summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xc/config/cf/X11.tmpl3
-rw-r--r--xc/config/cf/host.def98
-rw-r--r--xc/config/cf/xfree86.cf20
-rw-r--r--xc/config/util/added.cmd23
-rw-r--r--xc/config/util/instos2.cmd13
-rw-r--r--xc/config/util/os2inst.cmd50
-rw-r--r--xc/config/util/remove.cmd14
-rw-r--r--xc/config/util/xmkmf.cmd81
-rw-r--r--xc/extras/Mesa/docs/RELNOTES-4.0.473
-rw-r--r--xc/extras/Mesa/docs/RELNOTES-5.085
-rw-r--r--xc/extras/Mesa/docs/VERSIONS296
-rw-r--r--xc/extras/Mesa/include/GL/gl.h754
-rw-r--r--xc/extras/Mesa/include/GL/glext.h8
-rw-r--r--xc/extras/Mesa/include/GL/osmesa.h15
-rw-r--r--xc/extras/Mesa/include/GL/xmesa.h17
-rw-r--r--xc/extras/Mesa/include/GL/xmesa_x.h1
-rw-r--r--xc/extras/Mesa/include/GL/xmesa_xf86.h1
-rw-r--r--xc/extras/Mesa/src/OSmesa/osmesa.c142
-rw-r--r--xc/extras/Mesa/src/SPARC/glapi_sparc.S3549
-rw-r--r--xc/extras/Mesa/src/SPARC/sparc.c2
-rw-r--r--xc/extras/Mesa/src/X/fakeglx.c879
-rw-r--r--xc/extras/Mesa/src/X/glxapi.c33
-rw-r--r--xc/extras/Mesa/src/X/glxapi.h9
-rw-r--r--xc/extras/Mesa/src/X/glxheader.h5
-rw-r--r--xc/extras/Mesa/src/X/realglx.c8
-rw-r--r--xc/extras/Mesa/src/X/realglx.h13
-rw-r--r--xc/extras/Mesa/src/X/xfonts.c14
-rw-r--r--xc/extras/Mesa/src/X/xm_api.c190
-rw-r--r--xc/extras/Mesa/src/X/xm_dd.c255
-rw-r--r--xc/extras/Mesa/src/X/xm_line.c9
-rw-r--r--xc/extras/Mesa/src/X/xm_span.c86
-rw-r--r--xc/extras/Mesa/src/X/xm_tri.c226
-rw-r--r--xc/extras/Mesa/src/X/xmesaP.h28
-rw-r--r--xc/extras/Mesa/src/X86/3dnow.c23
-rw-r--r--xc/extras/Mesa/src/X86/3dnow.h1
-rw-r--r--xc/extras/Mesa/src/X86/3dnow_normal.S81
-rw-r--r--xc/extras/Mesa/src/X86/3dnow_vertex.S220
-rw-r--r--xc/extras/Mesa/src/X86/assyntax.h8
-rw-r--r--xc/extras/Mesa/src/X86/clip_args.h2
-rw-r--r--xc/extras/Mesa/src/X86/common_x86.c117
-rw-r--r--xc/extras/Mesa/src/X86/common_x86_asm.S192
-rw-r--r--xc/extras/Mesa/src/X86/common_x86_asm.h3
-rw-r--r--xc/extras/Mesa/src/X86/common_x86_features.h61
-rw-r--r--xc/extras/Mesa/src/X86/common_x86_macros.h7
-rw-r--r--xc/extras/Mesa/src/X86/gen_matypes.c79
-rw-r--r--xc/extras/Mesa/src/X86/glapi_x86.S2456
-rw-r--r--xc/extras/Mesa/src/X86/mmx.h18
-rw-r--r--xc/extras/Mesa/src/X86/mmx_blend.S620
-rw-r--r--xc/extras/Mesa/src/X86/mmx_blendtmp.h113
-rw-r--r--xc/extras/Mesa/src/X86/norm_args.h3
-rw-r--r--xc/extras/Mesa/src/X86/sse.c18
-rw-r--r--xc/extras/Mesa/src/X86/sse.h2
-rw-r--r--xc/extras/Mesa/src/X86/sse_normal.S13
-rw-r--r--xc/extras/Mesa/src/X86/sse_vertex.S182
-rw-r--r--xc/extras/Mesa/src/X86/x86.c12
-rw-r--r--xc/extras/Mesa/src/X86/x86.h1
-rw-r--r--xc/extras/Mesa/src/X86/x86_cliptest.S2
-rw-r--r--xc/extras/Mesa/src/X86/xform_args.h2
-rw-r--r--xc/extras/Mesa/src/accum.c13
-rw-r--r--xc/extras/Mesa/src/all.h94
-rw-r--r--xc/extras/Mesa/src/api_arrayelt.c11
-rw-r--r--xc/extras/Mesa/src/api_eval.c27
-rw-r--r--xc/extras/Mesa/src/api_loopback.c310
-rw-r--r--xc/extras/Mesa/src/api_noop.c86
-rw-r--r--xc/extras/Mesa/src/api_noop.h9
-rw-r--r--xc/extras/Mesa/src/api_validate.c33
-rw-r--r--xc/extras/Mesa/src/array_cache/ac_context.c60
-rw-r--r--xc/extras/Mesa/src/array_cache/ac_context.h10
-rw-r--r--xc/extras/Mesa/src/array_cache/ac_import.c192
-rw-r--r--xc/extras/Mesa/src/array_cache/acache.h34
-rw-r--r--xc/extras/Mesa/src/attrib.c178
-rw-r--r--xc/extras/Mesa/src/blend.c42
-rw-r--r--xc/extras/Mesa/src/buffers.c227
-rw-r--r--xc/extras/Mesa/src/clip.c19
-rw-r--r--xc/extras/Mesa/src/colormac.h11
-rw-r--r--xc/extras/Mesa/src/colortab.c14
-rw-r--r--xc/extras/Mesa/src/config.h19
-rw-r--r--xc/extras/Mesa/src/context.c856
-rw-r--r--xc/extras/Mesa/src/context.h68
-rw-r--r--xc/extras/Mesa/src/convolve.c7
-rw-r--r--xc/extras/Mesa/src/dd.h104
-rw-r--r--xc/extras/Mesa/src/debug.c14
-rw-r--r--xc/extras/Mesa/src/depth.c15
-rw-r--r--xc/extras/Mesa/src/dispatch.c30
-rw-r--r--xc/extras/Mesa/src/dlist.c558
-rw-r--r--xc/extras/Mesa/src/dlist.h19
-rw-r--r--xc/extras/Mesa/src/drawpix.c102
-rw-r--r--xc/extras/Mesa/src/enable.c1719
-rw-r--r--xc/extras/Mesa/src/enums.c72
-rw-r--r--xc/extras/Mesa/src/eval.c1102
-rw-r--r--xc/extras/Mesa/src/extensions.c102
-rw-r--r--xc/extras/Mesa/src/extensions.h6
-rw-r--r--xc/extras/Mesa/src/feedback.c10
-rw-r--r--xc/extras/Mesa/src/fog.c4
-rw-r--r--xc/extras/Mesa/src/get.c2074
-rw-r--r--xc/extras/Mesa/src/glapi.c1619
-rw-r--r--xc/extras/Mesa/src/glapi.h4
-rw-r--r--xc/extras/Mesa/src/glapioffsets.h78
-rw-r--r--xc/extras/Mesa/src/glapitable.h86
-rw-r--r--xc/extras/Mesa/src/glapitemp.h3886
-rw-r--r--xc/extras/Mesa/src/glheader.h18
-rw-r--r--xc/extras/Mesa/src/glprocs.h814
-rw-r--r--xc/extras/Mesa/src/glthread.c48
-rw-r--r--xc/extras/Mesa/src/glthread.h40
-rw-r--r--xc/extras/Mesa/src/hash.c106
-rw-r--r--xc/extras/Mesa/src/hash.h7
-rw-r--r--xc/extras/Mesa/src/highpc.c120
-rw-r--r--xc/extras/Mesa/src/hint.c45
-rw-r--r--xc/extras/Mesa/src/hint.h7
-rw-r--r--xc/extras/Mesa/src/histogram.c5
-rw-r--r--xc/extras/Mesa/src/histogram.h11
-rw-r--r--xc/extras/Mesa/src/image.c112
-rw-r--r--xc/extras/Mesa/src/image.h9
-rw-r--r--xc/extras/Mesa/src/imports.c657
-rw-r--r--xc/extras/Mesa/src/imports.h177
-rw-r--r--xc/extras/Mesa/src/light.c113
-rw-r--r--xc/extras/Mesa/src/light.h2
-rw-r--r--xc/extras/Mesa/src/lines.c5
-rw-r--r--xc/extras/Mesa/src/lowpc.c30
-rw-r--r--xc/extras/Mesa/src/macros.h32
-rw-r--r--xc/extras/Mesa/src/math/m_debug.h3
-rw-r--r--xc/extras/Mesa/src/math/m_debug_clip.c55
-rw-r--r--xc/extras/Mesa/src/math/m_debug_norm.c98
-rw-r--r--xc/extras/Mesa/src/math/m_debug_util.h12
-rw-r--r--xc/extras/Mesa/src/math/m_debug_xform.c41
-rw-r--r--xc/extras/Mesa/src/math/m_matrix.c290
-rw-r--r--xc/extras/Mesa/src/math/m_norm_tmp.h162
-rw-r--r--xc/extras/Mesa/src/math/m_translate.c6
-rw-r--r--xc/extras/Mesa/src/math/m_vector.c30
-rw-r--r--xc/extras/Mesa/src/math/m_xform.c4
-rw-r--r--xc/extras/Mesa/src/math/m_xform.h5
-rw-r--r--xc/extras/Mesa/src/matrix.c272
-rw-r--r--xc/extras/Mesa/src/mem.c251
-rw-r--r--xc/extras/Mesa/src/mem.h179
-rw-r--r--xc/extras/Mesa/src/mmath.c12
-rw-r--r--xc/extras/Mesa/src/mmath.h148
-rw-r--r--xc/extras/Mesa/src/mtypes.h598
-rw-r--r--xc/extras/Mesa/src/pixel.c29
-rw-r--r--xc/extras/Mesa/src/points.c127
-rw-r--r--xc/extras/Mesa/src/points.h14
-rw-r--r--xc/extras/Mesa/src/polygon.c28
-rw-r--r--xc/extras/Mesa/src/rastpos.c152
-rw-r--r--xc/extras/Mesa/src/rastpos.h4
-rw-r--r--xc/extras/Mesa/src/state.c180
-rw-r--r--xc/extras/Mesa/src/stencil.c66
-rw-r--r--xc/extras/Mesa/src/stencil.h7
-rw-r--r--xc/extras/Mesa/src/swrast/s_aaline.c25
-rw-r--r--xc/extras/Mesa/src/swrast/s_aalinetemp.h131
-rw-r--r--xc/extras/Mesa/src/swrast/s_aatriangle.c70
-rw-r--r--xc/extras/Mesa/src/swrast/s_aatritemp.h308
-rw-r--r--xc/extras/Mesa/src/swrast/s_accum.c30
-rw-r--r--xc/extras/Mesa/src/swrast/s_alpha.c243
-rw-r--r--xc/extras/Mesa/src/swrast/s_alpha.h9
-rw-r--r--xc/extras/Mesa/src/swrast/s_alphabuf.c114
-rw-r--r--xc/extras/Mesa/src/swrast/s_bitmap.c186
-rw-r--r--xc/extras/Mesa/src/swrast/s_blend.c236
-rw-r--r--xc/extras/Mesa/src/swrast/s_blend.h14
-rw-r--r--xc/extras/Mesa/src/swrast/s_buffers.c130
-rw-r--r--xc/extras/Mesa/src/swrast/s_context.c224
-rw-r--r--xc/extras/Mesa/src/swrast/s_context.h110
-rw-r--r--xc/extras/Mesa/src/swrast/s_copypix.c411
-rw-r--r--xc/extras/Mesa/src/swrast/s_depth.c129
-rw-r--r--xc/extras/Mesa/src/swrast/s_depth.h11
-rw-r--r--xc/extras/Mesa/src/swrast/s_drawpix.c387
-rw-r--r--xc/extras/Mesa/src/swrast/s_fog.c183
-rw-r--r--xc/extras/Mesa/src/swrast/s_fog.h27
-rw-r--r--xc/extras/Mesa/src/swrast/s_imaging.c29
-rw-r--r--xc/extras/Mesa/src/swrast/s_lines.c1260
-rw-r--r--xc/extras/Mesa/src/swrast/s_linetemp.h96
-rw-r--r--xc/extras/Mesa/src/swrast/s_logic.c110
-rw-r--r--xc/extras/Mesa/src/swrast/s_logic.h26
-rw-r--r--xc/extras/Mesa/src/swrast/s_masking.c125
-rw-r--r--xc/extras/Mesa/src/swrast/s_masking.h32
-rw-r--r--xc/extras/Mesa/src/swrast/s_pb.c517
-rw-r--r--xc/extras/Mesa/src/swrast/s_pb.h244
-rw-r--r--xc/extras/Mesa/src/swrast/s_pixeltex.c64
-rw-r--r--xc/extras/Mesa/src/swrast/s_pixeltex.h9
-rw-r--r--xc/extras/Mesa/src/swrast/s_points.c37
-rw-r--r--xc/extras/Mesa/src/swrast/s_points.h5
-rw-r--r--xc/extras/Mesa/src/swrast/s_pointtemp.h406
-rw-r--r--xc/extras/Mesa/src/swrast/s_readpix.c27
-rw-r--r--xc/extras/Mesa/src/swrast/s_scissor.c64
-rw-r--r--xc/extras/Mesa/src/swrast/s_span.c1764
-rw-r--r--xc/extras/Mesa/src/swrast/s_span.h48
-rw-r--r--xc/extras/Mesa/src/swrast/s_stencil.c387
-rw-r--r--xc/extras/Mesa/src/swrast/s_stencil.h11
-rw-r--r--xc/extras/Mesa/src/swrast/s_texstore.c167
-rw-r--r--xc/extras/Mesa/src/swrast/s_texture.c2783
-rw-r--r--xc/extras/Mesa/src/swrast/s_texture.h11
-rw-r--r--xc/extras/Mesa/src/swrast/s_triangle.c838
-rw-r--r--xc/extras/Mesa/src/swrast/s_trispan.h62
-rw-r--r--xc/extras/Mesa/src/swrast/s_tritemp.h190
-rw-r--r--xc/extras/Mesa/src/swrast/s_zoom.c474
-rw-r--r--xc/extras/Mesa/src/swrast/s_zoom.h32
-rw-r--r--xc/extras/Mesa/src/swrast/swrast.h244
-rw-r--r--xc/extras/Mesa/src/swrast_setup/ss_context.c29
-rw-r--r--xc/extras/Mesa/src/swrast_setup/ss_context.h13
-rw-r--r--xc/extras/Mesa/src/swrast_setup/ss_triangle.c38
-rw-r--r--xc/extras/Mesa/src/swrast_setup/ss_triangle.h3
-rw-r--r--xc/extras/Mesa/src/swrast_setup/ss_tritmp.h15
-rw-r--r--xc/extras/Mesa/src/swrast_setup/ss_vb.c65
-rw-r--r--xc/extras/Mesa/src/swrast_setup/ss_vb.h3
-rw-r--r--xc/extras/Mesa/src/swrast_setup/ss_vbtmp.h14
-rw-r--r--xc/extras/Mesa/src/swrast_setup/swrast_setup.h3
-rw-r--r--xc/extras/Mesa/src/texcompress.c154
-rw-r--r--xc/extras/Mesa/src/texcompress.h (renamed from xc/extras/Mesa/src/swrast/s_scissor.h)37
-rw-r--r--xc/extras/Mesa/src/texformat.c247
-rw-r--r--xc/extras/Mesa/src/texformat.h40
-rw-r--r--xc/extras/Mesa/src/texformat_tmp.h202
-rw-r--r--xc/extras/Mesa/src/teximage.c1181
-rw-r--r--xc/extras/Mesa/src/teximage.h7
-rw-r--r--xc/extras/Mesa/src/texobj.c67
-rw-r--r--xc/extras/Mesa/src/texobj.h2
-rw-r--r--xc/extras/Mesa/src/texstate.c804
-rw-r--r--xc/extras/Mesa/src/texstate.h6
-rw-r--r--xc/extras/Mesa/src/texstore.c783
-rw-r--r--xc/extras/Mesa/src/texstore.h38
-rw-r--r--xc/extras/Mesa/src/texutil.c172
-rw-r--r--xc/extras/Mesa/src/texutil.h2
-rw-r--r--xc/extras/Mesa/src/texutil_tmp.h71
-rw-r--r--xc/extras/Mesa/src/tnl/t_array_api.c114
-rw-r--r--xc/extras/Mesa/src/tnl/t_array_import.c161
-rw-r--r--xc/extras/Mesa/src/tnl/t_context.c17
-rw-r--r--xc/extras/Mesa/src/tnl/t_context.h263
-rw-r--r--xc/extras/Mesa/src/tnl/t_eval_api.c38
-rw-r--r--xc/extras/Mesa/src/tnl/t_imm_alloc.c32
-rw-r--r--xc/extras/Mesa/src/tnl/t_imm_alloc.h5
-rw-r--r--xc/extras/Mesa/src/tnl/t_imm_api.c488
-rw-r--r--xc/extras/Mesa/src/tnl/t_imm_api.h8
-rw-r--r--xc/extras/Mesa/src/tnl/t_imm_debug.c205
-rw-r--r--xc/extras/Mesa/src/tnl/t_imm_debug.h3
-rw-r--r--xc/extras/Mesa/src/tnl/t_imm_dlist.c124
-rw-r--r--xc/extras/Mesa/src/tnl/t_imm_dlist.h3
-rw-r--r--xc/extras/Mesa/src/tnl/t_imm_elt.c73
-rw-r--r--xc/extras/Mesa/src/tnl/t_imm_elt.h3
-rw-r--r--xc/extras/Mesa/src/tnl/t_imm_eval.c431
-rw-r--r--xc/extras/Mesa/src/tnl/t_imm_exec.c217
-rw-r--r--xc/extras/Mesa/src/tnl/t_imm_exec.h3
-rw-r--r--xc/extras/Mesa/src/tnl/t_imm_fixup.c352
-rw-r--r--xc/extras/Mesa/src/tnl/t_pipeline.c10
-rw-r--r--xc/extras/Mesa/src/tnl/t_pipeline.h4
-rw-r--r--xc/extras/Mesa/src/tnl/t_vb_cliptmp.h37
-rw-r--r--xc/extras/Mesa/src/tnl/t_vb_fog.c67
-rw-r--r--xc/extras/Mesa/src/tnl/t_vb_light.c32
-rw-r--r--xc/extras/Mesa/src/tnl/t_vb_lighttmp.h116
-rw-r--r--xc/extras/Mesa/src/tnl/t_vb_normals.c36
-rw-r--r--xc/extras/Mesa/src/tnl/t_vb_points.c29
-rw-r--r--xc/extras/Mesa/src/tnl/t_vb_render.c40
-rw-r--r--xc/extras/Mesa/src/tnl/t_vb_rendertmp.h3
-rw-r--r--xc/extras/Mesa/src/tnl/t_vb_texgen.c48
-rw-r--r--xc/extras/Mesa/src/tnl/t_vb_texmat.c33
-rw-r--r--xc/extras/Mesa/src/tnl/t_vb_vertex.c66
-rw-r--r--xc/extras/Mesa/src/tnl/t_vtx_api.c808
-rw-r--r--xc/extras/Mesa/src/tnl/t_vtx_api.h234
-rw-r--r--xc/extras/Mesa/src/tnl/t_vtx_exec.c632
-rw-r--r--xc/extras/Mesa/src/tnl/t_vtx_sse.c91
-rw-r--r--xc/extras/Mesa/src/tnl/t_vtx_x86.c705
-rw-r--r--xc/extras/Mesa/src/tnl/tnl.h3
-rw-r--r--xc/extras/Mesa/src/tnl_dd/t_dd.c3
-rw-r--r--xc/extras/Mesa/src/tnl_dd/t_dd_dmatmp.h25
-rw-r--r--xc/extras/Mesa/src/tnl_dd/t_dd_rendertmp.h3
-rw-r--r--xc/extras/Mesa/src/tnl_dd/t_dd_tritmp.h3
-rw-r--r--xc/extras/Mesa/src/tnl_dd/t_dd_unfilled.h3
-rw-r--r--xc/extras/Mesa/src/tnl_dd/t_dd_vb.c77
-rw-r--r--xc/extras/Mesa/src/tnl_dd/t_dd_vbtmp.h35
-rw-r--r--xc/extras/Mesa/src/tnl_dd/t_dd_vertex.h3
-rw-r--r--xc/extras/Mesa/src/varray.c297
-rw-r--r--xc/extras/Mesa/src/varray.h20
-rw-r--r--xc/extras/Mesa/src/vtxfmt.c25
-rw-r--r--xc/extras/Mesa/src/vtxfmt.h9
-rw-r--r--xc/extras/Mesa/src/vtxfmt_tmp.h193
-rw-r--r--xc/extras/ogl-sample/README.XF8626
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/macros/GNUmakefile48
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/macros/mkhead.awk290
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/macros/mkhead.ftn.awk339
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/macros/setup36
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/macros/setup.ftn31
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mandefs183
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/GNUmakefile53
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/README93
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/ftn/Distfile142
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/ftn/GNUmakefile100
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/ftn/Imakefile874
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/ftn/f1
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/html/Distfile141
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/html/GNUmakefile67
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/html_ftn/Distfile141
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/html_ftn/GNUmakefile67
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/pages105
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/Distfile142
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/GNUmakefile95
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/Imakefile874
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/RULES89
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/accum.gl170
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/activetextureARB.gl70
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/alphafunc.gl128
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/aretexturesresident.gl106
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/arrayelement.gl106
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/begin.gl229
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/bindtexture.gl128
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/bitmap.gl138
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/blendcolor.gl65
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/blendequation.gl163
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/blendfunc.gl264
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/c2
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/calllist.gl77
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/calllists.gl177
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/clear.gl115
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/clearaccum.gl58
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/clearcolor.gl57
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/cleardepth.gl53
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/clearindex.gl64
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/clearstencil.gl62
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/clientactivetextureARB.gl71
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/clipplane.gl95
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/color.gl103
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/colormask.gl73
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/colormaterial.gl108
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/colorpointer.gl145
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/colorsubtable.gl127
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/colortable.gl317
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/colortableparameter.gl94
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/const.awk104
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/convolutionfilter1d.gl231
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/convolutionfilter2d.gl246
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/convolutionparameter.gl165
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/copycolorsubtable.gl88
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/copycolortable.gl173
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/copyconvolutionfilter1d.gl177
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/copyconvolutionfilter2d.gl188
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/copypixels.gl258
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/copyteximage1d.gl178
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/copyteximage2d.gl182
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/copytexsubimage1d.gl138
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/copytexsubimage2d.gl154
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/copytexsubimage3d.gl159
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/cullface.gl75
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/deletelists.gl64
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/deletetextures.gl75
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/depthfunc.gl105
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/depthmask.gl63
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/depthrange.gl79
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/drawarrays.gl116
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/drawbuffer.gl158
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/drawelements.gl122
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/drawpixels.gl559
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/drawrangeelements.gl145
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/edgeflag.gl76
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/edgeflagpointer.gl122
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/enable.gl516
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/enableclientstate.gl134
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/evalcoord.gl208
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/evalmesh.gl189
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/evalpoint.gl111
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/feedbackbuffer.gl237
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/finish.gl53
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/flush.gl65
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/fog.gl202
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/frontface.gl83
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/frustum.gl142
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/genlists.gl66
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/gentextures.gl77
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/get.gl1791
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/getclipplane.gl67
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/getcolortable.gl155
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/getcolortableparameter.gl124
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/getconvolutionfilter.gl158
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/getconvolutionparameter.gl121
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/geterror.gl121
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/gethistogram.gl154
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/gethistogramparameter.gl110
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/getlight.gl192
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/getmap.gl132
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/getmaterial.gl138
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/getminmax.gl161
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/getminmaxparameter.gl83
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/getpixelmap.gl160
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/getpointerv.gl98
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/getpolygonstipple.gl69
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/getseparablefilter.gl163
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/getstring.gl104
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/gettexenv.gl85
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/gettexgen.gl105
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/getteximage.gl218
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/gettexlevelparameter.gl184
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/gettexparameter.gl147
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/hint.gl118
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/histogram.gl151
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/index.gl77
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/indexmask.gl74
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/indexpointer.gl138
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/initnames.gl57
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/interleavedarrays.gl130
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/isenabled.gl177
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/islist.gl55
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/istexture.gl63
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/light.gl240
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/lightmodel.gl172
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/linestipple.gl100
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/linewidth.gl113
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/listbase.gl56
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/loadidentity.gl75
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/loadmatrix.gl108
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/loadname.gl65
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/logicop.gl129
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/map1.gl268
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/map2.gl317
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/mapgrid.gl125
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/material.gl200
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/matrixmode.gl81
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/minmax.gl134
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/multitexcoordARB.gl102
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/multmatrix.gl132
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/newlist.gl163
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/normal.gl87
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/normalpointer.gl138
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/ortho.gl114
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/passthrough.gl72
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/pixelmap.gl250
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/pixelstore.gl513
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/pixeltransfer.gl446
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/pixelzoom.gl75
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/pointsize.gl145
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/polygonmode.gl117
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/polygonoffset.gl87
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/polygonstipple.gl97
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/prioritizetextures.gl98
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/pushattrib.gl279
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/pushclientattrib.gl111
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/pushmatrix.gl107
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/pushname.gl81
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/rasterpos.gl173
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/readbuffer.gl98
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/readpixels.gl357
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/rect.gl77
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/rendermode.gl124
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/resethistogram.gl55
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/resetminmax.gl58
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/rotate.gl114
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/scale.gl99
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/scissor.gl81
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/selectbuffer.gl127
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/separablefilter2d.gl254
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/shademodel.gl104
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/stencilfunc.gl159
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/stencilmask.gl70
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/stencilop.gl155
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/texcoord.gl92
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/texcoordpointer.gl154
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/texenv.gl183
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/texgen.gl243
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/teximage1d.gl461
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/teximage2d.gl487
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/teximage3d.gl488
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/texparameter.gl335
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/texsubimage1d.gl212
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/texsubimage2d.gl217
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/texsubimage3d.gl241
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/translate.gl94
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/vertex.gl76
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/vertexpointer.gl143
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/standard/viewport.gl84
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/style4
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/mangl/template86
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/GNUmakefile55
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/ftn/Distfile64
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/ftn/GNUmakefile102
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/ftn/Imakefile216
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/ftn/f1
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/html/Distfile63
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/html/GNUmakefile68
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/html_ftn/Distfile63
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/html_ftn/GNUmakefile69
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/Distfile64
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/GNUmakefile93
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/Imakefile216
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/begincurve.gl79
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/beginpolygon.gl89
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/beginsurface.gl84
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/begintrim.gl120
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/build1dmipmaplevels.gl229
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/build1dmipmaps.gl235
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/build2dmipmaplevels.gl234
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/build2dmipmaps.gl242
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/build3dmipmaplevels.gl236
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/build3dmipmaps.gl243
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/c2
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/checkextension.gl68
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/cylinder.gl77
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/deletenurbsrenderer.gl52
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/deletequadric.gl52
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/deletetess.gl51
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/disk.gl79
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/errorstring.gl65
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/getnurbsproperty.gl68
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/getstring.gl85
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/gettessproperty.gl63
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/loadsamplingmatrices.gl71
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/lookat.gl108
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/newnurbsrenderer.gl51
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/newquadric.gl53
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/newtess.gl50
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/nextcontour.gl117
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/nurbscallback.gl241
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/nurbscallbackdata.gl56
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/nurbscallbackdataext.gl53
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/nurbscurve.gl104
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/nurbsproperty.gl215
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/nurbssurface.gl121
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/ortho2d.gl54
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/partialdisk.gl92
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/perspective.gl106
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/pickmatrix.gl105
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/project.gl91
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/pwlcurve.gl78
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/quadriccallback.gl64
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/quadricdrawstyle.gl72
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/quadricnormals.gl66
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/quadricorientation.gl64
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/quadrictexture.gl60
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/scaleimage.gl175
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/sphere.gl77
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/tessbegincontour.gl58
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/tessbeginpolygon.gl88
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/tesscallback.gl307
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/tessendpolygon.gl86
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/tessnormal.gl78
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/tessproperty.gl112
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/tessvertex.gl112
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/unproject.gl83
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglu/standard/unproject4.gl102
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglw/Distfile11
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglw/GNUmakefile83
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglw/glwcreatemdrawingarea.gl50
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglw/glwdrawingarea.gl485
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglw/glwdrawingareamakecurrent.gl30
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manglw/glwdrawingareaswapbuffers.gl30
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/manrules181
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/tools/GNUmakefile49
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/tools/constCheck.pl160
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/tools/glman57
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/tools/man2html608
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/tools/mdate.pl50
-rwxr-xr-xxc/extras/ogl-sample/main/doc/man/tools/mmdoc220
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/Distfile212
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/GNUmakefile108
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/Imakefile66
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/exports.ls106
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/include/gluos.h25
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/GNUmakefile54
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/Imakefile43
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/GNUmakefile75
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Imakefile63
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierEval.cc256
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierEval.h55
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierPatch.cc205
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierPatch.h111
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierPatchMesh.cc613
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierPatchMesh.h127
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glcurveval.cc400
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glcurveval.h158
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glimports.h48
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glinterface.cc468
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glrenderer.cc303
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glrenderer.h145
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glsurfeval.cc1293
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glsurfeval.h404
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/incurveeval.cc209
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/insurfeval.cc2067
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/mystdio.h66
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/mystdlib.h63
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/GNUmakefile160
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Imakefile98
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arc.cc356
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arc.h139
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arcsorter.cc174
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arcsorter.h79
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arctess.cc609
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arctess.h72
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/backend.cc591
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/backend.h119
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/basiccrveval.cc140
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/basiccrveval.h67
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/basicsurfeval.cc230
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/basicsurfeval.h95
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bezierarc.h57
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bin.cc168
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bin.h127
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bufpool.cc109
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bufpool.h145
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/cachingeval.cc80
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/cachingeval.h56
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/ccw.cc567
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/coveandtiler.cc442
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/coveandtiler.h78
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curve.cc203
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curve.h76
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curvelist.cc112
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curvelist.h68
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curvesub.cc105
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/dataTransform.cc206
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/dataTransform.h66
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/defines.h56
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/displaylist.cc84
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/displaylist.h84
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/displaymode.h47
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/flist.cc120
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/flist.h65
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/flistsorter.cc83
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/flistsorter.h58
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/gridline.h52
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/gridtrimvertex.h95
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/gridvertex.h54
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/hull.cc167
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/hull.h74
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/intersect.cc662
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/jarcloc.h93
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/knotvector.cc138
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/knotvector.h68
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdesc.cc843
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdesc.h277
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdescv.cc243
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/maplist.cc117
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/maplist.h87
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mesher.cc488
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mesher.h89
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/monoTriangulationBackend.cc397
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/monotonizer.cc262
-rw-r--r--xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/monotonizer.h47
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/myassert.h57
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mycode.cc69
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mymath.h77
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mysetjmp.h91
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mystring.h62
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/nurbsconsts.h126
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/nurbsinterfac.cc539
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/nurbstess.cc693
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/nurbstess.h178
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/patch.cc508
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/patch.h100
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/patchlist.cc172
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/patchlist.h98
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/pwlarc.h84
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/quilt.cc278
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/quilt.h98
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/reader.cc148
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/reader.h138
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/renderhints.cc135
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/renderhints.h66
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/simplemath.h56
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/slicer.cc1287
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/slicer.h90
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/sorter.cc141
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/sorter.h57
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/splitarcs.cc295
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/subdivider.cc912
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/subdivider.h206
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/tobezier.cc689
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimline.cc222
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimline.h109
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimregion.cc116
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimregion.h90
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimvertex.h69
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimvertpool.cc121
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimvertpool.h63
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/types.h53
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/uarray.cc74
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/uarray.h61
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/varray.cc146
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/varray.h74
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/GNUmakefile99
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Imakefile72
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/definitions.h47
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/directedLine.cc846
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/directedLine.h178
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/glimports.h48
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/gridWrap.cc295
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/gridWrap.h144
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoChain.cc934
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoChain.h110
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoPolyPart.cc300
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoPolyPart.h47
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoTriangulation.cc1479
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoTriangulation.h192
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/mystdio.h66
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/mystdlib.h62
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/partitionX.cc164
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/partitionX.h61
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/partitionY.cc838
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/partitionY.h104
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyDBG.cc730
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyDBG.h75
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyUtil.cc92
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyUtil.h50
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/primitiveStream.cc192
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/primitiveStream.h116
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/quicksort.cc84
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/quicksort.h49
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/rectBlock.cc198
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/rectBlock.h89
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleComp.cc373
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleComp.h93
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompBot.cc846
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompBot.h145
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompRight.cc645
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompRight.h124
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompTop.cc1033
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompTop.h74
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleMonoPoly.cc2426
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleMonoPoly.h191
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampledLine.cc182
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampledLine.h78
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/searchTree.cc284
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/searchTree.h68
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/zlassert.h41
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/GNUmakefile110
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/Imakefile61
-rw-r--r--xc/extras/ogl-sample/main/gfx/lib/glu/libtess/README447
-rw-r--r--xc/extras/ogl-sample/main/gfx/lib/glu/libtess/alg-outline229
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/dict-list.h107
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/dict.c117
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/dict.h107
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/geom.c271
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/geom.h90
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/memalloc.c62
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/memalloc.h62
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/mesh.c796
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/mesh.h273
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/normal.c259
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/normal.h52
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq-heap.c259
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq-heap.h114
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq-sort.h124
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq.c267
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq.h124
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/render.c505
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/render.h59
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/sweep.c1358
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/sweep.h84
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/tess.c634
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/tess.h172
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/tessmono.c207
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libtess/tessmono.h77
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libutil/GNUmakefile68
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libutil/Imakefile57
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libutil/error.c87
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libutil/glue.c100
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libutil/gluint.h55
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libutil/mipmap.c8831
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libutil/project.c379
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libutil/quad.c1161
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glu/libutil/registry.c98
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glw/Distfile13
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glw/GLwDAUtil.c75
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.c732
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.h226
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawAP.h127
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.c39
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.h47
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawAP.h47
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glw/GNUmakefile74
-rwxr-xr-xxc/extras/ogl-sample/main/gfx/lib/glw/Imakefile50
-rw-r--r--xc/include/GL/glxproto.h11
-rw-r--r--xc/include/extensions/Imakefile2
-rw-r--r--xc/lib/GL/GL/GLos2.def428
-rw-r--r--xc/lib/GL/GL/GLos2.rsp6
-rw-r--r--xc/lib/GL/dri/Imakefile6
-rw-r--r--xc/lib/GL/dri/dri_glx.c370
-rw-r--r--xc/lib/GL/dri/dri_util.c150
-rw-r--r--xc/lib/GL/dri/dri_util.h82
-rw-r--r--xc/lib/GL/dri/drm/Imakefile3
-rw-r--r--xc/lib/GL/glx/compsize.c21
-rw-r--r--xc/lib/GL/glx/g_render.c132
-rw-r--r--xc/lib/GL/glx/glxclient.h73
-rw-r--r--xc/lib/GL/glx/glxcmds.c457
-rw-r--r--xc/lib/GL/glx/glxext.c7
-rw-r--r--xc/lib/GL/glx/indirect.h24
-rw-r--r--xc/lib/GL/glx/indirect_init.c33
-rw-r--r--xc/lib/GL/glx/indirect_wrap.h24
-rw-r--r--xc/lib/GL/glx/render2.c1
-rw-r--r--xc/lib/GL/glx/renderpix.c2
-rw-r--r--xc/lib/GL/glx/size.h1
-rw-r--r--xc/lib/GL/include/GL/internal/glcore.h2
-rw-r--r--xc/lib/GL/mesa/src/Imakefile.inc20
-rw-r--r--xc/lib/GL/mesa/src/OSmesa/OSmesa-def.cpp25
-rw-r--r--xc/lib/GL/mesa/src/X86/Imakefile3
-rw-r--r--xc/lib/GL/mesa/src/X86/Imakefile.inc18
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_context.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c6
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c4
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_points.c9
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_rendertmp.h42
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_state.c88
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c11
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c6
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h6
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c4
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c21
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_context.c13
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_context.h19
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_dd.c9
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_lock.c3
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_macros.h12
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_render.c20
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_screen.c19
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_span.c18
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_state.c151
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_tex.c24
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_texmem.c13
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_texstate.c6
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_tris.c13
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_vb.c195
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c12
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/Imakefile13
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810context.c49
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810context.h12
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810ioctl.c65
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810render.c23
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810screen.c30
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810screen.h6
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810span.c23
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810state.c66
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810tex.c13
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810texmem.c13
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810texstate.c9
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810tris.c14
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810vb.c25
-rw-r--r--xc/lib/GL/mesa/src/drv/i830/Imakefile11
-rw-r--r--xc/lib/GL/mesa/src/drv/i830/i830_context.c34
-rw-r--r--xc/lib/GL/mesa/src/drv/i830/i830_context.h11
-rw-r--r--xc/lib/GL/mesa/src/drv/i830/i830_debug.c4
-rw-r--r--xc/lib/GL/mesa/src/drv/i830/i830_ioctl.c75
-rw-r--r--xc/lib/GL/mesa/src/drv/i830/i830_render.c16
-rw-r--r--xc/lib/GL/mesa/src/drv/i830/i830_screen.c27
-rw-r--r--xc/lib/GL/mesa/src/drv/i830/i830_screen.h4
-rw-r--r--xc/lib/GL/mesa/src/drv/i830/i830_span.c19
-rw-r--r--xc/lib/GL/mesa/src/drv/i830/i830_state.c68
-rw-r--r--xc/lib/GL/mesa/src/drv/i830/i830_tex.c10
-rw-r--r--xc/lib/GL/mesa/src/drv/i830/i830_texmem.c3
-rw-r--r--xc/lib/GL/mesa/src/drv/i830/i830_texstate.c6
-rw-r--r--xc/lib/GL/mesa/src/drv/i830/i830_tris.c3
-rw-r--r--xc/lib/GL/mesa/src/drv/i830/i830_vb.c20
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c55
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h12
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgabuffers.c56
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgabuffers.h5
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgacontext.h12
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgadd.c21
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgaioctl.c133
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgaioctl.h10
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgapixel.c25
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgarender.c16
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgaspan.c26
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgastate.c47
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgatex.c36
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgatexcnv.c5
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgatexmem.c10
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgatris.c7
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgavb.c35
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_context.c32
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_context.h17
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_dd.c3
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c206
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_ioctl.h3
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_lock.c4
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_screen.c61
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_screen.h1
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_span.c47
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_state.c78
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_tex.c8
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_texmem.c4
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_texstate.c27
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_tris.c45
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_vb.c20
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_cmdbuf.c344
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_context.c672
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_context.h944
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_ioctl.c931
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_lock.c118
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_maos_arrays.c479
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_maos_vbtmp.h378
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_maos_verts.c338
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_pixel.c494
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_reg.h1438
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_sanity.c1435
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_sanity.h11
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_screen.c434
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_screen.h97
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_span.c430
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_state.c2155
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_state.h68
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_state_init.c696
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_swtcl.c1277
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_swtcl.h79
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_tcl.c555
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_tcl.h66
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_tex.c988
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_tex.h55
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_texmem.c809
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_texstate.c1799
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.c1148
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.h128
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_c.c797
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_sse.c95
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_x86.c462
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_vtxtmp_x86.S8
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_compat.c304
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_context.c452
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_context.h613
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c1319
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.h150
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c62
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_maos_arrays.c591
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_maos_vbtmp.h368
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_maos_verts.c335
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_sanity.c981
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c103
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_screen.h16
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_span.c52
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_state.c1648
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_state.h21
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_state_init.c558
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.c1191
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.c546
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.h66
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c245
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c88
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c500
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.c1437
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.h142
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_c.c802
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_sse.c87
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_x86.c462
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_vtxtmp_x86.S8
-rw-r--r--xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c22
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c264
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h7
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c4
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.c4
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_pixels.c11
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c8
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.c43
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_span.c52
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c77
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_tex.c8
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_texstate.c68
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_tris.c30
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_vb.c16
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_vbtmp.h8
-rw-r--r--xc/lib/GL/mesa/src/math/Imakefile.inc12
-rw-r--r--xc/lib/GL/mesa/src/swrast/Imakefile.inc12
-rw-r--r--xc/lib/GLU/GLU-def.cpp166
-rw-r--r--xc/lib/GLU/Imakefile133
-rw-r--r--xc/lib/GLU/include/Imakefile38
-rw-r--r--xc/lib/GLU/libnurbs/interface/Imakefile107
-rw-r--r--xc/lib/GLU/libnurbs/internals/Imakefile267
-rw-r--r--xc/lib/GLU/libnurbs/nurbtess/Imakefile150
-rw-r--r--xc/lib/GLU/libtess/Imakefile109
-rw-r--r--xc/lib/GLU/libutil/Imakefile84
-rw-r--r--xc/lib/GLw/GLwM1DrawA.c55
-rw-r--r--xc/lib/GLw/GLwM2DrawA.c55
-rw-r--r--xc/lib/GLw/GLwXm/PrimitiveP.h90
-rw-r--r--xc/lib/GLw/GLwXm/Xm.h143
-rw-r--r--xc/lib/GLw/GLwXm/XmP.h67
-rw-r--r--xc/lib/GLw/GLwXm/XmStrDefs.h121
-rw-r--r--xc/lib/GLw/Imakefile82
-rw-r--r--xc/lib/GLw/README.html242
-rw-r--r--xc/lib/GLw/README.txt199
-rw-r--r--xc/lib/font/FreeType/ftutil.c251
-rw-r--r--xc/lib/xtrans/Xtransos2.c886
-rw-r--r--xc/programs/Xserver/GL/dri/dri.c178
-rw-r--r--xc/programs/Xserver/GL/dri/dristruct.h5
-rw-r--r--xc/programs/Xserver/GL/dri/xf86dri.c61
-rw-r--r--xc/programs/Xserver/GL/glx/g_disptab.c44
-rw-r--r--xc/programs/Xserver/GL/glx/g_disptab.h8
-rw-r--r--xc/programs/Xserver/GL/glx/g_disptab_EXT.c270
-rw-r--r--xc/programs/Xserver/GL/glx/g_disptab_EXT.h12
-rw-r--r--xc/programs/Xserver/GL/glx/g_render.c37
-rw-r--r--xc/programs/Xserver/GL/glx/g_renderswap.c58
-rw-r--r--xc/programs/Xserver/GL/glx/glxcmds.c12
-rw-r--r--xc/programs/Xserver/GL/glx/glxscreens.c10
-rw-r--r--xc/programs/Xserver/GL/glx/glxserver.h2
-rw-r--r--xc/programs/Xserver/GL/glx/impsize.h2
-rw-r--r--xc/programs/Xserver/GL/glx/rensize.c9
-rw-r--r--xc/programs/Xserver/GL/glx/rensizetab.c4285
-rw-r--r--xc/programs/Xserver/GL/glx/singlesize.c5
-rw-r--r--xc/programs/Xserver/GL/glxmodule.c13
-rw-r--r--xc/programs/Xserver/GL/mesa/src/X/xf86glx.c70
-rw-r--r--xc/programs/Xserver/GL/mesa/src/X/xf86glxint.h2
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Dutch.lproj/InfoPlist.strings.cpp5
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/French.lproj/InfoPlist.strings.cpp5
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/German.lproj/InfoPlist.strings.cpp5
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/InfoPlist.strings.cpp5
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Preferences.h105
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Preferences.m517
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Spanish.lproj/InfoPlist.strings.cpp5
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Swedish.lproj/InfoPlist.strings.cpp5
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/XApplication.h20
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/XApplication.m20
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/XDarwin.pbproj/project.pbxproj1310
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/XDarwinStartup.c90
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/XView.h50
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/XView.m330
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/XWindow.h36
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/XWindow.m104
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Xserver.h70
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Xserver.m828
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/fakeBoxRec.h15
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/ko.lproj/InfoPlist.strings.cpp5
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/pseudoramiX.c420
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/pseudoramiX.h10
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/quartz.c513
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/quartz.h23
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/quartzAudio.c317
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/quartzAudio.h16
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/quartzCocoa.m122
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/quartzCommon.h68
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c572
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/quartzCursor.h17
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c125
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.h20
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/quartzShared.h43
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/quartzStartup.c114
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/rootless.h127
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/rootlessAqua.h15
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/rootlessAquaGlue.c226
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/rootlessAquaImp.h38
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/rootlessAquaImp.m237
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/rootlessCommon.c262
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/rootlessCommon.h214
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/rootlessGC.c1170
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/rootlessScreen.c426
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/rootlessValTree.c744
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/rootlessWindow.c674
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/rootlessWindow.h32
-rw-r--r--xc/programs/Xserver/hw/kdrive/linux/agp.c13
-rw-r--r--xc/programs/Xserver/hw/xfree86/Imakefile2
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86Mode.c84
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.SOLX86231
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/sgml/SOLX86.sgml327
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile10
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c109
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c25
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h2
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h43
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c79
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accelfuncs.c98
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_common.h444
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_cursor.c3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c741
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c781
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_macros.h134
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h385
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h2
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c23
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c57
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c75
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c121
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/rendition/vvga.c352
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/rendition/vvga.h43
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c2
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_limits.h2
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_reg.h2
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/apSolx86.shar1339
-rw-r--r--xc/programs/Xserver/hw/xfree86/loader/README107
-rw-r--r--xc/programs/Xserver/hw/xfree86/loader/xf86sym.c1
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_video.c1742
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm.h153
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drmP.h11
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_dma.h66
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_drv.h2
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux14
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h161
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h16
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_agpsupport.h67
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_dma.h133
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_proc.h5
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c46
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.c22
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c2
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c20
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h161
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/mga_drv.h6
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128.h114
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon.h155
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_cp.c41
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_drm.h2
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_drv.h17
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_irq.c256
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_mem.c12
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_state.c2202
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h46
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/loadmod.c1
1094 files changed, 73711 insertions, 147220 deletions
diff --git a/xc/config/cf/X11.tmpl b/xc/config/cf/X11.tmpl
index 74b05aeb9..9be9d010c 100644
--- a/xc/config/cf/X11.tmpl
+++ b/xc/config/cf/X11.tmpl
@@ -517,7 +517,8 @@ VENDORMANVERSION = XVendorManVersionString
#define BuildOSMesaLib (BuildGlxExt && defined(XFree86Version))
#endif
#ifndef BuildGLULibrary
-#define BuildGLULibrary (BuildGLXLibrary && HasCplusplus)
+#define BuildGLULibrary (BuildGLXLibrary && HasCplusplus && \
+ !BuildServersOnly)
#endif
#ifndef BuildGLwLibrary
#define BuildGLwLibrary ((BuildGlxExt || BuildGLXLibrary) && \
diff --git a/xc/config/cf/host.def b/xc/config/cf/host.def
new file mode 100644
index 000000000..3ce43dcc7
--- /dev/null
+++ b/xc/config/cf/host.def
@@ -0,0 +1,98 @@
+/*
+ * Set this for each DRI branch. It will be appended to the XFree86 version
+ * information.
+ */
+#define XFree86CustomVersion "DRI trunk"
+
+
+/* Don't use any special flags by default, but leave this here commented out
+ * so people see how to if they want
+ */
+/*
+#define DefaultGcc2AxpOpt -O2 -mcpu=ev6
+#define DefaultGcc2PpcOpt -O2 -mcpu=750
+#define DefaultGcc2i386Opt -O2
+#if defined(AlphaArchitecture)
+# define LibraryCDebugFlags -O2 -mcpu=ev6
+#elif defined(PpcArchitecture)
+# define LibraryCDebugFlags -O2 -mcpu=750
+#else
+# define LibraryCDebugFlags -O2
+#endif
+*/
+
+
+#define BuildXFree86ConfigTools YES
+
+#if defined(PpcArchitecture)
+
+#define XF86CardDrivers ati
+#define DriDrivers r128 radeon r200
+
+#else
+
+#define XF86CardDrivers tdfx i810 mga ati glint vga
+#define DriDrivers r200 tdfx mga i810 r128 radeon gamma i830 ffb /* sis */
+
+#endif
+
+#define GccWarningOptions -Wall -Wpointer-arith -Wstrict-prototypes \
+ -Wmissing-prototypes -Wmissing-declarations \
+ -Wnested-externs
+#define DefaultCCOptions -ansi GccWarningOptions -pipe -g
+
+#define NormalLibGlx NO
+
+#define BuildXF86DRI YES
+
+/* To do profiling of the dynamically loaded 'xyz_dri.so' object, turn
+ * this on.
+ * Use 'xc/lib/GL/makeprofile.sh' to make it work.
+ */
+/* #define GlxSoProf YES */
+
+#ifdef GlxSoProf
+# undef DefaultCCOptions
+# define DefaultCCOptions -ansi GccWarningOptions -pipe -g -p
+#endif
+
+/* Optionally turn these on for debugging */
+/* #define GlxBuiltInTdfx YES */
+/* #define GlxBuiltInI810 YES */
+/* #define GlxBuiltInMga YES */
+/* #define GlxBuiltInR128 YES */
+/* #define GlxBuiltInRadeon YES */
+/* #define DoLoadableServer NO */
+
+/* Optionally turn this on to change the place where you install the build.
+ * Warning: trailing blanks will cause build failures.
+ */
+/* #define ProjectRoot /usr/X11R6-DRI */
+
+/* Optionally turn this on to force the kernel modules to build */
+/* #define BuildXF86DRM YES */
+
+#define XF86AFB NO
+
+#define XnestServer NO
+#define XVirtualFramebufferServer NO
+
+/*
+ * Don't change anything below or the build will fail.
+ */
+#define BuildServersOnly YES
+#define BuildXvLibrary YES
+#define BuildXvMCLibrary YES
+#define BuildLibrariesForXServers NO
+#define BuildLibrariesForConfigTools NO
+#define BuildXIE NO
+#define BuildPexExt NO
+#define XprtServer NO
+#define SharedLibFont NO
+#define XInputDrivers mouse
+#if DoLoadableServer
+#undef XF1Bpp
+#undef XF4Bpp
+#define XF1Bpp NO
+#define XF4Bpp NO
+#endif
diff --git a/xc/config/cf/xfree86.cf b/xc/config/cf/xfree86.cf
index 42d95cc0f..5243fdb39 100644
--- a/xc/config/cf/xfree86.cf
+++ b/xc/config/cf/xfree86.cf
@@ -292,7 +292,7 @@ XCOMM $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $
/*
* Amiga framebuffer module.
- * This is for build testing only. It isn't actually used on this platform.
+ * This is mostly for build testing, but the vesa driver references it.
*/
# ifndef XF86AFB
# define XF86AFB YES
@@ -337,7 +337,7 @@ XCOMM $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $
# endif
# ifndef DriDrivers
-# define DriDrivers gamma i810 i830 mga r128 radeon \
+# define DriDrivers gamma i810 i830 mga r128 radeon r200 \
/*sis*/ tdfx DevelDRIDrivers
# endif
#endif
@@ -421,7 +421,7 @@ XCOMM $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $
# define DevelDRIDrivers /**/
-# define DriDrivers gamma i810 mga r128 radeon \
+# define DriDrivers gamma i810 mga r128 radeon r200 \
TdfxDriDriver DevelDRIDrivers
#endif /*x86_64Arcitecture*/
@@ -768,7 +768,7 @@ XCOMM $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $
XF86OSCardDrivers XF86ExtraCardDrivers
# endif
# ifndef DriDrivers
-# define DriDrivers gamma tdfx mga r128 radeon /*sis*/
+# define DriDrivers gamma tdfx mga r128 radeon r200 /*sis*/
# endif
#endif
@@ -856,7 +856,7 @@ XCOMM $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $
XF86OSCardDrivers XF86ExtraCardDrivers
# endif
# ifndef DriDrivers
-# define DriDrivers gamma tdfx mga r128 radeon
+# define DriDrivers gamma tdfx mga r128 radeon r200
# endif
#endif
@@ -945,7 +945,7 @@ XCOMM $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $
# define TdfxDriDriver /**/
# endif
# ifndef DriDrivers
-# define DriDrivers gamma TdfxDriDriver mga r128 radeon
+# define DriDrivers gamma tdfx mga r128 radeon r200
# endif
#endif
@@ -1159,6 +1159,9 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8
# ifndef GlxBuiltInRadeon
# define GlxBuiltInRadeon NO
# endif
+# ifndef GlxBuiltInR200
+# define GlxBuiltInR200 NO
+# endif
# ifndef GlxBuiltInFfb
# define GlxBuiltInFfb NO
# endif
@@ -1172,6 +1175,7 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8
GlxBuiltInI830 || \
GlxBuiltInR128 || \
GlxBuiltInRadeon || \
+ GlxBuiltInR200 || \
GlxBuildInFfb || \
GlxBuiltInSIS
# define GlxDriverUsesMesa YES
@@ -1184,6 +1188,7 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8
GlxBuiltInI830 || \
GlxBuiltInR128 || \
GlxBuiltInRadeon || \
+ GlxBuiltInR200 || \
GlxBuiltInFfb || \
GlxBuiltInSIS
# define GlxUseBuiltInDRIDriver YES
@@ -1216,6 +1221,9 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8
# if GlxBuiltInRadeon
# define DriDrivers radeon
# endif
+# if GlxBuiltInR200
+# define DriDrivers r200
+# endif
# if GlxBuiltInSIS
# define DriDrivers sis
# endif
diff --git a/xc/config/util/added.cmd b/xc/config/util/added.cmd
deleted file mode 100644
index aa63f1688..000000000
--- a/xc/config/util/added.cmd
+++ /dev/null
@@ -1,23 +0,0 @@
-/* OS/2 REXX script to create nonexisting directories
- * run with 'added dirlist_file'
- * where dirlist_file is a XFree86 added-* file
- *
- * $XFree86: xc/config/util/added.cmd,v 3.0 1994/10/20 06:01:00 dawes Exp $
- */
-
-file = arg(1)
-linein(file,1,0)
-curdir = directory()
-do while lines(file)=1
- fs = strip(filespec("path",linein(file)),'t','/')
- newdir = directory(fs)
- if newdir='' then do
- say 'create directory='fs
- call directory(curdir)
- call 'xc\config\util\mkdirhier.cmd' fs
- end
- else do
- say 'found directory='newdir
- call directory(curdir)
- end
-end
diff --git a/xc/config/util/instos2.cmd b/xc/config/util/instos2.cmd
deleted file mode 100644
index 501cf6716..000000000
--- a/xc/config/util/instos2.cmd
+++ /dev/null
@@ -1,13 +0,0 @@
-@echo off
-rem $XFree86: xc/config/util/instos2.cmd,v 3.0 1996/01/24 21:56:14 dawes Exp $
-rem this file is supposed to run from the xc/ dir.
-rem you must copy it manually to there before using. It is just here
-rem in order not to be in the root dir.
-rem
-set GCCOPT=-pipe
-set EMXLOAD=5
-emxload make.exe gcc.exe rm.exe mv.exe
-make SHELL= MFLAGS="CC=gcc" install 2>&1 | tee instxc.log
-rem
-rem
-echo INSTALL OF XFREE86/OS2 IS FINISHED
diff --git a/xc/config/util/os2inst.cmd b/xc/config/util/os2inst.cmd
deleted file mode 100644
index 1a8d1ae5a..000000000
--- a/xc/config/util/os2inst.cmd
+++ /dev/null
@@ -1,50 +0,0 @@
-/* OS/2 REXX SCRIPT */
-
-/* $XFree86: xc/config/util/os2inst.cmd,v 3.1 1996/02/19 12:16:52 dawes Exp $
- *
- * This is a wrapper for the install command. As any utility,
- * install could have been lifted from the BSD sources, but I just wanted
- * to play with Rexx a bit :-) (hv)
- * Note the similarity to the Unix shell scripts
- */
-
-dst=""
-src=""
-
-'@ECHO OFF'
-PARSE ARG all
-DO i=1 TO WORDS(all)
- w = WORD(all,i)
- SELECT
- WHEN w = "-c" THEN NOP
- WHEN w = "-m" THEN
- i = i + 1
- /* ignore mode */
- WHEN w = "-o" THEN
- i = i + 1
- /* ignore owner */
- WHEN w = "-g" THEN
- i = i + 1
- /* ignore group */
- WHEN w = "-s" THEN NOP
- OTHERWISE
- IF src = "" THEN
- src = w
- ELSE
- dst = w
- END
-END
-
-IF src = "" THEN DO
- SAY "os2inst: no input file specified"
- EXIT 1
-END
-
-IF dst = "" THEN DO
- SAY "os2inst: no destination specified"
- EXIT 1
-END
-
-ADDRESS CMD 'copy' src dst '> nul'
-
-EXIT
diff --git a/xc/config/util/remove.cmd b/xc/config/util/remove.cmd
deleted file mode 100644
index a9c7a8ad0..000000000
--- a/xc/config/util/remove.cmd
+++ /dev/null
@@ -1,14 +0,0 @@
-/* OS/2 REXX script to remove cleaned files
- * run with 'remove dirlist_file'
- * where dirlist_file is be a XFree86 removed-* file
- *
- * $XFree86: xc/config/util/remove.cmd,v 3.0 1994/10/20 06:01:04 dawes Exp $
- */
-'@echo off'
-file = arg(1)
-linein(file,1,0)
-curdir = directory()
-do while lines(file)=1
- fs = translate(linein(file),'\','/')
- del fs
-end
diff --git a/xc/config/util/xmkmf.cmd b/xc/config/util/xmkmf.cmd
deleted file mode 100644
index 7c4b3d5f7..000000000
--- a/xc/config/util/xmkmf.cmd
+++ /dev/null
@@ -1,81 +0,0 @@
-/* OS/2 REXX */
-/* make a Makefile from an Imakefile from inside or outside the sources
- *
- * $XFree86: xc/config/util/xmkmf.cmd,v 3.1 1996/04/15 11:14:27 dawes Exp $
- */
-'@ECHO OFF'
-
-/* this is actually used here */
-x11root = getenv('X11ROOT')
-
-/* these ones are checked only, because later scripts rely on their existance */
-libpath = getenv('LIBRARY_PATH')
-incpath = getenv('C_INCLUDE_PATH')
-
-/* get args */
-PARSE ARG arg0 arg1 arg2 arg3
-
-/* from here almost everything is the same as in the xmkmf sh script */
-topdir = ''
-curdir = '.'
-do_all = 0
-
-IF arg0 = '-a' THEN DO
- do_all = 1
- arg0 = arg1
- arg1 = arg2
- arg2 = arg3
-END
-ELSE DO
- do_all = 0
-END
-
-IF \(arg0 = '') THEN DO
- IF \(arg1 = '') THEN
- curdir = arg1
- topdir = arg0
-END
-IF \(arg2 = '') | SUBSTR(topdir,1,1) = '-' THEN DO
- SAY 'usage: xmkmf [-a] [top_of_sources_pathname [current_directory]]'
- EXIT
-END
-
-IF exists('Makefile') THEN DO
- SAY 'mv -f Makefile Makefile.bak'
- 'COPY Makefile Makefile.bak >nul 2>&1'
- 'DEL Makefile >nul 2>&1'
-END
-
-IF topdir = '' THEN
- iargs = '-DUseInstalled -I'x11root'/XFree86/lib/X11/config'
-ELSE
- iargs = '-I'topdir'/config/cf -DTOPDIR='topdir' -DCURDIR='curdir
-
-SAY 'imake 'iargs
-IF do_all = 1 THEN DO
- 'imake 'iargs
- SAY 'make Makefiles'
- CALL make 'Makefiles'
- SAY 'make includes'
- CALL make 'includes'
- SAY 'make depend'
- CALL make 'depend'
-END
-ELSE
- 'imake 'iargs
-
-EXIT
-
-exists:
-'DIR "'ARG(1)'" > nul 2>nul'
-IF rc = 0 THEN RETURN 1
-RETURN 0
-
-getenv:
-x = VALUE(ARG(1),,'OS2ENVIRONMENT')
-
-IF x = '' THEN DO
- SAY 'No 'ARG(1)' environment variable set!'
- EXIT
-END
-RETURN x
diff --git a/xc/extras/Mesa/docs/RELNOTES-4.0.4 b/xc/extras/Mesa/docs/RELNOTES-4.0.4
new file mode 100644
index 000000000..055716cec
--- /dev/null
+++ b/xc/extras/Mesa/docs/RELNOTES-4.0.4
@@ -0,0 +1,73 @@
+
+ Mesa 4.0.4 release notes
+
+ October 3, 2002
+
+ PLEASE READ!!!!
+
+
+
+Introduction
+------------
+
+Mesa uses an even/odd version number scheme like the Linux kernel.
+Odd numbered versions (such as 3.3) designate new developmental releases.
+Even numbered versions (such as 3.4) designate stable releases.
+
+Mesa 4.0.4 contains bug fixes since version 4.0.3 and a few new extensions
+needed for DRI drivers.
+
+See the docs/VERSIONS file for the list of bug fixes.
+
+
+
+New Extensions
+--------------
+
+GL_NV_texture_rectangle was back-ported from the Mesa 4.1 branch so
+that it could be incorporated into the DRI R200 driver.
+
+GL_MESA_ycbcr_texture supports texture images in the YCbCr video format.
+
+GL_APPLE_client_storage extension (for some DRI drivers only) allows the
+caller to say that copying the texture image is not needed.
+
+GL_MESA_pack_invert allows glReadPixels and glGetTexImage() to store images
+in upside-down order, which better matches conventional image file formats.
+
+
+
+Device Drivers
+--------------
+
+Mesa advertises itself as either OpenGL 1.2 or OpenGL 1.3 depending on the
+device driver. If the driver enables all the ARB extensions which are part
+of OpenGL 1.3 then glGetString(GL_VERSION) will return "1.3". Otherwise,
+it'll return "1.2".
+
+A number of Mesa's software drivers haven't been actively maintained for
+some time. We rely on volunteers to maintain many of the drivers.
+Here's the current status of all included drivers:
+
+Driver Status
+---------------------- ---------------------
+XMesa (Xlib) implements OpenGL 1.3
+OSMesa (off-screen) implements OpenGL 1.3
+FX (3dfx Voodoo1/2) implements OpenGL 1.3
+SVGA implements OpenGL 1.3
+Wind River UGL implements OpenGL 1.3
+Windows/Win32 implements OpenGL 1.3
+DOS/DJGPP implements OpenGL 1.3 (new in Mesa 4.0.2)
+GGI implements OpenGL 1.3
+BeOS needs updating
+Allegro needs updating
+D3D needs updating
+
+
+The DOS driver has been updated by Daniel Borca for Mesa 4.0.4.
+
+
+
+
+----------------------------------------------------------------------
+$Id: RELNOTES-4.0.4,v 1.2.8.1 2003/02/21 07:15:41 anholt Exp $
diff --git a/xc/extras/Mesa/docs/RELNOTES-5.0 b/xc/extras/Mesa/docs/RELNOTES-5.0
new file mode 100644
index 000000000..3f9cd34ec
--- /dev/null
+++ b/xc/extras/Mesa/docs/RELNOTES-5.0
@@ -0,0 +1,85 @@
+
+ Mesa 5.0 release notes
+
+ November 13, 2002
+
+ PLEASE READ!!!!
+
+
+
+Introduction
+------------
+
+Mesa uses an even/odd version number scheme like the Linux kernel.
+Even-numbered versions (such as 5.0) designate stable releases.
+Odd-numbered versions (such as 4.1) designate new developmental releases.
+
+Mesa 5.0 is basically just a stabilization of Mesa 4.1. To see a list of
+bug fixes, etc. see the VERSIONS file.
+
+
+
+New Features in Mesa 5.0
+------------------------
+
+Mesa 5.0 supports OpenGL 1.4. Note Mesa's versioning convention:
+
+ OpenGL Version Mesa Version
+ ------------------------------
+ 1.0 1.x
+ 1.1 2.x
+ 1.2 3.x
+ 1.3 4.x
+ 1.4 5.x
+
+OpenGL 1.4 (and Mesa 5.0) incorporates the following OpenGL extensions as
+standard features:
+
+ GL_ARB_depth_texture
+ GL_ARB_shadow
+ GL_ARB_texture_env_crossbar
+ GL_ARB_texture_mirror_repeat
+ GL_ARB_window_pos
+ GL_EXT_blend_color
+ GL_EXT_blend_func_separate
+ GL_EXT_blend_logic_op
+ GL_EXT_blend_minmax
+ GL_EXT_blend_subtract
+ GL_EXT_fog_coord
+ GL_EXT_multi_draw_arrays
+ GL_EXT_point_parameters
+ GL_EXT_secondary_color
+ GL_EXT_stencil_wrap
+ GL_SGIS_generate_mipmap
+
+
+
+Device Driver Status
+--------------------
+
+A number of Mesa's software drivers haven't been actively maintained for
+some time. We rely on volunteers to maintain many of these drivers.
+Here's the current status of all included drivers:
+
+
+Driver Status
+---------------------- ---------------------
+XMesa (Xlib) implements OpenGL 1.4
+OSMesa (off-screen) implements OpenGL 1.4
+FX (3dfx Voodoo1/2) implements OpenGL 1.3
+SVGA implements OpenGL 1.3
+Wind River UGL implements OpenGL 1.3
+Windows/Win32 implements OpenGL 1.4
+DOS/DJGPP implements OpenGL 1.3
+GGI implements OpenGL 1.3
+DOS implements OpenGL 1.4
+BeOS needs updating (underway)
+Allegro needs updating
+D3D needs updating
+
+Note: supporting OpenGL 1.4 (vs. 1.3 or 1.2) usually only requires that the
+driver call the _mesa_enable_1_4_extensions() function.
+
+
+----------------------------------------------------------------------
+$Id: RELNOTES-5.0,v 1.2.8.1 2003/02/21 07:15:41 anholt Exp $
diff --git a/xc/extras/Mesa/docs/VERSIONS b/xc/extras/Mesa/docs/VERSIONS
index c503de8a6..3b92684e7 100644
--- a/xc/extras/Mesa/docs/VERSIONS
+++ b/xc/extras/Mesa/docs/VERSIONS
@@ -1,4 +1,4 @@
-$Id: VERSIONS,v 1.1.1.2 2000/12/05 16:38:42 dawes Exp $
+$Id: VERSIONS,v 1.9.6.1 2003/02/21 07:15:41 anholt Exp $
Mesa Version History
@@ -776,10 +776,11 @@ Mesa Version History
- finished internal support for compressed textures for DRI
-3.4.1 December ??, 2000
+3.4.1 February 14, 2001
New:
- fixed some Linux build problems
- fixed some Windows build problems
+ - GL_EXT_texture_env_dot3 extension (Gareth Hughes)
Bug fixes:
- added RENDER_START/RENDER_FINISH macros for glCopyTexImage in DRI
- various state-update code changes needed for DRI bugs
@@ -789,3 +790,294 @@ Mesa Version History
- GLX_PBUFFER enum value was wrong in glx.h
- fixed a glColorMaterial lighting bug
- fixed bad args to Read/WriteStencilSpan in h/w stencil clear function
+ - glXCopySubBufferMESA() Y position was off by one
+ - Error checking of glTexSubImage3D() was broken (bug 128775)
+ - glPopAttrib() didn't restore all derived Mesa state correctly
+ - Better glReadPixels accuracy for 16bpp color - fixes lots of OpenGL
+ conformance problems at 16bpp.
+ - clearing depth buffer with scissoring was broken, would segfault
+ - OSMesaGetDepthBuffer() returned bad bytesPerValue value
+ - fixed a line clipping bug (reported by Craig McDaniel)
+ - fixed RGB color over/underflow bug for very tiny triangles
+ Known problems:
+ - NURBS or evaluator surfaces inside display lists don't always work
+
+
+3.4.2 May 17, 2001
+ Bug fixes:
+ - deleting the currently bound texture could cause bad problems
+ - using fog could result in random vertex alpha values
+ - AA triangle rendering could touch pixels outside right window bound
+ - fixed byteswapping problem in clear_32bit_ximage() function
+ - fixed bugs in wglUseFontBitmapsA(), by Frank Warmerdam
+ - fixed memory leak in glXUseXFont()
+ - fragment sampling in AA triangle function was off by 1/2 pixel
+ - Windows: reading pixels from framebuffer didn't always work
+ - glConvolutionFilter2D could segfault or cause FP exception
+ - fixed segfaults in FX and X drivers when using tex unit 1 but not 0
+ - GL_NAND logicop didn't work right in RGBA mode
+ - fixed a memory corruption bug in vertex buffer reset code
+ - clearing the softwara alpha buffer with scissoring was broken
+ - fixed a few color index mode fog bugs
+ - fixed some bad assertions in color index mode
+ - fixed FX line 'stipple' bug #420091
+ - fixed stencil buffer clear width/height typo
+ - fixed GL error glitches in gl[Client]ActiveTextureARB()
+ - fixed Windows compilation problem in texutil.c
+ - fixed 1/8-pixel AA triangle sampling error
+ Changes:
+ - optimized writing mono-colored pixel spans to X pixmaps
+ - increased max viewport size to 2048 x 2048
+
+
+3.5 June 21, 2001
+ New:
+ - internals of Mesa divided into modular pieces (Keith Whitwell)
+ - 100% OpenGL 1.2 conformance (passes all conformance tests)
+ - new AA line algorithm
+ - GL_EXT_convolution extension
+ - GL_ARB_imaging subset
+ - OSMesaCreateContextExt() function
+ - GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add)
+ - GL_MAX_TEXTURE_UNITS_ARB now defaults to eight
+ - GL_EXT_fog_coord extension (Keith Whitwell)
+ - GL_EXT_secondary_color extension (Keith Whitwell)
+ - GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add)
+ - GL_SGIX_depth_texture extension
+ - GL_SGIX_shadow and GL_SGIX_shadow_ambient extensions
+ - demos/shadowtex.c demo of GL_SGIX_depth_texture and GL_SGIX_shadow
+ - GL_ARB_texture_env_combine extension
+ - GL_ARB_texture_env_dot3 extension
+ - GL_ARB_texture_border_clamp (aka GL_SGIS_texture_border_clamp)
+ - OSMesaCreateContextExt() function
+ - libOSMesa.so library, contains the OSMesa driver interface
+ - GL/glxext.h header file for GLX extensions
+ - somewhat faster software texturing, fogging, depth testing
+ - all color-index conformance tests now pass (only 8bpp tested)
+ - SPARC assembly language TCL optimizations (David Miller)
+ - GL_SGIS_generate_mipmap extension
+ Bug Fixes:
+ - fbiRev and tmuRev were unitialized when using Glide3
+ - fixed a few color index mode conformance failures; all pass now
+ - now appling antialiasing coverage to alpha after texturing
+ - colors weren't getting clamped to [0,1] before color table lookup
+ - fixed RISC alignment errors caused by COPY_4UBV macro
+ - drawing wide, flat-shaded lines could cause a segfault
+ - vertices now snapped to 1/16 pixel to fix rendering of tiny triangles
+ Changes:
+ - SGI's Sample Implementation (SI) 1.3 GLU library replaces Mesa GLU
+ - new libOSMesa.so library, contains the OSMesa driver interface
+
+
+4.0 October 22, 2001
+ New:
+ - Mesa 4.0 implements the OpenGL 1.3 specification
+ - GL_IBM_rasterpos_clip extension
+ - GL_EXT_texture_edge_clamp extension (aka GL_SGIS_texture_edge_clamp)
+ - GL_ARB_texture_mirrored_repeat extension
+ - WindML UGL driver (Stephane Raimbault)
+ - added OSMESA_MAX_WIDTH/HEIGHT queries
+ - attempted compiliation fixes for Solaris 5, 7 and 8
+ - updated glext.h and glxext.h files
+ - updated Windows driver (Karl Schultz)
+ Bug fixes:
+ - added some missing GLX 1.3 tokens to include/GL/glx.h
+ - GL_COLOR_MATRIX changes weren't recognized by teximage functions
+ - glCopyPixels with scale and bias was broken
+ - glRasterPos with lighting could segfault
+ - glDeleteTextures could leave a dangling pointer
+ - Proxy textures for cube maps didn't work
+ - fixed a number of 16-bit color channel bugs
+ - fixed a few minor memory leaks
+ - GLX context sharing was broken in 3.5
+ - fixed state-update bugs in glPopClientAttrib()
+ - fixed glDrawRangeElements() bug
+ - fixed a glPush/PopAttrib() bug related to texture binding
+ - flat-shaded, textured lines were broken
+ - fixed a dangling pointer problem in the XMesa code (Chris Burghart)
+ - lighting didn't always produce the correct alpha value
+ - fixed 3DNow! code to not read past end of arrays (Andrew Lewycky)
+
+
+4.0.1 December 17, 2001
+ New:
+ - better sub-pixel sample positions for AA triangles (Ray Tice)
+ - slightly faster blending for (GL_ZERO, GL_ONE) and (GL_ONE, GL_ZERO)
+ Bug fixes:
+ - added missing break statements in glGet*() for multisample cases
+ - fixed uninitialized hash table mutex bug (display lists / texobjs)
+ - fixed bad teximage error check conditional (bug 476846)
+ - fixed demos readtex.c compilation problem on Windows (Karl Schultz)
+ - added missing glGet() query for GL_MAX_TEXTURE_LOD_BIAS_EXT
+ - silence some compiler warnings (gcc 2.96)
+ - enable the #define GL_VERSION_1_3 in GL/gl.h
+ - added GL 1.3 and GLX 1.4 entries to gl_mangle.h and glx_mangle.h
+ - fixed glu.h typedef problem found with MSDev 6.0
+ - build libGL.so with -Bsymbolic (fixes bug found with Chromium)
+ - added missing 'const' to glXGetContextIDEXT() in glxext.h
+ - fixed a few glXGetProcAddress() errors (texture compression, etc)
+ - fixed start index bug in compiled vertex arrays (Keith)
+ - fixed compilation problems in src/SPARC/glapi_sparc.S
+ - fixed triangle strip "parity" bug found in VTK medical1 demo (Keith)
+ - use glXGetProcAddressARB in GLUT to avoid extension linking problems
+ - provoking vertex of flat-shaded, color-index triangles was wrong
+ - fixed a few display list bugs (GLUT walker, molecule, etc) (Keith)
+ - glTexParameter didn't flush the vertex buffer (Ray Tice)
+ - feedback attributes for glDraw/CopyPixels and glBitmap were wrong
+ - fixed bug in normal length caching (ParaView lighting bug)
+ - fixed separate_specular color bug found in Chimera (18 Dec 2001)
+
+
+4.0.2 April 2, 2002
+ New:
+ - New DOS (DJGPP) driver written by Daniel Borca
+ - New driver interface functions for TCL drivers (such as Radeon DRI)
+ - GL_RENDERER string returns "Mesa Offscreen16" or "Mesa Offscreen32"
+ if using deep color channels
+ - latest GL/glext.h and GL/glxext.h headers from SGI
+ Bug fixes:
+ - GL_BLEND with non-black texture env color wasn't always correct
+ - GL_REPLACE with GL_RGB texture format wasn't always correct (alpha)
+ - glTexEnviv( pname != GL_TEXTURE_ENV_COLOR ) was broken
+ - glReadPixels was sometimes mistakenly clipped by the scissor box
+ - glDraw/ReadPixels didn't catch all the errors that they should have
+ - Fixed 24bpp rendering problem in Windows driver (Karl Schultz)
+ - 16-bit GLchan mode fixes (m_trans_tmp.h, s_triangle.c)
+ - Fixed 1-bit float->int conversion bug in glDrawPixels(GL_DEPTH_COMP)
+ - glColorMask as sometimes effecting glXSwapBuffers()
+ - fixed a potential bug in XMesaGarbageCollect()
+ - N threads rendering into one window didn't work reliably
+ - glCopyPixels didn't work for deep color channels
+ - improved 8 -> 16bit/channel texture image conversion (Gerk Huisma)
+ - glPopAttrib() didn't correctly restore user clip planes
+ - user clip planes failed for some perspective projections (Chromium)
+ Known bugs:
+ - mipmap LOD computation
+
+
+4.0.3 June 25, 2002
+ New:
+ - updated GL/glext.h file (version 15)
+ - corrected MMX blend code (Jose Fonseca)
+ - support for software-based alpha planes in Windows driver
+ - updated GGI driver (Filip Spacek)
+ Bug fixes:
+ - glext.h had wrong values for GL_DOT3_RGB[A]_EXT tokens
+ - OSMesaMakeCurrent() didn't recognize buffer size changes
+ - assorted conformance fixes for 16-bit/channel rendering
+ - texcombine alpha subtraction mode was broken
+ - fixed lighting bug with non-uniform scaling and display lists
+ - fixed bug when deleting shared display lists
+ - disabled SPARC cliptest assembly code (Mesa bug 544665)
+ - fixed a couple Solaris compilation/link problems
+ - blending clipped glDrawPixels didn't always work
+ - glGetTexImage() didn't accept packed pixel types
+ - glPixelMapu[is]v() could explode given too large of pixelmap
+ - glGetTexParameter[if]v() didn't accept GL_TEXTURE_MAX_ANISOTROPY_EXT
+ - glXCopyContext() could lead to segfaults
+ - glCullFace(GL_FRONT_AND_BACK) didn't work (bug 572665)
+ Changes:
+ - lots of C++ (g++) code clean-ups
+ - lots of T&L updates for the Radeon DRI driver
+ Known bugs:
+ - mipmap LOD computation (fixed for Mesa 4.1)
+
+
+4.0.4 October 3, 2002
+ New:
+ - GL_NV_texture_rectangle extension
+ - updated glext.h header (version 17)
+ - updated DOS driver (Daniel Borca)
+ - updated BeOS R5 driver (Philippe Houdoin)
+ - added GL_IBM_texture_mirror_repeat
+ - glxinfo now takes -l option to print interesting OpenGL limits info
+ - GL_MESA_ycbcr_texture extension
+ - GL_APPLE_client_storage extension (for some DRI drivers only)
+ - GL_MESA_pack_invert extension
+ Bug fixes:
+ - fixed GL_LINEAR fog bug by adding clamping
+ - fixed FP exceptions found using Alpha CPU
+ - 3dfx MESA_GLX_FX=window (render to window) didn't work
+ - fixed memory leak in wglCreateContest (Karl Schultz)
+ - define GLAPIENTRY and GLAPI if undefined in glu.h
+ - wglGetProcAddress didn't handle all API functions
+ - when testing for OpenGL 1.2 vs 1.3, check for GL_ARB_texture_cube_map
+ - removed GL_MAX_CONVOLUTION_WIDTH/HEIGHT from glGetInteger/Float/etc()
+ - error checking in compressed tex image functions had some glitches
+ - fixed AIX compile problem in src/config.c
+ - glGetTexImage was using pixel unpacking instead of packing params
+ - auto-mipmap generation for cube maps was incorrect
+ Changes:
+ - max texture units reduced to six to accomodate texture rectangles
+ - removed unfinished GL_MESA_sprite_point extension code
+
+
+4.1 October 29, 2002
+ New:
+ - GL_NV_vertex_program extension
+ - GL_NV_vertex_program1_1 extension
+ - GL_ARB_window_pos extension
+ - GL_ARB_depth_texture extension
+ - GL_ARB_shadow extension
+ - GL_ARB_shadow_ambient extension
+ - GL_EXT_shadow_funcs extension
+ - GL_ARB_point_parameters extension
+ - GL_ARB_texture_env_crossbar
+ - GL_NV_point_sprite extension
+ - GL_NV_texture_rectangle extension
+ - GL_EXT_multi_draw_arrays extension
+ - GL_EXT_stencil_two_side extension
+ - GLX_SGIX_fbconfig and GLX_SGIX_pbuffer extensions
+ - GL_ATI_texture_mirror_once extension (Ian Romanick)
+ - massive overhaul/simplification of software rasterizer module,
+ many contributions from Klaus Niederkrueger
+ - faster software texturing in some cases (i.e. trilinear filtering)
+ - new OSMesaGetProcAddress() function
+ - more blend modes implemented with MMX code (Jose Fonseca)
+ - added glutGetProcAddress() to GLUT
+ - added GLUT_FPS env var to compute frames/second in glutSwapBuffers()
+ - pbinfo and pbdemo PBuffer programs
+ - glxinfo -v prints transprent pixel info (Gerd Sussner)
+ Bug fixes:
+ - better mipmap LOD computation (prevents excessive blurriness)
+ - OSMesaMakeCurrent() didn't recognize buffer size changes
+ - assorted conformance fixes for 16-bit/channel rendering
+ - texcombine alpha subtraction mode was broken
+ - fixed some blend problems when GLchan==GLfloat (Gerk Huisma)
+ - clamp colors to [0,inf] in OSMesa if GLchan==GLfloat (Gerk Huisma)
+ - fixed divide by zero error in NURBS tessellator (Jon Perry)
+ - fixed GL_LINEAR fog bug by adding clamping
+ - fixed FP exceptions found using Alpha CPU
+ - 3dfx/glide driver render-to-window feature was broken
+ - added missing GLX_TRANSPARENT_RGB token to glx.h
+ - fixed error checking related to paletted textures
+ - fixed reference count error in glDeleteTextures (Randy Fayan)
+ Changes:
+ - New spec file and Python code to generate some GL dispatch files
+ - Glide driver defaults to "no" with autoconf/automake
+ - updated demos/stex3d with new options
+
+
+5.0 November 13, 2002
+ New:
+ - OpenGL 1.4 support (glGetString(GL_VERSION) returns "1.4")
+ - removed some overlooked debugging code
+ - glxinfo updated to support GLX_ARB_multisample
+ - GLUT now support GLX_ARB_multisample
+ - updated DOS driver (Daniel Borca)
+ Bug fixes:
+ - GL_POINT and GL_LINE-mode polygons didn't obey cull state
+ - fixed potential bug in _mesa_align_malloc/calloc()
+ - fixed missing triangle bug when running vertex programs
+ - fixed a few HPUX compilation problems
+ - FX (Glide) driver didn't compile
+ - setting GL_TEXTURE_BORDER_COLOR with glTexParameteriv() didn't work
+ - a few EXT functions, like glGenTexturesEXT, were no-ops
+ - a few OpenGL 1.4 functions like glFogCoord*, glBlendFuncSeparate,
+ glMultiDrawArrays and glMultiDrawElements were missing
+ - glGet*(GL_ACTIVE_STENCIL_FACE_EXT) was broken
+ - Pentium 4 Mobile was mistakenly identified as having 3DNow!
+ - fixed one-bit error in point/line fragment Z calculation
+ - fixed potential segfault in fakeglx code
+ - fixed color overflow problem in DOT3 texture env mode
+
diff --git a/xc/extras/Mesa/include/GL/gl.h b/xc/extras/Mesa/include/GL/gl.h
index c226fdc42..3722cdb47 100644
--- a/xc/extras/Mesa/include/GL/gl.h
+++ b/xc/extras/Mesa/include/GL/gl.h
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.4
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -62,6 +62,23 @@
# define GLAPIENTRY
#endif /* WIN32 / CYGWIN bracket */
+#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)
+# define PRAGMA_EXPORT_SUPPORTED 1
+#endif
+
+/*
+ * WINDOWS: Include windows.h here to define APIENTRY.
+ * It is also useful when applications include this file by
+ * including only glut.h, since glut.h depends on windows.h.
+ * Applications needing to include windows.h with parms other
+ * than "WIN32_LEAN_AND_MEAN" may include windows.h before
+ * glut.h or gl.h.
+ */
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__)
#include <gl/mesa_wgl.h>
#endif
@@ -69,6 +86,19 @@
#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
#pragma import on
#endif
+
+#ifndef APIENTRY
+#define APIENTRY GLAPIENTRY
+#endif
+
+#ifdef CENTERLINE_CLPP
+#define signed
+#endif
+
+#if defined(PRAGMA_EXPORT_SUPPORTED)
+#pragma export on
+#endif
+
/*
* End system-specific stuff.
**********************************************************************/
@@ -88,13 +118,8 @@ extern "C" {
/*
- *
* Datatypes
- *
*/
-#ifdef CENTERLINE_CLPP
-#define signed
-#endif
typedef unsigned int GLenum;
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;
@@ -114,9 +139,7 @@ typedef double GLclampd; /* double precision float in [0,1] */
/*
- *
* Constants
- *
*/
/* Boolean values */
@@ -332,10 +355,6 @@ typedef double GLclampd; /* double precision float in [0,1] */
#define GL_DST_COLOR 0x0306
#define GL_ONE_MINUS_DST_COLOR 0x0307
#define GL_SRC_ALPHA_SATURATE 0x0308
-#define GL_CONSTANT_COLOR 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
-#define GL_CONSTANT_ALPHA 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
/* Render Mode */
#define GL_FEEDBACK 0x1C01
@@ -503,8 +522,6 @@ typedef double GLclampd; /* double precision float in [0,1] */
/* Evaluators */
#define GL_AUTO_NORMAL 0x0D80
#define GL_MAP1_COLOR_4 0x0D90
-#define GL_MAP1_GRID_DOMAIN 0x0DD0
-#define GL_MAP1_GRID_SEGMENTS 0x0DD1
#define GL_MAP1_INDEX 0x0D91
#define GL_MAP1_NORMAL 0x0D92
#define GL_MAP1_TEXTURE_COORD_1 0x0D93
@@ -514,8 +531,6 @@ typedef double GLclampd; /* double precision float in [0,1] */
#define GL_MAP1_VERTEX_3 0x0D97
#define GL_MAP1_VERTEX_4 0x0D98
#define GL_MAP2_COLOR_4 0x0DB0
-#define GL_MAP2_GRID_DOMAIN 0x0DD2
-#define GL_MAP2_GRID_SEGMENTS 0x0DD3
#define GL_MAP2_INDEX 0x0DB1
#define GL_MAP2_NORMAL 0x0DB2
#define GL_MAP2_TEXTURE_COORD_1 0x0DB3
@@ -524,6 +539,10 @@ typedef double GLclampd; /* double precision float in [0,1] */
#define GL_MAP2_TEXTURE_COORD_4 0x0DB6
#define GL_MAP2_VERTEX_3 0x0DB7
#define GL_MAP2_VERTEX_4 0x0DB8
+#define GL_MAP1_GRID_DOMAIN 0x0DD0
+#define GL_MAP1_GRID_SEGMENTS 0x0DD1
+#define GL_MAP2_GRID_DOMAIN 0x0DD2
+#define GL_MAP2_GRID_SEGMENTS 0x0DD3
#define GL_COEFF 0x0A00
#define GL_DOMAIN 0x0A02
#define GL_ORDER 0x0A01
@@ -723,243 +742,6 @@ typedef double GLclampd; /* double precision float in [0,1] */
#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
-/* OpenGL 1.2 */
-#define GL_RESCALE_NORMAL 0x803A
-#define GL_CLAMP_TO_EDGE 0x812F
-#define GL_MAX_ELEMENTS_VERTICES 0x80E8
-#define GL_MAX_ELEMENTS_INDICES 0x80E9
-#define GL_BGR 0x80E0
-#define GL_BGRA 0x80E1
-#define GL_UNSIGNED_BYTE_3_3_2 0x8032
-#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
-#define GL_UNSIGNED_INT_8_8_8_8 0x8035
-#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
-#define GL_UNSIGNED_INT_10_10_10_2 0x8036
-#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
-#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
-#define GL_SINGLE_COLOR 0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
-#define GL_TEXTURE_MIN_LOD 0x813A
-#define GL_TEXTURE_MAX_LOD 0x813B
-#define GL_TEXTURE_BASE_LEVEL 0x813C
-#define GL_TEXTURE_MAX_LEVEL 0x813D
-#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
-#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
-#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
-#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
-#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#define GL_PACK_SKIP_IMAGES 0x806B
-#define GL_PACK_IMAGE_HEIGHT 0x806C
-#define GL_UNPACK_SKIP_IMAGES 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT 0x806E
-#define GL_TEXTURE_3D 0x806F
-#define GL_PROXY_TEXTURE_3D 0x8070
-#define GL_TEXTURE_DEPTH 0x8071
-#define GL_TEXTURE_WRAP_R 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE 0x8073
-#define GL_TEXTURE_BINDING_3D 0x806A
-
-
-/*
- * OpenGL 1.2 imaging subset
- */
-/* GL_EXT_color_table */
-#define GL_COLOR_TABLE 0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
-#define GL_PROXY_COLOR_TABLE 0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
-#define GL_COLOR_TABLE_SCALE 0x80D6
-#define GL_COLOR_TABLE_BIAS 0x80D7
-#define GL_COLOR_TABLE_FORMAT 0x80D8
-#define GL_COLOR_TABLE_WIDTH 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
-/* GL_EXT_convolution and GL_HP_convolution_border_modes */
-#define GL_CONVOLUTION_1D 0x8010
-#define GL_CONVOLUTION_2D 0x8011
-#define GL_SEPARABLE_2D 0x8012
-#define GL_CONVOLUTION_BORDER_MODE 0x8013
-#define GL_CONVOLUTION_FILTER_SCALE 0x8014
-#define GL_CONVOLUTION_FILTER_BIAS 0x8015
-#define GL_REDUCE 0x8016
-#define GL_CONVOLUTION_FORMAT 0x8017
-#define GL_CONVOLUTION_WIDTH 0x8018
-#define GL_CONVOLUTION_HEIGHT 0x8019
-#define GL_MAX_CONVOLUTION_WIDTH 0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
-#define GL_CONSTANT_BORDER 0x8151
-#define GL_REPLICATE_BORDER 0x8153
-#define GL_CONVOLUTION_BORDER_COLOR 0x8154
-/* GL_SGI_color_matrix */
-#define GL_COLOR_MATRIX 0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
-/* GL_EXT_histogram */
-#define GL_HISTOGRAM 0x8024
-#define GL_PROXY_HISTOGRAM 0x8025
-#define GL_HISTOGRAM_WIDTH 0x8026
-#define GL_HISTOGRAM_FORMAT 0x8027
-#define GL_HISTOGRAM_RED_SIZE 0x8028
-#define GL_HISTOGRAM_GREEN_SIZE 0x8029
-#define GL_HISTOGRAM_BLUE_SIZE 0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
-#define GL_HISTOGRAM_SINK 0x802D
-#define GL_MINMAX 0x802E
-#define GL_MINMAX_FORMAT 0x802F
-#define GL_MINMAX_SINK 0x8030
-#define GL_TABLE_TOO_LARGE 0x8031
-/* GL_EXT_blend_color, GL_EXT_blend_minmax */
-#define GL_BLEND_EQUATION 0x8009
-#define GL_MIN 0x8007
-#define GL_MAX 0x8008
-#define GL_FUNC_ADD 0x8006
-#define GL_FUNC_SUBTRACT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT 0x800B
-#define GL_BLEND_COLOR 0x8005
-
-
-/* OpenGL 1.3 */
-/* multitexture */
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE31 0x84DF
-#define GL_ACTIVE_TEXTURE 0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
-#define GL_MAX_TEXTURE_UNITS 0x84E2
-/* texture_cube_map */
-#define GL_NORMAL_MAP 0x8511
-#define GL_REFLECTION_MAP 0x8512
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
-/* texture_compression */
-#define GL_COMPRESSED_ALPHA 0x84E9
-#define GL_COMPRESSED_LUMINANCE 0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
-#define GL_COMPRESSED_INTENSITY 0x84EC
-#define GL_COMPRESSED_RGB 0x84ED
-#define GL_COMPRESSED_RGBA 0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
-#define GL_TEXTURE_COMPRESSED 0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-/* multisample */
-#define GL_MULTISAMPLE 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
-#define GL_SAMPLE_COVERAGE 0x80A0
-#define GL_SAMPLE_BUFFERS 0x80A8
-#define GL_SAMPLES 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-#define GL_MULTISAMPLE_BIT 0x20000000
-/* transpose_matrix */
-#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
-/* texture_env_combine */
-#define GL_COMBINE 0x8570
-#define GL_COMBINE_RGB 0x8571
-#define GL_COMBINE_ALPHA 0x8572
-#define GL_SOURCE0_RGB 0x8580
-#define GL_SOURCE1_RGB 0x8581
-#define GL_SOURCE2_RGB 0x8582
-#define GL_SOURCE0_ALPHA 0x8588
-#define GL_SOURCE1_ALPHA 0x8589
-#define GL_SOURCE2_ALPHA 0x858A
-#define GL_OPERAND0_RGB 0x8590
-#define GL_OPERAND1_RGB 0x8591
-#define GL_OPERAND2_RGB 0x8592
-#define GL_OPERAND0_ALPHA 0x8598
-#define GL_OPERAND1_ALPHA 0x8599
-#define GL_OPERAND2_ALPHA 0x859A
-#define GL_RGB_SCALE 0x8573
-#define GL_ADD_SIGNED 0x8574
-#define GL_INTERPOLATE 0x8575
-#define GL_SUBTRACT 0x84E7
-#define GL_CONSTANT 0x8576
-#define GL_PRIMARY_COLOR 0x8577
-#define GL_PREVIOUS 0x8578
-/* texture_env_dot3 */
-#define GL_DOT3_RGB 0x86AE
-#define GL_DOT3_RGBA 0x86AF
-/* texture_border_clamp */
-#define GL_CLAMP_TO_BORDER 0x812D
-
-
-
-#if defined(__BEOS__) || defined(__QUICKDRAW__)
-#pragma export on
-#endif
-
/*
* Miscellaneous
@@ -1057,7 +839,6 @@ GLAPI void GLAPIENTRY glFlush( void );
GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode );
-
/*
* Depth Buffer
*/
@@ -1080,7 +861,6 @@ GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GL
GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value );
-
/*
* Transformation
*/
@@ -1122,7 +902,6 @@ GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z );
GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z );
-
/*
* Display Lists
*/
@@ -1145,7 +924,6 @@ GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type,
GLAPI void GLAPIENTRY glListBase( GLuint base );
-
/*
* Drawing Functions
*/
@@ -1341,7 +1119,6 @@ GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 );
GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 );
-
/*
* Vertex Arrays (1.1)
*/
@@ -1375,7 +1152,6 @@ GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count,
GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride,
const GLvoid *pointer );
-
/*
* Lighting
*/
@@ -1410,8 +1186,6 @@ GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params
GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode );
-
-
/*
* Raster functions
*/
@@ -1453,8 +1227,6 @@ GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y,
GLsizei width, GLsizei height,
GLenum type );
-
-
/*
* Stenciling
*/
@@ -1532,7 +1304,6 @@ GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level,
GLvoid *pixels );
-
/* 1.1 functions */
GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures );
@@ -1589,8 +1360,6 @@ GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level,
GLsizei width, GLsizei height );
-
-
/*
* Evaluators
*/
@@ -1644,7 +1413,6 @@ GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 );
GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
-
/*
* Fog
*/
@@ -1658,7 +1426,6 @@ GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params );
GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params );
-
/*
* Selection and Feedback
*/
@@ -1679,12 +1446,57 @@ GLAPI void GLAPIENTRY glPopName( void );
-/* 1.2 functions */
+/*
+ * OpenGL 1.2
+ */
+
+#define GL_RESCALE_NORMAL 0x803A
+#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_MAX_ELEMENTS_VERTICES 0x80E8
+#define GL_MAX_ELEMENTS_INDICES 0x80E9
+#define GL_BGR 0x80E0
+#define GL_BGRA 0x80E1
+#define GL_UNSIGNED_BYTE_3_3_2 0x8032
+#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
+#define GL_UNSIGNED_INT_8_8_8_8 0x8035
+#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
+#define GL_UNSIGNED_INT_10_10_10_2 0x8036
+#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
+#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
+#define GL_SINGLE_COLOR 0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
+#define GL_TEXTURE_MIN_LOD 0x813A
+#define GL_TEXTURE_MAX_LOD 0x813B
+#define GL_TEXTURE_BASE_LEVEL 0x813C
+#define GL_TEXTURE_MAX_LEVEL 0x813D
+#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
+#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
+#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#define GL_PACK_SKIP_IMAGES 0x806B
+#define GL_PACK_IMAGE_HEIGHT 0x806C
+#define GL_UNPACK_SKIP_IMAGES 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT 0x806E
+#define GL_TEXTURE_3D 0x806F
+#define GL_PROXY_TEXTURE_3D 0x8070
+#define GL_TEXTURE_DEPTH 0x8071
+#define GL_TEXTURE_WRAP_R 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE 0x8073
+#define GL_TEXTURE_BINDING_3D 0x806A
+
GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start,
GLuint end, GLsizei count, GLenum type, const GLvoid *indices );
GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level,
- GLenum internalFormat,
+ GLint internalFormat,
GLsizei width, GLsizei height,
GLsizei depth, GLint border,
GLenum format, GLenum type,
@@ -1703,8 +1515,92 @@ GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level,
GLint y, GLsizei width,
GLsizei height );
+typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+typedef void (APIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+
+
+/*
+ * GL_ARB_imaging
+ */
+
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+#define GL_COLOR_TABLE 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
+#define GL_PROXY_COLOR_TABLE 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
+#define GL_COLOR_TABLE_SCALE 0x80D6
+#define GL_COLOR_TABLE_BIAS 0x80D7
+#define GL_COLOR_TABLE_FORMAT 0x80D8
+#define GL_COLOR_TABLE_WIDTH 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
+#define GL_CONVOLUTION_1D 0x8010
+#define GL_CONVOLUTION_2D 0x8011
+#define GL_SEPARABLE_2D 0x8012
+#define GL_CONVOLUTION_BORDER_MODE 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS 0x8015
+#define GL_REDUCE 0x8016
+#define GL_CONVOLUTION_FORMAT 0x8017
+#define GL_CONVOLUTION_WIDTH 0x8018
+#define GL_CONVOLUTION_HEIGHT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
+#define GL_CONSTANT_BORDER 0x8151
+#define GL_REPLICATE_BORDER 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR 0x8154
+#define GL_COLOR_MATRIX 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
+#define GL_HISTOGRAM 0x8024
+#define GL_PROXY_HISTOGRAM 0x8025
+#define GL_HISTOGRAM_WIDTH 0x8026
+#define GL_HISTOGRAM_FORMAT 0x8027
+#define GL_HISTOGRAM_RED_SIZE 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
+#define GL_HISTOGRAM_SINK 0x802D
+#define GL_MINMAX 0x802E
+#define GL_MINMAX_FORMAT 0x802F
+#define GL_MINMAX_SINK 0x8030
+#define GL_TABLE_TOO_LARGE 0x8031
+#define GL_BLEND_EQUATION 0x8009
+#define GL_MIN 0x8007
+#define GL_MAX 0x8008
+#define GL_FUNC_ADD 0x8006
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#define GL_BLEND_COLOR 0x8005
-/* 1.2 imaging extension functions */
GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat,
GLsizei width, GLenum format,
@@ -1814,9 +1710,151 @@ GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target,
GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format,
GLenum type, GLvoid *row, GLvoid *column, GLvoid *span );
+typedef void (APIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+typedef void (APIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode);
+typedef void (APIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+typedef void (APIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target);
+typedef void (APIENTRY * PFNGLRESETMINMAXPROC) (GLenum target);
-/* 1.3 functions */
+
+/*
+ * OpenGL 1.3
+ */
+
+/* multitexture */
+#define GL_TEXTURE0 0x84C0
+#define GL_TEXTURE1 0x84C1
+#define GL_TEXTURE2 0x84C2
+#define GL_TEXTURE3 0x84C3
+#define GL_TEXTURE4 0x84C4
+#define GL_TEXTURE5 0x84C5
+#define GL_TEXTURE6 0x84C6
+#define GL_TEXTURE7 0x84C7
+#define GL_TEXTURE8 0x84C8
+#define GL_TEXTURE9 0x84C9
+#define GL_TEXTURE10 0x84CA
+#define GL_TEXTURE11 0x84CB
+#define GL_TEXTURE12 0x84CC
+#define GL_TEXTURE13 0x84CD
+#define GL_TEXTURE14 0x84CE
+#define GL_TEXTURE15 0x84CF
+#define GL_TEXTURE16 0x84D0
+#define GL_TEXTURE17 0x84D1
+#define GL_TEXTURE18 0x84D2
+#define GL_TEXTURE19 0x84D3
+#define GL_TEXTURE20 0x84D4
+#define GL_TEXTURE21 0x84D5
+#define GL_TEXTURE22 0x84D6
+#define GL_TEXTURE23 0x84D7
+#define GL_TEXTURE24 0x84D8
+#define GL_TEXTURE25 0x84D9
+#define GL_TEXTURE26 0x84DA
+#define GL_TEXTURE27 0x84DB
+#define GL_TEXTURE28 0x84DC
+#define GL_TEXTURE29 0x84DD
+#define GL_TEXTURE30 0x84DE
+#define GL_TEXTURE31 0x84DF
+#define GL_ACTIVE_TEXTURE 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
+#define GL_MAX_TEXTURE_UNITS 0x84E2
+/* texture_cube_map */
+#define GL_NORMAL_MAP 0x8511
+#define GL_REFLECTION_MAP 0x8512
+#define GL_TEXTURE_CUBE_MAP 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
+/* texture_compression */
+#define GL_COMPRESSED_ALPHA 0x84E9
+#define GL_COMPRESSED_LUMINANCE 0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
+#define GL_COMPRESSED_INTENSITY 0x84EC
+#define GL_COMPRESSED_RGB 0x84ED
+#define GL_COMPRESSED_RGBA 0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
+#define GL_TEXTURE_COMPRESSED 0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+/* multisample */
+#define GL_MULTISAMPLE 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
+#define GL_SAMPLE_COVERAGE 0x80A0
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+#define GL_MULTISAMPLE_BIT 0x20000000
+/* transpose_matrix */
+#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
+/* texture_env_combine */
+#define GL_COMBINE 0x8570
+#define GL_COMBINE_RGB 0x8571
+#define GL_COMBINE_ALPHA 0x8572
+#define GL_SOURCE0_RGB 0x8580
+#define GL_SOURCE1_RGB 0x8581
+#define GL_SOURCE2_RGB 0x8582
+#define GL_SOURCE0_ALPHA 0x8588
+#define GL_SOURCE1_ALPHA 0x8589
+#define GL_SOURCE2_ALPHA 0x858A
+#define GL_OPERAND0_RGB 0x8590
+#define GL_OPERAND1_RGB 0x8591
+#define GL_OPERAND2_RGB 0x8592
+#define GL_OPERAND0_ALPHA 0x8598
+#define GL_OPERAND1_ALPHA 0x8599
+#define GL_OPERAND2_ALPHA 0x859A
+#define GL_RGB_SCALE 0x8573
+#define GL_ADD_SIGNED 0x8574
+#define GL_INTERPOLATE 0x8575
+#define GL_SUBTRACT 0x84E7
+#define GL_CONSTANT 0x8576
+#define GL_PRIMARY_COLOR 0x8577
+#define GL_PREVIOUS 0x8578
+/* texture_env_dot3 */
+#define GL_DOT3_RGB 0x86AE
+#define GL_DOT3_RGBA 0x86AF
+/* texture_border_clamp */
+#define GL_CLAMP_TO_BORDER 0x812D
GLAPI void GLAPIENTRY glActiveTexture( GLenum texture );
@@ -1911,8 +1949,52 @@ GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] );
GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert );
-
-#if defined(GL_GLEXT_LEGACY)
+typedef void (APIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img);
/*
@@ -1992,46 +2074,53 @@ GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v);
GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
#endif /* GL_ARB_multitexture */
/*
+ * Define this token if you want "old-style" header file behaviour (extensions
+ * defined in gl.h). Otherwise, extensions will be included from glext.h.
+ */
+#if defined(GL_GLEXT_LEGACY)
+
+
+/*
* 1. GL_EXT_abgr
*/
#ifndef GL_EXT_abgr
@@ -2472,7 +2561,7 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void );
/*
* ???. GL_MESA_trace
- * XXX this should go into glext.h at some point
+ * XXX obsolete
*/
#ifndef GL_MESA_trace
#define GL_MESA_trace 1
@@ -2503,7 +2592,7 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid
/*
* ???. GL_MESA_packed_depth_stencil
- * XXX this will be in glext.h someday
+ * XXX obsolete
*/
#ifndef GL_MESA_packed_depth_stencil
#define GL_MESA_packed_depth_stencil 1
@@ -2517,21 +2606,50 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid
#endif /* GL_MESA_packed_depth_stencil */
-/*
- * ??. GL_MESA_sprite_point
- */
-#ifndef GL_MESA_sprite_point
-#define GL_MESA_sprite_point 1
+#ifndef GL_MESA_ycbcr_texture
+#define GL_MESA_ycbcr_texture 1
-#define GL_SPRITE_POINT_MESA 0x8757 /* XXX not finalized! */
+#define GL_YCBCR_MESA 0x8757
+#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA /* same as Apple */
+#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB /* same as Apple */
+
+#endif /* GL_MESA_texture_ycbcr */
+
+
+
+#ifndef GL_MESA_pack_invert
+#define GL_MESA_pack_invert 1
+
+#define GL_PACK_INVERT_MESA 0x8758
+
+#endif /* GL_MESA_pack_invert */
+
+
+
+#ifndef GL_APPLE_client_storage
+#define GL_APPLE_client_storage 1
+
+#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
+
+#endif /* GL_APPLE_client_storage */
+
+
+
+#ifndef GL_APPLE_ycbcr_422
+#define GL_APPLE_ycbcr_422 1
+
+#define GL_YCBCR_422_APPLE 0x85B9
+#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
+
+#endif /* GL_APPLE_ycbcr_422 */
-#endif
/**********************************************************************
* Begin system-specific stuff
*/
-#if defined(__BEOS__) || defined(__QUICKDRAW__)
+#if defined(PRAGMA_EXPORT_SUPPORTED)
#pragma export off
#endif
diff --git a/xc/extras/Mesa/include/GL/glext.h b/xc/extras/Mesa/include/GL/glext.h
index 245f100c7..7d1f396bb 100644
--- a/xc/extras/Mesa/include/GL/glext.h
+++ b/xc/extras/Mesa/include/GL/glext.h
@@ -2423,6 +2423,11 @@ extern "C" {
#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911
#endif
+#ifndef GL_ATI_texture_env_combine3
+#define GL_MODULATE_ADD_ATI 0x8744
+#define GL_MODULATE_SIGNED_ADD_ATI 0x8745
+#define GL_MODULATE_SUBTRACT_ATI 0x8746
+#endif
/*************************************************************/
@@ -5016,6 +5021,9 @@ GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum);
typedef void (APIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
#endif
+#ifndef GL_ATI_texture_env_combine3
+#define GL_ATI_texture_env_combine3 1
+#endif
#ifdef __cplusplus
}
diff --git a/xc/extras/Mesa/include/GL/osmesa.h b/xc/extras/Mesa/include/GL/osmesa.h
index cf827a702..cf892b91c 100644
--- a/xc/extras/Mesa/include/GL/osmesa.h
+++ b/xc/extras/Mesa/include/GL/osmesa.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -61,8 +61,8 @@ extern "C" {
#define OSMESA_MAJOR_VERSION 4
-#define OSMESA_MINOR_VERSION 0
-#define OSMESA_PATCH_VERSION 3
+#define OSMESA_MINOR_VERSION 1
+#define OSMESA_PATCH_VERSION 0
@@ -252,6 +252,15 @@ OSMesaGetColorBuffer( OSMesaContext c, GLint *width, GLint *height,
+/*
+ * Return pointer to the named function.
+ *
+ * New in Mesa 4.1
+ */
+GLAPI void * GLAPIENTRY
+OSMesaGetProcAddress( const char *funcName );
+
+
#if defined(__BEOS__) || defined(__QUICKDRAW__)
#pragma export off
#endif
diff --git a/xc/extras/Mesa/include/GL/xmesa.h b/xc/extras/Mesa/include/GL/xmesa.h
index 056f717bb..49a511cc9 100644
--- a/xc/extras/Mesa/include/GL/xmesa.h
+++ b/xc/extras/Mesa/include/GL/xmesa.h
@@ -1,8 +1,9 @@
+
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * 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"),
@@ -88,7 +89,7 @@ extern struct Library *XLibBase;
#define XMESA_MAJOR_VERSION 4
-#define XMESA_MINOR_VERSION 0
+#define XMESA_MINOR_VERSION 1
@@ -372,6 +373,16 @@ extern GLboolean XMesaSetFXmode( GLint mode );
extern void XMesaResizeBuffers( XMesaBuffer b );
+
+/*
+ * Create a pbuffer.
+ * New in Mesa 4.1
+ */
+extern XMesaBuffer XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap,
+ unsigned int width, unsigned int height);
+
+
+
#ifdef __cplusplus
}
#endif
diff --git a/xc/extras/Mesa/include/GL/xmesa_x.h b/xc/extras/Mesa/include/GL/xmesa_x.h
index def044719..e7bdb6324 100644
--- a/xc/extras/Mesa/include/GL/xmesa_x.h
+++ b/xc/extras/Mesa/include/GL/xmesa_x.h
@@ -30,6 +30,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
*
+ * $Header: /home/ajax/dri-backup/xc/xc/extras/Mesa/include/GL/Attic/xmesa_x.h,v 1.7.26.1 2003/02/21 07:15:42 anholt Exp $
*/
#ifndef _XMESA_X_H_
diff --git a/xc/extras/Mesa/include/GL/xmesa_xf86.h b/xc/extras/Mesa/include/GL/xmesa_xf86.h
index 983f234dd..164e00ce3 100644
--- a/xc/extras/Mesa/include/GL/xmesa_xf86.h
+++ b/xc/extras/Mesa/include/GL/xmesa_xf86.h
@@ -30,6 +30,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
*
+ * $Header: /home/ajax/dri-backup/xc/xc/extras/Mesa/include/GL/Attic/xmesa_xf86.h,v 1.8.26.1 2003/02/21 07:15:42 anholt Exp $
*/
#ifndef _XMESA_XF86_H_
diff --git a/xc/extras/Mesa/src/OSmesa/osmesa.c b/xc/extras/Mesa/src/OSmesa/osmesa.c
index 0735e2d64..e5a79e1c3 100644
--- a/xc/extras/Mesa/src/OSmesa/osmesa.c
+++ b/xc/extras/Mesa/src/OSmesa/osmesa.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 5.0
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -40,9 +40,9 @@
#include "colormac.h"
#include "depth.h"
#include "extensions.h"
+#include "imports.h"
#include "macros.h"
#include "matrix.h"
-#include "mem.h"
#include "mmath.h"
#include "mtypes.h"
#include "texformat.h"
@@ -54,7 +54,6 @@
#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"
@@ -293,7 +292,8 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
osmesa->gl_visual,
sharelist ? &sharelist->gl_ctx
: (GLcontext *) NULL,
- (void *) osmesa, GL_TRUE )) {
+ (void *) osmesa,
+ GL_FALSE)) {
_mesa_destroy_visual( osmesa->gl_visual );
FREE(osmesa);
return NULL;
@@ -301,6 +301,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
_mesa_enable_sw_extensions(&(osmesa->gl_ctx));
_mesa_enable_1_3_extensions(&(osmesa->gl_ctx));
+ _mesa_enable_1_4_extensions(&(osmesa->gl_ctx));
osmesa->gl_buffer = _mesa_create_framebuffer( osmesa->gl_visual,
(GLboolean) ( osmesa->gl_visual->depthBits > 0 ),
@@ -473,7 +474,7 @@ OSMesaMakeCurrent( OSMesaContext ctx, void *buffer, GLenum type,
compute_row_addresses( ctx );
/* init viewport */
- if (ctx->gl_ctx.Viewport.Width==0) {
+ if (ctx->gl_ctx.Viewport.Width == 0) {
/* initialize viewport and scissor box to buffer size */
_mesa_Viewport( 0, 0, width, height );
ctx->gl_ctx.Scissor.Width = width;
@@ -624,6 +625,39 @@ OSMesaGetColorBuffer( OSMesaContext c, GLint *width,
}
}
+
+
+struct name_address {
+ const char *Name;
+ GLvoid *Address;
+};
+
+static struct name_address functions[] = {
+ { "OSMesaCreateContext", (void *) OSMesaCreateContext },
+ { "OSMesaCreateContextExt", (void *) OSMesaCreateContextExt },
+ { "OSMesaDestroyContext", (void *) OSMesaDestroyContext },
+ { "OSMesaMakeCurrent", (void *) OSMesaMakeCurrent },
+ { "OSMesaGetCurrentContext", (void *) OSMesaGetCurrentContext },
+ { "OSMesaPixelsStore", (void *) OSMesaPixelStore },
+ { "OSMesaGetIntegerv", (void *) OSMesaGetIntegerv },
+ { "OSMesaGetDepthBuffer", (void *) OSMesaGetDepthBuffer },
+ { "OSMesaGetColorBuffer", (void *) OSMesaGetColorBuffer },
+ { "OSMesaGetProcAddress", (void *) OSMesaGetProcAddress },
+ { NULL, NULL }
+};
+
+GLAPI void * GLAPIENTRY
+OSMesaGetProcAddress( const char *funcName )
+{
+ int i;
+ for (i = 0; functions[i].Name; i++) {
+ if (_mesa_strcmp(functions[i].Name, funcName) == 0)
+ return (void *) functions[i].Address;
+ }
+ return (void *) _glapi_get_proc_address(funcName);
+}
+
+
/**********************************************************************/
/*** Device Driver Functions ***/
/**********************************************************************/
@@ -634,12 +668,12 @@ OSMesaGetColorBuffer( OSMesaContext c, GLint *width,
*/
#if CHAN_TYPE == GL_FLOAT
-#define PACK_RGBA(DST, R, G, B, A) \
-do { \
- (DST)[0] = (R < 0.0f) ? 0.0f : ((R > 1.0f) ? 1.0f : R); \
- (DST)[1] = (G < 0.0f) ? 0.0f : ((G > 1.0f) ? 1.0f : G); \
- (DST)[2] = (B < 0.0f) ? 0.0f : ((B > 1.0f) ? 1.0f : B); \
- (DST)[3] = (A < 0.0f) ? 0.0f : ((A > 1.0f) ? 1.0f : A); \
+#define PACK_RGBA(DST, R, G, B, A) \
+do { \
+ (DST)[0] = MAX2( R, 0.0F ); \
+ (DST)[1] = MAX2( G, 0.0F ); \
+ (DST)[2] = MAX2( B, 0.0F ); \
+ (DST)[3] = CLAMP(A, 0.0F, CHAN_MAXF);\
} while (0)
#else
#define PACK_RGBA(DST, R, G, B, A) \
@@ -684,19 +718,11 @@ do { \
-static void set_draw_buffer( GLcontext *ctx, GLenum mode )
-{
- /* A no-op since there's only one color buffer! */
- (void) ctx;
- (void) mode;
-}
-
-
-static void set_read_buffer( GLcontext *ctx, GLframebuffer *buffer, GLenum mode )
+static void set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit )
{
/* separate read buffer not supported */
ASSERT(buffer == ctx->DrawBuffer);
- ASSERT(mode == GL_FRONT_LEFT);
+ ASSERT(bufferBit == FRONT_LEFT_BIT);
}
@@ -738,9 +764,10 @@ static void clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
}
else if (osmesa->format == OSMESA_RGB) {
- const GLchan r = ctx->Color.ClearColor[0];
- const GLchan g = ctx->Color.ClearColor[1];
- const GLchan b = ctx->Color.ClearColor[2];
+ GLchan r, g, b;
+ CLAMPED_FLOAT_TO_CHAN(r, ctx->Color.ClearColor[0]);
+ CLAMPED_FLOAT_TO_CHAN(g, ctx->Color.ClearColor[1]);
+ CLAMPED_FLOAT_TO_CHAN(b, ctx->Color.ClearColor[2]);
if (all) {
/* Clear whole RGB buffer */
GLuint n = osmesa->rowlength * osmesa->height;
@@ -764,9 +791,10 @@ static void clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
}
else if (osmesa->format == OSMESA_BGR) {
- const GLchan r = ctx->Color.ClearColor[0];
- const GLchan g = ctx->Color.ClearColor[1];
- const GLchan b = ctx->Color.ClearColor[2];
+ GLchan r, g, b;
+ CLAMPED_FLOAT_TO_CHAN(r, ctx->Color.ClearColor[0]);
+ CLAMPED_FLOAT_TO_CHAN(g, ctx->Color.ClearColor[1]);
+ CLAMPED_FLOAT_TO_CHAN(b, ctx->Color.ClearColor[2]);
if (all) {
/* Clear whole RGB buffer */
const GLint n = osmesa->rowlength * osmesa->height;
@@ -790,10 +818,11 @@ static void clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
}
else if (osmesa->format == OSMESA_RGB_565) {
- const GLchan r = ctx->Color.ClearColor[0];
- const GLchan g = ctx->Color.ClearColor[1];
- const GLchan b = ctx->Color.ClearColor[2];
GLushort clearPixel;
+ GLchan r, g, b;
+ CLAMPED_FLOAT_TO_CHAN(r, ctx->Color.ClearColor[0]);
+ CLAMPED_FLOAT_TO_CHAN(g, ctx->Color.ClearColor[1]);
+ CLAMPED_FLOAT_TO_CHAN(b, ctx->Color.ClearColor[2]);
PACK_RGB_565(clearPixel, r, g, b);
if (all) {
/* Clear whole RGB buffer */
@@ -822,10 +851,10 @@ static void clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
/* 4-byte pixel value */
GLuint clearPixel;
GLchan *clr = (GLchan *) &clearPixel;
- clr[osmesa->rInd] = ctx->Color.ClearColor[0];
- clr[osmesa->gInd] = ctx->Color.ClearColor[1];
- clr[osmesa->bInd] = ctx->Color.ClearColor[2];
- clr[osmesa->aInd] = ctx->Color.ClearColor[3];
+ CLAMPED_FLOAT_TO_CHAN(clr[osmesa->rInd], ctx->Color.ClearColor[0]);
+ CLAMPED_FLOAT_TO_CHAN(clr[osmesa->gInd], ctx->Color.ClearColor[1]);
+ CLAMPED_FLOAT_TO_CHAN(clr[osmesa->bInd], ctx->Color.ClearColor[2]);
+ CLAMPED_FLOAT_TO_CHAN(clr[osmesa->aInd], ctx->Color.ClearColor[3]);
if (all) {
/* Clear whole RGBA buffer */
const GLuint n = osmesa->rowlength * osmesa->height;
@@ -837,7 +866,7 @@ static void clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
}
else {
- BZERO(ptr4, n * sizeof(GLuint));
+ _mesa_bzero(ptr4, n * sizeof(GLuint));
}
}
else {
@@ -851,10 +880,11 @@ static void clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
}
#else
- const GLchan r = ctx->Color.ClearColor[0];
- const GLchan g = ctx->Color.ClearColor[1];
- const GLchan b = ctx->Color.ClearColor[2];
- const GLchan a = ctx->Color.ClearColor[3];
+ GLchan r, g, b, a;
+ CLAMPED_FLOAT_TO_CHAN(r, ctx->Color.ClearColor[0]);
+ CLAMPED_FLOAT_TO_CHAN(g, ctx->Color.ClearColor[1]);
+ CLAMPED_FLOAT_TO_CHAN(b, ctx->Color.ClearColor[2]);
+ CLAMPED_FLOAT_TO_CHAN(a, ctx->Color.ClearColor[3]);
if (all) {
/* Clear whole RGBA buffer */
const GLuint n = osmesa->rowlength * osmesa->height;
@@ -891,13 +921,8 @@ static void clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
static void buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height )
{
-#ifdef WIN32
- /* Hack to get around problems with exporting glapi_Context from Mesa
- and importing into OSMesa. */
+ /* don't use GET_CURRENT_CONTEXT(ctx) here - it's a problem on Windows */
GLcontext *ctx = (GLcontext *) _glapi_get_context();
-#else
- GET_CURRENT_CONTEXT(ctx);
-#endif
(void) buffer;
if (ctx) {
OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
@@ -1785,7 +1810,7 @@ osmesa_choose_line_function( GLcontext *ctx )
if (CHAN_BITS != 8) return NULL;
if (ctx->RenderMode != GL_RENDER) return NULL;
if (ctx->Line.SmoothFlag) return NULL;
- if (ctx->Texture._ReallyEnabled) return NULL;
+ if (ctx->Texture._EnabledUnits) return NULL;
if (ctx->Light.ShadeModel != GL_FLAT) return NULL;
if (ctx->Line.Width != 1.0F) return NULL;
if (ctx->Line.StippleFlag) return NULL;
@@ -1794,7 +1819,6 @@ osmesa_choose_line_function( GLcontext *ctx )
osmesa->format != OSMESA_BGRA &&
osmesa->format != OSMESA_ARGB) return NULL;
-
if (swrast->_RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
@@ -1857,7 +1881,6 @@ static void smooth_rgba_z_triangle( GLcontext *ctx,
const SWvertex *v2 )
{
const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
-
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
@@ -1865,7 +1888,7 @@ static void smooth_rgba_z_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
GLchan *img = PIXELADDR4(span.x, span.y); \
- for (i = 0; i < span.count; i++, img += 4) { \
+ for (i = 0; i < span.end; i++, img += 4) { \
const GLdepth z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
PACK_RGBA(img, FixedToChan(span.red), \
@@ -1909,7 +1932,7 @@ static void flat_rgba_z_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
GLuint *img = (GLuint *) PIXELADDR4(span.x, span.y); \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
const GLdepth z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
img[i] = pixel; \
@@ -1940,7 +1963,7 @@ osmesa_choose_triangle_function( GLcontext *ctx )
if (ctx->RenderMode != GL_RENDER) return (swrast_tri_func) NULL;
if (ctx->Polygon.SmoothFlag) return (swrast_tri_func) NULL;
if (ctx->Polygon.StippleFlag) return (swrast_tri_func) NULL;
- if (ctx->Texture._ReallyEnabled) return (swrast_tri_func) NULL;
+ if (ctx->Texture._EnabledUnits) return (swrast_tri_func) NULL;
if (osmesa->format != OSMESA_RGBA &&
osmesa->format != OSMESA_BGRA &&
osmesa->format != OSMESA_ARGB) return (swrast_tri_func) NULL;
@@ -2050,9 +2073,8 @@ static void osmesa_update_state( GLcontext *ctx, GLuint new_state )
ctx->Driver.GetString = get_string;
ctx->Driver.UpdateState = osmesa_update_state;
- ctx->Driver.SetDrawBuffer = set_draw_buffer;
- ctx->Driver.GetBufferSize = buffer_size;
ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
+ ctx->Driver.GetBufferSize = buffer_size;
ctx->Driver.Accum = _swrast_Accum;
ctx->Driver.Bitmap = _swrast_Bitmap;
@@ -2060,6 +2082,7 @@ static void osmesa_update_state( GLcontext *ctx, GLuint new_state )
ctx->Driver.CopyPixels = _swrast_CopyPixels;
ctx->Driver.DrawPixels = _swrast_DrawPixels;
ctx->Driver.ReadPixels = _swrast_ReadPixels;
+ ctx->Driver.DrawBuffer = _swrast_DrawBuffer;
ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format;
ctx->Driver.TexImage1D = _mesa_store_teximage1d;
@@ -2070,6 +2093,13 @@ static void osmesa_update_state( GLcontext *ctx, GLuint new_state )
ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d;
ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage;
+ ctx->Driver.CompressedTexImage1D = _mesa_store_compressed_teximage1d;
+ ctx->Driver.CompressedTexImage2D = _mesa_store_compressed_teximage2d;
+ ctx->Driver.CompressedTexImage3D = _mesa_store_compressed_teximage3d;
+ ctx->Driver.CompressedTexSubImage1D = _mesa_store_compressed_texsubimage1d;
+ ctx->Driver.CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d;
+ ctx->Driver.CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d;
+
ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d;
ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d;
ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d;
@@ -2080,9 +2110,7 @@ static void osmesa_update_state( GLcontext *ctx, GLuint new_state )
ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
- ctx->Driver.BaseCompressedTexFormat = _mesa_base_compressed_texformat;
- ctx->Driver.CompressedTextureSize = _mesa_compressed_texture_size;
- ctx->Driver.GetCompressedTexImage = _mesa_get_compressed_teximage;
+ swdd->SetBuffer = set_buffer;
/* RGB(A) span/pixel functions */
if (osmesa->format == OSMESA_RGB) {
@@ -2141,8 +2169,6 @@ static void osmesa_update_state( GLcontext *ctx, GLuint new_state )
swdd->ReadCI32Span = read_index_span;
swdd->ReadCI32Pixels = read_index_pixels;
- swdd->SetReadBuffer = set_read_buffer;
-
tnl->Driver.RunPipeline = _tnl_run_pipeline;
_swrast_InvalidateState( ctx, new_state );
diff --git a/xc/extras/Mesa/src/SPARC/glapi_sparc.S b/xc/extras/Mesa/src/SPARC/glapi_sparc.S
index 9d3eb8e20..738170087 100644
--- a/xc/extras/Mesa/src/SPARC/glapi_sparc.S
+++ b/xc/extras/Mesa/src/SPARC/glapi_sparc.S
@@ -1,9 +1,6 @@
/* DO NOT EDIT - This file generated automatically with glsparcasm.py script */
#include "glapioffsets.h"
-
-
-
/* The _glapi_Dispatch symbol addresses get relocated into the
* sethi/or instruction sequences below at library init time.
*/
@@ -8697,6 +8694,27 @@ glSampleCoverageARB:
jmpl %g3, %g0
nop
+.globl gl__unused413
+.type gl__unused413,#function
+gl__unused413:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset___unused413), %g2
+ or %g2, %lo(8 * _gloffset___unused413), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset___unused413)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
.globl glCompressedTexImage3DARB
.type glCompressedTexImage3DARB,#function
glCompressedTexImage3DARB:
@@ -8844,6 +8862,972 @@ glGetCompressedTexImageARB:
jmpl %g3, %g0
nop
+.globl glActiveTexture
+.type glActiveTexture,#function
+glActiveTexture:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_ActiveTextureARB), %g2
+ or %g2, %lo(8 * _gloffset_ActiveTextureARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_ActiveTextureARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glClientActiveTexture
+.type glClientActiveTexture,#function
+glClientActiveTexture:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_ClientActiveTextureARB), %g2
+ or %g2, %lo(8 * _gloffset_ClientActiveTextureARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_ClientActiveTextureARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord1d
+.type glMultiTexCoord1d,#function
+glMultiTexCoord1d:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord1dARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord1dARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord1dARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord1dv
+.type glMultiTexCoord1dv,#function
+glMultiTexCoord1dv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord1dvARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord1dvARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord1dvARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord1f
+.type glMultiTexCoord1f,#function
+glMultiTexCoord1f:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord1fARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord1fARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord1fARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord1fv
+.type glMultiTexCoord1fv,#function
+glMultiTexCoord1fv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord1fvARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord1fvARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord1fvARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord1i
+.type glMultiTexCoord1i,#function
+glMultiTexCoord1i:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord1iARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord1iARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord1iARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord1iv
+.type glMultiTexCoord1iv,#function
+glMultiTexCoord1iv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord1ivARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord1ivARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord1ivARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord1s
+.type glMultiTexCoord1s,#function
+glMultiTexCoord1s:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord1sARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord1sARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord1sARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord1sv
+.type glMultiTexCoord1sv,#function
+glMultiTexCoord1sv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord1svARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord1svARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord1svARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord2d
+.type glMultiTexCoord2d,#function
+glMultiTexCoord2d:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord2dARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord2dARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord2dARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord2dv
+.type glMultiTexCoord2dv,#function
+glMultiTexCoord2dv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord2dvARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord2dvARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord2dvARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord2f
+.type glMultiTexCoord2f,#function
+glMultiTexCoord2f:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord2fARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord2fARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord2fARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord2fv
+.type glMultiTexCoord2fv,#function
+glMultiTexCoord2fv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord2fvARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord2fvARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord2fvARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord2i
+.type glMultiTexCoord2i,#function
+glMultiTexCoord2i:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord2iARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord2iARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord2iARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord2iv
+.type glMultiTexCoord2iv,#function
+glMultiTexCoord2iv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord2ivARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord2ivARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord2ivARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord2s
+.type glMultiTexCoord2s,#function
+glMultiTexCoord2s:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord2sARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord2sARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord2sARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord2sv
+.type glMultiTexCoord2sv,#function
+glMultiTexCoord2sv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord2svARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord2svARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord2svARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord3d
+.type glMultiTexCoord3d,#function
+glMultiTexCoord3d:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord3dARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord3dARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord3dARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord3dv
+.type glMultiTexCoord3dv,#function
+glMultiTexCoord3dv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord3dvARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord3dvARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord3dvARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord3f
+.type glMultiTexCoord3f,#function
+glMultiTexCoord3f:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord3fARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord3fARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord3fARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord3fv
+.type glMultiTexCoord3fv,#function
+glMultiTexCoord3fv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord3fvARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord3fvARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord3fvARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord3i
+.type glMultiTexCoord3i,#function
+glMultiTexCoord3i:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord3iARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord3iARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord3iARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord3iv
+.type glMultiTexCoord3iv,#function
+glMultiTexCoord3iv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord3ivARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord3ivARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord3ivARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord3s
+.type glMultiTexCoord3s,#function
+glMultiTexCoord3s:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord3sARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord3sARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord3sARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord3sv
+.type glMultiTexCoord3sv,#function
+glMultiTexCoord3sv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord3svARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord3svARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord3svARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord4d
+.type glMultiTexCoord4d,#function
+glMultiTexCoord4d:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord4dARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord4dARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord4dARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord4dv
+.type glMultiTexCoord4dv,#function
+glMultiTexCoord4dv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord4dvARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord4dvARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord4dvARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord4f
+.type glMultiTexCoord4f,#function
+glMultiTexCoord4f:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord4fARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord4fARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord4fARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord4fv
+.type glMultiTexCoord4fv,#function
+glMultiTexCoord4fv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord4fvARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord4fvARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord4fvARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord4i
+.type glMultiTexCoord4i,#function
+glMultiTexCoord4i:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord4iARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord4iARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord4iARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord4iv
+.type glMultiTexCoord4iv,#function
+glMultiTexCoord4iv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord4ivARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord4ivARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord4ivARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord4s
+.type glMultiTexCoord4s,#function
+glMultiTexCoord4s:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord4sARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord4sARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord4sARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiTexCoord4sv
+.type glMultiTexCoord4sv,#function
+glMultiTexCoord4sv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiTexCoord4svARB), %g2
+ or %g2, %lo(8 * _gloffset_MultiTexCoord4svARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiTexCoord4svARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glLoadTransposeMatrixf
+.type glLoadTransposeMatrixf,#function
+glLoadTransposeMatrixf:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_LoadTransposeMatrixfARB), %g2
+ or %g2, %lo(8 * _gloffset_LoadTransposeMatrixfARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_LoadTransposeMatrixfARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glLoadTransposeMatrixd
+.type glLoadTransposeMatrixd,#function
+glLoadTransposeMatrixd:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_LoadTransposeMatrixdARB), %g2
+ or %g2, %lo(8 * _gloffset_LoadTransposeMatrixdARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_LoadTransposeMatrixdARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultTransposeMatrixf
+.type glMultTransposeMatrixf,#function
+glMultTransposeMatrixf:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultTransposeMatrixfARB), %g2
+ or %g2, %lo(8 * _gloffset_MultTransposeMatrixfARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultTransposeMatrixfARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultTransposeMatrixd
+.type glMultTransposeMatrixd,#function
+glMultTransposeMatrixd:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultTransposeMatrixdARB), %g2
+ or %g2, %lo(8 * _gloffset_MultTransposeMatrixdARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultTransposeMatrixdARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSampleCoverage
+.type glSampleCoverage,#function
+glSampleCoverage:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SampleCoverageARB), %g2
+ or %g2, %lo(8 * _gloffset_SampleCoverageARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SampleCoverageARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glCompressedTexImage3D
+.type glCompressedTexImage3D,#function
+glCompressedTexImage3D:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_CompressedTexImage3DARB), %g2
+ or %g2, %lo(8 * _gloffset_CompressedTexImage3DARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_CompressedTexImage3DARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glCompressedTexImage2D
+.type glCompressedTexImage2D,#function
+glCompressedTexImage2D:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_CompressedTexImage2DARB), %g2
+ or %g2, %lo(8 * _gloffset_CompressedTexImage2DARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_CompressedTexImage2DARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glCompressedTexImage1D
+.type glCompressedTexImage1D,#function
+glCompressedTexImage1D:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_CompressedTexImage1DARB), %g2
+ or %g2, %lo(8 * _gloffset_CompressedTexImage1DARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_CompressedTexImage1DARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glCompressedTexSubImage3D
+.type glCompressedTexSubImage3D,#function
+glCompressedTexSubImage3D:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_CompressedTexSubImage3DARB), %g2
+ or %g2, %lo(8 * _gloffset_CompressedTexSubImage3DARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_CompressedTexSubImage3DARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glCompressedTexSubImage2D
+.type glCompressedTexSubImage2D,#function
+glCompressedTexSubImage2D:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_CompressedTexSubImage2DARB), %g2
+ or %g2, %lo(8 * _gloffset_CompressedTexSubImage2DARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_CompressedTexSubImage2DARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glCompressedTexSubImage1D
+.type glCompressedTexSubImage1D,#function
+glCompressedTexSubImage1D:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_CompressedTexSubImage1DARB), %g2
+ or %g2, %lo(8 * _gloffset_CompressedTexSubImage1DARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_CompressedTexSubImage1DARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glGetCompressedTexImage
+.type glGetCompressedTexImage,#function
+glGetCompressedTexImage:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_GetCompressedTexImageARB), %g2
+ or %g2, %lo(8 * _gloffset_GetCompressedTexImageARB), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_GetCompressedTexImageARB)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
.globl glBlendColorEXT
.type glBlendColorEXT,#function
glBlendColorEXT:
@@ -10146,6 +11130,48 @@ glGetSharpenTexFuncSGIS:
jmpl %g3, %g0
nop
+.globl glSampleMaskSGIS
+.type glSampleMaskSGIS,#function
+glSampleMaskSGIS:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SampleMaskSGIS), %g2
+ or %g2, %lo(8 * _gloffset_SampleMaskSGIS), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SampleMaskSGIS)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSamplePatternSGIS
+.type glSamplePatternSGIS,#function
+glSamplePatternSGIS:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SamplePatternSGIS), %g2
+ or %g2, %lo(8 * _gloffset_SamplePatternSGIS), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SamplePatternSGIS)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
.globl glArrayElementEXT
.type glArrayElementEXT,#function
glArrayElementEXT:
@@ -10482,6 +11508,48 @@ glPointParameterfvEXT:
jmpl %g3, %g0
nop
+.globl glPointParameterfARB
+.type glPointParameterfARB,#function
+glPointParameterfARB:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_PointParameterfEXT), %g2
+ or %g2, %lo(8 * _gloffset_PointParameterfEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_PointParameterfEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glPointParameterfvARB
+.type glPointParameterfvARB,#function
+glPointParameterfvARB:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_PointParameterfvEXT), %g2
+ or %g2, %lo(8 * _gloffset_PointParameterfvEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_PointParameterfvEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
.globl glPointParameterfSGIS
.type glPointParameterfSGIS,#function
glPointParameterfSGIS:
@@ -11889,6 +12957,48 @@ glSecondaryColorPointerEXT:
jmpl %g3, %g0
nop
+.globl glMultiDrawArraysEXT
+.type glMultiDrawArraysEXT,#function
+glMultiDrawArraysEXT:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiDrawArraysEXT), %g2
+ or %g2, %lo(8 * _gloffset_MultiDrawArraysEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiDrawArraysEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiDrawElementsEXT
+.type glMultiDrawElementsEXT,#function
+glMultiDrawElementsEXT:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiDrawElementsEXT), %g2
+ or %g2, %lo(8 * _gloffset_MultiDrawElementsEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiDrawElementsEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
.globl glFogCoordfEXT
.type glFogCoordfEXT,#function
glFogCoordfEXT:
@@ -12960,9 +14070,9 @@ glTbufferMask3DFX:
jmpl %g3, %g0
nop
-.globl glSampleMaskSGIS
-.type glSampleMaskSGIS,#function
-glSampleMaskSGIS:
+.globl glSampleMaskEXT
+.type glSampleMaskEXT,#function
+glSampleMaskEXT:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -12981,9 +14091,9 @@ glSampleMaskSGIS:
jmpl %g3, %g0
nop
-.globl glSamplePatternSGIS
-.type glSamplePatternSGIS,#function
-glSamplePatternSGIS:
+.globl glSamplePatternEXT
+.type glSamplePatternEXT,#function
+glSamplePatternEXT:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13002,9 +14112,9 @@ glSamplePatternSGIS:
jmpl %g3, %g0
nop
-.globl glActiveTexture
-.type glActiveTexture,#function
-glActiveTexture:
+.globl glDeleteFencesNV
+.type glDeleteFencesNV,#function
+glDeleteFencesNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13012,20 +14122,20 @@ glActiveTexture:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_ActiveTextureARB), %g2
- or %g2, %lo(8 * _gloffset_ActiveTextureARB), %g2
+ sethi %hi(8 * _gloffset_DeleteFencesNV), %g2
+ or %g2, %lo(8 * _gloffset_DeleteFencesNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_ActiveTextureARB)], %g3
+ ld [%g1 + (4 * _gloffset_DeleteFencesNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glClientActiveTexture
-.type glClientActiveTexture,#function
-glClientActiveTexture:
+.globl glGenFencesNV
+.type glGenFencesNV,#function
+glGenFencesNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13033,20 +14143,20 @@ glClientActiveTexture:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_ClientActiveTextureARB), %g2
- or %g2, %lo(8 * _gloffset_ClientActiveTextureARB), %g2
+ sethi %hi(8 * _gloffset_GenFencesNV), %g2
+ or %g2, %lo(8 * _gloffset_GenFencesNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_ClientActiveTextureARB)], %g3
+ ld [%g1 + (4 * _gloffset_GenFencesNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glCompressedTexImage1D
-.type glCompressedTexImage1D,#function
-glCompressedTexImage1D:
+.globl glIsFenceNV
+.type glIsFenceNV,#function
+glIsFenceNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13054,20 +14164,20 @@ glCompressedTexImage1D:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_CompressedTexImage1DARB), %g2
- or %g2, %lo(8 * _gloffset_CompressedTexImage1DARB), %g2
+ sethi %hi(8 * _gloffset_IsFenceNV), %g2
+ or %g2, %lo(8 * _gloffset_IsFenceNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_CompressedTexImage1DARB)], %g3
+ ld [%g1 + (4 * _gloffset_IsFenceNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glCompressedTexImage2D
-.type glCompressedTexImage2D,#function
-glCompressedTexImage2D:
+.globl glTestFenceNV
+.type glTestFenceNV,#function
+glTestFenceNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13075,20 +14185,20 @@ glCompressedTexImage2D:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_CompressedTexImage2DARB), %g2
- or %g2, %lo(8 * _gloffset_CompressedTexImage2DARB), %g2
+ sethi %hi(8 * _gloffset_TestFenceNV), %g2
+ or %g2, %lo(8 * _gloffset_TestFenceNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_CompressedTexImage2DARB)], %g3
+ ld [%g1 + (4 * _gloffset_TestFenceNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glCompressedTexImage3D
-.type glCompressedTexImage3D,#function
-glCompressedTexImage3D:
+.globl glGetFenceivNV
+.type glGetFenceivNV,#function
+glGetFenceivNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13096,20 +14206,20 @@ glCompressedTexImage3D:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_CompressedTexImage3DARB), %g2
- or %g2, %lo(8 * _gloffset_CompressedTexImage3DARB), %g2
+ sethi %hi(8 * _gloffset_GetFenceivNV), %g2
+ or %g2, %lo(8 * _gloffset_GetFenceivNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_CompressedTexImage3DARB)], %g3
+ ld [%g1 + (4 * _gloffset_GetFenceivNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glCompressedTexSubImage1D
-.type glCompressedTexSubImage1D,#function
-glCompressedTexSubImage1D:
+.globl glFinishFenceNV
+.type glFinishFenceNV,#function
+glFinishFenceNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13117,20 +14227,20 @@ glCompressedTexSubImage1D:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_CompressedTexSubImage1DARB), %g2
- or %g2, %lo(8 * _gloffset_CompressedTexSubImage1DARB), %g2
+ sethi %hi(8 * _gloffset_FinishFenceNV), %g2
+ or %g2, %lo(8 * _gloffset_FinishFenceNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_CompressedTexSubImage1DARB)], %g3
+ ld [%g1 + (4 * _gloffset_FinishFenceNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glCompressedTexSubImage2D
-.type glCompressedTexSubImage2D,#function
-glCompressedTexSubImage2D:
+.globl glSetFenceNV
+.type glSetFenceNV,#function
+glSetFenceNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13138,20 +14248,20 @@ glCompressedTexSubImage2D:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_CompressedTexSubImage2DARB), %g2
- or %g2, %lo(8 * _gloffset_CompressedTexSubImage2DARB), %g2
+ sethi %hi(8 * _gloffset_SetFenceNV), %g2
+ or %g2, %lo(8 * _gloffset_SetFenceNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_CompressedTexSubImage2DARB)], %g3
+ ld [%g1 + (4 * _gloffset_SetFenceNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glCompressedTexSubImage3D
-.type glCompressedTexSubImage3D,#function
-glCompressedTexSubImage3D:
+.globl glWindowPos2dARB
+.type glWindowPos2dARB,#function
+glWindowPos2dARB:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13159,20 +14269,20 @@ glCompressedTexSubImage3D:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_CompressedTexSubImage3DARB), %g2
- or %g2, %lo(8 * _gloffset_CompressedTexSubImage3DARB), %g2
+ sethi %hi(8 * _gloffset_WindowPos2dMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos2dMESA), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_CompressedTexSubImage3DARB)], %g3
+ ld [%g1 + (4 * _gloffset_WindowPos2dMESA)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glGetCompressedTexImage
-.type glGetCompressedTexImage,#function
-glGetCompressedTexImage:
+.globl glWindowPos2fARB
+.type glWindowPos2fARB,#function
+glWindowPos2fARB:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13180,20 +14290,20 @@ glGetCompressedTexImage:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_GetCompressedTexImageARB), %g2
- or %g2, %lo(8 * _gloffset_GetCompressedTexImageARB), %g2
+ sethi %hi(8 * _gloffset_WindowPos2fMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos2fMESA), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_GetCompressedTexImageARB)], %g3
+ ld [%g1 + (4 * _gloffset_WindowPos2fMESA)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord1d
-.type glMultiTexCoord1d,#function
-glMultiTexCoord1d:
+.globl glWindowPos2iARB
+.type glWindowPos2iARB,#function
+glWindowPos2iARB:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13201,20 +14311,20 @@ glMultiTexCoord1d:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord1dARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord1dARB), %g2
+ sethi %hi(8 * _gloffset_WindowPos2iMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos2iMESA), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord1dARB)], %g3
+ ld [%g1 + (4 * _gloffset_WindowPos2iMESA)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord1dv
-.type glMultiTexCoord1dv,#function
-glMultiTexCoord1dv:
+.globl glWindowPos2sARB
+.type glWindowPos2sARB,#function
+glWindowPos2sARB:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13222,20 +14332,20 @@ glMultiTexCoord1dv:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord1dvARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord1dvARB), %g2
+ sethi %hi(8 * _gloffset_WindowPos2sMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos2sMESA), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord1dvARB)], %g3
+ ld [%g1 + (4 * _gloffset_WindowPos2sMESA)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord1f
-.type glMultiTexCoord1f,#function
-glMultiTexCoord1f:
+.globl glWindowPos2dvARB
+.type glWindowPos2dvARB,#function
+glWindowPos2dvARB:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13243,20 +14353,20 @@ glMultiTexCoord1f:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord1fARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord1fARB), %g2
+ sethi %hi(8 * _gloffset_WindowPos2dvMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos2dvMESA), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord1fARB)], %g3
+ ld [%g1 + (4 * _gloffset_WindowPos2dvMESA)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord1fv
-.type glMultiTexCoord1fv,#function
-glMultiTexCoord1fv:
+.globl glWindowPos2fvARB
+.type glWindowPos2fvARB,#function
+glWindowPos2fvARB:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13264,20 +14374,20 @@ glMultiTexCoord1fv:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord1fvARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord1fvARB), %g2
+ sethi %hi(8 * _gloffset_WindowPos2fvMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos2fvMESA), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord1fvARB)], %g3
+ ld [%g1 + (4 * _gloffset_WindowPos2fvMESA)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord1i
-.type glMultiTexCoord1i,#function
-glMultiTexCoord1i:
+.globl glWindowPos2ivARB
+.type glWindowPos2ivARB,#function
+glWindowPos2ivARB:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13285,20 +14395,20 @@ glMultiTexCoord1i:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord1iARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord1iARB), %g2
+ sethi %hi(8 * _gloffset_WindowPos2ivMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos2ivMESA), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord1iARB)], %g3
+ ld [%g1 + (4 * _gloffset_WindowPos2ivMESA)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord1iv
-.type glMultiTexCoord1iv,#function
-glMultiTexCoord1iv:
+.globl glWindowPos2svARB
+.type glWindowPos2svARB,#function
+glWindowPos2svARB:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13306,20 +14416,20 @@ glMultiTexCoord1iv:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord1ivARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord1ivARB), %g2
+ sethi %hi(8 * _gloffset_WindowPos2svMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos2svMESA), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord1ivARB)], %g3
+ ld [%g1 + (4 * _gloffset_WindowPos2svMESA)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord1s
-.type glMultiTexCoord1s,#function
-glMultiTexCoord1s:
+.globl glWindowPos3dARB
+.type glWindowPos3dARB,#function
+glWindowPos3dARB:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13327,20 +14437,20 @@ glMultiTexCoord1s:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord1sARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord1sARB), %g2
+ sethi %hi(8 * _gloffset_WindowPos3dMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos3dMESA), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord1sARB)], %g3
+ ld [%g1 + (4 * _gloffset_WindowPos3dMESA)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord1sv
-.type glMultiTexCoord1sv,#function
-glMultiTexCoord1sv:
+.globl glWindowPos3fARB
+.type glWindowPos3fARB,#function
+glWindowPos3fARB:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13348,20 +14458,20 @@ glMultiTexCoord1sv:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord1svARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord1svARB), %g2
+ sethi %hi(8 * _gloffset_WindowPos3fMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos3fMESA), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord1svARB)], %g3
+ ld [%g1 + (4 * _gloffset_WindowPos3fMESA)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord2d
-.type glMultiTexCoord2d,#function
-glMultiTexCoord2d:
+.globl glWindowPos3iARB
+.type glWindowPos3iARB,#function
+glWindowPos3iARB:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13369,20 +14479,20 @@ glMultiTexCoord2d:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord2dARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord2dARB), %g2
+ sethi %hi(8 * _gloffset_WindowPos3iMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos3iMESA), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord2dARB)], %g3
+ ld [%g1 + (4 * _gloffset_WindowPos3iMESA)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord2dv
-.type glMultiTexCoord2dv,#function
-glMultiTexCoord2dv:
+.globl glWindowPos3sARB
+.type glWindowPos3sARB,#function
+glWindowPos3sARB:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13390,20 +14500,20 @@ glMultiTexCoord2dv:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord2dvARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord2dvARB), %g2
+ sethi %hi(8 * _gloffset_WindowPos3sMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos3sMESA), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord2dvARB)], %g3
+ ld [%g1 + (4 * _gloffset_WindowPos3sMESA)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord2f
-.type glMultiTexCoord2f,#function
-glMultiTexCoord2f:
+.globl glWindowPos3dvARB
+.type glWindowPos3dvARB,#function
+glWindowPos3dvARB:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13411,20 +14521,20 @@ glMultiTexCoord2f:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord2fARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord2fARB), %g2
+ sethi %hi(8 * _gloffset_WindowPos3dvMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos3dvMESA), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord2fARB)], %g3
+ ld [%g1 + (4 * _gloffset_WindowPos3dvMESA)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord2fv
-.type glMultiTexCoord2fv,#function
-glMultiTexCoord2fv:
+.globl glWindowPos3fvARB
+.type glWindowPos3fvARB,#function
+glWindowPos3fvARB:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13432,20 +14542,20 @@ glMultiTexCoord2fv:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord2fvARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord2fvARB), %g2
+ sethi %hi(8 * _gloffset_WindowPos3fvMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos3fvMESA), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord2fvARB)], %g3
+ ld [%g1 + (4 * _gloffset_WindowPos3fvMESA)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord2i
-.type glMultiTexCoord2i,#function
-glMultiTexCoord2i:
+.globl glWindowPos3ivARB
+.type glWindowPos3ivARB,#function
+glWindowPos3ivARB:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13453,20 +14563,20 @@ glMultiTexCoord2i:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord2iARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord2iARB), %g2
+ sethi %hi(8 * _gloffset_WindowPos3ivMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos3ivMESA), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord2iARB)], %g3
+ ld [%g1 + (4 * _gloffset_WindowPos3ivMESA)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord2iv
-.type glMultiTexCoord2iv,#function
-glMultiTexCoord2iv:
+.globl glWindowPos3svARB
+.type glWindowPos3svARB,#function
+glWindowPos3svARB:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13474,20 +14584,20 @@ glMultiTexCoord2iv:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord2ivARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord2ivARB), %g2
+ sethi %hi(8 * _gloffset_WindowPos3svMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos3svMESA), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord2ivARB)], %g3
+ ld [%g1 + (4 * _gloffset_WindowPos3svMESA)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord2s
-.type glMultiTexCoord2s,#function
-glMultiTexCoord2s:
+.globl glAreProgramsResidentNV
+.type glAreProgramsResidentNV,#function
+glAreProgramsResidentNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13495,20 +14605,20 @@ glMultiTexCoord2s:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord2sARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord2sARB), %g2
+ sethi %hi(8 * _gloffset_AreProgramsResidentNV), %g2
+ or %g2, %lo(8 * _gloffset_AreProgramsResidentNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord2sARB)], %g3
+ ld [%g1 + (4 * _gloffset_AreProgramsResidentNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord2sv
-.type glMultiTexCoord2sv,#function
-glMultiTexCoord2sv:
+.globl glBindProgramNV
+.type glBindProgramNV,#function
+glBindProgramNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13516,20 +14626,20 @@ glMultiTexCoord2sv:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord2svARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord2svARB), %g2
+ sethi %hi(8 * _gloffset_BindProgramNV), %g2
+ or %g2, %lo(8 * _gloffset_BindProgramNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord2svARB)], %g3
+ ld [%g1 + (4 * _gloffset_BindProgramNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord3d
-.type glMultiTexCoord3d,#function
-glMultiTexCoord3d:
+.globl glDeleteProgramsNV
+.type glDeleteProgramsNV,#function
+glDeleteProgramsNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13537,20 +14647,20 @@ glMultiTexCoord3d:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord3dARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord3dARB), %g2
+ sethi %hi(8 * _gloffset_DeleteProgramsNV), %g2
+ or %g2, %lo(8 * _gloffset_DeleteProgramsNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord3dARB)], %g3
+ ld [%g1 + (4 * _gloffset_DeleteProgramsNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord3dv
-.type glMultiTexCoord3dv,#function
-glMultiTexCoord3dv:
+.globl glExecuteProgramNV
+.type glExecuteProgramNV,#function
+glExecuteProgramNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13558,20 +14668,20 @@ glMultiTexCoord3dv:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord3dvARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord3dvARB), %g2
+ sethi %hi(8 * _gloffset_ExecuteProgramNV), %g2
+ or %g2, %lo(8 * _gloffset_ExecuteProgramNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord3dvARB)], %g3
+ ld [%g1 + (4 * _gloffset_ExecuteProgramNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord3f
-.type glMultiTexCoord3f,#function
-glMultiTexCoord3f:
+.globl glGenProgramsNV
+.type glGenProgramsNV,#function
+glGenProgramsNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13579,20 +14689,20 @@ glMultiTexCoord3f:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord3fARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord3fARB), %g2
+ sethi %hi(8 * _gloffset_GenProgramsNV), %g2
+ or %g2, %lo(8 * _gloffset_GenProgramsNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord3fARB)], %g3
+ ld [%g1 + (4 * _gloffset_GenProgramsNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord3fv
-.type glMultiTexCoord3fv,#function
-glMultiTexCoord3fv:
+.globl glGetProgramParameterdvNV
+.type glGetProgramParameterdvNV,#function
+glGetProgramParameterdvNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13600,20 +14710,20 @@ glMultiTexCoord3fv:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord3fvARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord3fvARB), %g2
+ sethi %hi(8 * _gloffset_GetProgramParameterdvNV), %g2
+ or %g2, %lo(8 * _gloffset_GetProgramParameterdvNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord3fvARB)], %g3
+ ld [%g1 + (4 * _gloffset_GetProgramParameterdvNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord3i
-.type glMultiTexCoord3i,#function
-glMultiTexCoord3i:
+.globl glGetProgramParameterfvNV
+.type glGetProgramParameterfvNV,#function
+glGetProgramParameterfvNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13621,20 +14731,20 @@ glMultiTexCoord3i:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord3iARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord3iARB), %g2
+ sethi %hi(8 * _gloffset_GetProgramParameterfvNV), %g2
+ or %g2, %lo(8 * _gloffset_GetProgramParameterfvNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord3iARB)], %g3
+ ld [%g1 + (4 * _gloffset_GetProgramParameterfvNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord3iv
-.type glMultiTexCoord3iv,#function
-glMultiTexCoord3iv:
+.globl glGetProgramivNV
+.type glGetProgramivNV,#function
+glGetProgramivNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13642,20 +14752,20 @@ glMultiTexCoord3iv:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord3ivARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord3ivARB), %g2
+ sethi %hi(8 * _gloffset_GetProgramivNV), %g2
+ or %g2, %lo(8 * _gloffset_GetProgramivNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord3ivARB)], %g3
+ ld [%g1 + (4 * _gloffset_GetProgramivNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord3s
-.type glMultiTexCoord3s,#function
-glMultiTexCoord3s:
+.globl glGetProgramStringNV
+.type glGetProgramStringNV,#function
+glGetProgramStringNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13663,20 +14773,20 @@ glMultiTexCoord3s:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord3sARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord3sARB), %g2
+ sethi %hi(8 * _gloffset_GetProgramStringNV), %g2
+ or %g2, %lo(8 * _gloffset_GetProgramStringNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord3sARB)], %g3
+ ld [%g1 + (4 * _gloffset_GetProgramStringNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord3sv
-.type glMultiTexCoord3sv,#function
-glMultiTexCoord3sv:
+.globl glGetTrackMatrixivNV
+.type glGetTrackMatrixivNV,#function
+glGetTrackMatrixivNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13684,20 +14794,20 @@ glMultiTexCoord3sv:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord3svARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord3svARB), %g2
+ sethi %hi(8 * _gloffset_GetTrackMatrixivNV), %g2
+ or %g2, %lo(8 * _gloffset_GetTrackMatrixivNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord3svARB)], %g3
+ ld [%g1 + (4 * _gloffset_GetTrackMatrixivNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord4d
-.type glMultiTexCoord4d,#function
-glMultiTexCoord4d:
+.globl glGetVertexAttribdvNV
+.type glGetVertexAttribdvNV,#function
+glGetVertexAttribdvNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13705,20 +14815,20 @@ glMultiTexCoord4d:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord4dARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord4dARB), %g2
+ sethi %hi(8 * _gloffset_GetVertexAttribdvNV), %g2
+ or %g2, %lo(8 * _gloffset_GetVertexAttribdvNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord4dARB)], %g3
+ ld [%g1 + (4 * _gloffset_GetVertexAttribdvNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord4dv
-.type glMultiTexCoord4dv,#function
-glMultiTexCoord4dv:
+.globl glGetVertexAttribfvNV
+.type glGetVertexAttribfvNV,#function
+glGetVertexAttribfvNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13726,20 +14836,20 @@ glMultiTexCoord4dv:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord4dvARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord4dvARB), %g2
+ sethi %hi(8 * _gloffset_GetVertexAttribfvNV), %g2
+ or %g2, %lo(8 * _gloffset_GetVertexAttribfvNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord4dvARB)], %g3
+ ld [%g1 + (4 * _gloffset_GetVertexAttribfvNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord4f
-.type glMultiTexCoord4f,#function
-glMultiTexCoord4f:
+.globl glGetVertexAttribivNV
+.type glGetVertexAttribivNV,#function
+glGetVertexAttribivNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13747,20 +14857,20 @@ glMultiTexCoord4f:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord4fARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord4fARB), %g2
+ sethi %hi(8 * _gloffset_GetVertexAttribivNV), %g2
+ or %g2, %lo(8 * _gloffset_GetVertexAttribivNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord4fARB)], %g3
+ ld [%g1 + (4 * _gloffset_GetVertexAttribivNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord4fv
-.type glMultiTexCoord4fv,#function
-glMultiTexCoord4fv:
+.globl glGetVertexAttribPointervNV
+.type glGetVertexAttribPointervNV,#function
+glGetVertexAttribPointervNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13768,20 +14878,20 @@ glMultiTexCoord4fv:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord4fvARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord4fvARB), %g2
+ sethi %hi(8 * _gloffset_GetVertexAttribPointervNV), %g2
+ or %g2, %lo(8 * _gloffset_GetVertexAttribPointervNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord4fvARB)], %g3
+ ld [%g1 + (4 * _gloffset_GetVertexAttribPointervNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord4i
-.type glMultiTexCoord4i,#function
-glMultiTexCoord4i:
+.globl glIsProgramNV
+.type glIsProgramNV,#function
+glIsProgramNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13789,20 +14899,20 @@ glMultiTexCoord4i:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord4iARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord4iARB), %g2
+ sethi %hi(8 * _gloffset_IsProgramNV), %g2
+ or %g2, %lo(8 * _gloffset_IsProgramNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord4iARB)], %g3
+ ld [%g1 + (4 * _gloffset_IsProgramNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord4iv
-.type glMultiTexCoord4iv,#function
-glMultiTexCoord4iv:
+.globl glLoadProgramNV
+.type glLoadProgramNV,#function
+glLoadProgramNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13810,20 +14920,20 @@ glMultiTexCoord4iv:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord4ivARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord4ivARB), %g2
+ sethi %hi(8 * _gloffset_LoadProgramNV), %g2
+ or %g2, %lo(8 * _gloffset_LoadProgramNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord4ivARB)], %g3
+ ld [%g1 + (4 * _gloffset_LoadProgramNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord4s
-.type glMultiTexCoord4s,#function
-glMultiTexCoord4s:
+.globl glProgramParameter4dNV
+.type glProgramParameter4dNV,#function
+glProgramParameter4dNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13831,20 +14941,20 @@ glMultiTexCoord4s:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord4sARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord4sARB), %g2
+ sethi %hi(8 * _gloffset_ProgramParameter4dNV), %g2
+ or %g2, %lo(8 * _gloffset_ProgramParameter4dNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord4sARB)], %g3
+ ld [%g1 + (4 * _gloffset_ProgramParameter4dNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultiTexCoord4sv
-.type glMultiTexCoord4sv,#function
-glMultiTexCoord4sv:
+.globl glProgramParameter4dvNV
+.type glProgramParameter4dvNV,#function
+glProgramParameter4dvNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13852,20 +14962,20 @@ glMultiTexCoord4sv:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultiTexCoord4svARB), %g2
- or %g2, %lo(8 * _gloffset_MultiTexCoord4svARB), %g2
+ sethi %hi(8 * _gloffset_ProgramParameter4dvNV), %g2
+ or %g2, %lo(8 * _gloffset_ProgramParameter4dvNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultiTexCoord4svARB)], %g3
+ ld [%g1 + (4 * _gloffset_ProgramParameter4dvNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glLoadTransposeMatrixd
-.type glLoadTransposeMatrixd,#function
-glLoadTransposeMatrixd:
+.globl glProgramParameter4fNV
+.type glProgramParameter4fNV,#function
+glProgramParameter4fNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13873,20 +14983,20 @@ glLoadTransposeMatrixd:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_LoadTransposeMatrixdARB), %g2
- or %g2, %lo(8 * _gloffset_LoadTransposeMatrixdARB), %g2
+ sethi %hi(8 * _gloffset_ProgramParameter4fNV), %g2
+ or %g2, %lo(8 * _gloffset_ProgramParameter4fNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_LoadTransposeMatrixdARB)], %g3
+ ld [%g1 + (4 * _gloffset_ProgramParameter4fNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glLoadTransposeMatrixf
-.type glLoadTransposeMatrixf,#function
-glLoadTransposeMatrixf:
+.globl glProgramParameter4fvNV
+.type glProgramParameter4fvNV,#function
+glProgramParameter4fvNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13894,20 +15004,20 @@ glLoadTransposeMatrixf:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_LoadTransposeMatrixfARB), %g2
- or %g2, %lo(8 * _gloffset_LoadTransposeMatrixfARB), %g2
+ sethi %hi(8 * _gloffset_ProgramParameter4fvNV), %g2
+ or %g2, %lo(8 * _gloffset_ProgramParameter4fvNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_LoadTransposeMatrixfARB)], %g3
+ ld [%g1 + (4 * _gloffset_ProgramParameter4fvNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultTransposeMatrixd
-.type glMultTransposeMatrixd,#function
-glMultTransposeMatrixd:
+.globl glProgramParameters4dvNV
+.type glProgramParameters4dvNV,#function
+glProgramParameters4dvNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13915,20 +15025,20 @@ glMultTransposeMatrixd:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultTransposeMatrixdARB), %g2
- or %g2, %lo(8 * _gloffset_MultTransposeMatrixdARB), %g2
+ sethi %hi(8 * _gloffset_ProgramParameters4dvNV), %g2
+ or %g2, %lo(8 * _gloffset_ProgramParameters4dvNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultTransposeMatrixdARB)], %g3
+ ld [%g1 + (4 * _gloffset_ProgramParameters4dvNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glMultTransposeMatrixf
-.type glMultTransposeMatrixf,#function
-glMultTransposeMatrixf:
+.globl glProgramParameters4fvNV
+.type glProgramParameters4fvNV,#function
+glProgramParameters4fvNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13936,20 +15046,20 @@ glMultTransposeMatrixf:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_MultTransposeMatrixfARB), %g2
- or %g2, %lo(8 * _gloffset_MultTransposeMatrixfARB), %g2
+ sethi %hi(8 * _gloffset_ProgramParameters4fvNV), %g2
+ or %g2, %lo(8 * _gloffset_ProgramParameters4fvNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_MultTransposeMatrixfARB)], %g3
+ ld [%g1 + (4 * _gloffset_ProgramParameters4fvNV)], %g3
#endif
jmpl %g3, %g0
nop
-.globl glSampleCoverage
-.type glSampleCoverage,#function
-glSampleCoverage:
+.globl glRequestResidentProgramsNV
+.type glRequestResidentProgramsNV,#function
+glRequestResidentProgramsNV:
#ifdef __sparc_v9__
sethi %hi(0x00000000), %g2
sethi %hi(0x00000000), %g1
@@ -13957,17 +15067,1886 @@ glSampleCoverage:
or %g1, %lo(0x00000000), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
- sethi %hi(8 * _gloffset_SampleCoverageARB), %g2
- or %g2, %lo(8 * _gloffset_SampleCoverageARB), %g2
+ sethi %hi(8 * _gloffset_RequestResidentProgramsNV), %g2
+ or %g2, %lo(8 * _gloffset_RequestResidentProgramsNV), %g2
ldx [%g1 + %g2], %g3
#else
sethi %hi(0x00000000), %g1
ld [%g1 + %lo(0x00000000)], %g1
- ld [%g1 + (4 * _gloffset_SampleCoverageARB)], %g3
+ ld [%g1 + (4 * _gloffset_RequestResidentProgramsNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glTrackMatrixNV
+.type glTrackMatrixNV,#function
+glTrackMatrixNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_TrackMatrixNV), %g2
+ or %g2, %lo(8 * _gloffset_TrackMatrixNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_TrackMatrixNV)], %g3
#endif
jmpl %g3, %g0
nop
+.globl glVertexAttribPointerNV
+.type glVertexAttribPointerNV,#function
+glVertexAttribPointerNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttribPointerNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttribPointerNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttribPointerNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib1dNV
+.type glVertexAttrib1dNV,#function
+glVertexAttrib1dNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib1dNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib1dNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib1dNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib1dvNV
+.type glVertexAttrib1dvNV,#function
+glVertexAttrib1dvNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib1dvNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib1dvNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib1dvNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib1fNV
+.type glVertexAttrib1fNV,#function
+glVertexAttrib1fNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib1fNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib1fNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib1fNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib1fvNV
+.type glVertexAttrib1fvNV,#function
+glVertexAttrib1fvNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib1fvNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib1fvNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib1fvNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib1sNV
+.type glVertexAttrib1sNV,#function
+glVertexAttrib1sNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib1sNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib1sNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib1sNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib1svNV
+.type glVertexAttrib1svNV,#function
+glVertexAttrib1svNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib1svNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib1svNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib1svNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib2dNV
+.type glVertexAttrib2dNV,#function
+glVertexAttrib2dNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib2dNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib2dNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib2dNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib2dvNV
+.type glVertexAttrib2dvNV,#function
+glVertexAttrib2dvNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib2dvNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib2dvNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib2dvNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib2fNV
+.type glVertexAttrib2fNV,#function
+glVertexAttrib2fNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib2fNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib2fNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib2fNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib2fvNV
+.type glVertexAttrib2fvNV,#function
+glVertexAttrib2fvNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib2fvNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib2fvNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib2fvNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib2sNV
+.type glVertexAttrib2sNV,#function
+glVertexAttrib2sNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib2sNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib2sNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib2sNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib2svNV
+.type glVertexAttrib2svNV,#function
+glVertexAttrib2svNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib2svNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib2svNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib2svNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib3dNV
+.type glVertexAttrib3dNV,#function
+glVertexAttrib3dNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib3dNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib3dNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib3dNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib3dvNV
+.type glVertexAttrib3dvNV,#function
+glVertexAttrib3dvNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib3dvNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib3dvNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib3dvNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib3fNV
+.type glVertexAttrib3fNV,#function
+glVertexAttrib3fNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib3fNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib3fNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib3fNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib3fvNV
+.type glVertexAttrib3fvNV,#function
+glVertexAttrib3fvNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib3fvNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib3fvNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib3fvNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib3sNV
+.type glVertexAttrib3sNV,#function
+glVertexAttrib3sNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib3sNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib3sNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib3sNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib3svNV
+.type glVertexAttrib3svNV,#function
+glVertexAttrib3svNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib3svNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib3svNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib3svNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib4dNV
+.type glVertexAttrib4dNV,#function
+glVertexAttrib4dNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib4dNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib4dNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib4dNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib4dvNV
+.type glVertexAttrib4dvNV,#function
+glVertexAttrib4dvNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib4dvNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib4dvNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib4dvNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib4fNV
+.type glVertexAttrib4fNV,#function
+glVertexAttrib4fNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib4fNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib4fNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib4fNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib4fvNV
+.type glVertexAttrib4fvNV,#function
+glVertexAttrib4fvNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib4fvNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib4fvNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib4fvNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib4sNV
+.type glVertexAttrib4sNV,#function
+glVertexAttrib4sNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib4sNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib4sNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib4sNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib4svNV
+.type glVertexAttrib4svNV,#function
+glVertexAttrib4svNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib4svNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib4svNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib4svNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib4ubNV
+.type glVertexAttrib4ubNV,#function
+glVertexAttrib4ubNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib4ubNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib4ubNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib4ubNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttrib4ubvNV
+.type glVertexAttrib4ubvNV,#function
+glVertexAttrib4ubvNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttrib4ubvNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttrib4ubvNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttrib4ubvNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttribs1dvNV
+.type glVertexAttribs1dvNV,#function
+glVertexAttribs1dvNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttribs1dvNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttribs1dvNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttribs1dvNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttribs1fvNV
+.type glVertexAttribs1fvNV,#function
+glVertexAttribs1fvNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttribs1fvNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttribs1fvNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttribs1fvNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttribs1svNV
+.type glVertexAttribs1svNV,#function
+glVertexAttribs1svNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttribs1svNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttribs1svNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttribs1svNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttribs2dvNV
+.type glVertexAttribs2dvNV,#function
+glVertexAttribs2dvNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttribs2dvNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttribs2dvNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttribs2dvNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttribs2fvNV
+.type glVertexAttribs2fvNV,#function
+glVertexAttribs2fvNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttribs2fvNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttribs2fvNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttribs2fvNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttribs2svNV
+.type glVertexAttribs2svNV,#function
+glVertexAttribs2svNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttribs2svNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttribs2svNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttribs2svNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttribs3dvNV
+.type glVertexAttribs3dvNV,#function
+glVertexAttribs3dvNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttribs3dvNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttribs3dvNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttribs3dvNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttribs3fvNV
+.type glVertexAttribs3fvNV,#function
+glVertexAttribs3fvNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttribs3fvNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttribs3fvNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttribs3fvNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttribs3svNV
+.type glVertexAttribs3svNV,#function
+glVertexAttribs3svNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttribs3svNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttribs3svNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttribs3svNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttribs4dvNV
+.type glVertexAttribs4dvNV,#function
+glVertexAttribs4dvNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttribs4dvNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttribs4dvNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttribs4dvNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttribs4fvNV
+.type glVertexAttribs4fvNV,#function
+glVertexAttribs4fvNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttribs4fvNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttribs4fvNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttribs4fvNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttribs4svNV
+.type glVertexAttribs4svNV,#function
+glVertexAttribs4svNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttribs4svNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttribs4svNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttribs4svNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glVertexAttribs4ubvNV
+.type glVertexAttribs4ubvNV,#function
+glVertexAttribs4ubvNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_VertexAttribs4ubvNV), %g2
+ or %g2, %lo(8 * _gloffset_VertexAttribs4ubvNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_VertexAttribs4ubvNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glPointParameteriNV
+.type glPointParameteriNV,#function
+glPointParameteriNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_PointParameteriNV), %g2
+ or %g2, %lo(8 * _gloffset_PointParameteriNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_PointParameteriNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glPointParameterivNV
+.type glPointParameterivNV,#function
+glPointParameterivNV:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_PointParameterivNV), %g2
+ or %g2, %lo(8 * _gloffset_PointParameterivNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_PointParameterivNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glBlendFuncSeparate
+.type glBlendFuncSeparate,#function
+glBlendFuncSeparate:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_BlendFuncSeparateEXT), %g2
+ or %g2, %lo(8 * _gloffset_BlendFuncSeparateEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_BlendFuncSeparateEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glFogCoordf
+.type glFogCoordf,#function
+glFogCoordf:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_FogCoordfEXT), %g2
+ or %g2, %lo(8 * _gloffset_FogCoordfEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_FogCoordfEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glFogCoordfv
+.type glFogCoordfv,#function
+glFogCoordfv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_FogCoordfvEXT), %g2
+ or %g2, %lo(8 * _gloffset_FogCoordfvEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_FogCoordfvEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glFogCoordd
+.type glFogCoordd,#function
+glFogCoordd:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_FogCoorddEXT), %g2
+ or %g2, %lo(8 * _gloffset_FogCoorddEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_FogCoorddEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glFogCoorddv
+.type glFogCoorddv,#function
+glFogCoorddv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_FogCoorddvEXT), %g2
+ or %g2, %lo(8 * _gloffset_FogCoorddvEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_FogCoorddvEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glFogCoordPointer
+.type glFogCoordPointer,#function
+glFogCoordPointer:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_FogCoordPointerEXT), %g2
+ or %g2, %lo(8 * _gloffset_FogCoordPointerEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_FogCoordPointerEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiDrawArrays
+.type glMultiDrawArrays,#function
+glMultiDrawArrays:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiDrawArraysEXT), %g2
+ or %g2, %lo(8 * _gloffset_MultiDrawArraysEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiDrawArraysEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glMultiDrawElements
+.type glMultiDrawElements,#function
+glMultiDrawElements:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_MultiDrawElementsEXT), %g2
+ or %g2, %lo(8 * _gloffset_MultiDrawElementsEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_MultiDrawElementsEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glPointParameterf
+.type glPointParameterf,#function
+glPointParameterf:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_PointParameterfEXT), %g2
+ or %g2, %lo(8 * _gloffset_PointParameterfEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_PointParameterfEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glPointParameterfv
+.type glPointParameterfv,#function
+glPointParameterfv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_PointParameterfvEXT), %g2
+ or %g2, %lo(8 * _gloffset_PointParameterfvEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_PointParameterfvEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glPointParameteri
+.type glPointParameteri,#function
+glPointParameteri:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_PointParameteriNV), %g2
+ or %g2, %lo(8 * _gloffset_PointParameteriNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_PointParameteriNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glPointParameteriv
+.type glPointParameteriv,#function
+glPointParameteriv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_PointParameterivNV), %g2
+ or %g2, %lo(8 * _gloffset_PointParameterivNV), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_PointParameterivNV)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSecondaryColor3b
+.type glSecondaryColor3b,#function
+glSecondaryColor3b:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SecondaryColor3bEXT), %g2
+ or %g2, %lo(8 * _gloffset_SecondaryColor3bEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SecondaryColor3bEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSecondaryColor3bv
+.type glSecondaryColor3bv,#function
+glSecondaryColor3bv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SecondaryColor3bvEXT), %g2
+ or %g2, %lo(8 * _gloffset_SecondaryColor3bvEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SecondaryColor3bvEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSecondaryColor3d
+.type glSecondaryColor3d,#function
+glSecondaryColor3d:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SecondaryColor3dEXT), %g2
+ or %g2, %lo(8 * _gloffset_SecondaryColor3dEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SecondaryColor3dEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSecondaryColor3dv
+.type glSecondaryColor3dv,#function
+glSecondaryColor3dv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SecondaryColor3dvEXT), %g2
+ or %g2, %lo(8 * _gloffset_SecondaryColor3dvEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SecondaryColor3dvEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSecondaryColor3f
+.type glSecondaryColor3f,#function
+glSecondaryColor3f:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SecondaryColor3fEXT), %g2
+ or %g2, %lo(8 * _gloffset_SecondaryColor3fEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SecondaryColor3fEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSecondaryColor3fv
+.type glSecondaryColor3fv,#function
+glSecondaryColor3fv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SecondaryColor3fvEXT), %g2
+ or %g2, %lo(8 * _gloffset_SecondaryColor3fvEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SecondaryColor3fvEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSecondaryColor3i
+.type glSecondaryColor3i,#function
+glSecondaryColor3i:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SecondaryColor3iEXT), %g2
+ or %g2, %lo(8 * _gloffset_SecondaryColor3iEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SecondaryColor3iEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSecondaryColor3iv
+.type glSecondaryColor3iv,#function
+glSecondaryColor3iv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SecondaryColor3ivEXT), %g2
+ or %g2, %lo(8 * _gloffset_SecondaryColor3ivEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SecondaryColor3ivEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSecondaryColor3s
+.type glSecondaryColor3s,#function
+glSecondaryColor3s:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SecondaryColor3sEXT), %g2
+ or %g2, %lo(8 * _gloffset_SecondaryColor3sEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SecondaryColor3sEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSecondaryColor3sv
+.type glSecondaryColor3sv,#function
+glSecondaryColor3sv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SecondaryColor3svEXT), %g2
+ or %g2, %lo(8 * _gloffset_SecondaryColor3svEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SecondaryColor3svEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSecondaryColor3ub
+.type glSecondaryColor3ub,#function
+glSecondaryColor3ub:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SecondaryColor3ubEXT), %g2
+ or %g2, %lo(8 * _gloffset_SecondaryColor3ubEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SecondaryColor3ubEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSecondaryColor3ubv
+.type glSecondaryColor3ubv,#function
+glSecondaryColor3ubv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SecondaryColor3ubvEXT), %g2
+ or %g2, %lo(8 * _gloffset_SecondaryColor3ubvEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SecondaryColor3ubvEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSecondaryColor3ui
+.type glSecondaryColor3ui,#function
+glSecondaryColor3ui:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SecondaryColor3uiEXT), %g2
+ or %g2, %lo(8 * _gloffset_SecondaryColor3uiEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SecondaryColor3uiEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSecondaryColor3uiv
+.type glSecondaryColor3uiv,#function
+glSecondaryColor3uiv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SecondaryColor3uivEXT), %g2
+ or %g2, %lo(8 * _gloffset_SecondaryColor3uivEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SecondaryColor3uivEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSecondaryColor3us
+.type glSecondaryColor3us,#function
+glSecondaryColor3us:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SecondaryColor3usEXT), %g2
+ or %g2, %lo(8 * _gloffset_SecondaryColor3usEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SecondaryColor3usEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSecondaryColor3usv
+.type glSecondaryColor3usv,#function
+glSecondaryColor3usv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SecondaryColor3usvEXT), %g2
+ or %g2, %lo(8 * _gloffset_SecondaryColor3usvEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SecondaryColor3usvEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glSecondaryColorPointer
+.type glSecondaryColorPointer,#function
+glSecondaryColorPointer:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_SecondaryColorPointerEXT), %g2
+ or %g2, %lo(8 * _gloffset_SecondaryColorPointerEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_SecondaryColorPointerEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glWindowPos2d
+.type glWindowPos2d,#function
+glWindowPos2d:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_WindowPos2dMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos2dMESA), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_WindowPos2dMESA)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glWindowPos2dv
+.type glWindowPos2dv,#function
+glWindowPos2dv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_WindowPos2dvMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos2dvMESA), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_WindowPos2dvMESA)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glWindowPos2f
+.type glWindowPos2f,#function
+glWindowPos2f:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_WindowPos2fMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos2fMESA), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_WindowPos2fMESA)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glWindowPos2fv
+.type glWindowPos2fv,#function
+glWindowPos2fv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_WindowPos2fvMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos2fvMESA), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_WindowPos2fvMESA)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glWindowPos2i
+.type glWindowPos2i,#function
+glWindowPos2i:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_WindowPos2iMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos2iMESA), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_WindowPos2iMESA)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glWindowPos2iv
+.type glWindowPos2iv,#function
+glWindowPos2iv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_WindowPos2ivMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos2ivMESA), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_WindowPos2ivMESA)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glWindowPos2s
+.type glWindowPos2s,#function
+glWindowPos2s:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_WindowPos2sMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos2sMESA), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_WindowPos2sMESA)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glWindowPos2sv
+.type glWindowPos2sv,#function
+glWindowPos2sv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_WindowPos2svMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos2svMESA), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_WindowPos2svMESA)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glWindowPos3d
+.type glWindowPos3d,#function
+glWindowPos3d:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_WindowPos3dMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos3dMESA), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_WindowPos3dMESA)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glWindowPos3dv
+.type glWindowPos3dv,#function
+glWindowPos3dv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_WindowPos3dvMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos3dvMESA), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_WindowPos3dvMESA)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glWindowPos3f
+.type glWindowPos3f,#function
+glWindowPos3f:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_WindowPos3fMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos3fMESA), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_WindowPos3fMESA)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glWindowPos3fv
+.type glWindowPos3fv,#function
+glWindowPos3fv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_WindowPos3fvMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos3fvMESA), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_WindowPos3fvMESA)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glWindowPos3i
+.type glWindowPos3i,#function
+glWindowPos3i:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_WindowPos3iMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos3iMESA), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_WindowPos3iMESA)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glWindowPos3iv
+.type glWindowPos3iv,#function
+glWindowPos3iv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_WindowPos3ivMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos3ivMESA), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_WindowPos3ivMESA)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glWindowPos3s
+.type glWindowPos3s,#function
+glWindowPos3s:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_WindowPos3sMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos3sMESA), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_WindowPos3sMESA)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glWindowPos3sv
+.type glWindowPos3sv,#function
+glWindowPos3sv:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_WindowPos3svMESA), %g2
+ or %g2, %lo(8 * _gloffset_WindowPos3svMESA), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_WindowPos3svMESA)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+
+.globl glActiveStencilFaceEXT
+.type glActiveStencilFaceEXT,#function
+glActiveStencilFaceEXT:
+#ifdef __sparc_v9__
+ sethi %hi(0x00000000), %g2
+ sethi %hi(0x00000000), %g1
+ or %g2, %lo(0x00000000), %g2
+ or %g1, %lo(0x00000000), %g1
+ sllx %g2, 32, %g2
+ ldx [%g1 + %g2], %g1
+ sethi %hi(8 * _gloffset_ActiveStencilFaceEXT), %g2
+ or %g2, %lo(8 * _gloffset_ActiveStencilFaceEXT), %g2
+ ldx [%g1 + %g2], %g3
+#else
+ sethi %hi(0x00000000), %g1
+ ld [%g1 + %lo(0x00000000)], %g1
+ ld [%g1 + (4 * _gloffset_ActiveStencilFaceEXT)], %g3
+#endif
+ jmpl %g3, %g0
+ nop
+ nop
.globl _mesa_sparc_glapi_end
.type _mesa_sparc_glapi_end,#function
diff --git a/xc/extras/Mesa/src/SPARC/sparc.c b/xc/extras/Mesa/src/SPARC/sparc.c
index 666f6e918..7fe7c3fe5 100644
--- a/xc/extras/Mesa/src/SPARC/sparc.c
+++ b/xc/extras/Mesa/src/SPARC/sparc.c
@@ -1,4 +1,3 @@
-/* $Id: sparc.c,v 1.1.1.1 2002/10/22 13:06:32 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -30,7 +29,6 @@
#include "context.h"
-#include "math/m_vertices.h"
#include "math/m_xform.h"
#include "tnl/t_context.h"
#include "sparc.h"
diff --git a/xc/extras/Mesa/src/X/fakeglx.c b/xc/extras/Mesa/src/X/fakeglx.c
index e1e713795..279425ac1 100644
--- a/xc/extras/Mesa/src/X/fakeglx.c
+++ b/xc/extras/Mesa/src/X/fakeglx.c
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.4
+ * Version: 5.0
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -47,7 +47,7 @@
#include "context.h"
#include "config.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
#include "xfonts.h"
@@ -65,11 +65,22 @@
#define SERVER_MINOR_VERSION 4
/* This is appended onto the glXGetClient/ServerString version strings. */
-#define MESA_GLX_VERSION "Mesa 4.0.4"
+#define MESA_GLX_VERSION "Mesa 5.0"
/* Who implemented this GLX? */
#define VENDOR "Brian Paul"
+#define EXTENSIONS \
+ "GLX_MESA_set_3dfx_mode " \
+ "GLX_MESA_copy_sub_buffer " \
+ "GLX_MESA_pixmap_colormap " \
+ "GLX_MESA_release_buffers " \
+ "GLX_ARB_get_proc_address " \
+ "GLX_EXT_visual_info " \
+ "GLX_EXT_visual_rating " \
+ "GLX_SGI_video_sync " \
+ "GLX_SGIX_fbconfig " \
+ "GLX_SGIX_pbuffer"
/* Silence compiler warnings */
@@ -259,7 +270,7 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo,
if (dbFlag) {
/* Check if the MESA_BACK_BUFFER env var is set */
- char *backbuffer = getenv("MESA_BACK_BUFFER");
+ char *backbuffer = _mesa_getenv("MESA_BACK_BUFFER");
if (backbuffer) {
if (backbuffer[0]=='p' || backbuffer[0]=='P') {
ximageFlag = GL_FALSE;
@@ -268,15 +279,14 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo,
ximageFlag = GL_TRUE;
}
else {
- fprintf(stderr, "Mesa: invalid value for MESA_BACK_BUFFER ");
- fprintf(stderr, "environment variable, using an XImage.\n");
+ _mesa_warning(NULL, "Mesa: invalid value for MESA_BACK_BUFFER environment variable, using an XImage.");
}
}
}
/* Comparing IDs uses less memory but sometimes fails. */
/* XXX revisit this after 3.0 is finished. */
- if (getenv("MESA_GLX_VISUAL_HACK"))
+ if (_mesa_getenv("MESA_GLX_VISUAL_HACK"))
comparePointers = GL_TRUE;
else
comparePointers = GL_FALSE;
@@ -307,8 +317,8 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo,
/* Create a new visual and add it to the list. */
- if (NumVisuals>=MAX_VISUALS) {
- fprintf( stderr, "GLX Error: maximum number of visuals exceeded\n");
+ if (NumVisuals >= MAX_VISUALS) {
+ _mesa_problem(NULL, "GLX Error: maximum number of visuals exceeded");
return NULL;
}
@@ -319,6 +329,11 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo,
accumBlueSize, accumAlphaSize, 0, level,
GLX_NONE_EXT );
if (xmvis) {
+ /* Save a copy of the pointer now so we can find this visual again
+ * if we need to search for it in find_glx_visual().
+ */
+ xmvis->vishandle = vinfo;
+ /* add xmvis to the list */
VisualTable[NumVisuals] = xmvis;
NumVisuals++;
}
@@ -355,7 +370,7 @@ create_glx_visual( Display *dpy, XVisualInfo *visinfo )
);
}
else if (is_usable_visual( visinfo )) {
- if (getenv("MESA_GLX_FORCE_CI")) {
+ if (_mesa_getenv("MESA_GLX_FORCE_CI")) {
/* Configure this visual as a COLOR INDEX visual. */
return save_glx_visual( dpy, visinfo,
GL_FALSE, /* rgb */
@@ -391,7 +406,7 @@ create_glx_visual( Display *dpy, XVisualInfo *visinfo )
}
}
else {
- fprintf(stderr,"Mesa: error in glXCreateContext: bad visual\n");
+ _mesa_warning(NULL, "Mesa: error in glXCreateContext: bad visual\n");
return NULL;
}
}
@@ -406,19 +421,21 @@ find_glx_visual( Display *dpy, XVisualInfo *vinfo )
{
int i;
- /* First try to match pointers */
+ /* try to match visual id */
for (i=0;i<NumVisuals;i++) {
- if (VisualTable[i]->display==dpy && VisualTable[i]->vishandle==vinfo) {
+ if (VisualTable[i]->display==dpy
+ && VisualTable[i]->visinfo->visualid == vinfo->visualid) {
return VisualTable[i];
}
}
- /* try to match visual id */
+
+ /* if that fails, try to match pointers */
for (i=0;i<NumVisuals;i++) {
- if (VisualTable[i]->display==dpy
- && VisualTable[i]->visinfo->visualid == vinfo->visualid) {
+ if (VisualTable[i]->display==dpy && VisualTable[i]->vishandle==vinfo) {
return VisualTable[i];
}
}
+
return NULL;
}
@@ -554,21 +571,21 @@ static XVisualInfo *get_env_visual(Display *dpy, int scr, const char *varname)
int depth, xclass = -1;
XVisualInfo *vis;
- if (!getenv( varname )) {
+ if (!_mesa_getenv( varname )) {
return NULL;
}
- strncpy( value, getenv(varname), 100 );
+ _mesa_strncpy( value, _mesa_getenv(varname), 100 );
value[99] = 0;
sscanf( value, "%s %d", type, &depth );
- if (strcmp(type,"TrueColor")==0) xclass = TrueColor;
- else if (strcmp(type,"DirectColor")==0) xclass = DirectColor;
- else if (strcmp(type,"PseudoColor")==0) xclass = PseudoColor;
- else if (strcmp(type,"StaticColor")==0) xclass = StaticColor;
- else if (strcmp(type,"GrayScale")==0) xclass = GrayScale;
- else if (strcmp(type,"StaticGray")==0) xclass = StaticGray;
+ if (_mesa_strcmp(type,"TrueColor")==0) xclass = TrueColor;
+ else if (_mesa_strcmp(type,"DirectColor")==0) xclass = DirectColor;
+ else if (_mesa_strcmp(type,"PseudoColor")==0) xclass = PseudoColor;
+ else if (_mesa_strcmp(type,"StaticColor")==0) xclass = StaticColor;
+ else if (_mesa_strcmp(type,"GrayScale")==0) xclass = GrayScale;
+ else if (_mesa_strcmp(type,"StaticGray")==0) xclass = StaticGray;
if (xclass>-1 && depth>0) {
vis = get_visual( dpy, scr, depth, xclass );
@@ -577,8 +594,9 @@ static XVisualInfo *get_env_visual(Display *dpy, int scr, const char *varname)
}
}
- fprintf( stderr, "Mesa: GLX unable to find visual class=%s, depth=%d.\n",
- type, depth );
+ _mesa_warning(NULL, "GLX unable to find visual class=%s, depth=%d.",
+ type, depth);
+
return NULL;
}
@@ -892,10 +910,9 @@ static XVisualInfo *choose_x_overlay_visual( Display *dpy, int scr,
/**********************************************************************/
-static XVisualInfo *
-Fake_glXChooseVisual( Display *dpy, int screen, int *list )
+static XMesaVisual choose_visual( Display *dpy, int screen, const int *list )
{
- int *parselist;
+ const int *parselist;
XVisualInfo *vis;
int min_ci = 0;
int min_red=0, min_green=0, min_blue=0;
@@ -914,6 +931,7 @@ Fake_glXChooseVisual( Display *dpy, int screen, int *list )
int trans_type = DONT_CARE;
int trans_value = DONT_CARE;
GLint caveat = DONT_CARE;
+ XMesaVisual xmvis = NULL;
parselist = list;
@@ -1036,10 +1054,47 @@ Fake_glXChooseVisual( Display *dpy, int screen, int *list )
caveat = *parselist++; /* ignored for now */
break;
+ /*
+ * GLX_ARB_multisample
+ */
+ case GLX_SAMPLE_BUFFERS_ARB:
+ /* ms not supported */
+ return NULL;
+ case GLX_SAMPLES_ARB:
+ /* ms not supported */
+ return NULL;
+
+ /*
+ * FBConfig attribs.
+ */
+ case GLX_RENDER_TYPE:
+ parselist++;
+ if (*parselist == GLX_RGBA_BIT) {
+ rgb_flag = GL_TRUE;
+ }
+ else if (*parselist == GLX_COLOR_INDEX_BIT) {
+ rgb_flag = GL_FALSE;
+ }
+ else if (*parselist == 0) {
+ rgb_flag = GL_TRUE;
+ }
+ parselist++;
+ break;
+ case GLX_DRAWABLE_TYPE:
+ parselist++;
+ if (*parselist & ~(GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT)) {
+ return NULL; /* bad bit */
+ }
+ parselist++;
+ break;
+
case None:
break;
+
default:
/* undefined attribute */
+ _mesa_warning(NULL, "unexpected attrib 0x%x in choose_visual()",
+ *parselist);
return NULL;
}
}
@@ -1111,27 +1166,48 @@ Fake_glXChooseVisual( Display *dpy, int screen, int *list )
accumAlphaSize = alpha_flag ? ACCUM_BITS : 0;
}
- if (!save_glx_visual( dpy, vis, rgb_flag, alpha_flag, double_flag,
- stereo_flag, depth_size, stencil_size,
- accumRedSize, accumGreenSize,
- accumBlueSize, accumAlphaSize,
- level ))
- return NULL;
+ xmvis = save_glx_visual( dpy, vis, rgb_flag, alpha_flag, double_flag,
+ stereo_flag, depth_size, stencil_size,
+ accumRedSize, accumGreenSize,
+ accumBlueSize, accumAlphaSize, level );
}
- return vis;
+ return xmvis;
}
+static XVisualInfo *
+Fake_glXChooseVisual( Display *dpy, int screen, int *list )
+{
+ XMesaVisual xmvis = choose_visual(dpy, screen, list);
+ if (xmvis) {
+#if 0
+ return xmvis->vishandle;
+#else
+ /* create a new vishandle - the cached one may be stale */
+ xmvis->vishandle = _mesa_malloc(sizeof(XVisualInfo));
+ if (xmvis->vishandle) {
+ _mesa_memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo));
+ }
+ return xmvis->vishandle;
+#endif
+ }
+ else
+ return NULL;
+}
static GLXContext
Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo,
GLXContext share_list, Bool direct )
{
- XMesaVisual glxvis;
+ XMesaVisual xmvis;
struct fake_glx_context *glxCtx;
struct fake_glx_context *shareCtx = (struct fake_glx_context *) share_list;
+
+ if (!dpy || !visinfo)
+ return 0;
+
glxCtx = CALLOC_STRUCT(fake_glx_context);
if (!glxCtx)
return 0;
@@ -1139,18 +1215,18 @@ Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo,
/* deallocate unused windows/buffers */
XMesaGarbageCollect();
- glxvis = find_glx_visual( dpy, visinfo );
- if (!glxvis) {
+ xmvis = find_glx_visual( dpy, visinfo );
+ if (!xmvis) {
/* This visual wasn't found with glXChooseVisual() */
- glxvis = create_glx_visual( dpy, visinfo );
- if (!glxvis) {
+ xmvis = create_glx_visual( dpy, visinfo );
+ if (!xmvis) {
/* unusable visual */
FREE(glxCtx);
return NULL;
}
}
- glxCtx->xmesaContext = XMesaCreateContext(glxvis,
+ glxCtx->xmesaContext = XMesaCreateContext(xmvis,
shareCtx ? shareCtx->xmesaContext : NULL);
if (!glxCtx->xmesaContext) {
FREE(glxCtx);
@@ -1330,8 +1406,8 @@ Fake_glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap )
if (b) {
XMesaDestroyBuffer(b);
}
- else if (getenv("MESA_DEBUG")) {
- fprintf( stderr, "Mesa: glXDestroyGLXPixmap: invalid pixmap\n");
+ else if (_mesa_getenv("MESA_DEBUG")) {
+ _mesa_warning(NULL, "Mesa: glXDestroyGLXPixmap: invalid pixmap\n");
}
}
@@ -1404,8 +1480,8 @@ Fake_glXSwapBuffers( Display *dpy, GLXDrawable drawable )
if (buffer) {
XMesaSwapBuffers(buffer);
}
- else if (getenv("MESA_DEBUG")) {
- fprintf(stderr, "Mesa Warning: glXSwapBuffers: invalid drawable\n");
+ else if (_mesa_getenv("MESA_DEBUG")) {
+ _mesa_warning(NULL, "Mesa: glXSwapBuffers: invalid drawable\n");
}
}
@@ -1421,8 +1497,8 @@ Fake_glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
if (buffer) {
XMesaCopySubBuffer(buffer, x, y, width, height);
}
- else if (getenv("MESA_DEBUG")) {
- fprintf(stderr, "Mesa Warning: glXCopySubBufferMESA: invalid drawable\n");
+ else if (_mesa_getenv("MESA_DEBUG")) {
+ _mesa_warning(NULL, "Mesa: glXCopySubBufferMESA: invalid drawable\n");
}
}
@@ -1445,40 +1521,21 @@ Fake_glXQueryVersion( Display *dpy, int *maj, int *min )
* Query the GLX attributes of the given XVisualInfo.
*/
static int
-Fake_glXGetConfig( Display *dpy, XVisualInfo *visinfo,
- int attrib, int *value )
+get_config( XMesaVisual xmvis, int attrib, int *value, GLboolean fbconfig )
{
- XMesaVisual glxvis;
-
- glxvis = find_glx_visual( dpy, visinfo );
- if (!glxvis) {
- /* this visual wasn't obtained with glXChooseVisual */
- glxvis = create_glx_visual( dpy, visinfo );
- if (!glxvis) {
- /* this visual can't be used for GL rendering */
- if (attrib==GLX_USE_GL) {
- *value = (int) False;
- return 0;
- }
- else {
- /*fprintf( stderr, "Mesa: Error in glXGetConfig: bad visual\n");*/
- return GLX_BAD_VISUAL;
- }
- }
- }
-
+ ASSERT(xmvis);
switch(attrib) {
case GLX_USE_GL:
*value = (int) True;
return 0;
case GLX_BUFFER_SIZE:
- *value = visinfo->depth;
+ *value = xmvis->visinfo->depth;
return 0;
case GLX_LEVEL:
- *value = glxvis->level;
+ *value = xmvis->level;
return 0;
case GLX_RGBA:
- if (glxvis->mesa_visual.rgbMode) {
+ if (xmvis->mesa_visual.rgbMode) {
*value = True;
}
else {
@@ -1486,50 +1543,50 @@ Fake_glXGetConfig( Display *dpy, XVisualInfo *visinfo,
}
return 0;
case GLX_DOUBLEBUFFER:
- *value = (int) glxvis->mesa_visual.doubleBufferMode;
+ *value = (int) xmvis->mesa_visual.doubleBufferMode;
return 0;
case GLX_STEREO:
- *value = (int) glxvis->mesa_visual.stereoMode;
+ *value = (int) xmvis->mesa_visual.stereoMode;
return 0;
case GLX_AUX_BUFFERS:
*value = (int) False;
return 0;
case GLX_RED_SIZE:
- *value = glxvis->mesa_visual.redBits;
+ *value = xmvis->mesa_visual.redBits;
return 0;
case GLX_GREEN_SIZE:
- *value = glxvis->mesa_visual.greenBits;
+ *value = xmvis->mesa_visual.greenBits;
return 0;
case GLX_BLUE_SIZE:
- *value = glxvis->mesa_visual.blueBits;
+ *value = xmvis->mesa_visual.blueBits;
return 0;
case GLX_ALPHA_SIZE:
- *value = glxvis->mesa_visual.alphaBits;
+ *value = xmvis->mesa_visual.alphaBits;
return 0;
case GLX_DEPTH_SIZE:
- *value = glxvis->mesa_visual.depthBits;
+ *value = xmvis->mesa_visual.depthBits;
return 0;
case GLX_STENCIL_SIZE:
- *value = glxvis->mesa_visual.stencilBits;
+ *value = xmvis->mesa_visual.stencilBits;
return 0;
case GLX_ACCUM_RED_SIZE:
- *value = glxvis->mesa_visual.accumRedBits;
+ *value = xmvis->mesa_visual.accumRedBits;
return 0;
case GLX_ACCUM_GREEN_SIZE:
- *value = glxvis->mesa_visual.accumGreenBits;
+ *value = xmvis->mesa_visual.accumGreenBits;
return 0;
case GLX_ACCUM_BLUE_SIZE:
- *value = glxvis->mesa_visual.accumBlueBits;
+ *value = xmvis->mesa_visual.accumBlueBits;
return 0;
case GLX_ACCUM_ALPHA_SIZE:
- *value = glxvis->mesa_visual.accumAlphaBits;
+ *value = xmvis->mesa_visual.accumAlphaBits;
return 0;
/*
* GLX_EXT_visual_info extension
*/
case GLX_X_VISUAL_TYPE_EXT:
- switch (glxvis->visinfo->CLASS) {
+ switch (xmvis->visinfo->CLASS) {
case StaticGray: *value = GLX_STATIC_GRAY_EXT; return 0;
case GrayScale: *value = GLX_GRAY_SCALE_EXT; return 0;
case StaticColor: *value = GLX_STATIC_GRAY_EXT; return 0;
@@ -1539,27 +1596,27 @@ Fake_glXGetConfig( Display *dpy, XVisualInfo *visinfo,
}
return 0;
case GLX_TRANSPARENT_TYPE_EXT:
- if (glxvis->level==0) {
+ if (xmvis->level==0) {
/* normal planes */
*value = GLX_NONE_EXT;
}
- else if (glxvis->level>0) {
+ else if (xmvis->level>0) {
/* overlay */
- if (glxvis->mesa_visual.rgbMode) {
+ if (xmvis->mesa_visual.rgbMode) {
*value = GLX_TRANSPARENT_RGB_EXT;
}
else {
*value = GLX_TRANSPARENT_INDEX_EXT;
}
}
- else if (glxvis->level<0) {
+ else if (xmvis->level<0) {
/* underlay */
*value = GLX_NONE_EXT;
}
return 0;
case GLX_TRANSPARENT_INDEX_VALUE_EXT:
{
- int pixel = transparent_pixel( glxvis );
+ int pixel = transparent_pixel( xmvis );
if (pixel>=0) {
*value = pixel;
}
@@ -1584,21 +1641,108 @@ Fake_glXGetConfig( Display *dpy, XVisualInfo *visinfo,
*/
case GLX_VISUAL_CAVEAT_EXT:
/* test for zero, just in case */
- if (glxvis->VisualCaveat > 0)
- *value = glxvis->VisualCaveat;
+ if (xmvis->VisualCaveat > 0)
+ *value = xmvis->VisualCaveat;
else
*value = GLX_NONE_EXT;
return 0;
/*
- * Extensions
+ * GLX_ARB_multisample
+ */
+ case GLX_SAMPLE_BUFFERS_ARB:
+ *value = 0;
+ return 0;
+ case GLX_SAMPLES_ARB:
+ *value = 0;
+ return 0;
+
+ /*
+ * For FBConfigs:
*/
+ case GLX_SCREEN_EXT:
+ if (!fbconfig)
+ return GLX_BAD_ATTRIBUTE;
+ *value = xmvis->visinfo->screen;
+ break;
+ case GLX_DRAWABLE_TYPE: /*SGIX too */
+ if (!fbconfig)
+ return GLX_BAD_ATTRIBUTE;
+ *value = GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT;
+ break;
+ case GLX_RENDER_TYPE_SGIX:
+ if (!fbconfig)
+ return GLX_BAD_ATTRIBUTE;
+ if (xmvis->mesa_visual.rgbMode)
+ *value = GLX_RGBA_BIT;
+ else
+ *value = GLX_COLOR_INDEX_BIT;
+ break;
+ case GLX_X_RENDERABLE_SGIX:
+ if (!fbconfig)
+ return GLX_BAD_ATTRIBUTE;
+ *value = True; /* XXX really? */
+ break;
+ case GLX_FBCONFIG_ID_SGIX:
+ if (!fbconfig)
+ return GLX_BAD_ATTRIBUTE;
+ *value = xmvis->visinfo->visualid;
+ break;
+ case GLX_MAX_PBUFFER_WIDTH:
+ if (!fbconfig)
+ return GLX_BAD_ATTRIBUTE;
+ /* XXX or MAX_WIDTH? */
+ *value = DisplayWidth(xmvis->display, xmvis->visinfo->screen);
+ break;
+ case GLX_MAX_PBUFFER_HEIGHT:
+ if (!fbconfig)
+ return GLX_BAD_ATTRIBUTE;
+ *value = DisplayHeight(xmvis->display, xmvis->visinfo->screen);
+ break;
+ case GLX_MAX_PBUFFER_PIXELS:
+ if (!fbconfig)
+ return GLX_BAD_ATTRIBUTE;
+ *value = DisplayWidth(xmvis->display, xmvis->visinfo->screen) *
+ DisplayHeight(xmvis->display, xmvis->visinfo->screen);
+ break;
+ case GLX_VISUAL_ID:
+ if (!fbconfig)
+ return GLX_BAD_ATTRIBUTE;
+ *value = xmvis->visinfo->visualid;
+ break;
+
default:
return GLX_BAD_ATTRIBUTE;
}
+ return Success;
}
+static int
+Fake_glXGetConfig( Display *dpy, XVisualInfo *visinfo,
+ int attrib, int *value )
+{
+ XMesaVisual xmvis;
+
+ xmvis = find_glx_visual( dpy, visinfo );
+ if (!xmvis) {
+ /* this visual wasn't obtained with glXChooseVisual */
+ xmvis = create_glx_visual( dpy, visinfo );
+ if (!xmvis) {
+ /* this visual can't be used for GL rendering */
+ if (attrib==GLX_USE_GL) {
+ *value = (int) False;
+ return 0;
+ }
+ else {
+ return GLX_BAD_VISUAL;
+ }
+ }
+ }
+
+ return get_config(xmvis, attrib, value, GL_FALSE);
+}
+
static void
Fake_glXWaitGL( void )
@@ -1617,18 +1761,16 @@ Fake_glXWaitX( void )
}
-/*
- * Return the extensions string, which is 3Dfx-dependant.
- */
-static const char *get_extensions( void )
+static const char *
+get_extensions( void )
{
#ifdef FX
- const char *fx = getenv("MESA_GLX_FX");
+ const char *fx = _mesa_getenv("MESA_GLX_FX");
if (fx && fx[0] != 'd') {
- return "GLX_MESA_pixmap_colormap GLX_EXT_visual_info GLX_EXT_visual_rating GLX_MESA_release_buffers GLX_MESA_copy_sub_buffer GLX_SGI_video_sync GLX_MESA_set_3dfx_mode GLX_ARB_get_proc_address";
+ return EXTENSIONS;
}
#endif
- return "GLX_MESA_pixmap_colormap GLX_EXT_visual_info GLX_EXT_visual_rating GLX_MESA_release_buffers GLX_MESA_copy_sub_buffer GLX_SGI_video_sync GLX_ARB_get_proc_address";
+ return EXTENSIONS + 23; /* skip "GLX_MESA_set_3dfx_mode" */
}
@@ -1649,8 +1791,8 @@ static const char *
Fake_glXQueryServerString( Display *dpy, int screen, int name )
{
static char version[1000];
- sprintf(version, "%d.%d %s", SERVER_MAJOR_VERSION, SERVER_MINOR_VERSION,
- MESA_GLX_VERSION);
+ _mesa_sprintf(version, "%d.%d %s",
+ SERVER_MAJOR_VERSION, SERVER_MINOR_VERSION, MESA_GLX_VERSION);
(void) dpy;
(void) screen;
@@ -1674,8 +1816,8 @@ static const char *
Fake_glXGetClientString( Display *dpy, int name )
{
static char version[1000];
- sprintf(version, "%d.%d %s", CLIENT_MAJOR_VERSION, CLIENT_MINOR_VERSION,
- MESA_GLX_VERSION);
+ _mesa_sprintf(version, "%d.%d %s", CLIENT_MAJOR_VERSION,
+ CLIENT_MINOR_VERSION, MESA_GLX_VERSION);
(void) dpy;
@@ -1697,24 +1839,26 @@ Fake_glXGetClientString( Display *dpy, int name )
* GLX 1.3 and later
*/
-/* XXX Move this when done.
- * Create an XMesaBuffer as a Pbuffer.
- * New in Mesa 4.0 but untested.
- */
-extern XMesaBuffer XMesaCreatePBuffer( XMesaVisual v, XMesaColormap cmap,
- unsigned int width, unsigned int height );
-
-
static GLXFBConfig *
Fake_glXChooseFBConfig( Display *dpy, int screen,
const int *attribList, int *nitems )
{
- (void) dpy;
- (void) screen;
- (void) attribList;
- (void) nitems;
- return 0;
+ XMesaVisual xmvis = choose_visual(dpy, screen, attribList);
+ if (xmvis) {
+ GLXFBConfig *config = _mesa_malloc(sizeof(XMesaVisual));
+ if (!config) {
+ *nitems = 0;
+ return NULL;
+ }
+ *nitems = 1;
+ config[0] = (GLXFBConfig) xmvis;
+ return (GLXFBConfig *) config;
+ }
+ else {
+ *nitems = 0;
+ return NULL;
+ }
}
@@ -1722,168 +1866,40 @@ static int
Fake_glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
int attribute, int *value )
{
- XMesaVisual v = NULL; /* XXX Fix this */
+ XMesaVisual v = (XMesaVisual) config;
(void) dpy;
(void) config;
- (void) attribute;
- (void) value;
if (!dpy || !config || !value)
return -1;
- switch (attribute) {
- case GLX_FBCONFIG_ID:
- case GLX_BUFFER_SIZE:
- if (v->mesa_visual.rgbMode)
- *value = v->mesa_visual.redBits + v->mesa_visual.greenBits +
- v->mesa_visual.blueBits + v->mesa_visual.alphaBits;
- else
- *value = v->mesa_visual.indexBits;
- break;
- case GLX_LEVEL:
- *value = v->level;
- break;
- case GLX_DOUBLEBUFFER:
- *value = v->mesa_visual.doubleBufferMode;
- break;
- case GLX_STEREO:
- *value = v->mesa_visual.stereoMode;
- break;
- case GLX_AUX_BUFFERS:
- *value = v->mesa_visual.numAuxBuffers;
- break;
- case GLX_RED_SIZE:
- *value = v->mesa_visual.redBits;
- break;
- case GLX_GREEN_SIZE:
- *value = v->mesa_visual.greenBits;
- break;
- case GLX_BLUE_SIZE:
- *value = v->mesa_visual.blueBits;
- break;
- case GLX_ALPHA_SIZE:
- *value = v->mesa_visual.alphaBits;
- break;
- case GLX_DEPTH_SIZE:
- *value = v->mesa_visual.depthBits;
- break;
- case GLX_STENCIL_SIZE:
- *value = v->mesa_visual.stencilBits;
- break;
- case GLX_ACCUM_RED_SIZE:
- *value = v->mesa_visual.accumRedBits;
- break;
- case GLX_ACCUM_GREEN_SIZE:
- *value = v->mesa_visual.accumGreenBits;
- break;
- case GLX_ACCUM_BLUE_SIZE:
- *value = v->mesa_visual.accumBlueBits;
- break;
- case GLX_ACCUM_ALPHA_SIZE:
- *value = v->mesa_visual.accumAlphaBits;
- break;
- case GLX_RENDER_TYPE:
- *value = 0; /* XXX ??? */
- break;
- case GLX_DRAWABLE_TYPE:
- *value = GLX_PBUFFER_BIT; /* XXX fix? */
- break;
- case GLX_X_RENDERABLE:
- *value = False; /* XXX ??? */
- break;
- case GLX_X_VISUAL_TYPE:
-#if defined(__cplusplus) || defined(c_plusplus)
- switch (v->vishandle->c_class) {
-#else
- switch (v->vishandle->class) {
-#endif
- case GrayScale:
- *value = GLX_GRAY_SCALE;
- break;
- case StaticGray:
- *value = GLX_STATIC_GRAY;
- break;
- case StaticColor:
- *value = GLX_STATIC_COLOR;
- break;
- case PseudoColor:
- *value = GLX_PSEUDO_COLOR;
- break;
- case TrueColor:
- *value = GLX_TRUE_COLOR;
- break;
- case DirectColor:
- *value = GLX_DIRECT_COLOR;
- break;
- default:
- *value = 0;
- }
- break;
- case GLX_CONFIG_CAVEAT:
- *value = 0; /* XXX ??? */
- break;
- case GLX_TRANSPARENT_TYPE:
- if (v->level == 0) {
- /* normal planes */
- *value = GLX_NONE_EXT;
- }
- else if (v->level > 0) {
- /* overlay */
- if (v->mesa_visual.rgbMode) {
- *value = GLX_TRANSPARENT_RGB_EXT;
- }
- else {
- *value = GLX_TRANSPARENT_INDEX_EXT;
- }
- }
- else if (v->level < 0) {
- /* underlay */
- *value = GLX_NONE_EXT;
- }
- break;
- case GLX_TRANSPARENT_INDEX_VALUE:
- *value = transparent_pixel( v );
- break;
- case GLX_TRANSPARENT_RED_VALUE:
- *value = 0; /* not implemented */
- break;
- case GLX_TRANSPARENT_GREEN_VALUE:
- *value = 0; /* not implemented */
- break;
- case GLX_TRANSPARENT_BLUE_VALUE:
- *value = 0; /* not implemented */
- break;
- case GLX_TRANSPARENT_ALPHA_VALUE:
- *value = 0; /* not implemented */
- break;
- case GLX_MAX_PBUFFER_WIDTH:
- *value = DisplayWidth(dpy, v->vishandle->screen);
- break;
- case GLX_MAX_PBUFFER_HEIGHT:
- *value = DisplayHeight(dpy, v->vishandle->screen);
- break;
- case GLX_MAX_PBUFFER_PIXELS:
- *value = DisplayWidth(dpy, v->vishandle->screen) *
- DisplayHeight(dpy, v->vishandle->screen);
- break;
- case GLX_VISUAL_ID:
- *value = v->vishandle->visualid;
- break;
- default:
- return GLX_BAD_ATTRIBUTE;
- }
-
- return Success;
+ return get_config(v, attribute, value, GL_TRUE);
}
static GLXFBConfig *
Fake_glXGetFBConfigs( Display *dpy, int screen, int *nelements )
{
- (void) dpy;
- (void) screen;
- (void) nelements;
- return 0;
+ XVisualInfo *visuals, visTemplate;
+ const long visMask = VisualScreenMask;
+ int i;
+
+ /* Get list of all X visuals */
+ visTemplate.screen = screen;
+ visuals = XGetVisualInfo(dpy, visMask, &visTemplate, nelements);
+ if (*nelements > 0) {
+ XMesaVisual *results;
+ results = _mesa_malloc(*nelements * sizeof(XMesaVisual));
+ if (!results) {
+ *nelements = 0;
+ return NULL;
+ }
+ for (i = 0; i < *nelements; i++) {
+ results[i] = create_glx_visual(dpy, visuals + i);
+ }
+ return (GLXFBConfig *) results;
+ }
+ return NULL;
}
@@ -1891,8 +1907,17 @@ static XVisualInfo *
Fake_glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config )
{
if (dpy && config) {
- XMesaVisual v = (XMesaVisual) config;
- return v->vishandle;
+ XMesaVisual xmvis = (XMesaVisual) config;
+#if 0
+ return xmvis->vishandle;
+#else
+ /* create a new vishandle - the cached one may be stale */
+ xmvis->vishandle = _mesa_malloc(sizeof(XVisualInfo));
+ if (xmvis->vishandle) {
+ _mesa_memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo));
+ }
+ return xmvis->vishandle;
+#endif
}
else {
return NULL;
@@ -1929,7 +1954,6 @@ Fake_glXCreatePixmap( Display *dpy, GLXFBConfig config, Pixmap pixmap,
const int *attribList )
{
XMesaVisual v = (XMesaVisual) config;
- XVisualInfo *visinfo;
XMesaBuffer b;
(void) dpy;
@@ -1940,17 +1964,6 @@ Fake_glXCreatePixmap( Display *dpy, GLXFBConfig config, Pixmap pixmap,
if (!dpy || !config || !pixmap)
return 0;
- visinfo = v->vishandle;
-
- v = find_glx_visual( dpy, visinfo );
- if (!v) {
- v = create_glx_visual( dpy, visinfo );
- if (!v) {
- /* unusable visual */
- return 0;
- }
- }
-
b = XMesaCreatePixmapBuffer( v, pixmap, 0 );
if (!b) {
return 0;
@@ -1974,26 +1987,31 @@ static GLXPbuffer
Fake_glXCreatePbuffer( Display *dpy, GLXFBConfig config,
const int *attribList )
{
+ XMesaVisual xmvis = (XMesaVisual) config;
+ XMesaBuffer xmbuf;
const int *attrib;
int width = 0, height = 0;
GLboolean useLargest = GL_FALSE, preserveContents = GL_FALSE;
(void) dpy;
- (void) config;
- for (attrib = attribList; attrib; attrib++) {
+ for (attrib = attribList; *attrib; attrib++) {
switch (*attrib) {
case GLX_PBUFFER_WIDTH:
- width = *(++attrib);
+ attrib++;
+ width = *attrib;
break;
case GLX_PBUFFER_HEIGHT:
- height = *(++attrib);
+ attrib++;
+ height = *attrib;
break;
case GLX_PRESERVED_CONTENTS:
- preserveContents = GL_TRUE; /* ignored */
+ attrib++;
+ preserveContents = *attrib; /* ignored */
break;
case GLX_LARGEST_PBUFFER:
- useLargest = GL_TRUE; /* ignored */
+ attrib++;
+ useLargest = *attrib; /* ignored */
break;
default:
return 0;
@@ -2003,16 +2021,21 @@ Fake_glXCreatePbuffer( Display *dpy, GLXFBConfig config,
if (width == 0 || height == 0)
return 0;
-
- return 0;
+ xmbuf = XMesaCreatePBuffer( xmvis, 0, width, height);
+ /* A GLXPbuffer handle must be an X Drawable because that's what
+ * glXMakeCurrent takes.
+ */
+ return (GLXPbuffer) xmbuf->frontbuffer;
}
static void
Fake_glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf )
{
- (void) dpy;
- (void) pbuf;
+ XMesaBuffer b = XMesaFindBuffer(dpy, pbuf);
+ if (b) {
+ XMesaDestroyBuffer(b);
+ }
}
@@ -2020,16 +2043,25 @@ static void
Fake_glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
unsigned int *value )
{
- (void) dpy;
- (void) draw;
+ XMesaBuffer xmbuf = XMesaFindBuffer(dpy, draw);
+ if (!xmbuf)
+ return;
switch (attribute) {
case GLX_WIDTH:
+ *value = xmbuf->width;
+ break;
case GLX_HEIGHT:
+ *value = xmbuf->height;
+ break;
case GLX_PRESERVED_CONTENTS:
+ *value = True;
+ break;
case GLX_LARGEST_PBUFFER:
+ *value = xmbuf->width * xmbuf->height;
+ break;
case GLX_FBCONFIG_ID:
- *value = 0;
+ *value = xmbuf->xm_visual->visinfo->visualid;
return;
default:
return; /* GLX_BAD_ATTRIBUTE? */
@@ -2041,40 +2073,74 @@ static GLXContext
Fake_glXCreateNewContext( Display *dpy, GLXFBConfig config,
int renderType, GLXContext shareList, Bool direct )
{
- XMesaVisual v = (XMesaVisual) config;
+ struct fake_glx_context *glxCtx;
+ struct fake_glx_context *shareCtx = (struct fake_glx_context *) shareList;
+ XMesaVisual xmvis = (XMesaVisual) config;
if (!dpy || !config ||
(renderType != GLX_RGBA_TYPE && renderType != GLX_COLOR_INDEX_TYPE))
return 0;
- return Fake_glXCreateContext(dpy, v->vishandle, shareList, direct);
+ glxCtx = CALLOC_STRUCT(fake_glx_context);
+ if (!glxCtx)
+ return 0;
+
+ /* deallocate unused windows/buffers */
+ XMesaGarbageCollect();
+
+ glxCtx->xmesaContext = XMesaCreateContext(xmvis,
+ shareCtx ? shareCtx->xmesaContext : NULL);
+ if (!glxCtx->xmesaContext) {
+ FREE(glxCtx);
+ return NULL;
+ }
+
+ glxCtx->xmesaContext->direct = GL_FALSE;
+ glxCtx->glxContext.isDirect = GL_FALSE;
+ glxCtx->glxContext.currentDpy = dpy;
+ glxCtx->glxContext.xid = (XID) glxCtx; /* self pointer */
+
+ assert((void *) glxCtx == (void *) &(glxCtx->glxContext));
+
+ return (GLXContext) glxCtx;
}
static int
Fake_glXQueryContext( Display *dpy, GLXContext ctx, int attribute, int *value )
{
+ struct fake_glx_context *glxCtx = (struct fake_glx_context *) ctx;
+ XMesaContext xmctx = glxCtx->xmesaContext;
+
(void) dpy;
(void) ctx;
switch (attribute) {
case GLX_FBCONFIG_ID:
+ *value = xmctx->xm_visual->visinfo->visualid;
+ break;
case GLX_RENDER_TYPE:
+ if (xmctx->xm_visual->mesa_visual.rgbMode)
+ *value = GLX_RGBA_BIT;
+ else
+ *value = GLX_COLOR_INDEX_BIT;
+ break;
case GLX_SCREEN:
*value = 0;
return Success;
default:
return GLX_BAD_ATTRIBUTE;
}
+ return 0;
}
static void
Fake_glXSelectEvent( Display *dpy, GLXDrawable drawable, unsigned long mask )
{
- (void) dpy;
- (void) drawable;
- (void) mask;
+ XMesaBuffer xmbuf = XMesaFindBuffer(dpy, drawable);
+ if (xmbuf)
+ xmbuf->selectedEvents = mask;
}
@@ -2082,9 +2148,11 @@ static void
Fake_glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
unsigned long *mask )
{
- (void) dpy;
- (void) drawable;
- (void) mask;
+ XMesaBuffer xmbuf = XMesaFindBuffer(dpy, drawable);
+ if (xmbuf)
+ *mask = xmbuf->selectedEvents;
+ else
+ *mask = 0;
}
@@ -2125,11 +2193,7 @@ Fake_glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
static Bool
Fake_glXMakeCurrentReadSGI(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx)
{
- (void) dpy;
- (void) draw;
- (void) read;
- (void) ctx;
- return False;
+ return Fake_glXMakeContextCurrent( dpy, draw, read, ctx );
}
/* not used
@@ -2207,57 +2271,74 @@ Fake_glXQueryContextInfoEXT(Display *dpy, GLXContext context, int attribute, int
static int
Fake_glXGetFBConfigAttribSGIX(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value)
{
- (void) dpy;
- (void) config;
- (void) attribute;
- (void) value;
- return 0;
+ return Fake_glXGetFBConfigAttrib(dpy, config, attribute, value);
}
static GLXFBConfigSGIX *
Fake_glXChooseFBConfigSGIX(Display *dpy, int screen, int *attrib_list, int *nelements)
{
- (void) dpy;
- (void) screen;
- (void) attrib_list;
- (void) nelements;
- return 0;
+ return (GLXFBConfig *) Fake_glXChooseFBConfig(dpy, screen, attrib_list, nelements);
}
+
static GLXPixmap
Fake_glXCreateGLXPixmapWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap)
{
- (void) dpy;
- (void) config;
- (void) pixmap;
- return 0;
+ XMesaVisual xmvis = (XMesaVisual) config;
+ XMesaBuffer xmbuf = XMesaCreatePixmapBuffer(xmvis, pixmap, 0);
+ return xmbuf->frontbuffer; /* need to return an X ID */
}
+
static GLXContext
Fake_glXCreateContextWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct)
{
- (void) dpy;
- (void) config;
- (void) render_type;
- (void) share_list;
- (void) direct;
- return 0;
+ XMesaVisual xmvis = (XMesaVisual) config;
+ struct fake_glx_context *glxCtx;
+ struct fake_glx_context *shareCtx = (struct fake_glx_context *) share_list;
+
+ glxCtx = CALLOC_STRUCT(fake_glx_context);
+ if (!glxCtx)
+ return 0;
+
+ /* deallocate unused windows/buffers */
+ XMesaGarbageCollect();
+
+ glxCtx->xmesaContext = XMesaCreateContext(xmvis,
+ shareCtx ? shareCtx->xmesaContext : NULL);
+ if (!glxCtx->xmesaContext) {
+ FREE(glxCtx);
+ return NULL;
+ }
+
+ glxCtx->xmesaContext->direct = GL_FALSE;
+ glxCtx->glxContext.isDirect = GL_FALSE;
+ glxCtx->glxContext.currentDpy = dpy;
+ glxCtx->glxContext.xid = (XID) glxCtx; /* self pointer */
+
+ assert((void *) glxCtx == (void *) &(glxCtx->glxContext));
+
+ return (GLXContext) glxCtx;
}
+
static XVisualInfo *
Fake_glXGetVisualFromFBConfigSGIX(Display *dpy, GLXFBConfigSGIX config)
{
- (void) dpy;
- (void) config;
- return NULL;
+ return Fake_glXGetVisualFromFBConfig(dpy, config);
}
+
static GLXFBConfigSGIX
Fake_glXGetFBConfigFromVisualSGIX(Display *dpy, XVisualInfo *vis)
{
- (void) dpy;
- (void) vis;
- return 0;
+ XMesaVisual xmvis = find_glx_visual(dpy, vis);
+ if (!xmvis) {
+ /* This visual wasn't found with glXChooseVisual() */
+ xmvis = create_glx_visual(dpy, vis);
+ }
+
+ return (GLXFBConfigSGIX) xmvis;
}
@@ -2265,47 +2346,104 @@ Fake_glXGetFBConfigFromVisualSGIX(Display *dpy, XVisualInfo *vis)
/*** GLX_SGIX_pbuffer ***/
static GLXPbufferSGIX
-Fake_glXCreateGLXPbufferSGIX(Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list)
+Fake_glXCreateGLXPbufferSGIX(Display *dpy, GLXFBConfigSGIX config,
+ unsigned int width, unsigned int height,
+ int *attribList)
{
+ XMesaVisual xmvis = (XMesaVisual) config;
+ XMesaBuffer xmbuf;
+ const int *attrib;
+ GLboolean useLargest = GL_FALSE, preserveContents = GL_FALSE;
+
(void) dpy;
- (void) config;
- (void) width;
- (void) height;
- (void) attrib_list;
- return 0;
+
+ for (attrib = attribList; *attrib; attrib++) {
+ switch (*attrib) {
+ case GLX_PRESERVED_CONTENTS_SGIX:
+ attrib++;
+ preserveContents = *attrib; /* ignored */
+ break;
+ case GLX_LARGEST_PBUFFER_SGIX:
+ attrib++;
+ useLargest = *attrib; /* ignored */
+ break;
+ default:
+ return 0;
+ }
+ }
+
+ xmbuf = XMesaCreatePBuffer( xmvis, 0, width, height);
+ /* A GLXPbuffer handle must be an X Drawable because that's what
+ * glXMakeCurrent takes.
+ */
+ return (GLXPbuffer) xmbuf->frontbuffer;
}
+
static void
Fake_glXDestroyGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf)
{
- (void) dpy;
- (void) pbuf;
+ XMesaBuffer xmbuf = XMesaFindBuffer(dpy, pbuf);
+ if (xmbuf) {
+ XMesaDestroyBuffer(xmbuf);
+ }
}
+
static int
Fake_glXQueryGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value)
{
- (void) dpy;
- (void) pbuf;
- (void) attribute;
- (void) value;
+ const XMesaBuffer xmbuf = XMesaFindBuffer(dpy, pbuf);
+
+ if (!xmbuf) {
+ /* Generate GLXBadPbufferSGIX for bad pbuffer */
+ return 0;
+ }
+
+ switch (attribute) {
+ case GLX_PRESERVED_CONTENTS_SGIX:
+ *value = True;
+ break;
+ case GLX_LARGEST_PBUFFER_SGIX:
+ *value = xmbuf->width * xmbuf->height;
+ break;
+ case GLX_WIDTH_SGIX:
+ *value = xmbuf->width;
+ break;
+ case GLX_HEIGHT_SGIX:
+ *value = xmbuf->height;
+ break;
+ case GLX_EVENT_MASK_SGIX:
+ *value = 0; /* XXX might be wrong */
+ break;
+ default:
+ *value = 0;
+ }
return 0;
}
+
static void
Fake_glXSelectEventSGIX(Display *dpy, GLXDrawable drawable, unsigned long mask)
{
- (void) dpy;
- (void) drawable;
- (void) mask;
+ XMesaBuffer xmbuf = XMesaFindBuffer(dpy, drawable);
+ if (xmbuf) {
+ /* Note: we'll never generate clobber events */
+ xmbuf->selectedEvents = mask;
+ }
}
+
static void
Fake_glXGetSelectedEventSGIX(Display *dpy, GLXDrawable drawable, unsigned long *mask)
{
- (void) dpy;
- (void) drawable;
- (void) mask;
+ XMesaBuffer xmbuf = XMesaFindBuffer(dpy, drawable);
+ if (xmbuf) {
+ *mask = xmbuf->selectedEvents;
+ }
+ else {
+ *mask = 0;
+ }
}
@@ -2476,6 +2614,38 @@ Fake_glXSet3DfxModeMESA( int mode )
+/*** AGP memory allocation ***/
+static void *
+Fake_glXAllocateMemoryNV( GLsizei size,
+ GLfloat readFrequency,
+ GLfloat writeFrequency,
+ GLfloat priority )
+{
+ (void) size;
+ (void) readFrequency;
+ (void) writeFrequency;
+ (void) priority;
+ return NULL;
+}
+
+
+static void
+Fake_glXFreeMemoryNV( GLvoid *pointer )
+{
+ (void) pointer;
+}
+
+
+/*** GLX_MESA_agp_offset */
+
+static GLuint
+Fake_glXGetAGPOffsetMESA( const GLvoid *pointer )
+{
+ (void) pointer;
+ return ~0;
+}
+
+
extern struct _glxapi_table *_mesa_GetGLXDispatchTable(void);
struct _glxapi_table *_mesa_GetGLXDispatchTable(void)
@@ -2614,5 +2784,12 @@ struct _glxapi_table *_mesa_GetGLXDispatchTable(void)
/*** GLX_MESA_set_3dfx_mode ***/
glx.Set3DfxModeMESA = Fake_glXSet3DfxModeMESA;
+ /*** GLX_NV_vertex_array_range ***/
+ glx.AllocateMemoryNV = Fake_glXAllocateMemoryNV;
+ glx.FreeMemoryNV = Fake_glXFreeMemoryNV;
+
+ /*** GLX_MESA_agp_offset ***/
+ glx.GetAGPOffsetMESA = Fake_glXGetAGPOffsetMESA;
+
return &glx;
}
diff --git a/xc/extras/Mesa/src/X/glxapi.c b/xc/extras/Mesa/src/X/glxapi.c
index 4ddd7a92e..0ef19ff06 100644
--- a/xc/extras/Mesa/src/X/glxapi.c
+++ b/xc/extras/Mesa/src/X/glxapi.c
@@ -987,6 +987,35 @@ Bool glXSet3DfxModeMESA(int mode)
+/*** AGP memory allocation ***/
+
+void *
+glXAllocateMemoryNV( GLsizei size,
+ GLfloat readFrequency,
+ GLfloat writeFrequency,
+ GLfloat priority )
+{
+ struct _glxapi_table *t;
+ Display *dpy = glXGetCurrentDisplay();
+ GET_DISPATCH(dpy, t);
+ if (!t)
+ return NULL;
+ return (t->AllocateMemoryNV)(size, readFrequency, writeFrequency, priority);
+}
+
+
+void
+glXFreeMemoryNV( GLvoid *pointer )
+{
+ struct _glxapi_table *t;
+ Display *dpy = glXGetCurrentDisplay();
+ GET_DISPATCH(dpy, t);
+ if (!t)
+ return;
+ (t->FreeMemoryNV)(pointer);
+}
+
+
/**********************************************************************/
/* GLX API management functions */
@@ -1197,6 +1226,10 @@ static struct name_address_pair GLX_functions[] = {
/*** GLX_ARB_get_proc_address ***/
{ "glXGetProcAddressARB", (GLvoid *) glXGetProcAddressARB },
+ /*** GLX AGP memory allocation ***/
+ { "glXAllocateMemoryNV", (GLvoid *) glXAllocateMemoryNV },
+ { "glXFreeMemoryNV", (GLvoid *) glXFreeMemoryNV },
+
{ NULL, NULL } /* end of list */
};
diff --git a/xc/extras/Mesa/src/X/glxapi.h b/xc/extras/Mesa/src/X/glxapi.h
index 31e257e6f..5c61334d1 100644
--- a/xc/extras/Mesa/src/X/glxapi.h
+++ b/xc/extras/Mesa/src/X/glxapi.h
@@ -195,6 +195,15 @@ struct _glxapi_table {
/*** GLX_MESA_set_3dfx_mode ***/
Bool (*Set3DfxModeMESA)(int mode);
+ /*** GLX_NV_vertex_array_range ***/
+ void * (*AllocateMemoryNV)( GLsizei size,
+ GLfloat readFrequency,
+ GLfloat writeFrequency,
+ GLfloat priority );
+ void (*FreeMemoryNV)( GLvoid *pointer );
+
+ /*** GLX_MESA_agp_offset ***/
+ GLuint (*GetAGPOffsetMESA)( const GLvoid *pointer );
};
diff --git a/xc/extras/Mesa/src/X/glxheader.h b/xc/extras/Mesa/src/X/glxheader.h
index 39b9a0211..b58340038 100644
--- a/xc/extras/Mesa/src/X/glxheader.h
+++ b/xc/extras/Mesa/src/X/glxheader.h
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * 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"),
@@ -56,6 +56,7 @@
# include <sys/shm.h>
# include <X11/extensions/XShm.h>
# endif
+# include <GL/glx.h>
#endif
diff --git a/xc/extras/Mesa/src/X/realglx.c b/xc/extras/Mesa/src/X/realglx.c
index bd9800532..a7783f508 100644
--- a/xc/extras/Mesa/src/X/realglx.c
+++ b/xc/extras/Mesa/src/X/realglx.c
@@ -1,4 +1,3 @@
-/* $Id: realglx.c,v 1.1.1.3 2002/10/22 13:05:58 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -170,5 +169,12 @@ _real_GetGLXDispatchTable(void)
/*** GLX_MESA_set_3dfx_mode ***/
glx.Set3DfxModeMESA = _real_glXSet3DfxModeMESA;
+ /*** GLX_NV_vertex_array_range ***/
+ glx.AllocateMemoryNV = _real_glXAllocateMemoryNV;
+ glx.FreeMemoryNV = _real_glXFreeMemoryNV;
+
+ /*** GLX_MESA_agp_offset ***/
+ glx.GetAGPOffsetMESA = _real_glXGetAGPOffsetMESA;
+
return &glx;
}
diff --git a/xc/extras/Mesa/src/X/realglx.h b/xc/extras/Mesa/src/X/realglx.h
index da5924987..150129db6 100644
--- a/xc/extras/Mesa/src/X/realglx.h
+++ b/xc/extras/Mesa/src/X/realglx.h
@@ -1,4 +1,3 @@
-/* $Id: realglx.h,v 1.1.1.3 2002/10/22 13:05:58 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -306,6 +305,18 @@ extern Bool
_real_glXSet3DfxModeMESA( int mode );
#endif
+#ifdef GLX_NV_vertex_array_range
+extern void *
+_real_glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+extern void
+_real_glXFreeMemoryNV(GLvoid *pointer);
+#endif
+
+#ifdef GLX_MESA_agp_offset
+extern GLuint
+_real_glXGetAGPOffsetMESA(const GLvoid *pointer);
+#endif
+
#ifdef GLX_MESA_copy_sub_buffer
extern void
_real_glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
diff --git a/xc/extras/Mesa/src/X/xfonts.c b/xc/extras/Mesa/src/X/xfonts.c
index d2a1a7a40..8e256e097 100644
--- a/xc/extras/Mesa/src/X/xfonts.c
+++ b/xc/extras/Mesa/src/X/xfonts.c
@@ -32,19 +32,9 @@
#include <GL/vms_x_fix.h>
#endif
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include "GL/gl.h"
-#include "GL/glx.h"
+#include "glxheader.h"
#include "context.h"
-#include "mem.h"
+#include "imports.h"
#include "xfonts.h"
diff --git a/xc/extras/Mesa/src/X/xm_api.c b/xc/extras/Mesa/src/X/xm_api.c
index d1d4682aa..3555af027 100644
--- a/xc/extras/Mesa/src/X/xm_api.c
+++ b/xc/extras/Mesa/src/X/xm_api.c
@@ -1,6 +1,7 @@
+
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 5.0
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -21,7 +22,7 @@
* AN ACTION 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/extras/Mesa/src/X/xm_api.c,v 1.5 2002/09/09 21:52:12 dawes Exp $ */
+/* $XFree86: xc/extras/Mesa/src/X/xm_api.c,v 1.2 2002/02/26 23:37:31 tsi Exp $ */
/*
* This file contains the implementations of all the XMesa* functions.
@@ -67,13 +68,10 @@
#include "context.h"
#include "extensions.h"
#include "glthread.h"
+#include "imports.h"
#include "matrix.h"
-#include "mem.h"
#include "mmath.h"
#include "mtypes.h"
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
#include "macros.h"
#include "texformat.h"
#include "texstore.h"
@@ -162,18 +160,6 @@ static short hpcr_rgbTbl[3][256] = {
/*
- * X/Mesa error reporting function:
- */
-static void error( const char *msg )
-{
- (void)DitherValues; /* Muffle compiler */
-
- if (getenv("MESA_DEBUG"))
- fprintf( stderr, "X/Mesa error: %s\n", msg );
-}
-
-
-/*
* Return the host's byte order as LSBFirst or MSBFirst ala X.
*/
#ifndef XFree86Server
@@ -267,7 +253,7 @@ static GLint gamma_adjust( GLfloat gamma, GLint value, GLint max )
}
else {
double x = (double) value / (double) max;
- return IROUND_POS((GLfloat) max * pow(x, 1.0F/gamma));
+ return IROUND_POS((GLfloat) max * _mesa_pow(x, 1.0F/gamma));
}
}
@@ -281,8 +267,6 @@ 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
*/
-#define GET_BITS_PER_PIXEL(xmv) bits_per_pixel(xmv)
-
#ifdef XFree86Server
static int bits_per_pixel( XMesaVisual xmv )
@@ -499,7 +483,7 @@ static GLboolean alloc_shm_back_buffer( XMesaBuffer b )
ZPixmap, NULL, &b->shminfo,
b->width, b->height );
if (b->backimage == NULL) {
- error("alloc_back_buffer: Shared memory error (XShmCreateImage), disabling.");
+ _mesa_warning(NULL, "alloc_back_buffer: Shared memory error (XShmCreateImage), disabling.");
b->shm = 0;
return GL_FALSE;
}
@@ -507,11 +491,10 @@ static GLboolean alloc_shm_back_buffer( XMesaBuffer b )
b->shminfo.shmid = shmget( IPC_PRIVATE, b->backimage->bytes_per_line
* b->backimage->height, IPC_CREAT|0777 );
if (b->shminfo.shmid < 0) {
- if (getenv("MESA_DEBUG"))
- perror("alloc_back_buffer");
+ _mesa_warning(NULL, "shmget failed while allocating back buffer");
XDestroyImage( b->backimage );
b->backimage = NULL;
- error("alloc_back_buffer: Shared memory error (shmget), disabling.");
+ _mesa_warning(NULL, "alloc_back_buffer: Shared memory error (shmget), disabling.");
b->shm = 0;
return GL_FALSE;
}
@@ -519,12 +502,11 @@ static GLboolean alloc_shm_back_buffer( XMesaBuffer b )
b->shminfo.shmaddr = b->backimage->data
= (char*)shmat( b->shminfo.shmid, 0, 0 );
if (b->shminfo.shmaddr == (char *) -1) {
- if (getenv("MESA_DEBUG"))
- perror("alloc_back_buffer");
+ _mesa_warning(NULL, "shmat() failed while allocating back buffer");
XDestroyImage( b->backimage );
shmctl( b->shminfo.shmid, IPC_RMID, 0 );
b->backimage = NULL;
- error("alloc_back_buffer: Shared memory error (shmat), disabling.");
+ _mesa_warning(NULL, "alloc_back_buffer: Shared memory error (shmat), disabling.");
b->shm = 0;
return GL_FALSE;
}
@@ -627,9 +609,7 @@ void xmesa_alloc_back_buffer( XMesaBuffer b )
b->backimage = XMesaCreateImage(b->xm_visual->BitsPerPixel,
b->width, b->height, NULL);
#else
- if (b->shm==0
- || alloc_shm_back_buffer(b)==GL_FALSE
- ) {
+ if (b->shm==0 || alloc_shm_back_buffer(b)==GL_FALSE) {
/* Allocate a regular XImage for the back buffer. */
b->backimage = XCreateImage( b->xm_visual->display,
b->xm_visual->visinfo->visual,
@@ -639,12 +619,12 @@ void xmesa_alloc_back_buffer( XMesaBuffer b )
8, 0 ); /* pad, bytes_per_line */
#endif
if (!b->backimage) {
- error("alloc_back_buffer: XCreateImage failed.");
+ _mesa_warning(NULL, "alloc_back_buffer: XCreateImage failed.");
}
b->backimage->data = (char *) MALLOC( b->backimage->height
* b->backimage->bytes_per_line );
if (!b->backimage->data) {
- error("alloc_back_buffer: MALLOC failed.");
+ _mesa_warning(NULL, "alloc_back_buffer: MALLOC failed.");
XMesaDestroyImage( b->backimage );
b->backimage = NULL;
}
@@ -877,8 +857,8 @@ static GLboolean setup_grayscale( int client, XMesaVisual v,
buffer->pixel_to_b[xcol.pixel] = gray;
}
- if (colorsfailed && getenv("MESA_DEBUG")) {
- fprintf( stderr,
+ if (colorsfailed && _mesa_getenv("MESA_DEBUG")) {
+ _mesa_warning(NULL,
"Note: %d out of 256 needed colors do not match exactly.\n",
colorsfailed );
}
@@ -957,8 +937,8 @@ static GLboolean setup_dithered_color( int client, XMesaVisual v,
}
}
- if (colorsfailed && getenv("MESA_DEBUG")) {
- fprintf( stderr,
+ if (colorsfailed && _mesa_getenv("MESA_DEBUG")) {
+ _mesa_warning(NULL,
"Note: %d out of %d needed colors do not match exactly.\n",
colorsfailed, _R*_G*_B );
}
@@ -991,19 +971,19 @@ static void setup_8bit_hpcr( XMesaVisual v )
g = 1.0 / v->RedGamma;
for (i=0; i<256; i++) {
- GLint red = IROUND_POS(255.0 * pow( hpcr_rgbTbl[0][i]/255.0, g ));
+ GLint red = IROUND_POS(255.0 * _mesa_pow( hpcr_rgbTbl[0][i]/255.0, g ));
v->hpcr_rgbTbl[0][i] = CLAMP( red, 16, 239 );
}
g = 1.0 / v->GreenGamma;
for (i=0; i<256; i++) {
- GLint green = IROUND_POS(255.0 * pow( hpcr_rgbTbl[1][i]/255.0, g ));
+ GLint green = IROUND_POS(255.0 * _mesa_pow( hpcr_rgbTbl[1][i]/255.0, g ));
v->hpcr_rgbTbl[1][i] = CLAMP( green, 16, 239 );
}
g = 1.0 / v->BlueGamma;
for (i=0; i<256; i++) {
- GLint blue = IROUND_POS(255.0 * pow( hpcr_rgbTbl[2][i]/255.0, g ));
+ GLint blue = IROUND_POS(255.0 * _mesa_pow( hpcr_rgbTbl[2][i]/255.0, g ));
v->hpcr_rgbTbl[2][i] = CLAMP( blue, 32, 223 );
}
v->undithered_pf = PF_HPCR; /* can't really disable dithering for now */
@@ -1012,7 +992,7 @@ static void setup_8bit_hpcr( XMesaVisual v )
/* which method should I use to clear */
/* GL_FALSE: keep the ordinary method */
/* GL_TRUE : clear with dither pattern */
- v->hpcr_clear_flag = getenv("MESA_HPCR_CLEAR") ? GL_TRUE : GL_FALSE;
+ v->hpcr_clear_flag = _mesa_getenv("MESA_HPCR_CLEAR") ? GL_TRUE : GL_FALSE;
if (v->hpcr_clear_flag) {
v->hpcr_clear_pixmap = XMesaCreatePixmap(v->display,
@@ -1195,8 +1175,7 @@ static GLboolean initialize_visual_and_buffer( int client,
XMesaBuffer b,
GLboolean rgb_flag,
XMesaDrawable window,
- XMesaColormap cmap
- )
+ XMesaColormap cmap )
{
#ifndef XFree86Server
XGCValues gcvalues;
@@ -1207,7 +1186,7 @@ static GLboolean initialize_visual_and_buffer( int client,
}
/* Save true bits/pixel */
- v->BitsPerPixel = GET_BITS_PER_PIXEL(v);
+ v->BitsPerPixel = bits_per_pixel(v);
assert(v->BitsPerPixel > 0);
@@ -1243,12 +1222,12 @@ static GLboolean initialize_visual_and_buffer( int client,
}
}
else {
- error("XMesa: RGB mode rendering not supported in given visual.");
+ _mesa_warning(NULL, "XMesa: RGB mode rendering not supported in given visual.");
return GL_FALSE;
}
v->index_bits = 0;
- if (getenv("MESA_NO_DITHER")) {
+ if (_mesa_getenv("MESA_NO_DITHER")) {
v->dithered_pf = v->undithered_pf;
}
}
@@ -1259,13 +1238,13 @@ static GLboolean initialize_visual_and_buffer( int client,
* which can help Brian figure out what's going on when a user
* reports bugs.
*/
- if (getenv("MESA_INFO")) {
- fprintf(stderr, "X/Mesa visual = %p\n", (void *) v);
- fprintf(stderr, "X/Mesa dithered pf = %u\n", v->dithered_pf);
- fprintf(stderr, "X/Mesa undithered pf = %u\n", v->undithered_pf);
- fprintf(stderr, "X/Mesa level = %d\n", v->level);
- fprintf(stderr, "X/Mesa depth = %d\n", GET_VISUAL_DEPTH(v));
- fprintf(stderr, "X/Mesa bits per pixel = %d\n", v->BitsPerPixel);
+ if (_mesa_getenv("MESA_INFO")) {
+ _mesa_printf("X/Mesa visual = %p\n", (void *) v);
+ _mesa_printf("X/Mesa dithered pf = %u\n", v->dithered_pf);
+ _mesa_printf("X/Mesa undithered pf = %u\n", v->undithered_pf);
+ _mesa_printf("X/Mesa level = %d\n", v->level);
+ _mesa_printf("X/Mesa depth = %d\n", GET_VISUAL_DEPTH(v));
+ _mesa_printf("X/Mesa bits per pixel = %d\n", v->BitsPerPixel);
}
if (b && window) {
@@ -1477,7 +1456,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
GLint red_bits, green_bits, blue_bits, alpha_bits;
/* For debugging only */
- if (getenv("MESA_XSYNC")) {
+ 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.
@@ -1514,11 +1493,6 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
return NULL;
}
MEMCPY(v->visinfo, visinfo, sizeof(*visinfo));
-
- /* Save a copy of the pointer now so we can find this visual again
- * if we need to search for it in find_glx_visual().
- */
- v->vishandle = visinfo;
#endif
#ifdef XFree86Server
@@ -1535,7 +1509,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
#endif
/* check for MESA_GAMMA environment variable */
- gamma = getenv("MESA_GAMMA");
+ gamma = _mesa_getenv("MESA_GAMMA");
if (gamma) {
v->RedGamma = v->GreenGamma = v->BlueGamma = 0.0;
sscanf( gamma, "%f %f %f", &v->RedGamma, &v->GreenGamma, &v->BlueGamma );
@@ -1618,11 +1592,10 @@ void XMesaDestroyVisual( XMesaVisual v )
*/
XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
{
+ static GLboolean firstTime = GL_TRUE;
XMesaContext c;
GLcontext *ctx;
- GLboolean direct = GL_TRUE; /* XXXX */
- /* NOT_DONE: should this be GL_FALSE??? */
- static GLboolean firstTime = GL_TRUE;
+ GLboolean direct = GL_TRUE; /* not really */
if (firstTime) {
_glthread_INIT_MUTEX(_xmesa_lock);
@@ -1636,7 +1609,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
ctx = c->gl_ctx = _mesa_create_context( &v->mesa_visual,
share_list ? share_list->gl_ctx : (GLcontext *) NULL,
- (void *) c, direct );
+ (void *) c, direct);
if (!c->gl_ctx) {
FREE(c);
return NULL;
@@ -1644,6 +1617,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
_mesa_enable_sw_extensions(ctx);
_mesa_enable_1_3_extensions(ctx);
+ _mesa_enable_1_4_extensions(ctx);
if (CHECK_BYTE_ORDER(v)) {
c->swapbytes = GL_FALSE;
@@ -1653,6 +1627,8 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
}
c->xm_visual = v;
+ c->xm_draw_buffer = NULL; /* set later by XMesaMakeCurrent */
+ c->xm_read_buffer = NULL; /* set later by XMesaMakeCurrent */
c->xm_buffer = NULL; /* set later by XMesaMakeCurrent */
c->display = v->display;
c->pixelformat = v->dithered_pf; /* Dithering is enabled by default */
@@ -1672,12 +1648,6 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
*/
xmesa_init_pointers( ctx );
-
- /* Run the config file
- */
- _mesa_read_config_file( ctx );
-
-
return c;
}
@@ -1687,8 +1657,8 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
void XMesaDestroyContext( XMesaContext c )
{
#ifdef FX
- if (c->xm_buffer && c->xm_buffer->FXctx)
- fxMesaDestroyContext(c->xm_buffer->FXctx);
+ if (c->xm_draw_buffer && c->xm_buffer->FXctx)
+ fxMesaDestroyContext(c->xm_draw_buffer->FXctx);
#endif
if (c->gl_ctx) {
_swsetup_DestroyContext( c->gl_ctx );
@@ -1742,14 +1712,12 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, XMesaWindow w,
if (GET_VISUAL_DEPTH(v) != attr.depth) {
#endif
- if (getenv("MESA_DEBUG")) {
- fprintf(stderr, "XMesaCreateWindowBuffer: depth mismatch between visual and window!\n");
- }
+ _mesa_warning(NULL, "XMesaCreateWindowBuffer: depth mismatch between visual and window!\n");
return NULL;
}
b->xm_visual = v;
- b->pixmap_flag = GL_FALSE;
+ b->type = WINDOW;
b->display = v->display;
#ifdef XFree86Server
b->cmap = (ColormapPtr)LookupIDByType(wColormap(w), RT_COLORMAP);
@@ -1758,9 +1726,7 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, XMesaWindow w,
b->cmap = attr.colormap;
}
else {
- if (getenv("MESA_DEBUG")) {
- fprintf(stderr, "Window %u has no colormap!\n", (unsigned int) w);
- }
+ _mesa_warning(NULL, "Window %u has no colormap!\n", (unsigned int) w);
/* this is weird, a window w/out a colormap!? */
/* OK, let's just allocate a new one and hope for the best */
b->cmap = XCreateColormap(v->display, w, attr.visual, AllocNone);
@@ -1794,7 +1760,7 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, XMesaWindow w,
}
#ifdef FX
- fxEnvVar = getenv("MESA_GLX_FX");
+ fxEnvVar = _mesa_getenv("MESA_GLX_FX");
if (fxEnvVar) {
if (fxEnvVar[0]!='d') {
int attribs[100];
@@ -1853,10 +1819,10 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, XMesaWindow w,
}
}
else {
- fprintf(stderr,"WARNING: This Mesa Library includes the Glide driver but\n");
- fprintf(stderr," you have not defined the MESA_GLX_FX env. var.\n");
- fprintf(stderr," (check the README.3DFX file for more information).\n\n");
- fprintf(stderr," you can disable this message with a 'export MESA_GLX_FX=disable'.\n");
+ _mesa_warning(NULL, "WARNING: This Mesa Library includes the Glide driver but\n");
+ _mesa_warning(NULL, " you have not defined the MESA_GLX_FX env. var.\n");
+ _mesa_warning(NULL, " (check the README.3DFX file for more information).\n\n");
+ _mesa_warning(NULL, " you can disable this message with a 'export MESA_GLX_FX=disable'.\n");
}
#endif
@@ -1895,7 +1861,7 @@ XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v,
assert(v);
b->xm_visual = v;
- b->pixmap_flag = GL_TRUE;
+ b->type = PIXMAP;
b->display = v->display;
b->cmap = cmap;
@@ -1932,21 +1898,29 @@ XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v,
-#if 0 /* not done */
XMesaBuffer XMesaCreatePBuffer( XMesaVisual v, XMesaColormap cmap,
unsigned int width, unsigned int height )
{
+#ifdef XFree86Server
+ return 0;
+#else
int client = 0;
+ XMesaWindow root;
+ XMesaDrawable drawable; /* X Pixmap Drawable */
XMesaBuffer b = alloc_xmesa_buffer();
if (!b) {
return NULL;
}
b->xm_visual = v;
- b->pbuffer_flag = GL_TRUE;
+ b->type = PBUFFER;
b->display = v->display;
b->cmap = cmap;
+ /* allocate pixmap for front buffer */
+ root = RootWindow( v->display, v->visinfo->screen );
+ drawable = XCreatePixmap( v->display, root, width, height, v->visinfo->depth );
+
/* determine back buffer implementation */
if (v->mesa_visual.doubleBufferMode) {
if (v->ximage_flag) {
@@ -1970,14 +1944,14 @@ XMesaBuffer XMesaCreatePBuffer( XMesaVisual v, XMesaColormap cmap,
v->mesa_visual.alphaBits > 0 );
if (!initialize_visual_and_buffer(client, v, b, v->mesa_visual.rgbMode,
- 0, cmap)) {
+ drawable, cmap)) {
free_xmesa_buffer(client, b);
return NULL;
}
return b;
-}
#endif
+}
@@ -2050,24 +2024,24 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
if (drawBuffer->FXctx) {
fxMesaMakeCurrent(drawBuffer->FXctx);
- c->xm_buffer = drawBuffer;
+ c->xm_draw_buffer = drawBuffer;
c->xm_read_buffer = readBuffer;
- c->use_read_buffer = (drawBuffer != readBuffer);
+ c->xm_buffer = drawBuffer;
return GL_TRUE;
}
#endif
if (c->gl_ctx == _mesa_get_current_context()
- && c->xm_buffer == drawBuffer
+ && c->xm_draw_buffer == drawBuffer
&& c->xm_read_buffer == readBuffer
- && c->xm_buffer->wasCurrent) {
+ && c->xm_draw_buffer->wasCurrent) {
/* same context and buffer, do nothing */
return GL_TRUE;
}
- c->xm_buffer = drawBuffer;
+ c->xm_draw_buffer = drawBuffer;
c->xm_read_buffer = readBuffer;
- c->use_read_buffer = (drawBuffer != readBuffer);
+ c->xm_buffer = drawBuffer;
_mesa_make_current2(c->gl_ctx,
&drawBuffer->mesa_buffer,
@@ -2091,11 +2065,11 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
c->clearcolor[2],
c->clearcolor[3],
c->xm_visual->undithered_pf);
- XMesaSetForeground(c->display, c->xm_buffer->cleargc, c->clearpixel);
+ XMesaSetForeground(c->display, c->xm_draw_buffer->cleargc, c->clearpixel);
}
/* Solution to Stephane Rehel's problem with glXReleaseBuffersMESA(): */
- c->xm_buffer->wasCurrent = GL_TRUE;
+ c->xm_draw_buffer->wasCurrent = GL_TRUE;
}
else {
/* Detach */
@@ -2133,7 +2107,7 @@ XMesaBuffer XMesaGetCurrentBuffer( void )
GET_CURRENT_CONTEXT(ctx);
if (ctx) {
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- return xmesa->xm_buffer;
+ return xmesa->xm_draw_buffer;
}
else {
return 0;
@@ -2147,7 +2121,7 @@ XMesaBuffer XMesaGetCurrentReadBuffer( void )
GET_CURRENT_CONTEXT(ctx);
if (ctx) {
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- return xmesa->xm_buffer;
+ return xmesa->xm_read_buffer;
}
else {
return 0;
@@ -2159,7 +2133,7 @@ GLboolean XMesaForceCurrent(XMesaContext c)
{
if (c) {
if (c->gl_ctx != _mesa_get_current_context()) {
- _mesa_make_current(c->gl_ctx, &c->xm_buffer->mesa_buffer);
+ _mesa_make_current(c->gl_ctx, &c->xm_draw_buffer->mesa_buffer);
}
}
else {
@@ -2183,7 +2157,7 @@ GLboolean XMesaLoseCurrent(XMesaContext c)
GLboolean XMesaSetFXmode( GLint mode )
{
#ifdef FX
- const char *fx = getenv("MESA_GLX_FX");
+ const char *fx = _mesa_getenv("MESA_GLX_FX");
if (fx && fx[0] != 'd') {
GET_CURRENT_CONTEXT(ctx);
GrHwConfiguration hw;
@@ -2198,15 +2172,15 @@ GLboolean XMesaSetFXmode( GLint mode )
if (ctx) {
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
if (mode == XMESA_FX_WINDOW) {
- if (xmesa->xm_buffer->FXisHackUsable) {
+ if (xmesa->xm_draw_buffer->FXisHackUsable) {
FX_grSstControl(GR_CONTROL_DEACTIVATE);
- xmesa->xm_buffer->FXwindowHack = GL_TRUE;
+ xmesa->xm_draw_buffer->FXwindowHack = GL_TRUE;
return GL_TRUE;
}
}
else if (mode == XMESA_FX_FULLSCREEN) {
FX_grSstControl(GR_CONTROL_ACTIVATE);
- xmesa->xm_buffer->FXwindowHack = GL_FALSE;
+ xmesa->xm_draw_buffer->FXwindowHack = GL_FALSE;
return GL_TRUE;
}
else {
@@ -2327,7 +2301,7 @@ void XMesaSwapBuffers( XMesaBuffer b )
* we have to flush any pending rendering commands first.
*/
if (ctx && ctx->DrawBuffer == &(b->mesa_buffer))
- _mesa_swapbuffers(ctx);
+ _mesa_notifySwapBuffers(ctx);
if (b->db_state) {
#ifdef FX
@@ -2393,7 +2367,7 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height )
* we have to flush any pending rendering commands first.
*/
if (ctx && ctx->DrawBuffer == &(b->mesa_buffer))
- _mesa_swapbuffers(ctx);
+ _mesa_notifySwapBuffers(ctx);
if (b->db_state) {
int yTop = b->height - y - height;
@@ -2512,7 +2486,7 @@ const char *XMesaGetString( XMesaContext c, int name )
{
(void) c;
if (name==XMESA_VERSION) {
- return "4.0.3";
+ return "5.0";
}
else if (name==XMESA_EXTENSIONS) {
return "";
@@ -2546,7 +2520,7 @@ void XMesaGarbageCollect( void )
XMesaBuffer b, next;
for (b=XMesaBufferList; b; b=next) {
next = b->Next;
- if (b->display && b->frontbuffer && !b->pixmap_flag) {
+ if (b->display && b->frontbuffer && b->type == WINDOW) {
#ifdef XFree86Server
/* NOT_NEEDED */
#else
diff --git a/xc/extras/Mesa/src/X/xm_dd.c b/xc/extras/Mesa/src/X/xm_dd.c
index f7a1e7107..dcdd482f5 100644
--- a/xc/extras/Mesa/src/X/xm_dd.c
+++ b/xc/extras/Mesa/src/X/xm_dd.c
@@ -1,3 +1,4 @@
+
/*
* Mesa 3-D graphics library
* Version: 4.0.3
@@ -21,15 +22,16 @@
* AN ACTION 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/extras/Mesa/src/X/xm_dd.c,v 1.4 2002/09/09 21:29:58 dawes Exp $ */
+/* $XFree86: xc/extras/Mesa/src/X/xm_dd.c,v 1.2 2002/02/26 23:37:31 tsi Exp $ */
#include "glxheader.h"
#include "context.h"
+#include "colormac.h"
#include "depth.h"
#include "drawpix.h"
#include "extensions.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mtypes.h"
#include "state.h"
#include "texstore.h"
@@ -114,74 +116,51 @@ flush( GLcontext *ctx )
}
-static void
-set_draw_buffer( GLcontext *ctx, GLenum mode )
-{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- if (mode == GL_FRONT_LEFT) {
- /* write to front buffer */
- xmesa->xm_buffer->buffer = xmesa->xm_buffer->frontbuffer;
- xmesa_update_span_funcs(ctx);
- }
- else if (mode==GL_BACK_LEFT && xmesa->xm_buffer->db_state) {
- /* write to back buffer */
- if (xmesa->xm_buffer->backpixmap) {
- xmesa->xm_buffer->buffer =
- (XMesaDrawable)xmesa->xm_buffer->backpixmap;
- }
- else if (xmesa->xm_buffer->backimage) {
- xmesa->xm_buffer->buffer = None;
- }
- else {
- /* just in case there wasn't enough memory for back buffer */
- xmesa->xm_buffer->buffer = xmesa->xm_buffer->frontbuffer;
- }
- xmesa_update_span_funcs(ctx);
- }
- else {
- /* the swrast->_RasterMask MULTI_DRAW_BIT will be set and
- * we'll fall back to swrast to draw points/lines/triangles.
- */
- }
-}
-
-void
-xmesa_set_read_buffer( GLcontext *ctx, GLframebuffer *buffer, GLenum mode )
+/*
+ * This chooses the color buffer for reading and writing spans, points,
+ * lines, and triangles.
+ */
+static void
+set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit )
{
- XMesaBuffer target;
+ /* We can make this cast since the XMesaBuffer wraps GLframebuffer.
+ * GLframebuffer is the first member in a XMesaBuffer struct.
+ */
+ XMesaBuffer target = (XMesaBuffer) buffer;
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- if (buffer == ctx->DrawBuffer) {
- target = xmesa->xm_buffer;
- xmesa->use_read_buffer = GL_FALSE;
- }
- else {
- ASSERT(buffer == ctx->ReadBuffer);
- target = xmesa->xm_read_buffer;
- xmesa->use_read_buffer = GL_TRUE;
- }
+ /* This assignment tells the span/point/line/triangle functions
+ * which XMesaBuffer to use.
+ */
+ xmesa->xm_buffer = target;
- if (mode == GL_FRONT_LEFT) {
+ /*
+ * Now determine front vs back color buffer.
+ */
+ if (bufferBit == FRONT_LEFT_BIT) {
target->buffer = target->frontbuffer;
- xmesa_update_span_funcs(ctx);
}
- else if (mode==GL_BACK_LEFT && xmesa->xm_read_buffer->db_state) {
+ else if (bufferBit == BACK_LEFT_BIT) {
+ ASSERT(target->db_state);
if (target->backpixmap) {
- target->buffer = (XMesaDrawable)xmesa->xm_buffer->backpixmap;
+ /* back buffer is a pixmape */
+ target->buffer = target->backpixmap; /* incompatible types? */
}
else if (target->backimage) {
+ /* back buffer is an XImage */
target->buffer = None;
}
else {
- /* just in case there wasn't enough memory for back buffer */
+ /* No back buffer!!!! Must be out of memory, use front buffer */
target->buffer = target->frontbuffer;
}
- xmesa_update_span_funcs(ctx);
}
else {
- _mesa_problem(ctx, "invalid buffer in set_read_buffer() in xmesa2.c");
+ _mesa_problem(ctx, "invalid buffer 0x%x in set_buffer() in xm_dd.c");
+ return;
}
+ xmesa_update_span_funcs(ctx);
}
@@ -191,24 +170,27 @@ clear_index( GLcontext *ctx, GLuint index )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
xmesa->clearpixel = (unsigned long) index;
- XMesaSetForeground( xmesa->display, xmesa->xm_buffer->cleargc,
+ XMesaSetForeground( xmesa->display, xmesa->xm_draw_buffer->cleargc,
(unsigned long) index );
}
static void
-clear_color( GLcontext *ctx, const GLchan color[4] )
+clear_color( GLcontext *ctx, const GLfloat color[4] )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- xmesa->clearcolor[0] = color[0];
- xmesa->clearcolor[1] = color[1];
- xmesa->clearcolor[2] = color[2];
- xmesa->clearcolor[3] = color[3];
- xmesa->clearpixel = xmesa_color_to_pixel( xmesa, color[0], color[1],
- color[2], color[3],
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[2], color[2]);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[3], color[3]);
+ xmesa->clearpixel = xmesa_color_to_pixel( xmesa,
+ xmesa->clearcolor[0],
+ xmesa->clearcolor[1],
+ xmesa->clearcolor[2],
+ xmesa->clearcolor[3],
xmesa->xm_visual->undithered_pf );
_glthread_LOCK_MUTEX(_xmesa_lock);
- XMesaSetForeground( xmesa->display, xmesa->xm_buffer->cleargc,
+ XMesaSetForeground( xmesa->display, xmesa->xm_draw_buffer->cleargc,
xmesa->clearpixel );
_glthread_UNLOCK_MUTEX(_xmesa_lock);
}
@@ -220,7 +202,7 @@ static void
index_mask( GLcontext *ctx, GLuint mask )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- if (xmesa->xm_buffer->buffer != XIMAGE) {
+ if (xmesa->xm_draw_buffer->buffer != XIMAGE) {
unsigned long m;
if (mask==0xffffffff) {
m = ((unsigned long)~0L);
@@ -228,7 +210,8 @@ index_mask( GLcontext *ctx, GLuint mask )
else {
m = (unsigned long) mask;
}
- XMesaSetPlaneMask( xmesa->display, xmesa->xm_buffer->cleargc, m );
+ XMesaSetPlaneMask( xmesa->display, xmesa->xm_draw_buffer->cleargc, m );
+ XMesaSetPlaneMask( xmesa->display, xmesa->xm_draw_buffer->gc, m );
}
}
@@ -253,7 +236,7 @@ color_mask(GLcontext *ctx,
if (gmask) m |= GET_GREENMASK(xmesa->xm_visual);
if (bmask) m |= GET_BLUEMASK(xmesa->xm_visual);
}
- XMesaSetPlaneMask( xmesa->display, xmesa->xm_buffer->cleargc, m );
+ XMesaSetPlaneMask( xmesa->display, xmesa->xm_draw_buffer->cleargc, m );
}
}
@@ -270,16 +253,16 @@ clear_front_pixmap( GLcontext *ctx, GLboolean all,
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
if (all) {
- XMesaFillRectangle( xmesa->display, xmesa->xm_buffer->frontbuffer,
- xmesa->xm_buffer->cleargc,
+ XMesaFillRectangle( xmesa->display, xmesa->xm_draw_buffer->frontbuffer,
+ xmesa->xm_draw_buffer->cleargc,
0, 0,
- xmesa->xm_buffer->width+1,
- xmesa->xm_buffer->height+1 );
+ xmesa->xm_draw_buffer->width+1,
+ xmesa->xm_draw_buffer->height+1 );
}
else {
- XMesaFillRectangle( xmesa->display, xmesa->xm_buffer->frontbuffer,
- xmesa->xm_buffer->cleargc,
- x, xmesa->xm_buffer->height - y - height,
+ XMesaFillRectangle( xmesa->display, xmesa->xm_draw_buffer->frontbuffer,
+ xmesa->xm_draw_buffer->cleargc,
+ x, xmesa->xm_draw_buffer->height - y - height,
width, height );
}
}
@@ -291,16 +274,16 @@ clear_back_pixmap( GLcontext *ctx, GLboolean all,
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
if (all) {
- XMesaFillRectangle( xmesa->display, xmesa->xm_buffer->backpixmap,
- xmesa->xm_buffer->cleargc,
+ XMesaFillRectangle( xmesa->display, xmesa->xm_draw_buffer->backpixmap,
+ xmesa->xm_draw_buffer->cleargc,
0, 0,
- xmesa->xm_buffer->width+1,
- xmesa->xm_buffer->height+1 );
+ xmesa->xm_draw_buffer->width+1,
+ xmesa->xm_draw_buffer->height+1 );
}
else {
- XMesaFillRectangle( xmesa->display, xmesa->xm_buffer->backpixmap,
- xmesa->xm_buffer->cleargc,
- x, xmesa->xm_buffer->height - y - height,
+ XMesaFillRectangle( xmesa->display, xmesa->xm_draw_buffer->backpixmap,
+ xmesa->xm_draw_buffer->cleargc,
+ x, xmesa->xm_draw_buffer->height - y - height,
width, height );
}
}
@@ -312,14 +295,14 @@ clear_8bit_ximage( GLcontext *ctx, GLboolean all,
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
if (all) {
- size_t n = xmesa->xm_buffer->backimage->bytes_per_line
- * xmesa->xm_buffer->backimage->height;
- MEMSET( xmesa->xm_buffer->backimage->data, xmesa->clearpixel, n );
+ size_t n = xmesa->xm_draw_buffer->backimage->bytes_per_line
+ * xmesa->xm_draw_buffer->backimage->height;
+ MEMSET( xmesa->xm_draw_buffer->backimage->data, xmesa->clearpixel, n );
}
else {
GLint i;
for (i=0;i<height;i++) {
- GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, y+i );
+ GLubyte *ptr = PIXELADDR1( xmesa->xm_draw_buffer, x, y+i );
MEMSET( ptr, xmesa->clearpixel, width );
}
}
@@ -332,9 +315,9 @@ clear_HPCR_ximage( GLcontext *ctx, GLboolean all,
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
if (all) {
- GLint i, c16 = (xmesa->xm_buffer->backimage->bytes_per_line>>4)<<4;
- GLubyte *ptr = (GLubyte *)xmesa->xm_buffer->backimage->data;
- for (i=0; i<xmesa->xm_buffer->backimage->height; i++) {
+ GLint i, c16 = (xmesa->xm_draw_buffer->backimage->bytes_per_line>>4)<<4;
+ GLubyte *ptr = (GLubyte *)xmesa->xm_draw_buffer->backimage->data;
+ for (i=0; i<xmesa->xm_draw_buffer->backimage->height; i++) {
GLint j;
GLubyte *sptr = xmesa->xm_visual->hpcr_clear_ximage_pattern[0];
if (i&1) {
@@ -359,7 +342,7 @@ clear_HPCR_ximage( GLcontext *ctx, GLboolean all,
ptr[15] = sptr[15];
ptr += 16;
}
- for (; j<xmesa->xm_buffer->backimage->bytes_per_line; j++) {
+ for (; j<xmesa->xm_draw_buffer->backimage->bytes_per_line; j++) {
*ptr = sptr[j&15];
ptr++;
}
@@ -368,7 +351,7 @@ clear_HPCR_ximage( GLcontext *ctx, GLboolean all,
else {
GLint i;
for (i=y; i<y+height; i++) {
- GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, i );
+ GLubyte *ptr = PIXELADDR1( xmesa->xm_draw_buffer, x, i );
int j;
GLubyte *sptr = xmesa->xm_visual->hpcr_clear_ximage_pattern[0];
if (i&1) {
@@ -394,31 +377,31 @@ clear_16bit_ximage( GLcontext *ctx, GLboolean all,
}
if (all) {
register GLuint n;
- register GLuint *ptr4 = (GLuint *) xmesa->xm_buffer->backimage->data;
+ register GLuint *ptr4 = (GLuint *) xmesa->xm_draw_buffer->backimage->data;
if ((pixel & 0xff) == ((pixel >> 8) & 0xff)) {
/* low and high bytes are equal so use memset() */
- n = xmesa->xm_buffer->backimage->bytes_per_line
- * xmesa->xm_buffer->height;
+ n = xmesa->xm_draw_buffer->backimage->bytes_per_line
+ * xmesa->xm_draw_buffer->height;
MEMSET( ptr4, pixel & 0xff, n );
}
else {
pixel = pixel | (pixel<<16);
- n = xmesa->xm_buffer->backimage->bytes_per_line
- * xmesa->xm_buffer->height / 4;
+ n = xmesa->xm_draw_buffer->backimage->bytes_per_line
+ * xmesa->xm_draw_buffer->height / 4;
do {
*ptr4++ = pixel;
n--;
} while (n!=0);
- if ((xmesa->xm_buffer->backimage->bytes_per_line *
- xmesa->xm_buffer->height) & 0x2)
+ if ((xmesa->xm_draw_buffer->backimage->bytes_per_line *
+ xmesa->xm_draw_buffer->height) & 0x2)
*(GLushort *)ptr4 = pixel & 0xffff;
}
}
else {
register int i, j;
for (j=0;j<height;j++) {
- register GLushort *ptr2 = PIXELADDR2( xmesa->xm_buffer, x, y+j );
+ register GLushort *ptr2 = PIXELADDR2( xmesa->xm_draw_buffer, x, y+j );
for (i=0;i<width;i++) {
*ptr2++ = pixel;
}
@@ -447,21 +430,21 @@ clear_24bit_ximage( GLcontext *ctx, GLboolean all,
if (all) {
if (r==g && g==b) {
/* same value for all three components (gray) */
- const GLint w3 = xmesa->xm_buffer->width * 3;
- const GLint h = xmesa->xm_buffer->height;
+ const GLint w3 = xmesa->xm_draw_buffer->width * 3;
+ const GLint h = xmesa->xm_draw_buffer->height;
GLint i;
for (i = 0; i < h; i++) {
- bgr_t *ptr3 = PIXELADDR3(xmesa->xm_buffer, 0, i);
+ bgr_t *ptr3 = PIXELADDR3(xmesa->xm_draw_buffer, 0, i);
MEMSET(ptr3, r, w3);
}
}
else {
/* the usual case */
- const GLint w = xmesa->xm_buffer->width;
- const GLint h = xmesa->xm_buffer->height;
+ const GLint w = xmesa->xm_draw_buffer->width;
+ const GLint h = xmesa->xm_draw_buffer->height;
GLint i, j;
for (i = 0; i < h; i++) {
- bgr_t *ptr3 = PIXELADDR3(xmesa->xm_buffer, 0, i);
+ bgr_t *ptr3 = PIXELADDR3(xmesa->xm_draw_buffer, 0, i);
for (j = 0; j < w; j++) {
ptr3->r = r;
ptr3->g = g;
@@ -545,7 +528,7 @@ clear_24bit_ximage( GLcontext *ctx, GLboolean all,
/* same value for all three components (gray) */
GLint j;
for (j=0;j<height;j++) {
- bgr_t *ptr3 = PIXELADDR3( xmesa->xm_buffer, x, y+j );
+ bgr_t *ptr3 = PIXELADDR3( xmesa->xm_draw_buffer, x, y+j );
MEMSET(ptr3, r, 3 * width);
}
}
@@ -553,7 +536,7 @@ clear_24bit_ximage( GLcontext *ctx, GLboolean all,
/* non-gray clear color */
GLint i, j;
for (j = 0; j < height; j++) {
- bgr_t *ptr3 = PIXELADDR3( xmesa->xm_buffer, x, y+j );
+ bgr_t *ptr3 = PIXELADDR3( xmesa->xm_draw_buffer, x, y+j );
for (i = 0; i < width; i++) {
ptr3->r = r;
ptr3->g = g;
@@ -568,7 +551,7 @@ clear_24bit_ximage( GLcontext *ctx, GLboolean all,
pixel4[1] = (clearPixel << 16) | (clearPixel >> 8);
pixel4[2] = (clearPixel << 8) | (clearPixel >> 16);
for (j=0;j<height;j++) {
- bgr_t *ptr3 = PIXELADDR3( xmesa->xm_buffer, x, y+j );
+ bgr_t *ptr3 = PIXELADDR3( xmesa->xm_draw_buffer, x, y+j );
register GLuint *ptr4 = (GLuint *)ptr3;
register GLuint *p, px;
GLuint w = width;
@@ -651,8 +634,8 @@ clear_32bit_ximage( GLcontext *ctx, GLboolean all,
| ((pixel << 24) & 0xff000000);
}
if (all) {
- register GLint n = xmesa->xm_buffer->width * xmesa->xm_buffer->height;
- register GLuint *ptr4 = (GLuint *) xmesa->xm_buffer->backimage->data;
+ register GLint n = xmesa->xm_draw_buffer->width * xmesa->xm_draw_buffer->height;
+ register GLuint *ptr4 = (GLuint *) xmesa->xm_draw_buffer->backimage->data;
if (pixel==0) {
MEMSET( ptr4, pixel, 4*n );
}
@@ -666,7 +649,7 @@ clear_32bit_ximage( GLcontext *ctx, GLboolean all,
else {
register int i, j;
for (j=0;j<height;j++) {
- register GLuint *ptr4 = PIXELADDR4( xmesa->xm_buffer, x, y+j );
+ register GLuint *ptr4 = PIXELADDR4( xmesa->xm_draw_buffer, x, y+j );
for (i=0;i<width;i++) {
*ptr4++ = pixel;
}
@@ -680,11 +663,11 @@ clear_nbit_ximage( GLcontext *ctx, GLboolean all,
GLint x, GLint y, GLint width, GLint height )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- XMesaImage *img = xmesa->xm_buffer->backimage;
+ XMesaImage *img = xmesa->xm_draw_buffer->backimage;
if (all) {
register int i, j;
- width = xmesa->xm_buffer->width;
- height = xmesa->xm_buffer->height;
+ width = xmesa->xm_draw_buffer->width;
+ height = xmesa->xm_draw_buffer->height;
for (j=0;j<height;j++) {
for (i=0;i<width;i++) {
XMesaPutPixel( img, i, j, xmesa->clearpixel );
@@ -694,7 +677,7 @@ clear_nbit_ximage( GLcontext *ctx, GLboolean all,
else {
/* TODO: optimize this */
register int i, j;
- y = FLIP(xmesa->xm_buffer, y);
+ y = FLIP(xmesa->xm_draw_buffer, y);
for (j=0;j<height;j++) {
for (i=0;i<width;i++) {
XMesaPutPixel( img, x+i, y-j, xmesa->clearpixel );
@@ -713,7 +696,7 @@ clear_buffers( GLcontext *ctx, GLbitfield mask,
const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask;
if ((mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) &&
- xmesa->xm_buffer->mesa_buffer.UseSoftwareAlphaBuffers &&
+ xmesa->xm_draw_buffer->mesa_buffer.UseSoftwareAlphaBuffers &&
ctx->Color.ColorMask[ACOMP]) {
_mesa_clear_alpha_buffers(ctx);
}
@@ -721,13 +704,13 @@ clear_buffers( GLcontext *ctx, GLbitfield mask,
/* we can't handle color or index masking */
if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) {
if (mask & DD_FRONT_LEFT_BIT) {
- ASSERT(xmesa->xm_buffer->front_clear_func);
- (*xmesa->xm_buffer->front_clear_func)( ctx, all, x, y, width, height );
+ ASSERT(xmesa->xm_draw_buffer->front_clear_func);
+ (*xmesa->xm_draw_buffer->front_clear_func)( ctx, all, x, y, width, height );
mask &= ~DD_FRONT_LEFT_BIT;
}
if (mask & DD_BACK_LEFT_BIT) {
- ASSERT(xmesa->xm_buffer->back_clear_func);
- (*xmesa->xm_buffer->back_clear_func)( ctx, all, x, y, width, height );
+ ASSERT(xmesa->xm_draw_buffer->back_clear_func);
+ (*xmesa->xm_draw_buffer->back_clear_func)( ctx, all, x, y, width, height );
mask &= ~DD_BACK_LEFT_BIT;
}
}
@@ -800,8 +783,8 @@ drawpixels_8R8G8B( GLcontext *ctx,
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
XMesaDisplay *dpy = xmesa->xm_visual->display;
- XMesaDrawable buffer = xmesa->xm_buffer->buffer;
- XMesaGC gc = xmesa->xm_buffer->gc;
+ XMesaDrawable buffer = xmesa->xm_draw_buffer->buffer;
+ XMesaGC gc = xmesa->xm_draw_buffer->gc;
assert(dpy);
assert(buffer);
assert(gc);
@@ -831,7 +814,7 @@ drawpixels_8R8G8B( GLcontext *ctx,
ximage.red_mask = 0xff0000;
ximage.green_mask = 0x00ff00;
ximage.blue_mask = 0x0000ff;
- dstY = FLIP(xmesa->xm_buffer,dstY) - height + 1;
+ dstY = FLIP(xmesa->xm_draw_buffer,dstY) - height + 1;
XPutImage(dpy, buffer, gc, &ximage, srcX, srcY, dstX, dstY, w, h);
return GL_TRUE;
}
@@ -897,33 +880,33 @@ void xmesa_update_state( GLcontext *ctx, GLuint new_state )
/* setup pointers to front and back buffer clear functions */
- xmesa->xm_buffer->front_clear_func = clear_front_pixmap;
- if (xmesa->xm_buffer->backpixmap != XIMAGE) {
- xmesa->xm_buffer->back_clear_func = clear_back_pixmap;
+ xmesa->xm_draw_buffer->front_clear_func = clear_front_pixmap;
+ if (xmesa->xm_draw_buffer->backpixmap != XIMAGE) {
+ xmesa->xm_draw_buffer->back_clear_func = clear_back_pixmap;
}
else if (sizeof(GLushort)!=2 || sizeof(GLuint)!=4) {
- xmesa->xm_buffer->back_clear_func = clear_nbit_ximage;
+ xmesa->xm_draw_buffer->back_clear_func = clear_nbit_ximage;
}
else switch (xmesa->xm_visual->BitsPerPixel) {
case 8:
if (xmesa->xm_visual->hpcr_clear_flag) {
- xmesa->xm_buffer->back_clear_func = clear_HPCR_ximage;
+ xmesa->xm_draw_buffer->back_clear_func = clear_HPCR_ximage;
}
else {
- xmesa->xm_buffer->back_clear_func = clear_8bit_ximage;
+ xmesa->xm_draw_buffer->back_clear_func = clear_8bit_ximage;
}
break;
case 16:
- xmesa->xm_buffer->back_clear_func = clear_16bit_ximage;
+ xmesa->xm_draw_buffer->back_clear_func = clear_16bit_ximage;
break;
case 24:
- xmesa->xm_buffer->back_clear_func = clear_24bit_ximage;
+ xmesa->xm_draw_buffer->back_clear_func = clear_24bit_ximage;
break;
case 32:
- xmesa->xm_buffer->back_clear_func = clear_32bit_ximage;
+ xmesa->xm_draw_buffer->back_clear_func = clear_32bit_ximage;
break;
default:
- xmesa->xm_buffer->back_clear_func = clear_nbit_ximage;
+ xmesa->xm_draw_buffer->back_clear_func = clear_nbit_ximage;
break;
}
@@ -938,6 +921,7 @@ void xmesa_update_state( GLcontext *ctx, GLuint new_state )
void xmesa_init_pointers( GLcontext *ctx )
{
TNLcontext *tnl;
+ struct swrast_device_driver *dd = _swrast_GetDeviceDriverReference( ctx );
ctx->Driver.GetString = get_string;
ctx->Driver.GetBufferSize = get_buffer_size;
@@ -953,6 +937,7 @@ void xmesa_init_pointers( GLcontext *ctx )
ctx->Driver.CopyPixels = _swrast_CopyPixels;
ctx->Driver.DrawPixels = _swrast_DrawPixels;
ctx->Driver.ReadPixels = _swrast_ReadPixels;
+ ctx->Driver.DrawBuffer = _swrast_DrawBuffer;
/* Software texture functions:
*/
@@ -971,9 +956,12 @@ void xmesa_init_pointers( GLcontext *ctx )
ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d;
ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d;
- ctx->Driver.BaseCompressedTexFormat = _mesa_base_compressed_texformat;
- ctx->Driver.CompressedTextureSize = _mesa_compressed_texture_size;
- ctx->Driver.GetCompressedTexImage = _mesa_get_compressed_teximage;
+ ctx->Driver.CompressedTexImage1D = _mesa_store_compressed_teximage1d;
+ ctx->Driver.CompressedTexImage2D = _mesa_store_compressed_teximage2d;
+ ctx->Driver.CompressedTexImage3D = _mesa_store_compressed_teximage3d;
+ ctx->Driver.CompressedTexSubImage1D = _mesa_store_compressed_texsubimage1d;
+ ctx->Driver.CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d;
+ ctx->Driver.CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d;
/* Swrast hooks for imaging extensions:
*/
@@ -985,7 +973,6 @@ void xmesa_init_pointers( GLcontext *ctx )
/* Statechange callbacks:
*/
- ctx->Driver.SetDrawBuffer = set_draw_buffer;
ctx->Driver.ClearIndex = clear_index;
ctx->Driver.ClearColor = clear_color;
ctx->Driver.IndexMask = index_mask;
@@ -998,6 +985,8 @@ void xmesa_init_pointers( GLcontext *ctx )
tnl = TNL_CONTEXT(ctx);
tnl->Driver.RunPipeline = _tnl_run_pipeline;
+ dd->SetBuffer = set_buffer;
+
/* Install swsetup for tnl->Driver.Render.*:
*/
_swsetup_Wakeup(ctx);
diff --git a/xc/extras/Mesa/src/X/xm_line.c b/xc/extras/Mesa/src/X/xm_line.c
index 007c3ffa1..1c330c82e 100644
--- a/xc/extras/Mesa/src/X/xm_line.c
+++ b/xc/extras/Mesa/src/X/xm_line.c
@@ -1,10 +1,9 @@
-/* $Id: xm_line.c,v 1.1.1.1 2002/10/22 13:06:06 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -101,7 +100,7 @@ void xmesa_choose_point( GLcontext *ctx )
if (ctx->RenderMode == GL_RENDER
&& ctx->Point.Size == 1.0F && !ctx->Point.SmoothFlag
&& swrast->_RasterMask == 0
- && !ctx->Texture._ReallyEnabled
+ && !ctx->Texture._EnabledUnits
&& xmesa->xm_buffer->buffer != XIMAGE) {
swrast->Point = draw_points_ANY_pixmap;
}
@@ -557,7 +556,7 @@ static swrast_line_func get_line_func( GLcontext *ctx )
if (ctx->RenderMode != GL_RENDER) return (swrast_line_func) NULL;
if (ctx->Line.SmoothFlag) return (swrast_line_func) NULL;
- if (ctx->Texture._ReallyEnabled) return (swrast_line_func) NULL;
+ if (ctx->Texture._EnabledUnits) return (swrast_line_func) NULL;
if (ctx->Light.ShadeModel != GL_FLAT) return (swrast_line_func) NULL;
if (ctx->Line.StippleFlag) return (swrast_line_func) NULL;
if (swrast->_RasterMask & MULTI_DRAW_BIT) return (swrast_line_func) NULL;
diff --git a/xc/extras/Mesa/src/X/xm_span.c b/xc/extras/Mesa/src/X/xm_span.c
index 2fe2af697..eda81ee0e 100644
--- a/xc/extras/Mesa/src/X/xm_span.c
+++ b/xc/extras/Mesa/src/X/xm_span.c
@@ -1,3 +1,4 @@
+
/*
* Mesa 3-D graphics library
* Version: 3.5
@@ -21,18 +22,19 @@
* AN ACTION 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/extras/Mesa/src/X/xm_span.c,v 1.4 2002/09/09 21:07:28 dawes Exp $ */
+/* $XFree86: xc/extras/Mesa/src/X/xm_span.c,v 1.3 2002/02/27 21:07:54 tsi Exp $ */
#include "glxheader.h"
+#include "colormac.h"
#include "context.h"
-#include "drawpix.h"
-#include "mem.h"
-#include "state.h"
#include "depth.h"
+#include "drawpix.h"
+#include "extensions.h"
#include "macros.h"
+#include "imports.h"
#include "mtypes.h"
+#include "state.h"
#include "xmesaP.h"
-#include "extensions.h"
#include "swrast/swrast.h"
@@ -3470,14 +3472,9 @@ static void read_index_span( const GLcontext *ctx,
GLuint n, GLint x, GLint y, GLuint index[] )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- XMesaBuffer source;
+ XMesaBuffer source = xmesa->xm_buffer;
GLuint i;
- if (xmesa->use_read_buffer)
- source = xmesa->xm_read_buffer;
- else
- source = xmesa->xm_buffer;
-
y = FLIP(source, y);
if (source->buffer) {
@@ -3526,12 +3523,7 @@ static void read_color_span( const GLcontext *ctx,
GLubyte rgba[][4] )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- XMesaBuffer source;
-
- if (xmesa->use_read_buffer)
- source = xmesa->xm_read_buffer;
- else
- source = xmesa->xm_buffer;
+ XMesaBuffer source = xmesa->xm_buffer;
if (source->buffer) {
/* Read from Pixmap or Window */
@@ -3900,12 +3892,7 @@ static void read_index_pixels( const GLcontext *ctx,
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- XMesaBuffer source;
-
- if (xmesa->use_read_buffer)
- source = xmesa->xm_read_buffer;
- else
- source = xmesa->xm_buffer;
+ XMesaBuffer source = xmesa->xm_buffer;
if (source->buffer) {
for (i=0;i<n;i++) {
@@ -3935,15 +3922,8 @@ static void read_color_pixels( const GLcontext *ctx,
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
XMesaDisplay *dpy = xmesa->xm_visual->display;
register GLuint i;
- XMesaBuffer source;
- XMesaDrawable buffer;
-
- if (xmesa->use_read_buffer)
- source = xmesa->xm_read_buffer;
- else
- source = xmesa->xm_buffer;
-
- buffer = source->buffer; /* the X drawable */
+ XMesaBuffer source = xmesa->xm_buffer;
+ XMesaDrawable buffer = source->buffer; /* the X drawable */
if (source->buffer) {
switch (xmesa->pixelformat) {
@@ -4183,14 +4163,17 @@ static void read_color_pixels( const GLcontext *ctx,
static void
-clear_color_HPCR_ximage( GLcontext *ctx, const GLchan color[4] )
+clear_color_HPCR_ximage( GLcontext *ctx, const GLfloat color[4] )
{
int i;
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- COPY_4V(xmesa->clearcolor, color);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[2], color[2]);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[3], color[3]);
- if (color[0] == 0 && color[1] == 0 && color[2] == 0) {
+ if (color[0] == 0.0 && color[1] == 0.0 && color[2] == 0.0) {
/* black is black */
MEMSET( xmesa->xm_visual->hpcr_clear_ximage_pattern, 0x0 ,
sizeof(xmesa->xm_visual->hpcr_clear_ximage_pattern));
@@ -4198,24 +4181,33 @@ clear_color_HPCR_ximage( GLcontext *ctx, const GLchan color[4] )
else {
/* build clear pattern */
for (i=0; i<16; i++) {
- xmesa->xm_visual->hpcr_clear_ximage_pattern[0][i] =
- DITHER_HPCR(i, 0, color[0], color[1], color[2]);
+ xmesa->xm_visual->hpcr_clear_ximage_pattern[0][i] =
+ DITHER_HPCR(i, 0,
+ xmesa->clearcolor[0],
+ xmesa->clearcolor[1],
+ xmesa->clearcolor[2]);
xmesa->xm_visual->hpcr_clear_ximage_pattern[1][i] =
- DITHER_HPCR(i, 1, color[0], color[1], color[2]);
+ DITHER_HPCR(i, 1,
+ xmesa->clearcolor[0],
+ xmesa->clearcolor[1],
+ xmesa->clearcolor[2]);
}
}
}
static void
-clear_color_HPCR_pixmap( GLcontext *ctx, const GLchan color[4] )
+clear_color_HPCR_pixmap( GLcontext *ctx, const GLfloat color[4] )
{
int i;
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- COPY_4V(xmesa->clearcolor, color);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[2], color[2]);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[3], color[3]);
- if (color[0] == 0 && color[1] == 0 && color[2] == 0) {
+ if (color[0] == 0.0 && color[1] == 0.0 && color[2] == 0.0) {
/* black is black */
for (i=0; i<16; i++) {
XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 0, 0);
@@ -4225,9 +4217,15 @@ clear_color_HPCR_pixmap( GLcontext *ctx, const GLchan color[4] )
else {
for (i=0; i<16; i++) {
XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 0,
- DITHER_HPCR(i, 0, color[0], color[1], color[2]));
+ DITHER_HPCR(i, 0,
+ xmesa->clearcolor[0],
+ xmesa->clearcolor[1],
+ xmesa->clearcolor[2]));
XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 1,
- DITHER_HPCR(i, 1, color[0], color[1], color[2]));
+ DITHER_HPCR(i, 1,
+ xmesa->clearcolor[0],
+ xmesa->clearcolor[1],
+ xmesa->clearcolor[2]));
}
}
/* change tile pixmap content */
@@ -4489,6 +4487,4 @@ void xmesa_update_span_funcs( GLcontext *ctx )
dd->ReadRGBASpan = read_color_span;
dd->ReadCI32Pixels = read_index_pixels;
dd->ReadRGBAPixels = read_color_pixels;
-
- dd->SetReadBuffer = xmesa_set_read_buffer;
}
diff --git a/xc/extras/Mesa/src/X/xm_tri.c b/xc/extras/Mesa/src/X/xm_tri.c
index 3026b77e2..5e138f03d 100644
--- a/xc/extras/Mesa/src/X/xm_tri.c
+++ b/xc/extras/Mesa/src/X/xm_tri.c
@@ -1,8 +1,7 @@
-/* $Id: xm_tri.c,v 1.1.1.1 2002/10/22 13:06:05 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -35,6 +34,7 @@
#include "glxheader.h"
#include "depth.h"
#include "macros.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
#include "xmesaP.h"
@@ -44,7 +44,6 @@
#include "swrast/s_context.h"
#include "swrast/s_depth.h"
#include "swrast/s_triangle.h"
-#include "swrast/s_trispan.h"
@@ -70,7 +69,7 @@ static void smooth_TRUECOLOR_z_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
GLuint i; \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
unsigned long p; \
@@ -108,7 +107,7 @@ static void smooth_8A8B8G8R_z_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
pRow[i] = PACK_8B8G8R(FixedToInt(span.red), \
@@ -143,7 +142,7 @@ static void smooth_8R8G8B_z_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
pRow[i] = PACK_8R8G8B(FixedToInt(span.red), \
@@ -178,7 +177,7 @@ static void smooth_8R8G8B24_z_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
PIXEL_TYPE *ptr = pRow + i; \
@@ -214,7 +213,7 @@ static void smooth_TRUEDITHER_z_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
unsigned long p; \
@@ -251,7 +250,7 @@ static void smooth_5R6G5B_z_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
pRow[i] = PACK_5R6G5B(FixedToInt(span.red), \
@@ -287,7 +286,7 @@ static void smooth_DITHER_5R6G5B_z_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
PACK_TRUEDITHER(pRow[i], x, y, FixedToInt(span.red), \
@@ -324,7 +323,7 @@ static void smooth_DITHER8_z_triangle( GLcontext *ctx,
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
XDITHER_SETUP(y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
pRow[i] = (PIXEL_TYPE) XDITHER(x, FixedToInt(span.red),\
@@ -359,7 +358,7 @@ static void smooth_DITHER_z_triangle( GLcontext *ctx,
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
XDITHER_SETUP(y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
unsigned long p = XDITHER(x, FixedToInt(span.red), \
@@ -396,7 +395,7 @@ static void smooth_LOOKUP8_z_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
LOOKUP_SETUP; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
pRow[i] = LOOKUP(FixedToInt(span.red), \
@@ -433,7 +432,7 @@ static void smooth_HPCR_z_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
pRow[i] = DITHER_HPCR(x, y, FixedToInt(span.red), \
@@ -469,7 +468,7 @@ static void flat_TRUECOLOR_z_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
XMesaPutPixel(img, x, y, pixel); \
@@ -501,7 +500,7 @@ static void flat_8A8B8G8R_z_triangle( GLcontext *ctx,
v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
GLuint i; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
pRow[i] = (PIXEL_TYPE) p; \
@@ -533,7 +532,7 @@ static void flat_8R8G8B_z_triangle( GLcontext *ctx,
v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
GLuint i; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
pRow[i] = (PIXEL_TYPE) p; \
@@ -563,7 +562,7 @@ static void flat_8R8G8B24_z_triangle( GLcontext *ctx,
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define RENDER_SPAN( span ) \
GLuint i; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
PIXEL_TYPE *ptr = pRow + i; \
@@ -594,7 +593,7 @@ static void flat_TRUEDITHER_z_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
unsigned long p; \
@@ -629,7 +628,7 @@ static void flat_5R6G5B_z_triangle( GLcontext *ctx,
v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
GLuint i; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
pRow[i] = (PIXEL_TYPE) p; \
@@ -660,7 +659,7 @@ static void flat_DITHER_5R6G5B_z_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
PACK_TRUEDITHER(pRow[i], x, y, color[RCOMP], \
@@ -695,7 +694,7 @@ static void flat_DITHER8_z_triangle( GLcontext *ctx,
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
FLAT_DITHER_ROW_SETUP(FLIP(xmesa->xm_buffer, y)); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
pRow[i] = (PIXEL_TYPE) FLAT_DITHER(x); \
@@ -727,7 +726,7 @@ static void flat_DITHER_z_triangle( GLcontext *ctx,
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
FLAT_DITHER_ROW_SETUP(y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
unsigned long p = FLAT_DITHER(x); \
@@ -762,7 +761,7 @@ static void flat_HPCR_z_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
pRow[i] = (PIXEL_TYPE) DITHER_HPCR(x, y, r, g, b); \
@@ -797,7 +796,7 @@ static void flat_LOOKUP8_z_triangle( GLcontext *ctx,
GLubyte p = LOOKUP(r,g,b);
#define RENDER_SPAN( span ) \
GLuint i; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
pRow[i] = p; \
@@ -825,12 +824,12 @@ static void smooth_TRUECOLOR_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
unsigned long p; \
PACK_TRUECOLOR(p, FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue)); \
XMesaPutPixel(img, x, y, p); \
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
@@ -854,10 +853,10 @@ static void smooth_8A8B8G8R_triangle( GLcontext *ctx,
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define RENDER_SPAN( span ) \
GLuint i; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
pRow[i] = PACK_8B8G8R(FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue) ); \
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
} \
@@ -881,10 +880,10 @@ static void smooth_8R8G8B_triangle( GLcontext *ctx,
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define RENDER_SPAN( span ) \
GLuint i; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
pRow[i] = PACK_8R8G8B(FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue) ); \
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
@@ -909,11 +908,11 @@ static void smooth_8R8G8B24_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
PIXEL_TYPE *pixel = pRow; \
- for (i = 0; i < span.count; i++, pixel++) { \
+ for (i = 0; i < span.end; i++, pixel++) { \
pixel->r = FixedToInt(span.red); \
pixel->g = FixedToInt(span.green); \
- pixel->b = FixedToInt(span.blue); \
- span.red += span.redStep; \
+ pixel->b = FixedToInt(span.blue); \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
@@ -936,12 +935,12 @@ static void smooth_TRUEDITHER_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
unsigned long p; \
PACK_TRUEDITHER(p, x, y, FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue)); \
XMesaPutPixel(img, x, y, p ); \
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
@@ -965,10 +964,10 @@ static void smooth_5R6G5B_triangle( GLcontext *ctx,
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define RENDER_SPAN( span ) \
GLuint i; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
pRow[i] = (PIXEL_TYPE) PACK_5R6G5B(FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue)); \
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
@@ -993,10 +992,10 @@ static void smooth_DITHER_5R6G5B_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
PACK_TRUEDITHER(pRow[i], x, y, FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue)); \
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
@@ -1022,10 +1021,10 @@ static void smooth_DITHER8_triangle( GLcontext *ctx,
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
XDITHER_SETUP(y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
pRow[i] = (PIXEL_TYPE) XDITHER(x, FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue) ); \
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
@@ -1044,17 +1043,16 @@ static void smooth_DITHER_triangle( GLcontext *ctx,
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
XMesaImage *img = xmesa->xm_buffer->backimage;
-
#define INTERP_RGB 1
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
XDITHER_SETUP(y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
unsigned long p = XDITHER(x, FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue) ); \
XMesaPutPixel(img, x, y, p); \
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
@@ -1072,7 +1070,6 @@ static void smooth_LOOKUP8_triangle( GLcontext *ctx,
const SWvertex *v2 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-
#define INTERP_RGB 1
#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
@@ -1080,10 +1077,10 @@ static void smooth_LOOKUP8_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
LOOKUP_SETUP; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
pRow[i] = LOOKUP(FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue));\
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
@@ -1102,7 +1099,6 @@ static void smooth_HPCR_triangle( GLcontext *ctx,
const SWvertex *v2 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-
#define INTERP_RGB 1
#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
@@ -1110,10 +1106,10 @@ static void smooth_HPCR_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
- for (i = 0; i < span.count; i++, x++) { \
- pRow[i] = DITHER_HPCR(x, y, FixedToInt(span.red), \
+ for (i = 0; i < span.end; i++, x++) { \
+ pRow[i] = DITHER_HPCR(x, y, FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue)); \
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
@@ -1139,7 +1135,7 @@ static void flat_TRUECOLOR_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
XMesaPutPixel(img, x, y, pixel); \
}
@@ -1164,7 +1160,7 @@ static void flat_8A8B8G8R_triangle( GLcontext *ctx,
v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
GLuint i; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
pRow[i] = (PIXEL_TYPE) p; \
}
@@ -1189,7 +1185,7 @@ static void flat_8R8G8B_triangle( GLcontext *ctx,
v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
GLuint i; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
pRow[i] = (PIXEL_TYPE) p; \
}
@@ -1213,7 +1209,7 @@ static void flat_8R8G8B24_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
PIXEL_TYPE *pixel = pRow; \
- for (i = 0; i < span.count; i++, pixel++) { \
+ for (i = 0; i < span.end; i++, pixel++) { \
pixel->r = color[RCOMP]; \
pixel->g = color[GCOMP]; \
pixel->b = color[BCOMP]; \
@@ -1232,11 +1228,10 @@ static void flat_TRUEDITHER_triangle( GLcontext *ctx,
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
XMesaImage *img = xmesa->xm_buffer->backimage;
-
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
unsigned long p; \
PACK_TRUEDITHER(p, x, y, v2->color[0], \
v2->color[1], v2->color[2] ); \
@@ -1260,12 +1255,12 @@ static void flat_5R6G5B_triangle( GLcontext *ctx,
#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define SETUP_CODE \
+#define SETUP_CODE \
unsigned long p = PACK_5R6G5B( v2->color[0], \
v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
GLuint i; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
pRow[i] = (PIXEL_TYPE) p; \
}
@@ -1289,7 +1284,7 @@ static void flat_DITHER_5R6G5B_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
PACK_TRUEDITHER(pRow[i], x, y, color[RCOMP], \
color[GCOMP], color[BCOMP]); \
}
@@ -1317,7 +1312,7 @@ static void flat_DITHER8_triangle( GLcontext *ctx,
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
FLAT_DITHER_ROW_SETUP(FLIP(xmesa->xm_buffer, y)); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
pRow[i] = (PIXEL_TYPE) FLAT_DITHER(x); \
}
@@ -1342,7 +1337,7 @@ static void flat_DITHER_triangle( GLcontext *ctx,
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
FLAT_DITHER_ROW_SETUP(y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
unsigned long p = FLAT_DITHER(x); \
XMesaPutPixel(img, x, y, p ); \
}
@@ -1363,14 +1358,14 @@ static void flat_HPCR_triangle( GLcontext *ctx,
#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define SETUP_CODE \
+#define SETUP_CODE \
GLubyte r = v2->color[0]; \
GLubyte g = v2->color[1]; \
GLubyte b = v2->color[2];
-#define RENDER_SPAN( span ) \
+#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
- for (i = 0; i < span.count; i++, x++) { \
+ for (i = 0; i < span.end; i++, x++) { \
pRow[i] = (PIXEL_TYPE) DITHER_HPCR(x, y, r, g, b); \
}
@@ -1398,7 +1393,7 @@ static void flat_LOOKUP8_triangle( GLcontext *ctx,
GLubyte p = LOOKUP(r,g,b);
#define RENDER_SPAN( span ) \
GLuint i; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
pRow[i] = (PIXEL_TYPE) p; \
}
@@ -1410,89 +1405,89 @@ static void flat_LOOKUP8_triangle( GLcontext *ctx,
extern void _xmesa_print_triangle_func( swrast_tri_func triFunc );
void _xmesa_print_triangle_func( swrast_tri_func triFunc )
{
- printf("XMesa tri func = ");
+ _mesa_printf("XMesa tri func = ");
if (triFunc ==smooth_TRUECOLOR_z_triangle)
- printf("smooth_TRUECOLOR_z_triangle\n");
+ _mesa_printf("smooth_TRUECOLOR_z_triangle\n");
else if (triFunc ==smooth_8A8B8G8R_z_triangle)
- printf("smooth_8A8B8G8R_z_triangle\n");
+ _mesa_printf("smooth_8A8B8G8R_z_triangle\n");
else if (triFunc ==smooth_8R8G8B_z_triangle)
- printf("smooth_8R8G8B_z_triangle\n");
+ _mesa_printf("smooth_8R8G8B_z_triangle\n");
else if (triFunc ==smooth_8R8G8B24_z_triangle)
- printf("smooth_8R8G8B24_z_triangle\n");
+ _mesa_printf("smooth_8R8G8B24_z_triangle\n");
else if (triFunc ==smooth_TRUEDITHER_z_triangle)
- printf("smooth_TRUEDITHER_z_triangle\n");
+ _mesa_printf("smooth_TRUEDITHER_z_triangle\n");
else if (triFunc ==smooth_5R6G5B_z_triangle)
- printf("smooth_5R6G5B_z_triangle\n");
+ _mesa_printf("smooth_5R6G5B_z_triangle\n");
else if (triFunc ==smooth_DITHER_5R6G5B_z_triangle)
- printf("smooth_DITHER_5R6G5B_z_triangle\n");
+ _mesa_printf("smooth_DITHER_5R6G5B_z_triangle\n");
else if (triFunc ==smooth_HPCR_z_triangle)
- printf("smooth_HPCR_z_triangle\n");
+ _mesa_printf("smooth_HPCR_z_triangle\n");
else if (triFunc ==smooth_DITHER8_z_triangle)
- printf("smooth_DITHER8_z_triangle\n");
+ _mesa_printf("smooth_DITHER8_z_triangle\n");
else if (triFunc ==smooth_LOOKUP8_z_triangle)
- printf("smooth_LOOKUP8_z_triangle\n");
+ _mesa_printf("smooth_LOOKUP8_z_triangle\n");
else if (triFunc ==flat_TRUECOLOR_z_triangle)
- printf("flat_TRUECOLOR_z_triangle\n");
+ _mesa_printf("flat_TRUECOLOR_z_triangle\n");
else if (triFunc ==flat_8A8B8G8R_z_triangle)
- printf("flat_8A8B8G8R_z_triangle\n");
+ _mesa_printf("flat_8A8B8G8R_z_triangle\n");
else if (triFunc ==flat_8R8G8B_z_triangle)
- printf("flat_8R8G8B_z_triangle\n");
+ _mesa_printf("flat_8R8G8B_z_triangle\n");
else if (triFunc ==flat_8R8G8B24_z_triangle)
- printf("flat_8R8G8B24_z_triangle\n");
+ _mesa_printf("flat_8R8G8B24_z_triangle\n");
else if (triFunc ==flat_TRUEDITHER_z_triangle)
- printf("flat_TRUEDITHER_z_triangle\n");
+ _mesa_printf("flat_TRUEDITHER_z_triangle\n");
else if (triFunc ==flat_5R6G5B_z_triangle)
- printf("flat_5R6G5B_z_triangle\n");
+ _mesa_printf("flat_5R6G5B_z_triangle\n");
else if (triFunc ==flat_DITHER_5R6G5B_z_triangle)
- printf("flat_DITHER_5R6G5B_z_triangle\n");
+ _mesa_printf("flat_DITHER_5R6G5B_z_triangle\n");
else if (triFunc ==flat_HPCR_z_triangle)
- printf("flat_HPCR_z_triangle\n");
+ _mesa_printf("flat_HPCR_z_triangle\n");
else if (triFunc ==flat_DITHER8_z_triangle)
- printf("flat_DITHER8_z_triangle\n");
+ _mesa_printf("flat_DITHER8_z_triangle\n");
else if (triFunc ==flat_LOOKUP8_z_triangle)
- printf("flat_LOOKUP8_z_triangle\n");
+ _mesa_printf("flat_LOOKUP8_z_triangle\n");
else if (triFunc ==smooth_TRUECOLOR_triangle)
- printf("smooth_TRUECOLOR_triangle\n");
+ _mesa_printf("smooth_TRUECOLOR_triangle\n");
else if (triFunc ==smooth_8A8B8G8R_triangle)
- printf("smooth_8A8B8G8R_triangle\n");
+ _mesa_printf("smooth_8A8B8G8R_triangle\n");
else if (triFunc ==smooth_8R8G8B_triangle)
- printf("smooth_8R8G8B_triangle\n");
+ _mesa_printf("smooth_8R8G8B_triangle\n");
else if (triFunc ==smooth_8R8G8B24_triangle)
- printf("smooth_8R8G8B24_triangle\n");
+ _mesa_printf("smooth_8R8G8B24_triangle\n");
else if (triFunc ==smooth_TRUEDITHER_triangle)
- printf("smooth_TRUEDITHER_triangle\n");
+ _mesa_printf("smooth_TRUEDITHER_triangle\n");
else if (triFunc ==smooth_5R6G5B_triangle)
- printf("smooth_5R6G5B_triangle\n");
+ _mesa_printf("smooth_5R6G5B_triangle\n");
else if (triFunc ==smooth_DITHER_5R6G5B_triangle)
- printf("smooth_DITHER_5R6G5B_triangle\n");
+ _mesa_printf("smooth_DITHER_5R6G5B_triangle\n");
else if (triFunc ==smooth_HPCR_triangle)
- printf("smooth_HPCR_triangle\n");
+ _mesa_printf("smooth_HPCR_triangle\n");
else if (triFunc ==smooth_DITHER8_triangle)
- printf("smooth_DITHER8_triangle\n");
+ _mesa_printf("smooth_DITHER8_triangle\n");
else if (triFunc ==smooth_LOOKUP8_triangle)
- printf("smooth_LOOKUP8_triangle\n");
+ _mesa_printf("smooth_LOOKUP8_triangle\n");
else if (triFunc ==flat_TRUECOLOR_triangle)
- printf("flat_TRUECOLOR_triangle\n");
+ _mesa_printf("flat_TRUECOLOR_triangle\n");
else if (triFunc ==flat_TRUEDITHER_triangle)
- printf("flat_TRUEDITHER_triangle\n");
+ _mesa_printf("flat_TRUEDITHER_triangle\n");
else if (triFunc ==flat_8A8B8G8R_triangle)
- printf("flat_8A8B8G8R_triangle\n");
+ _mesa_printf("flat_8A8B8G8R_triangle\n");
else if (triFunc ==flat_8R8G8B_triangle)
- printf("flat_8R8G8B_triangle\n");
+ _mesa_printf("flat_8R8G8B_triangle\n");
else if (triFunc ==flat_8R8G8B24_triangle)
- printf("flat_8R8G8B24_triangle\n");
+ _mesa_printf("flat_8R8G8B24_triangle\n");
else if (triFunc ==flat_5R6G5B_triangle)
- printf("flat_5R6G5B_triangle\n");
+ _mesa_printf("flat_5R6G5B_triangle\n");
else if (triFunc ==flat_DITHER_5R6G5B_triangle)
- printf("flat_DITHER_5R6G5B_triangle\n");
+ _mesa_printf("flat_DITHER_5R6G5B_triangle\n");
else if (triFunc ==flat_HPCR_triangle)
- printf("flat_HPCR_triangle\n");
+ _mesa_printf("flat_HPCR_triangle\n");
else if (triFunc ==flat_DITHER8_triangle)
- printf("flat_DITHER8_triangle\n");
+ _mesa_printf("flat_DITHER8_triangle\n");
else if (triFunc ==flat_LOOKUP8_triangle)
- printf("flat_LOOKUP8_triangle\n");
+ _mesa_printf("flat_LOOKUP8_triangle\n");
else
- printf("???\n");
+ _mesa_printf("???\n");
}
#endif
@@ -1527,12 +1522,13 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx )
triFuncName = NULL;
#endif
- if (ctx->RenderMode != GL_RENDER ||
- ctx->Polygon.SmoothFlag ||
- ctx->Texture._ReallyEnabled ||
- (swrast->_RasterMask & MULTI_DRAW_BIT) ||
- (ctx->Polygon.CullFlag && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK))
- 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->Texture._EnabledUnits) return (swrast_tri_func) NULL;
+ if (swrast->_RasterMask & MULTI_DRAW_BIT) return (swrast_tri_func) NULL;
+ if (ctx->Polygon.CullFlag &&
+ ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
+ return (swrast_tri_func) NULL;
if (xmesa->xm_buffer->buffer==XIMAGE) {
if ( ctx->Light.ShadeModel==GL_SMOOTH
diff --git a/xc/extras/Mesa/src/X/xmesaP.h b/xc/extras/Mesa/src/X/xmesaP.h
index 06d1453c7..df3b2865f 100644
--- a/xc/extras/Mesa/src/X/xmesaP.h
+++ b/xc/extras/Mesa/src/X/xmesaP.h
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.2
+ * Version: 5.0
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -70,9 +70,9 @@ struct xmesa_visual {
#ifdef XFree86Server
GLint screen_depth; /* The depth of the screen */
#else
- XVisualInfo *vishandle; /* The pointer returned by glXChooseVisual */
+ XVisualInfo *vishandle; /* Only used in fakeglx.c */
#endif
- XMesaVisualInfo visinfo; /* X's visual info */
+ XMesaVisualInfo visinfo; /* X's visual info (pointer to private copy) */
GLint BitsPerPixel; /* True bits per pixel for XImages */
GLint level; /* 0=normal, 1=overlay, etc */
@@ -119,9 +119,9 @@ struct xmesa_visual {
struct xmesa_context {
GLcontext *gl_ctx; /* the core library context */
XMesaVisual xm_visual; /* Describes the buffers */
- XMesaBuffer xm_buffer; /* current draw framebuffer */
+ XMesaBuffer xm_draw_buffer; /* current draw framebuffer */
XMesaBuffer xm_read_buffer; /* current read framebuffer */
- GLboolean use_read_buffer; /* read from the xm_read_buffer/ */
+ XMesaBuffer xm_buffer; /* current span/point/line/triangle buffer */
XMesaDisplay *display; /* == xm_visual->display */
GLboolean swapbytes; /* Host byte order != display byte order? */
@@ -135,17 +135,25 @@ struct xmesa_context {
+typedef enum {
+ WINDOW, /* An X window */
+ GLXWINDOW, /* GLX window */
+ PIXMAP, /* GLX pixmap */
+ PBUFFER /* GLX Pbuffer */
+} BufferType;
+
+
/*
* "Derived" from GLframebuffer. Basically corresponds to a GLXDrawable.
*/
struct xmesa_buffer {
GLframebuffer mesa_buffer; /* depth, stencil, accum, etc buffers */
+ /* This MUST BE FIRST! */
GLboolean wasCurrent; /* was ever the current buffer? */
XMesaVisual xm_visual; /* the X/Mesa visual */
XMesaDisplay *display;
- GLboolean pixmap_flag; /* is the buffer a Pixmap? */
- GLboolean pbuffer_flag; /* is the buffer a Pbuffer? */
+ BufferType type; /* window, pixmap, pbuffer or glxwindow */
XMesaDrawable frontbuffer; /* either a window or pixmap */
XMesaPixmap backpixmap; /* back buffer Pixmap */
XMesaImage *backimage; /* back buffer simulated XImage */
@@ -155,6 +163,8 @@ struct xmesa_buffer {
XMesaColormap cmap; /* the X colormap */
+ unsigned long selectedEvents;/* for pbuffers only */
+
GLint db_state; /* 0 = single buffered */
/* BACK_PIXMAP = use Pixmap for back buffer */
/* BACK_XIMAGE = use XImage for back buffer */
@@ -528,9 +538,7 @@ extern GLboolean XMesaForceCurrent(XMesaContext c);
extern GLboolean XMesaLoseCurrent(XMesaContext c);
extern void XMesaReset( void );
-extern void xmesa_set_read_buffer( GLcontext *ctx,
- GLframebuffer *buffer, GLenum mode );
-
extern void xmesa_resize_buffers( GLframebuffer *buffer );
+
#endif
diff --git a/xc/extras/Mesa/src/X86/3dnow.c b/xc/extras/Mesa/src/X86/3dnow.c
index 00054e91d..01cd056b5 100644
--- a/xc/extras/Mesa/src/X86/3dnow.c
+++ b/xc/extras/Mesa/src/X86/3dnow.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -30,7 +30,6 @@
#include "glheader.h"
#include "context.h"
-#include "math/m_vertices.h"
#include "math/m_xform.h"
#include "tnl/t_context.h"
@@ -79,9 +78,7 @@ void _mesa_init_3dnow_transform_asm( void )
ASSIGN_XFORM_GROUP( 3dnow, 3 );
ASSIGN_XFORM_GROUP( 3dnow, 4 );
-/* Normalize function is broken - see demos/morph3d for example.
- */
-/* ASSIGN_NORM_GROUP( 3dnow ); */
+ ASSIGN_NORM_GROUP( 3dnow );
#ifdef DEBUG
_math_test_all_transform_functions( "3DNow!" );
@@ -89,17 +86,3 @@ void _mesa_init_3dnow_transform_asm( void )
#endif
#endif
}
-
-void _mesa_init_3dnow_vertex_asm( void )
-{
-#ifdef USE_3DNOW_ASM
- _mesa_xform_points3_v16_general = _mesa_v16_3dnow_general_xform;
-
- _mesa_project_v16 = _mesa_3dnow_project_vertices;
- _mesa_project_clipped_v16 = _mesa_3dnow_project_clipped_vertices;
-
-#ifdef DEBUG_NOT
- _math_test_all_vertex_functions( "3DNow!" );
-#endif
-#endif
-}
diff --git a/xc/extras/Mesa/src/X86/3dnow.h b/xc/extras/Mesa/src/X86/3dnow.h
index d9ea5154c..df9f2638d 100644
--- a/xc/extras/Mesa/src/X86/3dnow.h
+++ b/xc/extras/Mesa/src/X86/3dnow.h
@@ -34,6 +34,5 @@
#include "math/m_xform.h"
void _mesa_init_3dnow_transform_asm( void );
-void _mesa_init_3dnow_vertex_asm( void );
#endif
diff --git a/xc/extras/Mesa/src/X86/3dnow_normal.S b/xc/extras/Mesa/src/X86/3dnow_normal.S
index 920788fc6..eec9be3ee 100644
--- a/xc/extras/Mesa/src/X86/3dnow_normal.S
+++ b/xc/extras/Mesa/src/X86/3dnow_normal.S
@@ -1,10 +1,9 @@
-/* $Id: 3dnow_normal.S,v 1.1.1.1 2002/10/22 13:06:12 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 5.0.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -101,7 +100,7 @@ LLBL (G3TN_transform):
PUNPCKLDQ ( MM2, MM2 ) /* x2 | x2 */
PFMUL ( MM3, MM0 ) /* x1*m1 | x0*m0 */
- ADD_L ( CONST(12), EAX ) /* next r */
+ ADD_L ( CONST(16), EAX ) /* next r */
PREFETCHW ( REGIND(EAX) )
@@ -112,7 +111,7 @@ LLBL (G3TN_transform):
PFADD ( MM2, MM0 ) /* x0*m4+x1*m5+x2*m6| x0*m0+...+x2**/
MOVQ ( REGIND (EDX), MM1 ) /* x1 | x0 */
- MOVQ ( MM0, REGOFF(-12, EAX) ) /* write r0, r1 */
+ MOVQ ( MM0, REGOFF(-16, EAX) ) /* write r0, r1 */
PFMUL ( MM6, MM1 ) /* x1*m9 | x0*m8 */
MOVD ( REGOFF (8, EDX), MM2 ) /* | x2 */
@@ -125,7 +124,7 @@ LLBL (G3TN_transform):
PREFETCH ( REGIND(EDX) )
- MOVD ( MM1, REGOFF(-4, EAX) ) /* write r2 */
+ MOVD ( MM1, REGOFF(-8, EAX) ) /* write r2 */
DEC_L ( EBP ) /* decrement normal counter */
JA ( LLBL (G3TN_transform) )
@@ -160,7 +159,7 @@ LLBL (G3TN_norm_w_lengths):
MOVQ ( MM0, REGIND(EAX) ) /* write new x0, x1 */
MOVD ( MM1, REGOFF(8, EAX) ) /* write new x2 */
- ADD_L ( CONST(12), EAX ) /* next r */
+ ADD_L ( CONST(16), EAX ) /* next r */
DEC_L ( EBP ) /* decrement normal counter */
JA ( LLBL (G3TN_norm_w_lengths) )
@@ -171,11 +170,14 @@ LLBL (G3TN_norm):
PREFETCHW ( REGIND(EAX) )
+ MOVQ ( REGIND (EAX), MM0 ) /* x1 | x0 */
+ MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */
+
MOVQ ( MM0, MM3 ) /* x1 | x0 */
MOVQ ( MM1, MM4 ) /* | x2 */
PFMUL ( MM0, MM3 ) /* x1*x1 | x0*x0 */
- ADD_L ( CONST(12), EAX ) /* next r */
+ ADD_L ( CONST(16), EAX ) /* next r */
PFMUL ( MM1, MM4 ) /* | x2*x2 */
PFADD ( MM4, MM3 ) /* | x0*x0+x2*x2 */
@@ -194,13 +196,10 @@ LLBL (G3TN_norm):
PFMUL ( MM5, MM0 ) /* x1 (normalized) | x0 (normalize*/
- MOVQ ( MM0, REGOFF(-12, EAX) ) /* write new x0, x1 */
+ MOVQ ( MM0, REGOFF(-16, EAX) ) /* write new x0, x1 */
PFMUL ( MM5, MM1 ) /* | x2 (normalize*/
- MOVD ( MM1, REGOFF(-4, EAX) ) /* write new x2 */
- MOVQ ( REGIND (EAX), MM0 ) /* x1 | x0 */
-
- MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */
+ MOVD ( MM1, REGOFF(-8, EAX) ) /* write new x2 */
JA ( LLBL (G3TN_norm) )
LLBL (G3TN_exit_3dnow):
@@ -277,7 +276,7 @@ LLBL (G3TNNR_norm_w_lengths): /* use precalculated lengths */
PREFETCH ( REGIND(EDX) )
PFMUL ( MM2, MM7 ) /* | x2*m10 */
- ADD_L ( CONST(12), EAX ) /* next r */
+ ADD_L ( CONST(16), EAX ) /* next r */
PFMUL ( MM3, MM7 ) /* | x2 (normalized) */
PUNPCKLDQ ( MM3, MM3 ) /* length (x) | length (x) */
@@ -286,9 +285,9 @@ LLBL (G3TNNR_norm_w_lengths): /* use precalculated lengths */
PFMUL ( MM3, MM6 ) /* x1 (normalized) | x0 (normalized) */
DEC_L ( EBP ) /* decrement normal counter */
- MOVQ ( MM6, REGOFF(-12, EAX) ) /* write r0, r1 */
+ MOVQ ( MM6, REGOFF(-16, EAX) ) /* write r0, r1 */
- MOVD ( MM7, REGOFF(-4, EAX) ) /* write r2 */
+ MOVD ( MM7, REGOFF(-8, EAX) ) /* write r2 */
MOVD ( REGIND(EDI), MM3 ) /* | length (x) */
JA ( LLBL (G3TNNR_norm_w_lengths) )
@@ -303,7 +302,7 @@ LLBL (G3TNNR_norm): /* need to calculate lengths */
MOVD ( REGOFF(8, EDX), MM7 ) /* | x2 */
PFMUL ( MM0, MM6 ) /* x1*m5 | x0*m0 */
- ADD_L ( CONST(12), EAX ) /* next r */
+ ADD_L ( CONST(16), EAX ) /* next r */
PFMUL ( MM2, MM7 ) /* | x2*m10 */
MOVQ ( MM6, MM3 ) /* x1 (transformed)| x0 (transformed) */
@@ -332,10 +331,10 @@ LLBL (G3TNNR_norm): /* need to calculate lengths */
PFRCPIT2 ( MM4, MM5 )
PFMUL ( MM5, MM6 ) /* x1 (normalized) | x0 (normalized) */
- MOVQ ( MM6, REGOFF(-12, EAX) ) /* write r0, r1 */
+ MOVQ ( MM6, REGOFF(-16, EAX) ) /* write r0, r1 */
PFMUL ( MM5, MM7 ) /* | x2 (normalized) */
- MOVD ( MM7, REGOFF(-4, EAX) ) /* write r2 */
+ MOVD ( MM7, REGOFF(-8, EAX) ) /* write r2 */
JA ( LLBL (G3TNNR_norm) )
@@ -404,12 +403,12 @@ LLBL (G3TRNR_rescale):
PREFETCH ( REGIND(EDX) )
PFMUL ( MM2, MM5 ) /* | x2*m10 */
- ADD_L ( CONST(12), EAX ) /* next r */
+ ADD_L ( CONST(16), EAX ) /* next r */
DEC_L ( EBP ) /* decrement normal counter */
- MOVQ ( MM4, REGOFF(-12, EAX) ) /* write r0, r1 */
+ MOVQ ( MM4, REGOFF(-16, EAX) ) /* write r0, r1 */
- MOVD ( MM5, REGOFF(-4, EAX) ) /* write r2 */
+ MOVD ( MM5, REGOFF(-8, EAX) ) /* write r2 */
JA ( LLBL (G3TRNR_rescale) ) /* cnt > 0 ? -> process next normal */
FEMMS
@@ -481,7 +480,7 @@ LLBL (G3TR_rescale):
PUNPCKLDQ ( MM2, MM2 ) /* x2 | x2 */
PFMUL ( MM3, MM0 ) /* x1*m1 | x0*m0 */
- ADD_L ( CONST(12), EAX ) /* next r */
+ ADD_L ( CONST(16), EAX ) /* next r */
PFMUL ( MM4, MM1 ) /* x1*m5 | x0*m4 */
PFACC ( MM1, MM0 ) /* x0*m4+x1*m5 | x0*m0+x1*m1 */
@@ -496,14 +495,14 @@ LLBL (G3TR_rescale):
PREFETCH ( REGIND(EDX) )
- MOVQ ( MM0, REGOFF(-12, EAX) ) /* write r0, r1 */
+ MOVQ ( MM0, REGOFF(-16, EAX) ) /* write r0, r1 */
PFMUL ( MM6, MM1 ) /* x1*m9 | x0*m8 */
PFMUL ( MM7, MM2 ) /* | x2*m10 */
PFACC ( MM1, MM1 ) /* *not used* | x0*m8+x1*m9 */
PFADD ( MM2, MM1 ) /* *not used* | x0*m8+x1*m9+x2*m10 */
- MOVD ( MM1, REGOFF(-4, EAX) ) /* write r2 */
+ MOVD ( MM1, REGOFF(-8, EAX) ) /* write r2 */
DEC_L ( EDI ) /* decrement normal counter */
JA ( LLBL (G3TR_rescale) )
@@ -565,12 +564,12 @@ LLBL (G3TNR_transform):
PREFETCH ( REGIND(EDX) )
PFMUL ( MM2, MM5 ) /* | x2*m10 */
- ADD_L ( CONST(12), EAX ) /* next r */
+ ADD_L ( CONST(16), EAX ) /* next r */
DEC_L ( EDI ) /* decrement normal counter */
- MOVQ ( MM4, REGOFF(-12, EAX) ) /* write r0, r1 */
+ MOVQ ( MM4, REGOFF(-16, EAX) ) /* write r0, r1 */
- MOVD ( MM5, REGOFF(-4, EAX) ) /* write r2 */
+ MOVD ( MM5, REGOFF(-8, EAX) ) /* write r2 */
JA ( LLBL (G3TNR_transform) )
FEMMS
@@ -632,7 +631,7 @@ LLBL (G3T_transform):
PUNPCKLDQ ( MM2, MM2 ) /* x2 | x2 */
PFMUL ( MM3, MM0 ) /* x1*m1 | x0*m0 */
- ADD_L ( CONST(12), EAX ) /* next r */
+ ADD_L ( CONST(16), EAX ) /* next r */
PFMUL ( MM4, MM1 ) /* x1*m5 | x0*m4 */
PFACC ( MM1, MM0 ) /* x0*m4+x1*m5 | x0*m0+x1*m1 */
@@ -641,7 +640,7 @@ LLBL (G3T_transform):
PFADD ( MM2, MM0 ) /* x0*m4...+x2*m6| x0*m0+x1*m1+x2*m2 */
MOVQ ( REGIND(EDX), MM1 ) /* x1 | x0 */
- MOVQ ( MM0, REGOFF(-12, EAX) ) /* write r0, r1 */
+ MOVQ ( MM0, REGOFF(-16, EAX) ) /* write r0, r1 */
PFMUL ( MM6, MM1 ) /* x1*m9 | x0*m8 */
MOVD ( REGOFF(8, EDX), MM2 ) /* | x2 */
@@ -654,7 +653,7 @@ LLBL (G3T_transform):
PFACC ( MM1, MM1 ) /* *not used* | x0*m8+x1*m9 */
PFADD ( MM2, MM1 ) /* *not used* | x0*m8+x1*m9+x2*m10 */
- MOVD ( MM1, REGOFF(-4, EAX) ) /* write r2 */
+ MOVD ( MM1, REGOFF(-8, EAX) ) /* write r2 */
DEC_L ( EDI ) /* decrement normal counter */
JA ( LLBL (G3T_transform) )
@@ -718,7 +717,7 @@ LLBL (G3N_norm1): /* use precalculated lengths */
MOVQ ( MM0, REGIND(EAX) ) /* write new x0, x1 */
MOVD ( MM1, REGOFF(8, EAX) ) /* write new x2 */
- ADD_L ( CONST(12), EAX ) /* next r */
+ ADD_L ( CONST(16), EAX ) /* next r */
ADD_L ( CONST(4), EDX ) /* next length */
DEC_L ( EBP ) /* decrement normal counter */
@@ -732,18 +731,18 @@ LLBL (G3N_norm2): /* need to calculate lengths */
PREFETCHW ( REGIND(EAX) )
- MOVQ ( MM0, MM3 ) /* x1 | x0 */
- ADD_L ( STRIDE, ECX ) /* next normal */
-
PREFETCH ( REGIND(ECX) )
MOVQ ( REGIND(ECX), MM0 ) /* x1 | x0 */
MOVD ( REGOFF(8, ECX), MM1 ) /* | x2 */
+ MOVQ ( MM0, MM3 ) /* x1 | x0 */
+ ADD_L ( STRIDE, ECX ) /* next normal */
+
PFMUL ( MM0, MM3 ) /* x1*x1 | x0*x0 */
MOVQ ( MM1, MM4 ) /* | x2 */
- ADD_L ( CONST(12), EAX ) /* next r */
+ ADD_L ( CONST(16), EAX ) /* next r */
PFMUL ( MM1, MM4 ) /* | x2*x2 */
PFADD ( MM4, MM3 ) /* | x0*x0+x2*x2 */
@@ -761,10 +760,10 @@ LLBL (G3N_norm2): /* need to calculate lengths */
PFRCPIT2 ( MM4, MM5 )
PFMUL ( MM5, MM0 ) /* x1 (normalized) | x0 (normalized) */
- MOVQ ( MM0, REGOFF(-12, EAX) ) /* write new x0, x1 */
+ MOVQ ( MM0, REGOFF(-16, EAX) ) /* write new x0, x1 */
PFMUL ( MM5, MM1 ) /* | x2 (normalized) */
- MOVD ( MM1, REGOFF(-4, EAX) ) /* write new x2 */
+ MOVD ( MM1, REGOFF(-8, EAX) ) /* write new x2 */
JA ( LLBL (G3N_norm2) )
@@ -820,10 +819,10 @@ LLBL (G3R_rescale):
PREFETCH ( REGIND(ECX) )
PFMUL ( MM0, MM2 ) /* | x2*scale */
- ADD_L ( CONST(12), EAX ) /* next r */
+ ADD_L ( CONST(16), EAX ) /* next r */
- MOVQ ( MM1, REGOFF(-12, EAX) ) /* write r0, r1 */
- MOVD ( MM2, REGOFF(-4, EAX) ) /* write r2 */
+ MOVQ ( MM1, REGOFF(-16, EAX) ) /* write r0, r1 */
+ MOVD ( MM2, REGOFF(-8, EAX) ) /* write r2 */
DEC_L ( EDX ) /* decrement normal counter */
JA ( LLBL (G3R_rescale) )
diff --git a/xc/extras/Mesa/src/X86/3dnow_vertex.S b/xc/extras/Mesa/src/X86/3dnow_vertex.S
deleted file mode 100644
index 78d89ecb5..000000000
--- a/xc/extras/Mesa/src/X86/3dnow_vertex.S
+++ /dev/null
@@ -1,220 +0,0 @@
-#include "matypes.h"
-
- SEG_TEXT
-
-#define MAT_SY 20
-#define MAT_SZ 40
-#define MAT_TX 48
-#define MAT_TY 52
-#define MAT_TZ 56
-
-
-/*
- * void _mesa_v16_3dnow_general_xform( GLfloat *dest,
- * const GLfloat *m,
- * const GLfloat *src,
- * GLuint src_stride,
- * GLuint count )
- *
- * These tranformation functions could disappear if the standard ones
- * took an output stride.
- */
-GLOBL GLNAME( _mesa_v16_3dnow_general_xform )
-GLNAME( _mesa_v16_3dnow_general_xform ):
-
- PUSH_L ( EDI )
- PUSH_L ( ESI )
-
- MOV_L ( REGOFF(12, ESP), EAX ) /* dest */
- MOV_L ( REGOFF(16, ESP), ESI ) /* mat */
- MOV_L ( REGOFF(20, ESP), EDX ) /* src */
- MOV_L ( REGOFF(24, ESP), EDI ) /* src_stride */
- MOV_L ( REGOFF(28, ESP), ECX ) /* count */
-
- FEMMS
-
- MOVQ ( REGOFF(MAT_TX, ESI), MM7 ) /* ty | tx */
- MOVQ ( REGOFF(MAT_TZ, ESI), MM3 ) /* tw | tz */
-
-ALIGNTEXT32
-LLBL( v16_3dnow_general_loop ):
-
- PREFETCHW ( REGOFF(128, EAX) ) /* write alloc 2 verts ahead */
- PREFETCH ( REGOFF(32, EDX) ) /* prefetch next cache line */
-
- MOVQ ( REGIND(EDX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EDX), MM1 ) /* | x2 */
- MOVQ ( REGIND(ESI), MM4 ) /* m1 | m0 */
- PUNPCKHDQ ( MM0, MM2 ) /* x1 | */
- MOVQ ( REGOFF(16, ESI), MM5 ) /* m5 | m4 */
- PUNPCKLDQ ( MM0, MM0 ) /* x0 | x0 */
- MOVQ ( REGOFF(32, ESI), MM6 ) /* m9 | m8 */
- PFMUL ( MM0, MM4 ) /* x0*m1 | x0*m0 */
- PUNPCKHDQ ( MM2, MM2 ) /* x1 | x1 */
- PFMUL ( MM2, MM5 ) /* x1*m5 | x1*m4 */
- PUNPCKLDQ ( MM1, MM1 ) /* x2 | x2 */
- PFMUL ( REGOFF(8, ESI), MM0 ) /* x0*m3 | x0*m2 */
- PFMUL ( REGOFF(24, ESI), MM2 ) /* x1*m7 | x1*m6 */
- PFMUL ( MM1, MM6 ) /* x2*m9 | x2*m8 */
- PFADD ( MM4, MM5 ) /* x0*m1+x1*m5 | x0*m0+x1*m4 */
- PFMUL ( REGOFF(40, ESI), MM1 ) /* x2*m11 | x2*m10 */
- PFADD ( MM0, MM2 ) /* x0*m3+x1*m7 | x0*m2+x1*m6 */
- PFADD ( MM5, MM6 )
- PFADD ( MM1, MM2 )
- PFADD ( MM7, MM6 ) /* r1 | r0 */
- PFADD ( MM3, MM2 ) /* r3 | r2 */
- ADD_L ( EDI, EDX ) /* next input vertex */
- MOVQ ( MM6, REGIND(EAX) )
- MOVQ ( MM2, REGOFF(8, EAX) )
- ADD_L ( CONST(64), EAX ) /* next output vertex */
- DEC_L ( ECX )
- JNE ( LLBL(v16_3dnow_general_loop) )
-
- FEMMS
-
- POP_L ( ESI )
- POP_L ( EDI )
- RET
-
-
-
-/* Do viewport map and perspective projection. Args should look like:
- *
- * _mesa_3dnow_project_vertices( float *first_vertex,
- * const float *last_vertex,
- * float *matrix,
- * GLuint stride )
- *
- * This routine assumes a sane vertex layout with x,y,z,w as
- * the first four elements, to be projected in clip-space, to
- * x/w,y/w,z/w,1/w, and then transformed according to the matrix to
- * device space. The device coordinates will overwrite the clip
- * coordinates as the first four elements of the vertex.
- *
- * If projection is required for other elements, such as texcoords,
- * you will have to code a specialized version of this routine. See
- * FX/X86 for examples.
- *
- * These routines are simplified versions of the FX code written by
- * Holger.
- */
-
-GLOBL GLNAME( _mesa_3dnow_project_vertices )
-GLNAME( _mesa_3dnow_project_vertices ):
-
- PUSH_L ( EBP )
- FEMMS
- PREFETCH ( REGOFF(8, ESP) ) /* fetch the first vertex */
-
- MOV_L ( REGOFF(8, ESP), ECX ) /* first_vert */
- MOV_L ( REGOFF(12, ESP), EDX ) /* last_vert */
- 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 */
- MOVD ( REGIND(EBP), MM5 )
- PUNPCKLDQ ( REGOFF(MAT_SY, EBP), MM5 ) /* vsy | vsx */
- MOVD ( REGOFF(MAT_SZ, EBP), MM1 ) /* | vsz */
- SUB_L ( ECX, EDX ) /* last -= first */
-
-ALIGNTEXT32
-LLBL( v16_3dnow_pv_loop_start ):
-
- PREFETCH ( REGOFF(64, ECX) ) /* fetch one/two verts ahead */
- 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 )
- 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 */
- PUNPCKLDQ ( MM7, MM3 ) /* f[3] = oow | f[2] */
- MOVQ ( MM2, REGOFF(0, ECX) )
- MOVQ ( MM3, REGOFF(8, ECX) )
- ADD_L ( EAX, ECX ) /* f += stride */
- SUB_L ( EAX, EDX )
- JA ( LLBL(v16_3dnow_pv_loop_start) )
-
- FEMMS
- POP_L ( EBP )
- RET
-
-
-
-/*
- * _mesa_3dnow_project_clipped_vertices( float *first_vertex,
- * const float *last_vertex,
- * float *matrix,
- * GLuint stride,
- * const GLubyte *clip_mask )
- */
-GLOBL GLNAME( _mesa_3dnow_project_clipped_vertices )
-GLNAME( _mesa_3dnow_project_clipped_vertices ):
-
- PUSH_L ( EBP )
- PUSH_L ( ESI )
-
- FEMMS
-
- PREFETCH ( REGOFF(12, ESP) ) /* fetch the first vertex */
-
- MOV_L ( REGOFF(12, ESP), ECX ) /* first_vert */
- MOV_L ( REGOFF(16, ESP), EDX ) /* last_vert */
- MOV_L ( REGOFF(20, ESP), EBP ) /* matrix */
- MOV_L ( REGOFF(24, ESP), EAX ) /* stride */
- MOV_L ( REGOFF(28, ESP), ESI ) /* clip_mask */
-
-
- MOVD ( REGOFF(MAT_TX, EBP), MM6 ) /* | tx */
- PUNPCKLDQ ( REGOFF(MAT_TY, EBP), MM6 ) /* ty | tx */
- MOVD ( REGIND(EBP), MM5 )
- PUNPCKLDQ ( REGOFF(MAT_SY, EBP), MM5 ) /* vsy | vsx */
- MOVD ( REGOFF(MAT_SZ, EBP), MM1 ) /* | vsz */
-
-ALIGNTEXT32
-LLBL( v16_3dnow_pcv_loop_start ):
-
- CMP_B ( CONST(0), REGIND(ESI) )
- JNE ( LLBL(v16_3dnow_pcv_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 )
- 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 */
- PUNPCKLDQ ( MM7, MM3 ) /* f[3] = oow | f[2] */
- MOVQ ( MM2, REGOFF(0, ECX) )
- MOVQ ( MM3, REGOFF(8, ECX) )
-
-LLBL( v16_3dnow_pcv_skip ):
-
- ADD_L ( EAX, ECX ) /* f += stride */
- INC_L ( ESI ) /* next clip_mask */
-
- CMP_L ( ECX, EDX )
- JNE ( LLBL(v16_3dnow_pcv_loop_start) )
-
- FEMMS
-
- POP_L ( ESI )
- POP_L ( EBP )
- RET
diff --git a/xc/extras/Mesa/src/X86/assyntax.h b/xc/extras/Mesa/src/X86/assyntax.h
index 2aabbe4f8..25da11604 100644
--- a/xc/extras/Mesa/src/X86/assyntax.h
+++ b/xc/extras/Mesa/src/X86/assyntax.h
@@ -964,11 +964,11 @@ SECTION _DATA public align=16 class=DATA use32 flat
#endif
#if defined(Lynx) || (defined(SYSV) || defined(SVR4)) \
- || (defined(linux) || defined(__OS2ELF__)) && defined(__ELF__) \
+ || (defined(__linux__) || defined(__OS2ELF__)) && defined(__ELF__) \
|| defined(__FreeBSD__) && __FreeBSD__ >= 3
#define GLNAME(a) a
#else
-#define GLNAME(a) _ ## a
+#define GLNAME(a) CONCAT(_, a)
#endif
/*
@@ -1077,7 +1077,7 @@ SECTION _DATA public align=16 class=DATA use32 flat
#define VARINDIRECT(var) var
/* Use register contents as jump/call target: */
-#define CODEPTR(reg) reg
+#define CODEPTR(reg) P_(reg)
/*
* Redefine assembler commands
@@ -1201,7 +1201,7 @@ SECTION _DATA public align=16 class=DATA use32 flat
#define JS(a) js NEAR a
#define JZ(a) jz NEAR a
#define JMP(a) jmp a
-#define JMPF(s,a) jmpf
+#define JMPF(s,a) jmp far s:a
#define LAHF lahf
#define LAR(a, b) lar b, a
#define LEA_L(a, b) lea P_(b), P_(a)
diff --git a/xc/extras/Mesa/src/X86/clip_args.h b/xc/extras/Mesa/src/X86/clip_args.h
index 25eceed65..796611fbf 100644
--- a/xc/extras/Mesa/src/X86/clip_args.h
+++ b/xc/extras/Mesa/src/X86/clip_args.h
@@ -28,7 +28,7 @@
* FRAME_OFFSET to the number of bytes pushed onto the stack before
* using the ARG_* argument macros.
*
- * Gareth Hughes <gareth@valinux.com>
+ * Gareth Hughes
*/
#ifndef __CLIP_ARGS_H__
diff --git a/xc/extras/Mesa/src/X86/common_x86.c b/xc/extras/Mesa/src/X86/common_x86.c
index fc0fbb8c5..3d449b142 100644
--- a/xc/extras/Mesa/src/X86/common_x86.c
+++ b/xc/extras/Mesa/src/X86/common_x86.c
@@ -1,9 +1,8 @@
-
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 5.0
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -44,14 +43,21 @@
#include "context.h"
#include "common_x86_asm.h"
+#include "imports.h"
int _mesa_x86_cpu_features = 0;
/* No reason for this to be public.
*/
-extern int _mesa_identify_x86_cpu_features( void );
+extern int _mesa_identify_x86_cpu_features(void);
+extern GLuint _mesa_x86_has_cpuid(void);
+extern void _mesa_x86_cpuid(GLuint op, GLuint *reg_eax, GLuint *reg_ebx, GLuint *reg_ecx, GLuint *reg_edx);
+extern GLuint _mesa_x86_cpuid_eax(GLuint op);
+extern GLuint _mesa_x86_cpuid_ebx(GLuint op);
+extern GLuint _mesa_x86_cpuid_ecx(GLuint op);
+extern GLuint _mesa_x86_cpuid_edx(GLuint op);
static void message( const char *msg )
{
@@ -236,9 +242,86 @@ static void check_os_sse_support( void )
void _mesa_init_all_x86_transform_asm( void )
{
+ (void) message; /* silence warning */
#ifdef USE_X86_ASM
- _mesa_x86_cpu_features = _mesa_identify_x86_cpu_features();
+ _mesa_x86_cpu_features = 0;
+
+ if (!_mesa_x86_has_cpuid()) {
+ message("CPUID not detected");
+ }
+ else {
+ GLuint cpu_features;
+ GLuint cpu_ext_features;
+ GLuint cpu_ext_info;
+ char cpu_vendor[13];
+ GLuint result;
+
+ /* get vendor name */
+ _mesa_x86_cpuid(0, &result, (GLuint *)(cpu_vendor + 0), (GLuint *)(cpu_vendor + 8), (GLuint *)(cpu_vendor + 4));
+ cpu_vendor[12] = '\0';
+
+ message("cpu vendor: ");
+ message(cpu_vendor);
+ message("\n");
+
+ /* get cpu features */
+ cpu_features = _mesa_x86_cpuid_edx(1);
+
+ if (cpu_features & X86_CPU_FPU)
+ _mesa_x86_cpu_features |= X86_FEATURE_FPU;
+ if (cpu_features & X86_CPU_CMOV)
+ _mesa_x86_cpu_features |= X86_FEATURE_CMOV;
+
+#ifdef USE_MMX_ASM
+ if (cpu_features & X86_CPU_MMX)
+ _mesa_x86_cpu_features |= X86_FEATURE_MMX;
+#endif
+
+#ifdef USE_SSE_ASM
+ if (cpu_features & X86_CPU_XMM)
+ _mesa_x86_cpu_features |= X86_FEATURE_XMM;
+ if (cpu_features & X86_CPU_XMM2)
+ _mesa_x86_cpu_features |= X86_FEATURE_XMM2;
+#endif
+
+ /* query extended cpu features */
+ if ((cpu_ext_info = _mesa_x86_cpuid_eax(0x80000000)) > 0x80000000) {
+ if (cpu_ext_info >= 0x80000001) {
+
+ cpu_ext_features = _mesa_x86_cpuid_edx(0x80000001);
+
+ if (cpu_features & X86_CPU_MMX) {
+
+#ifdef USE_3DNOW_ASM
+ if (cpu_ext_features & X86_CPUEXT_3DNOW)
+ _mesa_x86_cpu_features |= X86_FEATURE_3DNOW;
+ if (cpu_ext_features & X86_CPUEXT_3DNOW_EXT)
+ _mesa_x86_cpu_features |= X86_FEATURE_3DNOWEXT;
+#endif
+#ifdef USE_MMX_ASM
+ if (cpu_ext_features & X86_CPUEXT_MMX_EXT)
+ _mesa_x86_cpu_features |= X86_FEATURE_MMXEXT;
+#endif
+ }
+ }
+
+ /* query cpu name */
+ if (cpu_ext_info >= 0x80000002) {
+ GLuint ofs;
+ char cpu_name[49];
+ for (ofs = 0; ofs < 3; ofs++)
+ _mesa_x86_cpuid(0x80000002+ofs, (GLuint *)(cpu_name + (16*ofs)+0), (GLuint *)(cpu_name + (16*ofs)+4), (GLuint *)(cpu_name + (16*ofs)+8), (GLuint *)(cpu_name + (16*ofs)+12));
+ cpu_name[48] = '\0'; /* the name should be NULL terminated, but just to be sure */
+
+ message("cpu name: ");
+ message(cpu_name);
+ message("\n");
+ }
+ }
+
+ }
+
if ( getenv( "MESA_NO_ASM" ) ) {
_mesa_x86_cpu_features = 0;
}
@@ -277,6 +360,7 @@ void _mesa_init_all_x86_transform_asm( void )
message( "SSE cpu detected.\n" );
_mesa_init_sse_transform_asm();
} else {
+ message( "SSE cpu detected, but switched off by user.\n" );
_mesa_x86_cpu_features &= ~(X86_FEATURE_XMM);
}
}
@@ -284,26 +368,3 @@ void _mesa_init_all_x86_transform_asm( void )
#endif
}
-/* Note: the above function must be called before this one, so that
- * _mesa_x86_cpu_features gets correctly initialized.
- */
-void _mesa_init_all_x86_vertex_asm( void )
-{
-#ifdef USE_X86_ASM
- if ( _mesa_x86_cpu_features ) {
- _mesa_init_x86_vertex_asm();
- }
-
-#ifdef USE_3DNOW_ASM
- if ( cpu_has_3dnow && getenv( "MESA_NO_3DNOW" ) == 0 ) {
- _mesa_init_3dnow_vertex_asm();
- }
-#endif
-
-#ifdef USE_SSE_ASM
- if ( cpu_has_xmm && getenv( "MESA_NO_SSE" ) == 0 ) {
- _mesa_init_sse_vertex_asm();
- }
-#endif
-#endif
-}
diff --git a/xc/extras/Mesa/src/X86/common_x86_asm.S b/xc/extras/Mesa/src/X86/common_x86_asm.S
index 9241843ff..019e16732 100644
--- a/xc/extras/Mesa/src/X86/common_x86_asm.S
+++ b/xc/extras/Mesa/src/X86/common_x86_asm.S
@@ -1,9 +1,8 @@
-
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 5.1
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * 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"),
@@ -22,7 +21,6 @@
* AN ACTION 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/extras/Mesa/src/X86/common_x86_asm.S,v 1.13 2002/09/09 21:52:14 dawes Exp $ */
/*
* Check extended CPU capabilities. Now justs returns the raw CPUID
@@ -32,6 +30,7 @@
* Written by Holger Waechtler <holger@akaflieg.extern.tu-berlin.de>
*
* Cleaned up and simplified by Gareth Hughes <gareth@valinux.com>
+ *
*/
/*
@@ -43,139 +42,105 @@
#include "matypes.h"
#include "common_x86_features.h"
+ SEG_TEXT
-/* Intel vendor string
- */
-#define GENU 0x756e6547 /* "Genu" */
-#define INEI 0x49656e69 /* "ineI" */
-#define NTEL 0x6c65746e /* "ntel" */
+ALIGNTEXT4
+GLOBL GLNAME(_mesa_x86_has_cpuid)
+GLNAME(_mesa_x86_has_cpuid):
-/* AMD vendor string
- */
-#define AUTH 0x68747541 /* "Auth" */
-#define ENTI 0x69746e65 /* "enti" */
-#define CAMD 0x444d4163 /* "cAMD" */
+ /* Test for the CPUID command. If the ID Flag bit in EFLAGS
+ * (bit 21) is writable, the CPUID command is present */
+ PUSHF_L
+ POP_L (EAX)
+ MOV_L (EAX, ECX)
+ XOR_L (CONST(0x00200000), EAX)
+ PUSH_L (EAX)
+ POPF_L
+ PUSHF_L
+ POP_L (EAX)
+ /* Verify the ID Flag bit has been written. */
+ CMP_L (ECX, EAX)
+ SETNE (AL)
+ XOR_L (CONST(0xff), EAX)
- SEG_DATA
+ RET
-/* We might want to print out some useful messages.
- */
-GLNAME( found_intel ): STRING( "Genuine Intel processor found\n\0" )
-GLNAME( found_amd ): STRING( "Authentic AMD processor found\n\0" )
-#ifdef USE_SSE_ASM
-GLNAME( sse_test_dummy ):
- D_LONG 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000
-#endif
+ALIGNTEXT4
+GLOBL GLNAME(_mesa_x86_cpuid)
+GLNAME(_mesa_x86_cpuid):
+ MOV_L (REGOFF(4, ESP), EAX) /* cpuid op */
+ PUSH_L (EDI)
+ PUSH_L (EBX)
- SEG_TEXT
+ CPUID
+
+ MOV_L (REGOFF(16, ESP), EDI) /* *eax */
+ MOV_L (EAX, REGIND(EDI))
+ MOV_L (REGOFF(20, ESP), EDI) /* *ebx */
+ MOV_L (EBX, REGIND(EDI))
+ MOV_L (REGOFF(24, ESP), EDI) /* *ecx */
+ MOV_L (ECX, REGIND(EDI))
+ MOV_L (REGOFF(28, ESP), EDI) /* *edx */
+ MOV_L (EDX, REGIND(EDI))
+
+ POP_L (EBX)
+ POP_L (EDI)
+ RET
ALIGNTEXT4
-GLOBL GLNAME( _mesa_identify_x86_cpu_features )
-GLNAME( _mesa_identify_x86_cpu_features ):
+GLOBL GLNAME(_mesa_x86_cpuid_eax)
+GLNAME(_mesa_x86_cpuid_eax):
- PUSH_L ( EBX )
+ MOV_L (REGOFF(4, ESP), EAX) /* cpuid op */
+ PUSH_L (EBX)
- /* Test for the CPUID command. If the ID Flag bit in EFLAGS
- * (bit 21) is writable, the CPUID command is present.
- */
- PUSHF_L
- POP_L ( EAX )
- MOV_L ( EAX, ECX )
- XOR_L ( CONST(0x00200000), EAX )
- PUSH_L ( EAX )
- POPF_L
- PUSHF_L
- POP_L ( EAX )
+ CPUID
- /* Verify the ID Flag bit has been written.
- */
- CMP_L ( ECX, EAX )
- JZ ( LLBL (cpuid_done) )
+ POP_L (EBX)
+ RET
- /* Get the CPU vendor info.
- */
- XOR_L ( EAX, EAX )
- CPUID
+ALIGNTEXT4
+GLOBL GLNAME(_mesa_x86_cpuid_ebx)
+GLNAME(_mesa_x86_cpuid_ebx):
+
+ MOV_L (REGOFF(4, ESP), EAX) /* cpuid op */
+ PUSH_L (EBX)
- /* Test for Intel processors. We must look for the
- * "GenuineIntel" string in EBX, ECX and EDX.
- */
- CMP_L ( CONST(GENU), EBX )
- JNE ( LLBL(cpuid_amd) )
- CMP_L ( CONST(INEI), EDX )
- JNE ( LLBL(cpuid_amd) )
- CMP_L ( CONST(NTEL), ECX )
- JNE ( LLBL(cpuid_amd) )
-
- /* We have an Intel processor, so we can get the feature
- * information with an CPUID input value of 1.
- */
- MOV_L ( CONST(0x1), EAX )
CPUID
- MOV_L ( EDX, EAX )
- JMP ( LLBL(cpuid_done) )
+ MOV_L (EBX, EAX) /* return EBX */
-LLBL(cpuid_amd):
+ POP_L (EBX)
+ RET
- /* Test for AMD processors. We must look for the
- * "AuthenticAMD" string in EBX, ECX and EDX.
- */
- CMP_L ( CONST(AUTH), EBX )
- JNE ( LLBL(cpuid_other) )
- CMP_L ( CONST(ENTI), EDX )
- JNE ( LLBL(cpuid_other) )
- CMP_L ( CONST(CAMD), ECX )
- JNE ( LLBL(cpuid_other) )
-
- /* We have an AMD processor, so we can get the feature
- * information after we verify that the extended functions are
- * supported.
- */
- /* The features we need are almost all in the extended set. The
- * exception is SSE enable, which is in the standard set (0x1).
- */
- MOV_L ( CONST(0x1), EAX )
- CPUID
- TEST_L ( EAX, EAX )
- JZ ( LLBL (cpuid_failed) )
- MOV_L ( EDX, ESI )
+ALIGNTEXT4
+GLOBL GLNAME(_mesa_x86_cpuid_ecx)
+GLNAME(_mesa_x86_cpuid_ecx):
- MOV_L ( CONST(0x80000000), EAX )
- CPUID
- TEST_L ( EAX, EAX )
- JZ ( LLBL (cpuid_failed) )
+ MOV_L (REGOFF(4, ESP), EAX) /* cpuid op */
+ PUSH_L (EBX)
- MOV_L ( CONST(0x80000001), EAX )
CPUID
- MOV_L ( EDX, EAX )
-
- AND_L ( CONST(0x02000000), ESI ) /* OR in the SSE bit */
- OR_L ( ESI, EAX )
-
- JMP ( LLBL (cpuid_done) )
-
-LLBL(cpuid_other):
+ MOV_L (ECX, EAX) /* return ECX */
- /* Test for other processors here when required.
- */
+ POP_L (EBX)
+ RET
-LLBL(cpuid_failed):
+ALIGNTEXT4
+GLOBL GLNAME(_mesa_x86_cpuid_edx)
+GLNAME(_mesa_x86_cpuid_edx):
- /* If we can't determine the feature information, we must
- * return zero to indicate that no platform-specific
- * optimizations can be used.
- */
- MOV_L ( CONST(0), EAX )
+ MOV_L (REGOFF(4, ESP), EAX) /* cpuid op */
+ PUSH_L (EBX)
-LLBL (cpuid_done):
+ CPUID
+ MOV_L (EDX, EAX) /* return EDX */
- POP_L ( EBX )
+ POP_L (EBX)
RET
-
#ifdef USE_SSE_ASM
/* Execute an SSE instruction to see if the operating system correctly
* supports SSE. A signal handler for SIGILL should have been set
@@ -215,7 +180,13 @@ GLNAME( _mesa_test_os_sse_exception_support ):
LDMXCSR ( REGOFF( -8, EBP ) )
XORPS ( XMM0, XMM0 )
- MOVUPS ( CONTENT( GLNAME( sse_test_dummy ) ), XMM1 )
+
+ PUSH_L ( CONST( 0x3f800000 ) )
+ PUSH_L ( CONST( 0x3f800000 ) )
+ PUSH_L ( CONST( 0x3f800000 ) )
+ PUSH_L ( CONST( 0x3f800000 ) )
+
+ MOVUPS ( REGIND( ESP ), XMM1 )
DIVPS ( XMM0, XMM1 )
@@ -227,3 +198,4 @@ GLNAME( _mesa_test_os_sse_exception_support ):
RET
#endif
+
diff --git a/xc/extras/Mesa/src/X86/common_x86_asm.h b/xc/extras/Mesa/src/X86/common_x86_asm.h
index 38096eced..46d1a4b07 100644
--- a/xc/extras/Mesa/src/X86/common_x86_asm.h
+++ b/xc/extras/Mesa/src/X86/common_x86_asm.h
@@ -31,7 +31,7 @@
* Changed by Andre Werthmann <wertmann@cs.uni-potsdam.de> for using the
* new Katmai functions
*
- * Reimplemented by Gareth Hughes <gareth@valinux.com> in a more
+ * Reimplemented by Gareth Hughes in a more
* future-proof manner, based on code in the Linux kernel.
*/
@@ -59,6 +59,5 @@
extern int _mesa_x86_cpu_features;
extern void _mesa_init_all_x86_transform_asm( void );
-extern void _mesa_init_all_x86_vertex_asm( void );
#endif
diff --git a/xc/extras/Mesa/src/X86/common_x86_features.h b/xc/extras/Mesa/src/X86/common_x86_features.h
index f82c92674..1820e67c3 100644
--- a/xc/extras/Mesa/src/X86/common_x86_features.h
+++ b/xc/extras/Mesa/src/X86/common_x86_features.h
@@ -1,7 +1,6 @@
-
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 5.1
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
@@ -28,46 +27,33 @@
* _mesa_identify_x86_cpu_features() and interpreted with the cpu_has_*
* helper macros.
*
- * Gareth Hughes <gareth@valinux.com>
+ * Gareth Hughes
*/
#ifndef __COMMON_X86_FEATURES_H__
#define __COMMON_X86_FEATURES_H__
-/* Capabilities of CPUs
- */
-#define X86_FEATURE_FPU 0x00000001
-#define X86_FEATURE_VME 0x00000002
-#define X86_FEATURE_DE 0x00000004
-#define X86_FEATURE_PSE 0x00000008
-#define X86_FEATURE_TSC 0x00000010
-#define X86_FEATURE_MSR 0x00000020
-#define X86_FEATURE_PAE 0x00000040
-#define X86_FEATURE_MCE 0x00000080
-#define X86_FEATURE_CX8 0x00000100
-#define X86_FEATURE_APIC 0x00000200
-#define X86_FEATURE_10 0x00000400
-#define X86_FEATURE_SEP 0x00000800
-#define X86_FEATURE_MTRR 0x00001000
-#define X86_FEATURE_PGE 0x00002000
-#define X86_FEATURE_MCA 0x00004000
-#define X86_FEATURE_CMOV 0x00008000
-#define X86_FEATURE_PAT 0x00010000
-#define X86_FEATURE_PSE36 0x00020000
-#define X86_FEATURE_18 0x00040000
-#define X86_FEATURE_19 0x00080000
-#define X86_FEATURE_20 0x00100000
-#define X86_FEATURE_21 0x00200000
-#define X86_FEATURE_MMXEXT 0x00400000
-#define X86_FEATURE_MMX 0x00800000
-#define X86_FEATURE_FXSR 0x01000000
-#define X86_FEATURE_XMM 0x02000000
-#define X86_FEATURE_XMM2 0x04000000
-#define X86_FEATURE_27 0x08000000
-#define X86_FEATURE_28 0x10000000
-#define X86_FEATURE_29 0x20000000
-#define X86_FEATURE_3DNOWEXT 0x40000000
-#define X86_FEATURE_3DNOW 0x80000000
+#define X86_FEATURE_FPU (1<<0)
+#define X86_FEATURE_CMOV (1<<1)
+#define X86_FEATURE_MMXEXT (1<<2)
+#define X86_FEATURE_MMX (1<<3)
+#define X86_FEATURE_FXSR (1<<4)
+#define X86_FEATURE_XMM (1<<5)
+#define X86_FEATURE_XMM2 (1<<6)
+#define X86_FEATURE_3DNOWEXT (1<<7)
+#define X86_FEATURE_3DNOW (1<<8)
+
+/* standard X86 CPU features */
+#define X86_CPU_FPU (1<<0)
+#define X86_CPU_CMOV (1<<15)
+#define X86_CPU_MMX (1<<23)
+#define X86_CPU_XMM (1<<25)
+#define X86_CPU_XMM2 (1<<26)
+
+/* extended X86 CPU features */
+#define X86_CPUEXT_MMX_EXT (1<<22)
+#define X86_CPUEXT_3DNOW_EXT (1<<30)
+#define X86_CPUEXT_3DNOW (1<<31)
#define cpu_has_mmx (_mesa_x86_cpu_features & X86_FEATURE_MMX)
#define cpu_has_mmxext (_mesa_x86_cpu_features & X86_FEATURE_MMXEXT)
@@ -77,3 +63,4 @@
#define cpu_has_3dnowext (_mesa_x86_cpu_features & X86_FEATURE_3DNOWEXT)
#endif
+
diff --git a/xc/extras/Mesa/src/X86/common_x86_macros.h b/xc/extras/Mesa/src/X86/common_x86_macros.h
index 05574e539..462f32b3f 100644
--- a/xc/extras/Mesa/src/X86/common_x86_macros.h
+++ b/xc/extras/Mesa/src/X86/common_x86_macros.h
@@ -1,4 +1,3 @@
-/* $Id: common_x86_macros.h,v 1.1.1.1 2002/10/22 13:06:16 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Gareth Hughes <gareth@valinux.com>
+ * Gareth Hughes
*/
#ifndef __COMMON_X86_MACROS_H__
@@ -71,9 +70,9 @@ extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d( XFORM_ARGS );
#define NORM_ARGS const GLmatrix *mat, \
GLfloat scale, \
- const GLvector3f *in, \
+ const GLvector4f *in, \
const GLfloat *lengths, \
- GLvector3f *dest
+ GLvector4f *dest
#define DECLARE_NORM_GROUP( pfx ) \
extern void _ASMAPI _mesa_##pfx##_rescale_normals( NORM_ARGS ); \
diff --git a/xc/extras/Mesa/src/X86/gen_matypes.c b/xc/extras/Mesa/src/X86/gen_matypes.c
index c983fdd5f..8682f33c8 100644
--- a/xc/extras/Mesa/src/X86/gen_matypes.c
+++ b/xc/extras/Mesa/src/X86/gen_matypes.c
@@ -1,10 +1,9 @@
-/* $Id: gen_matypes.c,v 1.1.1.1 2002/10/22 13:06:08 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Gareth Hughes <gareth@valinux.com>
+ * Gareth Hughes
*/
/*
@@ -34,13 +33,10 @@
* Mesa, including lighting, clipping, texture image conversion etc.
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "mtypes.h"
#include "tnl/t_context.h"
-#endif
+
#undef offsetof
#define offsetof( type, member ) ((size_t) &((type *)0)->member)
@@ -66,11 +62,21 @@ do { \
printf( "\n" ); \
} while (0)
+#if defined(__BEOS__)
+#define OFFSET( s, t, m ) \
+ printf( "#define %s\t%ld\n", s, offsetof( t, m ) );
+#else
#define OFFSET( s, t, m ) \
printf( "#define %s\t%d\n", s, offsetof( t, m ) );
+#endif
+#if defined(__BEOS__)
+#define SIZEOF( s, t ) \
+ printf( "#define %s\t%ld\n", s, sizeof(t) );
+#else
#define SIZEOF( s, t ) \
printf( "#define %s\t%d\n", s, sizeof(t) );
+#endif
#define DEFINE( s, d ) \
printf( "#define %s\t0x%x\n", s, d );
@@ -122,7 +128,7 @@ int main( int argc, char **argv )
OFFSET( "VB_OBJ_PTR ", struct vertex_buffer, ObjPtr );
OFFSET( "VB_EYE_PTR ", struct vertex_buffer, EyePtr );
OFFSET( "VB_CLIP_PTR ", struct vertex_buffer, ClipPtr );
- OFFSET( "VB_PROJ_CLIP_PTR ", struct vertex_buffer, ProjectedClipPtr );
+ OFFSET( "VB_PROJ_CLIP_PTR ", struct vertex_buffer, NdcPtr );
OFFSET( "VB_CLIP_OR_MASK ", struct vertex_buffer, ClipOrMask );
OFFSET( "VB_CLIP_MASK ", struct vertex_buffer, ClipMask );
OFFSET( "VB_NORMAL_PTR ", struct vertex_buffer, NormalPtr );
@@ -148,34 +154,35 @@ int main( int argc, char **argv )
DEFINE_HEADER( "struct vertex_buffer" );
- DEFINE( "VERT_OBJ ", VERT_OBJ );
- DEFINE( "VERT_RGBA ", VERT_RGBA );
- DEFINE( "VERT_NORM ", VERT_NORM );
- DEFINE( "VERT_INDEX ", VERT_INDEX );
- DEFINE( "VERT_EDGE ", VERT_EDGE );
- DEFINE( "VERT_SPEC_RGB ", VERT_SPEC_RGB );
- DEFINE( "VERT_FOG_COORD ", VERT_FOG_COORD );
- DEFINE( "VERT_TEX0 ", VERT_TEX0 );
- DEFINE( "VERT_TEX1 ", VERT_TEX1 );
- DEFINE( "VERT_TEX2 ", VERT_TEX2 );
- DEFINE( "VERT_TEX3 ", VERT_TEX3 );
- DEFINE( "VERT_EVAL_C1 ", VERT_EVAL_C1 );
- DEFINE( "VERT_EVAL_C2 ", VERT_EVAL_C2 );
- DEFINE( "VERT_EVAL_P1 ", VERT_EVAL_P1 );
- DEFINE( "VERT_EVAL_P2 ", VERT_EVAL_P2 );
- DEFINE( "VERT_OBJ_3 ", VERT_OBJ_3 );
- DEFINE( "VERT_OBJ_4 ", VERT_OBJ_4 );
- DEFINE( "VERT_MATERIAL ", VERT_MATERIAL );
- DEFINE( "VERT_ELT ", VERT_ELT );
- DEFINE( "VERT_BEGIN ", VERT_BEGIN );
- DEFINE( "VERT_END ", VERT_END );
- DEFINE( "VERT_END_VB ", VERT_END_VB );
- DEFINE( "VERT_POINT_SIZE ", VERT_POINT_SIZE );
- DEFINE( "VERT_EYE ", VERT_EYE );
- DEFINE( "VERT_CLIP ", VERT_CLIP );
+ /* XXX use new labels here someday after vertex proram is done */
+ DEFINE( "VERT_BIT_OBJ ", VERT_BIT_POS );
+ DEFINE( "VERT_BIT_NORM ", VERT_BIT_NORMAL );
+ DEFINE( "VERT_BIT_RGBA ", VERT_BIT_COLOR0 );
+ DEFINE( "VERT_BIT_SPEC_RGB ", VERT_BIT_COLOR1 );
+ DEFINE( "VERT_BIT_FOG_COORD ", VERT_BIT_FOG );
+ DEFINE( "VERT_BIT_INDEX ", VERT_BIT_INDEX );
+ DEFINE( "VERT_BIT_EDGE ", VERT_BIT_EDGEFLAG );
+ DEFINE( "VERT_BIT_TEX0 ", VERT_BIT_TEX0 );
+ DEFINE( "VERT_BIT_TEX1 ", VERT_BIT_TEX1 );
+ DEFINE( "VERT_BIT_TEX2 ", VERT_BIT_TEX2 );
+ DEFINE( "VERT_BIT_TEX3 ", VERT_BIT_TEX3 );
+ DEFINE( "VERT_BIT_EVAL_C1 ", VERT_BIT_EVAL_C1 );
+ DEFINE( "VERT_BIT_EVAL_C2 ", VERT_BIT_EVAL_C2 );
+ DEFINE( "VERT_BIT_EVAL_P1 ", VERT_BIT_EVAL_P1 );
+ DEFINE( "VERT_BIT_EVAL_P2 ", VERT_BIT_EVAL_P2 );
+ DEFINE( "VERT_BIT_OBJ_3 ", VERT_BIT_OBJ_3 );
+ DEFINE( "VERT_BIT_OBJ_4 ", VERT_BIT_OBJ_4 );
+ DEFINE( "VERT_BIT_MATERIAL ", VERT_BIT_MATERIAL );
+ DEFINE( "VERT_BIT_ELT ", VERT_BIT_ELT );
+ DEFINE( "VERT_BIT_BEGIN ", VERT_BIT_BEGIN );
+ DEFINE( "VERT_BIT_END ", VERT_BIT_END );
+ DEFINE( "VERT_BIT_END_VB ", VERT_BIT_END_VB );
+ DEFINE( "VERT_BIT_POINT_SIZE ", VERT_BIT_POINT_SIZE );
+ DEFINE( "VERT_BIT_EYE ", VERT_BIT_EYE );
+ DEFINE( "VERT_BIT_CLIP ", VERT_BIT_CLIP );
printf( "\n" );
- DEFINE( "VERT_OBJ_23 ", VERT_OBJ_3 );
- DEFINE( "VERT_OBJ_234 ", VERT_OBJ_4 );
+ DEFINE( "VERT_BIT_OBJ_23 ", VERT_BIT_OBJ_3 );
+ DEFINE( "VERT_BIT_OBJ_234 ", VERT_BIT_OBJ_4 );
/* GLvector3f offsets:
diff --git a/xc/extras/Mesa/src/X86/glapi_x86.S b/xc/extras/Mesa/src/X86/glapi_x86.S
index 5d1fbc168..57dd296c7 100644
--- a/xc/extras/Mesa/src/X86/glapi_x86.S
+++ b/xc/extras/Mesa/src/X86/glapi_x86.S
@@ -19,4003 +19,4843 @@
#endif
+EXTERN GLNAME(_glapi_Dispatch)
+
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(NewList))
GL_PREFIX(NewList):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_NewList))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(EndList))
GL_PREFIX(EndList):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_EndList))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CallList))
GL_PREFIX(CallList):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CallList))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CallLists))
GL_PREFIX(CallLists):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CallLists))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(DeleteLists))
GL_PREFIX(DeleteLists):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_DeleteLists))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GenLists))
GL_PREFIX(GenLists):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GenLists))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ListBase))
GL_PREFIX(ListBase):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ListBase))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Begin))
GL_PREFIX(Begin):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Begin))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Bitmap))
GL_PREFIX(Bitmap):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Bitmap))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color3b))
GL_PREFIX(Color3b):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color3b))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color3bv))
GL_PREFIX(Color3bv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color3bv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color3d))
GL_PREFIX(Color3d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color3d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color3dv))
GL_PREFIX(Color3dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color3dv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color3f))
GL_PREFIX(Color3f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color3f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color3fv))
GL_PREFIX(Color3fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color3fv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color3i))
GL_PREFIX(Color3i):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color3i))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color3iv))
GL_PREFIX(Color3iv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color3iv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color3s))
GL_PREFIX(Color3s):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color3s))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color3sv))
GL_PREFIX(Color3sv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color3sv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color3ub))
GL_PREFIX(Color3ub):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color3ub))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color3ubv))
GL_PREFIX(Color3ubv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color3ubv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color3ui))
GL_PREFIX(Color3ui):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color3ui))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color3uiv))
GL_PREFIX(Color3uiv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color3uiv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color3us))
GL_PREFIX(Color3us):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color3us))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color3usv))
GL_PREFIX(Color3usv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color3usv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color4b))
GL_PREFIX(Color4b):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color4b))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color4bv))
GL_PREFIX(Color4bv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color4bv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color4d))
GL_PREFIX(Color4d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color4d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color4dv))
GL_PREFIX(Color4dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color4dv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color4f))
GL_PREFIX(Color4f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color4f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color4fv))
GL_PREFIX(Color4fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color4fv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color4i))
GL_PREFIX(Color4i):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color4i))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color4iv))
GL_PREFIX(Color4iv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color4iv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color4s))
GL_PREFIX(Color4s):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color4s))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color4sv))
GL_PREFIX(Color4sv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color4sv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color4ub))
GL_PREFIX(Color4ub):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color4ub))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color4ubv))
GL_PREFIX(Color4ubv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color4ubv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color4ui))
GL_PREFIX(Color4ui):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color4ui))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color4uiv))
GL_PREFIX(Color4uiv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color4uiv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color4us))
GL_PREFIX(Color4us):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color4us))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Color4usv))
GL_PREFIX(Color4usv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Color4usv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(EdgeFlag))
GL_PREFIX(EdgeFlag):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_EdgeFlag))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(EdgeFlagv))
GL_PREFIX(EdgeFlagv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_EdgeFlagv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(End))
GL_PREFIX(End):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_End))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Indexd))
GL_PREFIX(Indexd):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Indexd))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Indexdv))
GL_PREFIX(Indexdv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Indexdv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Indexf))
GL_PREFIX(Indexf):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Indexf))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Indexfv))
GL_PREFIX(Indexfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Indexfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Indexi))
GL_PREFIX(Indexi):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Indexi))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Indexiv))
GL_PREFIX(Indexiv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Indexiv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Indexs))
GL_PREFIX(Indexs):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Indexs))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Indexsv))
GL_PREFIX(Indexsv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Indexsv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Normal3b))
GL_PREFIX(Normal3b):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Normal3b))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Normal3bv))
GL_PREFIX(Normal3bv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Normal3bv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Normal3d))
GL_PREFIX(Normal3d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Normal3d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Normal3dv))
GL_PREFIX(Normal3dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Normal3dv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Normal3f))
GL_PREFIX(Normal3f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Normal3f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Normal3fv))
GL_PREFIX(Normal3fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Normal3fv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Normal3i))
GL_PREFIX(Normal3i):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Normal3i))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Normal3iv))
GL_PREFIX(Normal3iv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Normal3iv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Normal3s))
GL_PREFIX(Normal3s):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Normal3s))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Normal3sv))
GL_PREFIX(Normal3sv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Normal3sv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos2d))
GL_PREFIX(RasterPos2d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos2d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos2dv))
GL_PREFIX(RasterPos2dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos2dv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos2f))
GL_PREFIX(RasterPos2f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos2f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos2fv))
GL_PREFIX(RasterPos2fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos2fv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos2i))
GL_PREFIX(RasterPos2i):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos2i))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos2iv))
GL_PREFIX(RasterPos2iv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos2iv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos2s))
GL_PREFIX(RasterPos2s):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos2s))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos2sv))
GL_PREFIX(RasterPos2sv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos2sv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos3d))
GL_PREFIX(RasterPos3d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos3d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos3dv))
GL_PREFIX(RasterPos3dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos3dv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos3f))
GL_PREFIX(RasterPos3f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos3f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos3fv))
GL_PREFIX(RasterPos3fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos3fv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos3i))
GL_PREFIX(RasterPos3i):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos3i))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos3iv))
GL_PREFIX(RasterPos3iv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos3iv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos3s))
GL_PREFIX(RasterPos3s):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos3s))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos3sv))
GL_PREFIX(RasterPos3sv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos3sv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos4d))
GL_PREFIX(RasterPos4d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos4d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos4dv))
GL_PREFIX(RasterPos4dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos4dv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos4f))
GL_PREFIX(RasterPos4f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos4f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos4fv))
GL_PREFIX(RasterPos4fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos4fv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos4i))
GL_PREFIX(RasterPos4i):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos4i))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos4iv))
GL_PREFIX(RasterPos4iv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos4iv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos4s))
GL_PREFIX(RasterPos4s):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos4s))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RasterPos4sv))
GL_PREFIX(RasterPos4sv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RasterPos4sv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Rectd))
GL_PREFIX(Rectd):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Rectd))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Rectdv))
GL_PREFIX(Rectdv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Rectdv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Rectf))
GL_PREFIX(Rectf):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Rectf))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Rectfv))
GL_PREFIX(Rectfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Rectfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Recti))
GL_PREFIX(Recti):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Recti))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Rectiv))
GL_PREFIX(Rectiv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Rectiv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Rects))
GL_PREFIX(Rects):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Rects))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Rectsv))
GL_PREFIX(Rectsv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Rectsv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord1d))
GL_PREFIX(TexCoord1d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord1d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord1dv))
GL_PREFIX(TexCoord1dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord1dv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord1f))
GL_PREFIX(TexCoord1f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord1f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord1fv))
GL_PREFIX(TexCoord1fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord1fv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord1i))
GL_PREFIX(TexCoord1i):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord1i))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord1iv))
GL_PREFIX(TexCoord1iv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord1iv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord1s))
GL_PREFIX(TexCoord1s):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord1s))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord1sv))
GL_PREFIX(TexCoord1sv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord1sv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord2d))
GL_PREFIX(TexCoord2d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord2d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord2dv))
GL_PREFIX(TexCoord2dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord2dv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord2f))
GL_PREFIX(TexCoord2f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord2f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord2fv))
GL_PREFIX(TexCoord2fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord2fv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord2i))
GL_PREFIX(TexCoord2i):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord2i))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord2iv))
GL_PREFIX(TexCoord2iv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord2iv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord2s))
GL_PREFIX(TexCoord2s):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord2s))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord2sv))
GL_PREFIX(TexCoord2sv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord2sv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord3d))
GL_PREFIX(TexCoord3d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord3d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord3dv))
GL_PREFIX(TexCoord3dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord3dv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord3f))
GL_PREFIX(TexCoord3f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord3f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord3fv))
GL_PREFIX(TexCoord3fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord3fv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord3i))
GL_PREFIX(TexCoord3i):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord3i))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord3iv))
GL_PREFIX(TexCoord3iv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord3iv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord3s))
GL_PREFIX(TexCoord3s):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord3s))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord3sv))
GL_PREFIX(TexCoord3sv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord3sv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord4d))
GL_PREFIX(TexCoord4d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord4d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord4dv))
GL_PREFIX(TexCoord4dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord4dv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord4f))
GL_PREFIX(TexCoord4f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord4f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord4fv))
GL_PREFIX(TexCoord4fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord4fv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord4i))
GL_PREFIX(TexCoord4i):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord4i))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord4iv))
GL_PREFIX(TexCoord4iv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord4iv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord4s))
GL_PREFIX(TexCoord4s):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord4s))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoord4sv))
GL_PREFIX(TexCoord4sv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoord4sv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex2d))
GL_PREFIX(Vertex2d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex2d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex2dv))
GL_PREFIX(Vertex2dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex2dv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex2f))
GL_PREFIX(Vertex2f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex2f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex2fv))
GL_PREFIX(Vertex2fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex2fv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex2i))
GL_PREFIX(Vertex2i):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex2i))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex2iv))
GL_PREFIX(Vertex2iv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex2iv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex2s))
GL_PREFIX(Vertex2s):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex2s))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex2sv))
GL_PREFIX(Vertex2sv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex2sv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex3d))
GL_PREFIX(Vertex3d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex3d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex3dv))
GL_PREFIX(Vertex3dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex3dv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex3f))
GL_PREFIX(Vertex3f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex3f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex3fv))
GL_PREFIX(Vertex3fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex3fv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex3i))
GL_PREFIX(Vertex3i):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex3i))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex3iv))
GL_PREFIX(Vertex3iv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex3iv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex3s))
GL_PREFIX(Vertex3s):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex3s))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex3sv))
GL_PREFIX(Vertex3sv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex3sv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex4d))
GL_PREFIX(Vertex4d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex4d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex4dv))
GL_PREFIX(Vertex4dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex4dv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex4f))
GL_PREFIX(Vertex4f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex4f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex4fv))
GL_PREFIX(Vertex4fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex4fv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex4i))
GL_PREFIX(Vertex4i):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex4i))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex4iv))
GL_PREFIX(Vertex4iv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex4iv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex4s))
GL_PREFIX(Vertex4s):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex4s))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Vertex4sv))
GL_PREFIX(Vertex4sv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Vertex4sv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ClipPlane))
GL_PREFIX(ClipPlane):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ClipPlane))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ColorMaterial))
GL_PREFIX(ColorMaterial):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ColorMaterial))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CullFace))
GL_PREFIX(CullFace):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CullFace))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Fogf))
GL_PREFIX(Fogf):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Fogf))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Fogfv))
GL_PREFIX(Fogfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Fogfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Fogi))
GL_PREFIX(Fogi):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Fogi))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Fogiv))
GL_PREFIX(Fogiv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Fogiv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FrontFace))
GL_PREFIX(FrontFace):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FrontFace))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Hint))
GL_PREFIX(Hint):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Hint))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Lightf))
GL_PREFIX(Lightf):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Lightf))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Lightfv))
GL_PREFIX(Lightfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Lightfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Lighti))
GL_PREFIX(Lighti):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Lighti))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Lightiv))
GL_PREFIX(Lightiv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Lightiv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(LightModelf))
GL_PREFIX(LightModelf):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_LightModelf))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(LightModelfv))
GL_PREFIX(LightModelfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_LightModelfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(LightModeli))
GL_PREFIX(LightModeli):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_LightModeli))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(LightModeliv))
GL_PREFIX(LightModeliv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_LightModeliv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(LineStipple))
GL_PREFIX(LineStipple):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_LineStipple))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(LineWidth))
GL_PREFIX(LineWidth):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_LineWidth))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Materialf))
GL_PREFIX(Materialf):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Materialf))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Materialfv))
GL_PREFIX(Materialfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Materialfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Materiali))
GL_PREFIX(Materiali):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Materiali))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Materialiv))
GL_PREFIX(Materialiv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Materialiv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PointSize))
GL_PREFIX(PointSize):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PointSize))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PolygonMode))
GL_PREFIX(PolygonMode):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PolygonMode))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PolygonStipple))
GL_PREFIX(PolygonStipple):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PolygonStipple))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Scissor))
GL_PREFIX(Scissor):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Scissor))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ShadeModel))
GL_PREFIX(ShadeModel):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ShadeModel))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexParameterf))
GL_PREFIX(TexParameterf):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexParameterf))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexParameterfv))
GL_PREFIX(TexParameterfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexParameterfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexParameteri))
GL_PREFIX(TexParameteri):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexParameteri))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexParameteriv))
GL_PREFIX(TexParameteriv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexParameteriv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexImage1D))
GL_PREFIX(TexImage1D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexImage1D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexImage2D))
GL_PREFIX(TexImage2D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexImage2D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexEnvf))
GL_PREFIX(TexEnvf):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexEnvf))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexEnvfv))
GL_PREFIX(TexEnvfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexEnvfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexEnvi))
GL_PREFIX(TexEnvi):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexEnvi))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexEnviv))
GL_PREFIX(TexEnviv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexEnviv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexGend))
GL_PREFIX(TexGend):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexGend))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexGendv))
GL_PREFIX(TexGendv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexGendv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexGenf))
GL_PREFIX(TexGenf):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexGenf))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexGenfv))
GL_PREFIX(TexGenfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexGenfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexGeni))
GL_PREFIX(TexGeni):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexGeni))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexGeniv))
GL_PREFIX(TexGeniv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexGeniv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FeedbackBuffer))
GL_PREFIX(FeedbackBuffer):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FeedbackBuffer))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SelectBuffer))
GL_PREFIX(SelectBuffer):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SelectBuffer))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RenderMode))
GL_PREFIX(RenderMode):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_RenderMode))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(InitNames))
GL_PREFIX(InitNames):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_InitNames))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(LoadName))
GL_PREFIX(LoadName):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_LoadName))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PassThrough))
GL_PREFIX(PassThrough):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PassThrough))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PopName))
GL_PREFIX(PopName):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PopName))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PushName))
GL_PREFIX(PushName):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PushName))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(DrawBuffer))
GL_PREFIX(DrawBuffer):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_DrawBuffer))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Clear))
GL_PREFIX(Clear):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Clear))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ClearAccum))
GL_PREFIX(ClearAccum):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ClearAccum))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ClearIndex))
GL_PREFIX(ClearIndex):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ClearIndex))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ClearColor))
GL_PREFIX(ClearColor):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ClearColor))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ClearStencil))
GL_PREFIX(ClearStencil):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ClearStencil))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ClearDepth))
GL_PREFIX(ClearDepth):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ClearDepth))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(StencilMask))
GL_PREFIX(StencilMask):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_StencilMask))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ColorMask))
GL_PREFIX(ColorMask):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ColorMask))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(DepthMask))
GL_PREFIX(DepthMask):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_DepthMask))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(IndexMask))
GL_PREFIX(IndexMask):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_IndexMask))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Accum))
GL_PREFIX(Accum):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Accum))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Disable))
GL_PREFIX(Disable):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Disable))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Enable))
GL_PREFIX(Enable):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Enable))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Finish))
GL_PREFIX(Finish):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Finish))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Flush))
GL_PREFIX(Flush):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Flush))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PopAttrib))
GL_PREFIX(PopAttrib):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PopAttrib))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PushAttrib))
GL_PREFIX(PushAttrib):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PushAttrib))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Map1d))
GL_PREFIX(Map1d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Map1d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Map1f))
GL_PREFIX(Map1f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Map1f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Map2d))
GL_PREFIX(Map2d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Map2d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Map2f))
GL_PREFIX(Map2f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Map2f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MapGrid1d))
GL_PREFIX(MapGrid1d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MapGrid1d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MapGrid1f))
GL_PREFIX(MapGrid1f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MapGrid1f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MapGrid2d))
GL_PREFIX(MapGrid2d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MapGrid2d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MapGrid2f))
GL_PREFIX(MapGrid2f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MapGrid2f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(EvalCoord1d))
GL_PREFIX(EvalCoord1d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_EvalCoord1d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(EvalCoord1dv))
GL_PREFIX(EvalCoord1dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_EvalCoord1dv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(EvalCoord1f))
GL_PREFIX(EvalCoord1f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_EvalCoord1f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(EvalCoord1fv))
GL_PREFIX(EvalCoord1fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_EvalCoord1fv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(EvalCoord2d))
GL_PREFIX(EvalCoord2d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_EvalCoord2d))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(EvalCoord2dv))
GL_PREFIX(EvalCoord2dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_EvalCoord2dv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(EvalCoord2f))
GL_PREFIX(EvalCoord2f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_EvalCoord2f))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(EvalCoord2fv))
GL_PREFIX(EvalCoord2fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_EvalCoord2fv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(EvalMesh1))
GL_PREFIX(EvalMesh1):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_EvalMesh1))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(EvalPoint1))
GL_PREFIX(EvalPoint1):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_EvalPoint1))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(EvalMesh2))
GL_PREFIX(EvalMesh2):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_EvalMesh2))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(EvalPoint2))
GL_PREFIX(EvalPoint2):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_EvalPoint2))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(AlphaFunc))
GL_PREFIX(AlphaFunc):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_AlphaFunc))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(BlendFunc))
GL_PREFIX(BlendFunc):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_BlendFunc))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(LogicOp))
GL_PREFIX(LogicOp):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_LogicOp))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(StencilFunc))
GL_PREFIX(StencilFunc):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_StencilFunc))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(StencilOp))
GL_PREFIX(StencilOp):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_StencilOp))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(DepthFunc))
GL_PREFIX(DepthFunc):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_DepthFunc))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PixelZoom))
GL_PREFIX(PixelZoom):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PixelZoom))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PixelTransferf))
GL_PREFIX(PixelTransferf):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PixelTransferf))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PixelTransferi))
GL_PREFIX(PixelTransferi):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PixelTransferi))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PixelStoref))
GL_PREFIX(PixelStoref):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PixelStoref))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PixelStorei))
GL_PREFIX(PixelStorei):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PixelStorei))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PixelMapfv))
GL_PREFIX(PixelMapfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PixelMapfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PixelMapuiv))
GL_PREFIX(PixelMapuiv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PixelMapuiv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PixelMapusv))
GL_PREFIX(PixelMapusv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PixelMapusv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ReadBuffer))
GL_PREFIX(ReadBuffer):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ReadBuffer))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyPixels))
GL_PREFIX(CopyPixels):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyPixels))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ReadPixels))
GL_PREFIX(ReadPixels):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ReadPixels))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(DrawPixels))
GL_PREFIX(DrawPixels):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_DrawPixels))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetBooleanv))
GL_PREFIX(GetBooleanv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetBooleanv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetClipPlane))
GL_PREFIX(GetClipPlane):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetClipPlane))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetDoublev))
GL_PREFIX(GetDoublev):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetDoublev))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetError))
GL_PREFIX(GetError):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetError))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetFloatv))
GL_PREFIX(GetFloatv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetFloatv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetIntegerv))
GL_PREFIX(GetIntegerv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetIntegerv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetLightfv))
GL_PREFIX(GetLightfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetLightfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetLightiv))
GL_PREFIX(GetLightiv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetLightiv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetMapdv))
GL_PREFIX(GetMapdv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetMapdv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetMapfv))
GL_PREFIX(GetMapfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetMapfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetMapiv))
GL_PREFIX(GetMapiv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetMapiv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetMaterialfv))
GL_PREFIX(GetMaterialfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetMaterialfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetMaterialiv))
GL_PREFIX(GetMaterialiv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetMaterialiv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetPixelMapfv))
GL_PREFIX(GetPixelMapfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetPixelMapfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetPixelMapuiv))
GL_PREFIX(GetPixelMapuiv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetPixelMapuiv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetPixelMapusv))
GL_PREFIX(GetPixelMapusv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetPixelMapusv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetPolygonStipple))
GL_PREFIX(GetPolygonStipple):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetPolygonStipple))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetString))
GL_PREFIX(GetString):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetString))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetTexEnvfv))
GL_PREFIX(GetTexEnvfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetTexEnvfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetTexEnviv))
GL_PREFIX(GetTexEnviv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetTexEnviv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetTexGendv))
GL_PREFIX(GetTexGendv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetTexGendv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetTexGenfv))
GL_PREFIX(GetTexGenfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetTexGenfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetTexGeniv))
GL_PREFIX(GetTexGeniv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetTexGeniv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetTexImage))
GL_PREFIX(GetTexImage):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetTexImage))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetTexParameterfv))
GL_PREFIX(GetTexParameterfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetTexParameterfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetTexParameteriv))
GL_PREFIX(GetTexParameteriv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetTexParameteriv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetTexLevelParameterfv))
GL_PREFIX(GetTexLevelParameterfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetTexLevelParameterfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetTexLevelParameteriv))
GL_PREFIX(GetTexLevelParameteriv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetTexLevelParameteriv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(IsEnabled))
GL_PREFIX(IsEnabled):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_IsEnabled))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(IsList))
GL_PREFIX(IsList):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_IsList))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(DepthRange))
GL_PREFIX(DepthRange):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_DepthRange))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Frustum))
GL_PREFIX(Frustum):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Frustum))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(LoadIdentity))
GL_PREFIX(LoadIdentity):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_LoadIdentity))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(LoadMatrixf))
GL_PREFIX(LoadMatrixf):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_LoadMatrixf))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(LoadMatrixd))
GL_PREFIX(LoadMatrixd):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_LoadMatrixd))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MatrixMode))
GL_PREFIX(MatrixMode):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MatrixMode))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultMatrixf))
GL_PREFIX(MultMatrixf):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultMatrixf))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultMatrixd))
GL_PREFIX(MultMatrixd):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultMatrixd))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Ortho))
GL_PREFIX(Ortho):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Ortho))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PopMatrix))
GL_PREFIX(PopMatrix):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PopMatrix))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PushMatrix))
GL_PREFIX(PushMatrix):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PushMatrix))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Rotated))
GL_PREFIX(Rotated):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Rotated))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Rotatef))
GL_PREFIX(Rotatef):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Rotatef))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Scaled))
GL_PREFIX(Scaled):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Scaled))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Scalef))
GL_PREFIX(Scalef):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Scalef))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Translated))
GL_PREFIX(Translated):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Translated))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Translatef))
GL_PREFIX(Translatef):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Translatef))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Viewport))
GL_PREFIX(Viewport):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Viewport))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ArrayElement))
GL_PREFIX(ArrayElement):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ArrayElement))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ColorPointer))
GL_PREFIX(ColorPointer):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ColorPointer))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(DisableClientState))
GL_PREFIX(DisableClientState):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_DisableClientState))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(DrawArrays))
GL_PREFIX(DrawArrays):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_DrawArrays))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(DrawElements))
GL_PREFIX(DrawElements):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_DrawElements))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(EdgeFlagPointer))
GL_PREFIX(EdgeFlagPointer):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_EdgeFlagPointer))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(EnableClientState))
GL_PREFIX(EnableClientState):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_EnableClientState))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetPointerv))
GL_PREFIX(GetPointerv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetPointerv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(IndexPointer))
GL_PREFIX(IndexPointer):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_IndexPointer))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(InterleavedArrays))
GL_PREFIX(InterleavedArrays):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_InterleavedArrays))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(NormalPointer))
GL_PREFIX(NormalPointer):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_NormalPointer))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoordPointer))
GL_PREFIX(TexCoordPointer):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoordPointer))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexPointer))
GL_PREFIX(VertexPointer):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_VertexPointer))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PolygonOffset))
GL_PREFIX(PolygonOffset):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PolygonOffset))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyTexImage1D))
GL_PREFIX(CopyTexImage1D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyTexImage1D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyTexImage2D))
GL_PREFIX(CopyTexImage2D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyTexImage2D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyTexSubImage1D))
GL_PREFIX(CopyTexSubImage1D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyTexSubImage1D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyTexSubImage2D))
GL_PREFIX(CopyTexSubImage2D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyTexSubImage2D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexSubImage1D))
GL_PREFIX(TexSubImage1D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexSubImage1D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexSubImage2D))
GL_PREFIX(TexSubImage2D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexSubImage2D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(AreTexturesResident))
GL_PREFIX(AreTexturesResident):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_AreTexturesResident))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(BindTexture))
GL_PREFIX(BindTexture):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_BindTexture))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(DeleteTextures))
GL_PREFIX(DeleteTextures):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_DeleteTextures))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GenTextures))
GL_PREFIX(GenTextures):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GenTextures))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(IsTexture))
GL_PREFIX(IsTexture):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_IsTexture))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PrioritizeTextures))
GL_PREFIX(PrioritizeTextures):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PrioritizeTextures))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Indexub))
GL_PREFIX(Indexub):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Indexub))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Indexubv))
GL_PREFIX(Indexubv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Indexubv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PopClientAttrib))
GL_PREFIX(PopClientAttrib):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PopClientAttrib))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PushClientAttrib))
GL_PREFIX(PushClientAttrib):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PushClientAttrib))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(BlendColor))
GL_PREFIX(BlendColor):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_BlendColor))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(BlendEquation))
GL_PREFIX(BlendEquation):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_BlendEquation))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(DrawRangeElements))
GL_PREFIX(DrawRangeElements):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_DrawRangeElements))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ColorTable))
GL_PREFIX(ColorTable):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ColorTable))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ColorTableParameterfv))
GL_PREFIX(ColorTableParameterfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ColorTableParameterfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ColorTableParameteriv))
GL_PREFIX(ColorTableParameteriv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ColorTableParameteriv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyColorTable))
GL_PREFIX(CopyColorTable):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyColorTable))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetColorTable))
GL_PREFIX(GetColorTable):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetColorTable))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetColorTableParameterfv))
GL_PREFIX(GetColorTableParameterfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetColorTableParameterfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetColorTableParameteriv))
GL_PREFIX(GetColorTableParameteriv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetColorTableParameteriv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ColorSubTable))
GL_PREFIX(ColorSubTable):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ColorSubTable))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyColorSubTable))
GL_PREFIX(CopyColorSubTable):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyColorSubTable))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ConvolutionFilter1D))
GL_PREFIX(ConvolutionFilter1D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ConvolutionFilter1D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ConvolutionFilter2D))
GL_PREFIX(ConvolutionFilter2D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ConvolutionFilter2D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ConvolutionParameterf))
GL_PREFIX(ConvolutionParameterf):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ConvolutionParameterf))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ConvolutionParameterfv))
GL_PREFIX(ConvolutionParameterfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ConvolutionParameterfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ConvolutionParameteri))
GL_PREFIX(ConvolutionParameteri):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ConvolutionParameteri))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ConvolutionParameteriv))
GL_PREFIX(ConvolutionParameteriv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ConvolutionParameteriv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyConvolutionFilter1D))
GL_PREFIX(CopyConvolutionFilter1D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyConvolutionFilter1D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyConvolutionFilter2D))
GL_PREFIX(CopyConvolutionFilter2D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyConvolutionFilter2D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetConvolutionFilter))
GL_PREFIX(GetConvolutionFilter):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetConvolutionFilter))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetConvolutionParameterfv))
GL_PREFIX(GetConvolutionParameterfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetConvolutionParameterfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetConvolutionParameteriv))
GL_PREFIX(GetConvolutionParameteriv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetConvolutionParameteriv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetSeparableFilter))
GL_PREFIX(GetSeparableFilter):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetSeparableFilter))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SeparableFilter2D))
GL_PREFIX(SeparableFilter2D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SeparableFilter2D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetHistogram))
GL_PREFIX(GetHistogram):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetHistogram))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetHistogramParameterfv))
GL_PREFIX(GetHistogramParameterfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetHistogramParameterfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetHistogramParameteriv))
GL_PREFIX(GetHistogramParameteriv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetHistogramParameteriv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetMinmax))
GL_PREFIX(GetMinmax):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetMinmax))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetMinmaxParameterfv))
GL_PREFIX(GetMinmaxParameterfv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetMinmaxParameterfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetMinmaxParameteriv))
GL_PREFIX(GetMinmaxParameteriv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetMinmaxParameteriv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Histogram))
GL_PREFIX(Histogram):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Histogram))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(Minmax))
GL_PREFIX(Minmax):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Minmax))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ResetHistogram))
GL_PREFIX(ResetHistogram):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ResetHistogram))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ResetMinmax))
GL_PREFIX(ResetMinmax):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ResetMinmax))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexImage3D))
GL_PREFIX(TexImage3D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexImage3D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexSubImage3D))
GL_PREFIX(TexSubImage3D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexSubImage3D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyTexSubImage3D))
GL_PREFIX(CopyTexSubImage3D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyTexSubImage3D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ActiveTextureARB))
GL_PREFIX(ActiveTextureARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ActiveTextureARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ClientActiveTextureARB))
GL_PREFIX(ClientActiveTextureARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ClientActiveTextureARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord1dARB))
GL_PREFIX(MultiTexCoord1dARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord1dARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord1dvARB))
GL_PREFIX(MultiTexCoord1dvARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord1dvARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord1fARB))
GL_PREFIX(MultiTexCoord1fARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord1fARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord1fvARB))
GL_PREFIX(MultiTexCoord1fvARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord1fvARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord1iARB))
GL_PREFIX(MultiTexCoord1iARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord1iARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord1ivARB))
GL_PREFIX(MultiTexCoord1ivARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord1ivARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord1sARB))
GL_PREFIX(MultiTexCoord1sARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord1sARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord1svARB))
GL_PREFIX(MultiTexCoord1svARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord1svARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord2dARB))
GL_PREFIX(MultiTexCoord2dARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord2dARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord2dvARB))
GL_PREFIX(MultiTexCoord2dvARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord2dvARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord2fARB))
GL_PREFIX(MultiTexCoord2fARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord2fARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord2fvARB))
GL_PREFIX(MultiTexCoord2fvARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord2fvARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord2iARB))
GL_PREFIX(MultiTexCoord2iARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord2iARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord2ivARB))
GL_PREFIX(MultiTexCoord2ivARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord2ivARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord2sARB))
GL_PREFIX(MultiTexCoord2sARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord2sARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord2svARB))
GL_PREFIX(MultiTexCoord2svARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord2svARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord3dARB))
GL_PREFIX(MultiTexCoord3dARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord3dARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord3dvARB))
GL_PREFIX(MultiTexCoord3dvARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord3dvARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord3fARB))
GL_PREFIX(MultiTexCoord3fARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord3fARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord3fvARB))
GL_PREFIX(MultiTexCoord3fvARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord3fvARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord3iARB))
GL_PREFIX(MultiTexCoord3iARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord3iARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord3ivARB))
GL_PREFIX(MultiTexCoord3ivARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord3ivARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord3sARB))
GL_PREFIX(MultiTexCoord3sARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord3sARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord3svARB))
GL_PREFIX(MultiTexCoord3svARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord3svARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord4dARB))
GL_PREFIX(MultiTexCoord4dARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord4dARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord4dvARB))
GL_PREFIX(MultiTexCoord4dvARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord4dvARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord4fARB))
GL_PREFIX(MultiTexCoord4fARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord4fARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord4fvARB))
GL_PREFIX(MultiTexCoord4fvARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord4fvARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord4iARB))
GL_PREFIX(MultiTexCoord4iARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord4iARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord4ivARB))
GL_PREFIX(MultiTexCoord4ivARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord4ivARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord4sARB))
GL_PREFIX(MultiTexCoord4sARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord4sARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultiTexCoord4svARB))
GL_PREFIX(MultiTexCoord4svARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultiTexCoord4svARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(LoadTransposeMatrixfARB))
GL_PREFIX(LoadTransposeMatrixfARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_LoadTransposeMatrixfARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(LoadTransposeMatrixdARB))
GL_PREFIX(LoadTransposeMatrixdARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_LoadTransposeMatrixdARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultTransposeMatrixfARB))
GL_PREFIX(MultTransposeMatrixfARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultTransposeMatrixfARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MultTransposeMatrixdARB))
GL_PREFIX(MultTransposeMatrixdARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_MultTransposeMatrixdARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SampleCoverageARB))
GL_PREFIX(SampleCoverageARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SampleCoverageARB))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(SamplePassARB))
-GL_PREFIX(SamplePassARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_SamplePassARB))
+GLOBL_FN(GL_PREFIX(__unused413))
+GL_PREFIX(__unused413):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset___unused413))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CompressedTexImage3DARB))
GL_PREFIX(CompressedTexImage3DARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CompressedTexImage3DARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CompressedTexImage2DARB))
GL_PREFIX(CompressedTexImage2DARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CompressedTexImage2DARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CompressedTexImage1DARB))
GL_PREFIX(CompressedTexImage1DARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CompressedTexImage1DARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CompressedTexSubImage3DARB))
GL_PREFIX(CompressedTexSubImage3DARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CompressedTexSubImage3DARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CompressedTexSubImage2DARB))
GL_PREFIX(CompressedTexSubImage2DARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CompressedTexSubImage2DARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CompressedTexSubImage1DARB))
GL_PREFIX(CompressedTexSubImage1DARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CompressedTexSubImage1DARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetCompressedTexImageARB))
GL_PREFIX(GetCompressedTexImageARB):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_GetCompressedTexImageARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ActiveTexture))
+GL_PREFIX(ActiveTexture):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_ActiveTextureARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ClientActiveTexture))
+GL_PREFIX(ClientActiveTexture):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_ClientActiveTextureARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord1d))
+GL_PREFIX(MultiTexCoord1d):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord1dARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord1dv))
+GL_PREFIX(MultiTexCoord1dv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord1dvARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord1f))
+GL_PREFIX(MultiTexCoord1f):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord1fARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord1fv))
+GL_PREFIX(MultiTexCoord1fv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord1fvARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord1i))
+GL_PREFIX(MultiTexCoord1i):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord1iARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord1iv))
+GL_PREFIX(MultiTexCoord1iv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord1ivARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord1s))
+GL_PREFIX(MultiTexCoord1s):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord1sARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord1sv))
+GL_PREFIX(MultiTexCoord1sv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord1svARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord2d))
+GL_PREFIX(MultiTexCoord2d):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord2dARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord2dv))
+GL_PREFIX(MultiTexCoord2dv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord2dvARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord2f))
+GL_PREFIX(MultiTexCoord2f):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord2fARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord2fv))
+GL_PREFIX(MultiTexCoord2fv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord2fvARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord2i))
+GL_PREFIX(MultiTexCoord2i):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord2iARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord2iv))
+GL_PREFIX(MultiTexCoord2iv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord2ivARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord2s))
+GL_PREFIX(MultiTexCoord2s):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord2sARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord2sv))
+GL_PREFIX(MultiTexCoord2sv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord2svARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord3d))
+GL_PREFIX(MultiTexCoord3d):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord3dARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord3dv))
+GL_PREFIX(MultiTexCoord3dv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord3dvARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord3f))
+GL_PREFIX(MultiTexCoord3f):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord3fARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord3fv))
+GL_PREFIX(MultiTexCoord3fv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord3fvARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord3i))
+GL_PREFIX(MultiTexCoord3i):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord3iARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord3iv))
+GL_PREFIX(MultiTexCoord3iv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord3ivARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord3s))
+GL_PREFIX(MultiTexCoord3s):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord3sARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord3sv))
+GL_PREFIX(MultiTexCoord3sv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord3svARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord4d))
+GL_PREFIX(MultiTexCoord4d):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord4dARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord4dv))
+GL_PREFIX(MultiTexCoord4dv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord4dvARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord4f))
+GL_PREFIX(MultiTexCoord4f):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord4fARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord4fv))
+GL_PREFIX(MultiTexCoord4fv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord4fvARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord4i))
+GL_PREFIX(MultiTexCoord4i):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord4iARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord4iv))
+GL_PREFIX(MultiTexCoord4iv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord4ivARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord4s))
+GL_PREFIX(MultiTexCoord4s):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord4sARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord4sv))
+GL_PREFIX(MultiTexCoord4sv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord4svARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(LoadTransposeMatrixf))
+GL_PREFIX(LoadTransposeMatrixf):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_LoadTransposeMatrixfARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(LoadTransposeMatrixd))
+GL_PREFIX(LoadTransposeMatrixd):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_LoadTransposeMatrixdARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultTransposeMatrixf))
+GL_PREFIX(MultTransposeMatrixf):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultTransposeMatrixfARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultTransposeMatrixd))
+GL_PREFIX(MultTransposeMatrixd):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultTransposeMatrixdARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SampleCoverage))
+GL_PREFIX(SampleCoverage):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SampleCoverageARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CompressedTexImage3D))
+GL_PREFIX(CompressedTexImage3D):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_CompressedTexImage3DARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CompressedTexImage2D))
+GL_PREFIX(CompressedTexImage2D):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_CompressedTexImage2DARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CompressedTexImage1D))
+GL_PREFIX(CompressedTexImage1D):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_CompressedTexImage1DARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CompressedTexSubImage3D))
+GL_PREFIX(CompressedTexSubImage3D):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_CompressedTexSubImage3DARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CompressedTexSubImage2D))
+GL_PREFIX(CompressedTexSubImage2D):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_CompressedTexSubImage2DARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CompressedTexSubImage1D))
+GL_PREFIX(CompressedTexSubImage1D):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_CompressedTexSubImage1DARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetCompressedTexImage))
+GL_PREFIX(GetCompressedTexImage):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetCompressedTexImageARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(BlendColorEXT))
GL_PREFIX(BlendColorEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_BlendColor))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PolygonOffsetEXT))
GL_PREFIX(PolygonOffsetEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PolygonOffsetEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexImage3DEXT))
GL_PREFIX(TexImage3DEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexImage3D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexSubImage3DEXT))
GL_PREFIX(TexSubImage3DEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexSubImage3D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetTexFilterFuncSGIS))
GL_PREFIX(GetTexFilterFuncSGIS):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetTexFilterFuncSGIS))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexFilterFuncSGIS))
GL_PREFIX(TexFilterFuncSGIS):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexFilterFuncSGIS))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexSubImage1DEXT))
GL_PREFIX(TexSubImage1DEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexSubImage1D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexSubImage2DEXT))
GL_PREFIX(TexSubImage2DEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexSubImage2D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyTexImage1DEXT))
GL_PREFIX(CopyTexImage1DEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyTexImage1D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyTexImage2DEXT))
GL_PREFIX(CopyTexImage2DEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyTexImage2D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyTexSubImage1DEXT))
GL_PREFIX(CopyTexSubImage1DEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyTexSubImage1D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyTexSubImage2DEXT))
GL_PREFIX(CopyTexSubImage2DEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyTexSubImage2D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyTexSubImage3DEXT))
GL_PREFIX(CopyTexSubImage3DEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyTexSubImage3D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetHistogramEXT))
GL_PREFIX(GetHistogramEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetHistogramEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetHistogramParameterfvEXT))
GL_PREFIX(GetHistogramParameterfvEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetHistogramParameterfvEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetHistogramParameterivEXT))
GL_PREFIX(GetHistogramParameterivEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetHistogramParameterivEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetMinmaxEXT))
GL_PREFIX(GetMinmaxEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetMinmaxEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetMinmaxParameterfvEXT))
GL_PREFIX(GetMinmaxParameterfvEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetMinmaxParameterfvEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetMinmaxParameterivEXT))
GL_PREFIX(GetMinmaxParameterivEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetMinmaxParameterivEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(HistogramEXT))
GL_PREFIX(HistogramEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Histogram))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(MinmaxEXT))
GL_PREFIX(MinmaxEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_Minmax))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ResetHistogramEXT))
GL_PREFIX(ResetHistogramEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ResetHistogram))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ResetMinmaxEXT))
GL_PREFIX(ResetMinmaxEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ResetMinmax))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ConvolutionFilter1DEXT))
GL_PREFIX(ConvolutionFilter1DEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ConvolutionFilter1D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ConvolutionFilter2DEXT))
GL_PREFIX(ConvolutionFilter2DEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ConvolutionFilter2D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ConvolutionParameterfEXT))
GL_PREFIX(ConvolutionParameterfEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ConvolutionParameterf))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ConvolutionParameterfvEXT))
GL_PREFIX(ConvolutionParameterfvEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ConvolutionParameterfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ConvolutionParameteriEXT))
GL_PREFIX(ConvolutionParameteriEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ConvolutionParameteri))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ConvolutionParameterivEXT))
GL_PREFIX(ConvolutionParameterivEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ConvolutionParameteriv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyConvolutionFilter1DEXT))
GL_PREFIX(CopyConvolutionFilter1DEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyConvolutionFilter1D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyConvolutionFilter2DEXT))
GL_PREFIX(CopyConvolutionFilter2DEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyConvolutionFilter2D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetConvolutionFilterEXT))
GL_PREFIX(GetConvolutionFilterEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetConvolutionFilterEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetConvolutionParameterfvEXT))
GL_PREFIX(GetConvolutionParameterfvEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetConvolutionParameterfvEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetConvolutionParameterivEXT))
GL_PREFIX(GetConvolutionParameterivEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetConvolutionParameterivEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetSeparableFilterEXT))
GL_PREFIX(GetSeparableFilterEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetSeparableFilterEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SeparableFilter2DEXT))
GL_PREFIX(SeparableFilter2DEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SeparableFilter2D))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ColorTableSGI))
GL_PREFIX(ColorTableSGI):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ColorTable))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ColorTableParameterfvSGI))
GL_PREFIX(ColorTableParameterfvSGI):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ColorTableParameterfv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ColorTableParameterivSGI))
GL_PREFIX(ColorTableParameterivSGI):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ColorTableParameteriv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyColorTableSGI))
GL_PREFIX(CopyColorTableSGI):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyColorTable))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetColorTableSGI))
GL_PREFIX(GetColorTableSGI):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetColorTableSGI))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetColorTableParameterfvSGI))
GL_PREFIX(GetColorTableParameterfvSGI):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetColorTableParameterfvSGI))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetColorTableParameterivSGI))
GL_PREFIX(GetColorTableParameterivSGI):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetColorTableParameterivSGI))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PixelTexGenSGIX))
GL_PREFIX(PixelTexGenSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PixelTexGenSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PixelTexGenParameteriSGIS))
GL_PREFIX(PixelTexGenParameteriSGIS):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PixelTexGenParameteriSGIS))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PixelTexGenParameterivSGIS))
GL_PREFIX(PixelTexGenParameterivSGIS):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PixelTexGenParameterivSGIS))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PixelTexGenParameterfSGIS))
GL_PREFIX(PixelTexGenParameterfSGIS):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PixelTexGenParameterfSGIS))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PixelTexGenParameterfvSGIS))
GL_PREFIX(PixelTexGenParameterfvSGIS):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PixelTexGenParameterfvSGIS))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetPixelTexGenParameterivSGIS))
GL_PREFIX(GetPixelTexGenParameterivSGIS):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetPixelTexGenParameterivSGIS))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetPixelTexGenParameterfvSGIS))
GL_PREFIX(GetPixelTexGenParameterfvSGIS):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetPixelTexGenParameterfvSGIS))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexImage4DSGIS))
GL_PREFIX(TexImage4DSGIS):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexImage4DSGIS))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexSubImage4DSGIS))
GL_PREFIX(TexSubImage4DSGIS):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexSubImage4DSGIS))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(AreTexturesResidentEXT))
GL_PREFIX(AreTexturesResidentEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_AreTexturesResidentEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(BindTextureEXT))
GL_PREFIX(BindTextureEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_BindTexture))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(DeleteTexturesEXT))
GL_PREFIX(DeleteTexturesEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_DeleteTextures))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GenTexturesEXT))
GL_PREFIX(GenTexturesEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GenTexturesEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(IsTextureEXT))
GL_PREFIX(IsTextureEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_IsTextureEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PrioritizeTexturesEXT))
GL_PREFIX(PrioritizeTexturesEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PrioritizeTextures))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(DetailTexFuncSGIS))
GL_PREFIX(DetailTexFuncSGIS):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_DetailTexFuncSGIS))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetDetailTexFuncSGIS))
GL_PREFIX(GetDetailTexFuncSGIS):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetDetailTexFuncSGIS))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SharpenTexFuncSGIS))
GL_PREFIX(SharpenTexFuncSGIS):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SharpenTexFuncSGIS))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetSharpenTexFuncSGIS))
GL_PREFIX(GetSharpenTexFuncSGIS):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetSharpenTexFuncSGIS))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SampleMaskSGIS))
GL_PREFIX(SampleMaskSGIS):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SampleMaskSGIS))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SamplePatternSGIS))
GL_PREFIX(SamplePatternSGIS):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SamplePatternSGIS))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ArrayElementEXT))
GL_PREFIX(ArrayElementEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ArrayElement))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ColorPointerEXT))
GL_PREFIX(ColorPointerEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ColorPointerEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(DrawArraysEXT))
GL_PREFIX(DrawArraysEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_DrawArrays))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(EdgeFlagPointerEXT))
GL_PREFIX(EdgeFlagPointerEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_EdgeFlagPointerEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetPointervEXT))
GL_PREFIX(GetPointervEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetPointerv))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(IndexPointerEXT))
GL_PREFIX(IndexPointerEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_IndexPointerEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(NormalPointerEXT))
GL_PREFIX(NormalPointerEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_NormalPointerEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TexCoordPointerEXT))
GL_PREFIX(TexCoordPointerEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TexCoordPointerEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexPointerEXT))
GL_PREFIX(VertexPointerEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_VertexPointerEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(BlendEquationEXT))
GL_PREFIX(BlendEquationEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_BlendEquation))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SpriteParameterfSGIX))
GL_PREFIX(SpriteParameterfSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SpriteParameterfSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SpriteParameterfvSGIX))
GL_PREFIX(SpriteParameterfvSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SpriteParameterfvSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SpriteParameteriSGIX))
GL_PREFIX(SpriteParameteriSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SpriteParameteriSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SpriteParameterivSGIX))
GL_PREFIX(SpriteParameterivSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SpriteParameterivSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PointParameterfEXT))
GL_PREFIX(PointParameterfEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PointParameterfEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PointParameterfvEXT))
GL_PREFIX(PointParameterfvEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_PointParameterfvEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PointParameterfARB))
+GL_PREFIX(PointParameterfARB):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_PointParameterfEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PointParameterfvARB))
+GL_PREFIX(PointParameterfvARB):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PointParameterfvEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PointParameterfSGIS))
GL_PREFIX(PointParameterfSGIS):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PointParameterfEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PointParameterfvSGIS))
GL_PREFIX(PointParameterfvSGIS):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PointParameterfvEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetInstrumentsSGIX))
GL_PREFIX(GetInstrumentsSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetInstrumentsSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(InstrumentsBufferSGIX))
GL_PREFIX(InstrumentsBufferSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_InstrumentsBufferSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(PollInstrumentsSGIX))
GL_PREFIX(PollInstrumentsSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_PollInstrumentsSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ReadInstrumentsSGIX))
GL_PREFIX(ReadInstrumentsSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ReadInstrumentsSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(StartInstrumentsSGIX))
GL_PREFIX(StartInstrumentsSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_StartInstrumentsSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(StopInstrumentsSGIX))
GL_PREFIX(StopInstrumentsSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_StopInstrumentsSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FrameZoomSGIX))
GL_PREFIX(FrameZoomSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FrameZoomSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TagSampleBufferSGIX))
GL_PREFIX(TagSampleBufferSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TagSampleBufferSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ReferencePlaneSGIX))
GL_PREFIX(ReferencePlaneSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ReferencePlaneSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FlushRasterSGIX))
GL_PREFIX(FlushRasterSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FlushRasterSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ColorSubTableEXT))
GL_PREFIX(ColorSubTableEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ColorSubTable))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CopyColorSubTableEXT))
GL_PREFIX(CopyColorSubTableEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CopyColorSubTable))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(HintPGI))
GL_PREFIX(HintPGI):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_HintPGI))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ColorTableEXT))
GL_PREFIX(ColorTableEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ColorTable))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetColorTableEXT))
GL_PREFIX(GetColorTableEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetColorTableEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetColorTableParameterivEXT))
GL_PREFIX(GetColorTableParameterivEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetColorTableParameterivEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetColorTableParameterfvEXT))
GL_PREFIX(GetColorTableParameterfvEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetColorTableParameterfvEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetListParameterfvSGIX))
GL_PREFIX(GetListParameterfvSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetListParameterfvSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetListParameterivSGIX))
GL_PREFIX(GetListParameterivSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetListParameterivSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ListParameterfSGIX))
GL_PREFIX(ListParameterfSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ListParameterfSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ListParameterfvSGIX))
GL_PREFIX(ListParameterfvSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ListParameterfvSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ListParameteriSGIX))
GL_PREFIX(ListParameteriSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ListParameteriSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ListParameterivSGIX))
GL_PREFIX(ListParameterivSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ListParameterivSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(IndexMaterialEXT))
GL_PREFIX(IndexMaterialEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_IndexMaterialEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(IndexFuncEXT))
GL_PREFIX(IndexFuncEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_IndexFuncEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(LockArraysEXT))
GL_PREFIX(LockArraysEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_LockArraysEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(UnlockArraysEXT))
GL_PREFIX(UnlockArraysEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_UnlockArraysEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CullParameterdvEXT))
GL_PREFIX(CullParameterdvEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CullParameterdvEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CullParameterfvEXT))
GL_PREFIX(CullParameterfvEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CullParameterfvEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FragmentColorMaterialSGIX))
GL_PREFIX(FragmentColorMaterialSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FragmentColorMaterialSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FragmentLightfSGIX))
GL_PREFIX(FragmentLightfSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FragmentLightfSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FragmentLightfvSGIX))
GL_PREFIX(FragmentLightfvSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FragmentLightfvSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FragmentLightiSGIX))
GL_PREFIX(FragmentLightiSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FragmentLightiSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FragmentLightivSGIX))
GL_PREFIX(FragmentLightivSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FragmentLightivSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FragmentLightModelfSGIX))
GL_PREFIX(FragmentLightModelfSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FragmentLightModelfSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FragmentLightModelfvSGIX))
GL_PREFIX(FragmentLightModelfvSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FragmentLightModelfvSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FragmentLightModeliSGIX))
GL_PREFIX(FragmentLightModeliSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FragmentLightModeliSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FragmentLightModelivSGIX))
GL_PREFIX(FragmentLightModelivSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FragmentLightModelivSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FragmentMaterialfSGIX))
GL_PREFIX(FragmentMaterialfSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FragmentMaterialfSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FragmentMaterialfvSGIX))
GL_PREFIX(FragmentMaterialfvSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FragmentMaterialfvSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FragmentMaterialiSGIX))
GL_PREFIX(FragmentMaterialiSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FragmentMaterialiSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FragmentMaterialivSGIX))
GL_PREFIX(FragmentMaterialivSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FragmentMaterialivSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetFragmentLightfvSGIX))
GL_PREFIX(GetFragmentLightfvSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetFragmentLightfvSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetFragmentLightivSGIX))
GL_PREFIX(GetFragmentLightivSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetFragmentLightivSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetFragmentMaterialfvSGIX))
GL_PREFIX(GetFragmentMaterialfvSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetFragmentMaterialfvSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetFragmentMaterialivSGIX))
GL_PREFIX(GetFragmentMaterialivSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetFragmentMaterialivSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(LightEnviSGIX))
GL_PREFIX(LightEnviSGIX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_LightEnviSGIX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(DrawRangeElementsEXT))
GL_PREFIX(DrawRangeElementsEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_DrawRangeElements))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SecondaryColor3bEXT))
GL_PREFIX(SecondaryColor3bEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SecondaryColor3bEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SecondaryColor3bvEXT))
GL_PREFIX(SecondaryColor3bvEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SecondaryColor3bvEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SecondaryColor3dEXT))
GL_PREFIX(SecondaryColor3dEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SecondaryColor3dEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SecondaryColor3dvEXT))
GL_PREFIX(SecondaryColor3dvEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SecondaryColor3dvEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SecondaryColor3fEXT))
GL_PREFIX(SecondaryColor3fEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SecondaryColor3fEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SecondaryColor3fvEXT))
GL_PREFIX(SecondaryColor3fvEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SecondaryColor3fvEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SecondaryColor3iEXT))
GL_PREFIX(SecondaryColor3iEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SecondaryColor3iEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SecondaryColor3ivEXT))
GL_PREFIX(SecondaryColor3ivEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SecondaryColor3ivEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SecondaryColor3sEXT))
GL_PREFIX(SecondaryColor3sEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SecondaryColor3sEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SecondaryColor3svEXT))
GL_PREFIX(SecondaryColor3svEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SecondaryColor3svEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SecondaryColor3ubEXT))
GL_PREFIX(SecondaryColor3ubEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SecondaryColor3ubEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SecondaryColor3ubvEXT))
GL_PREFIX(SecondaryColor3ubvEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SecondaryColor3ubvEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SecondaryColor3uiEXT))
GL_PREFIX(SecondaryColor3uiEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SecondaryColor3uiEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SecondaryColor3uivEXT))
GL_PREFIX(SecondaryColor3uivEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SecondaryColor3uivEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SecondaryColor3usEXT))
GL_PREFIX(SecondaryColor3usEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SecondaryColor3usEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SecondaryColor3usvEXT))
GL_PREFIX(SecondaryColor3usvEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SecondaryColor3usvEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SecondaryColorPointerEXT))
GL_PREFIX(SecondaryColorPointerEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SecondaryColorPointerEXT))
ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiDrawArraysEXT))
+GL_PREFIX(MultiDrawArraysEXT):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiDrawArraysEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiDrawElementsEXT))
+GL_PREFIX(MultiDrawElementsEXT):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiDrawElementsEXT))
+
+ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FogCoordfEXT))
GL_PREFIX(FogCoordfEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FogCoordfEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FogCoordfvEXT))
GL_PREFIX(FogCoordfvEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FogCoordfvEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FogCoorddEXT))
GL_PREFIX(FogCoorddEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FogCoorddEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FogCoorddvEXT))
GL_PREFIX(FogCoorddvEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FogCoorddvEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FogCoordPointerEXT))
GL_PREFIX(FogCoordPointerEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FogCoordPointerEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(BlendFuncSeparateEXT))
GL_PREFIX(BlendFuncSeparateEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_BlendFuncSeparateEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(BlendFuncSeparateINGR))
+GL_PREFIX(BlendFuncSeparateINGR):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_BlendFuncSeparateEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexWeightfEXT))
GL_PREFIX(VertexWeightfEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_VertexWeightfEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexWeightfvEXT))
GL_PREFIX(VertexWeightfvEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_VertexWeightfvEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexWeightPointerEXT))
GL_PREFIX(VertexWeightPointerEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_VertexWeightPointerEXT))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FlushVertexArrayRangeNV))
GL_PREFIX(FlushVertexArrayRangeNV):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FlushVertexArrayRangeNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexArrayRangeNV))
GL_PREFIX(VertexArrayRangeNV):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_VertexArrayRangeNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CombinerParameterfvNV))
GL_PREFIX(CombinerParameterfvNV):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CombinerParameterfvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CombinerParameterfNV))
GL_PREFIX(CombinerParameterfNV):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CombinerParameterfNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CombinerParameterivNV))
GL_PREFIX(CombinerParameterivNV):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CombinerParameterivNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CombinerParameteriNV))
GL_PREFIX(CombinerParameteriNV):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CombinerParameteriNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CombinerInputNV))
GL_PREFIX(CombinerInputNV):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CombinerInputNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(CombinerOutputNV))
GL_PREFIX(CombinerOutputNV):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_CombinerOutputNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(FinalCombinerInputNV))
GL_PREFIX(FinalCombinerInputNV):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_FinalCombinerInputNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetCombinerInputParameterfvNV))
GL_PREFIX(GetCombinerInputParameterfvNV):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetCombinerInputParameterfvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetCombinerInputParameterivNV))
GL_PREFIX(GetCombinerInputParameterivNV):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetCombinerInputParameterivNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetCombinerOutputParameterfvNV))
GL_PREFIX(GetCombinerOutputParameterfvNV):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetCombinerOutputParameterfvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetCombinerOutputParameterivNV))
GL_PREFIX(GetCombinerOutputParameterivNV):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetCombinerOutputParameterivNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetFinalCombinerInputParameterfvNV))
GL_PREFIX(GetFinalCombinerInputParameterfvNV):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetFinalCombinerInputParameterfvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetFinalCombinerInputParameterivNV))
GL_PREFIX(GetFinalCombinerInputParameterivNV):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_GetFinalCombinerInputParameterivNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ResizeBuffersMESA))
GL_PREFIX(ResizeBuffersMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_ResizeBuffersMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos2dMESA))
GL_PREFIX(WindowPos2dMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos2dMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos2dvMESA))
GL_PREFIX(WindowPos2dvMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos2dvMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos2fMESA))
GL_PREFIX(WindowPos2fMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos2fMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos2fvMESA))
GL_PREFIX(WindowPos2fvMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos2fvMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos2iMESA))
GL_PREFIX(WindowPos2iMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos2iMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos2ivMESA))
GL_PREFIX(WindowPos2ivMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos2ivMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos2sMESA))
GL_PREFIX(WindowPos2sMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos2sMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos2svMESA))
GL_PREFIX(WindowPos2svMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos2svMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos3dMESA))
GL_PREFIX(WindowPos3dMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos3dMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos3dvMESA))
GL_PREFIX(WindowPos3dvMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos3dvMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos3fMESA))
GL_PREFIX(WindowPos3fMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos3fMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos3fvMESA))
GL_PREFIX(WindowPos3fvMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos3fvMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos3iMESA))
GL_PREFIX(WindowPos3iMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos3iMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos3ivMESA))
GL_PREFIX(WindowPos3ivMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos3ivMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos3sMESA))
GL_PREFIX(WindowPos3sMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos3sMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos3svMESA))
GL_PREFIX(WindowPos3svMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos3svMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos4dMESA))
GL_PREFIX(WindowPos4dMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos4dMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos4dvMESA))
GL_PREFIX(WindowPos4dvMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos4dvMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos4fMESA))
GL_PREFIX(WindowPos4fMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos4fMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos4fvMESA))
GL_PREFIX(WindowPos4fvMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos4fvMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos4iMESA))
GL_PREFIX(WindowPos4iMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos4iMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos4ivMESA))
GL_PREFIX(WindowPos4ivMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos4ivMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos4sMESA))
GL_PREFIX(WindowPos4sMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos4sMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos4svMESA))
GL_PREFIX(WindowPos4svMESA):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos4svMESA))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TbufferMask3DFX))
GL_PREFIX(TbufferMask3DFX):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_TbufferMask3DFX))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SampleMaskEXT))
GL_PREFIX(SampleMaskEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SampleMaskSGIS))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(SamplePatternEXT))
GL_PREFIX(SamplePatternEXT):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
JMP(GL_OFFSET(_gloffset_SamplePatternSGIS))
-/* XXX these were added by hand because we need a new gl.spec file */
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(DeleteFencesNV))
+GL_PREFIX(DeleteFencesNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_DeleteFencesNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(ActiveTexture))
-GL_PREFIX(ActiveTexture):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_ActiveTextureARB))
+GLOBL_FN(GL_PREFIX(GenFencesNV))
+GL_PREFIX(GenFencesNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_GenFencesNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(ClientActiveTexture))
-GL_PREFIX(ClientActiveTexture):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_ClientActiveTextureARB))
+GLOBL_FN(GL_PREFIX(IsFenceNV))
+GL_PREFIX(IsFenceNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_IsFenceNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(CompressedTexImage1D))
-GL_PREFIX(CompressedTexImage1D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_CompressedTexImage1DARB))
+GLOBL_FN(GL_PREFIX(TestFenceNV))
+GL_PREFIX(TestFenceNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_TestFenceNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(CompressedTexImage2D))
-GL_PREFIX(CompressedTexImage2D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_CompressedTexImage2DARB))
+GLOBL_FN(GL_PREFIX(GetFenceivNV))
+GL_PREFIX(GetFenceivNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_GetFenceivNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(CompressedTexImage3D))
-GL_PREFIX(CompressedTexImage3D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_CompressedTexImage3DARB))
+GLOBL_FN(GL_PREFIX(FinishFenceNV))
+GL_PREFIX(FinishFenceNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_FinishFenceNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(CompressedTexSubImage1D))
-GL_PREFIX(CompressedTexSubImage1D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_CompressedTexSubImage1DARB))
+GLOBL_FN(GL_PREFIX(SetFenceNV))
+GL_PREFIX(SetFenceNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SetFenceNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(CompressedTexSubImage2D))
-GL_PREFIX(CompressedTexSubImage2D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_CompressedTexSubImage2DARB))
+GLOBL_FN(GL_PREFIX(WindowPos2dARB))
+GL_PREFIX(WindowPos2dARB):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos2dMESA))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(CompressedTexSubImage3D))
-GL_PREFIX(CompressedTexSubImage3D):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_CompressedTexSubImage3DARB))
+GLOBL_FN(GL_PREFIX(WindowPos2fARB))
+GL_PREFIX(WindowPos2fARB):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos2fMESA))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(GetCompressedTexImage))
-GL_PREFIX(GetCompressedTexImage):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_GetCompressedTexImageARB))
+GLOBL_FN(GL_PREFIX(WindowPos2iARB))
+GL_PREFIX(WindowPos2iARB):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos2iMESA))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord1d))
-GL_PREFIX(MultiTexCoord1d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord1dARB))
+GLOBL_FN(GL_PREFIX(WindowPos2sARB))
+GL_PREFIX(WindowPos2sARB):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos2sMESA))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord1dv))
-GL_PREFIX(MultiTexCoord1dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord1dvARB))
+GLOBL_FN(GL_PREFIX(WindowPos2dvARB))
+GL_PREFIX(WindowPos2dvARB):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos2dvMESA))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord1f))
-GL_PREFIX(MultiTexCoord1f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord1fARB))
+GLOBL_FN(GL_PREFIX(WindowPos2fvARB))
+GL_PREFIX(WindowPos2fvARB):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos2fvMESA))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord1fv))
-GL_PREFIX(MultiTexCoord1fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord1fvARB))
+GLOBL_FN(GL_PREFIX(WindowPos2ivARB))
+GL_PREFIX(WindowPos2ivARB):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos2ivMESA))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord1i))
-GL_PREFIX(MultiTexCoord1i):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord1iARB))
+GLOBL_FN(GL_PREFIX(WindowPos2svARB))
+GL_PREFIX(WindowPos2svARB):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos2svMESA))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord1iv))
-GL_PREFIX(MultiTexCoord1iv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord1ivARB))
+GLOBL_FN(GL_PREFIX(WindowPos3dARB))
+GL_PREFIX(WindowPos3dARB):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos3dMESA))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord1s))
-GL_PREFIX(MultiTexCoord1s):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord1sARB))
+GLOBL_FN(GL_PREFIX(WindowPos3fARB))
+GL_PREFIX(WindowPos3fARB):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos3fMESA))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord1sv))
-GL_PREFIX(MultiTexCoord1sv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord1svARB))
+GLOBL_FN(GL_PREFIX(WindowPos3iARB))
+GL_PREFIX(WindowPos3iARB):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos3iMESA))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord2d))
-GL_PREFIX(MultiTexCoord2d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord2dARB))
+GLOBL_FN(GL_PREFIX(WindowPos3sARB))
+GL_PREFIX(WindowPos3sARB):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos3sMESA))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord2dv))
-GL_PREFIX(MultiTexCoord2dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord2dvARB))
+GLOBL_FN(GL_PREFIX(WindowPos3dvARB))
+GL_PREFIX(WindowPos3dvARB):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos3dvMESA))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord2f))
-GL_PREFIX(MultiTexCoord2f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord2fARB))
+GLOBL_FN(GL_PREFIX(WindowPos3fvARB))
+GL_PREFIX(WindowPos3fvARB):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos3fvMESA))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord2fv))
-GL_PREFIX(MultiTexCoord2fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord2fvARB))
+GLOBL_FN(GL_PREFIX(WindowPos3ivARB))
+GL_PREFIX(WindowPos3ivARB):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos3ivMESA))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord2i))
-GL_PREFIX(MultiTexCoord2i):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord2iARB))
+GLOBL_FN(GL_PREFIX(WindowPos3svARB))
+GL_PREFIX(WindowPos3svARB):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos3svMESA))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord2iv))
-GL_PREFIX(MultiTexCoord2iv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord2ivARB))
+GLOBL_FN(GL_PREFIX(AreProgramsResidentNV))
+GL_PREFIX(AreProgramsResidentNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_AreProgramsResidentNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord2s))
-GL_PREFIX(MultiTexCoord2s):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord2sARB))
+GLOBL_FN(GL_PREFIX(BindProgramNV))
+GL_PREFIX(BindProgramNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_BindProgramNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord2sv))
-GL_PREFIX(MultiTexCoord2sv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord2svARB))
+GLOBL_FN(GL_PREFIX(DeleteProgramsNV))
+GL_PREFIX(DeleteProgramsNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_DeleteProgramsNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord3d))
-GL_PREFIX(MultiTexCoord3d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord3dARB))
+GLOBL_FN(GL_PREFIX(ExecuteProgramNV))
+GL_PREFIX(ExecuteProgramNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_ExecuteProgramNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord3dv))
-GL_PREFIX(MultiTexCoord3dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord3dvARB))
+GLOBL_FN(GL_PREFIX(GenProgramsNV))
+GL_PREFIX(GenProgramsNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_GenProgramsNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord3f))
-GL_PREFIX(MultiTexCoord3f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord3fARB))
+GLOBL_FN(GL_PREFIX(GetProgramParameterdvNV))
+GL_PREFIX(GetProgramParameterdvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_GetProgramParameterdvNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord3fv))
-GL_PREFIX(MultiTexCoord3fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord3fvARB))
+GLOBL_FN(GL_PREFIX(GetProgramParameterfvNV))
+GL_PREFIX(GetProgramParameterfvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_GetProgramParameterfvNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord3i))
-GL_PREFIX(MultiTexCoord3i):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord3iARB))
+GLOBL_FN(GL_PREFIX(GetProgramivNV))
+GL_PREFIX(GetProgramivNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_GetProgramivNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord3iv))
-GL_PREFIX(MultiTexCoord3iv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord3ivARB))
+GLOBL_FN(GL_PREFIX(GetProgramStringNV))
+GL_PREFIX(GetProgramStringNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_GetProgramStringNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord3s))
-GL_PREFIX(MultiTexCoord3s):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord3sARB))
+GLOBL_FN(GL_PREFIX(GetTrackMatrixivNV))
+GL_PREFIX(GetTrackMatrixivNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_GetTrackMatrixivNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord3sv))
-GL_PREFIX(MultiTexCoord3sv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord3svARB))
+GLOBL_FN(GL_PREFIX(GetVertexAttribdvNV))
+GL_PREFIX(GetVertexAttribdvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_GetVertexAttribdvNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord4d))
-GL_PREFIX(MultiTexCoord4d):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord4dARB))
+GLOBL_FN(GL_PREFIX(GetVertexAttribfvNV))
+GL_PREFIX(GetVertexAttribfvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_GetVertexAttribfvNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord4dv))
-GL_PREFIX(MultiTexCoord4dv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord4dvARB))
+GLOBL_FN(GL_PREFIX(GetVertexAttribivNV))
+GL_PREFIX(GetVertexAttribivNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_GetVertexAttribivNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord4f))
-GL_PREFIX(MultiTexCoord4f):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord4fARB))
+GLOBL_FN(GL_PREFIX(GetVertexAttribPointervNV))
+GL_PREFIX(GetVertexAttribPointervNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_GetVertexAttribPointervNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord4fv))
-GL_PREFIX(MultiTexCoord4fv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord4fvARB))
+GLOBL_FN(GL_PREFIX(IsProgramNV))
+GL_PREFIX(IsProgramNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_IsProgramNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord4i))
-GL_PREFIX(MultiTexCoord4i):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord4iARB))
+GLOBL_FN(GL_PREFIX(LoadProgramNV))
+GL_PREFIX(LoadProgramNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_LoadProgramNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord4iv))
-GL_PREFIX(MultiTexCoord4iv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord4ivARB))
+GLOBL_FN(GL_PREFIX(ProgramParameter4dNV))
+GL_PREFIX(ProgramParameter4dNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_ProgramParameter4dNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord4s))
-GL_PREFIX(MultiTexCoord4s):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord4sARB))
+GLOBL_FN(GL_PREFIX(ProgramParameter4dvNV))
+GL_PREFIX(ProgramParameter4dvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_ProgramParameter4dvNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultiTexCoord4sv))
-GL_PREFIX(MultiTexCoord4sv):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultiTexCoord4svARB))
+GLOBL_FN(GL_PREFIX(ProgramParameter4fNV))
+GL_PREFIX(ProgramParameter4fNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_ProgramParameter4fNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(LoadTransposeMatrixd))
-GL_PREFIX(LoadTransposeMatrixd):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_LoadTransposeMatrixdARB))
+GLOBL_FN(GL_PREFIX(ProgramParameter4fvNV))
+GL_PREFIX(ProgramParameter4fvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_ProgramParameter4fvNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(LoadTransposeMatrixf))
-GL_PREFIX(LoadTransposeMatrixf):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_LoadTransposeMatrixfARB))
+GLOBL_FN(GL_PREFIX(ProgramParameters4dvNV))
+GL_PREFIX(ProgramParameters4dvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_ProgramParameters4dvNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultTransposeMatrixd))
-GL_PREFIX(MultTransposeMatrixd):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultTransposeMatrixdARB))
+GLOBL_FN(GL_PREFIX(ProgramParameters4fvNV))
+GL_PREFIX(ProgramParameters4fvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_ProgramParameters4fvNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(MultTransposeMatrixf))
-GL_PREFIX(MultTransposeMatrixf):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_MultTransposeMatrixfARB))
+GLOBL_FN(GL_PREFIX(RequestResidentProgramsNV))
+GL_PREFIX(RequestResidentProgramsNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_RequestResidentProgramsNV))
ALIGNTEXT16
-GLOBL_FN(GL_PREFIX(SampleCoverage))
-GL_PREFIX(SampleCoverage):
- MOV_L(GLNAME(_glapi_Dispatch), EAX)
- JMP(GL_OFFSET(_gloffset_SampleCoverageARB))
+GLOBL_FN(GL_PREFIX(TrackMatrixNV))
+GL_PREFIX(TrackMatrixNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_TrackMatrixNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttribPointerNV))
+GL_PREFIX(VertexAttribPointerNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttribPointerNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib1dNV))
+GL_PREFIX(VertexAttrib1dNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib1dNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib1dvNV))
+GL_PREFIX(VertexAttrib1dvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib1dvNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib1fNV))
+GL_PREFIX(VertexAttrib1fNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib1fNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib1fvNV))
+GL_PREFIX(VertexAttrib1fvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib1fvNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib1sNV))
+GL_PREFIX(VertexAttrib1sNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib1sNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib1svNV))
+GL_PREFIX(VertexAttrib1svNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib1svNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib2dNV))
+GL_PREFIX(VertexAttrib2dNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib2dNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib2dvNV))
+GL_PREFIX(VertexAttrib2dvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib2dvNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib2fNV))
+GL_PREFIX(VertexAttrib2fNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib2fNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib2fvNV))
+GL_PREFIX(VertexAttrib2fvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib2fvNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib2sNV))
+GL_PREFIX(VertexAttrib2sNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib2sNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib2svNV))
+GL_PREFIX(VertexAttrib2svNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib2svNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib3dNV))
+GL_PREFIX(VertexAttrib3dNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib3dNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib3dvNV))
+GL_PREFIX(VertexAttrib3dvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib3dvNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib3fNV))
+GL_PREFIX(VertexAttrib3fNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib3fNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib3fvNV))
+GL_PREFIX(VertexAttrib3fvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib3fvNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib3sNV))
+GL_PREFIX(VertexAttrib3sNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib3sNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib3svNV))
+GL_PREFIX(VertexAttrib3svNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib3svNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib4dNV))
+GL_PREFIX(VertexAttrib4dNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib4dNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib4dvNV))
+GL_PREFIX(VertexAttrib4dvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib4dvNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib4fNV))
+GL_PREFIX(VertexAttrib4fNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib4fNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib4fvNV))
+GL_PREFIX(VertexAttrib4fvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib4fvNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib4sNV))
+GL_PREFIX(VertexAttrib4sNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib4sNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib4svNV))
+GL_PREFIX(VertexAttrib4svNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib4svNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib4ubNV))
+GL_PREFIX(VertexAttrib4ubNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib4ubNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttrib4ubvNV))
+GL_PREFIX(VertexAttrib4ubvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttrib4ubvNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttribs1dvNV))
+GL_PREFIX(VertexAttribs1dvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttribs1dvNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttribs1fvNV))
+GL_PREFIX(VertexAttribs1fvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttribs1fvNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttribs1svNV))
+GL_PREFIX(VertexAttribs1svNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttribs1svNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttribs2dvNV))
+GL_PREFIX(VertexAttribs2dvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttribs2dvNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttribs2fvNV))
+GL_PREFIX(VertexAttribs2fvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttribs2fvNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttribs2svNV))
+GL_PREFIX(VertexAttribs2svNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttribs2svNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttribs3dvNV))
+GL_PREFIX(VertexAttribs3dvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttribs3dvNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttribs3fvNV))
+GL_PREFIX(VertexAttribs3fvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttribs3fvNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttribs3svNV))
+GL_PREFIX(VertexAttribs3svNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttribs3svNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttribs4dvNV))
+GL_PREFIX(VertexAttribs4dvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttribs4dvNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttribs4fvNV))
+GL_PREFIX(VertexAttribs4fvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttribs4fvNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttribs4svNV))
+GL_PREFIX(VertexAttribs4svNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttribs4svNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexAttribs4ubvNV))
+GL_PREFIX(VertexAttribs4ubvNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_VertexAttribs4ubvNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PointParameteriNV))
+GL_PREFIX(PointParameteriNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_PointParameteriNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PointParameterivNV))
+GL_PREFIX(PointParameterivNV):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_PointParameterivNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(BlendFuncSeparate))
+GL_PREFIX(BlendFuncSeparate):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_BlendFuncSeparateEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(FogCoordf))
+GL_PREFIX(FogCoordf):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_FogCoordfEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(FogCoordfv))
+GL_PREFIX(FogCoordfv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_FogCoordfvEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(FogCoordd))
+GL_PREFIX(FogCoordd):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_FogCoorddEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(FogCoorddv))
+GL_PREFIX(FogCoorddv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_FogCoorddvEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(FogCoordPointer))
+GL_PREFIX(FogCoordPointer):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_FogCoordPointerEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiDrawArrays))
+GL_PREFIX(MultiDrawArrays):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiDrawArraysEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiDrawElements))
+GL_PREFIX(MultiDrawElements):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_MultiDrawElementsEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PointParameterf))
+GL_PREFIX(PointParameterf):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_PointParameterfEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PointParameterfv))
+GL_PREFIX(PointParameterfv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_PointParameterfvEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PointParameteri))
+GL_PREFIX(PointParameteri):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_PointParameteriNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PointParameteriv))
+GL_PREFIX(PointParameteriv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_PointParameterivNV))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SecondaryColor3b))
+GL_PREFIX(SecondaryColor3b):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SecondaryColor3bEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SecondaryColor3bv))
+GL_PREFIX(SecondaryColor3bv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SecondaryColor3bvEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SecondaryColor3d))
+GL_PREFIX(SecondaryColor3d):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SecondaryColor3dEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SecondaryColor3dv))
+GL_PREFIX(SecondaryColor3dv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SecondaryColor3dvEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SecondaryColor3f))
+GL_PREFIX(SecondaryColor3f):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SecondaryColor3fEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SecondaryColor3fv))
+GL_PREFIX(SecondaryColor3fv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SecondaryColor3fvEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SecondaryColor3i))
+GL_PREFIX(SecondaryColor3i):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SecondaryColor3iEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SecondaryColor3iv))
+GL_PREFIX(SecondaryColor3iv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SecondaryColor3ivEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SecondaryColor3s))
+GL_PREFIX(SecondaryColor3s):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SecondaryColor3sEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SecondaryColor3sv))
+GL_PREFIX(SecondaryColor3sv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SecondaryColor3svEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SecondaryColor3ub))
+GL_PREFIX(SecondaryColor3ub):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SecondaryColor3ubEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SecondaryColor3ubv))
+GL_PREFIX(SecondaryColor3ubv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SecondaryColor3ubvEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SecondaryColor3ui))
+GL_PREFIX(SecondaryColor3ui):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SecondaryColor3uiEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SecondaryColor3uiv))
+GL_PREFIX(SecondaryColor3uiv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SecondaryColor3uivEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SecondaryColor3us))
+GL_PREFIX(SecondaryColor3us):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SecondaryColor3usEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SecondaryColor3usv))
+GL_PREFIX(SecondaryColor3usv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SecondaryColor3usvEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SecondaryColorPointer))
+GL_PREFIX(SecondaryColorPointer):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_SecondaryColorPointerEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos2d))
+GL_PREFIX(WindowPos2d):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos2dMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos2dv))
+GL_PREFIX(WindowPos2dv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos2dvMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos2f))
+GL_PREFIX(WindowPos2f):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos2fMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos2fv))
+GL_PREFIX(WindowPos2fv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos2fvMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos2i))
+GL_PREFIX(WindowPos2i):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos2iMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos2iv))
+GL_PREFIX(WindowPos2iv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos2ivMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos2s))
+GL_PREFIX(WindowPos2s):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos2sMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos2sv))
+GL_PREFIX(WindowPos2sv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos2svMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos3d))
+GL_PREFIX(WindowPos3d):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos3dMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos3dv))
+GL_PREFIX(WindowPos3dv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos3dvMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos3f))
+GL_PREFIX(WindowPos3f):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos3fMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos3fv))
+GL_PREFIX(WindowPos3fv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos3fvMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos3i))
+GL_PREFIX(WindowPos3i):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos3iMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos3iv))
+GL_PREFIX(WindowPos3iv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos3ivMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos3s))
+GL_PREFIX(WindowPos3s):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos3sMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos3sv))
+GL_PREFIX(WindowPos3sv):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_WindowPos3svMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ActiveStencilFaceEXT))
+GL_PREFIX(ActiveStencilFaceEXT):
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
+ JMP(GL_OFFSET(_gloffset_ActiveStencilFaceEXT))
#endif /* __WIN32__ */
diff --git a/xc/extras/Mesa/src/X86/mmx.h b/xc/extras/Mesa/src/X86/mmx.h
index 9692d3f2a..f6bfcb3b5 100644
--- a/xc/extras/Mesa/src/X86/mmx.h
+++ b/xc/extras/Mesa/src/X86/mmx.h
@@ -1,5 +1,3 @@
-/* $Id: mmx.h,v 1.1.1.4 2002/10/22 13:06:08 alanh Exp $ */
-
/*
* Mesa 3-D graphics library
* Version: 3.5
@@ -32,4 +30,20 @@ extern void _ASMAPI
_mesa_mmx_blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[],
GLubyte rgba[][4], const GLubyte dest[][4] );
+extern void _ASMAPI
+_mesa_mmx_blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLubyte rgba[][4], const GLubyte dest[][4] );
+
+extern void _ASMAPI
+_mesa_mmx_blend_min( GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLubyte rgba[][4], const GLubyte dest[][4] );
+
+extern void _ASMAPI
+_mesa_mmx_blend_max( GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLubyte rgba[][4], const GLubyte dest[][4] );
+
+extern void _ASMAPI
+_mesa_mmx_blend_modulate( GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLubyte rgba[][4], const GLubyte dest[][4] );
+
#endif
diff --git a/xc/extras/Mesa/src/X86/mmx_blend.S b/xc/extras/Mesa/src/X86/mmx_blend.S
index 8efae08f5..9fe3e7179 100644
--- a/xc/extras/Mesa/src/X86/mmx_blend.S
+++ b/xc/extras/Mesa/src/X86/mmx_blend.S
@@ -4,8 +4,10 @@
#include "matypes.h"
-/*
- * make the following approximation to the division (Sree)
+
+/* integer multiplication - alpha plus one
+ *
+ * makes the following approximation to the division (Sree)
*
* rgb*a/255 ~= (rgb*(a+1)) >> 256
*
@@ -13,12 +15,24 @@
*
* 0*0 = 0 and 255*255 = 255
*
- * note this one should be used alone
+ * note that MX1 is a register with 0xffffffffffffffff constant which can be easily obtained making
+ *
+ * PCMPEQW ( MX1, MX1 )
*/
-#define GMBT_ALPHA_PLUS_ONE 0
-
-/*
- * take the geometric series approximation to the division
+#define GMB_MULT_AP1( MP1, MA1, MP2, MA2, MX1 ) \
+ PSUBW ( MX1, MA1 ) /* a1 + 1 | a1 + 1 | a1 + 1 | a1 + 1 */ ;\
+ PMULLW ( MP1, MA1 ) /* t1 = p1*a1 */ ;\
+ ;\
+TWO(PSUBW ( MX1, MA2 )) /* a2 + 1 | a2 + 1 | a2 + 1 | a2 + 1 */ ;\
+TWO(PMULLW ( MP2, MA2 )) /* t2 = p2*a2 */ ;\
+ ;\
+ PSRLW ( CONST(8), MA1 ) /* t1 >> 8 ~= t1/255 */ ;\
+TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 ~= t2/255 */
+
+
+/* integer multiplication - geometric series
+ *
+ * takes the geometric series approximation to the division
*
* t/255 = (t >> 8) + (t >> 16) + (t >> 24) ..
*
@@ -29,390 +43,316 @@
* note that just by itself it doesn't satisfies the OpenGL criteria, as 255*255 = 254,
* so the special case a = 255 must be accounted or roundoff must be used
*/
-#define GMBT_GEOMETRIC_SERIES 1
-
-/*
+#define GMB_MULT_GS( MP1, MA1, MP2, MA2 ) \
+ PMULLW ( MP1, MA1 ) /* t1 = p1*a1 */ ;\
+TWO(PMULLW ( MP2, MA2 )) /* t2 = p2*a2 */ ;\
+ ;\
+ MOVQ ( MA1, MP1 ) ;\
+ PSRLW ( CONST(8), MA1 ) /* t1 >> 8 */ ;\
+ ;\
+TWO(MOVQ ( MA2, MP2 )) ;\
+TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 */ ;\
+ ;\
+ PADDW ( MP1, MA1 ) /* t1 + (t1 >> 8) ~= (t1/255) << 8 */ ;\
+ PSRLW ( CONST(8), MA1 ) /* sa1 | sb1 | sg1 | sr1 */ ;\
+ ;\
+TWO(PADDW ( MP2, MA2 )) /* t2 + (t2 >> 8) ~= (t2/255) << 8 */ ;\
+TWO(PSRLW ( CONST(8), MA2 )) /* sa2 | sb2 | sg2 | sr2 */
+
+
+/* integer multiplication - geometric series plus rounding
+ *
* when using a geometric series division instead of truncating the result
* use roundoff in the approximation (Jim Blinn)
*
* t = rgb*a + 0x80
*
* achieving the exact results
+ *
+ * note that M80 is register with the 0x0080008000800080 constant
*/
-#define GMBT_ROUNDOFF 0
-
-/* instead of the roundoff this adds a small correction to satisfy the OpenGL criteria
+#define GMB_MULT_GSR( MP1, MA1, MP2, MA2, M80 ) \
+ PMULLW ( MP1, MA1 ) /* t1 = p1*a1 */ ;\
+ PADDW ( M80, MA1 ) /* t1 += 0x80 */ ;\
+ ;\
+TWO(PMULLW ( MP2, MA2 )) /* t2 = p2*a2 */ ;\
+TWO(PADDW ( M80, MA2 )) /* t2 += 0x80 */ ;\
+ ;\
+ MOVQ ( MA1, MP1 ) ;\
+ PSRLW ( CONST(8), MA1 ) /* t1 >> 8 */ ;\
+ ;\
+TWO(MOVQ ( MA2, MP2 )) ;\
+TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 */ ;\
+ ;\
+ PADDW ( MP1, MA1 ) /* t1 + (t1 >> 8) ~= (t1/255) << 8 */ ;\
+ PSRLW ( CONST(8), MA1 ) /* sa1 | sb1 | sg1 | sr1 */ ;\
+ ;\
+TWO(PADDW ( MP2, MA2 )) /* t2 + (t2 >> 8) ~= (t2/255) << 8 */ ;\
+TWO(PSRLW ( CONST(8), MA2 )) /* sa2 | sb2 | sg2 | sr2 */
+
+
+/* linear interpolation - geometric series
+ */
+#define GMB_LERP_GS( MP1, MQ1, MA1, MP2, MQ2, MA2) \
+ PSUBW ( MQ1, MP1 ) /* pa1 - qa1 | pb1 - qb1 | pg1 - qg1 | pr1 - qr1 */ ;\
+ PSLLW ( CONST(8), MQ1 ) /* q1 << 8 */ ;\
+ PMULLW ( MP1, MA1 ) /* t1 = (q1 - p1)*pa1 */ ;\
+ ;\
+TWO(PSUBW ( MQ2, MP2 )) /* pa2 - qa2 | pb2 - qb2 | pg2 - qg2 | pr2 - qr2 */ ;\
+TWO(PSLLW ( CONST(8), MQ2 )) /* q2 << 8 */ ;\
+TWO(PMULLW ( MP2, MA2 )) /* t2 = (q2 - p2)*pa2 */ ;\
+ ;\
+ MOVQ ( MA1, MP1 ) ;\
+ PSRLW ( CONST(8), MA1 ) /* t1 >> 8 */ ;\
+ ;\
+TWO(MOVQ ( MA2, MP2 )) ;\
+TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 */ ;\
+ ;\
+ PADDW ( MP1, MA1 ) /* t1 + (t1 >> 8) ~= (t1/255) << 8 */ ;\
+TWO(PADDW ( MP2, MA2 )) /* t2 + (t2 >> 8) ~= (t2/255) << 8 */ ;\
+ ;\
+ PADDW ( MQ1, MA1 ) /* (t1/255 + q1) << 8 */ ;\
+TWO(PADDW ( MQ2, MA2 )) /* (t2/255 + q2) << 8 */ ;\
+ ;\
+ PSRLW ( CONST(8), MA1 ) /* sa1 | sb1 | sg1 | sr1 */ ;\
+TWO(PSRLW ( CONST(8), MA2 )) /* sa2 | sb2 | sg2 | sr2 */
+
+
+/* linear interpolation - geometric series with roundoff
*
- * t/255 ~= (t + (t >> 8) + (t >> 15)) >> 8
+ * this is a generalization of Blinn's formula to signed arithmetic
*
- * note that although is faster than rounding off it doesn't give always the exact results
+ * note that M80 is a register with the 0x0080008000800080 constant
*/
-#define GMBT_GEOMETRIC_CORRECTION 1
-
-/*
- * do
+#define GMB_LERP_GSR( MP1, MQ1, MA1, MP2, MQ2, MA2, M80) \
+ PSUBW ( MQ1, MP1 ) /* pa1 - qa1 | pb1 - qb1 | pg1 - qg1 | pr1 - qr1 */ ;\
+ PSLLW ( CONST(8), MQ1 ) /* q1 << 8 */ ;\
+ PMULLW ( MP1, MA1 ) /* t1 = (q1 - p1)*pa1 */ ;\
+ ;\
+TWO(PSUBW ( MQ2, MP2 )) /* pa2 - qa2 | pb2 - qb2 | pg2 - qg2 | pr2 - qr2 */ ;\
+TWO(PSLLW ( CONST(8), MQ2 )) /* q2 << 8 */ ;\
+TWO(PMULLW ( MP2, MA2 )) /* t2 = (q2 - p2)*pa2 */ ;\
+ ;\
+ PSRLW ( CONST(15), MP1 ) /* q1 > p1 ? 1 : 0 */ ;\
+TWO(PSRLW ( CONST(15), MP2 )) /* q2 > q2 ? 1 : 0 */ ;\
+ ;\
+ PSLLW ( CONST(8), MP1 ) /* q1 > p1 ? 0x100 : 0 */ ;\
+TWO(PSLLW ( CONST(8), MP2 )) /* q2 > q2 ? 0x100 : 0 */ ;\
+ ;\
+ PSUBW ( MP1, MA1 ) /* t1 -=? 0x100 */ ;\
+TWO(PSUBW ( MP2, MA2 )) /* t2 -=? 0x100 */ ;\
+ ;\
+ PADDW ( M80, MA1 ) /* t1 += 0x80 */ ;\
+TWO(PADDW ( M80, MA2 )) /* t2 += 0x80 */ ;\
+ ;\
+ MOVQ ( MA1, MP1 ) ;\
+ PSRLW ( CONST(8), MA1 ) /* t1 >> 8 */ ;\
+ ;\
+TWO(MOVQ ( MA2, MP2 )) ;\
+TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 */ ;\
+ ;\
+ PADDW ( MP1, MA1 ) /* t1 + (t1 >> 8) ~= (t1/255) << 8 */ ;\
+TWO(PADDW ( MP2, MA2 )) /* t2 + (t2 >> 8) ~= (t2/255) << 8 */ ;\
+ ;\
+ PADDW ( MQ1, MA1 ) /* (t1/255 + q1) << 8 */ ;\
+TWO(PADDW ( MQ2, MA2 )) /* (t2/255 + q2) << 8 */ ;\
+ ;\
+ PSRLW ( CONST(8), MA1 ) /* sa1 | sb1 | sg1 | sr1 */ ;\
+TWO(PSRLW ( CONST(8), MA2 )) /* sa2 | sb2 | sg2 | sr2 */
+
+
+/* linear interpolation - geometric series with correction
+ *
+ * instead of the roundoff this adds a small correction to satisfy the OpenGL criteria
*
- * s = (q - p)*a + q
+ * t/255 ~= (t + (t >> 8) + (t >> 15)) >> 8
*
- * instead of
+ * note that although is faster than rounding off it doesn't give always the exact results
+ */
+#define GMB_LERP_GSC( MP1, MQ1, MA1, MP2, MQ2, MA2) \
+ PSUBW ( MQ1, MP1 ) /* pa1 - qa1 | pb1 - qb1 | pg1 - qg1 | pr1 - qr1 */ ;\
+ PSLLW ( CONST(8), MQ1 ) /* q1 << 8 */ ;\
+ PMULLW ( MP1, MA1 ) /* t1 = (q1 - p1)*pa1 */ ;\
+ ;\
+TWO(PSUBW ( MQ2, MP2 )) /* pa2 - qa2 | pb2 - qb2 | pg2 - qg2 | pr2 - qr2 */ ;\
+TWO(PSLLW ( CONST(8), MQ2 )) /* q2 << 8 */ ;\
+TWO(PMULLW ( MP2, MA2 )) /* t2 = (q2 - p2)*pa2 */ ;\
+ ;\
+ MOVQ ( MA1, MP1 ) ;\
+ PSRLW ( CONST(8), MA1 ) /* t1 >> 8 */ ;\
+ ;\
+TWO(MOVQ ( MA2, MP2 )) ;\
+TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 */ ;\
+ ;\
+ PADDW ( MA1, MP1 ) /* t1 + (t1 >> 8) ~= (t1/255) << 8 */ ;\
+ PSRLW ( CONST(7), MA1 ) /* t1 >> 15 */ ;\
+ ;\
+TWO(PADDW ( MA2, MP2 )) /* t2 + (t2 >> 8) ~= (t2/255) << 8 */ ;\
+TWO(PSRLW ( CONST(7), MA2 )) /* t2 >> 15 */ ;\
+ ;\
+ PADDW ( MP1, MA1 ) /* t1 + (t1 >> 8) + (t1 >>15) ~= (t1/255) << 8 */ ;\
+TWO(PADDW ( MP2, MA2 )) /* t2 + (t2 >> 8) + (t2 >>15) ~= (t2/255) << 8 */ ;\
+ ;\
+ PADDW ( MQ1, MA1 ) /* (t1/255 + q1) << 8 */ ;\
+TWO(PADDW ( MQ2, MA2 )) /* (t2/255 + q2) << 8 */ ;\
+ ;\
+ PSRLW ( CONST(8), MA1 ) /* sa1 | sb1 | sg1 | sr1 */ ;\
+TWO(PSRLW ( CONST(8), MA2 )) /* sa2 | sb2 | sg2 | sr2 */
+
+
+/* common blending setup code
*
- * s = p*a + q*(1-a)
+ * note that M00 is a register with 0x0000000000000000 constant which can be easily obtained making
*
- * this eliminates a multiply at the expense of
- * complicating the roundoff but is generally worth it
+ * PXOR ( M00, M00 )
*/
-#define GMBT_SIGNED_ARITHMETIC 1
+#define GMB_LOAD(rgba, dest, MPP, MQQ) \
+ONE(MOVD ( REGIND(rgba), MPP )) /* | | | | qa1 | qb1 | qg1 | qr1 */ ;\
+ONE(MOVD ( REGIND(dest), MQQ )) /* | | | | pa1 | pb1 | pg1 | pr1 */ ;\
+ ;\
+TWO(MOVQ ( REGIND(rgba), MPP )) /* qa2 | qb2 | qg2 | qr2 | qa1 | qb1 | qg1 | qr1 */ ;\
+TWO(MOVQ ( REGIND(dest), MQQ )) /* pa2 | pb2 | pg2 | pr2 | pa1 | pb1 | pg1 | pr1 */
+
+#define GMB_UNPACK(MP1, MQ1, MP2, MQ2, M00) \
+TWO(MOVQ ( MP1, MP2 )) ;\
+TWO(MOVQ ( MQ1, MQ2 )) ;\
+ ;\
+ PUNPCKLBW ( M00, MQ1 ) /* qa1 | qb1 | qg1 | qr1 */ ;\
+TWO(PUNPCKHBW ( M00, MQ2 )) /* qa2 | qb2 | qg2 | qr2 */ ;\
+ PUNPCKLBW ( M00, MP1 ) /* pa1 | pb1 | pg1 | pr1 */ ;\
+TWO(PUNPCKHBW ( M00, MP2 )) /* pa2 | pb2 | pg2 | pr2 */
+
+#define GMB_ALPHA(MP1, MA1, MP2, MA2) \
+ MOVQ ( MP1, MA1 ) ;\
+TWO(MOVQ ( MP2, MA2 )) ;\
+ ;\
+ PUNPCKHWD ( MA1, MA1 ) /* pa1 | pa1 | | */ ;\
+TWO(PUNPCKHWD ( MA2, MA2 )) /* pa2 | pa2 | | */ ;\
+ PUNPCKHDQ ( MA1, MA1 ) /* pa1 | pa1 | pa1 | pa1 */ ;\
+TWO(PUNPCKHDQ ( MA2, MA2 )) /* pa2 | pa2 | pa2 | pa2 */
+
+#define GMB_PACK( MS1, MS2 ) \
+ PACKUSWB ( MS2, MS1 ) /* sa2 | sb2 | sg2 | sr2 | sa1 | sb1 | sg1 | sr1 */ ;\
+
+#define GMB_STORE(rgba, MSS ) \
+ONE(MOVD ( MSS, REGIND(rgba) )) /* | | | | sa1 | sb1 | sg1 | sr1 */ ;\
+TWO(MOVQ ( MSS, REGIND(rgba) )) /* sa2 | sb2 | sg2 | sr2 | sa1 | sb1 | sg1 | sr1 */
+
-#if GMBT_ROUNDOFF
SEG_DATA
ALIGNDATA8
+const_0080:
+ D_LONG 0x00800080, 0x00800080
+
const_80:
- D_LONG 0x00800080, 0x00800080
-#endif
+ D_LONG 0x80808080, 0x80808080
- SEG_TEXT
+ SEG_TEXT
-ALIGNTEXT16
-GLOBL GLNAME(_mesa_mmx_blend_transparency)
-/*
- * void blend_transparency( GLcontext *ctx,
- * GLuint n,
- * const GLubyte mask[],
- * GLchan rgba[][4],
- * CONST GLchan dest[][4] )
- *
- * Common transparency blending mode.
+/* Blend transparency function
*/
-GLNAME( _mesa_mmx_blend_transparency ):
-
- PUSH_L ( EBP )
- MOV_L ( ESP, EBP )
- PUSH_L ( ESI )
- PUSH_L ( EDI )
- PUSH_L ( EBX )
-
- MOV_L ( REGOFF(12, EBP), ECX ) /* n */
- CMP_L ( CONST(0), ECX)
- JE ( LLBL (GMBT_return) )
-
- MOV_L ( REGOFF(16, EBP), EBX ) /* mask */
- MOV_L ( REGOFF(20, EBP), EDI ) /* rgba */
- MOV_L ( REGOFF(24, EBP), ESI ) /* dest */
-
- TEST_L ( CONST(4), EDI ) /* align rgba on an 8-byte boundary */
- JZ ( LLBL (GMBT_align_end) )
-
- CMP_B ( CONST(0), REGIND(EBX) ) /* *mask == 0 */
- JE ( LLBL (GMBT_align_continue) )
-
- PXOR ( MM0, MM0 ) /* 0x0000 | 0x0000 | 0x0000 | 0x0000 */
-
- MOVD ( REGIND(ESI), MM1 ) /* | | | | qa1 | qb1 | qg1 | qr1 */
- MOVD ( REGIND(EDI), MM2 ) /* | | | | pa1 | pb1 | pg1 | pr1 */
-
- PUNPCKLBW ( MM0, MM1 ) /* qa1 | qb1 | qg1 | qr1 */
- PUNPCKLBW ( MM0, MM2 ) /* pa1 | pb1 | pg1 | pr1 */
-
- MOVQ ( MM2, MM3 )
-
- PUNPCKHWD ( MM3, MM3 ) /* pa1 | pa1 | | */
- PUNPCKHDQ ( MM3, MM3 ) /* pa1 | pa1 | pa1 | pa1 */
-
-#if GMBT_ALPHA_PLUS_ONE
- PCMPEQW ( MM4, MM4 ) /* 0xffff | 0xffff | 0xffff | 0xffff */
-
- PSUBW ( MM4, MM3 ) /* pa1 + 1 | pa1 + 1 | pa1 + 1 | pa1 + 1 */
-#endif
-
-#if GMBT_SIGNED_ARITHMETIC
- PSUBW ( MM1, MM2 ) /* pa1 - qa1 | pb1 - qb1 | pg1 - qg1 | pr1 - qr1 */
-
- PSLLW ( CONST(8), MM1 ) /* q1 << 8 */
-
-#if GMBT_ROUNDOFF
- MOVQ ( MM2, MM4 )
-#endif
-
- PMULLW ( MM3, MM2 ) /* t1 = (q1 - p1)*pa1 */
-
-#if GMBT_ROUNDOFF
- PSRLW ( CONST(15), MM4 ) /* q1 > p1 ? 1 : 0 */
-
- PSLLW ( CONST(8), MM4 ) /* q1 > p1 ? 0x100 : 0 */
-
- PSUBW ( MM4, MM2 ) /* t1 -=? 0x100 */
-#endif
-
-#else
- PCMPEQW ( MM4, MM4 ) /* 0xffff | 0xffff | 0xffff | 0xffff */
- PUNPCKLBW ( MM0, MM4 ) /* 0x00ff | 0x00ff | 0x00ff | 0x00ff */
- MOVQ ( MM4, MM0 )
-
- PMULLW ( MM3, MM2 ) /* p1*pa1 */
-
- PSUBW ( MM3, MM0 ) /* 255 - pa1 | 255 - pa1 | 255 - pa1 | 255 - pa1 */
-
- PMULLW ( MM0, MM1 ) /* q1*(255 - pa1) */
-
- PADDW ( MM1, MM2 ) /* t1 = p1*pa1 + q1*(255 - pa1) */
-#endif
-
-#if GMBT_ROUNDOFF
- MOVQ ( CONTENT(const_80), MM4 )
-
- PADDW ( MM4, MM2 ) /* t1 += 0x80 */
-#endif
-
-#if GMBT_GEOMETRIC_SERIES
- MOVQ ( MM2, MM3 )
- PSRLW ( CONST(8), MM3 ) /* t1 >> 8 */
-
- PADDW ( MM3, MM2 ) /* t1 + (t1 >> 8) ~= (t1/255) << 8 */
-#endif
-
-#if GMBT_SIGNED_ARITHMETIC
- PADDW ( MM1, MM2 ) /* (t1/255 + q1) << 8 */
-#endif
-
- PSRLW ( CONST(8), MM2 ) /* sa1 | sb1 | sg1 | sr1 */
-
- PACKUSWB ( MM0, MM2 ) /* | | | | sa1 | sb1 | sg1 | sr1 */
- MOVD ( MM2, REGIND(EDI) )
-
-LLBL (GMBT_align_continue):
-
- DEC_L ( ECX ) /* n -= 1 */
- INC_L ( EBX ) /* mask += 1 */
- ADD_L ( CONST(4), EDI ) /* rgba += 1 */
- ADD_L ( CONST(4), ESI ) /* dest += 1 */
-
-LLBL (GMBT_align_end):
-
- CMP_L ( CONST(2), ECX)
- JB ( LLBL (GMBT_loop_end) )
-
-ALIGNTEXT16
-LLBL (GMBT_loop_begin):
-
- CMP_W ( CONST(0), REGIND(EBX) ) /* *mask == 0 && *(mask + 1) == 0 */
- JE ( LLBL (GMBT_loop_continue) )
-
- /* NOTE: the instruction pairing when multiple pipelines are available must be checked */
-
- PXOR ( MM0, MM0 ) /* 0x0000 | 0x0000 | 0x0000 | 0x0000 */
-
- MOVQ ( REGIND(ESI), MM7 ) /* qa2 | qb2 | qg2 | qr2 | qa1 | qb1 | qg1 | qr1 */
- MOVQ ( REGIND(EDI), MM6 ) /* pa2 | pb2 | pg2 | pr2 | pa1 | pb1 | pg1 | pr1 */
-
- MOVQ ( MM7, MM1 )
- MOVQ ( MM6, MM2 )
-
- PUNPCKLBW ( MM0, MM1 ) /* qa1 | qb1 | qg1 | qr1 */
- PUNPCKHBW ( MM0, MM7 ) /* qa2 | qb2 | qg2 | qr2 */
- PUNPCKLBW ( MM0, MM2 ) /* pa1 | pb1 | pg1 | pr1 */
- PUNPCKHBW ( MM0, MM6 ) /* pa2 | pb2 | pg2 | pr2 */
-
- MOVQ ( MM2, MM3 )
- MOVQ ( MM6, MM5 )
-
- PUNPCKHWD ( MM3, MM3 ) /* pa1 | pa1 | | */
- PUNPCKHWD ( MM5, MM5 ) /* pa2 | pa2 | | */
- PUNPCKHDQ ( MM3, MM3 ) /* pa1 | pa1 | pa1 | pa1 */
- PUNPCKHDQ ( MM5, MM5 ) /* pa2 | pa2 | pa2 | pa2 */
-
-#if GMBT_ALPHA_PLUS_ONE
- PCMPEQW ( MM4, MM4 ) /* 0xffff | 0xffff | 0xffff | 0xffff */
-
- PSUBW ( MM4, MM3 ) /* pa1 + 1 | pa1 + 1 | pa1 + 1 | pa1 + 1 */
- PSUBW ( MM4, MM5 ) /* pa2 + 1 | pa2 + 1 | pa2 + 1 | pa2 + 1 */
-#endif
-
-#if GMBT_SIGNED_ARITHMETIC
- PSUBW ( MM1, MM2 ) /* pa1 - qa1 | pb1 - qb1 | pg1 - qg1 | pr1 - qr1 */
- PSUBW ( MM7, MM6 ) /* pa2 - qa2 | pb2 - qb2 | pg2 - qg2 | pr2 - qr2 */
-
- PSLLW ( CONST(8), MM1 ) /* q1 << 8 */
- PSLLW ( CONST(8), MM7 ) /* q2 << 8 */
-
-#if GMBT_ROUNDOFF
- MOVQ ( MM2, MM0 )
- MOVQ ( MM6, MM4 )
-#endif
-
- PMULLW ( MM3, MM2 ) /* t1 = (q1 - p1)*pa1 */
- PMULLW ( MM5, MM6 ) /* t2 = (q2 - p2)*pa2 */
-
-#if GMBT_ROUNDOFF
- PSRLW ( CONST(15), MM0 ) /* q1 > p1 ? 1 : 0 */
- PSRLW ( CONST(15), MM4 ) /* q2 > q2 ? 1 : 0 */
-
- PSLLW ( CONST(8), MM0 ) /* q1 > p1 ? 0x100 : 0 */
- PSLLW ( CONST(8), MM4 ) /* q2 > q2 ? 0x100 : 0 */
-
- PSUBW ( MM0, MM2 ) /* t1 -=? 0x100 */
- PSUBW ( MM4, MM7 ) /* t2 -=? 0x100 */
-#endif
-
-#else
- PCMPEQW ( MM4, MM4 ) /* 0xffff | 0xffff | 0xffff | 0xffff */
- PUNPCKLBW ( MM0, MM4 ) /* 0x00ff | 0x00ff | 0x00ff | 0x00ff */
- MOVQ ( MM4, MM0 )
-
- PMULLW ( MM3, MM2 ) /* p1*pa1 */
- PMULLW ( MM5, MM6 ) /* p2*pa2 */
-
- PSUBW ( MM3, MM0 ) /* 255 - pa1 | 255 - pa1 | 255 - pa1 | 255 - pa1 */
- PSUBW ( MM5, MM4 ) /* 255 - pa2 | 255 - pa2 | 255 - pa2 | 255 - pa2 */
-
- PMULLW ( MM0, MM1 ) /* q1*(255 - pa1) */
- PMULLW ( MM4, MM7 ) /* q2*(255 - pa2) */
-
- PADDW ( MM1, MM2 ) /* t1 = p1*pa1 + q1*(255 - pa1) */
- PADDW ( MM7, MM6 ) /* t2 = p2*pa2 + q2*(255 - pa2) */
-#endif
-
-#if GMBT_ROUNDOFF
- MOVQ ( CONTENT(const_80), MM4 )
-
- PADDW ( MM4, MM2 ) /* t1 += 0x80 */
- PADDW ( MM4, MM6 ) /* t2 += 0x80 */
-#endif
-
-#if GMBT_GEOMETRIC_SERIES
- MOVQ ( MM2, MM3 )
- MOVQ ( MM6, MM5 )
-
- PSRLW ( CONST(8), MM3 ) /* t1 >> 8 */
- PSRLW ( CONST(8), MM5 ) /* t2 >> 8 */
-
- PADDW ( MM3, MM2 ) /* t1 + (t1 >> 8) ~= (t1/255) << 8 */
- PADDW ( MM5, MM6 ) /* t2 + (t2 >> 8) ~= (t2/255) << 8 */
-
-#if GMBT_GEOMETRIC_CORRECTION
- PSRLW ( CONST(7), MM3 ) /* t1 >> 15 */
- PSRLW ( CONST(7), MM5 ) /* t2 >> 15 */
-
- PADDW ( MM3, MM2 ) /* t1 + (t1 >> 8) + (t1 >>15) ~= (t1/255) << 8 */
- PADDW ( MM5, MM6 ) /* t2 + (t2 >> 8) + (t2 >>15) ~= (t2/255) << 8 */
-#endif
-#endif
-
-#if GMBT_SIGNED_ARITHMETIC
- PADDW ( MM1, MM2 ) /* (t1/255 + q1) << 8 */
- PADDW ( MM7, MM6 ) /* (t2/255 + q2) << 8 */
-#endif
-
- PSRLW ( CONST(8), MM2 ) /* sa1 | sb1 | sg1 | sr1 */
- PSRLW ( CONST(8), MM6 ) /* sa2 | sb2 | sg2 | sr2 */
-
- PACKUSWB ( MM6, MM2 ) /* sa2 | sb2 | sg2 | sr2 | sa1 | sb1 | sg1 | sr1 */
- MOVQ ( MM2, REGIND(EDI) )
-
-LLBL (GMBT_loop_continue):
-
- DEC_L ( ECX )
- DEC_L ( ECX ) /* n -= 2 */
- ADD_L ( CONST(2), EBX ) /* mask += 2 */
- ADD_L ( CONST(8), EDI ) /* rgba += 2 */
- ADD_L ( CONST(8), ESI ) /* dest += 2 */
- CMP_L ( CONST(2), ECX )
- JAE ( LLBL (GMBT_loop_begin) )
-
-LLBL (GMBT_loop_end):
-
- CMP_L ( CONST(1), ECX )
- JB ( LLBL (GMBT_done) )
-
- CMP_B ( CONST(0), REGIND(EBX) ) /* *mask == 0 */
- JE ( LLBL (GMBT_done) )
+#define TAG(x) x##_transparency
+#define INIT \
PXOR ( MM0, MM0 ) /* 0x0000 | 0x0000 | 0x0000 | 0x0000 */
- MOVD ( REGIND(ESI), MM1 ) /* | | | | qa1 | qb1 | qg1 | qr1 */
- MOVD ( REGIND(EDI), MM2 ) /* | | | | pa1 | pb1 | pg1 | pr1 */
+#define MAIN( rgba, dest ) \
+ GMB_LOAD( rgba, dest, MM1, MM2 ) ;\
+ GMB_UNPACK( MM1, MM2, MM4, MM5, MM0 ) ;\
+ GMB_ALPHA( MM1, MM3, MM4, MM6 ) ;\
+ GMB_LERP_GSC( MM1, MM2, MM3, MM4, MM5, MM6 ) ;\
+ GMB_PACK( MM3, MM6 ) ;\
+ GMB_STORE( rgba, MM3 )
- PUNPCKLBW ( MM0, MM1 ) /* qa1 | qb1 | qg1 | qr1 */
- PUNPCKLBW ( MM0, MM2 ) /* pa1 | pb1 | pg1 | pr1 */
+#include "mmx_blendtmp.h"
- MOVQ ( MM2, MM3 )
- PUNPCKHWD ( MM3, MM3 ) /* pa1 | pa1 | | */
- PUNPCKHDQ ( MM3, MM3 ) /* pa1 | pa1 | pa1 | pa1 */
-
-#if GMBT_ALPHA_PLUS_ONE
- PCMPEQW ( MM4, MM4 ) /* 0xffff | 0xffff | 0xffff | 0xffff */
+/* Blend add function
+ *
+ * FIXME: Add some loop unrolling here...
+ */
- PSUBW ( MM4, MM3 ) /* pa1 + 1 | pa1 + 1 | pa1 + 1 | pa1 + 1 */
-#endif
+#define TAG(x) x##_add
-#if GMBT_SIGNED_ARITHMETIC
- PSUBW ( MM1, MM2 ) /* pa1 - qa1 | pb1 - qb1 | pg1 - qg1 | pr1 - qr1 */
+#define INIT
- PSLLW ( CONST(8), MM1 ) /* q1 << 8 */
+#define MAIN( rgba, dest ) \
+ONE(MOVD ( REGIND(rgba), MM1 )) /* | | | | qa1 | qb1 | qg1 | qr1 */ ;\
+ONE(MOVD ( REGIND(dest), MM2 )) /* | | | | pa1 | pb1 | pg1 | pr1 */ ;\
+ONE(PADDUSB ( MM2, MM1 )) ;\
+ONE(MOVD ( MM1, REGIND(rgba) )) /* | | | | sa1 | sb1 | sg1 | sr1 */ ;\
+ ;\
+TWO(MOVQ ( REGIND(rgba), MM1 )) /* qa2 | qb2 | qg2 | qr2 | qa1 | qb1 | qg1 | qr1 */ ;\
+TWO(PADDUSB ( REGIND(dest), MM1 )) /* sa2 | sb2 | sg2 | sr2 | sa1 | sb1 | sg1 | sr1 */ ;\
+TWO(MOVQ ( MM1, REGIND(rgba) ))
-#if GMBT_ROUNDOFF
- MOVQ ( MM2, MM4 )
-#endif
+#include "mmx_blendtmp.h"
- PMULLW ( MM3, MM2 ) /* t1 = (q1 - p1)*pa1 */
-#if GMBT_ROUNDOFF
- PSRLW ( CONST(15), MM4 ) /* q1 > p1 ? 1 : 0 */
+/* Blend min function
+ */
- PSLLW ( CONST(8), MM4 ) /* q1 > p1 ? 0x100 : 0 */
+#define TAG(x) x##_min
- PSUBW ( MM4, MM2 ) /* t1 -=? 0x100 */
-#endif
+#define INIT \
+ MOVQ ( CONTENT(const_80), MM7 ) /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/
-#else
- PCMPEQW ( MM4, MM4 ) /* 0xffff | 0xffff | 0xffff | 0xffff */
- PUNPCKLBW ( MM0, MM4 ) /* 0x00ff | 0x00ff | 0x00ff | 0x00ff */
- MOVQ ( MM4, MM0 )
-
- PMULLW ( MM3, MM2 ) /* p1*pa1 */
+#define MAIN( rgba, dest ) \
+ GMB_LOAD( rgba, dest, MM1, MM2 ) ;\
+ MOVQ ( MM1, MM3 ) ;\
+ MOVQ ( MM2, MM4 ) ;\
+ PXOR ( MM7, MM3 ) /* unsigned -> signed */ ;\
+ PXOR ( MM7, MM4 ) /* unsigned -> signed */ ;\
+ PCMPGTB ( MM3, MM4 ) /* q > p ? 0xff : 0x00 */ ;\
+ PAND ( MM4, MM1 ) /* q > p ? p : 0 */ ;\
+ PANDN ( MM2, MM4 ) /* q > p ? 0 : q */ ;\
+ POR ( MM1, MM4 ) /* q > p ? p : q */ ;\
+ GMB_STORE( rgba, MM4 )
- PSUBW ( MM3, MM0 ) /* 255 - pa1 | 255 - pa1 | 255 - pa1 | 255 - pa1 */
+#include "mmx_blendtmp.h"
- PMULLW ( MM0, MM1 ) /* q1*(255 - pa1) */
- PADDW ( MM1, MM2 ) /* t1 = p1*pa1 + q1*(255 - pa1) */
-#endif
+/* Blend max function
+ */
-#if GMBT_ROUNDOFF
- MOVQ ( CONTENT(const_80), MM4 )
+#define TAG(x) x##_max
- PADDW ( MM4, MM2 ) /* t1 += 0x80 */
-#endif
+#define INIT \
+ MOVQ ( CONTENT(const_80), MM7 ) /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/
-#if GMBT_GEOMETRIC_SERIES
- MOVQ ( MM2, MM3 )
+#define MAIN( rgba, dest ) \
+ GMB_LOAD( rgba, dest, MM1, MM2 ) ;\
+ MOVQ ( MM1, MM3 ) ;\
+ MOVQ ( MM2, MM4 ) ;\
+ PXOR ( MM7, MM3 ) /* unsigned -> signed */ ;\
+ PXOR ( MM7, MM4 ) /* unsigned -> signed */ ;\
+ PCMPGTB ( MM3, MM4 ) /* q > p ? 0xff : 0x00 */ ;\
+ PAND ( MM4, MM2 ) /* q > p ? q : 0 */ ;\
+ PANDN ( MM1, MM4 ) /* q > p ? 0 : p */ ;\
+ POR ( MM2, MM4 ) /* q > p ? p : q */ ;\
+ GMB_STORE( rgba, MM4 )
- PSRLW ( CONST(8), MM3 ) /* t1 >> 8 */
+#include "mmx_blendtmp.h"
- PADDW ( MM3, MM2 ) /* t1 + (t1 >> 8) ~= (t1/255) << 8 */
-#endif
-#if GMBT_SIGNED_ARITHMETIC
- PADDW ( MM1, MM2 ) /* (t1/255 + q1) << 8 */
-#endif
+/* Blend modulate function
+ */
- PSRLW ( CONST(8), MM2 ) /* sa1 | sb1 | sg1 | sr1 */
-
- PACKUSWB ( MM0, MM2 ) /* | | | | sa1 | sb1 | sg1 | sr1 */
- MOVD ( MM2, REGIND(EDI) )
+#define TAG(x) x##_modulate
-LLBL (GMBT_done):
+#define INIT \
+ PXOR ( MM0, MM0 ) /* 0x0000 | 0x0000 | 0x0000 | 0x0000 */ ;\
+ MOVQ ( CONTENT(const_0080), MM7 ) /* 0x0080 | 0x0080 | 0x0080 | 0x0080 */
- EMMS
+#define MAIN( rgba, dest ) \
+ GMB_LOAD( rgba, dest, MM1, MM2 ) ;\
+ GMB_UNPACK( MM1, MM2, MM4, MM5, MM0 ) ;\
+ GMB_MULT_GSR( MM1, MM2, MM4, MM5, MM7 ) ;\
+ GMB_PACK( MM2, MM5 ) ;\
+ GMB_STORE( rgba, MM2 )
-LLBL (GMBT_return):
+#include "mmx_blendtmp.h"
- POP_L ( EBX )
- POP_L ( EDI )
- POP_L ( ESI )
- MOV_L ( EBP, ESP )
- POP_L ( EBP )
- RET
diff --git a/xc/extras/Mesa/src/X86/mmx_blendtmp.h b/xc/extras/Mesa/src/X86/mmx_blendtmp.h
new file mode 100644
index 000000000..1a8190355
--- /dev/null
+++ b/xc/extras/Mesa/src/X86/mmx_blendtmp.h
@@ -0,0 +1,113 @@
+/*
+ * Written by José Fonseca <j_r_fonseca@yahoo.co.uk>
+ */
+
+
+/*
+ * void _mesa_mmx_blend( GLcontext *ctx,
+ * GLuint n,
+ * const GLubyte mask[],
+ * GLchan rgba[][4],
+ * CONST GLchan dest[][4] )
+ *
+ */
+ALIGNTEXT16
+GLOBL GLNAME( TAG(_mesa_mmx_blend) )
+
+GLNAME( TAG(_mesa_mmx_blend) ):
+
+ PUSH_L ( EBP )
+ MOV_L ( ESP, EBP )
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+ PUSH_L ( EBX )
+
+ MOV_L ( REGOFF(12, EBP), ECX ) /* n */
+ CMP_L ( CONST(0), ECX)
+ JE ( LLBL ( TAG(GMB_return) ) )
+
+ MOV_L ( REGOFF(16, EBP), EBX ) /* mask */
+ MOV_L ( REGOFF(20, EBP), EDI ) /* rgba */
+ MOV_L ( REGOFF(24, EBP), ESI ) /* dest */
+
+ INIT
+
+ TEST_L ( CONST(4), EDI ) /* align rgba on an 8-byte boundary */
+ JZ ( LLBL ( TAG(GMB_align_end) ) )
+
+ CMP_B ( CONST(0), REGIND(EBX) ) /* *mask == 0 */
+ JE ( LLBL ( TAG(GMB_align_continue) ) )
+
+ /* runin */
+#define ONE(x) x
+#define TWO(x)
+ MAIN ( EDI, ESI )
+#undef ONE
+#undef TWO
+
+LLBL ( TAG(GMB_align_continue) ):
+
+ DEC_L ( ECX ) /* n -= 1 */
+ INC_L ( EBX ) /* mask += 1 */
+ ADD_L ( CONST(4), EDI ) /* rgba += 1 */
+ ADD_L ( CONST(4), ESI ) /* dest += 1 */
+
+LLBL ( TAG(GMB_align_end) ):
+
+ CMP_L ( CONST(2), ECX)
+ JB ( LLBL ( TAG(GMB_loop_end) ) )
+
+ALIGNTEXT16
+LLBL ( TAG(GMB_loop_begin) ):
+
+ CMP_W ( CONST(0), REGIND(EBX) ) /* *mask == 0 && *(mask + 1) == 0 */
+ JE ( LLBL ( TAG(GMB_loop_continue) ) )
+
+ /* main loop */
+#define ONE(x)
+#define TWO(x) x
+ MAIN ( EDI, ESI )
+#undef ONE
+#undef TWO
+
+LLBL ( TAG(GMB_loop_continue) ):
+
+ DEC_L ( ECX )
+ DEC_L ( ECX ) /* n -= 2 */
+ ADD_L ( CONST(2), EBX ) /* mask += 2 */
+ ADD_L ( CONST(8), EDI ) /* rgba += 2 */
+ ADD_L ( CONST(8), ESI ) /* dest += 2 */
+ CMP_L ( CONST(2), ECX )
+ JAE ( LLBL ( TAG(GMB_loop_begin) ) )
+
+LLBL ( TAG(GMB_loop_end) ):
+
+ CMP_L ( CONST(1), ECX )
+ JB ( LLBL ( TAG(GMB_done) ) )
+
+ CMP_B ( CONST(0), REGIND(EBX) ) /* *mask == 0 */
+ JE ( LLBL ( TAG(GMB_done) ) )
+
+ /* runout */
+#define ONE(x) x
+#define TWO(x)
+ MAIN ( EDI, ESI )
+#undef ONE
+#undef TWO
+
+LLBL ( TAG(GMB_done) ):
+
+ EMMS
+
+LLBL ( TAG(GMB_return) ):
+
+ POP_L ( EBX )
+ POP_L ( EDI )
+ POP_L ( ESI )
+ MOV_L ( EBP, ESP )
+ POP_L ( EBP )
+ RET
+
+#undef TAG
+#undef INIT
+#undef MAIN
diff --git a/xc/extras/Mesa/src/X86/norm_args.h b/xc/extras/Mesa/src/X86/norm_args.h
index 7c44fef83..596061c17 100644
--- a/xc/extras/Mesa/src/X86/norm_args.h
+++ b/xc/extras/Mesa/src/X86/norm_args.h
@@ -1,4 +1,3 @@
-/* $Id: norm_args.h,v 1.1.1.1 2002/10/22 13:06:14 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -29,7 +28,7 @@
* FRAME_OFFSET to the number of bytes pushed onto the stack before
* using the ARG_* argument macros.
*
- * Gareth Hughes <gareth@valinux.com>
+ * Gareth Hughes
*/
#ifndef __NORM_ARGS_H__
diff --git a/xc/extras/Mesa/src/X86/sse.c b/xc/extras/Mesa/src/X86/sse.c
index dea52e9e3..ea3496924 100644
--- a/xc/extras/Mesa/src/X86/sse.c
+++ b/xc/extras/Mesa/src/X86/sse.c
@@ -1,4 +1,3 @@
-/* $Id: sse.c,v 1.1.1.1 2002/10/22 13:06:08 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -31,7 +30,6 @@
#include "glheader.h"
#include "context.h"
-#include "math/m_vertices.h"
#include "math/m_xform.h"
#include "tnl/t_context.h"
@@ -118,19 +116,3 @@ void _mesa_init_sse_transform_asm( void )
#endif
}
-void _mesa_init_sse_vertex_asm( void )
-{
-#ifdef USE_SSE_ASM
- _mesa_xform_points3_v16_general = _mesa_v16_sse_general_xform;
-#if 0
- /* GH: These are broken. I'm fixing them now.
- */
- _mesa_project_v16 = _mesa_sse_project_vertices;
- _mesa_project_clipped_v16 = _mesa_sse_project_clipped_vertices;
-#endif
-
-#ifdef DEBUG_NOT
- _math_test_all_vertex_functions( "SSE" );
-#endif
-#endif
-}
diff --git a/xc/extras/Mesa/src/X86/sse.h b/xc/extras/Mesa/src/X86/sse.h
index 0d0ce4c14..521f91e41 100644
--- a/xc/extras/Mesa/src/X86/sse.h
+++ b/xc/extras/Mesa/src/X86/sse.h
@@ -1,4 +1,3 @@
-/* $Id: sse.h,v 1.1.1.1 2002/10/22 13:06:08 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -35,6 +34,5 @@
#include "math/m_xform.h"
void _mesa_init_sse_transform_asm( void );
-void _mesa_init_sse_vertex_asm( void );
#endif
diff --git a/xc/extras/Mesa/src/X86/sse_normal.S b/xc/extras/Mesa/src/X86/sse_normal.S
index 4b2d6edbe..c9088c4cc 100644
--- a/xc/extras/Mesa/src/X86/sse_normal.S
+++ b/xc/extras/Mesa/src/X86/sse_normal.S
@@ -1,4 +1,3 @@
-/* $Id: sse_normal.S,v 1.1.1.1 2002/10/22 13:06:09 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -64,7 +63,7 @@ GLNAME(_mesa_sse_transform_rescale_normals_no_rot):
MOV_L ( STRIDE, EAX ) /* stride */
MOV_L ( ECX, REGOFF(V3F_COUNT, EDI) ) /* set dest-count */
- IMUL_L( CONST(12), ECX ) /* count *= 12 */
+ IMUL_L( CONST(16), ECX ) /* count *= 16 */
MOV_L( REGOFF(V3F_START, ESI), ESI ) /* ptr to first source vertex */
MOV_L( REGOFF(V3F_START, EDI), EDI ) /* ptr to first dest vertex */
@@ -90,7 +89,7 @@ LLBL(K_G3TRNNRR_top):
MOVSS ( XMM2, D(2) ) /* ->D(2) */
LLBL(K_G3TRNNRR_skip):
- ADD_L ( CONST(12), EDI )
+ ADD_L ( CONST(16), EDI )
ADD_L ( EAX, ESI )
CMP_L ( ECX, EDI )
JNE ( LLBL(K_G3TRNNRR_top) )
@@ -125,7 +124,7 @@ GLNAME(_mesa_sse_transform_rescale_normals):
MOV_L ( STRIDE, EAX ) /* stride */
MOV_L ( ECX, REGOFF(V3F_COUNT, EDI) ) /* set dest-count */
- IMUL_L( CONST(12), ECX ) /* count *= 12 */
+ IMUL_L( CONST(16), ECX ) /* count *= 16 */
MOV_L( REGOFF(V3F_START, ESI), ESI ) /* ptr to first source vertex */
MOV_L( REGOFF(V3F_START, EDI), EDI ) /* ptr to first dest vertex */
@@ -183,7 +182,7 @@ LLBL(K_G3TRNR_top):
MOVSS ( XMM3, D(2) )
LLBL(K_G3TRNR_skip):
- ADD_L ( CONST(12), EDI )
+ ADD_L ( CONST(16), EDI )
ADD_L ( EAX, ESI )
CMP_L ( ECX, EDI )
JNE ( LLBL(K_G3TRNR_top) )
@@ -217,7 +216,7 @@ GLNAME(_mesa_sse_transform_normals_no_rot):
MOV_L ( STRIDE, EAX ) /* stride */
MOV_L ( ECX, REGOFF(V3F_COUNT, EDI) ) /* set dest-count */
- IMUL_L( CONST(12), ECX ) /* count *= 12 */
+ IMUL_L( CONST(16), ECX ) /* count *= 16 */
MOV_L( REGOFF(V3F_START, ESI), ESI ) /* ptr to first source vertex */
MOV_L( REGOFF(V3F_START, EDI), EDI ) /* ptr to first dest vertex */
@@ -240,7 +239,7 @@ LLBL(K_G3TNNRR_top):
MOVSS( XMM2, D(2) )
LLBL(K_G3TNNRR_skip):
- ADD_L ( CONST(12), EDI )
+ ADD_L ( CONST(16), EDI )
ADD_L ( EAX, ESI )
CMP_L ( ECX, EDI )
JNE ( LLBL(K_G3TNNRR_top) )
diff --git a/xc/extras/Mesa/src/X86/sse_vertex.S b/xc/extras/Mesa/src/X86/sse_vertex.S
deleted file mode 100644
index 4b66a3e6c..000000000
--- a/xc/extras/Mesa/src/X86/sse_vertex.S
+++ /dev/null
@@ -1,182 +0,0 @@
-#include "matypes.h"
-
- SEG_TEXT
-
-#define MAT_SY 20
-#define MAT_SZ 40
-#define MAT_TX 48
-#define MAT_TY 52
-#define MAT_TZ 56
-
-
-/*
- * void _mesa_v16_katmai_general_xform( GLfloat *dest,
- * const GLfloat *m,
- * const GLfloat *src,
- * GLuint src_stride,
- * GLuint count )
- *
- */
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_v16_sse_general_xform )
-GLNAME( _mesa_v16_sse_general_xform ):
-
- PUSH_L( EDI )
- PUSH_L( ESI )
-
- MOV_L( REGOFF(12, ESP), EAX ) /* destination */
- MOV_L( REGOFF(16, ESP), ESI ) /* matrix */
- MOV_L( REGOFF(20, ESP), EDX ) /* source */
- MOV_L( REGOFF(24, ESP), EDI ) /* src_stride */
- MOV_L( REGOFF(28, ESP), ECX ) /* count */
-
- MOVAPS( REGOFF(0, ESI), XMM4 ) /* m3 | m2 | m1 | m0 */
- MOVAPS( REGOFF(16, ESI), XMM5 ) /* m7 | m6 | m5 | m4 */
- MOVAPS( REGOFF(32, ESI), XMM6 ) /* m11 | m10 | m9 | m8 */
- MOVAPS( REGOFF(48, ESI), XMM7 ) /* m15 | m14 | m13 | m12 */
-
-ALIGNTEXT32
-LLBL(v16_sse_general_loop):
-
- MOVSS( REGOFF(0, EDX), XMM0 ) /* | | | x0 */
- SHUFPS( CONST(0x0), XMM0, XMM0 ) /* x0 | x0 | x0 | x0 */
- MULPS( XMM4, XMM0 ) /* x0*m3 | x0*m2 | x0*m1 | x0*m0 */
-
- MOVSS( REGOFF(4, EDX), XMM1 ) /* | | | x1 */
- SHUFPS( CONST(0x0), XMM1, XMM1 ) /* x1 | x1 | x1 | x1 */
- MULPS( XMM5, XMM1 ) /* x1*m7 | x1*m6 | x1*m5 | x1*m4 */
-
- MOVSS( REGOFF(8, EDX), XMM2 ) /* | | | x2 */
- SHUFPS( CONST(0x0), XMM2, XMM2 ) /* x2 | x2 | x2 | x2 */
- MULPS( XMM6, XMM2 ) /* x2*m11 | x2*m10 | x2*m9 | x2*m8 */
-
- ADDPS( XMM1, XMM0 )
- ADDPS( XMM2, XMM0 )
- ADDPS( XMM7, XMM0 ) /* r3 | r2 | r1 | r1 */
-
- MOVAPS( XMM0, REGOFF(0, EAX) )
-
- ADD_L( CONST(64), EAX ) /* next output vertex */
- ADD_L( EDI, EDX ) /* next input vertex */
-
- DEC_L( ECX )
- JNE( LLBL(v16_sse_general_loop) )
-
- POP_L( ESI )
- POP_L( EDI )
-
- RET
-
-
-/* void _mesa_sse_project_vertices(GLfloat *first,
- * GLfloat *last,
- * const GLfloat *m,
- * GLuint stride )
- */
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_sse_project_vertices )
-GLNAME( _mesa_sse_project_vertices ):
-
- PUSH_L( EBP )
-
- MOV_L( REGOFF(8, ESP), ECX ) /* first_vert */
- MOV_L( REGOFF(12, ESP), EDX ) /* last_vert */
- MOV_L( REGOFF(16, ESP), EBP ) /* matrix */
- MOV_L( REGOFF(20, ESP), EAX ) /* stride */
-
-
-ALIGNTEXT32
- MOVAPS( REGOFF(MAT_TX, EBP), XMM0 ) /* (x44), x43, x42, x41 => xmm0 */
- MOVSS( REGOFF(0, EBP), XMM1 ) /* -, -, -, x11 => xmm1 */
- UNPCKLPS( REGOFF(MAT_SY, EBP), XMM1 ) /* -, -, x22, x11 => xmm1 */
- SHUFPS( CONST(0x44), REGOFF(MAT_SZ, EBP), XMM1 )
- /* -, x33, x22, x11 => xmm1 */
-
- SUB_L( ECX, EDX ) /* last -= first */
-
-LLBL(v16_sse_pv_loop_start):
- MOVAPS( REGOFF(0, ECX), XMM3 ) /* f[3], f[2], f[1], f[0] */
-
- MOVSS( REGOFF(12, ECX), XMM2 ) /* -, -, -, f[3] */
- SHUFPS( CONST(0x0), XMM2, XMM2 ) /* f[3], f[3], f[3], f[3] */
- RCPPS( XMM2, XMM2 ) /* 1/f[3], 1/f[3], 1/f[3], 1/f[3] */
-
- MULPS( XMM2, XMM1 ) /* -, x33*1/f[3]... */
- MULPS( XMM3, XMM1 ) /* -, x33*1/f[3]*f[2]... */
- ADDPS( XMM0, XMM1 ) /* -, x33*1/f[3]*f[2]+x43... */
-
- MOVAPS( XMM1, REGOFF(0, ECX) ) /* back to f */
- MOVSS( XMM2, REGOFF(12, ECX) ) /* 1/f[3] into f[3] ! */
-
-
- ADD_L( EAX, ECX ) /* f += stride */
- SUB_L( EAX, EDX ) /* (last-first)-stride */
- JA ( LLBL(v16_sse_pv_loop_start) )
-
- POP_L( EBP )
- RET
-
-
-
-/* void _mesa_sse_project_clipped_vertices(GLfloat *first,
- * GLfloat *last,
- * const GLfloat *m,
- * GLuint stride,
- * const GLubyte *clipmask );
- */
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_sse_project_clipped_vertices )
-GLNAME( _mesa_sse_project_clipped_vertices ):
-
- PUSH_L( EBP )
- PUSH_L( ESI )
-
- MOV_L( REGOFF(12, ESP), ECX ) /* first_vert */
- MOV_L( REGOFF(16, ESP), EDX ) /* last_vert */
- MOV_L( REGOFF(20, ESP), EBP ) /* matrix */
- MOV_L( REGOFF(24, ESP), EAX ) /* stride */
- MOV_L( REGOFF(28, ESP), ESI ) /* clip_mask */
-
-
-
-ALIGNTEXT32
-
- MOVAPS( REGOFF(MAT_TX, EBP), XMM0 ) /* (x44), x43, x42, x41 => xmm0 */
- MOVSS( REGOFF(0, EBP), XMM1 ) /* -, -, -, x11 => xmm1 */
- UNPCKLPS( REGOFF(MAT_SY, EBP), XMM1 ) /* -, -, x22, x11 => xmm1 */
- SHUFPS( CONST(0x44), REGOFF(MAT_SZ, EBP), XMM1 )
- /* -, x33, x22, x11 => xmm1 */
-
-LLBL(v16_sse_pcv_loop_start):
- CMP_B ( CONST(0), REGIND(ESI) ) /* clip_mask == 0 ? */
- JNE( LLBL(v16_sse_pcv_skip) ) /* no -> skip ! */
-
- MOVAPS( REGOFF(0, ECX), XMM3 ) /* f[3], f[2], f[1], f[0] */
-
- MOVSS( REGOFF(12, ECX), XMM2 ) /* -, -, -, f[3] */
- SHUFPS( CONST(0x0), XMM2, XMM2 ) /* f[3], f[3], f[3], f[3] */
- RCPPS( XMM2, XMM2 ) /* 1/f[3], 1/f[3], 1/f[3], 1/f[3] */
-
- MULPS( XMM2, XMM1 ) /* -, x33*1/f[3]... */
- MULPS( XMM3, XMM1 ) /* -, x33*1/f[3]*f[2]... */
- ADDPS( XMM0, XMM1 ) /* -, x33*1/f[3]*f[2]+x43... */
-
- MOVAPS( XMM1, REGOFF(0, ECX) ) /* back to f */
- MOVSS( XMM2, REGOFF(12, ECX) ) /* 1/f[3] into f[3] ! */
-
-LLBL(v16_sse_pcv_skip):
- ADD_L( EAX, ECX ) /* f += stride */
- INC_L( ESI ) /* nect ClipMask */
-
- CMP_L( ECX, EDX ) /* p_first_vertex == p_last_vertex */
- JNE( LLBL(v16_sse_pcv_loop_start) )
- /* no -> go on with next vertex */
-
- POP_L( ESI )
- POP_L( EBP )
- RET
diff --git a/xc/extras/Mesa/src/X86/x86.c b/xc/extras/Mesa/src/X86/x86.c
index c2b222ea8..3835bbbd7 100644
--- a/xc/extras/Mesa/src/X86/x86.c
+++ b/xc/extras/Mesa/src/X86/x86.c
@@ -29,7 +29,6 @@
#include "glheader.h"
#include "context.h"
-#include "math/m_vertices.h"
#include "math/m_xform.h"
#include "tnl/t_context.h"
@@ -94,14 +93,3 @@ void _mesa_init_x86_transform_asm( void )
#endif
}
-void _mesa_init_x86_vertex_asm( void )
-{
-#ifdef USE_X86_ASM
- _mesa_xform_points3_v16_general = _mesa_v16_x86_general_xform;
- _mesa_cliptest_points4_v16 = _mesa_v16_x86_cliptest_points4;
-
-#if 0 /* DEBUG */
- _math_test_all_vertex_functions( "x86" );
-#endif
-#endif
-}
diff --git a/xc/extras/Mesa/src/X86/x86.h b/xc/extras/Mesa/src/X86/x86.h
index 75de94e6b..97651ec6e 100644
--- a/xc/extras/Mesa/src/X86/x86.h
+++ b/xc/extras/Mesa/src/X86/x86.h
@@ -31,6 +31,5 @@
#define __X86_H__
extern void _mesa_init_x86_transform_asm( void );
-extern void _mesa_init_x86_vertex_asm( void );
#endif
diff --git a/xc/extras/Mesa/src/X86/x86_cliptest.S b/xc/extras/Mesa/src/X86/x86_cliptest.S
index 03bcce679..7c5b892b9 100644
--- a/xc/extras/Mesa/src/X86/x86_cliptest.S
+++ b/xc/extras/Mesa/src/X86/x86_cliptest.S
@@ -95,7 +95,7 @@ clip_table:
* EBP: temp2
*/
-#if defined(__ELF__) && defined(__PIC__) && !defined(ELFPIC)
+#if defined(__ELF__) && defined(__PIC__) && defined(GNU_ASSEMBLER) && !defined(ELFPIC)
#define ELFPIC
#endif
diff --git a/xc/extras/Mesa/src/X86/xform_args.h b/xc/extras/Mesa/src/X86/xform_args.h
index 2713d548d..b773f5198 100644
--- a/xc/extras/Mesa/src/X86/xform_args.h
+++ b/xc/extras/Mesa/src/X86/xform_args.h
@@ -28,7 +28,7 @@
* FRAME_OFFSET to the number of bytes pushed onto the stack before
* using the ARG_* argument macros.
*
- * Gareth Hughes <gareth@valinux.com>
+ * Gareth Hughes
*/
#ifndef __XFORM_ARGS_H__
diff --git a/xc/extras/Mesa/src/accum.c b/xc/extras/Mesa/src/accum.c
index ca255892f..1185adbfd 100644
--- a/xc/extras/Mesa/src/accum.c
+++ b/xc/extras/Mesa/src/accum.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -23,20 +23,13 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "accum.h"
#include "context.h"
+#include "imports.h"
#include "macros.h"
-#include "mem.h"
#include "state.h"
#include "mtypes.h"
-#endif
-
-
void
diff --git a/xc/extras/Mesa/src/all.h b/xc/extras/Mesa/src/all.h
deleted file mode 100644
index 852aaa630..000000000
--- a/xc/extras/Mesa/src/all.h
+++ /dev/null
@@ -1,94 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/*
- * The purpose of this file is to collect all the header files that Mesa
- * uses into a single header so that we can get new compilers that support
- * pre-compiled headers to compile much faster.
- * All we do is list all the internal headers used by Mesa in this one
- * main header file, and most compilers will pre-compile all these headers
- * and use them over and over again for each source module. This makes a
- * big difference for Win32 support, because the <windows.h> headers take
- * a *long* time to compile.
- */
-
-
-#ifndef SRC_ALL_H
-#define SRC_ALL_H
-
-
-#ifndef PC_HEADER
- This is an error. all.h should be included only if PC_HEADER is defined.
-#endif
-
-#include "glheader.h"
-#include "accum.h"
-#include "attrib.h"
-#include "blend.h"
-#include "buffers.h"
-#include "clip.h"
-#include "colortab.h"
-#include "config.h"
-#include "context.h"
-#include "convolve.h"
-#include "dd.h"
-#include "depth.h"
-#include "dlist.h"
-#include "drawpix.h"
-#include "enable.h"
-#include "enums.h"
-#include "eval.h"
-#include "extensions.h"
-#include "feedback.h"
-#include "fog.h"
-#include "get.h"
-#include "glapi.h"
-#include "glthread.h"
-#include "hash.h"
-#include "hint.h"
-#include "histogram.h"
-#include "image.h"
-#include "light.h"
-#include "lines.h"
-#include "macros.h"
-#include "matrix.h"
-#include "mem.h"
-#include "mmath.h"
-#include "pixel.h"
-#include "points.h"
-#include "polygon.h"
-#include "rastpos.h"
-#include "state.h"
-#include "stencil.h"
-#include "teximage.h"
-#include "texobj.h"
-#include "texstate.h"
-#include "texstore.h"
-#include "mtypes.h"
-#include "varray.h"
-
-
-#endif /*SRC_ALL_H*/
diff --git a/xc/extras/Mesa/src/api_arrayelt.c b/xc/extras/Mesa/src/api_arrayelt.c
index 15ef51377..deaf65a9d 100644
--- a/xc/extras/Mesa/src/api_arrayelt.c
+++ b/xc/extras/Mesa/src/api_arrayelt.c
@@ -1,8 +1,7 @@
-/* $Id: api_arrayelt.c,v 1.1.1.1 2002/10/22 13:05:38 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -25,14 +24,14 @@
*/
/* Author:
- * Keith Whitwell <keith_whitwell@yahoo.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#include "glheader.h"
#include "api_arrayelt.h"
#include "context.h"
#include "glapi.h"
-#include "mem.h"
+#include "imports.h"
#include "macros.h"
#include "mtypes.h"
@@ -253,7 +252,7 @@ static void (*fogcoordfuncs[8])( const void * ) = {
GLboolean _ae_create_context( GLcontext *ctx )
{
ctx->aelt_context = MALLOC( sizeof(AEcontext) );
- if (!ctx->aelt_context)
+ if (!ctx->aelt_context)
return GL_FALSE;
AE_CONTEXT(ctx)->NewState = ~0;
@@ -307,7 +306,7 @@ static void _ae_update_state( GLcontext *ctx )
if (ctx->Array.EdgeFlag.Enabled) {
aa->array = &ctx->Array.EdgeFlag;
- aa->func = (array_func) glEdgeFlagv;
+ aa->func = (array_func)glEdgeFlagv;
aa++;
}
diff --git a/xc/extras/Mesa/src/api_eval.c b/xc/extras/Mesa/src/api_eval.c
index 9f497ce0c..3887ba808 100644
--- a/xc/extras/Mesa/src/api_eval.c
+++ b/xc/extras/Mesa/src/api_eval.c
@@ -1,4 +1,3 @@
-/* $Id: api_eval.c,v 1.1.1.1 2002/10/22 13:05:38 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#include "glheader.h"
@@ -281,16 +280,16 @@ void _mesa_EvalCoord1f( GLfloat u )
GLfloat normal[3], texcoord[4], color[4];
GLuint index;
- COPY_3FV( normal, ctx->Current.Normal );
- COPY_4FV( texcoord, ctx->Current.Texcoord[0] );
- COPY_4FV( color, ctx->Current.Color );
+ COPY_3FV( normal, ctx->Current.Attrib[VERT_ATTRIB_NORMAL] );
+ COPY_4FV( texcoord, ctx->Current.Attrib[VERT_ATTRIB_TEX0] );
+ COPY_4FV( color, ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
index = ctx->Current.Index;
do_EvalCoord1f( ctx, u );
- COPY_3FV( ctx->Current.Normal, normal );
- COPY_4FV( ctx->Current.Texcoord[0], texcoord );
- COPY_4FV( ctx->Current.Color, color );
+ COPY_3FV( ctx->Current.Attrib[VERT_ATTRIB_NORMAL], normal );
+ COPY_4FV( ctx->Current.Attrib[VERT_ATTRIB_TEX0], texcoord );
+ COPY_4FV( ctx->Current.Attrib[VERT_ATTRIB_COLOR0], color );
ctx->Current.Index = index;
}
@@ -300,16 +299,16 @@ void _mesa_EvalCoord2f( GLfloat u, GLfloat v )
GLfloat normal[3], texcoord[4], color[4];
GLuint index;
- COPY_3FV( normal, ctx->Current.Normal );
- COPY_4FV( texcoord, ctx->Current.Texcoord[0] );
- COPY_4FV( color, ctx->Current.Color );
+ COPY_3FV( normal, ctx->Current.Attrib[VERT_ATTRIB_NORMAL] );
+ COPY_4FV( texcoord, ctx->Current.Attrib[VERT_ATTRIB_TEX0] );
+ COPY_4FV( color, ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
index = ctx->Current.Index;
do_EvalCoord2f( ctx, u, v );
- COPY_3FV( ctx->Current.Normal, normal );
- COPY_4FV( ctx->Current.Texcoord[0], texcoord );
- COPY_4FV( ctx->Current.Color, color );
+ COPY_3FV( ctx->Current.Attrib[VERT_ATTRIB_NORMAL], normal );
+ COPY_4FV( ctx->Current.Attrib[VERT_ATTRIB_TEX0], texcoord );
+ COPY_4FV( ctx->Current.Attrib[VERT_ATTRIB_COLOR0], color );
ctx->Current.Index = index;
}
diff --git a/xc/extras/Mesa/src/api_loopback.c b/xc/extras/Mesa/src/api_loopback.c
index c944e6989..9805c59aa 100644
--- a/xc/extras/Mesa/src/api_loopback.c
+++ b/xc/extras/Mesa/src/api_loopback.c
@@ -1,8 +1,7 @@
-/* $Id: api_loopback.c,v 1.1.1.1 2002/10/22 13:05:37 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.2
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
@@ -64,6 +63,7 @@
#define MATERIALFV(a,b,c) glMaterialfv(a,b,c)
#define RECTF(a,b,c,d) glRectf(a,b,c,d)
+#define ATTRIB(index, x, y, z, w) _glapi_Dispatch->VertexAttrib4fNV(index, x, y, z, w)
#define FOGCOORDF(x) _glapi_Dispatch->FogCoordfEXT(x)
@@ -1370,6 +1370,268 @@ loopback_SecondaryColor3usvEXT_f( const GLushort *v )
}
+/*
+ * GL_NV_vertex_program
+ */
+
+static void
+loopback_VertexAttrib1sNV(GLuint index, GLshort x)
+{
+ ATTRIB(index, (GLfloat) x, 0.0F, 0.0F, 1.0F);
+}
+
+static void
+loopback_VertexAttrib1fNV(GLuint index, GLfloat x)
+{
+ ATTRIB(index, x, 0.0F, 0.0F, 1.0F);
+}
+
+static void
+loopback_VertexAttrib1dNV(GLuint index, GLdouble x)
+{
+ ATTRIB(index, (GLfloat) x, 0.0F, 0.0F, 1.0F);
+}
+
+static void
+loopback_VertexAttrib2sNV(GLuint index, GLshort x, GLshort y)
+{
+ ATTRIB(index, (GLfloat) x, y, 0.0F, 1.0F);
+}
+
+static void
+loopback_VertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y)
+{
+ ATTRIB(index, (GLfloat) x, y, 0.0F, 1.0F);
+}
+
+static void
+loopback_VertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y)
+{
+ ATTRIB(index, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
+}
+
+static void
+loopback_VertexAttrib3sNV(GLuint index, GLshort x, GLshort y, GLshort z)
+{
+ ATTRIB(index, (GLfloat) x, y, z, 1.0F);
+}
+
+static void
+loopback_VertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z)
+{
+ ATTRIB(index, x, y, z, 1.0F);
+}
+
+static void
+loopback_VertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z)
+{
+ ATTRIB(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
+}
+
+static void
+loopback_VertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ ATTRIB(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
+}
+
+static void
+loopback_VertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ ATTRIB(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
+}
+
+static void
+loopback_VertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
+{
+ ATTRIB(index, UBYTE_TO_FLOAT(x), UBYTE_TO_FLOAT(y),
+ UBYTE_TO_FLOAT(z), UBYTE_TO_FLOAT(w));
+}
+
+static void
+loopback_VertexAttrib1svNV(GLuint index, const GLshort *v)
+{
+ ATTRIB(index, (GLfloat) v[0], 0.0F, 0.0F, 1.0F);
+}
+
+static void
+loopback_VertexAttrib1fvNV(GLuint index, const GLfloat *v)
+{
+ ATTRIB(index, v[0], 0.0F, 0.0F, 1.0F);
+}
+
+static void
+loopback_VertexAttrib1dvNV(GLuint index, const GLdouble *v)
+{
+ ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
+}
+
+static void
+loopback_VertexAttrib2svNV(GLuint index, const GLshort *v)
+{
+ ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
+}
+
+static void
+loopback_VertexAttrib2fvNV(GLuint index, const GLfloat *v)
+{
+ ATTRIB(index, v[0], v[1], 0.0F, 1.0F);
+}
+
+static void
+loopback_VertexAttrib2dvNV(GLuint index, const GLdouble *v)
+{
+ ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
+}
+
+static void
+loopback_VertexAttrib3svNV(GLuint index, const GLshort *v)
+{
+ ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
+}
+
+static void
+loopback_VertexAttrib3fvNV(GLuint index, const GLfloat *v)
+{
+ ATTRIB(index, v[0], v[1], v[2], 1.0F);
+}
+
+static void
+loopback_VertexAttrib3dvNV(GLuint index, const GLdouble *v)
+{
+ ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
+}
+
+static void
+loopback_VertexAttrib4svNV(GLuint index, const GLshort *v)
+{
+ ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
+}
+
+static void
+loopback_VertexAttrib4fvNV(GLuint index, const GLfloat *v)
+{
+ ATTRIB(index, v[0], v[1], v[2], v[3]);
+}
+
+static void
+loopback_VertexAttrib4dvNV(GLuint index, const GLdouble *v)
+{
+ ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
+}
+
+static void
+loopback_VertexAttrib4ubvNV(GLuint index, const GLubyte *v)
+{
+ ATTRIB(index, UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]),
+ UBYTE_TO_FLOAT(v[2]), UBYTE_TO_FLOAT(v[3]));
+}
+
+
+static void
+loopback_VertexAttribs1svNV(GLuint index, GLsizei n, const GLshort *v)
+{
+ GLint i;
+ for (i = n - 1; i >= 0; i--)
+ loopback_VertexAttrib1svNV(index + i, v + i);
+}
+
+static void
+loopback_VertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat *v)
+{
+ GLint i;
+ for (i = n - 1; i >= 0; i--)
+ loopback_VertexAttrib1fvNV(index + i, v + i);
+}
+
+static void
+loopback_VertexAttribs1dvNV(GLuint index, GLsizei n, const GLdouble *v)
+{
+ GLint i;
+ for (i = n - 1; i >= 0; i--)
+ loopback_VertexAttrib1dvNV(index + i, v + i);
+}
+
+static void
+loopback_VertexAttribs2svNV(GLuint index, GLsizei n, const GLshort *v)
+{
+ GLint i;
+ for (i = n - 1; i >= 0; i--)
+ loopback_VertexAttrib2svNV(index + i, v + 2 * i);
+}
+
+static void
+loopback_VertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat *v)
+{
+ GLint i;
+ for (i = n - 1; i >= 0; i--)
+ loopback_VertexAttrib2fvNV(index + i, v + 2 * i);
+}
+
+static void
+loopback_VertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble *v)
+{
+ GLint i;
+ for (i = n - 1; i >= 0; i--)
+ loopback_VertexAttrib2dvNV(index + i, v + 2 * i);
+}
+
+static void
+loopback_VertexAttribs3svNV(GLuint index, GLsizei n, const GLshort *v)
+{
+ GLint i;
+ for (i = n - 1; i >= 0; i--)
+ loopback_VertexAttrib3svNV(index + i, v + 3 * i);
+}
+
+static void
+loopback_VertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat *v)
+{
+ GLint i;
+ for (i = n - 1; i >= 0; i--)
+ loopback_VertexAttrib3fvNV(index + i, v + 3 * i);
+}
+
+static void
+loopback_VertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble *v)
+{
+ GLint i;
+ for (i = n - 1; i >= 0; i--)
+ loopback_VertexAttrib3dvNV(index + i, v + 3 * i);
+}
+
+static void
+loopback_VertexAttribs4svNV(GLuint index, GLsizei n, const GLshort *v)
+{
+ GLint i;
+ for (i = n - 1; i >= 0; i--)
+ loopback_VertexAttrib4svNV(index + i, v + 4 * i);
+}
+
+static void
+loopback_VertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat *v)
+{
+ GLint i;
+ for (i = n - 1; i >= 0; i--)
+ loopback_VertexAttrib4fvNV(index + i, v + 4 * i);
+}
+
+static void
+loopback_VertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble *v)
+{
+ GLint i;
+ for (i = n - 1; i >= 0; i--)
+ loopback_VertexAttrib4dvNV(index + i, v + 4 * i);
+}
+
+static void
+loopback_VertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte *v)
+{
+ GLint i;
+ for (i = n - 1; i >= 0; i--)
+ loopback_VertexAttrib4ubvNV(index + i, v + 4 * i);
+}
+
+
void
_mesa_loopback_prefer_float( struct _glapi_table *dest,
@@ -1567,4 +1829,46 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest,
dest->Rectsv = loopback_Rectsv;
dest->FogCoorddEXT = loopback_FogCoorddEXT;
dest->FogCoorddvEXT = loopback_FogCoorddvEXT;
+
+ dest->VertexAttrib1sNV = loopback_VertexAttrib1sNV;
+ dest->VertexAttrib1fNV = loopback_VertexAttrib1fNV;
+ dest->VertexAttrib1dNV = loopback_VertexAttrib1dNV;
+ dest->VertexAttrib2sNV = loopback_VertexAttrib2sNV;
+ dest->VertexAttrib2fNV = loopback_VertexAttrib2fNV;
+ dest->VertexAttrib2dNV = loopback_VertexAttrib2dNV;
+ dest->VertexAttrib3sNV = loopback_VertexAttrib3sNV;
+ dest->VertexAttrib3fNV = loopback_VertexAttrib3fNV;
+ dest->VertexAttrib3dNV = loopback_VertexAttrib3dNV;
+ dest->VertexAttrib4sNV = loopback_VertexAttrib4sNV;
+ dest->VertexAttrib4dNV = loopback_VertexAttrib4dNV;
+ dest->VertexAttrib4ubNV = loopback_VertexAttrib4ubNV;
+
+ dest->VertexAttrib1svNV = loopback_VertexAttrib1svNV;
+ dest->VertexAttrib1fvNV = loopback_VertexAttrib1fvNV;
+ dest->VertexAttrib1dvNV = loopback_VertexAttrib1dvNV;
+ dest->VertexAttrib2svNV = loopback_VertexAttrib2svNV;
+ dest->VertexAttrib2fvNV = loopback_VertexAttrib2fvNV;
+ dest->VertexAttrib2dvNV = loopback_VertexAttrib2dvNV;
+ dest->VertexAttrib3svNV = loopback_VertexAttrib3svNV;
+ dest->VertexAttrib3fvNV = loopback_VertexAttrib3fvNV;
+ dest->VertexAttrib3dvNV = loopback_VertexAttrib3dvNV;
+ dest->VertexAttrib4svNV = loopback_VertexAttrib4svNV;
+ dest->VertexAttrib4fvNV = loopback_VertexAttrib4fvNV;
+ dest->VertexAttrib4dvNV = loopback_VertexAttrib4dvNV;
+ dest->VertexAttrib4ubvNV = loopback_VertexAttrib4ubvNV;
+
+ dest->VertexAttribs1svNV = loopback_VertexAttribs1svNV;
+ dest->VertexAttribs1fvNV = loopback_VertexAttribs1fvNV;
+ dest->VertexAttribs1dvNV = loopback_VertexAttribs1dvNV;
+ dest->VertexAttribs2svNV = loopback_VertexAttribs2svNV;
+ dest->VertexAttribs2fvNV = loopback_VertexAttribs2fvNV;
+ dest->VertexAttribs2dvNV = loopback_VertexAttribs2dvNV;
+ dest->VertexAttribs3svNV = loopback_VertexAttribs3svNV;
+ dest->VertexAttribs3fvNV = loopback_VertexAttribs3fvNV;
+ dest->VertexAttribs3dvNV = loopback_VertexAttribs3dvNV;
+ dest->VertexAttribs4svNV = loopback_VertexAttribs4svNV;
+ dest->VertexAttribs4fvNV = loopback_VertexAttribs4fvNV;
+ dest->VertexAttribs4dvNV = loopback_VertexAttribs4dvNV;
+ dest->VertexAttribs4ubvNV = loopback_VertexAttribs4ubvNV;
+
}
diff --git a/xc/extras/Mesa/src/api_noop.c b/xc/extras/Mesa/src/api_noop.c
index 373bff851..e3fdd6141 100644
--- a/xc/extras/Mesa/src/api_noop.c
+++ b/xc/extras/Mesa/src/api_noop.c
@@ -1,8 +1,7 @@
-/* $Id: api_noop.c,v 1.1.1.1 2002/10/22 13:05:43 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
@@ -58,13 +57,13 @@ void _mesa_noop_EdgeFlagv( const GLboolean *b )
void _mesa_noop_FogCoordfEXT( GLfloat a )
{
GET_CURRENT_CONTEXT(ctx);
- ctx->Current.FogCoord = a;
+ ctx->Current.Attrib[VERT_ATTRIB_FOG][0] = a;
}
void _mesa_noop_FogCoordfvEXT( const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- ctx->Current.FogCoord = *v;
+ ctx->Current.Attrib[VERT_ATTRIB_FOG][0] = *v;
}
void _mesa_noop_Indexi( GLint i )
@@ -82,7 +81,7 @@ void _mesa_noop_Indexiv( const GLint *v )
void _mesa_noop_Normal3f( GLfloat a, GLfloat b, GLfloat c )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Normal;
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
COPY_FLOAT(dest[0], a);
COPY_FLOAT(dest[1], b);
COPY_FLOAT(dest[2], c);
@@ -91,7 +90,7 @@ void _mesa_noop_Normal3f( GLfloat a, GLfloat b, GLfloat c )
void _mesa_noop_Normal3fv( const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Normal;
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
COPY_FLOAT(dest[0], v[0]);
COPY_FLOAT(dest[1], v[1]);
COPY_FLOAT(dest[2], v[2]);
@@ -155,7 +154,7 @@ void _mesa_noop_Materialfv( GLenum face, GLenum pname, const GLfloat *params )
void _mesa_noop_Color4ub( GLubyte a, GLubyte b, GLubyte c, GLubyte d )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
color[0] = UBYTE_TO_FLOAT(a);
color[1] = UBYTE_TO_FLOAT(b);
color[2] = UBYTE_TO_FLOAT(c);
@@ -165,7 +164,7 @@ void _mesa_noop_Color4ub( GLubyte a, GLubyte b, GLubyte c, GLubyte d )
void _mesa_noop_Color4ubv( const GLubyte *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
color[0] = UBYTE_TO_FLOAT(v[0]);
color[1] = UBYTE_TO_FLOAT(v[1]);
color[2] = UBYTE_TO_FLOAT(v[2]);
@@ -175,7 +174,7 @@ void _mesa_noop_Color4ubv( const GLubyte *v )
void _mesa_noop_Color4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
color[0] = a;
color[1] = b;
color[2] = c;
@@ -185,7 +184,7 @@ void _mesa_noop_Color4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
void _mesa_noop_Color4fv( const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
color[0] = v[0];
color[1] = v[1];
color[2] = v[2];
@@ -195,7 +194,7 @@ void _mesa_noop_Color4fv( const GLfloat *v )
void _mesa_noop_Color3ub( GLubyte a, GLubyte b, GLubyte c )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
color[0] = UBYTE_TO_FLOAT(a);
color[1] = UBYTE_TO_FLOAT(b);
color[2] = UBYTE_TO_FLOAT(c);
@@ -205,7 +204,7 @@ void _mesa_noop_Color3ub( GLubyte a, GLubyte b, GLubyte c )
void _mesa_noop_Color3ubv( const GLubyte *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
color[0] = UBYTE_TO_FLOAT(v[0]);
color[1] = UBYTE_TO_FLOAT(v[1]);
color[2] = UBYTE_TO_FLOAT(v[2]);
@@ -215,7 +214,7 @@ void _mesa_noop_Color3ubv( const GLubyte *v )
void _mesa_noop_Color3f( GLfloat a, GLfloat b, GLfloat c )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
color[0] = a;
color[1] = b;
color[2] = c;
@@ -225,7 +224,7 @@ void _mesa_noop_Color3f( GLfloat a, GLfloat b, GLfloat c )
void _mesa_noop_Color3fv( const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
color[0] = v[0];
color[1] = v[1];
color[2] = v[2];
@@ -241,7 +240,7 @@ void _mesa_noop_MultiTexCoord1fARB( GLenum target, GLfloat a )
*/
if (unit < MAX_TEXTURE_UNITS)
{
- GLfloat *dest = ctx->Current.Texcoord[unit];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
COPY_FLOAT(dest[0], a);
dest[1] = 0;
dest[2] = 0;
@@ -258,7 +257,7 @@ void _mesa_noop_MultiTexCoord1fvARB( GLenum target, const GLfloat *v )
*/
if (unit < MAX_TEXTURE_UNITS)
{
- GLfloat *dest = ctx->Current.Texcoord[unit];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
COPY_FLOAT(dest[0], v[0]);
dest[1] = 0;
dest[2] = 0;
@@ -275,7 +274,7 @@ void _mesa_noop_MultiTexCoord2fARB( GLenum target, GLfloat a, GLfloat b )
*/
if (unit < MAX_TEXTURE_UNITS)
{
- GLfloat *dest = ctx->Current.Texcoord[unit];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
COPY_FLOAT(dest[0], a);
COPY_FLOAT(dest[1], b);
dest[2] = 0;
@@ -292,7 +291,7 @@ void _mesa_noop_MultiTexCoord2fvARB( GLenum target, const GLfloat *v )
*/
if (unit < MAX_TEXTURE_UNITS)
{
- GLfloat *dest = ctx->Current.Texcoord[unit];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
COPY_FLOAT(dest[0], v[0]);
COPY_FLOAT(dest[1], v[1]);
dest[2] = 0;
@@ -309,7 +308,7 @@ void _mesa_noop_MultiTexCoord3fARB( GLenum target, GLfloat a, GLfloat b, GLfloat
*/
if (unit < MAX_TEXTURE_UNITS)
{
- GLfloat *dest = ctx->Current.Texcoord[unit];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
COPY_FLOAT(dest[0], a);
COPY_FLOAT(dest[1], b);
COPY_FLOAT(dest[2], c);
@@ -326,7 +325,7 @@ void _mesa_noop_MultiTexCoord3fvARB( GLenum target, const GLfloat *v )
*/
if (unit < MAX_TEXTURE_UNITS)
{
- GLfloat *dest = ctx->Current.Texcoord[unit];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
COPY_FLOAT(dest[0], v[0]);
COPY_FLOAT(dest[1], v[1]);
COPY_FLOAT(dest[2], v[2]);
@@ -344,7 +343,7 @@ void _mesa_noop_MultiTexCoord4fARB( GLenum target, GLfloat a, GLfloat b,
*/
if (unit < MAX_TEXTURE_UNITS)
{
- GLfloat *dest = ctx->Current.Texcoord[unit];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
COPY_FLOAT(dest[0], a);
COPY_FLOAT(dest[1], b);
COPY_FLOAT(dest[2], c);
@@ -361,7 +360,7 @@ void _mesa_noop_MultiTexCoord4fvARB( GLenum target, const GLfloat *v )
*/
if (unit < MAX_TEXTURE_UNITS)
{
- GLfloat *dest = ctx->Current.Texcoord[unit];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
COPY_FLOAT(dest[0], v[0]);
COPY_FLOAT(dest[1], v[1]);
COPY_FLOAT(dest[2], v[2]);
@@ -372,7 +371,7 @@ void _mesa_noop_MultiTexCoord4fvARB( GLenum target, const GLfloat *v )
void _mesa_noop_SecondaryColor3ubEXT( GLubyte a, GLubyte b, GLubyte c )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.SecondaryColor;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
color[0] = UBYTE_TO_FLOAT(a);
color[1] = UBYTE_TO_FLOAT(b);
color[2] = UBYTE_TO_FLOAT(c);
@@ -382,7 +381,7 @@ void _mesa_noop_SecondaryColor3ubEXT( GLubyte a, GLubyte b, GLubyte c )
void _mesa_noop_SecondaryColor3ubvEXT( const GLubyte *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.SecondaryColor;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
color[0] = UBYTE_TO_FLOAT(v[0]);
color[1] = UBYTE_TO_FLOAT(v[1]);
color[2] = UBYTE_TO_FLOAT(v[2]);
@@ -392,7 +391,7 @@ void _mesa_noop_SecondaryColor3ubvEXT( const GLubyte *v )
void _mesa_noop_SecondaryColor3fEXT( GLfloat a, GLfloat b, GLfloat c )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.SecondaryColor;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
color[0] = a;
color[1] = b;
color[2] = c;
@@ -402,7 +401,7 @@ void _mesa_noop_SecondaryColor3fEXT( GLfloat a, GLfloat b, GLfloat c )
void _mesa_noop_SecondaryColor3fvEXT( const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.SecondaryColor;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
color[0] = v[0];
color[1] = v[1];
color[2] = v[2];
@@ -412,7 +411,7 @@ void _mesa_noop_SecondaryColor3fvEXT( const GLfloat *v )
void _mesa_noop_TexCoord1f( GLfloat a )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Texcoord[0];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
COPY_FLOAT(dest[0], a);
dest[1] = 0;
dest[2] = 0;
@@ -422,7 +421,7 @@ void _mesa_noop_TexCoord1f( GLfloat a )
void _mesa_noop_TexCoord1fv( const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Texcoord[0];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
COPY_FLOAT(dest[0], v[0]);
dest[1] = 0;
dest[2] = 0;
@@ -432,7 +431,7 @@ void _mesa_noop_TexCoord1fv( const GLfloat *v )
void _mesa_noop_TexCoord2f( GLfloat a, GLfloat b )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Texcoord[0];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
COPY_FLOAT(dest[0], a);
COPY_FLOAT(dest[1], b);
dest[2] = 0;
@@ -442,7 +441,7 @@ void _mesa_noop_TexCoord2f( GLfloat a, GLfloat b )
void _mesa_noop_TexCoord2fv( const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Texcoord[0];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
COPY_FLOAT(dest[0], v[0]);
COPY_FLOAT(dest[1], v[1]);
dest[2] = 0;
@@ -452,7 +451,7 @@ void _mesa_noop_TexCoord2fv( const GLfloat *v )
void _mesa_noop_TexCoord3f( GLfloat a, GLfloat b, GLfloat c )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Texcoord[0];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
COPY_FLOAT(dest[0], a);
COPY_FLOAT(dest[1], b);
COPY_FLOAT(dest[2], c);
@@ -462,7 +461,7 @@ void _mesa_noop_TexCoord3f( GLfloat a, GLfloat b, GLfloat c )
void _mesa_noop_TexCoord3fv( const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Texcoord[0];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
COPY_FLOAT(dest[0], v[0]);
COPY_FLOAT(dest[1], v[1]);
COPY_FLOAT(dest[2], v[2]);
@@ -472,7 +471,7 @@ void _mesa_noop_TexCoord3fv( const GLfloat *v )
void _mesa_noop_TexCoord4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Texcoord[0];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
COPY_FLOAT(dest[0], a);
COPY_FLOAT(dest[1], b);
COPY_FLOAT(dest[2], c);
@@ -482,7 +481,7 @@ void _mesa_noop_TexCoord4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
void _mesa_noop_TexCoord4fv( const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Texcoord[0];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
COPY_FLOAT(dest[0], v[0]);
COPY_FLOAT(dest[1], v[1]);
COPY_FLOAT(dest[2], v[2]);
@@ -523,6 +522,25 @@ void _mesa_noop_Vertex4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
+void _mesa_noop_VertexAttrib4fNV( GLuint index, GLfloat x,
+ GLfloat y, GLfloat z, GLfloat w )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index < 16) {
+ ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, w);
+ }
+}
+
+void _mesa_noop_VertexAttrib4fvNV( GLuint index, const GLfloat *v )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index < 16) {
+ ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], v[3]);
+ }
+}
+
+
+
/* Execute a glRectf() function. This is not suitable for GL_COMPILE
* modes (as the test for outside begin/end is not compiled),
* but may be useful for drivers in circumstances which exclude
diff --git a/xc/extras/Mesa/src/api_noop.h b/xc/extras/Mesa/src/api_noop.h
index 380fe9225..da133ace7 100644
--- a/xc/extras/Mesa/src/api_noop.h
+++ b/xc/extras/Mesa/src/api_noop.h
@@ -1,8 +1,7 @@
-/* $Id: api_noop.h,v 1.1.1.1 2002/10/22 13:05:43 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
@@ -128,6 +127,12 @@ extern void _mesa_noop_Vertex3f( GLfloat a, GLfloat b, GLfloat c );
extern void _mesa_noop_Vertex4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d );
+extern void _mesa_noop_VertexAttrib4fNV( GLuint index, GLfloat x,
+ GLfloat y, GLfloat z, GLfloat w );
+
+extern void _mesa_noop_VertexAttrib4fvNV( GLuint index, const GLfloat *v );
+
+
/* Not strictly a noop -- translate Rectf down to Begin/End and
* vertices. Closer to the loopback operations, but doesn't meet the
diff --git a/xc/extras/Mesa/src/api_validate.c b/xc/extras/Mesa/src/api_validate.c
index 2f0869952..37ac4a142 100644
--- a/xc/extras/Mesa/src/api_validate.c
+++ b/xc/extras/Mesa/src/api_validate.c
@@ -1,8 +1,7 @@
-/* $Id: api_validate.c,v 1.1.1.1 2002/10/22 13:05:24 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.2
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -27,6 +26,7 @@
#include "glheader.h"
#include "api_validate.h"
#include "context.h"
+#include "imports.h"
#include "mtypes.h"
#include "state.h"
@@ -44,7 +44,8 @@ _mesa_validate_DrawElements(GLcontext *ctx,
return GL_FALSE;
}
- if (mode > GL_POLYGON) {
+ if (mode < 0 ||
+ mode > GL_POLYGON) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawArrays(mode)" );
return GL_FALSE;
}
@@ -60,7 +61,10 @@ _mesa_validate_DrawElements(GLcontext *ctx,
if (ctx->NewState)
_mesa_update_state( ctx );
- if (!ctx->Array.Vertex.Enabled)
+ if (ctx->Array.Vertex.Enabled
+ || (ctx->VertexProgram.Enabled && ctx->Array.VertexAttrib[0].Enabled))
+ return GL_TRUE;
+ else
return GL_FALSE;
return GL_TRUE;
@@ -81,7 +85,7 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode,
return GL_FALSE;
}
- if (mode > GL_POLYGON) {
+ if (mode < 0 || mode > GL_POLYGON) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawArrays(mode)" );
return GL_FALSE;
}
@@ -93,8 +97,7 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode,
if (type != GL_UNSIGNED_INT &&
type != GL_UNSIGNED_BYTE &&
- type != GL_UNSIGNED_SHORT)
- {
+ type != GL_UNSIGNED_SHORT) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawElements(type)" );
return GL_FALSE;
}
@@ -102,10 +105,11 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode,
if (ctx->NewState)
_mesa_update_state( ctx );
- if (!ctx->Array.Vertex.Enabled)
+ if (ctx->Array.Vertex.Enabled
+ || (ctx->VertexProgram.Enabled && ctx->Array.VertexAttrib[0].Enabled))
+ return GL_TRUE;
+ else
return GL_FALSE;
-
- return GL_TRUE;
}
@@ -121,7 +125,7 @@ _mesa_validate_DrawArrays(GLcontext *ctx,
return GL_FALSE;
}
- if (mode > GL_POLYGON) {
+ if (mode < 0 || mode > GL_POLYGON) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawArrays(mode)" );
return GL_FALSE;
}
@@ -129,8 +133,9 @@ _mesa_validate_DrawArrays(GLcontext *ctx,
if (ctx->NewState)
_mesa_update_state( ctx );
- if (!ctx->Array.Vertex.Enabled)
+ if (ctx->Array.Vertex.Enabled
+ || (ctx->VertexProgram.Enabled && ctx->Array.VertexAttrib[0].Enabled))
+ return GL_TRUE;
+ else
return GL_FALSE;
-
- return GL_TRUE;
}
diff --git a/xc/extras/Mesa/src/array_cache/ac_context.c b/xc/extras/Mesa/src/array_cache/ac_context.c
index d78394e52..6c807158c 100644
--- a/xc/extras/Mesa/src/array_cache/ac_context.c
+++ b/xc/extras/Mesa/src/array_cache/ac_context.c
@@ -1,10 +1,9 @@
-/* $Id: ac_context.c,v 1.1.1.1 2002/10/22 13:06:39 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,17 +23,22 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#include "glheader.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
#include "array_cache/ac_context.h"
+
+/*
+ * Initialize the array fallbacks. That is, by default the fallback arrays
+ * point into the current vertex attribute values in ctx->Current.Attrib[]
+ */
static void _ac_fallbacks_init( GLcontext *ctx )
{
ACcontext *ac = AC_CONTEXT(ctx);
@@ -46,7 +50,7 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Type = GL_FLOAT;
cl->Stride = 0;
cl->StrideB = 0;
- cl->Ptr = (void *) ctx->Current.Normal;
+ cl->Ptr = (void *) ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
@@ -55,7 +59,7 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Type = GL_FLOAT;
cl->Stride = 0;
cl->StrideB = 0;
- cl->Ptr = (void *) ctx->Current.Color;
+ cl->Ptr = (void *) ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
@@ -64,7 +68,7 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Type = GL_FLOAT;
cl->Stride = 0;
cl->StrideB = 0;
- cl->Ptr = (void *) ctx->Current.SecondaryColor;
+ cl->Ptr = (void *) ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
@@ -73,7 +77,7 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Type = GL_FLOAT;
cl->Stride = 0;
cl->StrideB = 0;
- cl->Ptr = (void *) &ctx->Current.FogCoord;
+ cl->Ptr = (void *) &ctx->Current.Attrib[VERT_ATTRIB_FOG];
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
@@ -92,7 +96,7 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Type = GL_FLOAT;
cl->Stride = 0;
cl->StrideB = 0;
- cl->Ptr = (void *) ctx->Current.Texcoord[i];
+ cl->Ptr = (void *) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + i];
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
}
@@ -105,9 +109,23 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Ptr = (void *) &ctx->Current.EdgeFlag;
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
+
+ for (i = 0; i < VERT_ATTRIB_MAX; i++) {
+ cl = &ac->Fallback.Attrib[i];
+ cl->Size = 4;
+ cl->Type = GL_FLOAT;
+ cl->Stride = 0;
+ cl->StrideB = 0;
+ cl->Ptr = (void *) ctx->Current.Attrib[i];
+ cl->Enabled = 1;
+ cl->Flags = CA_CLIENT_DATA; /* hack */
+ }
}
+/*
+ * Initialize the array cache pointers, types, strides, etc.
+ */
static void _ac_cache_init( GLcontext *ctx )
{
ACcontext *ac = AC_CONTEXT(ctx);
@@ -169,7 +187,7 @@ static void _ac_cache_init( GLcontext *ctx )
cl->Enabled = 1;
cl->Flags = 0;
- for (i = 0 ; i < MAX_TEXTURE_UNITS ; i++) {
+ for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
cl = &ac->Cache.TexCoord[i];
cl->Size = 4;
cl->Type = GL_FLOAT;
@@ -188,6 +206,17 @@ static void _ac_cache_init( GLcontext *ctx )
cl->Ptr = MALLOC( cl->StrideB * size );
cl->Enabled = 1;
cl->Flags = 0;
+
+ for (i = 0 ; i < VERT_ATTRIB_MAX; i++) {
+ cl = &ac->Cache.Attrib[i];
+ cl->Size = 4;
+ cl->Type = GL_FLOAT;
+ cl->Stride = 0;
+ cl->StrideB = 4 * sizeof(GLfloat);
+ cl->Ptr = MALLOC( cl->StrideB * size );
+ cl->Enabled = 1;
+ cl->Flags = 0;
+ }
}
@@ -229,6 +258,10 @@ static void _ac_raw_init( GLcontext *ctx )
ac->IsCached.TexCoord[i] = GL_FALSE;
}
+ for (i = 0 ; i < VERT_ATTRIB_MAX ; i++) {
+ ac->Raw.Attrib[i] = ac->Fallback.Attrib[i];
+ ac->IsCached.Attrib[i] = GL_FALSE;
+ }
}
GLboolean _ac_CreateContext( GLcontext *ctx )
@@ -262,6 +295,11 @@ void _ac_DestroyContext( GLcontext *ctx )
FREE( ac->Cache.TexCoord[i].Ptr );
}
+ for (i = 0; i < VERT_ATTRIB_MAX; i++) {
+ if (ac->Cache.Attrib[i].Ptr)
+ FREE( ac->Cache.Attrib[i].Ptr );
+ }
+
if (ac->Elts) FREE( ac->Elts );
/* Free the context structure itself */
diff --git a/xc/extras/Mesa/src/array_cache/ac_context.h b/xc/extras/Mesa/src/array_cache/ac_context.h
index 4916497b7..19a41e093 100644
--- a/xc/extras/Mesa/src/array_cache/ac_context.h
+++ b/xc/extras/Mesa/src/array_cache/ac_context.h
@@ -1,10 +1,9 @@
-/* $Id: ac_context.h,v 1.1.1.1 2002/10/22 13:06:39 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#ifndef _AC_CONTEXT_H
@@ -47,6 +46,7 @@ struct ac_arrays {
struct gl_client_array Index;
struct gl_client_array TexCoord[MAX_TEXTURE_UNITS];
struct gl_client_array EdgeFlag;
+ struct gl_client_array Attrib[VERT_ATTRIB_MAX]; /* GL_NV_vertex_program */
};
struct ac_array_pointers {
@@ -58,6 +58,7 @@ struct ac_array_pointers {
struct gl_client_array *Index;
struct gl_client_array *TexCoord[MAX_TEXTURE_UNITS];
struct gl_client_array *EdgeFlag;
+ struct gl_client_array *Attrib[VERT_ATTRIB_MAX]; /* GL_NV_vertex_program */
};
struct ac_array_flags {
@@ -69,6 +70,7 @@ struct ac_array_flags {
GLboolean Index;
GLboolean TexCoord[MAX_TEXTURE_UNITS];
GLboolean EdgeFlag;
+ GLboolean Attrib[VERT_ATTRIB_MAX]; /* GL_NV_vertex_program */
};
diff --git a/xc/extras/Mesa/src/array_cache/ac_import.c b/xc/extras/Mesa/src/array_cache/ac_import.c
index 745a7c4f0..d68de5b03 100644
--- a/xc/extras/Mesa/src/array_cache/ac_import.c
+++ b/xc/extras/Mesa/src/array_cache/ac_import.c
@@ -1,10 +1,9 @@
-/* $Id: ac_import.c,v 1.1.1.1 2002/10/22 13:06:39 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,12 +23,12 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#include "glheader.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
@@ -59,9 +58,9 @@ static void reset_texcoord( GLcontext *ctx, GLuint unit )
else {
ac->Raw.TexCoord[unit] = ac->Fallback.TexCoord[unit];
- if (ctx->Current.Texcoord[unit][3] != 1.0)
+ if (ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][3] != 1.0)
ac->Raw.TexCoord[unit].Size = 4;
- else if (ctx->Current.Texcoord[unit][2] != 0.0)
+ else if (ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][2] != 0.0)
ac->Raw.TexCoord[unit].Size = 3;
else
ac->Raw.TexCoord[unit].Size = 2;
@@ -74,7 +73,8 @@ static void reset_texcoord( GLcontext *ctx, GLuint unit )
static void reset_vertex( GLcontext *ctx )
{
ACcontext *ac = AC_CONTEXT(ctx);
- ASSERT(ctx->Array.Vertex.Enabled);
+ ASSERT(ctx->Array.Vertex.Enabled
+ || (ctx->VertexProgram.Enabled && ctx->Array.VertexAttrib[0].Enabled));
ac->Raw.Vertex = ctx->Array.Vertex;
STRIDE_ARRAY(ac->Raw.Vertex, ac->start);
ac->IsCached.Vertex = GL_FALSE;
@@ -104,7 +104,7 @@ static void reset_color( GLcontext *ctx )
ACcontext *ac = AC_CONTEXT(ctx);
- if (ctx->Array._Enabled & _NEW_ARRAY_COLOR) {
+ if (ctx->Array._Enabled & _NEW_ARRAY_COLOR0) {
ac->Raw.Color = ctx->Array.Color;
STRIDE_ARRAY(ac->Raw.Color, ac->start);
}
@@ -112,7 +112,7 @@ static void reset_color( GLcontext *ctx )
ac->Raw.Color = ac->Fallback.Color;
ac->IsCached.Color = GL_FALSE;
- ac->NewArrayState &= ~_NEW_ARRAY_COLOR;
+ ac->NewArrayState &= ~_NEW_ARRAY_COLOR0;
}
@@ -120,7 +120,7 @@ static void reset_secondarycolor( GLcontext *ctx )
{
ACcontext *ac = AC_CONTEXT(ctx);
- if (ctx->Array._Enabled & _NEW_ARRAY_SECONDARYCOLOR) {
+ if (ctx->Array._Enabled & _NEW_ARRAY_COLOR1) {
ac->Raw.SecondaryColor = ctx->Array.SecondaryColor;
STRIDE_ARRAY(ac->Raw.SecondaryColor, ac->start);
}
@@ -128,7 +128,7 @@ static void reset_secondarycolor( GLcontext *ctx )
ac->Raw.SecondaryColor = ac->Fallback.SecondaryColor;
ac->IsCached.SecondaryColor = GL_FALSE;
- ac->NewArrayState &= ~_NEW_ARRAY_SECONDARYCOLOR;
+ ac->NewArrayState &= ~_NEW_ARRAY_COLOR1;
}
@@ -147,6 +147,7 @@ static void reset_index( GLcontext *ctx )
ac->NewArrayState &= ~_NEW_ARRAY_INDEX;
}
+
static void reset_fogcoord( GLcontext *ctx )
{
ACcontext *ac = AC_CONTEXT(ctx);
@@ -162,6 +163,7 @@ static void reset_fogcoord( GLcontext *ctx )
ac->NewArrayState &= ~_NEW_ARRAY_FOGCOORD;
}
+
static void reset_edgeflag( GLcontext *ctx )
{
ACcontext *ac = AC_CONTEXT(ctx);
@@ -178,7 +180,73 @@ static void reset_edgeflag( GLcontext *ctx )
}
+static void reset_attrib( GLcontext *ctx, GLuint index )
+{
+ ACcontext *ac = AC_CONTEXT(ctx);
+ GLboolean fallback = GL_FALSE;
+
+ /*
+ * The 16 NV vertex attribute arrays have top priority. If one of those
+ * is not enabled, look if a corresponding conventional array is enabled.
+ * If nothing else, use the fallback (ctx->Current.Attrib) values.
+ */
+ if (ctx->Array._Enabled & _NEW_ARRAY_ATTRIB(index)) {
+ ac->Raw.Attrib[index] = ctx->Array.VertexAttrib[index];
+ STRIDE_ARRAY(ac->Raw.Attrib[index], ac->start);
+ }
+ else if (ctx->Array._Enabled & (1 << index)) {
+ /* use conventional vertex array if possible */
+ if (index == VERT_ATTRIB_POS) {
+ ac->Raw.Attrib[index] = ctx->Array.Vertex;
+ }
+ else if (index == VERT_ATTRIB_NORMAL) {
+ ac->Raw.Attrib[index] = ctx->Array.Normal;
+ }
+ else if (index == VERT_ATTRIB_COLOR0) {
+ ac->Raw.Attrib[index] = ctx->Array.Color;
+ }
+ else if (index == VERT_ATTRIB_COLOR1) {
+ ac->Raw.Attrib[index] = ctx->Array.SecondaryColor;
+ }
+ else if (index == VERT_ATTRIB_FOG) {
+ ac->Raw.Attrib[index] = ctx->Array.FogCoord;
+ }
+ else if (index >= VERT_ATTRIB_TEX0 && index <= VERT_ATTRIB_TEX7) {
+ GLuint unit = index - VERT_ATTRIB_TEX0;
+ ASSERT(unit < MAX_TEXTURE_UNITS);
+ ac->Raw.Attrib[index] = ctx->Array.TexCoord[unit];
+ }
+ else {
+ /* missing conventional array (vertex weight, for example) */
+ fallback = GL_TRUE;
+ }
+ if (!fallback)
+ STRIDE_ARRAY(ac->Raw.Attrib[index], ac->start);
+ }
+ else {
+ fallback = GL_TRUE;
+ }
+
+ if (fallback) {
+ /* fallback to ctx->Current.Attrib values */
+ ac->Raw.Attrib[index] = ac->Fallback.Attrib[index];
+
+ if (ctx->Current.Attrib[index][3] != 1.0)
+ ac->Raw.Attrib[index].Size = 4;
+ else if (ctx->Current.Attrib[index][2] != 0.0)
+ ac->Raw.Attrib[index].Size = 3;
+ else
+ ac->Raw.Attrib[index].Size = 2;
+ }
+
+ ac->IsCached.Attrib[index] = GL_FALSE;
+ ac->NewArrayState &= ~_NEW_ARRAY_ATTRIB(index);
+}
+
+/*
+ * Generic import function for color data
+ */
static void import( GLcontext *ctx,
GLenum type,
struct gl_client_array *to,
@@ -237,8 +305,12 @@ static void import( GLcontext *ctx,
-/* Functions to import array ranges with specified types and strides.
+/*
+ * Functions to import array ranges with specified types and strides.
+ * For example, if the vertex data is GLshort[2] and we want GLfloat[3]
+ * we'll use an import function to do the data conversion.
*/
+
static void import_texcoord( GLcontext *ctx, GLuint unit,
GLenum type, GLuint stride )
{
@@ -246,6 +318,8 @@ static void import_texcoord( GLcontext *ctx, GLuint unit,
struct gl_client_array *from = &ac->Raw.TexCoord[unit];
struct gl_client_array *to = &ac->Cache.TexCoord[unit];
+ ASSERT(unit < ctx->Const.MaxTextureUnits);
+
/* Limited choices at this stage:
*/
ASSERT(type == GL_FLOAT);
@@ -316,9 +390,6 @@ static void import_normal( GLcontext *ctx,
ac->IsCached.Normal = GL_TRUE;
}
-
-
-
static void import_color( GLcontext *ctx,
GLenum type, GLuint stride )
{
@@ -415,10 +486,42 @@ static void import_edgeflag( GLcontext *ctx,
ac->IsCached.EdgeFlag = GL_TRUE;
}
+static void import_attrib( GLcontext *ctx, GLuint index,
+ GLenum type, GLuint stride )
+{
+ ACcontext *ac = AC_CONTEXT(ctx);
+ struct gl_client_array *from = &ac->Raw.Attrib[index];
+ struct gl_client_array *to = &ac->Cache.Attrib[index];
+
+ ASSERT(index < VERT_ATTRIB_MAX);
+
+ /* Limited choices at this stage:
+ */
+ ASSERT(type == GL_FLOAT);
+ ASSERT(stride == 4*sizeof(GLfloat) || stride == 0);
+ ASSERT(ac->count - ac->start < ctx->Const.MaxArrayLockSize);
+
+ _math_trans_4f( (GLfloat (*)[4]) to->Ptr,
+ from->Ptr,
+ from->StrideB,
+ from->Type,
+ from->Size,
+ 0,
+ ac->count - ac->start);
+
+ to->Size = from->Size;
+ to->StrideB = 4 * sizeof(GLfloat);
+ to->Type = GL_FLOAT;
+ ac->IsCached.Attrib[index] = GL_TRUE;
+}
+
-/* Externals to request arrays with specific properties:
+/*
+ * Externals to request arrays with specific properties:
*/
+
+
struct gl_client_array *_ac_import_texcoord( GLcontext *ctx,
GLuint unit,
GLenum type,
@@ -429,6 +532,8 @@ struct gl_client_array *_ac_import_texcoord( GLcontext *ctx,
{
ACcontext *ac = AC_CONTEXT(ctx);
+ ASSERT(unit < ctx->Const.MaxTextureUnits);
+
/* Can we keep the existing version?
*/
if (ac->NewArrayState & _NEW_ARRAY_TEXCOORD(unit))
@@ -533,7 +638,7 @@ struct gl_client_array *_ac_import_color( GLcontext *ctx,
/* Can we keep the existing version?
*/
- if (ac->NewArrayState & _NEW_ARRAY_COLOR)
+ if (ac->NewArrayState & _NEW_ARRAY_COLOR0)
reset_color( ctx );
/* Is the request impossible?
@@ -601,7 +706,7 @@ struct gl_client_array *_ac_import_secondarycolor( GLcontext *ctx,
/* Can we keep the existing version?
*/
- if (ac->NewArrayState & _NEW_ARRAY_SECONDARYCOLOR)
+ if (ac->NewArrayState & _NEW_ARRAY_COLOR1)
reset_secondarycolor( ctx );
/* Is the request impossible?
@@ -656,9 +761,6 @@ struct gl_client_array *_ac_import_fogcoord( GLcontext *ctx,
}
}
-
-
-
struct gl_client_array *_ac_import_edgeflag( GLcontext *ctx,
GLenum type,
GLuint reqstride,
@@ -689,8 +791,50 @@ struct gl_client_array *_ac_import_edgeflag( GLcontext *ctx,
}
}
+/* GL_NV_vertex_program */
+struct gl_client_array *_ac_import_attrib( GLcontext *ctx,
+ GLuint index,
+ GLenum type,
+ GLuint reqstride,
+ GLuint reqsize,
+ GLboolean reqwriteable,
+ GLboolean *writeable )
+{
+ ACcontext *ac = AC_CONTEXT(ctx);
+
+ ASSERT(index < VERT_ATTRIB_MAX);
+
+ /* Can we keep the existing version?
+ */
+ if (ac->NewArrayState & _NEW_ARRAY_ATTRIB(index)) {
+ reset_attrib( ctx, index );
+ }
+ else if (ac->NewArrayState & (1 << index)) {
+ /* Also need to check conventional attributes */
+ reset_attrib( ctx, index );
+ }
+ /* Is the request impossible?
+ */
+ if (reqsize != 0 && ac->Raw.Attrib[index].Size > (GLint) reqsize)
+ return NULL;
+ /* Do we need to pull in a copy of the client data:
+ */
+ if (ac->Raw.Attrib[index].Type != type ||
+ (reqstride != 0 && ac->Raw.Attrib[index].StrideB != (GLint)reqstride) ||
+ reqwriteable)
+ {
+ if (!ac->IsCached.Attrib[index])
+ import_attrib(ctx, index, type, reqstride );
+ *writeable = GL_TRUE;
+ return &ac->Cache.Attrib[index];
+ }
+ else {
+ *writeable = GL_FALSE;
+ return &ac->Raw.Attrib[index];
+ }
+}
/* Clients must call this function to validate state and set bounds
@@ -723,8 +867,8 @@ void _ac_import_range( GLcontext *ctx, GLuint start, GLuint count )
-/* Additional convienence function for importing a the element list
- * for drawelements, drawrangeelements:
+/* Additional convienence function for importing the element list
+ * for glDrawElements() and glDrawRangeElements().
*/
CONST void *
_ac_import_elements( GLcontext *ctx,
diff --git a/xc/extras/Mesa/src/array_cache/acache.h b/xc/extras/Mesa/src/array_cache/acache.h
index 52e4c1f80..2bb64f365 100644
--- a/xc/extras/Mesa/src/array_cache/acache.h
+++ b/xc/extras/Mesa/src/array_cache/acache.h
@@ -1,10 +1,9 @@
-/* $Id: acache.h,v 1.1.1.1 2002/10/22 13:06:39 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#ifndef _ARRAYCACHE_H
@@ -43,15 +42,6 @@ extern void
_ac_InvalidateState( GLcontext *ctx, GLuint new_state );
extern struct gl_client_array *
-_ac_import_texcoord( GLcontext *ctx,
- GLuint unit,
- GLenum type,
- GLuint reqstride,
- GLuint reqsize,
- GLboolean reqwritable,
- GLboolean *writable );
-
-extern struct gl_client_array *
_ac_import_vertex( GLcontext *ctx,
GLenum type,
GLuint reqstride,
@@ -103,6 +93,24 @@ _ac_import_edgeflag( GLcontext *ctx,
GLboolean reqwritable,
GLboolean *writable );
+extern struct gl_client_array *
+_ac_import_texcoord( GLcontext *ctx,
+ GLuint unit,
+ GLenum type,
+ GLuint reqstride,
+ GLuint reqsize,
+ GLboolean reqwritable,
+ GLboolean *writable );
+
+extern struct gl_client_array *
+_ac_import_attrib( GLcontext *ctx,
+ GLuint index,
+ GLenum type,
+ GLuint reqstride,
+ GLuint reqsize,
+ GLboolean reqwritable,
+ GLboolean *writable );
+
/* Clients must call this function to validate state and set bounds
* before importing any data:
diff --git a/xc/extras/Mesa/src/attrib.c b/xc/extras/Mesa/src/attrib.c
index 636c33ee5..dec0ca5f5 100644
--- a/xc/extras/Mesa/src/attrib.c
+++ b/xc/extras/Mesa/src/attrib.c
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.4
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -23,11 +23,8 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "accum.h"
#include "attrib.h"
#include "blend.h"
@@ -42,7 +39,6 @@
#include "light.h"
#include "lines.h"
#include "matrix.h"
-#include "mem.h"
#include "points.h"
#include "polygon.h"
#include "simple_list.h"
@@ -51,9 +47,6 @@
#include "texstate.h"
#include "mtypes.h"
#include "math/m_xform.h"
-#endif
-
-
/*
@@ -80,8 +73,8 @@ _mesa_PushAttrib(GLbitfield mask)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glPushAttrib %x\n", (int)mask);
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glPushAttrib %x\n", (int) mask);
if (ctx->AttribStackDepth >= MAX_ATTRIB_STACK_DEPTH) {
_mesa_error( ctx, GL_STACK_OVERFLOW, "glPushAttrib" );
@@ -141,9 +134,7 @@ _mesa_PushAttrib(GLbitfield mask)
attr->AlphaTest = ctx->Color.AlphaEnabled;
attr->AutoNormal = ctx->Eval.AutoNormal;
attr->Blend = ctx->Color.BlendEnabled;
- for (i=0;i<MAX_CLIP_PLANES;i++) {
- attr->ClipPlane[i] = ctx->Transform.ClipEnabled[i];
- }
+ attr->ClipPlanes = ctx->Transform.ClipPlanesEnabled;
attr->ColorMaterial = ctx->Light.ColorMaterialEnabled;
attr->Convolution1D = ctx->Pixel.Convolution1DEnabled;
attr->Convolution2D = ctx->Pixel.Convolution2DEnabled;
@@ -171,6 +162,7 @@ _mesa_PushAttrib(GLbitfield mask)
attr->Map1TextureCoord4 = ctx->Eval.Map1TextureCoord4;
attr->Map1Vertex3 = ctx->Eval.Map1Vertex3;
attr->Map1Vertex4 = ctx->Eval.Map1Vertex4;
+ MEMCPY(attr->Map1Attrib, ctx->Eval.Map1Attrib, sizeof(ctx->Eval.Map1Attrib));
attr->Map2Color4 = ctx->Eval.Map2Color4;
attr->Map2Index = ctx->Eval.Map2Index;
attr->Map2Normal = ctx->Eval.Map2Normal;
@@ -180,10 +172,12 @@ _mesa_PushAttrib(GLbitfield mask)
attr->Map2TextureCoord4 = ctx->Eval.Map2TextureCoord4;
attr->Map2Vertex3 = ctx->Eval.Map2Vertex3;
attr->Map2Vertex4 = ctx->Eval.Map2Vertex4;
+ MEMCPY(attr->Map2Attrib, ctx->Eval.Map2Attrib, sizeof(ctx->Eval.Map2Attrib));
attr->Normalize = ctx->Transform.Normalize;
attr->RasterPositionUnclipped = ctx->Transform.RasterPositionUnclipped;
attr->PixelTexture = ctx->Pixel.PixelTextureEnabled;
attr->PointSmooth = ctx->Point.SmoothFlag;
+ attr->PointSprite = ctx->Point.PointSprite;
attr->PolygonOffsetPoint = ctx->Polygon.OffsetPoint;
attr->PolygonOffsetLine = ctx->Polygon.OffsetLine;
attr->PolygonOffsetFill = ctx->Polygon.OffsetFill;
@@ -201,6 +195,10 @@ _mesa_PushAttrib(GLbitfield mask)
attr->Texture[i] = ctx->Texture.Unit[i].Enabled;
attr->TexGen[i] = ctx->Texture.Unit[i].TexGenEnabled;
}
+ /* GL_NV_vertex_program */
+ attr->VertexProgram = ctx->VertexProgram.Enabled;
+ attr->VertexProgramPointSize = ctx->VertexProgram.PointSizeEnabled;
+ attr->VertexProgramTwoSide = ctx->VertexProgram.TwoSideEnabled;
newnode = new_attrib_node( GL_ENABLE_BIT );
newnode->data = attr;
newnode->next = head;
@@ -339,21 +337,22 @@ _mesa_PushAttrib(GLbitfield mask)
ctx->Texture.Unit[u].Current2D->RefCount++;
ctx->Texture.Unit[u].Current3D->RefCount++;
ctx->Texture.Unit[u].CurrentCubeMap->RefCount++;
+ ctx->Texture.Unit[u].CurrentRect->RefCount++;
}
attr = MALLOC_STRUCT( gl_texture_attrib );
MEMCPY( attr, &ctx->Texture, sizeof(struct gl_texture_attrib) );
/* copy state of the currently bound texture objects */
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
_mesa_copy_texture_object(&attr->Unit[u].Saved1D,
- attr->Unit[u].Current1D);
+ attr->Unit[u].Current1D);
_mesa_copy_texture_object(&attr->Unit[u].Saved2D,
- attr->Unit[u].Current2D);
+ attr->Unit[u].Current2D);
_mesa_copy_texture_object(&attr->Unit[u].Saved3D,
- attr->Unit[u].Current3D);
+ attr->Unit[u].Current3D);
_mesa_copy_texture_object(&attr->Unit[u].SavedCubeMap,
- attr->Unit[u].CurrentCubeMap);
+ attr->Unit[u].CurrentCubeMap);
_mesa_copy_texture_object(&attr->Unit[u].SavedRect,
- attr->Unit[u].CurrentRect);
+ attr->Unit[u].CurrentRect);
}
newnode = new_attrib_node( GL_TEXTURE_BIT );
newnode->data = attr;
@@ -412,9 +411,10 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable)
TEST_AND_UPDATE(ctx->Color.BlendEnabled, enable->Blend, GL_BLEND);
for (i=0;i<MAX_CLIP_PLANES;i++) {
- if (ctx->Transform.ClipEnabled[i] != enable->ClipPlane[i])
- _mesa_set_enable(ctx, (GLenum) (GL_CLIP_PLANE0 + i),
- enable->ClipPlane[i]);
+ const GLuint mask = 1 << i;
+ if ((ctx->Transform.ClipPlanesEnabled & mask) != (enable->ClipPlanes & mask))
+ _mesa_set_enable(ctx, (GLenum) (GL_CLIP_PLANE0 + i),
+ (GLboolean) ((enable->ClipPlanes & mask) ? GL_TRUE : GL_FALSE));
}
TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial,
@@ -437,6 +437,7 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable)
GL_INDEX_LOGIC_OP);
TEST_AND_UPDATE(ctx->Color.ColorLogicOpEnabled, enable->ColorLogicOp,
GL_COLOR_LOGIC_OP);
+
TEST_AND_UPDATE(ctx->Eval.Map1Color4, enable->Map1Color4, GL_MAP1_COLOR_4);
TEST_AND_UPDATE(ctx->Eval.Map1Index, enable->Map1Index, GL_MAP1_INDEX);
TEST_AND_UPDATE(ctx->Eval.Map1Normal, enable->Map1Normal, GL_MAP1_NORMAL);
@@ -452,6 +453,11 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable)
GL_MAP1_VERTEX_3);
TEST_AND_UPDATE(ctx->Eval.Map1Vertex4, enable->Map1Vertex4,
GL_MAP1_VERTEX_4);
+ for (i = 0; i < 16; i++) {
+ TEST_AND_UPDATE(ctx->Eval.Map1Attrib[i], enable->Map1Attrib[i],
+ GL_MAP1_VERTEX_ATTRIB0_4_NV + i);
+ }
+
TEST_AND_UPDATE(ctx->Eval.Map2Color4, enable->Map2Color4, GL_MAP2_COLOR_4);
TEST_AND_UPDATE(ctx->Eval.Map2Index, enable->Map2Index, GL_MAP2_INDEX);
TEST_AND_UPDATE(ctx->Eval.Map2Normal, enable->Map2Normal, GL_MAP2_NORMAL);
@@ -467,6 +473,11 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable)
GL_MAP2_VERTEX_3);
TEST_AND_UPDATE(ctx->Eval.Map2Vertex4, enable->Map2Vertex4,
GL_MAP2_VERTEX_4);
+ for (i = 0; i < 16; i++) {
+ TEST_AND_UPDATE(ctx->Eval.Map2Attrib[i], enable->Map2Attrib[i],
+ GL_MAP2_VERTEX_ATTRIB0_4_NV + i);
+ }
+
TEST_AND_UPDATE(ctx->Eval.AutoNormal, enable->AutoNormal, GL_AUTO_NORMAL);
TEST_AND_UPDATE(ctx->Transform.Normalize, enable->Normalize, GL_NORMALIZE);
TEST_AND_UPDATE(ctx->Transform.RescaleNormals, enable->RescaleNormals,
@@ -478,6 +489,10 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable)
GL_POINT_SMOOTH);
TEST_AND_UPDATE(ctx->Point.SmoothFlag, enable->PointSmooth,
GL_POINT_SMOOTH);
+ if (ctx->Extensions.NV_point_sprite) {
+ TEST_AND_UPDATE(ctx->Point.PointSprite, enable->PointSprite,
+ GL_POINT_SPRITE_NV);
+ }
TEST_AND_UPDATE(ctx->Polygon.OffsetPoint, enable->PolygonOffsetPoint,
GL_POLYGON_OFFSET_POINT);
TEST_AND_UPDATE(ctx->Polygon.OffsetLine, enable->PolygonOffsetLine,
@@ -490,6 +505,7 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable)
GL_POLYGON_STIPPLE);
TEST_AND_UPDATE(ctx->Scissor.Enabled, enable->Scissor, GL_SCISSOR_TEST);
TEST_AND_UPDATE(ctx->Stencil.Enabled, enable->Stencil, GL_STENCIL_TEST);
+ /* XXX two-sided stencil */
TEST_AND_UPDATE(ctx->Multisample.Enabled, enable->MultisampleEnabled,
GL_MULTISAMPLE_ARB);
TEST_AND_UPDATE(ctx->Multisample.SampleAlphaToCoverage,
@@ -504,6 +520,17 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable)
TEST_AND_UPDATE(ctx->Multisample.SampleCoverageInvert,
enable->SampleCoverageInvert,
GL_SAMPLE_COVERAGE_INVERT_ARB);
+ /* GL_NV_vertex_program */
+ TEST_AND_UPDATE(ctx->VertexProgram.Enabled,
+ enable->VertexProgram,
+ GL_VERTEX_PROGRAM_NV);
+ TEST_AND_UPDATE(ctx->VertexProgram.PointSizeEnabled,
+ enable->VertexProgramPointSize,
+ GL_VERTEX_PROGRAM_POINT_SIZE_NV);
+ TEST_AND_UPDATE(ctx->VertexProgram.TwoSideEnabled,
+ enable->VertexProgramTwoSide,
+ GL_VERTEX_PROGRAM_TWO_SIDE_NV);
+
#undef TEST_AND_UPDATE
/* texture unit enables */
@@ -515,17 +542,17 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable)
(*ctx->Driver.ActiveTexture)(ctx, i);
}
(*ctx->Driver.Enable)( ctx, GL_TEXTURE_1D,
- (GLboolean) (enable->Texture[i] & TEXTURE0_1D) );
+ (GLboolean) (enable->Texture[i] & TEXTURE_1D_BIT) );
(*ctx->Driver.Enable)( ctx, GL_TEXTURE_2D,
- (GLboolean) (enable->Texture[i] & TEXTURE0_2D) );
+ (GLboolean) (enable->Texture[i] & TEXTURE_2D_BIT) );
(*ctx->Driver.Enable)( ctx, GL_TEXTURE_3D,
- (GLboolean) (enable->Texture[i] & TEXTURE0_3D) );
+ (GLboolean) (enable->Texture[i] & TEXTURE_3D_BIT) );
if (ctx->Extensions.ARB_texture_cube_map)
(*ctx->Driver.Enable)( ctx, GL_TEXTURE_CUBE_MAP_ARB,
- (GLboolean) (enable->Texture[i] & TEXTURE0_CUBE) );
+ (GLboolean) (enable->Texture[i] & TEXTURE_CUBE_BIT) );
if (ctx->Extensions.NV_texture_rectangle)
(*ctx->Driver.Enable)( ctx, GL_TEXTURE_RECTANGLE_NV,
- (GLboolean) (enable->Texture[i] & TEXTURE0_RECT) );
+ (GLboolean) (enable->Texture[i] & TEXTURE_RECT_BIT) );
}
}
@@ -572,18 +599,18 @@ pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib)
_mesa_ActiveTextureARB(GL_TEXTURE0_ARB + u);
_mesa_set_enable(ctx, GL_TEXTURE_1D,
- (GLboolean) (unit->Enabled & TEXTURE0_1D ? GL_TRUE : GL_FALSE));
+ (GLboolean) (unit->Enabled & TEXTURE_1D_BIT ? GL_TRUE : GL_FALSE));
_mesa_set_enable(ctx, GL_TEXTURE_2D,
- (GLboolean) (unit->Enabled & TEXTURE0_2D ? GL_TRUE : GL_FALSE));
+ (GLboolean) (unit->Enabled & TEXTURE_2D_BIT ? GL_TRUE : GL_FALSE));
_mesa_set_enable(ctx, GL_TEXTURE_3D,
- (GLboolean) (unit->Enabled & TEXTURE0_3D ? GL_TRUE : GL_FALSE));
+ (GLboolean) (unit->Enabled & TEXTURE_3D_BIT ? GL_TRUE : GL_FALSE));
if (ctx->Extensions.ARB_texture_cube_map) {
_mesa_set_enable(ctx, GL_TEXTURE_CUBE_MAP_ARB,
- (GLboolean) (unit->Enabled & TEXTURE0_CUBE ? GL_TRUE : GL_FALSE));
+ (GLboolean) (unit->Enabled & TEXTURE_CUBE_BIT ? GL_TRUE : GL_FALSE));
}
if (ctx->Extensions.NV_texture_rectangle) {
_mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE_NV,
- (GLboolean) (unit->Enabled & TEXTURE0_RECT ? GL_TRUE : GL_FALSE));
+ (GLboolean) (unit->Enabled & TEXTURE_RECT_BIT ? GL_TRUE : GL_FALSE));
}
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, unit->EnvMode);
_mesa_TexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, unit->EnvColor);
@@ -704,7 +731,7 @@ pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib)
}
if (ctx->Extensions.SGIX_shadow_ambient) {
_mesa_TexParameterf(target, GL_SHADOW_AMBIENT_SGIX,
- CHAN_TO_FLOAT(obj->ShadowAmbient));
+ obj->ShadowAmbient);
}
}
@@ -753,9 +780,9 @@ _mesa_PopAttrib(void)
while (attr) {
- if (MESA_VERBOSE&VERBOSE_API) {
- fprintf(stderr, "glPopAttrib %s\n",
- _mesa_lookup_enum_by_nr(attr->kind));
+ if (MESA_VERBOSE & VERBOSE_API) {
+ _mesa_debug(ctx, "glPopAttrib %s\n",
+ _mesa_lookup_enum_by_nr(attr->kind));
}
switch (attr->kind) {
@@ -774,10 +801,10 @@ _mesa_PopAttrib(void)
const struct gl_colorbuffer_attrib *color;
color = (const struct gl_colorbuffer_attrib *) attr->data;
_mesa_ClearIndex((GLfloat) color->ClearIndex);
- _mesa_ClearColor(CHAN_TO_FLOAT(color->ClearColor[0]),
- CHAN_TO_FLOAT(color->ClearColor[1]),
- CHAN_TO_FLOAT(color->ClearColor[2]),
- CHAN_TO_FLOAT(color->ClearColor[3]));
+ _mesa_ClearColor(color->ClearColor[0],
+ color->ClearColor[1],
+ color->ClearColor[2],
+ color->ClearColor[3]);
_mesa_IndexMask(color->IndexMask);
_mesa_ColorMask((GLboolean) (color->ColorMask[0] != 0),
(GLboolean) (color->ColorMask[1] != 0),
@@ -785,8 +812,7 @@ _mesa_PopAttrib(void)
(GLboolean) (color->ColorMask[3] != 0));
_mesa_DrawBuffer(color->DrawBuffer);
_mesa_set_enable(ctx, GL_ALPHA_TEST, color->AlphaEnabled);
- _mesa_AlphaFunc(color->AlphaFunc,
- CHAN_TO_FLOAT(color->AlphaRef));
+ _mesa_AlphaFunc(color->AlphaFunc, color->AlphaRef);
_mesa_set_enable(ctx, GL_BLEND, color->BlendEnabled);
_mesa_BlendFuncSeparateEXT(color->BlendSrcRGB,
color->BlendDstRGB,
@@ -874,8 +900,8 @@ _mesa_PopAttrib(void)
_mesa_set_enable(ctx, GL_LIGHTING, light->Enabled);
/* per-light state */
- if (ctx->ModelView.flags & MAT_DIRTY_INVERSE)
- _math_matrix_analyse( &ctx->ModelView );
+ if (ctx->ModelviewMatrixStack.Top->flags & MAT_DIRTY_INVERSE)
+ _math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
for (i = 0; i < MAX_LIGHTS; i++) {
GLenum lgt = (GLenum) (GL_LIGHT0 + i);
@@ -885,9 +911,9 @@ _mesa_PopAttrib(void)
_mesa_Lightfv( lgt, GL_AMBIENT, l->Ambient );
_mesa_Lightfv( lgt, GL_DIFFUSE, l->Diffuse );
_mesa_Lightfv( lgt, GL_SPECULAR, l->Specular );
- TRANSFORM_POINT( tmp, ctx->ModelView.inv, l->EyePosition );
+ TRANSFORM_POINT( tmp, ctx->ModelviewMatrixStack.Top->inv, l->EyePosition );
_mesa_Lightfv( lgt, GL_POSITION, tmp );
- TRANSFORM_POINT( tmp, ctx->ModelView.m, l->EyeDirection );
+ TRANSFORM_POINT( tmp, ctx->ModelviewMatrixStack.Top->m, l->EyeDirection );
_mesa_Lightfv( lgt, GL_SPOT_DIRECTION, tmp );
_mesa_Lightfv( lgt, GL_SPOT_EXPONENT, &l->SpotExponent );
_mesa_Lightfv( lgt, GL_SPOT_CUTOFF, &l->SpotCutoff );
@@ -942,12 +968,26 @@ _mesa_PopAttrib(void)
point = (const struct gl_point_attrib *) attr->data;
_mesa_PointSize(point->Size);
_mesa_set_enable(ctx, GL_POINT_SMOOTH, point->SmoothFlag);
- _mesa_PointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT,
- point->Params);
- _mesa_PointParameterfEXT(GL_POINT_SIZE_MIN_EXT, point->MinSize);
- _mesa_PointParameterfEXT(GL_POINT_SIZE_MAX_EXT, point->MaxSize);
- _mesa_PointParameterfEXT(GL_POINT_FADE_THRESHOLD_SIZE_EXT,
- point->Threshold);
+ if (ctx->Extensions.EXT_point_parameters) {
+ _mesa_PointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT,
+ point->Params);
+ _mesa_PointParameterfEXT(GL_POINT_SIZE_MIN_EXT,
+ point->MinSize);
+ _mesa_PointParameterfEXT(GL_POINT_SIZE_MAX_EXT,
+ point->MaxSize);
+ _mesa_PointParameterfEXT(GL_POINT_FADE_THRESHOLD_SIZE_EXT,
+ point->Threshold);
+ }
+ if (ctx->Extensions.NV_point_sprite) {
+ GLuint u;
+ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
+ _mesa_TexEnvi(GL_POINT_SPRITE_NV, GL_COORD_REPLACE_NV,
+ (GLint) point->CoordReplace[u]);
+ }
+ _mesa_set_enable(ctx, GL_POINT_SPRITE_NV,point->PointSprite);
+ _mesa_PointParameteriNV(GL_POINT_SPRITE_R_MODE_NV,
+ ctx->Point.SpriteRMode);
+ }
}
break;
case GL_POLYGON_BIT:
@@ -988,15 +1028,17 @@ _mesa_PopAttrib(void)
break;
case GL_STENCIL_BUFFER_BIT:
{
+ const GLint face = 0; /* XXX stencil two side */
const struct gl_stencil_attrib *stencil;
stencil = (const struct gl_stencil_attrib *) attr->data;
_mesa_set_enable(ctx, GL_STENCIL_TEST, stencil->Enabled);
_mesa_ClearStencil(stencil->Clear);
- _mesa_StencilFunc(stencil->Function, stencil->Ref,
- stencil->ValueMask);
- _mesa_StencilMask(stencil->WriteMask);
- _mesa_StencilOp(stencil->FailFunc, stencil->ZFailFunc,
- stencil->ZPassFunc);
+ _mesa_StencilFunc(stencil->Function[face], stencil->Ref[face],
+ stencil->ValueMask[face]);
+ _mesa_StencilMask(stencil->WriteMask[face]);
+ _mesa_StencilOp(stencil->FailFunc[face],
+ stencil->ZFailFunc[face],
+ stencil->ZPassFunc[face]);
}
break;
case GL_TRANSFORM_BIT:
@@ -1006,30 +1048,30 @@ _mesa_PopAttrib(void)
xform = (const struct gl_transform_attrib *) attr->data;
_mesa_MatrixMode(xform->MatrixMode);
- if (ctx->ProjectionMatrix.flags & MAT_DIRTY)
- _math_matrix_analyse( &ctx->ProjectionMatrix );
+ if (ctx->ProjectionMatrixStack.Top->flags & MAT_DIRTY)
+ _math_matrix_analyse( ctx->ProjectionMatrixStack.Top );
/* restore clip planes */
for (i = 0; i < MAX_CLIP_PLANES; i++) {
+ const GLuint mask = 1 << 1;
const GLfloat *eyePlane = xform->EyeUserPlane[i];
COPY_4V(ctx->Transform.EyeUserPlane[i], eyePlane);
- if (xform->ClipEnabled[i]) {
- _mesa_transform_vector( ctx->Transform._ClipUserPlane[i],
- eyePlane,
- ctx->ProjectionMatrix.inv );
- _mesa_set_enable(ctx, GL_CLIP_PLANE0 + i, GL_TRUE );
+ if (xform->ClipPlanesEnabled & mask) {
+ _mesa_set_enable(ctx, GL_CLIP_PLANE0 + i, GL_TRUE);
}
else {
- _mesa_set_enable(ctx, GL_CLIP_PLANE0 + i, GL_FALSE );
+ _mesa_set_enable(ctx, GL_CLIP_PLANE0 + i, GL_FALSE);
}
if (ctx->Driver.ClipPlane)
ctx->Driver.ClipPlane( ctx, GL_CLIP_PLANE0 + i, eyePlane );
}
/* normalize/rescale */
- _mesa_set_enable(ctx, GL_NORMALIZE, ctx->Transform.Normalize);
- _mesa_set_enable(ctx, GL_RESCALE_NORMAL_EXT,
- ctx->Transform.RescaleNormals);
+ if (xform->Normalize != ctx->Transform.Normalize)
+ _mesa_set_enable(ctx, GL_NORMALIZE,ctx->Transform.Normalize);
+ if (xform->RescaleNormals != ctx->Transform.RescaleNormals)
+ _mesa_set_enable(ctx, GL_RESCALE_NORMAL_EXT,
+ ctx->Transform.RescaleNormals);
}
break;
case GL_TEXTURE_BIT:
diff --git a/xc/extras/Mesa/src/blend.c b/xc/extras/Mesa/src/blend.c
index d5bb107f6..e031851f9 100644
--- a/xc/extras/Mesa/src/blend.c
+++ b/xc/extras/Mesa/src/blend.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,9 +24,6 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "blend.h"
#include "colormac.h"
@@ -34,7 +31,6 @@
#include "enums.h"
#include "macros.h"
#include "mtypes.h"
-#endif
void
@@ -45,9 +41,9 @@ _mesa_BlendFunc( GLenum sfactor, GLenum dfactor )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
- fprintf(stderr, "glBlendFunc %s %s\n",
- _mesa_lookup_enum_by_nr(sfactor),
- _mesa_lookup_enum_by_nr(dfactor));
+ _mesa_debug(ctx, "glBlendFunc %s %s\n",
+ _mesa_lookup_enum_by_nr(sfactor),
+ _mesa_lookup_enum_by_nr(dfactor));
switch (sfactor) {
case GL_SRC_COLOR:
@@ -126,11 +122,11 @@ _mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB,
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
- fprintf(stderr, "glBlendFuncSeparate %s %s %s %s\n",
- _mesa_lookup_enum_by_nr(sfactorRGB),
- _mesa_lookup_enum_by_nr(dfactorRGB),
- _mesa_lookup_enum_by_nr(sfactorA),
- _mesa_lookup_enum_by_nr(dfactorA));
+ _mesa_debug(ctx, "glBlendFuncSeparate %s %s %s %s\n",
+ _mesa_lookup_enum_by_nr(sfactorRGB),
+ _mesa_lookup_enum_by_nr(dfactorRGB),
+ _mesa_lookup_enum_by_nr(sfactorA),
+ _mesa_lookup_enum_by_nr(dfactorA));
switch (sfactorRGB) {
case GL_SRC_COLOR:
@@ -267,8 +263,8 @@ _mesa_BlendEquation( GLenum mode )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
- fprintf(stderr, "glBlendEquation %s\n",
- _mesa_lookup_enum_by_nr(mode));
+ _mesa_debug(ctx, "glBlendEquation %s\n",
+ _mesa_lookup_enum_by_nr(mode));
switch (mode) {
case GL_FUNC_ADD_EXT:
@@ -345,7 +341,6 @@ void
_mesa_AlphaFunc( GLenum func, GLclampf ref )
{
GET_CURRENT_CONTEXT(ctx);
- GLchan cref;
ASSERT_OUTSIDE_BEGIN_END(ctx);
switch (func) {
@@ -357,18 +352,17 @@ _mesa_AlphaFunc( GLenum func, GLclampf ref )
case GL_NOTEQUAL:
case GL_GEQUAL:
case GL_ALWAYS:
- /* convert float alpha ref to GLchan type */
- UNCLAMPED_FLOAT_TO_CHAN(cref, ref);
+ ref = CLAMP(ref, 0.0F, 1.0F);
- if (ctx->Color.AlphaFunc == func && ctx->Color.AlphaRef == cref)
- return;
+ if (ctx->Color.AlphaFunc == func && ctx->Color.AlphaRef == ref)
+ return; /* no change */
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.AlphaFunc = func;
- ctx->Color.AlphaRef = cref;
+ ctx->Color.AlphaRef = ref;
if (ctx->Driver.AlphaFunc)
- ctx->Driver.AlphaFunc(ctx, func, cref);
+ ctx->Driver.AlphaFunc(ctx, func, ref);
return;
default:
@@ -444,7 +438,7 @@ _mesa_ColorMask( GLboolean red, GLboolean green,
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glColorMask %d %d %d %d\n", red, green, blue, alpha);
+ _mesa_debug(ctx, "glColorMask %d %d %d %d\n", red, green, blue, alpha);
/* Shouldn't have any information about channel depth in core mesa
* -- should probably store these as the native booleans:
diff --git a/xc/extras/Mesa/src/buffers.c b/xc/extras/Mesa/src/buffers.c
index c5a459d91..a6713c880 100644
--- a/xc/extras/Mesa/src/buffers.c
+++ b/xc/extras/Mesa/src/buffers.c
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -24,10 +24,8 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "accum.h"
#include "buffers.h"
#include "colormac.h"
@@ -35,11 +33,9 @@
#include "depth.h"
#include "enums.h"
#include "macros.h"
-#include "mem.h"
#include "stencil.h"
#include "state.h"
#include "mtypes.h"
-#endif
@@ -66,20 +62,20 @@ _mesa_ClearIndex( GLfloat c )
void
_mesa_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
{
- GLchan tmp[4];
+ GLfloat tmp[4];
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- UNCLAMPED_FLOAT_TO_CHAN(tmp[0], red);
- UNCLAMPED_FLOAT_TO_CHAN(tmp[1], green);
- UNCLAMPED_FLOAT_TO_CHAN(tmp[2], blue);
- UNCLAMPED_FLOAT_TO_CHAN(tmp[3], alpha);
+ tmp[0] = CLAMP(red, 0.0F, 1.0F);
+ tmp[1] = CLAMP(green, 0.0F, 1.0F);
+ tmp[2] = CLAMP(blue, 0.0F, 1.0F);
+ tmp[3] = CLAMP(alpha, 0.0F, 1.0F);
if (TEST_EQ_4V(tmp, ctx->Color.ClearColor))
- return;
+ return; /* no change */
FLUSH_VERTICES(ctx, _NEW_COLOR);
- COPY_CHAN4(ctx->Color.ClearColor, tmp);
+ COPY_4V(ctx->Color.ClearColor, tmp);
if (ctx->Visual.rgbMode && ctx->Driver.ClearColor) {
/* it's OK to call glClearColor in CI mode but it should be a NOP */
@@ -96,7 +92,16 @@ _mesa_Clear( GLbitfield mask )
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glClear 0x%x\n", mask);
+ _mesa_debug(ctx, "glClear 0x%x\n", mask);
+
+ if (mask & ~(GL_COLOR_BUFFER_BIT |
+ GL_DEPTH_BUFFER_BIT |
+ GL_STENCIL_BUFFER_BIT |
+ GL_ACCUM_BUFFER_BIT)) {
+ /* invalid bit set */
+ _mesa_error( ctx, GL_INVALID_VALUE, "glClear(mask)");
+ return;
+ }
if (ctx->NewState) {
_mesa_update_state( ctx ); /* update _Xmin, etc */
@@ -111,14 +116,14 @@ _mesa_Clear( GLbitfield mask )
/* don't clear depth buffer if depth writing disabled */
if (!ctx->Depth.Mask)
- CLEAR_BITS(mask, GL_DEPTH_BUFFER_BIT);
+ mask &= ~GL_DEPTH_BUFFER_BIT;
/* Build bitmask to send to driver Clear function */
ddMask = mask & (GL_DEPTH_BUFFER_BIT |
GL_STENCIL_BUFFER_BIT |
GL_ACCUM_BUFFER_BIT);
if (mask & GL_COLOR_BUFFER_BIT) {
- ddMask |= ctx->Color.DrawDestMask;
+ ddMask |= ctx->Color._DrawDestMask;
}
ASSERT(ctx->Driver.Clear);
@@ -134,51 +139,42 @@ _mesa_DrawBuffer( GLenum mode )
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* too complex... */
-
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glDrawBuffer %s\n", _mesa_lookup_enum_by_nr(mode));
+ _mesa_debug(ctx, "glDrawBuffer %s\n", _mesa_lookup_enum_by_nr(mode));
+ /*
+ * Do error checking and compute the _DrawDestMask bitfield.
+ */
switch (mode) {
- case GL_AUX0:
- case GL_AUX1:
- case GL_AUX2:
- case GL_AUX3:
- /* AUX buffers not implemented in Mesa at this time */
- _mesa_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
- return;
case GL_RIGHT:
if (!ctx->Visual.stereoMode) {
_mesa_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;}
if (ctx->Visual.doubleBufferMode)
- ctx->Color.DrawDestMask = FRONT_RIGHT_BIT | BACK_RIGHT_BIT;
+ ctx->Color._DrawDestMask = FRONT_RIGHT_BIT | BACK_RIGHT_BIT;
else
- ctx->Color.DrawDestMask = FRONT_RIGHT_BIT;
+ ctx->Color._DrawDestMask = FRONT_RIGHT_BIT;
break;
case GL_FRONT_RIGHT:
if (!ctx->Visual.stereoMode) {
_mesa_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;
}
- ctx->Color.DrawDestMask = FRONT_RIGHT_BIT;
+ ctx->Color._DrawDestMask = FRONT_RIGHT_BIT;
break;
case GL_BACK_RIGHT:
- if (!ctx->Visual.stereoMode) {
- _mesa_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
- return;
- }
- if (!ctx->Visual.doubleBufferMode) {
+ if (!ctx->Visual.stereoMode || !ctx->Visual.doubleBufferMode) {
_mesa_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;
}
- ctx->Color.DrawDestMask = BACK_RIGHT_BIT;
+ ctx->Color._DrawDestMask = BACK_RIGHT_BIT;
break;
case GL_BACK_LEFT:
if (!ctx->Visual.doubleBufferMode) {
_mesa_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;
}
- ctx->Color.DrawDestMask = BACK_LEFT_BIT;
+ ctx->Color._DrawDestMask = BACK_LEFT_BIT;
break;
case GL_FRONT_AND_BACK:
if (!ctx->Visual.doubleBufferMode) {
@@ -186,10 +182,10 @@ _mesa_DrawBuffer( GLenum mode )
return;
}
if (ctx->Visual.stereoMode)
- ctx->Color.DrawDestMask = FRONT_LEFT_BIT | BACK_LEFT_BIT
+ ctx->Color._DrawDestMask = FRONT_LEFT_BIT | BACK_LEFT_BIT
| FRONT_RIGHT_BIT | BACK_RIGHT_BIT;
else
- ctx->Color.DrawDestMask = FRONT_LEFT_BIT | BACK_LEFT_BIT;
+ ctx->Color._DrawDestMask = FRONT_LEFT_BIT | BACK_LEFT_BIT;
break;
case GL_BACK:
if (!ctx->Visual.doubleBufferMode) {
@@ -197,74 +193,81 @@ _mesa_DrawBuffer( GLenum mode )
return;
}
if (ctx->Visual.stereoMode)
- ctx->Color.DrawDestMask = BACK_LEFT_BIT | BACK_RIGHT_BIT;
+ ctx->Color._DrawDestMask = BACK_LEFT_BIT | BACK_RIGHT_BIT;
else
- ctx->Color.DrawDestMask = BACK_LEFT_BIT;
+ ctx->Color._DrawDestMask = BACK_LEFT_BIT;
break;
case GL_LEFT:
/* never an error */
if (ctx->Visual.doubleBufferMode)
- ctx->Color.DrawDestMask = FRONT_LEFT_BIT | BACK_LEFT_BIT;
+ ctx->Color._DrawDestMask = FRONT_LEFT_BIT | BACK_LEFT_BIT;
else
- ctx->Color.DrawDestMask = FRONT_LEFT_BIT;
+ ctx->Color._DrawDestMask = FRONT_LEFT_BIT;
break;
case GL_FRONT_LEFT:
/* never an error */
- ctx->Color.DrawDestMask = FRONT_LEFT_BIT;
+ ctx->Color._DrawDestMask = FRONT_LEFT_BIT;
break;
case GL_FRONT:
/* never an error */
if (ctx->Visual.stereoMode)
- ctx->Color.DrawDestMask = FRONT_LEFT_BIT | FRONT_RIGHT_BIT;
+ ctx->Color._DrawDestMask = FRONT_LEFT_BIT | FRONT_RIGHT_BIT;
else
- ctx->Color.DrawDestMask = FRONT_LEFT_BIT;
+ ctx->Color._DrawDestMask = FRONT_LEFT_BIT;
break;
case GL_NONE:
/* never an error */
- ctx->Color.DrawDestMask = 0;
+ ctx->Color._DrawDestMask = 0;
+ break;
+ case GL_AUX0:
+ if (ctx->Const.NumAuxBuffers >= 1) {
+ ctx->Color._DrawDestMask = AUX0_BIT;
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_AUX0)" );
+ return;
+ }
+ break;
+ case GL_AUX1:
+ if (ctx->Const.NumAuxBuffers >= 2) {
+ ctx->Color._DrawDestMask = AUX1_BIT;
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_AUX1)" );
+ return;
+ }
+ break;
+ case GL_AUX2:
+ if (ctx->Const.NumAuxBuffers >= 3) {
+ ctx->Color._DrawDestMask = AUX2_BIT;
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_AUX2)" );
+ return;
+ }
+ break;
+ case GL_AUX3:
+ if (ctx->Const.NumAuxBuffers >= 4) {
+ ctx->Color._DrawDestMask = AUX3_BIT;
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_AUX3)" );
+ return;
+ }
break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glDrawBuffer" );
return;
}
- /*
- * Make the dest buffer mode more precise if possible
- */
- if (mode == GL_LEFT && !ctx->Visual.doubleBufferMode)
- ctx->Color.DriverDrawBuffer = GL_FRONT_LEFT;
- else if (mode == GL_RIGHT && !ctx->Visual.doubleBufferMode)
- ctx->Color.DriverDrawBuffer = GL_FRONT_RIGHT;
- else if (mode == GL_FRONT && !ctx->Visual.stereoMode)
- ctx->Color.DriverDrawBuffer = GL_FRONT_LEFT;
- else if (mode == GL_BACK && !ctx->Visual.stereoMode)
- ctx->Color.DriverDrawBuffer = GL_BACK_LEFT;
- else
- ctx->Color.DriverDrawBuffer = mode;
-
- /*
- * Set current alpha buffer pointer
- */
- if (ctx->DrawBuffer->UseSoftwareAlphaBuffers) {
- if (ctx->Color.DriverDrawBuffer == GL_FRONT_LEFT)
- ctx->DrawBuffer->Alpha = ctx->DrawBuffer->FrontLeftAlpha;
- else if (ctx->Color.DriverDrawBuffer == GL_BACK_LEFT)
- ctx->DrawBuffer->Alpha = ctx->DrawBuffer->BackLeftAlpha;
- else if (ctx->Color.DriverDrawBuffer == GL_FRONT_RIGHT)
- ctx->DrawBuffer->Alpha = ctx->DrawBuffer->FrontRightAlpha;
- else if (ctx->Color.DriverDrawBuffer == GL_BACK_RIGHT)
- ctx->DrawBuffer->Alpha = ctx->DrawBuffer->BackRightAlpha;
- }
+ ctx->Color.DrawBuffer = mode;
+ ctx->NewState |= _NEW_COLOR;
/*
- * If we get here there can't have been an error. Now tell the
- * device driver about it.
+ * Call device driver function.
*/
- ASSERT(ctx->Driver.SetDrawBuffer);
- (*ctx->Driver.SetDrawBuffer)(ctx, ctx->Color.DriverDrawBuffer);
-
- ctx->Color.DrawBuffer = mode;
- ctx->NewState |= _NEW_COLOR;
+ if (ctx->Driver.DrawBuffer)
+ (*ctx->Driver.DrawBuffer)(ctx, mode);
}
@@ -276,21 +279,17 @@ _mesa_ReadBuffer( GLenum mode )
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(mode));
+ _mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(mode));
+ /*
+ * Do error checking and compute ctx->Pixel._ReadSrcMask.
+ */
switch (mode) {
- case GL_AUX0:
- case GL_AUX1:
- case GL_AUX2:
- case GL_AUX3:
- /* AUX buffers not implemented in Mesa at this time */
- _mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer" );
- return;
case GL_LEFT:
case GL_FRONT:
case GL_FRONT_LEFT:
/* Front-Left buffer, always exists */
- ctx->Pixel.DriverReadBuffer = GL_FRONT_LEFT;
+ ctx->Pixel._ReadSrcMask = FRONT_LEFT_BIT;
break;
case GL_BACK:
case GL_BACK_LEFT:
@@ -299,7 +298,7 @@ _mesa_ReadBuffer( GLenum mode )
_mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer" );
return;
}
- ctx->Pixel.DriverReadBuffer = GL_BACK_LEFT;
+ ctx->Pixel._ReadSrcMask = BACK_LEFT_BIT;
break;
case GL_FRONT_RIGHT:
case GL_RIGHT:
@@ -307,14 +306,50 @@ _mesa_ReadBuffer( GLenum mode )
_mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer" );
return;
}
- ctx->Pixel.DriverReadBuffer = GL_FRONT_RIGHT;
+ ctx->Pixel._ReadSrcMask = FRONT_RIGHT_BIT;
break;
case GL_BACK_RIGHT:
if (!ctx->Visual.stereoMode || !ctx->Visual.doubleBufferMode) {
_mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer" );
return;
}
- ctx->Pixel.DriverReadBuffer = GL_BACK_RIGHT;
+ ctx->Pixel._ReadSrcMask = BACK_RIGHT_BIT;
+ break;
+ case GL_AUX0:
+ if (ctx->Const.NumAuxBuffers >= 1) {
+ ctx->Pixel._ReadSrcMask = AUX0_BIT;
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer(GL_AUX0)" );
+ return;
+ }
+ break;
+ case GL_AUX1:
+ if (ctx->Const.NumAuxBuffers >= 2) {
+ ctx->Pixel._ReadSrcMask = AUX1_BIT;
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer(GL_AUX1)" );
+ return;
+ }
+ break;
+ case GL_AUX2:
+ if (ctx->Const.NumAuxBuffers >= 3) {
+ ctx->Pixel._ReadSrcMask = AUX2_BIT;
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer(GL_AUX2)" );
+ return;
+ }
+ break;
+ case GL_AUX3:
+ if (ctx->Const.NumAuxBuffers >= 4) {
+ ctx->Pixel._ReadSrcMask = AUX3_BIT;
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer(GL_AUX3)" );
+ return;
+ }
break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glReadBuffer" );
@@ -323,6 +358,12 @@ _mesa_ReadBuffer( GLenum mode )
ctx->Pixel.ReadBuffer = mode;
ctx->NewState |= _NEW_PIXEL;
+
+ /*
+ * Call device driver function.
+ */
+ if (ctx->Driver.ReadBuffer)
+ (*ctx->Driver.ReadBuffer)(ctx, mode);
}
@@ -338,7 +379,7 @@ _mesa_ResizeBuffersMESA( void )
GLcontext *ctx = _mesa_get_current_context();
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glResizeBuffersMESA\n");
+ _mesa_debug(ctx, "glResizeBuffersMESA\n");
if (ctx) {
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx );
@@ -394,7 +435,7 @@ _mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
}
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glScissor %d %d %d %d\n", x, y, width, height);
+ _mesa_debug(ctx, "glScissor %d %d %d %d\n", x, y, width, height);
if (x == ctx->Scissor.X &&
y == ctx->Scissor.Y &&
diff --git a/xc/extras/Mesa/src/clip.c b/xc/extras/Mesa/src/clip.c
index bde8c2072..07553683d 100644
--- a/xc/extras/Mesa/src/clip.c
+++ b/xc/extras/Mesa/src/clip.c
@@ -24,9 +24,6 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "clip.h"
#include "context.h"
@@ -36,7 +33,6 @@
#include "math/m_xform.h"
#include "math/m_matrix.h"
-#endif
@@ -73,10 +69,11 @@ _mesa_ClipPlane( GLenum plane, const GLdouble *eq )
* clipping now takes place. The clip-space equations are recalculated
* whenever the projection matrix changes.
*/
- if (ctx->ModelView.flags & MAT_DIRTY)
- _math_matrix_analyse( &ctx->ModelView );
+ if (ctx->ModelviewMatrixStack.Top->flags & MAT_DIRTY)
+ _math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
- _mesa_transform_vector( equation, equation, ctx->ModelView.inv );
+ _mesa_transform_vector( equation, equation,
+ ctx->ModelviewMatrixStack.Top->inv );
if (TEST_EQ_4V(ctx->Transform.EyeUserPlane[p], equation))
return;
@@ -88,13 +85,13 @@ _mesa_ClipPlane( GLenum plane, const GLdouble *eq )
* matrix, and is recalculated on changes to the projection matrix by
* code in _mesa_update_state().
*/
- if (ctx->Transform.ClipEnabled[p]) {
- if (ctx->ProjectionMatrix.flags & MAT_DIRTY)
- _math_matrix_analyse( &ctx->ProjectionMatrix );
+ if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
+ if (ctx->ProjectionMatrixStack.Top->flags & MAT_DIRTY)
+ _math_matrix_analyse( ctx->ProjectionMatrixStack.Top );
_mesa_transform_vector( ctx->Transform._ClipUserPlane[p],
ctx->Transform.EyeUserPlane[p],
- ctx->ProjectionMatrix.inv );
+ ctx->ProjectionMatrixStack.Top->inv );
}
if (ctx->Driver.ClipPlane)
diff --git a/xc/extras/Mesa/src/colormac.h b/xc/extras/Mesa/src/colormac.h
index ddfc2d22b..eb2043d3f 100644
--- a/xc/extras/Mesa/src/colormac.h
+++ b/xc/extras/Mesa/src/colormac.h
@@ -1,10 +1,9 @@
-/* $Id: colormac.h,v 1.1.1.1 2002/10/22 13:05:43 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -74,10 +73,8 @@
#define CHAN_TO_UBYTE(c) ((c) >> 8)
#define CHAN_TO_FLOAT(c) ((GLfloat) ((c) * (1.0 / CHAN_MAXF)))
-#define CLAMPED_FLOAT_TO_CHAN(c, f) \
- c = ((GLchan) IROUND((f) * CHAN_MAXF))
-#define UNCLAMPED_FLOAT_TO_CHAN(c, f) \
- c = ( (GLchan) IROUND( CLAMP(f, 0.0, 1.0) * CHAN_MAXF) )
+#define CLAMPED_FLOAT_TO_CHAN(c, f) CLAMPED_FLOAT_TO_USHORT(c, f)
+#define UNCLAMPED_FLOAT_TO_CHAN(c, f) UNCLAMPED_FLOAT_TO_USHORT(c, f)
#define COPY_CHAN4(DST, SRC) COPY_4V(DST, SRC)
diff --git a/xc/extras/Mesa/src/colortab.c b/xc/extras/Mesa/src/colortab.c
index 9ca9576e9..0a0392cef 100644
--- a/xc/extras/Mesa/src/colortab.c
+++ b/xc/extras/Mesa/src/colortab.c
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -24,20 +24,14 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "colortab.h"
#include "context.h"
#include "image.h"
#include "macros.h"
-#include "mem.h"
#include "mmath.h"
#include "state.h"
-#include "swrast/s_span.h" /* XXX SWRAST hack */
-#endif
-
/*
@@ -321,9 +315,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
table->Format = (GLenum) 0;
}
else {
- char msg[100];
- sprintf(msg, "glColorTable(width=%d)", width);
- _mesa_error(ctx, GL_INVALID_VALUE, msg);
+ _mesa_error(ctx, GL_INVALID_VALUE, "glColorTable(width=%d)", width);
}
return;
}
diff --git a/xc/extras/Mesa/src/config.h b/xc/extras/Mesa/src/config.h
index f65114aca..e1b53e93d 100644
--- a/xc/extras/Mesa/src/config.h
+++ b/xc/extras/Mesa/src/config.h
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.4
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -54,6 +54,10 @@
/* Maximum color matrix stack depth: */
#define MAX_COLOR_STACK_DEPTH 4
+/* Vertex program matrix stacks: */
+#define MAX_PROGRAM_MATRICES 8
+#define MAX_PROGRAM_STACK_DEPTH 4
+
/* Maximum attribute stack depth: */
#define MAX_ATTRIB_STACK_DEPTH 16
@@ -87,7 +91,7 @@
/* Min and Max point sizes and granularity */
#define MIN_POINT_SIZE 1.0
-#define MAX_POINT_SIZE 10.0
+#define MAX_POINT_SIZE 20.0
#define POINT_SIZE_GRANULARITY 0.1
/* Min and Max line widths and granularity */
@@ -104,14 +108,14 @@
/* Number of 3D texture mipmap levels */
#define MAX_3D_TEXTURE_LEVELS 8
-/* Number of cube texture mipmap levels */
+/* Number of cube texture mipmap levels - GL_ARB_texture_cube_map */
#define MAX_CUBE_TEXTURE_LEVELS 12
/* Maximum rectangular texture size - GL_NV_texture_rectangle */
#define MAX_TEXTURE_RECT_SIZE 2048
/* Number of texture units - GL_ARB_multitexture */
-#define MAX_TEXTURE_UNITS 6
+#define MAX_TEXTURE_UNITS 8
/* Maximum viewport/image size: */
#define MAX_WIDTH 2048
@@ -192,4 +196,11 @@
#define ACOMP 3
+
+/*
+ * Enable/disable features (blocks of code) by setting FEATURE_xyz to 0 or 1.
+ */
+#define FEATURE_NV_vertex_program 0
+
+
#endif /* CONFIG_H */
diff --git a/xc/extras/Mesa/src/context.c b/xc/extras/Mesa/src/context.c
index 3978fbe63..82037a2f6 100644
--- a/xc/extras/Mesa/src/context.c
+++ b/xc/extras/Mesa/src/context.c
@@ -1,8 +1,7 @@
-/* $Id: context.c,v 1.1.1.8 2002/10/22 13:05:37 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.4
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -25,10 +24,8 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "buffers.h"
#include "clip.h"
#include "colortab.h"
@@ -41,10 +38,8 @@
#include "get.h"
#include "glthread.h"
#include "hash.h"
-#include "imports.h"
#include "light.h"
#include "macros.h"
-#include "mem.h"
#include "mmath.h"
#include "simple_list.h"
#include "state.h"
@@ -53,14 +48,15 @@
#include "texstate.h"
#include "mtypes.h"
#include "varray.h"
+#if FEATURE_NV_vertex_program
+#include "vpstate.h"
+#endif
#include "vtxfmt.h"
-
#include "math/m_translate.h"
-#include "math/m_vertices.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
#include "math/mathmod.h"
-#endif
+
#if defined(MESA_TRACE)
#include "Trace/tr_context.h"
@@ -79,20 +75,157 @@ int MESA_VERBOSE = 0;
int MESA_DEBUG_FLAGS = 0;
#endif
+
+static void
+free_shared_state( GLcontext *ctx, struct gl_shared_state *ss );
+
+
/**********************************************************************/
/***** OpenGL SI-style interface (new in Mesa 3.5) *****/
/**********************************************************************/
-static GLboolean
-_mesa_DestroyContext(__GLcontext *gc)
+/* Called by window system/device driver (via gc->exports.destroyCurrent())
+ * when the rendering context is to be destroyed.
+ */
+GLboolean
+_mesa_destroyContext(__GLcontext *gc)
{
if (gc) {
_mesa_free_context_data(gc);
- (*gc->imports.free)(gc, gc);
+ _mesa_free(gc);
+ }
+ return GL_TRUE;
+}
+
+/* Called by window system/device driver (via gc->exports.loseCurrent())
+ * when the rendering context is made non-current.
+ */
+GLboolean
+_mesa_loseCurrent(__GLcontext *gc)
+{
+ /* XXX unbind context from thread */
+ return GL_TRUE;
+}
+
+/* Called by window system/device driver (via gc->exports.makeCurrent())
+ * when the rendering context is made current.
+ */
+GLboolean
+_mesa_makeCurrent(__GLcontext *gc)
+{
+ /* XXX bind context to thread */
+ return GL_TRUE;
+}
+
+/* Called by window system/device driver - yadda, yadda, yadda.
+ * See above comments.
+ */
+GLboolean
+_mesa_shareContext(__GLcontext *gc, __GLcontext *gcShare)
+{
+ if (gc && gcShare && gc->Shared && gcShare->Shared) {
+ gc->Shared->RefCount--;
+ if (gc->Shared->RefCount == 0) {
+ free_shared_state(gc, gc->Shared);
+ }
+ gc->Shared = gcShare->Shared;
+ gc->Shared->RefCount++;
+ return GL_TRUE;
+ }
+ else {
+ return GL_FALSE;
+ }
+}
+
+GLboolean
+_mesa_copyContext(__GLcontext *dst, const __GLcontext *src, GLuint mask)
+{
+ if (dst && src) {
+ _mesa_copy_context( src, dst, mask );
+ return GL_TRUE;
+ }
+ else {
+ return GL_FALSE;
}
+}
+
+GLboolean
+_mesa_forceCurrent(__GLcontext *gc)
+{
return GL_TRUE;
}
+GLboolean
+_mesa_notifyResize(__GLcontext *gc)
+{
+ GLint x, y;
+ GLuint width, height;
+ __GLdrawablePrivate *d = gc->imports.getDrawablePrivate(gc);
+ if (!d || !d->getDrawableSize)
+ return GL_FALSE;
+ d->getDrawableSize( d, &x, &y, &width, &height );
+ /* update viewport, resize software buffers, etc. */
+ return GL_TRUE;
+}
+
+void
+_mesa_notifyDestroy(__GLcontext *gc)
+{
+ /* Called when the context's window/buffer is going to be destroyed. */
+ /* Unbind from it. */
+}
+
+/* Called by window system just before swapping buffers.
+ * We have to finish any pending rendering.
+ */
+void
+_mesa_notifySwapBuffers(__GLcontext *gc)
+{
+ FLUSH_VERTICES( gc, 0 );
+}
+
+struct __GLdispatchStateRec *
+_mesa_dispatchExec(__GLcontext *gc)
+{
+ return NULL;
+}
+
+void
+_mesa_beginDispatchOverride(__GLcontext *gc)
+{
+}
+
+void
+_mesa_endDispatchOverride(__GLcontext *gc)
+{
+}
+
+/* Setup the exports. The window system will call these functions
+ * when it needs Mesa to do something.
+ * NOTE: Device drivers should override these functions! For example,
+ * the Xlib driver should plug in the XMesa*-style functions into this
+ * structure. The XMesa-style functions should then call the _mesa_*
+ * version of these functions. This is an approximation to OO design
+ * (inheritance and virtual functions).
+ */
+static void
+_mesa_init_default_exports(__GLexports *exports)
+{
+ exports->destroyContext = _mesa_destroyContext;
+ exports->loseCurrent = _mesa_loseCurrent;
+ exports->makeCurrent = _mesa_makeCurrent;
+ exports->shareContext = _mesa_shareContext;
+ exports->copyContext = _mesa_copyContext;
+ exports->forceCurrent = _mesa_forceCurrent;
+ exports->notifyResize = _mesa_notifyResize;
+ exports->notifyDestroy = _mesa_notifyDestroy;
+ exports->notifySwapBuffers = _mesa_notifySwapBuffers;
+ exports->dispatchExec = _mesa_dispatchExec;
+ exports->beginDispatchOverride = _mesa_beginDispatchOverride;
+ exports->endDispatchOverride = _mesa_endDispatchOverride;
+}
+
+
/* exported OpenGL SI interface */
__GLcontext *
@@ -100,34 +233,13 @@ __glCoreCreateContext(__GLimports *imports, __GLcontextModes *modes)
{
GLcontext *ctx;
- ctx = (GLcontext *) (*imports->calloc)(0, 1, sizeof(GLcontext));
+ ctx = (GLcontext *) (*imports->calloc)(NULL, 1, sizeof(GLcontext));
if (ctx == NULL) {
return NULL;
}
- ctx->Driver.CurrentExecPrimitive=0;
- ctx->imports = *imports;
- _mesa_initialize_visual(&ctx->Visual,
- modes->rgbMode,
- modes->doubleBufferMode,
- modes->stereoMode,
- modes->redBits,
- modes->greenBits,
- modes->blueBits,
- modes->alphaBits,
- modes->indexBits,
- modes->depthBits,
- modes->stencilBits,
- modes->accumRedBits,
- modes->accumGreenBits,
- modes->accumBlueBits,
- modes->accumAlphaBits,
- 0);
-
- /* KW: was imports->wscx */
- _mesa_initialize_context(ctx, &ctx->Visual, NULL, imports->other, GL_FALSE);
-
- ctx->exports.destroyContext = _mesa_DestroyContext;
+ _mesa_initialize_context(ctx, modes, NULL, imports, GL_FALSE);
+ ctx->imports = *imports;
return ctx;
}
@@ -148,12 +260,6 @@ __glCoreNopDispatch(void)
/**********************************************************************/
-/***** Context and Thread management *****/
-/**********************************************************************/
-
-
-
-/**********************************************************************/
/***** GL Visual allocation/destruction *****/
/**********************************************************************/
@@ -264,6 +370,7 @@ _mesa_initialize_visual( GLvisual *vis,
vis->rgbMode = rgbFlag;
vis->doubleBufferMode = dbFlag;
vis->stereoMode = stereoFlag;
+
vis->redBits = redBits;
vis->greenBits = greenBits;
vis->blueBits = blueBits;
@@ -277,6 +384,14 @@ _mesa_initialize_visual( GLvisual *vis,
vis->accumAlphaBits = (accumAlphaBits > 0) ? (8 * sizeof(GLaccum)) : 0;
vis->stencilBits = (stencilBits > 0) ? (8 * sizeof(GLstencil)) : 0;
+ vis->haveAccumBuffer = accumRedBits > 0;
+ vis->haveDepthBuffer = depthBits > 0;
+ vis->haveStencilBuffer = stencilBits > 0;
+
+ vis->numAuxBuffers = 0;
+ vis->level = 0;
+ vis->pixmapMode = 0;
+
return GL_TRUE;
}
@@ -337,7 +452,7 @@ _mesa_initialize_framebuffer( GLframebuffer *buffer,
assert(buffer);
assert(visual);
- BZERO(buffer, sizeof(GLframebuffer));
+ _mesa_bzero(buffer, sizeof(GLframebuffer));
/* sanity checks */
if (softwareDepth ) {
@@ -431,7 +546,7 @@ _glthread_DECLARE_STATIC_MUTEX(OneTimeLock);
* This function just calls all the various one-time-init functions in Mesa.
*/
static void
-one_time_init( void )
+one_time_init( GLcontext *ctx )
{
static GLboolean alreadyCalled = GL_FALSE;
_glthread_LOCK_MUTEX(OneTimeLock);
@@ -452,15 +567,22 @@ one_time_init( void )
#ifdef USE_SPARC_ASM
_mesa_init_sparc_glapi_relocs();
#endif
- if (getenv("MESA_DEBUG")) {
+ if (_mesa_getenv("MESA_DEBUG")) {
_glapi_noop_enable_warnings(GL_TRUE);
+#ifndef GLX_DIRECT_RENDERING
+ /* libGL from before 2002/06/28 don't have this function. Someday,
+ * when newer libGL libs are common, remove the #ifdef test. This
+ * only serves to print warnings when calling undefined GL functions.
+ */
+ _glapi_set_warning_func( (_glapi_warning_func) _mesa_warning );
+#endif
}
else {
_glapi_noop_enable_warnings(GL_FALSE);
}
#if defined(DEBUG) && defined(__DATE__) && defined(__TIME__)
- fprintf(stderr, "Mesa DEBUG build %s %s\n", __DATE__, __TIME__);
+ _mesa_debug(ctx, "Mesa DEBUG build %s %s\n", __DATE__, __TIME__);
#endif
alreadyCalled = GL_TRUE;
@@ -469,6 +591,36 @@ one_time_init( void )
}
+static void
+init_matrix_stack( struct matrix_stack *stack,
+ GLuint maxDepth, GLuint dirtyFlag )
+{
+ GLuint i;
+
+ stack->Depth = 0;
+ stack->MaxDepth = maxDepth;
+ stack->DirtyFlag = dirtyFlag;
+ /* The stack */
+ stack->Stack = (GLmatrix *) CALLOC(maxDepth * sizeof(GLmatrix));
+ for (i = 0; i < maxDepth; i++) {
+ _math_matrix_ctr(&stack->Stack[i]);
+ _math_matrix_alloc_inv(&stack->Stack[i]);
+ }
+ stack->Top = stack->Stack;
+}
+
+
+static void
+free_matrix_stack( struct matrix_stack *stack )
+{
+ GLuint i;
+ for (i = 0; i < stack->MaxDepth; i++) {
+ _math_matrix_dtr(&stack->Stack[i]);
+ }
+ FREE(stack->Stack);
+ stack->Stack = stack->Top = NULL;
+}
+
/*
* Allocate and initialize a shared context state structure.
@@ -487,6 +639,9 @@ alloc_shared_state( void )
ss->DisplayList = _mesa_NewHashTable();
ss->TexObjects = _mesa_NewHashTable();
+#if FEATURE_NV_vertex_program
+ ss->VertexPrograms = _mesa_NewHashTable();
+#endif
/* Default Texture objects */
outOfMemory = GL_FALSE;
@@ -518,12 +673,18 @@ alloc_shared_state( void )
outOfMemory = GL_TRUE;
}
- if (!ss->DisplayList || !ss->TexObjects || outOfMemory) {
+ if (!ss->DisplayList || !ss->TexObjects
+#if FEATURE_NV_vertex_program
+ || !ss->VertexPrograms
+#endif
+ || outOfMemory) {
/* Ran out of memory at some point. Free everything and return NULL */
if (ss->DisplayList)
_mesa_DeleteHashTable(ss->DisplayList);
if (ss->TexObjects)
_mesa_DeleteHashTable(ss->TexObjects);
+ if (ss->VertexPrograms)
+ _mesa_DeleteHashTable(ss->VertexPrograms);
if (ss->Default1D)
_mesa_free_texture_object(ss, ss->Default1D);
if (ss->Default2D)
@@ -570,6 +731,22 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
}
_mesa_DeleteHashTable(ss->TexObjects);
+#if FEATURE_NV_vertex_program
+ /* Free vertex programs */
+ while (1) {
+ GLuint prog = _mesa_HashFirstEntry(ss->VertexPrograms);
+ if (prog) {
+ _mesa_delete_program(ctx, prog);
+ }
+ else {
+ break;
+ }
+ }
+ _mesa_DeleteHashTable(ss->VertexPrograms);
+#endif
+
+ _glthread_DESTROY_MUTEX(ss->Mutex);
+
FREE(ss);
}
@@ -727,7 +904,7 @@ init_2d_map( struct gl_2d_map *map, int n, const float *initial )
static void
init_attrib_groups( GLcontext *ctx )
{
- GLuint i, j;
+ GLuint i;
assert(ctx);
@@ -758,50 +935,27 @@ init_attrib_groups( GLcontext *ctx )
ctx->Const.MaxColorTableSize = MAX_COLOR_TABLE_SIZE;
ctx->Const.MaxConvolutionWidth = MAX_CONVOLUTION_WIDTH;
ctx->Const.MaxConvolutionHeight = MAX_CONVOLUTION_HEIGHT;
- ctx->Const.NumCompressedTextureFormats = 0;
ctx->Const.MaxClipPlanes = MAX_CLIP_PLANES;
ctx->Const.MaxLights = MAX_LIGHTS;
- /* Modelview matrix */
- _math_matrix_ctr( &ctx->ModelView );
- _math_matrix_alloc_inv( &ctx->ModelView );
-
- ctx->ModelViewStackDepth = 0;
- for (i = 0; i < MAX_MODELVIEW_STACK_DEPTH - 1; i++) {
- _math_matrix_ctr( &ctx->ModelViewStack[i] );
- _math_matrix_alloc_inv( &ctx->ModelViewStack[i] );
- }
-
- /* Projection matrix - need inv for user clipping in clip space*/
- _math_matrix_ctr( &ctx->ProjectionMatrix );
- _math_matrix_alloc_inv( &ctx->ProjectionMatrix );
-
- ctx->ProjectionStackDepth = 0;
- for (i = 0; i < MAX_PROJECTION_STACK_DEPTH - 1; i++) {
- _math_matrix_ctr( &ctx->ProjectionStack[i] );
- _math_matrix_alloc_inv( &ctx->ProjectionStack[i] );
- }
-
- /* Derived ModelProject matrix */
+ /* Initialize matrix stacks */
+ init_matrix_stack(&ctx->ModelviewMatrixStack, MAX_MODELVIEW_STACK_DEPTH,
+ _NEW_MODELVIEW);
+ init_matrix_stack(&ctx->ProjectionMatrixStack, MAX_PROJECTION_STACK_DEPTH,
+ _NEW_PROJECTION);
+ init_matrix_stack(&ctx->ColorMatrixStack, MAX_COLOR_STACK_DEPTH,
+ _NEW_COLOR_MATRIX);
+ for (i = 0; i < MAX_TEXTURE_UNITS; i++)
+ init_matrix_stack(&ctx->TextureMatrixStack[i], MAX_TEXTURE_STACK_DEPTH,
+ _NEW_TEXTURE_MATRIX);
+ for (i = 0; i < MAX_PROGRAM_MATRICES; i++)
+ init_matrix_stack(&ctx->ProgramMatrixStack[i], MAX_PROGRAM_STACK_DEPTH,
+ _NEW_TRACK_MATRIX);
+ ctx->CurrentStack = &ctx->ModelviewMatrixStack;
+
+ /* Init combined Modelview*Projection matrix */
_math_matrix_ctr( &ctx->_ModelProjectMatrix );
- /* Texture matrix */
- for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
- _math_matrix_ctr( &ctx->TextureMatrix[i] );
- ctx->TextureStackDepth[i] = 0;
- for (j = 0; j < MAX_TEXTURE_STACK_DEPTH - 1; j++) {
- _math_matrix_ctr( &ctx->TextureStack[i][j] );
- ctx->TextureStack[i][j].inv = 0;
- }
- }
-
- /* Color matrix */
- _math_matrix_ctr(&ctx->ColorMatrix);
- ctx->ColorStackDepth = 0;
- for (j = 0; j < MAX_COLOR_STACK_DEPTH - 1; j++) {
- _math_matrix_ctr(&ctx->ColorStack[j]);
- }
-
/* Accumulate buffer group */
ASSIGN_4V( ctx->Accum.ClearColor, 0.0, 0.0, 0.0, 0.0 );
@@ -830,20 +984,23 @@ init_attrib_groups( GLcontext *ctx )
ctx->Color.DitherFlag = GL_TRUE;
/* Current group */
- ASSIGN_4V( ctx->Current.Color, 1.0, 1.0, 1.0, 1.0 );
+ ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_WEIGHT], 0.0, 0.0, 0.0, 0.0 );
+ ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_NORMAL], 0.0, 0.0, 1.0, 0.0 );
+ ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR0], 1.0, 1.0, 1.0, 1.0 );
+ ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR1], 0.0, 0.0, 0.0, 0.0 );
+ ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_FOG], 0.0, 0.0, 0.0, 0.0 );
+ for (i = 0; i < MAX_TEXTURE_UNITS; i++)
+ ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_TEX0 + i], 0.0, 0.0, 0.0, 1.0 );
ctx->Current.Index = 1;
- for (i=0; i<MAX_TEXTURE_UNITS; i++)
- ASSIGN_4V( ctx->Current.Texcoord[i], 0.0, 0.0, 0.0, 1.0 );
+ ctx->Current.EdgeFlag = GL_TRUE;
+
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 );
ctx->Current.RasterIndex = 1;
for (i=0; i<MAX_TEXTURE_UNITS; i++)
- ASSIGN_4V( ctx->Current.RasterMultiTexCoord[i], 0.0, 0.0, 0.0, 1.0 );
- ctx->Current.RasterTexCoord = ctx->Current.RasterMultiTexCoord[0];
+ ASSIGN_4V( ctx->Current.RasterTexCoords[i], 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterPosValid = GL_TRUE;
- ctx->Current.EdgeFlag = GL_TRUE;
- ASSIGN_3V( ctx->Current.Normal, 0.0, 0.0, 1.0 );
/* Depth buffer group */
@@ -863,6 +1020,7 @@ init_attrib_groups( GLcontext *ctx )
ctx->Eval.Map1TextureCoord4 = GL_FALSE;
ctx->Eval.Map1Vertex3 = GL_FALSE;
ctx->Eval.Map1Vertex4 = GL_FALSE;
+ MEMSET(ctx->Eval.Map1Attrib, 0, sizeof(ctx->Eval.Map1Attrib));
ctx->Eval.Map2Color4 = GL_FALSE;
ctx->Eval.Map2Index = GL_FALSE;
ctx->Eval.Map2Normal = GL_FALSE;
@@ -872,6 +1030,7 @@ init_attrib_groups( GLcontext *ctx )
ctx->Eval.Map2TextureCoord4 = GL_FALSE;
ctx->Eval.Map2Vertex3 = GL_FALSE;
ctx->Eval.Map2Vertex4 = GL_FALSE;
+ MEMSET(ctx->Eval.Map2Attrib, 0, sizeof(ctx->Eval.Map2Attrib));
ctx->Eval.AutoNormal = GL_FALSE;
ctx->Eval.MapGrid1un = 1;
ctx->Eval.MapGrid1u1 = 0.0;
@@ -890,6 +1049,7 @@ init_attrib_groups( GLcontext *ctx )
static GLfloat index[1] = { 1.0 };
static GLfloat color[4] = { 1.0, 1.0, 1.0, 1.0 };
static GLfloat texcoord[4] = { 0.0, 0.0, 0.0, 1.0 };
+ static GLfloat attrib[4] = { 0.0, 0.0, 0.0, 1.0 };
init_1d_map( &ctx->EvalMap.Map1Vertex3, 3, vertex );
init_1d_map( &ctx->EvalMap.Map1Vertex4, 4, vertex );
@@ -900,6 +1060,8 @@ init_attrib_groups( GLcontext *ctx )
init_1d_map( &ctx->EvalMap.Map1Texture2, 2, texcoord );
init_1d_map( &ctx->EvalMap.Map1Texture3, 3, texcoord );
init_1d_map( &ctx->EvalMap.Map1Texture4, 4, texcoord );
+ for (i = 0; i < 16; i++)
+ init_1d_map( ctx->EvalMap.Map1Attrib + i, 4, attrib );
init_2d_map( &ctx->EvalMap.Map2Vertex3, 3, vertex );
init_2d_map( &ctx->EvalMap.Map2Vertex4, 4, vertex );
@@ -910,6 +1072,8 @@ init_attrib_groups( GLcontext *ctx )
init_2d_map( &ctx->EvalMap.Map2Texture2, 2, texcoord );
init_2d_map( &ctx->EvalMap.Map2Texture3, 3, texcoord );
init_2d_map( &ctx->EvalMap.Map2Texture4, 4, texcoord );
+ for (i = 0; i < 16; i++)
+ init_2d_map( ctx->EvalMap.Map2Attrib + i, 4, attrib );
}
/* Fog group */
@@ -1094,7 +1258,11 @@ init_attrib_groups( GLcontext *ctx )
ctx->Point.MinSize = 0.0;
ctx->Point.MaxSize = ctx->Const.MaxPointSize;
ctx->Point.Threshold = 1.0;
- ctx->Point.SpriteMode = GL_FALSE; /* GL_MESA_sprite_point */
+ ctx->Point.PointSprite = GL_FALSE; /* GL_NV_point_sprite */
+ ctx->Point.SpriteRMode = GL_ZERO; /* GL_NV_point_sprite */
+ for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
+ ctx->Point.CoordReplace[i] = GL_FALSE; /* GL_NV_point_sprite */
+ }
/* Polygon group */
ctx->Polygon.CullFlag = GL_FALSE;
@@ -1107,7 +1275,6 @@ init_attrib_groups( GLcontext *ctx )
ctx->Polygon.StippleFlag = GL_FALSE;
ctx->Polygon.OffsetFactor = 0.0F;
ctx->Polygon.OffsetUnits = 0.0F;
- ctx->Polygon.OffsetMRD = 0.0F;
ctx->Polygon.OffsetPoint = GL_FALSE;
ctx->Polygon.OffsetLine = GL_FALSE;
ctx->Polygon.OffsetFill = GL_FALSE;
@@ -1124,18 +1291,27 @@ init_attrib_groups( GLcontext *ctx )
/* Stencil group */
ctx->Stencil.Enabled = GL_FALSE;
- ctx->Stencil.Function = GL_ALWAYS;
- ctx->Stencil.FailFunc = GL_KEEP;
- ctx->Stencil.ZPassFunc = GL_KEEP;
- ctx->Stencil.ZFailFunc = GL_KEEP;
- ctx->Stencil.Ref = 0;
- ctx->Stencil.ValueMask = STENCIL_MAX;
+ ctx->Stencil.TestTwoSide = GL_FALSE;
+ ctx->Stencil.ActiveFace = 0; /* 0 = GL_FRONT, 1 = GL_BACK */
+ ctx->Stencil.Function[0] = GL_ALWAYS;
+ ctx->Stencil.Function[1] = GL_ALWAYS;
+ ctx->Stencil.FailFunc[0] = GL_KEEP;
+ ctx->Stencil.FailFunc[1] = GL_KEEP;
+ ctx->Stencil.ZPassFunc[0] = GL_KEEP;
+ ctx->Stencil.ZPassFunc[1] = GL_KEEP;
+ ctx->Stencil.ZFailFunc[0] = GL_KEEP;
+ ctx->Stencil.ZFailFunc[1] = GL_KEEP;
+ ctx->Stencil.Ref[0] = 0;
+ ctx->Stencil.Ref[1] = 0;
+ ctx->Stencil.ValueMask[0] = STENCIL_MAX;
+ ctx->Stencil.ValueMask[1] = STENCIL_MAX;
+ ctx->Stencil.WriteMask[0] = STENCIL_MAX;
+ ctx->Stencil.WriteMask[1] = STENCIL_MAX;
ctx->Stencil.Clear = 0;
- ctx->Stencil.WriteMask = STENCIL_MAX;
/* Texture group */
ctx->Texture.CurrentUnit = 0; /* multitexture */
- ctx->Texture._ReallyEnabled = 0;
+ ctx->Texture._EnabledUnits = 0;
for (i=0; i<MAX_TEXTURE_UNITS; i++)
init_texture_unit( ctx, i );
ctx->Texture.SharedPalette = GL_FALSE;
@@ -1147,10 +1323,9 @@ init_attrib_groups( GLcontext *ctx )
ctx->Transform.RescaleNormals = GL_FALSE;
ctx->Transform.RasterPositionUnclipped = GL_FALSE;
for (i=0;i<MAX_CLIP_PLANES;i++) {
- ctx->Transform.ClipEnabled[i] = GL_FALSE;
ASSIGN_4V( ctx->Transform.EyeUserPlane[i], 0.0, 0.0, 0.0, 0.0 );
}
- ctx->Transform._AnyClip = GL_FALSE;
+ ctx->Transform.ClipPlanesEnabled = 0;
/* Viewport group */
ctx->Viewport.X = 0;
@@ -1281,6 +1456,18 @@ init_attrib_groups( GLcontext *ctx )
_mesa_init_colortable(&ctx->PostColorMatrixColorTable);
_mesa_init_colortable(&ctx->ProxyPostColorMatrixColorTable);
+ /* GL_NV_vertex_program */
+ ctx->VertexProgram.Enabled = GL_FALSE;
+ ctx->VertexProgram.PointSizeEnabled = GL_FALSE;
+ ctx->VertexProgram.TwoSideEnabled = GL_FALSE;
+ ctx->VertexProgram.CurrentID = 0;
+ ctx->VertexProgram.ErrorPos = -1;
+ ctx->VertexProgram.Current = NULL;
+ for (i = 0; i < VP_NUM_PROG_REGS / 4; i++) {
+ ctx->VertexProgram.TrackMatrix[i] = GL_NONE;
+ ctx->VertexProgram.TrackMatrixTransform[i] = GL_IDENTITY_NV;
+ }
+
/* Miscellaneous */
ctx->NewState = _NEW_ALL;
ctx->RenderMode = GL_RENDER;
@@ -1295,19 +1482,17 @@ init_attrib_groups( GLcontext *ctx )
ctx->CatchSignals = GL_TRUE;
ctx->OcclusionResult = GL_FALSE;
ctx->OcclusionResultSaved = GL_FALSE;
+ ctx->_Facing = 0;
/* For debug/development only */
- ctx->NoRaster = getenv("MESA_NO_RASTER") ? GL_TRUE : GL_FALSE;
+ ctx->NoRaster = _mesa_getenv("MESA_NO_RASTER") ? GL_TRUE : GL_FALSE;
ctx->FirstTimeCurrent = GL_TRUE;
/* Dither disable */
- ctx->NoDither = getenv("MESA_NO_DITHER") ? GL_TRUE : GL_FALSE;
+ ctx->NoDither = _mesa_getenv("MESA_NO_DITHER") ? GL_TRUE : GL_FALSE;
if (ctx->NoDither) {
- if (getenv("MESA_DEBUG")) {
- /* XXX This causes an OSMesa build problem on Solaris 2.6 */
-#ifndef SVR4
- fprintf(stderr, "MESA_NO_DITHER set - dithering disabled\n");
-#endif
+ if (_mesa_getenv("MESA_DEBUG")) {
+ _mesa_debug(ctx, "MESA_NO_DITHER set - dithering disabled\n");
}
ctx->Color.DitherFlag = GL_FALSE;
}
@@ -1345,7 +1530,8 @@ alloc_proxy_textures( GLcontext *ctx )
return GL_FALSE;
}
- ctx->Texture.ProxyCubeMap = _mesa_alloc_texture_object(NULL, 0, GL_TEXTURE_CUBE_MAP_ARB);
+ ctx->Texture.ProxyCubeMap = _mesa_alloc_texture_object(NULL, 0,
+ GL_TEXTURE_CUBE_MAP_ARB);
if (!ctx->Texture.ProxyCubeMap) {
_mesa_free_texture_object(NULL, ctx->Texture.Proxy1D);
_mesa_free_texture_object(NULL, ctx->Texture.Proxy2D);
@@ -1353,7 +1539,8 @@ alloc_proxy_textures( GLcontext *ctx )
return GL_FALSE;
}
- ctx->Texture.ProxyRect = _mesa_alloc_texture_object(NULL, 0, GL_TEXTURE_RECTANGLE_NV);
+ ctx->Texture.ProxyRect = _mesa_alloc_texture_object(NULL, 0,
+ GL_TEXTURE_RECTANGLE_NV);
if (!ctx->Texture.ProxyRect) {
_mesa_free_texture_object(NULL, ctx->Texture.Proxy1D);
_mesa_free_texture_object(NULL, ctx->Texture.Proxy2D);
@@ -1368,15 +1555,17 @@ alloc_proxy_textures( GLcontext *ctx )
ctx->Texture.Proxy2D->Image[i] = _mesa_alloc_texture_image();
ctx->Texture.Proxy3D->Image[i] = _mesa_alloc_texture_image();
ctx->Texture.ProxyCubeMap->Image[i] = _mesa_alloc_texture_image();
- ctx->Texture.ProxyRect->Image[i] = _mesa_alloc_texture_image();
if (!ctx->Texture.Proxy1D->Image[i]
|| !ctx->Texture.Proxy2D->Image[i]
|| !ctx->Texture.Proxy3D->Image[i]
- || !ctx->Texture.ProxyCubeMap->Image[i]
- || !ctx->Texture.ProxyRect->Image[i]) {
+ || !ctx->Texture.ProxyCubeMap->Image[i]) {
out_of_memory = GL_TRUE;
}
}
+ ctx->Texture.ProxyRect->Image[0] = _mesa_alloc_texture_image();
+ if (!ctx->Texture.ProxyRect->Image[0])
+ out_of_memory = GL_TRUE;
+
if (out_of_memory) {
for (i=0;i<MAX_TEXTURE_LEVELS;i++) {
if (ctx->Texture.Proxy1D->Image[i]) {
@@ -1391,9 +1580,9 @@ alloc_proxy_textures( GLcontext *ctx )
if (ctx->Texture.ProxyCubeMap->Image[i]) {
_mesa_free_texture_image(ctx->Texture.ProxyCubeMap->Image[i]);
}
- if (ctx->Texture.ProxyRect->Image[i]) {
- _mesa_free_texture_image(ctx->Texture.ProxyRect->Image[i]);
- }
+ }
+ if (ctx->Texture.ProxyRect->Image[0]) {
+ _mesa_free_texture_image(ctx->Texture.ProxyRect->Image[0]);
}
_mesa_free_texture_object(NULL, ctx->Texture.Proxy1D);
_mesa_free_texture_object(NULL, ctx->Texture.Proxy2D);
@@ -1411,36 +1600,36 @@ alloc_proxy_textures( GLcontext *ctx )
static void add_debug_flags( const char *debug )
{
#ifdef MESA_DEBUG
- if (strstr(debug, "varray"))
+ if (_mesa_strstr(debug, "varray"))
MESA_VERBOSE |= VERBOSE_VARRAY;
- if (strstr(debug, "tex"))
+ if (_mesa_strstr(debug, "tex"))
MESA_VERBOSE |= VERBOSE_TEXTURE;
- if (strstr(debug, "imm"))
+ if (_mesa_strstr(debug, "imm"))
MESA_VERBOSE |= VERBOSE_IMMEDIATE;
- if (strstr(debug, "pipe"))
+ if (_mesa_strstr(debug, "pipe"))
MESA_VERBOSE |= VERBOSE_PIPELINE;
- if (strstr(debug, "driver"))
+ if (_mesa_strstr(debug, "driver"))
MESA_VERBOSE |= VERBOSE_DRIVER;
- if (strstr(debug, "state"))
+ if (_mesa_strstr(debug, "state"))
MESA_VERBOSE |= VERBOSE_STATE;
- if (strstr(debug, "api"))
+ if (_mesa_strstr(debug, "api"))
MESA_VERBOSE |= VERBOSE_API;
- if (strstr(debug, "list"))
+ if (_mesa_strstr(debug, "list"))
MESA_VERBOSE |= VERBOSE_DISPLAY_LIST;
- if (strstr(debug, "lighting"))
+ if (_mesa_strstr(debug, "lighting"))
MESA_VERBOSE |= VERBOSE_LIGHTING;
/* Debug flag:
*/
- if (strstr(debug, "flush"))
+ if (_mesa_strstr(debug, "flush"))
MESA_DEBUG_FLAGS |= DEBUG_ALWAYS_FLUSH;
#endif
}
@@ -1458,19 +1647,20 @@ _mesa_initialize_context( GLcontext *ctx,
GLboolean direct )
{
GLuint dispatchSize;
+ const char *c;
- (void) direct; /* not used */
+ ASSERT(driver_ctx);
- /* misc one-time initializations */
- one_time_init();
+ /* If the driver wants core Mesa to use special imports, it'll have to
+ * override these defaults.
+ */
+ _mesa_init_default_imports( &(ctx->imports), driver_ctx );
- /**
- ** OpenGL SI stuff
- **/
- if (!ctx->imports.malloc) {
- _mesa_InitDefaultImports(&ctx->imports, driver_ctx, NULL);
- }
- /* exports are setup by the device driver */
+ /* initialize the exports (Mesa functions called by the window system) */
+ _mesa_init_default_exports( &(ctx->exports) );
+
+ /* misc one-time initializations */
+ one_time_init(ctx);
ctx->DriverCtx = driver_ctx;
ctx->Visual = *visual;
@@ -1503,17 +1693,15 @@ _mesa_initialize_context( GLcontext *ctx,
if (visual->doubleBufferMode) {
ctx->Color.DrawBuffer = GL_BACK;
- ctx->Color.DriverDrawBuffer = GL_BACK_LEFT;
- ctx->Color.DrawDestMask = BACK_LEFT_BIT;
+ ctx->Color._DrawDestMask = BACK_LEFT_BIT;
ctx->Pixel.ReadBuffer = GL_BACK;
- ctx->Pixel.DriverReadBuffer = GL_BACK_LEFT;
+ ctx->Pixel._ReadSrcMask = BACK_LEFT_BIT;
}
else {
ctx->Color.DrawBuffer = GL_FRONT;
- ctx->Color.DriverDrawBuffer = GL_FRONT_LEFT;
- ctx->Color.DrawDestMask = FRONT_LEFT_BIT;
+ ctx->Color._DrawDestMask = FRONT_LEFT_BIT;
ctx->Pixel.ReadBuffer = GL_FRONT;
- ctx->Pixel.DriverReadBuffer = GL_FRONT_LEFT;
+ ctx->Pixel._ReadSrcMask = FRONT_LEFT_BIT;
}
if (!alloc_proxy_textures(ctx)) {
@@ -1521,15 +1709,106 @@ _mesa_initialize_context( GLcontext *ctx,
return GL_FALSE;
}
- /* register the most recent extension functions with libGL */
- _glapi_add_entrypoint("glTbufferMask3DFX", 553);
- _glapi_add_entrypoint("glCompressedTexImage3DARB", 554);
- _glapi_add_entrypoint("glCompressedTexImage2DARB", 555);
- _glapi_add_entrypoint("glCompressedTexImage1DARB", 556);
- _glapi_add_entrypoint("glCompressedTexSubImage3DARB", 557);
- _glapi_add_entrypoint("glCompressedTexSubImage2DARB", 558);
- _glapi_add_entrypoint("glCompressedTexSubImage1DARB", 559);
- _glapi_add_entrypoint("glGetCompressedTexImageARB", 560);
+ /*
+ * For XFree86/DRI: tell libGL to add these functions to the dispatcher.
+ * Basically, we should add all extension functions above offset 577.
+ * This enables older libGL libraries to work with newer drivers that
+ * have newer extensions.
+ */
+ /* GL_ARB_window_pos aliases with GL_MESA_window_pos */
+ _glapi_add_entrypoint("glWindowPos2dARB", 513);
+ _glapi_add_entrypoint("glWindowPos2dvARB", 514);
+ _glapi_add_entrypoint("glWindowPos2fARB", 515);
+ _glapi_add_entrypoint("glWindowPos2fvARB", 516);
+ _glapi_add_entrypoint("glWindowPos2iARB", 517);
+ _glapi_add_entrypoint("glWindowPos2ivARB", 518);
+ _glapi_add_entrypoint("glWindowPos2sARB", 519);
+ _glapi_add_entrypoint("glWindowPos2svARB", 520);
+ _glapi_add_entrypoint("glWindowPos3dARB", 521);
+ _glapi_add_entrypoint("glWindowPos3dvARB", 522);
+ _glapi_add_entrypoint("glWindowPos3fARB", 523);
+ _glapi_add_entrypoint("glWindowPos3fvARB", 524);
+ _glapi_add_entrypoint("glWindowPos3iARB", 525);
+ _glapi_add_entrypoint("glWindowPos3ivARB", 526);
+ _glapi_add_entrypoint("glWindowPos3sARB", 527);
+ _glapi_add_entrypoint("glWindowPos3svARB", 528);
+ /* new extension functions */
+ _glapi_add_entrypoint("glAreProgramsResidentNV", 578);
+ _glapi_add_entrypoint("glBindProgramNV", 579);
+ _glapi_add_entrypoint("glDeleteProgramsNV", 580);
+ _glapi_add_entrypoint("glExecuteProgramNV", 581);
+ _glapi_add_entrypoint("glGenProgramsNV", 582);
+ _glapi_add_entrypoint("glGetProgramParameterdvNV", 583);
+ _glapi_add_entrypoint("glGetProgramParameterfvNV", 584);
+ _glapi_add_entrypoint("glGetProgramivNV", 585);
+ _glapi_add_entrypoint("glGetProgramStringNV", 586);
+ _glapi_add_entrypoint("glGetTrackMatrixivNV", 587);
+ _glapi_add_entrypoint("glGetVertexAttribdvNV", 588);
+ _glapi_add_entrypoint("glGetVertexAttribfvNV", 589);
+ _glapi_add_entrypoint("glGetVertexAttribivNV", 590);
+ _glapi_add_entrypoint("glGetVertexAttribPointervNV", 591);
+ _glapi_add_entrypoint("glIsProgramNV", 592);
+ _glapi_add_entrypoint("glLoadProgramNV", 593);
+ _glapi_add_entrypoint("glProgramParameter4dNV", 594);
+ _glapi_add_entrypoint("glProgramParameter4dvNV", 595);
+ _glapi_add_entrypoint("glProgramParameter4fNV", 596);
+ _glapi_add_entrypoint("glProgramParameter4fvNV", 597);
+ _glapi_add_entrypoint("glProgramParameters4dvNV", 598);
+ _glapi_add_entrypoint("glProgramParameters4fvNV", 599);
+ _glapi_add_entrypoint("glRequestResidentProgramsNV", 600);
+ _glapi_add_entrypoint("glTrackMatrixNV", 601);
+ _glapi_add_entrypoint("glVertexAttribPointerNV", 602);
+ _glapi_add_entrypoint("glVertexAttrib1dNV", 603);
+ _glapi_add_entrypoint("glVertexAttrib1dvNV", 604);
+ _glapi_add_entrypoint("glVertexAttrib1fNV", 605);
+ _glapi_add_entrypoint("glVertexAttrib1fvNV", 606);
+ _glapi_add_entrypoint("glVertexAttrib1sNV", 607);
+ _glapi_add_entrypoint("glVertexAttrib1svNV", 608);
+ _glapi_add_entrypoint("glVertexAttrib2dNV", 609);
+ _glapi_add_entrypoint("glVertexAttrib2dvNV", 610);
+ _glapi_add_entrypoint("glVertexAttrib2fNV", 611);
+ _glapi_add_entrypoint("glVertexAttrib2fvNV", 612);
+ _glapi_add_entrypoint("glVertexAttrib2sNV", 613);
+ _glapi_add_entrypoint("glVertexAttrib2svNV", 614);
+ _glapi_add_entrypoint("glVertexAttrib3dNV", 615);
+ _glapi_add_entrypoint("glVertexAttrib3dvNV", 616);
+ _glapi_add_entrypoint("glVertexAttrib3fNV", 617);
+ _glapi_add_entrypoint("glVertexAttrib3fvNV", 618);
+ _glapi_add_entrypoint("glVertexAttrib3sNV", 619);
+ _glapi_add_entrypoint("glVertexAttrib3svNV", 620);
+ _glapi_add_entrypoint("glVertexAttrib4dNV", 621);
+ _glapi_add_entrypoint("glVertexAttrib4dvNV", 622);
+ _glapi_add_entrypoint("glVertexAttrib4fNV", 623);
+ _glapi_add_entrypoint("glVertexAttrib4fvNV", 624);
+ _glapi_add_entrypoint("glVertexAttrib4sNV", 625);
+ _glapi_add_entrypoint("glVertexAttrib4svNV", 626);
+ _glapi_add_entrypoint("glVertexAttrib4ubNV", 627);
+ _glapi_add_entrypoint("glVertexAttrib4ubvNV", 628);
+ _glapi_add_entrypoint("glVertexAttribs1dvNV", 629);
+ _glapi_add_entrypoint("glVertexAttribs1fvNV", 630);
+ _glapi_add_entrypoint("glVertexAttribs1svNV", 631);
+ _glapi_add_entrypoint("glVertexAttribs2dvNV", 632);
+ _glapi_add_entrypoint("glVertexAttribs2fvNV", 633);
+ _glapi_add_entrypoint("glVertexAttribs2svNV", 634);
+ _glapi_add_entrypoint("glVertexAttribs3dvNV", 635);
+ _glapi_add_entrypoint("glVertexAttribs3fvNV", 636);
+ _glapi_add_entrypoint("glVertexAttribs3svNV", 637);
+ _glapi_add_entrypoint("glVertexAttribs4dvNV", 638);
+ _glapi_add_entrypoint("glVertexAttribs4fvNV", 639);
+ _glapi_add_entrypoint("glVertexAttribs4svNV", 640);
+ _glapi_add_entrypoint("glVertexAttribs4ubvNV", 641);
+ _glapi_add_entrypoint("glPointParameteriNV", 642);
+ _glapi_add_entrypoint("glPointParameterivNV", 643);
+ _glapi_add_entrypoint("glMultiDrawArraysEXT", 644);
+ _glapi_add_entrypoint("glMultiDrawElementsEXT", 645);
+ _glapi_add_entrypoint("glActiveStencilFaceEXT", 646);
+ _glapi_add_entrypoint("glDeleteFencesNV", 647);
+ _glapi_add_entrypoint("glGenFencesNV", 648);
+ _glapi_add_entrypoint("glIsFenceNV", 649);
+ _glapi_add_entrypoint("glTestFenceNV", 650);
+ _glapi_add_entrypoint("glGetFenceivNV", 651);
+ _glapi_add_entrypoint("glFinishFenceNV", 652);
+ _glapi_add_entrypoint("glSetFenceNV", 653);
/* Find the larger of Mesa's dispatch table and libGL's dispatch table.
* In practice, this'll be the same for stand-alone Mesa. But for DRI
@@ -1581,41 +1860,13 @@ _mesa_initialize_context( GLcontext *ctx,
}
ctx->MRD = 1.0; /* Minimum resolvable depth value, for polygon offset */
+ c = _mesa_getenv("MESA_DEBUG");
+ if (c)
+ add_debug_flags(c);
-#if defined(MESA_TRACE)
- ctx->TraceCtx = (trace_context_t *) CALLOC( sizeof(trace_context_t) );
-#if 0
- /* Brian: do you want to have CreateContext fail here,
- or should we just trap in NewTrace (currently done)? */
- if (!(ctx->TraceCtx)) {
- free_shared_state(ctx, ctx->Shared);
- FREE( ctx->Exec );
- FREE( ctx->Save );
- return GL_FALSE;
- }
-#endif
- trInitContext(ctx->TraceCtx);
-
- ctx->TraceDispatch = (struct _glapi_table *)
- CALLOC(dispatchSize * sizeof(void*));
-#if 0
- if (!(ctx->TraceCtx)) {
- free_shared_state(ctx, ctx->Shared);
- FREE( ctx->Exec );
- FREE( ctx->Save );
- FREE( ctx->TraceCtx );
- return GL_FALSE;
- }
-#endif
- trInitDispatch(ctx->TraceDispatch);
-#endif
-
-
- if (getenv("MESA_DEBUG"))
- add_debug_flags(getenv("MESA_DEBUG"));
-
- if (getenv("MESA_VERBOSE"))
- add_debug_flags(getenv("MESA_VERBOSE"));
+ c = _mesa_getenv("MESA_VERBOSE");
+ if (c)
+ add_debug_flags(c);
return GL_TRUE;
}
@@ -1627,6 +1878,7 @@ _mesa_initialize_context( GLcontext *ctx,
* Input: visual - a GLvisual pointer (we copy the struct contents)
* sharelist - another context to share display lists with or NULL
* driver_ctx - pointer to device driver's context state struct
+ * direct - direct rendering?
* Return: pointer to a new __GLcontextRec or NULL if error.
*/
GLcontext *
@@ -1634,17 +1886,22 @@ _mesa_create_context( const GLvisual *visual,
GLcontext *share_list,
void *driver_ctx,
GLboolean direct )
+
{
- GLcontext *ctx = (GLcontext *) CALLOC( sizeof(GLcontext) );
- if (!ctx) {
+ GLcontext *ctx;
+
+ ASSERT(visual);
+ ASSERT(driver_ctx);
+
+ ctx = (GLcontext *) _mesa_calloc(sizeof(GLcontext));
+ if (!ctx)
return NULL;
- }
- ctx->Driver.CurrentExecPrimitive = 0;
+
if (_mesa_initialize_context(ctx, visual, share_list, driver_ctx, direct)) {
return ctx;
}
else {
- FREE(ctx);
+ _mesa_free(ctx);
return NULL;
}
}
@@ -1659,35 +1916,36 @@ void
_mesa_free_context_data( GLcontext *ctx )
{
struct gl_shine_tab *s, *tmps;
- GLuint i, j;
+ GLuint i;
/* if we're destroying the current context, unbind it first */
if (ctx == _mesa_get_current_context()) {
_mesa_make_current(NULL, NULL);
}
- _math_matrix_dtr( &ctx->ModelView );
- for (i = 0; i < MAX_MODELVIEW_STACK_DEPTH - 1; i++) {
- _math_matrix_dtr( &ctx->ModelViewStack[i] );
- }
- _math_matrix_dtr( &ctx->ProjectionMatrix );
- for (i = 0; i < MAX_PROJECTION_STACK_DEPTH - 1; i++) {
- _math_matrix_dtr( &ctx->ProjectionStack[i] );
- }
- for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
- _math_matrix_dtr( &ctx->TextureMatrix[i] );
- for (j = 0; j < MAX_TEXTURE_STACK_DEPTH - 1; j++) {
- _math_matrix_dtr( &ctx->TextureStack[i][j] );
- }
- }
-
+ /*
+ * Free transformation matrix stacks
+ */
+ free_matrix_stack(&ctx->ModelviewMatrixStack);
+ free_matrix_stack(&ctx->ProjectionMatrixStack);
+ free_matrix_stack(&ctx->ColorMatrixStack);
+ for (i = 0; i < MAX_TEXTURE_UNITS; i++)
+ free_matrix_stack(&ctx->TextureMatrixStack[i]);
+ for (i = 0; i < MAX_PROGRAM_MATRICES; i++)
+ free_matrix_stack(&ctx->ProgramMatrixStack[i]);
+ /* combined Modelview*Projection matrix */
_math_matrix_dtr( &ctx->_ModelProjectMatrix );
- _math_matrix_dtr(&ctx->ColorMatrix);
- for (j = 0; j < MAX_COLOR_STACK_DEPTH - 1; j++) {
- _math_matrix_dtr(&ctx->ColorStack[j]);
+
+#if FEATURE_NV_vertex_program
+ if (ctx->VertexProgram.Current) {
+ ctx->VertexProgram.Current->RefCount--;
+ if (ctx->VertexProgram.Current->RefCount <= 0)
+ _mesa_delete_program(ctx, ctx->VertexProgram.CurrentID);
}
+#endif
+ /* Shared context state (display lists, textures, etc) */
_glthread_LOCK_MUTEX(ctx->Shared->Mutex);
ctx->Shared->RefCount--;
assert(ctx->Shared->RefCount >= 0);
@@ -1697,6 +1955,7 @@ _mesa_free_context_data( GLcontext *ctx )
free_shared_state( ctx, ctx->Shared );
}
+ /* Free lighting shininess exponentiation table */
foreach_s( s, tmps, ctx->_ShineTabList ) {
FREE( s );
}
@@ -1728,6 +1987,8 @@ _mesa_free_context_data( GLcontext *ctx )
FREE( ctx->EvalMap.Map1Texture3.Points );
if (ctx->EvalMap.Map1Texture4.Points)
FREE( ctx->EvalMap.Map1Texture4.Points );
+ for (i = 0; i < 16; i++)
+ FREE((ctx->EvalMap.Map1Attrib[i].Points));
if (ctx->EvalMap.Map2Vertex3.Points)
FREE( ctx->EvalMap.Map2Vertex3.Points );
@@ -1747,6 +2008,8 @@ _mesa_free_context_data( GLcontext *ctx )
FREE( ctx->EvalMap.Map2Texture3.Points );
if (ctx->EvalMap.Map2Texture4.Points)
FREE( ctx->EvalMap.Map2Texture4.Points );
+ for (i = 0; i < 16; i++)
+ FREE((ctx->EvalMap.Map2Attrib[i].Points));
_mesa_free_colortable_data( &ctx->ColorTable );
_mesa_free_colortable_data( &ctx->PostConvolutionColorTable );
@@ -1891,45 +2154,46 @@ _mesa_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask )
}
-/*
- * Set the current context, binding the given frame buffer to the context.
- */
-void
-_mesa_make_current( GLcontext *newCtx, GLframebuffer *buffer )
-{
- _mesa_make_current2( newCtx, buffer, buffer );
-}
-
static void print_info( void )
{
- fprintf(stderr, "Mesa GL_VERSION = %s\n",
+ _mesa_debug(NULL, "Mesa GL_VERSION = %s\n",
(char *) _mesa_GetString(GL_VERSION));
- fprintf(stderr, "Mesa GL_RENDERER = %s\n",
+ _mesa_debug(NULL, "Mesa GL_RENDERER = %s\n",
(char *) _mesa_GetString(GL_RENDERER));
- fprintf(stderr, "Mesa GL_VENDOR = %s\n",
+ _mesa_debug(NULL, "Mesa GL_VENDOR = %s\n",
(char *) _mesa_GetString(GL_VENDOR));
- fprintf(stderr, "Mesa GL_EXTENSIONS = %s\n",
+ _mesa_debug(NULL, "Mesa GL_EXTENSIONS = %s\n",
(char *) _mesa_GetString(GL_EXTENSIONS));
#if defined(THREADS)
- fprintf(stderr, "Mesa thread-safe: YES\n");
+ _mesa_debug(NULL, "Mesa thread-safe: YES\n");
#else
- fprintf(stderr, "Mesa thread-safe: NO\n");
+ _mesa_debug(NULL, "Mesa thread-safe: NO\n");
#endif
#if defined(USE_X86_ASM)
- fprintf(stderr, "Mesa x86-optimized: YES\n");
+ _mesa_debug(NULL, "Mesa x86-optimized: YES\n");
#else
- fprintf(stderr, "Mesa x86-optimized: NO\n");
+ _mesa_debug(NULL, "Mesa x86-optimized: NO\n");
#endif
#if defined(USE_SPARC_ASM)
- fprintf(stderr, "Mesa sparc-optimized: YES\n");
+ _mesa_debug(NULL, "Mesa sparc-optimized: YES\n");
#else
- fprintf(stderr, "Mesa sparc-optimized: NO\n");
+ _mesa_debug(NULL, "Mesa sparc-optimized: NO\n");
#endif
}
/*
+ * Set the current context, binding the given frame buffer to the context.
+ */
+void
+_mesa_make_current( GLcontext *newCtx, GLframebuffer *buffer )
+{
+ _mesa_make_current2( newCtx, buffer, buffer );
+}
+
+
+/*
* Bind the given context to the given draw-buffer and read-buffer
* and make it the current context for this thread.
*/
@@ -1938,7 +2202,7 @@ _mesa_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer,
GLframebuffer *readBuffer )
{
if (MESA_VERBOSE)
- fprintf(stderr, "_mesa_make_current2()\n");
+ _mesa_debug(newCtx, "_mesa_make_current2()\n");
/* Check that the context's and framebuffer's visuals are compatible.
* We could do a lot more checking here but this'll catch obvious
@@ -2009,6 +2273,7 @@ _mesa_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer,
}
}
+ /* This is only for T&L - a bit out of place, or misnamed (BP) */
if (newCtx->Driver.MakeCurrent)
newCtx->Driver.MakeCurrent( newCtx, drawBuffer, readBuffer );
@@ -2018,7 +2283,7 @@ _mesa_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer,
* information.
*/
if (newCtx->FirstTimeCurrent) {
- if (getenv("MESA_INFO")) {
+ if (_mesa_getenv("MESA_INFO")) {
print_info();
}
newCtx->FirstTimeCurrent = GL_FALSE;
@@ -2040,19 +2305,6 @@ _mesa_get_current_context( void )
}
-
-/*
- * This should be called by device drivers just before they do a
- * swapbuffers. Any pending rendering commands will be executed.
- */
-void
-_mesa_swapbuffers(GLcontext *ctx)
-{
- FLUSH_VERTICES( ctx, 0 );
-}
-
-
-
/*
* Return pointer to this context's current API dispatch table.
* It'll either be the immediate-mode execute dispatcher or the
@@ -2072,111 +2324,12 @@ _mesa_get_dispatch(GLcontext *ctx)
/*
- * This function is called when the Mesa user has stumbled into a code
- * path which may not be implemented fully or correctly.
- */
-void _mesa_problem( const GLcontext *ctx, const char *s )
-{
- fprintf( stderr, "Mesa implementation error: %s\n", s );
-#ifdef XF86DRI
- fprintf( stderr, "Please report to the DRI bug database at dri.sourceforge.net\n");
-#else
- fprintf( stderr, "Please report to the Mesa bug database at www.mesa3d.org\n" );
-#endif
- (void) ctx;
-}
-
-
-
-/*
- * This is called to inform the user that he or she has tried to do
- * something illogical or if there's likely a bug in their program
- * (like enabled depth testing without a depth buffer).
+ * Record the given error code and call the driver's Error function if defined.
+ * This is called via _mesa_error().
*/
void
-_mesa_warning( const GLcontext *ctx, const char *s )
+_mesa_record_error( GLcontext *ctx, GLenum error )
{
- (*ctx->imports.warning)((__GLcontext *) ctx, (char *) s);
-}
-
-
-
-/*
- * Compile an error into current display list.
- */
-void
-_mesa_compile_error( GLcontext *ctx, GLenum error, const char *s )
-{
- if (ctx->CompileFlag)
- _mesa_save_error( ctx, error, s );
-
- if (ctx->ExecuteFlag)
- _mesa_error( ctx, error, s );
-}
-
-
-
-/*
- * This is Mesa's error handler. Normally, all that's done is the updating
- * of the current error value. If Mesa is compiled with -DDEBUG or if the
- * environment variable "MESA_DEBUG" is defined then a real error message
- * is printed to stderr.
- * Input: ctx - the GL context
- * error - the error value
- * where - usually the name of function where error was detected
- */
-void
-_mesa_error( GLcontext *ctx, GLenum error, const char *where )
-{
- const char *debugEnv = getenv("MESA_DEBUG");
- GLboolean debug;
-
-#ifdef DEBUG
- if (debugEnv && strstr(debugEnv, "silent"))
- debug = GL_FALSE;
- else
- debug = GL_TRUE;
-#else
- if (debugEnv)
- debug = GL_TRUE;
- else
- debug = GL_FALSE;
-#endif
-
- if (debug) {
- const char *errstr;
- switch (error) {
- case GL_NO_ERROR:
- errstr = "GL_NO_ERROR";
- break;
- case GL_INVALID_VALUE:
- errstr = "GL_INVALID_VALUE";
- break;
- case GL_INVALID_ENUM:
- errstr = "GL_INVALID_ENUM";
- break;
- case GL_INVALID_OPERATION:
- errstr = "GL_INVALID_OPERATION";
- break;
- case GL_STACK_OVERFLOW:
- errstr = "GL_STACK_OVERFLOW";
- break;
- case GL_STACK_UNDERFLOW:
- errstr = "GL_STACK_UNDERFLOW";
- break;
- case GL_OUT_OF_MEMORY:
- errstr = "GL_OUT_OF_MEMORY";
- break;
- case GL_TABLE_TOO_LARGE:
- errstr = "GL_TABLE_TOO_LARGE";
- break;
- default:
- errstr = "unknown";
- break;
- }
- fprintf(stderr, "Mesa user error: %s in %s\n", errstr, where);
- }
-
if (!ctx)
return;
@@ -2191,7 +2344,6 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *where )
}
-
void
_mesa_Finish( void )
{
diff --git a/xc/extras/Mesa/src/context.h b/xc/extras/Mesa/src/context.h
index 36f8e164f..a123b317b 100644
--- a/xc/extras/Mesa/src/context.h
+++ b/xc/extras/Mesa/src/context.h
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
@@ -52,9 +52,7 @@
/*
- * Create/destroy a GLvisual. A GLvisual is like a GLX visual. It describes
- * the colorbuffer, depth buffer, stencil buffer and accum buffer which will
- * be used by the GL context and framebuffer.
+ * Create/destroy a GLvisual.
*/
extern GLvisual *
_mesa_create_visual( GLboolean rgbFlag,
@@ -97,9 +95,7 @@ _mesa_destroy_visual( GLvisual *vis );
/*
- * Create/destroy a GLframebuffer. A GLframebuffer is like a GLX drawable.
- * It bundles up the depth buffer, stencil buffer and accum buffers into a
- * single entity.
+ * Create/destroy a GLframebuffer.
*/
extern GLframebuffer *
_mesa_create_framebuffer( const GLvisual *visual,
@@ -125,14 +121,13 @@ _mesa_destroy_framebuffer( GLframebuffer *buffer );
/*
- * Create/destroy a GLcontext. A GLcontext is like a GLX context. It
- * contains the rendering state.
+ * Create/destroy a GLcontext.
*/
extern GLcontext *
_mesa_create_context( const GLvisual *visual,
GLcontext *share_list,
void *driver_ctx,
- GLboolean direct);
+ GLboolean direct );
extern GLboolean
_mesa_initialize_context( GLcontext *ctx,
@@ -181,47 +176,64 @@ _mesa_get_current_context(void);
-extern void
-_mesa_swapbuffers(GLcontext *ctx);
+/* OpenGL SI-style export functions. */
+extern GLboolean
+_mesa_destroyContext(__GLcontext *gc);
-extern struct _glapi_table *
-_mesa_get_dispatch(GLcontext *ctx);
+extern GLboolean
+_mesa_loseCurrent(__GLcontext *gc);
+extern GLboolean
+_mesa_makeCurrent(__GLcontext *gc);
+extern GLboolean
+_mesa_shareContext(__GLcontext *gc, __GLcontext *gcShare);
-/*
- * Miscellaneous
- */
+extern GLboolean
+_mesa_copyContext(__GLcontext *dst, const __GLcontext *src, GLuint mask);
+
+extern GLboolean
+_mesa_forceCurrent(__GLcontext *gc);
+
+extern GLboolean
+_mesa_notifyResize(__GLcontext *gc);
extern void
-_mesa_problem( const GLcontext *ctx, const char *s );
+_mesa_notifyDestroy(__GLcontext *gc);
extern void
-_mesa_warning( const GLcontext *ctx, const char *s );
+_mesa_notifySwapBuffers(__GLcontext *gc);
+
+extern struct __GLdispatchStateRec *
+_mesa_dispatchExec(__GLcontext *gc);
extern void
-_mesa_error( GLcontext *ctx, GLenum error, const char *s );
+_mesa_beginDispatchOverride(__GLcontext *gc);
extern void
-_mesa_compile_error( GLcontext *ctx, GLenum error, const char *s );
+_mesa_endDispatchOverride(__GLcontext *gc);
-extern void
-_mesa_Finish( void );
+extern struct _glapi_table *
+_mesa_get_dispatch(GLcontext *ctx);
-extern void
-_mesa_Flush( void );
+/*
+ * Miscellaneous
+ */
extern void
-_mesa_read_config_file(GLcontext *ctx);
+_mesa_record_error( GLcontext *ctx, GLenum error );
+
extern void
-_mesa_register_config_var(const char *name,
- void (*notify)( const char *, int ));
+_mesa_Finish( void );
+
+extern void
+_mesa_Flush( void );
#endif
diff --git a/xc/extras/Mesa/src/convolve.c b/xc/extras/Mesa/src/convolve.c
index a2622e0f4..341d60eac 100644
--- a/xc/extras/Mesa/src/convolve.c
+++ b/xc/extras/Mesa/src/convolve.c
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.2
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -32,9 +32,6 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colormac.h"
#include "convolve.h"
@@ -42,8 +39,6 @@
#include "image.h"
#include "mtypes.h"
#include "state.h"
-#include "swrast/s_span.h" /* XXX SWRAST hack */
-#endif
/*
diff --git a/xc/extras/Mesa/src/dd.h b/xc/extras/Mesa/src/dd.h
index 2bf833730..6e5f759f4 100644
--- a/xc/extras/Mesa/src/dd.h
+++ b/xc/extras/Mesa/src/dd.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -29,8 +29,6 @@
/* THIS FILE ONLY INCLUDED BY mtypes.h !!!!! */
-#include "macros.h"
-
struct gl_pixelstore_attrib;
/* Mask bits sent to the driver Clear() function */
@@ -38,9 +36,13 @@ struct gl_pixelstore_attrib;
#define DD_FRONT_RIGHT_BIT FRONT_RIGHT_BIT /* 2 */
#define DD_BACK_LEFT_BIT BACK_LEFT_BIT /* 4 */
#define DD_BACK_RIGHT_BIT BACK_RIGHT_BIT /* 8 */
+#define DD_AUX0 AUX0_BIT /* future use */
+#define DD_AUX1 AUX1_BIT /* future use */
+#define DD_AUX2 AUX2_BIT /* future use */
+#define DD_AUX3 AUX3_BIT /* future use */
#define DD_DEPTH_BIT GL_DEPTH_BUFFER_BIT /* 0x00000100 */
-#define DD_STENCIL_BIT GL_STENCIL_BUFFER_BIT /* 0x00000400 */
#define DD_ACCUM_BIT GL_ACCUM_BUFFER_BIT /* 0x00000200 */
+#define DD_STENCIL_BIT GL_STENCIL_BUFFER_BIT /* 0x00000400 */
/*
@@ -48,11 +50,6 @@ struct gl_pixelstore_attrib;
*/
struct dd_function_table {
- /**********************************************************************
- *** Mandatory functions: these functions must be implemented by ***
- *** every device driver. ***
- **********************************************************************/
-
const GLubyte * (*GetString)( GLcontext *ctx, GLenum name );
/* Return a string as needed by glGetString().
* Only the GL_RENDERER token must be implemented. Otherwise,
@@ -74,28 +71,23 @@ struct dd_function_table {
* If 'all' is true then the clear the whole buffer, else clear only the
* region defined by (x,y,width,height).
* This function must obey the glColorMask, glIndexMask and glStencilMask
- * settings! Software Mesa can do masked clears if the device driver can't.
+ * settings!
+ * Software Mesa can do masked clears if the device driver can't.
*/
- void (*SetDrawBuffer)( GLcontext *ctx, GLenum buffer );
+ void (*DrawBuffer)( GLcontext *ctx, GLenum buffer );
/*
- * Specifies the current buffer for writing.
- * The following values must be accepted when applicable:
- * GL_FRONT_LEFT - this buffer always exists
- * GL_BACK_LEFT - when double buffering
- * GL_FRONT_RIGHT - when using stereo
- * GL_BACK_RIGHT - when using stereo and double buffering
- * GL_FRONT - write to front left and front right if it exists
- * GL_BACK - write to back left and back right if it exists
- * GL_LEFT - write to front left and back left if it exists
- * GL_RIGHT - write to right left and back right if they exist
- * GL_FRONT_AND_BACK - write to all four buffers if they exist
- * GL_NONE - disable buffer write in device driver.
- *
+ * Specifies the current buffer for writing. Called via glDrawBuffer().
* Note the driver must organize fallbacks (eg with swrast) if it
* cannot implement the requested mode.
*/
+
+ void (*ReadBuffer)( GLcontext *ctx, GLenum buffer );
+ /*
+ * Specifies the current buffer for reading. Called via glReadBuffer().
+ */
+
void (*GetBufferSize)( GLframebuffer *buffer,
GLuint *width, GLuint *height );
/*
@@ -351,55 +343,6 @@ struct dd_function_table {
* should do the job.
*/
- void (*GetCompressedTexImage)( GLcontext *ctx, GLenum target,
- GLint level, void *image,
- const struct gl_texture_object *texObj,
- struct gl_texture_image *texImage );
- /* Called by glGetCompressedTexImageARB.
- * <target>, <level>, <image> are specified by user.
- * <texObj> is the source texture object.
- * <texImage> is the source texture image.
- */
-
- GLint (*BaseCompressedTexFormat)(GLcontext *ctx,
- GLint internalFormat);
- /* Called to compute the base format for a specific compressed
- * format. Return -1 if the internalFormat is not a specific
- * compressed format that the driver recognizes.
- * Example: if internalFormat==GL_COMPRESSED_RGB_FXT1_3DFX, return GL_RGB.
- */
-
- GLint (*CompressedTextureSize)(GLcontext *ctx,
- const struct gl_texture_image *texImage);
-
-#if 000
- /* ... Note the
- * return value differences between this function and
- * SpecificCompressedTexFormat below.
- */
-
- GLint (*SpecificCompressedTexFormat)(GLcontext *ctx,
- GLint internalFormat,
- GLint numDimensions,
- GLint *levelp,
- GLsizei *widthp,
- GLsizei *heightp,
- GLsizei *depthp,
- GLint *borderp,
- GLenum *formatp,
- GLenum *typep);
- /* Called to turn a generic texture format into a specific
- * texture format. For example, if a driver implements
- * GL_3DFX_texture_compression_FXT1, this would map
- * GL_COMPRESSED_RGBA_ARB to GL_COMPRESSED_RGBA_FXT1_3DFX.
- *
- * If the driver does not know how to handle the compressed
- * format, then just return the generic format, and Mesa will
- * do the right thing with it.
- */
-
-#endif
-
/***
*** Texture object functions:
***/
@@ -468,16 +411,14 @@ struct dd_function_table {
*** They're ALSO called by the gl_PopAttrib() function!!!
*** May add more functions like these to the device driver in the future.
***/
- void (*AlphaFunc)(GLcontext *ctx, GLenum func, GLchan ref);
+ void (*AlphaFunc)(GLcontext *ctx, GLenum func, GLfloat ref);
void (*BlendColor)(GLcontext *ctx, const GLfloat color[4]);
void (*BlendEquation)(GLcontext *ctx, GLenum mode);
void (*BlendFunc)(GLcontext *ctx, GLenum sfactor, GLenum dfactor);
void (*BlendFuncSeparate)(GLcontext *ctx,
GLenum sfactorRGB, GLenum dfactorRGB,
GLenum sfactorA, GLenum dfactorA);
- void (*BlendConstColor)(GLcontext *ctx, GLfloat red, GLfloat green,
- GLfloat blue, GLfloat alpha);
- void (*ClearColor)(GLcontext *ctx, const GLchan color[4]);
+ void (*ClearColor)(GLcontext *ctx, const GLfloat color[4]);
void (*ClearDepth)(GLcontext *ctx, GLclampd d);
void (*ClearIndex)(GLcontext *ctx, GLuint index);
void (*ClearStencil)(GLcontext *ctx, GLint s);
@@ -512,6 +453,7 @@ struct dd_function_table {
void (*StencilFunc)(GLcontext *ctx, GLenum func, GLint ref, GLuint mask);
void (*StencilMask)(GLcontext *ctx, GLuint mask);
void (*StencilOp)(GLcontext *ctx, GLenum fail, GLenum zfail, GLenum zpass);
+ void (*ActiveStencilFace)(GLcontext *ctx, GLuint face);
void (*TexGen)(GLcontext *ctx, GLenum coord, GLenum pname,
const GLfloat *params);
void (*TexEnv)(GLcontext *ctx, GLenum target, GLenum pname,
@@ -522,7 +464,6 @@ struct dd_function_table {
void (*TextureMatrix)(GLcontext *ctx, GLuint unit, const GLmatrix *mat);
void (*Viewport)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
-
/***
*** Vertex array functions
***
@@ -543,6 +484,8 @@ struct dd_function_table {
void (*TexCoordPointer)(GLcontext *ctx, GLint size, GLenum type,
GLsizei stride, const GLvoid *ptr);
void (*EdgeFlagPointer)(GLcontext *ctx, GLsizei stride, const GLvoid *ptr);
+ void (*VertexAttribPointer)(GLcontext *ctx, GLuint index, GLint size,
+ GLenum type, GLsizei stride, const GLvoid *ptr);
/*** State-query functions
@@ -555,8 +498,6 @@ struct dd_function_table {
GLboolean (*GetIntegerv)(GLcontext *ctx, GLenum pname, GLint *result);
GLboolean (*GetPointerv)(GLcontext *ctx, GLenum pname, GLvoid **result);
-
-
/***
*** Support for multiple t&l engines
***/
@@ -703,6 +644,9 @@ typedef struct {
void (*CallList)( GLuint ); /* NOTE */
void (*Begin)( GLenum );
void (*End)( void );
+ void (*VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+ void (*VertexAttrib4fvNV)( GLuint index, const GLfloat *v );
+
/* Drivers present a reduced set of the functions possible in
* begin/end objects. Core mesa provides translation stubs for the
* remaining functions to map down to these entrypoints.
diff --git a/xc/extras/Mesa/src/debug.c b/xc/extras/Mesa/src/debug.c
index de309348e..7cd30f30b 100644
--- a/xc/extras/Mesa/src/debug.c
+++ b/xc/extras/Mesa/src/debug.c
@@ -1,4 +1,3 @@
-/* $Id: debug.c,v 1.1.1.1 2002/10/22 13:05:08 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -25,11 +24,15 @@
*/
#include "mtypes.h"
+#include "context.h"
+#include "imports.h"
#include "debug.h"
-void _mesa_print_state( const char *msg, GLuint state )
+
+void
+_mesa_print_state( const char *msg, GLuint state )
{
- fprintf(stderr,
+ _mesa_debug(NULL,
"%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
msg,
state,
@@ -61,9 +64,10 @@ void _mesa_print_state( const char *msg, GLuint state )
-void _mesa_print_tri_caps( const char *name, GLuint flags )
+void
+_mesa_print_tri_caps( const char *name, GLuint flags )
{
- fprintf(stderr,
+ _mesa_debug(NULL,
"%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
name,
flags,
diff --git a/xc/extras/Mesa/src/depth.c b/xc/extras/Mesa/src/depth.c
index cd3b39521..1d8c52910 100644
--- a/xc/extras/Mesa/src/depth.c
+++ b/xc/extras/Mesa/src/depth.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,18 +24,13 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "context.h"
#include "enums.h"
#include "depth.h"
#include "macros.h"
-#include "mem.h"
#include "mtypes.h"
-#endif
-
/**********************************************************************/
@@ -69,7 +64,7 @@ _mesa_DepthFunc( GLenum func )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
- fprintf(stderr, "glDepthFunc %s\n", _mesa_lookup_enum_by_nr(func));
+ _mesa_debug(ctx, "glDepthFunc %s\n", _mesa_lookup_enum_by_nr(func));
switch (func) {
case GL_LESS: /* (default) pass if incoming z < stored z */
@@ -105,7 +100,7 @@ _mesa_DepthMask( GLboolean flag )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
- fprintf(stderr, "glDepthMask %d\n", flag);
+ _mesa_debug(ctx, "glDepthMask %d\n", flag);
/*
* GL_TRUE indicates depth buffer writing is enabled (default)
diff --git a/xc/extras/Mesa/src/dispatch.c b/xc/extras/Mesa/src/dispatch.c
index d4eebdb53..87dc64f02 100644
--- a/xc/extras/Mesa/src/dispatch.c
+++ b/xc/extras/Mesa/src/dispatch.c
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
@@ -27,10 +27,7 @@
/*
* This file generates all the gl* function entyrpoints.
* But if we're using X86-optimized dispatch (X86/glapi_x86.S) then
- * we don't use this file's code.
- *
- * Eventually this file may be replaced by automatically generated
- * code from an API spec file.
+ * we don't use this code.
*
* NOTE: This file should _not_ be used when compiling Mesa for a DRI-
* based device driver.
@@ -38,14 +35,11 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "glapi.h"
#include "glapitable.h"
#include "glthread.h"
-#endif
+
#if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM))
@@ -63,12 +57,28 @@
#define NAME(func) gl##func
#endif
+
+#if 0 /* Use this to log GL calls to stdout (for DEBUG only!) */
+
+#define F stdout
+#define DISPATCH(FUNC, ARGS, MESSAGE) \
+ fprintf MESSAGE; \
+ (_glapi_Dispatch->FUNC) ARGS;
+
+#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
+ fprintf MESSAGE; \
+ return (_glapi_Dispatch->FUNC) ARGS
+
+#else
+
#define DISPATCH(FUNC, ARGS, MESSAGE) \
- (_glapi_Dispatch->FUNC) ARGS
+ (_glapi_Dispatch->FUNC) ARGS;
#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
return (_glapi_Dispatch->FUNC) ARGS
+#endif /* logging */
+
#ifndef GLAPIENTRY
#define GLAPIENTRY
diff --git a/xc/extras/Mesa/src/dlist.c b/xc/extras/Mesa/src/dlist.c
index 5fe6124ec..bf01ec2bc 100644
--- a/xc/extras/Mesa/src/dlist.c
+++ b/xc/extras/Mesa/src/dlist.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 5.0
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -23,11 +23,8 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "api_loopback.h"
#include "attrib.h"
#include "blend.h"
@@ -54,7 +51,6 @@
#include "dlist.h"
#include "macros.h"
#include "matrix.h"
-#include "mem.h"
#include "pixel.h"
#include "points.h"
#include "polygon.h"
@@ -64,12 +60,13 @@
#include "texstate.h"
#include "mtypes.h"
#include "varray.h"
+#if FEATURE_NV_vertex_program
+#include "vpstate.h"
+#endif
#include "math/m_matrix.h"
#include "math/m_xform.h"
-#endif
-
/*
@@ -241,6 +238,17 @@ typedef enum {
OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D,
/* GL_ARB_multisample */
OPCODE_SAMPLE_COVERAGE,
+ /* GL_ARB_window_pos */
+ OPCODE_WINDOW_POS_ARB,
+ /* GL_NV_vertex_program */
+ OPCODE_BIND_PROGRAM_NV,
+ OPCODE_EXECUTE_PROGRAM_NV,
+ OPCODE_REQUEST_PROGRAMS_RESIDENT_NV,
+ OPCODE_LOAD_PROGRAM_NV,
+ OPCODE_PROGRAM_PARAMETER4F_NV,
+ OPCODE_TRACK_MATRIX_NV,
+ /* GL_EXT_stencil_two_side */
+ OPCODE_ACTIVE_STENCIL_FACE_EXT,
/* The following three are meta instructions */
OPCODE_ERROR, /* raise compiled-in error */
OPCODE_CONTINUE,
@@ -508,7 +516,7 @@ void _mesa_init_lists( void )
InstSize[OPCODE_BLEND_FUNC] = 3;
InstSize[OPCODE_BLEND_FUNC_SEPARATE] = 5;
InstSize[OPCODE_CALL_LIST] = 2;
- InstSize[OPCODE_CALL_LIST_OFFSET] = 2;
+ InstSize[OPCODE_CALL_LIST_OFFSET] = 3;
InstSize[OPCODE_CLEAR] = 2;
InstSize[OPCODE_CLEAR_ACCUM] = 5;
InstSize[OPCODE_CLEAR_COLOR] = 5;
@@ -626,6 +634,17 @@ void _mesa_init_lists( void )
InstSize[OPCODE_SAMPLE_COVERAGE] = 3;
/* GL_ARB_multitexture */
InstSize[OPCODE_ACTIVE_TEXTURE] = 2;
+ /* GL_ARB_window_pos */
+ InstSize[OPCODE_WINDOW_POS_ARB] = 4;
+ /* GL_NV_vertex_program */
+ InstSize[OPCODE_BIND_PROGRAM_NV] = 3;
+ InstSize[OPCODE_EXECUTE_PROGRAM_NV] = 7;
+ InstSize[OPCODE_REQUEST_PROGRAMS_RESIDENT_NV] = 2;
+ InstSize[OPCODE_LOAD_PROGRAM_NV] = 4;
+ InstSize[OPCODE_PROGRAM_PARAMETER4F_NV] = 7;
+ InstSize[OPCODE_TRACK_MATRIX_NV] = 5;
+ /* GL_EXT_stencil_two_side */
+ InstSize[OPCODE_ACTIVE_STENCIL_FACE_EXT] = 2;
}
init_flag = 1;
}
@@ -876,14 +895,34 @@ void _mesa_save_CallLists( GLsizei n, GLenum type, const GLvoid *lists )
{
GET_CURRENT_CONTEXT(ctx);
GLint i;
+ GLboolean typeErrorFlag;
+
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
FLUSH_CURRENT(ctx, 0);
+ switch (type) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ case GL_2_BYTES:
+ case GL_3_BYTES:
+ case GL_4_BYTES:
+ typeErrorFlag = GL_FALSE;
+ break;
+ default:
+ typeErrorFlag = GL_TRUE;
+ }
+
for (i=0;i<n;i++) {
GLuint list = translate_id( i, type, lists );
- Node *n = ALLOC_INSTRUCTION( ctx, OPCODE_CALL_LIST_OFFSET, 1 );
+ Node *n = ALLOC_INSTRUCTION( ctx, OPCODE_CALL_LIST_OFFSET, 2 );
if (n) {
n[1].ui = list;
+ n[2].b = typeErrorFlag;
}
}
if (ctx->ExecuteFlag) {
@@ -2495,6 +2534,18 @@ static void save_PointParameterfEXT( GLenum pname, GLfloat param )
save_PointParameterfvEXT(pname, &param);
}
+static void save_PointParameteriNV( GLenum pname, GLint param )
+{
+ GLfloat p = (GLfloat) param;
+ save_PointParameterfvEXT(pname, &p);
+}
+
+static void save_PointParameterivNV( GLenum pname, const GLint *param )
+{
+ GLfloat p = (GLfloat) param[0];
+ save_PointParameterfvEXT(pname, &p);
+}
+
static void save_PointSize( GLfloat size )
{
@@ -3227,7 +3278,7 @@ static void save_TexImage2D( GLenum target,
static void save_TexImage3D( GLenum target,
- GLint level, GLenum internalFormat,
+ GLint level, GLint internalFormat,
GLsizei width, GLsizei height, GLsizei depth,
GLint border,
GLenum format, GLenum type,
@@ -3782,7 +3833,7 @@ save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
}
if (ctx->ExecuteFlag) {
(*ctx->Exec->CompressedTexSubImage1DARB)(target, level, xoffset,
- width, format, imageSize, data);
+ width, format, imageSize, data);
}
}
@@ -3929,6 +3980,159 @@ save_PixelTexGenParameterfvSGIS(GLenum target, const GLfloat *value)
}
+/*
+ * GL_NV_vertex_program
+ */
+#if FEATURE_NV_vertex_program
+static void
+save_BindProgramNV(GLenum target, GLuint id)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_BIND_PROGRAM_NV, 2 );
+ if (n) {
+ n[1].e = target;
+ n[2].ui = id;
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->BindProgramNV)( target, id );
+ }
+}
+
+static void
+save_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_EXECUTE_PROGRAM_NV, 6 );
+ if (n) {
+ n[1].e = target;
+ n[2].ui = id;
+ n[3].f = params[0];
+ n[4].f = params[1];
+ n[5].f = params[2];
+ n[6].f = params[3];
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->ExecuteProgramNV)(target, id, params);
+ }
+}
+
+
+static void
+save_ProgramParameter4fNV(GLenum target, GLuint index,
+ GLfloat x, GLfloat y,
+ GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_PROGRAM_PARAMETER4F_NV, 6 );
+ if (n) {
+ n[1].e = target;
+ n[2].ui = index;
+ n[3].f = x;
+ n[4].f = y;
+ n[5].f = z;
+ n[6].f = w;
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->ProgramParameter4fNV)(target, index, x, y, z, w);
+ }
+}
+
+
+static void
+save_ProgramParameter4fvNV(GLenum target, GLuint index, const GLfloat *params)
+{
+ save_ProgramParameter4fNV(target, index, params[0], params[1],
+ params[2], params[3]);
+}
+
+
+static void
+save_ProgramParameter4dNV(GLenum target, GLuint index,
+ GLdouble x, GLdouble y,
+ GLdouble z, GLdouble w)
+{
+ save_ProgramParameter4fNV(target, index, (GLfloat) x, (GLfloat) y,
+ (GLfloat) z, (GLfloat) w);
+}
+
+
+static void
+save_ProgramParameter4dvNV(GLenum target, GLuint index,
+ const GLdouble *params)
+{
+ save_ProgramParameter4fNV(target, index, (GLfloat) params[0],
+ (GLfloat) params[1], (GLfloat) params[2],
+ (GLfloat) params[3]);
+}
+
+
+static void
+save_ProgramParameters4dvNV(GLenum target, GLuint index,
+ GLuint num, const GLdouble *params)
+{
+ GLuint i;
+ for (i = 0; i < num; i++) {
+ save_ProgramParameter4dvNV(target, index + i, params + 4 * i);
+ }
+}
+
+
+static void
+save_ProgramParameters4fvNV(GLenum target, GLuint index,
+ GLuint num, const GLfloat *params)
+{
+ GLuint i;
+ for (i = 0; i < num; i++) {
+ save_ProgramParameter4fvNV(target, index + i, params + 4 * i);
+ }
+}
+
+
+
+static void
+save_TrackMatrixNV(GLenum target, GLuint address,
+ GLenum matrix, GLenum transform)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_TRACK_MATRIX_NV, 4 );
+ if (n) {
+ n[1].e = target;
+ n[2].ui = address;
+ n[3].e = matrix;
+ n[4].e = transform;
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->TrackMatrixNV)(target, address, matrix, transform);
+ }
+}
+#endif /* FEATURE_NV_vertex_program */
+
+
+/* GL_EXT_stencil_two_side */
+static void save_ActiveStencilFaceEXT( GLenum face )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_ACTIVE_STENCIL_FACE_EXT, 1 );
+ if (n) {
+ n[1].e = face;
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->ActiveStencilFaceEXT)( face );
+ }
+}
+
+
+
/* KW: Compile commands
*
* Will appear in the list before the vertex buffer containing the
@@ -3947,6 +4151,21 @@ _mesa_save_error( GLcontext *ctx, GLenum error, const char *s )
}
+/*
+ * Compile an error into current display list.
+ */
+void
+_mesa_compile_error( GLcontext *ctx, GLenum error, const char *s )
+{
+ if (ctx->CompileFlag)
+ _mesa_save_error( ctx, error, s );
+
+ if (ctx->ExecuteFlag)
+ _mesa_error( ctx, error, s );
+}
+
+
+
static GLboolean
islist(GLcontext *ctx, GLuint list)
{
@@ -3983,9 +4202,6 @@ execute_list( GLcontext *ctx, GLuint list )
if (ctx->Driver.BeginCallList)
ctx->Driver.BeginCallList( ctx, list );
-/* fprintf(stderr, "execute list %d\n", list); */
-/* mesa_print_display_list( list ); */
-
ctx->CallDepth++;
n = (Node *) _mesa_HashLookup(ctx->Shared->DisplayList, list);
@@ -4042,7 +4258,11 @@ execute_list( GLcontext *ctx, GLuint list )
break;
case OPCODE_CALL_LIST_OFFSET:
/* Generated by glCallLists() so we must add ListBase */
- if (ctx->CallDepth<MAX_LIST_NESTING) {
+ if (n[2].b) {
+ /* user specified a bad datatype at compile time */
+ _mesa_error(ctx, GL_INVALID_ENUM, "glCallLists(type)");
+ }
+ else if (ctx->CallDepth < MAX_LIST_NESTING) {
execute_list( ctx, ctx->List.ListBase + n[1].ui );
}
break;
@@ -4610,6 +4830,40 @@ execute_list( GLcontext *ctx, GLuint list )
case OPCODE_SAMPLE_COVERAGE: /* GL_ARB_multisample */
(*ctx->Exec->SampleCoverageARB)(n[1].f, n[2].b);
break;
+ case OPCODE_WINDOW_POS_ARB: /* GL_ARB_window_pos */
+ (*ctx->Exec->WindowPos3fMESA)( n[1].f, n[2].f, n[3].f );
+ break;
+ case OPCODE_BIND_PROGRAM_NV: /* GL_NV_vertex_program */
+ (*ctx->Exec->BindProgramNV)( n[1].e, n[2].ui );
+ break;
+ case OPCODE_EXECUTE_PROGRAM_NV:
+ {
+ GLfloat v[4];
+ v[0] = n[3].f;
+ v[1] = n[4].f;
+ v[2] = n[5].f;
+ v[3] = n[6].f;
+ (*ctx->Exec->ExecuteProgramNV)(n[1].e, n[2].ui, v);
+ }
+ break;
+ case OPCODE_REQUEST_PROGRAMS_RESIDENT_NV:
+ /*
+ (*ctx->Exec->RequestResidentProgramsNV)();
+ */
+ break;
+ case OPCODE_LOAD_PROGRAM_NV:
+ /*
+ (*ctx->Exec->LoadProgramNV)();
+ */
+ break;
+ case OPCODE_PROGRAM_PARAMETER4F_NV:
+ (*ctx->Exec->ProgramParameter4fNV)(n[1].e, n[2].ui, n[3].f,
+ n[4].f, n[5].f, n[6].f);
+ break;
+ case OPCODE_TRACK_MATRIX_NV:
+ (*ctx->Exec->TrackMatrixNV)(n[1].e, n[2].ui, n[3].e, n[4].e);
+ break;
+
case OPCODE_CONTINUE:
n = (Node *) n[1].next;
break;
@@ -4619,8 +4873,8 @@ execute_list( GLcontext *ctx, GLuint list )
default:
{
char msg[1000];
- sprintf(msg, "Error in execute_list: opcode=%d", (int) opcode);
- _mesa_problem( ctx, msg );
+ _mesa_sprintf(msg, "Error in execute_list: opcode=%d", (int) opcode);
+ _mesa_problem(ctx, msg);
}
done = GL_TRUE;
}
@@ -4735,7 +4989,8 @@ _mesa_NewList( GLuint list, GLenum mode )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glNewList %u %s\n", list, _mesa_lookup_enum_by_nr(mode));
+ _mesa_debug(ctx, "glNewList %u %s\n", list,
+ _mesa_lookup_enum_by_nr(mode));
if (list==0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glNewList" );
@@ -4782,7 +5037,7 @@ _mesa_EndList( void )
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glEndList\n");
+ _mesa_debug(ctx, "glEndList\n");
/* Check that a list is under construction */
if (!ctx->CurrentListPtr) {
@@ -4825,7 +5080,7 @@ _mesa_CallList( GLuint list )
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "_mesa_CallList %d\n", list);
+ _mesa_debug(ctx, "_mesa_CallList %d\n", list);
/* mesa_print_display_list( list ); */
@@ -4858,7 +5113,25 @@ _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists )
GLboolean save_compile_flag;
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "_mesa_CallLists %d\n", n);
+ _mesa_debug(ctx, "_mesa_CallLists %d\n", n);
+
+ switch (type) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ case GL_2_BYTES:
+ case GL_3_BYTES:
+ case GL_4_BYTES:
+ /* OK */
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glCallLists(type)");
+ return;
+ }
/* Save the CompileFlag status, turn it off, execute display list,
* and restore the CompileFlag.
@@ -5526,6 +5799,26 @@ static void exec_FogCoordPointerEXT(GLenum type, GLsizei stride,
ctx->Exec->FogCoordPointerEXT( type, stride, ptr);
}
+/* GL_EXT_multi_draw_arrays */
+static void exec_MultiDrawArraysEXT(GLenum mode, GLint *first,
+ GLsizei *count, GLsizei primcount)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ ctx->Exec->MultiDrawArraysEXT( mode, first, count, primcount );
+}
+
+/* GL_EXT_multi_draw_arrays */
+static void exec_MultiDrawElementsEXT(GLenum mode, const GLsizei *count,
+ GLenum type, const GLvoid **indices,
+ GLsizei primcount)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ ctx->Exec->MultiDrawElementsEXT(mode, count, type, indices, primcount);
+}
+
+
/*
* Assign all the pointers in <table> to point to Mesa's display list
@@ -5721,6 +6014,7 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
/* GL 1.1 */
table->AreTexturesResident = exec_AreTexturesResident;
+ table->AreTexturesResidentEXT = exec_AreTexturesResident;
table->BindTexture = save_BindTexture;
table->ColorPointer = exec_ColorPointer;
table->CopyTexImage1D = save_CopyTexImage1D;
@@ -5732,10 +6026,12 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
table->EdgeFlagPointer = exec_EdgeFlagPointer;
table->EnableClientState = exec_EnableClientState;
table->GenTextures = exec_GenTextures;
+ table->GenTexturesEXT = exec_GenTextures;
table->GetPointerv = exec_GetPointerv;
table->IndexPointer = exec_IndexPointer;
table->InterleavedArrays = exec_InterleavedArrays;
table->IsTexture = exec_IsTexture;
+ table->IsTextureEXT = exec_IsTexture;
table->NormalPointer = exec_NormalPointer;
table->PopClientAttrib = exec_PopClientAttrib;
table->PrioritizeTextures = save_PrioritizeTextures;
@@ -5769,18 +6065,31 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
table->CopyConvolutionFilter1D = exec_CopyConvolutionFilter1D;
table->CopyConvolutionFilter2D = exec_CopyConvolutionFilter2D;
table->GetColorTable = exec_GetColorTable;
+ table->GetColorTableEXT = exec_GetColorTable;
table->GetColorTableParameterfv = exec_GetColorTableParameterfv;
+ table->GetColorTableParameterfvEXT = exec_GetColorTableParameterfv;
table->GetColorTableParameteriv = exec_GetColorTableParameteriv;
+ table->GetColorTableParameterivEXT = exec_GetColorTableParameteriv;
table->GetConvolutionFilter = exec_GetConvolutionFilter;
+ table->GetConvolutionFilterEXT = exec_GetConvolutionFilter;
table->GetConvolutionParameterfv = exec_GetConvolutionParameterfv;
+ table->GetConvolutionParameterfvEXT = exec_GetConvolutionParameterfv;
table->GetConvolutionParameteriv = exec_GetConvolutionParameteriv;
+ table->GetConvolutionParameterivEXT = exec_GetConvolutionParameteriv;
table->GetHistogram = exec_GetHistogram;
+ table->GetHistogramEXT = exec_GetHistogram;
table->GetHistogramParameterfv = exec_GetHistogramParameterfv;
+ table->GetHistogramParameterfvEXT = exec_GetHistogramParameterfv;
table->GetHistogramParameteriv = exec_GetHistogramParameteriv;
+ table->GetHistogramParameterivEXT = exec_GetHistogramParameteriv;
table->GetMinmax = exec_GetMinmax;
+ table->GetMinmaxEXT = exec_GetMinmax;
table->GetMinmaxParameterfv = exec_GetMinmaxParameterfv;
+ table->GetMinmaxParameterfvEXT = exec_GetMinmaxParameterfv;
table->GetMinmaxParameteriv = exec_GetMinmaxParameteriv;
+ table->GetMinmaxParameterivEXT = exec_GetMinmaxParameteriv;
table->GetSeparableFilter = exec_GetSeparableFilter;
+ table->GetSeparableFilterEXT = exec_GetSeparableFilter;
table->Histogram = save_Histogram;
table->Minmax = save_Minmax;
table->ResetHistogram = save_ResetHistogram;
@@ -5843,14 +6152,23 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
table->LockArraysEXT = exec_LockArraysEXT;
table->UnlockArraysEXT = exec_UnlockArraysEXT;
- /* GL_ARB_multitexture */
- table->ActiveTextureARB = save_ActiveTextureARB;
- table->ClientActiveTextureARB = exec_ClientActiveTextureARB;
+ /* 145. GL_EXT_secondary_color */
+ table->SecondaryColorPointerEXT = exec_SecondaryColorPointerEXT;
+
+ /* 148. GL_EXT_multi_draw_arrays */
+ table->MultiDrawArraysEXT = exec_MultiDrawArraysEXT;
+ table->MultiDrawElementsEXT = exec_MultiDrawElementsEXT;
- /* GL_EXT_blend_func_separate */
+ /* 149. GL_EXT_fog_coord */
+ table->FogCoordPointerEXT = exec_FogCoordPointerEXT;
+
+ /* 173. GL_EXT_blend_func_separate */
table->BlendFuncSeparateEXT = save_BlendFuncSeparateEXT;
- /* GL_MESA_window_pos */
+ /* 196. GL_MESA_resize_buffers */
+ table->ResizeBuffersMESA = exec_ResizeBuffersMESA;
+
+ /* 197. GL_MESA_window_pos */
table->WindowPos2dMESA = save_WindowPos2dMESA;
table->WindowPos2dvMESA = save_WindowPos2dvMESA;
table->WindowPos2fMESA = save_WindowPos2fMESA;
@@ -5876,16 +6194,57 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
table->WindowPos4sMESA = save_WindowPos4sMESA;
table->WindowPos4svMESA = save_WindowPos4svMESA;
- /* GL_MESA_resize_buffers */
- table->ResizeBuffersMESA = exec_ResizeBuffersMESA;
+#if FEATURE_NV_vertex_program
+ /* 233. GL_NV_vertex_program */
+ /* The following commands DO NOT go into display lists:
+ * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
+ * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
+ */
+ table->BindProgramNV = save_BindProgramNV;
+ table->DeleteProgramsNV = _mesa_DeleteProgramsNV;
+ table->ExecuteProgramNV = save_ExecuteProgramNV;
+ table->GenProgramsNV = _mesa_GenProgramsNV;
+ table->AreProgramsResidentNV = _mesa_AreProgramsResidentNV;
+ table->RequestResidentProgramsNV = _mesa_RequestResidentProgramsNV;
+ table->GetProgramParameterfvNV = _mesa_GetProgramParameterfvNV;
+ table->GetProgramParameterdvNV = _mesa_GetProgramParameterdvNV;
+ table->GetProgramivNV = _mesa_GetProgramivNV;
+ table->GetProgramStringNV = _mesa_GetProgramStringNV;
+ table->GetTrackMatrixivNV = _mesa_GetTrackMatrixivNV;
+ table->GetVertexAttribdvNV = _mesa_GetVertexAttribdvNV;
+ table->GetVertexAttribfvNV = _mesa_GetVertexAttribfvNV;
+ table->GetVertexAttribivNV = _mesa_GetVertexAttribivNV;
+ table->GetVertexAttribPointervNV = _mesa_GetVertexAttribPointervNV;
+ table->IsProgramNV = _mesa_IsProgramNV;
+ table->LoadProgramNV = _mesa_LoadProgramNV;
+ table->ProgramParameter4dNV = save_ProgramParameter4dNV;
+ table->ProgramParameter4dvNV = save_ProgramParameter4dvNV;
+ table->ProgramParameter4fNV = save_ProgramParameter4fNV;
+ table->ProgramParameter4fvNV = save_ProgramParameter4fvNV;
+ table->ProgramParameters4dvNV = save_ProgramParameters4dvNV;
+ table->ProgramParameters4fvNV = save_ProgramParameters4fvNV;
+ table->TrackMatrixNV = save_TrackMatrixNV;
+ table->VertexAttribPointerNV = _mesa_VertexAttribPointerNV;
+#endif
+
+ /* 262. GL_NV_point_sprite */
+ table->PointParameteriNV = save_PointParameteriNV;
+ table->PointParameterivNV = save_PointParameterivNV;
+
+ /* 268. GL_EXT_stencil_two_side */
+ table->ActiveStencilFaceEXT = save_ActiveStencilFaceEXT;
- /* GL_ARB_transpose_matrix */
+ /* ARB 1. GL_ARB_multitexture */
+ table->ActiveTextureARB = save_ActiveTextureARB;
+ table->ClientActiveTextureARB = exec_ClientActiveTextureARB;
+
+ /* ARB 3. GL_ARB_transpose_matrix */
table->LoadTransposeMatrixdARB = save_LoadTransposeMatrixdARB;
table->LoadTransposeMatrixfARB = save_LoadTransposeMatrixfARB;
table->MultTransposeMatrixdARB = save_MultTransposeMatrixdARB;
table->MultTransposeMatrixfARB = save_MultTransposeMatrixfARB;
- /* GL_ARB_multisample */
+ /* ARB 5. GL_ARB_multisample */
table->SampleCoverageARB = save_SampleCoverageARB;
/* ARB 12. GL_ARB_texture_compression */
@@ -5897,11 +6256,11 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
table->CompressedTexSubImage1DARB = save_CompressedTexSubImage1DARB;
table->GetCompressedTexImageARB = exec_GetCompressedTexImageARB;
- /* GL_EXT_secondary_color */
- table->SecondaryColorPointerEXT = exec_SecondaryColorPointerEXT;
+ /* ARB 14. GL_ARB_point_parameters */
+ /* re-use EXT_point_parameters functions */
- /* GL_EXT_fog_coord */
- table->FogCoordPointerEXT = exec_FogCoordPointerEXT;
+ /* ARB 25. GL_ARB_window_pos */
+ /* re-use MESA_window_pos functions */
}
@@ -5919,19 +6278,19 @@ static const char *enum_string( GLenum k )
* Print the commands in a display list. For debugging only.
* TODO: many commands aren't handled yet.
*/
-static void print_list( GLcontext *ctx, FILE *f, GLuint list )
+static void print_list( GLcontext *ctx, GLuint list )
{
Node *n;
GLboolean done;
if (!glIsList(list)) {
- fprintf(f,"%u is not a display list ID\n",list);
+ _mesa_printf("%u is not a display list ID\n", list);
return;
}
n = (Node *) _mesa_HashLookup(ctx->Shared->DisplayList, list);
- fprintf( f, "START-LIST %u, address %p\n", list, (void*)n );
+ _mesa_printf("START-LIST %u, address %p\n", list, (void*)n );
done = n ? GL_FALSE : GL_TRUE;
while (!done) {
@@ -5945,149 +6304,162 @@ static void print_list( GLcontext *ctx, FILE *f, GLuint list )
else {
switch (opcode) {
case OPCODE_ACCUM:
- fprintf(f,"accum %s %g\n", enum_string(n[1].e), n[2].f );
+ _mesa_printf("accum %s %g\n", enum_string(n[1].e), n[2].f );
break;
case OPCODE_BITMAP:
- fprintf(f,"Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i,
+ _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i,
n[3].f, n[4].f, n[5].f, n[6].f, (void *) n[7].data );
break;
case OPCODE_CALL_LIST:
- fprintf(f,"CallList %d\n", (int) n[1].ui );
+ _mesa_printf("CallList %d\n", (int) n[1].ui );
break;
case OPCODE_CALL_LIST_OFFSET:
- fprintf(f,"CallList %d + offset %u = %u\n", (int) n[1].ui,
+ _mesa_printf("CallList %d + offset %u = %u\n", (int) n[1].ui,
ctx->List.ListBase, ctx->List.ListBase + n[1].ui );
break;
case OPCODE_COLOR_TABLE_PARAMETER_FV:
- fprintf(f,"ColorTableParameterfv %s %s %f %f %f %f\n",
+ _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
enum_string(n[1].e), enum_string(n[2].e),
n[3].f, n[4].f, n[5].f, n[6].f);
break;
case OPCODE_COLOR_TABLE_PARAMETER_IV:
- fprintf(f,"ColorTableParameteriv %s %s %d %d %d %d\n",
+ _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
enum_string(n[1].e), enum_string(n[2].e),
n[3].i, n[4].i, n[5].i, n[6].i);
break;
case OPCODE_DISABLE:
- fprintf(f,"Disable %s\n", enum_string(n[1].e));
+ _mesa_printf("Disable %s\n", enum_string(n[1].e));
break;
case OPCODE_ENABLE:
- fprintf(f,"Enable %s\n", enum_string(n[1].e));
+ _mesa_printf("Enable %s\n", enum_string(n[1].e));
break;
case OPCODE_FRUSTUM:
- fprintf(f,"Frustum %g %g %g %g %g %g\n",
+ _mesa_printf("Frustum %g %g %g %g %g %g\n",
n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f );
break;
case OPCODE_LINE_STIPPLE:
- fprintf(f,"LineStipple %d %x\n", n[1].i, (int) n[2].us );
+ _mesa_printf("LineStipple %d %x\n", n[1].i, (int) n[2].us );
break;
case OPCODE_LOAD_IDENTITY:
- fprintf(f,"LoadIdentity\n");
+ _mesa_printf("LoadIdentity\n");
break;
case OPCODE_LOAD_MATRIX:
- fprintf(f,"LoadMatrix\n");
- fprintf(f," %8f %8f %8f %8f\n", n[1].f, n[5].f, n[9].f, n[13].f);
- fprintf(f," %8f %8f %8f %8f\n", n[2].f, n[6].f, n[10].f, n[14].f);
- fprintf(f," %8f %8f %8f %8f\n", n[3].f, n[7].f, n[11].f, n[15].f);
- fprintf(f," %8f %8f %8f %8f\n", n[4].f, n[8].f, n[12].f, n[16].f);
+ _mesa_printf("LoadMatrix\n");
+ _mesa_printf(" %8f %8f %8f %8f\n",
+ n[1].f, n[5].f, n[9].f, n[13].f);
+ _mesa_printf(" %8f %8f %8f %8f\n",
+ n[2].f, n[6].f, n[10].f, n[14].f);
+ _mesa_printf(" %8f %8f %8f %8f\n",
+ n[3].f, n[7].f, n[11].f, n[15].f);
+ _mesa_printf(" %8f %8f %8f %8f\n",
+ n[4].f, n[8].f, n[12].f, n[16].f);
break;
case OPCODE_MULT_MATRIX:
- fprintf(f,"MultMatrix (or Rotate)\n");
- fprintf(f," %8f %8f %8f %8f\n", n[1].f, n[5].f, n[9].f, n[13].f);
- fprintf(f," %8f %8f %8f %8f\n", n[2].f, n[6].f, n[10].f, n[14].f);
- fprintf(f," %8f %8f %8f %8f\n", n[3].f, n[7].f, n[11].f, n[15].f);
- fprintf(f," %8f %8f %8f %8f\n", n[4].f, n[8].f, n[12].f, n[16].f);
+ _mesa_printf("MultMatrix (or Rotate)\n");
+ _mesa_printf(" %8f %8f %8f %8f\n",
+ n[1].f, n[5].f, n[9].f, n[13].f);
+ _mesa_printf(" %8f %8f %8f %8f\n",
+ n[2].f, n[6].f, n[10].f, n[14].f);
+ _mesa_printf(" %8f %8f %8f %8f\n",
+ n[3].f, n[7].f, n[11].f, n[15].f);
+ _mesa_printf(" %8f %8f %8f %8f\n",
+ n[4].f, n[8].f, n[12].f, n[16].f);
break;
case OPCODE_ORTHO:
- fprintf(f,"Ortho %g %g %g %g %g %g\n",
+ _mesa_printf("Ortho %g %g %g %g %g %g\n",
n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f );
break;
case OPCODE_POP_ATTRIB:
- fprintf(f,"PopAttrib\n");
+ _mesa_printf("PopAttrib\n");
break;
case OPCODE_POP_MATRIX:
- fprintf(f,"PopMatrix\n");
+ _mesa_printf("PopMatrix\n");
break;
case OPCODE_POP_NAME:
- fprintf(f,"PopName\n");
+ _mesa_printf("PopName\n");
break;
case OPCODE_PUSH_ATTRIB:
- fprintf(f,"PushAttrib %x\n", n[1].bf );
+ _mesa_printf("PushAttrib %x\n", n[1].bf );
break;
case OPCODE_PUSH_MATRIX:
- fprintf(f,"PushMatrix\n");
+ _mesa_printf("PushMatrix\n");
break;
case OPCODE_PUSH_NAME:
- fprintf(f,"PushName %d\n", (int) n[1].ui );
+ _mesa_printf("PushName %d\n", (int) n[1].ui );
break;
case OPCODE_RASTER_POS:
- fprintf(f,"RasterPos %g %g %g %g\n", n[1].f, n[2].f,n[3].f,n[4].f);
+ _mesa_printf("RasterPos %g %g %g %g\n",
+ n[1].f, n[2].f,n[3].f,n[4].f);
break;
case OPCODE_ROTATE:
- fprintf(f,"Rotate %g %g %g %g\n", n[1].f, n[2].f, n[3].f, n[4].f );
+ _mesa_printf("Rotate %g %g %g %g\n",
+ n[1].f, n[2].f, n[3].f, n[4].f );
break;
case OPCODE_SCALE:
- fprintf(f,"Scale %g %g %g\n", n[1].f, n[2].f, n[3].f );
+ _mesa_printf("Scale %g %g %g\n", n[1].f, n[2].f, n[3].f );
break;
case OPCODE_TRANSLATE:
- fprintf(f,"Translate %g %g %g\n", n[1].f, n[2].f, n[3].f );
+ _mesa_printf("Translate %g %g %g\n", n[1].f, n[2].f, n[3].f );
break;
case OPCODE_BIND_TEXTURE:
- fprintf(f,"BindTexture %s %d\n", _mesa_lookup_enum_by_nr(n[1].ui),
- n[2].ui);
+ _mesa_printf("BindTexture %s %d\n",
+ _mesa_lookup_enum_by_nr(n[1].ui), n[2].ui);
break;
case OPCODE_SHADE_MODEL:
- fprintf(f,"ShadeModel %s\n", _mesa_lookup_enum_by_nr(n[1].ui));
+ _mesa_printf("ShadeModel %s\n",
+ _mesa_lookup_enum_by_nr(n[1].ui));
break;
case OPCODE_MAP1:
- fprintf(f,"Map1 %s %.3f %.3f %d %d\n",
+ _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
_mesa_lookup_enum_by_nr(n[1].ui),
n[2].f, n[3].f, n[4].i, n[5].i);
break;
case OPCODE_MAP2:
- fprintf(f,"Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
- _mesa_lookup_enum_by_nr(n[1].ui),
- n[2].f, n[3].f, n[4].f, n[5].f,
- n[6].i, n[7].i, n[8].i, n[9].i);
+ _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
+ _mesa_lookup_enum_by_nr(n[1].ui),
+ n[2].f, n[3].f, n[4].f, n[5].f,
+ n[6].i, n[7].i, n[8].i, n[9].i);
break;
case OPCODE_MAPGRID1:
- fprintf(f,"MapGrid1 %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f);
+ _mesa_printf("MapGrid1 %d %.3f %.3f\n",
+ n[1].i, n[2].f, n[3].f);
break;
case OPCODE_MAPGRID2:
- fprintf(f,"MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
- n[1].i, n[2].f, n[3].f,
- n[4].i, n[5].f, n[6].f);
+ _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
+ n[1].i, n[2].f, n[3].f,
+ n[4].i, n[5].f, n[6].f);
break;
case OPCODE_EVALMESH1:
- fprintf(f,"EvalMesh1 %d %d\n", n[1].i, n[2].i);
+ _mesa_printf("EvalMesh1 %d %d\n", n[1].i, n[2].i);
break;
case OPCODE_EVALMESH2:
- fprintf(f,"EvalMesh2 %d %d %d %d\n",
- n[1].i, n[2].i, n[3].i, n[4].i);
+ _mesa_printf("EvalMesh2 %d %d %d %d\n",
+ n[1].i, n[2].i, n[3].i, n[4].i);
break;
/*
* meta opcodes/commands
*/
case OPCODE_ERROR:
- fprintf(f,"Error: %s %s\n", enum_string(n[1].e), (const char *)n[2].data );
+ _mesa_printf("Error: %s %s\n",
+ enum_string(n[1].e), (const char *)n[2].data );
break;
case OPCODE_CONTINUE:
- fprintf(f,"DISPLAY-LIST-CONTINUE\n");
+ _mesa_printf("DISPLAY-LIST-CONTINUE\n");
n = (Node *) n[1].next;
break;
case OPCODE_END_OF_LIST:
- fprintf(f,"END-LIST %u\n", list);
+ _mesa_printf("END-LIST %u\n", list);
done = GL_TRUE;
break;
default:
if (opcode < 0 || opcode > OPCODE_END_OF_LIST) {
- fprintf(f,"ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
- opcode, (void*) n);
+ _mesa_printf("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
+ opcode, (void*) n);
return;
}
else {
- fprintf(f,"command %d, %u operands\n",opcode,InstSize[opcode]);
+ _mesa_printf("command %d, %u operands\n", opcode, InstSize[opcode]);
}
}
/* increment n to point to next compiled command */
@@ -6108,5 +6480,5 @@ static void print_list( GLcontext *ctx, FILE *f, GLuint list )
void mesa_print_display_list( GLuint list )
{
GET_CURRENT_CONTEXT(ctx);
- print_list( ctx, stderr, list );
+ print_list( ctx, list );
}
diff --git a/xc/extras/Mesa/src/dlist.h b/xc/extras/Mesa/src/dlist.h
index 58bbd7e42..9880aa079 100644
--- a/xc/extras/Mesa/src/dlist.h
+++ b/xc/extras/Mesa/src/dlist.h
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
@@ -82,19 +82,20 @@ extern void _mesa_ListBase( GLuint base );
extern void _mesa_NewList( GLuint list, GLenum mode );
-extern void _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize );
+extern void _mesa_init_dlist_table( struct _glapi_table *table,
+ GLuint tableSize );
extern void _mesa_save_error( GLcontext *ctx, GLenum error, const char *s );
+extern void _mesa_compile_error( GLcontext *ctx, GLenum error, const char *s );
-void *
-_mesa_alloc_instruction( GLcontext *ctx, int opcode, GLint sz );
-int
-_mesa_alloc_opcode( GLcontext *ctx, GLuint sz,
- void (*execute)( GLcontext *, void * ),
- void (*destroy)( GLcontext *, void * ),
- void (*print)( GLcontext *, void * ) );
+extern void *_mesa_alloc_instruction( GLcontext *ctx, int opcode, GLint sz );
+
+extern int _mesa_alloc_opcode( GLcontext *ctx, GLuint sz,
+ void (*execute)( GLcontext *, void * ),
+ void (*destroy)( GLcontext *, void * ),
+ void (*print)( GLcontext *, void * ) );
extern void _mesa_save_EvalMesh2(GLenum mode, GLint i1, GLint i2,
GLint j1, GLint j2 );
diff --git a/xc/extras/Mesa/src/drawpix.c b/xc/extras/Mesa/src/drawpix.c
index 45b0dfabd..3601a3ed8 100644
--- a/xc/extras/Mesa/src/drawpix.c
+++ b/xc/extras/Mesa/src/drawpix.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.1
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -23,22 +23,16 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "colormac.h"
#include "context.h"
#include "drawpix.h"
#include "feedback.h"
#include "macros.h"
-#include "mem.h"
#include "mmath.h"
#include "state.h"
#include "mtypes.h"
-#endif
-
/*
@@ -75,14 +69,15 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
&ctx->Unpack, pixels);
}
else if (ctx->RenderMode==GL_FEEDBACK) {
+ /* Feedback the current raster pos info */
if (ctx->Current.RasterPosValid) {
- FLUSH_CURRENT(ctx, 0);
+ FLUSH_CURRENT( ctx, 0 );
FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN );
_mesa_feedback_vertex( ctx,
ctx->Current.RasterPos,
ctx->Current.RasterColor,
- ctx->Current.RasterIndex,
- ctx->Current.RasterTexCoord );
+ ctx->Current.RasterIndex,
+ ctx->Current.RasterTexCoords[0] );
}
}
else if (ctx->RenderMode==GL_SELECT) {
@@ -102,7 +97,8 @@ _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (width < 0 || height < 0) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glReadPixels(width or height < 0)" );
+ _mesa_error( ctx, GL_INVALID_VALUE,
+ "glReadPixels(width=%d height=%d)", width, height );
return;
}
@@ -116,7 +112,6 @@ _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
ctx->Driver.ReadPixels(ctx, x, y, width, height,
format, type, &ctx->Pack, pixels);
-
}
@@ -155,13 +150,13 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
}
else if (ctx->RenderMode == GL_FEEDBACK) {
if (ctx->Current.RasterPosValid) {
- FLUSH_CURRENT(ctx, 0);
+ FLUSH_CURRENT( ctx, 0 );
FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_COPY_PIXEL_TOKEN );
- _mesa_feedback_vertex( ctx,
- ctx->Current.RasterPos,
- ctx->Current.RasterColor,
- ctx->Current.RasterIndex,
- ctx->Current.RasterTexCoord );
+ _mesa_feedback_vertex( ctx,
+ ctx->Current.RasterPos,
+ ctx->Current.RasterColor,
+ ctx->Current.RasterIndex,
+ ctx->Current.RasterTexCoords[0] );
}
}
else if (ctx->RenderMode == GL_SELECT) {
@@ -210,7 +205,7 @@ _mesa_Bitmap( GLsizei width, GLsizei height,
ctx->Current.RasterPos,
ctx->Current.RasterColor,
ctx->Current.RasterIndex,
- ctx->Current.RasterTexCoord );
+ ctx->Current.RasterTexCoords[0] );
}
}
else if (ctx->RenderMode==GL_SELECT) {
@@ -221,3 +216,68 @@ _mesa_Bitmap( GLsizei width, GLsizei height,
ctx->Current.RasterPos[0] += xmove;
ctx->Current.RasterPos[1] += ymove;
}
+
+
+
+#if 0 /* experimental */
+/*
+ * Execute glDrawDepthPixelsMESA(). This function accepts both a color
+ * image and depth (Z) image. Rasterization produces fragments with
+ * color and Z taken from these images. This function is intended for
+ * Z-compositing. Normally, this operation requires two glDrawPixels
+ * calls with stencil testing.
+ */
+void
+_mesa_DrawDepthPixelsMESA( GLsizei width, GLsizei height,
+ GLenum colorFormat, GLenum colorType,
+ const GLvoid *colors,
+ GLenum depthType, const GLvoid *depths )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (width < 0 || height < 0) {
+ _mesa_error( ctx, GL_INVALID_VALUE,
+ "glDrawDepthPixelsMESA(width or height < 0" );
+ return;
+ }
+
+ if (ctx->RenderMode==GL_RENDER) {
+ GLint x, y;
+ if (!colors || !depths || !ctx->Current.RasterPosValid) {
+ return;
+ }
+
+ if (ctx->NewState) {
+ _mesa_update_state(ctx);
+ }
+
+ /* Round, to satisfy conformance tests (matches SGI's OpenGL) */
+ x = IROUND(ctx->Current.RasterPos[0]);
+ y = IROUND(ctx->Current.RasterPos[1]);
+
+ ctx->OcclusionResult = GL_TRUE;
+ ctx->Driver.DrawDepthPixelsMESA(ctx, x, y, width, height,
+ colorFormat, colorType, colors,
+ depthType, depths, &ctx->Unpack);
+ }
+ else if (ctx->RenderMode==GL_FEEDBACK) {
+ /* Feedback the current raster pos info */
+ if (ctx->Current.RasterPosValid) {
+ FLUSH_CURRENT( ctx, 0 );
+ FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN );
+ _mesa_feedback_vertex( ctx,
+ ctx->Current.RasterPos,
+ ctx->Current.RasterColor,
+ ctx->Current.RasterIndex,
+ ctx->Current.RasterTexCoords[0] );
+ }
+ }
+ else if (ctx->RenderMode==GL_SELECT) {
+ if (ctx->Current.RasterPosValid) {
+ _mesa_update_hitflag( ctx, ctx->Current.RasterPos[2] );
+ }
+ }
+}
+
+#endif
diff --git a/xc/extras/Mesa/src/enable.c b/xc/extras/Mesa/src/enable.c
index 7be8dbf44..2f8f4dab1 100644
--- a/xc/extras/Mesa/src/enable.c
+++ b/xc/extras/Mesa/src/enable.c
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.4
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -24,9 +24,6 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "context.h"
#include "enable.h"
@@ -36,55 +33,90 @@
#include "simple_list.h"
#include "mtypes.h"
#include "enums.h"
-
#include "math/m_matrix.h"
#include "math/m_xform.h"
-#endif
+
+
+#define CHECK_EXTENSION(EXTNAME, CAP) \
+ if (!ctx->Extensions.EXTNAME) { \
+ _mesa_error(ctx, GL_INVALID_ENUM, "gl%sClientState(0x%x)", \
+ state ? "Enable" : "Disable", CAP); \
+ return; \
+ }
+
static void
client_state( GLcontext *ctx, GLenum cap, GLboolean state )
{
GLuint flag;
- GLboolean *var;
+ GLuint *var;
switch (cap) {
- case GL_VERTEX_ARRAY:
- var = &ctx->Array.Vertex.Enabled;
- flag = _NEW_ARRAY_VERTEX;
- break;
- case GL_NORMAL_ARRAY:
- var = &ctx->Array.Normal.Enabled;
- flag = _NEW_ARRAY_NORMAL;
- break;
- case GL_COLOR_ARRAY:
- var = &ctx->Array.Color.Enabled;
- flag = _NEW_ARRAY_COLOR;
- break;
- case GL_INDEX_ARRAY:
- var = &ctx->Array.Index.Enabled;
- flag = _NEW_ARRAY_INDEX;
- break;
- case GL_TEXTURE_COORD_ARRAY:
- var = &ctx->Array.TexCoord[ctx->Array.ActiveTexture].Enabled;
- flag = _NEW_ARRAY_TEXCOORD(ctx->Array.ActiveTexture);
- break;
- case GL_EDGE_FLAG_ARRAY:
- var = &ctx->Array.EdgeFlag.Enabled;
- flag = _NEW_ARRAY_EDGEFLAG;
- break;
- case GL_FOG_COORDINATE_ARRAY_EXT:
- var = &ctx->Array.FogCoord.Enabled;
- flag = _NEW_ARRAY_FOGCOORD;
- break;
- case GL_SECONDARY_COLOR_ARRAY_EXT:
- var = &ctx->Array.SecondaryColor.Enabled;
- flag = _NEW_ARRAY_SECONDARYCOLOR;
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glEnable/DisableClientState" );
- return;
+ case GL_VERTEX_ARRAY:
+ var = &ctx->Array.Vertex.Enabled;
+ flag = _NEW_ARRAY_VERTEX;
+ break;
+ case GL_NORMAL_ARRAY:
+ var = &ctx->Array.Normal.Enabled;
+ flag = _NEW_ARRAY_NORMAL;
+ break;
+ case GL_COLOR_ARRAY:
+ var = &ctx->Array.Color.Enabled;
+ flag = _NEW_ARRAY_COLOR0;
+ break;
+ case GL_INDEX_ARRAY:
+ var = &ctx->Array.Index.Enabled;
+ flag = _NEW_ARRAY_INDEX;
+ break;
+ case GL_TEXTURE_COORD_ARRAY:
+ var = &ctx->Array.TexCoord[ctx->Array.ActiveTexture].Enabled;
+ flag = _NEW_ARRAY_TEXCOORD(ctx->Array.ActiveTexture);
+ break;
+ case GL_EDGE_FLAG_ARRAY:
+ var = &ctx->Array.EdgeFlag.Enabled;
+ flag = _NEW_ARRAY_EDGEFLAG;
+ break;
+ case GL_FOG_COORDINATE_ARRAY_EXT:
+ var = &ctx->Array.FogCoord.Enabled;
+ flag = _NEW_ARRAY_FOGCOORD;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_EXT:
+ var = &ctx->Array.SecondaryColor.Enabled;
+ flag = _NEW_ARRAY_COLOR1;
+ break;
+
+#if FEATURE_NV_vertex_program
+ case GL_VERTEX_ATTRIB_ARRAY0_NV:
+ case GL_VERTEX_ATTRIB_ARRAY1_NV:
+ case GL_VERTEX_ATTRIB_ARRAY2_NV:
+ case GL_VERTEX_ATTRIB_ARRAY3_NV:
+ case GL_VERTEX_ATTRIB_ARRAY4_NV:
+ case GL_VERTEX_ATTRIB_ARRAY5_NV:
+ case GL_VERTEX_ATTRIB_ARRAY6_NV:
+ case GL_VERTEX_ATTRIB_ARRAY7_NV:
+ case GL_VERTEX_ATTRIB_ARRAY8_NV:
+ case GL_VERTEX_ATTRIB_ARRAY9_NV:
+ case GL_VERTEX_ATTRIB_ARRAY10_NV:
+ case GL_VERTEX_ATTRIB_ARRAY11_NV:
+ case GL_VERTEX_ATTRIB_ARRAY12_NV:
+ case GL_VERTEX_ATTRIB_ARRAY13_NV:
+ case GL_VERTEX_ATTRIB_ARRAY14_NV:
+ case GL_VERTEX_ATTRIB_ARRAY15_NV:
+ CHECK_EXTENSION(NV_vertex_program, cap);
+ {
+ GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV;
+ var = &ctx->Array.VertexAttrib[n].Enabled;
+ flag = _NEW_ARRAY_ATTRIB(n);
+ }
+ break;
+#endif /* FEATURE_NV_vertex_program */
+
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM,
+ "glEnable/DisableClientState(0x%x)", cap);
+ return;
}
if (*var == state)
@@ -125,709 +157,731 @@ _mesa_DisableClientState( GLenum cap )
}
+#undef CHECK_EXTENSION
+#define CHECK_EXTENSION(EXTNAME, CAP) \
+ if (!ctx->Extensions.EXTNAME) { \
+ _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(0x%x)", \
+ state ? "Enable" : "Disable", CAP); \
+ return; \
+ }
+
+
/*
* Perform glEnable and glDisable calls.
*/
void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
{
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "%s %s (newstate is %x)\n",
- state ? "glEnable" : "glDisable",
- _mesa_lookup_enum_by_nr(cap),
- ctx->NewState);
+ _mesa_debug(ctx, "%s %s (newstate is %x)\n",
+ state ? "glEnable" : "glDisable",
+ _mesa_lookup_enum_by_nr(cap),
+ ctx->NewState);
switch (cap) {
- case GL_ALPHA_TEST:
- if (ctx->Color.AlphaEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_COLOR);
- ctx->Color.AlphaEnabled = state;
- break;
- case GL_AUTO_NORMAL:
- if (ctx->Eval.AutoNormal == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.AutoNormal = state;
- break;
- case GL_BLEND:
- if (ctx->Color.BlendEnabled == state)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_COLOR);
- ctx->Color.BlendEnabled = state;
- /* The following needed to accomodate 1.0 RGB logic op blending */
- ctx->Color.ColorLogicOpEnabled =
- (ctx->Color.BlendEquation == GL_LOGIC_OP && state);
- break;
- case GL_CLIP_PLANE0:
- case GL_CLIP_PLANE1:
- case GL_CLIP_PLANE2:
- case GL_CLIP_PLANE3:
- case GL_CLIP_PLANE4:
- case GL_CLIP_PLANE5: {
- GLuint p = cap-GL_CLIP_PLANE0;
-
- if (ctx->Transform.ClipEnabled[p] == state)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
- ctx->Transform.ClipEnabled[p] = state;
-
- if (state) {
- ctx->Transform._AnyClip++;
-
- if (ctx->ProjectionMatrix.flags & MAT_DIRTY) {
- _math_matrix_analyse( &ctx->ProjectionMatrix );
- }
-
- /* This derived state also calculated in clip.c and
- * from _mesa_update_state() on changes to EyeUserPlane
- * and ctx->ProjectionMatrix respectively.
- */
- _mesa_transform_vector( ctx->Transform._ClipUserPlane[p],
- ctx->Transform.EyeUserPlane[p],
- ctx->ProjectionMatrix.inv );
+ case GL_ALPHA_TEST:
+ if (ctx->Color.AlphaEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+ ctx->Color.AlphaEnabled = state;
+ break;
+ case GL_AUTO_NORMAL:
+ if (ctx->Eval.AutoNormal == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.AutoNormal = state;
+ break;
+ case GL_BLEND:
+ if (ctx->Color.BlendEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+ ctx->Color.BlendEnabled = state;
+ /* The following needed to accomodate 1.0 RGB logic op blending */
+ ctx->Color.ColorLogicOpEnabled =
+ (ctx->Color.BlendEquation == GL_LOGIC_OP && state);
+ break;
+ case GL_CLIP_PLANE0:
+ case GL_CLIP_PLANE1:
+ case GL_CLIP_PLANE2:
+ case GL_CLIP_PLANE3:
+ case GL_CLIP_PLANE4:
+ case GL_CLIP_PLANE5:
+ {
+ const GLuint p = cap - GL_CLIP_PLANE0;
+
+ if ((ctx->Transform.ClipPlanesEnabled & (1 << p)) == ((GLuint) state << p))
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+
+ if (state) {
+ ctx->Transform.ClipPlanesEnabled |= (1 << p);
+
+ if (ctx->ProjectionMatrixStack.Top->flags & MAT_DIRTY)
+ _math_matrix_analyse( ctx->ProjectionMatrixStack.Top );
+
+ /* This derived state also calculated in clip.c and
+ * from _mesa_update_state() on changes to EyeUserPlane
+ * and ctx->ProjectionMatrix respectively.
+ */
+ _mesa_transform_vector( ctx->Transform._ClipUserPlane[p],
+ ctx->Transform.EyeUserPlane[p],
+ ctx->ProjectionMatrixStack.Top->inv );
+ }
+ else {
+ ctx->Transform.ClipPlanesEnabled &= ~(1 << p);
+ }
+ }
+ break;
+ case GL_COLOR_MATERIAL:
+ if (ctx->Light.ColorMaterialEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_LIGHT);
+ ctx->Light.ColorMaterialEnabled = state;
+ if (state) {
+ FLUSH_CURRENT(ctx, 0);
+ _mesa_update_color_material( ctx,
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
+ }
+ break;
+ case GL_CULL_FACE:
+ if (ctx->Polygon.CullFlag == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ ctx->Polygon.CullFlag = state;
+ break;
+ case GL_DEPTH_TEST:
+ if (state && ctx->Visual.depthBits==0) {
+ _mesa_warning(ctx,"glEnable(GL_DEPTH_TEST) but no depth buffer");
+ return;
+ }
+ if (ctx->Depth.Test==state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_DEPTH);
+ ctx->Depth.Test = state;
+ break;
+ case GL_DITHER:
+ if (ctx->NoDither) {
+ state = GL_FALSE; /* MESA_NO_DITHER env var */
+ }
+ if (ctx->Color.DitherFlag==state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+ ctx->Color.DitherFlag = state;
+ break;
+ case GL_FOG:
+ if (ctx->Fog.Enabled==state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_FOG);
+ ctx->Fog.Enabled = state;
+ break;
+ case GL_HISTOGRAM:
+ CHECK_EXTENSION(EXT_histogram, cap);
+ if (ctx->Pixel.HistogramEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.HistogramEnabled = state;
+ break;
+ case GL_LIGHT0:
+ case GL_LIGHT1:
+ case GL_LIGHT2:
+ case GL_LIGHT3:
+ case GL_LIGHT4:
+ case GL_LIGHT5:
+ case GL_LIGHT6:
+ case GL_LIGHT7:
+ if (ctx->Light.Light[cap-GL_LIGHT0].Enabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_LIGHT);
+ ctx->Light.Light[cap-GL_LIGHT0].Enabled = state;
+ if (state) {
+ insert_at_tail(&ctx->Light.EnabledList,
+ &ctx->Light.Light[cap-GL_LIGHT0]);
+ }
+ else {
+ remove_from_list(&ctx->Light.Light[cap-GL_LIGHT0]);
+ }
+ break;
+ case GL_LIGHTING:
+ if (ctx->Light.Enabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_LIGHT);
+ ctx->Light.Enabled = state;
+
+ if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
+ ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;
+ else
+ ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE;
+
+ if ((ctx->Light.Enabled &&
+ ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR)
+ || ctx->Fog.ColorSumEnabled)
+ ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR;
+ else
+ ctx->_TriangleCaps &= ~DD_SEPARATE_SPECULAR;
+
+ break;
+ case GL_LINE_SMOOTH:
+ if (ctx->Line.SmoothFlag == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_LINE);
+ ctx->Line.SmoothFlag = state;
+ ctx->_TriangleCaps ^= DD_LINE_SMOOTH;
+ break;
+ case GL_LINE_STIPPLE:
+ if (ctx->Line.StippleFlag == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_LINE);
+ ctx->Line.StippleFlag = state;
+ ctx->_TriangleCaps ^= DD_LINE_STIPPLE;
+ break;
+ case GL_INDEX_LOGIC_OP:
+ if (ctx->Color.IndexLogicOpEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+ ctx->Color.IndexLogicOpEnabled = state;
+ break;
+ case GL_COLOR_LOGIC_OP:
+ if (ctx->Color.ColorLogicOpEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+ ctx->Color.ColorLogicOpEnabled = state;
+ break;
+ case GL_MAP1_COLOR_4:
+ if (ctx->Eval.Map1Color4 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1Color4 = state;
+ break;
+ case GL_MAP1_INDEX:
+ if (ctx->Eval.Map1Index == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1Index = state;
+ break;
+ case GL_MAP1_NORMAL:
+ if (ctx->Eval.Map1Normal == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1Normal = state;
+ break;
+ case GL_MAP1_TEXTURE_COORD_1:
+ if (ctx->Eval.Map1TextureCoord1 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1TextureCoord1 = state;
+ break;
+ case GL_MAP1_TEXTURE_COORD_2:
+ if (ctx->Eval.Map1TextureCoord2 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1TextureCoord2 = state;
+ break;
+ case GL_MAP1_TEXTURE_COORD_3:
+ if (ctx->Eval.Map1TextureCoord3 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1TextureCoord3 = state;
+ break;
+ case GL_MAP1_TEXTURE_COORD_4:
+ if (ctx->Eval.Map1TextureCoord4 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1TextureCoord4 = state;
+ break;
+ case GL_MAP1_VERTEX_3:
+ if (ctx->Eval.Map1Vertex3 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1Vertex3 = state;
+ break;
+ case GL_MAP1_VERTEX_4:
+ if (ctx->Eval.Map1Vertex4 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1Vertex4 = state;
+ break;
+ case GL_MAP2_COLOR_4:
+ if (ctx->Eval.Map2Color4 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2Color4 = state;
+ break;
+ case GL_MAP2_INDEX:
+ if (ctx->Eval.Map2Index == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2Index = state;
+ break;
+ case GL_MAP2_NORMAL:
+ if (ctx->Eval.Map2Normal == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2Normal = state;
+ break;
+ case GL_MAP2_TEXTURE_COORD_1:
+ if (ctx->Eval.Map2TextureCoord1 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2TextureCoord1 = state;
+ break;
+ case GL_MAP2_TEXTURE_COORD_2:
+ if (ctx->Eval.Map2TextureCoord2 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2TextureCoord2 = state;
+ break;
+ case GL_MAP2_TEXTURE_COORD_3:
+ if (ctx->Eval.Map2TextureCoord3 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2TextureCoord3 = state;
+ break;
+ case GL_MAP2_TEXTURE_COORD_4:
+ if (ctx->Eval.Map2TextureCoord4 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2TextureCoord4 = state;
+ break;
+ case GL_MAP2_VERTEX_3:
+ if (ctx->Eval.Map2Vertex3 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2Vertex3 = state;
+ break;
+ case GL_MAP2_VERTEX_4:
+ if (ctx->Eval.Map2Vertex4 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2Vertex4 = state;
+ break;
+ case GL_MINMAX:
+ if (ctx->Pixel.MinMaxEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.MinMaxEnabled = state;
+ break;
+ case GL_NORMALIZE:
+ if (ctx->Transform.Normalize == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+ ctx->Transform.Normalize = state;
+ break;
+ case GL_POINT_SMOOTH:
+ if (ctx->Point.SmoothFlag==state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POINT);
+ ctx->Point.SmoothFlag = state;
+ ctx->_TriangleCaps ^= DD_POINT_SMOOTH;
+ break;
+ case GL_POLYGON_SMOOTH:
+ if (ctx->Polygon.SmoothFlag==state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ ctx->Polygon.SmoothFlag = state;
+ ctx->_TriangleCaps ^= DD_TRI_SMOOTH;
+ break;
+ case GL_POLYGON_STIPPLE:
+ if (ctx->Polygon.StippleFlag==state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ ctx->Polygon.StippleFlag = state;
+ ctx->_TriangleCaps ^= DD_TRI_STIPPLE;
+ break;
+ case GL_POLYGON_OFFSET_POINT:
+ if (ctx->Polygon.OffsetPoint==state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ ctx->Polygon.OffsetPoint = state;
+ break;
+ case GL_POLYGON_OFFSET_LINE:
+ if (ctx->Polygon.OffsetLine==state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ ctx->Polygon.OffsetLine = state;
+ break;
+ case GL_POLYGON_OFFSET_FILL:
+ /*case GL_POLYGON_OFFSET_EXT:*/
+ if (ctx->Polygon.OffsetFill==state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ ctx->Polygon.OffsetFill = state;
+ break;
+ case GL_RESCALE_NORMAL_EXT:
+ if (ctx->Transform.RescaleNormals == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+ ctx->Transform.RescaleNormals = state;
+ break;
+ case GL_SCISSOR_TEST:
+ if (ctx->Scissor.Enabled==state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_SCISSOR);
+ ctx->Scissor.Enabled = state;
+ break;
+ case GL_SHARED_TEXTURE_PALETTE_EXT:
+ if (ctx->Texture.SharedPalette == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ ctx->Texture.SharedPalette = state;
+ break;
+ case GL_STENCIL_TEST:
+ if (state && ctx->Visual.stencilBits==0) {
+ _mesa_warning(ctx,
+ "glEnable(GL_STENCIL_TEST) but no stencil buffer");
+ return;
+ }
+ if (ctx->Stencil.Enabled==state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_STENCIL);
+ ctx->Stencil.Enabled = state;
+ break;
+ case GL_TEXTURE_1D: {
+ const GLuint curr = ctx->Texture.CurrentUnit;
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
+ GLuint newenabled = texUnit->Enabled & ~TEXTURE_1D_BIT;
+ if (state)
+ newenabled |= TEXTURE_1D_BIT;
+ if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->Enabled = newenabled;
+ break;
}
- else {
- ctx->Transform._AnyClip--;
+ case GL_TEXTURE_2D: {
+ const GLuint curr = ctx->Texture.CurrentUnit;
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
+ GLuint newenabled = texUnit->Enabled & ~TEXTURE_2D_BIT;
+ if (state)
+ newenabled |= TEXTURE_2D_BIT;
+ if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->Enabled = newenabled;
+ break;
}
- }
- break;
- case GL_COLOR_MATERIAL:
- if (ctx->Light.ColorMaterialEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_LIGHT);
- ctx->Light.ColorMaterialEnabled = state;
- if (state) {
- FLUSH_CURRENT(ctx, 0);
- _mesa_update_color_material( ctx, ctx->Current.Color );
+ case GL_TEXTURE_3D: {
+ const GLuint curr = ctx->Texture.CurrentUnit;
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
+ GLuint newenabled = texUnit->Enabled & ~TEXTURE_3D_BIT;
+ if (state)
+ newenabled |= TEXTURE_3D_BIT;
+ if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->Enabled = newenabled;
+ break;
}
- break;
- case GL_CULL_FACE:
- if (ctx->Polygon.CullFlag == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
- ctx->Polygon.CullFlag = state;
- break;
- case GL_DEPTH_TEST:
- if (state && ctx->Visual.depthBits==0) {
- _mesa_warning(ctx,"glEnable(GL_DEPTH_TEST) but no depth buffer");
- return;
+ case GL_TEXTURE_GEN_Q: {
+ GLuint unit = ctx->Texture.CurrentUnit;
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ GLuint newenabled = texUnit->TexGenEnabled & ~Q_BIT;
+ if (state)
+ newenabled |= Q_BIT;
+ if (texUnit->TexGenEnabled == newenabled)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->TexGenEnabled = newenabled;
+ break;
}
- if (ctx->Depth.Test==state)
- return;
- FLUSH_VERTICES(ctx, _NEW_DEPTH);
- ctx->Depth.Test = state;
- break;
- case GL_DITHER:
- if (ctx->NoDither) {
- state = GL_FALSE; /* MESA_NO_DITHER env var */
+ case GL_TEXTURE_GEN_R: {
+ GLuint unit = ctx->Texture.CurrentUnit;
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ GLuint newenabled = texUnit->TexGenEnabled & ~R_BIT;
+ if (state)
+ newenabled |= R_BIT;
+ if (texUnit->TexGenEnabled == newenabled)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->TexGenEnabled = newenabled;
+ break;
}
- if (ctx->Color.DitherFlag==state)
- return;
- FLUSH_VERTICES(ctx, _NEW_COLOR);
- ctx->Color.DitherFlag = state;
- break;
- case GL_FOG:
- if (ctx->Fog.Enabled==state)
- return;
- FLUSH_VERTICES(ctx, _NEW_FOG);
- ctx->Fog.Enabled = state;
break;
- case GL_HISTOGRAM:
- if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glEnable(GL_HISTOGRAM)");
- return;
+ case GL_TEXTURE_GEN_S: {
+ GLuint unit = ctx->Texture.CurrentUnit;
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ GLuint newenabled = texUnit->TexGenEnabled & ~S_BIT;
+ if (state)
+ newenabled |= S_BIT;
+ if (texUnit->TexGenEnabled == newenabled)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->TexGenEnabled = newenabled;
+ break;
}
- if (ctx->Pixel.HistogramEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.HistogramEnabled = state;
break;
- case GL_LIGHT0:
- case GL_LIGHT1:
- case GL_LIGHT2:
- case GL_LIGHT3:
- case GL_LIGHT4:
- case GL_LIGHT5:
- case GL_LIGHT6:
- case GL_LIGHT7:
- if (ctx->Light.Light[cap-GL_LIGHT0].Enabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_LIGHT);
- ctx->Light.Light[cap-GL_LIGHT0].Enabled = state;
- if (state) {
- insert_at_tail(&ctx->Light.EnabledList,
- &ctx->Light.Light[cap-GL_LIGHT0]);
- }
- else {
- remove_from_list(&ctx->Light.Light[cap-GL_LIGHT0]);
+ case GL_TEXTURE_GEN_T: {
+ GLuint unit = ctx->Texture.CurrentUnit;
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ GLuint newenabled = texUnit->TexGenEnabled & ~T_BIT;
+ if (state)
+ newenabled |= T_BIT;
+ if (texUnit->TexGenEnabled == newenabled)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->TexGenEnabled = newenabled;
+ break;
}
break;
- case GL_LIGHTING:
- if (ctx->Light.Enabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_LIGHT);
- ctx->Light.Enabled = state;
-
- if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
- ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;
- else
- ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE;
-
- if ((ctx->Light.Enabled &&
- ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR)
- || ctx->Fog.ColorSumEnabled)
- ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR;
- else
- ctx->_TriangleCaps &= ~DD_SEPARATE_SPECULAR;
- break;
- case GL_LINE_SMOOTH:
- if (ctx->Line.SmoothFlag == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_LINE);
- ctx->Line.SmoothFlag = state;
- ctx->_TriangleCaps ^= DD_LINE_SMOOTH;
- break;
- case GL_LINE_STIPPLE:
- if (ctx->Line.StippleFlag == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_LINE);
- ctx->Line.StippleFlag = state;
- ctx->_TriangleCaps ^= DD_LINE_STIPPLE;
- break;
- case GL_INDEX_LOGIC_OP:
- if (ctx->Color.IndexLogicOpEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_COLOR);
- ctx->Color.IndexLogicOpEnabled = state;
- break;
- case GL_COLOR_LOGIC_OP:
- if (ctx->Color.ColorLogicOpEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_COLOR);
- ctx->Color.ColorLogicOpEnabled = state;
- break;
- case GL_MAP1_COLOR_4:
- if (ctx->Eval.Map1Color4 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1Color4 = state;
- break;
- case GL_MAP1_INDEX:
- if (ctx->Eval.Map1Index == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1Index = state;
- break;
- case GL_MAP1_NORMAL:
- if (ctx->Eval.Map1Normal == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1Normal = state;
- break;
- case GL_MAP1_TEXTURE_COORD_1:
- if (ctx->Eval.Map1TextureCoord1 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1TextureCoord1 = state;
- break;
- case GL_MAP1_TEXTURE_COORD_2:
- if (ctx->Eval.Map1TextureCoord2 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1TextureCoord2 = state;
- break;
- case GL_MAP1_TEXTURE_COORD_3:
- if (ctx->Eval.Map1TextureCoord3 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1TextureCoord3 = state;
- break;
- case GL_MAP1_TEXTURE_COORD_4:
- if (ctx->Eval.Map1TextureCoord4 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1TextureCoord4 = state;
- break;
- case GL_MAP1_VERTEX_3:
- if (ctx->Eval.Map1Vertex3 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1Vertex3 = state;
- break;
- case GL_MAP1_VERTEX_4:
- if (ctx->Eval.Map1Vertex4 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1Vertex4 = state;
- break;
- case GL_MAP2_COLOR_4:
- if (ctx->Eval.Map2Color4 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2Color4 = state;
- break;
- case GL_MAP2_INDEX:
- if (ctx->Eval.Map2Index == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2Index = state;
- break;
- case GL_MAP2_NORMAL:
- if (ctx->Eval.Map2Normal == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2Normal = state;
- break;
- case GL_MAP2_TEXTURE_COORD_1:
- if (ctx->Eval.Map2TextureCoord1 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2TextureCoord1 = state;
- break;
- case GL_MAP2_TEXTURE_COORD_2:
- if (ctx->Eval.Map2TextureCoord2 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2TextureCoord2 = state;
- break;
- case GL_MAP2_TEXTURE_COORD_3:
- if (ctx->Eval.Map2TextureCoord3 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2TextureCoord3 = state;
- break;
- case GL_MAP2_TEXTURE_COORD_4:
- if (ctx->Eval.Map2TextureCoord4 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2TextureCoord4 = state;
- break;
- case GL_MAP2_VERTEX_3:
- if (ctx->Eval.Map2Vertex3 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2Vertex3 = state;
- break;
- case GL_MAP2_VERTEX_4:
- if (ctx->Eval.Map2Vertex4 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2Vertex4 = state;
- break;
- case GL_MINMAX:
- if (ctx->Pixel.MinMaxEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.MinMaxEnabled = state;
- break;
- case GL_NORMALIZE:
- if (ctx->Transform.Normalize == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
- ctx->Transform.Normalize = state;
- break;
- case GL_POINT_SMOOTH:
- if (ctx->Point.SmoothFlag==state)
- return;
- FLUSH_VERTICES(ctx, _NEW_POINT);
- ctx->Point.SmoothFlag = state;
- ctx->_TriangleCaps ^= DD_POINT_SMOOTH;
- break;
- case GL_POLYGON_SMOOTH:
- if (ctx->Polygon.SmoothFlag==state)
- return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
- ctx->Polygon.SmoothFlag = state;
- ctx->_TriangleCaps ^= DD_TRI_SMOOTH;
- break;
- case GL_POLYGON_STIPPLE:
- if (ctx->Polygon.StippleFlag==state)
- return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
- ctx->Polygon.StippleFlag = state;
- ctx->_TriangleCaps ^= DD_TRI_STIPPLE;
- break;
- case GL_POLYGON_OFFSET_POINT:
- if (ctx->Polygon.OffsetPoint==state)
- return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
- ctx->Polygon.OffsetPoint = state;
- break;
- case GL_POLYGON_OFFSET_LINE:
- if (ctx->Polygon.OffsetLine==state)
- return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
- ctx->Polygon.OffsetLine = state;
- break;
- case GL_POLYGON_OFFSET_FILL:
- /*case GL_POLYGON_OFFSET_EXT:*/
- if (ctx->Polygon.OffsetFill==state)
- return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
- ctx->Polygon.OffsetFill = state;
- break;
- case GL_RESCALE_NORMAL_EXT:
- if (ctx->Transform.RescaleNormals == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
- ctx->Transform.RescaleNormals = state;
- break;
- case GL_SCISSOR_TEST:
- if (ctx->Scissor.Enabled==state)
- return;
- FLUSH_VERTICES(ctx, _NEW_SCISSOR);
- ctx->Scissor.Enabled = state;
- break;
- case GL_SHARED_TEXTURE_PALETTE_EXT:
- if (ctx->Texture.SharedPalette == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- ctx->Texture.SharedPalette = state;
- break;
- case GL_STENCIL_TEST:
- if (state && ctx->Visual.stencilBits==0) {
- _mesa_warning(ctx, "glEnable(GL_STENCIL_TEST) but no stencil buffer");
- return;
- }
- if (ctx->Stencil.Enabled==state)
- return;
- FLUSH_VERTICES(ctx, _NEW_STENCIL);
- ctx->Stencil.Enabled = state;
- break;
- case GL_TEXTURE_1D: {
- const GLuint curr = ctx->Texture.CurrentUnit;
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
- GLuint newenabled = texUnit->Enabled & ~TEXTURE0_1D;
- if (state)
- newenabled |= TEXTURE0_1D;
- if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Enabled = newenabled;
- break;
- }
- case GL_TEXTURE_2D: {
- const GLuint curr = ctx->Texture.CurrentUnit;
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
- GLuint newenabled = texUnit->Enabled & ~TEXTURE0_2D;
- if (state)
- newenabled |= TEXTURE0_2D;
- if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Enabled = newenabled;
- break;
- }
- case GL_TEXTURE_3D: {
- const GLuint curr = ctx->Texture.CurrentUnit;
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
- GLuint newenabled = texUnit->Enabled & ~TEXTURE0_3D;
- if (state)
- newenabled |= TEXTURE0_3D;
- if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Enabled = newenabled;
- break;
- }
- case GL_TEXTURE_GEN_Q: {
- GLuint unit = ctx->Texture.CurrentUnit;
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- GLuint newenabled = texUnit->TexGenEnabled & ~Q_BIT;
- if (state)
- newenabled |= Q_BIT;
- if (texUnit->TexGenEnabled == newenabled)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->TexGenEnabled = newenabled;
- break;
- }
- case GL_TEXTURE_GEN_R: {
- GLuint unit = ctx->Texture.CurrentUnit;
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- GLuint newenabled = texUnit->TexGenEnabled & ~R_BIT;
- if (state)
- newenabled |= R_BIT;
- if (texUnit->TexGenEnabled == newenabled)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->TexGenEnabled = newenabled;
- break;
- }
- break;
- case GL_TEXTURE_GEN_S: {
- GLuint unit = ctx->Texture.CurrentUnit;
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- GLuint newenabled = texUnit->TexGenEnabled & ~S_BIT;
- if (state)
- newenabled |= S_BIT;
- if (texUnit->TexGenEnabled == newenabled)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->TexGenEnabled = newenabled;
- break;
- }
- break;
- case GL_TEXTURE_GEN_T: {
- GLuint unit = ctx->Texture.CurrentUnit;
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- GLuint newenabled = texUnit->TexGenEnabled & ~T_BIT;
- if (state)
- newenabled |= T_BIT;
- if (texUnit->TexGenEnabled == newenabled)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->TexGenEnabled = newenabled;
- break;
- }
- break;
-
- /*
- * CLIENT STATE!!!
- */
- case GL_VERTEX_ARRAY:
- case GL_NORMAL_ARRAY:
- case GL_COLOR_ARRAY:
- case GL_INDEX_ARRAY:
- case GL_TEXTURE_COORD_ARRAY:
- case GL_EDGE_FLAG_ARRAY:
- case GL_FOG_COORDINATE_ARRAY_EXT:
- case GL_SECONDARY_COLOR_ARRAY_EXT:
- client_state( ctx, cap, state );
- return;
+ /*
+ * CLIENT STATE!!!
+ */
+ case GL_VERTEX_ARRAY:
+ case GL_NORMAL_ARRAY:
+ case GL_COLOR_ARRAY:
+ case GL_INDEX_ARRAY:
+ case GL_TEXTURE_COORD_ARRAY:
+ case GL_EDGE_FLAG_ARRAY:
+ case GL_FOG_COORDINATE_ARRAY_EXT:
+ case GL_SECONDARY_COLOR_ARRAY_EXT:
+ client_state( ctx, cap, state );
+ return;
/* GL_HP_occlusion_test */
- case GL_OCCLUSION_TEST_HP:
- if (!ctx->Extensions.HP_occlusion_test) {
- _mesa_error( ctx, GL_INVALID_ENUM, state ? "glEnable": "glDisable" );
- return;
- }
- if (ctx->Depth.OcclusionTest == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_DEPTH);
- ctx->Depth.OcclusionTest = state;
- if (state)
- ctx->OcclusionResult = ctx->OcclusionResultSaved;
- else
- ctx->OcclusionResultSaved = ctx->OcclusionResult;
- break;
+ case GL_OCCLUSION_TEST_HP:
+ CHECK_EXTENSION(HP_occlusion_test, cap);
+ if (ctx->Depth.OcclusionTest == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_DEPTH);
+ ctx->Depth.OcclusionTest = state;
+ if (state)
+ ctx->OcclusionResult = ctx->OcclusionResultSaved;
+ else
+ ctx->OcclusionResultSaved = ctx->OcclusionResult;
+ break;
/* GL_SGIS_pixel_texture */
- case GL_PIXEL_TEXTURE_SGIS:
- if (!ctx->Extensions.SGIS_pixel_texture) {
- _mesa_error( ctx, GL_INVALID_ENUM, state ? "glEnable": "glDisable" );
- return;
- }
- if (ctx->Pixel.PixelTextureEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.PixelTextureEnabled = state;
- break;
+ case GL_PIXEL_TEXTURE_SGIS:
+ CHECK_EXTENSION(SGIS_pixel_texture, cap);
+ if (ctx->Pixel.PixelTextureEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.PixelTextureEnabled = state;
+ break;
/* GL_SGIX_pixel_texture */
- case GL_PIXEL_TEX_GEN_SGIX:
- if (!ctx->Extensions.SGIX_pixel_texture) {
- _mesa_error( ctx, GL_INVALID_ENUM, state ? "glEnable": "glDisable" );
- return;
- }
- if (ctx->Pixel.PixelTextureEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.PixelTextureEnabled = state;
- break;
+ case GL_PIXEL_TEX_GEN_SGIX:
+ CHECK_EXTENSION(SGIX_pixel_texture, cap);
+ if (ctx->Pixel.PixelTextureEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.PixelTextureEnabled = state;
+ break;
/* GL_SGI_color_table */
- case GL_COLOR_TABLE_SGI:
- if (!ctx->Extensions.SGI_color_table && !ctx->Extensions.ARB_imaging) {
- _mesa_error( ctx, GL_INVALID_ENUM, state ? "glEnable": "glDisable" );
- return;
- }
- if (ctx->Pixel.ColorTableEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.ColorTableEnabled = state;
- break;
- case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
- if (!ctx->Extensions.SGI_color_table && !ctx->Extensions.ARB_imaging) {
- _mesa_error( ctx, GL_INVALID_ENUM, state ? "glEnable": "glDisable" );
- return;
- }
- if (ctx->Pixel.PostConvolutionColorTableEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.PostConvolutionColorTableEnabled = state;
- break;
- case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
- if (!ctx->Extensions.SGI_color_table && !ctx->Extensions.ARB_imaging) {
- _mesa_error( ctx, GL_INVALID_ENUM, state ? "glEnable": "glDisable" );
- return;
- }
- if (ctx->Pixel.PostColorMatrixColorTableEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.PostColorMatrixColorTableEnabled = state;
- break;
+ case GL_COLOR_TABLE_SGI:
+ CHECK_EXTENSION(SGI_color_table, cap);
+ if (ctx->Pixel.ColorTableEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.ColorTableEnabled = state;
+ break;
+ case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
+ CHECK_EXTENSION(SGI_color_table, cap);
+ if (ctx->Pixel.PostConvolutionColorTableEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.PostConvolutionColorTableEnabled = state;
+ break;
+ case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
+ CHECK_EXTENSION(SGI_color_table, cap);
+ if (ctx->Pixel.PostColorMatrixColorTableEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.PostColorMatrixColorTableEnabled = state;
+ break;
/* GL_EXT_convolution */
- case GL_CONVOLUTION_1D:
- if (!ctx->Extensions.EXT_convolution && !ctx->Extensions.ARB_imaging) {
- _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
- return;
- }
- if (ctx->Pixel.Convolution1DEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.Convolution1DEnabled = state;
- break;
- case GL_CONVOLUTION_2D:
- if (!ctx->Extensions.EXT_convolution && !ctx->Extensions.ARB_imaging) {
- _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
- return;
- }
- if (ctx->Pixel.Convolution2DEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.Convolution2DEnabled = state;
- break;
- case GL_SEPARABLE_2D:
- if (!ctx->Extensions.EXT_convolution && !ctx->Extensions.ARB_imaging) {
- _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
- return;
- }
- if (ctx->Pixel.Separable2DEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.Separable2DEnabled = state;
- break;
+ case GL_CONVOLUTION_1D:
+ CHECK_EXTENSION(EXT_convolution, cap);
+ if (ctx->Pixel.Convolution1DEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.Convolution1DEnabled = state;
+ break;
+ case GL_CONVOLUTION_2D:
+ CHECK_EXTENSION(EXT_convolution, cap);
+ if (ctx->Pixel.Convolution2DEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.Convolution2DEnabled = state;
+ break;
+ case GL_SEPARABLE_2D:
+ CHECK_EXTENSION(EXT_convolution, cap);
+ if (ctx->Pixel.Separable2DEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.Separable2DEnabled = state;
+ break;
/* GL_ARB_texture_cube_map */
- case GL_TEXTURE_CUBE_MAP_ARB: {
- const GLuint curr = ctx->Texture.CurrentUnit;
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
- GLuint newenabled = texUnit->Enabled & ~TEXTURE0_CUBE;
- if (state)
- newenabled |= TEXTURE0_CUBE;
- if (!ctx->Extensions.ARB_texture_cube_map) {
- _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
- return;
- }
- if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Enabled = newenabled;
- break;
- }
+ case GL_TEXTURE_CUBE_MAP_ARB:
+ {
+ const GLuint curr = ctx->Texture.CurrentUnit;
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
+ GLuint newenabled = texUnit->Enabled & ~TEXTURE_CUBE_BIT;
+ CHECK_EXTENSION(ARB_texture_cube_map, cap);
+ if (state)
+ newenabled |= TEXTURE_CUBE_BIT;
+ if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->Enabled = newenabled;
+ }
+ break;
+
/* GL_EXT_secondary_color */
- case GL_COLOR_SUM_EXT:
- if (!ctx->Extensions.EXT_secondary_color) {
- _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
- return;
- }
- if (ctx->Fog.ColorSumEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_FOG);
- ctx->Fog.ColorSumEnabled = state;
-
- if ((ctx->Light.Enabled &&
- ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR)
- || ctx->Fog.ColorSumEnabled)
- ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR;
- else
- ctx->_TriangleCaps &= ~DD_SEPARATE_SPECULAR;
+ case GL_COLOR_SUM_EXT:
+ CHECK_EXTENSION(EXT_secondary_color, cap);
+ if (ctx->Fog.ColorSumEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_FOG);
+ ctx->Fog.ColorSumEnabled = state;
+
+ if ((ctx->Light.Enabled &&
+ ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR)
+ || ctx->Fog.ColorSumEnabled)
+ ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR;
+ else
+ ctx->_TriangleCaps &= ~DD_SEPARATE_SPECULAR;
- break;
+ break;
/* GL_ARB_multisample */
- case GL_MULTISAMPLE_ARB:
- if (!ctx->Extensions.ARB_multisample) {
- _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
- return;
- }
- if (ctx->Multisample.Enabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
- ctx->Multisample.Enabled = state;
- break;
- case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
- if (!ctx->Extensions.ARB_multisample) {
- _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
- return;
- }
- if (ctx->Multisample.SampleAlphaToCoverage == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
- ctx->Multisample.SampleAlphaToCoverage = state;
- break;
- case GL_SAMPLE_ALPHA_TO_ONE_ARB:
- if (!ctx->Extensions.ARB_multisample) {
- _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
- return;
- }
- if (ctx->Multisample.SampleAlphaToOne == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
- ctx->Multisample.SampleAlphaToOne = state;
- break;
- case GL_SAMPLE_COVERAGE_ARB:
- if (!ctx->Extensions.ARB_multisample) {
- _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
- return;
- }
- if (ctx->Multisample.SampleCoverage == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
- ctx->Multisample.SampleCoverage = state;
- break;
- case GL_SAMPLE_COVERAGE_INVERT_ARB:
- if (!ctx->Extensions.ARB_multisample) {
- _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
- return;
- }
- if (ctx->Multisample.SampleCoverageInvert == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
- ctx->Multisample.SampleCoverageInvert = state;
- break;
+ case GL_MULTISAMPLE_ARB:
+ CHECK_EXTENSION(ARB_multisample, cap);
+ if (ctx->Multisample.Enabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.Enabled = state;
+ break;
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ CHECK_EXTENSION(ARB_multisample, cap);
+ if (ctx->Multisample.SampleAlphaToCoverage == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.SampleAlphaToCoverage = state;
+ break;
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ CHECK_EXTENSION(ARB_multisample, cap);
+ if (ctx->Multisample.SampleAlphaToOne == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.SampleAlphaToOne = state;
+ break;
+ case GL_SAMPLE_COVERAGE_ARB:
+ CHECK_EXTENSION(ARB_multisample, cap);
+ if (ctx->Multisample.SampleCoverage == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.SampleCoverage = state;
+ break;
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ CHECK_EXTENSION(ARB_multisample, cap);
+ if (ctx->Multisample.SampleCoverageInvert == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.SampleCoverageInvert = state;
+ break;
/* GL_IBM_rasterpos_clip */
- case GL_RASTER_POSITION_UNCLIPPED_IBM:
- if (!ctx->Extensions.IBM_rasterpos_clip) {
- _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
- return;
- }
- if (ctx->Transform.RasterPositionUnclipped == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
- ctx->Transform.RasterPositionUnclipped = state;
- break;
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ CHECK_EXTENSION(IBM_rasterpos_clip, cap);
+ if (ctx->Transform.RasterPositionUnclipped == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+ ctx->Transform.RasterPositionUnclipped = state;
+ break;
- /* GL_MESA_sprite_point */
- case GL_SPRITE_POINT_MESA:
- if (!ctx->Extensions.MESA_sprite_point) {
- _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
- return;
- }
- if (ctx->Point.SpriteMode == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_POINT);
- ctx->Point.SpriteMode = state;
- break;
+ /* GL_NV_point_sprite */
+ case GL_POINT_SPRITE_NV:
+ CHECK_EXTENSION(NV_point_sprite, cap);
+ if (ctx->Point.PointSprite == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POINT);
+ ctx->Point.PointSprite = state;
+ break;
+
+#if FEATURE_NV_vertex_program
+ case GL_VERTEX_PROGRAM_NV:
+ CHECK_EXTENSION(NV_vertex_program, cap);
+ if (ctx->VertexProgram.Enabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM | _NEW_PROGRAM); /* XXX OK? */
+ ctx->VertexProgram.Enabled = state;
+ break;
+ case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
+ CHECK_EXTENSION(NV_vertex_program, cap);
+ if (ctx->VertexProgram.PointSizeEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POINT | _NEW_PROGRAM);
+ ctx->VertexProgram.PointSizeEnabled = state;
+ break;
+ case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
+ CHECK_EXTENSION(NV_vertex_program, cap);
+ if (ctx->VertexProgram.TwoSideEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM); /* XXX OK? */
+ ctx->VertexProgram.TwoSideEnabled = state;
+ break;
+ case GL_MAP1_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION(NV_vertex_program, cap);
+ {
+ const GLuint map = (GLuint) (cap - GL_MAP1_VERTEX_ATTRIB0_4_NV);
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1Attrib[map] = state;
+ }
+ break;
+ case GL_MAP2_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION(NV_vertex_program, cap);
+ {
+ const GLuint map = (GLuint) (cap - GL_MAP2_VERTEX_ATTRIB0_4_NV);
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2Attrib[map] = state;
+ }
+ break;
+#endif /* FEATURE_NV_vertex_program */
/* GL_NV_texture_rectangle */
case GL_TEXTURE_RECTANGLE_NV:
+ CHECK_EXTENSION(NV_texture_rectangle, cap);
{
const GLuint curr = ctx->Texture.CurrentUnit;
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
- GLuint newenabled = texUnit->Enabled & ~TEXTURE0_RECT;
- if (!ctx->Extensions.NV_texture_rectangle) {
- _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
- return;
- }
+ GLuint newenabled = texUnit->Enabled & ~TEXTURE_RECT_BIT;
+ CHECK_EXTENSION(NV_texture_rectangle, cap);
if (state)
- newenabled |= TEXTURE0_RECT;
+ newenabled |= TEXTURE_RECT_BIT;
if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled)
return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
@@ -835,8 +889,18 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
}
break;
+ /* GL_EXT_stencil_two_side */
+ case GL_STENCIL_TEST_TWO_SIDE_EXT:
+ CHECK_EXTENSION(EXT_stencil_two_side, cap);
+ if (ctx->Stencil.TestTwoSide == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_STENCIL);
+ ctx->Stencil.TestTwoSide = state;
+ break;
+
default:
- _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "%s(0x%x)", state ? "glEnable" : "glDisable", cap);
return;
}
@@ -846,8 +910,6 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
}
-
-
void
_mesa_Enable( GLenum cap )
{
@@ -858,7 +920,6 @@ _mesa_Enable( GLenum cap )
}
-
void
_mesa_Disable( GLenum cap )
{
@@ -869,6 +930,13 @@ _mesa_Disable( GLenum cap )
}
+#undef CHECK_EXTENSION
+#define CHECK_EXTENSION(EXTNAME) \
+ if (!ctx->Extensions.EXTNAME) { \
+ _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled"); \
+ return GL_FALSE; \
+ }
+
GLboolean
_mesa_IsEnabled( GLenum cap )
@@ -887,7 +955,7 @@ _mesa_IsEnabled( GLenum cap )
case GL_CLIP_PLANE3:
case GL_CLIP_PLANE4:
case GL_CLIP_PLANE5:
- return ctx->Transform.ClipEnabled[cap-GL_CLIP_PLANE0];
+ return (ctx->Transform.ClipPlanesEnabled >> (cap - GL_CLIP_PLANE0)) & 1;
case GL_COLOR_MATERIAL:
return ctx->Light.ColorMaterialEnabled;
case GL_CULL_FACE:
@@ -898,14 +966,6 @@ _mesa_IsEnabled( GLenum cap )
return ctx->Color.DitherFlag;
case GL_FOG:
return ctx->Fog.Enabled;
- case GL_HISTOGRAM:
- if (ctx->Extensions.EXT_histogram || ctx->Extensions.ARB_imaging) {
- return ctx->Pixel.HistogramEnabled;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
- return GL_FALSE;
- }
case GL_LIGHTING:
return ctx->Light.Enabled;
case GL_LIGHT0:
@@ -961,8 +1021,6 @@ _mesa_IsEnabled( GLenum cap )
return ctx->Eval.Map2Vertex3;
case GL_MAP2_VERTEX_4:
return ctx->Eval.Map2Vertex4;
- case GL_MINMAX:
- return ctx->Pixel.MinMaxEnabled;
case GL_NORMALIZE:
return ctx->Transform.Normalize;
case GL_POINT_SMOOTH:
@@ -988,37 +1046,44 @@ _mesa_IsEnabled( GLenum cap )
return ctx->Stencil.Enabled;
case GL_TEXTURE_1D:
{
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- return (texUnit->Enabled & TEXTURE0_1D) ? GL_TRUE : GL_FALSE;
+ const struct gl_texture_unit *texUnit;
+ texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ return (texUnit->Enabled & TEXTURE_1D_BIT) ? GL_TRUE : GL_FALSE;
}
case GL_TEXTURE_2D:
{
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- return (texUnit->Enabled & TEXTURE0_2D) ? GL_TRUE : GL_FALSE;
+ const struct gl_texture_unit *texUnit;
+ texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ return (texUnit->Enabled & TEXTURE_2D_BIT) ? GL_TRUE : GL_FALSE;
}
case GL_TEXTURE_3D:
{
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- return (texUnit->Enabled & TEXTURE0_3D) ? GL_TRUE : GL_FALSE;
+ const struct gl_texture_unit *texUnit;
+ texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ return (texUnit->Enabled & TEXTURE_3D_BIT) ? GL_TRUE : GL_FALSE;
}
case GL_TEXTURE_GEN_Q:
{
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ const struct gl_texture_unit *texUnit;
+ texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
return (texUnit->TexGenEnabled & Q_BIT) ? GL_TRUE : GL_FALSE;
}
case GL_TEXTURE_GEN_R:
{
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ const struct gl_texture_unit *texUnit;
+ texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
return (texUnit->TexGenEnabled & R_BIT) ? GL_TRUE : GL_FALSE;
}
case GL_TEXTURE_GEN_S:
{
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ const struct gl_texture_unit *texUnit;
+ texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
return (texUnit->TexGenEnabled & S_BIT) ? GL_TRUE : GL_FALSE;
}
case GL_TEXTURE_GEN_T:
{
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ const struct gl_texture_unit *texUnit;
+ texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
return (texUnit->TexGenEnabled & T_BIT) ? GL_TRUE : GL_FALSE;
}
@@ -1026,133 +1091,195 @@ _mesa_IsEnabled( GLenum cap )
* CLIENT STATE!!!
*/
case GL_VERTEX_ARRAY:
- return ctx->Array.Vertex.Enabled;
+ return (ctx->Array.Vertex.Enabled != 0);
case GL_NORMAL_ARRAY:
- return ctx->Array.Normal.Enabled;
+ return (ctx->Array.Normal.Enabled != 0);
case GL_COLOR_ARRAY:
- return ctx->Array.Color.Enabled;
+ return (ctx->Array.Color.Enabled != 0);
case GL_INDEX_ARRAY:
- return ctx->Array.Index.Enabled;
+ return (ctx->Array.Index.Enabled != 0);
case GL_TEXTURE_COORD_ARRAY:
- return ctx->Array.TexCoord[ctx->Array.ActiveTexture].Enabled;
+ return (ctx->Array.TexCoord[ctx->Array.ActiveTexture].Enabled != 0);
case GL_EDGE_FLAG_ARRAY:
- return ctx->Array.EdgeFlag.Enabled;
+ return (ctx->Array.EdgeFlag.Enabled != 0);
+ case GL_FOG_COORDINATE_ARRAY_EXT:
+ CHECK_EXTENSION(EXT_fog_coord);
+ return (ctx->Array.FogCoord.Enabled != 0);
+ case GL_SECONDARY_COLOR_ARRAY_EXT:
+ CHECK_EXTENSION(EXT_secondary_color);
+ return (ctx->Array.SecondaryColor.Enabled != 0);
+
+ /* GL_EXT_histogram */
+ case GL_HISTOGRAM:
+ CHECK_EXTENSION(EXT_histogram);
+ return ctx->Pixel.HistogramEnabled;
+ case GL_MINMAX:
+ CHECK_EXTENSION(EXT_histogram);
+ return ctx->Pixel.MinMaxEnabled;
/* GL_HP_occlusion_test */
case GL_OCCLUSION_TEST_HP:
- if (ctx->Extensions.HP_occlusion_test) {
- return ctx->Depth.OcclusionTest;
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glIsEnabled" );
- return GL_FALSE;
- }
+ CHECK_EXTENSION(HP_occlusion_test);
+ return ctx->Depth.OcclusionTest;
/* GL_SGIS_pixel_texture */
case GL_PIXEL_TEXTURE_SGIS:
+ CHECK_EXTENSION(SGIS_pixel_texture);
return ctx->Pixel.PixelTextureEnabled;
/* GL_SGIX_pixel_texture */
case GL_PIXEL_TEX_GEN_SGIX:
+ CHECK_EXTENSION(SGIX_pixel_texture);
return ctx->Pixel.PixelTextureEnabled;
/* GL_SGI_color_table */
case GL_COLOR_TABLE_SGI:
+ CHECK_EXTENSION(SGI_color_table);
return ctx->Pixel.ColorTableEnabled;
case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
+ CHECK_EXTENSION(SGI_color_table);
return ctx->Pixel.PostConvolutionColorTableEnabled;
case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
+ CHECK_EXTENSION(SGI_color_table);
return ctx->Pixel.PostColorMatrixColorTableEnabled;
/* GL_EXT_convolution */
case GL_CONVOLUTION_1D:
+ CHECK_EXTENSION(EXT_convolution);
return ctx->Pixel.Convolution1DEnabled;
case GL_CONVOLUTION_2D:
+ CHECK_EXTENSION(EXT_convolution);
return ctx->Pixel.Convolution2DEnabled;
case GL_SEPARABLE_2D:
+ CHECK_EXTENSION(EXT_convolution);
return ctx->Pixel.Separable2DEnabled;
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
- if (ctx->Extensions.ARB_texture_cube_map) {
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- return (texUnit->Enabled & TEXTURE0_CUBE) ? GL_TRUE : GL_FALSE;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
- return GL_FALSE;
+ CHECK_EXTENSION(ARB_texture_cube_map);
+ {
+ const struct gl_texture_unit *texUnit;
+ texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ return (texUnit->Enabled & TEXTURE_CUBE_BIT) ? GL_TRUE : GL_FALSE;
}
/* GL_ARB_multisample */
case GL_MULTISAMPLE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- return ctx->Multisample.Enabled;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
- return GL_FALSE;
- }
+ CHECK_EXTENSION(ARB_multisample);
+ return ctx->Multisample.Enabled;
case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- return ctx->Multisample.SampleAlphaToCoverage;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
- return GL_FALSE;
- }
+ CHECK_EXTENSION(ARB_multisample);
+ return ctx->Multisample.SampleAlphaToCoverage;
case GL_SAMPLE_ALPHA_TO_ONE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- return ctx->Multisample.SampleAlphaToOne;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
- return GL_FALSE;
- }
+ CHECK_EXTENSION(ARB_multisample);
+ return ctx->Multisample.SampleAlphaToOne;
case GL_SAMPLE_COVERAGE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- return ctx->Multisample.SampleCoverage;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
- return GL_FALSE;
- }
+ CHECK_EXTENSION(ARB_multisample);
+ return ctx->Multisample.SampleCoverage;
case GL_SAMPLE_COVERAGE_INVERT_ARB:
- if (ctx->Extensions.ARB_multisample) {
- return ctx->Multisample.SampleCoverageInvert;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
- return GL_FALSE;
- }
+ CHECK_EXTENSION(ARB_multisample);
+ return ctx->Multisample.SampleCoverageInvert;
/* GL_IBM_rasterpos_clip */
case GL_RASTER_POSITION_UNCLIPPED_IBM:
- if (ctx->Extensions.IBM_rasterpos_clip) {
- return ctx->Transform.RasterPositionUnclipped;
+ CHECK_EXTENSION(IBM_rasterpos_clip);
+ return ctx->Transform.RasterPositionUnclipped;
+
+ /* GL_NV_point_sprite */
+ case GL_POINT_SPRITE_NV:
+ return ctx->Point.PointSprite;
+
+#if FEATURE_NV_vertex_program
+ case GL_VERTEX_PROGRAM_NV:
+ CHECK_EXTENSION(NV_vertex_program);
+ return ctx->VertexProgram.Enabled;
+ case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
+ CHECK_EXTENSION(NV_vertex_program);
+ return ctx->VertexProgram.PointSizeEnabled;
+ case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
+ CHECK_EXTENSION(NV_vertex_program);
+ return ctx->VertexProgram.TwoSideEnabled;
+ case GL_VERTEX_ATTRIB_ARRAY0_NV:
+ case GL_VERTEX_ATTRIB_ARRAY1_NV:
+ case GL_VERTEX_ATTRIB_ARRAY2_NV:
+ case GL_VERTEX_ATTRIB_ARRAY3_NV:
+ case GL_VERTEX_ATTRIB_ARRAY4_NV:
+ case GL_VERTEX_ATTRIB_ARRAY5_NV:
+ case GL_VERTEX_ATTRIB_ARRAY6_NV:
+ case GL_VERTEX_ATTRIB_ARRAY7_NV:
+ case GL_VERTEX_ATTRIB_ARRAY8_NV:
+ case GL_VERTEX_ATTRIB_ARRAY9_NV:
+ case GL_VERTEX_ATTRIB_ARRAY10_NV:
+ case GL_VERTEX_ATTRIB_ARRAY11_NV:
+ case GL_VERTEX_ATTRIB_ARRAY12_NV:
+ case GL_VERTEX_ATTRIB_ARRAY13_NV:
+ case GL_VERTEX_ATTRIB_ARRAY14_NV:
+ case GL_VERTEX_ATTRIB_ARRAY15_NV:
+ CHECK_EXTENSION(NV_vertex_program);
+ {
+ GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV;
+ return (ctx->Array.VertexAttrib[n].Enabled != 0);
}
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
- return GL_FALSE;
+ case GL_MAP1_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION(NV_vertex_program);
+ {
+ const GLuint map = (GLuint) (cap - GL_MAP1_VERTEX_ATTRIB0_4_NV);
+ return ctx->Eval.Map1Attrib[map];
}
-
- /* GL_MESA_sprite_point */
- case GL_SPRITE_POINT_MESA:
- return ctx->Point.SpriteMode;
+ case GL_MAP2_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION(NV_vertex_program);
+ {
+ const GLuint map = (GLuint) (cap - GL_MAP2_VERTEX_ATTRIB0_4_NV);
+ return ctx->Eval.Map2Attrib[map];
+ }
+#endif /* FEATURE_NV_vertex_program */
/* GL_NV_texture_rectangle */
case GL_TEXTURE_RECTANGLE_NV:
- if (ctx->Extensions.NV_texture_rectangle) {
+ CHECK_EXTENSION(NV_texture_rectangle);
+ {
const struct gl_texture_unit *texUnit;
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- return (texUnit->Enabled & TEXTURE0_RECT) ? GL_TRUE : GL_FALSE;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
- return GL_FALSE;
+ return (texUnit->Enabled & TEXTURE_RECT_BIT) ? GL_TRUE : GL_FALSE;
}
+ /* GL_EXT_stencil_two_side */
+ case GL_STENCIL_TEST_TWO_SIDE_EXT:
+ CHECK_EXTENSION(EXT_stencil_two_side);
+ return ctx->Stencil.TestTwoSide;
+
default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glIsEnabled" );
+ _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled(0x%x)", (int) cap);
return GL_FALSE;
}
}
diff --git a/xc/extras/Mesa/src/enums.c b/xc/extras/Mesa/src/enums.c
index 6801e8f5c..999c40a48 100644
--- a/xc/extras/Mesa/src/enums.c
+++ b/xc/extras/Mesa/src/enums.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 5.0.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -23,17 +23,13 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Author:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "enums.h"
-#include "mem.h"
-#endif
+#include "imports.h"
typedef struct {
@@ -775,10 +771,21 @@ enum_elt all_enums[] =
{ "GL_OCCLUSION_TEST_RESULT_HP", 0x8166 },
{ "GL_TEXTURE_FILTER_CONTROL_EXT", 0x8500 },
- { "GL_TEXTUER_LOD_BIAS_EXT", 0x8501 },
-
- { "GL_NORMAL_MAP_NV", 0x8511 },
- { "GL_REFLECTION_MAP_NV", 0x8512 },
+ { "GL_TEXTURE_LOD_BIAS_EXT", 0x8501 },
+
+ /* GL_ARB_texture_cube_map */
+ { "GL_NORMAL_MAP_ARB", 0x8511 },
+ { "GL_REFLECTION_MAP_ARB", 0x8512 },
+ { "GL_TEXTURE_CUBE_MAP_ARB", 0x8513 },
+ { "GL_TEXTURE_BINDING_CUBE_MAP_ARB", 0x8514 },
+ { "GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB", 0x8515 },
+ { "GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB", 0x8516 },
+ { "GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB", 0x8517 },
+ { "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB", 0x8518 },
+ { "GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB", 0x8519 },
+ { "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB", 0x851a },
+ { "GL_PROXY_TEXTURE_CUBE_MAP_ARB", 0x851b },
+ { "GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB", 0x851c },
{ "GL_PREFER_DOUBLEBUFFER_HINT_PGI", 107000 },
{ "GL_STRICT_DEPTHFUNC_HINT_PGI", 107030 },
@@ -840,11 +847,44 @@ enum_elt all_enums[] =
{ "GL_DOT3_RGBA_EXT", 0x8741 },
/* GL_ARB_texture_env_dot3 */
- { "GL_DOT3_RGB_EXT", 0x86ae },
- { "GL_DOT3_RGBA_EXT", 0x86af },
+ { "GL_DOT3_RGB_ARB", 0x86ae },
+ { "GL_DOT3_RGBA_ARB", 0x86af },
/* GL_ARB_texture_border_clamp */
{ "GL_CLAMP_TO_BORDER_ARB", 0x812D },
+
+ /* GL_ATI_texture_env_combine3 */
+ { "GL_MODULATE_ADD_ATI", 0x8744 },
+ { "GL_MODULATE_SIGNED_ADD_ATI", 0x8745 },
+ { "GL_MODULATE_SUBTRACT_ATI", 0x8746 },
+
+ /* GL_ARB_texture_compression */
+ { "GL_COMPRESSED_ALPHA_ARB", 0x84E9 },
+ { "GL_COMPRESSED_LUMINANCE_ARB", 0x84EA },
+ { "GL_COMPRESSED_LUMINANCE_ALPHA_ARB", 0x84EB },
+ { "GL_COMPRESSED_INTENSITY_ARB", 0x84EC },
+ { "GL_COMPRESSED_RGB_ARB", 0x84ED },
+ { "GL_COMPRESSED_RGBA_ARB", 0x84EE },
+ { "GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB", 0x86A0 },
+ { "GL_TEXTURE_COMPRESSED_ARB", 0x86A1 },
+ { "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB", 0x86A2 },
+ { "GL_COMPRESSED_TEXTURE_FORMATS_ARB", 0x86A3 },
+
+ /* GL_EXT_texture_compression_s3tc */
+ { "GL_COMPRESSED_RGB_S3TC_DXT1_EXT", 0x83F0 },
+ { "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT", 0x83F1 },
+ { "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT", 0x83F2 },
+ { "GL_COMPRESSED_RGBA_S3TC_DXT5_EXT", 0x83F3 },
+
+ /* GL_S3_s3tc */
+ { "GL_RGB_S3TC", 0x83A0 },
+ { "GL_RGB4_S3TC", 0x83A1 },
+ { "GL_RGBA_S3TC", 0x83A2 },
+ { "GL_RGBA4_S3TC", 0x83A3 },
+
+ /* GL_3DFX_texture_compression_FXT1 */
+ { "GL_COMPRESSED_RGB_FXT1_3DFX", 0x86B0 },
+ { "GL_COMPRESSED_RGBA_FXT1_3DFX", 0x86B1 },
};
#define Elements(x) sizeof(x)/sizeof(*x)
@@ -856,7 +896,7 @@ static int sorted = 0;
static int compar_name( const enum_elt *a, const enum_elt *b )
{
- return strcmp(a->c, b->c);
+ return _mesa_strcmp(a->c, b->c);
}
@@ -927,7 +967,7 @@ const char *_mesa_lookup_enum_by_nr( int nr )
}
else {
/* this isn't re-entrant safe, no big deal here */
- sprintf(token_tmp, "0x%x", nr);
+ _mesa_sprintf(token_tmp, "0x%x", nr);
return token_tmp;
}
}
diff --git a/xc/extras/Mesa/src/eval.c b/xc/extras/Mesa/src/eval.c
index a3fb0e9b5..b9c09a569 100644
--- a/xc/extras/Mesa/src/eval.c
+++ b/xc/extras/Mesa/src/eval.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -37,18 +37,14 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "colormac.h"
#include "context.h"
#include "eval.h"
#include "macros.h"
-#include "mem.h"
#include "mmath.h"
#include "mtypes.h"
-#endif
/*
@@ -77,7 +73,122 @@ GLuint _mesa_evaluator_components( GLenum target )
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: return 0;
+ default: break;
+ }
+
+ /* XXX need to check for the vertex program extension
+ if (!ctx->Extensions.NV_vertex_program)
+ return 0;
+ */
+
+ if (target >= GL_MAP1_VERTEX_ATTRIB0_4_NV &&
+ target <= GL_MAP1_VERTEX_ATTRIB15_4_NV)
+ return 4;
+
+ if (target >= GL_MAP2_VERTEX_ATTRIB0_4_NV &&
+ target <= GL_MAP2_VERTEX_ATTRIB15_4_NV)
+ return 4;
+
+ return 0;
+}
+
+
+/*
+ * Return pointer to the gl_1d_map struct for the named target.
+ */
+static struct gl_1d_map *
+get_1d_map( GLcontext *ctx, GLenum target )
+{
+ switch (target) {
+ case GL_MAP1_VERTEX_3:
+ return &ctx->EvalMap.Map1Vertex3;
+ case GL_MAP1_VERTEX_4:
+ return &ctx->EvalMap.Map1Vertex4;
+ case GL_MAP1_INDEX:
+ return &ctx->EvalMap.Map1Index;
+ case GL_MAP1_COLOR_4:
+ return &ctx->EvalMap.Map1Color4;
+ case GL_MAP1_NORMAL:
+ return &ctx->EvalMap.Map1Normal;
+ case GL_MAP1_TEXTURE_COORD_1:
+ return &ctx->EvalMap.Map1Texture1;
+ case GL_MAP1_TEXTURE_COORD_2:
+ return &ctx->EvalMap.Map1Texture2;
+ case GL_MAP1_TEXTURE_COORD_3:
+ return &ctx->EvalMap.Map1Texture3;
+ case GL_MAP1_TEXTURE_COORD_4:
+ return &ctx->EvalMap.Map1Texture4;
+ case GL_MAP1_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB15_4_NV:
+ if (!ctx->Extensions.NV_vertex_program)
+ return NULL;
+ return &ctx->EvalMap.Map1Attrib[target - GL_MAP1_VERTEX_ATTRIB0_4_NV];
+ default:
+ return NULL;
+ }
+}
+
+
+/*
+ * Return pointer to the gl_2d_map struct for the named target.
+ */
+static struct gl_2d_map *
+get_2d_map( GLcontext *ctx, GLenum target )
+{
+ switch (target) {
+ case GL_MAP2_VERTEX_3:
+ return &ctx->EvalMap.Map2Vertex3;
+ case GL_MAP2_VERTEX_4:
+ return &ctx->EvalMap.Map2Vertex4;
+ case GL_MAP2_INDEX:
+ return &ctx->EvalMap.Map2Index;
+ case GL_MAP2_COLOR_4:
+ return &ctx->EvalMap.Map2Color4;
+ case GL_MAP2_NORMAL:
+ return &ctx->EvalMap.Map2Normal;
+ case GL_MAP2_TEXTURE_COORD_1:
+ return &ctx->EvalMap.Map2Texture1;
+ case GL_MAP2_TEXTURE_COORD_2:
+ return &ctx->EvalMap.Map2Texture2;
+ case GL_MAP2_TEXTURE_COORD_3:
+ return &ctx->EvalMap.Map2Texture3;
+ case GL_MAP2_TEXTURE_COORD_4:
+ return &ctx->EvalMap.Map2Texture4;
+ case GL_MAP2_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB15_4_NV:
+ if (!ctx->Extensions.NV_vertex_program)
+ return NULL;
+ return &ctx->EvalMap.Map2Attrib[target - GL_MAP2_VERTEX_ATTRIB0_4_NV];
+ default:
+ return NULL;
}
}
@@ -95,20 +206,19 @@ GLuint _mesa_evaluator_components( GLenum target )
* of memory.
*/
GLfloat *_mesa_copy_map_points1f( GLenum target, GLint ustride, GLint uorder,
- const GLfloat *points )
+ const GLfloat *points )
{
GLfloat *buffer, *p;
GLint i, k, size = _mesa_evaluator_components(target);
- if (!points || size==0) {
+ if (!points || !size)
return NULL;
- }
buffer = (GLfloat *) MALLOC(uorder * size * sizeof(GLfloat));
- if(buffer)
- for(i=0, p=buffer; i<uorder; i++, points+=ustride)
- for(k=0; k<size; k++)
+ if (buffer)
+ for (i = 0, p = buffer; i < uorder; i++, points += ustride)
+ for (k = 0; k < size; k++)
*p++ = points[k];
return buffer;
@@ -120,20 +230,19 @@ GLfloat *_mesa_copy_map_points1f( GLenum target, GLint ustride, GLint uorder,
* Same as above but convert doubles to floats.
*/
GLfloat *_mesa_copy_map_points1d( GLenum target, GLint ustride, GLint uorder,
- const GLdouble *points )
+ const GLdouble *points )
{
GLfloat *buffer, *p;
GLint i, k, size = _mesa_evaluator_components(target);
- if (!points || size==0) {
+ if (!points || !size)
return NULL;
- }
buffer = (GLfloat *) MALLOC(uorder * size * sizeof(GLfloat));
- if(buffer)
- for(i=0, p=buffer; i<uorder; i++, points+=ustride)
- for(k=0; k<size; k++)
+ if (buffer)
+ for (i = 0, p = buffer; i < uorder; i++, points += ustride)
+ for (k = 0; k < size; k++)
*p++ = (GLfloat) points[k];
return buffer;
@@ -152,9 +261,9 @@ GLfloat *_mesa_copy_map_points1d( GLenum target, GLint ustride, GLint uorder,
* of memory.
*/
GLfloat *_mesa_copy_map_points2f( GLenum target,
- GLint ustride, GLint uorder,
- GLint vstride, GLint vorder,
- const GLfloat *points )
+ GLint ustride, GLint uorder,
+ GLint vstride, GLint vorder,
+ const GLfloat *points )
{
GLfloat *buffer, *p;
GLint i, j, k, size, dsize, hsize;
@@ -195,9 +304,9 @@ GLfloat *_mesa_copy_map_points2f( GLenum target,
* Same as above but convert doubles to floats.
*/
GLfloat *_mesa_copy_map_points2d(GLenum target,
- GLint ustride, GLint uorder,
- GLint vstride, GLint vorder,
- const GLdouble *points )
+ GLint ustride, GLint uorder,
+ GLint vstride, GLint vorder,
+ const GLdouble *points )
{
GLfloat *buffer, *p;
GLint i, j, k, size, hsize, dsize;
@@ -250,10 +359,10 @@ map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride,
GET_CURRENT_CONTEXT(ctx);
GLint k;
GLfloat *pnts;
- struct gl_1d_map *map = 0;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
+ struct gl_1d_map *map = NULL;
- assert(type == GL_FLOAT || type == GL_DOUBLE);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+ ASSERT(type == GL_FLOAT || type == GL_DOUBLE);
if (u1 == u2) {
_mesa_error( ctx, GL_INVALID_VALUE, "glMap1(u1,u2)" );
@@ -284,37 +393,10 @@ map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride,
return;
}
- switch (target) {
- case GL_MAP1_VERTEX_3:
- map = &ctx->EvalMap.Map1Vertex3;
- break;
- case GL_MAP1_VERTEX_4:
- map = &ctx->EvalMap.Map1Vertex4;
- break;
- case GL_MAP1_INDEX:
- map = &ctx->EvalMap.Map1Index;
- break;
- case GL_MAP1_COLOR_4:
- map = &ctx->EvalMap.Map1Color4;
- break;
- case GL_MAP1_NORMAL:
- map = &ctx->EvalMap.Map1Normal;
- break;
- case GL_MAP1_TEXTURE_COORD_1:
- map = &ctx->EvalMap.Map1Texture1;
- break;
- case GL_MAP1_TEXTURE_COORD_2:
- map = &ctx->EvalMap.Map1Texture2;
- break;
- case GL_MAP1_TEXTURE_COORD_3:
- map = &ctx->EvalMap.Map1Texture3;
- break;
- case GL_MAP1_TEXTURE_COORD_4:
- map = &ctx->EvalMap.Map1Texture4;
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glMap1(target)" );
- return;
+ map = get_1d_map(ctx, target);
+ if (!map) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glMap1(target)" );
+ return;
}
/* make copy of the control points */
@@ -360,8 +442,10 @@ map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
GET_CURRENT_CONTEXT(ctx);
GLint k;
GLfloat *pnts;
- struct gl_2d_map *map = 0;
+ struct gl_2d_map *map = NULL;
+
ASSERT_OUTSIDE_BEGIN_END(ctx);
+ ASSERT(type == GL_FLOAT || type == GL_DOUBLE);
if (u1==u2) {
_mesa_error( ctx, GL_INVALID_VALUE, "glMap2(u1,u2)" );
@@ -403,37 +487,10 @@ map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
return;
}
- switch (target) {
- case GL_MAP2_VERTEX_3:
- map = &ctx->EvalMap.Map2Vertex3;
- break;
- case GL_MAP2_VERTEX_4:
- map = &ctx->EvalMap.Map2Vertex4;
- break;
- case GL_MAP2_INDEX:
- map = &ctx->EvalMap.Map2Index;
- break;
- case GL_MAP2_COLOR_4:
- map = &ctx->EvalMap.Map2Color4;
- break;
- case GL_MAP2_NORMAL:
- map = &ctx->EvalMap.Map2Normal;
- break;
- case GL_MAP2_TEXTURE_COORD_1:
- map = &ctx->EvalMap.Map2Texture1;
- break;
- case GL_MAP2_TEXTURE_COORD_2:
- map = &ctx->EvalMap.Map2Texture2;
- break;
- case GL_MAP2_TEXTURE_COORD_3:
- map = &ctx->EvalMap.Map2Texture3;
- break;
- case GL_MAP2_TEXTURE_COORD_4:
- map = &ctx->EvalMap.Map2Texture4;
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glMap2(target)" );
- return;
+ map = get_2d_map(ctx, target);
+ if (!map) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glMap2(target)" );
+ return;
}
/* make copy of the control points */
@@ -487,98 +544,34 @@ void
_mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v )
{
GET_CURRENT_CONTEXT(ctx);
+ struct gl_1d_map *map1d;
+ struct gl_2d_map *map2d;
GLint i, n;
GLfloat *data;
+ GLuint comps;
+
ASSERT_OUTSIDE_BEGIN_END(ctx);
+ comps = _mesa_evaluator_components(target);
+ if (!comps) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapdv(target)" );
+ return;
+ }
+
+ map1d = get_1d_map(ctx, target);
+ map2d = get_2d_map(ctx, target);
+ ASSERT(map1d || map2d);
+
switch (query) {
case GL_COEFF:
- switch (target) {
- case GL_MAP1_COLOR_4:
- data = ctx->EvalMap.Map1Color4.Points;
- n = ctx->EvalMap.Map1Color4.Order * 4;
- break;
- case GL_MAP1_INDEX:
- data = ctx->EvalMap.Map1Index.Points;
- n = ctx->EvalMap.Map1Index.Order;
- break;
- case GL_MAP1_NORMAL:
- data = ctx->EvalMap.Map1Normal.Points;
- n = ctx->EvalMap.Map1Normal.Order * 3;
- break;
- case GL_MAP1_TEXTURE_COORD_1:
- data = ctx->EvalMap.Map1Texture1.Points;
- n = ctx->EvalMap.Map1Texture1.Order * 1;
- break;
- case GL_MAP1_TEXTURE_COORD_2:
- data = ctx->EvalMap.Map1Texture2.Points;
- n = ctx->EvalMap.Map1Texture2.Order * 2;
- break;
- case GL_MAP1_TEXTURE_COORD_3:
- data = ctx->EvalMap.Map1Texture3.Points;
- n = ctx->EvalMap.Map1Texture3.Order * 3;
- break;
- case GL_MAP1_TEXTURE_COORD_4:
- data = ctx->EvalMap.Map1Texture4.Points;
- n = ctx->EvalMap.Map1Texture4.Order * 4;
- break;
- case GL_MAP1_VERTEX_3:
- data = ctx->EvalMap.Map1Vertex3.Points;
- n = ctx->EvalMap.Map1Vertex3.Order * 3;
- break;
- case GL_MAP1_VERTEX_4:
- data = ctx->EvalMap.Map1Vertex4.Points;
- n = ctx->EvalMap.Map1Vertex4.Order * 4;
- break;
- case GL_MAP2_COLOR_4:
- data = ctx->EvalMap.Map2Color4.Points;
- n = ctx->EvalMap.Map2Color4.Uorder
- * ctx->EvalMap.Map2Color4.Vorder * 4;
- break;
- case GL_MAP2_INDEX:
- data = ctx->EvalMap.Map2Index.Points;
- n = ctx->EvalMap.Map2Index.Uorder
- * ctx->EvalMap.Map2Index.Vorder;
- break;
- case GL_MAP2_NORMAL:
- data = ctx->EvalMap.Map2Normal.Points;
- n = ctx->EvalMap.Map2Normal.Uorder
- * ctx->EvalMap.Map2Normal.Vorder * 3;
- break;
- case GL_MAP2_TEXTURE_COORD_1:
- data = ctx->EvalMap.Map2Texture1.Points;
- n = ctx->EvalMap.Map2Texture1.Uorder
- * ctx->EvalMap.Map2Texture1.Vorder * 1;
- break;
- case GL_MAP2_TEXTURE_COORD_2:
- data = ctx->EvalMap.Map2Texture2.Points;
- n = ctx->EvalMap.Map2Texture2.Uorder
- * ctx->EvalMap.Map2Texture2.Vorder * 2;
- break;
- case GL_MAP2_TEXTURE_COORD_3:
- data = ctx->EvalMap.Map2Texture3.Points;
- n = ctx->EvalMap.Map2Texture3.Uorder
- * ctx->EvalMap.Map2Texture3.Vorder * 3;
- break;
- case GL_MAP2_TEXTURE_COORD_4:
- data = ctx->EvalMap.Map2Texture4.Points;
- n = ctx->EvalMap.Map2Texture4.Uorder
- * ctx->EvalMap.Map2Texture4.Vorder * 4;
- break;
- case GL_MAP2_VERTEX_3:
- data = ctx->EvalMap.Map2Vertex3.Points;
- n = ctx->EvalMap.Map2Vertex3.Uorder
- * ctx->EvalMap.Map2Vertex3.Vorder * 3;
- break;
- case GL_MAP2_VERTEX_4:
- data = ctx->EvalMap.Map2Vertex4.Points;
- n = ctx->EvalMap.Map2Vertex4.Uorder
- * ctx->EvalMap.Map2Vertex4.Vorder * 4;
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapdv(target)" );
- return;
- }
+ if (map1d) {
+ data = map1d->Points;
+ n = map1d->Order * comps;
+ }
+ else {
+ data = map2d->Points;
+ n = map2d->Uorder * map2d->Vorder * comps;
+ }
if (data) {
for (i=0;i<n;i++) {
v[i] = data[i];
@@ -586,170 +579,25 @@ _mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v )
}
break;
case GL_ORDER:
- switch (target) {
- case GL_MAP1_COLOR_4:
- *v = ctx->EvalMap.Map1Color4.Order;
- break;
- case GL_MAP1_INDEX:
- *v = ctx->EvalMap.Map1Index.Order;
- break;
- case GL_MAP1_NORMAL:
- *v = ctx->EvalMap.Map1Normal.Order;
- break;
- case GL_MAP1_TEXTURE_COORD_1:
- *v = ctx->EvalMap.Map1Texture1.Order;
- break;
- case GL_MAP1_TEXTURE_COORD_2:
- *v = ctx->EvalMap.Map1Texture2.Order;
- break;
- case GL_MAP1_TEXTURE_COORD_3:
- *v = ctx->EvalMap.Map1Texture3.Order;
- break;
- case GL_MAP1_TEXTURE_COORD_4:
- *v = ctx->EvalMap.Map1Texture4.Order;
- break;
- case GL_MAP1_VERTEX_3:
- *v = ctx->EvalMap.Map1Vertex3.Order;
- break;
- case GL_MAP1_VERTEX_4:
- *v = ctx->EvalMap.Map1Vertex4.Order;
- break;
- case GL_MAP2_COLOR_4:
- v[0] = ctx->EvalMap.Map2Color4.Uorder;
- v[1] = ctx->EvalMap.Map2Color4.Vorder;
- break;
- case GL_MAP2_INDEX:
- v[0] = ctx->EvalMap.Map2Index.Uorder;
- v[1] = ctx->EvalMap.Map2Index.Vorder;
- break;
- case GL_MAP2_NORMAL:
- v[0] = ctx->EvalMap.Map2Normal.Uorder;
- v[1] = ctx->EvalMap.Map2Normal.Vorder;
- break;
- case GL_MAP2_TEXTURE_COORD_1:
- v[0] = ctx->EvalMap.Map2Texture1.Uorder;
- v[1] = ctx->EvalMap.Map2Texture1.Vorder;
- break;
- case GL_MAP2_TEXTURE_COORD_2:
- v[0] = ctx->EvalMap.Map2Texture2.Uorder;
- v[1] = ctx->EvalMap.Map2Texture2.Vorder;
- break;
- case GL_MAP2_TEXTURE_COORD_3:
- v[0] = ctx->EvalMap.Map2Texture3.Uorder;
- v[1] = ctx->EvalMap.Map2Texture3.Vorder;
- break;
- case GL_MAP2_TEXTURE_COORD_4:
- v[0] = ctx->EvalMap.Map2Texture4.Uorder;
- v[1] = ctx->EvalMap.Map2Texture4.Vorder;
- break;
- case GL_MAP2_VERTEX_3:
- v[0] = ctx->EvalMap.Map2Vertex3.Uorder;
- v[1] = ctx->EvalMap.Map2Vertex3.Vorder;
- break;
- case GL_MAP2_VERTEX_4:
- v[0] = ctx->EvalMap.Map2Vertex4.Uorder;
- v[1] = ctx->EvalMap.Map2Vertex4.Vorder;
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapdv(target)" );
- return;
- }
+ if (map1d) {
+ v[0] = (GLdouble) map1d->Order;
+ }
+ else {
+ v[0] = (GLdouble) map2d->Uorder;
+ v[1] = (GLdouble) map2d->Vorder;
+ }
break;
case GL_DOMAIN:
- switch (target) {
- case GL_MAP1_COLOR_4:
- v[0] = ctx->EvalMap.Map1Color4.u1;
- v[1] = ctx->EvalMap.Map1Color4.u2;
- break;
- case GL_MAP1_INDEX:
- v[0] = ctx->EvalMap.Map1Index.u1;
- v[1] = ctx->EvalMap.Map1Index.u2;
- break;
- case GL_MAP1_NORMAL:
- v[0] = ctx->EvalMap.Map1Normal.u1;
- v[1] = ctx->EvalMap.Map1Normal.u2;
- break;
- case GL_MAP1_TEXTURE_COORD_1:
- v[0] = ctx->EvalMap.Map1Texture1.u1;
- v[1] = ctx->EvalMap.Map1Texture1.u2;
- break;
- case GL_MAP1_TEXTURE_COORD_2:
- v[0] = ctx->EvalMap.Map1Texture2.u1;
- v[1] = ctx->EvalMap.Map1Texture2.u2;
- break;
- case GL_MAP1_TEXTURE_COORD_3:
- v[0] = ctx->EvalMap.Map1Texture3.u1;
- v[1] = ctx->EvalMap.Map1Texture3.u2;
- break;
- case GL_MAP1_TEXTURE_COORD_4:
- v[0] = ctx->EvalMap.Map1Texture4.u1;
- v[1] = ctx->EvalMap.Map1Texture4.u2;
- break;
- case GL_MAP1_VERTEX_3:
- v[0] = ctx->EvalMap.Map1Vertex3.u1;
- v[1] = ctx->EvalMap.Map1Vertex3.u2;
- break;
- case GL_MAP1_VERTEX_4:
- v[0] = ctx->EvalMap.Map1Vertex4.u1;
- v[1] = ctx->EvalMap.Map1Vertex4.u2;
- break;
- case GL_MAP2_COLOR_4:
- v[0] = ctx->EvalMap.Map2Color4.u1;
- v[1] = ctx->EvalMap.Map2Color4.u2;
- v[2] = ctx->EvalMap.Map2Color4.v1;
- v[3] = ctx->EvalMap.Map2Color4.v2;
- break;
- case GL_MAP2_INDEX:
- v[0] = ctx->EvalMap.Map2Index.u1;
- v[1] = ctx->EvalMap.Map2Index.u2;
- v[2] = ctx->EvalMap.Map2Index.v1;
- v[3] = ctx->EvalMap.Map2Index.v2;
- break;
- case GL_MAP2_NORMAL:
- v[0] = ctx->EvalMap.Map2Normal.u1;
- v[1] = ctx->EvalMap.Map2Normal.u2;
- v[2] = ctx->EvalMap.Map2Normal.v1;
- v[3] = ctx->EvalMap.Map2Normal.v2;
- break;
- case GL_MAP2_TEXTURE_COORD_1:
- v[0] = ctx->EvalMap.Map2Texture1.u1;
- v[1] = ctx->EvalMap.Map2Texture1.u2;
- v[2] = ctx->EvalMap.Map2Texture1.v1;
- v[3] = ctx->EvalMap.Map2Texture1.v2;
- break;
- case GL_MAP2_TEXTURE_COORD_2:
- v[0] = ctx->EvalMap.Map2Texture2.u1;
- v[1] = ctx->EvalMap.Map2Texture2.u2;
- v[2] = ctx->EvalMap.Map2Texture2.v1;
- v[3] = ctx->EvalMap.Map2Texture2.v2;
- break;
- case GL_MAP2_TEXTURE_COORD_3:
- v[0] = ctx->EvalMap.Map2Texture3.u1;
- v[1] = ctx->EvalMap.Map2Texture3.u2;
- v[2] = ctx->EvalMap.Map2Texture3.v1;
- v[3] = ctx->EvalMap.Map2Texture3.v2;
- break;
- case GL_MAP2_TEXTURE_COORD_4:
- v[0] = ctx->EvalMap.Map2Texture4.u1;
- v[1] = ctx->EvalMap.Map2Texture4.u2;
- v[2] = ctx->EvalMap.Map2Texture4.v1;
- v[3] = ctx->EvalMap.Map2Texture4.v2;
- break;
- case GL_MAP2_VERTEX_3:
- v[0] = ctx->EvalMap.Map2Vertex3.u1;
- v[1] = ctx->EvalMap.Map2Vertex3.u2;
- v[2] = ctx->EvalMap.Map2Vertex3.v1;
- v[3] = ctx->EvalMap.Map2Vertex3.v2;
- break;
- case GL_MAP2_VERTEX_4:
- v[0] = ctx->EvalMap.Map2Vertex4.u1;
- v[1] = ctx->EvalMap.Map2Vertex4.u2;
- v[2] = ctx->EvalMap.Map2Vertex4.v1;
- v[3] = ctx->EvalMap.Map2Vertex4.v2;
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapdv(target)" );
- }
+ if (map1d) {
+ v[0] = (GLdouble) map1d->u1;
+ v[1] = (GLdouble) map1d->u2;
+ }
+ else {
+ v[0] = (GLdouble) map2d->u1;
+ v[1] = (GLdouble) map2d->u2;
+ v[2] = (GLdouble) map2d->v1;
+ v[3] = (GLdouble) map2d->v2;
+ }
break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glGetMapdv(query)" );
@@ -761,98 +609,34 @@ void
_mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
+ struct gl_1d_map *map1d;
+ struct gl_2d_map *map2d;
GLint i, n;
GLfloat *data;
+ GLuint comps;
+
ASSERT_OUTSIDE_BEGIN_END(ctx);
+ comps = _mesa_evaluator_components(target);
+ if (!comps) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapfv(target)" );
+ return;
+ }
+
+ map1d = get_1d_map(ctx, target);
+ map2d = get_2d_map(ctx, target);
+ ASSERT(map1d || map2d);
+
switch (query) {
case GL_COEFF:
- switch (target) {
- case GL_MAP1_COLOR_4:
- data = ctx->EvalMap.Map1Color4.Points;
- n = ctx->EvalMap.Map1Color4.Order * 4;
- break;
- case GL_MAP1_INDEX:
- data = ctx->EvalMap.Map1Index.Points;
- n = ctx->EvalMap.Map1Index.Order;
- break;
- case GL_MAP1_NORMAL:
- data = ctx->EvalMap.Map1Normal.Points;
- n = ctx->EvalMap.Map1Normal.Order * 3;
- break;
- case GL_MAP1_TEXTURE_COORD_1:
- data = ctx->EvalMap.Map1Texture1.Points;
- n = ctx->EvalMap.Map1Texture1.Order * 1;
- break;
- case GL_MAP1_TEXTURE_COORD_2:
- data = ctx->EvalMap.Map1Texture2.Points;
- n = ctx->EvalMap.Map1Texture2.Order * 2;
- break;
- case GL_MAP1_TEXTURE_COORD_3:
- data = ctx->EvalMap.Map1Texture3.Points;
- n = ctx->EvalMap.Map1Texture3.Order * 3;
- break;
- case GL_MAP1_TEXTURE_COORD_4:
- data = ctx->EvalMap.Map1Texture4.Points;
- n = ctx->EvalMap.Map1Texture4.Order * 4;
- break;
- case GL_MAP1_VERTEX_3:
- data = ctx->EvalMap.Map1Vertex3.Points;
- n = ctx->EvalMap.Map1Vertex3.Order * 3;
- break;
- case GL_MAP1_VERTEX_4:
- data = ctx->EvalMap.Map1Vertex4.Points;
- n = ctx->EvalMap.Map1Vertex4.Order * 4;
- break;
- case GL_MAP2_COLOR_4:
- data = ctx->EvalMap.Map2Color4.Points;
- n = ctx->EvalMap.Map2Color4.Uorder
- * ctx->EvalMap.Map2Color4.Vorder * 4;
- break;
- case GL_MAP2_INDEX:
- data = ctx->EvalMap.Map2Index.Points;
- n = ctx->EvalMap.Map2Index.Uorder
- * ctx->EvalMap.Map2Index.Vorder;
- break;
- case GL_MAP2_NORMAL:
- data = ctx->EvalMap.Map2Normal.Points;
- n = ctx->EvalMap.Map2Normal.Uorder
- * ctx->EvalMap.Map2Normal.Vorder * 3;
- break;
- case GL_MAP2_TEXTURE_COORD_1:
- data = ctx->EvalMap.Map2Texture1.Points;
- n = ctx->EvalMap.Map2Texture1.Uorder
- * ctx->EvalMap.Map2Texture1.Vorder * 1;
- break;
- case GL_MAP2_TEXTURE_COORD_2:
- data = ctx->EvalMap.Map2Texture2.Points;
- n = ctx->EvalMap.Map2Texture2.Uorder
- * ctx->EvalMap.Map2Texture2.Vorder * 2;
- break;
- case GL_MAP2_TEXTURE_COORD_3:
- data = ctx->EvalMap.Map2Texture3.Points;
- n = ctx->EvalMap.Map2Texture3.Uorder
- * ctx->EvalMap.Map2Texture3.Vorder * 3;
- break;
- case GL_MAP2_TEXTURE_COORD_4:
- data = ctx->EvalMap.Map2Texture4.Points;
- n = ctx->EvalMap.Map2Texture4.Uorder
- * ctx->EvalMap.Map2Texture4.Vorder * 4;
- break;
- case GL_MAP2_VERTEX_3:
- data = ctx->EvalMap.Map2Vertex3.Points;
- n = ctx->EvalMap.Map2Vertex3.Uorder
- * ctx->EvalMap.Map2Vertex3.Vorder * 3;
- break;
- case GL_MAP2_VERTEX_4:
- data = ctx->EvalMap.Map2Vertex4.Points;
- n = ctx->EvalMap.Map2Vertex4.Uorder
- * ctx->EvalMap.Map2Vertex4.Vorder * 4;
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapfv(target)" );
- return;
- }
+ if (map1d) {
+ data = map1d->Points;
+ n = map1d->Order * comps;
+ }
+ else {
+ data = map2d->Points;
+ n = map2d->Uorder * map2d->Vorder * comps;
+ }
if (data) {
for (i=0;i<n;i++) {
v[i] = data[i];
@@ -860,170 +644,25 @@ _mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v )
}
break;
case GL_ORDER:
- switch (target) {
- case GL_MAP1_COLOR_4:
- *v = (GLfloat) ctx->EvalMap.Map1Color4.Order;
- break;
- case GL_MAP1_INDEX:
- *v = (GLfloat) ctx->EvalMap.Map1Index.Order;
- break;
- case GL_MAP1_NORMAL:
- *v = (GLfloat) ctx->EvalMap.Map1Normal.Order;
- break;
- case GL_MAP1_TEXTURE_COORD_1:
- *v = (GLfloat) ctx->EvalMap.Map1Texture1.Order;
- break;
- case GL_MAP1_TEXTURE_COORD_2:
- *v = (GLfloat) ctx->EvalMap.Map1Texture2.Order;
- break;
- case GL_MAP1_TEXTURE_COORD_3:
- *v = (GLfloat) ctx->EvalMap.Map1Texture3.Order;
- break;
- case GL_MAP1_TEXTURE_COORD_4:
- *v = (GLfloat) ctx->EvalMap.Map1Texture4.Order;
- break;
- case GL_MAP1_VERTEX_3:
- *v = (GLfloat) ctx->EvalMap.Map1Vertex3.Order;
- break;
- case GL_MAP1_VERTEX_4:
- *v = (GLfloat) ctx->EvalMap.Map1Vertex4.Order;
- break;
- case GL_MAP2_COLOR_4:
- v[0] = (GLfloat) ctx->EvalMap.Map2Color4.Uorder;
- v[1] = (GLfloat) ctx->EvalMap.Map2Color4.Vorder;
- break;
- case GL_MAP2_INDEX:
- v[0] = (GLfloat) ctx->EvalMap.Map2Index.Uorder;
- v[1] = (GLfloat) ctx->EvalMap.Map2Index.Vorder;
- break;
- case GL_MAP2_NORMAL:
- v[0] = (GLfloat) ctx->EvalMap.Map2Normal.Uorder;
- v[1] = (GLfloat) ctx->EvalMap.Map2Normal.Vorder;
- break;
- case GL_MAP2_TEXTURE_COORD_1:
- v[0] = (GLfloat) ctx->EvalMap.Map2Texture1.Uorder;
- v[1] = (GLfloat) ctx->EvalMap.Map2Texture1.Vorder;
- break;
- case GL_MAP2_TEXTURE_COORD_2:
- v[0] = (GLfloat) ctx->EvalMap.Map2Texture2.Uorder;
- v[1] = (GLfloat) ctx->EvalMap.Map2Texture2.Vorder;
- break;
- case GL_MAP2_TEXTURE_COORD_3:
- v[0] = (GLfloat) ctx->EvalMap.Map2Texture3.Uorder;
- v[1] = (GLfloat) ctx->EvalMap.Map2Texture3.Vorder;
- break;
- case GL_MAP2_TEXTURE_COORD_4:
- v[0] = (GLfloat) ctx->EvalMap.Map2Texture4.Uorder;
- v[1] = (GLfloat) ctx->EvalMap.Map2Texture4.Vorder;
- break;
- case GL_MAP2_VERTEX_3:
- v[0] = (GLfloat) ctx->EvalMap.Map2Vertex3.Uorder;
- v[1] = (GLfloat) ctx->EvalMap.Map2Vertex3.Vorder;
- break;
- case GL_MAP2_VERTEX_4:
- v[0] = (GLfloat) ctx->EvalMap.Map2Vertex4.Uorder;
- v[1] = (GLfloat) ctx->EvalMap.Map2Vertex4.Vorder;
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapfv(target)" );
- return;
- }
+ if (map1d) {
+ v[0] = (GLfloat) map1d->Order;
+ }
+ else {
+ v[0] = (GLfloat) map2d->Uorder;
+ v[1] = (GLfloat) map2d->Vorder;
+ }
break;
case GL_DOMAIN:
- switch (target) {
- case GL_MAP1_COLOR_4:
- v[0] = ctx->EvalMap.Map1Color4.u1;
- v[1] = ctx->EvalMap.Map1Color4.u2;
- break;
- case GL_MAP1_INDEX:
- v[0] = ctx->EvalMap.Map1Index.u1;
- v[1] = ctx->EvalMap.Map1Index.u2;
- break;
- case GL_MAP1_NORMAL:
- v[0] = ctx->EvalMap.Map1Normal.u1;
- v[1] = ctx->EvalMap.Map1Normal.u2;
- break;
- case GL_MAP1_TEXTURE_COORD_1:
- v[0] = ctx->EvalMap.Map1Texture1.u1;
- v[1] = ctx->EvalMap.Map1Texture1.u2;
- break;
- case GL_MAP1_TEXTURE_COORD_2:
- v[0] = ctx->EvalMap.Map1Texture2.u1;
- v[1] = ctx->EvalMap.Map1Texture2.u2;
- break;
- case GL_MAP1_TEXTURE_COORD_3:
- v[0] = ctx->EvalMap.Map1Texture3.u1;
- v[1] = ctx->EvalMap.Map1Texture3.u2;
- break;
- case GL_MAP1_TEXTURE_COORD_4:
- v[0] = ctx->EvalMap.Map1Texture4.u1;
- v[1] = ctx->EvalMap.Map1Texture4.u2;
- break;
- case GL_MAP1_VERTEX_3:
- v[0] = ctx->EvalMap.Map1Vertex3.u1;
- v[1] = ctx->EvalMap.Map1Vertex3.u2;
- break;
- case GL_MAP1_VERTEX_4:
- v[0] = ctx->EvalMap.Map1Vertex4.u1;
- v[1] = ctx->EvalMap.Map1Vertex4.u2;
- break;
- case GL_MAP2_COLOR_4:
- v[0] = ctx->EvalMap.Map2Color4.u1;
- v[1] = ctx->EvalMap.Map2Color4.u2;
- v[2] = ctx->EvalMap.Map2Color4.v1;
- v[3] = ctx->EvalMap.Map2Color4.v2;
- break;
- case GL_MAP2_INDEX:
- v[0] = ctx->EvalMap.Map2Index.u1;
- v[1] = ctx->EvalMap.Map2Index.u2;
- v[2] = ctx->EvalMap.Map2Index.v1;
- v[3] = ctx->EvalMap.Map2Index.v2;
- break;
- case GL_MAP2_NORMAL:
- v[0] = ctx->EvalMap.Map2Normal.u1;
- v[1] = ctx->EvalMap.Map2Normal.u2;
- v[2] = ctx->EvalMap.Map2Normal.v1;
- v[3] = ctx->EvalMap.Map2Normal.v2;
- break;
- case GL_MAP2_TEXTURE_COORD_1:
- v[0] = ctx->EvalMap.Map2Texture1.u1;
- v[1] = ctx->EvalMap.Map2Texture1.u2;
- v[2] = ctx->EvalMap.Map2Texture1.v1;
- v[3] = ctx->EvalMap.Map2Texture1.v2;
- break;
- case GL_MAP2_TEXTURE_COORD_2:
- v[0] = ctx->EvalMap.Map2Texture2.u1;
- v[1] = ctx->EvalMap.Map2Texture2.u2;
- v[2] = ctx->EvalMap.Map2Texture2.v1;
- v[3] = ctx->EvalMap.Map2Texture2.v2;
- break;
- case GL_MAP2_TEXTURE_COORD_3:
- v[0] = ctx->EvalMap.Map2Texture3.u1;
- v[1] = ctx->EvalMap.Map2Texture3.u2;
- v[2] = ctx->EvalMap.Map2Texture3.v1;
- v[3] = ctx->EvalMap.Map2Texture3.v2;
- break;
- case GL_MAP2_TEXTURE_COORD_4:
- v[0] = ctx->EvalMap.Map2Texture4.u1;
- v[1] = ctx->EvalMap.Map2Texture4.u2;
- v[2] = ctx->EvalMap.Map2Texture4.v1;
- v[3] = ctx->EvalMap.Map2Texture4.v2;
- break;
- case GL_MAP2_VERTEX_3:
- v[0] = ctx->EvalMap.Map2Vertex3.u1;
- v[1] = ctx->EvalMap.Map2Vertex3.u2;
- v[2] = ctx->EvalMap.Map2Vertex3.v1;
- v[3] = ctx->EvalMap.Map2Vertex3.v2;
- break;
- case GL_MAP2_VERTEX_4:
- v[0] = ctx->EvalMap.Map2Vertex4.u1;
- v[1] = ctx->EvalMap.Map2Vertex4.u2;
- v[2] = ctx->EvalMap.Map2Vertex4.v1;
- v[3] = ctx->EvalMap.Map2Vertex4.v2;
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapfv(target)" );
- }
+ if (map1d) {
+ v[0] = map1d->u1;
+ v[1] = map1d->u2;
+ }
+ else {
+ v[0] = map2d->u1;
+ v[1] = map2d->u2;
+ v[2] = map2d->v1;
+ v[3] = map2d->v2;
+ }
break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glGetMapfv(query)" );
@@ -1035,98 +674,34 @@ void
_mesa_GetMapiv( GLenum target, GLenum query, GLint *v )
{
GET_CURRENT_CONTEXT(ctx);
+ struct gl_1d_map *map1d;
+ struct gl_2d_map *map2d;
GLuint i, n;
GLfloat *data;
+ GLuint comps;
+
ASSERT_OUTSIDE_BEGIN_END(ctx);
+ comps = _mesa_evaluator_components(target);
+ if (!comps) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapiv(target)" );
+ return;
+ }
+
+ map1d = get_1d_map(ctx, target);
+ map2d = get_2d_map(ctx, target);
+ ASSERT(map1d || map2d);
+
switch (query) {
case GL_COEFF:
- switch (target) {
- case GL_MAP1_COLOR_4:
- data = ctx->EvalMap.Map1Color4.Points;
- n = ctx->EvalMap.Map1Color4.Order * 4;
- break;
- case GL_MAP1_INDEX:
- data = ctx->EvalMap.Map1Index.Points;
- n = ctx->EvalMap.Map1Index.Order;
- break;
- case GL_MAP1_NORMAL:
- data = ctx->EvalMap.Map1Normal.Points;
- n = ctx->EvalMap.Map1Normal.Order * 3;
- break;
- case GL_MAP1_TEXTURE_COORD_1:
- data = ctx->EvalMap.Map1Texture1.Points;
- n = ctx->EvalMap.Map1Texture1.Order * 1;
- break;
- case GL_MAP1_TEXTURE_COORD_2:
- data = ctx->EvalMap.Map1Texture2.Points;
- n = ctx->EvalMap.Map1Texture2.Order * 2;
- break;
- case GL_MAP1_TEXTURE_COORD_3:
- data = ctx->EvalMap.Map1Texture3.Points;
- n = ctx->EvalMap.Map1Texture3.Order * 3;
- break;
- case GL_MAP1_TEXTURE_COORD_4:
- data = ctx->EvalMap.Map1Texture4.Points;
- n = ctx->EvalMap.Map1Texture4.Order * 4;
- break;
- case GL_MAP1_VERTEX_3:
- data = ctx->EvalMap.Map1Vertex3.Points;
- n = ctx->EvalMap.Map1Vertex3.Order * 3;
- break;
- case GL_MAP1_VERTEX_4:
- data = ctx->EvalMap.Map1Vertex4.Points;
- n = ctx->EvalMap.Map1Vertex4.Order * 4;
- break;
- case GL_MAP2_COLOR_4:
- data = ctx->EvalMap.Map2Color4.Points;
- n = ctx->EvalMap.Map2Color4.Uorder
- * ctx->EvalMap.Map2Color4.Vorder * 4;
- break;
- case GL_MAP2_INDEX:
- data = ctx->EvalMap.Map2Index.Points;
- n = ctx->EvalMap.Map2Index.Uorder
- * ctx->EvalMap.Map2Index.Vorder;
- break;
- case GL_MAP2_NORMAL:
- data = ctx->EvalMap.Map2Normal.Points;
- n = ctx->EvalMap.Map2Normal.Uorder
- * ctx->EvalMap.Map2Normal.Vorder * 3;
- break;
- case GL_MAP2_TEXTURE_COORD_1:
- data = ctx->EvalMap.Map2Texture1.Points;
- n = ctx->EvalMap.Map2Texture1.Uorder
- * ctx->EvalMap.Map2Texture1.Vorder * 1;
- break;
- case GL_MAP2_TEXTURE_COORD_2:
- data = ctx->EvalMap.Map2Texture2.Points;
- n = ctx->EvalMap.Map2Texture2.Uorder
- * ctx->EvalMap.Map2Texture2.Vorder * 2;
- break;
- case GL_MAP2_TEXTURE_COORD_3:
- data = ctx->EvalMap.Map2Texture3.Points;
- n = ctx->EvalMap.Map2Texture3.Uorder
- * ctx->EvalMap.Map2Texture3.Vorder * 3;
- break;
- case GL_MAP2_TEXTURE_COORD_4:
- data = ctx->EvalMap.Map2Texture4.Points;
- n = ctx->EvalMap.Map2Texture4.Uorder
- * ctx->EvalMap.Map2Texture4.Vorder * 4;
- break;
- case GL_MAP2_VERTEX_3:
- data = ctx->EvalMap.Map2Vertex3.Points;
- n = ctx->EvalMap.Map2Vertex3.Uorder
- * ctx->EvalMap.Map2Vertex3.Vorder * 3;
- break;
- case GL_MAP2_VERTEX_4:
- data = ctx->EvalMap.Map2Vertex4.Points;
- n = ctx->EvalMap.Map2Vertex4.Uorder
- * ctx->EvalMap.Map2Vertex4.Vorder * 4;
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapiv(target)" );
- return;
- }
+ if (map1d) {
+ data = map1d->Points;
+ n = map1d->Order * comps;
+ }
+ else {
+ data = map2d->Points;
+ n = map2d->Uorder * map2d->Vorder * comps;
+ }
if (data) {
for (i=0;i<n;i++) {
v[i] = ROUNDF(data[i]);
@@ -1134,170 +709,25 @@ _mesa_GetMapiv( GLenum target, GLenum query, GLint *v )
}
break;
case GL_ORDER:
- switch (target) {
- case GL_MAP1_COLOR_4:
- *v = ctx->EvalMap.Map1Color4.Order;
- break;
- case GL_MAP1_INDEX:
- *v = ctx->EvalMap.Map1Index.Order;
- break;
- case GL_MAP1_NORMAL:
- *v = ctx->EvalMap.Map1Normal.Order;
- break;
- case GL_MAP1_TEXTURE_COORD_1:
- *v = ctx->EvalMap.Map1Texture1.Order;
- break;
- case GL_MAP1_TEXTURE_COORD_2:
- *v = ctx->EvalMap.Map1Texture2.Order;
- break;
- case GL_MAP1_TEXTURE_COORD_3:
- *v = ctx->EvalMap.Map1Texture3.Order;
- break;
- case GL_MAP1_TEXTURE_COORD_4:
- *v = ctx->EvalMap.Map1Texture4.Order;
- break;
- case GL_MAP1_VERTEX_3:
- *v = ctx->EvalMap.Map1Vertex3.Order;
- break;
- case GL_MAP1_VERTEX_4:
- *v = ctx->EvalMap.Map1Vertex4.Order;
- break;
- case GL_MAP2_COLOR_4:
- v[0] = ctx->EvalMap.Map2Color4.Uorder;
- v[1] = ctx->EvalMap.Map2Color4.Vorder;
- break;
- case GL_MAP2_INDEX:
- v[0] = ctx->EvalMap.Map2Index.Uorder;
- v[1] = ctx->EvalMap.Map2Index.Vorder;
- break;
- case GL_MAP2_NORMAL:
- v[0] = ctx->EvalMap.Map2Normal.Uorder;
- v[1] = ctx->EvalMap.Map2Normal.Vorder;
- break;
- case GL_MAP2_TEXTURE_COORD_1:
- v[0] = ctx->EvalMap.Map2Texture1.Uorder;
- v[1] = ctx->EvalMap.Map2Texture1.Vorder;
- break;
- case GL_MAP2_TEXTURE_COORD_2:
- v[0] = ctx->EvalMap.Map2Texture2.Uorder;
- v[1] = ctx->EvalMap.Map2Texture2.Vorder;
- break;
- case GL_MAP2_TEXTURE_COORD_3:
- v[0] = ctx->EvalMap.Map2Texture3.Uorder;
- v[1] = ctx->EvalMap.Map2Texture3.Vorder;
- break;
- case GL_MAP2_TEXTURE_COORD_4:
- v[0] = ctx->EvalMap.Map2Texture4.Uorder;
- v[1] = ctx->EvalMap.Map2Texture4.Vorder;
- break;
- case GL_MAP2_VERTEX_3:
- v[0] = ctx->EvalMap.Map2Vertex3.Uorder;
- v[1] = ctx->EvalMap.Map2Vertex3.Vorder;
- break;
- case GL_MAP2_VERTEX_4:
- v[0] = ctx->EvalMap.Map2Vertex4.Uorder;
- v[1] = ctx->EvalMap.Map2Vertex4.Vorder;
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapiv(target)" );
- return;
- }
+ if (map1d) {
+ v[0] = map1d->Order;
+ }
+ else {
+ v[0] = map2d->Uorder;
+ v[1] = map2d->Vorder;
+ }
break;
case GL_DOMAIN:
- switch (target) {
- case GL_MAP1_COLOR_4:
- v[0] = ROUNDF(ctx->EvalMap.Map1Color4.u1);
- v[1] = ROUNDF(ctx->EvalMap.Map1Color4.u2);
- break;
- case GL_MAP1_INDEX:
- v[0] = ROUNDF(ctx->EvalMap.Map1Index.u1);
- v[1] = ROUNDF(ctx->EvalMap.Map1Index.u2);
- break;
- case GL_MAP1_NORMAL:
- v[0] = ROUNDF(ctx->EvalMap.Map1Normal.u1);
- v[1] = ROUNDF(ctx->EvalMap.Map1Normal.u2);
- break;
- case GL_MAP1_TEXTURE_COORD_1:
- v[0] = ROUNDF(ctx->EvalMap.Map1Texture1.u1);
- v[1] = ROUNDF(ctx->EvalMap.Map1Texture1.u2);
- break;
- case GL_MAP1_TEXTURE_COORD_2:
- v[0] = ROUNDF(ctx->EvalMap.Map1Texture2.u1);
- v[1] = ROUNDF(ctx->EvalMap.Map1Texture2.u2);
- break;
- case GL_MAP1_TEXTURE_COORD_3:
- v[0] = ROUNDF(ctx->EvalMap.Map1Texture3.u1);
- v[1] = ROUNDF(ctx->EvalMap.Map1Texture3.u2);
- break;
- case GL_MAP1_TEXTURE_COORD_4:
- v[0] = ROUNDF(ctx->EvalMap.Map1Texture4.u1);
- v[1] = ROUNDF(ctx->EvalMap.Map1Texture4.u2);
- break;
- case GL_MAP1_VERTEX_3:
- v[0] = ROUNDF(ctx->EvalMap.Map1Vertex3.u1);
- v[1] = ROUNDF(ctx->EvalMap.Map1Vertex3.u2);
- break;
- case GL_MAP1_VERTEX_4:
- v[0] = ROUNDF(ctx->EvalMap.Map1Vertex4.u1);
- v[1] = ROUNDF(ctx->EvalMap.Map1Vertex4.u2);
- break;
- case GL_MAP2_COLOR_4:
- v[0] = ROUNDF(ctx->EvalMap.Map2Color4.u1);
- v[1] = ROUNDF(ctx->EvalMap.Map2Color4.u2);
- v[2] = ROUNDF(ctx->EvalMap.Map2Color4.v1);
- v[3] = ROUNDF(ctx->EvalMap.Map2Color4.v2);
- break;
- case GL_MAP2_INDEX:
- v[0] = ROUNDF(ctx->EvalMap.Map2Index.u1);
- v[1] = ROUNDF(ctx->EvalMap.Map2Index.u2);
- v[2] = ROUNDF(ctx->EvalMap.Map2Index.v1);
- v[3] = ROUNDF(ctx->EvalMap.Map2Index.v2);
- break;
- case GL_MAP2_NORMAL:
- v[0] = ROUNDF(ctx->EvalMap.Map2Normal.u1);
- v[1] = ROUNDF(ctx->EvalMap.Map2Normal.u2);
- v[2] = ROUNDF(ctx->EvalMap.Map2Normal.v1);
- v[3] = ROUNDF(ctx->EvalMap.Map2Normal.v2);
- break;
- case GL_MAP2_TEXTURE_COORD_1:
- v[0] = ROUNDF(ctx->EvalMap.Map2Texture1.u1);
- v[1] = ROUNDF(ctx->EvalMap.Map2Texture1.u2);
- v[2] = ROUNDF(ctx->EvalMap.Map2Texture1.v1);
- v[3] = ROUNDF(ctx->EvalMap.Map2Texture1.v2);
- break;
- case GL_MAP2_TEXTURE_COORD_2:
- v[0] = ROUNDF(ctx->EvalMap.Map2Texture2.u1);
- v[1] = ROUNDF(ctx->EvalMap.Map2Texture2.u2);
- v[2] = ROUNDF(ctx->EvalMap.Map2Texture2.v1);
- v[3] = ROUNDF(ctx->EvalMap.Map2Texture2.v2);
- break;
- case GL_MAP2_TEXTURE_COORD_3:
- v[0] = ROUNDF(ctx->EvalMap.Map2Texture3.u1);
- v[1] = ROUNDF(ctx->EvalMap.Map2Texture3.u2);
- v[2] = ROUNDF(ctx->EvalMap.Map2Texture3.v1);
- v[3] = ROUNDF(ctx->EvalMap.Map2Texture3.v2);
- break;
- case GL_MAP2_TEXTURE_COORD_4:
- v[0] = ROUNDF(ctx->EvalMap.Map2Texture4.u1);
- v[1] = ROUNDF(ctx->EvalMap.Map2Texture4.u2);
- v[2] = ROUNDF(ctx->EvalMap.Map2Texture4.v1);
- v[3] = ROUNDF(ctx->EvalMap.Map2Texture4.v2);
- break;
- case GL_MAP2_VERTEX_3:
- v[0] = ROUNDF(ctx->EvalMap.Map2Vertex3.u1);
- v[1] = ROUNDF(ctx->EvalMap.Map2Vertex3.u2);
- v[2] = ROUNDF(ctx->EvalMap.Map2Vertex3.v1);
- v[3] = ROUNDF(ctx->EvalMap.Map2Vertex3.v2);
- break;
- case GL_MAP2_VERTEX_4:
- v[0] = ROUNDF(ctx->EvalMap.Map2Vertex4.u1);
- v[1] = ROUNDF(ctx->EvalMap.Map2Vertex4.u2);
- v[2] = ROUNDF(ctx->EvalMap.Map2Vertex4.v1);
- v[3] = ROUNDF(ctx->EvalMap.Map2Vertex4.v2);
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapiv(target)" );
- }
+ if (map1d) {
+ v[0] = ROUNDF(map1d->u1);
+ v[1] = ROUNDF(map1d->u2);
+ }
+ else {
+ v[0] = ROUNDF(map2d->u1);
+ v[1] = ROUNDF(map2d->u2);
+ v[2] = ROUNDF(map2d->v1);
+ v[3] = ROUNDF(map2d->v2);
+ }
break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glGetMapiv(query)" );
diff --git a/xc/extras/Mesa/src/extensions.c b/xc/extras/Mesa/src/extensions.c
index b4ed8ed91..c61127490 100644
--- a/xc/extras/Mesa/src/extensions.c
+++ b/xc/extras/Mesa/src/extensions.c
@@ -1,7 +1,6 @@
-
/*
* Mesa 3-D graphics library
- * Version: 4.0.4
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -23,17 +22,12 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "context.h"
#include "extensions.h"
-#include "mem.h"
#include "simple_list.h"
#include "mtypes.h"
-#endif
#define MAX_EXT_NAMELEN 80
@@ -55,17 +49,25 @@ static struct {
const char *name;
int flag_offset;
} default_extensions[] = {
+ { OFF, "GL_ARB_depth_texture", F(ARB_depth_texture) },
{ OFF, "GL_ARB_imaging", F(ARB_imaging) },
{ OFF, "GL_ARB_multisample", F(ARB_multisample) },
{ OFF, "GL_ARB_multitexture", F(ARB_multitexture) },
+ { OFF, "GL_ARB_point_parameters", F(EXT_point_parameters) },
+ { 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) },
{ OFF, "GL_ARB_texture_compression", F(ARB_texture_compression) },
{ OFF, "GL_ARB_texture_cube_map", F(ARB_texture_cube_map) },
{ OFF, "GL_ARB_texture_env_add", F(EXT_texture_env_add) },
{ OFF, "GL_ARB_texture_env_combine", F(ARB_texture_env_combine) },
+ { OFF, "GL_ARB_texture_env_crossbar", F(ARB_texture_env_crossbar) },
{ OFF, "GL_ARB_texture_env_dot3", F(ARB_texture_env_dot3) },
{ OFF, "GL_ARB_texture_mirrored_repeat", F(ARB_texture_mirrored_repeat)},
{ ON, "GL_ARB_transpose_matrix", 0 },
+ { ON, "GL_ARB_window_pos", F(ARB_window_pos) },
+ { OFF, "GL_ATI_texture_mirror_once", F(ATI_texture_mirror_once)},
+ { OFF, "GL_ATI_texture_env_combine3", F(ATI_texture_env_combine3)},
{ ON, "GL_EXT_abgr", 0 },
{ ON, "GL_EXT_bgra", 0 },
{ OFF, "GL_EXT_blend_color", F(EXT_blend_color) },
@@ -74,19 +76,21 @@ static struct {
{ OFF, "GL_EXT_blend_minmax", F(EXT_blend_minmax) },
{ OFF, "GL_EXT_blend_subtract", F(EXT_blend_subtract) },
{ ON, "GL_EXT_clip_volume_hint", F(EXT_clip_volume_hint) },
- { OFF, "GL_EXT_cull_vertex", 0 },
{ OFF, "GL_EXT_convolution", F(EXT_convolution) },
{ ON, "GL_EXT_compiled_vertex_array", F(EXT_compiled_vertex_array) },
{ OFF, "GL_EXT_fog_coord", F(EXT_fog_coord) },
{ OFF, "GL_EXT_histogram", F(EXT_histogram) },
+ { OFF, "GL_EXT_multi_draw_arrays", F(EXT_multi_draw_arrays) },
{ ON, "GL_EXT_packed_pixels", F(EXT_packed_pixels) },
{ OFF, "GL_EXT_paletted_texture", F(EXT_paletted_texture) },
{ OFF, "GL_EXT_point_parameters", F(EXT_point_parameters) },
{ ON, "GL_EXT_polygon_offset", F(EXT_polygon_offset) },
{ ON, "GL_EXT_rescale_normal", F(EXT_rescale_normal) },
{ OFF, "GL_EXT_secondary_color", F(EXT_secondary_color) },
+ { OFF, "GL_EXT_shadow_funcs", F(EXT_shadow_funcs) },
{ OFF, "GL_EXT_shared_texture_palette", F(EXT_shared_texture_palette) },
{ OFF, "GL_EXT_stencil_wrap", F(EXT_stencil_wrap) },
+ { OFF, "GL_EXT_stencil_two_side", F(EXT_stencil_two_side) },
{ ON, "GL_EXT_texture3D", F(EXT_texture3D) },
{ OFF, "GL_EXT_texture_compression_s3tc", F(EXT_texture_compression_s3tc) },
{ OFF, "GL_EXT_texture_edge_clamp", F(SGIS_texture_edge_clamp) },
@@ -102,13 +106,17 @@ static struct {
{ ON, "GL_IBM_rasterpos_clip", F(IBM_rasterpos_clip) },
{ OFF, "GL_IBM_texture_mirrored_repeat", F(ARB_texture_mirrored_repeat)},
{ OFF, "GL_INGR_blend_func_separate", F(INGR_blend_func_separate) },
+ { OFF, "GL_MESA_pack_invert", F(MESA_pack_invert) },
{ OFF, "GL_MESA_packed_depth_stencil", 0 },
{ OFF, "GL_MESA_resize_buffers", F(MESA_resize_buffers) },
- { OFF, "GL_MESA_sprite_point", F(MESA_sprite_point) },
+ { OFF, "GL_MESA_ycbcr_texture", F(MESA_ycbcr_texture) },
{ ON, "GL_MESA_window_pos", F(MESA_window_pos) },
{ OFF, "GL_NV_blend_square", F(NV_blend_square) },
+ { OFF, "GL_NV_point_sprite", F(NV_point_sprite) },
{ ON, "GL_NV_texgen_reflection", F(NV_texgen_reflection) },
- { ON, "GL_NV_texture_rectangle", F(NV_texture_rectangle) },
+ { OFF, "GL_NV_texture_rectangle", F(NV_texture_rectangle) },
+ { OFF, "GL_NV_vertex_program", F(NV_vertex_program) },
+ { OFF, "GL_NV_vertex_program1_1", F(NV_vertex_program1_1) },
{ OFF, "GL_SGI_color_matrix", F(SGI_color_matrix) },
{ OFF, "GL_SGI_color_table", F(SGI_color_table) },
{ OFF, "GL_SGIS_generate_mipmap", F(SGIS_generate_mipmap) },
@@ -119,7 +127,8 @@ static struct {
{ OFF, "GL_SGIX_pixel_texture", F(SGIX_pixel_texture) },
{ OFF, "GL_SGIX_shadow", F(SGIX_shadow) },
{ OFF, "GL_SGIX_shadow_ambient", F(SGIX_shadow_ambient) },
- { OFF, "GL_3DFX_texture_compression_FXT1", F(_3DFX_texture_compression_FXT1) }
+ { OFF, "GL_3DFX_texture_compression_FXT1", F(TDFX_texture_compression_FXT1) },
+ { OFF, "GL_APPLE_client_storage", F(APPLE_client_storage) }
};
@@ -133,14 +142,21 @@ void
_mesa_enable_sw_extensions(GLcontext *ctx)
{
const char *extensions[] = {
+ "GL_ARB_depth_texture",
"GL_ARB_imaging",
"GL_ARB_multitexture",
+ "GL_ARB_point_parameters",
+ "GL_ARB_shadow",
+ "GL_ARB_shadow_ambient",
"GL_ARB_texture_border_clamp",
"GL_ARB_texture_cube_map",
"GL_ARB_texture_env_add",
"GL_ARB_texture_env_combine",
+ "GL_ARB_texture_env_crossbar",
"GL_ARB_texture_env_dot3",
"GL_ARB_texture_mirrored_repeat",
+ "GL_ATI_texture_env_combine3",
+ "GL_ATI_texture_mirror_once",
"GL_EXT_blend_color",
"GL_EXT_blend_func_separate",
"GL_EXT_blend_logic_op",
@@ -151,9 +167,11 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
"GL_EXT_histogram",
"GL_EXT_paletted_texture",
"GL_EXT_point_parameters",
+ "GL_EXT_shadow_funcs",
"GL_EXT_secondary_color",
"GL_EXT_shared_texture_palette",
"GL_EXT_stencil_wrap",
+ "GL_EXT_stencil_two_side",
"GL_EXT_texture_edge_clamp",
"GL_EXT_texture_env_add",
"GL_EXT_texture_env_combine",
@@ -162,12 +180,24 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
"GL_HP_occlusion_test",
"GL_IBM_texture_mirrored_repeat",
"GL_INGR_blend_func_separate",
+ "GL_MESA_pack_invert",
"GL_MESA_resize_buffers",
+ "GL_MESA_ycbcr_texture",
"GL_NV_blend_square",
+#if FEATURE_NV_fragment_program
+ "GL_NV_fragment_program",
+#endif
+ "GL_NV_light_max_exponent",
+ "GL_NV_point_sprite",
"GL_NV_texgen_reflection",
"GL_NV_texture_rectangle",
+#if FEATURE_NV_vertex_program
+ "GL_NV_vertex_program",
+ "GL_NV_vertex_program1_1",
+#endif
"GL_SGI_color_matrix",
"GL_SGI_color_table",
+ "GL_SGI_texture_color_table",
"GL_SGIS_generate_mipmap",
"GL_SGIS_pixel_texture",
"GL_SGIS_texture_edge_clamp",
@@ -240,6 +270,40 @@ _mesa_enable_1_3_extensions(GLcontext *ctx)
/*
+ * Enable all OpenGL 1.4 features and extensions.
+ */
+void
+_mesa_enable_1_4_extensions(GLcontext *ctx)
+{
+ const char *extensions[] = {
+ "GL_ARB_depth_texture",
+ "GL_ARB_point_parameters",
+ "GL_ARB_shadow",
+ "GL_ARB_texture_env_crossbar",
+ "GL_ARB_texture_mirrored_repeat",
+ "GL_ARB_window_pos",
+ "GL_EXT_blend_color",
+ "GL_EXT_blend_func_separate",
+ "GL_EXT_blend_logic_op",
+ "GL_EXT_blend_minmax",
+ "GL_EXT_blend_subtract",
+ "GL_EXT_fog_coord",
+ "GL_EXT_multi_draw_arrays",
+ "GL_EXT_secondary_color",
+ "GL_EXT_stencil_wrap",
+ "GL_SGIS_generate_mipmap",
+ NULL
+ };
+ GLuint i;
+
+ for (i = 0; extensions[i]; i++) {
+ _mesa_enable_extension(ctx, extensions[i]);
+ }
+}
+
+
+
+/*
* Add a new extenstion. This would be called from a Mesa driver.
*/
void
@@ -256,7 +320,7 @@ _mesa_add_extension( GLcontext *ctx,
{
struct extension *t = MALLOC_STRUCT(extension);
t->enabled = enabled;
- strncpy(t->name, name, MAX_EXT_NAMELEN);
+ _mesa_strncpy(t->name, name, MAX_EXT_NAMELEN);
t->name[MAX_EXT_NAMELEN] = 0;
t->flag = flag_ptr;
if (t->flag)
@@ -278,7 +342,7 @@ set_extension( GLcontext *ctx, const char *name, GLint state )
*/
struct extension *i;
foreach( i, ctx->Extensions.ext_list )
- if (strncmp(i->name, name, MAX_EXT_NAMELEN) == 0)
+ if (_mesa_strncmp(i->name, name, MAX_EXT_NAMELEN) == 0)
break;
if (i == ctx->Extensions.ext_list) {
@@ -320,7 +384,7 @@ _mesa_extension_is_enabled( GLcontext *ctx, const char *name)
{
struct extension *i;
foreach( i, ctx->Extensions.ext_list )
- if (strncmp(i->name, name, MAX_EXT_NAMELEN) == 0) {
+ if (_mesa_strncmp(i->name, name, MAX_EXT_NAMELEN) == 0) {
if (i->enabled)
return GL_TRUE;
else
@@ -387,18 +451,18 @@ _mesa_extensions_get_string( GLcontext *ctx )
GLuint len = 0;
foreach (i, ctx->Extensions.ext_list)
if (i->enabled)
- len += strlen(i->name) + 1;
+ len += _mesa_strlen(i->name) + 1;
if (len == 0)
return "";
- str = (char *)MALLOC(len * sizeof(char));
+ str = (char *) _mesa_malloc(len * sizeof(char));
ctx->Extensions.ext_string = str;
foreach (i, ctx->Extensions.ext_list)
if (i->enabled) {
- strcpy(str, i->name);
- str += strlen(str);
+ _mesa_strcpy(str, i->name);
+ str += _mesa_strlen(str);
*str++ = ' ';
}
diff --git a/xc/extras/Mesa/src/extensions.h b/xc/extras/Mesa/src/extensions.h
index 79293852e..fee9d0d57 100644
--- a/xc/extras/Mesa/src/extensions.h
+++ b/xc/extras/Mesa/src/extensions.h
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -36,6 +36,8 @@ extern void _mesa_enable_imaging_extensions(GLcontext *ctx);
extern void _mesa_enable_1_3_extensions(GLcontext *ctx);
+extern void _mesa_enable_1_4_extensions(GLcontext *ctx);
+
extern void _mesa_add_extension( GLcontext *ctx, GLboolean enabled,
const char *name, GLboolean *flag_ptr );
diff --git a/xc/extras/Mesa/src/feedback.c b/xc/extras/Mesa/src/feedback.c
index 8d88b7a81..bcb4d4b4a 100644
--- a/xc/extras/Mesa/src/feedback.c
+++ b/xc/extras/Mesa/src/feedback.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,9 +24,6 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colormac.h"
#include "context.h"
@@ -35,7 +32,6 @@
#include "macros.h"
#include "mmath.h"
#include "mtypes.h"
-#endif
@@ -339,7 +335,7 @@ _mesa_RenderMode( GLenum mode )
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glRenderMode %s\n", _mesa_lookup_enum_by_nr(mode));
+ _mesa_debug(ctx, "glRenderMode %s\n", _mesa_lookup_enum_by_nr(mode));
FLUSH_VERTICES(ctx, _NEW_RENDERMODE);
diff --git a/xc/extras/Mesa/src/fog.c b/xc/extras/Mesa/src/fog.c
index caa84298f..8a65ffaed 100644
--- a/xc/extras/Mesa/src/fog.c
+++ b/xc/extras/Mesa/src/fog.c
@@ -24,15 +24,11 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colormac.h"
#include "context.h"
#include "fog.h"
#include "mtypes.h"
-#endif
diff --git a/xc/extras/Mesa/src/get.c b/xc/extras/Mesa/src/get.c
index 9acefb053..36eeb9e07 100644
--- a/xc/extras/Mesa/src/get.c
+++ b/xc/extras/Mesa/src/get.c
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.4
+ * Version: 5.0
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -24,9 +24,6 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colormac.h"
#include "context.h"
@@ -37,9 +34,8 @@
#include "macros.h"
#include "mmath.h"
#include "mtypes.h"
-
+#include "texcompress.h"
#include "math/m_matrix.h"
-#endif
@@ -58,43 +54,39 @@
#endif
-
/* Check if named extension is enabled, if not generate error and return */
#define CHECK_EXTENSION_B(EXTNAME, PNAME) \
if (!ctx->Extensions.EXTNAME) { \
- char message[100]; \
- sprintf(message, "glGetBooleanv(0x%x)", (int) PNAME); \
- _mesa_error(ctx, GL_INVALID_VALUE, message); \
+ _mesa_error(ctx, GL_INVALID_VALUE, \
+ "glGetBooleanv(0x%x)", (int) PNAME); \
return; \
}
#define CHECK_EXTENSION_I(EXTNAME, PNAME) \
if (!ctx->Extensions.EXTNAME) { \
- char message[100]; \
- sprintf(message, "glGetIntegerv(0x%x)", (int) PNAME); \
- _mesa_error(ctx, GL_INVALID_VALUE, message); \
+ _mesa_error(ctx, GL_INVALID_VALUE, \
+ "glGetIntegerv(0x%x)", (int) PNAME); \
return; \
}
#define CHECK_EXTENSION_F(EXTNAME, PNAME) \
if (!ctx->Extensions.EXTNAME) { \
- char message[100]; \
- sprintf(message, "glGetFloatv(0x%x)", (int) PNAME); \
- _mesa_error(ctx, GL_INVALID_VALUE, message); \
+ _mesa_error(ctx, GL_INVALID_VALUE, \
+ "glGetFloatv(0x%x)", (int) PNAME); \
return; \
}
#define CHECK_EXTENSION_D(EXTNAME, PNAME) \
if (!ctx->Extensions.EXTNAME) { \
- char message[100]; \
- sprintf(message, "glGetDoublev(0x%x)", (int) PNAME); \
- _mesa_error(ctx, GL_INVALID_VALUE, message); \
+ _mesa_error(ctx, GL_INVALID_VALUE, \
+ "glGetDoublev(0x%x)", (int) PNAME); \
return; \
}
+
static GLenum
pixel_texgen_mode(const GLcontext *ctx)
{
@@ -135,7 +127,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
FLUSH_VERTICES(ctx, 0);
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glGetBooleanv %s\n", _mesa_lookup_enum_by_nr(pname));
+ _mesa_debug(ctx, "glGetBooleanv %s\n", _mesa_lookup_enum_by_nr(pname));
if (ctx->Driver.GetBooleanv
&& (*ctx->Driver.GetBooleanv)(ctx, pname, params))
@@ -176,7 +168,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*params = ENUM_TO_BOOL(ctx->Color.AlphaFunc);
break;
case GL_ALPHA_TEST_REF:
- *params = FLOAT_TO_BOOL((GLfloat) ctx->Color.AlphaRef / CHAN_MAXF);
+ *params = ctx->Color.AlphaRef ? GL_TRUE : GL_FALSE;
break;
case GL_ATTRIB_STACK_DEPTH:
*params = INT_TO_BOOL(ctx->AttribStackDepth);
@@ -235,7 +227,10 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
case GL_CLIP_PLANE3:
case GL_CLIP_PLANE4:
case GL_CLIP_PLANE5:
- *params = ctx->Transform.ClipEnabled[pname-GL_CLIP_PLANE0];
+ if (ctx->Transform.ClipPlanesEnabled & (1 << (pname - GL_CLIP_PLANE0)))
+ *params = GL_TRUE;
+ else
+ *params = GL_FALSE;
break;
case GL_COLOR_CLEAR_VALUE:
params[0] = ctx->Color.ClearColor[0] ? GL_TRUE : GL_FALSE;
@@ -266,10 +261,10 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
break;
case GL_CURRENT_COLOR:
FLUSH_CURRENT(ctx, 0);
- params[0] = FLOAT_TO_BOOL(ctx->Current.Color[0]);
- params[1] = FLOAT_TO_BOOL(ctx->Current.Color[1]);
- params[2] = FLOAT_TO_BOOL(ctx->Current.Color[2]);
- params[3] = FLOAT_TO_BOOL(ctx->Current.Color[3]);
+ params[0] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]);
+ params[1] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]);
+ params[2] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]);
+ params[3] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]);
break;
case GL_CURRENT_INDEX:
FLUSH_CURRENT(ctx, 0);
@@ -277,9 +272,9 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
break;
case GL_CURRENT_NORMAL:
FLUSH_CURRENT(ctx, 0);
- params[0] = FLOAT_TO_BOOL(ctx->Current.Normal[0]);
- params[1] = FLOAT_TO_BOOL(ctx->Current.Normal[1]);
- params[2] = FLOAT_TO_BOOL(ctx->Current.Normal[2]);
+ params[0] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]);
+ params[1] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]);
+ params[2] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]);
break;
case GL_CURRENT_RASTER_COLOR:
params[0] = FLOAT_TO_BOOL(ctx->Current.RasterColor[0]);
@@ -300,20 +295,20 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
params[3] = FLOAT_TO_BOOL(ctx->Current.RasterPos[3]);
break;
case GL_CURRENT_RASTER_TEXTURE_COORDS:
- params[0] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texUnit][0]);
- params[1] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texUnit][1]);
- params[2] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texUnit][2]);
- params[3] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texUnit][3]);
+ params[0] = FLOAT_TO_BOOL(ctx->Current.RasterTexCoords[texUnit][0]);
+ params[1] = FLOAT_TO_BOOL(ctx->Current.RasterTexCoords[texUnit][1]);
+ params[2] = FLOAT_TO_BOOL(ctx->Current.RasterTexCoords[texUnit][2]);
+ params[3] = FLOAT_TO_BOOL(ctx->Current.RasterTexCoords[texUnit][3]);
break;
case GL_CURRENT_RASTER_POSITION_VALID:
*params = ctx->Current.RasterPosValid;
break;
case GL_CURRENT_TEXTURE_COORDS:
FLUSH_CURRENT(ctx, 0);
- params[0] = FLOAT_TO_BOOL(ctx->Current.Texcoord[texUnit][0]);
- params[1] = FLOAT_TO_BOOL(ctx->Current.Texcoord[texUnit][1]);
- params[2] = FLOAT_TO_BOOL(ctx->Current.Texcoord[texUnit][2]);
- params[3] = FLOAT_TO_BOOL(ctx->Current.Texcoord[texUnit][3]);
+ params[0] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0]);
+ params[1] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1]);
+ params[2] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2]);
+ params[3] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3]);
break;
case GL_DEPTH_BIAS:
*params = FLOAT_TO_BOOL(ctx->Pixel.DepthBias);
@@ -398,15 +393,6 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
case GL_GREEN_SCALE:
*params = FLOAT_TO_BOOL(ctx->Pixel.GreenScale);
break;
- case GL_HISTOGRAM:
- if (ctx->Extensions.EXT_histogram) {
- *params = ctx->Pixel.HistogramEnabled;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
- }
- break;
case GL_INDEX_BITS:
*params = INT_TO_BOOL( ctx->Visual.indexBits );
break;
@@ -630,16 +616,13 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
params[0] = INT_TO_BOOL(MAX_WIDTH);
params[1] = INT_TO_BOOL(MAX_HEIGHT);
break;
- case GL_MINMAX:
- *params = ctx->Pixel.MinMaxEnabled;
- break;
case GL_MODELVIEW_MATRIX:
for (i=0;i<16;i++) {
- params[i] = FLOAT_TO_BOOL(ctx->ModelView.m[i]);
+ params[i] = FLOAT_TO_BOOL(ctx->ModelviewMatrixStack.Top->m[i]);
}
break;
case GL_MODELVIEW_STACK_DEPTH:
- *params = INT_TO_BOOL(ctx->ModelViewStackDepth + 1);
+ *params = INT_TO_BOOL(ctx->ModelviewMatrixStack.Depth + 1);
break;
case GL_NAME_STACK_DEPTH:
*params = INT_TO_BOOL(ctx->Select.NameStackDepth);
@@ -671,6 +654,9 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
case GL_PACK_IMAGE_HEIGHT_EXT:
*params = ctx->Pack.ImageHeight;
break;
+ case GL_PACK_INVERT_MESA:
+ *params = ctx->Pack.Invert;
+ break;
case GL_PERSPECTIVE_CORRECTION_HINT:
*params = ENUM_TO_BOOL(ctx->Hint.PerspectiveCorrection);
break;
@@ -762,11 +748,11 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
break;
case GL_PROJECTION_MATRIX:
for (i=0;i<16;i++) {
- params[i] = FLOAT_TO_BOOL(ctx->ProjectionMatrix.m[i]);
+ params[i] = FLOAT_TO_BOOL(ctx->ProjectionMatrixStack.Top->m[i]);
}
break;
case GL_PROJECTION_STACK_DEPTH:
- *params = INT_TO_BOOL(ctx->ProjectionStackDepth + 1);
+ *params = INT_TO_BOOL(ctx->ProjectionMatrixStack.Depth + 1);
break;
case GL_READ_BUFFER:
*params = ENUM_TO_BOOL(ctx->Pixel.ReadBuffer);
@@ -814,28 +800,28 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*params = INT_TO_BOOL(ctx->Stencil.Clear);
break;
case GL_STENCIL_FAIL:
- *params = ENUM_TO_BOOL(ctx->Stencil.FailFunc);
+ *params = ENUM_TO_BOOL(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_FUNC:
- *params = ENUM_TO_BOOL(ctx->Stencil.Function);
+ *params = ENUM_TO_BOOL(ctx->Stencil.Function[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_PASS_DEPTH_FAIL:
- *params = ENUM_TO_BOOL(ctx->Stencil.ZFailFunc);
+ *params = ENUM_TO_BOOL(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_PASS_DEPTH_PASS:
- *params = ENUM_TO_BOOL(ctx->Stencil.ZPassFunc);
+ *params = ENUM_TO_BOOL(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_REF:
- *params = INT_TO_BOOL(ctx->Stencil.Ref);
+ *params = INT_TO_BOOL(ctx->Stencil.Ref[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_TEST:
*params = ctx->Stencil.Enabled;
break;
case GL_STENCIL_VALUE_MASK:
- *params = INT_TO_BOOL(ctx->Stencil.ValueMask);
+ *params = INT_TO_BOOL(ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_WRITEMASK:
- *params = INT_TO_BOOL(ctx->Stencil.WriteMask);
+ *params = INT_TO_BOOL(ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]);
break;
case GL_STEREO:
*params = ctx->Visual.stereoMode;
@@ -887,11 +873,11 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
case GL_TEXTURE_MATRIX:
for (i=0;i<16;i++) {
params[i] =
- FLOAT_TO_BOOL(ctx->TextureMatrix[texUnit].m[i]);
+ FLOAT_TO_BOOL(ctx->TextureMatrixStack[texUnit].Top->m[i]);
}
break;
case GL_TEXTURE_STACK_DEPTH:
- *params = INT_TO_BOOL(ctx->TextureStackDepth[texUnit] + 1);
+ *params = INT_TO_BOOL(ctx->TextureMatrixStack[texUnit].Depth + 1);
break;
case GL_UNPACK_ALIGNMENT:
*params = INT_TO_BOOL(ctx->Unpack.Alignment);
@@ -917,6 +903,9 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
case GL_UNPACK_IMAGE_HEIGHT_EXT:
*params = ctx->Unpack.ImageHeight;
break;
+ case GL_UNPACK_CLIENT_STORAGE_APPLE:
+ *params = ctx->Unpack.ClientStorage;
+ break;
case GL_VIEWPORT:
params[0] = INT_TO_BOOL(ctx->Viewport.X);
params[1] = INT_TO_BOOL(ctx->Viewport.Y);
@@ -1010,58 +999,50 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
/* GL_ARB_multitexture */
case GL_MAX_TEXTURE_UNITS_ARB:
- *params = ctx->Const.MaxTextureUnits;
+ CHECK_EXTENSION_B(ARB_multitexture, pname);
+ *params = INT_TO_BOOL(ctx->Const.MaxTextureUnits);
break;
case GL_ACTIVE_TEXTURE_ARB:
+ CHECK_EXTENSION_B(ARB_multitexture, pname);
*params = INT_TO_BOOL(GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit);
break;
case GL_CLIENT_ACTIVE_TEXTURE_ARB:
+ CHECK_EXTENSION_B(ARB_multitexture, pname);
*params = INT_TO_BOOL(GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
break;
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
- else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
+ CHECK_EXTENSION_B(ARB_texture_cube_map, pname);
+ *params = _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
+ break;
case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = INT_TO_BOOL(textureUnit->CurrentCubeMap->Name);
- else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
+ CHECK_EXTENSION_B(ARB_texture_cube_map, pname);
+ *params = INT_TO_BOOL(textureUnit->CurrentCubeMap->Name);
+ break;
case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = INT_TO_BOOL(1 << (ctx->Const.MaxCubeTextureLevels - 1));
- else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+ CHECK_EXTENSION_B(ARB_texture_cube_map, pname);
+ *params = INT_TO_BOOL(1 << (ctx->Const.MaxCubeTextureLevels - 1));
break;
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSION_HINT_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- *params = INT_TO_BOOL(ctx->Hint.TextureCompression);
- }
- else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+ CHECK_EXTENSION_B(ARB_texture_compression, pname);
+ *params = INT_TO_BOOL(ctx->Hint.TextureCompression);
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- *params = INT_TO_BOOL(ctx->Const.NumCompressedTextureFormats);
- }
- else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+ CHECK_EXTENSION_B(ARB_texture_compression, pname);
+ *params = INT_TO_BOOL(_mesa_get_compressed_formats(ctx, NULL));
break;
case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- GLuint i;
- for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
- params[i] = INT_TO_BOOL(ctx->Const.CompressedTextureFormats[i]);
+ CHECK_EXTENSION_B(ARB_texture_compression, pname);
+ {
+ GLint formats[100];
+ GLuint i, n;
+ n = _mesa_get_compressed_formats(ctx, formats);
+ for (i = 0; i < n; i++)
+ params[i] = INT_TO_BOOL(formats[i]);
}
- else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
break;
/* GL_EXT_compiled_vertex_array */
@@ -1077,7 +1058,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->ColorMatrix.m);
+ _math_transposef(tm, ctx->ColorMatrixStack.Top->m);
for (i=0;i<16;i++) {
params[i] = FLOAT_TO_BOOL(tm[i]);
}
@@ -1087,7 +1068,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->ModelView.m);
+ _math_transposef(tm, ctx->ModelviewMatrixStack.Top->m);
for (i=0;i<16;i++) {
params[i] = FLOAT_TO_BOOL(tm[i]);
}
@@ -1097,7 +1078,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->ProjectionMatrix.m);
+ _math_transposef(tm, ctx->ProjectionMatrixStack.Top->m);
for (i=0;i<16;i++) {
params[i] = FLOAT_TO_BOOL(tm[i]);
}
@@ -1107,7 +1088,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->TextureMatrix[texUnit].m);
+ _math_transposef(tm, ctx->TextureMatrixStack[texUnit].Top->m);
for (i=0;i<16;i++) {
params[i] = FLOAT_TO_BOOL(tm[i]);
}
@@ -1116,26 +1097,18 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
/* GL_HP_occlusion_test */
case GL_OCCLUSION_TEST_HP:
- if (ctx->Extensions.HP_occlusion_test) {
- *params = ctx->Depth.OcclusionTest;
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
- }
+ CHECK_EXTENSION_B(HP_occlusion_test, pname);
+ *params = ctx->Depth.OcclusionTest;
return;
case GL_OCCLUSION_TEST_RESULT_HP:
- if (ctx->Extensions.HP_occlusion_test) {
- if (ctx->Depth.OcclusionTest)
- *params = ctx->OcclusionResult;
- else
- *params = ctx->OcclusionResultSaved;
- /* reset flag now */
- ctx->OcclusionResult = GL_FALSE;
- ctx->OcclusionResultSaved = GL_FALSE;
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
- }
+ CHECK_EXTENSION_B(HP_occlusion_test, pname);
+ if (ctx->Depth.OcclusionTest)
+ *params = ctx->OcclusionResult;
+ else
+ *params = ctx->OcclusionResultSaved;
+ /* reset flag now */
+ ctx->OcclusionResult = GL_FALSE;
+ ctx->OcclusionResultSaved = GL_FALSE;
return;
/* GL_SGIS_pixel_texture */
@@ -1154,11 +1127,11 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
/* GL_SGI_color_matrix (also in 1.2 imaging) */
case GL_COLOR_MATRIX_SGI:
for (i=0;i<16;i++) {
- params[i] = FLOAT_TO_BOOL(ctx->ColorMatrix.m[i]);
+ params[i] = FLOAT_TO_BOOL(ctx->ColorMatrixStack.Top->m[i]);
}
break;
case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
- *params = INT_TO_BOOL(ctx->ColorStackDepth + 1);
+ *params = INT_TO_BOOL(ctx->ColorMatrixStack.Depth + 1);
break;
case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
*params = FLOAT_TO_BOOL(MAX_COLOR_STACK_DEPTH);
@@ -1190,57 +1163,60 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
/* GL_EXT_convolution (also in 1.2 imaging) */
case GL_CONVOLUTION_1D_EXT:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = ctx->Pixel.Convolution1DEnabled;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
- }
+ CHECK_EXTENSION_B(EXT_convolution, pname);
+ *params = ctx->Pixel.Convolution1DEnabled;
break;
case GL_CONVOLUTION_2D:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = ctx->Pixel.Convolution2DEnabled;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
- }
+ CHECK_EXTENSION_B(EXT_convolution, pname);
+ *params = ctx->Pixel.Convolution2DEnabled;
break;
case GL_SEPARABLE_2D:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = ctx->Pixel.Separable2DEnabled;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
- }
+ CHECK_EXTENSION_B(EXT_convolution, pname);
+ *params = ctx->Pixel.Separable2DEnabled;
break;
case GL_POST_CONVOLUTION_RED_SCALE_EXT:
+ CHECK_EXTENSION_B(EXT_convolution, pname);
*params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[0]);
break;
case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
+ CHECK_EXTENSION_B(EXT_convolution, pname);
*params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[1]);
break;
case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
+ CHECK_EXTENSION_B(EXT_convolution, pname);
*params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[2]);
break;
case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
+ CHECK_EXTENSION_B(EXT_convolution, pname);
*params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[3]);
break;
case GL_POST_CONVOLUTION_RED_BIAS_EXT:
+ CHECK_EXTENSION_B(EXT_convolution, pname);
*params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[0]);
break;
case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
+ CHECK_EXTENSION_B(EXT_convolution, pname);
*params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[1]);
break;
case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
+ CHECK_EXTENSION_B(EXT_convolution, pname);
*params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[2]);
break;
case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
+ CHECK_EXTENSION_B(EXT_convolution, pname);
*params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[2]);
break;
+ /* GL_EXT_histogram (also in 1.2 imaging) */
+ case GL_HISTOGRAM:
+ CHECK_EXTENSION_B(EXT_histogram, pname);
+ *params = ctx->Pixel.HistogramEnabled;
+ break;
+ case GL_MINMAX:
+ CHECK_EXTENSION_B(EXT_histogram, pname);
+ *params = ctx->Pixel.MinMaxEnabled;
+ break;
+
/* GL_SGI_color_table (also in 1.2 imaging */
case GL_COLOR_TABLE_SGI:
*params = ctx->Pixel.ColorTableEnabled;
@@ -1254,39 +1230,49 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
/* GL_EXT_secondary_color */
case GL_COLOR_SUM_EXT:
+ CHECK_EXTENSION_B(EXT_secondary_color, pname);
*params = ctx->Fog.ColorSumEnabled;
break;
case GL_CURRENT_SECONDARY_COLOR_EXT:
+ CHECK_EXTENSION_B(EXT_secondary_color, pname);
FLUSH_CURRENT(ctx, 0);
- params[0] = INT_TO_BOOL(ctx->Current.SecondaryColor[0]);
- params[1] = INT_TO_BOOL(ctx->Current.SecondaryColor[1]);
- params[2] = INT_TO_BOOL(ctx->Current.SecondaryColor[2]);
+ params[0] = INT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]);
+ params[1] = INT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]);
+ params[2] = INT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]);
break;
case GL_SECONDARY_COLOR_ARRAY_EXT:
+ CHECK_EXTENSION_B(EXT_secondary_color, pname);
*params = ctx->Array.SecondaryColor.Enabled;
break;
case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_B(EXT_secondary_color, pname);
*params = ENUM_TO_BOOL(ctx->Array.SecondaryColor.Type);
break;
case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_B(EXT_secondary_color, pname);
*params = INT_TO_BOOL(ctx->Array.SecondaryColor.Stride);
break;
case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
+ CHECK_EXTENSION_B(EXT_secondary_color, pname);
*params = INT_TO_BOOL(ctx->Array.SecondaryColor.Stride);
break;
/* GL_EXT_fog_coord */
case GL_CURRENT_FOG_COORDINATE_EXT:
+ CHECK_EXTENSION_B(EXT_fog_coord, pname);
FLUSH_CURRENT(ctx, 0);
- *params = FLOAT_TO_BOOL(ctx->Current.FogCoord);
+ *params = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_FOG][0]);
break;
case GL_FOG_COORDINATE_ARRAY_EXT:
+ CHECK_EXTENSION_B(EXT_fog_coord, pname);
*params = ctx->Array.FogCoord.Enabled;
break;
case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_B(EXT_fog_coord, pname);
*params = ENUM_TO_BOOL(ctx->Array.FogCoord.Type);
break;
case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_B(EXT_fog_coord, pname);
*params = INT_TO_BOOL(ctx->Array.FogCoord.Stride);
break;
@@ -1297,121 +1283,170 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
/* GL_EXT_texture_filter_anisotropic */
case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
- if (ctx->Extensions.EXT_texture_filter_anisotropic) {
- *params = FLOAT_TO_BOOL(ctx->Const.MaxTextureMaxAnisotropy);
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
- return;
- }
+ CHECK_EXTENSION_B(EXT_texture_filter_anisotropic, pname);
+ *params = FLOAT_TO_BOOL(ctx->Const.MaxTextureMaxAnisotropy);
break;
/* GL_ARB_multisample */
case GL_MULTISAMPLE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = ctx->Multisample.Enabled;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
- }
+ CHECK_EXTENSION_B(ARB_multisample, pname);
+ *params = ctx->Multisample.Enabled;
break;
case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = ctx->Multisample.SampleAlphaToCoverage;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
- }
+ CHECK_EXTENSION_B(ARB_multisample, pname);
+ *params = ctx->Multisample.SampleAlphaToCoverage;
break;
case GL_SAMPLE_ALPHA_TO_ONE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = ctx->Multisample.SampleAlphaToOne;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
- }
+ CHECK_EXTENSION_B(ARB_multisample, pname);
+ *params = ctx->Multisample.SampleAlphaToOne;
break;
case GL_SAMPLE_COVERAGE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = ctx->Multisample.SampleCoverage;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
- }
+ CHECK_EXTENSION_B(ARB_multisample, pname);
+ *params = ctx->Multisample.SampleCoverage;
break;
case GL_SAMPLE_COVERAGE_VALUE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = FLOAT_TO_BOOL(ctx->Multisample.SampleCoverageValue);
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
- }
+ CHECK_EXTENSION_B(ARB_multisample, pname);
+ *params = FLOAT_TO_BOOL(ctx->Multisample.SampleCoverageValue);
break;
case GL_SAMPLE_COVERAGE_INVERT_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = ctx->Multisample.SampleCoverageInvert;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
- }
+ CHECK_EXTENSION_B(ARB_multisample, pname);
+ *params = ctx->Multisample.SampleCoverageInvert;
break;
case GL_SAMPLE_BUFFERS_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = 0; /* XXX fix someday */
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
- }
+ CHECK_EXTENSION_B(ARB_multisample, pname);
+ *params = 0; /* XXX fix someday */
break;
case GL_SAMPLES_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = 0; /* XXX fix someday */
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
- }
+ CHECK_EXTENSION_B(ARB_multisample, pname);
+ *params = 0; /* XXX fix someday */
break;
/* GL_IBM_rasterpos_clip */
case GL_RASTER_POSITION_UNCLIPPED_IBM:
- if (ctx->Extensions.IBM_rasterpos_clip) {
- *params = ctx->Transform.RasterPositionUnclipped;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBoolean");
- return;
- }
+ CHECK_EXTENSION_B(IBM_rasterpos_clip, pname);
+ *params = ctx->Transform.RasterPositionUnclipped;
break;
- /* GL_MESA_sprite_point */
- case GL_SPRITE_POINT_MESA:
- if (ctx->Extensions.MESA_sprite_point) {
- *params = ctx->Point.SpriteMode;
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
- return;
- }
+ /* GL_NV_point_sprite */
+ case GL_POINT_SPRITE_NV:
+ CHECK_EXTENSION_B(NV_point_sprite, pname);
+ *params = ctx->Point.PointSprite;
+ break;
+ case GL_POINT_SPRITE_R_MODE_NV:
+ CHECK_EXTENSION_B(NV_point_sprite, pname);
+ *params = ENUM_TO_BOOL(ctx->Point.SpriteRMode);
break;
/* GL_SGIS_generate_mipmap */
case GL_GENERATE_MIPMAP_HINT_SGIS:
- if (ctx->Extensions.SGIS_generate_mipmap) {
- *params = ENUM_TO_BOOL(ctx->Hint.GenerateMipmap);
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
+ CHECK_EXTENSION_B(SGIS_generate_mipmap, pname);
+ *params = ENUM_TO_BOOL(ctx->Hint.GenerateMipmap);
+ break;
+
+#if FEATURE_NV_vertex_program
+ case GL_VERTEX_PROGRAM_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ *params = ctx->VertexProgram.Enabled;
+ break;
+ case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ *params = ctx->VertexProgram.PointSizeEnabled;
+ break;
+ case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ *params = ctx->VertexProgram.TwoSideEnabled;
+ break;
+ case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ *params = (MAX_PROGRAM_STACK_DEPTH > 0) ? GL_TRUE : GL_FALSE;
+ break;
+ case GL_MAX_TRACK_MATRICES_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ *params = (MAX_PROGRAM_MATRICES > 0) ? GL_TRUE : GL_FALSE;
+ break;
+ case GL_CURRENT_MATRIX_STACK_DEPTH_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ *params = (ctx->CurrentStack->Depth > 0) ? GL_TRUE : GL_FALSE;
+ break;
+ case GL_CURRENT_MATRIX_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ *params = (ctx->Transform.MatrixMode != 0) ? GL_TRUE : GL_FALSE;
+ break;
+ case GL_VERTEX_PROGRAM_BINDING_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ *params = (ctx->VertexProgram.CurrentID != 0) ? GL_TRUE : GL_FALSE;
+ break;
+ case GL_PROGRAM_ERROR_POSITION_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ *params = (ctx->VertexProgram.ErrorPos != 0) ? GL_TRUE : GL_FALSE;
+ break;
+ case GL_VERTEX_ATTRIB_ARRAY0_NV:
+ case GL_VERTEX_ATTRIB_ARRAY1_NV:
+ case GL_VERTEX_ATTRIB_ARRAY2_NV:
+ case GL_VERTEX_ATTRIB_ARRAY3_NV:
+ case GL_VERTEX_ATTRIB_ARRAY4_NV:
+ case GL_VERTEX_ATTRIB_ARRAY5_NV:
+ case GL_VERTEX_ATTRIB_ARRAY6_NV:
+ case GL_VERTEX_ATTRIB_ARRAY7_NV:
+ case GL_VERTEX_ATTRIB_ARRAY8_NV:
+ case GL_VERTEX_ATTRIB_ARRAY9_NV:
+ case GL_VERTEX_ATTRIB_ARRAY10_NV:
+ case GL_VERTEX_ATTRIB_ARRAY11_NV:
+ case GL_VERTEX_ATTRIB_ARRAY12_NV:
+ case GL_VERTEX_ATTRIB_ARRAY13_NV:
+ case GL_VERTEX_ATTRIB_ARRAY14_NV:
+ case GL_VERTEX_ATTRIB_ARRAY15_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_VERTEX_ATTRIB_ARRAY0_NV;
+ *params = ctx->Array.VertexAttrib[n].Enabled;
+ }
+ break;
+ case GL_MAP1_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_MAP1_VERTEX_ATTRIB0_4_NV;
+ *params = ctx->Eval.Map1Attrib[n];
+ }
+ break;
+ case GL_MAP2_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_MAP2_VERTEX_ATTRIB0_4_NV;
+ *params = ctx->Eval.Map2Attrib[n];
}
break;
+#endif /* FEATURE_NV_vertex_program */
/* GL_NV_texture_rectangle */
case GL_TEXTURE_RECTANGLE_NV:
@@ -1427,8 +1462,18 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*params = INT_TO_BOOL(ctx->Const.MaxTextureRectSize);
break;
+ /* GL_EXT_stencil_two_side */
+ case GL_STENCIL_TEST_TWO_SIDE_EXT:
+ CHECK_EXTENSION_B(EXT_stencil_two_side, pname);
+ *params = ctx->Stencil.TestTwoSide;
+ break;
+ case GL_ACTIVE_STENCIL_FACE_EXT:
+ CHECK_EXTENSION_B(EXT_stencil_two_side, pname);
+ *params = ENUM_TO_BOOL(ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
+ break;
+
default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv(pname=0x%x)", pname);
}
}
@@ -1451,7 +1496,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
FLUSH_VERTICES(ctx, 0);
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glGetDoublev %s\n", _mesa_lookup_enum_by_nr(pname));
+ _mesa_debug(ctx, "glGetDoublev %s\n", _mesa_lookup_enum_by_nr(pname));
if (ctx->Driver.GetDoublev && (*ctx->Driver.GetDoublev)(ctx, pname, params))
return;
@@ -1491,7 +1536,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*params = ENUM_TO_DOUBLE(ctx->Color.AlphaFunc);
break;
case GL_ALPHA_TEST_REF:
- *params = (GLdouble) ctx->Color.AlphaRef / CHAN_MAXF;
+ *params = (GLdouble) ctx->Color.AlphaRef;
break;
case GL_ATTRIB_STACK_DEPTH:
*params = (GLdouble ) (ctx->AttribStackDepth);
@@ -1550,13 +1595,16 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
case GL_CLIP_PLANE3:
case GL_CLIP_PLANE4:
case GL_CLIP_PLANE5:
- *params = (GLdouble) ctx->Transform.ClipEnabled[pname-GL_CLIP_PLANE0];
+ if (ctx->Transform.ClipPlanesEnabled & (1 << (pname - GL_CLIP_PLANE0)))
+ *params = 1.0;
+ else
+ *params = 0.0;
break;
case GL_COLOR_CLEAR_VALUE:
- params[0] = (GLdouble) CHAN_TO_FLOAT(ctx->Color.ClearColor[0]);
- params[1] = (GLdouble) CHAN_TO_FLOAT(ctx->Color.ClearColor[1]);
- params[2] = (GLdouble) CHAN_TO_FLOAT(ctx->Color.ClearColor[2]);
- params[3] = (GLdouble) CHAN_TO_FLOAT(ctx->Color.ClearColor[3]);
+ params[0] = (GLdouble) ctx->Color.ClearColor[0];
+ params[1] = (GLdouble) ctx->Color.ClearColor[1];
+ params[2] = (GLdouble) ctx->Color.ClearColor[2];
+ params[3] = (GLdouble) ctx->Color.ClearColor[3];
break;
case GL_COLOR_MATERIAL:
*params = (GLdouble) ctx->Light.ColorMaterialEnabled;
@@ -1581,10 +1629,10 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
break;
case GL_CURRENT_COLOR:
FLUSH_CURRENT(ctx, 0);
- params[0] = (ctx->Current.Color[0]);
- params[1] = (ctx->Current.Color[1]);
- params[2] = (ctx->Current.Color[2]);
- params[3] = (ctx->Current.Color[3]);
+ params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0];
+ params[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1];
+ params[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2];
+ params[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
break;
case GL_CURRENT_INDEX:
FLUSH_CURRENT(ctx, 0);
@@ -1592,9 +1640,9 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
break;
case GL_CURRENT_NORMAL:
FLUSH_CURRENT(ctx, 0);
- params[0] = (GLdouble) ctx->Current.Normal[0];
- params[1] = (GLdouble) ctx->Current.Normal[1];
- params[2] = (GLdouble) ctx->Current.Normal[2];
+ params[0] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0];
+ params[1] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1];
+ params[2] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2];
break;
case GL_CURRENT_RASTER_COLOR:
params[0] = (GLdouble) ctx->Current.RasterColor[0];
@@ -1615,20 +1663,20 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
params[3] = (GLdouble) ctx->Current.RasterPos[3];
break;
case GL_CURRENT_RASTER_TEXTURE_COORDS:
- params[0] = (GLdouble) ctx->Current.RasterMultiTexCoord[texUnit][0];
- params[1] = (GLdouble) ctx->Current.RasterMultiTexCoord[texUnit][1];
- params[2] = (GLdouble) ctx->Current.RasterMultiTexCoord[texUnit][2];
- params[3] = (GLdouble) ctx->Current.RasterMultiTexCoord[texUnit][3];
+ params[0] = (GLdouble) ctx->Current.RasterTexCoords[texUnit][0];
+ params[1] = (GLdouble) ctx->Current.RasterTexCoords[texUnit][1];
+ params[2] = (GLdouble) ctx->Current.RasterTexCoords[texUnit][2];
+ params[3] = (GLdouble) ctx->Current.RasterTexCoords[texUnit][3];
break;
case GL_CURRENT_RASTER_POSITION_VALID:
*params = (GLdouble) ctx->Current.RasterPosValid;
break;
case GL_CURRENT_TEXTURE_COORDS:
FLUSH_CURRENT(ctx, 0);
- params[0] = (GLdouble) ctx->Current.Texcoord[texUnit][0];
- params[1] = (GLdouble) ctx->Current.Texcoord[texUnit][1];
- params[2] = (GLdouble) ctx->Current.Texcoord[texUnit][2];
- params[3] = (GLdouble) ctx->Current.Texcoord[texUnit][3];
+ params[0] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0];
+ params[1] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1];
+ params[2] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2];
+ params[3] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3];
break;
case GL_DEPTH_BIAS:
*params = (GLdouble) ctx->Pixel.DepthBias;
@@ -1713,15 +1761,6 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
case GL_GREEN_SCALE:
*params = (GLdouble) ctx->Pixel.GreenScale;
break;
- case GL_HISTOGRAM:
- if (ctx->Extensions.EXT_histogram || ctx->Extensions.ARB_imaging) {
- *params = (GLdouble) ctx->Pixel.HistogramEnabled;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
- }
- break;
case GL_INDEX_BITS:
*params = (GLdouble) ctx->Visual.indexBits;
break;
@@ -1945,16 +1984,13 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
params[0] = (GLdouble) MAX_WIDTH;
params[1] = (GLdouble) MAX_HEIGHT;
break;
- case GL_MINMAX:
- *params = (GLdouble) ctx->Pixel.MinMaxEnabled;
- break;
case GL_MODELVIEW_MATRIX:
for (i=0;i<16;i++) {
- params[i] = (GLdouble) ctx->ModelView.m[i];
+ params[i] = (GLdouble) ctx->ModelviewMatrixStack.Top->m[i];
}
break;
case GL_MODELVIEW_STACK_DEPTH:
- *params = (GLdouble) (ctx->ModelViewStackDepth + 1);
+ *params = (GLdouble) (ctx->ModelviewMatrixStack.Depth + 1);
break;
case GL_NAME_STACK_DEPTH:
*params = (GLdouble) ctx->Select.NameStackDepth;
@@ -1986,6 +2022,9 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
case GL_PACK_IMAGE_HEIGHT_EXT:
*params = (GLdouble) ctx->Pack.ImageHeight;
break;
+ case GL_PACK_INVERT_MESA:
+ *params = (GLdouble) ctx->Pack.Invert;
+ break;
case GL_PERSPECTIVE_CORRECTION_HINT:
*params = ENUM_TO_DOUBLE(ctx->Hint.PerspectiveCorrection);
break;
@@ -2077,11 +2116,11 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
break;
case GL_PROJECTION_MATRIX:
for (i=0;i<16;i++) {
- params[i] = (GLdouble) ctx->ProjectionMatrix.m[i];
+ params[i] = (GLdouble) ctx->ProjectionMatrixStack.Top->m[i];
}
break;
case GL_PROJECTION_STACK_DEPTH:
- *params = (GLdouble) (ctx->ProjectionStackDepth + 1);
+ *params = (GLdouble) (ctx->ProjectionMatrixStack.Depth + 1);
break;
case GL_READ_BUFFER:
*params = ENUM_TO_DOUBLE(ctx->Pixel.ReadBuffer);
@@ -2129,28 +2168,28 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*params = (GLdouble) ctx->Stencil.Clear;
break;
case GL_STENCIL_FAIL:
- *params = ENUM_TO_DOUBLE(ctx->Stencil.FailFunc);
+ *params = ENUM_TO_DOUBLE(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_FUNC:
- *params = ENUM_TO_DOUBLE(ctx->Stencil.Function);
+ *params = ENUM_TO_DOUBLE(ctx->Stencil.Function[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_PASS_DEPTH_FAIL:
- *params = ENUM_TO_DOUBLE(ctx->Stencil.ZFailFunc);
+ *params = ENUM_TO_DOUBLE(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_PASS_DEPTH_PASS:
- *params = ENUM_TO_DOUBLE(ctx->Stencil.ZPassFunc);
+ *params = ENUM_TO_DOUBLE(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_REF:
- *params = (GLdouble) ctx->Stencil.Ref;
+ *params = (GLdouble) ctx->Stencil.Ref[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_TEST:
*params = (GLdouble) ctx->Stencil.Enabled;
break;
case GL_STENCIL_VALUE_MASK:
- *params = (GLdouble) ctx->Stencil.ValueMask;
+ *params = (GLdouble) ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_WRITEMASK:
- *params = (GLdouble) ctx->Stencil.WriteMask;
+ *params = (GLdouble) ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace];
break;
case GL_STEREO:
*params = (GLdouble) ctx->Visual.stereoMode;
@@ -2199,11 +2238,11 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
break;
case GL_TEXTURE_MATRIX:
for (i=0;i<16;i++) {
- params[i] = (GLdouble) ctx->TextureMatrix[texUnit].m[i];
+ params[i] = (GLdouble) ctx->TextureMatrixStack[texUnit].Top->m[i];
}
break;
case GL_TEXTURE_STACK_DEPTH:
- *params = (GLdouble) (ctx->TextureStackDepth[texUnit] + 1);
+ *params = (GLdouble) (ctx->TextureMatrixStack[texUnit].Depth + 1);
break;
case GL_UNPACK_ALIGNMENT:
*params = (GLdouble) ctx->Unpack.Alignment;
@@ -2229,6 +2268,9 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
case GL_UNPACK_IMAGE_HEIGHT_EXT:
*params = (GLdouble) ctx->Unpack.ImageHeight;
break;
+ case GL_UNPACK_CLIENT_STORAGE_APPLE:
+ *params = (GLdouble) ctx->Unpack.ClientStorage;
+ break;
case GL_VIEWPORT:
params[0] = (GLdouble) ctx->Viewport.X;
params[1] = (GLdouble) ctx->Viewport.Y;
@@ -2322,58 +2364,50 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
/* GL_ARB_multitexture */
case GL_MAX_TEXTURE_UNITS_ARB:
+ CHECK_EXTENSION_D(ARB_multitexture, pname);
*params = (GLdouble) ctx->Const.MaxTextureUnits;
break;
case GL_ACTIVE_TEXTURE_ARB:
+ CHECK_EXTENSION_D(ARB_multitexture, pname);
*params = (GLdouble) (GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit);
break;
case GL_CLIENT_ACTIVE_TEXTURE_ARB:
+ CHECK_EXTENSION_D(ARB_multitexture, pname);
*params = (GLdouble) (GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
break;
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = (GLdouble) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
- else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
+ CHECK_EXTENSION_D(ARB_texture_cube_map, pname);
+ *params = (GLdouble) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
+ break;
case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = (GLdouble) textureUnit->CurrentCubeMap->Name;
- else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
+ CHECK_EXTENSION_D(ARB_texture_cube_map, pname);
+ *params = (GLdouble) textureUnit->CurrentCubeMap->Name;
+ break;
case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = (GLdouble) (1 << (ctx->Const.MaxCubeTextureLevels - 1));
- else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
+ CHECK_EXTENSION_D(ARB_texture_cube_map, pname);
+ *params = (GLdouble) (1 << (ctx->Const.MaxCubeTextureLevels - 1));
+ break;
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSION_HINT_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- *params = (GLdouble) ctx->Hint.TextureCompression;
- }
- else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+ CHECK_EXTENSION_D(ARB_texture_compression, pname);
+ *params = (GLdouble) ctx->Hint.TextureCompression;
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- *params = (GLdouble) ctx->Const.NumCompressedTextureFormats;
- }
- else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+ CHECK_EXTENSION_D(ARB_texture_compression, pname);
+ *params = (GLdouble) _mesa_get_compressed_formats(ctx, NULL);
break;
case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- GLuint i;
- for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
- params[i] = (GLdouble) ctx->Const.CompressedTextureFormats[i];
+ CHECK_EXTENSION_D(ARB_texture_compression, pname);
+ {
+ GLint formats[100];
+ GLuint i, n;
+ n = _mesa_get_compressed_formats(ctx, formats);
+ for (i = 0; i < n; i++)
+ params[i] = (GLdouble) formats[i];
}
- else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
break;
/* GL_EXT_compiled_vertex_array */
@@ -2389,7 +2423,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->ColorMatrix.m);
+ _math_transposef(tm, ctx->ColorMatrixStack.Top->m);
for (i=0;i<16;i++) {
params[i] = (GLdouble) tm[i];
}
@@ -2399,7 +2433,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->ModelView.m);
+ _math_transposef(tm, ctx->ModelviewMatrixStack.Top->m);
for (i=0;i<16;i++) {
params[i] = (GLdouble) tm[i];
}
@@ -2409,7 +2443,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->ProjectionMatrix.m);
+ _math_transposef(tm, ctx->ProjectionMatrixStack.Top->m);
for (i=0;i<16;i++) {
params[i] = (GLdouble) tm[i];
}
@@ -2419,7 +2453,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->TextureMatrix[texUnit].m);
+ _math_transposef(tm, ctx->TextureMatrixStack[texUnit].Top->m);
for (i=0;i<16;i++) {
params[i] = (GLdouble) tm[i];
}
@@ -2428,27 +2462,19 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
/* GL_HP_occlusion_test */
case GL_OCCLUSION_TEST_HP:
- if (ctx->Extensions.HP_occlusion_test) {
- *params = (GLdouble) ctx->Depth.OcclusionTest;
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
- }
- return;
+ CHECK_EXTENSION_D(HP_occlusion_test, pname);
+ *params = (GLdouble) ctx->Depth.OcclusionTest;
+ break;
case GL_OCCLUSION_TEST_RESULT_HP:
- if (ctx->Extensions.HP_occlusion_test) {
- if (ctx->Depth.OcclusionTest)
- *params = (GLdouble) ctx->OcclusionResult;
- else
- *params = (GLdouble) ctx->OcclusionResultSaved;
- /* reset flag now */
- ctx->OcclusionResult = GL_FALSE;
- ctx->OcclusionResultSaved = GL_FALSE;
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
- }
- return;
+ CHECK_EXTENSION_D(HP_occlusion_test, pname);
+ if (ctx->Depth.OcclusionTest)
+ *params = (GLdouble) ctx->OcclusionResult;
+ else
+ *params = (GLdouble) ctx->OcclusionResultSaved;
+ /* reset flag now */
+ ctx->OcclusionResult = GL_FALSE;
+ ctx->OcclusionResultSaved = GL_FALSE;
+ break;
/* GL_SGIS_pixel_texture */
case GL_PIXEL_TEXTURE_SGIS:
@@ -2466,11 +2492,11 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
/* GL_SGI_color_matrix (also in 1.2 imaging) */
case GL_COLOR_MATRIX_SGI:
for (i=0;i<16;i++) {
- params[i] = (GLdouble) ctx->ColorMatrix.m[i];
+ params[i] = (GLdouble) ctx->ColorMatrixStack.Top->m[i];
}
break;
case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
- *params = (GLdouble) (ctx->ColorStackDepth + 1);
+ *params = (GLdouble) (ctx->ColorMatrixStack.Depth + 1);
break;
case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
*params = (GLdouble) MAX_COLOR_STACK_DEPTH;
@@ -2502,57 +2528,60 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
/* GL_EXT_convolution (also in 1.2 imaging) */
case GL_CONVOLUTION_1D_EXT:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = (GLdouble) ctx->Pixel.Convolution1DEnabled;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
- }
+ CHECK_EXTENSION_D(EXT_convolution, pname);
+ *params = (GLdouble) ctx->Pixel.Convolution1DEnabled;
break;
case GL_CONVOLUTION_2D:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = (GLdouble) ctx->Pixel.Convolution2DEnabled;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
- }
+ CHECK_EXTENSION_D(EXT_convolution, pname);
+ *params = (GLdouble) ctx->Pixel.Convolution2DEnabled;
break;
case GL_SEPARABLE_2D:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = (GLdouble) ctx->Pixel.Separable2DEnabled;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
- }
+ CHECK_EXTENSION_D(EXT_convolution, pname);
+ *params = (GLdouble) ctx->Pixel.Separable2DEnabled;
break;
case GL_POST_CONVOLUTION_RED_SCALE_EXT:
+ CHECK_EXTENSION_D(EXT_convolution, pname);
*params = (GLdouble) ctx->Pixel.PostConvolutionScale[0];
break;
case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
+ CHECK_EXTENSION_D(EXT_convolution, pname);
*params = (GLdouble) ctx->Pixel.PostConvolutionScale[1];
break;
case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
+ CHECK_EXTENSION_D(EXT_convolution, pname);
*params = (GLdouble) ctx->Pixel.PostConvolutionScale[2];
break;
case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
+ CHECK_EXTENSION_D(EXT_convolution, pname);
*params = (GLdouble) ctx->Pixel.PostConvolutionScale[3];
break;
case GL_POST_CONVOLUTION_RED_BIAS_EXT:
+ CHECK_EXTENSION_D(EXT_convolution, pname);
*params = (GLdouble) ctx->Pixel.PostConvolutionBias[0];
break;
case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
+ CHECK_EXTENSION_D(EXT_convolution, pname);
*params = (GLdouble) ctx->Pixel.PostConvolutionBias[1];
break;
case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
+ CHECK_EXTENSION_D(EXT_convolution, pname);
*params = (GLdouble) ctx->Pixel.PostConvolutionBias[2];
break;
case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
+ CHECK_EXTENSION_D(EXT_convolution, pname);
*params = (GLdouble) ctx->Pixel.PostConvolutionBias[2];
break;
+ /* GL_EXT_histogram (also in 1.2 imaging) */
+ case GL_HISTOGRAM:
+ CHECK_EXTENSION_D(EXT_histogram, pname);
+ *params = (GLdouble) ctx->Pixel.HistogramEnabled;
+ break;
+ case GL_MINMAX:
+ CHECK_EXTENSION_D(EXT_histogram, pname);
+ *params = (GLdouble) ctx->Pixel.MinMaxEnabled;
+ break;
+
/* GL_SGI_color_table (also in 1.2 imaging */
case GL_COLOR_TABLE_SGI:
*params = (GLdouble) ctx->Pixel.ColorTableEnabled;
@@ -2566,39 +2595,49 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
/* GL_EXT_secondary_color */
case GL_COLOR_SUM_EXT:
+ CHECK_EXTENSION_D(EXT_secondary_color, pname);
*params = (GLdouble) ctx->Fog.ColorSumEnabled;
break;
case GL_CURRENT_SECONDARY_COLOR_EXT:
+ CHECK_EXTENSION_D(EXT_secondary_color, pname);
FLUSH_CURRENT(ctx, 0);
- params[0] = (ctx->Current.SecondaryColor[0]);
- params[1] = (ctx->Current.SecondaryColor[1]);
- params[2] = (ctx->Current.SecondaryColor[2]);
+ params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0];
+ params[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1];
+ params[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2];
break;
case GL_SECONDARY_COLOR_ARRAY_EXT:
+ CHECK_EXTENSION_D(EXT_secondary_color, pname);
*params = (GLdouble) ctx->Array.SecondaryColor.Enabled;
break;
case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_D(EXT_secondary_color, pname);
*params = (GLdouble) ctx->Array.SecondaryColor.Type;
break;
case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_D(EXT_secondary_color, pname);
*params = (GLdouble) ctx->Array.SecondaryColor.Stride;
break;
case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
+ CHECK_EXTENSION_D(EXT_secondary_color, pname);
*params = (GLdouble) ctx->Array.SecondaryColor.Stride;
break;
/* GL_EXT_fog_coord */
case GL_CURRENT_FOG_COORDINATE_EXT:
+ CHECK_EXTENSION_D(EXT_fog_coord, pname);
FLUSH_CURRENT(ctx, 0);
- *params = (GLdouble) ctx->Current.FogCoord;
+ *params = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
break;
case GL_FOG_COORDINATE_ARRAY_EXT:
+ CHECK_EXTENSION_D(EXT_fog_coord, pname);
*params = (GLdouble) ctx->Array.FogCoord.Enabled;
break;
case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_D(EXT_fog_coord, pname);
*params = (GLdouble) ctx->Array.FogCoord.Type;
break;
case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_D(EXT_fog_coord, pname);
*params = (GLdouble) ctx->Array.FogCoord.Stride;
break;
@@ -2609,121 +2648,170 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
/* GL_EXT_texture_filter_anisotropic */
case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
- if (ctx->Extensions.EXT_texture_filter_anisotropic) {
- *params = (GLdouble) ctx->Const.MaxTextureMaxAnisotropy;
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
- return;
- }
+ CHECK_EXTENSION_D(EXT_texture_filter_anisotropic, pname);
+ *params = (GLdouble) ctx->Const.MaxTextureMaxAnisotropy;
break;
/* GL_ARB_multisample */
case GL_MULTISAMPLE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = (GLdouble) ctx->Multisample.Enabled;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
- }
+ CHECK_EXTENSION_D(ARB_multisample, pname);
+ *params = (GLdouble) ctx->Multisample.Enabled;
break;
case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = (GLdouble) ctx->Multisample.SampleAlphaToCoverage;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
- }
+ CHECK_EXTENSION_D(ARB_multisample, pname);
+ *params = (GLdouble) ctx->Multisample.SampleAlphaToCoverage;
break;
case GL_SAMPLE_ALPHA_TO_ONE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = (GLdouble) ctx->Multisample.SampleAlphaToOne;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
- }
+ CHECK_EXTENSION_D(ARB_multisample, pname);
+ *params = (GLdouble) ctx->Multisample.SampleAlphaToOne;
break;
case GL_SAMPLE_COVERAGE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = (GLdouble) ctx->Multisample.SampleCoverage;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
- }
+ CHECK_EXTENSION_D(ARB_multisample, pname);
+ *params = (GLdouble) ctx->Multisample.SampleCoverage;
break;
case GL_SAMPLE_COVERAGE_VALUE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = ctx->Multisample.SampleCoverageValue;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
- }
+ CHECK_EXTENSION_D(ARB_multisample, pname);
+ *params = ctx->Multisample.SampleCoverageValue;
break;
case GL_SAMPLE_COVERAGE_INVERT_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = (GLdouble) ctx->Multisample.SampleCoverageInvert;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
- }
+ CHECK_EXTENSION_D(ARB_multisample, pname);
+ *params = (GLdouble) ctx->Multisample.SampleCoverageInvert;
break;
case GL_SAMPLE_BUFFERS_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = 0.0; /* XXX fix someday */
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
- }
+ CHECK_EXTENSION_D(ARB_multisample, pname);
+ *params = 0.0; /* XXX fix someday */
break;
case GL_SAMPLES_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = 0.0; /* XXX fix someday */
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
- }
+ CHECK_EXTENSION_D(ARB_multisample, pname);
+ *params = 0.0; /* XXX fix someday */
break;
/* GL_IBM_rasterpos_clip */
case GL_RASTER_POSITION_UNCLIPPED_IBM:
- if (ctx->Extensions.IBM_rasterpos_clip) {
- *params = (GLdouble) ctx->Transform.RasterPositionUnclipped;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
- }
+ CHECK_EXTENSION_D(IBM_rasterpos_clip, pname);
+ *params = (GLdouble) ctx->Transform.RasterPositionUnclipped;
break;
- /* GL_MESA_sprite_point */
- case GL_SPRITE_POINT_MESA:
- if (ctx->Extensions.MESA_sprite_point) {
- *params = (GLdouble) ctx->Point.SpriteMode;
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
- return;
- }
+ /* GL_NV_point_sprite */
+ case GL_POINT_SPRITE_NV:
+ CHECK_EXTENSION_B(NV_point_sprite, pname);
+ *params = (GLdouble) ctx->Point.PointSprite;
+ break;
+ case GL_POINT_SPRITE_R_MODE_NV:
+ CHECK_EXTENSION_B(NV_point_sprite, pname);
+ *params = (GLdouble) ctx->Point.SpriteRMode;
break;
/* GL_SGIS_generate_mipmap */
case GL_GENERATE_MIPMAP_HINT_SGIS:
- if (ctx->Extensions.SGIS_generate_mipmap) {
- *params = (GLdouble) ctx->Hint.GenerateMipmap;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
+ CHECK_EXTENSION_D(SGIS_generate_mipmap, pname);
+ *params = (GLdouble) ctx->Hint.GenerateMipmap;
+ break;
+
+#if FEATURE_NV_vertex_program
+ case GL_VERTEX_PROGRAM_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ *params = (GLdouble) ctx->VertexProgram.Enabled;
+ break;
+ case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ *params = (GLdouble) ctx->VertexProgram.PointSizeEnabled;
+ break;
+ case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ *params = (GLdouble) ctx->VertexProgram.TwoSideEnabled;
+ break;
+ case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ *params = (GLdouble) MAX_PROGRAM_STACK_DEPTH;
+ break;
+ case GL_MAX_TRACK_MATRICES_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ *params = (GLdouble) MAX_PROGRAM_MATRICES;
+ break;
+ case GL_CURRENT_MATRIX_STACK_DEPTH_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ *params = (GLdouble) ctx->CurrentStack->Depth;
+ break;
+ case GL_CURRENT_MATRIX_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ *params = (GLdouble) ctx->Transform.MatrixMode;
+ break;
+ case GL_VERTEX_PROGRAM_BINDING_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ *params = (GLdouble) ctx->VertexProgram.CurrentID;
+ break;
+ case GL_PROGRAM_ERROR_POSITION_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ *params = (GLdouble) ctx->VertexProgram.ErrorPos;
+ break;
+ case GL_VERTEX_ATTRIB_ARRAY0_NV:
+ case GL_VERTEX_ATTRIB_ARRAY1_NV:
+ case GL_VERTEX_ATTRIB_ARRAY2_NV:
+ case GL_VERTEX_ATTRIB_ARRAY3_NV:
+ case GL_VERTEX_ATTRIB_ARRAY4_NV:
+ case GL_VERTEX_ATTRIB_ARRAY5_NV:
+ case GL_VERTEX_ATTRIB_ARRAY6_NV:
+ case GL_VERTEX_ATTRIB_ARRAY7_NV:
+ case GL_VERTEX_ATTRIB_ARRAY8_NV:
+ case GL_VERTEX_ATTRIB_ARRAY9_NV:
+ case GL_VERTEX_ATTRIB_ARRAY10_NV:
+ case GL_VERTEX_ATTRIB_ARRAY11_NV:
+ case GL_VERTEX_ATTRIB_ARRAY12_NV:
+ case GL_VERTEX_ATTRIB_ARRAY13_NV:
+ case GL_VERTEX_ATTRIB_ARRAY14_NV:
+ case GL_VERTEX_ATTRIB_ARRAY15_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_VERTEX_ATTRIB_ARRAY0_NV;
+ *params = (GLdouble) ctx->Array.VertexAttrib[n].Enabled;
+ }
+ break;
+ case GL_MAP1_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_MAP1_VERTEX_ATTRIB0_4_NV;
+ *params = (GLdouble) ctx->Eval.Map1Attrib[n];
+ }
+ break;
+ case GL_MAP2_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_MAP2_VERTEX_ATTRIB0_4_NV;
+ *params = (GLdouble) ctx->Eval.Map2Attrib[n];
}
break;
+#endif /* FEATURE_NV_vertex_program */
/* GL_NV_texture_rectangle */
case GL_TEXTURE_RECTANGLE_NV:
@@ -2739,19 +2827,22 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*params = (GLdouble) ctx->Const.MaxTextureRectSize;
break;
+ /* GL_EXT_stencil_two_side */
+ case GL_STENCIL_TEST_TWO_SIDE_EXT:
+ CHECK_EXTENSION_D(EXT_stencil_two_side, pname);
+ *params = (GLdouble) ctx->Stencil.TestTwoSide;
+ break;
+ case GL_ACTIVE_STENCIL_FACE_EXT:
+ CHECK_EXTENSION_D(EXT_stencil_two_side, pname);
+ *params = (GLdouble) (ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
+ break;
+
default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev(pname=0x%x)", pname);
}
}
-#define GET_FLOAT_ERROR \
-{ \
- char s[100]; \
- sprintf(s, "glGetFloatv(0x%x)", pname); \
- _mesa_error(ctx, GL_INVALID_ENUM, s); \
-}
-
void
_mesa_GetFloatv( GLenum pname, GLfloat *params )
{
@@ -2770,7 +2861,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
FLUSH_VERTICES(ctx, 0);
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glGetFloatv %s\n", _mesa_lookup_enum_by_nr(pname));
+ _mesa_debug(ctx, "glGetFloatv %s\n", _mesa_lookup_enum_by_nr(pname));
if (ctx->Driver.GetFloatv && (*ctx->Driver.GetFloatv)(ctx, pname, params))
return;
@@ -2810,7 +2901,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*params = ENUM_TO_FLOAT(ctx->Color.AlphaFunc);
break;
case GL_ALPHA_TEST_REF:
- *params = (GLfloat) ctx->Color.AlphaRef / CHAN_MAXF;
+ *params = (GLfloat) ctx->Color.AlphaRef;
break;
case GL_ATTRIB_STACK_DEPTH:
*params = (GLfloat) (ctx->AttribStackDepth);
@@ -2869,13 +2960,16 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
case GL_CLIP_PLANE3:
case GL_CLIP_PLANE4:
case GL_CLIP_PLANE5:
- *params = (GLfloat) ctx->Transform.ClipEnabled[pname-GL_CLIP_PLANE0];
+ if (ctx->Transform.ClipPlanesEnabled & (1 << (pname - GL_CLIP_PLANE0)))
+ *params = 1.0;
+ else
+ *params = 0.0;
break;
case GL_COLOR_CLEAR_VALUE:
- params[0] = CHAN_TO_FLOAT(ctx->Color.ClearColor[0]);
- params[1] = CHAN_TO_FLOAT(ctx->Color.ClearColor[1]);
- params[2] = CHAN_TO_FLOAT(ctx->Color.ClearColor[2]);
- params[3] = CHAN_TO_FLOAT(ctx->Color.ClearColor[3]);
+ params[0] = ctx->Color.ClearColor[0];
+ params[1] = ctx->Color.ClearColor[1];
+ params[2] = ctx->Color.ClearColor[2];
+ params[3] = ctx->Color.ClearColor[3];
break;
case GL_COLOR_MATERIAL:
*params = (GLfloat) ctx->Light.ColorMaterialEnabled;
@@ -2900,10 +2994,10 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
break;
case GL_CURRENT_COLOR:
FLUSH_CURRENT(ctx, 0);
- params[0] = (ctx->Current.Color[0]);
- params[1] = (ctx->Current.Color[1]);
- params[2] = (ctx->Current.Color[2]);
- params[3] = (ctx->Current.Color[3]);
+ params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0];
+ params[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1];
+ params[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2];
+ params[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
break;
case GL_CURRENT_INDEX:
FLUSH_CURRENT(ctx, 0);
@@ -2911,9 +3005,9 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
break;
case GL_CURRENT_NORMAL:
FLUSH_CURRENT(ctx, 0);
- params[0] = ctx->Current.Normal[0];
- params[1] = ctx->Current.Normal[1];
- params[2] = ctx->Current.Normal[2];
+ params[0] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0];
+ params[1] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1];
+ params[2] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2];
break;
case GL_CURRENT_RASTER_COLOR:
params[0] = ctx->Current.RasterColor[0];
@@ -2934,20 +3028,20 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
params[3] = ctx->Current.RasterPos[3];
break;
case GL_CURRENT_RASTER_TEXTURE_COORDS:
- params[0] = ctx->Current.RasterMultiTexCoord[texUnit][0];
- params[1] = ctx->Current.RasterMultiTexCoord[texUnit][1];
- params[2] = ctx->Current.RasterMultiTexCoord[texUnit][2];
- params[3] = ctx->Current.RasterMultiTexCoord[texUnit][3];
+ params[0] = ctx->Current.RasterTexCoords[texUnit][0];
+ params[1] = ctx->Current.RasterTexCoords[texUnit][1];
+ params[2] = ctx->Current.RasterTexCoords[texUnit][2];
+ params[3] = ctx->Current.RasterTexCoords[texUnit][3];
break;
case GL_CURRENT_RASTER_POSITION_VALID:
*params = (GLfloat) ctx->Current.RasterPosValid;
break;
case GL_CURRENT_TEXTURE_COORDS:
FLUSH_CURRENT(ctx, 0);
- params[0] = (GLfloat) ctx->Current.Texcoord[texUnit][0];
- params[1] = (GLfloat) ctx->Current.Texcoord[texUnit][1];
- params[2] = (GLfloat) ctx->Current.Texcoord[texUnit][2];
- params[3] = (GLfloat) ctx->Current.Texcoord[texUnit][3];
+ params[0] = (GLfloat) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0];
+ params[1] = (GLfloat) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1];
+ params[2] = (GLfloat) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2];
+ params[3] = (GLfloat) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3];
break;
case GL_DEPTH_BIAS:
*params = (GLfloat) ctx->Pixel.DepthBias;
@@ -3032,15 +3126,6 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
case GL_GREEN_SCALE:
*params = (GLfloat) ctx->Pixel.GreenScale;
break;
- case GL_HISTOGRAM:
- if (ctx->Extensions.EXT_histogram || ctx->Extensions.ARB_imaging) {
- *params = (GLfloat) ctx->Pixel.HistogramEnabled;
- }
- else {
- GET_FLOAT_ERROR;
- return;
- }
- break;
case GL_INDEX_BITS:
*params = (GLfloat) ctx->Visual.indexBits;
break;
@@ -3264,16 +3349,13 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
params[0] = (GLfloat) MAX_WIDTH;
params[1] = (GLfloat) MAX_HEIGHT;
break;
- case GL_MINMAX:
- *params = (GLfloat) ctx->Pixel.MinMaxEnabled;
- break;
case GL_MODELVIEW_MATRIX:
for (i=0;i<16;i++) {
- params[i] = ctx->ModelView.m[i];
+ params[i] = ctx->ModelviewMatrixStack.Top->m[i];
}
break;
case GL_MODELVIEW_STACK_DEPTH:
- *params = (GLfloat) (ctx->ModelViewStackDepth + 1);
+ *params = (GLfloat) (ctx->ModelviewMatrixStack.Depth + 1);
break;
case GL_NAME_STACK_DEPTH:
*params = (GLfloat) ctx->Select.NameStackDepth;
@@ -3305,6 +3387,9 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
case GL_PACK_IMAGE_HEIGHT_EXT:
*params = (GLfloat) ctx->Pack.ImageHeight;
break;
+ case GL_PACK_INVERT_MESA:
+ *params = (GLfloat) ctx->Pack.Invert;
+ break;
case GL_PERSPECTIVE_CORRECTION_HINT:
*params = ENUM_TO_FLOAT(ctx->Hint.PerspectiveCorrection);
break;
@@ -3398,11 +3483,11 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
break;
case GL_PROJECTION_MATRIX:
for (i=0;i<16;i++) {
- params[i] = ctx->ProjectionMatrix.m[i];
+ params[i] = ctx->ProjectionMatrixStack.Top->m[i];
}
break;
case GL_PROJECTION_STACK_DEPTH:
- *params = (GLfloat) (ctx->ProjectionStackDepth + 1);
+ *params = (GLfloat) (ctx->ProjectionMatrixStack.Depth + 1);
break;
case GL_READ_BUFFER:
*params = ENUM_TO_FLOAT(ctx->Pixel.ReadBuffer);
@@ -3450,28 +3535,28 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*params = (GLfloat) ctx->Stencil.Clear;
break;
case GL_STENCIL_FAIL:
- *params = ENUM_TO_FLOAT(ctx->Stencil.FailFunc);
+ *params = ENUM_TO_FLOAT(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_FUNC:
- *params = ENUM_TO_FLOAT(ctx->Stencil.Function);
+ *params = ENUM_TO_FLOAT(ctx->Stencil.Function[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_PASS_DEPTH_FAIL:
- *params = ENUM_TO_FLOAT(ctx->Stencil.ZFailFunc);
+ *params = ENUM_TO_FLOAT(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_PASS_DEPTH_PASS:
- *params = ENUM_TO_FLOAT(ctx->Stencil.ZPassFunc);
+ *params = ENUM_TO_FLOAT(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_REF:
- *params = (GLfloat) ctx->Stencil.Ref;
+ *params = (GLfloat) ctx->Stencil.Ref[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_TEST:
*params = (GLfloat) ctx->Stencil.Enabled;
break;
case GL_STENCIL_VALUE_MASK:
- *params = (GLfloat) ctx->Stencil.ValueMask;
+ *params = (GLfloat) ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_WRITEMASK:
- *params = (GLfloat) ctx->Stencil.WriteMask;
+ *params = (GLfloat) ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace];
break;
case GL_STEREO:
*params = (GLfloat) ctx->Visual.stereoMode;
@@ -3520,11 +3605,11 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
break;
case GL_TEXTURE_MATRIX:
for (i=0;i<16;i++) {
- params[i] = ctx->TextureMatrix[texUnit].m[i];
+ params[i] = ctx->TextureMatrixStack[texUnit].Top->m[i];
}
break;
case GL_TEXTURE_STACK_DEPTH:
- *params = (GLfloat) (ctx->TextureStackDepth[texUnit] + 1);
+ *params = (GLfloat) (ctx->TextureMatrixStack[texUnit].Depth + 1);
break;
case GL_UNPACK_ALIGNMENT:
*params = (GLfloat) ctx->Unpack.Alignment;
@@ -3550,6 +3635,9 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
case GL_UNPACK_IMAGE_HEIGHT_EXT:
*params = (GLfloat) ctx->Unpack.ImageHeight;
break;
+ case GL_UNPACK_CLIENT_STORAGE_APPLE:
+ *params = (GLfloat) ctx->Unpack.ClientStorage;
+ break;
case GL_VIEWPORT:
params[0] = (GLfloat) ctx->Viewport.X;
params[1] = (GLfloat) ctx->Viewport.Y;
@@ -3643,105 +3731,91 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
/* GL_ARB_multitexture */
case GL_MAX_TEXTURE_UNITS_ARB:
+ CHECK_EXTENSION_F(ARB_multitexture, pname);
*params = (GLfloat) ctx->Const.MaxTextureUnits;
break;
case GL_ACTIVE_TEXTURE_ARB:
+ CHECK_EXTENSION_F(ARB_multitexture, pname);
*params = (GLfloat) (GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit);
break;
case GL_CLIENT_ACTIVE_TEXTURE_ARB:
+ CHECK_EXTENSION_F(ARB_multitexture, pname);
*params = (GLfloat) (GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
break;
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = (GLfloat) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
- else
- GET_FLOAT_ERROR;
- return;
+ CHECK_EXTENSION_F(ARB_texture_cube_map, pname);
+ *params = (GLfloat) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
+ break;
case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = (GLfloat) textureUnit->CurrentCubeMap->Name;
- else
- GET_FLOAT_ERROR;
- return;
+ CHECK_EXTENSION_F(ARB_texture_cube_map, pname);
+ *params = (GLfloat) textureUnit->CurrentCubeMap->Name;
+ break;
case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = (GLfloat) (1 << (ctx->Const.MaxCubeTextureLevels - 1));
- else
- GET_FLOAT_ERROR;
- return;
+ CHECK_EXTENSION_F(ARB_texture_cube_map, pname);
+ *params = (GLfloat) (1 << (ctx->Const.MaxCubeTextureLevels - 1));
+ break;
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSION_HINT_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- *params = (GLfloat) ctx->Hint.TextureCompression;
- }
- else
- GET_FLOAT_ERROR;
+ CHECK_EXTENSION_F(ARB_texture_compression, pname);
+ *params = (GLfloat) ctx->Hint.TextureCompression;
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- *params = (GLfloat) ctx->Const.NumCompressedTextureFormats;
- }
- else
- GET_FLOAT_ERROR;
+ CHECK_EXTENSION_F(ARB_texture_compression, pname);
+ *params = (GLfloat) _mesa_get_compressed_formats(ctx, NULL);
break;
case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- GLuint i;
- for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
- params[i] = (GLfloat) ctx->Const.CompressedTextureFormats[i];
+ CHECK_EXTENSION_F(ARB_texture_compression, pname);
+ {
+ GLint formats[100];
+ GLuint i, n;
+ n = _mesa_get_compressed_formats(ctx, formats);
+ for (i = 0; i < n; i++)
+ params[i] = (GLfloat) formats[i];
}
- else
- GET_FLOAT_ERROR;
break;
/* GL_EXT_compiled_vertex_array */
case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
+ CHECK_EXTENSION_F(EXT_compiled_vertex_array, pname);
*params = (GLfloat) ctx->Array.LockFirst;
break;
case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
+ CHECK_EXTENSION_F(EXT_compiled_vertex_array, pname);
*params = (GLfloat) ctx->Array.LockCount;
break;
/* GL_ARB_transpose_matrix */
case GL_TRANSPOSE_COLOR_MATRIX_ARB:
- _math_transposef(params, ctx->ColorMatrix.m);
+ _math_transposef(params, ctx->ColorMatrixStack.Top->m);
break;
case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
- _math_transposef(params, ctx->ModelView.m);
+ _math_transposef(params, ctx->ModelviewMatrixStack.Top->m);
break;
case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
- _math_transposef(params, ctx->ProjectionMatrix.m);
+ _math_transposef(params, ctx->ProjectionMatrixStack.Top->m);
break;
case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
- _math_transposef(params, ctx->TextureMatrix[texUnit].m);
+ _math_transposef(params, ctx->TextureMatrixStack[texUnit].Top->m);
break;
/* GL_HP_occlusion_test */
case GL_OCCLUSION_TEST_HP:
- if (ctx->Extensions.HP_occlusion_test) {
- *params = (GLfloat) ctx->Depth.OcclusionTest;
- }
- else {
- GET_FLOAT_ERROR;
- }
- return;
+ CHECK_EXTENSION_F(HP_occlusion_test, pname);
+ *params = (GLfloat) ctx->Depth.OcclusionTest;
+ break;
case GL_OCCLUSION_TEST_RESULT_HP:
- if (ctx->Extensions.HP_occlusion_test) {
- if (ctx->Depth.OcclusionTest)
- *params = (GLfloat) ctx->OcclusionResult;
- else
- *params = (GLfloat) ctx->OcclusionResultSaved;
- /* reset flag now */
- ctx->OcclusionResult = GL_FALSE;
- ctx->OcclusionResultSaved = GL_FALSE;
- }
- else {
- GET_FLOAT_ERROR;
- }
- return;
+ CHECK_EXTENSION_F(HP_occlusion_test, pname);
+ if (ctx->Depth.OcclusionTest)
+ *params = (GLfloat) ctx->OcclusionResult;
+ else
+ *params = (GLfloat) ctx->OcclusionResultSaved;
+ /* reset flag now */
+ ctx->OcclusionResult = GL_FALSE;
+ ctx->OcclusionResultSaved = GL_FALSE;
+ break;
/* GL_SGIS_pixel_texture */
case GL_PIXEL_TEXTURE_SGIS:
@@ -3759,11 +3833,11 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
/* GL_SGI_color_matrix (also in 1.2 imaging) */
case GL_COLOR_MATRIX_SGI:
for (i=0;i<16;i++) {
- params[i] = ctx->ColorMatrix.m[i];
+ params[i] = ctx->ColorMatrixStack.Top->m[i];
}
break;
case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
- *params = (GLfloat) (ctx->ColorStackDepth + 1);
+ *params = (GLfloat) (ctx->ColorMatrixStack.Depth + 1);
break;
case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
*params = (GLfloat) MAX_COLOR_STACK_DEPTH;
@@ -3795,57 +3869,60 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
/* GL_EXT_convolution (also in 1.2 imaging) */
case GL_CONVOLUTION_1D_EXT:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = (GLfloat) ctx->Pixel.Convolution1DEnabled;
- }
- else {
- GET_FLOAT_ERROR;
- return;
- }
+ CHECK_EXTENSION_F(EXT_convolution, pname);
+ *params = (GLfloat) ctx->Pixel.Convolution1DEnabled;
break;
case GL_CONVOLUTION_2D:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = (GLfloat) ctx->Pixel.Convolution2DEnabled;
- }
- else {
- GET_FLOAT_ERROR;
- return;
- }
+ CHECK_EXTENSION_F(EXT_convolution, pname);
+ *params = (GLfloat) ctx->Pixel.Convolution2DEnabled;
break;
case GL_SEPARABLE_2D:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = (GLfloat) ctx->Pixel.Separable2DEnabled;
- }
- else {
- GET_FLOAT_ERROR;
- return;
- }
+ CHECK_EXTENSION_F(EXT_convolution, pname);
+ *params = (GLfloat) ctx->Pixel.Separable2DEnabled;
break;
case GL_POST_CONVOLUTION_RED_SCALE_EXT:
+ CHECK_EXTENSION_F(EXT_convolution, pname);
*params = ctx->Pixel.PostConvolutionScale[0];
break;
case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
+ CHECK_EXTENSION_F(EXT_convolution, pname);
*params = ctx->Pixel.PostConvolutionScale[1];
break;
case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
+ CHECK_EXTENSION_F(EXT_convolution, pname);
*params = ctx->Pixel.PostConvolutionScale[2];
break;
case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
+ CHECK_EXTENSION_F(EXT_convolution, pname);
*params = ctx->Pixel.PostConvolutionScale[3];
break;
case GL_POST_CONVOLUTION_RED_BIAS_EXT:
+ CHECK_EXTENSION_F(EXT_convolution, pname);
*params = ctx->Pixel.PostConvolutionBias[0];
break;
case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
+ CHECK_EXTENSION_F(EXT_convolution, pname);
*params = ctx->Pixel.PostConvolutionBias[1];
break;
case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
+ CHECK_EXTENSION_F(EXT_convolution, pname);
*params = ctx->Pixel.PostConvolutionBias[2];
break;
case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
+ CHECK_EXTENSION_F(EXT_convolution, pname);
*params = ctx->Pixel.PostConvolutionBias[2];
break;
+ /* GL_EXT_histogram (also in 1.2 imaging) */
+ case GL_HISTOGRAM:
+ CHECK_EXTENSION_F(EXT_histogram, pname);
+ *params = (GLfloat) ctx->Pixel.HistogramEnabled;
+ break;
+ case GL_MINMAX:
+ CHECK_EXTENSION_F(EXT_histogram, pname);
+ *params = (GLfloat) ctx->Pixel.MinMaxEnabled;
+ break;
+
/* GL_SGI_color_table (also in 1.2 imaging */
case GL_COLOR_TABLE_SGI:
*params = (GLfloat) ctx->Pixel.ColorTableEnabled;
@@ -3859,39 +3936,49 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
/* GL_EXT_secondary_color */
case GL_COLOR_SUM_EXT:
+ CHECK_EXTENSION_F(EXT_secondary_color, pname);
*params = (GLfloat) ctx->Fog.ColorSumEnabled;
break;
case GL_CURRENT_SECONDARY_COLOR_EXT:
+ CHECK_EXTENSION_F(EXT_secondary_color, pname);
FLUSH_CURRENT(ctx, 0);
- params[0] = (ctx->Current.SecondaryColor[0]);
- params[1] = (ctx->Current.SecondaryColor[1]);
- params[2] = (ctx->Current.SecondaryColor[2]);
+ params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0];
+ params[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1];
+ params[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2];
break;
case GL_SECONDARY_COLOR_ARRAY_EXT:
+ CHECK_EXTENSION_F(EXT_secondary_color, pname);
*params = (GLfloat) ctx->Array.SecondaryColor.Enabled;
break;
case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_F(EXT_secondary_color, pname);
*params = (GLfloat) ctx->Array.SecondaryColor.Type;
break;
case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_F(EXT_secondary_color, pname);
*params = (GLfloat) ctx->Array.SecondaryColor.Stride;
break;
case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
+ CHECK_EXTENSION_F(EXT_secondary_color, pname);
*params = (GLfloat) ctx->Array.SecondaryColor.Stride;
break;
/* GL_EXT_fog_coord */
case GL_CURRENT_FOG_COORDINATE_EXT:
+ CHECK_EXTENSION_F(EXT_fog_coord, pname);
FLUSH_CURRENT(ctx, 0);
- *params = (GLfloat) ctx->Current.FogCoord;
+ *params = (GLfloat) ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
break;
case GL_FOG_COORDINATE_ARRAY_EXT:
+ CHECK_EXTENSION_F(EXT_fog_coord, pname);
*params = (GLfloat) ctx->Array.FogCoord.Enabled;
break;
case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_F(EXT_fog_coord, pname);
*params = (GLfloat) ctx->Array.FogCoord.Type;
break;
case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_F(EXT_fog_coord, pname);
*params = (GLfloat) ctx->Array.FogCoord.Stride;
break;
@@ -3902,119 +3989,167 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
/* GL_EXT_texture_filter_anisotropic */
case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
- if (ctx->Extensions.EXT_texture_filter_anisotropic) {
- *params = ctx->Const.MaxTextureMaxAnisotropy;
- }
- else {
- GET_FLOAT_ERROR;
- return;
- }
+ CHECK_EXTENSION_F(EXT_texture_filter_anisotropic, pname);
+ *params = ctx->Const.MaxTextureMaxAnisotropy;
break;
/* GL_ARB_multisample */
case GL_MULTISAMPLE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = (GLfloat) ctx->Multisample.Enabled;
- }
- else {
- GET_FLOAT_ERROR;
- return;
- }
+ CHECK_EXTENSION_F(ARB_multisample, pname);
+ *params = (GLfloat) ctx->Multisample.Enabled;
break;
case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = (GLfloat) ctx->Multisample.SampleAlphaToCoverage;
- }
- else {
- GET_FLOAT_ERROR;
- return;
- }
+ CHECK_EXTENSION_F(ARB_multisample, pname);
+ *params = (GLfloat) ctx->Multisample.SampleAlphaToCoverage;
break;
case GL_SAMPLE_ALPHA_TO_ONE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = (GLfloat) ctx->Multisample.SampleAlphaToOne;
- }
- else {
- GET_FLOAT_ERROR;
- return;
- }
+ CHECK_EXTENSION_F(ARB_multisample, pname);
+ *params = (GLfloat) ctx->Multisample.SampleAlphaToOne;
break;
case GL_SAMPLE_COVERAGE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = (GLfloat) ctx->Multisample.SampleCoverage;
- }
- else {
- GET_FLOAT_ERROR;
- return;
- }
+ CHECK_EXTENSION_F(ARB_multisample, pname);
+ *params = (GLfloat) ctx->Multisample.SampleCoverage;
break;
case GL_SAMPLE_COVERAGE_VALUE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = ctx->Multisample.SampleCoverageValue;
- }
- else {
- GET_FLOAT_ERROR;
- return;
- }
+ CHECK_EXTENSION_F(ARB_multisample, pname);
+ *params = ctx->Multisample.SampleCoverageValue;
break;
case GL_SAMPLE_COVERAGE_INVERT_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = (GLfloat) ctx->Multisample.SampleCoverageInvert;
- }
- else {
- GET_FLOAT_ERROR;
- return;
- }
+ CHECK_EXTENSION_F(ARB_multisample, pname);
+ *params = (GLfloat) ctx->Multisample.SampleCoverageInvert;
break;
case GL_SAMPLE_BUFFERS_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = 0.0; /* XXX fix someday */
- }
- else {
- GET_FLOAT_ERROR;
- return;
- }
+ CHECK_EXTENSION_F(ARB_multisample, pname);
+ *params = 0.0; /* XXX fix someday */
break;
case GL_SAMPLES_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = 0.0; /* XXX fix someday */
- }
- else {
- GET_FLOAT_ERROR;
- return;
- }
+ CHECK_EXTENSION_F(ARB_multisample, pname);
+ *params = 0.0; /* XXX fix someday */
break;
/* GL_IBM_rasterpos_clip */
case GL_RASTER_POSITION_UNCLIPPED_IBM:
- if (ctx->Extensions.IBM_rasterpos_clip) {
- *params = (GLfloat) ctx->Transform.RasterPositionUnclipped;
- }
- else {
- GET_FLOAT_ERROR;
- return;
- }
+ CHECK_EXTENSION_F(IBM_rasterpos_clip, pname);
+ *params = (GLfloat) ctx->Transform.RasterPositionUnclipped;
break;
- /* GL_MESA_sprite_point */
- case GL_SPRITE_POINT_MESA:
- if (ctx->Extensions.MESA_sprite_point) {
- *params = (GLfloat) ctx->Point.SpriteMode;
- }
- else {
- GET_FLOAT_ERROR;
- return;
- }
+ /* GL_NV_point_sprite */
+ case GL_POINT_SPRITE_NV:
+ CHECK_EXTENSION_B(NV_point_sprite, pname);
+ *params = (GLfloat) ctx->Point.PointSprite;
+ break;
+ case GL_POINT_SPRITE_R_MODE_NV:
+ CHECK_EXTENSION_B(NV_point_sprite, pname);
+ *params = (GLfloat) ctx->Point.SpriteRMode;
break;
/* GL_SGIS_generate_mipmap */
case GL_GENERATE_MIPMAP_HINT_SGIS:
- if (ctx->Extensions.SGIS_generate_mipmap) {
- *params = (GLfloat) ctx->Hint.GenerateMipmap;
- }
- else {
- GET_FLOAT_ERROR;
- return;
+ CHECK_EXTENSION_F(SGIS_generate_mipmap, pname);
+ *params = (GLfloat) ctx->Hint.GenerateMipmap;
+ break;
+
+#if FEATURE_NV_vertex_program
+ case GL_VERTEX_PROGRAM_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ *params = (GLfloat) ctx->VertexProgram.Enabled;
+ break;
+ case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ *params = (GLfloat) ctx->VertexProgram.PointSizeEnabled;
+ break;
+ case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ *params = (GLfloat) ctx->VertexProgram.TwoSideEnabled;
+ break;
+ case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ *params = (GLfloat) MAX_PROGRAM_STACK_DEPTH;
+ break;
+ case GL_MAX_TRACK_MATRICES_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ *params = (GLfloat) MAX_PROGRAM_MATRICES;
+ break;
+ case GL_CURRENT_MATRIX_STACK_DEPTH_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ *params = (GLfloat) ctx->CurrentStack->Depth;
+ break;
+ case GL_CURRENT_MATRIX_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ *params = (GLfloat) ctx->Transform.MatrixMode;
+ break;
+ case GL_VERTEX_PROGRAM_BINDING_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ *params = (GLfloat) ctx->VertexProgram.CurrentID;
+ break;
+ case GL_PROGRAM_ERROR_POSITION_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ *params = (GLfloat) ctx->VertexProgram.ErrorPos;
+ break;
+ case GL_VERTEX_ATTRIB_ARRAY0_NV:
+ case GL_VERTEX_ATTRIB_ARRAY1_NV:
+ case GL_VERTEX_ATTRIB_ARRAY2_NV:
+ case GL_VERTEX_ATTRIB_ARRAY3_NV:
+ case GL_VERTEX_ATTRIB_ARRAY4_NV:
+ case GL_VERTEX_ATTRIB_ARRAY5_NV:
+ case GL_VERTEX_ATTRIB_ARRAY6_NV:
+ case GL_VERTEX_ATTRIB_ARRAY7_NV:
+ case GL_VERTEX_ATTRIB_ARRAY8_NV:
+ case GL_VERTEX_ATTRIB_ARRAY9_NV:
+ case GL_VERTEX_ATTRIB_ARRAY10_NV:
+ case GL_VERTEX_ATTRIB_ARRAY11_NV:
+ case GL_VERTEX_ATTRIB_ARRAY12_NV:
+ case GL_VERTEX_ATTRIB_ARRAY13_NV:
+ case GL_VERTEX_ATTRIB_ARRAY14_NV:
+ case GL_VERTEX_ATTRIB_ARRAY15_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_VERTEX_ATTRIB_ARRAY0_NV;
+ *params = (GLfloat) ctx->Array.VertexAttrib[n].Enabled;
+ }
+ break;
+ case GL_MAP1_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_MAP1_VERTEX_ATTRIB0_4_NV;
+ *params = (GLfloat) ctx->Eval.Map1Attrib[n];
+ }
+ break;
+ case GL_MAP2_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_MAP2_VERTEX_ATTRIB0_4_NV;
+ *params = (GLfloat) ctx->Eval.Map2Attrib[n];
}
break;
@@ -4031,9 +4166,20 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
CHECK_EXTENSION_F(NV_texture_rectangle, pname);
*params = (GLfloat) ctx->Const.MaxTextureRectSize;
break;
+#endif /* FEATURE_NV_vertex_program */
+
+ /* GL_EXT_stencil_two_side */
+ case GL_STENCIL_TEST_TWO_SIDE_EXT:
+ CHECK_EXTENSION_F(EXT_stencil_two_side, pname);
+ *params = (GLfloat) ctx->Stencil.TestTwoSide;
+ break;
+ case GL_ACTIVE_STENCIL_FACE_EXT:
+ CHECK_EXTENSION_F(EXT_stencil_two_side, pname);
+ *params = (GLfloat) (ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
+ break;
- default:
- GET_FLOAT_ERROR;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv(0x%x)", pname);
}
}
@@ -4056,7 +4202,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
FLUSH_VERTICES(ctx, 0);
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glGetIntegerv %s\n", _mesa_lookup_enum_by_nr(pname));
+ _mesa_debug(ctx, "glGetIntegerv %s\n", _mesa_lookup_enum_by_nr(pname));
if (ctx->Driver.GetIntegerv
&& (*ctx->Driver.GetIntegerv)(ctx, pname, params))
@@ -4094,7 +4240,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*params = (GLint) ctx->Color.AlphaEnabled;
break;
case GL_ALPHA_TEST_REF:
- *params = FLOAT_TO_INT( (GLfloat) ctx->Color.AlphaRef / CHAN_MAXF );
+ *params = FLOAT_TO_INT(ctx->Color.AlphaRef);
break;
case GL_ALPHA_TEST_FUNC:
*params = (GLint) ctx->Color.AlphaFunc;
@@ -4156,8 +4302,10 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
case GL_CLIP_PLANE3:
case GL_CLIP_PLANE4:
case GL_CLIP_PLANE5:
- i = (GLint) (pname - GL_CLIP_PLANE0);
- *params = (GLint) ctx->Transform.ClipEnabled[i];
+ if (ctx->Transform.ClipPlanesEnabled & (1 << (pname - GL_CLIP_PLANE0)))
+ *params = 1;
+ else
+ *params = 0;
break;
case GL_COLOR_CLEAR_VALUE:
params[0] = FLOAT_TO_INT( (ctx->Color.ClearColor[0]) );
@@ -4188,10 +4336,10 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
break;
case GL_CURRENT_COLOR:
FLUSH_CURRENT(ctx, 0);
- params[0] = FLOAT_TO_INT( ( ctx->Current.Color[0] ) );
- params[1] = FLOAT_TO_INT( ( ctx->Current.Color[1] ) );
- params[2] = FLOAT_TO_INT( ( ctx->Current.Color[2] ) );
- params[3] = FLOAT_TO_INT( ( ctx->Current.Color[3] ) );
+ params[0] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]);
+ params[1] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]);
+ params[2] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]);
+ params[3] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]);
break;
case GL_CURRENT_INDEX:
FLUSH_CURRENT(ctx, 0);
@@ -4199,9 +4347,9 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
break;
case GL_CURRENT_NORMAL:
FLUSH_CURRENT(ctx, 0);
- params[0] = FLOAT_TO_INT( ctx->Current.Normal[0] );
- params[1] = FLOAT_TO_INT( ctx->Current.Normal[1] );
- params[2] = FLOAT_TO_INT( ctx->Current.Normal[2] );
+ params[0] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]);
+ params[1] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]);
+ params[2] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]);
break;
case GL_CURRENT_RASTER_COLOR:
params[0] = FLOAT_TO_INT( ctx->Current.RasterColor[0] );
@@ -4222,20 +4370,20 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
params[3] = (GLint) ctx->Current.RasterPos[3];
break;
case GL_CURRENT_RASTER_TEXTURE_COORDS:
- params[0] = (GLint) ctx->Current.RasterMultiTexCoord[texUnit][0];
- params[1] = (GLint) ctx->Current.RasterMultiTexCoord[texUnit][1];
- params[2] = (GLint) ctx->Current.RasterMultiTexCoord[texUnit][2];
- params[3] = (GLint) ctx->Current.RasterMultiTexCoord[texUnit][3];
+ params[0] = (GLint) ctx->Current.RasterTexCoords[texUnit][0];
+ params[1] = (GLint) ctx->Current.RasterTexCoords[texUnit][1];
+ params[2] = (GLint) ctx->Current.RasterTexCoords[texUnit][2];
+ params[3] = (GLint) ctx->Current.RasterTexCoords[texUnit][3];
break;
case GL_CURRENT_RASTER_POSITION_VALID:
*params = (GLint) ctx->Current.RasterPosValid;
break;
case GL_CURRENT_TEXTURE_COORDS:
FLUSH_CURRENT(ctx, 0);
- params[0] = (GLint) ctx->Current.Texcoord[texUnit][0];
- params[1] = (GLint) ctx->Current.Texcoord[texUnit][1];
- params[2] = (GLint) ctx->Current.Texcoord[texUnit][2];
- params[3] = (GLint) ctx->Current.Texcoord[texUnit][3];
+ params[0] = (GLint) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0];
+ params[1] = (GLint) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1];
+ params[2] = (GLint) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2];
+ params[3] = (GLint) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3];
break;
case GL_DEPTH_BIAS:
*params = (GLint) ctx->Pixel.DepthBias;
@@ -4320,15 +4468,6 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
case GL_GREEN_SCALE:
*params = (GLint) ctx->Pixel.GreenScale;
break;
- case GL_HISTOGRAM:
- if (ctx->Extensions.EXT_histogram || ctx->Extensions.ARB_imaging) {
- *params = (GLint) ctx->Pixel.HistogramEnabled;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
- return;
- }
- break;
case GL_INDEX_BITS:
*params = (GLint) ctx->Visual.indexBits;
break;
@@ -4552,16 +4691,13 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
params[0] = (GLint) MAX_WIDTH;
params[1] = (GLint) MAX_HEIGHT;
break;
- case GL_MINMAX:
- *params = (GLint) ctx->Pixel.MinMaxEnabled;
- break;
case GL_MODELVIEW_MATRIX:
for (i=0;i<16;i++) {
- params[i] = (GLint) ctx->ModelView.m[i];
+ params[i] = (GLint) ctx->ModelviewMatrixStack.Top->m[i];
}
break;
case GL_MODELVIEW_STACK_DEPTH:
- *params = (GLint) (ctx->ModelViewStackDepth + 1);
+ *params = (GLint) (ctx->ModelviewMatrixStack.Depth + 1);
break;
case GL_NAME_STACK_DEPTH:
*params = (GLint) ctx->Select.NameStackDepth;
@@ -4593,6 +4729,9 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
case GL_PACK_IMAGE_HEIGHT_EXT:
*params = ctx->Pack.ImageHeight;
break;
+ case GL_PACK_INVERT_MESA:
+ *params = ctx->Pack.Invert;
+ break;
case GL_PERSPECTIVE_CORRECTION_HINT:
*params = (GLint) ctx->Hint.PerspectiveCorrection;
break;
@@ -4684,11 +4823,11 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
break;
case GL_PROJECTION_MATRIX:
for (i=0;i<16;i++) {
- params[i] = (GLint) ctx->ProjectionMatrix.m[i];
+ params[i] = (GLint) ctx->ProjectionMatrixStack.Top->m[i];
}
break;
case GL_PROJECTION_STACK_DEPTH:
- *params = (GLint) (ctx->ProjectionStackDepth + 1);
+ *params = (GLint) (ctx->ProjectionMatrixStack.Depth + 1);
break;
case GL_READ_BUFFER:
*params = (GLint) ctx->Pixel.ReadBuffer;
@@ -4736,28 +4875,28 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*params = (GLint) ctx->Stencil.Clear;
break;
case GL_STENCIL_FAIL:
- *params = (GLint) ctx->Stencil.FailFunc;
+ *params = (GLint) ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_FUNC:
- *params = (GLint) ctx->Stencil.Function;
+ *params = (GLint) ctx->Stencil.Function[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_PASS_DEPTH_FAIL:
- *params = (GLint) ctx->Stencil.ZFailFunc;
+ *params = (GLint) ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_PASS_DEPTH_PASS:
- *params = (GLint) ctx->Stencil.ZPassFunc;
+ *params = (GLint) ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_REF:
- *params = (GLint) ctx->Stencil.Ref;
+ *params = (GLint) ctx->Stencil.Ref[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_TEST:
*params = (GLint) ctx->Stencil.Enabled;
break;
case GL_STENCIL_VALUE_MASK:
- *params = (GLint) ctx->Stencil.ValueMask;
+ *params = (GLint) ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_WRITEMASK:
- *params = (GLint) ctx->Stencil.WriteMask;
+ *params = (GLint) ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace];
break;
case GL_STEREO:
*params = (GLint) ctx->Visual.stereoMode;
@@ -4806,11 +4945,11 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
break;
case GL_TEXTURE_MATRIX:
for (i=0;i<16;i++) {
- params[i] = (GLint) ctx->TextureMatrix[texUnit].m[i];
+ params[i] = (GLint) ctx->TextureMatrixStack[texUnit].Top->m[i];
}
break;
case GL_TEXTURE_STACK_DEPTH:
- *params = (GLint) (ctx->TextureStackDepth[texUnit] + 1);
+ *params = (GLint) (ctx->TextureMatrixStack[texUnit].Depth + 1);
break;
case GL_UNPACK_ALIGNMENT:
*params = ctx->Unpack.Alignment;
@@ -4836,6 +4975,9 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
case GL_UNPACK_IMAGE_HEIGHT_EXT:
*params = ctx->Unpack.ImageHeight;
break;
+ case GL_UNPACK_CLIENT_STORAGE_APPLE:
+ *params = ctx->Unpack.ClientStorage;
+ break;
case GL_VIEWPORT:
params[0] = (GLint) ctx->Viewport.X;
params[1] = (GLint) ctx->Viewport.Y;
@@ -4929,65 +5071,53 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
/* GL_ARB_multitexture */
case GL_MAX_TEXTURE_UNITS_ARB:
+ CHECK_EXTENSION_I(ARB_multitexture, pname);
*params = ctx->Const.MaxTextureUnits;
break;
case GL_ACTIVE_TEXTURE_ARB:
+ CHECK_EXTENSION_I(ARB_multitexture, pname);
*params = GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit;
break;
case GL_CLIENT_ACTIVE_TEXTURE_ARB:
+ CHECK_EXTENSION_I(ARB_multitexture, pname);
*params = GL_TEXTURE0_ARB + ctx->Array.ActiveTexture;
break;
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = (GLint) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
- else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
+ CHECK_EXTENSION_I(ARB_texture_cube_map, pname);
+ *params = (GLint) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
+ break;
case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = textureUnit->CurrentCubeMap->Name;
- else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
+ CHECK_EXTENSION_I(ARB_texture_cube_map, pname);
+ *params = textureUnit->CurrentCubeMap->Name;
+ break;
case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = (1 << (ctx->Const.MaxCubeTextureLevels - 1));
- else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
+ CHECK_EXTENSION_I(ARB_texture_cube_map, pname);
+ *params = (1 << (ctx->Const.MaxCubeTextureLevels - 1));
+ break;
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSION_HINT_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- *params = (GLint) ctx->Hint.TextureCompression;
- }
- else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+ CHECK_EXTENSION_I(ARB_texture_compression, pname);
+ *params = (GLint) ctx->Hint.TextureCompression;
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- *params = (GLint) ctx->Const.NumCompressedTextureFormats;
- }
- else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+ CHECK_EXTENSION_I(ARB_texture_compression, pname);
+ *params = (GLint) _mesa_get_compressed_formats(ctx, NULL);
break;
case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- GLuint i;
- for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
- params[i] = (GLint) ctx->Const.CompressedTextureFormats[i];
- }
- else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+ CHECK_EXTENSION_I(ARB_texture_compression, pname);
+ (void) _mesa_get_compressed_formats(ctx, params);
break;
/* GL_EXT_compiled_vertex_array */
case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
+ CHECK_EXTENSION_I(EXT_compiled_vertex_array, pname);
*params = ctx->Array.LockFirst;
break;
case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
+ CHECK_EXTENSION_I(EXT_compiled_vertex_array, pname);
*params = ctx->Array.LockCount;
break;
@@ -4996,7 +5126,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->ColorMatrix.m);
+ _math_transposef(tm, ctx->ColorMatrixStack.Top->m);
for (i=0;i<16;i++) {
params[i] = (GLint) tm[i];
}
@@ -5006,7 +5136,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->ModelView.m);
+ _math_transposef(tm, ctx->ModelviewMatrixStack.Top->m);
for (i=0;i<16;i++) {
params[i] = (GLint) tm[i];
}
@@ -5016,7 +5146,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->ProjectionMatrix.m);
+ _math_transposef(tm, ctx->ProjectionMatrixStack.Top->m);
for (i=0;i<16;i++) {
params[i] = (GLint) tm[i];
}
@@ -5026,7 +5156,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->TextureMatrix[texUnit].m);
+ _math_transposef(tm, ctx->TextureMatrixStack[texUnit].Top->m);
for (i=0;i<16;i++) {
params[i] = (GLint) tm[i];
}
@@ -5035,199 +5165,201 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
/* GL_HP_occlusion_test */
case GL_OCCLUSION_TEST_HP:
- if (ctx->Extensions.HP_occlusion_test) {
- *params = (GLint) ctx->Depth.OcclusionTest;
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
- }
- return;
+ CHECK_EXTENSION_I(HP_occlusion_test, pname);
+ *params = (GLint) ctx->Depth.OcclusionTest;
+ break;
case GL_OCCLUSION_TEST_RESULT_HP:
- if (ctx->Extensions.HP_occlusion_test) {
- if (ctx->Depth.OcclusionTest)
- *params = (GLint) ctx->OcclusionResult;
- else
- *params = (GLint) ctx->OcclusionResultSaved;
- /* reset flag now */
- ctx->OcclusionResult = GL_FALSE;
- ctx->OcclusionResultSaved = GL_FALSE;
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
- }
- return;
+ CHECK_EXTENSION_I(HP_occlusion_test, pname);
+ if (ctx->Depth.OcclusionTest)
+ *params = (GLint) ctx->OcclusionResult;
+ else
+ *params = (GLint) ctx->OcclusionResultSaved;
+ /* reset flag now */
+ ctx->OcclusionResult = GL_FALSE;
+ ctx->OcclusionResultSaved = GL_FALSE;
+ break;
/* GL_SGIS_pixel_texture */
case GL_PIXEL_TEXTURE_SGIS:
+ CHECK_EXTENSION_I(SGIS_pixel_texture, pname);
*params = (GLint) ctx->Pixel.PixelTextureEnabled;
break;
/* GL_SGIX_pixel_texture */
case GL_PIXEL_TEX_GEN_SGIX:
+ CHECK_EXTENSION_I(SGIX_pixel_texture, pname);
*params = (GLint) ctx->Pixel.PixelTextureEnabled;
break;
case GL_PIXEL_TEX_GEN_MODE_SGIX:
+ CHECK_EXTENSION_I(SGIX_pixel_texture, pname);
*params = (GLint) pixel_texgen_mode(ctx);
break;
/* GL_SGI_color_matrix (also in 1.2 imaging) */
case GL_COLOR_MATRIX_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
for (i=0;i<16;i++) {
- params[i] = (GLint) ctx->ColorMatrix.m[i];
+ params[i] = (GLint) ctx->ColorMatrixStack.Top->m[i];
}
break;
case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
- *params = ctx->ColorStackDepth + 1;
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
+ *params = ctx->ColorMatrixStack.Depth + 1;
break;
case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
*params = MAX_COLOR_STACK_DEPTH;
break;
case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
*params = (GLint) ctx->Pixel.PostColorMatrixScale[0];
break;
case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
*params = (GLint) ctx->Pixel.PostColorMatrixScale[1];
break;
case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
*params = (GLint) ctx->Pixel.PostColorMatrixScale[2];
break;
case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
*params = (GLint) ctx->Pixel.PostColorMatrixScale[3];
break;
case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
*params = (GLint) ctx->Pixel.PostColorMatrixBias[0];
break;
case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
*params = (GLint) ctx->Pixel.PostColorMatrixBias[1];
break;
case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
*params = (GLint) ctx->Pixel.PostColorMatrixBias[2];
break;
case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
*params = (GLint) ctx->Pixel.PostColorMatrixBias[3];
break;
/* GL_EXT_convolution (also in 1.2 imaging) */
case GL_CONVOLUTION_1D_EXT:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = (GLint) ctx->Pixel.Convolution1DEnabled;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
- }
+ CHECK_EXTENSION_I(EXT_convolution, pname);
+ *params = (GLint) ctx->Pixel.Convolution1DEnabled;
break;
case GL_CONVOLUTION_2D:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = (GLint) ctx->Pixel.Convolution2DEnabled;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
- }
+ CHECK_EXTENSION_I(EXT_convolution, pname);
+ *params = (GLint) ctx->Pixel.Convolution2DEnabled;
break;
case GL_SEPARABLE_2D:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = (GLint) ctx->Pixel.Separable2DEnabled;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
- }
+ CHECK_EXTENSION_I(EXT_convolution, pname);
+ *params = (GLint) ctx->Pixel.Separable2DEnabled;
break;
case GL_POST_CONVOLUTION_RED_SCALE_EXT:
+ CHECK_EXTENSION_I(EXT_convolution, pname);
*params = (GLint) ctx->Pixel.PostConvolutionScale[0];
break;
case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
+ CHECK_EXTENSION_I(EXT_convolution, pname);
*params = (GLint) ctx->Pixel.PostConvolutionScale[1];
break;
case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
+ CHECK_EXTENSION_I(EXT_convolution, pname);
*params = (GLint) ctx->Pixel.PostConvolutionScale[2];
break;
case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
+ CHECK_EXTENSION_I(EXT_convolution, pname);
*params = (GLint) ctx->Pixel.PostConvolutionScale[3];
break;
case GL_POST_CONVOLUTION_RED_BIAS_EXT:
+ CHECK_EXTENSION_I(EXT_convolution, pname);
*params = (GLint) ctx->Pixel.PostConvolutionBias[0];
break;
case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
+ CHECK_EXTENSION_I(EXT_convolution, pname);
*params = (GLint) ctx->Pixel.PostConvolutionBias[1];
break;
case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
+ CHECK_EXTENSION_I(EXT_convolution, pname);
*params = (GLint) ctx->Pixel.PostConvolutionBias[2];
break;
case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
+ CHECK_EXTENSION_I(EXT_convolution, pname);
*params = (GLint) ctx->Pixel.PostConvolutionBias[2];
break;
+ /* GL_EXT_histogram (also in 1.2 imaging) */
+ case GL_HISTOGRAM:
+ CHECK_EXTENSION_I(EXT_histogram, pname);
+ *params = (GLint) ctx->Pixel.HistogramEnabled;
+ break;
+ case GL_MINMAX:
+ CHECK_EXTENSION_I(EXT_histogram, pname);
+ *params = (GLint) ctx->Pixel.MinMaxEnabled;
+ break;
+
/* GL_SGI_color_table (also in 1.2 imaging */
case GL_COLOR_TABLE_SGI:
+ CHECK_EXTENSION_I(SGI_color_table, pname);
*params = (GLint) ctx->Pixel.ColorTableEnabled;
break;
case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
+ CHECK_EXTENSION_I(SGI_color_table, pname);
*params = (GLint) ctx->Pixel.PostConvolutionColorTableEnabled;
break;
case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
+ CHECK_EXTENSION_I(SGI_color_table, pname);
*params = (GLint) ctx->Pixel.PostColorMatrixColorTableEnabled;
break;
/* GL_EXT_secondary_color */
case GL_COLOR_SUM_EXT:
+ CHECK_EXTENSION_I(EXT_secondary_color, pname);
*params = (GLint) ctx->Fog.ColorSumEnabled;
break;
case GL_CURRENT_SECONDARY_COLOR_EXT:
+ CHECK_EXTENSION_I(EXT_secondary_color, pname);
FLUSH_CURRENT(ctx, 0);
- params[0] = FLOAT_TO_INT( (ctx->Current.SecondaryColor[0]) );
- params[1] = FLOAT_TO_INT( (ctx->Current.SecondaryColor[1]) );
- params[2] = FLOAT_TO_INT( (ctx->Current.SecondaryColor[2]) );
+ params[0] = FLOAT_TO_INT( (ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]) );
+ params[1] = FLOAT_TO_INT( (ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]) );
+ params[2] = FLOAT_TO_INT( (ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]) );
break;
case GL_SECONDARY_COLOR_ARRAY_EXT:
+ CHECK_EXTENSION_I(EXT_secondary_color, pname);
*params = (GLint) ctx->Array.SecondaryColor.Enabled;
break;
case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_I(EXT_secondary_color, pname);
*params = (GLint) ctx->Array.SecondaryColor.Type;
break;
case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_I(EXT_secondary_color, pname);
*params = (GLint) ctx->Array.SecondaryColor.Stride;
break;
case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
+ CHECK_EXTENSION_I(EXT_secondary_color, pname);
*params = (GLint) ctx->Array.SecondaryColor.Stride;
break;
/* GL_EXT_fog_coord */
case GL_CURRENT_FOG_COORDINATE_EXT:
- if (ctx->Extensions.EXT_fog_coord) {
- FLUSH_CURRENT(ctx, 0);
- *params = (GLint) ctx->Current.FogCoord;
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
- }
+ CHECK_EXTENSION_I(EXT_fog_coord, pname);
+ FLUSH_CURRENT(ctx, 0);
+ *params = (GLint) ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
break;
case GL_FOG_COORDINATE_ARRAY_EXT:
- if (ctx->Extensions.EXT_fog_coord) {
- *params = (GLint) ctx->Array.FogCoord.Enabled;
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
- }
+ CHECK_EXTENSION_I(EXT_fog_coord, pname);
+ *params = (GLint) ctx->Array.FogCoord.Enabled;
break;
case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
- if (ctx->Extensions.EXT_fog_coord) {
- *params = (GLint) ctx->Array.FogCoord.Type;
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
- }
+ CHECK_EXTENSION_I(EXT_fog_coord, pname);
+ *params = (GLint) ctx->Array.FogCoord.Type;
break;
case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
- if (ctx->Extensions.EXT_fog_coord) {
- *params = (GLint) ctx->Array.FogCoord.Stride;
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
- }
+ CHECK_EXTENSION_I(EXT_fog_coord, pname);
+ *params = (GLint) ctx->Array.FogCoord.Stride;
break;
/* GL_EXT_texture_lod_bias */
@@ -5237,119 +5369,167 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
/* GL_EXT_texture_filter_anisotropic */
case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
- if (ctx->Extensions.EXT_texture_filter_anisotropic) {
- *params = (GLint) ctx->Const.MaxTextureMaxAnisotropy;
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
- return;
- }
+ CHECK_EXTENSION_I(EXT_texture_filter_anisotropic, pname);
+ *params = (GLint) ctx->Const.MaxTextureMaxAnisotropy;
break;
/* GL_ARB_multisample */
case GL_MULTISAMPLE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = (GLint) ctx->Multisample.Enabled;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
- }
+ CHECK_EXTENSION_I(ARB_multisample, pname);
+ *params = (GLint) ctx->Multisample.Enabled;
break;
case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = (GLint) ctx->Multisample.SampleAlphaToCoverage;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
- }
+ CHECK_EXTENSION_I(ARB_multisample, pname);
+ *params = (GLint) ctx->Multisample.SampleAlphaToCoverage;
break;
case GL_SAMPLE_ALPHA_TO_ONE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = (GLint) ctx->Multisample.SampleAlphaToOne;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
- }
+ CHECK_EXTENSION_I(ARB_multisample, pname);
+ *params = (GLint) ctx->Multisample.SampleAlphaToOne;
break;
case GL_SAMPLE_COVERAGE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = (GLint) ctx->Multisample.SampleCoverage;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
- }
+ CHECK_EXTENSION_I(ARB_multisample, pname);
+ *params = (GLint) ctx->Multisample.SampleCoverage;
break;
case GL_SAMPLE_COVERAGE_VALUE_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = (GLint) ctx->Multisample.SampleCoverageValue;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
- }
+ CHECK_EXTENSION_I(ARB_multisample, pname);
+ *params = (GLint) ctx->Multisample.SampleCoverageValue;
break;
case GL_SAMPLE_COVERAGE_INVERT_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = (GLint) ctx->Multisample.SampleCoverageInvert;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
- }
+ CHECK_EXTENSION_I(ARB_multisample, pname);
+ *params = (GLint) ctx->Multisample.SampleCoverageInvert;
break;
case GL_SAMPLE_BUFFERS_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = 0; /* XXX fix someday */
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
- }
+ CHECK_EXTENSION_I(ARB_multisample, pname);
+ *params = 0; /* XXX fix someday */
break;
case GL_SAMPLES_ARB:
- if (ctx->Extensions.ARB_multisample) {
- *params = 0; /* XXX fix someday */
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
- }
+ CHECK_EXTENSION_I(ARB_multisample, pname);
+ *params = 0; /* XXX fix someday */
break;
/* GL_IBM_rasterpos_clip */
case GL_RASTER_POSITION_UNCLIPPED_IBM:
- if (ctx->Extensions.IBM_rasterpos_clip) {
- *params = (GLint) ctx->Transform.RasterPositionUnclipped;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
- }
+ CHECK_EXTENSION_I(IBM_rasterpos_clip, pname);
+ *params = (GLint) ctx->Transform.RasterPositionUnclipped;
break;
- /* GL_MESA_sprite_point */
- case GL_SPRITE_POINT_MESA:
- if (ctx->Extensions.MESA_sprite_point) {
- *params = (GLint) ctx->Point.SpriteMode;
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
- return;
- }
+ /* GL_NV_point_sprite */
+ case GL_POINT_SPRITE_NV:
+ CHECK_EXTENSION_B(NV_point_sprite, pname);
+ *params = (GLint) ctx->Point.PointSprite;
+ break;
+ case GL_POINT_SPRITE_R_MODE_NV:
+ CHECK_EXTENSION_B(NV_point_sprite, pname);
+ *params = (GLint) ctx->Point.SpriteRMode;
break;
/* GL_SGIS_generate_mipmap */
case GL_GENERATE_MIPMAP_HINT_SGIS:
- if (ctx->Extensions.SGIS_generate_mipmap) {
- *params = (GLint) ctx->Hint.GenerateMipmap;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
+ CHECK_EXTENSION_I(SGIS_generate_mipmap, pname);
+ *params = (GLint) ctx->Hint.GenerateMipmap;
+ break;
+
+#if FEATURE_NV_vertex_program
+ case GL_VERTEX_PROGRAM_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ *params = (GLint) ctx->VertexProgram.Enabled;
+ break;
+ case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ *params = (GLint) ctx->VertexProgram.PointSizeEnabled;
+ break;
+ case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ *params = (GLint) ctx->VertexProgram.TwoSideEnabled;
+ break;
+ case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ *params = MAX_PROGRAM_STACK_DEPTH;
+ break;
+ case GL_MAX_TRACK_MATRICES_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ *params = MAX_PROGRAM_MATRICES;
+ break;
+ case GL_CURRENT_MATRIX_STACK_DEPTH_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ *params = ctx->CurrentStack->Depth;
+ break;
+ case GL_CURRENT_MATRIX_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ *params = (GLint) ctx->Transform.MatrixMode;
+ break;
+ case GL_VERTEX_PROGRAM_BINDING_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ *params = (GLint) ctx->VertexProgram.CurrentID;
+ break;
+ case GL_PROGRAM_ERROR_POSITION_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ *params = (GLint) ctx->VertexProgram.ErrorPos;
+ break;
+ case GL_VERTEX_ATTRIB_ARRAY0_NV:
+ case GL_VERTEX_ATTRIB_ARRAY1_NV:
+ case GL_VERTEX_ATTRIB_ARRAY2_NV:
+ case GL_VERTEX_ATTRIB_ARRAY3_NV:
+ case GL_VERTEX_ATTRIB_ARRAY4_NV:
+ case GL_VERTEX_ATTRIB_ARRAY5_NV:
+ case GL_VERTEX_ATTRIB_ARRAY6_NV:
+ case GL_VERTEX_ATTRIB_ARRAY7_NV:
+ case GL_VERTEX_ATTRIB_ARRAY8_NV:
+ case GL_VERTEX_ATTRIB_ARRAY9_NV:
+ case GL_VERTEX_ATTRIB_ARRAY10_NV:
+ case GL_VERTEX_ATTRIB_ARRAY11_NV:
+ case GL_VERTEX_ATTRIB_ARRAY12_NV:
+ case GL_VERTEX_ATTRIB_ARRAY13_NV:
+ case GL_VERTEX_ATTRIB_ARRAY14_NV:
+ case GL_VERTEX_ATTRIB_ARRAY15_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_VERTEX_ATTRIB_ARRAY0_NV;
+ *params = (GLint) ctx->Array.VertexAttrib[n].Enabled;
+ }
+ break;
+ case GL_MAP1_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_MAP1_VERTEX_ATTRIB0_4_NV;
+ *params = (GLint) ctx->Eval.Map1Attrib[n];
+ }
+ break;
+ case GL_MAP2_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_MAP2_VERTEX_ATTRIB0_4_NV;
+ *params = (GLint) ctx->Eval.Map2Attrib[n];
}
break;
@@ -5366,9 +5546,20 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
CHECK_EXTENSION_I(NV_texture_rectangle, pname);
*params = (GLint) ctx->Const.MaxTextureRectSize;
break;
+#endif /* FEATURE_NV_vertex_program */
+
+ /* GL_EXT_stencil_two_side */
+ case GL_STENCIL_TEST_TWO_SIDE_EXT:
+ CHECK_EXTENSION_I(EXT_stencil_two_side, pname);
+ *params = (GLint) ctx->Stencil.TestTwoSide;
+ break;
+ case GL_ACTIVE_STENCIL_FACE_EXT:
+ CHECK_EXTENSION_I(EXT_stencil_two_side, pname);
+ *params = (GLint) (ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
+ break;
default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv(pname=0x%x)", pname);
}
}
@@ -5385,7 +5576,7 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params )
return;
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glGetPointerv %s\n", _mesa_lookup_enum_by_nr(pname));
+ _mesa_debug(ctx, "glGetPointerv %s\n", _mesa_lookup_enum_by_nr(pname));
if (ctx->Driver.GetPointerv
&& (*ctx->Driver.GetPointerv)(ctx, pname, params))
@@ -5436,8 +5627,9 @@ _mesa_GetString( GLenum name )
GET_CURRENT_CONTEXT(ctx);
static const char *vendor = "Brian Paul";
static const char *renderer = "Mesa";
- static const char *version_1_2 = "1.2 Mesa 4.0.4";
- static const char *version_1_3 = "1.3 Mesa 4.0.4";
+ static const char *version_1_2 = "1.2 Mesa 5.0";
+ static const char *version_1_3 = "1.3 Mesa 5.0";
+ static const char *version_1_4 = "1.4 Mesa 5.0";
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
@@ -5448,29 +5640,51 @@ _mesa_GetString( GLenum name )
if (str)
return str;
- switch (name) {
- case GL_VENDOR:
- return (const GLubyte *) vendor;
- case GL_RENDERER:
- return (const GLubyte *) renderer;
- case GL_VERSION:
- if (ctx->Extensions.ARB_multitexture &&
- ctx->Extensions.ARB_multisample &&
- ctx->Extensions.ARB_texture_border_clamp &&
- ctx->Extensions.ARB_texture_compression &&
- ctx->Extensions.ARB_texture_cube_map &&
- ctx->Extensions.EXT_texture_env_add &&
- ctx->Extensions.ARB_texture_env_combine &&
- ctx->Extensions.ARB_texture_env_dot3)
- return (const GLubyte *) version_1_3;
- else
- return (const GLubyte *) version_1_2;
- case GL_EXTENSIONS:
- return (const GLubyte *) _mesa_extensions_get_string(ctx);
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" );
- return (const GLubyte *) 0;
- }
+ switch (name) {
+ case GL_VENDOR:
+ return (const GLubyte *) vendor;
+ case GL_RENDERER:
+ return (const GLubyte *) renderer;
+ case GL_VERSION:
+ if (ctx->Extensions.ARB_multisample &&
+ ctx->Extensions.ARB_multitexture &&
+ ctx->Extensions.ARB_texture_border_clamp &&
+ ctx->Extensions.ARB_texture_compression &&
+ ctx->Extensions.ARB_texture_cube_map &&
+ ctx->Extensions.EXT_texture_env_add &&
+ ctx->Extensions.ARB_texture_env_combine &&
+ ctx->Extensions.ARB_texture_env_dot3) {
+ if (ctx->Extensions.ARB_depth_texture &&
+ ctx->Extensions.ARB_shadow &&
+ ctx->Extensions.ARB_texture_env_crossbar &&
+ ctx->Extensions.ARB_texture_mirrored_repeat &&
+ ctx->Extensions.ARB_window_pos &&
+ ctx->Extensions.EXT_blend_color &&
+ ctx->Extensions.EXT_blend_func_separate &&
+ ctx->Extensions.EXT_blend_logic_op &&
+ ctx->Extensions.EXT_blend_minmax &&
+ ctx->Extensions.EXT_blend_subtract &&
+ ctx->Extensions.EXT_fog_coord &&
+ ctx->Extensions.EXT_multi_draw_arrays &&
+ ctx->Extensions.EXT_point_parameters && /*aka ARB*/
+ ctx->Extensions.EXT_secondary_color &&
+ ctx->Extensions.EXT_stencil_wrap &&
+ ctx->Extensions.SGIS_generate_mipmap) {
+ return (const GLubyte *) version_1_4;
+ }
+ else {
+ return (const GLubyte *) version_1_3;
+ }
+ }
+ else {
+ return (const GLubyte *) version_1_2;
+ }
+ case GL_EXTENSIONS:
+ return (const GLubyte *) _mesa_extensions_get_string(ctx);
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" );
+ return (const GLubyte *) 0;
+ }
}
}
@@ -5486,7 +5700,7 @@ _mesa_GetError( void )
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glGetError <-- %s\n", _mesa_lookup_enum_by_nr(e));
+ _mesa_debug(ctx, "glGetError <-- %s\n", _mesa_lookup_enum_by_nr(e));
ctx->ErrorValue = (GLenum) GL_NO_ERROR;
return e;
diff --git a/xc/extras/Mesa/src/glapi.c b/xc/extras/Mesa/src/glapi.c
index 550a57aa9..3cb4ccca3 100644
--- a/xc/extras/Mesa/src/glapi.c
+++ b/xc/extras/Mesa/src/glapi.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.1
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -36,11 +36,17 @@
* flexible enough to be reused in several places: XFree86, DRI-
* based libGL.so, and perhaps the SGI SI.
*
- * There are no dependencies on Mesa in this code.
+ * NOTE: There are no dependencies on Mesa in this code.
*
* Versions (API changes):
* 2000/02/23 - original version for Mesa 3.3 and XFree86 4.0
* 2001/01/16 - added dispatch override feature for Mesa 3.5
+ * 2002/06/28 - added _glapi_set_warning_func(), Mesa 4.1.
+ * 2002/10/01 - _glapi_get_proc_address() will now generate new entrypoints
+ * itself (using offset ~0). _glapi_add_entrypoint() can be
+ * called afterward and it'll fill in the correct dispatch
+ * offset. This allows DRI libGL to avoid probing for DRI
+ * drivers! No changes to the public glapi interface.
*/
@@ -54,20 +60,37 @@
/***** BEGIN NO-OP DISPATCH *****/
static GLboolean WarnFlag = GL_FALSE;
+static _glapi_warning_func warning_func;
+
+/*
+ * Enable/disable printing of warning messages.
+ */
void
_glapi_noop_enable_warnings(GLboolean enable)
{
WarnFlag = enable;
}
+/*
+ * Register a callback function for reporting errors.
+ */
+void
+_glapi_set_warning_func( _glapi_warning_func func )
+{
+ warning_func = func;
+}
+
static GLboolean
warn(void)
{
- if (WarnFlag || getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG"))
+ if ((WarnFlag || getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG"))
+ && warning_func) {
return GL_TRUE;
- else
+ }
+ else {
return GL_FALSE;
+ }
}
@@ -75,21 +98,19 @@ warn(void)
#define KEYWORD2
#define NAME(func) NoOp##func
-#define F stderr
+#define F NULL
-#define DISPATCH(func, args, msg) \
- if (warn()) { \
- fprintf(stderr, "GL User Error: calling "); \
- fprintf msg; \
- fprintf(stderr, " without a current context\n"); \
+#define DISPATCH(func, args, msg) \
+ if (warn()) { \
+ warning_func(NULL, "GL User Error: called without context:"); \
+ warning_func msg; \
}
-#define RETURN_DISPATCH(func, args, msg) \
- if (warn()) { \
- fprintf(stderr, "GL User Error: calling "); \
- fprintf msg; \
- fprintf(stderr, " without a current context\n"); \
- } \
+#define RETURN_DISPATCH(func, args, msg) \
+ if (warn()) { \
+ warning_func(NULL, "GL User Error: called without context:"); \
+ warning_func msg; \
+ } \
return 0
#define DISPATCH_TABLE_NAME __glapi_noop_table
@@ -100,7 +121,7 @@ warn(void)
static int NoOpUnused(void)
{
if (warn()) {
- fprintf(stderr, "GL User Error: calling extension function without a current context\n");
+ warning_func(NULL, "GL User Error: calling extension function without a current context\n");
}
return 0;
}
@@ -169,12 +190,10 @@ struct _glapi_table *_glapi_RealDispatch = (struct _glapi_table *) __glapi_noop_
void *_glapi_Context = NULL;
-static GLuint MaxDispatchOffset = sizeof(struct _glapi_table) / sizeof(void *) - 1;
-static GLboolean GetSizeCalled = GL_FALSE;
-
static GLboolean DispatchOverride = GL_FALSE;
+
/* strdup() is actually not a standard ANSI C or POSIX routine.
* Irix will not define it if ANSI mode is in effect.
*/
@@ -193,8 +212,7 @@ str_dup(const char *str)
/*
* We should call this periodically from a function such as glXMakeCurrent
- * in order to test if multiple threads are being used. When we detect
- * that situation we should then call _glapi_enable_thread_safety()
+ * in order to test if multiple threads are being used.
*/
void
_glapi_check_multithread(void)
@@ -421,42 +439,6 @@ _glapi_get_override_dispatch(int layer)
}
-
-/*
- * Return size of dispatch table struct as number of functions (or
- * slots).
- */
-GLuint
-_glapi_get_dispatch_table_size(void)
-{
- /* return sizeof(struct _glapi_table) / sizeof(void *);*/
- GetSizeCalled = GL_TRUE;
- return MaxDispatchOffset + 1;
-}
-
-
-
-/*
- * Get API dispatcher version string.
- */
-const char *
-_glapi_get_version(void)
-{
- return "20010116"; /* YYYYMMDD */
-}
-
-
-/*
- * For each entry in static_functions[] which use this function
- * we should implement a dispatch function in glapitemp.h and
- * in glapinoop.c
- */
-static int NotImplemented(void)
-{
- return 0;
-}
-
-
struct name_address_offset {
const char *Name;
GLvoid *Address;
@@ -464,1287 +446,8 @@ struct name_address_offset {
};
-static struct name_address_offset static_functions[] = {
- /* GL 1.1 */
- { "glNewList", (GLvoid *) glNewList, _gloffset_NewList },
- { "glEndList", (GLvoid *) glEndList, _gloffset_EndList },
- { "glCallList", (GLvoid *) glCallList, _gloffset_CallList },
- { "glCallLists", (GLvoid *) glCallLists, _gloffset_CallLists },
- { "glDeleteLists", (GLvoid *) glDeleteLists, _gloffset_DeleteLists },
- { "glGenLists", (GLvoid *) glGenLists, _gloffset_GenLists },
- { "glListBase", (GLvoid *) glListBase, _gloffset_ListBase },
- { "glBegin", (GLvoid *) glBegin, _gloffset_Begin },
- { "glBitmap", (GLvoid *) glBitmap, _gloffset_Bitmap },
- { "glColor3b", (GLvoid *) glColor3b, _gloffset_Color3b },
- { "glColor3bv", (GLvoid *) glColor3bv, _gloffset_Color3bv },
- { "glColor3d", (GLvoid *) glColor3d, _gloffset_Color3d },
- { "glColor3dv", (GLvoid *) glColor3dv, _gloffset_Color3dv },
- { "glColor3f", (GLvoid *) glColor3f, _gloffset_Color3f },
- { "glColor3fv", (GLvoid *) glColor3fv, _gloffset_Color3fv },
- { "glColor3i", (GLvoid *) glColor3i, _gloffset_Color3i },
- { "glColor3iv", (GLvoid *) glColor3iv, _gloffset_Color3iv },
- { "glColor3s", (GLvoid *) glColor3s, _gloffset_Color3s },
- { "glColor3sv", (GLvoid *) glColor3sv, _gloffset_Color3sv },
- { "glColor3ub", (GLvoid *) glColor3ub, _gloffset_Color3ub },
- { "glColor3ubv", (GLvoid *) glColor3ubv, _gloffset_Color3ubv },
- { "glColor3ui", (GLvoid *) glColor3ui, _gloffset_Color3ui },
- { "glColor3uiv", (GLvoid *) glColor3uiv, _gloffset_Color3uiv },
- { "glColor3us", (GLvoid *) glColor3us, _gloffset_Color3us },
- { "glColor3usv", (GLvoid *) glColor3usv, _gloffset_Color3usv },
- { "glColor4b", (GLvoid *) glColor4b, _gloffset_Color4b },
- { "glColor4bv", (GLvoid *) glColor4bv, _gloffset_Color4bv },
- { "glColor4d", (GLvoid *) glColor4d, _gloffset_Color4d },
- { "glColor4dv", (GLvoid *) glColor4dv, _gloffset_Color4dv },
- { "glColor4f", (GLvoid *) glColor4f, _gloffset_Color4f },
- { "glColor4fv", (GLvoid *) glColor4fv, _gloffset_Color4fv },
- { "glColor4i", (GLvoid *) glColor4i, _gloffset_Color4i },
- { "glColor4iv", (GLvoid *) glColor4iv, _gloffset_Color4iv },
- { "glColor4s", (GLvoid *) glColor4s, _gloffset_Color4s },
- { "glColor4sv", (GLvoid *) glColor4sv, _gloffset_Color4sv },
- { "glColor4ub", (GLvoid *) glColor4ub, _gloffset_Color4ub },
- { "glColor4ubv", (GLvoid *) glColor4ubv, _gloffset_Color4ubv },
- { "glColor4ui", (GLvoid *) glColor4ui, _gloffset_Color4ui },
- { "glColor4uiv", (GLvoid *) glColor4uiv, _gloffset_Color4uiv },
- { "glColor4us", (GLvoid *) glColor4us, _gloffset_Color4us },
- { "glColor4usv", (GLvoid *) glColor4usv, _gloffset_Color4usv },
- { "glEdgeFlag", (GLvoid *) glEdgeFlag, _gloffset_EdgeFlag },
- { "glEdgeFlagv", (GLvoid *) glEdgeFlagv, _gloffset_EdgeFlagv },
- { "glEnd", (GLvoid *) glEnd, _gloffset_End },
- { "glIndexd", (GLvoid *) glIndexd, _gloffset_Indexd },
- { "glIndexdv", (GLvoid *) glIndexdv, _gloffset_Indexdv },
- { "glIndexf", (GLvoid *) glIndexf, _gloffset_Indexf },
- { "glIndexfv", (GLvoid *) glIndexfv, _gloffset_Indexfv },
- { "glIndexi", (GLvoid *) glIndexi, _gloffset_Indexi },
- { "glIndexiv", (GLvoid *) glIndexiv, _gloffset_Indexiv },
- { "glIndexs", (GLvoid *) glIndexs, _gloffset_Indexs },
- { "glIndexsv", (GLvoid *) glIndexsv, _gloffset_Indexsv },
- { "glNormal3b", (GLvoid *) glNormal3b, _gloffset_Normal3b },
- { "glNormal3bv", (GLvoid *) glNormal3bv, _gloffset_Normal3bv },
- { "glNormal3d", (GLvoid *) glNormal3d, _gloffset_Normal3d },
- { "glNormal3dv", (GLvoid *) glNormal3dv, _gloffset_Normal3dv },
- { "glNormal3f", (GLvoid *) glNormal3f, _gloffset_Normal3f },
- { "glNormal3fv", (GLvoid *) glNormal3fv, _gloffset_Normal3fv },
- { "glNormal3i", (GLvoid *) glNormal3i, _gloffset_Normal3i },
- { "glNormal3iv", (GLvoid *) glNormal3iv, _gloffset_Normal3iv },
- { "glNormal3s", (GLvoid *) glNormal3s, _gloffset_Normal3s },
- { "glNormal3sv", (GLvoid *) glNormal3sv, _gloffset_Normal3sv },
- { "glRasterPos2d", (GLvoid *) glRasterPos2d, _gloffset_RasterPos2d },
- { "glRasterPos2dv", (GLvoid *) glRasterPos2dv, _gloffset_RasterPos2dv },
- { "glRasterPos2f", (GLvoid *) glRasterPos2f, _gloffset_RasterPos2f },
- { "glRasterPos2fv", (GLvoid *) glRasterPos2fv, _gloffset_RasterPos2fv },
- { "glRasterPos2i", (GLvoid *) glRasterPos2i, _gloffset_RasterPos2i },
- { "glRasterPos2iv", (GLvoid *) glRasterPos2iv, _gloffset_RasterPos2iv },
- { "glRasterPos2s", (GLvoid *) glRasterPos2s, _gloffset_RasterPos2s },
- { "glRasterPos2sv", (GLvoid *) glRasterPos2sv, _gloffset_RasterPos2sv },
- { "glRasterPos3d", (GLvoid *) glRasterPos3d, _gloffset_RasterPos3d },
- { "glRasterPos3dv", (GLvoid *) glRasterPos3dv, _gloffset_RasterPos3dv },
- { "glRasterPos3f", (GLvoid *) glRasterPos3f, _gloffset_RasterPos3f },
- { "glRasterPos3fv", (GLvoid *) glRasterPos3fv, _gloffset_RasterPos3fv },
- { "glRasterPos3i", (GLvoid *) glRasterPos3i, _gloffset_RasterPos3i },
- { "glRasterPos3iv", (GLvoid *) glRasterPos3iv, _gloffset_RasterPos3iv },
- { "glRasterPos3s", (GLvoid *) glRasterPos3s, _gloffset_RasterPos3s },
- { "glRasterPos3sv", (GLvoid *) glRasterPos3sv, _gloffset_RasterPos3sv },
- { "glRasterPos4d", (GLvoid *) glRasterPos4d, _gloffset_RasterPos4d },
- { "glRasterPos4dv", (GLvoid *) glRasterPos4dv, _gloffset_RasterPos4dv },
- { "glRasterPos4f", (GLvoid *) glRasterPos4f, _gloffset_RasterPos4f },
- { "glRasterPos4fv", (GLvoid *) glRasterPos4fv, _gloffset_RasterPos4fv },
- { "glRasterPos4i", (GLvoid *) glRasterPos4i, _gloffset_RasterPos4i },
- { "glRasterPos4iv", (GLvoid *) glRasterPos4iv, _gloffset_RasterPos4iv },
- { "glRasterPos4s", (GLvoid *) glRasterPos4s, _gloffset_RasterPos4s },
- { "glRasterPos4sv", (GLvoid *) glRasterPos4sv, _gloffset_RasterPos4sv },
- { "glRectd", (GLvoid *) glRectd, _gloffset_Rectd },
- { "glRectdv", (GLvoid *) glRectdv, _gloffset_Rectdv },
- { "glRectf", (GLvoid *) glRectf, _gloffset_Rectf },
- { "glRectfv", (GLvoid *) glRectfv, _gloffset_Rectfv },
- { "glRecti", (GLvoid *) glRecti, _gloffset_Recti },
- { "glRectiv", (GLvoid *) glRectiv, _gloffset_Rectiv },
- { "glRects", (GLvoid *) glRects, _gloffset_Rects },
- { "glRectsv", (GLvoid *) glRectsv, _gloffset_Rectsv },
- { "glTexCoord1d", (GLvoid *) glTexCoord1d, _gloffset_TexCoord1d },
- { "glTexCoord1dv", (GLvoid *) glTexCoord1dv, _gloffset_TexCoord1dv },
- { "glTexCoord1f", (GLvoid *) glTexCoord1f, _gloffset_TexCoord1f },
- { "glTexCoord1fv", (GLvoid *) glTexCoord1fv, _gloffset_TexCoord1fv },
- { "glTexCoord1i", (GLvoid *) glTexCoord1i, _gloffset_TexCoord1i },
- { "glTexCoord1iv", (GLvoid *) glTexCoord1iv, _gloffset_TexCoord1iv },
- { "glTexCoord1s", (GLvoid *) glTexCoord1s, _gloffset_TexCoord1s },
- { "glTexCoord1sv", (GLvoid *) glTexCoord1sv, _gloffset_TexCoord1sv },
- { "glTexCoord2d", (GLvoid *) glTexCoord2d, _gloffset_TexCoord2d },
- { "glTexCoord2dv", (GLvoid *) glTexCoord2dv, _gloffset_TexCoord2dv },
- { "glTexCoord2f", (GLvoid *) glTexCoord2f, _gloffset_TexCoord2f },
- { "glTexCoord2fv", (GLvoid *) glTexCoord2fv, _gloffset_TexCoord2fv },
- { "glTexCoord2i", (GLvoid *) glTexCoord2i, _gloffset_TexCoord2i },
- { "glTexCoord2iv", (GLvoid *) glTexCoord2iv, _gloffset_TexCoord2iv },
- { "glTexCoord2s", (GLvoid *) glTexCoord2s, _gloffset_TexCoord2s },
- { "glTexCoord2sv", (GLvoid *) glTexCoord2sv, _gloffset_TexCoord2sv },
- { "glTexCoord3d", (GLvoid *) glTexCoord3d, _gloffset_TexCoord3d },
- { "glTexCoord3dv", (GLvoid *) glTexCoord3dv, _gloffset_TexCoord3dv },
- { "glTexCoord3f", (GLvoid *) glTexCoord3f, _gloffset_TexCoord3f },
- { "glTexCoord3fv", (GLvoid *) glTexCoord3fv, _gloffset_TexCoord3fv },
- { "glTexCoord3i", (GLvoid *) glTexCoord3i, _gloffset_TexCoord3i },
- { "glTexCoord3iv", (GLvoid *) glTexCoord3iv, _gloffset_TexCoord3iv },
- { "glTexCoord3s", (GLvoid *) glTexCoord3s, _gloffset_TexCoord3s },
- { "glTexCoord3sv", (GLvoid *) glTexCoord3sv, _gloffset_TexCoord3sv },
- { "glTexCoord4d", (GLvoid *) glTexCoord4d, _gloffset_TexCoord4d },
- { "glTexCoord4dv", (GLvoid *) glTexCoord4dv, _gloffset_TexCoord4dv },
- { "glTexCoord4f", (GLvoid *) glTexCoord4f, _gloffset_TexCoord4f },
- { "glTexCoord4fv", (GLvoid *) glTexCoord4fv, _gloffset_TexCoord4fv },
- { "glTexCoord4i", (GLvoid *) glTexCoord4i, _gloffset_TexCoord4i },
- { "glTexCoord4iv", (GLvoid *) glTexCoord4iv, _gloffset_TexCoord4iv },
- { "glTexCoord4s", (GLvoid *) glTexCoord4s, _gloffset_TexCoord4s },
- { "glTexCoord4sv", (GLvoid *) glTexCoord4sv, _gloffset_TexCoord4sv },
- { "glVertex2d", (GLvoid *) glVertex2d, _gloffset_Vertex2d },
- { "glVertex2dv", (GLvoid *) glVertex2dv, _gloffset_Vertex2dv },
- { "glVertex2f", (GLvoid *) glVertex2f, _gloffset_Vertex2f },
- { "glVertex2fv", (GLvoid *) glVertex2fv, _gloffset_Vertex2fv },
- { "glVertex2i", (GLvoid *) glVertex2i, _gloffset_Vertex2i },
- { "glVertex2iv", (GLvoid *) glVertex2iv, _gloffset_Vertex2iv },
- { "glVertex2s", (GLvoid *) glVertex2s, _gloffset_Vertex2s },
- { "glVertex2sv", (GLvoid *) glVertex2sv, _gloffset_Vertex2sv },
- { "glVertex3d", (GLvoid *) glVertex3d, _gloffset_Vertex3d },
- { "glVertex3dv", (GLvoid *) glVertex3dv, _gloffset_Vertex3dv },
- { "glVertex3f", (GLvoid *) glVertex3f, _gloffset_Vertex3f },
- { "glVertex3fv", (GLvoid *) glVertex3fv, _gloffset_Vertex3fv },
- { "glVertex3i", (GLvoid *) glVertex3i, _gloffset_Vertex3i },
- { "glVertex3iv", (GLvoid *) glVertex3iv, _gloffset_Vertex3iv },
- { "glVertex3s", (GLvoid *) glVertex3s, _gloffset_Vertex3s },
- { "glVertex3sv", (GLvoid *) glVertex3sv, _gloffset_Vertex3sv },
- { "glVertex4d", (GLvoid *) glVertex4d, _gloffset_Vertex4d },
- { "glVertex4dv", (GLvoid *) glVertex4dv, _gloffset_Vertex4dv },
- { "glVertex4f", (GLvoid *) glVertex4f, _gloffset_Vertex4f },
- { "glVertex4fv", (GLvoid *) glVertex4fv, _gloffset_Vertex4fv },
- { "glVertex4i", (GLvoid *) glVertex4i, _gloffset_Vertex4i },
- { "glVertex4iv", (GLvoid *) glVertex4iv, _gloffset_Vertex4iv },
- { "glVertex4s", (GLvoid *) glVertex4s, _gloffset_Vertex4s },
- { "glVertex4sv", (GLvoid *) glVertex4sv, _gloffset_Vertex4sv },
- { "glClipPlane", (GLvoid *) glClipPlane, _gloffset_ClipPlane },
- { "glColorMaterial", (GLvoid *) glColorMaterial, _gloffset_ColorMaterial },
- { "glCullFace", (GLvoid *) glCullFace, _gloffset_CullFace },
- { "glFogf", (GLvoid *) glFogf, _gloffset_Fogf },
- { "glFogfv", (GLvoid *) glFogfv, _gloffset_Fogfv },
- { "glFogi", (GLvoid *) glFogi, _gloffset_Fogi },
- { "glFogiv", (GLvoid *) glFogiv, _gloffset_Fogiv },
- { "glFrontFace", (GLvoid *) glFrontFace, _gloffset_FrontFace },
- { "glHint", (GLvoid *) glHint, _gloffset_Hint },
- { "glLightf", (GLvoid *) glLightf, _gloffset_Lightf },
- { "glLightfv", (GLvoid *) glLightfv, _gloffset_Lightfv },
- { "glLighti", (GLvoid *) glLighti, _gloffset_Lighti },
- { "glLightiv", (GLvoid *) glLightiv, _gloffset_Lightiv },
- { "glLightModelf", (GLvoid *) glLightModelf, _gloffset_LightModelf },
- { "glLightModelfv", (GLvoid *) glLightModelfv, _gloffset_LightModelfv },
- { "glLightModeli", (GLvoid *) glLightModeli, _gloffset_LightModeli },
- { "glLightModeliv", (GLvoid *) glLightModeliv, _gloffset_LightModeliv },
- { "glLineStipple", (GLvoid *) glLineStipple, _gloffset_LineStipple },
- { "glLineWidth", (GLvoid *) glLineWidth, _gloffset_LineWidth },
- { "glMaterialf", (GLvoid *) glMaterialf, _gloffset_Materialf },
- { "glMaterialfv", (GLvoid *) glMaterialfv, _gloffset_Materialfv },
- { "glMateriali", (GLvoid *) glMateriali, _gloffset_Materiali },
- { "glMaterialiv", (GLvoid *) glMaterialiv, _gloffset_Materialiv },
- { "glPointSize", (GLvoid *) glPointSize, _gloffset_PointSize },
- { "glPolygonMode", (GLvoid *) glPolygonMode, _gloffset_PolygonMode },
- { "glPolygonStipple", (GLvoid *) glPolygonStipple, _gloffset_PolygonStipple },
- { "glScissor", (GLvoid *) glScissor, _gloffset_Scissor },
- { "glShadeModel", (GLvoid *) glShadeModel, _gloffset_ShadeModel },
- { "glTexParameterf", (GLvoid *) glTexParameterf, _gloffset_TexParameterf },
- { "glTexParameterfv", (GLvoid *) glTexParameterfv, _gloffset_TexParameterfv },
- { "glTexParameteri", (GLvoid *) glTexParameteri, _gloffset_TexParameteri },
- { "glTexParameteriv", (GLvoid *) glTexParameteriv, _gloffset_TexParameteriv },
- { "glTexImage1D", (GLvoid *) glTexImage1D, _gloffset_TexImage1D },
- { "glTexImage2D", (GLvoid *) glTexImage2D, _gloffset_TexImage2D },
- { "glTexEnvf", (GLvoid *) glTexEnvf, _gloffset_TexEnvf },
- { "glTexEnvfv", (GLvoid *) glTexEnvfv, _gloffset_TexEnvfv },
- { "glTexEnvi", (GLvoid *) glTexEnvi, _gloffset_TexEnvi },
- { "glTexEnviv", (GLvoid *) glTexEnviv, _gloffset_TexEnviv },
- { "glTexGend", (GLvoid *) glTexGend, _gloffset_TexGend },
- { "glTexGendv", (GLvoid *) glTexGendv, _gloffset_TexGendv },
- { "glTexGenf", (GLvoid *) glTexGenf, _gloffset_TexGenf },
- { "glTexGenfv", (GLvoid *) glTexGenfv, _gloffset_TexGenfv },
- { "glTexGeni", (GLvoid *) glTexGeni, _gloffset_TexGeni },
- { "glTexGeniv", (GLvoid *) glTexGeniv, _gloffset_TexGeniv },
- { "glFeedbackBuffer", (GLvoid *) glFeedbackBuffer, _gloffset_FeedbackBuffer },
- { "glSelectBuffer", (GLvoid *) glSelectBuffer, _gloffset_SelectBuffer },
- { "glRenderMode", (GLvoid *) glRenderMode, _gloffset_RenderMode },
- { "glInitNames", (GLvoid *) glInitNames, _gloffset_InitNames },
- { "glLoadName", (GLvoid *) glLoadName, _gloffset_LoadName },
- { "glPassThrough", (GLvoid *) glPassThrough, _gloffset_PassThrough },
- { "glPopName", (GLvoid *) glPopName, _gloffset_PopName },
- { "glPushName", (GLvoid *) glPushName, _gloffset_PushName },
- { "glDrawBuffer", (GLvoid *) glDrawBuffer, _gloffset_DrawBuffer },
- { "glClear", (GLvoid *) glClear, _gloffset_Clear },
- { "glClearAccum", (GLvoid *) glClearAccum, _gloffset_ClearAccum },
- { "glClearIndex", (GLvoid *) glClearIndex, _gloffset_ClearIndex },
- { "glClearColor", (GLvoid *) glClearColor, _gloffset_ClearColor },
- { "glClearStencil", (GLvoid *) glClearStencil, _gloffset_ClearStencil },
- { "glClearDepth", (GLvoid *) glClearDepth, _gloffset_ClearDepth },
- { "glStencilMask", (GLvoid *) glStencilMask, _gloffset_StencilMask },
- { "glColorMask", (GLvoid *) glColorMask, _gloffset_ColorMask },
- { "glDepthMask", (GLvoid *) glDepthMask, _gloffset_DepthMask },
- { "glIndexMask", (GLvoid *) glIndexMask, _gloffset_IndexMask },
- { "glAccum", (GLvoid *) glAccum, _gloffset_Accum },
- { "glDisable", (GLvoid *) glDisable, _gloffset_Disable },
- { "glEnable", (GLvoid *) glEnable, _gloffset_Enable },
- { "glFinish", (GLvoid *) glFinish, _gloffset_Finish },
- { "glFlush", (GLvoid *) glFlush, _gloffset_Flush },
- { "glPopAttrib", (GLvoid *) glPopAttrib, _gloffset_PopAttrib },
- { "glPushAttrib", (GLvoid *) glPushAttrib, _gloffset_PushAttrib },
- { "glMap1d", (GLvoid *) glMap1d, _gloffset_Map1d },
- { "glMap1f", (GLvoid *) glMap1f, _gloffset_Map1f },
- { "glMap2d", (GLvoid *) glMap2d, _gloffset_Map2d },
- { "glMap2f", (GLvoid *) glMap2f, _gloffset_Map2f },
- { "glMapGrid1d", (GLvoid *) glMapGrid1d, _gloffset_MapGrid1d },
- { "glMapGrid1f", (GLvoid *) glMapGrid1f, _gloffset_MapGrid1f },
- { "glMapGrid2d", (GLvoid *) glMapGrid2d, _gloffset_MapGrid2d },
- { "glMapGrid2f", (GLvoid *) glMapGrid2f, _gloffset_MapGrid2f },
- { "glEvalCoord1d", (GLvoid *) glEvalCoord1d, _gloffset_EvalCoord1d },
- { "glEvalCoord1dv", (GLvoid *) glEvalCoord1dv, _gloffset_EvalCoord1dv },
- { "glEvalCoord1f", (GLvoid *) glEvalCoord1f, _gloffset_EvalCoord1f },
- { "glEvalCoord1fv", (GLvoid *) glEvalCoord1fv, _gloffset_EvalCoord1fv },
- { "glEvalCoord2d", (GLvoid *) glEvalCoord2d, _gloffset_EvalCoord2d },
- { "glEvalCoord2dv", (GLvoid *) glEvalCoord2dv, _gloffset_EvalCoord2dv },
- { "glEvalCoord2f", (GLvoid *) glEvalCoord2f, _gloffset_EvalCoord2f },
- { "glEvalCoord2fv", (GLvoid *) glEvalCoord2fv, _gloffset_EvalCoord2fv },
- { "glEvalMesh1", (GLvoid *) glEvalMesh1, _gloffset_EvalMesh1 },
- { "glEvalPoint1", (GLvoid *) glEvalPoint1, _gloffset_EvalPoint1 },
- { "glEvalMesh2", (GLvoid *) glEvalMesh2, _gloffset_EvalMesh2 },
- { "glEvalPoint2", (GLvoid *) glEvalPoint2, _gloffset_EvalPoint2 },
- { "glAlphaFunc", (GLvoid *) glAlphaFunc, _gloffset_AlphaFunc },
- { "glBlendFunc", (GLvoid *) glBlendFunc, _gloffset_BlendFunc },
- { "glLogicOp", (GLvoid *) glLogicOp, _gloffset_LogicOp },
- { "glStencilFunc", (GLvoid *) glStencilFunc, _gloffset_StencilFunc },
- { "glStencilOp", (GLvoid *) glStencilOp, _gloffset_StencilOp },
- { "glDepthFunc", (GLvoid *) glDepthFunc, _gloffset_DepthFunc },
- { "glPixelZoom", (GLvoid *) glPixelZoom, _gloffset_PixelZoom },
- { "glPixelTransferf", (GLvoid *) glPixelTransferf, _gloffset_PixelTransferf },
- { "glPixelTransferi", (GLvoid *) glPixelTransferi, _gloffset_PixelTransferi },
- { "glPixelStoref", (GLvoid *) glPixelStoref, _gloffset_PixelStoref },
- { "glPixelStorei", (GLvoid *) glPixelStorei, _gloffset_PixelStorei },
- { "glPixelMapfv", (GLvoid *) glPixelMapfv, _gloffset_PixelMapfv },
- { "glPixelMapuiv", (GLvoid *) glPixelMapuiv, _gloffset_PixelMapuiv },
- { "glPixelMapusv", (GLvoid *) glPixelMapusv, _gloffset_PixelMapusv },
- { "glReadBuffer", (GLvoid *) glReadBuffer, _gloffset_ReadBuffer },
- { "glCopyPixels", (GLvoid *) glCopyPixels, _gloffset_CopyPixels },
- { "glReadPixels", (GLvoid *) glReadPixels, _gloffset_ReadPixels },
- { "glDrawPixels", (GLvoid *) glDrawPixels, _gloffset_DrawPixels },
- { "glGetBooleanv", (GLvoid *) glGetBooleanv, _gloffset_GetBooleanv },
- { "glGetClipPlane", (GLvoid *) glGetClipPlane, _gloffset_GetClipPlane },
- { "glGetDoublev", (GLvoid *) glGetDoublev, _gloffset_GetDoublev },
- { "glGetError", (GLvoid *) glGetError, _gloffset_GetError },
- { "glGetFloatv", (GLvoid *) glGetFloatv, _gloffset_GetFloatv },
- { "glGetIntegerv", (GLvoid *) glGetIntegerv, _gloffset_GetIntegerv },
- { "glGetLightfv", (GLvoid *) glGetLightfv, _gloffset_GetLightfv },
- { "glGetLightiv", (GLvoid *) glGetLightiv, _gloffset_GetLightiv },
- { "glGetMapdv", (GLvoid *) glGetMapdv, _gloffset_GetMapdv },
- { "glGetMapfv", (GLvoid *) glGetMapfv, _gloffset_GetMapfv },
- { "glGetMapiv", (GLvoid *) glGetMapiv, _gloffset_GetMapiv },
- { "glGetMaterialfv", (GLvoid *) glGetMaterialfv, _gloffset_GetMaterialfv },
- { "glGetMaterialiv", (GLvoid *) glGetMaterialiv, _gloffset_GetMaterialiv },
- { "glGetPixelMapfv", (GLvoid *) glGetPixelMapfv, _gloffset_GetPixelMapfv },
- { "glGetPixelMapuiv", (GLvoid *) glGetPixelMapuiv, _gloffset_GetPixelMapuiv },
- { "glGetPixelMapusv", (GLvoid *) glGetPixelMapusv, _gloffset_GetPixelMapusv },
- { "glGetPolygonStipple", (GLvoid *) glGetPolygonStipple, _gloffset_GetPolygonStipple },
- { "glGetString", (GLvoid *) glGetString, _gloffset_GetString },
- { "glGetTexEnvfv", (GLvoid *) glGetTexEnvfv, _gloffset_GetTexEnvfv },
- { "glGetTexEnviv", (GLvoid *) glGetTexEnviv, _gloffset_GetTexEnviv },
- { "glGetTexGendv", (GLvoid *) glGetTexGendv, _gloffset_GetTexGendv },
- { "glGetTexGenfv", (GLvoid *) glGetTexGenfv, _gloffset_GetTexGenfv },
- { "glGetTexGeniv", (GLvoid *) glGetTexGeniv, _gloffset_GetTexGeniv },
- { "glGetTexImage", (GLvoid *) glGetTexImage, _gloffset_GetTexImage },
- { "glGetTexParameterfv", (GLvoid *) glGetTexParameterfv, _gloffset_GetTexParameterfv },
- { "glGetTexParameteriv", (GLvoid *) glGetTexParameteriv, _gloffset_GetTexParameteriv },
- { "glGetTexLevelParameterfv", (GLvoid *) glGetTexLevelParameterfv, _gloffset_GetTexLevelParameterfv },
- { "glGetTexLevelParameteriv", (GLvoid *) glGetTexLevelParameteriv, _gloffset_GetTexLevelParameteriv },
- { "glIsEnabled", (GLvoid *) glIsEnabled, _gloffset_IsEnabled },
- { "glIsList", (GLvoid *) glIsList, _gloffset_IsList },
- { "glDepthRange", (GLvoid *) glDepthRange, _gloffset_DepthRange },
- { "glFrustum", (GLvoid *) glFrustum, _gloffset_Frustum },
- { "glLoadIdentity", (GLvoid *) glLoadIdentity, _gloffset_LoadIdentity },
- { "glLoadMatrixf", (GLvoid *) glLoadMatrixf, _gloffset_LoadMatrixf },
- { "glLoadMatrixd", (GLvoid *) glLoadMatrixd, _gloffset_LoadMatrixd },
- { "glMatrixMode", (GLvoid *) glMatrixMode, _gloffset_MatrixMode },
- { "glMultMatrixf", (GLvoid *) glMultMatrixf, _gloffset_MultMatrixf },
- { "glMultMatrixd", (GLvoid *) glMultMatrixd, _gloffset_MultMatrixd },
- { "glOrtho", (GLvoid *) glOrtho, _gloffset_Ortho },
- { "glPopMatrix", (GLvoid *) glPopMatrix, _gloffset_PopMatrix },
- { "glPushMatrix", (GLvoid *) glPushMatrix, _gloffset_PushMatrix },
- { "glRotated", (GLvoid *) glRotated, _gloffset_Rotated },
- { "glRotatef", (GLvoid *) glRotatef, _gloffset_Rotatef },
- { "glScaled", (GLvoid *) glScaled, _gloffset_Scaled },
- { "glScalef", (GLvoid *) glScalef, _gloffset_Scalef },
- { "glTranslated", (GLvoid *) glTranslated, _gloffset_Translated },
- { "glTranslatef", (GLvoid *) glTranslatef, _gloffset_Translatef },
- { "glViewport", (GLvoid *) glViewport, _gloffset_Viewport },
- /* 1.1 */
- { "glArrayElement", (GLvoid *) glArrayElement, _gloffset_ArrayElement },
- { "glColorPointer", (GLvoid *) glColorPointer, _gloffset_ColorPointer },
- { "glDisableClientState", (GLvoid *) glDisableClientState, _gloffset_DisableClientState },
- { "glDrawArrays", (GLvoid *) glDrawArrays, _gloffset_DrawArrays },
- { "glDrawElements", (GLvoid *) glDrawElements, _gloffset_DrawElements },
- { "glEdgeFlagPointer", (GLvoid *) glEdgeFlagPointer, _gloffset_EdgeFlagPointer },
- { "glEnableClientState", (GLvoid *) glEnableClientState, _gloffset_EnableClientState },
- { "glGetPointerv", (GLvoid *) glGetPointerv, _gloffset_GetPointerv },
- { "glIndexPointer", (GLvoid *) glIndexPointer, _gloffset_IndexPointer },
- { "glInterleavedArrays", (GLvoid *) glInterleavedArrays, _gloffset_InterleavedArrays },
- { "glNormalPointer", (GLvoid *) glNormalPointer, _gloffset_NormalPointer },
- { "glTexCoordPointer", (GLvoid *) glTexCoordPointer, _gloffset_TexCoordPointer },
- { "glVertexPointer", (GLvoid *) glVertexPointer, _gloffset_VertexPointer },
- { "glPolygonOffset", (GLvoid *) glPolygonOffset, _gloffset_PolygonOffset },
- { "glCopyTexImage1D", (GLvoid *) glCopyTexImage1D, _gloffset_CopyTexImage1D },
- { "glCopyTexImage2D", (GLvoid *) glCopyTexImage2D, _gloffset_CopyTexImage2D },
- { "glCopyTexSubImage1D", (GLvoid *) glCopyTexSubImage1D, _gloffset_CopyTexSubImage1D },
- { "glCopyTexSubImage2D", (GLvoid *) glCopyTexSubImage2D, _gloffset_CopyTexSubImage2D },
- { "glTexSubImage1D", (GLvoid *) glTexSubImage1D, _gloffset_TexSubImage1D },
- { "glTexSubImage2D", (GLvoid *) glTexSubImage2D, _gloffset_TexSubImage2D },
- { "glAreTexturesResident", (GLvoid *) glAreTexturesResident, _gloffset_AreTexturesResident },
- { "glBindTexture", (GLvoid *) glBindTexture, _gloffset_BindTexture },
- { "glDeleteTextures", (GLvoid *) glDeleteTextures, _gloffset_DeleteTextures },
- { "glGenTextures", (GLvoid *) glGenTextures, _gloffset_GenTextures },
- { "glIsTexture", (GLvoid *) glIsTexture, _gloffset_IsTexture },
- { "glPrioritizeTextures", (GLvoid *) glPrioritizeTextures, _gloffset_PrioritizeTextures },
- { "glIndexub", (GLvoid *) glIndexub, _gloffset_Indexub },
- { "glIndexubv", (GLvoid *) glIndexubv, _gloffset_Indexubv },
- { "glPopClientAttrib", (GLvoid *) glPopClientAttrib, _gloffset_PopClientAttrib },
- { "glPushClientAttrib", (GLvoid *) glPushClientAttrib, _gloffset_PushClientAttrib },
- /* 1.2 */
-#ifdef GL_VERSION_1_2
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) NotImplemented
-#endif
- { "glBlendColor", (GLvoid *) NAME(glBlendColor), _gloffset_BlendColor },
- { "glBlendEquation", (GLvoid *) NAME(glBlendEquation), _gloffset_BlendEquation },
- { "glDrawRangeElements", (GLvoid *) NAME(glDrawRangeElements), _gloffset_DrawRangeElements },
- { "glColorTable", (GLvoid *) NAME(glColorTable), _gloffset_ColorTable },
- { "glColorTableParameterfv", (GLvoid *) NAME(glColorTableParameterfv), _gloffset_ColorTableParameterfv },
- { "glColorTableParameteriv", (GLvoid *) NAME(glColorTableParameteriv), _gloffset_ColorTableParameteriv },
- { "glCopyColorTable", (GLvoid *) NAME(glCopyColorTable), _gloffset_CopyColorTable },
- { "glGetColorTable", (GLvoid *) NAME(glGetColorTable), _gloffset_GetColorTable },
- { "glGetColorTableParameterfv", (GLvoid *) NAME(glGetColorTableParameterfv), _gloffset_GetColorTableParameterfv },
- { "glGetColorTableParameteriv", (GLvoid *) NAME(glGetColorTableParameteriv), _gloffset_GetColorTableParameteriv },
- { "glColorSubTable", (GLvoid *) NAME(glColorSubTable), _gloffset_ColorSubTable },
- { "glCopyColorSubTable", (GLvoid *) NAME(glCopyColorSubTable), _gloffset_CopyColorSubTable },
- { "glConvolutionFilter1D", (GLvoid *) NAME(glConvolutionFilter1D), _gloffset_ConvolutionFilter1D },
- { "glConvolutionFilter2D", (GLvoid *) NAME(glConvolutionFilter2D), _gloffset_ConvolutionFilter2D },
- { "glConvolutionParameterf", (GLvoid *) NAME(glConvolutionParameterf), _gloffset_ConvolutionParameterf },
- { "glConvolutionParameterfv", (GLvoid *) NAME(glConvolutionParameterfv), _gloffset_ConvolutionParameterfv },
- { "glConvolutionParameteri", (GLvoid *) NAME(glConvolutionParameteri), _gloffset_ConvolutionParameteri },
- { "glConvolutionParameteriv", (GLvoid *) NAME(glConvolutionParameteriv), _gloffset_ConvolutionParameteriv },
- { "glCopyConvolutionFilter1D", (GLvoid *) NAME(glCopyConvolutionFilter1D), _gloffset_CopyConvolutionFilter1D },
- { "glCopyConvolutionFilter2D", (GLvoid *) NAME(glCopyConvolutionFilter2D), _gloffset_CopyConvolutionFilter2D },
- { "glGetConvolutionFilter", (GLvoid *) NAME(glGetConvolutionFilter), _gloffset_GetConvolutionFilter },
- { "glGetConvolutionParameterfv", (GLvoid *) NAME(glGetConvolutionParameterfv), _gloffset_GetConvolutionParameterfv },
- { "glGetConvolutionParameteriv", (GLvoid *) NAME(glGetConvolutionParameteriv), _gloffset_GetConvolutionParameteriv },
- { "glGetSeparableFilter", (GLvoid *) NAME(glGetSeparableFilter), _gloffset_GetSeparableFilter },
- { "glSeparableFilter2D", (GLvoid *) NAME(glSeparableFilter2D), _gloffset_SeparableFilter2D },
- { "glGetHistogram", (GLvoid *) NAME(glGetHistogram), _gloffset_GetHistogram },
- { "glGetHistogramParameterfv", (GLvoid *) NAME(glGetHistogramParameterfv), _gloffset_GetHistogramParameterfv },
- { "glGetHistogramParameteriv", (GLvoid *) NAME(glGetHistogramParameteriv), _gloffset_GetHistogramParameteriv },
- { "glGetMinmax", (GLvoid *) NAME(glGetMinmax), _gloffset_GetMinmax },
- { "glGetMinmaxParameterfv", (GLvoid *) NAME(glGetMinmaxParameterfv), _gloffset_GetMinmaxParameterfv },
- { "glGetMinmaxParameteriv", (GLvoid *) NAME(glGetMinmaxParameteriv), _gloffset_GetMinmaxParameteriv },
- { "glHistogram", (GLvoid *) NAME(glHistogram), _gloffset_Histogram },
- { "glMinmax", (GLvoid *) NAME(glMinmax), _gloffset_Minmax },
- { "glResetHistogram", (GLvoid *) NAME(glResetHistogram), _gloffset_ResetHistogram },
- { "glResetMinmax", (GLvoid *) NAME(glResetMinmax), _gloffset_ResetMinmax },
- { "glTexImage3D", (GLvoid *) NAME(glTexImage3D), _gloffset_TexImage3D },
- { "glTexSubImage3D", (GLvoid *) NAME(glTexSubImage3D), _gloffset_TexSubImage3D },
- { "glCopyTexSubImage3D", (GLvoid *) NAME(glCopyTexSubImage3D), _gloffset_CopyTexSubImage3D },
-#undef NAME
-
- /* 1.3 */
-#ifdef GL_VERSION_1_3
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) NotImplemented
-#endif
- { "glActiveTexture", (GLvoid *) NAME(glActiveTexture), _gloffset_ActiveTextureARB },
- { "glClientActiveTexture", (GLvoid *) NAME(glClientActiveTexture), _gloffset_ClientActiveTextureARB },
- { "glCompressedTexImage1D", (GLvoid *) NAME(glCompressedTexImage1D), _gloffset_CompressedTexImage1DARB },
- { "glCompressedTexImage2D", (GLvoid *) NAME(glCompressedTexImage2D), _gloffset_CompressedTexImage2DARB },
- { "glCompressedTexImage3D", (GLvoid *) NAME(glCompressedTexImage3D), _gloffset_CompressedTexImage3DARB },
- { "glCompressedTexSubImage1D", (GLvoid *) NAME(glCompressedTexSubImage1D), _gloffset_CompressedTexSubImage1DARB },
- { "glCompressedTexSubImage2D", (GLvoid *) NAME(glCompressedTexSubImage2D), _gloffset_CompressedTexSubImage2DARB },
- { "glCompressedTexSubImage3D", (GLvoid *) NAME(glCompressedTexSubImage3D), _gloffset_CompressedTexSubImage3DARB },
- { "glGetCompressedTexImage", (GLvoid *) NAME(glGetCompressedTexImage), _gloffset_GetCompressedTexImageARB },
- { "glMultiTexCoord1d", (GLvoid *) NAME(glMultiTexCoord1d), _gloffset_MultiTexCoord1dARB },
- { "glMultiTexCoord1dv", (GLvoid *) NAME(glMultiTexCoord1dv), _gloffset_MultiTexCoord1dvARB },
- { "glMultiTexCoord1f", (GLvoid *) NAME(glMultiTexCoord1f), _gloffset_MultiTexCoord1fARB },
- { "glMultiTexCoord1fv", (GLvoid *) NAME(glMultiTexCoord1fv), _gloffset_MultiTexCoord1fvARB },
- { "glMultiTexCoord1i", (GLvoid *) NAME(glMultiTexCoord1i), _gloffset_MultiTexCoord1iARB },
- { "glMultiTexCoord1iv", (GLvoid *) NAME(glMultiTexCoord1iv), _gloffset_MultiTexCoord1ivARB },
- { "glMultiTexCoord1s", (GLvoid *) NAME(glMultiTexCoord1s), _gloffset_MultiTexCoord1sARB },
- { "glMultiTexCoord1sv", (GLvoid *) NAME(glMultiTexCoord1sv), _gloffset_MultiTexCoord1svARB },
- { "glMultiTexCoord2d", (GLvoid *) NAME(glMultiTexCoord2d), _gloffset_MultiTexCoord2dARB },
- { "glMultiTexCoord2dv", (GLvoid *) NAME(glMultiTexCoord2dv), _gloffset_MultiTexCoord2dvARB },
- { "glMultiTexCoord2f", (GLvoid *) NAME(glMultiTexCoord2f), _gloffset_MultiTexCoord2fARB },
- { "glMultiTexCoord2fv", (GLvoid *) NAME(glMultiTexCoord2fv), _gloffset_MultiTexCoord2fvARB },
- { "glMultiTexCoord2i", (GLvoid *) NAME(glMultiTexCoord2i), _gloffset_MultiTexCoord2iARB },
- { "glMultiTexCoord2iv", (GLvoid *) NAME(glMultiTexCoord2iv), _gloffset_MultiTexCoord2ivARB },
- { "glMultiTexCoord2s", (GLvoid *) NAME(glMultiTexCoord2s), _gloffset_MultiTexCoord2sARB },
- { "glMultiTexCoord2sv", (GLvoid *) NAME(glMultiTexCoord2sv), _gloffset_MultiTexCoord2svARB },
- { "glMultiTexCoord3d", (GLvoid *) NAME(glMultiTexCoord3d), _gloffset_MultiTexCoord3dARB },
- { "glMultiTexCoord3dv", (GLvoid *) NAME(glMultiTexCoord3dv), _gloffset_MultiTexCoord3dvARB },
- { "glMultiTexCoord3f", (GLvoid *) NAME(glMultiTexCoord3f), _gloffset_MultiTexCoord3fARB },
- { "glMultiTexCoord3fv", (GLvoid *) NAME(glMultiTexCoord3fv), _gloffset_MultiTexCoord3fvARB },
- { "glMultiTexCoord3i", (GLvoid *) NAME(glMultiTexCoord3i), _gloffset_MultiTexCoord3iARB },
- { "glMultiTexCoord3iv", (GLvoid *) NAME(glMultiTexCoord3iv), _gloffset_MultiTexCoord3ivARB },
- { "glMultiTexCoord3s", (GLvoid *) NAME(glMultiTexCoord3s), _gloffset_MultiTexCoord3sARB },
- { "glMultiTexCoord3sv", (GLvoid *) NAME(glMultiTexCoord3sv), _gloffset_MultiTexCoord3svARB },
- { "glMultiTexCoord4d", (GLvoid *) NAME(glMultiTexCoord4d), _gloffset_MultiTexCoord4dARB },
- { "glMultiTexCoord4dv", (GLvoid *) NAME(glMultiTexCoord4dv), _gloffset_MultiTexCoord4dvARB },
- { "glMultiTexCoord4f", (GLvoid *) NAME(glMultiTexCoord4f), _gloffset_MultiTexCoord4fARB },
- { "glMultiTexCoord4fv", (GLvoid *) NAME(glMultiTexCoord4fv), _gloffset_MultiTexCoord4fvARB },
- { "glMultiTexCoord4i", (GLvoid *) NAME(glMultiTexCoord4i), _gloffset_MultiTexCoord4iARB },
- { "glMultiTexCoord4iv", (GLvoid *) NAME(glMultiTexCoord4iv), _gloffset_MultiTexCoord4ivARB },
- { "glMultiTexCoord4s", (GLvoid *) NAME(glMultiTexCoord4s), _gloffset_MultiTexCoord4sARB },
- { "glMultiTexCoord4sv", (GLvoid *) NAME(glMultiTexCoord4sv), _gloffset_MultiTexCoord4svARB },
- { "glLoadTransposeMatrixd", (GLvoid *) NAME(glLoadTransposeMatrixd), _gloffset_LoadTransposeMatrixdARB },
- { "glLoadTransposeMatrixf", (GLvoid *) NAME(glLoadTransposeMatrixf), _gloffset_LoadTransposeMatrixfARB },
- { "glMultTransposeMatrixd", (GLvoid *) NAME(glMultTransposeMatrixd), _gloffset_MultTransposeMatrixdARB },
- { "glMultTransposeMatrixf", (GLvoid *) NAME(glMultTransposeMatrixf), _gloffset_MultTransposeMatrixfARB },
- { "glSampleCoverage", (GLvoid *) NAME(glSampleCoverage), _gloffset_SampleCoverageARB },
-#if 0
- { "glSamplePass", (GLvoid *) NAME(glSamplePass), _gloffset_SamplePassARB },
-#endif
-#undef NAME
-
- /* ARB 1. GL_ARB_multitexture */
-#ifdef GL_ARB_multitexture
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) NotImplemented
-#endif
- { "glActiveTextureARB", (GLvoid *) NAME(glActiveTextureARB), _gloffset_ActiveTextureARB },
- { "glClientActiveTextureARB", (GLvoid *) NAME(glClientActiveTextureARB), _gloffset_ClientActiveTextureARB },
- { "glMultiTexCoord1dARB", (GLvoid *) NAME(glMultiTexCoord1dARB), _gloffset_MultiTexCoord1dARB },
- { "glMultiTexCoord1dvARB", (GLvoid *) NAME(glMultiTexCoord1dvARB), _gloffset_MultiTexCoord1dvARB },
- { "glMultiTexCoord1fARB", (GLvoid *) NAME(glMultiTexCoord1fARB), _gloffset_MultiTexCoord1fARB },
- { "glMultiTexCoord1fvARB", (GLvoid *) NAME(glMultiTexCoord1fvARB), _gloffset_MultiTexCoord1fvARB },
- { "glMultiTexCoord1iARB", (GLvoid *) NAME(glMultiTexCoord1iARB), _gloffset_MultiTexCoord1iARB },
- { "glMultiTexCoord1ivARB", (GLvoid *) NAME(glMultiTexCoord1ivARB), _gloffset_MultiTexCoord1ivARB },
- { "glMultiTexCoord1sARB", (GLvoid *) NAME(glMultiTexCoord1sARB), _gloffset_MultiTexCoord1sARB },
- { "glMultiTexCoord1svARB", (GLvoid *) NAME(glMultiTexCoord1svARB), _gloffset_MultiTexCoord1svARB },
- { "glMultiTexCoord2dARB", (GLvoid *) NAME(glMultiTexCoord2dARB), _gloffset_MultiTexCoord2dARB },
- { "glMultiTexCoord2dvARB", (GLvoid *) NAME(glMultiTexCoord2dvARB), _gloffset_MultiTexCoord2dvARB },
- { "glMultiTexCoord2fARB", (GLvoid *) NAME(glMultiTexCoord2fARB), _gloffset_MultiTexCoord2fARB },
- { "glMultiTexCoord2fvARB", (GLvoid *) NAME(glMultiTexCoord2fvARB), _gloffset_MultiTexCoord2fvARB },
- { "glMultiTexCoord2iARB", (GLvoid *) NAME(glMultiTexCoord2iARB), _gloffset_MultiTexCoord2iARB },
- { "glMultiTexCoord2ivARB", (GLvoid *) NAME(glMultiTexCoord2ivARB), _gloffset_MultiTexCoord2ivARB },
- { "glMultiTexCoord2sARB", (GLvoid *) NAME(glMultiTexCoord2sARB), _gloffset_MultiTexCoord2sARB },
- { "glMultiTexCoord2svARB", (GLvoid *) NAME(glMultiTexCoord2svARB), _gloffset_MultiTexCoord2svARB },
- { "glMultiTexCoord3dARB", (GLvoid *) NAME(glMultiTexCoord3dARB), _gloffset_MultiTexCoord3dARB },
- { "glMultiTexCoord3dvARB", (GLvoid *) NAME(glMultiTexCoord3dvARB), _gloffset_MultiTexCoord3dvARB },
- { "glMultiTexCoord3fARB", (GLvoid *) NAME(glMultiTexCoord3fARB), _gloffset_MultiTexCoord3fARB },
- { "glMultiTexCoord3fvARB", (GLvoid *) NAME(glMultiTexCoord3fvARB), _gloffset_MultiTexCoord3fvARB },
- { "glMultiTexCoord3iARB", (GLvoid *) NAME(glMultiTexCoord3iARB), _gloffset_MultiTexCoord3iARB },
- { "glMultiTexCoord3ivARB", (GLvoid *) NAME(glMultiTexCoord3ivARB), _gloffset_MultiTexCoord3ivARB },
- { "glMultiTexCoord3sARB", (GLvoid *) NAME(glMultiTexCoord3sARB), _gloffset_MultiTexCoord3sARB },
- { "glMultiTexCoord3svARB", (GLvoid *) NAME(glMultiTexCoord3svARB), _gloffset_MultiTexCoord3svARB },
- { "glMultiTexCoord4dARB", (GLvoid *) NAME(glMultiTexCoord4dARB), _gloffset_MultiTexCoord4dARB },
- { "glMultiTexCoord4dvARB", (GLvoid *) NAME(glMultiTexCoord4dvARB), _gloffset_MultiTexCoord4dvARB },
- { "glMultiTexCoord4fARB", (GLvoid *) NAME(glMultiTexCoord4fARB), _gloffset_MultiTexCoord4fARB },
- { "glMultiTexCoord4fvARB", (GLvoid *) NAME(glMultiTexCoord4fvARB), _gloffset_MultiTexCoord4fvARB },
- { "glMultiTexCoord4iARB", (GLvoid *) NAME(glMultiTexCoord4iARB), _gloffset_MultiTexCoord4iARB },
- { "glMultiTexCoord4ivARB", (GLvoid *) NAME(glMultiTexCoord4ivARB), _gloffset_MultiTexCoord4ivARB },
- { "glMultiTexCoord4sARB", (GLvoid *) NAME(glMultiTexCoord4sARB), _gloffset_MultiTexCoord4sARB },
- { "glMultiTexCoord4svARB", (GLvoid *) NAME(glMultiTexCoord4svARB), _gloffset_MultiTexCoord4svARB },
-#undef NAME
-
- /* ARB 3. GL_ARB_transpose_matrix */
-#ifdef GL_ARB_transpose_matrix
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) NotImplemented
-#endif
- { "glLoadTransposeMatrixdARB", (GLvoid *) NAME(glLoadTransposeMatrixdARB), _gloffset_LoadTransposeMatrixdARB },
- { "glLoadTransposeMatrixfARB", (GLvoid *) NAME(glLoadTransposeMatrixfARB), _gloffset_LoadTransposeMatrixfARB },
- { "glMultTransposeMatrixdARB", (GLvoid *) NAME(glMultTransposeMatrixdARB), _gloffset_MultTransposeMatrixdARB },
- { "glMultTransposeMatrixfARB", (GLvoid *) NAME(glMultTransposeMatrixfARB), _gloffset_MultTransposeMatrixfARB },
-#undef NAME
-
- /* ARB 5. GL_ARB_multisample */
-#ifdef GL_ARB_multisample
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glSampleCoverageARB", NAME(glSampleCoverageARB), _gloffset_SampleCoverageARB },
-#undef NAME
-
- /* ARB 12. GL_ARB_texture_compression */
-#ifdef GL_ARB_texture_compression
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glCompressedTexImage3DARB", NAME(glCompressedTexImage3DARB), _gloffset_CompressedTexImage3DARB },
- { "glCompressedTexImage2DARB", NAME(glCompressedTexImage2DARB), _gloffset_CompressedTexImage2DARB },
- { "glCompressedTexImage1DARB", NAME(glCompressedTexImage1DARB), _gloffset_CompressedTexImage1DARB },
- { "glCompressedTexSubImage3DARB", NAME(glCompressedTexSubImage3DARB), _gloffset_CompressedTexSubImage3DARB },
- { "glCompressedTexSubImage2DARB", NAME(glCompressedTexSubImage2DARB), _gloffset_CompressedTexSubImage2DARB },
- { "glCompressedTexSubImage1DARB", NAME(glCompressedTexSubImage1DARB), _gloffset_CompressedTexSubImage1DARB },
- { "glGetCompressedTexImageARB", NAME(glGetCompressedTexImageARB), _gloffset_GetCompressedTexImageARB },
-#undef NAME
-
- /* 2. GL_EXT_blend_color */
-#ifdef GL_EXT_blend_color
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glBlendColorEXT", NAME(glBlendColorEXT), _gloffset_BlendColor },
-#undef NAME
-
- /* 3. GL_EXT_polygon_offset */
-#ifdef GL_EXT_polygon_offset
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glPolygonOffsetEXT", NAME(glPolygonOffsetEXT), _gloffset_PolygonOffsetEXT },
-#undef NAME
-
- /* 6. GL_EXT_texture3D */
-#ifdef GL_EXT_texture3D
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glCopyTexSubImage3DEXT", NAME(glCopyTexSubImage3DEXT), _gloffset_CopyTexSubImage3D },
- { "glTexImage3DEXT", NAME(glTexImage3DEXT), _gloffset_TexImage3D },
- { "glTexSubImage3DEXT", NAME(glTexSubImage3DEXT), _gloffset_TexSubImage3D },
-#undef NAME
-
- /* 7. GL_SGI_texture_filter4 */
-#ifdef GL_SGI_texture_filter4
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glGetTexFilterFuncSGIS", NAME(glGetTexFilterFuncSGIS), _gloffset_GetTexFilterFuncSGIS },
- { "glTexFilterFuncSGIS", NAME(glTexFilterFuncSGIS), _gloffset_TexFilterFuncSGIS },
-#undef NAME
-
- /* 9. GL_EXT_subtexture */
-#ifdef GL_EXT_subtexture
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glTexSubImage1DEXT", NAME(glTexSubImage1DEXT), _gloffset_TexSubImage1D },
- { "glTexSubImage2DEXT", NAME(glTexSubImage2DEXT), _gloffset_TexSubImage2D },
-#undef NAME
-
- /* 10. GL_EXT_copy_texture */
-#ifdef GL_EXT_copy_texture
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glCopyTexImage1DEXT", NAME(glCopyTexImage1DEXT), _gloffset_CopyTexImage1D },
- { "glCopyTexImage2DEXT", NAME(glCopyTexImage2DEXT), _gloffset_CopyTexImage2D },
- { "glCopyTexSubImage1DEXT", NAME(glCopyTexSubImage1DEXT), _gloffset_CopyTexSubImage1D },
- { "glCopyTexSubImage2DEXT", NAME(glCopyTexSubImage2DEXT), _gloffset_CopyTexSubImage2D },
-#undef NAME
-
- /* 11. GL_EXT_histogram */
-#ifdef GL_EXT_histogram
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glGetHistogramEXT", NAME(glGetHistogramEXT), _gloffset_GetHistogramEXT },
- { "glGetHistogramParameterfvEXT", NAME(glGetHistogramParameterfvEXT), _gloffset_GetHistogramParameterfvEXT },
- { "glGetHistogramParameterivEXT", NAME(glGetHistogramParameterivEXT), _gloffset_GetHistogramParameterivEXT },
- { "glGetMinmaxEXT", NAME(glGetMinmaxEXT), _gloffset_GetMinmaxEXT },
- { "glGetMinmaxParameterfvEXT", NAME(glGetMinmaxParameterfvEXT), _gloffset_GetMinmaxParameterfvEXT },
- { "glGetMinmaxParameterivEXT", NAME(glGetMinmaxParameterivEXT), _gloffset_GetMinmaxParameterivEXT },
- { "glHistogramEXT", NAME(glHistogramEXT), _gloffset_Histogram },
- { "glMinmaxEXT", NAME(glMinmaxEXT), _gloffset_Minmax },
- { "glResetHistogramEXT", NAME(glResetHistogramEXT), _gloffset_ResetHistogram },
- { "glResetMinmaxEXT", NAME(glResetMinmaxEXT), _gloffset_ResetMinmax },
-#undef NAME
-
- /* 12. GL_EXT_convolution */
-#ifdef GL_EXT_convolution
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glConvolutionFilter1DEXT", NAME(glConvolutionFilter1DEXT), _gloffset_ConvolutionFilter1D },
- { "glConvolutionFilter2DEXT", NAME(glConvolutionFilter2DEXT), _gloffset_ConvolutionFilter2D },
- { "glConvolutionParameterfEXT", NAME(glConvolutionParameterfEXT), _gloffset_ConvolutionParameterf },
- { "glConvolutionParameterfvEXT", NAME(glConvolutionParameterfvEXT), _gloffset_ConvolutionParameterfv },
- { "glConvolutionParameteriEXT", NAME(glConvolutionParameteriEXT), _gloffset_ConvolutionParameteri },
- { "glConvolutionParameterivEXT", NAME(glConvolutionParameterivEXT), _gloffset_ConvolutionParameteriv },
- { "glCopyConvolutionFilter1DEXT", NAME(glCopyConvolutionFilter1DEXT), _gloffset_CopyConvolutionFilter1D },
- { "glCopyConvolutionFilter2DEXT", NAME(glCopyConvolutionFilter2DEXT), _gloffset_CopyConvolutionFilter2D },
- { "glGetConvolutionFilterEXT", NAME(glGetConvolutionFilterEXT), _gloffset_GetConvolutionFilterEXT },
- { "glGetConvolutionParameterivEXT", NAME(glGetConvolutionParameterivEXT), _gloffset_GetConvolutionParameterivEXT },
- { "glGetConvolutionParameterfvEXT", NAME(glGetConvolutionParameterfvEXT), _gloffset_GetConvolutionParameterfvEXT },
- { "glGetSeparableFilterEXT", NAME(glGetSeparableFilterEXT), _gloffset_GetSeparableFilterEXT },
- { "glSeparableFilter2DEXT", NAME(glSeparableFilter2DEXT), _gloffset_SeparableFilter2D },
-#undef NAME
-
- /* 14. GL_SGI_color_table */
-#ifdef GL_SGI_color_table
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glColorTableSGI", NAME(glColorTableSGI), _gloffset_ColorTable },
- { "glColorTableParameterfvSGI", NAME(glColorTableParameterfvSGI), _gloffset_ColorTableParameterfv },
- { "glColorTableParameterivSGI", NAME(glColorTableParameterivSGI), _gloffset_ColorTableParameteriv },
- { "glCopyColorTableSGI", NAME(glCopyColorTableSGI), _gloffset_CopyColorTable },
- { "glGetColorTableSGI", NAME(glGetColorTableSGI), _gloffset_GetColorTableSGI },
- { "glGetColorTableParameterfvSGI", NAME(glGetColorTableParameterfvSGI), _gloffset_GetColorTableParameterfvSGI },
- { "glGetColorTableParameterivSGI", NAME(glGetColorTableParameterivSGI), _gloffset_GetColorTableParameterivSGI },
-#undef NAME
-
- /* 15. GL_SGIS_pixel_texture */
-#ifdef GL_SGIS_pixel_texture
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glPixelTexGenParameterfSGIS", NAME(glPixelTexGenParameterfSGIS), _gloffset_PixelTexGenParameterfSGIS },
- { "glPixelTexGenParameterfvSGIS", NAME(glPixelTexGenParameterfvSGIS), _gloffset_PixelTexGenParameterfvSGIS },
- { "glPixelTexGenParameteriSGIS", NAME(glPixelTexGenParameteriSGIS), _gloffset_PixelTexGenParameteriSGIS },
- { "glPixelTexGenParameterivSGIS", NAME(glPixelTexGenParameterivSGIS), _gloffset_PixelTexGenParameterivSGIS },
- { "glGetPixelTexGenParameterfvSGIS", NAME(glGetPixelTexGenParameterfvSGIS), _gloffset_GetPixelTexGenParameterfvSGIS },
- { "glGetPixelTexGenParameterivSGIS", NAME(glGetPixelTexGenParameterivSGIS), _gloffset_GetPixelTexGenParameterivSGIS },
-#undef NAME
-
- /* 15a. GL_SGIX_pixel_texture */
-#ifdef GL_SGIX_pixel_texture
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glPixelTexGenSGIX", NAME(glPixelTexGenSGIX), _gloffset_PixelTexGenSGIX },
-#undef NAME
-
- /* 16. GL_SGIS_texture4D */
-#ifdef GL_SGIS_texture4D
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glTexImage4DSGIS", NAME(glTexImage4DSGIS), _gloffset_TexImage4DSGIS },
- { "glTexSubImage4DSGIS", NAME(glTexSubImage4DSGIS), _gloffset_TexSubImage4DSGIS },
-#undef NAME
-
- /* 20. GL_EXT_texture_object */
-#ifdef GL_EXT_texture_object
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glAreTexturesResidentEXT", NAME(glAreTexturesResidentEXT), _gloffset_AreTexturesResidentEXT },
- { "glBindTextureEXT", NAME(glBindTextureEXT), _gloffset_BindTexture },
- { "glDeleteTexturesEXT", NAME(glDeleteTexturesEXT), _gloffset_DeleteTextures },
- { "glGenTexturesEXT", NAME(glGenTexturesEXT), _gloffset_GenTexturesEXT },
- { "glIsTextureEXT", NAME(glIsTextureEXT), _gloffset_IsTextureEXT },
- { "glPrioritizeTexturesEXT", NAME(glPrioritizeTexturesEXT), _gloffset_PrioritizeTextures },
-#undef NAME
-
- /* 21. GL_SGIS_detail_texture */
-#ifdef GL_SGIS_detail_texture
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glDetailTexFuncSGIS", NAME(glDetailTexFuncSGIS), _gloffset_DetailTexFuncSGIS },
- { "glGetDetailTexFuncSGIS", NAME(glGetDetailTexFuncSGIS), _gloffset_GetDetailTexFuncSGIS },
-#undef NAME
-
- /* 22. GL_SGIS_sharpen_texture */
-#ifdef GL_SGIS_sharpen_texture
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glGetSharpenTexFuncSGIS", NAME(glGetSharpenTexFuncSGIS), _gloffset_GetSharpenTexFuncSGIS },
- { "glSharpenTexFuncSGIS", NAME(glSharpenTexFuncSGIS), _gloffset_SharpenTexFuncSGIS },
-#undef NAME
-
- /* 25. GL_SGIS_multisample */
-#ifdef GL_SGIS_multisample
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glSampleMaskSGIS", NAME(glSampleMaskSGIS), _gloffset_SampleMaskSGIS },
- { "glSamplePatternSGIS", NAME(glSamplePatternSGIS), _gloffset_SamplePatternSGIS },
-#undef NAME
-
- /* 30. GL_EXT_vertex_array */
-#ifdef GL_EXT_vertex_array
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glArrayElementEXT", NAME(glArrayElementEXT), _gloffset_ArrayElement },
- { "glColorPointerEXT", NAME(glColorPointerEXT), _gloffset_ColorPointerEXT },
- { "glDrawArraysEXT", NAME(glDrawArraysEXT), _gloffset_DrawArrays },
- { "glEdgeFlagPointerEXT", NAME(glEdgeFlagPointerEXT), _gloffset_EdgeFlagPointerEXT },
- { "glGetPointervEXT", NAME(glGetPointervEXT), _gloffset_GetPointerv },
- { "glIndexPointerEXT", NAME(glIndexPointerEXT), _gloffset_IndexPointerEXT },
- { "glNormalPointerEXT", NAME(glNormalPointerEXT), _gloffset_NormalPointerEXT },
- { "glTexCoordPointerEXT", NAME(glTexCoordPointerEXT), _gloffset_TexCoordPointerEXT },
- { "glVertexPointerEXT", NAME(glVertexPointerEXT), _gloffset_VertexPointerEXT },
-#undef NAME
-
- /* 37. GL_EXT_blend_minmax */
-#ifdef GL_EXT_blend_minmax
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glBlendEquationEXT", NAME(glBlendEquationEXT), _gloffset_BlendEquation },
-#undef NAME
-
- /* 52. GL_SGIX_sprite */
-#ifdef GL_SGIX_sprite
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glSpriteParameterfSGIX", NAME(glSpriteParameterfSGIX), _gloffset_SpriteParameterfSGIX },
- { "glSpriteParameterfvSGIX", NAME(glSpriteParameterfvSGIX), _gloffset_SpriteParameterfvSGIX },
- { "glSpriteParameteriSGIX", NAME(glSpriteParameteriSGIX), _gloffset_SpriteParameteriSGIX },
- { "glSpriteParameterivSGIX", NAME(glSpriteParameterivSGIX), _gloffset_SpriteParameterivSGIX },
-#undef NAME
-
- /* 54. GL_EXT_point_parameters */
-#ifdef GL_EXT_point_parameters
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glPointParameterfEXT", NAME(glPointParameterfEXT), _gloffset_PointParameterfEXT },
- { "glPointParameterfvEXT", NAME(glPointParameterfvEXT), _gloffset_PointParameterfvEXT },
- { "glPointParameterfSGIS", NAME(glPointParameterfSGIS), _gloffset_PointParameterfEXT },
- { "glPointParameterfvSGIS", NAME(glPointParameterfvSGIS), _gloffset_PointParameterfvEXT },
-#undef NAME
-
- /* 55. GL_SGIX_instruments */
-#ifdef GL_SGIX_instruments
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glInstrumentsBufferSGIX", NAME(glInstrumentsBufferSGIX), _gloffset_InstrumentsBufferSGIX },
- { "glStartInstrumentsSGIX", NAME(glStartInstrumentsSGIX), _gloffset_StartInstrumentsSGIX },
- { "glStopInstrumentsSGIX", NAME(glStopInstrumentsSGIX), _gloffset_StopInstrumentsSGIX },
- { "glReadInstrumentsSGIX", NAME(glReadInstrumentsSGIX), _gloffset_ReadInstrumentsSGIX },
- { "glPollInstrumentsSGIX", NAME(glPollInstrumentsSGIX), _gloffset_PollInstrumentsSGIX },
- { "glGetInstrumentsSGIX", NAME(glGetInstrumentsSGIX), _gloffset_GetInstrumentsSGIX },
-#undef NAME
-
- /* 57. GL_SGIX_framezoom */
-#ifdef GL_SGIX_framezoom
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glFrameZoomSGIX", NAME(glFrameZoomSGIX), _gloffset_FrameZoomSGIX },
-#undef NAME
-
- /* 58. GL_SGIX_tag_sample_buffer */
-#ifdef GL_SGIX_tag_sample_buffer
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glTagSampleBufferSGIX", NAME(glTagSampleBufferSGIX), _gloffset_TagSampleBufferSGIX },
-#undef NAME
-
- /* 60. GL_SGIX_reference_plane */
-#ifdef GL_SGIX_reference_plane
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glReferencePlaneSGIX", NAME(glReferencePlaneSGIX), _gloffset_ReferencePlaneSGIX },
-#undef NAME
-
- /* 61. GL_SGIX_flush_raster */
-#ifdef GL_SGIX_flush_raster
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glFlushRasterSGIX", NAME(glFlushRasterSGIX), _gloffset_FlushRasterSGIX },
-#undef NAME
-
- /* 66. GL_HP_image_transform */
-#if 0
-#ifdef GL_HP_image_transform
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glGetImageTransformParameterfvHP", NAME(glGetImageTransformParameterfvHP), _gloffset_GetImageTransformParameterfvHP },
- { "glGetImageTransformParameterivHP", NAME(glGetImageTransformParameterivHP), _gloffset_GetImageTransformParameterivHP },
- { "glImageTransformParameterfHP", NAME(glImageTransformParameterfHP), _gloffset_ImageTransformParameterfHP },
- { "glImageTransformParameterfvHP", NAME(glImageTransformParameterfvHP), _gloffset_ImageTransformParameterfvHP },
- { "glImageTransformParameteriHP", NAME(glImageTransformParameteriHP), _gloffset_ImageTransformParameteriHP },
- { "glImageTransformParameterivHP", NAME(glImageTransformParameterivHP), _gloffset_ImageTransformParameterivHP },
-#undef NAME
-#endif
-
- /* 74. GL_EXT_color_subtable */
-#ifdef GL_EXT_color_subtable
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glColorSubTableEXT", NAME(glColorSubTableEXT), _gloffset_ColorSubTable },
- { "glCopyColorSubTableEXT", NAME(glCopyColorSubTableEXT), _gloffset_CopyColorSubTable },
-#undef NAME
-
- /* 77. GL_PGI_misc_hints */
-#ifdef GL_PGI_misc_hints
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glHintPGI", NAME(glHintPGI), _gloffset_HintPGI },
-#undef NAME
-
- /* 78. GL_EXT_paletted_texture */
-#ifdef GL_EXT_paletted_texture
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glColorTableEXT", NAME(glColorTableEXT), _gloffset_ColorTable },
- { "glGetColorTableEXT", NAME(glGetColorTableEXT), _gloffset_GetColorTable },
- { "glGetColorTableParameterfvEXT", NAME(glGetColorTableParameterfvEXT), _gloffset_GetColorTableParameterfv },
- { "glGetColorTableParameterivEXT", NAME(glGetColorTableParameterivEXT), _gloffset_GetColorTableParameteriv },
-#undef NAME
-
- /* 80. GL_SGIX_list_priority */
-#ifdef GL_SGIX_list_priority
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glGetListParameterfvSGIX", NAME(glGetListParameterfvSGIX), _gloffset_GetListParameterfvSGIX },
- { "glGetListParameterivSGIX", NAME(glGetListParameterivSGIX), _gloffset_GetListParameterivSGIX },
- { "glListParameterfSGIX", NAME(glListParameterfSGIX), _gloffset_ListParameterfSGIX },
- { "glListParameterfvSGIX", NAME(glListParameterfvSGIX), _gloffset_ListParameterfvSGIX },
- { "glListParameteriSGIX", NAME(glListParameteriSGIX), _gloffset_ListParameteriSGIX },
- { "glListParameterivSGIX", NAME(glListParameterivSGIX), _gloffset_ListParameterivSGIX },
-#undef NAME
-
- /* 94. GL_EXT_index_material */
-#ifdef GL_EXT_index_material
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glIndexMaterialEXT", NAME(glIndexMaterialEXT), _gloffset_IndexMaterialEXT },
-#undef NAME
-
- /* 95. GL_EXT_index_func */
-#ifdef GL_EXT_index_func
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glIndexFuncEXT", NAME(glIndexFuncEXT), _gloffset_IndexFuncEXT },
-#undef NAME
-
- /* 97. GL_EXT_compiled_vertex_array */
-#ifdef GL_EXT_compiled_vertex_array
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glLockArraysEXT", NAME(glLockArraysEXT), _gloffset_LockArraysEXT },
- { "glUnlockArraysEXT", NAME(glUnlockArraysEXT), _gloffset_UnlockArraysEXT },
-#undef NAME
-
- /* 98. GL_EXT_cull_vertex */
-#ifdef GL_EXT_cull_vertex
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glCullParameterfvEXT", NAME(glCullParameterfvEXT), _gloffset_CullParameterfvEXT },
- { "glCullParameterdvEXT", NAME(glCullParameterdvEXT), _gloffset_CullParameterdvEXT },
-#undef NAME
-
- /* 102. GL_SGIX_fragment_lighting */
-#ifdef GL_SGIX_fragment_lighting
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glFragmentColorMaterialSGIX", NAME(glFragmentColorMaterialSGIX), _gloffset_FragmentColorMaterialSGIX },
- { "glFragmentLightfSGIX", NAME(glFragmentLightfSGIX), _gloffset_FragmentLightfSGIX },
- { "glFragmentLightfvSGIX", NAME(glFragmentLightfvSGIX), _gloffset_FragmentLightfvSGIX },
- { "glFragmentLightiSGIX", NAME(glFragmentLightiSGIX), _gloffset_FragmentLightiSGIX },
- { "glFragmentLightivSGIX", NAME(glFragmentLightivSGIX), _gloffset_FragmentLightivSGIX },
- { "glFragmentLightModelfSGIX", NAME(glFragmentLightModelfSGIX), _gloffset_FragmentLightModelfSGIX },
- { "glFragmentLightModelfvSGIX", NAME(glFragmentLightModelfvSGIX), _gloffset_FragmentLightModelfvSGIX },
- { "glFragmentLightModeliSGIX", NAME(glFragmentLightModeliSGIX), _gloffset_FragmentLightModeliSGIX },
- { "glFragmentLightModelivSGIX", NAME(glFragmentLightModelivSGIX), _gloffset_FragmentLightModelivSGIX },
- { "glFragmentMaterialfSGIX", NAME(glFragmentMaterialfSGIX), _gloffset_FragmentMaterialfSGIX },
- { "glFragmentMaterialfvSGIX", NAME(glFragmentMaterialfvSGIX), _gloffset_FragmentMaterialfvSGIX },
- { "glFragmentMaterialiSGIX", NAME(glFragmentMaterialiSGIX), _gloffset_FragmentMaterialiSGIX },
- { "glFragmentMaterialivSGIX", NAME(glFragmentMaterialivSGIX), _gloffset_FragmentMaterialivSGIX },
- { "glGetFragmentLightfvSGIX", NAME(glGetFragmentLightfvSGIX), _gloffset_GetFragmentLightfvSGIX },
- { "glGetFragmentLightivSGIX", NAME(glGetFragmentLightivSGIX), _gloffset_GetFragmentLightivSGIX },
- { "glGetFragmentMaterialfvSGIX", NAME(glGetFragmentMaterialfvSGIX), _gloffset_GetFragmentMaterialfvSGIX },
- { "glGetFragmentMaterialivSGIX", NAME(glGetFragmentMaterialivSGIX), _gloffset_GetFragmentMaterialivSGIX },
- { "glLightEnviSGIX", NAME(glLightEnviSGIX), _gloffset_LightEnviSGIX },
-#undef NAME
-
- /* 112. GL_EXT_draw_range_elements */
-#if 000
-#ifdef GL_EXT_draw_range_elements
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glDrawRangeElementsEXT", NAME(glDrawRangeElementsEXT), _gloffset_DrawRangeElementsEXT },
-#undef NAME
-#endif
-
- /* 117. GL_EXT_light_texture */
-#if 000
-#ifdef GL_EXT_light_texture
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glApplyTextureEXT", NAME(glApplyTextureEXT), _gloffset_ApplyTextureEXT },
- { "glTextureLightEXT", NAME(glTextureLightEXT), _gloffset_TextureLightEXT },
- { "glTextureMaterialEXT", NAME(glTextureMaterialEXT), _gloffset_TextureMaterialEXT },
-#undef NAME
-
- /* 135. GL_INTEL_texture_scissor */
-#ifdef GL_INTEL_texture_scissor
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glTexScissorINTEL", NAME(glTexScissorINTEL), _gloffset_TexScissorINTEL },
- { "glTexScissorFuncINTEL", NAME(glTexScissorFuncINTEL), _gloffset_glTexScissorFuncINTEL },
-#undef NAME
-
- /* 136. GL_INTEL_parallel_arrays */
-#ifdef GL_INTEL_parallel_arrays
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glVertexPointervINTEL", NAME(glVertexPointervINTEL), _gloffset_VertexPointervINTEL },
- { "glNormalPointervINTEL", NAME(glNormalPointervINTEL), _gloffset_NormalPointervINTEL },
- { "glColorPointervINTEL", NAME(glColorPointervINTEL), _gloffset_ColorPointervINTEL },
- { "glTexCoordPointervINTEL", NAME(glTexCoordPointervINTEL), _gloffset_glxCoordPointervINTEL },
-#undef NAME
-#endif
-
- /* 138. GL_EXT_pixel_transform */
-#if 000
-#ifdef GL_EXT_pixel_transform
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glPixelTransformParameteriEXT", NAME(glPixelTransformParameteriEXT), _gloffset_PixelTransformParameteriEXT },
- { "glPixelTransformParameterfEXT", NAME(glPixelTransformParameterfEXT), _gloffset_PixelTransformParameterfEXT },
- { "glPixelTransformParameterivEXT", NAME(glPixelTransformParameterivEXT), _gloffset_PixelTransformParameterivEXT },
- { "glPixelTransformParameterfvEXT", NAME(glPixelTransformParameterfvEXT), _gloffset_PixelTransformParameterfvEXT },
- { "glGetPixelTransformParameterivEXT", NAME(glGetPixelTransformParameterivEXT), _gloffset_GetPixelTransformParameterivEXT },
- { "glGetPixelTransformParameterfvEXT", NAME(glGetPixelTransformParameterfvEXT), _gloffset_GetPixelTransformParameterfvEXT },
-#undef NAME
-#endif
-
- /* 145. GL_EXT_secondary_color */
-#ifdef GL_EXT_secondary_color
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glSecondaryColor3bEXT", NAME(glSecondaryColor3bEXT), _gloffset_SecondaryColor3bEXT },
- { "glSecondaryColor3dEXT", NAME(glSecondaryColor3dEXT), _gloffset_SecondaryColor3dEXT },
- { "glSecondaryColor3fEXT", NAME(glSecondaryColor3fEXT), _gloffset_SecondaryColor3fEXT },
- { "glSecondaryColor3iEXT", NAME(glSecondaryColor3iEXT), _gloffset_SecondaryColor3iEXT },
- { "glSecondaryColor3sEXT", NAME(glSecondaryColor3sEXT), _gloffset_SecondaryColor3sEXT },
- { "glSecondaryColor3ubEXT", NAME(glSecondaryColor3ubEXT), _gloffset_SecondaryColor3ubEXT },
- { "glSecondaryColor3uiEXT", NAME(glSecondaryColor3uiEXT), _gloffset_SecondaryColor3uiEXT },
- { "glSecondaryColor3usEXT", NAME(glSecondaryColor3usEXT), _gloffset_SecondaryColor3usEXT },
- { "glSecondaryColor3bvEXT", NAME(glSecondaryColor3bvEXT), _gloffset_SecondaryColor3bvEXT },
- { "glSecondaryColor3dvEXT", NAME(glSecondaryColor3dvEXT), _gloffset_SecondaryColor3dvEXT },
- { "glSecondaryColor3fvEXT", NAME(glSecondaryColor3fvEXT), _gloffset_SecondaryColor3fvEXT },
- { "glSecondaryColor3ivEXT", NAME(glSecondaryColor3ivEXT), _gloffset_SecondaryColor3ivEXT },
- { "glSecondaryColor3svEXT", NAME(glSecondaryColor3svEXT), _gloffset_SecondaryColor3svEXT },
- { "glSecondaryColor3ubvEXT", NAME(glSecondaryColor3ubvEXT), _gloffset_SecondaryColor3ubvEXT },
- { "glSecondaryColor3uivEXT", NAME(glSecondaryColor3uivEXT), _gloffset_SecondaryColor3uivEXT },
- { "glSecondaryColor3usvEXT", NAME(glSecondaryColor3usvEXT), _gloffset_SecondaryColor3usvEXT },
- { "glSecondaryColorPointerEXT", NAME(glSecondaryColorPointerEXT), _gloffset_SecondaryColorPointerEXT },
-#undef NAME
-
- /* 147. GL_EXT_texture_perturb_normal */
-#if 000
-#ifdef GL_EXT_texture_perturb_normal
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glTextureNormalEXT", NAME(glTextureNormalEXT), _gloffset_TextureNormalEXT },
-#undef NAME
-#endif
-
- /* 148. GL_EXT_multi_draw_arrays */
-#if 000
-#ifdef GL_EXT_multi_draw_arrays
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glMultiDrawArraysEXT", NAME(glMultiDrawArraysEXT), _gloffset_MultiDrawArraysEXT },
-#undef NAME
-#endif
-
- /* 149. GL_EXT_fog_coord */
-#ifdef GL_EXT_fog_coord
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glFogCoordfEXT", NAME(glFogCoordfEXT), _gloffset_FogCoordfEXT },
- { "glFogCoordfvEXT", NAME(glFogCoordfvEXT), _gloffset_FogCoordfvEXT },
- { "glFogCoorddEXT", NAME(glFogCoorddEXT), _gloffset_FogCoorddEXT },
- { "glFogCoorddvEXT", NAME(glFogCoorddvEXT), _gloffset_FogCoorddvEXT },
- { "glFogCoordPointerEXT", NAME(glFogCoordPointerEXT), _gloffset_FogCoordPointerEXT },
-#undef NAME
-
- /* 156. GL_EXT_coordinate_frame */
-#if 000
-#ifdef GL_EXT_coordinate_frame
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glTangent3bEXT", NAME(glTangent3bEXT), _gloffset_Tangent3bEXT },
- { "glTangent3dEXT", NAME(glTangent3dEXT), _gloffset_Tangent3dEXT },
- { "glTangent3fEXT", NAME(glTangent3fEXT), _gloffset_Tangent3fEXT },
- { "glTangent3iEXT", NAME(glTangent3iEXT), _gloffset_Tangent3iEXT },
- { "glTangent3sEXT", NAME(glTangent3sEXT), _gloffset_Tangent3sEXT },
- { "glTangent3bvEXT", NAME(glTangent3bvEXT), _gloffset_Tangent3bvEXT },
- { "glTangent3dvEXT", NAME(glTangent3dvEXT), _gloffset_Tangent3dvEXT },
- { "glTangent3fvEXT", NAME(glTangent3fvEXT), _gloffset_Tangent3fvEXT },
- { "glTangent3ivEXT", NAME(glTangent3ivEXT), _gloffset_Tangent3ivEXT },
- { "glTangent3svEXT", NAME(glTangent3svEXT), _gloffset_Tangent3svEXT },
- { "glBinormal3bEXT", NAME(glBinormal3bEXT), _gloffset_Binormal3bEXT },
- { "glBinormal3dEXT", NAME(glBinormal3dEXT), _gloffset_Binormal3dEXT },
- { "glBinormal3fEXT", NAME(glBinormal3fEXT), _gloffset_Binormal3fEXT },
- { "glBinormal3iEXT", NAME(glBinormal3iEXT), _gloffset_Binormal3iEXT },
- { "glBinormal3sEXT", NAME(glBinormal3sEXT), _gloffset_Binormal3sEXT },
- { "glBinormal3bvEXT", NAME(glBinormal3bvEXT), _gloffset_Binormal3bvEXT },
- { "glBinormal3dvEXT", NAME(glBinormal3dvEXT), _gloffset_Binormal3dvEXT },
- { "glBinormal3fvEXT", NAME(glBinormal3fvEXT), _gloffset_Binormal3fvEXT },
- { "glBinormal3ivEXT", NAME(glBinormal3ivEXT), _gloffset_Binormal3ivEXT },
- { "glBinormal3svEXT", NAME(glBinormal3svEXT), _gloffset_Binormal3svEXT },
- { "glTangentPointerEXT", NAME(glTangentPointerEXT), _gloffset_TangentPointerEXT },
- { "glBinormalPointerEXT", NAME(glBinormalPointerEXT), _gloffset_BinormalPointerEXT },
-#undef NAME
-#endif
-
- /* 164. GL_SUN_global_alpha */
-#if 000
-#ifdef GL_SUN_global_alpha
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glGlobalAlphaFactorbSUN", NAME(glGlobalAlphaFactorbSUN), _gloffset_GlobalAlphaFactorbSUN },
- { "glGlobalAlphaFactorsSUN", NAME(glGlobalAlphaFactorsSUN), _gloffset_GlobalAlphaFactorsSUN },
- { "glGlobalAlphaFactoriSUN", NAME(glGlobalAlphaFactoriSUN), _gloffset_GlobalAlphaFactoriSUN },
- { "glGlobalAlphaFactorfSUN", NAME(glGlobalAlphaFactorfSUN), _gloffset_GlobalAlphaFactorfSUN },
- { "glGlobalAlphaFactordSUN", NAME(glGlobalAlphaFactordSUN), _gloffset_GlobalAlphaFactordSUN },
- { "glGlobalAlphaFactorubSUN", NAME(glGlobalAlphaFactorubSUN), _gloffset_GlobalAlphaFactorubSUN },
- { "glGlobalAlphaFactorusSUN", NAME(glGlobalAlphaFactorusSUN), _gloffset_GlobalAlphaFactorusSUN },
- { "glGlobalAlphaFactoruiSUN", NAME(glGlobalAlphaFactoruiSUN), _gloffset_GlobalAlphaFactoruiSUN },
-#undef NAME
-#endif
-
- /* 165. GL_SUN_triangle_list */
-#if 000
-#ifdef GL_SUN_triangle_list
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glReplacementCodeuiSUN", NAME(glReplacementCodeuiSUN), _gloffset_ReplacementCodeuiSUN },
- { "glReplacementCodeusSUN", NAME(glReplacementCodeusSUN), _gloffset_ReplacementCodeusSUN },
- { "glReplacementCodeubSUN", NAME(glReplacementCodeubSUN), _gloffset_ReplacementCodeubSUN },
- { "glReplacementCodeuivSUN", NAME(glReplacementCodeuivSUN), _gloffset_ReplacementCodeuivSUN },
- { "glReplacementCodeusvSUN", NAME(glReplacementCodeusvSUN), _gloffset_ReplacementCodeusvSUN },
- { "glReplacementCodeubvSUN", NAME(glReplacementCodeubvSUN), _gloffset_ReplacementCodeubvSUN },
- { "glReplacementCodePointerSUN", NAME(glReplacementCodePointerSUN), _gloffset_ReplacementCodePointerSUN },
-#undef NAME
-#endif
-
- /* 166. GL_SUN_vertex */
-#if 000
-#ifdef GL_SUN_vertex
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glColor4ubVertex2fSUN", NAME(glColor4ubVertex2fSUN), _gloffset_Color4ubVertex2fSUN },
- { "glColor4ubVertex2fvSUN", NAME(glColor4ubVertex2fvSUN), _gloffset_Color4ubVertex2fvSUN },
- { "glColor4ubVertex3fSUN", NAME(glColor4ubVertex3fSUN), _gloffset_Color4ubVertex3fSUN },
- { "glColor4ubVertex3fvSUN", NAME(glColor4ubVertex3fvSUN), _gloffset_Color4ubVertex3fvSUN },
- { "glColor3fVertex3fSUN", NAME(glColor3fVertex3fSUN), _gloffset_Color3fVertex3fSUN },
- { "glColor3fVertex3fvSUN", NAME(glColor3fVertex3fvSUN), _gloffset_Color3fVertex3fvSUN },
- { "glNormal3fVertex3fSUN", NAME(glNormal3fVertex3fSUN), _gloffset_Normal3fVertex3fSUN },
- { "glNormal3fVertex3fvSUN", NAME(glNormal3fVertex3fvSUN), _gloffset_Normal3fVertex3fvSUN },
- { "glColor4fNormal3fVertex3fSUN", NAME(glColor4fNormal3fVertex3fSUN), _gloffset_Color4fNormal3fVertex3fSUN },
- { "glColor4fNormal3fVertex3fvSUN", NAME(glColor4fNormal3fVertex3fvSUN), _gloffset_Color4fNormal3fVertex3fvSUN },
- { "glTexCoord2fVertex3fSUN", NAME(glTexCoord2fVertex3fSUN), _gloffset_TexCoord2fVertex3fSUN },
- { "glTexCoord2fVertex3fvSUN", NAME(glTexCoord2fVertex3fvSUN), _gloffset_TexCoord2fVertex3fvSUN },
- { "glTexCoord4fVertex4fSUN", NAME(glTexCoord4fVertex4fSUN), _gloffset_TexCoord4fVertex4fSUN },
- { "glTexCoord4fVertex4fvSUN", NAME(glTexCoord4fVertex4fvSUN), _gloffset_TexCoord4fVertex4fvSUN },
- { "glTexCoord2fColor4ubVertex3fSUN", NAME(glTexCoord2fColor4ubVertex3fSUN), _gloffset_TexCoord2fColor4ubVertex3fSUN },
- { "glTexCoord2fColor4ubVertex3fvSUN", NAME(glTexCoord2fColor4ubVertex3fvSUN), _gloffset_TexCoord2fColor4ubVertex3fvSUN },
- { "glTexCoord2fColor3fVertex3fSUN", NAME(glTexCoord2fColor3fVertex3fSUN), _gloffset_TexCoord2fColor3fVertex3fSUN },
- { "glTexCoord2fColor3fVertex3fvSUN", NAME(glTexCoord2fColor3fVertex3fvSUN), _gloffset_TexCoord2fColor3fVertex3fvSUN },
- { "glTexCoord2fNormal3fVertex3fSUN", NAME(glTexCoord2fNormal3fVertex3fSUN), _gloffset_TexCoord2fNormal3fVertex3fSUN },
- { "glTexCoord2fNormal3fVertex3fvSUN", NAME(glTexCoord2fNormal3fVertex3fvSUN), _gloffset_TexCoord2fNormal3fVertex3fvSUN },
- { "glTexCoord2fColor4fNormal3fVertex3fSUN", NAME(glTexCoord2fColor4fNormal3fVertex3fSUN), _gloffset_TexCoord2fColor4fNormal3fVertex3fSUN },
- { "glTexCoord2fColor4fNormal3fVertex3fvSUN", NAME(glTexCoord2fColor4fNormal3fVertex3fvSUN), _gloffset_TexCoord2fColor4fNormal3fVertex3fvSUN },
- { "glTexCoord4fColor4fNormal3fVertex4fSUN", NAME(glTexCoord4fColor4fNormal3fVertex4fSUN), _gloffset_TexCoord4fColor4fNormal3fVertex4fSUN },
- { "glTexCoord4fColor4fNormal3fVertex4fvSUN", NAME(glTexCoord4fColor4fNormal3fVertex4fvSUN), _gloffset_TexCoord4fColor4fNormal3fVertex4fvSUN },
- { "glReplacementCodeuiVertex3fSUN", NAME(glReplacementCodeuiVertex3fSUN), _gloffset_ReplacementCodeuiVertex3fSUN },
- { "glReplacementCodeuiVertex3fvSUN", NAME(glReplacementCodeuiVertex3fvSUN), _gloffset_ReplacementCodeuiVertex3fvSUN },
- { "glReplacementCodeuiColor4ubVertex3fSUN", NAME(glReplacementCodeuiColor4ubVertex3fSUN), _gloffset_ReplacementCodeuiColor4ubVertex3fSUN },
- { "glReplacementCodeuiColor4ubVertex3fvSUN", NAME(glReplacementCodeuiColor4ubVertex3fvSUN), _gloffset_ReplacementCodeuiColor4ubVertex3fvSUN },
- { "glReplacementCodeuiColor3fVertex3fSUN", NAME(glReplacementCodeuiColor3fVertex3fSUN), _gloffset_ReplacementCodeuiColor3fVertex3fSUN },
- { "glReplacementCodeuiColor3fVertex3fvSUN", NAME(glReplacementCodeuiColor3fVertex3fvSUN), _gloffset_ReplacementCodeuiColor3fVertex3fvSUN },
- { "glReplacementCodeuiNormal3fVertex3fSUN", NAME(glReplacementCodeuiNormal3fVertex3fSUN), _gloffset_ReplacementCodeuiNormal3fVertex3fSUN },
- { "glReplacementCodeuiNormal3fVertex3fvSUN", NAME(glReplacementCodeuiNormal3fVertex3fvSUN), _gloffset_ReplacementCodeuiNormal3fVertex3fvSUN },
- { "glReplacementCodeuiColor4fNormal3fVertex3fSUN", NAME(glReplacementCodeuiColor4fNormal3fVertex3fSUN), _gloffset_ReplacementCodeuiColor4fNormal3fVertex3fSUN },
- { "glReplacementCodeuiColor4fNormal3fVertex3fvSUN", NAME(glReplacementCodeuiColor4fNormal3fVertex3fvSUN), _gloffset_ReplacementCodeuiColor4fNormal3fVertex3fvSUN },
- { "glReplacementCodeuiTexCoord2fVertex3fSUN", NAME(glReplacementCodeuiTexCoord2fVertex3fSUN), _gloffset_ReplacementCodeuiTexCoord2fVertex3fSUN },
- { "glReplacementCodeuiTexCoord2fVertex3fvSUN", NAME(glReplacementCodeuiTexCoord2fVertex3fvSUN), _gloffset_ReplacementCodeuiTexCoord2fVertex3fvSUN },
- { "glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN", NAME(glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN), _gloffset_ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN },
- { "glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN", NAME(glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN), _gloffset_ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN },
- { "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN", NAME(glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN), _gloffset_ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN },
- { "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN", NAME(glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN), _gloffset_ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN },
-#undef NAME
-#endif
-
- /* 173. GL_EXT/INGR_blend_func_separate */
-#ifdef GL_EXT_blend_func_separate
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glBlendFuncSeparateEXT", NAME(glBlendFuncSeparateEXT), _gloffset_BlendFuncSeparateEXT },
- { "glBlendFuncSeparateINGR", NAME(glBlendFuncSeparateEXT), _gloffset_BlendFuncSeparateEXT },
-#undef NAME
-
- /* 188. GL_EXT_vertex_weighting */
-#ifdef GL_EXT_vertex_weighting
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glVertexWeightfEXT", NAME(glVertexWeightfEXT), _gloffset_VertexWeightfEXT },
- { "glVertexWeightfvEXT", NAME(glVertexWeightfvEXT), _gloffset_VertexWeightfvEXT },
- { "glVertexWeightPointerEXT", NAME(glVertexWeightPointerEXT), _gloffset_VertexWeightPointerEXT },
-#undef NAME
-
- /* 190. GL_NV_vertex_array_range */
-#ifdef GL_NV_vertex_array_range
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glFlushVertexArrayRangeNV", NAME(glFlushVertexArrayRangeNV), _gloffset_FlushVertexArrayRangeNV },
- { "glVertexArrayRangeNV", NAME(glVertexArrayRangeNV), _gloffset_VertexArrayRangeNV },
-#undef NAME
-
- /* 191. GL_NV_register_combiners */
-#ifdef GL_NV_register_combiners
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glCombinerParameterfvNV", NAME(glCombinerParameterfvNV), _gloffset_CombinerParameterfvNV },
- { "glCombinerParameterfNV", NAME(glCombinerParameterfNV), _gloffset_CombinerParameterfNV },
- { "glCombinerParameterivNV", NAME(glCombinerParameterivNV), _gloffset_CombinerParameterivNV },
- { "glCombinerParameteriNV", NAME(glCombinerParameteriNV), _gloffset_CombinerParameteriNV },
- { "glCombinerInputNV", NAME(glCombinerInputNV), _gloffset_CombinerInputNV },
- { "glCombinerOutputNV", NAME(glCombinerOutputNV), _gloffset_CombinerOutputNV },
- { "glFinalCombinerInputNV", NAME(glFinalCombinerInputNV), _gloffset_FinalCombinerInputNV },
- { "glGetCombinerInputParameterfvNV", NAME(glGetCombinerInputParameterfvNV), _gloffset_GetCombinerInputParameterfvNV },
- { "glGetCombinerInputParameterivNV", NAME(glGetCombinerInputParameterivNV), _gloffset_GetCombinerInputParameterivNV },
- { "glGetCombinerOutputParameterfvNV", NAME(glGetCombinerOutputParameterfvNV), _gloffset_GetCombinerOutputParameterfvNV },
- { "glGetCombinerOutputParameterivNV", NAME(glGetCombinerOutputParameterivNV), _gloffset_GetCombinerOutputParameterivNV },
- { "glGetFinalCombinerInputParameterfvNV", NAME(glGetFinalCombinerInputParameterfvNV), _gloffset_GetFinalCombinerInputParameterfvNV },
- { "glGetFinalCombinerInputParameterivNV", NAME(glGetFinalCombinerInputParameterivNV), _gloffset_GetFinalCombinerInputParameterivNV },
-#undef NAME
-
- /* 196. GL_MESA_resize_buffers */
-#ifdef MESA_resize_buffers
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glResizeBuffersMESA", NAME(glResizeBuffersMESA), _gloffset_ResizeBuffersMESA },
-#undef NAME
-
- /* 197. GL_MESA_window_pos */
-#ifdef MESA_window_pos
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glWindowPos2iMESA", NAME(glWindowPos2iMESA), _gloffset_WindowPos2iMESA },
- { "glWindowPos2sMESA", NAME(glWindowPos2sMESA), _gloffset_WindowPos2sMESA },
- { "glWindowPos2fMESA", NAME(glWindowPos2fMESA), _gloffset_WindowPos2fMESA },
- { "glWindowPos2dMESA", NAME(glWindowPos2dMESA), _gloffset_WindowPos2dMESA },
- { "glWindowPos2ivMESA", NAME(glWindowPos2ivMESA), _gloffset_WindowPos2ivMESA },
- { "glWindowPos2svMESA", NAME(glWindowPos2svMESA), _gloffset_WindowPos2svMESA },
- { "glWindowPos2fvMESA", NAME(glWindowPos2fvMESA), _gloffset_WindowPos2fvMESA },
- { "glWindowPos2dvMESA", NAME(glWindowPos2dvMESA), _gloffset_WindowPos2dvMESA },
- { "glWindowPos3iMESA", NAME(glWindowPos3iMESA), _gloffset_WindowPos3iMESA },
- { "glWindowPos3sMESA", NAME(glWindowPos3sMESA), _gloffset_WindowPos3sMESA },
- { "glWindowPos3fMESA", NAME(glWindowPos3fMESA), _gloffset_WindowPos3fMESA },
- { "glWindowPos3dMESA", NAME(glWindowPos3dMESA), _gloffset_WindowPos3dMESA },
- { "glWindowPos3ivMESA", NAME(glWindowPos3ivMESA), _gloffset_WindowPos3ivMESA },
- { "glWindowPos3svMESA", NAME(glWindowPos3svMESA), _gloffset_WindowPos3svMESA },
- { "glWindowPos3fvMESA", NAME(glWindowPos3fvMESA), _gloffset_WindowPos3fvMESA },
- { "glWindowPos3dvMESA", NAME(glWindowPos3dvMESA), _gloffset_WindowPos3dvMESA },
- { "glWindowPos4iMESA", NAME(glWindowPos4iMESA), _gloffset_WindowPos4iMESA },
- { "glWindowPos4sMESA", NAME(glWindowPos4sMESA), _gloffset_WindowPos4sMESA },
- { "glWindowPos4fMESA", NAME(glWindowPos4fMESA), _gloffset_WindowPos4fMESA },
- { "glWindowPos4dMESA", NAME(glWindowPos4dMESA), _gloffset_WindowPos4dMESA },
- { "glWindowPos4ivMESA", NAME(glWindowPos4ivMESA), _gloffset_WindowPos4ivMESA },
- { "glWindowPos4svMESA", NAME(glWindowPos4svMESA), _gloffset_WindowPos4svMESA },
- { "glWindowPos4fvMESA", NAME(glWindowPos4fvMESA), _gloffset_WindowPos4fvMESA },
- { "glWindowPos4dvMESA", NAME(glWindowPos4dvMESA), _gloffset_WindowPos4dvMESA },
-#undef NAME
-
- /* 209. WGL_EXT_multisample */
-#ifdef WGL_EXT_multisample
-#define NAME(X) (GLvoid *) X
-#else
-#define NAME(X) (GLvoid *) NotImplemented
-#endif
- { "glSampleMaskEXT", NAME(glSampleMaskEXT), _gloffset_SampleMaskSGIS },
- { "glSamplePatternEXT", NAME(glSamplePatternEXT), _gloffset_SamplePatternSGIS },
-#undef NAME
-
- { NULL, NULL } /* end of list marker */
-};
+/* The code in this file is auto-generated with Python */
+#include "glprocs.h"
@@ -1787,8 +490,20 @@ get_static_proc_address(const char *funcName)
* Extension function management.
*/
+/*
+ * Number of extension functions which we can dynamically add at runtime.
+ */
+#define MAX_EXTENSION_FUNCS 300
+
+
+/*
+ * The disptach table size (number of entries) is the sizeof the
+ * _glapi_table struct plus the number of dynamic entries we can add.
+ * The extra slots can be filled in by DRI drivers that register new extension
+ * functions.
+ */
+#define DISPATCH_TABLE_SIZE (sizeof(struct _glapi_table) / sizeof(void *) + MAX_EXTENSION_FUNCS)
-#define MAX_EXTENSION_FUNCS 1000
static struct name_address_offset ExtEntryTable[MAX_EXTENSION_FUNCS];
static GLuint NumExtEntryPoints = 0;
@@ -1822,7 +537,7 @@ generate_entrypoint(GLuint functionOffset)
* 14: ff a0 10 32 54 76 jmp *0x76543210(%eax)
* 14 15 16 17 18 19
*/
- static const unsigned char temp[] = {
+ static const unsigned char insn_template[] = {
0xa1, 0x00, 0x00, 0x00, 0x00,
0x85, 0xc0,
0x74, 0x06,
@@ -1830,10 +545,10 @@ generate_entrypoint(GLuint functionOffset)
0xe8, 0x00, 0x00, 0x00, 0x00,
0xff, 0xa0, 0x00, 0x00, 0x00, 0x00
};
- unsigned char *code = malloc(sizeof(temp));
+ unsigned char *code = (unsigned char *) malloc(sizeof(insn_template));
unsigned int next_insn;
if (code) {
- memcpy(code, temp, sizeof(temp));
+ memcpy(code, insn_template, sizeof(insn_template));
*(unsigned int *)(code + 0x01) = (unsigned int)&_glapi_Dispatch;
*(unsigned int *)(code + 0x0b) = (unsigned int)functionOffset * 4;
@@ -1867,7 +582,7 @@ generate_entrypoint(GLuint functionOffset)
0x01000000 /* nop */
};
#endif
- unsigned int *code = malloc(sizeof(insn_template));
+ unsigned int *code = (unsigned int *) malloc(sizeof(insn_template));
unsigned long glapi_addr = (unsigned long) &_glapi_Dispatch;
if (code) {
memcpy(code, insn_template, sizeof(insn_template));
@@ -1893,10 +608,42 @@ generate_entrypoint(GLuint functionOffset)
return code;
#else
return NULL;
-#endif
+#endif /* USE_*_ASM */
}
+/*
+ * This function inserts a new dispatch offset into the assembly language
+ * stub that was generated with the preceeding function.
+ */
+static void
+fill_in_entrypoint_offset(void *entrypoint, GLuint offset)
+{
+#if defined(USE_X86_ASM)
+
+ unsigned char *code = (unsigned char *) entrypoint;
+ *(unsigned int *)(code + 0x0b) = offset * 4;
+ *(unsigned int *)(code + 0x16) = offset * 4;
+
+#elif defined(USE_SPARC_ASM)
+
+ /* XXX this hasn't been tested! */
+ unsigned int *code = (unsigned int *) entrypoint;
+#ifdef __sparc_v9__
+ code[6] = 0x05000000; /* sethi %hi(8 * glapioffset), %g2 */
+ code[7] = 0x8410a000; /* or %g2, %lo(8 * glapioffset), %g2 */
+ code[6] |= ((offset * 8) >> 10);
+ code[7] |= ((offset * 8) & ((1 << 10) - 1));
+ __glapi_sparc_icache_flush(&code[6]);
+#else /* __sparc_v9__ */
+ code[2] = 0xc6006000; /* ld [%g1 + %lo(4*glapioffset)], %g3 */
+ code[2] |= (offset * 4);
+ __glapi_sparc_icache_flush(&code[2]);
+#endif /* __sparc_v9__ */
+
+#endif /* USE_*_ASM */
+}
+
/*
* Add a new extension function entrypoint.
@@ -1905,6 +652,10 @@ generate_entrypoint(GLuint functionOffset)
GLboolean
_glapi_add_entrypoint(const char *funcName, GLuint offset)
{
+ /* trivial rejection test */
+ if (!funcName || funcName[0] != 'g' || funcName[1] != 'l')
+ return GL_FALSE;
+
/* first check if the named function is already statically present */
{
GLint index = get_static_proc_offset(funcName);
@@ -1913,103 +664,56 @@ _glapi_add_entrypoint(const char *funcName, GLuint offset)
}
}
+ /* See if this function has already been dynamically added */
{
- /* make sure this offset/name pair is legal */
- const char *name = _glapi_get_proc_name(offset);
- if (name && strcmp(name, funcName) != 0)
- return GL_FALSE; /* bad name! */
- }
-
- {
- /* be sure index and name match known data */
GLuint i;
for (i = 0; i < NumExtEntryPoints; i++) {
if (strcmp(ExtEntryTable[i].Name, funcName) == 0) {
- /* function already registered with api */
+ /* function already registered */
if (ExtEntryTable[i].Offset == offset) {
return GL_TRUE; /* offsets match */
}
+ else if (ExtEntryTable[i].Offset == ~0
+ && offset < DISPATCH_TABLE_SIZE) {
+ /* need to patch-up the dispatch code */
+ if (offset != ~0) {
+ fill_in_entrypoint_offset(ExtEntryTable[i].Address, offset);
+ ExtEntryTable[i].Offset = offset;
+ }
+ return GL_TRUE;
+ }
else {
return GL_FALSE; /* bad offset! */
}
}
}
+ }
- /* Make sure we don't try to add a new entrypoint after someone
- * has already called _glapi_get_dispatch_table_size()! If that's
- * happened the caller's information would become out of date.
- */
- if (GetSizeCalled)
- return GL_FALSE;
-
- /* make sure we have space */
- if (NumExtEntryPoints >= MAX_EXTENSION_FUNCS) {
- return GL_FALSE;
- }
- else {
- void *entrypoint = generate_entrypoint(offset);
- if (!entrypoint)
- return GL_FALSE;
-
- ExtEntryTable[NumExtEntryPoints].Name = str_dup(funcName);
- ExtEntryTable[NumExtEntryPoints].Offset = offset;
- ExtEntryTable[NumExtEntryPoints].Address = entrypoint;
- NumExtEntryPoints++;
+ /* This is a new function, try to add it. */
+ if (NumExtEntryPoints >= MAX_EXTENSION_FUNCS ||
+ offset >= DISPATCH_TABLE_SIZE) {
+ /* No space left */
+ return GL_FALSE;
+ }
+ else {
+ void *entrypoint = generate_entrypoint(offset);
+ if (!entrypoint)
+ return GL_FALSE; /* couldn't generate assembly */
- if (offset > MaxDispatchOffset)
- MaxDispatchOffset = offset;
+ /* OK! */
+ ExtEntryTable[NumExtEntryPoints].Name = str_dup(funcName);
+ ExtEntryTable[NumExtEntryPoints].Offset = offset;
+ ExtEntryTable[NumExtEntryPoints].Address = entrypoint;
+ NumExtEntryPoints++;
- return GL_TRUE; /* success */
- }
+ return GL_TRUE; /* success */
}
- /* should never get here, but play it safe */
+ /* should never get here, silence compiler warnings */
return GL_FALSE;
}
-
-#if 0000 /* prototype code for dynamic extension slot allocation */
-
-static int NextFreeOffset = 409; /*XXX*/
-#define MAX_DISPATCH_TABLE_SIZE 1000
-
-/*
- * Dynamically allocate a dispatch slot for an extension entrypoint
- * and generate the assembly language dispatch stub.
- * Return the dispatch offset for the function or -1 if no room or error.
- */
-GLint
-_glapi_add_entrypoint2(const char *funcName)
-{
- int offset;
-
- /* first see if extension func is already known */
- offset = _glapi_get_proc_offset(funcName);
- if (offset >= 0)
- return offset;
-
- if (NumExtEntryPoints < MAX_EXTENSION_FUNCS
- && NextFreeOffset < MAX_DISPATCH_TABLE_SIZE) {
- void *entryPoint;
- offset = NextFreeOffset;
- entryPoint = generate_entrypoint(offset);
- if (entryPoint) {
- NextFreeOffset++;
- ExtEntryTable[NumExtEntryPoints].Name = str_dup(funcName);
- ExtEntryTable[NumExtEntryPoints].Offset = offset;
- ExtEntryTable[NumExtEntryPoints].Address = entryPoint;
- NumExtEntryPoints++;
- return offset;
- }
- }
- return -1;
-}
-
-#endif
-
-
-
/*
* Return offset of entrypoint for named function within dispatch table.
*/
@@ -2045,9 +749,35 @@ _glapi_get_proc_address(const char *funcName)
}
/* search static functions */
- return get_static_proc_address(funcName);
-}
+ {
+ const GLvoid *func = get_static_proc_address(funcName);
+ if (func)
+ return func;
+ }
+ /* generate new entrypoint - use a temporary dispatch offset of
+ * ~0 (i.e. -1). Later, when the driver calls _glapi_add_entrypoint()
+ * we'll put in the proper offset. If that never happens, and the
+ * user calls this function, he'll segfault. That's what you get
+ * when you try calling a GL function that doesn't really exist.
+ */
+ if (NumExtEntryPoints < MAX_EXTENSION_FUNCS) {
+ GLvoid *entrypoint = generate_entrypoint(~0);
+ if (!entrypoint)
+ return GL_FALSE;
+
+ ExtEntryTable[NumExtEntryPoints].Name = str_dup(funcName);
+ ExtEntryTable[NumExtEntryPoints].Offset = ~0;
+ ExtEntryTable[NumExtEntryPoints].Address = entrypoint;
+ NumExtEntryPoints++;
+
+ return entrypoint;
+ }
+ else {
+ /* no space for new functions! */
+ return NULL;
+ }
+}
@@ -2060,6 +790,8 @@ _glapi_get_proc_name(GLuint offset)
{
const GLuint n = sizeof(static_functions) / sizeof(struct name_address_offset);
GLuint i;
+
+ /* search built-in functions */
for (i = 0; i < n; i++) {
if (static_functions[i].Offset == offset)
return static_functions[i].Name;
@@ -2077,6 +809,29 @@ _glapi_get_proc_name(GLuint offset)
/*
+ * Return size of dispatch table struct as number of functions (or
+ * slots).
+ */
+GLuint
+_glapi_get_dispatch_table_size(void)
+{
+ return DISPATCH_TABLE_SIZE;
+}
+
+
+
+/*
+ * Get API dispatcher version string.
+ */
+const char *
+_glapi_get_version(void)
+{
+ return "20021001"; /* YYYYMMDD */
+}
+
+
+
+/*
* Make sure there are no NULL pointers in the given dispatch table.
* Intended for debugging purposes.
*/
@@ -2144,5 +899,21 @@ _glapi_check_table(const struct _glapi_table *table)
assert(secondaryColor3fOffset == offset);
assert(_glapi_get_proc_address("glSecondaryColor3fEXT") == (void *) &glSecondaryColor3fEXT);
}
+ {
+ GLuint pointParameterivOffset = _glapi_get_proc_offset("glPointParameterivNV");
+ char *pointParameterivFunc = (char*) &table->PointParameterivNV;
+ GLuint offset = (pointParameterivFunc - (char *) table) / sizeof(void *);
+ assert(pointParameterivOffset == _gloffset_PointParameterivNV);
+ assert(pointParameterivOffset == offset);
+ assert(_glapi_get_proc_address("glPointParameterivNV") == (void *) &glPointParameterivNV);
+ }
+ {
+ GLuint setFenceOffset = _glapi_get_proc_offset("glSetFenceNV");
+ char *setFenceFunc = (char*) &table->SetFenceNV;
+ GLuint offset = (setFenceFunc - (char *) table) / sizeof(void *);
+ assert(setFenceOffset == _gloffset_SetFenceNV);
+ assert(setFenceOffset == offset);
+ assert(_glapi_get_proc_address("glSetFenceNV") == (void *) &glSetFenceNV);
+ }
#endif
}
diff --git a/xc/extras/Mesa/src/glapi.h b/xc/extras/Mesa/src/glapi.h
index 73782f8c4..41d7aaf02 100644
--- a/xc/extras/Mesa/src/glapi.h
+++ b/xc/extras/Mesa/src/glapi.h
@@ -32,6 +32,8 @@
struct _glapi_table;
+typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...);
+
extern void *_glapi_Context;
@@ -41,6 +43,8 @@ extern struct _glapi_table *_glapi_Dispatch;
extern void
_glapi_noop_enable_warnings(GLboolean enable);
+extern void
+_glapi_set_warning_func(_glapi_warning_func func);
extern void
_glapi_check_multithread(void);
diff --git a/xc/extras/Mesa/src/glapioffsets.h b/xc/extras/Mesa/src/glapioffsets.h
index c1c82bba0..4223395f3 100644
--- a/xc/extras/Mesa/src/glapioffsets.h
+++ b/xc/extras/Mesa/src/glapioffsets.h
@@ -415,7 +415,7 @@
#define _gloffset_MultTransposeMatrixfARB 410
#define _gloffset_MultTransposeMatrixdARB 411
#define _gloffset_SampleCoverageARB 412
-#define _gloffset_SamplePassARB 413
+#define _gloffset___unused413 413
#define _gloffset_PolygonOffsetEXT 414
#define _gloffset_GetTexFilterFuncSGIS 415
#define _gloffset_TexFilterFuncSGIS 416
@@ -580,5 +580,81 @@
#define _gloffset_SecondaryColor3usEXT 575
#define _gloffset_SecondaryColor3usvEXT 576
#define _gloffset_SecondaryColorPointerEXT 577
+#define _gloffset_AreProgramsResidentNV 578
+#define _gloffset_BindProgramNV 579
+#define _gloffset_DeleteProgramsNV 580
+#define _gloffset_ExecuteProgramNV 581
+#define _gloffset_GenProgramsNV 582
+#define _gloffset_GetProgramParameterdvNV 583
+#define _gloffset_GetProgramParameterfvNV 584
+#define _gloffset_GetProgramivNV 585
+#define _gloffset_GetProgramStringNV 586
+#define _gloffset_GetTrackMatrixivNV 587
+#define _gloffset_GetVertexAttribdvNV 588
+#define _gloffset_GetVertexAttribfvNV 589
+#define _gloffset_GetVertexAttribivNV 590
+#define _gloffset_GetVertexAttribPointervNV 591
+#define _gloffset_IsProgramNV 592
+#define _gloffset_LoadProgramNV 593
+#define _gloffset_ProgramParameter4dNV 594
+#define _gloffset_ProgramParameter4dvNV 595
+#define _gloffset_ProgramParameter4fNV 596
+#define _gloffset_ProgramParameter4fvNV 597
+#define _gloffset_ProgramParameters4dvNV 598
+#define _gloffset_ProgramParameters4fvNV 599
+#define _gloffset_RequestResidentProgramsNV 600
+#define _gloffset_TrackMatrixNV 601
+#define _gloffset_VertexAttribPointerNV 602
+#define _gloffset_VertexAttrib1dNV 603
+#define _gloffset_VertexAttrib1dvNV 604
+#define _gloffset_VertexAttrib1fNV 605
+#define _gloffset_VertexAttrib1fvNV 606
+#define _gloffset_VertexAttrib1sNV 607
+#define _gloffset_VertexAttrib1svNV 608
+#define _gloffset_VertexAttrib2dNV 609
+#define _gloffset_VertexAttrib2dvNV 610
+#define _gloffset_VertexAttrib2fNV 611
+#define _gloffset_VertexAttrib2fvNV 612
+#define _gloffset_VertexAttrib2sNV 613
+#define _gloffset_VertexAttrib2svNV 614
+#define _gloffset_VertexAttrib3dNV 615
+#define _gloffset_VertexAttrib3dvNV 616
+#define _gloffset_VertexAttrib3fNV 617
+#define _gloffset_VertexAttrib3fvNV 618
+#define _gloffset_VertexAttrib3sNV 619
+#define _gloffset_VertexAttrib3svNV 620
+#define _gloffset_VertexAttrib4dNV 621
+#define _gloffset_VertexAttrib4dvNV 622
+#define _gloffset_VertexAttrib4fNV 623
+#define _gloffset_VertexAttrib4fvNV 624
+#define _gloffset_VertexAttrib4sNV 625
+#define _gloffset_VertexAttrib4svNV 626
+#define _gloffset_VertexAttrib4ubNV 627
+#define _gloffset_VertexAttrib4ubvNV 628
+#define _gloffset_VertexAttribs1dvNV 629
+#define _gloffset_VertexAttribs1fvNV 630
+#define _gloffset_VertexAttribs1svNV 631
+#define _gloffset_VertexAttribs2dvNV 632
+#define _gloffset_VertexAttribs2fvNV 633
+#define _gloffset_VertexAttribs2svNV 634
+#define _gloffset_VertexAttribs3dvNV 635
+#define _gloffset_VertexAttribs3fvNV 636
+#define _gloffset_VertexAttribs3svNV 637
+#define _gloffset_VertexAttribs4dvNV 638
+#define _gloffset_VertexAttribs4fvNV 639
+#define _gloffset_VertexAttribs4svNV 640
+#define _gloffset_VertexAttribs4ubvNV 641
+#define _gloffset_PointParameteriNV 642
+#define _gloffset_PointParameterivNV 643
+#define _gloffset_MultiDrawArraysEXT 644
+#define _gloffset_MultiDrawElementsEXT 645
+#define _gloffset_ActiveStencilFaceEXT 646
+#define _gloffset_DeleteFencesNV 647
+#define _gloffset_GenFencesNV 648
+#define _gloffset_IsFenceNV 649
+#define _gloffset_TestFenceNV 650
+#define _gloffset_GetFenceivNV 651
+#define _gloffset_FinishFenceNV 652
+#define _gloffset_SetFenceNV 653
#endif
diff --git a/xc/extras/Mesa/src/glapitable.h b/xc/extras/Mesa/src/glapitable.h
index f16af91e7..f75ee10ca 100644
--- a/xc/extras/Mesa/src/glapitable.h
+++ b/xc/extras/Mesa/src/glapitable.h
@@ -294,7 +294,7 @@ struct _glapi_table
void (*GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint * params); /* 285 */
GLboolean (*IsEnabled)(GLenum cap); /* 286 */
GLboolean (*IsList)(GLuint list); /* 287 */
- void (*DepthRange)(GLclampd near, GLclampd far); /* 288 */
+ void (*DepthRange)(GLclampd zNear, GLclampd zFar); /* 288 */
void (*Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 289 */
void (*LoadIdentity)(void); /* 290 */
void (*LoadMatrixf)(const GLfloat * m); /* 291 */
@@ -335,7 +335,7 @@ struct _glapi_table
void (*CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 326 */
void (*DeleteTextures)(GLsizei n, const GLuint * textures); /* 327 */
void (*GenTextures)(GLsizei n, GLuint * textures); /* 328 */
- void (*GetPointerv)(GLenum pname, GLvoid * * params); /* 329 */
+ void (*GetPointerv)(GLenum pname, GLvoid ** params); /* 329 */
GLboolean (*IsTexture)(GLuint texture); /* 330 */
void (*PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities); /* 331 */
void (*TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); /* 332 */
@@ -377,7 +377,7 @@ struct _glapi_table
void (*Minmax)(GLenum target, GLenum internalformat, GLboolean sink); /* 368 */
void (*ResetHistogram)(GLenum target); /* 369 */
void (*ResetMinmax)(GLenum target); /* 370 */
- void (*TexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 371 */
+ void (*TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 371 */
void (*TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); /* 372 */
void (*CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 373 */
void (*ActiveTextureARB)(GLenum texture); /* 374 */
@@ -419,7 +419,7 @@ struct _glapi_table
void (*MultTransposeMatrixfARB)(const GLfloat * m); /* 410 */
void (*MultTransposeMatrixdARB)(const GLdouble * m); /* 411 */
void (*SampleCoverageARB)(GLclampf value, GLboolean invert); /* 412 */
- void (*SamplePassARB)(GLenum pass); /* 413 */
+ void (*__unused413)(void); /* 413 */
void (*PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 414 */
void (*GetTexFilterFuncSGIS)(GLenum target, GLenum filter, GLfloat * weights); /* 415 */
void (*TexFilterFuncSGIS)(GLenum target, GLenum filter, GLsizei n, const GLfloat * weights); /* 416 */
@@ -504,7 +504,7 @@ struct _glapi_table
void (*VertexWeightfvEXT)(const GLfloat * weight); /* 495 */
void (*VertexWeightPointerEXT)(GLsizei size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 496 */
void (*FlushVertexArrayRangeNV)(void); /* 497 */
- void (*VertexArrayRangeNV)(GLsizei size, const GLvoid * pointer); /* 498 */
+ void (*VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 498 */
void (*CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 499 */
void (*CombinerParameterfNV)(GLenum pname, GLfloat param); /* 500 */
void (*CombinerParameterivNV)(GLenum pname, const GLint * params); /* 501 */
@@ -584,6 +584,82 @@ struct _glapi_table
void (*SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 575 */
void (*SecondaryColor3usvEXT)(const GLushort * v); /* 576 */
void (*SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 577 */
+ GLboolean (*AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 578 */
+ void (*BindProgramNV)(GLenum target, GLuint id); /* 579 */
+ void (*DeleteProgramsNV)(GLsizei n, const GLuint * ids); /* 580 */
+ void (*ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 581 */
+ void (*GenProgramsNV)(GLsizei n, GLuint * ids); /* 582 */
+ void (*GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 583 */
+ void (*GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 584 */
+ void (*GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 585 */
+ void (*GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 586 */
+ void (*GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 587 */
+ void (*GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 588 */
+ void (*GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 589 */
+ void (*GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 590 */
+ void (*GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer); /* 591 */
+ GLboolean (*IsProgramNV)(GLuint id); /* 592 */
+ void (*LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 593 */
+ void (*ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 594 */
+ void (*ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params); /* 595 */
+ void (*ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 596 */
+ void (*ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params); /* 597 */
+ void (*ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 598 */
+ void (*ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 599 */
+ void (*RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 600 */
+ void (*TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 601 */
+ void (*VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 602 */
+ void (*VertexAttrib1dNV)(GLuint index, GLdouble x); /* 603 */
+ void (*VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 604 */
+ void (*VertexAttrib1fNV)(GLuint index, GLfloat x); /* 605 */
+ void (*VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 606 */
+ void (*VertexAttrib1sNV)(GLuint index, GLshort x); /* 607 */
+ void (*VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 608 */
+ void (*VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 609 */
+ void (*VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 610 */
+ void (*VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 611 */
+ void (*VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 612 */
+ void (*VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 613 */
+ void (*VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 614 */
+ void (*VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 615 */
+ void (*VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 616 */
+ void (*VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 617 */
+ void (*VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 618 */
+ void (*VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 619 */
+ void (*VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 620 */
+ void (*VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 621 */
+ void (*VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 622 */
+ void (*VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 623 */
+ void (*VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 624 */
+ void (*VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 625 */
+ void (*VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 626 */
+ void (*VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 627 */
+ void (*VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 628 */
+ void (*VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 629 */
+ void (*VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 630 */
+ void (*VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 631 */
+ void (*VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 632 */
+ void (*VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 633 */
+ void (*VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 634 */
+ void (*VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 635 */
+ void (*VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 636 */
+ void (*VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 637 */
+ void (*VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 638 */
+ void (*VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 639 */
+ void (*VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 640 */
+ void (*VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 641 */
+ void (*PointParameteriNV)(GLenum pname, GLint params); /* 642 */
+ void (*PointParameterivNV)(GLenum pname, const GLint * params); /* 643 */
+ void (*MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 644 */
+ void (*MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 645 */
+ void (*ActiveStencilFaceEXT)(GLenum face); /* 646 */
+ void (*DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 647 */
+ void (*GenFencesNV)(GLsizei n, GLuint * fences); /* 648 */
+ GLboolean (*IsFenceNV)(GLuint fence); /* 649 */
+ GLboolean (*TestFenceNV)(GLuint fence); /* 650 */
+ void (*GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 651 */
+ void (*FinishFenceNV)(GLuint fence); /* 652 */
+ void (*SetFenceNV)(GLuint fence, GLenum condition); /* 653 */
};
#endif
diff --git a/xc/extras/Mesa/src/glapitemp.h b/xc/extras/Mesa/src/glapitemp.h
index 6ed64f7a1..ba6a09378 100644
--- a/xc/extras/Mesa/src/glapitemp.h
+++ b/xc/extras/Mesa/src/glapitemp.h
@@ -1,28 +1,5 @@
-/*
- * 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.
- */
-
+/* DO NOT EDIT! This file is generated by the glapitemp.py script. */
/*
* This file is a template which generates the OpenGL API entry point
@@ -69,3579 +46,4190 @@
#error RETURN_DISPATCH must be defined
#endif
+GLAPI void GLAPIENTRY gl__unused413(void); /* silence warning */
-/*
- * XXX
- * Most functions need the msg (printf-message) parameter to be finished.
- * I.e. replace ";" with the real info.
- */
-
-/*
- * XXX
- * Someday this code should be automatically generated from a spec file
- * like that used in the SGI OpenGL SI.
- */
+KEYWORD1 void KEYWORD2 NAME(NewList)(GLuint list, GLenum mode)
+{
+ DISPATCH(NewList, (list, mode), (F, "glNewList(%d, 0x%x);\n", list, mode));
+}
+KEYWORD1 void KEYWORD2 NAME(EndList)(void)
+{
+ DISPATCH(EndList, (), (F, "glEndList();\n"));
+}
+KEYWORD1 void KEYWORD2 NAME(CallList)(GLuint list)
+{
+ DISPATCH(CallList, (list), (F, "glCallList(%d);\n", list));
+}
-/* GL 1.0 */
+KEYWORD1 void KEYWORD2 NAME(CallLists)(GLsizei n, GLenum type, const GLvoid * lists)
+{
+ DISPATCH(CallLists, (n, type, lists), (F, "glCallLists(%d, 0x%x, %p);\n", n, type, (void *) lists));
+}
-KEYWORD1 void KEYWORD2 NAME(Accum)(GLenum op, GLfloat value)
+KEYWORD1 void KEYWORD2 NAME(DeleteLists)(GLuint list, GLsizei range)
{
- DISPATCH(Accum, (op, value), (F, "glAccum(0x%x, %g);", op, value));
+ DISPATCH(DeleteLists, (list, range), (F, "glDeleteLists(%d, %d);\n", list, range));
}
-KEYWORD1 void KEYWORD2 NAME(AlphaFunc)(GLenum func, GLclampf ref)
+KEYWORD1 GLuint KEYWORD2 NAME(GenLists)(GLsizei range)
{
- DISPATCH(AlphaFunc, (func, ref), (F, "glAlphaFunc(0x%x, %g);", func, ref));
+ RETURN_DISPATCH(GenLists, (range), (F, "glGenLists(%d);\n", range));
}
-KEYWORD1 void KEYWORD2 NAME(ArrayElementEXT)(GLint i)
+KEYWORD1 void KEYWORD2 NAME(ListBase)(GLuint base)
{
- DISPATCH(ArrayElement, (i), (F, ";"));
+ DISPATCH(ListBase, (base), (F, "glListBase(%d);\n", base));
}
KEYWORD1 void KEYWORD2 NAME(Begin)(GLenum mode)
{
- DISPATCH(Begin, (mode), (F, "glBegin(0x%x);", mode));
+ DISPATCH(Begin, (mode), (F, "glBegin(0x%x);\n", mode));
}
-KEYWORD1 void KEYWORD2 NAME(Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap)
+KEYWORD1 void KEYWORD2 NAME(Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap)
{
- DISPATCH(Bitmap, (width, height, xorig, yorig, xmove, ymove, bitmap), (F, "glBitmap(%d %d %g %g %g %g %p;", width, height, xorig, yorig, xmove, ymove, bitmap));
+ DISPATCH(Bitmap, (width, height, xorig, yorig, xmove, ymove, bitmap), (F, "glBitmap(%d, %d, %f, %f, %f, %f, %p);\n", width, height, xorig, yorig, xmove, ymove, (void *) bitmap));
}
-KEYWORD1 void KEYWORD2 NAME(BlendFunc)(GLenum sfactor, GLenum dfactor)
+KEYWORD1 void KEYWORD2 NAME(Color3b)(GLbyte red, GLbyte green, GLbyte blue)
{
- DISPATCH(BlendFunc, (sfactor, dfactor), (F, "glBlendFunc(0x%x, 0x%x);", sfactor, dfactor));
+ DISPATCH(Color3b, (red, green, blue), (F, "glColor3b(%d, %d, %d);\n", red, green, blue));
}
-KEYWORD1 void KEYWORD2 NAME(CallList)(GLuint list)
+KEYWORD1 void KEYWORD2 NAME(Color3bv)(const GLbyte * v)
{
- DISPATCH(CallList, (list), (F, "glCallList(%u);", list));
+ DISPATCH(Color3bv, (v), (F, "glColor3bv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(CallLists)(GLsizei n, GLenum type, const GLvoid *lists)
+KEYWORD1 void KEYWORD2 NAME(Color3d)(GLdouble red, GLdouble green, GLdouble blue)
{
- DISPATCH(CallLists, (n, type, lists), (F, "glCallLists(%d, 0x%x, %p);", n, type, lists));
+ DISPATCH(Color3d, (red, green, blue), (F, "glColor3d(%f, %f, %f);\n", red, green, blue));
}
-KEYWORD1 void KEYWORD2 NAME(Clear)(GLbitfield mask)
+KEYWORD1 void KEYWORD2 NAME(Color3dv)(const GLdouble * v)
{
- DISPATCH(Clear, (mask), (F, "glClear(0x%x);", mask));
+ DISPATCH(Color3dv, (v), (F, "glColor3dv(%p /* %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 void KEYWORD2 NAME(ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+KEYWORD1 void KEYWORD2 NAME(Color3f)(GLfloat red, GLfloat green, GLfloat blue)
{
- DISPATCH(ClearAccum, (red, green, blue, alpha), (F, "glClearAccum(%g, %g, %g, %g);", red, green, blue, alpha));
+ DISPATCH(Color3f, (red, green, blue), (F, "glColor3f(%f, %f, %f);\n", red, green, blue));
}
-KEYWORD1 void KEYWORD2 NAME(ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+KEYWORD1 void KEYWORD2 NAME(Color3fv)(const GLfloat * v)
{
- DISPATCH(ClearColor, (red, green, blue, alpha), (F, "glClearColor(%g, %g, %g, %g);", red, green, blue, alpha));
+ DISPATCH(Color3fv, (v), (F, "glColor3fv(%p /* %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 void KEYWORD2 NAME(ClearDepth)(GLclampd depth)
+KEYWORD1 void KEYWORD2 NAME(Color3i)(GLint red, GLint green, GLint blue)
{
- DISPATCH(ClearDepth, (depth), (F, "glClearDepth(%g);", depth));
+ DISPATCH(Color3i, (red, green, blue), (F, "glColor3i(%d, %d, %d);\n", red, green, blue));
}
-KEYWORD1 void KEYWORD2 NAME(ClearIndex)(GLfloat c)
+KEYWORD1 void KEYWORD2 NAME(Color3iv)(const GLint * v)
{
- DISPATCH(ClearIndex, (c), (F, "glClearIndex(%g);", c));
+ DISPATCH(Color3iv, (v), (F, "glColor3iv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(ClearStencil)(GLint s)
+KEYWORD1 void KEYWORD2 NAME(Color3s)(GLshort red, GLshort green, GLshort blue)
{
- DISPATCH(ClearStencil, (s), (F, "glClearStencil(%d);", s));
+ DISPATCH(Color3s, (red, green, blue), (F, "glColor3s(%d, %d, %d);\n", red, green, blue));
}
-KEYWORD1 void KEYWORD2 NAME(ClipPlane)(GLenum plane, const GLdouble *equation)
+KEYWORD1 void KEYWORD2 NAME(Color3sv)(const GLshort * v)
{
- DISPATCH(ClipPlane, (plane, equation), (F, "glClipPlane(%p);", (void *) equation));
+ DISPATCH(Color3sv, (v), (F, "glColor3sv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(Color3b)(GLbyte red, GLbyte green, GLbyte blue)
+KEYWORD1 void KEYWORD2 NAME(Color3ub)(GLubyte red, GLubyte green, GLubyte blue)
{
- DISPATCH(Color3b, (red, green, blue), (F, "glColor3b(%d, %d, %d);", red, green, blue));
+ DISPATCH(Color3ub, (red, green, blue), (F, "glColor3ub(%d, %d, %d);\n", red, green, blue));
}
-KEYWORD1 void KEYWORD2 NAME(Color3d)(GLdouble red, GLdouble green, GLdouble blue)
+KEYWORD1 void KEYWORD2 NAME(Color3ubv)(const GLubyte * v)
{
- DISPATCH(Color3d, (red, green, blue), (F, "glColor3d(%g, %g, %g);", red, green, blue));
+ DISPATCH(Color3ubv, (v), (F, "glColor3ubv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(Color3f)(GLfloat red, GLfloat green, GLfloat blue)
+KEYWORD1 void KEYWORD2 NAME(Color3ui)(GLuint red, GLuint green, GLuint blue)
{
- DISPATCH(Color3f, (red, green, blue), (F, "glColor3f(%g, %g, %g);", red, green, blue));
+ DISPATCH(Color3ui, (red, green, blue), (F, "glColor3ui(%d, %d, %d);\n", red, green, blue));
}
-KEYWORD1 void KEYWORD2 NAME(Color3i)(GLint red, GLint green, GLint blue)
+KEYWORD1 void KEYWORD2 NAME(Color3uiv)(const GLuint * v)
{
- DISPATCH(Color3i, (red, green, blue), (F, "glColor3i(%d, %d, %d);", red, green, blue));
+ DISPATCH(Color3uiv, (v), (F, "glColor3uiv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(Color3s)(GLshort red, GLshort green, GLshort blue)
+KEYWORD1 void KEYWORD2 NAME(Color3us)(GLushort red, GLushort green, GLushort blue)
{
- DISPATCH(Color3s, (red, green, blue), (F, "glColor3s(%d, %d, %d);", red, green, blue));
+ DISPATCH(Color3us, (red, green, blue), (F, "glColor3us(%d, %d, %d);\n", red, green, blue));
}
-KEYWORD1 void KEYWORD2 NAME(Color3ub)(GLubyte red, GLubyte green, GLubyte blue)
+KEYWORD1 void KEYWORD2 NAME(Color3usv)(const GLushort * v)
{
- DISPATCH(Color3ub, (red, green, blue), (F, "glColor3ub(%u, %u, %u);", red, green, blue));
+ DISPATCH(Color3usv, (v), (F, "glColor3usv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(Color3ui)(GLuint red, GLuint green, GLuint blue)
+KEYWORD1 void KEYWORD2 NAME(Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)
{
- DISPATCH(Color3ui, (red, green, blue), (F, "glColor3ui(%u, %u, %u);", red, green, blue));
+ DISPATCH(Color4b, (red, green, blue, alpha), (F, "glColor4b(%d, %d, %d, %d);\n", red, green, blue, alpha));
}
-KEYWORD1 void KEYWORD2 NAME(Color3us)(GLushort red, GLushort green, GLushort blue)
+KEYWORD1 void KEYWORD2 NAME(Color4bv)(const GLbyte * v)
{
- DISPATCH(Color3us, (red, green, blue), (F, "glColor3us(%u, %u, %u);", red, green, blue));
+ DISPATCH(Color4bv, (v), (F, "glColor4bv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)
+KEYWORD1 void KEYWORD2 NAME(Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
{
- DISPATCH(Color4b, (red, green, blue, alpha), (F, "glColor4b(%d, %d, %d, %d);", red, green, blue, alpha));
+ DISPATCH(Color4d, (red, green, blue, alpha), (F, "glColor4d(%f, %f, %f, %f);\n", red, green, blue, alpha));
}
-KEYWORD1 void KEYWORD2 NAME(Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
+KEYWORD1 void KEYWORD2 NAME(Color4dv)(const GLdouble * v)
{
- DISPATCH(Color4d, (red, green, blue, alpha), (F, "glColor4d(%g, %g, %g, %g);", red, green, blue, alpha));
+ DISPATCH(Color4dv, (v), (F, "glColor4dv(%p /* %g, %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2], v[3]));
}
KEYWORD1 void KEYWORD2 NAME(Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
{
- DISPATCH(Color4f, (red, green, blue, alpha), (F, "glColor4b(%g, %g, %g, %g);", red, green, blue, alpha));
+ DISPATCH(Color4f, (red, green, blue, alpha), (F, "glColor4f(%f, %f, %f, %f);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4fv)(const GLfloat * v)
+{
+ DISPATCH(Color4fv, (v), (F, "glColor4fv(%p /* %g, %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2], v[3]));
}
KEYWORD1 void KEYWORD2 NAME(Color4i)(GLint red, GLint green, GLint blue, GLint alpha)
{
- DISPATCH(Color4i, (red, green, blue, alpha), (F, "glColor4i(%d, %d, %d);", red, green, blue));
+ DISPATCH(Color4i, (red, green, blue, alpha), (F, "glColor4i(%d, %d, %d, %d);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4iv)(const GLint * v)
+{
+ DISPATCH(Color4iv, (v), (F, "glColor4iv(%p);\n", (void *) v));
}
KEYWORD1 void KEYWORD2 NAME(Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha)
{
- DISPATCH(Color4s, (red, green, blue, alpha), (F, "glColor4s(%d, %d, %d, %d);", red, green, blue, alpha));
+ DISPATCH(Color4s, (red, green, blue, alpha), (F, "glColor4s(%d, %d, %d, %d);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4sv)(const GLshort * v)
+{
+ DISPATCH(Color4sv, (v), (F, "glColor4sv(%p);\n", (void *) v));
}
KEYWORD1 void KEYWORD2 NAME(Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
{
- DISPATCH(Color4ub, (red, green, blue, alpha), (F, "glColor4ub(%u, %u, %u, %u);", red, green, blue, alpha));
+ DISPATCH(Color4ub, (red, green, blue, alpha), (F, "glColor4ub(%d, %d, %d, %d);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4ubv)(const GLubyte * v)
+{
+ DISPATCH(Color4ubv, (v), (F, "glColor4ubv(%p);\n", (void *) v));
}
KEYWORD1 void KEYWORD2 NAME(Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha)
{
- DISPATCH(Color4ui, (red, green, blue, alpha), (F, "glColor4ui(%u, %u, %u, %u);", red, green, blue, alpha));
+ DISPATCH(Color4ui, (red, green, blue, alpha), (F, "glColor4ui(%d, %d, %d, %d);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4uiv)(const GLuint * v)
+{
+ DISPATCH(Color4uiv, (v), (F, "glColor4uiv(%p);\n", (void *) v));
}
KEYWORD1 void KEYWORD2 NAME(Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha)
{
- DISPATCH(Color4us, (red, green, blue, alpha), (F, "glColor4us(%u, %u, %u, %u);", red, green, blue, alpha));
+ DISPATCH(Color4us, (red, green, blue, alpha), (F, "glColor4us(%d, %d, %d, %d);\n", red, green, blue, alpha));
}
-KEYWORD1 void KEYWORD2 NAME(Color3bv)(const GLbyte *v)
+KEYWORD1 void KEYWORD2 NAME(Color4usv)(const GLushort * v)
{
- DISPATCH(Color3bv, (v), (F, "glColor3bf(%p);", v));
+ DISPATCH(Color4usv, (v), (F, "glColor4usv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(Color3dv)(const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(EdgeFlag)(GLboolean flag)
{
- DISPATCH(Color3dv, (v), (F, "glColor3dv(%p);", (void *) v));
+ DISPATCH(EdgeFlag, (flag), (F, "glEdgeFlag(%d);\n", flag));
}
-KEYWORD1 void KEYWORD2 NAME(Color3fv)(const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(EdgeFlagv)(const GLboolean * flag)
{
- DISPATCH(Color3fv, (v), (F, "glColor3fv(%p);", (void *) v));
+ DISPATCH(EdgeFlagv, (flag), (F, "glEdgeFlagv(%p);\n", (void *) flag));
}
-KEYWORD1 void KEYWORD2 NAME(Color3iv)(const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(End)(void)
{
- DISPATCH(Color3iv, (v), (F, "glColor3iv(%p);", (void *) v));
+ DISPATCH(End, (), (F, "glEnd();\n"));
}
-KEYWORD1 void KEYWORD2 NAME(Color3sv)(const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(Indexd)(GLdouble c)
{
- DISPATCH(Color3sv, (v), (F, "glColor3sv(%p);", (void *) v));
+ DISPATCH(Indexd, (c), (F, "glIndexd(%f);\n", c));
}
-KEYWORD1 void KEYWORD2 NAME(Color3ubv)(const GLubyte *v)
+KEYWORD1 void KEYWORD2 NAME(Indexdv)(const GLdouble * c)
{
- DISPATCH(Color3ubv, (v), (F, "glColor3ubv(%p);", (void *) v));
+ DISPATCH(Indexdv, (c), (F, "glIndexdv(%p);\n", (void *) c));
}
-KEYWORD1 void KEYWORD2 NAME(Color3uiv)(const GLuint *v)
+KEYWORD1 void KEYWORD2 NAME(Indexf)(GLfloat c)
{
- DISPATCH(Color3uiv, (v), (F, "glColor3uiv(%p);", (void *) v));
+ DISPATCH(Indexf, (c), (F, "glIndexf(%f);\n", c));
}
-KEYWORD1 void KEYWORD2 NAME(Color3usv)(const GLushort *v)
+KEYWORD1 void KEYWORD2 NAME(Indexfv)(const GLfloat * c)
{
- DISPATCH(Color3usv, (v), (F, "glColor3usv(%p);", (void *) v));
+ DISPATCH(Indexfv, (c), (F, "glIndexfv(%p);\n", (void *) c));
}
-KEYWORD1 void KEYWORD2 NAME(Color4bv)(const GLbyte *v)
+KEYWORD1 void KEYWORD2 NAME(Indexi)(GLint c)
{
- DISPATCH(Color4bv, (v), (F, "glColor3bv(%p);", v));
+ DISPATCH(Indexi, (c), (F, "glIndexi(%d);\n", c));
}
-KEYWORD1 void KEYWORD2 NAME(Color4dv)(const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(Indexiv)(const GLint * c)
{
- DISPATCH(Color4dv, (v), (F, "glColor4dv(%p);", (void *) v));
+ DISPATCH(Indexiv, (c), (F, "glIndexiv(%p);\n", (void *) c));
}
-KEYWORD1 void KEYWORD2 NAME(Color4fv)(const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(Indexs)(GLshort c)
{
- DISPATCH(Color4fv, (v), (F, "glColor4fv(%p);", (void *) v));
+ DISPATCH(Indexs, (c), (F, "glIndexs(%d);\n", c));
}
-KEYWORD1 void KEYWORD2 NAME(Color4iv)(const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(Indexsv)(const GLshort * c)
{
- DISPATCH(Color4iv, (v), (F, "glColor4iv(%p);", (void *) v));
+ DISPATCH(Indexsv, (c), (F, "glIndexsv(%p);\n", (void *) c));
}
-KEYWORD1 void KEYWORD2 NAME(Color4sv)(const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz)
{
- DISPATCH(Color4sv, (v), (F, "glColor4sv(%p);", (void *) v));
+ DISPATCH(Normal3b, (nx, ny, nz), (F, "glNormal3b(%d, %d, %d);\n", nx, ny, nz));
}
-KEYWORD1 void KEYWORD2 NAME(Color4ubv)(const GLubyte *v)
+KEYWORD1 void KEYWORD2 NAME(Normal3bv)(const GLbyte * v)
{
- DISPATCH(Color4ubv, (v), (F, "glColor4ubv(%p);", (void *) v));
+ DISPATCH(Normal3bv, (v), (F, "glNormal3bv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(Color4uiv)(const GLuint *v)
+KEYWORD1 void KEYWORD2 NAME(Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz)
{
- DISPATCH(Color4uiv, (v), (F, "glColor4uiv(%p);", (void *) v));
+ DISPATCH(Normal3d, (nx, ny, nz), (F, "glNormal3d(%f, %f, %f);\n", nx, ny, nz));
}
-KEYWORD1 void KEYWORD2 NAME(Color4usv)(const GLushort *v)
+KEYWORD1 void KEYWORD2 NAME(Normal3dv)(const GLdouble * v)
{
- DISPATCH(Color4usv, (v), (F, "glColor4usv(%p);", (void *) v));
+ DISPATCH(Normal3dv, (v), (F, "glNormal3dv(%p /* %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 void KEYWORD2 NAME(ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
+KEYWORD1 void KEYWORD2 NAME(Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz)
{
- DISPATCH(ColorMask, (red, green, blue, alpha), (F, "glColorMask(%d, %d, %d, %d);", red, green, blue, alpha));
+ DISPATCH(Normal3f, (nx, ny, nz), (F, "glNormal3f(%f, %f, %f);\n", nx, ny, nz));
}
-KEYWORD1 void KEYWORD2 NAME(ColorMaterial)(GLenum face, GLenum mode)
+KEYWORD1 void KEYWORD2 NAME(Normal3fv)(const GLfloat * v)
{
- DISPATCH(ColorMaterial, (face, mode), (F, "glColorMaterial(0x%x, 0x%x);", face, mode));
+ DISPATCH(Normal3fv, (v), (F, "glNormal3fv(%p /* %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 void KEYWORD2 NAME(CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
+KEYWORD1 void KEYWORD2 NAME(Normal3i)(GLint nx, GLint ny, GLint nz)
{
- DISPATCH(CopyPixels, (x, y, width, height, type), (F, "glCopyPixels(%d, %d, %d, %d, 0x%x;", x, y, width, height, type));
+ DISPATCH(Normal3i, (nx, ny, nz), (F, "glNormal3i(%d, %d, %d);\n", nx, ny, nz));
}
-KEYWORD1 void KEYWORD2 NAME(CullFace)(GLenum mode)
+KEYWORD1 void KEYWORD2 NAME(Normal3iv)(const GLint * v)
{
- DISPATCH(CullFace, (mode), (F, "glCullFace(0x%x);", mode));
+ DISPATCH(Normal3iv, (v), (F, "glNormal3iv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(DepthFunc)(GLenum func)
+KEYWORD1 void KEYWORD2 NAME(Normal3s)(GLshort nx, GLshort ny, GLshort nz)
{
- DISPATCH(DepthFunc, (func), (F, "glDepthFunc(0x%x);", func));
+ DISPATCH(Normal3s, (nx, ny, nz), (F, "glNormal3s(%d, %d, %d);\n", nx, ny, nz));
}
-KEYWORD1 void KEYWORD2 NAME(DepthMask)(GLboolean flag)
+KEYWORD1 void KEYWORD2 NAME(Normal3sv)(const GLshort * v)
{
- DISPATCH(DepthMask, (flag), (F, "glDepthMask(%d);", flag));
+ DISPATCH(Normal3sv, (v), (F, "glNormal3sv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(DepthRange)(GLclampd nearVal, GLclampd farVal)
+KEYWORD1 void KEYWORD2 NAME(RasterPos2d)(GLdouble x, GLdouble y)
{
- DISPATCH(DepthRange, (nearVal, farVal), (F, "glDepthRange(%g, %g;", nearVal, farVal));
+ DISPATCH(RasterPos2d, (x, y), (F, "glRasterPos2d(%f, %f);\n", x, y));
}
-KEYWORD1 void KEYWORD2 NAME(DeleteLists)(GLuint list, GLsizei range)
+KEYWORD1 void KEYWORD2 NAME(RasterPos2dv)(const GLdouble * v)
{
- DISPATCH(DeleteLists, (list, range), (F, "glDeleteLists(%u, %d);", list, range));
+ DISPATCH(RasterPos2dv, (v), (F, "glRasterPos2dv(%p /* %g, %g */);\n", (void *) v, v[0], v[1]));
}
-KEYWORD1 void KEYWORD2 NAME(Disable)(GLenum cap)
+KEYWORD1 void KEYWORD2 NAME(RasterPos2f)(GLfloat x, GLfloat y)
{
- DISPATCH(Disable, (cap), (F, "glDisable(0x%x);", cap));
+ DISPATCH(RasterPos2f, (x, y), (F, "glRasterPos2f(%f, %f);\n", x, y));
}
-KEYWORD1 void KEYWORD2 NAME(DrawBuffer)(GLenum mode)
+KEYWORD1 void KEYWORD2 NAME(RasterPos2fv)(const GLfloat * v)
{
- DISPATCH(DrawBuffer, (mode), (F, "glDrawBuffer(0x%x);", mode));
+ DISPATCH(RasterPos2fv, (v), (F, "glRasterPos2fv(%p /* %g, %g */);\n", (void *) v, v[0], v[1]));
}
-KEYWORD1 void KEYWORD2 NAME(DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
+KEYWORD1 void KEYWORD2 NAME(RasterPos2i)(GLint x, GLint y)
{
- DISPATCH(DrawElements, (mode, count, type, indices), (F, "glDrawElements(0x%x, %d, 0x%x, %p;", mode, count, type, indices));
+ DISPATCH(RasterPos2i, (x, y), (F, "glRasterPos2i(%d, %d);\n", x, y));
}
-KEYWORD1 void KEYWORD2 NAME(DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
+KEYWORD1 void KEYWORD2 NAME(RasterPos2iv)(const GLint * v)
{
- DISPATCH(DrawPixels, (width, height, format, type, pixels), (F, "glDrawPixels(%d, %d, 0x%x, 0x%x, %p);", width, height, format, type, pixels));
+ DISPATCH(RasterPos2iv, (v), (F, "glRasterPos2iv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(EdgeFlag)(GLboolean flag)
+KEYWORD1 void KEYWORD2 NAME(RasterPos2s)(GLshort x, GLshort y)
{
- DISPATCH(EdgeFlag, (flag), (F, ";"));
+ DISPATCH(RasterPos2s, (x, y), (F, "glRasterPos2s(%d, %d);\n", x, y));
}
-KEYWORD1 void KEYWORD2 NAME(EdgeFlagv)(const GLboolean *flag)
+KEYWORD1 void KEYWORD2 NAME(RasterPos2sv)(const GLshort * v)
{
- DISPATCH(EdgeFlagv, (flag), (F, ";"));
+ DISPATCH(RasterPos2sv, (v), (F, "glRasterPos2sv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(Enable)(GLenum cap)
+KEYWORD1 void KEYWORD2 NAME(RasterPos3d)(GLdouble x, GLdouble y, GLdouble z)
{
- DISPATCH(Enable, (cap), (F, "glEnable(0x%x);", cap));
+ DISPATCH(RasterPos3d, (x, y, z), (F, "glRasterPos3d(%f, %f, %f);\n", x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(End)(void)
+KEYWORD1 void KEYWORD2 NAME(RasterPos3dv)(const GLdouble * v)
{
- DISPATCH(End, (), (F, "glEnd();"));
+ DISPATCH(RasterPos3dv, (v), (F, "glRasterPos3dv(%p /* %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 void KEYWORD2 NAME(EndList)(void)
+KEYWORD1 void KEYWORD2 NAME(RasterPos3f)(GLfloat x, GLfloat y, GLfloat z)
{
- DISPATCH(EndList, (), (F, "glEndList();"));
+ DISPATCH(RasterPos3f, (x, y, z), (F, "glRasterPos3f(%f, %f, %f);\n", x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(EvalCoord1d)(GLdouble u)
+KEYWORD1 void KEYWORD2 NAME(RasterPos3fv)(const GLfloat * v)
{
- DISPATCH(EvalCoord1d, (u), (F, "glEvalCoord1d(%g);", u));
+ DISPATCH(RasterPos3fv, (v), (F, "glRasterPos3fv(%p /* %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 void KEYWORD2 NAME(EvalCoord1f)(GLfloat u)
+KEYWORD1 void KEYWORD2 NAME(RasterPos3i)(GLint x, GLint y, GLint z)
+{
+ DISPATCH(RasterPos3i, (x, y, z), (F, "glRasterPos3i(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3iv)(const GLint * v)
{
- DISPATCH(EvalCoord1f, (u), (F, ";"));
+ DISPATCH(RasterPos3iv, (v), (F, "glRasterPos3iv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(EvalCoord1dv)(const GLdouble *u)
+KEYWORD1 void KEYWORD2 NAME(RasterPos3s)(GLshort x, GLshort y, GLshort z)
{
- DISPATCH(EvalCoord1dv, (u), (F, ";"));
+ DISPATCH(RasterPos3s, (x, y, z), (F, "glRasterPos3s(%d, %d, %d);\n", x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(EvalCoord1fv)(const GLfloat *u)
+KEYWORD1 void KEYWORD2 NAME(RasterPos3sv)(const GLshort * v)
{
- DISPATCH(EvalCoord1fv, (u), (F, ";"));
+ DISPATCH(RasterPos3sv, (v), (F, "glRasterPos3sv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(EvalCoord2d)(GLdouble u, GLdouble v)
+KEYWORD1 void KEYWORD2 NAME(RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
- DISPATCH(EvalCoord2d, (u, v), (F, ";"));
+ DISPATCH(RasterPos4d, (x, y, z, w), (F, "glRasterPos4d(%f, %f, %f, %f);\n", x, y, z, w));
}
-KEYWORD1 void KEYWORD2 NAME(EvalCoord2f)(GLfloat u, GLfloat v)
+KEYWORD1 void KEYWORD2 NAME(RasterPos4dv)(const GLdouble * v)
{
- DISPATCH(EvalCoord2f, (u, v), (F, ";"));
+ DISPATCH(RasterPos4dv, (v), (F, "glRasterPos4dv(%p /* %g, %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2], v[3]));
}
-KEYWORD1 void KEYWORD2 NAME(EvalCoord2dv)(const GLdouble *u)
+KEYWORD1 void KEYWORD2 NAME(RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
- DISPATCH(EvalCoord2dv, (u), (F, ";"));
+ DISPATCH(RasterPos4f, (x, y, z, w), (F, "glRasterPos4f(%f, %f, %f, %f);\n", x, y, z, w));
}
-KEYWORD1 void KEYWORD2 NAME(EvalCoord2fv)(const GLfloat *u)
+KEYWORD1 void KEYWORD2 NAME(RasterPos4fv)(const GLfloat * v)
{
- DISPATCH(EvalCoord2fv, (u), (F, ";"));
+ DISPATCH(RasterPos4fv, (v), (F, "glRasterPos4fv(%p /* %g, %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2], v[3]));
}
-KEYWORD1 void KEYWORD2 NAME(EvalMesh1)(GLenum mode, GLint i1, GLint i2)
+KEYWORD1 void KEYWORD2 NAME(RasterPos4i)(GLint x, GLint y, GLint z, GLint w)
{
- DISPATCH(EvalMesh1, (mode, i1, i2), (F, "glEvalMesh(0x%x, %d, %d);", mode, i1, i2));
+ DISPATCH(RasterPos4i, (x, y, z, w), (F, "glRasterPos4i(%d, %d, %d, %d);\n", x, y, z, w));
}
-KEYWORD1 void KEYWORD2 NAME(EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
+KEYWORD1 void KEYWORD2 NAME(RasterPos4iv)(const GLint * v)
{
- DISPATCH(EvalMesh2, (mode, i1, i2, j1, j2), (F, "glEvalMesh2(0x%x, %d, %d, %d, %d);", mode, i1, i2, j1, j2));
+ DISPATCH(RasterPos4iv, (v), (F, "glRasterPos4iv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(EvalPoint1)(GLint i)
+KEYWORD1 void KEYWORD2 NAME(RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w)
{
- DISPATCH(EvalPoint1, (i), (F, ";"));
+ DISPATCH(RasterPos4s, (x, y, z, w), (F, "glRasterPos4s(%d, %d, %d, %d);\n", x, y, z, w));
}
-KEYWORD1 void KEYWORD2 NAME(EvalPoint2)(GLint i, GLint j)
+KEYWORD1 void KEYWORD2 NAME(RasterPos4sv)(const GLshort * v)
{
- DISPATCH(EvalPoint2, (i, j), (F, ";"));
+ DISPATCH(RasterPos4sv, (v), (F, "glRasterPos4sv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(FeedbackBuffer)(GLsizei size, GLenum type, GLfloat *buffer)
+KEYWORD1 void KEYWORD2 NAME(Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
{
- DISPATCH(FeedbackBuffer, (size, type, buffer), (F, "glFeedbackBuffer(%d, 0x%x, %p);", size, type, (void *) buffer));
+ DISPATCH(Rectd, (x1, y1, x2, y2), (F, "glRectd(%f, %f, %f, %f);\n", x1, y1, x2, y2));
}
-KEYWORD1 void KEYWORD2 NAME(Finish)(void)
+KEYWORD1 void KEYWORD2 NAME(Rectdv)(const GLdouble * v1, const GLdouble * v2)
{
- DISPATCH(Finish, (), (F, "glFinish();"));
+ DISPATCH(Rectdv, (v1, v2), (F, "glRectdv(%p, %p);\n", (void *) v1, (void *) v2));
}
-KEYWORD1 void KEYWORD2 NAME(Flush)(void)
+KEYWORD1 void KEYWORD2 NAME(Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
{
- DISPATCH(Flush, (), (F, "glFlush();"));
+ DISPATCH(Rectf, (x1, y1, x2, y2), (F, "glRectf(%f, %f, %f, %f);\n", x1, y1, x2, y2));
}
-KEYWORD1 void KEYWORD2 NAME(Fogf)(GLenum pname, GLfloat param)
+KEYWORD1 void KEYWORD2 NAME(Rectfv)(const GLfloat * v1, const GLfloat * v2)
{
- DISPATCH(Fogf, (pname, param), (F, "glFogf(0x%x, %g);", pname, param));
+ DISPATCH(Rectfv, (v1, v2), (F, "glRectfv(%p, %p);\n", (void *) v1, (void *) v2));
}
-KEYWORD1 void KEYWORD2 NAME(Fogi)(GLenum pname, GLint param)
+KEYWORD1 void KEYWORD2 NAME(Recti)(GLint x1, GLint y1, GLint x2, GLint y2)
{
- DISPATCH(Fogi, (pname, param), (F, "glFogi(0x%x, %d);", pname, param));
+ DISPATCH(Recti, (x1, y1, x2, y2), (F, "glRecti(%d, %d, %d, %d);\n", x1, y1, x2, y2));
}
-KEYWORD1 void KEYWORD2 NAME(Fogfv)(GLenum pname, const GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(Rectiv)(const GLint * v1, const GLint * v2)
{
- DISPATCH(Fogfv, (pname, params), (F, "glFogfv(0x%x, %p);", pname, (void *) params));
+ DISPATCH(Rectiv, (v1, v2), (F, "glRectiv(%p, %p);\n", (void *) v1, (void *) v2));
}
-KEYWORD1 void KEYWORD2 NAME(Fogiv)(GLenum pname, const GLint *params)
+KEYWORD1 void KEYWORD2 NAME(Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
{
- DISPATCH(Fogiv, (pname, params), (F, "glFogiv(0x%x, %p);", pname, (void *) params));
+ DISPATCH(Rects, (x1, y1, x2, y2), (F, "glRects(%d, %d, %d, %d);\n", x1, y1, x2, y2));
}
-KEYWORD1 void KEYWORD2 NAME(FrontFace)(GLenum mode)
+KEYWORD1 void KEYWORD2 NAME(Rectsv)(const GLshort * v1, const GLshort * v2)
{
- DISPATCH(FrontFace, (mode), (F, "glFrontFace(0x%x);", mode));
+ DISPATCH(Rectsv, (v1, v2), (F, "glRectsv(%p, %p);\n", (void *) v1, (void *) v2));
}
-KEYWORD1 void KEYWORD2 NAME(Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
+KEYWORD1 void KEYWORD2 NAME(TexCoord1d)(GLdouble s)
{
- DISPATCH(Frustum, (left, right, bottom, top, nearval, farval), (F, "glFrustum(%f, %f, %f, %f, %f, %f);", left, right, bottom, top, nearval, farval));
+ DISPATCH(TexCoord1d, (s), (F, "glTexCoord1d(%f);\n", s));
}
-KEYWORD1 GLuint KEYWORD2 NAME(GenLists)(GLsizei range)
+KEYWORD1 void KEYWORD2 NAME(TexCoord1dv)(const GLdouble * v)
{
- RETURN_DISPATCH(GenLists, (range), (F, "glGenLists(%d);", range));
+ DISPATCH(TexCoord1dv, (v), (F, "glTexCoord1dv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(GetBooleanv)(GLenum pname, GLboolean *params)
+KEYWORD1 void KEYWORD2 NAME(TexCoord1f)(GLfloat s)
{
- DISPATCH(GetBooleanv, (pname, params), (F, "glGetBooleanv(0x%x, %p);", pname, params));
+ DISPATCH(TexCoord1f, (s), (F, "glTexCoord1f(%f);\n", s));
}
-KEYWORD1 void KEYWORD2 NAME(GetClipPlane)(GLenum plane, GLdouble *equation)
+KEYWORD1 void KEYWORD2 NAME(TexCoord1fv)(const GLfloat * v)
{
- DISPATCH(GetClipPlane, (plane, equation), (F, "glGetClipPlane(x0%x, %p);", plane, (void *) equation));
+ DISPATCH(TexCoord1fv, (v), (F, "glTexCoord1fv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(GetDoublev)(GLenum pname, GLdouble *params)
+KEYWORD1 void KEYWORD2 NAME(TexCoord1i)(GLint s)
{
- DISPATCH(GetDoublev, (pname, params), (F, "glGetDoublev(0x%x, %p);", pname, (void *) params));
+ DISPATCH(TexCoord1i, (s), (F, "glTexCoord1i(%d);\n", s));
}
-KEYWORD1 GLenum KEYWORD2 NAME(GetError)(void)
+KEYWORD1 void KEYWORD2 NAME(TexCoord1iv)(const GLint * v)
{
- RETURN_DISPATCH(GetError, (), (F, "glGetError();"));
+ DISPATCH(TexCoord1iv, (v), (F, "glTexCoord1iv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(GetFloatv)(GLenum pname, GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(TexCoord1s)(GLshort s)
{
- DISPATCH(GetFloatv, (pname, params), (F, "glGetFloatv(0x%x, %p);", pname, (void *) params));
+ DISPATCH(TexCoord1s, (s), (F, "glTexCoord1s(%d);\n", s));
}
-KEYWORD1 void KEYWORD2 NAME(GetIntegerv)(GLenum pname, GLint *params)
+KEYWORD1 void KEYWORD2 NAME(TexCoord1sv)(const GLshort * v)
{
- DISPATCH(GetIntegerv, (pname, params), (F, "glGetIntegerv(0x%x, %p);", pname, (void *) params));
+ DISPATCH(TexCoord1sv, (v), (F, "glTexCoord1sv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(GetLightfv)(GLenum light, GLenum pname, GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(TexCoord2d)(GLdouble s, GLdouble t)
{
- DISPATCH(GetLightfv, (light, pname, params), (F, "glGetLightfv(0x%x, 0x%x, %p);", light, pname, (void *) params));
+ DISPATCH(TexCoord2d, (s, t), (F, "glTexCoord2d(%f, %f);\n", s, t));
}
-KEYWORD1 void KEYWORD2 NAME(GetLightiv)(GLenum light, GLenum pname, GLint *params)
+KEYWORD1 void KEYWORD2 NAME(TexCoord2dv)(const GLdouble * v)
{
- DISPATCH(GetLightiv, (light, pname, params), (F, "glGetLightiv(0x%x, 0x%x, %p);", light, pname, (void *) params));
+ DISPATCH(TexCoord2dv, (v), (F, "glTexCoord2dv(%p /* %g, %g */);\n", (void *) v, v[0], v[1]));
}
-KEYWORD1 void KEYWORD2 NAME(GetMapdv)(GLenum target, GLenum query, GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(TexCoord2f)(GLfloat s, GLfloat t)
{
- DISPATCH(GetMapdv, (target, query, v), (F, "glGetMapdv(0x%x, 0x%x, %p);", target, query, (void *) v));
+ DISPATCH(TexCoord2f, (s, t), (F, "glTexCoord2f(%f, %f);\n", s, t));
}
-KEYWORD1 void KEYWORD2 NAME(GetMapfv)(GLenum target, GLenum query, GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(TexCoord2fv)(const GLfloat * v)
{
- DISPATCH(GetMapfv, (target, query, v), (F, "glGetMapfv(0x%x, 0x%x, %p);", target, query, (void *) v));
+ DISPATCH(TexCoord2fv, (v), (F, "glTexCoord2fv(%p /* %g, %g */);\n", (void *) v, v[0], v[1]));
}
-KEYWORD1 void KEYWORD2 NAME(GetMapiv)(GLenum target, GLenum query, GLint *v)
+KEYWORD1 void KEYWORD2 NAME(TexCoord2i)(GLint s, GLint t)
{
- DISPATCH(GetMapiv, (target, query, v), (F, "glGetMapiv(0x%x, 0x%x, %p);", target, query, (void *) v));
+ DISPATCH(TexCoord2i, (s, t), (F, "glTexCoord2i(%d, %d);\n", s, t));
}
-KEYWORD1 void KEYWORD2 NAME(GetMaterialfv)(GLenum face, GLenum pname, GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(TexCoord2iv)(const GLint * v)
{
- DISPATCH(GetMaterialfv, (face, pname, params), (F, "glGetMaterialfv(0x%x, 0x%x, %p;", face, pname, (void *) params));
+ DISPATCH(TexCoord2iv, (v), (F, "glTexCoord2iv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(GetMaterialiv)(GLenum face, GLenum pname, GLint *params)
+KEYWORD1 void KEYWORD2 NAME(TexCoord2s)(GLshort s, GLshort t)
{
- DISPATCH(GetMaterialiv, (face, pname, params), (F, "glGetMaterialiv(0x%x, 0x%x, %p);", face, pname, (void *) params));
+ DISPATCH(TexCoord2s, (s, t), (F, "glTexCoord2s(%d, %d);\n", s, t));
}
-KEYWORD1 void KEYWORD2 NAME(GetPixelMapfv)(GLenum map, GLfloat *values)
+KEYWORD1 void KEYWORD2 NAME(TexCoord2sv)(const GLshort * v)
{
- DISPATCH(GetPixelMapfv, (map, values), (F, "glGetPixelMapfv(0x%x, %p);", map, (void *) values));
+ DISPATCH(TexCoord2sv, (v), (F, "glTexCoord2sv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(GetPixelMapuiv)(GLenum map, GLuint *values)
+KEYWORD1 void KEYWORD2 NAME(TexCoord3d)(GLdouble s, GLdouble t, GLdouble r)
{
- DISPATCH(GetPixelMapuiv, (map, values), (F, "glGetPixelMapuiv(0x%x, %p);", map, (void *) values));
+ DISPATCH(TexCoord3d, (s, t, r), (F, "glTexCoord3d(%f, %f, %f);\n", s, t, r));
}
-KEYWORD1 void KEYWORD2 NAME(GetPixelMapusv)(GLenum map, GLushort *values)
+KEYWORD1 void KEYWORD2 NAME(TexCoord3dv)(const GLdouble * v)
{
- DISPATCH(GetPixelMapusv, (map, values), (F, "glGetPixelMapusv(0x%x, %p);", map, (void *) values));
+ DISPATCH(TexCoord3dv, (v), (F, "glTexCoord3dv(%p /* %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 void KEYWORD2 NAME(GetPolygonStipple)(GLubyte *mask)
+KEYWORD1 void KEYWORD2 NAME(TexCoord3f)(GLfloat s, GLfloat t, GLfloat r)
{
- DISPATCH(GetPolygonStipple, (mask), (F, "glGetPolygonStipple(%p);", mask));
+ DISPATCH(TexCoord3f, (s, t, r), (F, "glTexCoord3f(%f, %f, %f);\n", s, t, r));
}
-KEYWORD1 const GLubyte * KEYWORD2 NAME(GetString)(GLenum name)
+KEYWORD1 void KEYWORD2 NAME(TexCoord3fv)(const GLfloat * v)
{
- RETURN_DISPATCH(GetString, (name), (F, "glGetString(0x%x);", name));
+ DISPATCH(TexCoord3fv, (v), (F, "glTexCoord3fv(%p /* %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 void KEYWORD2 NAME(GetTexEnvfv)(GLenum target, GLenum pname, GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(TexCoord3i)(GLint s, GLint t, GLint r)
{
- DISPATCH(GetTexEnvfv, (target, pname, params), (F, "glGettexEnvfv(0x%x, 0x%x, %p);", target, pname, (void *) params));
+ DISPATCH(TexCoord3i, (s, t, r), (F, "glTexCoord3i(%d, %d, %d);\n", s, t, r));
}
-KEYWORD1 void KEYWORD2 NAME(GetTexEnviv)(GLenum target, GLenum pname, GLint *params)
+KEYWORD1 void KEYWORD2 NAME(TexCoord3iv)(const GLint * v)
{
- DISPATCH(GetTexEnviv, (target, pname, params), (F, "glGetTexEnviv(0x%x, 0x%x, %p);", target, pname, (void *) params));
+ DISPATCH(TexCoord3iv, (v), (F, "glTexCoord3iv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(GetTexGeniv)(GLenum target, GLenum pname, GLint *params)
+KEYWORD1 void KEYWORD2 NAME(TexCoord3s)(GLshort s, GLshort t, GLshort r)
{
- DISPATCH(GetTexGeniv, (target, pname, params), (F, "glGetTexGeniv(0x%x, 0x%x, %p);", target, pname, (void *) params));
+ DISPATCH(TexCoord3s, (s, t, r), (F, "glTexCoord3s(%d, %d, %d);\n", s, t, r));
}
-KEYWORD1 void KEYWORD2 NAME(GetTexGendv)(GLenum target, GLenum pname, GLdouble *params)
+KEYWORD1 void KEYWORD2 NAME(TexCoord3sv)(const GLshort * v)
{
- DISPATCH(GetTexGendv, (target, pname, params), (F, "glGetTexGendv(0x%x, 0x%x, %p;", target, pname, (void *) params));
+ DISPATCH(TexCoord3sv, (v), (F, "glTexCoord3sv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(GetTexGenfv)(GLenum target, GLenum pname, GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q)
{
- DISPATCH(GetTexGenfv, (target, pname, params), (F, "glGetTexGenfv(0x%x, 0x%x, %p);", target, pname, (void *) params));
+ DISPATCH(TexCoord4d, (s, t, r, q), (F, "glTexCoord4d(%f, %f, %f, %f);\n", s, t, r, q));
}
-KEYWORD1 void KEYWORD2 NAME(GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels)
+KEYWORD1 void KEYWORD2 NAME(TexCoord4dv)(const GLdouble * v)
{
- DISPATCH(GetTexImage, (target, level, format, type, pixels), (F, "glGetTexImage(0x%x, %d, 0x%x, 0x%x, %p);", target, level, format, type, pixels));
+ DISPATCH(TexCoord4dv, (v), (F, "glTexCoord4dv(%p /* %g, %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2], v[3]));
}
-KEYWORD1 void KEYWORD2 NAME(GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
{
- DISPATCH(GetTexLevelParameterfv, (target, level, pname, params), (F, "glGetTexLevelParameterfv(0x%x, %d, 0x%x, %p);", target, level, pname, (void *) params));
+ DISPATCH(TexCoord4f, (s, t, r, q), (F, "glTexCoord4f(%f, %f, %f, %f);\n", s, t, r, q));
}
-KEYWORD1 void KEYWORD2 NAME(GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params)
+KEYWORD1 void KEYWORD2 NAME(TexCoord4fv)(const GLfloat * v)
{
- DISPATCH(GetTexLevelParameteriv, (target, level, pname, params), (F, "glGetTexLevelParameteriv(0x%x, %d, 0x%x, %p);", target, level, pname, (void *) params));
+ DISPATCH(TexCoord4fv, (v), (F, "glTexCoord4fv(%p /* %g, %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2], v[3]));
}
-KEYWORD1 void KEYWORD2 NAME(GetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(TexCoord4i)(GLint s, GLint t, GLint r, GLint q)
{
- DISPATCH(GetTexParameterfv, (target, pname, params), (F, "glGetTexParameterfv(0x%x, 0x%x, %p);", target, pname, (void *) params));
+ DISPATCH(TexCoord4i, (s, t, r, q), (F, "glTexCoord4i(%d, %d, %d, %d);\n", s, t, r, q));
}
-KEYWORD1 void KEYWORD2 NAME(GetTexParameteriv)(GLenum target, GLenum pname, GLint *params)
+KEYWORD1 void KEYWORD2 NAME(TexCoord4iv)(const GLint * v)
{
- DISPATCH(GetTexParameteriv, (target, pname, params), (F, "glGetTexParameteriv(0x%x, 0x%x, %p);", target, pname, (void *) params));
+ DISPATCH(TexCoord4iv, (v), (F, "glTexCoord4iv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(Hint)(GLenum target, GLenum mode)
+KEYWORD1 void KEYWORD2 NAME(TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q)
{
- DISPATCH(Hint, (target, mode), (F, "glHint(0x%x, 0x%x);", target, mode));
+ DISPATCH(TexCoord4s, (s, t, r, q), (F, "glTexCoord4s(%d, %d, %d, %d);\n", s, t, r, q));
}
-KEYWORD1 void KEYWORD2 NAME(Indexd)(GLdouble c)
+KEYWORD1 void KEYWORD2 NAME(TexCoord4sv)(const GLshort * v)
{
- DISPATCH(Indexd, (c), (F, ";"));
+ DISPATCH(TexCoord4sv, (v), (F, "glTexCoord4sv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(Indexdv)(const GLdouble *c)
+KEYWORD1 void KEYWORD2 NAME(Vertex2d)(GLdouble x, GLdouble y)
{
- DISPATCH(Indexdv, (c), (F, ";"));
+ DISPATCH(Vertex2d, (x, y), (F, "glVertex2d(%f, %f);\n", x, y));
}
-KEYWORD1 void KEYWORD2 NAME(Indexf)(GLfloat c)
+KEYWORD1 void KEYWORD2 NAME(Vertex2dv)(const GLdouble * v)
{
- DISPATCH(Indexf, (c), (F, ";"));
+ DISPATCH(Vertex2dv, (v), (F, "glVertex2dv(%p /* %g, %g */);\n", (void *) v, v[0], v[1]));
}
-KEYWORD1 void KEYWORD2 NAME(Indexfv)(const GLfloat *c)
+KEYWORD1 void KEYWORD2 NAME(Vertex2f)(GLfloat x, GLfloat y)
{
- DISPATCH(Indexfv, (c), (F, ";"));
+ DISPATCH(Vertex2f, (x, y), (F, "glVertex2f(%f, %f);\n", x, y));
}
-KEYWORD1 void KEYWORD2 NAME(Indexi)(GLint c)
+KEYWORD1 void KEYWORD2 NAME(Vertex2fv)(const GLfloat * v)
{
- DISPATCH(Indexi, (c), (F, ";"));
+ DISPATCH(Vertex2fv, (v), (F, "glVertex2fv(%p /* %g, %g */);\n", (void *) v, v[0], v[1]));
}
-KEYWORD1 void KEYWORD2 NAME(Indexiv)(const GLint *c)
+KEYWORD1 void KEYWORD2 NAME(Vertex2i)(GLint x, GLint y)
{
- DISPATCH(Indexiv, (c), (F, ";"));
+ DISPATCH(Vertex2i, (x, y), (F, "glVertex2i(%d, %d);\n", x, y));
}
-KEYWORD1 void KEYWORD2 NAME(Indexs)(GLshort c)
+KEYWORD1 void KEYWORD2 NAME(Vertex2iv)(const GLint * v)
{
- DISPATCH(Indexs, (c), (F, ";"));
+ DISPATCH(Vertex2iv, (v), (F, "glVertex2iv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(Indexsv)(const GLshort *c)
+KEYWORD1 void KEYWORD2 NAME(Vertex2s)(GLshort x, GLshort y)
{
- DISPATCH(Indexsv, (c), (F, ";"));
+ DISPATCH(Vertex2s, (x, y), (F, "glVertex2s(%d, %d);\n", x, y));
}
-KEYWORD1 void KEYWORD2 NAME(Indexub)(GLubyte c)
+KEYWORD1 void KEYWORD2 NAME(Vertex2sv)(const GLshort * v)
{
- DISPATCH(Indexub, (c), (F, ";"));
+ DISPATCH(Vertex2sv, (v), (F, "glVertex2sv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(Indexubv)(const GLubyte *c)
+KEYWORD1 void KEYWORD2 NAME(Vertex3d)(GLdouble x, GLdouble y, GLdouble z)
{
- DISPATCH(Indexubv, (c), (F, ";"));
+ DISPATCH(Vertex3d, (x, y, z), (F, "glVertex3d(%f, %f, %f);\n", x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(IndexMask)(GLuint mask)
+KEYWORD1 void KEYWORD2 NAME(Vertex3dv)(const GLdouble * v)
{
- DISPATCH(IndexMask, (mask), (F, "glIndexMask(%u);", mask));
+ DISPATCH(Vertex3dv, (v), (F, "glVertex3dv(%p /* %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 void KEYWORD2 NAME(InitNames)(void)
+KEYWORD1 void KEYWORD2 NAME(Vertex3f)(GLfloat x, GLfloat y, GLfloat z)
{
- DISPATCH(InitNames, (), (F, "glInitNames();"));
+ DISPATCH(Vertex3f, (x, y, z), (F, "glVertex3f(%f, %f, %f);\n", x, y, z));
}
-KEYWORD1 GLboolean KEYWORD2 NAME(IsEnabled)(GLenum cap)
+KEYWORD1 void KEYWORD2 NAME(Vertex3fv)(const GLfloat * v)
{
- RETURN_DISPATCH(IsEnabled, (cap), (F, "glIsEnabled(0x%x);", cap));
+ DISPATCH(Vertex3fv, (v), (F, "glVertex3fv(%p /* %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 GLboolean KEYWORD2 NAME(IsList)(GLuint list)
+KEYWORD1 void KEYWORD2 NAME(Vertex3i)(GLint x, GLint y, GLint z)
+{
+ DISPATCH(Vertex3i, (x, y, z), (F, "glVertex3i(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3iv)(const GLint * v)
+{
+ DISPATCH(Vertex3iv, (v), (F, "glVertex3iv(%p);\n", (void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3s)(GLshort x, GLshort y, GLshort z)
{
- RETURN_DISPATCH(IsList, (list), (F, "glIsList(%u);", list));
+ DISPATCH(Vertex3s, (x, y, z), (F, "glVertex3s(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3sv)(const GLshort * v)
+{
+ DISPATCH(Vertex3sv, (v), (F, "glVertex3sv(%p);\n", (void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(Vertex4d, (x, y, z, w), (F, "glVertex4d(%f, %f, %f, %f);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4dv)(const GLdouble * v)
+{
+ DISPATCH(Vertex4dv, (v), (F, "glVertex4dv(%p /* %g, %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2], v[3]));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(Vertex4f, (x, y, z, w), (F, "glVertex4f(%f, %f, %f, %f);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4fv)(const GLfloat * v)
+{
+ DISPATCH(Vertex4fv, (v), (F, "glVertex4fv(%p /* %g, %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2], v[3]));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4i)(GLint x, GLint y, GLint z, GLint w)
+{
+ DISPATCH(Vertex4i, (x, y, z, w), (F, "glVertex4i(%d, %d, %d, %d);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4iv)(const GLint * v)
+{
+ DISPATCH(Vertex4iv, (v), (F, "glVertex4iv(%p);\n", (void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ DISPATCH(Vertex4s, (x, y, z, w), (F, "glVertex4s(%d, %d, %d, %d);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4sv)(const GLshort * v)
+{
+ DISPATCH(Vertex4sv, (v), (F, "glVertex4sv(%p);\n", (void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClipPlane)(GLenum plane, const GLdouble * equation)
+{
+ DISPATCH(ClipPlane, (plane, equation), (F, "glClipPlane(0x%x, %p);\n", plane, (void *) equation));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorMaterial)(GLenum face, GLenum mode)
+{
+ DISPATCH(ColorMaterial, (face, mode), (F, "glColorMaterial(0x%x, 0x%x);\n", face, mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CullFace)(GLenum mode)
+{
+ DISPATCH(CullFace, (mode), (F, "glCullFace(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Fogf)(GLenum pname, GLfloat param)
+{
+ DISPATCH(Fogf, (pname, param), (F, "glFogf(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Fogfv)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(Fogfv, (pname, params), (F, "glFogfv(0x%x, %p);\n", pname, (void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Fogi)(GLenum pname, GLint param)
+{
+ DISPATCH(Fogi, (pname, param), (F, "glFogi(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Fogiv)(GLenum pname, const GLint * params)
+{
+ DISPATCH(Fogiv, (pname, params), (F, "glFogiv(0x%x, %p);\n", pname, (void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FrontFace)(GLenum mode)
+{
+ DISPATCH(FrontFace, (mode), (F, "glFrontFace(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Hint)(GLenum target, GLenum mode)
+{
+ DISPATCH(Hint, (target, mode), (F, "glHint(0x%x, 0x%x);\n", target, mode));
}
KEYWORD1 void KEYWORD2 NAME(Lightf)(GLenum light, GLenum pname, GLfloat param)
{
- DISPATCH(Lightf, (light, pname, param), (F, "glLightfv(0x%x, 0x%x, %g);", light, pname, param));
+ DISPATCH(Lightf, (light, pname, param), (F, "glLightf(0x%x, 0x%x, %f);\n", light, pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(Lighti)(GLenum light, GLenum pname, GLint param)
+KEYWORD1 void KEYWORD2 NAME(Lightfv)(GLenum light, GLenum pname, const GLfloat * params)
{
- DISPATCH(Lighti, (light, pname, param), (F, "glLighti(0x%x, 0x%x, %d);", light, pname, param));
+ DISPATCH(Lightfv, (light, pname, params), (F, "glLightfv(0x%x, 0x%x, %p);\n", light, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(Lightfv)(GLenum light, GLenum pname, const GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(Lighti)(GLenum light, GLenum pname, GLint param)
{
- DISPATCH(Lightfv, (light, pname, params), (F, "glLightfv(0x%x, 0x%x, %p);", light, pname, (void *) params));
+ DISPATCH(Lighti, (light, pname, param), (F, "glLighti(0x%x, 0x%x, %d);\n", light, pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(Lightiv)(GLenum light, GLenum pname, const GLint *params)
+KEYWORD1 void KEYWORD2 NAME(Lightiv)(GLenum light, GLenum pname, const GLint * params)
{
- DISPATCH(Lightiv, (light, pname, params), (F, "glLightiv(0x%x, 0x%x, %p);", light, pname, (void *) params));
+ DISPATCH(Lightiv, (light, pname, params), (F, "glLightiv(0x%x, 0x%x, %p);\n", light, pname, (void *) params));
}
KEYWORD1 void KEYWORD2 NAME(LightModelf)(GLenum pname, GLfloat param)
{
- DISPATCH(LightModelf, (pname, param), (F, "glLightModelf(0x%x, %f);", pname, param));
+ DISPATCH(LightModelf, (pname, param), (F, "glLightModelf(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LightModelfv)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(LightModelfv, (pname, params), (F, "glLightModelfv(0x%x, %p);\n", pname, (void *) params));
}
KEYWORD1 void KEYWORD2 NAME(LightModeli)(GLenum pname, GLint param)
{
- DISPATCH(LightModeli, (pname, param), (F, "glLightModeli(0x%x, %d);", pname, param));
+ DISPATCH(LightModeli, (pname, param), (F, "glLightModeli(0x%x, %d);\n", pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(LightModelfv)(GLenum pname, const GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(LightModeliv)(GLenum pname, const GLint * params)
{
- DISPATCH(LightModelfv, (pname, params), (F, "glLightModelfv(0x%x, %p);", pname, (void *) params));
+ DISPATCH(LightModeliv, (pname, params), (F, "glLightModeliv(0x%x, %p);\n", pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(LightModeliv)(GLenum pname, const GLint *params)
+KEYWORD1 void KEYWORD2 NAME(LineStipple)(GLint factor, GLushort pattern)
{
- DISPATCH(LightModeliv, (pname, params), (F, "glLightModeliv(0x%x, %p);", pname, (void *) params));
+ DISPATCH(LineStipple, (factor, pattern), (F, "glLineStipple(%d, %d);\n", factor, pattern));
}
KEYWORD1 void KEYWORD2 NAME(LineWidth)(GLfloat width)
{
- DISPATCH(LineWidth, (width), (F, "glLineWidth(%g);", width));
+ DISPATCH(LineWidth, (width), (F, "glLineWidth(%f);\n", width));
}
-KEYWORD1 void KEYWORD2 NAME(LineStipple)(GLint factor, GLushort pattern)
+KEYWORD1 void KEYWORD2 NAME(Materialf)(GLenum face, GLenum pname, GLfloat param)
{
- DISPATCH(LineStipple, (factor, pattern), (F, "glLineStipple(%d, 0x%x);", factor, pattern));
+ DISPATCH(Materialf, (face, pname, param), (F, "glMaterialf(0x%x, 0x%x, %f);\n", face, pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(ListBase)(GLuint base)
+KEYWORD1 void KEYWORD2 NAME(Materialfv)(GLenum face, GLenum pname, const GLfloat * params)
{
- DISPATCH(ListBase, (base), (F, "glListbase(%d);", base));
+ DISPATCH(Materialfv, (face, pname, params), (F, "glMaterialfv(0x%x, 0x%x, %p);\n", face, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(LoadIdentity)(void)
+KEYWORD1 void KEYWORD2 NAME(Materiali)(GLenum face, GLenum pname, GLint param)
{
- DISPATCH(LoadIdentity, (), (F, "glLoadIdentity();"));
+ DISPATCH(Materiali, (face, pname, param), (F, "glMateriali(0x%x, 0x%x, %d);\n", face, pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(LoadMatrixd)(const GLdouble *m)
+KEYWORD1 void KEYWORD2 NAME(Materialiv)(GLenum face, GLenum pname, const GLint * params)
{
- DISPATCH(LoadMatrixd, (m), (F, "glLoadMatirxd(%p);", (void *) m));
+ DISPATCH(Materialiv, (face, pname, params), (F, "glMaterialiv(0x%x, 0x%x, %p);\n", face, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(LoadMatrixf)(const GLfloat *m)
+KEYWORD1 void KEYWORD2 NAME(PointSize)(GLfloat size)
{
- DISPATCH(LoadMatrixf, (m), (F, "glLoadMatrixf(%p);", (void *) m));
+ DISPATCH(PointSize, (size), (F, "glPointSize(%f);\n", size));
}
-KEYWORD1 void KEYWORD2 NAME(LoadName)(GLuint name)
+KEYWORD1 void KEYWORD2 NAME(PolygonMode)(GLenum face, GLenum mode)
{
- DISPATCH(LoadName, (name), (F, "glLoadName(%u);", name));
+ DISPATCH(PolygonMode, (face, mode), (F, "glPolygonMode(0x%x, 0x%x);\n", face, mode));
}
-KEYWORD1 void KEYWORD2 NAME(LogicOp)(GLenum opcode)
+KEYWORD1 void KEYWORD2 NAME(PolygonStipple)(const GLubyte * mask)
{
- DISPATCH(LogicOp, (opcode), (F, "glLogicOp(0x%x);", opcode));
+ DISPATCH(PolygonStipple, (mask), (F, "glPolygonStipple(%p);\n", (void *) mask));
}
-KEYWORD1 void KEYWORD2 NAME(Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points)
+KEYWORD1 void KEYWORD2 NAME(Scissor)(GLint x, GLint y, GLsizei width, GLsizei height)
{
- DISPATCH(Map1d, (target, u1, u2, stride, order, points), (F, ";"));
+ DISPATCH(Scissor, (x, y, width, height), (F, "glScissor(%d, %d, %d, %d);\n", x, y, width, height));
}
-KEYWORD1 void KEYWORD2 NAME(Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points)
+KEYWORD1 void KEYWORD2 NAME(ShadeModel)(GLenum mode)
{
- DISPATCH(Map1f, (target, u1, u2, stride, order, points), (F, ";"));
+ DISPATCH(ShadeModel, (mode), (F, "glShadeModel(0x%x);\n", mode));
}
-KEYWORD1 void KEYWORD2 NAME(Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points)
+KEYWORD1 void KEYWORD2 NAME(TexParameterf)(GLenum target, GLenum pname, GLfloat param)
{
- DISPATCH(Map2d, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points), (F, ";"));
+ DISPATCH(TexParameterf, (target, pname, param), (F, "glTexParameterf(0x%x, 0x%x, %f);\n", target, pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points)
+KEYWORD1 void KEYWORD2 NAME(TexParameterfv)(GLenum target, GLenum pname, const GLfloat * params)
{
- DISPATCH(Map2f, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points), (F, ";"));
+ DISPATCH(TexParameterfv, (target, pname, params), (F, "glTexParameterfv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(MapGrid1d)(GLint un, GLdouble u1, GLdouble u2)
+KEYWORD1 void KEYWORD2 NAME(TexParameteri)(GLenum target, GLenum pname, GLint param)
{
- DISPATCH(MapGrid1d, (un, u1, u2), (F, ";"));
+ DISPATCH(TexParameteri, (target, pname, param), (F, "glTexParameteri(0x%x, 0x%x, %d);\n", target, pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(MapGrid1f)(GLint un, GLfloat u1, GLfloat u2)
+KEYWORD1 void KEYWORD2 NAME(TexParameteriv)(GLenum target, GLenum pname, const GLint * params)
{
- DISPATCH(MapGrid1f, (un, u1, u2), (F, ";"));
+ DISPATCH(TexParameteriv, (target, pname, params), (F, "glTexParameteriv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
+KEYWORD1 void KEYWORD2 NAME(TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
{
- DISPATCH(MapGrid2d, (un, u1, u2, vn, v1, v2), (F, ";"));
+ DISPATCH(TexImage1D, (target, level, internalformat, width, border, format, type, pixels), (F, "glTexImage1D(0x%x, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, border, format, type, (void *) pixels));
}
-KEYWORD1 void KEYWORD2 NAME(MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
+KEYWORD1 void KEYWORD2 NAME(TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
{
- DISPATCH(MapGrid2f, (un, u1, u2, vn, v1, v2), (F, ";"));
+ DISPATCH(TexImage2D, (target, level, internalformat, width, height, border, format, type, pixels), (F, "glTexImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, border, format, type, (void *) pixels));
}
-KEYWORD1 void KEYWORD2 NAME(Materialf)(GLenum face, GLenum pname, GLfloat param)
+KEYWORD1 void KEYWORD2 NAME(TexEnvf)(GLenum target, GLenum pname, GLfloat param)
{
- DISPATCH(Materialf, (face, pname, param), (F, ";"));
+ DISPATCH(TexEnvf, (target, pname, param), (F, "glTexEnvf(0x%x, 0x%x, %f);\n", target, pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(Materiali)(GLenum face, GLenum pname, GLint param)
+KEYWORD1 void KEYWORD2 NAME(TexEnvfv)(GLenum target, GLenum pname, const GLfloat * params)
{
- DISPATCH(Materiali, (face, pname, param), (F, ";"));
+ DISPATCH(TexEnvfv, (target, pname, params), (F, "glTexEnvfv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(Materialfv)(GLenum face, GLenum pname, const GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(TexEnvi)(GLenum target, GLenum pname, GLint param)
{
- DISPATCH(Materialfv, (face, pname, params), (F, ";"));
+ DISPATCH(TexEnvi, (target, pname, param), (F, "glTexEnvi(0x%x, 0x%x, %d);\n", target, pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(Materialiv)(GLenum face, GLenum pname, const GLint *params)
+KEYWORD1 void KEYWORD2 NAME(TexEnviv)(GLenum target, GLenum pname, const GLint * params)
{
- DISPATCH(Materialiv, (face, pname, params), (F, ";"));
+ DISPATCH(TexEnviv, (target, pname, params), (F, "glTexEnviv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(MatrixMode)(GLenum mode)
+KEYWORD1 void KEYWORD2 NAME(TexGend)(GLenum coord, GLenum pname, GLdouble param)
{
- DISPATCH(MatrixMode, (mode), (F, "glMatrixMode(0x%x);", mode));
+ DISPATCH(TexGend, (coord, pname, param), (F, "glTexGend(0x%x, 0x%x, %f);\n", coord, pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(MultMatrixd)(const GLdouble *m)
+KEYWORD1 void KEYWORD2 NAME(TexGendv)(GLenum coord, GLenum pname, const GLdouble * params)
{
- DISPATCH(MultMatrixd, (m), (F, "glMultMatrixd(%p);", (void *) m));
+ DISPATCH(TexGendv, (coord, pname, params), (F, "glTexGendv(0x%x, 0x%x, %p);\n", coord, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(MultMatrixf)(const GLfloat *m)
+KEYWORD1 void KEYWORD2 NAME(TexGenf)(GLenum coord, GLenum pname, GLfloat param)
{
- DISPATCH(MultMatrixf, (m), (F, "glMultMatrixf(%p);", (void *) m));
+ DISPATCH(TexGenf, (coord, pname, param), (F, "glTexGenf(0x%x, 0x%x, %f);\n", coord, pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(NewList)(GLuint list, GLenum mode)
+KEYWORD1 void KEYWORD2 NAME(TexGenfv)(GLenum coord, GLenum pname, const GLfloat * params)
{
- DISPATCH(NewList, (list, mode), (F, ";"));
+ DISPATCH(TexGenfv, (coord, pname, params), (F, "glTexGenfv(0x%x, 0x%x, %p);\n", coord, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz)
+KEYWORD1 void KEYWORD2 NAME(TexGeni)(GLenum coord, GLenum pname, GLint param)
{
- DISPATCH(Normal3b, (nx, ny, nz), (F, "glNormal3b(%d, %d, %d);", nx, ny, nz));
+ DISPATCH(TexGeni, (coord, pname, param), (F, "glTexGeni(0x%x, 0x%x, %d);\n", coord, pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(Normal3bv)(const GLbyte *v)
+KEYWORD1 void KEYWORD2 NAME(TexGeniv)(GLenum coord, GLenum pname, const GLint * params)
{
- DISPATCH(Normal3bv, (v), (F, "glNormal3bv(%p);", (void *) v));
+ DISPATCH(TexGeniv, (coord, pname, params), (F, "glTexGeniv(0x%x, 0x%x, %p);\n", coord, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz)
+KEYWORD1 void KEYWORD2 NAME(FeedbackBuffer)(GLsizei size, GLenum type, GLfloat * buffer)
{
- DISPATCH(Normal3d, (nx, ny, nz), (F, "glNormal3d(%f, %f, %f);", nx, ny, nz));
+ DISPATCH(FeedbackBuffer, (size, type, buffer), (F, "glFeedbackBuffer(%d, 0x%x, %p);\n", size, type, (void *) buffer));
}
-KEYWORD1 void KEYWORD2 NAME(Normal3dv)(const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(SelectBuffer)(GLsizei size, GLuint * buffer)
{
- DISPATCH(Normal3dv, (v), (F, "glNormal3dv(%p);", (void *) v));
+ DISPATCH(SelectBuffer, (size, buffer), (F, "glSelectBuffer(%d, %p);\n", size, (void *) buffer));
}
-KEYWORD1 void KEYWORD2 NAME(Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz)
+KEYWORD1 GLint KEYWORD2 NAME(RenderMode)(GLenum mode)
{
- DISPATCH(Normal3f, (nx, ny, nz), (F, "glNormal3f(%g, %g, %g);", nx, ny, nz));
+ RETURN_DISPATCH(RenderMode, (mode), (F, "glRenderMode(0x%x);\n", mode));
}
-KEYWORD1 void KEYWORD2 NAME(Normal3fv)(const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(InitNames)(void)
{
- DISPATCH(Normal3fv, (v), (F, "glNormal3fv(%p);", (void *) v));
+ DISPATCH(InitNames, (), (F, "glInitNames();\n"));
}
-KEYWORD1 void KEYWORD2 NAME(Normal3i)(GLint nx, GLint ny, GLint nz)
+KEYWORD1 void KEYWORD2 NAME(LoadName)(GLuint name)
{
- DISPATCH(Normal3i, (nx, ny, nz), (F, "glNormal3i(%d, %d, %d);", nx, ny, nz));
+ DISPATCH(LoadName, (name), (F, "glLoadName(%d);\n", name));
}
-KEYWORD1 void KEYWORD2 NAME(Normal3iv)(const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(PassThrough)(GLfloat token)
{
- DISPATCH(Normal3iv, (v), (F, "glNormal3iv(%p);", (void *) v));
+ DISPATCH(PassThrough, (token), (F, "glPassThrough(%f);\n", token));
}
-KEYWORD1 void KEYWORD2 NAME(Normal3s)(GLshort nx, GLshort ny, GLshort nz)
+KEYWORD1 void KEYWORD2 NAME(PopName)(void)
{
- DISPATCH(Normal3s, (nx, ny, nz), (F, "glNormal3s(%d, %d, %d);", nx, ny, nz));
+ DISPATCH(PopName, (), (F, "glPopName();\n"));
}
-KEYWORD1 void KEYWORD2 NAME(Normal3sv)(const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(PushName)(GLuint name)
{
- DISPATCH(Normal3sv, (v), (F, "glNormal3sv(%p);", (void *) v));
+ DISPATCH(PushName, (name), (F, "glPushName(%d);\n", name));
}
-KEYWORD1 void KEYWORD2 NAME(Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
+KEYWORD1 void KEYWORD2 NAME(DrawBuffer)(GLenum mode)
{
- DISPATCH(Ortho, (left, right, bottom, top, nearval, farval), (F, "glOrtho(%f, %f, %f, %f, %f, %f);", left, right, bottom, top, nearval, farval));
+ DISPATCH(DrawBuffer, (mode), (F, "glDrawBuffer(0x%x);\n", mode));
}
-KEYWORD1 void KEYWORD2 NAME(PassThrough)(GLfloat token)
+KEYWORD1 void KEYWORD2 NAME(Clear)(GLbitfield mask)
{
- DISPATCH(PassThrough, (token), (F, "glPassThrough(%f);", token));
+ DISPATCH(Clear, (mask), (F, "glClear(%p);\n", (void *) mask));
}
-KEYWORD1 void KEYWORD2 NAME(PixelMapfv)(GLenum map, GLint mapsize, const GLfloat *values)
+KEYWORD1 void KEYWORD2 NAME(ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
{
- DISPATCH(PixelMapfv, (map, mapsize, values), (F, ";"));
+ DISPATCH(ClearAccum, (red, green, blue, alpha), (F, "glClearAccum(%f, %f, %f, %f);\n", red, green, blue, alpha));
}
-KEYWORD1 void KEYWORD2 NAME(PixelMapuiv)(GLenum map, GLint mapsize, const GLuint *values)
+KEYWORD1 void KEYWORD2 NAME(ClearIndex)(GLfloat c)
{
- DISPATCH(PixelMapuiv, (map, mapsize, values), (F, ";"));
+ DISPATCH(ClearIndex, (c), (F, "glClearIndex(%f);\n", c));
}
-KEYWORD1 void KEYWORD2 NAME(PixelMapusv)(GLenum map, GLint mapsize, const GLushort *values)
+KEYWORD1 void KEYWORD2 NAME(ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
- DISPATCH(PixelMapusv, (map, mapsize, values), (F, ";"));
+ DISPATCH(ClearColor, (red, green, blue, alpha), (F, "glClearColor(%f, %f, %f, %f);\n", red, green, blue, alpha));
}
-KEYWORD1 void KEYWORD2 NAME(PixelStoref)(GLenum pname, GLfloat param)
+KEYWORD1 void KEYWORD2 NAME(ClearStencil)(GLint s)
{
- DISPATCH(PixelStoref, (pname, param), (F, "glPixelStoref(0x%x, %f);", pname, param));
+ DISPATCH(ClearStencil, (s), (F, "glClearStencil(%d);\n", s));
}
-KEYWORD1 void KEYWORD2 NAME(PixelStorei)(GLenum pname, GLint param)
+KEYWORD1 void KEYWORD2 NAME(ClearDepth)(GLclampd depth)
{
- DISPATCH(PixelStorei, (pname, param), (F, "glPixelStorei(0x%x, %d);", pname, param));
+ DISPATCH(ClearDepth, (depth), (F, "glClearDepth(%f);\n", depth));
}
-KEYWORD1 void KEYWORD2 NAME(PixelTransferf)(GLenum pname, GLfloat param)
+KEYWORD1 void KEYWORD2 NAME(StencilMask)(GLuint mask)
{
- DISPATCH(PixelTransferf, (pname, param), (F, "glPixelTransferf(0x%x, %f);", pname, param));
+ DISPATCH(StencilMask, (mask), (F, "glStencilMask(%d);\n", mask));
}
-KEYWORD1 void KEYWORD2 NAME(PixelTransferi)(GLenum pname, GLint param)
+KEYWORD1 void KEYWORD2 NAME(ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
{
- DISPATCH(PixelTransferi, (pname, param), (F, "glPixelTransferi(0x%x, %d);", pname, param));
+ DISPATCH(ColorMask, (red, green, blue, alpha), (F, "glColorMask(%d, %d, %d, %d);\n", red, green, blue, alpha));
}
-KEYWORD1 void KEYWORD2 NAME(PixelZoom)(GLfloat xfactor, GLfloat yfactor)
+KEYWORD1 void KEYWORD2 NAME(DepthMask)(GLboolean flag)
{
- DISPATCH(PixelZoom, (xfactor, yfactor), (F, "glPixelZoom(%f, %f);", xfactor, yfactor));
+ DISPATCH(DepthMask, (flag), (F, "glDepthMask(%d);\n", flag));
}
-KEYWORD1 void KEYWORD2 NAME(PointSize)(GLfloat size)
+KEYWORD1 void KEYWORD2 NAME(IndexMask)(GLuint mask)
{
- DISPATCH(PointSize, (size), (F, "glPointSize(%f);", size));
+ DISPATCH(IndexMask, (mask), (F, "glIndexMask(%d);\n", mask));
}
-KEYWORD1 void KEYWORD2 NAME(PolygonMode)(GLenum face, GLenum mode)
+KEYWORD1 void KEYWORD2 NAME(Accum)(GLenum op, GLfloat value)
{
- DISPATCH(PolygonMode, (face, mode), (F, "glPolygonMode(0x%x, 0x%x);", face, mode));
+ DISPATCH(Accum, (op, value), (F, "glAccum(0x%x, %f);\n", op, value));
}
-KEYWORD1 void KEYWORD2 NAME(PolygonStipple)(const GLubyte *pattern)
+KEYWORD1 void KEYWORD2 NAME(Disable)(GLenum cap)
{
- DISPATCH(PolygonStipple, (pattern), (F, "glPolygonStipple(%p);", pattern));
+ DISPATCH(Disable, (cap), (F, "glDisable(0x%x);\n", cap));
}
-KEYWORD1 void KEYWORD2 NAME(PopAttrib)(void)
+KEYWORD1 void KEYWORD2 NAME(Enable)(GLenum cap)
{
- DISPATCH(PopAttrib, (), (F, "glPopAttrib();"));
+ DISPATCH(Enable, (cap), (F, "glEnable(0x%x);\n", cap));
}
-KEYWORD1 void KEYWORD2 NAME(PopMatrix)(void)
+KEYWORD1 void KEYWORD2 NAME(Finish)(void)
{
- DISPATCH(PopMatrix, (), (F, "glPopMatrix();"));
+ DISPATCH(Finish, (), (F, "glFinish();\n"));
}
-KEYWORD1 void KEYWORD2 NAME(PopName)(void)
+KEYWORD1 void KEYWORD2 NAME(Flush)(void)
+{
+ DISPATCH(Flush, (), (F, "glFlush();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PopAttrib)(void)
{
- DISPATCH(PopName, (), (F, "glPopName();"));
+ DISPATCH(PopAttrib, (), (F, "glPopAttrib();\n"));
}
KEYWORD1 void KEYWORD2 NAME(PushAttrib)(GLbitfield mask)
{
- DISPATCH(PushAttrib, (mask), (F, "glPushAttrib(0x%x)", mask));
+ DISPATCH(PushAttrib, (mask), (F, "glPushAttrib(%p);\n", (void *) mask));
}
-KEYWORD1 void KEYWORD2 NAME(PushMatrix)(void)
+KEYWORD1 void KEYWORD2 NAME(Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points)
{
- DISPATCH(PushMatrix, (), (F, "glPushMatrix();"));
+ DISPATCH(Map1d, (target, u1, u2, stride, order, points), (F, "glMap1d(0x%x, %f, %f, %d, %d, %p);\n", target, u1, u2, stride, order, (void *) points));
}
-KEYWORD1 void KEYWORD2 NAME(PushName)(GLuint name)
+KEYWORD1 void KEYWORD2 NAME(Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points)
{
- DISPATCH(PushName, (name), (F, "glPushName(%u)", name));
+ DISPATCH(Map1f, (target, u1, u2, stride, order, points), (F, "glMap1f(0x%x, %f, %f, %d, %d, %p);\n", target, u1, u2, stride, order, (void *) points));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos2d)(GLdouble x, GLdouble y)
+KEYWORD1 void KEYWORD2 NAME(Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points)
{
- DISPATCH(RasterPos2d, (x, y), (F, "glRasterPos2d(%g, %g);", x, y));
+ DISPATCH(Map2d, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points), (F, "glMap2d(0x%x, %f, %f, %d, %d, %f, %f, %d, %d, %p);\n", target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, (void *) points));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos2f)(GLfloat x, GLfloat y)
+KEYWORD1 void KEYWORD2 NAME(Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points)
{
- DISPATCH(RasterPos2f, (x, y), (F, "glRasterPos2f(%g, %g);", x, y));
+ DISPATCH(Map2f, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points), (F, "glMap2f(0x%x, %f, %f, %d, %d, %f, %f, %d, %d, %p);\n", target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, (void *) points));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos2i)(GLint x, GLint y)
+KEYWORD1 void KEYWORD2 NAME(MapGrid1d)(GLint un, GLdouble u1, GLdouble u2)
{
- DISPATCH(RasterPos2i, (x, y), (F, "glRasterPos2i(%d, %d);", x, y));
+ DISPATCH(MapGrid1d, (un, u1, u2), (F, "glMapGrid1d(%d, %f, %f);\n", un, u1, u2));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos2s)(GLshort x, GLshort y)
+KEYWORD1 void KEYWORD2 NAME(MapGrid1f)(GLint un, GLfloat u1, GLfloat u2)
{
- DISPATCH(RasterPos2s, (x, y), (F, "glRasterPos2s(%d, %d);", x, y));
+ DISPATCH(MapGrid1f, (un, u1, u2), (F, "glMapGrid1f(%d, %f, %f);\n", un, u1, u2));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos3d)(GLdouble x, GLdouble y, GLdouble z)
+KEYWORD1 void KEYWORD2 NAME(MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
{
- DISPATCH(RasterPos3d, (x, y, z), (F, "glRasterPos3d(%g, %g, %g);", x, y, z));
+ DISPATCH(MapGrid2d, (un, u1, u2, vn, v1, v2), (F, "glMapGrid2d(%d, %f, %f, %d, %f, %f);\n", un, u1, u2, vn, v1, v2));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos3f)(GLfloat x, GLfloat y, GLfloat z)
+KEYWORD1 void KEYWORD2 NAME(MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
{
- DISPATCH(RasterPos3f, (x, y, z), (F, "glRasterPos3f(%g, %g, %g);", x, y, z));
+ DISPATCH(MapGrid2f, (un, u1, u2, vn, v1, v2), (F, "glMapGrid2f(%d, %f, %f, %d, %f, %f);\n", un, u1, u2, vn, v1, v2));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos3i)(GLint x, GLint y, GLint z)
+KEYWORD1 void KEYWORD2 NAME(EvalCoord1d)(GLdouble u)
{
- DISPATCH(RasterPos3i, (x, y, z), (F, "glRasterPos3i(%d, %d, %d);", x, y, z));
+ DISPATCH(EvalCoord1d, (u), (F, "glEvalCoord1d(%f);\n", u));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos3s)(GLshort x, GLshort y, GLshort z)
+KEYWORD1 void KEYWORD2 NAME(EvalCoord1dv)(const GLdouble * u)
{
- DISPATCH(RasterPos3s, (x, y, z), (F, "glRasterPos3s(%d, %d, %d);", x, y, z));
+ DISPATCH(EvalCoord1dv, (u), (F, "glEvalCoord1dv(%p);\n", (void *) u));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+KEYWORD1 void KEYWORD2 NAME(EvalCoord1f)(GLfloat u)
{
- DISPATCH(RasterPos4d, (x, y, z, w), (F, "glRasterPos4d(%g, %g, %g, %g);", x, y, z, w));
+ DISPATCH(EvalCoord1f, (u), (F, "glEvalCoord1f(%f);\n", u));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+KEYWORD1 void KEYWORD2 NAME(EvalCoord1fv)(const GLfloat * u)
{
- DISPATCH(RasterPos4f, (x, y, z, w), (F, "glRasterPos4f(%g, %g, %g, %g);", x, y, z, w));
+ DISPATCH(EvalCoord1fv, (u), (F, "glEvalCoord1fv(%p);\n", (void *) u));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos4i)(GLint x, GLint y, GLint z, GLint w)
+KEYWORD1 void KEYWORD2 NAME(EvalCoord2d)(GLdouble u, GLdouble v)
{
- DISPATCH(RasterPos4i, (x, y, z, w), (F, "glRasterPos4i(%d, %d, %d, %d);", x, y, z, w));
+ DISPATCH(EvalCoord2d, (u, v), (F, "glEvalCoord2d(%f, %f);\n", u, v));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w)
+KEYWORD1 void KEYWORD2 NAME(EvalCoord2dv)(const GLdouble * u)
{
- DISPATCH(RasterPos4s, (x, y, z, w), (F, "glRasterPos4s(%d, %d, %d, %d);", x, y, z, w));
+ DISPATCH(EvalCoord2dv, (u), (F, "glEvalCoord2dv(%p /* %g, %g */);\n", (void *) u, u[0], u[1]));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos2dv)(const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(EvalCoord2f)(GLfloat u, GLfloat v)
{
- DISPATCH(RasterPos2dv, (v), (F, ";"));
+ DISPATCH(EvalCoord2f, (u, v), (F, "glEvalCoord2f(%f, %f);\n", u, v));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos2fv)(const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(EvalCoord2fv)(const GLfloat * u)
{
- DISPATCH(RasterPos2fv, (v), (F, ";"));
+ DISPATCH(EvalCoord2fv, (u), (F, "glEvalCoord2fv(%p /* %g, %g */);\n", (void *) u, u[0], u[1]));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos2iv)(const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(EvalMesh1)(GLenum mode, GLint i1, GLint i2)
{
- DISPATCH(RasterPos2iv, (v), (F, ";"));
+ DISPATCH(EvalMesh1, (mode, i1, i2), (F, "glEvalMesh1(0x%x, %d, %d);\n", mode, i1, i2));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos2sv)(const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(EvalPoint1)(GLint i)
{
- DISPATCH(RasterPos2sv, (v), (F, ";"));
+ DISPATCH(EvalPoint1, (i), (F, "glEvalPoint1(%d);\n", i));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos3dv)(const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
{
- DISPATCH(RasterPos3dv, (v), (F, ";"));
+ DISPATCH(EvalMesh2, (mode, i1, i2, j1, j2), (F, "glEvalMesh2(0x%x, %d, %d, %d, %d);\n", mode, i1, i2, j1, j2));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos3fv)(const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(EvalPoint2)(GLint i, GLint j)
{
- DISPATCH(RasterPos3fv, (v), (F, ";"));
+ DISPATCH(EvalPoint2, (i, j), (F, "glEvalPoint2(%d, %d);\n", i, j));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos3iv)(const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(AlphaFunc)(GLenum func, GLclampf ref)
{
- DISPATCH(RasterPos3iv, (v), (F, ";"));
+ DISPATCH(AlphaFunc, (func, ref), (F, "glAlphaFunc(0x%x, %f);\n", func, ref));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos3sv)(const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(BlendFunc)(GLenum sfactor, GLenum dfactor)
{
- DISPATCH(RasterPos3sv, (v), (F, ";"));
+ DISPATCH(BlendFunc, (sfactor, dfactor), (F, "glBlendFunc(0x%x, 0x%x);\n", sfactor, dfactor));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos4dv)(const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(LogicOp)(GLenum opcode)
{
- DISPATCH(RasterPos4dv, (v), (F, ";"));
+ DISPATCH(LogicOp, (opcode), (F, "glLogicOp(0x%x);\n", opcode));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos4fv)(const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(StencilFunc)(GLenum func, GLint ref, GLuint mask)
{
- DISPATCH(RasterPos4fv, (v), (F, ";"));
+ DISPATCH(StencilFunc, (func, ref, mask), (F, "glStencilFunc(0x%x, %d, %d);\n", func, ref, mask));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos4iv)(const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(StencilOp)(GLenum fail, GLenum zfail, GLenum zpass)
{
- DISPATCH(RasterPos4iv, (v), (F, ";"));
+ DISPATCH(StencilOp, (fail, zfail, zpass), (F, "glStencilOp(0x%x, 0x%x, 0x%x);\n", fail, zfail, zpass));
}
-KEYWORD1 void KEYWORD2 NAME(RasterPos4sv)(const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(DepthFunc)(GLenum func)
+{
+ DISPATCH(DepthFunc, (func), (F, "glDepthFunc(0x%x);\n", func));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelZoom)(GLfloat xfactor, GLfloat yfactor)
+{
+ DISPATCH(PixelZoom, (xfactor, yfactor), (F, "glPixelZoom(%f, %f);\n", xfactor, yfactor));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelTransferf)(GLenum pname, GLfloat param)
+{
+ DISPATCH(PixelTransferf, (pname, param), (F, "glPixelTransferf(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelTransferi)(GLenum pname, GLint param)
{
- DISPATCH(RasterPos4sv, (v), (F, ";"));
+ DISPATCH(PixelTransferi, (pname, param), (F, "glPixelTransferi(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelStoref)(GLenum pname, GLfloat param)
+{
+ DISPATCH(PixelStoref, (pname, param), (F, "glPixelStoref(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelStorei)(GLenum pname, GLint param)
+{
+ DISPATCH(PixelStorei, (pname, param), (F, "glPixelStorei(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelMapfv)(GLenum map, GLint mapsize, const GLfloat * values)
+{
+ DISPATCH(PixelMapfv, (map, mapsize, values), (F, "glPixelMapfv(0x%x, %d, %p);\n", map, mapsize, (void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelMapuiv)(GLenum map, GLint mapsize, const GLuint * values)
+{
+ DISPATCH(PixelMapuiv, (map, mapsize, values), (F, "glPixelMapuiv(0x%x, %d, %p);\n", map, mapsize, (void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelMapusv)(GLenum map, GLint mapsize, const GLushort * values)
+{
+ DISPATCH(PixelMapusv, (map, mapsize, values), (F, "glPixelMapusv(0x%x, %d, %p);\n", map, mapsize, (void *) values));
}
KEYWORD1 void KEYWORD2 NAME(ReadBuffer)(GLenum mode)
{
- DISPATCH(ReadBuffer, (mode), (F, ";"));
+ DISPATCH(ReadBuffer, (mode), (F, "glReadBuffer(0x%x);\n", mode));
}
-KEYWORD1 void KEYWORD2 NAME(ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
+KEYWORD1 void KEYWORD2 NAME(CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
{
- DISPATCH(ReadPixels, (x, y, width, height, format, type, pixels), (F, ";"));
+ DISPATCH(CopyPixels, (x, y, width, height, type), (F, "glCopyPixels(%d, %d, %d, %d, 0x%x);\n", x, y, width, height, type));
}
-KEYWORD1 void KEYWORD2 NAME(Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
+KEYWORD1 void KEYWORD2 NAME(ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels)
{
- DISPATCH(Rectd, (x1, y1, x2, y2), (F, ";"));
+ DISPATCH(ReadPixels, (x, y, width, height, format, type, pixels), (F, "glReadPixels(%d, %d, %d, %d, 0x%x, 0x%x, %p);\n", x, y, width, height, format, type, (void *) pixels));
}
-KEYWORD1 void KEYWORD2 NAME(Rectdv)(const GLdouble *v1, const GLdouble *v2)
+KEYWORD1 void KEYWORD2 NAME(DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
{
- DISPATCH(Rectdv, (v1, v2), (F, ";"));
+ DISPATCH(DrawPixels, (width, height, format, type, pixels), (F, "glDrawPixels(%d, %d, 0x%x, 0x%x, %p);\n", width, height, format, type, (void *) pixels));
}
-KEYWORD1 void KEYWORD2 NAME(Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
+KEYWORD1 void KEYWORD2 NAME(GetBooleanv)(GLenum pname, GLboolean * params)
{
- DISPATCH(Rectf, (x1, y1, x2, y2), (F, ";"));
+ DISPATCH(GetBooleanv, (pname, params), (F, "glGetBooleanv(0x%x, %p);\n", pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(Rectfv)(const GLfloat *v1, const GLfloat *v2)
+KEYWORD1 void KEYWORD2 NAME(GetClipPlane)(GLenum plane, GLdouble * equation)
{
- DISPATCH(Rectfv, (v1, v2), (F, ";"));
+ DISPATCH(GetClipPlane, (plane, equation), (F, "glGetClipPlane(0x%x, %p);\n", plane, (void *) equation));
}
-KEYWORD1 void KEYWORD2 NAME(Recti)(GLint x1, GLint y1, GLint x2, GLint y2)
+KEYWORD1 void KEYWORD2 NAME(GetDoublev)(GLenum pname, GLdouble * params)
{
- DISPATCH(Recti, (x1, y1, x2, y2), (F, ";"));
+ DISPATCH(GetDoublev, (pname, params), (F, "glGetDoublev(0x%x, %p);\n", pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(Rectiv)(const GLint *v1, const GLint *v2)
+KEYWORD1 GLenum KEYWORD2 NAME(GetError)(void)
{
- DISPATCH(Rectiv, (v1, v2), (F, ";"));
+ RETURN_DISPATCH(GetError, (), (F, "glGetError();\n"));
}
-KEYWORD1 void KEYWORD2 NAME(Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
+KEYWORD1 void KEYWORD2 NAME(GetFloatv)(GLenum pname, GLfloat * params)
{
- DISPATCH(Rects, (x1, y1, x2, y2), (F, ";"));
+ DISPATCH(GetFloatv, (pname, params), (F, "glGetFloatv(0x%x, %p);\n", pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(Rectsv)(const GLshort *v1, const GLshort *v2)
+KEYWORD1 void KEYWORD2 NAME(GetIntegerv)(GLenum pname, GLint * params)
{
- DISPATCH(Rectsv, (v1, v2), (F, ";"));
+ DISPATCH(GetIntegerv, (pname, params), (F, "glGetIntegerv(0x%x, %p);\n", pname, (void *) params));
}
-KEYWORD1 GLint KEYWORD2 NAME(RenderMode)(GLenum mode)
+KEYWORD1 void KEYWORD2 NAME(GetLightfv)(GLenum light, GLenum pname, GLfloat * params)
{
- RETURN_DISPATCH(RenderMode, (mode), (F, "glRenderMode(0x%x);", mode));
+ DISPATCH(GetLightfv, (light, pname, params), (F, "glGetLightfv(0x%x, 0x%x, %p);\n", light, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
+KEYWORD1 void KEYWORD2 NAME(GetLightiv)(GLenum light, GLenum pname, GLint * params)
{
- DISPATCH(Rotated, (angle, x, y, z), (F, ";"));
+ DISPATCH(GetLightiv, (light, pname, params), (F, "glGetLightiv(0x%x, 0x%x, %p);\n", light, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
+KEYWORD1 void KEYWORD2 NAME(GetMapdv)(GLenum target, GLenum query, GLdouble * v)
{
- DISPATCH(Rotatef, (angle, x, y, z), (F, "glRotatef(%g, %g, %g, %g);", angle, x, y, z));
+ DISPATCH(GetMapdv, (target, query, v), (F, "glGetMapdv(0x%x, 0x%x, %p);\n", target, query, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(SelectBuffer)(GLsizei size, GLuint *buffer)
+KEYWORD1 void KEYWORD2 NAME(GetMapfv)(GLenum target, GLenum query, GLfloat * v)
{
- DISPATCH(SelectBuffer, (size, buffer), (F, ";"));
+ DISPATCH(GetMapfv, (target, query, v), (F, "glGetMapfv(0x%x, 0x%x, %p);\n", target, query, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(Scaled)(GLdouble x, GLdouble y, GLdouble z)
+KEYWORD1 void KEYWORD2 NAME(GetMapiv)(GLenum target, GLenum query, GLint * v)
{
- DISPATCH(Scaled, (x, y, z), (F, ";"));
+ DISPATCH(GetMapiv, (target, query, v), (F, "glGetMapiv(0x%x, 0x%x, %p);\n", target, query, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(Scalef)(GLfloat x, GLfloat y, GLfloat z)
+KEYWORD1 void KEYWORD2 NAME(GetMaterialfv)(GLenum face, GLenum pname, GLfloat * params)
{
- DISPATCH(Scalef, (x, y, z), (F, "glScalef(%g, %g, %g);", x, y, z));
+ DISPATCH(GetMaterialfv, (face, pname, params), (F, "glGetMaterialfv(0x%x, 0x%x, %p);\n", face, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(Scissor)(GLint x, GLint y, GLsizei width, GLsizei height)
+KEYWORD1 void KEYWORD2 NAME(GetMaterialiv)(GLenum face, GLenum pname, GLint * params)
{
- DISPATCH(Scissor, (x, y, width, height), (F, "glScissor(%d, %d, %d, %d);", x, y, width, height));
+ DISPATCH(GetMaterialiv, (face, pname, params), (F, "glGetMaterialiv(0x%x, 0x%x, %p);\n", face, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(ShadeModel)(GLenum mode)
+KEYWORD1 void KEYWORD2 NAME(GetPixelMapfv)(GLenum map, GLfloat * values)
{
- DISPATCH(ShadeModel, (mode), (F, "glShadeModel(0x%x);", mode));
+ DISPATCH(GetPixelMapfv, (map, values), (F, "glGetPixelMapfv(0x%x, %p);\n", map, (void *) values));
}
-KEYWORD1 void KEYWORD2 NAME(StencilFunc)(GLenum func, GLint ref, GLuint mask)
+KEYWORD1 void KEYWORD2 NAME(GetPixelMapuiv)(GLenum map, GLuint * values)
{
- DISPATCH(StencilFunc, (func, ref, mask), (F, ";"));
+ DISPATCH(GetPixelMapuiv, (map, values), (F, "glGetPixelMapuiv(0x%x, %p);\n", map, (void *) values));
}
-KEYWORD1 void KEYWORD2 NAME(StencilMask)(GLuint mask)
+KEYWORD1 void KEYWORD2 NAME(GetPixelMapusv)(GLenum map, GLushort * values)
{
- DISPATCH(StencilMask, (mask), (F, ";"));
+ DISPATCH(GetPixelMapusv, (map, values), (F, "glGetPixelMapusv(0x%x, %p);\n", map, (void *) values));
}
-KEYWORD1 void KEYWORD2 NAME(StencilOp)(GLenum fail, GLenum zfail, GLenum zpass)
+KEYWORD1 void KEYWORD2 NAME(GetPolygonStipple)(GLubyte * mask)
{
- DISPATCH(StencilOp, (fail, zfail, zpass), (F, ";"));
+ DISPATCH(GetPolygonStipple, (mask), (F, "glGetPolygonStipple(%p);\n", (void *) mask));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord1d)(GLdouble s)
+KEYWORD1 const GLubyte * KEYWORD2 NAME(GetString)(GLenum name)
{
- DISPATCH(TexCoord1d, (s), (F, ";"));
+ RETURN_DISPATCH(GetString, (name), (F, "glGetString(0x%x);\n", name));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord1f)(GLfloat s)
+KEYWORD1 void KEYWORD2 NAME(GetTexEnvfv)(GLenum target, GLenum pname, GLfloat * params)
{
- DISPATCH(TexCoord1f, (s), (F, ";"));
+ DISPATCH(GetTexEnvfv, (target, pname, params), (F, "glGetTexEnvfv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord1i)(GLint s)
+KEYWORD1 void KEYWORD2 NAME(GetTexEnviv)(GLenum target, GLenum pname, GLint * params)
{
- DISPATCH(TexCoord1i, (s), (F, ";"));
+ DISPATCH(GetTexEnviv, (target, pname, params), (F, "glGetTexEnviv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord1s)(GLshort s)
+KEYWORD1 void KEYWORD2 NAME(GetTexGendv)(GLenum coord, GLenum pname, GLdouble * params)
{
- DISPATCH(TexCoord1s, (s), (F, ";"));
+ DISPATCH(GetTexGendv, (coord, pname, params), (F, "glGetTexGendv(0x%x, 0x%x, %p);\n", coord, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord2d)(GLdouble s, GLdouble t)
+KEYWORD1 void KEYWORD2 NAME(GetTexGenfv)(GLenum coord, GLenum pname, GLfloat * params)
{
- DISPATCH(TexCoord2d, (s, t), (F, ";"));
+ DISPATCH(GetTexGenfv, (coord, pname, params), (F, "glGetTexGenfv(0x%x, 0x%x, %p);\n", coord, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord2f)(GLfloat s, GLfloat t)
+KEYWORD1 void KEYWORD2 NAME(GetTexGeniv)(GLenum coord, GLenum pname, GLint * params)
{
- DISPATCH(TexCoord2f, (s, t), (F, ";"));
+ DISPATCH(GetTexGeniv, (coord, pname, params), (F, "glGetTexGeniv(0x%x, 0x%x, %p);\n", coord, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord2s)(GLshort s, GLshort t)
+KEYWORD1 void KEYWORD2 NAME(GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels)
{
- DISPATCH(TexCoord2s, (s, t), (F, ";"));
+ DISPATCH(GetTexImage, (target, level, format, type, pixels), (F, "glGetTexImage(0x%x, %d, 0x%x, 0x%x, %p);\n", target, level, format, type, (void *) pixels));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord2i)(GLint s, GLint t)
+KEYWORD1 void KEYWORD2 NAME(GetTexParameterfv)(GLenum target, GLenum pname, GLfloat * params)
{
- DISPATCH(TexCoord2i, (s, t), (F, ";"));
+ DISPATCH(GetTexParameterfv, (target, pname, params), (F, "glGetTexParameterfv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord3d)(GLdouble s, GLdouble t, GLdouble r)
+KEYWORD1 void KEYWORD2 NAME(GetTexParameteriv)(GLenum target, GLenum pname, GLint * params)
{
- DISPATCH(TexCoord3d, (s, t, r), (F, ";"));
+ DISPATCH(GetTexParameteriv, (target, pname, params), (F, "glGetTexParameteriv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord3f)(GLfloat s, GLfloat t, GLfloat r)
+KEYWORD1 void KEYWORD2 NAME(GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat * params)
{
- DISPATCH(TexCoord3f, (s, t, r), (F, ";"));
+ DISPATCH(GetTexLevelParameterfv, (target, level, pname, params), (F, "glGetTexLevelParameterfv(0x%x, %d, 0x%x, %p);\n", target, level, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord3i)(GLint s, GLint t, GLint r)
+KEYWORD1 void KEYWORD2 NAME(GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint * params)
{
- DISPATCH(TexCoord3i, (s, t, r), (F, ";"));
+ DISPATCH(GetTexLevelParameteriv, (target, level, pname, params), (F, "glGetTexLevelParameteriv(0x%x, %d, 0x%x, %p);\n", target, level, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord3s)(GLshort s, GLshort t, GLshort r)
+KEYWORD1 GLboolean KEYWORD2 NAME(IsEnabled)(GLenum cap)
{
- DISPATCH(TexCoord3s, (s, t, r), (F, ";"));
+ RETURN_DISPATCH(IsEnabled, (cap), (F, "glIsEnabled(0x%x);\n", cap));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+KEYWORD1 GLboolean KEYWORD2 NAME(IsList)(GLuint list)
{
- DISPATCH(TexCoord4d, (s, t, r, q), (F, ";"));
+ RETURN_DISPATCH(IsList, (list), (F, "glIsList(%d);\n", list));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+KEYWORD1 void KEYWORD2 NAME(DepthRange)(GLclampd zNear, GLclampd zFar)
{
- DISPATCH(TexCoord4f, (s, t, r, q), (F, ";"));
+ DISPATCH(DepthRange, (zNear, zFar), (F, "glDepthRange(%f, %f);\n", zNear, zFar));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord4i)(GLint s, GLint t, GLint r, GLint q)
+KEYWORD1 void KEYWORD2 NAME(Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
{
- DISPATCH(TexCoord4i, (s, t, r, q), (F, ";"));
+ DISPATCH(Frustum, (left, right, bottom, top, zNear, zFar), (F, "glFrustum(%f, %f, %f, %f, %f, %f);\n", left, right, bottom, top, zNear, zFar));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q)
+KEYWORD1 void KEYWORD2 NAME(LoadIdentity)(void)
{
- DISPATCH(TexCoord4s, (s, t, r, q), (F, ";"));
+ DISPATCH(LoadIdentity, (), (F, "glLoadIdentity();\n"));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord1dv)(const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(LoadMatrixf)(const GLfloat * m)
{
- DISPATCH(TexCoord1dv, (v), (F, ";"));
+ DISPATCH(LoadMatrixf, (m), (F, "glLoadMatrixf(%p);\n", (void *) m));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord1fv)(const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(LoadMatrixd)(const GLdouble * m)
{
- DISPATCH(TexCoord1fv, (v), (F, ";"));
+ DISPATCH(LoadMatrixd, (m), (F, "glLoadMatrixd(%p);\n", (void *) m));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord1iv)(const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(MatrixMode)(GLenum mode)
{
- DISPATCH(TexCoord1iv, (v), (F, ";"));
+ DISPATCH(MatrixMode, (mode), (F, "glMatrixMode(0x%x);\n", mode));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord1sv)(const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(MultMatrixf)(const GLfloat * m)
{
- DISPATCH(TexCoord1sv, (v), (F, ";"));
+ DISPATCH(MultMatrixf, (m), (F, "glMultMatrixf(%p);\n", (void *) m));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord2dv)(const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(MultMatrixd)(const GLdouble * m)
{
- DISPATCH(TexCoord2dv, (v), (F, ";"));
+ DISPATCH(MultMatrixd, (m), (F, "glMultMatrixd(%p);\n", (void *) m));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord2fv)(const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
{
- DISPATCH(TexCoord2fv, (v), (F, ";"));
+ DISPATCH(Ortho, (left, right, bottom, top, zNear, zFar), (F, "glOrtho(%f, %f, %f, %f, %f, %f);\n", left, right, bottom, top, zNear, zFar));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord2iv)(const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(PopMatrix)(void)
{
- DISPATCH(TexCoord2iv, (v), (F, ";"));
+ DISPATCH(PopMatrix, (), (F, "glPopMatrix();\n"));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord2sv)(const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(PushMatrix)(void)
{
- DISPATCH(TexCoord2sv, (v), (F, ";"));
+ DISPATCH(PushMatrix, (), (F, "glPushMatrix();\n"));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord3dv)(const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
{
- DISPATCH(TexCoord3dv, (v), (F, ";"));
+ DISPATCH(Rotated, (angle, x, y, z), (F, "glRotated(%f, %f, %f, %f);\n", angle, x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord3fv)(const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
{
- DISPATCH(TexCoord3fv, (v), (F, ";"));
+ DISPATCH(Rotatef, (angle, x, y, z), (F, "glRotatef(%f, %f, %f, %f);\n", angle, x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord3iv)(const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(Scaled)(GLdouble x, GLdouble y, GLdouble z)
{
- DISPATCH(TexCoord3iv, (v), (F, ";"));
+ DISPATCH(Scaled, (x, y, z), (F, "glScaled(%f, %f, %f);\n", x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord3sv)(const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(Scalef)(GLfloat x, GLfloat y, GLfloat z)
{
- DISPATCH(TexCoord3sv, (v), (F, ";"));
+ DISPATCH(Scalef, (x, y, z), (F, "glScalef(%f, %f, %f);\n", x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord4dv)(const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(Translated)(GLdouble x, GLdouble y, GLdouble z)
{
- DISPATCH(TexCoord4dv, (v), (F, ";"));
+ DISPATCH(Translated, (x, y, z), (F, "glTranslated(%f, %f, %f);\n", x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord4fv)(const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(Translatef)(GLfloat x, GLfloat y, GLfloat z)
{
- DISPATCH(TexCoord4fv, (v), (F, ";"));
+ DISPATCH(Translatef, (x, y, z), (F, "glTranslatef(%f, %f, %f);\n", x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord4iv)(const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(Viewport)(GLint x, GLint y, GLsizei width, GLsizei height)
{
- DISPATCH(TexCoord4iv, (v), (F, ";"));
+ DISPATCH(Viewport, (x, y, width, height), (F, "glViewport(%d, %d, %d, %d);\n", x, y, width, height));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoord4sv)(const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(ArrayElement)(GLint i)
{
- DISPATCH(TexCoord4sv, (v), (F, ";"));
+ DISPATCH(ArrayElement, (i), (F, "glArrayElement(%d);\n", i));
}
-KEYWORD1 void KEYWORD2 NAME(TexGend)(GLenum coord, GLenum pname, GLdouble param)
+KEYWORD1 void KEYWORD2 NAME(ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
{
- DISPATCH(TexGend, (coord, pname, param), (F, ";"));
+ DISPATCH(ColorPointer, (size, type, stride, pointer), (F, "glColorPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (void *) pointer));
}
-KEYWORD1 void KEYWORD2 NAME(TexGendv)(GLenum coord, GLenum pname, const GLdouble *params)
+KEYWORD1 void KEYWORD2 NAME(DisableClientState)(GLenum array)
{
- DISPATCH(TexGendv, (coord, pname, params), (F, ";"));
+ DISPATCH(DisableClientState, (array), (F, "glDisableClientState(0x%x);\n", array));
}
-KEYWORD1 void KEYWORD2 NAME(TexGenf)(GLenum coord, GLenum pname, GLfloat param)
+KEYWORD1 void KEYWORD2 NAME(DrawArrays)(GLenum mode, GLint first, GLsizei count)
{
- DISPATCH(TexGenf, (coord, pname, param), (F, ";"));
+ DISPATCH(DrawArrays, (mode, first, count), (F, "glDrawArrays(0x%x, %d, %d);\n", mode, first, count));
}
-KEYWORD1 void KEYWORD2 NAME(TexGenfv)(GLenum coord, GLenum pname, const GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices)
{
- DISPATCH(TexGenfv, (coord, pname, params), (F, ";"));
+ DISPATCH(DrawElements, (mode, count, type, indices), (F, "glDrawElements(0x%x, %d, 0x%x, %p);\n", mode, count, type, (void *) indices));
}
-KEYWORD1 void KEYWORD2 NAME(TexGeni)(GLenum coord, GLenum pname, GLint param)
+KEYWORD1 void KEYWORD2 NAME(EdgeFlagPointer)(GLsizei stride, const GLvoid * pointer)
{
- DISPATCH(TexGeni, (coord, pname, param), (F, ";"));
+ DISPATCH(EdgeFlagPointer, (stride, pointer), (F, "glEdgeFlagPointer(%d, %p);\n", stride, (void *) pointer));
}
-KEYWORD1 void KEYWORD2 NAME(TexGeniv)(GLenum coord, GLenum pname, const GLint *params)
+KEYWORD1 void KEYWORD2 NAME(EnableClientState)(GLenum array)
{
- DISPATCH(TexGeniv, (coord, pname, params), (F, ";"));
+ DISPATCH(EnableClientState, (array), (F, "glEnableClientState(0x%x);\n", array));
}
-KEYWORD1 void KEYWORD2 NAME(TexEnvf)(GLenum target, GLenum pname, GLfloat param)
+KEYWORD1 void KEYWORD2 NAME(GetPointerv)(GLenum pname, GLvoid ** params)
{
- DISPATCH(TexEnvf, (target, pname, param), (F, ";"));
+ DISPATCH(GetPointerv, (pname, params), (F, "glGetPointerv(0x%x, %p);\n", pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(TexEnvfv)(GLenum target, GLenum pname, const GLfloat *param)
+KEYWORD1 void KEYWORD2 NAME(IndexPointer)(GLenum type, GLsizei stride, const GLvoid * pointer)
{
- DISPATCH(TexEnvfv, (target, pname, param), (F, ";"));
+ DISPATCH(IndexPointer, (type, stride, pointer), (F, "glIndexPointer(0x%x, %d, %p);\n", type, stride, (void *) pointer));
}
-KEYWORD1 void KEYWORD2 NAME(TexEnvi)(GLenum target, GLenum pname, GLint param)
+KEYWORD1 void KEYWORD2 NAME(InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid * pointer)
{
- DISPATCH(TexEnvi, (target, pname, param), (F, ";"));
+ DISPATCH(InterleavedArrays, (format, stride, pointer), (F, "glInterleavedArrays(0x%x, %d, %p);\n", format, stride, (void *) pointer));
}
-KEYWORD1 void KEYWORD2 NAME(TexEnviv)(GLenum target, GLenum pname, const GLint *param)
+KEYWORD1 void KEYWORD2 NAME(NormalPointer)(GLenum type, GLsizei stride, const GLvoid * pointer)
{
- DISPATCH(TexEnviv, (target, pname, param), (F, ";"));
+ DISPATCH(NormalPointer, (type, stride, pointer), (F, "glNormalPointer(0x%x, %d, %p);\n", type, stride, (void *) pointer));
}
-KEYWORD1 void KEYWORD2 NAME(TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
+KEYWORD1 void KEYWORD2 NAME(TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
{
- DISPATCH(TexImage1D, (target, level, internalformat, width, border, format, type, pixels), (F, ";"));
+ DISPATCH(TexCoordPointer, (size, type, stride, pointer), (F, "glTexCoordPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (void *) pointer));
}
-KEYWORD1 void KEYWORD2 NAME(TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
+KEYWORD1 void KEYWORD2 NAME(VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
{
- DISPATCH(TexImage2D, (target, level, internalformat, width, height, border, format, type, pixels), (F, ";"));
+ DISPATCH(VertexPointer, (size, type, stride, pointer), (F, "glVertexPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (void *) pointer));
}
-KEYWORD1 void KEYWORD2 NAME(TexParameterf)(GLenum target, GLenum pname, GLfloat param)
+KEYWORD1 void KEYWORD2 NAME(PolygonOffset)(GLfloat factor, GLfloat units)
{
- DISPATCH(TexParameterf, (target, pname, param), (F, ";"));
+ DISPATCH(PolygonOffset, (factor, units), (F, "glPolygonOffset(%f, %f);\n", factor, units));
}
-KEYWORD1 void KEYWORD2 NAME(TexParameterfv)(GLenum target, GLenum pname, const GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
{
- DISPATCH(TexParameterfv, (target, pname, params), (F, ";"));
+ DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, "glCopyTexImage1D(0x%x, %d, 0x%x, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, border));
}
-KEYWORD1 void KEYWORD2 NAME(TexParameteri)(GLenum target, GLenum pname, GLint param)
+KEYWORD1 void KEYWORD2 NAME(CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
{
- DISPATCH(TexParameteri, (target, pname, param), (F, ";"));
+ DISPATCH(CopyTexImage2D, (target, level, internalformat, x, y, width, height, border), (F, "glCopyTexImage2D(0x%x, %d, 0x%x, %d, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, height, border));
}
-KEYWORD1 void KEYWORD2 NAME(TexParameteriv)(GLenum target, GLenum pname, const GLint *params)
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
{
- DISPATCH(TexParameteriv, (target, pname, params), (F, ";"));
+ DISPATCH(CopyTexSubImage1D, (target, level, xoffset, x, y, width), (F, "glCopyTexSubImage1D(0x%x, %d, %d, %d, %d, %d);\n", target, level, xoffset, x, y, width));
}
-KEYWORD1 void KEYWORD2 NAME(Translated)(GLdouble x, GLdouble y, GLdouble z)
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
{
- DISPATCH(Translated, (x, y, z), (F, "glTranslated(%g, %g, %g);", x, y, z));
+ DISPATCH(CopyTexSubImage2D, (target, level, xoffset, yoffset, x, y, width, height), (F, "glCopyTexSubImage2D(0x%x, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, x, y, width, height));
}
-KEYWORD1 void KEYWORD2 NAME(Translatef)(GLfloat x, GLfloat y, GLfloat z)
+KEYWORD1 void KEYWORD2 NAME(TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels)
{
- DISPATCH(Translatef, (x, y, z), (F, "glTranslatef(%g, %g, %g);", x, y, z));
+ DISPATCH(TexSubImage1D, (target, level, xoffset, width, format, type, pixels), (F, "glTexSubImage1D(0x%x, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, width, format, type, (void *) pixels));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex2d)(GLdouble x, GLdouble y)
+KEYWORD1 void KEYWORD2 NAME(TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
{
- DISPATCH(Vertex2d, (x, y), (F, "glVertex2d(%f, %f);", x, y));
+ DISPATCH(TexSubImage2D, (target, level, xoffset, yoffset, width, height, format, type, pixels), (F, "glTexSubImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, width, height, format, type, (void *) pixels));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex2dv)(const GLdouble *v)
+KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResident)(GLsizei n, const GLuint * textures, GLboolean * residences)
{
- DISPATCH(Vertex2dv, (v), (F, "glVertex2dv(%p);", (void *) v));
+ RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResident(%d, %p, %p);\n", n, (void *) textures, (void *) residences));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex2f)(GLfloat x, GLfloat y)
+KEYWORD1 void KEYWORD2 NAME(BindTexture)(GLenum target, GLuint texture)
{
- DISPATCH(Vertex2f, (x, y), (F, "glVertex2f(%g, %g);", x, y));
+ DISPATCH(BindTexture, (target, texture), (F, "glBindTexture(0x%x, %d);\n", target, texture));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex2fv)(const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(DeleteTextures)(GLsizei n, const GLuint * textures)
{
- DISPATCH(Vertex2fv, (v), (F, "glVertex2fv(%p);", (void *) v));
+ DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTextures(%d, %p);\n", n, (void *) textures));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex2i)(GLint x, GLint y)
+KEYWORD1 void KEYWORD2 NAME(GenTextures)(GLsizei n, GLuint * textures)
{
- DISPATCH(Vertex2i, (x, y), (F, "glVertex2i(%d, %d);", x, y));
+ DISPATCH(GenTextures, (n, textures), (F, "glGenTextures(%d, %p);\n", n, (void *) textures));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex2iv)(const GLint *v)
+KEYWORD1 GLboolean KEYWORD2 NAME(IsTexture)(GLuint texture)
{
- DISPATCH(Vertex2iv, (v), (F, "glVertex2iv(%p);", (void *) v));
+ RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTexture(%d);\n", texture));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex2s)(GLshort x, GLshort y)
+KEYWORD1 void KEYWORD2 NAME(PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities)
{
- DISPATCH(Vertex2s, (x, y), (F, "glVertex2s(%d, %d);", x, y));
+ DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTextures(%d, %p, %p);\n", n, (void *) textures, (void *) priorities));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex2sv)(const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(Indexub)(GLubyte c)
{
- DISPATCH(Vertex2sv, (v), (F, "glVertex2sv(%p);", (void *) v));
+ DISPATCH(Indexub, (c), (F, "glIndexub(%d);\n", c));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex3d)(GLdouble x, GLdouble y, GLdouble z)
+KEYWORD1 void KEYWORD2 NAME(Indexubv)(const GLubyte * c)
{
- DISPATCH(Vertex3d, (x, y, z), (F, "glVertex3d(%f, %f, %f);", x, y, z));
+ DISPATCH(Indexubv, (c), (F, "glIndexubv(%p);\n", (void *) c));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex3dv)(const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(PopClientAttrib)(void)
{
- DISPATCH(Vertex3dv, (v), (F, "glVertex3dv(%p);", (void *) v));
+ DISPATCH(PopClientAttrib, (), (F, "glPopClientAttrib();\n"));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex3f)(GLfloat x, GLfloat y, GLfloat z)
+KEYWORD1 void KEYWORD2 NAME(PushClientAttrib)(GLbitfield mask)
{
- DISPATCH(Vertex3f, (x, y, z), (F, "glVertex3f(%g, %g, %g);", x, y, z));
+ DISPATCH(PushClientAttrib, (mask), (F, "glPushClientAttrib(%p);\n", (void *) mask));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex3fv)(const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
- DISPATCH(Vertex3fv, (v), (F, "glVertex3fv(%p);", (void *) v));
+ DISPATCH(BlendColor, (red, green, blue, alpha), (F, "glBlendColor(%f, %f, %f, %f);\n", red, green, blue, alpha));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex3i)(GLint x, GLint y, GLint z)
+KEYWORD1 void KEYWORD2 NAME(BlendEquation)(GLenum mode)
{
- DISPATCH(Vertex3i, (x, y, z), (F, "glVertex3i(%d, %d, %d);", x, y, z));
+ DISPATCH(BlendEquation, (mode), (F, "glBlendEquation(0x%x);\n", mode));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex3iv)(const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices)
{
- DISPATCH(Vertex3iv, (v), (F, "glVertex3iv(%p);", (void *) v));
+ DISPATCH(DrawRangeElements, (mode, start, end, count, type, indices), (F, "glDrawRangeElements(0x%x, %d, %d, %d, 0x%x, %p);\n", mode, start, end, count, type, (void *) indices));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex3s)(GLshort x, GLshort y, GLshort z)
+KEYWORD1 void KEYWORD2 NAME(ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
{
- DISPATCH(Vertex3s, (x, y, z), (F, "glVertex3s(%d, %d, %d);", x, y, z));
+ DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTable(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (void *) table));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex3sv)(const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params)
{
- DISPATCH(Vertex3sv, (v), (F, "glVertex3sv(%p);", (void *) v));
+ DISPATCH(ColorTableParameterfv, (target, pname, params), (F, "glColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+KEYWORD1 void KEYWORD2 NAME(ColorTableParameteriv)(GLenum target, GLenum pname, const GLint * params)
{
- DISPATCH(Vertex4d, (x, y, z, w), (F, "glVertex4d(%f, %f, %f, %f);", x, y, z, w));
+ DISPATCH(ColorTableParameteriv, (target, pname, params), (F, "glColorTableParameteriv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex4dv)(const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
{
- DISPATCH(Vertex4dv, (v), (F, "glVertex4dv(%p);", (void *) v));
+ DISPATCH(CopyColorTable, (target, internalformat, x, y, width), (F, "glCopyColorTable(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+KEYWORD1 void KEYWORD2 NAME(GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid * table)
{
- DISPATCH(Vertex4f, (x, y, z, w), (F, "glVertex4f(%f, %f, %f, %f);", x, y, z, w));
+ DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTable(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (void *) table));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex4fv)(const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params)
{
- DISPATCH(Vertex4fv, (v), (F, "glVertex4fv(%p);", (void *) v));
+ DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex4i)(GLint x, GLint y, GLint z, GLint w)
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params)
{
- DISPATCH(Vertex4i, (x, y, z, w), (F, "glVertex4i(%d, %d, %d, %d);", x, y, z, w));
+ DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameteriv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex4iv)(const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data)
{
- DISPATCH(Vertex4iv, (v), (F, "glVertex4iv(%p);", (void *) v));
+ 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, (void *) data));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w)
+KEYWORD1 void KEYWORD2 NAME(CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
{
- DISPATCH(Vertex4s, (x, y, z, w), (F, "glVertex4s(%d, %d, %d, %d);", x, y, z, w));
+ DISPATCH(CopyColorSubTable, (target, start, x, y, width), (F, "glCopyColorSubTable(0x%x, %d, %d, %d, %d);\n", target, start, x, y, width));
}
-KEYWORD1 void KEYWORD2 NAME(Vertex4sv)(const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image)
{
- DISPATCH(Vertex4sv, (v), (F, "glVertex4sv(%p);", (void *) v));
+ DISPATCH(ConvolutionFilter1D, (target, internalformat, width, format, type, image), (F, "glConvolutionFilter1D(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (void *) image));
}
+KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image)
+{
+ DISPATCH(ConvolutionFilter2D, (target, internalformat, width, height, format, type, image), (F, "glConvolutionFilter2D(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, height, format, type, (void *) image));
+}
-KEYWORD1 void KEYWORD2 NAME(Viewport)(GLint x, GLint y, GLsizei width, GLsizei height)
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params)
{
- DISPATCH(Viewport, (x, y, width, height), (F, "glViewport(%d, %d, %d, %d);", x, y, width, height));
+ DISPATCH(ConvolutionParameterf, (target, pname, params), (F, "glConvolutionParameterf(0x%x, 0x%x, %f);\n", target, pname, params));
}
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(ConvolutionParameterfv, (target, pname, params), (F, "glConvolutionParameterfv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
+}
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteri)(GLenum target, GLenum pname, GLint params)
+{
+ DISPATCH(ConvolutionParameteri, (target, pname, params), (F, "glConvolutionParameteri(0x%x, 0x%x, %d);\n", target, pname, params));
+}
-/* GL 1.1 */
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint * params)
+{
+ DISPATCH(ConvolutionParameteriv, (target, pname, params), (F, "glConvolutionParameteriv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
+}
-KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResident)(GLsizei n, const GLuint *textures, GLboolean *residences)
+KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
{
- RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResident(%d, %p, %p);", n, (void *) textures, (void *) residences));
+ DISPATCH(CopyConvolutionFilter1D, (target, internalformat, x, y, width), (F, "glCopyConvolutionFilter1D(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width));
}
-KEYWORD1 void KEYWORD2 NAME(ArrayElement)(GLint i)
+KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
{
- DISPATCH(ArrayElement, (i), (F, ";"));
+ DISPATCH(CopyConvolutionFilter2D, (target, internalformat, x, y, width, height), (F, "glCopyConvolutionFilter2D(0x%x, 0x%x, %d, %d, %d, %d);\n", target, internalformat, x, y, width, height));
}
-KEYWORD1 void KEYWORD2 NAME(BindTexture)(GLenum target, GLuint texture)
+KEYWORD1 void KEYWORD2 NAME(GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid * image)
{
- DISPATCH(BindTexture, (target, texture), (F, ";"));
+ DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilter(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (void *) image));
}
-KEYWORD1 void KEYWORD2 NAME(ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
+KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params)
{
- DISPATCH(ColorPointer, (size, type, stride, ptr), (F, ";"));
+ DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
+KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params)
{
- DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, ";"));
+ DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameteriv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+KEYWORD1 void KEYWORD2 NAME(GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span)
{
- DISPATCH(CopyTexImage2D, (target, level, internalformat, x, y, width, height, border), (F, ";"));
+ DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilter(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (void *) row, (void *) column, (void *) span));
}
-KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
+KEYWORD1 void KEYWORD2 NAME(SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column)
{
- DISPATCH(CopyTexSubImage1D, (target, level, xoffset, x, y, width), (F, ";"));
+ 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, (void *) row, (void *) column));
}
-KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+KEYWORD1 void KEYWORD2 NAME(GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
{
- DISPATCH(CopyTexSubImage2D, (target, level, xoffset, yoffset, x, y, width, height), (F, ";"));
+ DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogram(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (void *) values));
}
-KEYWORD1 void KEYWORD2 NAME(DeleteTextures)(GLsizei n, const GLuint *textures)
+KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params)
{
- DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTextures(%d, %p);", n, (void *) textures));
+ DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(DisableClientState)(GLenum cap)
+KEYWORD1 void KEYWORD2 NAME(GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params)
{
- DISPATCH(DisableClientState, (cap), (F, "glDisableClientState(0x%x);", cap));
+ DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameteriv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(DrawArrays)(GLenum mode, GLint first, GLsizei count)
+KEYWORD1 void KEYWORD2 NAME(GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
{
- DISPATCH(DrawArrays, (mode, first, count), (F, "glDrawArrays(0x%x, %d, %d);", mode, first, count));
+ DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmax(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (void *) values));
}
-KEYWORD1 void KEYWORD2 NAME(EdgeFlagPointer)(GLsizei stride, const GLvoid *ptr)
+KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params)
{
- DISPATCH(EdgeFlagPointer, (stride, ptr), (F, "glEdgeFlagPointer(%d, %p);", stride, (void *) ptr));
+ DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(EnableClientState)(GLenum cap)
+KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params)
{
- DISPATCH(EnableClientState, (cap), (F, "glEnableClientState(0x%x)", cap));
+ DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameteriv(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(GenTextures)(GLsizei n, GLuint *textures)
+KEYWORD1 void KEYWORD2 NAME(Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
{
- DISPATCH(GenTextures, (n, textures), (F, "glGenTextures(%d, %p);", n, (void *) textures));
+ DISPATCH(Histogram, (target, width, internalformat, sink), (F, "glHistogram(0x%x, %d, 0x%x, %d);\n", target, width, internalformat, sink));
}
-KEYWORD1 void KEYWORD2 NAME(GetPointerv)(GLenum pname, GLvoid **params)
+KEYWORD1 void KEYWORD2 NAME(Minmax)(GLenum target, GLenum internalformat, GLboolean sink)
{
- DISPATCH(GetPointerv, (pname, params), (F, "glGetPointerv(0x%x, %p);", pname, (void *) params));
+ DISPATCH(Minmax, (target, internalformat, sink), (F, "glMinmax(0x%x, 0x%x, %d);\n", target, internalformat, sink));
}
-KEYWORD1 void KEYWORD2 NAME(IndexPointer)(GLenum type, GLsizei stride, const GLvoid *ptr)
+KEYWORD1 void KEYWORD2 NAME(ResetHistogram)(GLenum target)
{
- DISPATCH(IndexPointer, (type, stride, ptr), (F, "glIndexPointer(0x%x, %d, %p);", type, stride, ptr));
+ DISPATCH(ResetHistogram, (target), (F, "glResetHistogram(0x%x);\n", target));
}
-KEYWORD1 void KEYWORD2 NAME(InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid *pointer)
+KEYWORD1 void KEYWORD2 NAME(ResetMinmax)(GLenum target)
{
- DISPATCH(InterleavedArrays, (format, stride, pointer), (F, "glInterleavedArrays(0x%x, %d, %p);", format, stride, pointer));
+ DISPATCH(ResetMinmax, (target), (F, "glResetMinmax(0x%x);\n", target));
}
-KEYWORD1 GLboolean KEYWORD2 NAME(IsTexture)(GLuint texture)
+KEYWORD1 void KEYWORD2 NAME(TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
{
- RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTexture(%u);", texture));
+ DISPATCH(TexImage3D, (target, level, internalformat, width, height, depth, border, format, type, pixels), (F, "glTexImage3D(0x%x, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, depth, border, format, type, (void *) pixels));
}
-KEYWORD1 void KEYWORD2 NAME(NormalPointer)(GLenum type, GLsizei stride, const GLvoid *ptr)
+KEYWORD1 void KEYWORD2 NAME(TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels)
{
- DISPATCH(NormalPointer, (type, stride, ptr), (F, "glNormalPointer(0x%x, %d, %p);", type, stride, (void *) ptr));
+ DISPATCH(TexSubImage3D, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), (F, "glTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, (void *) pixels));
}
-KEYWORD1 void KEYWORD2 NAME(PolygonOffset)(GLfloat factor, GLfloat units)
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
{
- DISPATCH(PolygonOffset, (factor, units), (F, "glPolygonOffset(%g, %g);", factor, units));
+ DISPATCH(CopyTexSubImage3D, (target, level, xoffset, yoffset, zoffset, x, y, width, height), (F, "glCopyTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, zoffset, x, y, width, height));
}
-KEYWORD1 void KEYWORD2 NAME(PopClientAttrib)(void)
+KEYWORD1 void KEYWORD2 NAME(ActiveTextureARB)(GLenum texture)
{
- DISPATCH(PopClientAttrib, (), (F, "glPopClientAttrib();"));
+ DISPATCH(ActiveTextureARB, (texture), (F, "glActiveTextureARB(0x%x);\n", texture));
}
-KEYWORD1 void KEYWORD2 NAME(PrioritizeTextures)(GLsizei n, const GLuint *textures, const GLclampf *priorities)
+KEYWORD1 void KEYWORD2 NAME(ClientActiveTextureARB)(GLenum texture)
{
- DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTextures(%d, %p, %p);", n, (void *) textures, (void *) priorities));
+ DISPATCH(ClientActiveTextureARB, (texture), (F, "glClientActiveTextureARB(0x%x);\n", texture));
}
-KEYWORD1 void KEYWORD2 NAME(PushClientAttrib)(GLbitfield mask)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dARB)(GLenum target, GLdouble s)
{
- DISPATCH(PushClientAttrib, (mask), (F, "glPushClientAttrib(0x%x)", mask));
+ DISPATCH(MultiTexCoord1dARB, (target, s), (F, "glMultiTexCoord1dARB(0x%x, %f);\n", target, s));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dvARB)(GLenum target, const GLdouble * v)
{
- DISPATCH(TexCoordPointer, (size, type, stride, ptr), (F, ";"));
+ DISPATCH(MultiTexCoord1dvARB, (target, v), (F, "glMultiTexCoord1dvARB(0x%x, %p);\n", target, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fARB)(GLenum target, GLfloat s)
{
- DISPATCH(TexSubImage1D, (target, level, xoffset, width, format, type, pixels), (F, ";"));
+ DISPATCH(MultiTexCoord1fARB, (target, s), (F, "glMultiTexCoord1fARB(0x%x, %f);\n", target, s));
}
-KEYWORD1 void KEYWORD2 NAME(TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fvARB)(GLenum target, const GLfloat * v)
{
- DISPATCH(TexSubImage2D, (target, level, xoffset, yoffset, width, height, format, type, pixels), (F, ";"));
+ DISPATCH(MultiTexCoord1fvARB, (target, v), (F, "glMultiTexCoord1fvARB(0x%x, %p);\n", target, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1iARB)(GLenum target, GLint s)
{
- DISPATCH(VertexPointer, (size, type, stride, ptr), (F, ";"));
+ DISPATCH(MultiTexCoord1iARB, (target, s), (F, "glMultiTexCoord1iARB(0x%x, %d);\n", target, s));
}
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1ivARB)(GLenum target, const GLint * v)
+{
+ DISPATCH(MultiTexCoord1ivARB, (target, v), (F, "glMultiTexCoord1ivARB(0x%x, %p);\n", target, (void *) v));
+}
-/* GL 1.2 */
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1sARB)(GLenum target, GLshort s)
+{
+ DISPATCH(MultiTexCoord1sARB, (target, s), (F, "glMultiTexCoord1sARB(0x%x, %d);\n", target, s));
+}
-KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1svARB)(GLenum target, const GLshort * v)
{
- DISPATCH(CopyTexSubImage3D, (target, level, xoffset, yoffset, zoffset, x, y, width, height), (F, ";"));
+ DISPATCH(MultiTexCoord1svARB, (target, v), (F, "glMultiTexCoord1svARB(0x%x, %p);\n", target, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t)
{
- DISPATCH(DrawRangeElements, (mode, start, end, count, type, indices), (F, ";"));
+ DISPATCH(MultiTexCoord2dARB, (target, s, t), (F, "glMultiTexCoord2dARB(0x%x, %f, %f);\n", target, s, t));
}
-KEYWORD1 void KEYWORD2 NAME(TexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dvARB)(GLenum target, const GLdouble * v)
{
- DISPATCH(TexImage3D, (target, level, internalformat, width, height, depth, border, format, type, pixels), (F, ";"));
+ DISPATCH(MultiTexCoord2dvARB, (target, v), (F, "glMultiTexCoord2dvARB(0x%x, %p /* %g, %g */);\n", target, (void *) v, v[0], v[1]));
}
-KEYWORD1 void KEYWORD2 NAME(TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t)
{
- DISPATCH(TexSubImage3D, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), (F, ";"));
+ DISPATCH(MultiTexCoord2fARB, (target, s, t), (F, "glMultiTexCoord2fARB(0x%x, %f, %f);\n", target, s, t));
}
-/* GL_ARB_imaging */
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fvARB)(GLenum target, const GLfloat * v)
+{
+ DISPATCH(MultiTexCoord2fvARB, (target, v), (F, "glMultiTexCoord2fvARB(0x%x, %p /* %g, %g */);\n", target, (void *) v, v[0], v[1]));
+}
-KEYWORD1 void KEYWORD2 NAME(BlendColor)(GLclampf r, GLclampf g, GLclampf b, GLclampf a)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2iARB)(GLenum target, GLint s, GLint t)
{
- DISPATCH(BlendColor, (r, g, b, a), (F, ";"));
+ DISPATCH(MultiTexCoord2iARB, (target, s, t), (F, "glMultiTexCoord2iARB(0x%x, %d, %d);\n", target, s, t));
}
-KEYWORD1 void KEYWORD2 NAME(BlendEquation)(GLenum mode)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2ivARB)(GLenum target, const GLint * v)
{
- DISPATCH(BlendEquation, (mode), (F, ";"));
+ DISPATCH(MultiTexCoord2ivARB, (target, v), (F, "glMultiTexCoord2ivARB(0x%x, %p);\n", target, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t)
{
- DISPATCH(ColorSubTable, (target, start, count, format, type, data), (F, ";"));
+ DISPATCH(MultiTexCoord2sARB, (target, s, t), (F, "glMultiTexCoord2sARB(0x%x, %d, %d);\n", target, s, t));
}
-KEYWORD1 void KEYWORD2 NAME(ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2svARB)(GLenum target, const GLshort * v)
{
- DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, ";"));
+ DISPATCH(MultiTexCoord2svARB, (target, v), (F, "glMultiTexCoord2svARB(0x%x, %p);\n", target, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r)
{
- DISPATCH(ColorTableParameterfv, (target, pname, params), (F, ";"));
+ DISPATCH(MultiTexCoord3dARB, (target, s, t, r), (F, "glMultiTexCoord3dARB(0x%x, %f, %f, %f);\n", target, s, t, r));
}
-KEYWORD1 void KEYWORD2 NAME(ColorTableParameteriv)(GLenum target, GLenum pname, const GLint *params)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dvARB)(GLenum target, const GLdouble * v)
{
- DISPATCH(ColorTableParameteriv, (target, pname, params), (F, ";"));
+ DISPATCH(MultiTexCoord3dvARB, (target, v), (F, "glMultiTexCoord3dvARB(0x%x, %p /* %g, %g, %g */);\n", target, (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r)
{
- DISPATCH(ConvolutionFilter1D, (target, internalformat, width, format, type, image), (F, ";"));
+ DISPATCH(MultiTexCoord3fARB, (target, s, t, r), (F, "glMultiTexCoord3fARB(0x%x, %f, %f, %f);\n", target, s, t, r));
}
-KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fvARB)(GLenum target, const GLfloat * v)
{
- DISPATCH(ConvolutionFilter2D, (target, internalformat, width, height, format, type, image), (F, ";"));
+ DISPATCH(MultiTexCoord3fvARB, (target, v), (F, "glMultiTexCoord3fvARB(0x%x, %p /* %g, %g, %g */);\n", target, (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r)
{
- DISPATCH(ConvolutionParameterf, (target, pname, params), (F, ";"));
+ DISPATCH(MultiTexCoord3iARB, (target, s, t, r), (F, "glMultiTexCoord3iARB(0x%x, %d, %d, %d);\n", target, s, t, r));
}
-KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3ivARB)(GLenum target, const GLint * v)
{
- DISPATCH(ConvolutionParameterfv, (target, pname, params), (F, ";"));
+ DISPATCH(MultiTexCoord3ivARB, (target, v), (F, "glMultiTexCoord3ivARB(0x%x, %p);\n", target, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteri)(GLenum target, GLenum pname, GLint params)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r)
{
- DISPATCH(ConvolutionParameteri, (target, pname, params), (F, ";"));
+ DISPATCH(MultiTexCoord3sARB, (target, s, t, r), (F, "glMultiTexCoord3sARB(0x%x, %d, %d, %d);\n", target, s, t, r));
}
-KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint *params)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3svARB)(GLenum target, const GLshort * v)
{
- DISPATCH(ConvolutionParameteriv, (target, pname, params), (F, ";"));
+ DISPATCH(MultiTexCoord3svARB, (target, v), (F, "glMultiTexCoord3svARB(0x%x, %p);\n", target, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
{
- DISPATCH(CopyColorSubTable, (target, start, x, y, width), (F, ";"));
+ DISPATCH(MultiTexCoord4dARB, (target, s, t, r, q), (F, "glMultiTexCoord4dARB(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q));
}
-KEYWORD1 void KEYWORD2 NAME(CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dvARB)(GLenum target, const GLdouble * v)
{
- DISPATCH(CopyColorTable, (target, internalformat, x, y, width), (F, ";"));
+ DISPATCH(MultiTexCoord4dvARB, (target, v), (F, "glMultiTexCoord4dvARB(0x%x, %p /* %g, %g, %g, %g */);\n", target, (void *) v, v[0], v[1], v[2], v[3]));
}
-KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
{
- DISPATCH(CopyConvolutionFilter1D, (target, internalformat, x, y, width), (F, ";"));
+ DISPATCH(MultiTexCoord4fARB, (target, s, t, r, q), (F, "glMultiTexCoord4fARB(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q));
}
-KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fvARB)(GLenum target, const GLfloat * v)
{
- DISPATCH(CopyConvolutionFilter2D, (target, internalformat, x, y, width, height), (F, ";"));
+ DISPATCH(MultiTexCoord4fvARB, (target, v), (F, "glMultiTexCoord4fvARB(0x%x, %p /* %g, %g, %g, %g */);\n", target, (void *) v, v[0], v[1], v[2], v[3]));
}
-KEYWORD1 void KEYWORD2 NAME(GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid *table)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q)
{
- DISPATCH(GetColorTable, (target, format, type, table), (F, ";"));
+ DISPATCH(MultiTexCoord4iARB, (target, s, t, r, q), (F, "glMultiTexCoord4iARB(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q));
}
-KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4ivARB)(GLenum target, const GLint * v)
{
- DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, ";"));
+ DISPATCH(MultiTexCoord4ivARB, (target, v), (F, "glMultiTexCoord4ivARB(0x%x, %p);\n", target, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(GetColorTableParameteriv)(GLenum target, GLenum pname, GLint *params)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
{
- DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, ";"));
+ DISPATCH(MultiTexCoord4sARB, (target, s, t, r, q), (F, "glMultiTexCoord4sARB(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q));
}
-KEYWORD1 void KEYWORD2 NAME(GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid *image)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4svARB)(GLenum target, const GLshort * v)
{
- DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, ";"));
+ DISPATCH(MultiTexCoord4svARB, (target, v), (F, "glMultiTexCoord4svARB(0x%x, %p);\n", target, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixfARB)(const GLfloat * m)
{
- DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, ";"));
+ DISPATCH(LoadTransposeMatrixfARB, (m), (F, "glLoadTransposeMatrixfARB(%p);\n", (void *) m));
}
-KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint *params)
+KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixdARB)(const GLdouble * m)
{
- DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, ";"));
+ DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixdARB(%p);\n", (void *) m));
}
-KEYWORD1 void KEYWORD2 NAME(GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)
+KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixfARB)(const GLfloat * m)
{
- DISPATCH(GetHistogram, (target, reset, format, type, values), (F, ";"));
+ DISPATCH(MultTransposeMatrixfARB, (m), (F, "glMultTransposeMatrixfARB(%p);\n", (void *) m));
}
-KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixdARB)(const GLdouble * m)
{
- DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, ";"));
+ DISPATCH(MultTransposeMatrixdARB, (m), (F, "glMultTransposeMatrixdARB(%p);\n", (void *) m));
}
-KEYWORD1 void KEYWORD2 NAME(GetHistogramParameteriv)(GLenum target, GLenum pname, GLint *params)
+KEYWORD1 void KEYWORD2 NAME(SampleCoverageARB)(GLclampf value, GLboolean invert)
{
- DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, ";"));
+ DISPATCH(SampleCoverageARB, (value, invert), (F, "glSampleCoverageARB(%f, %d);\n", value, invert));
}
-KEYWORD1 void KEYWORD2 NAME(GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values)
+KEYWORD1 void KEYWORD2 NAME(__unused413)(void)
{
- DISPATCH(GetMinmax, (target, reset, format, types, values), (F, ";"));
+ DISPATCH(__unused413, (), (F, "gl__unused413();\n"));
}
-KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data)
{
- DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, ";"));
+ DISPATCH(CompressedTexImage3DARB, (target, level, internalformat, width, height, depth, border, imageSize, data), (F, "glCompressedTexImage3DARB(0x%x, %d, 0x%x, %d, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, depth, border, imageSize, (void *) data));
}
-KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint *params)
+KEYWORD1 void KEYWORD2 NAME(CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data)
{
- DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, ";"));
+ DISPATCH(CompressedTexImage2DARB, (target, level, internalformat, width, height, border, imageSize, data), (F, "glCompressedTexImage2DARB(0x%x, %d, 0x%x, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, border, imageSize, (void *) data));
}
-KEYWORD1 void KEYWORD2 NAME(GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span)
+KEYWORD1 void KEYWORD2 NAME(CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data)
{
- DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, ";"));
+ DISPATCH(CompressedTexImage1DARB, (target, level, internalformat, width, border, imageSize, data), (F, "glCompressedTexImage1DARB(0x%x, %d, 0x%x, %d, %d, %d, %p);\n", target, level, internalformat, width, border, imageSize, (void *) data));
}
-KEYWORD1 void KEYWORD2 NAME(Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
+KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data)
{
- DISPATCH(Histogram, (target, width, internalformat, sink), (F, ";"));
+ DISPATCH(CompressedTexSubImage3DARB, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), (F, "glCompressedTexSubImage3DARB(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, (void *) data));
}
-KEYWORD1 void KEYWORD2 NAME(Minmax)(GLenum target, GLenum internalformat, GLboolean sink)
+KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data)
{
- DISPATCH(Minmax, (target, internalformat, sink), (F, ";"));
+ DISPATCH(CompressedTexSubImage2DARB, (target, level, xoffset, yoffset, width, height, format, imageSize, data), (F, "glCompressedTexSubImage2DARB(0x%x, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, width, height, format, imageSize, (void *) data));
}
-KEYWORD1 void KEYWORD2 NAME(ResetMinmax)(GLenum target)
+KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data)
{
- DISPATCH(ResetMinmax, (target), (F, ";"));
+ DISPATCH(CompressedTexSubImage1DARB, (target, level, xoffset, width, format, imageSize, data), (F, "glCompressedTexSubImage1DARB(0x%x, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, width, format, imageSize, (void *) data));
}
-KEYWORD1 void KEYWORD2 NAME(ResetHistogram)(GLenum target)
+KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img)
{
- DISPATCH(ResetHistogram, (target), (F, ";"));
+ DISPATCH(GetCompressedTexImageARB, (target, level, img), (F, "glGetCompressedTexImageARB(0x%x, %d, %p);\n", target, level, (void *) img));
}
-KEYWORD1 void KEYWORD2 NAME(SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column)
+KEYWORD1 void KEYWORD2 NAME(ActiveTexture)(GLenum texture)
{
- DISPATCH(SeparableFilter2D, (target, internalformat, width, height, format, type, row, column), (F, ";"));
+ DISPATCH(ActiveTextureARB, (texture), (F, "glActiveTexture(0x%x);\n", texture));
}
-/***
- *** Extension functions
- ***/
+KEYWORD1 void KEYWORD2 NAME(ClientActiveTexture)(GLenum texture)
+{
+ DISPATCH(ClientActiveTextureARB, (texture), (F, "glClientActiveTexture(0x%x);\n", texture));
+}
-/* 2. GL_EXT_blend_color */
-KEYWORD1 void KEYWORD2 NAME(BlendColorEXT)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1d)(GLenum target, GLdouble s)
{
- DISPATCH(BlendColor, (red, green, blue, alpha), (F, ";"));
+ DISPATCH(MultiTexCoord1dARB, (target, s), (F, "glMultiTexCoord1d(0x%x, %f);\n", target, s));
}
-/* 3. GL_EXT_polygon_offset */
-KEYWORD1 void KEYWORD2 NAME(PolygonOffsetEXT)(GLfloat factor, GLfloat bias)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dv)(GLenum target, const GLdouble * v)
{
- DISPATCH(PolygonOffsetEXT, (factor, bias), (F, ";"));
+ DISPATCH(MultiTexCoord1dvARB, (target, v), (F, "glMultiTexCoord1dv(0x%x, %p);\n", target, (void *) v));
}
-/* 6. GL_EXT_texture3D */
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1f)(GLenum target, GLfloat s)
+{
+ DISPATCH(MultiTexCoord1fARB, (target, s), (F, "glMultiTexCoord1f(0x%x, %f);\n", target, s));
+}
-KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fv)(GLenum target, const GLfloat * v)
{
- DISPATCH(CopyTexSubImage3D, (target, level, xoffset, yoffset, zoffset, x, y, width, height), (F, ";"));
+ DISPATCH(MultiTexCoord1fvARB, (target, v), (F, "glMultiTexCoord1fv(0x%x, %p);\n", target, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(TexImage3DEXT)(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1i)(GLenum target, GLint s)
{
- DISPATCH(TexImage3D, (target, level, internalFormat, width, height, depth, border, format, type, pixels), (F, ";"));
+ DISPATCH(MultiTexCoord1iARB, (target, s), (F, "glMultiTexCoord1i(0x%x, %d);\n", target, s));
}
-KEYWORD1 void KEYWORD2 NAME(TexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1iv)(GLenum target, const GLint * v)
{
- DISPATCH(TexSubImage3D, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), (F, ";"));
+ DISPATCH(MultiTexCoord1ivARB, (target, v), (F, "glMultiTexCoord1iv(0x%x, %p);\n", target, (void *) v));
}
-/* 7. GL_SGI_texture_filter4 */
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1s)(GLenum target, GLshort s)
+{
+ DISPATCH(MultiTexCoord1sARB, (target, s), (F, "glMultiTexCoord1s(0x%x, %d);\n", target, s));
+}
-KEYWORD1 void KEYWORD2 NAME(GetTexFilterFuncSGIS)(GLenum target, GLenum filter, GLfloat *weights)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1sv)(GLenum target, const GLshort * v)
{
- DISPATCH(GetTexFilterFuncSGIS, (target, filter, weights), (F, ";"));
+ DISPATCH(MultiTexCoord1svARB, (target, v), (F, "glMultiTexCoord1sv(0x%x, %p);\n", target, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(TexFilterFuncSGIS)(GLenum target, GLenum filter, GLsizei n, const GLfloat *weights)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2d)(GLenum target, GLdouble s, GLdouble t)
{
- DISPATCH(TexFilterFuncSGIS, (target, filter, n, weights), (F, ";"));
+ DISPATCH(MultiTexCoord2dARB, (target, s, t), (F, "glMultiTexCoord2d(0x%x, %f, %f);\n", target, s, t));
}
-/* 9. GL_EXT_subtexture */
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dv)(GLenum target, const GLdouble * v)
+{
+ DISPATCH(MultiTexCoord2dvARB, (target, v), (F, "glMultiTexCoord2dv(0x%x, %p /* %g, %g */);\n", target, (void *) v, v[0], v[1]));
+}
-KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2f)(GLenum target, GLfloat s, GLfloat t)
{
- DISPATCH(CopyTexSubImage1D, (target, level, xoffset, x, y, width), (F, ";"));
+ DISPATCH(MultiTexCoord2fARB, (target, s, t), (F, "glMultiTexCoord2f(0x%x, %f, %f);\n", target, s, t));
}
-KEYWORD1 void KEYWORD2 NAME(TexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fv)(GLenum target, const GLfloat * v)
{
- DISPATCH(TexSubImage1D, (target, level, xoffset, width, format, type, pixels), (F, ";"));
+ DISPATCH(MultiTexCoord2fvARB, (target, v), (F, "glMultiTexCoord2fv(0x%x, %p /* %g, %g */);\n", target, (void *) v, v[0], v[1]));
}
-KEYWORD1 void KEYWORD2 NAME(TexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2i)(GLenum target, GLint s, GLint t)
{
- DISPATCH(TexSubImage2D, (target, level, xoffset, yoffset, width, height, format, type, pixels), (F, ";"));
+ DISPATCH(MultiTexCoord2iARB, (target, s, t), (F, "glMultiTexCoord2i(0x%x, %d, %d);\n", target, s, t));
}
-/* 10. GL_EXT_copy_texture */
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2iv)(GLenum target, const GLint * v)
+{
+ DISPATCH(MultiTexCoord2ivARB, (target, v), (F, "glMultiTexCoord2iv(0x%x, %p);\n", target, (void *) v));
+}
-KEYWORD1 void KEYWORD2 NAME(CopyTexImage1DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2s)(GLenum target, GLshort s, GLshort t)
{
- DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, ";"));
+ DISPATCH(MultiTexCoord2sARB, (target, s, t), (F, "glMultiTexCoord2s(0x%x, %d, %d);\n", target, s, t));
}
-KEYWORD1 void KEYWORD2 NAME(CopyTexImage2DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2sv)(GLenum target, const GLshort * v)
{
- DISPATCH(CopyTexImage2D, (target, level, internalformat, x, y, width, height, border), (F, ";"));
+ DISPATCH(MultiTexCoord2svARB, (target, v), (F, "glMultiTexCoord2sv(0x%x, %p);\n", target, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3d)(GLenum target, GLdouble s, GLdouble t, GLdouble r)
{
- DISPATCH(CopyTexSubImage2D, (target, level, xoffset, yoffset, x, y, width, height), (F, ";"));
+ DISPATCH(MultiTexCoord3dARB, (target, s, t, r), (F, "glMultiTexCoord3d(0x%x, %f, %f, %f);\n", target, s, t, r));
}
-/* 11. GL_EXT_histogram */
-KEYWORD1 void KEYWORD2 NAME(GetHistogramEXT)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dv)(GLenum target, const GLdouble * v)
{
- DISPATCH(GetHistogramEXT, (target, reset, format, type, values), (F, ";"));
+ DISPATCH(MultiTexCoord3dvARB, (target, v), (F, "glMultiTexCoord3dv(0x%x, %p /* %g, %g, %g */);\n", target, (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterfvEXT)(GLenum target, GLenum pname, GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3f)(GLenum target, GLfloat s, GLfloat t, GLfloat r)
{
- DISPATCH(GetHistogramParameterfvEXT, (target, pname, params), (F, ";"));
+ DISPATCH(MultiTexCoord3fARB, (target, s, t, r), (F, "glMultiTexCoord3f(0x%x, %f, %f, %f);\n", target, s, t, r));
}
-KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterivEXT)(GLenum target, GLenum pname, GLint *params)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fv)(GLenum target, const GLfloat * v)
{
- DISPATCH(GetHistogramParameterivEXT, (target, pname, params), (F, ";"));
+ DISPATCH(MultiTexCoord3fvARB, (target, v), (F, "glMultiTexCoord3fv(0x%x, %p /* %g, %g, %g */);\n", target, (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 void KEYWORD2 NAME(GetMinmaxEXT)(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3i)(GLenum target, GLint s, GLint t, GLint r)
{
- DISPATCH(GetMinmaxEXT, (target, reset, format, types, values), (F, ";"));
+ DISPATCH(MultiTexCoord3iARB, (target, s, t, r), (F, "glMultiTexCoord3i(0x%x, %d, %d, %d);\n", target, s, t, r));
}
-KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterfvEXT)(GLenum target, GLenum pname, GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3iv)(GLenum target, const GLint * v)
{
- DISPATCH(GetMinmaxParameterfvEXT, (target, pname, params), (F, ";"));
+ DISPATCH(MultiTexCoord3ivARB, (target, v), (F, "glMultiTexCoord3iv(0x%x, %p);\n", target, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterivEXT)(GLenum target, GLenum pname, GLint *params)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3s)(GLenum target, GLshort s, GLshort t, GLshort r)
{
- DISPATCH(GetMinmaxParameterivEXT, (target, pname, params), (F, ";"));
+ DISPATCH(MultiTexCoord3sARB, (target, s, t, r), (F, "glMultiTexCoord3s(0x%x, %d, %d, %d);\n", target, s, t, r));
}
-KEYWORD1 void KEYWORD2 NAME(HistogramEXT)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3sv)(GLenum target, const GLshort * v)
{
- DISPATCH(Histogram, (target, width, internalformat, sink), (F, ";"));
+ DISPATCH(MultiTexCoord3svARB, (target, v), (F, "glMultiTexCoord3sv(0x%x, %p);\n", target, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(MinmaxEXT)(GLenum target, GLenum internalformat, GLboolean sink)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4d)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
{
- DISPATCH(Minmax, (target, internalformat, sink), (F, ";"));
+ DISPATCH(MultiTexCoord4dARB, (target, s, t, r, q), (F, "glMultiTexCoord4d(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q));
}
-KEYWORD1 void KEYWORD2 NAME(ResetHistogramEXT)(GLenum target)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dv)(GLenum target, const GLdouble * v)
{
- DISPATCH(ResetHistogram, (target), (F, ";"));
+ DISPATCH(MultiTexCoord4dvARB, (target, v), (F, "glMultiTexCoord4dv(0x%x, %p /* %g, %g, %g, %g */);\n", target, (void *) v, v[0], v[1], v[2], v[3]));
}
-KEYWORD1 void KEYWORD2 NAME(ResetMinmaxEXT)(GLenum target)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
{
- DISPATCH(ResetMinmax, (target), (F, ";"));
+ DISPATCH(MultiTexCoord4fARB, (target, s, t, r, q), (F, "glMultiTexCoord4f(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q));
}
-/* 12. GL_EXT_convolution */
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fv)(GLenum target, const GLfloat * v)
+{
+ DISPATCH(MultiTexCoord4fvARB, (target, v), (F, "glMultiTexCoord4fv(0x%x, %p /* %g, %g, %g, %g */);\n", target, (void *) v, v[0], v[1], v[2], v[3]));
+}
-KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter1DEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4i)(GLenum target, GLint s, GLint t, GLint r, GLint q)
{
- DISPATCH(ConvolutionFilter1D, (target, internalformat, width, format, type, image), (F, ";"));
+ DISPATCH(MultiTexCoord4iARB, (target, s, t, r, q), (F, "glMultiTexCoord4i(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q));
}
-KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter2DEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4iv)(GLenum target, const GLint * v)
{
- DISPATCH(ConvolutionFilter2D, (target, internalformat, width, height, format, type, image), (F, ";"));
+ DISPATCH(MultiTexCoord4ivARB, (target, v), (F, "glMultiTexCoord4iv(0x%x, %p);\n", target, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterfEXT)(GLenum target, GLenum pname, GLfloat params)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4s)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
{
- DISPATCH(ConvolutionParameterf, (target, pname, params), (F, ";"));
+ DISPATCH(MultiTexCoord4sARB, (target, s, t, r, q), (F, "glMultiTexCoord4s(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q));
}
-KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterfvEXT)(GLenum target, GLenum pname, const GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4sv)(GLenum target, const GLshort * v)
{
- DISPATCH(ConvolutionParameterfv, (target, pname, params), (F, ";"));
+ DISPATCH(MultiTexCoord4svARB, (target, v), (F, "glMultiTexCoord4sv(0x%x, %p);\n", target, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteriEXT)(GLenum target, GLenum pname, GLint params)
+KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixf)(const GLfloat * m)
{
- DISPATCH(ConvolutionParameteri, (target, pname, params), (F, ";"));
+ DISPATCH(LoadTransposeMatrixfARB, (m), (F, "glLoadTransposeMatrixf(%p);\n", (void *) m));
}
-KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterivEXT)(GLenum target, GLenum pname, const GLint *params)
+KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixd)(const GLdouble * m)
{
- DISPATCH(ConvolutionParameteriv, (target, pname, params), (F, ";"));
+ DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixd(%p);\n", (void *) m));
}
-KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter1DEXT)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixf)(const GLfloat * m)
{
- DISPATCH(CopyConvolutionFilter1D, (target, internalformat, x, y, width), (F, ";"));
+ DISPATCH(MultTransposeMatrixfARB, (m), (F, "glMultTransposeMatrixf(%p);\n", (void *) m));
}
-KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter2DEXT)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
+KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixd)(const GLdouble * m)
{
- DISPATCH(CopyConvolutionFilter2D, (target, internalformat, x, y, width, height), (F, ";"));
+ DISPATCH(MultTransposeMatrixdARB, (m), (F, "glMultTransposeMatrixd(%p);\n", (void *) m));
}
-KEYWORD1 void KEYWORD2 NAME(GetConvolutionFilterEXT)(GLenum target, GLenum format, GLenum type, GLvoid *image)
+KEYWORD1 void KEYWORD2 NAME(SampleCoverage)(GLclampf value, GLboolean invert)
{
- DISPATCH(GetConvolutionFilterEXT, (target, format, type, image), (F, ";"));
+ DISPATCH(SampleCoverageARB, (value, invert), (F, "glSampleCoverage(%f, %d);\n", value, invert));
}
-KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterfvEXT)(GLenum target, GLenum pname, GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(CompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data)
{
- DISPATCH(GetConvolutionParameterfvEXT, (target, pname, params), (F, ";"));
+ DISPATCH(CompressedTexImage3DARB, (target, level, internalformat, width, height, depth, border, imageSize, data), (F, "glCompressedTexImage3D(0x%x, %d, 0x%x, %d, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, depth, border, imageSize, (void *) data));
}
-KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterivEXT)(GLenum target, GLenum pname, GLint *params)
+KEYWORD1 void KEYWORD2 NAME(CompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data)
{
- DISPATCH(GetConvolutionParameterivEXT, (target, pname, params), (F, ";"));
+ DISPATCH(CompressedTexImage2DARB, (target, level, internalformat, width, height, border, imageSize, data), (F, "glCompressedTexImage2D(0x%x, %d, 0x%x, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, border, imageSize, (void *) data));
}
-KEYWORD1 void KEYWORD2 NAME(GetSeparableFilterEXT)(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span)
+KEYWORD1 void KEYWORD2 NAME(CompressedTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data)
{
- DISPATCH(GetSeparableFilterEXT, (target, format, type, row, column, span), (F, ";"));
+ DISPATCH(CompressedTexImage1DARB, (target, level, internalformat, width, border, imageSize, data), (F, "glCompressedTexImage1D(0x%x, %d, 0x%x, %d, %d, %d, %p);\n", target, level, internalformat, width, border, imageSize, (void *) data));
}
-KEYWORD1 void KEYWORD2 NAME(SeparableFilter2DEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column)
+KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data)
{
- DISPATCH(SeparableFilter2D, (target, internalformat, width, height, format, type, row, column), (F, ";"));
+ DISPATCH(CompressedTexSubImage3DARB, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), (F, "glCompressedTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, (void *) data));
}
-/* 14. GL_SGI_color_table */
+KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexSubImage2DARB, (target, level, xoffset, yoffset, width, height, format, imageSize, data), (F, "glCompressedTexSubImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, width, height, format, imageSize, (void *) data));
+}
-KEYWORD1 void KEYWORD2 NAME(ColorTableParameterfvSGI)(GLenum target, GLenum pname, const GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data)
{
- DISPATCH(ColorTableParameterfv, (target, pname, params), (F, ";"));
+ DISPATCH(CompressedTexSubImage1DARB, (target, level, xoffset, width, format, imageSize, data), (F, "glCompressedTexSubImage1D(0x%x, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, width, format, imageSize, (void *) data));
}
-KEYWORD1 void KEYWORD2 NAME(ColorTableParameterivSGI)(GLenum target, GLenum pname, const GLint *params)
+KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImage)(GLenum target, GLint level, GLvoid * img)
{
- DISPATCH(ColorTableParameteriv, (target, pname, params), (F, ";"));
+ DISPATCH(GetCompressedTexImageARB, (target, level, img), (F, "glGetCompressedTexImage(0x%x, %d, %p);\n", target, level, (void *) img));
}
-KEYWORD1 void KEYWORD2 NAME(ColorTableSGI)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)
+/* No dispatch for WeightbvARB() */
+/* No dispatch for WeightsvARB() */
+/* No dispatch for WeightivARB() */
+/* No dispatch for WeightfvARB() */
+/* No dispatch for WeightdvARB() */
+/* No dispatch for WeightubvARB() */
+/* No dispatch for WeightusvARB() */
+/* No dispatch for WeightuivARB() */
+/* No dispatch for WeightPointerARB() */
+/* No dispatch for VertexBlendARB() */
+/* No dispatch for CurrentPaletteMatrixARB() */
+/* No dispatch for MatrixIndexubvARB() */
+/* No dispatch for MatrixIndexusvARB() */
+/* No dispatch for MatrixIndexuivARB() */
+/* No dispatch for MatrixIndexPointerARB() */
+KEYWORD1 void KEYWORD2 NAME(BlendColorEXT)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
- DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, ";"));
+ DISPATCH(BlendColor, (red, green, blue, alpha), (F, "glBlendColorEXT(%f, %f, %f, %f);\n", red, green, blue, alpha));
}
-KEYWORD1 void KEYWORD2 NAME(CopyColorTableSGI)(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width)
+KEYWORD1 void KEYWORD2 NAME(PolygonOffsetEXT)(GLfloat factor, GLfloat bias)
{
- DISPATCH(CopyColorTable, (target, internalFormat, x, y, width), (F, ";"));
+ DISPATCH(PolygonOffsetEXT, (factor, bias), (F, "glPolygonOffsetEXT(%f, %f);\n", factor, bias));
}
-KEYWORD1 void KEYWORD2 NAME(GetColorTableSGI)(GLenum target, GLenum format, GLenum type, GLvoid *table)
+KEYWORD1 void KEYWORD2 NAME(TexImage3DEXT)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
{
- DISPATCH(GetColorTableSGI, (target, format, type, table), (F, ";"));
+ DISPATCH(TexImage3D, (target, level, internalformat, width, height, depth, border, format, type, pixels), (F, "glTexImage3DEXT(0x%x, %d, 0x%x, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, depth, border, format, type, (void *) pixels));
}
-KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvSGI)(GLenum target, GLenum pname, GLfloat *params)
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels)
{
- DISPATCH(GetColorTableParameterfvSGI, (target, pname, params), (F, ";"));
+ DISPATCH(TexSubImage3D, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), (F, "glTexSubImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, (void *) pixels));
}
-KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivSGI)(GLenum target, GLenum pname, GLint *params)
+KEYWORD1 void KEYWORD2 NAME(GetTexFilterFuncSGIS)(GLenum target, GLenum filter, GLfloat * weights)
{
- DISPATCH(GetColorTableParameterivSGI, (target, pname, params), (F, ";"));
+ DISPATCH(GetTexFilterFuncSGIS, (target, filter, weights), (F, "glGetTexFilterFuncSGIS(0x%x, 0x%x, %p);\n", target, filter, (void *) weights));
}
-/* ??. GL_SGIX_pixel_texture */
+KEYWORD1 void KEYWORD2 NAME(TexFilterFuncSGIS)(GLenum target, GLenum filter, GLsizei n, const GLfloat * weights)
+{
+ DISPATCH(TexFilterFuncSGIS, (target, filter, n, weights), (F, "glTexFilterFuncSGIS(0x%x, 0x%x, %d, %p);\n", target, filter, n, (void *) weights));
+}
-KEYWORD1 void KEYWORD2 NAME(PixelTexGenSGIX)(GLenum mode)
+KEYWORD1 void KEYWORD2 NAME(TexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels)
{
- DISPATCH(PixelTexGenSGIX, (mode), (F, ";"));
+ DISPATCH(TexSubImage1D, (target, level, xoffset, width, format, type, pixels), (F, "glTexSubImage1DEXT(0x%x, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, width, format, type, (void *) pixels));
}
-/* 15. GL_SGIS_pixel_texture */
+KEYWORD1 void KEYWORD2 NAME(TexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexSubImage2D, (target, level, xoffset, yoffset, width, height, format, type, pixels), (F, "glTexSubImage2DEXT(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, width, height, format, type, (void *) pixels));
+}
-KEYWORD1 void KEYWORD2 NAME(PixelTexGenParameterfSGIS)(GLenum target, GLfloat value)
+KEYWORD1 void KEYWORD2 NAME(CopyTexImage1DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
{
- DISPATCH(PixelTexGenParameterfSGIS, (target, value), (F, ";"));
+ DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, "glCopyTexImage1DEXT(0x%x, %d, 0x%x, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, border));
}
-KEYWORD1 void KEYWORD2 NAME(PixelTexGenParameterfvSGIS)(GLenum target, const GLfloat *value)
+KEYWORD1 void KEYWORD2 NAME(CopyTexImage2DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
{
- DISPATCH(PixelTexGenParameterfvSGIS, (target, value), (F, ";"));
+ DISPATCH(CopyTexImage2D, (target, level, internalformat, x, y, width, height, border), (F, "glCopyTexImage2DEXT(0x%x, %d, 0x%x, %d, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, height, border));
}
-KEYWORD1 void KEYWORD2 NAME(PixelTexGenParameteriSGIS)(GLenum target, GLint value)
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
{
- DISPATCH(PixelTexGenParameteriSGIS, (target, value), (F, ";"));
+ DISPATCH(CopyTexSubImage1D, (target, level, xoffset, x, y, width), (F, "glCopyTexSubImage1DEXT(0x%x, %d, %d, %d, %d, %d);\n", target, level, xoffset, x, y, width));
}
-KEYWORD1 void KEYWORD2 NAME(PixelTexGenParameterivSGIS)(GLenum target, const GLint *value)
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
{
- DISPATCH(PixelTexGenParameterivSGIS, (target, value), (F, ";"));
+ DISPATCH(CopyTexSubImage2D, (target, level, xoffset, yoffset, x, y, width, height), (F, "glCopyTexSubImage2DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, x, y, width, height));
}
-KEYWORD1 void KEYWORD2 NAME(GetPixelTexGenParameterfvSGIS)(GLenum target, GLfloat *value)
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
{
- DISPATCH(GetPixelTexGenParameterfvSGIS, (target, value), (F, ";"));
+ DISPATCH(CopyTexSubImage3D, (target, level, xoffset, yoffset, zoffset, x, y, width, height), (F, "glCopyTexSubImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, zoffset, x, y, width, height));
}
-KEYWORD1 void KEYWORD2 NAME(GetPixelTexGenParameterivSGIS)(GLenum target, GLint *value)
+KEYWORD1 void KEYWORD2 NAME(GetHistogramEXT)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
{
- DISPATCH(GetPixelTexGenParameterivSGIS, (target, value), (F, ";"));
+ DISPATCH(GetHistogramEXT, (target, reset, format, type, values), (F, "glGetHistogramEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (void *) values));
}
-/* 16. GL_SGIS_texture4D */
+KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetHistogramParameterfvEXT, (target, pname, params), (F, "glGetHistogramParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
+}
-KEYWORD1 void KEYWORD2 NAME(TexImage4DSGIS)(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels)
+KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterivEXT)(GLenum target, GLenum pname, GLint * params)
{
- DISPATCH(TexImage4DSGIS, (target, level, internalFormat, width, height, depth, extent, border, format, type, pixels), (F, ";"));
+ DISPATCH(GetHistogramParameterivEXT, (target, pname, params), (F, "glGetHistogramParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(TexSubImage4DSGIS)(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 void *pixels)
+KEYWORD1 void KEYWORD2 NAME(GetMinmaxEXT)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
{
- DISPATCH(TexSubImage4DSGIS, (target, level, xoffset, yoffset, zoffset, woffset, width, height, depth, extent, format, type, pixels), (F, ";"));
+ DISPATCH(GetMinmaxEXT, (target, reset, format, type, values), (F, "glGetMinmaxEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (void *) values));
}
-/* 20. GL_EXT_texture_object */
+KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetMinmaxParameterfvEXT, (target, pname, params), (F, "glGetMinmaxParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
+}
-KEYWORD1 void KEYWORD2 NAME(GenTexturesEXT)(GLsizei n, GLuint *textures)
+KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterivEXT)(GLenum target, GLenum pname, GLint * params)
{
- DISPATCH(GenTextures, (n, textures), (F, ";"));
+ DISPATCH(GetMinmaxParameterivEXT, (target, pname, params), (F, "glGetMinmaxParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(DeleteTexturesEXT)(GLsizei n, const GLuint *texture)
+KEYWORD1 void KEYWORD2 NAME(HistogramEXT)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
{
- DISPATCH(DeleteTextures, (n, texture), (F, ";"));
+ DISPATCH(Histogram, (target, width, internalformat, sink), (F, "glHistogramEXT(0x%x, %d, 0x%x, %d);\n", target, width, internalformat, sink));
}
-KEYWORD1 void KEYWORD2 NAME(BindTextureEXT)(GLenum target, GLuint texture)
+KEYWORD1 void KEYWORD2 NAME(MinmaxEXT)(GLenum target, GLenum internalformat, GLboolean sink)
{
- DISPATCH(BindTexture, (target, texture), (F, ";"));
+ DISPATCH(Minmax, (target, internalformat, sink), (F, "glMinmaxEXT(0x%x, 0x%x, %d);\n", target, internalformat, sink));
}
-KEYWORD1 void KEYWORD2 NAME(PrioritizeTexturesEXT)(GLsizei n, const GLuint *textures, const GLclampf *priorities)
+KEYWORD1 void KEYWORD2 NAME(ResetHistogramEXT)(GLenum target)
{
- DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, ";"));
+ DISPATCH(ResetHistogram, (target), (F, "glResetHistogramEXT(0x%x);\n", target));
}
-KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResidentEXT)(GLsizei n, const GLuint *textures, GLboolean *residences)
+KEYWORD1 void KEYWORD2 NAME(ResetMinmaxEXT)(GLenum target)
{
- RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResidentEXT(%d %p %p);", n, (void *) textures, (void *) residences));
+ DISPATCH(ResetMinmax, (target), (F, "glResetMinmaxEXT(0x%x);\n", target));
}
-KEYWORD1 GLboolean KEYWORD2 NAME(IsTextureEXT)(GLuint texture)
+KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter1DEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image)
{
- RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTextureEXT(%u);", texture));
+ DISPATCH(ConvolutionFilter1D, (target, internalformat, width, format, type, image), (F, "glConvolutionFilter1DEXT(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (void *) image));
}
-/* 21. GL_SGIS_detail_texture */
+KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter2DEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image)
+{
+ DISPATCH(ConvolutionFilter2D, (target, internalformat, width, height, format, type, image), (F, "glConvolutionFilter2DEXT(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, height, format, type, (void *) image));
+}
-KEYWORD1 void KEYWORD2 NAME(DetailTexFuncSGIS)(GLenum target, GLsizei n, const GLfloat *points)
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterfEXT)(GLenum target, GLenum pname, GLfloat params)
{
- DISPATCH(DetailTexFuncSGIS, (target, n, points), (F, ";"));
+ DISPATCH(ConvolutionParameterf, (target, pname, params), (F, "glConvolutionParameterfEXT(0x%x, 0x%x, %f);\n", target, pname, params));
}
-KEYWORD1 void KEYWORD2 NAME(GetDetailTexFuncSGIS)(GLenum target, GLfloat *points)
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterfvEXT)(GLenum target, GLenum pname, const GLfloat * params)
{
- DISPATCH(GetDetailTexFuncSGIS, (target, points), (F, ";"));
+ DISPATCH(ConvolutionParameterfv, (target, pname, params), (F, "glConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-/* 22. GL_SGIS_sharpen_texture */
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteriEXT)(GLenum target, GLenum pname, GLint params)
+{
+ DISPATCH(ConvolutionParameteri, (target, pname, params), (F, "glConvolutionParameteriEXT(0x%x, 0x%x, %d);\n", target, pname, params));
+}
-KEYWORD1 void KEYWORD2 NAME(GetSharpenTexFuncSGIS)(GLenum target, GLfloat *points)
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterivEXT)(GLenum target, GLenum pname, const GLint * params)
{
- DISPATCH(GetSharpenTexFuncSGIS, (target, points), (F, ";"));
+ DISPATCH(ConvolutionParameteriv, (target, pname, params), (F, "glConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(SharpenTexFuncSGIS)(GLenum target, GLsizei n, const GLfloat *points)
+KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter1DEXT)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
{
- DISPATCH(SharpenTexFuncSGIS, (target, n, points), (F, ";"));
+ DISPATCH(CopyConvolutionFilter1D, (target, internalformat, x, y, width), (F, "glCopyConvolutionFilter1DEXT(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width));
}
-/* 25. GL_SGIS_multisample */
+KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter2DEXT)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyConvolutionFilter2D, (target, internalformat, x, y, width, height), (F, "glCopyConvolutionFilter2DEXT(0x%x, 0x%x, %d, %d, %d, %d);\n", target, internalformat, x, y, width, height));
+}
-KEYWORD1 void KEYWORD2 NAME(SampleMaskSGIS)(GLclampf value, GLboolean invert)
+KEYWORD1 void KEYWORD2 NAME(GetConvolutionFilterEXT)(GLenum target, GLenum format, GLenum type, GLvoid * image)
{
- DISPATCH(SampleMaskSGIS, (value, invert), (F, ";"));
+ DISPATCH(GetConvolutionFilterEXT, (target, format, type, image), (F, "glGetConvolutionFilterEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (void *) image));
}
-KEYWORD1 void KEYWORD2 NAME(SamplePatternSGIS)(GLenum pattern)
+KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params)
{
- DISPATCH(SamplePatternSGIS, (pattern), (F, ";"));
+ DISPATCH(GetConvolutionParameterfvEXT, (target, pname, params), (F, "glGetConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-/* 30. GL_EXT_vertex_array */
+KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterivEXT)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetConvolutionParameterivEXT, (target, pname, params), (F, "glGetConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
+}
-KEYWORD1 void KEYWORD2 NAME(VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr)
+KEYWORD1 void KEYWORD2 NAME(GetSeparableFilterEXT)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span)
{
- DISPATCH(VertexPointerEXT, (size, type, stride, count, ptr), (F, ";"));
+ DISPATCH(GetSeparableFilterEXT, (target, format, type, row, column, span), (F, "glGetSeparableFilterEXT(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (void *) row, (void *) column, (void *) span));
}
-KEYWORD1 void KEYWORD2 NAME(NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr)
+KEYWORD1 void KEYWORD2 NAME(SeparableFilter2DEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column)
{
- DISPATCH(NormalPointerEXT, (type, stride, count, ptr), (F, ";"));
+ DISPATCH(SeparableFilter2D, (target, internalformat, width, height, format, type, row, column), (F, "glSeparableFilter2DEXT(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p, %p);\n", target, internalformat, width, height, format, type, (void *) row, (void *) column));
}
-KEYWORD1 void KEYWORD2 NAME(ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr)
+KEYWORD1 void KEYWORD2 NAME(ColorTableSGI)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
{
- DISPATCH(ColorPointerEXT, (size, type, stride, count, ptr), (F, ";"));
+ DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableSGI(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (void *) table));
}
-KEYWORD1 void KEYWORD2 NAME(IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr)
+KEYWORD1 void KEYWORD2 NAME(ColorTableParameterfvSGI)(GLenum target, GLenum pname, const GLfloat * params)
{
- DISPATCH(IndexPointerEXT, (type, stride, count, ptr), (F, ";"));
+ DISPATCH(ColorTableParameterfv, (target, pname, params), (F, "glColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr)
+KEYWORD1 void KEYWORD2 NAME(ColorTableParameterivSGI)(GLenum target, GLenum pname, const GLint * params)
{
- DISPATCH(ColorPointerEXT, (size, type, stride, count, ptr), (F, ";"));
+ DISPATCH(ColorTableParameteriv, (target, pname, params), (F, "glColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean *ptr)
+KEYWORD1 void KEYWORD2 NAME(CopyColorTableSGI)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
{
- DISPATCH(EdgeFlagPointerEXT, (stride, count, ptr), (F, ";"));
+ DISPATCH(CopyColorTable, (target, internalformat, x, y, width), (F, "glCopyColorTableSGI(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width));
}
-KEYWORD1 void KEYWORD2 NAME(GetPointervEXT)(GLenum pname, void **params)
+KEYWORD1 void KEYWORD2 NAME(GetColorTableSGI)(GLenum target, GLenum format, GLenum type, GLvoid * table)
{
- DISPATCH(GetPointerv, (pname, params), (F, ";"));
+ DISPATCH(GetColorTableSGI, (target, format, type, table), (F, "glGetColorTableSGI(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (void *) table));
}
-KEYWORD1 void KEYWORD2 NAME(DrawArraysEXT)(GLenum mode, GLint first, GLsizei count)
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvSGI)(GLenum target, GLenum pname, GLfloat * params)
{
- DISPATCH(DrawArrays, (mode, first, count), (F, ";"));
+ DISPATCH(GetColorTableParameterfvSGI, (target, pname, params), (F, "glGetColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-/* 37. GL_EXT_blend_minmax */
-KEYWORD1 void KEYWORD2 NAME(BlendEquationEXT)(GLenum mode)
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivSGI)(GLenum target, GLenum pname, GLint * params)
{
- DISPATCH(BlendEquation, (mode), (F, "glBlendEquationEXT(0x%x);", mode));
+ DISPATCH(GetColorTableParameterivSGI, (target, pname, params), (F, "glGetColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-/* 52. GL_SGIX_sprite */
+KEYWORD1 void KEYWORD2 NAME(PixelTexGenSGIX)(GLenum mode)
+{
+ DISPATCH(PixelTexGenSGIX, (mode), (F, "glPixelTexGenSGIX(0x%x);\n", mode));
+}
-KEYWORD1 void KEYWORD2 NAME(SpriteParameterfSGIX)(GLenum pname, GLfloat param)
+KEYWORD1 void KEYWORD2 NAME(PixelTexGenParameteriSGIS)(GLenum pname, GLint param)
{
- DISPATCH(SpriteParameterfSGIX, (pname, param), (F, ";"));
+ DISPATCH(PixelTexGenParameteriSGIS, (pname, param), (F, "glPixelTexGenParameteriSGIS(0x%x, %d);\n", pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(SpriteParameterfvSGIX)(GLenum pname, const GLfloat *param)
+KEYWORD1 void KEYWORD2 NAME(PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params)
{
- DISPATCH(SpriteParameterfvSGIX, (pname, param), (F, ";"));
+ DISPATCH(PixelTexGenParameterivSGIS, (pname, params), (F, "glPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(SpriteParameteriSGIX)(GLenum pname, GLint param)
+KEYWORD1 void KEYWORD2 NAME(PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param)
{
- DISPATCH(SpriteParameteriSGIX, (pname, param), (F, ";"));
+ DISPATCH(PixelTexGenParameterfSGIS, (pname, param), (F, "glPixelTexGenParameterfSGIS(0x%x, %f);\n", pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(SpriteParameterivSGIX)(GLenum pname, const GLint *param)
+KEYWORD1 void KEYWORD2 NAME(PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params)
{
- DISPATCH(SpriteParameterivSGIX, (pname, param), (F, ";"));
+ DISPATCH(PixelTexGenParameterfvSGIS, (pname, params), (F, "glPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (void *) params));
}
-/* 54. GL_EXT_point_parameters */
+KEYWORD1 void KEYWORD2 NAME(GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params)
+{
+ DISPATCH(GetPixelTexGenParameterivSGIS, (pname, params), (F, "glGetPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (void *) params));
+}
-KEYWORD1 void KEYWORD2 NAME(PointParameterfEXT)(GLenum target, GLfloat param)
+KEYWORD1 void KEYWORD2 NAME(GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params)
{
- DISPATCH(PointParameterfEXT, (target, param), (F, ";"));
+ DISPATCH(GetPixelTexGenParameterfvSGIS, (pname, params), (F, "glGetPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(PointParameterfvEXT)(GLenum target, const GLfloat *param)
+KEYWORD1 void KEYWORD2 NAME(TexImage4DSGIS)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
{
- DISPATCH(PointParameterfvEXT, (target, param), (F, ";"));
+ DISPATCH(TexImage4DSGIS, (target, level, internalformat, width, height, depth, size4d, border, format, type, pixels), (F, "glTexImage4DSGIS(0x%x, %d, 0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, depth, size4d, border, format, type, (void *) pixels));
}
-KEYWORD1 void KEYWORD2 NAME(PointParameterfSGIS)(GLenum target, GLfloat param)
+KEYWORD1 void KEYWORD2 NAME(TexSubImage4DSGIS)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid * pixels)
{
- DISPATCH(PointParameterfEXT, (target, param), (F, ";"));
+ DISPATCH(TexSubImage4DSGIS, (target, level, xoffset, yoffset, zoffset, woffset, width, height, depth, size4d, format, type, pixels), (F, "glTexSubImage4DSGIS(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, zoffset, woffset, width, height, depth, size4d, format, type, (void *) pixels));
}
-KEYWORD1 void KEYWORD2 NAME(PointParameterfvSGIS)(GLenum target, const GLfloat *param)
+KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResidentEXT)(GLsizei n, const GLuint * textures, GLboolean * residences)
{
- DISPATCH(PointParameterfvEXT, (target, param), (F, ";"));
+ RETURN_DISPATCH(AreTexturesResidentEXT, (n, textures, residences), (F, "glAreTexturesResidentEXT(%d, %p, %p);\n", n, (void *) textures, (void *) residences));
}
-/* 55. GL_SGIX_instruments */
-KEYWORD1 GLint KEYWORD2 NAME(GetInstrumentsSGIX)(void)
+KEYWORD1 void KEYWORD2 NAME(BindTextureEXT)(GLenum target, GLuint texture)
{
- RETURN_DISPATCH(GetInstrumentsSGIX, (), (F, ";"));
+ DISPATCH(BindTexture, (target, texture), (F, "glBindTextureEXT(0x%x, %d);\n", target, texture));
}
-KEYWORD1 void KEYWORD2 NAME(InstrumentsBufferSGIX)(GLsizei size, GLint *buf)
+KEYWORD1 void KEYWORD2 NAME(DeleteTexturesEXT)(GLsizei n, const GLuint * textures)
{
- DISPATCH(InstrumentsBufferSGIX, (size, buf), (F, ";"));
+ DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTexturesEXT(%d, %p);\n", n, (void *) textures));
}
-KEYWORD1 GLint KEYWORD2 NAME(PollInstrumentsSGIX)(GLint *markerp)
+KEYWORD1 void KEYWORD2 NAME(GenTexturesEXT)(GLsizei n, GLuint * textures)
{
- RETURN_DISPATCH(PollInstrumentsSGIX, (markerp), (F, ";"));
+ DISPATCH(GenTexturesEXT, (n, textures), (F, "glGenTexturesEXT(%d, %p);\n", n, (void *) textures));
}
-KEYWORD1 void KEYWORD2 NAME(ReadInstrumentsSGIX)(GLint marker)
+KEYWORD1 GLboolean KEYWORD2 NAME(IsTextureEXT)(GLuint texture)
{
- DISPATCH(ReadInstrumentsSGIX, (marker), (F, ";"));
+ RETURN_DISPATCH(IsTextureEXT, (texture), (F, "glIsTextureEXT(%d);\n", texture));
}
-KEYWORD1 void KEYWORD2 NAME(StartInstrumentsSGIX)(void)
+KEYWORD1 void KEYWORD2 NAME(PrioritizeTexturesEXT)(GLsizei n, const GLuint * textures, const GLclampf * priorities)
{
- DISPATCH(StartInstrumentsSGIX, (), (F, ";"));
+ DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTexturesEXT(%d, %p, %p);\n", n, (void *) textures, (void *) priorities));
}
-KEYWORD1 void KEYWORD2 NAME(StopInstrumentsSGIX)(GLint marker)
+KEYWORD1 void KEYWORD2 NAME(DetailTexFuncSGIS)(GLenum target, GLsizei n, const GLfloat * points)
{
- DISPATCH(StopInstrumentsSGIX, (marker), (F, ";"));
+ DISPATCH(DetailTexFuncSGIS, (target, n, points), (F, "glDetailTexFuncSGIS(0x%x, %d, %p);\n", target, n, (void *) points));
}
-/* 57. GL_SGIX_framezoom */
-KEYWORD1 void KEYWORD2 NAME(FrameZoomSGIX)(GLint factor)
+KEYWORD1 void KEYWORD2 NAME(GetDetailTexFuncSGIS)(GLenum target, GLfloat * points)
{
- DISPATCH(FrameZoomSGIX, (factor), (F, ";"));
+ DISPATCH(GetDetailTexFuncSGIS, (target, points), (F, "glGetDetailTexFuncSGIS(0x%x, %p);\n", target, (void *) points));
}
-/* 58. GL_SGIX_tag_sample_buffer */
-KEYWORD1 void KEYWORD2 NAME(TagSampleBufferSGIX)(void)
+KEYWORD1 void KEYWORD2 NAME(SharpenTexFuncSGIS)(GLenum target, GLsizei n, const GLfloat * points)
{
- DISPATCH(TagSampleBufferSGIX, (), (F, ";"));
+ DISPATCH(SharpenTexFuncSGIS, (target, n, points), (F, "glSharpenTexFuncSGIS(0x%x, %d, %p);\n", target, n, (void *) points));
}
-/* 60. GL_SGIX_reference_plane */
-KEYWORD1 void KEYWORD2 NAME(ReferencePlaneSGIX)(const GLdouble *plane)
+KEYWORD1 void KEYWORD2 NAME(GetSharpenTexFuncSGIS)(GLenum target, GLfloat * points)
{
- DISPATCH(ReferencePlaneSGIX, (plane), (F, ";"));
+ DISPATCH(GetSharpenTexFuncSGIS, (target, points), (F, "glGetSharpenTexFuncSGIS(0x%x, %p);\n", target, (void *) points));
}
-/* 61. GL_SGIX_flush_raster */
-KEYWORD1 void KEYWORD2 NAME(FlushRasterSGIX)(void)
+KEYWORD1 void KEYWORD2 NAME(SampleMaskSGIS)(GLclampf value, GLboolean invert)
{
- DISPATCH(FlushRasterSGIX, (), (F, ";"));
+ DISPATCH(SampleMaskSGIS, (value, invert), (F, "glSampleMaskSGIS(%f, %d);\n", value, invert));
}
-/* 66. GL_HP_image_transform */
-#if 00
-KEYWORD1 void KEYWORD2 NAME(GetImageTransformParameterfvHP)(GLenum target, GLenum pname, GLfloat *param)
+KEYWORD1 void KEYWORD2 NAME(SamplePatternSGIS)(GLenum pattern)
{
- DISPATCH(GetImageTransformParameterfvHP, (target, pname, param), (F, ";"));
+ DISPATCH(SamplePatternSGIS, (pattern), (F, "glSamplePatternSGIS(0x%x);\n", pattern));
}
-KEYWORD1 void KEYWORD2 NAME(GetImageTransformParameterivHP)(GLenum target, GLenum pname, GLint *param)
+KEYWORD1 void KEYWORD2 NAME(ArrayElementEXT)(GLint i)
{
- DISPATCH(GetImageTransformParameterivHP, (target, pname, param), (F, ";"));
+ DISPATCH(ArrayElement, (i), (F, "glArrayElementEXT(%d);\n", i));
}
-KEYWORD1 void KEYWORD2 NAME(ImageTransformParameterfHP)(GLenum target, GLenum pname, const GLfloat param)
+KEYWORD1 void KEYWORD2 NAME(ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
{
- DISPATCH(ImageTransformParameterfHP, (target, pname, param), (F, ";"));
+ DISPATCH(ColorPointerEXT, (size, type, stride, count, pointer), (F, "glColorPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (void *) pointer));
}
-KEYWORD1 void KEYWORD2 NAME(ImageTransformParameterfvHP)(GLenum target, GLenum pname, const GLfloat *param)
+KEYWORD1 void KEYWORD2 NAME(DrawArraysEXT)(GLenum mode, GLint first, GLsizei count)
{
- DISPATCH(ImageTransformParameterfvHP, (target, pname, param), (F, ";"));
+ DISPATCH(DrawArrays, (mode, first, count), (F, "glDrawArraysEXT(0x%x, %d, %d);\n", mode, first, count));
}
-KEYWORD1 void KEYWORD2 NAME(ImageTransformParameteriHP)(GLenum target, GLenum pname, const GLint param)
+KEYWORD1 void KEYWORD2 NAME(EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer)
{
- DISPATCH(ImageTransformParameteriHP, (target, pname, param), (F, ";"));
+ DISPATCH(EdgeFlagPointerEXT, (stride, count, pointer), (F, "glEdgeFlagPointerEXT(%d, %d, %p);\n", stride, count, (void *) pointer));
}
-KEYWORD1 void KEYWORD2 NAME(ImageTransformParameterivHP)(GLenum target, GLenum pname, const GLint *param)
+KEYWORD1 void KEYWORD2 NAME(GetPointervEXT)(GLenum pname, GLvoid ** params)
{
- DISPATCH(ImageTransformParameterivHP, (target, pname, param), (F, ";"));
+ DISPATCH(GetPointerv, (pname, params), (F, "glGetPointervEXT(0x%x, %p);\n", pname, (void *) params));
}
-#endif
-/* 74. GL_EXT_color_subtable */
-KEYWORD1 void KEYWORD2 NAME(ColorSubTableEXT)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data)
+KEYWORD1 void KEYWORD2 NAME(IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
{
- DISPATCH(ColorSubTable, (target, start, count, format, type, data), (F, ";"));
+ DISPATCH(IndexPointerEXT, (type, stride, count, pointer), (F, "glIndexPointerEXT(0x%x, %d, %d, %p);\n", type, stride, count, (void *) pointer));
}
-KEYWORD1 void KEYWORD2 NAME(CopyColorSubTableEXT)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
+KEYWORD1 void KEYWORD2 NAME(NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
{
- DISPATCH(CopyColorSubTable, (target, start, x, y, width), (F, ";"));
+ DISPATCH(NormalPointerEXT, (type, stride, count, pointer), (F, "glNormalPointerEXT(0x%x, %d, %d, %p);\n", type, stride, count, (void *) pointer));
}
-/* 77. GL_PGI_misc_hints */
-KEYWORD1 void KEYWORD2 NAME(HintPGI)(GLenum target, GLint mode)
+KEYWORD1 void KEYWORD2 NAME(TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
{
- DISPATCH(HintPGI, (target, mode), (F, ";"));
+ DISPATCH(TexCoordPointerEXT, (size, type, stride, count, pointer), (F, "glTexCoordPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (void *) pointer));
}
-/* 78. GL_EXT_paletted_texture */
+KEYWORD1 void KEYWORD2 NAME(VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
+{
+ DISPATCH(VertexPointerEXT, (size, type, stride, count, pointer), (F, "glVertexPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (void *) pointer));
+}
-KEYWORD1 void KEYWORD2 NAME(ColorTableEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)
+KEYWORD1 void KEYWORD2 NAME(BlendEquationEXT)(GLenum mode)
{
- DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, ";"));
+ DISPATCH(BlendEquation, (mode), (F, "glBlendEquationEXT(0x%x);\n", mode));
}
-KEYWORD1 void KEYWORD2 NAME(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid *table)
+KEYWORD1 void KEYWORD2 NAME(SpriteParameterfSGIX)(GLenum pname, GLfloat param)
{
- DISPATCH(GetColorTableEXT, (target, format, type, table), (F, ";"));
+ DISPATCH(SpriteParameterfSGIX, (pname, param), (F, "glSpriteParameterfSGIX(0x%x, %f);\n", pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(SpriteParameterfvSGIX)(GLenum pname, const GLfloat * params)
{
- DISPATCH(GetColorTableParameterfvEXT, (target, pname, params), (F, ";"));
+ DISPATCH(SpriteParameterfvSGIX, (pname, params), (F, "glSpriteParameterfvSGIX(0x%x, %p);\n", pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint *params)
+KEYWORD1 void KEYWORD2 NAME(SpriteParameteriSGIX)(GLenum pname, GLint param)
{
- DISPATCH(GetColorTableParameterivEXT, (target, pname, params), (F, ";"));
+ DISPATCH(SpriteParameteriSGIX, (pname, param), (F, "glSpriteParameteriSGIX(0x%x, %d);\n", pname, param));
}
-/* 80. GL_SGIX_list_priority */
+KEYWORD1 void KEYWORD2 NAME(SpriteParameterivSGIX)(GLenum pname, const GLint * params)
+{
+ DISPATCH(SpriteParameterivSGIX, (pname, params), (F, "glSpriteParameterivSGIX(0x%x, %p);\n", pname, (void *) params));
+}
-KEYWORD1 void KEYWORD2 NAME(GetListParameterfvSGIX)(GLuint list, GLenum name, GLfloat *param)
+KEYWORD1 void KEYWORD2 NAME(PointParameterfEXT)(GLenum pname, GLfloat param)
{
- DISPATCH(GetListParameterfvSGIX, (list, name, param), (F, ";"));
+ DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfEXT(0x%x, %f);\n", pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(GetListParameterivSGIX)(GLuint list, GLenum name, GLint *param)
+KEYWORD1 void KEYWORD2 NAME(PointParameterfvEXT)(GLenum pname, const GLfloat * params)
{
- DISPATCH(GetListParameterivSGIX, (list, name, param), (F, ";"));
+ DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvEXT(0x%x, %p);\n", pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(ListParameterfSGIX)(GLuint list, GLenum name, GLfloat param)
+KEYWORD1 void KEYWORD2 NAME(PointParameterfARB)(GLenum pname, GLfloat param)
{
- DISPATCH(ListParameterfSGIX, (list, name, param), (F, ";"));
+ DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfARB(0x%x, %f);\n", pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(ListParameterfvSGIX)(GLuint list, GLenum name, const GLfloat *param)
+KEYWORD1 void KEYWORD2 NAME(PointParameterfvARB)(GLenum pname, const GLfloat * params)
{
- DISPATCH(ListParameterfvSGIX, (list, name, param), (F, ";"));
+ DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvARB(0x%x, %p);\n", pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(ListParameteriSGIX)(GLuint list, GLenum name, GLint param)
+KEYWORD1 void KEYWORD2 NAME(PointParameterfSGIS)(GLenum pname, GLfloat param)
{
- DISPATCH(ListParameteriSGIX, (list, name, param), (F, ";"));
+ DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfSGIS(0x%x, %f);\n", pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(ListParameterivSGIX)(GLuint list, GLenum name, const GLint *param)
+KEYWORD1 void KEYWORD2 NAME(PointParameterfvSGIS)(GLenum pname, const GLfloat * params)
{
- DISPATCH(ListParameterivSGIX, (list, name, param), (F, ";"));
+ DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvSGIS(0x%x, %p);\n", pname, (void *) params));
}
-/* 94. GL_EXT_index_material */
-KEYWORD1 void KEYWORD2 NAME(IndexMaterialEXT)(GLenum face, GLenum mode)
+KEYWORD1 GLint KEYWORD2 NAME(GetInstrumentsSGIX)(void)
{
- DISPATCH(IndexMaterialEXT, (face, mode), (F, ";"));
+ RETURN_DISPATCH(GetInstrumentsSGIX, (), (F, "glGetInstrumentsSGIX();\n"));
}
-/* 95. GL_EXT_index_func */
-KEYWORD1 void KEYWORD2 NAME(IndexFuncEXT)(GLenum func, GLfloat ref)
+KEYWORD1 void KEYWORD2 NAME(InstrumentsBufferSGIX)(GLsizei size, GLint * buffer)
{
- DISPATCH(IndexFuncEXT, (func, ref), (F, ";"));
+ DISPATCH(InstrumentsBufferSGIX, (size, buffer), (F, "glInstrumentsBufferSGIX(%d, %p);\n", size, (void *) buffer));
}
-/* 97. GL_EXT_compiled_vertex_array */
-KEYWORD1 void KEYWORD2 NAME(LockArraysEXT)(GLint first, GLsizei count)
+KEYWORD1 GLint KEYWORD2 NAME(PollInstrumentsSGIX)(GLint * marker_p)
{
- DISPATCH(LockArraysEXT, (first, count), (F, ";"));
+ RETURN_DISPATCH(PollInstrumentsSGIX, (marker_p), (F, "glPollInstrumentsSGIX(%p);\n", (void *) marker_p));
}
-KEYWORD1 void KEYWORD2 NAME(UnlockArraysEXT)(void)
+KEYWORD1 void KEYWORD2 NAME(ReadInstrumentsSGIX)(GLint marker)
{
- DISPATCH(UnlockArraysEXT, (), (F, ";"));
+ DISPATCH(ReadInstrumentsSGIX, (marker), (F, "glReadInstrumentsSGIX(%d);\n", marker));
}
-/* 98. GL_EXT_cull_vertex */
-KEYWORD1 void KEYWORD2 NAME(CullParameterfvEXT)(GLenum pname, GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(StartInstrumentsSGIX)(void)
{
- DISPATCH(CullParameterfvEXT, (pname, params), (F, ";"));
+ DISPATCH(StartInstrumentsSGIX, (), (F, "glStartInstrumentsSGIX();\n"));
}
-KEYWORD1 void KEYWORD2 NAME(CullParameterdvEXT)(GLenum pname, GLdouble *params)
+KEYWORD1 void KEYWORD2 NAME(StopInstrumentsSGIX)(GLint marker)
{
- DISPATCH(CullParameterdvEXT, (pname, params), (F, ";"));
+ DISPATCH(StopInstrumentsSGIX, (marker), (F, "glStopInstrumentsSGIX(%d);\n", marker));
}
-/* 102. GL_SGIX_fragment_lighting */
-KEYWORD1 void KEYWORD2 NAME(FragmentColorMaterialSGIX)(GLenum face, GLenum mode)
+KEYWORD1 void KEYWORD2 NAME(FrameZoomSGIX)(GLint factor)
{
- DISPATCH(FragmentColorMaterialSGIX, (face, mode), (F, ";"));
+ DISPATCH(FrameZoomSGIX, (factor), (F, "glFrameZoomSGIX(%d);\n", factor));
}
-KEYWORD1 void KEYWORD2 NAME(FragmentLightfSGIX)(GLenum light, GLenum pname, GLfloat param)
+KEYWORD1 void KEYWORD2 NAME(TagSampleBufferSGIX)(void)
{
- DISPATCH(FragmentLightfSGIX, (light, pname, param), (F, ";"));
+ DISPATCH(TagSampleBufferSGIX, (), (F, "glTagSampleBufferSGIX();\n"));
}
-KEYWORD1 void KEYWORD2 NAME(FragmentLightfvSGIX)(GLenum light, GLenum pname, const GLfloat * params)
+/* No dispatch for DeformationMap3dSGIX() */
+/* No dispatch for DeformationMap3fSGIX() */
+/* No dispatch for DeformSGIX() */
+/* No dispatch for LoadIdentityDeformationMapSGIX() */
+KEYWORD1 void KEYWORD2 NAME(ReferencePlaneSGIX)(const GLdouble * equation)
{
- DISPATCH(FragmentLightfvSGIX, (light, pname, params), (F, ";"));
+ DISPATCH(ReferencePlaneSGIX, (equation), (F, "glReferencePlaneSGIX(%p);\n", (void *) equation));
}
-KEYWORD1 void KEYWORD2 NAME(FragmentLightiSGIX)(GLenum light, GLenum pname, GLint param)
+KEYWORD1 void KEYWORD2 NAME(FlushRasterSGIX)(void)
{
- DISPATCH(FragmentLightiSGIX, (light, pname, param), (F, ";"));
+ DISPATCH(FlushRasterSGIX, (), (F, "glFlushRasterSGIX();\n"));
}
-KEYWORD1 void KEYWORD2 NAME(FragmentLightivSGIX)(GLenum light, GLenum pname, const GLint * params)
+/* No dispatch for FogFuncSGIS() */
+/* No dispatch for GetFogFuncSGIS() */
+/* No dispatch for ImageTransformParameteriHP() */
+/* No dispatch for ImageTransformParameterfHP() */
+/* No dispatch for ImageTransformParameterivHP() */
+/* No dispatch for ImageTransformParameterfvHP() */
+/* No dispatch for GetImageTransformParameterivHP() */
+/* No dispatch for GetImageTransformParameterfvHP() */
+KEYWORD1 void KEYWORD2 NAME(ColorSubTableEXT)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data)
{
- DISPATCH(FragmentLightivSGIX, (light, pname, params), (F, ";"));
+ DISPATCH(ColorSubTable, (target, start, count, format, type, data), (F, "glColorSubTableEXT(0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, start, count, format, type, (void *) data));
}
-KEYWORD1 void KEYWORD2 NAME(FragmentLightModelfSGIX)(GLenum pname, GLfloat param)
+KEYWORD1 void KEYWORD2 NAME(CopyColorSubTableEXT)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
{
- DISPATCH(FragmentLightModelfSGIX, (pname, param), (F, ";"));
+ DISPATCH(CopyColorSubTable, (target, start, x, y, width), (F, "glCopyColorSubTableEXT(0x%x, %d, %d, %d, %d);\n", target, start, x, y, width));
}
-KEYWORD1 void KEYWORD2 NAME(FragmentLightModelfvSGIX)(GLenum pname, const GLfloat * params)
+KEYWORD1 void KEYWORD2 NAME(HintPGI)(GLenum target, GLint mode)
{
- DISPATCH(FragmentLightModelfvSGIX, (pname, params), (F, ";"));
+ DISPATCH(HintPGI, (target, mode), (F, "glHintPGI(0x%x, %d);\n", target, mode));
}
-KEYWORD1 void KEYWORD2 NAME(FragmentLightModeliSGIX)(GLenum pname, GLint param)
+KEYWORD1 void KEYWORD2 NAME(ColorTableEXT)(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
{
- DISPATCH(FragmentLightModeliSGIX, (pname, param), (F, ";"));
+ DISPATCH(ColorTable, (target, internalFormat, width, format, type, table), (F, "glColorTableEXT(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalFormat, width, format, type, (void *) table));
}
-KEYWORD1 void KEYWORD2 NAME(FragmentLightModelivSGIX)(GLenum pname, const GLint * params)
+KEYWORD1 void KEYWORD2 NAME(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid * data)
{
- DISPATCH(FragmentLightModelivSGIX, (pname, params), (F, ";"));
+ DISPATCH(GetColorTableEXT, (target, format, type, data), (F, "glGetColorTableEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (void *) data));
}
-KEYWORD1 void KEYWORD2 NAME(FragmentMaterialfSGIX)(GLenum face, GLenum pname, GLfloat param)
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint * params)
{
- DISPATCH(FragmentMaterialfSGIX, (face, pname, param), (F, ";"));
+ DISPATCH(GetColorTableParameterivEXT, (target, pname, params), (F, "glGetColorTableParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(FragmentMaterialfvSGIX)(GLenum face, GLenum pname, const GLfloat * params)
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params)
{
- DISPATCH(FragmentMaterialfvSGIX, (face, pname, params), (F, ";"));
+ DISPATCH(GetColorTableParameterfvEXT, (target, pname, params), (F, "glGetColorTableParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(FragmentMaterialiSGIX)(GLenum face, GLenum pname, GLint param)
+KEYWORD1 void KEYWORD2 NAME(GetListParameterfvSGIX)(GLuint list, GLenum pname, GLfloat * params)
{
- DISPATCH(FragmentMaterialiSGIX, (face, pname, param), (F, ";"));
+ DISPATCH(GetListParameterfvSGIX, (list, pname, params), (F, "glGetListParameterfvSGIX(%d, 0x%x, %p);\n", list, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(FragmentMaterialivSGIX)(GLenum face, GLenum pname, const GLint * params)
+KEYWORD1 void KEYWORD2 NAME(GetListParameterivSGIX)(GLuint list, GLenum pname, GLint * params)
{
- DISPATCH(FragmentMaterialivSGIX, (face, pname, params), (F, ";"));
+ DISPATCH(GetListParameterivSGIX, (list, pname, params), (F, "glGetListParameterivSGIX(%d, 0x%x, %p);\n", list, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(GetFragmentLightfvSGIX)(GLenum light, GLenum pname, GLfloat * params)
+KEYWORD1 void KEYWORD2 NAME(ListParameterfSGIX)(GLuint list, GLenum pname, GLfloat param)
{
- DISPATCH(FragmentLightfvSGIX, (light, pname, params), (F, ";"));
+ DISPATCH(ListParameterfSGIX, (list, pname, param), (F, "glListParameterfSGIX(%d, 0x%x, %f);\n", list, pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(GetFragmentLightivSGIX)(GLenum light, GLenum pname, GLint * params)
+KEYWORD1 void KEYWORD2 NAME(ListParameterfvSGIX)(GLuint list, GLenum pname, const GLfloat * params)
{
- DISPATCH(FragmentLightivSGIX, (light, pname, params), (F, ";"));
+ DISPATCH(ListParameterfvSGIX, (list, pname, params), (F, "glListParameterfvSGIX(%d, 0x%x, %p);\n", list, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(GetFragmentMaterialfvSGIX)(GLenum face, GLenum pname, GLfloat * params)
+KEYWORD1 void KEYWORD2 NAME(ListParameteriSGIX)(GLuint list, GLenum pname, GLint param)
{
- DISPATCH(FragmentMaterialfvSGIX, (face, pname, params), (F, ";"));
+ DISPATCH(ListParameteriSGIX, (list, pname, param), (F, "glListParameteriSGIX(%d, 0x%x, %d);\n", list, pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(GetFragmentMaterialivSGIX)(GLenum face, GLenum pname, GLint * params)
+KEYWORD1 void KEYWORD2 NAME(ListParameterivSGIX)(GLuint list, GLenum pname, const GLint * params)
{
- DISPATCH(FragmentMaterialivSGIX, (face, pname, params), (F, ";"));
+ DISPATCH(ListParameterivSGIX, (list, pname, params), (F, "glListParameterivSGIX(%d, 0x%x, %p);\n", list, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(LightEnviSGIX)(GLenum pname, GLint param)
+KEYWORD1 void KEYWORD2 NAME(IndexMaterialEXT)(GLenum face, GLenum mode)
{
- DISPATCH(LightEnviSGIX, (pname, param), (F, ";"));
+ DISPATCH(IndexMaterialEXT, (face, mode), (F, "glIndexMaterialEXT(0x%x, 0x%x);\n", face, mode));
}
-/* 112. GL_EXT_draw_range_elements */
-KEYWORD1 void KEYWORD2 NAME(DrawRangeElementsEXT)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)
+KEYWORD1 void KEYWORD2 NAME(IndexFuncEXT)(GLenum func, GLclampf ref)
{
- DISPATCH(DrawRangeElements, (mode, start, end, count, type, indices), (F, "glDrawRangeElementsEXT(0x%x, %u %u %d 0x%x %p);", mode, start, end, count, type, (void *) indices));
+ DISPATCH(IndexFuncEXT, (func, ref), (F, "glIndexFuncEXT(0x%x, %f);\n", func, ref));
}
-/* 117. GL_EXT_light_texture */
-#if 00
-KEYWORD1 void KEYWORD2 NAME(ApplyTextureEXT)(GLenum mode)
+KEYWORD1 void KEYWORD2 NAME(LockArraysEXT)(GLint first, GLsizei count)
{
- DISPATCH(ApplyTextureEXT, (mode), (F, "glApplyTextureEXT(0x%x);", mode));
+ DISPATCH(LockArraysEXT, (first, count), (F, "glLockArraysEXT(%d, %d);\n", first, count));
}
-KEYWORD1 void KEYWORD2 NAME(TextureLightEXT)(GLenum pname)
+KEYWORD1 void KEYWORD2 NAME(UnlockArraysEXT)(void)
{
- DISPATCH(TextureLightEXT, (pname), (F, "glTextureLightEXT(0x%x);", pname));
+ DISPATCH(UnlockArraysEXT, (), (F, "glUnlockArraysEXT();\n"));
}
-KEYWORD1 void KEYWORD2 NAME(TextureMaterialEXT)(GLenum face, GLenum mode)
+KEYWORD1 void KEYWORD2 NAME(CullParameterdvEXT)(GLenum pname, GLdouble * params)
{
- DISPATCH(TextureMaterialEXT, (face, mode), (F, "glTextureMaterialEXT(0x%x, 0x%x);", face, mode));
+ DISPATCH(CullParameterdvEXT, (pname, params), (F, "glCullParameterdvEXT(0x%x, %p);\n", pname, (void *) params));
}
-#endif
-/* 135. GL_INTEL_texture_scissor */
-#if 00
-KEYWORD1 void KEYWORD2 NAME(TexScissorINTEL)(GLenum target, GLclampf tlow, GLclampf thigh)
+KEYWORD1 void KEYWORD2 NAME(CullParameterfvEXT)(GLenum pname, GLfloat * params)
{
- DISPATCH(TexScissorINTEL, (target, tlow, thigh), (F, "glTexScissorINTEL(0x%x %g %g);", target, tlow, thigh));
+ DISPATCH(CullParameterfvEXT, (pname, params), (F, "glCullParameterfvEXT(0x%x, %p);\n", pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(TexScissorFuncINTEL)(GLenum target, GLenum lfunc, GLenum hfunc)
+KEYWORD1 void KEYWORD2 NAME(FragmentColorMaterialSGIX)(GLenum face, GLenum mode)
{
- DISPATCH(TexScissorFuncINTEL, (target, lfunc, hfunc), (F, "glTexScissorFuncINTEL(0x%x 0x%x 0x%x);", target, tlow, thigh));
+ DISPATCH(FragmentColorMaterialSGIX, (face, mode), (F, "glFragmentColorMaterialSGIX(0x%x, 0x%x);\n", face, mode));
}
-#endif
-/* 136. GL_INTEL_parallel_arrays */
-#if 00
-KEYWORD1 void KEYWORD2 NAME(VertexPointervINTEL)(GLint size, GLenum type, const void ** pointer)
+KEYWORD1 void KEYWORD2 NAME(FragmentLightfSGIX)(GLenum light, GLenum pname, GLfloat param)
{
- DISPATCH(VertexPointervINTEL, (size, type, pointer), (F, "glVertexPointervINTEL(%d, 0x%x, %p);", size, type, pointer));
+ DISPATCH(FragmentLightfSGIX, (light, pname, param), (F, "glFragmentLightfSGIX(0x%x, 0x%x, %f);\n", light, pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(NormalPointervINTEL)(GLenum type, const void** pointer)
+KEYWORD1 void KEYWORD2 NAME(FragmentLightfvSGIX)(GLenum light, GLenum pname, const GLfloat * params)
{
- DISPATCH(NormalPointervINTEL, (size, pointer), (F, "glNormalPointervINTEL(%d, %p);", size, pointer));
+ DISPATCH(FragmentLightfvSGIX, (light, pname, params), (F, "glFragmentLightfvSGIX(0x%x, 0x%x, %p);\n", light, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(ColorPointervINTEL)(GLint size, GLenum type, const void** pointer)
+KEYWORD1 void KEYWORD2 NAME(FragmentLightiSGIX)(GLenum light, GLenum pname, GLint param)
{
- DISPATCH(ColorPointervINTEL, (size, type, pointer), (F, "glColorPointervINTEL(%d, 0x%x, %p);", size, type, pointer));
+ DISPATCH(FragmentLightiSGIX, (light, pname, param), (F, "glFragmentLightiSGIX(0x%x, 0x%x, %d);\n", light, pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(TexCoordPointervINTEL)(GLint size, GLenum type, const void** pointer)
+KEYWORD1 void KEYWORD2 NAME(FragmentLightivSGIX)(GLenum light, GLenum pname, const GLint * params)
{
- DISPATCH(TexCoordPointervINTEL, (size, type, pointer), (F, "glTexCoordPointervINTEL(%d, 0x%x, %p);", size, type, pointer));
+ DISPATCH(FragmentLightivSGIX, (light, pname, params), (F, "glFragmentLightivSGIX(0x%x, 0x%x, %p);\n", light, pname, (void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FragmentLightModelfSGIX)(GLenum pname, GLfloat param)
+{
+ DISPATCH(FragmentLightModelfSGIX, (pname, param), (F, "glFragmentLightModelfSGIX(0x%x, %f);\n", pname, param));
}
-#endif
-/* 138. GL_EXT_pixel_transform */
-#if 00
-KEYWORD1 void KEYWORD2 NAME(PixelTransformParameteriEXT)(GLenum target, GLenum pname, const GLint param)
+KEYWORD1 void KEYWORD2 NAME(FragmentLightModelfvSGIX)(GLenum pname, const GLfloat * params)
{
- DISPATCH(PixelTransformParameteriEXT, (target, pname, param), (F, "glPixelTransformParameteriEXT(0x%x, 0x%x, %d);", target, pname, param));
+ DISPATCH(FragmentLightModelfvSGIX, (pname, params), (F, "glFragmentLightModelfvSGIX(0x%x, %p);\n", pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(PixelTransformParameterfEXT)(GLenum target, GLenum pname, const GLfloat param)
+KEYWORD1 void KEYWORD2 NAME(FragmentLightModeliSGIX)(GLenum pname, GLint param)
{
- DISPATCH(PixelTransformParameterfEXT, (target, pname, param), (F, "glPixelTransformParameterfEXT(0x%x, 0x%x, %f);", target, pname, param));
+ DISPATCH(FragmentLightModeliSGIX, (pname, param), (F, "glFragmentLightModeliSGIX(0x%x, %d);\n", pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(PixelTransformParameterivEXT)(GLenum target, GLenum pname, const GLint *params)
+KEYWORD1 void KEYWORD2 NAME(FragmentLightModelivSGIX)(GLenum pname, const GLint * params)
{
- DISPATCH(PixelTransformParameterivEXT, (target, pname, params), (F, "glPixelTransformParameterivEXT(0x%x, 0x%x, %p);", target, pname, params));
+ DISPATCH(FragmentLightModelivSGIX, (pname, params), (F, "glFragmentLightModelivSGIX(0x%x, %p);\n", pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(PixelTransformParameterfvEXT)(GLenum target, GLenum pname, const GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(FragmentMaterialfSGIX)(GLenum face, GLenum pname, GLfloat param)
{
- DISPATCH(PixelTransformParameterfvEXT, (target, pname, params), (F, "glPixelTransformParameterfvEXT(0x%x, 0x%x, %p);", target, pname, params));
+ DISPATCH(FragmentMaterialfSGIX, (face, pname, param), (F, "glFragmentMaterialfSGIX(0x%x, 0x%x, %f);\n", face, pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(GetPixelTransformParameterivEXT)(GLenum target, GLenum pname, const GLint *params)
+KEYWORD1 void KEYWORD2 NAME(FragmentMaterialfvSGIX)(GLenum face, GLenum pname, const GLfloat * params)
{
- DISPATCH(GetPixelTransformParameterivEXT, (target, pname, params), (F, "glGetPixelTransformParameterivEXT(0x%x, 0x%x, %p);", target, pname, params));
+ DISPATCH(FragmentMaterialfvSGIX, (face, pname, params), (F, "glFragmentMaterialfvSGIX(0x%x, 0x%x, %p);\n", face, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(GetPixelTransformParameterfvEXT)(GLenum target, GLenum pname, const GLfloat *params)
+KEYWORD1 void KEYWORD2 NAME(FragmentMaterialiSGIX)(GLenum face, GLenum pname, GLint param)
{
- DISPATCH(GetPixelTransformParameterfvEXT, (target, pname, params), (F, "glGetPixelTransformParameterfvEXT(0x%x, 0x%x, %p);", target, pname, params));
+ DISPATCH(FragmentMaterialiSGIX, (face, pname, param), (F, "glFragmentMaterialiSGIX(0x%x, 0x%x, %d);\n", face, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FragmentMaterialivSGIX)(GLenum face, GLenum pname, const GLint * params)
+{
+ DISPATCH(FragmentMaterialivSGIX, (face, pname, params), (F, "glFragmentMaterialivSGIX(0x%x, 0x%x, %p);\n", face, pname, (void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetFragmentLightfvSGIX)(GLenum light, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetFragmentLightfvSGIX, (light, pname, params), (F, "glGetFragmentLightfvSGIX(0x%x, 0x%x, %p);\n", light, pname, (void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetFragmentLightivSGIX)(GLenum light, GLenum pname, GLint * params)
+{
+ DISPATCH(GetFragmentLightivSGIX, (light, pname, params), (F, "glGetFragmentLightivSGIX(0x%x, 0x%x, %p);\n", light, pname, (void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetFragmentMaterialfvSGIX)(GLenum face, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetFragmentMaterialfvSGIX, (face, pname, params), (F, "glGetFragmentMaterialfvSGIX(0x%x, 0x%x, %p);\n", face, pname, (void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetFragmentMaterialivSGIX)(GLenum face, GLenum pname, GLint * params)
+{
+ DISPATCH(GetFragmentMaterialivSGIX, (face, pname, params), (F, "glGetFragmentMaterialivSGIX(0x%x, 0x%x, %p);\n", face, pname, (void *) params));
}
-#endif
-/* 145. GL_EXT_secondary_color */
+KEYWORD1 void KEYWORD2 NAME(LightEnviSGIX)(GLenum pname, GLint param)
+{
+ DISPATCH(LightEnviSGIX, (pname, param), (F, "glLightEnviSGIX(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawRangeElementsEXT)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices)
+{
+ DISPATCH(DrawRangeElements, (mode, start, end, count, type, indices), (F, "glDrawRangeElementsEXT(0x%x, %d, %d, %d, 0x%x, %p);\n", mode, start, end, count, type, (void *) indices));
+}
+/* No dispatch for ApplyTextureEXT() */
+/* No dispatch for TextureLightEXT() */
+/* No dispatch for TextureMaterialEXT() */
+/* No dispatch for AsyncMarkerSGIX() */
+/* No dispatch for FinishAsyncSGIX() */
+/* No dispatch for PollAsyncSGIX() */
+/* No dispatch for GenAsyncMarkersSGIX() */
+/* No dispatch for DeleteAsyncMarkersSGIX() */
+/* No dispatch for IsAsyncMarkerSGIX() */
+/* No dispatch for VertexPointervINTEL() */
+/* No dispatch for NormalPointervINTEL() */
+/* No dispatch for ColorPointervINTEL() */
+/* No dispatch for TexCoordPointervINTEL() */
+/* No dispatch for PixelTransformParameteriEXT() */
+/* No dispatch for PixelTransformParameterfEXT() */
+/* No dispatch for PixelTransformParameterivEXT() */
+/* No dispatch for PixelTransformParameterfvEXT() */
KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue)
{
- DISPATCH(SecondaryColor3bEXT, (red, green, blue), (F, "glSecondaryColor3bEXT(%d, %d, %d);", red, green, blue));
+ DISPATCH(SecondaryColor3bEXT, (red, green, blue), (F, "glSecondaryColor3bEXT(%d, %d, %d);\n", red, green, blue));
}
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bvEXT)(const GLbyte *v)
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bvEXT)(const GLbyte * v)
{
- DISPATCH(SecondaryColor3bvEXT, (v), (F, "glSecondaryColor3bvEXT(%d, %d, %d);", v[0], v[1], v[2]));
+ DISPATCH(SecondaryColor3bvEXT, (v), (F, "glSecondaryColor3bvEXT(%p);\n", (void *) v));
}
KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue)
{
- DISPATCH(SecondaryColor3dEXT, (red, green, blue), (F, "glSecondaryColor3dEXT(%g, %g, %g);", red, green, blue));
+ DISPATCH(SecondaryColor3dEXT, (red, green, blue), (F, "glSecondaryColor3dEXT(%f, %f, %f);\n", red, green, blue));
}
KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dvEXT)(const GLdouble * v)
{
- DISPATCH(SecondaryColor3dvEXT, (v), (F, "glSecondaryColor3dvEXT(%g, %g, %g);", v[0], v[1], v[2]));
+ DISPATCH(SecondaryColor3dvEXT, (v), (F, "glSecondaryColor3dvEXT(%p /* %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2]));
}
KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue)
{
- DISPATCH(SecondaryColor3fEXT, (red, green, blue), (F, "glSecondaryColor3fEXT(%g, %g, %g);", red, green, blue));
+ DISPATCH(SecondaryColor3fEXT, (red, green, blue), (F, "glSecondaryColor3fEXT(%f, %f, %f);\n", red, green, blue));
}
KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fvEXT)(const GLfloat * v)
{
- DISPATCH(SecondaryColor3fvEXT, (v), (F, "glSecondaryColor3fvEXT(%g, %g, %g);", v[0], v[1], v[2]));
+ DISPATCH(SecondaryColor3fvEXT, (v), (F, "glSecondaryColor3fvEXT(%p /* %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2]));
}
KEYWORD1 void KEYWORD2 NAME(SecondaryColor3iEXT)(GLint red, GLint green, GLint blue)
{
- DISPATCH(SecondaryColor3iEXT, (red, green, blue), (F, "glSecondaryColor3iEXT(%d, %d, %d);", red, green, blue));
+ DISPATCH(SecondaryColor3iEXT, (red, green, blue), (F, "glSecondaryColor3iEXT(%d, %d, %d);\n", red, green, blue));
}
KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ivEXT)(const GLint * v)
{
- DISPATCH(SecondaryColor3ivEXT, (v), (F, "glSecondaryColor3ivEXT(%d, %d, %d);", v[0], v[1], v[2]));
+ DISPATCH(SecondaryColor3ivEXT, (v), (F, "glSecondaryColor3ivEXT(%p);\n", (void *) v));
}
KEYWORD1 void KEYWORD2 NAME(SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue)
{
- DISPATCH(SecondaryColor3sEXT, (red, green, blue), (F, "glSecondaryColor3sEXT(%d, %d, %d);", red, green, blue));
+ DISPATCH(SecondaryColor3sEXT, (red, green, blue), (F, "glSecondaryColor3sEXT(%d, %d, %d);\n", red, green, blue));
}
KEYWORD1 void KEYWORD2 NAME(SecondaryColor3svEXT)(const GLshort * v)
{
- DISPATCH(SecondaryColor3svEXT, (v), (F, "glSecondaryColor3svEXT(%d, %d, %d);", v[0], v[1], v[2]));
+ DISPATCH(SecondaryColor3svEXT, (v), (F, "glSecondaryColor3svEXT(%p);\n", (void *) v));
}
KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue)
{
- DISPATCH(SecondaryColor3ubEXT, (red, green, blue), (F, "glSecondaryColor3ubEXT(%d, %d, %d);", red, green, blue));
+ DISPATCH(SecondaryColor3ubEXT, (red, green, blue), (F, "glSecondaryColor3ubEXT(%d, %d, %d);\n", red, green, blue));
}
KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubvEXT)(const GLubyte * v)
{
- DISPATCH(SecondaryColor3ubvEXT, (v), (F, "glSecondaryColor3ubvEXT(%d, %d, %d);", v[0], v[1], v[2]));
+ DISPATCH(SecondaryColor3ubvEXT, (v), (F, "glSecondaryColor3ubvEXT(%p);\n", (void *) v));
}
KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue)
{
- DISPATCH(SecondaryColor3uiEXT, (red, green, blue), (F, "glSecondaryColor3uiEXT(%d, %d, %d);", red, green, blue));
+ DISPATCH(SecondaryColor3uiEXT, (red, green, blue), (F, "glSecondaryColor3uiEXT(%d, %d, %d);\n", red, green, blue));
}
KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uivEXT)(const GLuint * v)
{
- DISPATCH(SecondaryColor3uivEXT, (v), (F, "glSecondaryColor3uivEXT(%d, %d, %d);", v[0], v[1], v[2]));
+ DISPATCH(SecondaryColor3uivEXT, (v), (F, "glSecondaryColor3uivEXT(%p);\n", (void *) v));
}
KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue)
{
- DISPATCH(SecondaryColor3usEXT, (red, green, blue), (F, "glSecondaryColor3usEXT(%d, %d, %d);", red, green, blue));
+ DISPATCH(SecondaryColor3usEXT, (red, green, blue), (F, "glSecondaryColor3usEXT(%d, %d, %d);\n", red, green, blue));
}
KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usvEXT)(const GLushort * v)
{
- DISPATCH(SecondaryColor3usvEXT, (v), (F, "glSecondaryColor3usvEXT(%d, %d, %d);", v[0], v[1], v[2]));
+ DISPATCH(SecondaryColor3usvEXT, (v), (F, "glSecondaryColor3usvEXT(%p);\n", (void *) v));
}
KEYWORD1 void KEYWORD2 NAME(SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
{
- DISPATCH(SecondaryColorPointerEXT, (size, type, stride, pointer), (F, "glSecondaryColorPointerEXT(%d, 0x%x, %d, %p);", size, type, stride, pointer));
+ DISPATCH(SecondaryColorPointerEXT, (size, type, stride, pointer), (F, "glSecondaryColorPointerEXT(%d, 0x%x, %d, %p);\n", size, type, stride, (void *) pointer));
}
-/* 149. GL_EXT_fog_coord */
+/* No dispatch for TextureNormalEXT() */
+KEYWORD1 void KEYWORD2 NAME(MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount)
+{
+ DISPATCH(MultiDrawArraysEXT, (mode, first, count, primcount), (F, "glMultiDrawArraysEXT(0x%x, %p, %p, %d);\n", mode, (void *) first, (void *) count, primcount));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount)
+{
+ DISPATCH(MultiDrawElementsEXT, (mode, count, type, indices, primcount), (F, "glMultiDrawElementsEXT(0x%x, %p, 0x%x, %p, %d);\n", mode, (void *) count, type, (void *) indices, primcount));
+}
KEYWORD1 void KEYWORD2 NAME(FogCoordfEXT)(GLfloat coord)
{
- DISPATCH(FogCoordfEXT, (coord), (F, "glFogCoordfEXT(%g);", coord));
+ DISPATCH(FogCoordfEXT, (coord), (F, "glFogCoordfEXT(%f);\n", coord));
}
-KEYWORD1 void KEYWORD2 NAME(FogCoordfvEXT)(const GLfloat *coord)
+KEYWORD1 void KEYWORD2 NAME(FogCoordfvEXT)(const GLfloat * coord)
{
- DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfvEXT(%p);", (void *) coord));
+ DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfvEXT(%p);\n", (void *) coord));
}
KEYWORD1 void KEYWORD2 NAME(FogCoorddEXT)(GLdouble coord)
{
- DISPATCH(FogCoorddEXT, (coord), (F, "glFogCoorddEXT(%g);", coord));
+ DISPATCH(FogCoorddEXT, (coord), (F, "glFogCoorddEXT(%f);\n", coord));
}
KEYWORD1 void KEYWORD2 NAME(FogCoorddvEXT)(const GLdouble * coord)
{
- DISPATCH(FogCoorddvEXT, (coord), (F, "glFogCoorddvEXT(%p);", (void *) coord));
+ DISPATCH(FogCoorddvEXT, (coord), (F, "glFogCoorddvEXT(%p);\n", (void *) coord));
}
KEYWORD1 void KEYWORD2 NAME(FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer)
{
- DISPATCH(FogCoordPointerEXT, (type, stride, pointer), (F, "glFogCoordPointerEXT(0x%x, %d, %p);", type, stride, (void *) pointer));
-}
-
-/* 173. GL_EXT/INGR_blend_func_separate */
+ DISPATCH(FogCoordPointerEXT, (type, stride, pointer), (F, "glFogCoordPointerEXT(0x%x, %d, %p);\n", type, stride, (void *) pointer));
+}
+
+/* No dispatch for Tangent3bEXT() */
+/* No dispatch for Tangent3bvEXT() */
+/* No dispatch for Tangent3dEXT() */
+/* No dispatch for Tangent3dvEXT() */
+/* No dispatch for Tangent3fEXT() */
+/* No dispatch for Tangent3fvEXT() */
+/* No dispatch for Tangent3iEXT() */
+/* No dispatch for Tangent3ivEXT() */
+/* No dispatch for Tangent3sEXT() */
+/* No dispatch for Tangent3svEXT() */
+/* No dispatch for Binormal3bEXT() */
+/* No dispatch for Binormal3bvEXT() */
+/* No dispatch for Binormal3dEXT() */
+/* No dispatch for Binormal3dvEXT() */
+/* No dispatch for Binormal3fEXT() */
+/* No dispatch for Binormal3fvEXT() */
+/* No dispatch for Binormal3iEXT() */
+/* No dispatch for Binormal3ivEXT() */
+/* No dispatch for Binormal3sEXT() */
+/* No dispatch for Binormal3svEXT() */
+/* No dispatch for TangentPointerEXT() */
+/* No dispatch for BinormalPointerEXT() */
+/* No dispatch for FinishTextureSUNX() */
+/* No dispatch for GlobalAlphaFactorbSUN() */
+/* No dispatch for GlobalAlphaFactorsSUN() */
+/* No dispatch for GlobalAlphaFactoriSUN() */
+/* No dispatch for GlobalAlphaFactorfSUN() */
+/* No dispatch for GlobalAlphaFactordSUN() */
+/* No dispatch for GlobalAlphaFactorubSUN() */
+/* No dispatch for GlobalAlphaFactorusSUN() */
+/* No dispatch for GlobalAlphaFactoruiSUN() */
+/* No dispatch for ReplacementCodeuiSUN() */
+/* No dispatch for ReplacementCodeusSUN() */
+/* No dispatch for ReplacementCodeubSUN() */
+/* No dispatch for ReplacementCodeuivSUN() */
+/* No dispatch for ReplacementCodeusvSUN() */
+/* No dispatch for ReplacementCodeubvSUN() */
+/* No dispatch for ReplacementCodePointerSUN() */
+/* No dispatch for Color4ubVertex2fSUN() */
+/* No dispatch for Color4ubVertex2fvSUN() */
+/* No dispatch for Color4ubVertex3fSUN() */
+/* No dispatch for Color4ubVertex3fvSUN() */
+/* No dispatch for Color3fVertex3fSUN() */
+/* No dispatch for Color3fVertex3fvSUN() */
+/* No dispatch for Normal3fVertex3fSUN() */
+/* No dispatch for Normal3fVertex3fvSUN() */
+/* No dispatch for Color4fNormal3fVertex3fSUN() */
+/* No dispatch for Color4fNormal3fVertex3fvSUN() */
+/* No dispatch for TexCoord2fVertex3fSUN() */
+/* No dispatch for TexCoord2fVertex3fvSUN() */
+/* No dispatch for TexCoord4fVertex4fSUN() */
+/* No dispatch for TexCoord4fVertex4fvSUN() */
+/* No dispatch for TexCoord2fColor4ubVertex3fSUN() */
+/* No dispatch for TexCoord2fColor4ubVertex3fvSUN() */
+/* No dispatch for TexCoord2fColor3fVertex3fSUN() */
+/* No dispatch for TexCoord2fColor3fVertex3fvSUN() */
+/* No dispatch for TexCoord2fNormal3fVertex3fSUN() */
+/* No dispatch for TexCoord2fNormal3fVertex3fvSUN() */
+/* No dispatch for TexCoord2fColor4fNormal3fVertex3fSUN() */
+/* No dispatch for TexCoord2fColor4fNormal3fVertex3fvSUN() */
+/* No dispatch for TexCoord4fColor4fNormal3fVertex4fSUN() */
+/* No dispatch for TexCoord4fColor4fNormal3fVertex4fvSUN() */
+/* No dispatch for ReplacementCodeuiVertex3fSUN() */
+/* No dispatch for ReplacementCodeuiVertex3fvSUN() */
+/* No dispatch for ReplacementCodeuiColor4ubVertex3fSUN() */
+/* No dispatch for ReplacementCodeuiColor4ubVertex3fvSUN() */
+/* No dispatch for ReplacementCodeuiColor3fVertex3fSUN() */
+/* No dispatch for ReplacementCodeuiColor3fVertex3fvSUN() */
+/* No dispatch for ReplacementCodeuiNormal3fVertex3fSUN() */
+/* No dispatch for ReplacementCodeuiNormal3fVertex3fvSUN() */
+/* No dispatch for ReplacementCodeuiColor4fNormal3fVertex3fSUN() */
+/* No dispatch for ReplacementCodeuiColor4fNormal3fVertex3fvSUN() */
+/* No dispatch for ReplacementCodeuiTexCoord2fVertex3fSUN() */
+/* No dispatch for ReplacementCodeuiTexCoord2fVertex3fvSUN() */
+/* No dispatch for ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN() */
+/* No dispatch for ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN() */
+/* No dispatch for ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN() */
+/* No dispatch for ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN() */
KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
{
- DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, ";"));
+ DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateEXT(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
}
KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateINGR)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
{
- DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, ";"));
+ DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateINGR(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexWeightfEXT)(GLfloat weight)
+{
+ DISPATCH(VertexWeightfEXT, (weight), (F, "glVertexWeightfEXT(%f);\n", weight));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexWeightfvEXT)(const GLfloat * weight)
+{
+ DISPATCH(VertexWeightfvEXT, (weight), (F, "glVertexWeightfvEXT(%p);\n", (void *) weight));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexWeightPointerEXT)(GLsizei size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(VertexWeightPointerEXT, (size, type, stride, pointer), (F, "glVertexWeightPointerEXT(%d, 0x%x, %d, %p);\n", size, type, stride, (void *) pointer));
}
-/* 190. GL_NV_vertex_array_range */
KEYWORD1 void KEYWORD2 NAME(FlushVertexArrayRangeNV)(void)
{
- DISPATCH(FlushVertexArrayRangeNV, (), (F, ";"));
+ DISPATCH(FlushVertexArrayRangeNV, (), (F, "glFlushVertexArrayRangeNV();\n"));
}
-KEYWORD1 void KEYWORD2 NAME(VertexArrayRangeNV)(GLsizei size, const GLvoid * pointer)
+KEYWORD1 void KEYWORD2 NAME(VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer)
{
- DISPATCH(VertexArrayRangeNV, (size, pointer), (F, ";"));
+ DISPATCH(VertexArrayRangeNV, (length, pointer), (F, "glVertexArrayRangeNV(%d, %p);\n", length, (void *) pointer));
}
-/* 191. GL_NV_register_combiners */
KEYWORD1 void KEYWORD2 NAME(CombinerParameterfvNV)(GLenum pname, const GLfloat * params)
{
- DISPATCH(CombinerParameterfvNV, (pname, params), (F, ";"));
+ DISPATCH(CombinerParameterfvNV, (pname, params), (F, "glCombinerParameterfvNV(0x%x, %p);\n", pname, (void *) params));
}
KEYWORD1 void KEYWORD2 NAME(CombinerParameterfNV)(GLenum pname, GLfloat param)
{
- DISPATCH(CombinerParameterfNV, (pname, param), (F, ";"));
+ DISPATCH(CombinerParameterfNV, (pname, param), (F, "glCombinerParameterfNV(0x%x, %f);\n", pname, param));
}
KEYWORD1 void KEYWORD2 NAME(CombinerParameterivNV)(GLenum pname, const GLint * params)
{
- DISPATCH(CombinerParameterivNV, (pname, params), (F, ";"));
+ DISPATCH(CombinerParameterivNV, (pname, params), (F, "glCombinerParameterivNV(0x%x, %p);\n", pname, (void *) params));
}
KEYWORD1 void KEYWORD2 NAME(CombinerParameteriNV)(GLenum pname, GLint param)
{
- DISPATCH(CombinerParameteriNV, (pname, param), (F, ";"));
+ DISPATCH(CombinerParameteriNV, (pname, param), (F, "glCombinerParameteriNV(0x%x, %d);\n", pname, param));
}
KEYWORD1 void KEYWORD2 NAME(CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage)
{
- DISPATCH(CombinerInputNV, (stage, portion, variable, input, mapping, componentUsage), (F, ";"));
+ DISPATCH(CombinerInputNV, (stage, portion, variable, input, mapping, componentUsage), (F, "glCombinerInputNV(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x);\n", stage, portion, variable, input, mapping, componentUsage));
}
KEYWORD1 void KEYWORD2 NAME(CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum)
{
- DISPATCH(CombinerOutputNV, (stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum), (F, ";"));
+ DISPATCH(CombinerOutputNV, (stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum), (F, "glCombinerOutputNV(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, %d, %d, %d);\n", stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum));
}
KEYWORD1 void KEYWORD2 NAME(FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage)
{
- DISPATCH(FinalCombinerInputNV, (variable, input, mapping, componentUsage), (F, ";"));
+ DISPATCH(FinalCombinerInputNV, (variable, input, mapping, componentUsage), (F, "glFinalCombinerInputNV(0x%x, 0x%x, 0x%x, 0x%x);\n", variable, input, mapping, componentUsage));
}
KEYWORD1 void KEYWORD2 NAME(GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params)
{
- DISPATCH(GetCombinerInputParameterfvNV, (stage, portion, variable, pname, params), (F, ";"));
+ DISPATCH(GetCombinerInputParameterfvNV, (stage, portion, variable, pname, params), (F, "glGetCombinerInputParameterfvNV(0x%x, 0x%x, 0x%x, 0x%x, %p);\n", stage, portion, variable, pname, (void *) params));
}
KEYWORD1 void KEYWORD2 NAME(GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params)
{
- DISPATCH(GetCombinerInputParameterivNV, (stage, portion, variable, pname, params), (F, ";"));
+ DISPATCH(GetCombinerInputParameterivNV, (stage, portion, variable, pname, params), (F, "glGetCombinerInputParameterivNV(0x%x, 0x%x, 0x%x, 0x%x, %p);\n", stage, portion, variable, pname, (void *) params));
}
KEYWORD1 void KEYWORD2 NAME(GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params)
{
- DISPATCH(GetCombinerOutputParameterfvNV, (stage, portion, pname, params), (F, ";"));
+ DISPATCH(GetCombinerOutputParameterfvNV, (stage, portion, pname, params), (F, "glGetCombinerOutputParameterfvNV(0x%x, 0x%x, 0x%x, %p);\n", stage, portion, pname, (void *) params));
}
KEYWORD1 void KEYWORD2 NAME(GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params)
{
- DISPATCH(GetCombinerOutputParameterivNV, (stage, portion, pname, params), (F, ";"));
+ DISPATCH(GetCombinerOutputParameterivNV, (stage, portion, pname, params), (F, "glGetCombinerOutputParameterivNV(0x%x, 0x%x, 0x%x, %p);\n", stage, portion, pname, (void *) params));
}
KEYWORD1 void KEYWORD2 NAME(GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params)
{
-DISPATCH(GetFinalCombinerInputParameterfvNV, (variable, pname, params), (F, ";"));
+ DISPATCH(GetFinalCombinerInputParameterfvNV, (variable, pname, params), (F, "glGetFinalCombinerInputParameterfvNV(0x%x, 0x%x, %p);\n", variable, pname, (void *) params));
}
KEYWORD1 void KEYWORD2 NAME(GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params)
{
-DISPATCH(GetFinalCombinerInputParameterivNV, (variable, pname, params), (F, ";"));
+ DISPATCH(GetFinalCombinerInputParameterivNV, (variable, pname, params), (F, "glGetFinalCombinerInputParameterivNV(0x%x, 0x%x, %p);\n", variable, pname, (void *) params));
}
-/* 194. GL_EXT_vertex_weighting */
-KEYWORD1 void KEYWORD2 NAME(VertexWeightfEXT)(GLfloat weight)
+KEYWORD1 void KEYWORD2 NAME(ResizeBuffersMESA)(void)
{
- DISPATCH(VertexWeightfEXT, (weight), (F, ";"));
+ DISPATCH(ResizeBuffersMESA, (), (F, "glResizeBuffersMESA();\n"));
}
-KEYWORD1 void KEYWORD2 NAME(VertexWeightfvEXT)(const GLfloat * weight)
+KEYWORD1 void KEYWORD2 NAME(WindowPos2dMESA)(GLdouble x, GLdouble y)
{
- DISPATCH(VertexWeightfvEXT, (weight), (F, ";"));
+ DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2dMESA(%f, %f);\n", x, y));
}
-KEYWORD1 void KEYWORD2 NAME(VertexWeightPointerEXT)(GLsizei size, GLenum type, GLsizei stride, const GLvoid * pointer)
+KEYWORD1 void KEYWORD2 NAME(WindowPos2dvMESA)(const GLdouble * v)
{
- DISPATCH(VertexWeightPointerEXT, (size, type, stride, pointer), (F, ";"));
+ DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dvMESA(%p /* %g, %g */);\n", (void *) v, v[0], v[1]));
}
-/* 196. GL_MESA_resize_buffers */
-KEYWORD1 void KEYWORD2 NAME(ResizeBuffersMESA)(void)
+KEYWORD1 void KEYWORD2 NAME(WindowPos2fMESA)(GLfloat x, GLfloat y)
{
- DISPATCH(ResizeBuffersMESA, (), (F, "glResizeBuffersMESA();"));
+ DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2fMESA(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2fvMESA)(const GLfloat * v)
+{
+ DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fvMESA(%p /* %g, %g */);\n", (void *) v, v[0], v[1]));
}
-/* 197. GL_MESA_window_pos */
KEYWORD1 void KEYWORD2 NAME(WindowPos2iMESA)(GLint x, GLint y)
{
- DISPATCH(WindowPos2iMESA, (x, y), (F, ";"));
+ DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2iMESA(%d, %d);\n", x, y));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos2sMESA)(GLshort x, GLshort y)
+KEYWORD1 void KEYWORD2 NAME(WindowPos2ivMESA)(const GLint * v)
{
- DISPATCH(WindowPos2sMESA, (x, y), (F, ";"));
+ DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2ivMESA(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos2fMESA)(GLfloat x, GLfloat y)
+KEYWORD1 void KEYWORD2 NAME(WindowPos2sMESA)(GLshort x, GLshort y)
{
- DISPATCH(WindowPos2fMESA, (x, y), (F, ";"));
+ DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2sMESA(%d, %d);\n", x, y));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos2dMESA)(GLdouble x, GLdouble y)
+KEYWORD1 void KEYWORD2 NAME(WindowPos2svMESA)(const GLshort * v)
{
- DISPATCH(WindowPos2dMESA, (x, y), (F, ";"));
+ DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2svMESA(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos2ivMESA)(const GLint *p)
+KEYWORD1 void KEYWORD2 NAME(WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z)
{
- DISPATCH(WindowPos2ivMESA, (p), (F, ";"));
+ DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3dMESA(%f, %f, %f);\n", x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos2svMESA)(const GLshort *p)
+KEYWORD1 void KEYWORD2 NAME(WindowPos3dvMESA)(const GLdouble * v)
{
- DISPATCH(WindowPos2svMESA, (p), (F, ";"));
+ DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dvMESA(%p /* %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos2fvMESA)(const GLfloat *p)
+KEYWORD1 void KEYWORD2 NAME(WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z)
{
- DISPATCH(WindowPos2fvMESA, (p), (F, ";"));
+ DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3fMESA(%f, %f, %f);\n", x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos2dvMESA)(const GLdouble *p)
+KEYWORD1 void KEYWORD2 NAME(WindowPos3fvMESA)(const GLfloat * v)
{
- DISPATCH(WindowPos2dvMESA, (p), (F, ";"));
+ DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fvMESA(%p /* %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2]));
}
KEYWORD1 void KEYWORD2 NAME(WindowPos3iMESA)(GLint x, GLint y, GLint z)
{
- DISPATCH(WindowPos3iMESA, (x, y, z), (F, ";"));
+ DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3iMESA(%d, %d, %d);\n", x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos3sMESA)(GLshort x, GLshort y, GLshort z)
+KEYWORD1 void KEYWORD2 NAME(WindowPos3ivMESA)(const GLint * v)
{
- DISPATCH(WindowPos3sMESA, (x, y, z), (F, ";"));
+ DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3ivMESA(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z)
+KEYWORD1 void KEYWORD2 NAME(WindowPos3sMESA)(GLshort x, GLshort y, GLshort z)
{
- DISPATCH(WindowPos3fMESA, (x, y, z), (F, ";"));
+ DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3sMESA(%d, %d, %d);\n", x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z)
+KEYWORD1 void KEYWORD2 NAME(WindowPos3svMESA)(const GLshort * v)
{
- DISPATCH(WindowPos3dMESA, (x, y, z), (F, ";"));
+ DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3svMESA(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos3ivMESA)(const GLint *p)
+KEYWORD1 void KEYWORD2 NAME(WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
- DISPATCH(WindowPos3ivMESA, (p), (F, ";"));
+ DISPATCH(WindowPos4dMESA, (x, y, z, w), (F, "glWindowPos4dMESA(%f, %f, %f, %f);\n", x, y, z, w));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos3svMESA)(const GLshort *p)
+KEYWORD1 void KEYWORD2 NAME(WindowPos4dvMESA)(const GLdouble * v)
{
- DISPATCH(WindowPos3svMESA, (p), (F, ";"));
+ DISPATCH(WindowPos4dvMESA, (v), (F, "glWindowPos4dvMESA(%p /* %g, %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2], v[3]));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos3fvMESA)(const GLfloat *p)
+KEYWORD1 void KEYWORD2 NAME(WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
- DISPATCH(WindowPos3fvMESA, (p), (F, ";"));
+ DISPATCH(WindowPos4fMESA, (x, y, z, w), (F, "glWindowPos4fMESA(%f, %f, %f, %f);\n", x, y, z, w));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos3dvMESA)(const GLdouble *p)
+KEYWORD1 void KEYWORD2 NAME(WindowPos4fvMESA)(const GLfloat * v)
{
- DISPATCH(WindowPos3dvMESA, (p), (F, ";"));
+ DISPATCH(WindowPos4fvMESA, (v), (F, "glWindowPos4fvMESA(%p /* %g, %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2], v[3]));
}
KEYWORD1 void KEYWORD2 NAME(WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w)
{
- DISPATCH(WindowPos4iMESA, (x, y, z, w), (F, ";"));
+ DISPATCH(WindowPos4iMESA, (x, y, z, w), (F, "glWindowPos4iMESA(%d, %d, %d, %d);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4ivMESA)(const GLint * v)
+{
+ DISPATCH(WindowPos4ivMESA, (v), (F, "glWindowPos4ivMESA(%p);\n", (void *) v));
}
KEYWORD1 void KEYWORD2 NAME(WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w)
{
- DISPATCH(WindowPos4sMESA, (x, y, z, w), (F, ";"));
+ DISPATCH(WindowPos4sMESA, (x, y, z, w), (F, "glWindowPos4sMESA(%d, %d, %d, %d);\n", x, y, z, w));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+KEYWORD1 void KEYWORD2 NAME(WindowPos4svMESA)(const GLshort * v)
{
- DISPATCH(WindowPos4fMESA, (x, y, z, w), (F, ";"));
+ DISPATCH(WindowPos4svMESA, (v), (F, "glWindowPos4svMESA(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+/* No dispatch for MultiModeDrawArraysIBM() */
+/* No dispatch for MultiModeDrawElementsIBM() */
+/* No dispatch for ColorPointerListIBM() */
+/* No dispatch for SecondaryColorPointerListIBM() */
+/* No dispatch for EdgeFlagPointerListIBM() */
+/* No dispatch for FogCoordPointerListIBM() */
+/* No dispatch for IndexPointerListIBM() */
+/* No dispatch for NormalPointerListIBM() */
+/* No dispatch for TexCoordPointerListIBM() */
+/* No dispatch for VertexPointerListIBM() */
+KEYWORD1 void KEYWORD2 NAME(TbufferMask3DFX)(GLuint mask)
{
- DISPATCH(WindowPos4dMESA, (x, y, z, w), (F, ";"));
+ DISPATCH(TbufferMask3DFX, (mask), (F, "glTbufferMask3DFX(%d);\n", mask));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos4ivMESA)(const GLint *p)
+KEYWORD1 void KEYWORD2 NAME(SampleMaskEXT)(GLclampf value, GLboolean invert)
{
- DISPATCH(WindowPos4ivMESA, (p), (F, ";"));
+ DISPATCH(SampleMaskSGIS, (value, invert), (F, "glSampleMaskEXT(%f, %d);\n", value, invert));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos4svMESA)(const GLshort *p)
+KEYWORD1 void KEYWORD2 NAME(SamplePatternEXT)(GLenum pattern)
{
- DISPATCH(WindowPos4svMESA, (p), (F, ";"));
+ DISPATCH(SamplePatternSGIS, (pattern), (F, "glSamplePatternEXT(0x%x);\n", pattern));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos4fvMESA)(const GLfloat *p)
+/* No dispatch for TextureColorMaskSGIS() */
+/* No dispatch for IglooInterfaceSGIX() */
+KEYWORD1 void KEYWORD2 NAME(DeleteFencesNV)(GLsizei n, const GLuint * fences)
{
- DISPATCH(WindowPos4fvMESA, (p), (F, ";"));
+ DISPATCH(DeleteFencesNV, (n, fences), (F, "glDeleteFencesNV(%d, %p);\n", n, (void *) fences));
}
-KEYWORD1 void KEYWORD2 NAME(WindowPos4dvMESA)(const GLdouble *p)
+KEYWORD1 void KEYWORD2 NAME(GenFencesNV)(GLsizei n, GLuint * fences)
{
- DISPATCH(WindowPos4dvMESA, (p), (F, ";"));
+ DISPATCH(GenFencesNV, (n, fences), (F, "glGenFencesNV(%d, %p);\n", n, (void *) fences));
}
-/* 208. GL_3DFX_tbuffer */
-KEYWORD1 void KEYWORD2 NAME(TbufferMask3DFX)(GLuint mask)
+KEYWORD1 GLboolean KEYWORD2 NAME(IsFenceNV)(GLuint fence)
{
- DISPATCH(TbufferMask3DFX, (mask), (F, "glTbufferMask3DFX(0x%x);", mask));
+ RETURN_DISPATCH(IsFenceNV, (fence), (F, "glIsFenceNV(%d);\n", fence));
}
-/* 209. WGL_EXT_multisample */
+KEYWORD1 GLboolean KEYWORD2 NAME(TestFenceNV)(GLuint fence)
+{
+ RETURN_DISPATCH(TestFenceNV, (fence), (F, "glTestFenceNV(%d);\n", fence));
+}
-KEYWORD1 void KEYWORD2 NAME(SampleMaskEXT)(GLclampf value, GLboolean invert)
+KEYWORD1 void KEYWORD2 NAME(GetFenceivNV)(GLuint fence, GLenum pname, GLint * params)
{
- DISPATCH(SampleMaskSGIS, (value, invert), (F, ";"));
+ DISPATCH(GetFenceivNV, (fence, pname, params), (F, "glGetFenceivNV(%d, 0x%x, %p);\n", fence, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(SamplePatternEXT)(GLenum pattern)
+KEYWORD1 void KEYWORD2 NAME(FinishFenceNV)(GLuint fence)
{
- DISPATCH(SamplePatternSGIS, (pattern), (F, ";"));
+ DISPATCH(FinishFenceNV, (fence), (F, "glFinishFenceNV(%d);\n", fence));
}
-/* ARB 1. GL_ARB_multitexture */
+KEYWORD1 void KEYWORD2 NAME(SetFenceNV)(GLuint fence, GLenum condition)
+{
+ DISPATCH(SetFenceNV, (fence, condition), (F, "glSetFenceNV(%d, 0x%x);\n", fence, condition));
+}
-KEYWORD1 void KEYWORD2 NAME(ActiveTextureARB)(GLenum texture)
+/* No dispatch for MapControlPointsNV() */
+/* No dispatch for MapParameterivNV() */
+/* No dispatch for MapParameterfvNV() */
+/* No dispatch for GetMapControlPointsNV() */
+/* No dispatch for GetMapParameterivNV() */
+/* No dispatch for GetMapParameterfvNV() */
+/* No dispatch for GetMapAttribParameterivNV() */
+/* No dispatch for GetMapAttribParameterfvNV() */
+/* No dispatch for EvalMapsNV() */
+/* No dispatch for CombinerStageParameterfvNV() */
+/* No dispatch for GetCombinerStageParameterfvNV() */
+KEYWORD1 void KEYWORD2 NAME(WindowPos2dARB)(GLdouble x, GLdouble y)
{
- DISPATCH(ActiveTextureARB, (texture), (F, ";"));
+ DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2dARB(%f, %f);\n", x, y));
}
-KEYWORD1 void KEYWORD2 NAME(ClientActiveTextureARB)(GLenum texture)
+KEYWORD1 void KEYWORD2 NAME(WindowPos2fARB)(GLfloat x, GLfloat y)
{
- DISPATCH(ClientActiveTextureARB, (texture), (F, ";"));
+ DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2fARB(%f, %f);\n", x, y));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dARB)(GLenum target, GLdouble s)
+KEYWORD1 void KEYWORD2 NAME(WindowPos2iARB)(GLint x, GLint y)
{
- DISPATCH(MultiTexCoord1dARB, (target, s), (F, ";"));
+ DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2iARB(%d, %d);\n", x, y));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dvARB)(GLenum target, const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(WindowPos2sARB)(GLshort x, GLshort y)
{
- DISPATCH(MultiTexCoord1dvARB, (target, v), (F, ";"));
+ DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2sARB(%d, %d);\n", x, y));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fARB)(GLenum target, GLfloat s)
+KEYWORD1 void KEYWORD2 NAME(WindowPos2dvARB)(const GLdouble * p)
{
- DISPATCH(MultiTexCoord1fARB, (target, s), (F, ";"));
+ DISPATCH(WindowPos2dvMESA, (p), (F, "glWindowPos2dvARB(%p /* %g, %g */);\n", (void *) p, p[0], p[1]));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fvARB)(GLenum target, const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(WindowPos2fvARB)(const GLfloat * p)
{
- DISPATCH(MultiTexCoord1fvARB, (target, v), (F, ";"));
+ DISPATCH(WindowPos2fvMESA, (p), (F, "glWindowPos2fvARB(%p /* %g, %g */);\n", (void *) p, p[0], p[1]));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1iARB)(GLenum target, GLint s)
+KEYWORD1 void KEYWORD2 NAME(WindowPos2ivARB)(const GLint * p)
{
- DISPATCH(MultiTexCoord1iARB, (target, s), (F, ";"));
+ DISPATCH(WindowPos2ivMESA, (p), (F, "glWindowPos2ivARB(%p);\n", (void *) p));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1ivARB)(GLenum target, const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(WindowPos2svARB)(const GLshort * p)
{
- DISPATCH(MultiTexCoord1ivARB, (target, v), (F, ";"));
+ DISPATCH(WindowPos2svMESA, (p), (F, "glWindowPos2svARB(%p);\n", (void *) p));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1sARB)(GLenum target, GLshort s)
+KEYWORD1 void KEYWORD2 NAME(WindowPos3dARB)(GLdouble x, GLdouble y, GLdouble z)
{
- DISPATCH(MultiTexCoord1sARB, (target, s), (F, ";"));
+ DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3dARB(%f, %f, %f);\n", x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1svARB)(GLenum target, const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(WindowPos3fARB)(GLfloat x, GLfloat y, GLfloat z)
{
- DISPATCH(MultiTexCoord1svARB, (target, v), (F, ";"));
+ DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3fARB(%f, %f, %f);\n", x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t)
+KEYWORD1 void KEYWORD2 NAME(WindowPos3iARB)(GLint x, GLint y, GLint z)
{
- DISPATCH(MultiTexCoord2dARB, (target, s, t), (F, ";"));
+ DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3iARB(%d, %d, %d);\n", x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dvARB)(GLenum target, const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(WindowPos3sARB)(GLshort x, GLshort y, GLshort z)
{
- DISPATCH(MultiTexCoord2dvARB, (target, v), (F, ";"));
+ DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3sARB(%d, %d, %d);\n", x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t)
+KEYWORD1 void KEYWORD2 NAME(WindowPos3dvARB)(const GLdouble * p)
{
- DISPATCH(MultiTexCoord2fARB, (target, s, t), (F, ";"));
+ DISPATCH(WindowPos3dvMESA, (p), (F, "glWindowPos3dvARB(%p /* %g, %g, %g */);\n", (void *) p, p[0], p[1], p[2]));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fvARB)(GLenum target, const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(WindowPos3fvARB)(const GLfloat * p)
{
- DISPATCH(MultiTexCoord2fvARB, (target, v), (F, ";"));
+ DISPATCH(WindowPos3fvMESA, (p), (F, "glWindowPos3fvARB(%p /* %g, %g, %g */);\n", (void *) p, p[0], p[1], p[2]));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2iARB)(GLenum target, GLint s, GLint t)
+KEYWORD1 void KEYWORD2 NAME(WindowPos3ivARB)(const GLint * p)
{
- DISPATCH(MultiTexCoord2iARB, (target, s, t), (F, ";"));
+ DISPATCH(WindowPos3ivMESA, (p), (F, "glWindowPos3ivARB(%p);\n", (void *) p));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2ivARB)(GLenum target, const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(WindowPos3svARB)(const GLshort * p)
{
- DISPATCH(MultiTexCoord2ivARB, (target, v), (F, ";"));
+ DISPATCH(WindowPos3svMESA, (p), (F, "glWindowPos3svARB(%p);\n", (void *) p));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t)
+KEYWORD1 GLboolean KEYWORD2 NAME(AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences)
{
- DISPATCH(MultiTexCoord2sARB, (target, s, t), (F, ";"));
+ RETURN_DISPATCH(AreProgramsResidentNV, (n, ids, residences), (F, "glAreProgramsResidentNV(%d, %p, %p);\n", n, (void *) ids, (void *) residences));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2svARB)(GLenum target, const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(BindProgramNV)(GLenum target, GLuint id)
{
- DISPATCH(MultiTexCoord2svARB, (target, v), (F, ";"));
+ DISPATCH(BindProgramNV, (target, id), (F, "glBindProgramNV(0x%x, %d);\n", target, id));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r)
+KEYWORD1 void KEYWORD2 NAME(DeleteProgramsNV)(GLsizei n, const GLuint * ids)
{
- DISPATCH(MultiTexCoord3dARB, (target, s, t, r), (F, ";"));
+ DISPATCH(DeleteProgramsNV, (n, ids), (F, "glDeleteProgramsNV(%d, %p);\n", n, (void *) ids));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dvARB)(GLenum target, const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params)
{
- DISPATCH(MultiTexCoord3dvARB, (target, v), (F, ";"));
+ DISPATCH(ExecuteProgramNV, (target, id, params), (F, "glExecuteProgramNV(0x%x, %d, %p);\n", target, id, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r)
+KEYWORD1 void KEYWORD2 NAME(GenProgramsNV)(GLsizei n, GLuint * ids)
{
- DISPATCH(MultiTexCoord3fARB, (target, s, t, r), (F, ";"));
+ DISPATCH(GenProgramsNV, (n, ids), (F, "glGenProgramsNV(%d, %p);\n", n, (void *) ids));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fvARB)(GLenum target, const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params)
{
- DISPATCH(MultiTexCoord3fvARB, (target, v), (F, ";"));
+ DISPATCH(GetProgramParameterdvNV, (target, index, pname, params), (F, "glGetProgramParameterdvNV(0x%x, %d, 0x%x, %p);\n", target, index, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r)
+KEYWORD1 void KEYWORD2 NAME(GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params)
{
- DISPATCH(MultiTexCoord3iARB, (target, s, t, r), (F, ";"));
+ DISPATCH(GetProgramParameterfvNV, (target, index, pname, params), (F, "glGetProgramParameterfvNV(0x%x, %d, 0x%x, %p);\n", target, index, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3ivARB)(GLenum target, const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(GetProgramivNV)(GLuint id, GLenum pname, GLint * params)
{
- DISPATCH(MultiTexCoord3ivARB, (target, v), (F, ";"));
+ DISPATCH(GetProgramivNV, (id, pname, params), (F, "glGetProgramivNV(%d, 0x%x, %p);\n", id, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r)
+KEYWORD1 void KEYWORD2 NAME(GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program)
{
- DISPATCH(MultiTexCoord3sARB, (target, s, t, r), (F, ";"));
+ DISPATCH(GetProgramStringNV, (id, pname, program), (F, "glGetProgramStringNV(%d, 0x%x, %p);\n", id, pname, (void *) program));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3svARB)(GLenum target, const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params)
{
- DISPATCH(MultiTexCoord3svARB, (target, v), (F, ";"));
+ DISPATCH(GetTrackMatrixivNV, (target, address, pname, params), (F, "glGetTrackMatrixivNV(0x%x, %d, 0x%x, %p);\n", target, address, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params)
{
- DISPATCH(MultiTexCoord4dARB, (target, s, t, r, q), (F, ";"));
+ DISPATCH(GetVertexAttribdvNV, (index, pname, params), (F, "glGetVertexAttribdvNV(%d, 0x%x, %p);\n", index, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dvARB)(GLenum target, const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params)
{
- DISPATCH(MultiTexCoord4dvARB, (target, v), (F, ";"));
+ DISPATCH(GetVertexAttribfvNV, (index, pname, params), (F, "glGetVertexAttribfvNV(%d, 0x%x, %p);\n", index, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params)
{
- DISPATCH(MultiTexCoord4fARB, (target, s, t, r, q), (F, ";"));
+ DISPATCH(GetVertexAttribivNV, (index, pname, params), (F, "glGetVertexAttribivNV(%d, 0x%x, %p);\n", index, pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fvARB)(GLenum target, const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer)
{
- DISPATCH(MultiTexCoord4fvARB, (target, v), (F, ";"));
+ DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointervNV(%d, 0x%x, %p);\n", index, pname, (void *) pointer));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q)
+KEYWORD1 GLboolean KEYWORD2 NAME(IsProgramNV)(GLuint id)
{
- DISPATCH(MultiTexCoord4iARB, (target, s, t, r, q), (F, ";"));
+ RETURN_DISPATCH(IsProgramNV, (id), (F, "glIsProgramNV(%d);\n", id));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4ivARB)(GLenum target, const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program)
{
- DISPATCH(MultiTexCoord4ivARB, (target, v), (F, ";"));
+ DISPATCH(LoadProgramNV, (target, id, len, program), (F, "glLoadProgramNV(0x%x, %d, %d, %p);\n", target, id, len, (void *) program));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
+KEYWORD1 void KEYWORD2 NAME(ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
- DISPATCH(MultiTexCoord4sARB, (target, s, t, r, q), (F, ";"));
+ DISPATCH(ProgramParameter4dNV, (target, index, x, y, z, w), (F, "glProgramParameter4dNV(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4svARB)(GLenum target, const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params)
{
- DISPATCH(MultiTexCoord4svARB, (target, v), (F, ";"));
+ DISPATCH(ProgramParameter4dvNV, (target, index, params), (F, "glProgramParameter4dvNV(0x%x, %d, %p /* %g, %g, %g, %g */);\n", target, index, (void *) params, params[0], params[1], params[2], params[3]));
}
+KEYWORD1 void KEYWORD2 NAME(ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(ProgramParameter4fNV, (target, index, x, y, z, w), (F, "glProgramParameter4fNV(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
+}
-/* ARB 3. GL_ARB_transpose_matrix */
-KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixdARB)(const GLdouble m[16])
+KEYWORD1 void KEYWORD2 NAME(ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params)
{
- DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixARB(%p);", (void *) m));
+ DISPATCH(ProgramParameter4fvNV, (target, index, params), (F, "glProgramParameter4fvNV(0x%x, %d, %p /* %g, %g, %g, %g */);\n", target, index, (void *) params, params[0], params[1], params[2], params[3]));
}
-KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixfARB)(const GLfloat m[16])
+KEYWORD1 void KEYWORD2 NAME(ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params)
{
- DISPATCH(LoadTransposeMatrixfARB, (m), (F, "glLoadTransposeMatrixfARB(%p)", (void *) m));
+ DISPATCH(ProgramParameters4dvNV, (target, index, num, params), (F, "glProgramParameters4dvNV(0x%x, %d, %d, %p /* %g, %g, %g, %g */);\n", target, index, num, (void *) params, params[0], params[1], params[2], params[3]));
}
-KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixdARB)(const GLdouble m[16])
+KEYWORD1 void KEYWORD2 NAME(ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params)
{
- DISPATCH(MultTransposeMatrixdARB, (m), (F, "glMultTransposeMatrixfARB(%p)", (void *) m));
+ DISPATCH(ProgramParameters4fvNV, (target, index, num, params), (F, "glProgramParameters4fvNV(0x%x, %d, %d, %p /* %g, %g, %g, %g */);\n", target, index, num, (void *) params, params[0], params[1], params[2], params[3]));
}
-KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixfARB)(const GLfloat m[16])
+KEYWORD1 void KEYWORD2 NAME(RequestResidentProgramsNV)(GLsizei n, const GLuint * ids)
{
- DISPATCH(MultTransposeMatrixfARB, (m), (F, "glLoadTransposeMatrixfARB(%p)", (void *) m));
+ DISPATCH(RequestResidentProgramsNV, (n, ids), (F, "glRequestResidentProgramsNV(%d, %p);\n", n, (void *) ids));
}
-/* ARB 5. GL_ARB_multisample */
-KEYWORD1 void KEYWORD2 NAME(SampleCoverageARB)(GLclampf value, GLboolean invert)
+KEYWORD1 void KEYWORD2 NAME(TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform)
{
- DISPATCH(SampleCoverageARB, (value, invert), (F, "glSampleCoverageARB(%f, %d);", value, invert));
+ DISPATCH(TrackMatrixNV, (target, address, matrix, transform), (F, "glTrackMatrixNV(0x%x, %d, 0x%x, 0x%x);\n", target, address, matrix, transform));
}
-/*
-KEYWORD1 void KEYWORD2 NAME(SamplePassARB)(GLenum pass)
+KEYWORD1 void KEYWORD2 NAME(VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
{
- DISPATCH(SamplePassARB, (pass), (F, "glSamplePassARB(0x%x);", pass));
+ DISPATCH(VertexAttribPointerNV, (index, size, type, stride, pointer), (F, "glVertexAttribPointerNV(%d, %d, 0x%x, %d, %p);\n", index, size, type, stride, (void *) pointer));
}
-*/
-/* ARB 12. GL_ARB_texture_compression */
-KEYWORD1 void KEYWORD2 NAME(CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dNV)(GLuint index, GLdouble x)
{
- DISPATCH(CompressedTexImage1DARB, (target, level, internalformat, width, border, imageSize, data), (F, "glCompressedTexImage1DARB();"));
+ DISPATCH(VertexAttrib1dNV, (index, x), (F, "glVertexAttrib1dNV(%d, %f);\n", index, x));
}
-KEYWORD1 void KEYWORD2 NAME(CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dvNV)(GLuint index, const GLdouble * v)
{
- DISPATCH(CompressedTexImage2DARB, (target, level, internalformat, width, height, border, imageSize, data), (F, "glCompressedTexImage2DARB();"));
+ DISPATCH(VertexAttrib1dvNV, (index, v), (F, "glVertexAttrib1dvNV(%d, %p);\n", index, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fNV)(GLuint index, GLfloat x)
{
- DISPATCH(CompressedTexImage3DARB, (target, level, internalformat, width, height, depth, border, imageSize, data), (F, "glCompressedTexImage3DARB();"));
+ DISPATCH(VertexAttrib1fNV, (index, x), (F, "glVertexAttrib1fNV(%d, %f);\n", index, x));
}
-KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fvNV)(GLuint index, const GLfloat * v)
{
- DISPATCH(CompressedTexSubImage1DARB, (target, level, xoffset, width, format, imageSize, data), (F, "glCompressedTexSubImage1DARB();"));
+ DISPATCH(VertexAttrib1fvNV, (index, v), (F, "glVertexAttrib1fvNV(%d, %p);\n", index, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sNV)(GLuint index, GLshort x)
{
- DISPATCH(CompressedTexSubImage2DARB, (target, level, xoffset, yoffset, width, height, format, imageSize, data), (F, "glCompressedTexSubImage2DARB();"));
+ DISPATCH(VertexAttrib1sNV, (index, x), (F, "glVertexAttrib1sNV(%d, %d);\n", index, x));
}
-KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1svNV)(GLuint index, const GLshort * v)
{
- DISPATCH(CompressedTexSubImage3DARB, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), (F, "glCompressedTexSubImage3DARB();"));
+ DISPATCH(VertexAttrib1svNV, (index, v), (F, "glVertexAttrib1svNV(%d, %p);\n", index, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImageARB)(GLenum target, GLint lod, GLvoid *img)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y)
{
- DISPATCH(GetCompressedTexImageARB, (target, lod, img), (F, "glGetCompressedTexImageARB();"));
+ DISPATCH(VertexAttrib2dNV, (index, x, y), (F, "glVertexAttrib2dNV(%d, %f, %f);\n", index, x, y));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dvNV)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib2dvNV, (index, v), (F, "glVertexAttrib2dvNV(%d, %p /* %g, %g */);\n", index, (void *) v, v[0], v[1]));
+}
-/* GL 1.3 */
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y)
+{
+ DISPATCH(VertexAttrib2fNV, (index, x, y), (F, "glVertexAttrib2fNV(%d, %f, %f);\n", index, x, y));
+}
-KEYWORD1 void KEYWORD2 NAME(ActiveTexture)(GLenum texture)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fvNV)(GLuint index, const GLfloat * v)
{
- DISPATCH(ActiveTextureARB, (texture), (F, ";"));
+ DISPATCH(VertexAttrib2fvNV, (index, v), (F, "glVertexAttrib2fvNV(%d, %p /* %g, %g */);\n", index, (void *) v, v[0], v[1]));
}
-KEYWORD1 void KEYWORD2 NAME(ClientActiveTexture)(GLenum texture)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y)
{
- DISPATCH(ClientActiveTextureARB, (texture), (F, ";"));
+ DISPATCH(VertexAttrib2sNV, (index, x, y), (F, "glVertexAttrib2sNV(%d, %d, %d);\n", index, x, y));
}
-KEYWORD1 void KEYWORD2 NAME(CompressedTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2svNV)(GLuint index, const GLshort * v)
{
- DISPATCH(CompressedTexImage1DARB, (target, level, internalformat, width, border, imageSize, data), (F, "glCompressedTexImage1DARB();"));
+ DISPATCH(VertexAttrib2svNV, (index, v), (F, "glVertexAttrib2svNV(%d, %p);\n", index, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(CompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
{
- DISPATCH(CompressedTexImage2DARB, (target, level, internalformat, width, height, border, imageSize, data), (F, "glCompressedTexImage2DARB();"));
+ DISPATCH(VertexAttrib3dNV, (index, x, y, z), (F, "glVertexAttrib3dNV(%d, %f, %f, %f);\n", index, x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(CompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dvNV)(GLuint index, const GLdouble * v)
{
- DISPATCH(CompressedTexImage3DARB, (target, level, internalformat, width, height, depth, border, imageSize, data), (F, "glCompressedTexImage3DARB();"));
+ DISPATCH(VertexAttrib3dvNV, (index, v), (F, "glVertexAttrib3dvNV(%d, %p /* %g, %g, %g */);\n", index, (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
{
- DISPATCH(CompressedTexSubImage1DARB, (target, level, xoffset, width, format, imageSize, data), (F, "glCompressedTexSubImage1DARB();"));
+ DISPATCH(VertexAttrib3fNV, (index, x, y, z), (F, "glVertexAttrib3fNV(%d, %f, %f, %f);\n", index, x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fvNV)(GLuint index, const GLfloat * v)
{
- DISPATCH(CompressedTexSubImage2DARB, (target, level, xoffset, yoffset, width, height, format, imageSize, data), (F, "glCompressedTexSubImage2DARB();"));
+ DISPATCH(VertexAttrib3fvNV, (index, v), (F, "glVertexAttrib3fvNV(%d, %p /* %g, %g, %g */);\n", index, (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z)
{
- DISPATCH(CompressedTexSubImage3DARB, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), (F, "glCompressedTexSubImage3DARB();"));
+ DISPATCH(VertexAttrib3sNV, (index, x, y, z), (F, "glVertexAttrib3sNV(%d, %d, %d, %d);\n", index, x, y, z));
}
-KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImage)(GLenum target, GLint lod, GLvoid *img)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3svNV)(GLuint index, const GLshort * v)
{
- DISPATCH(GetCompressedTexImageARB, (target, lod, img), (F, "glGetCompressedTexImageARB();"));
+ DISPATCH(VertexAttrib3svNV, (index, v), (F, "glVertexAttrib3svNV(%d, %p);\n", index, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1d)(GLenum target, GLdouble s)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
- DISPATCH(MultiTexCoord1dARB, (target, s), (F, ";"));
+ DISPATCH(VertexAttrib4dNV, (index, x, y, z, w), (F, "glVertexAttrib4dNV(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dv)(GLenum target, const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dvNV)(GLuint index, const GLdouble * v)
{
- DISPATCH(MultiTexCoord1dvARB, (target, v), (F, ";"));
+ DISPATCH(VertexAttrib4dvNV, (index, v), (F, "glVertexAttrib4dvNV(%d, %p /* %g, %g, %g, %g */);\n", index, (void *) v, v[0], v[1], v[2], v[3]));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1f)(GLenum target, GLfloat s)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
- DISPATCH(MultiTexCoord1fARB, (target, s), (F, ";"));
+ DISPATCH(VertexAttrib4fNV, (index, x, y, z, w), (F, "glVertexAttrib4fNV(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fv)(GLenum target, const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fvNV)(GLuint index, const GLfloat * v)
{
- DISPATCH(MultiTexCoord1fvARB, (target, v), (F, ";"));
+ DISPATCH(VertexAttrib4fvNV, (index, v), (F, "glVertexAttrib4fvNV(%d, %p /* %g, %g, %g, %g */);\n", index, (void *) v, v[0], v[1], v[2], v[3]));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1i)(GLenum target, GLint s)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
{
- DISPATCH(MultiTexCoord1iARB, (target, s), (F, ";"));
+ DISPATCH(VertexAttrib4sNV, (index, x, y, z, w), (F, "glVertexAttrib4sNV(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1iv)(GLenum target, const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4svNV)(GLuint index, const GLshort * v)
{
- DISPATCH(MultiTexCoord1ivARB, (target, v), (F, ";"));
+ DISPATCH(VertexAttrib4svNV, (index, v), (F, "glVertexAttrib4svNV(%d, %p);\n", index, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1s)(GLenum target, GLshort s)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
{
- DISPATCH(MultiTexCoord1sARB, (target, s), (F, ";"));
+ DISPATCH(VertexAttrib4ubNV, (index, x, y, z, w), (F, "glVertexAttrib4ubNV(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1sv)(GLenum target, const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubvNV)(GLuint index, const GLubyte * v)
{
- DISPATCH(MultiTexCoord1svARB, (target, v), (F, ";"));
+ DISPATCH(VertexAttrib4ubvNV, (index, v), (F, "glVertexAttrib4ubvNV(%d, %p);\n", index, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2d)(GLenum target, GLdouble s, GLdouble t)
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v)
{
- DISPATCH(MultiTexCoord2dARB, (target, s, t), (F, ";"));
+ DISPATCH(VertexAttribs1dvNV, (index, n, v), (F, "glVertexAttribs1dvNV(%d, %d, %p);\n", index, n, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dv)(GLenum target, const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v)
{
- DISPATCH(MultiTexCoord2dvARB, (target, v), (F, ";"));
+ DISPATCH(VertexAttribs1fvNV, (index, n, v), (F, "glVertexAttribs1fvNV(%d, %d, %p);\n", index, n, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2f)(GLenum target, GLfloat s, GLfloat t)
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v)
{
- DISPATCH(MultiTexCoord2fARB, (target, s, t), (F, ";"));
+ DISPATCH(VertexAttribs1svNV, (index, n, v), (F, "glVertexAttribs1svNV(%d, %d, %p);\n", index, n, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fv)(GLenum target, const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v)
{
- DISPATCH(MultiTexCoord2fvARB, (target, v), (F, ";"));
+ DISPATCH(VertexAttribs2dvNV, (index, n, v), (F, "glVertexAttribs2dvNV(%d, %d, %p /* %g, %g */);\n", index, n, (void *) v, v[0], v[1]));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2i)(GLenum target, GLint s, GLint t)
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v)
{
- DISPATCH(MultiTexCoord2iARB, (target, s, t), (F, ";"));
+ DISPATCH(VertexAttribs2fvNV, (index, n, v), (F, "glVertexAttribs2fvNV(%d, %d, %p /* %g, %g */);\n", index, n, (void *) v, v[0], v[1]));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2iv)(GLenum target, const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v)
{
- DISPATCH(MultiTexCoord2ivARB, (target, v), (F, ";"));
+ DISPATCH(VertexAttribs2svNV, (index, n, v), (F, "glVertexAttribs2svNV(%d, %d, %p);\n", index, n, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2s)(GLenum target, GLshort s, GLshort t)
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v)
{
- DISPATCH(MultiTexCoord2sARB, (target, s, t), (F, ";"));
+ DISPATCH(VertexAttribs3dvNV, (index, n, v), (F, "glVertexAttribs3dvNV(%d, %d, %p /* %g, %g, %g */);\n", index, n, (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2sv)(GLenum target, const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v)
{
- DISPATCH(MultiTexCoord2svARB, (target, v), (F, ";"));
+ DISPATCH(VertexAttribs3fvNV, (index, n, v), (F, "glVertexAttribs3fvNV(%d, %d, %p /* %g, %g, %g */);\n", index, n, (void *) v, v[0], v[1], v[2]));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3d)(GLenum target, GLdouble s, GLdouble t, GLdouble r)
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v)
{
- DISPATCH(MultiTexCoord3dARB, (target, s, t, r), (F, ";"));
+ DISPATCH(VertexAttribs3svNV, (index, n, v), (F, "glVertexAttribs3svNV(%d, %d, %p);\n", index, n, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dv)(GLenum target, const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v)
{
- DISPATCH(MultiTexCoord3dvARB, (target, v), (F, ";"));
+ DISPATCH(VertexAttribs4dvNV, (index, n, v), (F, "glVertexAttribs4dvNV(%d, %d, %p /* %g, %g, %g, %g */);\n", index, n, (void *) v, v[0], v[1], v[2], v[3]));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3f)(GLenum target, GLfloat s, GLfloat t, GLfloat r)
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v)
{
- DISPATCH(MultiTexCoord3fARB, (target, s, t, r), (F, ";"));
+ DISPATCH(VertexAttribs4fvNV, (index, n, v), (F, "glVertexAttribs4fvNV(%d, %d, %p /* %g, %g, %g, %g */);\n", index, n, (void *) v, v[0], v[1], v[2], v[3]));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fv)(GLenum target, const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v)
{
- DISPATCH(MultiTexCoord3fvARB, (target, v), (F, ";"));
+ DISPATCH(VertexAttribs4svNV, (index, n, v), (F, "glVertexAttribs4svNV(%d, %d, %p);\n", index, n, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3i)(GLenum target, GLint s, GLint t, GLint r)
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v)
{
- DISPATCH(MultiTexCoord3iARB, (target, s, t, r), (F, ";"));
+ DISPATCH(VertexAttribs4ubvNV, (index, n, v), (F, "glVertexAttribs4ubvNV(%d, %d, %p);\n", index, n, (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3iv)(GLenum target, const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(PointParameteriNV)(GLenum pname, GLint params)
{
- DISPATCH(MultiTexCoord3ivARB, (target, v), (F, ";"));
+ DISPATCH(PointParameteriNV, (pname, params), (F, "glPointParameteriNV(0x%x, %d);\n", pname, params));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3s)(GLenum target, GLshort s, GLshort t, GLshort r)
+KEYWORD1 void KEYWORD2 NAME(PointParameterivNV)(GLenum pname, const GLint * params)
{
- DISPATCH(MultiTexCoord3sARB, (target, s, t, r), (F, ";"));
+ DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameterivNV(0x%x, %p);\n", pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3sv)(GLenum target, const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
{
- DISPATCH(MultiTexCoord3svARB, (target, v), (F, ";"));
+ DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparate(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4d)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+KEYWORD1 void KEYWORD2 NAME(FogCoordf)(GLfloat coord)
{
- DISPATCH(MultiTexCoord4dARB, (target, s, t, r, q), (F, ";"));
+ DISPATCH(FogCoordfEXT, (coord), (F, "glFogCoordf(%f);\n", coord));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dv)(GLenum target, const GLdouble *v)
+KEYWORD1 void KEYWORD2 NAME(FogCoordfv)(const GLfloat * coord)
{
- DISPATCH(MultiTexCoord4dvARB, (target, v), (F, ";"));
+ DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfv(%p);\n", (void *) coord));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+KEYWORD1 void KEYWORD2 NAME(FogCoordd)(GLdouble coord)
{
- DISPATCH(MultiTexCoord4fARB, (target, s, t, r, q), (F, ";"));
+ DISPATCH(FogCoorddEXT, (coord), (F, "glFogCoordd(%f);\n", coord));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fv)(GLenum target, const GLfloat *v)
+KEYWORD1 void KEYWORD2 NAME(FogCoorddv)(const GLdouble * coord)
{
- DISPATCH(MultiTexCoord4fvARB, (target, v), (F, ";"));
+ DISPATCH(FogCoorddvEXT, (coord), (F, "glFogCoorddv(%p);\n", (void *) coord));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4i)(GLenum target, GLint s, GLint t, GLint r, GLint q)
+KEYWORD1 void KEYWORD2 NAME(FogCoordPointer)(GLenum type, GLsizei stride, const GLvoid * pointer)
{
- DISPATCH(MultiTexCoord4iARB, (target, s, t, r, q), (F, ";"));
+ DISPATCH(FogCoordPointerEXT, (type, stride, pointer), (F, "glFogCoordPointer(0x%x, %d, %p);\n", type, stride, (void *) pointer));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4iv)(GLenum target, const GLint *v)
+KEYWORD1 void KEYWORD2 NAME(MultiDrawArrays)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount)
{
- DISPATCH(MultiTexCoord4ivARB, (target, v), (F, ";"));
+ DISPATCH(MultiDrawArraysEXT, (mode, first, count, primcount), (F, "glMultiDrawArrays(0x%x, %p, %p, %d);\n", mode, (void *) first, (void *) count, primcount));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4s)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
+KEYWORD1 void KEYWORD2 NAME(MultiDrawElements)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount)
{
- DISPATCH(MultiTexCoord4sARB, (target, s, t, r, q), (F, ";"));
+ DISPATCH(MultiDrawElementsEXT, (mode, count, type, indices, primcount), (F, "glMultiDrawElements(0x%x, %p, 0x%x, %p, %d);\n", mode, (void *) count, type, (void *) indices, primcount));
}
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4sv)(GLenum target, const GLshort *v)
+KEYWORD1 void KEYWORD2 NAME(PointParameterf)(GLenum pname, GLfloat param)
{
- DISPATCH(MultiTexCoord4svARB, (target, v), (F, ";"));
+ DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterf(0x%x, %f);\n", pname, param));
}
+KEYWORD1 void KEYWORD2 NAME(PointParameterfv)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfv(0x%x, %p);\n", pname, (void *) params));
+}
-KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixd)(const GLdouble m[16])
+KEYWORD1 void KEYWORD2 NAME(PointParameteri)(GLenum pname, GLint param)
{
- DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixARB(%p);", (void *) m));
+ DISPATCH(PointParameteriNV, (pname, param), (F, "glPointParameteri(0x%x, %d);\n", pname, param));
}
-KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixf)(const GLfloat m[16])
+KEYWORD1 void KEYWORD2 NAME(PointParameteriv)(GLenum pname, const GLint * params)
{
- DISPATCH(LoadTransposeMatrixfARB, (m), (F, "glLoadTransposeMatrixfARB(%p)", (void *) m));
+ DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameteriv(0x%x, %p);\n", pname, (void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixd)(const GLdouble m[16])
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3b)(GLbyte red, GLbyte green, GLbyte blue)
{
- DISPATCH(MultTransposeMatrixdARB, (m), (F, "glMultTransposeMatrixfARB(%p)", (void *) m));
+ DISPATCH(SecondaryColor3bEXT, (red, green, blue), (F, "glSecondaryColor3b(%d, %d, %d);\n", red, green, blue));
}
-KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixf)(const GLfloat m[16])
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bv)(const GLbyte * v)
{
- DISPATCH(MultTransposeMatrixfARB, (m), (F, "glLoadTransposeMatrixfARB(%p)", (void *) m));
+ DISPATCH(SecondaryColor3bvEXT, (v), (F, "glSecondaryColor3bv(%p);\n", (void *) v));
}
-KEYWORD1 void KEYWORD2 NAME(SampleCoverage)(GLclampf value, GLboolean invert)
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3d)(GLdouble red, GLdouble green, GLdouble blue)
{
- DISPATCH(SampleCoverageARB, (value, invert), (F, "glSampleCoverageARB(%f, %d);", value, invert));
+ DISPATCH(SecondaryColor3dEXT, (red, green, blue), (F, "glSecondaryColor3d(%f, %f, %f);\n", red, green, blue));
}
-/*
-KEYWORD1 void KEYWORD2 NAME(SamplePass)(GLenum pass)
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dv)(const GLdouble * v)
+{
+ DISPATCH(SecondaryColor3dvEXT, (v), (F, "glSecondaryColor3dv(%p /* %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2]));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3f)(GLfloat red, GLfloat green, GLfloat blue)
{
- DISPATCH(SamplePassARB, (pass), (F, "glSamplePassARB(0x%x);", pass));
+ DISPATCH(SecondaryColor3fEXT, (red, green, blue), (F, "glSecondaryColor3f(%f, %f, %f);\n", red, green, blue));
}
-*/
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fv)(const GLfloat * v)
+{
+ DISPATCH(SecondaryColor3fvEXT, (v), (F, "glSecondaryColor3fv(%p /* %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2]));
+}
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3i)(GLint red, GLint green, GLint blue)
+{
+ DISPATCH(SecondaryColor3iEXT, (red, green, blue), (F, "glSecondaryColor3i(%d, %d, %d);\n", red, green, blue));
+}
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3iv)(const GLint * v)
+{
+ DISPATCH(SecondaryColor3ivEXT, (v), (F, "glSecondaryColor3iv(%p);\n", (void *) v));
+}
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3s)(GLshort red, GLshort green, GLshort blue)
+{
+ DISPATCH(SecondaryColor3sEXT, (red, green, blue), (F, "glSecondaryColor3s(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3sv)(const GLshort * v)
+{
+ DISPATCH(SecondaryColor3svEXT, (v), (F, "glSecondaryColor3sv(%p);\n", (void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ub)(GLubyte red, GLubyte green, GLubyte blue)
+{
+ DISPATCH(SecondaryColor3ubEXT, (red, green, blue), (F, "glSecondaryColor3ub(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubv)(const GLubyte * v)
+{
+ DISPATCH(SecondaryColor3ubvEXT, (v), (F, "glSecondaryColor3ubv(%p);\n", (void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ui)(GLuint red, GLuint green, GLuint blue)
+{
+ DISPATCH(SecondaryColor3uiEXT, (red, green, blue), (F, "glSecondaryColor3ui(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uiv)(const GLuint * v)
+{
+ DISPATCH(SecondaryColor3uivEXT, (v), (F, "glSecondaryColor3uiv(%p);\n", (void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3us)(GLushort red, GLushort green, GLushort blue)
+{
+ DISPATCH(SecondaryColor3usEXT, (red, green, blue), (F, "glSecondaryColor3us(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usv)(const GLushort * v)
+{
+ DISPATCH(SecondaryColor3usvEXT, (v), (F, "glSecondaryColor3usv(%p);\n", (void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColorPointer)(GLint size, GLenum type, GLsizei stride, const void * pointer)
+{
+ DISPATCH(SecondaryColorPointerEXT, (size, type, stride, pointer), (F, "glSecondaryColorPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2d)(GLdouble x, GLdouble y)
+{
+ DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2d(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2dv)(const GLdouble * v)
+{
+ DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dv(%p /* %g, %g */);\n", (void *) v, v[0], v[1]));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2f)(GLfloat x, GLfloat y)
+{
+ DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2f(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2fv)(const GLfloat * v)
+{
+ DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fv(%p /* %g, %g */);\n", (void *) v, v[0], v[1]));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2i)(GLint x, GLint y)
+{
+ DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2i(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2iv)(const GLint * v)
+{
+ DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2iv(%p);\n", (void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2s)(GLshort x, GLshort y)
+{
+ DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2s(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2sv)(const GLshort * v)
+{
+ DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2sv(%p);\n", (void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3d)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3d(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3dv)(const GLdouble * v)
+{
+ DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dv(%p /* %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2]));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3f)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3f(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3fv)(const GLfloat * v)
+{
+ DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fv(%p /* %g, %g, %g */);\n", (void *) v, v[0], v[1], v[2]));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3i)(GLint x, GLint y, GLint z)
+{
+ DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3i(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3iv)(const GLint * v)
+{
+ DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3iv(%p);\n", (void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3s)(GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3s(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3sv)(const GLshort * v)
+{
+ DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3sv(%p);\n", (void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ActiveStencilFaceEXT)(GLenum face)
+{
+ DISPATCH(ActiveStencilFaceEXT, (face), (F, "glActiveStencilFaceEXT(0x%x);\n", face));
+}
+
+
+
+/*
+ * This is how a dispatch table can be initialized with all the functions
+ * we generated above.
+ */
#ifdef DISPATCH_TABLE_NAME
#ifndef TABLE_ENTRY
@@ -3955,7 +4543,6 @@ void *DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(Translated),
TABLE_ENTRY(Translatef),
TABLE_ENTRY(Viewport),
- /* 1.1 */
TABLE_ENTRY(ArrayElement),
TABLE_ENTRY(BindTexture),
TABLE_ENTRY(ColorPointer),
@@ -3986,7 +4573,6 @@ void *DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(TexSubImage2D),
TABLE_ENTRY(PopClientAttrib),
TABLE_ENTRY(PushClientAttrib),
- /* 1.2 */
TABLE_ENTRY(BlendColor),
TABLE_ENTRY(BlendEquation),
TABLE_ENTRY(DrawRangeElements),
@@ -4025,7 +4611,6 @@ void *DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(TexImage3D),
TABLE_ENTRY(TexSubImage3D),
TABLE_ENTRY(CopyTexSubImage3D),
- /* GL_ARB_multitexture */
TABLE_ENTRY(ActiveTextureARB),
TABLE_ENTRY(ClientActiveTextureARB),
TABLE_ENTRY(MultiTexCoord1dARB),
@@ -4060,108 +4645,74 @@ void *DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(MultiTexCoord4ivARB),
TABLE_ENTRY(MultiTexCoord4sARB),
TABLE_ENTRY(MultiTexCoord4svARB),
- /* GL_ARB_transpose_matrix */
TABLE_ENTRY(LoadTransposeMatrixfARB),
TABLE_ENTRY(LoadTransposeMatrixdARB),
TABLE_ENTRY(MultTransposeMatrixfARB),
TABLE_ENTRY(MultTransposeMatrixdARB),
- /* GL_ARB_multisample */
TABLE_ENTRY(SampleCoverageARB),
-#if 0
- TABLE_ENTRY(SamplePassARB),
-#else
- TABLE_ENTRY(Unused),
-#endif
- /* GL_EXT_blend_color */
- /* GL_EXT_polygon_offset */
+ TABLE_ENTRY(__unused413),
TABLE_ENTRY(PolygonOffsetEXT),
- /* GL_EXT_texture3D */
- /* GL_EXT_subtexture */
- /* GL_SGIS_texture_filter4 */
TABLE_ENTRY(GetTexFilterFuncSGIS),
TABLE_ENTRY(TexFilterFuncSGIS),
- /* GL_EXT_subtexture */
- /* GL_EXT_copy_texture */
- /* GL_EXT_histogram */
TABLE_ENTRY(GetHistogramEXT),
TABLE_ENTRY(GetHistogramParameterfvEXT),
TABLE_ENTRY(GetHistogramParameterivEXT),
TABLE_ENTRY(GetMinmaxEXT),
TABLE_ENTRY(GetMinmaxParameterfvEXT),
TABLE_ENTRY(GetMinmaxParameterivEXT),
- /* GL_EXT_convolution */
TABLE_ENTRY(GetConvolutionFilterEXT),
TABLE_ENTRY(GetConvolutionParameterfvEXT),
TABLE_ENTRY(GetConvolutionParameterivEXT),
TABLE_ENTRY(GetSeparableFilterEXT),
- /* GL_SGI_color_table */
TABLE_ENTRY(GetColorTableSGI),
TABLE_ENTRY(GetColorTableParameterfvSGI),
TABLE_ENTRY(GetColorTableParameterivSGI),
- /* GL_SGIX_pixel_texture */
TABLE_ENTRY(PixelTexGenSGIX),
- /* GL_SGIS_pixel_texture */
TABLE_ENTRY(PixelTexGenParameteriSGIS),
TABLE_ENTRY(PixelTexGenParameterivSGIS),
TABLE_ENTRY(PixelTexGenParameterfSGIS),
TABLE_ENTRY(PixelTexGenParameterfvSGIS),
TABLE_ENTRY(GetPixelTexGenParameterivSGIS),
TABLE_ENTRY(GetPixelTexGenParameterfvSGIS),
- /* GL_SGIS_texture4D */
TABLE_ENTRY(TexImage4DSGIS),
TABLE_ENTRY(TexSubImage4DSGIS),
- /* GL_EXT_texture_object */
TABLE_ENTRY(AreTexturesResidentEXT),
TABLE_ENTRY(GenTexturesEXT),
TABLE_ENTRY(IsTextureEXT),
- /* GL_SGIS_detail_texture */
TABLE_ENTRY(DetailTexFuncSGIS),
TABLE_ENTRY(GetDetailTexFuncSGIS),
- /* GL_SGIS_sharpen_texture */
TABLE_ENTRY(SharpenTexFuncSGIS),
TABLE_ENTRY(GetSharpenTexFuncSGIS),
- /* GL_SGIS_multisample */
TABLE_ENTRY(SampleMaskSGIS),
TABLE_ENTRY(SamplePatternSGIS),
- /* GL_EXT_vertex_array */
TABLE_ENTRY(ColorPointerEXT),
TABLE_ENTRY(EdgeFlagPointerEXT),
TABLE_ENTRY(IndexPointerEXT),
TABLE_ENTRY(NormalPointerEXT),
TABLE_ENTRY(TexCoordPointerEXT),
TABLE_ENTRY(VertexPointerEXT),
- /* GL_EXT_blend_minmax */
- /* GL_SGIX_sprite */
TABLE_ENTRY(SpriteParameterfSGIX),
TABLE_ENTRY(SpriteParameterfvSGIX),
TABLE_ENTRY(SpriteParameteriSGIX),
TABLE_ENTRY(SpriteParameterivSGIX),
- /* GL_EXT_point_parameters */
TABLE_ENTRY(PointParameterfEXT),
TABLE_ENTRY(PointParameterfvEXT),
- /* GL_SGIX_instruments */
TABLE_ENTRY(GetInstrumentsSGIX),
TABLE_ENTRY(InstrumentsBufferSGIX),
TABLE_ENTRY(PollInstrumentsSGIX),
TABLE_ENTRY(ReadInstrumentsSGIX),
TABLE_ENTRY(StartInstrumentsSGIX),
TABLE_ENTRY(StopInstrumentsSGIX),
- /* GL_SGIX_framezoom */
TABLE_ENTRY(FrameZoomSGIX),
- /* GL_SGIX_tag_sample_buffer */
TABLE_ENTRY(TagSampleBufferSGIX),
- /* GL_SGIX_reference_plane */
TABLE_ENTRY(ReferencePlaneSGIX),
- /* GL_SGIX_flush_raster */
TABLE_ENTRY(FlushRasterSGIX),
- /* GL_SGIX_list_priority */
TABLE_ENTRY(GetListParameterfvSGIX),
TABLE_ENTRY(GetListParameterivSGIX),
TABLE_ENTRY(ListParameterfSGIX),
TABLE_ENTRY(ListParameterfvSGIX),
TABLE_ENTRY(ListParameteriSGIX),
TABLE_ENTRY(ListParameterivSGIX),
- /* GL_SGIX_fragment_lighting */
TABLE_ENTRY(FragmentColorMaterialSGIX),
TABLE_ENTRY(FragmentLightfSGIX),
TABLE_ENTRY(FragmentLightfvSGIX),
@@ -4180,14 +4731,11 @@ void *DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(GetFragmentMaterialfvSGIX),
TABLE_ENTRY(GetFragmentMaterialivSGIX),
TABLE_ENTRY(LightEnviSGIX),
- /* GL_EXT_vertex_weighting */
TABLE_ENTRY(VertexWeightfEXT),
TABLE_ENTRY(VertexWeightfvEXT),
TABLE_ENTRY(VertexWeightPointerEXT),
- /* GL_NV_vertex_array_range */
TABLE_ENTRY(FlushVertexArrayRangeNV),
TABLE_ENTRY(VertexArrayRangeNV),
- /* GL_NV_register_combiners */
TABLE_ENTRY(CombinerParameterfvNV),
TABLE_ENTRY(CombinerParameterfNV),
TABLE_ENTRY(CombinerParameterivNV),
@@ -4201,9 +4749,7 @@ void *DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(GetCombinerOutputParameterivNV),
TABLE_ENTRY(GetFinalCombinerInputParameterfvNV),
TABLE_ENTRY(GetFinalCombinerInputParameterivNV),
- /* GL_MESA_resize_buffers */
TABLE_ENTRY(ResizeBuffersMESA),
- /* GL_MESA_window_pos */
TABLE_ENTRY(WindowPos2dMESA),
TABLE_ENTRY(WindowPos2dvMESA),
TABLE_ENTRY(WindowPos2fMESA),
@@ -4228,33 +4774,23 @@ void *DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(WindowPos4ivMESA),
TABLE_ENTRY(WindowPos4sMESA),
TABLE_ENTRY(WindowPos4svMESA),
- /* GL_EXT_draw_range_elements */
TABLE_ENTRY(BlendFuncSeparateEXT),
- /* GL_EXT_index_material */
TABLE_ENTRY(IndexMaterialEXT),
- /* GL_EXT_index_func */
TABLE_ENTRY(IndexFuncEXT),
- /* GL_EXT_compiled_vertex_array */
TABLE_ENTRY(LockArraysEXT),
TABLE_ENTRY(UnlockArraysEXT),
- /* GL_EXT_cull_vertex */
TABLE_ENTRY(CullParameterdvEXT),
TABLE_ENTRY(CullParameterfvEXT),
- /* GL_PGI_misc_hints */
TABLE_ENTRY(HintPGI),
- /* GL_EXT_fog_coord */
TABLE_ENTRY(FogCoordfEXT),
TABLE_ENTRY(FogCoordfvEXT),
TABLE_ENTRY(FogCoorddEXT),
TABLE_ENTRY(FogCoorddvEXT),
TABLE_ENTRY(FogCoordPointerEXT),
- /* GL_EXT_color_table */
TABLE_ENTRY(GetColorTableEXT),
TABLE_ENTRY(GetColorTableParameterivEXT),
TABLE_ENTRY(GetColorTableParameterfvEXT),
- /* GL_3DFX_tbuffer */
TABLE_ENTRY(TbufferMask3DFX),
- /* GL_ARB_texture_compression */
TABLE_ENTRY(CompressedTexImage3DARB),
TABLE_ENTRY(CompressedTexImage2DARB),
TABLE_ENTRY(CompressedTexImage1DARB),
@@ -4262,7 +4798,6 @@ void *DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(CompressedTexSubImage2DARB),
TABLE_ENTRY(CompressedTexSubImage1DARB),
TABLE_ENTRY(GetCompressedTexImageARB),
- /* GL_EXT_secondary_color */
TABLE_ENTRY(SecondaryColor3bEXT),
TABLE_ENTRY(SecondaryColor3bvEXT),
TABLE_ENTRY(SecondaryColor3dEXT),
@@ -4280,63 +4815,85 @@ void *DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(SecondaryColor3usEXT),
TABLE_ENTRY(SecondaryColor3usvEXT),
TABLE_ENTRY(SecondaryColorPointerEXT),
-#if 0
- /* 1.3 */
- TABLE_ENTRY(ActiveTexture),
- TABLE_ENTRY(ClientActiveTexture),
- TABLE_ENTRY(CompressedTexImage1D),
- TABLE_ENTRY(CompressedTexImage2D),
- TABLE_ENTRY(CompressedTexImage3D),
- TABLE_ENTRY(CompressedTexSubImage1D),
- TABLE_ENTRY(CompressedTexSubImage2D),
- TABLE_ENTRY(CompressedTexSubImage3D),
- TABLE_ENTRY(GetCompressedTexImage),
- TABLE_ENTRY(MultiTexCoord1d),
- TABLE_ENTRY(MultiTexCoord1dv),
- TABLE_ENTRY(MultiTexCoord1f),
- TABLE_ENTRY(MultiTexCoord1fv),
- TABLE_ENTRY(MultiTexCoord1i),
- TABLE_ENTRY(MultiTexCoord1iv),
- TABLE_ENTRY(MultiTexCoord1s),
- TABLE_ENTRY(MultiTexCoord1sv),
- TABLE_ENTRY(MultiTexCoord2d),
- TABLE_ENTRY(MultiTexCoord2dv),
- TABLE_ENTRY(MultiTexCoord2f),
- TABLE_ENTRY(MultiTexCoord2fv),
- TABLE_ENTRY(MultiTexCoord2i),
- TABLE_ENTRY(MultiTexCoord2iv),
- TABLE_ENTRY(MultiTexCoord2s),
- TABLE_ENTRY(MultiTexCoord2sv),
- TABLE_ENTRY(MultiTexCoord3d),
- TABLE_ENTRY(MultiTexCoord3dv),
- TABLE_ENTRY(MultiTexCoord3f),
- TABLE_ENTRY(MultiTexCoord3fv),
- TABLE_ENTRY(MultiTexCoord3i),
- TABLE_ENTRY(MultiTexCoord3iv),
- TABLE_ENTRY(MultiTexCoord3s),
- TABLE_ENTRY(MultiTexCoord3sv),
- TABLE_ENTRY(MultiTexCoord4d),
- TABLE_ENTRY(MultiTexCoord4dv),
- TABLE_ENTRY(MultiTexCoord4f),
- TABLE_ENTRY(MultiTexCoord4fv),
- TABLE_ENTRY(MultiTexCoord4i),
- TABLE_ENTRY(MultiTexCoord4iv),
- TABLE_ENTRY(MultiTexCoord4s),
- TABLE_ENTRY(MultiTexCoord4sv),
- TABLE_ENTRY(LoadTransposeMatrixd),
- TABLE_ENTRY(LoadTransposeMatrixf),
- TABLE_ENTRY(MultTransposeMatrixd),
- TABLE_ENTRY(MultTransposeMatrixf),
- TABLE_ENTRY(SampleCoverage),
-#if 0
- TABLE_ENTRY(SamplePass),
-#else
- TABLE_ENTRY(Unused),
-#endif
-#endif
+ TABLE_ENTRY(AreProgramsResidentNV),
+ TABLE_ENTRY(BindProgramNV),
+ TABLE_ENTRY(DeleteProgramsNV),
+ TABLE_ENTRY(ExecuteProgramNV),
+ TABLE_ENTRY(GenProgramsNV),
+ TABLE_ENTRY(GetProgramParameterdvNV),
+ TABLE_ENTRY(GetProgramParameterfvNV),
+ TABLE_ENTRY(GetProgramivNV),
+ TABLE_ENTRY(GetProgramStringNV),
+ TABLE_ENTRY(GetTrackMatrixivNV),
+ TABLE_ENTRY(GetVertexAttribdvNV),
+ TABLE_ENTRY(GetVertexAttribfvNV),
+ TABLE_ENTRY(GetVertexAttribivNV),
+ TABLE_ENTRY(GetVertexAttribPointervNV),
+ TABLE_ENTRY(IsProgramNV),
+ TABLE_ENTRY(LoadProgramNV),
+ TABLE_ENTRY(ProgramParameter4dNV),
+ TABLE_ENTRY(ProgramParameter4dvNV),
+ TABLE_ENTRY(ProgramParameter4fNV),
+ TABLE_ENTRY(ProgramParameter4fvNV),
+ TABLE_ENTRY(ProgramParameters4dvNV),
+ TABLE_ENTRY(ProgramParameters4fvNV),
+ TABLE_ENTRY(RequestResidentProgramsNV),
+ TABLE_ENTRY(TrackMatrixNV),
+ TABLE_ENTRY(VertexAttribPointerNV),
+ TABLE_ENTRY(VertexAttrib1dNV),
+ TABLE_ENTRY(VertexAttrib1dvNV),
+ TABLE_ENTRY(VertexAttrib1fNV),
+ TABLE_ENTRY(VertexAttrib1fvNV),
+ TABLE_ENTRY(VertexAttrib1sNV),
+ TABLE_ENTRY(VertexAttrib1svNV),
+ TABLE_ENTRY(VertexAttrib2dNV),
+ TABLE_ENTRY(VertexAttrib2dvNV),
+ TABLE_ENTRY(VertexAttrib2fNV),
+ TABLE_ENTRY(VertexAttrib2fvNV),
+ TABLE_ENTRY(VertexAttrib2sNV),
+ TABLE_ENTRY(VertexAttrib2svNV),
+ TABLE_ENTRY(VertexAttrib3dNV),
+ TABLE_ENTRY(VertexAttrib3dvNV),
+ TABLE_ENTRY(VertexAttrib3fNV),
+ TABLE_ENTRY(VertexAttrib3fvNV),
+ TABLE_ENTRY(VertexAttrib3sNV),
+ TABLE_ENTRY(VertexAttrib3svNV),
+ TABLE_ENTRY(VertexAttrib4dNV),
+ TABLE_ENTRY(VertexAttrib4dvNV),
+ TABLE_ENTRY(VertexAttrib4fNV),
+ TABLE_ENTRY(VertexAttrib4fvNV),
+ TABLE_ENTRY(VertexAttrib4sNV),
+ TABLE_ENTRY(VertexAttrib4svNV),
+ TABLE_ENTRY(VertexAttrib4ubNV),
+ TABLE_ENTRY(VertexAttrib4ubvNV),
+ TABLE_ENTRY(VertexAttribs1dvNV),
+ TABLE_ENTRY(VertexAttribs1fvNV),
+ TABLE_ENTRY(VertexAttribs1svNV),
+ TABLE_ENTRY(VertexAttribs2dvNV),
+ TABLE_ENTRY(VertexAttribs2fvNV),
+ TABLE_ENTRY(VertexAttribs2svNV),
+ TABLE_ENTRY(VertexAttribs3dvNV),
+ TABLE_ENTRY(VertexAttribs3fvNV),
+ TABLE_ENTRY(VertexAttribs3svNV),
+ TABLE_ENTRY(VertexAttribs4dvNV),
+ TABLE_ENTRY(VertexAttribs4fvNV),
+ TABLE_ENTRY(VertexAttribs4svNV),
+ TABLE_ENTRY(VertexAttribs4ubvNV),
+ TABLE_ENTRY(PointParameteriNV),
+ TABLE_ENTRY(PointParameterivNV),
+ TABLE_ENTRY(MultiDrawArraysEXT),
+ TABLE_ENTRY(MultiDrawElementsEXT),
+ TABLE_ENTRY(ActiveStencilFaceEXT),
+ TABLE_ENTRY(DeleteFencesNV),
+ TABLE_ENTRY(GenFencesNV),
+ TABLE_ENTRY(IsFenceNV),
+ TABLE_ENTRY(TestFenceNV),
+ TABLE_ENTRY(GetFenceivNV),
+ TABLE_ENTRY(FinishFenceNV),
+ TABLE_ENTRY(SetFenceNV),
/* 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.
+ * when someone tries to call a dynamically-registered
+ * extension function without a current rendering context.
*/
TABLE_ENTRY(Unused),
TABLE_ENTRY(Unused),
@@ -4437,89 +4994,72 @@ void *DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(Unused),
TABLE_ENTRY(Unused),
TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused)
};
#endif /* DISPATCH_TABLE_NAME */
-
/*
* This is just used to silence compiler warnings.
* We list the functions which aren't otherwise used.
*/
#ifdef UNUSED_TABLE_NAME
void *UNUSED_TABLE_NAME[] = {
+ TABLE_ENTRY(ActiveTexture),
+ TABLE_ENTRY(ClientActiveTexture),
+ TABLE_ENTRY(MultiTexCoord1d),
+ TABLE_ENTRY(MultiTexCoord1dv),
+ TABLE_ENTRY(MultiTexCoord1f),
+ TABLE_ENTRY(MultiTexCoord1fv),
+ TABLE_ENTRY(MultiTexCoord1i),
+ TABLE_ENTRY(MultiTexCoord1iv),
+ TABLE_ENTRY(MultiTexCoord1s),
+ TABLE_ENTRY(MultiTexCoord1sv),
+ TABLE_ENTRY(MultiTexCoord2d),
+ TABLE_ENTRY(MultiTexCoord2dv),
+ TABLE_ENTRY(MultiTexCoord2f),
+ TABLE_ENTRY(MultiTexCoord2fv),
+ TABLE_ENTRY(MultiTexCoord2i),
+ TABLE_ENTRY(MultiTexCoord2iv),
+ TABLE_ENTRY(MultiTexCoord2s),
+ TABLE_ENTRY(MultiTexCoord2sv),
+ TABLE_ENTRY(MultiTexCoord3d),
+ TABLE_ENTRY(MultiTexCoord3dv),
+ TABLE_ENTRY(MultiTexCoord3f),
+ TABLE_ENTRY(MultiTexCoord3fv),
+ TABLE_ENTRY(MultiTexCoord3i),
+ TABLE_ENTRY(MultiTexCoord3iv),
+ TABLE_ENTRY(MultiTexCoord3s),
+ TABLE_ENTRY(MultiTexCoord3sv),
+ TABLE_ENTRY(MultiTexCoord4d),
+ TABLE_ENTRY(MultiTexCoord4dv),
+ TABLE_ENTRY(MultiTexCoord4f),
+ TABLE_ENTRY(MultiTexCoord4fv),
+ TABLE_ENTRY(MultiTexCoord4i),
+ TABLE_ENTRY(MultiTexCoord4iv),
+ TABLE_ENTRY(MultiTexCoord4s),
+ TABLE_ENTRY(MultiTexCoord4sv),
+ TABLE_ENTRY(LoadTransposeMatrixf),
+ TABLE_ENTRY(LoadTransposeMatrixd),
+ TABLE_ENTRY(MultTransposeMatrixf),
+ TABLE_ENTRY(MultTransposeMatrixd),
+ TABLE_ENTRY(SampleCoverage),
+ TABLE_ENTRY(CompressedTexImage3D),
+ TABLE_ENTRY(CompressedTexImage2D),
+ TABLE_ENTRY(CompressedTexImage1D),
+ TABLE_ENTRY(CompressedTexSubImage3D),
+ TABLE_ENTRY(CompressedTexSubImage2D),
+ TABLE_ENTRY(CompressedTexSubImage1D),
+ TABLE_ENTRY(GetCompressedTexImage),
TABLE_ENTRY(BlendColorEXT),
- TABLE_ENTRY(CopyTexSubImage3DEXT),
TABLE_ENTRY(TexImage3DEXT),
TABLE_ENTRY(TexSubImage3DEXT),
- TABLE_ENTRY(CopyTexSubImage1DEXT),
TABLE_ENTRY(TexSubImage1DEXT),
TABLE_ENTRY(TexSubImage2DEXT),
TABLE_ENTRY(CopyTexImage1DEXT),
TABLE_ENTRY(CopyTexImage2DEXT),
+ TABLE_ENTRY(CopyTexSubImage1DEXT),
TABLE_ENTRY(CopyTexSubImage2DEXT),
+ TABLE_ENTRY(CopyTexSubImage3DEXT),
TABLE_ENTRY(HistogramEXT),
TABLE_ENTRY(MinmaxEXT),
TABLE_ENTRY(ResetHistogramEXT),
@@ -4533,17 +5073,19 @@ void *UNUSED_TABLE_NAME[] = {
TABLE_ENTRY(CopyConvolutionFilter1DEXT),
TABLE_ENTRY(CopyConvolutionFilter2DEXT),
TABLE_ENTRY(SeparableFilter2DEXT),
+ TABLE_ENTRY(ColorTableSGI),
TABLE_ENTRY(ColorTableParameterfvSGI),
TABLE_ENTRY(ColorTableParameterivSGI),
- TABLE_ENTRY(ColorTableSGI),
TABLE_ENTRY(CopyColorTableSGI),
- TABLE_ENTRY(DeleteTexturesEXT),
TABLE_ENTRY(BindTextureEXT),
+ TABLE_ENTRY(DeleteTexturesEXT),
TABLE_ENTRY(PrioritizeTexturesEXT),
- TABLE_ENTRY(GetPointervEXT),
TABLE_ENTRY(ArrayElementEXT),
TABLE_ENTRY(DrawArraysEXT),
+ TABLE_ENTRY(GetPointervEXT),
TABLE_ENTRY(BlendEquationEXT),
+ TABLE_ENTRY(PointParameterfARB),
+ TABLE_ENTRY(PointParameterfvARB),
TABLE_ENTRY(PointParameterfSGIS),
TABLE_ENTRY(PointParameterfvSGIS),
TABLE_ENTRY(ColorSubTableEXT),
@@ -4553,56 +5095,67 @@ void *UNUSED_TABLE_NAME[] = {
TABLE_ENTRY(BlendFuncSeparateINGR),
TABLE_ENTRY(SampleMaskEXT),
TABLE_ENTRY(SamplePatternEXT),
- TABLE_ENTRY(ActiveTexture),
- TABLE_ENTRY(ClientActiveTexture),
- TABLE_ENTRY(CompressedTexImage1D),
- TABLE_ENTRY(CompressedTexImage2D),
- TABLE_ENTRY(CompressedTexImage2DARB),
- TABLE_ENTRY(CompressedTexImage3D),
- TABLE_ENTRY(CompressedTexSubImage1D),
- TABLE_ENTRY(CompressedTexSubImage2D),
- TABLE_ENTRY(CompressedTexSubImage3D),
- TABLE_ENTRY(GetCompressedTexImage),
- TABLE_ENTRY(MultiTexCoord1d),
- TABLE_ENTRY(MultiTexCoord1dv),
- TABLE_ENTRY(MultiTexCoord1f),
- TABLE_ENTRY(MultiTexCoord1fv),
- TABLE_ENTRY(MultiTexCoord1i),
- TABLE_ENTRY(MultiTexCoord1iv),
- TABLE_ENTRY(MultiTexCoord1s),
- TABLE_ENTRY(MultiTexCoord1sv),
- TABLE_ENTRY(MultiTexCoord2d),
- TABLE_ENTRY(MultiTexCoord2dv),
- TABLE_ENTRY(MultiTexCoord2f),
- TABLE_ENTRY(MultiTexCoord2fv),
- TABLE_ENTRY(MultiTexCoord2i),
- TABLE_ENTRY(MultiTexCoord2iv),
- TABLE_ENTRY(MultiTexCoord2s),
- TABLE_ENTRY(MultiTexCoord2sv),
- TABLE_ENTRY(MultiTexCoord3d),
- TABLE_ENTRY(MultiTexCoord3dv),
- TABLE_ENTRY(MultiTexCoord3f),
- TABLE_ENTRY(MultiTexCoord3fv),
- TABLE_ENTRY(MultiTexCoord3i),
- TABLE_ENTRY(MultiTexCoord3iv),
- TABLE_ENTRY(MultiTexCoord3s),
- TABLE_ENTRY(MultiTexCoord3sv),
- TABLE_ENTRY(MultiTexCoord4d),
- TABLE_ENTRY(MultiTexCoord4dv),
- TABLE_ENTRY(MultiTexCoord4f),
- TABLE_ENTRY(MultiTexCoord4fv),
- TABLE_ENTRY(MultiTexCoord4i),
- TABLE_ENTRY(MultiTexCoord4iv),
- TABLE_ENTRY(MultiTexCoord4s),
- TABLE_ENTRY(MultiTexCoord4sv),
- TABLE_ENTRY(LoadTransposeMatrixd),
- TABLE_ENTRY(LoadTransposeMatrixf),
- TABLE_ENTRY(MultTransposeMatrixd),
- TABLE_ENTRY(MultTransposeMatrixf),
- TABLE_ENTRY(SampleCoverage),
-#if 0
- TABLE_ENTRY(SamplePass)
-#endif
+ TABLE_ENTRY(WindowPos2dARB),
+ TABLE_ENTRY(WindowPos2fARB),
+ TABLE_ENTRY(WindowPos2iARB),
+ TABLE_ENTRY(WindowPos2sARB),
+ TABLE_ENTRY(WindowPos2dvARB),
+ TABLE_ENTRY(WindowPos2fvARB),
+ TABLE_ENTRY(WindowPos2ivARB),
+ TABLE_ENTRY(WindowPos2svARB),
+ TABLE_ENTRY(WindowPos3dARB),
+ TABLE_ENTRY(WindowPos3fARB),
+ TABLE_ENTRY(WindowPos3iARB),
+ TABLE_ENTRY(WindowPos3sARB),
+ TABLE_ENTRY(WindowPos3dvARB),
+ TABLE_ENTRY(WindowPos3fvARB),
+ TABLE_ENTRY(WindowPos3ivARB),
+ TABLE_ENTRY(WindowPos3svARB),
+ TABLE_ENTRY(BlendFuncSeparate),
+ TABLE_ENTRY(FogCoordf),
+ TABLE_ENTRY(FogCoordfv),
+ TABLE_ENTRY(FogCoordd),
+ TABLE_ENTRY(FogCoorddv),
+ TABLE_ENTRY(FogCoordPointer),
+ TABLE_ENTRY(MultiDrawArrays),
+ TABLE_ENTRY(MultiDrawElements),
+ TABLE_ENTRY(PointParameterf),
+ TABLE_ENTRY(PointParameterfv),
+ TABLE_ENTRY(PointParameteri),
+ TABLE_ENTRY(PointParameteriv),
+ TABLE_ENTRY(SecondaryColor3b),
+ TABLE_ENTRY(SecondaryColor3bv),
+ TABLE_ENTRY(SecondaryColor3d),
+ TABLE_ENTRY(SecondaryColor3dv),
+ TABLE_ENTRY(SecondaryColor3f),
+ TABLE_ENTRY(SecondaryColor3fv),
+ TABLE_ENTRY(SecondaryColor3i),
+ TABLE_ENTRY(SecondaryColor3iv),
+ TABLE_ENTRY(SecondaryColor3s),
+ TABLE_ENTRY(SecondaryColor3sv),
+ TABLE_ENTRY(SecondaryColor3ub),
+ TABLE_ENTRY(SecondaryColor3ubv),
+ TABLE_ENTRY(SecondaryColor3ui),
+ TABLE_ENTRY(SecondaryColor3uiv),
+ TABLE_ENTRY(SecondaryColor3us),
+ TABLE_ENTRY(SecondaryColor3usv),
+ TABLE_ENTRY(SecondaryColorPointer),
+ TABLE_ENTRY(WindowPos2d),
+ TABLE_ENTRY(WindowPos2dv),
+ TABLE_ENTRY(WindowPos2f),
+ TABLE_ENTRY(WindowPos2fv),
+ TABLE_ENTRY(WindowPos2i),
+ TABLE_ENTRY(WindowPos2iv),
+ TABLE_ENTRY(WindowPos2s),
+ TABLE_ENTRY(WindowPos2sv),
+ TABLE_ENTRY(WindowPos3d),
+ TABLE_ENTRY(WindowPos3dv),
+ TABLE_ENTRY(WindowPos3f),
+ TABLE_ENTRY(WindowPos3fv),
+ TABLE_ENTRY(WindowPos3i),
+ TABLE_ENTRY(WindowPos3iv),
+ TABLE_ENTRY(WindowPos3s),
+ TABLE_ENTRY(WindowPos3sv),
};
#endif /*UNUSED_TABLE_NAME*/
@@ -4615,3 +5168,4 @@ void *UNUSED_TABLE_NAME[] = {
#undef DISPATCH_TABLE_NAME
#undef UNUSED_TABLE_NAME
#undef TABLE_ENTRY
+
diff --git a/xc/extras/Mesa/src/glheader.h b/xc/extras/Mesa/src/glheader.h
index 62fba6e00..794b99745 100644
--- a/xc/extras/Mesa/src/glheader.h
+++ b/xc/extras/Mesa/src/glheader.h
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 5.0
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -46,7 +46,7 @@
-#ifdef XFree86Module
+#if defined(XFree86LOADER) && defined(IN_MODULE)
#include "xf86_ansic.h"
#else
#include <assert.h>
@@ -66,6 +66,7 @@
#endif
#endif
#include <float.h>
+#include <stdarg.h>
#ifdef HAVE_CONFIG_H
@@ -73,7 +74,6 @@
#endif
-
#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__)
# define __WIN32__
# define finite _finite
@@ -256,6 +256,17 @@ typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESC
#endif
+/*
+ * Provide a reasonable replacement for __FUNCTION__ when using
+ * non-GNU C compilers.
+ */
+#if !defined(__GNUC__)
+#define STRINGIZE(x) #x
+#define STRINGIZE_EVAL(x) STRINGIZE(x)
+#define __FUNCTION__ STRINGIZE_EVAL(__FILE__) ", line " STRINGIZE_EVAL(__LINE__)
+#endif
+
+
/* Some compilers don't like some of Mesa's const usage */
#ifdef NO_CONST
# define CONST
@@ -282,5 +293,4 @@ typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESC
typedef union { GLfloat f; GLint i; } fi_type;
-
#endif /* GLHEADER_H */
diff --git a/xc/extras/Mesa/src/glprocs.h b/xc/extras/Mesa/src/glprocs.h
new file mode 100644
index 000000000..af7aea669
--- /dev/null
+++ b/xc/extras/Mesa/src/glprocs.h
@@ -0,0 +1,814 @@
+/* DO NOT EDIT - This file generated automatically by glprocs.py script */
+
+/* This file is only included by glapi.c and is used for
+ * the GetProcAddress() function
+ */
+
+static struct name_address_offset static_functions[] = {
+ { "glNewList", (GLvoid *) glNewList, _gloffset_NewList },
+ { "glEndList", (GLvoid *) glEndList, _gloffset_EndList },
+ { "glCallList", (GLvoid *) glCallList, _gloffset_CallList },
+ { "glCallLists", (GLvoid *) glCallLists, _gloffset_CallLists },
+ { "glDeleteLists", (GLvoid *) glDeleteLists, _gloffset_DeleteLists },
+ { "glGenLists", (GLvoid *) glGenLists, _gloffset_GenLists },
+ { "glListBase", (GLvoid *) glListBase, _gloffset_ListBase },
+ { "glBegin", (GLvoid *) glBegin, _gloffset_Begin },
+ { "glBitmap", (GLvoid *) glBitmap, _gloffset_Bitmap },
+ { "glColor3b", (GLvoid *) glColor3b, _gloffset_Color3b },
+ { "glColor3bv", (GLvoid *) glColor3bv, _gloffset_Color3bv },
+ { "glColor3d", (GLvoid *) glColor3d, _gloffset_Color3d },
+ { "glColor3dv", (GLvoid *) glColor3dv, _gloffset_Color3dv },
+ { "glColor3f", (GLvoid *) glColor3f, _gloffset_Color3f },
+ { "glColor3fv", (GLvoid *) glColor3fv, _gloffset_Color3fv },
+ { "glColor3i", (GLvoid *) glColor3i, _gloffset_Color3i },
+ { "glColor3iv", (GLvoid *) glColor3iv, _gloffset_Color3iv },
+ { "glColor3s", (GLvoid *) glColor3s, _gloffset_Color3s },
+ { "glColor3sv", (GLvoid *) glColor3sv, _gloffset_Color3sv },
+ { "glColor3ub", (GLvoid *) glColor3ub, _gloffset_Color3ub },
+ { "glColor3ubv", (GLvoid *) glColor3ubv, _gloffset_Color3ubv },
+ { "glColor3ui", (GLvoid *) glColor3ui, _gloffset_Color3ui },
+ { "glColor3uiv", (GLvoid *) glColor3uiv, _gloffset_Color3uiv },
+ { "glColor3us", (GLvoid *) glColor3us, _gloffset_Color3us },
+ { "glColor3usv", (GLvoid *) glColor3usv, _gloffset_Color3usv },
+ { "glColor4b", (GLvoid *) glColor4b, _gloffset_Color4b },
+ { "glColor4bv", (GLvoid *) glColor4bv, _gloffset_Color4bv },
+ { "glColor4d", (GLvoid *) glColor4d, _gloffset_Color4d },
+ { "glColor4dv", (GLvoid *) glColor4dv, _gloffset_Color4dv },
+ { "glColor4f", (GLvoid *) glColor4f, _gloffset_Color4f },
+ { "glColor4fv", (GLvoid *) glColor4fv, _gloffset_Color4fv },
+ { "glColor4i", (GLvoid *) glColor4i, _gloffset_Color4i },
+ { "glColor4iv", (GLvoid *) glColor4iv, _gloffset_Color4iv },
+ { "glColor4s", (GLvoid *) glColor4s, _gloffset_Color4s },
+ { "glColor4sv", (GLvoid *) glColor4sv, _gloffset_Color4sv },
+ { "glColor4ub", (GLvoid *) glColor4ub, _gloffset_Color4ub },
+ { "glColor4ubv", (GLvoid *) glColor4ubv, _gloffset_Color4ubv },
+ { "glColor4ui", (GLvoid *) glColor4ui, _gloffset_Color4ui },
+ { "glColor4uiv", (GLvoid *) glColor4uiv, _gloffset_Color4uiv },
+ { "glColor4us", (GLvoid *) glColor4us, _gloffset_Color4us },
+ { "glColor4usv", (GLvoid *) glColor4usv, _gloffset_Color4usv },
+ { "glEdgeFlag", (GLvoid *) glEdgeFlag, _gloffset_EdgeFlag },
+ { "glEdgeFlagv", (GLvoid *) glEdgeFlagv, _gloffset_EdgeFlagv },
+ { "glEnd", (GLvoid *) glEnd, _gloffset_End },
+ { "glIndexd", (GLvoid *) glIndexd, _gloffset_Indexd },
+ { "glIndexdv", (GLvoid *) glIndexdv, _gloffset_Indexdv },
+ { "glIndexf", (GLvoid *) glIndexf, _gloffset_Indexf },
+ { "glIndexfv", (GLvoid *) glIndexfv, _gloffset_Indexfv },
+ { "glIndexi", (GLvoid *) glIndexi, _gloffset_Indexi },
+ { "glIndexiv", (GLvoid *) glIndexiv, _gloffset_Indexiv },
+ { "glIndexs", (GLvoid *) glIndexs, _gloffset_Indexs },
+ { "glIndexsv", (GLvoid *) glIndexsv, _gloffset_Indexsv },
+ { "glNormal3b", (GLvoid *) glNormal3b, _gloffset_Normal3b },
+ { "glNormal3bv", (GLvoid *) glNormal3bv, _gloffset_Normal3bv },
+ { "glNormal3d", (GLvoid *) glNormal3d, _gloffset_Normal3d },
+ { "glNormal3dv", (GLvoid *) glNormal3dv, _gloffset_Normal3dv },
+ { "glNormal3f", (GLvoid *) glNormal3f, _gloffset_Normal3f },
+ { "glNormal3fv", (GLvoid *) glNormal3fv, _gloffset_Normal3fv },
+ { "glNormal3i", (GLvoid *) glNormal3i, _gloffset_Normal3i },
+ { "glNormal3iv", (GLvoid *) glNormal3iv, _gloffset_Normal3iv },
+ { "glNormal3s", (GLvoid *) glNormal3s, _gloffset_Normal3s },
+ { "glNormal3sv", (GLvoid *) glNormal3sv, _gloffset_Normal3sv },
+ { "glRasterPos2d", (GLvoid *) glRasterPos2d, _gloffset_RasterPos2d },
+ { "glRasterPos2dv", (GLvoid *) glRasterPos2dv, _gloffset_RasterPos2dv },
+ { "glRasterPos2f", (GLvoid *) glRasterPos2f, _gloffset_RasterPos2f },
+ { "glRasterPos2fv", (GLvoid *) glRasterPos2fv, _gloffset_RasterPos2fv },
+ { "glRasterPos2i", (GLvoid *) glRasterPos2i, _gloffset_RasterPos2i },
+ { "glRasterPos2iv", (GLvoid *) glRasterPos2iv, _gloffset_RasterPos2iv },
+ { "glRasterPos2s", (GLvoid *) glRasterPos2s, _gloffset_RasterPos2s },
+ { "glRasterPos2sv", (GLvoid *) glRasterPos2sv, _gloffset_RasterPos2sv },
+ { "glRasterPos3d", (GLvoid *) glRasterPos3d, _gloffset_RasterPos3d },
+ { "glRasterPos3dv", (GLvoid *) glRasterPos3dv, _gloffset_RasterPos3dv },
+ { "glRasterPos3f", (GLvoid *) glRasterPos3f, _gloffset_RasterPos3f },
+ { "glRasterPos3fv", (GLvoid *) glRasterPos3fv, _gloffset_RasterPos3fv },
+ { "glRasterPos3i", (GLvoid *) glRasterPos3i, _gloffset_RasterPos3i },
+ { "glRasterPos3iv", (GLvoid *) glRasterPos3iv, _gloffset_RasterPos3iv },
+ { "glRasterPos3s", (GLvoid *) glRasterPos3s, _gloffset_RasterPos3s },
+ { "glRasterPos3sv", (GLvoid *) glRasterPos3sv, _gloffset_RasterPos3sv },
+ { "glRasterPos4d", (GLvoid *) glRasterPos4d, _gloffset_RasterPos4d },
+ { "glRasterPos4dv", (GLvoid *) glRasterPos4dv, _gloffset_RasterPos4dv },
+ { "glRasterPos4f", (GLvoid *) glRasterPos4f, _gloffset_RasterPos4f },
+ { "glRasterPos4fv", (GLvoid *) glRasterPos4fv, _gloffset_RasterPos4fv },
+ { "glRasterPos4i", (GLvoid *) glRasterPos4i, _gloffset_RasterPos4i },
+ { "glRasterPos4iv", (GLvoid *) glRasterPos4iv, _gloffset_RasterPos4iv },
+ { "glRasterPos4s", (GLvoid *) glRasterPos4s, _gloffset_RasterPos4s },
+ { "glRasterPos4sv", (GLvoid *) glRasterPos4sv, _gloffset_RasterPos4sv },
+ { "glRectd", (GLvoid *) glRectd, _gloffset_Rectd },
+ { "glRectdv", (GLvoid *) glRectdv, _gloffset_Rectdv },
+ { "glRectf", (GLvoid *) glRectf, _gloffset_Rectf },
+ { "glRectfv", (GLvoid *) glRectfv, _gloffset_Rectfv },
+ { "glRecti", (GLvoid *) glRecti, _gloffset_Recti },
+ { "glRectiv", (GLvoid *) glRectiv, _gloffset_Rectiv },
+ { "glRects", (GLvoid *) glRects, _gloffset_Rects },
+ { "glRectsv", (GLvoid *) glRectsv, _gloffset_Rectsv },
+ { "glTexCoord1d", (GLvoid *) glTexCoord1d, _gloffset_TexCoord1d },
+ { "glTexCoord1dv", (GLvoid *) glTexCoord1dv, _gloffset_TexCoord1dv },
+ { "glTexCoord1f", (GLvoid *) glTexCoord1f, _gloffset_TexCoord1f },
+ { "glTexCoord1fv", (GLvoid *) glTexCoord1fv, _gloffset_TexCoord1fv },
+ { "glTexCoord1i", (GLvoid *) glTexCoord1i, _gloffset_TexCoord1i },
+ { "glTexCoord1iv", (GLvoid *) glTexCoord1iv, _gloffset_TexCoord1iv },
+ { "glTexCoord1s", (GLvoid *) glTexCoord1s, _gloffset_TexCoord1s },
+ { "glTexCoord1sv", (GLvoid *) glTexCoord1sv, _gloffset_TexCoord1sv },
+ { "glTexCoord2d", (GLvoid *) glTexCoord2d, _gloffset_TexCoord2d },
+ { "glTexCoord2dv", (GLvoid *) glTexCoord2dv, _gloffset_TexCoord2dv },
+ { "glTexCoord2f", (GLvoid *) glTexCoord2f, _gloffset_TexCoord2f },
+ { "glTexCoord2fv", (GLvoid *) glTexCoord2fv, _gloffset_TexCoord2fv },
+ { "glTexCoord2i", (GLvoid *) glTexCoord2i, _gloffset_TexCoord2i },
+ { "glTexCoord2iv", (GLvoid *) glTexCoord2iv, _gloffset_TexCoord2iv },
+ { "glTexCoord2s", (GLvoid *) glTexCoord2s, _gloffset_TexCoord2s },
+ { "glTexCoord2sv", (GLvoid *) glTexCoord2sv, _gloffset_TexCoord2sv },
+ { "glTexCoord3d", (GLvoid *) glTexCoord3d, _gloffset_TexCoord3d },
+ { "glTexCoord3dv", (GLvoid *) glTexCoord3dv, _gloffset_TexCoord3dv },
+ { "glTexCoord3f", (GLvoid *) glTexCoord3f, _gloffset_TexCoord3f },
+ { "glTexCoord3fv", (GLvoid *) glTexCoord3fv, _gloffset_TexCoord3fv },
+ { "glTexCoord3i", (GLvoid *) glTexCoord3i, _gloffset_TexCoord3i },
+ { "glTexCoord3iv", (GLvoid *) glTexCoord3iv, _gloffset_TexCoord3iv },
+ { "glTexCoord3s", (GLvoid *) glTexCoord3s, _gloffset_TexCoord3s },
+ { "glTexCoord3sv", (GLvoid *) glTexCoord3sv, _gloffset_TexCoord3sv },
+ { "glTexCoord4d", (GLvoid *) glTexCoord4d, _gloffset_TexCoord4d },
+ { "glTexCoord4dv", (GLvoid *) glTexCoord4dv, _gloffset_TexCoord4dv },
+ { "glTexCoord4f", (GLvoid *) glTexCoord4f, _gloffset_TexCoord4f },
+ { "glTexCoord4fv", (GLvoid *) glTexCoord4fv, _gloffset_TexCoord4fv },
+ { "glTexCoord4i", (GLvoid *) glTexCoord4i, _gloffset_TexCoord4i },
+ { "glTexCoord4iv", (GLvoid *) glTexCoord4iv, _gloffset_TexCoord4iv },
+ { "glTexCoord4s", (GLvoid *) glTexCoord4s, _gloffset_TexCoord4s },
+ { "glTexCoord4sv", (GLvoid *) glTexCoord4sv, _gloffset_TexCoord4sv },
+ { "glVertex2d", (GLvoid *) glVertex2d, _gloffset_Vertex2d },
+ { "glVertex2dv", (GLvoid *) glVertex2dv, _gloffset_Vertex2dv },
+ { "glVertex2f", (GLvoid *) glVertex2f, _gloffset_Vertex2f },
+ { "glVertex2fv", (GLvoid *) glVertex2fv, _gloffset_Vertex2fv },
+ { "glVertex2i", (GLvoid *) glVertex2i, _gloffset_Vertex2i },
+ { "glVertex2iv", (GLvoid *) glVertex2iv, _gloffset_Vertex2iv },
+ { "glVertex2s", (GLvoid *) glVertex2s, _gloffset_Vertex2s },
+ { "glVertex2sv", (GLvoid *) glVertex2sv, _gloffset_Vertex2sv },
+ { "glVertex3d", (GLvoid *) glVertex3d, _gloffset_Vertex3d },
+ { "glVertex3dv", (GLvoid *) glVertex3dv, _gloffset_Vertex3dv },
+ { "glVertex3f", (GLvoid *) glVertex3f, _gloffset_Vertex3f },
+ { "glVertex3fv", (GLvoid *) glVertex3fv, _gloffset_Vertex3fv },
+ { "glVertex3i", (GLvoid *) glVertex3i, _gloffset_Vertex3i },
+ { "glVertex3iv", (GLvoid *) glVertex3iv, _gloffset_Vertex3iv },
+ { "glVertex3s", (GLvoid *) glVertex3s, _gloffset_Vertex3s },
+ { "glVertex3sv", (GLvoid *) glVertex3sv, _gloffset_Vertex3sv },
+ { "glVertex4d", (GLvoid *) glVertex4d, _gloffset_Vertex4d },
+ { "glVertex4dv", (GLvoid *) glVertex4dv, _gloffset_Vertex4dv },
+ { "glVertex4f", (GLvoid *) glVertex4f, _gloffset_Vertex4f },
+ { "glVertex4fv", (GLvoid *) glVertex4fv, _gloffset_Vertex4fv },
+ { "glVertex4i", (GLvoid *) glVertex4i, _gloffset_Vertex4i },
+ { "glVertex4iv", (GLvoid *) glVertex4iv, _gloffset_Vertex4iv },
+ { "glVertex4s", (GLvoid *) glVertex4s, _gloffset_Vertex4s },
+ { "glVertex4sv", (GLvoid *) glVertex4sv, _gloffset_Vertex4sv },
+ { "glClipPlane", (GLvoid *) glClipPlane, _gloffset_ClipPlane },
+ { "glColorMaterial", (GLvoid *) glColorMaterial, _gloffset_ColorMaterial },
+ { "glCullFace", (GLvoid *) glCullFace, _gloffset_CullFace },
+ { "glFogf", (GLvoid *) glFogf, _gloffset_Fogf },
+ { "glFogfv", (GLvoid *) glFogfv, _gloffset_Fogfv },
+ { "glFogi", (GLvoid *) glFogi, _gloffset_Fogi },
+ { "glFogiv", (GLvoid *) glFogiv, _gloffset_Fogiv },
+ { "glFrontFace", (GLvoid *) glFrontFace, _gloffset_FrontFace },
+ { "glHint", (GLvoid *) glHint, _gloffset_Hint },
+ { "glLightf", (GLvoid *) glLightf, _gloffset_Lightf },
+ { "glLightfv", (GLvoid *) glLightfv, _gloffset_Lightfv },
+ { "glLighti", (GLvoid *) glLighti, _gloffset_Lighti },
+ { "glLightiv", (GLvoid *) glLightiv, _gloffset_Lightiv },
+ { "glLightModelf", (GLvoid *) glLightModelf, _gloffset_LightModelf },
+ { "glLightModelfv", (GLvoid *) glLightModelfv, _gloffset_LightModelfv },
+ { "glLightModeli", (GLvoid *) glLightModeli, _gloffset_LightModeli },
+ { "glLightModeliv", (GLvoid *) glLightModeliv, _gloffset_LightModeliv },
+ { "glLineStipple", (GLvoid *) glLineStipple, _gloffset_LineStipple },
+ { "glLineWidth", (GLvoid *) glLineWidth, _gloffset_LineWidth },
+ { "glMaterialf", (GLvoid *) glMaterialf, _gloffset_Materialf },
+ { "glMaterialfv", (GLvoid *) glMaterialfv, _gloffset_Materialfv },
+ { "glMateriali", (GLvoid *) glMateriali, _gloffset_Materiali },
+ { "glMaterialiv", (GLvoid *) glMaterialiv, _gloffset_Materialiv },
+ { "glPointSize", (GLvoid *) glPointSize, _gloffset_PointSize },
+ { "glPolygonMode", (GLvoid *) glPolygonMode, _gloffset_PolygonMode },
+ { "glPolygonStipple", (GLvoid *) glPolygonStipple, _gloffset_PolygonStipple },
+ { "glScissor", (GLvoid *) glScissor, _gloffset_Scissor },
+ { "glShadeModel", (GLvoid *) glShadeModel, _gloffset_ShadeModel },
+ { "glTexParameterf", (GLvoid *) glTexParameterf, _gloffset_TexParameterf },
+ { "glTexParameterfv", (GLvoid *) glTexParameterfv, _gloffset_TexParameterfv },
+ { "glTexParameteri", (GLvoid *) glTexParameteri, _gloffset_TexParameteri },
+ { "glTexParameteriv", (GLvoid *) glTexParameteriv, _gloffset_TexParameteriv },
+ { "glTexImage1D", (GLvoid *) glTexImage1D, _gloffset_TexImage1D },
+ { "glTexImage2D", (GLvoid *) glTexImage2D, _gloffset_TexImage2D },
+ { "glTexEnvf", (GLvoid *) glTexEnvf, _gloffset_TexEnvf },
+ { "glTexEnvfv", (GLvoid *) glTexEnvfv, _gloffset_TexEnvfv },
+ { "glTexEnvi", (GLvoid *) glTexEnvi, _gloffset_TexEnvi },
+ { "glTexEnviv", (GLvoid *) glTexEnviv, _gloffset_TexEnviv },
+ { "glTexGend", (GLvoid *) glTexGend, _gloffset_TexGend },
+ { "glTexGendv", (GLvoid *) glTexGendv, _gloffset_TexGendv },
+ { "glTexGenf", (GLvoid *) glTexGenf, _gloffset_TexGenf },
+ { "glTexGenfv", (GLvoid *) glTexGenfv, _gloffset_TexGenfv },
+ { "glTexGeni", (GLvoid *) glTexGeni, _gloffset_TexGeni },
+ { "glTexGeniv", (GLvoid *) glTexGeniv, _gloffset_TexGeniv },
+ { "glFeedbackBuffer", (GLvoid *) glFeedbackBuffer, _gloffset_FeedbackBuffer },
+ { "glSelectBuffer", (GLvoid *) glSelectBuffer, _gloffset_SelectBuffer },
+ { "glRenderMode", (GLvoid *) glRenderMode, _gloffset_RenderMode },
+ { "glInitNames", (GLvoid *) glInitNames, _gloffset_InitNames },
+ { "glLoadName", (GLvoid *) glLoadName, _gloffset_LoadName },
+ { "glPassThrough", (GLvoid *) glPassThrough, _gloffset_PassThrough },
+ { "glPopName", (GLvoid *) glPopName, _gloffset_PopName },
+ { "glPushName", (GLvoid *) glPushName, _gloffset_PushName },
+ { "glDrawBuffer", (GLvoid *) glDrawBuffer, _gloffset_DrawBuffer },
+ { "glClear", (GLvoid *) glClear, _gloffset_Clear },
+ { "glClearAccum", (GLvoid *) glClearAccum, _gloffset_ClearAccum },
+ { "glClearIndex", (GLvoid *) glClearIndex, _gloffset_ClearIndex },
+ { "glClearColor", (GLvoid *) glClearColor, _gloffset_ClearColor },
+ { "glClearStencil", (GLvoid *) glClearStencil, _gloffset_ClearStencil },
+ { "glClearDepth", (GLvoid *) glClearDepth, _gloffset_ClearDepth },
+ { "glStencilMask", (GLvoid *) glStencilMask, _gloffset_StencilMask },
+ { "glColorMask", (GLvoid *) glColorMask, _gloffset_ColorMask },
+ { "glDepthMask", (GLvoid *) glDepthMask, _gloffset_DepthMask },
+ { "glIndexMask", (GLvoid *) glIndexMask, _gloffset_IndexMask },
+ { "glAccum", (GLvoid *) glAccum, _gloffset_Accum },
+ { "glDisable", (GLvoid *) glDisable, _gloffset_Disable },
+ { "glEnable", (GLvoid *) glEnable, _gloffset_Enable },
+ { "glFinish", (GLvoid *) glFinish, _gloffset_Finish },
+ { "glFlush", (GLvoid *) glFlush, _gloffset_Flush },
+ { "glPopAttrib", (GLvoid *) glPopAttrib, _gloffset_PopAttrib },
+ { "glPushAttrib", (GLvoid *) glPushAttrib, _gloffset_PushAttrib },
+ { "glMap1d", (GLvoid *) glMap1d, _gloffset_Map1d },
+ { "glMap1f", (GLvoid *) glMap1f, _gloffset_Map1f },
+ { "glMap2d", (GLvoid *) glMap2d, _gloffset_Map2d },
+ { "glMap2f", (GLvoid *) glMap2f, _gloffset_Map2f },
+ { "glMapGrid1d", (GLvoid *) glMapGrid1d, _gloffset_MapGrid1d },
+ { "glMapGrid1f", (GLvoid *) glMapGrid1f, _gloffset_MapGrid1f },
+ { "glMapGrid2d", (GLvoid *) glMapGrid2d, _gloffset_MapGrid2d },
+ { "glMapGrid2f", (GLvoid *) glMapGrid2f, _gloffset_MapGrid2f },
+ { "glEvalCoord1d", (GLvoid *) glEvalCoord1d, _gloffset_EvalCoord1d },
+ { "glEvalCoord1dv", (GLvoid *) glEvalCoord1dv, _gloffset_EvalCoord1dv },
+ { "glEvalCoord1f", (GLvoid *) glEvalCoord1f, _gloffset_EvalCoord1f },
+ { "glEvalCoord1fv", (GLvoid *) glEvalCoord1fv, _gloffset_EvalCoord1fv },
+ { "glEvalCoord2d", (GLvoid *) glEvalCoord2d, _gloffset_EvalCoord2d },
+ { "glEvalCoord2dv", (GLvoid *) glEvalCoord2dv, _gloffset_EvalCoord2dv },
+ { "glEvalCoord2f", (GLvoid *) glEvalCoord2f, _gloffset_EvalCoord2f },
+ { "glEvalCoord2fv", (GLvoid *) glEvalCoord2fv, _gloffset_EvalCoord2fv },
+ { "glEvalMesh1", (GLvoid *) glEvalMesh1, _gloffset_EvalMesh1 },
+ { "glEvalPoint1", (GLvoid *) glEvalPoint1, _gloffset_EvalPoint1 },
+ { "glEvalMesh2", (GLvoid *) glEvalMesh2, _gloffset_EvalMesh2 },
+ { "glEvalPoint2", (GLvoid *) glEvalPoint2, _gloffset_EvalPoint2 },
+ { "glAlphaFunc", (GLvoid *) glAlphaFunc, _gloffset_AlphaFunc },
+ { "glBlendFunc", (GLvoid *) glBlendFunc, _gloffset_BlendFunc },
+ { "glLogicOp", (GLvoid *) glLogicOp, _gloffset_LogicOp },
+ { "glStencilFunc", (GLvoid *) glStencilFunc, _gloffset_StencilFunc },
+ { "glStencilOp", (GLvoid *) glStencilOp, _gloffset_StencilOp },
+ { "glDepthFunc", (GLvoid *) glDepthFunc, _gloffset_DepthFunc },
+ { "glPixelZoom", (GLvoid *) glPixelZoom, _gloffset_PixelZoom },
+ { "glPixelTransferf", (GLvoid *) glPixelTransferf, _gloffset_PixelTransferf },
+ { "glPixelTransferi", (GLvoid *) glPixelTransferi, _gloffset_PixelTransferi },
+ { "glPixelStoref", (GLvoid *) glPixelStoref, _gloffset_PixelStoref },
+ { "glPixelStorei", (GLvoid *) glPixelStorei, _gloffset_PixelStorei },
+ { "glPixelMapfv", (GLvoid *) glPixelMapfv, _gloffset_PixelMapfv },
+ { "glPixelMapuiv", (GLvoid *) glPixelMapuiv, _gloffset_PixelMapuiv },
+ { "glPixelMapusv", (GLvoid *) glPixelMapusv, _gloffset_PixelMapusv },
+ { "glReadBuffer", (GLvoid *) glReadBuffer, _gloffset_ReadBuffer },
+ { "glCopyPixels", (GLvoid *) glCopyPixels, _gloffset_CopyPixels },
+ { "glReadPixels", (GLvoid *) glReadPixels, _gloffset_ReadPixels },
+ { "glDrawPixels", (GLvoid *) glDrawPixels, _gloffset_DrawPixels },
+ { "glGetBooleanv", (GLvoid *) glGetBooleanv, _gloffset_GetBooleanv },
+ { "glGetClipPlane", (GLvoid *) glGetClipPlane, _gloffset_GetClipPlane },
+ { "glGetDoublev", (GLvoid *) glGetDoublev, _gloffset_GetDoublev },
+ { "glGetError", (GLvoid *) glGetError, _gloffset_GetError },
+ { "glGetFloatv", (GLvoid *) glGetFloatv, _gloffset_GetFloatv },
+ { "glGetIntegerv", (GLvoid *) glGetIntegerv, _gloffset_GetIntegerv },
+ { "glGetLightfv", (GLvoid *) glGetLightfv, _gloffset_GetLightfv },
+ { "glGetLightiv", (GLvoid *) glGetLightiv, _gloffset_GetLightiv },
+ { "glGetMapdv", (GLvoid *) glGetMapdv, _gloffset_GetMapdv },
+ { "glGetMapfv", (GLvoid *) glGetMapfv, _gloffset_GetMapfv },
+ { "glGetMapiv", (GLvoid *) glGetMapiv, _gloffset_GetMapiv },
+ { "glGetMaterialfv", (GLvoid *) glGetMaterialfv, _gloffset_GetMaterialfv },
+ { "glGetMaterialiv", (GLvoid *) glGetMaterialiv, _gloffset_GetMaterialiv },
+ { "glGetPixelMapfv", (GLvoid *) glGetPixelMapfv, _gloffset_GetPixelMapfv },
+ { "glGetPixelMapuiv", (GLvoid *) glGetPixelMapuiv, _gloffset_GetPixelMapuiv },
+ { "glGetPixelMapusv", (GLvoid *) glGetPixelMapusv, _gloffset_GetPixelMapusv },
+ { "glGetPolygonStipple", (GLvoid *) glGetPolygonStipple, _gloffset_GetPolygonStipple },
+ { "glGetString", (GLvoid *) glGetString, _gloffset_GetString },
+ { "glGetTexEnvfv", (GLvoid *) glGetTexEnvfv, _gloffset_GetTexEnvfv },
+ { "glGetTexEnviv", (GLvoid *) glGetTexEnviv, _gloffset_GetTexEnviv },
+ { "glGetTexGendv", (GLvoid *) glGetTexGendv, _gloffset_GetTexGendv },
+ { "glGetTexGenfv", (GLvoid *) glGetTexGenfv, _gloffset_GetTexGenfv },
+ { "glGetTexGeniv", (GLvoid *) glGetTexGeniv, _gloffset_GetTexGeniv },
+ { "glGetTexImage", (GLvoid *) glGetTexImage, _gloffset_GetTexImage },
+ { "glGetTexParameterfv", (GLvoid *) glGetTexParameterfv, _gloffset_GetTexParameterfv },
+ { "glGetTexParameteriv", (GLvoid *) glGetTexParameteriv, _gloffset_GetTexParameteriv },
+ { "glGetTexLevelParameterfv", (GLvoid *) glGetTexLevelParameterfv, _gloffset_GetTexLevelParameterfv },
+ { "glGetTexLevelParameteriv", (GLvoid *) glGetTexLevelParameteriv, _gloffset_GetTexLevelParameteriv },
+ { "glIsEnabled", (GLvoid *) glIsEnabled, _gloffset_IsEnabled },
+ { "glIsList", (GLvoid *) glIsList, _gloffset_IsList },
+ { "glDepthRange", (GLvoid *) glDepthRange, _gloffset_DepthRange },
+ { "glFrustum", (GLvoid *) glFrustum, _gloffset_Frustum },
+ { "glLoadIdentity", (GLvoid *) glLoadIdentity, _gloffset_LoadIdentity },
+ { "glLoadMatrixf", (GLvoid *) glLoadMatrixf, _gloffset_LoadMatrixf },
+ { "glLoadMatrixd", (GLvoid *) glLoadMatrixd, _gloffset_LoadMatrixd },
+ { "glMatrixMode", (GLvoid *) glMatrixMode, _gloffset_MatrixMode },
+ { "glMultMatrixf", (GLvoid *) glMultMatrixf, _gloffset_MultMatrixf },
+ { "glMultMatrixd", (GLvoid *) glMultMatrixd, _gloffset_MultMatrixd },
+ { "glOrtho", (GLvoid *) glOrtho, _gloffset_Ortho },
+ { "glPopMatrix", (GLvoid *) glPopMatrix, _gloffset_PopMatrix },
+ { "glPushMatrix", (GLvoid *) glPushMatrix, _gloffset_PushMatrix },
+ { "glRotated", (GLvoid *) glRotated, _gloffset_Rotated },
+ { "glRotatef", (GLvoid *) glRotatef, _gloffset_Rotatef },
+ { "glScaled", (GLvoid *) glScaled, _gloffset_Scaled },
+ { "glScalef", (GLvoid *) glScalef, _gloffset_Scalef },
+ { "glTranslated", (GLvoid *) glTranslated, _gloffset_Translated },
+ { "glTranslatef", (GLvoid *) glTranslatef, _gloffset_Translatef },
+ { "glViewport", (GLvoid *) glViewport, _gloffset_Viewport },
+ { "glArrayElement", (GLvoid *) glArrayElement, _gloffset_ArrayElement },
+ { "glColorPointer", (GLvoid *) glColorPointer, _gloffset_ColorPointer },
+ { "glDisableClientState", (GLvoid *) glDisableClientState, _gloffset_DisableClientState },
+ { "glDrawArrays", (GLvoid *) glDrawArrays, _gloffset_DrawArrays },
+ { "glDrawElements", (GLvoid *) glDrawElements, _gloffset_DrawElements },
+ { "glEdgeFlagPointer", (GLvoid *) glEdgeFlagPointer, _gloffset_EdgeFlagPointer },
+ { "glEnableClientState", (GLvoid *) glEnableClientState, _gloffset_EnableClientState },
+ { "glGetPointerv", (GLvoid *) glGetPointerv, _gloffset_GetPointerv },
+ { "glIndexPointer", (GLvoid *) glIndexPointer, _gloffset_IndexPointer },
+ { "glInterleavedArrays", (GLvoid *) glInterleavedArrays, _gloffset_InterleavedArrays },
+ { "glNormalPointer", (GLvoid *) glNormalPointer, _gloffset_NormalPointer },
+ { "glTexCoordPointer", (GLvoid *) glTexCoordPointer, _gloffset_TexCoordPointer },
+ { "glVertexPointer", (GLvoid *) glVertexPointer, _gloffset_VertexPointer },
+ { "glPolygonOffset", (GLvoid *) glPolygonOffset, _gloffset_PolygonOffset },
+ { "glCopyTexImage1D", (GLvoid *) glCopyTexImage1D, _gloffset_CopyTexImage1D },
+ { "glCopyTexImage2D", (GLvoid *) glCopyTexImage2D, _gloffset_CopyTexImage2D },
+ { "glCopyTexSubImage1D", (GLvoid *) glCopyTexSubImage1D, _gloffset_CopyTexSubImage1D },
+ { "glCopyTexSubImage2D", (GLvoid *) glCopyTexSubImage2D, _gloffset_CopyTexSubImage2D },
+ { "glTexSubImage1D", (GLvoid *) glTexSubImage1D, _gloffset_TexSubImage1D },
+ { "glTexSubImage2D", (GLvoid *) glTexSubImage2D, _gloffset_TexSubImage2D },
+ { "glAreTexturesResident", (GLvoid *) glAreTexturesResident, _gloffset_AreTexturesResident },
+ { "glBindTexture", (GLvoid *) glBindTexture, _gloffset_BindTexture },
+ { "glDeleteTextures", (GLvoid *) glDeleteTextures, _gloffset_DeleteTextures },
+ { "glGenTextures", (GLvoid *) glGenTextures, _gloffset_GenTextures },
+ { "glIsTexture", (GLvoid *) glIsTexture, _gloffset_IsTexture },
+ { "glPrioritizeTextures", (GLvoid *) glPrioritizeTextures, _gloffset_PrioritizeTextures },
+ { "glIndexub", (GLvoid *) glIndexub, _gloffset_Indexub },
+ { "glIndexubv", (GLvoid *) glIndexubv, _gloffset_Indexubv },
+ { "glPopClientAttrib", (GLvoid *) glPopClientAttrib, _gloffset_PopClientAttrib },
+ { "glPushClientAttrib", (GLvoid *) glPushClientAttrib, _gloffset_PushClientAttrib },
+ { "glBlendColor", (GLvoid *) glBlendColor, _gloffset_BlendColor },
+ { "glBlendEquation", (GLvoid *) glBlendEquation, _gloffset_BlendEquation },
+ { "glDrawRangeElements", (GLvoid *) glDrawRangeElements, _gloffset_DrawRangeElements },
+ { "glColorTable", (GLvoid *) glColorTable, _gloffset_ColorTable },
+ { "glColorTableParameterfv", (GLvoid *) glColorTableParameterfv, _gloffset_ColorTableParameterfv },
+ { "glColorTableParameteriv", (GLvoid *) glColorTableParameteriv, _gloffset_ColorTableParameteriv },
+ { "glCopyColorTable", (GLvoid *) glCopyColorTable, _gloffset_CopyColorTable },
+ { "glGetColorTable", (GLvoid *) glGetColorTable, _gloffset_GetColorTable },
+ { "glGetColorTableParameterfv", (GLvoid *) glGetColorTableParameterfv, _gloffset_GetColorTableParameterfv },
+ { "glGetColorTableParameteriv", (GLvoid *) glGetColorTableParameteriv, _gloffset_GetColorTableParameteriv },
+ { "glColorSubTable", (GLvoid *) glColorSubTable, _gloffset_ColorSubTable },
+ { "glCopyColorSubTable", (GLvoid *) glCopyColorSubTable, _gloffset_CopyColorSubTable },
+ { "glConvolutionFilter1D", (GLvoid *) glConvolutionFilter1D, _gloffset_ConvolutionFilter1D },
+ { "glConvolutionFilter2D", (GLvoid *) glConvolutionFilter2D, _gloffset_ConvolutionFilter2D },
+ { "glConvolutionParameterf", (GLvoid *) glConvolutionParameterf, _gloffset_ConvolutionParameterf },
+ { "glConvolutionParameterfv", (GLvoid *) glConvolutionParameterfv, _gloffset_ConvolutionParameterfv },
+ { "glConvolutionParameteri", (GLvoid *) glConvolutionParameteri, _gloffset_ConvolutionParameteri },
+ { "glConvolutionParameteriv", (GLvoid *) glConvolutionParameteriv, _gloffset_ConvolutionParameteriv },
+ { "glCopyConvolutionFilter1D", (GLvoid *) glCopyConvolutionFilter1D, _gloffset_CopyConvolutionFilter1D },
+ { "glCopyConvolutionFilter2D", (GLvoid *) glCopyConvolutionFilter2D, _gloffset_CopyConvolutionFilter2D },
+ { "glGetConvolutionFilter", (GLvoid *) glGetConvolutionFilter, _gloffset_GetConvolutionFilter },
+ { "glGetConvolutionParameterfv", (GLvoid *) glGetConvolutionParameterfv, _gloffset_GetConvolutionParameterfv },
+ { "glGetConvolutionParameteriv", (GLvoid *) glGetConvolutionParameteriv, _gloffset_GetConvolutionParameteriv },
+ { "glGetSeparableFilter", (GLvoid *) glGetSeparableFilter, _gloffset_GetSeparableFilter },
+ { "glSeparableFilter2D", (GLvoid *) glSeparableFilter2D, _gloffset_SeparableFilter2D },
+ { "glGetHistogram", (GLvoid *) glGetHistogram, _gloffset_GetHistogram },
+ { "glGetHistogramParameterfv", (GLvoid *) glGetHistogramParameterfv, _gloffset_GetHistogramParameterfv },
+ { "glGetHistogramParameteriv", (GLvoid *) glGetHistogramParameteriv, _gloffset_GetHistogramParameteriv },
+ { "glGetMinmax", (GLvoid *) glGetMinmax, _gloffset_GetMinmax },
+ { "glGetMinmaxParameterfv", (GLvoid *) glGetMinmaxParameterfv, _gloffset_GetMinmaxParameterfv },
+ { "glGetMinmaxParameteriv", (GLvoid *) glGetMinmaxParameteriv, _gloffset_GetMinmaxParameteriv },
+ { "glHistogram", (GLvoid *) glHistogram, _gloffset_Histogram },
+ { "glMinmax", (GLvoid *) glMinmax, _gloffset_Minmax },
+ { "glResetHistogram", (GLvoid *) glResetHistogram, _gloffset_ResetHistogram },
+ { "glResetMinmax", (GLvoid *) glResetMinmax, _gloffset_ResetMinmax },
+ { "glTexImage3D", (GLvoid *) glTexImage3D, _gloffset_TexImage3D },
+ { "glTexSubImage3D", (GLvoid *) glTexSubImage3D, _gloffset_TexSubImage3D },
+ { "glCopyTexSubImage3D", (GLvoid *) glCopyTexSubImage3D, _gloffset_CopyTexSubImage3D },
+ { "glActiveTextureARB", (GLvoid *) glActiveTextureARB, _gloffset_ActiveTextureARB },
+ { "glClientActiveTextureARB", (GLvoid *) glClientActiveTextureARB, _gloffset_ClientActiveTextureARB },
+ { "glMultiTexCoord1dARB", (GLvoid *) glMultiTexCoord1dARB, _gloffset_MultiTexCoord1dARB },
+ { "glMultiTexCoord1dvARB", (GLvoid *) glMultiTexCoord1dvARB, _gloffset_MultiTexCoord1dvARB },
+ { "glMultiTexCoord1fARB", (GLvoid *) glMultiTexCoord1fARB, _gloffset_MultiTexCoord1fARB },
+ { "glMultiTexCoord1fvARB", (GLvoid *) glMultiTexCoord1fvARB, _gloffset_MultiTexCoord1fvARB },
+ { "glMultiTexCoord1iARB", (GLvoid *) glMultiTexCoord1iARB, _gloffset_MultiTexCoord1iARB },
+ { "glMultiTexCoord1ivARB", (GLvoid *) glMultiTexCoord1ivARB, _gloffset_MultiTexCoord1ivARB },
+ { "glMultiTexCoord1sARB", (GLvoid *) glMultiTexCoord1sARB, _gloffset_MultiTexCoord1sARB },
+ { "glMultiTexCoord1svARB", (GLvoid *) glMultiTexCoord1svARB, _gloffset_MultiTexCoord1svARB },
+ { "glMultiTexCoord2dARB", (GLvoid *) glMultiTexCoord2dARB, _gloffset_MultiTexCoord2dARB },
+ { "glMultiTexCoord2dvARB", (GLvoid *) glMultiTexCoord2dvARB, _gloffset_MultiTexCoord2dvARB },
+ { "glMultiTexCoord2fARB", (GLvoid *) glMultiTexCoord2fARB, _gloffset_MultiTexCoord2fARB },
+ { "glMultiTexCoord2fvARB", (GLvoid *) glMultiTexCoord2fvARB, _gloffset_MultiTexCoord2fvARB },
+ { "glMultiTexCoord2iARB", (GLvoid *) glMultiTexCoord2iARB, _gloffset_MultiTexCoord2iARB },
+ { "glMultiTexCoord2ivARB", (GLvoid *) glMultiTexCoord2ivARB, _gloffset_MultiTexCoord2ivARB },
+ { "glMultiTexCoord2sARB", (GLvoid *) glMultiTexCoord2sARB, _gloffset_MultiTexCoord2sARB },
+ { "glMultiTexCoord2svARB", (GLvoid *) glMultiTexCoord2svARB, _gloffset_MultiTexCoord2svARB },
+ { "glMultiTexCoord3dARB", (GLvoid *) glMultiTexCoord3dARB, _gloffset_MultiTexCoord3dARB },
+ { "glMultiTexCoord3dvARB", (GLvoid *) glMultiTexCoord3dvARB, _gloffset_MultiTexCoord3dvARB },
+ { "glMultiTexCoord3fARB", (GLvoid *) glMultiTexCoord3fARB, _gloffset_MultiTexCoord3fARB },
+ { "glMultiTexCoord3fvARB", (GLvoid *) glMultiTexCoord3fvARB, _gloffset_MultiTexCoord3fvARB },
+ { "glMultiTexCoord3iARB", (GLvoid *) glMultiTexCoord3iARB, _gloffset_MultiTexCoord3iARB },
+ { "glMultiTexCoord3ivARB", (GLvoid *) glMultiTexCoord3ivARB, _gloffset_MultiTexCoord3ivARB },
+ { "glMultiTexCoord3sARB", (GLvoid *) glMultiTexCoord3sARB, _gloffset_MultiTexCoord3sARB },
+ { "glMultiTexCoord3svARB", (GLvoid *) glMultiTexCoord3svARB, _gloffset_MultiTexCoord3svARB },
+ { "glMultiTexCoord4dARB", (GLvoid *) glMultiTexCoord4dARB, _gloffset_MultiTexCoord4dARB },
+ { "glMultiTexCoord4dvARB", (GLvoid *) glMultiTexCoord4dvARB, _gloffset_MultiTexCoord4dvARB },
+ { "glMultiTexCoord4fARB", (GLvoid *) glMultiTexCoord4fARB, _gloffset_MultiTexCoord4fARB },
+ { "glMultiTexCoord4fvARB", (GLvoid *) glMultiTexCoord4fvARB, _gloffset_MultiTexCoord4fvARB },
+ { "glMultiTexCoord4iARB", (GLvoid *) glMultiTexCoord4iARB, _gloffset_MultiTexCoord4iARB },
+ { "glMultiTexCoord4ivARB", (GLvoid *) glMultiTexCoord4ivARB, _gloffset_MultiTexCoord4ivARB },
+ { "glMultiTexCoord4sARB", (GLvoid *) glMultiTexCoord4sARB, _gloffset_MultiTexCoord4sARB },
+ { "glMultiTexCoord4svARB", (GLvoid *) glMultiTexCoord4svARB, _gloffset_MultiTexCoord4svARB },
+ { "glLoadTransposeMatrixfARB", (GLvoid *) glLoadTransposeMatrixfARB, _gloffset_LoadTransposeMatrixfARB },
+ { "glLoadTransposeMatrixdARB", (GLvoid *) glLoadTransposeMatrixdARB, _gloffset_LoadTransposeMatrixdARB },
+ { "glMultTransposeMatrixfARB", (GLvoid *) glMultTransposeMatrixfARB, _gloffset_MultTransposeMatrixfARB },
+ { "glMultTransposeMatrixdARB", (GLvoid *) glMultTransposeMatrixdARB, _gloffset_MultTransposeMatrixdARB },
+ { "glSampleCoverageARB", (GLvoid *) glSampleCoverageARB, _gloffset_SampleCoverageARB },
+ { "glCompressedTexImage3DARB", (GLvoid *) glCompressedTexImage3DARB, _gloffset_CompressedTexImage3DARB },
+ { "glCompressedTexImage2DARB", (GLvoid *) glCompressedTexImage2DARB, _gloffset_CompressedTexImage2DARB },
+ { "glCompressedTexImage1DARB", (GLvoid *) glCompressedTexImage1DARB, _gloffset_CompressedTexImage1DARB },
+ { "glCompressedTexSubImage3DARB", (GLvoid *) glCompressedTexSubImage3DARB, _gloffset_CompressedTexSubImage3DARB },
+ { "glCompressedTexSubImage2DARB", (GLvoid *) glCompressedTexSubImage2DARB, _gloffset_CompressedTexSubImage2DARB },
+ { "glCompressedTexSubImage1DARB", (GLvoid *) glCompressedTexSubImage1DARB, _gloffset_CompressedTexSubImage1DARB },
+ { "glGetCompressedTexImageARB", (GLvoid *) glGetCompressedTexImageARB, _gloffset_GetCompressedTexImageARB },
+ { "glActiveTexture", (GLvoid *) glActiveTexture, _gloffset_ActiveTextureARB },
+ { "glClientActiveTexture", (GLvoid *) glClientActiveTexture, _gloffset_ClientActiveTextureARB },
+ { "glMultiTexCoord1d", (GLvoid *) glMultiTexCoord1d, _gloffset_MultiTexCoord1dARB },
+ { "glMultiTexCoord1dv", (GLvoid *) glMultiTexCoord1dv, _gloffset_MultiTexCoord1dvARB },
+ { "glMultiTexCoord1f", (GLvoid *) glMultiTexCoord1f, _gloffset_MultiTexCoord1fARB },
+ { "glMultiTexCoord1fv", (GLvoid *) glMultiTexCoord1fv, _gloffset_MultiTexCoord1fvARB },
+ { "glMultiTexCoord1i", (GLvoid *) glMultiTexCoord1i, _gloffset_MultiTexCoord1iARB },
+ { "glMultiTexCoord1iv", (GLvoid *) glMultiTexCoord1iv, _gloffset_MultiTexCoord1ivARB },
+ { "glMultiTexCoord1s", (GLvoid *) glMultiTexCoord1s, _gloffset_MultiTexCoord1sARB },
+ { "glMultiTexCoord1sv", (GLvoid *) glMultiTexCoord1sv, _gloffset_MultiTexCoord1svARB },
+ { "glMultiTexCoord2d", (GLvoid *) glMultiTexCoord2d, _gloffset_MultiTexCoord2dARB },
+ { "glMultiTexCoord2dv", (GLvoid *) glMultiTexCoord2dv, _gloffset_MultiTexCoord2dvARB },
+ { "glMultiTexCoord2f", (GLvoid *) glMultiTexCoord2f, _gloffset_MultiTexCoord2fARB },
+ { "glMultiTexCoord2fv", (GLvoid *) glMultiTexCoord2fv, _gloffset_MultiTexCoord2fvARB },
+ { "glMultiTexCoord2i", (GLvoid *) glMultiTexCoord2i, _gloffset_MultiTexCoord2iARB },
+ { "glMultiTexCoord2iv", (GLvoid *) glMultiTexCoord2iv, _gloffset_MultiTexCoord2ivARB },
+ { "glMultiTexCoord2s", (GLvoid *) glMultiTexCoord2s, _gloffset_MultiTexCoord2sARB },
+ { "glMultiTexCoord2sv", (GLvoid *) glMultiTexCoord2sv, _gloffset_MultiTexCoord2svARB },
+ { "glMultiTexCoord3d", (GLvoid *) glMultiTexCoord3d, _gloffset_MultiTexCoord3dARB },
+ { "glMultiTexCoord3dv", (GLvoid *) glMultiTexCoord3dv, _gloffset_MultiTexCoord3dvARB },
+ { "glMultiTexCoord3f", (GLvoid *) glMultiTexCoord3f, _gloffset_MultiTexCoord3fARB },
+ { "glMultiTexCoord3fv", (GLvoid *) glMultiTexCoord3fv, _gloffset_MultiTexCoord3fvARB },
+ { "glMultiTexCoord3i", (GLvoid *) glMultiTexCoord3i, _gloffset_MultiTexCoord3iARB },
+ { "glMultiTexCoord3iv", (GLvoid *) glMultiTexCoord3iv, _gloffset_MultiTexCoord3ivARB },
+ { "glMultiTexCoord3s", (GLvoid *) glMultiTexCoord3s, _gloffset_MultiTexCoord3sARB },
+ { "glMultiTexCoord3sv", (GLvoid *) glMultiTexCoord3sv, _gloffset_MultiTexCoord3svARB },
+ { "glMultiTexCoord4d", (GLvoid *) glMultiTexCoord4d, _gloffset_MultiTexCoord4dARB },
+ { "glMultiTexCoord4dv", (GLvoid *) glMultiTexCoord4dv, _gloffset_MultiTexCoord4dvARB },
+ { "glMultiTexCoord4f", (GLvoid *) glMultiTexCoord4f, _gloffset_MultiTexCoord4fARB },
+ { "glMultiTexCoord4fv", (GLvoid *) glMultiTexCoord4fv, _gloffset_MultiTexCoord4fvARB },
+ { "glMultiTexCoord4i", (GLvoid *) glMultiTexCoord4i, _gloffset_MultiTexCoord4iARB },
+ { "glMultiTexCoord4iv", (GLvoid *) glMultiTexCoord4iv, _gloffset_MultiTexCoord4ivARB },
+ { "glMultiTexCoord4s", (GLvoid *) glMultiTexCoord4s, _gloffset_MultiTexCoord4sARB },
+ { "glMultiTexCoord4sv", (GLvoid *) glMultiTexCoord4sv, _gloffset_MultiTexCoord4svARB },
+ { "glLoadTransposeMatrixf", (GLvoid *) glLoadTransposeMatrixf, _gloffset_LoadTransposeMatrixfARB },
+ { "glLoadTransposeMatrixd", (GLvoid *) glLoadTransposeMatrixd, _gloffset_LoadTransposeMatrixdARB },
+ { "glMultTransposeMatrixf", (GLvoid *) glMultTransposeMatrixf, _gloffset_MultTransposeMatrixfARB },
+ { "glMultTransposeMatrixd", (GLvoid *) glMultTransposeMatrixd, _gloffset_MultTransposeMatrixdARB },
+ { "glSampleCoverage", (GLvoid *) glSampleCoverage, _gloffset_SampleCoverageARB },
+ { "glCompressedTexImage3D", (GLvoid *) glCompressedTexImage3D, _gloffset_CompressedTexImage3DARB },
+ { "glCompressedTexImage2D", (GLvoid *) glCompressedTexImage2D, _gloffset_CompressedTexImage2DARB },
+ { "glCompressedTexImage1D", (GLvoid *) glCompressedTexImage1D, _gloffset_CompressedTexImage1DARB },
+ { "glCompressedTexSubImage3D", (GLvoid *) glCompressedTexSubImage3D, _gloffset_CompressedTexSubImage3DARB },
+ { "glCompressedTexSubImage2D", (GLvoid *) glCompressedTexSubImage2D, _gloffset_CompressedTexSubImage2DARB },
+ { "glCompressedTexSubImage1D", (GLvoid *) glCompressedTexSubImage1D, _gloffset_CompressedTexSubImage1DARB },
+ { "glGetCompressedTexImage", (GLvoid *) glGetCompressedTexImage, _gloffset_GetCompressedTexImageARB },
+ { "glBlendColorEXT", (GLvoid *) glBlendColorEXT, _gloffset_BlendColor },
+ { "glPolygonOffsetEXT", (GLvoid *) glPolygonOffsetEXT, _gloffset_PolygonOffsetEXT },
+ { "glTexImage3DEXT", (GLvoid *) glTexImage3DEXT, _gloffset_TexImage3D },
+ { "glTexSubImage3DEXT", (GLvoid *) glTexSubImage3DEXT, _gloffset_TexSubImage3D },
+ { "glGetTexFilterFuncSGIS", (GLvoid *) glGetTexFilterFuncSGIS, _gloffset_GetTexFilterFuncSGIS },
+ { "glTexFilterFuncSGIS", (GLvoid *) glTexFilterFuncSGIS, _gloffset_TexFilterFuncSGIS },
+ { "glTexSubImage1DEXT", (GLvoid *) glTexSubImage1DEXT, _gloffset_TexSubImage1D },
+ { "glTexSubImage2DEXT", (GLvoid *) glTexSubImage2DEXT, _gloffset_TexSubImage2D },
+ { "glCopyTexImage1DEXT", (GLvoid *) glCopyTexImage1DEXT, _gloffset_CopyTexImage1D },
+ { "glCopyTexImage2DEXT", (GLvoid *) glCopyTexImage2DEXT, _gloffset_CopyTexImage2D },
+ { "glCopyTexSubImage1DEXT", (GLvoid *) glCopyTexSubImage1DEXT, _gloffset_CopyTexSubImage1D },
+ { "glCopyTexSubImage2DEXT", (GLvoid *) glCopyTexSubImage2DEXT, _gloffset_CopyTexSubImage2D },
+ { "glCopyTexSubImage3DEXT", (GLvoid *) glCopyTexSubImage3DEXT, _gloffset_CopyTexSubImage3D },
+ { "glGetHistogramEXT", (GLvoid *) glGetHistogramEXT, _gloffset_GetHistogramEXT },
+ { "glGetHistogramParameterfvEXT", (GLvoid *) glGetHistogramParameterfvEXT, _gloffset_GetHistogramParameterfvEXT },
+ { "glGetHistogramParameterivEXT", (GLvoid *) glGetHistogramParameterivEXT, _gloffset_GetHistogramParameterivEXT },
+ { "glGetMinmaxEXT", (GLvoid *) glGetMinmaxEXT, _gloffset_GetMinmaxEXT },
+ { "glGetMinmaxParameterfvEXT", (GLvoid *) glGetMinmaxParameterfvEXT, _gloffset_GetMinmaxParameterfvEXT },
+ { "glGetMinmaxParameterivEXT", (GLvoid *) glGetMinmaxParameterivEXT, _gloffset_GetMinmaxParameterivEXT },
+ { "glHistogramEXT", (GLvoid *) glHistogramEXT, _gloffset_Histogram },
+ { "glMinmaxEXT", (GLvoid *) glMinmaxEXT, _gloffset_Minmax },
+ { "glResetHistogramEXT", (GLvoid *) glResetHistogramEXT, _gloffset_ResetHistogram },
+ { "glResetMinmaxEXT", (GLvoid *) glResetMinmaxEXT, _gloffset_ResetMinmax },
+ { "glConvolutionFilter1DEXT", (GLvoid *) glConvolutionFilter1DEXT, _gloffset_ConvolutionFilter1D },
+ { "glConvolutionFilter2DEXT", (GLvoid *) glConvolutionFilter2DEXT, _gloffset_ConvolutionFilter2D },
+ { "glConvolutionParameterfEXT", (GLvoid *) glConvolutionParameterfEXT, _gloffset_ConvolutionParameterf },
+ { "glConvolutionParameterfvEXT", (GLvoid *) glConvolutionParameterfvEXT, _gloffset_ConvolutionParameterfv },
+ { "glConvolutionParameteriEXT", (GLvoid *) glConvolutionParameteriEXT, _gloffset_ConvolutionParameteri },
+ { "glConvolutionParameterivEXT", (GLvoid *) glConvolutionParameterivEXT, _gloffset_ConvolutionParameteriv },
+ { "glCopyConvolutionFilter1DEXT", (GLvoid *) glCopyConvolutionFilter1DEXT, _gloffset_CopyConvolutionFilter1D },
+ { "glCopyConvolutionFilter2DEXT", (GLvoid *) glCopyConvolutionFilter2DEXT, _gloffset_CopyConvolutionFilter2D },
+ { "glGetConvolutionFilterEXT", (GLvoid *) glGetConvolutionFilterEXT, _gloffset_GetConvolutionFilterEXT },
+ { "glGetConvolutionParameterfvEXT", (GLvoid *) glGetConvolutionParameterfvEXT, _gloffset_GetConvolutionParameterfvEXT },
+ { "glGetConvolutionParameterivEXT", (GLvoid *) glGetConvolutionParameterivEXT, _gloffset_GetConvolutionParameterivEXT },
+ { "glGetSeparableFilterEXT", (GLvoid *) glGetSeparableFilterEXT, _gloffset_GetSeparableFilterEXT },
+ { "glSeparableFilter2DEXT", (GLvoid *) glSeparableFilter2DEXT, _gloffset_SeparableFilter2D },
+ { "glColorTableSGI", (GLvoid *) glColorTableSGI, _gloffset_ColorTable },
+ { "glColorTableParameterfvSGI", (GLvoid *) glColorTableParameterfvSGI, _gloffset_ColorTableParameterfv },
+ { "glColorTableParameterivSGI", (GLvoid *) glColorTableParameterivSGI, _gloffset_ColorTableParameteriv },
+ { "glCopyColorTableSGI", (GLvoid *) glCopyColorTableSGI, _gloffset_CopyColorTable },
+ { "glGetColorTableSGI", (GLvoid *) glGetColorTableSGI, _gloffset_GetColorTableSGI },
+ { "glGetColorTableParameterfvSGI", (GLvoid *) glGetColorTableParameterfvSGI, _gloffset_GetColorTableParameterfvSGI },
+ { "glGetColorTableParameterivSGI", (GLvoid *) glGetColorTableParameterivSGI, _gloffset_GetColorTableParameterivSGI },
+ { "glPixelTexGenSGIX", (GLvoid *) glPixelTexGenSGIX, _gloffset_PixelTexGenSGIX },
+ { "glPixelTexGenParameteriSGIS", (GLvoid *) glPixelTexGenParameteriSGIS, _gloffset_PixelTexGenParameteriSGIS },
+ { "glPixelTexGenParameterivSGIS", (GLvoid *) glPixelTexGenParameterivSGIS, _gloffset_PixelTexGenParameterivSGIS },
+ { "glPixelTexGenParameterfSGIS", (GLvoid *) glPixelTexGenParameterfSGIS, _gloffset_PixelTexGenParameterfSGIS },
+ { "glPixelTexGenParameterfvSGIS", (GLvoid *) glPixelTexGenParameterfvSGIS, _gloffset_PixelTexGenParameterfvSGIS },
+ { "glGetPixelTexGenParameterivSGIS", (GLvoid *) glGetPixelTexGenParameterivSGIS, _gloffset_GetPixelTexGenParameterivSGIS },
+ { "glGetPixelTexGenParameterfvSGIS", (GLvoid *) glGetPixelTexGenParameterfvSGIS, _gloffset_GetPixelTexGenParameterfvSGIS },
+ { "glTexImage4DSGIS", (GLvoid *) glTexImage4DSGIS, _gloffset_TexImage4DSGIS },
+ { "glTexSubImage4DSGIS", (GLvoid *) glTexSubImage4DSGIS, _gloffset_TexSubImage4DSGIS },
+ { "glAreTexturesResidentEXT", (GLvoid *) glAreTexturesResidentEXT, _gloffset_AreTexturesResidentEXT },
+ { "glBindTextureEXT", (GLvoid *) glBindTextureEXT, _gloffset_BindTexture },
+ { "glDeleteTexturesEXT", (GLvoid *) glDeleteTexturesEXT, _gloffset_DeleteTextures },
+ { "glGenTexturesEXT", (GLvoid *) glGenTexturesEXT, _gloffset_GenTexturesEXT },
+ { "glIsTextureEXT", (GLvoid *) glIsTextureEXT, _gloffset_IsTextureEXT },
+ { "glPrioritizeTexturesEXT", (GLvoid *) glPrioritizeTexturesEXT, _gloffset_PrioritizeTextures },
+ { "glDetailTexFuncSGIS", (GLvoid *) glDetailTexFuncSGIS, _gloffset_DetailTexFuncSGIS },
+ { "glGetDetailTexFuncSGIS", (GLvoid *) glGetDetailTexFuncSGIS, _gloffset_GetDetailTexFuncSGIS },
+ { "glSharpenTexFuncSGIS", (GLvoid *) glSharpenTexFuncSGIS, _gloffset_SharpenTexFuncSGIS },
+ { "glGetSharpenTexFuncSGIS", (GLvoid *) glGetSharpenTexFuncSGIS, _gloffset_GetSharpenTexFuncSGIS },
+ { "glSampleMaskSGIS", (GLvoid *) glSampleMaskSGIS, _gloffset_SampleMaskSGIS },
+ { "glSamplePatternSGIS", (GLvoid *) glSamplePatternSGIS, _gloffset_SamplePatternSGIS },
+ { "glArrayElementEXT", (GLvoid *) glArrayElementEXT, _gloffset_ArrayElement },
+ { "glColorPointerEXT", (GLvoid *) glColorPointerEXT, _gloffset_ColorPointerEXT },
+ { "glDrawArraysEXT", (GLvoid *) glDrawArraysEXT, _gloffset_DrawArrays },
+ { "glEdgeFlagPointerEXT", (GLvoid *) glEdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT },
+ { "glGetPointervEXT", (GLvoid *) glGetPointervEXT, _gloffset_GetPointerv },
+ { "glIndexPointerEXT", (GLvoid *) glIndexPointerEXT, _gloffset_IndexPointerEXT },
+ { "glNormalPointerEXT", (GLvoid *) glNormalPointerEXT, _gloffset_NormalPointerEXT },
+ { "glTexCoordPointerEXT", (GLvoid *) glTexCoordPointerEXT, _gloffset_TexCoordPointerEXT },
+ { "glVertexPointerEXT", (GLvoid *) glVertexPointerEXT, _gloffset_VertexPointerEXT },
+ { "glBlendEquationEXT", (GLvoid *) glBlendEquationEXT, _gloffset_BlendEquation },
+ { "glSpriteParameterfSGIX", (GLvoid *) glSpriteParameterfSGIX, _gloffset_SpriteParameterfSGIX },
+ { "glSpriteParameterfvSGIX", (GLvoid *) glSpriteParameterfvSGIX, _gloffset_SpriteParameterfvSGIX },
+ { "glSpriteParameteriSGIX", (GLvoid *) glSpriteParameteriSGIX, _gloffset_SpriteParameteriSGIX },
+ { "glSpriteParameterivSGIX", (GLvoid *) glSpriteParameterivSGIX, _gloffset_SpriteParameterivSGIX },
+ { "glPointParameterfEXT", (GLvoid *) glPointParameterfEXT, _gloffset_PointParameterfEXT },
+ { "glPointParameterfvEXT", (GLvoid *) glPointParameterfvEXT, _gloffset_PointParameterfvEXT },
+ { "glPointParameterfARB", (GLvoid *) glPointParameterfARB, _gloffset_PointParameterfEXT },
+ { "glPointParameterfvARB", (GLvoid *) glPointParameterfvARB, _gloffset_PointParameterfvEXT },
+ { "glPointParameterfSGIS", (GLvoid *) glPointParameterfSGIS, _gloffset_PointParameterfEXT },
+ { "glPointParameterfvSGIS", (GLvoid *) glPointParameterfvSGIS, _gloffset_PointParameterfvEXT },
+ { "glGetInstrumentsSGIX", (GLvoid *) glGetInstrumentsSGIX, _gloffset_GetInstrumentsSGIX },
+ { "glInstrumentsBufferSGIX", (GLvoid *) glInstrumentsBufferSGIX, _gloffset_InstrumentsBufferSGIX },
+ { "glPollInstrumentsSGIX", (GLvoid *) glPollInstrumentsSGIX, _gloffset_PollInstrumentsSGIX },
+ { "glReadInstrumentsSGIX", (GLvoid *) glReadInstrumentsSGIX, _gloffset_ReadInstrumentsSGIX },
+ { "glStartInstrumentsSGIX", (GLvoid *) glStartInstrumentsSGIX, _gloffset_StartInstrumentsSGIX },
+ { "glStopInstrumentsSGIX", (GLvoid *) glStopInstrumentsSGIX, _gloffset_StopInstrumentsSGIX },
+ { "glFrameZoomSGIX", (GLvoid *) glFrameZoomSGIX, _gloffset_FrameZoomSGIX },
+ { "glTagSampleBufferSGIX", (GLvoid *) glTagSampleBufferSGIX, _gloffset_TagSampleBufferSGIX },
+ { "glReferencePlaneSGIX", (GLvoid *) glReferencePlaneSGIX, _gloffset_ReferencePlaneSGIX },
+ { "glFlushRasterSGIX", (GLvoid *) glFlushRasterSGIX, _gloffset_FlushRasterSGIX },
+ { "glColorSubTableEXT", (GLvoid *) glColorSubTableEXT, _gloffset_ColorSubTable },
+ { "glCopyColorSubTableEXT", (GLvoid *) glCopyColorSubTableEXT, _gloffset_CopyColorSubTable },
+ { "glHintPGI", (GLvoid *) glHintPGI, _gloffset_HintPGI },
+ { "glColorTableEXT", (GLvoid *) glColorTableEXT, _gloffset_ColorTable },
+ { "glGetColorTableEXT", (GLvoid *) glGetColorTableEXT, _gloffset_GetColorTableEXT },
+ { "glGetColorTableParameterivEXT", (GLvoid *) glGetColorTableParameterivEXT, _gloffset_GetColorTableParameterivEXT },
+ { "glGetColorTableParameterfvEXT", (GLvoid *) glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfvEXT },
+ { "glGetListParameterfvSGIX", (GLvoid *) glGetListParameterfvSGIX, _gloffset_GetListParameterfvSGIX },
+ { "glGetListParameterivSGIX", (GLvoid *) glGetListParameterivSGIX, _gloffset_GetListParameterivSGIX },
+ { "glListParameterfSGIX", (GLvoid *) glListParameterfSGIX, _gloffset_ListParameterfSGIX },
+ { "glListParameterfvSGIX", (GLvoid *) glListParameterfvSGIX, _gloffset_ListParameterfvSGIX },
+ { "glListParameteriSGIX", (GLvoid *) glListParameteriSGIX, _gloffset_ListParameteriSGIX },
+ { "glListParameterivSGIX", (GLvoid *) glListParameterivSGIX, _gloffset_ListParameterivSGIX },
+ { "glIndexMaterialEXT", (GLvoid *) glIndexMaterialEXT, _gloffset_IndexMaterialEXT },
+ { "glIndexFuncEXT", (GLvoid *) glIndexFuncEXT, _gloffset_IndexFuncEXT },
+ { "glLockArraysEXT", (GLvoid *) glLockArraysEXT, _gloffset_LockArraysEXT },
+ { "glUnlockArraysEXT", (GLvoid *) glUnlockArraysEXT, _gloffset_UnlockArraysEXT },
+ { "glCullParameterdvEXT", (GLvoid *) glCullParameterdvEXT, _gloffset_CullParameterdvEXT },
+ { "glCullParameterfvEXT", (GLvoid *) glCullParameterfvEXT, _gloffset_CullParameterfvEXT },
+ { "glFragmentColorMaterialSGIX", (GLvoid *) glFragmentColorMaterialSGIX, _gloffset_FragmentColorMaterialSGIX },
+ { "glFragmentLightfSGIX", (GLvoid *) glFragmentLightfSGIX, _gloffset_FragmentLightfSGIX },
+ { "glFragmentLightfvSGIX", (GLvoid *) glFragmentLightfvSGIX, _gloffset_FragmentLightfvSGIX },
+ { "glFragmentLightiSGIX", (GLvoid *) glFragmentLightiSGIX, _gloffset_FragmentLightiSGIX },
+ { "glFragmentLightivSGIX", (GLvoid *) glFragmentLightivSGIX, _gloffset_FragmentLightivSGIX },
+ { "glFragmentLightModelfSGIX", (GLvoid *) glFragmentLightModelfSGIX, _gloffset_FragmentLightModelfSGIX },
+ { "glFragmentLightModelfvSGIX", (GLvoid *) glFragmentLightModelfvSGIX, _gloffset_FragmentLightModelfvSGIX },
+ { "glFragmentLightModeliSGIX", (GLvoid *) glFragmentLightModeliSGIX, _gloffset_FragmentLightModeliSGIX },
+ { "glFragmentLightModelivSGIX", (GLvoid *) glFragmentLightModelivSGIX, _gloffset_FragmentLightModelivSGIX },
+ { "glFragmentMaterialfSGIX", (GLvoid *) glFragmentMaterialfSGIX, _gloffset_FragmentMaterialfSGIX },
+ { "glFragmentMaterialfvSGIX", (GLvoid *) glFragmentMaterialfvSGIX, _gloffset_FragmentMaterialfvSGIX },
+ { "glFragmentMaterialiSGIX", (GLvoid *) glFragmentMaterialiSGIX, _gloffset_FragmentMaterialiSGIX },
+ { "glFragmentMaterialivSGIX", (GLvoid *) glFragmentMaterialivSGIX, _gloffset_FragmentMaterialivSGIX },
+ { "glGetFragmentLightfvSGIX", (GLvoid *) glGetFragmentLightfvSGIX, _gloffset_GetFragmentLightfvSGIX },
+ { "glGetFragmentLightivSGIX", (GLvoid *) glGetFragmentLightivSGIX, _gloffset_GetFragmentLightivSGIX },
+ { "glGetFragmentMaterialfvSGIX", (GLvoid *) glGetFragmentMaterialfvSGIX, _gloffset_GetFragmentMaterialfvSGIX },
+ { "glGetFragmentMaterialivSGIX", (GLvoid *) glGetFragmentMaterialivSGIX, _gloffset_GetFragmentMaterialivSGIX },
+ { "glLightEnviSGIX", (GLvoid *) glLightEnviSGIX, _gloffset_LightEnviSGIX },
+ { "glDrawRangeElementsEXT", (GLvoid *) glDrawRangeElementsEXT, _gloffset_DrawRangeElements },
+ { "glSecondaryColor3bEXT", (GLvoid *) glSecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT },
+ { "glSecondaryColor3bvEXT", (GLvoid *) glSecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT },
+ { "glSecondaryColor3dEXT", (GLvoid *) glSecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT },
+ { "glSecondaryColor3dvEXT", (GLvoid *) glSecondaryColor3dvEXT, _gloffset_SecondaryColor3dvEXT },
+ { "glSecondaryColor3fEXT", (GLvoid *) glSecondaryColor3fEXT, _gloffset_SecondaryColor3fEXT },
+ { "glSecondaryColor3fvEXT", (GLvoid *) glSecondaryColor3fvEXT, _gloffset_SecondaryColor3fvEXT },
+ { "glSecondaryColor3iEXT", (GLvoid *) glSecondaryColor3iEXT, _gloffset_SecondaryColor3iEXT },
+ { "glSecondaryColor3ivEXT", (GLvoid *) glSecondaryColor3ivEXT, _gloffset_SecondaryColor3ivEXT },
+ { "glSecondaryColor3sEXT", (GLvoid *) glSecondaryColor3sEXT, _gloffset_SecondaryColor3sEXT },
+ { "glSecondaryColor3svEXT", (GLvoid *) glSecondaryColor3svEXT, _gloffset_SecondaryColor3svEXT },
+ { "glSecondaryColor3ubEXT", (GLvoid *) glSecondaryColor3ubEXT, _gloffset_SecondaryColor3ubEXT },
+ { "glSecondaryColor3ubvEXT", (GLvoid *) glSecondaryColor3ubvEXT, _gloffset_SecondaryColor3ubvEXT },
+ { "glSecondaryColor3uiEXT", (GLvoid *) glSecondaryColor3uiEXT, _gloffset_SecondaryColor3uiEXT },
+ { "glSecondaryColor3uivEXT", (GLvoid *) glSecondaryColor3uivEXT, _gloffset_SecondaryColor3uivEXT },
+ { "glSecondaryColor3usEXT", (GLvoid *) glSecondaryColor3usEXT, _gloffset_SecondaryColor3usEXT },
+ { "glSecondaryColor3usvEXT", (GLvoid *) glSecondaryColor3usvEXT, _gloffset_SecondaryColor3usvEXT },
+ { "glSecondaryColorPointerEXT", (GLvoid *) glSecondaryColorPointerEXT, _gloffset_SecondaryColorPointerEXT },
+ { "glMultiDrawArraysEXT", (GLvoid *) glMultiDrawArraysEXT, _gloffset_MultiDrawArraysEXT },
+ { "glMultiDrawElementsEXT", (GLvoid *) glMultiDrawElementsEXT, _gloffset_MultiDrawElementsEXT },
+ { "glFogCoordfEXT", (GLvoid *) glFogCoordfEXT, _gloffset_FogCoordfEXT },
+ { "glFogCoordfvEXT", (GLvoid *) glFogCoordfvEXT, _gloffset_FogCoordfvEXT },
+ { "glFogCoorddEXT", (GLvoid *) glFogCoorddEXT, _gloffset_FogCoorddEXT },
+ { "glFogCoorddvEXT", (GLvoid *) glFogCoorddvEXT, _gloffset_FogCoorddvEXT },
+ { "glFogCoordPointerEXT", (GLvoid *) glFogCoordPointerEXT, _gloffset_FogCoordPointerEXT },
+ { "glBlendFuncSeparateEXT", (GLvoid *) glBlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT },
+ { "glBlendFuncSeparateINGR", (GLvoid *) glBlendFuncSeparateINGR, _gloffset_BlendFuncSeparateEXT },
+ { "glVertexWeightfEXT", (GLvoid *) glVertexWeightfEXT, _gloffset_VertexWeightfEXT },
+ { "glVertexWeightfvEXT", (GLvoid *) glVertexWeightfvEXT, _gloffset_VertexWeightfvEXT },
+ { "glVertexWeightPointerEXT", (GLvoid *) glVertexWeightPointerEXT, _gloffset_VertexWeightPointerEXT },
+ { "glFlushVertexArrayRangeNV", (GLvoid *) glFlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV },
+ { "glVertexArrayRangeNV", (GLvoid *) glVertexArrayRangeNV, _gloffset_VertexArrayRangeNV },
+ { "glCombinerParameterfvNV", (GLvoid *) glCombinerParameterfvNV, _gloffset_CombinerParameterfvNV },
+ { "glCombinerParameterfNV", (GLvoid *) glCombinerParameterfNV, _gloffset_CombinerParameterfNV },
+ { "glCombinerParameterivNV", (GLvoid *) glCombinerParameterivNV, _gloffset_CombinerParameterivNV },
+ { "glCombinerParameteriNV", (GLvoid *) glCombinerParameteriNV, _gloffset_CombinerParameteriNV },
+ { "glCombinerInputNV", (GLvoid *) glCombinerInputNV, _gloffset_CombinerInputNV },
+ { "glCombinerOutputNV", (GLvoid *) glCombinerOutputNV, _gloffset_CombinerOutputNV },
+ { "glFinalCombinerInputNV", (GLvoid *) glFinalCombinerInputNV, _gloffset_FinalCombinerInputNV },
+ { "glGetCombinerInputParameterfvNV", (GLvoid *) glGetCombinerInputParameterfvNV, _gloffset_GetCombinerInputParameterfvNV },
+ { "glGetCombinerInputParameterivNV", (GLvoid *) glGetCombinerInputParameterivNV, _gloffset_GetCombinerInputParameterivNV },
+ { "glGetCombinerOutputParameterfvNV", (GLvoid *) glGetCombinerOutputParameterfvNV, _gloffset_GetCombinerOutputParameterfvNV },
+ { "glGetCombinerOutputParameterivNV", (GLvoid *) glGetCombinerOutputParameterivNV, _gloffset_GetCombinerOutputParameterivNV },
+ { "glGetFinalCombinerInputParameterfvNV", (GLvoid *) glGetFinalCombinerInputParameterfvNV, _gloffset_GetFinalCombinerInputParameterfvNV },
+ { "glGetFinalCombinerInputParameterivNV", (GLvoid *) glGetFinalCombinerInputParameterivNV, _gloffset_GetFinalCombinerInputParameterivNV },
+ { "glResizeBuffersMESA", (GLvoid *) glResizeBuffersMESA, _gloffset_ResizeBuffersMESA },
+ { "glWindowPos2dMESA", (GLvoid *) glWindowPos2dMESA, _gloffset_WindowPos2dMESA },
+ { "glWindowPos2dvMESA", (GLvoid *) glWindowPos2dvMESA, _gloffset_WindowPos2dvMESA },
+ { "glWindowPos2fMESA", (GLvoid *) glWindowPos2fMESA, _gloffset_WindowPos2fMESA },
+ { "glWindowPos2fvMESA", (GLvoid *) glWindowPos2fvMESA, _gloffset_WindowPos2fvMESA },
+ { "glWindowPos2iMESA", (GLvoid *) glWindowPos2iMESA, _gloffset_WindowPos2iMESA },
+ { "glWindowPos2ivMESA", (GLvoid *) glWindowPos2ivMESA, _gloffset_WindowPos2ivMESA },
+ { "glWindowPos2sMESA", (GLvoid *) glWindowPos2sMESA, _gloffset_WindowPos2sMESA },
+ { "glWindowPos2svMESA", (GLvoid *) glWindowPos2svMESA, _gloffset_WindowPos2svMESA },
+ { "glWindowPos3dMESA", (GLvoid *) glWindowPos3dMESA, _gloffset_WindowPos3dMESA },
+ { "glWindowPos3dvMESA", (GLvoid *) glWindowPos3dvMESA, _gloffset_WindowPos3dvMESA },
+ { "glWindowPos3fMESA", (GLvoid *) glWindowPos3fMESA, _gloffset_WindowPos3fMESA },
+ { "glWindowPos3fvMESA", (GLvoid *) glWindowPos3fvMESA, _gloffset_WindowPos3fvMESA },
+ { "glWindowPos3iMESA", (GLvoid *) glWindowPos3iMESA, _gloffset_WindowPos3iMESA },
+ { "glWindowPos3ivMESA", (GLvoid *) glWindowPos3ivMESA, _gloffset_WindowPos3ivMESA },
+ { "glWindowPos3sMESA", (GLvoid *) glWindowPos3sMESA, _gloffset_WindowPos3sMESA },
+ { "glWindowPos3svMESA", (GLvoid *) glWindowPos3svMESA, _gloffset_WindowPos3svMESA },
+ { "glWindowPos4dMESA", (GLvoid *) glWindowPos4dMESA, _gloffset_WindowPos4dMESA },
+ { "glWindowPos4dvMESA", (GLvoid *) glWindowPos4dvMESA, _gloffset_WindowPos4dvMESA },
+ { "glWindowPos4fMESA", (GLvoid *) glWindowPos4fMESA, _gloffset_WindowPos4fMESA },
+ { "glWindowPos4fvMESA", (GLvoid *) glWindowPos4fvMESA, _gloffset_WindowPos4fvMESA },
+ { "glWindowPos4iMESA", (GLvoid *) glWindowPos4iMESA, _gloffset_WindowPos4iMESA },
+ { "glWindowPos4ivMESA", (GLvoid *) glWindowPos4ivMESA, _gloffset_WindowPos4ivMESA },
+ { "glWindowPos4sMESA", (GLvoid *) glWindowPos4sMESA, _gloffset_WindowPos4sMESA },
+ { "glWindowPos4svMESA", (GLvoid *) glWindowPos4svMESA, _gloffset_WindowPos4svMESA },
+ { "glTbufferMask3DFX", (GLvoid *) glTbufferMask3DFX, _gloffset_TbufferMask3DFX },
+ { "glSampleMaskEXT", (GLvoid *) glSampleMaskEXT, _gloffset_SampleMaskSGIS },
+ { "glSamplePatternEXT", (GLvoid *) glSamplePatternEXT, _gloffset_SamplePatternSGIS },
+ { "glDeleteFencesNV", (GLvoid *) glDeleteFencesNV, _gloffset_DeleteFencesNV },
+ { "glGenFencesNV", (GLvoid *) glGenFencesNV, _gloffset_GenFencesNV },
+ { "glIsFenceNV", (GLvoid *) glIsFenceNV, _gloffset_IsFenceNV },
+ { "glTestFenceNV", (GLvoid *) glTestFenceNV, _gloffset_TestFenceNV },
+ { "glGetFenceivNV", (GLvoid *) glGetFenceivNV, _gloffset_GetFenceivNV },
+ { "glFinishFenceNV", (GLvoid *) glFinishFenceNV, _gloffset_FinishFenceNV },
+ { "glSetFenceNV", (GLvoid *) glSetFenceNV, _gloffset_SetFenceNV },
+ { "glWindowPos2dARB", (GLvoid *) glWindowPos2dARB, _gloffset_WindowPos2dMESA },
+ { "glWindowPos2fARB", (GLvoid *) glWindowPos2fARB, _gloffset_WindowPos2fMESA },
+ { "glWindowPos2iARB", (GLvoid *) glWindowPos2iARB, _gloffset_WindowPos2iMESA },
+ { "glWindowPos2sARB", (GLvoid *) glWindowPos2sARB, _gloffset_WindowPos2sMESA },
+ { "glWindowPos2dvARB", (GLvoid *) glWindowPos2dvARB, _gloffset_WindowPos2dvMESA },
+ { "glWindowPos2fvARB", (GLvoid *) glWindowPos2fvARB, _gloffset_WindowPos2fvMESA },
+ { "glWindowPos2ivARB", (GLvoid *) glWindowPos2ivARB, _gloffset_WindowPos2ivMESA },
+ { "glWindowPos2svARB", (GLvoid *) glWindowPos2svARB, _gloffset_WindowPos2svMESA },
+ { "glWindowPos3dARB", (GLvoid *) glWindowPos3dARB, _gloffset_WindowPos3dMESA },
+ { "glWindowPos3fARB", (GLvoid *) glWindowPos3fARB, _gloffset_WindowPos3fMESA },
+ { "glWindowPos3iARB", (GLvoid *) glWindowPos3iARB, _gloffset_WindowPos3iMESA },
+ { "glWindowPos3sARB", (GLvoid *) glWindowPos3sARB, _gloffset_WindowPos3sMESA },
+ { "glWindowPos3dvARB", (GLvoid *) glWindowPos3dvARB, _gloffset_WindowPos3dvMESA },
+ { "glWindowPos3fvARB", (GLvoid *) glWindowPos3fvARB, _gloffset_WindowPos3fvMESA },
+ { "glWindowPos3ivARB", (GLvoid *) glWindowPos3ivARB, _gloffset_WindowPos3ivMESA },
+ { "glWindowPos3svARB", (GLvoid *) glWindowPos3svARB, _gloffset_WindowPos3svMESA },
+ { "glAreProgramsResidentNV", (GLvoid *) glAreProgramsResidentNV, _gloffset_AreProgramsResidentNV },
+ { "glBindProgramNV", (GLvoid *) glBindProgramNV, _gloffset_BindProgramNV },
+ { "glDeleteProgramsNV", (GLvoid *) glDeleteProgramsNV, _gloffset_DeleteProgramsNV },
+ { "glExecuteProgramNV", (GLvoid *) glExecuteProgramNV, _gloffset_ExecuteProgramNV },
+ { "glGenProgramsNV", (GLvoid *) glGenProgramsNV, _gloffset_GenProgramsNV },
+ { "glGetProgramParameterdvNV", (GLvoid *) glGetProgramParameterdvNV, _gloffset_GetProgramParameterdvNV },
+ { "glGetProgramParameterfvNV", (GLvoid *) glGetProgramParameterfvNV, _gloffset_GetProgramParameterfvNV },
+ { "glGetProgramivNV", (GLvoid *) glGetProgramivNV, _gloffset_GetProgramivNV },
+ { "glGetProgramStringNV", (GLvoid *) glGetProgramStringNV, _gloffset_GetProgramStringNV },
+ { "glGetTrackMatrixivNV", (GLvoid *) glGetTrackMatrixivNV, _gloffset_GetTrackMatrixivNV },
+ { "glGetVertexAttribdvNV", (GLvoid *) glGetVertexAttribdvNV, _gloffset_GetVertexAttribdvNV },
+ { "glGetVertexAttribfvNV", (GLvoid *) glGetVertexAttribfvNV, _gloffset_GetVertexAttribfvNV },
+ { "glGetVertexAttribivNV", (GLvoid *) glGetVertexAttribivNV, _gloffset_GetVertexAttribivNV },
+ { "glGetVertexAttribPointervNV", (GLvoid *) glGetVertexAttribPointervNV, _gloffset_GetVertexAttribPointervNV },
+ { "glIsProgramNV", (GLvoid *) glIsProgramNV, _gloffset_IsProgramNV },
+ { "glLoadProgramNV", (GLvoid *) glLoadProgramNV, _gloffset_LoadProgramNV },
+ { "glProgramParameter4dNV", (GLvoid *) glProgramParameter4dNV, _gloffset_ProgramParameter4dNV },
+ { "glProgramParameter4dvNV", (GLvoid *) glProgramParameter4dvNV, _gloffset_ProgramParameter4dvNV },
+ { "glProgramParameter4fNV", (GLvoid *) glProgramParameter4fNV, _gloffset_ProgramParameter4fNV },
+ { "glProgramParameter4fvNV", (GLvoid *) glProgramParameter4fvNV, _gloffset_ProgramParameter4fvNV },
+ { "glProgramParameters4dvNV", (GLvoid *) glProgramParameters4dvNV, _gloffset_ProgramParameters4dvNV },
+ { "glProgramParameters4fvNV", (GLvoid *) glProgramParameters4fvNV, _gloffset_ProgramParameters4fvNV },
+ { "glRequestResidentProgramsNV", (GLvoid *) glRequestResidentProgramsNV, _gloffset_RequestResidentProgramsNV },
+ { "glTrackMatrixNV", (GLvoid *) glTrackMatrixNV, _gloffset_TrackMatrixNV },
+ { "glVertexAttribPointerNV", (GLvoid *) glVertexAttribPointerNV, _gloffset_VertexAttribPointerNV },
+ { "glVertexAttrib1dNV", (GLvoid *) glVertexAttrib1dNV, _gloffset_VertexAttrib1dNV },
+ { "glVertexAttrib1dvNV", (GLvoid *) glVertexAttrib1dvNV, _gloffset_VertexAttrib1dvNV },
+ { "glVertexAttrib1fNV", (GLvoid *) glVertexAttrib1fNV, _gloffset_VertexAttrib1fNV },
+ { "glVertexAttrib1fvNV", (GLvoid *) glVertexAttrib1fvNV, _gloffset_VertexAttrib1fvNV },
+ { "glVertexAttrib1sNV", (GLvoid *) glVertexAttrib1sNV, _gloffset_VertexAttrib1sNV },
+ { "glVertexAttrib1svNV", (GLvoid *) glVertexAttrib1svNV, _gloffset_VertexAttrib1svNV },
+ { "glVertexAttrib2dNV", (GLvoid *) glVertexAttrib2dNV, _gloffset_VertexAttrib2dNV },
+ { "glVertexAttrib2dvNV", (GLvoid *) glVertexAttrib2dvNV, _gloffset_VertexAttrib2dvNV },
+ { "glVertexAttrib2fNV", (GLvoid *) glVertexAttrib2fNV, _gloffset_VertexAttrib2fNV },
+ { "glVertexAttrib2fvNV", (GLvoid *) glVertexAttrib2fvNV, _gloffset_VertexAttrib2fvNV },
+ { "glVertexAttrib2sNV", (GLvoid *) glVertexAttrib2sNV, _gloffset_VertexAttrib2sNV },
+ { "glVertexAttrib2svNV", (GLvoid *) glVertexAttrib2svNV, _gloffset_VertexAttrib2svNV },
+ { "glVertexAttrib3dNV", (GLvoid *) glVertexAttrib3dNV, _gloffset_VertexAttrib3dNV },
+ { "glVertexAttrib3dvNV", (GLvoid *) glVertexAttrib3dvNV, _gloffset_VertexAttrib3dvNV },
+ { "glVertexAttrib3fNV", (GLvoid *) glVertexAttrib3fNV, _gloffset_VertexAttrib3fNV },
+ { "glVertexAttrib3fvNV", (GLvoid *) glVertexAttrib3fvNV, _gloffset_VertexAttrib3fvNV },
+ { "glVertexAttrib3sNV", (GLvoid *) glVertexAttrib3sNV, _gloffset_VertexAttrib3sNV },
+ { "glVertexAttrib3svNV", (GLvoid *) glVertexAttrib3svNV, _gloffset_VertexAttrib3svNV },
+ { "glVertexAttrib4dNV", (GLvoid *) glVertexAttrib4dNV, _gloffset_VertexAttrib4dNV },
+ { "glVertexAttrib4dvNV", (GLvoid *) glVertexAttrib4dvNV, _gloffset_VertexAttrib4dvNV },
+ { "glVertexAttrib4fNV", (GLvoid *) glVertexAttrib4fNV, _gloffset_VertexAttrib4fNV },
+ { "glVertexAttrib4fvNV", (GLvoid *) glVertexAttrib4fvNV, _gloffset_VertexAttrib4fvNV },
+ { "glVertexAttrib4sNV", (GLvoid *) glVertexAttrib4sNV, _gloffset_VertexAttrib4sNV },
+ { "glVertexAttrib4svNV", (GLvoid *) glVertexAttrib4svNV, _gloffset_VertexAttrib4svNV },
+ { "glVertexAttrib4ubNV", (GLvoid *) glVertexAttrib4ubNV, _gloffset_VertexAttrib4ubNV },
+ { "glVertexAttrib4ubvNV", (GLvoid *) glVertexAttrib4ubvNV, _gloffset_VertexAttrib4ubvNV },
+ { "glVertexAttribs1dvNV", (GLvoid *) glVertexAttribs1dvNV, _gloffset_VertexAttribs1dvNV },
+ { "glVertexAttribs1fvNV", (GLvoid *) glVertexAttribs1fvNV, _gloffset_VertexAttribs1fvNV },
+ { "glVertexAttribs1svNV", (GLvoid *) glVertexAttribs1svNV, _gloffset_VertexAttribs1svNV },
+ { "glVertexAttribs2dvNV", (GLvoid *) glVertexAttribs2dvNV, _gloffset_VertexAttribs2dvNV },
+ { "glVertexAttribs2fvNV", (GLvoid *) glVertexAttribs2fvNV, _gloffset_VertexAttribs2fvNV },
+ { "glVertexAttribs2svNV", (GLvoid *) glVertexAttribs2svNV, _gloffset_VertexAttribs2svNV },
+ { "glVertexAttribs3dvNV", (GLvoid *) glVertexAttribs3dvNV, _gloffset_VertexAttribs3dvNV },
+ { "glVertexAttribs3fvNV", (GLvoid *) glVertexAttribs3fvNV, _gloffset_VertexAttribs3fvNV },
+ { "glVertexAttribs3svNV", (GLvoid *) glVertexAttribs3svNV, _gloffset_VertexAttribs3svNV },
+ { "glVertexAttribs4dvNV", (GLvoid *) glVertexAttribs4dvNV, _gloffset_VertexAttribs4dvNV },
+ { "glVertexAttribs4fvNV", (GLvoid *) glVertexAttribs4fvNV, _gloffset_VertexAttribs4fvNV },
+ { "glVertexAttribs4svNV", (GLvoid *) glVertexAttribs4svNV, _gloffset_VertexAttribs4svNV },
+ { "glVertexAttribs4ubvNV", (GLvoid *) glVertexAttribs4ubvNV, _gloffset_VertexAttribs4ubvNV },
+ { "glPointParameteriNV", (GLvoid *) glPointParameteriNV, _gloffset_PointParameteriNV },
+ { "glPointParameterivNV", (GLvoid *) glPointParameterivNV, _gloffset_PointParameterivNV },
+ { "glBlendFuncSeparate", (GLvoid *) glBlendFuncSeparate, _gloffset_BlendFuncSeparateEXT },
+ { "glFogCoordf", (GLvoid *) glFogCoordf, _gloffset_FogCoordfEXT },
+ { "glFogCoordfv", (GLvoid *) glFogCoordfv, _gloffset_FogCoordfvEXT },
+ { "glFogCoordd", (GLvoid *) glFogCoordd, _gloffset_FogCoorddEXT },
+ { "glFogCoorddv", (GLvoid *) glFogCoorddv, _gloffset_FogCoorddvEXT },
+ { "glFogCoordPointer", (GLvoid *) glFogCoordPointer, _gloffset_FogCoordPointerEXT },
+ { "glMultiDrawArrays", (GLvoid *) glMultiDrawArrays, _gloffset_MultiDrawArraysEXT },
+ { "glMultiDrawElements", (GLvoid *) glMultiDrawElements, _gloffset_MultiDrawElementsEXT },
+ { "glPointParameterf", (GLvoid *) glPointParameterf, _gloffset_PointParameterfEXT },
+ { "glPointParameterfv", (GLvoid *) glPointParameterfv, _gloffset_PointParameterfvEXT },
+ { "glPointParameteri", (GLvoid *) glPointParameteri, _gloffset_PointParameteriNV },
+ { "glPointParameteriv", (GLvoid *) glPointParameteriv, _gloffset_PointParameterivNV },
+ { "glSecondaryColor3b", (GLvoid *) glSecondaryColor3b, _gloffset_SecondaryColor3bEXT },
+ { "glSecondaryColor3bv", (GLvoid *) glSecondaryColor3bv, _gloffset_SecondaryColor3bvEXT },
+ { "glSecondaryColor3d", (GLvoid *) glSecondaryColor3d, _gloffset_SecondaryColor3dEXT },
+ { "glSecondaryColor3dv", (GLvoid *) glSecondaryColor3dv, _gloffset_SecondaryColor3dvEXT },
+ { "glSecondaryColor3f", (GLvoid *) glSecondaryColor3f, _gloffset_SecondaryColor3fEXT },
+ { "glSecondaryColor3fv", (GLvoid *) glSecondaryColor3fv, _gloffset_SecondaryColor3fvEXT },
+ { "glSecondaryColor3i", (GLvoid *) glSecondaryColor3i, _gloffset_SecondaryColor3iEXT },
+ { "glSecondaryColor3iv", (GLvoid *) glSecondaryColor3iv, _gloffset_SecondaryColor3ivEXT },
+ { "glSecondaryColor3s", (GLvoid *) glSecondaryColor3s, _gloffset_SecondaryColor3sEXT },
+ { "glSecondaryColor3sv", (GLvoid *) glSecondaryColor3sv, _gloffset_SecondaryColor3svEXT },
+ { "glSecondaryColor3ub", (GLvoid *) glSecondaryColor3ub, _gloffset_SecondaryColor3ubEXT },
+ { "glSecondaryColor3ubv", (GLvoid *) glSecondaryColor3ubv, _gloffset_SecondaryColor3ubvEXT },
+ { "glSecondaryColor3ui", (GLvoid *) glSecondaryColor3ui, _gloffset_SecondaryColor3uiEXT },
+ { "glSecondaryColor3uiv", (GLvoid *) glSecondaryColor3uiv, _gloffset_SecondaryColor3uivEXT },
+ { "glSecondaryColor3us", (GLvoid *) glSecondaryColor3us, _gloffset_SecondaryColor3usEXT },
+ { "glSecondaryColor3usv", (GLvoid *) glSecondaryColor3usv, _gloffset_SecondaryColor3usvEXT },
+ { "glSecondaryColorPointer", (GLvoid *) glSecondaryColorPointer, _gloffset_SecondaryColorPointerEXT },
+ { "glWindowPos2d", (GLvoid *) glWindowPos2d, _gloffset_WindowPos2dMESA },
+ { "glWindowPos2dv", (GLvoid *) glWindowPos2dv, _gloffset_WindowPos2dvMESA },
+ { "glWindowPos2f", (GLvoid *) glWindowPos2f, _gloffset_WindowPos2fMESA },
+ { "glWindowPos2fv", (GLvoid *) glWindowPos2fv, _gloffset_WindowPos2fvMESA },
+ { "glWindowPos2i", (GLvoid *) glWindowPos2i, _gloffset_WindowPos2iMESA },
+ { "glWindowPos2iv", (GLvoid *) glWindowPos2iv, _gloffset_WindowPos2ivMESA },
+ { "glWindowPos2s", (GLvoid *) glWindowPos2s, _gloffset_WindowPos2sMESA },
+ { "glWindowPos2sv", (GLvoid *) glWindowPos2sv, _gloffset_WindowPos2svMESA },
+ { "glWindowPos3d", (GLvoid *) glWindowPos3d, _gloffset_WindowPos3dMESA },
+ { "glWindowPos3dv", (GLvoid *) glWindowPos3dv, _gloffset_WindowPos3dvMESA },
+ { "glWindowPos3f", (GLvoid *) glWindowPos3f, _gloffset_WindowPos3fMESA },
+ { "glWindowPos3fv", (GLvoid *) glWindowPos3fv, _gloffset_WindowPos3fvMESA },
+ { "glWindowPos3i", (GLvoid *) glWindowPos3i, _gloffset_WindowPos3iMESA },
+ { "glWindowPos3iv", (GLvoid *) glWindowPos3iv, _gloffset_WindowPos3ivMESA },
+ { "glWindowPos3s", (GLvoid *) glWindowPos3s, _gloffset_WindowPos3sMESA },
+ { "glWindowPos3sv", (GLvoid *) glWindowPos3sv, _gloffset_WindowPos3svMESA },
+ { "glActiveStencilFaceEXT", (GLvoid *) glActiveStencilFaceEXT, _gloffset_ActiveStencilFaceEXT },
+ { NULL, NULL } /* end of list marker */
+};
diff --git a/xc/extras/Mesa/src/glthread.c b/xc/extras/Mesa/src/glthread.c
index b48aed899..5fa831397 100644
--- a/xc/extras/Mesa/src/glthread.c
+++ b/xc/extras/Mesa/src/glthread.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -30,12 +30,8 @@
*/
-#ifdef PC_ALL
-#include "all.h"
-#else
#include "glheader.h"
#include "glthread.h"
-#endif
/*
@@ -291,6 +287,46 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
+/*
+ * BeOS threads
+ */
+#ifdef BEOS_THREADS
+
+unsigned long
+_glthread_GetID(void)
+{
+ return (unsigned long) find_thread(NULL);
+}
+
+void
+_glthread_InitTSD(_glthread_TSD *tsd)
+{
+ tsd->key = tls_allocate();
+ tsd->initMagic = INIT_MAGIC;
+}
+
+void *
+_glthread_GetTSD(_glthread_TSD *tsd)
+{
+ if (tsd->initMagic != (int) INIT_MAGIC) {
+ _glthread_InitTSD(tsd);
+ }
+ return tls_get(tsd->key);
+}
+
+void
+_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
+{
+ if (tsd->initMagic != (int) INIT_MAGIC) {
+ _glthread_InitTSD(tsd);
+ }
+ tls_set(tsd->key, ptr);
+}
+
+#endif /* BEOS_THREADS */
+
+
+
#else /* THREADS */
diff --git a/xc/extras/Mesa/src/glthread.h b/xc/extras/Mesa/src/glthread.h
index 3bcee3b29..051965446 100644
--- a/xc/extras/Mesa/src/glthread.h
+++ b/xc/extras/Mesa/src/glthread.h
@@ -100,6 +100,9 @@ typedef pthread_mutex_t _glthread_Mutex;
#define _glthread_INIT_MUTEX(name) \
pthread_mutex_init(&(name), NULL)
+#define _glthread_DESTROY_MUTEX(name) \
+ pthread_mutex_destroy(&(name))
+
#define _glthread_LOCK_MUTEX(name) \
(void) pthread_mutex_lock(&(name))
@@ -133,6 +136,7 @@ typedef mutex_t _glthread_Mutex;
/* XXX need to really implement mutex-related macros */
#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0
#define _glthread_INIT_MUTEX(name) (void) name
+#define _glthread_DESTROY_MUTEX(name) (void) name
#define _glthread_LOCK_MUTEX(name) (void) name
#define _glthread_UNLOCK_MUTEX(name) (void) name
@@ -161,6 +165,7 @@ typedef CRITICAL_SECTION _glthread_Mutex;
/* XXX need to really implement mutex-related macros */
#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0
#define _glthread_INIT_MUTEX(name) (void) name
+#define _glthread_DESTROY_MUTEX(name) (void) name
#define _glthread_LOCK_MUTEX(name) (void) name
#define _glthread_UNLOCK_MUTEX(name) (void) name
@@ -196,6 +201,9 @@ typedef xmutex_rec _glthread_Mutex;
#define _glthread_INIT_MUTEX(name) \
xmutex_init(&(name))
+#define _glthread_DESTROY_MUTEX(name) \
+ xmutex_clear(&(name))
+
#define _glthread_LOCK_MUTEX(name) \
(void) xmutex_lock(&(name))
@@ -206,6 +214,36 @@ typedef xmutex_rec _glthread_Mutex;
+/*
+ * BeOS threads. R5.x required.
+ */
+#ifdef BEOS_THREADS
+#include <kernel/OS.h>
+#include <support/TLS.h>
+
+typedef struct {
+ int32 key;
+ int initMagic;
+} _glthread_TSD;
+
+typedef thread_id _glthread_Thread;
+
+/* Use Benaphore, aka speeder semaphore */
+typedef struct {
+ int32 lock;
+ sem_id sem;
+} benaphore;
+typedef benaphore _glthread_Mutex;
+
+#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = { 0,
+create_sem(0, #name"_benaphore") }
+#define _glthread_INIT_MUTEX(name) name.sem = create_sem(0, #name"_benaphore"), name.lock = 0
+#define _glthread_LOCK_MUTEX(name) if((atomic_add(&(name.lock), 1)) >= 1) acquire_sem(name.sem)
+#define _glthread_UNLOCK_MUTEX(name) if((atomic_add(&(name.lock), -1)) > 1) release_sem(name.sem)
+
+#endif /* BEOS_THREADS */
+
+
#ifndef THREADS
@@ -223,6 +261,8 @@ typedef GLuint _glthread_Mutex;
#define _glthread_INIT_MUTEX(name) (void) name
+#define _glthread_DESTROY_MUTEX(name) (void) name
+
#define _glthread_LOCK_MUTEX(name) (void) name
#define _glthread_UNLOCK_MUTEX(name) (void) name
diff --git a/xc/extras/Mesa/src/hash.c b/xc/extras/Mesa/src/hash.c
index 54f49d426..32e37a268 100644
--- a/xc/extras/Mesa/src/hash.c
+++ b/xc/extras/Mesa/src/hash.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -23,43 +23,48 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "glthread.h"
#include "hash.h"
-#include "mem.h"
-#endif
+#include "context.h"
-/*
- * Generic hash table.
- *
- * This is used to implement display list and texture object lookup.
- * NOTE: key=0 is illegal.
+/**
+ * \file hash.c
+ * \brief Generic hash table. Used for display lists and texture objects.
+ * The hash functions are thread-safe.
+ * \author Brian Paul
+ * \note key=0 is illegal
*/
-#define TABLE_SIZE 1024
+#define TABLE_SIZE 1023 /**< Size of lookup table/array */
+/**
+ * An entry in the hash table. This struct is private to this file.
+ */
struct HashEntry {
- GLuint Key;
- void *Data;
- struct HashEntry *Next;
+ GLuint Key; /**< the entry's key */
+ void *Data; /**< the entry's data */
+ struct HashEntry *Next; /**< pointer to next entry */
};
+/**
+ * The hashtable data structure. This is an opaque types (it's not
+ * defined in the .h file).
+ */
struct _mesa_HashTable {
- struct HashEntry *Table[TABLE_SIZE];
- GLuint MaxKey;
- _glthread_Mutex Mutex;
+ struct HashEntry *Table[TABLE_SIZE]; /**< the lookup table */
+ GLuint MaxKey; /**< highest key inserted so far */
+ _glthread_Mutex Mutex; /**< mutual exclusion lock */
};
-/*
- * Return pointer to a new, empty hash table.
+/**
+ * Create a new hash table.
+ * \return pointer to a new, empty hash table.
*/
struct _mesa_HashTable *_mesa_NewHashTable(void)
{
@@ -72,8 +77,9 @@ struct _mesa_HashTable *_mesa_NewHashTable(void)
-/*
+/**
* Delete a hash table.
+ * \param table - the hash table to delete
*/
void _mesa_DeleteHashTable(struct _mesa_HashTable *table)
{
@@ -87,16 +93,17 @@ void _mesa_DeleteHashTable(struct _mesa_HashTable *table)
entry = next;
}
}
+ _glthread_DESTROY_MUTEX(table->Mutex);
FREE(table);
}
-/*
+/**
* Lookup an entry in the hash table.
- * Input: table - the hash table
- * key - the key
- * Return: user data pointer or NULL if key not in table
+ * \param table - the hash table
+ * \param key - the key
+ * \return pointer to user's data or NULL if key not in table
*/
void *_mesa_HashLookup(const struct _mesa_HashTable *table, GLuint key)
{
@@ -119,12 +126,12 @@ void *_mesa_HashLookup(const struct _mesa_HashTable *table, GLuint key)
-/*
+/**
* Insert into the hash table. If an entry with this key already exists
* we'll replace the existing entry.
- * Input: table - the hash table
- * key - the key (not zero)
- * data - pointer to user data
+ * \param table - the hash table
+ * \param key - the key (not zero)
+ * \param data - pointer to user data
*/
void _mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data)
{
@@ -164,10 +171,10 @@ void _mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data)
-/*
+/**
* Remove an entry from the hash table.
- * Input: table - the hash table
- * key - key of entry to remove
+ * \param table - the hash table
+ * \param key - key of entry to remove
*/
void _mesa_HashRemove(struct _mesa_HashTable *table, GLuint key)
{
@@ -204,10 +211,12 @@ void _mesa_HashRemove(struct _mesa_HashTable *table, GLuint key)
-/*
- * Return the key of the "first" entry in the hash table.
+/**
+ * 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.
*/
GLuint _mesa_HashFirstEntry(struct _mesa_HashTable *table)
{
@@ -226,8 +235,9 @@ GLuint _mesa_HashFirstEntry(struct _mesa_HashTable *table)
-/*
+/**
* Dump contents of hash table for debugging.
+ * \param table - the hash table
*/
void _mesa_HashPrint(const struct _mesa_HashTable *table)
{
@@ -236,7 +246,7 @@ void _mesa_HashPrint(const struct _mesa_HashTable *table)
for (i=0;i<TABLE_SIZE;i++) {
const struct HashEntry *entry = table->Table[i];
while (entry) {
- printf("%u %p\n", entry->Key, entry->Data);
+ _mesa_debug(NULL, "%u %p\n", entry->Key, entry->Data);
entry = entry->Next;
}
}
@@ -244,11 +254,11 @@ void _mesa_HashPrint(const struct _mesa_HashTable *table)
-/*
+/**
* Find a block of 'numKeys' adjacent unused hash keys.
- * Input: table - the hash table
- * numKeys - number of keys needed
- * Return: starting key of free block or 0 if failure
+ * \param table - the hash table
+ * \param numKeys - number of keys needed
+ * \return Starting key of free block or 0 if failure
*/
GLuint _mesa_HashFindFreeKeyBlock(struct _mesa_HashTable *table, GLuint numKeys)
{
@@ -293,17 +303,19 @@ int main(int argc, char *argv[])
int a, b, c;
struct HashTable *t;
- printf("&a = %p\n", &a);
- printf("&b = %p\n", &b);
+ _mesa_printf("&a = %p\n", &a);
+ _mesa_printf("&b = %p\n", &b);
t = _mesa_NewHashTable();
_mesa_HashInsert(t, 501, &a);
_mesa_HashInsert(t, 10, &c);
_mesa_HashInsert(t, 0xfffffff8, &b);
_mesa_HashPrint(t);
- printf("Find 501: %p\n", _mesa_HashLookup(t,501));
- printf("Find 1313: %p\n", _mesa_HashLookup(t,1313));
- printf("Find block of 100: %d\n", _mesa_HashFindFreeKeyBlock(t, 100));
+
+ _mesa_printf("Find 501: %p\n", _mesa_HashLookup(t,501));
+ _mesa_printf("Find 1313: %p\n", _mesa_HashLookup(t,1313));
+ _mesa_printf("Find block of 100: %d\n", _mesa_HashFindFreeKeyBlock(t, 100));
+
_mesa_DeleteHashTable(t);
return 0;
diff --git a/xc/extras/Mesa/src/hash.h b/xc/extras/Mesa/src/hash.h
index a6ed16ccc..07bdef46c 100644
--- a/xc/extras/Mesa/src/hash.h
+++ b/xc/extras/Mesa/src/hash.h
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -31,6 +31,9 @@
#include "glheader.h"
+/**
+ * Opaque hash table type.
+ */
struct HashTable;
diff --git a/xc/extras/Mesa/src/highpc.c b/xc/extras/Mesa/src/highpc.c
deleted file mode 100644
index d35a5ae61..000000000
--- a/xc/extras/Mesa/src/highpc.c
+++ /dev/null
@@ -1,120 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include "glheader.h"
-#include "mtypes.h"
-#endif
-
-
-/*
- * This is the highest address in Mesa
- */
-extern void mesa_highpc(void); /* silence compiler warning */
-void mesa_highpc(void) { }
-
-#if defined(__GNUC__) && defined(__linux__)
-
-void monstartup( char *lowpc, char *highpc );
-void _mcleanup( void );
-void mesa_lowpc( void );
-void mesa_highpc( void );
-
-static int profile = 0;
-
-extern void force_init_prof( void ); /* silence compiler warning */
-void force_init_prof( void )
-{
- FILE *fp;
-
- if (profile) return;
-
- profile = 1;
-
- monstartup( (char *)mesa_lowpc, (char *)mesa_highpc );
-
- fprintf(stderr, "Starting profiling, %x %x\n",
- (unsigned int)mesa_lowpc,
- (unsigned int)mesa_highpc);
-
- if ((fp = fopen( "mesa_lowpc", "w" )) != NULL) {
- fprintf( fp, "0x%08x ", (unsigned int)mesa_lowpc );
- fclose( fp );
- }
-}
-
-/*
- * Start profiling
- */
-extern void init_prof(void); /* silence compiler warning */
-void __attribute__ ((constructor))
-init_prof( void )
-{
- FILE *fp;
- char *s = getenv("MESA_MON");
-
- if (s == NULL || atoi(s) == 0)
- return;
-
- profile = 1;
-
- monstartup( (char *)mesa_lowpc, (char *)mesa_highpc );
-
- fprintf(stderr, "Starting profiling, %x %x\n",
- (unsigned int)mesa_lowpc,
- (unsigned int)mesa_highpc);
-
- if ((fp = fopen( "mesa_lowpc", "w" )) != NULL) {
- fprintf( fp, "0x%08x ", (unsigned int)mesa_lowpc );
- fclose( fp );
- }
-}
-
-
-
-/*
- * Finish profiling
- */
-extern void fini_prof(void); /* silence compiler warning */
-void __attribute__ ((destructor))
-fini_prof( void )
-{
- if (profile) {
- _mcleanup( );
-
- fprintf(stderr, "Finished profiling\n");
- }
-}
-
-#else
-
-void force_init_prof( void )
-{
-}
-
-#endif
diff --git a/xc/extras/Mesa/src/hint.c b/xc/extras/Mesa/src/hint.c
index 9a946d6dc..90ccc8bf6 100644
--- a/xc/extras/Mesa/src/hint.c
+++ b/xc/extras/Mesa/src/hint.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,15 +24,11 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "enums.h"
#include "context.h"
#include "hint.h"
-#include "state.h"
-#endif
+#include "imports.h"
@@ -41,49 +37,44 @@ _mesa_Hint( GLenum target, GLenum mode )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- (void) _mesa_try_Hint( ctx, target, mode );
-}
-
-GLboolean
-_mesa_try_Hint( GLcontext *ctx, GLenum target, GLenum mode )
-{
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glHint %s %d\n", _mesa_lookup_enum_by_nr(target), mode);
+ _mesa_debug(ctx, "glHint %s %d\n",
+ _mesa_lookup_enum_by_nr(target), mode);
if (mode != GL_NICEST && mode != GL_FASTEST && mode != GL_DONT_CARE) {
_mesa_error(ctx, GL_INVALID_ENUM, "glHint(mode)");
- return GL_FALSE;
+ return;
}
switch (target) {
case GL_FOG_HINT:
if (ctx->Hint.Fog == mode)
- return GL_TRUE;
+ return;
FLUSH_VERTICES(ctx, _NEW_HINT);
ctx->Hint.Fog = mode;
break;
case GL_LINE_SMOOTH_HINT:
if (ctx->Hint.LineSmooth == mode)
- return GL_TRUE;
+ return;
FLUSH_VERTICES(ctx, _NEW_HINT);
ctx->Hint.LineSmooth = mode;
break;
case GL_PERSPECTIVE_CORRECTION_HINT:
if (ctx->Hint.PerspectiveCorrection == mode)
- return GL_TRUE;
+ return;
FLUSH_VERTICES(ctx, _NEW_HINT);
ctx->Hint.PerspectiveCorrection = mode;
break;
case GL_POINT_SMOOTH_HINT:
if (ctx->Hint.PointSmooth == mode)
- return GL_TRUE;
+ return;
FLUSH_VERTICES(ctx, _NEW_HINT);
ctx->Hint.PointSmooth = mode;
break;
case GL_POLYGON_SMOOTH_HINT:
if (ctx->Hint.PolygonSmooth == mode)
- return GL_TRUE;
+ return;
FLUSH_VERTICES(ctx, _NEW_HINT);
ctx->Hint.PolygonSmooth = mode;
break;
@@ -91,7 +82,7 @@ _mesa_try_Hint( GLcontext *ctx, GLenum target, GLenum mode )
/* GL_EXT_clip_volume_hint */
case GL_CLIP_VOLUME_CLIPPING_HINT_EXT:
if (ctx->Hint.ClipVolumeClipping == mode)
- return GL_TRUE;
+ return;
FLUSH_VERTICES(ctx, _NEW_HINT);
ctx->Hint.ClipVolumeClipping = mode;
break;
@@ -100,10 +91,10 @@ _mesa_try_Hint( GLcontext *ctx, GLenum target, GLenum mode )
case GL_TEXTURE_COMPRESSION_HINT_ARB:
if (!ctx->Extensions.ARB_texture_compression) {
_mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)");
- return GL_FALSE;
+ return;
}
if (ctx->Hint.TextureCompression == mode)
- return GL_TRUE;
+ return;
FLUSH_VERTICES(ctx, _NEW_HINT);
ctx->Hint.TextureCompression = mode;
break;
@@ -112,22 +103,20 @@ _mesa_try_Hint( GLcontext *ctx, GLenum target, GLenum mode )
case GL_GENERATE_MIPMAP_HINT_SGIS:
if (!ctx->Extensions.SGIS_generate_mipmap) {
_mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)");
- return GL_FALSE;
+ return;
}
if (ctx->Hint.GenerateMipmap == mode)
- return GL_TRUE;
+ return;
FLUSH_VERTICES(ctx, _NEW_HINT);
ctx->Hint.GenerateMipmap = mode;
break;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)");
- return GL_FALSE;
+ return;
}
if (ctx->Driver.Hint) {
(*ctx->Driver.Hint)( ctx, target, mode );
}
-
- return GL_TRUE;
}
diff --git a/xc/extras/Mesa/src/hint.h b/xc/extras/Mesa/src/hint.h
index 8432337b2..f33be7b54 100644
--- a/xc/extras/Mesa/src/hint.h
+++ b/xc/extras/Mesa/src/hint.h
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -31,9 +31,6 @@
#include "mtypes.h"
-extern GLboolean
-_mesa_try_Hint( GLcontext *ctx, GLenum target, GLenum mode );
-
extern void
_mesa_Hint( GLenum target, GLenum mode );
diff --git a/xc/extras/Mesa/src/histogram.c b/xc/extras/Mesa/src/histogram.c
index 8ee061168..805438f2f 100644
--- a/xc/extras/Mesa/src/histogram.c
+++ b/xc/extras/Mesa/src/histogram.c
@@ -1,4 +1,3 @@
-/* $Id: histogram.c,v 1.1.1.1 2002/10/22 13:05:10 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -25,16 +24,12 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colormac.h"
#include "context.h"
#include "image.h"
#include "histogram.h"
#include "mmath.h"
-#endif
/*
diff --git a/xc/extras/Mesa/src/histogram.h b/xc/extras/Mesa/src/histogram.h
index 8c620f750..61fdeb319 100644
--- a/xc/extras/Mesa/src/histogram.h
+++ b/xc/extras/Mesa/src/histogram.h
@@ -1,10 +1,9 @@
-/* $Id: histogram.h,v 1.1.1.1 2002/10/22 13:05:10 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -28,14 +27,8 @@
#ifndef HISTOGRAM_H
#define HISTOGRAM_H
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "mtypes.h"
-#endif
-
extern void _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values);
diff --git a/xc/extras/Mesa/src/image.c b/xc/extras/Mesa/src/image.c
index da2e6953f..4c042315d 100644
--- a/xc/extras/Mesa/src/image.c
+++ b/xc/extras/Mesa/src/image.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -23,22 +23,16 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colormac.h"
#include "context.h"
#include "image.h"
+#include "imports.h"
#include "histogram.h"
#include "macros.h"
-#include "mem.h"
#include "mmath.h"
#include "pixel.h"
#include "mtypes.h"
-#endif
-
/*
@@ -56,7 +50,9 @@ const struct gl_pixelstore_attrib _mesa_native_packing = {
0, /* ImageHeight */
0, /* SkipImages */
GL_FALSE, /* SwapBytes */
- GL_FALSE /* LsbFirst */
+ GL_FALSE, /* LsbFirst */
+ GL_FALSE, /* ClientStorage */
+ GL_FALSE /* Invert */
};
@@ -183,17 +179,17 @@ GLint _mesa_sizeof_packed_type( GLenum type )
case GL_UNSIGNED_BYTE_2_3_3_REV:
return sizeof(GLubyte);
case GL_UNSIGNED_SHORT_5_6_5:
- return sizeof(GLshort);
+ return sizeof(GLushort);
case GL_UNSIGNED_SHORT_5_6_5_REV:
- return sizeof(GLshort);
+ return sizeof(GLushort);
case GL_UNSIGNED_SHORT_4_4_4_4:
- return sizeof(GLshort);
+ return sizeof(GLushort);
case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- return sizeof(GLshort);
+ return sizeof(GLushort);
case GL_UNSIGNED_SHORT_5_5_5_1:
- return sizeof(GLshort);
+ return sizeof(GLushort);
case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- return sizeof(GLshort);
+ return sizeof(GLushort);
case GL_UNSIGNED_INT_8_8_8_8:
return sizeof(GLuint);
case GL_UNSIGNED_INT_8_8_8_8_REV:
@@ -202,6 +198,9 @@ GLint _mesa_sizeof_packed_type( GLenum type )
return sizeof(GLuint);
case GL_UNSIGNED_INT_2_10_10_10_REV:
return sizeof(GLuint);
+ case GL_UNSIGNED_SHORT_8_8_MESA:
+ case GL_UNSIGNED_SHORT_8_8_REV_MESA:
+ return sizeof(GLushort);
default:
return -1;
}
@@ -244,6 +243,8 @@ GLint _mesa_components_in_format( GLenum format )
return 4;
case GL_ABGR_EXT:
return 4;
+ case GL_YCBCR_MESA:
+ return 2;
default:
return -1;
}
@@ -283,7 +284,7 @@ GLint _mesa_bytes_per_pixel( GLenum format, GLenum type )
case GL_UNSIGNED_SHORT_5_6_5:
case GL_UNSIGNED_SHORT_5_6_5_REV:
if (format == GL_RGB || format == GL_BGR)
- return sizeof(GLshort);
+ return sizeof(GLushort);
else
return -1; /* error */
case GL_UNSIGNED_SHORT_4_4_4_4:
@@ -302,6 +303,12 @@ GLint _mesa_bytes_per_pixel( GLenum format, GLenum type )
return sizeof(GLuint);
else
return -1;
+ case GL_UNSIGNED_SHORT_8_8_MESA:
+ case GL_UNSIGNED_SHORT_8_8_REV_MESA:
+ if (format == GL_YCBCR_MESA)
+ return sizeof(GLushort);
+ else
+ return -1;
default:
return -1;
}
@@ -392,6 +399,12 @@ _mesa_is_legal_format_and_type( GLenum format, GLenum type )
default:
return GL_FALSE;
}
+ case GL_YCBCR_MESA:
+ if (type == GL_UNSIGNED_SHORT_8_8_MESA ||
+ type == GL_UNSIGNED_SHORT_8_8_REV_MESA)
+ return GL_TRUE;
+ else
+ return GL_FALSE;
default:
; /* fall-through */
}
@@ -475,6 +488,7 @@ _mesa_image_address( const struct gl_pixelstore_attrib *packing,
else {
/* Non-BITMAP data */
GLint bytes_per_pixel, bytes_per_row, remainder, bytes_per_image;
+ GLint topOfImage;
bytes_per_pixel = _mesa_bytes_per_pixel( format, type );
@@ -490,9 +504,19 @@ _mesa_image_address( const struct gl_pixelstore_attrib *packing,
bytes_per_image = bytes_per_row * rows_per_image;
+ if (packing->Invert) {
+ /* set pixel_addr to the last row */
+ topOfImage = bytes_per_row * (height - 1);
+ bytes_per_row = -bytes_per_row;
+ }
+ else {
+ topOfImage = 0;
+ }
+
/* compute final pixel address */
pixel_addr = (GLubyte *) image
+ (skipimages + img) * bytes_per_image
+ + topOfImage
+ (skiprows + row) * bytes_per_row
+ (skippixels + column) * bytes_per_pixel;
}
@@ -513,14 +537,18 @@ _mesa_image_row_stride( const struct gl_pixelstore_attrib *packing,
ASSERT(packing);
if (type == GL_BITMAP) {
/* BITMAP data */
+ GLint bytes;
if (packing->RowLength == 0) {
- GLint bytes = (width + 7) / 8;
- return bytes;
+ bytes = (width + 7) / 8;
}
else {
- GLint bytes = (packing->RowLength + 7) / 8;
- return bytes;
+ bytes = (packing->RowLength + 7) / 8;
+ }
+ if (packing->Invert) {
+ /* negate the bytes per row (negative row stride) */
+ bytes = -bytes;
}
+ return bytes;
}
else {
/* Non-BITMAP data */
@@ -537,6 +565,8 @@ _mesa_image_row_stride( const struct gl_pixelstore_attrib *packing,
remainder = bytesPerRow % packing->Alignment;
if (remainder > 0)
bytesPerRow += (packing->Alignment - remainder);
+ if (packing->Invert)
+ bytesPerRow = -bytesPerRow;
return bytesPerRow;
}
}
@@ -544,6 +574,46 @@ _mesa_image_row_stride( const struct gl_pixelstore_attrib *packing,
/*
+ * Compute the stride between images in a 3D texture (in bytes) for the given
+ * pixel packing parameters and image width, format and type.
+ */
+GLint
+_mesa_image_image_stride( const struct gl_pixelstore_attrib *packing,
+ GLint width, GLint height,
+ GLenum format, GLenum type )
+{
+ ASSERT(packing);
+ ASSERT(type != GL_BITMAP);
+
+ {
+ const GLint bytesPerPixel = _mesa_bytes_per_pixel(format, type);
+ GLint bytesPerRow, bytesPerImage, remainder;
+
+ if (bytesPerPixel <= 0)
+ return -1; /* error */
+ if (packing->RowLength == 0) {
+ bytesPerRow = bytesPerPixel * width;
+ }
+ else {
+ bytesPerRow = bytesPerPixel * packing->RowLength;
+ }
+ remainder = bytesPerRow % packing->Alignment;
+ if (remainder > 0)
+ bytesPerRow += (packing->Alignment - remainder);
+
+ if (packing->ImageHeight == 0)
+ bytesPerImage = bytesPerRow * height;
+ else
+ bytesPerImage = bytesPerRow * packing->ImageHeight;
+
+ return bytesPerImage;
+ }
+}
+
+
+
+
+/*
* Unpack a 32x32 pixel polygon stipple from user memory using the
* current pixel unpack settings.
*/
diff --git a/xc/extras/Mesa/src/image.h b/xc/extras/Mesa/src/image.h
index de1546a27..39260f0b4 100644
--- a/xc/extras/Mesa/src/image.h
+++ b/xc/extras/Mesa/src/image.h
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -68,6 +68,11 @@ _mesa_image_row_stride( const struct gl_pixelstore_attrib *packing,
GLint width, GLenum format, GLenum type );
+extern GLint
+_mesa_image_image_stride( const struct gl_pixelstore_attrib *packing,
+ GLint width, GLint height,
+ GLenum format, GLenum type );
+
extern void
_mesa_unpack_polygon_stipple( const GLubyte *pattern, GLuint dest[32],
const struct gl_pixelstore_attrib *unpacking );
diff --git a/xc/extras/Mesa/src/imports.c b/xc/extras/Mesa/src/imports.c
index c19e51d65..3d197563e 100644
--- a/xc/extras/Mesa/src/imports.c
+++ b/xc/extras/Mesa/src/imports.c
@@ -1,10 +1,8 @@
-/* $Id: imports.c,v 1.1.1.1 2002/10/22 13:05:51 alanh Exp $ */
-
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 5.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -26,146 +24,671 @@
/*
- * Imports are functions which the device driver or window system or
+ * Imports are services which the device driver or window system or
* operating system provides to the core renderer. The core renderer (Mesa)
* will call these functions in order to do memory allocation, simple I/O,
* etc.
*
- * Some drivers will need to implement these functions themselves but
- * many (most?) Mesa drivers will be fine using these.
+ * Some drivers will want to override/replace this file with something
+ * specialized, but that'll be rare.
+ *
+ * Eventually, I want to move roll the glheader.h file into this.
+ *
+ * The OpenGL SI's __GLimports structure allows per-context specification of
+ * replacements for the standard C lib functions. In practice that's probably
+ * never needed; compile-time replacements are far more likely.
*
- * A server-side GL renderer will likely not use these functions since
- * the renderer should use the XFree86-wrapped system calls.
+ * The _mesa_foo() functions defined here don't in general take a context
+ * parameter. I guess we can change that someday, if need be.
+ * So for now, the __GLimports stuff really isn't used.
*/
#include "glheader.h"
-#include "imports.h"
-#include "mem.h"
#include "mtypes.h"
+#include "context.h"
+#include "imports.h"
-static void *
-_mesa_Malloc(__GLcontext *gc, size_t size)
+#define MAXSTRING 4000 /* for vsnprintf() */
+
+#ifdef WIN32
+#define vsnprintf _vsnprintf
+#elif defined(__IBMC__) || defined(__IBMCPP__) || defined(VMS)
+extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg);
+#endif
+
+
+/**********************************************************************/
+/* Wrappers for standard C library functions */
+/**********************************************************************/
+
+/*
+ * Functions still needed:
+ * scanf
+ * qsort
+ * bsearch
+ * rand and RAND_MAX
+ */
+
+void *
+_mesa_malloc(size_t bytes)
{
- return MALLOC(size);
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86malloc(bytes);
+#else
+ return malloc(bytes);
+#endif
}
-static void *
-_mesa_Calloc(__GLcontext *gc, size_t numElem, size_t elemSize)
+
+void *
+_mesa_calloc(size_t bytes)
{
- return CALLOC(numElem * elemSize);
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86calloc(1, bytes);
+#else
+ return calloc(1, bytes);
+#endif
}
-static void *
-_mesa_Realloc(__GLcontext *gc, void *oldAddr, size_t newSize)
+
+void
+_mesa_free(void *ptr)
{
- return realloc(oldAddr, newSize);
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ xf86free(ptr);
+#else
+ free(ptr);
+#endif
}
-static void
-_mesa_Free(__GLcontext *gc, void *addr)
+
+void *
+_mesa_align_malloc(size_t bytes, unsigned long alignment)
{
- FREE(addr);
+ unsigned long ptr, buf;
+
+ ASSERT( alignment > 0 );
+
+ /* Allocate extra memory to accomodate rounding up the address for
+ * alignment and to record the real malloc address.
+ */
+ ptr = (unsigned long) _mesa_malloc(bytes + alignment + sizeof(void *));
+ if (!ptr)
+ return NULL;
+
+ buf = (ptr + alignment + sizeof(void *)) & ~(unsigned long)(alignment - 1);
+ *(unsigned long *)(buf - sizeof(void *)) = ptr;
+
+#ifdef DEBUG
+ /* mark the non-aligned area */
+ while ( ptr < buf - sizeof(void *) ) {
+ *(unsigned long *)ptr = 0xcdcdcdcd;
+ ptr += sizeof(unsigned long);
+ }
+#endif
+
+ return (void *) buf;
}
-/* Must be before '#undef getenv' for inclusion in XFree86.
- */
-static char * CAPI
-_mesa_getenv(__GLcontext *gc, const char *var)
+
+void *
+_mesa_align_calloc(size_t bytes, unsigned long alignment)
{
- (void) gc;
+ unsigned long ptr, buf;
+
+ ASSERT( alignment > 0 );
+
+ ptr = (unsigned long) _mesa_calloc(bytes + alignment + sizeof(void *));
+ if (!ptr)
+ return NULL;
+
+ buf = (ptr + alignment + sizeof(void *)) & ~(unsigned long)(alignment - 1);
+ *(unsigned long *)(buf - sizeof(void *)) = ptr;
+
+#ifdef DEBUG
+ /* mark the non-aligned area */
+ while ( ptr < buf - sizeof(void *) ) {
+ *(unsigned long *)ptr = 0xcdcdcdcd;
+ ptr += sizeof(unsigned long);
+ }
+#endif
+
+ return (void *)buf;
+}
+
+
+void
+_mesa_align_free(void *ptr)
+{
+#if 0
+ _mesa_free( (void *)(*(unsigned long *)((unsigned long)ptr - sizeof(void *))) );
+#else
+ /* The actuall address to free is stuffed in the word immediately
+ * before the address the client sees.
+ */
+ void **cubbyHole = (void **) ((char *) ptr - sizeof(void *));
+ void *realAddr = *cubbyHole;
+ _mesa_free(realAddr);
+#endif
+}
+
+
+void *
+_mesa_memcpy(void *dest, const void *src, size_t n)
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86memcpy(dest, src, n);
+#elif defined(SUNOS4)
+ return memcpy((char *) dest, (char *) src, (int) n);
+#else
+ return memcpy(dest, src, n);
+#endif
+}
+
+
+void
+_mesa_memset( void *dst, int val, size_t n )
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ xf86memset( dst, val, n );
+#elif defined(SUNOS4)
+ memset( (char *) dst, (int) val, (int) n );
+#else
+ memset(dst, val, n);
+#endif
+}
+
+
+void
+_mesa_memset16( unsigned short *dst, unsigned short val, size_t n )
+{
+ while (n-- > 0)
+ *dst++ = val;
+}
+
+
+void
+_mesa_bzero( void *dst, size_t n )
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ xf86memset( dst, 0, n );
+#elif defined(__FreeBSD__)
+ bzero( dst, n );
+#else
+ memset( dst, 0, n );
+#endif
+}
+
+
+double
+_mesa_sin(double a)
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86sin(a);
+#else
+ return sin(a);
+#endif
+}
+
+
+double
+_mesa_cos(double a)
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86cos(a);
+#else
+ return cos(a);
+#endif
+}
+
+
+double
+_mesa_sqrt(double x)
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86sqrt(x);
+#else
+ return sqrt(x);
+#endif
+}
+
+
+double
+_mesa_pow(double x, double y)
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86pow(x, y);
+#else
+ return pow(x, y);
+#endif
+}
+
+
+char *
+_mesa_getenv( const char *var )
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86getenv(var);
+#else
return getenv(var);
+#endif
}
-static void
-_mesa_warning(__GLcontext *gc, char *str)
+
+char *
+_mesa_strstr( const char *haystack, const char *needle )
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86strstr(haystack, needle);
+#else
+ return strstr(haystack, needle);
+#endif
+}
+
+
+char *
+_mesa_strncat( char *dest, const char *src, size_t n )
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86strncat(dest, src, n);
+#else
+ return strncat(dest, src, n);
+#endif
+}
+
+
+char *
+_mesa_strcpy( char *dest, const char *src )
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86strcpy(dest, src);
+#else
+ return strcpy(dest, src);
+#endif
+}
+
+
+char *
+_mesa_strncpy( char *dest, const char *src, size_t n )
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86strncpy(dest, src, n);
+#else
+ return strncpy(dest, src, n);
+#endif
+}
+
+
+size_t
+_mesa_strlen( const char *s )
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86strlen(s);
+#else
+ return strlen(s);
+#endif
+}
+
+
+int
+_mesa_strcmp( const char *s1, const char *s2 )
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86strcmp(s1, s2);
+#else
+ return strcmp(s1, s2);
+#endif
+}
+
+
+int
+_mesa_strncmp( const char *s1, const char *s2, size_t n )
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86strncmp(s1, s2, n);
+#else
+ return strncmp(s1, s2, n);
+#endif
+}
+
+
+char *
+_mesa_strdup( const char *s )
+{
+ int l = _mesa_strlen(s);
+ char *s2 = (char *) _mesa_malloc(l + 1);
+ if (s2)
+ _mesa_strcpy(s2, s);
+ return s2;
+}
+
+
+int
+_mesa_atoi(const char *s)
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86atoi(s);
+#else
+ return atoi(s);
+#endif
+}
+
+
+double
+_mesa_strtod( const char *s, char **end )
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86strtod(s, end);
+#else
+ return strtod(s, end);
+#endif
+}
+
+
+int
+_mesa_sprintf( char *str, const char *fmt, ... )
+{
+ int r;
+ va_list args;
+ va_start( args, fmt );
+ va_end( args );
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ r = xf86vsprintf( str, fmt, args );
+#else
+ r = vsprintf( str, fmt, args );
+#endif
+ return r;
+}
+
+
+void
+_mesa_printf( const char *fmtString, ... )
+{
+ char s[MAXSTRING];
+ va_list args;
+ va_start( args, fmtString );
+ vsnprintf(s, MAXSTRING, fmtString, args);
+ va_end( args );
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ xf86printf("%s", s);
+#else
+ printf("%s", s);
+#endif
+}
+
+
+void
+_mesa_warning( GLcontext *ctx, const char *fmtString, ... )
{
GLboolean debug;
+ char str[MAXSTRING];
+ va_list args;
+ (void) ctx;
+ va_start( args, fmtString );
+ (void) vsnprintf( str, MAXSTRING, fmtString, args );
+ va_end( args );
#ifdef DEBUG
- debug = GL_TRUE;
+ debug = GL_TRUE; /* always print warning */
#else
-/* Whacko XFree86 macro:
+ debug = _mesa_getenv("MESA_DEBUG") ? GL_TRUE : GL_FALSE;
+#endif
+ if (debug) {
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ xf86fprintf(stderr, "Mesa warning: %s\n", str);
+#else
+ fprintf(stderr, "Mesa warning: %s\n", str);
+#endif
+ }
+}
+
+
+/*
+ * This function is called when the Mesa user has stumbled into a code
+ * path which may not be implemented fully or correctly.
*/
-#ifdef getenv
-#undef getenv
+void
+_mesa_problem( const GLcontext *ctx, const char *fmtString, ... )
+{
+ va_list args;
+ char str[MAXSTRING];
+ (void) ctx;
+
+ va_start( args, fmtString );
+ vsnprintf( str, MAXSTRING, fmtString, args );
+ va_end( args );
+
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ xf86fprintf(stderr, "Mesa implementation error: %s\n", str);
+ xf86fprintf(stderr, "Please report to the DRI project at dri.sourceforge.net\n");
+#else
+ fprintf(stderr, "Mesa implementation error: %s\n", str);
+ fprintf(stderr, "Please report to the Mesa bug database at www.mesa3d.org\n" );
#endif
- if (gc->imports.getenv(gc, "MESA_DEBUG")) {
+}
+
+
+/*
+ * If in debug mode, print error message to stdout.
+ * Also, record the error code by calling _mesa_record_error().
+ * Input: ctx - the GL context
+ * error - the error value
+ * fmtString - printf-style format string, followed by optional args
+ */
+void
+_mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... )
+{
+ const char *debugEnv;
+ GLboolean debug;
+
+ debugEnv = _mesa_getenv("MESA_DEBUG");
+
+#ifdef DEBUG
+ if (debugEnv && _mesa_strstr(debugEnv, "silent"))
+ debug = GL_FALSE;
+ else
debug = GL_TRUE;
- }
- else {
+#else
+ if (debugEnv)
+ debug = GL_TRUE;
+ else
debug = GL_FALSE;
- }
#endif
+
if (debug) {
- fprintf(stderr, "Mesa warning: %s\n", str);
+ va_list args;
+ char where[MAXSTRING];
+ const char *errstr;
+
+ va_start( args, fmtString );
+ vsnprintf( where, MAXSTRING, fmtString, args );
+ va_end( args );
+
+ switch (error) {
+ case GL_NO_ERROR:
+ errstr = "GL_NO_ERROR";
+ break;
+ case GL_INVALID_VALUE:
+ errstr = "GL_INVALID_VALUE";
+ break;
+ case GL_INVALID_ENUM:
+ errstr = "GL_INVALID_ENUM";
+ break;
+ case GL_INVALID_OPERATION:
+ errstr = "GL_INVALID_OPERATION";
+ break;
+ case GL_STACK_OVERFLOW:
+ errstr = "GL_STACK_OVERFLOW";
+ break;
+ case GL_STACK_UNDERFLOW:
+ errstr = "GL_STACK_UNDERFLOW";
+ break;
+ case GL_OUT_OF_MEMORY:
+ errstr = "GL_OUT_OF_MEMORY";
+ break;
+ case GL_TABLE_TOO_LARGE:
+ errstr = "GL_TABLE_TOO_LARGE";
+ break;
+ default:
+ errstr = "unknown";
+ break;
+ }
+ _mesa_debug(ctx, "Mesa user error: %s in %s\n", errstr, where);
}
+
+ _mesa_record_error(ctx, error);
+}
+
+
+/*
+ * Call this to report debug information. Uses stderr.
+ */
+void
+_mesa_debug( const GLcontext *ctx, const char *fmtString, ... )
+{
+ char s[MAXSTRING];
+ va_list args;
+ va_start(args, fmtString);
+ vsnprintf(s, MAXSTRING, fmtString, args);
+ va_end(args);
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ xf86fprintf(stderr, "Mesa: %s", s);
+#else
+ fprintf(stderr, "Mesa: %s", s);
+#endif
+}
+
+
+
+/**********************************************************************/
+/* Default Imports Wrapper */
+/**********************************************************************/
+
+static void *
+default_malloc(__GLcontext *gc, size_t size)
+{
+ (void) gc;
+ return _mesa_malloc(size);
+}
+
+static void *
+default_calloc(__GLcontext *gc, size_t numElem, size_t elemSize)
+{
+ (void) gc;
+ return _mesa_calloc(numElem * elemSize);
+}
+
+static void *
+default_realloc(__GLcontext *gc, void *oldAddr, size_t newSize)
+{
+ (void) gc;
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86realloc(oldAddr, newSize);
+#else
+ return realloc(oldAddr, newSize);
+#endif
}
static void
-_mesa_fatal(__GLcontext *gc, char *str)
+default_free(__GLcontext *gc, void *addr)
{
- fprintf(stderr, "%s\n", str);
+ (void) gc;
+ _mesa_free(addr);
+}
+
+static char * CAPI
+default_getenv( __GLcontext *gc, const char *var )
+{
+ (void) gc;
+ return _mesa_getenv(var);
+}
+
+static void
+default_warning(__GLcontext *gc, char *str)
+{
+ _mesa_warning(gc, str);
+}
+
+static void
+default_fatal(__GLcontext *gc, char *str)
+{
+ _mesa_problem(gc, str);
abort();
}
static int CAPI
-_mesa_atoi(__GLcontext *gc, const char *str)
+default_atoi(__GLcontext *gc, const char *str)
{
(void) gc;
return atoi(str);
}
static int CAPI
-_mesa_sprintf(__GLcontext *gc, char *str, const char *fmt, ...)
+default_sprintf(__GLcontext *gc, char *str, const char *fmt, ...)
{
- /* XXX fix this */
- return sprintf(str, fmt);
+ int r;
+ va_list args;
+ va_start( args, fmt );
+ r = vsprintf( str, fmt, args );
+ va_end( args );
+ return r;
}
static void * CAPI
-_mesa_fopen(__GLcontext *gc, const char *path, const char *mode)
+default_fopen(__GLcontext *gc, const char *path, const char *mode)
{
return fopen(path, mode);
}
static int CAPI
-_mesa_fclose(__GLcontext *gc, void *stream)
+default_fclose(__GLcontext *gc, void *stream)
{
return fclose((FILE *) stream);
}
static int CAPI
-_mesa_fprintf(__GLcontext *gc, void *stream, const char *fmt, ...)
+default_fprintf(__GLcontext *gc, void *stream, const char *fmt, ...)
{
- /* XXX fix this */
- return fprintf((FILE *) stream, fmt);
+ int r;
+ va_list args;
+ va_start( args, fmt );
+ r = vfprintf( (FILE *) stream, fmt, args );
+ va_end( args );
+ return r;
}
/* XXX this really is driver-specific and can't be here */
static __GLdrawablePrivate *
-_mesa_GetDrawablePrivate(__GLcontext *gc)
+default_GetDrawablePrivate(__GLcontext *gc)
{
return NULL;
}
+
+
+/*
+ * Initialize a __GLimports object to point to the functions in
+ * this file. This is to be called from device drivers.
+ * Input: imports - the object to init
+ * driverCtx - pointer to device driver-specific data
+ */
void
-_mesa_InitDefaultImports(__GLimports *imports, void *driverCtx, void *other)
-{
- imports->malloc = _mesa_Malloc;
- imports->calloc = _mesa_Calloc;
- imports->realloc = _mesa_Realloc;
- imports->free = _mesa_Free;
- imports->warning = _mesa_warning;
- imports->fatal = _mesa_fatal;
- imports->getenv = _mesa_getenv;
- imports->atoi = _mesa_atoi;
- imports->sprintf = _mesa_sprintf;
- imports->fopen = _mesa_fopen;
- imports->fclose = _mesa_fclose;
- imports->fprintf = _mesa_fprintf;
- imports->getDrawablePrivate = _mesa_GetDrawablePrivate;
-/* imports->wscx = driverCtx; */
+_mesa_init_default_imports(__GLimports *imports, void *driverCtx)
+{
+ imports->malloc = default_malloc;
+ imports->calloc = default_calloc;
+ imports->realloc = default_realloc;
+ imports->free = default_free;
+ imports->warning = default_warning;
+ imports->fatal = default_fatal;
+ imports->getenv = default_getenv; /* not used for now */
+ imports->atoi = default_atoi;
+ imports->sprintf = default_sprintf;
+ imports->fopen = default_fopen;
+ imports->fclose = default_fclose;
+ imports->fprintf = default_fprintf;
+ imports->getDrawablePrivate = default_GetDrawablePrivate;
imports->other = driverCtx;
}
diff --git a/xc/extras/Mesa/src/imports.h b/xc/extras/Mesa/src/imports.h
index 53c823c34..936976fd0 100644
--- a/xc/extras/Mesa/src/imports.h
+++ b/xc/extras/Mesa/src/imports.h
@@ -1,10 +1,8 @@
-/* $Id: imports.h,v 1.1.1.1 2002/10/22 13:05:51 alanh Exp $ */
-
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 5.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -25,15 +23,180 @@
*/
+/*
+ * This file provides wrappers for all the standard C library functions
+ * like malloc, free, printf, getenv, etc.
+ */
+
+
#ifndef IMPORTS_H
#define IMPORTS_H
-#include "glheader.h"
+#define MALLOC(BYTES) _mesa_malloc(BYTES)
+#define CALLOC(BYTES) _mesa_calloc(BYTES)
+#define MALLOC_STRUCT(T) (struct T *) _mesa_malloc(sizeof(struct T))
+#define CALLOC_STRUCT(T) (struct T *) _mesa_calloc(sizeof(struct T))
+#define FREE(PTR) _mesa_free(PTR)
+#define ALIGN_MALLOC(BYTES, N) _mesa_align_malloc(BYTES, N)
+#define ALIGN_CALLOC(BYTES, N) _mesa_align_calloc(BYTES, N)
+#define ALIGN_MALLOC_STRUCT(T, N) (struct T *) _mesa_align_malloc(sizeof(struct T), N)
+#define ALIGN_CALLOC_STRUCT(T, N) (struct T *) _mesa_align_calloc(sizeof(struct T), N)
+#define ALIGN_FREE(PTR) _mesa_align_free(PTR)
-extern void
-_mesa_InitDefaultImports(__GLimports *imports, void *driverCtx, void *other);
+#define MEMCPY( DST, SRC, BYTES) _mesa_memcpy(DST, SRC, BYTES)
+#define MEMSET( DST, VAL, N ) _mesa_memset(DST, VAL, N)
+extern void _mesa_memset16( GLushort *dst, GLushort val, size_t n );
+
+#define MEMSET16( DST, VAL, N ) \
+ _mesa_memset16( (GLushort *) (DST), (GLushort) (VAL), (size_t) (N) )
+/* MACs and BeOS don't support static larger than 32kb, so... */
+#if defined(macintosh) && !defined(__MRC__)
+/*extern char *AGLAlloc(int size);*/
+/*extern void AGLFree(char* ptr);*/
+# define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)_mesa_alloc(sizeof(TYPE)*(SIZE))
+# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])_mesa_alloc(sizeof(TYPE)*(SIZE1)*(SIZE2))
+# define DEFMNARRAY(TYPE,NAME,SIZE1,SIZE2,SIZE3) TYPE (*NAME)[SIZE2][SIZE3] = (TYPE(*)[SIZE2][SIZE3])_mesa_alloc(sizeof(TYPE)*(SIZE1)*(SIZE2)*(SIZE3))
+
+# define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0)
+# define UNDEFARRAY(NAME) do {if ((NAME)) {_mesa_free((char*)NAME);} }while (0)
+#elif defined(__BEOS__)
+# define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)_mesa_malloc(sizeof(TYPE)*(SIZE))
+# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])_mesa_malloc(sizeof(TYPE)*(SIZE1)*(SIZE2))
+# define DEFMNARRAY(TYPE,NAME,SIZE1,SIZE2,SIZE3) TYPE (*NAME)[SIZE2][SIZE3] = (TYPE(*)[SIZE2][SIZE3])_mesa_malloc(sizeof(TYPE)*(SIZE1)*(SIZE2)*(SIZE3))
+# define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0)
+# define UNDEFARRAY(NAME) do {if ((NAME)) {_mesa_free((char*)NAME);} }while (0)
+#else
+# define DEFARRAY(TYPE,NAME,SIZE) TYPE NAME[SIZE]
+# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE NAME[SIZE1][SIZE2]
+# define DEFMNARRAY(TYPE,NAME,SIZE1,SIZE2,SIZE3) TYPE NAME[SIZE1][SIZE2][SIZE3]
+# define CHECKARRAY(NAME,CMD) do {} while(0)
+# define UNDEFARRAY(NAME)
#endif
+
+
+#ifdef MESA_EXTERNAL_BUFFERALLOC
+/*
+ * If you want Mesa's depth/stencil/accum/etc buffers to be allocated
+ * with a specialized allocator you can define MESA_EXTERNAL_BUFFERALLOC
+ * and implement _ext_mesa_alloc/free_pixelbuffer() in your app.
+ * Contributed by Gerk Huisma (gerk@five-d.demon.nl).
+ */
+extern void *_ext_mesa_alloc_pixelbuffer( unsigned int size );
+extern void _ext_mesa_free_pixelbuffer( void *pb );
+
+#define MESA_PBUFFER_ALLOC(BYTES) (void *) _ext_mesa_alloc_pixelbuffer(BYTES)
+#define MESA_PBUFFER_FREE(PTR) _ext_mesa_free_pixelbuffer(PTR)
+#else
+/* Default buffer allocation uses the aligned allocation routines: */
+#define MESA_PBUFFER_ALLOC(BYTES) (void *) _mesa_align_malloc(BYTES, 512)
+#define MESA_PBUFFER_FREE(PTR) _mesa_align_free(PTR)
+#endif
+
+
+extern void *
+_mesa_malloc( size_t bytes );
+
+extern void *
+_mesa_calloc( size_t bytes );
+
+extern void
+_mesa_free( void *ptr );
+
+extern void *
+_mesa_align_malloc( size_t bytes, unsigned long alignment );
+
+extern void *
+_mesa_align_calloc( size_t bytes, unsigned long alignment );
+
+extern void
+_mesa_align_free( void *ptr );
+
+extern void *
+_mesa_memcpy( void *dest, const void *src, size_t n );
+
+extern void
+_mesa_memset( void *dst, int val, size_t n );
+
+extern void
+_mesa_memset16( unsigned short *dst, unsigned short val, size_t n );
+
+extern void
+_mesa_bzero( void *dst, size_t n );
+
+
+extern double
+_mesa_sin(double a);
+
+extern double
+_mesa_cos(double a);
+
+extern double
+_mesa_sqrt(double x);
+
+extern double
+_mesa_pow(double x, double y);
+
+
+extern char *
+_mesa_getenv( const char *var );
+
+extern char *
+_mesa_strstr( const char *haystack, const char *needle );
+
+extern char *
+_mesa_strncat( char *dest, const char *src, size_t n );
+
+extern char *
+_mesa_strcpy( char *dest, const char *src );
+
+extern char *
+_mesa_strncpy( char *dest, const char *src, size_t n );
+
+extern size_t
+_mesa_strlen( const char *s );
+
+extern int
+_mesa_strcmp( const char *s1, const char *s2 );
+
+extern int
+_mesa_strncmp( const char *s1, const char *s2, size_t n );
+
+extern char *
+_mesa_strdup( const char *s );
+
+extern int
+_mesa_atoi( const char *s );
+
+extern double
+_mesa_strtod( const char *s, char **end );
+
+extern int
+_mesa_sprintf( char *str, const char *fmt, ... );
+
+extern void
+_mesa_printf( const char *fmtString, ... );
+
+
+extern void
+_mesa_warning( __GLcontext *gc, const char *fmtString, ... );
+
+extern void
+_mesa_problem( const __GLcontext *ctx, const char *fmtString, ... );
+
+extern void
+_mesa_error( __GLcontext *ctx, GLenum error, const char *fmtString, ... );
+
+extern void
+_mesa_debug( const __GLcontext *ctx, const char *fmtString, ... );
+
+
+extern void
+_mesa_init_default_imports( __GLimports *imports, void *driverCtx );
+
+
+#endif /* IMPORTS_H */
+
diff --git a/xc/extras/Mesa/src/light.c b/xc/extras/Mesa/src/light.c
index c649ce2d8..25ff41889 100644
--- a/xc/extras/Mesa/src/light.c
+++ b/xc/extras/Mesa/src/light.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,23 +24,18 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "colormac.h"
#include "context.h"
#include "enums.h"
#include "light.h"
#include "macros.h"
-#include "mem.h"
#include "mmath.h"
#include "simple_list.h"
#include "mtypes.h"
-
#include "math/m_xform.h"
#include "math/m_matrix.h"
-#endif
/* XXX this is a bit of a hack needed for compilation within XFree86 */
@@ -56,7 +51,7 @@ _mesa_ShadeModel( GLenum mode )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glShadeModel %s\n", _mesa_lookup_enum_by_nr(mode));
+ _mesa_debug(ctx, "glShadeModel %s\n", _mesa_lookup_enum_by_nr(mode));
if (mode != GL_FLAT && mode != GL_SMOOTH) {
_mesa_error( ctx, GL_INVALID_ENUM, "glShadeModel" );
@@ -90,7 +85,7 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
struct gl_light *l = &ctx->Light.Light[i];
if (i < 0 || i >= (GLint) ctx->Const.MaxLights) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glLight" );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glLight(light=0x%x)", light );
return;
}
@@ -116,7 +111,7 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
case GL_POSITION: {
GLfloat tmp[4];
/* transform position by ModelView matrix */
- TRANSFORM_POINT( tmp, ctx->ModelView.m, params );
+ TRANSFORM_POINT( tmp, ctx->ModelviewMatrixStack.Top->m, params );
if (TEST_EQ_4V(l->EyePosition, tmp))
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
@@ -130,10 +125,10 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
case GL_SPOT_DIRECTION: {
GLfloat tmp[4];
/* transform direction by inverse modelview */
- if (ctx->ModelView.flags & MAT_DIRTY_INVERSE) {
- _math_matrix_analyse( &ctx->ModelView );
+ if (ctx->ModelviewMatrixStack.Top->flags & MAT_DIRTY_INVERSE) {
+ _math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
}
- TRANSFORM_NORMAL( tmp, params, ctx->ModelView.inv );
+ TRANSFORM_NORMAL( tmp, params, ctx->ModelviewMatrixStack.Top->inv );
if (TEST_EQ_3V(l->EyeDirection, tmp))
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
@@ -160,7 +155,7 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
l->SpotCutoff = params[0];
- l->_CosCutoff = (GLfloat) cos(params[0]*DEG2RAD);
+ l->_CosCutoff = (GLfloat) _mesa_cos(params[0]*DEG2RAD);
if (l->_CosCutoff < 0)
l->_CosCutoff = 0;
if (l->SpotCutoff != 180.0F)
@@ -199,7 +194,7 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
l->QuadraticAttenuation = params[0];
break;
default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glLight" );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glLight(pname=0x%x)", pname );
return;
}
@@ -418,7 +413,8 @@ _mesa_LightModelfv( GLenum pname, const GLfloat *params )
else if (params[0] == (GLfloat) GL_SEPARATE_SPECULAR_COLOR)
newenum = GL_SEPARATE_SPECULAR_COLOR;
else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glLightModel(param)" );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glLightModel(param=0x0%x)",
+ (GLint) params[0] );
return;
}
if (ctx->Light.Model.ColorControl == newenum)
@@ -435,7 +431,7 @@ _mesa_LightModelfv( GLenum pname, const GLfloat *params )
break;
default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glLightModel" );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glLightModel(pname=0x%x)", pname );
break;
}
@@ -616,7 +612,7 @@ void _mesa_update_material( GLcontext *ctx,
bitmask &= ~ctx->Light.ColorMaterialBitmask;
if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
- fprintf(stderr, "_mesa_update_material, mask 0x%x\n", bitmask);
+ _mesa_debug(ctx, "_mesa_update_material, mask 0x%x\n", bitmask);
if (!bitmask)
return;
@@ -713,25 +709,16 @@ void _mesa_update_material( GLcontext *ctx,
ctx->Light.Material[1].SpecularIndex = src[1].SpecularIndex;
}
- if (0)
- {
+ if (0) {
struct gl_material *mat = &ctx->Light.Material[0];
- fprintf(stderr, "update_mat emission : %f %f %f\n",
- mat->Emission[0],
- mat->Emission[1],
- mat->Emission[2]);
- fprintf(stderr, "update_mat specular : %f %f %f\n",
- mat->Specular[0],
- mat->Specular[1],
- mat->Specular[2]);
- fprintf(stderr, "update_mat diffuse : %f %f %f\n",
- mat->Diffuse[0],
- mat->Diffuse[1],
- mat->Diffuse[2]);
- fprintf(stderr, "update_mat ambient : %f %f %f\n",
- mat->Ambient[0],
- mat->Ambient[1],
- mat->Ambient[2]);
+ _mesa_debug(ctx, "update_mat emission : %f %f %f\n",
+ mat->Emission[0], mat->Emission[1], mat->Emission[2]);
+ _mesa_debug(ctx, "update_mat specular : %f %f %f\n",
+ mat->Specular[0], mat->Specular[1], mat->Specular[2]);
+ _mesa_debug(ctx, "update_mat diffuse : %f %f %f\n",
+ mat->Diffuse[0], mat->Diffuse[1], mat->Diffuse[2]);
+ _mesa_debug(ctx, "update_mat ambient : %f %f %f\n",
+ mat->Ambient[0], mat->Ambient[1], mat->Ambient[2]);
}
}
@@ -753,7 +740,7 @@ void _mesa_update_color_material( GLcontext *ctx,
GLuint bitmask = ctx->Light.ColorMaterialBitmask;
if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
- fprintf(stderr, "_mesa_update_color_material, mask 0x%x\n", bitmask);
+ _mesa_debug(ctx, "_mesa_update_color_material, mask 0x%x\n", bitmask);
/* update emissive colors */
if (bitmask & FRONT_EMISSION_BIT) {
@@ -830,25 +817,16 @@ void _mesa_update_color_material( GLcontext *ctx,
}
}
- if (0)
- {
+ if (0) {
struct gl_material *mat = &ctx->Light.Material[0];
- fprintf(stderr, "update_color_mat emission : %f %f %f\n",
- mat->Emission[0],
- mat->Emission[1],
- mat->Emission[2]);
- fprintf(stderr, "update_color_mat specular : %f %f %f\n",
- mat->Specular[0],
- mat->Specular[1],
- mat->Specular[2]);
- fprintf(stderr, "update_color_mat diffuse : %f %f %f\n",
- mat->Diffuse[0],
- mat->Diffuse[1],
- mat->Diffuse[2]);
- fprintf(stderr, "update_color_mat ambient : %f %f %f\n",
- mat->Ambient[0],
- mat->Ambient[1],
- mat->Ambient[2]);
+ _mesa_debug(ctx, "update_color_mat emission : %f %f %f\n",
+ mat->Emission[0], mat->Emission[1], mat->Emission[2]);
+ _mesa_debug(ctx, "update_color_mat specular : %f %f %f\n",
+ mat->Specular[0], mat->Specular[1], mat->Specular[2]);
+ _mesa_debug(ctx, "update_color_mat diffuse : %f %f %f\n",
+ mat->Diffuse[0], mat->Diffuse[1], mat->Diffuse[2]);
+ _mesa_debug(ctx, "update_color_mat ambient : %f %f %f\n",
+ mat->Ambient[0], mat->Ambient[1], mat->Ambient[2]);
}
}
@@ -867,9 +845,9 @@ _mesa_ColorMaterial( GLenum face, GLenum mode )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glColorMaterial %s %s\n",
- _mesa_lookup_enum_by_nr(face),
- _mesa_lookup_enum_by_nr(mode));
+ _mesa_debug(ctx, "glColorMaterial %s %s\n",
+ _mesa_lookup_enum_by_nr(face),
+ _mesa_lookup_enum_by_nr(mode));
bitmask = _mesa_material_bitmask(ctx, face, mode, legal, "glColorMaterial");
@@ -885,7 +863,7 @@ _mesa_ColorMaterial( GLenum face, GLenum mode )
if (ctx->Light.ColorMaterialEnabled) {
FLUSH_CURRENT( ctx, 0 );
- _mesa_update_color_material( ctx, ctx->Current.Color );
+ _mesa_update_color_material(ctx,ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
}
if (ctx->Driver.ColorMaterial)
@@ -1059,7 +1037,7 @@ static void validate_spot_exp_table( struct gl_light *l )
for (i = EXP_TABLE_SIZE - 1; i > 0 ;i--) {
if (clamp == 0) {
- tmp = pow(i / (GLdouble) (EXP_TABLE_SIZE - 1), exponent);
+ tmp = _mesa_pow(i / (GLdouble) (EXP_TABLE_SIZE - 1), exponent);
if (tmp < FLT_MIN * 100.0) {
tmp = 0.0;
clamp = 1;
@@ -1117,7 +1095,7 @@ static void validate_shine_table( GLcontext *ctx, GLuint i, GLfloat shininess )
GLdouble t, x = j / (GLfloat) (SHINE_TABLE_SIZE - 1);
if (x < 0.005) /* underflow check */
x = 0.005;
- t = pow(x, shininess);
+ t = _mesa_pow(x, shininess);
if (t > 1e-20)
m[j] = (GLfloat) t;
else
@@ -1257,16 +1235,21 @@ _mesa_compute_light_positions( GLcontext *ctx )
COPY_3V( ctx->_EyeZDir, eye_z );
}
else {
- TRANSFORM_NORMAL( ctx->_EyeZDir, eye_z, ctx->ModelView.m );
+ TRANSFORM_NORMAL( ctx->_EyeZDir, eye_z, ctx->ModelviewMatrixStack.Top->m );
}
foreach (light, &ctx->Light.EnabledList) {
if (ctx->_NeedEyeCoords) {
COPY_4FV( light->_Position, light->EyePosition );
+#if 0
+ light->_Position[0] /= light->_Position[3];
+ light->_Position[1] /= light->_Position[3];
+ light->_Position[2] /= light->_Position[3];
+#endif
}
else {
- TRANSFORM_POINT( light->_Position, ctx->ModelView.inv,
+ TRANSFORM_POINT( light->_Position, ctx->ModelviewMatrixStack.Top->inv,
light->EyePosition );
}
@@ -1290,7 +1273,7 @@ _mesa_compute_light_positions( GLcontext *ctx )
else {
TRANSFORM_NORMAL( light->_NormDirection,
light->EyeDirection,
- ctx->ModelView.m);
+ ctx->ModelviewMatrixStack.Top->m);
}
NORMALIZE_3FV( light->_NormDirection );
diff --git a/xc/extras/Mesa/src/light.h b/xc/extras/Mesa/src/light.h
index bee9b4f40..557e48802 100644
--- a/xc/extras/Mesa/src/light.h
+++ b/xc/extras/Mesa/src/light.h
@@ -85,7 +85,7 @@ do { \
float f = (dp * (SHINE_TABLE_SIZE-1)); \
int k = (int) f; \
if (k > SHINE_TABLE_SIZE-2) \
- result = (GLfloat) pow( dp, _tab->shininess ); \
+ result = (GLfloat) _mesa_pow( dp, _tab->shininess ); \
else \
result = _tab->tab[k] + (f-k)*(_tab->tab[k+1]-_tab->tab[k]); \
} while (0)
diff --git a/xc/extras/Mesa/src/lines.c b/xc/extras/Mesa/src/lines.c
index a596a9362..7ffa50272 100644
--- a/xc/extras/Mesa/src/lines.c
+++ b/xc/extras/Mesa/src/lines.c
@@ -24,9 +24,6 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "context.h"
#include "depth.h"
@@ -35,8 +32,6 @@
#include "mmath.h"
#include "texstate.h"
#include "mtypes.h"
-#endif
-
void
diff --git a/xc/extras/Mesa/src/lowpc.c b/xc/extras/Mesa/src/lowpc.c
deleted file mode 100644
index 848e703e0..000000000
--- a/xc/extras/Mesa/src/lowpc.c
+++ /dev/null
@@ -1,30 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/*
- * This is the lowest address in Mesa
- */
-void mesa_lowpc(void) { }
diff --git a/xc/extras/Mesa/src/macros.h b/xc/extras/Mesa/src/macros.h
index b3502b609..dbe097961 100644
--- a/xc/extras/Mesa/src/macros.h
+++ b/xc/extras/Mesa/src/macros.h
@@ -58,15 +58,6 @@
#endif
-
-/*
- * Bitmask helpers
- */
-#define SET_BITS(WORD, BITS) (WORD) |= (BITS)
-#define CLEAR_BITS(WORD, BITS) (WORD) &= ~(BITS)
-#define TEST_BITS(WORD, BITS) ((WORD) & (BITS))
-
-
/* Stepping a GLfloat pointer by a byte stride
*/
#define STRIDE_F(p, i) (p = (GLfloat *)((GLubyte *)p + i))
@@ -121,6 +112,27 @@ do { \
(DST)[3] = (SRC)[3]; \
} while (0)
+#define COPY_2V_CAST( DST, SRC, CAST ) \
+do { \
+ (DST)[0] = (CAST)(SRC)[0]; \
+ (DST)[1] = (CAST)(SRC)[1]; \
+} while (0)
+
+#define COPY_3V_CAST( DST, SRC, CAST ) \
+do { \
+ (DST)[0] = (CAST)(SRC)[0]; \
+ (DST)[1] = (CAST)(SRC)[1]; \
+ (DST)[2] = (CAST)(SRC)[2]; \
+} while (0)
+
+#define COPY_4V_CAST( DST, SRC, CAST ) \
+do { \
+ (DST)[0] = (CAST)(SRC)[0]; \
+ (DST)[1] = (CAST)(SRC)[1]; \
+ (DST)[2] = (CAST)(SRC)[2]; \
+ (DST)[3] = (CAST)(SRC)[3]; \
+} while (0)
+
#if defined(__i386__)
#define COPY_4UBV(DST, SRC) \
do { \
@@ -453,7 +465,7 @@ do { \
-/* Generic color packing macros.
+/* Generic color packing macros
* XXX We may move these into texutil.h at some point.
*/
diff --git a/xc/extras/Mesa/src/math/m_debug.h b/xc/extras/Mesa/src/math/m_debug.h
index 4795c5207..6476b6de2 100644
--- a/xc/extras/Mesa/src/math/m_debug.h
+++ b/xc/extras/Mesa/src/math/m_debug.h
@@ -1,4 +1,3 @@
-/* $Id: m_debug.h,v 1.1.1.1 2002/10/22 13:06:31 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Gareth Hughes <gareth@valinux.com>
+ * Gareth Hughes
*/
#ifndef __M_DEBUG_H__
diff --git a/xc/extras/Mesa/src/math/m_debug_clip.c b/xc/extras/Mesa/src/math/m_debug_clip.c
index 634f5922c..867850c61 100644
--- a/xc/extras/Mesa/src/math/m_debug_clip.c
+++ b/xc/extras/Mesa/src/math/m_debug_clip.c
@@ -1,8 +1,7 @@
-/* $Id: m_debug_clip.c,v 1.1.1.1 2002/10/22 13:06:32 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 5.0
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
@@ -24,13 +23,13 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Gareth Hughes <gareth@valinux.com>
+ * Gareth Hughes
*/
#include "glheader.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "m_matrix.h"
#include "m_xform.h"
@@ -48,10 +47,12 @@ static char *cnames[2] = {
"_mesa_clip_tab",
"_mesa_clip_np_tab"
};
+#ifdef RUN_DEBUG_BENCHMARK
static char *cstrings[2] = {
"clip, perspective divide",
"clip, no divide"
};
+#endif
/* =============================================================
@@ -253,20 +254,20 @@ static int test_cliptest_function( clip_func func, int np,
}
if ( dco != rco ) {
- printf( "\n-----------------------------\n" );
- printf( "dco = 0x%02x rco = 0x%02x\n", dco, rco );
+ _mesa_printf( "\n-----------------------------\n" );
+ _mesa_printf( "dco = 0x%02x rco = 0x%02x\n", dco, rco );
return 0;
}
if ( dca != rca ) {
- printf( "\n-----------------------------\n" );
- printf( "dca = 0x%02x rca = 0x%02x\n", dca, rca );
+ _mesa_printf( "\n-----------------------------\n" );
+ _mesa_printf( "dca = 0x%02x rca = 0x%02x\n", dca, rca );
return 0;
}
for ( i = 0 ; i < TEST_COUNT ; i++ ) {
if ( dm[i] != rm[i] ) {
- printf( "\n-----------------------------\n" );
- printf( "(i = %i)\n", i );
- printf( "dm = 0x%02x rm = 0x%02x\n", dm[i], rm[i] );
+ _mesa_printf( "\n-----------------------------\n" );
+ _mesa_printf( "(i = %i)\n", i );
+ _mesa_printf( "dm = 0x%02x rm = 0x%02x\n", dm[i], rm[i] );
return 0;
}
}
@@ -280,19 +281,19 @@ static int test_cliptest_function( clip_func func, int np,
for ( i = 0 ; i < TEST_COUNT ; i++ ) {
for ( j = 0 ; j < 4 ; j++ ) {
if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) {
- printf( "\n-----------------------------\n" );
- printf( "(i = %i, j = %i) dm = 0x%02x rm = 0x%02x\n",
+ _mesa_printf( "\n-----------------------------\n" );
+ _mesa_printf( "(i = %i, j = %i) dm = 0x%02x rm = 0x%02x\n",
i, j, dm[i], rm[i] );
- printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+ _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
d[i][0], r[i][0], r[i][0]-d[i][0],
MAX_PRECISION - significand_match( d[i][0], r[i][0] ) );
- printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+ _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
d[i][1], r[i][1], r[i][1]-d[i][1],
MAX_PRECISION - significand_match( d[i][1], r[i][1] ) );
- printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+ _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
d[i][2], r[i][2], r[i][2]-d[i][2],
MAX_PRECISION - significand_match( d[i][2], r[i][2] ) );
- printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+ _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
d[i][3], r[i][3], r[i][3]-d[i][3],
MAX_PRECISION - significand_match( d[i][3], r[i][3] ) );
return 0;
@@ -311,26 +312,26 @@ void _math_test_all_cliptest_functions( char *description )
if ( first_time ) {
first_time = 0;
- mesa_profile = getenv( "MESA_PROFILE" );
+ mesa_profile = _mesa_getenv( "MESA_PROFILE" );
}
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile ) {
if ( !counter_overhead ) {
INIT_COUNTER();
- printf( "counter overhead: %ld cycles\n\n", counter_overhead );
+ _mesa_printf( "counter overhead: %ld cycles\n\n", counter_overhead );
}
- printf( "cliptest results after hooking in %s functions:\n", description );
+ _mesa_printf( "cliptest results after hooking in %s functions:\n", description );
}
#endif
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile ) {
- printf( "\n\t" );
+ _mesa_printf( "\n\t" );
for ( psize = 2 ; psize <= 4 ; psize++ ) {
- printf( " p%d\t", psize );
+ _mesa_printf( " p%d\t", psize );
}
- printf( "\n--------------------------------------------------------\n\t" );
+ _mesa_printf( "\n--------------------------------------------------------\n\t" );
}
#endif
@@ -341,23 +342,23 @@ void _math_test_all_cliptest_functions( char *description )
if ( test_cliptest_function( func, np, psize, cycles ) == 0 ) {
char buf[100];
- sprintf( buf, "%s[%d] failed test (%s)",
+ _mesa_sprintf( buf, "%s[%d] failed test (%s)",
cnames[np], psize, description );
_mesa_problem( NULL, buf );
}
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile )
- printf( " %li\t", benchmark_tab[np][psize-1] );
+ _mesa_printf( " %li\t", benchmark_tab[np][psize-1] );
#endif
}
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile )
- printf( " | [%s]\n\t", cstrings[np] );
+ _mesa_printf( " | [%s]\n\t", cstrings[np] );
#endif
}
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile )
- printf( "\n" );
+ _mesa_printf( "\n" );
#endif
}
diff --git a/xc/extras/Mesa/src/math/m_debug_norm.c b/xc/extras/Mesa/src/math/m_debug_norm.c
index 2646c5263..4de90e3d6 100644
--- a/xc/extras/Mesa/src/math/m_debug_norm.c
+++ b/xc/extras/Mesa/src/math/m_debug_norm.c
@@ -1,10 +1,9 @@
-/* $Id: m_debug_norm.c,v 1.1.1.1 2002/10/22 13:06:32 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,13 +23,13 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Gareth Hughes <gareth@valinux.com>
+ * Gareth Hughes
*/
#include "glheader.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "m_matrix.h"
@@ -119,14 +118,14 @@ static char *norm_strings[8] = {
static void ref_norm_transform_rescale( const GLmatrix *mat,
GLfloat scale,
- const GLvector3f *in,
+ const GLvector4f *in,
const GLfloat *lengths,
- GLvector3f *dest )
+ GLvector4f *dest )
{
GLuint i;
const GLfloat *s = in->start;
const GLfloat *m = mat->inv;
- GLfloat (*out)[3] = (GLfloat (*)[3])dest->start;
+ GLfloat (*out)[4] = (GLfloat (*)[4]) dest->start;
(void) lengths;
@@ -142,14 +141,14 @@ static void ref_norm_transform_rescale( const GLmatrix *mat,
static void ref_norm_transform_normalize( const GLmatrix *mat,
GLfloat scale,
- const GLvector3f *in,
+ const GLvector4f *in,
const GLfloat *lengths,
- GLvector3f *dest )
+ GLvector4f *dest )
{
GLuint i;
const GLfloat *s = in->start;
const GLfloat *m = mat->inv;
- GLfloat (*out)[3] = (GLfloat (*)[3])dest->start;
+ GLfloat (*out)[4] = (GLfloat (*)[4]) dest->start;
for ( i = 0 ; i < in->count ; i++ ) {
GLfloat t[3];
@@ -181,12 +180,21 @@ static void ref_norm_transform_normalize( const GLmatrix *mat,
* Normal transformation tests
*/
+static void init_matrix( GLfloat *m )
+{
+ m[0] = 63.0; m[4] = 43.0; m[ 8] = 29.0; m[12] = 43.0;
+ m[1] = 55.0; m[5] = 17.0; m[ 9] = 31.0; m[13] = 7.0;
+ m[2] = 44.0; m[6] = 9.0; m[10] = 7.0; m[14] = 3.0;
+ m[3] = 11.0; m[7] = 23.0; m[11] = 91.0; m[15] = 9.0;
+}
+
+
static int test_norm_function( normal_func func, int mtype, long *cycles )
{
- GLvector3f source[1], dest[1], dest2[1], ref[1], ref2[1];
+ GLvector4f source[1], dest[1], dest2[1], ref[1], ref2[1];
GLmatrix mat[1];
- GLfloat s[TEST_COUNT][5], d[TEST_COUNT][3], r[TEST_COUNT][3];
- GLfloat d2[TEST_COUNT][3], r2[TEST_COUNT][3], length[TEST_COUNT];
+ GLfloat s[TEST_COUNT][5], d[TEST_COUNT][4], r[TEST_COUNT][4];
+ GLfloat d2[TEST_COUNT][4], r2[TEST_COUNT][4], length[TEST_COUNT];
GLfloat scale;
GLfloat *m;
int i, j;
@@ -232,34 +240,34 @@ static int test_norm_function( normal_func func, int mtype, long *cycles )
length[i] = 1 / sqrt( LEN_SQUARED_3FV( s[i] ) );
}
- source->data = (GLfloat(*)[3])s;
- source->start = (GLfloat *)s;
+ source->data = (GLfloat(*)[4]) s;
+ source->start = (GLfloat *) s;
source->count = TEST_COUNT;
source->stride = sizeof(s[0]);
source->flags = 0;
- dest->data = (GLfloat(*)[3])d;
- dest->start = (GLfloat *)d;
+ dest->data = d;
+ dest->start = (GLfloat *) d;
dest->count = TEST_COUNT;
- dest->stride = sizeof(float[3]);
+ dest->stride = sizeof(float[4]);
dest->flags = 0;
- dest2->data = (GLfloat(*)[3])d2;
- dest2->start = (GLfloat *)d2;
+ dest2->data = d2;
+ dest2->start = (GLfloat *) d2;
dest2->count = TEST_COUNT;
- dest2->stride = sizeof(float[3]);
+ dest2->stride = sizeof(float[4]);
dest2->flags = 0;
- ref->data = (GLfloat(*)[3])r;
- ref->start = (GLfloat *)r;
+ ref->data = r;
+ ref->start = (GLfloat *) r;
ref->count = TEST_COUNT;
- ref->stride = sizeof(float[3]);
+ ref->stride = sizeof(float[4]);
ref->flags = 0;
- ref2->data = (GLfloat(*)[3])r2;
- ref2->start = (GLfloat *)r2;
+ ref2->data = r2;
+ ref2->start = (GLfloat *) r2;
ref2->count = TEST_COUNT;
- ref2->stride = sizeof(float[3]);
+ ref2->stride = sizeof(float[4]);
ref2->flags = 0;
if ( norm_normalize_types[mtype] == 0 ) {
@@ -282,15 +290,15 @@ static int test_norm_function( normal_func func, int mtype, long *cycles )
for ( i = 0 ; i < TEST_COUNT ; i++ ) {
for ( j = 0 ; j < 3 ; j++ ) {
if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) {
- printf( "-----------------------------\n" );
- printf( "(i = %i, j = %i)\n", i, j );
- printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+ _mesa_printf( "-----------------------------\n" );
+ _mesa_printf( "(i = %i, j = %i)\n", i, j );
+ _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
d[i][0], r[i][0], r[i][0]/d[i][0],
MAX_PRECISION - significand_match( d[i][0], r[i][0] ) );
- printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+ _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
d[i][1], r[i][1], r[i][1]/d[i][1],
MAX_PRECISION - significand_match( d[i][1], r[i][1] ) );
- printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+ _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
d[i][2], r[i][2], r[i][2]/d[i][2],
MAX_PRECISION - significand_match( d[i][2], r[i][2] ) );
return 0;
@@ -298,15 +306,15 @@ static int test_norm_function( normal_func func, int mtype, long *cycles )
if ( norm_normalize_types[mtype] != 0 ) {
if ( significand_match( d2[i][j], r2[i][j] ) < REQUIRED_PRECISION ) {
- printf( "------------------- precalculated length case ------\n" );
- printf( "(i = %i, j = %i)\n", i, j );
- printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+ _mesa_printf( "------------------- precalculated length case ------\n" );
+ _mesa_printf( "(i = %i, j = %i)\n", i, j );
+ _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
d2[i][0], r2[i][0], r2[i][0]/d2[i][0],
MAX_PRECISION - significand_match( d2[i][0], r2[i][0] ) );
- printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+ _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
d2[i][1], r2[i][1], r2[i][1]/d2[i][1],
MAX_PRECISION - significand_match( d2[i][1], r2[i][1] ) );
- printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+ _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
d2[i][2], r2[i][2], r2[i][2]/d2[i][2],
MAX_PRECISION - significand_match( d2[i][2], r2[i][2] ) );
return 0;
@@ -334,11 +342,11 @@ void _math_test_all_normal_transform_functions( char *description )
if ( mesa_profile ) {
if ( !counter_overhead ) {
INIT_COUNTER();
- printf( "counter overhead: %ld cycles\n\n", counter_overhead );
+ _mesa_printf( "counter overhead: %ld cycles\n\n", counter_overhead );
}
- printf( "normal transform results after hooking in %s functions:\n",
+ _mesa_printf( "normal transform results after hooking in %s functions:\n",
description );
- printf( "\n-------------------------------------------------------\n" );
+ _mesa_printf( "\n-------------------------------------------------------\n" );
}
#endif
@@ -348,21 +356,21 @@ void _math_test_all_normal_transform_functions( char *description )
if ( test_norm_function( func, mtype, cycles ) == 0 ) {
char buf[100];
- sprintf( buf, "_mesa_normal_tab[0][%s] failed test (%s)",
+ _mesa_sprintf( buf, "_mesa_normal_tab[0][%s] failed test (%s)",
norm_strings[mtype], description );
_mesa_problem( NULL, buf );
}
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile ) {
- printf( " %li\t", benchmark_tab[mtype] );
- printf( " | [%s]\n", norm_strings[mtype] );
+ _mesa_printf( " %li\t", benchmark_tab[mtype] );
+ _mesa_printf( " | [%s]\n", norm_strings[mtype] );
}
#endif
}
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile ) {
- printf( "\n" );
+ _mesa_printf( "\n" );
fflush( stdout );
}
#endif
diff --git a/xc/extras/Mesa/src/math/m_debug_util.h b/xc/extras/Mesa/src/math/m_debug_util.h
index 1cc77fd44..9b89c90e3 100644
--- a/xc/extras/Mesa/src/math/m_debug_util.h
+++ b/xc/extras/Mesa/src/math/m_debug_util.h
@@ -1,4 +1,3 @@
-/* $Id: m_debug_util.h,v 1.1.1.1 2002/10/22 13:06:27 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Gareth Hughes <gareth@valinux.com>
+ * Gareth Hughes
*/
#ifndef __M_DEBUG_UTIL_H__
@@ -263,15 +262,6 @@ static int significand_match( GLfloat a, GLfloat b )
enum { NIL = 0, ONE = 1, NEG = -1, VAR = 2 };
-static void init_matrix( GLfloat *m )
-{
- m[0] = 63.0; m[4] = 43.0; m[ 8] = 29.0; m[12] = 43.0;
- m[1] = 55.0; m[5] = 17.0; m[ 9] = 31.0; m[13] = 7.0;
- m[2] = 44.0; m[6] = 9.0; m[10] = 7.0; m[14] = 3.0;
- m[3] = 11.0; m[7] = 23.0; m[11] = 91.0; m[15] = 9.0;
-}
-
-
/* Ensure our arrays are correctly aligned.
*/
#if defined(__GNUC__)
diff --git a/xc/extras/Mesa/src/math/m_debug_xform.c b/xc/extras/Mesa/src/math/m_debug_xform.c
index 7566bf060..c197d953e 100644
--- a/xc/extras/Mesa/src/math/m_debug_xform.c
+++ b/xc/extras/Mesa/src/math/m_debug_xform.c
@@ -1,4 +1,3 @@
-/* $Id: m_debug_xform.c,v 1.1.1.1 2002/10/22 13:06:28 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -31,7 +30,7 @@
#include "glheader.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "m_matrix.h"
#include "m_xform.h"
@@ -150,6 +149,14 @@ static void ref_transform( GLvector4f *dst,
* Vertex transformation tests
*/
+static void init_matrix( GLfloat *m )
+{
+ m[0] = 63.0; m[4] = 43.0; m[ 8] = 29.0; m[12] = 43.0;
+ m[1] = 55.0; m[5] = 17.0; m[ 9] = 31.0; m[13] = 7.0;
+ m[2] = 44.0; m[6] = 9.0; m[10] = 7.0; m[14] = 3.0;
+ m[3] = 11.0; m[7] = 23.0; m[11] = 91.0; m[15] = 9.0;
+}
+
static GLfloat s[TEST_COUNT][4] ALIGN16;
static GLfloat d[TEST_COUNT][4] ALIGN16;
static GLfloat r[TEST_COUNT][4] ALIGN16;
@@ -242,18 +249,18 @@ static int test_transform_function( transform_func func, int psize,
for ( i = 0 ; i < TEST_COUNT ; i++ ) {
for ( j = 0 ; j < 4 ; j++ ) {
if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) {
- printf( "-----------------------------\n" );
- printf( "(i = %i, j = %i)\n", i, j );
- printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+ _mesa_printf("-----------------------------\n" );
+ _mesa_printf("(i = %i, j = %i)\n", i, j );
+ _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n",
d[i][0], r[i][0], r[i][0]-d[i][0],
MAX_PRECISION - significand_match( d[i][0], r[i][0] ) );
- printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+ _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n",
d[i][1], r[i][1], r[i][1]-d[i][1],
MAX_PRECISION - significand_match( d[i][1], r[i][1] ) );
- printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+ _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n",
d[i][2], r[i][2], r[i][2]-d[i][2],
MAX_PRECISION - significand_match( d[i][2], r[i][2] ) );
- printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+ _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n",
d[i][3], r[i][3], r[i][3]-d[i][3],
MAX_PRECISION - significand_match( d[i][3], r[i][3] ) );
return 0;
@@ -280,19 +287,19 @@ void _math_test_all_transform_functions( char *description )
if ( mesa_profile ) {
if ( !counter_overhead ) {
INIT_COUNTER();
- printf( "counter overhead: %ld cycles\n\n", counter_overhead );
+ _mesa_printf("counter overhead: %ld cycles\n\n", counter_overhead );
}
- printf( "transform results after hooking in %s functions:\n", description );
+ _mesa_printf("transform results after hooking in %s functions:\n", description );
}
#endif
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile ) {
- printf( "\n" );
+ _mesa_printf("\n" );
for ( psize = 1 ; psize <= 4 ; psize++ ) {
- printf( " p%d\t", psize );
+ _mesa_printf(" p%d\t", psize );
}
- printf( "\n--------------------------------------------------------\n" );
+ _mesa_printf("\n--------------------------------------------------------\n" );
}
#endif
@@ -303,23 +310,23 @@ void _math_test_all_transform_functions( char *description )
if ( test_transform_function( func, psize, mtype, cycles ) == 0 ) {
char buf[100];
- sprintf( buf, "_mesa_transform_tab[0][%d][%s] failed test (%s)",
+ _mesa_sprintf(buf, "_mesa_transform_tab[0][%d][%s] failed test (%s)",
psize, mstrings[mtype], description );
_mesa_problem( NULL, buf );
}
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile )
- printf( " %li\t", benchmark_tab[psize-1][mtype] );
+ _mesa_printf(" %li\t", benchmark_tab[psize-1][mtype] );
#endif
}
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile )
- printf( " | [%s]\n", mstrings[mtype] );
+ _mesa_printf(" | [%s]\n", mstrings[mtype] );
#endif
}
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile )
- printf( "\n" );
+ _mesa_printf( "\n" );
#endif
}
diff --git a/xc/extras/Mesa/src/math/m_matrix.c b/xc/extras/Mesa/src/math/m_matrix.c
index 8653c0c46..9f17e2cfc 100644
--- a/xc/extras/Mesa/src/math/m_matrix.c
+++ b/xc/extras/Mesa/src/math/m_matrix.c
@@ -1,8 +1,7 @@
-/* $Id: m_matrix.c,v 1.1.1.1 2002/10/22 13:06:30 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.2
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -23,7 +22,6 @@
* AN ACTION 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/extras/Mesa/src/math/m_matrix.c,v 1.2 2002/09/12 15:16:51 tsi Exp $ */
/*
@@ -35,11 +33,10 @@
* 3. Transformation of a point p by a matrix M is: p' = M * p
*/
-#include <math.h>
-
#include "glheader.h"
+#include "imports.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "m_matrix.h"
@@ -137,25 +134,25 @@ static void print_matrix_floats( const GLfloat m[16] )
{
int i;
for (i=0;i<4;i++) {
- fprintf(stderr,"\t%f %f %f %f\n", m[i], m[4+i], m[8+i], m[12+i] );
+ _mesa_debug(NULL,"\t%f %f %f %f\n", m[i], m[4+i], m[8+i], m[12+i] );
}
}
void
_math_matrix_print( const GLmatrix *m )
{
- fprintf(stderr, "Matrix type: %s, flags: %x\n", types[m->type], m->flags);
+ _mesa_debug(NULL, "Matrix type: %s, flags: %x\n", types[m->type], m->flags);
print_matrix_floats(m->m);
- fprintf(stderr, "Inverse: \n");
+ _mesa_debug(NULL, "Inverse: \n");
if (m->inv) {
GLfloat prod[16];
print_matrix_floats(m->inv);
matmul4(prod, m->m, m->inv);
- fprintf(stderr, "Mat * Inverse:\n");
+ _mesa_debug(NULL, "Mat * Inverse:\n");
print_matrix_floats(prod);
}
else {
- fprintf(stderr, " - not available\n");
+ _mesa_debug(NULL, " - not available\n");
}
}
@@ -470,6 +467,7 @@ static GLboolean invert_matrix_2d_no_rot( GLmatrix *mat )
#if 0
+/* broken */
static GLboolean invert_matrix_perspective( GLmatrix *mat )
{
const GLfloat *in = mat->m;
@@ -538,123 +536,181 @@ static GLboolean matrix_invert( GLmatrix *mat )
/*
* Generate a 4x4 transformation matrix from glRotate parameters, and
* postmultiply the input matrix by it.
+ * This function contributed by Erich Boleyn (erich@uruk.org).
+ * Optimizatios contributed by Rudolf Opalla (rudi@khm.de).
*/
void
_math_matrix_rotate( GLmatrix *mat,
GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
{
- /* This function contributed by Erich Boleyn (erich@uruk.org) */
- GLfloat mag, s, c;
- GLfloat xx, yy, zz, xy, yz, zx, xs, ys, zs, one_c;
+ GLfloat xx, yy, zz, xy, yz, zx, xs, ys, zs, one_c, s, c;
GLfloat m[16];
+ GLboolean optimized;
s = (GLfloat) sin( angle * DEG2RAD );
c = (GLfloat) cos( angle * DEG2RAD );
- mag = (GLfloat) GL_SQRT( x*x + y*y + z*z );
+ MEMCPY(m, Identity, sizeof(GLfloat)*16);
+ optimized = GL_FALSE;
- if (mag <= 1.0e-4) {
- /* generate an identity matrix and return */
- MEMCPY(m, Identity, sizeof(GLfloat)*16);
- return;
- }
+#define M(row,col) m[col*4+row]
- x /= mag;
- y /= mag;
- z /= mag;
+ if (x == 0.0F) {
+ if (y == 0.0F) {
+ if (z != 0.0F) {
+ optimized = GL_TRUE;
+ /* rotate only around z-axis */
+ M(0,0) = c;
+ M(1,1) = c;
+ if (z < 0.0F) {
+ M(0,1) = s;
+ M(1,0) = -s;
+ }
+ else {
+ M(0,1) = -s;
+ M(1,0) = s;
+ }
+ }
+ }
+ else if (z == 0.0F) {
+ optimized = GL_TRUE;
+ /* rotate only around y-axis */
+ M(0,0) = c;
+ M(2,2) = c;
+ if (y < 0.0F) {
+ M(0,2) = -s;
+ M(2,0) = s;
+ }
+ else {
+ M(0,2) = s;
+ M(2,0) = -s;
+ }
+ }
+ }
+ else if (y == 0.0F) {
+ if (z == 0.0F) {
+ optimized = GL_TRUE;
+ /* rotate only around x-axis */
+ M(1,1) = c;
+ M(2,2) = c;
+ if (y < 0.0F) {
+ M(1,2) = s;
+ M(2,1) = -s;
+ }
+ else {
+ M(1,2) = -s;
+ M(2,1) = s;
+ }
+ }
+ }
-#define M(row,col) m[col*4+row]
+ if (!optimized) {
+ const GLfloat mag = (GLfloat) GL_SQRT(x * x + y * y + z * z);
- /*
- * Arbitrary axis rotation matrix.
- *
- * This is composed of 5 matrices, Rz, Ry, T, Ry', Rz', multiplied
- * like so: Rz * Ry * T * Ry' * Rz'. T is the final rotation
- * (which is about the X-axis), and the two composite transforms
- * Ry' * Rz' and Rz * Ry are (respectively) the rotations necessary
- * from the arbitrary axis to the X-axis then back. They are
- * all elementary rotations.
- *
- * Rz' is a rotation about the Z-axis, to bring the axis vector
- * into the x-z plane. Then Ry' is applied, rotating about the
- * Y-axis to bring the axis vector parallel with the X-axis. The
- * rotation about the X-axis is then performed. Ry and Rz are
- * simply the respective inverse transforms to bring the arbitrary
- * axis back to it's original orientation. The first transforms
- * Rz' and Ry' are considered inverses, since the data from the
- * arbitrary axis gives you info on how to get to it, not how
- * to get away from it, and an inverse must be applied.
- *
- * The basic calculation used is to recognize that the arbitrary
- * axis vector (x, y, z), since it is of unit length, actually
- * represents the sines and cosines of the angles to rotate the
- * X-axis to the same orientation, with theta being the angle about
- * Z and phi the angle about Y (in the order described above)
- * as follows:
- *
- * cos ( theta ) = x / sqrt ( 1 - z^2 )
- * sin ( theta ) = y / sqrt ( 1 - z^2 )
- *
- * cos ( phi ) = sqrt ( 1 - z^2 )
- * sin ( phi ) = z
- *
- * Note that cos ( phi ) can further be inserted to the above
- * formulas:
- *
- * cos ( theta ) = x / cos ( phi )
- * sin ( theta ) = y / sin ( phi )
- *
- * ...etc. Because of those relations and the standard trigonometric
- * relations, it is pssible to reduce the transforms down to what
- * is used below. It may be that any primary axis chosen will give the
- * same results (modulo a sign convention) using thie method.
- *
- * Particularly nice is to notice that all divisions that might
- * have caused trouble when parallel to certain planes or
- * axis go away with care paid to reducing the expressions.
- * After checking, it does perform correctly under all cases, since
- * in all the cases of division where the denominator would have
- * been zero, the numerator would have been zero as well, giving
- * the expected result.
- */
+ if (mag <= 1.0e-4) {
+ /* no rotation, leave mat as-is */
+ return;
+ }
- xx = x * x;
- yy = y * y;
- zz = z * z;
- xy = x * y;
- yz = y * z;
- zx = z * x;
- xs = x * s;
- ys = y * s;
- zs = z * s;
- one_c = 1.0F - c;
-
- M(0,0) = (one_c * xx) + c;
- M(0,1) = (one_c * xy) - zs;
- M(0,2) = (one_c * zx) + ys;
- M(0,3) = 0.0F;
-
- M(1,0) = (one_c * xy) + zs;
- M(1,1) = (one_c * yy) + c;
- M(1,2) = (one_c * yz) - xs;
- M(1,3) = 0.0F;
-
- M(2,0) = (one_c * zx) - ys;
- M(2,1) = (one_c * yz) + xs;
- M(2,2) = (one_c * zz) + c;
- M(2,3) = 0.0F;
-
- M(3,0) = 0.0F;
- M(3,1) = 0.0F;
- M(3,2) = 0.0F;
- M(3,3) = 1.0F;
+ x /= mag;
+ y /= mag;
+ z /= mag;
+
+
+ /*
+ * Arbitrary axis rotation matrix.
+ *
+ * This is composed of 5 matrices, Rz, Ry, T, Ry', Rz', multiplied
+ * like so: Rz * Ry * T * Ry' * Rz'. T is the final rotation
+ * (which is about the X-axis), and the two composite transforms
+ * Ry' * Rz' and Rz * Ry are (respectively) the rotations necessary
+ * from the arbitrary axis to the X-axis then back. They are
+ * all elementary rotations.
+ *
+ * Rz' is a rotation about the Z-axis, to bring the axis vector
+ * into the x-z plane. Then Ry' is applied, rotating about the
+ * Y-axis to bring the axis vector parallel with the X-axis. The
+ * rotation about the X-axis is then performed. Ry and Rz are
+ * simply the respective inverse transforms to bring the arbitrary
+ * axis back to it's original orientation. The first transforms
+ * Rz' and Ry' are considered inverses, since the data from the
+ * arbitrary axis gives you info on how to get to it, not how
+ * to get away from it, and an inverse must be applied.
+ *
+ * The basic calculation used is to recognize that the arbitrary
+ * axis vector (x, y, z), since it is of unit length, actually
+ * represents the sines and cosines of the angles to rotate the
+ * X-axis to the same orientation, with theta being the angle about
+ * Z and phi the angle about Y (in the order described above)
+ * as follows:
+ *
+ * cos ( theta ) = x / sqrt ( 1 - z^2 )
+ * sin ( theta ) = y / sqrt ( 1 - z^2 )
+ *
+ * cos ( phi ) = sqrt ( 1 - z^2 )
+ * sin ( phi ) = z
+ *
+ * Note that cos ( phi ) can further be inserted to the above
+ * formulas:
+ *
+ * cos ( theta ) = x / cos ( phi )
+ * sin ( theta ) = y / sin ( phi )
+ *
+ * ...etc. Because of those relations and the standard trigonometric
+ * relations, it is pssible to reduce the transforms down to what
+ * is used below. It may be that any primary axis chosen will give the
+ * same results (modulo a sign convention) using thie method.
+ *
+ * Particularly nice is to notice that all divisions that might
+ * have caused trouble when parallel to certain planes or
+ * axis go away with care paid to reducing the expressions.
+ * After checking, it does perform correctly under all cases, since
+ * in all the cases of division where the denominator would have
+ * been zero, the numerator would have been zero as well, giving
+ * the expected result.
+ */
+
+ xx = x * x;
+ yy = y * y;
+ zz = z * z;
+ xy = x * y;
+ yz = y * z;
+ zx = z * x;
+ xs = x * s;
+ ys = y * s;
+ zs = z * s;
+ one_c = 1.0F - c;
+
+ /* We already hold the identity-matrix so we can skip some statements */
+ M(0,0) = (one_c * xx) + c;
+ M(0,1) = (one_c * xy) - zs;
+ M(0,2) = (one_c * zx) + ys;
+/* M(0,3) = 0.0F; */
+
+ M(1,0) = (one_c * xy) + zs;
+ M(1,1) = (one_c * yy) + c;
+ M(1,2) = (one_c * yz) - xs;
+/* M(1,3) = 0.0F; */
+
+ M(2,0) = (one_c * zx) - ys;
+ M(2,1) = (one_c * yz) + xs;
+ M(2,2) = (one_c * zz) + c;
+/* M(2,3) = 0.0F; */
+/*
+ M(3,0) = 0.0F;
+ M(3,1) = 0.0F;
+ M(3,2) = 0.0F;
+ M(3,3) = 1.0F;
+*/
+ }
#undef M
matrix_multf( mat, m, MAT_FLAG_ROTATION );
}
+
void
_math_matrix_frustum( GLmatrix *mat,
GLfloat left, GLfloat right,
@@ -985,11 +1041,10 @@ _math_matrix_loadf( GLmatrix *mat, const GLfloat *m )
void
_math_matrix_ctr( GLmatrix *m )
{
- if ( m->m == 0 ) {
- m->m = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 );
- }
- MEMCPY( m->m, Identity, sizeof(Identity) );
- m->inv = 0;
+ m->m = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 );
+ if (m->m)
+ MEMCPY( m->m, Identity, sizeof(Identity) );
+ m->inv = NULL;
m->type = MATRIX_IDENTITY;
m->flags = 0;
}
@@ -997,13 +1052,13 @@ _math_matrix_ctr( GLmatrix *m )
void
_math_matrix_dtr( GLmatrix *m )
{
- if ( m->m != 0 ) {
+ if (m->m) {
ALIGN_FREE( m->m );
- m->m = 0;
+ m->m = NULL;
}
- if ( m->inv != 0 ) {
+ if (m->inv) {
ALIGN_FREE( m->inv );
- m->inv = 0;
+ m->inv = NULL;
}
}
@@ -1011,9 +1066,10 @@ _math_matrix_dtr( GLmatrix *m )
void
_math_matrix_alloc_inv( GLmatrix *m )
{
- if ( m->inv == 0 ) {
+ if (!m->inv) {
m->inv = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 );
- MEMCPY( m->inv, Identity, 16 * sizeof(GLfloat) );
+ if (m->inv)
+ MEMCPY( m->inv, Identity, 16 * sizeof(GLfloat) );
}
}
diff --git a/xc/extras/Mesa/src/math/m_norm_tmp.h b/xc/extras/Mesa/src/math/m_norm_tmp.h
index b0e3e1785..90ca38093 100644
--- a/xc/extras/Mesa/src/math/m_norm_tmp.h
+++ b/xc/extras/Mesa/src/math/m_norm_tmp.h
@@ -1,10 +1,9 @@
-/* $Id: m_norm_tmp.h,v 1.1.1.1 2002/10/22 13:06:32 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -28,25 +27,34 @@
* New (3.1) transformation code written by Keith Whitwell.
*/
-#include <math.h>
-#include "m_vertices.h"
+/* Functions to tranform a vector of normals. This includes applying
+ * the transformation matrix, rescaling and normalization.
+ */
+/*
+ * mat - the 4x4 transformation matrix
+ * scale - uniform scale factor of the transformation matrix (not always used)
+ * in - the source vector of normals
+ * lengths - length of each incoming normal (may be NULL) (a display list
+ * optimization)
+ * dest - the destination vector of normals
+ */
static void _XFORMAPI
TAG(transform_normalize_normals)( const GLmatrix *mat,
GLfloat scale,
- const GLvector3f *in,
+ const GLvector4f *in,
const GLfloat *lengths,
- GLvector3f *dest )
+ GLvector4f *dest )
{
- GLuint i;
+ GLfloat (*out)[4] = (GLfloat (*)[4])dest->start;
const GLfloat *from = in->start;
- GLuint stride = in->stride;
- GLuint count = in->count;
- GLfloat (*out)[3] = (GLfloat (*)[3])dest->start;
- GLfloat *m = mat->inv;
+ const GLuint stride = in->stride;
+ const GLuint count = in->count;
+ const GLfloat *m = mat->inv;
GLfloat m0 = m[0], m4 = m[4], m8 = m[8];
GLfloat m1 = m[1], m5 = m[5], m9 = m[9];
GLfloat m2 = m[2], m6 = m[6], m10 = m[10];
+ GLuint i;
if (!lengths) {
STRIDE_LOOP {
@@ -65,8 +73,7 @@ TAG(transform_normalize_normals)( const GLmatrix *mat,
out[i][1] = (GLfloat) (ty * scale);
out[i][2] = (GLfloat) (tz * scale);
}
- else
- {
+ else {
out[i][0] = out[i][1] = out[i][2] = 0;
}
}
@@ -102,19 +109,20 @@ TAG(transform_normalize_normals)( const GLmatrix *mat,
static void _XFORMAPI
TAG(transform_normalize_normals_no_rot)( const GLmatrix *mat,
GLfloat scale,
- const GLvector3f *in,
+ const GLvector4f *in,
const GLfloat *lengths,
- GLvector3f *dest )
+ GLvector4f *dest )
{
- GLuint i;
+ GLfloat (*out)[4] = (GLfloat (*)[4])dest->start;
const GLfloat *from = in->start;
- GLuint stride = in->stride;
- GLuint count = in->count;
- GLfloat (*out)[3] = (GLfloat (*)[3])dest->start;
- GLfloat *m = mat->inv;
+ const GLuint stride = in->stride;
+ const GLuint count = in->count;
+ const GLfloat *m = mat->inv;
GLfloat m0 = m[0];
GLfloat m5 = m[5];
GLfloat m10 = m[10];
+ GLuint i;
+
if (!lengths) {
STRIDE_LOOP {
GLfloat tx, ty, tz;
@@ -132,8 +140,7 @@ TAG(transform_normalize_normals_no_rot)( const GLmatrix *mat,
out[i][1] = (GLfloat) (ty * scale);
out[i][2] = (GLfloat) (tz * scale);
}
- else
- {
+ else {
out[i][0] = out[i][1] = out[i][2] = 0;
}
}
@@ -167,20 +174,22 @@ TAG(transform_normalize_normals_no_rot)( const GLmatrix *mat,
static void _XFORMAPI
TAG(transform_rescale_normals_no_rot)( const GLmatrix *mat,
GLfloat scale,
- const GLvector3f *in,
+ const GLvector4f *in,
const GLfloat *lengths,
- GLvector3f *dest )
+ GLvector4f *dest )
{
- GLuint i;
+ GLfloat (*out)[4] = (GLfloat (*)[4])dest->start;
const GLfloat *from = in->start;
- GLuint stride = in->stride;
- GLuint count = in->count;
- GLfloat (*out)[3] = (GLfloat (*)[3])dest->start;
+ const GLuint stride = in->stride;
+ const GLuint count = in->count;
const GLfloat *m = mat->inv;
- GLfloat m0 = scale*m[0];
- GLfloat m5 = scale*m[5];
- GLfloat m10 = scale*m[10];
+ const GLfloat m0 = scale*m[0];
+ const GLfloat m5 = scale*m[5];
+ const GLfloat m10 = scale*m[10];
+ GLuint i;
+
(void) lengths;
+
STRIDE_LOOP {
GLfloat ux = from[0], uy = from[1], uz = from[2];
out[i][0] = ux * m0;
@@ -190,26 +199,29 @@ TAG(transform_rescale_normals_no_rot)( const GLmatrix *mat,
dest->count = in->count;
}
+
static void _XFORMAPI
TAG(transform_rescale_normals)( const GLmatrix *mat,
GLfloat scale,
- const GLvector3f *in,
+ const GLvector4f *in,
const GLfloat *lengths,
- GLvector3f *dest )
+ GLvector4f *dest )
{
- GLuint i;
+ GLfloat (*out)[4] = (GLfloat (*)[4])dest->start;
const GLfloat *from = in->start;
- GLuint stride = in->stride;
- GLuint count = in->count;
- GLfloat (*out)[3] = (GLfloat (*)[3])dest->start;
+ const GLuint stride = in->stride;
+ const GLuint count = in->count;
/* Since we are unlikely to have < 3 vertices in the buffer,
* it makes sense to pre-multiply by scale.
*/
const GLfloat *m = mat->inv;
- GLfloat m0 = scale*m[0], m4 = scale*m[4], m8 = scale*m[8];
- GLfloat m1 = scale*m[1], m5 = scale*m[5], m9 = scale*m[9];
- GLfloat m2 = scale*m[2], m6 = scale*m[6], m10 = scale*m[10];
+ const GLfloat m0 = scale*m[0], m4 = scale*m[4], m8 = scale*m[8];
+ const GLfloat m1 = scale*m[1], m5 = scale*m[5], m9 = scale*m[9];
+ const GLfloat m2 = scale*m[2], m6 = scale*m[6], m10 = scale*m[10];
+ GLuint i;
+
(void) lengths;
+
STRIDE_LOOP {
GLfloat ux = from[0], uy = from[1], uz = from[2];
out[i][0] = ux * m0 + uy * m1 + uz * m2;
@@ -223,21 +235,23 @@ TAG(transform_rescale_normals)( const GLmatrix *mat,
static void _XFORMAPI
TAG(transform_normals_no_rot)( const GLmatrix *mat,
GLfloat scale,
- const GLvector3f *in,
+ const GLvector4f *in,
const GLfloat *lengths,
- GLvector3f *dest )
+ GLvector4f *dest )
{
- GLuint i;
+ GLfloat (*out)[4] = (GLfloat (*)[4])dest->start;
const GLfloat *from = in->start;
- GLuint stride = in->stride;
- GLuint count = in->count;
- GLfloat (*out)[3] = (GLfloat (*)[3])dest->start;
+ const GLuint stride = in->stride;
+ const GLuint count = in->count;
const GLfloat *m = mat->inv;
- GLfloat m0 = m[0];
- GLfloat m5 = m[5];
- GLfloat m10 = m[10];
+ const GLfloat m0 = m[0];
+ const GLfloat m5 = m[5];
+ const GLfloat m10 = m[10];
+ GLuint i;
+
(void) scale;
(void) lengths;
+
STRIDE_LOOP {
GLfloat ux = from[0], uy = from[1], uz = from[2];
out[i][0] = ux * m0;
@@ -251,21 +265,23 @@ TAG(transform_normals_no_rot)( const GLmatrix *mat,
static void _XFORMAPI
TAG(transform_normals)( const GLmatrix *mat,
GLfloat scale,
- const GLvector3f *in,
+ const GLvector4f *in,
const GLfloat *lengths,
- GLvector3f *dest )
+ GLvector4f *dest )
{
- GLuint i;
+ GLfloat (*out)[4] = (GLfloat (*)[4])dest->start;
const GLfloat *from = in->start;
- GLuint stride = in->stride;
- GLuint count = in->count;
- GLfloat (*out)[3] = (GLfloat (*)[3])dest->start;
+ const GLuint stride = in->stride;
+ const GLuint count = in->count;
const GLfloat *m = mat->inv;
- GLfloat m0 = m[0], m4 = m[4], m8 = m[8];
- GLfloat m1 = m[1], m5 = m[5], m9 = m[9];
- GLfloat m2 = m[2], m6 = m[6], m10 = m[10];
+ const GLfloat m0 = m[0], m4 = m[4], m8 = m[8];
+ const GLfloat m1 = m[1], m5 = m[5], m9 = m[9];
+ const GLfloat m2 = m[2], m6 = m[6], m10 = m[10];
+ GLuint i;
+
(void) scale;
(void) lengths;
+
STRIDE_LOOP {
GLfloat ux = from[0], uy = from[1], uz = from[2];
out[i][0] = ux * m0 + uy * m1 + uz * m2;
@@ -279,17 +295,19 @@ TAG(transform_normals)( const GLmatrix *mat,
static void _XFORMAPI
TAG(normalize_normals)( const GLmatrix *mat,
GLfloat scale,
- const GLvector3f *in,
+ const GLvector4f *in,
const GLfloat *lengths,
- GLvector3f *dest )
+ GLvector4f *dest )
{
- GLuint i;
+ GLfloat (*out)[4] = (GLfloat (*)[4])dest->start;
const GLfloat *from = in->start;
- GLuint stride = in->stride;
- GLuint count = in->count;
- GLfloat (*out)[3] = (GLfloat (*)[3])dest->start;
+ const GLuint stride = in->stride;
+ const GLuint count = in->count;
+ GLuint i;
+
(void) mat;
(void) scale;
+
if (lengths) {
STRIDE_LOOP {
const GLfloat x = from[0], y = from[1], z = from[2];
@@ -323,17 +341,19 @@ TAG(normalize_normals)( const GLmatrix *mat,
static void _XFORMAPI
TAG(rescale_normals)( const GLmatrix *mat,
GLfloat scale,
- const GLvector3f *in,
+ const GLvector4f *in,
const GLfloat *lengths,
- GLvector3f *dest )
+ GLvector4f *dest )
{
- GLuint i;
+ GLfloat (*out)[4] = (GLfloat (*)[4])dest->start;
const GLfloat *from = in->start;
- GLuint stride = in->stride;
- GLuint count = in->count;
- GLfloat (*out)[3] = (GLfloat (*)[3])dest->start;
+ const GLuint stride = in->stride;
+ const GLuint count = in->count;
+ GLuint i;
+
(void) mat;
(void) lengths;
+
STRIDE_LOOP {
SCALE_SCALAR_3V( out[i], scale, from );
}
diff --git a/xc/extras/Mesa/src/math/m_translate.c b/xc/extras/Mesa/src/math/m_translate.c
index 6e4dcee06..9cf0c39a3 100644
--- a/xc/extras/Mesa/src/math/m_translate.c
+++ b/xc/extras/Mesa/src/math/m_translate.c
@@ -1,10 +1,9 @@
-/* $Id: m_translate.c,v 1.1.1.1 2002/10/22 13:06:28 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -32,7 +31,6 @@
#include "glheader.h"
#include "mtypes.h" /* GLchan hack */
#include "colormac.h"
-#include "mem.h"
#include "mmath.h"
#include "m_translate.h"
diff --git a/xc/extras/Mesa/src/math/m_vector.c b/xc/extras/Mesa/src/math/m_vector.c
index c04143be2..e01c87d67 100644
--- a/xc/extras/Mesa/src/math/m_vector.c
+++ b/xc/extras/Mesa/src/math/m_vector.c
@@ -1,4 +1,3 @@
-/* $Id: m_vector.c,v 1.1.1.1 2002/10/22 13:06:29 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -30,8 +29,9 @@
#include "glheader.h"
+#include "imports.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "m_vector.h"
@@ -367,36 +367,36 @@ void _mesa_vector4f_print( GLvector4f *v, GLubyte *cullmask, GLboolean culling )
GLfloat *d = (GLfloat *)v->data;
GLuint j, i = 0, count;
- printf("data-start\n");
+ _mesa_printf("data-start\n");
for ( ; d != v->start ; STRIDE_F(d, v->stride), i++)
- printf( t, i, d[0], d[1], d[2], d[3]);
+ _mesa_printf(t, i, d[0], d[1], d[2], d[3]);
- printf("start-count(%u)\n", v->count);
+ _mesa_printf("start-count(%u)\n", v->count);
count = i + v->count;
if (culling) {
for ( ; i < count ; STRIDE_F(d, v->stride), i++)
if (cullmask[i])
- printf( t, i, d[0], d[1], d[2], d[3]);
+ _mesa_printf(t, i, d[0], d[1], d[2], d[3]);
}
else {
for ( ; i < count ; STRIDE_F(d, v->stride), i++)
- printf( t, i, d[0], d[1], d[2], d[3]);
+ _mesa_printf(t, i, d[0], d[1], d[2], d[3]);
}
for (j = v->size ; j < 4; j++) {
if ((v->flags & (1<<j)) == 0) {
- printf("checking col %u is clean as advertised ", j);
+ _mesa_printf("checking col %u is clean as advertised ", j);
for (i = 0, d = (GLfloat *) v->data ;
i < count && d[j] == c[j] ;
i++, STRIDE_F(d, v->stride)) {};
if (i == count)
- printf(" --> ok\n");
+ _mesa_printf(" --> ok\n");
else
- printf(" --> Failed at %u ******\n", i);
+ _mesa_printf(" --> Failed at %u ******\n", i);
}
}
}
@@ -410,20 +410,20 @@ void _mesa_vector3f_print( GLvector3f *v, GLubyte *cullmask, GLboolean culling )
GLfloat *d = (GLfloat *)v->data;
GLuint i = 0, count;
- printf("data-start\n");
+ _mesa_printf("data-start\n");
for ( ; d != v->start ; STRIDE_F(d,v->stride), i++)
- printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]);
+ _mesa_printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]);
- printf("start-count(%u)\n", v->count);
+ _mesa_printf("start-count(%u)\n", v->count);
count = i + v->count;
if (culling) {
for ( ; i < count ; STRIDE_F(d,v->stride), i++)
if (cullmask[i])
- printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]);
+ _mesa_printf("%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]);
}
else {
for ( ; i < count ; STRIDE_F(d,v->stride), i++)
- printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]);
+ _mesa_printf("%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]);
}
}
diff --git a/xc/extras/Mesa/src/math/m_xform.c b/xc/extras/Mesa/src/math/m_xform.c
index 183d58fa6..be8a74a78 100644
--- a/xc/extras/Mesa/src/math/m_xform.c
+++ b/xc/extras/Mesa/src/math/m_xform.c
@@ -1,4 +1,3 @@
-/* $Id: m_xform.c,v 1.1.1.1 2002/10/22 13:06:31 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -35,8 +34,6 @@
* 3. Transformation of a point p by a matrix M is: p' = M * p
*/
-#include <math.h>
-
#include "glheader.h"
#include "macros.h"
#include "mmath.h"
@@ -220,6 +217,5 @@ _math_init( void )
{
_math_init_transformation();
_math_init_translate();
- _math_init_vertices();
_math_init_eval();
}
diff --git a/xc/extras/Mesa/src/math/m_xform.h b/xc/extras/Mesa/src/math/m_xform.h
index e4e31327a..badc29eaf 100644
--- a/xc/extras/Mesa/src/math/m_xform.h
+++ b/xc/extras/Mesa/src/math/m_xform.h
@@ -1,4 +1,3 @@
-/* $Id: m_xform.h,v 1.1.1.1 2002/10/22 13:06:31 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -155,9 +154,9 @@ typedef void (*vec_copy_func)( GLvector4f *to,
*/
typedef void (_NORMAPIP normal_func)( CONST GLmatrix *mat,
GLfloat scale,
- CONST GLvector3f *in,
+ CONST GLvector4f *in,
CONST GLfloat lengths[],
- GLvector3f *dest );
+ GLvector4f *dest );
/* Flags for selecting a normal transformation function.
diff --git a/xc/extras/Mesa/src/matrix.c b/xc/extras/Mesa/src/matrix.c
index c97b28951..b9c069cc2 100644
--- a/xc/extras/Mesa/src/matrix.c
+++ b/xc/extras/Mesa/src/matrix.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -34,52 +34,17 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "buffers.h"
#include "context.h"
#include "enums.h"
#include "macros.h"
#include "matrix.h"
-#include "mem.h"
#include "mmath.h"
#include "mtypes.h"
-
#include "math/m_matrix.h"
-#endif
-
-
-/**********************************************************************/
-/* API functions */
-/**********************************************************************/
-
-
-#define GET_ACTIVE_MATRIX(ctx, mat, flags, where) \
-do { \
- if (MESA_VERBOSE&VERBOSE_API) fprintf(stderr, "%s\n", where); \
- switch (ctx->Transform.MatrixMode) { \
- case GL_MODELVIEW: \
- mat = &ctx->ModelView; \
- flags |= _NEW_MODELVIEW; \
- break; \
- case GL_PROJECTION: \
- mat = &ctx->ProjectionMatrix; \
- flags |= _NEW_PROJECTION; \
- break; \
- case GL_TEXTURE: \
- mat = &ctx->TextureMatrix[ctx->Texture.CurrentUnit]; \
- flags |= _NEW_TEXTURE_MATRIX; \
- break; \
- case GL_COLOR: \
- mat = &ctx->ColorMatrix; \
- flags |= _NEW_COLOR_MATRIX; \
- break; \
- default: \
- _mesa_problem(ctx, where); \
- } \
-} while (0)
+
void
@@ -88,11 +53,8 @@ _mesa_Frustum( GLdouble left, GLdouble right,
GLdouble nearval, GLdouble farval )
{
GET_CURRENT_CONTEXT(ctx);
- GLmatrix *mat = 0;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- GET_ACTIVE_MATRIX( ctx, mat, ctx->NewState, "glFrustrum" );
-
if (nearval <= 0.0 ||
farval <= 0.0 ||
nearval == farval ||
@@ -103,9 +65,11 @@ _mesa_Frustum( GLdouble left, GLdouble right,
return;
}
- _math_matrix_frustum( mat, (GLfloat) left, (GLfloat) right,
+ _math_matrix_frustum( ctx->CurrentStack->Top,
+ (GLfloat) left, (GLfloat) right,
(GLfloat) bottom, (GLfloat) top,
(GLfloat) nearval, (GLfloat) farval );
+ ctx->NewState |= ctx->CurrentStack->DirtyFlag;
}
@@ -115,10 +79,11 @@ _mesa_Ortho( GLdouble left, GLdouble right,
GLdouble nearval, GLdouble farval )
{
GET_CURRENT_CONTEXT(ctx);
- GLmatrix *mat = 0;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- GET_ACTIVE_MATRIX( ctx, mat, ctx->NewState, "glOrtho" );
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glFrustum(%f, %f, %f, %f, %f, %f)\n",
+ left, right, bottom, top, nearval, farval);
if (left == right ||
bottom == top ||
@@ -128,9 +93,11 @@ _mesa_Ortho( GLdouble left, GLdouble right,
return;
}
- _math_matrix_ortho( mat, (GLfloat) left, (GLfloat) right,
+ _math_matrix_ortho( ctx->CurrentStack->Top,
+ (GLfloat) left, (GLfloat) right,
(GLfloat) bottom, (GLfloat) top,
(GLfloat) nearval, (GLfloat) farval );
+ ctx->NewState |= ctx->CurrentStack->DirtyFlag;
}
@@ -140,19 +107,43 @@ _mesa_MatrixMode( GLenum mode )
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
+ if (ctx->Transform.MatrixMode == mode && mode != GL_TEXTURE)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+
switch (mode) {
- case GL_MODELVIEW:
- case GL_PROJECTION:
- case GL_TEXTURE:
- case GL_COLOR:
- if (ctx->Transform.MatrixMode == mode)
- return;
- ctx->Transform.MatrixMode = mode;
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
- break;
- default:
+ case GL_MODELVIEW:
+ ctx->CurrentStack = &ctx->ModelviewMatrixStack;
+ break;
+ case GL_PROJECTION:
+ ctx->CurrentStack = &ctx->ProjectionMatrixStack;
+ break;
+ case GL_TEXTURE:
+ ctx->CurrentStack = &ctx->TextureMatrixStack[ctx->Texture.CurrentUnit];
+ break;
+ case GL_COLOR:
+ ctx->CurrentStack = &ctx->ColorMatrixStack;
+ break;
+ case GL_MATRIX0_NV:
+ case GL_MATRIX1_NV:
+ case GL_MATRIX2_NV:
+ case GL_MATRIX3_NV:
+ case GL_MATRIX4_NV:
+ case GL_MATRIX5_NV:
+ case GL_MATRIX6_NV:
+ case GL_MATRIX7_NV:
+ if (!ctx->Extensions.NV_vertex_program) {
_mesa_error( ctx, GL_INVALID_ENUM, "glMatrixMode" );
+ return;
+ }
+ ctx->CurrentStack = &ctx->ProgramMatrixStack[mode - GL_MATRIX0_NV];
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glMatrixMode" );
+ return;
}
+
+ ctx->Transform.MatrixMode = mode;
}
@@ -161,51 +152,22 @@ void
_mesa_PushMatrix( void )
{
GET_CURRENT_CONTEXT(ctx);
+ struct matrix_stack *stack = ctx->CurrentStack;
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glPushMatrix %s\n",
- _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
-
- switch (ctx->Transform.MatrixMode) {
- case GL_MODELVIEW:
- if (ctx->ModelViewStackDepth >= MAX_MODELVIEW_STACK_DEPTH - 1) {
- _mesa_error( ctx, GL_STACK_OVERFLOW, "glPushMatrix");
- return;
- }
- _math_matrix_copy( &ctx->ModelViewStack[ctx->ModelViewStackDepth++],
- &ctx->ModelView );
- break;
- case GL_PROJECTION:
- if (ctx->ProjectionStackDepth >= MAX_PROJECTION_STACK_DEPTH - 1) {
- _mesa_error( ctx, GL_STACK_OVERFLOW, "glPushMatrix");
- return;
- }
- _math_matrix_copy( &ctx->ProjectionStack[ctx->ProjectionStackDepth++],
- &ctx->ProjectionMatrix );
- break;
- case GL_TEXTURE:
- {
- GLuint t = ctx->Texture.CurrentUnit;
- if (ctx->TextureStackDepth[t] >= MAX_TEXTURE_STACK_DEPTH - 1) {
- _mesa_error( ctx, GL_STACK_OVERFLOW, "glPushMatrix");
- return;
- }
- _math_matrix_copy( &ctx->TextureStack[t][ctx->TextureStackDepth[t]++],
- &ctx->TextureMatrix[t] );
- }
- break;
- case GL_COLOR:
- if (ctx->ColorStackDepth >= MAX_COLOR_STACK_DEPTH - 1) {
- _mesa_error( ctx, GL_STACK_OVERFLOW, "glPushMatrix");
- return;
- }
- _math_matrix_copy( &ctx->ColorStack[ctx->ColorStackDepth++],
- &ctx->ColorMatrix );
- break;
- default:
- _mesa_problem(ctx, "Bad matrix mode in _mesa_PushMatrix");
+ _mesa_debug(ctx, "glPushMatrix %s\n",
+ _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
+
+ if (stack->Depth + 1 >= stack->MaxDepth) {
+ _mesa_error( ctx, GL_STACK_OVERFLOW, "glPushMatrix" );
+ return;
}
+ _math_matrix_copy( &stack->Stack[stack->Depth + 1],
+ &stack->Stack[stack->Depth] );
+ stack->Depth++;
+ stack->Top = &(stack->Stack[stack->Depth]);
+ ctx->NewState |= stack->DirtyFlag;
}
@@ -214,56 +176,20 @@ void
_mesa_PopMatrix( void )
{
GET_CURRENT_CONTEXT(ctx);
+ struct matrix_stack *stack = ctx->CurrentStack;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glPopMatrix %s\n",
- _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
-
- switch (ctx->Transform.MatrixMode) {
- case GL_MODELVIEW:
- if (ctx->ModelViewStackDepth==0) {
- _mesa_error( ctx, GL_STACK_UNDERFLOW, "glPopMatrix");
- return;
- }
- _math_matrix_copy( &ctx->ModelView,
- &ctx->ModelViewStack[--ctx->ModelViewStackDepth] );
- ctx->NewState |= _NEW_MODELVIEW;
- break;
- case GL_PROJECTION:
- if (ctx->ProjectionStackDepth==0) {
- _mesa_error( ctx, GL_STACK_UNDERFLOW, "glPopMatrix");
- return;
- }
-
- _math_matrix_copy( &ctx->ProjectionMatrix,
- &ctx->ProjectionStack[--ctx->ProjectionStackDepth] );
- ctx->NewState |= _NEW_PROJECTION;
- break;
- case GL_TEXTURE:
- {
- GLuint t = ctx->Texture.CurrentUnit;
- if (ctx->TextureStackDepth[t]==0) {
- _mesa_error( ctx, GL_STACK_UNDERFLOW, "glPopMatrix");
- return;
- }
- _math_matrix_copy(&ctx->TextureMatrix[t],
- &ctx->TextureStack[t][--ctx->TextureStackDepth[t]]);
- ctx->NewState |= _NEW_TEXTURE_MATRIX;
- }
- break;
- case GL_COLOR:
- if (ctx->ColorStackDepth==0) {
- _mesa_error( ctx, GL_STACK_UNDERFLOW, "glPopMatrix");
- return;
- }
- _math_matrix_copy(&ctx->ColorMatrix,
- &ctx->ColorStack[--ctx->ColorStackDepth]);
- ctx->NewState |= _NEW_COLOR_MATRIX;
- break;
- default:
- _mesa_problem(ctx, "Bad matrix mode in _mesa_PopMatrix");
+ _mesa_debug(ctx, "glPopMatrix %s\n",
+ _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
+
+ if (stack->Depth == 0) {
+ _mesa_error( ctx, GL_STACK_UNDERFLOW, "glPopMatrix" );
+ return;
}
+ stack->Depth--;
+ stack->Top = &(stack->Stack[stack->Depth]);
+ ctx->NewState |= stack->DirtyFlag;
}
@@ -272,10 +198,13 @@ void
_mesa_LoadIdentity( void )
{
GET_CURRENT_CONTEXT(ctx);
- GLmatrix *mat = 0;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glLoadIdentity");
- _math_matrix_set_identity( mat );
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glLoadIdentity()");
+
+ _math_matrix_set_identity( ctx->CurrentStack->Top );
+ ctx->NewState |= ctx->CurrentStack->DirtyFlag;
}
@@ -283,11 +212,18 @@ void
_mesa_LoadMatrixf( const GLfloat *m )
{
GET_CURRENT_CONTEXT(ctx);
- GLmatrix *mat = 0;
if (!m) return;
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx,
+ "glLoadMatrix(%f %f %f %f, %f %f %f %f, %f %f %f %f, %f %f %f %f\n",
+ m[0], m[4], m[8], m[12],
+ m[1], m[5], m[9], m[13],
+ m[2], m[6], m[10], m[14],
+ m[3], m[7], m[11], m[15]);
+
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glLoadMatrix");
- _math_matrix_loadf( mat, m );
+ _math_matrix_loadf( ctx->CurrentStack->Top, m );
+ ctx->NewState |= ctx->CurrentStack->DirtyFlag;
}
@@ -311,11 +247,17 @@ void
_mesa_MultMatrixf( const GLfloat *m )
{
GET_CURRENT_CONTEXT(ctx);
- GLmatrix *mat = 0;
if (!m) return;
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx,
+ "glMultMatrix(%f %f %f %f, %f %f %f %f, %f %f %f %f, %f %f %f %f\n",
+ m[0], m[4], m[8], m[12],
+ m[1], m[5], m[9], m[13],
+ m[2], m[6], m[10], m[14],
+ m[3], m[7], m[11], m[15]);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- GET_ACTIVE_MATRIX( ctx, mat, ctx->NewState, "glMultMatrix" );
- _math_matrix_mul_floats( mat, m );
+ _math_matrix_mul_floats( ctx->CurrentStack->Top, m );
+ ctx->NewState |= ctx->CurrentStack->DirtyFlag;
}
@@ -345,9 +287,8 @@ _mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (angle != 0.0F) {
- GLmatrix *mat = 0;
- GET_ACTIVE_MATRIX( ctx, mat, ctx->NewState, "glRotate" );
- _math_matrix_rotate( mat, angle, x, y, z );
+ _math_matrix_rotate( ctx->CurrentStack->Top, angle, x, y, z);
+ ctx->NewState |= ctx->CurrentStack->DirtyFlag;
}
}
@@ -365,10 +306,9 @@ void
_mesa_Scalef( GLfloat x, GLfloat y, GLfloat z )
{
GET_CURRENT_CONTEXT(ctx);
- GLmatrix *mat = 0;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glScale");
- _math_matrix_scale( mat, x, y, z );
+ _math_matrix_scale( ctx->CurrentStack->Top, x, y, z);
+ ctx->NewState |= ctx->CurrentStack->DirtyFlag;
}
@@ -386,10 +326,9 @@ void
_mesa_Translatef( GLfloat x, GLfloat y, GLfloat z )
{
GET_CURRENT_CONTEXT(ctx);
- GLmatrix *mat = 0;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glTranslate");
- _math_matrix_translate( mat, x, y, z );
+ _math_matrix_translate( ctx->CurrentStack->Top, x, y, z);
+ ctx->NewState |= ctx->CurrentStack->DirtyFlag;
}
@@ -463,14 +402,15 @@ _mesa_set_viewport( GLcontext *ctx, GLint x, GLint y,
const GLfloat n = ctx->Viewport.Near;
const GLfloat f = ctx->Viewport.Far;
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glViewport %d %d %d %d\n", x, y, width, height);
+
if (width < 0 || height < 0) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glViewport" );
+ _mesa_error( ctx, GL_INVALID_VALUE,
+ "glViewport(%d, %d, %d, %d)", x, y, width, height );
return;
}
- if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glViewport %d %d %d %d\n", x, y, width, height);
-
/* clamp width, and height to implementation dependent range */
width = CLAMP( width, 1, MAX_WIDTH );
height = CLAMP( height, 1, MAX_HEIGHT );
@@ -525,7 +465,7 @@ _mesa_DepthRange( GLclampd nearval, GLclampd farval )
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glDepthRange %f %f\n", nearval, farval);
+ _mesa_debug(ctx, "glDepthRange %f %f\n", nearval, farval);
n = (GLfloat) CLAMP( nearval, 0.0, 1.0 );
f = (GLfloat) CLAMP( farval, 0.0, 1.0 );
diff --git a/xc/extras/Mesa/src/mem.c b/xc/extras/Mesa/src/mem.c
deleted file mode 100644
index 511b5b05a..000000000
--- a/xc/extras/Mesa/src/mem.c
+++ /dev/null
@@ -1,251 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/*
- * Memory allocation functions. Called via the MALLOC, CALLOC and
- * FREE macros when DEBUG symbol is defined.
- * You might want to set breakpoints on these functions or plug in
- * other memory allocation functions. The Mesa sources should only
- * use the MALLOC and FREE macros (which could also be overriden).
- */
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include "glheader.h"
-#include "config.h"
-#include "macros.h"
-#include "mem.h"
-#endif
-
-
-#if defined(WIN32) && defined(_DEBUG)
-
-/*
- * N-byte aligned memory allocation functions. Called via the ALIGN_MALLOC,
- * ALIGN_CALLOC and ALIGN_FREE macros. Debug versions?
- * These functions allow dynamically allocated memory to be correctly
- * aligned for improved cache utilization and specialized assembly
- * support.
- */
-
-/*
- * Allocate N-byte aligned memory (uninitialized)
- */
-void *
-_mesa_align_malloc_dbg(size_t bytes, unsigned long alignment, const char *_file, int _line )
-{
- unsigned long ptr, buf;
-
- ASSERT( alignment > 0 );
-
- ptr = (unsigned long) _malloc_dbg( bytes + alignment, _NORMAL_BLOCK, _file, _line );
-
- buf = (ptr + alignment) & ~(unsigned long)(alignment - 1);
- *(unsigned long *)(buf - sizeof(void *)) = ptr;
-
-#ifdef DEBUG
- /* mark the non-aligned area */
- while ( ptr < buf - sizeof(void *) ) {
- *(unsigned long *)ptr = 0xcdcdcdcd;
- ptr += sizeof(unsigned long);
- }
-#endif
-
- return (void *)buf;
-}
-
-
-/*
- * Allocate N-byte aligned memory and initialize to zero
- */
-void *
-_mesa_align_calloc_dbg(size_t bytes, unsigned long alignment, const char *_file, int _line)
-{
- unsigned long ptr, buf;
-
- ASSERT( alignment > 0 );
-
- ptr = (unsigned long) _calloc_dbg( 1, bytes + alignment, _NORMAL_BLOCK, _file, _line );
-
- buf = (ptr + alignment) & ~(unsigned long)(alignment - 1);
- *(unsigned long *)(buf - sizeof(void *)) = ptr;
-
-#ifdef DEBUG
- /* mark the non-aligned area */
- while ( ptr < buf - sizeof(void *) ) {
- *(unsigned long *)ptr = 0xcdcdcdcd;
- ptr += sizeof(unsigned long);
- }
-#endif
-
- return (void *)buf;
-}
-
-
-/*
- * Free N-byte aligned memory
- */
-void
-_mesa_align_free_dbg(void *ptr, const char *_file, int _line)
-{
- /* The actuall address to free is stuffed in the word immediately
- * before the address the client sees.
- */
- void **cubbyHole = (void **) ((char *) ptr - sizeof(void *));
- void *realAddr = *cubbyHole;
- _free_dbg(realAddr, _NORMAL_BLOCK );
-}
-
-
-#else /* WIN32 && _DEBUG */
-
-
-/*
- * Allocate memory (uninitialized)
- */
-void *
-_mesa_malloc(size_t bytes)
-{
- return malloc(bytes);
-}
-
-
-/*
- * Allocate memory and initialize to zero.
- */
-void *
-_mesa_calloc(size_t bytes)
-{
- return calloc(1, bytes);
-}
-
-
-/*
- * Free memory
- */
-void
-_mesa_free(void *ptr)
-{
- free(ptr);
-}
-
-
-
-/*
- * N-byte aligned memory allocation functions. Called via the ALIGN_MALLOC,
- * ALIGN_CALLOC and ALIGN_FREE macros. Debug versions?
- * These functions allow dynamically allocated memory to be correctly
- * aligned for improved cache utilization and specialized assembly
- * support.
- */
-
-
-/*
- * Allocate N-byte aligned memory (uninitialized)
- */
-void *
-_mesa_align_malloc(size_t bytes, unsigned long alignment)
-{
- unsigned long ptr, buf;
-
- ASSERT( alignment > 0 );
-
- ptr = (unsigned long) MALLOC( bytes + alignment );
-
- buf = (ptr + alignment) & ~(unsigned long)(alignment - 1);
- *(unsigned long *)(buf - sizeof(void *)) = ptr;
-
-#ifdef DEBUG
- /* mark the non-aligned area */
- while ( ptr < buf - sizeof(void *) ) {
- *(unsigned long *)ptr = 0xcdcdcdcd;
- ptr += sizeof(unsigned long);
- }
-#endif
-
- return (void *)buf;
-}
-
-
-/*
- * Allocate N-byte aligned memory and initialize to zero
- */
-void *
-_mesa_align_calloc(size_t bytes, unsigned long alignment)
-{
- unsigned long ptr, buf;
-
- ASSERT( alignment > 0 );
-
- ptr = (unsigned long) CALLOC( bytes + alignment );
-
- buf = (ptr + alignment) & ~(unsigned long)(alignment - 1);
- *(unsigned long *)(buf - sizeof(void *)) = ptr;
-
-#ifdef DEBUG
- /* mark the non-aligned area */
- while ( ptr < buf - sizeof(void *) ) {
- *(unsigned long *)ptr = 0xcdcdcdcd;
- ptr += sizeof(unsigned long);
- }
-#endif
-
- return (void *)buf;
-}
-
-
-/*
- * Free N-byte aligned memory
- */
-void
-_mesa_align_free(void *ptr)
-{
-#if 0
- FREE( (void *)(*(unsigned long *)((unsigned long)ptr - sizeof(void *))) );
-#else
- /* The actuall address to free is stuffed in the word immediately
- * before the address the client sees.
- */
- void **cubbyHole = (void **) ((char *) ptr - sizeof(void *));
- void *realAddr = *cubbyHole;
- FREE(realAddr);
-#endif
-}
-
-
-#endif /* WIN32 && _DEBUG */
-
-
-/*
- * Set a block of GLushorts to a particular value.
- */
-void
-_mesa_memset16( GLushort *dst, GLushort val, size_t n )
-{
- while (n-- > 0)
- *dst++ = val;
-}
diff --git a/xc/extras/Mesa/src/mem.h b/xc/extras/Mesa/src/mem.h
deleted file mode 100644
index d27361e76..000000000
--- a/xc/extras/Mesa/src/mem.h
+++ /dev/null
@@ -1,179 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 4.0.2
- *
- * 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.
- */
-
-
-#ifndef MEM_H
-#define MEM_H
-
-
-#include "glheader.h"
-/* Do not reference mtypes.h from this file.
- */
-
-/*
- * Memory allocation
- */
-#if defined(WIN32) && defined(_DEBUG)
-#include <malloc.h>
-#ifndef _CRTDBG_MAP_ALLOC
- #define _CRTDBG_MAP_ALLOC 1
-#endif
-#include <crtdbg.h>
-
-#define _mesa_malloc(n) _malloc_dbg( n, _NORMAL_BLOCK, __FILE__ , __LINE__ )
-#define _mesa_calloc(n) _calloc_dbg( 1, n, _NORMAL_BLOCK, __FILE__ , __LINE__ )
-#define _mesa_free(p) _free_dbg(p, _NORMAL_BLOCK )
-
-extern void *_mesa_align_malloc_dbg(size_t bytes, unsigned long alignment, const char *_file, int _line );
-extern void *_mesa_align_calloc_dbg(size_t bytes, unsigned long alignment, const char *_file, int _line );
-extern void _mesa_align_free_dbg(void *ptr, const char *_file, int _line);
-
-#define _mesa_align_malloc( s, a ) _mesa_align_malloc_dbg( s, a, __FILE__ , __LINE__ )
-#define _mesa_align_calloc( s, a ) _mesa_align_calloc_dbg( s, a, __FILE__ , __LINE__ )
-#define _mesa_align_free(p) _mesa_align_free_dbg(p, __FILE__ , __LINE__)
-
-#else /* WIN32 && _DEBUG */
-
-extern void *_mesa_malloc(size_t bytes);
-extern void *_mesa_calloc(size_t bytes);
-extern void _mesa_free(void *ptr);
-
-extern void *_mesa_align_malloc(size_t bytes, unsigned long alignment);
-extern void *_mesa_align_calloc(size_t bytes, unsigned long alignment);
-extern void _mesa_align_free(void *ptr);
-
-#endif /* WIN32 && _DEBUG */
-
-
-#ifdef DEBUG
-
-/* call Mesa memory functions */
-#define MALLOC(BYTES) _mesa_malloc(BYTES)
-#define CALLOC(BYTES) _mesa_calloc(BYTES)
-#define MALLOC_STRUCT(T) (struct T *) _mesa_malloc(sizeof(struct T))
-#define CALLOC_STRUCT(T) (struct T *) _mesa_calloc(sizeof(struct T))
-#define FREE(PTR) _mesa_free(PTR)
-
-#else
-
-/* directly call C lib memory functions */
-#define MALLOC(BYTES) (void *) malloc(BYTES)
-#define CALLOC(BYTES) (void *) calloc(1, BYTES)
-#define MALLOC_STRUCT(T) (struct T *) malloc(sizeof(struct T))
-#define CALLOC_STRUCT(T) (struct T *) calloc(1,sizeof(struct T))
-#define FREE(PTR) free(PTR)
-
-#endif
-
-/* call Mesa N-byte aligned memory functions */
-#define ALIGN_MALLOC(BYTES, N) (void *) _mesa_align_malloc(BYTES, N)
-#define ALIGN_CALLOC(BYTES, N) (void *) _mesa_align_calloc(BYTES, N)
-#define ALIGN_MALLOC_STRUCT(T, N) (struct T *) _mesa_align_malloc(sizeof(struct T), N)
-#define ALIGN_CALLOC_STRUCT(T, N) (struct T *) _mesa_align_calloc(sizeof(struct T), N)
-#define ALIGN_FREE(PTR) _mesa_align_free(PTR)
-
-
-#ifdef MESA_EXTERNAL_BUFFERALLOC
-/*
- * If you want Mesa's depth/stencil/accum/etc buffers to be allocated
- * with a specialized allocator you can define MESA_EXTERNAL_BUFFERALLOC
- * and implement _ext_mesa_alloc/free_pixelbuffer() in your app.
- * Contributed by Gerk Huisma (gerk@five-d.demon.nl).
- */
-extern void *_ext_mesa_alloc_pixelbuffer( unsigned int size );
-extern void _ext_mesa_free_pixelbuffer( void *pb );
-
-#define MESA_PBUFFER_ALLOC(BYTES) (void *) _ext_mesa_alloc_pixelbuffer(BYTES)
-#define MESA_PBUFFER_FREE(PTR) _ext_mesa_free_pixelbuffer(PTR)
-#else
-/* Default buffer allocation uses the aligned allocation routines: */
-#define MESA_PBUFFER_ALLOC(BYTES) (void *) _mesa_align_malloc(BYTES, 512)
-#define MESA_PBUFFER_FREE(PTR) _mesa_align_free(PTR)
-#endif
-
-
-/* Memory copy: */
-#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
-
-
-/* Memory set: */
-#ifdef SUNOS4
-#define MEMSET( DST, VAL, N ) \
- memset( (char *) (DST), (int) (VAL), (int) (N) )
-#else
-#define MEMSET( DST, VAL, N ) \
- memset( (void *) (DST), (int) (VAL), (size_t) (N) )
-#endif
-
-extern void _mesa_memset16( GLushort *dst, GLushort val, size_t n );
-
-#define MEMSET16( DST, VAL, N ) \
- _mesa_memset16( (GLushort *) (DST), (GLushort) (VAL), (size_t) (N) )
-
-
-/* On some systems we might want to use bzero() (but is bzero portable?) */
-#if defined(__FreeBSD__)
-#define BZERO( ADDR, N ) \
- bzero( (void *) (ADDR), (size_t) (N) )
-#else
-#define BZERO( ADDR, N ) \
- memset( (void *) (ADDR), 0, (size_t) (N) )
-#endif
-
-
-/* MACs and BeOS don't support static larger than 32kb, so... */
-#if defined(macintosh) && !defined(__MRC__)
-/*extern char *AGLAlloc(int size);*/
-/*extern void AGLFree(char* ptr);*/
-# define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)MALLOC(sizeof(TYPE)*(SIZE))
-# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])MALLOC(sizeof(TYPE)*(SIZE1)*(SIZE2))
-# define DEFMNARRAY(TYPE,NAME,SIZE1,SIZE2,SIZE3) TYPE (*NAME)[SIZE2][SIZE3] = (TYPE(*)[SIZE2][SIZE3])MALLOC(sizeof(TYPE)*(SIZE1)*(SIZE2)*(SIZE3))
-
-# define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0)
-# define UNDEFARRAY(NAME) do {if ((NAME)) {FREE((char*)NAME);} }while (0)
-#elif defined(__BEOS__)
-# define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)malloc(sizeof(TYPE)*(SIZE))
-# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])malloc(sizeof(TYPE)*(SIZE1)*(SIZE2))
-# define DEFMNARRAY(TYPE,NAME,SIZE1,SIZE2,SIZE3) TYPE (*NAME)[SIZE2][SIZE3] = (TYPE(*)[SIZE2][SIZE3])malloc(sizeof(TYPE)*(SIZE1)*(SIZE2)*(SIZE3))
-# define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0)
-# define UNDEFARRAY(NAME) do {if ((NAME)) {free((char*)NAME);} }while (0)
-#else
-# define DEFARRAY(TYPE,NAME,SIZE) TYPE NAME[SIZE]
-# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE NAME[SIZE1][SIZE2]
-# define DEFMNARRAY(TYPE,NAME,SIZE1,SIZE2,SIZE3) TYPE NAME[SIZE1][SIZE2][SIZE3]
-# define CHECKARRAY(NAME,CMD) do {} while(0)
-# define UNDEFARRAY(NAME)
-#endif
-
-
-
-
-#endif
diff --git a/xc/extras/Mesa/src/mmath.c b/xc/extras/Mesa/src/mmath.c
index 78afabdfa..6abeb74cf 100644
--- a/xc/extras/Mesa/src/mmath.c
+++ b/xc/extras/Mesa/src/mmath.c
@@ -24,12 +24,8 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "mmath.h"
-#endif
static int in_fast_math;
@@ -66,7 +62,7 @@ static void init_sqrt(void)
*/
fi.i = (i << 16) | (127 << 23);
- fi.f = sqrt(fi.f);
+ fi.f = _mesa_sqrt(fi.f);
/*
* Take the square root then strip the first 7 bits of
@@ -119,7 +115,7 @@ float gl_sqrt( float x )
num.i = ((sqrttab[num.i >> 16]) << 16) | ((e + 127) << 23);
return num.f;
#else
- return (GLfloat) sqrt(x);
+ return (GLfloat) _mesa_sqrt(x);
#endif
}
@@ -149,8 +145,8 @@ _mesa_init_math(void)
#if defined(_FPU_GETCW) && defined(_FPU_SETCW)
{
- const char *debug = getenv("MESA_DEBUG");
- if (debug && strcmp(debug, "FP")==0) {
+ const char *debug = _mesa_getenv("MESA_DEBUG");
+ if (debug && _mesa_strcmp(debug, "FP")==0) {
/* die on FP exceptions */
fpu_control_t mask;
_FPU_GETCW(mask);
diff --git a/xc/extras/Mesa/src/mmath.h b/xc/extras/Mesa/src/mmath.h
index c39c93004..e5a662cbc 100644
--- a/xc/extras/Mesa/src/mmath.h
+++ b/xc/extras/Mesa/src/mmath.h
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 5.0.1
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * 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"),
@@ -36,6 +36,7 @@
#include "glheader.h"
+#include "imports.h"
/* Do not reference mtypes.h from this file.
*/
@@ -132,7 +133,7 @@ __inline END_FAST_MATH(unsigned short x)
#define HAVE_FAST_MATH
#else
-#define START_FAST_MATH(x) (void)(x)
+#define START_FAST_MATH(x) x = 0
#define END_FAST_MATH(x) (void)(x)
/* The mac float really is a float, with the same precision as a
@@ -168,12 +169,12 @@ extern float gl_sqrt(float x);
*/
#define NORMALIZE_3FV( V ) \
do { \
- GLfloat len = LEN_SQUARED_3FV(V); \
+ GLfloat len = (GLfloat) LEN_SQUARED_3FV(V); \
if (len) { \
len = (GLfloat) (1.0 / GL_SQRT(len)); \
- (V)[0] = (GLfloat) ((V)[0] * len); \
- (V)[1] = (GLfloat) ((V)[1] * len); \
- (V)[2] = (GLfloat) ((V)[2] * len); \
+ (V)[0] = (GLfloat) ((V)[0] * len); \
+ (V)[1] = (GLfloat) ((V)[1] * len); \
+ (V)[2] = (GLfloat) ((V)[2] * len); \
} \
} while(0)
@@ -191,6 +192,14 @@ do { \
#define CEILF(x) ceil(x)
#define FLOORF(x) floor(x)
#define FABSF(x) fabs(x)
+#elif defined(__WIN32__)
+#define CEILF(x) ((GLfloat)ceil(x))
+#define FLOORF(x) ((GLfloat)floor(x))
+#define FABSF(x) ((GLfloat)fabs(x))
+#elif defined(XFree86LOADER) && defined(IN_MODULE)
+#define CEILF(x) ((GLfloat) xf86ceil(x))
+#define FLOORF(x) ((GLfloat) xf86floor(x))
+#define FABSF(x) ((GLfloat) xf86fabs(x))
#else
#define CEILF(x) ceilf(x)
#define FLOORF(x) floorf(x)
@@ -395,29 +404,29 @@ static INLINE int iceil(float f)
* This function/macro is sensitive to precision. Test carefully
* if you change it.
*/
-#define UNCLAMPED_FLOAT_TO_UBYTE(b, f) \
+#define UNCLAMPED_FLOAT_TO_UBYTE(ub, f) \
do { \
union { GLfloat r; GLuint i; } __tmp; \
__tmp.r = (f); \
- b = ((__tmp.i >= IEEE_0996) \
+ ub = ((__tmp.i >= IEEE_0996) \
? ((GLint)__tmp.i < 0) ? (GLubyte)0 : (GLubyte)255 \
: (__tmp.r = __tmp.r*(255.0F/256.0F) + 32768.0F, \
(GLubyte)__tmp.i)); \
} while (0)
-#define CLAMPED_FLOAT_TO_UBYTE(b, f) \
- UNCLAMPED_FLOAT_TO_UBYTE(b, f)
+#define CLAMPED_FLOAT_TO_UBYTE(ub, f) \
+ UNCLAMPED_FLOAT_TO_UBYTE(ub, f)
#define COPY_FLOAT( dst, src ) \
((fi_type *) &(dst))->i = ((fi_type *) &(src))->i
#else /* USE_IEEE */
-#define UNCLAMPED_FLOAT_TO_UBYTE(b, f) \
- b = ((GLubyte) IROUND(CLAMP(f, 0.0F, 1.0F) * 255.0F))
+#define UNCLAMPED_FLOAT_TO_UBYTE(ub, f) \
+ ub = ((GLubyte) IROUND(CLAMP((f), 0.0F, 1.0F) * 255.0F))
-#define CLAMPED_FLOAT_TO_UBYTE(b, f) \
- b = ((GLubyte) IROUND((f) * 255.0F))
+#define CLAMPED_FLOAT_TO_UBYTE(ub, f) \
+ ub = ((GLubyte) IROUND((f) * 255.0F))
#define COPY_FLOAT( dst, src ) (dst) = (src)
@@ -488,7 +497,10 @@ extern float _mesa_ubyte_to_float_color_tab[256];
#define SHORT_TO_USHORT(s) ((s) < 0 ? 0 : ((GLushort) (((s) * 65535 / 32767))))
#define INT_TO_USHORT(i) ((i) < 0 ? 0 : ((GLushort) ((i) >> 15)))
#define UINT_TO_USHORT(i) ((i) < 0 ? 0 : ((GLushort) ((i) >> 16)))
-#define UNCLAMPED_FLOAT_TO_USHORT(us, f) us = (GLushort) ((f) * 65535.0F)
+#define UNCLAMPED_FLOAT_TO_USHORT(us, f) \
+ us = ( (GLushort) IROUND( CLAMP((f), 0.0, 1.0) * 65535.0F) )
+#define CLAMPED_FLOAT_TO_USHORT(us, f) \
+ us = ( (GLushort) IROUND( (f) * 65535.0F) )
@@ -518,24 +530,24 @@ do { \
} while (0)
#define INTERP_UI( t, dstui, outui, inui ) \
- dstui = (GLuint) (GLint) LINTERP( t, (GLfloat) (outui), (GLfloat) (inui) )
+ dstui = (GLuint) (GLint) LINTERP( (t), (GLfloat) (outui), (GLfloat) (inui) )
#define INTERP_F( t, dstf, outf, inf ) \
dstf = LINTERP( t, outf, inf )
-#define INTERP_4F( t, dst, out, in ) \
-do { \
- (dst)[0] = LINTERP( (t), (out)[0], (in)[0] ); \
- (dst)[1] = LINTERP( (t), (out)[1], (in)[1] ); \
- (dst)[2] = LINTERP( (t), (out)[2], (in)[2] ); \
- (dst)[3] = LINTERP( (t), (out)[3], (in)[3] ); \
+#define INTERP_4F( t, dst, out, in ) \
+do { \
+ dst[0] = LINTERP( (t), (out)[0], (in)[0] ); \
+ dst[1] = LINTERP( (t), (out)[1], (in)[1] ); \
+ dst[2] = LINTERP( (t), (out)[2], (in)[2] ); \
+ dst[3] = LINTERP( (t), (out)[3], (in)[3] ); \
} while (0)
-#define INTERP_3F( t, dst, out, in ) \
-do { \
- (dst)[0] = LINTERP( (t), (out)[0], (in)[0] ); \
- (dst)[1] = LINTERP( (t), (out)[1], (in)[1] ); \
- (dst)[2] = LINTERP( (t), (out)[2], (in)[2] ); \
+#define INTERP_3F( t, dst, out, in ) \
+do { \
+ dst[0] = LINTERP( (t), (out)[0], (in)[0] ); \
+ dst[1] = LINTERP( (t), (out)[1], (in)[1] ); \
+ dst[2] = LINTERP( (t), (out)[2], (in)[2] ); \
} while (0)
#define INTERP_4CHAN( t, dst, out, in ) \
@@ -554,12 +566,12 @@ do { \
} while (0)
#define INTERP_SZ( t, vec, to, out, in, sz ) \
-do { \
+do { \
switch (sz) { \
- case 4: (vec)[to][3] = LINTERP( (t), (vec)[out][3], (vec)[in][3] ); \
- case 3: (vec)[to][2] = LINTERP( (t), (vec)[out][2], (vec)[in][2] ); \
- case 2: (vec)[to][1] = LINTERP( (t), (vec)[out][1], (vec)[in][1] ); \
- case 1: (vec)[to][0] = LINTERP( (t), (vec)[out][0], (vec)[in][0] ); \
+ case 4: vec[to][3] = LINTERP( (t), (vec)[out][3], (vec)[in][3] ); \
+ case 3: vec[to][2] = LINTERP( (t), (vec)[out][2], (vec)[in][2] ); \
+ case 2: vec[to][1] = LINTERP( (t), (vec)[out][1], (vec)[in][1] ); \
+ case 1: vec[to][0] = LINTERP( (t), (vec)[out][0], (vec)[in][0] ); \
} \
} while(0)
@@ -567,13 +579,21 @@ do { \
/*
* Fixed point arithmetic macros
*/
+#ifdef FIXED_14
+#define FIXED_ONE 0x00004000
+#define FIXED_HALF 0x00002000
+#define FIXED_FRAC_MASK 0x00003FFF
+#define FIXED_SCALE 16384.0f
+#define FIXED_SHIFT 14
+#else
#define FIXED_ONE 0x00000800
#define FIXED_HALF 0x00000400
#define FIXED_FRAC_MASK 0x000007FF
-#define FIXED_INT_MASK (~FIXED_FRAC_MASK)
-#define FIXED_EPSILON 1
#define FIXED_SCALE 2048.0f
#define FIXED_SHIFT 11
+#endif
+#define FIXED_INT_MASK (~FIXED_FRAC_MASK)
+#define FIXED_EPSILON 1
#define FloatToFixed(X) (IROUND((X) * FIXED_SCALE))
#define IntToFixed(I) ((I) << FIXED_SHIFT)
#define FixedToInt(X) ((X) >> FIXED_SHIFT)
@@ -584,18 +604,72 @@ do { \
#define PosFloatToFixed(X) FloatToFixed(X)
#define SignedFloatToFixed(X) FloatToFixed(X)
-#ifdef USE_IEEE
/* Returns TRUE for x == Inf or x == NaN. */
+#ifdef USE_IEEE
static INLINE int IS_INF_OR_NAN( float x )
{
union {float f; int i;} tmp;
tmp.f = x;
return !(int)((unsigned int)((tmp.i & 0x7fffffff)-0x7f800000) >> 31);
}
+#elif defined(isfinite)
+#define IS_INF_OR_NAN(x) (!isfinite(x))
+#elif defined(finite)
+#define IS_INF_OR_NAN(x) (!finite(x))
+#elif __VMS
+#define IS_INF_OR_NAN(x) (!finite(x))
+#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#define IS_INF_OR_NAN(x) (!isfinite(x))
#else
-#define IS_INF_OR_NAN(x) (!finite(x))
+#define IS_INF_OR_NAN(x) (!finite(x))
+#endif
+
+
+/*
+ * Return log_base_2(x).
+ */
+#ifdef USE_IEEE
+
+#if 0
+/* This is pretty fast, but not accurate enough (only 2 fractional bits).
+ * Based on code from http://www.stereopsis.com/log2.html
+ */
+static INLINE GLfloat LOG2(GLfloat x)
+{
+ const GLfloat y = x * x * x * x;
+ const GLuint ix = *((GLuint *) &y);
+ const GLuint exp = (ix >> 23) & 0xFF;
+ const GLint log2 = ((GLint) exp) - 127;
+ return (GLfloat) log2 * (1.0 / 4.0); /* 4, because of x^4 above */
+}
#endif
+/* Pretty fast, and accurate.
+ * Based on code from http://www.flipcode.com/totd/
+ */
+static INLINE GLfloat LOG2(GLfloat val)
+{
+ GLint *exp_ptr = (GLint *) &val;
+ GLint x = *exp_ptr;
+ const GLint log_2 = ((x >> 23) & 255) - 128;
+ x &= ~(255 << 23);
+ x += 127 << 23;
+ *exp_ptr = x;
+ val = ((-1.0f/3) * val + 2) * val - 2.0f/3;
+ return val + log_2;
+}
+
+#else /* USE_IEEE */
+
+/* Slow, portable solution.
+ * NOTE: log_base_2(x) = log(x) / log(2)
+ * NOTE: 1.442695 = 1/log(2).
+ */
+#define LOG2(x) ((GLfloat) (log(x) * 1.442695F))
+
+#endif /* USE_IEEE */
+
+
extern void
_mesa_init_math(void);
diff --git a/xc/extras/Mesa/src/mtypes.h b/xc/extras/Mesa/src/mtypes.h
index 82a8c2ab7..7ace44d43 100644
--- a/xc/extras/Mesa/src/mtypes.h
+++ b/xc/extras/Mesa/src/mtypes.h
@@ -1,8 +1,7 @@
-/* $Id: mtypes.h,v 1.1.1.1 2002/10/22 13:05:27 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.4
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -24,6 +23,10 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+/**
+ * \file mtypes.h
+ * \brief Main Mesa data structures.
+ */
#ifndef TYPES_H
#define TYPES_H
@@ -63,11 +66,11 @@
#define CHAN_MAXF 1.0F
#define CHAN_TYPE GL_FLOAT
#else
-#error illegal number of color channel bits
+#error "illegal number of color channel bits"
#endif
-/*
+/**
* Accumulation buffer data type:
*/
#if ACCUM_BITS==8
@@ -81,7 +84,7 @@
#endif
-/*
+/**
* Stencil buffer data type:
*/
#if STENCIL_BITS==8
@@ -95,20 +98,20 @@
#endif
-/*
+/**
* Depth buffer data type:
*/
typedef GLuint GLdepth; /* Must be 32-bits! */
-/*
+/**
* Fixed point data type:
*/
typedef int GLfixed;
-/*
+/**
* Some forward type declarations
*/
struct _mesa_HashTable;
@@ -120,7 +123,52 @@ typedef struct gl_frame_buffer GLframebuffer;
-/* Maximum number of temporary vertices required for clipping. (Used
+/* These define the aliases between numbered vertex attributes and
+ * conventional OpenGL vertex attributes. We use these values in
+ * quite a few places. New in Mesa 4.1.
+ */
+#define VERT_ATTRIB_POS 0
+#define VERT_ATTRIB_WEIGHT 1
+#define VERT_ATTRIB_NORMAL 2
+#define VERT_ATTRIB_COLOR0 3
+#define VERT_ATTRIB_COLOR1 4
+#define VERT_ATTRIB_FOG 5
+#define VERT_ATTRIB_SIX 6
+#define VERT_ATTRIB_SEVEN 7
+#define VERT_ATTRIB_TEX0 8
+#define VERT_ATTRIB_TEX1 9
+#define VERT_ATTRIB_TEX2 10
+#define VERT_ATTRIB_TEX3 11
+#define VERT_ATTRIB_TEX4 12
+#define VERT_ATTRIB_TEX5 13
+#define VERT_ATTRIB_TEX6 14
+#define VERT_ATTRIB_TEX7 15
+#define VERT_ATTRIB_MAX 16
+
+/* These are used in bitfields in many places */
+#define VERT_BIT_POS (1 << VERT_ATTRIB_POS)
+#define VERT_BIT_WEIGHT (1 << VERT_ATTRIB_WEIGHT)
+#define VERT_BIT_NORMAL (1 << VERT_ATTRIB_NORMAL)
+#define VERT_BIT_COLOR0 (1 << VERT_ATTRIB_COLOR0)
+#define VERT_BIT_COLOR1 (1 << VERT_ATTRIB_COLOR1)
+#define VERT_BIT_FOG (1 << VERT_ATTRIB_FOG)
+#define VERT_BIT_SIX (1 << VERT_ATTRIB_SIX)
+#define VERT_BIT_SEVEN (1 << VERT_ATTRIB_SEVEN)
+#define VERT_BIT_TEX0 (1 << VERT_ATTRIB_TEX0)
+#define VERT_BIT_TEX1 (1 << VERT_ATTRIB_TEX1)
+#define VERT_BIT_TEX2 (1 << VERT_ATTRIB_TEX2)
+#define VERT_BIT_TEX3 (1 << VERT_ATTRIB_TEX3)
+#define VERT_BIT_TEX4 (1 << VERT_ATTRIB_TEX4)
+#define VERT_BIT_TEX5 (1 << VERT_ATTRIB_TEX5)
+#define VERT_BIT_TEX6 (1 << VERT_ATTRIB_TEX6)
+#define VERT_BIT_TEX7 (1 << VERT_ATTRIB_TEX7)
+
+#define VERT_BIT_TEX(u) (1 << (VERT_ATTRIB_TEX0 + (u)))
+
+
+
+/**
+ * Maximum number of temporary vertices required for clipping. (Used
* in array_cache and tnl modules).
*/
#define MAX_CLIPPED_VERTICES ((2 * (6 + MAX_CLIP_PLANES))+1)
@@ -185,7 +233,7 @@ struct gl_shine_tab {
struct gl_light {
- struct gl_light *next; /* double linked list with sentinel */
+ struct gl_light *next; /* double linked list with sentinel */
struct gl_light *prev;
GLfloat Ambient[4]; /* ambient color */
@@ -252,29 +300,31 @@ struct gl_accum_attrib {
/*
- * Used in DrawDestMask below
+ * Used in _DrawDestMask and _ReadSrcMask below to identify color buffers.
*/
-#define FRONT_LEFT_BIT 1
-#define FRONT_RIGHT_BIT 2
-#define BACK_LEFT_BIT 4
-#define BACK_RIGHT_BIT 8
-
+#define FRONT_LEFT_BIT 0x1
+#define FRONT_RIGHT_BIT 0x2
+#define BACK_LEFT_BIT 0x4
+#define BACK_RIGHT_BIT 0x8
+#define AUX0_BIT 0x10
+#define AUX1_BIT 0x20
+#define AUX2_BIT 0x40
+#define AUX3_BIT 0x80
struct gl_colorbuffer_attrib {
GLuint ClearIndex; /* Index to use for glClear */
- GLchan ClearColor[4]; /* Color to use for glClear */
+ GLclampf ClearColor[4]; /* Color to use for glClear */
GLuint IndexMask; /* Color index write mask */
GLubyte ColorMask[4]; /* Each flag is 0xff or 0x0 */
- GLenum DrawBuffer; /* Which buffer to draw into */
- GLenum DriverDrawBuffer; /* Current device driver dest buffer */
- GLubyte DrawDestMask; /* bitwise-OR of bitflags above */
+ GLenum DrawBuffer; /* Which buffer to draw into */
+ GLubyte _DrawDestMask; /* bitwise-OR of FRONT/BACK_LEFT/RIGHT_BITs */
/* alpha testing */
GLboolean AlphaEnabled; /* Alpha test enabled flag */
GLenum AlphaFunc; /* Alpha test function */
- GLchan AlphaRef; /* Alpha ref value as GLchan */
+ GLclampf AlphaRef;
/* blending */
GLboolean BlendEnabled; /* Blending enabled flag */
@@ -297,25 +347,21 @@ struct gl_colorbuffer_attrib {
struct gl_current_attrib {
/* These values valid only when FLUSH_VERTICES has been called.
*/
- GLfloat Normal[3]; /* Current vertex normal */
- GLfloat Color[4]; /* Current RGBA color */
- GLfloat SecondaryColor[4]; /* Current secondary color */
- GLfloat FogCoord; /* Current Fog coord */
+ GLfloat Attrib[VERT_ATTRIB_MAX][4]; /* Current vertex attributes */
+ /* indexed by VERT_ATTRIB_* */
GLuint Index; /* Current color index */
GLboolean EdgeFlag; /* Current edge flag */
- GLfloat Texcoord[MAX_TEXTURE_UNITS][4]; /* Current texture coords */
- /* These values are always valid.
+ /* These values are always valid. BTW, note how similar this set of
+ * attributes is to the SWvertex datatype in the software rasterizer...
*/
GLfloat RasterPos[4]; /* Current raster position */
GLfloat RasterDistance; /* Current raster distance */
GLfloat RasterColor[4]; /* Current raster color */
GLfloat RasterSecondaryColor[4]; /* Current rast 2ndary color */
- GLuint RasterIndex; /* Current raster index */
- GLfloat *RasterTexCoord; /* Current raster texcoord*/
- GLfloat RasterMultiTexCoord[MAX_TEXTURE_UNITS][4];
- GLfloat RasterFogCoord;
- GLboolean RasterPosValid; /* Raster po valid flag */
+ GLuint RasterIndex; /* Current raster index */
+ GLfloat RasterTexCoords[MAX_TEXTURE_UNITS][4];/* Current raster texcoords */
+ GLboolean RasterPosValid; /* Raster pos valid flag */
};
@@ -332,7 +378,7 @@ struct gl_enable_attrib {
GLboolean AlphaTest;
GLboolean AutoNormal;
GLboolean Blend;
- GLboolean ClipPlane[MAX_CLIP_PLANES];
+ GLuint ClipPlanes;
GLboolean ColorMaterial;
GLboolean Convolution1D;
GLboolean Convolution2D;
@@ -357,6 +403,7 @@ struct gl_enable_attrib {
GLboolean Map1TextureCoord4;
GLboolean Map1Vertex3;
GLboolean Map1Vertex4;
+ GLboolean Map1Attrib[16]; /* GL_NV_vertex_program */
GLboolean Map2Color4;
GLboolean Map2Index;
GLboolean Map2Normal;
@@ -366,6 +413,7 @@ struct gl_enable_attrib {
GLboolean Map2TextureCoord4;
GLboolean Map2Vertex3;
GLboolean Map2Vertex4;
+ GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */
GLboolean MinMax;
GLboolean Normalize;
GLboolean PixelTexture;
@@ -378,14 +426,18 @@ struct gl_enable_attrib {
GLboolean RescaleNormals;
GLboolean Scissor;
GLboolean Stencil;
- GLboolean MultisampleEnabled; /* GL_ARB_multisample */
- GLboolean SampleAlphaToCoverage; /* GL_ARB_multisample */
- GLboolean SampleAlphaToOne; /* GL_ARB_multisample */
- GLboolean SampleCoverage; /* GL_ARB_multisample */
- GLboolean SampleCoverageInvert; /* GL_ARB_multisample */
+ GLboolean MultisampleEnabled; /* GL_ARB_multisample */
+ GLboolean SampleAlphaToCoverage; /* GL_ARB_multisample */
+ GLboolean SampleAlphaToOne; /* GL_ARB_multisample */
+ GLboolean SampleCoverage; /* GL_ARB_multisample */
+ GLboolean SampleCoverageInvert; /* GL_ARB_multisample */
GLboolean RasterPositionUnclipped; /* GL_IBM_rasterpos_clip */
GLuint Texture[MAX_TEXTURE_UNITS];
GLuint TexGen[MAX_TEXTURE_UNITS];
+ GLboolean VertexProgram; /* GL_NV_vertex_program */
+ GLboolean VertexProgramPointSize; /* GL_NV_vertex_program */
+ GLboolean VertexProgramTwoSide; /* GL_NV_vertex_program */
+ GLboolean PointSprite; /* GL_NV_point_sprite */
};
@@ -400,6 +452,7 @@ struct gl_eval_attrib {
GLboolean Map1TextureCoord4;
GLboolean Map1Vertex3;
GLboolean Map1Vertex4;
+ GLboolean Map1Attrib[16]; /* GL_NV_vertex_program */
GLboolean Map2Color4;
GLboolean Map2Index;
GLboolean Map2Normal;
@@ -409,6 +462,7 @@ struct gl_eval_attrib {
GLboolean Map2TextureCoord4;
GLboolean Map2Vertex3;
GLboolean Map2Vertex4;
+ GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */
GLboolean AutoNormal;
/* Map Grid endpoints and divisions and calculated du values */
GLint MapGrid1un;
@@ -474,6 +528,11 @@ struct gl_convolution_attrib {
};
+#define LIGHT_SPOT 0x1
+#define LIGHT_LOCAL_VIEWER 0x2
+#define LIGHT_POSITIONAL 0x4
+#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)
+
struct gl_light_attrib {
struct gl_light Light[MAX_LIGHTS]; /* Array of lights */
struct gl_lightmodel Model; /* Lighting model */
@@ -493,17 +552,11 @@ struct gl_light_attrib {
/* Derived for optimizations: */
GLboolean _NeedVertices; /* Use fast shader? */
- GLuint _Flags; /* LIGHT_* flags, see below */
+ GLuint _Flags; /* LIGHT_* flags, see above */
GLfloat _BaseColor[2][3];
};
-#define LIGHT_SPOT 0x1
-#define LIGHT_LOCAL_VIEWER 0x2
-#define LIGHT_POSITIONAL 0x4
-
-#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)
-
struct gl_line_attrib {
GLboolean SmoothFlag; /* GL_LINE_SMOOTH enabled? */
GLboolean StippleFlag; /* GL_LINE_STIPPLE enabled? */
@@ -518,6 +571,7 @@ struct gl_list_attrib {
GLuint ListBase;
};
+
struct gl_list_opcode {
GLuint size;
void (*execute)( GLcontext *ctx, void *data );
@@ -545,7 +599,9 @@ struct gl_multisample_attrib {
struct gl_pixel_attrib {
GLenum ReadBuffer; /* src buffer for glRead/CopyPixels */
- GLenum DriverReadBuffer; /* Driver's current source buffer */
+ GLubyte _ReadSrcMask; /* Not really a mask, but like _DrawDestMask */
+ /* May be: FRONT_LEFT_BIT, BACK_LEFT_BIT, */
+ /* FRONT_RIGHT_BIT or BACK_RIGHT_BIT. */
GLfloat RedBias, RedScale;
GLfloat GreenBias, GreenScale;
GLfloat BlueBias, BlueScale;
@@ -555,6 +611,7 @@ struct gl_pixel_attrib {
GLboolean MapColorFlag;
GLboolean MapStencilFlag;
GLfloat ZoomX, ZoomY;
+ /* XXX move these out of gl_pixel_attrib */
GLint MapStoSsize; /* Size of each pixel map */
GLint MapItoIsize;
GLint MapItoRsize;
@@ -614,13 +671,15 @@ struct gl_pixel_attrib {
struct gl_point_attrib {
GLboolean SmoothFlag; /* True if GL_POINT_SMOOTH is enabled */
- GLboolean SpriteMode; /* GL_MESA_sprite_point extension */
GLfloat Size; /* User-specified point size */
GLfloat _Size; /* Size clamped to Const.Min/MaxPointSize */
GLfloat Params[3]; /* GL_EXT_point_parameters */
GLfloat MinSize, MaxSize; /* GL_EXT_point_parameters */
GLfloat Threshold; /* GL_EXT_point_parameters */
GLboolean _Attenuated; /* True if Params != [1, 0, 0] */
+ GLboolean PointSprite; /* GL_NV_point_sprite */
+ GLboolean CoordReplace[MAX_TEXTURE_UNITS]; /* GL_NV_point_sprite */
+ GLenum SpriteRMode; /* GL_NV_point_sprite */
};
@@ -628,18 +687,16 @@ struct gl_polygon_attrib {
GLenum FrontFace; /* Either GL_CW or GL_CCW */
GLenum FrontMode; /* Either GL_POINT, GL_LINE or GL_FILL */
GLenum BackMode; /* Either GL_POINT, GL_LINE or GL_FILL */
- GLboolean _FrontBit; /* */
+ GLboolean _FrontBit; /* 0=GL_CCW, 1=GL_CW */
GLboolean CullFlag; /* Culling on/off flag */
GLboolean SmoothFlag; /* True if GL_POLYGON_SMOOTH is enabled */
GLboolean StippleFlag; /* True if GL_POLYGON_STIPPLE is enabled */
GLenum CullFaceMode; /* Culling mode GL_FRONT or GL_BACK */
GLfloat OffsetFactor; /* Polygon offset factor, from user */
GLfloat OffsetUnits; /* Polygon offset units, from user */
- GLfloat OffsetMRD; /* = OffsetUnits * visual->MRD */
GLboolean OffsetPoint; /* Offset in GL_POINT mode */
GLboolean OffsetLine; /* Offset in GL_LINE mode */
GLboolean OffsetFill; /* Offset in GL_FILL mode */
- GLboolean _OffsetAny;
};
@@ -652,14 +709,16 @@ struct gl_scissor_attrib {
struct gl_stencil_attrib {
GLboolean Enabled; /* Enabled flag */
- GLenum Function; /* Stencil function */
- GLenum FailFunc; /* Fail function */
- GLenum ZPassFunc; /* Depth buffer pass function */
- GLenum ZFailFunc; /* Depth buffer fail function */
- GLstencil Ref; /* Reference value */
- GLstencil ValueMask; /* Value mask */
+ GLboolean TestTwoSide; /* GL_EXT_stencil_two_side */
+ GLubyte ActiveFace; /* GL_EXT_stencil_two_side (0 or 1) */
+ GLenum Function[2]; /* Stencil function */
+ GLenum FailFunc[2]; /* Fail function */
+ GLenum ZPassFunc[2]; /* Depth buffer pass function */
+ GLenum ZFailFunc[2]; /* Depth buffer fail function */
+ GLstencil Ref[2]; /* Reference value */
+ GLstencil ValueMask[2]; /* Value mask */
+ GLstencil WriteMask[2]; /* Write mask */
GLstencil Clear; /* Clear value */
- GLstencil WriteMask; /* Write mask */
};
@@ -669,54 +728,17 @@ struct gl_stencil_attrib {
#define R_BIT 4
#define Q_BIT 8
-#define NUM_TEXTURE_TARGETS 5 /* 1D, 2D, 3D, CUBE, and RECT */
-
-/* Texture Enabled flags */
-#define TEXTURE0_1D 0x1 /* Texture unit 0 (default) */
-#define TEXTURE0_2D 0x2
-#define TEXTURE0_3D 0x4
-#define TEXTURE0_CUBE 0x8
-#define TEXTURE0_RECT 0x10
-#define TEXTURE0_ANY (TEXTURE0_1D | TEXTURE0_2D | TEXTURE0_3D | TEXTURE0_CUBE | TEXTURE0_RECT)
-
-#define TEXTURE1_1D (TEXTURE0_1D << 5) /* Texture unit 1 */
-#define TEXTURE1_2D (TEXTURE0_2D << 5)
-#define TEXTURE1_3D (TEXTURE0_3D << 5)
-#define TEXTURE1_CUBE (TEXTURE0_CUBE << 5)
-#define TEXTURE1_RECT (TEXTURE0_RECT << 5)
-#define TEXTURE1_ANY (TEXTURE1_1D | TEXTURE1_2D | TEXTURE1_3D | TEXTURE1_CUBE | TEXTURE1_RECT)
-
-#define TEXTURE2_1D (TEXTURE0_1D << 10) /* Texture unit 2 */
-#define TEXTURE2_2D (TEXTURE0_2D << 10)
-#define TEXTURE2_3D (TEXTURE0_3D << 10)
-#define TEXTURE2_CUBE (TEXTURE0_CUBE << 10)
-#define TEXTURE2_RECT (TEXTURE0_RECT << 10)
-#define TEXTURE2_ANY (TEXTURE2_1D | TEXTURE2_2D | TEXTURE2_3D | TEXTURE2_CUBE | TEXTURE2_RECT)
-
-#define TEXTURE3_1D (TEXTURE0_1D << 15) /* Texture unit 3 */
-#define TEXTURE3_2D (TEXTURE0_2D << 15)
-#define TEXTURE3_3D (TEXTURE0_3D << 15)
-#define TEXTURE3_CUBE (TEXTURE0_CUBE << 15)
-#define TEXTURE3_RECT (TEXTURE0_RECT << 15)
-#define TEXTURE3_ANY (TEXTURE3_1D | TEXTURE3_2D | TEXTURE3_3D | TEXTURE3_CUBE | TEXTURE3_RECT)
-
-#define TEXTURE4_1D (TEXTURE0_1D << 20) /* Texture unit 4 */
-#define TEXTURE4_2D (TEXTURE0_2D << 20)
-#define TEXTURE4_3D (TEXTURE0_3D << 20)
-#define TEXTURE4_CUBE (TEXTURE0_CUBE << 20)
-#define TEXTURE4_RECT (TEXTURE0_RECT << 20)
-#define TEXTURE4_ANY (TEXTURE4_1D | TEXTURE4_2D | TEXTURE4_3D | TEXTURE4_CUBE | TEXTURE4_TECT)
-
-#define TEXTURE5_1D (TEXTURE0_1D << 25) /* Texture unit 5 */
-#define TEXTURE5_2D (TEXTURE0_2D << 25)
-#define TEXTURE5_3D (TEXTURE0_3D << 25)
-#define TEXTURE5_CUBE (TEXTURE0_CUBE << 25)
-#define TEXTURE5_RECT (TEXTURE0_CUBE << 25)
-#define TEXTURE5_ANY (TEXTURE5_1D | TEXTURE5_2D | TEXTURE5_3D | TEXTURE5_CUBE | TEXTURE5_RECT)
-
-
-/* Bitmap versions of the GL_ constants.
- */
+/* Texture.Unit[]._ReallyEnabled flags: */
+#define TEXTURE_1D_BIT 0x01
+#define TEXTURE_2D_BIT 0x02
+#define TEXTURE_3D_BIT 0x04
+#define TEXTURE_CUBE_BIT 0x08
+#define TEXTURE_RECT_BIT 0x10
+
+#define NUM_TEXTURE_TARGETS 5 /* 1D, 2D, 3D, CUBE and RECT */
+
+
+/* Bitmap versions of the GL_ constants. */
#define TEXGEN_SPHERE_MAP 0x1
#define TEXGEN_OBJ_LINEAR 0x2
#define TEXGEN_EYE_LINEAR 0x4
@@ -733,8 +755,7 @@ struct gl_stencil_attrib {
-/* A selection of state flags to make driver and module's lives easier.
- */
+/* A selection of state flags to make driver and module's lives easier. */
#define ENABLE_TEXGEN0 0x1
#define ENABLE_TEXGEN1 0x2
#define ENABLE_TEXGEN2 0x4
@@ -773,35 +794,36 @@ struct gl_texture_format {
* GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA,
* GL_COLOR_INDEX or GL_DEPTH_COMPONENT.
*/
- GLenum Type; /* Internal type as GL enum value */
-
GLubyte RedBits; /* Bits per texel component */
- GLubyte GreenBits;
- GLubyte BlueBits;
+ GLubyte GreenBits; /* These are just rough approximations for */
+ GLubyte BlueBits; /* compressed texture formats. */
GLubyte AlphaBits;
GLubyte LuminanceBits;
GLubyte IntensityBits;
GLubyte IndexBits;
GLubyte DepthBits;
- GLint TexelBytes;
+ GLint TexelBytes; /* Bytes per texel (0 for compressed formats */
FetchTexelFunc FetchTexel1D; /* Texel fetch function pointers */
FetchTexelFunc FetchTexel2D;
FetchTexelFunc FetchTexel3D;
};
+
/* Texture image record */
struct gl_texture_image {
GLenum Format; /* GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA,
* GL_INTENSITY, GL_RGB, GL_RGBA,
* GL_COLOR_INDEX or GL_DEPTH_COMPONENT only.
+ * Used for choosing TexEnv arithmetic.
*/
GLint IntFormat; /* Internal format as given by the user */
GLuint Border; /* 0 or 1 */
GLuint Width; /* = 2^WidthLog2 + 2*Border */
GLuint Height; /* = 2^HeightLog2 + 2*Border */
GLuint Depth; /* = 2^DepthLog2 + 2*Border */
+ GLuint RowStride; /* == Width unless IsClientData and padded */
GLuint Width2; /* = Width - 2*Border */
GLuint Height2; /* = Height - 2*Border */
GLuint Depth2; /* = Depth - 2*Border */
@@ -813,6 +835,8 @@ struct gl_texture_image {
GLfloat HeightScale; /* used for mipmap lod computation */
GLfloat DepthScale; /* used for mipmap lod computation */
GLvoid *Data; /* Image data, accessed via FetchTexel() */
+ GLboolean IsClientData; /* Data owned by client? */
+
const struct gl_texture_format *TexFormat;
@@ -833,7 +857,8 @@ struct gl_texture_object {
GLuint Name; /* an unsigned integer */
GLenum Target; /* GL_TEXTURE_1D, GL_TEXTURE_2D, etc. */
GLfloat Priority; /* in [0,1] */
- GLchan BorderColor[4];
+ GLfloat BorderColor[4]; /* unclamped */
+ GLchan _BorderChan[4]; /* clamped, as GLchan */
GLenum WrapS; /* Wrap modes are: GL_CLAMP, REPEAT */
GLenum WrapT; /* GL_CLAMP_TO_EDGE, and */
GLenum WrapR; /* GL_CLAMP_TO_BORDER_ARB */
@@ -846,7 +871,10 @@ struct gl_texture_object {
GLfloat MaxAnisotropy; /* GL_EXT_texture_filter_anisotropic */
GLboolean CompareFlag; /* GL_SGIX_shadow */
GLenum CompareOperator; /* GL_SGIX_shadow */
- GLchan ShadowAmbient; /* GL_SGIX_shadow_ambient */
+ GLfloat ShadowAmbient;
+ GLenum CompareMode; /* GL_ARB_shadow */
+ GLenum CompareFunc; /* GL_ARB_shadow */
+ GLenum DepthMode; /* GL_ARB_depth_texture */
GLint _MaxLevel; /* actual max mipmap level (q in the spec) */
GLfloat _MaxLambda; /* = _MaxLevel - BaseLevel (q - b in spec) */
GLboolean GenerateMipmap; /* GL_SGIS_generate_mipmap */
@@ -872,13 +900,10 @@ struct gl_texture_object {
};
-
-/*
- * Texture units are new with the multitexture extension.
- */
+/* Texture unit record */
struct gl_texture_unit {
- GLuint Enabled; /* bitmask of TEXTURE0_1D, _2D, _3D, _CUBE, _RECT */
- GLuint _ReallyEnabled; /* 0 or one of TEXTURE0_1D, _2D, _3D, _CUBE, _RECT */
+ GLuint Enabled; /* bitmask of TEXTURE_*_BIT flags */
+ GLuint _ReallyEnabled; /* 0 or exactly one of TEXTURE_*_BIT flags */
GLenum EnvMode; /* GL_MODULATE, GL_DECAL, GL_BLEND, etc. */
GLfloat EnvColor[4];
@@ -923,20 +948,17 @@ struct gl_texture_unit {
struct gl_texture_object Saved1D; /* only used by glPush/PopAttrib */
struct gl_texture_object Saved2D;
struct gl_texture_object Saved3D;
- struct gl_texture_object SavedCubeMap; /* GL_ARB_texture_cube_map */
- struct gl_texture_object SavedRect; /* GL_NV_texture_rectangle */
+ struct gl_texture_object SavedCubeMap;
+ struct gl_texture_object SavedRect;
};
+/* The texture attribute group */
struct gl_texture_attrib {
/* multitexture */
GLuint CurrentUnit; /* Active texture unit */
- GLuint _ReallyEnabled; /* enables for all texture units: */
- /* = (Unit[0]._ReallyEnabled << 0) | */
- /* (Unit[1]._ReallyEnabled << 5) | */
- /* (Unit[2]._ReallyEnabled << 10) | etc... */
-
+ GLuint _EnabledUnits; /* one bit set for each really-enabled unit */
GLuint _GenFlags; /* for texgen */
GLuint _TexGenEnabled;
GLuint _TexMatEnabled;
@@ -946,8 +968,8 @@ struct gl_texture_attrib {
struct gl_texture_object *Proxy1D;
struct gl_texture_object *Proxy2D;
struct gl_texture_object *Proxy3D;
- struct gl_texture_object *ProxyCubeMap; /* GL_ARB_texture_cube_map */
- struct gl_texture_object *ProxyRect; /* GL_NV_texture_rectangle */
+ struct gl_texture_object *ProxyCubeMap;
+ struct gl_texture_object *ProxyRect;
/* GL_EXT_shared_texture_palette */
GLboolean SharedPalette;
@@ -959,8 +981,7 @@ struct gl_transform_attrib {
GLenum MatrixMode; /* Matrix mode */
GLfloat EyeUserPlane[MAX_CLIP_PLANES][4];
GLfloat _ClipUserPlane[MAX_CLIP_PLANES][4]; /* derived */
- GLboolean ClipEnabled[MAX_CLIP_PLANES];
- GLubyte _AnyClip; /* How many ClipEnabled? */
+ GLuint ClipPlanesEnabled; /* on/off bitmask */
GLboolean Normalize; /* Normalize all normals? */
GLboolean RescaleNormals; /* GL_EXT_rescale_normal */
GLboolean RasterPositionUnclipped; /* GL_IBM_rasterpos_clip */
@@ -995,6 +1016,8 @@ struct gl_pixelstore_attrib {
GLint SkipImages; /* for GL_EXT_texture3D */
GLboolean SwapBytes;
GLboolean LsbFirst;
+ GLboolean ClientStorage; /* GL_APPLE_client_storage */
+ GLboolean Invert; /* GL_MESA_pack_invert */
};
@@ -1011,7 +1034,7 @@ struct gl_client_array {
GLsizei StrideB; /* actual stride in bytes */
void *Ptr;
GLuint Flags;
- GLboolean Enabled;
+ GLuint Enabled; /* one of the _NEW_ARRAY_ bits */
};
@@ -1025,6 +1048,8 @@ struct gl_array_attrib {
struct gl_client_array TexCoord[MAX_TEXTURE_UNITS];
struct gl_client_array EdgeFlag;
+ struct gl_client_array VertexAttrib[16]; /* GL_NV_vertex_program */
+
GLint TexCoordInterleaveFactor;
GLint ActiveTexture; /* Client Active Texture */
GLuint LockFirst;
@@ -1092,6 +1117,7 @@ struct gl_evaluators {
struct gl_1d_map Map1Texture2;
struct gl_1d_map Map1Texture3;
struct gl_1d_map Map1Texture4;
+ struct gl_1d_map Map1Attrib[16]; /* GL_NV_vertex_program */
/* 2-D maps */
struct gl_2d_map Map2Vertex3;
@@ -1103,10 +1129,131 @@ struct gl_evaluators {
struct gl_2d_map Map2Texture2;
struct gl_2d_map Map2Texture3;
struct gl_2d_map Map2Texture4;
+ struct gl_2d_map Map2Attrib[16]; /* GL_NV_vertex_program */
};
/*
+ * Vertex program tokens and datatypes
+ */
+
+#define VP_MAX_INSTRUCTIONS 128
+
+#define VP_NUM_INPUT_REGS VERT_ATTRIB_MAX
+#define VP_NUM_OUTPUT_REGS 15
+#define VP_NUM_TEMP_REGS 12
+#define VP_NUM_PROG_REGS 96
+
+#define VP_NUM_TOTAL_REGISTERS (VP_NUM_INPUT_REGS + VP_NUM_OUTPUT_REGS + VP_NUM_TEMP_REGS + VP_NUM_PROG_REGS)
+
+/* Location of register sets within the whole register file */
+#define VP_INPUT_REG_START 0
+#define VP_INPUT_REG_END (VP_INPUT_REG_START + VP_NUM_INPUT_REGS - 1)
+#define VP_OUTPUT_REG_START (VP_INPUT_REG_END + 1)
+#define VP_OUTPUT_REG_END (VP_OUTPUT_REG_START + VP_NUM_OUTPUT_REGS - 1)
+#define VP_TEMP_REG_START (VP_OUTPUT_REG_END + 1)
+#define VP_TEMP_REG_END (VP_TEMP_REG_START + VP_NUM_TEMP_REGS - 1)
+#define VP_PROG_REG_START (VP_TEMP_REG_END + 1)
+#define VP_PROG_REG_END (VP_PROG_REG_START + VP_NUM_PROG_REGS - 1)
+
+
+/* Machine state (i.e. the register file) */
+struct vp_machine
+{
+ GLfloat Registers[VP_NUM_TOTAL_REGISTERS][4];
+ GLint AddressReg; /* might someday be a 4-vector */
+};
+
+
+/* Vertex program opcodes */
+enum vp_opcode
+{
+ MOV,
+ LIT,
+ RCP,
+ RSQ,
+ EXP,
+ LOG,
+ MUL,
+ ADD,
+ DP3,
+ DP4,
+ DST,
+ MIN,
+ MAX,
+ SLT,
+ SGE,
+ MAD,
+ ARL,
+ DPH,
+ RCC,
+ SUB,
+ ABS,
+ END
+};
+
+
+/* Instruction source register */
+struct vp_src_register
+{
+ GLint Register; /* or the offset from the address register */
+ GLuint Swizzle[4];
+ GLboolean Negate;
+ GLboolean RelAddr;
+};
+
+
+/* Instruction destination register */
+struct vp_dst_register
+{
+ GLint Register;
+ GLboolean WriteMask[4];
+};
+
+
+/* Vertex program instruction */
+struct vp_instruction
+{
+ enum vp_opcode Opcode;
+ struct vp_src_register SrcReg[3];
+ struct vp_dst_register DstReg;
+};
+
+
+/* The actual vertex program, stored in the hash table */
+struct vp_program
+{
+ GLubyte *String; /* Original user code */
+ struct vp_instruction *Instructions; /* Compiled instructions */
+ GLenum Target; /* GL_VERTEX_PROGRAM_NV or GL_VERTEX_STATE_PROGRAM_NV */
+ GLint RefCount; /* Since programs can be shared among contexts */
+ GLboolean IsPositionInvariant; /* GL_NV_vertex_program1_1 */
+ GLboolean Resident;
+ GLuint InputsRead; /* Bitmask of which input regs are read */
+ GLuint OutputsWritten; /* Bitmask of which output regs are written to */
+};
+
+
+/*
+ * State vars for GL_NV_vertex_program
+ */
+struct vertex_program_state
+{
+ GLboolean Enabled; /* GL_VERTEX_PROGRAM_NV */
+ GLboolean PointSizeEnabled; /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
+ GLboolean TwoSideEnabled; /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
+ GLuint CurrentID; /* currently bound program's ID */
+ GLint ErrorPos; /* GL_PROGRAM_ERROR_POSITION_NV */
+ struct vp_program *Current; /* ptr to currently bound program */
+ struct vp_machine Machine; /* machine state */
+
+ GLenum TrackMatrix[VP_NUM_PROG_REGS / 4];
+ GLenum TrackMatrixTransform[VP_NUM_PROG_REGS / 4];
+};
+
+
+
+/*
* State which can be shared by multiple contexts:
*/
struct gl_shared_state {
@@ -1123,6 +1270,9 @@ struct gl_shared_state {
struct gl_texture_object *DefaultCubeMap;
struct gl_texture_object *DefaultRect;
+ /* GL_NV_vertex_program */
+ struct _mesa_HashTable *VertexPrograms;
+
void *DriverData; /* Device driver shared state */
};
@@ -1153,11 +1303,10 @@ struct gl_frame_buffer {
GLaccum *Accum; /* array [4*Width*Height] of GLaccum values */
/* Software alpha planes */
- GLchan *FrontLeftAlpha; /* array [Width*Height] of GLubyte */
- GLchan *BackLeftAlpha; /* array [Width*Height] of GLubyte */
- GLchan *FrontRightAlpha; /* array [Width*Height] of GLubyte */
- GLchan *BackRightAlpha; /* array [Width*Height] of GLubyte */
- GLchan *Alpha; /* Points to current alpha buffer */
+ GLvoid *FrontLeftAlpha; /* array [Width*Height] of GLubyte */
+ GLvoid *BackLeftAlpha; /* array [Width*Height] of GLubyte */
+ GLvoid *FrontRightAlpha; /* array [Width*Height] of GLubyte */
+ GLvoid *BackRightAlpha; /* array [Width*Height] of GLubyte */
/* Drawing bounds: intersection of window size and scissor box */
GLint _Xmin, _Ymin; /* inclusive */
@@ -1189,8 +1338,6 @@ struct gl_constants {
GLuint MaxColorTableSize;
GLuint MaxConvolutionWidth;
GLuint MaxConvolutionHeight;
- GLuint NumCompressedTextureFormats; /* GL_ARB_texture_compression */
- GLenum CompressedTextureFormats[MAX_COMPRESSED_TEXTURE_FORMATS];
GLuint MaxClipPlanes;
GLuint MaxLights;
};
@@ -1206,15 +1353,21 @@ struct gl_extensions {
/* Flags to quickly test if certain extensions are available.
* Not every extension needs to have such a flag, but it's encouraged.
*/
+ GLboolean ARB_depth_texture;
GLboolean ARB_imaging;
GLboolean ARB_multisample;
GLboolean ARB_multitexture;
+ GLboolean ARB_shadow;
GLboolean ARB_texture_border_clamp;
GLboolean ARB_texture_compression;
GLboolean ARB_texture_cube_map;
GLboolean ARB_texture_env_combine;
+ GLboolean ARB_texture_env_crossbar;
GLboolean ARB_texture_env_dot3;
GLboolean ARB_texture_mirrored_repeat;
+ GLboolean ARB_window_pos;
+ GLboolean ATI_texture_mirror_once;
+ GLboolean ATI_texture_env_combine3;
GLboolean EXT_blend_color;
GLboolean EXT_blend_func_separate;
GLboolean EXT_blend_logic_op;
@@ -1225,14 +1378,17 @@ struct gl_extensions {
GLboolean EXT_compiled_vertex_array;
GLboolean EXT_fog_coord;
GLboolean EXT_histogram;
+ GLboolean EXT_multi_draw_arrays;
GLboolean EXT_packed_pixels;
GLboolean EXT_paletted_texture;
GLboolean EXT_point_parameters;
GLboolean EXT_polygon_offset;
GLboolean EXT_rescale_normal;
+ GLboolean EXT_shadow_funcs;
GLboolean EXT_secondary_color;
GLboolean EXT_shared_texture_palette;
GLboolean EXT_stencil_wrap;
+ GLboolean EXT_stencil_two_side;
GLboolean EXT_texture3D;
GLboolean EXT_texture_compression_s3tc;
GLboolean EXT_texture_env_add;
@@ -1245,12 +1401,16 @@ struct gl_extensions {
GLboolean HP_occlusion_test;
GLboolean IBM_rasterpos_clip;
GLboolean INGR_blend_func_separate;
+ GLboolean MESA_pack_invert;
GLboolean MESA_window_pos;
GLboolean MESA_resize_buffers;
- GLboolean MESA_sprite_point;
+ GLboolean MESA_ycbcr_texture;
GLboolean NV_blend_square;
- GLboolean NV_texgen_reflection;
+ GLboolean NV_point_sprite;
GLboolean NV_texture_rectangle;
+ GLboolean NV_texgen_reflection;
+ GLboolean NV_vertex_program;
+ GLboolean NV_vertex_program1_1;
GLboolean SGI_color_matrix;
GLboolean SGI_color_table;
GLboolean SGIS_generate_mipmap;
@@ -1259,11 +1419,24 @@ struct gl_extensions {
GLboolean SGIX_depth_texture;
GLboolean SGIX_pixel_texture;
GLboolean SGIX_shadow;
- GLboolean SGIX_shadow_ambient;
- GLboolean _3DFX_texture_compression_FXT1;
+ GLboolean SGIX_shadow_ambient; /* or GL_ARB_shadow_ambient */
+ GLboolean TDFX_texture_compression_FXT1;
+ GLboolean APPLE_client_storage;
};
+/*
+ * A stack of matrices (projection, modelview, color, texture, etc).
+ */
+struct matrix_stack
+{
+ GLmatrix *Top; /* points into Stack */
+ GLmatrix *Stack; /* array [MaxDepth] of GLmatrix */
+ GLuint Depth; /* 0 <= Depth < MaxDepth */
+ GLuint MaxDepth; /* size of Stack[] array */
+ GLuint DirtyFlag; /* _NEW_MODELVIEW or _NEW_PROJECTION, for example */
+};
+
/*
* Bits for image transfer operations (ctx->ImageTransferState).
@@ -1324,32 +1497,40 @@ struct gl_extensions {
#define _NEW_RENDERMODE 0x800000 /* RenderMode, Feedback, Select */
#define _NEW_BUFFERS 0x1000000 /* ctx->Visual, ctx->DrawBuffer, */
#define _NEW_MULTISAMPLE 0x2000000 /* ctx->Multisample */
+#define _NEW_TRACK_MATRIX 0x4000000 /* ctx->VertexProgram */
+#define _NEW_PROGRAM 0x8000000 /* ctx->VertexProgram */
#define _NEW_ALL ~0
/* Bits to track array state changes (also used to summarize array enabled)
*/
-#define _NEW_ARRAY_VERTEX 0x1
-#define _NEW_ARRAY_COLOR 0x2
-#define _NEW_ARRAY_NORMAL 0x4
-#define _NEW_ARRAY_INDEX 0x8
-#define _NEW_ARRAY_EDGEFLAG 0x10
-#define _NEW_ARRAY_SECONDARYCOLOR 0x20
-#define _NEW_ARRAY_FOGCOORD 0x40
-#define _NEW_ARRAY_TEXCOORD_0 0x80
-#define _NEW_ARRAY_TEXCOORD_1 0x100
-#define _NEW_ARRAY_TEXCOORD_2 0x200
-#define _NEW_ARRAY_TEXCOORD_3 0x400
-#define _NEW_ARRAY_TEXCOORD_4 0x800
-#define _NEW_ARRAY_TEXCOORD_5 0x1000
-#define _NEW_ARRAY_TEXCOORD_6 0x2000
-#define _NEW_ARRAY_TEXCOORD_7 0x4000
-#define _NEW_ARRAY_ALL 0x7fff
+#define _NEW_ARRAY_VERTEX VERT_BIT_POS
+#define _NEW_ARRAY_WEIGHT VERT_BIT_WEIGHT
+#define _NEW_ARRAY_NORMAL VERT_BIT_NORMAL
+#define _NEW_ARRAY_COLOR0 VERT_BIT_COLOR0
+#define _NEW_ARRAY_COLOR1 VERT_BIT_COLOR1
+#define _NEW_ARRAY_FOGCOORD VERT_BIT_FOG
+#define _NEW_ARRAY_INDEX VERT_BIT_SIX
+#define _NEW_ARRAY_EDGEFLAG VERT_BIT_SEVEN
+#define _NEW_ARRAY_TEXCOORD_0 VERT_BIT_TEX0
+#define _NEW_ARRAY_TEXCOORD_1 VERT_BIT_TEX1
+#define _NEW_ARRAY_TEXCOORD_2 VERT_BIT_TEX2
+#define _NEW_ARRAY_TEXCOORD_3 VERT_BIT_TEX3
+#define _NEW_ARRAY_TEXCOORD_4 VERT_BIT_TEX4
+#define _NEW_ARRAY_TEXCOORD_5 VERT_BIT_TEX5
+#define _NEW_ARRAY_TEXCOORD_6 VERT_BIT_TEX6
+#define _NEW_ARRAY_TEXCOORD_7 VERT_BIT_TEX7
+#define _NEW_ARRAY_ATTRIB_0 0x10000 /* start at bit 16 */
+#define _NEW_ARRAY_ALL 0xffffffff
+
#define _NEW_ARRAY_TEXCOORD(i) (_NEW_ARRAY_TEXCOORD_0 << (i))
+#define _NEW_ARRAY_ATTRIB(i) (_NEW_ARRAY_ATTRIB_0 << (i))
+
/* A bunch of flags that we think might be useful to drivers.
+ * Set in the ctx->_TriangleCaps bitfield.
*/
#define DD_FLATSHADE 0x1
#define DD_SEPARATE_SPECULAR 0x2
@@ -1366,6 +1547,7 @@ struct gl_extensions {
#define DD_POINT_SIZE 0x1000
#define DD_POINT_ATTEN 0x2000
+
/* Define the state changes under which each of these bits might change
*/
#define _DD_NEW_FLATSHADE _NEW_LIGHT
@@ -1394,9 +1576,11 @@ struct gl_extensions {
#define _IMAGE_NEW_TRANSFER_STATE (_NEW_PIXEL | _NEW_COLOR_MATRIX)
+/* Bits for ctx->_NeedNormals */
#define NEED_NORMALS_TEXGEN 0x1
#define NEED_NORMALS_LIGHT 0x2
+/* Bits for ctx->_NeedEyeCoords */
#define NEED_EYE_TEXGEN 0x1
#define NEED_EYE_LIGHT 0x2
#define NEED_EYE_LIGHT_MODELVIEW 0x4
@@ -1433,15 +1617,18 @@ struct gl_tnl_module {
};
-/*
- * The library context:
+/**
+ * This is the central context data structure for Mesa. Almost all
+ * OpenGL state is contained in this structure.
+ * Think of this as a base class from which device drivers will derive
+ * sub classes.
*/
struct __GLcontextRec {
- /*
- ** Os related interfaces; these *must* be the first members of this
- ** structure, because they are exposed to the outside world (i.e. GLX
- ** extension).
- */
+ /**
+ * OS related interfaces; these *must* be the first members of this
+ * structure, because they are exposed to the outside world (i.e. GLX
+ * extension).
+ */
__GLimports imports;
__GLexports exports;
@@ -1449,49 +1636,39 @@ struct __GLcontextRec {
struct gl_shared_state *Shared;
/* API function pointer tables */
- struct _glapi_table *Save; /* Display list save funcs */
- struct _glapi_table *Exec; /* Execute funcs */
- struct _glapi_table *CurrentDispatch; /* == Save or Exec !! */
+ struct _glapi_table *Save; /**< Display list save funcs */
+ struct _glapi_table *Exec; /**< Execute funcs */
+ struct _glapi_table *CurrentDispatch; /**< == Save or Exec !! */
- GLboolean ExecPrefersFloat; /* What preference for color conversion? */
+ GLboolean ExecPrefersFloat; /**< What preference for color conversion? */
GLboolean SavePrefersFloat;
GLvisual Visual;
- GLframebuffer *DrawBuffer; /* buffer for writing */
- GLframebuffer *ReadBuffer; /* buffer for reading */
+ GLframebuffer *DrawBuffer; /**< buffer for writing */
+ GLframebuffer *ReadBuffer; /**< buffer for reading */
- /* Driver function pointer table */
+ /**
+ * Device driver function pointer table
+ */
struct dd_function_table Driver;
- void *DriverCtx; /* Points to device driver context/state */
- void *DriverMgrCtx; /* Points to device driver manager (optional)*/
+ void *DriverCtx; /**< Points to device driver context/state */
+ void *DriverMgrCtx; /**< Points to device driver manager (optional)*/
/* Core/Driver constants */
struct gl_constants Const;
- /* Modelview matrix and stack */
- GLmatrix ModelView; /* current matrix, not stored on stack */
- GLuint ModelViewStackDepth;
- GLmatrix ModelViewStack[MAX_MODELVIEW_STACK_DEPTH - 1];
-
- /* Projection matrix and stack */
- GLmatrix ProjectionMatrix; /* current matrix, not stored on stack */
- GLuint ProjectionStackDepth;
- GLmatrix ProjectionStack[MAX_PROJECTION_STACK_DEPTH - 1];
+ /* The various 4x4 matrix stacks */
+ struct matrix_stack ModelviewMatrixStack;
+ struct matrix_stack ProjectionMatrixStack;
+ struct matrix_stack ColorMatrixStack;
+ struct matrix_stack TextureMatrixStack[MAX_TEXTURE_UNITS];
+ struct matrix_stack ProgramMatrixStack[MAX_PROGRAM_MATRICES];
+ struct matrix_stack *CurrentStack; /* Points to one of the above stacks */
/* Combined modelview and projection matrix */
GLmatrix _ModelProjectMatrix;
- /* Texture matrix and stack */
- GLmatrix TextureMatrix[MAX_TEXTURE_UNITS];
- GLuint TextureStackDepth[MAX_TEXTURE_UNITS];
- GLmatrix TextureStack[MAX_TEXTURE_UNITS][MAX_TEXTURE_STACK_DEPTH - 1];
-
- /* Color matrix and stack */
- GLmatrix ColorMatrix;
- GLuint ColorStackDepth;
- GLmatrix ColorStack[MAX_COLOR_STACK_DEPTH - 1];
-
/* Display lists */
GLuint CallDepth; /* Current recursion calling depth */
GLboolean ExecuteFlag; /* Execute GL commands? */
@@ -1557,6 +1734,8 @@ struct __GLcontextRec {
struct gl_color_table PostColorMatrixColorTable;
struct gl_color_table ProxyPostColorMatrixColorTable;
+ struct vertex_program_state VertexProgram; /* GL_NV_vertex_program */
+
GLenum ErrorValue; /* Last error code */
GLenum RenderMode; /* either GL_RENDER, GL_SELECT, GL_FEEDBACK */
GLuint NewState; /* bitwise-or of _NEW_* flags */
@@ -1569,28 +1748,32 @@ struct __GLcontextRec {
GLuint _NeedEyeCoords;
GLuint _NeedNormals; /* Are vertex normal vectors needed? */
- struct gl_shine_tab *_ShineTable[2]; /* Active shine tables */
- struct gl_shine_tab *_ShineTabList; /* Mru list of inactive shine tables */
+ struct gl_shine_tab *_ShineTable[2]; /* Active shine tables */
+ struct gl_shine_tab *_ShineTabList; /* Mru list of inactive shine tables */
struct gl_list_extensions listext; /* driver dlist extensions */
- GLboolean OcclusionResult; /* GL_HP_occlusion_test */
- GLboolean OcclusionResultSaved; /* GL_HP_occlusion_test */
+ GLboolean OcclusionResult; /**< for GL_HP_occlusion_test */
+ GLboolean OcclusionResultSaved; /**< for GL_HP_occlusion_test */
+ GLuint _Facing; /* This is a hack for 2-sided stencil test. We don't */
+ /* have a better way to communicate this value from */
+ /* swrast_setup to swrast. */
+
/* Z buffer stuff */
- GLuint DepthMax; /* Max depth buffer value */
- GLfloat DepthMaxF; /* Float max depth buffer value */
- GLfloat MRD; /* minimum resolvable difference in Z values */
+ GLuint DepthMax; /**< Max depth buffer value */
+ GLfloat DepthMaxF; /**< Float max depth buffer value */
+ GLfloat MRD; /**< minimum resolvable difference in Z values */
- /* Should 3Dfx Glide driver catch signals? */
+ /** Should 3Dfx Glide driver catch signals? */
GLboolean CatchSignals;
- /* For debugging/development only */
+ /** For debugging/development only */
GLboolean NoRaster;
GLboolean FirstTimeCurrent;
- /* Dither disable via MESA_NO_DITHER env var */
+ /** Dither disable via MESA_NO_DITHER env var */
GLboolean NoDither;
GLboolean Rendering;
@@ -1660,16 +1843,13 @@ enum _debug {
#define Elements(x) sizeof(x)/sizeof(*(x))
-#ifndef __GNUC__
-#define __FUNCTION__ "some function"
-#endif
/* Eventually let the driver specify what statechanges require a flush:
*/
#define FLUSH_VERTICES(ctx, newstate) \
do { \
if (MESA_VERBOSE & VERBOSE_STATE) \
- fprintf(stderr, "FLUSH_VERTICES in %s\n", __FUNCTION__); \
+ _mesa_debug(ctx, "FLUSH_VERTICES in %s\n", __FUNCTION__); \
if (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES) \
ctx->Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES); \
ctx->NewState |= newstate; \
@@ -1678,7 +1858,7 @@ do { \
#define FLUSH_CURRENT(ctx, newstate) \
do { \
if (MESA_VERBOSE & VERBOSE_STATE) \
- fprintf(stderr, "FLUSH_CURRENT in %s\n", __FUNCTION__); \
+ _mesa_debug(ctx, "FLUSH_CURRENT in %s\n", __FUNCTION__); \
if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) \
ctx->Driver.FlushVertices(ctx, FLUSH_UPDATE_CURRENT); \
ctx->NewState |= newstate; \
diff --git a/xc/extras/Mesa/src/pixel.c b/xc/extras/Mesa/src/pixel.c
index f6e3322c4..af4aeb077 100644
--- a/xc/extras/Mesa/src/pixel.c
+++ b/xc/extras/Mesa/src/pixel.c
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -23,19 +23,13 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "colormac.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
#include "pixel.h"
#include "mtypes.h"
-#endif
-
/**********************************************************************/
@@ -145,6 +139,17 @@ _mesa_PixelStorei( GLenum pname, GLint param )
FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
ctx->Pack.Alignment = param;
break;
+ case GL_PACK_INVERT_MESA:
+ if (!ctx->Extensions.MESA_pack_invert) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glPixelstore(pname)" );
+ return;
+ }
+ if (ctx->Pack.Invert == param)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
+ ctx->Pack.Invert = param;
+ break;
+
case GL_UNPACK_SWAP_BYTES:
if (param == (GLint)ctx->Unpack.SwapBytes)
return;
@@ -222,6 +227,12 @@ _mesa_PixelStorei( GLenum pname, GLint param )
FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
ctx->Unpack.Alignment = param;
break;
+ case GL_UNPACK_CLIENT_STORAGE_APPLE:
+ if (param == (GLint)ctx->Unpack.ClientStorage)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
+ ctx->Unpack.ClientStorage = param ? GL_TRUE : GL_FALSE;
+ break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glPixelStore" );
return;
@@ -851,7 +862,7 @@ _mesa_transform_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4])
const GLfloat bb = ctx->Pixel.PostColorMatrixBias[2];
const GLfloat as = ctx->Pixel.PostColorMatrixScale[3];
const GLfloat ab = ctx->Pixel.PostColorMatrixBias[3];
- const GLfloat *m = ctx->ColorMatrix.m;
+ const GLfloat *m = ctx->ColorMatrixStack.Top->m;
GLuint i;
for (i = 0; i < n; i++) {
const GLfloat r = rgba[i][RCOMP];
diff --git a/xc/extras/Mesa/src/points.c b/xc/extras/Mesa/src/points.c
index 12ca20689..00941e6f2 100644
--- a/xc/extras/Mesa/src/points.c
+++ b/xc/extras/Mesa/src/points.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -23,9 +23,6 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "context.h"
#include "macros.h"
@@ -33,7 +30,6 @@
#include "points.h"
#include "texstate.h"
#include "mtypes.h"
-#endif
@@ -68,6 +64,32 @@ _mesa_PointSize( GLfloat size )
+/*
+ * Added by GL_NV_point_sprite
+ */
+void
+_mesa_PointParameteriNV( GLenum pname, GLint param )
+{
+ const GLfloat value = (GLfloat) param;
+ _mesa_PointParameterfvEXT(pname, &value);
+}
+
+
+/*
+ * Added by GL_NV_point_sprite
+ */
+void
+_mesa_PointParameterivNV( GLenum pname, const GLint *params )
+{
+ const GLfloat value = (GLfloat) params[0];
+ _mesa_PointParameterfvEXT(pname, &value);
+}
+
+
+
+/*
+ * Same for both GL_EXT_point_parameters and GL_ARB_point_parameters.
+ */
void
_mesa_PointParameterfEXT( GLenum pname, GLfloat param)
{
@@ -75,6 +97,10 @@ _mesa_PointParameterfEXT( GLenum pname, GLfloat param)
}
+
+/*
+ * Same for both GL_EXT_point_parameters and GL_ARB_point_parameters.
+ */
void
_mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params)
{
@@ -83,7 +109,7 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params)
switch (pname) {
case GL_DISTANCE_ATTENUATION_EXT:
- {
+ if (ctx->Extensions.EXT_point_parameters) {
const GLboolean tmp = ctx->Point._Attenuated;
if (TEST_EQ_3V(ctx->Point.Params, params))
return;
@@ -104,39 +130,88 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params)
ctx->_NeedEyeCoords ^= NEED_EYE_POINT_ATTEN;
}
}
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glPointParameterf[v]{EXT,ARB}(pname)");
+ return;
+ }
break;
case GL_POINT_SIZE_MIN_EXT:
- if (*params < 0.0F) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glPointParameterfvEXT" );
+ if (ctx->Extensions.EXT_point_parameters) {
+ if (params[0] < 0.0F) {
+ _mesa_error( ctx, GL_INVALID_VALUE,
+ "glPointParameterf[v]{EXT,ARB}(param)" );
+ return;
+ }
+ if (ctx->Point.MinSize == params[0])
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POINT);
+ ctx->Point.MinSize = params[0];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glPointParameterf[v]{EXT,ARB}(pname)");
return;
}
- if (ctx->Point.MinSize == *params)
- return;
- FLUSH_VERTICES(ctx, _NEW_POINT);
- ctx->Point.MinSize = *params;
break;
case GL_POINT_SIZE_MAX_EXT:
- if (*params < 0.0F) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glPointParameterfvEXT" );
+ if (ctx->Extensions.EXT_point_parameters) {
+ if (params[0] < 0.0F) {
+ _mesa_error( ctx, GL_INVALID_VALUE,
+ "glPointParameterf[v]{EXT,ARB}(param)" );
+ return;
+ }
+ if (ctx->Point.MaxSize == params[0])
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POINT);
+ ctx->Point.MaxSize = params[0];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glPointParameterf[v]{EXT,ARB}(pname)");
return;
}
- if (ctx->Point.MaxSize == *params)
- return;
- FLUSH_VERTICES(ctx, _NEW_POINT);
- ctx->Point.MaxSize = *params;
break;
case GL_POINT_FADE_THRESHOLD_SIZE_EXT:
- if (*params < 0.0F) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glPointParameterfvEXT" );
+ if (ctx->Extensions.EXT_point_parameters) {
+ if (params[0] < 0.0F) {
+ _mesa_error( ctx, GL_INVALID_VALUE,
+ "glPointParameterf[v]{EXT,ARB}(param)" );
+ return;
+ }
+ if (ctx->Point.Threshold == params[0])
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POINT);
+ ctx->Point.Threshold = params[0];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glPointParameterf[v]{EXT,ARB}(pname)");
+ return;
+ }
+ break;
+ case GL_POINT_SPRITE_R_MODE_NV:
+ if (ctx->Extensions.NV_point_sprite) {
+ GLenum value = (GLenum) params[0];
+ if (value != GL_ZERO && value != GL_S && value != GL_R) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glPointParameterf[v]{EXT,ARB}(param)");
+ return;
+ }
+ if (ctx->Point.SpriteRMode == value)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POINT);
+ ctx->Point.SpriteRMode = value;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glPointParameterf[v]{EXT,ARB}(pname)");
return;
}
- if (ctx->Point.Threshold == *params)
- return;
- FLUSH_VERTICES(ctx, _NEW_POINT);
- ctx->Point.Threshold = *params;
break;
default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glPointParameterfvEXT" );
+ _mesa_error( ctx, GL_INVALID_ENUM,
+ "glPointParameterf[v]{EXT,ARB}(pname)" );
return;
}
diff --git a/xc/extras/Mesa/src/points.h b/xc/extras/Mesa/src/points.h
index 36e1071c2..da57fba7a 100644
--- a/xc/extras/Mesa/src/points.h
+++ b/xc/extras/Mesa/src/points.h
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,9 +24,6 @@
*/
-
-
-
#ifndef POINTS_H
#define POINTS_H
@@ -37,14 +34,17 @@
extern void
_mesa_PointSize( GLfloat size );
+extern void
+_mesa_PointParameteriNV( GLenum pname, GLint param );
extern void
-_mesa_PointParameterfEXT( GLenum pname, GLfloat param);
+_mesa_PointParameterivNV( GLenum pname, const GLint *params );
+extern void
+_mesa_PointParameterfEXT( GLenum pname, GLfloat param );
extern void
_mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params );
-
#endif
diff --git a/xc/extras/Mesa/src/polygon.c b/xc/extras/Mesa/src/polygon.c
index d1be6fa66..dd4f44ec3 100644
--- a/xc/extras/Mesa/src/polygon.c
+++ b/xc/extras/Mesa/src/polygon.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,19 +24,14 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "context.h"
#include "image.h"
#include "enums.h"
#include "macros.h"
-#include "mem.h"
#include "polygon.h"
#include "mtypes.h"
-#endif
-
void
@@ -46,7 +41,7 @@ _mesa_CullFace( GLenum mode )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glCullFace %s\n", _mesa_lookup_enum_by_nr(mode));
+ _mesa_debug(ctx, "glCullFace %s\n", _mesa_lookup_enum_by_nr(mode));
if (mode!=GL_FRONT && mode!=GL_BACK && mode!=GL_FRONT_AND_BACK) {
_mesa_error( ctx, GL_INVALID_ENUM, "glCullFace" );
@@ -72,7 +67,7 @@ _mesa_FrontFace( GLenum mode )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glFrontFace %s\n", _mesa_lookup_enum_by_nr(mode));
+ _mesa_debug(ctx, "glFrontFace %s\n", _mesa_lookup_enum_by_nr(mode));
if (mode!=GL_CW && mode!=GL_CCW) {
_mesa_error( ctx, GL_INVALID_ENUM, "glFrontFace" );
@@ -100,9 +95,9 @@ _mesa_PolygonMode( GLenum face, GLenum mode )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glPolygonMode %s %s\n",
- _mesa_lookup_enum_by_nr(face),
- _mesa_lookup_enum_by_nr(mode));
+ _mesa_debug(ctx, "glPolygonMode %s %s\n",
+ _mesa_lookup_enum_by_nr(face),
+ _mesa_lookup_enum_by_nr(mode));
if (mode!=GL_POINT && mode!=GL_LINE && mode!=GL_FILL) {
_mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(mode)" );
@@ -153,7 +148,7 @@ _mesa_PolygonStipple( const GLubyte *pattern )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glPolygonStipple\n");
+ _mesa_debug(ctx, "glPolygonStipple\n");
FLUSH_VERTICES(ctx, _NEW_POLYGONSTIPPLE);
_mesa_unpack_polygon_stipple(pattern, ctx->PolygonStipple, &ctx->Unpack);
@@ -171,7 +166,7 @@ _mesa_GetPolygonStipple( GLubyte *dest )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glGetPolygonStipple\n");
+ _mesa_debug(ctx, "glGetPolygonStipple\n");
_mesa_pack_polygon_stipple(ctx->PolygonStipple, dest, &ctx->Pack);
}
@@ -185,7 +180,7 @@ _mesa_PolygonOffset( GLfloat factor, GLfloat units )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glPolygonOffset %f %f\n", factor, units);
+ _mesa_debug(ctx, "glPolygonOffset %f %f\n", factor, units);
if (ctx->Polygon.OffsetFactor == factor &&
ctx->Polygon.OffsetUnits == units)
@@ -194,7 +189,6 @@ _mesa_PolygonOffset( GLfloat factor, GLfloat units )
FLUSH_VERTICES(ctx, _NEW_POLYGON);
ctx->Polygon.OffsetFactor = factor;
ctx->Polygon.OffsetUnits = units;
- ctx->Polygon.OffsetMRD = units * ctx->MRD;
if (ctx->Driver.PolygonOffset)
ctx->Driver.PolygonOffset( ctx, factor, units );
diff --git a/xc/extras/Mesa/src/rastpos.c b/xc/extras/Mesa/src/rastpos.c
index 7813506e2..606e80d92 100644
--- a/xc/extras/Mesa/src/rastpos.c
+++ b/xc/extras/Mesa/src/rastpos.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,9 +24,6 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "clip.h"
#include "colormac.h"
@@ -42,7 +39,6 @@
#include "math/m_matrix.h"
#include "math/m_xform.h"
-#endif
/*
@@ -91,7 +87,7 @@ userclip_point( GLcontext* ctx, const GLfloat v[] )
GLuint p;
for (p = 0; p < ctx->Const.MaxClipPlanes; p++) {
- if (ctx->Transform.ClipEnabled[p]) {
+ if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
GLfloat dot = v[0] * ctx->Transform._ClipUserPlane[p][0]
+ v[1] * ctx->Transform._ClipUserPlane[p][1]
+ v[2] * ctx->Transform._ClipUserPlane[p][2]
@@ -285,15 +281,15 @@ raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
_mesa_update_state( ctx );
ASSIGN_4V( v, x, y, z, w );
- TRANSFORM_POINT( eye, ctx->ModelView.m, v );
+ TRANSFORM_POINT( eye, ctx->ModelviewMatrixStack.Top->m, v );
/* raster color */
if (ctx->Light.Enabled) {
GLfloat *norm, eyenorm[3];
- GLfloat *objnorm = ctx->Current.Normal;
+ GLfloat *objnorm = ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
if (ctx->_NeedEyeCoords) {
- GLfloat *inv = ctx->ModelView.inv;
+ GLfloat *inv = ctx->ModelviewMatrixStack.Top->inv;
TRANSFORM_NORMAL( eyenorm, objnorm, inv );
norm = eyenorm;
}
@@ -310,9 +306,10 @@ raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
else {
/* use current color or index */
if (ctx->Visual.rgbMode) {
- COPY_4FV(ctx->Current.RasterColor, ctx->Current.Color);
+ COPY_4FV(ctx->Current.RasterColor,
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
COPY_4FV(ctx->Current.RasterSecondaryColor,
- ctx->Current.SecondaryColor);
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR1]);
}
else {
ctx->Current.RasterIndex = ctx->Current.Index;
@@ -320,11 +317,14 @@ raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
}
/* compute raster distance */
- ctx->Current.RasterDistance = (GLfloat)
+ if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT)
+ ctx->Current.RasterDistance = ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
+ else
+ ctx->Current.RasterDistance = (GLfloat)
GL_SQRT( eye[0]*eye[0] + eye[1]*eye[1] + eye[2]*eye[2] );
/* apply projection matrix: clip = Proj * eye */
- TRANSFORM_POINT( clip, ctx->ProjectionMatrix.m, eye );
+ TRANSFORM_POINT( clip, ctx->ProjectionMatrixStack.Top->m, eye );
/* clip to view volume */
if (ctx->Transform.RasterPositionUnclipped) {
@@ -339,8 +339,7 @@ raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
}
/* clip to user clipping planes */
- if (ctx->Transform._AnyClip &&
- userclip_point(ctx, clip) == 0) {
+ if (ctx->Transform.ClipPlanesEnabled && !userclip_point(ctx, clip)) {
ctx->Current.RasterPosValid = GL_FALSE;
return;
}
@@ -361,13 +360,11 @@ raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
ctx->Current.RasterPos[3] = clip[3];
ctx->Current.RasterPosValid = GL_TRUE;
- ctx->Current.RasterFogCoord = ctx->Current.FogCoord;
-
{
GLuint texSet;
for (texSet = 0; texSet < ctx->Const.MaxTextureUnits; texSet++) {
- COPY_4FV( ctx->Current.RasterMultiTexCoord[texSet],
- ctx->Current.Texcoord[texSet] );
+ COPY_4FV( ctx->Current.RasterTexCoords[texSet],
+ ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texSet] );
}
}
@@ -378,7 +375,6 @@ raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
}
-
void
_mesa_RasterPos2d(GLdouble x, GLdouble y)
{
@@ -527,41 +523,53 @@ _mesa_RasterPos4sv(const GLshort *v)
}
-
/**********************************************************************/
-/*** GL_MESA_window_pos ***/
+/*** GL_ARB_window_pos / GL_MESA_window_pos ***/
/**********************************************************************/
-
-/*
- * This is a MESA extension function. Pretty much just like glRasterPos
- * except we don't apply the modelview or projection matrices; specify a
- * window coordinate directly.
- * Caller: context->API.WindowPos4fMESA pointer.
- */
-void
-_mesa_WindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+static void
+window_pos3f(GLfloat x, GLfloat y, GLfloat z)
{
GET_CURRENT_CONTEXT(ctx);
+ GLfloat z2;
+
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
FLUSH_CURRENT(ctx, 0);
+ z2 = CLAMP(z, 0.0F, 1.0F) * (ctx->Viewport.Far - ctx->Viewport.Near)
+ + ctx->Viewport.Near;
+
/* set raster position */
ctx->Current.RasterPos[0] = x;
ctx->Current.RasterPos[1] = y;
- ctx->Current.RasterPos[2] = CLAMP( z, 0.0F, 1.0F );
- ctx->Current.RasterPos[3] = w;
+ ctx->Current.RasterPos[2] = z2;
+ ctx->Current.RasterPos[3] = 1.0F;
ctx->Current.RasterPosValid = GL_TRUE;
- ctx->Current.RasterDistance = 0.0F;
- ctx->Current.RasterFogCoord = 0.0F;
+
+ if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT)
+ ctx->Current.RasterDistance = ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
+ else
+ ctx->Current.RasterDistance = 0.0;
/* raster color = current color or index */
if (ctx->Visual.rgbMode) {
- ctx->Current.RasterColor[0] = (ctx->Current.Color[0]);
- ctx->Current.RasterColor[1] = (ctx->Current.Color[1]);
- ctx->Current.RasterColor[2] = (ctx->Current.Color[2]);
- ctx->Current.RasterColor[3] = (ctx->Current.Color[3]);
+ ctx->Current.RasterColor[0]
+ = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0], 0.0F, 1.0F);
+ ctx->Current.RasterColor[1]
+ = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1], 0.0F, 1.0F);
+ ctx->Current.RasterColor[2]
+ = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2], 0.0F, 1.0F);
+ ctx->Current.RasterColor[3]
+ = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3], 0.0F, 1.0F);
+ ctx->Current.RasterSecondaryColor[0]
+ = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0], 0.0F, 1.0F);
+ ctx->Current.RasterSecondaryColor[1]
+ = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1], 0.0F, 1.0F);
+ ctx->Current.RasterSecondaryColor[2]
+ = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2], 0.0F, 1.0F);
+ ctx->Current.RasterSecondaryColor[3]
+ = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3], 0.0F, 1.0F);
}
else {
ctx->Current.RasterIndex = ctx->Current.Index;
@@ -571,8 +579,8 @@ _mesa_WindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
{
GLuint texSet;
for (texSet = 0; texSet < ctx->Const.MaxTextureUnits; texSet++) {
- COPY_4FV( ctx->Current.RasterMultiTexCoord[texSet],
- ctx->Current.Texcoord[texSet] );
+ COPY_4FV( ctx->Current.RasterTexCoords[texSet],
+ ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texSet] );
}
}
@@ -582,146 +590,160 @@ _mesa_WindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
}
+/* This is just to support the GL_MESA_window_pos version */
+static void
+window_pos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ window_pos3f(x, y, z);
+ ctx->Current.RasterPos[3] = w;
+}
void
_mesa_WindowPos2dMESA(GLdouble x, GLdouble y)
{
- _mesa_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
+ window_pos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
}
void
_mesa_WindowPos2fMESA(GLfloat x, GLfloat y)
{
- _mesa_WindowPos4fMESA(x, y, 0.0F, 1.0F);
+ window_pos4f(x, y, 0.0F, 1.0F);
}
void
_mesa_WindowPos2iMESA(GLint x, GLint y)
{
- _mesa_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
+ window_pos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
}
void
_mesa_WindowPos2sMESA(GLshort x, GLshort y)
{
- _mesa_WindowPos4fMESA(x, y, 0.0F, 1.0F);
+ window_pos4f(x, y, 0.0F, 1.0F);
}
void
_mesa_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z)
{
- _mesa_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
+ window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
}
void
_mesa_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z)
{
- _mesa_WindowPos4fMESA(x, y, z, 1.0F);
+ window_pos4f(x, y, z, 1.0F);
}
void
_mesa_WindowPos3iMESA(GLint x, GLint y, GLint z)
{
- _mesa_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
+ window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
}
void
_mesa_WindowPos3sMESA(GLshort x, GLshort y, GLshort z)
{
- _mesa_WindowPos4fMESA(x, y, z, 1.0F);
+ window_pos4f(x, y, z, 1.0F);
}
void
_mesa_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
- _mesa_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
+ window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
+}
+
+void
+_mesa_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ window_pos4f(x, y, z, w);
}
void
_mesa_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w)
{
- _mesa_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
+ window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
}
void
_mesa_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w)
{
- _mesa_WindowPos4fMESA(x, y, z, w);
+ window_pos4f(x, y, z, w);
}
void
_mesa_WindowPos2dvMESA(const GLdouble *v)
{
- _mesa_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
+ window_pos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
}
void
_mesa_WindowPos2fvMESA(const GLfloat *v)
{
- _mesa_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
+ window_pos4f(v[0], v[1], 0.0F, 1.0F);
}
void
_mesa_WindowPos2ivMESA(const GLint *v)
{
- _mesa_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
+ window_pos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
}
void
_mesa_WindowPos2svMESA(const GLshort *v)
{
- _mesa_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
+ window_pos4f(v[0], v[1], 0.0F, 1.0F);
}
void
_mesa_WindowPos3dvMESA(const GLdouble *v)
{
- _mesa_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
+ window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
}
void
_mesa_WindowPos3fvMESA(const GLfloat *v)
{
- _mesa_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
+ window_pos4f(v[0], v[1], v[2], 1.0);
}
void
_mesa_WindowPos3ivMESA(const GLint *v)
{
- _mesa_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
+ window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
}
void
_mesa_WindowPos3svMESA(const GLshort *v)
{
- _mesa_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
+ window_pos4f(v[0], v[1], v[2], 1.0F);
}
void
_mesa_WindowPos4dvMESA(const GLdouble *v)
{
- _mesa_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
+ window_pos4f((GLfloat) v[0], (GLfloat) v[1],
(GLfloat) v[2], (GLfloat) v[3]);
}
void
_mesa_WindowPos4fvMESA(const GLfloat *v)
{
- _mesa_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
+ window_pos4f(v[0], v[1], v[2], v[3]);
}
void
_mesa_WindowPos4ivMESA(const GLint *v)
{
- _mesa_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
+ window_pos4f((GLfloat) v[0], (GLfloat) v[1],
(GLfloat) v[2], (GLfloat) v[3]);
}
void
_mesa_WindowPos4svMESA(const GLshort *v)
{
- _mesa_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
+ window_pos4f(v[0], v[1], v[2], v[3]);
}
diff --git a/xc/extras/Mesa/src/rastpos.h b/xc/extras/Mesa/src/rastpos.h
index e3fc1ee20..3d18cb91c 100644
--- a/xc/extras/Mesa/src/rastpos.h
+++ b/xc/extras/Mesa/src/rastpos.h
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
diff --git a/xc/extras/Mesa/src/state.c b/xc/extras/Mesa/src/state.c
index 9ea5e118c..dc3409ed5 100644
--- a/xc/extras/Mesa/src/state.c
+++ b/xc/extras/Mesa/src/state.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.4
+ * Version: 5.0
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -30,9 +30,6 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "accum.h"
#include "api_loopback.h"
@@ -68,17 +65,19 @@
#include "texstate.h"
#include "mtypes.h"
#include "varray.h"
+#if FEATURE_NV_vertex_program
+#include "vpstate.h"
+#endif
#include "math/m_matrix.h"
#include "math/m_xform.h"
-#endif
static int
generic_noop(void)
{
#ifdef DEBUG
- _mesa_problem(NULL, "undefined function dispatch");
+ _mesa_problem(NULL, "User called no-op dispatch function");
#endif
return 0;
}
@@ -294,6 +293,7 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
/* 1.1 */
exec->AreTexturesResident = _mesa_AreTexturesResident;
+ exec->AreTexturesResidentEXT = _mesa_AreTexturesResident;
exec->BindTexture = _mesa_BindTexture;
exec->ColorPointer = _mesa_ColorPointer;
exec->CopyTexImage1D = _mesa_CopyTexImage1D;
@@ -305,10 +305,12 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
exec->EdgeFlagPointer = _mesa_EdgeFlagPointer;
exec->EnableClientState = _mesa_EnableClientState;
exec->GenTextures = _mesa_GenTextures;
+ exec->GenTexturesEXT = _mesa_GenTextures;
exec->GetPointerv = _mesa_GetPointerv;
exec->IndexPointer = _mesa_IndexPointer;
exec->InterleavedArrays = _mesa_InterleavedArrays;
exec->IsTexture = _mesa_IsTexture;
+ exec->IsTextureEXT = _mesa_IsTexture;
exec->NormalPointer = _mesa_NormalPointer;
exec->PopClientAttrib = _mesa_PopClientAttrib;
exec->PrioritizeTextures = _mesa_PrioritizeTextures;
@@ -341,18 +343,31 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
exec->CopyConvolutionFilter1D = _mesa_CopyConvolutionFilter1D;
exec->CopyConvolutionFilter2D = _mesa_CopyConvolutionFilter2D;
exec->GetColorTable = _mesa_GetColorTable;
+ exec->GetColorTableEXT = _mesa_GetColorTable;
exec->GetColorTableParameterfv = _mesa_GetColorTableParameterfv;
+ exec->GetColorTableParameterfvEXT = _mesa_GetColorTableParameterfv;
exec->GetColorTableParameteriv = _mesa_GetColorTableParameteriv;
+ exec->GetColorTableParameterivEXT = _mesa_GetColorTableParameteriv;
exec->GetConvolutionFilter = _mesa_GetConvolutionFilter;
+ exec->GetConvolutionFilterEXT = _mesa_GetConvolutionFilter;
exec->GetConvolutionParameterfv = _mesa_GetConvolutionParameterfv;
+ exec->GetConvolutionParameterfvEXT = _mesa_GetConvolutionParameterfv;
exec->GetConvolutionParameteriv = _mesa_GetConvolutionParameteriv;
+ exec->GetConvolutionParameterivEXT = _mesa_GetConvolutionParameteriv;
exec->GetHistogram = _mesa_GetHistogram;
+ exec->GetHistogramEXT = _mesa_GetHistogram;
exec->GetHistogramParameterfv = _mesa_GetHistogramParameterfv;
+ exec->GetHistogramParameterfvEXT = _mesa_GetHistogramParameterfv;
exec->GetHistogramParameteriv = _mesa_GetHistogramParameteriv;
+ exec->GetHistogramParameterivEXT = _mesa_GetHistogramParameteriv;
exec->GetMinmax = _mesa_GetMinmax;
+ exec->GetMinmaxEXT = _mesa_GetMinmax;
exec->GetMinmaxParameterfv = _mesa_GetMinmaxParameterfv;
+ exec->GetMinmaxParameterfvEXT = _mesa_GetMinmaxParameterfv;
exec->GetMinmaxParameteriv = _mesa_GetMinmaxParameteriv;
+ exec->GetMinmaxParameterivEXT = _mesa_GetMinmaxParameteriv;
exec->GetSeparableFilter = _mesa_GetSeparableFilter;
+ exec->GetSeparableFilterEXT = _mesa_GetSeparableFilter;
exec->Histogram = _mesa_Histogram;
exec->Minmax = _mesa_Minmax;
exec->ResetHistogram = _mesa_ResetHistogram;
@@ -423,6 +438,10 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
exec->LockArraysEXT = _mesa_LockArraysEXT;
exec->UnlockArraysEXT = _mesa_UnlockArraysEXT;
+ /* 148. GL_EXT_multi_draw_arrays */
+ exec->MultiDrawArraysEXT = _mesa_MultiDrawArraysEXT;
+ exec->MultiDrawElementsEXT = _mesa_MultiDrawElementsEXT;
+
/* 173. GL_INGR_blend_func_separate */
exec->BlendFuncSeparateEXT = _mesa_BlendFuncSeparateEXT;
@@ -455,6 +474,42 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
exec->WindowPos4sMESA = _mesa_WindowPos4sMESA;
exec->WindowPos4svMESA = _mesa_WindowPos4svMESA;
+ /* 233. GL_NV_vertex_program */
+#if FEATURE_NV_vertex_program
+ exec->BindProgramNV = _mesa_BindProgramNV;
+ exec->DeleteProgramsNV = _mesa_DeleteProgramsNV;
+ exec->ExecuteProgramNV = _mesa_ExecuteProgramNV;
+ exec->GenProgramsNV = _mesa_GenProgramsNV;
+ exec->AreProgramsResidentNV = _mesa_AreProgramsResidentNV;
+ exec->RequestResidentProgramsNV = _mesa_RequestResidentProgramsNV;
+ exec->GetProgramParameterfvNV = _mesa_GetProgramParameterfvNV;
+ exec->GetProgramParameterdvNV = _mesa_GetProgramParameterdvNV;
+ exec->GetProgramivNV = _mesa_GetProgramivNV;
+ exec->GetProgramStringNV = _mesa_GetProgramStringNV;
+ exec->GetTrackMatrixivNV = _mesa_GetTrackMatrixivNV;
+ exec->GetVertexAttribdvNV = _mesa_GetVertexAttribdvNV;
+ exec->GetVertexAttribfvNV = _mesa_GetVertexAttribfvNV;
+ exec->GetVertexAttribivNV = _mesa_GetVertexAttribivNV;
+ exec->GetVertexAttribPointervNV = _mesa_GetVertexAttribPointervNV;
+ exec->IsProgramNV = _mesa_IsProgramNV;
+ exec->LoadProgramNV = _mesa_LoadProgramNV;
+ exec->ProgramParameter4dNV = _mesa_ProgramParameter4dNV;
+ exec->ProgramParameter4dvNV = _mesa_ProgramParameter4dvNV;
+ exec->ProgramParameter4fNV = _mesa_ProgramParameter4fNV;
+ exec->ProgramParameter4fvNV = _mesa_ProgramParameter4fvNV;
+ exec->ProgramParameters4dvNV = _mesa_ProgramParameters4dvNV;
+ exec->ProgramParameters4fvNV = _mesa_ProgramParameters4fvNV;
+ exec->TrackMatrixNV = _mesa_TrackMatrixNV;
+ exec->VertexAttribPointerNV = _mesa_VertexAttribPointerNV;
+#endif
+
+ /* 262. GL_NV_point_sprite */
+ exec->PointParameteriNV = _mesa_PointParameteriNV;
+ exec->PointParameterivNV = _mesa_PointParameterivNV;
+
+ /* 268. GL_EXT_stencil_two_side */
+ exec->ActiveStencilFaceEXT = _mesa_ActiveStencilFaceEXT;
+
/* ARB 1. GL_ARB_multitexture */
exec->ActiveTextureARB = _mesa_ActiveTextureARB;
exec->ClientActiveTextureARB = _mesa_ClientActiveTextureARB;
@@ -477,6 +532,8 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
exec->CompressedTexSubImage1DARB = _mesa_CompressedTexSubImage1DARB;
exec->GetCompressedTexImageARB = _mesa_GetCompressedTexImageARB;
+ /* ARB 14. GL_ARB_point_parameters */
+ /* reuse EXT_point_parameters functions */
}
@@ -486,6 +543,10 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
/**********************************************************************/
+/*
+ * Check polygon state and set DD_TRI_CULL_FRONT_BACK and/or DD_TRI_OFFSET
+ * in ctx->_TriangleCaps if needed.
+ */
static void
update_polygon( GLcontext *ctx )
{
@@ -495,36 +556,32 @@ update_polygon( GLcontext *ctx )
ctx->_TriangleCaps |= DD_TRI_CULL_FRONT_BACK;
/* Any Polygon offsets enabled? */
- ctx->Polygon._OffsetAny = GL_FALSE;
- ctx->_TriangleCaps &= ~DD_TRI_OFFSET;
-
if (ctx->Polygon.OffsetPoint ||
ctx->Polygon.OffsetLine ||
ctx->Polygon.OffsetFill) {
ctx->_TriangleCaps |= DD_TRI_OFFSET;
- ctx->Polygon._OffsetAny = GL_TRUE;
}
}
static void
calculate_model_project_matrix( GLcontext *ctx )
{
- _math_matrix_mul_matrix( &ctx->_ModelProjectMatrix,
- &ctx->ProjectionMatrix,
- &ctx->ModelView );
+ _math_matrix_mul_matrix( &ctx->_ModelProjectMatrix,
+ ctx->ProjectionMatrixStack.Top,
+ ctx->ModelviewMatrixStack.Top );
- _math_matrix_analyse( &ctx->_ModelProjectMatrix );
+ _math_matrix_analyse( &ctx->_ModelProjectMatrix );
}
static void
update_modelview_scale( GLcontext *ctx )
{
ctx->_ModelViewInvScale = 1.0F;
- if (ctx->ModelView.flags & (MAT_FLAG_UNIFORM_SCALE |
+ if (ctx->ModelviewMatrixStack.Top->flags & (MAT_FLAG_UNIFORM_SCALE |
MAT_FLAG_GENERAL_SCALE |
MAT_FLAG_GENERAL_3D |
MAT_FLAG_GENERAL) ) {
- const GLfloat *m = ctx->ModelView.inv;
+ const GLfloat *m = ctx->ModelviewMatrixStack.Top->inv;
GLfloat f = m[2] * m[2] + m[6] * m[6] + m[10] * m[10];
if (f < 1e-12) f = 1.0;
if (ctx->_NeedEyeCoords)
@@ -594,23 +651,23 @@ update_drawbuffer( GLcontext *ctx )
/* NOTE: This routine references Tranform attribute values to compute
* userclip positions in clip space, but is only called on
* _NEW_PROJECTION. The _mesa_ClipPlane() function keeps these values
- * uptodate across changes to the Transform attributes.
+ * up to date across changes to the Transform attributes.
*/
static void
update_projection( GLcontext *ctx )
{
- _math_matrix_analyse( &ctx->ProjectionMatrix );
+ _math_matrix_analyse( ctx->ProjectionMatrixStack.Top );
/* Recompute clip plane positions in clipspace. This is also done
* in _mesa_ClipPlane().
*/
- if (ctx->Transform._AnyClip) {
+ if (ctx->Transform.ClipPlanesEnabled) {
GLuint p;
for (p = 0; p < ctx->Const.MaxClipPlanes; p++) {
- if (ctx->Transform.ClipEnabled[p]) {
+ if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
_mesa_transform_vector( ctx->Transform._ClipUserPlane[p],
ctx->Transform.EyeUserPlane[p],
- ctx->ProjectionMatrix.inv );
+ ctx->ProjectionMatrixStack.Top->inv );
}
}
}
@@ -660,7 +717,7 @@ update_image_transfer_state(GLcontext *ctx)
if (ctx->Pixel.PostConvolutionColorTableEnabled)
mask |= IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT;
- if (ctx->ColorMatrix.type != MATRIX_IDENTITY ||
+ if (ctx->ColorMatrixStack.Top->type != MATRIX_IDENTITY ||
ctx->Pixel.PostColorMatrixScale[0] != 1.0F ||
ctx->Pixel.PostColorMatrixBias[0] != 0.0F ||
ctx->Pixel.PostColorMatrixScale[1] != 1.0F ||
@@ -702,15 +759,15 @@ update_texture_matrices( GLcontext *ctx )
ctx->Texture._TexMatEnabled = 0;
for (i=0; i < ctx->Const.MaxTextureUnits; i++) {
- if (ctx->TextureMatrix[i].flags & MAT_DIRTY) {
- _math_matrix_analyse( &ctx->TextureMatrix[i] );
+ if (ctx->TextureMatrixStack[i].Top->flags & MAT_DIRTY) {
+ _math_matrix_analyse( ctx->TextureMatrixStack[i].Top );
if (ctx->Texture.Unit[i]._ReallyEnabled &&
- ctx->TextureMatrix[i].type != MATRIX_IDENTITY)
+ ctx->TextureMatrixStack[i].Top->type != MATRIX_IDENTITY)
ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(i);
if (ctx->Driver.TextureMatrix)
- ctx->Driver.TextureMatrix( ctx, i, &ctx->TextureMatrix[i] );
+ ctx->Driver.TextureMatrix( ctx, i, ctx->TextureMatrixStack[i].Top);
}
}
}
@@ -727,9 +784,9 @@ update_texture_matrices( GLcontext *ctx )
static void
update_texture_state( GLcontext *ctx )
{
- GLuint i;
+ GLuint unit;
- ctx->Texture._ReallyEnabled = 0;
+ ctx->Texture._EnabledUnits = 0;
ctx->Texture._GenFlags = 0;
ctx->_NeedNormals &= ~NEED_NORMALS_TEXGEN;
ctx->_NeedEyeCoords &= ~NEED_EYE_TEXGEN;
@@ -738,8 +795,8 @@ update_texture_state( GLcontext *ctx )
/* Update texture unit state.
*/
- for (i=0; i < ctx->Const.MaxTextureUnits; i++) {
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
+ for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
texUnit->_ReallyEnabled = 0;
texUnit->_GenFlags = 0;
@@ -747,60 +804,60 @@ update_texture_state( GLcontext *ctx )
if (!texUnit->Enabled)
continue;
- /* Find the texture of highest dimensionality that is enabled
- * and complete. We'll use it for texturing.
+ /* Look for the highest-priority texture target that's enabled and
+ * complete. That's the one we'll use for texturing.
*/
- if (texUnit->Enabled & TEXTURE0_CUBE) {
+ if (texUnit->Enabled & TEXTURE_CUBE_BIT) {
struct gl_texture_object *texObj = texUnit->CurrentCubeMap;
if (!texObj->Complete) {
_mesa_test_texobj_completeness(ctx, texObj);
}
if (texObj->Complete) {
- texUnit->_ReallyEnabled = TEXTURE0_CUBE;
+ texUnit->_ReallyEnabled = TEXTURE_CUBE_BIT;
texUnit->_Current = texObj;
}
}
- if (!texUnit->_ReallyEnabled && (texUnit->Enabled & TEXTURE0_3D)) {
+ if (!texUnit->_ReallyEnabled && (texUnit->Enabled & TEXTURE_3D_BIT)) {
struct gl_texture_object *texObj = texUnit->Current3D;
if (!texObj->Complete) {
_mesa_test_texobj_completeness(ctx, texObj);
}
if (texObj->Complete) {
- texUnit->_ReallyEnabled = TEXTURE0_3D;
+ texUnit->_ReallyEnabled = TEXTURE_3D_BIT;
texUnit->_Current = texObj;
}
}
- if (!texUnit->_ReallyEnabled && (texUnit->Enabled & TEXTURE0_RECT)) {
+ if (!texUnit->_ReallyEnabled && (texUnit->Enabled & TEXTURE_RECT_BIT)) {
struct gl_texture_object *texObj = texUnit->CurrentRect;
if (!texObj->Complete) {
_mesa_test_texobj_completeness(ctx, texObj);
}
if (texObj->Complete) {
- texUnit->_ReallyEnabled = TEXTURE0_RECT;
+ texUnit->_ReallyEnabled = TEXTURE_RECT_BIT;
texUnit->_Current = texObj;
}
}
- if (!texUnit->_ReallyEnabled && (texUnit->Enabled & TEXTURE0_2D)) {
+ if (!texUnit->_ReallyEnabled && (texUnit->Enabled & TEXTURE_2D_BIT)) {
struct gl_texture_object *texObj = texUnit->Current2D;
if (!texObj->Complete) {
_mesa_test_texobj_completeness(ctx, texObj);
}
if (texObj->Complete) {
- texUnit->_ReallyEnabled = TEXTURE0_2D;
+ texUnit->_ReallyEnabled = TEXTURE_2D_BIT;
texUnit->_Current = texObj;
}
}
- if (!texUnit->_ReallyEnabled && (texUnit->Enabled & TEXTURE0_1D)) {
+ if (!texUnit->_ReallyEnabled && (texUnit->Enabled & TEXTURE_1D_BIT)) {
struct gl_texture_object *texObj = texUnit->Current1D;
if (!texObj->Complete) {
_mesa_test_texobj_completeness(ctx, texObj);
}
if (texObj->Complete) {
- texUnit->_ReallyEnabled = TEXTURE0_1D;
+ texUnit->_ReallyEnabled = TEXTURE_1D_BIT;
texUnit->_Current = texObj;
}
}
@@ -810,10 +867,8 @@ update_texture_state( GLcontext *ctx )
continue;
}
- {
- GLuint flag = texUnit->_ReallyEnabled << (i * NUM_TEXTURE_TARGETS);
- ctx->Texture._ReallyEnabled |= flag;
- }
+ if (texUnit->_ReallyEnabled)
+ ctx->Texture._EnabledUnits |= (1 << unit);
if (texUnit->TexGenEnabled) {
if (texUnit->TexGenEnabled & S_BIT) {
@@ -829,12 +884,12 @@ update_texture_state( GLcontext *ctx )
texUnit->_GenFlags |= texUnit->_GenBitR;
}
- ctx->Texture._TexGenEnabled |= ENABLE_TEXGEN(i);
+ ctx->Texture._TexGenEnabled |= ENABLE_TEXGEN(unit);
ctx->Texture._GenFlags |= texUnit->_GenFlags;
}
- if (ctx->TextureMatrix[i].type != MATRIX_IDENTITY)
- ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(i);
+ if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY)
+ ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(unit);
}
if (ctx->Texture._GenFlags & TEXGEN_NEED_NORMALS) {
@@ -848,6 +903,7 @@ update_texture_state( GLcontext *ctx )
}
+
/*
* If ctx->NewState is non-zero then this function MUST be called before
* rendering any primitive. Basically, function pointers and miscellaneous
@@ -874,7 +930,7 @@ void _mesa_update_state( GLcontext *ctx )
_mesa_print_state("_mesa_update_state", new_state);
if (new_state & _NEW_MODELVIEW)
- _math_matrix_analyse( &ctx->ModelView );
+ _math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
if (new_state & _NEW_PROJECTION)
update_projection( ctx );
@@ -883,7 +939,7 @@ void _mesa_update_state( GLcontext *ctx )
update_texture_matrices( ctx );
if (new_state & _NEW_COLOR_MATRIX)
- _math_matrix_analyse( &ctx->ColorMatrix );
+ _math_matrix_analyse( ctx->ColorMatrixStack.Top );
/* References ColorMatrix.type (derived above).
*/
@@ -912,17 +968,29 @@ void _mesa_update_state( GLcontext *ctx )
if (new_state & (_NEW_MODELVIEW|_NEW_LIGHT)) {
ctx->_NeedEyeCoords &= ~NEED_EYE_LIGHT_MODELVIEW;
if (ctx->Light.Enabled &&
- !TEST_MAT_FLAGS( &ctx->ModelView, MAT_FLAGS_LENGTH_PRESERVING))
+ !TEST_MAT_FLAGS( ctx->ModelviewMatrixStack.Top, MAT_FLAGS_LENGTH_PRESERVING))
ctx->_NeedEyeCoords |= NEED_EYE_LIGHT_MODELVIEW;
}
+
+#if 0
+ /* XXX this is a bit of a hack. We should be checking elsewhere if
+ * vertex program mode is enabled. We set _NeedEyeCoords to zero to
+ * ensure that the combined modelview/projection matrix is computed
+ * in calculate_model_project_matrix().
+ */
+ if (ctx->VertexProgram.Enabled)
+ ctx->_NeedEyeCoords = 0;
+ /* KW: it's now always computed.
+ */
+#endif
+
/* Keep ModelviewProject uptodate always to allow tnl
* implementations that go model->clip even when eye is required.
*/
if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION))
calculate_model_project_matrix(ctx);
-
/* ctx->_NeedEyeCoords is now uptodate.
*
* If the truth value of this variable has changed, update for the
@@ -956,7 +1024,6 @@ void _mesa_update_state( GLcontext *ctx )
ASSERT(ctx->Driver.GetString);
ASSERT(ctx->Driver.UpdateState);
ASSERT(ctx->Driver.Clear);
- ASSERT(ctx->Driver.SetDrawBuffer);
ASSERT(ctx->Driver.GetBufferSize);
if (ctx->Visual.accumRedBits > 0) {
ASSERT(ctx->Driver.Accum);
@@ -978,9 +1045,6 @@ void _mesa_update_state( GLcontext *ctx )
ASSERT(ctx->Driver.CopyTexSubImage2D);
ASSERT(ctx->Driver.CopyTexSubImage3D);
if (ctx->Extensions.ARB_texture_compression) {
- ASSERT(ctx->Driver.BaseCompressedTexFormat);
- ASSERT(ctx->Driver.CompressedTextureSize);
- ASSERT(ctx->Driver.GetCompressedTexImage);
#if 0 /* HW drivers need these, but not SW rasterizers */
ASSERT(ctx->Driver.CompressedTexImage1D);
ASSERT(ctx->Driver.CompressedTexImage2D);
diff --git a/xc/extras/Mesa/src/stencil.c b/xc/extras/Mesa/src/stencil.c
index f633220d2..b38a620e5 100644
--- a/xc/extras/Mesa/src/stencil.c
+++ b/xc/extras/Mesa/src/stencil.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,20 +24,14 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "context.h"
#include "depth.h"
#include "macros.h"
-#include "mem.h"
#include "stencil.h"
#include "mtypes.h"
#include "enable.h"
-#endif
-
-
void
@@ -63,6 +57,7 @@ void
_mesa_StencilFunc( GLenum func, GLint ref, GLuint mask )
{
GET_CURRENT_CONTEXT(ctx);
+ const GLint face = ctx->Stencil.ActiveFace;
GLint maxref;
ASSERT_OUTSIDE_BEGIN_END(ctx);
@@ -84,18 +79,18 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask )
maxref = (1 << STENCIL_BITS) - 1;
ref = (GLstencil) CLAMP( ref, 0, maxref );
- if (ctx->Stencil.Function == func &&
- ctx->Stencil.ValueMask == (GLstencil) mask &&
- ctx->Stencil.Ref == ref)
+ if (ctx->Stencil.Function[face] == func &&
+ ctx->Stencil.ValueMask[face] == (GLstencil) mask &&
+ ctx->Stencil.Ref[face] == ref)
return;
FLUSH_VERTICES(ctx, _NEW_STENCIL);
- ctx->Stencil.Function = func;
- ctx->Stencil.Ref = ref;
- ctx->Stencil.ValueMask = (GLstencil) mask;
+ ctx->Stencil.Function[face] = func;
+ ctx->Stencil.Ref[face] = ref;
+ ctx->Stencil.ValueMask[face] = (GLstencil) mask;
if (ctx->Driver.StencilFunc) {
- (*ctx->Driver.StencilFunc)( ctx, func, ctx->Stencil.Ref, mask );
+ (*ctx->Driver.StencilFunc)( ctx, func, ref, mask );
}
}
@@ -105,13 +100,14 @@ void
_mesa_StencilMask( GLuint mask )
{
GET_CURRENT_CONTEXT(ctx);
+ const GLint face = ctx->Stencil.ActiveFace;
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (ctx->Stencil.WriteMask == (GLstencil) mask)
- return;
+ if (ctx->Stencil.WriteMask[face] == (GLstencil) mask)
+ return;
FLUSH_VERTICES(ctx, _NEW_STENCIL);
- ctx->Stencil.WriteMask = (GLstencil) mask;
+ ctx->Stencil.WriteMask[face] = (GLstencil) mask;
if (ctx->Driver.StencilMask) {
(*ctx->Driver.StencilMask)( ctx, mask );
@@ -124,6 +120,7 @@ void
_mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
{
GET_CURRENT_CONTEXT(ctx);
+ const GLint face = ctx->Stencil.ActiveFace;
ASSERT_OUTSIDE_BEGIN_END(ctx);
switch (fail) {
@@ -181,17 +178,36 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
return;
}
- if (ctx->Stencil.ZFailFunc == zfail &&
- ctx->Stencil.ZPassFunc == zpass &&
- ctx->Stencil.FailFunc == fail)
+ if (ctx->Stencil.ZFailFunc[face] == zfail &&
+ ctx->Stencil.ZPassFunc[face] == zpass &&
+ ctx->Stencil.FailFunc[face] == fail)
return;
FLUSH_VERTICES(ctx, _NEW_STENCIL);
- ctx->Stencil.ZFailFunc = zfail;
- ctx->Stencil.ZPassFunc = zpass;
- ctx->Stencil.FailFunc = fail;
+ ctx->Stencil.ZFailFunc[face] = zfail;
+ ctx->Stencil.ZPassFunc[face] = zpass;
+ ctx->Stencil.FailFunc[face] = fail;
if (ctx->Driver.StencilOp) {
(*ctx->Driver.StencilOp)(ctx, fail, zfail, zpass);
}
}
+
+
+/* GL_EXT_stencil_two_side */
+void
+_mesa_ActiveStencilFaceEXT(GLenum face)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (face == GL_FRONT || face == GL_BACK) {
+ FLUSH_VERTICES(ctx, _NEW_STENCIL);
+ ctx->Stencil.ActiveFace = (face == GL_FRONT) ? 0 : 1;
+ }
+
+ if (ctx->Driver.ActiveStencilFace) {
+ (*ctx->Driver.ActiveStencilFace)( ctx, (GLuint) ctx->Stencil.ActiveFace );
+ }
+}
+
diff --git a/xc/extras/Mesa/src/stencil.h b/xc/extras/Mesa/src/stencil.h
index 7c96e8b9e..bb20884b8 100644
--- a/xc/extras/Mesa/src/stencil.h
+++ b/xc/extras/Mesa/src/stencil.h
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -47,5 +47,8 @@ extern void
_mesa_StencilOp( GLenum fail, GLenum zfail, GLenum zpass );
+extern void
+_mesa_ActiveStencilFaceEXT(GLenum face);
+
#endif
diff --git a/xc/extras/Mesa/src/swrast/s_aaline.c b/xc/extras/Mesa/src/swrast/s_aaline.c
index 08bcaac63..cef87b2c1 100644
--- a/xc/extras/Mesa/src/swrast/s_aaline.c
+++ b/xc/extras/Mesa/src/swrast/s_aaline.c
@@ -1,10 +1,9 @@
-/* $Id: s_aaline.c,v 1.1.1.1 2002/10/22 13:06:56 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -27,8 +26,8 @@
#include "glheader.h"
#include "swrast/s_aaline.h"
-#include "swrast/s_pb.h"
#include "swrast/s_context.h"
+#include "swrast/s_span.h"
#include "swrast/swrast.h"
#include "mtypes.h"
#include "mmath.h"
@@ -75,6 +74,8 @@ struct LineInfo
GLfloat vPlane[MAX_TEXTURE_UNITS][4];
GLfloat lambda[MAX_TEXTURE_UNITS];
GLfloat texWidth[MAX_TEXTURE_UNITS], texHeight[MAX_TEXTURE_UNITS];
+
+ struct sw_span span;
};
@@ -326,8 +327,9 @@ compute_coveragef(const struct LineInfo *info,
-typedef void (*plot_func)(GLcontext *ctx, const struct LineInfo *line,
- struct pixel_buffer *pb, int ix, int iy);
+typedef void (*plot_func)(GLcontext *ctx, struct LineInfo *line,
+ int ix, int iy);
+
/*
@@ -337,7 +339,6 @@ static void
segment(GLcontext *ctx,
struct LineInfo *line,
plot_func plot,
- struct pixel_buffer *pb,
GLfloat t0, GLfloat t1)
{
const GLfloat absDx = (line->dx < 0.0F) ? -line->dx : line->dx;
@@ -407,7 +408,7 @@ segment(GLcontext *ctx,
GLint iy;
/* scan across the line, bottom-to-top */
for (iy = iyBot; iy < iyTop; iy++) {
- (*plot)(ctx, line, pb, ix, iy);
+ (*plot)(ctx, line, ix, iy);
}
yBot += dydx;
yTop += dydx;
@@ -453,7 +454,7 @@ segment(GLcontext *ctx,
GLint ix;
/* scan across the line, left-to-right */
for (ix = ixLeft; ix < ixRight; ix++) {
- (*plot)(ctx, line, pb, ix, iy);
+ (*plot)(ctx, line, ix, iy);
}
xLeft += dxdy;
xRight += dxdy;
@@ -486,6 +487,7 @@ segment(GLcontext *ctx,
#define NAME(x) aa_multitex_rgba_##x
#define DO_Z
+#define DO_FOG
#define DO_RGBA
#define DO_MULTITEX
#include "s_aalinetemp.h"
@@ -493,6 +495,7 @@ segment(GLcontext *ctx,
#define NAME(x) aa_multitex_spec_##x
#define DO_Z
+#define DO_FOG
#define DO_RGBA
#define DO_MULTITEX
#define DO_SPEC
@@ -509,8 +512,8 @@ _swrast_choose_aa_line_function(GLcontext *ctx)
if (ctx->Visual.rgbMode) {
/* RGBA */
- if (ctx->Texture._ReallyEnabled) {
- if (ctx->Texture._ReallyEnabled > TEXTURE0_ANY) {
+ if (ctx->Texture._EnabledUnits != 0) {
+ if (ctx->Texture._EnabledUnits > 1) {
/* Multitextured! */
if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR ||
ctx->Fog.ColorSumEnabled)
diff --git a/xc/extras/Mesa/src/swrast/s_aalinetemp.h b/xc/extras/Mesa/src/swrast/s_aalinetemp.h
index bd675f365..4dc2691a1 100644
--- a/xc/extras/Mesa/src/swrast/s_aalinetemp.h
+++ b/xc/extras/Mesa/src/swrast/s_aalinetemp.h
@@ -1,10 +1,9 @@
-/* $Id: s_aalinetemp.h,v 1.1.1.1 2002/10/22 13:06:52 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -34,107 +33,81 @@
* Function to render each fragment in the AA line.
*/
static void
-NAME(plot)(GLcontext *ctx, const struct LineInfo *line,
- struct pixel_buffer *pb, int ix, int iy)
+NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy)
{
const GLfloat fx = (GLfloat) ix;
const GLfloat fy = (GLfloat) iy;
const GLfloat coverage = compute_coveragef(line, ix, iy);
- GLdepth z;
- GLfloat fog;
-#ifdef DO_RGBA
- GLchan red, green, blue, alpha;
-#else
- GLint index;
-#endif
- GLchan specRed, specGreen, specBlue;
- GLfloat tex[MAX_TEXTURE_UNITS][4], lambda[MAX_TEXTURE_UNITS];
+ const GLuint i = line->span.end;
if (coverage == 0.0)
return;
+ line->span.end++;
+ line->span.array->coverage[i] = coverage;
+ line->span.array->x[i] = ix;
+ line->span.array->y[i] = iy;
+
/*
* Compute Z, color, texture coords, fog for the fragment by
* solving the plane equations at (ix,iy).
*/
#ifdef DO_Z
- z = (GLdepth) solve_plane(fx, fy, line->zPlane);
-#else
- z = 0.0;
+ line->span.array->z[i] = (GLdepth) solve_plane(fx, fy, line->zPlane);
#endif
#ifdef DO_FOG
- fog = solve_plane(fx, fy, line->fPlane);
-#else
- fog = 0.0;
+ line->span.array->fog[i] = solve_plane(fx, fy, line->fPlane);
#endif
#ifdef DO_RGBA
- red = solve_plane_chan(fx, fy, line->rPlane);
- green = solve_plane_chan(fx, fy, line->gPlane);
- blue = solve_plane_chan(fx, fy, line->bPlane);
- alpha = solve_plane_chan(fx, fy, line->aPlane);
+ line->span.array->rgba[i][RCOMP] = solve_plane_chan(fx, fy, line->rPlane);
+ line->span.array->rgba[i][GCOMP] = solve_plane_chan(fx, fy, line->gPlane);
+ line->span.array->rgba[i][BCOMP] = solve_plane_chan(fx, fy, line->bPlane);
+ line->span.array->rgba[i][ACOMP] = solve_plane_chan(fx, fy, line->aPlane);
#endif
#ifdef DO_INDEX
- index = (GLint) solve_plane(fx, fy, line->iPlane);
+ line->span.array->index[i] = (GLint) solve_plane(fx, fy, line->iPlane);
#endif
#ifdef DO_SPEC
- specRed = solve_plane_chan(fx, fy, line->srPlane);
- specGreen = solve_plane_chan(fx, fy, line->sgPlane);
- specBlue = solve_plane_chan(fx, fy, line->sbPlane);
-#else
- (void) specRed;
- (void) specGreen;
- (void) specBlue;
+ line->span.array->spec[i][RCOMP] = solve_plane_chan(fx, fy, line->srPlane);
+ line->span.array->spec[i][GCOMP] = solve_plane_chan(fx, fy, line->sgPlane);
+ line->span.array->spec[i][BCOMP] = solve_plane_chan(fx, fy, line->sbPlane);
#endif
#ifdef DO_TEX
{
- GLfloat invQ = solve_plane_recip(fx, fy, line->vPlane[0]);
- tex[0][0] = solve_plane(fx, fy, line->sPlane[0]) * invQ;
- tex[0][1] = solve_plane(fx, fy, line->tPlane[0]) * invQ;
- tex[0][2] = solve_plane(fx, fy, line->uPlane[0]) * invQ;
- lambda[0] = compute_lambda(line->sPlane[0], line->tPlane[0], invQ,
- line->texWidth[0], line->texHeight[0]);
+ const GLfloat invQ = solve_plane_recip(fx, fy, line->vPlane[0]);
+ line->span.array->texcoords[0][i][0] = solve_plane(fx, fy, line->sPlane[0]) * invQ;
+ line->span.array->texcoords[0][i][1] = solve_plane(fx, fy, line->tPlane[0]) * invQ;
+ line->span.array->texcoords[0][i][2] = solve_plane(fx, fy, line->uPlane[0]) * invQ;
+ line->span.array->lambda[0][i] = compute_lambda(line->sPlane[0], line->tPlane[0], invQ,
+ line->texWidth[0], line->texHeight[0]);
}
#elif defined(DO_MULTITEX)
{
GLuint unit;
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
if (ctx->Texture.Unit[unit]._ReallyEnabled) {
- GLfloat invQ = solve_plane_recip(fx, fy, line->vPlane[unit]);
- tex[unit][0] = solve_plane(fx, fy, line->sPlane[unit]) * invQ;
- tex[unit][1] = solve_plane(fx, fy, line->tPlane[unit]) * invQ;
- tex[unit][2] = solve_plane(fx, fy, line->uPlane[unit]) * invQ;
- lambda[unit] = compute_lambda(line->sPlane[unit],
- line->tPlane[unit], invQ,
- line->texWidth[unit], line->texHeight[unit]);
+ const GLfloat invQ = solve_plane_recip(fx, fy, line->vPlane[unit]);
+ line->span.array->texcoords[unit][i][0] = solve_plane(fx, fy, line->sPlane[unit]) * invQ;
+ line->span.array->texcoords[unit][i][1] = solve_plane(fx, fy, line->tPlane[unit]) * invQ;
+ line->span.array->texcoords[unit][i][2] = solve_plane(fx, fy, line->uPlane[unit]) * invQ;
+ line->span.array->lambda[unit][i] = compute_lambda(line->sPlane[unit],
+ line->tPlane[unit], invQ,
+ line->texWidth[unit], line->texHeight[unit]);
}
}
}
-#else
- (void) tex[0][0];
- (void) lambda[0];
#endif
-
- PB_COVERAGE(pb, coverage);
-
-#if defined(DO_MULTITEX)
-#if defined(DO_SPEC)
- PB_WRITE_MULTITEX_SPEC_PIXEL(pb, ix, iy, z, fog, red, green, blue, alpha,
- specRed, specGreen, specBlue, tex);
-#else
- PB_WRITE_MULTITEX_PIXEL(pb, ix, iy, z, fog, red, green, blue, alpha, tex);
-#endif
-#elif defined(DO_TEX)
- PB_WRITE_TEX_PIXEL(pb, ix, iy, z, fog, red, green, blue, alpha,
- tex[0][0], tex[0][1], tex[0][2]);
+ if (line->span.end == MAX_WIDTH) {
+#if defined(DO_TEX) || defined(DO_MULTITEX)
+ _mesa_write_texture_span(ctx, &(line->span));
#elif defined(DO_RGBA)
- PB_WRITE_RGBA_PIXEL(pb, ix, iy, z, fog, red, green, blue, alpha);
-#elif defined(DO_INDEX)
- PB_WRITE_CI_PIXEL(pb, ix, iy, z, fog, index);
+ _mesa_write_rgba_span(ctx, &(line->span));
+#else
+ _mesa_write_index_span(ctx, &(line->span));
#endif
-
- pb->haveCoverage = GL_TRUE;
- PB_CHECK_FLUSH(ctx, pb);
+ line->span.end = 0; /* reset counter */
+ }
}
@@ -146,7 +119,6 @@ static void
NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- struct pixel_buffer *pb = SWRAST_CONTEXT(ctx)->PB;
GLfloat tStart, tEnd; /* segment start, end along line length */
GLboolean inSegment;
GLint iLen, i;
@@ -165,18 +137,23 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
if (line.len == 0.0 || IS_INF_OR_NAN(line.len))
return;
+ INIT_SPAN(line.span, GL_LINE, 0, 0, SPAN_XY | SPAN_COVERAGE);
+
line.xAdj = line.dx / line.len * line.halfWidth;
line.yAdj = line.dy / line.len * line.halfWidth;
#ifdef DO_Z
+ line.span.arrayMask |= SPAN_Z;
compute_plane(line.x0, line.y0, line.x1, line.y1,
v0->win[2], v1->win[2], line.zPlane);
#endif
#ifdef DO_FOG
+ line.span.arrayMask |= SPAN_FOG;
compute_plane(line.x0, line.y0, line.x1, line.y1,
v0->fog, v1->fog, line.fPlane);
#endif
#ifdef DO_RGBA
+ line.span.arrayMask |= SPAN_RGBA;
if (ctx->Light.ShadeModel == GL_SMOOTH) {
compute_plane(line.x0, line.y0, line.x1, line.y1,
v0->color[RCOMP], v1->color[RCOMP], line.rPlane);
@@ -195,6 +172,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
}
#endif
#ifdef DO_SPEC
+ line.span.arrayMask |= SPAN_SPEC;
if (ctx->Light.ShadeModel == GL_SMOOTH) {
compute_plane(line.x0, line.y0, line.x1, line.y1,
v0->specular[RCOMP], v1->specular[RCOMP], line.srPlane);
@@ -210,6 +188,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
}
#endif
#ifdef DO_INDEX
+ line.span.arrayMask |= SPAN_INDEX;
if (ctx->Light.ShadeModel == GL_SMOOTH) {
compute_plane(line.x0, line.y0, line.x1, line.y1,
(GLfloat) v0->index, (GLfloat) v1->index, line.iPlane);
@@ -232,6 +211,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
const GLfloat r1 = v1->texcoord[0][2] * invW0;
const GLfloat q0 = v0->texcoord[0][3] * invW0;
const GLfloat q1 = v1->texcoord[0][3] * invW0;
+ line.span.arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA);
compute_plane(line.x0, line.y0, line.x1, line.y1, s0, s1, line.sPlane[0]);
compute_plane(line.x0, line.y0, line.x1, line.y1, t0, t1, line.tPlane[0]);
compute_plane(line.x0, line.y0, line.x1, line.y1, r0, r1, line.uPlane[0]);
@@ -242,6 +222,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
#elif defined(DO_MULTITEX)
{
GLuint u;
+ line.span.arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA);
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
if (ctx->Texture.Unit[u]._ReallyEnabled) {
const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current;
@@ -291,7 +272,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
/* stipple bit is off */
if (inSegment && (tEnd > tStart)) {
/* draw the segment */
- segment(ctx, &line, NAME(plot), pb, tStart, tEnd);
+ segment(ctx, &line, NAME(plot), tStart, tEnd);
inSegment = GL_FALSE;
}
else {
@@ -303,13 +284,21 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
if (inSegment) {
/* draw the final segment of the line */
- segment(ctx, &line, NAME(plot), pb, tStart, 1.0F);
+ segment(ctx, &line, NAME(plot), tStart, 1.0F);
}
}
else {
/* non-stippled */
- segment(ctx, &line, NAME(plot), pb, 0.0, 1.0);
+ segment(ctx, &line, NAME(plot), 0.0, 1.0);
}
+
+#if defined(DO_TEX) || defined(DO_MULTITEX)
+ _mesa_write_texture_span(ctx, &(line.span));
+#elif defined(DO_RGBA)
+ _mesa_write_rgba_span(ctx, &(line.span));
+#else
+ _mesa_write_index_span(ctx, &(line.span));
+#endif
}
diff --git a/xc/extras/Mesa/src/swrast/s_aatriangle.c b/xc/extras/Mesa/src/swrast/s_aatriangle.c
index e58e93b7e..6a8c38ea3 100644
--- a/xc/extras/Mesa/src/swrast/s_aatriangle.c
+++ b/xc/extras/Mesa/src/swrast/s_aatriangle.c
@@ -1,10 +1,9 @@
-/* $Id: s_aatriangle.c,v 1.1.1.1 2002/10/22 13:06:45 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.1
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -30,7 +29,9 @@
*/
-#include "mem.h"
+#include "glheader.h"
+#include "macros.h"
+#include "imports.h"
#include "mmath.h"
#include "s_aatriangle.h"
#include "s_context.h"
@@ -40,6 +41,7 @@
/*
* Compute coefficients of a plane using the X,Y coords of the v0, v1, v2
* vertices and the given Z values.
+ * A point (x,y,z) lies on plane iff a*x+b*y+c*z+d = 0.
*/
static INLINE void
compute_plane(const GLfloat v0[], const GLfloat v1[], const GLfloat v2[],
@@ -53,9 +55,15 @@ compute_plane(const GLfloat v0[], const GLfloat v1[], const GLfloat v2[],
const GLfloat qy = v2[1] - v0[1];
const GLfloat qz = z2 - z0;
+ /* Crossproduct "(a,b,c):= dv1 x dv2" is orthogonal to plane. */
const GLfloat a = py * qz - pz * qy;
const GLfloat b = pz * qx - px * qz;
const GLfloat c = px * qy - py * qx;
+ /* Point on the plane = "r*(a,b,c) + w", with fixed "r" depending
+ on the distance of plane from origin and arbitrary "w" parallel
+ to the plane. */
+ /* The scalar product "(r*(a,b,c)+w)*(a,b,c)" is "r*(a^2+b^2+c^2)",
+ which is equal to "-d" below. */
const GLfloat d = -(a * v0[0] + b * v0[1] + c * z0);
plane[0] = a;
@@ -93,8 +101,8 @@ do { \
static INLINE GLfloat
solve_plane(GLfloat x, GLfloat y, const GLfloat plane[4])
{
- const GLfloat z = (plane[3] + plane[0] * x + plane[1] * y) / -plane[2];
- return z;
+ ASSERT(plane[2] != 0.0F);
+ return (plane[3] + plane[0] * x + plane[1] * y) / -plane[2];
}
@@ -116,7 +124,6 @@ solve_plane_recip(GLfloat x, GLfloat y, const GLfloat plane[4])
}
-
/*
* Solve plane and return clamped GLchan value.
*/
@@ -193,7 +200,7 @@ compute_coveragef(const GLfloat v0[3], const GLfloat v1[3],
#ifdef DEBUG
{
const GLfloat area = dx0 * dy1 - dx1 * dy0;
- assert(area >= 0.0);
+ ASSERT(area >= 0.0);
}
#endif
@@ -276,7 +283,7 @@ compute_coveragei(const GLfloat v0[3], const GLfloat v1[3],
#ifdef DEBUG
{
const GLfloat area = dx0 * dy1 - dx1 * dy0;
- assert(area >= 0.0);
+ ASSERT(area >= 0.0);
}
#endif
@@ -344,23 +351,36 @@ index_aa_tri(GLcontext *ctx,
/*
* Compute mipmap level of detail.
+ * XXX we should really include the R coordinate in this computation
+ * in order to do 3-D texture mipmapping.
*/
static INLINE GLfloat
compute_lambda(const GLfloat sPlane[4], const GLfloat tPlane[4],
- GLfloat invQ, GLfloat width, GLfloat height)
+ const GLfloat qPlane[4], GLfloat cx, GLfloat cy,
+ GLfloat invQ, GLfloat texWidth, GLfloat texHeight)
{
- GLfloat dudx = sPlane[0] / sPlane[2] * invQ * width;
- GLfloat dudy = sPlane[1] / sPlane[2] * invQ * width;
- GLfloat dvdx = tPlane[0] / tPlane[2] * invQ * height;
- GLfloat dvdy = tPlane[1] / tPlane[2] * invQ * height;
- GLfloat r1 = dudx * dudx + dudy * dudy;
- GLfloat r2 = dvdx * dvdx + dvdy * dvdy;
- GLfloat rho2 = r1 + r2;
- /* return log base 2 of rho */
- if (rho2 == 0.0F)
- return 0.0;
- else
- return (GLfloat) (log(rho2) * 1.442695 * 0.5); /* 1.442695 = 1/log(2) */
+ const GLfloat s = solve_plane(cx, cy, sPlane);
+ const GLfloat t = solve_plane(cx, cy, tPlane);
+ const GLfloat invQ_x1 = solve_plane_recip(cx+1.0F, cy, qPlane);
+ const GLfloat invQ_y1 = solve_plane_recip(cx, cy+1.0F, qPlane);
+ const GLfloat s_x1 = s - sPlane[0] / sPlane[2];
+ const GLfloat s_y1 = s - sPlane[1] / sPlane[2];
+ const GLfloat t_x1 = t - tPlane[0] / tPlane[2];
+ const GLfloat t_y1 = t - tPlane[1] / tPlane[2];
+ GLfloat dsdx = s_x1 * invQ_x1 - s * invQ;
+ GLfloat dsdy = s_y1 * invQ_y1 - s * invQ;
+ GLfloat dtdx = t_x1 * invQ_x1 - t * invQ;
+ GLfloat dtdy = t_y1 * invQ_y1 - t * invQ;
+ GLfloat maxU, maxV, rho, lambda;
+ dsdx = FABSF(dsdx);
+ dsdy = FABSF(dsdy);
+ dtdx = FABSF(dtdx);
+ dtdy = FABSF(dtdy);
+ maxU = MAX2(dsdx, dsdy) * texWidth;
+ maxV = MAX2(dtdx, dtdy) * texHeight;
+ rho = MAX2(maxU, maxV);
+ lambda = LOG2(rho);
+ return lambda;
}
@@ -430,9 +450,9 @@ _mesa_set_aa_triangle_function(GLcontext *ctx)
{
ASSERT(ctx->Polygon.SmoothFlag);
- if (ctx->Texture._ReallyEnabled) {
+ if (ctx->Texture._EnabledUnits != 0) {
if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
- if (ctx->Texture._ReallyEnabled > TEXTURE0_ANY) {
+ if (ctx->Texture._EnabledUnits > 1) {
SWRAST_CONTEXT(ctx)->Triangle = spec_multitex_aa_tri;
}
else {
@@ -440,7 +460,7 @@ _mesa_set_aa_triangle_function(GLcontext *ctx)
}
}
else {
- if (ctx->Texture._ReallyEnabled > TEXTURE0_ANY) {
+ if (ctx->Texture._EnabledUnits > 1) {
SWRAST_CONTEXT(ctx)->Triangle = multitex_aa_tri;
}
else {
diff --git a/xc/extras/Mesa/src/swrast/s_aatritemp.h b/xc/extras/Mesa/src/swrast/s_aatritemp.h
index 0b2e073de..abe99ecf4 100644
--- a/xc/extras/Mesa/src/swrast/s_aatritemp.h
+++ b/xc/extras/Mesa/src/swrast/s_aatritemp.h
@@ -1,10 +1,9 @@
-/* $Id: s_aatritemp.h,v 1.1.1.1 2002/10/22 13:06:51 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -52,64 +51,40 @@
GLfloat yMin, yMax;
GLboolean ltor;
GLfloat majDx, majDy; /* major (i.e. long) edge dx and dy */
-
+
+ struct sw_span span;
+
#ifdef DO_Z
GLfloat zPlane[4];
- GLdepth z[MAX_WIDTH];
#endif
#ifdef DO_FOG
GLfloat fogPlane[4];
- GLfloat fog[MAX_WIDTH];
#else
GLfloat *fog = NULL;
#endif
#ifdef DO_RGBA
GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4];
- DEFMARRAY(GLchan, rgba, MAX_WIDTH, 4); /* mac 32k limitation */
#endif
#ifdef DO_INDEX
GLfloat iPlane[4];
- GLuint index[MAX_WIDTH];
- GLint icoverageSpan[MAX_WIDTH];
-#else
- GLfloat coverageSpan[MAX_WIDTH];
#endif
#ifdef DO_SPEC
GLfloat srPlane[4], sgPlane[4], sbPlane[4];
- DEFMARRAY(GLchan, spec, MAX_WIDTH, 4);
#endif
#ifdef DO_TEX
GLfloat sPlane[4], tPlane[4], uPlane[4], vPlane[4];
GLfloat texWidth, texHeight;
- DEFARRAY(GLfloat, s, MAX_WIDTH); /* mac 32k limitation */
- DEFARRAY(GLfloat, t, MAX_WIDTH);
- DEFARRAY(GLfloat, u, MAX_WIDTH);
- DEFARRAY(GLfloat, lambda, MAX_WIDTH);
#elif defined(DO_MULTITEX)
- GLfloat sPlane[MAX_TEXTURE_UNITS][4];
- GLfloat tPlane[MAX_TEXTURE_UNITS][4];
- GLfloat uPlane[MAX_TEXTURE_UNITS][4];
- GLfloat vPlane[MAX_TEXTURE_UNITS][4];
+ GLfloat sPlane[MAX_TEXTURE_UNITS][4]; /* texture S */
+ GLfloat tPlane[MAX_TEXTURE_UNITS][4]; /* texture T */
+ GLfloat uPlane[MAX_TEXTURE_UNITS][4]; /* texture R */
+ GLfloat vPlane[MAX_TEXTURE_UNITS][4]; /* texture Q */
GLfloat texWidth[MAX_TEXTURE_UNITS], texHeight[MAX_TEXTURE_UNITS];
- DEFMARRAY(GLfloat, s, MAX_TEXTURE_UNITS, MAX_WIDTH); /* mac 32k limit */
- DEFMARRAY(GLfloat, t, MAX_TEXTURE_UNITS, MAX_WIDTH);
- DEFMARRAY(GLfloat, u, MAX_TEXTURE_UNITS, MAX_WIDTH);
- DEFMARRAY(GLfloat, lambda, MAX_TEXTURE_UNITS, MAX_WIDTH);
#endif
GLfloat bf = SWRAST_CONTEXT(ctx)->_backface_sign;
-
-#ifdef DO_RGBA
- CHECKARRAY(rgba, return); /* mac 32k limitation */
-#endif
-#ifdef DO_SPEC
- CHECKARRAY(spec, return);
-#endif
-#if defined(DO_TEX) || defined(DO_MULTITEX)
- CHECKARRAY(s, return);
- CHECKARRAY(t, return);
- CHECKARRAY(u, return);
- CHECKARRAY(lambda, return);
-#endif
+
+
+ INIT_SPAN(span, GL_POLYGON, 0, 0, SPAN_COVERAGE);
/* determine bottom to top order of vertices */
{
@@ -164,9 +139,11 @@
*/
#ifdef DO_Z
compute_plane(p0, p1, p2, p0[2], p1[2], p2[2], zPlane);
+ span.arrayMask |= SPAN_Z;
#endif
#ifdef DO_FOG
compute_plane(p0, p1, p2, v0->fog, v1->fog, v2->fog, fogPlane);
+ span.arrayMask |= SPAN_FOG;
#endif
#ifdef DO_RGBA
if (ctx->Light.ShadeModel == GL_SMOOTH) {
@@ -181,6 +158,7 @@
constant_plane(v2->color[BCOMP], bPlane);
constant_plane(v2->color[ACOMP], aPlane);
}
+ span.arrayMask |= SPAN_RGBA;
#endif
#ifdef DO_INDEX
if (ctx->Light.ShadeModel == GL_SMOOTH) {
@@ -190,6 +168,7 @@
else {
constant_plane((GLfloat) v2->index, iPlane);
}
+ span.arrayMask |= SPAN_INDEX;
#endif
#ifdef DO_SPEC
if (ctx->Light.ShadeModel == GL_SMOOTH) {
@@ -202,6 +181,7 @@
constant_plane(v2->specular[GCOMP], sgPlane);
constant_plane(v2->specular[BCOMP], sbPlane);
}
+ span.arrayMask |= SPAN_SPEC;
#endif
#ifdef DO_TEX
{
@@ -229,6 +209,7 @@
texWidth = (GLfloat) texImage->Width;
texHeight = (GLfloat) texImage->Height;
}
+ span.arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA);
#elif defined(DO_MULTITEX)
{
GLuint u;
@@ -260,6 +241,7 @@
}
}
}
+ span.arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA);
#endif
/* Begin bottom-to-top scan over the triangle.
@@ -284,8 +266,9 @@
GLint iy;
for (iy = iyMin; iy < iyMax; iy++, x += dxdy) {
GLint ix, startX = (GLint) (x - xAdj);
- GLuint count, n;
+ GLuint count;
GLfloat coverage = 0.0F;
+
/* skip over fragments with zero coverage */
while (startX < MAX_WIDTH) {
coverage = compute_coveragef(pMin, pMid, pMax, startX, iy);
@@ -300,39 +283,41 @@
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;
#ifdef DO_INDEX
- icoverageSpan[count] = compute_coveragei(pMin, pMid, pMax, ix, iy);
+ array->coverage[count] = (GLfloat) compute_coveragei(pMin, pMid, pMax, ix, iy);
#else
- coverageSpan[count] = coverage;
+ array->coverage[count] = coverage;
#endif
#ifdef DO_Z
- z[count] = (GLdepth) solve_plane(cx, cy, zPlane);
+ array->z[count] = (GLdepth) solve_plane(cx, cy, zPlane);
#endif
#ifdef DO_FOG
- fog[count] = solve_plane(cx, cy, fogPlane);
+ array->fog[count] = solve_plane(cx, cy, fogPlane);
#endif
#ifdef DO_RGBA
- rgba[count][RCOMP] = solve_plane_chan(cx, cy, rPlane);
- rgba[count][GCOMP] = solve_plane_chan(cx, cy, gPlane);
- rgba[count][BCOMP] = solve_plane_chan(cx, cy, bPlane);
- rgba[count][ACOMP] = solve_plane_chan(cx, cy, aPlane);
+ array->rgba[count][RCOMP] = solve_plane_chan(cx, cy, rPlane);
+ array->rgba[count][GCOMP] = solve_plane_chan(cx, cy, gPlane);
+ array->rgba[count][BCOMP] = solve_plane_chan(cx, cy, bPlane);
+ array->rgba[count][ACOMP] = solve_plane_chan(cx, cy, aPlane);
#endif
#ifdef DO_INDEX
- index[count] = (GLint) solve_plane(cx, cy, iPlane);
+ array->index[count] = (GLint) solve_plane(cx, cy, iPlane);
#endif
#ifdef DO_SPEC
- spec[count][RCOMP] = solve_plane_chan(cx, cy, srPlane);
- spec[count][GCOMP] = solve_plane_chan(cx, cy, sgPlane);
- spec[count][BCOMP] = solve_plane_chan(cx, cy, sbPlane);
+ array->spec[count][RCOMP] = solve_plane_chan(cx, cy, srPlane);
+ array->spec[count][GCOMP] = solve_plane_chan(cx, cy, sgPlane);
+ array->spec[count][BCOMP] = solve_plane_chan(cx, cy, sbPlane);
#endif
#ifdef DO_TEX
{
const GLfloat invQ = solve_plane_recip(cx, cy, vPlane);
- s[count] = solve_plane(cx, cy, sPlane) * invQ;
- t[count] = solve_plane(cx, cy, tPlane) * invQ;
- u[count] = solve_plane(cx, cy, uPlane) * invQ;
- lambda[count] = compute_lambda(sPlane, tPlane, invQ,
- texWidth, texHeight);
+ array->texcoords[0][count][0] = solve_plane(cx, cy, sPlane) * invQ;
+ array->texcoords[0][count][1] = solve_plane(cx, cy, tPlane) * invQ;
+ array->texcoords[0][count][2] = solve_plane(cx, cy, uPlane) * invQ;
+ array->lambda[0][count] = compute_lambda(sPlane, tPlane, vPlane,
+ cx, cy, invQ,
+ texWidth, texHeight);
}
#elif defined(DO_MULTITEX)
{
@@ -340,11 +325,12 @@
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
if (ctx->Texture.Unit[unit]._ReallyEnabled) {
GLfloat invQ = solve_plane_recip(cx, cy, vPlane[unit]);
- s[unit][count] = solve_plane(cx, cy, sPlane[unit]) * invQ;
- t[unit][count] = solve_plane(cx, cy, tPlane[unit]) * invQ;
- u[unit][count] = solve_plane(cx, cy, uPlane[unit]) * invQ;
- lambda[unit][count] = compute_lambda(sPlane[unit],
- tPlane[unit], invQ, texWidth[unit], texHeight[unit]);
+ array->texcoords[unit][count][0] = solve_plane(cx, cy, sPlane[unit]) * invQ;
+ array->texcoords[unit][count][1] = solve_plane(cx, cy, tPlane[unit]) * invQ;
+ array->texcoords[unit][count][2] = solve_plane(cx, cy, uPlane[unit]) * invQ;
+ array->lambda[unit][count] = compute_lambda(sPlane[unit],
+ tPlane[unit], vPlane[unit], cx, cy, invQ,
+ texWidth[unit], texHeight[unit]);
}
}
}
@@ -353,46 +339,20 @@
count++;
coverage = compute_coveragef(pMin, pMid, pMax, ix, iy);
}
-
+
if (ix <= startX)
continue;
-
- n = (GLuint) ix - (GLuint) startX;
-
-#ifdef DO_MULTITEX
-# ifdef DO_SPEC
- _mesa_write_multitexture_span(ctx, n, startX, iy, z, fog,
- (const GLfloat (*)[MAX_WIDTH]) s,
- (const GLfloat (*)[MAX_WIDTH]) t,
- (const GLfloat (*)[MAX_WIDTH]) u,
- (GLfloat (*)[MAX_WIDTH]) lambda,
- rgba, (const GLchan (*)[4]) spec,
- coverageSpan, GL_POLYGON);
-# else
- _mesa_write_multitexture_span(ctx, n, startX, iy, z, fog,
- (const GLfloat (*)[MAX_WIDTH]) s,
- (const GLfloat (*)[MAX_WIDTH]) t,
- (const GLfloat (*)[MAX_WIDTH]) u,
- lambda, rgba, NULL, coverageSpan,
- GL_POLYGON);
-# endif
-#elif defined(DO_TEX)
-# ifdef DO_SPEC
- _mesa_write_texture_span(ctx, n, startX, iy, z, fog,
- s, t, u, lambda, rgba,
- (const GLchan (*)[4]) spec,
- coverageSpan, GL_POLYGON);
-# else
- _mesa_write_texture_span(ctx, n, startX, iy, z, fog,
- s, t, u, lambda,
- rgba, NULL, coverageSpan, GL_POLYGON);
-# endif
+
+ span.x = startX;
+ span.y = iy;
+ span.end = (GLuint) ix - (GLuint) startX;
+ ASSERT(span.interpMask == 0);
+#if defined(DO_MULTITEX) || defined(DO_TEX)
+ _mesa_write_texture_span(ctx, &span);
#elif defined(DO_RGBA)
- _mesa_write_rgba_span(ctx, n, startX, iy, z, fog, rgba,
- coverageSpan, GL_POLYGON);
+ _mesa_write_rgba_span(ctx, &span);
#elif defined(DO_INDEX)
- _mesa_write_index_span(ctx, n, startX, iy, z, fog, index,
- icoverageSpan, GL_POLYGON);
+ _mesa_write_index_span(ctx, &span);
#endif
}
}
@@ -409,7 +369,7 @@
GLint ix, left, startX = (GLint) (x + xAdj);
GLuint count, n;
GLfloat coverage = 0.0F;
-
+
/* make sure we're not past the window edge */
if (startX >= ctx->DrawBuffer->_Xmax) {
startX = ctx->DrawBuffer->_Xmax - 1;
@@ -422,46 +382,47 @@
break;
startX--;
}
-
+
/* enter interior of triangle */
ix = startX;
count = 0;
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;
#ifdef DO_INDEX
- icoverageSpan[ix] = compute_coveragei(pMin, pMid, pMax, ix, iy);
+ array->coverage[ix] = (GLfloat) compute_coveragei(pMin, pMax, pMid, ix, iy);
#else
- coverageSpan[ix] = coverage;
+ array->coverage[ix] = coverage;
#endif
#ifdef DO_Z
- z[ix] = (GLdepth) solve_plane(cx, cy, zPlane);
+ array->z[ix] = (GLdepth) solve_plane(cx, cy, zPlane);
#endif
#ifdef DO_FOG
- fog[ix] = solve_plane(cx, cy, fogPlane);
+ array->fog[ix] = solve_plane(cx, cy, fogPlane);
#endif
#ifdef DO_RGBA
- rgba[ix][RCOMP] = solve_plane_chan(cx, cy, rPlane);
- rgba[ix][GCOMP] = solve_plane_chan(cx, cy, gPlane);
- rgba[ix][BCOMP] = solve_plane_chan(cx, cy, bPlane);
- rgba[ix][ACOMP] = solve_plane_chan(cx, cy, aPlane);
+ array->rgba[ix][RCOMP] = solve_plane_chan(cx, cy, rPlane);
+ array->rgba[ix][GCOMP] = solve_plane_chan(cx, cy, gPlane);
+ array->rgba[ix][BCOMP] = solve_plane_chan(cx, cy, bPlane);
+ array->rgba[ix][ACOMP] = solve_plane_chan(cx, cy, aPlane);
#endif
#ifdef DO_INDEX
- index[ix] = (GLint) solve_plane(cx, cy, iPlane);
+ array->index[ix] = (GLint) solve_plane(cx, cy, iPlane);
#endif
#ifdef DO_SPEC
- spec[ix][RCOMP] = solve_plane_chan(cx, cy, srPlane);
- spec[ix][GCOMP] = solve_plane_chan(cx, cy, sgPlane);
- spec[ix][BCOMP] = solve_plane_chan(cx, cy, sbPlane);
+ array->spec[ix][RCOMP] = solve_plane_chan(cx, cy, srPlane);
+ array->spec[ix][GCOMP] = solve_plane_chan(cx, cy, sgPlane);
+ array->spec[ix][BCOMP] = solve_plane_chan(cx, cy, sbPlane);
#endif
#ifdef DO_TEX
{
const GLfloat invQ = solve_plane_recip(cx, cy, vPlane);
- s[ix] = solve_plane(cx, cy, sPlane) * invQ;
- t[ix] = solve_plane(cx, cy, tPlane) * invQ;
- u[ix] = solve_plane(cx, cy, uPlane) * invQ;
- lambda[ix] = compute_lambda(sPlane, tPlane, invQ,
- texWidth, texHeight);
+ array->texcoords[0][ix][0] = solve_plane(cx, cy, sPlane) * invQ;
+ array->texcoords[0][ix][1] = solve_plane(cx, cy, tPlane) * invQ;
+ array->texcoords[0][ix][2] = solve_plane(cx, cy, uPlane) * invQ;
+ array->lambda[0][ix] = compute_lambda(sPlane, tPlane, vPlane,
+ cx, cy, invQ, texWidth, texHeight);
}
#elif defined(DO_MULTITEX)
{
@@ -469,11 +430,15 @@
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
if (ctx->Texture.Unit[unit]._ReallyEnabled) {
GLfloat invQ = solve_plane_recip(cx, cy, vPlane[unit]);
- s[unit][ix] = solve_plane(cx, cy, sPlane[unit]) * invQ;
- t[unit][ix] = solve_plane(cx, cy, tPlane[unit]) * invQ;
- u[unit][ix] = solve_plane(cx, cy, uPlane[unit]) * invQ;
- lambda[unit][ix] = compute_lambda(sPlane[unit],
- tPlane[unit], invQ, texWidth[unit], texHeight[unit]);
+ array->texcoords[unit][ix][0] = solve_plane(cx, cy, sPlane[unit]) * invQ;
+ array->texcoords[unit][ix][1] = solve_plane(cx, cy, tPlane[unit]) * invQ;
+ array->texcoords[unit][ix][2] = solve_plane(cx, cy, uPlane[unit]) * invQ;
+ array->lambda[unit][ix] = compute_lambda(sPlane[unit],
+ tPlane[unit],
+ vPlane[unit],
+ cx, cy, invQ,
+ texWidth[unit],
+ texHeight[unit]);
}
}
}
@@ -482,83 +447,76 @@
count++;
coverage = compute_coveragef(pMin, pMax, pMid, ix, iy);
}
-
+
if (startX <= ix)
continue;
n = (GLuint) startX - (GLuint) ix;
left = ix + 1;
+
+ /* shift all values to the left */
+ /* XXX this is temporary */
+ {
+ struct span_arrays *array = span.array;
+ GLint j;
+ for (j = 0; j < (GLint) n; j++) {
+#ifdef DO_RGBA
+ COPY_4V(array->rgba[j], array->rgba[j + left]);
+#endif
+#ifdef DO_SPEC
+ COPY_4V(array->spec[j], array->spec[j + left]);
+#endif
+#ifdef DO_INDEX
+ array->index[j] = array->index[j + left];
+#endif
+#ifdef DO_Z
+ array->z[j] = array->z[j + left];
+#endif
+#ifdef DO_FOG
+ array->fog[j] = array->fog[j + left];
+#endif
+#ifdef DO_TEX
+ COPY_4V(array->texcoords[0][j], array->texcoords[0][j + left]);
+#endif
+#if defined(DO_MULTITEX) || defined(DO_TEX)
+ array->lambda[0][j] = array->lambda[0][j + left];
+#endif
+ array->coverage[j] = array->coverage[j + left];
+ }
+ }
#ifdef DO_MULTITEX
+ /* shift texcoords */
{
+ struct span_arrays *array = span.array;
GLuint unit;
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
if (ctx->Texture.Unit[unit]._ReallyEnabled) {
GLint j;
for (j = 0; j < (GLint) n; j++) {
- s[unit][j] = s[unit][j + left];
- t[unit][j] = t[unit][j + left];
- u[unit][j] = u[unit][j + left];
- lambda[unit][j] = lambda[unit][j + left];
+ array->texcoords[unit][j][0] = array->texcoords[unit][j + left][0];
+ array->texcoords[unit][j][1] = array->texcoords[unit][j + left][1];
+ array->texcoords[unit][j][2] = array->texcoords[unit][j + left][2];
+ array->lambda[unit][j] = array->lambda[unit][j + left];
}
}
}
}
-# ifdef DO_SPEC
- _mesa_write_multitexture_span(ctx, n, left, iy, z + left, fog + left,
- (const GLfloat (*)[MAX_WIDTH]) s,
- (const GLfloat (*)[MAX_WIDTH]) t,
- (const GLfloat (*)[MAX_WIDTH]) u,
- lambda, rgba + left,
- (const GLchan (*)[4]) (spec + left),
- coverageSpan + left,
- GL_POLYGON);
-# else
- _mesa_write_multitexture_span(ctx, n, left, iy, z + left, fog + left,
- (const GLfloat (*)[MAX_WIDTH]) s,
- (const GLfloat (*)[MAX_WIDTH]) t,
- (const GLfloat (*)[MAX_WIDTH]) u,
- lambda,
- rgba + left, NULL, coverageSpan + left,
- GL_POLYGON);
-# endif
-#elif defined(DO_TEX)
-# ifdef DO_SPEC
- _mesa_write_texture_span(ctx, n, left, iy, z + left, fog + left,
- s + left, t + left, u + left,
- lambda + left, rgba + left,
- (const GLchan (*)[4]) (spec + left),
- coverageSpan + left,
- GL_POLYGON);
-# else
- _mesa_write_texture_span(ctx, n, left, iy, z + left, fog + left,
- s + left, t + left,
- u + left, lambda + left,
- rgba + left, NULL,
- coverageSpan + left, GL_POLYGON);
-# endif
+#endif
+
+ span.x = left;
+ span.y = iy;
+ span.end = n;
+ ASSERT(span.interpMask == 0);
+#if defined(DO_MULTITEX) || defined(DO_TEX)
+ _mesa_write_texture_span(ctx, &span);
#elif defined(DO_RGBA)
- _mesa_write_rgba_span(ctx, n, left, iy, z + left, fog + left,
- rgba + left, coverageSpan + left, GL_POLYGON);
+ _mesa_write_rgba_span(ctx, &span);
#elif defined(DO_INDEX)
- _mesa_write_index_span(ctx, n, left, iy, z + left, fog + left,
- index + left, icoverageSpan + left, GL_POLYGON);
+ _mesa_write_index_span(ctx, &span);
#endif
}
}
-
-#ifdef DO_RGBA
- UNDEFARRAY(rgba); /* mac 32k limitation */
-#endif
-#ifdef DO_SPEC
- UNDEFARRAY(spec);
-#endif
-#if defined(DO_TEX) || defined(DO_MULTITEX)
- UNDEFARRAY(s);
- UNDEFARRAY(t);
- UNDEFARRAY(u);
- UNDEFARRAY(lambda);
-#endif
}
diff --git a/xc/extras/Mesa/src/swrast/s_accum.c b/xc/extras/Mesa/src/swrast/s_accum.c
index b93f8379e..16eca43d5 100644
--- a/xc/extras/Mesa/src/swrast/s_accum.c
+++ b/xc/extras/Mesa/src/swrast/s_accum.c
@@ -1,8 +1,7 @@
-/* $Id: s_accum.c,v 1.1.1.1 2002/10/22 13:06:55 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.2
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -29,7 +28,7 @@
#include "context.h"
#include "macros.h"
#include "mmath.h"
-#include "mem.h"
+#include "imports.h"
#include "s_accum.h"
#include "s_alphabuf.h"
@@ -62,10 +61,11 @@
*/
-#if CHAN_BITS == 8
+#if CHAN_BITS == 8 && ACCUM_BITS < 32
#define USE_OPTIMIZED_ACCUM /* enable the optimization */
#endif
+
void
_mesa_alloc_accum_buffer( GLframebuffer *buffer )
{
@@ -194,7 +194,8 @@ _mesa_clear_accum_buffer( GLcontext *ctx )
ctx->Accum.ClearColor[2]==0.0 &&
ctx->Accum.ClearColor[3]==0.0) {
/* Black */
- BZERO( ctx->DrawBuffer->Accum, buffersize * 4 * sizeof(GLaccum) );
+ _mesa_bzero( ctx->DrawBuffer->Accum,
+ buffersize * 4 * sizeof(GLaccum) );
}
else {
/* Not black */
@@ -242,6 +243,7 @@ _swrast_Accum( GLcontext *ctx, GLenum op, GLfloat value,
GLchan rgba[MAX_WIDTH][4];
const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
+
if (SWRAST_CONTEXT(ctx)->NewState)
_swrast_validate_derived( ctx );
@@ -304,8 +306,7 @@ _swrast_Accum( GLcontext *ctx, GLenum op, GLfloat value,
if (value == 0.0F)
return;
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
- ctx->Pixel.DriverReadBuffer );
+ _swrast_use_read_buffer(ctx);
/* May have to leave optimized accum buffer mode */
if (swrast->_IntegerAccumScaler == 0.0 && value > 0.0 && value <= 1.0)
@@ -357,14 +358,13 @@ _swrast_Accum( GLcontext *ctx, GLenum op, GLfloat value,
}
}
/* restore read buffer = draw buffer (the default) */
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
- ctx->Color.DriverDrawBuffer );
+ _swrast_use_draw_buffer(ctx);
+
RENDER_FINISH(swrast,ctx);
break;
case GL_LOAD:
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
- ctx->Pixel.DriverReadBuffer );
+ _swrast_use_read_buffer(ctx);
/* This is a change to go into optimized accum buffer mode */
if (value > 0.0 && value <= 1.0) {
@@ -431,8 +431,8 @@ _swrast_Accum( GLcontext *ctx, GLenum op, GLfloat value,
}
/* restore read buffer = draw buffer (the default) */
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
- ctx->Color.DriverDrawBuffer );
+ _swrast_use_draw_buffer(ctx);
+
RENDER_FINISH(swrast,ctx);
break;
@@ -472,7 +472,7 @@ _swrast_Accum( GLcontext *ctx, GLenum op, GLfloat value,
rgba[i][ACOMP] = multTable[acc[i4+3]];
}
if (colorMask != 0xffffffff) {
- _mesa_mask_rgba_span( ctx, width, xpos, ypos, rgba );
+ _mesa_mask_rgba_array( ctx, width, xpos, ypos, rgba );
}
(*swrast->Driver.WriteRGBASpan)( ctx, width, xpos, ypos,
(const GLchan (*)[4])rgba, NULL );
@@ -507,7 +507,7 @@ _swrast_Accum( GLcontext *ctx, GLenum op, GLfloat value,
rgba[i][ACOMP] = CLAMP( a, 0, CHAN_MAX );
}
if (colorMask != 0xffffffff) {
- _mesa_mask_rgba_span( ctx, width, xpos, ypos, rgba );
+ _mesa_mask_rgba_array( ctx, width, xpos, ypos, rgba );
}
(*swrast->Driver.WriteRGBASpan)( ctx, width, xpos, ypos,
(const GLchan (*)[4])rgba, NULL );
diff --git a/xc/extras/Mesa/src/swrast/s_alpha.c b/xc/extras/Mesa/src/swrast/s_alpha.c
index 0d6353ec0..22ccff6dc 100644
--- a/xc/extras/Mesa/src/swrast/s_alpha.c
+++ b/xc/extras/Mesa/src/swrast/s_alpha.c
@@ -1,10 +1,9 @@
-/* $Id: s_alpha.c,v 1.1.1.1 2002/10/22 13:06:58 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,6 +23,10 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+/**
+ * \file swrast/s_alpha.c
+ * \brief Functions to apply alpha test.
+ */
#include "glheader.h"
#include "context.h"
@@ -32,67 +35,191 @@
#include "mmath.h"
#include "s_alpha.h"
+#include "s_context.h"
-
-
-
-/*
- * Apply the alpha test to a span of pixels.
- * In: rgba - array of pixels
- * In/Out: mask - current pixel mask. Pixels which fail the alpha test
- * will set the corresponding mask flag to 0.
- * Return: 0 = all pixels in the span failed the alpha test.
- * 1 = one or more pixels passed the alpha test.
+/**
+ * \fn GLint _mesa_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.
*/
GLint
-_mesa_alpha_test( const GLcontext *ctx,
- GLuint n, CONST GLchan rgba[][4], GLubyte mask[] )
+_mesa_alpha_test( const GLcontext *ctx, struct sw_span *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;
- GLchan ref = ctx->Color.AlphaRef;
- /* switch cases ordered from most frequent to less frequent */
- switch (ctx->Color.AlphaFunc) {
- case GL_LESS:
- for (i=0;i<n;i++) {
- mask[i] &= (rgba[i][ACOMP] < ref);
- }
- return 1;
- case GL_LEQUAL:
- for (i=0;i<n;i++)
- mask[i] &= (rgba[i][ACOMP] <= ref);
- return 1;
- case GL_GEQUAL:
- for (i=0;i<n;i++) {
- mask[i] &= (rgba[i][ACOMP] >= ref);
- }
- return 1;
- case GL_GREATER:
- for (i=0;i<n;i++) {
- mask[i] &= (rgba[i][ACOMP] > ref);
- }
- return 1;
- case GL_NOTEQUAL:
- for (i=0;i<n;i++) {
- mask[i] &= (rgba[i][ACOMP] != ref);
- }
- return 1;
- case GL_EQUAL:
- for (i=0;i<n;i++) {
- mask[i] &= (rgba[i][ACOMP] == ref);
- }
- return 1;
- case GL_ALWAYS:
- /* do nothing */
- return 1;
- case GL_NEVER:
- /* caller should check for zero! */
- return 0;
- default:
- _mesa_problem( ctx, "Invalid alpha test in gl_alpha_test" );
- return 0;
+ CLAMPED_FLOAT_TO_CHAN(ref, ctx->Color.AlphaRef);
+
+ 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 _mesa_alpha_test" );
+ return 0;
+ }
}
- /* Never get here */
- /*return 1;*/
+ else {
+ /* Use the interpolation values */
+#if CHAN_TYPE == GL_FLOAT
+ const GLfloat alphaStep = span->alphaStep;
+ GLfloat alpha = span->alpha;
+ 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;
+ }
+#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;
+ }
+#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;
}
diff --git a/xc/extras/Mesa/src/swrast/s_alpha.h b/xc/extras/Mesa/src/swrast/s_alpha.h
index 63e872c08..86a7d0654 100644
--- a/xc/extras/Mesa/src/swrast/s_alpha.h
+++ b/xc/extras/Mesa/src/swrast/s_alpha.h
@@ -1,10 +1,9 @@
-/* $Id: s_alpha.h,v 1.1.1.1 2002/10/22 13:06:58 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -34,9 +33,7 @@
extern GLint
-_mesa_alpha_test( const GLcontext *ctx, GLuint n,
- CONST GLchan rgba[][4], GLubyte mask[] );
-
+_mesa_alpha_test( const GLcontext *ctx, struct sw_span *span );
#endif
diff --git a/xc/extras/Mesa/src/swrast/s_alphabuf.c b/xc/extras/Mesa/src/swrast/s_alphabuf.c
index ee1c15933..e677fb7d6 100644
--- a/xc/extras/Mesa/src/swrast/s_alphabuf.c
+++ b/xc/extras/Mesa/src/swrast/s_alphabuf.c
@@ -1,8 +1,7 @@
-/* $Id: s_alphabuf.c,v 1.1.1.1 2002/10/22 13:06:44 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.2
+ * Version: 5.0.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -32,26 +31,20 @@
#include "glheader.h"
+#include "colormac.h"
#include "context.h"
-#include "mem.h"
+#include "imports.h"
+#include "s_context.h"
#include "s_alphabuf.h"
-#define ALPHA_DRAW_ADDR(X,Y) \
- (ctx->DrawBuffer->Alpha + (Y) * ctx->DrawBuffer->Width + (X))
-
-#define ALPHA_READ_ADDR(X,Y) \
- (ctx->ReadBuffer->Alpha + (Y) * ctx->ReadBuffer->Width + (X))
-
-
/*
* Allocate a new front and back alpha buffer.
*/
void
_mesa_alloc_alpha_buffers( GLframebuffer *buffer )
{
- GET_CURRENT_CONTEXT(ctx);
const GLint bytes = buffer->Width * buffer->Height * sizeof(GLchan);
ASSERT(buffer->UseSoftwareAlphaBuffers);
@@ -59,7 +52,7 @@ _mesa_alloc_alpha_buffers( GLframebuffer *buffer )
if (buffer->FrontLeftAlpha) {
MESA_PBUFFER_FREE( buffer->FrontLeftAlpha );
}
- buffer->FrontLeftAlpha = (GLchan *) MESA_PBUFFER_ALLOC( bytes );
+ buffer->FrontLeftAlpha = MESA_PBUFFER_ALLOC( bytes );
if (!buffer->FrontLeftAlpha) {
/* out of memory */
_mesa_error( NULL, GL_OUT_OF_MEMORY,
@@ -70,7 +63,7 @@ _mesa_alloc_alpha_buffers( GLframebuffer *buffer )
if (buffer->BackLeftAlpha) {
MESA_PBUFFER_FREE( buffer->BackLeftAlpha );
}
- buffer->BackLeftAlpha = (GLchan *) MESA_PBUFFER_ALLOC( bytes );
+ buffer->BackLeftAlpha = MESA_PBUFFER_ALLOC( bytes );
if (!buffer->BackLeftAlpha) {
/* out of memory */
_mesa_error( NULL, GL_OUT_OF_MEMORY,
@@ -82,7 +75,7 @@ _mesa_alloc_alpha_buffers( GLframebuffer *buffer )
if (buffer->FrontRightAlpha) {
MESA_PBUFFER_FREE( buffer->FrontRightAlpha );
}
- buffer->FrontRightAlpha = (GLchan *) MESA_PBUFFER_ALLOC( bytes );
+ buffer->FrontRightAlpha = MESA_PBUFFER_ALLOC( bytes );
if (!buffer->FrontRightAlpha) {
/* out of memory */
_mesa_error( NULL, GL_OUT_OF_MEMORY,
@@ -93,7 +86,7 @@ _mesa_alloc_alpha_buffers( GLframebuffer *buffer )
if (buffer->BackRightAlpha) {
MESA_PBUFFER_FREE( buffer->BackRightAlpha );
}
- buffer->BackRightAlpha = (GLchan *) MESA_PBUFFER_ALLOC( bytes );
+ buffer->BackRightAlpha = MESA_PBUFFER_ALLOC( bytes );
if (!buffer->BackRightAlpha) {
/* out of memory */
_mesa_error( NULL, GL_OUT_OF_MEMORY,
@@ -101,17 +94,6 @@ _mesa_alloc_alpha_buffers( GLframebuffer *buffer )
}
}
}
-
- if (ctx) {
- if (ctx->Color.DriverDrawBuffer == GL_FRONT_LEFT)
- buffer->Alpha = buffer->FrontLeftAlpha;
- else if (ctx->Color.DriverDrawBuffer == GL_BACK_LEFT)
- buffer->Alpha = buffer->BackLeftAlpha;
- else if (ctx->Color.DriverDrawBuffer == GL_FRONT_RIGHT)
- buffer->Alpha = buffer->FrontRightAlpha;
- else if (ctx->Color.DriverDrawBuffer == GL_BACK_RIGHT)
- buffer->Alpha = buffer->BackRightAlpha;
- }
}
@@ -121,27 +103,29 @@ _mesa_alloc_alpha_buffers( GLframebuffer *buffer )
void
_mesa_clear_alpha_buffers( GLcontext *ctx )
{
- const GLchan aclear = ctx->Color.ClearColor[3];
+ GLchan aclear;
GLuint bufferBit;
+ CLAMPED_FLOAT_TO_CHAN(aclear, ctx->Color.ClearColor[3]);
+
ASSERT(ctx->DrawBuffer->UseSoftwareAlphaBuffers);
ASSERT(ctx->Color.ColorMask[ACOMP]);
/* loop over four possible alpha buffers */
for (bufferBit = 1; bufferBit <= 8; bufferBit = bufferBit << 1) {
- if (bufferBit & ctx->Color.DrawDestMask) {
+ if (bufferBit & ctx->Color._DrawDestMask) {
GLchan *buffer;
if (bufferBit == FRONT_LEFT_BIT) {
- buffer = ctx->DrawBuffer->FrontLeftAlpha;
+ buffer = (GLchan *) ctx->DrawBuffer->FrontLeftAlpha;
}
else if (bufferBit == FRONT_RIGHT_BIT) {
- buffer = ctx->DrawBuffer->FrontRightAlpha;
+ buffer = (GLchan *) ctx->DrawBuffer->FrontRightAlpha;
}
else if (bufferBit == BACK_LEFT_BIT) {
- buffer = ctx->DrawBuffer->BackLeftAlpha;
+ buffer = (GLchan *) ctx->DrawBuffer->BackLeftAlpha;
}
else {
- buffer = ctx->DrawBuffer->BackRightAlpha;
+ buffer = (GLchan *) ctx->DrawBuffer->BackRightAlpha;
}
if (ctx->Scissor.Enabled) {
@@ -187,13 +171,41 @@ _mesa_clear_alpha_buffers( GLcontext *ctx )
+static INLINE
+GLchan *get_alpha_buffer( GLcontext *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+
+ switch (swrast->CurrentBuffer) {
+ case FRONT_LEFT_BIT:
+ return (GLchan *) ctx->DrawBuffer->FrontLeftAlpha;
+ break;
+ case BACK_LEFT_BIT:
+ return (GLchan *) ctx->DrawBuffer->BackLeftAlpha;
+ break;
+ case FRONT_RIGHT_BIT:
+ return (GLchan *) ctx->DrawBuffer->FrontRightAlpha;
+ break;
+ case BACK_RIGHT_BIT:
+ return (GLchan *) ctx->DrawBuffer->BackRightAlpha;
+ break;
+ default:
+ _mesa_problem(ctx, "Bad CurrentBuffer in get_alpha_buffer()");
+ return (GLchan *) ctx->DrawBuffer->FrontLeftAlpha;
+ }
+}
+
+
void
_mesa_write_alpha_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
CONST GLchan rgba[][4], const GLubyte mask[] )
{
- GLchan *aptr = ALPHA_DRAW_ADDR( x, y );
+ GLchan *buffer, *aptr;
GLuint i;
+ buffer = get_alpha_buffer(ctx);
+ aptr = buffer + y * ctx->DrawBuffer->Width + x;
+
if (mask) {
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -214,9 +226,12 @@ void
_mesa_write_mono_alpha_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
GLchan alpha, const GLubyte mask[] )
{
- GLchan *aptr = ALPHA_DRAW_ADDR( x, y );
+ GLchan *buffer, *aptr;
GLuint i;
+ buffer = get_alpha_buffer(ctx);
+ aptr = buffer + y * ctx->DrawBuffer->Width + x;
+
if (mask) {
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -238,19 +253,22 @@ _mesa_write_alpha_pixels( GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
CONST GLchan rgba[][4], const GLubyte mask[] )
{
+ GLchan *buffer;
GLuint i;
+ buffer = get_alpha_buffer(ctx);
+
if (mask) {
for (i=0;i<n;i++) {
if (mask[i]) {
- GLchan *aptr = ALPHA_DRAW_ADDR( x[i], y[i] );
+ GLchan *aptr = buffer + y[i] * ctx->DrawBuffer->Width + x[i];
*aptr = rgba[i][ACOMP];
}
}
}
else {
for (i=0;i<n;i++) {
- GLchan *aptr = ALPHA_DRAW_ADDR( x[i], y[i] );
+ GLchan *aptr = buffer + y[i] * ctx->DrawBuffer->Width + x[i];
*aptr = rgba[i][ACOMP];
}
}
@@ -262,19 +280,22 @@ _mesa_write_mono_alpha_pixels( GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
GLchan alpha, const GLubyte mask[] )
{
+ GLchan *buffer;
GLuint i;
+ buffer = get_alpha_buffer(ctx);
+
if (mask) {
for (i=0;i<n;i++) {
if (mask[i]) {
- GLchan *aptr = ALPHA_DRAW_ADDR( x[i], y[i] );
+ GLchan *aptr = buffer + y[i] * ctx->DrawBuffer->Width + x[i];
*aptr = alpha;
}
}
}
else {
for (i=0;i<n;i++) {
- GLchan *aptr = ALPHA_DRAW_ADDR( x[i], y[i] );
+ GLchan *aptr = buffer + y[i] * ctx->DrawBuffer->Width + x[i];
*aptr = alpha;
}
}
@@ -286,11 +307,14 @@ void
_mesa_read_alpha_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, GLchan rgba[][4] )
{
- GLchan *aptr = ALPHA_READ_ADDR( x, y );
+ const GLchan *buffer, *aptr;
GLuint i;
- for (i=0;i<n;i++) {
+
+ buffer = get_alpha_buffer(ctx);
+ aptr = buffer + y * ctx->DrawBuffer->Width + x;
+
+ for (i = 0; i < n; i++)
rgba[i][ACOMP] = *aptr++;
- }
}
@@ -299,10 +323,14 @@ _mesa_read_alpha_pixels( GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
GLchan rgba[][4], const GLubyte mask[] )
{
+ const GLchan *buffer;
GLuint i;
- for (i=0;i<n;i++) {
+
+ buffer = get_alpha_buffer(ctx);
+
+ for (i = 0; i < n; i++) {
if (mask[i]) {
- GLchan *aptr = ALPHA_READ_ADDR( x[i], y[i] );
+ const GLchan *aptr = buffer + y[i] * ctx->DrawBuffer->Width + x[i];
rgba[i][ACOMP] = *aptr;
}
}
diff --git a/xc/extras/Mesa/src/swrast/s_bitmap.c b/xc/extras/Mesa/src/swrast/s_bitmap.c
index 2cb088369..bc6c103a9 100644
--- a/xc/extras/Mesa/src/swrast/s_bitmap.c
+++ b/xc/extras/Mesa/src/swrast/s_bitmap.c
@@ -1,10 +1,9 @@
-/* $Id: s_bitmap.c,v 1.1.1.1 2002/10/22 13:06:54 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 5.0
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,15 +23,20 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+/**
+ * \file swrast/s_bitmap.c
+ * \brief glBitmap rendering.
+ * \author Brian Paul
+ */
#include "glheader.h"
#include "image.h"
#include "macros.h"
+#include "mmath.h"
#include "pixel.h"
#include "s_context.h"
-#include "s_fog.h"
-#include "s_pb.h"
+#include "s_span.h"
@@ -46,10 +50,9 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
const GLubyte *bitmap )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- struct pixel_buffer *PB = swrast->PB;
GLint row, col;
- GLdepth fragZ;
- GLfloat fog;
+ GLuint count = 0;
+ struct sw_span span;
ASSERT(ctx->RenderMode == GL_RENDER);
ASSERT(bitmap);
@@ -59,32 +62,146 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
if (SWRAST_CONTEXT(ctx)->NewState)
_swrast_validate_derived( ctx );
- /* Set bitmap drawing color */
+ INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_XY);
+
if (ctx->Visual.rgbMode) {
- GLint r, g, b, a;
- r = (GLint) (ctx->Current.RasterColor[0] * CHAN_MAXF);
- g = (GLint) (ctx->Current.RasterColor[1] * CHAN_MAXF);
- b = (GLint) (ctx->Current.RasterColor[2] * CHAN_MAXF);
- a = (GLint) (ctx->Current.RasterColor[3] * CHAN_MAXF);
- PB_SET_COLOR( PB, r, g, b, a );
+ 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 {
- PB_SET_INDEX( PB, ctx->Current.RasterIndex );
+ span.interpMask |= SPAN_INDEX;
+ span.index = ChanToFixed(ctx->Current.RasterIndex);
+ span.indexStep = 0;
+ }
+
+ if (ctx->Depth.Test)
+ _mesa_span_default_z(ctx, &span);
+ if (ctx->Fog.Enabled)
+ _mesa_span_default_fog(ctx, &span);
+ if (ctx->Texture._EnabledUnits)
+ _mesa_span_default_texcoords(ctx, &span);
+
+ for (row = 0; row < height; row++, span.y++) {
+ const GLubyte *src = (const GLubyte *) _mesa_image_address( unpack,
+ bitmap, width, height, GL_COLOR_INDEX, GL_BITMAP, 0, row, 0 );
+
+ if (unpack->LsbFirst) {
+ /* Lsb first */
+ GLubyte mask = 1U << (unpack->SkipPixels & 0x7);
+ for (col = 0; col < width; col++) {
+ if (*src & mask) {
+ span.array->x[count] = px + col;
+ span.array->y[count] = py + row;
+ count++;
+ }
+ if (mask == 128U) {
+ src++;
+ mask = 1U;
+ }
+ else {
+ mask = mask << 1;
+ }
+ }
+
+ /* get ready for next row */
+ if (mask != 1)
+ src++;
+ }
+ else {
+ /* Msb first */
+ GLubyte mask = 128U >> (unpack->SkipPixels & 0x7);
+ for (col = 0; col < width; col++) {
+ if (*src & mask) {
+ span.array->x[count] = px + col;
+ span.array->y[count] = py + row;
+ count++;
+ }
+ if (mask == 1U) {
+ src++;
+ mask = 128U;
+ }
+ else {
+ mask = mask >> 1;
+ }
+ }
+
+ /* get ready for next row */
+ if (mask != 128)
+ src++;
+ }
+
+ if (count + width >= MAX_WIDTH || row + 1 == height) {
+ /* flush the span */
+ span.end = count;
+ if (ctx->Visual.rgbMode)
+ _mesa_write_rgba_span(ctx, &span);
+ else
+ _mesa_write_index_span(ctx, &span);
+ span.end = 0;
+ count = 0;
+ }
}
- fragZ = (GLdepth) ( ctx->Current.RasterPos[2] * ctx->DepthMaxF);
+ RENDER_FINISH(swrast,ctx);
+}
+
+
+#if 0
+/*
+ * XXX this is another way to implement Bitmap. Use horizontal runs of
+ * fragments, initializing the mask array to indicate which fragmens to
+ * draw or skip.
+ */
+void
+_swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLint row, col;
+ struct sw_span span;
+
+ ASSERT(ctx->RenderMode == GL_RENDER);
+ ASSERT(bitmap);
+
+ RENDER_START(swrast,ctx);
- if (ctx->Fog.Enabled) {
- if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT)
- fog = _mesa_z_to_fogfactor(ctx, ctx->Current.FogCoord);
- else
- fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
+ if (SWRAST_CONTEXT(ctx)->NewState)
+ _swrast_validate_derived( ctx );
+
+ INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_MASK);
+
+ /*span.arrayMask |= SPAN_MASK;*/ /* we'll init span.mask[] */
+ 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 {
- fog = 0.0;
+ span.interpMask |= SPAN_INDEX;
+ span.index = ChanToFixed(ctx->Current.RasterIndex);
+ span.indexStep = 0;
}
- for (row=0; row<height; row++) {
+ if (ctx->Depth.Test)
+ _mesa_span_default_z(ctx, &span);
+ if (ctx->Fog.Enabled)
+ _mesa_span_default_fog(ctx, &span);
+ if (ctx->Texture._EnabledUnits)
+ _mesa_span_default_texcoords(ctx, &span);
+
+ for (row=0; row<height; row++, span.y++) {
const GLubyte *src = (const GLubyte *) _mesa_image_address( unpack,
bitmap, width, height, GL_COLOR_INDEX, GL_BITMAP, 0, row, 0 );
@@ -92,9 +209,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
/* Lsb first */
GLubyte mask = 1U << (unpack->SkipPixels & 0x7);
for (col=0; col<width; col++) {
- if (*src & mask) {
- PB_WRITE_PIXEL( PB, px+col, py+row, fragZ, fog );
- }
+ span.array->mask[col] = (*src & mask) ? GL_TRUE : GL_FALSE;
if (mask == 128U) {
src++;
mask = 1U;
@@ -104,7 +219,10 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
}
}
- PB_CHECK_FLUSH( ctx, PB );
+ if (ctx->Visual.rgbMode)
+ _mesa_write_rgba_span(ctx, &span);
+ else
+ _mesa_write_index_span(ctx, &span);
/* get ready for next row */
if (mask != 1)
@@ -114,9 +232,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
/* Msb first */
GLubyte mask = 128U >> (unpack->SkipPixels & 0x7);
for (col=0; col<width; col++) {
- if (*src & mask) {
- PB_WRITE_PIXEL( PB, px+col, py+row, fragZ, fog );
- }
+ span.array->mask[col] = (*src & mask) ? GL_TRUE : GL_FALSE;
if (mask == 1U) {
src++;
mask = 128U;
@@ -126,7 +242,10 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
}
}
- PB_CHECK_FLUSH( ctx, PB );
+ if (ctx->Visual.rgbMode)
+ _mesa_write_rgba_span(ctx, &span);
+ else
+ _mesa_write_index_span(ctx, &span);
/* get ready for next row */
if (mask != 128)
@@ -134,7 +253,6 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
}
}
- _mesa_flush_pb(ctx);
-
RENDER_FINISH(swrast,ctx);
}
+#endif
diff --git a/xc/extras/Mesa/src/swrast/s_blend.c b/xc/extras/Mesa/src/swrast/s_blend.c
index ad6764f16..acd454811 100644
--- a/xc/extras/Mesa/src/swrast/s_blend.c
+++ b/xc/extras/Mesa/src/swrast/s_blend.c
@@ -1,8 +1,7 @@
-/* $Id: s_blend.c,v 1.1.1.1 2002/10/22 13:06:41 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -25,14 +24,15 @@
*/
+
#include "glheader.h"
#include "context.h"
+#include "colormac.h"
#include "macros.h"
#include "s_alphabuf.h"
#include "s_blend.h"
#include "s_context.h"
-#include "s_pb.h"
#include "s_span.h"
@@ -60,10 +60,7 @@ blend_noop( GLcontext *ctx, GLuint n, const GLubyte mask[],
for (i = 0; i < n; i++) {
if (mask[i]) {
- rgba[i][RCOMP] = dest[i][RCOMP];
- rgba[i][GCOMP] = dest[i][GCOMP];
- rgba[i][BCOMP] = dest[i][BCOMP];
- rgba[i][ACOMP] = dest[i][ACOMP];
+ COPY_CHAN4( rgba[i], dest[i] );
}
}
}
@@ -102,7 +99,7 @@ blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[],
for (i=0;i<n;i++) {
if (mask[i]) {
- const GLint t = rgba[i][ACOMP]; /* t in [0, CHAN_MAX] */
+ const GLchan t = rgba[i][ACOMP]; /* t in [0, CHAN_MAX] */
if (t == 0) {
/* 0% alpha */
rgba[i][RCOMP] = dest[i][RCOMP];
@@ -132,27 +129,31 @@ blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[],
#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
- const GLint s = CHAN_MAX - t;
- const GLint r = DIV255(rgba[i][RCOMP] * t + dest[i][RCOMP] * s);
- const GLint g = DIV255(rgba[i][GCOMP] * t + dest[i][GCOMP] * s);
- const GLint b = DIV255(rgba[i][BCOMP] * t + dest[i][BCOMP] * s);
- const GLint a = DIV255(rgba[i][ACOMP] * t + dest[i][ACOMP] * s);
+#else
+ GLint temp;
+#define DIV255(X) (temp = (X), ((temp << 8) + temp + 256) >> 16)
+#endif
+ 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 GLfloat s = 1.0 - tt;
- const GLint r = (GLint) (rgba[i][RCOMP] * tt + dest[i][RCOMP] * s);
- const GLint g = (GLint) (rgba[i][GCOMP] * tt + dest[i][GCOMP] * s);
- const GLint b = (GLint) (rgba[i][BCOMP] * tt + dest[i][BCOMP] * s);
- const GLint a = (GLint) (rgba[i][ACOMP] * tt + dest[i][ACOMP] * s);
+ 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 s = 1.0 - tt;
- const GLfloat r = rgba[i][RCOMP] * tt + dest[i][RCOMP] * s;
- const GLfloat g = rgba[i][GCOMP] * tt + dest[i][GCOMP] * s;
- const GLfloat b = rgba[i][BCOMP] * tt + dest[i][BCOMP] * s;
- const GLfloat a = rgba[i][ACOMP] * tt + dest[i][ACOMP] * s;
+ 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);
@@ -186,20 +187,22 @@ blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[],
for (i=0;i<n;i++) {
if (mask[i]) {
#if CHAN_TYPE == GL_FLOAT
- GLfloat r = rgba[i][RCOMP] + dest[i][RCOMP];
- GLfloat g = rgba[i][GCOMP] + dest[i][GCOMP];
- GLfloat b = rgba[i][BCOMP] + dest[i][BCOMP];
- GLfloat a = rgba[i][ACOMP] + dest[i][ACOMP];
+ /* 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];
-#endif
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
}
}
}
@@ -222,7 +225,12 @@ blend_min( GLcontext *ctx, GLuint n, const GLubyte mask[],
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
}
}
}
@@ -245,7 +253,12 @@ blend_max( GLcontext *ctx, GLuint n, const GLubyte mask[],
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
}
}
}
@@ -269,11 +282,20 @@ blend_modulate( GLcontext *ctx, GLuint n, const GLubyte mask[],
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]) >> 8;
- GLint g = (rgba[i][GCOMP] * dest[i][GCOMP]) >> 8;
- GLint b = (rgba[i][BCOMP] * dest[i][BCOMP]) >> 8;
- GLint a = (rgba[i][ACOMP] * dest[i][ACOMP]) >> 8;
+ 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;
@@ -296,10 +318,10 @@ static void _BLENDAPI
blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
GLchan rgba[][4], CONST GLchan dest[][4] )
{
- GLfloat rscale = 1.0F / CHAN_MAXF;
- GLfloat gscale = 1.0F / CHAN_MAXF;
- GLfloat bscale = 1.0F / CHAN_MAXF;
- GLfloat ascale = 1.0F / CHAN_MAXF;
+ 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;
for (i=0;i<n;i++) {
@@ -313,19 +335,33 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
#endif
GLfloat sR, sG, sB, sA; /* Source scaling */
GLfloat dR, dG, dB, dA; /* Dest scaling */
- GLfloat r, g, b, a;
+ GLfloat r, g, b, a; /* result color */
- /* Source Color */
+ /* 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
- /* Frame buffer color */
+ /* 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
/* Source RGB factor */
switch (ctx->Color.BlendSrcRGB) {
@@ -349,7 +385,7 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
sR = sG = sB = (GLfloat) As * ascale;
break;
case GL_ONE_MINUS_SRC_ALPHA:
- sR = sG = sB = (GLfloat) 1.0F - (GLfloat) As * ascale;
+ sR = sG = sB = 1.0F - (GLfloat) As * ascale;
break;
case GL_DST_ALPHA:
sR = sG = sB = (GLfloat) Ad * ascale;
@@ -415,7 +451,7 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
sA = (GLfloat) As * ascale;
break;
case GL_ONE_MINUS_SRC_ALPHA:
- sA = (GLfloat) 1.0F - (GLfloat) As * ascale;
+ sA = 1.0F - (GLfloat) As * ascale;
break;
case GL_DST_ALPHA:
sA =(GLfloat) Ad * ascale;
@@ -472,7 +508,7 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
dR = dG = dB = (GLfloat) As * ascale;
break;
case GL_ONE_MINUS_SRC_ALPHA:
- dR = dG = dB = (GLfloat) 1.0F - (GLfloat) As * ascale;
+ dR = dG = dB = 1.0F - (GLfloat) As * ascale;
break;
case GL_DST_ALPHA:
dR = dG = dB = (GLfloat) Ad * ascale;
@@ -530,7 +566,7 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
dA = (GLfloat) As * ascale;
break;
case GL_ONE_MINUS_SRC_ALPHA:
- dA = (GLfloat) 1.0F - (GLfloat) As * ascale;
+ dA = 1.0F - (GLfloat) As * ascale;
break;
case GL_DST_ALPHA:
dA = (GLfloat) Ad * ascale;
@@ -560,7 +596,7 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
/* this should never happen */
dA = 0.0F;
_mesa_problem(ctx, "Bad blend dest A factor in do_blend");
- return;
+ return;
}
/* Due to round-off problems we have to clamp against zero. */
@@ -610,9 +646,9 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
}
/* final clamping */
- rgba[i][RCOMP] = CLAMP( r, 0.0F, CHAN_MAXF );
- rgba[i][GCOMP] = CLAMP( g, 0.0F, CHAN_MAXF );
- rgba[i][BCOMP] = CLAMP( b, 0.0F, CHAN_MAXF );
+ 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 );
#else
if (ctx->Color.BlendEquation==GL_FUNC_ADD_EXT) {
@@ -669,30 +705,54 @@ void _swrast_choose_blend_func( GLcontext *ctx )
SWRAST_CONTEXT(ctx)->BlendFunc = blend_general;
}
else if (eq==GL_FUNC_ADD_EXT && srcRGB==GL_SRC_ALPHA
- && dstRGB==GL_ONE_MINUS_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;
+ SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_transparency;
}
else
#endif
SWRAST_CONTEXT(ctx)->BlendFunc = blend_transparency;
}
else if (eq==GL_FUNC_ADD_EXT && srcRGB==GL_ONE && dstRGB==GL_ONE) {
- SWRAST_CONTEXT(ctx)->BlendFunc = blend_add;
+#if defined(USE_MMX_ASM)
+ if ( cpu_has_mmx ) {
+ SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_add;
+ }
+ else
+#endif
+ SWRAST_CONTEXT(ctx)->BlendFunc = blend_add;
}
else if (((eq==GL_FUNC_ADD_EXT || eq==GL_FUNC_REVERSE_SUBTRACT_EXT)
&& (srcRGB==GL_ZERO && dstRGB==GL_SRC_COLOR))
||
((eq==GL_FUNC_ADD_EXT || eq==GL_FUNC_SUBTRACT_EXT)
&& (srcRGB==GL_DST_COLOR && dstRGB==GL_ZERO))) {
- SWRAST_CONTEXT(ctx)->BlendFunc = blend_modulate;
+#if defined(USE_MMX_ASM)
+ if ( cpu_has_mmx ) {
+ SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_modulate;
+ }
+ else
+#endif
+ SWRAST_CONTEXT(ctx)->BlendFunc = blend_modulate;
}
else if (eq==GL_MIN_EXT) {
- SWRAST_CONTEXT(ctx)->BlendFunc = blend_min;
+#if defined(USE_MMX_ASM)
+ if ( cpu_has_mmx ) {
+ SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_min;
+ }
+ else
+#endif
+ SWRAST_CONTEXT(ctx)->BlendFunc = blend_min;
}
else if (eq==GL_MAX_EXT) {
- SWRAST_CONTEXT(ctx)->BlendFunc = blend_max;
+#if defined(USE_MMX_ASM)
+ if ( cpu_has_mmx ) {
+ SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_max;
+ }
+ else
+#endif
+ SWRAST_CONTEXT(ctx)->BlendFunc = blend_max;
}
else if (eq==GL_FUNC_ADD_EXT && srcRGB == GL_ZERO && dstRGB == GL_ONE) {
SWRAST_CONTEXT(ctx)->BlendFunc = blend_noop;
@@ -709,58 +769,38 @@ void _swrast_choose_blend_func( GLcontext *ctx )
/*
* Apply the blending operator to a span of pixels.
- * Input: n - number of pixels in span
- * x, y - location of leftmost pixel in span in window coords.
- * mask - boolean mask indicating which pixels to blend.
- * In/Out: rgba - pixel values
+ * We can handle horizontal runs of pixels (spans) or arrays of x/y
+ * pixel coordinates.
*/
void
-_mesa_blend_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- GLchan rgba[][4], const GLubyte mask[] )
+_mesa_blend_span( GLcontext *ctx, const struct sw_span *span,
+ GLchan rgba[][4] )
{
- GLchan dest[MAX_WIDTH][4];
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLchan framebuffer[MAX_WIDTH][4];
- /* Check if device driver can do the work */
- if (ctx->Color.BlendEquation==GL_LOGIC_OP &&
- !ctx->Color.ColorLogicOpEnabled) {
- return;
- }
+ ASSERT(span->end <= MAX_WIDTH);
+ ASSERT(span->arrayMask & SPAN_RGBA);
+ ASSERT(!ctx->Color.ColorLogicOpEnabled);
/* Read span of current frame buffer pixels */
- _mesa_read_rgba_span( ctx, ctx->DrawBuffer, n, x, y, dest );
-
- SWRAST_CONTEXT(ctx)->BlendFunc( ctx, n, mask, rgba,
- (const GLchan (*)[4]) dest );
-}
-
-
-
-/*
- * Apply the blending operator to an array of pixels.
- * Input: n - number of pixels in span
- * x, y - array of pixel locations
- * mask - boolean mask indicating which pixels to blend.
- * In/Out: rgba - pixel values
- */
-void
-_mesa_blend_pixels( GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLchan rgba[][4], const GLubyte mask[] )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLchan dest[PB_SIZE][4];
-
- /* Check if device driver can do the work */
- if (ctx->Color.BlendEquation==GL_LOGIC_OP &&
- !ctx->Color.ColorLogicOpEnabled) {
- return;
+ if (span->arrayMask & SPAN_XY) {
+ /* array of x/y pixel coords */
+ (*swrast->Driver.ReadRGBAPixels)( ctx, span->end,
+ span->array->x, span->array->y,
+ framebuffer, span->array->mask );
+ if (swrast->_RasterMask & ALPHABUF_BIT) {
+ _mesa_read_alpha_pixels( ctx, span->end,
+ span->array->x, span->array->y,
+ framebuffer, span->array->mask );
+ }
}
-
- /* Read pixels from current color buffer */
- (*swrast->Driver.ReadRGBAPixels)( ctx, n, x, y, dest, mask );
- if (swrast->_RasterMask & ALPHABUF_BIT) {
- _mesa_read_alpha_pixels( ctx, n, x, y, dest, mask );
+ else {
+ /* horizontal run of pixels */
+ _mesa_read_rgba_span( ctx, ctx->DrawBuffer, span->end,
+ span->x, span->y, framebuffer );
}
- swrast->BlendFunc( ctx, n, mask, rgba, (const GLchan (*)[4])dest );
+ SWRAST_CONTEXT(ctx)->BlendFunc( ctx, span->end, span->array->mask, rgba,
+ (const GLchan (*)[4]) framebuffer );
}
diff --git a/xc/extras/Mesa/src/swrast/s_blend.h b/xc/extras/Mesa/src/swrast/s_blend.h
index 1882b18e2..c9357748d 100644
--- a/xc/extras/Mesa/src/swrast/s_blend.h
+++ b/xc/extras/Mesa/src/swrast/s_blend.h
@@ -1,10 +1,9 @@
-/* $Id: s_blend.h,v 1.1.1.1 2002/10/22 13:06:41 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -35,16 +34,11 @@
extern void
-_mesa_blend_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- GLchan rgba[][4], const GLubyte mask[] );
+_mesa_blend_span( GLcontext *ctx, const struct sw_span *span,
+ GLchan rgba[][4] );
extern void
-_mesa_blend_pixels( GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLchan rgba[][4], const GLubyte mask[] );
-
-extern void
_swrast_choose_blend_func( GLcontext *ctx );
diff --git a/xc/extras/Mesa/src/swrast/s_buffers.c b/xc/extras/Mesa/src/swrast/s_buffers.c
index 59524ba09..18d11891c 100644
--- a/xc/extras/Mesa/src/swrast/s_buffers.c
+++ b/xc/extras/Mesa/src/swrast/s_buffers.c
@@ -1,10 +1,9 @@
-/* $Id: s_buffers.c,v 1.1.1.1 2002/10/22 13:06:40 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -26,8 +25,9 @@
#include "glheader.h"
+#include "colormac.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "s_accum.h"
#include "s_alphabuf.h"
@@ -53,21 +53,19 @@ clear_color_buffer_with_masking( GLcontext *ctx )
if (ctx->Visual.rgbMode) {
/* RGBA mode */
- const GLchan r = ctx->Color.ClearColor[0];
- const GLchan g = ctx->Color.ClearColor[1];
- const GLchan b = ctx->Color.ClearColor[2];
- const GLchan a = ctx->Color.ClearColor[3];
+ GLchan clearColor[4];
GLint i;
+ 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]);
for (i = 0; i < height; i++) {
GLchan rgba[MAX_WIDTH][4];
GLint j;
for (j = 0; j < width; j++) {
- rgba[j][RCOMP] = r;
- rgba[j][GCOMP] = g;
- rgba[j][BCOMP] = b;
- rgba[j][ACOMP] = a;
+ COPY_CHAN4(rgba[j], clearColor);
}
- _mesa_mask_rgba_span( ctx, width, x, y + i, rgba );
+ _mesa_mask_rgba_array( ctx, width, x, y + i, rgba );
(*swrast->Driver.WriteRGBASpan)( ctx, width, x, y + i,
(CONST GLchan (*)[4]) rgba, NULL );
}
@@ -82,7 +80,7 @@ clear_color_buffer_with_masking( GLcontext *ctx )
for (j=0;j<width;j++) {
span[j] = ctx->Color.ClearIndex;
}
- _mesa_mask_index_span( ctx, width, x, y + i, span );
+ _mesa_mask_index_array( ctx, width, x, y + i, span );
(*swrast->Driver.WriteCI32Span)( ctx, width, x, y + i, span, mask );
}
}
@@ -104,20 +102,19 @@ clear_color_buffer(GLcontext *ctx)
if (ctx->Visual.rgbMode) {
/* RGBA mode */
- const GLchan r = ctx->Color.ClearColor[0];
- const GLchan g = ctx->Color.ClearColor[1];
- const GLchan b = ctx->Color.ClearColor[2];
- const GLchan a = ctx->Color.ClearColor[3];
+ GLchan clearColor[4];
GLchan span[MAX_WIDTH][4];
GLint i;
+ 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]);
+
ASSERT(*((GLuint *) &ctx->Color.ColorMask) == 0xffffffff);
for (i = 0; i < width; i++) {
- span[i][RCOMP] = r;
- span[i][GCOMP] = g;
- span[i][BCOMP] = b;
- span[i][ACOMP] = a;
+ COPY_CHAN4(span[i], clearColor);
}
for (i = 0; i < height; i++) {
(*swrast->Driver.WriteRGBASpan)( ctx, width, x, y + i,
@@ -167,23 +164,8 @@ clear_color_buffers(GLcontext *ctx)
/* loop over four possible dest color buffers */
for (bufferBit = 1; bufferBit <= 8; bufferBit = bufferBit << 1) {
- if (bufferBit & ctx->Color.DrawDestMask) {
- if (bufferBit == FRONT_LEFT_BIT) {
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_LEFT);
- (void) (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, GL_FRONT_LEFT);
- }
- else if (bufferBit == FRONT_RIGHT_BIT) {
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_RIGHT);
- (void) (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, GL_FRONT_RIGHT);
- }
- else if (bufferBit == BACK_LEFT_BIT) {
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_LEFT);
- (void) (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, GL_BACK_LEFT);
- }
- else {
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_RIGHT);
- (void) (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, GL_BACK_RIGHT);
- }
+ if (bufferBit & ctx->Color._DrawDestMask) {
+ (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, bufferBit);
if (colorMask != 0xffffffff) {
clear_color_buffer_with_masking(ctx);
@@ -194,9 +176,8 @@ clear_color_buffers(GLcontext *ctx)
}
}
- /* restore default read/draw buffers */
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, ctx->Color.DriverDrawBuffer );
- (void) (*swrast->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer, ctx->Pixel.DriverReadBuffer );
+ /* restore default read/draw buffer */
+ _swrast_use_draw_buffer(ctx);
}
@@ -224,7 +205,7 @@ _swrast_Clear( GLcontext *ctx, GLbitfield mask,
/* do software clearing here */
if (mask) {
- if (mask & ctx->Color.DrawDestMask) clear_color_buffers(ctx);
+ if (mask & ctx->Color._DrawDestMask) clear_color_buffers(ctx);
if (mask & GL_DEPTH_BUFFER_BIT) _mesa_clear_depth_buffer(ctx);
if (mask & GL_ACCUM_BUFFER_BIT) _mesa_clear_accum_buffer(ctx);
if (mask & GL_STENCIL_BUFFER_BIT) _mesa_clear_stencil_buffer(ctx);
@@ -258,3 +239,66 @@ _swrast_alloc_buffers( GLframebuffer *buffer )
_mesa_alloc_alpha_buffers( buffer );
}
}
+
+
+/*
+ * Fallback for ctx->Driver.DrawBuffer()
+ */
+void
+_swrast_DrawBuffer( GLcontext *ctx, GLenum mode )
+{
+ _swrast_use_draw_buffer(ctx);
+}
+
+
+/*
+ * Setup things so that we read/write spans from the user-designated
+ * read buffer (set via glReadPixels). We usually just have to call
+ * this for glReadPixels, glCopyPixels, etc.
+ */
+void
+_swrast_use_read_buffer( GLcontext *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+
+ /* Do this so the software-emulated alpha plane span functions work! */
+ swrast->CurrentBuffer = ctx->Pixel._ReadSrcMask;
+ /* Tell the device driver where to read/write spans */
+ (*swrast->Driver.SetBuffer)( ctx, ctx->ReadBuffer, swrast->CurrentBuffer );
+}
+
+
+/*
+ * Setup things so that we read/write spans from the default draw buffer.
+ * This is the usual mode that Mesa's software rasterizer operates in.
+ */
+void
+_swrast_use_draw_buffer( GLcontext *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+
+ /* The user can specify rendering to zero, one, two, or four color
+ * buffers simultaneously with glDrawBuffer()!
+ * We don't expect the span/point/line/triangle functions to deal with
+ * that mess so we'll iterate over the multiple buffers as needed.
+ * But usually we only render to one color buffer at a time.
+ * We set ctx->Color._DriverDrawBuffer to that buffer and tell the
+ * device driver to use that buffer.
+ * Look in s_span.c's multi_write_rgba_span() function to see how
+ * we loop over multiple color buffers when needed.
+ */
+
+ if (ctx->Color._DrawDestMask & FRONT_LEFT_BIT)
+ swrast->CurrentBuffer = FRONT_LEFT_BIT;
+ else if (ctx->Color._DrawDestMask & BACK_LEFT_BIT)
+ swrast->CurrentBuffer = BACK_LEFT_BIT;
+ else if (ctx->Color._DrawDestMask & FRONT_RIGHT_BIT)
+ swrast->CurrentBuffer = FRONT_RIGHT_BIT;
+ else if (ctx->Color._DrawDestMask & BACK_RIGHT_BIT)
+ swrast->CurrentBuffer = BACK_RIGHT_BIT;
+ else
+ /* glDrawBuffer(GL_NONE) */
+ swrast->CurrentBuffer = FRONT_LEFT_BIT; /* we always have this buffer */
+
+ (*swrast->Driver.SetBuffer)( ctx, ctx->DrawBuffer, swrast->CurrentBuffer );
+}
diff --git a/xc/extras/Mesa/src/swrast/s_context.c b/xc/extras/Mesa/src/swrast/s_context.c
index 042797d08..16acc154a 100644
--- a/xc/extras/Mesa/src/swrast/s_context.c
+++ b/xc/extras/Mesa/src/swrast/s_context.c
@@ -1,8 +1,7 @@
-/* $Id: s_context.c,v 1.1.1.1 2002/10/22 13:06:44 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -24,25 +23,24 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#include "glheader.h"
+#include "context.h"
#include "mtypes.h"
-#include "mem.h"
+#include "imports.h"
-#include "s_pb.h"
-#include "s_points.h"
-#include "s_lines.h"
-#include "s_triangle.h"
+#include "swrast.h"
#include "s_blend.h"
#include "s_context.h"
+#include "s_lines.h"
+#include "s_points.h"
+#include "s_span.h"
+#include "s_triangle.h"
#include "s_texture.h"
-
-
-
/*
* Recompute the value of swrast->_RasterMask, etc. according to
* the current context.
@@ -56,13 +54,13 @@ _swrast_update_rasterflags( GLcontext *ctx )
if (ctx->Color.BlendEnabled) RasterMask |= BLEND_BIT;
if (ctx->Depth.Test) RasterMask |= DEPTH_BIT;
if (ctx->Fog.Enabled) RasterMask |= FOG_BIT;
- if (ctx->Scissor.Enabled) RasterMask |= SCISSOR_BIT;
+ if (ctx->Scissor.Enabled) RasterMask |= CLIP_BIT;
if (ctx->Stencil.Enabled) RasterMask |= STENCIL_BIT;
if (ctx->Visual.rgbMode) {
const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
if (colorMask != 0xffffffff) RasterMask |= MASKING_BIT;
if (ctx->Color.ColorLogicOpEnabled) RasterMask |= LOGIC_OP_BIT;
- if (ctx->Texture._ReallyEnabled) RasterMask |= TEXTURE_BIT;
+ if (ctx->Texture._EnabledUnits) RasterMask |= TEXTURE_BIT;
}
else {
if (ctx->Color.IndexMask != 0xffffffff) RasterMask |= MASKING_BIT;
@@ -78,7 +76,7 @@ _swrast_update_rasterflags( GLcontext *ctx )
|| ctx->Viewport.X + ctx->Viewport.Width > (GLint) ctx->DrawBuffer->Width
|| ctx->Viewport.Y < 0
|| ctx->Viewport.Y + ctx->Viewport.Height > (GLint) ctx->DrawBuffer->Height) {
- RasterMask |= WINCLIP_BIT;
+ RasterMask |= CLIP_BIT;
}
if (ctx->Depth.OcclusionTest)
@@ -89,8 +87,11 @@ _swrast_update_rasterflags( GLcontext *ctx )
* MULTI_DRAW_BIT flag. Also set it if we're drawing to no
* buffers or the RGBA or CI mask disables all writes.
*/
- if (ctx->Color.DrawBuffer == GL_FRONT_AND_BACK ||
- ctx->Color.DrawBuffer == GL_NONE) {
+ if (ctx->Color._DrawDestMask != FRONT_LEFT_BIT &&
+ ctx->Color._DrawDestMask != BACK_LEFT_BIT &&
+ ctx->Color._DrawDestMask != FRONT_RIGHT_BIT &&
+ ctx->Color._DrawDestMask != BACK_RIGHT_BIT) {
+ /* more than one color buffer designated for writing (or zero buffers) */
RasterMask |= MULTI_DRAW_BIT;
}
else if (ctx->Visual.rgbMode && *((GLuint *) ctx->Color.ColorMask) == 0) {
@@ -143,6 +144,26 @@ _swrast_update_hint( GLcontext *ctx )
swrast->AllowPixelFog));
}
+
+/*
+ * Update the swrast->_AnyTextureCombine flag.
+ */
+static void
+_swrast_update_texture_env( GLcontext *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint i;
+ swrast->_AnyTextureCombine = GL_FALSE;
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
+ if (ctx->Texture.Unit[i].EnvMode == GL_COMBINE_EXT ||
+ ctx->Texture.Unit[i].EnvMode == GL_COMBINE4_NV) {
+ swrast->_AnyTextureCombine = GL_TRUE;
+ return;
+ }
+ }
+}
+
+
#define _SWRAST_NEW_DERIVED (_SWRAST_NEW_RASTERMASK | \
_NEW_TEXTURE | \
_NEW_HINT | \
@@ -181,6 +202,8 @@ _swrast_update_hint( GLcontext *ctx )
#define _SWRAST_NEW_TEXTURE_SAMPLE_FUNC _NEW_TEXTURE
+#define _SWRAST_NEW_TEXTURE_ENV_MODE _NEW_TEXTURE
+
#define _SWRAST_NEW_BLEND_FUNC _NEW_COLOR
@@ -200,7 +223,7 @@ _swrast_validate_triangle( GLcontext *ctx,
swrast->choose_triangle( ctx );
if ((ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) &&
- !ctx->Texture._ReallyEnabled) {
+ ctx->Texture._EnabledUnits == 0) {
swrast->SpecTriangle = swrast->Triangle;
swrast->Triangle = _swrast_add_spec_terms_triangle;
}
@@ -217,7 +240,7 @@ _swrast_validate_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 )
swrast->choose_line( ctx );
if ((ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) &&
- !ctx->Texture._ReallyEnabled) {
+ ctx->Texture._EnabledUnits == 0) {
swrast->SpecLine = swrast->Line;
swrast->Line = _swrast_add_spec_terms_line;
}
@@ -235,7 +258,7 @@ _swrast_validate_point( GLcontext *ctx, const SWvertex *v0 )
swrast->choose_point( ctx );
if ((ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) &&
- !ctx->Texture._ReallyEnabled) {
+ ctx->Texture._EnabledUnits == 0) {
swrast->SpecPoint = swrast->Point;
swrast->Point = _swrast_add_spec_terms_point;
}
@@ -261,17 +284,15 @@ _swrast_validate_blend_func( GLcontext *ctx, GLuint n,
static void
_swrast_validate_texture_sample( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj,
- GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
- GLchan rgba[][4] )
+ GLuint n, GLfloat texcoords[][4],
+ const GLfloat lambda[], GLchan rgba[][4] )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
_swrast_validate_derived( ctx );
_swrast_choose_texture_sample_func( ctx, texUnit, tObj );
- swrast->TextureSample[texUnit]( ctx, texUnit, tObj, n, s, t, u,
+ swrast->TextureSample[texUnit]( ctx, texUnit, tObj, n, texcoords,
lambda, rgba );
}
@@ -315,7 +336,6 @@ _swrast_invalidate_state( GLcontext *ctx, GLuint new_state )
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
swrast->TextureSample[i] = _swrast_validate_texture_sample;
-
if (ctx->Visual.rgbMode) {
ASSERT(swrast->Driver.WriteRGBASpan);
ASSERT(swrast->Driver.WriteRGBSpan);
@@ -334,18 +354,15 @@ _swrast_invalidate_state( GLcontext *ctx, GLuint new_state )
ASSERT(swrast->Driver.ReadCI32Span);
ASSERT(swrast->Driver.ReadCI32Pixels);
}
-
}
-
void
_swrast_validate_derived( GLcontext *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- if (swrast->NewState)
- {
+ if (swrast->NewState) {
if (swrast->NewState & _SWRAST_NEW_RASTERMASK)
_swrast_update_rasterflags( ctx );
@@ -355,6 +372,9 @@ _swrast_validate_derived( GLcontext *ctx )
if (swrast->NewState & _NEW_HINT)
_swrast_update_hint( ctx );
+ if (swrast->NewState & _SWRAST_NEW_TEXTURE_ENV_MODE)
+ _swrast_update_texture_env( ctx );
+
swrast->NewState = 0;
swrast->StateChanges = 0;
swrast->InvalidateState = _swrast_invalidate_state;
@@ -371,7 +391,7 @@ _swrast_Quad( GLcontext *ctx,
const SWvertex *v2, const SWvertex *v3 )
{
if (SWRAST_DEBUG) {
- fprintf(stderr, "_swrast_Quad\n");
+ _mesa_debug(ctx, "_swrast_Quad\n");
_swrast_print_vertex( ctx, v0 );
_swrast_print_vertex( ctx, v1 );
_swrast_print_vertex( ctx, v2 );
@@ -386,7 +406,7 @@ _swrast_Triangle( GLcontext *ctx, const SWvertex *v0,
const SWvertex *v1, const SWvertex *v2 )
{
if (SWRAST_DEBUG) {
- fprintf(stderr, "_swrast_Triangle\n");
+ _mesa_debug(ctx, "_swrast_Triangle\n");
_swrast_print_vertex( ctx, v0 );
_swrast_print_vertex( ctx, v1 );
_swrast_print_vertex( ctx, v2 );
@@ -398,7 +418,7 @@ void
_swrast_Line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 )
{
if (SWRAST_DEBUG) {
- fprintf(stderr, "_swrast_Line\n");
+ _mesa_debug(ctx, "_swrast_Line\n");
_swrast_print_vertex( ctx, v0 );
_swrast_print_vertex( ctx, v1 );
}
@@ -409,7 +429,7 @@ void
_swrast_Point( GLcontext *ctx, const SWvertex *v0 )
{
if (SWRAST_DEBUG) {
- fprintf(stderr, "_swrast_Point\n");
+ _mesa_debug(ctx, "_swrast_Point\n");
_swrast_print_vertex( ctx, v0 );
}
SWRAST_CONTEXT(ctx)->Point( ctx, v0 );
@@ -419,7 +439,7 @@ void
_swrast_InvalidateState( GLcontext *ctx, GLuint new_state )
{
if (SWRAST_DEBUG) {
- fprintf(stderr, "_swrast_InvalidateState\n");
+ _mesa_debug(ctx, "_swrast_InvalidateState\n");
}
SWRAST_CONTEXT(ctx)->InvalidateState( ctx, new_state );
}
@@ -428,7 +448,7 @@ void
_swrast_ResetLineStipple( GLcontext *ctx )
{
if (SWRAST_DEBUG) {
- fprintf(stderr, "_swrast_ResetLineStipple\n");
+ _mesa_debug(ctx, "_swrast_ResetLineStipple\n");
}
SWRAST_CONTEXT(ctx)->StippleCounter = 0;
}
@@ -437,7 +457,7 @@ void
_swrast_allow_vertex_fog( GLcontext *ctx, GLboolean value )
{
if (SWRAST_DEBUG) {
- fprintf(stderr, "_swrast_allow_vertex_fog %d\n", value);
+ _mesa_debug(ctx, "_swrast_allow_vertex_fog %d\n", value);
}
SWRAST_CONTEXT(ctx)->InvalidateState( ctx, _NEW_HINT );
SWRAST_CONTEXT(ctx)->AllowVertexFog = value;
@@ -447,7 +467,7 @@ void
_swrast_allow_pixel_fog( GLcontext *ctx, GLboolean value )
{
if (SWRAST_DEBUG) {
- fprintf(stderr, "_swrast_allow_pixel_fog %d\n", value);
+ _mesa_debug(ctx, "_swrast_allow_pixel_fog %d\n", value);
}
SWRAST_CONTEXT(ctx)->InvalidateState( ctx, _NEW_HINT );
SWRAST_CONTEXT(ctx)->AllowPixelFog = value;
@@ -461,18 +481,12 @@ _swrast_CreateContext( GLcontext *ctx )
SWcontext *swrast = (SWcontext *)CALLOC(sizeof(SWcontext));
if (SWRAST_DEBUG) {
- fprintf(stderr, "_swrast_CreateContext\n");
+ _mesa_debug(ctx, "_swrast_CreateContext\n");
}
if (!swrast)
return GL_FALSE;
- swrast->PB = _mesa_alloc_pb();
- if (!swrast->PB) {
- FREE(swrast);
- return GL_FALSE;
- }
-
swrast->NewState = ~0;
swrast->choose_point = _swrast_choose_point;
@@ -492,15 +506,44 @@ _swrast_CreateContext( GLcontext *ctx )
swrast->AllowVertexFog = GL_TRUE;
swrast->AllowPixelFog = GL_TRUE;
+ if (ctx->Visual.doubleBufferMode)
+ swrast->CurrentBuffer = BACK_LEFT_BIT;
+ else
+ swrast->CurrentBuffer = FRONT_LEFT_BIT;
+
/* Optimized Accum buffer */
swrast->_IntegerAccumMode = GL_TRUE;
swrast->_IntegerAccumScaler = 0.0;
-
for (i = 0 ; i < MAX_TEXTURE_UNITS ; i++)
swrast->TextureSample[i] = _swrast_validate_texture_sample;
+ swrast->SpanArrays = MALLOC_STRUCT(span_arrays);
+ if (!swrast->SpanArrays) {
+ FREE(swrast);
+ return GL_FALSE;
+ }
+
+ /* init point span buffer */
+ swrast->PointSpan.primitive = GL_POINT;
+ swrast->PointSpan.start = 0;
+ swrast->PointSpan.end = 0;
+ swrast->PointSpan.facing = 0;
+ swrast->PointSpan.array = swrast->SpanArrays;
+
+ assert(ctx->Const.MaxTextureUnits > 0);
+ assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_UNITS);
+
+ swrast->TexelBuffer = (GLchan *) MALLOC(ctx->Const.MaxTextureUnits *
+ MAX_WIDTH * 4 * sizeof(GLchan));
+ if (!swrast->TexelBuffer) {
+ FREE(swrast->SpanArrays);
+ FREE(swrast);
+ return GL_FALSE;
+ }
+
ctx->swrast_context = swrast;
+
return GL_TRUE;
}
@@ -510,10 +553,11 @@ _swrast_DestroyContext( GLcontext *ctx )
SWcontext *swrast = SWRAST_CONTEXT(ctx);
if (SWRAST_DEBUG) {
- fprintf(stderr, "_swrast_DestroyContext\n");
+ _mesa_debug(ctx, "_swrast_DestroyContext\n");
}
- FREE( swrast->PB );
+ FREE( swrast->SpanArrays );
+ FREE( swrast->TexelBuffer );
FREE( swrast );
ctx->swrast_context = 0;
@@ -527,6 +571,56 @@ _swrast_GetDeviceDriverReference( GLcontext *ctx )
return &swrast->Driver;
}
+void
+_swrast_flush( GLcontext *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ /* flush any pending fragments from rendering points */
+ if (swrast->PointSpan.end > 0) {
+ if (ctx->Visual.rgbMode) {
+ if (ctx->Texture._EnabledUnits)
+ _mesa_write_texture_span(ctx, &(swrast->PointSpan));
+ else
+ _mesa_write_rgba_span(ctx, &(swrast->PointSpan));
+ }
+ else {
+ _mesa_write_index_span(ctx, &(swrast->PointSpan));
+ }
+ swrast->PointSpan.end = 0;
+ }
+}
+
+void
+_swrast_render_primitive( GLcontext *ctx, GLenum prim )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ if (swrast->Primitive == GL_POINTS && prim != GL_POINTS) {
+ _swrast_flush(ctx);
+ }
+ swrast->Primitive = prim;
+}
+
+
+void
+_swrast_render_start( GLcontext *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ if (swrast->Driver.SpanRenderStart)
+ swrast->Driver.SpanRenderStart( ctx );
+ swrast->PointSpan.end = 0;
+}
+
+void
+_swrast_render_finish( GLcontext *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ if (swrast->Driver.SpanRenderFinish)
+ swrast->Driver.SpanRenderFinish( ctx );
+
+ _swrast_flush(ctx);
+}
+
+
#define SWRAST_DEBUG_VERTICES 0
void
@@ -535,29 +629,31 @@ _swrast_print_vertex( GLcontext *ctx, const SWvertex *v )
GLuint i;
if (SWRAST_DEBUG_VERTICES) {
- fprintf(stderr, "win %f %f %f %f\n",
- v->win[0], v->win[1], v->win[2], v->win[3]);
+ _mesa_debug(ctx, "win %f %f %f %f\n",
+ v->win[0], v->win[1], v->win[2], v->win[3]);
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
if (ctx->Texture.Unit[i]._ReallyEnabled)
- fprintf(stderr, "texcoord[%d] %f %f %f %f\n", i,
- v->texcoord[i][0], v->texcoord[i][1],
- v->texcoord[i][2], v->texcoord[i][3]);
+ _mesa_debug(ctx, "texcoord[%d] %f %f %f %f\n", i,
+ v->texcoord[i][0], v->texcoord[i][1],
+ v->texcoord[i][2], v->texcoord[i][3]);
#if CHAN_TYPE == GL_FLOAT
- fprintf(stderr, "color %f %f %f %f\n",
- v->color[0], v->color[1], v->color[2], v->color[3]);
- fprintf(stderr, "spec %f %f %f %f\n",
- v->specular[0], v->specular[1], v->specular[2], v->specular[3]);
+ _mesa_debug(ctx, "color %f %f %f %f\n",
+ v->color[0], v->color[1], v->color[2], v->color[3]);
+ _mesa_debug(ctx, "spec %f %f %f %f\n",
+ v->specular[0], v->specular[1],
+ v->specular[2], v->specular[3]);
#else
- fprintf(stderr, "color %d %d %d %d\n",
- v->color[0], v->color[1], v->color[2], v->color[3]);
- fprintf(stderr, "spec %d %d %d %d\n",
- v->specular[0], v->specular[1], v->specular[2], v->specular[3]);
+ _mesa_debug(ctx, "color %d %d %d %d\n",
+ v->color[0], v->color[1], v->color[2], v->color[3]);
+ _mesa_debug(ctx, "spec %d %d %d %d\n",
+ v->specular[0], v->specular[1],
+ v->specular[2], v->specular[3]);
#endif
- fprintf(stderr, "fog %f\n", v->fog);
- fprintf(stderr, "index %d\n", v->index);
- fprintf(stderr, "pointsize %f\n", v->pointSize);
- fprintf(stderr, "\n");
+ _mesa_debug(ctx, "fog %f\n", v->fog);
+ _mesa_debug(ctx, "index %d\n", v->index);
+ _mesa_debug(ctx, "pointsize %f\n", v->pointSize);
+ _mesa_debug(ctx, "\n");
}
}
diff --git a/xc/extras/Mesa/src/swrast/s_context.h b/xc/extras/Mesa/src/swrast/s_context.h
index 79081b809..75b72f3a2 100644
--- a/xc/extras/Mesa/src/swrast/s_context.h
+++ b/xc/extras/Mesa/src/swrast/s_context.h
@@ -1,10 +1,9 @@
-/* $Id: s_context.h,v 1.1.1.1 2002/10/22 13:06:45 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,7 +23,13 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+/**
+ * \file swrast/s_context.h
+ * \brief fill in description
+ * \author Keith Whitwell <keith@tungstengraphics.com>
*/
#ifndef S_CONTEXT_H
@@ -38,10 +43,8 @@
*/
typedef void (*TextureSampleFunc)( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj,
- GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
- GLchan rgba[][4] );
+ GLuint n, GLfloat texcoords[][4],
+ const GLfloat lambda[], GLchan rgba[][4] );
@@ -66,25 +69,25 @@ typedef void (*swrast_tri_func)( GLcontext *ctx, const SWvertex *,
const SWvertex *, const SWvertex *);
-
-/*
- * Bitmasks to indicate which rasterization options are enabled (RasterMask)
+/** \defgroup Bitmasks
+ * Bitmasks to indicate which rasterization options are enabled
+ * (RasterMask)
*/
-#define ALPHATEST_BIT 0x001 /* Alpha-test pixels */
-#define BLEND_BIT 0x002 /* Blend pixels */
-#define DEPTH_BIT 0x004 /* Depth-test pixels */
-#define FOG_BIT 0x008 /* Fog pixels */
-#define LOGIC_OP_BIT 0x010 /* Apply logic op in software */
-#define SCISSOR_BIT 0x020 /* Scissor pixels */
-#define STENCIL_BIT 0x040 /* Stencil pixels */
-#define MASKING_BIT 0x080 /* Do glColorMask or glIndexMask */
-#define ALPHABUF_BIT 0x100 /* Using software alpha buffer */
-#define WINCLIP_BIT 0x200 /* Clip pixels/primitives to window */
-#define MULTI_DRAW_BIT 0x400 /* Write to more than one color- */
- /* buffer or no buffers. */
-#define OCCLUSION_BIT 0x800 /* GL_HP_occlusion_test enabled */
-#define TEXTURE_BIT 0x1000 /* Texturing really enabled */
-
+/*@{*/
+#define ALPHATEST_BIT 0x001 /**< Alpha-test pixels */
+#define BLEND_BIT 0x002 /**< Blend pixels */
+#define DEPTH_BIT 0x004 /**< Depth-test pixels */
+#define FOG_BIT 0x008 /**< Fog pixels */
+#define LOGIC_OP_BIT 0x010 /**< Apply logic op in software */
+#define CLIP_BIT 0x020 /**< Scissor or window clip pixels */
+#define STENCIL_BIT 0x040 /**< Stencil pixels */
+#define MASKING_BIT 0x080 /**< Do glColorMask or glIndexMask */
+#define ALPHABUF_BIT 0x100 /**< Using software alpha buffer */
+#define MULTI_DRAW_BIT 0x400 /**< Write to more than one color- */
+ /**< buffer or no buffers. */
+#define OCCLUSION_BIT 0x800 /**< GL_HP_occlusion_test enabled */
+#define TEXTURE_BIT 0x1000 /**< Texturing really enabled */
+/*@}*/
#define _SWRAST_NEW_RASTERMASK (_NEW_BUFFERS| \
_NEW_SCISSOR| \
@@ -97,43 +100,49 @@ typedef void (*swrast_tri_func)( GLcontext *ctx, const SWvertex *,
_NEW_DEPTH)
-
+/**
+ * \struct SWcontext
+ * \brief SWContext?
+ */
typedef struct
{
- /* Driver interface:
+ /** Driver interface:
*/
struct swrast_device_driver Driver;
- /* Configuration mechanisms to make software rasterizer match
+ /** Configuration mechanisms to make software rasterizer match
* characteristics of the hardware rasterizer (if present):
*/
GLboolean AllowVertexFog;
GLboolean AllowPixelFog;
- /* Derived values, invalidated on statechanges, updated from
+ /** Derived values, invalidated on statechanges, updated from
* _swrast_validate_derived():
*/
GLuint _RasterMask;
GLfloat _MinMagThresh[MAX_TEXTURE_UNITS];
GLfloat _backface_sign;
GLboolean _PreferPixelFog;
+ GLboolean _AnyTextureCombine;
/* Accum buffer temporaries.
*/
- GLboolean _IntegerAccumMode; /* Storing unscaled integers? */
- GLfloat _IntegerAccumScaler; /* Implicit scale factor */
+ GLboolean _IntegerAccumMode; /**< Storing unscaled integers? */
+ GLfloat _IntegerAccumScaler; /**< Implicit scale factor */
/* Working values:
*/
- struct pixel_buffer* PB;
- GLuint StippleCounter; /* Line stipple counter */
+ GLuint StippleCounter; /**< Line stipple counter */
GLuint NewState;
GLuint StateChanges;
+ GLenum Primitive; /* current primitive being drawn (ala glBegin) */
+ GLuint CurrentBuffer; /* exactly one of FRONT_LEFT_BIT, BACK_LEFT_BIT, etc*/
- /* Mechanism to allow driver (like X11) to register further
+ /** Mechanism to allow driver (like X11) to register further
* software rasterization routines.
*/
+ /*@{*/
void (*choose_point)( GLcontext * );
void (*choose_line)( GLcontext * );
void (*choose_triangle)( GLcontext * );
@@ -141,29 +150,50 @@ typedef struct
GLuint invalidate_point;
GLuint invalidate_line;
GLuint invalidate_triangle;
+ /*@}*/
-
- /* Function pointers for dispatch behind public entrypoints.
- */
+ /** Function pointers for dispatch behind public entrypoints. */
+ /*@{*/
void (*InvalidateState)( GLcontext *ctx, GLuint new_state );
swrast_point_func Point;
swrast_line_func Line;
swrast_tri_func Triangle;
+ /*@}*/
- /* Placeholders for when separate specular (or secondary color) is
+ /**
+ * Placeholders for when separate specular (or secondary color) is
* enabled but texturing is not.
*/
+ /*@{*/
swrast_point_func SpecPoint;
swrast_line_func SpecLine;
swrast_tri_func SpecTriangle;
+ /*@}*/
+ /**
+ * Typically, we'll allocate a sw_span structure as a local variable
+ * and set its 'array' pointer to point to this object. The reason is
+ * this object is big and causes problems when allocated on the stack
+ * on some systems.
+ */
+ struct span_arrays *SpanArrays;
- /* Internal hooks, kept uptodate by the same mechanism as above.
+ /**
+ * Used to buffer N GL_POINTS, instead of rendering one by one.
+ */
+ struct sw_span PointSpan;
+
+ /** Internal hooks, kept uptodate by the same mechanism as above.
*/
blend_func BlendFunc;
TextureSampleFunc TextureSample[MAX_TEXTURE_UNITS];
+ /** Buffer for saving the sampled texture colors.
+ * Needed for GL_ARB_texture_env_crossbar implementation.
+ */
+ GLchan *TexelBuffer;
+
} SWcontext;
diff --git a/xc/extras/Mesa/src/swrast/s_copypix.c b/xc/extras/Mesa/src/swrast/s_copypix.c
index 10c66ef89..eab359090 100644
--- a/xc/extras/Mesa/src/swrast/s_copypix.c
+++ b/xc/extras/Mesa/src/swrast/s_copypix.c
@@ -1,8 +1,7 @@
-/* $Id: s_copypix.c,v 1.1.1.1 2002/10/22 13:06:52 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 5.0
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -31,13 +30,12 @@
#include "convolve.h"
#include "feedback.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "pixel.h"
#include "s_context.h"
#include "s_depth.h"
-#include "s_fog.h"
#include "s_histogram.h"
#include "s_pixeltex.h"
#include "s_span.h"
@@ -67,6 +65,9 @@ regions_overlap(GLint srcx, GLint srcy,
else if (srcy < dsty) { /* this is OK */
return GL_FALSE;
}
+ else if (srcy > dsty + height) {
+ return GL_FALSE;
+ }
else {
return GL_TRUE;
}
@@ -98,32 +99,21 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
GLint width, GLint height, GLint destx, GLint desty)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLdepth zspan[MAX_WIDTH];
- GLfloat fogSpan[MAX_WIDTH];
GLboolean quick_draw;
GLint row;
GLboolean changeBuffer;
- GLchan *saveReadAlpha;
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
const GLuint transferOps = ctx->_ImageTransferState;
GLfloat *dest, *tmpImage, *convImage;
+ struct sw_span span;
- if (ctx->Depth.Test || ctx->Fog.Enabled) {
- /* fill in array of z values */
- GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMax);
- GLfloat fog;
- GLint i;
+ INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
- if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT)
- fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterFogCoord);
- else
- fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
+ if (ctx->Depth.Test)
+ _mesa_span_default_z(ctx, &span);
+ if (ctx->Fog.Enabled)
+ _mesa_span_default_fog(ctx, &span);
- for (i = 0; i < width; i++) {
- zspan[i] = z;
- fogSpan[i] = fog;
- }
- }
if (SWRAST_CONTEXT(ctx)->_RasterMask == 0
&& !zoom
@@ -136,7 +126,6 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
}
/* If read and draw buffer are different we must do buffer switching */
- saveReadAlpha = ctx->ReadBuffer->Alpha;
changeBuffer = ctx->Pixel.ReadBuffer != ctx->Color.DrawBuffer
|| ctx->DrawBuffer != ctx->ReadBuffer;
@@ -157,16 +146,8 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
dest = tmpImage;
if (changeBuffer) {
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
- ctx->Pixel.DriverReadBuffer );
- if (ctx->Pixel.DriverReadBuffer == GL_FRONT_LEFT)
- ctx->ReadBuffer->Alpha = ctx->ReadBuffer->FrontLeftAlpha;
- else if (ctx->Pixel.DriverReadBuffer == GL_BACK_LEFT)
- ctx->ReadBuffer->Alpha = ctx->ReadBuffer->BackLeftAlpha;
- else if (ctx->Pixel.DriverReadBuffer == GL_FRONT_RIGHT)
- ctx->ReadBuffer->Alpha = ctx->ReadBuffer->FrontRightAlpha;
- else
- ctx->ReadBuffer->Alpha = ctx->ReadBuffer->BackRightAlpha;
+ /* choose the read buffer */
+ _swrast_use_read_buffer(ctx);
}
/* read source image */
@@ -184,11 +165,9 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
}
}
- /* read from the draw buffer again (in case of blending) */
if (changeBuffer) {
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
- ctx->Color.DriverDrawBuffer );
- ctx->ReadBuffer->Alpha = saveReadAlpha;
+ /* restore default src/dst buffer */
+ _swrast_use_draw_buffer(ctx);
}
/* do image transfer ops up until convolution */
@@ -251,7 +230,6 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
for (row = 0; row < height; row++) {
const GLfloat *src = convImage + row * width * 4;
- GLchan rgba[MAX_WIDTH][4];
GLint i, dy;
/* clamp to [0,1] and convert float back to chan */
@@ -260,27 +238,15 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
GLint g = (GLint) (src[i * 4 + GCOMP] * CHAN_MAXF);
GLint b = (GLint) (src[i * 4 + BCOMP] * CHAN_MAXF);
GLint a = (GLint) (src[i * 4 + ACOMP] * CHAN_MAXF);
- rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX);
- rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX);
- rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX);
- rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX);
- }
-
- if (ctx->Texture._ReallyEnabled && ctx->Pixel.PixelTextureEnabled) {
- GLfloat s[MAX_WIDTH], t[MAX_WIDTH], r[MAX_WIDTH], q[MAX_WIDTH];
- GLchan primary_rgba[MAX_WIDTH][4];
- GLuint unit;
- /* XXX not sure how multitexture is supposed to work here */
-
- MEMCPY(primary_rgba, rgba, 4 * width * sizeof(GLchan));
-
- for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
- _mesa_pixeltexgen(ctx, width, (const GLchan (*)[4]) rgba,
- s, t, r, q);
- _swrast_texture_fragments(ctx, unit, width, s, t, r, NULL,
- (CONST GLchan (*)[4]) primary_rgba,
- rgba);
- }
+ span.array->rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX);
+ span.array->rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX);
+ span.array->rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX);
+ span.array->rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX);
+ }
+
+ if (ctx->Pixel.PixelTextureEnabled && ctx->Texture._EnabledUnits) {
+ span.end = width;
+ _swrast_pixel_texture(ctx, &span);
}
/* write row to framebuffer */
@@ -288,15 +254,21 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
dy = desty + row;
if (quick_draw && dy >= 0 && dy < (GLint) ctx->DrawBuffer->Height) {
(*swrast->Driver.WriteRGBASpan)( ctx, width, destx, dy,
- (const GLchan (*)[4])rgba, NULL );
+ (const GLchan (*)[4])span.array->rgba, NULL );
}
else if (zoom) {
- _mesa_write_zoomed_rgba_span( ctx, width, destx, dy, zspan, fogSpan,
- (const GLchan (*)[4])rgba, desty);
+ span.x = destx;
+ span.y = dy;
+ span.end = width;
+ _mesa_write_zoomed_rgba_span(ctx, &span,
+ (CONST GLchan (*)[4])span.array->rgba,
+ desty);
}
else {
- _mesa_write_rgba_span( ctx, width, destx, dy, zspan, fogSpan, rgba,
- NULL, GL_BITMAP );
+ span.x = destx;
+ span.y = dy;
+ span.end = width;
+ _mesa_write_rgba_span(ctx, &span);
}
}
@@ -312,18 +284,16 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
GLint width, GLint height, GLint destx, GLint desty)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLdepth zspan[MAX_WIDTH];
- GLfloat fogSpan[MAX_WIDTH];
- GLchan rgba[MAX_WIDTH][4];
GLchan *tmpImage,*p;
GLboolean quick_draw;
- GLint sy, dy, stepy;
- GLint i, j;
+ GLint sy, dy, stepy, j;
GLboolean changeBuffer;
- GLchan *saveReadAlpha;
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
GLint overlapping;
const GLuint transferOps = ctx->_ImageTransferState;
+ struct sw_span span;
+
+ 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);
@@ -347,21 +317,10 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
- if (ctx->Depth.Test || ctx->Fog.Enabled) {
- /* fill in array of z values */
- GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMax);
- GLfloat fog;
-
- if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT)
- fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterFogCoord);
- else
- fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
-
- for (i=0;i<width;i++) {
- zspan[i] = z;
- fogSpan[i] = fog;
- }
- }
+ if (ctx->Depth.Test)
+ _mesa_span_default_z(ctx, &span);
+ if (ctx->Fog.Enabled)
+ _mesa_span_default_fog(ctx, &span);
if (SWRAST_CONTEXT(ctx)->_RasterMask == 0
&& !zoom
@@ -374,13 +333,9 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
}
/* If read and draw buffer are different we must do buffer switching */
- saveReadAlpha = ctx->ReadBuffer->Alpha;
changeBuffer = ctx->Pixel.ReadBuffer != ctx->Color.DrawBuffer
|| ctx->DrawBuffer != ctx->ReadBuffer;
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
- ctx->Pixel.DriverReadBuffer );
-
if (overlapping) {
GLint ssy = sy;
tmpImage = (GLchan *) MALLOC(width * height * sizeof(GLchan) * 4);
@@ -388,25 +343,22 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
_mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" );
return;
}
+ /* setup source */
+ if (changeBuffer)
+ _swrast_use_read_buffer(ctx);
+ /* read the source image */
p = tmpImage;
- if (changeBuffer) {
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
- ctx->Pixel.DriverReadBuffer );
- if (ctx->Pixel.DriverReadBuffer == GL_FRONT_LEFT)
- ctx->ReadBuffer->Alpha = ctx->ReadBuffer->FrontLeftAlpha;
- else if (ctx->Pixel.DriverReadBuffer == GL_BACK_LEFT)
- ctx->ReadBuffer->Alpha = ctx->ReadBuffer->BackLeftAlpha;
- else if (ctx->Pixel.DriverReadBuffer == GL_FRONT_RIGHT)
- ctx->ReadBuffer->Alpha = ctx->ReadBuffer->FrontRightAlpha;
- else
- ctx->ReadBuffer->Alpha = ctx->ReadBuffer->BackRightAlpha;
- }
for (j = 0; j < height; j++, ssy += stepy) {
_mesa_read_rgba_span( ctx, ctx->ReadBuffer, width, srcx, ssy,
(GLchan (*)[4]) p );
p += width * 4;
}
p = tmpImage;
+ /* restore dest */
+ if (changeBuffer) {
+ _swrast_use_draw_buffer(ctx);
+ changeBuffer = GL_FALSE;
+ }
}
else {
tmpImage = NULL; /* silence compiler warnings */
@@ -417,35 +369,17 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
/* Get source pixels */
if (overlapping) {
/* get from buffered image */
- MEMCPY(rgba, p, width * sizeof(GLchan) * 4);
+ MEMCPY(span.array->rgba, p, width * sizeof(GLchan) * 4);
p += width * 4;
}
else {
/* get from framebuffer */
- if (changeBuffer) {
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
- ctx->Pixel.DriverReadBuffer );
- if (ctx->Pixel.DriverReadBuffer == GL_FRONT_LEFT) {
- ctx->ReadBuffer->Alpha = ctx->ReadBuffer->FrontLeftAlpha;
- }
- else if (ctx->Pixel.DriverReadBuffer == GL_BACK_LEFT) {
- ctx->ReadBuffer->Alpha = ctx->ReadBuffer->BackLeftAlpha;
- }
- else if (ctx->Pixel.DriverReadBuffer == GL_FRONT_RIGHT) {
- ctx->ReadBuffer->Alpha = ctx->ReadBuffer->FrontRightAlpha;
- }
- else {
- ctx->ReadBuffer->Alpha = ctx->ReadBuffer->BackRightAlpha;
- }
- }
- _mesa_read_rgba_span( ctx, ctx->ReadBuffer, width, srcx, sy, rgba );
- }
-
- if (changeBuffer) {
- /* read from the draw buffer again (in case of blending) */
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
- ctx->Color.DriverDrawBuffer );
- ctx->ReadBuffer->Alpha = saveReadAlpha;
+ if (changeBuffer)
+ _swrast_use_read_buffer(ctx);
+ _mesa_read_rgba_span( ctx, ctx->ReadBuffer, width, srcx, sy,
+ span.array->rgba );
+ if (changeBuffer)
+ _swrast_use_draw_buffer(ctx);
}
if (transferOps) {
@@ -456,10 +390,10 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
/* convert chan to float */
for (k = 0; k < width; k++) {
- rgbaFloat[k][RCOMP] = (GLfloat) rgba[k][RCOMP] * scale;
- rgbaFloat[k][GCOMP] = (GLfloat) rgba[k][GCOMP] * scale;
- rgbaFloat[k][BCOMP] = (GLfloat) rgba[k][BCOMP] * scale;
- rgbaFloat[k][ACOMP] = (GLfloat) rgba[k][ACOMP] * scale;
+ rgbaFloat[k][RCOMP] = (GLfloat) span.array->rgba[k][RCOMP] * scale;
+ rgbaFloat[k][GCOMP] = (GLfloat) span.array->rgba[k][GCOMP] * scale;
+ rgbaFloat[k][BCOMP] = (GLfloat) span.array->rgba[k][BCOMP] * scale;
+ rgbaFloat[k][ACOMP] = (GLfloat) span.array->rgba[k][ACOMP] * scale;
}
/* scale & bias */
if (transferOps & IMAGE_SCALE_BIAS_BIT) {
@@ -479,7 +413,8 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
}
/* convolution */
if (transferOps & IMAGE_CONVOLUTION_BIT) {
- /* XXX to do */
+ _mesa_problem(ctx, "Convolution should not be enabled in copy_rgba_pixels()");
+ return;
}
/* GL_POST_CONVOLUTION_RED/GREEN/BLUE/ALPHA_SCALE/BIAS */
if (transferOps & IMAGE_POST_CONVOLUTION_SCALE_BIAS) {
@@ -519,61 +454,39 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
GLint g = (GLint) (rgbaFloat[k][GCOMP] * CHAN_MAXF);
GLint b = (GLint) (rgbaFloat[k][BCOMP] * CHAN_MAXF);
GLint a = (GLint) (rgbaFloat[k][ACOMP] * CHAN_MAXF);
- rgba[k][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX);
- rgba[k][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX);
- rgba[k][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX);
- rgba[k][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX);
+ span.array->rgba[k][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX);
+ span.array->rgba[k][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX);
+ span.array->rgba[k][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX);
+ span.array->rgba[k][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX);
}
UNDEFARRAY(rgbaFloat); /* mac 32k limitation */
}
- if (ctx->Texture._ReallyEnabled && ctx->Pixel.PixelTextureEnabled) {
- GLuint unit;
- GLchan primary_rgba[MAX_WIDTH][4];
- DEFARRAY(GLfloat, s, MAX_WIDTH); /* mac 32k limitation */
- DEFARRAY(GLfloat, t, MAX_WIDTH); /* mac 32k limitation */
- DEFARRAY(GLfloat, r, MAX_WIDTH); /* mac 32k limitation */
- DEFARRAY(GLfloat, q, MAX_WIDTH); /* mac 32k limitation */
- CHECKARRAY(s, return); /* mac 32k limitation */
- CHECKARRAY(t, return);
- CHECKARRAY(r, return);
- CHECKARRAY(q, return);
-
- /* XXX not sure how multitexture is supposed to work here */
- MEMCPY(primary_rgba, rgba, 4 * width * sizeof(GLchan));
-
- for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
- _mesa_pixeltexgen(ctx, width, (const GLchan (*)[4]) rgba,
- s, t, r, q);
- _swrast_texture_fragments(ctx, unit, width, s, t, r, NULL,
- (CONST GLchan (*)[4]) primary_rgba,
- rgba);
- }
-
- UNDEFARRAY(s); /* mac 32k limitation */
- UNDEFARRAY(t);
- UNDEFARRAY(r);
- UNDEFARRAY(q);
+ if (ctx->Pixel.PixelTextureEnabled && ctx->Texture._EnabledUnits) {
+ span.end = width;
+ _swrast_pixel_texture(ctx, &span);
}
if (quick_draw && dy >= 0 && dy < (GLint) ctx->DrawBuffer->Height) {
(*swrast->Driver.WriteRGBASpan)( ctx, width, destx, dy,
- (const GLchan (*)[4])rgba, NULL );
+ (const GLchan (*)[4])span.array->rgba, NULL );
}
else if (zoom) {
- _mesa_write_zoomed_rgba_span( ctx, width, destx, dy, zspan, fogSpan,
- (const GLchan (*)[4])rgba, desty);
+ span.x = destx;
+ span.y = dy;
+ span.end = width;
+ _mesa_write_zoomed_rgba_span(ctx, &span,
+ (CONST GLchan (*)[4]) span.array->rgba,
+ desty);
}
else {
- _mesa_write_rgba_span( ctx, width, destx, dy, zspan, fogSpan, rgba,
- NULL, GL_BITMAP );
+ span.x = destx;
+ span.y = dy;
+ span.end = width;
+ _mesa_write_rgba_span(ctx, &span);
}
}
- /* Restore pixel source to be the draw buffer (for blending, etc) */
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
- ctx->Color.DriverDrawBuffer );
-
if (overlapping)
FREE(tmpImage);
}
@@ -583,16 +496,16 @@ static void copy_ci_pixels( GLcontext *ctx,
GLint srcx, GLint srcy, GLint width, GLint height,
GLint destx, GLint desty )
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLdepth zspan[MAX_WIDTH];
- GLfloat fogSpan[MAX_WIDTH];
GLuint *tmpImage,*p;
GLint sy, dy, stepy;
- GLint i, j;
+ GLint j;
GLboolean changeBuffer;
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;
+
+ INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_INDEX);
/* Determine if copy should be bottom-to-top or top-to-bottom */
if (srcy<desty) {
@@ -611,29 +524,15 @@ static void copy_ci_pixels( GLcontext *ctx,
overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
- if (ctx->Depth.Test || ctx->Fog.Enabled) {
- /* fill in array of z values */
- GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMax);
- GLfloat fog;
-
- if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT)
- fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterFogCoord);
- else
- fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
-
- for (i=0;i<width;i++) {
- zspan[i] = z;
- fogSpan[i] = fog;
- }
- }
+ if (ctx->Depth.Test)
+ _mesa_span_default_z(ctx, &span);
+ if (ctx->Fog.Enabled)
+ _mesa_span_default_fog(ctx, &span);
/* If read and draw buffer are different we must do buffer switching */
changeBuffer = ctx->Pixel.ReadBuffer != ctx->Color.DrawBuffer
|| ctx->DrawBuffer != ctx->ReadBuffer;
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
- ctx->Pixel.DriverReadBuffer );
-
if (overlapping) {
GLint ssy = sy;
tmpImage = (GLuint *) MALLOC(width * height * sizeof(GLuint));
@@ -641,16 +540,21 @@ static void copy_ci_pixels( GLcontext *ctx,
_mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" );
return;
}
+ /* setup source */
+ if (changeBuffer)
+ _swrast_use_read_buffer(ctx);
+ /* read the image */
p = tmpImage;
- if (changeBuffer) {
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
- ctx->Pixel.DriverReadBuffer );
- }
for (j = 0; j < height; j++, ssy += stepy) {
_mesa_read_index_span( ctx, ctx->ReadBuffer, width, srcx, ssy, p );
p += width;
}
p = tmpImage;
+ /* restore to draw buffer */
+ if (changeBuffer) {
+ _swrast_use_draw_buffer(ctx);
+ changeBuffer = GL_FALSE;
+ }
}
else {
tmpImage = NULL; /* silence compiler warning */
@@ -658,46 +562,35 @@ static void copy_ci_pixels( GLcontext *ctx,
}
for (j = 0; j < height; j++, sy += stepy, dy += stepy) {
- GLuint indexes[MAX_WIDTH];
if (overlapping) {
- MEMCPY(indexes, p, width * sizeof(GLuint));
+ MEMCPY(span.array->index, p, width * sizeof(GLuint));
p += width;
}
else {
- if (changeBuffer) {
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
- ctx->Pixel.DriverReadBuffer );
- }
- _mesa_read_index_span( ctx, ctx->ReadBuffer, width, srcx, sy, indexes );
- }
-
- if (changeBuffer) {
- /* set read buffer back to draw buffer (in case of logicops) */
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
- ctx->Color.DriverDrawBuffer );
+ if (changeBuffer)
+ _swrast_use_read_buffer(ctx);
+ _mesa_read_index_span( ctx, ctx->ReadBuffer, width, srcx, sy,
+ span.array->index );
+ if (changeBuffer)
+ _swrast_use_draw_buffer(ctx);
}
if (shift_or_offset) {
- _mesa_shift_and_offset_ci( ctx, width, indexes );
+ _mesa_shift_and_offset_ci( ctx, width, span.array->index );
}
if (ctx->Pixel.MapColorFlag) {
- _mesa_map_ci( ctx, width, indexes );
+ _mesa_map_ci( ctx, width, span.array->index );
}
- if (zoom) {
- _mesa_write_zoomed_index_span(ctx, width, destx, dy, zspan, fogSpan,
- indexes, desty );
- }
- else {
- _mesa_write_index_span(ctx, width, destx, dy, zspan, fogSpan, indexes,
- NULL, GL_BITMAP);
- }
+ span.x = destx;
+ span.y = dy;
+ span.end = width;
+ if (zoom)
+ _mesa_write_zoomed_index_span(ctx, &span, desty);
+ else
+ _mesa_write_index_span(ctx, &span);
}
- /* Restore pixel source to be the draw buffer (for blending, etc) */
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
- ctx->Color.DriverDrawBuffer );
-
if (overlapping)
FREE(tmpImage);
}
@@ -712,20 +605,17 @@ static void copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
GLint destx, GLint desty )
{
GLfloat depth[MAX_WIDTH];
- GLdepth zspan[MAX_WIDTH];
- GLfloat fogSpan[MAX_WIDTH];
GLfloat *p, *tmpImage;
- GLuint indexes[MAX_WIDTH];
GLint sy, dy, stepy;
GLint i, j;
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
GLint overlapping;
- DEFMARRAY(GLchan, rgba, MAX_WIDTH, 4); /* mac 32k limitation */
- CHECKARRAY(rgba, return); /* mac 32k limitation */
+ struct sw_span span;
+
+ INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_Z);
if (!ctx->Visual.depthBits) {
_mesa_error( ctx, GL_INVALID_OPERATION, "glCopyPixels" );
- UNDEFARRAY(rgba); /* mac 32k limitation */
return;
}
@@ -746,39 +636,15 @@ static void copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
- /* setup colors or indexes */
- if (ctx->Visual.rgbMode) {
- GLuint *rgba32 = (GLuint *) rgba;
- GLuint color = *(GLuint*)( ctx->Current.Color );
- for (i = 0; i < width; i++) {
- rgba32[i] = color;
- }
- }
- else {
- for (i = 0; i < width; i++) {
- indexes[i] = ctx->Current.Index;
- }
- }
-
- if (ctx->Fog.Enabled) {
- GLfloat fog;
-
- if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT)
- fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterFogCoord);
- else
- fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
-
- for (i = 0; i < width; i++) {
- fogSpan[i] = fog;
- }
- }
+ _mesa_span_default_color(ctx, &span);
+ if (ctx->Fog.Enabled)
+ _mesa_span_default_fog(ctx, &span);
if (overlapping) {
GLint ssy = sy;
tmpImage = (GLfloat *) MALLOC(width * height * sizeof(GLfloat));
if (!tmpImage) {
_mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" );
- UNDEFARRAY(rgba); /* mac 32k limitation */
return;
}
p = tmpImage;
@@ -804,33 +670,28 @@ static void copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
for (i = 0; i < width; i++) {
GLfloat d = depth[i] * ctx->Pixel.DepthScale + ctx->Pixel.DepthBias;
- zspan[i] = (GLdepth) (CLAMP(d, 0.0F, 1.0F) * ctx->DepthMax);
+ span.array->z[i] = (GLdepth) (CLAMP(d, 0.0F, 1.0F) * ctx->DepthMax);
}
+ span.x = destx;
+ span.y = dy;
+ span.end = width;
if (ctx->Visual.rgbMode) {
- if (zoom) {
- _mesa_write_zoomed_rgba_span( ctx, width, destx, dy, zspan,
- fogSpan, (const GLchan (*)[4])rgba, desty );
- }
- else {
- _mesa_write_rgba_span( ctx, width, destx, dy, zspan, fogSpan,
- (GLchan (*)[4])rgba, NULL, GL_BITMAP);
- }
+ if (zoom)
+ _mesa_write_zoomed_rgba_span( ctx, &span,
+ (const GLchan (*)[4])span.array->rgba,
+ desty );
+ else
+ _mesa_write_rgba_span(ctx, &span);
}
else {
- if (zoom) {
- _mesa_write_zoomed_index_span( ctx, width, destx, dy,
- zspan, fogSpan, indexes, desty );
- }
- else {
- _mesa_write_index_span( ctx, width, destx, dy,
- zspan, fogSpan, indexes, NULL, GL_BITMAP );
- }
+ if (zoom)
+ _mesa_write_zoomed_index_span( ctx, &span, desty );
+ else
+ _mesa_write_index_span(ctx, &span);
}
}
- UNDEFARRAY(rgba); /* mac 32k limitation */
-
if (overlapping)
FREE(tmpImage);
}
diff --git a/xc/extras/Mesa/src/swrast/s_depth.c b/xc/extras/Mesa/src/swrast/s_depth.c
index 76ef0d9cb..d3279d634 100644
--- a/xc/extras/Mesa/src/swrast/s_depth.c
+++ b/xc/extras/Mesa/src/swrast/s_depth.c
@@ -1,8 +1,7 @@
-/* $Id: s_depth.c,v 1.1.1.1 2002/10/22 13:06:45 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -28,25 +27,24 @@
#include "glheader.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "s_depth.h"
#include "s_context.h"
-#include "s_pb.h"
-
-
-/*
+/**
* Return address of depth buffer value for given window coord.
*/
GLvoid *
_mesa_zbuffer_address(GLcontext *ctx, GLint x, GLint y)
{
if (ctx->Visual.depthBits <= 16)
- return (GLushort *) ctx->DrawBuffer->DepthBuffer + ctx->DrawBuffer->Width * y + x;
+ return (GLushort *) ctx->DrawBuffer->DepthBuffer
+ + ctx->DrawBuffer->Width * y + x;
else
- return (GLuint *) ctx->DrawBuffer->DepthBuffer + ctx->DrawBuffer->Width * y + x;
+ return (GLuint *) ctx->DrawBuffer->DepthBuffer
+ + ctx->DrawBuffer->Width * y + x;
}
@@ -73,7 +71,7 @@ _mesa_zbuffer_address(GLcontext *ctx, GLint x, GLint y)
* Return: number of fragments which pass the test.
*/
static GLuint
-depth_test_span16( GLcontext *ctx, GLuint n, GLint x, GLint y,
+depth_test_span16( GLcontext *ctx, GLuint n,
GLushort zbuffer[], const GLdepth z[], GLubyte mask[] )
{
GLuint passed = 0;
@@ -291,7 +289,7 @@ depth_test_span16( GLcontext *ctx, GLuint n, GLint x, GLint y,
}
break;
case GL_NEVER:
- BZERO(mask, n * sizeof(GLubyte));
+ _mesa_bzero(mask, n * sizeof(GLubyte));
break;
default:
_mesa_problem(ctx, "Bad depth func in depth_test_span16");
@@ -302,7 +300,7 @@ depth_test_span16( GLcontext *ctx, GLuint n, GLint x, GLint y,
static GLuint
-depth_test_span32( GLcontext *ctx, GLuint n, GLint x, GLint y,
+depth_test_span32( GLcontext *ctx, GLuint n,
GLuint zbuffer[], const GLdepth z[], GLubyte mask[] )
{
GLuint passed = 0;
@@ -520,7 +518,7 @@ depth_test_span32( GLcontext *ctx, GLuint n, GLint x, GLint y,
}
break;
case GL_NEVER:
- BZERO(mask, n * sizeof(GLubyte));
+ _mesa_bzero(mask, n * sizeof(GLubyte));
break;
default:
_mesa_problem(ctx, "Bad depth func in depth_test_span32");
@@ -534,33 +532,59 @@ depth_test_span32( GLcontext *ctx, GLuint n, GLint x, GLint y,
/*
* Apply depth test to span of fragments. Hardware or software z buffer.
*/
-GLuint
-_mesa_depth_test_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], GLubyte mask[] )
+static GLuint
+depth_test_span( GLcontext *ctx, struct sw_span *span)
{
+ const GLint x = span->x;
+ const GLint y = span->y;
+ const GLuint n = span->end;
SWcontext *swrast = SWRAST_CONTEXT(ctx);
+
+ ASSERT((span->arrayMask & SPAN_XY) == 0);
+ ASSERT(span->arrayMask & SPAN_Z);
+
if (swrast->Driver.ReadDepthSpan) {
/* hardware-based depth buffer */
GLdepth zbuffer[MAX_WIDTH];
GLuint passed;
(*swrast->Driver.ReadDepthSpan)(ctx, n, x, y, zbuffer);
- passed = depth_test_span32(ctx, n, x, y, zbuffer, z, mask);
- assert(swrast->Driver.WriteDepthSpan);
- (*swrast->Driver.WriteDepthSpan)(ctx, n, x, y, zbuffer, mask);
+ passed = depth_test_span32(ctx, n, zbuffer, span->array->z,
+ span->array->mask);
+ ASSERT(swrast->Driver.WriteDepthSpan);
+ (*swrast->Driver.WriteDepthSpan)(ctx, n, x, y, zbuffer,
+ span->array->mask);
+ if (passed < n)
+ span->writeAll = GL_FALSE;
return passed;
}
else {
+ GLuint passed;
/* software depth buffer */
if (ctx->Visual.depthBits <= 16) {
GLushort *zptr = (GLushort *) Z_ADDRESS16(ctx, x, y);
- GLuint passed = depth_test_span16(ctx, n, x, y, zptr, z, mask);
- return passed;
+ passed = depth_test_span16(ctx, n, zptr, span->array->z, span->array->mask);
}
else {
GLuint *zptr = (GLuint *) Z_ADDRESS32(ctx, x, y);
- GLuint passed = depth_test_span32(ctx, n, x, y, zptr, z, mask);
- return passed;
+ passed = depth_test_span32(ctx, n, zptr, span->array->z, span->array->mask);
}
+#if 1
+ if (passed < span->end) {
+ span->writeAll = GL_FALSE;
+ }
+#else
+ /* this causes a glDrawPixels(GL_DEPTH_COMPONENT) conformance failure */
+ if (passed < span->end) {
+ span->writeAll = GL_FALSE;
+ if (passed == 0) {
+ span->end = 0;
+ return 0;
+ }
+ while (span->end > 0 && span->mask[span->end - 1] == 0)
+ span->end --;
+ }
+#endif
+ return passed;
}
}
@@ -804,7 +828,7 @@ software_depth_test_pixels16( GLcontext *ctx, GLuint n,
break;
case GL_NEVER:
/* depth test never passes */
- BZERO(mask, n * sizeof(GLubyte));
+ _mesa_bzero(mask, n * sizeof(GLubyte));
break;
default:
_mesa_problem(ctx, "Bad depth func in software_depth_test_pixels");
@@ -1050,7 +1074,7 @@ software_depth_test_pixels32( GLcontext *ctx, GLuint n,
break;
case GL_NEVER:
/* depth test never passes */
- BZERO(mask, n * sizeof(GLubyte));
+ _mesa_bzero(mask, n * sizeof(GLubyte));
break;
default:
_mesa_problem(ctx, "Bad depth func in software_depth_test_pixels");
@@ -1284,7 +1308,7 @@ hardware_depth_test_pixels( GLcontext *ctx, GLuint n, GLdepth zbuffer[],
break;
case GL_NEVER:
/* depth test never passes */
- BZERO(mask, n * sizeof(GLubyte));
+ _mesa_bzero(mask, n * sizeof(GLubyte));
break;
default:
_mesa_problem(ctx, "Bad depth func in hardware_depth_test_pixels");
@@ -1293,15 +1317,19 @@ hardware_depth_test_pixels( GLcontext *ctx, GLuint n, GLdepth zbuffer[],
-void
-_mesa_depth_test_pixels( GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- const GLdepth z[], GLubyte mask[] )
+static GLuint
+depth_test_pixels( GLcontext *ctx, struct sw_span *span )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const GLuint n = span->end;
+ const GLint *x = span->array->x;
+ const GLint *y = span->array->y;
+ const GLdepth *z = span->array->z;
+ GLubyte *mask = span->array->mask;
+
if (swrast->Driver.ReadDepthPixels) {
/* read depth values from hardware Z buffer */
- GLdepth zbuffer[PB_SIZE];
+ GLdepth zbuffer[MAX_WIDTH];
(*swrast->Driver.ReadDepthPixels)(ctx, n, x, y, zbuffer);
hardware_depth_test_pixels( ctx, n, zbuffer, z, mask );
@@ -1317,9 +1345,22 @@ _mesa_depth_test_pixels( GLcontext *ctx,
else
software_depth_test_pixels32(ctx, n, x, y, z, mask);
}
+ return n; /* not really correct, but OK */
}
+/**
+ * Apply depth (Z) buffer testing to the span.
+ * \return approx number of pixels that passed (only zero is reliable)
+ */
+GLuint
+_mesa_depth_test_span( GLcontext *ctx, struct sw_span *span)
+{
+ if (span->arrayMask & SPAN_XY)
+ return depth_test_pixels(ctx, span);
+ else
+ return depth_test_span(ctx, span);
+}
@@ -1328,7 +1369,7 @@ _mesa_depth_test_pixels( GLcontext *ctx,
/**********************************************************************/
-/*
+/**
* Read a span of depth values from the depth buffer.
* This function does clipping before calling the device driver function.
*/
@@ -1339,7 +1380,7 @@ _mesa_read_depth_span( GLcontext *ctx,
SWcontext *swrast = SWRAST_CONTEXT(ctx);
if (y < 0 || y >= (GLint) ctx->DrawBuffer->Height ||
- x + n <= 0 || x >= (GLint) ctx->DrawBuffer->Width) {
+ x + (GLint) n <= 0 || x >= (GLint) ctx->DrawBuffer->Width) {
/* span is completely outside framebuffer */
GLint i;
for (i = 0; i < n; i++)
@@ -1390,7 +1431,7 @@ _mesa_read_depth_span( GLcontext *ctx,
}
else {
/* no depth buffer */
- BZERO(depth, n * sizeof(GLfloat));
+ _mesa_bzero(depth, n * sizeof(GLfloat));
}
}
@@ -1398,7 +1439,7 @@ _mesa_read_depth_span( GLcontext *ctx,
-/*
+/**
* Return a span of depth values from the depth buffer as floats in [0,1].
* This is used for both hardware and software depth buffers.
* Input: n - how many pixels
@@ -1413,7 +1454,7 @@ _mesa_read_depth_span_float( GLcontext *ctx,
const GLfloat scale = 1.0F / ctx->DepthMaxF;
if (y < 0 || y >= (GLint) ctx->DrawBuffer->Height ||
- x + n <= 0 || x >= (GLint) ctx->DrawBuffer->Width) {
+ x + (GLint) n <= 0 || x >= (GLint) ctx->DrawBuffer->Width) {
/* span is completely outside framebuffer */
GLint i;
for (i = 0; i < n; i++)
@@ -1469,7 +1510,7 @@ _mesa_read_depth_span_float( GLcontext *ctx,
}
else {
/* no depth buffer */
- BZERO(depth, n * sizeof(GLfloat));
+ _mesa_bzero(depth, n * sizeof(GLfloat));
}
}
@@ -1481,9 +1522,10 @@ _mesa_read_depth_span_float( GLcontext *ctx,
-/*
+/**
* Allocate a new depth buffer. If there's already a depth buffer allocated
* it will be free()'d. The new depth buffer will be uniniitalized.
+ * This function is only called through Driver.alloc_depth_buffer.
*/
void
_mesa_alloc_depth_buffer( GLframebuffer *buffer )
@@ -1504,7 +1546,8 @@ _mesa_alloc_depth_buffer( GLframebuffer *buffer )
else
bytesPerValue = sizeof(GLuint);
- buffer->DepthBuffer = MESA_PBUFFER_ALLOC(buffer->Width * buffer->Height * bytesPerValue);
+ buffer->DepthBuffer = MESA_PBUFFER_ALLOC(buffer->Width * buffer->Height
+ * bytesPerValue);
if (!buffer->DepthBuffer) {
/* out of memory */
@@ -1518,9 +1561,7 @@ _mesa_alloc_depth_buffer( GLframebuffer *buffer )
}
-
-
-/*
+/**
* Clear the depth buffer. If the depth buffer doesn't exist yet we'll
* allocate it now.
* This function is only called through Driver.clear_depth_buffer.
@@ -1578,7 +1619,7 @@ _mesa_clear_depth_buffer( GLcontext *ctx )
const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->DepthMax);
if ((clearValue & 0xff) == (clearValue >> 8)) {
if (clearValue == 0) {
- BZERO(ctx->DrawBuffer->DepthBuffer,
+ _mesa_bzero(ctx->DrawBuffer->DepthBuffer,
2*ctx->DrawBuffer->Width*ctx->DrawBuffer->Height);
}
else {
@@ -1612,7 +1653,7 @@ _mesa_clear_depth_buffer( GLcontext *ctx )
/* >16 bit depth buffer */
const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->DepthMax);
if (clearValue == 0) {
- BZERO(ctx->DrawBuffer->DepthBuffer,
+ _mesa_bzero(ctx->DrawBuffer->DepthBuffer,
ctx->DrawBuffer->Width*ctx->DrawBuffer->Height*sizeof(GLuint));
}
else {
diff --git a/xc/extras/Mesa/src/swrast/s_depth.h b/xc/extras/Mesa/src/swrast/s_depth.h
index 9f04d727b..f1bd65e3a 100644
--- a/xc/extras/Mesa/src/swrast/s_depth.h
+++ b/xc/extras/Mesa/src/swrast/s_depth.h
@@ -1,8 +1,7 @@
-/* $Id: s_depth.h,v 1.1.1.1 2002/10/22 13:06:46 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.2
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -37,14 +36,10 @@ extern GLvoid *
_mesa_zbuffer_address(GLcontext *ctx, GLint x, GLint y);
+
extern GLuint
-_mesa_depth_test_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], GLubyte mask[] );
+_mesa_depth_test_span( GLcontext *ctx, struct sw_span *span);
-extern void
-_mesa_depth_test_pixels( GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- const GLdepth z[], GLubyte mask[] );
extern void
diff --git a/xc/extras/Mesa/src/swrast/s_drawpix.c b/xc/extras/Mesa/src/swrast/s_drawpix.c
index 7f5ed8077..3bcee0fc6 100644
--- a/xc/extras/Mesa/src/swrast/s_drawpix.c
+++ b/xc/extras/Mesa/src/swrast/s_drawpix.c
@@ -1,8 +1,7 @@
-/* $Id: s_drawpix.c,v 1.1.1.1 2002/10/22 13:06:58 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 5.0
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -31,13 +30,12 @@
#include "convolve.h"
#include "image.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "pixel.h"
#include "s_context.h"
#include "s_drawpix.h"
-#include "s_fog.h"
#include "s_pixeltex.h"
#include "s_span.h"
#include "s_stencil.h"
@@ -103,15 +101,23 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
const struct gl_pixelstore_attrib *unpack = &ctx->Unpack;
- GLchan rgb[MAX_WIDTH][3];
- GLchan rgba[MAX_WIDTH][4];
+ struct sw_span span;
+
+ INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
if (!ctx->Current.RasterPosValid) {
return GL_TRUE; /* no-op */
}
- if ((SWRAST_CONTEXT(ctx)->_RasterMask&(~(SCISSOR_BIT|WINCLIP_BIT)))==0
- && ctx->Texture._ReallyEnabled == 0
+ if (ctx->Depth.Test)
+ _mesa_span_default_z(ctx, &span);
+ if (ctx->Fog.Enabled)
+ _mesa_span_default_fog(ctx, &span);
+ if (ctx->Texture._EnabledUnits)
+ _mesa_span_default_texcoords(ctx, &span);
+
+ if ((SWRAST_CONTEXT(ctx)->_RasterMask & ~CLIP_BIT) == 0
+ && ctx->Texture._EnabledUnits == 0
&& unpack->Alignment == 1
&& !unpack->SwapBytes
&& !unpack->LsbFirst) {
@@ -232,8 +238,11 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
/* with zooming */
GLint row;
for (row=0; row<drawHeight; row++) {
- _mesa_write_zoomed_rgba_span(ctx, drawWidth, destX, destY,
- zSpan, 0, (CONST GLchan (*)[4]) src, zoomY0);
+ span.x = destX;
+ span.y = destY;
+ span.end = drawWidth;
+ _mesa_write_zoomed_rgba_span(ctx, &span,
+ (CONST GLchan (*)[4]) src, zoomY0);
src += rowLength * 4;
destY++;
}
@@ -269,8 +278,11 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
/* with zooming */
GLint row;
for (row=0; row<drawHeight; row++) {
- _mesa_write_zoomed_rgb_span(ctx, drawWidth, destX, destY,
- zSpan, 0, (CONST GLchan (*)[3]) src, zoomY0);
+ span.x = destX;
+ span.y = destY;
+ span.end = drawWidth;
+ _mesa_write_zoomed_rgb_span(ctx, &span,
+ (CONST GLchan (*)[3]) src, zoomY0);
src += rowLength * 3;
destY++;
}
@@ -290,12 +302,12 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
for (row=0; row<drawHeight; row++) {
GLint i;
for (i=0;i<drawWidth;i++) {
- rgb[i][0] = src[i];
- rgb[i][1] = src[i];
- rgb[i][2] = src[i];
+ span.array->rgb[i][0] = src[i];
+ span.array->rgb[i][1] = src[i];
+ span.array->rgb[i][2] = src[i];
}
(*swrast->Driver.WriteRGBSpan)(ctx, drawWidth, destX, destY,
- (CONST GLchan (*)[3]) rgb, NULL);
+ (CONST GLchan (*)[3]) span.array->rgb, NULL);
src += rowLength;
destY++;
}
@@ -307,13 +319,13 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
for (row=0; row<drawHeight; row++) {
GLint i;
for (i=0;i<drawWidth;i++) {
- rgb[i][0] = src[i];
- rgb[i][1] = src[i];
- rgb[i][2] = src[i];
+ span.array->rgb[i][0] = src[i];
+ span.array->rgb[i][1] = src[i];
+ span.array->rgb[i][2] = src[i];
}
destY--;
(*swrast->Driver.WriteRGBSpan)(ctx, drawWidth, destX, destY,
- (CONST GLchan (*)[3]) rgb, NULL);
+ (CONST GLchan (*)[3]) span.array->rgb, NULL);
src += rowLength;
}
}
@@ -324,12 +336,15 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
for (row=0; row<drawHeight; row++) {
GLint i;
for (i=0;i<drawWidth;i++) {
- rgb[i][0] = src[i];
- rgb[i][1] = src[i];
- rgb[i][2] = src[i];
+ span.array->rgb[i][0] = src[i];
+ span.array->rgb[i][1] = src[i];
+ span.array->rgb[i][2] = src[i];
}
- _mesa_write_zoomed_rgb_span(ctx, drawWidth, destX, destY,
- zSpan, 0, (CONST GLchan (*)[3]) rgb, zoomY0);
+ span.x = destX;
+ span.y = destY;
+ span.end = drawWidth;
+ _mesa_write_zoomed_rgb_span(ctx, &span,
+ (CONST GLchan (*)[3]) span.array->rgb, zoomY0);
src += rowLength;
destY++;
}
@@ -350,13 +365,13 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
GLint i;
GLchan *ptr = src;
for (i=0;i<drawWidth;i++) {
- rgba[i][0] = *ptr;
- rgba[i][1] = *ptr;
- rgba[i][2] = *ptr++;
- rgba[i][3] = *ptr++;
+ span.array->rgba[i][0] = *ptr;
+ span.array->rgba[i][1] = *ptr;
+ span.array->rgba[i][2] = *ptr++;
+ span.array->rgba[i][3] = *ptr++;
}
(*swrast->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY,
- (CONST GLchan (*)[4]) rgba, NULL);
+ (CONST GLchan (*)[4]) span.array->rgba, NULL);
src += rowLength*2;
destY++;
}
@@ -369,14 +384,14 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
GLint i;
GLchan *ptr = src;
for (i=0;i<drawWidth;i++) {
- rgba[i][0] = *ptr;
- rgba[i][1] = *ptr;
- rgba[i][2] = *ptr++;
- rgba[i][3] = *ptr++;
+ 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--;
(*swrast->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY,
- (CONST GLchan (*)[4]) rgba, NULL);
+ (CONST GLchan (*)[4]) span.array->rgba, NULL);
src += rowLength*2;
}
}
@@ -388,13 +403,16 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
GLchan *ptr = src;
GLint i;
for (i=0;i<drawWidth;i++) {
- rgba[i][0] = *ptr;
- rgba[i][1] = *ptr;
- rgba[i][2] = *ptr++;
- rgba[i][3] = *ptr++;
+ span.array->rgba[i][0] = *ptr;
+ span.array->rgba[i][1] = *ptr;
+ span.array->rgba[i][2] = *ptr++;
+ span.array->rgba[i][3] = *ptr++;
}
- _mesa_write_zoomed_rgba_span(ctx, drawWidth, destX, destY,
- zSpan, 0, (CONST GLchan (*)[4]) rgba, zoomY0);
+ span.x = destX;
+ span.y = destY;
+ span.end = drawWidth;
+ _mesa_write_zoomed_rgba_span(ctx, &span,
+ (CONST GLchan (*)[4]) span.array->rgba, zoomY0);
src += rowLength*2;
destY++;
}
@@ -411,10 +429,9 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
GLint row;
for (row=0; row<drawHeight; row++) {
ASSERT(drawWidth < MAX_WIDTH);
- _mesa_map_ci8_to_rgba(ctx, drawWidth, src, rgba);
+ _mesa_map_ci8_to_rgba(ctx, drawWidth, src, span.array->rgba);
(*swrast->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY,
- (const GLchan (*)[4]) rgba,
- NULL);
+ (const GLchan (*)[4]) span.array->rgba, NULL);
src += rowLength;
destY++;
}
@@ -425,11 +442,10 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
GLint row;
for (row=0; row<drawHeight; row++) {
ASSERT(drawWidth < MAX_WIDTH);
- _mesa_map_ci8_to_rgba(ctx, drawWidth, src, rgba);
+ _mesa_map_ci8_to_rgba(ctx, drawWidth, src, span.array->rgba);
destY--;
(*swrast->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY,
- (CONST GLchan (*)[4]) rgba,
- NULL);
+ (CONST GLchan (*)[4]) span.array->rgba, NULL);
src += rowLength;
}
return GL_TRUE;
@@ -439,9 +455,12 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
GLint row;
for (row=0; row<drawHeight; row++) {
ASSERT(drawWidth < MAX_WIDTH);
- _mesa_map_ci8_to_rgba(ctx, drawWidth, src, rgba);
- _mesa_write_zoomed_rgba_span(ctx, drawWidth, destX, destY,
- zSpan, 0, (CONST GLchan (*)[4]) rgba, zoomY0);
+ _mesa_map_ci8_to_rgba(ctx, drawWidth, src, span.array->rgba);
+ span.x = destX;
+ span.y = destY;
+ span.end = drawWidth;
+ _mesa_write_zoomed_rgba_span(ctx, &span,
+ (CONST GLchan (*)[4]) span.array->rgba, zoomY0);
src += rowLength;
destY++;
}
@@ -489,47 +508,33 @@ draw_index_pixels( GLcontext *ctx, GLint x, GLint y,
{
const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
const GLint desty = y;
- GLint row, drawWidth;
- GLdepth zspan[MAX_WIDTH];
- GLfloat fogSpan[MAX_WIDTH];
+ GLint row, drawWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width;
+ struct sw_span span;
- drawWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width;
-
- /* Fragment depth values */
- if (ctx->Depth.Test || ctx->Fog.Enabled) {
- GLdepth zval = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMaxF);
- GLfloat fog;
- GLint i;
+ INIT_SPAN(span, GL_BITMAP, drawWidth, 0, SPAN_INDEX);
- if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT)
- fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterFogCoord);
- else
- fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
-
- for (i = 0; i < drawWidth; i++) {
- zspan[i] = zval;
- fogSpan[i] = fog;
- }
- }
+ if (ctx->Depth.Test)
+ _mesa_span_default_z(ctx, &span);
+ if (ctx->Fog.Enabled)
+ _mesa_span_default_fog(ctx, &span);
/*
* General solution
*/
for (row = 0; row < height; row++, y++) {
- GLuint indexes[MAX_WIDTH];
const GLvoid *source = _mesa_image_address(&ctx->Unpack,
pixels, width, height, GL_COLOR_INDEX, type, 0, row, 0);
- _mesa_unpack_index_span(ctx, drawWidth, GL_UNSIGNED_INT, indexes,
+ _mesa_unpack_index_span(ctx, drawWidth, GL_UNSIGNED_INT,
+ span.array->index,
type, source, &ctx->Unpack,
ctx->_ImageTransferState);
- if (zoom) {
- _mesa_write_zoomed_index_span(ctx, drawWidth, x, y, zspan, fogSpan,
- indexes, desty);
- }
- else {
- _mesa_write_index_span(ctx, drawWidth, x, y, zspan, fogSpan, indexes,
- NULL, GL_BITMAP);
- }
+ span.x = x;
+ span.y = y;
+ span.end = drawWidth;
+ if (zoom)
+ _mesa_write_zoomed_index_span(ctx, &span, desty);
+ else
+ _mesa_write_index_span(ctx, &span);
}
}
@@ -594,7 +599,6 @@ draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y,
}
-
/*
* Do a glDrawPixels of depth values.
*/
@@ -606,9 +610,10 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
const GLboolean bias_or_scale = ctx->Pixel.DepthBias!=0.0 || ctx->Pixel.DepthScale!=1.0;
const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
const GLint desty = y;
- GLchan rgba[MAX_WIDTH][4];
- GLuint ispan[MAX_WIDTH];
GLint drawWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width;
+ struct sw_span span;
+
+ INIT_SPAN(span, GL_BITMAP, drawWidth, 0, SPAN_Z);
if (type != GL_BYTE
&& type != GL_UNSIGNED_BYTE
@@ -621,62 +626,53 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
return;
}
- /* Colors or indexes */
- if (ctx->Visual.rgbMode) {
- GLint i;
- GLint r, g, b, a;
- UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterColor[0]);
- UNCLAMPED_FLOAT_TO_CHAN(g, ctx->Current.RasterColor[1]);
- UNCLAMPED_FLOAT_TO_CHAN(b, ctx->Current.RasterColor[2]);
- UNCLAMPED_FLOAT_TO_CHAN(a, ctx->Current.RasterColor[3]);
- for (i = 0; i < drawWidth; i++) {
- rgba[i][RCOMP] = r;
- rgba[i][GCOMP] = g;
- rgba[i][BCOMP] = b;
- rgba[i][ACOMP] = a;
- }
- }
- else {
- GLint i;
- for (i = 0; i < drawWidth; i++) {
- ispan[i] = ctx->Current.RasterIndex;
- }
- }
+ _mesa_span_default_color(ctx, &span);
+
+ if (ctx->Fog.Enabled)
+ _mesa_span_default_fog(ctx, &span);
+ if (ctx->Texture._EnabledUnits)
+ _mesa_span_default_texcoords(ctx, &span);
if (type==GL_UNSIGNED_SHORT && ctx->Visual.depthBits == 16
&& !bias_or_scale && !zoom && ctx->Visual.rgbMode) {
/* Special case: directly write 16-bit depth values */
GLint row;
- for (row = 0; row < height; row++, y++) {
- GLdepth zspan[MAX_WIDTH];
+ span.x = x;
+ span.y = y;
+ span.end = drawWidth;
+ for (row = 0; row < height; row++, span.y++) {
const GLushort *zptr = (const GLushort *)
_mesa_image_address(&ctx->Unpack, pixels, width, height,
GL_DEPTH_COMPONENT, type, 0, row, 0);
GLint i;
- for (i = 0; i < width; i++)
- zspan[i] = zptr[i];
- _mesa_write_rgba_span(ctx, width, x, y, zspan, 0, rgba,
- NULL, GL_BITMAP);
+ for (i = 0; i < drawWidth; i++)
+ span.array->z[i] = zptr[i];
+ _mesa_write_rgba_span(ctx, &span);
}
}
else if (type==GL_UNSIGNED_INT && ctx->Visual.depthBits == 32
&& !bias_or_scale && !zoom && ctx->Visual.rgbMode) {
/* Special case: directly write 32-bit depth values */
GLint row;
- for (row = 0; row < height; row++, y++) {
+ span.x = x;
+ span.y = y;
+ span.end = drawWidth;
+ for (row = 0; row < height; row++, span.y++) {
const GLuint *zptr = (const GLuint *)
_mesa_image_address(&ctx->Unpack, pixels, width, height,
GL_DEPTH_COMPONENT, type, 0, row, 0);
- _mesa_write_rgba_span(ctx, width, x, y, zptr, 0, rgba,
- NULL, GL_BITMAP);
+ MEMCPY(span.array->z, zptr, drawWidth * sizeof(GLdepth));
+ _mesa_write_rgba_span(ctx, &span);
}
}
else {
/* General case */
GLint row;
- for (row = 0; row < height; row++, y++) {
+ span.x = x;
+ span.y = y;
+ span.end = drawWidth;
+ for (row = 0; row < height; row++, span.y++) {
GLfloat fspan[MAX_WIDTH];
- GLdepth zspan[MAX_WIDTH];
const GLvoid *src = _mesa_image_address(&ctx->Unpack,
pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0);
_mesa_unpack_depth_span( ctx, drawWidth, fspan, type, src,
@@ -686,31 +682,23 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
const GLfloat zs = ctx->DepthMaxF;
GLint i;
for (i = 0; i < drawWidth; i++) {
- zspan[i] = (GLdepth) (fspan[i] * zs + 0.5F);
+ span.array->z[i] = (GLdepth) (fspan[i] * zs + 0.5F);
}
}
-
if (ctx->Visual.rgbMode) {
if (zoom) {
- _mesa_write_zoomed_rgba_span(ctx, width, x, y, zspan, 0,
- (const GLchan (*)[4]) rgba, desty);
- }
- else {
- _mesa_write_rgba_span(ctx, width, x, y, zspan, 0,
- rgba, NULL, GL_BITMAP);
+ _mesa_write_zoomed_rgba_span(ctx, &span,
+ (const GLchan (*)[4]) span.array->rgba, desty);
}
+ else
+ _mesa_write_rgba_span(ctx, &span);
}
else {
- if (zoom) {
- _mesa_write_zoomed_index_span(ctx, width, x, y, zspan, 0,
- ispan, GL_BITMAP);
- }
- else {
- _mesa_write_index_span(ctx, width, x, y, zspan, 0,
- ispan, NULL, GL_BITMAP);
- }
+ if (zoom)
+ _mesa_write_zoomed_index_span(ctx, &span, desty);
+ else
+ _mesa_write_index_span(ctx, &span);
}
-
}
}
}
@@ -728,11 +716,12 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
const struct gl_pixelstore_attrib *unpack = &ctx->Unpack;
const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
const GLint desty = y;
- GLdepth zspan[MAX_WIDTH];
- GLfloat fogSpan[MAX_WIDTH];
GLboolean quickDraw;
GLfloat *convImage = NULL;
GLuint transferOps = ctx->_ImageTransferState;
+ struct sw_span span;
+
+ INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
if (!_mesa_is_legal_format_and_type(format, type)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawPixels(format or type)");
@@ -743,24 +732,12 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
if (fast_draw_pixels(ctx, x, y, width, height, format, type, pixels))
return;
- /* Fragment depth values */
- if (ctx->Depth.Test || ctx->Fog.Enabled) {
- /* fill in array of z values */
- GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMaxF);
- GLfloat fog;
- GLint i;
-
- if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT)
- fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterFogCoord);
- else
- fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
-
- for (i=0;i<width;i++) {
- zspan[i] = z;
- fogSpan[i] = fog;
- }
- }
-
+ if (ctx->Depth.Test)
+ _mesa_span_default_z(ctx, &span);
+ if (ctx->Fog.Enabled)
+ _mesa_span_default_fog(ctx, &span);
+ if (ctx->Texture._EnabledUnits)
+ _mesa_span_default_texcoords(ctx, &span);
if (SWRAST_CONTEXT(ctx)->_RasterMask == 0 && !zoom && x >= 0 && y >= 0
&& x + width <= (GLint) ctx->DrawBuffer->Width
@@ -827,61 +804,44 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
* General solution
*/
{
- GLchan rgba[MAX_WIDTH][4];
GLint row;
if (width > MAX_WIDTH)
width = MAX_WIDTH;
+
for (row = 0; row < height; row++, y++) {
const GLvoid *source = _mesa_image_address(unpack,
pixels, width, height, format, type, 0, row, 0);
- _mesa_unpack_chan_color_span(ctx, width, GL_RGBA, (GLchan *) rgba,
+
+ _mesa_unpack_chan_color_span(ctx, width, 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;
- if (ctx->Texture._ReallyEnabled && ctx->Pixel.PixelTextureEnabled) {
- GLchan primary_rgba[MAX_WIDTH][4];
- GLuint unit;
- DEFARRAY(GLfloat, s, MAX_WIDTH); /* mac 32k limitation */
- DEFARRAY(GLfloat, t, MAX_WIDTH);
- DEFARRAY(GLfloat, r, MAX_WIDTH);
- DEFARRAY(GLfloat, q, MAX_WIDTH);
- CHECKARRAY(s, return); /* mac 32k limitation */
- CHECKARRAY(t, return);
- CHECKARRAY(r, return);
- CHECKARRAY(q, return);
-
- /* XXX not sure how multitexture is supposed to work here */
- MEMCPY(primary_rgba, rgba, 4 * width * sizeof(GLchan));
-
- for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
- if (ctx->Texture.Unit[unit]._ReallyEnabled) {
- _mesa_pixeltexgen(ctx, width, (const GLchan (*)[4]) rgba,
- s, t, r, q);
- _swrast_texture_fragments(ctx, unit, width, s, t, r, NULL,
- (CONST GLchan (*)[4]) primary_rgba,
- rgba);
- }
- }
- UNDEFARRAY(s); /* mac 32k limitation */
- UNDEFARRAY(t);
- UNDEFARRAY(r);
- UNDEFARRAY(q);
+ if (ctx->Pixel.PixelTextureEnabled && ctx->Texture._EnabledUnits) {
+ span.end = width;
+ _swrast_pixel_texture(ctx, &span);
}
if (quickDraw) {
(*swrast->Driver.WriteRGBASpan)(ctx, width, x, y,
- (CONST GLchan (*)[4]) rgba, NULL);
+ (CONST GLchan (*)[4]) span.array->rgba, NULL);
}
else if (zoom) {
- _mesa_write_zoomed_rgba_span(ctx, width, x, y, zspan, fogSpan,
- (CONST GLchan (*)[4]) rgba, desty);
+ span.x = x;
+ span.y = y;
+ span.end = width;
+ _mesa_write_zoomed_rgba_span(ctx, &span,
+ (CONST GLchan (*)[4]) span.array->rgba, desty);
}
else {
- _mesa_write_rgba_span(ctx, (GLuint) width, x, y, zspan, fogSpan,
- rgba, NULL, GL_BITMAP);
+ span.x = x;
+ span.y = y;
+ span.end = width;
+ _mesa_write_rgba_span(ctx, &span);
}
}
}
@@ -907,7 +867,6 @@ _swrast_DrawPixels( GLcontext *ctx,
SWcontext *swrast = SWRAST_CONTEXT(ctx);
(void) unpack;
-
if (swrast->NewState)
_swrast_validate_derived( ctx );
@@ -945,3 +904,55 @@ _swrast_DrawPixels( GLcontext *ctx,
RENDER_FINISH(swrast,ctx);
}
+
+
+
+#if 0 /* experimental */
+/*
+ * Execute glDrawDepthPixelsMESA().
+ */
+void
+_swrast_DrawDepthPixelsMESA( GLcontext *ctx,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum colorFormat, GLenum colorType,
+ const GLvoid *colors,
+ GLenum depthType, const GLvoid *depths,
+ const struct gl_pixelstore_attrib *unpack )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ (void) unpack;
+
+ if (swrast->NewState)
+ _swrast_validate_derived( ctx );
+
+ RENDER_START(swrast,ctx);
+
+ switch (colorFormat) {
+ case GL_COLOR_INDEX:
+ if (ctx->Visual.rgbMode)
+ draw_rgba_pixels(ctx, x,y, width, height, colorFormat, colorType, colors);
+ else
+ draw_index_pixels(ctx, x, y, width, height, colorType, colors);
+ break;
+ case GL_RED:
+ case GL_GREEN:
+ case GL_BLUE:
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ case GL_LUMINANCE_ALPHA:
+ case GL_RGB:
+ case GL_BGR:
+ case GL_RGBA:
+ case GL_BGRA:
+ case GL_ABGR_EXT:
+ draw_rgba_pixels(ctx, x, y, width, height, colorFormat, colorType, colors);
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM,
+ "glDrawDepthPixelsMESA(colorFormat)" );
+ }
+
+ RENDER_FINISH(swrast,ctx);
+}
+#endif
diff --git a/xc/extras/Mesa/src/swrast/s_fog.c b/xc/extras/Mesa/src/swrast/s_fog.c
index b7e880528..2e2390c08 100644
--- a/xc/extras/Mesa/src/swrast/s_fog.c
+++ b/xc/extras/Mesa/src/swrast/s_fog.c
@@ -1,8 +1,7 @@
-/* $Id: s_fog.c,v 1.1.1.1 2002/10/22 13:06:41 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -33,12 +32,12 @@
#include "s_context.h"
#include "s_fog.h"
-#include "s_pb.h"
+#include "s_span.h"
-/*
+/**
* Used to convert current raster distance to a fog factor in [0,1].
*/
GLfloat
@@ -63,67 +62,14 @@ _mesa_z_to_fogfactor(GLcontext *ctx, GLfloat z)
f = (GLfloat) exp(-(d * d * z * z));
return f;
default:
- _mesa_problem(ctx, "Bad fog mode in make_fog_coord");
+ _mesa_problem(ctx, "Bad fog mode in _mesa_z_to_fogfactor");
return 0.0;
}
}
-/*
- * Apply fog to an array of RGBA pixels.
- * Input: n - number of pixels
- * fog - array of fog factors in [0,1]
- * red, green, blue, alpha - pixel colors
- * Output: red, green, blue, alpha - fogged pixel colors
- */
-void
-_mesa_fog_rgba_pixels( const GLcontext *ctx,
- GLuint n,
- const GLfloat fog[],
- GLchan rgba[][4] )
-{
- GLuint i;
- GLchan rFog, gFog, bFog;
-
- 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]);
-
- for (i = 0; i < n; i++) {
- const GLfloat f = fog[i];
- const GLfloat g = 1.0F - f;
- rgba[i][RCOMP] = (GLchan) (f * rgba[i][RCOMP] + g * rFog);
- rgba[i][GCOMP] = (GLchan) (f * rgba[i][GCOMP] + g * gFog);
- rgba[i][BCOMP] = (GLchan) (f * rgba[i][BCOMP] + g * bFog);
- }
-}
-
-
-
-/*
- * Apply fog to an array of color index pixels.
- * Input: n - number of pixels
- * fog - array of fog factors in [0,1]
- * index - pixel color indexes
- * Output: index - fogged pixel color indexes
- */
-void
-_mesa_fog_ci_pixels( const GLcontext *ctx,
- GLuint n, const GLfloat fog[], GLuint index[] )
-{
- GLuint idx = (GLuint) ctx->Fog.Index;
- GLuint i;
-
- for (i = 0; i < n; i++) {
- const GLfloat f = CLAMP(fog[i], 0.0F, 1.0F);
- index[i] = (GLuint) ((GLfloat) index[i] + (1.0F - f) * idx);
- }
-}
-
-
-
-/*
+/**
* Calculate fog factors (in [0,1]) from window z values
* Input: n - number of pixels
* z - array of integer depth values
@@ -138,9 +84,10 @@ compute_fog_factors_from_z( const GLcontext *ctx,
const GLdepth z[],
GLfloat fogFact[] )
{
- const GLboolean ortho = (ctx->ProjectionMatrix.m[15] != 0.0F);
- const GLfloat p10 = ctx->ProjectionMatrix.m[10];
- const GLfloat p14 = ctx->ProjectionMatrix.m[14];
+ const GLfloat *proj = ctx->ProjectionMatrixStack.Top->m;
+ const GLboolean ortho = (proj[15] != 0.0F);
+ const GLfloat p10 = proj[10];
+ const GLfloat p14 = proj[14];
const GLfloat tz = ctx->Viewport._WindowMap.m[MAT_TZ];
GLfloat szInv;
GLuint i;
@@ -267,37 +214,101 @@ compute_fog_factors_from_z( const GLcontext *ctx,
}
-/*
- * Apply fog to an array of RGBA pixels.
- * Input: n - number of pixels
- * z - array of integer depth values
- * red, green, blue, alpha - pixel colors
- * Output: red, green, blue, alpha - fogged pixel colors
+
+/**
+ * Apply fog to a span of RGBA pixels.
+ * The fog factors are either in the span->array->fog or stored as base/step.
+ * These are fog _factors_, not fog coords. Fog coords were converted to
+ * fog factors per vertex.
*/
void
-_mesa_depth_fog_rgba_pixels( const GLcontext *ctx,
- GLuint n, const GLdepth z[], GLchan rgba[][4] )
+_mesa_fog_rgba_span( const GLcontext *ctx, struct sw_span *span )
{
- GLfloat fogFact[PB_SIZE];
- ASSERT(n <= PB_SIZE);
- compute_fog_factors_from_z( ctx, n, z, fogFact );
- _mesa_fog_rgba_pixels( ctx, n, fogFact, rgba );
+ const SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const GLuint n = span->end;
+ GLchan (*rgba)[4] = (GLchan (*)[4]) span->array->rgba;
+ GLchan rFog, gFog, bFog;
+
+ ASSERT(ctx->Fog.Enabled);
+ ASSERT((span->interpMask | span->arrayMask) & SPAN_FOG);
+ ASSERT(span->arrayMask & SPAN_RGBA);
+
+ 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]);
+
+ if (swrast->_PreferPixelFog) {
+ /* compute fog factor from each fragment's Z value */
+ if ((span->interpMask & SPAN_Z) && (span->arrayMask & SPAN_Z) == 0)
+ _mesa_span_interpolate_z(ctx, span);
+ compute_fog_factors_from_z(ctx, n, span->array->z, span->array->fog);
+ span->arrayMask |= SPAN_FOG;
+ }
+
+ if (span->arrayMask & SPAN_FOG) {
+ /* use fog array in span */
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ const GLfloat fog = span->array->fog[i];
+ const GLfloat oneMinusFog = 1.0F - fog;
+ rgba[i][RCOMP] = (GLchan) (fog * rgba[i][RCOMP] + oneMinusFog * rFog);
+ rgba[i][GCOMP] = (GLchan) (fog * rgba[i][GCOMP] + oneMinusFog * gFog);
+ rgba[i][BCOMP] = (GLchan) (fog * rgba[i][BCOMP] + oneMinusFog * bFog);
+ }
+ }
+ else {
+ /* interpolate fog factors */
+ GLfloat fog = span->fog, dFog = span->fogStep;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ const GLfloat oneMinusFog = 1.0F - fog;
+ rgba[i][RCOMP] = (GLchan) (fog * rgba[i][RCOMP] + oneMinusFog * rFog);
+ rgba[i][GCOMP] = (GLchan) (fog * rgba[i][GCOMP] + oneMinusFog * gFog);
+ rgba[i][BCOMP] = (GLchan) (fog * rgba[i][BCOMP] + oneMinusFog * bFog);
+ fog += dFog;
+ }
+ }
}
-/*
- * Apply fog to an array of color index pixels.
- * Input: n - number of pixels
- * z - array of integer depth values
- * index - pixel color indexes
- * Output: index - fogged pixel color indexes
+/**
+ * As above, but color index mode.
*/
void
-_mesa_depth_fog_ci_pixels( const GLcontext *ctx,
- GLuint n, const GLdepth z[], GLuint index[] )
+_mesa_fog_ci_span( const GLcontext *ctx, struct sw_span *span )
{
- GLfloat fogFact[PB_SIZE];
- ASSERT(n <= PB_SIZE);
- compute_fog_factors_from_z( ctx, n, z, fogFact );
- _mesa_fog_ci_pixels( ctx, n, fogFact, index );
+ const SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const GLuint n = span->end;
+ GLuint *index = span->array->index;
+
+ ASSERT(ctx->Fog.Enabled);
+ ASSERT(span->arrayMask & SPAN_INDEX);
+ ASSERT((span->interpMask | span->arrayMask) & SPAN_FOG);
+
+ if (swrast->_PreferPixelFog) {
+ /* compute fog factor from each fragment's Z value */
+ if ((span->interpMask & SPAN_Z) && (span->arrayMask & SPAN_Z) == 0)
+ _mesa_span_interpolate_z(ctx, span);
+ compute_fog_factors_from_z(ctx, n, span->array->z, span->array->fog);
+ span->arrayMask |= SPAN_FOG;
+ }
+
+ if (span->arrayMask & SPAN_FOG) {
+ const GLuint idx = (GLuint) ctx->Fog.Index;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ const GLfloat f = CLAMP(span->array->fog[i], 0.0F, 1.0F);
+ index[i] = (GLuint) ((GLfloat) index[i] + (1.0F - f) * idx);
+ }
+ }
+ else {
+ GLfloat fog = span->fog, dFog = span->fogStep;
+ const GLuint idx = (GLuint) ctx->Fog.Index;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ const GLfloat f = CLAMP(fog, 0.0F, 1.0F);
+ index[i] = (GLuint) ((GLfloat) index[i] + (1.0F - f) * idx);
+ fog += dFog;
+ }
+ }
}
diff --git a/xc/extras/Mesa/src/swrast/s_fog.h b/xc/extras/Mesa/src/swrast/s_fog.h
index a3c35759c..6e23647d1 100644
--- a/xc/extras/Mesa/src/swrast/s_fog.h
+++ b/xc/extras/Mesa/src/swrast/s_fog.h
@@ -1,10 +1,9 @@
-/* $Id: s_fog.h,v 1.1.1.1 2002/10/22 13:06:41 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -36,29 +35,11 @@
extern GLfloat
_mesa_z_to_fogfactor(GLcontext *ctx, GLfloat z);
-
-extern void
-_mesa_fog_rgba_pixels( const GLcontext *ctx,
- GLuint n, const GLfloat fog[],
- GLchan rgba[][4] );
-
-extern void
-_mesa_fog_ci_pixels( const GLcontext *ctx,
- GLuint n, const GLfloat fog[], GLuint indx[] );
-
-extern void
-_mesa_win_fog_coords_from_z( const GLcontext *ctx,
- GLuint n,
- const GLdepth z[],
- GLfloat fogcoord[] );
-
extern void
-_mesa_depth_fog_rgba_pixels( const GLcontext *ctx,
- GLuint n, const GLdepth z[], GLchan rgba[][4] );
+_mesa_fog_rgba_span( const GLcontext *ctx, struct sw_span *span );
extern void
-_mesa_depth_fog_ci_pixels( const GLcontext *ctx,
- GLuint n, const GLdepth z[], GLuint index[] );
+_mesa_fog_ci_span( const GLcontext *ctx, struct sw_span *span );
#endif
diff --git a/xc/extras/Mesa/src/swrast/s_imaging.c b/xc/extras/Mesa/src/swrast/s_imaging.c
index 495ef3197..4b5438f88 100644
--- a/xc/extras/Mesa/src/swrast/s_imaging.c
+++ b/xc/extras/Mesa/src/swrast/s_imaging.c
@@ -1,8 +1,7 @@
-/* $Id: s_imaging.c,v 1.1.1.1 2002/10/22 13:06:48 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -37,12 +36,10 @@ _swrast_CopyColorTable( GLcontext *ctx,
GLenum target, GLenum internalformat,
GLint x, GLint y, GLsizei width)
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLchan data[MAX_WIDTH][4];
/* Select buffer to read from */
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
- ctx->Pixel.DriverReadBuffer );
+ _swrast_use_read_buffer(ctx);
if (width > MAX_WIDTH)
width = MAX_WIDTH;
@@ -51,8 +48,7 @@ _swrast_CopyColorTable( GLcontext *ctx,
_mesa_read_rgba_span( ctx, ctx->ReadBuffer, width, x, y, data );
/* Restore reading from draw buffer (the default) */
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
- ctx->Color.DriverDrawBuffer );
+ _swrast_use_draw_buffer(ctx);
glColorTable(target, internalformat, width, GL_RGBA, CHAN_TYPE, data);
}
@@ -61,12 +57,10 @@ void
_swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start,
GLint x, GLint y, GLsizei width)
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLchan data[MAX_WIDTH][4];
/* Select buffer to read from */
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
- ctx->Pixel.DriverReadBuffer );
+ _swrast_use_read_buffer(ctx);
if (width > MAX_WIDTH)
width = MAX_WIDTH;
@@ -75,8 +69,7 @@ _swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start,
_mesa_read_rgba_span( ctx, ctx->ReadBuffer, width, x, y, data );
/* Restore reading from draw buffer (the default) */
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
- ctx->Color.DriverDrawBuffer );
+ _swrast_use_draw_buffer(ctx);
glColorSubTable(target, start, width, GL_RGBA, CHAN_TYPE, data);
}
@@ -90,6 +83,9 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target,
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLchan rgba[MAX_CONVOLUTION_WIDTH][4];
+ /* Select buffer to read from */
+ _swrast_use_read_buffer(ctx);
+
RENDER_START( swrast, ctx );
/* read the data from framebuffer */
@@ -98,6 +94,9 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target,
RENDER_FINISH( swrast, ctx );
+ /* Restore reading from draw buffer (the default) */
+ _swrast_use_draw_buffer(ctx);
+
/* store as convolution filter */
glConvolutionFilter1D(target, internalFormat, width,
GL_RGBA, CHAN_TYPE, rgba);
@@ -114,6 +113,9 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target,
GLchan rgba[MAX_CONVOLUTION_HEIGHT][MAX_CONVOLUTION_WIDTH][4];
GLint i;
+ /* Select buffer to read from */
+ _swrast_use_read_buffer(ctx);
+
RENDER_START(swrast,ctx);
/* read pixels from framebuffer */
@@ -124,6 +126,9 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target,
RENDER_FINISH(swrast,ctx);
+ /* Restore reading from draw buffer (the default) */
+ _swrast_use_draw_buffer(ctx);
+
/*
* HACK: save & restore context state so we can store this as a
* convolution filter via the GL api. Doesn't call any callbacks
diff --git a/xc/extras/Mesa/src/swrast/s_lines.c b/xc/extras/Mesa/src/swrast/s_lines.c
index ec8c343e3..eabfdcce0 100644
--- a/xc/extras/Mesa/src/swrast/s_lines.c
+++ b/xc/extras/Mesa/src/swrast/s_lines.c
@@ -1,10 +1,9 @@
-/* $Id: s_lines.c,v 1.1.1.1 2002/10/22 13:06:48 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 5.0
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -30,334 +29,294 @@
#include "macros.h"
#include "mmath.h"
#include "s_aaline.h"
-#include "s_pb.h"
#include "s_context.h"
#include "s_depth.h"
-#include "s_lines.h"
#include "s_feedback.h"
+#include "s_lines.h"
+#include "s_span.h"
+/*
+ * Init the mask[] array to implement a line stipple.
+ */
+static void
+compute_stipple_mask( GLcontext *ctx, GLuint len, GLubyte mask[] )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint i;
-/**********************************************************************/
-/***** Rasterization *****/
-/**********************************************************************/
+ for (i = 0; i < len; i++) {
+ GLuint bit = (swrast->StippleCounter / ctx->Line.StippleFactor) & 0xf;
+ if ((1 << bit) & ctx->Line.StipplePattern) {
+ mask[i] = GL_TRUE;
+ }
+ else {
+ mask[i] = GL_FALSE;
+ }
+ swrast->StippleCounter++;
+ }
+}
/*
- * There are 4 pairs (RGBA, CI) of line drawing functions:
- * 1. simple: width=1 and no special rasterization functions (fastest)
- * 2. flat: width=1, non-stippled, flat-shaded, any raster operations
- * 3. smooth: width=1, non-stippled, smooth-shaded, any raster operations
- * 4. general: any other kind of line (slowest)
+ * To draw a wide line we can simply redraw the span N times, side by side.
*/
-
-
-/* Flat, color index line */
-static void flat_ci_line( GLcontext *ctx,
- const SWvertex *vert0,
- const SWvertex *vert1 )
+static void
+draw_wide_line( GLcontext *ctx, struct sw_span *span, GLboolean xMajor )
{
- struct pixel_buffer *PB = SWRAST_CONTEXT(ctx)->PB;
+ GLint width, start;
- PB_SET_INDEX( PB, vert0->index );
+ ASSERT(span->end < MAX_WIDTH);
-#define INTERP_XY 1
-#define PLOT(X,Y) PB_WRITE_PIXEL(PB, X, Y, 0, 0);
+ width = (GLint) CLAMP( ctx->Line.Width, MIN_LINE_WIDTH, MAX_LINE_WIDTH );
-#include "s_linetemp.h"
-
- _mesa_flush_pb(ctx);
+ if (width & 1)
+ start = width / 2;
+ else
+ start = width / 2 - 1;
+
+ if (xMajor) {
+ GLint *y = span->array->y;
+ GLuint i;
+ GLint w;
+ for (w = 0; w < width; w++) {
+ if (w == 0) {
+ for (i = 0; i < span->end; i++)
+ y[i] -= start;
+ }
+ else {
+ for (i = 0; i < span->end; i++)
+ y[i]++;
+ }
+ if ((span->interpMask | span->arrayMask) & SPAN_TEXTURE)
+ _mesa_write_texture_span(ctx, span);
+ else if ((span->interpMask | span->arrayMask) & SPAN_RGBA)
+ _mesa_write_rgba_span(ctx, span);
+ else
+ _mesa_write_index_span(ctx, span);
+ }
+ }
+ else {
+ GLint *x = span->array->x;
+ GLuint i;
+ GLint w;
+ for (w = 0; w < width; w++) {
+ if (w == 0) {
+ for (i = 0; i < span->end; i++)
+ x[i] -= start;
+ }
+ else {
+ for (i = 0; i < span->end; i++)
+ x[i]++;
+ }
+ if ((span->interpMask | span->arrayMask) & SPAN_TEXTURE)
+ _mesa_write_texture_span(ctx, span);
+ else if ((span->interpMask | span->arrayMask) & SPAN_RGBA)
+ _mesa_write_rgba_span(ctx, span);
+ else
+ _mesa_write_index_span(ctx, span);
+ }
+ }
}
-/* Flat, color index line with Z interpolation/testing */
-static void flat_ci_z_line( GLcontext *ctx,
- const SWvertex *vert0,
- const SWvertex *vert1 )
+/**********************************************************************/
+/***** Rasterization *****/
+/**********************************************************************/
+
+
+/* Flat, color index line */
+static void flat_ci_line( GLcontext *ctx,
+ const SWvertex *vert0,
+ const SWvertex *vert1 )
{
- struct pixel_buffer *PB = SWRAST_CONTEXT(ctx)->PB;
- PB_SET_INDEX( PB, vert0->index );
+ GLint *x, *y;
+ struct sw_span span;
+
+ ASSERT(ctx->Light.ShadeModel == GL_FLAT);
+ ASSERT(!ctx->Line.StippleFlag);
+ ASSERT(ctx->Line.Width == 1.0F);
+
+ INIT_SPAN(span, GL_LINE, 0, SPAN_INDEX, SPAN_XY);
+ span.index = IntToFixed(vert1->index);
+ span.indexStep = 0;
+ x = span.array->x;
+ y = span.array->y;
#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define PLOT(X,Y) PB_WRITE_PIXEL(PB, X, Y, Z, fog0);
+#define PLOT(X,Y) \
+ { \
+ x[span.end] = X; \
+ y[span.end] = Y; \
+ span.end++; \
+ }
#include "s_linetemp.h"
- _mesa_flush_pb(ctx);
+ _mesa_write_index_span(ctx, &span);
}
-
/* Flat-shaded, RGBA line */
static void flat_rgba_line( GLcontext *ctx,
const SWvertex *vert0,
const SWvertex *vert1 )
{
- const GLchan *color = vert1->color;
- struct pixel_buffer *PB = SWRAST_CONTEXT(ctx)->PB;
- PB_SET_COLOR( PB, color[0], color[1], color[2], color[3] );
+ struct sw_span span;
+ GLint *x, *y;
+
+ ASSERT(ctx->Light.ShadeModel == GL_FLAT);
+ ASSERT(!ctx->Line.StippleFlag);
+ ASSERT(ctx->Line.Width == 1.0F);
+
+ INIT_SPAN(span, GL_LINE, 0, SPAN_RGBA, SPAN_XY);
+ span.red = ChanToFixed(vert1->color[0]);
+ span.green = ChanToFixed(vert1->color[1]);
+ span.blue = ChanToFixed(vert1->color[2]);
+ span.alpha = ChanToFixed(vert1->color[3]);
+ span.redStep = 0;
+ span.greenStep = 0;
+ span.blueStep = 0;
+ span.alphaStep = 0;
+ x = span.array->x;
+ y = span.array->y;
#define INTERP_XY 1
-#define PLOT(X,Y) PB_WRITE_PIXEL(PB, X, Y, 0, 0);
-
-#include "s_linetemp.h"
-
- _mesa_flush_pb(ctx);
-}
-
-
-
-/* Flat-shaded, RGBA line with Z interpolation/testing */
-static void flat_rgba_z_line( GLcontext *ctx,
- const SWvertex *vert0,
- const SWvertex *vert1 )
-{
- const GLchan *color = vert1->color;
- struct pixel_buffer *PB = SWRAST_CONTEXT(ctx)->PB;
- PB_SET_COLOR( PB, color[0], color[1], color[2], color[3] );
-
-#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define PLOT(X,Y) PB_WRITE_PIXEL(PB, X, Y, Z, fog0);
+#define PLOT(X,Y) \
+ { \
+ x[span.end] = X; \
+ y[span.end] = Y; \
+ span.end++; \
+ }
#include "s_linetemp.h"
- _mesa_flush_pb(ctx);
+ _mesa_write_rgba_span(ctx, &span);
}
-
/* Smooth shaded, color index line */
static void smooth_ci_line( GLcontext *ctx,
const SWvertex *vert0,
const SWvertex *vert1 )
{
- struct pixel_buffer *PB = SWRAST_CONTEXT(ctx)->PB;
- GLint count = PB->count;
- GLint *pbx = PB->x;
- GLint *pby = PB->y;
- GLuint *pbi = PB->index;
+ struct sw_span span;
+ GLint *x, *y;
+ GLuint *index;
- PB->mono = GL_FALSE;
+ ASSERT(ctx->Light.ShadeModel == GL_SMOOTH);
+ ASSERT(!ctx->Line.StippleFlag);
+ ASSERT(ctx->Line.Width == 1.0F);
-#define INTERP_XY 1
-#define INTERP_INDEX 1
-
-#define PLOT(X,Y) \
- pbx[count] = X; \
- pby[count] = Y; \
- pbi[count] = I; \
- count++;
-
-#include "s_linetemp.h"
-
- PB->count = count;
- _mesa_flush_pb(ctx);
-}
-
-
-
-/* Smooth shaded, color index line with Z interpolation/testing */
-static void smooth_ci_z_line( GLcontext *ctx,
- const SWvertex *vert0,
- const SWvertex *vert1 )
-{
- struct pixel_buffer *PB = SWRAST_CONTEXT(ctx)->PB;
- GLint count = PB->count;
- GLint *pbx = PB->x;
- GLint *pby = PB->y;
- GLdepth *pbz = PB->z;
- GLuint *pbi = PB->index;
-
- PB->mono = GL_FALSE;
+ INIT_SPAN(span, GL_LINE, 0, 0, SPAN_XY | SPAN_INDEX);
+ x = span.array->x;
+ y = span.array->y;
+ index = span.array->index;
#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
#define INTERP_INDEX 1
-
#define PLOT(X,Y) \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- pbi[count] = I; \
- count++;
+ { \
+ x[span.end] = X; \
+ y[span.end] = Y; \
+ index[span.end] = I; \
+ span.end++; \
+ }
#include "s_linetemp.h"
- PB->count = count;
- _mesa_flush_pb(ctx);
+ _mesa_write_index_span(ctx, &span);
}
-
/* Smooth-shaded, RGBA line */
static void smooth_rgba_line( GLcontext *ctx,
const SWvertex *vert0,
const SWvertex *vert1 )
{
- struct pixel_buffer *PB = SWRAST_CONTEXT(ctx)->PB;
- GLint count = PB->count;
- GLint *pbx = PB->x;
- GLint *pby = PB->y;
- GLchan (*pbrgba)[4] = PB->rgba;
-
- PB->mono = GL_FALSE;
-
-#define INTERP_XY 1
-#define INTERP_RGB 1
-#define INTERP_ALPHA 1
-
-#define PLOT(X,Y) \
- pbx[count] = X; \
- pby[count] = Y; \
- pbrgba[count][RCOMP] = FixedToInt(r0); \
- pbrgba[count][GCOMP] = FixedToInt(g0); \
- pbrgba[count][BCOMP] = FixedToInt(b0); \
- pbrgba[count][ACOMP] = FixedToInt(a0); \
- count++;
-
-#include "s_linetemp.h"
-
- PB->count = count;
- _mesa_flush_pb(ctx);
-}
-
-
-
-/* Smooth-shaded, RGBA line with Z interpolation/testing */
-static void smooth_rgba_z_line( GLcontext *ctx,
- const SWvertex *vert0,
- const SWvertex *vert1 )
-{
- struct pixel_buffer *PB = SWRAST_CONTEXT(ctx)->PB;
- GLint count = PB->count;
- GLint *pbx = PB->x;
- GLint *pby = PB->y;
- GLdepth *pbz = PB->z;
- GLfloat *pbfog = PB->fog;
- GLchan (*pbrgba)[4] = PB->rgba;
+ struct sw_span span;
+ GLint *x, *y;
+ GLchan (*rgba)[4];
+ ASSERT(ctx->Light.ShadeModel == GL_SMOOTH);
+ ASSERT(!ctx->Line.StippleFlag);
+ ASSERT(ctx->Line.Width == 1.0F);
- PB->mono = GL_FALSE;
+ INIT_SPAN(span, GL_LINE, 0, 0, SPAN_XY | SPAN_RGBA);
+ x = span.array->x;
+ y = span.array->y;
+ rgba = span.array->rgba;
#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_ALPHA 1
-
#define PLOT(X,Y) \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- pbfog[count] = fog0; \
- pbrgba[count][RCOMP] = FixedToInt(r0); \
- pbrgba[count][GCOMP] = FixedToInt(g0); \
- pbrgba[count][BCOMP] = FixedToInt(b0); \
- pbrgba[count][ACOMP] = FixedToInt(a0); \
- count++;
+ { \
+ x[span.end] = X; \
+ y[span.end] = Y; \
+ rgba[span.end][RCOMP] = FixedToInt(r0); \
+ rgba[span.end][GCOMP] = FixedToInt(g0); \
+ rgba[span.end][BCOMP] = FixedToInt(b0); \
+ rgba[span.end][ACOMP] = FixedToInt(a0); \
+ span.end++; \
+ }
#include "s_linetemp.h"
- PB->count = count;
- _mesa_flush_pb(ctx);
+ _mesa_write_rgba_span(ctx, &span);
}
-#define CHECK_FULL(count) \
- if (count >= PB_SIZE-MAX_WIDTH) { \
- PB->count = count; \
- _mesa_flush_pb(ctx); \
- count = PB->count; \
- }
-
-
-
/* Smooth shaded, color index, any width, maybe stippled */
static void general_smooth_ci_line( GLcontext *ctx,
const SWvertex *vert0,
const SWvertex *vert1 )
{
- struct pixel_buffer *PB = SWRAST_CONTEXT(ctx)->PB;
- GLint count = PB->count;
- GLint *pbx = PB->x;
- GLint *pby = PB->y;
- GLdepth *pbz = PB->z;
- GLfloat *pbfog = PB->fog;
- GLuint *pbi = PB->index;
-
- PB->mono = GL_FALSE;
-
- if (ctx->Line.StippleFlag) {
- /* stippled */
+ GLboolean xMajor = GL_FALSE;
+ struct sw_span span;
+ GLint *x, *y;
+ GLdepth *z;
+ GLfloat *fog;
+ GLuint *index;
+
+ ASSERT(ctx->Light.ShadeModel == GL_SMOOTH);
+
+ INIT_SPAN(span, GL_LINE, 0, 0,
+ SPAN_XY | SPAN_Z | SPAN_FOG | SPAN_INDEX);
+ x = span.array->x;
+ y = span.array->y;
+ z = span.array->z;
+ fog = span.array->fog;
+ index = span.array->index;
+
+#define SET_XMAJOR 1
#define INTERP_XY 1
#define INTERP_Z 1
#define INTERP_FOG 1
#define INTERP_INDEX 1
-#define WIDE 1
-#define STIPPLE 1
#define PLOT(X,Y) \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- pbfog[count] = fog0; \
- pbi[count] = I; \
- count++; \
- CHECK_FULL(count);
-#include "s_linetemp.h"
+ { \
+ x[span.end] = X; \
+ y[span.end] = Y; \
+ z[span.end] = Z; \
+ fog[span.end] = fog0; \
+ index[span.end] = I; \
+ span.end++; \
}
- else {
- /* unstippled */
- if (ctx->Line.Width==2.0F) {
- /* special case: unstippled and width=2 */
-#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define INTERP_INDEX 1
-#define XMAJOR_PLOT(X,Y) \
- pbx[count] = X; pbx[count+1] = X; \
- pby[count] = Y; pby[count+1] = Y+1; \
- pbz[count] = Z; pbz[count+1] = Z; \
- pbfog[count] = fog0; pbfog[count+1] = fog0; \
- pbi[count] = I; pbi[count+1] = I; \
- count += 2; \
- CHECK_FULL(count);
-#define YMAJOR_PLOT(X,Y) \
- pbx[count] = X; pbx[count+1] = X+1; \
- pby[count] = Y; pby[count+1] = Y; \
- pbz[count] = Z; pbz[count+1] = Z; \
- pbfog[count] = fog0; pbfog[count+1] = fog0; \
- pbi[count] = I; pbi[count+1] = I; \
- count += 2; \
- CHECK_FULL(count);
-#include "s_linetemp.h"
- }
- else {
- /* unstippled, any width */
-#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define INTERP_INDEX 1
-#define WIDE 1
-#define PLOT(X,Y) \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- pbi[count] = I; \
- pbfog[count] = fog0; \
- count++; \
- CHECK_FULL(count);
#include "s_linetemp.h"
- }
+
+ if (ctx->Line.StippleFlag) {
+ span.arrayMask |= SPAN_MASK;
+ compute_stipple_mask(ctx, span.end, span.array->mask);
}
- PB->count = count;
- _mesa_flush_pb(ctx);
+ if (ctx->Line.Width > 1.0) {
+ draw_wide_line(ctx, &span, xMajor);
+ }
+ else {
+ _mesa_write_index_span(ctx, &span);
+ }
}
@@ -366,73 +325,48 @@ static void general_flat_ci_line( GLcontext *ctx,
const SWvertex *vert0,
const SWvertex *vert1 )
{
- struct pixel_buffer *PB = SWRAST_CONTEXT(ctx)->PB;
- GLint count;
- GLint *pbx = PB->x;
- GLint *pby = PB->y;
- GLdepth *pbz = PB->z;
- GLfloat *pbfog = PB->fog;
- PB_SET_INDEX( PB, vert0->index );
- count = PB->count;
-
- if (ctx->Line.StippleFlag) {
- /* stippled, any width */
+ GLboolean xMajor = GL_FALSE;
+ struct sw_span span;
+ GLint *x, *y;
+ GLdepth *z;
+ GLfloat *fog;
+
+ ASSERT(ctx->Light.ShadeModel == GL_FLAT);
+
+ INIT_SPAN(span, GL_LINE, 0, SPAN_INDEX,
+ SPAN_XY | SPAN_Z | SPAN_FOG);
+ span.index = IntToFixed(vert1->index);
+ span.indexStep = 0;
+ x = span.array->x;
+ y = span.array->y;
+ z = span.array->z;
+ fog = span.array->fog;
+
+#define SET_XMAJOR 1
#define INTERP_XY 1
#define INTERP_Z 1
#define INTERP_FOG 1
-#define WIDE 1
-#define STIPPLE 1
#define PLOT(X,Y) \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- pbfog[count] = fog0; \
- count++; \
- CHECK_FULL(count);
-#include "s_linetemp.h"
+ { \
+ x[span.end] = X; \
+ y[span.end] = Y; \
+ z[span.end] = Z; \
+ fog[span.end] = fog0; \
+ span.end++; \
}
- else {
- /* unstippled */
- if (ctx->Line.Width==2.0F) {
- /* special case: unstippled and width=2 */
-#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define XMAJOR_PLOT(X,Y) \
- pbx[count] = X; pbx[count+1] = X; \
- pby[count] = Y; pby[count+1] = Y+1; \
- pbz[count] = Z; pbz[count+1] = Z; \
- pbfog[count] = fog0; pbfog[count+1] = fog0; \
- count += 2; \
- CHECK_FULL(count);
-#define YMAJOR_PLOT(X,Y) \
- pbx[count] = X; pbx[count+1] = X+1; \
- pby[count] = Y; pby[count+1] = Y; \
- pbz[count] = Z; pbz[count+1] = Z; \
- pbfog[count] = fog0; pbfog[count+1] = fog0; \
- count += 2; \
- CHECK_FULL(count);
#include "s_linetemp.h"
- }
- else {
- /* unstippled, any width */
-#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define WIDE 1
-#define PLOT(X,Y) \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- pbfog[count] = fog0; \
- count++; \
- CHECK_FULL(count);
-#include "s_linetemp.h"
- }
+
+ if (ctx->Line.StippleFlag) {
+ span.arrayMask |= SPAN_MASK;
+ compute_stipple_mask(ctx, span.end, span.array->mask);
}
- PB->count = count;
- _mesa_flush_pb(ctx);
+ if (ctx->Line.Width > 1.0) {
+ draw_wide_line(ctx, &span, xMajor);
+ }
+ else {
+ _mesa_write_index_span(ctx, &span);
+ }
}
@@ -441,104 +375,54 @@ static void general_smooth_rgba_line( GLcontext *ctx,
const SWvertex *vert0,
const SWvertex *vert1 )
{
- struct pixel_buffer *PB = SWRAST_CONTEXT(ctx)->PB;
- GLint count = PB->count;
- GLint *pbx = PB->x;
- GLint *pby = PB->y;
- GLdepth *pbz = PB->z;
- GLfloat *pbfog = PB->fog;
- GLchan (*pbrgba)[4] = PB->rgba;
-
- PB->mono = GL_FALSE;
-
- if (ctx->Line.StippleFlag) {
- /* stippled */
+ GLboolean xMajor = GL_FALSE;
+ struct sw_span span;
+ GLint *x, *y;
+ GLdepth *z;
+ GLchan (*rgba)[4];
+ GLfloat *fog;
+
+ ASSERT(ctx->Light.ShadeModel == GL_SMOOTH);
+
+ INIT_SPAN(span, GL_LINE, 0, 0,
+ SPAN_XY | SPAN_Z | SPAN_FOG | SPAN_RGBA);
+ x = span.array->x;
+ y = span.array->y;
+ z = span.array->z;
+ rgba = span.array->rgba;
+ fog = span.array->fog;
+
+#define SET_XMAJOR 1
#define INTERP_XY 1
#define INTERP_Z 1
#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_ALPHA 1
-#define WIDE 1
-#define STIPPLE 1
#define PLOT(X,Y) \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- pbfog[count] = fog0; \
- pbrgba[count][RCOMP] = FixedToInt(r0); \
- pbrgba[count][GCOMP] = FixedToInt(g0); \
- pbrgba[count][BCOMP] = FixedToInt(b0); \
- pbrgba[count][ACOMP] = FixedToInt(a0); \
- count++; \
- CHECK_FULL(count);
-#include "s_linetemp.h"
+ { \
+ x[span.end] = X; \
+ y[span.end] = Y; \
+ z[span.end] = Z; \
+ rgba[span.end][RCOMP] = FixedToInt(r0); \
+ rgba[span.end][GCOMP] = FixedToInt(g0); \
+ rgba[span.end][BCOMP] = FixedToInt(b0); \
+ rgba[span.end][ACOMP] = FixedToInt(a0); \
+ fog[span.end] = fog0; \
+ span.end++; \
}
- else {
- /* unstippled */
- if (ctx->Line.Width==2.0F) {
- /* special case: unstippled and width=2 */
-#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define INTERP_RGB 1
-#define INTERP_ALPHA 1
-#define XMAJOR_PLOT(X,Y) \
- pbx[count] = X; pbx[count+1] = X; \
- pby[count] = Y; pby[count+1] = Y+1; \
- pbz[count] = Z; pbz[count+1] = Z; \
- pbfog[count] = fog0; pbfog[count+1] = fog0; \
- pbrgba[count][RCOMP] = FixedToInt(r0); \
- pbrgba[count][GCOMP] = FixedToInt(g0); \
- pbrgba[count][BCOMP] = FixedToInt(b0); \
- pbrgba[count][ACOMP] = FixedToInt(a0); \
- pbrgba[count+1][RCOMP] = FixedToInt(r0); \
- pbrgba[count+1][GCOMP] = FixedToInt(g0); \
- pbrgba[count+1][BCOMP] = FixedToInt(b0); \
- pbrgba[count+1][ACOMP] = FixedToInt(a0); \
- count += 2; \
- CHECK_FULL(count);
-#define YMAJOR_PLOT(X,Y) \
- pbx[count] = X; pbx[count+1] = X+1; \
- pby[count] = Y; pby[count+1] = Y; \
- pbz[count] = Z; pbz[count+1] = Z; \
- pbfog[count] = fog0; pbfog[count+1] = fog0; \
- pbrgba[count][RCOMP] = FixedToInt(r0); \
- pbrgba[count][GCOMP] = FixedToInt(g0); \
- pbrgba[count][BCOMP] = FixedToInt(b0); \
- pbrgba[count][ACOMP] = FixedToInt(a0); \
- pbrgba[count+1][RCOMP] = FixedToInt(r0); \
- pbrgba[count+1][GCOMP] = FixedToInt(g0); \
- pbrgba[count+1][BCOMP] = FixedToInt(b0); \
- pbrgba[count+1][ACOMP] = FixedToInt(a0); \
- count += 2; \
- CHECK_FULL(count);
-#include "s_linetemp.h"
- }
- else {
- /* unstippled, any width */
-#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define INTERP_RGB 1
-#define INTERP_ALPHA 1
-#define WIDE 1
-#define PLOT(X,Y) \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- pbfog[count] = fog0; \
- pbrgba[count][RCOMP] = FixedToInt(r0); \
- pbrgba[count][GCOMP] = FixedToInt(g0); \
- pbrgba[count][BCOMP] = FixedToInt(b0); \
- pbrgba[count][ACOMP] = FixedToInt(a0); \
- count++; \
- CHECK_FULL(count);
#include "s_linetemp.h"
- }
+
+ if (ctx->Line.StippleFlag) {
+ span.arrayMask |= SPAN_MASK;
+ compute_stipple_mask(ctx, span.end, span.array->mask);
}
- PB->count = count;
- _mesa_flush_pb(ctx);
+ if (ctx->Line.Width > 1.0) {
+ draw_wide_line(ctx, &span, xMajor);
+ }
+ else {
+ _mesa_write_rgba_span(ctx, &span);
+ }
}
@@ -546,52 +430,54 @@ static void general_flat_rgba_line( GLcontext *ctx,
const SWvertex *vert0,
const SWvertex *vert1 )
{
- struct pixel_buffer *PB = SWRAST_CONTEXT(ctx)->PB;
- const GLchan *color = vert1->color;
- GLuint count;
- PB_SET_COLOR( PB, color[0], color[1], color[2], color[3] );
-
- if (ctx->Line.StippleFlag) {
- /* stippled */
+ GLboolean xMajor = GL_FALSE;
+ struct sw_span span;
+ GLint *x, *y;
+ GLdepth *z;
+ GLfloat *fog;
+
+ ASSERT(ctx->Light.ShadeModel == GL_FLAT);
+
+ INIT_SPAN(span, GL_LINE, 0, SPAN_RGBA,
+ SPAN_XY | SPAN_Z | SPAN_FOG);
+ span.red = ChanToFixed(vert1->color[0]);
+ span.green = ChanToFixed(vert1->color[1]);
+ span.blue = ChanToFixed(vert1->color[2]);
+ span.alpha = ChanToFixed(vert1->color[3]);
+ span.redStep = 0;
+ span.greenStep = 0;
+ span.blueStep = 0;
+ span.alphaStep = 0;
+ x = span.array->x;
+ y = span.array->y;
+ z = span.array->z;
+ fog = span.array->fog;
+
+#define SET_XMAJOR 1
#define INTERP_XY 1
#define INTERP_Z 1
#define INTERP_FOG 1
-#define WIDE 1
-#define STIPPLE 1
-#define PLOT(X,Y) \
- PB_WRITE_PIXEL(PB, X, Y, Z, fog0); \
- count = PB->count; \
- CHECK_FULL(count);
-#include "s_linetemp.h"
+#define PLOT(X,Y) \
+ { \
+ x[span.end] = X; \
+ y[span.end] = Y; \
+ z[span.end] = Z; \
+ fog[span.end] = fog0; \
+ span.end++; \
}
- else {
- /* unstippled */
- if (ctx->Line.Width==2.0F) {
- /* special case: unstippled and width=2 */
-#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define XMAJOR_PLOT(X,Y) PB_WRITE_PIXEL(PB, X, Y, Z, fog0); \
- PB_WRITE_PIXEL(PB, X, Y+1, Z, fog0);
-#define YMAJOR_PLOT(X,Y) PB_WRITE_PIXEL(PB, X, Y, Z, fog0); \
- PB_WRITE_PIXEL(PB, X+1, Y, Z, fog0);
#include "s_linetemp.h"
- }
- else {
- /* unstippled, any width */
-#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define WIDE 1
-#define PLOT(X,Y) \
- PB_WRITE_PIXEL(PB, X, Y, Z, fog0); \
- count = PB->count; \
- CHECK_FULL(count);
-#include "s_linetemp.h"
- }
+
+ if (ctx->Line.StippleFlag) {
+ span.arrayMask |= SPAN_MASK;
+ compute_stipple_mask(ctx, span.end, span.array->mask);
}
- _mesa_flush_pb(ctx);
+ if (ctx->Line.Width > 1.0) {
+ draw_wide_line(ctx, &span, xMajor);
+ }
+ else {
+ _mesa_write_rgba_span(ctx, &span);
+ }
}
@@ -600,65 +486,58 @@ static void flat_textured_line( GLcontext *ctx,
const SWvertex *vert0,
const SWvertex *vert1 )
{
- struct pixel_buffer *PB = SWRAST_CONTEXT(ctx)->PB;
- GLint count;
- GLint *pbx = PB->x;
- GLint *pby = PB->y;
- GLdepth *pbz = PB->z;
- GLfloat *pbfog = PB->fog;
- GLfloat *pbs = PB->s[0];
- GLfloat *pbt = PB->t[0];
- GLfloat *pbu = PB->u[0];
- GLchan *color = (GLchan*) vert1->color;
- PB_SET_COLOR( PB, color[0], color[1], color[2], color[3] );
- count = PB->count;
-
- if (ctx->Line.StippleFlag) {
- /* stippled */
+ GLboolean xMajor = GL_FALSE;
+ struct sw_span span;
+
+ ASSERT(ctx->Light.ShadeModel == GL_FLAT);
+
+ INIT_SPAN(span, GL_LINE, 0, SPAN_RGBA | SPAN_SPEC,
+ SPAN_XY | SPAN_Z | SPAN_FOG | SPAN_TEXTURE | SPAN_LAMBDA);
+ span.red = ChanToFixed(vert1->color[0]);
+ span.green = ChanToFixed(vert1->color[1]);
+ span.blue = ChanToFixed(vert1->color[2]);
+ span.alpha = ChanToFixed(vert1->color[3]);
+ span.redStep = 0;
+ span.greenStep = 0;
+ span.blueStep = 0;
+ span.alphaStep = 0;
+ span.specRed = ChanToFixed(vert1->specular[0]);
+ span.specGreen = ChanToFixed(vert1->specular[1]);
+ span.specBlue = ChanToFixed(vert1->specular[2]);
+ span.specRedStep = 0;
+ span.specGreenStep = 0;
+ span.specBlueStep = 0;
+
+#define SET_XMAJOR 1
#define INTERP_XY 1
#define INTERP_Z 1
#define INTERP_FOG 1
#define INTERP_TEX 1
-#define WIDE 1
-#define STIPPLE 1
-#define PLOT(X,Y) \
- { \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- pbfog[count] = fog0; \
- pbs[count] = fragTexcoord[0];\
- pbt[count] = fragTexcoord[1];\
- pbu[count] = fragTexcoord[2];\
- count++; \
- CHECK_FULL(count); \
- }
-#include "s_linetemp.h"
+#define PLOT(X,Y) \
+ { \
+ span.array->x[span.end] = X; \
+ span.array->y[span.end] = Y; \
+ span.array->z[span.end] = Z; \
+ span.array->fog[span.end] = fog0; \
+ span.array->texcoords[0][span.end][0] = fragTexcoord[0]; \
+ span.array->texcoords[0][span.end][1] = fragTexcoord[1]; \
+ span.array->texcoords[0][span.end][2] = fragTexcoord[2]; \
+ span.array->lambda[0][span.end] = 0.0; \
+ span.end++; \
}
- else {
- /* unstippled */
-#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define INTERP_TEX 1
-#define WIDE 1
-#define PLOT(X,Y) \
- { \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- pbfog[count] = fog0; \
- pbs[count] = fragTexcoord[0];\
- pbt[count] = fragTexcoord[1];\
- pbu[count] = fragTexcoord[2];\
- count++; \
- CHECK_FULL(count); \
- }
#include "s_linetemp.h"
+
+ if (ctx->Line.StippleFlag) {
+ span.arrayMask |= SPAN_MASK;
+ compute_stipple_mask(ctx, span.end, span.array->mask);
}
- PB->count = count;
- _mesa_flush_pb(ctx);
+ if (ctx->Line.Width > 1.0) {
+ draw_wide_line(ctx, &span, xMajor);
+ }
+ else {
+ _mesa_write_texture_span(ctx, &span);
+ }
}
@@ -668,77 +547,50 @@ static void smooth_textured_line( GLcontext *ctx,
const SWvertex *vert0,
const SWvertex *vert1 )
{
- struct pixel_buffer *PB = SWRAST_CONTEXT(ctx)->PB;
- GLint count = PB->count;
- GLint *pbx = PB->x;
- GLint *pby = PB->y;
- GLdepth *pbz = PB->z;
- GLfloat *pbfog = PB->fog;
- GLfloat *pbs = PB->s[0];
- GLfloat *pbt = PB->t[0];
- GLfloat *pbu = PB->u[0];
- GLchan (*pbrgba)[4] = PB->rgba;
-
- PB->mono = GL_FALSE;
+ GLboolean xMajor = GL_FALSE;
+ struct sw_span span;
- if (ctx->Line.StippleFlag) {
- /* stippled */
+ ASSERT(ctx->Light.ShadeModel == GL_SMOOTH);
+
+ INIT_SPAN(span, GL_LINE, 0, 0,
+ SPAN_XY | SPAN_Z | SPAN_FOG | SPAN_RGBA | SPAN_TEXTURE | SPAN_LAMBDA);
+
+#define SET_XMAJOR 1
#define INTERP_XY 1
#define INTERP_Z 1
#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_ALPHA 1
#define INTERP_TEX 1
-#define WIDE 1
-#define STIPPLE 1
-#define PLOT(X,Y) \
- { \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- pbfog[count] = fog0; \
- pbs[count] = fragTexcoord[0]; \
- pbt[count] = fragTexcoord[1]; \
- pbu[count] = fragTexcoord[2]; \
- pbrgba[count][RCOMP] = FixedToInt(r0); \
- pbrgba[count][GCOMP] = FixedToInt(g0); \
- pbrgba[count][BCOMP] = FixedToInt(b0); \
- pbrgba[count][ACOMP] = FixedToInt(a0); \
- count++; \
- CHECK_FULL(count); \
- }
-#include "s_linetemp.h"
+#define PLOT(X,Y) \
+ { \
+ span.array->x[span.end] = X; \
+ span.array->y[span.end] = Y; \
+ span.array->z[span.end] = Z; \
+ span.array->fog[span.end] = fog0; \
+ span.array->rgba[span.end][RCOMP] = FixedToInt(r0); \
+ span.array->rgba[span.end][GCOMP] = FixedToInt(g0); \
+ span.array->rgba[span.end][BCOMP] = FixedToInt(b0); \
+ span.array->rgba[span.end][ACOMP] = FixedToInt(a0); \
+ span.array->texcoords[0][span.end][0] = fragTexcoord[0]; \
+ span.array->texcoords[0][span.end][1] = fragTexcoord[1]; \
+ span.array->texcoords[0][span.end][2] = fragTexcoord[2]; \
+ span.array->lambda[0][span.end] = 0.0; \
+ span.end++; \
}
- else {
- /* unstippled */
-#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define INTERP_RGB 1
-#define INTERP_ALPHA 1
-#define INTERP_TEX 1
-#define WIDE 1
-#define PLOT(X,Y) \
- { \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- pbfog[count] = fog0; \
- pbs[count] = fragTexcoord[0]; \
- pbt[count] = fragTexcoord[1]; \
- pbu[count] = fragTexcoord[2]; \
- pbrgba[count][RCOMP] = FixedToInt(r0); \
- pbrgba[count][GCOMP] = FixedToInt(g0); \
- pbrgba[count][BCOMP] = FixedToInt(b0); \
- pbrgba[count][ACOMP] = FixedToInt(a0); \
- count++; \
- CHECK_FULL(count); \
- }
#include "s_linetemp.h"
+
+ if (ctx->Line.StippleFlag) {
+ span.arrayMask |= SPAN_MASK;
+ compute_stipple_mask(ctx, span.end, span.array->mask);
}
- PB->count = count;
- _mesa_flush_pb(ctx);
+ if (ctx->Line.Width > 1.0) {
+ draw_wide_line(ctx, &span, xMajor);
+ }
+ else {
+ _mesa_write_texture_span(ctx, &span);
+ }
}
@@ -749,20 +601,16 @@ static void smooth_multitextured_line( GLcontext *ctx,
const SWvertex *vert0,
const SWvertex *vert1 )
{
- struct pixel_buffer *PB = SWRAST_CONTEXT(ctx)->PB;
- GLint count = PB->count;
- GLint *pbx = PB->x;
- GLint *pby = PB->y;
- GLdepth *pbz = PB->z;
- GLfloat *pbfog = PB->fog;
- GLchan (*pbrgba)[4] = PB->rgba;
- GLchan (*pbspec)[3] = PB->spec;
-
- PB->mono = GL_FALSE;
- PB->haveSpec = GL_TRUE;
+ GLboolean xMajor = GL_FALSE;
+ struct sw_span span;
+ GLuint u;
- if (ctx->Line.StippleFlag) {
- /* stippled */
+ ASSERT(ctx->Light.ShadeModel == GL_SMOOTH);
+
+ INIT_SPAN(span, GL_LINE, 0, 0,
+ SPAN_XY | SPAN_Z | SPAN_FOG | SPAN_RGBA | SPAN_SPEC | SPAN_TEXTURE | SPAN_LAMBDA);
+
+#define SET_XMAJOR 1
#define INTERP_XY 1
#define INTERP_Z 1
#define INTERP_FOG 1
@@ -770,73 +618,42 @@ static void smooth_multitextured_line( GLcontext *ctx,
#define INTERP_SPEC 1
#define INTERP_ALPHA 1
#define INTERP_MULTITEX 1
-#define WIDE 1
-#define STIPPLE 1
-#define PLOT(X,Y) \
- { \
- GLuint u; \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- pbfog[count] = fog0; \
- pbrgba[count][RCOMP] = FixedToInt(r0); \
- pbrgba[count][GCOMP] = FixedToInt(g0); \
- pbrgba[count][BCOMP] = FixedToInt(b0); \
- pbrgba[count][ACOMP] = FixedToInt(a0); \
- pbspec[count][RCOMP] = FixedToInt(sr0); \
- pbspec[count][GCOMP] = FixedToInt(sg0); \
- pbspec[count][BCOMP] = FixedToInt(sb0); \
- for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { \
- if (ctx->Texture.Unit[u]._ReallyEnabled) { \
- PB->s[u][count] = fragTexcoord[u][0]; \
- PB->t[u][count] = fragTexcoord[u][1]; \
- PB->u[u][count] = fragTexcoord[u][2]; \
- } \
- } \
- count++; \
- CHECK_FULL(count); \
- }
-#include "s_linetemp.h"
+#define PLOT(X,Y) \
+ { \
+ span.array->x[span.end] = X; \
+ span.array->y[span.end] = Y; \
+ span.array->z[span.end] = Z; \
+ span.array->fog[span.end] = fog0; \
+ span.array->rgba[span.end][RCOMP] = FixedToInt(r0); \
+ span.array->rgba[span.end][GCOMP] = FixedToInt(g0); \
+ span.array->rgba[span.end][BCOMP] = FixedToInt(b0); \
+ span.array->rgba[span.end][ACOMP] = FixedToInt(a0); \
+ span.array->spec[span.end][RCOMP] = FixedToInt(sr0); \
+ span.array->spec[span.end][GCOMP] = FixedToInt(sg0); \
+ span.array->spec[span.end][BCOMP] = FixedToInt(sb0); \
+ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { \
+ if (ctx->Texture.Unit[u]._ReallyEnabled) { \
+ span.array->texcoords[u][span.end][0] = fragTexcoord[u][0]; \
+ span.array->texcoords[u][span.end][1] = fragTexcoord[u][1]; \
+ span.array->texcoords[u][span.end][2] = fragTexcoord[u][2]; \
+ span.array->lambda[u][span.end] = 0.0; \
+ } \
+ } \
+ span.end++; \
}
- else {
- /* unstippled */
-#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define INTERP_RGB 1
-#define INTERP_SPEC 1
-#define INTERP_ALPHA 1
-#define INTERP_MULTITEX 1
-#define WIDE 1
-#define PLOT(X,Y) \
- { \
- GLuint u; \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- pbfog[count] = fog0; \
- pbrgba[count][RCOMP] = FixedToInt(r0); \
- pbrgba[count][GCOMP] = FixedToInt(g0); \
- pbrgba[count][BCOMP] = FixedToInt(b0); \
- pbrgba[count][ACOMP] = FixedToInt(a0); \
- pbspec[count][RCOMP] = FixedToInt(sr0); \
- pbspec[count][GCOMP] = FixedToInt(sg0); \
- pbspec[count][BCOMP] = FixedToInt(sb0); \
- for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { \
- if (ctx->Texture.Unit[u]._ReallyEnabled) { \
- PB->s[u][count] = fragTexcoord[u][0]; \
- PB->t[u][count] = fragTexcoord[u][1]; \
- PB->u[u][count] = fragTexcoord[u][2]; \
- } \
- } \
- count++; \
- CHECK_FULL(count); \
- }
#include "s_linetemp.h"
+
+ if (ctx->Line.StippleFlag) {
+ span.arrayMask |= SPAN_MASK;
+ compute_stipple_mask(ctx, span.end, span.array->mask);
}
- PB->count = count;
- _mesa_flush_pb(ctx);
+ if (ctx->Line.Width > 1.0) {
+ draw_wide_line(ctx, &span, xMajor);
+ }
+ else {
+ _mesa_write_texture_span(ctx, &span);
+ }
}
@@ -847,94 +664,63 @@ static void flat_multitextured_line( GLcontext *ctx,
const SWvertex *vert0,
const SWvertex *vert1 )
{
- struct pixel_buffer *PB = SWRAST_CONTEXT(ctx)->PB;
- GLint count = PB->count;
- GLint *pbx = PB->x;
- GLint *pby = PB->y;
- GLdepth *pbz = PB->z;
- GLfloat *pbfog = PB->fog;
- GLchan (*pbrgba)[4] = PB->rgba;
- GLchan (*pbspec)[3] = PB->spec;
- GLchan *color = (GLchan*) vert1->color;
- GLchan sRed = vert1->specular[0];
- GLchan sGreen = vert1->specular[1];
- GLchan sBlue = vert1->specular[2];
-
- PB->mono = GL_FALSE;
- PB->haveSpec = GL_TRUE;
-
- if (ctx->Line.StippleFlag) {
- /* stippled */
+ GLboolean xMajor = GL_FALSE;
+ struct sw_span span;
+ GLuint u;
+
+ ASSERT(ctx->Light.ShadeModel == GL_FLAT);
+
+ INIT_SPAN(span, GL_LINE, 0, SPAN_RGBA | SPAN_SPEC,
+ SPAN_XY | SPAN_Z | SPAN_FOG | SPAN_TEXTURE | SPAN_LAMBDA);
+ span.red = ChanToFixed(vert1->color[0]);
+ span.green = ChanToFixed(vert1->color[1]);
+ span.blue = ChanToFixed(vert1->color[2]);
+ span.alpha = ChanToFixed(vert1->color[3]);
+ span.redStep = 0;
+ span.greenStep = 0;
+ span.blueStep = 0;
+ span.alphaStep = 0;
+ span.specRed = ChanToFixed(vert1->specular[0]);
+ span.specGreen = ChanToFixed(vert1->specular[1]);
+ span.specBlue = ChanToFixed(vert1->specular[2]);
+ span.specRedStep = 0;
+ span.specGreenStep = 0;
+ span.specBlueStep = 0;
+
+#define SET_XMAJOR 1
#define INTERP_XY 1
#define INTERP_Z 1
#define INTERP_FOG 1
-#define INTERP_ALPHA 1
#define INTERP_MULTITEX 1
-#define WIDE 1
-#define STIPPLE 1
-#define PLOT(X,Y) \
- { \
- GLuint u; \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- pbfog[count] = fog0; \
- pbrgba[count][RCOMP] = color[0]; \
- pbrgba[count][GCOMP] = color[1]; \
- pbrgba[count][BCOMP] = color[2]; \
- pbrgba[count][ACOMP] = color[3]; \
- pbspec[count][RCOMP] = sRed; \
- pbspec[count][GCOMP] = sGreen; \
- pbspec[count][BCOMP] = sBlue; \
- for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { \
- if (ctx->Texture.Unit[u]._ReallyEnabled) { \
- PB->s[u][count] = fragTexcoord[u][0]; \
- PB->t[u][count] = fragTexcoord[u][1]; \
- PB->u[u][count] = fragTexcoord[u][2]; \
- } \
- } \
- count++; \
- CHECK_FULL(count); \
- }
-#include "s_linetemp.h"
+#define PLOT(X,Y) \
+ { \
+ span.array->x[span.end] = X; \
+ span.array->y[span.end] = Y; \
+ span.array->z[span.end] = Z; \
+ span.array->fog[span.end] = fog0; \
+ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { \
+ if (ctx->Texture.Unit[u]._ReallyEnabled) { \
+ span.array->texcoords[u][span.end][0] = fragTexcoord[u][0]; \
+ span.array->texcoords[u][span.end][1] = fragTexcoord[u][1]; \
+ span.array->texcoords[u][span.end][2] = fragTexcoord[u][2]; \
+ span.array->lambda[u][span.end] = 0.0; \
+ } \
+ } \
+ span.end++; \
}
- else {
- /* unstippled */
-#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define INTERP_ALPHA 1
-#define INTERP_MULTITEX 1
-#define WIDE 1
-#define PLOT(X,Y) \
- { \
- GLuint u; \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- pbfog[count] = fog0; \
- pbrgba[count][RCOMP] = color[0]; \
- pbrgba[count][GCOMP] = color[1]; \
- pbrgba[count][BCOMP] = color[2]; \
- pbrgba[count][ACOMP] = color[3]; \
- pbspec[count][RCOMP] = sRed; \
- pbspec[count][GCOMP] = sGreen; \
- pbspec[count][BCOMP] = sBlue; \
- for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { \
- if (ctx->Texture.Unit[u]._ReallyEnabled) { \
- PB->s[u][count] = fragTexcoord[u][0]; \
- PB->t[u][count] = fragTexcoord[u][1]; \
- PB->u[u][count] = fragTexcoord[u][2]; \
- } \
- } \
- count++; \
- CHECK_FULL(count); \
- }
#include "s_linetemp.h"
+
+ if (ctx->Line.StippleFlag) {
+ span.arrayMask |= SPAN_MASK;
+ compute_stipple_mask(ctx, span.end, span.array->mask);
}
- PB->count = count;
- _mesa_flush_pb(ctx);
+ if (ctx->Line.Width > 1.0) {
+ draw_wide_line(ctx, &span, xMajor);
+ }
+ else {
+ _mesa_write_texture_span(ctx, &span);
+ }
}
@@ -963,41 +749,33 @@ _mesa_print_line_function(GLcontext *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- printf("Line Func == ");
+ _mesa_printf("Line Func == ");
if (swrast->Line == flat_ci_line)
- printf("flat_ci_line\n");
- else if (swrast->Line == flat_ci_z_line)
- printf("flat_ci_z_line\n");
+ _mesa_printf("flat_ci_line\n");
else if (swrast->Line == flat_rgba_line)
- printf("flat_rgba_line\n");
- else if (swrast->Line == flat_rgba_z_line)
- printf("flat_rgba_z_line\n");
+ _mesa_printf("flat_rgba_line\n");
else if (swrast->Line == smooth_ci_line)
- printf("smooth_ci_line\n");
- else if (swrast->Line == smooth_ci_z_line)
- printf("smooth_ci_z_line\n");
+ _mesa_printf("smooth_ci_line\n");
else if (swrast->Line == smooth_rgba_line)
- printf("smooth_rgba_line\n");
- else if (swrast->Line == smooth_rgba_z_line)
- printf("smooth_rgba_z_line\n");
+ _mesa_printf("smooth_rgba_line\n");
else if (swrast->Line == general_smooth_ci_line)
- printf("general_smooth_ci_line\n");
+ _mesa_printf("general_smooth_ci_line\n");
else if (swrast->Line == general_flat_ci_line)
- printf("general_flat_ci_line\n");
+ _mesa_printf("general_flat_ci_line\n");
else if (swrast->Line == general_smooth_rgba_line)
- printf("general_smooth_rgba_line\n");
+ _mesa_printf("general_smooth_rgba_line\n");
else if (swrast->Line == general_flat_rgba_line)
- printf("general_flat_rgba_line\n");
+ _mesa_printf("general_flat_rgba_line\n");
else if (swrast->Line == flat_textured_line)
- printf("flat_textured_line\n");
+ _mesa_printf("flat_textured_line\n");
else if (swrast->Line == smooth_textured_line)
- printf("smooth_textured_line\n");
+ _mesa_printf("smooth_textured_line\n");
else if (swrast->Line == smooth_multitextured_line)
- printf("smooth_multitextured_line\n");
+ _mesa_printf("smooth_multitextured_line\n");
else if (swrast->Line == flat_multitextured_line)
- printf("flat_multitextured_line\n");
+ _mesa_printf("flat_multitextured_line\n");
else
- printf("Driver func %p\n", (void *) swrast->Line);
+ _mesa_printf("Driver func %p\n", (void *) swrast->Line);
}
#endif
@@ -1011,7 +789,7 @@ static const char *lineFuncName = NULL;
#define USE(lineFunc) \
do { \
lineFuncName = #lineFunc; \
- /*printf("%s\n", lineFuncName);*/ \
+ /*_mesa_printf("%s\n", lineFuncName);*/ \
swrast->Line = lineFunc; \
} while (0)
@@ -1036,23 +814,23 @@ _swrast_choose_line( GLcontext *ctx )
SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLboolean rgbmode = ctx->Visual.rgbMode;
- if (ctx->RenderMode==GL_RENDER) {
+ if (ctx->RenderMode == GL_RENDER) {
if (ctx->Line.SmoothFlag) {
/* antialiased lines */
_swrast_choose_aa_line_function(ctx);
ASSERT(swrast->Triangle);
}
- else if (ctx->Texture._ReallyEnabled) {
- if (ctx->Texture._ReallyEnabled > TEXTURE0_ANY ||
+ else if (ctx->Texture._EnabledUnits) {
+ if (ctx->Texture._EnabledUnits > 1 ||
(ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)) {
/* multi-texture and/or separate specular color */
- if (ctx->Light.ShadeModel==GL_SMOOTH)
+ if (ctx->Light.ShadeModel == GL_SMOOTH)
USE(smooth_multitextured_line);
else
USE(flat_multitextured_line);
}
else {
- if (ctx->Light.ShadeModel==GL_SMOOTH) {
+ if (ctx->Light.ShadeModel == GL_SMOOTH) {
USE(smooth_textured_line);
}
else {
@@ -1060,28 +838,14 @@ _swrast_choose_line( GLcontext *ctx )
}
}
}
- else if (ctx->Line.Width!=1.0 || ctx->Line.StippleFlag) {
- if (ctx->Light.ShadeModel==GL_SMOOTH) {
- if (rgbmode)
- USE(general_smooth_rgba_line);
- else
- USE(general_smooth_ci_line);
- }
- else {
- if (rgbmode)
- USE(general_flat_rgba_line);
- else
- USE(general_flat_ci_line);
- }
- }
else {
- if (ctx->Light.ShadeModel==GL_SMOOTH) {
- /* Width==1, non-stippled, smooth-shaded */
- if (ctx->Depth.Test || ctx->Fog.Enabled) {
+ if (ctx->Light.ShadeModel == GL_SMOOTH) {
+ if (ctx->Depth.Test || ctx->Fog.Enabled || ctx->Line.Width != 1.0
+ || ctx->Line.StippleFlag) {
if (rgbmode)
- USE(smooth_rgba_z_line);
+ USE(general_smooth_rgba_line);
else
- USE(smooth_ci_z_line);
+ USE(general_smooth_ci_line);
}
else {
if (rgbmode)
@@ -1091,12 +855,12 @@ _swrast_choose_line( GLcontext *ctx )
}
}
else {
- /* Width==1, non-stippled, flat-shaded */
- if (ctx->Depth.Test || ctx->Fog.Enabled) {
+ if (ctx->Depth.Test || ctx->Fog.Enabled || ctx->Line.Width != 1.0
+ || ctx->Line.StippleFlag) {
if (rgbmode)
- USE(flat_rgba_z_line);
+ USE(general_flat_rgba_line);
else
- USE(flat_ci_z_line);
+ USE(general_flat_ci_line);
}
else {
if (rgbmode)
@@ -1107,11 +871,11 @@ _swrast_choose_line( GLcontext *ctx )
}
}
}
- else if (ctx->RenderMode==GL_FEEDBACK) {
+ else if (ctx->RenderMode == GL_FEEDBACK) {
USE(_mesa_feedback_line);
}
else {
- /* GL_SELECT mode */
+ ASSERT(ctx->RenderMode == GL_SELECT);
USE(_mesa_select_line);
}
diff --git a/xc/extras/Mesa/src/swrast/s_linetemp.h b/xc/extras/Mesa/src/swrast/s_linetemp.h
index c5e7984c5..9c7541315 100644
--- a/xc/extras/Mesa/src/swrast/s_linetemp.h
+++ b/xc/extras/Mesa/src/swrast/s_linetemp.h
@@ -1,8 +1,7 @@
-/* $Id: s_linetemp.h,v 1.1.1.1 2002/10/22 13:06:55 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.2
+ * Version: 5.0
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -56,11 +55,7 @@
* Optionally, one may provide one-time setup code
* SETUP_CODE - code which is to be executed once per line
*
- * To enable line stippling define STIPPLE = 1
- * To enable wide lines define WIDE = 1
- *
- * To actually "plot" each pixel either the PLOT macro or
- * (XMAJOR_PLOT and YMAJOR_PLOT macros) must be defined...
+ * To actually "plot" each pixel the PLOT macro must be defined...
* PLOT(X,Y) - code to plot a pixel. Example:
* if (Z < *zPtr) {
* *zPtr = Z;
@@ -140,16 +135,6 @@
PIXEL_TYPE *pixelPtr;
GLint pixelXstep, pixelYstep;
#endif
-#ifdef STIPPLE
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
-#endif
-#ifdef WIDE
- /* for wide lines, draw all X in [x+min, x+max] or Y in [y+min, y+max] */
- GLint width, min, max;
- width = (GLint) CLAMP( ctx->Line.Width, MIN_LINE_WIDTH, MAX_LINE_WIDTH );
- min = (width-1) / -2;
- max = min + width - 1;
-#endif
#ifdef INTERP_TEX
{
tex[0] = invw0 * vert0->texcoord[0][0];
@@ -188,6 +173,19 @@
return;
}
+ /*
+ printf("%s():\n", __FUNCTION__);
+ printf(" (%f, %f, %f) -> (%f, %f, %f)\n",
+ vert0->win[0], vert0->win[1], vert0->win[2],
+ vert1->win[0], vert1->win[1], vert1->win[2]);
+ printf(" (%d, %d, %d) -> (%d, %d, %d)\n",
+ vert0->color[0], vert0->color[1], vert0->color[2],
+ vert1->color[0], vert1->color[1], vert1->color[2]);
+ printf(" (%d, %d, %d) -> (%d, %d, %d)\n",
+ vert0->specular[0], vert0->specular[1], vert0->specular[2],
+ vert1->specular[0], vert1->specular[1], vert1->specular[2]);
+ */
+
/*
* Despite being clipped to the view volume, the line's window coordinates
* may just lie outside the window bounds. That is, if the legal window
@@ -231,8 +229,8 @@
zPtr = (DEPTH_TYPE *) _mesa_zbuffer_address(ctx, x0, y0);
# endif
if (depthBits <= 16) {
- z0 = FloatToFixed(vert0->win[2]);
- z1 = FloatToFixed(vert1->win[2]);
+ z0 = FloatToFixed(vert0->win[2]) + FIXED_HALF;
+ z1 = FloatToFixed(vert1->win[2]) + FIXED_HALF;
}
else {
z0 = (int) vert0->win[2];
@@ -301,6 +299,9 @@
GLint errorInc = dy+dy;
GLint error = errorInc-dx;
GLint errorDec = error-dx;
+#ifdef SET_XMAJOR
+ xMajor = GL_TRUE;
+#endif
#ifdef INTERP_Z
dz = (z1-z0) / dx;
#endif
@@ -348,11 +349,6 @@
#endif
for (i=0;i<dx;i++) {
-#ifdef STIPPLE
- GLushort m;
- m = 1 << ((swrast->StippleCounter/ctx->Line.StippleFactor) & 0xf);
- if (ctx->Line.StipplePattern & m) {
-#endif
#ifdef INTERP_Z
GLdepth Z = FixedToDepth(z0);
#endif
@@ -382,26 +378,9 @@
}
}
#endif
-#ifdef WIDE
- {
- GLint yy;
- GLint ymin = y0 + min;
- GLint ymax = y0 + max;
- for (yy=ymin;yy<=ymax;yy++) {
- PLOT( x0, yy );
- }
- }
-#else
-# ifdef XMAJOR_PLOT
- XMAJOR_PLOT( x0, y0 );
-# else
+
PLOT( x0, y0 );
-# endif
-#endif /*WIDE*/
-#ifdef STIPPLE
- }
- swrast->StippleCounter++;
-#endif
+
#ifdef INTERP_XY
x0 += xstep;
#endif
@@ -523,11 +502,6 @@
#endif
for (i=0;i<dy;i++) {
-#ifdef STIPPLE
- GLushort m;
- m = 1 << ((swrast->StippleCounter/ctx->Line.StippleFactor) & 0xf);
- if (ctx->Line.StipplePattern & m) {
-#endif
#ifdef INTERP_Z
GLdepth Z = FixedToDepth(z0);
#endif
@@ -557,26 +531,9 @@
}
}
#endif
-#ifdef WIDE
- {
- GLint xx;
- GLint xmin = x0 + min;
- GLint xmax = x0 + max;
- for (xx=xmin;xx<=xmax;xx++) {
- PLOT( xx, y0 );
- }
- }
-#else
-# ifdef YMAJOR_PLOT
- YMAJOR_PLOT( x0, y0 );
-# else
+
PLOT( x0, y0 );
-# endif
-#endif /*WIDE*/
-#ifdef STIPPLE
- }
- swrast->StippleCounter++;
-#endif
+
#ifdef INTERP_XY
y0 += ystep;
#endif
@@ -663,9 +620,6 @@
#undef BYTES_PER_ROW
#undef SETUP_CODE
#undef PLOT
-#undef XMAJOR_PLOT
-#undef YMAJOR_PLOT
#undef CLIP_HACK
-#undef STIPPLE
-#undef WIDE
#undef FixedToDepth
+#undef SET_XMAJOR
diff --git a/xc/extras/Mesa/src/swrast/s_logic.c b/xc/extras/Mesa/src/swrast/s_logic.c
index 3521418bf..4f5b3b387 100644
--- a/xc/extras/Mesa/src/swrast/s_logic.c
+++ b/xc/extras/Mesa/src/swrast/s_logic.c
@@ -1,10 +1,9 @@
-/* $Id: s_logic.c,v 1.1.1.1 2002/10/22 13:06:51 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -27,12 +26,12 @@
#include "glheader.h"
#include "context.h"
+#include "imports.h"
#include "macros.h"
#include "s_alphabuf.h"
#include "s_context.h"
#include "s_logic.h"
-#include "s_pb.h"
#include "s_span.h"
@@ -40,9 +39,9 @@
/*
* Apply logic op to array of CI pixels.
*/
-static void index_logicop( GLcontext *ctx, GLuint n,
- GLuint index[], const GLuint dest[],
- const GLubyte mask[] )
+static void
+index_logicop( GLcontext *ctx, GLuint n, GLuint index[], const GLuint dest[],
+ const GLubyte mask[] )
{
GLuint i;
switch (ctx->Color.LogicOp) {
@@ -166,32 +165,25 @@ static void index_logicop( GLcontext *ctx, GLuint n,
* used if the device driver can't do logic ops.
*/
void
-_mesa_logicop_ci_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- GLuint index[], const GLubyte mask[] )
+_mesa_logicop_ci_span( GLcontext *ctx, const struct sw_span *span,
+ GLuint index[] )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLuint dest[MAX_WIDTH];
- /* Read dest values from frame buffer */
- (*swrast->Driver.ReadCI32Span)( ctx, n, x, y, dest );
- index_logicop( ctx, n, index, dest, mask );
-}
+ ASSERT(span->end < MAX_WIDTH);
-
-/*
- * Apply the current logic operator to an array of CI pixels. This is only
- * used if the device driver can't do logic ops.
- */
-void
-_mesa_logicop_ci_pixels( GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLuint index[], const GLubyte mask[] )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLuint dest[PB_SIZE];
/* Read dest values from frame buffer */
- (*swrast->Driver.ReadCI32Pixels)( ctx, n, x, y, dest, mask );
- index_logicop( ctx, n, index, dest, mask );
+ if (span->arrayMask & SPAN_XY) {
+ (*swrast->Driver.ReadCI32Pixels)( ctx, span->end,
+ span->array->x, span->array->y,
+ dest, span->array->mask );
+ }
+ else {
+ (*swrast->Driver.ReadCI32Span)( ctx, span->end, span->x, span->y, dest );
+ }
+
+ index_logicop( ctx, span->end, index, dest, span->array->mask );
}
@@ -207,9 +199,9 @@ _mesa_logicop_ci_pixels( GLcontext *ctx,
* Note: Since the R, G, B, and A channels are all treated the same we
* process them as 4-byte GLuints instead of four GLubytes.
*/
-static void rgba_logicop_ui( const GLcontext *ctx, GLuint n,
- const GLubyte mask[],
- GLuint src[], const GLuint dest[] )
+static void
+rgba_logicop_ui( const GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLuint src[], const GLuint dest[] )
{
GLuint i;
switch (ctx->Color.LogicOp) {
@@ -332,9 +324,9 @@ static void rgba_logicop_ui( const GLcontext *ctx, GLuint n,
* As above, but operate on GLchan values
* Note: need to pass n = numPixels * 4.
*/
-static void rgba_logicop_chan( const GLcontext *ctx, GLuint n,
- const GLubyte mask[],
- GLchan srcPtr[], const GLchan destPtr[] )
+static void
+rgba_logicop_chan( const GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLchan srcPtr[], const GLchan destPtr[] )
{
#if CHAN_TYPE == GL_FLOAT
GLuint *src = (GLuint *) srcPtr;
@@ -466,46 +458,40 @@ static void rgba_logicop_chan( const GLcontext *ctx, GLuint n,
/*
* Apply the current logic operator to a span of RGBA pixels.
- * This is only used if the device driver can't do logic ops.
+ * We can handle horizontal runs of pixels (spans) or arrays of x/y
+ * pixel coordinates.
*/
void
-_mesa_logicop_rgba_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y,
- GLchan rgba[][4], const GLubyte mask[] )
+_mesa_logicop_rgba_span( GLcontext *ctx, const struct sw_span *span,
+ GLchan rgba[][4] )
{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLchan dest[MAX_WIDTH][4];
- _mesa_read_rgba_span( ctx, ctx->DrawBuffer, n, x, y, dest );
- if (sizeof(GLchan) * 4 == sizeof(GLuint)) {
- rgba_logicop_ui(ctx, n, mask, (GLuint *) rgba, (const GLuint *) dest);
+
+ ASSERT(span->end < MAX_WIDTH);
+ ASSERT(span->arrayMask & SPAN_RGBA);
+
+ if (span->arrayMask & SPAN_XY) {
+ (*swrast->Driver.ReadRGBAPixels)(ctx, span->end,
+ span->array->x, span->array->y,
+ dest, span->array->mask);
+ if (SWRAST_CONTEXT(ctx)->_RasterMask & ALPHABUF_BIT) {
+ _mesa_read_alpha_pixels(ctx, span->end,
+ span->array->x, span->array->y,
+ dest, span->array->mask);
+ }
}
else {
- rgba_logicop_chan(ctx, 4 * n, mask,
- (GLchan *) rgba, (const GLchan *) dest);
+ _mesa_read_rgba_span(ctx, ctx->DrawBuffer, span->end,
+ span->x, span->y, dest);
}
-}
-
-
-/*
- * Apply the current logic operator to an array of RGBA pixels.
- * This is only used if the device driver can't do logic ops.
- */
-void
-_mesa_logicop_rgba_pixels( GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLchan rgba[][4], const GLubyte mask[] )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLchan dest[PB_SIZE][4];
- (*swrast->Driver.ReadRGBAPixels)( ctx, n, x, y, dest, mask );
- if (SWRAST_CONTEXT(ctx)->_RasterMask & ALPHABUF_BIT) {
- _mesa_read_alpha_pixels( ctx, n, x, y, dest, mask );
- }
if (sizeof(GLchan) * 4 == sizeof(GLuint)) {
- rgba_logicop_ui(ctx, n, mask, (GLuint *) rgba, (const GLuint *) dest);
+ rgba_logicop_ui(ctx, span->end, span->array->mask,
+ (GLuint *) rgba, (const GLuint *) dest);
}
else {
- rgba_logicop_chan(ctx, 4 * n, mask,
+ rgba_logicop_chan(ctx, 4 * span->end, span->array->mask,
(GLchan *) rgba, (const GLchan *) dest);
}
}
diff --git a/xc/extras/Mesa/src/swrast/s_logic.h b/xc/extras/Mesa/src/swrast/s_logic.h
index 8ac68f830..820451d9b 100644
--- a/xc/extras/Mesa/src/swrast/s_logic.h
+++ b/xc/extras/Mesa/src/swrast/s_logic.h
@@ -1,10 +1,9 @@
-/* $Id: s_logic.h,v 1.1.1.1 2002/10/22 13:06:51 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -34,26 +33,13 @@
extern void
-_mesa_logicop_ci_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y, GLuint index[],
- const GLubyte mask[] );
+_mesa_logicop_ci_span( GLcontext *ctx, const struct sw_span *span,
+ GLuint index[] );
extern void
-_mesa_logicop_ci_pixels( GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLuint index[], const GLubyte mask[] );
-
-
-extern void
-_mesa_logicop_rgba_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- GLchan rgba[][4], const GLubyte mask[] );
-
-
-extern void
-_mesa_logicop_rgba_pixels( GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLchan rgba[][4], const GLubyte mask[] );
+_mesa_logicop_rgba_span( GLcontext *ctx, const struct sw_span *span,
+ GLchan rgba[][4] );
#endif
diff --git a/xc/extras/Mesa/src/swrast/s_masking.c b/xc/extras/Mesa/src/swrast/s_masking.c
index d4d57140d..74e1fb5bc 100644
--- a/xc/extras/Mesa/src/swrast/s_masking.c
+++ b/xc/extras/Mesa/src/swrast/s_masking.c
@@ -1,10 +1,9 @@
-/* $Id: s_masking.c,v 1.1.1.1 2002/10/22 13:06:44 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -37,62 +36,70 @@
#include "s_alphabuf.h"
#include "s_context.h"
#include "s_masking.h"
-#include "s_pb.h"
#include "s_span.h"
-/*
- * Apply glColorMask to a span of RGBA pixels.
- */
+
void
-_mesa_mask_rgba_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y, GLchan rgba[][4] )
+_mesa_mask_rgba_span( GLcontext *ctx, const struct sw_span *span,
+ GLchan rgba[][4] )
{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
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;
+#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;
- _mesa_read_rgba_span( ctx, ctx->DrawBuffer, n, x, y, dest );
+ ASSERT(n < MAX_WIDTH);
+ ASSERT(span->arrayMask & SPAN_RGBA);
+
+ if (span->arrayMask & SPAN_XY) {
+ (*swrast->Driver.ReadRGBAPixels)(ctx, n, span->array->x, span->array->y,
+ dest, span->array->mask);
+ if (SWRAST_CONTEXT(ctx)->_RasterMask & ALPHABUF_BIT) {
+ _mesa_read_alpha_pixels(ctx, n, span->array->x, span->array->y,
+ dest, span->array->mask);
+ }
+ }
+ else {
+ _mesa_read_rgba_span(ctx, ctx->DrawBuffer, n, span->x, span->y, dest);
+ }
+
+#if CHAN_BITS == 8
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];
-
- _mesa_read_rgba_span( ctx, ctx->DrawBuffer, 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
}
+
/*
- * Apply glColorMask to an array of RGBA pixels.
+ * Apply glColorMask to a span of RGBA pixels.
*/
void
-_mesa_mask_rgba_pixels( GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLchan rgba[][4], const GLubyte mask[] )
+_mesa_mask_rgba_array( GLcontext *ctx,
+ GLuint n, GLint x, GLint y, GLchan rgba[][4] )
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLchan dest[PB_SIZE][4];
+ GLchan dest[MAX_WIDTH][4];
GLuint i;
#if CHAN_BITS == 8
@@ -102,12 +109,8 @@ _mesa_mask_rgba_pixels( GLcontext *ctx,
GLuint *rgba32 = (GLuint *) rgba;
GLuint *dest32 = (GLuint *) dest;
- (*swrast->Driver.ReadRGBAPixels)( ctx, n, x, y, dest, mask );
- if (SWRAST_CONTEXT(ctx)->_RasterMask & ALPHABUF_BIT) {
- _mesa_read_alpha_pixels( ctx, n, x, y, dest, mask );
- }
-
- for (i=0; i<n; i++) {
+ _mesa_read_rgba_span( ctx, ctx->DrawBuffer, n, x, y, dest );
+ for (i = 0; i < n; i++) {
rgba32[i] = (rgba32[i] & srcMask) | (dest32[i] & dstMask);
}
@@ -118,11 +121,7 @@ _mesa_mask_rgba_pixels( GLcontext *ctx,
const GLint bMask = ctx->Color.ColorMask[BCOMP];
const GLint aMask = ctx->Color.ColorMask[ACOMP];
- (*swrast->Driver.ReadRGBAPixels)( ctx, n, x, y, dest, mask );
- if (SWRAST_CONTEXT(ctx)->_RasterMask & ALPHABUF_BIT) {
- _mesa_read_alpha_pixels( ctx, n, x, y, dest, mask );
- }
-
+ _mesa_read_rgba_span( ctx, ctx->DrawBuffer, 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];
@@ -135,43 +134,53 @@ _mesa_mask_rgba_pixels( GLcontext *ctx,
-/*
- * Apply glIndexMask to a span of CI pixels.
- */
void
-_mesa_mask_index_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y, GLuint index[] )
+_mesa_mask_index_span( GLcontext *ctx, const struct sw_span *span,
+ GLuint index[] )
{
- GLuint i;
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const GLuint msrc = ctx->Color.IndexMask;
+ const GLuint mdest = ~msrc;
GLuint fbindexes[MAX_WIDTH];
- GLuint msrc, mdest;
+ GLuint i;
- _mesa_read_index_span( ctx, ctx->DrawBuffer, n, x, y, fbindexes );
+ ASSERT(span->arrayMask & SPAN_INDEX);
+ ASSERT(span->end < MAX_WIDTH);
- msrc = ctx->Color.IndexMask;
- mdest = ~msrc;
+ if (span->arrayMask & SPAN_XY) {
- for (i=0;i<n;i++) {
- index[i] = (index[i] & msrc) | (fbindexes[i] & mdest);
+ (*swrast->Driver.ReadCI32Pixels)(ctx, span->end, span->array->x,
+ span->array->y, fbindexes,
+ span->array->mask);
+
+ for (i = 0; i < span->end; i++) {
+ index[i] = (index[i] & msrc) | (fbindexes[i] & mdest);
+ }
+ }
+ else {
+ _mesa_read_index_span(ctx, ctx->DrawBuffer, span->end, span->x, span->y,
+ fbindexes );
+
+ for (i = 0; i < span->end; i++) {
+ index[i] = (index[i] & msrc) | (fbindexes[i] & mdest);
+ }
}
}
/*
- * Apply glIndexMask to an array of CI pixels.
+ * Apply glIndexMask to a span of CI pixels.
*/
void
-_mesa_mask_index_pixels( GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLuint index[], const GLubyte mask[] )
+_mesa_mask_index_array( GLcontext *ctx,
+ GLuint n, GLint x, GLint y, GLuint index[] )
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLuint i;
- GLuint fbindexes[PB_SIZE];
+ GLuint fbindexes[MAX_WIDTH];
GLuint msrc, mdest;
- (*swrast->Driver.ReadCI32Pixels)( ctx, n, x, y, fbindexes, mask );
+ _mesa_read_index_span( ctx, ctx->DrawBuffer, n, x, y, fbindexes );
msrc = ctx->Color.IndexMask;
mdest = ~msrc;
diff --git a/xc/extras/Mesa/src/swrast/s_masking.h b/xc/extras/Mesa/src/swrast/s_masking.h
index f79acf413..8b5c86366 100644
--- a/xc/extras/Mesa/src/swrast/s_masking.h
+++ b/xc/extras/Mesa/src/swrast/s_masking.h
@@ -1,10 +1,9 @@
-/* $Id: s_masking.h,v 1.1.1.1 2002/10/22 13:06:44 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -37,39 +36,26 @@
* Implement glColorMask for a span of RGBA pixels.
*/
extern void
-_mesa_mask_rgba_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y,
+_mesa_mask_rgba_span( GLcontext *ctx, const struct sw_span *span,
GLchan rgba[][4] );
-
-/*
- * Implement glColorMask for an array of RGBA pixels.
- */
extern void
-_mesa_mask_rgba_pixels( GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLchan rgba[][4], const GLubyte mask[] );
-
+_mesa_mask_rgba_array( GLcontext *ctx, GLuint n, GLint x, GLint y,
+ GLchan rgba[][4] );
/*
* Implement glIndexMask for a span of CI pixels.
*/
extern void
-_mesa_mask_index_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y, GLuint index[] );
+_mesa_mask_index_span( GLcontext *ctx, const struct sw_span *span,
+ GLuint index[] );
-
-/*
- * Implement glIndexMask for an array of CI pixels.
- */
extern void
-_mesa_mask_index_pixels( GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLuint index[], const GLubyte mask[] );
-
+_mesa_mask_index_array( GLcontext *ctx,
+ GLuint n, GLint x, GLint y, GLuint index[] );
#endif
diff --git a/xc/extras/Mesa/src/swrast/s_pb.c b/xc/extras/Mesa/src/swrast/s_pb.c
deleted file mode 100644
index a0da3a6b3..000000000
--- a/xc/extras/Mesa/src/swrast/s_pb.c
+++ /dev/null
@@ -1,517 +0,0 @@
-/* $Id: s_pb.c,v 1.1.1.1 2002/10/22 13:06:53 alanh 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.
- */
-
-
-
-/*
- * Pixel buffer:
- *
- * As fragments are produced (by point, line, and bitmap drawing) they
- * are accumlated in a buffer. When the buffer is full or has to be
- * flushed (glEnd), we apply all enabled rasterization functions to the
- * pixels and write the results to the display buffer. The goal is to
- * maximize the number of pixels processed inside loops and to minimize
- * the number of function calls.
- */
-
-
-#include "glheader.h"
-#include "macros.h"
-#include "mem.h"
-
-#include "s_alpha.h"
-#include "s_alphabuf.h"
-#include "s_blend.h"
-#include "s_context.h"
-#include "s_depth.h"
-#include "s_fog.h"
-#include "s_logic.h"
-#include "s_masking.h"
-#include "s_pb.h"
-#include "s_scissor.h"
-#include "s_stencil.h"
-#include "s_texture.h"
-
-
-
-/*
- * Allocate and initialize a new pixel buffer structure.
- */
-struct pixel_buffer *_mesa_alloc_pb(void)
-{
- struct pixel_buffer *pb;
- pb = CALLOC_STRUCT(pixel_buffer);
- if (pb) {
- int i, j;
- /* set non-zero fields */
- pb->mono = GL_TRUE;
-
- /* Set all lambda values to 0.0 since we don't do mipmapping for
- * points or lines and want to use the level 0 texture image.
- */
- for (j=0;j<MAX_TEXTURE_UNITS;j++) {
- for (i=0; i<PB_SIZE; i++) {
- pb->lambda[j][i] = 0.0;
- }
- }
- }
- return pb;
-}
-
-
-
-/*
- * Draw to more than one color buffer (or none).
- */
-static void multi_write_index_pixels( GLcontext *ctx, GLuint n,
- const GLint x[], const GLint y[],
- const GLuint indexes[],
- const GLubyte mask[] )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLuint bufferBit;
-
- if (ctx->Color.DrawBuffer == GL_NONE)
- return;
-
- /* loop over four possible dest color buffers */
- for (bufferBit = 1; bufferBit <= 8; bufferBit = bufferBit << 1) {
- if (bufferBit & ctx->Color.DrawDestMask) {
- GLuint indexTmp[PB_SIZE];
- ASSERT(n < PB_SIZE);
-
- if (bufferBit == FRONT_LEFT_BIT)
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_LEFT);
- else if (bufferBit == FRONT_RIGHT_BIT)
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_RIGHT);
- else if (bufferBit == BACK_LEFT_BIT)
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_LEFT);
- else
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_RIGHT);
-
- /* make copy of incoming indexes */
- MEMCPY( indexTmp, indexes, n * sizeof(GLuint) );
- if (ctx->Color.IndexLogicOpEnabled) {
- _mesa_logicop_ci_pixels( ctx, n, x, y, indexTmp, mask );
- }
- if (ctx->Color.IndexMask != 0xffffffff) {
- _mesa_mask_index_pixels( ctx, n, x, y, indexTmp, mask );
- }
- (*swrast->Driver.WriteCI32Pixels)( ctx, n, x, y, indexTmp, mask );
- }
- }
-
- /* restore default dest buffer */
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, ctx->Color.DriverDrawBuffer);
-}
-
-
-
-/*
- * Draw to more than one RGBA color buffer (or none).
- */
-static void multi_write_rgba_pixels( GLcontext *ctx, GLuint n,
- const GLint x[], const GLint y[],
- CONST GLchan rgba[][4],
- const GLubyte mask[] )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLuint bufferBit;
-
- if (ctx->Color.DrawBuffer == GL_NONE)
- return;
-
- /* loop over four possible dest color buffers */
- for (bufferBit = 1; bufferBit <= 8; bufferBit = bufferBit << 1) {
- if (bufferBit & ctx->Color.DrawDestMask) {
- GLchan rgbaTmp[PB_SIZE][4];
- ASSERT(n < PB_SIZE);
-
- if (bufferBit == FRONT_LEFT_BIT) {
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_LEFT);
- ctx->DrawBuffer->Alpha = ctx->DrawBuffer->FrontLeftAlpha;
- }
- else if (bufferBit == FRONT_RIGHT_BIT) {
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_RIGHT);
- ctx->DrawBuffer->Alpha = ctx->DrawBuffer->FrontRightAlpha;
- }
- else if (bufferBit == BACK_LEFT_BIT) {
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_LEFT);
- ctx->DrawBuffer->Alpha = ctx->DrawBuffer->BackLeftAlpha;
- }
- else {
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_RIGHT);
- ctx->DrawBuffer->Alpha = ctx->DrawBuffer->BackRightAlpha;
- }
-
- /* make copy of incoming colors */
- MEMCPY( rgbaTmp, rgba, 4 * n * sizeof(GLchan) );
-
- if (ctx->Color.ColorLogicOpEnabled) {
- _mesa_logicop_rgba_pixels( ctx, n, x, y, rgbaTmp, mask );
- }
- else if (ctx->Color.BlendEnabled) {
- _mesa_blend_pixels( ctx, n, x, y, rgbaTmp, mask );
- }
- if (*((GLuint *) &ctx->Color.ColorMask) != 0xffffffff) {
- _mesa_mask_rgba_pixels( ctx, n, x, y, rgbaTmp, mask );
- }
-
- (*swrast->Driver.WriteRGBAPixels)( ctx, n, x, y,
- (const GLchan (*)[4])rgbaTmp, mask );
- if (SWRAST_CONTEXT(ctx)->_RasterMask & ALPHABUF_BIT) {
- _mesa_write_alpha_pixels( ctx, n, x, y,
- (const GLchan (*)[4])rgbaTmp, mask );
- }
- }
- }
-
- /* restore default dest buffer */
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, ctx->Color.DriverDrawBuffer);
-}
-
-
-
-/*
- * Add specular color to primary color. This is used only when
- * GL_LIGHT_MODEL_COLOR_CONTROL = GL_SEPARATE_SPECULAR_COLOR.
- */
-static void add_colors( GLuint n, GLchan rgba[][4], CONST GLchan spec[][3] )
-{
- GLuint i;
- for (i=0; i<n; 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];
- rgba[i][RCOMP] = MIN2(r, CHAN_MAX);
- rgba[i][GCOMP] = MIN2(g, CHAN_MAX);
- rgba[i][BCOMP] = MIN2(b, CHAN_MAX);
- }
-}
-
-
-
-/*
- * When the pixel buffer is full, or needs to be flushed, call this
- * function. All the pixels in the pixel buffer will be subjected
- * to texturing, scissoring, stippling, alpha testing, stenciling,
- * depth testing, blending, and finally written to the frame buffer.
- */
-void _mesa_flush_pb( GLcontext *ctx )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLuint RasterMask = swrast->_RasterMask;
-
- /* Pixel colors may be changed if any of these raster ops enabled */
- const GLuint modBits = FOG_BIT | TEXTURE_BIT | BLEND_BIT |
- MASKING_BIT | LOGIC_OP_BIT;
- struct pixel_buffer *PB = swrast->PB;
- GLubyte mask[PB_SIZE];
-
- if (PB->count == 0)
- goto CleanUp;
-
- /* initialize mask array and clip pixels simultaneously */
- {
- const GLint xmin = ctx->DrawBuffer->_Xmin;
- const GLint xmax = ctx->DrawBuffer->_Xmax;
- const GLint ymin = ctx->DrawBuffer->_Ymin;
- const GLint ymax = ctx->DrawBuffer->_Ymax;
- const GLuint n = PB->count;
- GLint *x = PB->x;
- GLint *y = PB->y;
- GLuint i;
- for (i = 0; i < n; i++) {
- mask[i] = (x[i] >= xmin) & (x[i] < xmax) & (y[i] >= ymin) & (y[i] < ymax);
- }
- }
-
- if (ctx->Visual.rgbMode) {
- /*
- * RGBA COLOR PIXELS
- */
-
- /* If each pixel can be of a different color... */
- if ((RasterMask & modBits) || !PB->mono) {
-
- if (PB->mono) {
- /* copy mono color into rgba array */
- GLuint i;
- for (i = 0; i < PB->count; i++) {
- COPY_CHAN4(PB->rgba[i], PB->currentColor);
- }
- }
-
- if (ctx->Texture._ReallyEnabled) {
- GLchan primary_rgba[PB_SIZE][4];
- GLuint texUnit;
-
- /* must make a copy of primary colors since they may be modified */
- MEMCPY(primary_rgba, PB->rgba, 4 * PB->count * sizeof(GLchan));
-
- for (texUnit = 0; texUnit < ctx->Const.MaxTextureUnits; texUnit++){
- _swrast_texture_fragments( ctx, texUnit, PB->count,
- PB->s[texUnit], PB->t[texUnit],
- PB->u[texUnit], PB->lambda[texUnit],
- (CONST GLchan (*)[4]) primary_rgba,
- PB->rgba );
- }
- }
-
- if ((ctx->Fog.ColorSumEnabled ||
- (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR
- && ctx->Light.Enabled)) && PB->haveSpec) {
- /* add specular color to primary color */
- add_colors( PB->count, PB->rgba, (const GLchan (*)[3]) PB->spec );
- }
-
- if (ctx->Fog.Enabled) {
- if (swrast->_PreferPixelFog)
- _mesa_depth_fog_rgba_pixels( ctx, PB->count, PB->z, PB->rgba );
- else
- _mesa_fog_rgba_pixels( ctx, PB->count, PB->fog, PB->rgba );
- }
-
- /* Antialias coverage application */
- if (PB->haveCoverage) {
- const GLuint n = PB->count;
- GLuint i;
- for (i = 0; i < n; i++) {
- PB->rgba[i][ACOMP] = (GLchan) (PB->rgba[i][ACOMP] * PB->coverage[i]);
- }
- }
-
- /* Scissoring already done above */
-
- if (ctx->Color.AlphaEnabled) {
- if (_mesa_alpha_test( ctx, PB->count,
- (const GLchan (*)[4]) PB->rgba, mask )==0) {
- goto CleanUp;
- }
- }
-
- if (ctx->Stencil.Enabled) {
- /* first stencil test */
- if (_mesa_stencil_and_ztest_pixels(ctx, PB->count,
- PB->x, PB->y, PB->z, mask) == 0) {
- goto CleanUp;
- }
- }
- else if (ctx->Depth.Test) {
- /* regular depth testing */
- _mesa_depth_test_pixels( ctx, PB->count, PB->x, PB->y, PB->z, mask );
- }
-
-
- if (RasterMask & MULTI_DRAW_BIT) {
- multi_write_rgba_pixels( ctx, PB->count, PB->x, PB->y,
- (const GLchan (*)[4])PB->rgba, mask );
- }
- else {
- /* normal case: write to exactly one buffer */
- const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask);
-
- if (ctx->Color.ColorLogicOpEnabled) {
- _mesa_logicop_rgba_pixels( ctx, PB->count, PB->x, PB->y,
- PB->rgba, mask);
- }
- else if (ctx->Color.BlendEnabled) {
- _mesa_blend_pixels( ctx, PB->count, PB->x, PB->y, PB->rgba, mask);
- }
- if (colorMask == 0x0) {
- goto CleanUp;
- }
- else if (colorMask != 0xffffffff) {
- _mesa_mask_rgba_pixels(ctx, PB->count, PB->x, PB->y, PB->rgba, mask);
- }
-
- (*swrast->Driver.WriteRGBAPixels)( ctx, PB->count, PB->x, PB->y,
- (const GLchan (*)[4]) PB->rgba,
- mask );
- if (RasterMask & ALPHABUF_BIT) {
- _mesa_write_alpha_pixels( ctx, PB->count, PB->x, PB->y,
- (const GLchan (*)[4]) PB->rgba, mask );
- }
- }
- }
- else {
- /* Same color for all pixels */
-
- /* Scissoring already done above */
-
- if (ctx->Color.AlphaEnabled) {
- if (_mesa_alpha_test( ctx, PB->count,
- (const GLchan (*)[4]) PB->rgba, mask )==0) {
- goto CleanUp;
- }
- }
-
- if (ctx->Stencil.Enabled) {
- /* first stencil test */
- if (_mesa_stencil_and_ztest_pixels(ctx, PB->count,
- PB->x, PB->y, PB->z, mask) == 0) {
- goto CleanUp;
- }
- }
- else if (ctx->Depth.Test) {
- /* regular depth testing */
- _mesa_depth_test_pixels( ctx, PB->count, PB->x, PB->y, PB->z, mask );
- }
-
- if (ctx->Color.DrawBuffer == GL_NONE) {
- goto CleanUp;
- }
-
- if (RasterMask & MULTI_DRAW_BIT) {
- if (PB->mono) {
- /* copy mono color into rgba array */
- GLuint i;
- for (i = 0; i < PB->count; i++) {
- COPY_CHAN4(PB->rgba[i], PB->currentColor);
- }
- }
- multi_write_rgba_pixels( ctx, PB->count, PB->x, PB->y,
- (const GLchan (*)[4]) PB->rgba, mask );
- }
- else {
- /* normal case: write to exactly one buffer */
- (*swrast->Driver.WriteMonoRGBAPixels)( ctx, PB->count, PB->x, PB->y,
- PB->currentColor, mask );
- if (RasterMask & ALPHABUF_BIT) {
- _mesa_write_mono_alpha_pixels( ctx, PB->count, PB->x, PB->y,
- PB->currentColor[ACOMP], mask );
- }
- }
- /*** ALL DONE ***/
- }
- }
- else {
- /*
- * COLOR INDEX PIXELS
- */
-
- /* If we may be writting pixels with different indexes... */
- if ((RasterMask & modBits) || !PB->mono) {
-
- if (PB->mono) {
- GLuint i;
- for (i = 0; i < PB->count; i++) {
- PB->index[i] = PB->currentIndex;
- }
- }
- if (ctx->Fog.Enabled) {
- if (swrast->_PreferPixelFog)
- _mesa_depth_fog_ci_pixels( ctx, PB->count, PB->z, PB->index );
- else
- _mesa_fog_ci_pixels( ctx, PB->count, PB->fog, PB->index );
- }
-
- /* Antialias coverage application */
- if (PB->haveCoverage) {
- const GLuint n = PB->count;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint frac = (GLint) (15.0 * PB->coverage[i]);
- PB->index[i] = (PB->index[i] & ~0xf) | frac;
- }
- }
-
- /* Scissoring already done above */
-
- if (ctx->Stencil.Enabled) {
- /* first stencil test */
- if (_mesa_stencil_and_ztest_pixels(ctx, PB->count,
- PB->x, PB->y, PB->z, mask) == 0) {
- goto CleanUp;
- }
- }
- else if (ctx->Depth.Test) {
- /* regular depth testing */
- _mesa_depth_test_pixels( ctx, PB->count, PB->x, PB->y, PB->z, mask );
- }
- if (RasterMask & MULTI_DRAW_BIT) {
- multi_write_index_pixels( ctx, PB->count, PB->x, PB->y, PB->index, mask );
- }
- else {
- /* normal case: write to exactly one buffer */
-
- if (ctx->Color.IndexLogicOpEnabled) {
- _mesa_logicop_ci_pixels(ctx, PB->count, PB->x, PB->y,
- PB->index, mask);
- }
- if (ctx->Color.IndexMask != 0xffffffff) {
- _mesa_mask_index_pixels(ctx, PB->count, PB->x, PB->y,
- PB->index, mask);
- }
- (*swrast->Driver.WriteCI32Pixels)( ctx, PB->count, PB->x, PB->y,
- PB->index, mask );
- }
-
- /*** ALL DONE ***/
- }
- else {
- /* Same color index for all pixels */
-
- /* Scissoring already done above */
-
- if (ctx->Stencil.Enabled) {
- /* first stencil test */
- if (_mesa_stencil_and_ztest_pixels(ctx, PB->count,
- PB->x, PB->y, PB->z, mask) == 0) {
- goto CleanUp;
- }
- }
- else if (ctx->Depth.Test) {
- /* regular depth testing */
- _mesa_depth_test_pixels(ctx, PB->count, PB->x, PB->y, PB->z, mask);
- }
-
- if (RasterMask & MULTI_DRAW_BIT) {
- multi_write_index_pixels(ctx, PB->count, PB->x, PB->y,
- PB->index, mask);
- }
- else {
- /* normal case: write to exactly one buffer */
- (*swrast->Driver.WriteMonoCIPixels)(ctx, PB->count, PB->x, PB->y,
- PB->currentIndex, mask);
- }
- }
- }
-
-CleanUp:
- PB->count = 0;
- PB->mono = GL_TRUE;
- PB->haveSpec = GL_FALSE;
- PB->haveCoverage = GL_FALSE;
-}
-
-
-void
-_swrast_flush( GLcontext *ctx )
-{
- if (SWRAST_CONTEXT(ctx)->PB->count > 0)
- _mesa_flush_pb(ctx);
-}
diff --git a/xc/extras/Mesa/src/swrast/s_pb.h b/xc/extras/Mesa/src/swrast/s_pb.h
deleted file mode 100644
index 72d2df353..000000000
--- a/xc/extras/Mesa/src/swrast/s_pb.h
+++ /dev/null
@@ -1,244 +0,0 @@
-/* $Id: s_pb.h,v 1.1.1.1 2002/10/22 13:06:53 alanh Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef PB_H
-#define PB_H
-
-
-#include "mtypes.h"
-#include "swrast.h"
-#include "colormac.h"
-
-
-/*
- * Pixel buffer size, must be larger than MAX_WIDTH.
- */
-#define PB_SIZE (3*MAX_WIDTH)
-
-
-struct pixel_buffer {
- GLchan currentColor[4]; /* Current color, for subsequent pixels */
- GLuint currentIndex; /* Current index, for subsequent pixels */
- GLuint count; /* Number of pixels in buffer */
- GLboolean mono; /* Same color or index for all pixels? */
- GLboolean haveSpec; /* any specular colors? */
- GLboolean haveCoverage; /* apply AA coverage? */
-
- GLint x[PB_SIZE]; /* X window coord in [0,MAX_WIDTH) */
- GLint y[PB_SIZE]; /* Y window coord in [0,MAX_HEIGHT) */
- GLdepth z[PB_SIZE]; /* Z window coord in [0,Visual.MaxDepth] */
- GLfloat fog[PB_SIZE]; /* Fog window coord in [0,1] */
- GLchan rgba[PB_SIZE][4]; /* Colors */
- GLchan spec[PB_SIZE][3]; /* Separate specular colors */
- GLuint index[PB_SIZE]; /* Color indexes */
- GLfloat coverage[PB_SIZE]; /* Antialiasing coverage in [0,1] */
- GLfloat s[MAX_TEXTURE_UNITS][PB_SIZE]; /* Texture S coordinates */
- GLfloat t[MAX_TEXTURE_UNITS][PB_SIZE]; /* Texture T coordinates */
- GLfloat u[MAX_TEXTURE_UNITS][PB_SIZE]; /* Texture R coordinates */
- GLfloat lambda[MAX_TEXTURE_UNITS][PB_SIZE]; /* Texture lambda values */
-};
-
-
-
-/*
- * Set the color used for all subsequent pixels in the buffer.
- */
-#define PB_SET_COLOR( PB, R, G, B, A ) \
-do { \
- if ((PB)->count > 0) \
- (PB)->mono = GL_FALSE; \
- (PB)->currentColor[RCOMP] = (R); \
- (PB)->currentColor[GCOMP] = (G); \
- (PB)->currentColor[BCOMP] = (B); \
- (PB)->currentColor[ACOMP] = (A); \
-} while (0)
-
-
-/*
- * Set the color index used for all subsequent pixels in the buffer.
- */
-#define PB_SET_INDEX( PB, I ) \
-do { \
- if ((PB)->count > 0) \
- (PB)->mono = GL_FALSE; \
- (PB)->currentIndex = (I); \
-} while (0)
-
-
-/*
- * "write" a pixel using current color or index
- */
-#define PB_WRITE_PIXEL( PB, X, Y, Z, FOG ) \
-do { \
- GLuint count = (PB)->count; \
- (PB)->x[count] = X; \
- (PB)->y[count] = Y; \
- (PB)->z[count] = Z; \
- (PB)->fog[count] = FOG; \
- COPY_CHAN4((PB)->rgba[count], (PB)->currentColor); \
- (PB)->index[count] = (PB)->currentIndex; \
- (PB)->count++; \
-} while (0)
-
-
-/*
- * "write" an RGBA pixel
- */
-#define PB_WRITE_RGBA_PIXEL( PB, X, Y, Z, FOG, R, G, B, A ) \
-do { \
- GLuint count = (PB)->count; \
- (PB)->x[count] = X; \
- (PB)->y[count] = Y; \
- (PB)->z[count] = Z; \
- (PB)->fog[count] = FOG; \
- (PB)->rgba[count][RCOMP] = R; \
- (PB)->rgba[count][GCOMP] = G; \
- (PB)->rgba[count][BCOMP] = B; \
- (PB)->rgba[count][ACOMP] = A; \
- (PB)->mono = GL_FALSE; \
- (PB)->count++; \
-} while (0)
-
-
-/*
- * "write" a color-index pixel
- */
-#define PB_WRITE_CI_PIXEL( PB, X, Y, Z, FOG, I ) \
-do { \
- GLuint count = (PB)->count; \
- (PB)->x[count] = X; \
- (PB)->y[count] = Y; \
- (PB)->z[count] = Z; \
- (PB)->fog[count] = FOG; \
- (PB)->index[count] = I; \
- (PB)->mono = GL_FALSE; \
- (PB)->count++; \
-} while (0)
-
-
-
-/*
- * "write" an RGBA pixel with texture coordinates
- */
-#define PB_WRITE_TEX_PIXEL( PB, X, Y, Z, FOG, R, G, B, A, S, T, U ) \
-do { \
- GLuint count = (PB)->count; \
- (PB)->x[count] = X; \
- (PB)->y[count] = Y; \
- (PB)->z[count] = Z; \
- (PB)->fog[count] = FOG; \
- (PB)->rgba[count][RCOMP] = R; \
- (PB)->rgba[count][GCOMP] = G; \
- (PB)->rgba[count][BCOMP] = B; \
- (PB)->rgba[count][ACOMP] = A; \
- (PB)->s[0][count] = S; \
- (PB)->t[0][count] = T; \
- (PB)->u[0][count] = U; \
- (PB)->mono = GL_FALSE; \
- (PB)->count++; \
-} while (0)
-
-
-/*
- * "write" an RGBA pixel with multiple texture coordinates
- */
-#define PB_WRITE_MULTITEX_PIXEL( PB, X, Y, Z, FOG, R, G, B, A, TEXCOORDS ) \
-do { \
- GLuint count = (PB)->count; \
- GLuint unit; \
- (PB)->x[count] = X; \
- (PB)->y[count] = Y; \
- (PB)->z[count] = Z; \
- (PB)->fog[count] = FOG; \
- (PB)->rgba[count][RCOMP] = R; \
- (PB)->rgba[count][GCOMP] = G; \
- (PB)->rgba[count][BCOMP] = B; \
- (PB)->rgba[count][ACOMP] = A; \
- for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) { \
- if (ctx->Texture.Unit[unit]._ReallyEnabled) { \
- (PB)->s[unit][count] = TEXCOORDS[unit][0]; \
- (PB)->t[unit][count] = TEXCOORDS[unit][1]; \
- (PB)->u[unit][count] = TEXCOORDS[unit][2]; \
- } \
- } \
- (PB)->mono = GL_FALSE; \
- (PB)->count++; \
-} while (0)
-
-
-/*
- * "write" an RGBA pixel with multiple texture coordinates and specular color
- */
-#define PB_WRITE_MULTITEX_SPEC_PIXEL( PB, X, Y, Z, FOG, R, G, B, A, SR, SG, SB, TEXCOORDS )\
-do { \
- GLuint count = (PB)->count; \
- GLuint unit; \
- (PB)->haveSpec = GL_TRUE; \
- (PB)->x[count] = X; \
- (PB)->y[count] = Y; \
- (PB)->z[count] = Z; \
- (PB)->fog[count] = FOG; \
- (PB)->rgba[count][RCOMP] = R; \
- (PB)->rgba[count][GCOMP] = G; \
- (PB)->rgba[count][BCOMP] = B; \
- (PB)->rgba[count][ACOMP] = A; \
- (PB)->spec[count][RCOMP] = SR; \
- (PB)->spec[count][GCOMP] = SG; \
- (PB)->spec[count][BCOMP] = SB; \
- for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) { \
- if (ctx->Texture.Unit[unit]._ReallyEnabled) { \
- (PB)->s[unit][count] = TEXCOORDS[unit][0]; \
- (PB)->t[unit][count] = TEXCOORDS[unit][1]; \
- (PB)->u[unit][count] = TEXCOORDS[unit][2]; \
- } \
- } \
- (PB)->mono = GL_FALSE; \
- (PB)->count++; \
-} while (0)
-
-
-#define PB_COVERAGE(PB, COVERAGE) \
- (PB)->coverage[(PB)->count] = COVERAGE;
-
-
-/*
- * Call this function at least every MAX_WIDTH pixels:
- */
-#define PB_CHECK_FLUSH( CTX, PB ) \
-do { \
- if ((PB)->count >= PB_SIZE - MAX_WIDTH) { \
- _mesa_flush_pb( CTX ); \
- } \
-} while(0)
-
-
-extern struct pixel_buffer *_mesa_alloc_pb(void);
-
-extern void _mesa_flush_pb( GLcontext *ctx );
-
-
-#endif
diff --git a/xc/extras/Mesa/src/swrast/s_pixeltex.c b/xc/extras/Mesa/src/swrast/s_pixeltex.c
index f52972ff7..776a38c91 100644
--- a/xc/extras/Mesa/src/swrast/s_pixeltex.c
+++ b/xc/extras/Mesa/src/swrast/s_pixeltex.c
@@ -1,10 +1,9 @@
-/* $Id: s_pixeltex.c,v 1.1.1.1 2002/10/22 13:06:56 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -35,47 +34,84 @@
#include "glheader.h"
#include "colormac.h"
+#include "imports.h"
#include "s_context.h"
#include "s_pixeltex.h"
+#include "s_texture.h"
/*
* Convert RGBA values into strq texture coordinates.
*/
-void
-_mesa_pixeltexgen(GLcontext *ctx, GLuint n, const GLchan rgba[][4],
- GLfloat s[], GLfloat t[], GLfloat r[], GLfloat q[])
+static void
+pixeltexgen(GLcontext *ctx, GLuint n, const GLchan rgba[][4],
+ GLfloat texcoord[][4])
{
if (ctx->Pixel.FragmentRgbSource == GL_CURRENT_RASTER_COLOR) {
GLuint i;
for (i = 0; i < n; i++) {
- s[i] = ctx->Current.RasterColor[RCOMP];
- t[i] = ctx->Current.RasterColor[GCOMP];
- r[i] = ctx->Current.RasterColor[BCOMP];
+ texcoord[i][0] = ctx->Current.RasterColor[RCOMP];
+ texcoord[i][1] = ctx->Current.RasterColor[GCOMP];
+ texcoord[i][2] = ctx->Current.RasterColor[BCOMP];
}
}
else {
GLuint i;
ASSERT(ctx->Pixel.FragmentRgbSource == GL_PIXEL_GROUP_COLOR_SGIS);
for (i = 0; i < n; i++) {
- s[i] = CHAN_TO_FLOAT(rgba[i][RCOMP]);
- t[i] = CHAN_TO_FLOAT(rgba[i][GCOMP]);
- r[i] = CHAN_TO_FLOAT(rgba[i][BCOMP]);
+ texcoord[i][0] = CHAN_TO_FLOAT(rgba[i][RCOMP]);
+ texcoord[i][1] = CHAN_TO_FLOAT(rgba[i][GCOMP]);
+ texcoord[i][2] = CHAN_TO_FLOAT(rgba[i][BCOMP]);
}
}
if (ctx->Pixel.FragmentAlphaSource == GL_CURRENT_RASTER_COLOR) {
GLuint i;
for (i = 0; i < n; i++) {
- q[i] = ctx->Current.RasterColor[ACOMP];
+ texcoord[i][3] = ctx->Current.RasterColor[ACOMP];
}
}
else {
GLuint i;
ASSERT(ctx->Pixel.FragmentAlphaSource == GL_PIXEL_GROUP_COLOR_SGIS);
for (i = 0; i < n; i++) {
- q[i] = CHAN_TO_FLOAT(rgba[i][ACOMP]);
+ texcoord[i][3] = CHAN_TO_FLOAT(rgba[i][ACOMP]);
+ }
+ }
+}
+
+
+
+/*
+ * Used by glDraw/CopyPixels: the incoming image colors are treated
+ * as texture coordinates. Use those coords to texture the image.
+ * This is for GL_SGIS_pixel_texture / GL_SGIX_pixel_texture.
+ */
+void
+_swrast_pixel_texture(GLcontext *ctx, struct sw_span *span)
+{
+ GLuint unit;
+
+ ASSERT(!(span->arrayMask & SPAN_TEXTURE));
+ span->arrayMask |= SPAN_TEXTURE;
+
+ /* convert colors into texture coordinates */
+ pixeltexgen( ctx, span->end,
+ (const GLchan (*)[4]) span->array->rgba,
+ span->array->texcoords[0] );
+
+ /* copy the new texture units for all enabled units */
+ for (unit = 1; unit < ctx->Const.MaxTextureUnits; unit++) {
+ if (ctx->Texture.Unit[unit]._ReallyEnabled) {
+ MEMCPY( span->array->texcoords[unit], span->array->texcoords[0],
+ span->end * 4 * sizeof(GLfloat) );
}
}
+
+ /* apply texture mapping */
+ _swrast_texture_span( ctx, span );
+
+ /* this is a work-around to be fixed by initializing again span */
+ span->arrayMask &= ~SPAN_TEXTURE;
}
diff --git a/xc/extras/Mesa/src/swrast/s_pixeltex.h b/xc/extras/Mesa/src/swrast/s_pixeltex.h
index 7d1d8047c..6ef7a44df 100644
--- a/xc/extras/Mesa/src/swrast/s_pixeltex.h
+++ b/xc/extras/Mesa/src/swrast/s_pixeltex.h
@@ -1,10 +1,9 @@
-/* $Id: s_pixeltex.h,v 1.1.1.1 2002/10/22 13:06:56 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -31,9 +30,9 @@
#include "mtypes.h"
#include "swrast.h"
+
extern void
-_mesa_pixeltexgen(GLcontext *ctx, GLuint n, const GLchan rgba[][4],
- GLfloat s[], GLfloat t[], GLfloat r[], GLfloat q[]);
+_swrast_pixel_texture(GLcontext *ctx, struct sw_span *span);
#endif
diff --git a/xc/extras/Mesa/src/swrast/s_points.c b/xc/extras/Mesa/src/swrast/s_points.c
index 75f4b7811..5ef41d9fb 100644
--- a/xc/extras/Mesa/src/swrast/s_points.c
+++ b/xc/extras/Mesa/src/swrast/s_points.c
@@ -1,10 +1,9 @@
-/* $Id: s_points.c,v 1.1.1.1 2002/10/22 13:06:58 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -33,20 +32,19 @@
#include "texstate.h"
#include "s_context.h"
#include "s_feedback.h"
-#include "s_pb.h"
#include "s_points.h"
#include "s_span.h"
-#define INDEX 0x0
#define RGBA 0x1
-#define SMOOTH 0x2
-#define TEXTURE 0x4
-#define SPECULAR 0x8
-#define LARGE 0x10
-#define ATTENUATE 0x20
-#define SPRITE 0x40
+#define INDEX 0x2
+#define SMOOTH 0x4
+#define TEXTURE 0x8
+#define SPECULAR 0x10
+#define LARGE 0x20
+#define ATTENUATE 0x40
+#define SPRITE 0x80
/*
@@ -148,12 +146,12 @@
/*
* Sprite (textured point)
*/
-#define FLAGS (RGBA | TEXTURE | SPRITE)
+#define FLAGS (RGBA | SPRITE)
#define NAME sprite_point
#include "s_pointtemp.h"
-#define FLAGS (RGBA | ATTENUATE | TEXTURE | SPRITE)
+#define FLAGS (RGBA | ATTENUATE | SPRITE)
#define NAME atten_sprite_point
#include "s_pointtemp.h"
@@ -202,7 +200,8 @@ _swrast_choose_point( GLcontext *ctx )
GLboolean rgbMode = ctx->Visual.rgbMode;
if (ctx->RenderMode==GL_RENDER) {
- if (ctx->Point.SpriteMode) {
+ if (ctx->Point.PointSprite) {
+ /* GL_NV_point_sprite */
/* XXX this might not be good enough */
if (ctx->Point._Attenuated)
USE(atten_sprite_point);
@@ -212,10 +211,10 @@ _swrast_choose_point( GLcontext *ctx )
else if (ctx->Point.SmoothFlag) {
/* Smooth points */
if (rgbMode) {
- if (ctx->Point._Attenuated) {
+ if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
USE(atten_antialiased_rgba_point);
}
- else if (ctx->Texture._ReallyEnabled) {
+ else if (ctx->Texture._EnabledUnits) {
USE(antialiased_tex_rgba_point);
}
else {
@@ -226,9 +225,9 @@ _swrast_choose_point( GLcontext *ctx )
USE(antialiased_ci_point);
}
}
- else if (ctx->Point._Attenuated) {
+ else if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
if (rgbMode) {
- if (ctx->Texture._ReallyEnabled) {
+ if (ctx->Texture._EnabledUnits) {
if (ctx->Point.SmoothFlag) {
USE(atten_antialiased_rgba_point);
}
@@ -245,7 +244,7 @@ _swrast_choose_point( GLcontext *ctx )
USE(atten_general_ci_point);
}
}
- else if (ctx->Texture._ReallyEnabled && rgbMode) {
+ else if (ctx->Texture._EnabledUnits && rgbMode) {
/* textured */
USE(textured_rgba_point);
}
diff --git a/xc/extras/Mesa/src/swrast/s_points.h b/xc/extras/Mesa/src/swrast/s_points.h
index 0b2ec5ba6..40b442e95 100644
--- a/xc/extras/Mesa/src/swrast/s_points.h
+++ b/xc/extras/Mesa/src/swrast/s_points.h
@@ -1,4 +1,3 @@
-/* $Id: s_points.h,v 1.1.1.1 2002/10/22 13:06:58 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -30,10 +29,10 @@
#include "mtypes.h"
-void
+extern void
_swrast_choose_point( GLcontext *ctx );
-void
+extern void
_swrast_add_spec_terms_point( GLcontext *ctx,
const SWvertex *v0 );
diff --git a/xc/extras/Mesa/src/swrast/s_pointtemp.h b/xc/extras/Mesa/src/swrast/s_pointtemp.h
index efef56bc0..8f07fa25a 100644
--- a/xc/extras/Mesa/src/swrast/s_pointtemp.h
+++ b/xc/extras/Mesa/src/swrast/s_pointtemp.h
@@ -1,10 +1,9 @@
-/* $Id: s_pointtemp.h,v 1.1.1.1 2002/10/22 13:06:54 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 5.0
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -36,7 +35,7 @@
* SPECULAR = do separate specular color
* LARGE = do points with diameter > 1 pixel
* ATTENUATE = compute point size attenuation
- * SPRITE = GL_MESA_sprite_point
+ * SPRITE = GL_NV_point_sprite
*
* Notes: LARGE and ATTENUATE are exclusive of each other.
* TEXTURE requires RGBA
@@ -53,7 +52,7 @@
* else if d > rmax2 then
* fragment has 0% coverage
* else
- * fragement has % coverage = (d - rmin2) / (rmax2 - rmin2)
+ * fragment has % coverage = (d - rmin2) / (rmax2 - rmin2)
*/
@@ -61,49 +60,76 @@
static void
NAME ( GLcontext *ctx, const SWvertex *vert )
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- struct pixel_buffer *PB = swrast->PB;
-
- const GLint z = (GLint) (vert->win[2]);
-
+#if FLAGS & (ATTENUATE | LARGE | SMOOTH | SPRITE)
+ GLfloat size;
+#endif
+#if FLAGS & ATTENUATE
+ GLfloat alphaAtten;
+#endif
#if FLAGS & RGBA
const GLchan red = vert->color[0];
const GLchan green = vert->color[1];
const GLchan blue = vert->color[2];
- GLchan alpha = vert->color[3];
+ const GLchan alpha = vert->color[3];
+#endif
#if FLAGS & SPECULAR
- const GLchan sRed = vert->specular[0];
- const GLchan sGreen = vert->specular[1];
- const GLchan sBlue = vert->specular[2];
+ const GLchan specRed = vert->specular[0];
+ const GLchan specGreen = vert->specular[1];
+ const GLchan specBlue = vert->specular[2];
#endif
-#else
- GLint index = vert->index;
+#if FLAGS & INDEX
+ const GLuint colorIndex = vert->index;
#endif
-#if FLAGS & (ATTENUATE | LARGE | SMOOTH)
- GLfloat size;
-#endif
-#if FLAGS & ATTENUATE
- GLfloat alphaAtten;
-#endif
-
#if FLAGS & TEXTURE
GLfloat texcoord[MAX_TEXTURE_UNITS][4];
GLuint u;
+#endif
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ struct sw_span *span = &(swrast->PointSpan);
+
+ /* Cull primitives with malformed coordinates.
+ */
+ {
+ float tmp = vert->win[0] + vert->win[1];
+ if (IS_INF_OR_NAN(tmp))
+ return;
+ }
+
+ /*
+ * Span init
+ */
+ span->interpMask = SPAN_FOG;
+ span->arrayMask = SPAN_XY | SPAN_Z;
+ span->fog = vert->fog;
+ span->fogStep = 0.0;
+#if FLAGS & RGBA
+ span->arrayMask |= SPAN_RGBA;
+#endif
+#if FLAGS & SPECULAR
+ span->arrayMask |= SPAN_SPEC;
+#endif
+#if FLAGS & INDEX
+ span->arrayMask |= SPAN_INDEX;
+#endif
+#if FLAGS & TEXTURE
+ span->arrayMask |= SPAN_TEXTURE;
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
if (ctx->Texture.Unit[u]._ReallyEnabled) {
- if (vert->texcoord[u][3] != 1.0 && vert->texcoord[u][3] != 0.0) {
- texcoord[u][0] = vert->texcoord[u][0] / vert->texcoord[u][3];
- texcoord[u][1] = vert->texcoord[u][1] / vert->texcoord[u][3];
- texcoord[u][2] = vert->texcoord[u][2] / vert->texcoord[u][3];
- }
- else {
- texcoord[u][0] = vert->texcoord[u][0];
- texcoord[u][1] = vert->texcoord[u][1];
- texcoord[u][2] = vert->texcoord[u][2];
- }
+ const GLfloat q = vert->texcoord[u][3];
+ const GLfloat invQ = (q == 0.0F || q == 1.0F) ? 1.0F : (1.0F / q);
+ texcoord[u][0] = vert->texcoord[u][0] * invQ;
+ texcoord[u][1] = vert->texcoord[u][1] * invQ;
+ texcoord[u][2] = vert->texcoord[u][2] * invQ;
+ texcoord[u][3] = q;
}
}
#endif
+#if FLAGS & SMOOTH
+ span->arrayMask |= SPAN_COVERAGE;
+#endif
+#if FLAGS & SPRITE
+ span->arrayMask |= SPAN_TEXTURE;
+#endif
#if FLAGS & ATTENUATE
if (vert->pointSize >= ctx->Point.Threshold) {
@@ -115,78 +141,19 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
size = MAX2(ctx->Point.Threshold, ctx->Point.MinSize);
alphaAtten = dsize * dsize;
}
-#elif FLAGS & (LARGE | SMOOTH)
+#elif FLAGS & (LARGE | SMOOTH | SPRITE)
size = ctx->Point._Size;
#endif
- /* Cull primitives with malformed coordinates.
+#if FLAGS & (ATTENUATE | LARGE | SMOOTH | SPRITE)
+ /*
+ * Multi-pixel points
*/
- {
- float tmp = vert->win[0] + vert->win[1];
- if (IS_INF_OR_NAN(tmp))
- return;
- }
-
-#if FLAGS & SPRITE
- {
- SWcontext *swctx = SWRAST_CONTEXT(ctx);
- const GLfloat radius = 0.5F * vert->pointSize; /* XXX threshold, alpha */
- SWvertex v0, v1, v2, v3;
- GLuint unit;
-
- (void) red;
- (void) green;
- (void) blue;
- (void) alpha;
- (void) z;
-
- /* lower left corner */
- v0 = *vert;
- v0.win[0] -= radius;
- v0.win[1] -= radius;
-
- /* lower right corner */
- v1 = *vert;
- v1.win[0] += radius;
- v1.win[1] -= radius;
-
- /* upper right corner */
- v2 = *vert;
- v2.win[0] += radius;
- v2.win[1] += radius;
-
- /* upper left corner */
- v3 = *vert;
- v3.win[0] -= radius;
- v3.win[1] += radius;
-
- for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
- if (ctx->Texture.Unit[unit]._ReallyEnabled) {
- v0.texcoord[unit][0] = 0.0;
- v0.texcoord[unit][1] = 0.0;
- v1.texcoord[unit][0] = 1.0;
- v1.texcoord[unit][1] = 0.0;
- v2.texcoord[unit][0] = 1.0;
- v2.texcoord[unit][1] = 1.0;
- v3.texcoord[unit][0] = 0.0;
- v3.texcoord[unit][1] = 1.0;
- }
- }
-
- /* XXX if radius < threshold, attenuate alpha? */
-
- /* XXX need to implement clipping!!! */
-
- /* render */
- swctx->Triangle(ctx, &v0, &v1, &v2);
- swctx->Triangle(ctx, &v0, &v2, &v3);
- }
-
-#elif FLAGS & (LARGE | ATTENUATE | SMOOTH)
-
- {
+ {{
GLint x, y;
const GLfloat radius = 0.5F * size;
+ const GLint z = (GLint) (vert->win[2] + 0.5F);
+ GLuint count;
#if FLAGS & SMOOTH
const GLfloat rmin = radius - 0.7071F; /* 0.7071 = sqrt(2)/2 */
const GLfloat rmax = radius + 0.7071F;
@@ -218,109 +185,186 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
ymin = (GLint) vert->win[1] - iRadius + 1;
ymax = ymin + iSize - 1;
}
+#endif /*SMOOTH*/
+
+ /* 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 FLAGS & (TEXTURE | SPRITE)
+ if (ctx->Texture._EnabledUnits)
+ _mesa_write_texture_span(ctx, span);
+ else
+ _mesa_write_rgba_span(ctx, span);
+#elif FLAGS & RGBA
+ _mesa_write_rgba_span(ctx, span);
+#else
+ _mesa_write_index_span(ctx, span);
#endif
- (void) radius;
+ span->end = 0;
+ }
+ /*
+ * OK, generate fragments
+ */
+ count = span->end;
+ (void) radius;
for (y = ymin; y <= ymax; y++) {
for (x = xmin; x <= xmax; x++) {
-#if FLAGS & SMOOTH
- /* compute coverage */
- const GLfloat dx = x - vert->win[0] + 0.5F;
- const GLfloat dy = y - vert->win[1] + 0.5F;
- const GLfloat dist2 = dx * dx + dy * dy;
- if (dist2 < rmax2) {
-#if FLAGS & RGBA
- alpha = vert->color[3];
+#if FLAGS & (SPRITE | TEXTURE)
+ GLuint u;
#endif
- if (dist2 >= rmin2) {
- /* compute partial coverage */
- PB_COVERAGE(PB, 1.0F - (dist2 - rmin2) * cscale);
- }
- else {
- /* full coverage */
- PB_COVERAGE(PB, 1.0F);
- }
-
-#endif /* SMOOTH */
-#if ((FLAGS & (ATTENUATE | RGBA)) == (ATTENUATE | RGBA))
- alpha = (GLchan) (alpha * alphaAtten);
+#if FLAGS & RGBA
+ span->array->rgba[count][RCOMP] = red;
+ span->array->rgba[count][GCOMP] = green;
+ span->array->rgba[count][BCOMP] = blue;
+ span->array->rgba[count][ACOMP] = alpha;
#endif
-
#if FLAGS & SPECULAR
- PB_WRITE_MULTITEX_SPEC_PIXEL(PB, x, y, z, vert->fog,
- red, green, blue, alpha,
- sRed, sGreen, sBlue,
- texcoord);
-#elif FLAGS & TEXTURE
- if (ctx->Texture._ReallyEnabled > TEXTURE0_ANY) {
- PB_WRITE_MULTITEX_PIXEL(PB, x, y, z, vert->fog,
- red, green, blue, alpha,
- texcoord);
- }
- else if (ctx->Texture._ReallyEnabled) {
- PB_WRITE_TEX_PIXEL(PB, x,y,z, vert->fog,
- red, green, blue, alpha,
- texcoord[0][0],
- texcoord[0][1],
- texcoord[0][2]);
- }
- else {
- PB_WRITE_RGBA_PIXEL(PB, x, y, z, vert->fog,
- red, green, blue, alpha);
- }
-#elif FLAGS & RGBA
- PB_WRITE_RGBA_PIXEL(PB, x, y, z, vert->fog,
- red, green, blue, alpha);
-#else /* color index */
- PB_WRITE_CI_PIXEL(PB, x, y, z, vert->fog, index);
+ span->array->spec[count][RCOMP] = specRed;
+ span->array->spec[count][GCOMP] = specGreen;
+ span->array->spec[count][BCOMP] = specBlue;
#endif
-#if FLAGS & SMOOTH
- }
+#if FLAGS & INDEX
+ span->array->index[count] = colorIndex;
+#endif
+#if FLAGS & TEXTURE
+ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
+ if (ctx->Texture.Unit[u]._ReallyEnabled) {
+ COPY_4V(span->array->texcoords[u][count], texcoord[u]);
+ }
+ }
#endif
- }
- }
#if FLAGS & SMOOTH
- PB->haveCoverage = GL_TRUE;
+ /* compute coverage */
+ {
+ const GLfloat dx = x - vert->win[0] + 0.5F;
+ const GLfloat dy = y - vert->win[1] + 0.5F;
+ const GLfloat dist2 = dx * dx + dy * dy;
+ if (dist2 < rmax2) {
+ if (dist2 >= rmin2) {
+ /* compute partial coverage */
+ span->array->coverage[count] = 1.0F - (dist2 - rmin2) * cscale;
+#if FLAGS & INDEX
+ /* coverage in [0,15] */
+ span->array->coverage[count] *= 15.0;
#endif
+ }
+ else {
+ /* full coverage */
+ span->array->coverage[count] = 1.0F;
+ }
+
+ span->array->x[count] = x;
+ span->array->y[count] = y;
+ span->array->z[count] = z;
+
+#if (FLAGS & ATTENUATE) && (FLAGS & RGBA)
+ span->array->rgba[count][ACOMP] = (GLchan) (alpha * alphaAtten);
+#elif FLAGS & RGBA
+ span->array->rgba[count][ACOMP] = alpha;
+#endif /*ATTENUATE*/
+ count++;
+ } /*if*/
+ }
- PB_CHECK_FLUSH(ctx,PB);
- }
+#else /*SMOOTH*/
-#else /* LARGE || ATTENUATE || SMOOTH*/
+ /* not smooth (square points) */
+ span->array->x[count] = x;
+ span->array->y[count] = y;
+ span->array->z[count] = z;
- {
- /* size == 1 */
- GLint x = (GLint) vert->win[0];
- GLint y = (GLint) vert->win[1];
-#if ((FLAGS & (SPECULAR | TEXTURE)) == (SPECULAR | TEXTURE))
- PB_WRITE_MULTITEX_SPEC_PIXEL(PB, x, y, z, vert->fog,
- red, green, blue, alpha,
- sRed, sGreen, sBlue,
- texcoord);
-#elif FLAGS & TEXTURE
- if (ctx->Texture._ReallyEnabled > TEXTURE0_ANY) {
- PB_WRITE_MULTITEX_PIXEL(PB, x, y, z, vert->fog,
- red, green, blue, alpha, texcoord );
- }
- else {
- PB_WRITE_TEX_PIXEL(PB, x, y, z, vert->fog,
- red, green, blue, alpha,
- texcoord[0][0], texcoord[0][1], texcoord[0][2]);
- }
+#if FLAGS & SPRITE
+ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
+ if (ctx->Texture.Unit[u]._ReallyEnabled) {
+ if (ctx->Point.CoordReplace[u]) {
+ GLfloat s = 0.5F + (x + 0.5F - vert->win[0]) / size;
+ GLfloat t = 0.5F - (y + 0.5F - vert->win[1]) / size;
+ span->array->texcoords[u][count][0] = s;
+ span->array->texcoords[u][count][1] = t;
+ span->array->texcoords[u][count][3] = 1.0F;
+ if (ctx->Point.SpriteRMode == GL_ZERO)
+ span->array->texcoords[u][count][2] = 0.0F;
+ else if (ctx->Point.SpriteRMode == GL_S)
+ span->array->texcoords[u][count][2] = vert->texcoord[u][0];
+ else /* GL_R */
+ span->array->texcoords[u][count][2] = vert->texcoord[u][2];
+ }
+ else {
+ COPY_4V(span->array->texcoords[u][count], vert->texcoord[u]);
+ }
+ }
+ }
+#endif /*SPRITE*/
+
+ count++; /* square point */
+
+#endif /*SMOOTH*/
+
+ } /*for x*/
+ } /*for y*/
+ span->end = count;
+ }}
+
+#else /* LARGE | ATTENUATE | SMOOTH | SPRITE */
+
+ /*
+ * Single-pixel points
+ */
+ {{
+ GLuint count;
+
+ /* check if we need to flush */
+ if (span->end >= MAX_WIDTH ||
+ (swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT))) {
+#if FLAGS & (TEXTURE | SPRITE)
+ if (ctx->Texture._EnabledUnits)
+ _mesa_write_texture_span(ctx, span);
+ else
+ _mesa_write_rgba_span(ctx, span);
#elif FLAGS & RGBA
- /* rgba size 1 point */
- alpha = vert->color[3];
- PB_WRITE_RGBA_PIXEL(PB, x, y, z, vert->fog, red, green, blue, alpha);
+ _mesa_write_rgba_span(ctx, span);
#else
- /* color index size 1 point */
- PB_WRITE_CI_PIXEL(PB, x, y, z, vert->fog, index);
+ _mesa_write_index_span(ctx, span);
#endif
- }
+ span->end = 0;
+ }
+
+ count = span->end;
+
+#if FLAGS & RGBA
+ span->array->rgba[count][RCOMP] = red;
+ span->array->rgba[count][GCOMP] = green;
+ span->array->rgba[count][BCOMP] = blue;
+ span->array->rgba[count][ACOMP] = alpha;
+#endif
+#if FLAGS & SPECULAR
+ span->array->spec[count][RCOMP] = specRed;
+ span->array->spec[count][GCOMP] = specGreen;
+ span->array->spec[count][BCOMP] = specBlue;
+#endif
+#if FLAGS & INDEX
+ span->array->index[count] = colorIndex;
+#endif
+#if FLAGS & TEXTURE
+ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
+ if (ctx->Texture.Unit[u]._ReallyEnabled) {
+ COPY_4V(span->array->texcoords[u][count], texcoord[u]);
+ }
+ }
+#endif
+
+ span->array->x[count] = (GLint) vert->win[0];
+ span->array->y[count] = (GLint) vert->win[1];
+ span->array->z[count] = (GLint) (vert->win[2] + 0.5F);
+ span->end = count + 1;
+ }}
+
#endif /* LARGE || ATTENUATE || SMOOTH */
- PB_CHECK_FLUSH(ctx, PB);
+ ASSERT(span->end <= MAX_WIDTH);
}
diff --git a/xc/extras/Mesa/src/swrast/s_readpix.c b/xc/extras/Mesa/src/swrast/s_readpix.c
index 666baa286..672109982 100644
--- a/xc/extras/Mesa/src/swrast/s_readpix.c
+++ b/xc/extras/Mesa/src/swrast/s_readpix.c
@@ -1,8 +1,7 @@
-/* $Id: s_readpix.c,v 1.1.1.1 2002/10/22 13:06:56 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -32,7 +31,7 @@
#include "feedback.h"
#include "image.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "pixel.h"
#include "s_alphabuf.h"
@@ -62,9 +61,7 @@ read_index_pixels( GLcontext *ctx,
return;
}
- ASSERT(swrast->Driver.SetReadBuffer);
- (*swrast->Driver.SetReadBuffer)(ctx, ctx->ReadBuffer,
- ctx->Pixel.DriverReadBuffer);
+ _swrast_use_read_buffer(ctx);
readWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width;
@@ -82,8 +79,7 @@ read_index_pixels( GLcontext *ctx,
&ctx->Pack, ctx->_ImageTransferState);
}
- (*swrast->Driver.SetReadBuffer)(ctx, ctx->DrawBuffer,
- ctx->Color.DriverDrawBuffer);
+ _swrast_use_draw_buffer(ctx);
}
@@ -282,8 +278,15 @@ read_fast_rgba_pixels( GLcontext *ctx,
if (0) {
#endif
GLchan *dest = (GLchan *) pixels
- + (skipRows * rowLength + skipPixels) * 4;
+ + (skipRows * rowLength + skipPixels) * 4;
GLint row;
+
+ if (packing->Invert) {
+ /* start at top and go down */
+ dest += (readHeight - 1) * rowLength * 4;
+ rowLength = -rowLength;
+ }
+
for (row=0; row<readHeight; row++) {
(*swrast->Driver.ReadRGBASpan)(ctx, readWidth, srcX, srcY,
(GLchan (*)[4]) dest);
@@ -318,13 +321,13 @@ read_rgba_pixels( GLcontext *ctx,
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLint readWidth;
- (*swrast->Driver.SetReadBuffer)(ctx, ctx->ReadBuffer, ctx->Pixel.DriverReadBuffer);
+ _swrast_use_read_buffer(ctx);
/* Try optimized path first */
if (read_fast_rgba_pixels( ctx, x, y, width, height,
format, type, pixels, packing )) {
- (*swrast->Driver.SetReadBuffer)(ctx, ctx->DrawBuffer, ctx->Color.DriverDrawBuffer);
+ _swrast_use_draw_buffer(ctx);
return; /* done! */
}
@@ -470,7 +473,7 @@ read_rgba_pixels( GLcontext *ctx,
}
}
- (*swrast->Driver.SetReadBuffer)(ctx, ctx->DrawBuffer, ctx->Color.DriverDrawBuffer);
+ _swrast_use_draw_buffer(ctx);
}
diff --git a/xc/extras/Mesa/src/swrast/s_scissor.c b/xc/extras/Mesa/src/swrast/s_scissor.c
deleted file mode 100644
index 3558b91d0..000000000
--- a/xc/extras/Mesa/src/swrast/s_scissor.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* $Id: s_scissor.c,v 1.1.1.1 2002/10/22 13:06:51 alanh 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.
- */
-
-
-#include "glheader.h"
-#include "macros.h"
-#include "mem.h"
-#include "s_context.h"
-#include "s_scissor.h"
-
-
-/*
- * Apply the scissor test to a span of pixels.
- * Return: 0 = all pixels in the span are outside the scissor box.
- * n = mask[n-1] is the last one to be visible
- */
-GLuint
-_mesa_scissor_span(GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte mask[])
-{
- /* first check if whole span is outside the scissor box */
- if (y < ctx->DrawBuffer->_Ymin
- || y >= ctx->DrawBuffer->_Ymax
- || x > ctx->DrawBuffer->_Xmax
- || x + (GLint) n - 1 < ctx->DrawBuffer->_Xmin) {
- return 0;
- }
- else {
- const GLint xMin = ctx->DrawBuffer->_Xmin;
- const GLint xMax = ctx->DrawBuffer->_Xmax;
-
- if (x < xMin)
- BZERO(mask, (xMin-x) * sizeof(GLubyte));
-
- if (x + (GLint) n > xMax) {
- BZERO(mask + xMax - x, (n - (xMax - x)) * sizeof(GLubyte));
- return (GLuint) (xMax - x);
- }
-
- return n;
- }
-}
diff --git a/xc/extras/Mesa/src/swrast/s_span.c b/xc/extras/Mesa/src/swrast/s_span.c
index 375fe6a96..784279c7d 100644
--- a/xc/extras/Mesa/src/swrast/s_span.c
+++ b/xc/extras/Mesa/src/swrast/s_span.c
@@ -1,8 +1,7 @@
-/* $Id: s_span.c,v 1.1.1.1 2002/10/22 13:06:57 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 5.0.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -25,16 +24,19 @@
*/
-/*
- * pixel span rasterization:
- * These functions implement the rasterization pipeline.
+/**
+ * \file swrast/s_span.c
+ * \brief Span processing functions used by all rasterization functions.
+ * This is where all the per-fragment tests are performed
+ * \author Brian Paul
*/
-
#include "glheader.h"
#include "colormac.h"
+#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "mmath.h"
+#include "imports.h"
#include "s_alpha.h"
#include "s_alphabuf.h"
@@ -44,743 +46,1050 @@
#include "s_fog.h"
#include "s_logic.h"
#include "s_masking.h"
-#include "s_scissor.h"
#include "s_span.h"
#include "s_stencil.h"
#include "s_texture.h"
+/**
+ * Init span's Z interpolation values to the RasterPos Z.
+ * Used during setup for glDraw/CopyPixels.
+ */
+void
+_mesa_span_default_z( GLcontext *ctx, struct sw_span *span )
+{
+ if (ctx->Visual.depthBits <= 16)
+ span->z = FloatToFixed(ctx->Current.RasterPos[2] * ctx->DepthMax + 0.5F);
+ else
+ span->z = (GLint) (ctx->Current.RasterPos[2] * ctx->DepthMax + 0.5F);
+ span->zStep = 0;
+ span->interpMask |= SPAN_Z;
+}
-/*
- * Apply the current polygon stipple pattern to a span of pixels.
+
+/**
+ * Init span's fog interpolation values to the RasterPos fog.
+ * Used during setup for glDraw/CopyPixels.
*/
-static void
-stipple_polygon_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- GLubyte mask[] )
+void
+_mesa_span_default_fog( GLcontext *ctx, struct sw_span *span )
{
- const GLuint highbit = 0x80000000;
- GLuint i, m, stipple;
+ span->fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
+ span->fogStep = 0;
+ span->interpMask |= SPAN_FOG;
+}
- stipple = ctx->PolygonStipple[y % 32];
- m = highbit >> (GLuint) (x % 32);
- for (i = 0; i < n; i++) {
- if ((m & stipple) == 0) {
- mask[i] = 0;
- }
- m = m >> 1;
- if (m == 0) {
- m = highbit;
- }
+/**
+ * Init span's color or index interpolation values to the RasterPos color.
+ * Used during setup for glDraw/CopyPixels.
+ */
+void
+_mesa_span_default_color( GLcontext *ctx, struct sw_span *span )
+{
+ if (ctx->Visual.rgbMode) {
+ GLchan r, g, b, a;
+ UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterColor[0]);
+ UNCLAMPED_FLOAT_TO_CHAN(g, ctx->Current.RasterColor[1]);
+ UNCLAMPED_FLOAT_TO_CHAN(b, ctx->Current.RasterColor[2]);
+ UNCLAMPED_FLOAT_TO_CHAN(a, ctx->Current.RasterColor[3]);
+#if CHAN_TYPE == GL_FLOAT
+ span->red = r;
+ span->green = g;
+ span->blue = b;
+ span->alpha = a;
+#else
+ span->red = IntToFixed(r);
+ span->green = IntToFixed(g);
+ span->blue = IntToFixed(b);
+ span->alpha = IntToFixed(a);
+#endif
+ span->redStep = 0;
+ span->greenStep = 0;
+ span->blueStep = 0;
+ span->alphaStep = 0;
+ span->interpMask |= SPAN_RGBA;
+ }
+ else {
+ span->index = IntToFixed(ctx->Current.RasterIndex);
+ span->indexStep = 0;
+ span->interpMask |= SPAN_INDEX;
}
}
-
-/*
- * Clip a pixel span to the current buffer/window boundaries.
- * Return: 'n' such that pixel 'n', 'n+1' etc. are clipped,
- * as a special case:
- * 0 = all pixels clipped
+/**
+ * Init span's texcoord interpolation values to the RasterPos texcoords.
+ * Used during setup for glDraw/CopyPixels.
*/
-static GLuint
-clip_span( GLcontext *ctx, GLint n, GLint x, GLint y, GLubyte mask[] )
+void
+_mesa_span_default_texcoords( GLcontext *ctx, struct sw_span *span )
{
- /* Clip to top and bottom */
- if (y < 0 || y >= (GLint) ctx->DrawBuffer->Height) {
- return 0;
+ GLuint i;
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
+ COPY_4V(span->tex[i], ctx->Current.RasterTexCoords[i]);
+ ASSIGN_4V(span->texStepX[i], 0.0F, 0.0F, 0.0F, 0.0F);
+ ASSIGN_4V(span->texStepY[i], 0.0F, 0.0F, 0.0F, 0.0F);
}
+ span->interpMask |= SPAN_TEXTURE;
+}
+
+
+/* Fill in the span.color.rgba array from the interpolation values */
+static void
+interpolate_colors(GLcontext *ctx, struct sw_span *span)
+{
+ 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;
+ const GLuint n = span->end;
+ GLchan (*rgba)[4] = span->array->rgba;
+ GLuint i;
- /* Clip to the left */
- if (x < 0) {
- if (x + n <= 0) {
- /* completely off left side */
- return 0;
+ ASSERT((span->interpMask & SPAN_RGBA) &&
+ !(span->arrayMask & SPAN_RGBA));
+
+ if (span->interpMask & SPAN_FLAT) {
+ /* constant color */
+ GLchan color[4];
+ color[RCOMP] = FixedToChan(r);
+ color[GCOMP] = FixedToChan(g);
+ color[BCOMP] = FixedToChan(b);
+ color[ACOMP] = FixedToChan(a);
+ for (i = 0; i < n; i++) {
+ COPY_CHAN4(span->array->rgba[i], color);
}
- else {
- /* partially off left side */
- BZERO(mask, -x * sizeof(GLubyte));
+ }
+ else {
+ /* interpolate */
+ 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;
}
}
+ span->arrayMask |= SPAN_RGBA;
+}
+
- /* Clip to right */
- if (x + n > (GLint) ctx->DrawBuffer->Width) {
- if (x >= (GLint) ctx->DrawBuffer->Width) {
- /* completely off right side */
- return 0;
+/* Fill in the span.color.index array from the interpolation values */
+static void
+interpolate_indexes(GLcontext *ctx, struct sw_span *span)
+{
+ GLfixed index = span->index;
+ const GLint indexStep = span->indexStep;
+ const GLuint n = span->end;
+ GLuint *indexes = span->array->index;
+ GLuint i;
+ ASSERT((span->interpMask & SPAN_INDEX) &&
+ !(span->arrayMask & SPAN_INDEX));
+
+ if ((span->interpMask & SPAN_FLAT) || (indexStep == 0)) {
+ /* constant color */
+ index = FixedToInt(index);
+ for (i = 0; i < n; i++) {
+ indexes[i] = index;
}
- else {
- /* partially off right side */
- return ctx->DrawBuffer->Width - x;
+ }
+ else {
+ /* interpolate */
+ for (i = 0; i < n; i++) {
+ indexes[i] = FixedToInt(index);
+ index += indexStep;
}
}
-
- return n;
+ span->arrayMask |= SPAN_INDEX;
}
-
-/*
- * Draw to more than one color buffer (or none).
- */
+/* Fill in the span.->array->spec array from the interpolation values */
static void
-multi_write_index_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLuint indexes[], const GLubyte mask[] )
+interpolate_specular(GLcontext *ctx, struct sw_span *span)
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLuint bufferBit;
+ 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;
+}
- if (ctx->Color.DrawBuffer == GL_NONE)
- return;
- /* loop over four possible dest color buffers */
- for (bufferBit = 1; bufferBit <= 8; bufferBit = bufferBit << 1) {
- if (bufferBit & ctx->Color.DrawDestMask) {
- GLuint indexTmp[MAX_WIDTH];
- ASSERT(n < MAX_WIDTH);
+/* Fill in the span.zArray array from the interpolation values */
+void
+_mesa_span_interpolate_z( const GLcontext *ctx, struct sw_span *span )
+{
+ const GLuint n = span->end;
+ GLuint i;
- if (bufferBit == FRONT_LEFT_BIT)
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_LEFT);
- else if (bufferBit == FRONT_RIGHT_BIT)
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_RIGHT);
- else if (bufferBit == BACK_LEFT_BIT)
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_LEFT);
- else
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_RIGHT);
+ ASSERT((span->interpMask & SPAN_Z) &&
+ !(span->arrayMask & SPAN_Z));
- /* make copy of incoming indexes */
- MEMCPY( indexTmp, indexes, n * sizeof(GLuint) );
- if (ctx->Color.IndexLogicOpEnabled) {
- _mesa_logicop_ci_span( ctx, n, x, y, indexTmp, mask );
- }
- if (ctx->Color.IndexMask == 0) {
- break;
- }
- else if (ctx->Color.IndexMask != 0xffffffff) {
- _mesa_mask_index_span( ctx, n, x, y, indexTmp );
- }
- (*swrast->Driver.WriteCI32Span)( ctx, n, x, y, indexTmp, mask );
+ if (ctx->Visual.depthBits <= 16) {
+ GLfixed zval = span->z;
+ GLdepth *z = span->array->z;
+ for (i = 0; i < n; i++) {
+ z[i] = FixedToInt(zval);
+ zval += span->zStep;
}
}
-
- /* restore default dest buffer */
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, ctx->Color.DriverDrawBuffer);
+ else {
+ /* Deep Z buffer, no fixed->int shift */
+ GLfixed zval = span->z;
+ GLdepth *z = span->array->z;
+ for (i = 0; i < n; i++) {
+ z[i] = zval;
+ zval += span->zStep;
+ }
+ }
+ span->arrayMask |= SPAN_Z;
}
-
/*
- * Write a horizontal span of color index pixels to the frame buffer.
- * Stenciling, Depth-testing, etc. are done as needed.
- * Input: n - number of pixels in the span
- * x, y - location of leftmost pixel in the span
- * z - array of [n] z-values
- * fog - array of fog factor values in [0,1]
- * index - array of [n] color indexes
- * primitive - either GL_POINT, GL_LINE, GL_POLYGON, or GL_BITMAP
+ * This the ideal solution, as given in the OpenGL spec.
*/
-void
-_mesa_write_index_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], const GLfloat fog[],
- GLuint indexIn[], const GLint coverage[],
- GLenum primitive )
+#if 0
+static GLfloat
+compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy,
+ GLfloat dqdx, GLfloat dqdy, GLfloat texW, GLfloat texH,
+ GLfloat s, GLfloat t, GLfloat q, GLfloat invQ)
{
- const GLuint modBits = FOG_BIT | BLEND_BIT | MASKING_BIT | LOGIC_OP_BIT;
- GLubyte mask[MAX_WIDTH];
- GLuint indexBackup[MAX_WIDTH];
- GLuint *index; /* points to indexIn or indexBackup */
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLfloat dudx = texW * ((s + dsdx) / (q + dqdx) - s * invQ);
+ GLfloat dvdx = texH * ((t + dtdx) / (q + dqdx) - t * invQ);
+ GLfloat dudy = texW * ((s + dsdy) / (q + dqdy) - s * invQ);
+ GLfloat dvdy = texH * ((t + dtdy) / (q + dqdy) - t * invQ);
+ GLfloat x = sqrt(dudx * dudx + dvdx * dvdx);
+ GLfloat y = sqrt(dudy * dudy + dvdy * dvdy);
+ GLfloat rho = MAX2(x, y);
+ GLfloat lambda = LOG2(rho);
+ return lambda;
+}
+#endif
- /* init mask to 1's (all pixels are to be written) */
- MEMSET(mask, 1, n);
- if ((swrast->_RasterMask & WINCLIP_BIT) || primitive==GL_BITMAP) {
- if ((n = clip_span(ctx,n,x,y,mask)) == 0) {
- return;
- }
- }
+/*
+ * This is a faster approximation
+ */
+static GLfloat
+compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy,
+ GLfloat dqdx, GLfloat dqdy, GLfloat texW, GLfloat texH,
+ GLfloat s, GLfloat t, GLfloat q, GLfloat invQ)
+{
+ GLfloat dsdx2 = (s + dsdx) / (q + dqdx) - s * invQ;
+ GLfloat dtdx2 = (t + dtdx) / (q + dqdx) - t * invQ;
+ GLfloat dsdy2 = (s + dsdy) / (q + dqdy) - s * invQ;
+ GLfloat dtdy2 = (t + dtdy) / (q + dqdy) - t * invQ;
+ GLfloat maxU, maxV, rho, lambda;
+ dsdx2 = FABSF(dsdx2);
+ dsdy2 = FABSF(dsdy2);
+ dtdx2 = FABSF(dtdx2);
+ dtdy2 = FABSF(dtdy2);
+ maxU = MAX2(dsdx2, dsdy2) * texW;
+ maxV = MAX2(dtdx2, dtdy2) * texH;
+ rho = MAX2(maxU, maxV);
+ lambda = LOG2(rho);
+ return lambda;
+}
- if ((primitive==GL_BITMAP && (swrast->_RasterMask & modBits))
- || (swrast->_RasterMask & MULTI_DRAW_BIT)) {
- /* Make copy of color indexes */
- MEMCPY( indexBackup, indexIn, n * sizeof(GLuint) );
- index = indexBackup;
+/*
+ * Fill in the span.texcoords array from the interpolation values.
+ * XXX We could optimize here for the case when dq = 0. That would
+ * usually be the case when using an orthographic projection.
+ */
+static void
+interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
+{
+ ASSERT(span->interpMask & SPAN_TEXTURE);
+ ASSERT(!(span->arrayMask & SPAN_TEXTURE));
+
+ if (ctx->Texture._EnabledUnits > 1) {
+ /* multitexture */
+ GLuint u;
+ span->arrayMask |= SPAN_TEXTURE;
+ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
+ if (ctx->Texture.Unit[u]._ReallyEnabled) {
+ const struct gl_texture_object *obj =ctx->Texture.Unit[u]._Current;
+ const struct gl_texture_image *img = obj->Image[obj->BaseLevel];
+ GLboolean needLambda = (obj->MinFilter != obj->MagFilter);
+ if (needLambda) {
+ GLfloat (*texcoord)[4] = span->array->texcoords[u];
+ GLfloat *lambda = span->array->lambda[u];
+ const GLfloat texW = (GLfloat) img->WidthScale;
+ const GLfloat texH = (GLfloat) img->HeightScale;
+ const GLfloat dsdx = span->texStepX[u][0];
+ const GLfloat dsdy = span->texStepY[u][0];
+ const GLfloat dtdx = span->texStepX[u][1];
+ const GLfloat dtdy = span->texStepY[u][1];
+ const GLfloat drdx = span->texStepX[u][2];
+ const GLfloat dqdx = span->texStepX[u][3];
+ const GLfloat dqdy = span->texStepY[u][3];
+ GLfloat s = span->tex[u][0];
+ GLfloat t = span->tex[u][1];
+ GLfloat r = span->tex[u][2];
+ GLfloat q = span->tex[u][3];
+ GLuint i;
+ for (i = 0; i < span->end; i++) {
+ const GLfloat invQ = (q == 0.0F) ? 1.0F : (1.0F / q);
+ texcoord[i][0] = s * invQ;
+ texcoord[i][1] = t * invQ;
+ texcoord[i][2] = r * invQ;
+ lambda[i] = compute_lambda(dsdx, dsdy, dtdx, dtdy,
+ dqdx, dqdy, texW, texH,
+ s, t, q, invQ);
+ s += dsdx;
+ t += dtdx;
+ r += drdx;
+ q += dqdx;
+ }
+ span->arrayMask |= SPAN_LAMBDA;
+ }
+ else {
+ GLfloat (*texcoord)[4] = span->array->texcoords[u];
+ GLfloat *lambda = span->array->lambda[u];
+ const GLfloat dsdx = span->texStepX[u][0];
+ const GLfloat dtdx = span->texStepX[u][1];
+ const GLfloat drdx = span->texStepX[u][2];
+ const GLfloat dqdx = span->texStepX[u][3];
+ GLfloat s = span->tex[u][0];
+ GLfloat t = span->tex[u][1];
+ GLfloat r = span->tex[u][2];
+ GLfloat q = span->tex[u][3];
+ GLuint i;
+ if (dqdx == 0.0) {
+ /* Ortho projection or polygon's parallel to window X axis */
+ const GLfloat invQ = (q == 0.0F) ? 1.0F : (1.0F / q);
+ for (i = 0; i < span->end; i++) {
+ texcoord[i][0] = s * invQ;
+ texcoord[i][1] = t * invQ;
+ texcoord[i][2] = r * invQ;
+ lambda[i] = 0.0;
+ s += dsdx;
+ t += dtdx;
+ r += drdx;
+ }
+ }
+ else {
+ for (i = 0; i < span->end; i++) {
+ const GLfloat invQ = (q == 0.0F) ? 1.0F : (1.0F / q);
+ texcoord[i][0] = s * invQ;
+ texcoord[i][1] = t * invQ;
+ texcoord[i][2] = r * invQ;
+ lambda[i] = 0.0;
+ s += dsdx;
+ t += dtdx;
+ r += drdx;
+ q += dqdx;
+ }
+ }
+ } /* lambda */
+ } /* if */
+ } /* for */
}
else {
- index = indexIn;
- }
-
-
- /* Do the scissor test */
- if (ctx->Scissor.Enabled) {
- if ((n = _mesa_scissor_span( ctx, n, x, y, mask )) == 0) {
- return;
+ /* single texture */
+ const struct gl_texture_object *obj = ctx->Texture.Unit[0]._Current;
+ const struct gl_texture_image *img = obj->Image[obj->BaseLevel];
+ GLboolean needLambda = (obj->MinFilter != obj->MagFilter);
+ span->arrayMask |= SPAN_TEXTURE;
+ if (needLambda) {
+ /* just texture unit 0, with lambda */
+ GLfloat (*texcoord)[4] = span->array->texcoords[0];
+ GLfloat *lambda = span->array->lambda[0];
+ const GLfloat texW = (GLfloat) img->WidthScale;
+ const GLfloat texH = (GLfloat) img->HeightScale;
+ const GLfloat dsdx = span->texStepX[0][0];
+ const GLfloat dsdy = span->texStepY[0][0];
+ const GLfloat dtdx = span->texStepX[0][1];
+ const GLfloat dtdy = span->texStepY[0][1];
+ const GLfloat drdx = span->texStepX[0][2];
+ const GLfloat dqdx = span->texStepX[0][3];
+ const GLfloat dqdy = span->texStepY[0][3];
+ GLfloat s = span->tex[0][0];
+ GLfloat t = span->tex[0][1];
+ GLfloat r = span->tex[0][2];
+ GLfloat q = span->tex[0][3];
+ GLuint i;
+ for (i = 0; i < span->end; i++) {
+ const GLfloat invQ = (q == 0.0F) ? 1.0F : (1.0F / q);
+ lambda[i] = compute_lambda(dsdx, dsdy, dtdx, dtdy,
+ dqdx, dqdy, texW, texH,
+ s, t, q, invQ);
+ texcoord[i][0] = s * invQ;
+ texcoord[i][1] = t * invQ;
+ texcoord[i][2] = r * invQ;
+ s += dsdx;
+ t += dtdx;
+ r += drdx;
+ q += dqdx;
+ }
+ span->arrayMask |= SPAN_LAMBDA;
}
- }
-
- /* Polygon Stippling */
- if (ctx->Polygon.StippleFlag && primitive==GL_POLYGON) {
- stipple_polygon_span( ctx, n, x, y, mask );
- }
-
- if (ctx->Stencil.Enabled) {
- /* first stencil test */
- if (_mesa_stencil_and_ztest_span(ctx, n, x, y, z, mask) == GL_FALSE) {
- return;
+ else {
+ /* just texture 0, without lambda */
+ GLfloat (*texcoord)[4] = span->array->texcoords[0];
+ const GLfloat dsdx = span->texStepX[0][0];
+ const GLfloat dtdx = span->texStepX[0][1];
+ const GLfloat drdx = span->texStepX[0][2];
+ const GLfloat dqdx = span->texStepX[0][3];
+ GLfloat s = span->tex[0][0];
+ GLfloat t = span->tex[0][1];
+ GLfloat r = span->tex[0][2];
+ GLfloat q = span->tex[0][3];
+ GLuint i;
+ if (dqdx == 0.0) {
+ /* Ortho projection or polygon's parallel to window X axis */
+ const GLfloat invQ = (q == 0.0F) ? 1.0F : (1.0F / q);
+ for (i = 0; i < span->end; i++) {
+ texcoord[i][0] = s * invQ;
+ texcoord[i][1] = t * invQ;
+ texcoord[i][2] = r * invQ;
+ s += dsdx;
+ t += dtdx;
+ r += drdx;
+ }
+ }
+ else {
+ for (i = 0; i < span->end; i++) {
+ const GLfloat invQ = (q == 0.0F) ? 1.0F : (1.0F / q);
+ texcoord[i][0] = s * invQ;
+ texcoord[i][1] = t * invQ;
+ texcoord[i][2] = r * invQ;
+ s += dsdx;
+ t += dtdx;
+ r += drdx;
+ q += dqdx;
+ }
+ }
}
}
- else if (ctx->Depth.Test) {
- /* regular depth testing */
- if (_mesa_depth_test_span( ctx, n, x, y, z, mask ) == 0)
- return;
- }
+}
- /* if we get here, something passed the depth test */
- ctx->OcclusionResult = GL_TRUE;
- /* Per-pixel fog */
- if (ctx->Fog.Enabled) {
- if (fog && !swrast->_PreferPixelFog)
- _mesa_fog_ci_pixels( ctx, n, fog, index );
- else
- _mesa_depth_fog_ci_pixels( ctx, n, z, index );
- }
+/**
+ * Apply the current polygon stipple pattern to a span of pixels.
+ */
+static void
+stipple_polygon_span( GLcontext *ctx, struct sw_span *span )
+{
+ const GLuint highbit = 0x80000000;
+ const GLuint stipple = ctx->PolygonStipple[span->y % 32];
+ GLubyte *mask = span->array->mask;
+ GLuint i, m;
- /* Antialias coverage application */
- if (coverage) {
- GLuint i;
- for (i = 0; i < n; i++) {
- ASSERT(coverage[i] < 16);
- index[i] = (index[i] & ~0xf) | coverage[i];
- }
- }
+ ASSERT(ctx->Polygon.StippleFlag);
+ ASSERT((span->arrayMask & SPAN_XY) == 0);
- if (swrast->_RasterMask & MULTI_DRAW_BIT) {
- /* draw to zero or two or more buffers */
- multi_write_index_span( ctx, n, x, y, index, mask );
- }
- else {
- /* normal situation: draw to exactly one buffer */
- if (ctx->Color.IndexLogicOpEnabled) {
- _mesa_logicop_ci_span( ctx, n, x, y, index, mask );
- }
+ m = highbit >> (GLuint) (span->x % 32);
- if (ctx->Color.IndexMask == 0) {
- return;
+ for (i = 0; i < span->end; i++) {
+ if ((m & stipple) == 0) {
+ mask[i] = 0;
}
- else if (ctx->Color.IndexMask != 0xffffffff) {
- _mesa_mask_index_span( ctx, n, x, y, index );
+ m = m >> 1;
+ if (m == 0) {
+ m = highbit;
}
-
- /* write pixels */
- (*swrast->Driver.WriteCI32Span)( ctx, n, x, y, index, mask );
}
+ span->writeAll = GL_FALSE;
}
-
-
-void
-_mesa_write_monoindex_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], const GLfloat fog[],
- GLuint index, const GLint coverage[],
- GLenum primitive )
+/**
+ * Clip a pixel span to the current buffer/window boundaries:
+ * DrawBuffer->_Xmin, _Xmax, _Ymin, _Ymax. This will accomplish
+ * window clipping and scissoring.
+ * Return: GL_TRUE some pixels still visible
+ * GL_FALSE nothing visible
+ */
+static GLuint
+clip_span( GLcontext *ctx, struct sw_span *span )
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLubyte mask[MAX_WIDTH];
- GLuint i;
-
- /* init mask to 1's (all pixels are to be written) */
- MEMSET(mask, 1, n);
-
- if ((swrast->_RasterMask & WINCLIP_BIT) || primitive==GL_BITMAP) {
- if ((n = clip_span( ctx, n, x, y, mask)) == 0) {
- return;
+ const GLint xmin = ctx->DrawBuffer->_Xmin;
+ const GLint xmax = ctx->DrawBuffer->_Xmax;
+ const GLint ymin = ctx->DrawBuffer->_Ymin;
+ const GLint ymax = ctx->DrawBuffer->_Ymax;
+
+ if (span->arrayMask & SPAN_XY) {
+ /* arrays of x/y pixel coords */
+ const GLint *x = span->array->x;
+ const GLint *y = span->array->y;
+ const GLint n = span->end;
+ GLubyte *mask = span->array->mask;
+ GLint i;
+ if (span->arrayMask & SPAN_MASK) {
+ /* note: using & intead of && to reduce branches */
+ for (i = 0; i < n; i++) {
+ mask[i] &= (x[i] >= xmin) & (x[i] < xmax)
+ & (y[i] >= ymin) & (y[i] < ymax);
+ }
+ }
+ else {
+ /* note: using & intead of && to reduce branches */
+ for (i = 0; i < n; i++) {
+ mask[i] = (x[i] >= xmin) & (x[i] < xmax)
+ & (y[i] >= ymin) & (y[i] < ymax);
+ }
}
+ return GL_TRUE; /* some pixels visible */
}
+ else {
+ /* horizontal span of pixels */
+ const GLint x = span->x;
+ const GLint y = span->y;
+ const GLint n = span->end;
- /* Do the scissor test */
- if (ctx->Scissor.Enabled) {
- if ((n = _mesa_scissor_span( ctx, n, x, y, mask )) == 0) {
- return;
+ /* Trivial rejection tests */
+ if (y < ymin || y >= ymax || x + n <= xmin || x >= xmax) {
+ span->end = 0;
+ return GL_FALSE; /* all pixels clipped */
}
- }
- /* Polygon Stippling */
- if (ctx->Polygon.StippleFlag && primitive==GL_POLYGON) {
- stipple_polygon_span( ctx, n, x, y, mask );
- }
+ /* Clip to the left */
+ if (x < xmin) {
+ ASSERT(x + n > xmin);
+ span->writeAll = GL_FALSE;
+ _mesa_bzero(span->array->mask, (xmin - x) * sizeof(GLubyte));
+ }
- if (ctx->Stencil.Enabled) {
- /* first stencil test */
- if (_mesa_stencil_and_ztest_span(ctx, n, x, y, z, mask) == GL_FALSE) {
- return;
+ /* Clip to right */
+ if (x + n > xmax) {
+ ASSERT(x < xmax);
+ span->end = xmax - x;
}
+
+ return GL_TRUE; /* some pixels visible */
}
- else if (ctx->Depth.Test) {
- /* regular depth testing */
- if (_mesa_depth_test_span( ctx, n, x, y, z, mask ) == 0)
- return;
- }
+}
- /* if we get here, something passed the depth test */
- ctx->OcclusionResult = GL_TRUE;
- if (ctx->Color.DrawBuffer == GL_NONE) {
- /* write no pixels */
- return;
- }
- if (ctx->Fog.Enabled
- || ctx->Color.IndexLogicOpEnabled
- || ctx->Color.IndexMask != 0xffffffff
- || coverage) {
- /* different index per pixel */
- GLuint indexes[MAX_WIDTH];
- for (i = 0; i < n; i++) {
- indexes[i] = index;
- }
+/**
+ * Draw to more than one color buffer (or none).
+ */
+static void
+multi_write_index_span( GLcontext *ctx, struct sw_span *span )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint bufferBit;
- if (ctx->Fog.Enabled) {
- if (fog && !swrast->_PreferPixelFog)
- _mesa_fog_ci_pixels( ctx, n, fog, indexes );
- else
- _mesa_depth_fog_ci_pixels( ctx, n, z, indexes );
- }
+ /* loop over four possible dest color buffers */
+ for (bufferBit = 1; bufferBit <= 8; bufferBit <<= 1) {
+ if (bufferBit & ctx->Color._DrawDestMask) {
+ GLuint indexTmp[MAX_WIDTH];
+ ASSERT(span->end < MAX_WIDTH);
- /* Antialias coverage application */
- if (coverage) {
- GLuint i;
- for (i = 0; i < n; i++) {
- ASSERT(coverage[i] < 16);
- indexes[i] = (indexes[i] & ~0xf) | coverage[i];
- }
- }
+ /* Set the current read/draw buffer */
+ swrast->CurrentBuffer = bufferBit;
+ (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, bufferBit);
+
+ /* make copy of incoming indexes */
+ MEMCPY( indexTmp, span->array->index, span->end * sizeof(GLuint) );
- if (swrast->_RasterMask & MULTI_DRAW_BIT) {
- /* draw to zero or two or more buffers */
- multi_write_index_span( ctx, n, x, y, indexes, mask );
- }
- else {
- /* normal situation: draw to exactly one buffer */
if (ctx->Color.IndexLogicOpEnabled) {
- _mesa_logicop_ci_span( ctx, n, x, y, indexes, mask );
+ _mesa_logicop_ci_span(ctx, span, indexTmp);
}
- if (ctx->Color.IndexMask == 0) {
- return;
+
+ if (ctx->Color.IndexMask != 0xffffffff) {
+ _mesa_mask_index_span(ctx, span, indexTmp);
}
- else if (ctx->Color.IndexMask != 0xffffffff) {
- _mesa_mask_index_span( ctx, n, x, y, indexes );
+
+ if (span->arrayMask & SPAN_XY) {
+ /* array of pixel coords */
+ (*swrast->Driver.WriteCI32Pixels)(ctx, span->end,
+ span->array->x, span->array->y,
+ indexTmp, span->array->mask);
+ }
+ else {
+ /* horizontal run of pixels */
+ (*swrast->Driver.WriteCI32Span)(ctx, span->end, span->x, span->y,
+ indexTmp, span->array->mask);
}
- (*swrast->Driver.WriteCI32Span)( ctx, n, x, y, indexes, mask );
- }
- }
- else {
- /* same color index for all pixels */
- ASSERT(!ctx->Color.IndexLogicOpEnabled);
- ASSERT(ctx->Color.IndexMask == 0xffffffff);
- if (swrast->_RasterMask & MULTI_DRAW_BIT) {
- /* draw to zero or two or more buffers */
- GLuint indexes[MAX_WIDTH];
- for (i = 0; i < n; i++)
- indexes[i] = index;
- multi_write_index_span( ctx, n, x, y, indexes, mask );
- }
- else {
- /* normal situation: draw to exactly one buffer */
- (*swrast->Driver.WriteMonoCISpan)( ctx, n, x, y, index, mask );
}
}
-}
+ /* restore default dest buffer */
+ _swrast_use_draw_buffer(ctx);
+}
-/*
+/**
* Draw to more than one RGBA color buffer (or none).
+ * All fragment operations, up to (but not) blending/logicop should
+ * have been done first.
*/
static void
-multi_write_rgba_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- CONST GLchan rgba[][4], const GLubyte mask[] )
+multi_write_rgba_span( GLcontext *ctx, struct sw_span *span )
{
const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask);
GLuint bufferBit;
SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ ASSERT(colorMask != 0x0);
+
if (ctx->Color.DrawBuffer == GL_NONE)
return;
/* loop over four possible dest color buffers */
- for (bufferBit = 1; bufferBit <= 8; bufferBit = bufferBit << 1) {
- if (bufferBit & ctx->Color.DrawDestMask) {
+ for (bufferBit = 1; bufferBit <= 8; bufferBit <<= 1) {
+ if (bufferBit & ctx->Color._DrawDestMask) {
GLchan rgbaTmp[MAX_WIDTH][4];
- ASSERT(n < MAX_WIDTH);
+ ASSERT(span->end < MAX_WIDTH);
- if (bufferBit == FRONT_LEFT_BIT) {
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_LEFT);
- ctx->DrawBuffer->Alpha = ctx->DrawBuffer->FrontLeftAlpha;
- }
- else if (bufferBit == FRONT_RIGHT_BIT) {
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_RIGHT);
- ctx->DrawBuffer->Alpha = ctx->DrawBuffer->FrontRightAlpha;
- }
- else if (bufferBit == BACK_LEFT_BIT) {
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_LEFT);
- ctx->DrawBuffer->Alpha = ctx->DrawBuffer->BackLeftAlpha;
- }
- else {
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_RIGHT);
- ctx->DrawBuffer->Alpha = ctx->DrawBuffer->BackRightAlpha;
- }
+ /* Set the current read/draw buffer */
+ swrast->CurrentBuffer = bufferBit;
+ (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, bufferBit);
/* make copy of incoming colors */
- MEMCPY( rgbaTmp, rgba, 4 * n * sizeof(GLchan) );
+ MEMCPY( rgbaTmp, span->array->rgba, 4 * span->end * sizeof(GLchan) );
if (ctx->Color.ColorLogicOpEnabled) {
- _mesa_logicop_rgba_span( ctx, n, x, y, rgbaTmp, mask );
+ _mesa_logicop_rgba_span(ctx, span, rgbaTmp);
}
else if (ctx->Color.BlendEnabled) {
- _mesa_blend_span( ctx, n, x, y, rgbaTmp, mask );
+ _mesa_blend_span(ctx, span, rgbaTmp);
}
- if (colorMask == 0x0) {
- break;
- }
- else if (colorMask != 0xffffffff) {
- _mesa_mask_rgba_span( ctx, n, x, y, rgbaTmp );
+
+ if (colorMask != 0xffffffff) {
+ _mesa_mask_rgba_span(ctx, span, rgbaTmp);
}
- (*swrast->Driver.WriteRGBASpan)( ctx, n, x, y,
- (const GLchan (*)[4]) rgbaTmp, mask );
- if (swrast->_RasterMask & ALPHABUF_BIT) {
- _mesa_write_alpha_span( ctx, n, x, y,
- (const GLchan (*)[4])rgbaTmp, mask );
+ if (span->arrayMask & SPAN_XY) {
+ /* array of pixel coords */
+ (*swrast->Driver.WriteRGBAPixels)(ctx, span->end,
+ span->array->x, span->array->y,
+ (const GLchan (*)[4]) rgbaTmp,
+ span->array->mask);
+ if (SWRAST_CONTEXT(ctx)->_RasterMask & ALPHABUF_BIT) {
+ _mesa_write_alpha_pixels(ctx, span->end,
+ span->array->x, span->array->y,
+ (const GLchan (*)[4]) rgbaTmp,
+ span->array->mask);
+ }
+ }
+ else {
+ /* horizontal run of pixels */
+ (*swrast->Driver.WriteRGBASpan)(ctx, span->end, span->x, span->y,
+ (const GLchan (*)[4]) rgbaTmp,
+ span->array->mask);
+ if (swrast->_RasterMask & ALPHABUF_BIT) {
+ _mesa_write_alpha_span(ctx, span->end, span->x, span->y,
+ (const GLchan (*)[4]) rgbaTmp,
+ span->array->mask);
+ }
}
}
}
/* restore default dest buffer */
- (void) (*ctx->Driver.SetDrawBuffer)( ctx, ctx->Color.DriverDrawBuffer );
+ _swrast_use_draw_buffer(ctx);
}
-/*
- * Apply fragment processing to a span of RGBA fragments.
- * Input:
- * n - number of fragments in the span
- * x,y - location of first (left) fragment
- * fog - array of fog factor values in [0,1]
+/**
+ * This function may modify any of the array values in the span.
+ * span->interpMask and span->arrayMask may be changed but will be restored
+ * to their original values before returning.
*/
void
-_mesa_write_rgba_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], const GLfloat fog[],
- GLchan rgbaIn[][4], const GLfloat coverage[],
- GLenum primitive )
+_mesa_write_index_span( GLcontext *ctx, struct sw_span *span)
{
- const GLuint modBits = FOG_BIT | BLEND_BIT | MASKING_BIT |
- LOGIC_OP_BIT | TEXTURE_BIT;
- GLubyte mask[MAX_WIDTH];
- GLboolean write_all = GL_TRUE;
- GLchan rgbaBackup[MAX_WIDTH][4];
- GLchan (*rgba)[4];
- const GLubyte *Null = 0;
SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const GLuint origInterpMask = span->interpMask;
+ const GLuint origArrayMask = span->arrayMask;
- /* init mask to 1's (all pixels are to be written) */
- MEMSET(mask, 1, n);
+ ASSERT(span->end <= MAX_WIDTH);
+ ASSERT(span->primitive == GL_POINT || span->primitive == GL_LINE ||
+ span->primitive == GL_POLYGON || span->primitive == GL_BITMAP);
+ ASSERT((span->interpMask | span->arrayMask) & SPAN_INDEX);
+ ASSERT((span->interpMask & span->arrayMask) == 0);
- if ((swrast->_RasterMask & WINCLIP_BIT) || primitive==GL_BITMAP) {
- if ((n = clip_span( ctx,n,x,y,mask)) == 0) {
- return;
- }
- if (mask[0] == 0)
- write_all = GL_FALSE;
- }
-
- if ((primitive==GL_BITMAP && (swrast->_RasterMask & modBits))
- || (swrast->_RasterMask & MULTI_DRAW_BIT)) {
- /* must make a copy of the colors since they may be modified */
- MEMCPY( rgbaBackup, rgbaIn, 4 * n * sizeof(GLchan) );
- rgba = rgbaBackup;
+ if (span->arrayMask & SPAN_MASK) {
+ /* mask was initialized by caller, probably glBitmap */
+ span->writeAll = GL_FALSE;
}
else {
- rgba = rgbaIn;
+ MEMSET(span->array->mask, 1, span->end);
+ span->writeAll = GL_TRUE;
}
- /* Do the scissor test */
- if (ctx->Scissor.Enabled) {
- if ((n = _mesa_scissor_span( ctx, n, x, y, mask )) == 0) {
+ /* Clipping */
+ if ((swrast->_RasterMask & CLIP_BIT) || (span->primitive != GL_POLYGON)) {
+ if (!clip_span(ctx, span)) {
return;
}
- if (mask[0] == 0)
- write_all = GL_FALSE;
- }
-
- /* Polygon Stippling */
- if (ctx->Polygon.StippleFlag && primitive==GL_POLYGON) {
- stipple_polygon_span( ctx, n, x, y, mask );
- write_all = GL_FALSE;
}
- /* Do the alpha test */
- if (ctx->Color.AlphaEnabled) {
- if (_mesa_alpha_test( ctx, n, (const GLchan (*)[4]) rgba, mask ) == 0) {
- return;
+#ifdef DEBUG
+ if (span->arrayMask & SPAN_XY) {
+ GLuint i;
+ for (i = 0; i < span->end; i++) {
+ if (span->array->mask[i]) {
+ assert(span->array->x[i] >= ctx->DrawBuffer->_Xmin);
+ assert(span->array->x[i] < ctx->DrawBuffer->_Xmax);
+ assert(span->array->y[i] >= ctx->DrawBuffer->_Ymin);
+ assert(span->array->y[i] < ctx->DrawBuffer->_Ymax);
+ }
}
- write_all = GL_FALSE;
}
+#endif
- if (ctx->Stencil.Enabled) {
- /* first stencil test */
- if (_mesa_stencil_and_ztest_span(ctx, n, x, y, z, mask) == GL_FALSE) {
- return;
- }
- write_all = GL_FALSE;
+ /* Polygon Stippling */
+ if (ctx->Polygon.StippleFlag && span->primitive == GL_POLYGON) {
+ stipple_polygon_span(ctx, span);
}
- else if (ctx->Depth.Test) {
- /* regular depth testing */
- GLuint m = _mesa_depth_test_span( ctx, n, x, y, z, mask );
- if (m == 0) {
- return;
+
+ /* Depth test and stencil */
+ if (ctx->Depth.Test || ctx->Stencil.Enabled) {
+ if (span->interpMask & SPAN_Z)
+ _mesa_span_interpolate_z(ctx, span);
+
+ if (ctx->Stencil.Enabled) {
+ if (!_mesa_stencil_and_ztest_span(ctx, span)) {
+ span->arrayMask = origArrayMask;
+ return;
+ }
}
- if (m < n) {
- write_all = GL_FALSE;
+ else {
+ ASSERT(ctx->Depth.Test);
+ if (!_mesa_depth_test_span(ctx, span)) {
+ span->arrayMask = origArrayMask;
+ return;
+ }
}
}
/* if we get here, something passed the depth test */
ctx->OcclusionResult = GL_TRUE;
- /* Per-pixel fog */
+ /* we have to wait until after occlusion to do this test */
+ if (ctx->Color.DrawBuffer == GL_NONE || ctx->Color.IndexMask == 0) {
+ /* write no pixels */
+ span->arrayMask = origArrayMask;
+ return;
+ }
+
+ /* Interpolate the color indexes if needed */
+ if (span->interpMask & SPAN_INDEX) {
+ interpolate_indexes(ctx, span);
+ /* clear the bit - this allows the WriteMonoCISpan optimization below */
+ span->interpMask &= ~SPAN_INDEX;
+ }
+
+ /* Fog */
if (ctx->Fog.Enabled) {
- if (fog && !swrast->_PreferPixelFog)
- _mesa_fog_rgba_pixels( ctx, n, fog, rgba );
- else
- _mesa_depth_fog_rgba_pixels( ctx, n, z, rgba );
+ _mesa_fog_ci_span(ctx, span);
}
/* Antialias coverage application */
- if (coverage) {
+ if (span->arrayMask & SPAN_COVERAGE) {
GLuint i;
- for (i = 0; i < n; i++) {
- rgba[i][ACOMP] = (GLchan) (rgba[i][ACOMP] * coverage[i]);
+ GLuint *index = span->array->index;
+ GLfloat *coverage = span->array->coverage;
+ for (i = 0; i < span->end; i++) {
+ ASSERT(coverage[i] < 16);
+ index[i] = (index[i] & ~0xf) | ((GLuint) coverage[i]);
}
}
if (swrast->_RasterMask & MULTI_DRAW_BIT) {
- multi_write_rgba_span( ctx, n, x, y, (const GLchan (*)[4]) rgba, mask );
+ /* draw to zero or two or more buffers */
+ multi_write_index_span(ctx, span);
}
else {
- /* normal: write to exactly one buffer */
- /* logic op or blending */
- const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask);
-
- if (ctx->Color.ColorLogicOpEnabled) {
- _mesa_logicop_rgba_span( ctx, n, x, y, rgba, mask );
- }
- else if (ctx->Color.BlendEnabled) {
- _mesa_blend_span( ctx, n, x, y, rgba, mask );
+ /* normal situation: draw to exactly one buffer */
+ if (ctx->Color.IndexLogicOpEnabled) {
+ _mesa_logicop_ci_span(ctx, span, span->array->index);
}
- /* Color component masking */
- if (colorMask == 0x0) {
- return;
- }
- else if (colorMask != 0xffffffff) {
- _mesa_mask_rgba_span( ctx, n, x, y, rgba );
+ if (ctx->Color.IndexMask != 0xffffffff) {
+ _mesa_mask_index_span(ctx, span, span->array->index);
}
/* write pixels */
- (*swrast->Driver.WriteRGBASpan)( ctx, n, x, y,
- (const GLchan (*)[4]) rgba,
- write_all ? Null : mask );
-
- if (swrast->_RasterMask & ALPHABUF_BIT) {
- _mesa_write_alpha_span( ctx, n, x, y,
- (const GLchan (*)[4]) rgba,
- write_all ? Null : mask );
+ if (span->arrayMask & SPAN_XY) {
+ /* array of pixel coords */
+ if ((span->interpMask & SPAN_INDEX) && span->indexStep == 0) {
+ /* all pixels have same color index */
+ (*swrast->Driver.WriteMonoCIPixels)(ctx, span->end,
+ span->array->x, span->array->y,
+ FixedToInt(span->index),
+ span->array->mask);
+ }
+ else {
+ (*swrast->Driver.WriteCI32Pixels)(ctx, span->end, span->array->x,
+ span->array->y, span->array->index,
+ span->array->mask );
+ }
+ }
+ else {
+ /* horizontal run of pixels */
+ if ((span->interpMask & SPAN_INDEX) && span->indexStep == 0) {
+ /* all pixels have same color index */
+ (*swrast->Driver.WriteMonoCISpan)(ctx, span->end, span->x, span->y,
+ FixedToInt(span->index),
+ span->array->mask);
+ }
+ else {
+ (*swrast->Driver.WriteCI32Span)(ctx, span->end, span->x, span->y,
+ span->array->index,
+ span->array->mask);
+ }
}
}
-}
+ span->interpMask = origInterpMask;
+ span->arrayMask = origArrayMask;
+}
-/*
- * Write a horizontal span of color pixels to the frame buffer.
- * The color is initially constant for the whole span.
- * Alpha-testing, stenciling, depth-testing, and blending are done as needed.
- * Input: n - number of pixels in the span
- * x, y - location of leftmost pixel in the span
- * z - array of [n] z-values
- * fog - array of fog factor values in [0,1]
- * r, g, b, a - the color of the pixels
- * primitive - either GL_POINT, GL_LINE, GL_POLYGON or GL_BITMAP.
+/**
+ * This function may modify any of the array values in the span.
+ * span->interpMask and span->arrayMask may be changed but will be restored
+ * to their original values before returning.
*/
void
-_mesa_write_monocolor_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], const GLfloat fog[],
- const GLchan color[4], const GLfloat coverage[],
- GLenum primitive )
+_mesa_write_rgba_span( GLcontext *ctx, struct sw_span *span)
{
- const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask);
- GLuint i;
- GLubyte mask[MAX_WIDTH];
- GLboolean write_all = GL_TRUE;
- GLchan rgba[MAX_WIDTH][4];
- const GLubyte *Null = 0;
SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask);
+ const GLuint origInterpMask = span->interpMask;
+ const GLuint origArrayMask = span->arrayMask;
+ GLboolean monoColor;
+
+ ASSERT(span->end <= MAX_WIDTH);
+ ASSERT(span->primitive == GL_POINT || span->primitive == GL_LINE ||
+ span->primitive == GL_POLYGON || span->primitive == GL_BITMAP);
+ ASSERT((span->interpMask & span->arrayMask) == 0);
+ ASSERT((span->interpMask | span->arrayMask) & SPAN_RGBA);
+#ifdef DEBUG
+ if (ctx->Fog.Enabled)
+ ASSERT((span->interpMask | span->arrayMask) & SPAN_FOG);
+ if (ctx->Depth.Test)
+ ASSERT((span->interpMask | span->arrayMask) & SPAN_Z);
+#endif
- /* init mask to 1's (all pixels are to be written) */
- MEMSET(mask, 1, n);
+ if (span->arrayMask & SPAN_MASK) {
+ /* mask was initialized by caller, probably glBitmap */
+ span->writeAll = GL_FALSE;
+ }
+ else {
+ MEMSET(span->array->mask, 1, span->end);
+ span->writeAll = GL_TRUE;
+ }
- if ((swrast->_RasterMask & WINCLIP_BIT) || primitive==GL_BITMAP) {
- if ((n = clip_span( ctx,n,x,y,mask)) == 0) {
- return;
+ /* Determine if we have mono-chromatic colors */
+ monoColor = (span->interpMask & SPAN_RGBA) &&
+ span->redStep == 0 && span->greenStep == 0 &&
+ span->blueStep == 0 && span->alphaStep == 0;
+
+ /* Clipping */
+ if ((swrast->_RasterMask & CLIP_BIT) || (span->primitive != GL_POLYGON)) {
+ if (!clip_span(ctx, span)) {
+ return;
}
- if (mask[0] == 0)
- write_all = GL_FALSE;
}
- /* Do the scissor test */
- if (ctx->Scissor.Enabled) {
- if ((n = _mesa_scissor_span( ctx, n, x, y, mask )) == 0) {
- return;
+#ifdef DEBUG
+ if (span->arrayMask & SPAN_XY) {
+ GLuint i;
+ for (i = 0; i < span->end; i++) {
+ if (span->array->mask[i]) {
+ assert(span->array->x[i] >= ctx->DrawBuffer->_Xmin);
+ assert(span->array->x[i] < ctx->DrawBuffer->_Xmax);
+ assert(span->array->y[i] >= ctx->DrawBuffer->_Ymin);
+ assert(span->array->y[i] < ctx->DrawBuffer->_Ymax);
+ }
}
- if (mask[0] == 0)
- write_all = GL_FALSE;
}
+#endif
/* Polygon Stippling */
- if (ctx->Polygon.StippleFlag && primitive==GL_POLYGON) {
- stipple_polygon_span( ctx, n, x, y, mask );
- write_all = GL_FALSE;
+ if (ctx->Polygon.StippleFlag && span->primitive == GL_POLYGON) {
+ stipple_polygon_span(ctx, span);
}
/* Do the alpha test */
if (ctx->Color.AlphaEnabled) {
- for (i = 0; i < n; i++) {
- rgba[i][ACOMP] = color[ACOMP];
- }
- if (_mesa_alpha_test( ctx, n, (const GLchan (*)[4])rgba, mask ) == 0) {
+ if (!_mesa_alpha_test(ctx, span)) {
+ span->interpMask = origInterpMask;
+ span->arrayMask = origArrayMask;
return;
}
- write_all = GL_FALSE;
}
- if (ctx->Stencil.Enabled) {
- /* first stencil test */
- if (_mesa_stencil_and_ztest_span(ctx, n, x, y, z, mask) == GL_FALSE) {
- return;
- }
- write_all = GL_FALSE;
- }
- else if (ctx->Depth.Test) {
- /* regular depth testing */
- GLuint m = _mesa_depth_test_span( ctx, n, x, y, z, mask );
- if (m == 0) {
- return;
+ /* Stencil and Z testing */
+ if (ctx->Stencil.Enabled || ctx->Depth.Test) {
+ if (span->interpMask & SPAN_Z)
+ _mesa_span_interpolate_z(ctx, span);
+
+ if (ctx->Stencil.Enabled) {
+ if (!_mesa_stencil_and_ztest_span(ctx, span)) {
+ span->interpMask = origInterpMask;
+ span->arrayMask = origArrayMask;
+ return;
+ }
}
- if (m < n) {
- write_all = GL_FALSE;
+ else {
+ ASSERT(ctx->Depth.Test);
+ ASSERT(span->arrayMask & SPAN_Z);
+ /* regular depth testing */
+ if (!_mesa_depth_test_span(ctx, span)) {
+ span->interpMask = origInterpMask;
+ span->arrayMask = origArrayMask;
+ return;
+ }
}
}
/* if we get here, something passed the depth test */
ctx->OcclusionResult = GL_TRUE;
- if (ctx->Color.DrawBuffer == GL_NONE) {
- /* write no pixels */
+ /* can't abort span-writing until after occlusion testing */
+ if (colorMask == 0x0) {
+ span->interpMask = origInterpMask;
+ span->arrayMask = origArrayMask;
return;
}
- if (ctx->Color.ColorLogicOpEnabled || colorMask != 0xffffffff ||
- (swrast->_RasterMask & (BLEND_BIT | FOG_BIT)) || coverage) {
- /* assign same color to each pixel */
- for (i = 0; i < n; i++) {
- if (mask[i]) {
- COPY_CHAN4(rgba[i], color);
- }
- }
+ /* Now we may need to interpolate the colors */
+ if ((span->interpMask & SPAN_RGBA) && (span->arrayMask & SPAN_RGBA) == 0) {
+ interpolate_colors(ctx, span);
+ /* clear the bit - this allows the WriteMonoCISpan optimization below */
+ span->interpMask &= ~SPAN_RGBA;
+ }
- /* Per-pixel fog */
- if (ctx->Fog.Enabled) {
- if (fog && !swrast->_PreferPixelFog)
- _mesa_fog_rgba_pixels( ctx, n, fog, rgba );
- else
- _mesa_depth_fog_rgba_pixels( ctx, n, z, rgba );
- }
+ /* Fog */
+ if (ctx->Fog.Enabled) {
+ _mesa_fog_rgba_span(ctx, span);
+ monoColor = GL_FALSE;
+ }
- /* Antialias coverage application */
- if (coverage) {
- GLuint i;
- for (i = 0; i < n; i++) {
- rgba[i][ACOMP] = (GLchan) (rgba[i][ACOMP] * coverage[i]);
- }
+ /* 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]);
}
+ monoColor = GL_FALSE;
+ }
- if (swrast->_RasterMask & MULTI_DRAW_BIT) {
- multi_write_rgba_span( ctx, n, x, y,
- (const GLchan (*)[4]) rgba, mask );
+ if (swrast->_RasterMask & MULTI_DRAW_BIT) {
+ multi_write_rgba_span(ctx, span);
+ }
+ else {
+ /* normal: write to exactly one buffer */
+ if (ctx->Color.ColorLogicOpEnabled) {
+ _mesa_logicop_rgba_span(ctx, span, span->array->rgba);
+ monoColor = GL_FALSE;
+ }
+ else if (ctx->Color.BlendEnabled) {
+ _mesa_blend_span(ctx, span, span->array->rgba);
+ monoColor = GL_FALSE;
}
- else {
- /* normal: write to exactly one buffer */
- if (ctx->Color.ColorLogicOpEnabled) {
- _mesa_logicop_rgba_span( ctx, n, x, y, rgba, mask );
- }
- else if (ctx->Color.BlendEnabled) {
- _mesa_blend_span( ctx, n, x, y, rgba, mask );
- }
-
- /* Color component masking */
- if (colorMask == 0x0) {
- return;
- }
- else if (colorMask != 0xffffffff) {
- _mesa_mask_rgba_span( ctx, n, x, y, rgba );
- }
- /* write pixels */
- (*swrast->Driver.WriteRGBASpan)( ctx, n, x, y,
- (const GLchan (*)[4]) rgba,
- write_all ? Null : mask );
- if (swrast->_RasterMask & ALPHABUF_BIT) {
- _mesa_write_alpha_span( ctx, n, x, y,
- (const GLchan (*)[4]) rgba,
- write_all ? Null : mask );
- }
+ /* Color component masking */
+ if (colorMask != 0xffffffff) {
+ _mesa_mask_rgba_span(ctx, span, span->array->rgba);
+ monoColor = GL_FALSE;
}
- }
- else {
- /* same color for all pixels */
- ASSERT(!ctx->Color.BlendEnabled);
- ASSERT(!ctx->Color.ColorLogicOpEnabled);
- if (swrast->_RasterMask & MULTI_DRAW_BIT) {
- for (i = 0; i < n; i++) {
- if (mask[i]) {
- COPY_CHAN4(rgba[i], color);
- }
+ /* write pixels */
+ if (span->arrayMask & SPAN_XY) {
+ /* array of pixel coords */
+ /* XXX test for mono color */
+ (*swrast->Driver.WriteRGBAPixels)(ctx, span->end, span->array->x,
+ span->array->y, (const GLchan (*)[4]) span->array->rgba, span->array->mask);
+ if (SWRAST_CONTEXT(ctx)->_RasterMask & ALPHABUF_BIT) {
+ _mesa_write_alpha_pixels(ctx, span->end,
+ span->array->x, span->array->y,
+ (const GLchan (*)[4]) span->array->rgba,
+ span->array->mask);
}
- multi_write_rgba_span( ctx, n, x, y,
- (const GLchan (*)[4]) rgba, mask );
}
else {
- (*swrast->Driver.WriteMonoRGBASpan)( ctx, n, x, y, color, mask );
- if (swrast->_RasterMask & ALPHABUF_BIT) {
- _mesa_write_mono_alpha_span( ctx, n, x, y, (GLchan) color[ACOMP],
- write_all ? Null : mask );
+ /* horizontal run of pixels */
+ if (monoColor) {
+ /* all pixels have same color */
+ GLchan color[4];
+ color[RCOMP] = FixedToChan(span->red);
+ color[GCOMP] = FixedToChan(span->green);
+ color[BCOMP] = FixedToChan(span->blue);
+ color[ACOMP] = FixedToChan(span->alpha);
+ (*swrast->Driver.WriteMonoRGBASpan)(ctx, span->end, span->x,
+ span->y, color, span->array->mask);
+ if (swrast->_RasterMask & ALPHABUF_BIT) {
+ _mesa_write_mono_alpha_span(ctx, span->end, span->x, span->y,
+ color[ACOMP],
+ span->writeAll ? ((const GLubyte *) NULL) : span->array->mask);
+ }
+ }
+ else {
+ /* each pixel is a different color */
+ (*swrast->Driver.WriteRGBASpan)(ctx, span->end, span->x, span->y,
+ (const GLchan (*)[4]) span->array->rgba,
+ span->writeAll ? ((const GLubyte *) NULL) : span->array->mask);
+ if (swrast->_RasterMask & ALPHABUF_BIT) {
+ _mesa_write_alpha_span(ctx, span->end, span->x, span->y,
+ (const GLchan (*)[4]) span->array->rgba,
+ span->writeAll ? ((const GLubyte *) NULL) : span->array->mask);
+ }
}
}
}
-}
+ span->interpMask = origInterpMask;
+ span->arrayMask = origArrayMask;
+}
-/*
+/**
* 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], CONST GLchan specular[][4] )
+add_colors(GLuint n, GLchan rgba[][4], GLchan specular[][4] )
{
GLuint i;
for (i = 0; i < n; i++) {
@@ -801,330 +1110,205 @@ add_colors(GLuint n, GLchan rgba[][4], CONST GLchan specular[][4] )
}
-/*
- * Write a horizontal span of textured pixels to the frame buffer.
- * The color of each pixel is different.
- * Alpha-testing, stenciling, depth-testing, and blending are done
- * as needed.
- * Input: n - number of pixels in the span
- * x, y - location of leftmost pixel in the span
- * z - array of [n] z-values
- * fog - array of fog factor values in [0,1]
- * s, t - array of (s,t) texture coordinates for each pixel
- * lambda - array of texture lambda values
- * rgba - array of [n] color components
- * primitive - either GL_POINT, GL_LINE, GL_POLYGON or GL_BITMAP.
+/**
+ * This function may modify any of the array values in the span.
+ * span->interpMask and span->arrayMask may be changed but will be restored
+ * to their original values before returning.
*/
void
-_mesa_write_texture_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], const GLfloat fog[],
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], GLfloat lambda[],
- GLchan rgbaIn[][4], CONST GLchan spec[][4],
- const GLfloat coverage[], GLenum primitive )
+_mesa_write_texture_span( GLcontext *ctx, struct sw_span *span)
{
const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask);
- GLubyte mask[MAX_WIDTH];
- GLboolean write_all = GL_TRUE;
- GLchan rgbaBackup[MAX_WIDTH][4];
- GLchan (*rgba)[4]; /* points to either rgbaIn or rgbaBackup */
- const GLubyte *Null = 0;
SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const GLuint origArrayMask = span->arrayMask;
- /* init mask to 1's (all pixels are to be written) */
- MEMSET(mask, 1, n);
-
- if ((swrast->_RasterMask & WINCLIP_BIT) || primitive==GL_BITMAP) {
- if ((n=clip_span(ctx, n, x, y, mask)) == 0) {
- return;
- }
- if (mask[0] == 0)
- write_all = GL_FALSE;
- }
+ 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(ctx->Texture._EnabledUnits);
+ /*
+ printf("%s() interp 0x%x array 0x%x\n", __FUNCTION__, span->interpMask, span->arrayMask);
+ */
- if (primitive==GL_BITMAP || (swrast->_RasterMask & MULTI_DRAW_BIT)) {
- /* must make a copy of the colors since they may be modified */
- MEMCPY(rgbaBackup, rgbaIn, 4 * n * sizeof(GLchan));
- rgba = rgbaBackup;
+ if (span->arrayMask & SPAN_MASK) {
+ /* mask was initialized by caller, probably glBitmap */
+ span->writeAll = GL_FALSE;
}
else {
- rgba = rgbaIn;
- }
-
- /* Do the scissor test */
- if (ctx->Scissor.Enabled) {
- if ((n = _mesa_scissor_span( ctx, n, x, y, mask )) == 0) {
- return;
- }
- if (mask[0] == 0)
- write_all = GL_FALSE;
- }
-
- /* Polygon Stippling */
- if (ctx->Polygon.StippleFlag && primitive==GL_POLYGON) {
- stipple_polygon_span( ctx, n, x, y, mask );
- write_all = GL_FALSE;
+ MEMSET(span->array->mask, 1, span->end);
+ span->writeAll = GL_TRUE;
}
- /* Texture with alpha test */
- if (ctx->Color.AlphaEnabled) {
- /* Texturing without alpha is done after depth-testing which
- gives a potential speed-up. */
- ASSERT(ctx->Texture._ReallyEnabled);
- _swrast_texture_fragments( ctx, 0, n, s, t, u, lambda,
- (CONST GLchan (*)[4]) rgba, rgba );
-
- /* Do the alpha test */
- if (_mesa_alpha_test( ctx, n, (const GLchan (*)[4]) rgba, mask ) == 0) {
- return;
- }
- write_all = GL_FALSE;
- }
-
- if (ctx->Stencil.Enabled) {
- /* first stencil test */
- if (_mesa_stencil_and_ztest_span(ctx, n, x, y, z, mask) == GL_FALSE) {
+ /* Clipping */
+ if ((swrast->_RasterMask & CLIP_BIT) || (span->primitive != GL_POLYGON)) {
+ if (!clip_span(ctx, span)) {
return;
}
- write_all = GL_FALSE;
- }
- else if (ctx->Depth.Test) {
- /* regular depth testing */
- GLuint m = _mesa_depth_test_span( ctx, n, x, y, z, mask );
- if (m == 0) {
- return;
- }
- if (m < n) {
- write_all = GL_FALSE;
- }
}
- /* if we get here, something passed the depth test */
- ctx->OcclusionResult = GL_TRUE;
-
- /* Texture without alpha test */
- if (! ctx->Color.AlphaEnabled) {
- ASSERT(ctx->Texture._ReallyEnabled);
- _swrast_texture_fragments( ctx, 0, n, s, t, u, lambda,
- (CONST GLchan (*)[4]) rgba, rgba );
- }
-
- /* Add base and specular colors */
- if (spec &&
- (ctx->Fog.ColorSumEnabled ||
- (ctx->Light.Enabled &&
- ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)))
- add_colors( n, rgba, spec ); /* rgba = rgba + spec */
-
- /* Per-pixel fog */
- if (ctx->Fog.Enabled) {
- if (fog && !swrast->_PreferPixelFog)
- _mesa_fog_rgba_pixels( ctx, n, fog, rgba );
- else
- _mesa_depth_fog_rgba_pixels( ctx, n, z, rgba );
- }
-
- /* Antialias coverage application */
- if (coverage) {
+#ifdef DEBUG
+ if (span->arrayMask & SPAN_XY) {
GLuint i;
- for (i = 0; i < n; i++) {
- rgba[i][ACOMP] = (GLchan) (rgba[i][ACOMP] * coverage[i]);
- }
- }
-
- if (swrast->_RasterMask & MULTI_DRAW_BIT) {
- multi_write_rgba_span( ctx, n, x, y, (const GLchan (*)[4]) rgba, mask );
- }
- else {
- /* normal: write to exactly one buffer */
- if (ctx->Color.ColorLogicOpEnabled) {
- _mesa_logicop_rgba_span( ctx, n, x, y, rgba, mask );
- }
- else if (ctx->Color.BlendEnabled) {
- _mesa_blend_span( ctx, n, x, y, rgba, mask );
- }
- if (colorMask == 0x0) {
- return;
- }
- else if (colorMask != 0xffffffff) {
- _mesa_mask_rgba_span( ctx, n, x, y, rgba );
- }
-
- (*swrast->Driver.WriteRGBASpan)( ctx, n, x, y, (const GLchan (*)[4])rgba,
- write_all ? Null : mask );
- if (swrast->_RasterMask & ALPHABUF_BIT) {
- _mesa_write_alpha_span( ctx, n, x, y, (const GLchan (*)[4]) rgba,
- write_all ? Null : mask );
- }
- }
-}
-
-
-
-/*
- * As above but perform multiple stages of texture application.
- */
-void
-_mesa_write_multitexture_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], const GLfloat fog[],
- CONST GLfloat s[MAX_TEXTURE_UNITS][MAX_WIDTH],
- CONST GLfloat t[MAX_TEXTURE_UNITS][MAX_WIDTH],
- CONST GLfloat u[MAX_TEXTURE_UNITS][MAX_WIDTH],
- GLfloat lambda[][MAX_WIDTH],
- GLchan rgbaIn[MAX_TEXTURE_UNITS][4],
- CONST GLchan spec[MAX_TEXTURE_UNITS][4],
- const GLfloat coverage[],
- GLenum primitive )
-{
- GLubyte mask[MAX_WIDTH];
- GLboolean write_all = GL_TRUE;
- GLchan rgbaBackup[MAX_WIDTH][4];
- GLchan (*rgba)[4]; /* points to either rgbaIn or rgbaBackup */
- GLuint i;
- const GLubyte *Null = 0;
- const GLuint texUnits = ctx->Const.MaxTextureUnits;
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
-
- /* init mask to 1's (all pixels are to be written) */
- MEMSET(mask, 1, n);
-
- if ((swrast->_RasterMask & WINCLIP_BIT) || primitive==GL_BITMAP) {
- if ((n=clip_span(ctx, n, x, y, mask)) == 0) {
- return;
- }
- if (mask[0] == 0)
- write_all = GL_FALSE;
- }
-
-
- if (primitive==GL_BITMAP || (swrast->_RasterMask & MULTI_DRAW_BIT)
- || texUnits > 1) {
- /* must make a copy of the colors since they may be modified */
- MEMCPY(rgbaBackup, rgbaIn, 4 * n * sizeof(GLchan));
- rgba = rgbaBackup;
- }
- else {
- rgba = rgbaIn;
- }
-
- /* Do the scissor test */
- if (ctx->Scissor.Enabled) {
- if ((n = _mesa_scissor_span( ctx, n, x, y, mask )) == 0) {
- return;
+ for (i = 0; i < span->end; i++) {
+ if (span->array->mask[i]) {
+ assert(span->array->x[i] >= ctx->DrawBuffer->_Xmin);
+ assert(span->array->x[i] < ctx->DrawBuffer->_Xmax);
+ assert(span->array->y[i] >= ctx->DrawBuffer->_Ymin);
+ assert(span->array->y[i] < ctx->DrawBuffer->_Ymax);
+ }
}
- if (mask[0] == 0)
- write_all = GL_FALSE;
}
+#endif
/* Polygon Stippling */
- if (ctx->Polygon.StippleFlag && primitive==GL_POLYGON) {
- stipple_polygon_span( ctx, n, x, y, mask );
- write_all = GL_FALSE;
+ if (ctx->Polygon.StippleFlag && span->primitive == GL_POLYGON) {
+ stipple_polygon_span(ctx, span);
}
+ /* Need texture coordinates now */
+ if ((span->interpMask & SPAN_TEXTURE)
+ && (span->arrayMask & SPAN_TEXTURE) == 0)
+ interpolate_texcoords(ctx, span);
+
/* Texture with alpha test */
if (ctx->Color.AlphaEnabled) {
+
+ /* 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);
+
/* Texturing without alpha is done after depth-testing which
* gives a potential speed-up.
*/
- ASSERT(ctx->Texture._ReallyEnabled);
- for (i = 0; i < texUnits; i++)
- _swrast_texture_fragments( ctx, i, n, s[i], t[i], u[i], lambda[i],
- (CONST GLchan (*)[4]) rgbaIn, rgba );
+ _swrast_texture_span( ctx, span );
/* Do the alpha test */
- if (_mesa_alpha_test( ctx, n, (const GLchan (*)[4])rgba, mask ) == 0) {
- return;
- }
- write_all = GL_FALSE;
- }
-
- if (ctx->Stencil.Enabled) {
- /* first stencil test */
- if (_mesa_stencil_and_ztest_span(ctx, n, x, y, z, mask) == GL_FALSE) {
+ if (!_mesa_alpha_test(ctx, span)) {
+ span->arrayMask = origArrayMask;
return;
}
- write_all = GL_FALSE;
}
- else if (ctx->Depth.Test) {
- /* regular depth testing */
- GLuint m = _mesa_depth_test_span( ctx, n, x, y, z, mask );
- if (m == 0) {
- return;
+
+ /* Stencil and Z testing */
+ if (ctx->Stencil.Enabled || ctx->Depth.Test) {
+ if (span->interpMask & SPAN_Z)
+ _mesa_span_interpolate_z(ctx, span);
+
+ if (ctx->Stencil.Enabled) {
+ if (!_mesa_stencil_and_ztest_span(ctx, span)) {
+ span->arrayMask = origArrayMask;
+ return;
+ }
}
- if (m < n) {
- write_all = GL_FALSE;
+ else {
+ ASSERT(ctx->Depth.Test);
+ ASSERT(span->arrayMask & SPAN_Z);
+ /* regular depth testing */
+ if (!_mesa_depth_test_span(ctx, span)) {
+ span->arrayMask = origArrayMask;
+ return;
+ }
}
}
- /* if we get here, something passed the depth test */
+ /* if we get here, some fragments passed the depth test */
ctx->OcclusionResult = GL_TRUE;
+ /* We had to wait until now to check for glColorMask(F,F,F,F) because of
+ * the occlusion test.
+ */
+ if (colorMask == 0x0) {
+ span->arrayMask = origArrayMask;
+ return;
+ }
+
/* Texture without alpha test */
- if (! ctx->Color.AlphaEnabled) {
- ASSERT(ctx->Texture._ReallyEnabled);
- for (i = 0; i < texUnits; i++)
- _swrast_texture_fragments( ctx, i, n, s[i], t[i], u[i], lambda[i],
- (CONST GLchan (*)[4]) rgbaIn, rgba );
+ if (!ctx->Color.AlphaEnabled) {
+
+ /* 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);
+
+ _swrast_texture_span( ctx, span );
}
+ ASSERT(span->arrayMask & SPAN_RGBA);
+
/* Add base and specular colors */
- if (spec &&
- (ctx->Fog.ColorSumEnabled ||
- (ctx->Light.Enabled &&
- ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)))
- add_colors( n, rgba, spec ); /* rgba = rgba + spec */
+ if (ctx->Fog.ColorSumEnabled ||
+ (ctx->Light.Enabled &&
+ ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) {
+ if (span->interpMask & SPAN_SPEC) {
+ interpolate_specular(ctx, span);
+ }
+ ASSERT(span->arrayMask & SPAN_SPEC);
+ add_colors( span->end, span->array->rgba, span->array->spec );
+ }
- /* Per-pixel fog */
+ /* Fog */
if (ctx->Fog.Enabled) {
- if (fog && !swrast->_PreferPixelFog)
- _mesa_fog_rgba_pixels( ctx, n, fog, rgba );
- else
- _mesa_depth_fog_rgba_pixels( ctx, n, z, rgba );
+ _mesa_fog_rgba_span(ctx, span);
}
/* Antialias coverage application */
- if (coverage) {
+ if (span->arrayMask & SPAN_COVERAGE) {
+ GLchan (*rgba)[4] = span->array->rgba;
+ GLfloat *coverage = span->array->coverage;
GLuint i;
- for (i = 0; i < n; i++) {
+ for (i = 0; i < span->end; i++) {
rgba[i][ACOMP] = (GLchan) (rgba[i][ACOMP] * coverage[i]);
}
}
if (swrast->_RasterMask & MULTI_DRAW_BIT) {
- multi_write_rgba_span( ctx, n, x, y, (const GLchan (*)[4]) rgba, mask );
+ multi_write_rgba_span(ctx, span);
}
else {
/* normal: write to exactly one buffer */
- const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask);
-
if (ctx->Color.ColorLogicOpEnabled) {
- _mesa_logicop_rgba_span( ctx, n, x, y, rgba, mask );
+ _mesa_logicop_rgba_span(ctx, span, span->array->rgba);
}
- else if (ctx->Color.BlendEnabled) {
- _mesa_blend_span( ctx, n, x, y, rgba, mask );
+ else if (ctx->Color.BlendEnabled) {
+ _mesa_blend_span(ctx, span, span->array->rgba);
}
- if (colorMask == 0x0) {
- return;
- }
- else if (colorMask != 0xffffffff) {
- _mesa_mask_rgba_span( ctx, n, x, y, rgba );
+ if (colorMask != 0xffffffff) {
+ _mesa_mask_rgba_span(ctx, span, span->array->rgba);
}
- (*swrast->Driver.WriteRGBASpan)( ctx, n, x, y, (const GLchan (*)[4])rgba,
- write_all ? Null : mask );
- if (swrast->_RasterMask & ALPHABUF_BIT) {
- _mesa_write_alpha_span( ctx, n, x, y, (const GLchan (*)[4])rgba,
- write_all ? Null : mask );
+
+ if (span->arrayMask & SPAN_XY) {
+ /* array of pixel coords */
+ (*swrast->Driver.WriteRGBAPixels)(ctx, span->end, span->array->x,
+ span->array->y, (const GLchan (*)[4]) span->array->rgba, span->array->mask);
+ if (SWRAST_CONTEXT(ctx)->_RasterMask & ALPHABUF_BIT) {
+ _mesa_write_alpha_pixels(ctx, span->end,
+ span->array->x, span->array->y,
+ (const GLchan (*)[4]) span->array->rgba,
+ span->array->mask);
+ }
+ }
+ else {
+ /* horizontal run of pixels */
+ (*swrast->Driver.WriteRGBASpan)(ctx, span->end, span->x, span->y,
+ (const GLchan (*)[4]) span->array->rgba,
+ span->writeAll ? NULL : span->array->mask);
+ if (swrast->_RasterMask & ALPHABUF_BIT) {
+ _mesa_write_alpha_span(ctx, span->end, span->x, span->y,
+ (const GLchan (*)[4]) span->array->rgba,
+ span->writeAll ? NULL : span->array->mask);
+ }
}
}
+
+ span->arrayMask = origArrayMask;
}
-/*
+/**
* Read RGBA pixels from frame buffer. Clipping will be done to prevent
* reading ouside the buffer's boundaries.
*/
@@ -1139,7 +1323,7 @@ _mesa_read_rgba_span( GLcontext *ctx, GLframebuffer *buffer,
if (y < 0 || y >= bufHeight || x + (GLint) n < 0 || x >= bufWidth) {
/* completely above, below, or right */
/* XXX maybe leave undefined? */
- BZERO(rgba, 4 * n * sizeof(GLchan));
+ _mesa_bzero(rgba, 4 * n * sizeof(GLchan));
}
else {
GLint skip, length;
@@ -1152,7 +1336,7 @@ _mesa_read_rgba_span( GLcontext *ctx, GLframebuffer *buffer,
return;
}
if (length > bufWidth) {
- length = buffer->Width;
+ length = bufWidth;
}
}
else if ((GLint) (x + n) > bufWidth) {
@@ -1172,15 +1356,13 @@ _mesa_read_rgba_span( GLcontext *ctx, GLframebuffer *buffer,
(*swrast->Driver.ReadRGBASpan)( ctx, length, x + skip, y, rgba + skip );
if (buffer->UseSoftwareAlphaBuffers) {
- _mesa_read_alpha_span( ctx, length, x + skip, y, rgba + skip );
+ _mesa_read_alpha_span(ctx, length, x + skip, y, rgba + skip);
}
}
}
-
-
-/*
+/**
* Read CI pixels from frame buffer. Clipping will be done to prevent
* reading ouside the buffer's boundaries.
*/
@@ -1194,7 +1376,7 @@ _mesa_read_index_span( GLcontext *ctx, GLframebuffer *buffer,
if (y < 0 || y >= bufHeight || x + (GLint) n < 0 || x >= bufWidth) {
/* completely above, below, or right */
- BZERO(indx, n * sizeof(GLuint));
+ _mesa_bzero(indx, n * sizeof(GLuint));
}
else {
GLint skip, length;
diff --git a/xc/extras/Mesa/src/swrast/s_span.h b/xc/extras/Mesa/src/swrast/s_span.h
index 063494258..d37961e98 100644
--- a/xc/extras/Mesa/src/swrast/s_span.h
+++ b/xc/extras/Mesa/src/swrast/s_span.h
@@ -1,10 +1,9 @@
-/* $Id: s_span.h,v 1.1.1.1 2002/10/22 13:06:57 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -34,61 +33,38 @@
extern void
-_mesa_write_index_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], const GLfloat fog[],
- GLuint index[], const GLint coverage[],
- GLenum primitive );
-
+_mesa_span_default_z( GLcontext *ctx, struct sw_span *span );
extern void
-_mesa_write_monoindex_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], const GLfloat fog[],
- GLuint index, const GLint coverage[],
- GLenum primitive );
+_mesa_span_interpolate_z( const GLcontext *ctx, struct sw_span *span );
+extern void
+_mesa_span_default_fog( GLcontext *ctx, struct sw_span *span );
extern void
-_mesa_write_rgba_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], const GLfloat fog[],
- GLchan rgba[][4], const GLfloat coverage[],
- GLenum primitive );
+_mesa_span_default_color( GLcontext *ctx, struct sw_span *span );
+extern void
+_mesa_span_default_texcoords( GLcontext *ctx, struct sw_span *span );
extern void
-_mesa_write_monocolor_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], const GLfloat fog[],
- const GLchan color[4], const GLfloat coverage[],
- GLenum primitive );
+_mesa_write_index_span( GLcontext *ctx, struct sw_span *span);
extern void
-_mesa_write_texture_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], const GLfloat fog[],
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], GLfloat lambda[],
- GLchan rgba[][4], CONST GLchan spec[][4],
- const GLfloat coverage[], GLenum primitive );
+_mesa_write_rgba_span( GLcontext *ctx, struct sw_span *span);
extern void
-_mesa_write_multitexture_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], const GLfloat fog[],
- CONST GLfloat s[MAX_TEXTURE_UNITS][MAX_WIDTH],
- CONST GLfloat t[MAX_TEXTURE_UNITS][MAX_WIDTH],
- CONST GLfloat u[MAX_TEXTURE_UNITS][MAX_WIDTH],
- GLfloat lambda[MAX_TEXTURE_UNITS][MAX_WIDTH],
- GLchan rgba[][4], CONST GLchan spec[][4],
- const GLfloat coverage[], GLenum primitive );
+_mesa_write_texture_span( GLcontext *ctx, struct sw_span *span);
extern void
_mesa_read_rgba_span( GLcontext *ctx, GLframebuffer *buffer,
GLuint n, GLint x, GLint y, GLchan rgba[][4] );
-
extern void
_mesa_read_index_span( GLcontext *ctx, GLframebuffer *buffer,
GLuint n, GLint x, GLint y, GLuint indx[] );
-
#endif
diff --git a/xc/extras/Mesa/src/swrast/s_stencil.c b/xc/extras/Mesa/src/swrast/s_stencil.c
index 13ecc70da..b535830fe 100644
--- a/xc/extras/Mesa/src/swrast/s_stencil.c
+++ b/xc/extras/Mesa/src/swrast/s_stencil.c
@@ -1,8 +1,7 @@
-/* $Id: s_stencil.c,v 1.1.1.1 2002/10/22 13:06:41 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -28,17 +27,14 @@
#include "glheader.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "s_context.h"
#include "s_depth.h"
-#include "s_pb.h"
#include "s_stencil.h"
-
-
/* Stencil Logic:
IF stencil test fails THEN
@@ -55,8 +51,6 @@ ENDIF
*/
-
-
/*
* Return the address of a stencil buffer value given the window coords:
*/
@@ -65,22 +59,23 @@ ENDIF
-/*
+/**
* Apply the given stencil operator to the array of stencil values.
* Don't touch stencil[i] if mask[i] is zero.
* Input: n - size of stencil array
* oper - the stencil buffer operator
+ * face - 0 or 1 for front or back face operation
* stencil - array of stencil values
* mask - array [n] of flag: 1=apply operator, 0=don't apply operator
* Output: stencil - modified values
*/
-static void apply_stencil_op( const GLcontext *ctx, GLenum oper,
- GLuint n, GLstencil stencil[],
- const GLubyte mask[] )
+static void
+apply_stencil_op( const GLcontext *ctx, GLenum oper, GLuint face,
+ GLuint n, GLstencil stencil[], const GLubyte mask[] )
{
- const GLstencil ref = ctx->Stencil.Ref;
- const GLstencil wrtmask = ctx->Stencil.WriteMask;
- const GLstencil invmask = (GLstencil) (~ctx->Stencil.WriteMask);
+ const GLstencil ref = ctx->Stencil.Ref[face];
+ const GLstencil wrtmask = ctx->Stencil.WriteMask[face];
+ const GLstencil invmask = (GLstencil) (~wrtmask);
GLuint i;
switch (oper) {
@@ -226,9 +221,10 @@ static void apply_stencil_op( const GLcontext *ctx, GLenum oper,
-/*
+/**
* Apply stencil test to an array of stencil values (before depth buffering).
- * Input: n - number of pixels in the array
+ * Input: face - 0 or 1 for front or back-face polygons
+ * n - number of pixels in the array
* stencil - array of [n] stencil values
* mask - array [n] of flag: 0=skip the pixel, 1=stencil the pixel
* Output: mask - pixels which fail the stencil test will have their
@@ -237,15 +233,16 @@ static void apply_stencil_op( const GLcontext *ctx, GLenum oper,
* Return: GL_FALSE = all pixels failed, GL_TRUE = zero or more pixels passed.
*/
static GLboolean
-do_stencil_test( GLcontext *ctx, GLuint n, GLstencil stencil[],
+do_stencil_test( GLcontext *ctx, GLuint face, GLuint n, GLstencil stencil[],
GLubyte mask[] )
{
- GLubyte fail[PB_SIZE];
+ GLubyte fail[MAX_WIDTH];
GLboolean allfail = GL_FALSE;
GLuint i;
GLstencil r, s;
+ const GLuint valueMask = ctx->Stencil.ValueMask[face];
- ASSERT(n <= PB_SIZE);
+ ASSERT(n <= MAX_WIDTH);
/*
* Perform stencil test. The results of this operation are stored
@@ -256,9 +253,9 @@ do_stencil_test( GLcontext *ctx, GLuint n, GLstencil stencil[],
* the stencil fail operator is not to be applied
* ENDIF
*/
- switch (ctx->Stencil.Function) {
+ switch (ctx->Stencil.Function[face]) {
case GL_NEVER:
- /* always fail */
+ /* never pass; always fail */
for (i=0;i<n;i++) {
if (mask[i]) {
mask[i] = 0;
@@ -271,10 +268,10 @@ do_stencil_test( GLcontext *ctx, GLuint n, GLstencil stencil[],
allfail = GL_TRUE;
break;
case GL_LESS:
- r = (GLstencil) (ctx->Stencil.Ref & ctx->Stencil.ValueMask);
+ r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
for (i=0;i<n;i++) {
if (mask[i]) {
- s = (GLstencil) (stencil[i] & ctx->Stencil.ValueMask);
+ s = (GLstencil) (stencil[i] & valueMask);
if (r < s) {
/* passed */
fail[i] = 0;
@@ -290,10 +287,10 @@ do_stencil_test( GLcontext *ctx, GLuint n, GLstencil stencil[],
}
break;
case GL_LEQUAL:
- r = (GLstencil) (ctx->Stencil.Ref & ctx->Stencil.ValueMask);
+ r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
for (i=0;i<n;i++) {
if (mask[i]) {
- s = (GLstencil) (stencil[i] & ctx->Stencil.ValueMask);
+ s = (GLstencil) (stencil[i] & valueMask);
if (r <= s) {
/* pass */
fail[i] = 0;
@@ -309,10 +306,10 @@ do_stencil_test( GLcontext *ctx, GLuint n, GLstencil stencil[],
}
break;
case GL_GREATER:
- r = (GLstencil) (ctx->Stencil.Ref & ctx->Stencil.ValueMask);
+ r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
for (i=0;i<n;i++) {
if (mask[i]) {
- s = (GLstencil) (stencil[i] & ctx->Stencil.ValueMask);
+ s = (GLstencil) (stencil[i] & valueMask);
if (r > s) {
/* passed */
fail[i] = 0;
@@ -328,10 +325,10 @@ do_stencil_test( GLcontext *ctx, GLuint n, GLstencil stencil[],
}
break;
case GL_GEQUAL:
- r = (GLstencil) (ctx->Stencil.Ref & ctx->Stencil.ValueMask);
+ r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
for (i=0;i<n;i++) {
if (mask[i]) {
- s = (GLstencil) (stencil[i] & ctx->Stencil.ValueMask);
+ s = (GLstencil) (stencil[i] & valueMask);
if (r >= s) {
/* passed */
fail[i] = 0;
@@ -347,10 +344,10 @@ do_stencil_test( GLcontext *ctx, GLuint n, GLstencil stencil[],
}
break;
case GL_EQUAL:
- r = (GLstencil) (ctx->Stencil.Ref & ctx->Stencil.ValueMask);
+ r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
for (i=0;i<n;i++) {
if (mask[i]) {
- s = (GLstencil) (stencil[i] & ctx->Stencil.ValueMask);
+ s = (GLstencil) (stencil[i] & valueMask);
if (r == s) {
/* passed */
fail[i] = 0;
@@ -366,10 +363,10 @@ do_stencil_test( GLcontext *ctx, GLuint n, GLstencil stencil[],
}
break;
case GL_NOTEQUAL:
- r = (GLstencil) (ctx->Stencil.Ref & ctx->Stencil.ValueMask);
+ r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
for (i=0;i<n;i++) {
if (mask[i]) {
- s = (GLstencil) (stencil[i] & ctx->Stencil.ValueMask);
+ s = (GLstencil) (stencil[i] & valueMask);
if (r != s) {
/* passed */
fail[i] = 0;
@@ -395,8 +392,8 @@ do_stencil_test( GLcontext *ctx, GLuint n, GLstencil stencil[],
return 0;
}
- if (ctx->Stencil.FailFunc != GL_KEEP) {
- apply_stencil_op( ctx, ctx->Stencil.FailFunc, n, stencil, fail );
+ if (ctx->Stencil.FailFunc[face] != GL_KEEP) {
+ apply_stencil_op( ctx, ctx->Stencil.FailFunc[face], face, n, stencil, fail );
}
return !allfail;
@@ -404,47 +401,69 @@ do_stencil_test( GLcontext *ctx, GLuint n, GLstencil stencil[],
-
-/*
- * Apply stencil and depth testing to an array of pixels.
- * Hardware or software stencil buffer acceptable.
+/**
+ * Apply stencil and depth testing to the span of pixels.
+ * Both software and hardware stencil buffers are acceptable.
* Input: n - number of pixels in the span
+ * x, y - location of leftmost pixel in span
* z - array [n] of z values
- * stencil - array [n] of stencil values
* mask - array [n] of flags (1=test this pixel, 0=skip the pixel)
- * Output: stencil - modified stencil values
- * mask - array [n] of flags (1=stencil and depth test passed)
- * Return: GL_TRUE - all fragments failed the testing
- * GL_FALSE - one or more fragments passed the testing
+ * Output: mask - array [n] of flags (1=stencil and depth test passed)
+ * Return: GL_FALSE - all fragments failed the testing
+ * GL_TRUE - one or more fragments passed the testing
*
*/
static GLboolean
-stencil_and_ztest_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], GLstencil stencil[],
- GLubyte mask[] )
+stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span, GLuint face)
{
- ASSERT(ctx->Stencil.Enabled);
- ASSERT(n <= PB_SIZE);
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLstencil stencilRow[MAX_WIDTH];
+ GLstencil *stencil;
+ const GLuint n = span->end;
+ const GLint x = span->x;
+ const GLint y = span->y;
+ GLubyte *mask = span->array->mask;
+ ASSERT((span->arrayMask & SPAN_XY) == 0);
+ ASSERT(ctx->Stencil.Enabled);
+ ASSERT(n <= MAX_WIDTH);
+#ifdef DEBUG
+ if (ctx->Depth.Test) {
+ ASSERT(span->arrayMask & SPAN_Z);
+ }
+#endif
+
+ /* Get initial stencil values */
+ if (swrast->Driver.WriteStencilSpan) {
+ /* Get stencil values from the hardware stencil buffer */
+ ASSERT(swrast->Driver.ReadStencilSpan);
+ (*swrast->Driver.ReadStencilSpan)(ctx, n, x, y, stencilRow);
+ stencil = stencilRow;
+ }
+ else {
+ /* Get pointer into software stencil buffer */
+ stencil = STENCIL_ADDRESS(x, y);
+ }
+
/*
* Apply the stencil test to the fragments.
* failMask[i] is 1 if the stencil test failed.
*/
- if (do_stencil_test( ctx, n, stencil, mask ) == GL_FALSE) {
+ if (do_stencil_test( ctx, face, n, stencil, mask ) == GL_FALSE) {
/* all fragments failed the stencil test, we're done. */
+ span->writeAll = GL_FALSE;
return GL_FALSE;
}
-
/*
* Some fragments passed the stencil test, apply depth test to them
* and apply Zpass and Zfail stencil ops.
*/
- if (ctx->Depth.Test==GL_FALSE) {
+ if (ctx->Depth.Test == GL_FALSE) {
/*
* No depth buffer, just apply zpass stencil function to active pixels.
*/
- apply_stencil_op( ctx, ctx->Stencil.ZPassFunc, n, stencil, mask );
+ apply_stencil_op( ctx, ctx->Stencil.ZPassFunc[face], face, n, stencil, mask );
}
else {
/*
@@ -457,7 +476,7 @@ stencil_and_ztest_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
MEMCPY(oldmask, mask, n * sizeof(GLubyte));
/* apply the depth test */
- _mesa_depth_test_span(ctx, n, x, y, z, mask);
+ _mesa_depth_test_span(ctx, span);
/* Set the stencil pass/fail flags according to result of depth testing.
* if oldmask[i] == 0 then
@@ -476,72 +495,36 @@ stencil_and_ztest_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
}
/* apply the pass and fail operations */
- if (ctx->Stencil.ZFailFunc != GL_KEEP) {
- apply_stencil_op( ctx, ctx->Stencil.ZFailFunc, n, stencil, failmask );
+ if (ctx->Stencil.ZFailFunc[face] != GL_KEEP) {
+ apply_stencil_op( ctx, ctx->Stencil.ZFailFunc[face], face,
+ n, stencil, failmask );
}
- if (ctx->Stencil.ZPassFunc != GL_KEEP) {
- apply_stencil_op( ctx, ctx->Stencil.ZPassFunc, n, stencil, passmask );
+ if (ctx->Stencil.ZPassFunc[face] != GL_KEEP) {
+ apply_stencil_op( ctx, ctx->Stencil.ZPassFunc[face], face,
+ n, stencil, passmask );
}
}
- return GL_TRUE; /* one or more fragments passed both tests */
-}
-
-
-
-/*
- * Apply stencil and depth testing to the span of pixels.
- * Both software and hardware stencil buffers are acceptable.
- * Input: n - number of pixels in the span
- * x, y - location of leftmost pixel in span
- * z - array [n] of z values
- * mask - array [n] of flags (1=test this pixel, 0=skip the pixel)
- * Output: mask - array [n] of flags (1=stencil and depth test passed)
- * Return: GL_TRUE - all fragments failed the testing
- * GL_FALSE - one or more fragments passed the testing
- *
- */
-GLboolean
-_mesa_stencil_and_ztest_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], GLubyte mask[] )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLstencil stencilRow[MAX_WIDTH];
- GLstencil *stencil;
- GLboolean result;
-
- ASSERT(ctx->Stencil.Enabled);
- ASSERT(n <= MAX_WIDTH);
-
- /* Get initial stencil values */
- if (swrast->Driver.WriteStencilSpan) {
- ASSERT(swrast->Driver.ReadStencilSpan);
- /* Get stencil values from the hardware stencil buffer */
- (*swrast->Driver.ReadStencilSpan)(ctx, n, x, y, stencilRow);
- stencil = stencilRow;
- }
- else {
- /* software stencil buffer */
- stencil = STENCIL_ADDRESS(x, y);
- }
-
- /* do all the stencil/depth testing/updating */
- result = stencil_and_ztest_span( ctx, n, x, y, z, stencil, mask );
-
+ /*
+ * Write updated stencil values back into hardware stencil buffer.
+ */
if (swrast->Driver.WriteStencilSpan) {
- /* Write updated stencil values into hardware stencil buffer */
+ ASSERT(stencil == stencilRow);
(swrast->Driver.WriteStencilSpan)(ctx, n, x, y, stencil, mask );
}
-
- return result;
+
+ span->writeAll = GL_FALSE;
+
+ return GL_TRUE; /* one or more fragments passed both tests */
}
-/*
+/**
* Apply the given stencil operator for each pixel in the array whose
- * mask flag is set. This is for software stencil buffers only.
+ * mask flag is set.
+ * \note This is for software stencil buffers only.
* Input: n - number of pixels in the span
* x, y - array of [n] pixels
* operator - the stencil buffer operator
@@ -550,11 +533,11 @@ _mesa_stencil_and_ztest_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
static void
apply_stencil_op_to_pixels( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
- GLenum oper, const GLubyte mask[] )
+ GLenum oper, GLuint face, const GLubyte mask[] )
{
- const GLstencil ref = ctx->Stencil.Ref;
- const GLstencil wrtmask = ctx->Stencil.WriteMask;
- const GLstencil invmask = (GLstencil) (~ctx->Stencil.WriteMask);
+ const GLstencil ref = ctx->Stencil.Ref[face];
+ const GLstencil wrtmask = ctx->Stencil.WriteMask[face];
+ const GLstencil invmask = (GLstencil) (~wrtmask);
GLuint i;
ASSERT(!SWRAST_CONTEXT(ctx)->Driver.WriteStencilSpan); /* software stencil buffer only! */
@@ -704,26 +687,31 @@ apply_stencil_op_to_pixels( const GLcontext *ctx,
-/*
+/**
* Apply stencil test to an array of pixels before depth buffering.
- * Used for software stencil buffer only.
+ *
+ * \note Used for software stencil buffer only.
* Input: n - number of pixels in the span
* x, y - array of [n] pixels to stencil
* mask - array [n] of flag: 0=skip the pixel, 1=stencil the pixel
* Output: mask - pixels which fail the stencil test will have their
* mask flag set to 0.
- * Return: 0 = all pixels failed, 1 = zero or more pixels passed.
+ * \return GL_FALSE = all pixels failed, GL_TRUE = zero or more pixels passed.
*/
static GLboolean
-stencil_test_pixels( GLcontext *ctx, GLuint n,
+stencil_test_pixels( GLcontext *ctx, GLuint face, GLuint n,
const GLint x[], const GLint y[], GLubyte mask[] )
{
- GLubyte fail[PB_SIZE];
+ GLubyte fail[MAX_WIDTH];
GLstencil r, s;
GLuint i;
GLboolean allfail = GL_FALSE;
+ const GLuint valueMask = ctx->Stencil.ValueMask[face];
- ASSERT(!SWRAST_CONTEXT(ctx)->Driver.WriteStencilSpan); /* software stencil buffer only! */
+ /* software stencil buffer only! */
+ ASSERT(ctx->DrawBuffer->UseSoftwareStencilBuffer);
+ ASSERT(!SWRAST_CONTEXT(ctx)->Driver.ReadStencilSpan);
+ ASSERT(!SWRAST_CONTEXT(ctx)->Driver.WriteStencilSpan);
/*
* Perform stencil test. The results of this operation are stored
@@ -735,7 +723,7 @@ stencil_test_pixels( GLcontext *ctx, GLuint n,
* ENDIF
*/
- switch (ctx->Stencil.Function) {
+ switch (ctx->Stencil.Function[face]) {
case GL_NEVER:
/* always fail */
for (i=0;i<n;i++) {
@@ -750,11 +738,11 @@ stencil_test_pixels( GLcontext *ctx, GLuint n,
allfail = GL_TRUE;
break;
case GL_LESS:
- r = (GLstencil) (ctx->Stencil.Ref & ctx->Stencil.ValueMask);
+ r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
for (i=0;i<n;i++) {
if (mask[i]) {
GLstencil *sptr = STENCIL_ADDRESS(x[i],y[i]);
- s = (GLstencil) (*sptr & ctx->Stencil.ValueMask);
+ s = (GLstencil) (*sptr & valueMask);
if (r < s) {
/* passed */
fail[i] = 0;
@@ -770,11 +758,11 @@ stencil_test_pixels( GLcontext *ctx, GLuint n,
}
break;
case GL_LEQUAL:
- r = (GLstencil) (ctx->Stencil.Ref & ctx->Stencil.ValueMask);
+ r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
for (i=0;i<n;i++) {
if (mask[i]) {
GLstencil *sptr = STENCIL_ADDRESS(x[i],y[i]);
- s = (GLstencil) (*sptr & ctx->Stencil.ValueMask);
+ s = (GLstencil) (*sptr & valueMask);
if (r <= s) {
/* pass */
fail[i] = 0;
@@ -790,11 +778,11 @@ stencil_test_pixels( GLcontext *ctx, GLuint n,
}
break;
case GL_GREATER:
- r = (GLstencil) (ctx->Stencil.Ref & ctx->Stencil.ValueMask);
+ r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
for (i=0;i<n;i++) {
if (mask[i]) {
GLstencil *sptr = STENCIL_ADDRESS(x[i],y[i]);
- s = (GLstencil) (*sptr & ctx->Stencil.ValueMask);
+ s = (GLstencil) (*sptr & valueMask);
if (r > s) {
/* passed */
fail[i] = 0;
@@ -810,11 +798,11 @@ stencil_test_pixels( GLcontext *ctx, GLuint n,
}
break;
case GL_GEQUAL:
- r = (GLstencil) (ctx->Stencil.Ref & ctx->Stencil.ValueMask);
+ r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
for (i=0;i<n;i++) {
if (mask[i]) {
GLstencil *sptr = STENCIL_ADDRESS(x[i],y[i]);
- s = (GLstencil) (*sptr & ctx->Stencil.ValueMask);
+ s = (GLstencil) (*sptr & valueMask);
if (r >= s) {
/* passed */
fail[i] = 0;
@@ -830,11 +818,11 @@ stencil_test_pixels( GLcontext *ctx, GLuint n,
}
break;
case GL_EQUAL:
- r = (GLstencil) (ctx->Stencil.Ref & ctx->Stencil.ValueMask);
+ r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
for (i=0;i<n;i++) {
if (mask[i]) {
GLstencil *sptr = STENCIL_ADDRESS(x[i],y[i]);
- s = (GLstencil) (*sptr & ctx->Stencil.ValueMask);
+ s = (GLstencil) (*sptr & valueMask);
if (r == s) {
/* passed */
fail[i] = 0;
@@ -850,11 +838,11 @@ stencil_test_pixels( GLcontext *ctx, GLuint n,
}
break;
case GL_NOTEQUAL:
- r = (GLstencil) (ctx->Stencil.Ref & ctx->Stencil.ValueMask);
+ r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask);
for (i=0;i<n;i++) {
if (mask[i]) {
GLstencil *sptr = STENCIL_ADDRESS(x[i],y[i]);
- s = (GLstencil) (*sptr & ctx->Stencil.ValueMask);
+ s = (GLstencil) (*sptr & valueMask);
if (r != s) {
/* passed */
fail[i] = 0;
@@ -880,8 +868,9 @@ stencil_test_pixels( GLcontext *ctx, GLuint n,
return 0;
}
- if (ctx->Stencil.FailFunc != GL_KEEP) {
- apply_stencil_op_to_pixels( ctx, n, x, y, ctx->Stencil.FailFunc, fail );
+ if (ctx->Stencil.FailFunc[face] != GL_KEEP) {
+ apply_stencil_op_to_pixels( ctx, n, x, y, ctx->Stencil.FailFunc[face],
+ face, fail );
}
return !allfail;
@@ -890,7 +879,7 @@ stencil_test_pixels( GLcontext *ctx, GLuint n,
-/*
+/**
* Apply stencil and depth testing to an array of pixels.
* This is used both for software and hardware stencil buffers.
*
@@ -903,54 +892,60 @@ stencil_test_pixels( GLcontext *ctx, GLuint n,
* z - array [n] of z values
* mask - array [n] of flags (1=test this pixel, 0=skip the pixel)
* Output: mask - array [n] of flags (1=stencil and depth test passed)
- * Return: GL_TRUE - all fragments failed the testing
- * GL_FALSE - one or more fragments passed the testing
+ * Return: GL_FALSE - all fragments failed the testing
+ * GL_TRUE - one or more fragments passed the testing
*/
-GLboolean
-_mesa_stencil_and_ztest_pixels( GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- const GLdepth z[], GLubyte mask[] )
+static GLboolean
+stencil_and_ztest_pixels( GLcontext *ctx, struct sw_span *span, GLuint face )
{
+ const GLuint n = span->end;
+ const GLint *x = span->array->x;
+ const GLint *y = span->array->y;
+ GLubyte *mask = span->array->mask;
SWcontext *swrast = SWRAST_CONTEXT(ctx);
+
+ ASSERT(span->arrayMask & SPAN_XY);
ASSERT(ctx->Stencil.Enabled);
- ASSERT(n <= PB_SIZE);
+ ASSERT(n <= MAX_WIDTH);
if (swrast->Driver.WriteStencilPixels) {
/*** Hardware stencil buffer ***/
- GLstencil stencil[PB_SIZE];
- GLubyte origMask[PB_SIZE];
+ GLstencil stencil[MAX_WIDTH];
+ GLubyte origMask[MAX_WIDTH];
+ ASSERT(!ctx->DrawBuffer->UseSoftwareStencilBuffer);
ASSERT(swrast->Driver.ReadStencilPixels);
(*swrast->Driver.ReadStencilPixels)(ctx, n, x, y, stencil);
MEMCPY(origMask, mask, n * sizeof(GLubyte));
- (void) do_stencil_test(ctx, n, stencil, mask);
+ (void) do_stencil_test(ctx, face, n, stencil, mask);
if (ctx->Depth.Test == GL_FALSE) {
- apply_stencil_op(ctx, ctx->Stencil.ZPassFunc, n, stencil, mask);
+ apply_stencil_op(ctx, ctx->Stencil.ZPassFunc[face], face,
+ n, stencil, mask);
}
else {
- _mesa_depth_test_pixels(ctx, n, x, y, z, mask);
+ _mesa_depth_test_span(ctx, span);
- if (ctx->Stencil.ZFailFunc != GL_KEEP) {
- GLubyte failmask[PB_SIZE];
+ if (ctx->Stencil.ZFailFunc[face] != GL_KEEP) {
+ GLubyte failmask[MAX_WIDTH];
GLuint i;
for (i = 0; i < n; i++) {
ASSERT(mask[i] == 0 || mask[i] == 1);
failmask[i] = origMask[i] & (mask[i] ^ 1);
}
- apply_stencil_op(ctx, ctx->Stencil.ZFailFunc,
+ apply_stencil_op(ctx, ctx->Stencil.ZFailFunc[face], face,
n, stencil, failmask);
}
- if (ctx->Stencil.ZPassFunc != GL_KEEP) {
- GLubyte passmask[PB_SIZE];
+ if (ctx->Stencil.ZPassFunc[face] != GL_KEEP) {
+ GLubyte passmask[MAX_WIDTH];
GLuint i;
for (i = 0; i < n; i++) {
ASSERT(mask[i] == 0 || mask[i] == 1);
passmask[i] = origMask[i] & mask[i];
}
- apply_stencil_op(ctx, ctx->Stencil.ZPassFunc,
+ apply_stencil_op(ctx, ctx->Stencil.ZPassFunc[face], face,
n, stencil, passmask);
}
}
@@ -963,22 +958,24 @@ _mesa_stencil_and_ztest_pixels( GLcontext *ctx,
else {
/*** Software stencil buffer ***/
- if (stencil_test_pixels(ctx, n, x, y, mask) == GL_FALSE) {
+ ASSERT(ctx->DrawBuffer->UseSoftwareStencilBuffer);
+
+ if (stencil_test_pixels(ctx, face, n, x, y, mask) == GL_FALSE) {
/* all fragments failed the stencil test, we're done. */
return GL_FALSE;
}
if (ctx->Depth.Test==GL_FALSE) {
apply_stencil_op_to_pixels(ctx, n, x, y,
- ctx->Stencil.ZPassFunc, mask);
+ ctx->Stencil.ZPassFunc[face], face, mask);
}
else {
- GLubyte passmask[PB_SIZE], failmask[PB_SIZE], oldmask[PB_SIZE];
+ GLubyte passmask[MAX_WIDTH], failmask[MAX_WIDTH], oldmask[MAX_WIDTH];
GLuint i;
MEMCPY(oldmask, mask, n * sizeof(GLubyte));
- _mesa_depth_test_pixels(ctx, n, x, y, z, mask);
+ _mesa_depth_test_span(ctx, span);
for (i=0;i<n;i++) {
ASSERT(mask[i] == 0 || mask[i] == 1);
@@ -986,13 +983,15 @@ _mesa_stencil_and_ztest_pixels( GLcontext *ctx,
failmask[i] = oldmask[i] & (mask[i] ^ 1);
}
- if (ctx->Stencil.ZFailFunc != GL_KEEP) {
+ if (ctx->Stencil.ZFailFunc[face] != GL_KEEP) {
apply_stencil_op_to_pixels(ctx, n, x, y,
- ctx->Stencil.ZFailFunc, failmask);
+ ctx->Stencil.ZFailFunc[face],
+ face, failmask);
}
- if (ctx->Stencil.ZPassFunc != GL_KEEP) {
+ if (ctx->Stencil.ZPassFunc[face] != GL_KEEP) {
apply_stencil_op_to_pixels(ctx, n, x, y,
- ctx->Stencil.ZPassFunc, passmask);
+ ctx->Stencil.ZPassFunc[face],
+ face, passmask);
}
}
@@ -1001,8 +1000,23 @@ _mesa_stencil_and_ztest_pixels( GLcontext *ctx,
}
+/**
+ * /return GL_TRUE = one or more fragments passed,
+ * GL_FALSE = all fragments failed.
+ */
+GLboolean
+_mesa_stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span)
+{
+ /* span->facing can only be non-zero if using two-sided stencil */
+ ASSERT(ctx->Stencil.TestTwoSide || span->facing == 0);
+ if (span->arrayMask & SPAN_XY)
+ return stencil_and_ztest_pixels(ctx, span, span->facing);
+ else
+ return stencil_and_ztest_span(ctx, span, span->facing);
+}
-/*
+
+/**
* Return a span of stencil values from the stencil buffer.
* Used for glRead/CopyPixels
* Input: n - how many pixels
@@ -1014,8 +1028,10 @@ _mesa_read_stencil_span( GLcontext *ctx,
GLint n, GLint x, GLint y, GLstencil stencil[] )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- if (y < 0 || y >= (GLint) ctx->DrawBuffer->Height ||
- x + n <= 0 || x >= (GLint) ctx->DrawBuffer->Width) {
+ const GLint bufWidth = (GLint) ctx->DrawBuffer->Width;
+ const GLint bufHeight = (GLint) ctx->DrawBuffer->Height;
+
+ if (y < 0 || y >= bufHeight || x + n <= 0 || x >= bufWidth) {
/* span is completely outside framebuffer */
return; /* undefined values OK */
}
@@ -1026,8 +1042,8 @@ _mesa_read_stencil_span( GLcontext *ctx,
n -= dx;
stencil += dx;
}
- if (x + n > (GLint) ctx->DrawBuffer->Width) {
- GLint dx = x + n - (GLint) ctx->DrawBuffer->Width;
+ if (x + n > bufWidth) {
+ GLint dx = x + n - bufWidth;
n -= dx;
}
if (n <= 0) {
@@ -1053,7 +1069,7 @@ _mesa_read_stencil_span( GLcontext *ctx,
-/*
+/**
* Write a span of stencil values to the stencil buffer.
* Used for glDraw/CopyPixels
* Input: n - how many pixels
@@ -1066,9 +1082,10 @@ _mesa_write_stencil_span( GLcontext *ctx, GLint n, GLint x, GLint y,
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLstencil *ssrc = stencil;
+ const GLint bufWidth = (GLint) ctx->DrawBuffer->Width;
+ const GLint bufHeight = (GLint) ctx->DrawBuffer->Height;
- if (y < 0 || y >= (GLint) ctx->DrawBuffer->Height ||
- x + n <= 0 || x >= (GLint) ctx->DrawBuffer->Width) {
+ if (y < 0 || y >= bufHeight || x + n <= 0 || x >= bufWidth) {
/* span is completely outside framebuffer */
return; /* undefined values OK */
}
@@ -1079,8 +1096,8 @@ _mesa_write_stencil_span( GLcontext *ctx, GLint n, GLint x, GLint y,
n -= dx;
ssrc += dx;
}
- if (x + n > (GLint) ctx->DrawBuffer->Width) {
- GLint dx = x + n - (GLint) ctx->DrawBuffer->Width;
+ if (x + n > bufWidth) {
+ GLint dx = x + n - bufWidth;
n -= dx;
}
if (n <= 0) {
@@ -1104,7 +1121,7 @@ _mesa_write_stencil_span( GLcontext *ctx, GLint n, GLint x, GLint y,
-/*
+/**
* Allocate a new stencil buffer. If there's an old one it will be
* deallocated first. The new stencil buffer will be uninitialized.
*/
@@ -1118,8 +1135,8 @@ _mesa_alloc_stencil_buffer( GLframebuffer *buffer )
}
/* allocate new stencil buffer */
- buffer->Stencil = (GLstencil *) MESA_PBUFFER_ALLOC(buffer->Width * buffer->Height
- * sizeof(GLstencil));
+ buffer->Stencil = (GLstencil *)
+ MESA_PBUFFER_ALLOC(buffer->Width * buffer->Height * sizeof(GLstencil));
if (!buffer->Stencil) {
/* out of memory */
_mesa_error( NULL, GL_OUT_OF_MEMORY, "_mesa_alloc_stencil_buffer" );
@@ -1128,7 +1145,7 @@ _mesa_alloc_stencil_buffer( GLframebuffer *buffer )
-/*
+/**
* Clear the software (malloc'd) stencil buffer.
*/
static void
@@ -1142,11 +1159,11 @@ clear_software_stencil_buffer( GLcontext *ctx )
if (ctx->Scissor.Enabled) {
/* clear scissor region only */
const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
- if (ctx->Stencil.WriteMask != STENCIL_MAX) {
+ if (ctx->Stencil.WriteMask[0] != STENCIL_MAX) {
/* must apply mask to the clear */
GLint y;
for (y = ctx->DrawBuffer->_Ymin; y < ctx->DrawBuffer->_Ymax; y++) {
- const GLstencil mask = ctx->Stencil.WriteMask;
+ const GLstencil mask = ctx->Stencil.WriteMask[0];
const GLstencil invMask = ~mask;
const GLstencil clearVal = (ctx->Stencil.Clear & mask);
GLstencil *stencil = STENCIL_ADDRESS( ctx->DrawBuffer->_Xmin, y );
@@ -1173,11 +1190,11 @@ clear_software_stencil_buffer( GLcontext *ctx )
}
else {
/* clear whole stencil buffer */
- if (ctx->Stencil.WriteMask != STENCIL_MAX) {
+ if (ctx->Stencil.WriteMask[0] != STENCIL_MAX) {
/* must apply mask to the clear */
const GLuint n = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height;
GLstencil *stencil = ctx->DrawBuffer->Stencil;
- const GLstencil mask = ctx->Stencil.WriteMask;
+ const GLstencil mask = ctx->Stencil.WriteMask[0];
const GLstencil invMask = ~mask;
const GLstencil clearVal = (ctx->Stencil.Clear & mask);
GLuint i;
@@ -1204,7 +1221,7 @@ clear_software_stencil_buffer( GLcontext *ctx )
-/*
+/**
* Clear the hardware (in graphics card) stencil buffer.
* This is done with the Driver.WriteStencilSpan() and Driver.ReadStencilSpan()
* functions.
@@ -1224,11 +1241,11 @@ clear_hardware_stencil_buffer( GLcontext *ctx )
/* clear scissor region only */
const GLint x = ctx->DrawBuffer->_Xmin;
const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
- if (ctx->Stencil.WriteMask != STENCIL_MAX) {
+ if (ctx->Stencil.WriteMask[0] != STENCIL_MAX) {
/* must apply mask to the clear */
GLint y;
for (y = ctx->DrawBuffer->_Ymin; y < ctx->DrawBuffer->_Ymax; y++) {
- const GLstencil mask = ctx->Stencil.WriteMask;
+ const GLstencil mask = ctx->Stencil.WriteMask[0];
const GLstencil invMask = ~mask;
const GLstencil clearVal = (ctx->Stencil.Clear & mask);
GLstencil stencil[MAX_WIDTH];
@@ -1254,9 +1271,9 @@ clear_hardware_stencil_buffer( GLcontext *ctx )
}
else {
/* clear whole stencil buffer */
- if (ctx->Stencil.WriteMask != STENCIL_MAX) {
+ if (ctx->Stencil.WriteMask[0] != STENCIL_MAX) {
/* must apply mask to the clear */
- const GLstencil mask = ctx->Stencil.WriteMask;
+ const GLstencil mask = ctx->Stencil.WriteMask[0];
const GLstencil invMask = ~mask;
const GLstencil clearVal = (ctx->Stencil.Clear & mask);
const GLint width = ctx->DrawBuffer->Width;
@@ -1292,8 +1309,8 @@ clear_hardware_stencil_buffer( GLcontext *ctx )
-/*
- * Clear the stencil buffer.
+/**
+ * Clear the stencil buffer (hardware or software).
*/
void
_mesa_clear_stencil_buffer( GLcontext *ctx )
diff --git a/xc/extras/Mesa/src/swrast/s_stencil.h b/xc/extras/Mesa/src/swrast/s_stencil.h
index 03e0de901..30b390e1b 100644
--- a/xc/extras/Mesa/src/swrast/s_stencil.h
+++ b/xc/extras/Mesa/src/swrast/s_stencil.h
@@ -1,8 +1,7 @@
-/* $Id: s_stencil.h,v 1.1.1.1 2002/10/22 13:06:41 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.2
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -33,14 +32,10 @@
#include "swrast.h"
-extern GLboolean
-_mesa_stencil_and_ztest_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], GLubyte mask[] );
extern GLboolean
-_mesa_stencil_and_ztest_pixels( GLcontext *ctx, GLuint n,
- const GLint x[], const GLint y[],
- const GLdepth z[], GLubyte mask[] );
+_mesa_stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span);
+
extern void
diff --git a/xc/extras/Mesa/src/swrast/s_texstore.c b/xc/extras/Mesa/src/swrast/s_texstore.c
index 0ec021b70..1865b22e3 100644
--- a/xc/extras/Mesa/src/swrast/s_texstore.c
+++ b/xc/extras/Mesa/src/swrast/s_texstore.c
@@ -1,10 +1,9 @@
-/* $Id: s_texstore.c,v 1.1.1.1 2002/10/22 13:06:53 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -42,8 +41,8 @@
#include "context.h"
#include "convolve.h"
#include "image.h"
+#include "imports.h"
#include "macros.h"
-#include "mem.h"
#include "texformat.h"
#include "teximage.h"
#include "texstore.h"
@@ -73,8 +72,7 @@ read_color_image( GLcontext *ctx, GLint x, GLint y,
return NULL;
/* Select buffer to read from */
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
- ctx->Pixel.DriverReadBuffer );
+ _swrast_use_read_buffer(ctx);
RENDER_START(swrast,ctx);
@@ -89,8 +87,7 @@ read_color_image( GLcontext *ctx, GLint x, GLint y,
RENDER_FINISH(swrast,ctx);
/* Read from draw buffer (the default) */
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
- ctx->Color.DriverDrawBuffer );
+ _swrast_use_draw_buffer(ctx);
return image;
}
@@ -146,8 +143,8 @@ is_depth_format(GLenum format)
*/
void
_swrast_copy_teximage1d( GLcontext *ctx, GLenum target, GLint level,
- GLenum internalFormat,
- GLint x, GLint y, GLsizei width, GLint border )
+ GLenum internalFormat,
+ GLint x, GLint y, GLsizei width, GLint border )
{
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
@@ -194,7 +191,7 @@ _swrast_copy_teximage1d( GLcontext *ctx, GLenum target, GLint level,
/* GL_SGIS_generate_mipmap */
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- _mesa_generate_mipmap(ctx, texUnit, texObj);
+ _mesa_generate_mipmap(ctx, target, texUnit, texObj);
}
}
@@ -204,9 +201,9 @@ _swrast_copy_teximage1d( GLcontext *ctx, GLenum target, GLint level,
*/
void
_swrast_copy_teximage2d( GLcontext *ctx, GLenum target, GLint level,
- GLenum internalFormat,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLint border )
+ GLenum internalFormat,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLint border )
{
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
@@ -253,7 +250,7 @@ _swrast_copy_teximage2d( GLcontext *ctx, GLenum target, GLint level,
/* GL_SGIS_generate_mipmap */
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- _mesa_generate_mipmap(ctx, texUnit, texObj);
+ _mesa_generate_mipmap(ctx, target, texUnit, texObj);
}
}
@@ -262,8 +259,8 @@ _swrast_copy_teximage2d( GLcontext *ctx, GLenum target, GLint level,
* Fallback for Driver.CopyTexSubImage1D().
*/
void
-_swrast_copy_texsubimage1d(GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y, GLsizei width)
+_swrast_copy_texsubimage1d( GLcontext *ctx, GLenum target, GLint level,
+ GLint xoffset, GLint x, GLint y, GLsizei width )
{
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
@@ -277,55 +274,38 @@ _swrast_copy_texsubimage1d(GLcontext *ctx, GLenum target, GLint level,
ASSERT(ctx->Driver.TexImage1D);
- if (texImage->Format != GL_DEPTH_COMPONENT) {
- /* read RGBA image from framebuffer */
- GLchan *image = read_color_image(ctx, x, y, width, 1);
+ if (texImage->Format == GL_DEPTH_COMPONENT) {
+ /* read depth image from framebuffer */
+ GLfloat *image = read_depth_image(ctx, x, y, width, 1);
if (!image) {
- _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D" );
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D");
return;
}
-#if 0
- /*
- * XXX this is a bit of a hack. We need to be sure that the alpha
- * channel is 1.0 if the internal texture format is not supposed to
- * have an alpha channel. This is because some drivers may store
- * RGB textures as RGBA and the texutil.c code isn't smart enough
- * to set the alpha channel to 1.0 in this situation.
- */
- if (texImage->Format == GL_LUMINANCE ||
- texImage->Format == GL_RGB) {
- const GLuint n = width * 4;
- GLuint i;
- for (i = 0; i < n; i += 4) {
- image[i + 3] = CHAN_MAX;
- }
- }
-#endif
- /* now call glTexSubImage1D to do the real work */
+ /* call glTexSubImage1D to redefine the texture */
(*ctx->Driver.TexSubImage1D)(ctx, target, level, xoffset, width,
- GL_RGBA, CHAN_TYPE, image,
+ GL_DEPTH_COMPONENT, GL_FLOAT, image,
&_mesa_native_packing, texObj, texImage);
FREE(image);
}
else {
- /* read depth image from framebuffer */
- GLfloat *image = read_depth_image(ctx, x, y, width, 1);
+ /* read RGBA image from framebuffer */
+ GLchan *image = read_color_image(ctx, x, y, width, 1);
if (!image) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D");
+ _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D" );
return;
}
- /* call glTexSubImage1D to redefine the texture */
+ /* now call glTexSubImage1D to do the real work */
(*ctx->Driver.TexSubImage1D)(ctx, target, level, xoffset, width,
- GL_DEPTH_COMPONENT, GL_FLOAT, image,
+ GL_RGBA, CHAN_TYPE, image,
&_mesa_native_packing, texObj, texImage);
FREE(image);
}
/* GL_SGIS_generate_mipmap */
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- _mesa_generate_mipmap(ctx, texUnit, texObj);
+ _mesa_generate_mipmap(ctx, target, texUnit, texObj);
}
}
@@ -335,9 +315,9 @@ _swrast_copy_texsubimage1d(GLcontext *ctx, GLenum target, GLint level,
*/
void
_swrast_copy_texsubimage2d( GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint x, GLint y, GLsizei width, GLsizei height )
+ GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height )
{
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
@@ -351,57 +331,40 @@ _swrast_copy_texsubimage2d( GLcontext *ctx,
ASSERT(ctx->Driver.TexImage2D);
- if (texImage->Format != GL_DEPTH_COMPONENT) {
- /* read RGBA image from framebuffer */
- GLchan *image = read_color_image(ctx, x, y, width, height);
+ if (texImage->Format == GL_DEPTH_COMPONENT) {
+ /* read depth image from framebuffer */
+ GLfloat *image = read_depth_image(ctx, x, y, width, height);
if (!image) {
- _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D" );
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D");
return;
}
-#if 0
- /*
- * XXX this is a bit of a hack. We need to be sure that the alpha
- * channel is 1.0 if the internal texture format is not supposed to
- * have an alpha channel. This is because some drivers may store
- * RGB textures as RGBA and the texutil.c code isn't smart enough
- * to set the alpha channel to 1.0 in this situation.
- */
- if (texImage->Format == GL_LUMINANCE ||
- texImage->Format == GL_RGB) {
- const GLuint n = width * height * 4;
- GLuint i;
- for (i = 0; i < n; i += 4) {
- image[i + 3] = CHAN_MAX;
- }
- }
-#endif
- /* now call glTexSubImage2D to do the real work */
+ /* call glTexImage1D to redefine the texture */
(*ctx->Driver.TexSubImage2D)(ctx, target, level,
xoffset, yoffset, width, height,
- GL_RGBA, CHAN_TYPE, image,
+ GL_DEPTH_COMPONENT, GL_FLOAT, image,
&_mesa_native_packing, texObj, texImage);
FREE(image);
}
else {
- /* read depth image from framebuffer */
- GLfloat *image = read_depth_image(ctx, x, y, width, height);
+ /* read RGBA image from framebuffer */
+ GLchan *image = read_color_image(ctx, x, y, width, height);
if (!image) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D");
+ _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D" );
return;
}
- /* call glTexImage1D to redefine the texture */
+ /* now call glTexSubImage2D to do the real work */
(*ctx->Driver.TexSubImage2D)(ctx, target, level,
xoffset, yoffset, width, height,
- GL_DEPTH_COMPONENT, GL_FLOAT, image,
+ GL_RGBA, CHAN_TYPE, image,
&_mesa_native_packing, texObj, texImage);
FREE(image);
}
/* GL_SGIS_generate_mipmap */
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- _mesa_generate_mipmap(ctx, texUnit, texObj);
+ _mesa_generate_mipmap(ctx, target, texUnit, texObj);
}
}
@@ -411,9 +374,9 @@ _swrast_copy_texsubimage2d( GLcontext *ctx,
*/
void
_swrast_copy_texsubimage3d( GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLint x, GLint y, GLsizei width, GLsizei height )
+ GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height )
{
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
@@ -427,55 +390,39 @@ _swrast_copy_texsubimage3d( GLcontext *ctx,
ASSERT(ctx->Driver.TexImage3D);
- if (texImage->Format != GL_DEPTH_COMPONENT) {
- /* read RGBA image from framebuffer */
- GLchan *image = read_color_image(ctx, x, y, width, height);
+ if (texImage->Format == GL_DEPTH_COMPONENT) {
+ /* read depth image from framebuffer */
+ GLfloat *image = read_depth_image(ctx, x, y, width, height);
if (!image) {
- _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D" );
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D");
return;
}
-#if 0
- /*
- * XXX this is a bit of a hack. We need to be sure that the alpha
- * channel is 1.0 if the internal texture format is not supposed to
- * have an alpha channel. This is because some drivers may store
- * RGB textures as RGBA and the texutil.c code isn't smart enough
- * to set the alpha channel to 1.0 in this situation.
- */
- if (texImage->Format == GL_LUMINANCE ||
- texImage->Format == GL_RGB) {
- const GLuint n = width * height * 4;
- GLuint i;
- for (i = 0; i < n; i += 4) {
- image[i + 3] = CHAN_MAX;
- }
- }
-#endif
- /* now call glTexSubImage3D to do the real work */
+
+ /* call glTexImage1D to redefine the texture */
(*ctx->Driver.TexSubImage3D)(ctx, target, level,
xoffset, yoffset, zoffset, width, height, 1,
- GL_RGBA, CHAN_TYPE, image,
+ GL_DEPTH_COMPONENT, GL_FLOAT, image,
&_mesa_native_packing, texObj, texImage);
FREE(image);
}
else {
- /* read depth image from framebuffer */
- GLfloat *image = read_depth_image(ctx, x, y, width, height);
+ /* read RGBA image from framebuffer */
+ GLchan *image = read_color_image(ctx, x, y, width, height);
if (!image) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D");
+ _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D" );
return;
}
- /* call glTexImage1D to redefine the texture */
+ /* now call glTexSubImage3D to do the real work */
(*ctx->Driver.TexSubImage3D)(ctx, target, level,
xoffset, yoffset, zoffset, width, height, 1,
- GL_DEPTH_COMPONENT, GL_FLOAT, image,
+ GL_RGBA, CHAN_TYPE, image,
&_mesa_native_packing, texObj, texImage);
FREE(image);
}
/* GL_SGIS_generate_mipmap */
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- _mesa_generate_mipmap(ctx, texUnit, texObj);
+ _mesa_generate_mipmap(ctx, target, texUnit, texObj);
}
}
diff --git a/xc/extras/Mesa/src/swrast/s_texture.c b/xc/extras/Mesa/src/swrast/s_texture.c
index 66672a94f..5286601f8 100644
--- a/xc/extras/Mesa/src/swrast/s_texture.c
+++ b/xc/extras/Mesa/src/swrast/s_texture.c
@@ -1,8 +1,6 @@
-/* $Id: s_texture.c,v 1.1.1.1 2002/10/22 13:06:51 alanh Exp $ */
-
/*
* Mesa 3-D graphics library
- * Version: 4.0.4
+ * Version: 5.0
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -30,12 +28,11 @@
#include "colormac.h"
#include "macros.h"
#include "mmath.h"
-#include "mem.h"
+#include "imports.h"
#include "texformat.h"
#include "teximage.h"
#include "s_context.h"
-#include "s_pb.h"
#include "s_texture.h"
@@ -50,7 +47,7 @@
/*
* Used to compute texel locations for linear sampling.
* Input:
- * wrapMode = GL_REPEAT, GL_CLAMP, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_BORDER_ARB
+ * wrapMode = GL_REPEAT, GL_CLAMP, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_BORDER
* S = texcoord in [0,1]
* SIZE = width (or height or depth) of texture
* Output:
@@ -79,7 +76,7 @@
if (I1 >= (GLint) SIZE) \
I1 = SIZE - 1; \
} \
- else if (wrapMode == GL_CLAMP_TO_BORDER_ARB) { \
+ else if (wrapMode == GL_CLAMP_TO_BORDER) { \
const GLfloat min = -1.0F / (2.0F * SIZE); \
const GLfloat max = 1.0F - min; \
if (S <= min) \
@@ -92,12 +89,37 @@
I0 = IFLOOR(U); \
I1 = I0 + 1; \
} \
- else if (wrapMode == GL_MIRRORED_REPEAT_ARB) { \
+ else if (wrapMode == GL_MIRRORED_REPEAT) { \
const GLint flr = IFLOOR(S); \
if (flr & 1) \
U = 1.0F - (S - (GLfloat) flr); /* flr is odd */ \
else \
U = S - (GLfloat) flr; /* flr is even */ \
+ U = (U * SIZE) - 0.5F; \
+ I0 = IFLOOR(U); \
+ I1 = I0 + 1; \
+ if (I0 < 0) \
+ I0 = 0; \
+ if (I1 >= (GLint) SIZE) \
+ I1 = SIZE - 1; \
+ } \
+ else if (wrapMode == GL_MIRROR_CLAMP_ATI) { \
+ U = (GLfloat) fabs(S); \
+ if (U >= 1.0F) \
+ U = (GLfloat) SIZE; \
+ else \
+ U *= SIZE; \
+ U -= 0.5F; \
+ I0 = IFLOOR(U); \
+ I1 = I0 + 1; \
+ } \
+ else if (wrapMode == GL_MIRROR_CLAMP_TO_EDGE_ATI) { \
+ U = (GLfloat) fabs(S); \
+ if (U >= 1.0F) \
+ U = (GLfloat) SIZE; \
+ else \
+ U *= SIZE; \
+ U -= 0.5F; \
I0 = IFLOOR(U); \
I1 = I0 + 1; \
if (I0 < 0) \
@@ -143,7 +165,7 @@
else \
I = IFLOOR(S * SIZE); \
} \
- else if (wrapMode == GL_CLAMP_TO_BORDER_ARB) { \
+ else if (wrapMode == GL_CLAMP_TO_BORDER) { \
/* s limited to [min,max] */ \
/* i limited to [-1, size] */ \
const GLfloat min = -1.0F / (2.0F * SIZE); \
@@ -155,7 +177,7 @@
else \
I = IFLOOR(S * SIZE); \
} \
- else if (wrapMode == GL_MIRRORED_REPEAT_ARB) { \
+ else if (wrapMode == GL_MIRRORED_REPEAT) { \
const GLfloat min = 1.0F / (2.0F * SIZE); \
const GLfloat max = 1.0F - min; \
const GLint flr = IFLOOR(S); \
@@ -171,6 +193,30 @@
else \
I = IFLOOR(u * SIZE); \
} \
+ else if (wrapMode == GL_MIRROR_CLAMP_ATI) { \
+ /* s limited to [0,1] */ \
+ /* i limited to [0,size-1] */ \
+ const GLfloat u = (GLfloat) fabs(S); \
+ if (u <= 0.0F) \
+ I = 0; \
+ else if (u >= 1.0F) \
+ I = SIZE - 1; \
+ else \
+ I = IFLOOR(u * SIZE); \
+ } \
+ else if (wrapMode == GL_MIRROR_CLAMP_TO_EDGE_ATI) { \
+ /* s limited to [min,max] */ \
+ /* i limited to [0, size-1] */ \
+ const GLfloat min = 1.0F / (2.0F * SIZE); \
+ const GLfloat max = 1.0F - min; \
+ const GLfloat u = (GLfloat) fabs(S); \
+ if (u < min) \
+ I = 0; \
+ else if (u > max) \
+ I = SIZE - 1; \
+ else \
+ I = IFLOOR(u * SIZE); \
+ } \
else { \
ASSERT(wrapMode == GL_CLAMP); \
/* s limited to [0,1] */ \
@@ -185,16 +231,25 @@
}
+#define COMPUTE_LINEAR_REPEAT_TEXEL_LOCATION(S, U, SIZE, I0, I1) \
+{ \
+ U = S * SIZE - 0.5F; \
+ I0 = IFLOOR(U) & (SIZE - 1); \
+ I1 = (I0 + 1) & (SIZE - 1); \
+}
+
+
/*
* Compute linear mipmap levels for given lambda.
*/
#define COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda, level) \
{ \
if (lambda < 0.0F) \
- lambda = 0.0F; \
+ level = tObj->BaseLevel; \
else if (lambda > tObj->_MaxLambda) \
- lambda = tObj->_MaxLambda; \
- level = (GLint) (tObj->BaseLevel + lambda); \
+ level = (GLint) (tObj->BaseLevel + tObj->_MaxLambda); \
+ else \
+ level = (GLint) (tObj->BaseLevel + lambda); \
}
@@ -203,11 +258,14 @@
*/
#define COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda, level) \
{ \
+ GLfloat l; \
if (lambda <= 0.5F) \
- lambda = 0.0F; \
+ l = 0.0F; \
else if (lambda > tObj->_MaxLambda + 0.4999F) \
- lambda = tObj->_MaxLambda + 0.4999F; \
- level = (GLint) (tObj->BaseLevel + lambda + 0.5F); \
+ l = tObj->_MaxLambda + 0.4999F; \
+ else \
+ l = lambda; \
+ level = (GLint) (tObj->BaseLevel + l + 0.5F); \
if (level > tObj->_MaxLevel) \
level = tObj->_MaxLevel; \
}
@@ -236,7 +294,6 @@
#define K1BIT 32
-
/*
* Get texture palette entry.
*/
@@ -288,6 +345,100 @@ palette_sample(const GLcontext *ctx,
}
+/*
+ * The lambda[] array values are always monotonic. Either the whole span
+ * will be minified, magnified, or split between the two. This function
+ * determines the subranges in [0, n-1] that are to be minified or magnified.
+ */
+static INLINE void
+compute_min_mag_ranges( GLfloat minMagThresh, GLuint n, const GLfloat lambda[],
+ GLuint *minStart, GLuint *minEnd,
+ GLuint *magStart, GLuint *magEnd )
+{
+ ASSERT(lambda != NULL);
+#if 0
+ /* Verify that lambda[] is monotonous.
+ * We can't really use this because the inaccuracy in the LOG2 function
+ * causes this test to fail, yet the resulting texturing is correct.
+ */
+ if (n > 1) {
+ GLuint i;
+ printf("lambda delta = %g\n", lambda[0] - lambda[n-1]);
+ if (lambda[0] >= lambda[n-1]) { /* decreasing */
+ for (i = 0; i < n - 1; i++) {
+ ASSERT((GLint) (lambda[i] * 10) >= (GLint) (lambda[i+1] * 10));
+ }
+ }
+ else { /* increasing */
+ for (i = 0; i < n - 1; i++) {
+ ASSERT((GLint) (lambda[i] * 10) <= (GLint) (lambda[i+1] * 10));
+ }
+ }
+ }
+#endif /* DEBUG */
+
+ /* since lambda is monotonous-array use this check first */
+ if (lambda[0] <= minMagThresh && lambda[n-1] <= minMagThresh) {
+ /* magnification for whole span */
+ *magStart = 0;
+ *magEnd = n;
+ *minStart = *minEnd = 0;
+ }
+ else if (lambda[0] > minMagThresh && lambda[n-1] > minMagThresh) {
+ /* minification for whole span */
+ *minStart = 0;
+ *minEnd = n;
+ *magStart = *magEnd = 0;
+ }
+ else {
+ /* a mix of minification and magnification */
+ GLuint i;
+ if (lambda[0] > minMagThresh) {
+ /* start with minification */
+ for (i = 1; i < n; i++) {
+ if (lambda[i] <= minMagThresh)
+ break;
+ }
+ *minStart = 0;
+ *minEnd = i;
+ *magStart = i;
+ *magEnd = n;
+ }
+ else {
+ /* start with magnification */
+ for (i = 1; i < n; i++) {
+ if (lambda[i] > minMagThresh)
+ break;
+ }
+ *magStart = 0;
+ *magEnd = i;
+ *minStart = i;
+ *minEnd = n;
+ }
+ }
+
+#if 0
+ /* Verify the min/mag Start/End values
+ * We don't use this either (see above)
+ */
+ {
+ GLint i;
+ for (i = 0; i < n; i++) {
+ if (lambda[i] > minMagThresh) {
+ /* minification */
+ ASSERT(i >= *minStart);
+ ASSERT(i < *minEnd);
+ }
+ else {
+ /* magnification */
+ ASSERT(i >= *magStart);
+ ASSERT(i < *magEnd);
+ }
+ }
+ }
+#endif
+}
+
/**********************************************************************/
/* 1-D Texture Sampling Functions */
@@ -300,19 +451,19 @@ static void
sample_1d_nearest(GLcontext *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
- GLfloat s, GLchan rgba[4])
+ const GLfloat texcoord[4], GLchan rgba[4])
{
const GLint width = img->Width2; /* without border, power of two */
GLint i;
- COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, s, width, i);
+ COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, texcoord[0], width, i);
/* skip over the border, if any */
i += img->Border;
if (i < 0 || i >= (GLint) img->Width) {
- /* Need this test for GL_CLAMP_TO_BORDER_ARB mode */
- COPY_CHAN4(rgba, tObj->BorderColor);
+ /* Need this test for GL_CLAMP_TO_BORDER mode */
+ COPY_CHAN4(rgba, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i, 0, 0, (GLvoid *) rgba);
@@ -331,14 +482,14 @@ static void
sample_1d_linear(GLcontext *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
- GLfloat s, GLchan rgba[4])
+ const GLfloat texcoord[4], GLchan rgba[4])
{
const GLint width = img->Width2;
GLint i0, i1;
GLfloat u;
GLuint useBorderColor;
- COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapS, s, u, width, i0, i1);
+ COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapS, texcoord[0], u, width, i0, i1);
useBorderColor = 0;
if (img->Border) {
@@ -364,7 +515,7 @@ sample_1d_linear(GLcontext *ctx,
GLchan t0[4], t1[4]; /* texels */
if (useBorderColor & I0BIT) {
- COPY_CHAN4(t0, tObj->BorderColor);
+ COPY_CHAN4(t0, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i0, 0, 0, (GLvoid *) t0);
@@ -373,7 +524,7 @@ sample_1d_linear(GLcontext *ctx,
}
}
if (useBorderColor & I1BIT) {
- COPY_CHAN4(t1, tObj->BorderColor);
+ COPY_CHAN4(t1, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i1, 0, 0, (GLvoid *) t1);
@@ -406,24 +557,32 @@ sample_1d_linear(GLcontext *ctx,
static void
sample_1d_nearest_mipmap_nearest(GLcontext *ctx,
const struct gl_texture_object *tObj,
- GLfloat s, GLfloat lambda,
- GLchan rgba[4])
+ GLuint n, GLfloat texcoord[][4],
+ const GLfloat lambda[], GLchan rgba[][4])
{
- GLint level;
- COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda, level);
- sample_1d_nearest(ctx, tObj, tObj->Image[level], s, rgba);
+ GLuint i;
+ ASSERT(lambda != NULL);
+ for (i = 0; i < n; i++) {
+ GLint level;
+ COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda[i], level);
+ sample_1d_nearest(ctx, tObj, tObj->Image[level], texcoord[i], rgba[i]);
+ }
}
static void
sample_1d_linear_mipmap_nearest(GLcontext *ctx,
const struct gl_texture_object *tObj,
- GLfloat s, GLfloat lambda,
- GLchan rgba[4])
+ GLuint n, GLfloat texcoord[][4],
+ const GLfloat lambda[], GLchan rgba[][4])
{
- GLint level;
- COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda, level);
- sample_1d_linear(ctx, tObj, tObj->Image[level], s, rgba);
+ GLuint i;
+ ASSERT(lambda != NULL);
+ for (i = 0; i < n; i++) {
+ GLint level;
+ COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda[i], level);
+ sample_1d_linear(ctx, tObj, tObj->Image[level], texcoord[i], rgba[i]);
+ }
}
@@ -432,34 +591,37 @@ sample_1d_linear_mipmap_nearest(GLcontext *ctx,
* This is really just needed in order to prevent warnings with some compilers.
*/
#if CHAN_TYPE == GL_FLOAT
-#define INTCAST
+#define CHAN_CAST
#else
-#define INTCAST (GLint)
+#define CHAN_CAST (GLchan) (GLint)
#endif
static void
sample_1d_nearest_mipmap_linear(GLcontext *ctx,
const struct gl_texture_object *tObj,
- GLfloat s, GLfloat lambda,
- GLchan rgba[4])
+ GLuint n, GLfloat texcoord[][4],
+ const GLfloat lambda[], GLchan rgba[][4])
{
- GLint level;
-
- COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda, level);
-
- if (level >= tObj->_MaxLevel) {
- sample_1d_nearest(ctx, tObj, tObj->Image[tObj->_MaxLevel], s, rgba);
- }
- else {
- GLchan t0[4], t1[4];
- const GLfloat f = FRAC(lambda);
- sample_1d_nearest(ctx, tObj, tObj->Image[level ], s, t0);
- sample_1d_nearest(ctx, tObj, tObj->Image[level+1], s, t1);
- rgba[RCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
- rgba[GCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
- rgba[BCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
- rgba[ACOMP] = (GLchan) INTCAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]);
+ GLuint i;
+ ASSERT(lambda != NULL);
+ for (i = 0; i < n; i++) {
+ GLint level;
+ COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
+ if (level >= tObj->_MaxLevel) {
+ sample_1d_nearest(ctx, tObj, tObj->Image[tObj->_MaxLevel],
+ texcoord[i], rgba[i]);
+ }
+ else {
+ GLchan t0[4], t1[4];
+ const GLfloat f = FRAC(lambda[i]);
+ sample_1d_nearest(ctx, tObj, tObj->Image[level ], texcoord[i], t0);
+ sample_1d_nearest(ctx, tObj, tObj->Image[level+1], texcoord[i], t1);
+ rgba[i][RCOMP] = CHAN_CAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
+ rgba[i][GCOMP] = CHAN_CAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
+ rgba[i][BCOMP] = CHAN_CAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
+ rgba[i][ACOMP] = CHAN_CAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]);
+ }
}
}
@@ -468,25 +630,28 @@ sample_1d_nearest_mipmap_linear(GLcontext *ctx,
static void
sample_1d_linear_mipmap_linear(GLcontext *ctx,
const struct gl_texture_object *tObj,
- GLfloat s, GLfloat lambda,
- GLchan rgba[4])
+ GLuint n, GLfloat texcoord[][4],
+ const GLfloat lambda[], GLchan rgba[][4])
{
- GLint level;
-
- COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda, level);
-
- if (level >= tObj->_MaxLevel) {
- sample_1d_linear(ctx, tObj, tObj->Image[tObj->_MaxLevel], s, rgba);
- }
- else {
- GLchan t0[4], t1[4];
- const GLfloat f = FRAC(lambda);
- sample_1d_linear(ctx, tObj, tObj->Image[level ], s, t0);
- sample_1d_linear(ctx, tObj, tObj->Image[level+1], s, t1);
- rgba[RCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
- rgba[GCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
- rgba[BCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
- rgba[ACOMP] = (GLchan) INTCAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]);
+ GLuint i;
+ ASSERT(lambda != NULL);
+ for (i = 0; i < n; i++) {
+ GLint level;
+ COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
+ if (level >= tObj->_MaxLevel) {
+ sample_1d_linear(ctx, tObj, tObj->Image[tObj->_MaxLevel],
+ texcoord[i], rgba[i]);
+ }
+ else {
+ GLchan t0[4], t1[4];
+ const GLfloat f = FRAC(lambda[i]);
+ sample_1d_linear(ctx, tObj, tObj->Image[level ], texcoord[i], t0);
+ sample_1d_linear(ctx, tObj, tObj->Image[level+1], texcoord[i], t1);
+ rgba[i][RCOMP] = CHAN_CAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
+ rgba[i][GCOMP] = CHAN_CAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
+ rgba[i][BCOMP] = CHAN_CAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
+ rgba[i][ACOMP] = CHAN_CAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]);
+ }
}
}
@@ -495,17 +660,14 @@ sample_1d_linear_mipmap_linear(GLcontext *ctx,
static void
sample_nearest_1d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
+ GLfloat texcoords[][4], const GLfloat lambda[],
GLchan rgba[][4] )
{
GLuint i;
struct gl_texture_image *image = tObj->Image[tObj->BaseLevel];
- (void) t;
- (void) u;
(void) lambda;
for (i=0;i<n;i++) {
- sample_1d_nearest(ctx, tObj, image, s[i], rgba[i]);
+ sample_1d_nearest(ctx, tObj, image, texcoords[i], rgba[i]);
}
}
@@ -514,17 +676,14 @@ sample_nearest_1d( GLcontext *ctx, GLuint texUnit,
static void
sample_linear_1d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
+ GLfloat texcoords[][4], const GLfloat lambda[],
GLchan rgba[][4] )
{
GLuint i;
struct gl_texture_image *image = tObj->Image[tObj->BaseLevel];
- (void) t;
- (void) u;
(void) lambda;
for (i=0;i<n;i++) {
- sample_1d_linear(ctx, tObj, image, s[i], rgba[i]);
+ sample_1d_linear(ctx, tObj, image, texcoords[i], rgba[i]);
}
}
@@ -537,71 +696,74 @@ sample_linear_1d( GLcontext *ctx, GLuint texUnit,
static void
sample_lambda_1d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
- GLchan rgba[][4] )
+ GLfloat texcoords[][4],
+ const GLfloat lambda[], GLchan rgba[][4] )
{
- GLfloat MinMagThresh = SWRAST_CONTEXT(ctx)->_MinMagThresh[texUnit];
+ GLuint minStart, minEnd; /* texels with minification */
+ GLuint magStart, magEnd; /* texels with magnification */
GLuint i;
- (void) t;
- (void) u;
+ ASSERT(lambda != NULL);
+ compute_min_mag_ranges(SWRAST_CONTEXT(ctx)->_MinMagThresh[texUnit],
+ n, lambda, &minStart, &minEnd, &magStart, &magEnd);
- for (i=0;i<n;i++) {
- if (lambda[i] > MinMagThresh) {
- /* minification */
- switch (tObj->MinFilter) {
- case GL_NEAREST:
- sample_1d_nearest(ctx, tObj, tObj->Image[tObj->BaseLevel],
- s[i], rgba[i]);
- break;
- case GL_LINEAR:
- sample_1d_linear(ctx, tObj, tObj->Image[tObj->BaseLevel],
- s[i], rgba[i]);
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- sample_1d_nearest_mipmap_nearest(ctx, tObj, lambda[i], s[i],
- rgba[i]);
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- sample_1d_linear_mipmap_nearest(ctx, tObj, s[i], lambda[i],
- rgba[i]);
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- sample_1d_nearest_mipmap_linear(ctx, tObj, s[i], lambda[i],
- rgba[i]);
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- sample_1d_linear_mipmap_linear(ctx, tObj, s[i], lambda[i],
- rgba[i]);
- break;
- default:
- _mesa_problem(NULL, "Bad min filter in sample_1d_texture");
- return;
- }
+ if (minStart < minEnd) {
+ /* do the minified texels */
+ const GLuint m = minEnd - minStart;
+ switch (tObj->MinFilter) {
+ case GL_NEAREST:
+ for (i = minStart; i < minEnd; i++)
+ sample_1d_nearest(ctx, tObj, tObj->Image[tObj->BaseLevel],
+ texcoords[i], rgba[i]);
+ break;
+ case GL_LINEAR:
+ for (i = minStart; i < minEnd; i++)
+ sample_1d_linear(ctx, tObj, tObj->Image[tObj->BaseLevel],
+ texcoords[i], rgba[i]);
+ break;
+ case GL_NEAREST_MIPMAP_NEAREST:
+ sample_1d_nearest_mipmap_nearest(ctx, tObj, m, texcoords + minStart,
+ lambda + minStart, rgba + minStart);
+ break;
+ case GL_LINEAR_MIPMAP_NEAREST:
+ sample_1d_linear_mipmap_nearest(ctx, tObj, m, texcoords + minStart,
+ lambda + minStart, rgba + minStart);
+ break;
+ case GL_NEAREST_MIPMAP_LINEAR:
+ sample_1d_nearest_mipmap_linear(ctx, tObj, m, texcoords + minStart,
+ lambda + minStart, rgba + minStart);
+ break;
+ case GL_LINEAR_MIPMAP_LINEAR:
+ sample_1d_linear_mipmap_linear(ctx, tObj, m, texcoords + minStart,
+ lambda + minStart, rgba + minStart);
+ break;
+ default:
+ _mesa_problem(ctx, "Bad min filter in sample_1d_texture");
+ return;
}
- else {
- /* magnification */
- switch (tObj->MagFilter) {
- case GL_NEAREST:
- sample_1d_nearest(ctx, tObj, tObj->Image[tObj->BaseLevel],
- s[i], rgba[i]);
- break;
- case GL_LINEAR:
- sample_1d_linear(ctx, tObj, tObj->Image[tObj->BaseLevel],
- s[i], rgba[i]);
- break;
- default:
- _mesa_problem(NULL, "Bad mag filter in sample_1d_texture");
- return;
- }
+ }
+
+ if (magStart < magEnd) {
+ /* do the magnified texels */
+ switch (tObj->MagFilter) {
+ case GL_NEAREST:
+ for (i = magStart; i < magEnd; i++)
+ sample_1d_nearest(ctx, tObj, tObj->Image[tObj->BaseLevel],
+ texcoords[i], rgba[i]);
+ break;
+ case GL_LINEAR:
+ for (i = magStart; i < magEnd; i++)
+ sample_1d_linear(ctx, tObj, tObj->Image[tObj->BaseLevel],
+ texcoords[i], rgba[i]);
+ break;
+ default:
+ _mesa_problem(ctx, "Bad mag filter in sample_1d_texture");
+ return;
}
}
}
-
-
/**********************************************************************/
/* 2-D Texture Sampling Functions */
/**********************************************************************/
@@ -610,27 +772,27 @@ sample_lambda_1d( GLcontext *ctx, GLuint texUnit,
/*
* Return the texture sample for coordinate (s,t) using GL_NEAREST filter.
*/
-static void
+static INLINE void
sample_2d_nearest(GLcontext *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
- GLfloat s, GLfloat t,
+ const GLfloat texcoord[4],
GLchan rgba[])
{
const GLint width = img->Width2; /* without border, power of two */
const GLint height = img->Height2; /* without border, power of two */
GLint i, j;
- COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, s, width, i);
- COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapT, t, height, j);
+ COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, texcoord[0], width, i);
+ COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapT, texcoord[1], height, j);
/* skip over the border, if any */
i += img->Border;
j += img->Border;
if (i < 0 || i >= (GLint) img->Width || j < 0 || j >= (GLint) img->Height) {
- /* Need this test for GL_CLAMP_TO_BORDER_ARB mode */
- COPY_CHAN4(rgba, tObj->BorderColor);
+ /* Need this test for GL_CLAMP_TO_BORDER mode */
+ COPY_CHAN4(rgba, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i, j, 0, (GLvoid *) rgba);
@@ -646,11 +808,11 @@ sample_2d_nearest(GLcontext *ctx,
* Return the texture sample for coordinate (s,t) using GL_LINEAR filter.
* New sampling code contributed by Lynn Quam <quam@ai.sri.com>.
*/
-static void
+static INLINE void
sample_2d_linear(GLcontext *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
- GLfloat s, GLfloat t,
+ const GLfloat texcoord[4],
GLchan rgba[])
{
const GLint width = img->Width2;
@@ -659,8 +821,8 @@ sample_2d_linear(GLcontext *ctx,
GLuint useBorderColor;
GLfloat u, v;
- COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapS, s, u, width, i0, i1);
- COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapT, t, v, height, j0, j1);
+ COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapS, texcoord[0], u, width, i0, i1);
+ COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapT, texcoord[1], v, height, j0, j1);
useBorderColor = 0;
if (img->Border) {
@@ -698,7 +860,7 @@ sample_2d_linear(GLcontext *ctx,
GLchan t11[4];
if (useBorderColor & (I0BIT | J0BIT)) {
- COPY_CHAN4(t00, tObj->BorderColor);
+ COPY_CHAN4(t00, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i0, j0, 0, (GLvoid *) t00);
@@ -707,7 +869,7 @@ sample_2d_linear(GLcontext *ctx,
}
}
if (useBorderColor & (I1BIT | J0BIT)) {
- COPY_CHAN4(t10, tObj->BorderColor);
+ COPY_CHAN4(t10, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i1, j0, 0, (GLvoid *) t10);
@@ -716,7 +878,7 @@ sample_2d_linear(GLcontext *ctx,
}
}
if (useBorderColor & (I0BIT | J1BIT)) {
- COPY_CHAN4(t01, tObj->BorderColor);
+ COPY_CHAN4(t01, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i0, j1, 0, (GLvoid *) t01);
@@ -725,7 +887,7 @@ sample_2d_linear(GLcontext *ctx,
}
}
if (useBorderColor & (I1BIT | J1BIT)) {
- COPY_CHAN4(t11, tObj->BorderColor);
+ COPY_CHAN4(t11, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i1, j1, 0, (GLvoid *) t11);
@@ -763,16 +925,99 @@ sample_2d_linear(GLcontext *ctx,
}
+/*
+ * As above, but we know WRAP_S == REPEAT and WRAP_T == REPEAT
+ * and we're not using a paletted texture.
+ */
+static INLINE void
+sample_2d_linear_repeat(GLcontext *ctx,
+ const struct gl_texture_object *tObj,
+ const struct gl_texture_image *img,
+ const GLfloat texcoord[4],
+ GLchan rgba[])
+{
+ const GLint width = img->Width2;
+ const GLint height = img->Height2;
+ GLint i0, j0, i1, j1;
+ GLfloat u, v;
+
+ ASSERT(tObj->WrapS == GL_REPEAT);
+ ASSERT(tObj->WrapT == GL_REPEAT);
+ ASSERT(img->Border == 0);
+ ASSERT(img->Format != GL_COLOR_INDEX);
+
+ COMPUTE_LINEAR_REPEAT_TEXEL_LOCATION(texcoord[0], u, width, i0, i1);
+ COMPUTE_LINEAR_REPEAT_TEXEL_LOCATION(texcoord[1], v, height, j0, j1);
+
+ {
+ const GLfloat a = FRAC(u);
+ const GLfloat b = FRAC(v);
+
+#if CHAN_TYPE == GL_FLOAT || CHAN_TYPE == GL_UNSIGNED_SHORT
+ const GLfloat w00 = (1.0F-a) * (1.0F-b);
+ const GLfloat w10 = a * (1.0F-b);
+ const GLfloat w01 = (1.0F-a) * b ;
+ const GLfloat w11 = a * b ;
+#else /* CHAN_BITS == 8 */
+ /* compute sample weights in fixed point in [0,WEIGHT_SCALE] */
+ const GLint w00 = IROUND_POS((1.0F-a) * (1.0F-b) * WEIGHT_SCALE);
+ const GLint w10 = IROUND_POS( a * (1.0F-b) * WEIGHT_SCALE);
+ const GLint w01 = IROUND_POS((1.0F-a) * b * WEIGHT_SCALE);
+ const GLint w11 = IROUND_POS( a * b * WEIGHT_SCALE);
+#endif
+ GLchan t00[4];
+ GLchan t10[4];
+ GLchan t01[4];
+ GLchan t11[4];
+
+ (*img->FetchTexel)(img, i0, j0, 0, (GLvoid *) t00);
+ (*img->FetchTexel)(img, i1, j0, 0, (GLvoid *) t10);
+ (*img->FetchTexel)(img, i0, j1, 0, (GLvoid *) t01);
+ (*img->FetchTexel)(img, i1, j1, 0, (GLvoid *) t11);
+
+#if CHAN_TYPE == GL_FLOAT
+ rgba[0] = w00 * t00[0] + w10 * t10[0] + w01 * t01[0] + w11 * t11[0];
+ rgba[1] = w00 * t00[1] + w10 * t10[1] + w01 * t01[1] + w11 * t11[1];
+ rgba[2] = w00 * t00[2] + w10 * t10[2] + w01 * t01[2] + w11 * t11[2];
+ rgba[3] = w00 * t00[3] + w10 * t10[3] + w01 * t01[3] + w11 * t11[3];
+#elif CHAN_TYPE == GL_UNSIGNED_SHORT
+ rgba[0] = (GLchan) (w00 * t00[0] + w10 * t10[0] +
+ w01 * t01[0] + w11 * t11[0] + 0.5);
+ rgba[1] = (GLchan) (w00 * t00[1] + w10 * t10[1] +
+ w01 * t01[1] + w11 * t11[1] + 0.5);
+ rgba[2] = (GLchan) (w00 * t00[2] + w10 * t10[2] +
+ w01 * t01[2] + w11 * t11[2] + 0.5);
+ rgba[3] = (GLchan) (w00 * t00[3] + w10 * t10[3] +
+ w01 * t01[3] + w11 * t11[3] + 0.5);
+#else /* CHAN_BITS == 8 */
+ rgba[0] = (GLchan) ((w00 * t00[0] + w10 * t10[0] +
+ w01 * t01[0] + w11 * t11[0]) >> WEIGHT_SHIFT);
+ rgba[1] = (GLchan) ((w00 * t00[1] + w10 * t10[1] +
+ w01 * t01[1] + w11 * t11[1]) >> WEIGHT_SHIFT);
+ rgba[2] = (GLchan) ((w00 * t00[2] + w10 * t10[2] +
+ w01 * t01[2] + w11 * t11[2]) >> WEIGHT_SHIFT);
+ rgba[3] = (GLchan) ((w00 * t00[3] + w10 * t10[3] +
+ w01 * t01[3] + w11 * t11[3]) >> WEIGHT_SHIFT);
+#endif
+
+ }
+
+}
+
+
static void
sample_2d_nearest_mipmap_nearest(GLcontext *ctx,
const struct gl_texture_object *tObj,
- GLfloat s, GLfloat t, GLfloat lambda,
- GLchan rgba[4])
+ GLuint n, GLfloat texcoord[][4],
+ const GLfloat lambda[], GLchan rgba[][4])
{
- GLint level;
- COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda, level);
- sample_2d_nearest(ctx, tObj, tObj->Image[level], s, t, rgba);
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ GLint level;
+ COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda[i], level);
+ sample_2d_nearest(ctx, tObj, tObj->Image[level], texcoord[i], rgba[i]);
+ }
}
@@ -780,12 +1025,16 @@ sample_2d_nearest_mipmap_nearest(GLcontext *ctx,
static void
sample_2d_linear_mipmap_nearest(GLcontext *ctx,
const struct gl_texture_object *tObj,
- GLfloat s, GLfloat t, GLfloat lambda,
- GLchan rgba[4])
+ GLuint n, GLfloat texcoord[][4],
+ const GLfloat lambda[], GLchan rgba[][4])
{
- GLint level;
- COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda, level);
- sample_2d_linear(ctx, tObj, tObj->Image[level], s, t, rgba);
+ GLuint i;
+ ASSERT(lambda != NULL);
+ for (i = 0; i < n; i++) {
+ GLint level;
+ COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda[i], level);
+ sample_2d_linear(ctx, tObj, tObj->Image[level], texcoord[i], rgba[i]);
+ }
}
@@ -793,70 +1042,105 @@ sample_2d_linear_mipmap_nearest(GLcontext *ctx,
static void
sample_2d_nearest_mipmap_linear(GLcontext *ctx,
const struct gl_texture_object *tObj,
- GLfloat s, GLfloat t, GLfloat lambda,
- GLchan rgba[4])
+ GLuint n, GLfloat texcoord[][4],
+ const GLfloat lambda[], GLchan rgba[][4])
{
- GLint level;
-
- COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda, level);
-
- if (level >= tObj->_MaxLevel) {
- sample_2d_nearest(ctx, tObj, tObj->Image[tObj->_MaxLevel], s, t, rgba);
- }
- else {
- GLchan t0[4], t1[4]; /* texels */
- const GLfloat f = FRAC(lambda);
- sample_2d_nearest(ctx, tObj, tObj->Image[level ], s, t, t0);
- sample_2d_nearest(ctx, tObj, tObj->Image[level+1], s, t, t1);
- rgba[RCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
- rgba[GCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
- rgba[BCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
- rgba[ACOMP] = (GLchan) INTCAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]);
+ GLuint i;
+ ASSERT(lambda != NULL);
+ for (i = 0; i < n; i++) {
+ GLint level;
+ COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
+ if (level >= tObj->_MaxLevel) {
+ sample_2d_nearest(ctx, tObj, tObj->Image[tObj->_MaxLevel],
+ texcoord[i], rgba[i]);
+ }
+ else {
+ GLchan t0[4], t1[4]; /* texels */
+ const GLfloat f = FRAC(lambda[i]);
+ sample_2d_nearest(ctx, tObj, tObj->Image[level ], texcoord[i], t0);
+ sample_2d_nearest(ctx, tObj, tObj->Image[level+1], texcoord[i], t1);
+ rgba[i][RCOMP] = CHAN_CAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
+ rgba[i][GCOMP] = CHAN_CAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
+ rgba[i][BCOMP] = CHAN_CAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
+ rgba[i][ACOMP] = CHAN_CAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]);
+ }
}
}
+/* Trilinear filtering */
static void
-sample_2d_linear_mipmap_linear(GLcontext *ctx,
- const struct gl_texture_object *tObj,
- GLfloat s, GLfloat t, GLfloat lambda,
- GLchan rgba[4])
+sample_2d_linear_mipmap_linear( GLcontext *ctx,
+ const struct gl_texture_object *tObj,
+ GLuint n, GLfloat texcoord[][4],
+ const GLfloat lambda[], GLchan rgba[][4] )
{
- GLint level;
+ GLuint i;
+ ASSERT(lambda != NULL);
+ for (i = 0; i < n; i++) {
+ GLint level;
+ COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
+ if (level >= tObj->_MaxLevel) {
+ sample_2d_linear(ctx, tObj, tObj->Image[tObj->_MaxLevel],
+ texcoord[i], rgba[i]);
+ }
+ else {
+ GLchan t0[4], t1[4]; /* texels */
+ const GLfloat f = FRAC(lambda[i]);
+ sample_2d_linear(ctx, tObj, tObj->Image[level ], texcoord[i], t0);
+ sample_2d_linear(ctx, tObj, tObj->Image[level+1], texcoord[i], t1);
+ rgba[i][RCOMP] = CHAN_CAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
+ rgba[i][GCOMP] = CHAN_CAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
+ rgba[i][BCOMP] = CHAN_CAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
+ rgba[i][ACOMP] = CHAN_CAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]);
+ }
+ }
+}
- COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda, level);
- if (level >= tObj->_MaxLevel) {
- sample_2d_linear(ctx, tObj, tObj->Image[tObj->_MaxLevel], s, t, rgba);
- }
- else {
- GLchan t0[4], t1[4]; /* texels */
- const GLfloat f = FRAC(lambda);
- sample_2d_linear(ctx, tObj, tObj->Image[level ], s, t, t0);
- sample_2d_linear(ctx, tObj, tObj->Image[level+1], s, t, t1);
- rgba[RCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
- rgba[GCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
- rgba[BCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
- rgba[ACOMP] = (GLchan) INTCAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]);
+static void
+sample_2d_linear_mipmap_linear_repeat( GLcontext *ctx,
+ const struct gl_texture_object *tObj,
+ GLuint n, GLfloat texcoord[][4],
+ const GLfloat lambda[], GLchan rgba[][4] )
+{
+ GLuint i;
+ ASSERT(lambda != NULL);
+ ASSERT(tObj->WrapS == GL_REPEAT);
+ ASSERT(tObj->WrapT == GL_REPEAT);
+ for (i = 0; i < n; i++) {
+ GLint level;
+ COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
+ if (level >= tObj->_MaxLevel) {
+ sample_2d_linear_repeat(ctx, tObj, tObj->Image[tObj->_MaxLevel],
+ texcoord[i], rgba[i]);
+ }
+ else {
+ GLchan t0[4], t1[4]; /* texels */
+ const GLfloat f = FRAC(lambda[i]);
+ sample_2d_linear_repeat(ctx, tObj, tObj->Image[level ], texcoord[i], t0);
+ sample_2d_linear_repeat(ctx, tObj, tObj->Image[level+1], texcoord[i], t1);
+ rgba[i][RCOMP] = CHAN_CAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
+ rgba[i][GCOMP] = CHAN_CAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
+ rgba[i][BCOMP] = CHAN_CAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
+ rgba[i][ACOMP] = CHAN_CAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]);
+ }
}
}
-
static void
sample_nearest_2d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
- GLchan rgba[][4] )
+ GLfloat texcoords[][4],
+ const GLfloat lambda[], GLchan rgba[][4] )
{
GLuint i;
struct gl_texture_image *image = tObj->Image[tObj->BaseLevel];
- (void) u;
(void) lambda;
for (i=0;i<n;i++) {
- sample_2d_nearest(ctx, tObj, image, s[i], t[i], rgba[i]);
+ sample_2d_nearest(ctx, tObj, image, texcoords[i], rgba[i]);
}
}
@@ -865,16 +1149,14 @@ sample_nearest_2d( GLcontext *ctx, GLuint texUnit,
static void
sample_linear_2d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
- GLchan rgba[][4] )
+ GLfloat texcoords[][4],
+ const GLfloat lambda[], GLchan rgba[][4] )
{
GLuint i;
struct gl_texture_image *image = tObj->Image[tObj->BaseLevel];
- (void) u;
(void) lambda;
for (i=0;i<n;i++) {
- sample_2d_linear(ctx, tObj, image, s[i], t[i], rgba[i]);
+ sample_2d_linear(ctx, tObj, image, texcoords[i], rgba[i]);
}
}
@@ -883,15 +1165,15 @@ sample_linear_2d( GLcontext *ctx, GLuint texUnit,
* Optimized 2-D texture sampling:
* S and T wrap mode == GL_REPEAT
* GL_NEAREST min/mag filter
- * No border
+ * No border,
+ * RowStride == Width,
* Format = GL_RGB
*/
static void
opt_sample_rgb_2d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj,
- GLuint n, const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
- GLchan rgba[][4] )
+ GLuint n, GLfloat texcoords[][4],
+ const GLfloat lambda[], GLchan rgba[][4] )
{
const struct gl_texture_image *img = tObj->Image[tObj->BaseLevel];
const GLfloat width = (GLfloat) img->Width;
@@ -900,7 +1182,6 @@ opt_sample_rgb_2d( GLcontext *ctx, GLuint texUnit,
const GLint rowMask = img->Height - 1;
const GLint shift = img->WidthLog2;
GLuint k;
- (void) u;
(void) lambda;
ASSERT(tObj->WrapS==GL_REPEAT);
ASSERT(tObj->WrapT==GL_REPEAT);
@@ -908,8 +1189,8 @@ opt_sample_rgb_2d( GLcontext *ctx, GLuint texUnit,
ASSERT(img->Format==GL_RGB);
for (k=0; k<n; k++) {
- GLint i = IFLOOR(s[k] * width) & colMask;
- GLint j = IFLOOR(t[k] * height) & rowMask;
+ GLint i = IFLOOR(texcoords[k][0] * width) & colMask;
+ GLint j = IFLOOR(texcoords[k][1] * height) & rowMask;
GLint pos = (j << shift) | i;
GLchan *texel = ((GLchan *) img->Data) + 3*pos;
rgba[k][RCOMP] = texel[0];
@@ -924,14 +1205,14 @@ opt_sample_rgb_2d( GLcontext *ctx, GLuint texUnit,
* S and T wrap mode == GL_REPEAT
* GL_NEAREST min/mag filter
* No border
+ * RowStride == Width,
* Format = GL_RGBA
*/
static void
opt_sample_rgba_2d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj,
- GLuint n, const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
- GLchan rgba[][4] )
+ GLuint n, GLfloat texcoords[][4],
+ const GLfloat lambda[], GLchan rgba[][4] )
{
const struct gl_texture_image *img = tObj->Image[tObj->BaseLevel];
const GLfloat width = (GLfloat) img->Width;
@@ -940,7 +1221,6 @@ opt_sample_rgba_2d( GLcontext *ctx, GLuint texUnit,
const GLint rowMask = img->Height - 1;
const GLint shift = img->WidthLog2;
GLuint i;
- (void) u;
(void) lambda;
ASSERT(tObj->WrapS==GL_REPEAT);
ASSERT(tObj->WrapT==GL_REPEAT);
@@ -948,8 +1228,8 @@ opt_sample_rgba_2d( GLcontext *ctx, GLuint texUnit,
ASSERT(img->Format==GL_RGBA);
for (i = 0; i < n; i++) {
- const GLint col = IFLOOR(s[i] * width) & colMask;
- const GLint row = IFLOOR(t[i] * height) & rowMask;
+ const GLint col = IFLOOR(texcoords[i][0] * width) & colMask;
+ const GLint row = IFLOOR(texcoords[i][1] * height) & rowMask;
const GLint pos = (row << shift) | col;
const GLchan *texel = ((GLchan *) img->Data) + (pos << 2); /* pos*4 */
COPY_CHAN4(rgba[i], texel);
@@ -958,105 +1238,115 @@ opt_sample_rgba_2d( GLcontext *ctx, GLuint texUnit,
/*
- * Given an array of (s,t) texture coordinate and lambda (level of detail)
+ * Given an array of texture coordinate and lambda (level of detail)
* values, return an array of texture sample.
*/
static void
sample_lambda_2d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj,
- GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
- GLchan rgba[][4] )
+ GLuint n, GLfloat texcoords[][4],
+ const GLfloat lambda[], GLchan rgba[][4] )
{
- const GLfloat minMagThresh = SWRAST_CONTEXT(ctx)->_MinMagThresh[texUnit];
- GLuint i;
- (void) u;
-
- /* since lambda is monotonous-array use this check first */
- if (lambda[0] <= minMagThresh && lambda[n-1] <= minMagThresh) {
- /* magnification for whole span */
- const struct gl_texture_image *img = tObj->Image[tObj->BaseLevel];
- switch (tObj->MagFilter) {
+ const struct gl_texture_image *tImg = tObj->Image[tObj->BaseLevel];
+ GLuint minStart, minEnd; /* texels with minification */
+ GLuint magStart, magEnd; /* texels with magnification */
+
+ const GLboolean repeatNoBorder = (tObj->WrapS == GL_REPEAT)
+ && (tObj->WrapT == GL_REPEAT)
+ && (tImg->Border == 0 && (tImg->Width == tImg->RowStride))
+ && (tImg->Format != GL_COLOR_INDEX);
+
+ ASSERT(lambda != NULL);
+ compute_min_mag_ranges(SWRAST_CONTEXT(ctx)->_MinMagThresh[texUnit],
+ n, lambda, &minStart, &minEnd, &magStart, &magEnd);
+
+ if (minStart < minEnd) {
+ /* do the minified texels */
+ const GLuint m = minEnd - minStart;
+ switch (tObj->MinFilter) {
case GL_NEAREST:
- if (tObj->WrapS == GL_REPEAT && tObj->WrapT == GL_REPEAT &&
- img->Border == 0) {
- switch (img->Format) {
+ if (repeatNoBorder) {
+ switch (tImg->Format) {
case GL_RGB:
- opt_sample_rgb_2d(ctx, texUnit, tObj, n, s, t, NULL,
- NULL, rgba);
+ opt_sample_rgb_2d(ctx, texUnit, tObj, m, texcoords + minStart,
+ NULL, rgba + minStart);
break;
case GL_RGBA:
- opt_sample_rgba_2d(ctx, texUnit, tObj, n, s, t, NULL,
- NULL, rgba);
+ opt_sample_rgba_2d(ctx, texUnit, tObj, m, texcoords + minStart,
+ NULL, rgba + minStart);
break;
default:
- sample_nearest_2d(ctx, texUnit, tObj, n, s, t, NULL,
- NULL, rgba);
+ sample_nearest_2d(ctx, texUnit, tObj, m, texcoords + minStart,
+ NULL, rgba + minStart );
}
}
else {
- sample_nearest_2d(ctx, texUnit, tObj, n, s, t, NULL,
- NULL, rgba);
+ sample_nearest_2d(ctx, texUnit, tObj, m, texcoords + minStart,
+ NULL, rgba + minStart);
}
break;
case GL_LINEAR:
- sample_linear_2d(ctx, texUnit, tObj, n, s, t, NULL,
- NULL, rgba);
+ sample_linear_2d(ctx, texUnit, tObj, m, texcoords + minStart,
+ NULL, rgba + minStart);
+ break;
+ case GL_NEAREST_MIPMAP_NEAREST:
+ sample_2d_nearest_mipmap_nearest(ctx, tObj, m, texcoords + minStart,
+ lambda + minStart, rgba + minStart);
+ break;
+ case GL_LINEAR_MIPMAP_NEAREST:
+ sample_2d_linear_mipmap_nearest(ctx, tObj, m, texcoords + minStart,
+ lambda + minStart, rgba + minStart);
+ break;
+ case GL_NEAREST_MIPMAP_LINEAR:
+ sample_2d_nearest_mipmap_linear(ctx, tObj, m, texcoords + minStart,
+ lambda + minStart, rgba + minStart);
+ break;
+ case GL_LINEAR_MIPMAP_LINEAR:
+ if (repeatNoBorder)
+ sample_2d_linear_mipmap_linear_repeat(ctx, tObj, m,
+ texcoords + minStart, lambda + minStart, rgba + minStart);
+ else
+ sample_2d_linear_mipmap_linear(ctx, tObj, m, texcoords + minStart,
+ lambda + minStart, rgba + minStart);
break;
default:
- _mesa_problem(NULL, "Bad mag filter in sample_lambda_2d");
+ _mesa_problem(ctx, "Bad min filter in sample_2d_texture");
+ return;
}
}
- else {
- for (i = 0; i < n; i++) {
- if (lambda[i] > minMagThresh) {
- /* minification */
- switch (tObj->MinFilter) {
- case GL_NEAREST:
- sample_2d_nearest(ctx, tObj, tObj->Image[tObj->BaseLevel],
- s[i], t[i], rgba[i]);
- break;
- case GL_LINEAR:
- sample_2d_linear(ctx, tObj, tObj->Image[tObj->BaseLevel],
- s[i], t[i], rgba[i]);
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- sample_2d_nearest_mipmap_nearest(ctx, tObj, s[i], t[i],
- lambda[i], rgba[i]);
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- sample_2d_linear_mipmap_nearest(ctx,tObj, s[i], t[i],
- lambda[i], rgba[i]);
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- sample_2d_nearest_mipmap_linear(ctx,tObj, s[i], t[i],
- lambda[i], rgba[i]);
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- sample_2d_linear_mipmap_linear(ctx,tObj, s[i], t[i],
- lambda[i], rgba[i] );
- break;
- default:
- _mesa_problem(NULL, "Bad min filter in sample_2d_texture");
- return;
+
+ if (magStart < magEnd) {
+ /* do the magnified texels */
+ const GLuint m = magEnd - magStart;
+
+ switch (tObj->MagFilter) {
+ case GL_NEAREST:
+ if (repeatNoBorder) {
+ switch (tImg->Format) {
+ case GL_RGB:
+ opt_sample_rgb_2d(ctx, texUnit, tObj, m, texcoords + magStart,
+ NULL, rgba + magStart);
+ break;
+ case GL_RGBA:
+ opt_sample_rgba_2d(ctx, texUnit, tObj, m, texcoords + magStart,
+ NULL, rgba + magStart);
+ break;
+ default:
+ sample_nearest_2d(ctx, texUnit, tObj, m, texcoords + magStart,
+ NULL, rgba + magStart );
}
}
else {
- /* magnification */
- switch (tObj->MagFilter) {
- case GL_NEAREST:
- sample_2d_nearest(ctx, tObj, tObj->Image[tObj->BaseLevel],
- s[i], t[i], rgba[i]);
- break;
- case GL_LINEAR:
- sample_2d_linear(ctx, tObj, tObj->Image[tObj->BaseLevel],
- s[i], t[i], rgba[i] );
- break;
- default:
- _mesa_problem(NULL, "Bad mag filter in sample_2d_texture");
- }
+ sample_nearest_2d(ctx, texUnit, tObj, m, texcoords + magStart,
+ NULL, rgba + magStart);
}
+ break;
+ case GL_LINEAR:
+ sample_linear_2d(ctx, texUnit, tObj, m, texcoords + magStart,
+ NULL, rgba + magStart);
+ break;
+ default:
+ _mesa_problem(ctx, "Bad mag filter in sample_lambda_2d");
}
}
}
@@ -1074,7 +1364,7 @@ static void
sample_3d_nearest(GLcontext *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
- GLfloat s, GLfloat t, GLfloat r,
+ const GLfloat texcoord[4],
GLchan rgba[4])
{
const GLint width = img->Width2; /* without border, power of two */
@@ -1082,15 +1372,15 @@ sample_3d_nearest(GLcontext *ctx,
const GLint depth = img->Depth2; /* without border, power of two */
GLint i, j, k;
- COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, s, width, i);
- COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapT, t, height, j);
- COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapR, r, depth, k);
+ COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, texcoord[0], width, i);
+ COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapT, texcoord[1], height, j);
+ COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapR, texcoord[2], depth, k);
if (i < 0 || i >= (GLint) img->Width ||
j < 0 || j >= (GLint) img->Height ||
k < 0 || k >= (GLint) img->Depth) {
- /* Need this test for GL_CLAMP_TO_BORDER_ARB mode */
- COPY_CHAN4(rgba, tObj->BorderColor);
+ /* Need this test for GL_CLAMP_TO_BORDER mode */
+ COPY_CHAN4(rgba, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i, j, k, (GLvoid *) rgba);
@@ -1109,7 +1399,7 @@ static void
sample_3d_linear(GLcontext *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
- GLfloat s, GLfloat t, GLfloat r,
+ const GLfloat texcoord[4],
GLchan rgba[4])
{
const GLint width = img->Width2;
@@ -1119,9 +1409,9 @@ sample_3d_linear(GLcontext *ctx,
GLuint useBorderColor;
GLfloat u, v, w;
- COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapS, s, u, width, i0, i1);
- COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapT, t, v, height, j0, j1);
- COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapR, r, w, depth, k0, k1);
+ COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapS, texcoord[0], u, width, i0, i1);
+ COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapT, texcoord[1], v, height, j0, j1);
+ COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapR, texcoord[2], w, depth, k0, k1);
useBorderColor = 0;
if (img->Border) {
@@ -1173,7 +1463,7 @@ sample_3d_linear(GLcontext *ctx,
GLchan t100[4], t110[4], t101[4], t111[4];
if (useBorderColor & (I0BIT | J0BIT | K0BIT)) {
- COPY_CHAN4(t000, tObj->BorderColor);
+ COPY_CHAN4(t000, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i0, j0, k0, (GLvoid *) t000);
@@ -1182,7 +1472,7 @@ sample_3d_linear(GLcontext *ctx,
}
}
if (useBorderColor & (I1BIT | J0BIT | K0BIT)) {
- COPY_CHAN4(t100, tObj->BorderColor);
+ COPY_CHAN4(t100, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i1, j0, k0, (GLvoid *) t100);
@@ -1191,7 +1481,7 @@ sample_3d_linear(GLcontext *ctx,
}
}
if (useBorderColor & (I0BIT | J1BIT | K0BIT)) {
- COPY_CHAN4(t010, tObj->BorderColor);
+ COPY_CHAN4(t010, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i0, j1, k0, (GLvoid *) t010);
@@ -1200,7 +1490,7 @@ sample_3d_linear(GLcontext *ctx,
}
}
if (useBorderColor & (I1BIT | J1BIT | K0BIT)) {
- COPY_CHAN4(t110, tObj->BorderColor);
+ COPY_CHAN4(t110, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i1, j1, k0, (GLvoid *) t110);
@@ -1210,7 +1500,7 @@ sample_3d_linear(GLcontext *ctx,
}
if (useBorderColor & (I0BIT | J0BIT | K1BIT)) {
- COPY_CHAN4(t001, tObj->BorderColor);
+ COPY_CHAN4(t001, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i0, j0, k1, (GLvoid *) t001);
@@ -1219,7 +1509,7 @@ sample_3d_linear(GLcontext *ctx,
}
}
if (useBorderColor & (I1BIT | J0BIT | K1BIT)) {
- COPY_CHAN4(t101, tObj->BorderColor);
+ COPY_CHAN4(t101, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i1, j0, k1, (GLvoid *) t101);
@@ -1228,7 +1518,7 @@ sample_3d_linear(GLcontext *ctx,
}
}
if (useBorderColor & (I0BIT | J1BIT | K1BIT)) {
- COPY_CHAN4(t011, tObj->BorderColor);
+ COPY_CHAN4(t011, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i0, j1, k1, (GLvoid *) t011);
@@ -1237,7 +1527,7 @@ sample_3d_linear(GLcontext *ctx,
}
}
if (useBorderColor & (I1BIT | J1BIT | K1BIT)) {
- COPY_CHAN4(t111, tObj->BorderColor);
+ COPY_CHAN4(t111, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i1, j1, k1, (GLvoid *) t111);
@@ -1299,50 +1589,59 @@ sample_3d_linear(GLcontext *ctx,
static void
sample_3d_nearest_mipmap_nearest(GLcontext *ctx,
const struct gl_texture_object *tObj,
- GLfloat s, GLfloat t, GLfloat r,
- GLfloat lambda, GLchan rgba[4] )
+ GLuint n, GLfloat texcoord[][4],
+ const GLfloat lambda[], GLchan rgba[][4] )
{
- GLint level;
- COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda, level);
- sample_3d_nearest(ctx, tObj, tObj->Image[level], s, t, r, rgba);
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ GLint level;
+ COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda[i], level);
+ sample_3d_nearest(ctx, tObj, tObj->Image[level], texcoord[i], rgba[i]);
+ }
}
static void
sample_3d_linear_mipmap_nearest(GLcontext *ctx,
const struct gl_texture_object *tObj,
- GLfloat s, GLfloat t, GLfloat r,
- GLfloat lambda, GLchan rgba[4])
+ GLuint n, GLfloat texcoord[][4],
+ const GLfloat lambda[], GLchan rgba[][4])
{
- GLint level;
- COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda, level);
- sample_3d_linear(ctx, tObj, tObj->Image[level], s, t, r, rgba);
+ GLuint i;
+ ASSERT(lambda != NULL);
+ for (i = 0; i < n; i++) {
+ GLint level;
+ COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda[i], level);
+ sample_3d_linear(ctx, tObj, tObj->Image[level], texcoord[i], rgba[i]);
+ }
}
static void
sample_3d_nearest_mipmap_linear(GLcontext *ctx,
const struct gl_texture_object *tObj,
- GLfloat s, GLfloat t, GLfloat r,
- GLfloat lambda, GLchan rgba[4])
+ GLuint n, GLfloat texcoord[][4],
+ const GLfloat lambda[], GLchan rgba[][4])
{
- GLint level;
-
- COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda, level);
-
- if (level >= tObj->_MaxLevel) {
- sample_3d_nearest(ctx, tObj, tObj->Image[tObj->_MaxLevel],
- s, t, r, rgba);
- }
- else {
- GLchan t0[4], t1[4]; /* texels */
- const GLfloat f = FRAC(lambda);
- sample_3d_nearest(ctx, tObj, tObj->Image[level ], s, t, r, t0);
- sample_3d_nearest(ctx, tObj, tObj->Image[level+1], s, t, r, t1);
- rgba[RCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
- rgba[GCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
- rgba[BCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
- rgba[ACOMP] = (GLchan) INTCAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]);
+ GLuint i;
+ ASSERT(lambda != NULL);
+ for (i = 0; i < n; i++) {
+ GLint level;
+ COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
+ if (level >= tObj->_MaxLevel) {
+ sample_3d_nearest(ctx, tObj, tObj->Image[tObj->_MaxLevel],
+ texcoord[i], rgba[i]);
+ }
+ else {
+ GLchan t0[4], t1[4]; /* texels */
+ const GLfloat f = FRAC(lambda[i]);
+ sample_3d_nearest(ctx, tObj, tObj->Image[level ], texcoord[i], t0);
+ sample_3d_nearest(ctx, tObj, tObj->Image[level+1], texcoord[i], t1);
+ rgba[i][RCOMP] = CHAN_CAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
+ rgba[i][GCOMP] = CHAN_CAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
+ rgba[i][BCOMP] = CHAN_CAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
+ rgba[i][ACOMP] = CHAN_CAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]);
+ }
}
}
@@ -1350,25 +1649,28 @@ sample_3d_nearest_mipmap_linear(GLcontext *ctx,
static void
sample_3d_linear_mipmap_linear(GLcontext *ctx,
const struct gl_texture_object *tObj,
- GLfloat s, GLfloat t, GLfloat r,
- GLfloat lambda, GLchan rgba[4] )
+ GLuint n, GLfloat texcoord[][4],
+ const GLfloat lambda[], GLchan rgba[][4])
{
- GLint level;
-
- COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda, level);
-
- if (level >= tObj->_MaxLevel) {
- sample_3d_linear(ctx, tObj, tObj->Image[tObj->_MaxLevel], s, t, r, rgba);
- }
- else {
- GLchan t0[4], t1[4]; /* texels */
- const GLfloat f = FRAC(lambda);
- sample_3d_linear(ctx, tObj, tObj->Image[level ], s, t, r, t0);
- sample_3d_linear(ctx, tObj, tObj->Image[level+1], s, t, r, t1);
- rgba[RCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
- rgba[GCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
- rgba[BCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
- rgba[ACOMP] = (GLchan) INTCAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]);
+ GLuint i;
+ ASSERT(lambda != NULL);
+ for (i = 0; i < n; i++) {
+ GLint level;
+ COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
+ if (level >= tObj->_MaxLevel) {
+ sample_3d_linear(ctx, tObj, tObj->Image[tObj->_MaxLevel],
+ texcoord[i], rgba[i]);
+ }
+ else {
+ GLchan t0[4], t1[4]; /* texels */
+ const GLfloat f = FRAC(lambda[i]);
+ sample_3d_linear(ctx, tObj, tObj->Image[level ], texcoord[i], t0);
+ sample_3d_linear(ctx, tObj, tObj->Image[level+1], texcoord[i], t1);
+ rgba[i][RCOMP] = CHAN_CAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
+ rgba[i][GCOMP] = CHAN_CAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
+ rgba[i][BCOMP] = CHAN_CAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
+ rgba[i][ACOMP] = CHAN_CAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]);
+ }
}
}
@@ -1376,15 +1678,14 @@ sample_3d_linear_mipmap_linear(GLcontext *ctx,
static void
sample_nearest_3d(GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
+ GLfloat texcoords[][4], const GLfloat lambda[],
GLchan rgba[][4])
{
GLuint i;
struct gl_texture_image *image = tObj->Image[tObj->BaseLevel];
(void) lambda;
for (i=0;i<n;i++) {
- sample_3d_nearest(ctx, tObj, image, s[i], t[i], u[i], rgba[i]);
+ sample_3d_nearest(ctx, tObj, image, texcoords[i], rgba[i]);
}
}
@@ -1393,15 +1694,14 @@ sample_nearest_3d(GLcontext *ctx, GLuint texUnit,
static void
sample_linear_3d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
- GLchan rgba[][4] )
+ GLfloat texcoords[][4],
+ const GLfloat lambda[], GLchan rgba[][4] )
{
GLuint i;
struct gl_texture_image *image = tObj->Image[tObj->BaseLevel];
(void) lambda;
for (i=0;i<n;i++) {
- sample_3d_linear(ctx, tObj, image, s[i], t[i], u[i], rgba[i]);
+ sample_3d_linear(ctx, tObj, image, texcoords[i], rgba[i]);
}
}
@@ -1413,60 +1713,69 @@ sample_linear_3d( GLcontext *ctx, GLuint texUnit,
static void
sample_lambda_3d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
+ GLfloat texcoords[][4], const GLfloat lambda[],
GLchan rgba[][4] )
{
+ GLuint minStart, minEnd; /* texels with minification */
+ GLuint magStart, magEnd; /* texels with magnification */
GLuint i;
- GLfloat MinMagThresh = SWRAST_CONTEXT(ctx)->_MinMagThresh[texUnit];
- for (i=0;i<n;i++) {
+ ASSERT(lambda != NULL);
+ compute_min_mag_ranges(SWRAST_CONTEXT(ctx)->_MinMagThresh[texUnit],
+ n, lambda, &minStart, &minEnd, &magStart, &magEnd);
- if (lambda[i] > MinMagThresh) {
- /* minification */
- switch (tObj->MinFilter) {
- case GL_NEAREST:
- sample_3d_nearest(ctx, tObj, tObj->Image[tObj->BaseLevel],
- s[i], t[i], u[i], rgba[i]);
- break;
- case GL_LINEAR:
- sample_3d_linear(ctx, tObj, tObj->Image[tObj->BaseLevel],
- s[i], t[i], u[i], rgba[i]);
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- sample_3d_nearest_mipmap_nearest(ctx, tObj, s[i], t[i], u[i],
- lambda[i], rgba[i]);
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- sample_3d_linear_mipmap_nearest(ctx, tObj, s[i], t[i], u[i],
- lambda[i], rgba[i]);
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- sample_3d_nearest_mipmap_linear(ctx, tObj, s[i], t[i], u[i],
- lambda[i], rgba[i]);
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- sample_3d_linear_mipmap_linear(ctx, tObj, s[i], t[i], u[i],
- lambda[i], rgba[i]);
- break;
- default:
- _mesa_problem(NULL, "Bad min filterin sample_3d_texture");
- }
+ if (minStart < minEnd) {
+ /* do the minified texels */
+ GLuint m = minEnd - minStart;
+ switch (tObj->MinFilter) {
+ case GL_NEAREST:
+ for (i = minStart; i < minEnd; i++)
+ sample_3d_nearest(ctx, tObj, tObj->Image[tObj->BaseLevel],
+ texcoords[i], rgba[i]);
+ break;
+ case GL_LINEAR:
+ for (i = minStart; i < minEnd; i++)
+ sample_3d_linear(ctx, tObj, tObj->Image[tObj->BaseLevel],
+ texcoords[i], rgba[i]);
+ break;
+ case GL_NEAREST_MIPMAP_NEAREST:
+ sample_3d_nearest_mipmap_nearest(ctx, tObj, m, texcoords + minStart,
+ lambda + minStart, rgba + minStart);
+ break;
+ case GL_LINEAR_MIPMAP_NEAREST:
+ sample_3d_linear_mipmap_nearest(ctx, tObj, m, texcoords + minStart,
+ lambda + minStart, rgba + minStart);
+ break;
+ case GL_NEAREST_MIPMAP_LINEAR:
+ sample_3d_nearest_mipmap_linear(ctx, tObj, m, texcoords + minStart,
+ lambda + minStart, rgba + minStart);
+ break;
+ case GL_LINEAR_MIPMAP_LINEAR:
+ sample_3d_linear_mipmap_linear(ctx, tObj, m, texcoords + minStart,
+ lambda + minStart, rgba + minStart);
+ break;
+ default:
+ _mesa_problem(ctx, "Bad min filter in sample_3d_texture");
+ return;
}
- else {
- /* magnification */
- switch (tObj->MagFilter) {
- case GL_NEAREST:
- sample_3d_nearest(ctx, tObj, tObj->Image[tObj->BaseLevel],
- s[i], t[i], u[i], rgba[i]);
- break;
- case GL_LINEAR:
- sample_3d_linear(ctx, tObj, tObj->Image[tObj->BaseLevel],
- s[i], t[i], u[i], rgba[i]);
- break;
- default:
- _mesa_problem(NULL, "Bad mag filter in sample_3d_texture");
- }
+ }
+
+ if (magStart < magEnd) {
+ /* do the magnified texels */
+ switch (tObj->MagFilter) {
+ case GL_NEAREST:
+ for (i = magStart; i < magEnd; i++)
+ sample_3d_nearest(ctx, tObj, tObj->Image[tObj->BaseLevel],
+ texcoords[i], rgba[i]);
+ break;
+ case GL_LINEAR:
+ for (i = magStart; i < magEnd; i++)
+ sample_3d_linear(ctx, tObj, tObj->Image[tObj->BaseLevel],
+ texcoords[i], rgba[i]);
+ break;
+ default:
+ _mesa_problem(ctx, "Bad mag filter in sample_3d_texture");
+ return;
}
}
}
@@ -1483,8 +1792,7 @@ sample_lambda_3d( GLcontext *ctx, GLuint texUnit,
*/
static const struct gl_texture_image **
choose_cube_face(const struct gl_texture_object *texObj,
- GLfloat rx, GLfloat ry, GLfloat rz,
- GLfloat *newS, GLfloat *newT)
+ const GLfloat texcoord[4], GLfloat newCoord[4])
{
/*
major axis
@@ -1497,6 +1805,9 @@ choose_cube_face(const struct gl_texture_object *texObj,
+rz TEXTURE_CUBE_MAP_POSITIVE_Z_EXT +rx -ry rz
-rz TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT -rx -ry rz
*/
+ const GLfloat rx = texcoord[0];
+ const GLfloat ry = texcoord[1];
+ const GLfloat rz = texcoord[2];
const struct gl_texture_image **imgArray;
const GLfloat arx = ABSF(rx), ary = ABSF(ry), arz = ABSF(rz);
GLfloat sc, tc, ma;
@@ -1544,8 +1855,8 @@ choose_cube_face(const struct gl_texture_object *texObj,
}
}
- *newS = ( sc / ma + 1.0F ) * 0.5F;
- *newT = ( tc / ma + 1.0F ) * 0.5F;
+ newCoord[0] = ( sc / ma + 1.0F ) * 0.5F;
+ newCoord[1] = ( tc / ma + 1.0F ) * 0.5F;
return imgArray;
}
@@ -1553,18 +1864,17 @@ choose_cube_face(const struct gl_texture_object *texObj,
static void
sample_nearest_cube(GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
+ GLfloat texcoords[][4], const GLfloat lambda[],
GLchan rgba[][4])
{
GLuint i;
(void) lambda;
for (i = 0; i < n; i++) {
const struct gl_texture_image **images;
- GLfloat newS, newT;
- images = choose_cube_face(tObj, s[i], t[i], u[i], &newS, &newT);
+ GLfloat newCoord[4];
+ images = choose_cube_face(tObj, texcoords[i], newCoord);
sample_2d_nearest(ctx, tObj, images[tObj->BaseLevel],
- newS, newT, rgba[i]);
+ newCoord, rgba[i]);
}
}
@@ -1572,112 +1882,119 @@ sample_nearest_cube(GLcontext *ctx, GLuint texUnit,
static void
sample_linear_cube(GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
- GLchan rgba[][4])
+ GLfloat texcoords[][4],
+ const GLfloat lambda[], GLchan rgba[][4])
{
GLuint i;
(void) lambda;
for (i = 0; i < n; i++) {
const struct gl_texture_image **images;
- GLfloat newS, newT;
- images = choose_cube_face(tObj, s[i], t[i], u[i], &newS, &newT);
+ GLfloat newCoord[4];
+ images = choose_cube_face(tObj, texcoords[i], newCoord);
sample_2d_linear(ctx, tObj, images[tObj->BaseLevel],
- newS, newT, rgba[i]);
+ newCoord, rgba[i]);
}
}
static void
-sample_cube_nearest_mipmap_nearest(GLcontext *ctx,
+sample_cube_nearest_mipmap_nearest(GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj,
- GLfloat s, GLfloat t, GLfloat u,
- GLfloat lambda, GLchan rgba[4])
+ GLuint n, GLfloat texcoord[][4],
+ const GLfloat lambda[], GLchan rgba[][4])
{
- const struct gl_texture_image **images;
- GLfloat newS, newT;
- GLint level;
-
- COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda, level);
-
- images = choose_cube_face(tObj, s, t, u, &newS, &newT);
- sample_2d_nearest(ctx, tObj, images[level], newS, newT, rgba);
+ GLuint i;
+ ASSERT(lambda != NULL);
+ for (i = 0; i < n; i++) {
+ const struct gl_texture_image **images;
+ GLfloat newCoord[4];
+ GLint level;
+ COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda[i], level);
+ images = choose_cube_face(tObj, texcoord[i], newCoord);
+ sample_2d_nearest(ctx, tObj, images[level], newCoord, rgba[i]);
+ }
}
static void
-sample_cube_linear_mipmap_nearest(GLcontext *ctx,
+sample_cube_linear_mipmap_nearest(GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj,
- GLfloat s, GLfloat t, GLfloat u,
- GLfloat lambda, GLchan rgba[4])
+ GLuint n, GLfloat texcoord[][4],
+ const GLfloat lambda[], GLchan rgba[][4])
{
- const struct gl_texture_image **images;
- GLfloat newS, newT;
- GLint level;
-
- COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda, level);
-
- images = choose_cube_face(tObj, s, t, u, &newS, &newT);
- sample_2d_linear(ctx, tObj, images[level], newS, newT, rgba);
+ GLuint i;
+ ASSERT(lambda != NULL);
+ for (i = 0; i < n; i++) {
+ const struct gl_texture_image **images;
+ GLfloat newCoord[4];
+ GLint level;
+ COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda[i], level);
+ images = choose_cube_face(tObj, texcoord[i], newCoord);
+ sample_2d_linear(ctx, tObj, images[level], newCoord, rgba[i]);
+ }
}
static void
-sample_cube_nearest_mipmap_linear(GLcontext *ctx,
+sample_cube_nearest_mipmap_linear(GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj,
- GLfloat s, GLfloat t, GLfloat u,
- GLfloat lambda, GLchan rgba[4])
+ GLuint n, GLfloat texcoord[][4],
+ const GLfloat lambda[], GLchan rgba[][4])
{
- const struct gl_texture_image **images;
- GLfloat newS, newT;
- GLint level;
-
- COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda, level);
-
- images = choose_cube_face(tObj, s, t, u, &newS, &newT);
-
- if (level >= tObj->_MaxLevel) {
- sample_2d_nearest(ctx, tObj, images[tObj->_MaxLevel], newS, newT, rgba);
- }
- else {
- GLchan t0[4], t1[4]; /* texels */
- const GLfloat f = FRAC(lambda);
- sample_2d_nearest(ctx, tObj, images[level ], newS, newT, t0);
- sample_2d_nearest(ctx, tObj, images[level+1], newS, newT, t1);
- rgba[RCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
- rgba[GCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
- rgba[BCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
- rgba[ACOMP] = (GLchan) INTCAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]);
+ GLuint i;
+ ASSERT(lambda != NULL);
+ for (i = 0; i < n; i++) {
+ const struct gl_texture_image **images;
+ GLfloat newCoord[4];
+ GLint level;
+ COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
+ images = choose_cube_face(tObj, texcoord[i], newCoord);
+ if (level >= tObj->_MaxLevel) {
+ sample_2d_nearest(ctx, tObj, images[tObj->_MaxLevel],
+ newCoord, rgba[i]);
+ }
+ else {
+ GLchan t0[4], t1[4]; /* texels */
+ const GLfloat f = FRAC(lambda[i]);
+ sample_2d_nearest(ctx, tObj, images[level ], newCoord, t0);
+ sample_2d_nearest(ctx, tObj, images[level+1], newCoord, t1);
+ rgba[i][RCOMP] = CHAN_CAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
+ rgba[i][GCOMP] = CHAN_CAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
+ rgba[i][BCOMP] = CHAN_CAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
+ rgba[i][ACOMP] = CHAN_CAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]);
+ }
}
}
static void
-sample_cube_linear_mipmap_linear(GLcontext *ctx,
+sample_cube_linear_mipmap_linear(GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj,
- GLfloat s, GLfloat t, GLfloat u,
- GLfloat lambda, GLchan rgba[4])
+ GLuint n, GLfloat texcoord[][4],
+ const GLfloat lambda[], GLchan rgba[][4])
{
- const struct gl_texture_image **images;
- GLfloat newS, newT;
- GLint level;
-
- COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda, level);
-
- images = choose_cube_face(tObj, s, t, u, &newS, &newT);
-
- if (level >= tObj->_MaxLevel) {
- sample_2d_linear(ctx, tObj, images[tObj->_MaxLevel], newS, newT, rgba);
- }
- else {
- GLchan t0[4], t1[4];
- const GLfloat f = FRAC(lambda);
- sample_2d_linear(ctx, tObj, images[level ], newS, newT, t0);
- sample_2d_linear(ctx, tObj, images[level+1], newS, newT, t1);
- rgba[RCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
- rgba[GCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
- rgba[BCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
- rgba[ACOMP] = (GLchan) INTCAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]);
+ GLuint i;
+ ASSERT(lambda != NULL);
+ for (i = 0; i < n; i++) {
+ const struct gl_texture_image **images;
+ GLfloat newCoord[4];
+ GLint level;
+ COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
+ images = choose_cube_face(tObj, texcoord[i], newCoord);
+ if (level >= tObj->_MaxLevel) {
+ sample_2d_linear(ctx, tObj, images[tObj->_MaxLevel],
+ newCoord, rgba[i]);
+ }
+ else {
+ GLchan t0[4], t1[4];
+ const GLfloat f = FRAC(lambda[i]);
+ sample_2d_linear(ctx, tObj, images[level ], newCoord, t0);
+ sample_2d_linear(ctx, tObj, images[level+1], newCoord, t1);
+ rgba[i][RCOMP] = CHAN_CAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
+ rgba[i][GCOMP] = CHAN_CAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
+ rgba[i][BCOMP] = CHAN_CAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
+ rgba[i][ACOMP] = CHAN_CAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]);
+ }
}
}
@@ -1685,81 +2002,72 @@ sample_cube_linear_mipmap_linear(GLcontext *ctx,
static void
sample_lambda_cube( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
+ GLfloat texcoords[][4], const GLfloat lambda[],
GLchan rgba[][4])
{
- GLfloat MinMagThresh = SWRAST_CONTEXT(ctx)->_MinMagThresh[texUnit];
- GLuint i;
+ GLuint minStart, minEnd; /* texels with minification */
+ GLuint magStart, magEnd; /* texels with magnification */
- for (i = 0; i < n; i++) {
- if (lambda[i] > MinMagThresh) {
- /* minification */
- switch (tObj->MinFilter) {
- case GL_NEAREST:
- {
- const struct gl_texture_image **images;
- GLfloat newS, newT;
- images = choose_cube_face(tObj, s[i], t[i], u[i],
- &newS, &newT);
- sample_2d_nearest(ctx, tObj, images[tObj->BaseLevel],
- newS, newT, rgba[i]);
- }
- break;
- case GL_LINEAR:
- {
- const struct gl_texture_image **images;
- GLfloat newS, newT;
- images = choose_cube_face(tObj, s[i], t[i], u[i],
- &newS, &newT);
- sample_2d_linear(ctx, tObj, images[tObj->BaseLevel],
- newS, newT, rgba[i]);
- }
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- sample_cube_nearest_mipmap_nearest(ctx, tObj, s[i], t[i], u[i],
- lambda[i], rgba[i]);
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- sample_cube_linear_mipmap_nearest(ctx, tObj, s[i], t[i], u[i],
- lambda[i], rgba[i]);
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- sample_cube_nearest_mipmap_linear(ctx, tObj, s[i], t[i], u[i],
- lambda[i], rgba[i]);
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- sample_cube_linear_mipmap_linear(ctx, tObj, s[i], t[i], u[i],
- lambda[i], rgba[i]);
- break;
- default:
- _mesa_problem(NULL, "Bad min filter in sample_lambda_cube");
- }
+ ASSERT(lambda != NULL);
+ compute_min_mag_ranges(SWRAST_CONTEXT(ctx)->_MinMagThresh[texUnit],
+ n, lambda, &minStart, &minEnd, &magStart, &magEnd);
+
+ if (minStart < minEnd) {
+ /* do the minified texels */
+ const GLuint m = minEnd - minStart;
+ switch (tObj->MinFilter) {
+ case GL_NEAREST:
+ sample_nearest_cube(ctx, texUnit, tObj, m, texcoords + minStart,
+ lambda + minStart, rgba + minStart);
+ break;
+ case GL_LINEAR:
+ sample_linear_cube(ctx, texUnit, tObj, m, texcoords + minStart,
+ lambda + minStart, rgba + minStart);
+ break;
+ case GL_NEAREST_MIPMAP_NEAREST:
+ sample_cube_nearest_mipmap_nearest(ctx, texUnit, tObj, m,
+ texcoords + minStart,
+ lambda + minStart, rgba + minStart);
+ break;
+ case GL_LINEAR_MIPMAP_NEAREST:
+ sample_cube_linear_mipmap_nearest(ctx, texUnit, tObj, m,
+ texcoords + minStart,
+ lambda + minStart, rgba + minStart);
+ break;
+ case GL_NEAREST_MIPMAP_LINEAR:
+ sample_cube_nearest_mipmap_linear(ctx, texUnit, tObj, m,
+ texcoords + minStart,
+ lambda + minStart, rgba + minStart);
+ break;
+ case GL_LINEAR_MIPMAP_LINEAR:
+ sample_cube_linear_mipmap_linear(ctx, texUnit, tObj, m,
+ texcoords + minStart,
+ lambda + minStart, rgba + minStart);
+ break;
+ default:
+ _mesa_problem(ctx, "Bad min filter in sample_lambda_cube");
}
- else {
- /* magnification */
- const struct gl_texture_image **images;
- GLfloat newS, newT;
- images = choose_cube_face(tObj, s[i], t[i], u[i],
- &newS, &newT);
- switch (tObj->MagFilter) {
- case GL_NEAREST:
- sample_2d_nearest(ctx, tObj, images[tObj->BaseLevel],
- newS, newT, rgba[i]);
- break;
- case GL_LINEAR:
- sample_2d_linear(ctx, tObj, images[tObj->BaseLevel],
- newS, newT, rgba[i]);
- break;
- default:
- _mesa_problem(NULL, "Bad mag filter in sample_lambda_cube");
- }
+ }
+
+ if (magStart < magEnd) {
+ /* do the magnified texels */
+ const GLuint m = magEnd - magStart;
+ switch (tObj->MagFilter) {
+ case GL_NEAREST:
+ sample_nearest_cube(ctx, texUnit, tObj, m, texcoords + magStart,
+ lambda + magStart, rgba + magStart);
+ break;
+ case GL_LINEAR:
+ sample_linear_cube(ctx, texUnit, tObj, m, texcoords + magStart,
+ lambda + magStart, rgba + magStart);
+ break;
+ default:
+ _mesa_problem(ctx, "Bad mag filter in sample_lambda_cube");
}
}
}
-
/**********************************************************************/
/* Texture Rectangle Sampling Functions */
/**********************************************************************/
@@ -1767,8 +2075,7 @@ sample_lambda_cube( GLcontext *ctx, GLuint texUnit,
static void
sample_nearest_rect(GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
+ GLfloat texcoords[][4], const GLfloat lambda[],
GLchan rgba[][4])
{
const struct gl_texture_image *img = tObj->Image[0];
@@ -1783,10 +2090,10 @@ sample_nearest_rect(GLcontext *ctx, GLuint texUnit,
ASSERT(tObj->WrapS == GL_CLAMP ||
tObj->WrapS == GL_CLAMP_TO_EDGE ||
- tObj->WrapS == GL_CLAMP_TO_BORDER_ARB);
+ tObj->WrapS == GL_CLAMP_TO_BORDER);
ASSERT(tObj->WrapT == GL_CLAMP ||
tObj->WrapT == GL_CLAMP_TO_EDGE ||
- tObj->WrapT == GL_CLAMP_TO_BORDER_ARB);
+ tObj->WrapT == GL_CLAMP_TO_BORDER);
ASSERT(img->Format != GL_COLOR_INDEX);
/* XXX move Wrap mode tests outside of loops for common cases */
@@ -1794,22 +2101,22 @@ sample_nearest_rect(GLcontext *ctx, GLuint texUnit,
GLint row, col;
/* NOTE: we DO NOT use [0, 1] texture coordinates! */
if (tObj->WrapS == GL_CLAMP) {
- col = IFLOOR( CLAMP(s[i], 0.0F, width) );
+ col = IFLOOR( CLAMP(texcoords[i][0], 0.0F, width) );
}
else if (tObj->WrapS == GL_CLAMP_TO_EDGE) {
- col = IFLOOR( CLAMP(s[i], 0.5F, width - 0.5F) );
+ col = IFLOOR( CLAMP(texcoords[i][0], 0.5F, width - 0.5F) );
}
else {
- col = IFLOOR( CLAMP(s[i], -0.5F, width + 0.5F) );
+ col = IFLOOR( CLAMP(texcoords[i][0], -0.5F, width + 0.5F) );
}
if (tObj->WrapT == GL_CLAMP) {
- row = IFLOOR( CLAMP(t[i], 0.0F, height) );
+ row = IFLOOR( CLAMP(texcoords[i][1], 0.0F, height) );
}
else if (tObj->WrapT == GL_CLAMP_TO_EDGE) {
- row = IFLOOR( CLAMP(t[i], 0.5F, height - 0.5F) );
+ row = IFLOOR( CLAMP(texcoords[i][1], 0.5F, height - 0.5F) );
}
else {
- row = IFLOOR( CLAMP(t[i], -0.5F, height + 0.5F) );
+ row = IFLOOR( CLAMP(texcoords[i][1], -0.5F, height + 0.5F) );
}
col = CLAMP(col, 0, width_minus_1);
@@ -1823,9 +2130,8 @@ sample_nearest_rect(GLcontext *ctx, GLuint texUnit,
static void
sample_linear_rect(GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
- GLchan rgba[][4])
+ GLfloat texcoords[][4],
+ const GLfloat lambda[], GLchan rgba[][4])
{
const struct gl_texture_image *img = tObj->Image[0];
const GLfloat width = (GLfloat) img->Width;
@@ -1839,10 +2145,10 @@ sample_linear_rect(GLcontext *ctx, GLuint texUnit,
ASSERT(tObj->WrapS == GL_CLAMP ||
tObj->WrapS == GL_CLAMP_TO_EDGE ||
- tObj->WrapS == GL_CLAMP_TO_BORDER_ARB);
+ tObj->WrapS == GL_CLAMP_TO_BORDER);
ASSERT(tObj->WrapT == GL_CLAMP ||
tObj->WrapT == GL_CLAMP_TO_EDGE ||
- tObj->WrapT == GL_CLAMP_TO_BORDER_ARB);
+ tObj->WrapT == GL_CLAMP_TO_BORDER);
ASSERT(img->Format != GL_COLOR_INDEX);
/* XXX lots of opportunity for optimization in this loop */
@@ -1854,22 +2160,22 @@ sample_linear_rect(GLcontext *ctx, GLuint texUnit,
/* NOTE: we DO NOT use [0, 1] texture coordinates! */
if (tObj->WrapS == GL_CLAMP) {
- fcol = CLAMP(s[i], 0.0F, width);
+ fcol = CLAMP(texcoords[i][0], 0.0F, width);
}
else if (tObj->WrapS == GL_CLAMP_TO_EDGE) {
- fcol = CLAMP(s[i], 0.5F, width - 0.5F);
+ fcol = CLAMP(texcoords[i][0], 0.5F, width - 0.5F);
}
else {
- fcol = CLAMP(s[i], -0.5F, width + 0.5F);
+ fcol = CLAMP(texcoords[i][0], -0.5F, width + 0.5F);
}
if (tObj->WrapT == GL_CLAMP) {
- frow = CLAMP(t[i], 0.0F, height);
+ frow = CLAMP(texcoords[i][1], 0.0F, height);
}
else if (tObj->WrapT == GL_CLAMP_TO_EDGE) {
- frow = CLAMP(t[i], 0.5F, height - 0.5F);
+ frow = CLAMP(texcoords[i][1], 0.5F, height - 0.5F);
}
else {
- frow = CLAMP(t[i], -0.5F, height + 0.5F);
+ frow = CLAMP(texcoords[i][1], -0.5F, height + 0.5F);
}
/* compute integer rows/columns */
@@ -1897,92 +2203,456 @@ sample_linear_rect(GLcontext *ctx, GLuint texUnit,
w11 = a * b ;
/* compute weighted average of samples */
- rgba[i][0] = w00 * t00[0] + w10 * t10[0] + w01 * t01[0] + w11 * t11[0];
- rgba[i][1] = w00 * t00[1] + w10 * t10[1] + w01 * t01[1] + w11 * t11[1];
- rgba[i][2] = w00 * t00[2] + w10 * t10[2] + w01 * t01[2] + w11 * t11[2];
- rgba[i][3] = w00 * t00[3] + w10 * t10[3] + w01 * t01[3] + w11 * t11[3];
+ rgba[i][0] =
+ (GLchan) (w00 * t00[0] + w10 * t10[0] + w01 * t01[0] + w11 * t11[0]);
+ rgba[i][1] =
+ (GLchan) (w00 * t00[1] + w10 * t10[1] + w01 * t01[1] + w11 * t11[1]);
+ rgba[i][2] =
+ (GLchan) (w00 * t00[2] + w10 * t10[2] + w01 * t01[2] + w11 * t11[2]);
+ rgba[i][3] =
+ (GLchan) (w00 * t00[3] + w10 * t10[3] + w01 * t01[3] + w11 * t11[3]);
}
}
-
static void
sample_lambda_rect( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
+ GLfloat texcoords[][4], const GLfloat lambda[],
GLchan rgba[][4])
{
- const GLfloat minMagThresh = SWRAST_CONTEXT(ctx)->_MinMagThresh[texUnit];
- GLuint i;
+ GLuint minStart, minEnd, magStart, magEnd;
- {
+ /* We only need lambda to decide between minification and magnification.
+ * There is no mipmapping with rectangular textures.
+ */
+ compute_min_mag_ranges(SWRAST_CONTEXT(ctx)->_MinMagThresh[texUnit],
+ n, lambda, &minStart, &minEnd, &magStart, &magEnd);
+
+ if (minStart < minEnd) {
+ if (tObj->MinFilter == GL_NEAREST) {
+ sample_nearest_rect( ctx, texUnit, tObj, minEnd - minStart,
+ texcoords + minStart, NULL, rgba + minStart);
+ }
+ else {
+ sample_linear_rect( ctx, texUnit, tObj, minEnd - minStart,
+ texcoords + minStart, NULL, rgba + minStart);
+ }
+ }
+ if (magStart < magEnd) {
+ if (tObj->MagFilter == GL_NEAREST) {
+ sample_nearest_rect( ctx, texUnit, tObj, magEnd - magStart,
+ texcoords + magStart, NULL, rgba + magStart);
+ }
+ else {
+ sample_linear_rect( ctx, texUnit, tObj, magEnd - magStart,
+ texcoords + magStart, NULL, rgba + magStart);
+ }
+ }
+}
+
+
+
+/*
+ * Sample a shadow/depth texture.
+ */
+static void
+sample_depth_texture( GLcontext *ctx, GLuint unit,
+ const struct gl_texture_object *tObj, GLuint n,
+ GLfloat texcoords[][4], const GLfloat lambda[],
+ GLchan texel[][4] )
+{
+ const GLint baseLevel = tObj->BaseLevel;
+ const struct gl_texture_image *texImage = tObj->Image[baseLevel];
+ const GLuint width = texImage->Width;
+ const GLuint height = texImage->Height;
+ GLchan ambient;
+ GLenum function;
+ GLchan result;
+
+ (void) unit;
+
+ ASSERT(tObj->Image[tObj->BaseLevel]->Format == GL_DEPTH_COMPONENT);
+ ASSERT(tObj->Target == GL_TEXTURE_1D ||
+ tObj->Target == GL_TEXTURE_2D ||
+ tObj->Target == GL_TEXTURE_RECTANGLE_NV);
+
+ UNCLAMPED_FLOAT_TO_CHAN(ambient, tObj->ShadowAmbient);
+
+ /* XXXX if tObj->MinFilter != tObj->MagFilter, we're ignoring lambda */
+
+ /* XXX this could be precomputed and saved in the texture object */
+ if (tObj->CompareFlag) {
+ /* GL_SGIX_shadow */
+ if (tObj->CompareOperator == GL_TEXTURE_LEQUAL_R_SGIX) {
+ function = GL_LEQUAL;
+ }
+ else {
+ ASSERT(tObj->CompareOperator == GL_TEXTURE_GEQUAL_R_SGIX);
+ function = GL_GEQUAL;
+ }
+ }
+ else if (tObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) {
+ /* GL_ARB_shadow */
+ function = tObj->CompareFunc;
+ }
+ else {
+ function = GL_NONE; /* pass depth through as grayscale */
+ }
+
+ if (tObj->MagFilter == GL_NEAREST) {
+ GLuint i;
for (i = 0; i < n; i++) {
- GLfloat coord[4];
- coord[0] = s[i];
- coord[1] = t[i];
- coord[2] = u[i];
- coord[3] = 1.0;
- if (lambda[i] > minMagThresh) {
- /* minification */
- switch (tObj->MinFilter) {
- case GL_NEAREST:
- sample_nearest_rect(ctx, texUnit, tObj, 1,
- s + i, t + i, u + i, lambda + i,
- rgba + i );
- break;
- case GL_LINEAR:
- sample_linear_rect(ctx, texUnit, tObj, 1,
- s + i, t + i, u + i, lambda + i,
- rgba + i );
- break;
- default:
- _mesa_problem(NULL, "Bad min filter in sample_lambda_rect");
- return;
+ GLfloat depthSample;
+ GLint col, row;
+ /* XXX fix for texture rectangle! */
+ COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, texcoords[i][0], width, col);
+ COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapT, texcoords[i][1], height, row);
+ depthSample = *((const GLfloat *) texImage->Data + row * width + col);
+
+ switch (function) {
+ case GL_LEQUAL:
+ result = (texcoords[i][2] <= depthSample) ? CHAN_MAX : ambient;
+ break;
+ case GL_GEQUAL:
+ result = (texcoords[i][2] >= depthSample) ? CHAN_MAX : ambient;
+ break;
+ case GL_LESS:
+ result = (texcoords[i][2] < depthSample) ? CHAN_MAX : ambient;
+ break;
+ case GL_GREATER:
+ result = (texcoords[i][2] > depthSample) ? CHAN_MAX : ambient;
+ break;
+ case GL_EQUAL:
+ result = (texcoords[i][2] == depthSample) ? CHAN_MAX : ambient;
+ break;
+ case GL_NOTEQUAL:
+ result = (texcoords[i][2] != depthSample) ? CHAN_MAX : ambient;
+ break;
+ case GL_ALWAYS:
+ result = CHAN_MAX;
+ break;
+ case GL_NEVER:
+ result = ambient;
+ break;
+ case GL_NONE:
+ CLAMPED_FLOAT_TO_CHAN(result, depthSample);
+ break;
+ default:
+ _mesa_problem(ctx, "Bad compare func in sample_depth_texture");
+ return;
+ }
+
+ switch (tObj->DepthMode) {
+ case GL_LUMINANCE:
+ texel[i][RCOMP] = result;
+ texel[i][GCOMP] = result;
+ texel[i][BCOMP] = result;
+ texel[i][ACOMP] = CHAN_MAX;
+ break;
+ case GL_INTENSITY:
+ texel[i][RCOMP] = result;
+ texel[i][GCOMP] = result;
+ texel[i][BCOMP] = result;
+ texel[i][ACOMP] = result;
+ break;
+ case GL_ALPHA:
+ texel[i][RCOMP] = 0;
+ texel[i][GCOMP] = 0;
+ texel[i][BCOMP] = 0;
+ texel[i][ACOMP] = result;
+ break;
+ default:
+ _mesa_problem(ctx, "Bad depth texture mode");
+ }
+ }
+ }
+ else {
+ GLuint i;
+ ASSERT(tObj->MagFilter == GL_LINEAR);
+ for (i = 0; i < n; i++) {
+ GLfloat depth00, depth01, depth10, depth11;
+ GLint i0, i1, j0, j1;
+ GLfloat u, v;
+ GLuint useBorderTexel;
+
+ /* XXX fix for texture rectangle! */
+ COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapS, texcoords[i][0], u, width, i0, i1);
+ COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapT, texcoords[i][1], v, height,j0, j1);
+
+ useBorderTexel = 0;
+ if (texImage->Border) {
+ i0 += texImage->Border;
+ i1 += texImage->Border;
+ j0 += texImage->Border;
+ j1 += texImage->Border;
+ }
+ else {
+ if (i0 < 0 || i0 >= (GLint) width) useBorderTexel |= I0BIT;
+ if (i1 < 0 || i1 >= (GLint) width) useBorderTexel |= I1BIT;
+ if (j0 < 0 || j0 >= (GLint) height) useBorderTexel |= J0BIT;
+ if (j1 < 0 || j1 >= (GLint) height) useBorderTexel |= J1BIT;
+ }
+
+ /* get four depth samples from the texture */
+ if (useBorderTexel & (I0BIT | J0BIT)) {
+ depth00 = 1.0;
+ }
+ else {
+ depth00 = *((const GLfloat *) texImage->Data + j0 * width + i0);
+ }
+ if (useBorderTexel & (I1BIT | J0BIT)) {
+ depth10 = 1.0;
+ }
+ else {
+ depth10 = *((const GLfloat *) texImage->Data + j0 * width + i1);
+ }
+ if (useBorderTexel & (I0BIT | J1BIT)) {
+ depth01 = 1.0;
+ }
+ else {
+ depth01 = *((const GLfloat *) texImage->Data + j1 * width + i0);
+ }
+ if (useBorderTexel & (I1BIT | J1BIT)) {
+ depth11 = 1.0;
+ }
+ else {
+ depth11 = *((const GLfloat *) texImage->Data + j1 * width + i1);
+ }
+
+ if (0) {
+ /* compute a single weighted depth sample and do one comparison */
+ const GLfloat a = FRAC(u + 1.0F);
+ const GLfloat b = FRAC(v + 1.0F);
+ const GLfloat w00 = (1.0F - a) * (1.0F - b);
+ const GLfloat w10 = ( a) * (1.0F - b);
+ const GLfloat w01 = (1.0F - a) * ( b);
+ const GLfloat w11 = ( a) * ( b);
+ const GLfloat depthSample = w00 * depth00 + w10 * depth10
+ + w01 * depth01 + w11 * depth11;
+ if ((depthSample <= texcoords[i][2] && function == GL_LEQUAL) ||
+ (depthSample >= texcoords[i][2] && function == GL_GEQUAL)) {
+ result = ambient;
+ }
+ else {
+ result = CHAN_MAX;
}
}
else {
- /* magnification */
- switch (tObj->MagFilter) {
- case GL_NEAREST:
- sample_nearest_rect(ctx, texUnit, tObj, 1,
- s + i, t + i, u + i, lambda + i,
- rgba + i );
- break;
- case GL_LINEAR:
- sample_linear_rect(ctx, texUnit, tObj, 1,
- s + i, t + i, u + i, lambda + i,
- rgba + i );
- break;
- default:
- _mesa_problem(NULL, "Bad mag filter in sample_lambda_rect");
- return;
+ /* Do four depth/R comparisons and compute a weighted result.
+ * If this touches on somebody's I.P., I'll remove this code
+ * upon request.
+ */
+ const GLfloat d = (CHAN_MAXF - (GLfloat) ambient) * 0.25F;
+ GLfloat luminance = CHAN_MAXF;
+
+ switch (function) {
+ case GL_LEQUAL:
+ if (depth00 <= texcoords[i][2]) luminance -= d;
+ if (depth01 <= texcoords[i][2]) luminance -= d;
+ if (depth10 <= texcoords[i][2]) luminance -= d;
+ if (depth11 <= texcoords[i][2]) luminance -= d;
+ result = (GLchan) luminance;
+ break;
+ case GL_GEQUAL:
+ if (depth00 >= texcoords[i][2]) luminance -= d;
+ if (depth01 >= texcoords[i][2]) luminance -= d;
+ if (depth10 >= texcoords[i][2]) luminance -= d;
+ if (depth11 >= texcoords[i][2]) luminance -= d;
+ result = (GLchan) luminance;
+ break;
+ case GL_LESS:
+ if (depth00 < texcoords[i][2]) luminance -= d;
+ if (depth01 < texcoords[i][2]) luminance -= d;
+ if (depth10 < texcoords[i][2]) luminance -= d;
+ if (depth11 < texcoords[i][2]) luminance -= d;
+ result = (GLchan) luminance;
+ break;
+ case GL_GREATER:
+ if (depth00 > texcoords[i][2]) luminance -= d;
+ if (depth01 > texcoords[i][2]) luminance -= d;
+ if (depth10 > texcoords[i][2]) luminance -= d;
+ if (depth11 > texcoords[i][2]) luminance -= d;
+ result = (GLchan) luminance;
+ break;
+ case GL_EQUAL:
+ if (depth00 == texcoords[i][2]) luminance -= d;
+ if (depth01 == texcoords[i][2]) luminance -= d;
+ if (depth10 == texcoords[i][2]) luminance -= d;
+ if (depth11 == texcoords[i][2]) luminance -= d;
+ result = (GLchan) luminance;
+ break;
+ case GL_NOTEQUAL:
+ if (depth00 != texcoords[i][2]) luminance -= d;
+ if (depth01 != texcoords[i][2]) luminance -= d;
+ if (depth10 != texcoords[i][2]) luminance -= d;
+ if (depth11 != texcoords[i][2]) luminance -= d;
+ result = (GLchan) luminance;
+ break;
+ case GL_ALWAYS:
+ result = 0;
+ break;
+ case GL_NEVER:
+ result = CHAN_MAX;
+ break;
+ case GL_NONE:
+ /* ordinary bilinear filtering */
+ {
+ const GLfloat a = FRAC(u + 1.0F);
+ const GLfloat b = FRAC(v + 1.0F);
+ const GLfloat w00 = (1.0F - a) * (1.0F - b);
+ const GLfloat w10 = ( a) * (1.0F - b);
+ const GLfloat w01 = (1.0F - a) * ( b);
+ const GLfloat w11 = ( a) * ( b);
+ const GLfloat depthSample = w00 * depth00 + w10 * depth10
+ + w01 * depth01 + w11 * depth11;
+ CLAMPED_FLOAT_TO_CHAN(result, depthSample);
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "Bad compare func in sample_depth_texture");
+ return;
}
}
- }
- }
+ switch (tObj->DepthMode) {
+ case GL_LUMINANCE:
+ texel[i][RCOMP] = result;
+ texel[i][GCOMP] = result;
+ texel[i][BCOMP] = result;
+ texel[i][ACOMP] = CHAN_MAX;
+ break;
+ case GL_INTENSITY:
+ texel[i][RCOMP] = result;
+ texel[i][GCOMP] = result;
+ texel[i][BCOMP] = result;
+ texel[i][ACOMP] = result;
+ break;
+ case GL_ALPHA:
+ texel[i][RCOMP] = 0;
+ texel[i][GCOMP] = 0;
+ texel[i][BCOMP] = 0;
+ texel[i][ACOMP] = result;
+ break;
+ default:
+ _mesa_problem(ctx, "Bad depth texture mode");
+ }
+ } /* for */
+ } /* if filter */
}
+#if 0
+/*
+ * Experimental depth texture sampling function.
+ */
+static void
+sample_depth_texture2(const GLcontext *ctx,
+ const struct gl_texture_unit *texUnit,
+ GLuint n, GLfloat texcoords[][4],
+ GLchan texel[][4])
+{
+ const struct gl_texture_object *texObj = texUnit->_Current;
+ const GLint baseLevel = texObj->BaseLevel;
+ const struct gl_texture_image *texImage = texObj->Image[baseLevel];
+ const GLuint width = texImage->Width;
+ const GLuint height = texImage->Height;
+ GLchan ambient;
+ GLboolean lequal, gequal;
+
+ if (texObj->Target != GL_TEXTURE_2D) {
+ _mesa_problem(ctx, "only 2-D depth textures supported at this time");
+ return;
+ }
+
+ if (texObj->MinFilter != texObj->MagFilter) {
+ _mesa_problem(ctx, "mipmapped depth textures not supported at this time");
+ return;
+ }
+
+ /* XXX the GL_SGIX_shadow extension spec doesn't say what to do if
+ * GL_TEXTURE_COMPARE_SGIX == GL_TRUE but the current texture object
+ * isn't a depth texture.
+ */
+ if (texImage->Format != GL_DEPTH_COMPONENT) {
+ _mesa_problem(ctx,"GL_TEXTURE_COMPARE_SGIX enabled with non-depth texture");
+ return;
+ }
+ UNCLAMPED_FLOAT_TO_CHAN(ambient, tObj->ShadowAmbient);
+
+ if (texObj->CompareOperator == GL_TEXTURE_LEQUAL_R_SGIX) {
+ lequal = GL_TRUE;
+ gequal = GL_FALSE;
+ }
+ else {
+ lequal = GL_FALSE;
+ gequal = GL_TRUE;
+ }
+
+ {
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ const GLint K = 3;
+ GLint col, row, ii, jj, imin, imax, jmin, jmax, samples, count;
+ GLfloat w;
+ GLchan lum;
+ COMPUTE_NEAREST_TEXEL_LOCATION(texObj->WrapS, texcoords[i][0],
+ width, col);
+ COMPUTE_NEAREST_TEXEL_LOCATION(texObj->WrapT, texcoords[i][1],
+ height, row);
+
+ imin = col - K;
+ imax = col + K;
+ jmin = row - K;
+ jmax = row + K;
+
+ if (imin < 0) imin = 0;
+ if (imax >= width) imax = width - 1;
+ if (jmin < 0) jmin = 0;
+ if (jmax >= height) jmax = height - 1;
+
+ samples = (imax - imin + 1) * (jmax - jmin + 1);
+ count = 0;
+ for (jj = jmin; jj <= jmax; jj++) {
+ for (ii = imin; ii <= imax; ii++) {
+ GLfloat depthSample = *((const GLfloat *) texImage->Data
+ + jj * width + ii);
+ if ((depthSample <= r[i] && lequal) ||
+ (depthSample >= r[i] && gequal)) {
+ count++;
+ }
+ }
+ }
+
+ w = (GLfloat) count / (GLfloat) samples;
+ w = CHAN_MAXF - w * (CHAN_MAXF - (GLfloat) ambient);
+ lum = (GLint) w;
+
+ texel[i][RCOMP] = lum;
+ texel[i][GCOMP] = lum;
+ texel[i][BCOMP] = lum;
+ texel[i][ACOMP] = CHAN_MAX;
+ }
+ }
+}
+#endif
+
+
+/**
+ * We use this function when a texture object is in an "incomplete" state.
+ */
static void
null_sample_func( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat u[], const GLfloat lambda[],
+ GLfloat texcoords[][4], const GLfloat lambda[],
GLchan rgba[][4])
{
}
-/**********************************************************************/
-/* Texture Sampling Setup */
-/**********************************************************************/
-
-
-/*
+/**
* Setup the texture sampling function for this texture object.
*/
void
@@ -1991,11 +2661,12 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, GLuint texUnit,
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- if (!t->Complete) {
- swrast->TextureSample[texUnit] = null_sample_func;
+ if (!t->Complete) {
+ swrast->TextureSample[texUnit] = null_sample_func;
}
else {
- GLboolean needLambda = (GLboolean) (t->MinFilter != t->MagFilter);
+ const GLboolean needLambda = (GLboolean) (t->MinFilter != t->MagFilter);
+ const GLenum format = t->Image[t->BaseLevel]->Format;
if (needLambda) {
/* Compute min/mag filter threshold */
@@ -2011,27 +2682,33 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, GLuint texUnit,
switch (t->Target) {
case GL_TEXTURE_1D:
- if (needLambda) {
+ if (format == GL_DEPTH_COMPONENT) {
+ swrast->TextureSample[texUnit] = sample_depth_texture;
+ }
+ else if (needLambda) {
swrast->TextureSample[texUnit] = sample_lambda_1d;
}
- else if (t->MinFilter==GL_LINEAR) {
+ else if (t->MinFilter == GL_LINEAR) {
swrast->TextureSample[texUnit] = sample_linear_1d;
}
else {
- ASSERT(t->MinFilter==GL_NEAREST);
+ ASSERT(t->MinFilter == GL_NEAREST);
swrast->TextureSample[texUnit] = sample_nearest_1d;
}
break;
case GL_TEXTURE_2D:
- if (needLambda) {
+ if (format == GL_DEPTH_COMPONENT) {
+ swrast->TextureSample[texUnit] = sample_depth_texture;
+ }
+ else if (needLambda) {
swrast->TextureSample[texUnit] = sample_lambda_2d;
}
- else if (t->MinFilter==GL_LINEAR) {
+ else if (t->MinFilter == GL_LINEAR) {
swrast->TextureSample[texUnit] = sample_linear_2d;
}
else {
GLint baseLevel = t->BaseLevel;
- ASSERT(t->MinFilter==GL_NEAREST);
+ ASSERT(t->MinFilter == GL_NEAREST);
if (t->WrapS == GL_REPEAT &&
t->WrapT == GL_REPEAT &&
t->Image[baseLevel]->Border == 0 &&
@@ -2052,23 +2729,23 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, GLuint texUnit,
if (needLambda) {
swrast->TextureSample[texUnit] = sample_lambda_3d;
}
- else if (t->MinFilter==GL_LINEAR) {
+ else if (t->MinFilter == GL_LINEAR) {
swrast->TextureSample[texUnit] = sample_linear_3d;
}
else {
- ASSERT(t->MinFilter==GL_NEAREST);
+ ASSERT(t->MinFilter == GL_NEAREST);
swrast->TextureSample[texUnit] = sample_nearest_3d;
}
break;
- case GL_TEXTURE_CUBE_MAP_ARB:
+ case GL_TEXTURE_CUBE_MAP:
if (needLambda) {
swrast->TextureSample[texUnit] = sample_lambda_cube;
}
- else if (t->MinFilter==GL_LINEAR) {
+ else if (t->MinFilter == GL_LINEAR) {
swrast->TextureSample[texUnit] = sample_linear_cube;
}
else {
- ASSERT(t->MinFilter==GL_NEAREST);
+ ASSERT(t->MinFilter == GL_NEAREST);
swrast->TextureSample[texUnit] = sample_nearest_cube;
}
break;
@@ -2085,7 +2762,7 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, GLuint texUnit,
}
break;
default:
- _mesa_problem(NULL, "invalid dimensions in _mesa_set_texture_sampler");
+ _mesa_problem(ctx, "invalid target in _swrast_choose_texture_sample_func");
}
}
}
@@ -2094,70 +2771,131 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, GLuint texUnit,
#define PROD(A,B) ( (GLuint)(A) * ((GLuint)(B)+1) )
#define S_PROD(A,B) ( (GLint)(A) * ((GLint)(B)+1) )
+
+/**
+ * Do texture application for GL_ARB/EXT_texture_env_combine.
+ * This function also supports GL_{EXT,ARB}_texture_env_dot3 and
+ * GL_ATI_texture_env_combine3
+ *
+ * \param ctx rendering context
+ * \param textureUnit the texture unit to apply
+ * \param n number of fragments to process (span width)
+ * \param primary_rgba incoming fragment color array
+ * \param texelBuffer pointer to texel colors for all texture units
+ *
+ * \param rgba incoming colors, which get modified here
+ */
static INLINE void
-texture_combine(const GLcontext *ctx,
- const struct gl_texture_unit *textureUnit,
- GLuint n,
- CONST GLchan (*primary_rgba)[4],
- CONST GLchan (*texel)[4],
- GLchan (*rgba)[4])
+texture_combine( const GLcontext *ctx, GLuint unit, GLuint n,
+ CONST GLchan (*primary_rgba)[4],
+ CONST GLchan *texelBuffer,
+ GLchan (*rgba)[4] )
{
+ const struct gl_texture_unit *textureUnit = &(ctx->Texture.Unit[unit]);
const GLchan (*argRGB [3])[4];
const GLchan (*argA [3])[4];
- GLuint i, j;
const GLuint RGBshift = textureUnit->CombineScaleShiftRGB;
const GLuint Ashift = textureUnit->CombineScaleShiftA;
#if CHAN_TYPE == GL_FLOAT
const GLchan RGBmult = (GLfloat) (1 << RGBshift);
const GLchan Amult = (GLfloat) (1 << Ashift);
+ static const GLchan one[4] = { 1.0, 1.0, 1.0, 1.0 };
+ static const GLchan zero[4] = { 0.0, 0.0, 0.0, 0.0 };
#else
const GLint half = (CHAN_MAX + 1) / 2;
+ static const GLchan one[4] = { CHAN_MAX, CHAN_MAX, CHAN_MAX, CHAN_MAX };
+ static const GLchan zero[4] = { 0, 0, 0, 0 };
#endif
+ GLuint i, j;
+ GLuint numColorArgs;
+ GLuint numAlphaArgs;
+ /* GLchan ccolor[3][4]; */
DEFMNARRAY(GLchan, ccolor, 3, 3 * MAX_WIDTH, 4); /* mac 32k limitation */
CHECKARRAY(ccolor, return); /* mac 32k limitation */
ASSERT(ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine);
+ ASSERT(SWRAST_CONTEXT(ctx)->_AnyTextureCombine);
+
+
+ /*
+ printf("modeRGB 0x%x modeA 0x%x srcRGB1 0x%x srcA1 0x%x srcRGB2 0x%x srcA2 0x%x\n",
+ textureUnit->CombineModeRGB,
+ textureUnit->CombineModeA,
+ textureUnit->CombineSourceRGB[0],
+ textureUnit->CombineSourceA[0],
+ textureUnit->CombineSourceRGB[1],
+ textureUnit->CombineSourceA[1]);
+ */
/*
* Do operand setup for up to 3 operands. Loop over the terms.
*/
- for (j = 0; j < 3; j++) {
- switch (textureUnit->CombineSourceA[j]) {
- case GL_TEXTURE:
- argA[j] = texel;
- break;
- case GL_PRIMARY_COLOR_EXT:
- argA[j] = primary_rgba;
- break;
- case GL_PREVIOUS_EXT:
- argA[j] = (const GLchan (*)[4]) rgba;
- break;
- case GL_CONSTANT_EXT:
- {
- GLchan alpha, (*c)[4] = ccolor[j];
- UNCLAMPED_FLOAT_TO_CHAN(alpha, textureUnit->EnvColor[3]);
- for (i = 0; i < n; i++)
- c[i][ACOMP] = alpha;
- argA[j] = (const GLchan (*)[4]) ccolor[j];
- }
- break;
- default:
- _mesa_problem(ctx, "invalid combine source");
- }
+ switch (textureUnit->CombineModeRGB) {
+ case GL_REPLACE:
+ numColorArgs = 1;
+ break;
+ case GL_MODULATE:
+ case GL_ADD:
+ case GL_ADD_SIGNED:
+ case GL_SUBTRACT:
+ case GL_DOT3_RGB:
+ case GL_DOT3_RGBA:
+ case GL_DOT3_RGB_EXT:
+ case GL_DOT3_RGBA_EXT:
+ numColorArgs = 2;
+ break;
+ case GL_INTERPOLATE:
+ case GL_MODULATE_ADD_ATI:
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ case GL_MODULATE_SUBTRACT_ATI:
+ numColorArgs = 3;
+ break;
+ default:
+ numColorArgs = 0;
+ ASSERT(0);
+ break;
+ }
+
+ switch (textureUnit->CombineModeA) {
+ case GL_REPLACE:
+ numAlphaArgs = 1;
+ break;
+ case GL_MODULATE:
+ case GL_ADD:
+ case GL_ADD_SIGNED:
+ case GL_SUBTRACT:
+ numAlphaArgs = 2;
+ break;
+ case GL_INTERPOLATE:
+ case GL_MODULATE_ADD_ATI:
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ case GL_MODULATE_SUBTRACT_ATI:
+ numAlphaArgs = 3;
+ break;
+ default:
+ numAlphaArgs = 0;
+ ASSERT(0);
+ break;
+ }
+
+ for (j = 0; j < numColorArgs; j++) {
+ const GLenum srcRGB = textureUnit->CombineSourceRGB[j];
- switch (textureUnit->CombineSourceRGB[j]) {
+
+ switch (srcRGB) {
case GL_TEXTURE:
- argRGB[j] = texel;
+ argRGB[j] = (const GLchan (*)[4])
+ (texelBuffer + unit * (n * 4 * sizeof(GLchan)));
break;
- case GL_PRIMARY_COLOR_EXT:
+ case GL_PRIMARY_COLOR:
argRGB[j] = primary_rgba;
break;
- case GL_PREVIOUS_EXT:
+ case GL_PREVIOUS:
argRGB[j] = (const GLchan (*)[4]) rgba;
break;
- case GL_CONSTANT_EXT:
+ case GL_CONSTANT:
{
GLchan (*c)[4] = ccolor[j];
GLchan red, green, blue, alpha;
@@ -2174,8 +2912,24 @@ texture_combine(const GLcontext *ctx,
argRGB[j] = (const GLchan (*)[4]) ccolor[j];
}
break;
+ /* GL_ATI_texture_env_combine3 allows GL_ZERO & GL_ONE as sources.
+ */
+ case GL_ZERO:
+ argRGB[j] = & zero;
+ break;
+ case GL_ONE:
+ argRGB[j] = & one;
+ break;
default:
- _mesa_problem(ctx, "invalid combine source");
+ /* ARB_texture_env_crossbar source */
+ {
+ const GLuint srcUnit = srcRGB - GL_TEXTURE0;
+ ASSERT(srcUnit < ctx->Const.MaxTextureUnits);
+ if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled)
+ return;
+ argRGB[j] = (const GLchan (*)[4])
+ (texelBuffer + srcUnit * (n * 4 * sizeof(GLchan)));
+ }
}
if (textureUnit->CombineOperandRGB[j] != GL_SRC_COLOR) {
@@ -2208,6 +2962,51 @@ texture_combine(const GLcontext *ctx,
}
}
}
+ }
+
+
+ for (j = 0; j < numAlphaArgs; j++) {
+ const GLenum srcA = textureUnit->CombineSourceA[j];
+
+ switch (srcA) {
+ case GL_TEXTURE:
+ argA[j] = (const GLchan (*)[4])
+ (texelBuffer + unit * (n * 4 * sizeof(GLchan)));
+ break;
+ case GL_PRIMARY_COLOR:
+ argA[j] = primary_rgba;
+ break;
+ case GL_PREVIOUS:
+ argA[j] = (const GLchan (*)[4]) rgba;
+ break;
+ case GL_CONSTANT:
+ {
+ GLchan alpha, (*c)[4] = ccolor[j];
+ UNCLAMPED_FLOAT_TO_CHAN(alpha, textureUnit->EnvColor[3]);
+ for (i = 0; i < n; i++)
+ c[i][ACOMP] = alpha;
+ argA[j] = (const GLchan (*)[4]) ccolor[j];
+ }
+ break;
+ /* GL_ATI_texture_env_combine3 allows GL_ZERO & GL_ONE as sources.
+ */
+ case GL_ZERO:
+ argA[j] = & zero;
+ break;
+ case GL_ONE:
+ argA[j] = & one;
+ break;
+ default:
+ /* ARB_texture_env_crossbar source */
+ {
+ const GLuint srcUnit = srcA - GL_TEXTURE0;
+ ASSERT(srcUnit < ctx->Const.MaxTextureUnits);
+ if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled)
+ return;
+ argA[j] = (const GLchan (*)[4])
+ (texelBuffer + srcUnit * (n * 4 * sizeof(GLchan)));
+ }
+ }
if (textureUnit->CombineOperandA[j] == GL_ONE_MINUS_SRC_ALPHA) {
const GLchan (*src)[4] = argA[j];
@@ -2217,17 +3016,6 @@ texture_combine(const GLcontext *ctx,
dst[i][ACOMP] = CHAN_MAX - src[i][ACOMP];
}
}
-
- if (textureUnit->CombineModeRGB == GL_REPLACE &&
- textureUnit->CombineModeA == GL_REPLACE) {
- break; /* done, we need only arg0 */
- }
-
- if (j == 1 &&
- textureUnit->CombineModeRGB != GL_INTERPOLATE_EXT &&
- textureUnit->CombineModeA != GL_INTERPOLATE_EXT) {
- break; /* arg0 and arg1 are done. we don't need arg2. */
- }
}
/*
@@ -2305,7 +3093,7 @@ texture_combine(const GLcontext *ctx,
}
}
break;
- case GL_ADD_SIGNED_EXT:
+ case GL_ADD_SIGNED:
{
const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0];
const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1];
@@ -2328,7 +3116,7 @@ texture_combine(const GLcontext *ctx,
}
}
break;
- case GL_INTERPOLATE_EXT:
+ case GL_INTERPOLATE:
{
const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0];
const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1];
@@ -2361,7 +3149,7 @@ texture_combine(const GLcontext *ctx,
}
}
break;
- case GL_SUBTRACT_ARB:
+ case GL_SUBTRACT:
{
const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0];
const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1];
@@ -2407,8 +3195,8 @@ texture_combine(const GLcontext *ctx,
}
}
break;
- case GL_DOT3_RGB_ARB:
- case GL_DOT3_RGBA_ARB:
+ case GL_DOT3_RGB:
+ case GL_DOT3_RGBA:
{
/* DO scale the result by 1 2 or 4 */
const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0];
@@ -2418,8 +3206,8 @@ texture_combine(const GLcontext *ctx,
GLchan dot = ((arg0[i][RCOMP]-0.5F) * (arg1[i][RCOMP]-0.5F) +
(arg0[i][GCOMP]-0.5F) * (arg1[i][GCOMP]-0.5F) +
(arg0[i][BCOMP]-0.5F) * (arg1[i][BCOMP]-0.5F))
- * 4.0F;
- dot = CLAMP(dot, 0.0, CHAN_MAXF) * RGBmult;
+ * 4.0F * RGBmult;
+ dot = CLAMP(dot, 0.0, CHAN_MAXF);
#else
GLint dot = (S_PROD((GLint)arg0[i][RCOMP] - half,
(GLint)arg1[i][RCOMP] - half) +
@@ -2427,12 +3215,100 @@ texture_combine(const GLcontext *ctx,
(GLint)arg1[i][GCOMP] - half) +
S_PROD((GLint)arg0[i][BCOMP] - half,
(GLint)arg1[i][BCOMP] - half)) >> 6;
- dot = CLAMP(dot, 0, CHAN_MAX) << RGBshift;
+ dot <<= RGBshift;
+ dot = CLAMP(dot, 0, CHAN_MAX);
#endif
rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = (GLchan) dot;
}
}
break;
+ case GL_MODULATE_ADD_ATI:
+ {
+ const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0];
+ const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1];
+ const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2];
+#if CHAN_TYPE != GL_FLOAT
+ const GLint shift = CHAN_BITS - RGBshift;
+#endif
+ for (i = 0; i < n; i++) {
+#if CHAN_TYPE == GL_FLOAT
+ rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) + arg1[i][RCOMP]) * RGBmult;
+ rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) + arg1[i][GCOMP]) * RGBmult;
+ rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) + arg1[i][BCOMP]) * RGBmult;
+#else
+ GLuint r = (PROD(arg0[i][RCOMP], arg2[i][RCOMP])
+ + ((GLuint) arg1[i][RCOMP] << CHAN_BITS)) >> shift;
+ GLuint g = (PROD(arg0[i][GCOMP], arg2[i][GCOMP])
+ + ((GLuint) arg1[i][GCOMP] << CHAN_BITS)) >> shift;
+ GLuint b = (PROD(arg0[i][BCOMP], arg2[i][BCOMP])
+ + ((GLuint) arg1[i][BCOMP] << CHAN_BITS)) >> shift;
+ 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
+ }
+ }
+ break;
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ {
+ const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0];
+ const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1];
+ const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2];
+#if CHAN_TYPE != GL_FLOAT
+ const GLint shift = CHAN_BITS - RGBshift;
+#endif
+ for (i = 0; i < n; i++) {
+#if CHAN_TYPE == GL_FLOAT
+ rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) + arg1[i][RCOMP] - 0.5) * RGBmult;
+ rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) + arg1[i][GCOMP] - 0.5) * RGBmult;
+ rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) + arg1[i][BCOMP] - 0.5) * RGBmult;
+#else
+ GLint r = (S_PROD(arg0[i][RCOMP], arg2[i][RCOMP])
+ + (((GLint) arg1[i][RCOMP] - half) << CHAN_BITS))
+ >> shift;
+ GLint g = (S_PROD(arg0[i][GCOMP], arg2[i][GCOMP])
+ + (((GLint) arg1[i][GCOMP] - half) << CHAN_BITS))
+ >> shift;
+ GLint b = (S_PROD(arg0[i][BCOMP], arg2[i][BCOMP])
+ + (((GLint) arg1[i][BCOMP] - half) << CHAN_BITS))
+ >> shift;
+ rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX);
+ rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX);
+ rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX);
+#endif
+ }
+ }
+ break;
+ case GL_MODULATE_SUBTRACT_ATI:
+ {
+ const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0];
+ const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1];
+ const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2];
+#if CHAN_TYPE != GL_FLOAT
+ const GLint shift = CHAN_BITS - RGBshift;
+#endif
+ for (i = 0; i < n; i++) {
+#if CHAN_TYPE == GL_FLOAT
+ rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) - arg1[i][RCOMP]) * RGBmult;
+ rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) - arg1[i][GCOMP]) * RGBmult;
+ rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) - arg1[i][BCOMP]) * RGBmult;
+#else
+ GLint r = (S_PROD(arg0[i][RCOMP], arg2[i][RCOMP])
+ - ((GLint) arg1[i][RCOMP] << CHAN_BITS))
+ >> shift;
+ GLint g = (S_PROD(arg0[i][GCOMP], arg2[i][GCOMP])
+ - ((GLint) arg1[i][GCOMP] << CHAN_BITS))
+ >> shift;
+ GLint b = (S_PROD(arg0[i][BCOMP], arg2[i][BCOMP])
+ - ((GLint) arg1[i][BCOMP] << CHAN_BITS))
+ >> shift;
+ rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX);
+ rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX);
+ rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX);
+#endif
+ }
+ }
+ break;
default:
_mesa_problem(ctx, "invalid combine mode");
}
@@ -2489,7 +3365,7 @@ texture_combine(const GLcontext *ctx,
}
}
break;
- case GL_ADD_SIGNED_EXT:
+ case GL_ADD_SIGNED:
{
const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0];
const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1];
@@ -2504,7 +3380,7 @@ texture_combine(const GLcontext *ctx,
}
}
break;
- case GL_INTERPOLATE_EXT:
+ case GL_INTERPOLATE:
{
const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0];
const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1];
@@ -2526,7 +3402,7 @@ texture_combine(const GLcontext *ctx,
}
}
break;
- case GL_SUBTRACT_ARB:
+ case GL_SUBTRACT:
{
const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0];
const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1];
@@ -2540,7 +3416,66 @@ texture_combine(const GLcontext *ctx,
}
}
break;
-
+ case GL_MODULATE_ADD_ATI:
+ {
+ const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0];
+ const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1];
+ const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2];
+#if CHAN_TYPE != GL_FLOAT
+ const GLint shift = CHAN_BITS - Ashift;
+#endif
+ for (i = 0; i < n; i++) {
+#if CHAN_TYPE == GL_FLOAT
+ rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) + arg1[i][ACOMP]) * Amult;
+#else
+ GLuint a = (PROD(arg0[i][ACOMP], arg2[i][ACOMP])
+ + ((GLuint) arg1[i][ACOMP] << CHAN_BITS))
+ >> shift;
+ rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX);
+#endif
+ }
+ }
+ break;
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ {
+ const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0];
+ const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1];
+ const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2];
+#if CHAN_TYPE != GL_FLOAT
+ const GLint shift = CHAN_BITS - Ashift;
+#endif
+ for (i = 0; i < n; i++) {
+#if CHAN_TYPE == GL_FLOAT
+ rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) + arg1[i][ACOMP] - 0.5F) * Amult;
+#else
+ GLint a = (S_PROD(arg0[i][ACOMP], arg2[i][ACOMP])
+ + (((GLint) arg1[i][ACOMP] - half) << CHAN_BITS))
+ >> shift;
+ rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX);
+#endif
+ }
+ }
+ break;
+ case GL_MODULATE_SUBTRACT_ATI:
+ {
+ const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0];
+ const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1];
+ const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2];
+#if CHAN_TYPE != GL_FLOAT
+ const GLint shift = CHAN_BITS - Ashift;
+#endif
+ for (i = 0; i < n; i++) {
+#if CHAN_TYPE == GL_FLOAT
+ rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) - arg1[i][ACOMP]) * Amult;
+#else
+ GLint a = (S_PROD(arg0[i][ACOMP], arg2[i][ACOMP])
+ - ((GLint) arg1[i][ACOMP] << CHAN_BITS))
+ >> shift;
+ rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX);
+#endif
+ }
+ }
+ break;
default:
_mesa_problem(ctx, "invalid combine mode");
}
@@ -2551,7 +3486,7 @@ texture_combine(const GLcontext *ctx,
* GL_DOT3.
*/
if (textureUnit->CombineModeRGB == GL_DOT3_RGBA_EXT ||
- textureUnit->CombineModeRGB == GL_DOT3_RGBA_ARB) {
+ textureUnit->CombineModeRGB == GL_DOT3_RGBA) {
for (i = 0; i < n; i++) {
rgba[i][ACOMP] = rgba[i][RCOMP];
}
@@ -2561,14 +3496,23 @@ texture_combine(const GLcontext *ctx,
#undef PROD
+/**
+ * Implement NVIDIA's GL_NV_texture_env_combine4 extension when
+ * texUnit->EnvMode == GL_COMBINE4_NV.
+ */
+static INLINE void
+texture_combine4( const GLcontext *ctx, GLuint unit, GLuint n,
+ CONST GLchan (*primary_rgba)[4],
+ CONST GLchan *texelBuffer,
+ GLchan (*rgba)[4] )
+{
+}
-/**********************************************************************/
-/* Texture Application */
-/**********************************************************************/
-/*
- * Combine incoming fragment color with texel color to produce output color.
+/**
+ * Apply a conventional OpenGL texture env mode (REPLACE, ADD, BLEND,
+ * MODULATE, or DECAL) to an array of fragments.
* Input: textureUnit - pointer to texture unit to apply
* format - base internal texture format
* n - number of fragments
@@ -2578,7 +3522,7 @@ texture_combine(const GLcontext *ctx,
* according to the texture environment mode.
*/
static void
-apply_texture( const GLcontext *ctx,
+texture_apply( const GLcontext *ctx,
const struct gl_texture_unit *texUnit,
GLuint n,
CONST GLchan primary_rgba[][4], CONST GLchan texel[][4],
@@ -2597,8 +3541,9 @@ apply_texture( const GLcontext *ctx,
format = texUnit->_Current->Image[baseLevel]->Format;
- if (format==GL_COLOR_INDEX || format==GL_DEPTH_COMPONENT) {
- format = GL_RGBA; /* XXXX a hack! */
+ if (format == GL_COLOR_INDEX || format == GL_DEPTH_COMPONENT
+ || format == GL_YCBCR_MESA) {
+ format = GL_RGBA; /* a bit of a hack */
}
switch (texUnit->EnvMode) {
@@ -2657,7 +3602,7 @@ apply_texture( const GLcontext *ctx,
}
break;
default:
- _mesa_problem(ctx, "Bad format (GL_REPLACE) in apply_texture");
+ _mesa_problem(ctx, "Bad format (GL_REPLACE) in texture_apply");
return;
}
break;
@@ -2723,7 +3668,7 @@ apply_texture( const GLcontext *ctx,
}
break;
default:
- _mesa_problem(ctx, "Bad format (GL_MODULATE) in apply_texture");
+ _mesa_problem(ctx, "Bad format (GL_MODULATE) in texture_apply");
return;
}
break;
@@ -2756,7 +3701,7 @@ apply_texture( const GLcontext *ctx,
}
break;
default:
- _mesa_problem(ctx, "Bad format (GL_DECAL) in apply_texture");
+ _mesa_problem(ctx, "Bad format (GL_DECAL) in texture_apply");
return;
}
break;
@@ -2826,7 +3771,7 @@ apply_texture( const GLcontext *ctx,
}
break;
default:
- _mesa_problem(ctx, "Bad format (GL_BLEND) in apply_texture");
+ _mesa_problem(ctx, "Bad format (GL_BLEND) in texture_apply");
return;
}
break;
@@ -2903,351 +3848,109 @@ apply_texture( const GLcontext *ctx,
}
break;
default:
- _mesa_problem(ctx, "Bad format (GL_ADD) in apply_texture");
+ _mesa_problem(ctx, "Bad format (GL_ADD) in texture_apply");
return;
}
break;
- case GL_COMBINE_EXT:
- texture_combine(ctx, texUnit, n, primary_rgba, texel, rgba);
- break;
-
default:
- _mesa_problem(ctx, "Bad env mode in apply_texture");
+ _mesa_problem(ctx, "Bad env mode in texture_apply");
return;
}
}
-/*
- * Sample a shadow/depth texture.
- * Input: ctx - context
- * texUnit - the texture unit
- * n - number of samples
- * s,t,r - array [n] of texture coordinates
- * In/Out: rgba - array [n] of texel colors.
+/**
+ * Apply texture mapping to a span of fragments.
*/
-static void
-sample_depth_texture(const GLcontext *ctx,
- const struct gl_texture_unit *texUnit,
- GLuint n,
- const GLfloat s[], const GLfloat t[], const GLfloat r[],
- GLchan texel[][4])
+void
+_swrast_texture_span( GLcontext *ctx, struct sw_span *span )
{
- const struct gl_texture_object *texObj = texUnit->_Current;
- const GLint baseLevel = texObj->BaseLevel;
- const struct gl_texture_image *texImage = texObj->Image[baseLevel];
- const GLuint width = texImage->Width;
- const GLuint height = texImage->Height;
- const GLchan ambient = texObj->ShadowAmbient;
- GLboolean lequal, gequal;
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLchan primary_rgba[MAX_WIDTH][4];
+ GLuint unit;
- if (texObj->Target != GL_TEXTURE_2D) {
- _mesa_problem(ctx, "only 2-D depth textures supported at this time");
- return;
- }
+ ASSERT(span->end < MAX_WIDTH);
+ ASSERT(span->arrayMask & SPAN_TEXTURE);
- if (texObj->MinFilter != texObj->MagFilter) {
- _mesa_problem(ctx, "mipmapped depth textures not supported at this time");
- return;
- }
-
- /* XXX the GL_SGIX_shadow extension spec doesn't say what to do if
- * GL_TEXTURE_COMPARE_SGIX == GL_TRUE but the current texture object
- * isn't a depth texture.
+ /*
+ * Save copy of the incoming fragment colors (the GL_PRIMARY_COLOR)
*/
- if (texImage->Format != GL_DEPTH_COMPONENT) {
- _mesa_problem(ctx,"GL_TEXTURE_COMPARE_SGIX enabled with non-depth texture");
- return;
- }
-
- if (texObj->CompareOperator == GL_TEXTURE_LEQUAL_R_SGIX) {
- lequal = GL_TRUE;
- gequal = GL_FALSE;
- }
- else {
- lequal = GL_FALSE;
- gequal = GL_TRUE;
- }
+ if (swrast->_AnyTextureCombine)
+ MEMCPY(primary_rgba, span->array->rgba, 4 * span->end * sizeof(GLchan));
- if (texObj->MagFilter == GL_NEAREST) {
- GLuint i;
- for (i = 0; i < n; i++) {
- GLfloat depthSample;
- GLint col, row;
- COMPUTE_NEAREST_TEXEL_LOCATION(texObj->WrapS, s[i], width, col);
- COMPUTE_NEAREST_TEXEL_LOCATION(texObj->WrapT, t[i], height, row);
- depthSample = *((const GLfloat *) texImage->Data + row * width + col);
- if ((r[i] <= depthSample && lequal) ||
- (r[i] >= depthSample && gequal)) {
- texel[i][RCOMP] = CHAN_MAX;
- texel[i][GCOMP] = CHAN_MAX;
- texel[i][BCOMP] = CHAN_MAX;
- texel[i][ACOMP] = CHAN_MAX;
- }
- else {
- texel[i][RCOMP] = ambient;
- texel[i][GCOMP] = ambient;
- texel[i][BCOMP] = ambient;
- texel[i][ACOMP] = CHAN_MAX;
- }
- }
- }
- else {
- GLuint i;
- ASSERT(texObj->MagFilter == GL_LINEAR);
- for (i = 0; i < n; i++) {
- GLfloat depth00, depth01, depth10, depth11;
- GLint i0, i1, j0, j1;
- GLfloat u, v;
- GLuint useBorderTexel;
-
- COMPUTE_LINEAR_TEXEL_LOCATIONS(texObj->WrapS, s[i], u, width, i0, i1);
- COMPUTE_LINEAR_TEXEL_LOCATIONS(texObj->WrapT, t[i], v, height,j0, j1);
-
- useBorderTexel = 0;
- if (texImage->Border) {
- i0 += texImage->Border;
- i1 += texImage->Border;
- j0 += texImage->Border;
- j1 += texImage->Border;
- }
- else {
- if (i0 < 0 || i0 >= (GLint) width) useBorderTexel |= I0BIT;
- if (i1 < 0 || i1 >= (GLint) width) useBorderTexel |= I1BIT;
- if (j0 < 0 || j0 >= (GLint) height) useBorderTexel |= J0BIT;
- if (j1 < 0 || j1 >= (GLint) height) useBorderTexel |= J1BIT;
- }
-
- /* get four depth samples from the texture */
- if (useBorderTexel & (I0BIT | J0BIT)) {
- depth00 = 1.0;
- }
- else {
- depth00 = *((const GLfloat *) texImage->Data + j0 * width + i0);
- }
- if (useBorderTexel & (I1BIT | J0BIT)) {
- depth10 = 1.0;
- }
- else {
- depth10 = *((const GLfloat *) texImage->Data + j0 * width + i1);
- }
- if (useBorderTexel & (I0BIT | J1BIT)) {
- depth01 = 1.0;
- }
- else {
- depth01 = *((const GLfloat *) texImage->Data + j1 * width + i0);
- }
- if (useBorderTexel & (I1BIT | J1BIT)) {
- depth11 = 1.0;
- }
- else {
- depth11 = *((const GLfloat *) texImage->Data + j1 * width + i1);
- }
-
- if (0) {
- /* compute a single weighted depth sample and do one comparison */
- const GLfloat a = FRAC(u + 1.0F);
- const GLfloat b = FRAC(v + 1.0F);
- const GLfloat w00 = (1.0F - a) * (1.0F - b);
- const GLfloat w10 = ( a) * (1.0F - b);
- const GLfloat w01 = (1.0F - a) * ( b);
- const GLfloat w11 = ( a) * ( b);
- const GLfloat depthSample = w00 * depth00 + w10 * depth10
- + w01 * depth01 + w11 * depth11;
- if ((depthSample <= r[i] && lequal) ||
- (depthSample >= r[i] && gequal)) {
- texel[i][RCOMP] = ambient;
- texel[i][GCOMP] = ambient;
- texel[i][BCOMP] = ambient;
- texel[i][ACOMP] = CHAN_MAX;
- }
- else {
- texel[i][RCOMP] = CHAN_MAX;
- texel[i][GCOMP] = CHAN_MAX;
- texel[i][BCOMP] = CHAN_MAX;
- texel[i][ACOMP] = CHAN_MAX;
- }
- }
- else {
- /* Do four depth/R comparisons and compute a weighted result.
- * If this touches on somebody's I.P., I'll remove this code
- * upon request.
- */
- const GLfloat d = (CHAN_MAXF - (GLfloat) ambient) * 0.25F;
- GLfloat luminance = CHAN_MAXF;
- GLchan lum;
- if (lequal) {
- if (depth00 <= r[i]) luminance -= d;
- if (depth01 <= r[i]) luminance -= d;
- if (depth10 <= r[i]) luminance -= d;
- if (depth11 <= r[i]) luminance -= d;
- }
- else {
- if (depth00 >= r[i]) luminance -= d;
- if (depth01 >= r[i]) luminance -= d;
- if (depth10 >= r[i]) luminance -= d;
- if (depth11 >= r[i]) luminance -= d;
- }
- lum = (GLchan) luminance;
- texel[i][RCOMP] = lum;
- texel[i][GCOMP] = lum;
- texel[i][BCOMP] = lum;
- texel[i][ACOMP] = CHAN_MAX;
- }
- }
- }
-}
-
-
-#if 0
-/*
- * Experimental depth texture sampling function.
- */
-static void
-sample_depth_texture2(const GLcontext *ctx,
- const struct gl_texture_unit *texUnit,
- GLuint n,
- const GLfloat s[], const GLfloat t[], const GLfloat r[],
- GLchan texel[][4])
-{
- const struct gl_texture_object *texObj = texUnit->_Current;
- const GLint baseLevel = texObj->BaseLevel;
- const struct gl_texture_image *texImage = texObj->Image[baseLevel];
- const GLuint width = texImage->Width;
- const GLuint height = texImage->Height;
- const GLchan ambient = texObj->ShadowAmbient;
- GLboolean lequal, gequal;
-
- if (texObj->Dimensions != 2) {
- _mesa_problem(ctx, "only 2-D depth textures supported at this time");
- return;
- }
-
- if (texObj->MinFilter != texObj->MagFilter) {
- _mesa_problem(ctx, "mipmapped depth textures not supported at this time");
- return;
- }
-
- /* XXX the GL_SGIX_shadow extension spec doesn't say what to do if
- * GL_TEXTURE_COMPARE_SGIX == GL_TRUE but the current texture object
- * isn't a depth texture.
+ /*
+ * Must do all texture sampling before combining in order to
+ * accomodate GL_ARB_texture_env_crossbar.
*/
- if (texImage->Format != GL_DEPTH_COMPONENT) {
- _mesa_problem(ctx,"GL_TEXTURE_COMPARE_SGIX enabled with non-depth texture");
- return;
- }
-
- if (texObj->CompareOperator == GL_TEXTURE_LEQUAL_R_SGIX) {
- lequal = GL_TRUE;
- gequal = GL_FALSE;
- }
- else {
- lequal = GL_FALSE;
- gequal = GL_TRUE;
- }
-
- {
- GLuint i;
- for (i = 0; i < n; i++) {
- const GLint K = 3;
- GLint col, row, ii, jj, imin, imax, jmin, jmax, samples, count;
- GLfloat w;
- GLchan lum;
- COMPUTE_NEAREST_TEXEL_LOCATION(texObj->WrapS, s[i], width, col);
- COMPUTE_NEAREST_TEXEL_LOCATION(texObj->WrapT, t[i], height, row);
-
- imin = col - K;
- imax = col + K;
- jmin = row - K;
- jmax = row + K;
-
- if (imin < 0) imin = 0;
- if (imax >= width) imax = width - 1;
- if (jmin < 0) jmin = 0;
- if (jmax >= height) jmax = height - 1;
-
- samples = (imax - imin + 1) * (jmax - jmin + 1);
- count = 0;
- for (jj = jmin; jj <= jmax; jj++) {
- for (ii = imin; ii <= imax; ii++) {
- GLfloat depthSample = *((const GLfloat *) texImage->Data
- + jj * width + ii);
- if ((depthSample <= r[i] && lequal) ||
- (depthSample >= r[i] && gequal)) {
- count++;
- }
- }
- }
-
- w = (GLfloat) count / (GLfloat) samples;
- w = CHAN_MAXF - w * (CHAN_MAXF - (GLfloat) ambient);
- lum = (GLint) w;
-
- texel[i][RCOMP] = lum;
- texel[i][GCOMP] = lum;
- texel[i][BCOMP] = lum;
- texel[i][ACOMP] = CHAN_MAX;
- }
- }
-}
-#endif
-
-
-/*
- * Apply a unit of texture mapping to the incoming fragments.
- */
-void
-_swrast_texture_fragments( GLcontext *ctx, GLuint texUnit, GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat r[], GLfloat lambda[],
- CONST GLchan primary_rgba[][4], GLchan rgba[][4] )
-{
- const GLuint mask = TEXTURE0_ANY << (texUnit * NUM_TEXTURE_TARGETS);
-
- if (ctx->Texture._ReallyEnabled & mask) {
- const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit];
-
- if (textureUnit->_Current) { /* XXX need this? */
- GLchan texel[PB_SIZE][4];
-
- if (lambda) {
- if (textureUnit->LodBias != 0.0F) {
+ for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
+ if (ctx->Texture.Unit[unit]._ReallyEnabled) {
+ const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ const struct gl_texture_object *curObj = texUnit->_Current;
+ GLfloat *lambda = span->array->lambda[unit];
+ GLchan (*texels)[4] = (GLchan (*)[4])
+ (swrast->TexelBuffer + unit * (span->end * 4 * sizeof(GLchan)));
+
+ /* adjust texture lod (lambda) */
+ if (span->arrayMask | SPAN_LAMBDA) {
+ if (texUnit->LodBias != 0.0F) {
/* apply LOD bias, but don't clamp yet */
GLuint i;
- for (i=0;i<n;i++) {
- lambda[i] += textureUnit->LodBias;
+ for (i = 0; i < span->end; i++) {
+ lambda[i] += texUnit->LodBias;
}
}
- if (textureUnit->_Current->MinLod != -1000.0 ||
- textureUnit->_Current->MaxLod != 1000.0) {
+ if (curObj->MinLod != -1000.0 || curObj->MaxLod != 1000.0) {
/* apply LOD clamping to lambda */
- const GLfloat min = textureUnit->_Current->MinLod;
- const GLfloat max = textureUnit->_Current->MaxLod;
+ const GLfloat min = curObj->MinLod;
+ const GLfloat max = curObj->MaxLod;
GLuint i;
- for (i=0;i<n;i++) {
+ for (i = 0; i < span->end; i++) {
GLfloat l = lambda[i];
lambda[i] = CLAMP(l, min, max);
}
}
}
- /* Sample the texture. */
- if (textureUnit->_Current->CompareFlag) {
- /* depth texture */
- sample_depth_texture(ctx, textureUnit, n, s, t, r, texel);
+ /* Sample the texture (span->end fragments) */
+ swrast->TextureSample[unit]( ctx, unit, texUnit->_Current,
+ span->end, span->array->texcoords[unit],
+ lambda, texels );
+ }
+ }
+
+ /*
+ * OK, now apply the texture (aka texture combine/blend).
+ * We modify the span->color.rgba values.
+ */
+ for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
+ if (ctx->Texture.Unit[unit]._ReallyEnabled) {
+ const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ if (texUnit->EnvMode == GL_COMBINE) {
+ /* GL_ARB/EXT_texture_env_combine */
+ texture_combine( ctx, unit, span->end,
+ (CONST GLchan (*)[4]) primary_rgba,
+ swrast->TexelBuffer,
+ span->array->rgba );
+ }
+ else if (texUnit->EnvMode == GL_COMBINE4_NV) {
+ /* GL_NV_texture_env_combine4 */
+ texture_combine4( ctx, unit, span->end,
+ (CONST GLchan (*)[4]) primary_rgba,
+ swrast->TexelBuffer,
+ span->array->rgba );
}
else {
- /* color texture */
- SWRAST_CONTEXT(ctx)->TextureSample[texUnit]( ctx, texUnit,
- textureUnit->_Current,
- n, s, t, r,
- lambda, texel );
- }
- apply_texture( ctx, textureUnit, n, primary_rgba,
- (const GLchan (*)[4]) texel, rgba );
+ /* conventional texture blend */
+ const GLchan (*texels)[4] = (const GLchan (*)[4])
+ (swrast->TexelBuffer + unit *
+ (span->end * 4 * sizeof(GLchan)));
+ texture_apply( ctx, texUnit, span->end,
+ (CONST GLchan (*)[4]) primary_rgba, texels,
+ span->array->rgba );
+ }
}
}
}
diff --git a/xc/extras/Mesa/src/swrast/s_texture.h b/xc/extras/Mesa/src/swrast/s_texture.h
index c1b792094..0157071f1 100644
--- a/xc/extras/Mesa/src/swrast/s_texture.h
+++ b/xc/extras/Mesa/src/swrast/s_texture.h
@@ -1,10 +1,9 @@
-/* $Id: s_texture.h,v 1.1.1.1 2002/10/22 13:06:51 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -40,10 +39,6 @@ _swrast_choose_texture_sample_func( GLcontext *ctx,
extern void
-_swrast_texture_fragments( GLcontext *ctx, GLuint texSet, GLuint n,
- const GLfloat s[], const GLfloat t[],
- const GLfloat r[], GLfloat lambda[],
- CONST GLchan primary_rgba[][4], GLchan rgba[][4] );
-
+_swrast_texture_span( GLcontext *ctx, struct sw_span *span );
#endif
diff --git a/xc/extras/Mesa/src/swrast/s_triangle.c b/xc/extras/Mesa/src/swrast/s_triangle.c
index ad9e77926..a4efb679f 100644
--- a/xc/extras/Mesa/src/swrast/s_triangle.c
+++ b/xc/extras/Mesa/src/swrast/s_triangle.c
@@ -1,10 +1,9 @@
-/* $Id: s_triangle.c,v 1.1.1.1 2002/10/22 13:06:48 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.2
+ * Version: 5.0
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -34,8 +33,8 @@
#include "glheader.h"
#include "context.h"
#include "colormac.h"
+#include "imports.h"
#include "macros.h"
-#include "mem.h"
#include "mmath.h"
#include "texformat.h"
#include "teximage.h"
@@ -47,10 +46,11 @@
#include "s_feedback.h"
#include "s_span.h"
#include "s_triangle.h"
-#include "s_trispan.h"
-
+/*
+ * Just used for feedback mode.
+ */
GLboolean _mesa_cull_triangle( GLcontext *ctx,
const SWvertex *v0,
const SWvertex *v1,
@@ -81,18 +81,12 @@ static void flat_ci_triangle( GLcontext *ctx,
#define INTERP_Z 1
#define INTERP_FOG 1
-#define RENDER_SPAN( span ) \
- GLdepth zSpan[MAX_WIDTH]; \
- GLfloat fogSpan[MAX_WIDTH]; \
- GLuint i; \
- for (i = 0; i < span.count; i++) { \
- zSpan[i] = FixedToDepth(span.z); \
- span.z += span.zStep; \
- fogSpan[i] = span.fog; \
- span.fog += span.fogStep; \
- } \
- _mesa_write_monoindex_span(ctx, span.count, span.x, span.y, \
- zSpan, fogSpan, v2->index, NULL, GL_POLYGON );
+#define SETUP_CODE \
+ span.interpMask |= SPAN_INDEX; \
+ span.index = IntToFixed(v2->index); \
+ span.indexStep = 0;
+
+#define RENDER_SPAN( span ) _mesa_write_index_span(ctx, &span);
#include "s_tritemp.h"
}
@@ -111,21 +105,7 @@ static void smooth_ci_triangle( GLcontext *ctx,
#define INTERP_FOG 1
#define INTERP_INDEX 1
-#define RENDER_SPAN( span ) \
- GLdepth zSpan[MAX_WIDTH]; \
- GLfloat fogSpan[MAX_WIDTH]; \
- GLuint indexSpan[MAX_WIDTH]; \
- GLuint i; \
- for (i = 0; i < span.count; i++) { \
- zSpan[i] = FixedToDepth(span.z); \
- span.z += span.zStep; \
- indexSpan[i] = FixedToInt(span.index); \
- span.index += span.indexStep; \
- fogSpan[i] = span.fog; \
- span.fog += span.fogStep; \
- } \
- _mesa_write_index_span(ctx, span.count, span.x, span.y, \
- zSpan, fogSpan, indexSpan, NULL, GL_POLYGON);
+#define RENDER_SPAN( span ) _mesa_write_index_span(ctx, &span);
#include "s_tritemp.h"
}
@@ -144,23 +124,22 @@ static void flat_rgba_triangle( GLcontext *ctx,
#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
-#define RENDER_SPAN( span ) \
- GLdepth zSpan[MAX_WIDTH]; \
- GLfloat fogSpan[MAX_WIDTH]; \
- GLuint i; \
- for (i = 0; i < span.count; i++) { \
- zSpan[i] = FixedToDepth(span.z); \
- span.z += span.zStep; \
- fogSpan[i] = span.fog; \
- span.fog += span.fogStep; \
- } \
- _mesa_write_monocolor_span(ctx, span.count, span.x, span.y, zSpan, \
- fogSpan, v2->color, NULL, GL_POLYGON );
+#define SETUP_CODE \
+ ASSERT(ctx->Texture._EnabledUnits == 0); \
+ ASSERT(ctx->Light.ShadeModel==GL_FLAT); \
+ span.interpMask |= SPAN_RGBA; \
+ span.red = ChanToFixed(v2->color[0]); \
+ span.green = ChanToFixed(v2->color[1]); \
+ span.blue = ChanToFixed(v2->color[2]); \
+ span.alpha = ChanToFixed(v2->color[3]); \
+ span.redStep = 0; \
+ span.greenStep = 0; \
+ span.blueStep = 0; \
+ span.alphaStep = 0;
+
+#define RENDER_SPAN( span ) _mesa_write_rgba_span(ctx, &span);
#include "s_tritemp.h"
-
- ASSERT(!ctx->Texture._ReallyEnabled); /* texturing must be off */
- ASSERT(ctx->Light.ShadeModel==GL_FLAT);
}
@@ -180,33 +159,17 @@ static void smooth_rgba_triangle( GLcontext *ctx,
#define INTERP_RGB 1
#define INTERP_ALPHA 1
-#define RENDER_SPAN( span ) \
- GLdepth zSpan[MAX_WIDTH]; \
- GLchan rgbaSpan[MAX_WIDTH][4]; \
- GLfloat fogSpan[MAX_WIDTH]; \
- GLuint i; \
- for (i = 0; i < span.count; i++) { \
- rgbaSpan[i][RCOMP] = FixedToChan(span.red); \
- rgbaSpan[i][GCOMP] = FixedToChan(span.green); \
- rgbaSpan[i][BCOMP] = FixedToChan(span.blue); \
- rgbaSpan[i][ACOMP] = FixedToChan(span.alpha); \
- span.red += span.redStep; \
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
- span.alpha += span.alphaStep; \
- zSpan[i] = FixedToDepth(span.z); \
- span.z += span.zStep; \
- fogSpan[i] = span.fog; \
- span.fog += span.fogStep; \
- } \
- _mesa_write_rgba_span(ctx, span.count, span.x, span.y, \
- (CONST GLdepth *) zSpan, \
- fogSpan, rgbaSpan, NULL, GL_POLYGON);
+#define SETUP_CODE \
+ { \
+ /* texturing must be off */ \
+ ASSERT(ctx->Texture._EnabledUnits == 0); \
+ ASSERT(ctx->Light.ShadeModel==GL_SMOOTH); \
+ }
+
+#define RENDER_SPAN( span ) _mesa_write_rgba_span(ctx, &span);
#include "s_tritemp.h"
- ASSERT(!ctx->Texture._ReallyEnabled); /* texturing must be off */
- ASSERT(ctx->Light.ShadeModel==GL_SMOOTH);
}
@@ -228,7 +191,7 @@ static void simple_textured_triangle( GLcontext *ctx,
#define SETUP_CODE \
SWcontext *swrast = SWRAST_CONTEXT(ctx); \
struct gl_texture_object *obj = ctx->Texture.Unit[0].Current2D; \
- GLint b = obj->BaseLevel; \
+ const GLint b = obj->BaseLevel; \
const GLfloat twidth = (GLfloat) obj->Image[b]->Width; \
const GLfloat theight = (GLfloat) obj->Image[b]->Height; \
const GLint twidth_log2 = obj->Image[b]->WidthLog2; \
@@ -241,23 +204,23 @@ static void simple_textured_triangle( GLcontext *ctx,
}
#define RENDER_SPAN( span ) \
- GLchan rgbSpan[MAX_WIDTH][3]; \
GLuint i; \
span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \
span.intTex[1] -= FIXED_HALF; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
GLint s = FixedToInt(span.intTex[0]) & smask; \
GLint t = FixedToInt(span.intTex[1]) & tmask; \
GLint pos = (t << twidth_log2) + s; \
pos = pos + pos + pos; /* multiply by 3 */ \
- rgbSpan[i][RCOMP] = texture[pos]; \
- rgbSpan[i][GCOMP] = texture[pos+1]; \
- rgbSpan[i][BCOMP] = texture[pos+2]; \
+ span.array->rgb[i][RCOMP] = texture[pos]; \
+ span.array->rgb[i][GCOMP] = texture[pos+1]; \
+ span.array->rgb[i][BCOMP] = texture[pos+2]; \
span.intTex[0] += span.intTexStep[0]; \
span.intTex[1] += span.intTexStep[1]; \
} \
- (*swrast->Driver.WriteRGBSpan)(ctx, span.count, span.x, span.y, \
- (CONST GLchan (*)[3]) rgbSpan, NULL );
+ (*swrast->Driver.WriteRGBSpan)(ctx, span.end, span.x, span.y, \
+ (CONST GLchan (*)[3]) span.array->rgb,\
+ NULL );
#include "s_tritemp.h"
}
@@ -284,46 +247,45 @@ static void simple_z_textured_triangle( GLcontext *ctx,
#define SETUP_CODE \
SWcontext *swrast = SWRAST_CONTEXT(ctx); \
struct gl_texture_object *obj = ctx->Texture.Unit[0].Current2D; \
- GLint b = obj->BaseLevel; \
- GLfloat twidth = (GLfloat) obj->Image[b]->Width; \
- GLfloat theight = (GLfloat) obj->Image[b]->Height; \
- GLint twidth_log2 = obj->Image[b]->WidthLog2; \
+ const GLint b = obj->BaseLevel; \
+ const GLfloat twidth = (GLfloat) obj->Image[b]->Width; \
+ const GLfloat theight = (GLfloat) obj->Image[b]->Height; \
+ const GLint twidth_log2 = obj->Image[b]->WidthLog2; \
const GLchan *texture = (const GLchan *) obj->Image[b]->Data; \
- GLint smask = obj->Image[b]->Width - 1; \
- GLint tmask = obj->Image[b]->Height - 1; \
+ const GLint smask = obj->Image[b]->Width - 1; \
+ const GLint tmask = obj->Image[b]->Height - 1; \
if (!texture) { \
/* this shouldn't happen */ \
return; \
}
#define RENDER_SPAN( span ) \
- GLchan rgbSpan[MAX_WIDTH][3]; \
- GLubyte mask[MAX_WIDTH]; \
GLuint i; \
span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \
span.intTex[1] -= FIXED_HALF; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
const GLdepth z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
GLint s = FixedToInt(span.intTex[0]) & smask; \
GLint t = FixedToInt(span.intTex[1]) & tmask; \
GLint pos = (t << twidth_log2) + s; \
pos = pos + pos + pos; /* multiply by 3 */ \
- rgbSpan[i][RCOMP] = texture[pos]; \
- rgbSpan[i][GCOMP] = texture[pos+1]; \
- rgbSpan[i][BCOMP] = texture[pos+2]; \
+ span.array->rgb[i][RCOMP] = texture[pos]; \
+ span.array->rgb[i][GCOMP] = texture[pos+1]; \
+ span.array->rgb[i][BCOMP] = texture[pos+2]; \
zRow[i] = z; \
- mask[i] = 1; \
+ span.array->mask[i] = 1; \
} \
else { \
- mask[i] = 0; \
+ span.array->mask[i] = 0; \
} \
span.intTex[0] += span.intTexStep[0]; \
span.intTex[1] += span.intTexStep[1]; \
span.z += span.zStep; \
} \
- (*swrast->Driver.WriteRGBSpan)(ctx, span.count, span.x, span.y, \
- (CONST GLchan (*)[3]) rgbSpan, mask );
+ (*swrast->Driver.WriteRGBSpan)(ctx, span.end, span.x, span.y, \
+ (CONST GLchan (*)[3]) span.array->rgb,\
+ span.array->mask );
#include "s_tritemp.h"
}
@@ -341,7 +303,6 @@ struct affine_info
const GLchan *texture;
GLfixed er, eg, eb, ea;
GLint tbytesline, tsize;
- GLint fixedToDepthShift;
};
@@ -349,8 +310,8 @@ struct affine_info
* textures with GL_REPLACE, GL_MODULATE, GL_BLEND, GL_DECAL or GL_ADD
* texture env modes.
*/
-static void
-affine_span(GLcontext *ctx, struct triangle_span *span,
+static INLINE void
+affine_span(GLcontext *ctx, struct sw_span *span,
struct affine_info *info)
{
GLchan sample[4]; /* the filtered texture sample */
@@ -388,7 +349,7 @@ affine_span(GLcontext *ctx, struct triangle_span *span,
sample[ACOMP] = (ti * (si * tex00[3] + sf * tex01[3]) + \
tf * (si * tex10[3] + sf * tex11[3])) >> 2 * FIXED_SHIFT
-#define MODULATE \
+#define MODULATE \
dest[RCOMP] = span->red * (sample[RCOMP] + 1u) >> (FIXED_SHIFT + 8); \
dest[GCOMP] = span->green * (sample[GCOMP] + 1u) >> (FIXED_SHIFT + 8); \
dest[BCOMP] = span->blue * (sample[BCOMP] + 1u) >> (FIXED_SHIFT + 8); \
@@ -440,17 +401,13 @@ affine_span(GLcontext *ctx, struct triangle_span *span,
#define NEAREST_RGBA_REPLACE COPY_CHAN4(dest, tex00)
#define SPAN_NEAREST(DO_TEX,COMP) \
- for (i = 0; i < span->count; i++) { \
+ for (i = 0; i < span->end; i++) { \
/* Isn't it necessary to use FixedFloor below?? */ \
GLint s = FixedToInt(span->intTex[0]) & info->smask; \
GLint t = FixedToInt(span->intTex[1]) & info->tmask; \
GLint pos = (t << info->twidth_log2) + s; \
const GLchan *tex00 = info->texture + COMP * pos; \
- zspan[i] = FixedToDepth(span->z); \
- fogspan[i] = span->fog; \
DO_TEX; \
- span->fog += span->fogStep; \
- span->z += span->zStep; \
span->red += span->redStep; \
span->green += span->greenStep; \
span->blue += span->blueStep; \
@@ -461,7 +418,7 @@ affine_span(GLcontext *ctx, struct triangle_span *span,
}
#define SPAN_LINEAR(DO_TEX,COMP) \
- for (i = 0; i < span->count; i++) { \
+ for (i = 0; i < span->end; i++) { \
/* Isn't it necessary to use FixedFloor below?? */ \
GLint s = FixedToInt(span->intTex[0]) & info->smask; \
GLint t = FixedToInt(span->intTex[1]) & info->tmask; \
@@ -484,11 +441,7 @@ affine_span(GLcontext *ctx, struct triangle_span *span,
tex01 -= info->tbytesline; \
tex11 -= info->tbytesline; \
} \
- zspan[i] = FixedToDepth(span->z); \
- fogspan[i] = span->fog; \
DO_TEX; \
- span->fog += span->fogStep; \
- span->z += span->zStep; \
span->red += span->redStep; \
span->green += span->greenStep; \
span->blue += span->blueStep; \
@@ -498,14 +451,9 @@ affine_span(GLcontext *ctx, struct triangle_span *span,
dest += 4; \
}
-#define FixedToDepth(F) ((F) >> fixedToDepthShift)
GLuint i;
- GLdepth zspan[MAX_WIDTH];
- GLfloat fogspan[MAX_WIDTH];
- GLchan rgba[MAX_WIDTH][4];
- GLchan *dest = rgba[0];
- const GLint fixedToDepthShift = info->fixedToDepthShift;
+ GLchan *dest = span->array->rgba[0];
span->intTex[0] -= FIXED_HALF;
span->intTex[1] -= FIXED_HALF;
@@ -528,7 +476,8 @@ affine_span(GLcontext *ctx, struct triangle_span *span,
SPAN_NEAREST(NEAREST_RGB;ADD,3);
break;
default:
- abort();
+ _mesa_problem(ctx, "bad tex env mode in SPAN_LINEAR");
+ return;
}
break;
case GL_RGBA:
@@ -549,7 +498,8 @@ affine_span(GLcontext *ctx, struct triangle_span *span,
SPAN_NEAREST(NEAREST_RGBA_REPLACE,4);
break;
default:
- abort();
+ _mesa_problem(ctx, "bad tex env mode (2) in SPAN_LINEAR");
+ return;
}
break;
}
@@ -575,7 +525,8 @@ affine_span(GLcontext *ctx, struct triangle_span *span,
SPAN_LINEAR(LINEAR_RGB;ADD,3);
break;
default:
- abort();
+ _mesa_problem(ctx, "bad tex env mode (3) in SPAN_LINEAR");
+ return;
}
break;
case GL_RGBA:
@@ -596,17 +547,19 @@ affine_span(GLcontext *ctx, struct triangle_span *span,
SPAN_LINEAR(LINEAR_RGBA;REPLACE,4);
break;
default:
- abort();
- } break;
+ _mesa_problem(ctx, "bad tex env mode (4) in SPAN_LINEAR");
+ return;
+ }
+ break;
}
break;
}
- _mesa_write_rgba_span(ctx, span->count, span->x, span->y,
- zspan, fogspan, rgba, NULL, GL_POLYGON);
+ span->interpMask &= ~SPAN_RGBA;
+ ASSERT(span->arrayMask & SPAN_RGBA);
+ _mesa_write_rgba_span(ctx, span);
#undef SPAN_NEAREST
#undef SPAN_LINEAR
-#undef FixedToDepth
}
@@ -632,10 +585,9 @@ static void affine_textured_triangle( GLcontext *ctx,
struct affine_info info; \
struct gl_texture_unit *unit = ctx->Texture.Unit+0; \
struct gl_texture_object *obj = unit->Current2D; \
- GLint b = obj->BaseLevel; \
- GLfloat twidth = (GLfloat) obj->Image[b]->Width; \
- GLfloat theight = (GLfloat) obj->Image[b]->Height; \
- info.fixedToDepthShift = ctx->Visual.depthBits <= 16 ? FIXED_SHIFT : 0;\
+ const GLint b = obj->BaseLevel; \
+ const GLfloat twidth = (GLfloat) obj->Image[b]->Width; \
+ const GLfloat theight = (GLfloat) obj->Image[b]->Height; \
info.texture = (const GLchan *) obj->Image[b]->Data; \
info.twidth_log2 = obj->Image[b]->WidthLog2; \
info.smask = obj->Image[b]->Width - 1; \
@@ -643,6 +595,7 @@ static void affine_textured_triangle( GLcontext *ctx,
info.format = obj->Image[b]->Format; \
info.filter = obj->MinFilter; \
info.envmode = unit->EnvMode; \
+ span.arrayMask |= SPAN_RGBA; \
\
if (info.envmode == GL_BLEND) { \
/* potential off-by-one error here? (1.0f -> 2048 -> 0) */ \
@@ -695,12 +648,11 @@ struct persp_info
const GLchan *texture;
GLfixed er, eg, eb, ea; /* texture env color */
GLint tbytesline, tsize;
- GLint fixedToDepthShift;
};
-static void
-fast_persp_span(GLcontext *ctx, struct triangle_span *span,
+static INLINE void
+fast_persp_span(GLcontext *ctx, struct sw_span *span,
struct persp_info *info)
{
GLchan sample[4]; /* the filtered texture sample */
@@ -711,7 +663,7 @@ fast_persp_span(GLcontext *ctx, struct triangle_span *span,
* unused variables (for instance tf,sf,ti,si in case of GL_NEAREST).
*/
#define SPAN_NEAREST(DO_TEX,COMP) \
- for (i = 0; i < span->count; i++) { \
+ for (i = 0; i < span->end; i++) { \
GLdouble invQ = tex_coord[2] ? \
(1.0 / tex_coord[2]) : 1.0; \
GLfloat s_tmp = (GLfloat) (tex_coord[0] * invQ); \
@@ -720,11 +672,7 @@ fast_persp_span(GLcontext *ctx, struct triangle_span *span,
GLint t = IFLOOR(t_tmp) & info->tmask; \
GLint pos = (t << info->twidth_log2) + s; \
const GLchan *tex00 = info->texture + COMP * pos; \
- zspan[i] = FixedToDepth(span->z); \
- fogspan[i] = span->fog; \
DO_TEX; \
- span->fog += span->fogStep; \
- span->z += span->zStep; \
span->red += span->redStep; \
span->green += span->greenStep; \
span->blue += span->blueStep; \
@@ -736,7 +684,7 @@ fast_persp_span(GLcontext *ctx, struct triangle_span *span,
}
#define SPAN_LINEAR(DO_TEX,COMP) \
- for (i = 0; i < span->count; i++) { \
+ for (i = 0; i < span->end; i++) { \
GLdouble invQ = tex_coord[2] ? \
(1.0 / tex_coord[2]) : 1.0; \
GLfloat s_tmp = (GLfloat) (tex_coord[0] * invQ); \
@@ -764,11 +712,7 @@ fast_persp_span(GLcontext *ctx, struct triangle_span *span,
tex01 -= info->tbytesline; \
tex11 -= info->tbytesline; \
} \
- zspan[i] = FixedToDepth(span->z); \
- fogspan[i] = span->fog; \
DO_TEX; \
- span->fog += span->fogStep; \
- span->z += span->zStep; \
span->red += span->redStep; \
span->green += span->greenStep; \
span->blue += span->blueStep; \
@@ -779,23 +723,17 @@ fast_persp_span(GLcontext *ctx, struct triangle_span *span,
dest += 4; \
}
-#define FixedToDepth(F) ((F) >> fixedToDepthShift)
-
GLuint i;
- GLdepth zspan[MAX_WIDTH];
GLfloat tex_coord[3], tex_step[3];
- GLfloat fogspan[MAX_WIDTH];
- GLchan rgba[MAX_WIDTH][4];
- GLchan *dest = rgba[0];
- const GLint fixedToDepthShift = info->fixedToDepthShift;
-
- tex_coord[0] = span->tex[0][0] * (info->smask + 1),
- tex_step[0] = span->texStep[0][0] * (info->smask + 1);
- tex_coord[1] = span->tex[0][1] * (info->tmask + 1),
- tex_step[1] = span->texStep[0][1] * (info->tmask + 1);
+ GLchan *dest = span->array->rgba[0];
+
+ tex_coord[0] = span->tex[0][0] * (info->smask + 1);
+ tex_step[0] = span->texStepX[0][0] * (info->smask + 1);
+ tex_coord[1] = span->tex[0][1] * (info->tmask + 1);
+ tex_step[1] = span->texStepX[0][1] * (info->tmask + 1);
/* span->tex[0][2] only if 3D-texturing, here only 2D */
- tex_coord[2] = span->tex[0][3],
- tex_step[2] = span->texStep[0][3];
+ tex_coord[2] = span->tex[0][3];
+ tex_step[2] = span->texStepX[0][3];
switch (info->filter) {
case GL_NEAREST:
@@ -816,7 +754,8 @@ fast_persp_span(GLcontext *ctx, struct triangle_span *span,
SPAN_NEAREST(NEAREST_RGB;ADD,3);
break;
default:
- abort();
+ _mesa_problem(ctx, "bad tex env mode (5) in SPAN_LINEAR");
+ return;
}
break;
case GL_RGBA:
@@ -837,7 +776,8 @@ fast_persp_span(GLcontext *ctx, struct triangle_span *span,
SPAN_NEAREST(NEAREST_RGBA_REPLACE,4);
break;
default:
- abort();
+ _mesa_problem(ctx, "bad tex env mode (6) in SPAN_LINEAR");
+ return;
}
break;
}
@@ -861,7 +801,8 @@ fast_persp_span(GLcontext *ctx, struct triangle_span *span,
SPAN_LINEAR(LINEAR_RGB;ADD,3);
break;
default:
- abort();
+ _mesa_problem(ctx, "bad tex env mode (7) in SPAN_LINEAR");
+ return;
}
break;
case GL_RGBA:
@@ -882,25 +823,19 @@ fast_persp_span(GLcontext *ctx, struct triangle_span *span,
SPAN_LINEAR(LINEAR_RGBA;REPLACE,4);
break;
default:
- abort();
+ _mesa_problem(ctx, "bad tex env mode (8) in SPAN_LINEAR");
+ return;
}
break;
}
break;
}
- /* This does not seem to be necessary, but I don't know !! */
- /* span->tex[0][0] = tex_coord[0] / (info->smask + 1),
- span->tex[0][1] = tex_coord[1] / (info->tmask + 1),*/
- /* span->tex[0][2] only if 3D-texturing, here only 2D */
- /* span->tex[0][3] = tex_coord[2]; */
- _mesa_write_rgba_span(ctx, span->count, span->x, span->y,
- zspan, fogspan, rgba, NULL, GL_POLYGON);
-
+ ASSERT(span->arrayMask & SPAN_RGBA);
+ _mesa_write_rgba_span(ctx, span);
#undef SPAN_NEAREST
#undef SPAN_LINEAR
-#undef FixedToDepth
}
@@ -924,10 +859,9 @@ static void persp_textured_triangle( GLcontext *ctx,
#define SETUP_CODE \
struct persp_info info; \
- struct gl_texture_unit *unit = ctx->Texture.Unit+0; \
- struct gl_texture_object *obj = unit->Current2D; \
- GLint b = obj->BaseLevel; \
- info.fixedToDepthShift = ctx->Visual.depthBits <= 16 ? FIXED_SHIFT : 0;\
+ const struct gl_texture_unit *unit = ctx->Texture.Unit+0; \
+ const struct gl_texture_object *obj = unit->Current2D; \
+ const GLint b = obj->BaseLevel; \
info.texture = (const GLchan *) obj->Image[b]->Data; \
info.twidth_log2 = obj->Image[b]->WidthLog2; \
info.smask = obj->Image[b]->Width - 1; \
@@ -969,7 +903,10 @@ static void persp_textured_triangle( GLcontext *ctx,
} \
info.tsize = obj->Image[b]->Height * info.tbytesline;
-#define RENDER_SPAN( span ) fast_persp_span(ctx, &span, &info);
+#define RENDER_SPAN( span ) \
+ span.interpMask &= ~SPAN_RGBA; \
+ span.arrayMask |= SPAN_RGBA; \
+ fast_persp_span(ctx, &span, &info);
#include "s_tritemp.h"
@@ -978,335 +915,6 @@ static void persp_textured_triangle( GLcontext *ctx,
#endif /* CHAN_BITS != GL_FLOAT */
-
-/*
- * Generate arrays of fragment colors, z, fog, texcoords, etc from a
- * triangle span object. Then call the span/fragment processsing
- * functions in s_span.[ch]. This is used by a bunch of the textured
- * triangle functions.
- */
-static void
-rasterize_span(GLcontext *ctx, const struct triangle_span *span)
-{
- DEFMARRAY(GLchan, rgba, MAX_WIDTH, 4);
- DEFMARRAY(GLchan, spec, MAX_WIDTH, 4);
- DEFARRAY(GLuint, index, MAX_WIDTH);
- DEFARRAY(GLuint, z, MAX_WIDTH);
- DEFARRAY(GLfloat, fog, MAX_WIDTH);
- DEFARRAY(GLfloat, sTex, MAX_WIDTH);
- DEFARRAY(GLfloat, tTex, MAX_WIDTH);
- DEFARRAY(GLfloat, rTex, MAX_WIDTH);
- DEFARRAY(GLfloat, lambda, MAX_WIDTH);
- DEFMARRAY(GLfloat, msTex, MAX_TEXTURE_UNITS, MAX_WIDTH);
- DEFMARRAY(GLfloat, mtTex, MAX_TEXTURE_UNITS, MAX_WIDTH);
- DEFMARRAY(GLfloat, mrTex, MAX_TEXTURE_UNITS, MAX_WIDTH);
- DEFMARRAY(GLfloat, mLambda, MAX_TEXTURE_UNITS, MAX_WIDTH);
-
- CHECKARRAY(rgba, return);
- CHECKARRAY(spec, return);
- CHECKARRAY(index, return);
- CHECKARRAY(z, return);
- CHECKARRAY(fog, return);
- CHECKARRAY(sTex, return);
- CHECKARRAY(tTex, return);
- CHECKARRAY(rTex, return);
- CHECKARRAY(lambda, return);
- CHECKARRAY(msTex, return);
- CHECKARRAY(mtTex, return);
- CHECKARRAY(mrTex, return);
- CHECKARRAY(mLambda, return);
-
- if (span->activeMask & SPAN_RGBA) {
- if (span->activeMask & SPAN_FLAT) {
- GLuint i;
- 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 < span->count; i++) {
- COPY_CHAN4(rgba[i], color);
- }
- }
- else {
- /* smooth interpolation */
-#if CHAN_TYPE == GL_FLOAT
- GLfloat r = span->red;
- GLfloat g = span->green;
- GLfloat b = span->blue;
- GLfloat a = span->alpha;
-#else
- GLfixed r = span->red;
- GLfixed g = span->green;
- GLfixed b = span->blue;
- GLfixed a = span->alpha;
-#endif
- GLuint i;
- for (i = 0; i < span->count; i++) {
- rgba[i][RCOMP] = FixedToChan(r);
- rgba[i][GCOMP] = FixedToChan(g);
- rgba[i][BCOMP] = FixedToChan(b);
- rgba[i][ACOMP] = FixedToChan(a);
- r += span->redStep;
- g += span->greenStep;
- b += span->blueStep;
- a += span->alphaStep;
- }
- }
- }
-
- if (span->activeMask & SPAN_SPEC) {
- if (span->activeMask & SPAN_FLAT) {
- 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->count; i++) {
- spec[i][RCOMP] = r;
- spec[i][GCOMP] = g;
- spec[i][BCOMP] = b;
- }
- }
- else {
- /* smooth interpolation */
-#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->count; i++) {
- spec[i][RCOMP] = FixedToChan(r);
- spec[i][GCOMP] = FixedToChan(g);
- spec[i][BCOMP] = FixedToChan(b);
- r += span->specRedStep;
- g += span->specGreenStep;
- b += span->specBlueStep;
- }
- }
- }
-
- if (span->activeMask & SPAN_INDEX) {
- if (span->activeMask & SPAN_FLAT) {
- GLuint i;
- const GLint indx = FixedToInt(span->index);
- for (i = 0; i < span->count; i++) {
- index[i] = indx;
- }
- }
- else {
- /* smooth interpolation */
- GLuint i;
- GLfixed ind = span->index;
- for (i = 0; i < span->count; i++) {
- index[i] = FixedToInt(ind);
- ind += span->indexStep;
- }
- }
- }
-
- if (span->activeMask & SPAN_Z) {
- if (ctx->Visual.depthBits <= 16) {
- GLuint i;
- GLfixed zval = span->z;
- for (i = 0; i < span->count; i++) {
- z[i] = FixedToInt(zval);
- zval += span->zStep;
- }
- }
- else {
- /* Deep Z buffer, no fixed->int shift */
- GLuint i;
- GLfixed zval = span->z;
- for (i = 0; i < span->count; i++) {
- z[i] = zval;
- zval += span->zStep;
- }
- }
- }
- if (span->activeMask & SPAN_FOG) {
- GLuint i;
- GLfloat f = span->fog;
- for (i = 0; i < span->count; i++) {
- fog[i] = f;
- f += span->fogStep;
- }
- }
- if (span->activeMask & SPAN_TEXTURE) {
- if (ctx->Texture._ReallyEnabled & ~TEXTURE0_ANY) {
- /* multitexture */
- if (span->activeMask & SPAN_LAMBDA) {
- /* with lambda */
- GLuint u;
- for (u = 0; u < MAX_TEXTURE_UNITS; u++) {
- if (ctx->Texture.Unit[u]._ReallyEnabled) {
- GLfloat s = span->tex[u][0];
- GLfloat t = span->tex[u][1];
- GLfloat r = span->tex[u][2];
- GLfloat q = span->tex[u][3];
- GLuint i;
- for (i = 0; i < span->count; i++) {
- const GLfloat invQ = (q == 0.0F) ? 1.0F : (1.0F / q);
- msTex[u][i] = s * invQ;
- mtTex[u][i] = t * invQ;
- mrTex[u][i] = r * invQ;
- mLambda[u][i] = (GLfloat)
- (log(span->rho[u] * invQ * invQ) * 1.442695F * 0.5F);
- s += span->texStep[u][0];
- t += span->texStep[u][1];
- r += span->texStep[u][2];
- q += span->texStep[u][3];
- }
- }
- }
- }
- else {
- /* without lambda */
- GLuint u;
- for (u = 0; u < MAX_TEXTURE_UNITS; u++) {
- if (ctx->Texture.Unit[u]._ReallyEnabled) {
- GLfloat s = span->tex[u][0];
- GLfloat t = span->tex[u][1];
- GLfloat r = span->tex[u][2];
- GLfloat q = span->tex[u][3];
- GLuint i;
- for (i = 0; i < span->count; i++) {
- const GLfloat invQ = (q == 0.0F) ? 1.0F : (1.0F / q);
- msTex[u][i] = s * invQ;
- mtTex[u][i] = t * invQ;
- mrTex[u][i] = r * invQ;
- s += span->texStep[u][0];
- t += span->texStep[u][1];
- r += span->texStep[u][2];
- q += span->texStep[u][3];
- }
- }
- }
- }
- }
- else {
- /* just texture unit 0 */
- if (span->activeMask & SPAN_LAMBDA) {
- /* with lambda */
- GLfloat s = span->tex[0][0];
- GLfloat t = span->tex[0][1];
- GLfloat r = span->tex[0][2];
- GLfloat q = span->tex[0][3];
- GLuint i;
- for (i = 0; i < span->count; i++) {
- const GLfloat invQ = (q == 0.0F) ? 1.0F : (1.0F / q);
- sTex[i] = s * invQ;
- tTex[i] = t * invQ;
- rTex[i] = r * invQ;
- lambda[i] = (GLfloat)
- (log(span->rho[0] * invQ * invQ) * 1.442695F * 0.5F);
- s += span->texStep[0][0];
- t += span->texStep[0][1];
- r += span->texStep[0][2];
- q += span->texStep[0][3];
- }
- }
- else {
- /* without lambda */
- GLfloat s = span->tex[0][0];
- GLfloat t = span->tex[0][1];
- GLfloat r = span->tex[0][2];
- GLfloat q = span->tex[0][3];
- GLuint i;
- for (i = 0; i < span->count; i++) {
- const GLfloat invQ = (q == 0.0F) ? 1.0F : (1.0F / q);
- sTex[i] = s * invQ;
- tTex[i] = t * invQ;
- rTex[i] = r * invQ;
- s += span->texStep[0][0];
- t += span->texStep[0][1];
- r += span->texStep[0][2];
- q += span->texStep[0][3];
- }
- }
- }
- }
- /* XXX keep this? */
- if (span->activeMask & SPAN_INT_TEXTURE) {
- GLint intTexcoord[MAX_WIDTH][2];
- GLfixed s = span->intTex[0];
- GLfixed t = span->intTex[1];
- GLuint i;
- for (i = 0; i < span->count; i++) {
- intTexcoord[i][0] = FixedToInt(s);
- intTexcoord[i][1] = FixedToInt(t);
- s += span->intTexStep[0];
- t += span->intTexStep[1];
- }
- }
-
- /* examine activeMask and call a s_span.c function */
- if (span->activeMask & SPAN_TEXTURE) {
- const GLfloat *fogPtr;
- if (span->activeMask & SPAN_FOG)
- fogPtr = fog;
- else
- fogPtr = NULL;
-
- if (ctx->Texture._ReallyEnabled & ~TEXTURE0_ANY) {
- if (span->activeMask & SPAN_SPEC) {
- _mesa_write_multitexture_span(ctx, span->count, span->x, span->y,
- z, fogPtr,
- (const GLfloat (*)[MAX_WIDTH]) msTex,
- (const GLfloat (*)[MAX_WIDTH]) mtTex,
- (const GLfloat (*)[MAX_WIDTH]) mrTex,
- (GLfloat (*)[MAX_WIDTH]) mLambda,
- rgba, (CONST GLchan (*)[4]) spec,
- NULL, GL_POLYGON );
- }
- else {
- _mesa_write_multitexture_span(ctx, span->count, span->x, span->y,
- z, fogPtr,
- (const GLfloat (*)[MAX_WIDTH]) msTex,
- (const GLfloat (*)[MAX_WIDTH]) mtTex,
- (const GLfloat (*)[MAX_WIDTH]) mrTex,
- (GLfloat (*)[MAX_WIDTH]) mLambda,
- rgba, NULL, NULL, GL_POLYGON);
- }
- }
- else {
- /* single texture */
- if (span->activeMask & SPAN_SPEC) {
- _mesa_write_texture_span(ctx, span->count, span->x, span->y,
- z, fogPtr, sTex, tTex, rTex, lambda,
- rgba, (CONST GLchan (*)[4]) spec,
- NULL, GL_POLYGON);
- }
- else {
- _mesa_write_texture_span(ctx, span->count, span->x, span->y,
- z, fogPtr, sTex, tTex, rTex, lambda,
- rgba, NULL, NULL, GL_POLYGON);
- }
- }
- }
- else {
- _mesa_problem(ctx, "rasterize_span() should only be used for texturing");
- }
-
- UNDEFARRAY(rgba);
- UNDEFARRAY(spec);
- UNDEFARRAY(index);
- UNDEFARRAY(z);
- UNDEFARRAY(fog);
- UNDEFARRAY(sTex);
- UNDEFARRAY(tTex);
- UNDEFARRAY(rTex);
- UNDEFARRAY(lambda);
- UNDEFARRAY(msTex);
- UNDEFARRAY(mtTex);
- UNDEFARRAY(mrTex);
- UNDEFARRAY(mLambda);
-}
-
@@ -1323,173 +931,27 @@ static void general_textured_triangle( GLcontext *ctx,
#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
-#define INTERP_ALPHA 1
-#define INTERP_TEX 1
-
-#define SETUP_CODE \
- const struct gl_texture_object *obj = ctx->Texture.Unit[0]._Current; \
- const struct gl_texture_image *texImage = obj->Image[obj->BaseLevel];\
- DEFARRAY(GLfloat, sSpan, MAX_WIDTH); /* mac 32k limitation */ \
- DEFARRAY(GLfloat, tSpan, MAX_WIDTH); /* mac 32k limitation */ \
- DEFARRAY(GLfloat, uSpan, MAX_WIDTH); /* mac 32k limitation */ \
- CHECKARRAY(sSpan, return); /* mac 32k limitation */ \
- CHECKARRAY(tSpan, return); /* mac 32k limitation */ \
- CHECKARRAY(uSpan, return); /* mac 32k limitation */ \
- span.texWidth[0] = (GLfloat) texImage->Width; \
- span.texHeight[0] = (GLfloat) texImage->Height; \
- (void) fixedToDepthShift;
-
-#define RENDER_SPAN( span ) \
- GLdepth zSpan[MAX_WIDTH]; \
- GLfloat fogSpan[MAX_WIDTH]; \
- GLchan rgbaSpan[MAX_WIDTH][4]; \
- GLuint i; \
- /* NOTE: we could just call rasterize_span() here instead */ \
- for (i = 0; i < span.count; i++) { \
- GLdouble invQ = span.tex[0][3] ? (1.0 / span.tex[0][3]) : 1.0; \
- zSpan[i] = FixedToDepth(span.z); \
- span.z += span.zStep; \
- fogSpan[i] = span.fog; \
- span.fog += span.fogStep; \
- rgbaSpan[i][RCOMP] = FixedToChan(span.red); \
- rgbaSpan[i][GCOMP] = FixedToChan(span.green); \
- rgbaSpan[i][BCOMP] = FixedToChan(span.blue); \
- rgbaSpan[i][ACOMP] = FixedToChan(span.alpha); \
- span.red += span.redStep; \
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
- span.alpha += span.alphaStep; \
- sSpan[i] = (GLfloat) (span.tex[0][0] * invQ); \
- tSpan[i] = (GLfloat) (span.tex[0][1] * invQ); \
- uSpan[i] = (GLfloat) (span.tex[0][2] * invQ); \
- span.tex[0][0] += span.texStep[0][0]; \
- span.tex[0][1] += span.texStep[0][1]; \
- span.tex[0][2] += span.texStep[0][2]; \
- span.tex[0][3] += span.texStep[0][3]; \
- } \
- _mesa_write_texture_span(ctx, span.count, span.x, span.y, \
- zSpan, fogSpan, sSpan, tSpan, uSpan, \
- NULL, rgbaSpan, NULL, NULL, GL_POLYGON );
-
-#define CLEANUP_CODE \
- UNDEFARRAY(sSpan); /* mac 32k limitation */ \
- UNDEFARRAY(tSpan); \
- UNDEFARRAY(uSpan);
-
-#include "s_tritemp.h"
-}
-
-
-/*
- * Render a smooth-shaded, textured, RGBA triangle with separate specular
- * color interpolation.
- * Interpolate texcoords with perspective correction, w/out mipmapping.
- */
-static void general_textured_spec_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
-#define INTERP_RGB 1
#define INTERP_SPEC 1
#define INTERP_ALPHA 1
#define INTERP_TEX 1
-#define SETUP_CODE \
- const struct gl_texture_object *obj = ctx->Texture.Unit[0]._Current; \
- const struct gl_texture_image *texImage = obj->Image[obj->BaseLevel];\
- span.texWidth[0] = (GLfloat) texImage->Width; \
- span.texHeight[0] = (GLfloat) texImage->Height; \
- (void) fixedToDepthShift;
-
-#define RENDER_SPAN( span ) rasterize_span(ctx, &span);
-
-#include "s_tritemp.h"
-}
-
-
-/*
- * Render a smooth-shaded, textured, RGBA triangle.
- * Interpolate S,T,R with perspective correction and compute lambda for
- * each fragment. Lambda is used to determine whether to use the
- * minification or magnification filter. If minification and using
- * mipmaps, lambda is also used to select the texture level of detail.
- */
-static void lambda_textured_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
-#define INTERP_RGB 1
-#define INTERP_ALPHA 1
-#define INTERP_TEX 1
-#define INTERP_LAMBDA 1
-
-#define SETUP_CODE \
- const struct gl_texture_object *obj = ctx->Texture.Unit[0]._Current; \
- const struct gl_texture_image *texImage = obj->Image[obj->BaseLevel];\
- span.texWidth[0] = (GLfloat) texImage->Width; \
- span.texHeight[0] = (GLfloat) texImage->Height; \
- (void) fixedToDepthShift;
-
-#define RENDER_SPAN( span ) rasterize_span(ctx, &span);
+#define RENDER_SPAN( span ) _mesa_write_texture_span(ctx, &span);
#include "s_tritemp.h"
}
-/*
- * Render a smooth-shaded, textured, RGBA triangle with separate specular
- * interpolation.
- * Interpolate S,T,R with perspective correction and compute lambda for
- * each fragment. Lambda is used to determine whether to use the
- * minification or magnification filter. If minification and using
- * mipmaps, lambda is also used to select the texture level of detail.
- */
-static void lambda_textured_spec_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
-#define INTERP_RGB 1
-#define INTERP_SPEC 1
-#define INTERP_ALPHA 1
-#define INTERP_TEX 1
-#define INTERP_LAMBDA 1
-
-#define SETUP_CODE \
- const struct gl_texture_object *obj = ctx->Texture.Unit[0]._Current; \
- const struct gl_texture_image *texImage = obj->Image[obj->BaseLevel];\
- span.texWidth[0] = (GLfloat) texImage->Width; \
- span.texHeight[0] = (GLfloat) texImage->Height; \
- (void) fixedToDepthShift;
-
-#define RENDER_SPAN( span ) rasterize_span(ctx, &span);
-
-#include "s_tritemp.h"
-}
-
/*
* This is the big one!
- * Interpolate Z, RGB, Alpha, specular, fog, and N sets of texture coordinates
- * with lambda (LOD).
+ * Interpolate Z, RGB, Alpha, specular, fog, and N sets of texture coordinates.
* Yup, it's slow.
*/
static void
-lambda_multitextured_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
+multitextured_triangle( GLcontext *ctx,
+ const SWvertex *v0,
+ const SWvertex *v1,
+ const SWvertex *v2 )
{
#define INTERP_Z 1
@@ -1499,23 +961,8 @@ lambda_multitextured_triangle( GLcontext *ctx,
#define INTERP_ALPHA 1
#define INTERP_SPEC 1
#define INTERP_MULTITEX 1
-#define INTERP_LAMBDA 1
-#define SETUP_CODE \
- GLuint u; \
- for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { \
- if (ctx->Texture.Unit[u]._ReallyEnabled) { \
- const struct gl_texture_object *texObj; \
- const struct gl_texture_image *texImage; \
- texObj = ctx->Texture.Unit[u]._Current; \
- texImage = texObj->Image[texObj->BaseLevel]; \
- span.texWidth[u] = (GLfloat) texImage->Width; \
- span.texHeight[u] = (GLfloat) texImage->Height; \
- } \
- } \
- (void) fixedToDepthShift;
-
-#define RENDER_SPAN( span ) rasterize_span(ctx, &span);
+#define RENDER_SPAN( span ) _mesa_write_texture_span(ctx, &span);
#include "s_tritemp.h"
@@ -1537,7 +984,7 @@ static void occlusion_zless_triangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
- for (i = 0; i < span.count; i++) { \
+ for (i = 0; i < span.end; i++) { \
GLdepth z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
ctx->OcclusionResult = GL_TRUE; \
@@ -1616,13 +1063,13 @@ void _swrast_add_spec_terms_triangle( GLcontext *ctx,
#ifdef DEBUG
/* record the current triangle function name */
-static const char *triFuncName = NULL;
+const char *_mesa_triFuncName = NULL;
-#define USE(triFunc) \
-do { \
- triFuncName = #triFunc; \
- /*printf("%s\n", triFuncName);*/ \
- swrast->Triangle = triFunc; \
+#define USE(triFunc) \
+do { \
+ _mesa_triFuncName = #triFunc; \
+ /*printf("%s\n", _mesa_triFuncName);*/ \
+ swrast->Triangle = triFunc; \
} while (0)
#else
@@ -1678,7 +1125,7 @@ _swrast_choose_triangle( GLcontext *ctx )
}
}
- if (ctx->Texture._ReallyEnabled) {
+ if (ctx->Texture._EnabledUnits) {
/* Ugh, we do a _lot_ of tests to pick the best textured tri func */
const struct gl_texture_object *texObj2D;
const struct gl_texture_image *texImg;
@@ -1692,10 +1139,12 @@ _swrast_choose_triangle( GLcontext *ctx )
envMode = ctx->Texture.Unit[0].EnvMode;
/* First see if we can used an optimized 2-D texture function */
- if (ctx->Texture._ReallyEnabled==TEXTURE0_2D
+ if (ctx->Texture._EnabledUnits == 1
+ && ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT
&& texObj2D->WrapS==GL_REPEAT
&& texObj2D->WrapT==GL_REPEAT
&& texImg->Border==0
+ && texImg->Width == texImg->RowStride
&& (format == MESA_FORMAT_RGB || format == MESA_FORMAT_RGBA)
&& minFilter == magFilter
&& ctx->Light.Model.ColorControl == GL_SINGLE_COLOR
@@ -1733,38 +1182,17 @@ _swrast_choose_triangle( GLcontext *ctx )
}
}
else {
- /* More complicated textures (mipmap, multi-tex, sep specular) */
- GLboolean needLambda;
- /* if mag filter != min filter we need to compute lambda */
- const struct gl_texture_object *obj = ctx->Texture.Unit[0]._Current;
- if (obj && obj->MinFilter != obj->MagFilter)
- needLambda = GL_TRUE;
- else
- needLambda = GL_FALSE;
- if (ctx->Texture._ReallyEnabled > TEXTURE0_ANY) {
- USE(lambda_multitextured_triangle);
- }
- else if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
- /* separate specular color interpolation */
- if (needLambda) {
- USE(lambda_textured_spec_triangle);
- }
- else {
- USE(general_textured_spec_triangle);
- }
+ /* general case textured triangles */
+ if (ctx->Texture._EnabledUnits > 1) {
+ USE(multitextured_triangle);
}
else {
- if (needLambda) {
- USE(lambda_textured_triangle);
- }
- else {
- USE(general_textured_triangle);
- }
+ USE(general_textured_triangle);
}
}
}
else {
- ASSERT(!ctx->Texture._ReallyEnabled);
+ ASSERT(!ctx->Texture._EnabledUnits);
if (ctx->Light.ShadeModel==GL_SMOOTH) {
/* smooth shaded, no texturing, stippled or some raster ops */
if (rgbmode) {
diff --git a/xc/extras/Mesa/src/swrast/s_trispan.h b/xc/extras/Mesa/src/swrast/s_trispan.h
index 9a85132fe..15207e863 100644
--- a/xc/extras/Mesa/src/swrast/s_trispan.h
+++ b/xc/extras/Mesa/src/swrast/s_trispan.h
@@ -1,4 +1,3 @@
-/* $Id: s_trispan.h,v 1.1.1.1 2002/10/22 13:06:42 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -29,65 +28,4 @@
#define S_TRISPAN_H
-/*
- * The triangle_span structure is used by the triangle template code in
- * s_tritemp.h. It describes how colors, Z, texcoords, etc are to be
- * interpolated across each scanline of triangle.
- * With this structure it's easy to hand-off span rasterization to a
- * subroutine instead of doing it all inline like we used to do.
- * It also cleans up the local variable namespace a great deal.
- *
- * It would be interesting to experiment with multiprocessor rasterization
- * with this structure. The triangle rasterizer could simply emit a
- * stream of these structures which would be consumed by one or more
- * span-processing threads which could run in parallel.
- */
-
-
-/* When the triangle_span struct is initialized, these flags indicates
- * which values are needed for rendering the triangle.
- */
-#define SPAN_RGBA 0x001
-#define SPAN_SPEC 0x002
-#define SPAN_INDEX 0x004
-#define SPAN_Z 0x008
-#define SPAN_FOG 0x010
-#define SPAN_TEXTURE 0x020
-#define SPAN_INT_TEXTURE 0x040
-#define SPAN_LAMBDA 0x080
-#define SPAN_FLAT 0x100 /* flat shading? */
-
-
-struct triangle_span {
- GLint x, y;
- GLuint count;
- GLuint activeMask; /* OR of the SPAN_* flags */
-#if CHAN_TYPE == GL_FLOAT
- GLfloat red, redStep;
- GLfloat green, greenStep;
- GLfloat blue, blueStep;
- GLfloat alpha, alphaStep;
- GLfloat specRed, specRedStep;
- GLfloat specGreen, specGreenStep;
- GLfloat specBlue, specBlueStep;
-#else
- GLfixed red, redStep;
- GLfixed green, greenStep;
- GLfixed blue, blueStep;
- GLfixed alpha, alphaStep;
- GLfixed specRed, specRedStep;
- GLfixed specGreen, specGreenStep;
- GLfixed specBlue, specBlueStep;
-#endif
- GLfixed index, indexStep;
- GLfixed z, zStep;
- GLfloat fog, fogStep;
- GLfloat tex[MAX_TEXTURE_UNITS][4], texStep[MAX_TEXTURE_UNITS][4];
- GLfixed intTex[2], intTexStep[2];
- /* Needed for texture lambda (LOD) computation */
- GLfloat rho[MAX_TEXTURE_UNITS];
- GLfloat texWidth[MAX_TEXTURE_UNITS], texHeight[MAX_TEXTURE_UNITS];
-};
-
-
#endif /* S_TRISPAN_H */
diff --git a/xc/extras/Mesa/src/swrast/s_tritemp.h b/xc/extras/Mesa/src/swrast/s_tritemp.h
index 41306fc03..2feeb8b13 100644
--- a/xc/extras/Mesa/src/swrast/s_tritemp.h
+++ b/xc/extras/Mesa/src/swrast/s_tritemp.h
@@ -1,3 +1,4 @@
+
/*
* Mesa 3-D graphics library
* Version: 3.5
@@ -21,7 +22,7 @@
* AN ACTION 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/extras/Mesa/src/swrast/s_tritemp.h,v 1.3 2002/09/09 21:07:37 dawes Exp $ */
+/* $XFree86: xc/extras/Mesa/src/swrast/s_tritemp.h,v 1.2 2002/02/27 21:07:54 tsi Exp $ */
/*
* Triangle Rasterizer Template
@@ -41,8 +42,6 @@
* INTERP_TEX - if defined, interpolate set 0 float STRQ texcoords
* NOTE: OpenGL STRQ = Mesa STUV (R was taken for red)
* INTERP_MULTITEX - if defined, interpolate N units of STRQ texcoords
- * INTERP_LAMBDA - if defined, compute lambda value (for mipmapping)
- * a lambda value for every texture unit
* INTERP_FLOAT_RGBA - if defined, interpolate RGBA with floating point
* INTERP_FLOAT_SPEC - if defined, interpolate specular with floating point
*
@@ -115,10 +114,12 @@
GLfloat oneOverArea;
const SWvertex *vMin, *vMid, *vMax; /* Y(vMin)<=Y(vMid)<=Y(vMax) */
float bf = SWRAST_CONTEXT(ctx)->_backface_sign;
- const GLint snapMask = ~((FIXED_ONE / 16) - 1); /* for x/y coord snapping */
+ const GLint snapMask = ~((FIXED_ONE / (1 << SUB_PIXEL_BITS)) - 1); /* for x/y coord snapping */
GLfixed vMin_fx, vMin_fy, vMid_fx, vMid_fy, vMax_fx, vMax_fy;
- struct triangle_span span;
+ struct sw_span span;
+
+ INIT_SPAN(span, GL_POLYGON, 0, 0, 0);
#ifdef INTERP_Z
(void) fixedToDepthShift;
@@ -127,14 +128,8 @@
/*
printf("%s()\n", __FUNCTION__);
printf(" %g, %g, %g\n", v0->win[0], v0->win[1], v0->win[2]);
- printf(" %d, %d, %d, %d\n",
- v0->color[0], v0->color[1], v0->color[2], v0->color[3]);
printf(" %g, %g, %g\n", v1->win[0], v1->win[1], v1->win[2]);
- printf(" %d, %d, %d, %d\n",
- v1->color[0], v1->color[1], v1->color[2], v1->color[3]);
printf(" %g, %g, %g\n", v2->win[0], v2->win[1], v2->win[2]);
- printf(" %d, %d, %d, %d\n",
- v2->color[0], v2->color[1], v2->color[2], v2->color[3]);
*/
/* Compute fixed point x,y coords w/ half-pixel offsets and snapping.
@@ -210,7 +205,7 @@
if (area * bf < 0.0)
return;
- if (area == 0.0F || IS_INF_OR_NAN(area))
+ if (IS_INF_OR_NAN(area) || area == 0.0F)
return;
oneOverArea = 1.0F / area;
@@ -219,6 +214,7 @@
#ifndef DO_OCCLUSION_TEST
ctx->OcclusionResult = GL_TRUE;
#endif
+ span.facing = ctx->_Facing; /* for 2-sided stencil test */
/* Edge setup. For a triangle strip these could be reused... */
{
@@ -319,20 +315,16 @@
GLfloat dtdx, dtdy;
#endif
#ifdef INTERP_TEX
- GLfloat dsdy;
- GLfloat dtdy;
- GLfloat dudy;
- GLfloat dvdy;
+ GLfloat dsdx, dsdy;
+ GLfloat dtdx, dtdy;
+ GLfloat dudx, dudy;
+ GLfloat dvdx, dvdy;
#endif
#ifdef INTERP_MULTITEX
- GLfloat dsdy[MAX_TEXTURE_UNITS];
- GLfloat dtdy[MAX_TEXTURE_UNITS];
- GLfloat dudy[MAX_TEXTURE_UNITS];
- GLfloat dvdy[MAX_TEXTURE_UNITS];
-#endif
-
-#if defined(INTERP_LAMBDA) && !defined(INTERP_TEX) && !defined(INTERP_MULTITEX)
-#error "Mipmapping without texturing doesn't make sense."
+ GLfloat dsdx[MAX_TEXTURE_UNITS], dsdy[MAX_TEXTURE_UNITS];
+ GLfloat dtdx[MAX_TEXTURE_UNITS], dtdy[MAX_TEXTURE_UNITS];
+ GLfloat dudx[MAX_TEXTURE_UNITS], dudy[MAX_TEXTURE_UNITS];
+ GLfloat dvdx[MAX_TEXTURE_UNITS], dvdy[MAX_TEXTURE_UNITS];
#endif
/*
@@ -344,11 +336,10 @@
scan_from_left_to_right = (oneOverArea < 0.0F);
- span.activeMask = 0;
/* compute d?/dx and d?/dy derivatives */
#ifdef INTERP_Z
- span.activeMask |= SPAN_Z;
+ span.interpMask |= SPAN_Z;
{
GLfloat eMaj_dz, eBot_dz;
eMaj_dz = vMax->win[2] - vMin->win[2];
@@ -369,7 +360,7 @@
}
#endif
#ifdef INTERP_FOG
- span.activeMask |= SPAN_FOG;
+ span.interpMask |= SPAN_FOG;
{
const GLfloat eMaj_dfog = vMax->fog - vMin->fog;
const GLfloat eBot_dfog = vMid->fog - vMin->fog;
@@ -378,7 +369,7 @@
}
#endif
#ifdef INTERP_RGB
- span.activeMask |= SPAN_RGBA;
+ span.interpMask |= SPAN_RGBA;
if (ctx->Light.ShadeModel == GL_SMOOTH) {
GLfloat eMaj_dr, eBot_dr;
GLfloat eMaj_dg, eBot_dg;
@@ -419,7 +410,7 @@
}
else {
ASSERT (ctx->Light.ShadeModel == GL_FLAT);
- span.activeMask |= SPAN_FLAT;
+ span.interpMask |= SPAN_FLAT;
drdx = drdy = 0.0F;
dgdx = dgdy = 0.0F;
dbdx = dbdy = 0.0F;
@@ -433,7 +424,7 @@
}
#endif
#ifdef INTERP_FLOAT_RGBA
- span.activeMask |= SPAN_RGBA;
+ span.interpMask |= SPAN_RGBA;
if (ctx->Light.ShadeModel == GL_SMOOTH) {
GLfloat eMaj_dr, eBot_dr;
GLfloat eMaj_dg, eBot_dg;
@@ -468,7 +459,7 @@
}
#endif
#ifdef INTERP_SPEC
- span.activeMask |= SPAN_SPEC;
+ span.interpMask |= SPAN_SPEC;
if (ctx->Light.ShadeModel == GL_SMOOTH) {
GLfloat eMaj_dsr, eBot_dsr;
GLfloat eMaj_dsg, eBot_dsg;
@@ -505,7 +496,7 @@
}
#endif
#ifdef INTERP_FLOAT_SPEC
- span.activeMask |= SPAN_SPEC;
+ span.interpMask |= SPAN_SPEC;
if (ctx->Light.ShadeModel == GL_SMOOTH) {
GLfloat eMaj_dsr, eBot_dsr;
GLfloat eMaj_dsg, eBot_dsg;
@@ -533,7 +524,7 @@
}
#endif
#ifdef INTERP_INDEX
- span.activeMask |= SPAN_INDEX;
+ span.interpMask |= SPAN_INDEX;
if (ctx->Light.ShadeModel == GL_SMOOTH) {
GLfloat eMaj_di, eBot_di;
eMaj_di = (GLfloat) ((GLint) vMax->index - (GLint) vMin->index);
@@ -543,13 +534,13 @@
didy = oneOverArea * (eMaj.dx * eBot_di - eMaj_di * eBot.dx);
}
else {
- span.activeMask |= SPAN_FLAT;
+ span.interpMask |= SPAN_FLAT;
didx = didy = 0.0F;
span.indexStep = 0;
}
#endif
#ifdef INTERP_INT_TEX
- span.activeMask |= SPAN_INT_TEXTURE;
+ span.interpMask |= SPAN_INT_TEXTURE;
{
GLfloat eMaj_ds, eBot_ds;
eMaj_ds = (vMax->texcoord[0][0] - vMin->texcoord[0][0]) * S_SCALE;
@@ -569,7 +560,7 @@
#endif
#ifdef INTERP_TEX
- span.activeMask |= SPAN_TEXTURE;
+ span.interpMask |= SPAN_TEXTURE;
{
GLfloat wMax = vMax->win[3];
GLfloat wMin = vMin->win[3];
@@ -581,46 +572,35 @@
eMaj_ds = vMax->texcoord[0][0] * wMax - vMin->texcoord[0][0] * wMin;
eBot_ds = vMid->texcoord[0][0] * wMid - vMin->texcoord[0][0] * wMin;
- span.texStep[0][0] = oneOverArea * (eMaj_ds * eBot.dy
- - eMaj.dy * eBot_ds);
+ dsdx = oneOverArea * (eMaj_ds * eBot.dy - eMaj.dy * eBot_ds);
dsdy = oneOverArea * (eMaj.dx * eBot_ds - eMaj_ds * eBot.dx);
+ span.texStepX[0][0] = dsdx;
+ span.texStepY[0][0] = dsdy;
eMaj_dt = vMax->texcoord[0][1] * wMax - vMin->texcoord[0][1] * wMin;
eBot_dt = vMid->texcoord[0][1] * wMid - vMin->texcoord[0][1] * wMin;
- span.texStep[0][1] = oneOverArea * (eMaj_dt * eBot.dy
- - eMaj.dy * eBot_dt);
+ dtdx = oneOverArea * (eMaj_dt * eBot.dy - eMaj.dy * eBot_dt);
dtdy = oneOverArea * (eMaj.dx * eBot_dt - eMaj_dt * eBot.dx);
+ span.texStepX[0][1] = dtdx;
+ span.texStepY[0][1] = dtdy;
eMaj_du = vMax->texcoord[0][2] * wMax - vMin->texcoord[0][2] * wMin;
eBot_du = vMid->texcoord[0][2] * wMid - vMin->texcoord[0][2] * wMin;
- span.texStep[0][2] = oneOverArea * (eMaj_du * eBot.dy
- - eMaj.dy * eBot_du);
+ dudx = oneOverArea * (eMaj_du * eBot.dy - eMaj.dy * eBot_du);
dudy = oneOverArea * (eMaj.dx * eBot_du - eMaj_du * eBot.dx);
+ span.texStepX[0][2] = dudx;
+ span.texStepY[0][2] = dudy;
eMaj_dv = vMax->texcoord[0][3] * wMax - vMin->texcoord[0][3] * wMin;
eBot_dv = vMid->texcoord[0][3] * wMid - vMin->texcoord[0][3] * wMin;
- span.texStep[0][3] = oneOverArea * (eMaj_dv * eBot.dy
- - eMaj.dy * eBot_dv);
+ dvdx = oneOverArea * (eMaj_dv * eBot.dy - eMaj.dy * eBot_dv);
dvdy = oneOverArea * (eMaj.dx * eBot_dv - eMaj_dv * eBot.dx);
+ span.texStepX[0][3] = dvdx;
+ span.texStepY[0][3] = dvdy;
}
-# ifdef INTERP_LAMBDA
- {
- GLfloat dudx = span.texStep[0][0] * span.texWidth[0];
- GLfloat dudy = dsdy * span.texWidth[0];
- GLfloat dvdx = span.texStep[0][1] * span.texHeight[0];
- GLfloat dvdy = dtdy * span.texHeight[0];
- GLfloat r1 = dudx * dudx + dudy * dudy;
- GLfloat r2 = dvdx * dvdx + dvdy * dvdy;
- span.rho[0] = r1 + r2; /* was rho2 = MAX2(r1,r2) */
- span.activeMask |= SPAN_LAMBDA;
- }
-# endif
#endif
#ifdef INTERP_MULTITEX
- span.activeMask |= SPAN_TEXTURE;
-# ifdef INTERP_LAMBDA
- span.activeMask |= SPAN_LAMBDA;
-# endif
+ span.interpMask |= SPAN_TEXTURE;
{
GLfloat wMax = vMax->win[3];
GLfloat wMin = vMin->win[3];
@@ -636,44 +616,37 @@
- vMin->texcoord[u][0] * wMin;
eBot_ds = vMid->texcoord[u][0] * wMid
- vMin->texcoord[u][0] * wMin;
- span.texStep[u][0] = oneOverArea * (eMaj_ds * eBot.dy
- - eMaj.dy * eBot_ds);
+ dsdx[u] = oneOverArea * (eMaj_ds * eBot.dy - eMaj.dy * eBot_ds);
dsdy[u] = oneOverArea * (eMaj.dx * eBot_ds - eMaj_ds * eBot.dx);
+ span.texStepX[u][0] = dsdx[u];
+ span.texStepY[u][0] = dsdy[u];
eMaj_dt = vMax->texcoord[u][1] * wMax
- vMin->texcoord[u][1] * wMin;
eBot_dt = vMid->texcoord[u][1] * wMid
- vMin->texcoord[u][1] * wMin;
- span.texStep[u][1] = oneOverArea * (eMaj_dt * eBot.dy
- - eMaj.dy * eBot_dt);
+ dtdx[u] = oneOverArea * (eMaj_dt * eBot.dy - eMaj.dy * eBot_dt);
dtdy[u] = oneOverArea * (eMaj.dx * eBot_dt - eMaj_dt * eBot.dx);
+ span.texStepX[u][1] = dtdx[u];
+ span.texStepY[u][1] = dtdy[u];
eMaj_du = vMax->texcoord[u][2] * wMax
- vMin->texcoord[u][2] * wMin;
eBot_du = vMid->texcoord[u][2] * wMid
- vMin->texcoord[u][2] * wMin;
- span.texStep[u][2] = oneOverArea * (eMaj_du * eBot.dy
- - eMaj.dy * eBot_du);
+ dudx[u] = oneOverArea * (eMaj_du * eBot.dy - eMaj.dy * eBot_du);
dudy[u] = oneOverArea * (eMaj.dx * eBot_du - eMaj_du * eBot.dx);
+ span.texStepX[u][2] = dudx[u];
+ span.texStepY[u][2] = dudy[u];
eMaj_dv = vMax->texcoord[u][3] * wMax
- vMin->texcoord[u][3] * wMin;
eBot_dv = vMid->texcoord[u][3] * wMid
- vMin->texcoord[u][3] * wMin;
- span.texStep[u][3] = oneOverArea * (eMaj_dv * eBot.dy
- - eMaj.dy * eBot_dv);
+ dvdx[u] = oneOverArea * (eMaj_dv * eBot.dy - eMaj.dy * eBot_dv);
dvdy[u] = oneOverArea * (eMaj.dx * eBot_dv - eMaj_dv * eBot.dx);
-# ifdef INTERP_LAMBDA
- {
- GLfloat dudx = span.texStep[u][0] * span.texWidth[u];
- GLfloat dudy = dsdy[u] * span.texWidth[u];
- GLfloat dvdx = span.texStep[u][1] * span.texHeight[u];
- GLfloat dvdy = dtdy[u] * span.texHeight[u];
- GLfloat r1 = dudx * dudx + dudy * dudy;
- GLfloat r2 = dvdx * dvdx + dvdy * dvdy;
- span.rho[u] = r1 + r2; /* was rho2 = MAX2(r1,r2) */
- }
-# endif
+ span.texStepX[u][3] = dvdx[u];
+ span.texStepY[u][3] = dvdy[u];
}
}
}
@@ -1033,21 +1006,21 @@
GLfloat invW = vLower->win[3];
GLfloat s0, t0, u0, v0;
s0 = vLower->texcoord[0][0] * invW;
- sLeft = s0 + (span.texStep[0][0] * adjx + dsdy * adjy)
+ sLeft = s0 + (span.texStepX[0][0] * adjx + dsdy * adjy)
* (1.0F/FIXED_SCALE);
- dsOuter = dsdy + dxOuter * span.texStep[0][0];
+ dsOuter = dsdy + dxOuter * span.texStepX[0][0];
t0 = vLower->texcoord[0][1] * invW;
- tLeft = t0 + (span.texStep[0][1] * adjx + dtdy * adjy)
+ tLeft = t0 + (span.texStepX[0][1] * adjx + dtdy * adjy)
* (1.0F/FIXED_SCALE);
- dtOuter = dtdy + dxOuter * span.texStep[0][1];
+ dtOuter = dtdy + dxOuter * span.texStepX[0][1];
u0 = vLower->texcoord[0][2] * invW;
- uLeft = u0 + (span.texStep[0][2] * adjx + dudy * adjy)
+ uLeft = u0 + (span.texStepX[0][2] * adjx + dudy * adjy)
* (1.0F/FIXED_SCALE);
- duOuter = dudy + dxOuter * span.texStep[0][2];
+ duOuter = dudy + dxOuter * span.texStepX[0][2];
v0 = vLower->texcoord[0][3] * invW;
- vLeft = v0 + (span.texStep[0][3] * adjx + dvdy * adjy)
+ vLeft = v0 + (span.texStepX[0][3] * adjx + dvdy * adjy)
* (1.0F/FIXED_SCALE);
- dvOuter = dvdy + dxOuter * span.texStep[0][3];
+ dvOuter = dvdy + dxOuter * span.texStepX[0][3];
}
#endif
#ifdef INTERP_MULTITEX
@@ -1058,21 +1031,21 @@
GLfloat invW = vLower->win[3];
GLfloat s0, t0, u0, v0;
s0 = vLower->texcoord[u][0] * invW;
- sLeft[u] = s0 + (span.texStep[u][0] * adjx + dsdy[u]
+ sLeft[u] = s0 + (span.texStepX[u][0] * adjx + dsdy[u]
* adjy) * (1.0F/FIXED_SCALE);
- dsOuter[u] = dsdy[u] + dxOuter * span.texStep[u][0];
+ dsOuter[u] = dsdy[u] + dxOuter * span.texStepX[u][0];
t0 = vLower->texcoord[u][1] * invW;
- tLeft[u] = t0 + (span.texStep[u][1] * adjx + dtdy[u]
+ tLeft[u] = t0 + (span.texStepX[u][1] * adjx + dtdy[u]
* adjy) * (1.0F/FIXED_SCALE);
- dtOuter[u] = dtdy[u] + dxOuter * span.texStep[u][1];
+ dtOuter[u] = dtdy[u] + dxOuter * span.texStepX[u][1];
u0 = vLower->texcoord[u][2] * invW;
- uLeft[u] = u0 + (span.texStep[u][2] * adjx + dudy[u]
+ uLeft[u] = u0 + (span.texStepX[u][2] * adjx + dudy[u]
* adjy) * (1.0F/FIXED_SCALE);
- duOuter[u] = dudy[u] + dxOuter * span.texStep[u][2];
+ duOuter[u] = dudy[u] + dxOuter * span.texStepX[u][2];
v0 = vLower->texcoord[u][3] * invW;
- vLeft[u] = v0 + (span.texStep[u][3] * adjx + dvdy[u]
+ vLeft[u] = v0 + (span.texStepX[u][3] * adjx + dvdy[u]
* adjy) * (1.0F/FIXED_SCALE);
- dvOuter[u] = dvdy[u] + dxOuter * span.texStep[u][3];
+ dvOuter[u] = dvdy[u] + dxOuter * span.texStepX[u][3];
}
}
}
@@ -1125,20 +1098,20 @@
fdtInner = fdtOuter + span.intTexStep[1];
#endif
#ifdef INTERP_TEX
- dsInner = dsOuter + span.texStep[0][0];
- dtInner = dtOuter + span.texStep[0][1];
- duInner = duOuter + span.texStep[0][2];
- dvInner = dvOuter + span.texStep[0][3];
+ dsInner = dsOuter + span.texStepX[0][0];
+ dtInner = dtOuter + span.texStepX[0][1];
+ duInner = duOuter + span.texStepX[0][2];
+ dvInner = dvOuter + span.texStepX[0][3];
#endif
#ifdef INTERP_MULTITEX
{
GLuint u;
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
if (ctx->Texture.Unit[u]._ReallyEnabled) {
- dsInner[u] = dsOuter[u] + span.texStep[u][0];
- dtInner[u] = dtOuter[u] + span.texStep[u][1];
- duInner[u] = duOuter[u] + span.texStep[u][2];
- dvInner[u] = dvOuter[u] + span.texStep[u][3];
+ dsInner[u] = dsOuter[u] + span.texStepX[u][0];
+ dtInner[u] = dtOuter[u] + span.texStepX[u][1];
+ duInner[u] = duOuter[u] + span.texStepX[u][2];
+ dvInner[u] = dvOuter[u] + span.texStepX[u][3];
}
}
}
@@ -1148,11 +1121,13 @@
/* initialize the span interpolants to the leftmost value */
/* ff = fixed-pt fragment */
const GLint right = FixedToInt(fxRightEdge);
+
span.x = FixedToInt(fxLeftEdge);
+
if (right <= span.x)
- span.count = 0;
+ span.end = 0;
else
- span.count = right - span.x;
+ span.end = right - span.x;
#ifdef INTERP_Z
span.z = fz;
@@ -1266,7 +1241,7 @@
#endif
/* This is where we actually generate fragments */
- if (span.count > 0) {
+ if (span.end > 0) {
RENDER_SPAN( span );
}
@@ -1276,7 +1251,7 @@
* pixel-center x coordinate so that it stays
* on or inside the major edge.
*/
- span.y++;
+ (span.y)++;
lines--;
fxLeftEdge += fdxLeftEdge;
@@ -1419,7 +1394,6 @@
#undef INTERP_INT_TEX
#undef INTERP_TEX
#undef INTERP_MULTITEX
-#undef INTERP_LAMBDA
#undef INTERP_FLOAT_RGBA
#undef INTERP_FLOAT_SPEC
diff --git a/xc/extras/Mesa/src/swrast/s_zoom.c b/xc/extras/Mesa/src/swrast/s_zoom.c
index b56128147..0d1f08458 100644
--- a/xc/extras/Mesa/src/swrast/s_zoom.c
+++ b/xc/extras/Mesa/src/swrast/s_zoom.c
@@ -1,8 +1,7 @@
-/* $Id: s_zoom.c,v 1.1.1.1 2002/10/22 13:06:58 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -26,6 +25,8 @@
#include "glheader.h"
#include "macros.h"
+#include "imports.h"
+#include "colormac.h"
#include "s_context.h"
#include "s_span.h"
@@ -33,342 +34,229 @@
#include "s_zoom.h"
-
/*
- * Write a span of pixels to the frame buffer while applying a pixel zoom.
- * This is only used by glDrawPixels and glCopyPixels.
- * Input: n - number of pixels in input row
- * x, y - destination of the span
- * z - depth values for the span
- * red, green, blue, alpha - array of colors
- * y0 - location of first row in the image we're drawing.
+ * Helper function called from _mesa_write_zoomed_rgba/rgb/index_span().
*/
-void
-_mesa_write_zoomed_rgba_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y, const GLdepth z[],
- const GLfloat *fog,
- CONST GLchan rgba[][4], GLint y0 )
+static void
+zoom_span( GLcontext *ctx, const struct sw_span *span,
+ const GLvoid *src, GLint y0, GLenum format )
{
- GLint m;
- GLint r0, r1, row, r;
- GLint i, j, skipcol;
- GLchan zrgba[MAX_WIDTH][4]; /* zoomed pixel colors */
- GLdepth zdepth[MAX_WIDTH]; /* zoomed depth values */
- GLfloat zfog[MAX_WIDTH]; /* zoomed fog values */
- GLint maxwidth = MIN2( ctx->DrawBuffer->Width, MAX_WIDTH );
- const GLuint *srcRGBA32 = (const GLuint *) rgba;
- GLuint *dstRGBA32 = (GLuint *) zrgba;
-
- /* compute width of output row */
- m = (GLint) ABSF( n * ctx->Pixel.ZoomX );
- if (m==0) {
+ GLint r0, r1, row;
+ GLint c0, c1, skipCol;
+ GLint i, j;
+ const GLuint maxWidth = MIN2( ctx->DrawBuffer->Width, MAX_WIDTH );
+ GLchan rgbaSave[MAX_WIDTH][4];
+ GLuint indexSave[MAX_WIDTH];
+ const GLchan (*rgba)[4] = (const GLchan (*)[4]) src;
+ const GLchan (*rgb)[3] = (const GLchan (*)[3]) src;
+ const GLuint *indexes = (const GLuint *) src;
+ struct sw_span zoomed;
+ struct span_arrays zoomed_arrays; /* this is big! */
+
+ /* no pixel arrays! */
+ ASSERT((span->arrayMask & SPAN_XY) == 0);
+ ASSERT(span->primitive == GL_BITMAP);
+
+ INIT_SPAN(zoomed, GL_BITMAP, 0, 0, 0);
+ zoomed.array = &zoomed_arrays;
+
+ if (format == GL_RGBA || format == GL_RGB) {
+ zoomed.z = span->z;
+ zoomed.zStep = span->z;
+ zoomed.fog = span->fog;
+ zoomed.fogStep = span->fogStep;
+ zoomed.interpMask = span->interpMask & ~SPAN_RGBA;
+ zoomed.arrayMask |= SPAN_RGBA;
+ }
+ else if (format == GL_COLOR_INDEX) {
+ zoomed.z = span->z;
+ zoomed.zStep = span->z;
+ zoomed.fog = span->fog;
+ zoomed.fogStep = span->fogStep;
+ zoomed.interpMask = span->interpMask & ~SPAN_INDEX;
+ zoomed.arrayMask |= SPAN_INDEX;
+ }
+
+ /*
+ * Compute which columns to draw: [c0, c1)
+ */
+ c0 = (GLint) span->x;
+ c1 = (GLint) (span->x + span->end * ctx->Pixel.ZoomX);
+ if (c0 == c1) {
return;
}
- if (ctx->Pixel.ZoomX<0.0) {
- /* adjust x coordinate for left/right mirroring */
- x = x - m;
+ else if (c1 < c0) {
+ /* swap */
+ GLint ctmp = c1;
+ c1 = c0;
+ c0 = ctmp;
}
-
- /* compute which rows to draw */
- row = y-y0;
+ if (c0 < 0) {
+ zoomed.x = 0;
+ zoomed.start = 0;
+ zoomed.end = c1;
+ skipCol = -c0;
+ }
+ else {
+ zoomed.x = c0;
+ zoomed.start = 0;
+ zoomed.end = c1 - c0;
+ skipCol = 0;
+ }
+ if (zoomed.end > maxWidth)
+ zoomed.end = maxWidth;
+
+ /*
+ * Compute which rows to draw: [r0, r1)
+ */
+ row = span->y - y0;
r0 = y0 + (GLint) (row * ctx->Pixel.ZoomY);
r1 = y0 + (GLint) ((row+1) * ctx->Pixel.ZoomY);
- if (r0==r1) {
+ if (r0 == r1) {
return;
}
- else if (r1<r0) {
+ else if (r1 < r0) {
+ /* swap */
GLint rtmp = r1;
r1 = r0;
r0 = rtmp;
}
- /* return early if r0...r1 is above or below window */
- if (r0<0 && r1<0) {
- /* below window */
+ ASSERT(r0 < r1);
+ ASSERT(c0 < c1);
+
+ /*
+ * Trivial clip rejection testing.
+ */
+ if (r1 < 0) /* below window */
return;
- }
- if (r0 >= (GLint) ctx->DrawBuffer->Height &&
- r1 >= (GLint) ctx->DrawBuffer->Height) {
- /* above window */
+ if (r0 >= (GLint) ctx->DrawBuffer->Height) /* above window */
return;
- }
-
- /* check if left edge is outside window */
- skipcol = 0;
- if (x<0) {
- skipcol = -x;
- m += x;
- }
- /* make sure span isn't too long or short */
- if (m>maxwidth) {
- m = maxwidth;
- }
- else if (m<=0) {
+ if (c1 < 0) /* left of window */
+ return;
+ if (c0 >= (GLint) ctx->DrawBuffer->Width) /* right of window */
return;
- }
-
- assert( m <= MAX_WIDTH );
/* zoom the span horizontally */
- if (ctx->Pixel.ZoomX==-1.0F) {
- /* n==m */
- for (j=0;j<m;j++) {
- i = n - (j+skipcol) - 1;
- dstRGBA32[j] = srcRGBA32[i];
- zdepth[j] = z[i];
+ if (format == GL_RGBA) {
+ if (ctx->Pixel.ZoomX == -1.0F) {
+ /* common case */
+ for (j = (GLint) zoomed.start; j < (GLint) zoomed.end; j++) {
+ i = span->end - (j + skipCol) - 1;
+ COPY_CHAN4(zoomed.array->rgba[j], rgba[i]);
+ }
}
- if (fog && ctx->Fog.Enabled) {
- for (j=0;j<m;j++) {
- i = n - (j+skipcol) - 1;
- zfog[j] = fog[i];
- }
+ else {
+ /* general solution */
+ const GLfloat xscale = 1.0F / ctx->Pixel.ZoomX;
+ for (j = (GLint) zoomed.start; j < (GLint) zoomed.end; j++) {
+ i = (GLint) ((j + skipCol) * xscale);
+ if (i < 0)
+ i = span->end + i - 1;
+ COPY_CHAN4(zoomed.array->rgba[j], rgba[i]);
+ }
}
}
- else {
- GLfloat xscale = 1.0F / ctx->Pixel.ZoomX;
- for (j=0;j<m;j++) {
- i = (GLint) ((j+skipcol) * xscale);
- if (i<0) i = n + i - 1;
- dstRGBA32[j] = srcRGBA32[i];
- zdepth[j] = z[i];
+ else if (format == GL_RGB) {
+ if (ctx->Pixel.ZoomX == -1.0F) {
+ /* common case */
+ for (j = (GLint) zoomed.start; j < (GLint) zoomed.end; j++) {
+ i = span->end - (j + skipCol) - 1;
+ zoomed.array->rgba[j][0] = rgb[i][0];
+ zoomed.array->rgba[j][1] = rgb[i][1];
+ zoomed.array->rgba[j][2] = rgb[i][2];
+ zoomed.array->rgba[j][3] = CHAN_MAX;
+ }
}
- if (fog && ctx->Fog.Enabled) {
- for (j=0;j<m;j++) {
- i = (GLint) ((j+skipcol) * xscale);
- if (i<0) i = n + i - 1;
- zfog[j] = fog[i];
- }
+ else {
+ /* general solution */
+ const GLfloat xscale = 1.0F / ctx->Pixel.ZoomX;
+ for (j = (GLint) zoomed.start; j < (GLint) zoomed.end; j++) {
+ i = (GLint) ((j + skipCol) * xscale);
+ if (i < 0)
+ i = span->end + i - 1;
+ zoomed.array->rgba[j][0] = rgb[i][0];
+ zoomed.array->rgba[j][1] = rgb[i][1];
+ zoomed.array->rgba[j][2] = rgb[i][2];
+ zoomed.array->rgba[j][3] = CHAN_MAX;
+ }
}
}
-
- /* write the span */
- for (r=r0; r<r1; r++) {
- _mesa_write_rgba_span( ctx, m, x+skipcol, r, zdepth,
- (fog ? zfog : 0), zrgba, NULL, GL_BITMAP );
- }
-}
-
-
-
-void
-_mesa_write_zoomed_rgb_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y, const GLdepth z[],
- const GLfloat *fog,
- CONST GLchan rgb[][3], GLint y0 )
-{
- GLint m;
- GLint r0, r1, row, r;
- GLint i, j, skipcol;
- GLchan zrgba[MAX_WIDTH][4]; /* zoomed pixel colors */
- GLdepth zdepth[MAX_WIDTH]; /* zoomed depth values */
- GLfloat zfog[MAX_WIDTH]; /* zoomed fog values */
- GLint maxwidth = MIN2( ctx->DrawBuffer->Width, MAX_WIDTH );
-
- /* compute width of output row */
- m = (GLint) ABSF( n * ctx->Pixel.ZoomX );
- if (m==0) {
- return;
- }
- if (ctx->Pixel.ZoomX<0.0) {
- /* adjust x coordinate for left/right mirroring */
- x = x - m;
- }
-
- /* compute which rows to draw */
- row = y-y0;
- r0 = y0 + (GLint) (row * ctx->Pixel.ZoomY);
- r1 = y0 + (GLint) ((row+1) * ctx->Pixel.ZoomY);
- if (r0==r1) {
- return;
- }
- else if (r1<r0) {
- GLint rtmp = r1;
- r1 = r0;
- r0 = rtmp;
- }
-
- /* return early if r0...r1 is above or below window */
- if (r0<0 && r1<0) {
- /* below window */
- return;
- }
- if (r0 >= (GLint) ctx->DrawBuffer->Height &&
- r1 >= (GLint) ctx->DrawBuffer->Height) {
- /* above window */
- return;
- }
-
- /* check if left edge is outside window */
- skipcol = 0;
- if (x<0) {
- skipcol = -x;
- m += x;
- }
- /* make sure span isn't too long or short */
- if (m>maxwidth) {
- m = maxwidth;
- }
- else if (m<=0) {
- return;
+ else if (format == GL_COLOR_INDEX) {
+ if (ctx->Pixel.ZoomX == -1.0F) {
+ /* common case */
+ for (j = (GLint) zoomed.start; j < (GLint) zoomed.end; j++) {
+ i = span->end - (j + skipCol) - 1;
+ zoomed.array->index[j] = indexes[i];
+ }
+ }
+ else {
+ /* general solution */
+ const GLfloat xscale = 1.0F / ctx->Pixel.ZoomX;
+ for (j = (GLint) zoomed.start; j < (GLint) zoomed.end; j++) {
+ i = (GLint) ((j + skipCol) * xscale);
+ if (i < 0)
+ i = span->end + i - 1;
+ zoomed.array->index[j] = indexes[i];
+ }
+ }
}
- assert( m <= MAX_WIDTH );
-
- /* zoom the span horizontally */
- if (ctx->Pixel.ZoomX==-1.0F) {
- /* n==m */
- for (j=0;j<m;j++) {
- i = n - (j+skipcol) - 1;
- zrgba[j][0] = rgb[i][0];
- zrgba[j][1] = rgb[i][1];
- zrgba[j][2] = rgb[i][2];
- zrgba[j][3] = CHAN_MAX;
- zdepth[j] = z[i];
+ /* write the span in rows [r0, r1) */
+ if (format == GL_RGBA || format == GL_RGB) {
+ /* Writing the span may modify the colors, so make a backup now if we're
+ * going to call _mesa_write_zoomed_span() more than once.
+ */
+ if (r1 - r0 > 1) {
+ MEMCPY(rgbaSave, zoomed.array->rgba, zoomed.end * 4 * sizeof(GLchan));
}
- if (fog && ctx->Fog.Enabled) {
- for (j=0;j<m;j++) {
- i = n - (j+skipcol) - 1;
- zfog[j] = fog[i];
- }
+ for (zoomed.y = r0; zoomed.y < r1; zoomed.y++) {
+ _mesa_write_rgba_span(ctx, &zoomed);
+ if (r1 - r0 > 1) {
+ /* restore the colors */
+ MEMCPY(zoomed.array->rgba, rgbaSave, zoomed.end*4 * sizeof(GLchan));
+ }
}
}
- else {
- GLfloat xscale = 1.0F / ctx->Pixel.ZoomX;
- for (j=0;j<m;j++) {
- i = (GLint) ((j+skipcol) * xscale);
- if (i<0) i = n + i - 1;
- zrgba[j][0] = rgb[i][0];
- zrgba[j][1] = rgb[i][1];
- zrgba[j][2] = rgb[i][2];
- zrgba[j][3] = CHAN_MAX;
- zdepth[j] = z[i];
+ else if (format == GL_COLOR_INDEX) {
+ if (r1 - r0 > 1) {
+ MEMCPY(indexSave, zoomed.array->index, zoomed.end * sizeof(GLuint));
}
- if (fog && ctx->Fog.Enabled) {
- for (j=0;j<m;j++) {
- i = (GLint) ((j+skipcol) * xscale);
- if (i<0) i = n + i - 1;
- zfog[j] = fog[i];
- }
+ for (zoomed.y = r0; zoomed.y < r1; zoomed.y++) {
+ _mesa_write_index_span(ctx, &zoomed);
+ if (r1 - r0 > 1) {
+ /* restore the colors */
+ MEMCPY(zoomed.array->index, indexSave, zoomed.end * sizeof(GLuint));
+ }
}
}
-
- /* write the span */
- for (r=r0; r<r1; r++) {
- _mesa_write_rgba_span( ctx, m, x+skipcol, r, zdepth,
- (fog ? zfog : 0), zrgba, NULL, GL_BITMAP );
- }
}
-
-/*
- * As above, but write CI pixels.
- */
void
-_mesa_write_zoomed_index_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y, const GLdepth z[],
- const GLfloat *fog,
- const GLuint indexes[], GLint y0 )
+_mesa_write_zoomed_rgba_span( GLcontext *ctx, const struct sw_span *span,
+ CONST GLchan rgba[][4], GLint y0 )
{
- GLint m;
- GLint r0, r1, row, r;
- GLint i, j, skipcol;
- GLuint zindexes[MAX_WIDTH]; /* zoomed color indexes */
- GLdepth zdepth[MAX_WIDTH]; /* zoomed depth values */
- GLfloat zfog[MAX_WIDTH]; /* zoomed fog values */
- GLint maxwidth = MIN2( ctx->DrawBuffer->Width, MAX_WIDTH );
-
- /* compute width of output row */
- m = (GLint) ABSF( n * ctx->Pixel.ZoomX );
- if (m==0) {
- return;
- }
- if (ctx->Pixel.ZoomX<0.0) {
- /* adjust x coordinate for left/right mirroring */
- x = x - m;
- }
-
- /* compute which rows to draw */
- row = y-y0;
- r0 = y0 + (GLint) (row * ctx->Pixel.ZoomY);
- r1 = y0 + (GLint) ((row+1) * ctx->Pixel.ZoomY);
- if (r0==r1) {
- return;
- }
- else if (r1<r0) {
- GLint rtmp = r1;
- r1 = r0;
- r0 = rtmp;
- }
-
- /* return early if r0...r1 is above or below window */
- if (r0<0 && r1<0) {
- /* below window */
- return;
- }
- if (r0 >= (GLint) ctx->DrawBuffer->Height &&
- r1 >= (GLint) ctx->DrawBuffer->Height) {
- /* above window */
- return;
- }
+ zoom_span(ctx, span, (const GLvoid *) rgba, y0, GL_RGBA);
+}
- /* check if left edge is outside window */
- skipcol = 0;
- if (x<0) {
- skipcol = -x;
- m += x;
- }
- /* make sure span isn't too long or short */
- if (m>maxwidth) {
- m = maxwidth;
- }
- else if (m<=0) {
- return;
- }
- assert( m <= MAX_WIDTH );
+void
+_mesa_write_zoomed_rgb_span( GLcontext *ctx, const struct sw_span *span,
+ CONST GLchan rgb[][3], GLint y0 )
+{
+ zoom_span(ctx, span, (const GLvoid *) rgb, y0, GL_RGB);
+}
- /* zoom the span horizontally */
- if (ctx->Pixel.ZoomX==-1.0F) {
- /* n==m */
- for (j=0;j<m;j++) {
- i = n - (j+skipcol) - 1;
- zindexes[j] = indexes[i];
- zdepth[j] = z[i];
- }
- if (fog && ctx->Fog.Enabled) {
- for (j=0;j<m;j++) {
- i = n - (j+skipcol) - 1;
- zfog[j] = fog[i];
- }
- }
- }
- else {
- GLfloat xscale = 1.0F / ctx->Pixel.ZoomX;
- for (j=0;j<m;j++) {
- i = (GLint) ((j+skipcol) * xscale);
- if (i<0) i = n + i - 1;
- zindexes[j] = indexes[i];
- zdepth[j] = z[i];
- }
- if (fog && ctx->Fog.Enabled) {
- for (j=0;j<m;j++) {
- i = (GLint) ((j+skipcol) * xscale);
- if (i<0) i = n + i - 1;
- zfog[j] = fog[i];
- }
- }
- }
- /* write the span */
- for (r=r0; r<r1; r++) {
- _mesa_write_index_span( ctx, m, x+skipcol, r, zdepth,
- (fog ? zfog : 0), zindexes, NULL, GL_BITMAP );
- }
+void
+_mesa_write_zoomed_index_span( GLcontext *ctx, const struct sw_span *span,
+ GLint y0 )
+{
+ zoom_span(ctx, span, (const GLvoid *) span->array->index, y0, GL_COLOR_INDEX);
}
-
/*
* As above, but write stencil values.
*/
@@ -431,7 +319,7 @@ _mesa_write_zoomed_stencil_span( GLcontext *ctx,
return;
}
- assert( m <= MAX_WIDTH );
+ ASSERT( m <= MAX_WIDTH );
/* zoom the span horizontally */
if (ctx->Pixel.ZoomX==-1.0F) {
diff --git a/xc/extras/Mesa/src/swrast/s_zoom.h b/xc/extras/Mesa/src/swrast/s_zoom.h
index a55223607..bdc7013e0 100644
--- a/xc/extras/Mesa/src/swrast/s_zoom.h
+++ b/xc/extras/Mesa/src/swrast/s_zoom.h
@@ -1,10 +1,9 @@
-/* $Id: s_zoom.h,v 1.1.1.1 2002/10/22 13:06:58 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,39 +23,26 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
#ifndef S_ZOOM_H
#define S_ZOOM_H
-
#include "mtypes.h"
-
+#include "swrast.h"
extern void
-_mesa_write_zoomed_rgba_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y, const GLdepth z[],
- const GLfloat *fog,
- CONST GLchan rgba[][4], GLint y0 );
-
+_mesa_write_zoomed_rgba_span( GLcontext *ctx, const struct sw_span *span,
+ CONST GLchan rgb[][4], GLint y0 );
extern void
-_mesa_write_zoomed_rgb_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y, const GLdepth z[],
- const GLfloat *fog,
+_mesa_write_zoomed_rgb_span( GLcontext *ctx, const struct sw_span *span,
CONST GLchan rgb[][3], GLint y0 );
-
extern void
-_mesa_write_zoomed_index_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y, const GLdepth z[],
- const GLfloat *fog,
- const GLuint indexes[], GLint y0 );
-
+_mesa_write_zoomed_index_span( GLcontext *ctx, const struct sw_span *span,
+ GLint y0 );
extern void
-_mesa_write_zoomed_stencil_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y,
+_mesa_write_zoomed_stencil_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
const GLstencil stencil[], GLint y0 );
-
#endif
diff --git a/xc/extras/Mesa/src/swrast/swrast.h b/xc/extras/Mesa/src/swrast/swrast.h
index 7149be8fb..76e9ca24d 100644
--- a/xc/extras/Mesa/src/swrast/swrast.h
+++ b/xc/extras/Mesa/src/swrast/swrast.h
@@ -1,10 +1,9 @@
-/* $Id: swrast.h,v 1.1.1.1 2002/10/22 13:06:46 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -23,8 +22,12 @@
* AN ACTION OF 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>
+ */
+
+/**
+ * \file swrast/swrast.h
+ * \brief Defines basic structures for sw_rasterizer.
+ * \author Keith Whitwell <keith@tungstengraphics.com>
*/
#ifndef SWRAST_H
@@ -32,9 +35,11 @@
#include "mtypes.h"
-
-
-/* The software rasterizer now uses this format for vertices. Thus a
+/**
+ * \struct SWvertex
+ * \brief Data-structure to handle vertices in the software rasterizer.
+ *
+ * The software rasterizer now uses this format for vertices. Thus a
* 'RasterSetup' stage or other translation is required between the
* tnl module and the swrast rasterization functions. This serves to
* isolate the swrast module from the internals of the tnl module, and
@@ -57,6 +62,8 @@
* primitives unaccelerated), hook in swrast_setup instead.
*/
typedef struct {
+ /** win[0], win[1] are the screen-coords of SWvertex. win[2] is the
+ * z-coord. what is win[3]? */
GLfloat win[4];
GLfloat texcoord[MAX_TEXTURE_UNITS][4];
GLchan color[4];
@@ -67,6 +74,154 @@ typedef struct {
} SWvertex;
+/**
+ * \struct sw_span
+ * \brief Contains data for either a horizontal line or a set of
+ * pixels that are passed through a pipeline of functions before being
+ * drawn.
+ *
+ * The sw_span structure describes the colors, Z, fogcoord, texcoords,
+ * etc for either a horizontal run or a set of independent pixels. We
+ * can either specify a base/step to indicate interpolated values, or
+ * fill in arrays of values. The interpMask and arrayMask bitfields
+ * indicate which are active.
+ *
+ * With this structure it's easy to hand-off span rasterization to
+ * subroutines instead of doing it all inline in the triangle functions
+ * like we used to do.
+ * It also cleans up the local variable namespace a great deal.
+ *
+ * It would be interesting to experiment with multiprocessor rasterization
+ * with this structure. The triangle rasterizer could simply emit a
+ * stream of these structures which would be consumed by one or more
+ * span-processing threads which could run in parallel.
+ */
+
+
+/**
+ * \defgroup SpanFlags SPAN_XXX-flags
+ * Bitmasks to indicate which span_arrays need to be computed
+ * (sw_span::interpMask) or have already been filled
+ * (sw_span::arrayMask)
+ */
+/*@{*/
+#define SPAN_RGBA 0x001
+#define SPAN_SPEC 0x002
+#define SPAN_INDEX 0x004
+#define SPAN_Z 0x008
+#define SPAN_FOG 0x010
+#define SPAN_TEXTURE 0x020
+#define SPAN_INT_TEXTURE 0x040
+#define SPAN_LAMBDA 0x080
+#define SPAN_COVERAGE 0x100
+#define SPAN_FLAT 0x200 /**< flat shading? */
+/** sw_span::arrayMask only - for span_arrays::x, span_arrays::y */
+#define SPAN_XY 0x400
+#define SPAN_MASK 0x800 /**< sw_span::arrayMask only */
+/*@}*/
+
+
+/**
+ * \struct 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.
+ */
+struct span_arrays {
+ GLchan rgb[MAX_WIDTH][3];
+ GLchan rgba[MAX_WIDTH][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 */
+ GLdepth z[MAX_WIDTH];
+ GLfloat fog[MAX_WIDTH];
+ GLfloat texcoords[MAX_TEXTURE_UNITS][MAX_WIDTH][4];
+ GLfloat lambda[MAX_TEXTURE_UNITS][MAX_WIDTH];
+ GLfloat coverage[MAX_WIDTH];
+
+ /** This mask indicates if fragment is alive or culled */
+ GLubyte mask[MAX_WIDTH];
+};
+
+
+struct sw_span {
+ GLint x, y;
+
+ /** Only need to process pixels between start <= i < end */
+ /** At this time, start is always zero. */
+ GLuint start, end;
+
+ /** This flag indicates that mask[] array is effectively filled with ones */
+ GLboolean writeAll;
+
+ /** either GL_POLYGON, GL_LINE, GL_POLYGON, GL_BITMAP */
+ GLenum primitive;
+
+ /** 0 = front-facing span, 1 = back-facing span (for two-sided stencil) */
+ GLuint facing;
+
+ /**
+ * This bitmask (of \link SpanFlags SPAN_* flags\endlink) indicates
+ * which of the x/xStep variables are relevant.
+ */
+ GLuint interpMask;
+
+#if CHAN_TYPE == GL_FLOAT
+ GLfloat red, redStep;
+ GLfloat green, greenStep;
+ GLfloat blue, blueStep;
+ GLfloat alpha, alphaStep;
+ GLfloat specRed, specRedStep;
+ GLfloat specGreen, specGreenStep;
+ GLfloat specBlue, specBlueStep;
+#else /* CHAN_TYPE == GL_UNSIGNED_BYTE or GL_UNSIGNED SHORT */
+ GLfixed red, redStep;
+ GLfixed green, greenStep;
+ GLfixed blue, blueStep;
+ GLfixed alpha, alphaStep;
+ GLfixed specRed, specRedStep;
+ GLfixed specGreen, specGreenStep;
+ GLfixed specBlue, specBlueStep;
+#endif
+ GLfixed index, indexStep;
+ GLfixed z, zStep;
+ GLfloat fog, fogStep;
+ GLfloat tex[MAX_TEXTURE_UNITS][4];
+ GLfloat texStepX[MAX_TEXTURE_UNITS][4];
+ GLfloat texStepY[MAX_TEXTURE_UNITS][4];
+ GLfixed intTex[2], intTexStep[2];
+
+ /**
+ * This bitmask (of \link SpanFlags SPAN_* flags\endlink) indicates
+ * which of the fragment arrays in the span_arrays struct are relevant.
+ */
+ GLuint arrayMask;
+
+ /**
+ * We store the arrays of fragment values in a separate struct so
+ * that we can allocate sw_span structs on the stack without using
+ * 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;
+};
+
+
+#define INIT_SPAN(S, PRIMITIVE, END, INTERP_MASK, ARRAY_MASK) \
+do { \
+ (S).primitive = (PRIMITIVE); \
+ (S).interpMask = (INTERP_MASK); \
+ (S).arrayMask = (ARRAY_MASK); \
+ (S).start = 0; \
+ (S).end = (END); \
+ (S).facing = 0; \
+ (S).array = SWRAST_CONTEXT(ctx)->SpanArrays; \
+} while (0)
+
+
+
struct swrast_device_driver;
@@ -75,6 +230,12 @@ struct swrast_device_driver;
extern void
_swrast_alloc_buffers( GLframebuffer *buffer );
+extern void
+_swrast_use_read_buffer( GLcontext *ctx );
+
+extern void
+_swrast_use_draw_buffer( GLcontext *ctx );
+
extern GLboolean
_swrast_CreateContext( GLcontext *ctx );
@@ -125,6 +286,10 @@ _swrast_Accum( GLcontext *ctx, GLenum op,
GLint width, GLint height );
+extern void
+_swrast_DrawBuffer( GLcontext *ctx, GLenum mode );
+
+
/* Reset the stipple counter
*/
extern void
@@ -153,6 +318,14 @@ _swrast_Quad( GLcontext *ctx,
extern void
_swrast_flush( GLcontext *ctx );
+extern void
+_swrast_render_primitive( GLcontext *ctx, GLenum mode );
+
+extern void
+_swrast_render_start( GLcontext *ctx );
+
+extern void
+_swrast_render_finish( GLcontext *ctx );
/* Tell the software rasterizer about core state changes.
*/
@@ -177,19 +350,19 @@ _swrast_print_vertex( GLcontext *ctx, const SWvertex *v );
* Imaging fallbacks (a better solution should be found, perhaps
* moving all the imaging fallback code to a new module)
*/
-void
+extern void
_swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target,
GLenum internalFormat,
GLint x, GLint y, GLsizei width,
GLsizei height);
-void
+extern void
_swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target,
GLenum internalFormat,
GLint x, GLint y, GLsizei width);
-void
+extern void
_swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start,
GLint x, GLint y, GLsizei width);
-void
+extern void
_swrast_CopyColorTable( GLcontext *ctx,
GLenum target, GLenum internalformat,
GLint x, GLint y, GLsizei width);
@@ -201,48 +374,51 @@ _swrast_CopyColorTable( GLcontext *ctx,
*/
extern void
_swrast_copy_teximage1d(GLcontext *ctx, GLenum target, GLint level,
- GLenum internalFormat,
- GLint x, GLint y, GLsizei width, GLint border);
+ GLenum internalFormat,
+ GLint x, GLint y, GLsizei width, GLint border);
extern void
_swrast_copy_teximage2d(GLcontext *ctx, GLenum target, GLint level,
- GLenum internalFormat,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLint border);
+ GLenum internalFormat,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLint border);
extern void
_swrast_copy_texsubimage1d(GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y, GLsizei width);
+ GLint xoffset, GLint x, GLint y, GLsizei width);
extern void
_swrast_copy_texsubimage2d(GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint x, GLint y, GLsizei width, GLsizei height);
+ GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height);
extern void
_swrast_copy_texsubimage3d(GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLint x, GLint y, GLsizei width, GLsizei height);
+ GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height);
-/* The driver interface for the software rasterizer. Unless otherwise
- * noted, all functions are mandatory.
+/* The driver interface for the software rasterizer.
+ * Unless otherwise noted, all functions are mandatory.
*/
struct swrast_device_driver {
- void (*SetReadBuffer)( GLcontext *ctx, GLframebuffer *colorBuffer,
- GLenum buffer );
+ void (*SetBuffer)( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit);
/*
- * Specifies the current buffer for span/pixel reading.
- * colorBuffer will be one of:
- * GL_FRONT_LEFT - this buffer always exists
- * GL_BACK_LEFT - when double buffering
- * GL_FRONT_RIGHT - when using stereo
- * GL_BACK_RIGHT - when using stereo and double buffering
+ * Specifies the current buffer for span/pixel writing/reading.
+ * buffer indicates which window to write to / read from. Normally,
+ * this'll be the buffer currently bound to the context, but it doesn't
+ * have to be!
+ * bufferBit indicates which color buffer, one of:
+ * FRONT_LEFT_BIT - this buffer always exists
+ * BACK_LEFT_BIT - when double buffering
+ * FRONT_RIGHT_BIT - when using stereo
+ * BACK_RIGHT_BIT - when using stereo and double buffering
+ * AUXn_BIT - if aux buffers are implemented
*/
diff --git a/xc/extras/Mesa/src/swrast_setup/ss_context.c b/xc/extras/Mesa/src/swrast_setup/ss_context.c
index 974f18bd4..c000e4194 100644
--- a/xc/extras/Mesa/src/swrast_setup/ss_context.c
+++ b/xc/extras/Mesa/src/swrast_setup/ss_context.c
@@ -1,10 +1,9 @@
-/* $Id: ss_context.c,v 1.1.1.1 2002/10/22 13:06:38 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,11 +23,11 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#include "glheader.h"
-#include "mem.h"
+#include "imports.h"
#include "ss_context.h"
#include "ss_triangle.h"
#include "ss_vb.h"
@@ -49,7 +48,6 @@
#define _SWSETUP_NEW_RENDERINDEX (_NEW_POLYGON|_NEW_LIGHT)
-
GLboolean
_swsetup_CreateContext( GLcontext *ctx )
{
@@ -99,8 +97,13 @@ static void
_swsetup_RenderPrimitive( GLcontext *ctx, GLenum mode )
{
SWSETUP_CONTEXT(ctx)->render_prim = mode;
+ _swrast_render_primitive( ctx, mode );
}
+/*
+ * We patch this function into tnl->Driver.Render.Start.
+ * It's called when we start rendering a vertex buffer.
+ */
static void
_swsetup_RenderStart( GLcontext *ctx )
{
@@ -117,19 +120,17 @@ _swsetup_RenderStart( GLcontext *ctx )
swsetup->NewState = 0;
- if (swsetup->Driver.Start)
- swsetup->Driver.Start( ctx );
+ _swrast_render_start( ctx );
}
+/*
+ * We patch this function into tnl->Driver.Render.Finish.
+ * It's called when we finish rendering a vertex buffer.
+ */
static void
_swsetup_RenderFinish( GLcontext *ctx )
{
- SScontext *swsetup = SWSETUP_CONTEXT(ctx);
-
- _swrast_flush( ctx );
-
- if (swsetup->Driver.Finish)
- swsetup->Driver.Finish( ctx );
+ _swrast_render_finish( ctx );
}
void
diff --git a/xc/extras/Mesa/src/swrast_setup/ss_context.h b/xc/extras/Mesa/src/swrast_setup/ss_context.h
index d7b595461..84813e98e 100644
--- a/xc/extras/Mesa/src/swrast_setup/ss_context.h
+++ b/xc/extras/Mesa/src/swrast_setup/ss_context.h
@@ -1,10 +1,9 @@
-/* $Id: ss_context.h,v 1.1.1.1 2002/10/22 13:06:38 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#ifndef SS_CONTEXT_H
@@ -44,12 +43,6 @@ typedef struct {
*/
struct gl_client_array ChanColor;
struct gl_client_array ChanSecondaryColor;
-
-
- struct {
- void (*Start)( GLcontext * );
- void (*Finish)( GLcontext * );
- } Driver;
} SScontext;
#define SWSETUP_CONTEXT(ctx) ((SScontext *)ctx->swsetup_context)
diff --git a/xc/extras/Mesa/src/swrast_setup/ss_triangle.c b/xc/extras/Mesa/src/swrast_setup/ss_triangle.c
index 3a3cf1f32..b041c32ef 100644
--- a/xc/extras/Mesa/src/swrast_setup/ss_triangle.c
+++ b/xc/extras/Mesa/src/swrast_setup/ss_triangle.c
@@ -1,4 +1,3 @@
-/* $Id: ss_triangle.c,v 1.1.1.1 2002/10/22 13:06:38 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#include "glheader.h"
@@ -48,7 +47,8 @@ static quad_func quad_tab[SS_MAX_TRIFUNC];
static void _swsetup_render_line_tri( GLcontext *ctx,
- GLuint e0, GLuint e1, GLuint e2 )
+ GLuint e0, GLuint e1, GLuint e2,
+ GLuint facing )
{
SScontext *swsetup = SWSETUP_CONTEXT(ctx);
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
@@ -61,6 +61,14 @@ static void _swsetup_render_line_tri( GLcontext *ctx,
GLchan s[2][4];
GLuint i[2];
+ /* cull testing */
+ if (ctx->Polygon.CullFlag) {
+ if (facing == 1 && ctx->Polygon.CullFaceMode != GL_FRONT)
+ return;
+ if (facing == 0 && ctx->Polygon.CullFaceMode != GL_BACK)
+ return;
+ }
+
if (ctx->_TriangleCaps & DD_FLATSHADE) {
COPY_CHAN4(c[0], v0->color);
COPY_CHAN4(c[1], v1->color);
@@ -98,7 +106,8 @@ static void _swsetup_render_line_tri( GLcontext *ctx,
}
static void _swsetup_render_point_tri( GLcontext *ctx,
- GLuint e0, GLuint e1, GLuint e2 )
+ GLuint e0, GLuint e1, GLuint e2,
+ GLuint facing )
{
SScontext *swsetup = SWSETUP_CONTEXT(ctx);
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
@@ -111,6 +120,14 @@ static void _swsetup_render_point_tri( GLcontext *ctx,
GLchan s[2][4];
GLuint i[2];
+ /* cull testing */
+ if (ctx->Polygon.CullFlag) {
+ if (facing == 1 && ctx->Polygon.CullFaceMode != GL_FRONT)
+ return;
+ if (facing == 0 && ctx->Polygon.CullFaceMode != GL_BACK)
+ return;
+ }
+
if (ctx->_TriangleCaps & DD_FLATSHADE) {
COPY_CHAN4(c[0], v0->color);
COPY_CHAN4(c[1], v1->color);
@@ -139,6 +156,7 @@ static void _swsetup_render_point_tri( GLcontext *ctx,
v0->index = i[0];
v1->index = i[1];
}
+ _swrast_flush(ctx);
}
#define SS_COLOR(a,b) COPY_CHAN4(a,b)
@@ -265,13 +283,19 @@ void _swsetup_choose_trifuncs( GLcontext *ctx )
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint ind = 0;
- if (ctx->Polygon._OffsetAny)
+ if (ctx->Polygon.OffsetPoint ||
+ ctx->Polygon.OffsetLine ||
+ ctx->Polygon.OffsetFill)
ind |= SS_OFFSET_BIT;
if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
ind |= SS_TWOSIDE_BIT;
- if (ctx->_TriangleCaps & DD_TRI_UNFILLED)
+ /* We piggyback the two-sided stencil front/back determination on the
+ * unfilled triangle path.
+ */
+ if ((ctx->_TriangleCaps & DD_TRI_UNFILLED) ||
+ (ctx->Stencil.Enabled && ctx->Stencil.TestTwoSide))
ind |= SS_UNFILLED_BIT;
if (ctx->Visual.rgbMode)
@@ -281,4 +305,6 @@ void _swsetup_choose_trifuncs( GLcontext *ctx )
tnl->Driver.Render.Quad = quad_tab[ind];
tnl->Driver.Render.Line = swsetup_line;
tnl->Driver.Render.Points = swsetup_points;
+
+ ctx->_Facing = 0;
}
diff --git a/xc/extras/Mesa/src/swrast_setup/ss_triangle.h b/xc/extras/Mesa/src/swrast_setup/ss_triangle.h
index 655d7deab..78833269e 100644
--- a/xc/extras/Mesa/src/swrast_setup/ss_triangle.h
+++ b/xc/extras/Mesa/src/swrast_setup/ss_triangle.h
@@ -1,4 +1,3 @@
-/* $Id: ss_triangle.h,v 1.1.1.1 2002/10/22 13:06:38 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#ifndef SS_TRIANGLE_H
diff --git a/xc/extras/Mesa/src/swrast_setup/ss_tritmp.h b/xc/extras/Mesa/src/swrast_setup/ss_tritmp.h
index 9801b7ab7..77219fc60 100644
--- a/xc/extras/Mesa/src/swrast_setup/ss_tritmp.h
+++ b/xc/extras/Mesa/src/swrast_setup/ss_tritmp.h
@@ -1,10 +1,9 @@
-/* $Id: ss_tritmp.h,v 1.1.1.1 2002/10/22 13:06:39 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 5.0
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
@@ -36,7 +35,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
GLfloat z[3];
GLfloat offset;
GLenum mode = GL_FILL;
- GLuint facing;
+ GLuint facing = 0;
v[0] = &verts[e0];
v[1] = &verts[e1];
@@ -54,6 +53,8 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
if (IND & (SS_TWOSIDE_BIT | SS_UNFILLED_BIT))
{
facing = (cc < 0.0) ^ ctx->Polygon._FrontBit;
+ if (ctx->Stencil.TestTwoSide)
+ ctx->_Facing = facing; /* for 2-sided stencil test */
if (IND & SS_UNFILLED_BIT)
mode = facing ? ctx->Polygon.BackMode : ctx->Polygon.FrontMode;
@@ -110,14 +111,14 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
v[1]->win[2] += offset;
v[2]->win[2] += offset;
}
- _swsetup_render_point_tri( ctx, e0, e1, e2 );
+ _swsetup_render_point_tri( ctx, e0, e1, e2, facing );
} else if (mode == GL_LINE) {
if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetLine) {
v[0]->win[2] += offset;
v[1]->win[2] += offset;
v[2]->win[2] += offset;
}
- _swsetup_render_line_tri( ctx, e0, e1, e2 );
+ _swsetup_render_line_tri( ctx, e0, e1, e2, facing );
} else {
if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetFill) {
v[0]->win[2] += offset;
diff --git a/xc/extras/Mesa/src/swrast_setup/ss_vb.c b/xc/extras/Mesa/src/swrast_setup/ss_vb.c
index 8f5d9161f..7f6832b4c 100644
--- a/xc/extras/Mesa/src/swrast_setup/ss_vb.c
+++ b/xc/extras/Mesa/src/swrast_setup/ss_vb.c
@@ -1,8 +1,7 @@
-/* $Id: ss_vb.c,v 1.1.1.1 2002/10/22 13:06:38 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -24,13 +23,14 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#include "glheader.h"
#include "colormac.h"
+#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "swrast/swrast.h"
#include "tnl/t_context.h"
@@ -291,33 +291,32 @@ static void copy_pv_extras( GLcontext *ctx, GLuint dst, GLuint src )
* Initialization
***********************************************************************/
-
-
-
-
static void
emit_invalid( GLcontext *ctx, GLuint start, GLuint end, GLuint newinputs )
{
- fprintf(stderr, "swrast_setup: invalid setup function\n");
+ _mesa_debug(ctx, "swrast_setup: invalid setup function\n");
(void) (ctx && start && end && newinputs);
}
+
static void
interp_invalid( GLcontext *ctx, GLfloat t,
GLuint edst, GLuint eout, GLuint ein,
GLboolean force_boundary )
{
- fprintf(stderr, "swrast_setup: invalid interp function\n");
+ _mesa_debug(ctx, "swrast_setup: invalid interp function\n");
(void) (ctx && t && edst && eout && ein && force_boundary);
}
+
static void
copy_pv_invalid( GLcontext *ctx, GLuint edst, GLuint esrc )
{
- fprintf(stderr, "swrast_setup: invalid copy_pv function\n");
+ _mesa_debug(ctx, "swrast_setup: invalid copy_pv function\n");
(void) (ctx && edst && esrc );
}
+
static void init_standard( void )
{
GLuint i;
@@ -359,21 +358,24 @@ static void init_standard( void )
init_index_fog_point();
}
-static void printSetupFlags(char *msg, GLuint flags )
+
+/* debug only */
+#if 0
+static void
+printSetupFlags(const GLcontext *ctx, char *msg, GLuint flags )
{
- fprintf(stderr, "%s(%x): %s%s%s%s%s%s%s\n",
- msg,
- (int)flags,
- (flags & COLOR) ? "color, " : "",
- (flags & INDEX) ? "index, " : "",
- (flags & TEX0) ? "tex0, " : "",
- (flags & MULTITEX) ? "multitex, " : "",
- (flags & SPEC) ? "spec, " : "",
- (flags & FOG) ? "fog, " : "",
- (flags & POINT) ? "point, " : "");
+ _mesa_debug(ctx, "%s(%x): %s%s%s%s%s%s%s\n",
+ msg,
+ (int) flags,
+ (flags & COLOR) ? "color, " : "",
+ (flags & INDEX) ? "index, " : "",
+ (flags & TEX0) ? "tex0, " : "",
+ (flags & MULTITEX) ? "multitex, " : "",
+ (flags & SPEC) ? "spec, " : "",
+ (flags & FOG) ? "fog, " : "",
+ (flags & POINT) ? "point, " : "");
}
-
-
+#endif
void
_swsetup_choose_rastersetup_func(GLcontext *ctx)
@@ -386,10 +388,10 @@ _swsetup_choose_rastersetup_func(GLcontext *ctx)
if (ctx->Visual.rgbMode) {
funcindex = COLOR;
- if (ctx->Texture._ReallyEnabled & ~TEXTURE0_ANY)
- funcindex |= MULTITEX;
- else if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY)
- funcindex |= TEX0;
+ if (ctx->Texture._EnabledUnits > 1)
+ funcindex |= MULTITEX; /* a unit above unit[0] is enabled */
+ else if (ctx->Texture._EnabledUnits == 1)
+ funcindex |= TEX0; /* only unit 0 is enabled */
if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
funcindex |= SPEC;
@@ -398,7 +400,8 @@ _swsetup_choose_rastersetup_func(GLcontext *ctx)
funcindex = INDEX;
}
- if (ctx->Point._Attenuated)
+ if (ctx->Point._Attenuated ||
+ (ctx->VertexProgram.Enabled && ctx->VertexProgram.PointSizeEnabled))
funcindex |= POINT;
if (ctx->Fog.Enabled)
@@ -435,6 +438,8 @@ _swsetup_vb_init( GLcontext *ctx )
{
(void) ctx;
init_standard();
- (void) printSetupFlags;
+ /*
+ printSetupFlags(ctx);
+ */
}
diff --git a/xc/extras/Mesa/src/swrast_setup/ss_vb.h b/xc/extras/Mesa/src/swrast_setup/ss_vb.h
index c9c1f8cd8..6ea0cb1a7 100644
--- a/xc/extras/Mesa/src/swrast_setup/ss_vb.h
+++ b/xc/extras/Mesa/src/swrast_setup/ss_vb.h
@@ -1,4 +1,3 @@
-/* $Id: ss_vb.h,v 1.1.1.1 2002/10/22 13:06:38 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#ifndef SS_VB_H
diff --git a/xc/extras/Mesa/src/swrast_setup/ss_vbtmp.h b/xc/extras/Mesa/src/swrast_setup/ss_vbtmp.h
index c2a48aca1..ba5f20fde 100644
--- a/xc/extras/Mesa/src/swrast_setup/ss_vbtmp.h
+++ b/xc/extras/Mesa/src/swrast_setup/ss_vbtmp.h
@@ -1,8 +1,7 @@
-/* $Id: ss_vbtmp.h,v 1.1.1.1 2002/10/22 13:06:38 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
@@ -73,11 +72,11 @@ static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end,
}
}
- proj = VB->ProjectedClipPtr->data[0];
- proj_stride = VB->ProjectedClipPtr->stride;
+ proj = VB->NdcPtr->data[0];
+ proj_stride = VB->NdcPtr->stride;
if (IND & FOG) {
- fog = VB->FogCoordPtr->data;
+ fog = (GLfloat *) VB->FogCoordPtr->data;
fog_stride = VB->FogCoordPtr->stride;
}
if (IND & COLOR) {
@@ -99,7 +98,7 @@ static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end,
index_stride = VB->IndexPtr[0]->stride;
}
if (IND & POINT) {
- pointSize = VB->PointSizePtr->data;
+ pointSize = (GLfloat *) VB->PointSizePtr->data;
pointSize_stride = VB->PointSizePtr->stride;
}
@@ -215,6 +214,7 @@ static void TAG(interp)( GLcontext *ctx,
INTERP_UI( t, dst->index, out->index, in->index );
}
+ /* XXX Point size interpolation??? */
if (IND & POINT) {
INTERP_F( t, dst->pointSize, out->pointSize, in->pointSize );
}
diff --git a/xc/extras/Mesa/src/swrast_setup/swrast_setup.h b/xc/extras/Mesa/src/swrast_setup/swrast_setup.h
index 16dde40e9..4825c772f 100644
--- a/xc/extras/Mesa/src/swrast_setup/swrast_setup.h
+++ b/xc/extras/Mesa/src/swrast_setup/swrast_setup.h
@@ -1,4 +1,3 @@
-/* $Id: swrast_setup.h,v 1.1.1.1 2002/10/22 13:06:39 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
/* Public interface to the swrast_setup module. This module provides
diff --git a/xc/extras/Mesa/src/texcompress.c b/xc/extras/Mesa/src/texcompress.c
new file mode 100644
index 000000000..1890b0a13
--- /dev/null
+++ b/xc/extras/Mesa/src/texcompress.c
@@ -0,0 +1,154 @@
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 4.1
+ *
+ * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include "glheader.h"
+#include "imports.h"
+#include "context.h"
+#include "image.h"
+#include "texcompress.h"
+#include "texformat.h"
+
+
+/**
+ * Get the list of supported internal compression formats.
+ * \param formats - the results list (may be NULL)
+ * \return number of formats.
+ */
+GLuint
+_mesa_get_compressed_formats( GLcontext *ctx, GLint *formats )
+{
+ GLuint n = 0;
+ if (ctx->Extensions.ARB_texture_compression) {
+ if (ctx->Extensions.TDFX_texture_compression_FXT1) {
+ if (formats) {
+ formats[n++] = GL_COMPRESSED_RGB_FXT1_3DFX;
+ formats[n++] = GL_COMPRESSED_RGBA_FXT1_3DFX;
+ }
+ else {
+ n += 4;
+ }
+ }
+ }
+ return n;
+}
+
+
+
+/**
+ * Return bytes of storage needed for the given texture size and compressed
+ * format.
+ * \param width, height, depth - texture size in texels
+ * \param texFormat - one of the compressed format enums
+ * \return size in bytes, or zero if bad texFormat
+ */
+GLuint
+_mesa_compressed_texture_size( GLcontext *ctx,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format )
+{
+ GLuint size;
+
+ switch (format) {
+ case GL_COMPRESSED_RGB_FXT1_3DFX:
+ case GL_COMPRESSED_RGBA_FXT1_3DFX:
+ /* round up to multiple of 4 */
+ size = ((width + 7) / 8) * ((height + 3) / 4) * 16;
+ return size;
+ default:
+ _mesa_problem(ctx, "bad texformat in compressed_texture_size");
+ return 0;
+ }
+}
+
+
+/*
+ * Compute the bytes per row in a compressed texture image.
+ */
+GLint
+_mesa_compressed_row_stride(GLenum format, GLsizei width)
+{
+ GLint bytesPerTile, stride;
+
+ switch (format) {
+ default:
+ return 0;
+ }
+
+ stride = ((width + 3) / 4) * bytesPerTile;
+ return stride;
+}
+
+
+/*
+ * Return the address of the pixel at (col, row, img) in a
+ * compressed texture image.
+ * \param col, row, img - image position (3D)
+ * \param format - compressed image format
+ * \param width - image width
+ * \param image - the image address
+ * \return address of pixel at (row, col)
+ */
+GLubyte *
+_mesa_compressed_image_address(GLint col, GLint row, GLint img,
+ GLenum format,
+ GLsizei width, const GLubyte *image)
+{
+ GLint bytesPerTile, stride;
+ GLubyte *addr;
+
+ ASSERT((row & 3) == 0);
+ ASSERT((col & 3) == 0);
+ (void) img;
+
+ switch (format) {
+ default:
+ return 0;
+ }
+
+ stride = ((width + 3) / 4) * bytesPerTile;
+
+ addr = (GLubyte *) image + (row / 4) * stride + (col / 4) * bytesPerTile;
+ return addr;
+}
+
+
+
+/*
+ * \param srcRowStride - source stride, in pixels
+ */
+void
+_mesa_compress_teximage( GLcontext *ctx, GLsizei width, GLsizei height,
+ GLenum srcFormat, const GLchan *source,
+ GLint srcRowStride,
+ const struct gl_texture_format *dstFormat,
+ GLubyte *dest, GLint dstRowStride )
+{
+ switch (dstFormat->MesaFormat) {
+ default:
+ _mesa_problem(ctx, "Bad dstFormat in _mesa_compress_teximage()");
+ return;
+ }
+}
diff --git a/xc/extras/Mesa/src/swrast/s_scissor.h b/xc/extras/Mesa/src/texcompress.h
index ec454e4dd..d0856142e 100644
--- a/xc/extras/Mesa/src/swrast/s_scissor.h
+++ b/xc/extras/Mesa/src/texcompress.h
@@ -1,10 +1,9 @@
-/* $Id: s_scissor.h,v 1.1.1.1 2002/10/22 13:06:51 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,17 +23,35 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifndef S_SCISSOR_H
-#define S_SCISSOR_H
-
+#ifndef TEXCOMPRESS_H
+#define TEXCOMPRESS_H
#include "mtypes.h"
-#include "swrast.h"
extern GLuint
-_mesa_scissor_span(GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte mask[]);
+_mesa_get_compressed_formats( GLcontext *ctx, GLint *formats );
+
+extern GLuint
+_mesa_compressed_texture_size( GLcontext *ctx,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format );
+
+extern GLint
+_mesa_compressed_row_stride(GLenum format, GLsizei width);
+
+
+extern GLubyte *
+_mesa_compressed_image_address(GLint col, GLint row, GLint img,
+ GLenum format,
+ GLsizei width, const GLubyte *image);
+
+extern void
+_mesa_compress_teximage( GLcontext *ctx, GLsizei width, GLsizei height,
+ GLenum srcFormat, const GLchan *source,
+ GLint srcRowStride,
+ const struct gl_texture_format *dstFormat,
+ GLubyte *dest, GLint dstRowStride );
-#endif
+#endif /* TEXCOMPRESS_H */
diff --git a/xc/extras/Mesa/src/texformat.c b/xc/extras/Mesa/src/texformat.c
index a55d9ddb0..88ab316d8 100644
--- a/xc/extras/Mesa/src/texformat.c
+++ b/xc/extras/Mesa/src/texformat.c
@@ -23,24 +23,19 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Author:
- * Gareth Hughes <gareth@valinux.com>
+ * Gareth Hughes
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colormac.h"
#include "context.h"
#include "image.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
#include "texformat.h"
#include "teximage.h"
#include "texstate.h"
-#include "swrast/s_span.h"
-#endif
/* Texel fetch routines for all supported formats:
@@ -74,7 +69,6 @@ static void fetch_null_texel( const struct gl_texture_image *texImage,
const struct gl_texture_format _mesa_texformat_rgba = {
MESA_FORMAT_RGBA, /* MesaFormat */
GL_RGBA, /* BaseFormat */
- CHAN_TYPE, /* Type */
CHAN_BITS, /* RedBits */
CHAN_BITS, /* GreenBits */
CHAN_BITS, /* BlueBits */
@@ -92,7 +86,6 @@ const struct gl_texture_format _mesa_texformat_rgba = {
const struct gl_texture_format _mesa_texformat_rgb = {
MESA_FORMAT_RGB, /* MesaFormat */
GL_RGB, /* BaseFormat */
- CHAN_TYPE, /* Type */
CHAN_BITS, /* RedBits */
CHAN_BITS, /* GreenBits */
CHAN_BITS, /* BlueBits */
@@ -110,7 +103,6 @@ const struct gl_texture_format _mesa_texformat_rgb = {
const struct gl_texture_format _mesa_texformat_alpha = {
MESA_FORMAT_ALPHA, /* MesaFormat */
GL_ALPHA, /* BaseFormat */
- CHAN_TYPE, /* Type */
0, /* RedBits */
0, /* GreenBits */
0, /* BlueBits */
@@ -128,7 +120,6 @@ const struct gl_texture_format _mesa_texformat_alpha = {
const struct gl_texture_format _mesa_texformat_luminance = {
MESA_FORMAT_LUMINANCE, /* MesaFormat */
GL_LUMINANCE, /* BaseFormat */
- CHAN_TYPE, /* Type */
0, /* RedBits */
0, /* GreenBits */
0, /* BlueBits */
@@ -146,7 +137,6 @@ const struct gl_texture_format _mesa_texformat_luminance = {
const struct gl_texture_format _mesa_texformat_luminance_alpha = {
MESA_FORMAT_LUMINANCE_ALPHA, /* MesaFormat */
GL_LUMINANCE_ALPHA, /* BaseFormat */
- CHAN_TYPE, /* Type */
0, /* RedBits */
0, /* GreenBits */
0, /* BlueBits */
@@ -164,7 +154,6 @@ const struct gl_texture_format _mesa_texformat_luminance_alpha = {
const struct gl_texture_format _mesa_texformat_intensity = {
MESA_FORMAT_INTENSITY, /* MesaFormat */
GL_INTENSITY, /* BaseFormat */
- CHAN_TYPE, /* Type */
0, /* RedBits */
0, /* GreenBits */
0, /* BlueBits */
@@ -182,7 +171,6 @@ const struct gl_texture_format _mesa_texformat_intensity = {
const struct gl_texture_format _mesa_texformat_color_index = {
MESA_FORMAT_COLOR_INDEX, /* MesaFormat */
GL_COLOR_INDEX, /* BaseFormat */
- CHAN_TYPE, /* Type */
0, /* RedBits */
0, /* GreenBits */
0, /* BlueBits */
@@ -200,7 +188,6 @@ const struct gl_texture_format _mesa_texformat_color_index = {
const struct gl_texture_format _mesa_texformat_depth_component = {
MESA_FORMAT_DEPTH_COMPONENT, /* MesaFormat */
GL_DEPTH_COMPONENT, /* BaseFormat */
- GL_FLOAT, /* Type */
0, /* RedBits */
0, /* GreenBits */
0, /* BlueBits */
@@ -223,7 +210,6 @@ const struct gl_texture_format _mesa_texformat_depth_component = {
const struct gl_texture_format _mesa_texformat_rgba8888 = {
MESA_FORMAT_RGBA8888, /* MesaFormat */
GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_INT_8_8_8_8, /* Type */
8, /* RedBits */
8, /* GreenBits */
8, /* BlueBits */
@@ -241,7 +227,6 @@ const struct gl_texture_format _mesa_texformat_rgba8888 = {
const struct gl_texture_format _mesa_texformat_argb8888 = {
MESA_FORMAT_ARGB8888, /* MesaFormat */
GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_INT_8_8_8_8_REV, /* Type */
8, /* RedBits */
8, /* GreenBits */
8, /* BlueBits */
@@ -259,7 +244,6 @@ const struct gl_texture_format _mesa_texformat_argb8888 = {
const struct gl_texture_format _mesa_texformat_rgb888 = {
MESA_FORMAT_RGB888, /* MesaFormat */
GL_RGB, /* BaseFormat */
- GL_UNSIGNED_BYTE, /* Type */
8, /* RedBits */
8, /* GreenBits */
8, /* BlueBits */
@@ -277,7 +261,6 @@ const struct gl_texture_format _mesa_texformat_rgb888 = {
const struct gl_texture_format _mesa_texformat_rgb565 = {
MESA_FORMAT_RGB565, /* MesaFormat */
GL_RGB, /* BaseFormat */
- GL_UNSIGNED_SHORT_5_6_5, /* Type */
5, /* RedBits */
6, /* GreenBits */
5, /* BlueBits */
@@ -295,7 +278,6 @@ const struct gl_texture_format _mesa_texformat_rgb565 = {
const struct gl_texture_format _mesa_texformat_argb4444 = {
MESA_FORMAT_ARGB4444, /* MesaFormat */
GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_SHORT_4_4_4_4_REV, /* Type */
4, /* RedBits */
4, /* GreenBits */
4, /* BlueBits */
@@ -313,7 +295,6 @@ const struct gl_texture_format _mesa_texformat_argb4444 = {
const struct gl_texture_format _mesa_texformat_argb1555 = {
MESA_FORMAT_ARGB1555, /* MesaFormat */
GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_SHORT_1_5_5_5_REV, /* Type */
5, /* RedBits */
5, /* GreenBits */
5, /* BlueBits */
@@ -331,7 +312,6 @@ const struct gl_texture_format _mesa_texformat_argb1555 = {
const struct gl_texture_format _mesa_texformat_al88 = {
MESA_FORMAT_AL88, /* MesaFormat */
GL_LUMINANCE_ALPHA, /* BaseFormat */
- GL_UNSIGNED_BYTE, /* Type */
0, /* RedBits */
0, /* GreenBits */
0, /* BlueBits */
@@ -349,7 +329,6 @@ const struct gl_texture_format _mesa_texformat_al88 = {
const struct gl_texture_format _mesa_texformat_rgb332 = {
MESA_FORMAT_RGB332, /* MesaFormat */
GL_RGB, /* BaseFormat */
- GL_UNSIGNED_BYTE_3_3_2, /* Type */
3, /* RedBits */
3, /* GreenBits */
2, /* BlueBits */
@@ -367,7 +346,6 @@ const struct gl_texture_format _mesa_texformat_rgb332 = {
const struct gl_texture_format _mesa_texformat_a8 = {
MESA_FORMAT_A8, /* MesaFormat */
GL_ALPHA, /* BaseFormat */
- GL_UNSIGNED_BYTE, /* Type */
0, /* RedBits */
0, /* GreenBits */
0, /* BlueBits */
@@ -385,7 +363,6 @@ const struct gl_texture_format _mesa_texformat_a8 = {
const struct gl_texture_format _mesa_texformat_l8 = {
MESA_FORMAT_L8, /* MesaFormat */
GL_LUMINANCE, /* BaseFormat */
- GL_UNSIGNED_BYTE, /* Type */
0, /* RedBits */
0, /* GreenBits */
0, /* BlueBits */
@@ -403,7 +380,6 @@ const struct gl_texture_format _mesa_texformat_l8 = {
const struct gl_texture_format _mesa_texformat_i8 = {
MESA_FORMAT_I8, /* MesaFormat */
GL_INTENSITY, /* BaseFormat */
- GL_UNSIGNED_BYTE, /* Type */
0, /* RedBits */
0, /* GreenBits */
0, /* BlueBits */
@@ -421,7 +397,6 @@ const struct gl_texture_format _mesa_texformat_i8 = {
const struct gl_texture_format _mesa_texformat_ci8 = {
MESA_FORMAT_CI8, /* MesaFormat */
GL_COLOR_INDEX, /* BaseFormat */
- GL_UNSIGNED_BYTE, /* Type */
0, /* RedBits */
0, /* GreenBits */
0, /* BlueBits */
@@ -436,15 +411,196 @@ const struct gl_texture_format _mesa_texformat_ci8 = {
fetch_3d_texel_ci8, /* FetchTexel3D */
};
+const struct gl_texture_format _mesa_texformat_ycbcr = {
+ MESA_FORMAT_YCBCR, /* MesaFormat */
+ GL_YCBCR_MESA, /* BaseFormat */
+ 0, /* RedBits */
+ 0, /* GreenBits */
+ 0, /* BlueBits */
+ 0, /* AlphaBits */
+ 0, /* LuminanceBits */
+ 0, /* IntensityBits */
+ 0, /* IndexBits */
+ 0, /* DepthBits */
+ 2, /* TexelBytes */
+ fetch_1d_texel_ycbcr, /* FetchTexel1D */
+ fetch_2d_texel_ycbcr, /* FetchTexel2D */
+ fetch_3d_texel_ycbcr, /* FetchTexel3D */
+};
+
+
+const struct gl_texture_format _mesa_texformat_ycbcr_rev = {
+ MESA_FORMAT_YCBCR_REV, /* MesaFormat */
+ GL_YCBCR_MESA, /* BaseFormat */
+ 0, /* RedBits */
+ 0, /* GreenBits */
+ 0, /* BlueBits */
+ 0, /* AlphaBits */
+ 0, /* LuminanceBits */
+ 0, /* IntensityBits */
+ 0, /* IndexBits */
+ 0, /* DepthBits */
+ 2, /* TexelBytes */
+ fetch_1d_texel_ycbcr_rev, /* FetchTexel1D */
+ fetch_2d_texel_ycbcr_rev, /* FetchTexel2D */
+ fetch_3d_texel_ycbcr_rev, /* FetchTexel3D */
+};
+
+
+/* Big-endian */
+#if 0
+const struct gl_texture_format _mesa_texformat_abgr8888 = {
+ MESA_FORMAT_ABGR8888, /* MesaFormat */
+ GL_RGBA, /* BaseFormat */
+ GL_UNSIGNED_INT_8_8_8_8, /* Type */
+ 8, /* RedBits */
+ 8, /* GreenBits */
+ 8, /* BlueBits */
+ 8, /* AlphaBits */
+ 0, /* LuminanceBits */
+ 0, /* IntensityBits */
+ 0, /* IndexBits */
+ 0, /* DepthBits */
+ 4, /* TexelBytes */
+ fetch_1d_texel_abgr8888, /* FetchTexel1D */
+ fetch_2d_texel_abgr8888, /* FetchTexel2D */
+ fetch_3d_texel_abgr8888, /* FetchTexel3D */
+};
+
+const struct gl_texture_format _mesa_texformat_bgra8888 = {
+ MESA_FORMAT_BGRA8888, /* MesaFormat */
+ GL_RGBA, /* BaseFormat */
+ GL_UNSIGNED_INT_8_8_8_8, /* Type */
+ 8, /* RedBits */
+ 8, /* GreenBits */
+ 8, /* BlueBits */
+ 8, /* AlphaBits */
+ 0, /* LuminanceBits */
+ 0, /* IntensityBits */
+ 0, /* IndexBits */
+ 0, /* DepthBits */
+ 4, /* TexelBytes */
+ fetch_1d_texel_bgra8888, /* FetchTexel1D */
+ fetch_2d_texel_bgra8888, /* FetchTexel2D */
+ fetch_3d_texel_bgra8888, /* FetchTexel3D */
+};
+
+const struct gl_texture_format _mesa_texformat_bgr888 = {
+ MESA_FORMAT_BGR888, /* MesaFormat */
+ GL_RGB, /* BaseFormat */
+ GL_UNSIGNED_BYTE, /* Type */
+ 8, /* RedBits */
+ 8, /* GreenBits */
+ 8, /* BlueBits */
+ 0, /* AlphaBits */
+ 0, /* LuminanceBits */
+ 0, /* IntensityBits */
+ 0, /* IndexBits */
+ 0, /* DepthBits */
+ 3, /* TexelBytes */
+ fetch_1d_texel_bgr888, /* FetchTexel1D */
+ fetch_2d_texel_bgr888, /* FetchTexel2D */
+ fetch_3d_texel_bgr888, /* FetchTexel3D */
+};
+
+const struct gl_texture_format _mesa_texformat_bgr565 = {
+ MESA_FORMAT_BGR565, /* MesaFormat */
+ GL_RGB, /* BaseFormat */
+ GL_UNSIGNED_SHORT_5_6_5, /* Type */
+ 5, /* RedBits */
+ 6, /* GreenBits */
+ 5, /* BlueBits */
+ 0, /* AlphaBits */
+ 0, /* LuminanceBits */
+ 0, /* IntensityBits */
+ 0, /* IndexBits */
+ 0, /* DepthBits */
+ 2, /* TexelBytes */
+ fetch_1d_texel_bgr565, /* FetchTexel1D */
+ fetch_2d_texel_bgr565, /* FetchTexel2D */
+ fetch_3d_texel_bgr565, /* FetchTexel3D */
+};
+
+const struct gl_texture_format _mesa_texformat_bgra4444 = {
+ MESA_FORMAT_BGRA4444, /* MesaFormat */
+ GL_RGBA, /* BaseFormat */
+ GL_UNSIGNED_SHORT_4_4_4_4_REV, /* Type */
+ 4, /* RedBits */
+ 4, /* GreenBits */
+ 4, /* BlueBits */
+ 4, /* AlphaBits */
+ 0, /* LuminanceBits */
+ 0, /* IntensityBits */
+ 0, /* IndexBits */
+ 0, /* DepthBits */
+ 2, /* TexelBytes */
+ fetch_1d_texel_bgra4444, /* FetchTexel1D */
+ fetch_2d_texel_bgra4444, /* FetchTexel2D */
+ fetch_3d_texel_bgra4444, /* FetchTexel3D */
+};
+
+const struct gl_texture_format _mesa_texformat_bgra5551 = {
+ MESA_FORMAT_BGRA5551, /* MesaFormat */
+ GL_RGBA, /* BaseFormat */
+ GL_UNSIGNED_SHORT_1_5_5_5_REV, /* Type */
+ 5, /* RedBits */
+ 5, /* GreenBits */
+ 5, /* BlueBits */
+ 1, /* AlphaBits */
+ 0, /* LuminanceBits */
+ 0, /* IntensityBits */
+ 0, /* IndexBits */
+ 0, /* DepthBits */
+ 2, /* TexelBytes */
+ fetch_1d_texel_bgra1555, /* FetchTexel1D */
+ fetch_2d_texel_bgra1555, /* FetchTexel2D */
+ fetch_3d_texel_bgra1555, /* FetchTexel3D */
+};
+
+const struct gl_texture_format _mesa_texformat_la88 = {
+ MESA_FORMAT_LA88, /* MesaFormat */
+ GL_LUMINANCE_ALPHA, /* BaseFormat */
+ GL_UNSIGNED_BYTE, /* Type */
+ 0, /* RedBits */
+ 0, /* GreenBits */
+ 0, /* BlueBits */
+ 8, /* AlphaBits */
+ 8, /* LuminanceBits */
+ 0, /* IntensityBits */
+ 0, /* IndexBits */
+ 0, /* DepthBits */
+ 2, /* TexelBytes */
+ fetch_1d_texel_la88, /* FetchTexel1D */
+ fetch_2d_texel_la88, /* FetchTexel2D */
+ fetch_3d_texel_la88, /* FetchTexel3D */
+};
+
+const struct gl_texture_format _mesa_texformat_bgr233 = {
+ MESA_FORMAT_BGR233, /* MesaFormat */
+ GL_RGB, /* BaseFormat */
+ GL_UNSIGNED_BYTE_3_3_2, /* Type */
+ 3, /* RedBits */
+ 3, /* GreenBits */
+ 2, /* BlueBits */
+ 0, /* AlphaBits */
+ 0, /* LuminanceBits */
+ 0, /* IntensityBits */
+ 0, /* IndexBits */
+ 0, /* DepthBits */
+ 1, /* TexelBytes */
+ fetch_1d_texel_bgr233, /* FetchTexel1D */
+ fetch_2d_texel_bgr233, /* FetchTexel2D */
+ fetch_3d_texel_bgr233, /* FetchTexel3D */
+};
+#endif
/* =============================================================
- * Null format:
+ * Null format (useful for proxy textures):
*/
const struct gl_texture_format _mesa_null_texformat = {
-1, /* MesaFormat */
0, /* BaseFormat */
- 0, /* Type */
0, /* RedBits */
0, /* GreenBits */
0, /* BlueBits */
@@ -460,7 +616,6 @@ const struct gl_texture_format _mesa_null_texformat = {
};
-
GLboolean
_mesa_is_hardware_tex_format( const struct gl_texture_format *format )
{
@@ -471,8 +626,8 @@ _mesa_is_hardware_tex_format( const struct gl_texture_format *format )
/* Given an internal texture format (or 1, 2, 3, 4) return a pointer
* to a gl_texture_format which which to store the texture.
* This is called via ctx->Driver.ChooseTextureFormat().
- * Hardware drivers should not use this function, but instead a
- * specialized function.
+ * Hardware drivers typically override this function with a specialized
+ * version.
*/
const struct gl_texture_format *
_mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
@@ -589,9 +744,15 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
_mesa_problem(ctx, "texture compression extension not enabled");
return &_mesa_texformat_rgba;
+ /* GL_MESA_ycrcr_texture */
+ case GL_YCBCR_MESA:
+ if (type == GL_UNSIGNED_SHORT_8_8_MESA)
+ return &_mesa_texformat_ycbcr;
+ else
+ return &_mesa_texformat_ycbcr_rev;
+
default:
_mesa_problem(ctx, "unexpected format in _mesa_choose_tex_format()");
- printf("intformat = %d %x\n", internalFormat, internalFormat);
return NULL;
}
}
@@ -626,23 +787,3 @@ _mesa_base_compressed_texformat(GLcontext *ctx, GLint intFormat)
return -1; /* not a recognized compressed format */
}
}
-
-
-/*
- * Called via ctx->Driver.CompressedTextureSize().
- * This function is only used by software rasterizers.
- * Hardware drivers will have to implement a specialized function.
- */
-GLint
-_mesa_compressed_texture_size(GLcontext *ctx,
- const struct gl_texture_image *texImage)
-{
- GLint b;
- assert(texImage);
- assert(texImage->TexFormat);
-
- b = texImage->Width * texImage->Height * texImage->Depth *
- texImage->TexFormat->TexelBytes;
- assert(b > 0);
- return b;
-}
diff --git a/xc/extras/Mesa/src/texformat.h b/xc/extras/Mesa/src/texformat.h
index 72b473cdf..1ea33090f 100644
--- a/xc/extras/Mesa/src/texformat.h
+++ b/xc/extras/Mesa/src/texformat.h
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -23,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Author:
- * Gareth Hughes <gareth@valinux.com>
+ * Gareth Hughes
*/
#ifndef TEXFORMAT_H
@@ -32,17 +32,20 @@
#include "mtypes.h"
-/* The Mesa internal texture image types. These will be set to their
- * default value, but may be changed by drivers as required.
+/*
+ * The Mesa internal texture image types.
+ * All texture images must be stored in one of these formats.
*/
enum _format {
/* Hardware-friendly formats. Drivers can override the default
* formats and convert texture images to one of these as required.
+ * The driver's ChooseTextureFormat() function will choose one of
+ * these formats.
* These formats are all little endian, as shown below. They will be
* most useful for x86-based PC graphics card drivers.
*
* NOTE: In the default case, some of these formats will be
- * duplicates of the default formats listed above. However, these
+ * duplicates of the generic formats listed below. However, these
* formats guarantee their internal component sizes, while GLchan may
* vary betwen GLubyte, GLushort and GLfloat.
*/
@@ -60,6 +63,23 @@ enum _format {
MESA_FORMAT_L8, /* LLLL LLLL */
MESA_FORMAT_I8, /* IIII IIII */
MESA_FORMAT_CI8, /* CCCC CCCC */
+ MESA_FORMAT_YCBCR, /* YYYY YYYY UorV UorV */
+ MESA_FORMAT_YCBCR_REV, /* UorV UorV YYYY YYYY */
+
+#if 0
+ /* upcoming little-endian formats: */
+
+ /* msb <------ TEXEL BITS -----------> lsb */
+ /* ---- ---- ---- ---- ---- ---- ---- ---- */
+ MESA_FORMAT_ABGR8888, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */
+ MESA_FORMAT_BGRA8888, /* BBBB BBBB GGGG GGGG RRRR RRRR AAAA AAAA */
+ MESA_FORMAT_BGR888, /* BBBB BBBB GGGG GGGG RRRR RRRR */
+ MESA_FORMAT_BGR565, /* BBBB BGGG GGGR RRRR */
+ MESA_FORMAT_BGRA4444, /* BBBB GGGG RRRR AAAA */
+ MESA_FORMAT_BGRA5551, /* BBBB BGGG GGRR RRRA */
+ MESA_FORMAT_LA88, /* LLLL LLLL AAAA AAAA */
+ MESA_FORMAT_BGR233, /* BBGG GRRR */
+#endif
/* Generic GLchan-based formats. These are the default formats used
* by the software rasterizer and, unless the driver overrides the
@@ -69,7 +89,7 @@ enum _format {
*
* NOTE: Because these are based on the GLchan datatype, one cannot
* assume 8 bits per channel with these formats. If you require
- * GLubyte per channel, use one of the hardware formats above.
+ * GLubyte channels, use one of the hardware formats above.
*/
MESA_FORMAT_RGBA,
MESA_FORMAT_RGB,
@@ -92,10 +112,6 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
extern GLint
_mesa_base_compressed_texformat(GLcontext *ctx, GLint intFormat);
-extern GLint
-_mesa_compressed_texture_size(GLcontext *ctx,
- const struct gl_texture_image *texImage);
-
/* The default formats, GLchan per component:
*/
@@ -122,6 +138,8 @@ extern const struct gl_texture_format _mesa_texformat_a8;
extern const struct gl_texture_format _mesa_texformat_l8;
extern const struct gl_texture_format _mesa_texformat_i8;
extern const struct gl_texture_format _mesa_texformat_ci8;
+extern const struct gl_texture_format _mesa_texformat_ycbcr;
+extern const struct gl_texture_format _mesa_texformat_ycbcr_rev;
/* The null format:
*/
diff --git a/xc/extras/Mesa/src/texformat_tmp.h b/xc/extras/Mesa/src/texformat_tmp.h
index cc788d658..6b1c001dc 100644
--- a/xc/extras/Mesa/src/texformat_tmp.h
+++ b/xc/extras/Mesa/src/texformat_tmp.h
@@ -1,10 +1,9 @@
-/* $Id: texformat_tmp.h,v 1.1.1.1 2002/10/22 13:05:22 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -23,10 +22,18 @@
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
- * Gareth Hughes <gareth@valinux.com>
+ * Authors:
+ * Gareth Hughes
+ * Brian Paul
*/
+
+/*
+ * This template file generates texel fetch functions for 1-D, 2-D and 3-D
+ * texture images.
+ */
+
+
#if DIM == 1
#define CHAN_SRC( t, i, j, k, sz ) \
@@ -43,13 +50,13 @@
#elif DIM == 2
#define CHAN_SRC( t, i, j, k, sz ) \
- ((GLchan *)(t)->Data + ((t)->Width * (j) + (i)) * (sz))
+ ((GLchan *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))
#define UBYTE_SRC( t, i, j, k, sz ) \
- ((GLubyte *)(t)->Data + ((t)->Width * (j) + (i)) * (sz))
+ ((GLubyte *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))
#define USHORT_SRC( t, i, j, k ) \
- ((GLushort *)(t)->Data + ((t)->Width * (j) + (i)))
+ ((GLushort *)(t)->Data + ((t)->RowStride * (j) + (i)))
#define FLOAT_SRC( t, i, j, k ) \
- ((GLfloat *)(t)->Data + ((t)->Width * (j) + (i)))
+ ((GLfloat *)(t)->Data + ((t)->RowStride * (j) + (i)))
#define FETCH(x) fetch_2d_texel_##x
@@ -57,16 +64,16 @@
#define CHAN_SRC( t, i, j, k, sz ) \
(GLchan *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)) * (sz)
+ (t)->RowStride + (i)) * (sz)
#define UBYTE_SRC( t, i, j, k, sz ) \
((GLubyte *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)) * (sz))
+ (t)->RowStride + (i)) * (sz))
#define USHORT_SRC( t, i, j, k ) \
((GLushort *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)))
+ (t)->RowStride + (i)))
#define FLOAT_SRC( t, i, j, k ) \
((GLfloat *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)))
+ (t)->RowStride + (i)))
#define FETCH(x) fetch_3d_texel_##x
@@ -191,7 +198,8 @@ static void FETCH(rgb565)( const struct gl_texture_image *texImage,
GLint i, GLint j, GLint k, GLvoid *texel )
{
const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
+ const GLushort s = *src;
+ GLchan *rgba = (GLchan *) texel;
rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf8) * 255 / 0xf8 );
rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 3) & 0xfc) * 255 / 0xfc );
rgba[BCOMP] = UBYTE_TO_CHAN( ((s << 3) & 0xf8) * 255 / 0xf8 );
@@ -202,7 +210,8 @@ static void FETCH(argb4444)( const struct gl_texture_image *texImage,
GLint i, GLint j, GLint k, GLvoid *texel )
{
const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
+ const GLushort s = *src;
+ GLchan *rgba = (GLchan *) texel;
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 );
@@ -213,7 +222,8 @@ static void FETCH(argb1555)( const struct gl_texture_image *texImage,
GLint i, GLint j, GLint k, GLvoid *texel )
{
const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
+ const GLushort s = *src;
+ GLchan *rgba = (GLchan *) texel;
rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0x1f) * 255 / 0x1f );
rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0x1f) * 255 / 0x1f );
rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0x1f) * 255 / 0x1f );
@@ -235,7 +245,8 @@ static void FETCH(rgb332)( const struct gl_texture_image *texImage,
GLint i, GLint j, GLint k, GLvoid *texel )
{
const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 1 );
- GLchan *rgba = (GLchan *) texel; GLubyte s = *src;
+ const GLubyte s = *src;
+ GLchan *rgba = (GLchan *) texel;
rgba[RCOMP] = UBYTE_TO_CHAN( ((s ) & 0xe0) * 255 / 0xe0 );
rgba[GCOMP] = UBYTE_TO_CHAN( ((s << 3) & 0xe0) * 255 / 0xe0 );
rgba[BCOMP] = UBYTE_TO_CHAN( ((s << 5) & 0xc0) * 255 / 0xc0 );
@@ -283,6 +294,163 @@ static void FETCH(ci8)( const struct gl_texture_image *texImage,
*index = UBYTE_TO_CHAN( *src );
}
+/* XXX this may break if GLchan != GLubyte */
+static void FETCH(ycbcr)( const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLvoid *texel )
+{
+ const GLushort *src0 = USHORT_SRC( texImage, (i & ~1), j, k ); /* even */
+ const GLushort *src1 = src0 + 1; /* odd */
+ const GLubyte y0 = (*src0 >> 8) & 0xff; /* luminance */
+ const GLubyte cb = *src0 & 0xff; /* chroma U */
+ const GLubyte y1 = (*src1 >> 8) & 0xff; /* luminance */
+ const GLubyte cr = *src1 & 0xff; /* chroma V */
+ GLchan *rgba = (GLchan *) texel;
+ GLint r, g, b;
+ if (i & 1) {
+ /* odd pixel: use y1,cr,cb */
+ r = (GLint) (1.164 * (y1-16) + 1.596 * (cr-128));
+ g = (GLint) (1.164 * (y1-16) - 0.813 * (cr-128) - 0.391 * (cb-128));
+ b = (GLint) (1.164 * (y1-16) + 2.018 * (cb-128));
+ }
+ else {
+ /* even pixel: use y0,cr,cb */
+ r = (GLint) (1.164 * (y0-16) + 1.596 * (cr-128));
+ g = (GLint) (1.164 * (y0-16) - 0.813 * (cr-128) - 0.391 * (cb-128));
+ b = (GLint) (1.164 * (y0-16) + 2.018 * (cb-128));
+ }
+ rgba[RCOMP] = CLAMP(r, 0, CHAN_MAX);
+ rgba[GCOMP] = CLAMP(g, 0, CHAN_MAX);
+ rgba[BCOMP] = CLAMP(b, 0, CHAN_MAX);
+ rgba[ACOMP] = CHAN_MAX;
+}
+
+/* XXX this may break if GLchan != GLubyte */
+static void FETCH(ycbcr_rev)( const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLvoid *texel )
+{
+ const GLushort *src0 = USHORT_SRC( texImage, (i & ~1), j, k ); /* even */
+ const GLushort *src1 = src0 + 1; /* odd */
+ const GLubyte y0 = *src0 & 0xff; /* luminance */
+ const GLubyte cr = (*src0 >> 8) & 0xff; /* chroma U */
+ const GLubyte y1 = *src1 & 0xff; /* luminance */
+ const GLubyte cb = (*src1 >> 8) & 0xff; /* chroma V */
+ GLchan *rgba = (GLchan *) texel;
+ GLint r, g, b;
+ if (i & 1) {
+ /* odd pixel: use y1,cr,cb */
+ r = (GLint) (1.164 * (y1-16) + 1.596 * (cr-128));
+ g = (GLint) (1.164 * (y1-16) - 0.813 * (cr-128) - 0.391 * (cb-128));
+ b = (GLint) (1.164 * (y1-16) + 2.018 * (cb-128));
+ }
+ else {
+ /* even pixel: use y0,cr,cb */
+ r = (GLint) (1.164 * (y0-16) + 1.596 * (cr-128));
+ g = (GLint) (1.164 * (y0-16) - 0.813 * (cr-128) - 0.391 * (cb-128));
+ b = (GLint) (1.164 * (y0-16) + 2.018 * (cb-128));
+ }
+ rgba[RCOMP] = CLAMP(r, 0, CHAN_MAX);
+ rgba[GCOMP] = CLAMP(g, 0, CHAN_MAX);
+ rgba[BCOMP] = CLAMP(b, 0, CHAN_MAX);
+ rgba[ACOMP] = CHAN_MAX;
+}
+
+
+/* big-endian */
+
+#if 0
+static void FETCH(abgr8888)( const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLvoid *texel )
+{
+ const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 4 );
+ GLchan *rgba = (GLchan *) texel;
+ rgba[RCOMP] = UBYTE_TO_CHAN( src[3] );
+ rgba[GCOMP] = UBYTE_TO_CHAN( src[2] );
+ rgba[BCOMP] = UBYTE_TO_CHAN( src[1] );
+ rgba[ACOMP] = UBYTE_TO_CHAN( src[0] );
+}
+
+static void FETCH(bgra8888)( const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLvoid *texel )
+{
+ const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 4 );
+ GLchan *rgba = (GLchan *) texel;
+ rgba[RCOMP] = UBYTE_TO_CHAN( src[2] );
+ rgba[GCOMP] = UBYTE_TO_CHAN( src[1] );
+ rgba[BCOMP] = UBYTE_TO_CHAN( src[0] );
+ rgba[ACOMP] = UBYTE_TO_CHAN( src[3] );
+}
+
+static void FETCH(bgr888)( const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLvoid *texel )
+{
+ const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 3 );
+ GLchan *rgba = (GLchan *) texel;
+ rgba[RCOMP] = UBYTE_TO_CHAN( src[2] );
+ rgba[GCOMP] = UBYTE_TO_CHAN( src[1] );
+ rgba[BCOMP] = UBYTE_TO_CHAN( src[0] );
+ rgba[ACOMP] = CHAN_MAX;
+}
+
+static void FETCH(bgr565)( const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLvoid *texel )
+{
+ const GLushort *src = USHORT_SRC( texImage, i, j, k );
+ const GLushort s = *src;
+ GLchan *rgba = (GLchan *) texel;
+ rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf8) * 255 / 0xf8 );
+ rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 3) & 0xfc) * 255 / 0xfc );
+ rgba[BCOMP] = UBYTE_TO_CHAN( ((s << 3) & 0xf8) * 255 / 0xf8 );
+ rgba[ACOMP] = CHAN_MAX;
+}
+
+static void FETCH(bgra4444)( const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLvoid *texel )
+{
+ const GLushort *src = USHORT_SRC( texImage, i, j, k );
+ const GLushort s = *src;
+ GLchan *rgba = (GLchan *) texel;
+ 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] = UBYTE_TO_CHAN( ((s >> 12) & 0xf) * 255 / 0xf );
+}
+
+static void FETCH(bgra5551)( const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLvoid *texel )
+{
+ const GLushort *src = USHORT_SRC( texImage, i, j, k );
+ const GLushort s = *src;
+ GLchan *rgba = (GLchan *) texel;
+ rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0x1f) * 255 / 0x1f );
+ rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0x1f) * 255 / 0x1f );
+ rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0x1f) * 255 / 0x1f );
+ rgba[ACOMP] = UBYTE_TO_CHAN( ((s >> 15) & 0x01) * 255 );
+}
+
+static void FETCH(la88)( const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLvoid *texel )
+{
+ const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 2 );
+ GLchan *rgba = (GLchan *) texel;
+ rgba[RCOMP] = UBYTE_TO_CHAN( src[0] );
+ rgba[GCOMP] = UBYTE_TO_CHAN( src[0] );
+ rgba[BCOMP] = UBYTE_TO_CHAN( src[0] );
+ rgba[ACOMP] = UBYTE_TO_CHAN( src[1] );
+}
+
+static void FETCH(bgr233)( const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLvoid *texel )
+{
+ const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 1 );
+ const GLubyte s = *src;
+ GLchan *rgba = (GLchan *) texel;
+ rgba[RCOMP] = UBYTE_TO_CHAN( ((s ) & 0xe0) * 255 / 0xe0 );
+ rgba[GCOMP] = UBYTE_TO_CHAN( ((s << 3) & 0xe0) * 255 / 0xe0 );
+ rgba[BCOMP] = UBYTE_TO_CHAN( ((s << 5) & 0xc0) * 255 / 0xc0 );
+ rgba[ACOMP] = CHAN_MAX;
+}
+#endif
+
#undef CHAN_SRC
#undef UBYTE_SRC
diff --git a/xc/extras/Mesa/src/teximage.c b/xc/extras/Mesa/src/teximage.c
index 48cf19c68..1beccc5ce 100644
--- a/xc/extras/Mesa/src/teximage.c
+++ b/xc/extras/Mesa/src/teximage.c
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.4
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -23,25 +23,20 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "context.h"
#include "convolve.h"
#include "image.h"
+#include "imports.h"
#include "macros.h"
-#include "mem.h"
#include "mmath.h"
#include "state.h"
+#include "texcompress.h"
#include "texformat.h"
#include "teximage.h"
#include "texstate.h"
#include "texstore.h"
#include "mtypes.h"
-#include "swrast/s_span.h" /* XXX SWRAST hack */
-#endif
/*
@@ -54,8 +49,8 @@
*/
-#ifdef DEBUG
-static void PrintTexture(const struct gl_texture_image *img)
+#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");
@@ -64,7 +59,7 @@ static void PrintTexture(const struct gl_texture_image *img)
const GLchan *data = (const GLchan *) img->Data;
if (!data) {
- printf("No texture data\n");
+ _mesa_printf("No texture data\n");
return;
}
@@ -92,16 +87,16 @@ static void PrintTexture(const struct gl_texture_image *img)
for (i = 0; i < img->Height; i++) {
for (j = 0; j < img->Width; j++) {
if (c==1)
- printf("%02x ", data[0]);
+ _mesa_printf("%02x ", data[0]);
else if (c==2)
- printf("%02x%02x ", data[0], data[1]);
+ _mesa_printf("%02x%02x ", data[0], data[1]);
else if (c==3)
- printf("%02x%02x%02x ", data[0], data[1], data[2]);
+ _mesa_printf("%02x%02x%02x ", data[0], data[1], data[2]);
else if (c==4)
- printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]);
- data += c;
+ _mesa_printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]);
+ data += (img->RowStride - img->Width) * c;
}
- printf("\n");
+ _mesa_printf("\n");
}
#endif
}
@@ -142,6 +137,10 @@ logbase2( int n )
* Given an internal texture format enum or 1, 2, 3, 4 return the
* corresponding _base_ internal format: GL_ALPHA, GL_LUMINANCE,
* GL_LUMANCE_ALPHA, GL_INTENSITY, GL_RGB, or GL_RGBA.
+ *
+ * This is the format which is used during texture application (i.e. the
+ * texture format and env mode determine the arithmetic used.
+ *
* Return -1 if invalid enum.
*/
GLint
@@ -151,12 +150,6 @@ _mesa_base_tex_format( GLcontext *ctx, GLint format )
* Ask the driver for the base format, if it doesn't
* know, it will return -1;
*/
- if (ctx->Driver.BaseCompressedTexFormat) {
- GLint ifmt = (*ctx->Driver.BaseCompressedTexFormat)(ctx, format);
- if (ifmt >= 0) {
- return ifmt;
- }
- }
switch (format) {
case GL_ALPHA:
case GL_ALPHA4:
@@ -213,7 +206,10 @@ _mesa_base_tex_format( GLcontext *ctx, GLint format )
case GL_COLOR_INDEX8_EXT:
case GL_COLOR_INDEX12_EXT:
case GL_COLOR_INDEX16_EXT:
- return GL_COLOR_INDEX;
+ if (ctx->Extensions.EXT_paletted_texture)
+ return GL_COLOR_INDEX;
+ else
+ return -1;
case GL_DEPTH_COMPONENT:
case GL_DEPTH_COMPONENT16_SGIX:
case GL_DEPTH_COMPONENT24_SGIX:
@@ -222,6 +218,55 @@ _mesa_base_tex_format( GLcontext *ctx, GLint format )
return GL_DEPTH_COMPONENT;
else
return -1;
+
+ /* GL_ARB_texture_compression */
+ case GL_COMPRESSED_ALPHA:
+ if (ctx->Extensions.ARB_texture_compression)
+ return GL_ALPHA;
+ else
+ return -1;
+ case GL_COMPRESSED_LUMINANCE:
+ if (ctx->Extensions.ARB_texture_compression)
+ return GL_LUMINANCE;
+ else
+ return -1;
+ case GL_COMPRESSED_LUMINANCE_ALPHA:
+ if (ctx->Extensions.ARB_texture_compression)
+ return GL_LUMINANCE_ALPHA;
+ else
+ return -1;
+ case GL_COMPRESSED_INTENSITY:
+ if (ctx->Extensions.ARB_texture_compression)
+ return GL_INTENSITY;
+ else
+ return -1;
+ case GL_COMPRESSED_RGB:
+ if (ctx->Extensions.ARB_texture_compression)
+ return GL_RGB;
+ else
+ return -1;
+ case GL_COMPRESSED_RGBA:
+ if (ctx->Extensions.ARB_texture_compression)
+ return GL_RGBA;
+ else
+ return -1;
+ case GL_COMPRESSED_RGB_FXT1_3DFX:
+ if (ctx->Extensions.TDFX_texture_compression_FXT1)
+ return GL_RGB;
+ else
+ return -1;
+ case GL_COMPRESSED_RGBA_FXT1_3DFX:
+ if (ctx->Extensions.TDFX_texture_compression_FXT1)
+ return GL_RGBA;
+ else
+ return -1;
+
+ case GL_YCBCR_MESA:
+ if (ctx->Extensions.MESA_ycbcr_texture)
+ return GL_YCBCR_MESA;
+ else
+ return -1;
+
default:
return -1; /* error */
}
@@ -279,6 +324,7 @@ is_color_format(GLenum format)
case GL_RGBA12:
case GL_RGBA16:
return GL_TRUE;
+ case GL_YCBCR_MESA: /* not considered to be RGB */
default:
return GL_FALSE;
}
@@ -303,25 +349,24 @@ is_index_format(GLenum format)
}
-/*
- * Return GL_TRUE if internalFormat is a compressed format, return GL_FALSE
- * otherwise.
+/**
+ * Return GL_TRUE if internalFormat is a supported compressed format,
+ * return GL_FALSE otherwise.
+ * \param - internalFormat - the internal format token provided by the user
*/
static GLboolean
-is_compressed_format(GLcontext *ctx, GLenum internalFormat)
+is_compressed_format(GLenum internalFormat)
{
- if (ctx->Driver.BaseCompressedTexFormat) {
- GLint b = (*ctx->Driver.BaseCompressedTexFormat)(ctx, internalFormat);
- if (b > 0)
+ switch (internalFormat) {
+ case GL_COMPRESSED_RGB_FXT1_3DFX:
+ case GL_COMPRESSED_RGBA_FXT1_3DFX:
return GL_TRUE;
- else
+ default:
return GL_FALSE;
}
- return GL_FALSE;
}
-
/*
* Store a gl_texture_image pointer in a gl_texture_object structure
* according to the target and level parameters.
@@ -384,7 +429,7 @@ _mesa_alloc_texture_image( void )
void
_mesa_free_texture_image( struct gl_texture_image *teximage )
{
- if (teximage->Data) {
+ if (teximage->Data && !teximage->IsClientData) {
MESA_PBUFFER_FREE( teximage->Data );
teximage->Data = NULL;
}
@@ -532,6 +577,41 @@ _mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit,
}
+/*
+ * Return the maximum number of allows mipmap levels for the given
+ * texture target.
+ */
+GLint
+_mesa_max_texture_levels(GLcontext *ctx, GLenum target)
+{
+ switch (target) {
+ case GL_TEXTURE_1D:
+ case GL_PROXY_TEXTURE_1D:
+ case GL_TEXTURE_2D:
+ case GL_PROXY_TEXTURE_2D:
+ return ctx->Const.MaxTextureLevels;
+ case GL_TEXTURE_3D:
+ case GL_PROXY_TEXTURE_3D:
+ return ctx->Const.Max3DTextureLevels;
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
+ case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
+ return ctx->Const.MaxCubeTextureLevels;
+ break;
+ case GL_TEXTURE_RECTANGLE_NV:
+ case GL_PROXY_TEXTURE_RECTANGLE_NV:
+ return 1;
+ break;
+ default:
+ return 0; /* bad target */
+ }
+}
+
+
#if 000 /* not used anymore */
/*
@@ -605,6 +685,7 @@ clear_teximage_fields(struct gl_texture_image *img)
img->Width = 0;
img->Height = 0;
img->Depth = 0;
+ img->RowStride = 0;
img->Width2 = 0;
img->Height2 = 0;
img->Depth2 = 0;
@@ -636,6 +717,7 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target,
img->Width = width;
img->Height = height;
img->Depth = depth;
+ img->RowStride = width;
img->WidthLog2 = logbase2(width - 2 * border);
if (height == 1) /* 1-D texture */
img->HeightLog2 = 0;
@@ -649,7 +731,13 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target,
img->Height2 = 1 << img->HeightLog2;
img->Depth2 = 1 << img->DepthLog2;
img->MaxLog2 = MAX2(img->WidthLog2, img->HeightLog2);
- img->IsCompressed = is_compressed_format(ctx, internalFormat);
+ img->IsCompressed = is_compressed_format(internalFormat);
+ if (img->IsCompressed)
+ img->CompressedSize = _mesa_compressed_texture_size(ctx, width, height,
+ depth, internalFormat);
+ else
+ img->CompressedSize = 0;
+
/* Compute Width/Height/DepthScale for mipmap lod computation */
if (target == GL_TEXTURE_RECTANGLE_NV) {
/* scale = 1.0 since texture coords directly map to texels */
@@ -661,7 +749,8 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target,
img->WidthScale = (GLfloat) img->Width;
img->HeightScale = (GLfloat) img->Height;
img->DepthScale = (GLfloat) img->Depth;
- }}
+ }
+}
@@ -680,7 +769,6 @@ texture_error_check( GLcontext *ctx, GLenum target,
GLint depth, GLint border )
{
GLboolean isProxy;
- GLint iformat;
GLint maxLevels = 0, maxTextureSize;
if (dimensions == 1) {
@@ -767,9 +855,8 @@ texture_error_check( GLcontext *ctx, GLenum target,
/* Border */
if (border != 0 && border != 1) {
if (!isProxy) {
- char message[100];
- sprintf(message, "glTexImage%dD(border=%d)", dimensions, border);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexImage%dD(border=%d)", dimensions, border);
}
return GL_TRUE;
}
@@ -783,9 +870,8 @@ texture_error_check( GLcontext *ctx, GLenum target,
target == GL_PROXY_TEXTURE_RECTANGLE_NV) {
if (width < 1 || width > ctx->Const.MaxTextureRectSize) {
if (!isProxy) {
- char message[100];
- sprintf(message, "glTexImage%dD(width=%d)", dimensions, width);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexImage%dD(width=%d)", dimensions, width);
}
return GL_TRUE;
}
@@ -793,9 +879,8 @@ texture_error_check( GLcontext *ctx, GLenum target,
else if (width < 2 * border || width > 2 + maxTextureSize
|| logbase2( width - 2 * border ) < 0) {
if (!isProxy) {
- char message[100];
- sprintf(message, "glTexImage%dD(width=%d)", dimensions, width);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexImage%dD(width=%d)", dimensions, width);
}
return GL_TRUE;
}
@@ -805,9 +890,8 @@ texture_error_check( GLcontext *ctx, GLenum target,
target == GL_PROXY_TEXTURE_RECTANGLE_NV) {
if (height < 1 || height > ctx->Const.MaxTextureRectSize) {
if (!isProxy) {
- char message[100];
- sprintf(message, "glTexImage%dD(height=%d)", dimensions, height);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexImage%dD(height=%d)", dimensions, height);
}
return GL_TRUE;
}
@@ -816,9 +900,8 @@ texture_error_check( GLcontext *ctx, GLenum target,
if (height < 2 * border || height > 2 + maxTextureSize
|| logbase2( height - 2 * border ) < 0) {
if (!isProxy) {
- char message[100];
- sprintf(message, "glTexImage%dD(height=%d)", dimensions, height);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexImage%dD(height=%d)", dimensions, height);
}
return GL_TRUE;
}
@@ -840,9 +923,8 @@ texture_error_check( GLcontext *ctx, GLenum target,
if (depth < 2 * border || depth > 2 + maxTextureSize
|| logbase2( depth - 2 * border ) < 0) {
if (!isProxy) {
- char message[100];
- sprintf(message, "glTexImage3D(depth=%d)", depth );
- _mesa_error( ctx, GL_INVALID_VALUE, message );
+ _mesa_error( ctx, GL_INVALID_VALUE,
+ "glTexImage3D(depth=%d)", depth );
}
return GL_TRUE;
}
@@ -853,18 +935,16 @@ texture_error_check( GLcontext *ctx, GLenum target,
target == GL_PROXY_TEXTURE_RECTANGLE_NV) {
if (level != 0) {
if (!isProxy) {
- char message[100];
- sprintf(message, "glTexImage%dD(level=%d)", dimensions, level);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexImage2D(level=%d)", level);
}
return GL_TRUE;
}
}
else if (level < 0 || level >= maxLevels) {
if (!isProxy) {
- char message[100];
- sprintf(message, "glTexImage%dD(level=%d)", dimensions, level);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexImage%dD(level=%d)", dimensions, level);
}
return GL_TRUE;
}
@@ -878,32 +958,85 @@ texture_error_check( GLcontext *ctx, GLenum target,
}
}
- iformat = _mesa_base_tex_format( ctx, internalFormat );
- if (iformat < 0) {
+ if (_mesa_base_tex_format(ctx, internalFormat) < 0) {
if (!isProxy) {
- char message[100];
- sprintf(message, "glTexImage%dD(internalFormat=0x%x)", dimensions,
- internalFormat);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexImage%dD(internalFormat=0x%x)",
+ dimensions, internalFormat);
}
return GL_TRUE;
}
- ASSERT(iformat > 0);
-
- if (!is_compressed_format( ctx, internalFormat ) &&
- !_mesa_is_legal_format_and_type( format, type )) {
+ if (!_mesa_is_legal_format_and_type(format, type)) {
/* Yes, generate GL_INVALID_OPERATION, not GL_INVALID_ENUM, if there
* is a type/format mismatch. See 1.2 spec page 94, sec 3.6.4.
*/
if (!isProxy) {
- char message[100];
- sprintf(message, "glTexImage%dD(format or type)", dimensions);
- _mesa_error(ctx, GL_INVALID_OPERATION, message);
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexImage%dD(format or type)", dimensions);
}
return GL_TRUE;
}
+ if (format == GL_YCBCR_MESA || internalFormat == GL_YCBCR_MESA) {
+ ASSERT(ctx->Extensions.MESA_ycbcr_texture);
+ if (format != GL_YCBCR_MESA ||
+ internalFormat != GL_YCBCR_MESA ||
+ (type != GL_UNSIGNED_SHORT_8_8_MESA &&
+ type != GL_UNSIGNED_SHORT_8_8_REV_MESA)) {
+ char message[100];
+ _mesa_sprintf(message,
+ "glTexImage%d(format/type/internalFormat YCBCR mismatch",
+ dimensions);
+ _mesa_error(ctx, GL_INVALID_ENUM, message);
+ return GL_TRUE; /* error */
+ }
+ if (target != GL_TEXTURE_2D &&
+ target != GL_PROXY_TEXTURE_2D &&
+ target != GL_TEXTURE_RECTANGLE_NV &&
+ target != GL_PROXY_TEXTURE_RECTANGLE_NV) {
+ if (!isProxy)
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage(target)");
+ return GL_TRUE;
+ }
+ if (border != 0) {
+ if (!isProxy) {
+ char message[100];
+ _mesa_sprintf(message,
+ "glTexImage%d(format=GL_YCBCR_MESA and border=%d)",
+ dimensions, border);
+ _mesa_error(ctx, GL_INVALID_VALUE, message);
+ }
+ return GL_TRUE;
+ }
+ }
+
+ if (is_compressed_format(internalFormat)) {
+ if (target == GL_TEXTURE_2D || target == GL_PROXY_TEXTURE_2D) {
+ /* OK */
+ }
+ else if (ctx->Extensions.ARB_texture_cube_map &&
+ (target == GL_PROXY_TEXTURE_CUBE_MAP ||
+ (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X &&
+ target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z))) {
+ /* OK */
+ }
+ else {
+ if (!isProxy) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexImage%d(target)", dimensions);
+ return GL_TRUE;
+ }
+ }
+ if (border != 0) {
+ if (!isProxy) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexImage%D(border!=0)", dimensions);
+ }
+ return GL_TRUE;
+ }
+ }
+
/* if we get here, the parameters are OK */
return GL_FALSE;
}
@@ -926,39 +1059,42 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions,
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
struct gl_texture_image *destTex;
GLint maxLevels = 0;
- GLboolean compressed;
if (dimensions == 1) {
- if (target != GL_TEXTURE_1D) {
+ if (target == GL_TEXTURE_1D) {
+ maxLevels = ctx->Const.MaxTextureLevels;
+ }
+ else {
_mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage1D(target)" );
return GL_TRUE;
}
- maxLevels = ctx->Const.MaxTextureLevels;
}
else if (dimensions == 2) {
- if (ctx->Extensions.ARB_texture_cube_map) {
- if ((target < GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB ||
- target > GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) &&
- target != GL_TEXTURE_2D) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage2D(target)" );
- return GL_TRUE;
- }
+ if (ctx->Extensions.ARB_texture_cube_map &&
+ target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
+ target <=GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) {
+ maxLevels = ctx->Const.MaxCubeTextureLevels;
}
- else if (target != GL_TEXTURE_2D) {
+ else if (ctx->Extensions.NV_texture_rectangle &&
+ target == GL_TEXTURE_RECTANGLE_NV) {
+ maxLevels = 1;
+ }
+ else if (target == GL_TEXTURE_2D) {
+ maxLevels = ctx->Const.MaxTextureLevels;
+ }
+ else {
_mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage2D(target)" );
return GL_TRUE;
}
- if (target == GL_PROXY_TEXTURE_2D && target == GL_TEXTURE_2D)
- maxLevels = ctx->Const.MaxTextureLevels;
- else
- maxLevels = ctx->Const.MaxCubeTextureLevels;
}
else if (dimensions == 3) {
- if (target != GL_TEXTURE_3D) {
+ if (target == GL_TEXTURE_3D) {
+ maxLevels = ctx->Const.Max3DTextureLevels;
+ }
+ else {
_mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage3D(target)" );
return GL_TRUE;
}
- maxLevels = ctx->Const.Max3DTextureLevels;
}
else {
_mesa_problem( ctx, "bad dims in texture_error_check" );
@@ -968,28 +1104,22 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions,
ASSERT(maxLevels > 0);
if (level < 0 || level >= maxLevels) {
- char message[100];
- sprintf(message, "glTexSubImage2D(level=%d)", level);
- _mesa_error(ctx, GL_INVALID_ENUM, message);
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexSubImage2D(level=%d)", level);
return GL_TRUE;
}
if (width < 0) {
- char message[100];
- sprintf(message, "glTexSubImage%dD(width=%d)", dimensions, width);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexSubImage%dD(width=%d)", dimensions, width);
return GL_TRUE;
}
if (height < 0 && dimensions > 1) {
- char message[100];
- sprintf(message, "glTexSubImage%dD(height=%d)", dimensions, height);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexSubImage%dD(height=%d)", dimensions, height);
return GL_TRUE;
}
if (depth < 0 && dimensions > 2) {
- char message[100];
- sprintf(message, "glTexSubImage%dD(depth=%d)", dimensions, depth);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage%dD(depth=%d)", dimensions, depth);
return GL_TRUE;
}
@@ -1029,31 +1159,51 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions,
}
}
- compressed = is_compressed_format(ctx, destTex->IntFormat);
-
- if (!compressed && !_mesa_is_legal_format_and_type(format, type)) {
- char message[100];
- sprintf(message, "glTexSubImage%dD(format or type)", dimensions);
- _mesa_error(ctx, GL_INVALID_ENUM, message);
+ if (!_mesa_is_legal_format_and_type(format, type)) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexSubImage%dD(format or type)", dimensions);
return GL_TRUE;
}
- if (compressed) {
- if (xoffset != -((GLint)destTex->Border)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glTexSubImage1/2/3D(xoffset != -border");
+ if (destTex->IsCompressed) {
+ const struct gl_texture_unit *texUnit;
+ const struct gl_texture_object *texObj;
+ const struct gl_texture_image *texImage;
+ texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ texObj = _mesa_select_tex_object(ctx, texUnit, target);
+ texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
+
+ if (target == GL_TEXTURE_2D || target == GL_PROXY_TEXTURE_2D) {
+ /* OK */
+ }
+ else if (ctx->Extensions.ARB_texture_cube_map &&
+ (target == GL_PROXY_TEXTURE_CUBE_MAP ||
+ (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X &&
+ target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z))) {
+ /* OK */
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexSubImage%D(target)", dimensions);
return GL_TRUE;
}
- if (dimensions > 1 && yoffset != -((GLint)destTex->Border)) {
+ /* offset must be multiple of 4 */
+ if ((xoffset & 3) || (yoffset & 3)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
- "glTexSubImage2/3D(yoffset != -border");
+ "glTexSubImage%D(xoffset or yoffset)", dimensions);
return GL_TRUE;
}
- if (dimensions > 2 && zoffset != -((GLint)destTex->Border)) {
+ /* size must be multiple of 4 or equal to whole texture size */
+ if ((width & 3) && (GLuint) width != texImage->Width) {
_mesa_error(ctx, GL_INVALID_OPERATION,
- "glTexSubImage3D(zoffset != -border");
+ "glTexSubImage%D(width)", dimensions);
return GL_TRUE;
- }
+ }
+ if ((height & 3) && (GLuint) height != texImage->Height) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexSubImage%D(width)", dimensions);
+ return GL_TRUE;
+ }
}
return GL_FALSE;
@@ -1070,7 +1220,6 @@ copytexture_error_check( GLcontext *ctx, GLuint dimensions,
GLenum target, GLint level, GLint internalFormat,
GLint width, GLint height, GLint border )
{
- GLint iformat;
GLint maxLevels = 0, maxTextureSize;
if (dimensions == 1) {
@@ -1111,18 +1260,16 @@ copytexture_error_check( GLcontext *ctx, GLuint dimensions,
/* Border */
if (border != 0 && border != 1) {
- char message[100];
- sprintf(message, "glCopyTexImage%dD(border)", dimensions);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexImage%dD(border)", dimensions);
return GL_TRUE;
}
/* Width */
if (width < 2 * border || width > 2 + maxTextureSize
|| logbase2( width - 2 * border ) < 0) {
- char message[100];
- sprintf(message, "glCopyTexImage%dD(width=%d)", dimensions, width);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexImage%dD(width=%d)", dimensions, width);
return GL_TRUE;
}
@@ -1130,9 +1277,8 @@ copytexture_error_check( GLcontext *ctx, GLuint dimensions,
if (dimensions >= 2) {
if (height < 2 * border || height > 2 + maxTextureSize
|| logbase2( height - 2 * border ) < 0) {
- char message[100];
- sprintf(message, "glCopyTexImage%dD(height=%d)", dimensions, height);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexImage%dD(height=%d)", dimensions, height);
return GL_TRUE;
}
}
@@ -1148,20 +1294,30 @@ copytexture_error_check( GLcontext *ctx, GLuint dimensions,
/* Level */
if (level < 0 || level >= maxLevels) {
- char message[100];
- sprintf(message, "glCopyTexImage%dD(level=%d)", dimensions, level);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexImage%dD(level=%d)", dimensions, level);
return GL_TRUE;
}
- iformat = _mesa_base_tex_format(ctx, internalFormat);
- if (iformat < 0) {
- char message[100];
- sprintf(message, "glCopyTexImage%dD(internalFormat)", dimensions);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ if (_mesa_base_tex_format(ctx, internalFormat) < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexImage%dD(internalFormat)", dimensions);
return GL_TRUE;
}
+ if (is_compressed_format(internalFormat)) {
+ if (target != GL_TEXTURE_2D) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glCopyTexImage%d(target)", dimensions);
+ return GL_TRUE;
+ }
+ if (border != 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyTexImage%D(border!=0)", dimensions);
+ return GL_TRUE;
+ }
+ }
+
/* if we get here, the parameters are OK */
return GL_FALSE;
}
@@ -1176,7 +1332,6 @@ copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions,
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
struct gl_texture_image *teximage;
GLint maxLevels = 0;
- GLboolean compressed;
if (dimensions == 1) {
if (target != GL_TEXTURE_1D) {
@@ -1198,7 +1353,7 @@ copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions,
_mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage2D(target)" );
return GL_TRUE;
}
- if (target == GL_TEXTURE_2D)
+ if (target == GL_PROXY_TEXTURE_2D && target == GL_TEXTURE_2D)
maxLevels = ctx->Const.MaxTextureLevels;
else
maxLevels = ctx->Const.MaxCubeTextureLevels;
@@ -1214,93 +1369,95 @@ copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions,
ASSERT(maxLevels > 0);
if (level < 0 || level >= maxLevels) {
- char message[100];
- sprintf(message, "glCopyTexSubImage%dD(level=%d)", dimensions, level);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(level=%d)", dimensions, level);
return GL_TRUE;
}
if (width < 0) {
- char message[100];
- sprintf(message, "glCopyTexSubImage%dD(width=%d)", dimensions, width);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(width=%d)", dimensions, width);
return GL_TRUE;
}
if (dimensions > 1 && height < 0) {
- char message[100];
- sprintf(message, "glCopyTexSubImage%dD(height=%d)", dimensions, height);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(height=%d)", dimensions, height);
return GL_TRUE;
}
teximage = _mesa_select_tex_image(ctx, texUnit, target, level);
if (!teximage) {
- char message[100];
- sprintf(message, "glCopyTexSubImage%dD(undefined texture)", dimensions);
- _mesa_error(ctx, GL_INVALID_OPERATION, message);
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyTexSubImage%dD(undefined texture level: %d)",
+ dimensions, level);
return GL_TRUE;
}
if (xoffset < -((GLint)teximage->Border)) {
- char message[100];
- sprintf(message, "glCopyTexSubImage%dD(xoffset=%d)", dimensions, xoffset);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(xoffset=%d)", dimensions, xoffset);
return GL_TRUE;
}
if (xoffset + width > (GLint) (teximage->Width + teximage->Border)) {
- char message[100];
- sprintf(message, "glCopyTexSubImage%dD(xoffset+width)", dimensions);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(xoffset+width)", dimensions);
return GL_TRUE;
}
if (dimensions > 1) {
if (yoffset < -((GLint)teximage->Border)) {
- char message[100];
- sprintf(message, "glCopyTexSubImage%dD(yoffset=%d)", dimensions, yoffset);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(yoffset=%d)", dimensions, yoffset);
return GL_TRUE;
}
/* NOTE: we're adding the border here, not subtracting! */
if (yoffset + height > (GLint) (teximage->Height + teximage->Border)) {
- char message[100];
- sprintf(message, "glCopyTexSubImage%dD(yoffset+height)", dimensions);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(yoffset+height)", dimensions);
return GL_TRUE;
}
}
if (dimensions > 2) {
if (zoffset < -((GLint)teximage->Border)) {
- char message[100];
- sprintf(message, "glCopyTexSubImage%dD(zoffset)", dimensions);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(zoffset)", dimensions);
return GL_TRUE;
}
if (zoffset > (GLint) (teximage->Depth + teximage->Border)) {
- char message[100];
- sprintf(message, "glCopyTexSubImage%dD(zoffset+depth)", dimensions);
- _mesa_error(ctx, GL_INVALID_VALUE, message);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(zoffset+depth)", dimensions);
return GL_TRUE;
}
}
- compressed = is_compressed_format(ctx, teximage->IntFormat);
- if (compressed) {
- if (xoffset != -((GLint)teximage->Border)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTexSubImage1/2/3D(xoffset != -border");
+ if (teximage->IsCompressed) {
+ if (target != GL_TEXTURE_2D) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glCopyTexSubImage%d(target)", dimensions);
return GL_TRUE;
}
- if (dimensions > 1 && yoffset != -((GLint)teximage->Border)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTexSubImage2/3D(yoffset != -border");
+ /* offset must be multiple of 4 */
+ if ((xoffset & 3) || (yoffset & 3)) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%D(xoffset or yoffset)", dimensions);
return GL_TRUE;
}
- if (dimensions > 2 && zoffset != -((GLint)teximage->Border)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTexSubImage3D(zoffset != -border");
+ /* size must be multiple of 4 */
+ if ((width & 3) != 0 && (GLuint) width != teximage->Width) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%D(width)", dimensions);
return GL_TRUE;
- }
+ }
+ if ((height & 3) != 0 && (GLuint) height != teximage->Height) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%D(height)", dimensions);
+ return GL_TRUE;
+ }
+ }
+
+ if (teximage->IntFormat == GL_YCBCR_MESA) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyTexSubImage2D");
+ return GL_TRUE;
}
/* if we get here, the parameters are OK */
@@ -1315,7 +1472,7 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format,
{
const struct gl_texture_unit *texUnit;
const struct gl_texture_object *texObj;
- struct gl_texture_image *texImage;
+ const struct gl_texture_image *texImage;
GLint maxLevels = 0;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
@@ -1327,20 +1484,8 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format,
return;
}
- if (target == GL_TEXTURE_1D || target == GL_TEXTURE_2D) {
- maxLevels = ctx->Const.MaxTextureLevels;
- }
- else if (target == GL_TEXTURE_3D) {
- maxLevels = ctx->Const.Max3DTextureLevels;
- }
- else if (target == GL_TEXTURE_RECTANGLE_NV) {
- maxLevels = 1;
- }
- else {
- maxLevels = ctx->Const.MaxCubeTextureLevels;
- }
-
- ASSERT(maxLevels > 0);
+ maxLevels = _mesa_max_texture_levels(ctx, target);
+ ASSERT(maxLevels > 0); /* 0 indicates bad target, caught above */
if (level < 0 || level >= maxLevels) {
_mesa_error( ctx, GL_INVALID_VALUE, "glGetTexImage(level)" );
@@ -1366,6 +1511,10 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format,
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)");
}
+ if (!ctx->Extensions.MESA_ycbcr_texture && format == GL_YCBCR_MESA) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)");
+ }
+
/* XXX what if format/type doesn't match texture format/type? */
if (!pixels)
@@ -1390,7 +1539,7 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format,
for (img = 0; img < depth; img++) {
for (row = 0; row < height; row++) {
/* compute destination address in client memory */
- GLvoid *dest = _mesa_image_address( &ctx->Unpack, pixels,
+ GLvoid *dest = _mesa_image_address( &ctx->Pack, pixels,
width, height, format, type,
img, row, 0);
assert(dest);
@@ -1416,6 +1565,24 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format,
_mesa_pack_depth_span(ctx, width, dest, type,
depthRow, &ctx->Pack);
}
+ else if (format == GL_YCBCR_MESA) {
+ /* No pixel transfer */
+ const GLint rowstride = texImage->RowStride;
+ MEMCPY(dest,
+ (const GLushort *) texImage->Data + row * rowstride,
+ width * sizeof(GLushort));
+ /* check for byte swapping */
+ if ((texImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR
+ && type == GL_UNSIGNED_SHORT_8_8_REV_MESA) ||
+ (texImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR_REV
+ && type == GL_UNSIGNED_SHORT_8_8_MESA)) {
+ if (!ctx->Pack.SwapBytes)
+ _mesa_swap2((GLushort *) dest, width);
+ }
+ else if (ctx->Pack.SwapBytes) {
+ _mesa_swap2((GLushort *) dest, width);
+ }
+ }
else {
/* general case: convert row to RGBA format */
GLchan rgba[MAX_WIDTH][4];
@@ -1473,13 +1640,14 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat,
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
/* free the old texture data */
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
clear_teximage_fields(texImage); /* not really needed, but helpful */
- _mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, 1, 1,
+ _mesa_init_teximage_fields(ctx, target, texImage,
+ postConvWidth, 1, 1,
border, internalFormat);
if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
@@ -1487,28 +1655,10 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat,
ASSERT(ctx->Driver.TexImage1D);
-#if 0 /* don't make default teximage anymore */
- if (pixels) {
- (*ctx->Driver.TexImage1D)(ctx, target, level, internalFormat,
- width, border, format, type, pixels,
- &ctx->Unpack, texObj, texImage);
- }
- else {
- GLubyte *dummy = make_null_texture(width, 1, 1, format);
- if (dummy) {
- (*ctx->Driver.TexImage1D)(ctx, target, level, internalFormat,
- width, border,
- format, GL_UNSIGNED_BYTE, dummy,
- &_mesa_native_packing, texObj, texImage);
- FREE(dummy);
- }
- }
-#else
- /* <pixels> may be null! */
+ /* 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);
-#endif
ASSERT(texImage->TexFormat);
if (!texImage->FetchTexel) {
@@ -1517,26 +1667,15 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat,
}
ASSERT(texImage->FetchTexel);
- if (texImage->IsCompressed) {
- ASSERT(texImage->CompressedSize > 0);
- }
-
/* state update */
texObj->Complete = GL_FALSE;
ctx->NewState |= _NEW_TEXTURE;
}
else if (target == GL_PROXY_TEXTURE_1D) {
/* Proxy texture: check for errors and update proxy state */
- GLenum error = texture_error_check(ctx, target, level, internalFormat,
- format, type, 1,
- postConvWidth, 1, 1, border);
+ GLboolean error = texture_error_check(ctx, target, level, internalFormat,
+ format, type, 1, postConvWidth, 1, 1, border);
if (!error) {
- struct gl_texture_unit *texUnit;
- 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, postConvWidth, 1, 1,
- border, internalFormat);
ASSERT(ctx->Driver.TestProxyTexImage);
error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level,
internalFormat, format, type,
@@ -1548,6 +1687,16 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat,
clear_teximage_fields(ctx->Texture.Proxy1D->Image[level]);
}
}
+ else {
+ /* no error, set the tex image parameters */
+ struct gl_texture_unit *texUnit;
+ 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,
+ postConvWidth, 1, 1,
+ border, internalFormat);
+ }
}
else {
_mesa_error( ctx, GL_INVALID_ENUM, "glTexImage1D(target)" );
@@ -1600,43 +1749,25 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
/* free the old texture data */
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
clear_teximage_fields(texImage); /* not really needed, but helpful */
_mesa_init_teximage_fields(ctx, target, texImage,
- postConvWidth, postConvHeight,
- 1, border, internalFormat);
+ postConvWidth, postConvHeight, 1,
+ border, internalFormat);
if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
_mesa_update_state(ctx);
ASSERT(ctx->Driver.TexImage2D);
-#if 0 /* don't make default teximage anymore */
- if (pixels) {
- (*ctx->Driver.TexImage2D)(ctx, target, level, internalFormat,
- width, height, border, format, type, pixels,
- &ctx->Unpack, texObj, texImage);
- }
- else {
- GLubyte *dummy = make_null_texture(width, height, 1, format);
- if (dummy) {
- (*ctx->Driver.TexImage2D)(ctx, target, level, internalFormat,
- width, height, border,
- format, GL_UNSIGNED_BYTE, dummy,
- &_mesa_native_packing, texObj, texImage);
- FREE(dummy);
- }
- }
-#else
- /* <pixels> may be null! */
+ /* 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);
-#endif
ASSERT(texImage->TexFormat);
if (!texImage->FetchTexel) {
@@ -1645,10 +1776,6 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
}
ASSERT(texImage->FetchTexel);
- if (texImage->IsCompressed) {
- ASSERT(texImage->CompressedSize > 0);
- }
-
/* state update */
texObj->Complete = GL_FALSE;
ctx->NewState |= _NEW_TEXTURE;
@@ -1659,16 +1786,9 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
(target == GL_PROXY_TEXTURE_RECTANGLE_NV &&
ctx->Extensions.NV_texture_rectangle)) {
/* Proxy texture: check for errors and update proxy state */
- GLenum error = texture_error_check(ctx, target, level, internalFormat,
- format, type, 2,
- postConvWidth, postConvHeight, 1, border);
+ GLboolean error = texture_error_check(ctx, target, level, internalFormat,
+ format, type, 2, postConvWidth, postConvHeight, 1, border);
if (!error) {
- struct gl_texture_unit *texUnit;
- 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, postConvWidth,
- postConvHeight, 1, border, internalFormat);
ASSERT(ctx->Driver.TestProxyTexImage);
error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level,
internalFormat, format, type,
@@ -1682,6 +1802,16 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
clear_teximage_fields(ctx->Texture.Proxy2D->Image[level]);
}
}
+ else {
+ /* no error, set the tex image parameters */
+ struct gl_texture_unit *texUnit;
+ 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,
+ postConvWidth, postConvHeight, 1,
+ border, internalFormat);
+ }
}
else {
_mesa_error( ctx, GL_INVALID_ENUM, "glTexImage2D(target)" );
@@ -1695,7 +1825,7 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
* Note that width and height include the border.
*/
void
-_mesa_TexImage3D( GLenum target, GLint level, GLenum internalFormat,
+_mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat,
GLsizei width, GLsizei height, GLsizei depth,
GLint border, GLenum format, GLenum type,
const GLvoid *pixels )
@@ -1725,12 +1855,13 @@ _mesa_TexImage3D( GLenum target, GLint level, GLenum internalFormat,
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
clear_teximage_fields(texImage); /* not really needed, but helpful */
- _mesa_init_teximage_fields(ctx, target, texImage, width, height, depth,
+ _mesa_init_teximage_fields(ctx, target, texImage,
+ width, height, depth,
border, internalFormat);
if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
@@ -1738,30 +1869,10 @@ _mesa_TexImage3D( GLenum target, GLint level, GLenum internalFormat,
ASSERT(ctx->Driver.TexImage3D);
-#if 0 /* don't make default teximage anymore */
- if (pixels) {
- (*ctx->Driver.TexImage3D)(ctx, target, level, (GLint) internalFormat,
- width, height, depth, border,
- format, type, pixels,
- &ctx->Unpack, texObj, texImage);
- }
- else {
- GLubyte *dummy = make_null_texture(width, height, depth, format);
- if (dummy) {
- (*ctx->Driver.TexImage3D)(ctx, target, level,
- (GLint) internalFormat,
- width, height, depth, border,
- format, GL_UNSIGNED_BYTE, dummy,
- &_mesa_native_packing, texObj, texImage);
- FREE(dummy);
- }
- }
-#else
- /* <pixels> may be null! */
+ /* 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);
-#endif
ASSERT(texImage->TexFormat);
if (!texImage->FetchTexel) {
@@ -1770,25 +1881,15 @@ _mesa_TexImage3D( GLenum target, GLint level, GLenum internalFormat,
}
ASSERT(texImage->FetchTexel);
- if (texImage->IsCompressed) {
- ASSERT(texImage->CompressedSize > 0);
- }
-
/* state update */
texObj->Complete = GL_FALSE;
ctx->NewState |= _NEW_TEXTURE;
}
else if (target == GL_PROXY_TEXTURE_3D) {
/* Proxy texture: check for errors and update proxy state */
- GLenum error = texture_error_check(ctx, target, level, internalFormat,
+ GLboolean error = texture_error_check(ctx, target, level, internalFormat,
format, type, 3, width, height, depth, border);
if (!error) {
- struct gl_texture_unit *texUnit;
- 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);
ASSERT(ctx->Driver.TestProxyTexImage);
error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level,
internalFormat, format, type,
@@ -1800,6 +1901,15 @@ _mesa_TexImage3D( GLenum target, GLint level, GLenum internalFormat,
clear_teximage_fields(ctx->Texture.Proxy3D->Image[level]);
}
}
+ else {
+ /* no error, set the tex image parameters */
+ struct gl_texture_unit *texUnit;
+ 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);
+ }
}
else {
_mesa_error( ctx, GL_INVALID_ENUM, "glTexImage3D(target)" );
@@ -1814,7 +1924,7 @@ _mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalFormat,
GLint border, GLenum format, GLenum type,
const GLvoid *pixels )
{
- _mesa_TexImage3D(target, level, internalFormat, width, height,
+ _mesa_TexImage3D(target, level, (GLint) internalFormat, width, height,
depth, border, format, type, pixels);
}
@@ -1994,11 +2104,11 @@ _mesa_CopyTexImage1D( GLenum target, GLint level,
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
/* free the old texture data */
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
clear_teximage_fields(texImage); /* not really needed, but helpful */
_mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, 1, 1,
@@ -2058,11 +2168,11 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat,
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
/* free the old texture data */
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
clear_teximage_fields(texImage); /* not really needed, but helpful */
_mesa_init_teximage_fields(ctx, target, texImage,
@@ -2200,6 +2310,176 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level,
+
+/**********************************************************************/
+/****** Compressed Textures ******/
+/**********************************************************************/
+
+
+/**
+ * Error checking for glCompressedTexImage[123]D().
+ * \return error code or GL_NO_ERROR.
+ */
+static GLenum
+compressed_texture_error_check(GLcontext *ctx, GLint dimensions,
+ GLenum target, GLint level,
+ GLenum internalFormat, GLsizei width,
+ GLsizei height, GLsizei depth, GLint border,
+ GLsizei imageSize)
+{
+ GLboolean isProxy = GL_FALSE;
+ GLint expectedSize, maxLevels = 0, maxTextureSize;
+
+ if (dimensions == 1) {
+ /* 1D compressed textures not allowed */
+ return GL_INVALID_ENUM;
+ }
+ else if (dimensions == 2) {
+ if (target == GL_PROXY_TEXTURE_2D) {
+ maxLevels = ctx->Const.MaxTextureLevels;
+ isProxy = GL_TRUE;
+ }
+ else if (target == GL_TEXTURE_2D) {
+ maxLevels = ctx->Const.MaxTextureLevels;
+ }
+ else if (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB) {
+ if (!ctx->Extensions.ARB_texture_cube_map)
+ return GL_INVALID_ENUM; /*target*/
+ maxLevels = ctx->Const.MaxCubeTextureLevels;
+ isProxy = GL_TRUE;
+ }
+ else if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
+ target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) {
+ if (!ctx->Extensions.ARB_texture_cube_map)
+ return GL_INVALID_ENUM; /*target*/
+ maxLevels = ctx->Const.MaxCubeTextureLevels;
+ }
+ else {
+ return GL_INVALID_ENUM; /*target*/
+ }
+ }
+ else if (dimensions == 3) {
+ /* 3D compressed textures not allowed */
+ return GL_INVALID_ENUM;
+ }
+
+ maxTextureSize = 1 << (maxLevels - 1);
+
+ if (!is_compressed_format(internalFormat))
+ return GL_INVALID_ENUM;
+
+ if (border != 0)
+ return GL_INVALID_VALUE;
+
+ if (width < 1 || width > maxTextureSize || logbase2(width) < 0)
+ return GL_INVALID_VALUE;
+
+ if ((height < 1 || height > maxTextureSize || logbase2(height) < 0)
+ && dimensions > 1)
+ return GL_INVALID_VALUE;
+
+ if ((depth < 1 || depth > maxTextureSize || logbase2(depth) < 0)
+ && dimensions > 2)
+ return GL_INVALID_VALUE;
+
+ /* For cube map, width must equal height */
+ if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
+ target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB && width != height)
+ return GL_INVALID_VALUE;
+
+ if (level < 0 || level >= maxLevels)
+ return GL_INVALID_VALUE;
+
+ expectedSize = _mesa_compressed_texture_size(ctx, width, height, depth,
+ internalFormat);
+ if (expectedSize != imageSize)
+ return GL_INVALID_VALUE;
+
+ return GL_NO_ERROR;
+}
+
+
+/**
+ * Error checking for glCompressedTexSubImage[123]D().
+ * \return error code or GL_NO_ERROR.
+ */
+static GLenum
+compressed_subtexture_error_check(GLcontext *ctx, GLint dimensions,
+ GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLsizei imageSize)
+{
+ GLboolean isProxy = GL_FALSE;
+ GLint expectedSize, maxLevels = 0, maxTextureSize;
+
+ if (dimensions == 1) {
+ /* 1D compressed textures not allowed */
+ return GL_INVALID_ENUM;
+ }
+ else if (dimensions == 2) {
+ if (target == GL_PROXY_TEXTURE_2D) {
+ maxLevels = ctx->Const.MaxTextureLevels;
+ isProxy = GL_TRUE;
+ }
+ else if (target == GL_TEXTURE_2D) {
+ maxLevels = ctx->Const.MaxTextureLevels;
+ }
+ else if (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB) {
+ if (!ctx->Extensions.ARB_texture_cube_map)
+ return GL_INVALID_ENUM; /*target*/
+ maxLevels = ctx->Const.MaxCubeTextureLevels;
+ isProxy = GL_TRUE;
+ }
+ else if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
+ target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) {
+ if (!ctx->Extensions.ARB_texture_cube_map)
+ return GL_INVALID_ENUM; /*target*/
+ maxLevels = ctx->Const.MaxCubeTextureLevels;
+ }
+ else {
+ return GL_INVALID_ENUM; /*target*/
+ }
+ }
+ else if (dimensions == 3) {
+ /* 3D compressed textures not allowed */
+ return GL_INVALID_ENUM;
+ }
+
+ maxTextureSize = 1 << (maxLevels - 1);
+
+ if (!is_compressed_format(format))
+ return GL_INVALID_ENUM;
+
+ if (width < 1 || width > maxTextureSize || logbase2(width) < 0)
+ return GL_INVALID_VALUE;
+
+ if ((height < 1 || height > maxTextureSize || logbase2(height) < 0)
+ && dimensions > 1)
+ return GL_INVALID_VALUE;
+
+ if (level < 0 || level >= maxLevels)
+ return GL_INVALID_VALUE;
+
+ if ((xoffset & 3) != 0 || (yoffset & 3) != 0)
+ return GL_INVALID_VALUE;
+
+ if ((width & 3) != 0 && width != 2 && width != 1)
+ return GL_INVALID_VALUE;
+
+ if ((height & 3) != 0 && height != 2 && height != 1)
+ return GL_INVALID_VALUE;
+
+ expectedSize = _mesa_compressed_texture_size(ctx, width, height, depth,
+ format);
+ if (expectedSize != imageSize)
+ return GL_INVALID_VALUE;
+
+ return GL_NO_ERROR;
+}
+
+
+
void
_mesa_CompressedTexImage1DARB(GLenum target, GLint level,
GLenum internalFormat, GLsizei width,
@@ -2209,28 +2489,15 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- switch (internalFormat) {
- case GL_COMPRESSED_ALPHA_ARB:
- case GL_COMPRESSED_LUMINANCE_ARB:
- case GL_COMPRESSED_LUMINANCE_ALPHA_ARB:
- case GL_COMPRESSED_INTENSITY_ARB:
- case GL_COMPRESSED_RGB_ARB:
- case GL_COMPRESSED_RGBA_ARB:
- _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage1DARB");
- return;
- default:
- /* silence compiler warning */
- ;
- }
-
if (target == GL_TEXTURE_1D) {
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
-
- if (texture_error_check(ctx, target, level, internalFormat,
- GL_NONE, GL_NONE, 1, width, 1, 1, border)) {
- return; /* error in texture image was detected */
+ GLenum error = compressed_texture_error_check(ctx, 1, target, level,
+ internalFormat, width, 1, 1, border, imageSize);
+ if (error) {
+ _mesa_error(ctx, error, "glCompressedTexImage1D");
+ return;
}
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
@@ -2241,26 +2508,23 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level,
texImage = _mesa_alloc_texture_image();
texObj->Image[level] = texImage;
if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1DARB");
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1D");
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
_mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1,
border, internalFormat);
- if (ctx->Extensions.ARB_texture_compression) {
- ASSERT(ctx->Driver.CompressedTexImage1D);
- (*ctx->Driver.CompressedTexImage1D)(ctx, target, level,
- internalFormat, width, border,
- imageSize, data,
- texObj, texImage);
- ASSERT(texImage->CompressedSize > 0); /* sanity */
- }
+ ASSERT(ctx->Driver.CompressedTexImage1D);
+ (*ctx->Driver.CompressedTexImage1D)(ctx, target, level,
+ internalFormat, width, border,
+ imageSize, data,
+ texObj, texImage);
/* state update */
texObj->Complete = GL_FALSE;
@@ -2268,15 +2532,9 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level,
}
else if (target == GL_PROXY_TEXTURE_1D) {
/* Proxy texture: check for errors and update proxy state */
- GLenum error = texture_error_check(ctx, target, level, internalFormat,
- GL_NONE, GL_NONE, 1, width, 1, 1, border);
+ GLenum error = compressed_texture_error_check(ctx, 1, target, level,
+ internalFormat, width, 1, 1, border, imageSize);
if (!error) {
- struct gl_texture_unit *texUnit;
- 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);
ASSERT(ctx->Driver.TestProxyTexImage);
error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level,
internalFormat, GL_NONE, GL_NONE,
@@ -2288,9 +2546,18 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level,
clear_teximage_fields(ctx->Texture.Proxy1D->Image[level]);
}
}
+ else {
+ /* store the teximage parameters */
+ struct gl_texture_unit *texUnit;
+ 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);
+ }
}
else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage1DARB(target)");
+ _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage1D(target)");
return;
}
}
@@ -2305,33 +2572,18 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- switch (internalFormat) {
- case GL_COMPRESSED_ALPHA_ARB:
- case GL_COMPRESSED_LUMINANCE_ARB:
- case GL_COMPRESSED_LUMINANCE_ALPHA_ARB:
- case GL_COMPRESSED_INTENSITY_ARB:
- case GL_COMPRESSED_RGB_ARB:
- case GL_COMPRESSED_RGBA_ARB:
- _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage2DARB");
- return;
- default:
- /* silence compiler warning */
- ;
- }
-
if (target == GL_TEXTURE_2D ||
(ctx->Extensions.ARB_texture_cube_map &&
target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
- target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) ||
- (ctx->Extensions.NV_texture_rectangle &&
- target == GL_TEXTURE_RECTANGLE_NV)) {
+ target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)) {
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
-
- if (texture_error_check(ctx, target, level, internalFormat,
- GL_NONE, GL_NONE, 2, width, height, 1, border)) {
- return; /* error in texture image was detected */
+ GLenum error = compressed_texture_error_check(ctx, 2, target, level,
+ internalFormat, width, height, 1, border, imageSize);
+ if (error) {
+ _mesa_error(ctx, error, "glCompressedTexImage2D");
+ return;
}
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
@@ -2342,42 +2594,35 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level,
texImage = _mesa_alloc_texture_image();
texObj->Image[level] = texImage;
if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2DARB");
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D");
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
_mesa_init_teximage_fields(ctx, target, texImage, width, height, 1,
border, internalFormat);
- if (ctx->Extensions.ARB_texture_compression) {
- ASSERT(ctx->Driver.CompressedTexImage2D);
- (*ctx->Driver.CompressedTexImage2D)(ctx, target, level,
- internalFormat, width, height,
- border, imageSize, data,
- texObj, texImage);
- ASSERT(texImage->CompressedSize > 0); /* sanity */
- }
+ 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;
}
- else if (target == GL_PROXY_TEXTURE_2D) {
+ else if (target == GL_PROXY_TEXTURE_2D ||
+ (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB &&
+ ctx->Extensions.ARB_texture_cube_map)) {
/* Proxy texture: check for errors and update proxy state */
- GLenum error = texture_error_check(ctx, target, level, internalFormat,
- GL_NONE, GL_NONE, 2, width, height, 1, border);
+ GLenum error = compressed_texture_error_check(ctx, 2, target, level,
+ internalFormat, width, height, 1, border, imageSize);
if (!error) {
- struct gl_texture_unit *texUnit;
- 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);
ASSERT(ctx->Driver.TestProxyTexImage);
error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level,
internalFormat, GL_NONE, GL_NONE,
@@ -2391,9 +2636,18 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level,
clear_teximage_fields(ctx->Texture.Proxy2D->Image[level]);
}
}
+ else {
+ /* store the teximage parameters */
+ struct gl_texture_unit *texUnit;
+ 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);
+ }
}
else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage2DARB(target)");
+ _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage2D(target)");
return;
}
}
@@ -2408,28 +2662,15 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- switch (internalFormat) {
- case GL_COMPRESSED_ALPHA_ARB:
- case GL_COMPRESSED_LUMINANCE_ARB:
- case GL_COMPRESSED_LUMINANCE_ALPHA_ARB:
- case GL_COMPRESSED_INTENSITY_ARB:
- case GL_COMPRESSED_RGB_ARB:
- case GL_COMPRESSED_RGBA_ARB:
- _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage3DARB");
- return;
- default:
- /* silence compiler warning */
- ;
- }
-
if (target == GL_TEXTURE_3D) {
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
-
- if (texture_error_check(ctx, target, level, internalFormat,
- GL_NONE, GL_NONE, 3, width, height, depth, border)) {
- return; /* error in texture image was detected */
+ GLenum error = compressed_texture_error_check(ctx, 3, target, level,
+ internalFormat, width, height, depth, border, imageSize);
+ if (error) {
+ _mesa_error(ctx, error, "glCompressedTexImage3D");
+ return;
}
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
@@ -2440,27 +2681,24 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level,
texImage = _mesa_alloc_texture_image();
texObj->Image[level] = texImage;
if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3DARB");
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3D");
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
_mesa_init_teximage_fields(ctx, target, texImage, width, height, depth,
border, internalFormat);
- if (ctx->Extensions.ARB_texture_compression) {
- ASSERT(ctx->Driver.CompressedTexImage3D);
- (*ctx->Driver.CompressedTexImage3D)(ctx, target, level,
- internalFormat,
- width, height, depth,
- border, imageSize, data,
- texObj, texImage);
- ASSERT(texImage->CompressedSize > 0); /* sanity */
- }
+ 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;
@@ -2468,16 +2706,9 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level,
}
else if (target == GL_PROXY_TEXTURE_3D) {
/* Proxy texture: check for errors and update proxy state */
- GLenum error = texture_error_check(ctx, target, level, internalFormat,
- GL_NONE, GL_NONE, 3, width, height, depth, border);
+ GLenum error = compressed_texture_error_check(ctx, 3, target, level,
+ internalFormat, width, height, depth, border, imageSize);
if (!error) {
- struct gl_texture_unit *texUnit;
- 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);
ASSERT(ctx->Driver.TestProxyTexImage);
error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level,
internalFormat, GL_NONE, GL_NONE,
@@ -2489,9 +2720,18 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level,
clear_teximage_fields(ctx->Texture.Proxy3D->Image[level]);
}
}
+ else {
+ /* store the teximage parameters */
+ struct gl_texture_unit *texUnit;
+ 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);
+ }
}
else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage3DARB(target)");
+ _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage3D(target)");
return;
}
}
@@ -2505,12 +2745,15 @@ _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
+ GLenum error;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (subtexture_error_check(ctx, 1, target, level, xoffset, 0, 0,
- width, 1, 1, format, GL_NONE)) {
- return; /* error was detected */
+ error = compressed_subtexture_error_check(ctx, 1, target, level,
+ xoffset, 0, 0, width, 1, 1, format, imageSize);
+ if (error) {
+ _mesa_error(ctx, error, "glCompressedTexSubImage1D");
+ return;
}
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
@@ -2518,6 +2761,17 @@ _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
assert(texImage);
+ if ((GLint) format != texImage->IntFormat) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCompressedTexSubImage1D(format)");
+ return;
+ }
+
+ if ((width == 1 || width == 2) && (GLuint) width != texImage->Width) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage1D(width)");
+ return;
+ }
+
if (width == 0 || !data)
return; /* no-op, not an error */
@@ -2540,12 +2794,15 @@ _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
+ GLenum error;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (subtexture_error_check(ctx, 2, target, level, xoffset, yoffset, 0,
- width, height, 1, format, GL_NONE)) {
- return; /* error was detected */
+ error = compressed_subtexture_error_check(ctx, 2, target, level,
+ xoffset, yoffset, 0, width, height, 1, format, imageSize);
+ if (error) {
+ _mesa_error(ctx, error, "glCompressedTexSubImage2D");
+ return;
}
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
@@ -2553,6 +2810,18 @@ _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
assert(texImage);
+ if ((GLint) format != texImage->IntFormat) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCompressedTexSubImage2D(format)");
+ 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)");
+ return;
+ }
+
if (width == 0 || height == 0 || !data)
return; /* no-op, not an error */
@@ -2575,12 +2844,15 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
+ GLenum error;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (subtexture_error_check(ctx, 3, target, level, xoffset, yoffset, zoffset,
- width, height, depth, format, GL_NONE)) {
- return; /* error was detected */
+ error = compressed_subtexture_error_check(ctx, 3, target, level,
+ xoffset, yoffset, zoffset, width, height, depth, format, imageSize);
+ if (error) {
+ _mesa_error(ctx, error, "glCompressedTexSubImage2D");
+ return;
}
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
@@ -2588,6 +2860,19 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
assert(texImage);
+ if ((GLint) format != texImage->IntFormat) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCompressedTexSubImage3D(format)");
+ 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)");
+ return;
+ }
+
if (width == 0 || height == 0 || depth == 0 || !data)
return; /* no-op, not an error */
@@ -2619,17 +2904,8 @@ _mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img)
return;
}
- if (target == GL_TEXTURE_1D || target == GL_TEXTURE_2D) {
- maxLevels = ctx->Const.MaxTextureLevels;
- }
- else if (target == GL_TEXTURE_3D) {
- maxLevels = ctx->Const.Max3DTextureLevels;
- }
- else {
- maxLevels = ctx->Const.MaxCubeTextureLevels;
- }
-
- ASSERT(maxLevels > 0);
+ maxLevels = _mesa_max_texture_levels(ctx, target);
+ ASSERT(maxLevels > 0); /* 0 indicates bad target, caught above */
if (level < 0 || level >= maxLevels) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetCompressedTexImageARB(level)");
@@ -2656,9 +2932,6 @@ _mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img)
if (!img)
return;
- if (ctx->Extensions.ARB_texture_compression) {
- ASSERT(ctx->Driver.GetCompressedTexImage);
- (*ctx->Driver.GetCompressedTexImage)(ctx, target, level, img, texObj,
- texImage);
- }
+ /* just memcpy, no pixelstore or pixel transfer */
+ MEMCPY(img, texImage->Data, texImage->CompressedSize);
}
diff --git a/xc/extras/Mesa/src/teximage.h b/xc/extras/Mesa/src/teximage.h
index 46f9b60a5..ac467d27c 100644
--- a/xc/extras/Mesa/src/teximage.h
+++ b/xc/extras/Mesa/src/teximage.h
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.4
+ * Version: 3.5
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
@@ -69,6 +69,9 @@ _mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit,
GLenum target, GLint level);
+extern GLint
+_mesa_max_texture_levels(GLcontext *ctx, GLenum target);
+
/*** API entry point functions ***/
@@ -86,7 +89,7 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalformat,
extern void
-_mesa_TexImage3D( GLenum target, GLint level, GLenum internalformat,
+_mesa_TexImage3D( GLenum target, GLint level, GLint internalformat,
GLsizei width, GLsizei height, GLsizei depth, GLint border,
GLenum format, GLenum type, const GLvoid *pixels );
diff --git a/xc/extras/Mesa/src/texobj.c b/xc/extras/Mesa/src/texobj.c
index 1b0e583a2..75c92be18 100644
--- a/xc/extras/Mesa/src/texobj.c
+++ b/xc/extras/Mesa/src/texobj.c
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.4
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -23,23 +23,17 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colortab.h"
#include "context.h"
#include "enums.h"
#include "hash.h"
+#include "imports.h"
#include "macros.h"
-#include "mem.h"
#include "teximage.h"
#include "texstate.h"
#include "texobj.h"
#include "mtypes.h"
-#endif
-
/*
@@ -48,7 +42,8 @@
* table.
* Input: shared - the shared GL state structure to contain the texture object
* name - integer name for the texture object
- * dimensions - either 1, 2, 3 or 6 (cube map)
+ * target - either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D,
+ * GL_TEXTURE_CUBE_MAP_ARB or GL_TEXTURE_RECTANGLE_NV
* zero is ok for the sake of GenTextures()
* Return: pointer to new texture object
*/
@@ -86,16 +81,18 @@ _mesa_alloc_texture_object( struct gl_shared_state *shared,
obj->WrapR = GL_REPEAT;
obj->MinFilter = GL_NEAREST_MIPMAP_LINEAR;
}
- obj->MinFilter = GL_NEAREST_MIPMAP_LINEAR;
obj->MagFilter = GL_LINEAR;
obj->MinLod = -1000.0;
obj->MaxLod = 1000.0;
obj->BaseLevel = 0;
obj->MaxLevel = 1000;
obj->MaxAnisotropy = 1.0;
- obj->CompareFlag = GL_FALSE;
- obj->CompareOperator = GL_TEXTURE_LEQUAL_R_SGIX;
- obj->ShadowAmbient = 0;
+ obj->CompareFlag = GL_FALSE; /* SGIX_shadow */
+ obj->CompareOperator = GL_TEXTURE_LEQUAL_R_SGIX; /* SGIX_shadow */
+ obj->CompareMode = GL_LUMINANCE; /* ARB_shadow */
+ obj->CompareFunc = GL_LEQUAL; /* ARB_shadow */
+ obj->DepthMode = GL_LUMINANCE; /* ARB_depth_texture */
+ obj->ShadowAmbient = 0.0F; /* ARB/SGIX_shadow_ambient */
_mesa_init_colortable(&obj->Palette);
/* insert into linked list */
@@ -166,12 +163,14 @@ void _mesa_free_texture_object( struct gl_shared_state *shared,
}
}
+ /* destroy the mutex -- it may have allocated memory (eg on bsd) */
+ _glthread_DESTROY_MUTEX(t->Mutex);
+
/* free this object */
FREE( t );
}
-
/*
* Copy texture object state from one texture object to another.
*/
@@ -198,14 +197,17 @@ _mesa_copy_texture_object( struct gl_texture_object *dest,
dest->CompareFlag = src->CompareFlag;
dest->CompareOperator = src->CompareOperator;
dest->ShadowAmbient = src->ShadowAmbient;
+ dest->CompareMode = src->CompareMode;
+ dest->CompareFunc = src->CompareFunc;
+ dest->DepthMode = src->DepthMode;
dest->_MaxLevel = src->_MaxLevel;
dest->_MaxLambda = src->_MaxLambda;
+ dest->GenerateMipmap = src->GenerateMipmap;
dest->Palette = src->Palette;
dest->Complete = src->Complete;
}
-
/*
* Report why a texture object is incomplete. (for debug only)
*/
@@ -213,7 +215,7 @@ _mesa_copy_texture_object( struct gl_texture_object *dest,
static void
incomplete(const struct gl_texture_object *t, const char *why)
{
- printf("Texture Obj %d incomplete because: %s\n", t->Name, why);
+ _mesa_printf("Texture Obj %d incomplete because: %s\n", t->Name, why);
}
#else
#define incomplete(a, b)
@@ -413,6 +415,11 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
t->Complete = GL_FALSE;
return;
}
+ if (t->Image[i]->Format == GL_DEPTH_COMPONENT) {
+ t->Complete = GL_FALSE;
+ incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex");
+ return;
+ }
if (t->Image[i]->Width2 != width) {
t->Complete = GL_FALSE;
incomplete(t, "3D Image[i] bad width");
@@ -446,6 +453,12 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
height /= 2;
}
if (i >= minLevel && i <= maxLevel) {
+ /* Don't support GL_DEPTH_COMPONENT for cube maps */
+ if (t->Image[i]->Format == GL_DEPTH_COMPONENT) {
+ t->Complete = GL_FALSE;
+ incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex");
+ return;
+ }
/* check that we have images defined */
if (!t->Image[i] || !t->NegX[i] ||
!t->PosY[i] || !t->NegY[i] ||
@@ -475,7 +488,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
}
else {
- /* Dimensions = ??? */
+ /* Target = ??? */
_mesa_problem(ctx, "Bug in gl_test_texture_object_completeness\n");
}
}
@@ -519,8 +532,8 @@ _mesa_GenTextures( GLsizei n, GLuint *texName )
/* Allocate new, empty texture objects */
for (i=0;i<n;i++) {
GLuint name = first + i;
- GLuint dims = 0;
- (void) _mesa_alloc_texture_object( ctx->Shared, name, dims);
+ GLenum target = 0;
+ (void) _mesa_alloc_texture_object( ctx->Shared, name, target);
}
_glthread_UNLOCK_MUTEX(GenTexturesLock);
@@ -555,27 +568,38 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *texName)
if (delObj == unit->Current1D) {
unit->Current1D = ctx->Shared->Default1D;
ctx->Shared->Default1D->RefCount++;
+ delObj->RefCount--;
if (delObj == unit->_Current)
unit->_Current = unit->Current1D;
}
else if (delObj == unit->Current2D) {
unit->Current2D = ctx->Shared->Default2D;
ctx->Shared->Default2D->RefCount++;
+ delObj->RefCount--;
if (delObj == unit->_Current)
unit->_Current = unit->Current2D;
}
else if (delObj == unit->Current3D) {
unit->Current3D = ctx->Shared->Default3D;
ctx->Shared->Default3D->RefCount++;
+ delObj->RefCount--;
if (delObj == unit->_Current)
unit->_Current = unit->Current3D;
}
else if (delObj == unit->CurrentCubeMap) {
unit->CurrentCubeMap = ctx->Shared->DefaultCubeMap;
ctx->Shared->DefaultCubeMap->RefCount++;
+ delObj->RefCount--;
if (delObj == unit->_Current)
unit->_Current = unit->CurrentCubeMap;
}
+ else if (delObj == unit->CurrentRect) {
+ unit->CurrentRect = ctx->Shared->DefaultRect;
+ ctx->Shared->DefaultRect->RefCount++;
+ delObj->RefCount--;
+ if (delObj == unit->_Current)
+ unit->_Current = unit->CurrentRect;
+ }
}
ctx->NewState |= _NEW_TEXTURE;
@@ -610,8 +634,8 @@ _mesa_BindTexture( GLenum target, GLuint texName )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
- fprintf(stderr, "glBindTexture %s %d\n",
- _mesa_lookup_enum_by_nr(target), (GLint) texName);
+ _mesa_debug(ctx, "glBindTexture %s %d\n",
+ _mesa_lookup_enum_by_nr(target), (GLint) texName);
switch (target) {
case GL_TEXTURE_1D:
@@ -726,6 +750,7 @@ _mesa_BindTexture( GLenum target, GLuint texName )
break;
default:
_mesa_problem(ctx, "bad target in BindTexture");
+ return;
}
/* Pass BindTexture call to device driver */
diff --git a/xc/extras/Mesa/src/texobj.h b/xc/extras/Mesa/src/texobj.h
index c04f732eb..d0a0e8381 100644
--- a/xc/extras/Mesa/src/texobj.h
+++ b/xc/extras/Mesa/src/texobj.h
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.4
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
diff --git a/xc/extras/Mesa/src/texstate.c b/xc/extras/Mesa/src/texstate.c
index eae7db349..af71ec985 100644
--- a/xc/extras/Mesa/src/texstate.c
+++ b/xc/extras/Mesa/src/texstate.c
@@ -1,9 +1,8 @@
-
/*
* Mesa 3-D graphics library
- * Version: 4.0.4
+ * Version: 5.1
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,9 +23,6 @@
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colormac.h"
#include "context.h"
@@ -39,7 +35,6 @@
#include "mtypes.h"
#include "math/m_xform.h"
#include "math/m_matrix.h"
-#endif
@@ -119,6 +114,35 @@ _mesa_copy_texture_state( const GLcontext *src, GLcontext *dst )
}
+/*
+ * For debugging
+ */
+void
+_mesa_print_texunit_state( GLcontext *ctx, GLuint unit )
+{
+ const struct gl_texture_unit *texUnit = ctx->Texture.Unit + unit;
+ _mesa_printf("Texture Unit %d\n", unit);
+ _mesa_printf(" GL_TEXTURE_ENV_MODE = %s\n", _mesa_lookup_enum_by_nr(texUnit->EnvMode));
+ _mesa_printf(" GL_COMBINE_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->CombineModeRGB));
+ _mesa_printf(" GL_COMBINE_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->CombineModeA));
+ _mesa_printf(" GL_SOURCE0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->CombineSourceRGB[0]));
+ _mesa_printf(" GL_SOURCE1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->CombineSourceRGB[1]));
+ _mesa_printf(" GL_SOURCE2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->CombineSourceRGB[2]));
+ _mesa_printf(" GL_SOURCE0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->CombineSourceA[0]));
+ _mesa_printf(" GL_SOURCE1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->CombineSourceA[1]));
+ _mesa_printf(" GL_SOURCE2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->CombineSourceA[2]));
+ _mesa_printf(" GL_OPERAND0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->CombineOperandRGB[0]));
+ _mesa_printf(" GL_OPERAND1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->CombineOperandRGB[1]));
+ _mesa_printf(" GL_OPERAND2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->CombineOperandRGB[2]));
+ _mesa_printf(" GL_OPERAND0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->CombineOperandA[0]));
+ _mesa_printf(" GL_OPERAND1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->CombineOperandA[1]));
+ _mesa_printf(" GL_OPERAND2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->CombineOperandA[2]));
+ _mesa_printf(" GL_RGB_SCALE = %d\n", 1 << texUnit->CombineScaleShiftRGB);
+ _mesa_printf(" GL_ALPHA_SCALE = %d\n", 1 << texUnit->CombineScaleShiftA);
+ _mesa_printf(" GL_TEXTURE_ENV_COLOR = (%f, %f, %f, %f)\n", texUnit->EnvColor[0], texUnit->EnvColor[1], texUnit->EnvColor[2], texUnit->EnvColor[3]);
+}
+
+
/**********************************************************************/
/* Texture Environment */
@@ -133,60 +157,47 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
ASSERT_OUTSIDE_BEGIN_END(ctx);
#define TE_ERROR(errCode, msg, value) \
- { \
- char s[100]; \
- sprintf(s, msg, _mesa_lookup_enum_by_nr(value)); \
- _mesa_error(ctx, errCode, s); \
- }
+ _mesa_error(ctx, errCode, msg, _mesa_lookup_enum_by_nr(value));
- if (target==GL_TEXTURE_ENV) {
+ if (target == GL_TEXTURE_ENV) {
switch (pname) {
- case GL_TEXTURE_ENV_MODE: {
- GLenum mode = (GLenum) (GLint) *param;
-
- switch (mode) {
- case GL_ADD:
- if (!ctx->Extensions.EXT_texture_env_add) {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
- return;
- }
- break;
- case GL_COMBINE_EXT:
- if (!ctx->Extensions.EXT_texture_env_combine &&
- !ctx->Extensions.ARB_texture_env_combine) {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
- return;
- }
- break;
- case GL_MODULATE:
- case GL_BLEND:
- case GL_DECAL:
- case GL_REPLACE:
- break;
- default:
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
- return;
- }
-
- if (texUnit->EnvMode == mode)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->EnvMode = mode;
- break;
- }
- case GL_TEXTURE_ENV_COLOR: {
- GLfloat tmp[4];
- tmp[0] = CLAMP( param[0], 0.0F, 1.0F );
- tmp[1] = CLAMP( param[1], 0.0F, 1.0F );
- tmp[2] = CLAMP( param[2], 0.0F, 1.0F );
- tmp[3] = CLAMP( param[3], 0.0F, 1.0F );
- if (TEST_EQ_4V(tmp, texUnit->EnvColor))
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- COPY_4FV(texUnit->EnvColor, tmp);
- break;
- }
- case GL_COMBINE_RGB_EXT:
+ case GL_TEXTURE_ENV_MODE:
+ {
+ const GLenum mode = (GLenum) (GLint) *param;
+ if (mode == GL_MODULATE ||
+ mode == GL_BLEND ||
+ mode == GL_DECAL ||
+ mode == GL_REPLACE ||
+ (mode == GL_ADD && ctx->Extensions.EXT_texture_env_add) ||
+ (mode == GL_COMBINE &&
+ (ctx->Extensions.EXT_texture_env_combine ||
+ ctx->Extensions.ARB_texture_env_combine))) {
+ /* legal */
+ if (texUnit->EnvMode == mode)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->EnvMode = mode;
+ }
+ else {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
+ return;
+ }
+ }
+ break;
+ case GL_TEXTURE_ENV_COLOR:
+ {
+ GLfloat tmp[4];
+ tmp[0] = CLAMP( param[0], 0.0F, 1.0F );
+ tmp[1] = CLAMP( param[1], 0.0F, 1.0F );
+ tmp[2] = CLAMP( param[2], 0.0F, 1.0F );
+ tmp[3] = CLAMP( param[3], 0.0F, 1.0F );
+ if (TEST_EQ_4V(tmp, texUnit->EnvColor))
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ COPY_4FV(texUnit->EnvColor, tmp);
+ }
+ break;
+ case GL_COMBINE_RGB:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
const GLenum mode = (GLenum) (GLint) *param;
@@ -194,11 +205,11 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
case GL_REPLACE:
case GL_MODULATE:
case GL_ADD:
- case GL_ADD_SIGNED_EXT:
- case GL_INTERPOLATE_EXT:
+ case GL_ADD_SIGNED:
+ case GL_INTERPOLATE:
/* OK */
break;
- case GL_SUBTRACT_ARB:
+ case GL_SUBTRACT:
if (!ctx->Extensions.ARB_texture_env_combine) {
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
return;
@@ -211,9 +222,17 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
return;
}
break;
- case GL_DOT3_RGB_ARB:
- case GL_DOT3_RGBA_ARB:
- if (!ctx->Extensions.ARB_texture_env_dot3) {
+ case GL_DOT3_RGB:
+ case GL_DOT3_RGBA:
+ if (!ctx->Extensions.ARB_texture_env_dot3) {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
+ return;
+ }
+ break;
+ case GL_MODULATE_ADD_ATI:
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ case GL_MODULATE_SUBTRACT_ATI:
+ if (!ctx->Extensions.ATI_texture_env_combine3) {
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
return;
}
@@ -232,56 +251,70 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
return;
}
break;
- case GL_COMBINE_ALPHA_EXT:
+ case GL_COMBINE_ALPHA:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
const GLenum mode = (GLenum) (GLint) *param;
- switch (mode) {
+ switch (mode) {
case GL_REPLACE:
case GL_MODULATE:
case GL_ADD:
- case GL_ADD_SIGNED_EXT:
- case GL_INTERPOLATE_EXT:
- /* OK */
+ case GL_ADD_SIGNED:
+ case GL_INTERPOLATE:
+ /* OK */
break;
- case GL_SUBTRACT_ARB:
- if (!ctx->Extensions.ARB_texture_env_combine) {
+ case GL_SUBTRACT:
+ if (!ctx->Extensions.ARB_texture_env_combine) {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
+ return;
+ }
+ break;
+ case GL_MODULATE_ADD_ATI:
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ case GL_MODULATE_SUBTRACT_ATI:
+ if (!ctx->Extensions.ATI_texture_env_combine3) {
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
- return;
- }
- break;
+ return;
+ }
+ break;
default:
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
return;
}
- if (texUnit->CombineModeA == mode)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->CombineModeA = mode;
+
+ if (texUnit->CombineModeA == mode)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->CombineModeA = mode;
}
else {
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
return;
}
break;
- case GL_SOURCE0_RGB_EXT:
- case GL_SOURCE1_RGB_EXT:
- case GL_SOURCE2_RGB_EXT:
+ case GL_SOURCE0_RGB:
+ case GL_SOURCE1_RGB:
+ case GL_SOURCE2_RGB:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
- GLenum source = (GLenum) (GLint) *param;
- GLuint s = pname - GL_SOURCE0_RGB_EXT;
- switch (source) {
- case GL_TEXTURE:
- case GL_CONSTANT_EXT:
- case GL_PRIMARY_COLOR_EXT:
- case GL_PREVIOUS_EXT:
- if (texUnit->CombineSourceRGB[s] == source)
- return;
+ const GLenum source = (GLenum) (GLint) *param;
+ const GLuint s = pname - GL_SOURCE0_RGB;
+ if (source == GL_TEXTURE ||
+ source == GL_CONSTANT ||
+ source == GL_PRIMARY_COLOR ||
+ source == GL_PREVIOUS ||
+ (ctx->Extensions.ARB_texture_env_crossbar &&
+ source >= GL_TEXTURE0 &&
+ source < GL_TEXTURE0 + ctx->Const.MaxTextureUnits) ||
+ (ctx->Extensions.ATI_texture_env_combine3 &&
+ (source == GL_ZERO || source == GL_ONE))) {
+ /* legal */
+ if (texUnit->CombineSourceRGB[s] == source)
+ return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texUnit->CombineSourceRGB[s] = source;
- break;
- default:
+ }
+ else {
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", source);
return;
}
@@ -291,23 +324,29 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
return;
}
break;
- case GL_SOURCE0_ALPHA_EXT:
- case GL_SOURCE1_ALPHA_EXT:
- case GL_SOURCE2_ALPHA_EXT:
+ case GL_SOURCE0_ALPHA:
+ case GL_SOURCE1_ALPHA:
+ case GL_SOURCE2_ALPHA:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
- GLenum source = (GLenum) (GLint) *param;
- GLuint s = pname - GL_SOURCE0_ALPHA_EXT;
- switch (source) {
- case GL_TEXTURE:
- case GL_CONSTANT_EXT:
- case GL_PRIMARY_COLOR_EXT:
- case GL_PREVIOUS_EXT:
- if (texUnit->CombineSourceA[s] == source) return;
+ const GLenum source = (GLenum) (GLint) *param;
+ const GLuint s = pname - GL_SOURCE0_ALPHA;
+ if (source == GL_TEXTURE ||
+ source == GL_CONSTANT ||
+ source == GL_PRIMARY_COLOR ||
+ source == GL_PREVIOUS ||
+ (ctx->Extensions.ARB_texture_env_crossbar &&
+ source >= GL_TEXTURE0 &&
+ source < GL_TEXTURE0 + ctx->Const.MaxTextureUnits) ||
+ (ctx->Extensions.ATI_texture_env_combine3 &&
+ (source == GL_ZERO || source == GL_ONE))) {
+ /* legal */
+ if (texUnit->CombineSourceA[s] == source)
+ return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texUnit->CombineSourceA[s] = source;
- break;
- default:
+ }
+ else {
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", source);
return;
}
@@ -317,12 +356,13 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
return;
}
break;
- case GL_OPERAND0_RGB_EXT:
- case GL_OPERAND1_RGB_EXT:
+ case GL_OPERAND0_RGB:
+ case GL_OPERAND1_RGB:
+ case GL_OPERAND2_RGB:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
- GLenum operand = (GLenum) (GLint) *param;
- GLuint s = pname - GL_OPERAND0_RGB_EXT;
+ const GLenum operand = (GLenum) (GLint) *param;
+ const GLuint s = pname - GL_OPERAND0_RGB;
switch (operand) {
case GL_SRC_COLOR:
case GL_ONE_MINUS_SRC_COLOR:
@@ -343,64 +383,20 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
return;
}
break;
- case GL_OPERAND0_ALPHA_EXT:
- case GL_OPERAND1_ALPHA_EXT:
+ case GL_OPERAND0_ALPHA:
+ case GL_OPERAND1_ALPHA:
+ case GL_OPERAND2_ALPHA:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
- GLenum operand = (GLenum) (GLint) *param;
+ const GLenum operand = (GLenum) (GLint) *param;
switch (operand) {
case GL_SRC_ALPHA:
case GL_ONE_MINUS_SRC_ALPHA:
- if (texUnit->CombineOperandA[pname-GL_OPERAND0_ALPHA_EXT] ==
+ if (texUnit->CombineOperandA[pname-GL_OPERAND0_ALPHA] ==
operand)
return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->CombineOperandA[pname-GL_OPERAND0_ALPHA_EXT] = operand;
- break;
- default:
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand);
- return;
- }
- }
- else {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
- return;
- }
- break;
- case GL_OPERAND2_RGB_EXT:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- GLenum operand = (GLenum) (GLint) *param;
- switch (operand) {
- case GL_SRC_COLOR: /* ARB combine only */
- case GL_ONE_MINUS_SRC_COLOR: /* ARB combine only */
- case GL_SRC_ALPHA:
- case GL_ONE_MINUS_SRC_ALPHA: /* ARB combine only */
- if (texUnit->CombineOperandRGB[2] == operand)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->CombineOperandRGB[2] = operand;
- default:
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand);
- return;
- }
- }
- else {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
- return;
- }
- break;
- case GL_OPERAND2_ALPHA_EXT:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- GLenum operand = (GLenum) (GLint) *param;
- switch (operand) {
- case GL_SRC_ALPHA:
- case GL_ONE_MINUS_SRC_ALPHA: /* ARB combine only */
- if (texUnit->CombineOperandA[2] == operand)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->CombineOperandA[2] = operand;
+ texUnit->CombineOperandA[pname-GL_OPERAND0_ALPHA] = operand;
break;
default:
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand);
@@ -412,7 +408,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
return;
}
break;
- case GL_RGB_SCALE_EXT:
+ case GL_RGB_SCALE:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
GLuint newshift;
@@ -473,35 +469,63 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
return;
}
}
- else if (target==GL_TEXTURE_FILTER_CONTROL_EXT) {
+ else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) {
+ /* GL_EXT_texture_lod_bias */
if (!ctx->Extensions.EXT_texture_lod_bias) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(param)" );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)", target );
return;
}
- switch (pname) {
- case GL_TEXTURE_LOD_BIAS_EXT:
+ if (pname == GL_TEXTURE_LOD_BIAS_EXT) {
if (texUnit->LodBias == param[0])
return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texUnit->LodBias = CLAMP(param[0], -ctx->Const.MaxTextureLodBias,
ctx->Const.MaxTextureLodBias);
- break;
- default:
+ }
+ else {
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
return;
}
}
+ else if (target == GL_POINT_SPRITE_NV) {
+ /* GL_NV_point_sprite */
+ if (!ctx->Extensions.NV_point_sprite) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)", target );
+ return;
+ }
+ if (pname == GL_COORD_REPLACE_NV) {
+ const GLenum value = (GLenum) param[0];
+ if (value == GL_TRUE || value == GL_FALSE) {
+ /* It's kind of weird to set point state via glTexEnv,
+ * but that's what the spec calls for.
+ */
+ const GLboolean state = (GLboolean) value;
+ if (ctx->Point.CoordReplace[ctx->Texture.CurrentUnit] == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POINT);
+ ctx->Point.CoordReplace[ctx->Texture.CurrentUnit] = state;
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glTexEnv(param=0x%x)", value);
+ return;
+ }
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname=0x%x)", pname );
+ return;
+ }
+ }
else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target)" );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)",target );
return;
}
if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
- fprintf(stderr, "glTexEnv %s %s %.1f(%s) ...\n",
- _mesa_lookup_enum_by_nr(target),
- _mesa_lookup_enum_by_nr(pname),
- *param,
- _mesa_lookup_enum_by_nr((GLenum) (GLint) *param));
+ _mesa_debug(ctx, "glTexEnv %s %s %.1f(%s) ...\n",
+ _mesa_lookup_enum_by_nr(target),
+ _mesa_lookup_enum_by_nr(pname),
+ *param,
+ _mesa_lookup_enum_by_nr((GLenum) (GLint) *param));
/* Tell device driver about the new texture environment */
if (ctx->Driver.TexEnv) {
@@ -561,7 +585,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
case GL_TEXTURE_ENV_COLOR:
COPY_4FV( params, texUnit->EnvColor );
break;
- case GL_COMBINE_RGB_EXT:
+ case GL_COMBINE_RGB:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLfloat) texUnit->CombineModeRGB;
@@ -570,7 +594,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
}
break;
- case GL_COMBINE_ALPHA_EXT:
+ case GL_COMBINE_ALPHA:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLfloat) texUnit->CombineModeA;
@@ -579,7 +603,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
}
break;
- case GL_SOURCE0_RGB_EXT:
+ case GL_SOURCE0_RGB:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLfloat) texUnit->CombineSourceRGB[0];
@@ -588,7 +612,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
}
break;
- case GL_SOURCE1_RGB_EXT:
+ case GL_SOURCE1_RGB:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLfloat) texUnit->CombineSourceRGB[1];
@@ -597,7 +621,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
}
break;
- case GL_SOURCE2_RGB_EXT:
+ case GL_SOURCE2_RGB:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLfloat) texUnit->CombineSourceRGB[2];
@@ -606,7 +630,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
}
break;
- case GL_SOURCE0_ALPHA_EXT:
+ case GL_SOURCE0_ALPHA:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLfloat) texUnit->CombineSourceA[0];
@@ -615,7 +639,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
}
break;
- case GL_SOURCE1_ALPHA_EXT:
+ case GL_SOURCE1_ALPHA:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLfloat) texUnit->CombineSourceA[1];
@@ -624,7 +648,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
}
break;
- case GL_SOURCE2_ALPHA_EXT:
+ case GL_SOURCE2_ALPHA:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLfloat) texUnit->CombineSourceA[2];
@@ -633,7 +657,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
}
break;
- case GL_OPERAND0_RGB_EXT:
+ case GL_OPERAND0_RGB:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLfloat) texUnit->CombineOperandRGB[0];
@@ -642,7 +666,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
}
break;
- case GL_OPERAND1_RGB_EXT:
+ case GL_OPERAND1_RGB:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLfloat) texUnit->CombineOperandRGB[1];
@@ -651,7 +675,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
}
break;
- case GL_OPERAND2_RGB_EXT:
+ case GL_OPERAND2_RGB:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLfloat) texUnit->CombineOperandRGB[2];
@@ -660,7 +684,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
}
break;
- case GL_OPERAND0_ALPHA_EXT:
+ case GL_OPERAND0_ALPHA:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLfloat) texUnit->CombineOperandA[0];
@@ -669,7 +693,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
}
break;
- case GL_OPERAND1_ALPHA_EXT:
+ case GL_OPERAND1_ALPHA:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLfloat) texUnit->CombineOperandA[1];
@@ -678,7 +702,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
}
break;
- case GL_OPERAND2_ALPHA_EXT:
+ case GL_OPERAND2_ALPHA:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLfloat) texUnit->CombineOperandA[2];
@@ -687,7 +711,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
}
break;
- case GL_RGB_SCALE_EXT:
+ case GL_RGB_SCALE:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
if (texUnit->CombineScaleShiftRGB == 0)
@@ -735,6 +759,20 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
return;
}
}
+ else if (target == GL_POINT_SPRITE_NV) {
+ /* GL_NV_point_sprite */
+ if (!ctx->Extensions.NV_point_sprite) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" );
+ return;
+ }
+ if (pname == GL_COORD_REPLACE_NV) {
+ *params = (GLfloat) ctx->Point.CoordReplace[ctx->Texture.CurrentUnit];
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)" );
+ return;
+ }
+ }
else {
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" );
return;
@@ -749,11 +787,6 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (target != GL_TEXTURE_ENV) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" );
- return;
- }
-
if (target == GL_TEXTURE_ENV) {
switch (pname) {
case GL_TEXTURE_ENV_MODE:
@@ -765,7 +798,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
params[2] = FLOAT_TO_INT( texUnit->EnvColor[2] );
params[3] = FLOAT_TO_INT( texUnit->EnvColor[3] );
break;
- case GL_COMBINE_RGB_EXT:
+ case GL_COMBINE_RGB:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLint) texUnit->CombineModeRGB;
@@ -774,7 +807,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
}
break;
- case GL_COMBINE_ALPHA_EXT:
+ case GL_COMBINE_ALPHA:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLint) texUnit->CombineModeA;
@@ -783,7 +816,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
}
break;
- case GL_SOURCE0_RGB_EXT:
+ case GL_SOURCE0_RGB:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLint) texUnit->CombineSourceRGB[0];
@@ -792,7 +825,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
}
break;
- case GL_SOURCE1_RGB_EXT:
+ case GL_SOURCE1_RGB:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLint) texUnit->CombineSourceRGB[1];
@@ -801,7 +834,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
}
break;
- case GL_SOURCE2_RGB_EXT:
+ case GL_SOURCE2_RGB:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLint) texUnit->CombineSourceRGB[2];
@@ -810,7 +843,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
}
break;
- case GL_SOURCE0_ALPHA_EXT:
+ case GL_SOURCE0_ALPHA:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLint) texUnit->CombineSourceA[0];
@@ -819,7 +852,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
}
break;
- case GL_SOURCE1_ALPHA_EXT:
+ case GL_SOURCE1_ALPHA:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLint) texUnit->CombineSourceA[1];
@@ -828,7 +861,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
}
break;
- case GL_SOURCE2_ALPHA_EXT:
+ case GL_SOURCE2_ALPHA:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLint) texUnit->CombineSourceA[2];
@@ -837,7 +870,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
}
break;
- case GL_OPERAND0_RGB_EXT:
+ case GL_OPERAND0_RGB:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLint) texUnit->CombineOperandRGB[0];
@@ -846,7 +879,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
}
break;
- case GL_OPERAND1_RGB_EXT:
+ case GL_OPERAND1_RGB:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLint) texUnit->CombineOperandRGB[1];
@@ -855,7 +888,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
}
break;
- case GL_OPERAND2_RGB_EXT:
+ case GL_OPERAND2_RGB:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLint) texUnit->CombineOperandRGB[2];
@@ -864,7 +897,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
}
break;
- case GL_OPERAND0_ALPHA_EXT:
+ case GL_OPERAND0_ALPHA:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLint) texUnit->CombineOperandA[0];
@@ -873,7 +906,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
}
break;
- case GL_OPERAND1_ALPHA_EXT:
+ case GL_OPERAND1_ALPHA:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLint) texUnit->CombineOperandA[1];
@@ -882,7 +915,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
}
break;
- case GL_OPERAND2_ALPHA_EXT:
+ case GL_OPERAND2_ALPHA:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
*params = (GLint) texUnit->CombineOperandA[2];
@@ -891,7 +924,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
}
break;
- case GL_RGB_SCALE_EXT:
+ case GL_RGB_SCALE:
if (ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine) {
if (texUnit->CombineScaleShiftRGB == 0)
@@ -939,8 +972,22 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
return;
}
}
+ else if (target == GL_POINT_SPRITE_NV) {
+ /* GL_NV_point_sprite */
+ if (!ctx->Extensions.NV_point_sprite) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" );
+ return;
+ }
+ if (pname == GL_COORD_REPLACE_NV) {
+ *params = (GLint) ctx->Point.CoordReplace[ctx->Texture.CurrentUnit];
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)" );
+ return;
+ }
+ }
else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" );
return;
}
}
@@ -970,10 +1017,10 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
- fprintf(stderr, "texPARAM %s %s %d...\n",
- _mesa_lookup_enum_by_nr(target),
- _mesa_lookup_enum_by_nr(pname),
- eparam);
+ _mesa_debug(ctx, "texPARAM %s %s %d...\n",
+ _mesa_lookup_enum_by_nr(target),
+ _mesa_lookup_enum_by_nr(pname),
+ eparam);
switch (target) {
@@ -983,10 +1030,10 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
case GL_TEXTURE_2D:
texObj = texUnit->Current2D;
break;
- case GL_TEXTURE_3D_EXT:
+ case GL_TEXTURE_3D:
texObj = texUnit->Current3D;
break;
- case GL_TEXTURE_CUBE_MAP_ARB:
+ case GL_TEXTURE_CUBE_MAP:
if (!ctx->Extensions.ARB_texture_cube_map) {
_mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" );
return;
@@ -1010,7 +1057,6 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
/* A small optimization */
if (texObj->MinFilter == eparam)
return;
-
if (eparam==GL_NEAREST || eparam==GL_LINEAR) {
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->MinFilter = eparam;
@@ -1046,7 +1092,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
if (texObj->WrapS == eparam)
return;
if (eparam == GL_CLAMP || eparam == GL_CLAMP_TO_EDGE ||
- (eparam == GL_CLAMP_TO_BORDER_ARB &&
+ (eparam == GL_CLAMP_TO_BORDER &&
ctx->Extensions.ARB_texture_border_clamp)) {
/* any texture target */
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
@@ -1054,8 +1100,12 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
}
else if (texObj->Target != GL_TEXTURE_RECTANGLE_NV &&
(eparam == GL_REPEAT ||
- (eparam == GL_MIRRORED_REPEAT_ARB &&
- ctx->Extensions.ARB_texture_mirrored_repeat))) {
+ (eparam == GL_MIRRORED_REPEAT &&
+ ctx->Extensions.ARB_texture_mirrored_repeat) ||
+ (eparam == GL_MIRROR_CLAMP_ATI &&
+ ctx->Extensions.ATI_texture_mirror_once) ||
+ (eparam == GL_MIRROR_CLAMP_TO_EDGE_ATI &&
+ ctx->Extensions.ATI_texture_mirror_once))) {
/* non-rectangle texture */
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->WrapS = eparam;
@@ -1069,7 +1119,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
if (texObj->WrapT == eparam)
return;
if (eparam == GL_CLAMP || eparam == GL_CLAMP_TO_EDGE ||
- (eparam == GL_CLAMP_TO_BORDER_ARB &&
+ (eparam == GL_CLAMP_TO_BORDER &&
ctx->Extensions.ARB_texture_border_clamp)) {
/* any texture target */
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
@@ -1077,8 +1127,12 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
}
else if (texObj->Target != GL_TEXTURE_RECTANGLE_NV &&
(eparam == GL_REPEAT ||
- (eparam == GL_MIRRORED_REPEAT_ARB &&
- ctx->Extensions.ARB_texture_mirrored_repeat))) {
+ (eparam == GL_MIRRORED_REPEAT &&
+ ctx->Extensions.ARB_texture_mirrored_repeat) ||
+ (eparam == GL_MIRROR_CLAMP_ATI &&
+ ctx->Extensions.ATI_texture_mirror_once) ||
+ (eparam == GL_MIRROR_CLAMP_TO_EDGE_ATI &&
+ ctx->Extensions.ATI_texture_mirror_once))) {
/* non-rectangle texture */
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->WrapT = eparam;
@@ -1088,11 +1142,11 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
return;
}
break;
- case GL_TEXTURE_WRAP_R_EXT:
+ case GL_TEXTURE_WRAP_R:
if (texObj->WrapR == eparam)
return;
if (eparam == GL_CLAMP || eparam == GL_CLAMP_TO_EDGE ||
- (eparam == GL_CLAMP_TO_BORDER_ARB &&
+ (eparam == GL_CLAMP_TO_BORDER &&
ctx->Extensions.ARB_texture_border_clamp)) {
/* any texture target */
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
@@ -1100,8 +1154,12 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
}
else if (texObj->Target != GL_TEXTURE_RECTANGLE_NV &&
(eparam == GL_REPEAT ||
- (eparam == GL_MIRRORED_REPEAT_ARB &&
- ctx->Extensions.ARB_texture_mirrored_repeat))) {
+ (eparam == GL_MIRRORED_REPEAT &&
+ ctx->Extensions.ARB_texture_mirrored_repeat) ||
+ (eparam == GL_MIRROR_CLAMP_ATI &&
+ ctx->Extensions.ATI_texture_mirror_once) ||
+ (eparam == GL_MIRROR_CLAMP_TO_EDGE_ATI &&
+ ctx->Extensions.ATI_texture_mirror_once))) {
/* non-rectangle texture */
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->WrapR = eparam;
@@ -1112,10 +1170,14 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
break;
case GL_TEXTURE_BORDER_COLOR:
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[0], params[0]);
- UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[1], params[1]);
- UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[2], params[2]);
- UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[3], params[3]);
+ texObj->BorderColor[RCOMP] = params[0];
+ texObj->BorderColor[GCOMP] = params[1];
+ texObj->BorderColor[BCOMP] = params[2];
+ texObj->BorderColor[ACOMP] = params[3];
+ UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[RCOMP], params[0]);
+ UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[GCOMP], params[1]);
+ UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[BCOMP], params[2]);
+ UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[ACOMP], params[3]);
break;
case GL_TEXTURE_MIN_LOD:
if (texObj->MinLod == params[0])
@@ -1150,7 +1212,6 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
texObj->MaxLevel = (GLint) params[0];
break;
case GL_TEXTURE_PRIORITY:
- /* (keithh@netcomuk.co.uk) */
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->Priority = CLAMP( params[0], 0.0F, 1.0F );
break;
@@ -1165,7 +1226,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
}
else {
_mesa_error(ctx, GL_INVALID_ENUM,
- "glTexParameter(pname=GL_MAX_TEXTURE_ANISOTROPY_EXT)");
+ "glTexParameter(pname=GL_TEXTURE_MAX_ANISOTROPY_EXT)");
return;
}
break;
@@ -1198,10 +1259,10 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
return;
}
break;
- case GL_SHADOW_AMBIENT_SGIX:
+ case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
if (ctx->Extensions.SGIX_shadow_ambient) {
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- UNCLAMPED_FLOAT_TO_CHAN(texObj->ShadowAmbient, params[0]);
+ texObj->ShadowAmbient = CLAMP(params[0], 0.0F, 1.0F);
}
else {
_mesa_error(ctx, GL_INVALID_ENUM,
@@ -1211,7 +1272,6 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
break;
case GL_GENERATE_MIPMAP_SGIS:
if (ctx->Extensions.SGIS_generate_mipmap) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE;
}
else {
@@ -1220,12 +1280,78 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
return;
}
break;
- default:
- {
- char s[100];
- sprintf(s, "glTexParameter(pname=0x%x)", pname);
- _mesa_error( ctx, GL_INVALID_ENUM, s);
+ case GL_TEXTURE_COMPARE_MODE_ARB:
+ if (ctx->Extensions.ARB_shadow) {
+ const GLenum mode = (GLenum) params[0];
+ if (mode == GL_NONE || mode == GL_COMPARE_R_TO_TEXTURE_ARB) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texObj->CompareMode = mode;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexParameter(bad GL_TEXTURE_COMPARE_MODE_ARB: 0x%x)", mode);
+ return;
+ }
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexParameter(pname=GL_TEXTURE_COMPARE_MODE_ARB)");
+ return;
}
+ break;
+ case GL_TEXTURE_COMPARE_FUNC_ARB:
+ if (ctx->Extensions.ARB_shadow) {
+ const GLenum func = (GLenum) params[0];
+ if (func == GL_LEQUAL || func == GL_GEQUAL) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texObj->CompareFunc = func;
+ }
+ else if (ctx->Extensions.EXT_shadow_funcs &&
+ (func == GL_EQUAL ||
+ func == GL_NOTEQUAL ||
+ func == GL_LESS ||
+ func == GL_GREATER ||
+ func == GL_ALWAYS ||
+ func == GL_NEVER)) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texObj->CompareFunc = func;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexParameter(bad GL_TEXTURE_COMPARE_FUNC_ARB)");
+ return;
+ }
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexParameter(pname=GL_TEXTURE_COMPARE_FUNC_ARB)");
+ return;
+ }
+ break;
+ case GL_DEPTH_TEXTURE_MODE_ARB:
+ if (ctx->Extensions.ARB_depth_texture) {
+ const GLenum result = (GLenum) params[0];
+ if (result == GL_LUMINANCE || result == GL_INTENSITY
+ || result == GL_ALPHA) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texObj->DepthMode = result;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexParameter(bad GL_DEPTH_TEXTURE_MODE_ARB)");
+ return;
+ }
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexParameter(pname=GL_DEPTH_TEXTURE_MODE_ARB)");
+ return;
+ }
+ break;
+
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexParameter(pname=0x%x)", pname);
return;
}
@@ -1246,12 +1372,21 @@ _mesa_TexParameteri( GLenum target, GLenum pname, GLint param )
_mesa_TexParameterfv(target, pname, fparam);
}
+
void
_mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params )
{
GLfloat fparam[4];
- fparam[0] = (GLfloat) params[0];
- fparam[1] = fparam[2] = fparam[3] = 0.0;
+ if (pname == GL_TEXTURE_BORDER_COLOR) {
+ fparam[0] = INT_TO_FLOAT(params[0]);
+ fparam[1] = INT_TO_FLOAT(params[1]);
+ fparam[2] = INT_TO_FLOAT(params[2]);
+ fparam[3] = INT_TO_FLOAT(params[3]);
+ }
+ else {
+ fparam[0] = (GLfloat) params[0];
+ fparam[1] = fparam[2] = fparam[3] = 0.0F;
+ }
_mesa_TexParameterfv(target, pname, fparam);
}
@@ -1279,14 +1414,14 @@ tex_image_dimensions(GLcontext *ctx, GLenum target)
case GL_TEXTURE_3D:
case GL_PROXY_TEXTURE_3D:
return 3;
- case GL_TEXTURE_CUBE_MAP_ARB:
- case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
+ case GL_TEXTURE_CUBE_MAP:
+ case GL_PROXY_TEXTURE_CUBE_MAP:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
return ctx->Extensions.ARB_texture_cube_map ? 2 : 0;
case GL_TEXTURE_RECTANGLE_NV:
case GL_PROXY_TEXTURE_RECTANGLE_NV:
@@ -1310,6 +1445,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
GLint maxLevels;
ASSERT_OUTSIDE_BEGIN_END(ctx);
+ /* this will catch bad target values */
dimensions = tex_image_dimensions(ctx, target); /* 1, 2 or 3 */
if (dimensions == 0) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(target)");
@@ -1327,13 +1463,13 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
case GL_PROXY_TEXTURE_3D:
maxLevels = ctx->Const.Max3DTextureLevels;
break;
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
- case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+ case GL_PROXY_TEXTURE_CUBE_MAP:
maxLevels = ctx->Const.MaxCubeTextureLevels;
break;
case GL_TEXTURE_RECTANGLE_NV:
@@ -1341,8 +1477,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
maxLevels = 1;
break;
default:
- maxLevels = ctx->Const.MaxCubeTextureLevels;
- break;
+ _mesa_problem(ctx, "switch in _mesa_GetTexLevelParameter");
+ return;
}
if (level < 0 || level >= maxLevels) {
@@ -1363,7 +1499,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
isProxy = (target == GL_PROXY_TEXTURE_1D) ||
(target == GL_PROXY_TEXTURE_2D) ||
(target == GL_PROXY_TEXTURE_3D) ||
- (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB) ||
+ (target == GL_PROXY_TEXTURE_CUBE_MAP) ||
(target == GL_PROXY_TEXTURE_RECTANGLE_NV);
switch (pname) {
@@ -1437,33 +1573,37 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
if (ctx->Extensions.SGIX_depth_texture)
*params = img->TexFormat->DepthBits;
else
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)");
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetTexLevelParameter[if]v(pname)");
return;
/* GL_ARB_texture_compression */
- case GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB:
+ case GL_TEXTURE_COMPRESSED_IMAGE_SIZE:
if (ctx->Extensions.ARB_texture_compression) {
if (img->IsCompressed && !isProxy)
*params = img->CompressedSize;
else
_mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetTexLevelParameter[if]v(pname)");
+ "glGetTexLevelParameter[if]v(pname)");
}
else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)");
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetTexLevelParameter[if]v(pname)");
}
return;
- case GL_TEXTURE_COMPRESSED_ARB:
+ case GL_TEXTURE_COMPRESSED:
if (ctx->Extensions.ARB_texture_compression) {
*params = (GLint) img->IsCompressed;
}
else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)");
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetTexLevelParameter[if]v(pname)");
}
return;
default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)");
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetTexLevelParameter[if]v(pname)");
}
}
@@ -1496,14 +1636,14 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
case GL_TEXTURE_WRAP_T:
*params = ENUM_TO_FLOAT(obj->WrapT);
return;
- case GL_TEXTURE_WRAP_R_EXT:
+ case GL_TEXTURE_WRAP_R:
*params = ENUM_TO_FLOAT(obj->WrapR);
return;
case GL_TEXTURE_BORDER_COLOR:
- params[0] = obj->BorderColor[0] / CHAN_MAXF;
- params[1] = obj->BorderColor[1] / CHAN_MAXF;
- params[2] = obj->BorderColor[2] / CHAN_MAXF;
- params[3] = obj->BorderColor[3] / CHAN_MAXF;
+ 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;
case GL_TEXTURE_RESIDENT:
{
@@ -1548,9 +1688,9 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
return;
}
break;
- case GL_SHADOW_AMBIENT_SGIX:
+ case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
if (ctx->Extensions.SGIX_shadow_ambient) {
- *params = CHAN_TO_FLOAT(obj->ShadowAmbient);
+ *params = obj->ShadowAmbient;
return;
}
break;
@@ -1560,6 +1700,24 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
return;
}
break;
+ case GL_TEXTURE_COMPARE_MODE_ARB:
+ if (ctx->Extensions.ARB_shadow) {
+ *params = (GLfloat) obj->CompareMode;
+ return;
+ }
+ break;
+ case GL_TEXTURE_COMPARE_FUNC_ARB:
+ if (ctx->Extensions.ARB_shadow) {
+ *params = (GLfloat) obj->CompareFunc;
+ return;
+ }
+ break;
+ case GL_DEPTH_TEXTURE_MODE_ARB:
+ if (ctx->Extensions.ARB_depth_texture) {
+ *params = (GLfloat) obj->DepthMode;
+ return;
+ }
+ break;
default:
; /* silence warnings */
}
@@ -1595,20 +1753,20 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
case GL_TEXTURE_WRAP_T:
*params = (GLint) obj->WrapT;
return;
- case GL_TEXTURE_WRAP_R_EXT:
+ case GL_TEXTURE_WRAP_R:
*params = (GLint) obj->WrapR;
return;
case GL_TEXTURE_BORDER_COLOR:
{
- GLfloat color[4];
- color[0] = obj->BorderColor[0] / CHAN_MAXF;
- color[1] = obj->BorderColor[1] / CHAN_MAXF;
- color[2] = obj->BorderColor[2] / CHAN_MAXF;
- color[3] = obj->BorderColor[3] / CHAN_MAXF;
- params[0] = FLOAT_TO_INT( color[0] );
- params[1] = FLOAT_TO_INT( color[1] );
- params[2] = FLOAT_TO_INT( color[2] );
- params[3] = FLOAT_TO_INT( color[3] );
+ GLfloat b[4];
+ b[0] = CLAMP(obj->BorderColor[0], 0.0F, 1.0F);
+ b[1] = CLAMP(obj->BorderColor[1], 0.0F, 1.0F);
+ b[2] = CLAMP(obj->BorderColor[2], 0.0F, 1.0F);
+ b[3] = CLAMP(obj->BorderColor[3], 0.0F, 1.0F);
+ params[0] = FLOAT_TO_INT(b[0]);
+ params[1] = FLOAT_TO_INT(b[1]);
+ params[2] = FLOAT_TO_INT(b[2]);
+ params[3] = FLOAT_TO_INT(b[3]);
}
return;
case GL_TEXTURE_RESIDENT:
@@ -1654,10 +1812,9 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
return;
}
break;
- case GL_SHADOW_AMBIENT_SGIX:
+ case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
if (ctx->Extensions.SGIX_shadow_ambient) {
- /* XXX range? */
- *params = (GLint) CHAN_TO_FLOAT(obj->ShadowAmbient);
+ *params = (GLint) FLOAT_TO_INT(obj->ShadowAmbient);
return;
}
break;
@@ -1667,6 +1824,24 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
return;
}
break;
+ case GL_TEXTURE_COMPARE_MODE_ARB:
+ if (ctx->Extensions.ARB_shadow) {
+ *params = (GLint) obj->CompareMode;
+ return;
+ }
+ break;
+ case GL_TEXTURE_COMPARE_FUNC_ARB:
+ if (ctx->Extensions.ARB_shadow) {
+ *params = (GLint) obj->CompareFunc;
+ return;
+ }
+ break;
+ case GL_DEPTH_TEXTURE_MODE_ARB:
+ if (ctx->Extensions.ARB_depth_texture) {
+ *params = (GLint) obj->DepthMode;
+ return;
+ }
+ break;
default:
; /* silence warnings */
}
@@ -1691,10 +1866,10 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
- fprintf(stderr, "texGEN %s %s %x...\n",
- _mesa_lookup_enum_by_nr(coord),
- _mesa_lookup_enum_by_nr(pname),
- *(int *)params);
+ _mesa_debug(ctx, "texGEN %s %s %x...\n",
+ _mesa_lookup_enum_by_nr(coord),
+ _mesa_lookup_enum_by_nr(pname),
+ *(int *)params);
switch (coord) {
case GL_S:
@@ -1740,10 +1915,10 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
GLfloat tmp[4];
/* Transform plane equation by the inverse modelview matrix */
- if (ctx->ModelView.flags & MAT_DIRTY_INVERSE) {
- _math_matrix_analyse( &ctx->ModelView );
+ if (ctx->ModelviewMatrixStack.Top->flags & MAT_DIRTY_INVERSE) {
+ _math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
}
- _mesa_transform_vector( tmp, params, ctx->ModelView.inv );
+ _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv );
if (TEST_EQ_4V(texUnit->EyePlaneS, tmp))
return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
@@ -1796,10 +1971,10 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
else if (pname==GL_EYE_PLANE) {
GLfloat tmp[4];
/* Transform plane equation by the inverse modelview matrix */
- if (ctx->ModelView.flags & MAT_DIRTY_INVERSE) {
- _math_matrix_analyse( &ctx->ModelView );
+ if (ctx->ModelviewMatrixStack.Top->flags & MAT_DIRTY_INVERSE) {
+ _math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
}
- _mesa_transform_vector( tmp, params, ctx->ModelView.inv );
+ _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv );
if (TEST_EQ_4V(texUnit->EyePlaneT, tmp))
return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
@@ -1849,10 +2024,10 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
else if (pname==GL_EYE_PLANE) {
GLfloat tmp[4];
/* Transform plane equation by the inverse modelview matrix */
- if (ctx->ModelView.flags & MAT_DIRTY_INVERSE) {
- _math_matrix_analyse( &ctx->ModelView );
+ if (ctx->ModelviewMatrixStack.Top->flags & MAT_DIRTY_INVERSE) {
+ _math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
}
- _mesa_transform_vector( tmp, params, ctx->ModelView.inv );
+ _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv );
if (TEST_EQ_4V(texUnit->EyePlaneR, tmp))
return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
@@ -1896,10 +2071,10 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
else if (pname==GL_EYE_PLANE) {
GLfloat tmp[4];
/* Transform plane equation by the inverse modelview matrix */
- if (ctx->ModelView.flags & MAT_DIRTY_INVERSE) {
- _math_matrix_analyse( &ctx->ModelView );
+ if (ctx->ModelviewMatrixStack.Top->flags & MAT_DIRTY_INVERSE) {
+ _math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
}
- _mesa_transform_vector( tmp, params, ctx->ModelView.inv );
+ _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv );
if (TEST_EQ_4V(texUnit->EyePlaneQ, tmp))
return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
@@ -2226,20 +2401,27 @@ void
_mesa_ActiveTextureARB( GLenum target )
{
GET_CURRENT_CONTEXT(ctx);
- GLuint texUnit = target - GL_TEXTURE0_ARB;
+ GLuint texUnit = target - GL_TEXTURE0;
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
- fprintf(stderr, "glActiveTexture %s\n",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_debug(ctx, "glActiveTexture %s\n",
+ _mesa_lookup_enum_by_nr(target));
- if (texUnit > ctx->Const.MaxTextureUnits) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glActiveTextureARB(target)");
+ /* Cater for texture unit 0 is first, therefore use >= */
+ if (texUnit >= ctx->Const.MaxTextureUnits) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glActiveTexture(target)");
return;
}
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+
ctx->Texture.CurrentUnit = texUnit;
+ if (ctx->Transform.MatrixMode == GL_TEXTURE) {
+ /* update current stack pointer */
+ ctx->CurrentStack = &ctx->TextureMatrixStack[texUnit];
+ }
+
if (ctx->Driver.ActiveTexture) {
(*ctx->Driver.ActiveTexture)( ctx, (GLuint) texUnit );
}
@@ -2251,11 +2433,11 @@ void
_mesa_ClientActiveTextureARB( GLenum target )
{
GET_CURRENT_CONTEXT(ctx);
- GLuint texUnit = target - GL_TEXTURE0_ARB;
+ GLuint texUnit = target - GL_TEXTURE0;
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (texUnit > ctx->Const.MaxTextureUnits) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glClientActiveTextureARB(target)");
+ _mesa_error(ctx, GL_INVALID_ENUM, "glClientActiveTexture(target)");
return;
}
diff --git a/xc/extras/Mesa/src/texstate.h b/xc/extras/Mesa/src/texstate.h
index 7f15673ad..66e7dfd88 100644
--- a/xc/extras/Mesa/src/texstate.h
+++ b/xc/extras/Mesa/src/texstate.h
@@ -1,7 +1,6 @@
-
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 5.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -34,6 +33,9 @@
extern void
_mesa_copy_texture_state( const GLcontext *src, GLcontext *dst );
+extern void
+_mesa_print_texunit_state( GLcontext *ctx, GLuint unit );
+
/*** Called from API ***/
diff --git a/xc/extras/Mesa/src/texstore.c b/xc/extras/Mesa/src/texstore.c
index 2285c4663..62768c598 100644
--- a/xc/extras/Mesa/src/texstore.c
+++ b/xc/extras/Mesa/src/texstore.c
@@ -1,8 +1,7 @@
-/* $Id: texstore.c,v 1.1.1.1 2002/10/22 13:05:22 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.4
+ * Version: 5.0.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -29,12 +28,38 @@
* 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
+ * texture image data.
+ *
+ * However, most device drivers will be able to use the fallback functions
+ * in this file. That is, most drivers will have the following bit of
+ * code:
+ * ctx->Driver.TexImage1D = _mesa_store_teximage1d;
+ * ctx->Driver.TexImage2D = _mesa_store_teximage2d;
+ * ctx->Driver.TexImage3D = _mesa_store_teximage3d;
+ * etc...
+ *
+ * Texture image processing is actually kind of complicated. We have to do:
+ * Format/type conversions
+ * pixel unpacking
+ * pixel transfer (scale, bais, lookup, convolution!, etc)
+ *
+ * These functions can handle most everything, including processing full
+ * images and sub-images.
+ */
+
+
+#include "glheader.h"
#include "colormac.h"
#include "context.h"
#include "convolve.h"
#include "image.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
+#include "texcompress.h"
#include "texformat.h"
#include "teximage.h"
#include "texstore.h"
@@ -46,9 +71,6 @@
* corresponding _base_ internal format: GL_ALPHA, GL_LUMINANCE,
* GL_LUMANCE_ALPHA, GL_INTENSITY, GL_RGB, or GL_RGBA. Return the
* number of components for the format. Return -1 if invalid enum.
- *
- * GH: Do we really need this? We have the number of bytes per texel
- * in the texture format structures, so why don't we just use that?
*/
static GLint
components_in_intformat( GLint format )
@@ -115,6 +137,8 @@ components_in_intformat( GLint format )
case GL_DEPTH_COMPONENT24_SGIX:
case GL_DEPTH_COMPONENT32_SGIX:
return 1;
+ case GL_YCBCR_MESA:
+ return 2; /* Y + (Cb or Cr) */
default:
return -1; /* error */
}
@@ -127,7 +151,8 @@ components_in_intformat( GLint format )
* We also take care of all image transfer operations here, including
* convolution, scale/bias, colortables, etc.
*
- * The destination texel channel type is always GLchan.
+ * The destination texel type is always GLchan.
+ * The destination texel format is one of the 6 basic types.
*
* A hardware driver may use this as a helper routine to unpack and
* apply pixel transfer ops into a temporary image buffer. Then,
@@ -135,8 +160,8 @@ components_in_intformat( GLint format )
*
* Input:
* dimensions - 1, 2, or 3
- * texFormat - GL_LUMINANCE, GL_INTENSITY, GL_LUMINANCE_ALPHA, GL_ALPHA,
- * GL_RGB or GL_RGBA
+ * texDestFormat - GL_LUMINANCE, GL_INTENSITY, GL_LUMINANCE_ALPHA, GL_ALPHA,
+ * GL_RGB or GL_RGBA (the destination format)
* texDestAddr - destination image address
* srcWidth, srcHeight, srcDepth - size (in pixels) of src and dest images
* dstXoffset, dstYoffset, dstZoffset - position to store the image within
@@ -162,6 +187,12 @@ transfer_teximage(GLcontext *ctx, GLuint dimensions,
ASSERT(ctx);
ASSERT(dimensions >= 1 && dimensions <= 3);
+ ASSERT(texDestFormat == GL_LUMINANCE ||
+ texDestFormat == GL_INTENSITY ||
+ texDestFormat == GL_LUMINANCE_ALPHA ||
+ texDestFormat == GL_ALPHA ||
+ texDestFormat == GL_RGB ||
+ texDestFormat == GL_RGBA);
ASSERT(texDestAddr);
ASSERT(srcWidth >= 1);
ASSERT(srcHeight >= 1);
@@ -255,6 +286,26 @@ transfer_teximage(GLcontext *ctx, GLuint dimensions,
dest += dstImageStride;
}
}
+ else if (texDestFormat == GL_YCBCR_MESA) {
+ /* YCbCr texture */
+ GLint img, row;
+ GLushort *dest = (GLushort *) texDestAddr
+ + dstZoffset * (dstImageStride / sizeof(GLushort))
+ + dstYoffset * (dstRowStride / sizeof(GLushort))
+ + dstXoffset * texComponents;
+ ASSERT(ctx->Extensions.MESA_ycbcr_texture);
+ for (img = 0; img < srcDepth; img++) {
+ GLushort *destRow = dest;
+ for (row = 0; row < srcHeight; row++) {
+ const GLvoid *srcRow = _mesa_image_address(srcPacking,
+ srcAddr, srcWidth, srcHeight,
+ srcFormat, srcType, img, row, 0);
+ MEMCPY(destRow, srcRow, srcWidth * sizeof(GLushort));
+ destRow += (dstRowStride / sizeof(GLushort));
+ }
+ dest += dstImageStride / sizeof(GLushort);
+ }
+ }
else if (texDestFormat == GL_DEPTH_COMPONENT) {
/* Depth texture (shadow maps) */
GLint img, row;
@@ -422,6 +473,12 @@ _mesa_transfer_teximage(GLcontext *ctx, GLuint dimensions,
GLint postConvWidth = srcWidth, postConvHeight = srcHeight;
assert(baseInternalFormat > 0);
+ ASSERT(baseInternalFormat == GL_LUMINANCE ||
+ baseInternalFormat == GL_INTENSITY ||
+ baseInternalFormat == GL_LUMINANCE_ALPHA ||
+ baseInternalFormat == GL_ALPHA ||
+ baseInternalFormat == GL_RGB ||
+ baseInternalFormat == GL_RGBA);
if (transferOps & IMAGE_CONVOLUTION_BIT) {
_mesa_adjust_image_for_convolution(ctx, dimensions, &postConvWidth,
@@ -604,12 +661,86 @@ _mesa_transfer_teximage(GLcontext *ctx, GLuint dimensions,
}
+
+/**
+ * Given a user's uncompressed texture image, this function takes care of
+ * pixel unpacking, pixel transfer, format conversion and compression.
+ */
+static void
+transfer_compressed_teximage(GLcontext *ctx, GLuint dimensions,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum srcFormat, GLenum srcType,
+ const struct gl_pixelstore_attrib *unpacking,
+ const GLvoid *source,
+ const struct gl_texture_format *dstFormat,
+ GLubyte *dest,
+ GLint dstRowStride)
+{
+ GLchan *tempImage = NULL;
+ GLint srcRowStride;
+ GLenum baseFormat;
+
+ ASSERT(dimensions == 2);
+ /* TexelBytes is zero if and only if it's a compressed format */
+ ASSERT(dstFormat->TexelBytes == 0);
+
+ baseFormat = dstFormat->BaseFormat;
+
+ if (srcFormat != baseFormat || srcType != CHAN_TYPE ||
+ ctx->_ImageTransferState != 0 || unpacking->SwapBytes) {
+ /* need to convert user's image to texImage->Format, GLchan */
+ GLint comps = components_in_intformat(baseFormat);
+ GLint postConvWidth = width, postConvHeight = height;
+
+ /* XXX convolution untested */
+ if (ctx->_ImageTransferState & IMAGE_CONVOLUTION_BIT) {
+ _mesa_adjust_image_for_convolution(ctx, dimensions, &postConvWidth,
+ &postConvHeight);
+ }
+
+ tempImage = (GLchan*) MALLOC(width * height * comps * sizeof(GLchan));
+ if (!tempImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
+ return;
+ }
+ transfer_teximage(ctx, dimensions,
+ baseFormat, /* dest format */
+ tempImage, /* dst address */
+ width, height, depth, /* src size */
+ 0, 0, 0, /* x/y/zoffset */
+ comps * width, /* dst row stride */
+ comps * width * height, /* dst image stride */
+ srcFormat, srcType, /* src format, type */
+ source, unpacking, /* src and src packing */
+ ctx->_ImageTransferState);
+ source = tempImage;
+ width = postConvWidth;
+ height = postConvHeight;
+ srcRowStride = width;
+ }
+ else {
+ if (unpacking->RowLength)
+ srcRowStride = unpacking->RowLength;
+ else
+ srcRowStride = width;
+ }
+
+ _mesa_compress_teximage(ctx, width, height, baseFormat,
+ (const GLchan *) source, srcRowStride,
+ dstFormat, dest, dstRowStride);
+ if (tempImage) {
+ FREE(tempImage);
+ }
+}
+
+
+
/*
- * This is the software fallback for Driver.TexImage1D().
+ * This is the software fallback for Driver.TexImage1D()
+ * and Driver.CopyTexImage2D().
* The texture image type will be GLchan.
* The texture image format will be GL_COLOR_INDEX, GL_INTENSITY,
* GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_ALPHA, GL_RGB or GL_RGBA.
- *
*/
void
_mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level,
@@ -636,52 +767,55 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level,
texelBytes = texImage->TexFormat->TexelBytes;
- /* Compute image size, in bytes */
- if (texImage->IsCompressed) {
- assert(ctx->Driver.CompressedTextureSize);
- sizeInBytes = ctx->Driver.CompressedTextureSize(ctx, texImage);
- assert(sizeInBytes > 0);
- texImage->CompressedSize = sizeInBytes;
- }
- else {
- sizeInBytes = postConvWidth * texelBytes;
- }
-
/* allocate memory */
+ if (texImage->IsCompressed)
+ sizeInBytes = texImage->CompressedSize;
+ else
+ sizeInBytes = postConvWidth * texelBytes;
texImage->Data = MESA_PBUFFER_ALLOC(sizeInBytes);
if (!texImage->Data) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D");
return;
}
- if (pixels) {
- /* unpack image, apply transfer ops and store in texImage->Data */
+ if (!pixels)
+ return;
+
+ /* unpack image, apply transfer ops and store in texImage->Data */
+ if (texImage->IsCompressed) {
+ GLint dstRowStride = _mesa_compressed_row_stride(texImage->IntFormat,
+ width);
+ transfer_compressed_teximage(ctx, 1, width, 1, 1,
+ format, type, packing,
+ pixels, texImage->TexFormat,
+ (GLubyte *) texImage->Data, dstRowStride);
+ }
+ else {
_mesa_transfer_teximage(ctx, 1,
- _mesa_base_tex_format(ctx, internalFormat),
+ texImage->Format, /* base format */
texImage->TexFormat, texImage->Data,
- width, 1, 1, 0, 0, 0,
+ width, 1, 1, /* src size */
+ 0, 0, 0, /* dstX/Y/Zoffset */
0, /* dstRowStride */
0, /* dstImageStride */
format, type, pixels, packing);
+ }
- /* GL_SGIS_generate_mipmap */
- if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- _mesa_generate_mipmap(ctx,
- &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
- texObj);
- }
+ /* GL_SGIS_generate_mipmap */
+ if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
+ _mesa_generate_mipmap(ctx, target,
+ &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
+ texObj);
}
}
/*
- * This is the software fallback for Driver.TexImage2D().
+ * This is the software fallback for Driver.TexImage2D()
+ * and Driver.CopyTexImage2D().
* The texture image type will be GLchan.
* The texture image format will be GL_COLOR_INDEX, GL_INTENSITY,
* GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_ALPHA, GL_RGB or GL_RGBA.
- *
- * NOTE: if real texture compression is supported, this whole function
- * will need to be overridden.
*/
void
_mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level,
@@ -709,51 +843,56 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level,
texelBytes = texImage->TexFormat->TexelBytes;
- /* Compute image size, in bytes */
- if (texImage->IsCompressed) {
- assert(ctx->Driver.CompressedTextureSize);
- sizeInBytes = ctx->Driver.CompressedTextureSize(ctx, texImage);
- assert(sizeInBytes > 0);
- texImage->CompressedSize = sizeInBytes;
- }
- else {
- sizeInBytes = postConvWidth * postConvHeight * texelBytes;
- }
-
/* allocate memory */
+ if (texImage->IsCompressed)
+ sizeInBytes = texImage->CompressedSize;
+ else
+ sizeInBytes = postConvWidth * postConvHeight * texelBytes;
texImage->Data = MESA_PBUFFER_ALLOC(sizeInBytes);
if (!texImage->Data) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
return;
}
- if (pixels) {
- /* unpack image, apply transfer ops and store in texImage->Data */
+ if (!pixels)
+ return;
+
+ /* unpack image, apply transfer ops and store in texImage->Data */
+ if (texImage->IsCompressed) {
+ GLint dstRowStride = _mesa_compressed_row_stride(texImage->IntFormat,
+ width);
+ transfer_compressed_teximage(ctx, 2, width, height, 1,
+ format, type, packing,
+ pixels, texImage->TexFormat,
+ (GLubyte *) texImage->Data, dstRowStride);
+ }
+ else {
_mesa_transfer_teximage(ctx, 2,
- _mesa_base_tex_format(ctx, internalFormat),
+ texImage->Format,
texImage->TexFormat, texImage->Data,
- width, height, 1, 0, 0, 0,
- texImage->Width * texelBytes,
+ width, height, 1, /* src size */
+ 0, 0, 0, /* dstX/Y/Zoffset */
+ texImage->Width * texelBytes, /* dstRowStride */
0, /* dstImageStride */
format, type, pixels, packing);
+ }
- /* GL_SGIS_generate_mipmap */
- if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- _mesa_generate_mipmap(ctx,
- &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
- texObj);
- }
+ /* GL_SGIS_generate_mipmap */
+ if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
+ _mesa_generate_mipmap(ctx, target,
+ &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
+ texObj);
}
}
/*
- * This is the software fallback for Driver.TexImage3D().
+ * This is the software fallback for Driver.TexImage3D()
+ * and Driver.CopyTexImage3D().
* The texture image type will be GLchan.
* The texture image format will be GL_COLOR_INDEX, GL_INTENSITY,
* GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_ALPHA, GL_RGB or GL_RGBA.
- *
*/
void
_mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level,
@@ -775,40 +914,45 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level,
texelBytes = texImage->TexFormat->TexelBytes;
- /* Compute image size, in bytes */
- if (texImage->IsCompressed) {
- assert(ctx->Driver.CompressedTextureSize);
- sizeInBytes = ctx->Driver.CompressedTextureSize(ctx, texImage);
- assert(sizeInBytes > 0);
- texImage->CompressedSize = sizeInBytes;
- }
- else {
- sizeInBytes = width * height * depth * texelBytes;
- }
-
/* allocate memory */
+ if (texImage->IsCompressed)
+ sizeInBytes = texImage->CompressedSize;
+ else
+ sizeInBytes = width * height * depth * texelBytes;
texImage->Data = MESA_PBUFFER_ALLOC(sizeInBytes);
if (!texImage->Data) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D");
return;
}
- if (pixels) {
- /* unpack image, apply transfer ops and store in texImage->Data */
+ if (!pixels)
+ return;
+
+ /* unpack image, apply transfer ops and store in texImage->Data */
+ if (texImage->IsCompressed) {
+ GLint dstRowStride = _mesa_compressed_row_stride(texImage->IntFormat,
+ width);
+ transfer_compressed_teximage(ctx, 3, width, height, depth,
+ format, type, packing,
+ pixels, texImage->TexFormat,
+ (GLubyte *) texImage->Data, dstRowStride);
+ }
+ else {
_mesa_transfer_teximage(ctx, 3,
- _mesa_base_tex_format(ctx, internalFormat),
+ texImage->Format,
texImage->TexFormat, texImage->Data,
- width, height, depth, 0, 0, 0,
- texImage->Width * texelBytes,
+ width, height, depth, /* src size */
+ 0, 0, 0, /* dstX/Y/Zoffset */
+ texImage->Width * texelBytes, /* dstRowStride */
texImage->Width * texImage->Height * texelBytes,
format, type, pixels, packing);
+ }
- /* GL_SGIS_generate_mipmap */
- if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- _mesa_generate_mipmap(ctx,
- &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
- texObj);
- }
+ /* GL_SGIS_generate_mipmap */
+ if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
+ _mesa_generate_mipmap(ctx, target,
+ &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
+ texObj);
}
}
@@ -816,7 +960,8 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level,
/*
- * This is the software fallback for Driver.TexSubImage1D().
+ * This is the software fallback for Driver.TexSubImage1D()
+ * and Driver.CopyTexSubImage1D().
*/
void
_mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level,
@@ -826,25 +971,45 @@ _mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level,
struct gl_texture_object *texObj,
struct gl_texture_image *texImage)
{
- _mesa_transfer_teximage(ctx, 1,
- _mesa_base_tex_format(ctx, texImage->IntFormat),
- texImage->TexFormat, texImage->Data,
- width, 1, 1, /* src size */
- xoffset, 0, 0, /* dest offsets */
- 0, /* dstRowStride */
- 0, /* dstImageStride */
- format, type, pixels, packing);
+ if (texImage->IsCompressed) {
+ GLint dstRowStride = _mesa_compressed_row_stride(texImage->IntFormat,
+ texImage->Width);
+ GLubyte *dest = _mesa_compressed_image_address(xoffset, 0, 0,
+ texImage->IntFormat,
+ texImage->Width,
+ texImage->Data);
+ transfer_compressed_teximage(ctx, 1, /* dimensions */
+ width, 1, 1, /* size to replace */
+ format, type, /* source format/type */
+ packing, /* source packing */
+ pixels, /* source data */
+ texImage->TexFormat,/* dest format */
+ dest, dstRowStride);
+ }
+ else {
+ _mesa_transfer_teximage(ctx, 1,
+ texImage->Format,
+ texImage->TexFormat, texImage->Data,
+ width, 1, 1, /* src size */
+ xoffset, 0, 0, /* dest offsets */
+ 0, /* dstRowStride */
+ 0, /* dstImageStride */
+ format, type, pixels, packing);
+ }
/* GL_SGIS_generate_mipmap */
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- _mesa_generate_mipmap(ctx, &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
+ _mesa_generate_mipmap(ctx, target,
+ &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
texObj);
}
}
+
/*
- * This is the software fallback for Driver.TexSubImage2D().
+ * This is the software fallback for Driver.TexSubImage2D()
+ * and Driver.CopyTexSubImage2D().
*/
void
_mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level,
@@ -855,18 +1020,36 @@ _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level,
struct gl_texture_object *texObj,
struct gl_texture_image *texImage)
{
- _mesa_transfer_teximage(ctx, 2,
- _mesa_base_tex_format(ctx, texImage->IntFormat),
- texImage->TexFormat, texImage->Data,
- width, height, 1, /* src size */
- xoffset, yoffset, 0, /* dest offsets */
- texImage->Width * texImage->TexFormat->TexelBytes,
- 0, /* dstImageStride */
- format, type, pixels, packing);
+ if (texImage->IsCompressed) {
+ GLint dstRowStride = _mesa_compressed_row_stride(texImage->IntFormat,
+ texImage->Width);
+ GLubyte *dest = _mesa_compressed_image_address(xoffset, yoffset, 0,
+ texImage->IntFormat,
+ texImage->Width,
+ texImage->Data);
+ transfer_compressed_teximage(ctx, 2, /* dimensions */
+ width, height, 1, /* size to replace */
+ format, type, /* source format/type */
+ packing, /* source packing */
+ pixels, /* source data */
+ texImage->TexFormat,/* dest format */
+ dest, dstRowStride);
+ }
+ else {
+ _mesa_transfer_teximage(ctx, 2,
+ texImage->Format,
+ texImage->TexFormat, texImage->Data,
+ width, height, 1, /* src size */
+ xoffset, yoffset, 0, /* dest offsets */
+ texImage->Width *texImage->TexFormat->TexelBytes,
+ 0, /* dstImageStride */
+ format, type, pixels, packing);
+ }
/* GL_SGIS_generate_mipmap */
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- _mesa_generate_mipmap(ctx, &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
+ _mesa_generate_mipmap(ctx, target,
+ &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
texObj);
}
}
@@ -874,6 +1057,7 @@ _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level,
/*
* This is the software fallback for Driver.TexSubImage3D().
+ * and Driver.CopyTexSubImage3D().
*/
void
_mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level,
@@ -884,18 +1068,37 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level,
struct gl_texture_object *texObj,
struct gl_texture_image *texImage)
{
- const GLint texelBytes = texImage->TexFormat->TexelBytes;
- _mesa_transfer_teximage(ctx, 3,
- _mesa_base_tex_format(ctx, texImage->IntFormat),
+ if (texImage->IsCompressed) {
+ GLint dstRowStride = _mesa_compressed_row_stride(texImage->IntFormat,
+ texImage->Width);
+ GLubyte *dest = _mesa_compressed_image_address(xoffset, yoffset, zoffset,
+ texImage->IntFormat,
+ texImage->Width,
+ texImage->Data);
+ transfer_compressed_teximage(ctx, 3, /* dimensions */
+ width, height, depth,/* size to replace */
+ format, type, /* source format/type */
+ packing, /* source packing */
+ pixels, /* source data */
+ texImage->TexFormat,/* dest format */
+ dest, dstRowStride);
+ }
+ else {
+ const GLint texelBytes = texImage->TexFormat->TexelBytes;
+ _mesa_transfer_teximage(ctx, 3,
+ texImage->Format,
texImage->TexFormat, texImage->Data,
width, height, depth, /* src size */
xoffset, yoffset, xoffset, /* dest offsets */
- texImage->Width * texelBytes,
+ texImage->Width * texelBytes, /* dst row stride */
texImage->Width * texImage->Height * texelBytes,
format, type, pixels, packing);
+ }
+
/* GL_SGIS_generate_mipmap */
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- _mesa_generate_mipmap(ctx, &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
+ _mesa_generate_mipmap(ctx, target,
+ &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
texObj);
}
}
@@ -914,9 +1117,7 @@ _mesa_store_compressed_teximage1d(GLcontext *ctx, GLenum target, GLint level,
struct gl_texture_object *texObj,
struct gl_texture_image *texImage)
{
- /* Nothing here.
- * The device driver has to do it all.
- */
+ /* this space intentionally left blank */
}
@@ -932,9 +1133,33 @@ _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level,
struct gl_texture_object *texObj,
struct gl_texture_image *texImage)
{
- /* Nothing here.
- * The device driver has to do it all.
+ /* This is pretty simple, basically just do a memcpy without worrying
+ * about the usual image unpacking or image transfer operations.
*/
+ ASSERT(texObj);
+ ASSERT(texImage);
+ ASSERT(texImage->Width > 0);
+ ASSERT(texImage->Height > 0);
+ ASSERT(texImage->Depth == 1);
+ ASSERT(texImage->Data == NULL); /* was freed in glCompressedTexImage2DARB */
+
+ /* choose the texture format */
+ assert(ctx->Driver.ChooseTextureFormat);
+ texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx,
+ internalFormat, 0, 0);
+ assert(texImage->TexFormat);
+ texImage->FetchTexel = texImage->TexFormat->FetchTexel2D;
+
+ /* allocate storage */
+ texImage->Data = MESA_PBUFFER_ALLOC(imageSize);
+ if (!texImage->Data) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2DARB");
+ return;
+ }
+
+ /* copy the data */
+ ASSERT(texImage->CompressedSize == imageSize);
+ MEMCPY(texImage->Data, data, imageSize);
}
@@ -951,31 +1176,90 @@ _mesa_store_compressed_teximage3d(GLcontext *ctx, GLenum target, GLint level,
struct gl_texture_object *texObj,
struct gl_texture_image *texImage)
{
- /* Nothing here.
- * The device driver has to do it all.
- */
+ /* this space intentionally left blank */
}
-/*
- * Fallback for Driver.GetCompressedTexImage3D()
- * This will probably work find for hardware drivers. That is, hardware
- * drivers won't have to override this function, unless the compressed
- * texture must first be fetched from the TRAM.
+/**
+ * Fallback for Driver.CompressedTexSubImage1D()
*/
void
-_mesa_get_compressed_teximage(GLcontext *ctx, GLenum target,
- GLint level, void *image,
- const struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
+_mesa_store_compressed_texsubimage1d(GLcontext *ctx, GLenum target,
+ GLint level,
+ GLint xoffset, GLsizei width,
+ GLenum format,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
{
- assert(texImage->IsCompressed);
- assert(texImage->CompressedSize > 0);
- MEMCPY(image, texImage->Data, texImage->CompressedSize);
+ /* this space intentionally left blank */
}
+/**
+ * Fallback for Driver.CompressedTexSubImage2D()
+ */
+void
+_mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target,
+ GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ GLint bytesPerRow, destRowStride, srcRowStride;
+ GLint i, rows;
+ GLubyte *dest;
+ const GLubyte *src;
+
+ /* these should have been caught sooner */
+ ASSERT((width & 3) == 0 || width == 2 || width == 1);
+ ASSERT((height & 3) == 0 || height == 2 || height == 1);
+ ASSERT((xoffset & 3) == 0);
+ ASSERT((yoffset & 3) == 0);
+
+ srcRowStride = _mesa_compressed_row_stride(texImage->IntFormat, width);
+ src = (const GLubyte *) data;
+
+ destRowStride = _mesa_compressed_row_stride(texImage->IntFormat,
+ texImage->Width);
+ dest = _mesa_compressed_image_address(xoffset, yoffset, 0,
+ texImage->IntFormat,
+ texImage->Width, texImage->Data);
+
+ bytesPerRow = srcRowStride;
+ rows = height / 4;
+
+ for (i = 0; i < rows; i++) {
+ MEMCPY(dest, src, bytesPerRow);
+ dest += destRowStride;
+ src += srcRowStride;
+ }
+}
+
+
+/**
+ * Fallback for Driver.CompressedTexSubImage3D()
+ */
+void
+_mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target,
+ GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ /* this space intentionally left blank */
+}
+
+
+
+
/*
* This is the fallback for Driver.TestProxyTexImage().
@@ -1470,7 +1754,7 @@ make_3d_mipmap(const struct gl_texture_format *format, GLint border,
*/
/*
- printf("mip3d %d x %d x %d -> %d x %d x %d\n",
+ _mesa_printf("mip3d %d x %d x %d -> %d x %d x %d\n",
srcWidth, srcHeight, srcDepth, dstWidth, dstHeight, dstDepth);
*/
@@ -1603,53 +1887,74 @@ make_3d_mipmap(const struct gl_texture_format *format, GLint border,
* Stop at texObj's MaxLevel or when we get to the 1x1 texture.
*/
void
-_mesa_generate_mipmap(GLcontext *ctx,
+_mesa_generate_mipmap(GLcontext *ctx, GLenum target,
const struct gl_texture_unit *texUnit,
struct gl_texture_object *texObj)
{
- const GLenum targets1D[] = { GL_TEXTURE_1D, 0 };
- const GLenum targets2D[] = { GL_TEXTURE_2D, 0 };
- const GLenum targets3D[] = { GL_TEXTURE_3D, 0 };
- const GLenum targetsCube[] = { GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB,
- GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,
- GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB,
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB,
- GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB,
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB,
- 0 };
- const GLenum targetsRect[] = { GL_TEXTURE_RECTANGLE_NV, 0 };
- const GLenum *targets;
- GLint level;
- GLint maxLevels = 0;
+ const struct gl_texture_image *srcImage;
+ const struct gl_texture_format *convertFormat;
+ const GLubyte *srcData;
+ GLubyte *dstData;
+ GLint level, maxLevels;
ASSERT(texObj);
- ASSERT(texObj->Image[texObj->BaseLevel]);
-
- switch (texObj->Target) {
- case GL_TEXTURE_1D:
- targets = targets1D;
- maxLevels = ctx->Const.MaxTextureLevels;
- break;
- case GL_TEXTURE_2D:
- targets = targets2D;
- maxLevels = ctx->Const.MaxTextureLevels;
- break;
- case GL_TEXTURE_3D:
- targets = targets3D;
- maxLevels = ctx->Const.Max3DTextureLevels;
- break;
- case GL_TEXTURE_CUBE_MAP_ARB:
- targets = targetsCube;
- maxLevels = ctx->Const.MaxCubeTextureLevels;
- break;
- case GL_TEXTURE_RECTANGLE_NV:
- targets = targetsRect;
- maxLevels = 1;
- break;
- default:
- _mesa_problem(ctx,
- "Bad texture object dimension in _mesa_generate_mipmaps");
- return;
+ srcImage = texObj->Image[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->Format == GL_RGB) {
+ convertFormat = &_mesa_texformat_rgb;
+ components = 3;
+ }
+ else if (srcImage->Format == GL_RGBA) {
+ convertFormat = &_mesa_texformat_rgba;
+ components = 4;
+ }
+ else {
+ _mesa_problem(ctx, "bad srcImage->Format in _mesa_generate_mipmaps");
+ return;
+ }
+
+ /* allocate storage for uncompressed GL_RGB or GL_RGBA images */
+ size = _mesa_bytes_per_pixel(srcImage->Format, CHAN_TYPE)
+ * srcImage->Width * srcImage->Height * srcImage->Depth + 20;
+ /* 20 extra bytes, just be safe when calling last FetchTexel */
+ srcData = MALLOC(size);
+ if (!srcData) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "generate mipmaps");
+ return;
+ }
+ dstData = MALLOC(size / 2); /* 1/4 would probably be OK */
+ if (!dstData) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "generate mipmaps");
+ 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->FetchTexel)(srcImage, col, row, 0, (GLvoid *) dst);
+ dst += components;
+ }
+ }
+ }
+ else {
+ /* uncompressed */
+ convertFormat = srcImage->TexFormat;
}
for (level = texObj->BaseLevel; level < texObj->MaxLevel
@@ -1660,15 +1965,14 @@ _mesa_generate_mipmap(GLcontext *ctx,
GLint srcWidth, srcHeight, srcDepth;
GLint dstWidth, dstHeight, dstDepth;
GLint border, bytesPerTexel;
- GLint t;
- srcImage = texObj->Image[level];
+ /* 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;
- bytesPerTexel = srcImage->TexFormat->TexelBytes;
/* compute next (level+1) image size */
if (srcWidth - 2 * border > 1) {
@@ -1694,65 +1998,88 @@ _mesa_generate_mipmap(GLcontext *ctx,
dstHeight == srcHeight &&
dstDepth == srcDepth) {
/* all done */
+ if (srcImage->IsCompressed) {
+ FREE((void *) srcData);
+ FREE(dstData);
+ }
return;
}
- /* Need this loop just because of cubemaps */
- for (t = 0; targets[t]; t++) {
- ASSERT(t < 6);
-
- dstImage = _mesa_select_tex_image(ctx, texUnit, targets[t], level+1);
+ /* get dest gl_texture_image */
+ dstImage = _mesa_select_tex_image(ctx, texUnit, target, level+1);
+ if (!dstImage) {
+ dstImage = _mesa_alloc_texture_image();
if (!dstImage) {
- dstImage = _mesa_alloc_texture_image();
- if (!dstImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
- return;
- }
- _mesa_set_tex_image(texObj, targets[t], level + 1, dstImage);
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
+ return;
}
+ _mesa_set_tex_image(texObj, target, level + 1, dstImage);
+ }
- /* Free old image data */
- if (dstImage->Data)
- MESA_PBUFFER_FREE(dstImage->Data);
-
- /* initialize new image */
- _mesa_init_teximage_fields(ctx, t, dstImage, dstWidth, dstHeight,
- dstDepth, border, srcImage->Format);
- dstImage->DriverData = NULL;
- dstImage->TexFormat = srcImage->TexFormat;
- dstImage->FetchTexel = srcImage->FetchTexel;
- ASSERT(dstImage->TexFormat);
- ASSERT(dstImage->FetchTexel);
-
+ /* Free old image data */
+ if (dstImage->Data)
+ MESA_PBUFFER_FREE(dstImage->Data);
+
+ /* initialize new image */
+ _mesa_init_teximage_fields(ctx, target, dstImage, dstWidth, dstHeight,
+ dstDepth, border, srcImage->IntFormat);
+ dstImage->DriverData = NULL;
+ dstImage->TexFormat = srcImage->TexFormat;
+ dstImage->FetchTexel = srcImage->FetchTexel;
+ ASSERT(dstImage->TexFormat);
+ ASSERT(dstImage->FetchTexel);
+
+ /* Alloc new teximage data buffer.
+ * Setup src and dest data pointers.
+ */
+ if (dstImage->IsCompressed) {
+ ASSERT(dstImage->CompressedSize > 0); /* set by init_teximage_fields*/
+ dstImage->Data = MESA_PBUFFER_ALLOC(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 = srcImage->TexFormat->TexelBytes;
ASSERT(dstWidth * dstHeight * dstDepth * bytesPerTexel > 0);
-
- /* alloc new image buffer */
dstImage->Data = MESA_PBUFFER_ALLOC(dstWidth * dstHeight * dstDepth
- * bytesPerTexel);
+ * 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 (texObj->Target) {
+ /*
+ * We use simple 2x2 averaging to compute the next mipmap level.
+ */
+ switch (target) {
case GL_TEXTURE_1D:
- make_1d_mipmap(srcImage->TexFormat, border,
- srcWidth, (const GLubyte *) srcImage->Data,
- dstWidth, (GLubyte *) dstImage->Data);
+ make_1d_mipmap(convertFormat, border,
+ srcWidth, srcData,
+ dstWidth, dstData);
break;
case GL_TEXTURE_2D:
- case GL_TEXTURE_CUBE_MAP_ARB:
- make_2d_mipmap(srcImage->TexFormat, border,
- srcWidth, srcHeight, (const GLubyte *) srcImage->Data,
- dstWidth, dstHeight, (GLubyte *) dstImage->Data);
+ 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(srcImage->TexFormat, border,
- srcWidth, srcHeight, srcDepth, (const GLubyte *) srcImage->Data,
- dstWidth, dstHeight, dstDepth, (GLubyte *) dstImage->Data);
+ make_3d_mipmap(convertFormat, border,
+ srcWidth, srcHeight, srcDepth, srcData,
+ dstWidth, dstHeight, dstDepth, dstData);
break;
case GL_TEXTURE_RECTANGLE_NV:
/* no mipmaps, do nothing */
@@ -1760,7 +2087,29 @@ _mesa_generate_mipmap(GLcontext *ctx,
default:
_mesa_problem(ctx, "bad dimensions in _mesa_generate_mipmaps");
return;
- }
- } /* loop over tex image targets */
- } /* loop over tex levels */
+ }
+
+ if (dstImage->IsCompressed) {
+ GLubyte *temp;
+ /* compress image from dstData into dstImage->Data */
+ const GLenum srcFormat = convertFormat->BaseFormat;
+ GLint dstRowStride = _mesa_compressed_row_stride(srcImage->IntFormat,
+ dstWidth);
+ ASSERT(srcFormat == GL_RGB || srcFormat == GL_RGBA);
+ _mesa_compress_teximage(ctx,
+ dstWidth, dstHeight, /* size */
+ srcFormat, /* source format */
+ dstData, /* source buffer */
+ dstWidth, /* source row stride */
+ dstImage->TexFormat, /* dest format */
+ dstImage->Data, /* dest buffer */
+ dstRowStride ); /* dest row stride */
+
+ /* swap src and dest pointers */
+ temp = (GLubyte *) srcData;
+ srcData = dstData;
+ dstData = temp;
+ }
+
+ } /* loop over mipmap levels */
}
diff --git a/xc/extras/Mesa/src/texstore.h b/xc/extras/Mesa/src/texstore.h
index 53c1a2807..799769698 100644
--- a/xc/extras/Mesa/src/texstore.h
+++ b/xc/extras/Mesa/src/texstore.h
@@ -1,10 +1,9 @@
-/* $Id: texstore.h,v 1.1.1.1 2002/10/22 13:05:22 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -136,10 +135,33 @@ _mesa_store_compressed_teximage3d(GLcontext *ctx, GLenum target, GLint level,
extern void
-_mesa_get_compressed_teximage(GLcontext *ctx, GLenum target,
- GLint level, void *image,
- const struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
+_mesa_store_compressed_texsubimage1d(GLcontext *ctx, GLenum target,
+ GLint level,
+ GLint xoffset, GLsizei width,
+ GLenum format,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+extern void
+_mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target,
+ GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+extern void
+_mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target,
+ GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
extern GLboolean
@@ -149,7 +171,7 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
extern void
-_mesa_generate_mipmap(GLcontext *ctx,
+_mesa_generate_mipmap(GLcontext *ctx, GLenum target,
const struct gl_texture_unit *texUnit,
struct gl_texture_object *texObj);
diff --git a/xc/extras/Mesa/src/texutil.c b/xc/extras/Mesa/src/texutil.c
index bf9285a7e..5b515b776 100644
--- a/xc/extras/Mesa/src/texutil.c
+++ b/xc/extras/Mesa/src/texutil.c
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -23,22 +23,27 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Gareth Hughes <gareth@valinux.com>
+ * Gareth Hughes
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
+/*
+ * Description:
+ * Functions for texture image conversion. This takes care of converting
+ * typical GL_RGBA/GLubyte textures into hardware-specific formats.
+ * We can handle non-standard row strides and pixel unpacking parameters.
+ */
+
+
#include "glheader.h"
#include "context.h"
#include "enums.h"
#include "image.h"
+#include "imports.h"
#include "macros.h"
-#include "mem.h"
#include "mtypes.h"
#include "texformat.h"
#include "texutil.h"
-#endif
+
#define DEBUG_TEXUTIL 0
@@ -50,7 +55,7 @@
#endif
-struct gl_texture_convert {
+struct convert_info {
GLint xoffset, yoffset, zoffset; /* Subimage offset */
GLint width, height, depth; /* Subimage region */
@@ -66,15 +71,16 @@ struct gl_texture_convert {
GLint index;
};
-typedef GLboolean (*convert_func)( struct gl_texture_convert *convert );
+typedef GLboolean (*convert_func)( const struct convert_info *convert );
+/* bitvalues for convert->index */
#define CONVERT_STRIDE_BIT 0x1
#define CONVERT_UNPACKING_BIT 0x2
/* =============================================================
- * RGBA8888 textures:
+ * Convert to RGBA8888 textures:
*/
#define DST_TYPE GLuint
@@ -117,7 +123,7 @@ typedef GLboolean (*convert_func)( struct gl_texture_convert *convert );
#define CONVERT_RGBA8888( name ) \
static GLboolean \
-convert_##name##_rgba8888( struct gl_texture_convert *convert ) \
+convert_##name##_rgba8888( const struct convert_info *convert ) \
{ \
convert_func *tab; \
GLint index = convert->index; \
@@ -153,7 +159,7 @@ CONVERT_RGBA8888( texsubimage3d )
/* =============================================================
- * ARGB8888 textures:
+ * Convert to ARGB8888 textures:
*/
#define DST_TYPE GLuint
@@ -196,7 +202,7 @@ CONVERT_RGBA8888( texsubimage3d )
#define CONVERT_ARGB8888( name ) \
static GLboolean \
-convert_##name##_argb8888( struct gl_texture_convert *convert ) \
+convert_##name##_argb8888( const struct convert_info *convert ) \
{ \
convert_func *tab; \
GLint index = convert->index; \
@@ -231,11 +237,11 @@ CONVERT_ARGB8888( texsubimage3d )
/* =============================================================
- * RGB888 textures:
+ * Convert to RGB888 textures:
*/
static GLboolean
-convert_texsubimage2d_rgb888( struct gl_texture_convert *convert )
+convert_texsubimage2d_rgb888( const struct convert_info *convert )
{
/* This is a placeholder for now...
*/
@@ -243,7 +249,7 @@ convert_texsubimage2d_rgb888( struct gl_texture_convert *convert )
}
static GLboolean
-convert_texsubimage3d_rgb888( struct gl_texture_convert *convert )
+convert_texsubimage3d_rgb888( const struct convert_info *convert )
{
/* This is a placeholder for now...
*/
@@ -253,7 +259,7 @@ convert_texsubimage3d_rgb888( struct gl_texture_convert *convert )
/* =============================================================
- * RGB565 textures:
+ * Convert to RGB565 textures:
*/
#define DST_TYPE GLushort
@@ -300,7 +306,7 @@ convert_texsubimage3d_rgb888( struct gl_texture_convert *convert )
#define CONVERT_RGB565( name ) \
static GLboolean \
-convert_##name##_rgb565( struct gl_texture_convert *convert ) \
+convert_##name##_rgb565( const struct convert_info *convert ) \
{ \
convert_func *tab; \
GLint index = convert->index; \
@@ -335,7 +341,7 @@ CONVERT_RGB565( texsubimage3d )
/* =============================================================
- * ARGB4444 textures:
+ * Convert to ARGB4444 textures:
*/
#define DST_TYPE GLushort
@@ -368,7 +374,7 @@ CONVERT_RGB565( texsubimage3d )
#define CONVERT_ARGB4444( name ) \
static GLboolean \
-convert_##name##_argb4444( struct gl_texture_convert *convert ) \
+convert_##name##_argb4444( const struct convert_info *convert ) \
{ \
convert_func *tab; \
GLint index = convert->index; \
@@ -398,7 +404,7 @@ CONVERT_ARGB4444( texsubimage3d )
/* =============================================================
- * ARGB1555 textures:
+ * Convert to ARGB1555 textures:
*/
#define DST_TYPE GLushort
@@ -462,7 +468,7 @@ CONVERT_ARGB4444( texsubimage3d )
#define CONVERT_ARGB1555( name ) \
static GLboolean \
-convert_##name##_argb1555( struct gl_texture_convert *convert ) \
+convert_##name##_argb1555( const struct convert_info *convert ) \
{ \
convert_func *tab; \
GLint index = convert->index; \
@@ -558,7 +564,7 @@ CONVERT_ARGB1555( texsubimage3d )
#define CONVERT_AL88( name ) \
static GLboolean \
-convert_##name##_al88( struct gl_texture_convert *convert ) \
+convert_##name##_al88( const struct convert_info *convert ) \
{ \
convert_func *tab; \
GLint index = convert->index; \
@@ -598,11 +604,11 @@ CONVERT_AL88( texsubimage3d )
/* =============================================================
- * RGB332 textures:
+ * Convert to RGB332 textures:
*/
static GLboolean
-convert_texsubimage2d_rgb332( struct gl_texture_convert *convert )
+convert_texsubimage2d_rgb332( const struct convert_info *convert )
{
/* This is a placeholder for now...
*/
@@ -610,7 +616,7 @@ convert_texsubimage2d_rgb332( struct gl_texture_convert *convert )
}
static GLboolean
-convert_texsubimage3d_rgb332( struct gl_texture_convert *convert )
+convert_texsubimage3d_rgb332( const struct convert_info *convert )
{
/* This is a placeholder for now...
*/
@@ -638,7 +644,7 @@ convert_texsubimage3d_rgb332( struct gl_texture_convert *convert )
#define CONVERT_CI8( name ) \
static GLboolean \
-convert_##name##_ci8( struct gl_texture_convert *convert ) \
+convert_##name##_ci8( const struct convert_info *convert ) \
{ \
convert_func *tab; \
GLint index = convert->index; \
@@ -664,12 +670,88 @@ CONVERT_CI8( texsubimage2d )
CONVERT_CI8( texsubimage3d )
+/* =============================================================
+ * convert to YCBCR textures:
+ */
+
+#define DST_TYPE GLushort
+#define DST_TEXELS_PER_DWORD 2
+
+#define CONVERT_TEXEL( dst, src ) \
+ dst = (src[0] << 8) | src[1];
+
+#define CONVERT_DIRECT
+
+#define SRC_TEXEL_BYTES 2
+
+#define TAG(x) x##_ycbcr_direct
+#include "texutil_tmp.h"
+
+
+#define CONVERT_YCBCR( name ) \
+static GLboolean \
+convert_##name##_ycbcr( const struct convert_info *convert ) \
+{ \
+ convert_func *tab; \
+ GLint index = convert->index; \
+ \
+ if (convert->format != GL_YCBCR_MESA) { \
+ /* Can't handle this source format/type combination */ \
+ return GL_FALSE; \
+ } \
+ tab = name##_tab_ycbcr_direct; \
+ \
+ return tab[index]( convert ); \
+}
+
+CONVERT_YCBCR( texsubimage2d )
+CONVERT_YCBCR( texsubimage3d )
+
+
+/* =============================================================
+ * convert to YCBCR_REV textures:
+ */
+
+#define DST_TYPE GLushort
+#define DST_TEXELS_PER_DWORD 2
+
+#define CONVERT_TEXEL( dst, src ) \
+ dst = (src[1] << 8) | src[0];
+
+#define CONVERT_DIRECT
+
+#define SRC_TEXEL_BYTES 2
+
+#define TAG(x) x##_ycbcr_rev_direct
+#include "texutil_tmp.h"
+
+
+#define CONVERT_YCBCR_REV( name ) \
+static GLboolean \
+convert_##name##_ycbcr_rev( const struct convert_info *convert ) \
+{ \
+ convert_func *tab; \
+ GLint index = convert->index; \
+ \
+ if (convert->format != GL_YCBCR_MESA) { \
+ /* Can't handle this source format/type combination */ \
+ return GL_FALSE; \
+ } \
+ tab = name##_tab_ycbcr_rev_direct; \
+ \
+ return tab[index]( convert ); \
+}
+
+CONVERT_YCBCR_REV( texsubimage2d )
+CONVERT_YCBCR_REV( texsubimage3d )
+
+
/* =============================================================
* Global entry points
*/
-static convert_func gl_convert_texsubimage2d_tab[] = {
+static convert_func convert_texsubimage2d_tab[] = {
convert_texsubimage2d_rgba8888,
convert_texsubimage2d_argb8888,
convert_texsubimage2d_rgb888,
@@ -682,9 +764,11 @@ static convert_func gl_convert_texsubimage2d_tab[] = {
convert_texsubimage2d_ci8,
convert_texsubimage2d_ci8,
convert_texsubimage2d_ci8,
+ convert_texsubimage2d_ycbcr,
+ convert_texsubimage2d_ycbcr_rev,
};
-static convert_func gl_convert_texsubimage3d_tab[] = {
+static convert_func convert_texsubimage3d_tab[] = {
convert_texsubimage3d_rgba8888,
convert_texsubimage3d_argb8888,
convert_texsubimage3d_rgb888,
@@ -697,6 +781,8 @@ static convert_func gl_convert_texsubimage3d_tab[] = {
convert_texsubimage3d_ci8,
convert_texsubimage3d_ci8,
convert_texsubimage3d_ci8,
+ convert_texsubimage3d_ycbcr,
+ convert_texsubimage3d_ycbcr_rev,
};
@@ -734,14 +820,14 @@ _mesa_convert_texsubimage1d( GLint mesaFormat,
const struct gl_pixelstore_attrib *unpacking,
const GLvoid *srcImage, GLvoid *dstImage )
{
- struct gl_texture_convert convert;
+ struct convert_info convert;
ASSERT( unpacking );
ASSERT( srcImage );
ASSERT( dstImage );
ASSERT( mesaFormat >= MESA_FORMAT_RGBA8888 );
- ASSERT( mesaFormat <= MESA_FORMAT_CI8 );
+ ASSERT( mesaFormat <= MESA_FORMAT_YCBCR_REV );
/* Make it easier to pass all the parameters around.
*/
@@ -760,7 +846,9 @@ _mesa_convert_texsubimage1d( GLint mesaFormat,
if ( convert_needs_unpacking( unpacking, format, type ) )
convert.index |= CONVERT_UNPACKING_BIT;
- return gl_convert_texsubimage2d_tab[mesaFormat]( &convert );
+ ASSERT(convert.index < 4);
+
+ return convert_texsubimage2d_tab[mesaFormat]( &convert );
}
@@ -790,22 +878,22 @@ _mesa_convert_texsubimage1d( GLint mesaFormat,
* destImage - pointer to dest image
*/
GLboolean
-_mesa_convert_texsubimage2d( GLint mesaFormat,
+_mesa_convert_texsubimage2d( GLint mesaFormat, /* dest */
GLint xoffset, GLint yoffset,
GLint width, GLint height,
GLint destImageWidth,
- GLenum format, GLenum type,
+ GLenum format, GLenum type, /* source */
const struct gl_pixelstore_attrib *unpacking,
const GLvoid *srcImage, GLvoid *dstImage )
{
- struct gl_texture_convert convert;
+ struct convert_info convert;
ASSERT( unpacking );
ASSERT( srcImage );
ASSERT( dstImage );
ASSERT( mesaFormat >= MESA_FORMAT_RGBA8888 );
- ASSERT( mesaFormat <= MESA_FORMAT_CI8 );
+ ASSERT( mesaFormat <= MESA_FORMAT_YCBCR_REV );
/* Make it easier to pass all the parameters around.
*/
@@ -828,26 +916,26 @@ _mesa_convert_texsubimage2d( GLint mesaFormat,
if ( width != destImageWidth )
convert.index |= CONVERT_STRIDE_BIT;
- return gl_convert_texsubimage2d_tab[mesaFormat]( &convert );
+ return convert_texsubimage2d_tab[mesaFormat]( &convert );
}
GLboolean
-_mesa_convert_texsubimage3d( GLint mesaFormat,
+_mesa_convert_texsubimage3d( GLint mesaFormat, /* dest */
GLint xoffset, GLint yoffset, GLint zoffset,
GLint width, GLint height, GLint depth,
GLint dstImageWidth, GLint dstImageHeight,
- GLenum format, GLenum type,
+ GLenum format, GLenum type, /* source */
const struct gl_pixelstore_attrib *unpacking,
const GLvoid *srcImage, GLvoid *dstImage )
{
- struct gl_texture_convert convert;
+ struct convert_info convert;
ASSERT( unpacking );
ASSERT( srcImage );
ASSERT( dstImage );
ASSERT( mesaFormat >= MESA_FORMAT_RGBA8888 );
- ASSERT( mesaFormat <= MESA_FORMAT_CI8 );
+ ASSERT( mesaFormat <= MESA_FORMAT_YCBCR_REV );
/* Make it easier to pass all the parameters around.
*/
@@ -873,7 +961,7 @@ _mesa_convert_texsubimage3d( GLint mesaFormat,
if ( width != dstImageWidth || height != dstImageHeight )
convert.index |= CONVERT_STRIDE_BIT;
- return gl_convert_texsubimage3d_tab[mesaFormat]( &convert );
+ return convert_texsubimage3d_tab[mesaFormat]( &convert );
}
diff --git a/xc/extras/Mesa/src/texutil.h b/xc/extras/Mesa/src/texutil.h
index 9a1be1ddb..97e629cfb 100644
--- a/xc/extras/Mesa/src/texutil.h
+++ b/xc/extras/Mesa/src/texutil.h
@@ -23,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Gareth Hughes <gareth@valinux.com>
+ * Gareth Hughes
*/
diff --git a/xc/extras/Mesa/src/texutil_tmp.h b/xc/extras/Mesa/src/texutil_tmp.h
index 34fbfd7cf..d6b94376b 100644
--- a/xc/extras/Mesa/src/texutil_tmp.h
+++ b/xc/extras/Mesa/src/texutil_tmp.h
@@ -1,5 +1,3 @@
-/* $Id: texutil_tmp.h,v 1.1.1.3 2002/10/22 13:05:37 alanh Exp $ */
-
/*
* Mesa 3-D graphics library
* Version: 4.0.2
@@ -24,11 +22,28 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Author:
- * Gareth Hughes <gareth@valinux.com>
+ * Gareth Hughes
*/
+
/*
- * NOTE: All 3D teximage code is untested and most definitely broken...
+ * For 2D and 3D texture images, we generate functions for
+ * - conversion without pixel unpacking and standard stride
+ * - conversion without pixel unpacking and non-standard stride
+ * - conversion with pixel unpacking and standard stride
+ * - conversion with pixel unpacking and non-standard stride
+ *
+ *
+ * Macros which need to be defined before including this file:
+ * TAG(x) - the function name wrapper
+ * DST_TYPE - the destination texel datatype (GLuint, GLushort, etc)
+ * DST_TEXELS_PER_DWORD - number of dest texels that'll fit in 4 bytes
+ * CONVERT_TEXEL - code to convert from source to dest texel
+ * CONVER_TEXEL_DWORD - if multiple texels fit in 4 bytes, this macros
+ * will convert/store multiple texels at once
+ * CONVERT_DIRECT - if defined, just memcpy texels from src to dest
+ * SRC_TEXEL_BYTES - bytes per source texel
+ * PRESERVE_DST_TYPE - if defined, don't undefined these macros at end
*/
@@ -43,7 +58,7 @@
* PRE: No pixelstore attribs, width == dstImageWidth.
*/
static GLboolean
-TAG(texsubimage2d)( struct gl_texture_convert *convert )
+TAG(texsubimage2d)( const struct convert_info *convert )
{
const GLubyte *src = (const GLubyte *)convert->srcImage;
GLuint *dst = (GLuint *)((GLubyte *)convert->dstImage +
@@ -51,7 +66,7 @@ TAG(texsubimage2d)( struct gl_texture_convert *convert )
convert->xoffset) * DST_TEXEL_BYTES);
#if DEBUG_TEXUTIL
- fprintf( stderr, __FUNCTION__ "\n" );
+ _mesa_debug( NULL, __FUNCTION__ "\n" );
#endif
#ifdef CONVERT_DIRECT
@@ -79,7 +94,7 @@ TAG(texsubimage2d)( struct gl_texture_convert *convert )
/* PRE: As above, height == dstImageHeight also.
*/
static GLboolean
-TAG(texsubimage3d)( struct gl_texture_convert *convert )
+TAG(texsubimage3d)( const struct convert_info *convert )
{
const GLubyte *src = (const GLubyte *)convert->srcImage;
GLuint *dst = (GLuint *)((GLubyte *)convert->dstImage +
@@ -87,7 +102,7 @@ TAG(texsubimage3d)( struct gl_texture_convert *convert )
convert->yoffset) * convert->width +
convert->xoffset) * DST_TEXEL_BYTES);
#if DEBUG_TEXUTIL
- fprintf( stderr, __FUNCTION__ "\n" );
+ _mesa_debug( NULL, __FUNCTION__ "\n" );
#endif
#ifdef CONVERT_DIRECT
@@ -118,7 +133,7 @@ TAG(texsubimage3d)( struct gl_texture_convert *convert )
* PRE: No pixelstore attribs, width != dstImageWidth.
*/
static GLboolean
-TAG(texsubimage2d_stride)( struct gl_texture_convert *convert )
+TAG(texsubimage2d_stride)( const struct convert_info *convert )
{
const GLubyte *src = (const GLubyte *)convert->srcImage;
DST_TYPE *dst = (DST_TYPE *)((GLubyte *)convert->dstImage +
@@ -130,11 +145,11 @@ TAG(texsubimage2d_stride)( struct gl_texture_convert *convert )
adjust = convert->dstImageWidth - convert->width;
#if DEBUG_TEXUTIL
- fprintf( stderr, __FUNCTION__ ":\n" );
- fprintf( stderr, " x=%d y=%d w=%d h=%d s=%d\n",
+ _mesa_debug( NULL, __FUNCTION__ ":\n" );
+ _mesa_debug( NULL, " x=%d y=%d w=%d h=%d s=%d\n",
convert->xoffset, convert->yoffset, convert->width,
convert->height, convert->dstImageWidth );
- fprintf( stderr, " adjust=%d\n", adjust );
+ _mesa_debug( NULL, " adjust=%d\n", adjust );
#endif
for ( row = 0 ; row < convert->height ; row++ ) {
@@ -151,7 +166,7 @@ TAG(texsubimage2d_stride)( struct gl_texture_convert *convert )
/* PRE: As above, or height != dstImageHeight also.
*/
static GLboolean
-TAG(texsubimage3d_stride)( struct gl_texture_convert *convert )
+TAG(texsubimage3d_stride)( const struct convert_info *convert )
{
const GLubyte *src = (const GLubyte *)convert->srcImage;
DST_TYPE *dst = (DST_TYPE *)((GLubyte *)convert->dstImage +
@@ -164,11 +179,11 @@ TAG(texsubimage3d_stride)( struct gl_texture_convert *convert )
adjust = convert->dstImageWidth - convert->width;
#if DEBUG_TEXUTIL
- fprintf( stderr, __FUNCTION__ ":\n" );
- fprintf( stderr, " x=%d y=%d w=%d h=%d s=%d\n",
+ _mesa_debug( NULL, __FUNCTION__ ":\n" );
+ _mesa_debug( NULL, " x=%d y=%d w=%d h=%d s=%d\n",
convert->xoffset, convert->yoffset, convert->width,
convert->height, convert->dstImageWidth );
- fprintf( stderr, " adjust=%d\n", adjust );
+ _mesa_debug( NULL, " adjust=%d\n", adjust );
#endif
for ( img = 0 ; img < convert->depth ; img++ ) {
@@ -191,7 +206,7 @@ TAG(texsubimage3d_stride)( struct gl_texture_convert *convert )
* PRE: Require pixelstore attribs, width == dstImageWidth.
*/
static GLboolean
-TAG(texsubimage2d_unpack)( struct gl_texture_convert *convert )
+TAG(texsubimage2d_unpack)( const struct convert_info *convert )
{
const GLubyte *src = (const GLubyte *)
_mesa_image_address( convert->unpacking, convert->srcImage,
@@ -203,7 +218,7 @@ TAG(texsubimage2d_unpack)( struct gl_texture_convert *convert )
GLint row, col;
#if DEBUG_TEXUTIL
- fprintf( stderr, __FUNCTION__ "\n" );
+ _mesa_debug( NULL, __FUNCTION__ "\n" );
#endif
if (convert->width & (DST_TEXELS_PER_DWORD - 1)) {
@@ -249,7 +264,7 @@ TAG(texsubimage2d_unpack)( struct gl_texture_convert *convert )
/* PRE: as above, height == dstImageHeight also.
*/
static GLboolean
-TAG(texsubimage3d_unpack)( struct gl_texture_convert *convert )
+TAG(texsubimage3d_unpack)( const struct convert_info *convert )
{
const GLubyte *src = (const GLubyte *)
_mesa_image_address( convert->unpacking, convert->srcImage,
@@ -265,7 +280,7 @@ TAG(texsubimage3d_unpack)( struct gl_texture_convert *convert )
GLint row, col, img;
#if DEBUG_TEXUTIL
- fprintf( stderr, __FUNCTION__ "\n" );
+ _mesa_debug( NULL, __FUNCTION__ "\n" );
#endif
if (convert->width & (DST_TEXELS_PER_DWORD - 1)) {
@@ -324,7 +339,7 @@ TAG(texsubimage3d_unpack)( struct gl_texture_convert *convert )
* PRE: Require pixelstore attribs, width != dstImageWidth.
*/
static GLboolean
-TAG(texsubimage2d_stride_unpack)( struct gl_texture_convert *convert )
+TAG(texsubimage2d_stride_unpack)( const struct convert_info *convert )
{
const GLubyte *src = (const GLubyte *)
_mesa_image_address( convert->unpacking, convert->srcImage,
@@ -343,11 +358,11 @@ TAG(texsubimage2d_stride_unpack)( struct gl_texture_convert *convert )
adjust = convert->dstImageWidth - convert->width;
#if DEBUG_TEXUTIL
- fprintf( stderr, __FUNCTION__ ":\n" );
- fprintf( stderr, " x=%d y=%d w=%d h=%d s=%d\n",
+ _mesa_debug( NULL, __FUNCTION__ ":\n" );
+ _mesa_debug( NULL, " x=%d y=%d w=%d h=%d s=%d\n",
convert->xoffset, convert->yoffset, convert->width,
convert->height, convert->dstImageWidth );
- fprintf( stderr, " adjust=%d\n", adjust );
+ _mesa_debug( NULL, " adjust=%d\n", adjust );
#endif
for ( row = 0 ; row < convert->height ; row++ ) {
@@ -372,7 +387,7 @@ TAG(texsubimage2d_stride_unpack)( struct gl_texture_convert *convert )
/* PRE: As above, or height != dstImageHeight also.
*/
static GLboolean
-TAG(texsubimage3d_stride_unpack)( struct gl_texture_convert *convert )
+TAG(texsubimage3d_stride_unpack)( const struct convert_info *convert )
{
const GLubyte *src = (const GLubyte *)
_mesa_image_address( convert->unpacking, convert->srcImage,
@@ -396,11 +411,11 @@ TAG(texsubimage3d_stride_unpack)( struct gl_texture_convert *convert )
adjust = convert->dstImageWidth - convert->width;
#if DEBUG_TEXUTIL
- fprintf( stderr, __FUNCTION__ ":\n" );
- fprintf( stderr, " x=%d y=%d w=%d h=%d s=%d\n",
+ _mesa_debug( NULL, __FUNCTION__ ":\n" );
+ _mesa_debug( NULL, " x=%d y=%d w=%d h=%d s=%d\n",
convert->xoffset, convert->yoffset, convert->width,
convert->height, convert->dstImageWidth );
- fprintf( stderr, " adjust=%d\n", adjust );
+ _mesa_debug( NULL, " adjust=%d\n", adjust );
#endif
for ( img = 0 ; img < convert->depth ; img++ ) {
diff --git a/xc/extras/Mesa/src/tnl/t_array_api.c b/xc/extras/Mesa/src/tnl/t_array_api.c
index 060203b81..60744a2d7 100644
--- a/xc/extras/Mesa/src/tnl/t_array_api.c
+++ b/xc/extras/Mesa/src/tnl/t_array_api.c
@@ -1,8 +1,7 @@
-/* $Id: t_array_api.c,v 1.1.1.1 2002/10/22 13:06:23 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -22,19 +21,22 @@
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF 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>
+ */
+
+/**
+ * \file vpexec.c
+ * \brief Vertex array API functions (glDrawArrays, etc)
+ * \author Keith Whitwell
*/
#include "glheader.h"
#include "api_validate.h"
#include "context.h"
+#include "imports.h"
#include "macros.h"
#include "mmath.h"
-#include "mem.h"
-#include "state.h"
#include "mtypes.h"
+#include "state.h"
#include "array_cache/acache.h"
@@ -77,7 +79,7 @@ static void _tnl_draw_range_elements( GLcontext *ctx, GLenum mode,
TNLcontext *tnl = TNL_CONTEXT(ctx);
FLUSH_CURRENT( ctx, 0 );
- /* fprintf(stderr, "%s\n", __FUNCTION__); */
+ /* _mesa_debug(ctx, "%s\n", __FUNCTION__); */
if (tnl->pipeline.build_state_changes)
_tnl_validate_pipeline( ctx );
@@ -101,7 +103,9 @@ static void _tnl_draw_range_elements( GLcontext *ctx, GLenum mode,
-
+/**
+ * Called via the GL API dispatcher.
+ */
void
_tnl_DrawArrays(GLenum mode, GLint start, GLsizei count)
{
@@ -111,7 +115,7 @@ _tnl_DrawArrays(GLenum mode, GLint start, GLsizei count)
GLuint thresh = (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES) ? 30 : 10;
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "_tnl_DrawArrays %d %d\n", start, count);
+ _mesa_debug(NULL, "_tnl_DrawArrays %d %d\n", start, count);
/* Check arguments, etc.
*/
@@ -130,43 +134,28 @@ _tnl_DrawArrays(GLenum mode, GLint start, GLsizei count)
*/
fallback_drawarrays( ctx, mode, start, start + count );
}
- else if (count < (GLint) ctx->Const.MaxArrayLockSize) {
- /* Moderate primitives which can fit in a single vertex buffer:
+ else if (ctx->Array.LockCount &&
+ count < (GLint) ctx->Const.MaxArrayLockSize) {
+
+ /* Locked primitives which can fit in a single vertex buffer:
*/
FLUSH_CURRENT( ctx, 0 );
- if (ctx->Array.LockCount)
- {
- if (start < (GLint) ctx->Array.LockFirst)
- start = ctx->Array.LockFirst;
- if (start + count > (GLint) ctx->Array.LockCount)
- count = ctx->Array.LockCount - start;
-
- /* Locked drawarrays. Reuse any previously transformed data.
- */
- _tnl_vb_bind_arrays( ctx, ctx->Array.LockFirst, ctx->Array.LockCount );
- VB->FirstPrimitive = start;
- VB->Primitive[start] = mode | PRIM_BEGIN | PRIM_END | PRIM_LAST;
- VB->PrimitiveLength[start] = count;
- tnl->Driver.RunPipeline( ctx );
- } else {
- /* The arrays are small enough to fit in a single VB; just bind
- * them and go. Any untransformed data will be copied on
- * clipping.
- *
- * Invalidate any cached data dependent on these arrays.
- */
- _tnl_vb_bind_arrays( ctx, start, start + count );
- VB->FirstPrimitive = 0;
- VB->Primitive[0] = mode | PRIM_BEGIN | PRIM_END | PRIM_LAST;
- VB->PrimitiveLength[0] = count;
- tnl->pipeline.run_input_changes |= ctx->Array._Enabled;
- tnl->Driver.RunPipeline( ctx );
- tnl->pipeline.run_input_changes |= ctx->Array._Enabled;
- }
- }
+ if (start < (GLint) ctx->Array.LockFirst)
+ start = ctx->Array.LockFirst;
+ if (start + count > (GLint) ctx->Array.LockCount)
+ count = ctx->Array.LockCount - start;
+
+ /* Locked drawarrays. Reuse any previously transformed data.
+ */
+ _tnl_vb_bind_arrays( ctx, ctx->Array.LockFirst, ctx->Array.LockCount );
+ VB->FirstPrimitive = start;
+ VB->Primitive[start] = mode | PRIM_BEGIN | PRIM_END | PRIM_LAST;
+ VB->PrimitiveLength[start] = count;
+ tnl->Driver.RunPipeline( ctx );
+ }
else {
- int bufsz = 256; /* use a small buffer for cache goodness */
+ int bufsz = 256; /* Use a small buffer for cache goodness */
int j, nr;
int minimum, modulo, skip;
@@ -178,10 +167,12 @@ _tnl_DrawArrays(GLenum mode, GLint start, GLsizei count)
minimum = 0;
modulo = 1;
skip = 0;
+ break;
case GL_LINES:
minimum = 1;
modulo = 2;
skip = 1;
+ break;
case GL_LINE_STRIP:
minimum = 1;
modulo = 1;
@@ -212,10 +203,19 @@ _tnl_DrawArrays(GLenum mode, GLint start, GLsizei count)
case GL_POLYGON:
default:
/* Primitives requiring a copied vertex (fan-like primitives)
- * must use the slow path:
+ * must use the slow path if they cannot fit in a single
+ * vertex buffer.
*/
- fallback_drawarrays( ctx, mode, start, start + count );
- return;
+ if (count < (GLint) ctx->Const.MaxArrayLockSize) {
+ bufsz = ctx->Const.MaxArrayLockSize;
+ minimum = 0;
+ modulo = 1;
+ skip = 0;
+ }
+ else {
+ fallback_drawarrays( ctx, mode, start, start + count );
+ return;
+ }
}
FLUSH_CURRENT( ctx, 0 );
@@ -241,6 +241,9 @@ _tnl_DrawArrays(GLenum mode, GLint start, GLsizei count)
}
+/**
+ * Called via the GL API dispatcher.
+ */
void
_tnl_DrawRangeElements(GLenum mode,
GLuint start, GLuint end,
@@ -250,7 +253,7 @@ _tnl_DrawRangeElements(GLenum mode,
GLuint *ui_indices;
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "_tnl_DrawRangeElements %d %d %d\n", start, end, count);
+ _mesa_debug(NULL, "_tnl_DrawRangeElements %d %d %d\n", start, end, count);
/* Check arguments, etc.
*/
@@ -306,6 +309,9 @@ _tnl_DrawRangeElements(GLenum mode,
+/**
+ * Called via the GL API dispatcher.
+ */
void
_tnl_DrawElements(GLenum mode, GLsizei count, GLenum type,
const GLvoid *indices)
@@ -314,7 +320,7 @@ _tnl_DrawElements(GLenum mode, GLsizei count, GLenum type,
GLuint *ui_indices;
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "_tnl_DrawElements %d\n", count);
+ _mesa_debug(NULL, "_tnl_DrawElements %d\n", count);
/* Check arguments, etc.
*/
@@ -354,6 +360,10 @@ _tnl_DrawElements(GLenum mode, GLsizei count, GLenum type,
}
+/**
+ * Initialize context's vertex array fields. Called during T 'n L context
+ * creation.
+ */
void _tnl_array_init( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
@@ -368,8 +378,8 @@ void _tnl_array_init( GLcontext *ctx )
/* Setup vector pointers that will be used to bind arrays to VB's.
*/
_mesa_vector4f_init( &tmp->Obj, 0, 0 );
- _mesa_vector3f_init( &tmp->Normal, 0, 0 );
- _mesa_vector1f_init( &tmp->FogCoord, 0, 0 );
+ _mesa_vector4f_init( &tmp->Normal, 0, 0 );
+ _mesa_vector4f_init( &tmp->FogCoord, 0, 0 );
_mesa_vector1ui_init( &tmp->Index, 0, 0 );
_mesa_vector1ub_init( &tmp->EdgeFlag, 0, 0 );
@@ -381,6 +391,10 @@ void _tnl_array_init( GLcontext *ctx )
}
+/**
+ * Destroy the context's vertex array stuff.
+ * Called during T 'n L context destruction.
+ */
void _tnl_array_destroy( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
diff --git a/xc/extras/Mesa/src/tnl/t_array_import.c b/xc/extras/Mesa/src/tnl/t_array_import.c
index 7bcdac975..6f62aa398 100644
--- a/xc/extras/Mesa/src/tnl/t_array_import.c
+++ b/xc/extras/Mesa/src/tnl/t_array_import.c
@@ -1,10 +1,9 @@
-/* $Id: t_array_import.c,v 1.1.1.1 2002/10/22 13:06:18 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,13 +23,13 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#include "glheader.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "state.h"
#include "mtypes.h"
@@ -81,7 +80,7 @@ static void _tnl_import_normal( GLcontext *ctx,
stride ? 3*sizeof(GLfloat) : 0, writeable,
&is_writeable);
- inputs->Normal.data = (GLfloat (*)[3]) tmp->Ptr;
+ inputs->Normal.data = (GLfloat (*)[4]) tmp->Ptr;
inputs->Normal.start = (GLfloat *) tmp->Ptr;
inputs->Normal.stride = tmp->StrideB;
inputs->Normal.flags &= ~(VEC_BAD_STRIDE|VEC_NOT_WRITEABLE);
@@ -143,7 +142,7 @@ static void _tnl_import_fogcoord( GLcontext *ctx,
stride ? sizeof(GLfloat) : 0, writeable,
&is_writeable);
- inputs->FogCoord.data = (GLfloat *) tmp->Ptr;
+ inputs->FogCoord.data = (GLfloat (*)[4]) tmp->Ptr;
inputs->FogCoord.start = (GLfloat *) tmp->Ptr;
inputs->FogCoord.stride = tmp->StrideB;
inputs->FogCoord.flags &= ~(VEC_BAD_STRIDE|VEC_NOT_WRITEABLE);
@@ -177,7 +176,7 @@ static void _tnl_import_index( GLcontext *ctx,
static void _tnl_import_texcoord( GLcontext *ctx,
- GLuint i,
+ GLuint unit,
GLboolean writeable,
GLboolean stride )
{
@@ -185,21 +184,21 @@ static void _tnl_import_texcoord( GLcontext *ctx,
struct gl_client_array *tmp;
GLboolean is_writeable = 0;
- tmp = _ac_import_texcoord(ctx, i, GL_FLOAT,
- stride ? 4*sizeof(GLfloat) : 0,
+ tmp = _ac_import_texcoord(ctx, unit, GL_FLOAT,
+ stride ? 4 * sizeof(GLfloat) : 0,
0,
writeable,
&is_writeable);
- inputs->TexCoord[i].data = (GLfloat (*)[4]) tmp->Ptr;
- inputs->TexCoord[i].start = (GLfloat *) tmp->Ptr;
- inputs->TexCoord[i].stride = tmp->StrideB;
- inputs->TexCoord[i].size = tmp->Size;
- inputs->TexCoord[i].flags &= ~(VEC_BAD_STRIDE|VEC_NOT_WRITEABLE);
- if (inputs->TexCoord[i].stride != 4*sizeof(GLfloat))
- inputs->TexCoord[i].flags |= VEC_BAD_STRIDE;
+ inputs->TexCoord[unit].data = (GLfloat (*)[4]) tmp->Ptr;
+ inputs->TexCoord[unit].start = (GLfloat *) tmp->Ptr;
+ inputs->TexCoord[unit].stride = tmp->StrideB;
+ inputs->TexCoord[unit].size = tmp->Size;
+ inputs->TexCoord[unit].flags &= ~(VEC_BAD_STRIDE|VEC_NOT_WRITEABLE);
+ if (inputs->TexCoord[unit].stride != 4*sizeof(GLfloat))
+ inputs->TexCoord[unit].flags |= VEC_BAD_STRIDE;
if (!is_writeable)
- inputs->TexCoord[i].flags |= VEC_NOT_WRITEABLE;
+ inputs->TexCoord[unit].flags |= VEC_NOT_WRITEABLE;
}
@@ -228,9 +227,40 @@ static void _tnl_import_edgeflag( GLcontext *ctx,
-/* Callback for VB stages that need to improve the quality of arrays
+static void _tnl_import_attrib( GLcontext *ctx,
+ GLuint index,
+ GLboolean writeable,
+ GLboolean stride )
+{
+ struct vertex_arrays *inputs = &TNL_CONTEXT(ctx)->array_inputs;
+ struct gl_client_array *tmp;
+ GLboolean is_writeable = 0;
+
+ tmp = _ac_import_attrib(ctx, index, GL_FLOAT,
+ stride ? 4 * sizeof(GLfloat) : 0,
+ 4, /* want GLfloat[4] */
+ writeable,
+ &is_writeable);
+
+ inputs->Attribs[index].data = (GLfloat (*)[4]) tmp->Ptr;
+ inputs->Attribs[index].start = (GLfloat *) tmp->Ptr;
+ inputs->Attribs[index].stride = tmp->StrideB;
+ inputs->Attribs[index].size = tmp->Size;
+ inputs->Attribs[index].flags &= ~(VEC_BAD_STRIDE|VEC_NOT_WRITEABLE);
+ if (inputs->Attribs[index].stride != 4 * sizeof(GLfloat))
+ inputs->Attribs[index].flags |= VEC_BAD_STRIDE;
+ if (!is_writeable)
+ inputs->Attribs[index].flags |= VEC_NOT_WRITEABLE;
+}
+
+
+
+/**
+ * Callback for VB stages that need to improve the quality of arrays
* bound to the VB. This is only necessary for client arrays which
* have not been transformed at any point in the pipeline.
+ * \param required - bitmask of VERT_*_BIT flags
+ * \param flags - bitmask of VEC_* flags (ex: VEC_NOT_WRITABLE)
*/
static void _tnl_upgrade_client_data( GLcontext *ctx,
GLuint required,
@@ -246,56 +276,58 @@ static void _tnl_upgrade_client_data( GLcontext *ctx,
if (writeable || stride) ca_flags |= CA_CLIENT_DATA;
- if ((required & VERT_CLIP) && VB->ClipPtr == VB->ObjPtr)
- required |= VERT_OBJ;
+ if ((required & VERT_BIT_CLIP) && VB->ClipPtr == VB->ObjPtr)
+ required |= VERT_BIT_POS;
/* _tnl_print_vert_flags("_tnl_upgrade_client_data", required); */
- if ((required & VERT_OBJ) && (VB->ObjPtr->flags & flags)) {
+ if ((required & VERT_BIT_POS) && (VB->ObjPtr->flags & flags)) {
ASSERT(VB->ObjPtr == &inputs->Obj);
_tnl_import_vertex( ctx, writeable, stride );
- VB->importable_data &= ~(VERT_OBJ|VERT_CLIP);
+ VB->importable_data &= ~(VERT_BIT_POS|VERT_BIT_CLIP);
}
- if ((required & VERT_NORM) && (VB->NormalPtr->flags & flags)) {
+ if ((required & VERT_BIT_NORMAL) && (VB->NormalPtr->flags & flags)) {
ASSERT(VB->NormalPtr == &inputs->Normal);
_tnl_import_normal( ctx, writeable, stride );
- VB->importable_data &= ~VERT_NORM;
+ VB->importable_data &= ~VERT_BIT_NORMAL;
}
- if ((required & VERT_RGBA) && (VB->ColorPtr[0]->Flags & ca_flags)) {
+ if ((required & VERT_BIT_COLOR0) && (VB->ColorPtr[0]->Flags & ca_flags)) {
ASSERT(VB->ColorPtr[0] == &inputs->Color);
_tnl_import_color( ctx, GL_FLOAT, writeable, stride );
- VB->importable_data &= ~VERT_RGBA;
+ VB->importable_data &= ~VERT_BIT_COLOR0;
}
- if ((required & VERT_SPEC_RGB) &&
+ if ((required & VERT_BIT_COLOR1) &&
(VB->SecondaryColorPtr[0]->Flags & ca_flags)) {
ASSERT(VB->SecondaryColorPtr[0] == &inputs->SecondaryColor);
_tnl_import_secondarycolor( ctx, GL_FLOAT, writeable, stride );
- VB->importable_data &= ~VERT_SPEC_RGB;
+ VB->importable_data &= ~VERT_BIT_COLOR1;
}
- if ((required & VERT_FOG_COORD) && (VB->FogCoordPtr->flags & flags)) {
+ if ((required & VERT_BIT_FOG)
+ && (VB->FogCoordPtr->flags & flags)) {
ASSERT(VB->FogCoordPtr == &inputs->FogCoord);
_tnl_import_fogcoord( ctx, writeable, stride );
- VB->importable_data &= ~VERT_FOG_COORD;
+ VB->importable_data &= ~VERT_BIT_FOG;
}
- if ((required & VERT_INDEX) && (VB->IndexPtr[0]->flags & flags)) {
+ if ((required & VERT_BIT_INDEX) && (VB->IndexPtr[0]->flags & flags)) {
ASSERT(VB->IndexPtr[0] == &inputs->Index);
_tnl_import_index( ctx, writeable, stride );
- VB->importable_data &= ~VERT_INDEX;
+ VB->importable_data &= ~VERT_BIT_INDEX;
}
- if (required & VERT_TEX_ANY)
+ if (required & VERT_BITS_TEX_ANY)
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
- if ((required & VERT_TEX(i)) && (VB->TexCoordPtr[i]->flags & flags)) {
+ if ((required & VERT_BIT_TEX(i)) && (VB->TexCoordPtr[i]->flags & flags)) {
ASSERT(VB->TexCoordPtr[i] == &inputs->TexCoord[i]);
_tnl_import_texcoord( ctx, i, writeable, stride );
- VB->importable_data &= ~VERT_TEX(i);
+ VB->importable_data &= ~VERT_BIT_TEX(i);
}
+ /* XXX not sure what to do here for vertex program arrays */
}
@@ -306,24 +338,23 @@ void _tnl_vb_bind_arrays( GLcontext *ctx, GLint start, GLsizei count )
struct vertex_buffer *VB = &tnl->vb;
GLuint inputs = tnl->pipeline.inputs;
struct vertex_arrays *tmp = &tnl->array_inputs;
- GLuint i;
-/* fprintf(stderr, "%s %d..%d // %d..%d\n", __FUNCTION__, */
+/* _mesa_debug(ctx, "%s %d..%d // %d..%d\n", __FUNCTION__, */
/* start, count, ctx->Array.LockFirst, ctx->Array.LockCount); */
/* _tnl_print_vert_flags(" inputs", inputs); */
/* _tnl_print_vert_flags(" _Enabled", ctx->Array._Enabled); */
-/* _tnl_print_vert_flags(" importable", inputs & VERT_FIXUP); */
+/* _tnl_print_vert_flags(" importable", inputs & VERT_BITS_FIXUP); */
VB->Count = count - start;
VB->FirstClipped = VB->Count;
- VB->Elts = 0;
- VB->MaterialMask = 0;
- VB->Material = 0;
- VB->Flag = 0;
+ VB->Elts = NULL;
+ VB->MaterialMask = NULL;
+ VB->Material = NULL;
+ VB->Flag = NULL;
VB->Primitive = tnl->tmp_primitive;
VB->PrimitiveLength = tnl->tmp_primitive_length;
VB->import_data = _tnl_upgrade_client_data;
- VB->importable_data = inputs & VERT_FIXUP;
+ VB->importable_data = inputs & VERT_BITS_FIXUP;
if (ctx->Array.LockCount) {
ASSERT(start == (GLint) ctx->Array.LockFirst);
@@ -332,59 +363,69 @@ void _tnl_vb_bind_arrays( GLcontext *ctx, GLint start, GLsizei count )
_ac_import_range( ctx, start, count );
- if (inputs & VERT_OBJ) {
+ if (inputs & VERT_BIT_POS) {
_tnl_import_vertex( ctx, 0, 0 );
tmp->Obj.count = VB->Count;
VB->ObjPtr = &tmp->Obj;
}
- if (inputs & VERT_NORM) {
+ if (inputs & VERT_BIT_NORMAL) {
_tnl_import_normal( ctx, 0, 0 );
tmp->Normal.count = VB->Count;
VB->NormalPtr = &tmp->Normal;
}
- if (inputs & VERT_RGBA) {
+ if (inputs & VERT_BIT_COLOR0) {
_tnl_import_color( ctx, 0, 0, 0 );
VB->ColorPtr[0] = &tmp->Color;
VB->ColorPtr[1] = 0;
}
- if (inputs & VERT_TEX_ANY) {
- for (i = 0; i < ctx->Const.MaxTextureUnits ; i++) {
- if (inputs & VERT_TEX(i)) {
- _tnl_import_texcoord( ctx, i, 0, 0 );
- tmp->TexCoord[i].count = VB->Count;
- VB->TexCoordPtr[i] = &tmp->TexCoord[i];
+ if (inputs & VERT_BITS_TEX_ANY) {
+ GLuint unit;
+ for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
+ if (inputs & VERT_BIT_TEX(unit)) {
+ _tnl_import_texcoord( ctx, unit, GL_FALSE, GL_FALSE );
+ tmp->TexCoord[unit].count = VB->Count;
+ VB->TexCoordPtr[unit] = &tmp->TexCoord[unit];
}
}
}
- if (inputs & (VERT_INDEX|VERT_FOG_COORD|VERT_EDGE|VERT_SPEC_RGB)) {
- if (inputs & VERT_INDEX) {
+ if (inputs & (VERT_BIT_INDEX | VERT_BIT_FOG |
+ VERT_BIT_EDGEFLAG | VERT_BIT_COLOR1)) {
+ if (inputs & VERT_BIT_INDEX) {
_tnl_import_index( ctx, 0, 0 );
tmp->Index.count = VB->Count;
VB->IndexPtr[0] = &tmp->Index;
VB->IndexPtr[1] = 0;
}
- if (inputs & VERT_FOG_COORD) {
+ if (inputs & VERT_BIT_FOG) {
_tnl_import_fogcoord( ctx, 0, 0 );
tmp->FogCoord.count = VB->Count;
VB->FogCoordPtr = &tmp->FogCoord;
}
- if (inputs & VERT_EDGE) {
+ if (inputs & VERT_BIT_EDGEFLAG) {
_tnl_import_edgeflag( ctx, GL_TRUE, sizeof(GLboolean) );
VB->EdgeFlag = (GLboolean *) tmp->EdgeFlag.data;
}
- if (inputs & VERT_SPEC_RGB) {
+ if (inputs & VERT_BIT_COLOR1) {
_tnl_import_secondarycolor( ctx, 0, 0, 0 );
VB->SecondaryColorPtr[0] = &tmp->SecondaryColor;
VB->SecondaryColorPtr[1] = 0;
}
}
-}
-
+ /* XXX not 100% sure this is finished. Keith should probably inspect. */
+ if (ctx->VertexProgram.Enabled) {
+ GLuint index;
+ for (index = 0; index < VERT_ATTRIB_MAX; index++) {
+ /* XXX check program->InputsRead to reduce work here */
+ _tnl_import_attrib( ctx, index, GL_FALSE, GL_TRUE );
+ VB->AttribPtr[index] = &tmp->Attribs[index];
+ }
+ }
+}
diff --git a/xc/extras/Mesa/src/tnl/t_context.c b/xc/extras/Mesa/src/tnl/t_context.c
index 029a22368..906953712 100644
--- a/xc/extras/Mesa/src/tnl/t_context.c
+++ b/xc/extras/Mesa/src/tnl/t_context.c
@@ -1,10 +1,9 @@
-/* $Id: t_context.c,v 1.1.1.1 2002/10/22 13:06:16 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,14 +23,14 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#include "glheader.h"
+#include "imports.h"
#include "macros.h"
#include "mtypes.h"
-#include "mem.h"
#include "dlist.h"
#include "light.h"
#include "vtxfmt.h"
@@ -103,7 +102,7 @@ _tnl_CreateContext( GLcontext *ctx )
_tnl_install_pipeline( ctx, _tnl_default_pipeline );
- tnl->NeedProjCoords = GL_TRUE;
+ tnl->NeedNdcCoords = GL_TRUE;
tnl->LoopbackDListCassettes = GL_FALSE;
tnl->CalcDListNormalLengths = GL_TRUE;
@@ -196,7 +195,7 @@ _tnl_wakeup_exec( GLcontext *ctx )
tnl->pipeline.run_input_changes = ~0;
if (ctx->Light.ColorMaterialEnabled) {
- _mesa_update_color_material( ctx, ctx->Current.Color );
+ _mesa_update_color_material( ctx, ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
}
}
@@ -216,8 +215,8 @@ void
_tnl_need_projected_coords( GLcontext *ctx, GLboolean mode )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
- if (tnl->NeedProjCoords != mode) {
- tnl->NeedProjCoords = mode;
+ if (tnl->NeedNdcCoords != mode) {
+ tnl->NeedNdcCoords = mode;
_tnl_InvalidateState( ctx, _NEW_PROJECTION );
}
}
diff --git a/xc/extras/Mesa/src/tnl/t_context.h b/xc/extras/Mesa/src/tnl/t_context.h
index c301934f2..396406ccb 100644
--- a/xc/extras/Mesa/src/tnl/t_context.h
+++ b/xc/extras/Mesa/src/tnl/t_context.h
@@ -1,10 +1,9 @@
-/* $Id: t_context.h,v 1.1.1.1 2002/10/22 13:06:17 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -22,9 +21,12 @@
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Author:
- * Keith Whitwell <keithw@valinux.com>
+ */
+
+/**
+ * \file t_context.h
+ * \brief TnL module datatypes and definitions.
+ * \author Keith Whitwell
*/
#ifndef _T_CONTEXT_H
@@ -58,110 +60,94 @@
/* Flags to be added to the primitive enum in VB->Primitive.
*/
-#define PRIM_MODE_MASK 0xff /* Extract the actual primitive */
-#define PRIM_BEGIN 0x100 /* The prim starts here (not wrapped) */
-#define PRIM_END 0x200 /* The prim ends in this VB (does not wrap) */
-#define PRIM_PARITY 0x400 /* The prim wrapped on an odd number of verts */
-#define PRIM_LAST 0x800 /* No more prims in the VB */
+#define PRIM_MODE_MASK 0xff /* Extract the actual primitive */
+#define PRIM_BEGIN 0x100 /* The prim starts here (not wrapped) */
+#define PRIM_END 0x200 /* The prim ends in this VB (does not wrap) */
+#define PRIM_PARITY 0x400 /* The prim wrapped on an odd number of verts */
+#define PRIM_LAST 0x800 /* No more prims in the VB */
-/* Flags that describe the inputs and outputs of pipeline stages, and
- * the contents of a vertex-cassette.
- *
- * 5 spare flags, rearrangement of eval flags can secure at least 3
- * more.
+/**
+ * Flags that describe the inputs and outputs of pipeline stages, and
+ * the contents of a vertex-cassette. We reuse the VERT_BIT_* flags
+ * defined in mtypes.h and add a bunch of new ones.
*/
-#define VERT_OBJ _NEW_ARRAY_VERTEX
-#define VERT_RGBA _NEW_ARRAY_COLOR
-#define VERT_NORM _NEW_ARRAY_NORMAL
-#define VERT_INDEX _NEW_ARRAY_INDEX
-#define VERT_EDGE _NEW_ARRAY_EDGEFLAG
-#define VERT_SPEC_RGB _NEW_ARRAY_SECONDARYCOLOR
-#define VERT_FOG_COORD _NEW_ARRAY_FOGCOORD
-#define VERT_TEX0 _NEW_ARRAY_TEXCOORD_0
-#define VERT_TEX1 _NEW_ARRAY_TEXCOORD_1
-#define VERT_TEX2 _NEW_ARRAY_TEXCOORD_2
-#define VERT_TEX3 _NEW_ARRAY_TEXCOORD_3
-#define VERT_TEX4 _NEW_ARRAY_TEXCOORD_4
-#define VERT_TEX5 _NEW_ARRAY_TEXCOORD_5
-#define VERT_TEX6 _NEW_ARRAY_TEXCOORD_6
-#define VERT_TEX7 _NEW_ARRAY_TEXCOORD_7
-#define VERT_EVAL_C1 0x8000 /* imm only */
-#define VERT_EVAL_C2 0x10000 /* imm only */
-#define VERT_EVAL_P1 0x20000 /* imm only */
-#define VERT_EVAL_P2 0x40000 /* imm only */
-#define VERT_OBJ_3 0x80000 /* imm only */
-#define VERT_OBJ_4 0x100000 /* imm only */
-#define VERT_MATERIAL 0x200000 /* imm only, but tested in vb code */
-#define VERT_ELT 0x400000 /* imm only */
-#define VERT_BEGIN 0x800000 /* imm only, but tested in vb code */
-#define VERT_END 0x1000000 /* imm only, but tested in vb code */
-#define VERT_END_VB 0x2000000 /* imm only, but tested in vb code */
-#define VERT_POINT_SIZE 0x4000000 /* vb only, could reuse a bit */
-#define VERT_EYE VERT_BEGIN /* vb only, reuse imm bit */
-#define VERT_CLIP VERT_END /* vb only, reuse imm bit*/
+/* bits 0..5 defined in mtypes.h */
+#define VERT_BIT_INDEX VERT_BIT_SIX /* a free vertex attrib bit */
+#define VERT_BIT_EDGEFLAG VERT_BIT_SEVEN /* a free vertex attrib bit */
+/* bits 8..15 defined in mtypes.h */
+#define VERT_BIT_EVAL_C1 (1 << 16) /* imm only */
+#define VERT_BIT_EVAL_C2 (1 << 17) /* imm only */
+#define VERT_BIT_EVAL_P1 (1 << 18) /* imm only */
+#define VERT_BIT_EVAL_P2 (1 << 19) /* imm only */
+#define VERT_BIT_OBJ_3 (1 << 20) /* imm only */
+#define VERT_BIT_OBJ_4 (1 << 21) /* imm only */
+#define VERT_BIT_MATERIAL (1 << 22) /* imm only, but tested in vb code */
+#define VERT_BIT_ELT (1 << 23) /* imm only */
+#define VERT_BIT_BEGIN (1 << 24) /* imm only, but tested in vb code */
+#define VERT_BIT_END (1 << 25) /* imm only, but tested in vb code */
+#define VERT_BIT_END_VB (1 << 26) /* imm only, but tested in vb code */
+#define VERT_BIT_POINT_SIZE (1 << 27) /* vb only, could reuse a bit */
+#define VERT_BIT_EYE VERT_BIT_BEGIN /* vb only, reuse imm bit */
+#define VERT_BIT_CLIP VERT_BIT_END /* vb only, reuse imm bit*/
/* Flags for IM->TexCoordSize. Enough flags for 16 units.
*/
-#define TEX_0_SIZE_3 (GLuint) 0x1
-#define TEX_0_SIZE_4 (GLuint) 0x1001
-#define TEX_SIZE_3(unit) (TEX_0_SIZE_3<<unit)
-#define TEX_SIZE_4(unit) (TEX_0_SIZE_4<<unit)
+#define TEX_0_SIZE_3 (unsigned)0x1
+#define TEX_0_SIZE_4 (unsigned)0x10001
+#define TEX_SIZE_3(unit) (TEX_0_SIZE_3 << (unit))
+#define TEX_SIZE_4(unit) (TEX_0_SIZE_4 << (unit))
/* Shorthands.
*/
-#define VERT_EVAL_ANY (VERT_EVAL_C1|VERT_EVAL_P1| \
- VERT_EVAL_C2|VERT_EVAL_P2)
-
-#define VERT_OBJ_23 (VERT_OBJ_3|VERT_OBJ)
-#define VERT_OBJ_234 (VERT_OBJ_4|VERT_OBJ_23)
-
-#define VERT_TEX0_SHIFT 11
-
-#define VERT_TEX(i) (VERT_TEX0 << i)
-
-#define VERT_TEX_ANY (VERT_TEX0 | \
- VERT_TEX1 | \
- VERT_TEX2 | \
- VERT_TEX3 | \
- VERT_TEX4 | \
- VERT_TEX5 | \
- VERT_TEX6 | \
- VERT_TEX7)
-
-#define VERT_FIXUP (VERT_TEX_ANY | \
- VERT_RGBA | \
- VERT_SPEC_RGB | \
- VERT_FOG_COORD | \
- VERT_INDEX | \
- VERT_EDGE | \
- VERT_NORM)
-
-#define VERT_CURRENT_DATA (VERT_FIXUP | \
- VERT_MATERIAL)
-
-#define VERT_DATA (VERT_TEX_ANY | \
- VERT_RGBA | \
- VERT_SPEC_RGB | \
- VERT_FOG_COORD | \
- VERT_INDEX | \
- VERT_EDGE | \
- VERT_NORM | \
- VERT_OBJ | \
- VERT_MATERIAL | \
- VERT_ELT | \
- VERT_EVAL_ANY)
-
-
-/* KW: Represents everything that can take place between a begin and
+#define VERT_BITS_OBJ_23 (VERT_BIT_POS | VERT_BIT_OBJ_3)
+#define VERT_BITS_OBJ_234 (VERT_BIT_POS | VERT_BIT_OBJ_3 | VERT_BIT_OBJ_4)
+
+#define VERT_BITS_TEX_ANY (VERT_BIT_TEX0 | \
+ VERT_BIT_TEX1 | \
+ VERT_BIT_TEX2 | \
+ VERT_BIT_TEX3 | \
+ VERT_BIT_TEX4 | \
+ VERT_BIT_TEX5 | \
+ VERT_BIT_TEX6 | \
+ VERT_BIT_TEX7)
+
+#define VERT_BITS_EVAL_ANY (VERT_BIT_EVAL_C1 | VERT_BIT_EVAL_P1 | \
+ VERT_BIT_EVAL_C2 | VERT_BIT_EVAL_P2)
+
+#define VERT_BITS_FIXUP (VERT_BITS_TEX_ANY | \
+ VERT_BIT_COLOR0 | \
+ VERT_BIT_COLOR1 | \
+ VERT_BIT_FOG | \
+ VERT_BIT_INDEX | \
+ VERT_BIT_EDGEFLAG | \
+ VERT_BIT_NORMAL)
+
+#define VERT_BITS_CURRENT_DATA (VERT_BITS_FIXUP | \
+ VERT_BIT_MATERIAL)
+
+#define VERT_BITS_DATA (VERT_BITS_TEX_ANY | \
+ VERT_BIT_COLOR0 | \
+ VERT_BIT_COLOR1 | \
+ VERT_BIT_FOG | \
+ VERT_BIT_INDEX | \
+ VERT_BIT_EDGEFLAG | \
+ VERT_BIT_NORMAL | \
+ VERT_BIT_POS | \
+ VERT_BIT_MATERIAL | \
+ VERT_BIT_ELT | \
+ VERT_BITS_EVAL_ANY)
+
+
+/**
+ * KW: Represents everything that can take place between a begin and
* end, and can represent multiple begin/end pairs. Can be used to
* losslessly encode this information in display lists.
*/
struct immediate
{
- struct __GLcontextRec *backref;
GLuint id, ref_count;
/* This must be saved when immediates are shared in display lists.
@@ -200,41 +186,44 @@ struct immediate
GLuint MaterialOrMask;
GLuint MaterialAndMask;
- GLfloat (*TexCoord[MAX_TEXTURE_UNITS])[4];
-
- GLuint Primitive[IMM_SIZE]; /* BEGIN/END */
+ GLuint Primitive[IMM_SIZE]; /* BEGIN/END */
GLuint PrimitiveLength[IMM_SIZE]; /* BEGIN/END */
- GLuint Flag[IMM_SIZE]; /* VERT_* flags */
- GLfloat Color[IMM_SIZE][4];
- GLfloat Obj[IMM_SIZE][4];
- GLfloat Normal[IMM_SIZE][3];
- GLfloat *NormalLengthPtr;
- GLfloat TexCoord0[IMM_SIZE][4]; /* just VERT_TEX0 */
+ GLuint Flag[IMM_SIZE]; /* VERT_BIT_* flags */
+
+ /* All vertex attributes (position, normal, color, secondary color,
+ * texcoords, fog coord) are stored in the Attrib[] arrays instead
+ * of individual arrays as we did prior to Mesa 4.1.
+ *
+ * XXX may need to use 32-byte aligned allocation for this!!!
+ */
+ GLfloat Attrib[VERT_ATTRIB_MAX][IMM_SIZE][4]; /* GL_NV_vertex_program */
+
+ GLfloat *NormalLengthPtr; /* length of normal vectors (display list only) */
+
GLuint Elt[IMM_SIZE];
GLubyte EdgeFlag[IMM_SIZE];
GLuint Index[IMM_SIZE];
- GLfloat SecondaryColor[IMM_SIZE][4];
- GLfloat FogCoord[IMM_SIZE];
};
struct vertex_arrays
{
+ /* XXX move a bunch of these fields into the Attribs[] array??? */
GLvector4f Obj;
- GLvector3f Normal;
+ GLvector4f Normal;
struct gl_client_array Color;
struct gl_client_array SecondaryColor;
GLvector1ui Index;
GLvector1ub EdgeFlag;
GLvector4f TexCoord[MAX_TEXTURE_UNITS];
GLvector1ui Elt;
- GLvector1f FogCoord;
+ GLvector4f FogCoord;
+ GLvector4f Attribs[VERT_ATTRIB_MAX];
};
-typedef struct gl_material GLmaterial;
-
-/* Contains the current state of a running pipeline.
+/**
+ * Contains the current state of a running pipeline.
*/
typedef struct vertex_buffer
{
@@ -244,34 +233,36 @@ typedef struct vertex_buffer
/* Constant over the pipeline.
*/
- GLuint Count; /* for everything except Elts */
- GLuint FirstClipped; /* temp verts for clipping */
- GLuint FirstPrimitive; /* usually zero */
+ GLuint Count; /* for everything except Elts */
+ GLuint FirstClipped; /* temp verts for clipping */
+ GLuint FirstPrimitive; /* usually zero */
/* Pointers to current data.
*/
- GLuint *Elts; /* VERT_ELT */
- GLvector4f *ObjPtr; /* VERT_OBJ */
- GLvector4f *EyePtr; /* VERT_EYE */
- GLvector4f *ClipPtr; /* VERT_CLIP */
- GLvector4f *ProjectedClipPtr; /* VERT_CLIP (2) */
- GLubyte ClipOrMask; /* VERT_CLIP (3) */
- GLubyte *ClipMask; /* VERT_CLIP (4) */
- GLvector3f *NormalPtr; /* VERT_NORM */
- GLfloat *NormalLengthPtr; /* VERT_NORM */
- GLboolean *EdgeFlag; /* VERT_EDGE */
+ GLuint *Elts; /* VERT_BIT_ELT */
+ GLvector4f *ObjPtr; /* VERT_BIT_POS */
+ GLvector4f *EyePtr; /* VERT_BIT_EYE */
+ GLvector4f *ClipPtr; /* VERT_BIT_CLIP */
+ GLvector4f *NdcPtr; /* VERT_BIT_CLIP (2) */
+ GLubyte ClipOrMask; /* VERT_BIT_CLIP (3) */
+ GLubyte *ClipMask; /* VERT_BIT_CLIP (4) */
+ GLvector4f *NormalPtr; /* VERT_BIT_NORMAL */
+ GLfloat *NormalLengthPtr; /* VERT_BIT_NORMAL */
+ GLboolean *EdgeFlag; /* VERT_BIT_EDGEFLAG */
GLvector4f *TexCoordPtr[MAX_TEXTURE_UNITS]; /* VERT_TEX_0..n */
- GLvector1ui *IndexPtr[2]; /* VERT_INDEX */
- struct gl_client_array *ColorPtr[2]; /* VERT_RGBA */
- struct gl_client_array *SecondaryColorPtr[2]; /* VERT_SPEC_RGB */
- GLvector1f *FogCoordPtr; /* VERT_FOG_COORD */
- GLvector1f *PointSizePtr; /* VERT_POINT_SIZE */
- GLmaterial (*Material)[2]; /* VERT_MATERIAL, optional */
- GLuint *MaterialMask; /* VERT_MATERIAL, optional */
- GLuint *Flag; /* VERT_* flags, optional */
- GLuint *Primitive; /* GL_(mode)|PRIM_* flags */
- GLuint *PrimitiveLength; /* integers */
-
+ GLvector1ui *IndexPtr[2]; /* VERT_BIT_INDEX */
+ struct gl_client_array *ColorPtr[2]; /* VERT_BIT_COLOR0 */
+ struct gl_client_array *SecondaryColorPtr[2];/* VERT_BIT_COLOR1 */
+ GLvector4f *PointSizePtr; /* VERT_BIT_POINT_SIZE */
+ GLvector4f *FogCoordPtr; /* VERT_BIT_FOG */
+ struct gl_material (*Material)[2]; /* VERT_BIT_MATERIAL, optional */
+ GLuint *MaterialMask; /* VERT_BIT_MATERIAL, optional */
+ GLuint *Flag; /* VERT_BIT_* flags, optional */
+ GLuint *Primitive; /* GL_(mode)|PRIM_* flags */
+ GLuint *PrimitiveLength; /* integers */
+
+ /* Inputs to the vertex program stage */
+ GLvector4f *AttribPtr[VERT_ATTRIB_MAX]; /* GL_NV_vertex_program */
GLuint importable_data;
void *import_source;
@@ -360,6 +351,8 @@ struct gl_pipeline {
struct tnl_eval_store {
GLuint EvalMap1Flags;
GLuint EvalMap2Flags;
+ GLuint EvalMap1AttribFlags; /* GL_NV_vertex_program */
+ GLuint EvalMap2AttribFlags; /* GL_NV_vertex_program */
GLuint EvalNewState;
struct immediate *im; /* used for temporary data */
};
@@ -538,7 +531,7 @@ typedef struct {
/* Probably need a better configuration mechanism:
*/
- GLboolean NeedProjCoords;
+ GLboolean NeedNdcCoords;
GLboolean LoopbackDListCassettes;
GLboolean CalcDListNormalLengths;
GLboolean IsolateMaterials;
diff --git a/xc/extras/Mesa/src/tnl/t_eval_api.c b/xc/extras/Mesa/src/tnl/t_eval_api.c
index 5bd3880df..cd38d92d3 100644
--- a/xc/extras/Mesa/src/tnl/t_eval_api.c
+++ b/xc/extras/Mesa/src/tnl/t_eval_api.c
@@ -1,8 +1,7 @@
-/* $Id: t_eval_api.c,v 1.1.1.1 2002/10/22 13:06:21 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -22,6 +21,10 @@
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF 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 - original code
+ * Brian Paul - vertex program updates
*/
@@ -29,7 +32,7 @@
#include "colormac.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
#include "math/m_eval.h"
@@ -40,9 +43,6 @@
#include "t_imm_exec.h"
-
-
-
/* KW: If are compiling, we don't know whether eval will produce a
* vertex when it is run in the future. If this is pure immediate
* mode, eval is a noop if neither vertex map is enabled.
@@ -61,7 +61,8 @@ _tnl_exec_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
GLenum prim;
ASSERT_OUTSIDE_BEGIN_END(ctx);
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glEvalMesh1()");
switch (mode) {
case GL_POINT:
@@ -77,7 +78,8 @@ _tnl_exec_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
/* No effect if vertex maps disabled.
*/
- if (!ctx->Eval.Map1Vertex4 && !ctx->Eval.Map1Vertex3)
+ if (!ctx->Eval.Map1Vertex4 && !ctx->Eval.Map1Vertex3 &&
+ (!ctx->VertexProgram.Enabled || !ctx->Eval.Map1Attrib[VERT_ATTRIB_POS]))
return;
du = ctx->Eval.MapGrid1du;
@@ -108,10 +110,10 @@ _tnl_exec_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
tnl->Driver.NotifyBegin = 0;
if (compiling) {
- struct immediate *IM = _tnl_alloc_immediate( ctx );
+ struct immediate *tmp = _tnl_alloc_immediate( ctx );
FLUSH_VERTICES( ctx, 0 );
- SET_IMMEDIATE( ctx, IM );
- IM->ref_count++;
+ SET_IMMEDIATE( ctx, tmp );
+ TNL_CURRENT_IM(ctx)->ref_count++;
ctx->CompileFlag = GL_FALSE;
}
@@ -146,14 +148,15 @@ _tnl_exec_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 )
GLfloat u, du, v, dv, v1, u1;
ASSERT_OUTSIDE_BEGIN_END(ctx);
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glEvalMesh2()");
/* No effect if vertex maps disabled.
*/
- if (!ctx->Eval.Map2Vertex4 && !ctx->Eval.Map2Vertex3)
+ if (!ctx->Eval.Map2Vertex4 && !ctx->Eval.Map2Vertex3 &&
+ (!ctx->VertexProgram.Enabled || !ctx->Eval.Map2Attrib[VERT_ATTRIB_POS]))
return;
-
du = ctx->Eval.MapGrid2du;
dv = ctx->Eval.MapGrid2dv;
v1 = ctx->Eval.MapGrid2v1 + j1 * dv;
@@ -173,10 +176,10 @@ _tnl_exec_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 )
tnl->Driver.NotifyBegin = 0;
if (compiling) {
- struct immediate *IM = _tnl_alloc_immediate( ctx );
+ struct immediate *tmp = _tnl_alloc_immediate( ctx );
FLUSH_VERTICES( ctx, 0 );
- SET_IMMEDIATE( ctx, IM );
- IM->ref_count++;
+ SET_IMMEDIATE( ctx, tmp );
+ TNL_CURRENT_IM(ctx)->ref_count++;
ctx->CompileFlag = GL_FALSE;
}
@@ -236,7 +239,6 @@ _tnl_exec_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 )
}
-
void _tnl_eval_init( GLcontext *ctx )
{
GLvertexformat *vfmt = &(TNL_CONTEXT(ctx)->vtxfmt);
diff --git a/xc/extras/Mesa/src/tnl/t_imm_alloc.c b/xc/extras/Mesa/src/tnl/t_imm_alloc.c
index 0cee83712..65d5a752d 100644
--- a/xc/extras/Mesa/src/tnl/t_imm_alloc.c
+++ b/xc/extras/Mesa/src/tnl/t_imm_alloc.c
@@ -1,8 +1,7 @@
-/* $Id: t_imm_alloc.c,v 1.1.1.1 2002/10/22 13:06:25 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -24,11 +23,11 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#include "glheader.h"
-#include "mem.h"
+#include "imports.h"
#include "mtypes.h"
#include "t_imm_alloc.h"
@@ -38,8 +37,7 @@ static int id = 0; /* give each struct immediate a unique ID number */
static struct immediate *real_alloc_immediate( GLcontext *ctx )
{
- struct immediate *IM = ALIGN_MALLOC_STRUCT( immediate, 32 );
- GLuint j;
+ struct immediate *IM = ALIGN_CALLOC_STRUCT( immediate, 32 );
if (!IM)
return 0;
@@ -48,7 +46,6 @@ static struct immediate *real_alloc_immediate( GLcontext *ctx )
IM->id = id++;
IM->ref_count = 0;
- IM->backref = ctx;
IM->FlushElt = 0;
IM->LastPrimitive = IMM_MAX_COPIED_VERTS;
IM->Count = IMM_MAX_COPIED_VERTS;
@@ -62,23 +59,6 @@ static struct immediate *real_alloc_immediate( GLcontext *ctx )
IM->CopyTexSize = 0;
IM->CopyStart = IM->Start;
-
- /* TexCoord0 is special.
- */
- IM->TexCoord[0] = IM->TexCoord0;
-
- for (j = 1; j < ctx->Const.MaxTextureUnits; j++) {
- IM->TexCoord[j] = (GLfloat (*)[4])
- ALIGN_MALLOC( IMM_SIZE * sizeof(GLfloat) * 4, 32 );
- }
-
- /* KW: Removed initialization of normals as these are now treated
- * identically to all other data types.
- */
-
- MEMSET(IM->Flag, 0, sizeof(IM->Flag));
- MEMSET(IM->Normal, 0.0 , sizeof(IM->Normal));
-
return IM;
}
@@ -86,7 +66,6 @@ static struct immediate *real_alloc_immediate( GLcontext *ctx )
static void real_free_immediate( struct immediate *IM )
{
static int freed = 0;
- GLuint j;
if (IM->Material) {
FREE( IM->Material );
@@ -95,9 +74,6 @@ static void real_free_immediate( struct immediate *IM )
IM->MaterialMask = 0;
}
- for (j = 1; j < IM->MaxTextureUnits; j++)
- ALIGN_FREE( IM->TexCoord[j] );
-
if (IM->NormalLengthPtr)
ALIGN_FREE( IM->NormalLengthPtr );
diff --git a/xc/extras/Mesa/src/tnl/t_imm_alloc.h b/xc/extras/Mesa/src/tnl/t_imm_alloc.h
index e560dcc4d..502be3fe9 100644
--- a/xc/extras/Mesa/src/tnl/t_imm_alloc.h
+++ b/xc/extras/Mesa/src/tnl/t_imm_alloc.h
@@ -1,10 +1,9 @@
-/* $Id: t_imm_alloc.h,v 1.1.1.1 2002/10/22 13:06:25 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * 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"),
diff --git a/xc/extras/Mesa/src/tnl/t_imm_api.c b/xc/extras/Mesa/src/tnl/t_imm_api.c
index b9a956ce5..9e073f162 100644
--- a/xc/extras/Mesa/src/tnl/t_imm_api.c
+++ b/xc/extras/Mesa/src/tnl/t_imm_api.c
@@ -1,8 +1,7 @@
-/* $Id: t_imm_api.c,v 1.1.1.1 2002/10/22 13:06:24 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
@@ -34,10 +33,11 @@
#include "dlist.h"
#include "enums.h"
#include "light.h"
-#include "mem.h"
+#include "imports.h"
#include "state.h"
#include "colormac.h"
#include "macros.h"
+#include "vtxfmt.h"
#include "t_context.h"
#include "t_imm_api.h"
@@ -48,13 +48,19 @@
/* A cassette is full or flushed on a statechange.
*/
-void _tnl_flush_immediate( struct immediate *IM )
+void _tnl_flush_immediate( GLcontext *ctx, struct immediate *IM )
{
- GLcontext *ctx = IM->backref;
+ if (!ctx) {
+ /* We were called by glVertex, glEvalCoord, glArrayElement, etc.
+ * The current context is corresponds to the IM structure.
+ */
+ GET_CURRENT_CONTEXT(context);
+ ctx = context;
+ }
if (MESA_VERBOSE & VERBOSE_IMMEDIATE)
- fprintf(stderr, "_tnl_flush_immediate IM: %d compiling: %d\n",
- IM->id, ctx->CompileFlag);
+ _mesa_debug(ctx, "_tnl_flush_immediate IM: %d compiling: %d\n",
+ IM->id, ctx->CompileFlag);
if (IM->FlushElt == FLUSH_ELT_EAGER) {
_tnl_translate_array_elts( ctx, IM, IM->LastPrimitive, IM->Count );
@@ -79,21 +85,21 @@ void _tnl_flush_vertices( GLcontext *ctx, GLuint flags )
struct immediate *IM = TNL_CURRENT_IM(ctx);
if (MESA_VERBOSE & VERBOSE_IMMEDIATE)
- fprintf( stderr,
- "_tnl_flush_vertices flags %x IM(%d) %d..%d Flag[%d]: %x\n",
- flags, IM->id, IM->Start, IM->Count, IM->Start,
- IM->Flag[IM->Start]);
+ _mesa_debug(ctx,
+ "_tnl_flush_vertices flags %x IM(%d) %d..%d Flag[%d]: %x\n",
+ flags, IM->id, IM->Start, IM->Count, IM->Start,
+ IM->Flag[IM->Start]);
- if (IM->Flag[IM->Start])
+ if (IM->Flag[IM->Start]) {
if ((flags & FLUSH_UPDATE_CURRENT) ||
IM->Count > IM->Start ||
- (IM->Flag[IM->Start] & (VERT_BEGIN|VERT_END)))
- _tnl_flush_immediate( IM );
+ (IM->Flag[IM->Start] & (VERT_BIT_BEGIN | VERT_BIT_END))) {
+ _tnl_flush_immediate( ctx, IM );
+ }
+ }
}
-
-
void
_tnl_save_Begin( GLenum mode )
{
@@ -101,7 +107,7 @@ _tnl_save_Begin( GLenum mode )
struct immediate *IM = TNL_CURRENT_IM(ctx);
GLuint inflags, state;
-/* fprintf(stderr, "%s: before: %x\n", __FUNCTION__, IM->BeginState); */
+/* _mesa_debug(ctx, "%s: before: %x\n", __FUNCTION__, IM->BeginState); */
if (mode > GL_POLYGON) {
_mesa_compile_error( ctx, GL_INVALID_ENUM, "_tnl_Begin" );
@@ -111,10 +117,19 @@ _tnl_save_Begin( GLenum mode )
if (ctx->NewState)
_mesa_update_state(ctx);
+#if 000
+ /* if only a very few slots left, might as well flush now
+ */
+ if (IM->Count > IMM_MAXDATA-8) {
+ _tnl_flush_immediate( ctx, IM );
+ IM = TNL_CURRENT_IM(ctx);
+ }
+#endif
+
/* Check for and flush buffered vertices from internal operations.
*/
if (IM->SavedBeginState) {
- _tnl_flush_immediate( IM );
+ _tnl_flush_immediate( ctx, IM );
IM = TNL_CURRENT_IM(ctx);
IM->BeginState = IM->SavedBeginState;
IM->SavedBeginState = 0;
@@ -130,7 +145,7 @@ _tnl_save_Begin( GLenum mode )
GLuint last = IM->LastPrimitive;
state |= (VERT_BEGIN_0|VERT_BEGIN_1);
- IM->Flag[count] |= VERT_BEGIN;
+ IM->Flag[count] |= VERT_BIT_BEGIN;
IM->Primitive[count] = mode | PRIM_BEGIN;
IM->PrimitiveLength[IM->LastPrimitive] = count - IM->LastPrimitive;
IM->LastPrimitive = count;
@@ -166,7 +181,7 @@ _tnl_Begin( GLenum mode )
ASSERT (!ctx->CompileFlag);
if (mode > GL_POLYGON) {
- _mesa_error( ctx, GL_INVALID_ENUM, "_tnl_Begin" );
+ _mesa_error( ctx, GL_INVALID_ENUM, "_tnl_Begin(0x%x)", mode );
return;
}
@@ -189,8 +204,8 @@ _tnl_Begin( GLenum mode )
return;
}
- assert( IM->SavedBeginState == 0 );
- assert( IM->BeginState == 0 );
+ assert( (IM->SavedBeginState & (VERT_BEGIN_0|VERT_BEGIN_1)) == 0 );
+ assert( (IM->BeginState & (VERT_BEGIN_0|VERT_BEGIN_1)) == 0 );
/* Not quite right. Need to use the fallback '_aa_ArrayElement'
* when not known to be inside begin/end and arrays are
@@ -200,12 +215,14 @@ _tnl_Begin( GLenum mode )
_tnl_translate_array_elts( ctx, IM, last, count );
}
- IM->Flag[count] |= VERT_BEGIN;
+ IM->Flag[count] |= VERT_BIT_BEGIN;
IM->Primitive[count] = mode | PRIM_BEGIN;
IM->PrimitiveLength[last] = count - last;
IM->LastPrimitive = count;
IM->BeginState = (VERT_BEGIN_0|VERT_BEGIN_1);
+/* _mesa_debug(ctx, "%s: %x\n", __FUNCTION__, IM->BeginState); */
+
ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
ctx->Driver.CurrentExecPrimitive = mode;
}
@@ -219,12 +236,12 @@ _tnl_Begin( GLenum mode )
GLboolean
_tnl_hard_begin( GLcontext *ctx, GLenum p )
{
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
+/* _mesa_debug(ctx, "%s\n", __FUNCTION__); */
if (!ctx->CompileFlag) {
/* If not compiling, treat as a normal begin().
*/
-/* fprintf(stderr, "%s: treating as glBegin\n", __FUNCTION__); */
+/* _mesa_debug(ctx, "%s: treating as glBegin\n", __FUNCTION__); */
glBegin( p );
return GL_TRUE;
}
@@ -239,7 +256,7 @@ _tnl_hard_begin( GLcontext *ctx, GLenum p )
_mesa_update_state(ctx);
if (IM->Count > IMM_MAXDATA-8) {
- _tnl_flush_immediate( IM );
+ _tnl_flush_immediate( ctx, IM );
IM = TNL_CURRENT_IM(ctx);
}
@@ -278,7 +295,7 @@ _tnl_hard_begin( GLcontext *ctx, GLenum p )
ASSERT (IM->FlushElt != FLUSH_ELT_EAGER);
IM->BeginState |= VERT_BEGIN_0|VERT_BEGIN_1;
- IM->Flag[IM->Count] |= VERT_BEGIN;
+ IM->Flag[IM->Count] |= VERT_BIT_BEGIN;
IM->Primitive[IM->Count] = p | PRIM_BEGIN;
IM->PrimitiveLength[IM->LastPrimitive] = IM->Count - IM->LastPrimitive;
IM->LastPrimitive = IM->Count;
@@ -314,7 +331,10 @@ _tnl_end( GLcontext *ctx )
GLuint state = IM->BeginState;
GLuint inflags = (~state) & (VERT_BEGIN_0|VERT_BEGIN_1);
- assert( ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES );
+ /* Not the case if vertices emitted without calling glBegin first:
+ */
+/* assert( ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES ); */
+
state |= inflags << 2; /* errors */
@@ -324,7 +344,7 @@ _tnl_end( GLcontext *ctx )
GLuint last = IM->LastPrimitive;
state &= ~(VERT_BEGIN_0|VERT_BEGIN_1); /* update state */
- IM->Flag[count] |= VERT_END;
+ IM->Flag[count] |= VERT_BIT_END;
IM->Primitive[last] |= PRIM_END;
IM->PrimitiveLength[last] = count - last;
IM->Primitive[count] = PRIM_OUTSIDE_BEGIN_END; /* removes PRIM_BEGIN
@@ -339,10 +359,6 @@ _tnl_end( GLcontext *ctx )
IM->BeginState = state;
- /* Only update CurrentExecPrimitive if not compiling. If we are in
- * COMPILE_AND_EXECUTE mode, it will be done on replay of this
- * cassette.
- */
if (!ctx->CompileFlag) {
if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END)
_mesa_error( ctx, GL_INVALID_OPERATION, "_tnl_End" );
@@ -354,13 +370,14 @@ _tnl_end( GLcontext *ctx )
* behaviour.
*/
if (MESA_DEBUG_FLAGS & DEBUG_ALWAYS_FLUSH)
- _tnl_flush_immediate( IM );
+ _tnl_flush_immediate( ctx, IM );
}
-static void
+void
_tnl_End(void)
{
GET_CURRENT_CONTEXT(ctx);
+
_tnl_end( ctx );
/* Need to keep save primitive uptodate in COMPILE and
@@ -372,29 +389,28 @@ _tnl_End(void)
}
-#define COLOR( IM, r, g, b, a ) \
-{ \
- GLuint count = IM->Count; \
- IM->Flag[count] |= VERT_RGBA; \
- IM->Color[count][0] = r; \
- IM->Color[count][1] = g; \
- IM->Color[count][2] = b; \
- IM->Color[count][3] = a; \
+#define COLOR( r, g, b, a ) \
+{ \
+ GET_IMMEDIATE; \
+ GLuint count = IM->Count; \
+ GLfloat *color = IM->Attrib[VERT_ATTRIB_COLOR0][count]; \
+ IM->Flag[count] |= VERT_BIT_COLOR0; \
+ color[0] = r; \
+ color[1] = g; \
+ color[2] = b; \
+ color[3] = a; \
}
static void
_tnl_Color3f( GLfloat red, GLfloat green, GLfloat blue )
{
- GET_IMMEDIATE;
- COLOR( IM, red, green, blue, 1.0 );
+ COLOR( red, green, blue, 1.0 );
}
static void
_tnl_Color3ub( GLubyte red, GLubyte green, GLubyte blue )
{
- GET_IMMEDIATE;
- COLOR(IM,
- UBYTE_TO_FLOAT(red),
+ COLOR(UBYTE_TO_FLOAT(red),
UBYTE_TO_FLOAT(green),
UBYTE_TO_FLOAT(blue),
1.0);
@@ -403,16 +419,13 @@ _tnl_Color3ub( GLubyte red, GLubyte green, GLubyte blue )
static void
_tnl_Color4f( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
{
- GET_IMMEDIATE;
- COLOR( IM, red, green, blue, alpha );
+ COLOR( red, green, blue, alpha );
}
static void
_tnl_Color4ub( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha )
{
- GET_IMMEDIATE;
- COLOR(IM,
- UBYTE_TO_FLOAT(red),
+ COLOR(UBYTE_TO_FLOAT(red),
UBYTE_TO_FLOAT(green),
UBYTE_TO_FLOAT(blue),
UBYTE_TO_FLOAT(alpha));
@@ -421,16 +434,13 @@ _tnl_Color4ub( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha )
static void
_tnl_Color3fv( const GLfloat *v )
{
- GET_IMMEDIATE;
- COLOR( IM, v[0], v[1], v[2], 1.0 );
+ COLOR( v[0], v[1], v[2], 1.0 );
}
static void
_tnl_Color3ubv( const GLubyte *v )
{
- GET_IMMEDIATE;
- COLOR(IM,
- UBYTE_TO_FLOAT(v[0]),
+ COLOR(UBYTE_TO_FLOAT(v[0]),
UBYTE_TO_FLOAT(v[1]),
UBYTE_TO_FLOAT(v[2]),
1.0 );
@@ -439,16 +449,13 @@ _tnl_Color3ubv( const GLubyte *v )
static void
_tnl_Color4fv( const GLfloat *v )
{
- GET_IMMEDIATE;
- COLOR( IM, v[0], v[1], v[2], v[3] );
+ COLOR( v[0], v[1], v[2], v[3] );
}
static void
_tnl_Color4ubv( const GLubyte *v)
{
- GET_IMMEDIATE;
- COLOR(IM,
- UBYTE_TO_FLOAT(v[0]),
+ COLOR(UBYTE_TO_FLOAT(v[0]),
UBYTE_TO_FLOAT(v[1]),
UBYTE_TO_FLOAT(v[2]),
UBYTE_TO_FLOAT(v[3]));
@@ -457,28 +464,27 @@ _tnl_Color4ubv( const GLubyte *v)
-#define SECONDARY_COLOR( IM, r, g, b ) \
-{ \
- GLuint count = IM->Count; \
- IM->Flag[count] |= VERT_SPEC_RGB; \
- IM->SecondaryColor[count][0] = r; \
- IM->SecondaryColor[count][1] = g; \
- IM->SecondaryColor[count][2] = b; \
+#define SECONDARY_COLOR( r, g, b ) \
+{ \
+ GLuint count; \
+ GET_IMMEDIATE; \
+ count = IM->Count; \
+ IM->Flag[count] |= VERT_BIT_COLOR1; \
+ IM->Attrib[VERT_ATTRIB_COLOR1][count][0] = r; \
+ IM->Attrib[VERT_ATTRIB_COLOR1][count][1] = g; \
+ IM->Attrib[VERT_ATTRIB_COLOR1][count][2] = b; \
}
static void
_tnl_SecondaryColor3fEXT( GLfloat red, GLfloat green, GLfloat blue )
{
- GET_IMMEDIATE;
- SECONDARY_COLOR( IM, red, green, blue );
+ SECONDARY_COLOR( red, green, blue );
}
static void
_tnl_SecondaryColor3ubEXT( GLubyte red, GLubyte green, GLubyte blue )
{
- GET_IMMEDIATE;
- SECONDARY_COLOR(IM,
- UBYTE_TO_FLOAT(red),
+ SECONDARY_COLOR(UBYTE_TO_FLOAT(red),
UBYTE_TO_FLOAT(green),
UBYTE_TO_FLOAT(blue));
}
@@ -486,23 +492,18 @@ _tnl_SecondaryColor3ubEXT( GLubyte red, GLubyte green, GLubyte blue )
static void
_tnl_SecondaryColor3fvEXT( const GLfloat *v )
{
- GET_IMMEDIATE;
- SECONDARY_COLOR( IM, v[0], v[1], v[2] );
+ SECONDARY_COLOR( v[0], v[1], v[2] );
}
static void
_tnl_SecondaryColor3ubvEXT( const GLubyte *v )
{
- GET_IMMEDIATE;
- SECONDARY_COLOR(IM,
- UBYTE_TO_FLOAT(v[0]),
+ SECONDARY_COLOR(UBYTE_TO_FLOAT(v[0]),
UBYTE_TO_FLOAT(v[1]),
UBYTE_TO_FLOAT(v[2]));
}
-
-
static void
_tnl_EdgeFlag( GLboolean flag )
{
@@ -510,7 +511,7 @@ _tnl_EdgeFlag( GLboolean flag )
GET_IMMEDIATE;
count = IM->Count;
IM->EdgeFlag[count] = flag;
- IM->Flag[count] |= VERT_EDGE;
+ IM->Flag[count] |= VERT_BIT_EDGEFLAG;
}
@@ -521,7 +522,7 @@ _tnl_EdgeFlagv( const GLboolean *flag )
GET_IMMEDIATE;
count = IM->Count;
IM->EdgeFlag[count] = *flag;
- IM->Flag[count] |= VERT_EDGE;
+ IM->Flag[count] |= VERT_BIT_EDGEFLAG;
}
@@ -531,8 +532,8 @@ _tnl_FogCoordfEXT( GLfloat f )
GLuint count;
GET_IMMEDIATE;
count = IM->Count;
- IM->FogCoord[count] = f;
- IM->Flag[count] |= VERT_FOG_COORD;
+ IM->Attrib[VERT_ATTRIB_FOG][count][0] = f; /*FogCoord[count] = f;*/
+ IM->Flag[count] |= VERT_BIT_FOG;
}
static void
@@ -541,8 +542,8 @@ _tnl_FogCoordfvEXT( const GLfloat *v )
GLuint count;
GET_IMMEDIATE;
count = IM->Count;
- IM->FogCoord[count] = v[0];
- IM->Flag[count] |= VERT_FOG_COORD;
+ IM->Attrib[VERT_ATTRIB_FOG][count][0] = v[0]; /*FogCoord[count] = v[0];*/
+ IM->Flag[count] |= VERT_BIT_FOG;
}
@@ -553,7 +554,7 @@ _tnl_Indexi( GLint c )
GET_IMMEDIATE;
count = IM->Count;
IM->Index[count] = c;
- IM->Flag[count] |= VERT_INDEX;
+ IM->Flag[count] |= VERT_BIT_INDEX;
}
@@ -564,19 +565,19 @@ _tnl_Indexiv( const GLint *c )
GET_IMMEDIATE;
count = IM->Count;
IM->Index[count] = *c;
- IM->Flag[count] |= VERT_INDEX;
+ IM->Flag[count] |= VERT_BIT_INDEX;
}
-#define NORMAL( x, y, z ) \
-{ \
- GLuint count; \
- GLfloat *normal; \
- GET_IMMEDIATE; \
- count = IM->Count; \
- IM->Flag[count] |= VERT_NORM; \
- normal = IM->Normal[count]; \
- ASSIGN_3V(normal, x,y,z); \
+#define NORMAL( x, y, z ) \
+{ \
+ GLuint count; \
+ GLfloat *normal; \
+ GET_IMMEDIATE; \
+ count = IM->Count; \
+ IM->Flag[count] |= VERT_BIT_NORMAL; \
+ normal = IM->Attrib[VERT_ATTRIB_NORMAL][count]; \
+ ASSIGN_3V(normal, x,y,z); \
}
#if defined(USE_IEEE)
@@ -586,8 +587,8 @@ _tnl_Indexiv( const GLint *c )
fi_type *normal; \
GET_IMMEDIATE; \
count = IM->Count; \
- IM->Flag[count] |= VERT_NORM; \
- normal = (fi_type *)IM->Normal[count]; \
+ IM->Flag[count] |= VERT_BIT_NORMAL; \
+ normal = (fi_type *)IM->Attrib[VERT_ATTRIB_NORMAL][count]; \
normal[0].i = ((fi_type *)&(x))->i; \
normal[1].i = ((fi_type *)&(y))->i; \
normal[2].i = ((fi_type *)&(z))->i; \
@@ -619,55 +620,55 @@ _tnl_Normal3fv( const GLfloat *v )
GLfloat *tc; \
GET_IMMEDIATE; \
count = IM->Count; \
- IM->Flag[count] |= VERT_TEX0; \
- tc = IM->TexCoord0[count]; \
+ IM->Flag[count] |= VERT_BIT_TEX0; \
+ tc = IM->Attrib[VERT_ATTRIB_TEX0][count]; \
ASSIGN_4V(tc,s,0,0,1); \
}
-#define TEXCOORD2(s,t) \
+#define TEXCOORD2(s, t) \
{ \
GLuint count; \
GLfloat *tc; \
GET_IMMEDIATE; \
count = IM->Count; \
- IM->Flag[count] |= VERT_TEX0; \
- tc = IM->TexCoord0[count]; \
- ASSIGN_4V(tc, s,t,0,1); \
+ IM->Flag[count] |= VERT_BIT_TEX0; \
+ tc = IM->Attrib[VERT_ATTRIB_TEX0][count]; \
+ ASSIGN_4V(tc, s, t, 0, 1); \
}
-#define TEXCOORD3(s,t,u) \
+#define TEXCOORD3(s, t, u) \
{ \
GLuint count; \
GLfloat *tc; \
GET_IMMEDIATE; \
count = IM->Count; \
- IM->Flag[count] |= VERT_TEX0; \
- IM->TexSize |= TEX_0_SIZE_3; \
- tc = IM->TexCoord0[count]; \
- ASSIGN_4V(tc, s,t,u,1); \
+ IM->Flag[count] |= VERT_BIT_TEX0; \
+ IM->TexSize |= TEX_0_SIZE_3; \
+ tc = IM->Attrib[VERT_ATTRIB_TEX0][count]; \
+ ASSIGN_4V(tc, s, t, u, 1); \
}
-#define TEXCOORD4(s,t,u,v) \
+#define TEXCOORD4(s, t, u, v) \
{ \
GLuint count; \
GLfloat *tc; \
GET_IMMEDIATE; \
count = IM->Count; \
- IM->Flag[count] |= VERT_TEX0; \
- IM->TexSize |= TEX_0_SIZE_4; \
- tc = IM->TexCoord0[count]; \
- ASSIGN_4V(tc, s,t,u,v); \
+ IM->Flag[count] |= VERT_BIT_TEX0; \
+ IM->TexSize |= TEX_0_SIZE_4; \
+ tc = IM->Attrib[VERT_ATTRIB_TEX0][count]; \
+ ASSIGN_4V(tc, s, t, u, v); \
}
#if defined(USE_IEEE)
-#define TEXCOORD2F(s,t) \
+#define TEXCOORD2F(s, t) \
{ \
GLuint count; \
fi_type *tc; \
GET_IMMEDIATE; \
count = IM->Count; \
- IM->Flag[count] |= VERT_TEX0; \
- tc = (fi_type *)IM->TexCoord0[count]; \
+ IM->Flag[count] |= VERT_BIT_TEX0; \
+ tc = (fi_type *)IM->Attrib[VERT_ATTRIB_TEX0][count]; \
tc[0].i = ((fi_type *)&(s))->i; \
tc[1].i = ((fi_type *)&(t))->i; \
tc[2].i = 0; \
@@ -687,20 +688,20 @@ _tnl_TexCoord1f( GLfloat s )
static void
_tnl_TexCoord2f( GLfloat s, GLfloat t )
{
- TEXCOORD2F(s,t);
+ TEXCOORD2F(s, t);
}
static void
_tnl_TexCoord3f( GLfloat s, GLfloat t, GLfloat r )
{
- TEXCOORD3(s,t,r);
+ TEXCOORD3(s, t, r);
}
static void
_tnl_TexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q )
{
- TEXCOORD4(s,t,r,q)
+ TEXCOORD4(s, t, r, q)
}
static void
@@ -712,19 +713,19 @@ _tnl_TexCoord1fv( const GLfloat *v )
static void
_tnl_TexCoord2fv( const GLfloat *v )
{
- TEXCOORD2F(v[0],v[1]);
+ TEXCOORD2F(v[0], v[1]);
}
static void
_tnl_TexCoord3fv( const GLfloat *v )
{
- TEXCOORD3(v[0],v[1],v[2]);
+ TEXCOORD3(v[0], v[1], v[2]);
}
static void
_tnl_TexCoord4fv( const GLfloat *v )
{
- TEXCOORD4(v[0],v[1],v[2],v[3]);
+ TEXCOORD4(v[0], v[1], v[2], v[3]);
}
@@ -732,86 +733,86 @@ _tnl_TexCoord4fv( const GLfloat *v )
/* KW: Run into bad problems in vertex copying if we don't fully pad
* the incoming vertices.
*/
-#define VERTEX2(IM, x,y) \
-{ \
- GLuint count = IM->Count++; \
- GLfloat *dest = IM->Obj[count]; \
- IM->Flag[count] |= VERT_OBJ; \
- ASSIGN_4V(dest, x, y, 0, 1); \
-/* ASSERT(IM->Flag[IM->Count]==0); */\
- if (count == IMM_MAXDATA - 1) \
- _tnl_flush_immediate( IM ); \
+#define VERTEX2(IM, x,y) \
+{ \
+ GLuint count = IM->Count++; \
+ GLfloat *dest = IM->Attrib[VERT_ATTRIB_POS][count]; \
+ IM->Flag[count] |= VERT_BIT_POS; \
+ ASSIGN_4V(dest, x, y, 0, 1); \
+/* ASSERT(IM->Flag[IM->Count]==0); */ \
+ if (count == IMM_MAXDATA - 1) \
+ _tnl_flush_immediate( NULL, IM ); \
}
-#define VERTEX3(IM,x,y,z) \
-{ \
- GLuint count = IM->Count++; \
- GLfloat *dest = IM->Obj[count]; \
- IM->Flag[count] |= VERT_OBJ_23; \
- ASSIGN_4V(dest, x, y, z, 1); \
+#define VERTEX3(IM,x,y,z) \
+{ \
+ GLuint count = IM->Count++; \
+ GLfloat *dest = IM->Attrib[VERT_ATTRIB_POS][count]; \
+ IM->Flag[count] |= VERT_BITS_OBJ_23; \
+ ASSIGN_4V(dest, x, y, z, 1); \
/* ASSERT(IM->Flag[IM->Count]==0); */ \
- if (count == IMM_MAXDATA - 1) \
- _tnl_flush_immediate( IM ); \
-}
-
-#define VERTEX4(IM, x,y,z,w) \
-{ \
- GLuint count = IM->Count++; \
- GLfloat *dest = IM->Obj[count]; \
- IM->Flag[count] |= VERT_OBJ_234; \
- ASSIGN_4V(dest, x, y, z, w); \
if (count == IMM_MAXDATA - 1) \
- _tnl_flush_immediate( IM ); \
+ _tnl_flush_immediate( NULL, IM ); \
}
-#if defined(USE_IEEE)
-#define VERTEX2F(IM, x, y) \
+#define VERTEX4(IM, x,y,z,w) \
{ \
GLuint count = IM->Count++; \
- fi_type *dest = (fi_type *)IM->Obj[count]; \
- IM->Flag[count] |= VERT_OBJ; \
- dest[0].i = ((fi_type *)&(x))->i; \
- dest[1].i = ((fi_type *)&(y))->i; \
- dest[2].i = 0; \
- dest[3].i = IEEE_ONE; \
-/* ASSERT(IM->Flag[IM->Count]==0); */ \
+ GLfloat *dest = IM->Attrib[VERT_ATTRIB_POS][count]; \
+ IM->Flag[count] |= VERT_BITS_OBJ_234; \
+ ASSIGN_4V(dest, x, y, z, w); \
if (count == IMM_MAXDATA - 1) \
- _tnl_flush_immediate( IM ); \
+ _tnl_flush_immediate( NULL, IM ); \
+}
+
+#if defined(USE_IEEE)
+#define VERTEX2F(IM, x, y) \
+{ \
+ GLuint count = IM->Count++; \
+ fi_type *dest = (fi_type *)IM->Attrib[VERT_ATTRIB_POS][count]; \
+ IM->Flag[count] |= VERT_BIT_POS; \
+ dest[0].i = ((fi_type *)&(x))->i; \
+ dest[1].i = ((fi_type *)&(y))->i; \
+ dest[2].i = 0; \
+ dest[3].i = IEEE_ONE; \
+/* ASSERT(IM->Flag[IM->Count]==0); */ \
+ if (count == IMM_MAXDATA - 1) \
+ _tnl_flush_immediate( NULL, IM ); \
}
#else
#define VERTEX2F VERTEX2
#endif
#if defined(USE_IEEE)
-#define VERTEX3F(IM, x, y, z) \
-{ \
- GLuint count = IM->Count++; \
- fi_type *dest = (fi_type *)IM->Obj[count]; \
- IM->Flag[count] |= VERT_OBJ_23; \
- dest[0].i = ((fi_type *)&(x))->i; \
- dest[1].i = ((fi_type *)&(y))->i; \
- dest[2].i = ((fi_type *)&(z))->i; \
- dest[3].i = IEEE_ONE; \
-/* ASSERT(IM->Flag[IM->Count]==0); */ \
- if (count == IMM_MAXDATA - 1) \
- _tnl_flush_immediate( IM ); \
+#define VERTEX3F(IM, x, y, z) \
+{ \
+ GLuint count = IM->Count++; \
+ fi_type *dest = (fi_type *)IM->Attrib[VERT_ATTRIB_POS][count]; \
+ IM->Flag[count] |= VERT_BITS_OBJ_23; \
+ dest[0].i = ((fi_type *)&(x))->i; \
+ dest[1].i = ((fi_type *)&(y))->i; \
+ dest[2].i = ((fi_type *)&(z))->i; \
+ dest[3].i = IEEE_ONE; \
+/* ASSERT(IM->Flag[IM->Count]==0); */ \
+ if (count == IMM_MAXDATA - 1) \
+ _tnl_flush_immediate( NULL, IM ); \
}
#else
#define VERTEX3F VERTEX3
#endif
#if defined(USE_IEEE)
-#define VERTEX4F(IM, x, y, z, w) \
-{ \
- GLuint count = IM->Count++; \
- fi_type *dest = (fi_type *)IM->Obj[count]; \
- IM->Flag[count] |= VERT_OBJ_234; \
- dest[0].i = ((fi_type *)&(x))->i; \
- dest[1].i = ((fi_type *)&(y))->i; \
- dest[2].i = ((fi_type *)&(z))->i; \
- dest[3].i = ((fi_type *)&(w))->i; \
- if (count == IMM_MAXDATA - 1) \
- _tnl_flush_immediate( IM ); \
+#define VERTEX4F(IM, x, y, z, w) \
+{ \
+ GLuint count = IM->Count++; \
+ fi_type *dest = (fi_type *)IM->Attrib[VERT_ATTRIB_POS][count]; \
+ IM->Flag[count] |= VERT_BITS_OBJ_234; \
+ dest[0].i = ((fi_type *)&(x))->i; \
+ dest[1].i = ((fi_type *)&(y))->i; \
+ dest[2].i = ((fi_type *)&(z))->i; \
+ dest[3].i = ((fi_type *)&(w))->i; \
+ if (count == IMM_MAXDATA - 1) \
+ _tnl_flush_immediate( NULL, IM ); \
}
#else
#define VERTEX4F VERTEX4
@@ -879,9 +880,9 @@ _tnl_Vertex4fv( const GLfloat *v )
GLuint texunit = target - GL_TEXTURE0_ARB; \
if (texunit < IM->MaxTextureUnits) { \
GLuint count = IM->Count; \
- GLfloat *tc = IM->TexCoord[texunit][count]; \
+ GLfloat *tc = IM->Attrib[VERT_ATTRIB_TEX0 + texunit][count]; \
ASSIGN_4V(tc, s, 0.0F, 0.0F, 1.0F); \
- IM->Flag[count] |= VERT_TEX(texunit); \
+ IM->Flag[count] |= VERT_BIT_TEX(texunit); \
} \
}
@@ -891,9 +892,9 @@ _tnl_Vertex4fv( const GLfloat *v )
GLuint texunit = target - GL_TEXTURE0_ARB; \
if (texunit < IM->MaxTextureUnits) { \
GLuint count = IM->Count; \
- GLfloat *tc = IM->TexCoord[texunit][count]; \
+ GLfloat *tc = IM->Attrib[VERT_ATTRIB_TEX0 + texunit][count]; \
ASSIGN_4V(tc, s, t, 0.0F, 1.0F); \
- IM->Flag[count] |= VERT_TEX(texunit); \
+ IM->Flag[count] |= VERT_BIT_TEX(texunit); \
} \
}
@@ -903,9 +904,9 @@ _tnl_Vertex4fv( const GLfloat *v )
GLuint texunit = target - GL_TEXTURE0_ARB; \
if (texunit < IM->MaxTextureUnits) { \
GLuint count = IM->Count; \
- GLfloat *tc = IM->TexCoord[texunit][count]; \
+ GLfloat *tc = IM->Attrib[VERT_ATTRIB_TEX0 + texunit][count]; \
ASSIGN_4V(tc, s, t, u, 1.0F); \
- IM->Flag[count] |= VERT_TEX(texunit); \
+ IM->Flag[count] |= VERT_BIT_TEX(texunit); \
IM->TexSize |= TEX_SIZE_3(texunit); \
} \
}
@@ -916,9 +917,9 @@ _tnl_Vertex4fv( const GLfloat *v )
GLuint texunit = target - GL_TEXTURE0_ARB; \
if (texunit < IM->MaxTextureUnits) { \
GLuint count = IM->Count; \
- GLfloat *tc = IM->TexCoord[texunit][count]; \
+ GLfloat *tc = IM->Attrib[VERT_ATTRIB_TEX0 + texunit][count]; \
ASSIGN_4V(tc, s, t, u, v); \
- IM->Flag[count] |= VERT_TEX(texunit); \
+ IM->Flag[count] |= VERT_BIT_TEX(texunit); \
IM->TexSize |= TEX_SIZE_4(texunit); \
} \
}
@@ -930,8 +931,8 @@ _tnl_Vertex4fv( const GLfloat *v )
GLuint texunit = target - GL_TEXTURE0_ARB; \
if (texunit < IM->MaxTextureUnits) { \
GLuint count = IM->Count; \
- fi_type *tc = (fi_type *)IM->TexCoord[texunit][count]; \
- IM->Flag[count] |= VERT_TEX(texunit); \
+ fi_type *tc = (fi_type *)IM->Attrib[VERT_ATTRIB_TEX0 + texunit][count];\
+ IM->Flag[count] |= VERT_BIT_TEX(texunit); \
tc[0].i = ((fi_type *)&(s))->i; \
tc[1].i = ((fi_type *)&(t))->i; \
tc[2].i = 0; \
@@ -1001,37 +1002,41 @@ _tnl_MultiTexCoord4fvARB(GLenum target, const GLfloat *v)
#define EVALCOORD1(IM, x) \
{ \
GLuint count = IM->Count++; \
- IM->Flag[count] |= VERT_EVAL_C1; \
- ASSIGN_4V(IM->Obj[count], x, 0, 0, 1); \
+ GLfloat *dest = IM->Attrib[VERT_ATTRIB_POS][count]; \
+ IM->Flag[count] |= VERT_BIT_EVAL_C1; \
+ ASSIGN_4V(dest, x, 0, 0, 1); \
if (count == IMM_MAXDATA-1) \
- _tnl_flush_immediate( IM ); \
+ _tnl_flush_immediate( NULL, IM ); \
}
#define EVALCOORD2(IM, x, y) \
{ \
GLuint count = IM->Count++; \
- IM->Flag[count] |= VERT_EVAL_C2; \
- ASSIGN_4V(IM->Obj[count], x, y, 0, 1); \
+ GLfloat *dest = IM->Attrib[VERT_ATTRIB_POS][count]; \
+ IM->Flag[count] |= VERT_BIT_EVAL_C2; \
+ ASSIGN_4V(dest, x, y, 0, 1); \
if (count == IMM_MAXDATA-1) \
- _tnl_flush_immediate( IM ); \
+ _tnl_flush_immediate( NULL, IM ); \
}
#define EVALPOINT1(IM, x) \
{ \
GLuint count = IM->Count++; \
- IM->Flag[count] |= VERT_EVAL_P1; \
- ASSIGN_4V(IM->Obj[count], x, 0, 0, 1); \
+ GLfloat *dest = IM->Attrib[VERT_ATTRIB_POS][count]; \
+ IM->Flag[count] |= VERT_BIT_EVAL_P1; \
+ ASSIGN_4V(dest, x, 0, 0, 1); \
if (count == IMM_MAXDATA-1) \
- _tnl_flush_immediate( IM ); \
+ _tnl_flush_immediate( NULL, IM ); \
}
#define EVALPOINT2(IM, x, y) \
{ \
GLuint count = IM->Count++; \
- IM->Flag[count] |= VERT_EVAL_P2; \
- ASSIGN_4V(IM->Obj[count], x, y, 0, 1); \
+ GLfloat *dest = IM->Attrib[VERT_ATTRIB_POS][count]; \
+ IM->Flag[count] |= VERT_BIT_EVAL_P2; \
+ ASSIGN_4V(dest, x, y, 0, 1); \
if (count == IMM_MAXDATA-1) \
- _tnl_flush_immediate( IM ); \
+ _tnl_flush_immediate( NULL, IM ); \
}
static void
@@ -1087,11 +1092,11 @@ _tnl_EvalPoint2( GLint i, GLint j )
GLuint count = IM->Count; \
IM->Elt[count] = i; \
IM->Flag[count] &= IM->ArrayEltFlags; \
- IM->Flag[count] |= VERT_ELT; \
+ IM->Flag[count] |= VERT_BIT_ELT; \
IM->FlushElt = IM->ArrayEltFlush; \
IM->Count += IM->ArrayEltIncr; \
- if (IM->Count == IMM_MAXDATA) \
- _tnl_flush_immediate( IM ); \
+ if (IM->Count == IMM_MAXDATA) \
+ _tnl_flush_immediate( NULL, IM ); \
}
@@ -1129,6 +1134,51 @@ _tnl_eval_coord2f( GLcontext *CC, GLfloat u, GLfloat v )
+/*
+ * NV_vertex_program
+ */
+
+static void
+_tnl_VertexAttrib4fNV( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+{
+ if (index < 16) {
+ GET_IMMEDIATE;
+ const GLuint count = IM->Count;
+ GLfloat *attrib = IM->Attrib[index][count];
+ ASSIGN_4V(attrib, x, y, z, w);
+ IM->Flag[count] |= (1 << index);
+ if (index == 0) {
+ IM->Count++;
+ if (count == IMM_MAXDATA - 1)
+ _tnl_flush_immediate( NULL, IM );
+ }
+ }
+ else {
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribNV(index > 15)");
+ }
+}
+
+static void
+_tnl_VertexAttrib4fvNV( GLuint index, const GLfloat *v )
+{
+ if (index < 16) {
+ GET_IMMEDIATE;
+ const GLuint count = IM->Count;
+ GLfloat *attrib = IM->Attrib[index][count];
+ COPY_4V(attrib, v);
+ IM->Flag[count] |= (1 << index);
+ if (index == 0) {
+ IM->Count++;
+ if (count == IMM_MAXDATA - 1)
+ _tnl_flush_immediate( NULL, IM );
+ }
+ }
+ else {
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribNV(index > 15)");
+ }
+}
/* Execute a glRectf() function. _tnl_hard_begin() ensures the check
@@ -1164,20 +1214,20 @@ _tnl_Materialfv( GLenum face, GLenum pname, const GLfloat *params )
return;
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "_tnl_Materialfv\n");
+ _mesa_debug(ctx, "_tnl_Materialfv\n");
if (tnl->IsolateMaterials &&
!(IM->BeginState & VERT_BEGIN_1)) /* heuristic */
{
- _tnl_flush_immediate( IM );
+ _tnl_flush_immediate( ctx, IM );
IM = TNL_CURRENT_IM(ctx);
count = IM->Count;
}
- if (!(IM->Flag[count] & VERT_MATERIAL)) {
+ if (!(IM->Flag[count] & VERT_BIT_MATERIAL)) {
if (!IM->Material) {
- IM->Material = (GLmaterial (*)[2]) MALLOC( sizeof(GLmaterial) *
- IMM_SIZE * 2 );
+ IM->Material = (struct gl_material (*)[2])
+ MALLOC( sizeof(struct gl_material) * IMM_SIZE * 2 );
IM->MaterialMask = (GLuint *) MALLOC( sizeof(GLuint) * IMM_SIZE );
IM->MaterialMask[IM->LastMaterial] = 0;
}
@@ -1187,7 +1237,7 @@ _tnl_Materialfv( GLenum face, GLenum pname, const GLfloat *params )
IM->MaterialOrMask & ~bitmask );
}
- IM->Flag[count] |= VERT_MATERIAL;
+ IM->Flag[count] |= VERT_BIT_MATERIAL;
IM->MaterialMask[count] = 0;
IM->MaterialAndMask &= IM->MaterialMask[IM->LastMaterial];
IM->LastMaterial = count;
@@ -1243,7 +1293,7 @@ _tnl_Materialfv( GLenum face, GLenum pname, const GLfloat *params )
if (tnl->IsolateMaterials &&
!(IM->BeginState & VERT_BEGIN_1)) /* heuristic */
{
- _tnl_flush_immediate( IM );
+ _tnl_flush_immediate( ctx, IM );
}
}
@@ -1305,6 +1355,8 @@ void _tnl_imm_vtxfmt_init( GLcontext *ctx )
vfmt->Vertex3fv = _tnl_Vertex3fv;
vfmt->Vertex4f = _tnl_Vertex4f;
vfmt->Vertex4fv = _tnl_Vertex4fv;
+ vfmt->VertexAttrib4fNV = _tnl_VertexAttrib4fNV;
+ vfmt->VertexAttrib4fvNV = _tnl_VertexAttrib4fvNV;
/* Outside begin/end functions (from t_varray.c, t_eval.c, ...):
*/
diff --git a/xc/extras/Mesa/src/tnl/t_imm_api.h b/xc/extras/Mesa/src/tnl/t_imm_api.h
index 101acf651..1cb89fd4d 100644
--- a/xc/extras/Mesa/src/tnl/t_imm_api.h
+++ b/xc/extras/Mesa/src/tnl/t_imm_api.h
@@ -1,8 +1,7 @@
-/* $Id: t_imm_api.h,v 1.1.1.1 2002/10/22 13:06:25 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
@@ -35,6 +34,11 @@
extern void _tnl_save_Begin( GLenum mode );
extern void _tnl_Begin( GLenum mode );
+extern void _tnl_Begin( GLenum mode );
+
+extern void _tnl_End(void);
+
+
/* TNL-private internal functions for building higher-level operations:
*/
extern GLboolean _tnl_hard_begin( GLcontext *ctx, GLenum p );
diff --git a/xc/extras/Mesa/src/tnl/t_imm_debug.c b/xc/extras/Mesa/src/tnl/t_imm_debug.c
index d60300bc3..98b009c38 100644
--- a/xc/extras/Mesa/src/tnl/t_imm_debug.c
+++ b/xc/extras/Mesa/src/tnl/t_imm_debug.c
@@ -1,4 +1,3 @@
-/* $Id: t_imm_debug.c,v 1.1.1.1 2002/10/22 13:06:17 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -25,39 +24,42 @@
*/
#include "mtypes.h"
+#include "context.h"
+#include "imports.h"
#include "t_context.h"
#include "t_imm_debug.h"
+
void _tnl_print_vert_flags( const char *name, GLuint flags )
{
- fprintf(stderr,
+ _mesa_debug(NULL,
"%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
name,
flags,
- (flags & VERT_CLIP) ? "clip/proj-clip/glend, " : "",
- (flags & VERT_EDGE) ? "edgeflag, " : "",
- (flags & VERT_ELT) ? "array-elt, " : "",
- (flags & VERT_END_VB) ? "end-vb, " : "",
- (flags & VERT_EVAL_ANY) ? "eval-coord, " : "",
- (flags & VERT_EYE) ? "eye/glbegin, " : "",
- (flags & VERT_FOG_COORD) ? "fog-coord, " : "",
- (flags & VERT_INDEX) ? "index, " : "",
- (flags & VERT_MATERIAL) ? "material, " : "",
- (flags & VERT_NORM) ? "normals, " : "",
- (flags & VERT_OBJ) ? "obj, " : "",
- (flags & VERT_OBJ_3) ? "obj-3, " : "",
- (flags & VERT_OBJ_4) ? "obj-4, " : "",
- (flags & VERT_POINT_SIZE) ? "point-size, " : "",
- (flags & VERT_RGBA) ? "colors, " : "",
- (flags & VERT_SPEC_RGB) ? "specular, " : "",
- (flags & VERT_TEX0) ? "texcoord0, " : "",
- (flags & VERT_TEX1) ? "texcoord1, " : "",
- (flags & VERT_TEX2) ? "texcoord2, " : "",
- (flags & VERT_TEX3) ? "texcoord3, " : "",
- (flags & VERT_TEX4) ? "texcoord4, " : "",
- (flags & VERT_TEX5) ? "texcoord5, " : "",
- (flags & VERT_TEX6) ? "texcoord6, " : "",
- (flags & VERT_TEX7) ? "texcoord7, " : ""
+ (flags & VERT_BIT_CLIP) ? "clip/proj-clip/glend, " : "",
+ (flags & VERT_BIT_EDGEFLAG) ? "edgeflag, " : "",
+ (flags & VERT_BIT_ELT) ? "array-elt, " : "",
+ (flags & VERT_BIT_END_VB) ? "end-vb, " : "",
+ (flags & VERT_BITS_EVAL_ANY) ? "eval-coord, " : "",
+ (flags & VERT_BIT_EYE) ? "eye/glbegin, " : "",
+ (flags & VERT_BIT_FOG) ? "fog-coord, " : "",
+ (flags & VERT_BIT_INDEX) ? "index, " : "",
+ (flags & VERT_BIT_MATERIAL) ? "material, " : "",
+ (flags & VERT_BIT_NORMAL) ? "normals, " : "",
+ (flags & VERT_BIT_POS) ? "obj, " : "",
+ (flags & VERT_BIT_OBJ_3) ? "obj-3, " : "",
+ (flags & VERT_BIT_OBJ_4) ? "obj-4, " : "",
+ (flags & VERT_BIT_POINT_SIZE) ? "point-size, " : "",
+ (flags & VERT_BIT_COLOR0) ? "colors, " : "",
+ (flags & VERT_BIT_COLOR1) ? "specular, " : "",
+ (flags & VERT_BIT_TEX0) ? "texcoord0, " : "",
+ (flags & VERT_BIT_TEX1) ? "texcoord1, " : "",
+ (flags & VERT_BIT_TEX2) ? "texcoord2, " : "",
+ (flags & VERT_BIT_TEX3) ? "texcoord3, " : "",
+ (flags & VERT_BIT_TEX4) ? "texcoord4, " : "",
+ (flags & VERT_BIT_TEX5) ? "texcoord5, " : "",
+ (flags & VERT_BIT_TEX6) ? "texcoord6, " : "",
+ (flags & VERT_BIT_TEX7) ? "texcoord7, " : ""
);
}
@@ -70,7 +72,7 @@ void _tnl_print_cassette( struct immediate *IM )
GLuint state = IM->BeginState;
GLuint req = ~0;
- fprintf(stderr, "Cassette id %d, %u rows.\n", IM->id,
+ _mesa_debug(NULL, "Cassette id %d, %u rows.\n", IM->id,
IM->Count - IM->CopyStart);
_tnl_print_vert_flags("Contains at least one", orflag);
@@ -79,91 +81,102 @@ void _tnl_print_cassette( struct immediate *IM )
{
_tnl_print_vert_flags("Contains a full complement of", andflag);
- fprintf(stderr, "Final begin/end state %s/%s, errors %s/%s\n",
- (state & VERT_BEGIN_0) ? "in" : "out",
- (state & VERT_BEGIN_1) ? "in" : "out",
- (state & VERT_ERROR_0) ? "y" : "n",
- (state & VERT_ERROR_1) ? "y" : "n");
+ _mesa_debug(NULL, "Final begin/end state %s/%s, errors %s/%s\n",
+ (state & VERT_BEGIN_0) ? "in" : "out",
+ (state & VERT_BEGIN_1) ? "in" : "out",
+ (state & VERT_ERROR_0) ? "y" : "n",
+ (state & VERT_ERROR_1) ? "y" : "n");
}
- if ((MESA_VERBOSE & VERBOSE_IMMEDIATE) &&
- (MESA_VERBOSE & VERBOSE_VERTS)) {
- for (i = IM->CopyStart ; i <= IM->Count ; i++) {
- fprintf(stderr, "%u: ", i);
- if (req & VERT_OBJ_234) {
- if (flags[i] & VERT_EVAL_C1)
- fprintf(stderr, "EvalCoord %f ", IM->Obj[i][0]);
- else if (flags[i] & VERT_EVAL_P1)
- fprintf(stderr, "EvalPoint %.0f ", IM->Obj[i][0]);
- else if (flags[i] & VERT_EVAL_C2)
- fprintf(stderr, "EvalCoord %f %f ", IM->Obj[i][0], IM->Obj[i][1]);
- else if (flags[i] & VERT_EVAL_P2)
- fprintf(stderr, "EvalPoint %.0f %.0f ", IM->Obj[i][0], IM->Obj[i][1]);
- else if (i < IM->Count && (flags[i]&VERT_OBJ_234)) {
- fprintf(stderr, "Obj %f %f %f %f",
- IM->Obj[i][0], IM->Obj[i][1], IM->Obj[i][2], IM->Obj[i][3]);
- }
+ for (i = IM->CopyStart ; i <= IM->Count ; i++) {
+ _mesa_debug(NULL, "%u: ", i);
+ if (req & VERT_BITS_OBJ_234) {
+ if (flags[i] & VERT_BIT_EVAL_C1)
+ _mesa_debug(NULL, "EvalCoord %f ",
+ IM->Attrib[VERT_ATTRIB_POS][i][0]);
+ else if (flags[i] & VERT_BIT_EVAL_P1)
+ _mesa_debug(NULL, "EvalPoint %.0f ",
+ IM->Attrib[VERT_ATTRIB_POS][i][0]);
+ else if (flags[i] & VERT_BIT_EVAL_C2)
+ _mesa_debug(NULL, "EvalCoord %f %f ",
+ IM->Attrib[VERT_ATTRIB_POS][i][0],
+ IM->Attrib[VERT_ATTRIB_POS][i][1]);
+ else if (flags[i] & VERT_BIT_EVAL_P2)
+ _mesa_debug(NULL, "EvalPoint %.0f %.0f ",
+ IM->Attrib[VERT_ATTRIB_POS][i][0],
+ IM->Attrib[VERT_ATTRIB_POS][i][1]);
+ else if (i < IM->Count && (flags[i] & VERT_BITS_OBJ_234)) {
+ _mesa_debug(NULL, "Obj %f %f %f %f",
+ IM->Attrib[VERT_ATTRIB_POS][i][0],
+ IM->Attrib[VERT_ATTRIB_POS][i][1],
+ IM->Attrib[VERT_ATTRIB_POS][i][2],
+ IM->Attrib[VERT_ATTRIB_POS][i][3]);
}
+ }
- if (req & flags[i] & VERT_ELT)
- fprintf(stderr, " Elt %u\t", IM->Elt[i]);
-
- if (req & flags[i] & VERT_NORM)
- fprintf(stderr, " Norm %f %f %f ",
- IM->Normal[i][0], IM->Normal[i][1], IM->Normal[i][2]);
-
- if (req & flags[i] & VERT_TEX_ANY) {
- GLuint j;
- for (j = 0 ; j < MAX_TEXTURE_UNITS ; j++) {
- if (req & flags[i] & VERT_TEX(j)) {
- fprintf(stderr,
- "TC%d %f %f %f %f",
- j,
- IM->TexCoord[j][i][0], IM->TexCoord[j][i][1],
- IM->TexCoord[j][i][2], IM->TexCoord[j][i][2]);
- }
+ if (req & flags[i] & VERT_BIT_ELT)
+ _mesa_debug(NULL, " Elt %u\t", IM->Elt[i]);
+
+ if (req & flags[i] & VERT_BIT_NORMAL)
+ _mesa_debug(NULL, " Norm %f %f %f ",
+ IM->Attrib[VERT_ATTRIB_NORMAL][i][0],
+ IM->Attrib[VERT_ATTRIB_NORMAL][i][1],
+ IM->Attrib[VERT_ATTRIB_NORMAL][i][2]);
+
+ if (req & flags[i] & VERT_BITS_TEX_ANY) {
+ GLuint j;
+ for (j = 0 ; j < MAX_TEXTURE_UNITS ; j++) {
+ if (req & flags[i] & VERT_BIT_TEX(j)) {
+ _mesa_debug(NULL, "TC%d %f %f %f %f", j,
+ IM->Attrib[VERT_ATTRIB_TEX0 + j][i][0],
+ IM->Attrib[VERT_ATTRIB_TEX0 + j][i][1],
+ IM->Attrib[VERT_ATTRIB_TEX0 + j][i][2],
+ IM->Attrib[VERT_ATTRIB_TEX0 + j][i][3]);
}
}
+ }
- if (req & flags[i] & VERT_RGBA)
- fprintf(stderr, " Rgba %f %f %f %f ",
- IM->Color[i][0], IM->Color[i][1],
- IM->Color[i][2], IM->Color[i][3]);
+ if (req & flags[i] & VERT_BIT_COLOR0)
+ _mesa_debug(NULL, " Rgba %f %f %f %f ",
+ IM->Attrib[VERT_ATTRIB_COLOR0][i][0],
+ IM->Attrib[VERT_ATTRIB_COLOR0][i][1],
+ IM->Attrib[VERT_ATTRIB_COLOR0][i][2],
+ IM->Attrib[VERT_ATTRIB_COLOR0][i][3]);
- if (req & flags[i] & VERT_SPEC_RGB)
- fprintf(stderr, " Spec %f %f %f ",
- IM->SecondaryColor[i][0], IM->SecondaryColor[i][1],
- IM->SecondaryColor[i][2]);
+ if (req & flags[i] & VERT_BIT_COLOR1)
+ _mesa_debug(NULL, " Spec %f %f %f ",
+ IM->Attrib[VERT_ATTRIB_COLOR1][i][0],
+ IM->Attrib[VERT_ATTRIB_COLOR1][i][1],
+ IM->Attrib[VERT_ATTRIB_COLOR1][i][2]);
- if (req & flags[i] & VERT_FOG_COORD)
- fprintf(stderr, " Fog %f ", IM->FogCoord[i]);
+ if (req & flags[i] & VERT_BIT_FOG)
+ _mesa_debug(NULL, " Fog %f ", IM->Attrib[VERT_ATTRIB_FOG][i][0]);
- if (req & flags[i] & VERT_INDEX)
- fprintf(stderr, " Index %u ", IM->Index[i]);
+ if (req & flags[i] & VERT_BIT_INDEX)
+ _mesa_debug(NULL, " Index %u ", IM->Index[i]);
- if (req & flags[i] & VERT_EDGE)
- fprintf(stderr, " Edgeflag %d ", IM->EdgeFlag[i]);
+ if (req & flags[i] & VERT_BIT_EDGEFLAG)
+ _mesa_debug(NULL, " Edgeflag %d ", IM->EdgeFlag[i]);
- if (req & flags[i] & VERT_MATERIAL)
- fprintf(stderr, " Material ");
+ if (req & flags[i] & VERT_BIT_MATERIAL)
+ _mesa_debug(NULL, " Material ");
- /* The order of these two is not easily knowable, but this is
- * the usually correct way to look at them.
- */
- if (req & flags[i] & VERT_END)
- fprintf(stderr, " END ");
+ /* The order of these two is not easily knowable, but this is
+ * the usually correct way to look at them.
+ */
+ if (req & flags[i] & VERT_BIT_END)
+ _mesa_debug(NULL, " END ");
- if (req & flags[i] & VERT_BEGIN)
- fprintf(stderr, " BEGIN(%s) (%s%s%s%s)",
- _mesa_prim_name[IM->Primitive[i] & PRIM_MODE_MASK],
- (IM->Primitive[i] & PRIM_LAST) ? "LAST," : "",
- (IM->Primitive[i] & PRIM_BEGIN) ? "BEGIN," : "",
- (IM->Primitive[i] & PRIM_END) ? "END," : "",
- (IM->Primitive[i] & PRIM_PARITY) ? "PARITY," : "");
+ if (req & flags[i] & VERT_BIT_BEGIN)
+ _mesa_debug(NULL, " BEGIN(%s) (%s%s%s%s)",
+ _mesa_prim_name[IM->Primitive[i] & PRIM_MODE_MASK],
+ (IM->Primitive[i] & PRIM_LAST) ? "LAST," : "",
+ (IM->Primitive[i] & PRIM_BEGIN) ? "BEGIN," : "",
+ (IM->Primitive[i] & PRIM_END) ? "END," : "",
+ (IM->Primitive[i] & PRIM_PARITY) ? "PARITY," : "");
- fprintf(stderr, "\n");
- }
+ _mesa_debug(NULL, "\n");
}
}
diff --git a/xc/extras/Mesa/src/tnl/t_imm_debug.h b/xc/extras/Mesa/src/tnl/t_imm_debug.h
index 2f9853089..91eea9347 100644
--- a/xc/extras/Mesa/src/tnl/t_imm_debug.h
+++ b/xc/extras/Mesa/src/tnl/t_imm_debug.h
@@ -1,4 +1,3 @@
-/* $Id: t_imm_debug.h,v 1.1.1.1 2002/10/22 13:06:18 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#ifndef _T_DEBUG_H
diff --git a/xc/extras/Mesa/src/tnl/t_imm_dlist.c b/xc/extras/Mesa/src/tnl/t_imm_dlist.c
index c9be06e26..e74c944a8 100644
--- a/xc/extras/Mesa/src/tnl/t_imm_dlist.c
+++ b/xc/extras/Mesa/src/tnl/t_imm_dlist.c
@@ -1,10 +1,9 @@
-/* $Id: t_imm_dlist.c,v 1.1.1.1 2002/10/22 13:06:19 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
@@ -33,7 +32,7 @@
#include "dlist.h"
#include "debug.h"
#include "mmath.h"
-#include "mem.h"
+#include "imports.h"
#include "state.h"
#include "t_context.h"
@@ -70,7 +69,7 @@ static void build_normal_lengths( struct immediate *IM )
{
GLuint i;
GLfloat len;
- GLfloat (*data)[3] = IM->Normal + IM->Start;
+ GLfloat (*data)[4] = IM->Attrib[VERT_ATTRIB_NORMAL] + IM->Start;
GLfloat *dest = IM->NormalLengthPtr;
GLuint *flags = IM->Flag + IM->Start;
GLuint count = IM->Count - IM->Start;
@@ -86,7 +85,7 @@ static void build_normal_lengths( struct immediate *IM )
for (i = 0 ; i < count ; ) {
dest[i] = len;
- if (flags[++i] & VERT_NORM) {
+ if (flags[++i] & VERT_BIT_NORMAL) {
len = (GLfloat) LEN_3FV( data[i] );
if (len > 0.0F) len = 1.0F / len;
}
@@ -97,7 +96,7 @@ static void fixup_normal_lengths( struct immediate *IM )
{
GLuint i;
GLfloat len = 1.0F; /* just to silence warnings */
- GLfloat (*data)[3] = IM->Normal;
+ GLfloat (*data)[4] = IM->Attrib[VERT_ATTRIB_NORMAL];
GLfloat *dest = IM->NormalLengthPtr;
GLuint *flags = IM->Flag;
@@ -108,7 +107,7 @@ static void fixup_normal_lengths( struct immediate *IM )
}
if (i < IM->Count) {
- while (!(flags[i] & (VERT_NORM|VERT_END_VB))) {
+ while (!(flags[i] & (VERT_BIT_NORMAL|VERT_BIT_END_VB))) {
dest[i] = len;
i++;
}
@@ -129,7 +128,7 @@ _tnl_compile_cassette( GLcontext *ctx, struct immediate *IM )
GLuint new_beginstate;
if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST)
- fprintf(stderr, "_tnl_compiled_cassette IM: %d\n", IM->id);
+ _mesa_debug(ctx, "_tnl_compiled_cassette IM: %d\n", IM->id);
if (IM->FlushElt) {
ASSERT (IM->FlushElt == FLUSH_ELT_LAZY);
@@ -142,8 +141,8 @@ _tnl_compile_cassette( GLcontext *ctx, struct immediate *IM )
* array-elements have been translated away by now, so it's ok to
* remove it.)
*/
- IM->OrFlag &= ~VERT_ELT;
- IM->AndFlag &= ~VERT_ELT;
+ IM->OrFlag &= ~VERT_BIT_ELT;
+ IM->AndFlag &= ~VERT_BIT_ELT;
_tnl_fixup_input( ctx, IM );
@@ -225,17 +224,17 @@ static void fixup_compiled_primitives( GLcontext *ctx, struct immediate *IM )
_mesa_error( ctx, GL_INVALID_OPERATION, "glBegin/glEnd");
for (i = IM->Start ; i <= IM->Count ; i += IM->PrimitiveLength[i])
- if (IM->Flag[i] & (VERT_BEGIN|VERT_END_VB))
+ if (IM->Flag[i] & (VERT_BIT_BEGIN|VERT_BIT_END_VB))
break;
/* Would like to just ignore vertices upto this point. Can't
* set copystart because it might skip materials?
*/
ASSERT(IM->Start == IM->CopyStart);
- if (i > IM->CopyStart || !(IM->Flag[IM->Start] & VERT_BEGIN)) {
+ if (i > IM->CopyStart || !(IM->Flag[IM->Start] & VERT_BIT_BEGIN)) {
IM->Primitive[IM->CopyStart] = GL_POLYGON+1;
IM->PrimitiveLength[IM->CopyStart] = i - IM->CopyStart;
- if (IM->Flag[i] & VERT_END_VB) {
+ if (IM->Flag[i] & VERT_BIT_END_VB) {
IM->Primitive[IM->CopyStart] |= PRIM_LAST;
IM->LastPrimitive = IM->CopyStart;
}
@@ -247,7 +246,7 @@ static void fixup_compiled_primitives( GLcontext *ctx, struct immediate *IM )
_mesa_error( ctx, GL_INVALID_OPERATION, "glBegin/glEnd");
if (IM->CopyStart == IM->Start &&
- IM->Flag[IM->Start] & (VERT_END|VERT_END_VB))
+ IM->Flag[IM->Start] & (VERT_BIT_END | VERT_BIT_END_VB))
{
}
else
@@ -259,16 +258,16 @@ static void fixup_compiled_primitives( GLcontext *ctx, struct immediate *IM )
/* one of these should be true, else we'll be in an infinite loop
*/
ASSERT(IM->PrimitiveLength[IM->Start] > 0 ||
- IM->Flag[IM->Start] & (VERT_END|VERT_END_VB));
+ IM->Flag[IM->Start] & (VERT_BIT_END | VERT_BIT_END_VB));
for (i = IM->Start ; i <= IM->Count ; i += IM->PrimitiveLength[i])
- if (IM->Flag[i] & (VERT_END|VERT_END_VB)) {
+ if (IM->Flag[i] & (VERT_BIT_END | VERT_BIT_END_VB)) {
IM->PrimitiveLength[IM->CopyStart] = i - IM->CopyStart;
- if (IM->Flag[i] & VERT_END_VB) {
+ if (IM->Flag[i] & VERT_BIT_END_VB) {
IM->Primitive[IM->CopyStart] |= PRIM_LAST;
IM->LastPrimitive = IM->CopyStart;
}
- if (IM->Flag[i] & VERT_END) {
+ if (IM->Flag[i] & VERT_BIT_END) {
IM->Primitive[IM->CopyStart] |= PRIM_END;
}
break;
@@ -296,8 +295,7 @@ execute_compiled_cassette( GLcontext *ctx, void *data )
TNLvertexcassette *node = (TNLvertexcassette *)data;
struct immediate *IM = node->IM;
- if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST)
- fprintf(stderr, "execute_compiled_cassette IM: %d\n", IM->id);
+/* _mesa_debug("%s\n", __FUNCTION__); */
IM->Start = node->Start;
IM->CopyStart = node->Start;
@@ -313,15 +311,13 @@ execute_compiled_cassette( GLcontext *ctx, void *data )
IM->MaterialOrMask = node->MaterialOrMask;
IM->MaterialAndMask = node->MaterialAndMask;
-
if ((MESA_VERBOSE & VERBOSE_DISPLAY_LIST) &&
(MESA_VERBOSE & VERBOSE_IMMEDIATE))
_tnl_print_cassette( IM );
if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST) {
- fprintf(stderr, "Run cassette %d, rows %d..%d, beginstate %x ",
- IM->id,
- IM->Start, IM->Count, IM->BeginState);
+ _mesa_debug(ctx, "Run cassette %d, rows %d..%d, beginstate %x ",
+ IM->id, IM->Start, IM->Count, IM->BeginState);
_tnl_print_vert_flags("orflag", IM->OrFlag);
}
@@ -368,12 +364,6 @@ execute_compiled_cassette( GLcontext *ctx, void *data )
IM->Primitive[IM->LastPrimitive] & PRIM_MODE_MASK;
}
-/* fprintf(stderr, "%s: IM->Primitive[%d]: %x, CurrExecPrim: %x\n", */
-/* __FUNCTION__, */
-/* IM->LastPrimitive, */
-/* IM->Primitive[IM->LastPrimitive], */
-/* ctx->Driver.CurrentExecPrimitive); */
-
_tnl_get_exec_copy_verts( ctx, IM );
if (IM->NormalLengthPtr)
@@ -409,8 +399,8 @@ print_compiled_cassette( GLcontext *ctx, void *data )
TNLvertexcassette *node = (TNLvertexcassette *)data;
struct immediate *IM = node->IM;
- fprintf(stderr, "TNL-VERTEX-CASSETTE, id %u, rows %u..%u\n",
- node->IM->id, node->Start, node->Count);
+ _mesa_debug(ctx, "TNL-VERTEX-CASSETTE, id %u, rows %u..%u\n",
+ node->IM->id, node->Start, node->Count);
IM->Start = node->Start;
IM->CopyStart = node->Start;
@@ -433,7 +423,7 @@ _tnl_BeginCallList( GLcontext *ctx, GLuint list )
{
(void) ctx;
(void) list;
- FLUSH_CURRENT(ctx, 0); /* Current immediate is emptied on CallList */
+ FLUSH_CURRENT(ctx, 0);
}
@@ -581,17 +571,15 @@ static void loopback_compiled_cassette( GLcontext *ctx, struct immediate *IM )
void (GLAPIENTRY *texcoordfv[MAX_TEXTURE_UNITS])( GLenum, const GLfloat * );
GLuint maxtex = 0;
GLuint p, length, prim = 0;
-
-/* _tnl_print_vert_flags(__FUNCTION__, orflag); */
-
- if (orflag & VERT_OBJ_234)
+
+ if (orflag & VERT_BITS_OBJ_234)
vertex = (void (GLAPIENTRY *)(const GLfloat *)) glVertex4fv;
else
vertex = (void (GLAPIENTRY *)(const GLfloat *)) glVertex3fv;
- if (orflag & VERT_TEX_ANY) {
+ if (orflag & VERT_BITS_TEX_ANY) {
for (j = 0 ; j < ctx->Const.MaxTextureUnits ; j++) {
- if (orflag & VERT_TEX(j)) {
+ if (orflag & VERT_BIT_TEX(j)) {
maxtex = j+1;
if ((IM->TexSize & TEX_SIZE_4(j)) == TEX_SIZE_4(j))
texcoordfv[j] = glMultiTexCoord4fvARB;
@@ -615,49 +603,49 @@ static void loopback_compiled_cassette( GLcontext *ctx, struct immediate *IM )
}
for ( i = p ; i <= p+length ; i++) {
- if (flags[i] & VERT_TEX_ANY) {
+ if (flags[i] & VERT_BITS_TEX_ANY) {
GLuint k;
for (k = 0 ; k < maxtex ; k++) {
- if (flags[i] & VERT_TEX(k)) {
- texcoordfv[k]( GL_TEXTURE0_ARB + k, IM->TexCoord[k][i] );
+ if (flags[i] & VERT_BIT_TEX(k)) {
+ texcoordfv[k]( GL_TEXTURE0_ARB + k,
+ IM->Attrib[VERT_ATTRIB_TEX0 + k][i] );
}
}
}
- if (flags[i] & VERT_NORM) {
- glNormal3fv(IM->Normal[i]);
- }
+ if (flags[i] & VERT_BIT_NORMAL)
+ glNormal3fv(IM->Attrib[VERT_ATTRIB_NORMAL][i]);
- if (flags[i] & VERT_RGBA) {
- glColor4fv( IM->Color[i] );
- }
+ if (flags[i] & VERT_BIT_COLOR0)
+ glColor4fv( IM->Attrib[VERT_ATTRIB_COLOR0][i] );
- if (flags[i] & VERT_SPEC_RGB)
- _glapi_Dispatch->SecondaryColor3fvEXT( IM->SecondaryColor[i] );
+ if (flags[i] & VERT_BIT_COLOR1)
+ _glapi_Dispatch->SecondaryColor3fvEXT( IM->Attrib[VERT_ATTRIB_COLOR1][i] );
- if (flags[i] & VERT_FOG_COORD)
- _glapi_Dispatch->FogCoordfEXT( IM->FogCoord[i] );
+ if (flags[i] & VERT_BIT_FOG)
+ _glapi_Dispatch->FogCoordfEXT( IM->Attrib[VERT_ATTRIB_FOG][i][0] );
- if (flags[i] & VERT_INDEX)
+ if (flags[i] & VERT_BIT_INDEX)
glIndexi( IM->Index[i] );
- if (flags[i] & VERT_EDGE)
+ if (flags[i] & VERT_BIT_EDGEFLAG)
glEdgeFlag( IM->EdgeFlag[i] );
- if (flags[i] & VERT_MATERIAL)
+ if (flags[i] & VERT_BIT_MATERIAL)
emit_material( IM->Material[i], IM->MaterialMask[i] );
- if (flags[i]&VERT_OBJ_234) {
- vertex( IM->Obj[i] );
- }
- else if (flags[i] & VERT_EVAL_C1)
- glEvalCoord1f( IM->Obj[i][0] );
- else if (flags[i] & VERT_EVAL_P1)
- glEvalPoint1( (GLint) IM->Obj[i][0] );
- else if (flags[i] & VERT_EVAL_C2)
- glEvalCoord2f( IM->Obj[i][0], IM->Obj[i][1] );
- else if (flags[i] & VERT_EVAL_P2)
- glEvalPoint2( (GLint) IM->Obj[i][0], (GLint) IM->Obj[i][1] );
+ if (flags[i]&VERT_BITS_OBJ_234)
+ vertex( IM->Attrib[VERT_ATTRIB_POS][i] );
+ else if (flags[i] & VERT_BIT_EVAL_C1)
+ glEvalCoord1f( IM->Attrib[VERT_ATTRIB_POS][i][0] );
+ else if (flags[i] & VERT_BIT_EVAL_P1)
+ glEvalPoint1( (GLint) IM->Attrib[VERT_ATTRIB_POS][i][0] );
+ else if (flags[i] & VERT_BIT_EVAL_C2)
+ glEvalCoord2f( IM->Attrib[VERT_ATTRIB_POS][i][0],
+ IM->Attrib[VERT_ATTRIB_POS][i][1] );
+ else if (flags[i] & VERT_BIT_EVAL_P2)
+ glEvalPoint2( (GLint) IM->Attrib[VERT_ATTRIB_POS][i][0],
+ (GLint) IM->Attrib[VERT_ATTRIB_POS][i][1] );
}
if (prim & PRIM_END) {
diff --git a/xc/extras/Mesa/src/tnl/t_imm_dlist.h b/xc/extras/Mesa/src/tnl/t_imm_dlist.h
index c11ebf2e5..e12d4c053 100644
--- a/xc/extras/Mesa/src/tnl/t_imm_dlist.h
+++ b/xc/extras/Mesa/src/tnl/t_imm_dlist.h
@@ -1,4 +1,3 @@
-/* $Id: t_imm_dlist.h,v 1.1.1.1 2002/10/22 13:06:19 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#ifndef _T_DLIST_H
diff --git a/xc/extras/Mesa/src/tnl/t_imm_elt.c b/xc/extras/Mesa/src/tnl/t_imm_elt.c
index e153264bb..254b78d7f 100644
--- a/xc/extras/Mesa/src/tnl/t_imm_elt.c
+++ b/xc/extras/Mesa/src/tnl/t_imm_elt.c
@@ -1,10 +1,9 @@
-/* $Id: t_imm_elt.c,v 1.1.1.1 2002/10/22 13:06:25 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,12 +23,13 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#include "glheader.h"
#include "colormac.h"
-#include "mem.h"
+#include "context.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
@@ -138,7 +138,7 @@ static trans_elt_4f_func _tnl_trans_elt_4f_tab[5][MAX_TYPES];
GLuint start, GLuint n
#define SRC_START 0
#define DST_START start
-#define CHECK if ((flags[i]&match) == VERT_ELT)
+#define CHECK if ((flags[i]&match) == VERT_BIT_ELT)
#define NEXT_F (void)1
#define NEXT_F2 f = first + elts[i] * stride;
@@ -597,6 +597,7 @@ void _tnl_imm_elt_init( void )
}
+#if 00
static void _tnl_trans_elt_1f(GLfloat *to,
const struct gl_client_array *from,
GLuint *flags,
@@ -615,6 +616,7 @@ static void _tnl_trans_elt_1f(GLfloat *to,
n );
}
+#endif
static void _tnl_trans_elt_1ui(GLuint *to,
const struct gl_client_array *from,
@@ -719,6 +721,7 @@ static void _tnl_trans_elt_4f(GLfloat (*to)[4],
+#if 0
static void _tnl_trans_elt_3f(GLfloat (*to)[3],
const struct gl_client_array *from,
GLuint *flags,
@@ -736,7 +739,7 @@ static void _tnl_trans_elt_3f(GLfloat (*to)[3],
start,
n );
}
-
+#endif
@@ -754,66 +757,66 @@ void _tnl_translate_array_elts( GLcontext *ctx, struct immediate *IM,
GLuint translate = ctx->Array._Enabled;
GLuint i;
- if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
- fprintf(stderr, "exec_array_elements %d .. %d\n", start, count);
+ if (MESA_VERBOSE & VERBOSE_IMMEDIATE)
+ _mesa_debug(ctx, "exec_array_elements %d .. %d\n", start, count);
- if (translate & VERT_OBJ) {
- _tnl_trans_elt_4f( IM->Obj,
+ if (translate & VERT_BIT_POS) {
+ _tnl_trans_elt_4f( IM->Attrib[VERT_ATTRIB_POS],
&ctx->Array.Vertex,
- flags, elts, (VERT_ELT|VERT_OBJ),
+ flags, elts, (VERT_BIT_ELT|VERT_BIT_POS),
start, count);
if (ctx->Array.Vertex.Size == 4)
- translate |= VERT_OBJ_234;
+ translate |= VERT_BITS_OBJ_234;
else if (ctx->Array.Vertex.Size == 3)
- translate |= VERT_OBJ_23;
+ translate |= VERT_BITS_OBJ_23;
}
- if (translate & VERT_NORM)
- _tnl_trans_elt_3f( IM->Normal,
+ if (translate & VERT_BIT_NORMAL)
+ _tnl_trans_elt_4f( IM->Attrib[VERT_ATTRIB_NORMAL],
&ctx->Array.Normal,
- flags, elts, (VERT_ELT|VERT_NORM),
+ flags, elts, (VERT_BIT_ELT|VERT_BIT_NORMAL),
start, count);
- if (translate & VERT_EDGE)
+ if (translate & VERT_BIT_EDGEFLAG)
_tnl_trans_elt_1ub( IM->EdgeFlag,
&ctx->Array.EdgeFlag,
- flags, elts, (VERT_ELT|VERT_EDGE),
+ flags, elts, (VERT_BIT_ELT|VERT_BIT_EDGEFLAG),
start, count);
- if (translate & VERT_RGBA) {
- _tnl_trans_elt_4f( IM->Color,
+ if (translate & VERT_BIT_COLOR0) {
+ _tnl_trans_elt_4f( IM->Attrib[VERT_ATTRIB_COLOR0],
&ctx->Array.Color,
- flags, elts, (VERT_ELT|VERT_RGBA),
+ flags, elts, (VERT_BIT_ELT|VERT_BIT_COLOR0),
start, count);
}
- if (translate & VERT_SPEC_RGB) {
- _tnl_trans_elt_4f( IM->SecondaryColor,
+ if (translate & VERT_BIT_COLOR1) {
+ _tnl_trans_elt_4f( IM->Attrib[VERT_ATTRIB_COLOR1],
&ctx->Array.SecondaryColor,
- flags, elts, (VERT_ELT|VERT_SPEC_RGB),
+ flags, elts, (VERT_BIT_ELT|VERT_BIT_COLOR1),
start, count);
}
- if (translate & VERT_FOG_COORD)
- _tnl_trans_elt_1f( IM->FogCoord,
+ if (translate & VERT_BIT_FOG)
+ _tnl_trans_elt_4f( IM->Attrib[VERT_ATTRIB_FOG],
&ctx->Array.FogCoord,
- flags, elts, (VERT_ELT|VERT_FOG_COORD),
+ flags, elts, (VERT_BIT_ELT|VERT_BIT_FOG),
start, count);
- if (translate & VERT_INDEX)
+ if (translate & VERT_BIT_INDEX)
_tnl_trans_elt_1ui( IM->Index,
&ctx->Array.Index,
- flags, elts, (VERT_ELT|VERT_INDEX),
+ flags, elts, (VERT_BIT_ELT|VERT_BIT_INDEX),
start, count);
- if (translate & VERT_TEX_ANY) {
+ if (translate & VERT_BITS_TEX_ANY) {
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
- if (translate & VERT_TEX(i)) {
- _tnl_trans_elt_4f( IM->TexCoord[i],
+ if (translate & VERT_BIT_TEX(i)) {
+ _tnl_trans_elt_4f( IM->Attrib[VERT_ATTRIB_TEX0 + i],
&ctx->Array.TexCoord[i],
- flags, elts, (VERT_ELT|VERT_TEX(i)),
+ flags, elts, (VERT_BIT_ELT|VERT_BIT_TEX(i)),
start, count);
if (ctx->Array.TexCoord[i].Size == 4)
@@ -824,7 +827,7 @@ void _tnl_translate_array_elts( GLcontext *ctx, struct immediate *IM,
}
for (i = start ; i < count ; i++)
- if (flags[i] & VERT_ELT) flags[i] |= translate;
+ if (flags[i] & VERT_BIT_ELT) flags[i] |= translate;
IM->FlushElt = 0;
}
diff --git a/xc/extras/Mesa/src/tnl/t_imm_elt.h b/xc/extras/Mesa/src/tnl/t_imm_elt.h
index d5088edcf..811cb17c3 100644
--- a/xc/extras/Mesa/src/tnl/t_imm_elt.h
+++ b/xc/extras/Mesa/src/tnl/t_imm_elt.h
@@ -1,4 +1,3 @@
-/* $Id: t_imm_elt.h,v 1.1.1.1 2002/10/22 13:06:25 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
diff --git a/xc/extras/Mesa/src/tnl/t_imm_eval.c b/xc/extras/Mesa/src/tnl/t_imm_eval.c
index e0dd25800..d71845320 100644
--- a/xc/extras/Mesa/src/tnl/t_imm_eval.c
+++ b/xc/extras/Mesa/src/tnl/t_imm_eval.c
@@ -1,10 +1,9 @@
-/* $Id: t_imm_eval.c,v 1.1.1.1 2002/10/22 13:06:23 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,8 +23,8 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
- *
+ * Keith Whitwell <keith@tungstengraphics.com>
+ * Brian Paul - vertex program updates
*/
@@ -33,7 +32,7 @@
#include "colormac.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
#include "math/m_eval.h"
@@ -52,11 +51,11 @@ static void eval_points1( GLfloat outcoord[][4],
GLfloat du, GLfloat u1 )
{
GLuint i;
- for (i = 0 ; !(flags[i] & VERT_END_VB) ; i++)
- if (flags[i] & VERT_EVAL_ANY) {
+ for (i = 0 ; !(flags[i] & VERT_BIT_END_VB) ; i++)
+ if (flags[i] & VERT_BITS_EVAL_ANY) {
outcoord[i][0] = coord[i][0];
outcoord[i][1] = coord[i][1];
- if (flags[i] & VERT_EVAL_P1)
+ if (flags[i] & VERT_BIT_EVAL_P1)
outcoord[i][0] = coord[i][0] * du + u1;
}
}
@@ -68,11 +67,11 @@ static void eval_points2( GLfloat outcoord[][4],
GLfloat dv, GLfloat v1 )
{
GLuint i;
- for (i = 0 ; !(flags[i] & VERT_END_VB) ; i++) {
- if (flags[i] & VERT_EVAL_ANY) {
+ for (i = 0 ; !(flags[i] & VERT_BIT_END_VB) ; i++) {
+ if (flags[i] & VERT_BITS_EVAL_ANY) {
outcoord[i][0] = coord[i][0];
outcoord[i][1] = coord[i][1];
- if (flags[i] & VERT_EVAL_P2) {
+ if (flags[i] & VERT_BIT_EVAL_P2) {
outcoord[i][0] = coord[i][0] * du + u1;
outcoord[i][1] = coord[i][1] * dv + v1;
}
@@ -93,15 +92,15 @@ static void eval1_4f( GLvector4f *dest,
GLfloat coord[][4],
const GLuint *flags,
GLuint dimension,
- struct gl_1d_map *map )
+ const struct gl_1d_map *map )
{
const GLfloat u1 = map->u1;
const GLfloat du = map->du;
GLfloat (*to)[4] = dest->data;
GLuint i;
- for (i = 0 ; !(flags[i] & VERT_END_VB) ; i++)
- if (flags[i] & (VERT_EVAL_C1|VERT_EVAL_P1)) {
+ for (i = 0 ; !(flags[i] & VERT_BIT_END_VB) ; i++)
+ if (flags[i] & (VERT_BIT_EVAL_C1|VERT_BIT_EVAL_P1)) {
GLfloat u = (coord[i][0] - u1) * du;
ASSIGN_4V(to[i], 0,0,0,1);
_math_horner_bezier_curve(map->Points, to[i], u,
@@ -112,11 +111,13 @@ static void eval1_4f( GLvector4f *dest,
dest->flags |= dirty_flags[dimension];
}
+
+/* as above, but dest is a gl_client_array */
static void eval1_4f_ca( struct gl_client_array *dest,
GLfloat coord[][4],
const GLuint *flags,
GLuint dimension,
- struct gl_1d_map *map )
+ const struct gl_1d_map *map )
{
const GLfloat u1 = map->u1;
const GLfloat du = map->du;
@@ -126,8 +127,8 @@ static void eval1_4f_ca( struct gl_client_array *dest,
ASSERT(dest->Type == GL_FLOAT);
ASSERT(dest->StrideB == 4 * sizeof(GLfloat));
- for (i = 0 ; !(flags[i] & VERT_END_VB) ; i++)
- if (flags[i] & (VERT_EVAL_C1|VERT_EVAL_P1)) {
+ for (i = 0 ; !(flags[i] & VERT_BIT_END_VB) ; i++)
+ if (flags[i] & (VERT_BIT_EVAL_C1|VERT_BIT_EVAL_P1)) {
GLfloat u = (coord[i][0] - u1) * du;
ASSIGN_4V(to[i], 0,0,0,1);
_math_horner_bezier_curve(map->Points, to[i], u,
@@ -141,15 +142,15 @@ static void eval1_4f_ca( struct gl_client_array *dest,
static void eval1_1ui( GLvector1ui *dest,
GLfloat coord[][4],
const GLuint *flags,
- struct gl_1d_map *map )
+ const struct gl_1d_map *map )
{
const GLfloat u1 = map->u1;
const GLfloat du = map->du;
GLuint *to = dest->data;
GLuint i;
- for (i = 0 ; !(flags[i] & VERT_END_VB) ; i++)
- if (flags[i] & (VERT_EVAL_C1|VERT_EVAL_P1)) {
+ for (i = 0 ; !(flags[i] & VERT_BIT_END_VB) ; i++)
+ if (flags[i] & (VERT_BIT_EVAL_C1|VERT_BIT_EVAL_P1)) {
GLfloat u = (coord[i][0] - u1) * du;
GLfloat tmp;
_math_horner_bezier_curve(map->Points, &tmp, u, 1, map->Order);
@@ -158,46 +159,41 @@ static void eval1_1ui( GLvector1ui *dest,
}
-static void eval1_norm( GLvector3f *dest,
+static void eval1_norm( GLvector4f *dest,
GLfloat coord[][4],
const GLuint *flags,
- struct gl_1d_map *map )
+ const struct gl_1d_map *map )
{
const GLfloat u1 = map->u1;
const GLfloat du = map->du;
- GLfloat (*to)[3] = dest->data;
+ GLfloat (*to)[4] = dest->data;
GLuint i;
- for (i = 0 ; !(flags[i] & VERT_END_VB) ; i++)
- if (flags[i] & (VERT_EVAL_C1|VERT_EVAL_P1)) {
+ for (i = 0 ; !(flags[i] & VERT_BIT_END_VB) ; i++)
+ if (flags[i] & (VERT_BIT_EVAL_C1|VERT_BIT_EVAL_P1)) {
GLfloat u = (coord[i][0] - u1) * du;
_math_horner_bezier_curve(map->Points, to[i], u, 3, map->Order);
}
}
-
-
-
static void eval2_obj_norm( GLvector4f *obj_ptr,
- GLvector3f *norm_ptr,
+ GLvector4f *norm_ptr,
GLfloat coord[][4],
GLuint *flags,
GLuint dimension,
- struct gl_2d_map *map )
+ const struct gl_2d_map *map )
{
const GLfloat u1 = map->u1;
const GLfloat du = map->du;
const GLfloat v1 = map->v1;
const GLfloat dv = map->dv;
GLfloat (*obj)[4] = obj_ptr->data;
- GLfloat (*normal)[3] = norm_ptr->data;
+ GLfloat (*normal)[4] = norm_ptr->data;
GLuint i;
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-
- for (i = 0 ; !(flags[i] & VERT_END_VB) ; i++)
- if (flags[i] & (VERT_EVAL_C2|VERT_EVAL_P2)) {
+ for (i = 0 ; !(flags[i] & VERT_BIT_END_VB) ; i++)
+ if (flags[i] & (VERT_BIT_EVAL_C2|VERT_BIT_EVAL_P2)) {
GLfloat u = (coord[i][0] - u1) * du;
GLfloat v = (coord[i][1] - v1) * dv;
GLfloat du[4], dv[4];
@@ -229,7 +225,7 @@ static void eval2_4f( GLvector4f *dest,
GLfloat coord[][4],
const GLuint *flags,
GLuint dimension,
- struct gl_2d_map *map )
+ const struct gl_2d_map *map )
{
const GLfloat u1 = map->u1;
const GLfloat du = map->du;
@@ -238,8 +234,8 @@ static void eval2_4f( GLvector4f *dest,
GLfloat (*to)[4] = dest->data;
GLuint i;
- for (i = 0 ; !(flags[i] & VERT_END_VB) ; i++)
- if (flags[i] & (VERT_EVAL_C2|VERT_EVAL_P2)) {
+ for (i = 0 ; !(flags[i] & VERT_BIT_END_VB) ; i++)
+ if (flags[i] & (VERT_BIT_EVAL_C2|VERT_BIT_EVAL_P2)) {
GLfloat u = (coord[i][0] - u1) * du;
GLfloat v = (coord[i][1] - v1) * dv;
@@ -251,11 +247,13 @@ static void eval2_4f( GLvector4f *dest,
dest->flags |= dirty_flags[dimension];
}
+
+/* as above, but dest is a gl_client_array */
static void eval2_4f_ca( struct gl_client_array *dest,
GLfloat coord[][4],
const GLuint *flags,
GLuint dimension,
- struct gl_2d_map *map )
+ const struct gl_2d_map *map )
{
const GLfloat u1 = map->u1;
const GLfloat du = map->du;
@@ -267,8 +265,8 @@ static void eval2_4f_ca( struct gl_client_array *dest,
ASSERT(dest->Type == GL_FLOAT);
ASSERT(dest->StrideB == 4 * sizeof(GLfloat));
- for (i = 0 ; !(flags[i] & VERT_END_VB) ; i++)
- if (flags[i] & (VERT_EVAL_C2|VERT_EVAL_P2)) {
+ for (i = 0 ; !(flags[i] & VERT_BIT_END_VB) ; i++)
+ if (flags[i] & (VERT_BIT_EVAL_C2|VERT_BIT_EVAL_P2)) {
GLfloat u = (coord[i][0] - u1) * du;
GLfloat v = (coord[i][1] - v1) * dv;
_math_horner_bezier_surf(map->Points, to[i], u, v, dimension,
@@ -279,33 +277,33 @@ static void eval2_4f_ca( struct gl_client_array *dest,
}
-static void eval2_norm( GLvector3f *dest,
+static void eval2_norm( GLvector4f *dest,
GLfloat coord[][4],
GLuint *flags,
- struct gl_2d_map *map )
+ const struct gl_2d_map *map )
{
const GLfloat u1 = map->u1;
const GLfloat du = map->du;
const GLfloat v1 = map->v1;
const GLfloat dv = map->dv;
- GLfloat (*to)[3] = dest->data;
+ GLfloat (*to)[4] = dest->data;
GLuint i;
- for (i = 0 ; !(flags[i] & VERT_END_VB) ; i++)
- if (flags[i] & (VERT_EVAL_C2|VERT_EVAL_P2)) {
+ for (i = 0 ; !(flags[i] & VERT_BIT_END_VB) ; i++) {
+ if (flags[i] & (VERT_BIT_EVAL_C2|VERT_BIT_EVAL_P2)) {
GLfloat u = (coord[i][0] - u1) * du;
GLfloat v = (coord[i][1] - v1) * dv;
_math_horner_bezier_surf(map->Points, to[i], u, v, 3,
map->Uorder, map->Vorder);
- }
-
+ }
+ }
}
static void eval2_1ui( GLvector1ui *dest,
GLfloat coord[][4],
const GLuint *flags,
- struct gl_2d_map *map )
+ const struct gl_2d_map *map )
{
const GLfloat u1 = map->u1;
const GLfloat du = map->du;
@@ -314,8 +312,8 @@ static void eval2_1ui( GLvector1ui *dest,
GLuint *to = dest->data;
GLuint i;
- for (i = 0 ; !(flags[i] & VERT_END_VB) ; i++)
- if (flags[i] & (VERT_EVAL_C2|VERT_EVAL_P2)) {
+ for (i = 0 ; !(flags[i] & VERT_BIT_END_VB) ; i++)
+ if (flags[i] & (VERT_BIT_EVAL_C2|VERT_BIT_EVAL_P2)) {
GLfloat u = (coord[i][0] - u1) * du;
GLfloat v = (coord[i][1] - v1) * dv;
GLfloat tmp;
@@ -327,16 +325,12 @@ static void eval2_1ui( GLvector1ui *dest,
}
-
-
-
-
static void copy_4f( GLfloat to[][4], GLfloat from[][4], GLuint count )
{
MEMCPY( to, from, count * sizeof(to[0]));
}
-static void copy_4f_stride( GLfloat to[][4], GLfloat *from,
+static void copy_4f_stride( GLfloat to[][4], const GLfloat *from,
GLuint stride, GLuint count )
{
if (stride == 4 * sizeof(GLfloat))
@@ -348,7 +342,7 @@ static void copy_4f_stride( GLfloat to[][4], GLfloat *from,
}
}
-static void copy_3f( GLfloat to[][3], GLfloat from[][3], GLuint count )
+static void copy_3f( GLfloat to[][4], GLfloat from[][4], GLuint count )
{
GLuint i;
for (i = 0 ; i < count ; i++) {
@@ -357,7 +351,7 @@ static void copy_3f( GLfloat to[][3], GLfloat from[][3], GLuint count )
}
-static void copy_1ui( GLuint to[], GLuint from[], GLuint count )
+static void copy_1ui( GLuint to[], const GLuint from[], GLuint count )
{
MEMCPY( to, from, (count) * sizeof(to[0]));
}
@@ -370,58 +364,71 @@ static void update_eval( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint eval1 = 0, eval2 = 0;
+ GLuint i;
if (ctx->Eval.Map1Index)
- eval1 |= VERT_INDEX;
+ eval1 |= VERT_BIT_INDEX;
if (ctx->Eval.Map2Index)
- eval2 |= VERT_INDEX;
+ eval2 |= VERT_BIT_INDEX;
if (ctx->Eval.Map1Color4)
- eval1 |= VERT_RGBA;
+ eval1 |= VERT_BIT_COLOR0;
if (ctx->Eval.Map2Color4)
- eval2 |= VERT_RGBA;
+ eval2 |= VERT_BIT_COLOR0;
if (ctx->Eval.Map1Normal)
- eval1 |= VERT_NORM;
+ eval1 |= VERT_BIT_NORMAL;
if (ctx->Eval.Map2Normal)
- eval2 |= VERT_NORM;
+ eval2 |= VERT_BIT_NORMAL;
if (ctx->Eval.Map1TextureCoord4 ||
ctx->Eval.Map1TextureCoord3 ||
ctx->Eval.Map1TextureCoord2 ||
ctx->Eval.Map1TextureCoord1)
- eval1 |= VERT_TEX0;
+ eval1 |= VERT_BIT_TEX0;
if (ctx->Eval.Map2TextureCoord4 ||
ctx->Eval.Map2TextureCoord3 ||
ctx->Eval.Map2TextureCoord2 ||
ctx->Eval.Map2TextureCoord1)
- eval2 |= VERT_TEX0;
+ eval2 |= VERT_BIT_TEX0;
if (ctx->Eval.Map1Vertex4)
- eval1 |= VERT_OBJ_234;
+ eval1 |= VERT_BITS_OBJ_234;
if (ctx->Eval.Map1Vertex3)
- eval1 |= VERT_OBJ_23;
+ eval1 |= VERT_BITS_OBJ_23;
if (ctx->Eval.Map2Vertex4) {
if (ctx->Eval.AutoNormal)
- eval2 |= VERT_OBJ_234 | VERT_NORM;
+ eval2 |= VERT_BITS_OBJ_234 | VERT_BIT_NORMAL;
else
- eval2 |= VERT_OBJ_234;
+ eval2 |= VERT_BITS_OBJ_234;
}
else if (ctx->Eval.Map2Vertex3) {
if (ctx->Eval.AutoNormal)
- eval2 |= VERT_OBJ_23 | VERT_NORM;
+ eval2 |= VERT_BITS_OBJ_23 | VERT_BIT_NORMAL;
else
- eval2 |= VERT_OBJ_23;
+ eval2 |= VERT_BITS_OBJ_23;
}
tnl->eval.EvalMap1Flags = eval1;
tnl->eval.EvalMap2Flags = eval2;
+
+ /* GL_NV_vertex_program evaluators */
+ eval1 = eval2 = 0;
+ for (i = 0; i < VERT_ATTRIB_MAX; i++) {
+ if (ctx->Eval.Map1Attrib[i])
+ eval1 |= (1 << i);
+ if (ctx->Eval.Map2Attrib[i])
+ eval2 |= (1 << i);
+ }
+ tnl->eval.EvalMap1AttribFlags = eval1;
+ tnl->eval.EvalMap2AttribFlags = eval2;
+
tnl->eval.EvalNewState = 0;
}
@@ -441,13 +448,13 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM )
GLuint *flags = IM->Flag + IM->CopyStart;
GLuint copycount;
GLuint orflag = IM->OrFlag;
- GLuint any_eval1 = orflag & (VERT_EVAL_C1|VERT_EVAL_P1);
- GLuint any_eval2 = orflag & (VERT_EVAL_C2|VERT_EVAL_P2);
+ GLuint any_eval1 = orflag & (VERT_BIT_EVAL_C1|VERT_BIT_EVAL_P1);
+ GLuint any_eval2 = orflag & (VERT_BIT_EVAL_C2|VERT_BIT_EVAL_P2);
GLuint req = 0;
GLuint purge_flags = 0;
- GLfloat (*coord)[4] = IM->Obj + IM->CopyStart;
+ GLfloat (*coord)[4] = IM->Attrib[VERT_ATTRIB_POS] + IM->CopyStart;
- if (IM->AndFlag & VERT_EVAL_ANY)
+ if (IM->AndFlag & VERT_BITS_EVAL_ANY)
copycount = IM->Start - IM->CopyStart; /* just copy copied vertices */
else
copycount = IM->Count - IM->CopyStart; /* copy all vertices */
@@ -459,46 +466,46 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM )
update_eval( ctx );
if (any_eval1) {
- req |= tnl->pipeline.inputs & tnl->eval.EvalMap1Flags;
+ req |= tnl->pipeline.inputs
+ & (tnl->eval.EvalMap1Flags | tnl->eval.EvalMap1AttribFlags);
- if (!ctx->Eval.Map1Vertex4 && !ctx->Eval.Map1Vertex3)
- purge_flags = (VERT_EVAL_P1|VERT_EVAL_C1);
+ if (!ctx->Eval.Map1Vertex4 && !ctx->Eval.Map1Vertex3 &&
+ !ctx->Eval.Map1Attrib[0])
+ purge_flags = (VERT_BIT_EVAL_P1|VERT_BIT_EVAL_C1);
- if (orflag & VERT_EVAL_P1) {
- eval_points1( store->Obj + IM->CopyStart,
+ if (orflag & VERT_BIT_EVAL_P1) {
+ eval_points1( store->Attrib[VERT_ATTRIB_POS] + IM->CopyStart,
coord, flags,
ctx->Eval.MapGrid1du,
ctx->Eval.MapGrid1u1);
- coord = store->Obj + IM->CopyStart;
+ coord = store->Attrib[VERT_ATTRIB_POS] + IM->CopyStart;
}
}
if (any_eval2) {
- req |= tnl->pipeline.inputs & tnl->eval.EvalMap2Flags;
+ req |= tnl->pipeline.inputs
+ & (tnl->eval.EvalMap2Flags | tnl->eval.EvalMap2AttribFlags);
- if (!ctx->Eval.Map2Vertex4 && !ctx->Eval.Map2Vertex3)
- purge_flags |= (VERT_EVAL_P2|VERT_EVAL_C2);
+ if (!ctx->Eval.Map2Vertex4 && !ctx->Eval.Map2Vertex3 &&
+ !ctx->Eval.Map2Attrib[0])
+ purge_flags |= (VERT_BIT_EVAL_P2|VERT_BIT_EVAL_C2);
- if (orflag & VERT_EVAL_P2) {
- eval_points2( store->Obj + IM->CopyStart,
+ if (orflag & VERT_BIT_EVAL_P2) {
+ eval_points2( store->Attrib[VERT_ATTRIB_POS] + IM->CopyStart,
coord, flags,
ctx->Eval.MapGrid2du,
ctx->Eval.MapGrid2u1,
ctx->Eval.MapGrid2dv,
ctx->Eval.MapGrid2v1 );
- coord = store->Obj + IM->CopyStart;
+ coord = store->Attrib[VERT_ATTRIB_POS] + IM->CopyStart;
}
}
-
-/* _tnl_print_vert_flags(__FUNCTION__, req); */
-
/* Perform the evaluations on active data elements.
*/
- if (req & VERT_INDEX)
- {
+ if (req & VERT_BIT_INDEX) {
GLuint generated = 0;
if (copycount)
@@ -509,152 +516,230 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM )
if (ctx->Eval.Map1Index && any_eval1) {
eval1_1ui( &tmp->Index, coord, flags, &ctx->EvalMap.Map1Index );
- generated |= VERT_EVAL_C1|VERT_EVAL_P1;
+ generated |= VERT_BIT_EVAL_C1|VERT_BIT_EVAL_P1;
}
if (ctx->Eval.Map2Index && any_eval2) {
eval2_1ui( &tmp->Index, coord, flags, &ctx->EvalMap.Map2Index );
- generated |= VERT_EVAL_C2|VERT_EVAL_P2;
+ generated |= VERT_BIT_EVAL_C2|VERT_BIT_EVAL_P2;
}
}
- if (req & VERT_RGBA)
- {
+ if (req & VERT_BIT_COLOR0) {
GLuint generated = 0;
if (copycount)
- copy_4f_stride( store->Color + IM->CopyStart,
+ copy_4f_stride( store->Attrib[VERT_ATTRIB_COLOR0] + IM->CopyStart,
(GLfloat *)tmp->Color.Ptr,
tmp->Color.StrideB,
copycount );
- tmp->Color.Ptr = store->Color + IM->CopyStart;
+ tmp->Color.Ptr = store->Attrib[VERT_ATTRIB_COLOR0] + IM->CopyStart;
tmp->Color.StrideB = 4 * sizeof(GLfloat);
tmp->Color.Flags = 0;
- tnl->vb.importable_data &= ~VERT_RGBA;
+ tnl->vb.importable_data &= ~VERT_BIT_COLOR0;
+
+ if (ctx->VertexProgram.Enabled) {
+ tmp->Attribs[VERT_ATTRIB_COLOR0].data =
+ store->Attrib[VERT_ATTRIB_COLOR0] + IM->CopyStart;
+ tmp->Attribs[VERT_ATTRIB_COLOR0].start =
+ (GLfloat *) tmp->Attribs[VERT_ATTRIB_COLOR0].data;
+ tmp->Attribs[VERT_ATTRIB_COLOR0].size = 0;
+ }
- if (ctx->Eval.Map1Color4 && any_eval1) {
- eval1_4f_ca( &tmp->Color, coord, flags, 4, &ctx->EvalMap.Map1Color4 );
- generated |= VERT_EVAL_C1|VERT_EVAL_P1;
+ /* Vertex program maps have priority over conventional attribs */
+ if (any_eval1) {
+ if (ctx->VertexProgram.Enabled
+ && ctx->Eval.Map1Attrib[VERT_ATTRIB_COLOR0]) {
+ eval1_4f_ca( &tmp->Color, coord, flags, 4,
+ &ctx->EvalMap.Map1Attrib[VERT_ATTRIB_COLOR0] );
+ generated |= VERT_BIT_EVAL_C1|VERT_BIT_EVAL_P1;
+ }
+ else if (ctx->Eval.Map1Color4) {
+ eval1_4f_ca( &tmp->Color, coord, flags, 4,
+ &ctx->EvalMap.Map1Color4 );
+ generated |= VERT_BIT_EVAL_C1|VERT_BIT_EVAL_P1;
+ }
}
- if (ctx->Eval.Map2Color4 && any_eval2) {
- eval2_4f_ca( &tmp->Color, coord, flags, 4, &ctx->EvalMap.Map2Color4 );
- generated |= VERT_EVAL_C2|VERT_EVAL_P2;
+ if (any_eval2) {
+ if (ctx->VertexProgram.Enabled
+ && ctx->Eval.Map2Attrib[VERT_ATTRIB_COLOR0]) {
+ eval2_4f_ca( &tmp->Color, coord, flags, 4,
+ &ctx->EvalMap.Map2Attrib[VERT_ATTRIB_COLOR0] );
+ generated |= VERT_BIT_EVAL_C2|VERT_BIT_EVAL_P2;
+ }
+ else if (ctx->Eval.Map2Color4) {
+ eval2_4f_ca( &tmp->Color, coord, flags, 4,
+ &ctx->EvalMap.Map2Color4 );
+ generated |= VERT_BIT_EVAL_C2|VERT_BIT_EVAL_P2;
+ }
}
}
-
- if (req & VERT_TEX(0))
- {
+ if (req & VERT_BIT_TEX0) {
GLuint generated = 0;
if (copycount)
- copy_4f( store->TexCoord[0] + IM->CopyStart,
+ copy_4f( store->Attrib[VERT_ATTRIB_TEX0] + IM->CopyStart,
tmp->TexCoord[0].data, copycount );
else
tmp->TexCoord[0].size = 0;
- tmp->TexCoord[0].data = store->TexCoord[0] + IM->CopyStart;
+ tmp->TexCoord[0].data = store->Attrib[VERT_ATTRIB_TEX0] + IM->CopyStart;
tmp->TexCoord[0].start = (GLfloat *)tmp->TexCoord[0].data;
+ if (ctx->VertexProgram.Enabled) {
+ tmp->Attribs[VERT_ATTRIB_TEX0].data =
+ store->Attrib[VERT_ATTRIB_TEX0] + IM->CopyStart;
+ tmp->Attribs[VERT_ATTRIB_TEX0].start =
+ (GLfloat *) tmp->Attribs[VERT_ATTRIB_TEX0].data;
+ tmp->Attribs[VERT_ATTRIB_TEX0].size = 0;
+ }
+
+ /* Vertex program maps have priority over conventional attribs */
if (any_eval1) {
- if (ctx->Eval.Map1TextureCoord4) {
+ if (ctx->VertexProgram.Enabled
+ && ctx->Eval.Map1Attrib[VERT_ATTRIB_TEX0]) {
+ eval1_4f( &tmp->TexCoord[0], coord, flags, 4,
+ &ctx->EvalMap.Map1Attrib[VERT_ATTRIB_TEX0] );
+ generated |= VERT_BIT_EVAL_C1|VERT_BIT_EVAL_P1;
+ }
+ else if (ctx->Eval.Map1TextureCoord4) {
eval1_4f( &tmp->TexCoord[0], coord, flags, 4,
&ctx->EvalMap.Map1Texture4 );
- generated |= VERT_EVAL_C1|VERT_EVAL_P1;
+ generated |= VERT_BIT_EVAL_C1|VERT_BIT_EVAL_P1;
}
else if (ctx->Eval.Map1TextureCoord3) {
eval1_4f( &tmp->TexCoord[0], coord, flags, 3,
&ctx->EvalMap.Map1Texture3 );
- generated |= VERT_EVAL_C1|VERT_EVAL_P1;
+ generated |= VERT_BIT_EVAL_C1|VERT_BIT_EVAL_P1;
}
else if (ctx->Eval.Map1TextureCoord2) {
eval1_4f( &tmp->TexCoord[0], coord, flags, 2,
&ctx->EvalMap.Map1Texture2 );
- generated |= VERT_EVAL_C1|VERT_EVAL_P1;
+ generated |= VERT_BIT_EVAL_C1|VERT_BIT_EVAL_P1;
}
else if (ctx->Eval.Map1TextureCoord1) {
eval1_4f( &tmp->TexCoord[0], coord, flags, 1,
&ctx->EvalMap.Map1Texture1 );
- generated |= VERT_EVAL_C1|VERT_EVAL_P1;
+ generated |= VERT_BIT_EVAL_C1|VERT_BIT_EVAL_P1;
}
}
if (any_eval2) {
- if (ctx->Eval.Map2TextureCoord4) {
+ if (ctx->VertexProgram.Enabled
+ && ctx->Eval.Map2Attrib[VERT_ATTRIB_TEX0]) {
+ eval2_4f( &tmp->TexCoord[0], coord, flags, 4,
+ &ctx->EvalMap.Map2Attrib[VERT_ATTRIB_TEX0] );
+ generated |= VERT_BIT_EVAL_C1|VERT_BIT_EVAL_P1;
+ }
+ else if (ctx->Eval.Map2TextureCoord4) {
eval2_4f( &tmp->TexCoord[0], coord, flags, 4,
&ctx->EvalMap.Map2Texture4 );
- generated |= VERT_EVAL_C2|VERT_EVAL_P2;
+ generated |= VERT_BIT_EVAL_C2|VERT_BIT_EVAL_P2;
}
else if (ctx->Eval.Map2TextureCoord3) {
eval2_4f( &tmp->TexCoord[0], coord, flags, 3,
&ctx->EvalMap.Map2Texture3 );
- generated |= VERT_EVAL_C2|VERT_EVAL_P2;
+ generated |= VERT_BIT_EVAL_C2|VERT_BIT_EVAL_P2;
}
else if (ctx->Eval.Map2TextureCoord2) {
eval2_4f( &tmp->TexCoord[0], coord, flags, 2,
&ctx->EvalMap.Map2Texture2 );
- generated |= VERT_EVAL_C2|VERT_EVAL_P2;
+ generated |= VERT_BIT_EVAL_C2|VERT_BIT_EVAL_P2;
}
else if (ctx->Eval.Map2TextureCoord1) {
eval2_4f( &tmp->TexCoord[0], coord, flags, 1,
&ctx->EvalMap.Map2Texture1 );
- generated |= VERT_EVAL_C2|VERT_EVAL_P2;
+ generated |= VERT_BIT_EVAL_C2|VERT_BIT_EVAL_P2;
}
}
}
-
- if (req & VERT_NORM)
- {
+ if (req & VERT_BIT_NORMAL) {
GLuint generated = 0;
if (copycount) {
- copy_3f( store->Normal + IM->CopyStart, tmp->Normal.data,
- copycount );
+ copy_3f( store->Attrib[VERT_ATTRIB_NORMAL] + IM->CopyStart,
+ tmp->Normal.data, copycount );
}
- tmp->Normal.data = store->Normal + IM->CopyStart;
+ tmp->Normal.data = store->Attrib[VERT_ATTRIB_NORMAL] + IM->CopyStart;
tmp->Normal.start = (GLfloat *)tmp->Normal.data;
- if (ctx->Eval.Map1Normal && any_eval1) {
- eval1_norm( &tmp->Normal, coord, flags,
- &ctx->EvalMap.Map1Normal );
- generated |= VERT_EVAL_C1|VERT_EVAL_P1;
+ if (ctx->VertexProgram.Enabled) {
+ tmp->Attribs[VERT_ATTRIB_NORMAL].data =
+ store->Attrib[VERT_ATTRIB_NORMAL] + IM->CopyStart;
+ tmp->Attribs[VERT_ATTRIB_NORMAL].start =
+ (GLfloat *) tmp->Attribs[VERT_ATTRIB_NORMAL].data;
+ tmp->Attribs[VERT_ATTRIB_NORMAL].size = 0;
}
- if (ctx->Eval.Map2Normal && any_eval2) {
- eval2_norm( &tmp->Normal, coord, flags,
- &ctx->EvalMap.Map2Normal );
- generated |= VERT_EVAL_C2|VERT_EVAL_P2;
+ if (any_eval1) {
+ if (ctx->VertexProgram.Enabled &&
+ ctx->Eval.Map1Attrib[VERT_ATTRIB_NORMAL]) {
+ eval1_norm( &tmp->Normal, coord, flags,
+ &ctx->EvalMap.Map1Attrib[VERT_ATTRIB_NORMAL] );
+ generated |= VERT_BIT_EVAL_C1|VERT_BIT_EVAL_P1;
+ }
+ else if (ctx->Eval.Map1Normal) {
+ eval1_norm( &tmp->Normal, coord, flags, &ctx->EvalMap.Map1Normal );
+ generated |= VERT_BIT_EVAL_C1|VERT_BIT_EVAL_P1;
+ }
}
- }
-
+ if (any_eval2) {
+ if (ctx->VertexProgram.Enabled &&
+ ctx->Eval.Map2Attrib[VERT_ATTRIB_NORMAL]) {
+ eval2_norm( &tmp->Normal, coord, flags,
+ &ctx->EvalMap.Map2Attrib[VERT_ATTRIB_NORMAL] );
+ generated |= VERT_BIT_EVAL_C2|VERT_BIT_EVAL_P2;
+ }
+ else if (ctx->Eval.Map2Normal) {
+ eval2_norm( &tmp->Normal, coord, flags, &ctx->EvalMap.Map2Normal );
+ generated |= VERT_BIT_EVAL_C2|VERT_BIT_EVAL_P2;
+ }
+ }
+ }
/* In the AutoNormal case, the copy and assignment of tmp->NormalPtr
* are done above.
*/
- if (req & VERT_OBJ)
- {
+ if (req & VERT_BIT_POS) {
if (copycount) {
/* This copy may already have occurred when eliminating
* glEvalPoint calls:
*/
- if (coord != store->Obj + IM->CopyStart)
- copy_4f( store->Obj + IM->CopyStart, tmp->Obj.data, copycount );
- } else
+ if (coord != store->Attrib[VERT_ATTRIB_POS] + IM->CopyStart) {
+ copy_4f( store->Attrib[VERT_ATTRIB_POS] + IM->CopyStart,
+ tmp->Obj.data, copycount );
+ }
+ }
+ else {
tmp->Obj.size = 0;
+ }
+
+ tmp->Obj.data = store->Attrib[VERT_ATTRIB_POS] + IM->CopyStart;
+ tmp->Obj.start = (GLfloat *) tmp->Obj.data;
- tmp->Obj.data = store->Obj + IM->CopyStart;
- tmp->Obj.start = (GLfloat *)tmp->Obj.data;
+#if 1
+ /*tmp->Attribs[0].count = count;*/
+ tmp->Attribs[0].data = store->Attrib[0] + IM->CopyStart;
+ tmp->Attribs[0].start = (GLfloat *) tmp->Attribs[0].data;
+ tmp->Attribs[0].size = 0;
+#endif
/* Note: Normal data is already prepared above.
*/
if (any_eval1) {
- if (ctx->Eval.Map1Vertex4) {
+ if (ctx->VertexProgram.Enabled &&
+ ctx->Eval.Map1Attrib[VERT_ATTRIB_POS]) {
+ eval1_4f( &tmp->Obj, coord, flags, 4,
+ &ctx->EvalMap.Map1Attrib[VERT_ATTRIB_POS] );
+ }
+ else if (ctx->Eval.Map1Vertex4) {
eval1_4f( &tmp->Obj, coord, flags, 4,
&ctx->EvalMap.Map1Vertex4 );
}
@@ -665,18 +750,25 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM )
}
if (any_eval2) {
- if (ctx->Eval.Map2Vertex4)
- {
- if (ctx->Eval.AutoNormal && (req & VERT_NORM))
+ if (ctx->VertexProgram.Enabled &&
+ ctx->Eval.Map2Attrib[VERT_ATTRIB_POS]) {
+ if (ctx->Eval.AutoNormal && (req & VERT_BIT_NORMAL))
+ eval2_obj_norm( &tmp->Obj, &tmp->Normal, coord, flags, 4,
+ &ctx->EvalMap.Map2Attrib[VERT_ATTRIB_POS] );
+ else
+ eval2_4f( &tmp->Obj, coord, flags, 4,
+ &ctx->EvalMap.Map2Attrib[VERT_ATTRIB_POS] );
+ }
+ else if (ctx->Eval.Map2Vertex4) {
+ if (ctx->Eval.AutoNormal && (req & VERT_BIT_NORMAL))
eval2_obj_norm( &tmp->Obj, &tmp->Normal, coord, flags, 4,
&ctx->EvalMap.Map2Vertex4 );
else
eval2_4f( &tmp->Obj, coord, flags, 4,
&ctx->EvalMap.Map2Vertex4 );
}
- else if (ctx->Eval.Map2Vertex3)
- {
- if (ctx->Eval.AutoNormal && (req & VERT_NORM))
+ else if (ctx->Eval.Map2Vertex3) {
+ if (ctx->Eval.AutoNormal && (req & VERT_BIT_NORMAL))
eval2_obj_norm( &tmp->Obj, &tmp->Normal, coord, flags, 3,
&ctx->EvalMap.Map2Vertex3 );
else
@@ -687,18 +779,47 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM )
}
+ if (ctx->VertexProgram.Enabled) {
+ /* We already evaluated position, normal, color and texture 0 above.
+ * now evaluate any other generic attributes.
+ */
+ const GLuint skipBits = (VERT_BIT_POS |
+ VERT_BIT_NORMAL |
+ VERT_BIT_COLOR0 |
+ VERT_BIT_TEX0);
+ GLuint generated = 0;
+ GLuint attr;
+ for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) {
+ if ((1 << attr) & req & ~skipBits) {
+ if (any_eval1 && ctx->Eval.Map1Attrib[attr]) {
+ /* evaluate 1-D vertex attrib map [i] */
+ eval1_4f( &tmp->Attribs[attr], coord, flags, 4,
+ &ctx->EvalMap.Map1Attrib[attr] );
+ generated |= VERT_BIT_EVAL_C1|VERT_BIT_EVAL_P1;
+ }
+ if (any_eval2 && ctx->Eval.Map2Attrib[attr]) {
+ /* evaluate 2-D vertex attrib map [i] */
+ eval2_4f( &tmp->Attribs[attr], coord, flags, 4,
+ &ctx->EvalMap.Map2Attrib[attr] );
+ generated |= VERT_BIT_EVAL_C1|VERT_BIT_EVAL_P1;
+ }
+ }
+ }
+ }
+
/* Calculate new IM->Elts, IM->Primitive, IM->PrimitiveLength for
* the case where vertex maps are not enabled for some received
* eval coordinates. In this case those slots in the immediate
* must be ignored.
*/
if (purge_flags) {
- GLuint vertex = VERT_OBJ|(VERT_EVAL_ANY & ~purge_flags);
+ const GLuint vertex = VERT_BIT_POS|(VERT_BITS_EVAL_ANY & ~purge_flags);
GLuint last_new_prim = 0;
GLuint new_prim_length = 0;
GLuint next_old_prim = 0;
struct vertex_buffer *VB = &tnl->vb;
- GLuint i,j,count = VB->Count;
+ const GLuint count = VB->Count;
+ GLuint i, j;
for (i = 0, j = 0 ; i < count ; i++) {
if (flags[i] & vertex) {
@@ -720,8 +841,8 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM )
/* Produce new flags array:
*/
{
+ const GLuint count = tnl->vb.Count + 1;
GLuint i;
- GLuint count = tnl->vb.Count + 1;
copy_1ui( store->Flag, flags, count );
tnl->vb.Flag = store->Flag;
diff --git a/xc/extras/Mesa/src/tnl/t_imm_exec.c b/xc/extras/Mesa/src/tnl/t_imm_exec.c
index 7036a8675..bf5050856 100644
--- a/xc/extras/Mesa/src/tnl/t_imm_exec.c
+++ b/xc/extras/Mesa/src/tnl/t_imm_exec.c
@@ -1,8 +1,7 @@
-/* $Id: t_imm_exec.c,v 1.1.1.1 2002/10/22 13:06:24 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -22,11 +21,13 @@
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF 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>
*/
+/**
+ * \file tnl/t_imm_exec.c
+ * \brief Setup to execute immediate-mode vertex data.
+ * \author Keith Whitwell
+ */
#include "glheader.h"
#include "colormac.h"
@@ -34,7 +35,7 @@
#include "enums.h"
#include "dlist.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "light.h"
#include "state.h"
@@ -70,8 +71,7 @@ static void reset_input( GLcontext *ctx,
MEMSET(IM->Flag + start, 0, sizeof(GLuint) * (IM->Count+2-start));
if (MESA_VERBOSE & VERBOSE_IMMEDIATE)
- fprintf(stderr, "reset_input: IM(%d) new %x\n",
- IM->id, beginstate);
+ _mesa_debug(ctx, "reset_input: IM(%d) new %x\n", IM->id, beginstate);
IM->Start = start;
IM->Count = start;
@@ -100,6 +100,7 @@ void _tnl_reset_exec_input( GLcontext *ctx,
reset_input( ctx, start, beginstate, savedbeginstate );
IM->CopyStart = start - tnl->ExecCopyCount;
+
IM->Primitive[IM->CopyStart] = ctx->Driver.CurrentExecPrimitive;
if (tnl->ExecParity)
IM->Primitive[IM->CopyStart] |= PRIM_PARITY;
@@ -121,45 +122,57 @@ void _tnl_reset_compile_input( GLcontext *ctx,
}
+/**
+ * Copy the last specified normal, color, texcoord, edge flag, etc
+ * from the immediate struct into the ctx->Current attribute group.
+ */
void _tnl_copy_to_current( GLcontext *ctx, struct immediate *IM,
GLuint flag, GLuint count )
{
if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
_tnl_print_vert_flags("copy to current", flag);
- if (flag & VERT_NORM)
- COPY_3FV( ctx->Current.Normal, IM->Normal[count]);
+ /* XXX should be able to replace these conditions with a loop over
+ * the 16 vertex attributes.
+ */
+ if (flag & VERT_BIT_NORMAL)
+ COPY_4FV( ctx->Current.Attrib[VERT_ATTRIB_NORMAL],
+ IM->Attrib[VERT_ATTRIB_NORMAL][count]);
- if (flag & VERT_INDEX)
+ if (flag & VERT_BIT_INDEX)
ctx->Current.Index = IM->Index[count];
- if (flag & VERT_EDGE)
+ if (flag & VERT_BIT_EDGEFLAG)
ctx->Current.EdgeFlag = IM->EdgeFlag[count];
- if (flag & VERT_RGBA) {
- COPY_4FV(ctx->Current.Color, IM->Color[count]);
+ if (flag & VERT_BIT_COLOR0) {
+ COPY_4FV(ctx->Current.Attrib[VERT_ATTRIB_COLOR0],
+ IM->Attrib[VERT_ATTRIB_COLOR0][count]);
if (ctx->Light.ColorMaterialEnabled) {
- _mesa_update_color_material( ctx, ctx->Current.Color );
- TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange( ctx );
+ _mesa_update_color_material( ctx,
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
+ TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange( ctx );
}
}
- if (flag & VERT_SPEC_RGB)
- COPY_4FV(ctx->Current.SecondaryColor, IM->SecondaryColor[count]);
+ if (flag & VERT_BIT_COLOR1)
+ COPY_4FV(ctx->Current.Attrib[VERT_ATTRIB_COLOR1],
+ IM->Attrib[VERT_ATTRIB_COLOR1][count]);
- if (flag & VERT_FOG_COORD)
- ctx->Current.FogCoord = IM->FogCoord[count];
+ if (flag & VERT_BIT_FOG)
+ ctx->Current.Attrib[VERT_ATTRIB_FOG][0] = IM->Attrib[VERT_ATTRIB_FOG][count][0];
- if (flag & VERT_TEX_ANY) {
+ if (flag & VERT_BITS_TEX_ANY) {
GLuint i;
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
- if (flag & VERT_TEX(i)) {
- COPY_4FV( ctx->Current.Texcoord[0], IM->TexCoord[0][count]);
+ if (flag & VERT_BIT_TEX(i)) {
+ COPY_4FV( ctx->Current.Attrib[VERT_ATTRIB_TEX0 + i],
+ IM->Attrib[VERT_ATTRIB_TEX0 + i][count]);
}
}
}
- if (flag & VERT_MATERIAL) {
+ if (flag & VERT_BIT_MATERIAL) {
_mesa_update_material( ctx,
IM->Material[IM->LastMaterial],
IM->MaterialOrMask );
@@ -193,12 +206,12 @@ void _tnl_compute_orflag( struct immediate *IM, GLuint start )
* eg. a single glMaterial call, in which case IM->Start ==
* IM->Count, but the buffer is definitely not empty.
*/
- if (IM->Flag[i] & VERT_DATA) {
+ if (IM->Flag[i] & VERT_BITS_DATA) {
IM->LastData++;
orflag |= IM->Flag[i];
}
- IM->Flag[IM->LastData+1] |= VERT_END_VB;
+ IM->Flag[IM->LastData+1] |= VERT_BIT_END_VB;
IM->CopyAndFlag = IM->AndFlag = andflag;
IM->OrFlag = orflag;
IM->CopyOrFlag = orflag;
@@ -206,13 +219,11 @@ void _tnl_compute_orflag( struct immediate *IM, GLuint start )
}
-
-
-
-
-
-
-/* Note: The 'start' member of the GLvector structs is now redundant
+/**
+ * This is where the vertex data is transfered from the 'struct immediate
+ * into the 'struct vertex_buffer'.
+ *
+ * Note: The 'start' member of the GLvector structs is now redundant
* because we always re-transform copied vertices, and the vectors
* below are set up so that the first copied vertex (if any) appears
* at position zero.
@@ -223,8 +234,8 @@ static void _tnl_vb_bind_immediate( GLcontext *ctx, struct immediate *IM )
struct vertex_buffer *VB = &tnl->vb;
struct vertex_arrays *tmp = &tnl->imm_inputs;
GLuint inputs = tnl->pipeline.inputs; /* for copy-to-current */
- GLuint start = IM->CopyStart;
- GLuint count = IM->Count - start;
+ const GLuint start = IM->CopyStart;
+ const GLuint count = IM->Count - start;
/* TODO: optimize the case where nothing has changed. (Just bind
* tmp to vb).
@@ -234,7 +245,7 @@ static void _tnl_vb_bind_immediate( GLcontext *ctx, struct immediate *IM )
*/
VB->Count = count;
VB->FirstClipped = IMM_MAXDATA - IM->CopyStart;
- VB->import_data = 0;
+ VB->import_data = NULL;
VB->importable_data = 0;
/* Need an IM->FirstPrimitive?
@@ -247,19 +258,18 @@ static void _tnl_vb_bind_immediate( GLcontext *ctx, struct immediate *IM )
/* TexCoordPtr's are zeroed in loop below.
*/
- VB->NormalPtr = 0;
- VB->NormalLengthPtr = 0;
- VB->FogCoordPtr = 0;
- VB->EdgeFlag = 0;
- VB->IndexPtr[0] = 0;
- VB->IndexPtr[1] = 0;
- VB->ColorPtr[0] = 0;
- VB->ColorPtr[1] = 0;
- VB->SecondaryColorPtr[0] = 0;
- VB->SecondaryColorPtr[1] = 0;
- VB->Elts = 0;
- VB->MaterialMask = 0;
- VB->Material = 0;
+ VB->NormalPtr = NULL;
+ VB->NormalLengthPtr = NULL;
+ VB->EdgeFlag = NULL;
+ VB->IndexPtr[0] = NULL;
+ VB->IndexPtr[1] = NULL;
+ VB->ColorPtr[0] = NULL;
+ VB->ColorPtr[1] = NULL;
+ VB->SecondaryColorPtr[0] = NULL;
+ VB->SecondaryColorPtr[1] = NULL;
+ VB->Elts = NULL;
+ VB->MaterialMask = NULL;
+ VB->Material = NULL;
/* _tnl_print_vert_flags("copy-orflag", IM->CopyOrFlag); */
/* _tnl_print_vert_flags("orflag", IM->OrFlag); */
@@ -267,75 +277,77 @@ static void _tnl_vb_bind_immediate( GLcontext *ctx, struct immediate *IM )
/* Setup the initial values of array pointers in the vb.
*/
- if (inputs & VERT_OBJ) {
- tmp->Obj.data = IM->Obj + start;
- tmp->Obj.start = (GLfloat *)(IM->Obj + start);
+ if (inputs & VERT_BIT_POS) {
+ tmp->Obj.data = IM->Attrib[VERT_ATTRIB_POS] + start;
+ tmp->Obj.start = (GLfloat *)(IM->Attrib[VERT_ATTRIB_POS] + start);
tmp->Obj.count = count;
VB->ObjPtr = &tmp->Obj;
- if ((IM->CopyOrFlag & VERT_OBJ_234) == VERT_OBJ_234)
+ if ((IM->CopyOrFlag & VERT_BITS_OBJ_234) == VERT_BITS_OBJ_234)
tmp->Obj.size = 4;
- else if ((IM->CopyOrFlag & VERT_OBJ_234) == VERT_OBJ_23)
+ else if ((IM->CopyOrFlag & VERT_BITS_OBJ_234) == VERT_BITS_OBJ_23)
tmp->Obj.size = 3;
else
tmp->Obj.size = 2;
}
- if (inputs & VERT_NORM) {
- tmp->Normal.data = IM->Normal + start;
- tmp->Normal.start = (GLfloat *)(IM->Normal + start);
+ if (inputs & VERT_BIT_NORMAL) {
+ tmp->Normal.data = IM->Attrib[VERT_ATTRIB_NORMAL] + start;
+ tmp->Normal.start = (GLfloat *) (IM->Attrib[VERT_ATTRIB_NORMAL] + start);
tmp->Normal.count = count;
+ tmp->Normal.size = 3; /* just to be safe */
VB->NormalPtr = &tmp->Normal;
if (IM->NormalLengthPtr)
VB->NormalLengthPtr = IM->NormalLengthPtr + start;
}
- if (inputs & VERT_INDEX) {
+ if (inputs & VERT_BIT_INDEX) {
tmp->Index.count = count;
tmp->Index.data = IM->Index + start;
tmp->Index.start = IM->Index + start;
VB->IndexPtr[0] = &tmp->Index;
}
- if (inputs & VERT_FOG_COORD) {
- tmp->FogCoord.data = IM->FogCoord + start;
- tmp->FogCoord.start = IM->FogCoord + start;
+ if (inputs & VERT_BIT_FOG) {
+ tmp->FogCoord.data = IM->Attrib[VERT_ATTRIB_FOG] + start;
+ tmp->FogCoord.start = (GLfloat *) (IM->Attrib[VERT_ATTRIB_FOG] + start);
tmp->FogCoord.count = count;
VB->FogCoordPtr = &tmp->FogCoord;
}
- if (inputs & VERT_SPEC_RGB) {
- tmp->SecondaryColor.Ptr = IM->SecondaryColor + start;
+ if (inputs & VERT_BIT_COLOR1) {
+ tmp->SecondaryColor.Ptr = IM->Attrib[VERT_ATTRIB_COLOR1] + start;
VB->SecondaryColorPtr[0] = &tmp->SecondaryColor;
}
- if (inputs & VERT_EDGE) {
+ if (inputs & VERT_BIT_EDGEFLAG) {
VB->EdgeFlag = IM->EdgeFlag + start;
}
- if (inputs & VERT_RGBA) {
- if (IM->CopyOrFlag & VERT_RGBA) {
- tmp->Color.Ptr = IM->Color + start;
+ if (inputs & VERT_BIT_COLOR0) {
+ if (IM->CopyOrFlag & VERT_BIT_COLOR0) {
+ tmp->Color.Ptr = IM->Attrib[VERT_ATTRIB_COLOR0] + start;
tmp->Color.StrideB = 4 * sizeof(GLfloat);
tmp->Color.Flags = 0;
- } else {
- tmp->Color.Ptr = ctx->Current.Color;
+ }
+ else {
+ tmp->Color.Ptr = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
tmp->Color.StrideB = 0;
tmp->Color.Flags = CA_CLIENT_DATA; /* hack */
VB->import_source = IM;
- VB->importable_data |= VERT_RGBA;
+ VB->importable_data |= VERT_BIT_COLOR0;
VB->import_data = _tnl_upgrade_current_data;
}
VB->ColorPtr[0] = &tmp->Color;
}
- if (inputs & VERT_TEX_ANY) {
+ if (inputs & VERT_BITS_TEX_ANY) {
GLuint i;
for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
- VB->TexCoordPtr[i] = 0;
- if (inputs & VERT_TEX(i)) {
+ VB->TexCoordPtr[i] = NULL;
+ if (inputs & VERT_BIT_TEX(i)) {
tmp->TexCoord[i].count = count;
- tmp->TexCoord[i].data = IM->TexCoord[i] + start;
- tmp->TexCoord[i].start = (GLfloat *)(IM->TexCoord[i] + start);
+ tmp->TexCoord[i].data = IM->Attrib[VERT_ATTRIB_TEX0 + i] + start;
+ tmp->TexCoord[i].start = (GLfloat *)(IM->Attrib[VERT_ATTRIB_TEX0 + i] + start);
tmp->TexCoord[i].size = 2;
if (IM->TexSize & TEX_SIZE_3(i)) {
tmp->TexCoord[i].size = 3;
@@ -347,27 +359,38 @@ static void _tnl_vb_bind_immediate( GLcontext *ctx, struct immediate *IM )
}
}
- if ((inputs & IM->OrFlag & VERT_MATERIAL) && IM->Material) {
+ if ((inputs & IM->OrFlag & VERT_BIT_MATERIAL) && IM->Material) {
VB->MaterialMask = IM->MaterialMask + start;
VB->Material = IM->Material + start;
}
+
+ /* GL_NV_vertex_program */
+ if (ctx->VertexProgram.Enabled) {
+ GLuint attr;
+ for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) {
+ tmp->Attribs[attr].count = count;
+ tmp->Attribs[attr].data = IM->Attrib[attr] + start;
+ tmp->Attribs[attr].start = (GLfloat *) (IM->Attrib[attr] + start);
+ tmp->Attribs[attr].size = 4;
+ VB->AttribPtr[attr] = &(tmp->Attribs[attr]);
+ }
+ }
}
-/* Called by exec_vert_cassette, execute_compiled_cassette, but not
+/**
+ * Called by exec_vert_cassette, execute_compiled_cassette, but not
* exec_elt_cassette.
*/
void _tnl_run_cassette( GLcontext *ctx, struct immediate *IM )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-
_tnl_vb_bind_immediate( ctx, IM );
- if (IM->OrFlag & VERT_EVAL_ANY)
+ if (IM->OrFlag & VERT_BITS_EVAL_ANY)
_tnl_eval_immediate( ctx, IM );
/* Invalidate all stored data before and after run:
@@ -380,12 +403,11 @@ void _tnl_run_cassette( GLcontext *ctx, struct immediate *IM )
}
-/* Called for regular vertex cassettes.
+/**
+ * Called for regular vertex cassettes.
*/
static void exec_vert_cassette( GLcontext *ctx, struct immediate *IM )
{
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-
if (IM->FlushElt) {
/* Orflag is computed twice, but only reach this code if app is
* using a mixture of glArrayElement() and glVertex() while
@@ -403,7 +425,7 @@ static void exec_vert_cassette( GLcontext *ctx, struct immediate *IM )
}
-/* Called for pure, locked VERT_ELT cassettes instead of
+/* Called for pure, locked VERT_BIT_ELT cassettes instead of
* _tnl_run_cassette.
*/
static void exec_elt_cassette( GLcontext *ctx, struct immediate *IM )
@@ -411,8 +433,6 @@ static void exec_elt_cassette( GLcontext *ctx, struct immediate *IM )
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-
_tnl_vb_bind_arrays( ctx, ctx->Array.LockFirst, ctx->Array.LockCount );
/* Take only elements and primitive information from the immediate:
@@ -446,7 +466,8 @@ exec_empty_cassette( GLcontext *ctx, struct immediate *IM )
-/* Called for all cassettes when not compiling or playing a display
+/**
+ * Called for all cassettes when not compiling or playing a display
* list.
*/
void _tnl_execute_cassette( GLcontext *ctx, struct immediate *IM )
@@ -463,7 +484,7 @@ void _tnl_execute_cassette( GLcontext *ctx, struct immediate *IM )
if (IM->CopyStart == IM->Count) {
exec_empty_cassette( ctx, IM );
}
- else if ((IM->CopyOrFlag & VERT_DATA) == VERT_ELT &&
+ else if ((IM->CopyOrFlag & VERT_BITS_DATA) == VERT_BIT_ELT &&
ctx->Array.LockCount &&
ctx->Array.Vertex.Enabled) {
exec_elt_cassette( ctx, IM );
@@ -492,15 +513,13 @@ void _tnl_execute_cassette( GLcontext *ctx, struct immediate *IM )
if (ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1)
ctx->Driver.NeedFlush &= ~FLUSH_STORED_VERTICES;
-
-/* fprintf(stderr, "%s: NeedFlush: %x\n", __FUNCTION__, */
-/* ctx->Driver.NeedFlush); */
}
-/* Setup vector pointers that will be used to bind immediates to VB's.
+/**
+ * Setup vector pointers that will be used to bind immediates to VB's.
*/
void _tnl_imm_init( GLcontext *ctx )
{
@@ -524,23 +543,23 @@ void _tnl_imm_init( GLcontext *ctx )
TNL_CURRENT_IM(ctx)->CopyStart = IMM_MAX_COPIED_VERTS;
_mesa_vector4f_init( &tmp->Obj, 0, 0 );
- _mesa_vector3f_init( &tmp->Normal, 0, 0 );
+ _mesa_vector4f_init( &tmp->Normal, 0, 0 );
- tmp->Color.Ptr = 0;
+ tmp->Color.Ptr = NULL;
tmp->Color.Type = GL_FLOAT;
tmp->Color.Size = 4;
tmp->Color.Stride = 0;
tmp->Color.StrideB = 4 * sizeof(GLfloat);
tmp->Color.Flags = 0;
- tmp->SecondaryColor.Ptr = 0;
+ tmp->SecondaryColor.Ptr = NULL;
tmp->SecondaryColor.Type = GL_FLOAT;
tmp->SecondaryColor.Size = 4;
tmp->SecondaryColor.Stride = 0;
tmp->SecondaryColor.StrideB = 4 * sizeof(GLfloat);
tmp->SecondaryColor.Flags = 0;
- _mesa_vector1f_init( &tmp->FogCoord, 0, 0 );
+ _mesa_vector4f_init( &tmp->FogCoord, 0, 0 );
_mesa_vector1ui_init( &tmp->Index, 0, 0 );
_mesa_vector1ub_init( &tmp->EdgeFlag, 0, 0 );
@@ -556,6 +575,10 @@ void _tnl_imm_init( GLcontext *ctx )
}
+/**
+ * Deallocate the immediate-mode buffer for the given context, if
+ * its reference count goes to zero.
+ */
void _tnl_imm_destroy( GLcontext *ctx )
{
if (TNL_CURRENT_IM(ctx)) {
@@ -569,6 +592,6 @@ void _tnl_imm_destroy( GLcontext *ctx )
* So we just set the context's own tnl immediate pointer
* to 0.
*/
- ctx->swtnl_im = 0;
+ ctx->swtnl_im = NULL;
}
}
diff --git a/xc/extras/Mesa/src/tnl/t_imm_exec.h b/xc/extras/Mesa/src/tnl/t_imm_exec.h
index b4ecb9a1b..6b3c65f4c 100644
--- a/xc/extras/Mesa/src/tnl/t_imm_exec.h
+++ b/xc/extras/Mesa/src/tnl/t_imm_exec.h
@@ -1,4 +1,3 @@
-/* $Id: t_imm_exec.h,v 1.1.1.1 2002/10/22 13:06:24 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -38,7 +37,7 @@ extern void _tnl_flush_vertices( GLcontext *ctx, GLuint flush_flags );
/* Called from imm_api.c and _tnl_flush_vertices:
*/
-extern void _tnl_flush_immediate( struct immediate *IM );
+extern void _tnl_flush_immediate( GLcontext *ctx, struct immediate *IM );
/* Called from imm_dlist.c and _tnl_flush_immediate:
*/
diff --git a/xc/extras/Mesa/src/tnl/t_imm_fixup.c b/xc/extras/Mesa/src/tnl/t_imm_fixup.c
index 0ce42b458..ca5a2a554 100644
--- a/xc/extras/Mesa/src/tnl/t_imm_fixup.c
+++ b/xc/extras/Mesa/src/tnl/t_imm_fixup.c
@@ -1,8 +1,7 @@
-/* $Id: t_imm_fixup.c,v 1.1.1.1 2002/10/22 13:06:20 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -26,7 +25,7 @@
/*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
@@ -37,7 +36,7 @@
#include "colormac.h"
#include "light.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "state.h"
#include "mtypes.h"
@@ -65,7 +64,7 @@ _tnl_fixup_4f( GLfloat data[][4], GLuint flag[], GLuint start, GLuint match )
for (;;) {
if ((flag[++i] & match) == 0) {
COPY_4FV(data[i], data[i-1]);
- if (flag[i] & VERT_END_VB) break;
+ if (flag[i] & VERT_BIT_END_VB) break;
}
}
}
@@ -78,13 +77,13 @@ _tnl_fixup_3f( float data[][3], GLuint flag[], GLuint start, GLuint match )
for (;;) {
if ((flag[++i] & match) == 0) {
-/* fprintf(stderr, "_tnl_fixup_3f copy to %p values %f %f %f\n", */
+/* _mesa_debug(NULL, "_tnl_fixup_3f copy to %p values %f %f %f\n", */
/* data[i], */
/* data[i-1][0], */
/* data[i-1][1], */
/* data[i-1][2]); */
COPY_3V(data[i], data[i-1]);
- if (flag[i] & VERT_END_VB) break;
+ if (flag[i] & VERT_BIT_END_VB) break;
}
}
}
@@ -98,7 +97,7 @@ _tnl_fixup_1ui( GLuint *data, GLuint flag[], GLuint start, GLuint match )
for (;;) {
if ((flag[++i] & match) == 0) {
data[i] = data[i-1];
- if (flag[i] & VERT_END_VB) break;
+ if (flag[i] & VERT_BIT_END_VB) break;
}
}
flag[i] |= match;
@@ -113,7 +112,7 @@ _tnl_fixup_1f( GLfloat *data, GLuint flag[], GLuint start, GLuint match )
for (;;) {
if ((flag[++i] & match) == 0) {
data[i] = data[i-1];
- if (flag[i] & VERT_END_VB) break;
+ if (flag[i] & VERT_BIT_END_VB) break;
}
}
flag[i] |= match;
@@ -127,7 +126,7 @@ _tnl_fixup_1ub( GLubyte *data, GLuint flag[], GLuint start, GLuint match )
for (;;) {
if ((flag[++i] & match) == 0) {
data[i] = data[i-1];
- if (flag[i] & VERT_END_VB) break;
+ if (flag[i] & VERT_BIT_END_VB) break;
}
}
flag[i] |= match;
@@ -139,94 +138,114 @@ fixup_first_4f( GLfloat data[][4], GLuint flag[], GLuint match,
GLuint start, GLfloat *dflt )
{
GLuint i = start-1;
- match |= VERT_END_VB;
+ match |= VERT_BIT_END_VB;
while ((flag[++i]&match) == 0)
COPY_4FV(data[i], dflt);
}
+#if 0
static void
fixup_first_3f( GLfloat data[][3], GLuint flag[], GLuint match,
GLuint start, GLfloat *dflt )
{
GLuint i = start-1;
- match |= VERT_END_VB;
+ match |= VERT_BIT_END_VB;
-/* fprintf(stderr, "fixup_first_3f default: %f %f %f start: %d\n", */
+/* _mesa_debug(NULL, "fixup_first_3f default: %f %f %f start: %d\n", */
/* dflt[0], dflt[1], dflt[2], start); */
while ((flag[++i]&match) == 0)
COPY_3FV(data[i], dflt);
}
-
+#endif
static void
fixup_first_1ui( GLuint data[], GLuint flag[], GLuint match,
GLuint start, GLuint dflt )
{
GLuint i = start-1;
- match |= VERT_END_VB;
+ match |= VERT_BIT_END_VB;
while ((flag[++i]&match) == 0)
data[i] = dflt;
}
+#if 00
static void
fixup_first_1f( GLfloat data[], GLuint flag[], GLuint match,
GLuint start, GLfloat dflt )
{
GLuint i = start-1;
- match |= VERT_END_VB;
+ match |= VERT_BIT_END_VB;
while ((flag[++i]&match) == 0)
data[i] = dflt;
}
-
+#endif
static void
fixup_first_1ub( GLubyte data[], GLuint flag[], GLuint match,
GLuint start, GLubyte dflt )
{
GLuint i = start-1;
- match |= VERT_END_VB;
+ match |= VERT_BIT_END_VB;
while ((flag[++i]&match) == 0)
data[i] = dflt;
}
+/*
+ * Copy vertex attributes from the ctx->Current group into the immediate
+ * struct at the given position according to copyMask.
+ */
static void copy_from_current( GLcontext *ctx, struct immediate *IM,
- GLuint start, GLuint copy )
+ GLuint pos, GLuint copyMask )
{
+ GLuint attrib, attribBit;
+
if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
- _tnl_print_vert_flags("copy from current", copy);
+ _tnl_print_vert_flags("copy from current", copyMask);
- if (copy & VERT_NORM) {
- COPY_3V( IM->Normal[start], ctx->Current.Normal );
+#if 0
+ if (copyMask & VERT_BIT_NORMAL) {
+ COPY_4V(IM->Attrib[VERT_ATTRIB_NORMAL][pos],
+ ctx->Current.Attrib[VERT_ATTRIB_NORMAL]);
}
- if (copy & VERT_RGBA) {
- COPY_4FV( IM->Color[start], ctx->Current.Color);
+ if (copyMask & VERT_BIT_COLOR0) {
+ COPY_4FV( IM->Attrib[VERT_ATTRIB_COLOR0][pos],
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
}
- if (copy & VERT_SPEC_RGB)
- COPY_4FV( IM->SecondaryColor[start], ctx->Current.SecondaryColor);
+ if (copyMask & VERT_BIT_COLOR1)
+ COPY_4FV( IM->Attrib[VERT_ATTRIB_COLOR1][pos],
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR1]);
- if (copy & VERT_FOG_COORD)
- IM->FogCoord[start] = ctx->Current.FogCoord;
+ if (copyMask & VERT_BIT_FOG)
+ IM->Attrib[VERT_ATTRIB_FOG][pos][0] = ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
- if (copy & VERT_INDEX)
- IM->Index[start] = ctx->Current.Index;
-
- if (copy & VERT_EDGE)
- IM->EdgeFlag[start] = ctx->Current.EdgeFlag;
-
- if (copy & VERT_TEX_ANY) {
+ if (copyMask & VERT_BITS_TEX_ANY) {
GLuint i;
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
- if (copy & VERT_TEX(i))
- COPY_4FV( IM->TexCoord[i][start], ctx->Current.Texcoord[i] );
+ if (copyMask & VERT_BIT_TEX(i))
+ COPY_4FV(IM->Attrib[VERT_ATTRIB_TEX0 + i][pos],
+ ctx->Current.Attrib[VERT_ATTRIB_TEX0 + i]);
+ }
+ }
+#else
+ for (attrib = 0, attribBit = 1; attrib < 16; attrib++, attribBit <<= 1) {
+ if (copyMask & attribBit) {
+ COPY_4FV( IM->Attrib[attrib][pos], ctx->Current.Attrib[attrib]);
}
}
+#endif
+
+ if (copyMask & VERT_BIT_INDEX)
+ IM->Index[pos] = ctx->Current.Index;
+
+ if (copyMask & VERT_BIT_EDGEFLAG)
+ IM->EdgeFlag[pos] = ctx->Current.EdgeFlag;
}
@@ -240,13 +259,13 @@ void _tnl_fixup_input( GLcontext *ctx, struct immediate *IM )
IM->CopyTexSize = IM->TexSize;
-/* fprintf(stderr, "Fixup input, Start: %u Count: %u LastData: %u\n", */
+/* _mesa_debug(ctx, "Fixup input, Start: %u Count: %u LastData: %u\n", */
/* IM->Start, IM->Count, IM->LastData); */
/* _tnl_print_vert_flags("Orflag", orflag); */
/* _tnl_print_vert_flags("Andflag", andflag); */
- fixup = ~andflag & VERT_FIXUP;
+ fixup = ~andflag & VERT_BITS_FIXUP;
if (!ctx->CompileFlag)
fixup &= tnl->pipeline.inputs;
@@ -254,7 +273,7 @@ void _tnl_fixup_input( GLcontext *ctx, struct immediate *IM )
if (!ctx->ExecuteFlag)
fixup &= orflag;
- if ((orflag & (VERT_OBJ|VERT_EVAL_ANY)) == 0)
+ if ((orflag & (VERT_BIT_POS|VERT_BITS_EVAL_ANY)) == 0)
fixup = 0;
if (fixup) {
@@ -270,75 +289,84 @@ void _tnl_fixup_input( GLcontext *ctx, struct immediate *IM )
if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
_tnl_print_vert_flags("fixup", fixup);
- if (fixup & VERT_TEX_ANY) {
+ /* XXX replace these conditionals with a loop over the 16
+ * vertex attributes.
+ */
+
+ if (fixup & VERT_BITS_TEX_ANY) {
GLuint i;
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
- if (fixup & VERT_TEX(i)) {
- if (orflag & VERT_TEX(i))
- _tnl_fixup_4f( IM->TexCoord[i], IM->Flag, start,
- VERT_TEX(i) );
+ if (fixup & VERT_BIT_TEX(i)) {
+ if (orflag & VERT_BIT_TEX(i))
+ _tnl_fixup_4f( IM->Attrib[VERT_ATTRIB_TEX0 + i], IM->Flag,
+ start, VERT_BIT_TEX(i) );
else
- fixup_first_4f( IM->TexCoord[i], IM->Flag, VERT_END_VB, start,
- IM->TexCoord[i][start]);
+ fixup_first_4f( IM->Attrib[VERT_ATTRIB_TEX0 + i], IM->Flag,
+ VERT_BIT_END_VB, start,
+ IM->Attrib[VERT_ATTRIB_TEX0 + i][start]);
}
}
}
- if (fixup & VERT_EDGE) {
- if (orflag & VERT_EDGE)
- _tnl_fixup_1ub( IM->EdgeFlag, IM->Flag, start, VERT_EDGE );
+ if (fixup & VERT_BIT_EDGEFLAG) {
+ if (orflag & VERT_BIT_EDGEFLAG)
+ _tnl_fixup_1ub( IM->EdgeFlag, IM->Flag, start, VERT_BIT_EDGEFLAG );
else
- fixup_first_1ub( IM->EdgeFlag, IM->Flag, VERT_END_VB, start,
+ fixup_first_1ub( IM->EdgeFlag, IM->Flag, VERT_BIT_END_VB, start,
IM->EdgeFlag[start] );
}
- if (fixup & VERT_INDEX) {
- if (orflag & VERT_INDEX)
- _tnl_fixup_1ui( IM->Index, IM->Flag, start, VERT_INDEX );
+ if (fixup & VERT_BIT_INDEX) {
+ if (orflag & VERT_BIT_INDEX)
+ _tnl_fixup_1ui( IM->Index, IM->Flag, start, VERT_BIT_INDEX );
else
- fixup_first_1ui( IM->Index, IM->Flag, VERT_END_VB, start,
+ fixup_first_1ui( IM->Index, IM->Flag, VERT_BIT_END_VB, start,
IM->Index[start] );
}
- if (fixup & VERT_RGBA) {
- if (orflag & VERT_RGBA)
- _tnl_fixup_4f( IM->Color, IM->Flag, start, VERT_RGBA );
+ if (fixup & VERT_BIT_COLOR0) {
+ if (orflag & VERT_BIT_COLOR0)
+ _tnl_fixup_4f( IM->Attrib[VERT_ATTRIB_COLOR0], IM->Flag, start,
+ VERT_BIT_COLOR0 );
/* No need for else case as the drivers understand stride
* zero here. (TODO - propogate this)
*/
}
- if (fixup & VERT_SPEC_RGB) {
- if (orflag & VERT_SPEC_RGB)
- _tnl_fixup_4f( IM->SecondaryColor, IM->Flag, start,
- VERT_SPEC_RGB );
+ if (fixup & VERT_BIT_COLOR1) {
+ if (orflag & VERT_BIT_COLOR1)
+ _tnl_fixup_4f( IM->Attrib[VERT_ATTRIB_COLOR1], IM->Flag, start,
+ VERT_BIT_COLOR1 );
else
- fixup_first_4f( IM->SecondaryColor, IM->Flag, VERT_END_VB, start,
- IM->SecondaryColor[start] );
+ fixup_first_4f( IM->Attrib[VERT_ATTRIB_COLOR1], IM->Flag, VERT_BIT_END_VB, start,
+ IM->Attrib[VERT_ATTRIB_COLOR1][start] );
}
- if (fixup & VERT_FOG_COORD) {
- if (orflag & VERT_FOG_COORD)
- _tnl_fixup_1f( IM->FogCoord, IM->Flag, start, VERT_FOG_COORD );
+ if (fixup & VERT_BIT_FOG) {
+ if (orflag & VERT_BIT_FOG)
+ _tnl_fixup_4f( IM->Attrib[VERT_ATTRIB_FOG], IM->Flag,
+ start, VERT_BIT_FOG );
else
- fixup_first_1f( IM->FogCoord, IM->Flag, VERT_END_VB, start,
- IM->FogCoord[start] );
+ fixup_first_4f( IM->Attrib[VERT_ATTRIB_FOG], IM->Flag, VERT_BIT_END_VB,
+ start, IM->Attrib[VERT_ATTRIB_FOG][start] );
}
- if (fixup & VERT_NORM) {
- if (orflag & VERT_NORM)
- _tnl_fixup_3f( IM->Normal, IM->Flag, start, VERT_NORM );
+ if (fixup & VERT_BIT_NORMAL) {
+ if (orflag & VERT_BIT_NORMAL)
+ _tnl_fixup_4f( IM->Attrib[VERT_ATTRIB_NORMAL], IM->Flag, start,
+ VERT_BIT_NORMAL );
else
- fixup_first_3f( IM->Normal, IM->Flag, VERT_END_VB, start,
- IM->Normal[start] );
+ fixup_first_4f( IM->Attrib[VERT_ATTRIB_NORMAL], IM->Flag,
+ VERT_BIT_END_VB, start,
+ IM->Attrib[VERT_ATTRIB_NORMAL][start] );
}
}
/* Prune possible half-filled slot.
*/
- IM->Flag[IM->LastData+1] &= ~VERT_END_VB;
- IM->Flag[IM->Count] |= VERT_END_VB;
+ IM->Flag[IM->LastData+1] &= ~VERT_BIT_END_VB;
+ IM->Flag[IM->Count] |= VERT_BIT_END_VB;
/* Materials:
@@ -348,7 +376,7 @@ void _tnl_fixup_input( GLcontext *ctx, struct immediate *IM )
GLuint i = IM->Start;
do {
- while (!(IM->Flag[i] & VERT_MATERIAL))
+ while (!(IM->Flag[i] & VERT_BIT_MATERIAL))
i++;
vulnerable &= ~IM->MaterialMask[i];
@@ -363,24 +391,26 @@ void _tnl_fixup_input( GLcontext *ctx, struct immediate *IM )
}
-
-
-static void copy_material( struct immediate *next,
- struct immediate *prev,
- GLuint dst, GLuint src )
+static void
+copy_material( struct immediate *next,
+ struct immediate *prev,
+ GLuint dst, GLuint src )
{
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
+/* _mesa_debug(NULL, "%s\n", __FUNCTION__); */
if (next->Material == 0) {
- next->Material = (GLmaterial (*)[2]) MALLOC( sizeof(GLmaterial) *
- IMM_SIZE * 2 );
+ next->Material = (struct gl_material (*)[2])
+ MALLOC( sizeof(struct gl_material) * IMM_SIZE * 2 );
next->MaterialMask = (GLuint *) MALLOC( sizeof(GLuint) * IMM_SIZE );
}
next->MaterialMask[dst] = prev->MaterialOrMask;
- MEMCPY(next->Material[dst], prev->Material[src], 2*sizeof(GLmaterial));
+ MEMCPY(next->Material[dst], prev->Material[src],
+ 2 * sizeof(struct gl_material));
}
+
+
static GLboolean is_fan_like[GL_POLYGON+1] = {
GL_FALSE,
GL_FALSE,
@@ -421,7 +451,7 @@ void _tnl_copy_immediate_vertices( GLcontext *ctx, struct immediate *next )
next->CopyStart = next->Start - count;
- if ((prev->CopyOrFlag & VERT_DATA) == VERT_ELT &&
+ if ((prev->CopyOrFlag & VERT_BITS_DATA) == VERT_BIT_ELT &&
ctx->Array.LockCount &&
ctx->Array.Vertex.Enabled)
{
@@ -432,25 +462,25 @@ void _tnl_copy_immediate_vertices( GLcontext *ctx, struct immediate *next )
GLuint src = elts[i+offset];
GLuint dst = next->CopyStart+i;
next->Elt[dst] = prev->Elt[src];
- next->Flag[dst] = VERT_ELT;
+ next->Flag[dst] = VERT_BIT_ELT;
elts[i+offset] = dst;
}
-/* fprintf(stderr, "ADDING VERT_ELT!\n"); */
- next->CopyOrFlag |= VERT_ELT;
- next->CopyAndFlag &= VERT_ELT;
+/* _mesa_debug(ctx, "ADDING VERT_BIT_ELT!\n"); */
+ next->CopyOrFlag |= VERT_BIT_ELT;
+ next->CopyAndFlag &= VERT_BIT_ELT;
}
else {
GLuint copy = tnl->pipeline.inputs & (prev->CopyOrFlag|prev->Evaluated);
GLuint flag;
if (is_fan_like[ctx->Driver.CurrentExecPrimitive]) {
- flag = ((prev->CopyOrFlag|prev->Evaluated) & VERT_FIXUP);
+ flag = ((prev->CopyOrFlag|prev->Evaluated) & VERT_BITS_FIXUP);
next->CopyOrFlag |= flag;
}
else {
/* Don't let an early 'glColor', etc. poison the elt path.
*/
- flag = ((prev->OrFlag|prev->Evaluated) & VERT_FIXUP);
+ flag = ((prev->OrFlag|prev->Evaluated) & VERT_BITS_FIXUP);
}
next->TexSize |= tnl->ExecCopyTexSize;
@@ -474,30 +504,31 @@ void _tnl_copy_immediate_vertices( GLcontext *ctx, struct immediate *next )
*
* Note these pointers are null when inactive.
*/
- COPY_4FV( next->Obj[dst], inputs->Obj.data[isrc] );
+ COPY_4FV( next->Attrib[VERT_ATTRIB_POS][dst],
+ inputs->Obj.data[isrc] );
- if (copy & VERT_NORM) {
-/* fprintf(stderr, "copy vert norm %d to %d (%p): %f %f %f\n", */
+ if (copy & VERT_BIT_NORMAL) {
+/* _mesa_debug(ctx, "copy vert norm %d to %d (%p): %f %f %f\n", */
/* isrc, dst, */
/* next->Normal[dst], */
/* inputs->Normal.data[isrc][0], */
/* inputs->Normal.data[isrc][1], */
/* inputs->Normal.data[isrc][2]); */
- COPY_3FV( next->Normal[dst], inputs->Normal.data[isrc] );
+ COPY_3FV( next->Attrib[VERT_ATTRIB_NORMAL][dst], inputs->Normal.data[isrc] );
}
- if (copy & VERT_RGBA)
- COPY_4FV( next->Color[dst],
+ if (copy & VERT_BIT_COLOR0)
+ COPY_4FV( next->Attrib[VERT_ATTRIB_COLOR0][dst],
((GLfloat (*)[4])inputs->Color.Ptr)[isrc] );
- if (copy & VERT_INDEX)
+ if (copy & VERT_BIT_INDEX)
next->Index[dst] = inputs->Index.data[isrc];
- if (copy & VERT_TEX_ANY) {
+ if (copy & VERT_BITS_TEX_ANY) {
GLuint i;
for (i = 0 ; i < prev->MaxTextureUnits ; i++) {
- if (copy & VERT_TEX(i))
- COPY_4FV( next->TexCoord[i][dst],
+ if (copy & VERT_BIT_TEX(i))
+ COPY_4FV( next->Attrib[VERT_ATTRIB_TEX0 + i][dst],
inputs->TexCoord[i].data[isrc] );
}
}
@@ -505,29 +536,31 @@ void _tnl_copy_immediate_vertices( GLcontext *ctx, struct immediate *next )
/* Remaining values should be the same in the 'input' struct and the
* original immediate.
*/
- if (copy & (VERT_ELT|VERT_EDGE|VERT_SPEC_RGB|VERT_FOG_COORD|
- VERT_MATERIAL)) {
+ if (copy & (VERT_BIT_ELT|VERT_BIT_EDGEFLAG|VERT_BIT_COLOR1|VERT_BIT_FOG|
+ VERT_BIT_MATERIAL)) {
- if (prev->Flag[src] & VERT_MATERIAL)
+ if (prev->Flag[src] & VERT_BIT_MATERIAL)
copy_material(next, prev, dst, src);
next->Elt[dst] = prev->Elt[src];
next->EdgeFlag[dst] = prev->EdgeFlag[src];
- COPY_4FV( next->SecondaryColor[dst], prev->SecondaryColor[src] );
- next->FogCoord[dst] = prev->FogCoord[src];
+ COPY_4FV( next->Attrib[VERT_ATTRIB_COLOR1][dst],
+ prev->Attrib[VERT_ATTRIB_COLOR1][src] );
+ COPY_4FV( next->Attrib[VERT_ATTRIB_FOG][dst],
+ prev->Attrib[VERT_ATTRIB_FOG][src] );
}
next->Flag[dst] = flag;
- next->CopyOrFlag |= prev->Flag[src] & (VERT_FIXUP|
- VERT_MATERIAL|
- VERT_OBJ);
- elts[i+offset] = dst;
+ next->CopyOrFlag |= prev->Flag[src] & (VERT_BITS_FIXUP|
+ VERT_BIT_MATERIAL|
+ VERT_BIT_POS);
+ elts[i+offset] = dst;
}
}
if (--tnl->ExecCopySource->ref_count == 0)
_tnl_free_immediate( ctx, tnl->ExecCopySource );
-
+
tnl->ExecCopySource = next; next->ref_count++;
}
@@ -544,7 +577,7 @@ void _tnl_fixup_compiled_cassette( GLcontext *ctx, struct immediate *IM )
GLuint fixup;
GLuint start = IM->Start;
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
+/* _mesa_debug(ctx, "%s\n", __FUNCTION__); */
IM->Evaluated = 0;
IM->CopyOrFlag = IM->OrFlag;
@@ -560,7 +593,7 @@ void _tnl_fixup_compiled_cassette( GLcontext *ctx, struct immediate *IM )
/* Naked array elements can be copied into the first cassette in a
* display list. Need to translate them away:
*/
- if (IM->CopyOrFlag & VERT_ELT) {
+ if (IM->CopyOrFlag & VERT_BIT_ELT) {
GLuint copy = tnl->pipeline.inputs & ~ctx->Array._Enabled;
GLuint i;
@@ -574,49 +607,59 @@ void _tnl_fixup_compiled_cassette( GLcontext *ctx, struct immediate *IM )
_tnl_copy_to_current( ctx, IM, ctx->Array._Enabled, IM->Start );
}
- fixup = tnl->pipeline.inputs & ~IM->Flag[start] & VERT_FIXUP;
+ fixup = tnl->pipeline.inputs & ~IM->Flag[start] & VERT_BITS_FIXUP;
/* _tnl_print_vert_flags("fixup compiled", fixup); */
if (fixup) {
- if (fixup & VERT_TEX_ANY) {
- GLuint i;
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
- if (fixup & VERT_TEX(i))
- fixup_first_4f( IM->TexCoord[i], IM->Flag, VERT_TEX(i), start,
- ctx->Current.Texcoord[i] );
- }
- }
- if (fixup & VERT_EDGE)
- fixup_first_1ub(IM->EdgeFlag, IM->Flag, VERT_EDGE, start,
- ctx->Current.EdgeFlag );
+ /* XXX try to replace this code with a loop over the 16 vertex
+ * attributes.
+ */
- if (fixup & VERT_INDEX)
- fixup_first_1ui(IM->Index, IM->Flag, VERT_INDEX, start,
- ctx->Current.Index );
+ if (fixup & VERT_BIT_NORMAL) {
+ fixup_first_4f(IM->Attrib[VERT_ATTRIB_NORMAL], IM->Flag,
+ VERT_BIT_NORMAL, start,
+ ctx->Current.Attrib[VERT_ATTRIB_NORMAL] );
+ }
- if (fixup & VERT_RGBA) {
- if (IM->CopyOrFlag & VERT_RGBA)
- fixup_first_4f(IM->Color, IM->Flag, VERT_RGBA, start,
- ctx->Current.Color );
+ if (fixup & VERT_BIT_COLOR0) {
+ if (IM->CopyOrFlag & VERT_BIT_COLOR0)
+ fixup_first_4f(IM->Attrib[VERT_ATTRIB_COLOR0], IM->Flag,
+ VERT_BIT_COLOR0, start,
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
else
- fixup &= ~VERT_RGBA;
+ fixup &= ~VERT_BIT_COLOR0;
}
- if (fixup & VERT_SPEC_RGB)
- fixup_first_4f(IM->SecondaryColor, IM->Flag, VERT_SPEC_RGB, start,
- ctx->Current.SecondaryColor );
+ if (fixup & VERT_BIT_COLOR1)
+ fixup_first_4f(IM->Attrib[VERT_ATTRIB_COLOR1], IM->Flag,
+ VERT_BIT_COLOR1, start,
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR1] );
- if (fixup & VERT_FOG_COORD)
- fixup_first_1f(IM->FogCoord, IM->Flag, VERT_FOG_COORD, start,
- ctx->Current.FogCoord );
+ if (fixup & VERT_BIT_FOG)
+ fixup_first_4f( IM->Attrib[VERT_ATTRIB_FOG], IM->Flag,
+ VERT_BIT_FOG, start,
+ ctx->Current.Attrib[VERT_ATTRIB_FOG] );
- if (fixup & VERT_NORM) {
- fixup_first_3f(IM->Normal, IM->Flag, VERT_NORM, start,
- ctx->Current.Normal );
+ if (fixup & VERT_BITS_TEX_ANY) {
+ GLuint i;
+ for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
+ if (fixup & VERT_BIT_TEX(i))
+ fixup_first_4f( IM->Attrib[VERT_ATTRIB_TEX0 + i], IM->Flag,
+ VERT_BIT_TEX(i), start,
+ ctx->Current.Attrib[VERT_ATTRIB_TEX0 + i] );
+ }
}
+ if (fixup & VERT_BIT_EDGEFLAG)
+ fixup_first_1ub(IM->EdgeFlag, IM->Flag, VERT_BIT_EDGEFLAG, start,
+ ctx->Current.EdgeFlag );
+
+ if (fixup & VERT_BIT_INDEX)
+ fixup_first_1ui(IM->Index, IM->Flag, VERT_BIT_INDEX, start,
+ ctx->Current.Index );
+
IM->CopyOrFlag |= fixup;
}
@@ -628,7 +671,7 @@ void _tnl_fixup_compiled_cassette( GLcontext *ctx, struct immediate *IM )
GLuint i = IM->Start;
do {
- while (!(IM->Flag[i] & VERT_MATERIAL))
+ while (!(IM->Flag[i] & VERT_BIT_MATERIAL))
i++;
vulnerable &= ~IM->MaterialMask[i];
@@ -724,7 +767,7 @@ _tnl_get_exec_copy_verts( GLcontext *ctx, struct immediate *IM )
GLuint pintro = intro[prim];
GLuint ovf = 0;
-/* fprintf(stderr, "_tnl_get_exec_copy_verts %s\n", */
+/* _mesa_debug(ctx, "_tnl_get_exec_copy_verts %s\n", */
/* _mesa_lookup_enum_by_nr(prim)); */
if (tnl->ExecCopySource)
@@ -748,6 +791,7 @@ _tnl_get_exec_copy_verts( GLcontext *ctx, struct immediate *IM )
tnl->ExecParity ^= IM->PrimitiveLength[IM->LastPrimitive] & 1;
+
if (pincr != 1 && (IM->Count - last - pintro))
ovf = (IM->Count - last - pintro) % pincr;
@@ -801,24 +845,26 @@ void _tnl_upgrade_current_data( GLcontext *ctx,
/* _tnl_print_vert_flags("_tnl_upgrade_client_data", required); */
- if ((required & VERT_RGBA) && (VB->ColorPtr[0]->Flags & CA_CLIENT_DATA)) {
+ if ((required & VERT_BIT_COLOR0) && (VB->ColorPtr[0]->Flags & CA_CLIENT_DATA)) {
struct gl_client_array *tmp = &tnl->imm_inputs.Color;
GLuint start = IM->CopyStart;
- tmp->Ptr = IM->Color + start;
+ tmp->Ptr = IM->Attrib[VERT_ATTRIB_COLOR0] + start;
tmp->StrideB = 4 * sizeof(GLfloat);
tmp->Flags = 0;
- COPY_4FV( IM->Color[start], ctx->Current.Color);
+ COPY_4FV( IM->Attrib[VERT_ATTRIB_COLOR0][start],
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
/*
- ASSERT(IM->Flag[IM->LastData+1] & VERT_END_VB);
+ ASSERT(IM->Flag[IM->LastData+1] & VERT_BIT_END_VB);
*/
- fixup_first_4f( IM->Color, IM->Flag, VERT_END_VB, start,
- IM->Color[start] );
+ fixup_first_4f( IM->Attrib[VERT_ATTRIB_COLOR0], IM->Flag,
+ VERT_BIT_END_VB,
+ start, IM->Attrib[VERT_ATTRIB_COLOR0][start] );
- VB->importable_data &= ~VERT_RGBA;
+ VB->importable_data &= ~VERT_BIT_COLOR0;
}
}
diff --git a/xc/extras/Mesa/src/tnl/t_pipeline.c b/xc/extras/Mesa/src/tnl/t_pipeline.c
index dcd4b27a0..144710e51 100644
--- a/xc/extras/Mesa/src/tnl/t_pipeline.c
+++ b/xc/extras/Mesa/src/tnl/t_pipeline.c
@@ -1,4 +1,3 @@
-/* $Id: t_pipeline.c,v 1.1.1.1 2002/10/22 13:06:18 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,12 +23,12 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#include "glheader.h"
#include "context.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "state.h"
#include "mtypes.h"
@@ -186,7 +185,7 @@ void _tnl_run_pipeline( GLcontext *ctx )
*
* - inserting optimized (but specialized) stages ahead of the
* general-purpose fallback implementation. For example, the old
- * fastpath mechanism, which only works when the VERT_ELT input is
+ * fastpath mechanism, which only works when the VERT_BIT_ELT input is
* available, can be duplicated by placing the fastpath stage at the
* head of this pipeline. Such specialized stages are currently
* constrained to have no outputs (ie. they must either finish the *
@@ -203,6 +202,9 @@ const struct gl_pipeline_stage *_tnl_default_pipeline[] = {
&_tnl_texgen_stage,
&_tnl_texture_transform_stage,
&_tnl_point_attenuation_stage,
+#if FEATURE_NV_vertex_program
+ &_tnl_vertex_program_stage,
+#endif
&_tnl_render_stage,
0
};
diff --git a/xc/extras/Mesa/src/tnl/t_pipeline.h b/xc/extras/Mesa/src/tnl/t_pipeline.h
index c8b8e0a5a..9ccdb7998 100644
--- a/xc/extras/Mesa/src/tnl/t_pipeline.h
+++ b/xc/extras/Mesa/src/tnl/t_pipeline.h
@@ -1,4 +1,3 @@
-/* $Id: t_pipeline.h,v 1.1.1.1 2002/10/22 13:06:18 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
@@ -54,6 +53,7 @@ extern const struct gl_pipeline_stage _tnl_fog_coordinate_stage;
extern const struct gl_pipeline_stage _tnl_texgen_stage;
extern const struct gl_pipeline_stage _tnl_texture_transform_stage;
extern const struct gl_pipeline_stage _tnl_point_attenuation_stage;
+extern const struct gl_pipeline_stage _tnl_vertex_program_stage;
extern const struct gl_pipeline_stage _tnl_render_stage;
/* Shorthand to plug in the default pipeline:
diff --git a/xc/extras/Mesa/src/tnl/t_vb_cliptmp.h b/xc/extras/Mesa/src/tnl/t_vb_cliptmp.h
index 351ee782f..2484560d2 100644
--- a/xc/extras/Mesa/src/tnl/t_vb_cliptmp.h
+++ b/xc/extras/Mesa/src/tnl/t_vb_cliptmp.h
@@ -1,4 +1,3 @@
-/* $Id: t_vb_cliptmp.h,v 1.1.1.1 2002/10/22 13:06:21 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
@@ -140,11 +139,11 @@ TAG(clip_line)( GLcontext *ctx, GLuint i, GLuint j, GLubyte mask )
if (mask & CLIP_USER_BIT) {
for (p=0;p<MAX_CLIP_PLANES;p++) {
- if (ctx->Transform.ClipEnabled[p]) {
- GLfloat a = ctx->Transform._ClipUserPlane[p][0];
- GLfloat b = ctx->Transform._ClipUserPlane[p][1];
- GLfloat c = ctx->Transform._ClipUserPlane[p][2];
- GLfloat d = ctx->Transform._ClipUserPlane[p][3];
+ if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
+ const GLfloat a = ctx->Transform._ClipUserPlane[p][0];
+ const GLfloat b = ctx->Transform._ClipUserPlane[p][1];
+ const GLfloat c = ctx->Transform._ClipUserPlane[p][2];
+ const GLfloat d = ctx->Transform._ClipUserPlane[p][3];
LINE_CLIP( CLIP_USER_BIT, a, b, c, d );
}
}
@@ -188,13 +187,13 @@ TAG(clip_tri)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLubyte mask )
if (mask & CLIP_USER_BIT) {
for (p=0;p<MAX_CLIP_PLANES;p++) {
- if (ctx->Transform.ClipEnabled[p]) {
- GLfloat a = ctx->Transform._ClipUserPlane[p][0];
- GLfloat b = ctx->Transform._ClipUserPlane[p][1];
- GLfloat c = ctx->Transform._ClipUserPlane[p][2];
- GLfloat d = ctx->Transform._ClipUserPlane[p][3];
- POLY_CLIP( CLIP_USER_BIT, a, b, c, d );
- }
+ if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
+ const GLfloat a = ctx->Transform._ClipUserPlane[p][0];
+ const GLfloat b = ctx->Transform._ClipUserPlane[p][1];
+ const GLfloat c = ctx->Transform._ClipUserPlane[p][2];
+ const GLfloat d = ctx->Transform._ClipUserPlane[p][3];
+ POLY_CLIP( CLIP_USER_BIT, a, b, c, d );
+ }
}
}
@@ -241,11 +240,11 @@ TAG(clip_quad)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3,
if (mask & CLIP_USER_BIT) {
for (p=0;p<MAX_CLIP_PLANES;p++) {
- if (ctx->Transform.ClipEnabled[p]) {
- GLfloat a = ctx->Transform._ClipUserPlane[p][0];
- GLfloat b = ctx->Transform._ClipUserPlane[p][1];
- GLfloat c = ctx->Transform._ClipUserPlane[p][2];
- GLfloat d = ctx->Transform._ClipUserPlane[p][3];
+ if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
+ const GLfloat a = ctx->Transform._ClipUserPlane[p][0];
+ const GLfloat b = ctx->Transform._ClipUserPlane[p][1];
+ const GLfloat c = ctx->Transform._ClipUserPlane[p][2];
+ const GLfloat d = ctx->Transform._ClipUserPlane[p][3];
POLY_CLIP( CLIP_USER_BIT, a, b, c, d );
}
}
diff --git a/xc/extras/Mesa/src/tnl/t_vb_fog.c b/xc/extras/Mesa/src/tnl/t_vb_fog.c
index bddbc6211..d59980417 100644
--- a/xc/extras/Mesa/src/tnl/t_vb_fog.c
+++ b/xc/extras/Mesa/src/tnl/t_vb_fog.c
@@ -1,10 +1,9 @@
-/* $Id: t_vb_fog.c,v 1.1.1.1 2002/10/22 13:06:22 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
@@ -32,7 +31,7 @@
#include "colormac.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
@@ -43,8 +42,8 @@
struct fog_stage_data {
- GLvector1f fogcoord; /* has actual storage allocated */
- GLvector1f input; /* points into VB->EyePtr Z values */
+ GLvector4f fogcoord; /* has actual storage allocated */
+ GLvector4f input; /* points into VB->EyePtr Z values */
};
#define FOG_STAGE_DATA(stage) ((struct fog_stage_data *)stage->privatePtr)
@@ -85,14 +84,14 @@ static void init_static_data( void )
}
-static void make_win_fog_coords( GLcontext *ctx, GLvector1f *out,
- const GLvector1f *in )
+static void make_win_fog_coords( GLcontext *ctx, GLvector4f *out,
+ const GLvector4f *in )
{
GLfloat end = ctx->Fog.End;
GLfloat *v = in->start;
GLuint stride = in->stride;
GLuint n = in->count;
- GLfloat *data = out->data;
+ GLfloat (*data)[4] = out->data;
GLfloat d;
GLuint i;
@@ -106,19 +105,19 @@ static void make_win_fog_coords( GLcontext *ctx, GLvector1f *out,
d = 1.0F / (ctx->Fog.End - ctx->Fog.Start);
for ( i = 0 ; i < n ; i++, STRIDE_F(v, stride)) {
GLfloat f = (end - ABSF(*v)) * d;
- data[i] = CLAMP(f, 0.0F, 1.0F);
+ data[i][0] = CLAMP(f, 0.0F, 1.0F);
}
break;
case GL_EXP:
d = ctx->Fog.Density;
for ( i = 0 ; i < n ; i++, STRIDE_F(v,stride))
- NEG_EXP( data[i], d * ABSF(*v) );
+ NEG_EXP( data[i][0], d * ABSF(*v) );
break;
case GL_EXP2:
d = ctx->Fog.Density*ctx->Fog.Density;
for ( i = 0 ; i < n ; i++, STRIDE_F(v, stride)) {
GLfloat z = *v;
- NEG_EXP( data[i], d * z * z );
+ NEG_EXP( data[i][0], d * z * z );
}
break;
default:
@@ -133,7 +132,7 @@ static GLboolean run_fog_stage( GLcontext *ctx,
{
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
struct fog_stage_data *store = FOG_STAGE_DATA(stage);
- GLvector1f *input;
+ GLvector4f *input;
if (stage->changed_inputs == 0)
return GL_TRUE;
@@ -145,7 +144,7 @@ static GLboolean run_fog_stage( GLcontext *ctx,
VB->FogCoordPtr = &store->fogcoord;
if (!ctx->_NeedEyeCoords) {
- GLfloat *m = ctx->ModelView.m;
+ const GLfloat *m = ctx->ModelviewMatrixStack.Top->m;
GLfloat plane[4];
/* Use this to store calculated eye z values:
@@ -160,25 +159,25 @@ static GLboolean run_fog_stage( GLcontext *ctx,
/* Full eye coords weren't required, just calculate the
* eye Z values.
*/
- _mesa_dotprod_tab[VB->ObjPtr->size]( input->data,
- sizeof(GLfloat),
+ _mesa_dotprod_tab[VB->ObjPtr->size]( (GLfloat *) input->data,
+ 4 * sizeof(GLfloat),
VB->ObjPtr, plane );
input->count = VB->ObjPtr->count;
}
- else
- {
+ else {
input = &store->input;
if (VB->EyePtr->size < 2)
_mesa_vector4f_clean_elem( VB->EyePtr, VB->Count, 2 );
- input->data = &(VB->EyePtr->data[0][2]);
+ input->data = (GLfloat (*)[4]) &(VB->EyePtr->data[0][2]);
input->start = VB->EyePtr->start+2;
input->stride = VB->EyePtr->stride;
input->count = VB->EyePtr->count;
}
- } else {
+ }
+ else {
/* use glFogCoord() coordinates */
/* source = VB->FogCoordPtr */
input = VB->FogCoordPtr;
@@ -190,14 +189,15 @@ static GLboolean run_fog_stage( GLcontext *ctx,
return GL_TRUE;
}
+
static void check_fog_stage( GLcontext *ctx, struct gl_pipeline_stage *stage )
{
- stage->active = ctx->Fog.Enabled;
+ stage->active = ctx->Fog.Enabled && !ctx->VertexProgram.Enabled;
if (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT)
- stage->inputs = VERT_EYE;
+ stage->inputs = VERT_BIT_EYE;
else
- stage->inputs = VERT_FOG_COORD;
+ stage->inputs = VERT_BIT_FOG;
}
@@ -213,8 +213,8 @@ static GLboolean alloc_fog_data( GLcontext *ctx,
if (!store)
return GL_FALSE;
- _mesa_vector1f_alloc( &store->fogcoord, 0, tnl->vb.Size, 32 );
- _mesa_vector1f_init( &store->input, 0, 0 );
+ _mesa_vector4f_alloc( &store->fogcoord, 0, tnl->vb.Size, 32 );
+ _mesa_vector4f_init( &store->input, 0, 0 );
if (!inited)
init_static_data();
@@ -230,7 +230,7 @@ static void free_fog_data( struct gl_pipeline_stage *stage )
{
struct fog_stage_data *store = FOG_STAGE_DATA(stage);
if (store) {
- _mesa_vector1f_free( &store->fogcoord );
+ _mesa_vector4f_free( &store->fogcoord );
FREE( store );
stage->privatePtr = NULL;
}
@@ -239,11 +239,14 @@ static void free_fog_data( struct gl_pipeline_stage *stage )
const struct gl_pipeline_stage _tnl_fog_coordinate_stage =
{
- "build fog coordinates",
- _NEW_FOG,
- _NEW_FOG,
- 0, 0, VERT_FOG_COORD, /* active, inputs, outputs */
- 0, 0, /* changed_inputs, private_data */
+ "build fog coordinates", /* name */
+ _NEW_FOG, /* check_state */
+ _NEW_FOG, /* run_state */
+ GL_FALSE, /* active? */
+ 0, /* inputs */
+ VERT_BIT_FOG, /* outputs */
+ 0, /* changed_inputs */
+ NULL, /* private_data */
free_fog_data, /* dtr */
check_fog_stage, /* check */
alloc_fog_data /* run -- initially set to init. */
diff --git a/xc/extras/Mesa/src/tnl/t_vb_light.c b/xc/extras/Mesa/src/tnl/t_vb_light.c
index a38c42cf0..a75dacf54 100644
--- a/xc/extras/Mesa/src/tnl/t_vb_light.c
+++ b/xc/extras/Mesa/src/tnl/t_vb_light.c
@@ -1,4 +1,3 @@
-/* $Id: t_vb_light.c,v 1.1.1.1 2002/10/22 13:06:19 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -30,7 +29,7 @@
#include "colormac.h"
#include "light.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "simple_list.h"
#include "mtypes.h"
@@ -168,12 +167,12 @@ static GLboolean run_lighting( GLcontext *ctx, struct gl_pipeline_stage *stage )
/* Make sure we can talk about elements 0..2 in the vector we are
* lighting.
*/
- if (stage->changed_inputs & (VERT_EYE|VERT_OBJ)) {
+ if (stage->changed_inputs & (VERT_BIT_EYE|VERT_BIT_POS)) {
if (input->size <= 2) {
if (input->flags & VEC_NOT_WRITEABLE) {
- ASSERT(VB->importable_data & VERT_OBJ);
+ ASSERT(VB->importable_data & VERT_BIT_POS);
- VB->import_data( ctx, VERT_OBJ, VEC_NOT_WRITEABLE );
+ VB->import_data( ctx, VERT_BIT_POS, VEC_NOT_WRITEABLE );
input = ctx->_NeedEyeCoords ? VB->EyePtr : VB->ObjPtr;
ASSERT((input->flags & VEC_NOT_WRITEABLE) == 0);
@@ -295,19 +294,19 @@ static GLboolean run_init_lighting( GLcontext *ctx,
*/
static void check_lighting( GLcontext *ctx, struct gl_pipeline_stage *stage )
{
- stage->active = ctx->Light.Enabled;
+ stage->active = ctx->Light.Enabled && !ctx->VertexProgram.Enabled;
if (stage->active) {
if (stage->privatePtr)
stage->run = run_validate_lighting;
- stage->inputs = VERT_NORM|VERT_MATERIAL;
+ stage->inputs = VERT_BIT_NORMAL|VERT_BIT_MATERIAL;
if (ctx->Light._NeedVertices)
- stage->inputs |= VERT_EYE; /* effectively, even when lighting in obj */
+ stage->inputs |= VERT_BIT_EYE; /* effectively, even when lighting in obj */
if (ctx->Light.ColorMaterialEnabled)
- stage->inputs |= VERT_RGBA;
+ stage->inputs |= VERT_BIT_COLOR0;
- stage->outputs = VERT_RGBA;
+ stage->outputs = VERT_BIT_COLOR0;
if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
- stage->outputs |= VERT_SPEC_RGB;
+ stage->outputs |= VERT_BIT_COLOR1;
}
}
@@ -334,13 +333,16 @@ static void dtr( struct gl_pipeline_stage *stage )
const struct gl_pipeline_stage _tnl_lighting_stage =
{
- "lighting",
+ "lighting", /* name */
_NEW_LIGHT, /* recheck */
_NEW_LIGHT|_NEW_MODELVIEW, /* recalc -- modelview dependency
* otherwise not captured by inputs
- * (which may be VERT_OBJ) */
- 0,0,0, /* active, inputs, outputs */
- 0,0, /* changed_inputs, private_data */
+ * (which may be VERT_BIT_POS) */
+ GL_FALSE, /* active? */
+ 0, /* inputs */
+ 0, /* outputs */
+ 0, /* changed_inputs */
+ NULL, /* private_data */
dtr, /* destroy */
check_lighting, /* check */
run_init_lighting /* run -- initially set to ctr */
diff --git a/xc/extras/Mesa/src/tnl/t_vb_lighttmp.h b/xc/extras/Mesa/src/tnl/t_vb_lighttmp.h
index 5618d4af7..c0ef45cce 100644
--- a/xc/extras/Mesa/src/tnl/t_vb_lighttmp.h
+++ b/xc/extras/Mesa/src/tnl/t_vb_lighttmp.h
@@ -1,8 +1,7 @@
-/* $Id: t_vb_lighttmp.h,v 1.1.1.1 2002/10/22 13:06:22 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
@@ -25,32 +24,32 @@
*
*
* Authors:
- * Brian Paul <brianp@valinux.com>
- * Keith Whitwell <keithw@valinux.com>
+ * Brian Paul
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#if (IDX & LIGHT_FLAGS)
# define VSTRIDE (4 * sizeof(GLfloat))
-# define NSTRIDE (3 * sizeof(GLfloat))
-# define CHECK_MATERIAL(x) (flags[x] & VERT_MATERIAL)
-# define CHECK_END_VB(x) (flags[x] & VERT_END_VB)
+# define NSTRIDE nstride /*(3 * sizeof(GLfloat))*/
+# define CHECK_MATERIAL(x) (flags[x] & VERT_BIT_MATERIAL)
+# define CHECK_END_VB(x) (flags[x] & VERT_BIT_END_VB)
# if (IDX & LIGHT_COLORMATERIAL)
# define CMSTRIDE STRIDE_F(CMcolor, CMstride)
-# define CHECK_COLOR_MATERIAL(x) (flags[x] & VERT_RGBA)
-# define CHECK_VALIDATE(x) (flags[x] & (VERT_RGBA|VERT_MATERIAL))
+# define CHECK_COLOR_MATERIAL(x) (flags[x] & VERT_BIT_COLOR0)
+# define CHECK_VALIDATE(x) (flags[x] & (VERT_BIT_COLOR0|VERT_BIT_MATERIAL))
# define DO_ANOTHER_NORMAL(x) \
- ((flags[x] & (VERT_RGBA|VERT_NORM|VERT_END_VB|VERT_MATERIAL)) == VERT_NORM)
+ ((flags[x] & (VERT_BIT_COLOR0|VERT_BIT_NORMAL|VERT_BIT_END_VB|VERT_BIT_MATERIAL)) == VERT_BIT_NORMAL)
# define REUSE_LIGHT_RESULTS(x) \
- ((flags[x] & (VERT_RGBA|VERT_NORM|VERT_END_VB|VERT_MATERIAL)) == 0)
+ ((flags[x] & (VERT_BIT_COLOR0|VERT_BIT_NORMAL|VERT_BIT_END_VB|VERT_BIT_MATERIAL)) == 0)
# else
# define CMSTRIDE (void)0
# define CHECK_COLOR_MATERIAL(x) 0
-# define CHECK_VALIDATE(x) (flags[x] & (VERT_MATERIAL))
+# define CHECK_VALIDATE(x) (flags[x] & (VERT_BIT_MATERIAL))
# define DO_ANOTHER_NORMAL(x) \
- ((flags[x] & (VERT_NORM|VERT_END_VB|VERT_MATERIAL)) == VERT_NORM)
+ ((flags[x] & (VERT_BIT_NORMAL|VERT_BIT_END_VB|VERT_BIT_MATERIAL)) == VERT_BIT_NORMAL)
# define REUSE_LIGHT_RESULTS(x) \
- ((flags[x] & (VERT_NORM|VERT_END_VB|VERT_MATERIAL)) == 0)
+ ((flags[x] & (VERT_BIT_NORMAL|VERT_BIT_END_VB|VERT_BIT_MATERIAL)) == 0)
# endif
#else
# define VSTRIDE vstride
@@ -80,7 +79,15 @@
#endif
+/* define TRACE if to trace lighting code */
+
+/*
+ * ctx is the current context
+ * VB is the vertex buffer
+ * stage is the lighting stage-private data
+ * input is the vector of eye or object-space vertex coordinates
+ */
static void TAG(light_rgba_spec)( GLcontext *ctx,
struct vertex_buffer *VB,
struct gl_pipeline_stage *stage,
@@ -89,12 +96,11 @@ static void TAG(light_rgba_spec)( GLcontext *ctx,
struct light_stage_data *store = LIGHT_STAGE_DATA(stage);
GLfloat (*base)[3] = ctx->Light._BaseColor;
GLchan sumA[2];
-
GLuint j;
- GLuint vstride = input->stride;
+ const GLuint vstride = input->stride;
const GLfloat *vertex = (GLfloat *)input->data;
- GLuint nstride = VB->NormalPtr->stride;
+ const GLuint nstride = VB->NormalPtr->stride;
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
GLfloat *CMcolor;
@@ -104,23 +110,19 @@ static void TAG(light_rgba_spec)( GLcontext *ctx,
GLchan (*Bcolor)[4] = (GLchan (*)[4]) store->LitColor[1].Ptr;
GLchan (*Fspec)[4] = (GLchan (*)[4]) store->LitSecondary[0].Ptr;
GLchan (*Bspec)[4] = (GLchan (*)[4]) store->LitSecondary[1].Ptr;
- GLchan (*spec[2])[4];
- GLuint nr = VB->Count;
- GLuint *flags = VB->Flag;
+ const GLuint nr = VB->Count;
+ const GLuint *flags = VB->Flag;
struct gl_material (*new_material)[2] = VB->Material;
- GLuint *new_material_mask = VB->MaterialMask;
+ const GLuint *new_material_mask = VB->MaterialMask;
(void) flags;
(void) nstride;
(void) vstride;
-
- if (MESA_VERBOSE & VERBOSE_LIGHTING)
- fprintf(stderr, "%s\n", __FUNCTION__ );
-
- spec[0] = Fspec;
- spec[1] = Bspec;
+#ifdef TRACE
+ fprintf(stderr, "%s\n", __FUNCTION__ );
+#endif
if (IDX & LIGHT_COLORMATERIAL) {
if (VB->ColorPtr[0]->Type != GL_FLOAT ||
@@ -310,9 +312,9 @@ static void TAG(light_rgba)( GLcontext *ctx,
GLfloat (*base)[3] = ctx->Light._BaseColor;
GLchan sumA[2];
- GLuint vstride = input->stride;
+ const GLuint vstride = input->stride;
const GLfloat *vertex = (GLfloat *) input->data;
- GLuint nstride = VB->NormalPtr->stride;
+ const GLuint nstride = VB->NormalPtr->stride;
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
GLfloat *CMcolor;
@@ -321,14 +323,15 @@ static void TAG(light_rgba)( GLcontext *ctx,
GLchan (*Fcolor)[4] = (GLchan (*)[4]) store->LitColor[0].Ptr;
GLchan (*Bcolor)[4] = (GLchan (*)[4]) store->LitColor[1].Ptr;
GLchan (*color[2])[4];
- GLuint *flags = VB->Flag;
+ const GLuint *flags = VB->Flag;
struct gl_material (*new_material)[2] = VB->Material;
- GLuint *new_material_mask = VB->MaterialMask;
- GLuint nr = VB->Count;
+ const GLuint *new_material_mask = VB->MaterialMask;
+ const GLuint nr = VB->Count;
- if (MESA_VERBOSE & VERBOSE_LIGHTING)
- fprintf(stderr, "%s\n", __FUNCTION__ );
+#ifdef TRACE
+ fprintf(stderr, "%s\n", __FUNCTION__ );
+#endif
(void) flags;
(void) nstride;
@@ -522,23 +525,24 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
{
struct light_stage_data *store = LIGHT_STAGE_DATA(stage);
- GLuint nstride = VB->NormalPtr->stride;
+ const GLuint nstride = VB->NormalPtr->stride;
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
GLfloat *CMcolor;
GLuint CMstride;
GLchan (*Fcolor)[4] = (GLchan (*)[4]) store->LitColor[0].Ptr;
GLchan (*Bcolor)[4] = (GLchan (*)[4]) store->LitColor[1].Ptr;
- struct gl_light *light = ctx->Light.EnabledList.next;
- GLuint *flags = VB->Flag;
+ const struct gl_light *light = ctx->Light.EnabledList.next;
+ const GLuint *flags = VB->Flag;
GLchan basechan[2][4];
GLuint j = 0;
struct gl_material (*new_material)[2] = VB->Material;
- GLuint *new_material_mask = VB->MaterialMask;
+ const GLuint *new_material_mask = VB->MaterialMask;
GLfloat base[2][3];
- GLuint nr = VB->Count;
+ const GLuint nr = VB->Count;
- if (MESA_VERBOSE & VERBOSE_LIGHTING)
- fprintf(stderr, "%s\n", __FUNCTION__ );
+#ifdef TRACE
+ fprintf(stderr, "%s\n", __FUNCTION__ );
+#endif
(void) input; /* doesn't refer to Eye or Obj */
(void) flags;
@@ -608,7 +612,8 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
Bcolor[j][3] = basechan[1][3];
}
COPY_CHAN4(Fcolor[j], basechan[0]);
- } else {
+ }
+ else {
GLfloat n_dot_h = DOT3(normal, light->_h_inf_norm);
GLfloat sum[3];
COPY_3V(sum, base[0]);
@@ -650,22 +655,22 @@ static void TAG(light_fast_rgba)( GLcontext *ctx,
{
struct light_stage_data *store = LIGHT_STAGE_DATA(stage);
GLchan sumA[2];
- GLuint nstride = VB->NormalPtr->stride;
+ const GLuint nstride = VB->NormalPtr->stride;
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
GLfloat *CMcolor;
GLuint CMstride;
GLchan (*Fcolor)[4] = (GLchan (*)[4]) store->LitColor[0].Ptr;
GLchan (*Bcolor)[4] = (GLchan (*)[4]) store->LitColor[1].Ptr;
- GLuint *flags = VB->Flag;
+ const GLuint *flags = VB->Flag;
GLuint j = 0;
struct gl_material (*new_material)[2] = VB->Material;
GLuint *new_material_mask = VB->MaterialMask;
- GLuint nr = VB->Count;
- struct gl_light *light;
-
- if (MESA_VERBOSE & VERBOSE_LIGHTING)
- fprintf(stderr, "%s\n", __FUNCTION__ );
+ const GLuint nr = VB->Count;
+ const struct gl_light *light;
+#ifdef TRACE
+ fprintf(stderr, "%s\n", __FUNCTION__ );
+#endif
(void) flags;
(void) input;
@@ -791,20 +796,21 @@ static void TAG(light_ci)( GLcontext *ctx,
{
struct light_stage_data *store = LIGHT_STAGE_DATA(stage);
GLuint j;
- GLuint vstride = input->stride;
+ const GLuint vstride = input->stride;
const GLfloat *vertex = (GLfloat *) input->data;
- GLuint nstride = VB->NormalPtr->stride;
+ const GLuint nstride = VB->NormalPtr->stride;
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
GLfloat *CMcolor;
GLuint CMstride;
- GLuint *flags = VB->Flag;
+ const GLuint *flags = VB->Flag;
GLuint *indexResult[2];
struct gl_material (*new_material)[2] = VB->Material;
GLuint *new_material_mask = VB->MaterialMask;
- GLuint nr = VB->Count;
+ const GLuint nr = VB->Count;
- if (MESA_VERBOSE & VERBOSE_LIGHTING)
- fprintf(stderr, "%s\n", __FUNCTION__ );
+#ifdef TRACE
+ fprintf(stderr, "%s\n", __FUNCTION__ );
+#endif
(void) flags;
(void) nstride;
diff --git a/xc/extras/Mesa/src/tnl/t_vb_normals.c b/xc/extras/Mesa/src/tnl/t_vb_normals.c
index 6ec71d0a0..a99de7a21 100644
--- a/xc/extras/Mesa/src/tnl/t_vb_normals.c
+++ b/xc/extras/Mesa/src/tnl/t_vb_normals.c
@@ -1,10 +1,9 @@
-/* $Id: t_vb_normals.c,v 1.1.1.1 2002/10/22 13:06:25 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
@@ -32,7 +31,7 @@
#include "colormac.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
@@ -45,7 +44,7 @@
struct normal_stage_data {
normal_func NormalTransform;
- GLvector3f normal;
+ GLvector4f normal;
};
#define NORMAL_STAGE_DATA(stage) ((struct normal_stage_data *)stage->privatePtr)
@@ -66,16 +65,16 @@ static GLboolean run_normal_stage( GLcontext *ctx,
* got a transformation matrix with uniform scaling.
*/
const GLfloat *lengths;
- if (ctx->ModelView.flags & MAT_FLAG_GENERAL_SCALE)
+ if (ctx->ModelviewMatrixStack.Top->flags & MAT_FLAG_GENERAL_SCALE)
lengths = NULL;
else
lengths = VB->NormalLengthPtr;
- store->NormalTransform( &ctx->ModelView,
+ store->NormalTransform( ctx->ModelviewMatrixStack.Top,
ctx->_ModelViewInvScale,
- VB->NormalPtr,
+ VB->NormalPtr, /* input normals */
lengths,
- &store->normal );
+ &store->normal ); /* resulting normals */
}
VB->NormalPtr = &store->normal;
@@ -94,7 +93,7 @@ static GLboolean run_validate_normal_stage( GLcontext *ctx,
if (ctx->_NeedEyeCoords) {
GLuint transform = NORM_TRANSFORM_NO_ROT;
- if (ctx->ModelView.flags & (MAT_FLAG_GENERAL |
+ if (ctx->ModelviewMatrixStack.Top->flags & (MAT_FLAG_GENERAL |
MAT_FLAG_ROTATION |
MAT_FLAG_GENERAL_3D |
MAT_FLAG_PERSPECTIVE))
@@ -138,7 +137,7 @@ static GLboolean run_validate_normal_stage( GLcontext *ctx,
static void check_normal_transform( GLcontext *ctx,
struct gl_pipeline_stage *stage )
{
- stage->active = ctx->_NeedNormals;
+ stage->active = ctx->_NeedNormals && !ctx->VertexProgram.Enabled;
/* Don't clobber the initialize function:
*/
if (stage->privatePtr)
@@ -156,7 +155,7 @@ static GLboolean alloc_normal_data( GLcontext *ctx,
if (!store)
return GL_FALSE;
- _mesa_vector3f_alloc( &store->normal, 0, tnl->vb.Size, 32 );
+ _mesa_vector4f_alloc( &store->normal, 0, tnl->vb.Size, 32 );
/* Now run the stage.
*/
@@ -170,7 +169,7 @@ static void free_normal_data( struct gl_pipeline_stage *stage )
{
struct normal_stage_data *store = NORMAL_STAGE_DATA(stage);
if (store) {
- _mesa_vector3f_free( &store->normal );
+ _mesa_vector4f_free( &store->normal );
FREE( store );
stage->privatePtr = NULL;
}
@@ -185,11 +184,14 @@ static void free_normal_data( struct gl_pipeline_stage *stage )
const struct gl_pipeline_stage _tnl_normal_transform_stage =
{
- "normal transform",
+ "normal transform", /* name */
_TNL_NEW_NORMAL_TRANSFORM, /* re-check */
_TNL_NEW_NORMAL_TRANSFORM, /* re-run */
- 0,VERT_NORM,VERT_NORM, /* active, inputs, outputs */
- 0, 0, /* changed_inputs, private */
+ GL_FALSE, /* active? */
+ VERT_BIT_NORMAL, /* inputs */
+ VERT_BIT_NORMAL, /* outputs */
+ 0, /* changed_inputs */
+ NULL, /* private data */
free_normal_data, /* destructor */
check_normal_transform, /* check */
alloc_normal_data /* run -- initially set to alloc */
diff --git a/xc/extras/Mesa/src/tnl/t_vb_points.c b/xc/extras/Mesa/src/tnl/t_vb_points.c
index 57b0142ee..67e527ca8 100644
--- a/xc/extras/Mesa/src/tnl/t_vb_points.c
+++ b/xc/extras/Mesa/src/tnl/t_vb_points.c
@@ -1,10 +1,9 @@
-/* $Id: t_vb_points.c,v 1.1.1.1 2002/10/22 13:06:25 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,17 +23,17 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Brian Paul <brian@valinux.com>
+ * Brian Paul
*/
#include "mtypes.h"
-#include "mem.h"
+#include "imports.h"
#include "t_context.h"
#include "t_pipeline.h"
struct point_stage_data {
- GLvector1f PointSize;
+ GLvector4f PointSize;
};
#define POINT_STAGE_DATA(stage) ((struct point_stage_data *)stage->privatePtr)
@@ -53,7 +52,7 @@ static GLboolean run_point_stage( GLcontext *ctx,
const GLfloat p1 = ctx->Point.Params[1];
const GLfloat p2 = ctx->Point.Params[2];
const GLfloat pointSize = ctx->Point._Size;
- GLfloat *size = store->PointSize.data;
+ GLfloat (*size)[4] = store->PointSize.data;
GLuint i;
if (stage->changed_inputs) {
@@ -61,7 +60,7 @@ static GLboolean run_point_stage( GLcontext *ctx,
for (i = 0; i < VB->Count; i++) {
const GLfloat dist = -eye[i][2];
/* GLfloat dist = GL_SQRT(pos[0]*pos[0]+pos[1]*pos[1]+pos[2]*pos[2]);*/
- size[i] = pointSize / (p0 + dist * (p1 + dist * p2));
+ size[i][0] = pointSize / (p0 + dist * (p1 + dist * p2));
}
}
@@ -76,7 +75,7 @@ static GLboolean run_point_stage( GLcontext *ctx,
*/
static void check_point_size( GLcontext *ctx, struct gl_pipeline_stage *d )
{
- d->active = ctx->Point._Attenuated;
+ d->active = ctx->Point._Attenuated && !ctx->VertexProgram.Enabled;
}
static GLboolean alloc_point_data( GLcontext *ctx,
@@ -89,7 +88,7 @@ static GLboolean alloc_point_data( GLcontext *ctx,
if (!store)
return GL_FALSE;
- _mesa_vector1f_alloc( &store->PointSize, 0, VB->Size, 32 );
+ _mesa_vector4f_alloc( &store->PointSize, 0, VB->Size, 32 );
/* Now run the stage.
*/
@@ -102,7 +101,7 @@ static void free_point_data( struct gl_pipeline_stage *stage )
{
struct point_stage_data *store = POINT_STAGE_DATA(stage);
if (store) {
- _mesa_vector1f_free( &store->PointSize );
+ _mesa_vector4f_free( &store->PointSize );
FREE( store );
stage->privatePtr = 0;
}
@@ -113,11 +112,11 @@ const struct gl_pipeline_stage _tnl_point_attenuation_stage =
"point size attenuation", /* name */
_NEW_POINT, /* build_state_change */
_NEW_POINT, /* run_state_change */
- 0, /* active */
- VERT_EYE, /* inputs */
- VERT_POINT_SIZE, /* outputs */
+ GL_FALSE, /* active */
+ VERT_BIT_EYE, /* inputs */
+ VERT_BIT_POINT_SIZE, /* outputs */
0, /* changed_inputs (temporary value) */
- 0, /* stage private data */
+ NULL, /* stage private data */
free_point_data, /* destructor */
check_point_size, /* check */
alloc_point_data /* run -- initially set to alloc data */
diff --git a/xc/extras/Mesa/src/tnl/t_vb_render.c b/xc/extras/Mesa/src/tnl/t_vb_render.c
index ac50cad60..3eb09b619 100644
--- a/xc/extras/Mesa/src/tnl/t_vb_render.c
+++ b/xc/extras/Mesa/src/tnl/t_vb_render.c
@@ -1,4 +1,3 @@
-/* $Id: t_vb_render.c,v 1.1.1.1 2002/10/22 13:06:21 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
@@ -44,7 +43,7 @@
#include "context.h"
#include "enums.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mtypes.h"
#include "mmath.h"
@@ -228,7 +227,7 @@ static void clip_elt_triangles( GLcontext *ctx,
const quad_func QuadFunc = tnl->Driver.Render.Quad; \
const GLboolean stipple = ctx->Line.StippleFlag; \
(void) (LineFunc && TriangleFunc && QuadFunc); \
- (void) elt; (void) stipple;
+ (void) elt; (void) stipple
#define RESET_STIPPLE if (stipple) tnl->Driver.Render.ResetLineStipple( ctx )
#define RESET_OCCLUSION ctx->OcclusionResult = GL_TRUE
@@ -283,7 +282,6 @@ static GLboolean run_render( GLcontext *ctx,
render_func *tab;
GLint pass = 0;
-
/* Allow the drivers to lock before projected verts are built so
* that window coordinates are guarenteed not to change before
* rendering.
@@ -328,7 +326,7 @@ static GLboolean run_render( GLcontext *ctx,
ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
if (MESA_VERBOSE & VERBOSE_PRIMS)
- fprintf(stderr, "MESA prim %s %d..%d\n",
+ _mesa_debug(NULL, "MESA prim %s %d..%d\n",
_mesa_lookup_enum_by_nr(flags & PRIM_MODE_MASK),
i, i+length);
@@ -357,39 +355,39 @@ static GLboolean run_render( GLcontext *ctx,
*/
static void check_render( GLcontext *ctx, struct gl_pipeline_stage *stage )
{
- GLuint inputs = VERT_CLIP;
+ GLuint inputs = VERT_BIT_CLIP;
GLuint i;
if (ctx->Visual.rgbMode) {
- inputs |= VERT_RGBA;
+ inputs |= VERT_BIT_COLOR0;
if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
- inputs |= VERT_SPEC_RGB;
+ inputs |= VERT_BIT_COLOR1;
- if (ctx->Texture._ReallyEnabled) {
+ if (ctx->Texture._EnabledUnits) {
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
if (ctx->Texture.Unit[i]._ReallyEnabled)
- inputs |= VERT_TEX(i);
+ inputs |= VERT_BIT_TEX(i);
}
}
}
else {
- inputs |= VERT_INDEX;
+ inputs |= VERT_BIT_INDEX;
}
if (ctx->Point._Attenuated)
- inputs |= VERT_POINT_SIZE;
+ inputs |= VERT_BIT_POINT_SIZE;
/* How do drivers turn this off?
*/
if (ctx->Fog.Enabled)
- inputs |= VERT_FOG_COORD;
+ inputs |= VERT_BIT_FOG;
if (ctx->_TriangleCaps & DD_TRI_UNFILLED)
- inputs |= VERT_EDGE;
+ inputs |= VERT_BIT_EDGEFLAG;
if (ctx->RenderMode==GL_FEEDBACK)
- inputs |= VERT_TEX_ANY;
+ inputs |= VERT_BITS_TEX_ANY;
stage->inputs = inputs;
}
@@ -404,7 +402,7 @@ static void dtr( struct gl_pipeline_stage *stage )
const struct gl_pipeline_stage _tnl_render_stage =
{
- "render",
+ "render", /* name */
(_NEW_BUFFERS |
_DD_NEW_SEPARATE_SPECULAR |
_DD_NEW_FLATSHADE |
@@ -415,9 +413,11 @@ const struct gl_pipeline_stage _tnl_render_stage =
_DD_NEW_TRI_UNFILLED |
_NEW_RENDERMODE), /* re-check (new inputs, interp function) */
0, /* re-run (always runs) */
- GL_TRUE, /* active */
- 0, 0, /* inputs (set in check_render), outputs */
- 0, 0, /* changed_inputs, private */
+ GL_TRUE, /* active? */
+ 0, /* inputs (set in check_render) */
+ 0, /* outputs */
+ 0, /* changed_inputs */
+ NULL, /* private data */
dtr, /* destructor */
check_render, /* check */
run_render /* run */
diff --git a/xc/extras/Mesa/src/tnl/t_vb_rendertmp.h b/xc/extras/Mesa/src/tnl/t_vb_rendertmp.h
index 5e3ad4ff0..7bc0e37fa 100644
--- a/xc/extras/Mesa/src/tnl/t_vb_rendertmp.h
+++ b/xc/extras/Mesa/src/tnl/t_vb_rendertmp.h
@@ -1,4 +1,3 @@
-/* $Id: t_vb_rendertmp.h,v 1.1.1.1 2002/10/22 13:06:19 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
diff --git a/xc/extras/Mesa/src/tnl/t_vb_texgen.c b/xc/extras/Mesa/src/tnl/t_vb_texgen.c
index 1e78644fa..25ae2bcd5 100644
--- a/xc/extras/Mesa/src/tnl/t_vb_texgen.c
+++ b/xc/extras/Mesa/src/tnl/t_vb_texgen.c
@@ -1,4 +1,3 @@
-/* $Id: t_vb_texgen.c,v 1.1.1.1 2002/10/22 13:06:26 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,8 +23,8 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Brian Paul <brian@valinux.com>
- * Keith Whitwell <keithw@valinux.com>
+ * Brian Paul
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
@@ -34,7 +33,7 @@
#include "context.h"
#include "macros.h"
#include "mmath.h"
-#include "mem.h"
+#include "imports.h"
#include "mtypes.h"
#include "math/m_xform.h"
@@ -95,7 +94,7 @@ static GLuint all_bits[5] = {
static void build_m3( GLfloat f[][3], GLfloat m[],
- const GLvector3f *normal,
+ const GLvector4f *normal,
const GLvector4f *eye )
{
GLuint stride = eye->stride;
@@ -122,7 +121,7 @@ static void build_m3( GLfloat f[][3], GLfloat m[],
static void build_m2( GLfloat f[][3], GLfloat m[],
- const GLvector3f *normal,
+ const GLvector4f *normal,
const GLvector4f *eye )
{
GLuint stride = eye->stride;
@@ -152,7 +151,7 @@ static void build_m2( GLfloat f[][3], GLfloat m[],
typedef void (*build_m_func)( GLfloat f[][3],
GLfloat m[],
- const GLvector3f *normal,
+ const GLvector4f *normal,
const GLvector4f *eye );
@@ -171,7 +170,7 @@ static build_m_func build_m_tab[5] = {
*/
static void build_f3( GLfloat *f,
GLuint fstride,
- const GLvector3f *normal,
+ const GLvector4f *normal,
const GLvector4f *eye )
{
GLuint stride = eye->stride;
@@ -198,7 +197,7 @@ static void build_f3( GLfloat *f,
static void build_f2( GLfloat *f,
GLuint fstride,
- const GLvector3f *normal,
+ const GLvector4f *normal,
const GLvector4f *eye )
{
GLuint stride = eye->stride;
@@ -226,7 +225,7 @@ static void build_f2( GLfloat *f,
typedef void (*build_f_func)( GLfloat *f,
GLuint fstride,
- const GLvector3f *normal_vec,
+ const GLvector4f *normal_vec,
const GLvector4f *eye );
@@ -281,7 +280,7 @@ static void texgen_normal_map_nv( GLcontext *ctx,
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
GLvector4f *in = VB->TexCoordPtr[unit];
GLvector4f *out = &store->texcoord[unit];
- GLvector3f *normal = VB->NormalPtr;
+ GLvector4f *normal = VB->NormalPtr;
GLfloat (*texcoord)[4] = (GLfloat (*)[4])out->start;
GLuint count = VB->Count;
GLuint i;
@@ -322,7 +321,7 @@ static void texgen_sphere_map( GLcontext *ctx,
GLfloat (*f)[3] = store->tmp_f;
GLfloat *m = store->tmp_m;
-/* fprintf(stderr, "%s normstride %d eyestride %d\n", */
+/* _mesa_debug(NULL, "%s normstride %d eyestride %d\n", */
/* __FUNCTION__, VB->NormalPtr->stride, */
/* VB->EyePtr->stride); */
@@ -362,7 +361,7 @@ static void texgen( GLcontext *ctx,
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
const GLvector4f *obj = VB->ObjPtr;
const GLvector4f *eye = VB->EyePtr;
- const GLvector3f *normal = VB->NormalPtr;
+ const GLvector4f *normal = VB->NormalPtr;
GLfloat (*texcoord)[4] = (GLfloat (*)[4])out->data;
GLfloat *indata;
GLuint count = VB->Count;
@@ -529,7 +528,7 @@ static GLboolean run_texgen_stage( GLcontext *ctx,
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
if (ctx->Texture._TexGenEnabled & ENABLE_TEXGEN(i)) {
- if (stage->changed_inputs & (VERT_EYE | VERT_NORM | VERT_TEX(i)))
+ if (stage->changed_inputs & (VERT_BIT_EYE | VERT_BIT_NORMAL | VERT_BIT_TEX(i)))
store->TexgenFunc[i]( ctx, store, i );
VB->TexCoordPtr[i] = &store->texcoord[i];
@@ -591,28 +590,28 @@ static void check_texgen( GLcontext *ctx, struct gl_pipeline_stage *stage )
GLuint i;
stage->active = 0;
- if (ctx->Texture._TexGenEnabled) {
+ if (ctx->Texture._TexGenEnabled && !ctx->VertexProgram.Enabled) {
GLuint inputs = 0;
GLuint outputs = 0;
if (ctx->Texture._GenFlags & TEXGEN_OBJ_LINEAR)
- inputs |= VERT_OBJ;
+ inputs |= VERT_BIT_POS;
if (ctx->Texture._GenFlags & TEXGEN_NEED_EYE_COORD)
- inputs |= VERT_EYE;
+ inputs |= VERT_BIT_EYE;
if (ctx->Texture._GenFlags & TEXGEN_NEED_NORMALS)
- inputs |= VERT_NORM;
+ inputs |= VERT_BIT_NORMAL;
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
if (ctx->Texture._TexGenEnabled & ENABLE_TEXGEN(i))
{
- outputs |= VERT_TEX(i);
+ outputs |= VERT_BIT_TEX(i);
/* Need the original input in case it contains a Q coord:
* (sigh)
*/
- inputs |= VERT_TEX(i);
+ inputs |= VERT_BIT_TEX(i);
/* Something for Feedback? */
}
@@ -678,11 +677,14 @@ static void free_texgen_data( struct gl_pipeline_stage *stage )
const struct gl_pipeline_stage _tnl_texgen_stage =
{
- "texgen",
+ "texgen", /* name */
_NEW_TEXTURE, /* when to call check() */
_NEW_TEXTURE, /* when to invalidate stored data */
- 0,0,0, /* active, inputs, outputs */
- 0,0, /* changed_inputs, private */
+ GL_FALSE, /* active? */
+ 0, /* inputs */
+ 0, /* outputs */
+ 0, /* changed_inputs */
+ NULL, /* private data */
free_texgen_data, /* destructor */
check_texgen, /* check */
alloc_texgen_data /* run -- initially set to alloc data */
diff --git a/xc/extras/Mesa/src/tnl/t_vb_texmat.c b/xc/extras/Mesa/src/tnl/t_vb_texmat.c
index 600ec0e23..c81e790de 100644
--- a/xc/extras/Mesa/src/tnl/t_vb_texmat.c
+++ b/xc/extras/Mesa/src/tnl/t_vb_texmat.c
@@ -1,4 +1,3 @@
-/* $Id: t_vb_texmat.c,v 1.1.1.1 2002/10/22 13:06:26 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
@@ -32,7 +31,7 @@
#include "colormac.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
@@ -60,12 +59,12 @@ static void check_texmat( GLcontext *ctx, struct gl_pipeline_stage *stage )
GLuint i;
stage->active = 0;
- if (ctx->Texture._TexMatEnabled) {
+ if (ctx->Texture._TexMatEnabled && !ctx->VertexProgram.Enabled) {
GLuint flags = 0;
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
if (ctx->Texture._TexMatEnabled & ENABLE_TEXMAT(i))
- flags |= VERT_TEX(i);
+ flags |= VERT_BIT_TEX(i);
stage->active = 1;
stage->inputs = flags;
@@ -85,8 +84,9 @@ static GLboolean run_texmat_stage( GLcontext *ctx,
*/
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
if (ctx->Texture._TexMatEnabled & ENABLE_TEXMAT(i)) {
- if (stage->changed_inputs & VERT_TEX(i))
- (void) TransformRaw( &store->texcoord[i], &ctx->TextureMatrix[i],
+ if (stage->changed_inputs & VERT_BIT_TEX(i))
+ (void) TransformRaw( &store->texcoord[i],
+ ctx->TextureMatrixStack[i].Top,
VB->TexCoordPtr[i]);
VB->TexCoordPtr[i] = &store->texcoord[i];
@@ -137,12 +137,15 @@ static void free_texmat_data( struct gl_pipeline_stage *stage )
const struct gl_pipeline_stage _tnl_texture_transform_stage =
{
- "texture transform",
- _NEW_TEXTURE|_NEW_TEXTURE_MATRIX,
- _NEW_TEXTURE|_NEW_TEXTURE_MATRIX,
- 0,0,0, /* active, inputs, outputs */
- 0,0, /* changed_inputs, private */
- free_texmat_data, /* destructor */
- check_texmat, /* check */
- alloc_texmat_data, /* run -- initially set to init */
+ "texture transform", /* name */
+ _NEW_TEXTURE|_NEW_TEXTURE_MATRIX, /* check_state */
+ _NEW_TEXTURE|_NEW_TEXTURE_MATRIX, /* run_state */
+ GL_FALSE, /* active? */
+ 0, /* inputs */
+ 0, /* outputs */
+ 0, /* changed_inputs */
+ NULL, /* private data */
+ free_texmat_data, /* destructor */
+ check_texmat, /* check */
+ alloc_texmat_data, /* run -- initially set to init */
};
diff --git a/xc/extras/Mesa/src/tnl/t_vb_vertex.c b/xc/extras/Mesa/src/tnl/t_vb_vertex.c
index aacda742e..27e47feaf 100644
--- a/xc/extras/Mesa/src/tnl/t_vb_vertex.c
+++ b/xc/extras/Mesa/src/tnl/t_vb_vertex.c
@@ -1,8 +1,7 @@
-/* $Id: t_vb_vertex.c,v 1.1.1.1 2002/10/22 13:06:17 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 5.0
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
@@ -32,7 +31,7 @@
#include "colormac.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
@@ -57,7 +56,7 @@ struct vertex_stage_data {
*/
GLvector4f *save_eyeptr;
GLvector4f *save_clipptr;
- GLvector4f *save_projptr;
+ GLvector4f *save_ndcptr;
};
#define VERTEX_STAGE_DATA(stage) ((struct vertex_stage_data *)stage->privatePtr)
@@ -79,7 +78,7 @@ static void NAME( GLcontext *ctx, \
GLuint p; \
\
for (p = 0; p < ctx->Const.MaxClipPlanes; p++) \
- if (ctx->Transform.ClipEnabled[p]) { \
+ if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { \
GLuint nr, i; \
const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; \
const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; \
@@ -137,22 +136,26 @@ static GLboolean run_vertex_stage( GLcontext *ctx,
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
+ ASSERT(!ctx->VertexProgram.Enabled);
+
if (stage->changed_inputs) {
if (ctx->_NeedEyeCoords) {
/* Separate modelview transformation:
* Use combined ModelProject to avoid some depth artifacts
*/
- if (ctx->ModelView.type == MATRIX_IDENTITY)
+ if (ctx->ModelviewMatrixStack.Top->type == MATRIX_IDENTITY)
VB->EyePtr = VB->ObjPtr;
else
- VB->EyePtr = TransformRaw( &store->eye, &ctx->ModelView,
+ VB->EyePtr = TransformRaw( &store->eye,
+ ctx->ModelviewMatrixStack.Top,
VB->ObjPtr);
- if (ctx->ProjectionMatrix.type == MATRIX_IDENTITY)
+ if (ctx->ProjectionMatrixStack.Top->type == MATRIX_IDENTITY)
VB->ClipPtr = VB->EyePtr;
else
- VB->ClipPtr = TransformRaw( &store->clip, &ctx->_ModelProjectMatrix,
+ VB->ClipPtr = TransformRaw( &store->clip,
+ &ctx->_ModelProjectMatrix,
VB->ObjPtr );
}
else {
@@ -171,7 +174,7 @@ static GLboolean run_vertex_stage( GLcontext *ctx,
if (VB->ClipPtr->size < 4) {
if (VB->ClipPtr->flags & VEC_NOT_WRITEABLE) {
ASSERT(VB->ClipPtr == VB->ObjPtr);
- VB->import_data( ctx, VERT_OBJ, VEC_NOT_WRITEABLE );
+ VB->import_data( ctx, VERT_BIT_POS, VEC_NOT_WRITEABLE );
VB->ClipPtr = VB->ObjPtr;
}
if (VB->ClipPtr->size == 2)
@@ -185,16 +188,16 @@ static GLboolean run_vertex_stage( GLcontext *ctx,
store->ormask = 0;
store->andmask = CLIP_ALL_BITS;
- if (tnl->NeedProjCoords) {
- VB->ProjectedClipPtr =
+ if (tnl->NeedNdcCoords) {
+ VB->NdcPtr =
_mesa_clip_tab[VB->ClipPtr->size]( VB->ClipPtr,
&store->proj,
store->clipmask,
&store->ormask,
&store->andmask );
-
- } else {
- VB->ProjectedClipPtr = 0;
+ }
+ else {
+ VB->NdcPtr = 0;
_mesa_clip_np_tab[VB->ClipPtr->size]( VB->ClipPtr,
0,
store->clipmask,
@@ -209,7 +212,7 @@ static GLboolean run_vertex_stage( GLcontext *ctx,
/* Test userclip planes. This contributes to VB->ClipMask, so
* is essentially required to be in this stage.
*/
- if (ctx->Transform._AnyClip) {
+ if (ctx->Transform.ClipPlanesEnabled) {
usercliptab[VB->ClipPtr->size]( ctx,
VB->ClipPtr,
store->clipmask,
@@ -223,23 +226,23 @@ static GLboolean run_vertex_stage( GLcontext *ctx,
VB->ClipOrMask = store->ormask;
VB->ClipMask = store->clipmask;
- if (VB->ClipPtr == VB->ObjPtr && (VB->importable_data & VERT_OBJ))
- VB->importable_data |= VERT_CLIP;
+ if (VB->ClipPtr == VB->ObjPtr && (VB->importable_data & VERT_BIT_POS))
+ VB->importable_data |= VERT_BIT_CLIP;
store->save_eyeptr = VB->EyePtr;
store->save_clipptr = VB->ClipPtr;
- store->save_projptr = VB->ProjectedClipPtr;
+ store->save_ndcptr = VB->NdcPtr;
}
else {
/* Replay the sideeffects.
*/
VB->EyePtr = store->save_eyeptr;
VB->ClipPtr = store->save_clipptr;
- VB->ProjectedClipPtr = store->save_projptr;
+ VB->NdcPtr = store->save_ndcptr;
VB->ClipMask = store->clipmask;
VB->ClipOrMask = store->ormask;
- if (VB->ClipPtr == VB->ObjPtr && (VB->importable_data & VERT_OBJ))
- VB->importable_data |= VERT_CLIP;
+ if (VB->ClipPtr == VB->ObjPtr && (VB->importable_data & VERT_BIT_POS))
+ VB->importable_data |= VERT_BIT_CLIP;
if (store->andmask)
return GL_FALSE;
}
@@ -250,8 +253,7 @@ static GLboolean run_vertex_stage( GLcontext *ctx,
static void check_vertex( GLcontext *ctx, struct gl_pipeline_stage *stage )
{
- (void) ctx;
- (void) stage;
+ stage->active = !ctx->VertexProgram.Enabled;
}
static GLboolean init_vertex_stage( GLcontext *ctx,
@@ -303,15 +305,17 @@ static void dtr( struct gl_pipeline_stage *stage )
const struct gl_pipeline_stage _tnl_vertex_transform_stage =
{
"modelview/project/cliptest/divide",
- 0, /* re-check -- always on */
- _MESA_NEW_NEED_EYE_COORDS |
+ _NEW_PROGRAM, /* check_state: only care about vertex prog */
+ _MESA_NEW_NEED_EYE_COORDS | /* run_state: when to invalidate / re-run */
_NEW_MODELVIEW|
_NEW_PROJECTION|
- _NEW_TRANSFORM, /* re-run */
+ _NEW_PROGRAM|
+ _NEW_TRANSFORM,
GL_TRUE, /* active */
- VERT_OBJ, /* inputs */
- VERT_EYE|VERT_CLIP, /* outputs */
- 0, 0, /* changed_inputs, private */
+ VERT_BIT_POS, /* inputs */
+ VERT_BIT_EYE|VERT_BIT_CLIP, /* outputs */
+ 0, /* changed_inputs */
+ NULL, /* private data */
dtr, /* destructor */
check_vertex, /* check */
init_vertex_stage /* run -- initially set to init */
diff --git a/xc/extras/Mesa/src/tnl/t_vtx_api.c b/xc/extras/Mesa/src/tnl/t_vtx_api.c
new file mode 100644
index 000000000..4076051c8
--- /dev/null
+++ b/xc/extras/Mesa/src/tnl/t_vtx_api.c
@@ -0,0 +1,808 @@
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+#include "mtypes.h"
+#include "colormac.h"
+#include "simple_list.h"
+#include "vtxfmt.h"
+
+#include "tnl_vtx_api.h"
+
+/* Fallback versions of all the entrypoints for situations where
+ * codegen isn't available. This is slowed significantly by all the
+ * gumph necessary to get to the tnl pointer.
+ */
+
+
+/* MultiTexcoord ends up with both of these branches, unfortunately
+ * (it may get its own version of the macro after size-tracking is
+ * working).
+ *
+ * Errors (VertexAttribNV when ATTR>15) are handled at a higher level.
+ */
+#define ATTRF( ATTR, N, A, B, C, D ) \
+{ \
+ GET_CURRENT_CONTEXT( ctx ); \
+ TNLcontext *tnl = TNL_CONTEXT(ctx); \
+ \
+ if ((ATTR) == 0) { \
+ int i; \
+ \
+ if (N>0) tnl->vbptr[0].f = A; \
+ if (N>1) tnl->vbptr[1].f = B; \
+ if (N>2) tnl->vbptr[2].f = C; \
+ if (N>3) tnl->vbptr[3].f = D; \
+ \
+ for (i = N; i < tnl->vertex_size; i++) \
+ *tnl->vbptr[i].i = tnl->vertex[i].i; \
+ \
+ tnl->vbptr += tnl->vertex_size; \
+ \
+ if (--tnl->counter == 0) \
+ tnl->notify(); \
+ } \
+ else { \
+ GLfloat *dest = tnl->attrptr[ATTR]; \
+ if (N>0) dest[0] = A; \
+ if (N>1) dest[1] = B; \
+ if (N>2) dest[2] = C; \
+ if (N>3) dest[3] = D; \
+ } \
+}
+
+#define ATTR4F( ATTR, A, B, C, D ) ATTRF( ATTR, 4, A, B, C, D )
+#define ATTR3F( ATTR, A, B, C, D ) ATTRF( ATTR, 3, A, B, C, 1 )
+#define ATTR2F( ATTR, A, B, C, D ) ATTRF( ATTR, 2, A, B, 0, 1 )
+#define ATTR1F( ATTR, A, B, C, D ) ATTRF( ATTR, 1, A, 0, 0, 1 )
+
+#define ATTR3UB( ATTR, A, B, C ) \
+ ATTR3F( ATTR, \
+ UBYTE_TO_FLOAT(A), \
+ UBYTE_TO_FLOAT(B), \
+ UBYTE_TO_FLOAT(C))
+
+
+#define ATTR4UB( ATTR, A, B, C, D ) \
+ ATTR4F( ATTR, \
+ UBYTE_TO_FLOAT(A), \
+ UBYTE_TO_FLOAT(B), \
+ UBYTE_TO_FLOAT(C), \
+ UBYTE_TO_FLOAT(D))
+
+
+/* Vertex
+ */
+static void tnl_Vertex2f( GLfloat x, GLfloat y )
+{
+ ATTR2F( VERT_ATTRIB_POS, x, y );
+}
+
+static void tnl_Vertex2fv( const GLfloat *v )
+{
+ ATTR2F( VERT_ATTRIB_POS, v[0], v[1] );
+}
+
+static void tnl_Vertex3f( GLfloat x, GLfloat y, GLfloat z )
+{
+ ATTR3F( VERT_ATTRIB_POS, x, y, z );
+}
+
+static void tnl_Vertex3fv( const GLfloat *v )
+{
+ ATTR3F( VERT_ATTRIB_POS, v[0], v[1], v[2] );
+}
+
+static void tnl_Vertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+{
+ ATTR4F( VERT_ATTRIB_POS, x, y, z, w );
+}
+
+static void tnl_Vertex4fv( const GLfloat *v )
+{
+ ATTR4F( VERT_ATTRIB_POS, v[0], v[1], v[2], v[3] );
+}
+
+
+/* Color
+ */
+static void tnl_Color3ub( GLubyte r, GLubyte g, GLubyte b )
+{
+ ATTR3UB( VERT_ATTRIB_COLOR0, r, g, b );
+}
+
+static void tnl_Color3ubv( const GLubyte *v )
+{
+ ATTR3UB( VERT_ATTRIB_COLOR0, v[0], v[1], v[2] );
+}
+
+static void tnl_Color4ub( GLubyte r, GLubyte g, GLubyte b, GLubyte a )
+{
+ ATTR4UB( VERT_ATTRIB_COLOR0, r, g, b, a );
+}
+
+static void tnl_Color4ubv( const GLubyte *v )
+{
+ ATTR4UB( VERT_ATTRIB_COLOR0, v[0], v[1], v[2], v[3] );
+}
+
+static void tnl_Color3f( GLfloat r, GLfloat g, GLfloat b )
+{
+ ATTR3F( VERT_ATTRIB_COLOR0, r, g, b );
+}
+
+static void tnl_Color3fv( const GLfloat *v )
+{
+ ATTR3F( VERT_ATTRIB_COLOR0, v[0], v[1], v[2] );
+}
+
+static void tnl_Color4f( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
+{
+ ATTR4F( VERT_ATTRIB_COLOR0, r, g, b, a );
+}
+
+static void tnl_Color4fv( const GLfloat *v )
+{
+ ATTR4F( VERT_ATTRIB_COLOR0, v[0], v[1], v[2], v[3] );
+}
+
+
+/* Secondary Color
+ */
+static void tnl_SecondaryColor3ubEXT( GLubyte r, GLubyte g, GLubyte b )
+{
+ ATTR3UB( VERT_ATTRIB_COLOR1, r, g, b );
+}
+
+static void tnl_SecondaryColor3ubvEXT( const GLubyte *v )
+{
+ ATTR3UB( VERT_ATTRIB_COLOR1, v[0], v[1], v[2] );
+}
+
+static void tnl_SecondaryColor3fEXT( GLfloat r, GLfloat g, GLfloat b )
+{
+ ATTR3F( VERT_ATTRIB_COLOR1, r, g, b );
+}
+
+static void tnl_SecondaryColor3fvEXT( const GLfloat *v )
+{
+ ATTR3F( VERT_ATTRIB_COLOR1, v[0], v[1], v[2] );
+}
+
+
+
+/* Fog Coord
+ */
+static void tnl_FogCoordfEXT( GLfloat f )
+{
+ ATTR1F( VERT_ATTRIB_FOG, f );
+}
+
+static void tnl_FogCoordfvEXT( const GLfloat *v )
+{
+ ATTR1F( VERT_ATTRIB_FOG, v[0] );
+}
+
+
+
+/* Normal
+ */
+static void tnl_Normal3f( GLfloat n0, GLfloat n1, GLfloat n2 )
+{
+ ATTR3F( VERT_ATTRIB_NORMAL, n0, n1, n2 );
+}
+
+static void tnl_Normal3fv( const GLfloat *v )
+{
+ ATTR3F( VERT_ATTRIB_COLOR1, v[0], v[1], v[2] );
+}
+
+
+/* TexCoord
+ */
+static void tnl_TexCoord1f( GLfloat s )
+{
+ ATTR1F( VERT_ATTRIB_TEX0, s );
+}
+
+static void tnl_TexCoord1fv( const GLfloat *v )
+{
+ ATTR1F( VERT_ATTRIB_TEX0, v[0] );
+}
+
+static void tnl_TexCoord2f( GLfloat s, GLfloat t )
+{
+ ATTR2F( VERT_ATTRIB_TEX0, s, t );
+}
+
+static void tnl_TexCoord2fv( const GLfloat *v )
+{
+ ATTR2F( VERT_ATTRIB_TEX0, v[0], v[1] );
+}
+
+static void tnl_TexCoord3f( GLfloat s, GLfloat t, GLfloat r )
+{
+ ATTR3F( VERT_ATTRIB_TEX0, s, t, r );
+}
+
+static void tnl_TexCoord3fv( const GLfloat *v )
+{
+ ATTR3F( VERT_ATTRIB_TEX0, v[0], v[1], v[2] );
+}
+
+static void tnl_TexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q )
+{
+ ATTR4F( VERT_ATTRIB_TEX0, s, t, r, q );
+}
+
+static void tnl_TexCoord4fv( const GLfloat *v )
+{
+ ATTR4F( VERT_ATTRIB_TEX0, v[0], v[1], v[2], v[3] );
+}
+
+
+/* Miscellaneous:
+ *
+ * These don't alias NV attributes, but still need similar treatment.
+ * Basically these are attributes with numbers greater than 16.
+ */
+static void tnl_EdgeFlag( GLboolean flag )
+{
+ GLfloat f = flag ? 1 : 0;
+ ATTR1F( VERT_ATTRIB_EDGEFLAG, f);
+}
+
+static void tnl_EdgeFlagv( const GLboolean *flag )
+{
+ GLfloat f = flag[0] ? 1 : 0;
+ ATTR1F( VERT_ATTRIB_EDGEFLAG, f);
+}
+
+static void tnl_Indexi( GLint idx )
+{
+ ATTR1F( VERT_ATTRIB_INDEX, idx );
+}
+
+static void tnl_Indexiv( const GLint *idx )
+{
+ ATTR1F( VERT_ATTRIB_INDEX, idx );
+}
+
+/* Use dispatch switching to build 'ranges' of eval vertices for each
+ * type, avoiding need for flags. (Make
+ * evalcoords/evalpoints/vertices/attr0 mutually exclusive)
+ */
+static void _tnl_EvalCoord1f( GLfloat u )
+{
+ ATTR1F( VERT_ATTRIB_POS, u );
+}
+
+static void _tnl_EvalCoord1fv( const GLfloat *v )
+{
+ ATTR1F( VERT_ATTRIB_POS, v[0] );
+}
+
+static void _tnl_EvalCoord2f( GLfloat u, GLfloat v )
+{
+ ATTR2F( VERT_ATTRIB_POS, u, v );
+}
+
+static void _tnl_EvalCoord2fv( const GLfloat *v )
+{
+ ATTR2F( VERT_ATTRIB_POS, v[0], v[1] );
+}
+
+
+
+/* Second level dispatch table for MultiTexCoord, Material and
+ * VertexAttribNV.
+ *
+ * Need this because we want to track things like vertex attribute
+ * sizes, presence/otherwise of attribs in recorded vertices, etc, by
+ * manipulating the state of dispatch tables. Need therefore a
+ * dispatch slot for each value of 'index' or 'unit' in VertexAttribNV
+ * and MultiTexCoordARB. Also need a mechnism for keeping this data
+ * consistent with what's coming in via the Vertex/Normal/etc api
+ * above (where aliasing exists with the traditional entrypoints).
+ * Note that MultiTexCoordARB aliases with TexCoord when unit==0.
+ *
+ * Need presence tracking for material components, too, but not size
+ * tracking or help with aliasing. Could move material to seperate
+ * dispatch without the "*4" below, or even do the checks every time.
+ */
+struct attr_dispatch_tab {
+ void (*tab[32*4])( void );
+ void (*swapped[32*4])( void );
+ int swapcount;
+ int installed_sizes[32];
+};
+
+#define DISPATCH_ATTR1F( ATTR, N, )
+ tnl->vb.attr_dispatch
+
+/* Result at the back end after second dispatch -- could further
+ * specialize for attr zero -- maybe just in the codegen version.
+ */
+static void tnl_Attr1f( GLint attr, GLfloat s )
+{
+ ATTR1F( attr, s );
+}
+
+static void tnl_Attr1fv( GLint attr, const GLfloat *v )
+{
+ ATTR1F( attr, v[0] );
+}
+
+static void tnl_Attr2f( GLint attr, GLfloat s, GLfloat t )
+{
+ ATTR2F( attr, s, t );
+}
+
+static void tnl_Attr2fv( GLint attr, const GLfloat *v )
+{
+ ATTR2F( attr, v[0], v[1] );
+}
+
+static void tnl_Attr3f( GLint attr, GLfloat s, GLfloat t, GLfloat r )
+{
+ ATTR3F( attr, s, t, r );
+}
+
+static void tnl_Attr3fv( GLint attr, const GLfloat *v )
+{
+ ATTR3F( attr, v[0], v[1], v[2] );
+}
+
+static void tnl_Attr4f( GLint attr, GLfloat s, GLfloat t, GLfloat r, GLfloat q )
+{
+ ATTR4F( attr, s, t, r, q );
+}
+
+static void tnl_Attr4fv( GLint attr, const GLfloat *v )
+{
+ ATTR4F( attr, v[0], v[1], v[2], v[3] );
+}
+
+
+/* MultiTexcoord: Send through second level dispatch.
+ */
+static void tnl_MultiTexCoord1fARB( GLenum target, GLfloat s )
+{
+ GLuint attr = (target - GL_TEXTURE0_ARB) + VERT_ATTRIB_TEX0;
+ if (attr < MAX_VERT_ATTRS)
+ DISPATCH_ATTR1F( attr, s );
+}
+
+static void tnl_MultiTexCoord1fvARB( GLenum target, const GLfloat *v )
+{
+ GLuint attr = (target - GL_TEXTURE0_ARB) + VERT_ATTRIB_TEX0;
+ if (attr < MAX_VERT_ATTRS)
+ DISPATCH_ATTR1F( attr, v[0] );
+}
+
+static void tnl_MultiTexCoord2fARB( GLenum target, GLfloat s, GLfloat t )
+{
+ GLuint attr = (target - GL_TEXTURE0_ARB) + VERT_ATTRIB_TEX0;
+ if (attr < MAX_VERT_ATTRS)
+ DISPATCH_ATTR2F( attr, s, t );
+}
+
+static void tnl_MultiTexCoord2fvARB( GLenum target, const GLfloat *v )
+{
+ GLuint attr = (target - GL_TEXTURE0_ARB) + VERT_ATTRIB_TEX0;
+ if (attr < MAX_VERT_ATTRS)
+ DISPATCH_ATTR2F( attr, v[0], v[1] );
+}
+
+static void tnl_MultiTexCoord3fARB( GLenum target, GLfloat s, GLfloat t,
+ GLfloat r)
+{
+ GLuint attr = (target - GL_TEXTURE0_ARB) + VERT_ATTRIB_TEX0;
+ if (attr < MAX_VERT_ATTRS)
+ DISPATCH_ATTR3F( attr, s, t, r );
+}
+
+static void tnl_MultiTexCoord3fvARB( GLenum target, const GLfloat *v )
+{
+ GLuint attr = (target - GL_TEXTURE0_ARB) + VERT_ATTRIB_TEX0;
+ if (attr < MAX_VERT_ATTRS)
+ DISPATCH_ATTR3F( attr, v[0], v[1], v[2] );
+}
+
+static void tnl_MultiTexCoord4fARB( GLenum target, GLfloat s, GLfloat t,
+ GLfloat r, GLfloat q )
+{
+ GLuint attr = (target - GL_TEXTURE0_ARB) + VERT_ATTRIB_TEX0;
+ if (attr < MAX_VERT_ATTRS)
+ DISPATCH_ATTR4F( attr, s, t, r, q );
+}
+
+static void tnl_MultiTexCoord4fvARB( GLenum target, const GLfloat *v )
+{
+ GLuint attr = (target - GL_TEXTURE0_ARB) + VERT_ATTRIB_TEX0;
+ if (attr < MAX_VERT_ATTRS)
+ DISPATCH_ATTR4F( attr, v[0], v[1], v[2], v[3] );
+}
+
+
+/* NV_vertex_program:
+ *
+ * Check for errors & reroute through second dispatch layer to get
+ * size tracking per-attribute.
+ */
+static void tnl_VertexAttrib1fNV( GLuint index, GLfloat s )
+{
+ if (index < MAX_VERT_ATTRS)
+ DISPATCH_ATTR1F( index, s );
+ else
+ DISPATCH_ERROR;
+}
+
+static void tnl_VertexAttrib1fvNV( GLuint index, const GLfloat *v )
+{
+ if (index < MAX_VERT_ATTRS)
+ DISPATCH_ATTR1F( index, v[0] );
+ else
+ DISPATCH_ERROR;
+}
+
+static void tnl_VertexAttrib2fNV( GLuint index, GLfloat s, GLfloat t )
+{
+ if (index < MAX_VERT_ATTRS)
+ DISPATCH_ATTR2F( index, s, t );
+ else
+ DISPATCH_ERROR;
+}
+
+static void tnl_VertexAttrib2fvNV( GLuint index, const GLfloat *v )
+{
+ if (index < MAX_VERT_ATTRS)
+ DISPATCH_ATTR2F( index, v[0], v[1] );
+ else
+ DISPATCH_ERROR;
+}
+
+static void tnl_VertexAttrib3fNV( GLuint index, GLfloat s, GLfloat t,
+ GLfloat r )
+{
+ if (index < MAX_VERT_ATTRS)
+ DISPATCH_ATTR3F( index, s, t, r );
+ else
+ DISPATCH_ERROR;
+}
+
+static void tnl_VertexAttrib3fvNV( GLuint index, const GLfloat *v )
+{
+ if (index < MAX_VERT_ATTRS)
+ DISPATCH_ATTR3F( index, v[0], v[1], v[2] );
+ else
+ DISPATCH_ERROR;
+}
+
+static void tnl_VertexAttrib4fNV( GLuint index, GLfloat s, GLfloat t,
+ GLfloat r, GLfloat q )
+{
+ if (index < MAX_VERT_ATTRS)
+ DISPATCH_ATTR4F( index, s, t, r, q );
+ else
+ DISPATCH_ERROR;
+}
+
+static void tnl_VertexAttrib4fvNV( GLuint index, const GLfloat *v )
+{
+ if (index < MAX_VERT_ATTRS)
+ DISPATCH_ATTR4F( index, v[0], v[1], v[2], v[3] );
+ else
+ DISPATCH_ERROR;
+}
+
+
+
+
+
+
+
+/* Materials:
+ *
+ * These are treated as per-vertex attributes, at indices above where
+ * the NV_vertex_program leaves off. There are a lot of good things
+ * about treating materials this way.
+ *
+ * *** Need a dispatch step (like VertexAttribute GLint attr, and MultiTexCoord)
+ * *** to expand vertex size, etc. Use the same second level dispatch
+ * *** (keyed by attr number) as above.
+ */
+#define MAT( ATTR, face, params ) \
+do { \
+ if (face != GL_BACK) \
+ DISPATCH_ATTRF( ATTR, N, params ); \
+ if (face != GL_FRONT) \
+ DISPATCH_ATTRF( ATTR+7, N, params ); \
+} while (0)
+
+
+/* NOTE: Have to remove/dealwith colormaterial crossovers, probably
+ * later on - in the meantime just store everything.
+ */
+static void _tnl_Materialfv( GLenum face, GLenum pname,
+ const GLfloat *params )
+{
+ switch (pname) {
+ case GL_EMISSION:
+ MAT( VERT_ATTRIB_FRONT_EMMISSION, 4, face, params );
+ break;
+ case GL_AMBIENT:
+ MAT( VERT_ATTRIB_FRONT_AMBIENT, 4, face, params );
+ break;
+ case GL_DIFFUSE:
+ MAT( VERT_ATTRIB_FRONT_DIFFUSE, 4, face, params );
+ break;
+ case GL_SPECULAR:
+ MAT( VERT_ATTRIB_FRONT_SPECULAR, 4, face, params );
+ break;
+ case GL_SHININESS:
+ MAT( VERT_ATTRIB_FRONT_SHININESS, 1, face, params );
+ break;
+ case GL_COLOR_INDEXES:
+ MAT( VERT_ATTRIB_FRONT_EMMISSION, 3, face, params );
+ break;
+ case GL_AMBIENT_AND_DIFFUSE:
+ MAT( VERT_ATTRIB_FRONT_AMBIENT, 4, face, params );
+ MAT( VERT_ATTRIB_FRONT_DIFFUSE, 4, face, params );
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, where );
+ return;
+ }
+}
+
+
+
+
+/* Codegen support
+ */
+static struct dynfn *lookup( struct dynfn *l, int key )
+{
+ struct dynfn *f;
+
+ foreach( f, l ) {
+ if (f->key == key)
+ return f;
+ }
+
+ return 0;
+}
+
+/* Vertex descriptor
+ */
+struct _tnl_vertex_descriptor {
+ GLuint attr_bits[4];
+};
+
+
+/* Can't use the loopback template for this:
+ */
+#define CHOOSE(FN, FNTYPE, MASK, ACTIVE, ARGS1, ARGS2 ) \
+static void choose_##FN ARGS1 \
+{ \
+ int key = tnl->vertex_format & (MASK|ACTIVE); \
+ struct dynfn *dfn = lookup( &tnl->dfn_cache.FN, key ); \
+ \
+ if (dfn == 0) \
+ dfn = tnl->codegen.FN( &vb, key ); \
+ else if (MESA_VERBOSE & DEBUG_CODEGEN) \
+ _mesa_debug(NULL, "%s -- cached codegen\n", __FUNCTION__ ); \
+ \
+ if (dfn) \
+ tnl->context->Exec->FN = (FNTYPE)(dfn->code); \
+ else { \
+ if (MESA_VERBOSE & DEBUG_CODEGEN) \
+ _mesa_debug(NULL, "%s -- generic version\n", __FUNCTION__ ); \
+ tnl->context->Exec->FN = tnl_##FN; \
+ } \
+ \
+ tnl->context->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
+ tnl->context->Exec->FN ARGS2; \
+}
+
+
+
+CHOOSE(Normal3f, p3f, 3, VERT_ATTRIB_NORMAL,
+ (GLfloat a,GLfloat b,GLfloat c), (a,b,c))
+CHOOSE(Normal3fv, pfv, 3, VERT_ATTRIB_NORMAL,
+ (const GLfloat *v), (v))
+
+CHOOSE(Color4ub, p4ub, 4, VERT_ATTRIB_COLOR0,
+ (GLubyte a,GLubyte b, GLubyte c, GLubyte d), (a,b,c,d))
+CHOOSE(Color4ubv, pubv, 4, VERT_ATTRIB_COLOR0,
+ (const GLubyte *v), (v))
+CHOOSE(Color3ub, p3ub, 3, VERT_ATTRIB_COLOR0,
+ (GLubyte a,GLubyte b, GLubyte c), (a,b,c))
+CHOOSE(Color3ubv, pubv, 3, VERT_ATTRIB_COLOR0,
+ (const GLubyte *v), (v))
+
+CHOOSE(Color4f, p4f, 4, VERT_ATTRIB_COLOR0,
+ (GLfloat a,GLfloat b, GLfloat c, GLfloat d), (a,b,c,d))
+CHOOSE(Color4fv, pfv, 4, VERT_ATTRIB_COLOR0,
+ (const GLfloat *v), (v))
+CHOOSE(Color3f, p3f, 3, VERT_ATTRIB_COLOR0,
+ (GLfloat a,GLfloat b, GLfloat c), (a,b,c))
+CHOOSE(Color3fv, pfv, 3, VERT_ATTRIB_COLOR0,
+ (const GLfloat *v), (v))
+
+
+CHOOSE(SecondaryColor3ubEXT, p3ub, VERT_ATTRIB_COLOR1,
+ (GLubyte a,GLubyte b, GLubyte c), (a,b,c))
+CHOOSE(SecondaryColor3ubvEXT, pubv, VERT_ATTRIB_COLOR1,
+ (const GLubyte *v), (v))
+CHOOSE(SecondaryColor3fEXT, p3f, VERT_ATTRIB_COLOR1,
+ (GLfloat a,GLfloat b, GLfloat c), (a,b,c))
+CHOOSE(SecondaryColor3fvEXT, pfv, VERT_ATTRIB_COLOR1,
+ (const GLfloat *v), (v))
+
+CHOOSE(TexCoord2f, p2f, VERT_ATTRIB_TEX0,
+ (GLfloat a,GLfloat b), (a,b))
+CHOOSE(TexCoord2fv, pfv, VERT_ATTRIB_TEX0,
+ (const GLfloat *v), (v))
+CHOOSE(TexCoord1f, p1f, VERT_ATTRIB_TEX0,
+ (GLfloat a), (a))
+CHOOSE(TexCoord1fv, pfv, VERT_ATTRIB_TEX0,
+ (const GLfloat *v), (v))
+
+CHOOSE(MultiTexCoord2fARB, pe2f, VERT_ATTRIB_TEX0,
+ (GLenum u,GLfloat a,GLfloat b), (u,a,b))
+CHOOSE(MultiTexCoord2fvARB, pefv, MASK_ST_ALL, ACTIVE_ST_ALL,
+ (GLenum u,const GLfloat *v), (u,v))
+CHOOSE(MultiTexCoord1fARB, pe1f, MASK_ST_ALL, ACTIVE_ST_ALL,
+ (GLenum u,GLfloat a), (u,a))
+CHOOSE(MultiTexCoord1fvARB, pefv, MASK_ST_ALL, ACTIVE_ST_ALL,
+ (GLenum u,const GLfloat *v), (u,v))
+
+CHOOSE(Vertex3f, p3f, VERT_ATTRIB_POS,
+ (GLfloat a,GLfloat b,GLfloat c), (a,b,c))
+CHOOSE(Vertex3fv, pfv, VERT_ATTRIB_POS,
+ (const GLfloat *v), (v))
+CHOOSE(Vertex2f, p2f, VERT_ATTRIB_POS,
+ (GLfloat a,GLfloat b), (a,b))
+CHOOSE(Vertex2fv, pfv, VERT_ATTRIB_POS,
+ (const GLfloat *v), (v))
+
+
+
+
+
+void _tnl_InitVtxfmtChoosers( GLvertexformat *vfmt )
+{
+ vfmt->Color3f = choose_Color3f;
+ vfmt->Color3fv = choose_Color3fv;
+ vfmt->Color3ub = choose_Color3ub;
+ vfmt->Color3ubv = choose_Color3ubv;
+ vfmt->Color4f = choose_Color4f;
+ vfmt->Color4fv = choose_Color4fv;
+ vfmt->Color4ub = choose_Color4ub;
+ vfmt->Color4ubv = choose_Color4ubv;
+ vfmt->SecondaryColor3fEXT = choose_SecondaryColor3fEXT;
+ vfmt->SecondaryColor3fvEXT = choose_SecondaryColor3fvEXT;
+ vfmt->SecondaryColor3ubEXT = choose_SecondaryColor3ubEXT;
+ vfmt->SecondaryColor3ubvEXT = choose_SecondaryColor3ubvEXT;
+ vfmt->MultiTexCoord1fARB = dd_MultiTexCoord1fARB;
+ vfmt->MultiTexCoord1fvARB = dd_MultiTexCoord1fvARB;
+ vfmt->MultiTexCoord2fARB = dd_MultiTexCoord2fARB;
+ vfmt->MultiTexCoord2fvARB = dd_MultiTexCoord2fvARB;
+ vfmt->MultiTexCoord3fARB = dd_MultiTexCoord3fARB;
+ vfmt->MultiTexCoord3fvARB = dd_MultiTexCoord3fvARB;
+ vfmt->MultiTexCoord4fARB = dd_MultiTexCoord4fARB;
+ vfmt->MultiTexCoord4fvARB = dd_MultiTexCoord4fvARB;
+ vfmt->Normal3f = choose_Normal3f;
+ vfmt->Normal3fv = choose_Normal3fv;
+ vfmt->TexCoord1f = choose_TexCoord1f;
+ vfmt->TexCoord1fv = choose_TexCoord1fv;
+ vfmt->TexCoord2f = choose_TexCoord2f;
+ vfmt->TexCoord2fv = choose_TexCoord2fv;
+ vfmt->TexCoord3f = choose_TexCoord3f;
+ vfmt->TexCoord3fv = choose_TexCoord3fv;
+ vfmt->TexCoord4f = choose_TexCoord4f;
+ vfmt->TexCoord4fv = choose_TexCoord4fv;
+ vfmt->Vertex2f = choose_Vertex2f;
+ vfmt->Vertex2fv = choose_Vertex2fv;
+ vfmt->Vertex3f = choose_Vertex3f;
+ vfmt->Vertex3fv = choose_Vertex3fv;
+ vfmt->Vertex4f = choose_Vertex4f;
+ vfmt->Vertex4fv = choose_Vertex4fv;
+ vfmt->FogCoordfvEXT = choose_FogCoordfvEXT;
+ vfmt->FogCoordfEXT = choose_FogCoordfEXT;
+ vfmt->EdgeFlag = choose_EdgeFlag;
+ vfmt->EdgeFlagv = choose_EdgeFlagv;
+ vfmt->Indexi = choose_Indexi;
+ vfmt->Indexiv = choose_Indexiv;
+ vfmt->EvalCoord1f = choose_EvalCoord1f;
+ vfmt->EvalCoord1fv = choose_EvalCoord1fv;
+ vfmt->EvalCoord2f = choose_EvalCoord2f;
+ vfmt->EvalCoord2fv = choose_EvalCoord2fv;
+ vfmt->Materialfv = dd_Materialfv;
+}
+
+
+static struct dynfn *codegen_noop( struct _vb *vb, int key )
+{
+ (void) vb; (void) key;
+ return 0;
+}
+
+void _tnl_InitCodegen( struct dfn_generators *gen )
+{
+ /* Generate an attribute or vertex command.
+ */
+ gen->Attr1f = codegen_noop;
+ gen->Attr1fv = codegen_noop;
+ gen->Attr2f = codegen_noop;
+ gen->Attr2fv = codegen_noop;
+ gen->Attr3f = codegen_noop;
+ gen->Attr3fv = codegen_noop;
+ gen->Attr4f = codegen_noop;
+ gen->Attr4fv = codegen_noop;
+
+ /* Index is never zero for these...
+ */
+ gen->Attr3ub = codegen_noop;
+ gen->Attr3ubv = codegen_noop;
+ gen->Attr4ub = codegen_noop;
+ gen->Attr4ubv = codegen_noop;
+
+ /* As above, but deal with the extra (redundant by now) index
+ * argument to the generated function.
+ */
+ gen->NVAttr1f = codegen_noop;
+ gen->NVAttr1fv = codegen_noop;
+ gen->NVAttr2f = codegen_noop;
+ gen->NVAttr2fv = codegen_noop;
+ gen->NVAttr3f = codegen_noop;
+ gen->NVAttr3fv = codegen_noop;
+ gen->NVAttr4f = codegen_noop;
+ gen->NVAttr4fv = codegen_noop;
+
+
+ if (!getenv("MESA_NO_CODEGEN")) {
+#if defined(USE_X86_ASM)
+ _tnl_InitX86Codegen( gen );
+#endif
+
+#if defined(USE_SSE_ASM)
+ _tnl_InitSSECodegen( gen );
+#endif
+
+#if defined(USE_3DNOW_ASM)
+#endif
+
+#if defined(USE_SPARC_ASM)
+#endif
+ }
+}
diff --git a/xc/extras/Mesa/src/tnl/t_vtx_api.h b/xc/extras/Mesa/src/tnl/t_vtx_api.h
new file mode 100644
index 000000000..6bfdbe8fe
--- /dev/null
+++ b/xc/extras/Mesa/src/tnl/t_vtx_api.h
@@ -0,0 +1,234 @@
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ *
+ */
+
+#ifndef __RADEON_VTXFMT_H__
+#define __RADEON_VTXFMT_H__
+
+#ifdef GLX_DIRECT_RENDERING
+
+#include "_tnl__context.h"
+
+extern void _tnl_UpdateVtxfmt( GLcontext *ctx );
+extern void _tnl_InitVtxfmt( GLcontext *ctx );
+extern void _tnl_InvalidateVtxfmt( GLcontext *ctx );
+extern void _tnl_DestroyVtxfmt( GLcontext *ctx );
+
+typedef void (*p4f)( GLfloat, GLfloat, GLfloat, GLfloat );
+typedef void (*p3f)( GLfloat, GLfloat, GLfloat );
+typedef void (*p2f)( GLfloat, GLfloat );
+typedef void (*p1f)( GLfloat );
+typedef void (*pe2f)( GLenum, GLfloat, GLfloat );
+typedef void (*pe1f)( GLenum, GLfloat );
+typedef void (*p4ub)( GLubyte, GLubyte, GLubyte, GLubyte );
+typedef void (*p3ub)( GLubyte, GLubyte, GLubyte );
+typedef void (*pfv)( const GLfloat * );
+typedef void (*pefv)( GLenum, const GLfloat * );
+typedef void (*pubv)( const GLubyte * );
+
+/* Want to keep a cache of these around. Each is parameterized by
+ * only a single value which has only a small range. Only expect a
+ * few, so just rescan the list each time?
+ */
+struct dynfn {
+ struct dynfn *next, *prev;
+ int key;
+ char *code;
+};
+
+struct dfn_lists {
+ struct dynfn Vertex2f;
+ struct dynfn Vertex2fv;
+ struct dynfn Vertex3f;
+ struct dynfn Vertex3fv;
+ struct dynfn Color4ub;
+ struct dynfn Color4ubv;
+ struct dynfn Color3ub;
+ struct dynfn Color3ubv;
+ struct dynfn Color4f;
+ struct dynfn Color4fv;
+ struct dynfn Color3f;
+ struct dynfn Color3fv;
+ struct dynfn SecondaryColor3ubEXT;
+ struct dynfn SecondaryColor3ubvEXT;
+ struct dynfn SecondaryColor3fEXT;
+ struct dynfn SecondaryColor3fvEXT;
+ struct dynfn Normal3f;
+ struct dynfn Normal3fv;
+ struct dynfn TexCoord2f;
+ struct dynfn TexCoord2fv;
+ struct dynfn TexCoord1f;
+ struct dynfn TexCoord1fv;
+ struct dynfn MultiTexCoord2fARB;
+ struct dynfn MultiTexCoord2fvARB;
+ struct dynfn MultiTexCoord1fARB;
+ struct dynfn MultiTexCoord1fvARB;
+};
+
+struct _vb;
+
+struct dfn_generators {
+ struct dynfn *(*Vertex2f)( struct _vb *, int );
+ struct dynfn *(*Vertex2fv)( struct _vb *, int );
+ struct dynfn *(*Vertex3f)( struct _vb *, int );
+ struct dynfn *(*Vertex3fv)( struct _vb *, int );
+ struct dynfn *(*Color4ub)( struct _vb *, int );
+ struct dynfn *(*Color4ubv)( struct _vb *, int );
+ struct dynfn *(*Color3ub)( struct _vb *, int );
+ struct dynfn *(*Color3ubv)( struct _vb *, int );
+ struct dynfn *(*Color4f)( struct _vb *, int );
+ struct dynfn *(*Color4fv)( struct _vb *, int );
+ struct dynfn *(*Color3f)( struct _vb *, int );
+ struct dynfn *(*Color3fv)( struct _vb *, int );
+ struct dynfn *(*SecondaryColor3ubEXT)( struct _vb *, int );
+ struct dynfn *(*SecondaryColor3ubvEXT)( struct _vb *, int );
+ struct dynfn *(*SecondaryColor3fEXT)( struct _vb *, int );
+ struct dynfn *(*SecondaryColor3fvEXT)( struct _vb *, int );
+ struct dynfn *(*Normal3f)( struct _vb *, int );
+ struct dynfn *(*Normal3fv)( struct _vb *, int );
+ struct dynfn *(*TexCoord2f)( struct _vb *, int );
+ struct dynfn *(*TexCoord2fv)( struct _vb *, int );
+ struct dynfn *(*TexCoord1f)( struct _vb *, int );
+ struct dynfn *(*TexCoord1fv)( struct _vb *, int );
+ struct dynfn *(*MultiTexCoord2fARB)( struct _vb *, int );
+ struct dynfn *(*MultiTexCoord2fvARB)( struct _vb *, int );
+ struct dynfn *(*MultiTexCoord1fARB)( struct _vb *, int );
+ struct dynfn *(*MultiTexCoord1fvARB)( struct _vb *, int );
+};
+
+struct prim {
+ GLuint start;
+ GLuint end;
+ GLuint prim;
+};
+
+#define _TNL__MAX_PRIMS 64
+
+
+
+struct tnl_vbinfo {
+ /* Keep these first: referenced from codegen templates:
+ */
+ GLint counter;
+ GLint *dmaptr;
+ void (*notify)( void );
+ union { float f; int i; GLubyte ub4[4]; } vertex[16*4];
+
+ GLfloat *attrptr[16];
+ GLuint size[16];
+
+ GLenum *prim; /* &ctx->Driver.CurrentExecPrimitive */
+ GLuint primflags;
+
+ GLboolean installed;
+ GLboolean recheck;
+
+ GLint vertex_size;
+ GLint initial_counter;
+ GLint nrverts;
+ GLuint vertex_format;
+
+ GLuint installed_vertex_format;
+
+ struct prim primlist[RADEON_MAX_PRIMS];
+ int nrprims;
+
+ struct dfn_lists dfn_cache;
+ struct dfn_generators codegen;
+ GLvertexformat vtxfmt;
+};
+
+
+extern void _tnl_InitVtxfmtChoosers( GLvertexformat *vfmt );
+
+
+#define FIXUP( CODE, OFFSET, CHECKVAL, NEWVAL ) \
+do { \
+ int *icode = (int *)(CODE+OFFSET); \
+ assert (*icode == CHECKVAL); \
+ *icode = (int)NEWVAL; \
+} while (0)
+
+
+/* Useful for figuring out the offsets:
+ */
+#define FIXUP2( CODE, OFFSET, CHECKVAL, NEWVAL ) \
+do { \
+ while (*(int *)(CODE+OFFSET) != CHECKVAL) OFFSET++; \
+ fprintf(stderr, "%s/%d CVAL %x OFFSET %d\n", __FUNCTION__, \
+ __LINE__, CHECKVAL, OFFSET); \
+ *(int *)(CODE+OFFSET) = (int)NEWVAL; \
+ OFFSET += 4; \
+} while (0)
+
+/*
+ */
+void _tnl_InitCodegen( struct dfn_generators *gen );
+void _tnl_InitX86Codegen( struct dfn_generators *gen );
+void _tnl_InitSSECodegen( struct dfn_generators *gen );
+
+void _tnl_copy_to_current( GLcontext *ctx );
+
+
+/* Defined in tnl_vtxfmt_c.c.
+ */
+struct dynfn *tnl_makeX86Vertex2f( TNLcontext *, int );
+struct dynfn *tnl_makeX86Vertex2fv( TNLcontext *, int );
+struct dynfn *tnl_makeX86Vertex3f( TNLcontext *, int );
+struct dynfn *tnl_makeX86Vertex3fv( TNLcontext *, int );
+struct dynfn *tnl_makeX86Color4ub( TNLcontext *, int );
+struct dynfn *tnl_makeX86Color4ubv( TNLcontext *, int );
+struct dynfn *tnl_makeX86Color3ub( TNLcontext *, int );
+struct dynfn *tnl_makeX86Color3ubv( TNLcontext *, int );
+struct dynfn *tnl_makeX86Color4f( TNLcontext *, int );
+struct dynfn *tnl_makeX86Color4fv( TNLcontext *, int );
+struct dynfn *tnl_makeX86Color3f( TNLcontext *, int );
+struct dynfn *tnl_makeX86Color3fv( TNLcontext *, int );
+struct dynfn *tnl_makeX86SecondaryColor3ubEXT( TNLcontext *, int );
+struct dynfn *tnl_makeX86SecondaryColor3ubvEXT( TNLcontext *, int );
+struct dynfn *tnl_makeX86SecondaryColor3fEXT( TNLcontext *, int );
+struct dynfn *tnl_makeX86SecondaryColor3fvEXT( TNLcontext *, int );
+struct dynfn *tnl_makeX86Normal3f( TNLcontext *, int );
+struct dynfn *tnl_makeX86Normal3fv( TNLcontext *, int );
+struct dynfn *tnl_makeX86TexCoord2f( TNLcontext *, int );
+struct dynfn *tnl_makeX86TexCoord2fv( TNLcontext *, int );
+struct dynfn *tnl_makeX86TexCoord1f( TNLcontext *, int );
+struct dynfn *tnl_makeX86TexCoord1fv( TNLcontext *, int );
+struct dynfn *tnl_makeX86MultiTexCoord2fARB( TNLcontext *, int );
+struct dynfn *tnl_makeX86MultiTexCoord2fvARB( TNLcontext *, int );
+struct dynfn *tnl_makeX86MultiTexCoord1fARB( TNLcontext *, int );
+struct dynfn *tnl_makeX86MultiTexCoord1fvARB( TNLcontext *, int );
+
+
+#endif
+#endif
diff --git a/xc/extras/Mesa/src/tnl/t_vtx_exec.c b/xc/extras/Mesa/src/tnl/t_vtx_exec.c
new file mode 100644
index 000000000..7e9db7892
--- /dev/null
+++ b/xc/extras/Mesa/src/tnl/t_vtx_exec.c
@@ -0,0 +1,632 @@
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ *
+ */
+#include "api_noop.h"
+#include "api_arrayelt.h"
+#include "context.h"
+#include "imports.h"
+#include "mmath.h"
+#include "mtypes.h"
+#include "enums.h"
+#include "glapi.h"
+#include "colormac.h"
+#include "light.h"
+#include "state.h"
+#include "vtxfmt.h"
+
+#include "tnl/tnl.h"
+#include "tnl/t_context.h"
+#include "tnl/t_array_api.h"
+
+static void _tnl_FlushVertices( GLcontext *, GLuint );
+
+
+void tnl_copy_to_current( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint flag = tnl->vertex_format;
+ GLint i;
+
+ assert(ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT);
+
+ for (i = 0 ; i < 16 ; i++)
+ if (flag & (1<<i))
+ COPY_4FV( ctx->Current.Attrib[i], tnl->attribptr[i] );
+
+ if (flag & VERT_BIT_INDEX)
+ ctx->Current.Index = tnl->indexptr[0];
+
+ if (flag & VERT_BIT_EDGEFLAG)
+ ctx->Current.EdgeFlag = tnl->edgeflagptr[0];
+
+ if (flag & VERT_BIT_MATERIAL) {
+ _mesa_update_material( ctx,
+ IM->Material[IM->LastMaterial],
+ IM->MaterialOrMask );
+
+ tnl->Driver.NotifyMaterialChange( ctx );
+ }
+
+
+ ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT;
+}
+
+static GLboolean discreet_gl_prim[GL_POLYGON+1] = {
+ 1, /* 0 points */
+ 1, /* 1 lines */
+ 0, /* 2 line_strip */
+ 0, /* 3 line_loop */
+ 1, /* 4 tris */
+ 0, /* 5 tri_fan */
+ 0, /* 6 tri_strip */
+ 1, /* 7 quads */
+ 0, /* 8 quadstrip */
+ 0, /* 9 poly */
+};
+
+/* Optimize the primitive list: ONLY FOR EXECUTE ATM
+ */
+static void optimize_prims( TNLcontext *tnl )
+{
+ int i, j;
+
+ if (tnl->nrprims <= 1)
+ return;
+
+ for (j = 0, i = 1 ; i < tnl->nrprims; i++) {
+ int pj = tnl->primlist[j].prim & 0xf;
+ int pi = tnl->primlist[i].prim & 0xf;
+
+ if (pj == pi && discreet_gl_prim[pj] &&
+ tnl->primlist[i].start == tnl->primlist[j].end) {
+ tnl->primlist[j].end = tnl->primlist[i].end;
+ }
+ else {
+ j++;
+ if (j != i) tnl->primlist[j] = tnl->primlist[i];
+ }
+ }
+
+ tnl->nrprims = j+1;
+}
+
+
+/* Bind vertex buffer pointers, run pipeline:
+ */
+static void flush_prims( TNLcontext *tnl )
+{
+ int i,j;
+
+ tnl->dma.current.ptr = tnl->dma.current.start +=
+ (tnl->initial_counter - tnl->counter) * tnl->vertex_size * 4;
+
+ tnl->tcl.vertex_format = tnl->vertex_format;
+ tnl->tcl.aos_components[0] = &tmp;
+ tnl->tcl.nr_aos_components = 1;
+ tnl->dma.flush = 0;
+
+ tnl->Driver.RunPipeline( ... );
+
+ tnl->nrprims = 0;
+}
+
+
+static void start_prim( TNLcontext *tnl, GLuint mode )
+{
+ if (MESA_VERBOSE & DEBUG_VFMT)
+ _mesa_debug(NULL, "%s %d\n", __FUNCTION__,
+ tnl->initial_counter - tnl->counter);
+
+ tnl->primlist[tnl->nrprims].start = tnl->initial_counter - tnl->counter;
+ tnl->primlist[tnl->nrprims].prim = mode;
+}
+
+static void note_last_prim( TNLcontext *tnl, GLuint flags )
+{
+ if (MESA_VERBOSE & DEBUG_VFMT)
+ _mesa_debug(NULL, "%s %d\n", __FUNCTION__,
+ tnl->initial_counter - tnl->counter);
+
+ if (tnl->prim[0] != GL_POLYGON+1) {
+ tnl->primlist[tnl->nrprims].prim |= flags;
+ tnl->primlist[tnl->nrprims].end = tnl->initial_counter - tnl->counter;
+
+ if (++tnl->nrprims == TNL_MAX_PRIMS)
+ flush_prims( tnl );
+ }
+}
+
+
+static void copy_vertex( TNLcontext *tnl, GLuint n, GLfloat *dst )
+{
+ GLuint i;
+ GLfloat *src = (GLfloat *)(tnl->dma.current.address +
+ tnl->dma.current.ptr +
+ (tnl->primlist[tnl->nrprims].start + n) *
+ tnl->vertex_size * 4);
+
+ if (MESA_VERBOSE & DEBUG_VFMT)
+ _mesa_debug(NULL, "copy_vertex %d\n",
+ tnl->primlist[tnl->nrprims].start + n);
+
+ for (i = 0 ; i < tnl->vertex_size; i++) {
+ dst[i] = src[i];
+ }
+}
+
+static GLuint copy_wrapped_verts( TNLcontext *tnl, GLfloat (*tmp)[15] )
+{
+ GLuint ovf, i;
+ GLuint nr = (tnl->initial_counter - tnl->counter) - tnl->primlist[tnl->nrprims].start;
+
+ if (MESA_VERBOSE & DEBUG_VFMT)
+ _mesa_debug(NULL, "%s %d verts\n", __FUNCTION__, nr);
+
+ switch( tnl->prim[0] )
+ {
+ case GL_POINTS:
+ return 0;
+ case GL_LINES:
+ ovf = nr&1;
+ for (i = 0 ; i < ovf ; i++)
+ copy_vertex( tnl, nr-ovf+i, tmp[i] );
+ return i;
+ case GL_TRIANGLES:
+ ovf = nr%3;
+ for (i = 0 ; i < ovf ; i++)
+ copy_vertex( tnl, nr-ovf+i, tmp[i] );
+ return i;
+ case GL_QUADS:
+ ovf = nr&3;
+ for (i = 0 ; i < ovf ; i++)
+ copy_vertex( tnl, nr-ovf+i, tmp[i] );
+ return i;
+ case GL_LINE_STRIP:
+ if (nr == 0)
+ return 0;
+ copy_vertex( tnl, nr-1, tmp[0] );
+ return 1;
+ case GL_LINE_LOOP:
+ case GL_TRIANGLE_FAN:
+ case GL_POLYGON:
+ if (nr == 0)
+ return 0;
+ else if (nr == 1) {
+ copy_vertex( tnl, 0, tmp[0] );
+ return 1;
+ } else {
+ copy_vertex( tnl, 0, tmp[0] );
+ copy_vertex( tnl, nr-1, tmp[1] );
+ return 2;
+ }
+ case GL_TRIANGLE_STRIP:
+ ovf = MIN2( nr-1, 2 );
+ for (i = 0 ; i < ovf ; i++)
+ copy_vertex( tnl, nr-ovf+i, tmp[i] );
+ return i;
+ case GL_QUAD_STRIP:
+ ovf = MIN2( nr-1, 2 );
+ if (nr > 2) ovf += nr&1;
+ for (i = 0 ; i < ovf ; i++)
+ copy_vertex( tnl, nr-ovf+i, tmp[i] );
+ return i;
+ default:
+ assert(0);
+ return 0;
+ }
+}
+
+
+
+/* Extend for vertex-format changes on wrap:
+ */
+static void wrap_buffer( void )
+{
+ TNLcontext *tnl = tnl->tnl;
+ GLfloat tmp[3][15];
+ GLuint i, nrverts;
+
+ if (MESA_VERBOSE & (DEBUG_VFMT|DEBUG_PRIMS))
+ _mesa_debug(NULL, "%s %d\n", __FUNCTION__,
+ tnl->initial_counter - tnl->counter);
+
+ /* Don't deal with parity. *** WONT WORK FOR COMPILE
+ */
+ if ((((tnl->initial_counter - tnl->counter) -
+ tnl->primlist[tnl->nrprims].start) & 1)) {
+ tnl->counter++;
+ tnl->initial_counter++;
+ return;
+ }
+
+ /* Copy vertices out of dma:
+ */
+ nrverts = copy_dma_verts( tnl, tmp );
+
+ if (MESA_VERBOSE & DEBUG_VFMT)
+ _mesa_debug(NULL, "%d vertices to copy\n", nrverts);
+
+
+ /* Finish the prim at this point:
+ */
+ note_last_prim( tnl, 0 );
+ flush_prims( tnl );
+
+ /* Reset counter, dmaptr
+ */
+ tnl->dmaptr = (int *)(tnl->dma.current.ptr + tnl->dma.current.address);
+ tnl->counter = (tnl->dma.current.end - tnl->dma.current.ptr) /
+ (tnl->vertex_size * 4);
+ tnl->counter--;
+ tnl->initial_counter = tnl->counter;
+ tnl->notify = wrap_buffer;
+
+ tnl->dma.flush = flush_prims;
+ start_prim( tnl, tnl->prim[0] );
+
+
+ /* Reemit saved vertices
+ * *** POSSIBLY IN NEW FORMAT
+ * --> Can't always extend at end of vertex?
+ */
+ for (i = 0 ; i < nrverts; i++) {
+ if (MESA_VERBOSE & DEBUG_VERTS) {
+ int j;
+ _mesa_debug(NULL, "re-emit vertex %d to %p\n", i, tnl->dmaptr);
+ if (MESA_VERBOSE & DEBUG_VERBOSE)
+ for (j = 0 ; j < tnl->vertex_size; j++)
+ _mesa_debug(NULL, "\t%08x/%f\n", *(int*)&tmp[i][j], tmp[i][j]);
+ }
+
+ memcpy( tnl->dmaptr, tmp[i], tnl->vertex_size * 4 );
+ tnl->dmaptr += tnl->vertex_size;
+ tnl->counter--;
+ }
+}
+
+
+
+/* Always follow data, don't try to predict what's necessary.
+ */
+static GLboolean check_vtx_fmt( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT)
+ ctx->Driver.FlushVertices( ctx, FLUSH_UPDATE_CURRENT );
+
+
+ TNL_NEWPRIM(tnl);
+ tnl->vertex_format = VERT_BIT_POS;
+ tnl->prim = &ctx->Driver.CurrentExecPrimitive;
+
+
+ /* Currently allow the full 4 components per attrib. Can use the
+ * mechanism from radeon driver color handling to reduce this (and
+ * also to store ubyte colors where these are incoming). This
+ * won't work for compile mode.
+ *
+ * Only adding components when they are first received eliminates
+ * the need for displaylist fixup, as there are no 'empty' slots
+ * at the start of buffers.
+ */
+ for (i = 0 ; i < 16 ; i++) {
+ if (ind & (1<<i)) {
+ tnl->attribptr[i] = &tnl->vertex[tnl->vertex_size].f;
+ tnl->vertex_size += 4;
+ tnl->attribptr[i][0] = ctx->Current.Attrib[i][0];
+ tnl->attribptr[i][1] = ctx->Current.Attrib[i][1];
+ tnl->attribptr[i][2] = ctx->Current.Attrib[i][2];
+ tnl->attribptr[i][3] = ctx->Current.Attrib[i][3];
+ }
+ else
+ tnl->attribptr[i] = ctx->Current.Attrib[i];
+ }
+
+ /* Edgeflag, Index:
+ */
+ for (i = 16 ; i < 18 ; i++)
+ ;
+
+ /* Materials:
+ */
+ for (i = 18 ; i < 28 ; i++)
+ ;
+
+ /* Eval:
+ */
+ for (i = 28 ; i < 29 ; i++)
+ ;
+
+
+ if (tnl->installed_vertex_format != tnl->vertex_format) {
+ if (MESA_VERBOSE & DEBUG_VFMT)
+ _mesa_debug(NULL, "reinstall on vertex_format change\n");
+ _mesa_install_exec_vtxfmt( ctx, &tnl->vtxfmt );
+ tnl->installed_vertex_format = tnl->vertex_format;
+ }
+
+ return GL_TRUE;
+}
+
+
+void _tnl_InvalidateVtxfmt( GLcontext *ctx )
+{
+ tnl->recheck = GL_TRUE;
+ tnl->fell_back = GL_FALSE;
+}
+
+
+
+
+static void _tnl_ValidateVtxfmt( GLcontext *ctx )
+{
+ if (MESA_VERBOSE & DEBUG_VFMT)
+ _mesa_debug(NULL, "%s\n", __FUNCTION__);
+
+ if (ctx->Driver.NeedFlush)
+ ctx->Driver.FlushVertices( ctx, ctx->Driver.NeedFlush );
+
+ tnl->recheck = GL_FALSE;
+
+ if (check_vtx_fmt( ctx )) {
+ if (!tnl->installed) {
+ if (MESA_VERBOSE & DEBUG_VFMT)
+ _mesa_debug(NULL, "reinstall (new install)\n");
+
+ _mesa_install_exec_vtxfmt( ctx, &tnl->vtxfmt );
+ ctx->Driver.FlushVertices = _tnl_FlushVertices;
+ tnl->installed = GL_TRUE;
+ }
+ else
+ _mesa_debug(NULL, "%s: already installed", __FUNCTION__);
+ }
+ else {
+ if (MESA_VERBOSE & DEBUG_VFMT)
+ _mesa_debug(NULL, "%s: failed\n", __FUNCTION__);
+
+ if (tnl->installed) {
+ if (tnl->tnl->dma.flush)
+ tnl->tnl->dma.flush( tnl->tnl );
+ _tnl_wakeup_exec( ctx );
+ tnl->installed = GL_FALSE;
+ }
+ }
+}
+
+
+
+
+
+/* Begin/End
+ */
+static void _tnl_Begin( GLenum mode )
+{
+ GLcontext *ctx = tnl->context;
+ TNLcontext *tnl = tnl->tnl;
+
+ if (MESA_VERBOSE & DEBUG_VFMT)
+ _mesa_debug(NULL, "%s\n", __FUNCTION__);
+
+ if (mode > GL_POLYGON) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glBegin" );
+ return;
+ }
+
+ if (tnl->prim[0] != GL_POLYGON+1) {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glBegin" );
+ return;
+ }
+
+ if (ctx->NewState)
+ _mesa_update_state( ctx );
+
+ if (tnl->recheck)
+ _tnl_ValidateVtxfmt( ctx );
+
+ if (tnl->dma.flush && tnl->counter < 12) {
+ if (MESA_VERBOSE & DEBUG_VFMT)
+ _mesa_debug(NULL, "%s: flush almost-empty buffers\n", __FUNCTION__);
+ flush_prims( tnl );
+ }
+
+ if (!tnl->dma.flush) {
+ if (tnl->dma.current.ptr + 12*tnl->vertex_size*4 >
+ tnl->dma.current.end) {
+ TNL_NEWPRIM( tnl );
+ _tnl_RefillCurrentDmaRegion( tnl );
+ }
+
+ tnl->dmaptr = (int *)(tnl->dma.current.address + tnl->dma.current.ptr);
+ tnl->counter = (tnl->dma.current.end - tnl->dma.current.ptr) /
+ (tnl->vertex_size * 4);
+ tnl->counter--;
+ tnl->initial_counter = tnl->counter;
+ tnl->notify = wrap_buffer;
+ tnl->dma.flush = flush_prims;
+ tnl->context->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
+ }
+
+
+ tnl->prim[0] = mode;
+ start_prim( tnl, mode | PRIM_BEGIN );
+}
+
+
+
+
+
+static void _tnl_End( void )
+{
+ TNLcontext *tnl = tnl->tnl;
+ GLcontext *ctx = tnl->context;
+
+ if (MESA_VERBOSE & DEBUG_VFMT)
+ _mesa_debug(NULL, "%s\n", __FUNCTION__);
+
+ if (tnl->prim[0] == GL_POLYGON+1) {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" );
+ return;
+ }
+
+ note_last_prim( tnl, PRIM_END );
+ tnl->prim[0] = GL_POLYGON+1;
+}
+
+
+static void _tnl_FlushVertices( GLcontext *ctx, GLuint flags )
+{
+ if (MESA_VERBOSE & DEBUG_VFMT)
+ _mesa_debug(NULL, "%s\n", __FUNCTION__);
+
+ assert(tnl->installed);
+
+ if (flags & FLUSH_UPDATE_CURRENT) {
+ _tnl_copy_to_current( ctx );
+ if (MESA_VERBOSE & DEBUG_VFMT)
+ _mesa_debug(NULL, "reinstall on update_current\n");
+ _mesa_install_exec_vtxfmt( ctx, &tnl->vtxfmt );
+ ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT;
+ }
+
+ if (flags & FLUSH_STORED_VERTICES) {
+ TNLcontext *tnl = TNL_CONTEXT( ctx );
+ assert (tnl->dma.flush == 0 ||
+ tnl->dma.flush == flush_prims);
+ if (tnl->dma.flush == flush_prims)
+ flush_prims( TNL_CONTEXT( ctx ) );
+ ctx->Driver.NeedFlush &= ~FLUSH_STORED_VERTICES;
+ }
+}
+
+
+
+/* At this point, don't expect very many versions of each function to
+ * be generated, so not concerned about freeing them?
+ */
+
+
+static void _tnl_InitVtxfmt( GLcontext *ctx )
+{
+ GLvertexformat *vfmt = &(tnl->vtxfmt);
+
+ MEMSET( vfmt, 0, sizeof(GLvertexformat) );
+
+ /* Hook in chooser functions for codegen, etc:
+ */
+ _tnl_InitVtxfmtChoosers( vfmt );
+
+ /* Handled fully in supported states, but no codegen:
+ */
+ vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */
+ vfmt->Rectf = _mesa_noop_Rectf; /* generic helper */
+ vfmt->Begin = _tnl_Begin;
+ vfmt->End = _tnl_End;
+
+ tnl->context = ctx;
+ tnl->tnl = TNL_CONTEXT(ctx);
+ tnl->prim = &ctx->Driver.CurrentExecPrimitive;
+ tnl->primflags = 0;
+
+ make_empty_list( &tnl->dfn_cache.Vertex2f );
+ make_empty_list( &tnl->dfn_cache.Vertex2fv );
+ make_empty_list( &tnl->dfn_cache.Vertex3f );
+ make_empty_list( &tnl->dfn_cache.Vertex3fv );
+ make_empty_list( &tnl->dfn_cache.Color4ub );
+ make_empty_list( &tnl->dfn_cache.Color4ubv );
+ make_empty_list( &tnl->dfn_cache.Color3ub );
+ make_empty_list( &tnl->dfn_cache.Color3ubv );
+ make_empty_list( &tnl->dfn_cache.Color4f );
+ make_empty_list( &tnl->dfn_cache.Color4fv );
+ make_empty_list( &tnl->dfn_cache.Color3f );
+ make_empty_list( &tnl->dfn_cache.Color3fv );
+ make_empty_list( &tnl->dfn_cache.SecondaryColor3fEXT );
+ make_empty_list( &tnl->dfn_cache.SecondaryColor3fvEXT );
+ make_empty_list( &tnl->dfn_cache.SecondaryColor3ubEXT );
+ make_empty_list( &tnl->dfn_cache.SecondaryColor3ubvEXT );
+ make_empty_list( &tnl->dfn_cache.Normal3f );
+ make_empty_list( &tnl->dfn_cache.Normal3fv );
+ make_empty_list( &tnl->dfn_cache.TexCoord2f );
+ make_empty_list( &tnl->dfn_cache.TexCoord2fv );
+ make_empty_list( &tnl->dfn_cache.TexCoord1f );
+ make_empty_list( &tnl->dfn_cache.TexCoord1fv );
+ make_empty_list( &tnl->dfn_cache.MultiTexCoord2fARB );
+ make_empty_list( &tnl->dfn_cache.MultiTexCoord2fvARB );
+ make_empty_list( &tnl->dfn_cache.MultiTexCoord1fARB );
+ make_empty_list( &tnl->dfn_cache.MultiTexCoord1fvARB );
+
+ _tnl_InitCodegen( &tnl->codegen );
+}
+
+static void free_funcs( struct dynfn *l )
+{
+ struct dynfn *f, *tmp;
+ foreach_s (f, tmp, l) {
+ remove_from_list( f );
+ ALIGN_FREE( f->code );
+ FREE( f );
+ }
+}
+
+
+static void _tnl_DestroyVtxfmt( GLcontext *ctx )
+{
+ count_funcs();
+ free_funcs( &tnl->dfn_cache.Vertex2f );
+ free_funcs( &tnl->dfn_cache.Vertex2fv );
+ free_funcs( &tnl->dfn_cache.Vertex3f );
+ free_funcs( &tnl->dfn_cache.Vertex3fv );
+ free_funcs( &tnl->dfn_cache.Color4ub );
+ free_funcs( &tnl->dfn_cache.Color4ubv );
+ free_funcs( &tnl->dfn_cache.Color3ub );
+ free_funcs( &tnl->dfn_cache.Color3ubv );
+ free_funcs( &tnl->dfn_cache.Color4f );
+ free_funcs( &tnl->dfn_cache.Color4fv );
+ free_funcs( &tnl->dfn_cache.Color3f );
+ free_funcs( &tnl->dfn_cache.Color3fv );
+ free_funcs( &tnl->dfn_cache.SecondaryColor3ubEXT );
+ free_funcs( &tnl->dfn_cache.SecondaryColor3ubvEXT );
+ free_funcs( &tnl->dfn_cache.SecondaryColor3fEXT );
+ free_funcs( &tnl->dfn_cache.SecondaryColor3fvEXT );
+ free_funcs( &tnl->dfn_cache.Normal3f );
+ free_funcs( &tnl->dfn_cache.Normal3fv );
+ free_funcs( &tnl->dfn_cache.TexCoord2f );
+ free_funcs( &tnl->dfn_cache.TexCoord2fv );
+ free_funcs( &tnl->dfn_cache.TexCoord1f );
+ free_funcs( &tnl->dfn_cache.TexCoord1fv );
+ free_funcs( &tnl->dfn_cache.MultiTexCoord2fARB );
+ free_funcs( &tnl->dfn_cache.MultiTexCoord2fvARB );
+ free_funcs( &tnl->dfn_cache.MultiTexCoord1fARB );
+ free_funcs( &tnl->dfn_cache.MultiTexCoord1fvARB );
+}
+
diff --git a/xc/extras/Mesa/src/tnl/t_vtx_sse.c b/xc/extras/Mesa/src/tnl/t_vtx_sse.c
new file mode 100644
index 000000000..8998c901b
--- /dev/null
+++ b/xc/extras/Mesa/src/tnl/t_vtx_sse.c
@@ -0,0 +1,91 @@
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "imports.h"
+#include "simple_list.h"
+#include "t_vtx_api.h"
+
+#if defined(USE_SSE_ASM)
+
+/* Build specialized versions of the immediate calls on the fly for
+ * the current state. ???P4 SSE2 versions???
+ */
+
+
+static struct dynfn *makeSSENormal3fv( struct _vb *vb, int key )
+{
+ /* Requires P4 (sse2?)
+ */
+ static unsigned char temp[] = {
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0xba, 0x78, 0x56, 0x34, 0x12, /* mov $0x12345678,%edx */
+ 0xf3, 0x0f, 0x7e, 0x00, /* movq (%eax),%xmm0 */
+ 0x66, 0x0f, 0x6e, 0x48, 0x08, /* movd 0x8(%eax),%xmm1 */
+ 0x66, 0x0f, 0xd6, 0x42, 0x0c, /* movq %xmm0,0xc(%edx) */
+ 0x66, 0x0f, 0x7e, 0x4a, 0x14, /* movd %xmm1,0x14(%edx) */
+ 0xc3, /* ret */
+ };
+
+
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ insert_at_head( &vb->dfn_cache.Normal3fv, dfn );
+ dfn->key = key;
+
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 5, 0x0, (int)vb->normalptr);
+ return dfn;
+}
+
+void _tnl_InitSSECodegen( struct dfn_generators *gen )
+{
+ /* Need to:
+ * - check kernel sse support
+ * - check p4/sse2
+ */
+ (void) makeSSENormal3fv;
+}
+
+
+#else
+
+void _tnl_InitSSECodegen( struct dfn_generators *gen )
+{
+ (void) gen;
+}
+
+#endif
+
+
+
+
diff --git a/xc/extras/Mesa/src/tnl/t_vtx_x86.c b/xc/extras/Mesa/src/tnl/t_vtx_x86.c
new file mode 100644
index 000000000..7a55db72d
--- /dev/null
+++ b/xc/extras/Mesa/src/tnl/t_vtx_x86.c
@@ -0,0 +1,705 @@
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "imports.h"
+#include "mmath.h"
+#include "simple_list.h"
+#include "tnl_vtxfmt.h"
+
+#if defined(USE_X86_ASM)
+
+
+struct dynfn *tnl_makeX86Vertex2f( TNLcontext *tnl, int key )
+{
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+
+ if (RADEON_DEBUG & DEBUG_CODEGEN)
+ _mesa_debug(NULL, "%s 0x%08x\n", __FUNCTION__, key );
+
+ switch (tnl->vertex_size) {
+ default: {
+ /* Repz convenient as it's possible to emit code for any size
+ * vertex with little tweaking. Might as well read vertsize
+ * though, and have only one of these.
+ */
+ static char temp[] = {
+ 0x57, /* push %edi */
+ 0x56, /* push %esi */
+ 0xbe, 0, 0, 0, 0, /* mov $VERTEX+2,%esi */
+ 0x8b, 0x3d, 0, 0, 0, 0, /* mov DMAPTR,%edi */
+ 0x8b, 0x44, 0x24, 0x0c, /* mov 0x0c(%esp,1),%eax */
+ 0x8b, 0x54, 0x24, 0x10, /* mov 0x10(%esp,1),%edx */
+ 0x89, 0x07, /* mov %eax,(%edi) */
+ 0x89, 0x57, 0x04, /* mov %edx,0x4(%edi) */
+ 0x83, 0xc7, 0x08, /* add $0x8,%edi */
+ 0xb9, 0, 0, 0, 0, /* mov $VERTSIZE-2,%ecx */
+ 0xf3, 0xa5, /* repz movsl %ds:(%esi),%es:(%edi)*/
+ 0xa1, 0, 0, 0, 0, /* mov COUNTER,%eax */
+ 0x89, 0x3d, 0, 0, 0, 0, /* mov %edi,DMAPTR */
+ 0x48, /* dec %eax */
+ 0xa3, 0, 0, 0, 0, /* mov %eax,COUNTER */
+ 0x5e, /* pop %esi */
+ 0x5f, /* pop %edi */
+ 0x74, 0x01, /* je +1 */
+ 0xc3, /* ret */
+ 0xff, 0x25, 0, 0, 0, 0 /* jmp NOTIFY */
+ };
+
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 3, 0x0, (int)&tnl->vertex[2]);
+ FIXUP(dfn->code, 9, 0x0, (int)&tnl->dmaptr);
+ FIXUP(dfn->code, 37, 0x0, tnl->vertex_size-2);
+ FIXUP(dfn->code, 44, 0x0, (int)&tnl->counter);
+ FIXUP(dfn->code, 50, 0x0, (int)&tnl->dmaptr);
+ FIXUP(dfn->code, 56, 0x0, (int)&tnl->counter);
+ FIXUP(dfn->code, 67, 0x0, (int)&tnl->notify);
+ break;
+ }
+ }
+
+ insert_at_head( &tnl->dfn_cache.Vertex3f, dfn );
+ dfn->key = key;
+ return dfn;
+}
+
+/* Build specialized versions of the immediate calls on the fly for
+ * the current state. Generic x86 versions.
+ */
+
+struct dynfn *tnl_makeX86Vertex3f( TNLcontext *tnl, int key )
+{
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+
+ if (RADEON_DEBUG & DEBUG_CODEGEN)
+ _mesa_debug(NULL, "%s 0x%08x\n", __FUNCTION__, key );
+
+ switch (tnl->vertex_size) {
+ case 4: {
+ static char temp[] = {
+ 0x8b, 0x0d, 0,0,0,0, /* mov DMAPTR,%ecx */
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0x8b, 0x54, 0x24, 0x08, /* mov 0x8(%esp,1),%edx */
+ 0x89, 0x01, /* mov %eax,(%ecx) */
+ 0x89, 0x51, 0x04, /* mov %edx,0x4(%ecx) */
+ 0x8b, 0x44, 0x24, 0x0c, /* mov 0xc(%esp,1),%eax */
+ 0x8b, 0x15, 0,0,0,0, /* mov VERTEX[3],%edx */
+ 0x89, 0x41, 0x08, /* mov %eax,0x8(%ecx) */
+ 0x89, 0x51, 0x0c, /* mov %edx,0xc(%ecx) */
+ 0xa1, 0, 0, 0, 0, /* mov COUNTER,%eax */
+ 0x83, 0xc1, 0x10, /* add $0x10,%ecx */
+ 0x48, /* dec %eax */
+ 0x89, 0x0d, 0,0,0,0, /* mov %ecx,DMAPTR */
+ 0xa3, 0, 0, 0, 0, /* mov %eax,COUNTER */
+ 0x74, 0x01, /* je +1 */
+ 0xc3, /* ret */
+ 0xff, 0x25, 0,0,0,0 /* jmp *NOTIFY */
+ };
+
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 2, 0x0, (int)&tnl->dmaptr);
+ FIXUP(dfn->code, 25, 0x0, (int)&tnl->vertex[3]);
+ FIXUP(dfn->code, 36, 0x0, (int)&tnl->counter);
+ FIXUP(dfn->code, 46, 0x0, (int)&tnl->dmaptr);
+ FIXUP(dfn->code, 51, 0x0, (int)&tnl->counter);
+ FIXUP(dfn->code, 60, 0x0, (int)&tnl->notify);
+ break;
+ }
+ case 6: {
+ static char temp[] = {
+ 0x57, /* push %edi */
+ 0x8b, 0x3d, 0, 0, 0, 0, /* mov DMAPTR,%edi */
+ 0x8b, 0x44, 0x24, 0x8, /* mov 0x8(%esp,1),%eax */
+ 0x8b, 0x54, 0x24, 0xc, /* mov 0xc(%esp,1),%edx */
+ 0x8b, 0x4c, 0x24, 0x10, /* mov 0x10(%esp,1),%ecx */
+ 0x89, 0x07, /* mov %eax,(%edi) */
+ 0x89, 0x57, 0x04, /* mov %edx,0x4(%edi) */
+ 0x89, 0x4f, 0x08, /* mov %ecx,0x8(%edi) */
+ 0xa1, 0, 0, 0, 0, /* mov VERTEX[3],%eax */
+ 0x8b, 0x15, 0, 0, 0, 0, /* mov VERTEX[4],%edx */
+ 0x8b, 0x0d, 0, 0, 0, 0, /* mov VERTEX[5],%ecx */
+ 0x89, 0x47, 0x0c, /* mov %eax,0xc(%edi) */
+ 0x89, 0x57, 0x10, /* mov %edx,0x10(%edi) */
+ 0x89, 0x4f, 0x14, /* mov %ecx,0x14(%edi) */
+ 0x83, 0xc7, 0x18, /* add $0x18,%edi */
+ 0xa1, 0, 0, 0, 0, /* mov COUNTER,%eax */
+ 0x89, 0x3d, 0, 0, 0, 0, /* mov %edi,DMAPTR */
+ 0x48, /* dec %eax */
+ 0x5f, /* pop %edi */
+ 0xa3, 0, 0, 0, 0, /* mov %eax,COUNTER */
+ 0x74, 0x01, /* je +1 */
+ 0xc3, /* ret */
+ 0xff, 0x25, 0,0,0,0, /* jmp *NOTIFY */
+ };
+
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 3, 0x0, (int)&tnl->dmaptr);
+ FIXUP(dfn->code, 28, 0x0, (int)&tnl->vertex[3]);
+ FIXUP(dfn->code, 34, 0x0, (int)&tnl->vertex[4]);
+ FIXUP(dfn->code, 40, 0x0, (int)&tnl->vertex[5]);
+ FIXUP(dfn->code, 57, 0x0, (int)&tnl->counter);
+ FIXUP(dfn->code, 63, 0x0, (int)&tnl->dmaptr);
+ FIXUP(dfn->code, 70, 0x0, (int)&tnl->counter);
+ FIXUP(dfn->code, 79, 0x0, (int)&tnl->notify);
+ break;
+ }
+ default: {
+ /* Repz convenient as it's possible to emit code for any size
+ * vertex with little tweaking. Might as well read vertsize
+ * though, and have only one of these.
+ */
+ static char temp[] = {
+ 0x57, /* push %edi */
+ 0x56, /* push %esi */
+ 0xbe, 0, 0, 0, 0, /* mov $VERTEX+3,%esi */
+ 0x8b, 0x3d, 0, 0, 0, 0, /* mov DMAPTR,%edi */
+ 0x8b, 0x44, 0x24, 0x0c, /* mov 0x0c(%esp,1),%eax */
+ 0x8b, 0x54, 0x24, 0x10, /* mov 0x10(%esp,1),%edx */
+ 0x8b, 0x4c, 0x24, 0x14, /* mov 0x14(%esp,1),%ecx */
+ 0x89, 0x07, /* mov %eax,(%edi) */
+ 0x89, 0x57, 0x04, /* mov %edx,0x4(%edi) */
+ 0x89, 0x4f, 0x08, /* mov %ecx,0x8(%edi) */
+ 0x83, 0xc7, 0x0c, /* add $0xc,%edi */
+ 0xb9, 0, 0, 0, 0, /* mov $VERTSIZE-3,%ecx */
+ 0xf3, 0xa5, /* repz movsl %ds:(%esi),%es:(%edi)*/
+ 0xa1, 0, 0, 0, 0, /* mov COUNTER,%eax */
+ 0x89, 0x3d, 0, 0, 0, 0, /* mov %edi,DMAPTR */
+ 0x48, /* dec %eax */
+ 0xa3, 0, 0, 0, 0, /* mov %eax,COUNTER */
+ 0x5e, /* pop %esi */
+ 0x5f, /* pop %edi */
+ 0x74, 0x01, /* je +1 */
+ 0xc3, /* ret */
+ 0xff, 0x25, 0, 0, 0, 0 /* jmp NOTIFY */
+ };
+
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 3, 0x0, (int)&tnl->vertex[3]);
+ FIXUP(dfn->code, 9, 0x0, (int)&tnl->dmaptr);
+ FIXUP(dfn->code, 37, 0x0, tnl->vertex_size-3);
+ FIXUP(dfn->code, 44, 0x0, (int)&tnl->counter);
+ FIXUP(dfn->code, 50, 0x0, (int)&tnl->dmaptr);
+ FIXUP(dfn->code, 56, 0x0, (int)&tnl->counter);
+ FIXUP(dfn->code, 67, 0x0, (int)&tnl->notify);
+ break;
+ }
+ }
+
+ insert_at_head( &tnl->dfn_cache.Vertex3f, dfn );
+ dfn->key = key;
+ return dfn;
+}
+
+
+
+struct dynfn *tnl_makeX86Vertex3fv( TNLcontext *tnl, int key )
+{
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+
+ if (TNL_DEBUG & DEBUG_CODEGEN)
+ _mesa_debug(NULL, "%s 0x%08x\n", __FUNCTION__, key );
+
+ switch (tnl->vertex_size) {
+ case 6: {
+ static char temp[] = {
+ 0xa1, 0x00, 0x00, 0, 0, /* mov 0x0,%eax */
+ 0x8b, 0x4c, 0x24, 0x04, /* mov 0x4(%esp,1),%ecx */
+ 0x8b, 0x11, /* mov (%ecx),%edx */
+ 0x89, 0x10, /* mov %edx,(%eax) */
+ 0x8b, 0x51, 0x04, /* mov 0x4(%ecx),%edx */
+ 0x8b, 0x49, 0x08, /* mov 0x8(%ecx),%ecx */
+ 0x89, 0x50, 0x04, /* mov %edx,0x4(%eax) */
+ 0x89, 0x48, 0x08, /* mov %ecx,0x8(%eax) */
+ 0x8b, 0x15, 0x1c, 0, 0, 0, /* mov 0x1c,%edx */
+ 0x8b, 0x0d, 0x20, 0, 0, 0, /* mov 0x20,%ecx */
+ 0x89, 0x50, 0x0c, /* mov %edx,0xc(%eax) */
+ 0x89, 0x48, 0x10, /* mov %ecx,0x10(%eax) */
+ 0x8b, 0x15, 0x24, 0, 0, 0, /* mov 0x24,%edx */
+ 0x89, 0x50, 0x14, /* mov %edx,0x14(%eax) */
+ 0x83, 0xc0, 0x18, /* add $0x18,%eax */
+ 0xa3, 0x00, 0x00, 0, 0, /* mov %eax,0x0 */
+ 0xa1, 0x04, 0x00, 0, 0, /* mov 0x4,%eax */
+ 0x48, /* dec %eax */
+ 0xa3, 0x04, 0x00, 0, 0, /* mov %eax,0x4 */
+ 0x74, 0x01, /* je 2a4 <.f11> */
+ 0xc3, /* ret */
+ 0xff, 0x25, 0x08, 0, 0, 0, /* jmp *0x8 */
+ };
+
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 1, 0x00000000, (int)&tnl->dmaptr);
+ FIXUP(dfn->code, 27, 0x0000001c, (int)&tnl->vertex[3]);
+ FIXUP(dfn->code, 33, 0x00000020, (int)&tnl->vertex[4]);
+ FIXUP(dfn->code, 45, 0x00000024, (int)&tnl->vertex[5]);
+ FIXUP(dfn->code, 56, 0x00000000, (int)&tnl->dmaptr);
+ FIXUP(dfn->code, 61, 0x00000004, (int)&tnl->counter);
+ FIXUP(dfn->code, 67, 0x00000004, (int)&tnl->counter);
+ FIXUP(dfn->code, 76, 0x00000008, (int)&tnl->notify);
+ break;
+ }
+
+
+ case 8: {
+ static char temp[] = {
+ 0xa1, 0x00, 0x00, 0, 0, /* mov 0x0,%eax */
+ 0x8b, 0x4c, 0x24, 0x04, /* mov 0x4(%esp,1),%ecx */
+ 0x8b, 0x11, /* mov (%ecx),%edx */
+ 0x89, 0x10, /* mov %edx,(%eax) */
+ 0x8b, 0x51, 0x04, /* mov 0x4(%ecx),%edx */
+ 0x8b, 0x49, 0x08, /* mov 0x8(%ecx),%ecx */
+ 0x89, 0x50, 0x04, /* mov %edx,0x4(%eax) */
+ 0x89, 0x48, 0x08, /* mov %ecx,0x8(%eax) */
+ 0x8b, 0x15, 0x1c, 0, 0, 0, /* mov 0x1c,%edx */
+ 0x8b, 0x0d, 0x20, 0, 0, 0, /* mov 0x20,%ecx */
+ 0x89, 0x50, 0x0c, /* mov %edx,0xc(%eax) */
+ 0x89, 0x48, 0x10, /* mov %ecx,0x10(%eax) */
+ 0x8b, 0x15, 0x1c, 0, 0, 0, /* mov 0x1c,%edx */
+ 0x8b, 0x0d, 0x20, 0, 0, 0, /* mov 0x20,%ecx */
+ 0x89, 0x50, 0x14, /* mov %edx,0x14(%eax) */
+ 0x89, 0x48, 0x18, /* mov %ecx,0x18(%eax) */
+ 0x8b, 0x15, 0x24, 0, 0, 0, /* mov 0x24,%edx */
+ 0x89, 0x50, 0x1c, /* mov %edx,0x1c(%eax) */
+ 0x83, 0xc0, 0x20, /* add $0x20,%eax */
+ 0xa3, 0x00, 0x00, 0, 0, /* mov %eax,0x0 */
+ 0xa1, 0x04, 0x00, 0, 0, /* mov 0x4,%eax */
+ 0x48, /* dec %eax */
+ 0xa3, 0x04, 0x00, 0, 0, /* mov %eax,0x4 */
+ 0x74, 0x01, /* je 2a4 <.f11> */
+ 0xc3, /* ret */
+ 0xff, 0x25, 0x08, 0, 0, 0, /* jmp *0x8 */
+ };
+
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 1, 0x00000000, (int)&tnl->dmaptr);
+ FIXUP(dfn->code, 27, 0x0000001c, (int)&tnl->vertex[3]);
+ FIXUP(dfn->code, 33, 0x00000020, (int)&tnl->vertex[4]);
+ FIXUP(dfn->code, 45, 0x0000001c, (int)&tnl->vertex[5]);
+ FIXUP(dfn->code, 51, 0x00000020, (int)&tnl->vertex[6]);
+ FIXUP(dfn->code, 63, 0x00000024, (int)&tnl->vertex[7]);
+ FIXUP(dfn->code, 74, 0x00000000, (int)&tnl->dmaptr);
+ FIXUP(dfn->code, 79, 0x00000004, (int)&tnl->counter);
+ FIXUP(dfn->code, 85, 0x00000004, (int)&tnl->counter);
+ FIXUP(dfn->code, 94, 0x00000008, (int)&tnl->notify);
+ break;
+ }
+
+
+
+ default: {
+ /* Repz convenient as it's possible to emit code for any size
+ * vertex with little tweaking. Might as well read vertsize
+ * though, and have only one of these.
+ */
+ static char temp[] = {
+ 0x8b, 0x54, 0x24, 0x04, /* mov 0x4(%esp,1),%edx */
+ 0x57, /* push %edi */
+ 0x56, /* push %esi */
+ 0x8b, 0x3d, 1,1,1,1, /* mov DMAPTR,%edi */
+ 0x8b, 0x02, /* mov (%edx),%eax */
+ 0x8b, 0x4a, 0x04, /* mov 0x4(%edx),%ecx */
+ 0x8b, 0x72, 0x08, /* mov 0x8(%edx),%esi */
+ 0x89, 0x07, /* mov %eax,(%edi) */
+ 0x89, 0x4f, 0x04, /* mov %ecx,0x4(%edi) */
+ 0x89, 0x77, 0x08, /* mov %esi,0x8(%edi) */
+ 0x83, 0xc7, 0x0c, /* add $0xc,%edi */
+ 0xb9, 0x06, 0x00, 0x00, 0x00, /* mov $VERTSIZE-3,%ecx */
+ 0xbe, 0x58, 0x00, 0x00, 0x00, /* mov $VERTEX[3],%esi */
+ 0xf3, 0xa5, /* repz movsl %ds:(%esi),%es:(%edi)*/
+ 0x89, 0x3d, 1, 1, 1, 1, /* mov %edi,DMAPTR */
+ 0xa1, 2, 2, 2, 2, /* mov COUNTER,%eax */
+ 0x5e, /* pop %esi */
+ 0x5f, /* pop %edi */
+ 0x48, /* dec %eax */
+ 0xa3, 2, 2, 2, 2, /* mov %eax,COUNTER */
+ 0x74, 0x01, /* je +1 */
+ 0xc3, /* ret */
+ 0xff, 0x25, 0, 0, 0, 0 /* jmp NOTIFY */
+ };
+
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 8, 0x01010101, (int)&tnl->dmaptr);
+ FIXUP(dfn->code, 32, 0x00000006, tnl->vertex_size-3);
+ FIXUP(dfn->code, 37, 0x00000058, (int)&tnl->vertex[3]);
+ FIXUP(dfn->code, 45, 0x01010101, (int)&tnl->dmaptr);
+ FIXUP(dfn->code, 50, 0x02020202, (int)&tnl->counter);
+ FIXUP(dfn->code, 58, 0x02020202, (int)&tnl->counter);
+ FIXUP(dfn->code, 67, 0x0, (int)&tnl->notify);
+ break;
+ }
+ }
+
+ insert_at_head( &tnl->dfn_cache.Vertex3fv, dfn );
+ dfn->key = key;
+ return dfn;
+}
+
+
+struct dynfn *tnl_makeX86Attr4fv( TNLcontext *tnl, int key )
+{
+ static char temp[] = {
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0xba, 0, 0, 0, 0, /* mov $DEST,%edx */
+ 0x8b, 0x08, /* mov (%eax),%ecx */
+ 0x89, 0x0a, /* mov %ecx,(%edx) */
+ 0x8b, 0x48, 0x04, /* mov 0x4(%eax),%ecx */
+ 0x89, 0x4a, 0x04, /* mov %ecx,0x4(%edx) */
+ 0x8b, 0x48, 0x08, /* mov 0x8(%eax),%ecx */
+ 0x89, 0x4a, 0x08, /* mov %ecx,0x8(%edx) */
+ 0x8b, 0x48, 0x0a, /* mov 0xa(%eax),%ecx */
+ 0x89, 0x4a, 0x0a, /* mov %ecx,0xa(%edx) */
+ 0xc3, /* ret */
+ };
+
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+
+ if (TNL_DEBUG & DEBUG_CODEGEN)
+ _mesa_debug(NULL, "%s 0x%08x\n", __FUNCTION__, key );
+
+ insert_at_head( &tnl->dfn_cache.Normal3fv, dfn );
+ dfn->key = key;
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 5, 0x0, (int)tnl->normalptr);
+ return dfn;
+}
+
+struct dynfn *tnl_makeX86Attr4f( TNLcontext *tnl, int key )
+{
+ static char temp[] = {
+ 0xba, 0x78, 0x56, 0x34, 0x12, /* mov $DEST,%edx */
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0x89, 0x02, /* mov %eax,(%edx) */
+ 0x8b, 0x44, 0x24, 0x08, /* mov 0x8(%esp,1),%eax */
+ 0x89, 0x42, 0x04, /* mov %eax,0x4(%edx) */
+ 0x8b, 0x44, 0x24, 0x0c, /* mov 0xc(%esp,1),%eax */
+ 0x89, 0x42, 0x08, /* mov %eax,0x8(%edx) */
+ 0x8b, 0x44, 0x24, 0x10, /* mov 0x10(%esp,1),%eax */
+ 0x89, 0x42, 0x0a, /* mov %eax,0xa(%edx) */
+ 0xc3, /* ret */
+ };
+
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+
+ if (TNL_DEBUG & DEBUG_CODEGEN)
+ _mesa_debug(NULL, "%s 0x%08x\n", __FUNCTION__, key );
+
+ insert_at_head( &tnl->dfn_cache.Normal3f, dfn );
+ dfn->key = key;
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 1, 0x12345678, (int)tnl->normalptr);
+ return dfn;
+}
+
+
+struct dynfn *tnl_makeX86Attr3fv( TNLcontext *tnl, int key )
+{
+ static char temp[] = {
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0xba, 0, 0, 0, 0, /* mov $DEST,%edx */
+ 0x8b, 0x08, /* mov (%eax),%ecx */
+ 0x89, 0x0a, /* mov %ecx,(%edx) */
+ 0x8b, 0x48, 0x04, /* mov 0x4(%eax),%ecx */
+ 0x89, 0x4a, 0x04, /* mov %ecx,0x4(%edx) */
+ 0x8b, 0x48, 0x08, /* mov 0x8(%eax),%ecx */
+ 0x89, 0x4a, 0x08, /* mov %ecx,0x8(%edx) */
+ 0xc3, /* ret */
+ };
+
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+
+ if (TNL_DEBUG & DEBUG_CODEGEN)
+ _mesa_debug(NULL, "%s 0x%08x\n", __FUNCTION__, key );
+
+ insert_at_head( &tnl->dfn_cache.Normal3fv, dfn );
+ dfn->key = key;
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 5, 0x0, (int)tnl->normalptr);
+ return dfn;
+}
+
+struct dynfn *tnl_makeX86Attr3f( TNLcontext *tnl, int key )
+{
+ static char temp[] = {
+ 0xba, 0x78, 0x56, 0x34, 0x12, /* mov $DEST,%edx */
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0x89, 0x02, /* mov %eax,(%edx) */
+ 0x8b, 0x44, 0x24, 0x08, /* mov 0x8(%esp,1),%eax */
+ 0x89, 0x42, 0x04, /* mov %eax,0x4(%edx) */
+ 0x8b, 0x44, 0x24, 0x0c, /* mov 0xc(%esp,1),%eax */
+ 0x89, 0x42, 0x08, /* mov %eax,0x8(%edx) */
+ 0xc3, /* ret */
+ };
+
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+
+ if (TNL_DEBUG & DEBUG_CODEGEN)
+ _mesa_debug(NULL, "%s 0x%08x\n", __FUNCTION__, key );
+
+ insert_at_head( &tnl->dfn_cache.Normal3f, dfn );
+ dfn->key = key;
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 1, 0x12345678, (int)tnl->normalptr);
+ return dfn;
+}
+
+struct dynfn *tnl_makeX86Attr4ubv( TNLcontext *tnl, int key )
+{
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ insert_at_head( &tnl->dfn_cache.Color4ubv, dfn );
+ dfn->key = key;
+
+ if (TNL_DEBUG & DEBUG_CODEGEN)
+ _mesa_debug(NULL, "%s 0x%08x\n", __FUNCTION__, key );
+
+ if (key & TNL_CP_VC_FRMT_PKCOLOR) {
+ static char temp[] = {
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0xba, 0x78, 0x56, 0x34, 0x12, /* mov $DEST,%edx */
+ 0x8b, 0x00, /* mov (%eax),%eax */
+ 0x89, 0x02, /* mov %eax,(%edx) */
+ 0xc3, /* ret */
+ };
+
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 5, 0x12345678, (int)tnl->ubytecolorptr);
+ return dfn;
+ }
+ else {
+ static char temp[] = {
+ 0x53, /* push %ebx */
+ 0xba, 0x00, 0x00, 0x00, 0x00, /* mov $0x0,%edx */
+ 0x31, 0xc0, /* xor %eax,%eax */
+ 0x31, 0xc9, /* xor %ecx,%ecx */
+ 0x8b, 0x5c, 0x24, 0x08, /* mov 0x8(%esp,1), %ebx */
+ 0x8b, 0x1b, /* mov (%ebx), %ebx */
+ 0x88, 0xd8, /* mov %bl, %al */
+ 0x88, 0xf9, /* mov %bh, %cl */
+ 0x8b, 0x04, 0x82, /* mov (%edx,%eax,4),%eax */
+ 0x8b, 0x0c, 0x8a, /* mov (%edx,%ecx,4),%ecx */
+ 0xa3, 0xaf, 0xbe, 0xad, 0xde, /* mov %eax,0xdeadbeaf */
+ 0x89, 0x0d, 0xaf, 0xbe, 0xad, 0xde, /* mov %ecx,0xdeadbeaf */
+ 0x31, 0xc0, /* xor %eax,%eax */
+ 0x31, 0xc9, /* xor %ecx,%ecx */
+ 0xc1, 0xeb, 0x10, /* shr $0x10, %ebx */
+ 0x88, 0xd8, /* mov %bl, %al */
+ 0x88, 0xf9, /* mov %bh, %cl */
+ 0x8b, 0x04, 0x82, /* mov (%edx,%eax,4),%eax */
+ 0x8b, 0x0c, 0x8a, /* mov (%edx,%ecx,4),%ecx */
+ 0xa3, 0xaf, 0xbe, 0xad, 0xde, /* mov %eax,0xdeadbeaf */
+ 0x89, 0x0d, 0xaf, 0xbe, 0xad, 0xde, /* mov %ecx,0xdeadbeaf */
+ 0x5b, /* pop %ebx */
+ 0xc3, /* ret */
+ };
+
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 2, 0x00000000, (int)_mesa_ubyte_to_float_color_tab);
+ FIXUP(dfn->code, 27, 0xdeadbeaf, (int)tnl->floatcolorptr);
+ FIXUP(dfn->code, 33, 0xdeadbeaf, (int)tnl->floatcolorptr+4);
+ FIXUP(dfn->code, 55, 0xdeadbeaf, (int)tnl->floatcolorptr+8);
+ FIXUP(dfn->code, 61, 0xdeadbeaf, (int)tnl->floatcolorptr+12);
+ return dfn;
+ }
+}
+
+struct dynfn *tnl_makeX86Attr4ub( TNLcontext *tnl, int key )
+{
+ if (TNL_DEBUG & DEBUG_CODEGEN)
+ _mesa_debug(NULL, "%s 0x%08x\n", __FUNCTION__, key );
+
+ if (key & TNL_CP_VC_FRMT_PKCOLOR) {
+ /* XXX push/pop */
+ static char temp[] = {
+ 0x53, /* push %ebx */
+ 0x8b, 0x44, 0x24, 0x08, /* mov 0x8(%esp,1),%eax */
+ 0x8b, 0x54, 0x24, 0x0c, /* mov 0xc(%esp,1),%edx */
+ 0x8b, 0x4c, 0x24, 0x10, /* mov 0x10(%esp,1),%ecx */
+ 0x8b, 0x5c, 0x24, 0x14, /* mov 0x14(%esp,1),%ebx */
+ 0xa2, 0, 0, 0, 0, /* mov %al,DEST */
+ 0x88, 0x15, 0, 0, 0, 0, /* mov %dl,DEST+1 */
+ 0x88, 0x0d, 0, 0, 0, 0, /* mov %cl,DEST+2 */
+ 0x88, 0x1d, 0, 0, 0, 0, /* mov %bl,DEST+3 */
+ 0x5b, /* pop %ebx */
+ 0xc3, /* ret */
+ };
+
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ insert_at_head( &tnl->dfn_cache.Color4ub, dfn );
+ dfn->key = key;
+
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 18, 0x0, (int)tnl->ubytecolorptr);
+ FIXUP(dfn->code, 24, 0x0, (int)tnl->ubytecolorptr+1);
+ FIXUP(dfn->code, 30, 0x0, (int)tnl->ubytecolorptr+2);
+ FIXUP(dfn->code, 36, 0x0, (int)tnl->ubytecolorptr+3);
+ return dfn;
+ }
+ else
+ return 0;
+}
+
+
+
+struct dynfn *tnl_makeX86Attr2fv( TNLcontext *tnl, int key )
+{
+ static char temp[] = {
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0xba, 0x78, 0x56, 0x34, 0x12, /* mov $DEST,%edx */
+ 0x8b, 0x08, /* mov (%eax),%ecx */
+ 0x8b, 0x40, 0x04, /* mov 0x4(%eax),%eax */
+ 0x89, 0x0a, /* mov %ecx,(%edx) */
+ 0x89, 0x42, 0x04, /* mov %eax,0x4(%edx) */
+ 0xc3, /* ret */
+ };
+
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+
+ if (TNL_DEBUG & DEBUG_CODEGEN)
+ _mesa_debug(NULL, "%s 0x%08x\n", __FUNCTION__, key );
+
+ insert_at_head( &tnl->dfn_cache.TexCoord2fv, dfn );
+ dfn->key = key;
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 5, 0x12345678, (int)tnl->texcoordptr[0]);
+ return dfn;
+}
+
+struct dynfn *tnl_makeX86Attr2f( TNLcontext *tnl, int key )
+{
+ static char temp[] = {
+ 0xba, 0x78, 0x56, 0x34, 0x12, /* mov $DEST,%edx */
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0x8b, 0x4c, 0x24, 0x08, /* mov 0x8(%esp,1),%ecx */
+ 0x89, 0x02, /* mov %eax,(%edx) */
+ 0x89, 0x4a, 0x04, /* mov %ecx,0x4(%edx) */
+ 0xc3, /* ret */
+ };
+
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+
+ if (TNL_DEBUG & DEBUG_CODEGEN)
+ _mesa_debug(NULL, "%s 0x%08x\n", __FUNCTION__, key );
+
+ insert_at_head( &tnl->dfn_cache.TexCoord2f, dfn );
+ dfn->key = key;
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 1, 0x12345678, (int)tnl->texcoordptr[0]);
+ return dfn;
+}
+
+
+struct dynfn *tnl_makeX86Attr1fv( TNLcontext *tnl, int key )
+{
+ static char temp[] = {
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0xba, 0x78, 0x56, 0x34, 0x12, /* mov $DEST,%edx */
+ 0x8b, 0x08, /* mov (%eax),%ecx */
+ 0x89, 0x0a, /* mov %ecx,(%edx) */
+ 0xc3, /* ret */
+ };
+
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+
+ if (TNL_DEBUG & DEBUG_CODEGEN)
+ _mesa_debug(NULL, "%s 0x%08x\n", __FUNCTION__, key );
+
+ insert_at_head( &tnl->dfn_cache.TexCoord2fv, dfn );
+ dfn->key = key;
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 5, 0x12345678, (int)tnl->texcoordptr[0]);
+ return dfn;
+}
+
+struct dynfn *tnl_makeX86Attr1f( TNLcontext *tnl, int key )
+{
+ static char temp[] = {
+ 0xba, 0x78, 0x56, 0x34, 0x12, /* mov $DEST,%edx */
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0x89, 0x02, /* mov %eax,(%edx) */
+ 0xc3, /* ret */
+ };
+
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+
+ if (TNL_DEBUG & DEBUG_CODEGEN)
+ _mesa_debug(NULL, "%s 0x%08x\n", __FUNCTION__, key );
+
+ insert_at_head( &tnl->dfn_cache.TexCoord2f, dfn );
+ dfn->key = key;
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 1, 0x12345678, (int)tnl->texcoordptr[0]);
+ return dfn;
+}
+
+
+
+void _tnl_InitX86Codegen( struct dfn_generators *gen )
+{
+ gen->Attr1f = tnl_makeX86Attr1f;
+ gen->Attr1fv = tnl_makeX86Attr1fv;
+ gen->Attr2f = tnl_makeX86Attr2f;
+ gen->Attr2fv = tnl_makeX86Attr2fv;
+ gen->Attr3f = tnl_makeX86Attr3f;
+ gen->Attr3fv = tnl_makeX86Attr3fv;
+ gen->Attr4f = tnl_makeX86Attr4f;
+ gen->Attr4fv = tnl_makeX86Attr4fv;
+ gen->Attr4ub = tnl_makeX86Attr4ub;
+ gen->Attr4ubv = tnl_makeX86Attr4ubv;
+ gen->Vertex3f = tnl_makeX86Vertex3f;
+ gen->Vertex3fv = tnl_makeX86Vertex3fv;
+}
+
+
+#else
+
+void _tnl_InitX86Codegen( struct dfn_generators *gen )
+{
+ (void) gen;
+}
+
+#endif
diff --git a/xc/extras/Mesa/src/tnl/tnl.h b/xc/extras/Mesa/src/tnl/tnl.h
index dc2af3946..349a8c7d6 100644
--- a/xc/extras/Mesa/src/tnl/tnl.h
+++ b/xc/extras/Mesa/src/tnl/tnl.h
@@ -1,4 +1,3 @@
-/* $Id: tnl.h,v 1.1.1.1 2002/10/22 13:06:18 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#ifndef _TNL_H
diff --git a/xc/extras/Mesa/src/tnl_dd/t_dd.c b/xc/extras/Mesa/src/tnl_dd/t_dd.c
index 967bab66a..731da5c32 100644
--- a/xc/extras/Mesa/src/tnl_dd/t_dd.c
+++ b/xc/extras/Mesa/src/tnl_dd/t_dd.c
@@ -1,4 +1,3 @@
-/* $Id: t_dd.c,v 1.1.1.1 2002/10/22 13:07:01 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
static void copy_pv_rgba4_spec5( GLcontext *ctx, GLuint edst, GLuint esrc )
diff --git a/xc/extras/Mesa/src/tnl_dd/t_dd_dmatmp.h b/xc/extras/Mesa/src/tnl_dd/t_dd_dmatmp.h
index 99a818b4e..d9f709389 100644
--- a/xc/extras/Mesa/src/tnl_dd/t_dd_dmatmp.h
+++ b/xc/extras/Mesa/src/tnl_dd/t_dd_dmatmp.h
@@ -1,4 +1,3 @@
-/* $Id: t_dd_dmatmp.h,v 1.1.1.1 2002/10/22 13:07:01 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
@@ -240,17 +239,25 @@ static void TAG(render_line_loop_verts)( GLcontext *ctx,
currentsz--;
dmasz--;
- if (currentsz < 8)
- currentsz = dmasz;
-
- for ( ; j + 1 < count; j += nr - 1 ) {
- nr = MIN2( currentsz, count - j );
- EMIT_VERTS( ctx, j, nr );
+ if (currentsz < 8) {
+ NEW_BUFFER();
currentsz = dmasz;
}
- if (start < count - 1 && (flags & PRIM_END))
+ if (j + 1 < count) {
+ for ( ; j + 1 < count; j += nr - 1 ) {
+ nr = MIN2( currentsz, count - j );
+ EMIT_VERTS( ctx, j, nr );
+ currentsz = dmasz;
+ }
+
+ if (start < count - 1 && (flags & PRIM_END))
+ EMIT_VERTS( ctx, start, 1 );
+ }
+ else if (start + 1 < count && (flags & PRIM_END)) {
+ EMIT_VERTS( ctx, start+1, 1 );
EMIT_VERTS( ctx, start, 1 );
+ }
FINISH;
diff --git a/xc/extras/Mesa/src/tnl_dd/t_dd_rendertmp.h b/xc/extras/Mesa/src/tnl_dd/t_dd_rendertmp.h
index 7a05a65f5..fc00e7693 100644
--- a/xc/extras/Mesa/src/tnl_dd/t_dd_rendertmp.h
+++ b/xc/extras/Mesa/src/tnl_dd/t_dd_rendertmp.h
@@ -1,4 +1,3 @@
-/* $Id: t_dd_rendertmp.h,v 1.1.1.1 2002/10/22 13:07:01 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
diff --git a/xc/extras/Mesa/src/tnl_dd/t_dd_tritmp.h b/xc/extras/Mesa/src/tnl_dd/t_dd_tritmp.h
index 8cd4a6f3f..cc47798d5 100644
--- a/xc/extras/Mesa/src/tnl_dd/t_dd_tritmp.h
+++ b/xc/extras/Mesa/src/tnl_dd/t_dd_tritmp.h
@@ -1,4 +1,3 @@
-/* $Id: t_dd_tritmp.h,v 1.1.1.1 2002/10/22 13:06:59 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
diff --git a/xc/extras/Mesa/src/tnl_dd/t_dd_unfilled.h b/xc/extras/Mesa/src/tnl_dd/t_dd_unfilled.h
index b41525bb1..46415ea5f 100644
--- a/xc/extras/Mesa/src/tnl_dd/t_dd_unfilled.h
+++ b/xc/extras/Mesa/src/tnl_dd/t_dd_unfilled.h
@@ -1,4 +1,3 @@
-/* $Id: t_dd_unfilled.h,v 1.1.1.1 2002/10/22 13:06:59 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#if HAVE_RGBA
diff --git a/xc/extras/Mesa/src/tnl_dd/t_dd_vb.c b/xc/extras/Mesa/src/tnl_dd/t_dd_vb.c
index 179ae8d26..4a742bcbb 100644
--- a/xc/extras/Mesa/src/tnl_dd/t_dd_vb.c
+++ b/xc/extras/Mesa/src/tnl_dd/t_dd_vb.c
@@ -1,4 +1,3 @@
-/* $Id: t_dd_vb.c,v 1.1.1.1 2002/10/22 13:07:02 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#include "math/m_translate.h"
@@ -195,22 +194,78 @@ void TAG(print_vertex)( GLcontext *ctx, const VERTEX *v )
LOCALVARS
GLuint format = GET_VERTEX_FORMAT();
- if (format == TINY_VERTEX_FORMAT) {
- fprintf(stderr, "x %f y %f z %f\n", v->v.x, v->v.y, v->v.z);
- fprintf(stderr, "r %d g %d b %d a %d\n",
+ fprintf(stderr, "(%x) ", format);
+
+ switch (format) {
+#if HAVE_TINY_VERTICES
+ case TINY_VERTEX_FORMAT:
+ fprintf(stderr, "xyz %.4f,%.4f,%.4f rgba %x:%x:%x:%x\n",
+ v->v.x, v->v.y, v->v.z,
v->tv.color.red,
v->tv.color.green,
v->tv.color.blue,
v->tv.color.alpha);
- }
- else {
- fprintf(stderr, "x %f y %f z %f oow %f\n",
- v->v.x, v->v.y, v->v.z, v->v.w);
- fprintf(stderr, "r %d g %d b %d a %d\n",
+ break;
+#endif
+#if HAVE_NOTEX_VERTICES
+ case NOTEX_VERTEX_FORMAT:
+ fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x spec %x:%x:%x:%x\n",
+ v->v.x, v->v.y, v->v.z, v->v.w,
+ v->v.color.red,
+ v->v.color.green,
+ v->v.color.blue,
+ v->v.color.alpha,
+ v->v.specular.red,
+ v->v.specular.green,
+ v->v.specular.blue,
+ v->v.specular.alpha);
+ break;
+#endif
+#if HAVE_TEX0_VERTICES
+ case TEX0_VERTEX_FORMAT:
+ fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x st %.4f,%.4f\n",
+ v->v.x, v->v.y, v->v.z, v->v.w,
+ v->v.color.red,
+ v->v.color.green,
+ v->v.color.blue,
+ v->v.color.alpha,
+ v->v.u0,
+ v->v.v0);
+ break;
+#endif
+#if HAVE_TEX1_VERTICES
+ case TEX1_VERTEX_FORMAT:
+ fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x st %.4f,%.4f st %.4f,%.4f\n",
+ v->v.x, v->v.y, v->v.z, v->v.w,
+ v->v.color.red,
+ v->v.color.green,
+ v->v.color.blue,
+ v->v.color.alpha,
+ v->v.u0,
+ v->v.v0,
+ v->v.u1,
+ v->v.u2);
+ break;
+#endif
+#if HAVE_PTEX_VERTICES
+ case PROJ_TEX1_VERTEX_FORMAT:
+ fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x stq %.4f,%.4f,%.4f stq %.4f,%.4f,%.4f\n",
+ v->v.x, v->v.y, v->v.z, v->v.w,
v->v.color.red,
v->v.color.green,
v->v.color.blue,
- v->v.color.alpha);
+ v->v.color.alpha,
+ v->pv.u0,
+ v->pv.v0,
+ v->pv.q0,
+ v->pv.u1,
+ v->pv.v1,
+ v->pv.q1);
+ break;
+#endif
+ default:
+ fprintf(stderr, "???\n");
+ break;
}
fprintf(stderr, "\n");
diff --git a/xc/extras/Mesa/src/tnl_dd/t_dd_vbtmp.h b/xc/extras/Mesa/src/tnl_dd/t_dd_vbtmp.h
index 16bd770bb..0fc1a64e2 100644
--- a/xc/extras/Mesa/src/tnl_dd/t_dd_vbtmp.h
+++ b/xc/extras/Mesa/src/tnl_dd/t_dd_vbtmp.h
@@ -1,8 +1,7 @@
-/* $Id: t_dd_vbtmp.h,v 1.1.1.1 2002/10/22 13:07:00 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
@@ -125,7 +124,7 @@ static void TAG(emit)( GLcontext *ctx,
{
LOCALVARS
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLfloat (*tc0)[4], (*tc1)[4], *fog;
+ GLfloat (*tc0)[4], (*tc1)[4], (*fog)[4];
GLfloat (*tc2)[4], (*tc3)[4];
GLubyte (*col)[4], (*spec)[4];
GLuint tc0_stride, tc1_stride, col_stride, spec_stride, fog_stride;
@@ -148,8 +147,8 @@ static void TAG(emit)( GLcontext *ctx,
coord_stride = VB->ClipPtr->stride;
}
else {
- coord = VB->ProjectedClipPtr->data;
- coord_stride = VB->ProjectedClipPtr->stride;
+ coord = VB->NdcPtr->data;
+ coord_stride = VB->NdcPtr->stride;
}
if (DO_TEX3) {
@@ -210,13 +209,13 @@ static void TAG(emit)( GLcontext *ctx,
fog_stride = VB->FogCoordPtr->stride;
}
else {
- GLfloat tmp = 0;
+ static GLfloat tmp[4] = {0, 0, 0, 0};
fog = &tmp;
fog_stride = 0;
}
}
- if (VB->importable_data) {
+ if (VB->importable_data || (DO_SPEC && !spec_stride) || (DO_FOG && !fog_stride)) {
/* May have nonstandard strides:
*/
if (start) {
@@ -234,7 +233,8 @@ static void TAG(emit)( GLcontext *ctx,
if (DO_SPEC)
STRIDE_4UB(spec, start * spec_stride);
if (DO_FOG)
- STRIDE_F(fog, start * fog_stride);
+ /*STRIDE_F(fog, start * fog_stride);*/
+ fog = (GLfloat (*)[4])((GLubyte *)fog + start * fog_stride);
}
for (i=start; i < end; i++, v = (VERTEX *)((GLubyte *)v + stride)) {
@@ -268,8 +268,9 @@ static void TAG(emit)( GLcontext *ctx,
STRIDE_4UB(spec, spec_stride);
}
if (DO_FOG) {
- v->v.specular.alpha = fog[0] * 255.0;
- STRIDE_F(fog, fog_stride);
+ v->v.specular.alpha = fog[0][0] * 255.0;
+ /*STRIDE_F(fog, fog_stride);*/
+ fog = (GLfloat (*)[4])((GLubyte *)fog + fog_stride);
}
if (DO_TEX0) {
v->v.u0 = tc0[0][0];
@@ -367,7 +368,7 @@ static void TAG(emit)( GLcontext *ctx,
v->v.specular.blue = spec[i][2];
}
if (DO_FOG) {
- v->v.specular.alpha = fog[i] * 255.0;
+ v->v.specular.alpha = fog[i][0] * 255.0;
}
if (DO_TEX0) {
v->v.u0 = tc0[i][0];
@@ -420,8 +421,8 @@ static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end,
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
GLubyte (*col)[4];
GLuint col_stride;
- GLfloat (*coord)[4] = VB->ProjectedClipPtr->data;
- GLuint coord_stride = VB->ProjectedClipPtr->stride;
+ GLfloat (*coord)[4] = VB->NdcPtr->data;
+ GLuint coord_stride = VB->NdcPtr->stride;
GLfloat *v = (GLfloat *)dest;
const GLubyte *mask = VB->ClipMask;
const GLfloat *s = GET_VIEWPORT_MAT();
@@ -674,8 +675,8 @@ static void TAG(interp)( GLcontext *ctx,
INTERP_F( t, dst->pv.v0, out->pv.v0, in->pv.v0 );
INTERP_F( t, dst->pv.q0, out->pv.q0, in->pv.q0 );
} else {
- GLfloat wout = VB->ProjectedClipPtr->data[eout][3];
- GLfloat win = VB->ProjectedClipPtr->data[ein][3];
+ GLfloat wout = VB->NdcPtr->data[eout][3];
+ GLfloat win = VB->NdcPtr->data[ein][3];
GLfloat qout = out->pv.w / wout;
GLfloat qin = in->pv.w / win;
GLfloat qdst, rqdst;
@@ -708,7 +709,7 @@ static void TAG(interp)( GLcontext *ctx,
}
}
else if (DO_PTEX) {
- dst->pv.q0 = 0.0; /* must be a valid float on radeon */
+ dst->pv.q1 = 0.0; /* must be a valid float on radeon */
}
if (DO_TEX2) {
if (DO_PTEX) {
diff --git a/xc/extras/Mesa/src/tnl_dd/t_dd_vertex.h b/xc/extras/Mesa/src/tnl_dd/t_dd_vertex.h
index 51639b5f6..d45dd09fb 100644
--- a/xc/extras/Mesa/src/tnl_dd/t_dd_vertex.h
+++ b/xc/extras/Mesa/src/tnl_dd/t_dd_vertex.h
@@ -1,4 +1,3 @@
-/* $Id: t_dd_vertex.h,v 1.1.1.1 2002/10/22 13:07:00 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
typedef struct {
diff --git a/xc/extras/Mesa/src/varray.c b/xc/extras/Mesa/src/varray.c
index f400f9ef5..03052898a 100644
--- a/xc/extras/Mesa/src/varray.c
+++ b/xc/extras/Mesa/src/varray.c
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
- * Version: 4.0.3
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -23,9 +23,6 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "context.h"
#include "enable.h"
@@ -39,7 +36,6 @@
#include "mtypes.h"
#include "varray.h"
#include "math/m_translate.h"
-#endif
@@ -49,40 +45,41 @@ _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (size<2 || size>4) {
+ if (size < 2 || size > 4) {
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexPointer(size)" );
return;
}
- if (stride<0) {
+ if (stride < 0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexPointer(stride)" );
return;
}
if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API))
- fprintf(stderr, "glVertexPointer( sz %d type %s stride %d )\n", size,
- _mesa_lookup_enum_by_nr( type ),
- stride);
+ _mesa_debug(ctx, "glVertexPointer( sz %d type %s stride %d )\n", size,
+ _mesa_lookup_enum_by_nr( type ), stride);
- ctx->Array.Vertex.StrideB = stride;
- if (!stride) {
- switch (type) {
+ /* always need to check that <type> is legal */
+ switch (type) {
case GL_SHORT:
- ctx->Array.Vertex.StrideB = size*sizeof(GLshort);
+ ctx->Array.Vertex.StrideB = size * sizeof(GLshort);
break;
case GL_INT:
- ctx->Array.Vertex.StrideB = size*sizeof(GLint);
+ ctx->Array.Vertex.StrideB = size * sizeof(GLint);
break;
case GL_FLOAT:
- ctx->Array.Vertex.StrideB = size*sizeof(GLfloat);
+ ctx->Array.Vertex.StrideB = size * sizeof(GLfloat);
break;
case GL_DOUBLE:
- ctx->Array.Vertex.StrideB = size*sizeof(GLdouble);
+ ctx->Array.Vertex.StrideB = size * sizeof(GLdouble);
break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexPointer(type)" );
return;
- }
}
+
+ if (stride)
+ ctx->Array.Vertex.StrideB = stride;
+
ctx->Array.Vertex.Size = size;
ctx->Array.Vertex.Type = type;
ctx->Array.Vertex.Stride = stride;
@@ -103,39 +100,39 @@ _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr )
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (stride<0) {
+ if (stride < 0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glNormalPointer(stride)" );
return;
}
if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API))
- fprintf(stderr, "glNormalPointer( type %s stride %d )\n",
- _mesa_lookup_enum_by_nr( type ),
- stride);
+ _mesa_debug(ctx, "glNormalPointer( type %s stride %d )\n",
+ _mesa_lookup_enum_by_nr( type ), stride);
- ctx->Array.Normal.StrideB = stride;
- if (!stride) {
- switch (type) {
+ switch (type) {
case GL_BYTE:
- ctx->Array.Normal.StrideB = 3*sizeof(GLbyte);
+ ctx->Array.Normal.StrideB = 3 * sizeof(GLbyte);
break;
case GL_SHORT:
- ctx->Array.Normal.StrideB = 3*sizeof(GLshort);
+ ctx->Array.Normal.StrideB = 3 * sizeof(GLshort);
break;
case GL_INT:
- ctx->Array.Normal.StrideB = 3*sizeof(GLint);
+ ctx->Array.Normal.StrideB = 3 * sizeof(GLint);
break;
case GL_FLOAT:
- ctx->Array.Normal.StrideB = 3*sizeof(GLfloat);
+ ctx->Array.Normal.StrideB = 3 * sizeof(GLfloat);
break;
case GL_DOUBLE:
- ctx->Array.Normal.StrideB = 3*sizeof(GLdouble);
+ ctx->Array.Normal.StrideB = 3 * sizeof(GLdouble);
break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glNormalPointer(type)" );
return;
- }
}
+ if (stride)
+ ctx->Array.Normal.StrideB = stride;
+
+ ctx->Array.Normal.Size = 3;
ctx->Array.Normal.Type = type;
ctx->Array.Normal.Stride = stride;
ctx->Array.Normal.Ptr = (void *) ptr;
@@ -154,7 +151,7 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (size<3 || size>4) {
+ if (size < 3 || size > 4) {
_mesa_error( ctx, GL_INVALID_VALUE, "glColorPointer(size)" );
return;
}
@@ -164,48 +161,48 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
}
if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API))
- fprintf(stderr, "glColorPointer( sz %d type %s stride %d )\n", size,
- _mesa_lookup_enum_by_nr( type ),
- stride);
+ _mesa_debug(ctx, "glColorPointer( sz %d type %s stride %d )\n", size,
+ _mesa_lookup_enum_by_nr( type ), stride);
- ctx->Array.Color.StrideB = stride;
- if (!stride) {
- switch (type) {
+ switch (type) {
case GL_BYTE:
- ctx->Array.Color.StrideB = size*sizeof(GLbyte);
+ ctx->Array.Color.StrideB = size * sizeof(GLbyte);
break;
case GL_UNSIGNED_BYTE:
- ctx->Array.Color.StrideB = size*sizeof(GLubyte);
+ ctx->Array.Color.StrideB = size * sizeof(GLubyte);
break;
case GL_SHORT:
- ctx->Array.Color.StrideB = size*sizeof(GLshort);
+ ctx->Array.Color.StrideB = size * sizeof(GLshort);
break;
case GL_UNSIGNED_SHORT:
- ctx->Array.Color.StrideB = size*sizeof(GLushort);
+ ctx->Array.Color.StrideB = size * sizeof(GLushort);
break;
case GL_INT:
- ctx->Array.Color.StrideB = size*sizeof(GLint);
+ ctx->Array.Color.StrideB = size * sizeof(GLint);
break;
case GL_UNSIGNED_INT:
- ctx->Array.Color.StrideB = size*sizeof(GLuint);
+ ctx->Array.Color.StrideB = size * sizeof(GLuint);
break;
case GL_FLOAT:
- ctx->Array.Color.StrideB = size*sizeof(GLfloat);
+ ctx->Array.Color.StrideB = size * sizeof(GLfloat);
break;
case GL_DOUBLE:
- ctx->Array.Color.StrideB = size*sizeof(GLdouble);
+ ctx->Array.Color.StrideB = size * sizeof(GLdouble);
break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glColorPointer(type)" );
return;
- }
}
+
+ if (stride)
+ ctx->Array.Color.StrideB = stride;
+
ctx->Array.Color.Size = size;
ctx->Array.Color.Type = type;
ctx->Array.Color.Stride = stride;
ctx->Array.Color.Ptr = (void *) ptr;
ctx->NewState |= _NEW_ARRAY;
- ctx->Array.NewState |= _NEW_ARRAY_COLOR;
+ ctx->Array.NewState |= _NEW_ARRAY_COLOR0;
if (ctx->Driver.ColorPointer)
ctx->Driver.ColorPointer( ctx, size, type, stride, ptr );
@@ -219,14 +216,12 @@ _mesa_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (stride<0) {
+ if (stride < 0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glFogCoordPointer(stride)" );
return;
}
- ctx->Array.FogCoord.StrideB = stride;
- if (!stride) {
- switch (type) {
+ switch (type) {
case GL_FLOAT:
ctx->Array.FogCoord.StrideB = sizeof(GLfloat);
break;
@@ -236,8 +231,12 @@ _mesa_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr)
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glFogCoordPointer(type)" );
return;
- }
}
+
+ if (stride)
+ ctx->Array.FogCoord.StrideB = stride;
+
+ ctx->Array.FogCoord.Size = 1;
ctx->Array.FogCoord.Type = type;
ctx->Array.FogCoord.Stride = stride;
ctx->Array.FogCoord.Ptr = (void *) ptr;
@@ -255,14 +254,12 @@ _mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (stride<0) {
+ if (stride < 0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glIndexPointer(stride)" );
return;
}
- ctx->Array.Index.StrideB = stride;
- if (!stride) {
- switch (type) {
+ switch (type) {
case GL_UNSIGNED_BYTE:
ctx->Array.Index.StrideB = sizeof(GLubyte);
break;
@@ -281,8 +278,12 @@ _mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glIndexPointer(type)" );
return;
- }
}
+
+ if (stride)
+ ctx->Array.Index.StrideB = stride;
+
+ ctx->Array.Index.Size = 1;
ctx->Array.Index.Type = type;
ctx->Array.Index.Stride = stride;
ctx->Array.Index.Ptr = (void *) ptr;
@@ -302,57 +303,57 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type,
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (size != 3 && size != 4) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glColorPointer(size)" );
+ _mesa_error( ctx, GL_INVALID_VALUE, "glSecondaryColorPointer(size)" );
return;
}
- if (stride<0) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glColorPointer(stride)" );
+ if (stride < 0) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glSecondaryColorPointer(stride)" );
return;
}
if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API))
- fprintf(stderr, "glColorPointer( sz %d type %s stride %d )\n", size,
- _mesa_lookup_enum_by_nr( type ),
- stride);
+ _mesa_debug(ctx, "glSecondaryColorPointer( sz %d type %s stride %d )\n",
+ size, _mesa_lookup_enum_by_nr( type ), stride);
- ctx->Array.SecondaryColor.StrideB = stride;
- if (!stride) {
- switch (type) {
+ switch (type) {
case GL_BYTE:
- ctx->Array.SecondaryColor.StrideB = size*sizeof(GLbyte);
+ ctx->Array.SecondaryColor.StrideB = size * sizeof(GLbyte);
break;
case GL_UNSIGNED_BYTE:
- ctx->Array.SecondaryColor.StrideB = size*sizeof(GLubyte);
+ ctx->Array.SecondaryColor.StrideB = size * sizeof(GLubyte);
break;
case GL_SHORT:
- ctx->Array.SecondaryColor.StrideB = size*sizeof(GLshort);
+ ctx->Array.SecondaryColor.StrideB = size * sizeof(GLshort);
break;
case GL_UNSIGNED_SHORT:
- ctx->Array.SecondaryColor.StrideB = size*sizeof(GLushort);
+ ctx->Array.SecondaryColor.StrideB = size * sizeof(GLushort);
break;
case GL_INT:
- ctx->Array.SecondaryColor.StrideB = size*sizeof(GLint);
+ ctx->Array.SecondaryColor.StrideB = size * sizeof(GLint);
break;
case GL_UNSIGNED_INT:
- ctx->Array.SecondaryColor.StrideB = size*sizeof(GLuint);
+ ctx->Array.SecondaryColor.StrideB = size * sizeof(GLuint);
break;
case GL_FLOAT:
- ctx->Array.SecondaryColor.StrideB = size*sizeof(GLfloat);
+ ctx->Array.SecondaryColor.StrideB = size * sizeof(GLfloat);
break;
case GL_DOUBLE:
- ctx->Array.SecondaryColor.StrideB = size*sizeof(GLdouble);
+ ctx->Array.SecondaryColor.StrideB = size * sizeof(GLdouble);
break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glSecondaryColorPointer(type)" );
return;
- }
}
+
+ if (stride)
+ ctx->Array.SecondaryColor.StrideB = stride;
+
ctx->Array.SecondaryColor.Size = 3; /* hardwire */
ctx->Array.SecondaryColor.Type = type;
ctx->Array.SecondaryColor.Stride = stride;
ctx->Array.SecondaryColor.Ptr = (void *) ptr;
ctx->NewState |= _NEW_ARRAY;
- ctx->Array.NewState |= _NEW_ARRAY_SECONDARYCOLOR;
+ ctx->Array.NewState |= _NEW_ARRAY_COLOR1;
if (ctx->Driver.SecondaryColorPointer)
ctx->Driver.SecondaryColorPointer( ctx, size, type, stride, ptr );
@@ -361,48 +362,48 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type,
void
-_mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
+_mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
+ const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
GLuint texUnit = ctx->Array.ActiveTexture;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (size<1 || size>4) {
+ if (size < 1 || size > 4) {
_mesa_error( ctx, GL_INVALID_VALUE, "glTexCoordPointer(size)" );
return;
}
- if (stride<0) {
+ if (stride < 0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glTexCoordPointer(stride)" );
return;
}
if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API))
- fprintf(stderr, "glTexCoordPointer( unit %u sz %d type %s stride %d )\n",
- texUnit,
- size,
- _mesa_lookup_enum_by_nr( type ),
- stride);
-
- ctx->Array.TexCoord[texUnit].StrideB = stride;
- if (!stride) {
- switch (type) {
+ _mesa_debug(ctx, "glTexCoordPointer(unit %u sz %d type %s stride %d)\n",
+ texUnit, size, _mesa_lookup_enum_by_nr( type ), stride);
+
+ /* always need to check that <type> is legal */
+ switch (type) {
case GL_SHORT:
- ctx->Array.TexCoord[texUnit].StrideB = size*sizeof(GLshort);
+ ctx->Array.TexCoord[texUnit].StrideB = size * sizeof(GLshort);
break;
case GL_INT:
- ctx->Array.TexCoord[texUnit].StrideB = size*sizeof(GLint);
+ ctx->Array.TexCoord[texUnit].StrideB = size * sizeof(GLint);
break;
case GL_FLOAT:
- ctx->Array.TexCoord[texUnit].StrideB = size*sizeof(GLfloat);
+ ctx->Array.TexCoord[texUnit].StrideB = size * sizeof(GLfloat);
break;
case GL_DOUBLE:
- ctx->Array.TexCoord[texUnit].StrideB = size*sizeof(GLdouble);
+ ctx->Array.TexCoord[texUnit].StrideB = size * sizeof(GLdouble);
break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glTexCoordPointer(type)" );
return;
- }
}
+
+ if (stride)
+ ctx->Array.TexCoord[texUnit].StrideB = stride;
+
ctx->Array.TexCoord[texUnit].Size = size;
ctx->Array.TexCoord[texUnit].Type = type;
ctx->Array.TexCoord[texUnit].Stride = stride;
@@ -410,17 +411,13 @@ _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr
ctx->NewState |= _NEW_ARRAY;
ctx->Array.NewState |= _NEW_ARRAY_TEXCOORD(texUnit);
-/* fprintf(stderr, "%s ptr %p\n", __FUNCTION__, ptr); */
-
if (ctx->Driver.TexCoordPointer)
ctx->Driver.TexCoordPointer( ctx, size, type, stride, ptr );
}
-
-
void
-_mesa_EdgeFlagPointer(GLsizei stride, const void *vptr)
+_mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *vptr)
{
GET_CURRENT_CONTEXT(ctx);
const GLboolean *ptr = (GLboolean *)vptr;
@@ -441,7 +438,65 @@ _mesa_EdgeFlagPointer(GLsizei stride, const void *vptr)
}
+void _mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (index >= VERT_ATTRIB_MAX) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerNV(index)");
+ return;
+ }
+ if (size < 1 || size > 4) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerNV(size)");
+ return;
+ }
+
+ if (stride < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerNV(stride)");
+ return;
+ }
+
+ if (type == GL_UNSIGNED_BYTE && size != 4) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerNV(size!=4)");
+ return;
+ }
+
+ /* check for valid 'type' and compute StrideB right away */
+ switch (type) {
+ case GL_UNSIGNED_BYTE:
+ ctx->Array.VertexAttrib[index].StrideB = size * sizeof(GLubyte);
+ break;
+ case GL_SHORT:
+ ctx->Array.VertexAttrib[index].StrideB = size * sizeof(GLshort);
+ break;
+ case GL_FLOAT:
+ ctx->Array.VertexAttrib[index].StrideB = size * sizeof(GLfloat);
+ break;
+ case GL_DOUBLE:
+ ctx->Array.VertexAttrib[index].StrideB = size * sizeof(GLdouble);
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttribPointerNV(type)" );
+ return;
+ }
+
+ if (stride)
+ ctx->Array.VertexAttrib[index].StrideB = stride;
+
+ ctx->Array.VertexAttrib[index].Stride = stride;
+ ctx->Array.VertexAttrib[index].Size = size;
+ ctx->Array.VertexAttrib[index].Type = type;
+ ctx->Array.VertexAttrib[index].Ptr = (void *) ptr;
+
+ ctx->NewState |= _NEW_ARRAY;
+ ctx->Array.NewState |= _NEW_ARRAY_ATTRIB(index);
+
+ if (ctx->Driver.VertexAttribPointer)
+ ctx->Driver.VertexAttribPointer( ctx, index, size, type, stride, ptr );
+}
void
@@ -499,8 +554,6 @@ _mesa_EdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *ptr)
-
-
void
_mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer)
{
@@ -704,7 +757,7 @@ _mesa_LockArraysEXT(GLint first, GLsizei count)
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glLockArrays %d %d\n", first, count);
+ _mesa_debug(ctx, "glLockArrays %d %d\n", first, count);
if (first == 0 && count > 0 &&
count <= (GLint) ctx->Const.MaxArrayLockSize) {
@@ -731,7 +784,7 @@ _mesa_UnlockArraysEXT( void )
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glUnlockArrays\n");
+ _mesa_debug(ctx, "glUnlockArrays\n");
ctx->Array.LockFirst = 0;
ctx->Array.LockCount = 0;
@@ -741,3 +794,41 @@ _mesa_UnlockArraysEXT( void )
if (ctx->Driver.UnlockArraysEXT)
ctx->Driver.UnlockArraysEXT( ctx );
}
+
+
+
+/* GL_EXT_multi_draw_arrays */
+/* Somebody forgot to spec the first and count parameters as const! <sigh> */
+void
+_mesa_MultiDrawArraysEXT( GLenum mode, GLint *first,
+ GLsizei *count, GLsizei primcount )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint i;
+
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ for (i = 0; i < primcount; i++) {
+ if (count[i] > 0) {
+ (ctx->Exec->DrawArrays)(mode, first[i], count[i]);
+ }
+ }
+}
+
+
+/* GL_EXT_multi_draw_arrays */
+void
+_mesa_MultiDrawElementsEXT( GLenum mode, const GLsizei *count, GLenum type,
+ const GLvoid **indices, GLsizei primcount )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint i;
+
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ for (i = 0; i < primcount; i++) {
+ if (count[i] > 0) {
+ (ctx->Exec->DrawElements)(mode, count[i], type, indices[i]);
+ }
+ }
+}
diff --git a/xc/extras/Mesa/src/varray.h b/xc/extras/Mesa/src/varray.h
index 3aaf50739..67558794e 100644
--- a/xc/extras/Mesa/src/varray.h
+++ b/xc/extras/Mesa/src/varray.h
@@ -1,10 +1,8 @@
-/* $Id: varray.h,v 1.1.1.5 2002/10/22 13:05:55 alanh Exp $ */
-
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -96,14 +94,28 @@ _mesa_EdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *ptr);
extern void
_mesa_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr);
+
extern void
_mesa_SecondaryColorPointerEXT(GLint size, GLenum type,
GLsizei stride, const GLvoid *ptr);
extern void
+_mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer);
+
+
+extern void
_mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer);
+extern void
+_mesa_MultiDrawArraysEXT( GLenum mode, GLint *first,
+ GLsizei *count, GLsizei primcount );
+
+extern void
+_mesa_MultiDrawElementsEXT( GLenum mode, const GLsizei *count, GLenum type,
+ const GLvoid **indices, GLsizei primcount );
+
#endif
diff --git a/xc/extras/Mesa/src/vtxfmt.c b/xc/extras/Mesa/src/vtxfmt.c
index 43abb9889..d7b18e4c1 100644
--- a/xc/extras/Mesa/src/vtxfmt.c
+++ b/xc/extras/Mesa/src/vtxfmt.c
@@ -1,8 +1,7 @@
-/* $Id: vtxfmt.c,v 1.1.1.1 2002/10/22 13:05:49 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
@@ -24,13 +23,14 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
+ * Gareth Hughes
*/
#include "glheader.h"
#include "api_loopback.h"
#include "context.h"
+#include "imports.h"
#include "mtypes.h"
#include "state.h"
#include "vtxfmt.h"
@@ -54,18 +54,16 @@
ASSERT( tnl->Current ); \
ASSERT( tnl->SwapCount < NUM_VERTEX_FORMAT_ENTRIES ); \
\
- /* Save the swapped function's dispatch entry so it can be \
- * restored later. \
- */ \
+ /* Save the swapped function's dispatch entry so it can be */ \
+ /* restored later. */ \
tnl->Swapped[tnl->SwapCount][0] = (void *)&(ctx->Exec->FUNC); \
tnl->Swapped[tnl->SwapCount][1] = (void *)TAG(FUNC); \
tnl->SwapCount++; \
\
if ( 0 ) \
- fprintf( stderr, " swapping gl" #FUNC"...\n" ); \
+ _mesa_debug(ctx, " swapping gl" #FUNC"...\n" ); \
\
- /* Install the tnl function pointer. \
- */ \
+ /* Install the tnl function pointer. */ \
ctx->Exec->FUNC = tnl->Current->FUNC; \
}
@@ -126,18 +124,17 @@ static void install_vtxfmt( struct _glapi_table *tab, GLvertexformat *vfmt )
tab->Vertex3fv = vfmt->Vertex3fv;
tab->Vertex4f = vfmt->Vertex4f;
tab->Vertex4fv = vfmt->Vertex4fv;
+ tab->CallList = vfmt->CallList;
tab->Begin = vfmt->Begin;
tab->End = vfmt->End;
-
-/* tab->NewList = vfmt->NewList; */
- tab->CallList = vfmt->CallList;
-
+ tab->VertexAttrib4fNV = vfmt->VertexAttrib4fNV;
tab->Rectf = vfmt->Rectf;
tab->DrawArrays = vfmt->DrawArrays;
tab->DrawElements = vfmt->DrawElements;
tab->DrawRangeElements = vfmt->DrawRangeElements;
tab->EvalMesh1 = vfmt->EvalMesh1;
tab->EvalMesh2 = vfmt->EvalMesh2;
+ assert(tab->EvalMesh2);
}
diff --git a/xc/extras/Mesa/src/vtxfmt.h b/xc/extras/Mesa/src/vtxfmt.h
index 14ab79e7d..6f6006bd2 100644
--- a/xc/extras/Mesa/src/vtxfmt.h
+++ b/xc/extras/Mesa/src/vtxfmt.h
@@ -1,10 +1,9 @@
-/* $Id: vtxfmt.h,v 1.1.1.1 2002/10/22 13:05:49 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,8 +23,8 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
+ * Gareth Hughes
*/
#ifndef _VTXFMT_H_
diff --git a/xc/extras/Mesa/src/vtxfmt_tmp.h b/xc/extras/Mesa/src/vtxfmt_tmp.h
index ca11e772c..0900d6e3f 100644
--- a/xc/extras/Mesa/src/vtxfmt_tmp.h
+++ b/xc/extras/Mesa/src/vtxfmt_tmp.h
@@ -1,10 +1,9 @@
-/* $Id: vtxfmt_tmp.h,v 1.1.1.1 2002/10/22 13:05:07 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.1
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * 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"),
@@ -24,7 +23,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Gareth Hughes <gareth@valinux.com>
+ * Gareth Hughes
*/
#ifndef PRE_LOOPBACK
@@ -34,109 +33,109 @@
static void TAG(ArrayElement)( GLint i )
{
PRE_LOOPBACK( ArrayElement );
- glArrayElement( i );
+ _glapi_Dispatch->ArrayElement( i );
}
-static void TAG(Color3f)( GLfloat a, GLfloat b, GLfloat c )
+static void TAG(Color3f)( GLfloat r, GLfloat g, GLfloat b )
{
PRE_LOOPBACK( Color3f );
- glColor3f( a, b, c );
+ _glapi_Dispatch->Color3f( r, g, b );
}
static void TAG(Color3fv)( const GLfloat *v )
{
PRE_LOOPBACK( Color3fv );
- glColor3fv( v );
+ _glapi_Dispatch->Color3fv( v );
}
-static void TAG(Color3ub)( GLubyte a, GLubyte b, GLubyte c )
+static void TAG(Color3ub)( GLubyte r, GLubyte g, GLubyte b )
{
PRE_LOOPBACK( Color3ub );
- glColor3ub( a, b, c );
+ _glapi_Dispatch->Color3ub( r, g, b );
}
static void TAG(Color3ubv)( const GLubyte *v )
{
PRE_LOOPBACK( Color3ubv );
- glColor3ubv( v );
+ _glapi_Dispatch->Color3ubv( v );
}
-static void TAG(Color4f)( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
+static void TAG(Color4f)( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
{
PRE_LOOPBACK( Color4f );
- glColor4f( a, b, c, d );
+ _glapi_Dispatch->Color4f( r, g, b, a );
}
static void TAG(Color4fv)( const GLfloat *v )
{
PRE_LOOPBACK( Color4fv );
- glColor4fv( v );
+ _glapi_Dispatch->Color4fv( v );
}
-static void TAG(Color4ub)( GLubyte a, GLubyte b, GLubyte c, GLubyte d )
+static void TAG(Color4ub)( GLubyte r, GLubyte g, GLubyte b, GLubyte a )
{
PRE_LOOPBACK( Color4ub );
- glColor4ub( a, b, c, d );
+ _glapi_Dispatch->Color4ub( r, g, b, a );
}
static void TAG(Color4ubv)( const GLubyte *v )
{
PRE_LOOPBACK( Color4ubv );
- glColor4ubv( v );
+ _glapi_Dispatch->Color4ubv( v );
}
-static void TAG(EdgeFlag)( GLboolean a )
+static void TAG(EdgeFlag)( GLboolean e )
{
PRE_LOOPBACK( EdgeFlag );
- glEdgeFlag( a );
+ _glapi_Dispatch->EdgeFlag( e );
}
static void TAG(EdgeFlagv)( const GLboolean *v )
{
PRE_LOOPBACK( EdgeFlagv );
- glEdgeFlagv( v );
+ _glapi_Dispatch->EdgeFlagv( v );
}
-static void TAG(EvalCoord1f)( GLfloat a )
+static void TAG(EvalCoord1f)( GLfloat s )
{
PRE_LOOPBACK( EvalCoord1f );
- glEvalCoord1f( a );
+ _glapi_Dispatch->EvalCoord1f( s );
}
static void TAG(EvalCoord1fv)( const GLfloat *v )
{
PRE_LOOPBACK( EvalCoord1fv );
- glEvalCoord1fv( v );
+ _glapi_Dispatch->EvalCoord1fv( v );
}
-static void TAG(EvalCoord2f)( GLfloat a, GLfloat b )
+static void TAG(EvalCoord2f)( GLfloat s, GLfloat t )
{
PRE_LOOPBACK( EvalCoord2f );
- glEvalCoord2f( a, b );
+ _glapi_Dispatch->EvalCoord2f( s, t );
}
static void TAG(EvalCoord2fv)( const GLfloat *v )
{
PRE_LOOPBACK( EvalCoord2fv );
- glEvalCoord2fv( v );
+ _glapi_Dispatch->EvalCoord2fv( v );
}
-static void TAG(EvalPoint1)( GLint a )
+static void TAG(EvalPoint1)( GLint i )
{
PRE_LOOPBACK( EvalPoint1 );
- glEvalPoint1( a );
+ _glapi_Dispatch->EvalPoint1( i );
}
-static void TAG(EvalPoint2)( GLint a, GLint b )
+static void TAG(EvalPoint2)( GLint i, GLint j )
{
PRE_LOOPBACK( EvalPoint2 );
- glEvalPoint2( a, b );
+ _glapi_Dispatch->EvalPoint2( i, j );
}
-static void TAG(FogCoordfEXT)( GLfloat a )
+static void TAG(FogCoordfEXT)( GLfloat f )
{
PRE_LOOPBACK( FogCoordfEXT );
- _glapi_Dispatch->FogCoordfEXT( a );
+ _glapi_Dispatch->FogCoordfEXT( f );
}
static void TAG(FogCoordfvEXT)( const GLfloat *v )
@@ -145,90 +144,90 @@ static void TAG(FogCoordfvEXT)( const GLfloat *v )
_glapi_Dispatch->FogCoordfvEXT( v );
}
-static void TAG(Indexi)( GLint a )
+static void TAG(Indexi)( GLint i )
{
PRE_LOOPBACK( Indexi );
- glIndexi( a );
+ _glapi_Dispatch->Indexi( i );
}
static void TAG(Indexiv)( const GLint *v )
{
PRE_LOOPBACK( Indexiv );
- glIndexiv( v );
+ _glapi_Dispatch->Indexiv( v );
}
static void TAG(Materialfv)( GLenum face, GLenum pname, const GLfloat *v )
{
PRE_LOOPBACK( Materialfv );
- glMaterialfv( face, pname, v );
+ _glapi_Dispatch->Materialfv( face, pname, v );
}
static void TAG(MultiTexCoord1fARB)( GLenum target, GLfloat a )
{
PRE_LOOPBACK( MultiTexCoord1fARB );
- glMultiTexCoord1fARB( target, a );
+ _glapi_Dispatch->MultiTexCoord1fARB( target, a );
}
static void TAG(MultiTexCoord1fvARB)( GLenum target, const GLfloat *tc )
{
PRE_LOOPBACK( MultiTexCoord1fvARB );
- glMultiTexCoord1fvARB( target, tc );
+ _glapi_Dispatch->MultiTexCoord1fvARB( target, tc );
}
-static void TAG(MultiTexCoord2fARB)( GLenum target, GLfloat a, GLfloat b )
+static void TAG(MultiTexCoord2fARB)( GLenum target, GLfloat s, GLfloat t )
{
PRE_LOOPBACK( MultiTexCoord2fARB );
- glMultiTexCoord2fARB( target, a, b );
+ _glapi_Dispatch->MultiTexCoord2fARB( target, s, t );
}
static void TAG(MultiTexCoord2fvARB)( GLenum target, const GLfloat *tc )
{
PRE_LOOPBACK( MultiTexCoord2fvARB );
- glMultiTexCoord2fvARB( target, tc );
+ _glapi_Dispatch->MultiTexCoord2fvARB( target, tc );
}
-static void TAG(MultiTexCoord3fARB)( GLenum target, GLfloat a,
- GLfloat b, GLfloat c )
+static void TAG(MultiTexCoord3fARB)( GLenum target, GLfloat s,
+ GLfloat t, GLfloat r )
{
PRE_LOOPBACK( MultiTexCoord3fARB );
- glMultiTexCoord3fARB( target, a, b, c );
+ _glapi_Dispatch->MultiTexCoord3fARB( target, s, t, r );
}
static void TAG(MultiTexCoord3fvARB)( GLenum target, const GLfloat *tc )
{
PRE_LOOPBACK( MultiTexCoord3fvARB );
- glMultiTexCoord3fvARB( target, tc );
+ _glapi_Dispatch->MultiTexCoord3fvARB( target, tc );
}
-static void TAG(MultiTexCoord4fARB)( GLenum target, GLfloat a,
- GLfloat b, GLfloat c, GLfloat d )
+static void TAG(MultiTexCoord4fARB)( GLenum target, GLfloat s,
+ GLfloat t, GLfloat r, GLfloat q )
{
PRE_LOOPBACK( MultiTexCoord4fARB );
- glMultiTexCoord4fARB( target, a, b, c, d );
+ _glapi_Dispatch->MultiTexCoord4fARB( target, s, t, r, q );
}
static void TAG(MultiTexCoord4fvARB)( GLenum target, const GLfloat *tc )
{
PRE_LOOPBACK( MultiTexCoord4fvARB );
- glMultiTexCoord4fvARB( target, tc );
+ _glapi_Dispatch->MultiTexCoord4fvARB( target, tc );
}
-static void TAG(Normal3f)( GLfloat a, GLfloat b, GLfloat c )
+static void TAG(Normal3f)( GLfloat x, GLfloat y, GLfloat z )
{
PRE_LOOPBACK( Normal3f );
- glNormal3f( a, b, c );
+ _glapi_Dispatch->Normal3f( x, y, z );
}
static void TAG(Normal3fv)( const GLfloat *v )
{
PRE_LOOPBACK( Normal3fv );
- glNormal3fv( v );
+ _glapi_Dispatch->Normal3fv( v );
}
-static void TAG(SecondaryColor3fEXT)( GLfloat a, GLfloat b, GLfloat c )
+static void TAG(SecondaryColor3fEXT)( GLfloat r, GLfloat g, GLfloat b )
{
PRE_LOOPBACK( SecondaryColor3fEXT );
- _glapi_Dispatch->SecondaryColor3fEXT( a, b, c );
+ _glapi_Dispatch->SecondaryColor3fEXT( r, g, b );
}
static void TAG(SecondaryColor3fvEXT)( const GLfloat *v )
@@ -237,10 +236,10 @@ static void TAG(SecondaryColor3fvEXT)( const GLfloat *v )
_glapi_Dispatch->SecondaryColor3fvEXT( v );
}
-static void TAG(SecondaryColor3ubEXT)( GLubyte a, GLubyte b, GLubyte c )
+static void TAG(SecondaryColor3ubEXT)( GLubyte r, GLubyte g, GLubyte b )
{
PRE_LOOPBACK( SecondaryColor3ubEXT );
- _glapi_Dispatch->SecondaryColor3ubEXT( a, b, c );
+ _glapi_Dispatch->SecondaryColor3ubEXT( r, g, b );
}
static void TAG(SecondaryColor3ubvEXT)( const GLubyte *v )
@@ -249,125 +248,125 @@ static void TAG(SecondaryColor3ubvEXT)( const GLubyte *v )
_glapi_Dispatch->SecondaryColor3ubvEXT( v );
}
-static void TAG(TexCoord1f)( GLfloat a )
+static void TAG(TexCoord1f)( GLfloat s )
{
PRE_LOOPBACK( TexCoord1f );
- glTexCoord1f( a );
+ _glapi_Dispatch->TexCoord1f( s );
}
static void TAG(TexCoord1fv)( const GLfloat *tc )
{
PRE_LOOPBACK( TexCoord1fv );
- glTexCoord1fv( tc );
+ _glapi_Dispatch->TexCoord1fv( tc );
}
-static void TAG(TexCoord2f)( GLfloat a, GLfloat b )
+static void TAG(TexCoord2f)( GLfloat s, GLfloat t )
{
PRE_LOOPBACK( TexCoord2f );
- glTexCoord2f( a, b );
+ _glapi_Dispatch->TexCoord2f( s, t );
}
static void TAG(TexCoord2fv)( const GLfloat *tc )
{
PRE_LOOPBACK( TexCoord2fv );
- glTexCoord2fv( tc );
+ _glapi_Dispatch->TexCoord2fv( tc );
}
-static void TAG(TexCoord3f)( GLfloat a, GLfloat b, GLfloat c )
+static void TAG(TexCoord3f)( GLfloat s, GLfloat t, GLfloat r )
{
PRE_LOOPBACK( TexCoord3f );
- glTexCoord3f( a, b, c );
+ _glapi_Dispatch->TexCoord3f( s, t, r );
}
static void TAG(TexCoord3fv)( const GLfloat *tc )
{
PRE_LOOPBACK( TexCoord3fv );
- glTexCoord3fv( tc );
+ _glapi_Dispatch->TexCoord3fv( tc );
}
-static void TAG(TexCoord4f)( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
+static void TAG(TexCoord4f)( GLfloat s, GLfloat t, GLfloat r, GLfloat q )
{
PRE_LOOPBACK( TexCoord4f );
- glTexCoord4f( a, b, c, d );
+ _glapi_Dispatch->TexCoord4f( s, t, r, q );
}
static void TAG(TexCoord4fv)( const GLfloat *tc )
{
PRE_LOOPBACK( TexCoord4fv );
- glTexCoord4fv( tc );
+ _glapi_Dispatch->TexCoord4fv( tc );
}
-static void TAG(Vertex2f)( GLfloat a, GLfloat b )
+static void TAG(Vertex2f)( GLfloat x, GLfloat y )
{
PRE_LOOPBACK( Vertex2f );
- glVertex2f( a, b );
+ _glapi_Dispatch->Vertex2f( x, y );
}
-static void TAG(Vertex2fv)( const GLfloat *obj )
+static void TAG(Vertex2fv)( const GLfloat *v )
{
PRE_LOOPBACK( Vertex2fv );
- glVertex2fv( obj );
+ _glapi_Dispatch->Vertex2fv( v );
}
-static void TAG(Vertex3f)( GLfloat a, GLfloat b, GLfloat c )
+static void TAG(Vertex3f)( GLfloat x, GLfloat y, GLfloat z )
{
PRE_LOOPBACK( Vertex3f );
- glVertex3f( a, b, c );
+ _glapi_Dispatch->Vertex3f( x, y, z );
}
-static void TAG(Vertex3fv)( const GLfloat *obj )
+static void TAG(Vertex3fv)( const GLfloat *v )
{
PRE_LOOPBACK( Vertex3fv );
- glVertex3fv( obj );
+ _glapi_Dispatch->Vertex3fv( v );
}
-static void TAG(Vertex4f)( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
+static void TAG(Vertex4f)( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
{
PRE_LOOPBACK( Vertex4f );
- glVertex4f( a, b, c, d );
+ _glapi_Dispatch->Vertex4f( x, y, z, w );
}
-static void TAG(Vertex4fv)( const GLfloat *obj )
+static void TAG(Vertex4fv)( const GLfloat *v )
{
PRE_LOOPBACK( Vertex4fv );
- glVertex4fv( obj );
+ _glapi_Dispatch->Vertex4fv( v );
}
static void TAG(CallList)( GLuint i )
{
PRE_LOOPBACK( CallList );
- glCallList( i );
+ _glapi_Dispatch->CallList( i );
}
static void TAG(Begin)( GLenum mode )
{
PRE_LOOPBACK( Begin );
- glBegin( mode );
+ _glapi_Dispatch->Begin( mode );
}
static void TAG(End)( void )
{
PRE_LOOPBACK( End );
- glEnd();
+ _glapi_Dispatch->End();
}
static void TAG(Rectf)( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
{
PRE_LOOPBACK( Rectf );
- glRectf( x1, y1, x2, y2 );
+ _glapi_Dispatch->Rectf( x1, y1, x2, y2 );
}
static void TAG(DrawArrays)( GLenum mode, GLint start, GLsizei count )
{
PRE_LOOPBACK( DrawArrays );
- glDrawArrays( mode, start, count );
+ _glapi_Dispatch->DrawArrays( mode, start, count );
}
static void TAG(DrawElements)( GLenum mode, GLsizei count, GLenum type,
const void *indices )
{
PRE_LOOPBACK( DrawElements );
- glDrawElements( mode, count, type, indices );
+ _glapi_Dispatch->DrawElements( mode, count, type, indices );
}
static void TAG(DrawRangeElements)( GLenum mode, GLuint start,
@@ -375,20 +374,32 @@ static void TAG(DrawRangeElements)( GLenum mode, GLuint start,
GLenum type, const void *indices )
{
PRE_LOOPBACK( DrawRangeElements );
- glDrawRangeElements( mode, start, end, count, type, indices );
+ _glapi_Dispatch->DrawRangeElements( mode, start, end, count, type, indices );
}
static void TAG(EvalMesh1)( GLenum mode, GLint i1, GLint i2 )
{
PRE_LOOPBACK( EvalMesh1 );
- glEvalMesh1( mode, i1, i2 );
+ _glapi_Dispatch->EvalMesh1( mode, i1, i2 );
}
static void TAG(EvalMesh2)( GLenum mode, GLint i1, GLint i2,
GLint j1, GLint j2 )
{
PRE_LOOPBACK( EvalMesh2 );
- glEvalMesh2( mode, i1, i2, j1, j2 );
+ _glapi_Dispatch->EvalMesh2( mode, i1, i2, j1, j2 );
+}
+
+static void TAG(VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+{
+ PRE_LOOPBACK( VertexAttrib4fNV );
+ _glapi_Dispatch->VertexAttrib4fNV( index, x, y, z, w );
+}
+
+static void TAG(VertexAttrib4fvNV)( GLuint index, const GLfloat *v )
+{
+ PRE_LOOPBACK( VertexAttrib4fNV );
+ _glapi_Dispatch->VertexAttrib4fvNV( index, v );
}
@@ -446,12 +457,14 @@ static GLvertexformat TAG(vtxfmt) = {
TAG(CallList),
TAG(Begin),
TAG(End),
+ TAG(VertexAttrib4fNV),
+ TAG(VertexAttrib4fvNV),
TAG(Rectf),
TAG(DrawArrays),
TAG(DrawElements),
TAG(DrawRangeElements),
TAG(EvalMesh1),
- TAG(EvalMesh2),
+ TAG(EvalMesh2)
};
#undef TAG
diff --git a/xc/extras/ogl-sample/README.XF86 b/xc/extras/ogl-sample/README.XF86
deleted file mode 100644
index 0e2840e40..000000000
--- a/xc/extras/ogl-sample/README.XF86
+++ /dev/null
@@ -1,26 +0,0 @@
-
-This is an import of selected parts of SGI's ogl-sample distribution,
-which is available from their CVS repository at :pserver:cvs@oss.sgi.com/cvs
-(password 'cvs', check out "projects/ogl-sample/main).
-
-Currently only the GLw and GLU components have been imported:
-
- main/doc/man/macros
- main/doc/man/mandefs
- main/doc/man/mangl
- main/doc/man/manglu
- main/doc/man/manglw
- main/doc/man/manrules
- main/doc/man/tools
- main/gfx/lib/glw
- main/gfx/lib/glu
-
-Others may be imported at a later date.
-
-When importing, use the vendor tag OGL_SAMPLE, and tag OGL_SAMPLE-yyyymmdd,
-where yyyymmdd indicates the date of the snapshot from the ogl-sample
-CVS repository.
-
-
-
-$XFree86: xc/extras/ogl-sample/README.XF86,v 1.5 2002/01/14 22:20:12 dawes Exp $
diff --git a/xc/extras/ogl-sample/main/doc/man/macros/GNUmakefile b/xc/extras/ogl-sample/main/doc/man/macros/GNUmakefile
deleted file mode 100755
index e50d42bce..000000000
--- a/xc/extras/ogl-sample/main/doc/man/macros/GNUmakefile
+++ /dev/null
@@ -1,48 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/doc/man/macros/Attic/GNUmakefile,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-
-COMMONPREF = standard
-include $(ROOT)/usr/include/make/commondefs
-
-default headers headers_install libs libs_install install apps:
-
-distsi distoss:
- $(MAKE) $(COMMONPREF)$@
-
-$(COMMONTARGS): % : $(COMMONPREF)%
-
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/doc/man/macros/mkhead.awk b/xc/extras/ogl-sample/main/doc/man/macros/mkhead.awk
deleted file mode 100755
index 07f6ce39b..000000000
--- a/xc/extras/ogl-sample/main/doc/man/macros/mkhead.awk
+++ /dev/null
@@ -1,290 +0,0 @@
-# basename is set on the command line
-# The regexp below is replaced by an expression to do case insensitive
-# searching on the name of a GL function before running this program.
-#
-# Runs on 'gl.h' ('glu.h', 'glx.h') and locates the lines for the specified
-# GL (glu, glx) function, then generates M4 definitions for man page
-#
-BEGIN {
- found = 0
- numargs = 0
- newargs[0] = ""
- stderr = "cat 1>&2"
- vee = 0
- getnames(basename)
-
- for (j=0; j<numNames; j++)
- {
- rexpNames[j] = names[j] regExps[j]
- head[j] = ""
- numFound[j] = 0
- nargs[0] = 0
- }
-}
-
-/extern/ {
- cmdfield = 0;
- # search for the command string
- for (i = 3; i <= NF; i++)
- {
- name = $i;
- if (index(name,"gl") == 1)
- {
- cmdfield = i;
- # strip the gl, glu, or glX prefix
- # note that the X of glX is not stripped!
- if (index(name,"glu") == 1)
- name = substr(name,4);
- else
- name = substr(name,3);
- truename = name;
- break;
- }
- }
- if (cmdfield != 0) {
- for (i=0; i<numNames; i++)
- {
- if (name ~ rexpNames[i])
- { # Found one - $cmdfield is the name, $2 through $(cmdfield-1) is
- # the return type. The rest is the argument list.
- match(name,names[i])
- if ((RLENGTH != length(names[i])) || (match(name,rexpNames[i]) != 1))
- continue
- if (RLENGTH != length(name))
- continue
- cname = name
- names[i,numFound[i]] = truename
- p = index($0,"(")
- addargs(substr($0,p,length($0)-p-1),i) # Strips trailing semicolon
- typestr = $2
- for (j = 3; j < cmdfield; j++)
- {
- typestr = typestr " " $j
- }
- head[i] = head[i] makeHead(truename,typestr,i)
- numFound[i]++
- found++
- }
- }
- }
-}
-
-END {
- if (found == 0) {
- if (basename == "xintro") {
- numNames = 1;
- numFound[0] = 1;
- names[0,0] = "XIntro";
- }
- else if (basename == "intro") {
- numNames = 1;
- numFound[0] = 1;
- names[0,0] = "Intro";
- }
- else {
- printf "No GL call found that matches '%s'.\n", basename | stderr
- printf "Edit macros/mkhead.awk to add a special name.\n" | stderr
- }
- }
- printf "_define(_samething,@<.PP\n"
- printf "The above subroutines are functionally equivalent;\n"
- printf "they differ only in the specification of their parameters.\n"
- printf ">@)dnl\n"
-
- printf "_define(_header,@<dnl\n"
- printf "_setup()dnl\n"
- printf "_define(_cname,$1)dnl\n"
- printf ".TH %s$1 3G\n", prefix
- printf ".SH NAME\n"
- printf ".B \""
- for (i=0; i<numNames; i++)
- for (j=0; j<numFound[i]; j++)
- if ((i == (numNames-1)) && (j == (numFound[i]-1)))
- printf "%s%s\n", prefix, names[i,j]
- else
- printf "%s%s, ", prefix, names[i,j]
- printf "\\- $2\n"
- printf ">@)dnl\n"
-
- printf "_define(_names,@<dnl\n"
- printf "_ifelse($3,@<>@,.SH C SPECIFICATION\n)"
- printf "_ifelse("
- for (i=0; i<numNames; i++)
- {
- printf "_namenum,@<%d>@,@<%s>@,dnl\n",i,head[i]
- }
- printf "ERROR)dnl\n"
- printf "_define(@<_namenum>@,_incr(_namenum))>@)dnl\n"
-
-# if (found > 1)
-# {
-# printf "_samething()\n"
-# }
- maxArgs = 0
- for (i=0; i<numNames; i++)
- if (maxArgs < nargs[i])
- maxArgs = nargs[i]
- long = ""
- for (j=1; j<=maxArgs; j++)
- {
- printf "_define(_param%d,@<",j
- printf "_define(@<_tmpnum>@,_ifelse($#,0,_namenum,$1))dnl\n"
- printf "_ifelse("
- for (i=0; i<numNames; i++)
- {
- printf "_tmpnum,@<%d>@,\\f2%s\\fP,dnl\n",i+1,args[j,i]
- if (length(args[j,i]) > length(long))
- long = args[j,i]
- }
- printf "???)>@)dnl\n"
- }
-# next loop same as above, except does not italicize
-# resulting definitions can be used in equations
- for (j=1; j<=maxArgs; j++)
- {
- printf "_define(_eqnparam%d,@<",j
- printf "_define(@<_tmpnum>@,_ifelse($#,0,_namenum,$1))dnl\n"
- printf "_ifelse("
- for (i=0; i<numNames; i++)
- {
- printf "_tmpnum,@<%d>@,\"%s\",dnl\n",i+1,args[j,i]
- if (length(args[j,i]) > length(long))
- long = args[j,i]
- }
- printf "???)>@)dnl\n"
- }
-# The following stuff is designed to find the longest argument so that
-# the '.TP' indentation can be set in the first instaciation of _phead
-# (thus the use of the '_first' macro as a flag). Things are complicated
-# by the possibility of multiple arguments in the call to _phead.
-# This is what _makelist is for: to turn a space separted multiple
-# argument list into a comma separated one (commas can't be used in
-# the original list because they have special meaning to m4).
-# Unfortunately, this means that (currently) if the longest string is
-# a multiple argument, the indentation will only be right if it occurs
-# in the first _phead. This is because only the API file is scanned
-# for arguments, and not the man page file, so this script can't know
-# which instance of phead has the longest (multiple) argument.
-
- long = "\\fI" long "\\fP"
- printf "_define(_phead,@<dnl\n"
- printf "_ifdef(@<_first>@,@<.TP>@,@<.TP \\w'"
- printf "_ifelse(_eval(_len(%s)>_len(_makelist($1))),1,",long
- printf "%s,translit(_makelist($1),@<+>@,@<\\>@))\\ \\ 'u dnl\n", long
- printf "_define(_first,first)>@)\n"
- printf "translit(_makelist($1),@<+>@,@<,>@)>@)dnl\n"
- printf "_define(_cmnd,@<\\%%_ifelse($1,@<>@,\\f3" prefix "@<>@_cname\\fP,dnl\n"
- printf "\\f3" prefix "$1\\fP)>@)dnl\n"
- printf "_define(_glcmnd,@<_ifelse($1,@<>@,\\f3gl@<>@_cname\\fP,dnl\n"
- printf "\\f3gl$1\\fP)>@)dnl\n"
- printf "_define(_glucmnd,@<_ifelse($1,@<>@,\\f3glu@<>@_cname\\fP,dnl\n"
- printf "\\f3glu$1\\fP)>@)dnl\n"
- printf "_define(_xcmnd,@<_ifelse($1,@<>@,\\f3X@<>@_cname\\fP,dnl\n"
- printf "\\f3X$1\\fP)>@)dnl\n"
-# printf "syscmd(@<${maCdIr}/mkname.awk>@ ${maCdIr}/pglspec >_tmpnam)dnl\n"
-# printf "_include(_tmpnam)syscmd(rm -f _tmpnam)>@))dnl\n"
-}
-
-
-
-#
-# function to make the troff to typeset the function header
-#
-function makeHead(fname,type,i)
-{
- fname = prefix fname
- headString = sprintf("%s \\f3%s\\fP(",type,fname)
- if (numargs > 0)
- {
- headString = headString "\n"
- if (numargs > 1)
- {
- headString = headString sprintf("%s,\n",targs[1,i])
- headString = headString ".nf\n"
- headString = headString sprintf(".ta \\w'\\f3%s \\fP%s( 'u\n",type,fname)
- for (j=2; j<=numargs-1; j++)
- headString = headString sprintf("\t%s,\n",targs[j,i])
- headString = headString sprintf("\t%s )\n",targs[numargs,i])
- headString = headString ".fi\n"
- }
- else
- headString = headString sprintf("%s )\n.nf\n.fi\n",targs[numargs,i])
- }
- else
- headString = headString " void )\n.nf\n.fi\n"
- return headString
-}
-
-# Generates 'args' of untyped argument names
-# Also generates 'targs' of typed argument names and 'nargs', the number
-# of arguments.
-
-function addargs(arglist,i)
-{
-#
-# First strip leading '(' and trailing ')'
-#
- if (substr(arglist,1,1) == "(")
- arglist = substr(arglist,2,length(arglist))
- while (substr(arglist,1,1) == " ")
- arglist = substr(arglist,2,length(arglist))
-
- if (substr(arglist,length(arglist),1) == ")")
- arglist = substr(arglist,1,length(arglist)-1)
- while (substr(arglist,length(arglist),1) == " ")
- arglist = substr(arglist,1,length(arglist)-1)
-
- numargs = split(arglist,newargs, ",[ \t]")
- if (newargs[1] == "void")
- {
- numargs = 0;
- targs[1,i] = newargs[1];
- args[1,i] = newargs[1];
- }
- if (nargs[i] < numargs)
- nargs[i] = numargs;
-
- for (j=1; j<=numargs; j++)
- {
-# targs[j,i] italicizes the argument but not the type
- targs[j,i] = newargs[j]
- numWords = split(targs[j,i],words,"[ \t]")
- args[j,i] = words[numWords]
- targs[j,i] = words[1]
- for (k=2; k<=numWords-1; k++)
- targs[j,i] = targs[j,i] " " words[k]
- targs[j,i] = targs[j,i] " \\fI" words[numWords] "\\fP"
- sub(/\[.*\]/,"",args[j,i])
- gsub("[*()]","",args[j,i])
- }
-}
-
-#
-# Parse and save away the _names(name,regexp) declarations in the file
-# for later use in matching the entries in the API file.
-#
-
-function getnames(file)
-{
- numNames = 0
- fname = file ".gl"
- while (getline < fname)
- {
- if (index($0,"_names(") != 0)
- {
- start = index($0,"_names(") + 7
- stuff = substr($0,start,length($0)-start)
- split(stuff,things,",")
- names[numNames] = things[1]
- regExps[numNames] = things[2]
- numNames++
- }
- }
- close(fname)
- if (numNames == 0)
- {
- names[0] = file
- regExps[0] = "[1-9]*u*[lbsifd]*v*"
- numNames++
- }
-}
diff --git a/xc/extras/ogl-sample/main/doc/man/macros/mkhead.ftn.awk b/xc/extras/ogl-sample/main/doc/man/macros/mkhead.ftn.awk
deleted file mode 100755
index 669a41d8f..000000000
--- a/xc/extras/ogl-sample/main/doc/man/macros/mkhead.ftn.awk
+++ /dev/null
@@ -1,339 +0,0 @@
-# FORTRAN version
-#
-# Scans the source text for a manual page and locates "_names" macro
-# invocations. Looks up the names in gl.h (or glu.h or glx.h) and generates
-# definitions for the OpenGL m4 man page macros (_cmnd, _param1, etc.)
-# Extracts machine dependencies for the names and stores them in a file
-# for later inclusion in the man page. (See glman shell script.)
-#
-# basename, prefix, machdeps, and machdepsout are set on the command line.
-# The regexp below is replaced by an expression to do case insensitive
-# searching on the name of a GL function before running this program.
-#
-BEGIN {
- FS = " |\t|\\("
- basename = substr(basename,2,length(basename)-1) # strip leading 'f'
- prefix = "f" prefix
- found = 0
- numargs = 0
- newargs[0] = ""
- stderr = "cat 1>&2"
- vee = 0
- getnames("f" basename)
-
- for (j=0; j<numNames; j++)
- {
- rexpNames[j] = names[j] regExps[j]
- head[j] = ""
- numFound[j] = 0
- nargs[0] = 0
- }
-}
-
-/extern/ {
- cmdfield = 0;
- # search for the command string
- for (i = 3; i <= NF; i++)
- {
- name = $i;
- if (index(name,"gl") == 1)
- {
- cmdfield = i;
- # strip the gl, glu, or glX prefix
- if (index(name,"glu") == 1 || index(name,"glX") == 1)
- name = substr(name,4);
- else
- name = substr(name,3);
- truename = name;
- break;
- }
- }
- if (cmdfield != 0) {
- for (i=0; i<numNames; i++)
- {
- if (name ~ rexpNames[i])
- { # Found one - $cmdfield is the name, $2 through $(cmdfield-1) is
- # the return type. The rest is the argument list.
- match(name,names[i])
- if ((RLENGTH != length(names[i])) || (match(name,rexpNames[i]) != 1))
- continue
- if (RLENGTH != length(name))
- continue
- cname = name
- names[i,numFound[i]] = truename
- p = index($0,"(")
- addargs(substr($0,p,length($0)-p-1),i) # Strips trailing semicolon
- typestr = $2
- for (j = 3; j < cmdfield; j++)
- {
- typestr = typestr " " $j
- }
- head[i] = head[i] makeHead(truename,typestr,i)
- numFound[i]++
- found++
- }
- }
- }
-}
-
-END {
- if (found == 0) {
- if (basename == "glxintro") {
- numNames = 1;
- numFound[0] = 1;
- names[0,0] = "Intro";
- }
- else if (basename == "intro") {
- numNames = 1;
- numFound[0] = 1;
- names[0,0] = "Intro";
- }
- else {
- printf "No GL call found that matches '%s'.\n", basename | stderr
- printf "Edit macros/mkhead.awk to add a special name.\n" | stderr
- }
- }
- printf "_define(_samething,@<.PP\n"
- printf "The above subroutines are functionally equivalent;\n"
- printf "they differ only in the specification of their parameters.\n"
- printf ">@)dnl\n"
-
- printf "_define(_header,@<dnl\n"
- printf "_setup()dnl\n"
- printf "_define(_cname,$1)dnl\n"
- printf ".TH %s$1 \n", prefix
- printf ".SH NAME\n"
- printf ".B \""
- for (i=0; i<numNames; i++)
- for (j=0; j<numFound[i]; j++)
- if ((i == (numNames-1)) && (j == (numFound[i]-1)))
- printf "%s%s\n", prefix, names[i,j]
- else
- printf "%s%s, ", prefix, names[i,j]
- printf "\\- $2\n"
- printf ">@)dnl\n"
-
- printf "_define(_names,@<dnl\n"
- printf "_ifelse($3,@<>@,.SH FORTRAN SPECIFICATION\n)"
- printf "_ifelse("
- for (i=0; i<numNames; i++)
- {
- printf "_namenum,@<%d>@,@<%s>@,dnl\n",i,head[i]
- }
- printf "ERROR)dnl\n"
- printf "_define(@<_namenum>@,_incr(_namenum))>@)dnl\n"
-
-# Define the _machdeps macro to include the machine dependencies
-# extracted earlier:
-
- printf "_define(@<_machdeps>@,@<_sinclude(@<%s>@)>@)dnl\n", machdepsout
-
-# if (found > 1)
-# {
-# printf "_samething()\n"
-# }
- maxArgs = 0
- for (i=0; i<numNames; i++)
- if (maxArgs < nargs[i])
- maxArgs = nargs[i]
- long = ""
- for (j=1; j<=maxArgs; j++)
- {
- printf "_define(_param%d,@<",j
- printf "_define(@<_tmpnum>@,_ifelse($#,0,_namenum,$1))dnl\n"
- printf "_ifelse("
- for (i=0; i<numNames; i++)
- {
- printf "_tmpnum,@<%d>@,\\f2%s\\fP,dnl\n",i+1,args[j,i]
- if (length(args[j,i]) > length(long))
- long = args[j,i]
- }
- printf "???)>@)dnl\n"
- }
-# next loop same as above, except does not italicize
-# resulting definitions can be used in equations
- for (j=1; j<=maxArgs; j++)
- {
- printf "_define(_eqnparam%d,@<",j
- printf "_define(@<_tmpnum>@,_ifelse($#,0,_namenum,$1))dnl\n"
- printf "_ifelse("
- for (i=0; i<numNames; i++)
- {
- printf "_tmpnum,@<%d>@,\"%s\",dnl\n",i+1,args[j,i]
- if (length(args[j,i]) > length(long))
- long = args[j,i]
- }
- printf "???)>@)dnl\n"
- }
-# The following stuff is designed to find the longest argument so that
-# the '.TP' indentation can be set in the first instaciation of _phead
-# (thus the use of the '_first' macro as a flag). Things are complicated
-# by the possibility of multiple arguments in the call to _phead.
-# This is what _makelist is for: to turn a space separted multiple
-# argument list into a comma separated one (commas can't be used in
-# the original list because they have special meaning to m4).
-# Unfortunately, this means that (currently) if the longest string is
-# a multiple argument, the indentation will only be right if it occurs
-# in the first _phead. This is because only the API file is scanned
-# for arguments, and not the man page file, so this script can't know
-# which instance of phead has the longest (multiple) argument.
-
- long = "\\fI" long "\\fP"
- printf "_define(_phead,@<dnl\n"
- printf "_ifdef(@<_first>@,@<.TP>@,@<.TP \\w'"
- printf "_ifelse(_eval(_len(%s)>_len(_makelist($1))),1,",long
- printf "%s,translit(_makelist($1),@<+>@,@<\\>@))\\ \\ 'u dnl\n", long
- printf "_define(_first,first)>@)\n"
- printf "translit(_makelist($1),@<+>@,@<,>@)>@)dnl\n"
- printf "_define(_cmnd,@<_ifelse($1,@<>@,\\f3" prefix "@<>@_cname\\fP,dnl\n"
- printf "\\f3" prefix "$1\\fP)>@)dnl\n"
- printf "_define(_glcmnd,@<_ifelse($1,@<>@,\\f3gl@<>@_cname\\fP,dnl\n"
- printf "\\f3gl$1\\fP)>@)dnl\n"
- printf "_define(_glucmnd,@<_ifelse($1,@<>@,\\f3glu@<>@_cname\\fP,dnl\n"
- printf "\\f3glu$1\\fP)>@)dnl\n"
- printf "_define(_xcmnd,@<_ifelse($1,@<>@,\\f3X@<>@_cname\\fP,dnl\n"
- printf "\\f3X$1\\fP)>@)dnl\n"
-# printf "syscmd(@<${maCdIr}/mkname.awk>@ ${maCdIr}/pglspec >_tmpnam)dnl\n"
-# printf "_include(_tmpnam)syscmd(rm -f _tmpnam)>@))dnl\n"
-}
-
-
-
-#
-# function to make the troff to typeset the function header
-#
-function makeHead(fname,type,i)
-{
- fname = prefix fname
- headString = sprintf("%s \\f3%s\\fP(",fortranize(type,0),fname)
- if (numargs > 0)
- {
- headString = headString "\n"
- if (numargs > 1)
- {
- headString = headString sprintf("%s,\n",fortranize(targs[1,i],1))
- headString = headString ".nf\n"
- headString = headString sprintf(".ta \\w'\\f3%s \\fP%s( 'u\n",fortranize(type,0),fname)
- for (j=2; j<=numargs-1; j++)
- headString = headString sprintf("\t%s,\n",fortranize(targs[j,i],1))
- headString = headString sprintf("\t%s )\n",fortranize(targs[numargs,i],1))
- headString = headString ".fi\n"
- }
- else
- headString = headString sprintf("%s )\n.nf\n.fi\n",fortranize(targs[numargs,i],1))
- }
- else
- headString = headString " )\n.nf\n.fi\n"
- return headString
-}
-
-
-# Convert a gl C type to the FORTRAN equivalent
-# If flag = 1, then convert a function argument;
-# else, convert a function return type.
-
-function fortranize(typedArg,flag)
-{
- item = typedArg;
- if (flag == 0) { # return type
- sub(/void/,"SUBROUTINE",item)
- }
- # function argument or return type
- if (item ~ /\*/) {
- sub(/\*/,"",item);
- sub(/const /,"",item)
- if (item ~ /GLubyte/)
- sub(/GLubyte/,"CHARACTER*256",item)
- else
- sub(/GL[^ ]*/,"CHARACTER*8",item)
- }
- else {
- sub(/GLu*byte/,"INTEGER*1",item)
- sub(/GLu*short/,"INTEGER*2",item)
- sub(/GLu*int/,"INTEGER*4",item)
- sub(/GLsizei/,"INTEGER*4",item)
- sub(/GLfloat/,"REAL*4",item)
- sub(/GLclampf/,"REAL*4",item)
- sub(/GLdouble/,"REAL*8",item)
- sub(/GLclampd/,"REAL*4",item)
- sub(/GLboolean/,"LOGICAL*1",item)
- sub(/GLenum/,"INTEGER*4",item)
- sub(/GLbitfield/,"INTEGER*4",item)
- }
- return item
-}
-
-
-# Generates 'args' of untyped argument names
-# Also generates 'targs' of typed argument names and 'nargs', the number
-# of arguments.
-
-function addargs(arglist,i)
-{
-#
-# First strip leading '(' and trailing ')'
-#
- if (substr(arglist,1,1) == "(")
- arglist = substr(arglist,2,length(arglist))
- while (substr(arglist,1,1) == " ")
- arglist = substr(arglist,2,length(arglist))
-
- if (substr(arglist,length(arglist),1) == ")")
- arglist = substr(arglist,1,length(arglist)-1)
- while (substr(arglist,length(arglist),1) == " ")
- arglist = substr(arglist,1,length(arglist)-1)
-
- numargs = split(arglist,newargs, ",[ \t]")
- if (newargs[1] == "void")
- {
- numargs = 0;
- targs[1,i] = newargs[1];
- args[1,i] = newargs[1];
- }
- if (nargs[i] < numargs)
- nargs[i] = numargs;
-
- for (j=1; j<=numargs; j++)
- {
-# targs[j,i] italicizes the argument but not the type
- targs[j,i] = newargs[j]
- numWords = split(targs[j,i],words,"[ \t]")
- args[j,i] = words[numWords]
- targs[j,i] = words[1]
- for (k=2; k<=numWords-1; k++)
- targs[j,i] = targs[j,i] " " words[k]
- targs[j,i] = targs[j,i] " \\fI" words[numWords] "\\fP"
- sub(/\[.*\]/,"",args[j,i])
- gsub("[*()]","",args[j,i])
- }
-}
-
-#
-# Parse and save away the _names(name,regexp) declarations in the file
-# for later use in matching the entries in the API file.
-#
-
-function getnames(file)
-{
- numNames = 0
- fname = file ".gl"
- while (getline < fname)
- {
- if (index($0,"_names(") != 0)
- {
- start = index($0,"_names(") + 7
- stuff = substr($0,start,length($0)-start)
- split(stuff,things,",")
- names[numNames] = things[1]
- regExps[numNames] = things[2]
- numNames++
- }
- }
- close(fname)
- if (numNames == 0)
- {
- names[0] = file
- regExps[0] = "[1-9]*u*[lbsifd]*v*"
- numNames++
- }
-}
diff --git a/xc/extras/ogl-sample/main/doc/man/macros/setup b/xc/extras/ogl-sample/main/doc/man/macros/setup
deleted file mode 100755
index 74a69369c..000000000
--- a/xc/extras/ogl-sample/main/doc/man/macros/setup
+++ /dev/null
@@ -1,36 +0,0 @@
-define(`_define',defn(`define'))dnl
-define(`_ifdef',defn(`ifdef'))dnl
-define(`_ifelse',defn(`ifelse'))dnl
-define(`_eval',defn(`eval'))dnl
-define(`_len',defn(`len'))dnl
-define(`_incr',defn(`incr'))dnl
-changecom()dnl
-define(`_C_',defn(`dnl'))dnl
-undefine(`define')undefine(`ifdef')dnl
-undefine(`shift')undefine(`divert')undefine(`incr')dnl
-undefine(`decr')undefine(`eval')undefine(`len')undefine(`index')dnl
-undefine(`substr')undefine(`include')dnl
-changequote(@<,>@)dnl
-_define(_makelist,@<_dolist(translit($1,@< >@,@<,>@))>@)dnl
-_define(_dolist,@<dnl
-_ifelse($#,1,$1,$#,2,$1@<+ >@$2,$#,3,$1@<+ >@$2@<+ >@$3,$#,dnl
-4,$1@<+ >@$2@<+ >@$3@<+ >@$4)>@)dnl
-_define(_namenum,@<0>@)dnl
-_define(_tmpnam,maketemp)dnl
-_define(_const,@<\%\f3GL_$1\fP>@)dnl
-_define(_arbconst,@<\%\f3GL_$1_ARB\fP>@)dnl
-_define(_arbconstidx,@<\%\f3GL_$1\fP$i$\f3_ARB\fP>@)dnl
-_define(_xconst,@<\%\f3$1\fP>@)dnl
-_define(_extname,@<\%\f3$1\fP>@)dnl
-_define(_arbstring,@<\%\f3GL_ARB_$1\fP>@)dnl
-_define(_extstring,@<\%\f3GL_$1\fP>@)dnl
-_define(_glxextstring,@<\%\f3GLX_$1\fP>@)dnl
-_define(_glxconst,@<\%\f3GLX_$1\fP>@)dnl
-_define(_glxerror,@<\%\f3GLX$1\fP>@)dnl
-_define(_gluconst,@<\%\f3GLU_$1\fP>@)dnl
-_define(_econst,@<bold \%GL_$1>@)dnl
-_define(_hex,@<\%0x$1>@)dnl
-_define(_setup,@<_ifdef(@<_filters>@,@<'\"! _filters() | mmdoc
->@)dnl
-'\"macro stdmacro
->@)dnl
diff --git a/xc/extras/ogl-sample/main/doc/man/macros/setup.ftn b/xc/extras/ogl-sample/main/doc/man/macros/setup.ftn
deleted file mode 100755
index b7ed065e9..000000000
--- a/xc/extras/ogl-sample/main/doc/man/macros/setup.ftn
+++ /dev/null
@@ -1,31 +0,0 @@
-define(`_define',defn(`define'))dnl
-define(`_ifdef',defn(`ifdef'))dnl
-define(`_ifelse',defn(`ifelse'))dnl
-define(`_eval',defn(`eval'))dnl
-define(`_len',defn(`len'))dnl
-define(`_incr',defn(`incr'))dnl
-define(`_sinclude',defn(`sinclude'))dnl
-changecom()dnl
-define(`_C_',defn(`dnl'))dnl
-undefine(`define')undefine(`ifdef')dnl
-undefine(`shift')undefine(`divert')undefine(`incr')dnl
-undefine(`decr')undefine(`eval')undefine(`len')undefine(`index')dnl
-undefine(`substr')undefine(`include')undefine(`sinclude')dnl
-changequote(@<,>@)dnl
-_define(_makelist,@<_dolist(translit($1,@< >@,@<,>@))>@)dnl
-_define(_dolist,@<dnl
-_ifelse($#,1,$1,$#,2,$1@<+ >@$2,$#,3,$1@<+ >@$2@<+ >@$3,$#,dnl
-4,$1@<+ >@$2@<+ >@$3@<+ >@$4)>@)dnl
-_define(_namenum,@<0>@)dnl
-_define(_tmpnam,maketemp)dnl
-_define(_const,@<\f3GL_$1\fP>@)dnl
-_define(_xconst,@<\f3$1\fP>@)dnl
-_define(_glxconst,@<\f3GLX_$1\fP>@)dnl
-_define(_glxerror,@<\f3GLX$1\fP>@)dnl
-_define(_gluconst,@<\f3GLU_$1\fP>@)dnl
-_define(_econst,@<bold GL_$1>@)dnl
-_define(_hex,@<@<$>@$1>@)dnl
-_define(_setup,@<_ifdef(@<_filters>@,@<'\"! _filters() | mmdoc
->@)dnl
-'\"macro stdmacro
->@)dnl
diff --git a/xc/extras/ogl-sample/main/doc/man/mandefs b/xc/extras/ogl-sample/main/doc/man/mandefs
deleted file mode 100755
index 667de92e1..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mandefs
+++ /dev/null
@@ -1,183 +0,0 @@
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/doc/man/Attic/mandefs,v 1.1.1.1 2001/03/19 17:45:27 dawes Exp $
-
-# Common definitions for man page Makefiles
-
-MMDOC = sh -x $(DEPTH)/tools/mmdoc
-MPATH = $(DEPTH)/macros
-GETNAMES = awk -f $(DEPTH)/tools/getnames
-ADDINST = awk -f $(DEPTH)/tools/addinst
-MAN2HTML = $(DEPTH)/tools/man2html
-
-# Global version and (published) date values for man page footers. Can override
-# for a particular directory by reassigning after the inclusion of mandefs.
-VERSION = Version 1.0
-DATE = June 1991
-
-#
-# directories - these may exist under some or all of the man sections
-# and correspond to option man pages
-# we list them all here once
-
-OPTIONS = standard nfs dwb trans ftn emacs pascal pl1 5080 ada t3270 pfa diags \
- x11 xt noship sna sna_3770 sna_3270 sna_server sna_lu6.2 spaceball \
- x25 netvis netman softpc c++ sna_lu0-3 bsdlpr 4DDN dgl gpib slip \
- nonstandard libil pca t3270dft vc nqs seiko5500 vfr bvo tcp3270 \
- smt sqa fddi fddivis cc cmplrs dbx edge ld efast cdrom gltools \
- moregltools imagetools gldebug libsphere
-
-# Change /pubs/tools symbolic name to $(MPATH) in .so's
-FIXPUBS = sed 's:^\.so[ ]*/pubs/tools/:.so $(MPATH)/:'
-
-# script to translate the first line of the manpage
-# from '\"! tbl | eqn | mmdoc
-# to '\" t e
-# which is what the linux man command needs.
-
-ifeq ($(OS),Linux)
-FIXROFF = awk '/\\\"!/ { gsub(/!/, ""); \
- gsub(/eqn/, "e"); \
- gsub(/tbl/, "t"); \
- gsub(/mmdoc/, ""); \
- gsub(/\|/, ""); print $0; next; } { print $0; }'
-else
-FIXROFF = cat
-endif
-
-# Convert .TH lines to all uppercase when making online pages (mostly
-# for GL man pages). If line is .TH \*(}x, don't uppercase it.
-THTOUPPER = \
- sed '/^\.TH[^}]*$$/y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'
-
-# Add string definitions containing VERSION, DATE, and RELEASE (only
-# the portion after the "-", if it exists) to man page input. Also
-# define strings with print date (i.e. "now"), last modified date of
-# input file, and result of "sum <input file>".
-ADDSTRINGS = awk 'BEGIN { \
- first = 1; \
- if (split("$(RELEASE)", r, "-") > 1) \
- release = r[2]; \
- else \
- release="$(RELEASE)"; \
- } \
- first == 1 && $$0 !~ /^'"'"'\\"/ { \
- print ".ds Vn $(VERSION)"; \
- print ".ds Dt $(DATE)"; \
- print ".ds Re Release", release; \
- print ".ds Dp '"`date '+%b %d %H:%M'`"'"; \
- print ".ds Dm '"`ls -l $< | cut -c42-53`"'"; \
- print ".ds Xs '"`sum $<`"'"; \
- first = 0; \
- } \
- { print }'
-
-# If page doesn't start with a magic '\", add a default one.
-ADDMAGIC = ( case `head -1 $<` in \
- "'\\\""*) cat $< ;; \
- _*) $(DEPTH)/tools/glman $(PREFIX) $(DEPTH) $< $(APIFILE) $(M4OPTS) ;; \
- *) echo "'\\\"macro stdmacro" ; cat $< ;; \
- esac ) | $(FIXPUBS) | $(ADDSTRINGS) | $(FIXROFF)
-
-# If GL page starts '\"!, second line is assumed to contain '\"macro stdmacro,
-# and it is changed to '\"macro mn; if page doesn't start with '\",
-# '\"macro mn is added (if it's not there already). Only use the "mn"
-# macros for hardcopy; online man pages use stdmacro like all other man pages.
-ADDGLMAGIC = ( case `head -1 $<` in \
- "'\\\"macro mn") cat $< ;; \
- "'\\\""!*) sed '2 s/stdmacro/mn/' $< ;; \
- _*) $(DEPTH)/tools/glman $(PREFIX) $(DEPTH) $< $(APIFILE) $(M4OPTS) ;; \
- *) echo "'\\\"macro mn" ; cat $< ;; \
- esac ) | $(FIXPUBS) | $(ADDSTRINGS)
-
-RUNMMDOC = TMMACRO=$(MPATH) PATH=$(DEPTH)/tools:$$PATH \
- OTHERFILES="$(MPATH)/Op $(LANGOPT) $(MPATH)/localmacs" \
- $(MMDOC) $(MMFLAGS)
-
-
-LEGALBASE = [0-z+,%-]*#
-LEGALSUF1 = [1-7]#
-LEGALSUF2 = [1-7][a-z]#
-LEGALSUF3 = [1-7]X11#
-LEGALSUF4 = [1-7]Xt#
-LEGALNAME1 = $(LEGALBASE).$(LEGALSUF1)#
-LEGALNAME2 = $(LEGALBASE).$(LEGALSUF2)#
-LEGALNAME3 = $(LEGALBASE).$(LEGALSUF3)#
-LEGALNAME4 = $(LEGALBASE).$(LEGALSUF4)#
-LISTLEGAL = find . \( -name '$(LEGALNAME1)' -o -name '$(LEGALNAME2)' \
- -o -name '$(LEGALNAME3)' -o -name '$(LEGALNAME4)' \) -print | \
- sed -e 's/^..//' -e '/\//d'
-
-#
-# The following defintions are release-note specific.
-#
-
-# File that should be included before each chapter is formatted
-CHAPHEAD = Templates/cFront
-
-# Files that should be included before each appendix is formatted
-APPDXHEAD = Templates/cFront Templates/aFront
-
-# Between start and end put file names for generating
-# the TC files in the right order.
-
-BASE = ch*#
-CHAPSUF = cmm#
-APPSUF = amm#
-
-LEGALCHAP = $(BASE).$(CHAPSUF)
-LEGALAPP = $(BASE).$(APPSUF)
-RELNOTES = find . \( -name '$(LEGALCHAP)' -o -name '$(LEGALAPP)' \) -print | \
- sed -e 's/^..//' -e '/\//d' | sort
-
-TCFILES = ToC/TC.start ToC/ch*.TC ToC/TC.end
-
-MMFILES = `$(RELNOTES)`
-
-IXFILES = Index/ch*.IX
-
-CHAP_PP = pic $(CHAPHEAD) $? | tbl
-APP_PP = pic $(APPDXHEAD) $? | tbl
-
-# these should to be macros, so they can be overridden
-PSVIEWOPTS = -F1.2 -0,2-6,11
-PSVIEW = psview
-# this scale and geom works to show 6x9 pages on a 1280x1024
-# display.
-XPSVIEWOPTS = -wp -skipc -sc 1.1 -geom 660x1020 -
-XPSVIEW = xpsview
-
-# this can be used under X for previewing
-DITVIEW = xditview -geom 640x950 -
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/GNUmakefile b/xc/extras/ogl-sample/main/doc/man/mangl/GNUmakefile
deleted file mode 100755
index 08e5597f2..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/GNUmakefile
+++ /dev/null
@@ -1,53 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-
-COMMONPREF = standard
-include $(ROOT)/usr/include/make/commondefs
-
-SUBDIRS = \
- standard \
- ftn \
- html \
- html_ftn \
- $(NULL)
-
-default $(ALLTARGS): $(_FORCE)
- $(SUBDIRS_MAKERULE)
-
-distoss:
- $(MAKE) $(COMMONPREF)$@
- $(SUBDIRS_MAKERULE)
-
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/README b/xc/extras/ogl-sample/main/doc/man/mangl/README
deleted file mode 100755
index 3a49cdc14..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/README
+++ /dev/null
@@ -1,93 +0,0 @@
-This directory has GL man pages.
-
-./style gives some style guidelines.
-
-./template is a template that can be used as a starting point
- when writing new man pages.
-
-./standard contains man page source and a Makefile for making
- various targets using nroff and troff. The suffix
- for man page source in this directory is '.gl'.
-
-Two awk scripts and m4 are run over GL man page source before it is
-processed in the same way that standard man pages are. This allows
-a writer to avoid most annoying troff'isms.
- Several macros are provided to simplify man page writing. These
-are:
-
-_header(name,desc)
- Gives the name of the command to be used at the
- top and bottom of the man page and in the _cmnd macro
- (below). Also give the one line description of the
- command.
-
-_names(base,regexp)
-_names(base,regexp,noheader)
- Generates the 'C SPECIFICATIONS' for all forms of
- a command with the indicated base name and an
- extension matching the given regular expression.
- This is done by using the name and expression to search the
- known GL commands. A function header is generated for
- each matching command. The second form of the command,
- with a third argument (any argument will do) suppresses
- the generation of the 'C SPECIFICATION' section heading
- for the matched names (useful when a single man page
- describes diverse commands).
-
-_cmnd Without an argument, generates the correctly prefixed and
-_cmnd(arg) capitalized base command name. Use \& (troff zero-width
- space) to separate it from immediately following letters,
- digits, underscores or parentheses. With an argument, it
- generates the prefixed command name (currently the argument
- is not matched against the known GL commands).
- The command is automatically emboldened.
-
-_param<i> Generates the italicized <i>th parameter to the command.
-_param<i>(n) Without an argument, it gets the <i>th argument to forms
- of the command matching the last _names() invocation.
- With an argument, gives the <i>th argument to forms of
- the command matching the nth _names() invocation.
-
-_eqnparam<i> Same as _param, but does not italicize, and can therefore
-_eqnparam<i>(n) be used in equations.
-
-_phead(param) Used when generating a parameter description of 'param'.
- Parameter description immediately follows.
-
-_const(arg) Generates a prefixed and emboldened GL constant 'arg'.
-_econst(arg) Same as _const but for use inside equations.
-
-_hex(arg) Generates "0x'arg'".
-
-_C_ Comment; everything following up to and including the next
- newline is ignored
-
-_define define an M4 macro. See the M4 man page. Most of the
- M4 macros having common names that could clash with words
- in the text have been undefined or redefined to have
- underscores preceeding their names. Be sure to use _C_
- (or M4's 'dnl') at the end of a macro definition to
- avoid extraneous newlines in the troff source.
-
-If '_filters' is defined before the use of '_header' (see the template
-for an example that is commented out) then the processed text is run
-through the shell commands given in '_filters' just before being sent to
-troff. Useful when tables or equations appear in the text.
-
-Two standard macros may be redefined in special situations. '_basename'
-is the base command name. Normally it is set to the filename of the
-man page being generated, sans suffix, and appears in the banner on
-every page of the man page. 'gl' is automatically prepended to this
-name. '_samething' is the message to be printed when there are
-multiple commands under the same heading. See the template for
-commented out examples.
-
-Troff macro names .BR and .BP appear in various manpages. These are
-placeholders for .br and .bp macros that were added for the Addison
-Wesley publication, but are not valid for other printings. Since these
-macros are not defined anywhere, they are ignored by troff/nroff.
-
-A final and important note: the file MUST begin with an '_'
-(probably as in '_header' or '_define(_filters,...)_C_) or
-the aforementioned processing will not be applied and you will
-be obliged to use the frightful standard man page troff constructs.
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/ftn/Distfile b/xc/extras/ogl-sample/main/doc/man/mangl/ftn/Distfile
deleted file mode 100755
index b862546bd..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/ftn/Distfile
+++ /dev/null
@@ -1,142 +0,0 @@
-#
-#
-
-DISTDIR_SI = /xc/doc/man/GL/gl_ftn
-
-DISTFILES_SI = \
- Imakefile \
- fglaccum.3gl \
- fglalphafunc.3gl \
- fglaretexturesresident.3gl \
- fglarrayelement.3gl \
- fglbegin.3gl \
- fglbindtexture.3gl \
- fglbitmap.3gl \
- fglblendfunc.3gl \
- fglcalllist.3gl \
- fglcalllists.3gl \
- fglclear.3gl \
- fglclearaccum.3gl \
- fglclearcolor.3gl \
- fglcleardepth.3gl \
- fglclearindex.3gl \
- fglclearstencil.3gl \
- fglclipplane.3gl \
- fglcolor.3gl \
- fglcolormask.3gl \
- fglcolormaterial.3gl \
- fglcolorpointer.3gl \
- fglcopypixels.3gl \
- fglcopyteximage1d.3gl \
- fglcopyteximage2d.3gl \
- fglcopytexsubimage1d.3gl \
- fglcopytexsubimage2d.3gl \
- fglcullface.3gl \
- fgldeletelists.3gl \
- fgldeletetextures.3gl \
- fgldepthfunc.3gl \
- fgldepthmask.3gl \
- fgldepthrange.3gl \
- fgldrawarrays.3gl \
- fgldrawbuffer.3gl \
- fgldrawelements.3gl \
- fgldrawpixels.3gl \
- fgledgeflag.3gl \
- fgledgeflagpointer.3gl \
- fglenable.3gl \
- fglenableclientstate.3gl \
- fglevalcoord.3gl \
- fglevalmesh.3gl \
- fglevalpoint.3gl \
- fglfeedbackbuffer.3gl \
- fglfinish.3gl \
- fglflush.3gl \
- fglfog.3gl \
- fglfrontface.3gl \
- fglfrustum.3gl \
- fglgenlists.3gl \
- fglgentextures.3gl \
- fglget.3gl \
- fglgetclipplane.3gl \
- fglgeterror.3gl \
- fglgetlight.3gl \
- fglgetmap.3gl \
- fglgetmaterial.3gl \
- fglgetpixelmap.3gl \
- fglgetpointerv.3gl \
- fglgetpolygonstipple.3gl \
- fglgetstring.3gl \
- fglgettexenv.3gl \
- fglgettexgen.3gl \
- fglgetteximage.3gl \
- fglgettexlevelparameter.3gl \
- fglgettexparameter.3gl \
- fglhint.3gl \
- fglindex.3gl \
- fglindexmask.3gl \
- fglindexpointer.3gl \
- fglinitnames.3gl \
- fglinterleavedarrays.3gl \
- fglisenabled.3gl \
- fglislist.3gl \
- fglistexture.3gl \
- fgllight.3gl \
- fgllightmodel.3gl \
- fgllinestipple.3gl \
- fgllinewidth.3gl \
- fgllistbase.3gl \
- fglloadidentity.3gl \
- fglloadmatrix.3gl \
- fglloadname.3gl \
- fgllogicop.3gl \
- fglmap1.3gl \
- fglmap2.3gl \
- fglmapgrid.3gl \
- fglmaterial.3gl \
- fglmatrixmode.3gl \
- fglmultmatrix.3gl \
- fglnewlist.3gl \
- fglnormal.3gl \
- fglnormalpointer.3gl \
- fglortho.3gl \
- fglpassthrough.3gl \
- fglpixelmap.3gl \
- fglpixelstore.3gl \
- fglpixeltransfer.3gl \
- fglpixelzoom.3gl \
- fglpointsize.3gl \
- fglpolygonmode.3gl \
- fglpolygonoffset.3gl \
- fglpolygonstipple.3gl \
- fglprioritizetextures.3gl \
- fglpushattrib.3gl \
- fglpushclientattrib.3gl \
- fglpushmatrix.3gl \
- fglpushname.3gl \
- fglrasterpos.3gl \
- fglreadbuffer.3gl \
- fglreadpixels.3gl \
- fglrect.3gl \
- fglrendermode.3gl \
- fglrotate.3gl \
- fglscale.3gl \
- fglscissor.3gl \
- fglselectbuffer.3gl \
- fglshademodel.3gl \
- fglstencilfunc.3gl \
- fglstencilmask.3gl \
- fglstencilop.3gl \
- fgltexcoord.3gl \
- fgltexcoordpointer.3gl \
- fgltexenv.3gl \
- fgltexgen.3gl \
- fglteximage1d.3gl \
- fglteximage2d.3gl \
- fgltexparameter.3gl \
- fgltexsubimage1d.3gl \
- fgltexsubimage2d.3gl \
- fgltranslate.3gl \
- fglvertex.3gl \
- fglvertexpointer.3gl \
- fglviewport.3gl \
- $(NULL)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/ftn/GNUmakefile b/xc/extras/ogl-sample/main/doc/man/mangl/ftn/GNUmakefile
deleted file mode 100755
index c913364cb..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/ftn/GNUmakefile
+++ /dev/null
@@ -1,100 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-
-# NOTES:
-# - The file "lor-c.mn" contains the source for the List of Routines section
-# of the C edition of the GL Reference Guide. The usual targets
-# lor-c.p, lor-c.ps, and lor-c.psv exist for it; however, it does not have
-# a .3g suffix because we don't want to include it as a on-line man page.
-# The file should be generated!!!
-
-COMMONPREF = standard
-include $(ROOT)/usr/include/make/commondefs
-
-DEPTH = ../..
-LANGOPT = f
-PREFIX = gl
-IDB_PATH = /usr/catman/g_man/cat3/standard
-
-MANPREF = man
-include $(DEPTH)/mandefs
-
-APIFILE = $(ROOT)/usr/include/GL/gl.h
-
-VERSION = Version 1.2
-DATE = 10 Nov 1998
-RELEASE = 1.0
-MMFLAGS = -rs2
-
-LEGALSUF1 = gl#
-LEGALSUF2 = gl#
-LEGALSUF3 = gl#
-LEGALSUF4 = gl#
-
-LOCALPRINTLISTFILTER = | sed -e '/^intro\.p$$/d' | (echo intro.p ; cat )
-
-default:
- $(MAKE) links
- $(MAKE) manpages
-
-headers headers_install libs libs_install install apps:
-
-distsi: default
- $(MAKE) $(COMMONPREF)$@
-
-distoss:
- $(MAKE) $(COMMONPREF)$@
-
-links:
- cd ../standard ; \
- for i in *.gl ; do \
- ( cd ../ftn ; if test ! -L fgl$$i ; then \
- /bin/ln -s ../standard/$$i fgl$$i; fi ); \
- done
-
-manpages: $(patsubst %.gl,%.3gl,$(wildcard *.gl))
-
-const.diff: const.awk *.gl $(ROOT)/usr/include/GL/gl.h
- awk -f const.awk $(ROOT)/usr/include/GL/gl.h *.gl | \
- sort | uniq > const.diff
-
-clean:
- rm -f *.gl
-
-clobber: clean
- rm -f *.3gl
-
-include $(DEPTH)/manrules
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/ftn/Imakefile b/xc/extras/ogl-sample/main/doc/man/mangl/ftn/Imakefile
deleted file mode 100755
index 2ccc9c282..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/ftn/Imakefile
+++ /dev/null
@@ -1,874 +0,0 @@
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-#ifdef ManPageAlias
-#undef ManPageAlias
-#endif
-#define ManPageAlias(file,destdir,alias) @@\
-alias.$(MANSUFFIX): file.$(MANSUFFIX) @@\
- echo .so `basename destdir`/file.$(MANSUFFIX) > alias.$(MANSUFFIX) @@\
-
-MANSUFFIX = 3gl
-
-MAN_PAGES = \
-fglAccum.$(MANSUFFIX) fglAlphaFunc.$(MANSUFFIX) \
-fglAreTexturesResident.$(MANSUFFIX) fglArrayElement.$(MANSUFFIX) \
-fglBegin.$(MANSUFFIX) fglBindTexture.$(MANSUFFIX) \
-fglBitmap.$(MANSUFFIX) fglBlendColorEXT.$(MANSUFFIX) \
-fglBlendFunc.$(MANSUFFIX) fglCallList.$(MANSUFFIX) \
-fglCallLists.$(MANSUFFIX) fglClear.$(MANSUFFIX) \
-fglClearAccum.$(MANSUFFIX) fglClearColor.$(MANSUFFIX) \
-fglClearDepth.$(MANSUFFIX) fglClearIndex.$(MANSUFFIX) \
-fglClearStencil.$(MANSUFFIX) fglClipPlane.$(MANSUFFIX) \
-fglColor3b.$(MANSUFFIX) fglColor3bv.$(MANSUFFIX) \
-fglColor3d.$(MANSUFFIX) fglColor3dv.$(MANSUFFIX) \
-fglColor3f.$(MANSUFFIX) fglColor3fv.$(MANSUFFIX) \
-fglColor3i.$(MANSUFFIX) fglColor3iv.$(MANSUFFIX) \
-fglColor3s.$(MANSUFFIX) fglColor3sv.$(MANSUFFIX) \
-fglColor3ub.$(MANSUFFIX) fglColor3ubv.$(MANSUFFIX) \
-fglColor3ui.$(MANSUFFIX) fglColor3uiv.$(MANSUFFIX) \
-fglColor3us.$(MANSUFFIX) fglColor3usv.$(MANSUFFIX) \
-fglColor4b.$(MANSUFFIX) fglColor4bv.$(MANSUFFIX) \
-fglColor4d.$(MANSUFFIX) fglColor4dv.$(MANSUFFIX) \
-fglColor4f.$(MANSUFFIX) fglColor4fv.$(MANSUFFIX) \
-fglColor4i.$(MANSUFFIX) fglColor4iv.$(MANSUFFIX) \
-fglColor4s.$(MANSUFFIX) fglColor4sv.$(MANSUFFIX) \
-fglColor4ub.$(MANSUFFIX) fglColor4ubv.$(MANSUFFIX) \
-fglColor4ui.$(MANSUFFIX) fglColor4uiv.$(MANSUFFIX) \
-fglColor4us.$(MANSUFFIX) fglColor4usv.$(MANSUFFIX) \
-fglColorMask.$(MANSUFFIX) fglColorMaterial.$(MANSUFFIX) \
-fglColorPointer.$(MANSUFFIX) fglCopyPixels.$(MANSUFFIX) \
-fglCopyTexImage1D.$(MANSUFFIX) fglCopyTexImage2D.$(MANSUFFIX) \
-fglCopyTexSubImage1D.$(MANSUFFIX) fglCopyTexSubImage2D.$(MANSUFFIX) \
-fglCullFace.$(MANSUFFIX) fglDeleteLists.$(MANSUFFIX) \
-fglDeleteTextures.$(MANSUFFIX) fglDepthFunc.$(MANSUFFIX) \
-fglDepthMask.$(MANSUFFIX) fglDepthRange.$(MANSUFFIX) \
-fglDisable.$(MANSUFFIX) fglDisableClientState.$(MANSUFFIX) \
-fglDrawArrays.$(MANSUFFIX) fglDrawBuffer.$(MANSUFFIX) \
-fglDrawElements.$(MANSUFFIX) fglDrawPixels.$(MANSUFFIX) \
-fglEdgeFlag.$(MANSUFFIX) fglEdgeFlagPointer.$(MANSUFFIX) \
-fglEdgeFlagv.$(MANSUFFIX) fglEnable.$(MANSUFFIX) \
-fglEnableClientState.$(MANSUFFIX) fglEnd.$(MANSUFFIX) \
-fglEndList.$(MANSUFFIX) fglEvalCoord1d.$(MANSUFFIX) \
-fglEvalCoord1dv.$(MANSUFFIX) fglEvalCoord1f.$(MANSUFFIX) \
-fglEvalCoord1fv.$(MANSUFFIX) fglEvalCoord2d.$(MANSUFFIX) \
-fglEvalCoord2dv.$(MANSUFFIX) fglEvalCoord2f.$(MANSUFFIX) \
-fglEvalCoord2fv.$(MANSUFFIX) fglEvalMesh1.$(MANSUFFIX) \
-fglEvalMesh2.$(MANSUFFIX) fglEvalPoint1.$(MANSUFFIX) \
-fglEvalPoint2.$(MANSUFFIX) fglFeedbackBuffer.$(MANSUFFIX) \
-fglFinish.$(MANSUFFIX) fglFlush.$(MANSUFFIX) \
-fglFogf.$(MANSUFFIX) fglFogfv.$(MANSUFFIX) \
-fglFogi.$(MANSUFFIX) fglFogiv.$(MANSUFFIX) \
-fglFrontFace.$(MANSUFFIX) fglFrustum.$(MANSUFFIX) \
-fglGenLists.$(MANSUFFIX) fglGenTextures.$(MANSUFFIX) \
-fglGetBooleanv.$(MANSUFFIX) fglGetClipPlane.$(MANSUFFIX) \
-fglGetDoublev.$(MANSUFFIX) fglGetError.$(MANSUFFIX) \
-fglGetFloatv.$(MANSUFFIX) fglGetIntegerv.$(MANSUFFIX) \
-fglGetLightfv.$(MANSUFFIX) fglGetLightiv.$(MANSUFFIX) \
-fglGetMapdv.$(MANSUFFIX) fglGetMapfv.$(MANSUFFIX) \
-fglGetMapiv.$(MANSUFFIX) fglGetMaterialfv.$(MANSUFFIX) \
-fglGetMaterialiv.$(MANSUFFIX) fglGetPixelMapfv.$(MANSUFFIX) \
-fglGetPixelMapuiv.$(MANSUFFIX) fglGetPixelMapusv.$(MANSUFFIX) \
-fglGetPointerv.$(MANSUFFIX) fglGetPolygonStipple.$(MANSUFFIX) \
-fglGetString.$(MANSUFFIX) fglGetTexEnvfv.$(MANSUFFIX) \
-fglGetTexEnviv.$(MANSUFFIX) fglGetTexGendv.$(MANSUFFIX) \
-fglGetTexGenfv.$(MANSUFFIX) fglGetTexGeniv.$(MANSUFFIX) \
-fglGetTexImage.$(MANSUFFIX) fglGetTexLevelParameterfv.$(MANSUFFIX) \
-fglGetTexLevelParameteriv.$(MANSUFFIX) fglGetTexParameterfv.$(MANSUFFIX) \
-fglGetTexParameteriv.$(MANSUFFIX) fglHint.$(MANSUFFIX) \
-fglIndexMask.$(MANSUFFIX) fglIndexPointer.$(MANSUFFIX) \
-fglIndexd.$(MANSUFFIX) fglIndexdv.$(MANSUFFIX) \
-fglIndexf.$(MANSUFFIX) fglIndexfv.$(MANSUFFIX) \
-fglIndexi.$(MANSUFFIX) fglIndexiv.$(MANSUFFIX) \
-fglIndexs.$(MANSUFFIX) fglIndexsv.$(MANSUFFIX) \
-fglIndexub.$(MANSUFFIX) fglIndexubv.$(MANSUFFIX) \
-fglInitNames.$(MANSUFFIX) fglInterleavedArrays.$(MANSUFFIX) \
-fglIsEnabled.$(MANSUFFIX) fglIsList.$(MANSUFFIX) \
-fglIsTexture.$(MANSUFFIX) fglLightModelf.$(MANSUFFIX) \
-fglLightModelfv.$(MANSUFFIX) fglLightModeli.$(MANSUFFIX) \
-fglLightModeliv.$(MANSUFFIX) fglLightf.$(MANSUFFIX) \
-fglLightfv.$(MANSUFFIX) fglLighti.$(MANSUFFIX) \
-fglLightiv.$(MANSUFFIX) fglLineStipple.$(MANSUFFIX) \
-fglLineWidth.$(MANSUFFIX) fglListBase.$(MANSUFFIX) \
-fglLoadIdentity.$(MANSUFFIX) fglLoadMatrixd.$(MANSUFFIX) \
-fglLoadMatrixf.$(MANSUFFIX) fglLoadName.$(MANSUFFIX) \
-fglLogicOp.$(MANSUFFIX) fglMap1d.$(MANSUFFIX) \
-fglMap1f.$(MANSUFFIX) fglMap2d.$(MANSUFFIX) \
-fglMap2f.$(MANSUFFIX) fglMapGrid1d.$(MANSUFFIX) \
-fglMapGrid1f.$(MANSUFFIX) fglMapGrid2d.$(MANSUFFIX) \
-fglMapGrid2f.$(MANSUFFIX) fglMaterialf.$(MANSUFFIX) \
-fglMaterialfv.$(MANSUFFIX) fglMateriali.$(MANSUFFIX) \
-fglMaterialiv.$(MANSUFFIX) fglMatrixMode.$(MANSUFFIX) \
-fglMultMatrixd.$(MANSUFFIX) fglMultMatrixf.$(MANSUFFIX) \
-fglNewList.$(MANSUFFIX) fglNormal3b.$(MANSUFFIX) \
-fglNormal3bv.$(MANSUFFIX) fglNormal3d.$(MANSUFFIX) \
-fglNormal3dv.$(MANSUFFIX) fglNormal3f.$(MANSUFFIX) \
-fglNormal3fv.$(MANSUFFIX) fglNormal3i.$(MANSUFFIX) \
-fglNormal3iv.$(MANSUFFIX) fglNormal3s.$(MANSUFFIX) \
-fglNormal3sv.$(MANSUFFIX) fglNormalPointer.$(MANSUFFIX) \
-fglOrtho.$(MANSUFFIX) fglPassThrough.$(MANSUFFIX) \
-fglPixelMapfv.$(MANSUFFIX) fglPixelMapuiv.$(MANSUFFIX) \
-fglPixelMapusv.$(MANSUFFIX) fglPixelStoref.$(MANSUFFIX) \
-fglPixelStorei.$(MANSUFFIX) fglPixelTransferf.$(MANSUFFIX) \
-fglPixelTransferi.$(MANSUFFIX) fglPixelZoom.$(MANSUFFIX) \
-fglPointSize.$(MANSUFFIX) fglPolygonMode.$(MANSUFFIX) \
-fglPolygonOffset.$(MANSUFFIX) fglPolygonStipple.$(MANSUFFIX) \
-fglPopAttrib.$(MANSUFFIX) fglPopClientAttrib.$(MANSUFFIX) \
-fglPopMatrix.$(MANSUFFIX) fglPopName.$(MANSUFFIX) \
-fglPrioritizeTextures.$(MANSUFFIX) fglPushAttrib.$(MANSUFFIX) \
-fglPushClientAttrib.$(MANSUFFIX) fglPushMatrix.$(MANSUFFIX) \
-fglPushName.$(MANSUFFIX) fglRasterPos2d.$(MANSUFFIX) \
-fglRasterPos2dv.$(MANSUFFIX) fglRasterPos2f.$(MANSUFFIX) \
-fglRasterPos2fv.$(MANSUFFIX) fglRasterPos2i.$(MANSUFFIX) \
-fglRasterPos2iv.$(MANSUFFIX) fglRasterPos2s.$(MANSUFFIX) \
-fglRasterPos2sv.$(MANSUFFIX) fglRasterPos3d.$(MANSUFFIX) \
-fglRasterPos3dv.$(MANSUFFIX) fglRasterPos3f.$(MANSUFFIX) \
-fglRasterPos3fv.$(MANSUFFIX) fglRasterPos3i.$(MANSUFFIX) \
-fglRasterPos3iv.$(MANSUFFIX) fglRasterPos3s.$(MANSUFFIX) \
-fglRasterPos3sv.$(MANSUFFIX) fglRasterPos4d.$(MANSUFFIX) \
-fglRasterPos4dv.$(MANSUFFIX) fglRasterPos4f.$(MANSUFFIX) \
-fglRasterPos4fv.$(MANSUFFIX) fglRasterPos4i.$(MANSUFFIX) \
-fglRasterPos4iv.$(MANSUFFIX) fglRasterPos4s.$(MANSUFFIX) \
-fglRasterPos4sv.$(MANSUFFIX) fglReadBuffer.$(MANSUFFIX) \
-fglReadPixels.$(MANSUFFIX) fglRectd.$(MANSUFFIX) \
-fglRectdv.$(MANSUFFIX) fglRectf.$(MANSUFFIX) \
-fglRectfv.$(MANSUFFIX) fglRecti.$(MANSUFFIX) \
-fglRectiv.$(MANSUFFIX) fglRects.$(MANSUFFIX) \
-fglRectsv.$(MANSUFFIX) fglRenderMode.$(MANSUFFIX) \
-fglRotated.$(MANSUFFIX) fglRotatef.$(MANSUFFIX) \
-fglScaled.$(MANSUFFIX) fglScalef.$(MANSUFFIX) \
-fglScissor.$(MANSUFFIX) fglSelectBuffer.$(MANSUFFIX) \
-fglShadeModel.$(MANSUFFIX) fglStencilFunc.$(MANSUFFIX) \
-fglStencilMask.$(MANSUFFIX) fglStencilOp.$(MANSUFFIX) \
-fglTexCoord1d.$(MANSUFFIX) fglTexCoord1dv.$(MANSUFFIX) \
-fglTexCoord1f.$(MANSUFFIX) fglTexCoord1fv.$(MANSUFFIX) \
-fglTexCoord1i.$(MANSUFFIX) fglTexCoord1iv.$(MANSUFFIX) \
-fglTexCoord1s.$(MANSUFFIX) fglTexCoord1sv.$(MANSUFFIX) \
-fglTexCoord2d.$(MANSUFFIX) fglTexCoord2dv.$(MANSUFFIX) \
-fglTexCoord2f.$(MANSUFFIX) fglTexCoord2fv.$(MANSUFFIX) \
-fglTexCoord2i.$(MANSUFFIX) fglTexCoord2iv.$(MANSUFFIX) \
-fglTexCoord2s.$(MANSUFFIX) fglTexCoord2sv.$(MANSUFFIX) \
-fglTexCoord3d.$(MANSUFFIX) fglTexCoord3dv.$(MANSUFFIX) \
-fglTexCoord3f.$(MANSUFFIX) fglTexCoord3fv.$(MANSUFFIX) \
-fglTexCoord3i.$(MANSUFFIX) fglTexCoord3iv.$(MANSUFFIX) \
-fglTexCoord3s.$(MANSUFFIX) fglTexCoord3sv.$(MANSUFFIX) \
-fglTexCoord4d.$(MANSUFFIX) fglTexCoord4dv.$(MANSUFFIX) \
-fglTexCoord4f.$(MANSUFFIX) fglTexCoord4fv.$(MANSUFFIX) \
-fglTexCoord4i.$(MANSUFFIX) fglTexCoord4iv.$(MANSUFFIX) \
-fglTexCoord4s.$(MANSUFFIX) fglTexCoord4sv.$(MANSUFFIX) \
-fglTexCoordPointer.$(MANSUFFIX) fglTexEnvf.$(MANSUFFIX) \
-fglTexEnvfv.$(MANSUFFIX) fglTexEnvi.$(MANSUFFIX) \
-fglTexEnviv.$(MANSUFFIX) fglTexGend.$(MANSUFFIX) \
-fglTexGendv.$(MANSUFFIX) fglTexGenf.$(MANSUFFIX) \
-fglTexGenfv.$(MANSUFFIX) fglTexGeni.$(MANSUFFIX) \
-fglTexGeniv.$(MANSUFFIX) fglTexImage1D.$(MANSUFFIX) \
-fglTexImage2D.$(MANSUFFIX) fglTexParameterf.$(MANSUFFIX) \
-fglTexParameterfv.$(MANSUFFIX) fglTexParameteri.$(MANSUFFIX) \
-fglTexParameteriv.$(MANSUFFIX) fglTexSubImage1D.$(MANSUFFIX) \
-fglTexSubImage2D.$(MANSUFFIX) fglTranslated.$(MANSUFFIX) \
-fglTranslatef.$(MANSUFFIX) fglVertex2d.$(MANSUFFIX) \
-fglVertex2dv.$(MANSUFFIX) fglVertex2f.$(MANSUFFIX) \
-fglVertex2fv.$(MANSUFFIX) fglVertex2i.$(MANSUFFIX) \
-fglVertex2iv.$(MANSUFFIX) fglVertex2s.$(MANSUFFIX) \
-fglVertex2sv.$(MANSUFFIX) fglVertex3d.$(MANSUFFIX) \
-fglVertex3dv.$(MANSUFFIX) fglVertex3f.$(MANSUFFIX) \
-fglVertex3fv.$(MANSUFFIX) fglVertex3i.$(MANSUFFIX) \
-fglVertex3iv.$(MANSUFFIX) fglVertex3s.$(MANSUFFIX) \
-fglVertex3sv.$(MANSUFFIX) fglVertex4d.$(MANSUFFIX) \
-fglVertex4dv.$(MANSUFFIX) fglVertex4f.$(MANSUFFIX) \
-fglVertex4fv.$(MANSUFFIX) fglVertex4i.$(MANSUFFIX) \
-fglVertex4iv.$(MANSUFFIX) fglVertex4s.$(MANSUFFIX) \
-fglVertex4sv.$(MANSUFFIX) fglVertexPointer.$(MANSUFFIX) \
-fglViewport.$(MANSUFFIX)
-
-LINK_NAMES = \
-fglAccum.$(MANSUFFIX) fglAlphaFunc.$(MANSUFFIX) \
-fglAreTexturesResident.$(MANSUFFIX) fglArrayElement.$(MANSUFFIX) \
-fglBegin.$(MANSUFFIX) fglBindTexture.$(MANSUFFIX) \
-fglBitmap.$(MANSUFFIX) fglBlendColorEXT.$(MANSUFFIX) \
-fglBlendFunc.$(MANSUFFIX) fglCallList.$(MANSUFFIX) \
-fglCallLists.$(MANSUFFIX) fglClear.$(MANSUFFIX) \
-fglClearAccum.$(MANSUFFIX) fglClearColor.$(MANSUFFIX) \
-fglClearDepth.$(MANSUFFIX) fglClearIndex.$(MANSUFFIX) \
-fglClearStencil.$(MANSUFFIX) fglClipPlane.$(MANSUFFIX) \
-fglColor3b.$(MANSUFFIX) fglColorMask.$(MANSUFFIX) \
-fglColorMaterial.$(MANSUFFIX) fglColorPointer.$(MANSUFFIX) \
-fglCopyPixels.$(MANSUFFIX) fglCopyTexImage1D.$(MANSUFFIX) \
-fglCopyTexImage2D.$(MANSUFFIX) fglCopyTexSubImage1D.$(MANSUFFIX) \
-fglCopyTexSubImage2D.$(MANSUFFIX) fglCullFace.$(MANSUFFIX) \
-fglDeleteLists.$(MANSUFFIX) fglDeleteTextures.$(MANSUFFIX) \
-fglDepthFunc.$(MANSUFFIX) fglDepthMask.$(MANSUFFIX) \
-fglDepthRange.$(MANSUFFIX) fglDrawArrays.$(MANSUFFIX) \
-fglDrawBuffer.$(MANSUFFIX) fglDrawElements.$(MANSUFFIX) \
-fglDrawPixels.$(MANSUFFIX) fglEdgeFlag.$(MANSUFFIX) \
-fglEdgeFlagPointer.$(MANSUFFIX) fglEnable.$(MANSUFFIX) \
-fglEnableClientState.$(MANSUFFIX) fglEvalCoord1d.$(MANSUFFIX) \
-fglEvalMesh1.$(MANSUFFIX) fglEvalPoint1.$(MANSUFFIX) \
-fglFeedbackBuffer.$(MANSUFFIX) fglFinish.$(MANSUFFIX) \
-fglFlush.$(MANSUFFIX) fglFogf.$(MANSUFFIX) \
-fglFrontFace.$(MANSUFFIX) fglFrustum.$(MANSUFFIX) \
-fglGenLists.$(MANSUFFIX) fglGenTextures.$(MANSUFFIX) \
-fglGetBooleanv.$(MANSUFFIX) fglGetClipPlane.$(MANSUFFIX) \
-fglGetError.$(MANSUFFIX) fglGetLightfv.$(MANSUFFIX) \
-fglGetMapdv.$(MANSUFFIX) fglGetMaterialfv.$(MANSUFFIX) \
-fglGetPixelMapfv.$(MANSUFFIX) fglGetPointerv.$(MANSUFFIX) \
-fglGetPolygonStipple.$(MANSUFFIX) fglGetString.$(MANSUFFIX) \
-fglGetTexEnvfv.$(MANSUFFIX) fglGetTexGendv.$(MANSUFFIX) \
-fglGetTexImage.$(MANSUFFIX) fglGetTexLevelParameterfv.$(MANSUFFIX) \
-fglGetTexParameterfv.$(MANSUFFIX) fglHint.$(MANSUFFIX) \
-fglIndexMask.$(MANSUFFIX) fglIndexPointer.$(MANSUFFIX) \
-fglIndexd.$(MANSUFFIX) fglInitNames.$(MANSUFFIX) \
-fglInterleavedArrays.$(MANSUFFIX) fglIsEnabled.$(MANSUFFIX) \
-fglIsList.$(MANSUFFIX) fglIsTexture.$(MANSUFFIX) \
-fglLightModelf.$(MANSUFFIX) fglLightf.$(MANSUFFIX) \
-fglLineStipple.$(MANSUFFIX) fglLineWidth.$(MANSUFFIX) \
-fglListBase.$(MANSUFFIX) fglLoadIdentity.$(MANSUFFIX) \
-fglLoadMatrixd.$(MANSUFFIX) fglLoadName.$(MANSUFFIX) \
-fglLogicOp.$(MANSUFFIX) fglMap1d.$(MANSUFFIX) \
-fglMap2d.$(MANSUFFIX) fglMapGrid1d.$(MANSUFFIX) \
-fglMaterialf.$(MANSUFFIX) fglMatrixMode.$(MANSUFFIX) \
-fglMultMatrixd.$(MANSUFFIX) fglNewList.$(MANSUFFIX) \
-fglNormal3b.$(MANSUFFIX) fglNormalPointer.$(MANSUFFIX) \
-fglOrtho.$(MANSUFFIX) fglPassThrough.$(MANSUFFIX) \
-fglPixelMapfv.$(MANSUFFIX) fglPixelStoref.$(MANSUFFIX) \
-fglPixelTransferf.$(MANSUFFIX) fglPixelZoom.$(MANSUFFIX) \
-fglPointSize.$(MANSUFFIX) fglPolygonMode.$(MANSUFFIX) \
-fglPolygonOffset.$(MANSUFFIX) fglPolygonStipple.$(MANSUFFIX) \
-fglPrioritizeTextures.$(MANSUFFIX) fglPushAttrib.$(MANSUFFIX) \
-fglPushClientAttrib.$(MANSUFFIX) fglPushMatrix.$(MANSUFFIX) \
-fglPushName.$(MANSUFFIX) fglRasterPos2d.$(MANSUFFIX) \
-fglReadBuffer.$(MANSUFFIX) fglReadPixels.$(MANSUFFIX) \
-fglRectd.$(MANSUFFIX) fglRenderMode.$(MANSUFFIX) \
-fglRotated.$(MANSUFFIX) fglScaled.$(MANSUFFIX) \
-fglScissor.$(MANSUFFIX) fglSelectBuffer.$(MANSUFFIX) \
-fglShadeModel.$(MANSUFFIX) fglStencilFunc.$(MANSUFFIX) \
-fglStencilMask.$(MANSUFFIX) fglStencilOp.$(MANSUFFIX) \
-fglTexCoord1d.$(MANSUFFIX) fglTexCoordPointer.$(MANSUFFIX) \
-fglTexEnvf.$(MANSUFFIX) fglTexGend.$(MANSUFFIX) \
-fglTexImage1D.$(MANSUFFIX) fglTexImage2D.$(MANSUFFIX) \
-fglTexParameterf.$(MANSUFFIX) fglTexSubImage1D.$(MANSUFFIX) \
-fglTexSubImage2D.$(MANSUFFIX) fglTranslated.$(MANSUFFIX) \
-fglVertex2d.$(MANSUFFIX) fglVertexPointer.$(MANSUFFIX) \
-fglViewport.$(MANSUFFIX)
-
-ALIAS_NAMES = \
-fglColor3bv.$(MANSUFFIX) fglColor3d.$(MANSUFFIX) \
-fglColor3dv.$(MANSUFFIX) fglColor3f.$(MANSUFFIX) \
-fglColor3fv.$(MANSUFFIX) fglColor3i.$(MANSUFFIX) \
-fglColor3iv.$(MANSUFFIX) fglColor3s.$(MANSUFFIX) \
-fglColor3sv.$(MANSUFFIX) fglColor3ub.$(MANSUFFIX) \
-fglColor3ubv.$(MANSUFFIX) fglColor3ui.$(MANSUFFIX) \
-fglColor3uiv.$(MANSUFFIX) fglColor3us.$(MANSUFFIX) \
-fglColor3usv.$(MANSUFFIX) fglColor4b.$(MANSUFFIX) \
-fglColor4bv.$(MANSUFFIX) fglColor4d.$(MANSUFFIX) \
-fglColor4dv.$(MANSUFFIX) fglColor4f.$(MANSUFFIX) \
-fglColor4fv.$(MANSUFFIX) fglColor4i.$(MANSUFFIX) \
-fglColor4iv.$(MANSUFFIX) fglColor4s.$(MANSUFFIX) \
-fglColor4sv.$(MANSUFFIX) fglColor4ub.$(MANSUFFIX) \
-fglColor4ubv.$(MANSUFFIX) fglColor4ui.$(MANSUFFIX) \
-fglColor4uiv.$(MANSUFFIX) fglColor4us.$(MANSUFFIX) \
-fglColor4usv.$(MANSUFFIX) fglDisable.$(MANSUFFIX) \
-fglDisableClientState.$(MANSUFFIX) fglEdgeFlagv.$(MANSUFFIX) \
-fglEnd.$(MANSUFFIX) fglEndList.$(MANSUFFIX) \
-fglEvalCoord1dv.$(MANSUFFIX) fglEvalCoord1f.$(MANSUFFIX) \
-fglEvalCoord1fv.$(MANSUFFIX) fglEvalCoord2d.$(MANSUFFIX) \
-fglEvalCoord2dv.$(MANSUFFIX) fglEvalCoord2f.$(MANSUFFIX) \
-fglEvalCoord2fv.$(MANSUFFIX) fglEvalMesh2.$(MANSUFFIX) \
-fglEvalPoint2.$(MANSUFFIX) fglFogfv.$(MANSUFFIX) \
-fglFogi.$(MANSUFFIX) fglFogiv.$(MANSUFFIX) \
-fglGetDoublev.$(MANSUFFIX) fglGetFloatv.$(MANSUFFIX) \
-fglGetIntegerv.$(MANSUFFIX) fglGetLightiv.$(MANSUFFIX) \
-fglGetMapfv.$(MANSUFFIX) fglGetMapiv.$(MANSUFFIX) \
-fglGetMaterialiv.$(MANSUFFIX) fglGetPixelMapuiv.$(MANSUFFIX) \
-fglGetPixelMapusv.$(MANSUFFIX) fglGetTexEnviv.$(MANSUFFIX) \
-fglGetTexGenfv.$(MANSUFFIX) fglGetTexGeniv.$(MANSUFFIX) \
-fglGetTexLevelParameteriv.$(MANSUFFIX) fglGetTexParameteriv.$(MANSUFFIX) \
-fglIndexdv.$(MANSUFFIX) fglIndexf.$(MANSUFFIX) \
-fglIndexfv.$(MANSUFFIX) fglIndexi.$(MANSUFFIX) \
-fglIndexiv.$(MANSUFFIX) fglIndexs.$(MANSUFFIX) \
-fglIndexsv.$(MANSUFFIX) fglIndexub.$(MANSUFFIX) \
-fglIndexubv.$(MANSUFFIX) fglLightModelfv.$(MANSUFFIX) \
-fglLightModeli.$(MANSUFFIX) fglLightModeliv.$(MANSUFFIX) \
-fglLightfv.$(MANSUFFIX) fglLighti.$(MANSUFFIX) \
-fglLightiv.$(MANSUFFIX) fglLoadMatrixf.$(MANSUFFIX) \
-fglMap1f.$(MANSUFFIX) fglMap2f.$(MANSUFFIX) \
-fglMapGrid1f.$(MANSUFFIX) fglMapGrid2d.$(MANSUFFIX) \
-fglMapGrid2f.$(MANSUFFIX) fglMaterialfv.$(MANSUFFIX) \
-fglMateriali.$(MANSUFFIX) fglMaterialiv.$(MANSUFFIX) \
-fglMultMatrixf.$(MANSUFFIX) fglNormal3bv.$(MANSUFFIX) \
-fglNormal3d.$(MANSUFFIX) fglNormal3dv.$(MANSUFFIX) \
-fglNormal3f.$(MANSUFFIX) fglNormal3fv.$(MANSUFFIX) \
-fglNormal3i.$(MANSUFFIX) fglNormal3iv.$(MANSUFFIX) \
-fglNormal3s.$(MANSUFFIX) fglNormal3sv.$(MANSUFFIX) \
-fglPixelMapuiv.$(MANSUFFIX) fglPixelMapusv.$(MANSUFFIX) \
-fglPixelStorei.$(MANSUFFIX) fglPixelTransferi.$(MANSUFFIX) \
-fglPopAttrib.$(MANSUFFIX) fglPopClientAttrib.$(MANSUFFIX) \
-fglPopMatrix.$(MANSUFFIX) fglPopName.$(MANSUFFIX) \
-fglRasterPos2dv.$(MANSUFFIX) fglRasterPos2f.$(MANSUFFIX) \
-fglRasterPos2fv.$(MANSUFFIX) fglRasterPos2i.$(MANSUFFIX) \
-fglRasterPos2iv.$(MANSUFFIX) fglRasterPos2s.$(MANSUFFIX) \
-fglRasterPos2sv.$(MANSUFFIX) fglRasterPos3d.$(MANSUFFIX) \
-fglRasterPos3dv.$(MANSUFFIX) fglRasterPos3f.$(MANSUFFIX) \
-fglRasterPos3fv.$(MANSUFFIX) fglRasterPos3i.$(MANSUFFIX) \
-fglRasterPos3iv.$(MANSUFFIX) fglRasterPos3s.$(MANSUFFIX) \
-fglRasterPos3sv.$(MANSUFFIX) fglRasterPos4d.$(MANSUFFIX) \
-fglRasterPos4dv.$(MANSUFFIX) fglRasterPos4f.$(MANSUFFIX) \
-fglRasterPos4fv.$(MANSUFFIX) fglRasterPos4i.$(MANSUFFIX) \
-fglRasterPos4iv.$(MANSUFFIX) fglRasterPos4s.$(MANSUFFIX) \
-fglRasterPos4sv.$(MANSUFFIX) fglRectdv.$(MANSUFFIX) \
-fglRectf.$(MANSUFFIX) fglRectfv.$(MANSUFFIX) \
-fglRecti.$(MANSUFFIX) fglRectiv.$(MANSUFFIX) \
-fglRects.$(MANSUFFIX) fglRectsv.$(MANSUFFIX) \
-fglRotatef.$(MANSUFFIX) fglScalef.$(MANSUFFIX) \
-fglTexCoord1dv.$(MANSUFFIX) fglTexCoord1f.$(MANSUFFIX) \
-fglTexCoord1fv.$(MANSUFFIX) fglTexCoord1i.$(MANSUFFIX) \
-fglTexCoord1iv.$(MANSUFFIX) fglTexCoord1s.$(MANSUFFIX) \
-fglTexCoord1sv.$(MANSUFFIX) fglTexCoord2d.$(MANSUFFIX) \
-fglTexCoord2dv.$(MANSUFFIX) fglTexCoord2f.$(MANSUFFIX) \
-fglTexCoord2fv.$(MANSUFFIX) fglTexCoord2i.$(MANSUFFIX) \
-fglTexCoord2iv.$(MANSUFFIX) fglTexCoord2s.$(MANSUFFIX) \
-fglTexCoord2sv.$(MANSUFFIX) fglTexCoord3d.$(MANSUFFIX) \
-fglTexCoord3dv.$(MANSUFFIX) fglTexCoord3f.$(MANSUFFIX) \
-fglTexCoord3fv.$(MANSUFFIX) fglTexCoord3i.$(MANSUFFIX) \
-fglTexCoord3iv.$(MANSUFFIX) fglTexCoord3s.$(MANSUFFIX) \
-fglTexCoord3sv.$(MANSUFFIX) fglTexCoord4d.$(MANSUFFIX) \
-fglTexCoord4dv.$(MANSUFFIX) fglTexCoord4f.$(MANSUFFIX) \
-fglTexCoord4fv.$(MANSUFFIX) fglTexCoord4i.$(MANSUFFIX) \
-fglTexCoord4iv.$(MANSUFFIX) fglTexCoord4s.$(MANSUFFIX) \
-fglTexCoord4sv.$(MANSUFFIX) fglTexEnvfv.$(MANSUFFIX) \
-fglTexEnvi.$(MANSUFFIX) fglTexEnviv.$(MANSUFFIX) \
-fglTexGendv.$(MANSUFFIX) fglTexGenf.$(MANSUFFIX) \
-fglTexGenfv.$(MANSUFFIX) fglTexGeni.$(MANSUFFIX) \
-fglTexGeniv.$(MANSUFFIX) fglTexParameterfv.$(MANSUFFIX) \
-fglTexParameteri.$(MANSUFFIX) fglTexParameteriv.$(MANSUFFIX) \
-fglTranslatef.$(MANSUFFIX) fglVertex2dv.$(MANSUFFIX) \
-fglVertex2f.$(MANSUFFIX) fglVertex2fv.$(MANSUFFIX) \
-fglVertex2i.$(MANSUFFIX) fglVertex2iv.$(MANSUFFIX) \
-fglVertex2s.$(MANSUFFIX) fglVertex2sv.$(MANSUFFIX) \
-fglVertex3d.$(MANSUFFIX) fglVertex3dv.$(MANSUFFIX) \
-fglVertex3f.$(MANSUFFIX) fglVertex3fv.$(MANSUFFIX) \
-fglVertex3i.$(MANSUFFIX) fglVertex3iv.$(MANSUFFIX) \
-fglVertex3s.$(MANSUFFIX) fglVertex3sv.$(MANSUFFIX) \
-fglVertex4d.$(MANSUFFIX) fglVertex4dv.$(MANSUFFIX) \
-fglVertex4f.$(MANSUFFIX) fglVertex4fv.$(MANSUFFIX) \
-fglVertex4i.$(MANSUFFIX) fglVertex4iv.$(MANSUFFIX) \
-fglVertex4s.$(MANSUFFIX) fglVertex4sv.$(MANSUFFIX)
-
-
-AllTarget($(MAN_PAGES))
-
-list:
- @for i in $(MAN_PAGES); do echo $$i; done;
-
-install_list:
- @for i in $(MAN_PAGES); do echo $(LIBMANDIR)/$$i; done;
-
-install:: install.man
-
-clean::
- $(RM) $(LINK_NAMES) $(ALIAS_NAMES)
-
-InstallMultipleMan($(MAN_PAGES),$(LIBMANDIR))
-
-LinkFile(fglAccum.$(MANSUFFIX), fglaccum.3gl)
-
-LinkFile(fglAlphaFunc.$(MANSUFFIX), fglalphafunc.3gl)
-
-LinkFile(fglAreTexturesResident.$(MANSUFFIX), fglaretexturesresident.3gl)
-
-LinkFile(fglArrayElement.$(MANSUFFIX), fglarrayelement.3gl)
-
-LinkFile(fglBegin.$(MANSUFFIX), fglbegin.3gl)
-ManPageAlias(fglBegin, $(LIBMANDIR), fglEnd)
-
-LinkFile(fglBindTexture.$(MANSUFFIX), fglbindtexture.3gl)
-
-LinkFile(fglBitmap.$(MANSUFFIX), fglbitmap.3gl)
-
-LinkFile(fglBlendColorEXT.$(MANSUFFIX), fglblendcolorext.3gl)
-
-LinkFile(fglBlendFunc.$(MANSUFFIX), fglblendfunc.3gl)
-
-LinkFile(fglCallList.$(MANSUFFIX), fglcalllist.3gl)
-
-LinkFile(fglCallLists.$(MANSUFFIX), fglcalllists.3gl)
-
-LinkFile(fglClear.$(MANSUFFIX), fglclear.3gl)
-
-LinkFile(fglClearAccum.$(MANSUFFIX), fglclearaccum.3gl)
-
-LinkFile(fglClearColor.$(MANSUFFIX), fglclearcolor.3gl)
-
-LinkFile(fglClearDepth.$(MANSUFFIX), fglcleardepth.3gl)
-
-LinkFile(fglClearIndex.$(MANSUFFIX), fglclearindex.3gl)
-
-LinkFile(fglClearStencil.$(MANSUFFIX), fglclearstencil.3gl)
-
-LinkFile(fglClipPlane.$(MANSUFFIX), fglclipplane.3gl)
-
-LinkFile(fglColor3b.$(MANSUFFIX), fglcolor.3gl)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor3d)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor3f)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor3i)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor3s)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor3ub)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor3ui)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor3us)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor4b)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor4d)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor4f)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor4i)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor4s)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor4ub)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor4ui)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor4us)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor3bv)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor3dv)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor3fv)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor3iv)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor3sv)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor3ubv)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor3uiv)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor3usv)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor4bv)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor4dv)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor4fv)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor4iv)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor4sv)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor4ubv)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor4uiv)
-ManPageAlias(fglColor3b, $(LIBMANDIR), fglColor4usv)
-
-LinkFile(fglColorMask.$(MANSUFFIX), fglcolormask.3gl)
-
-LinkFile(fglColorMaterial.$(MANSUFFIX), fglcolormaterial.3gl)
-
-LinkFile(fglColorPointer.$(MANSUFFIX), fglcolorpointer.3gl)
-
-LinkFile(fglCopyPixels.$(MANSUFFIX), fglcopypixels.3gl)
-
-LinkFile(fglCopyTexImage1D.$(MANSUFFIX), fglcopyteximage1d.3gl)
-
-LinkFile(fglCopyTexImage2D.$(MANSUFFIX), fglcopyteximage2d.3gl)
-
-LinkFile(fglCopyTexSubImage1D.$(MANSUFFIX), fglcopytexsubimage1d.3gl)
-
-LinkFile(fglCopyTexSubImage2D.$(MANSUFFIX), fglcopytexsubimage2d.3gl)
-
-LinkFile(fglCullFace.$(MANSUFFIX), fglcullface.3gl)
-
-LinkFile(fglDeleteLists.$(MANSUFFIX), fgldeletelists.3gl)
-
-LinkFile(fglDeleteTextures.$(MANSUFFIX), fgldeletetextures.3gl)
-
-LinkFile(fglDepthFunc.$(MANSUFFIX), fgldepthfunc.3gl)
-
-LinkFile(fglDepthMask.$(MANSUFFIX), fgldepthmask.3gl)
-
-LinkFile(fglDepthRange.$(MANSUFFIX), fgldepthrange.3gl)
-
-LinkFile(fglDrawArrays.$(MANSUFFIX), fgldrawarrays.3gl)
-
-LinkFile(fglDrawBuffer.$(MANSUFFIX), fgldrawbuffer.3gl)
-
-LinkFile(fglDrawElements.$(MANSUFFIX), fgldrawelements.3gl)
-
-LinkFile(fglDrawPixels.$(MANSUFFIX), fgldrawpixels.3gl)
-
-LinkFile(fglEdgeFlag.$(MANSUFFIX), fgledgeflag.3gl)
-ManPageAlias(fglEdgeFlag, $(LIBMANDIR), fglEdgeFlagv)
-
-LinkFile(fglEdgeFlagPointer.$(MANSUFFIX), fgledgeflagpointer.3gl)
-
-LinkFile(fglEnable.$(MANSUFFIX), fglenable.3gl)
-ManPageAlias(fglEnable, $(LIBMANDIR), fglDisable)
-
-LinkFile(fglEnableClientState.$(MANSUFFIX), fglenableclientstate.3gl)
-ManPageAlias(fglEnableClientState, $(LIBMANDIR), fglDisableClientState)
-
-LinkFile(fglEvalCoord1d.$(MANSUFFIX), fglevalcoord.3gl)
-ManPageAlias(fglEvalCoord1d, $(LIBMANDIR), fglEvalCoord1f)
-ManPageAlias(fglEvalCoord1d, $(LIBMANDIR), fglEvalCoord2d)
-ManPageAlias(fglEvalCoord1d, $(LIBMANDIR), fglEvalCoord2f)
-ManPageAlias(fglEvalCoord1d, $(LIBMANDIR), fglEvalCoord1dv)
-ManPageAlias(fglEvalCoord1d, $(LIBMANDIR), fglEvalCoord1fv)
-ManPageAlias(fglEvalCoord1d, $(LIBMANDIR), fglEvalCoord2dv)
-ManPageAlias(fglEvalCoord1d, $(LIBMANDIR), fglEvalCoord2fv)
-
-LinkFile(fglEvalMesh1.$(MANSUFFIX), fglevalmesh.3gl)
-ManPageAlias(fglEvalMesh1, $(LIBMANDIR), fglEvalMesh2)
-
-LinkFile(fglEvalPoint1.$(MANSUFFIX), fglevalpoint.3gl)
-ManPageAlias(fglEvalPoint1, $(LIBMANDIR), fglEvalPoint2)
-
-LinkFile(fglFeedbackBuffer.$(MANSUFFIX), fglfeedbackbuffer.3gl)
-
-LinkFile(fglFinish.$(MANSUFFIX), fglfinish.3gl)
-
-LinkFile(fglFlush.$(MANSUFFIX), fglflush.3gl)
-
-LinkFile(fglFogf.$(MANSUFFIX), fglfog.3gl)
-ManPageAlias(fglFogf, $(LIBMANDIR), fglFogi)
-ManPageAlias(fglFogf, $(LIBMANDIR), fglFogfv)
-ManPageAlias(fglFogf, $(LIBMANDIR), fglFogiv)
-
-LinkFile(fglFrontFace.$(MANSUFFIX), fglfrontface.3gl)
-
-LinkFile(fglFrustum.$(MANSUFFIX), fglfrustum.3gl)
-
-LinkFile(fglGenLists.$(MANSUFFIX), fglgenlists.3gl)
-
-LinkFile(fglGenTextures.$(MANSUFFIX), fglgentextures.3gl)
-
-LinkFile(fglGetBooleanv.$(MANSUFFIX), fglget.3gl)
-ManPageAlias(fglGetBooleanv, $(LIBMANDIR), fglGetDoublev)
-ManPageAlias(fglGetBooleanv, $(LIBMANDIR), fglGetFloatv)
-ManPageAlias(fglGetBooleanv, $(LIBMANDIR), fglGetIntegerv)
-
-LinkFile(fglGetClipPlane.$(MANSUFFIX), fglgetclipplane.3gl)
-
-LinkFile(fglGetError.$(MANSUFFIX), fglgeterror.3gl)
-
-LinkFile(fglGetLightfv.$(MANSUFFIX), fglgetlight.3gl)
-ManPageAlias(fglGetLightfv, $(LIBMANDIR), fglGetLightiv)
-
-LinkFile(fglGetMapdv.$(MANSUFFIX), fglgetmap.3gl)
-ManPageAlias(fglGetMapdv, $(LIBMANDIR), fglGetMapfv)
-ManPageAlias(fglGetMapdv, $(LIBMANDIR), fglGetMapiv)
-
-LinkFile(fglGetMaterialfv.$(MANSUFFIX), fglgetmaterial.3gl)
-ManPageAlias(fglGetMaterialfv, $(LIBMANDIR), fglGetMaterialiv)
-
-LinkFile(fglGetPixelMapfv.$(MANSUFFIX), fglgetpixelmap.3gl)
-ManPageAlias(fglGetPixelMapfv, $(LIBMANDIR), fglGetPixelMapuiv)
-ManPageAlias(fglGetPixelMapfv, $(LIBMANDIR), fglGetPixelMapusv)
-
-LinkFile(fglGetPointerv.$(MANSUFFIX), fglgetpointerv.3gl)
-
-LinkFile(fglGetPolygonStipple.$(MANSUFFIX), fglgetpolygonstipple.3gl)
-
-LinkFile(fglGetString.$(MANSUFFIX), fglgetstring.3gl)
-
-LinkFile(fglGetTexEnvfv.$(MANSUFFIX), fglgettexenv.3gl)
-ManPageAlias(fglGetTexEnvfv, $(LIBMANDIR), fglGetTexEnviv)
-
-LinkFile(fglGetTexGendv.$(MANSUFFIX), fglgettexgen.3gl)
-ManPageAlias(fglGetTexGendv, $(LIBMANDIR), fglGetTexGenfv)
-ManPageAlias(fglGetTexGendv, $(LIBMANDIR), fglGetTexGeniv)
-
-LinkFile(fglGetTexImage.$(MANSUFFIX), fglgetteximage.3gl)
-
-LinkFile(fglGetTexLevelParameterfv.$(MANSUFFIX), fglgettexlevelparameter.3gl)
-ManPageAlias(fglGetTexLevelParameterfv, $(LIBMANDIR), fglGetTexLevelParameteriv)
-
-LinkFile(fglGetTexParameterfv.$(MANSUFFIX), fglgettexparameter.3gl)
-ManPageAlias(fglGetTexParameterfv, $(LIBMANDIR), fglGetTexParameteriv)
-
-LinkFile(fglHint.$(MANSUFFIX), fglhint.3gl)
-
-LinkFile(fglIndexd.$(MANSUFFIX), fglindex.3gl)
-ManPageAlias(fglIndexd, $(LIBMANDIR), fglIndexf)
-ManPageAlias(fglIndexd, $(LIBMANDIR), fglIndexi)
-ManPageAlias(fglIndexd, $(LIBMANDIR), fglIndexs)
-ManPageAlias(fglIndexd, $(LIBMANDIR), fglIndexub)
-ManPageAlias(fglIndexd, $(LIBMANDIR), fglIndexdv)
-ManPageAlias(fglIndexd, $(LIBMANDIR), fglIndexfv)
-ManPageAlias(fglIndexd, $(LIBMANDIR), fglIndexiv)
-ManPageAlias(fglIndexd, $(LIBMANDIR), fglIndexsv)
-ManPageAlias(fglIndexd, $(LIBMANDIR), fglIndexubv)
-
-LinkFile(fglIndexMask.$(MANSUFFIX), fglindexmask.3gl)
-
-LinkFile(fglIndexPointer.$(MANSUFFIX), fglindexpointer.3gl)
-
-LinkFile(fglInitNames.$(MANSUFFIX), fglinitnames.3gl)
-
-LinkFile(fglInterleavedArrays.$(MANSUFFIX), fglinterleavedarrays.3gl)
-
-LinkFile(fglIsEnabled.$(MANSUFFIX), fglisenabled.3gl)
-
-LinkFile(fglIsList.$(MANSUFFIX), fglislist.3gl)
-
-LinkFile(fglIsTexture.$(MANSUFFIX), fglistexture.3gl)
-
-LinkFile(fglLightf.$(MANSUFFIX), fgllight.3gl)
-ManPageAlias(fglLightf, $(LIBMANDIR), fglLighti)
-ManPageAlias(fglLightf, $(LIBMANDIR), fglLightfv)
-ManPageAlias(fglLightf, $(LIBMANDIR), fglLightiv)
-
-LinkFile(fglLightModelf.$(MANSUFFIX), fgllightmodel.3gl)
-ManPageAlias(fglLightModelf, $(LIBMANDIR), fglLightModeli)
-ManPageAlias(fglLightModelf, $(LIBMANDIR), fglLightModelfv)
-ManPageAlias(fglLightModelf, $(LIBMANDIR), fglLightModeliv)
-
-LinkFile(fglLineStipple.$(MANSUFFIX), fgllinestipple.3gl)
-
-LinkFile(fglLineWidth.$(MANSUFFIX), fgllinewidth.3gl)
-
-LinkFile(fglListBase.$(MANSUFFIX), fgllistbase.3gl)
-
-LinkFile(fglLoadIdentity.$(MANSUFFIX), fglloadidentity.3gl)
-
-LinkFile(fglLoadMatrixd.$(MANSUFFIX), fglloadmatrix.3gl)
-ManPageAlias(fglLoadMatrixd, $(LIBMANDIR), fglLoadMatrixf)
-
-LinkFile(fglLoadName.$(MANSUFFIX), fglloadname.3gl)
-
-LinkFile(fglLogicOp.$(MANSUFFIX), fgllogicop.3gl)
-
-LinkFile(fglMap1d.$(MANSUFFIX), fglmap1.3gl)
-ManPageAlias(fglMap1d, $(LIBMANDIR), fglMap1f)
-
-LinkFile(fglMap2d.$(MANSUFFIX), fglmap2.3gl)
-ManPageAlias(fglMap2d, $(LIBMANDIR), fglMap2f)
-
-LinkFile(fglMapGrid1d.$(MANSUFFIX), fglmapgrid.3gl)
-ManPageAlias(fglMapGrid1d, $(LIBMANDIR), fglMapGrid1f)
-ManPageAlias(fglMapGrid1d, $(LIBMANDIR), fglMapGrid2d)
-ManPageAlias(fglMapGrid1d, $(LIBMANDIR), fglMapGrid2f)
-
-LinkFile(fglMaterialf.$(MANSUFFIX), fglmaterial.3gl)
-ManPageAlias(fglMaterialf, $(LIBMANDIR), fglMateriali)
-ManPageAlias(fglMaterialf, $(LIBMANDIR), fglMaterialfv)
-ManPageAlias(fglMaterialf, $(LIBMANDIR), fglMaterialiv)
-
-LinkFile(fglMatrixMode.$(MANSUFFIX), fglmatrixmode.3gl)
-
-LinkFile(fglMultMatrixd.$(MANSUFFIX), fglmultmatrix.3gl)
-ManPageAlias(fglMultMatrixd, $(LIBMANDIR), fglMultMatrixf)
-
-LinkFile(fglNewList.$(MANSUFFIX), fglnewlist.3gl)
-ManPageAlias(fglNewList, $(LIBMANDIR), fglEndList)
-
-LinkFile(fglNormal3b.$(MANSUFFIX), fglnormal.3gl)
-ManPageAlias(fglNormal3b, $(LIBMANDIR), fglNormal3d)
-ManPageAlias(fglNormal3b, $(LIBMANDIR), fglNormal3f)
-ManPageAlias(fglNormal3b, $(LIBMANDIR), fglNormal3i)
-ManPageAlias(fglNormal3b, $(LIBMANDIR), fglNormal3s)
-ManPageAlias(fglNormal3b, $(LIBMANDIR), fglNormal3bv)
-ManPageAlias(fglNormal3b, $(LIBMANDIR), fglNormal3dv)
-ManPageAlias(fglNormal3b, $(LIBMANDIR), fglNormal3fv)
-ManPageAlias(fglNormal3b, $(LIBMANDIR), fglNormal3iv)
-ManPageAlias(fglNormal3b, $(LIBMANDIR), fglNormal3sv)
-
-LinkFile(fglNormalPointer.$(MANSUFFIX), fglnormalpointer.3gl)
-
-LinkFile(fglOrtho.$(MANSUFFIX), fglortho.3gl)
-
-LinkFile(fglPassThrough.$(MANSUFFIX), fglpassthrough.3gl)
-
-LinkFile(fglPixelMapfv.$(MANSUFFIX), fglpixelmap.3gl)
-ManPageAlias(fglPixelMapfv, $(LIBMANDIR), fglPixelMapuiv)
-ManPageAlias(fglPixelMapfv, $(LIBMANDIR), fglPixelMapusv)
-
-LinkFile(fglPixelStoref.$(MANSUFFIX), fglpixelstore.3gl)
-ManPageAlias(fglPixelStoref, $(LIBMANDIR), fglPixelStorei)
-
-LinkFile(fglPixelTransferf.$(MANSUFFIX), fglpixeltransfer.3gl)
-ManPageAlias(fglPixelTransferf, $(LIBMANDIR), fglPixelTransferi)
-
-LinkFile(fglPixelZoom.$(MANSUFFIX), fglpixelzoom.3gl)
-
-LinkFile(fglPointSize.$(MANSUFFIX), fglpointsize.3gl)
-
-LinkFile(fglPolygonMode.$(MANSUFFIX), fglpolygonmode.3gl)
-
-LinkFile(fglPolygonOffset.$(MANSUFFIX), fglpolygonoffset.3gl)
-
-LinkFile(fglPolygonStipple.$(MANSUFFIX), fglpolygonstipple.3gl)
-
-LinkFile(fglPrioritizeTextures.$(MANSUFFIX), fglprioritizetextures.3gl)
-
-LinkFile(fglPushAttrib.$(MANSUFFIX), fglpushattrib.3gl)
-ManPageAlias(fglPushAttrib, $(LIBMANDIR), fglPopAttrib)
-
-LinkFile(fglPushClientAttrib.$(MANSUFFIX), fglpushclientattrib.3gl)
-ManPageAlias(fglPushClientAttrib, $(LIBMANDIR), fglPopClientAttrib)
-
-LinkFile(fglPushMatrix.$(MANSUFFIX), fglpushmatrix.3gl)
-ManPageAlias(fglPushMatrix, $(LIBMANDIR), fglPopMatrix)
-
-LinkFile(fglPushName.$(MANSUFFIX), fglpushname.3gl)
-ManPageAlias(fglPushName, $(LIBMANDIR), fglPopName)
-
-LinkFile(fglRasterPos2d.$(MANSUFFIX), fglrasterpos.3gl)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos2f)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos2i)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos2s)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos3d)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos3f)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos3i)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos3s)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos4d)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos4f)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos4i)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos4s)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos2dv)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos2fv)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos2iv)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos2sv)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos3dv)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos3fv)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos3iv)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos3sv)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos4dv)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos4fv)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos4iv)
-ManPageAlias(fglRasterPos2d, $(LIBMANDIR), fglRasterPos4sv)
-
-LinkFile(fglReadBuffer.$(MANSUFFIX), fglreadbuffer.3gl)
-
-LinkFile(fglReadPixels.$(MANSUFFIX), fglreadpixels.3gl)
-
-LinkFile(fglRectd.$(MANSUFFIX), fglrect.3gl)
-ManPageAlias(fglRectd, $(LIBMANDIR), fglRectf)
-ManPageAlias(fglRectd, $(LIBMANDIR), fglRecti)
-ManPageAlias(fglRectd, $(LIBMANDIR), fglRects)
-ManPageAlias(fglRectd, $(LIBMANDIR), fglRectdv)
-ManPageAlias(fglRectd, $(LIBMANDIR), fglRectfv)
-ManPageAlias(fglRectd, $(LIBMANDIR), fglRectiv)
-ManPageAlias(fglRectd, $(LIBMANDIR), fglRectsv)
-
-LinkFile(fglRenderMode.$(MANSUFFIX), fglrendermode.3gl)
-
-LinkFile(fglRotated.$(MANSUFFIX), fglrotate.3gl)
-ManPageAlias(fglRotated, $(LIBMANDIR), fglRotatef)
-
-LinkFile(fglScaled.$(MANSUFFIX), fglscale.3gl)
-ManPageAlias(fglScaled, $(LIBMANDIR), fglScalef)
-
-LinkFile(fglScissor.$(MANSUFFIX), fglscissor.3gl)
-
-LinkFile(fglSelectBuffer.$(MANSUFFIX), fglselectbuffer.3gl)
-
-LinkFile(fglShadeModel.$(MANSUFFIX), fglshademodel.3gl)
-
-LinkFile(fglStencilFunc.$(MANSUFFIX), fglstencilfunc.3gl)
-
-LinkFile(fglStencilMask.$(MANSUFFIX), fglstencilmask.3gl)
-
-LinkFile(fglStencilOp.$(MANSUFFIX), fglstencilop.3gl)
-
-LinkFile(fglTexCoord1d.$(MANSUFFIX), fgltexcoord.3gl)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord1f)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord1i)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord1s)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord2d)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord2f)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord2i)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord2s)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord3d)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord3f)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord3i)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord3s)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord4d)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord4f)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord4i)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord4s)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord1dv)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord1fv)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord1iv)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord1sv)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord2dv)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord2fv)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord2iv)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord2sv)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord3dv)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord3fv)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord3iv)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord3sv)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord4dv)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord4fv)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord4iv)
-ManPageAlias(fglTexCoord1d, $(LIBMANDIR), fglTexCoord4sv)
-
-LinkFile(fglTexCoordPointer.$(MANSUFFIX), fgltexcoordpointer.3gl)
-
-LinkFile(fglTexEnvf.$(MANSUFFIX), fgltexenv.3gl)
-ManPageAlias(fglTexEnvf, $(LIBMANDIR), fglTexEnvi)
-ManPageAlias(fglTexEnvf, $(LIBMANDIR), fglTexEnvfv)
-ManPageAlias(fglTexEnvf, $(LIBMANDIR), fglTexEnviv)
-
-LinkFile(fglTexGend.$(MANSUFFIX), fgltexgen.3gl)
-ManPageAlias(fglTexGend, $(LIBMANDIR), fglTexGenf)
-ManPageAlias(fglTexGend, $(LIBMANDIR), fglTexGeni)
-ManPageAlias(fglTexGend, $(LIBMANDIR), fglTexGendv)
-ManPageAlias(fglTexGend, $(LIBMANDIR), fglTexGenfv)
-ManPageAlias(fglTexGend, $(LIBMANDIR), fglTexGeniv)
-
-LinkFile(fglTexImage1D.$(MANSUFFIX), fglteximage1d.3gl)
-
-LinkFile(fglTexImage2D.$(MANSUFFIX), fglteximage2d.3gl)
-
-LinkFile(fglTexParameterf.$(MANSUFFIX), fgltexparameter.3gl)
-ManPageAlias(fglTexParameterf, $(LIBMANDIR), fglTexParameteri)
-ManPageAlias(fglTexParameterf, $(LIBMANDIR), fglTexParameterfv)
-ManPageAlias(fglTexParameterf, $(LIBMANDIR), fglTexParameteriv)
-
-LinkFile(fglTexSubImage1D.$(MANSUFFIX), fgltexsubimage1d.3gl)
-
-LinkFile(fglTexSubImage2D.$(MANSUFFIX), fgltexsubimage2d.3gl)
-
-LinkFile(fglTranslated.$(MANSUFFIX), fgltranslate.3gl)
-ManPageAlias(fglTranslated, $(LIBMANDIR), fglTranslatef)
-
-LinkFile(fglVertex2d.$(MANSUFFIX), fglvertex.3gl)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex2f)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex2i)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex2s)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex3d)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex3f)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex3i)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex3s)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex4d)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex4f)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex4i)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex4s)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex2dv)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex2fv)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex2iv)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex2sv)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex3dv)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex3fv)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex3iv)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex3sv)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex4dv)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex4fv)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex4iv)
-ManPageAlias(fglVertex2d, $(LIBMANDIR), fglVertex4sv)
-
-LinkFile(fglVertexPointer.$(MANSUFFIX), fglvertexpointer.3gl)
-
-LinkFile(fglViewport.$(MANSUFFIX), fglviewport.3gl)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/ftn/f b/xc/extras/ogl-sample/main/doc/man/mangl/ftn/f
deleted file mode 100755
index c4b555609..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/ftn/f
+++ /dev/null
@@ -1 +0,0 @@
-.Op + f
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/html/Distfile b/xc/extras/ogl-sample/main/doc/man/mangl/html/Distfile
deleted file mode 100755
index eaf57c21f..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/html/Distfile
+++ /dev/null
@@ -1,141 +0,0 @@
-#
-#
-
-DISTDIR_SI = /xc/doc/hardcopy/GL/html/gl
-
-DISTFILES_SI = \
- accum.html \
- alphafunc.html \
- aretexturesresident.html \
- arrayelement.html \
- begin.html \
- bindtexture.html \
- bitmap.html \
- blendfunc.html \
- calllist.html \
- calllists.html \
- clear.html \
- clearaccum.html \
- clearcolor.html \
- cleardepth.html \
- clearindex.html \
- clearstencil.html \
- clipplane.html \
- color.html \
- colormask.html \
- colormaterial.html \
- colorpointer.html \
- copypixels.html \
- copyteximage1d.html \
- copyteximage2d.html \
- copytexsubimage1d.html \
- copytexsubimage2d.html \
- cullface.html \
- deletelists.html \
- deletetextures.html \
- depthfunc.html \
- depthmask.html \
- depthrange.html \
- drawarrays.html \
- drawbuffer.html \
- drawelements.html \
- drawpixels.html \
- edgeflag.html \
- edgeflagpointer.html \
- enable.html \
- enableclientstate.html \
- evalcoord.html \
- evalmesh.html \
- evalpoint.html \
- feedbackbuffer.html \
- finish.html \
- flush.html \
- fog.html \
- frontface.html \
- frustum.html \
- genlists.html \
- gentextures.html \
- get.html \
- getclipplane.html \
- geterror.html \
- getlight.html \
- getmap.html \
- getmaterial.html \
- getpixelmap.html \
- getpointerv.html \
- getpolygonstipple.html \
- getstring.html \
- gettexenv.html \
- gettexgen.html \
- getteximage.html \
- gettexlevelparameter.html \
- gettexparameter.html \
- hint.html \
- index.html \
- indexmask.html \
- indexpointer.html \
- initnames.html \
- interleavedarrays.html \
- isenabled.html \
- islist.html \
- istexture.html \
- light.html \
- lightmodel.html \
- linestipple.html \
- linewidth.html \
- listbase.html \
- loadidentity.html \
- loadmatrix.html \
- loadname.html \
- logicop.html \
- map1.html \
- map2.html \
- mapgrid.html \
- material.html \
- matrixmode.html \
- multmatrix.html \
- newlist.html \
- normal.html \
- normalpointer.html \
- ortho.html \
- passthrough.html \
- pixelmap.html \
- pixelstore.html \
- pixeltransfer.html \
- pixelzoom.html \
- pointsize.html \
- polygonmode.html \
- polygonoffset.html \
- polygonstipple.html \
- prioritizetextures.html \
- pushattrib.html \
- pushclientattrib.html \
- pushmatrix.html \
- pushname.html \
- rasterpos.html \
- readbuffer.html \
- readpixels.html \
- rect.html \
- rendermode.html \
- rotate.html \
- scale.html \
- scissor.html \
- selectbuffer.html \
- shademodel.html \
- stencilfunc.html \
- stencilmask.html \
- stencilop.html \
- texcoord.html \
- texcoordpointer.html \
- texenv.html \
- texgen.html \
- teximage1d.html \
- teximage2d.html \
- texparameter.html \
- texsubimage1d.html \
- texsubimage2d.html \
- translate.html \
- vertex.html \
- vertexpointer.html \
- viewport.html \
- $(NULL)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/html/GNUmakefile b/xc/extras/ogl-sample/main/doc/man/mangl/html/GNUmakefile
deleted file mode 100755
index 996e64ab7..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/html/GNUmakefile
+++ /dev/null
@@ -1,67 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-
-COMMONPREF = standard
-include $(ROOT)/usr/include/make/commondefs
-
-DEPTH = ../..
-LANGOPT = c
-PREFIX = gl
-MANSRC = ../standard
-
-MANPREF = man
-include $(DEPTH)/mandefs
-
-# Dependencies are in the man page source directory
-VPATH = $(shell cd $(MANSRC) ; pwd)
-
-default:
- $(MAKE) html
-
-headers headers_install libs libs_install install apps:
-
-distsi: default
- $(MAKE) $(COMMONPREF)$@
-
-distoss:
- $(MAKE) $(COMMONPREF)$@
-
-html: $(patsubst %.3gl,%.html,$(notdir $(wildcard $(MANSRC)/*.3gl)))
-
-clobber:
- rm -rf *.html
-
-include $(DEPTH)/manrules
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/html_ftn/Distfile b/xc/extras/ogl-sample/main/doc/man/mangl/html_ftn/Distfile
deleted file mode 100755
index 18d86d2cf..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/html_ftn/Distfile
+++ /dev/null
@@ -1,141 +0,0 @@
-#
-#
-
-DISTDIR_SI = /xc/doc/hardcopy/GL/html/gl_ftn
-
-DISTFILES_SI = \
- fglaccum.html \
- fglalphafunc.html \
- fglaretexturesresident.html \
- fglarrayelement.html \
- fglbegin.html \
- fglbindtexture.html \
- fglbitmap.html \
- fglblendfunc.html \
- fglcalllist.html \
- fglcalllists.html \
- fglclear.html \
- fglclearaccum.html \
- fglclearcolor.html \
- fglcleardepth.html \
- fglclearindex.html \
- fglclearstencil.html \
- fglclipplane.html \
- fglcolor.html \
- fglcolormask.html \
- fglcolormaterial.html \
- fglcolorpointer.html \
- fglcopypixels.html \
- fglcopyteximage1d.html \
- fglcopyteximage2d.html \
- fglcopytexsubimage1d.html \
- fglcopytexsubimage2d.html \
- fglcullface.html \
- fgldeletelists.html \
- fgldeletetextures.html \
- fgldepthfunc.html \
- fgldepthmask.html \
- fgldepthrange.html \
- fgldrawarrays.html \
- fgldrawbuffer.html \
- fgldrawelements.html \
- fgldrawpixels.html \
- fgledgeflag.html \
- fgledgeflagpointer.html \
- fglenable.html \
- fglenableclientstate.html \
- fglevalcoord.html \
- fglevalmesh.html \
- fglevalpoint.html \
- fglfeedbackbuffer.html \
- fglfinish.html \
- fglflush.html \
- fglfog.html \
- fglfrontface.html \
- fglfrustum.html \
- fglgenlists.html \
- fglgentextures.html \
- fglget.html \
- fglgetclipplane.html \
- fglgeterror.html \
- fglgetlight.html \
- fglgetmap.html \
- fglgetmaterial.html \
- fglgetpixelmap.html \
- fglgetpointerv.html \
- fglgetpolygonstipple.html \
- fglgetstring.html \
- fglgettexenv.html \
- fglgettexgen.html \
- fglgetteximage.html \
- fglgettexlevelparameter.html \
- fglgettexparameter.html \
- fglhint.html \
- fglindex.html \
- fglindexmask.html \
- fglindexpointer.html \
- fglinitnames.html \
- fglinterleavedarrays.html \
- fglisenabled.html \
- fglislist.html \
- fglistexture.html \
- fgllight.html \
- fgllightmodel.html \
- fgllinestipple.html \
- fgllinewidth.html \
- fgllistbase.html \
- fglloadidentity.html \
- fglloadmatrix.html \
- fglloadname.html \
- fgllogicop.html \
- fglmap1.html \
- fglmap2.html \
- fglmapgrid.html \
- fglmaterial.html \
- fglmatrixmode.html \
- fglmultmatrix.html \
- fglnewlist.html \
- fglnormal.html \
- fglnormalpointer.html \
- fglortho.html \
- fglpassthrough.html \
- fglpixelmap.html \
- fglpixelstore.html \
- fglpixeltransfer.html \
- fglpixelzoom.html \
- fglpointsize.html \
- fglpolygonmode.html \
- fglpolygonoffset.html \
- fglpolygonstipple.html \
- fglprioritizetextures.html \
- fglpushattrib.html \
- fglpushclientattrib.html \
- fglpushmatrix.html \
- fglpushname.html \
- fglrasterpos.html \
- fglreadbuffer.html \
- fglreadpixels.html \
- fglrect.html \
- fglrendermode.html \
- fglrotate.html \
- fglscale.html \
- fglscissor.html \
- fglselectbuffer.html \
- fglshademodel.html \
- fglstencilfunc.html \
- fglstencilmask.html \
- fglstencilop.html \
- fgltexcoord.html \
- fgltexcoordpointer.html \
- fgltexenv.html \
- fgltexgen.html \
- fglteximage1d.html \
- fglteximage2d.html \
- fgltexparameter.html \
- fgltexsubimage1d.html \
- fgltexsubimage2d.html \
- fgltranslate.html \
- fglvertex.html \
- fglvertexpointer.html \
- fglviewport.html \
- $(NULL)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/html_ftn/GNUmakefile b/xc/extras/ogl-sample/main/doc/man/mangl/html_ftn/GNUmakefile
deleted file mode 100755
index b00948d05..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/html_ftn/GNUmakefile
+++ /dev/null
@@ -1,67 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-
-COMMONPREF = standard
-include $(ROOT)/usr/include/make/commondefs
-
-DEPTH = ../..
-LANGOPT = c
-PREFIX = gl
-MANSRC = ../ftn
-
-MANPREF = man
-include $(DEPTH)/mandefs
-
-# Dependencies are in the man page source directory
-VPATH = $(shell cd $(MANSRC) ; pwd)
-
-default:
- $(MAKE) html
-
-headers headers_install libs libs_install install apps:
-
-distsi: default
- $(MAKE) $(COMMONPREF)$@
-
-distoss:
- $(MAKE) $(COMMONPREF)$@
-
-html: $(patsubst %.3gl,%.html,$(notdir $(wildcard $(MANSRC)/*.3gl)))
-
-clobber:
- rm -rf *.html
-
-include $(DEPTH)/manrules
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/pages b/xc/extras/ogl-sample/main/doc/man/mangl/pages
deleted file mode 100755
index 338d5e260..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/pages
+++ /dev/null
@@ -1,105 +0,0 @@
-Each line corresponds to a single manpage text body.
-Lines with comma-separated command names, and with the
-parenthetical (both share one page description, two
-entry points) do just that: they share a single text
-body, but have multiple instantiations. Lines with
-comma-separated command names, and with the
-parenthetical (one page, one entry point) simply share
-a single page.
-
-Accum
-AlphaFunc
-Begin, End (both share one page description, two entry points)
-Bitmap
-BlendFunc
-CallList, CallLists (one page, one entry point)
-Clear
-ClearAccum
-ClearColor
-ClearDepth
-ClearIndex
-ClearStencil
-ClipPlane
-Color, Colorv (one page, one entry point)
-ColorMask
-ColorMaterial
-CopyPixels
-CullFace
-DeleteList
-DepthFunc
-DepthRange
-Disable, Enable (both share one page description, two entry points)
-DrawBuffer
-DrawPixels
-EdgeFlag, EdgeFlagv (one page, one entry point)
-EvalCoord, EvalCoordv (one page, one entry point)
-EvalMesh
-EvalPoint
-FeedbackBuffer
-Finish
-Flush
-Fogv
-FrontFace
-Frustum
-GenLists
-GetClipPlane
-GetImage
-GetLightv
-GetMapv
-GetMaterialv
-GetTexEnvv
-GetTexGenv
-Getv
-Hint
-IndexMask
-Index, Indexv (one page, one entry point)
-InitNames
-IsEnabled
-IsList
-LightModelv
-Lightv
-LineStipple
-LineWidth
-ListBase
-LoadMatrix
-LoadName
-LogicOp
-Map1, Map2 (one page, one entry point)
-MapGrid1, MapGrid2 (one page, one entry point)
-Materialv
-MatrixMode
-MultMatrix
-NewList, EndList (both share one page description, two entry points)
-Normal, Normalv (one page, one entry point)
-Ortho
-PassThrough
-PixelMap
-PixelStore
-PixelTransfer
-PointSize
-PolygonMode
-PolygonStipple
-PushAttrib, PopAttrib (both share one page description, two entry points)
-PushMatrix, PopMatrix (both share one page description, two entry points)
-PushName, PopName (both share one page description, two entry points)
-RasterPos, RasterPosv (one page, one entry point)
-ReadPixels
-ReadSource
-Rect, Rectv (one page, one entry point)
-RenderMode
-Rotate
-Scale
-Scissor
-SelectBuffer
-ShadeModel
-StencilFunc
-StencilMask
-StencilOp
-TexCoord, TexCoordv (one page, one entry point)
-TexEnvv
-TexGenv
-TexImage1d, TexImage2d (one page, one entry point)
-TexParameter
-Translate
-Vertex, Vertexv (one page, one entry point)
-Viewport
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/Distfile b/xc/extras/ogl-sample/main/doc/man/mangl/standard/Distfile
deleted file mode 100755
index f720fc3e9..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/Distfile
+++ /dev/null
@@ -1,142 +0,0 @@
-#
-#
-
-DISTDIR_SI = /xc/doc/man/GL/gl
-
-DISTFILES_SI = \
- Imakefile \
- accum.3gl \
- alphafunc.3gl \
- aretexturesresident.3gl \
- arrayelement.3gl \
- begin.3gl \
- bindtexture.3gl \
- bitmap.3gl \
- blendfunc.3gl \
- calllist.3gl \
- calllists.3gl \
- clear.3gl \
- clearaccum.3gl \
- clearcolor.3gl \
- cleardepth.3gl \
- clearindex.3gl \
- clearstencil.3gl \
- clipplane.3gl \
- color.3gl \
- colormask.3gl \
- colormaterial.3gl \
- colorpointer.3gl \
- copypixels.3gl \
- copyteximage1d.3gl \
- copyteximage2d.3gl \
- copytexsubimage1d.3gl \
- copytexsubimage2d.3gl \
- cullface.3gl \
- deletelists.3gl \
- deletetextures.3gl \
- depthfunc.3gl \
- depthmask.3gl \
- depthrange.3gl \
- drawarrays.3gl \
- drawbuffer.3gl \
- drawelements.3gl \
- drawpixels.3gl \
- edgeflag.3gl \
- edgeflagpointer.3gl \
- enable.3gl \
- enableclientstate.3gl \
- evalcoord.3gl \
- evalmesh.3gl \
- evalpoint.3gl \
- feedbackbuffer.3gl \
- finish.3gl \
- flush.3gl \
- fog.3gl \
- frontface.3gl \
- frustum.3gl \
- genlists.3gl \
- gentextures.3gl \
- get.3gl \
- getclipplane.3gl \
- geterror.3gl \
- getlight.3gl \
- getmap.3gl \
- getmaterial.3gl \
- getpixelmap.3gl \
- getpointerv.3gl \
- getpolygonstipple.3gl \
- getstring.3gl \
- gettexenv.3gl \
- gettexgen.3gl \
- getteximage.3gl \
- gettexlevelparameter.3gl \
- gettexparameter.3gl \
- hint.3gl \
- index.3gl \
- indexmask.3gl \
- indexpointer.3gl \
- initnames.3gl \
- interleavedarrays.3gl \
- isenabled.3gl \
- islist.3gl \
- istexture.3gl \
- light.3gl \
- lightmodel.3gl \
- linestipple.3gl \
- linewidth.3gl \
- listbase.3gl \
- loadidentity.3gl \
- loadmatrix.3gl \
- loadname.3gl \
- logicop.3gl \
- map1.3gl \
- map2.3gl \
- mapgrid.3gl \
- material.3gl \
- matrixmode.3gl \
- multmatrix.3gl \
- newlist.3gl \
- normal.3gl \
- normalpointer.3gl \
- ortho.3gl \
- passthrough.3gl \
- pixelmap.3gl \
- pixelstore.3gl \
- pixeltransfer.3gl \
- pixelzoom.3gl \
- pointsize.3gl \
- polygonmode.3gl \
- polygonoffset.3gl \
- polygonstipple.3gl \
- prioritizetextures.3gl \
- pushattrib.3gl \
- pushclientattrib.3gl \
- pushmatrix.3gl \
- pushname.3gl \
- rasterpos.3gl \
- readbuffer.3gl \
- readpixels.3gl \
- rect.3gl \
- rendermode.3gl \
- rotate.3gl \
- scale.3gl \
- scissor.3gl \
- selectbuffer.3gl \
- shademodel.3gl \
- stencilfunc.3gl \
- stencilmask.3gl \
- stencilop.3gl \
- texcoord.3gl \
- texcoordpointer.3gl \
- texenv.3gl \
- texgen.3gl \
- teximage1d.3gl \
- teximage2d.3gl \
- texparameter.3gl \
- texsubimage1d.3gl \
- texsubimage2d.3gl \
- translate.3gl \
- vertex.3gl \
- vertexpointer.3gl \
- viewport.3gl \
- $(NULL)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/GNUmakefile b/xc/extras/ogl-sample/main/doc/man/mangl/standard/GNUmakefile
deleted file mode 100755
index d17621346..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/GNUmakefile
+++ /dev/null
@@ -1,95 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-
-# NOTES:
-# - The file "lor-c.mn" contains the source for the List of Routines section
-# of the C edition of the GL Reference Guide. The usual targets
-# lor-c.p, lor-c.ps, and lor-c.psv exist for it; however, it does not have
-# a .3g suffix because we don't want to include it as a on-line man page.
-# The file should be generated!!!
-
-COMMONPREF = standard
-include $(ROOT)/usr/include/make/commondefs
-
-DEPTH = ../..
-LANGOPT = c
-PREFIX = gl
-IDB_PATH = /usr/catman/g_man/cat3/standard
-
-MANPREF = man
-include $(DEPTH)/mandefs
-
-APIFILE = $(ROOT)/usr/include/GL/gl.h
-
-VERSION = Version 1.2
-DATE = 24 September 1999
-RELEASE = 1.2.1
-MMFLAGS = -rs2
-M4OPTS = -B8192
-
-LEGALSUF1 = 3g#
-LEGALSUF2 = 3g#
-LEGALSUF3 = 3g#
-LEGALSUF4 = 3g#
-
-LOCALPRINTLISTFILTER = | sed -e '/^intro\.p$$/d' | (echo intro.p ; cat )
-
-default:
- $(MAKE) manpages
-
-headers headers_install libs libs_install apps:
-
-distsi: default
- $(MAKE) $(COMMONPREF)$@
-
-distoss:
- $(MAKE) $(COMMONPREF)$@
-
-manpages: $(patsubst %.gl,%.3gl,$(wildcard *.gl))
-
-install: manpages
- for file in *.3gl; do \
- install -D -m 644 $$file ${ROOT}/usr/man/man3/gl`basename $$file .3gl`.3gl ; \
- done
-
-const.diff: const.awk *.gl $(ROOT)/usr/include/GL/gl.h
- awk -f const.awk $(ROOT)/usr/include/GL/gl.h *.gl | \
- sort | uniq > const.diff
-
-clobber:
- rm -f *.3gl
-
-include $(DEPTH)/manrules
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/Imakefile b/xc/extras/ogl-sample/main/doc/man/mangl/standard/Imakefile
deleted file mode 100755
index 862abd608..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/Imakefile
+++ /dev/null
@@ -1,874 +0,0 @@
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-#ifdef ManPageAlias
-#undef ManPageAlias
-#endif
-#define ManPageAlias(file,destdir,alias) @@\
-alias.$(MANSUFFIX): file.$(MANSUFFIX) @@\
- echo .so `basename destdir`/file.$(MANSUFFIX) > alias.$(MANSUFFIX) @@\
-
-MANSUFFIX = 3gl
-
-MAN_PAGES = \
-glAccum.$(MANSUFFIX) glAlphaFunc.$(MANSUFFIX) \
-glAreTexturesResident.$(MANSUFFIX) glArrayElement.$(MANSUFFIX) \
-glBegin.$(MANSUFFIX) glBindTexture.$(MANSUFFIX) \
-glBitmap.$(MANSUFFIX) glBlendColorEXT.$(MANSUFFIX) \
-glBlendFunc.$(MANSUFFIX) glCallList.$(MANSUFFIX) \
-glCallLists.$(MANSUFFIX) glClear.$(MANSUFFIX) \
-glClearAccum.$(MANSUFFIX) glClearColor.$(MANSUFFIX) \
-glClearDepth.$(MANSUFFIX) glClearIndex.$(MANSUFFIX) \
-glClearStencil.$(MANSUFFIX) glClipPlane.$(MANSUFFIX) \
-glColor3b.$(MANSUFFIX) glColor3bv.$(MANSUFFIX) \
-glColor3d.$(MANSUFFIX) glColor3dv.$(MANSUFFIX) \
-glColor3f.$(MANSUFFIX) glColor3fv.$(MANSUFFIX) \
-glColor3i.$(MANSUFFIX) glColor3iv.$(MANSUFFIX) \
-glColor3s.$(MANSUFFIX) glColor3sv.$(MANSUFFIX) \
-glColor3ub.$(MANSUFFIX) glColor3ubv.$(MANSUFFIX) \
-glColor3ui.$(MANSUFFIX) glColor3uiv.$(MANSUFFIX) \
-glColor3us.$(MANSUFFIX) glColor3usv.$(MANSUFFIX) \
-glColor4b.$(MANSUFFIX) glColor4bv.$(MANSUFFIX) \
-glColor4d.$(MANSUFFIX) glColor4dv.$(MANSUFFIX) \
-glColor4f.$(MANSUFFIX) glColor4fv.$(MANSUFFIX) \
-glColor4i.$(MANSUFFIX) glColor4iv.$(MANSUFFIX) \
-glColor4s.$(MANSUFFIX) glColor4sv.$(MANSUFFIX) \
-glColor4ub.$(MANSUFFIX) glColor4ubv.$(MANSUFFIX) \
-glColor4ui.$(MANSUFFIX) glColor4uiv.$(MANSUFFIX) \
-glColor4us.$(MANSUFFIX) glColor4usv.$(MANSUFFIX) \
-glColorMask.$(MANSUFFIX) glColorMaterial.$(MANSUFFIX) \
-glColorPointer.$(MANSUFFIX) glCopyPixels.$(MANSUFFIX) \
-glCopyTexImage1D.$(MANSUFFIX) glCopyTexImage2D.$(MANSUFFIX) \
-glCopyTexSubImage1D.$(MANSUFFIX) glCopyTexSubImage2D.$(MANSUFFIX) \
-glCullFace.$(MANSUFFIX) glDeleteLists.$(MANSUFFIX) \
-glDeleteTextures.$(MANSUFFIX) glDepthFunc.$(MANSUFFIX) \
-glDepthMask.$(MANSUFFIX) glDepthRange.$(MANSUFFIX) \
-glDisable.$(MANSUFFIX) glDisableClientState.$(MANSUFFIX) \
-glDrawArrays.$(MANSUFFIX) glDrawBuffer.$(MANSUFFIX) \
-glDrawElements.$(MANSUFFIX) glDrawPixels.$(MANSUFFIX) \
-glEdgeFlag.$(MANSUFFIX) glEdgeFlagPointer.$(MANSUFFIX) \
-glEdgeFlagv.$(MANSUFFIX) glEnable.$(MANSUFFIX) \
-glEnableClientState.$(MANSUFFIX) glEnd.$(MANSUFFIX) \
-glEndList.$(MANSUFFIX) glEvalCoord1d.$(MANSUFFIX) \
-glEvalCoord1dv.$(MANSUFFIX) glEvalCoord1f.$(MANSUFFIX) \
-glEvalCoord1fv.$(MANSUFFIX) glEvalCoord2d.$(MANSUFFIX) \
-glEvalCoord2dv.$(MANSUFFIX) glEvalCoord2f.$(MANSUFFIX) \
-glEvalCoord2fv.$(MANSUFFIX) glEvalMesh1.$(MANSUFFIX) \
-glEvalMesh2.$(MANSUFFIX) glEvalPoint1.$(MANSUFFIX) \
-glEvalPoint2.$(MANSUFFIX) glFeedbackBuffer.$(MANSUFFIX) \
-glFinish.$(MANSUFFIX) glFlush.$(MANSUFFIX) \
-glFogf.$(MANSUFFIX) glFogfv.$(MANSUFFIX) \
-glFogi.$(MANSUFFIX) glFogiv.$(MANSUFFIX) \
-glFrontFace.$(MANSUFFIX) glFrustum.$(MANSUFFIX) \
-glGenLists.$(MANSUFFIX) glGenTextures.$(MANSUFFIX) \
-glGetBooleanv.$(MANSUFFIX) glGetClipPlane.$(MANSUFFIX) \
-glGetDoublev.$(MANSUFFIX) glGetError.$(MANSUFFIX) \
-glGetFloatv.$(MANSUFFIX) glGetIntegerv.$(MANSUFFIX) \
-glGetLightfv.$(MANSUFFIX) glGetLightiv.$(MANSUFFIX) \
-glGetMapdv.$(MANSUFFIX) glGetMapfv.$(MANSUFFIX) \
-glGetMapiv.$(MANSUFFIX) glGetMaterialfv.$(MANSUFFIX) \
-glGetMaterialiv.$(MANSUFFIX) glGetPixelMapfv.$(MANSUFFIX) \
-glGetPixelMapuiv.$(MANSUFFIX) glGetPixelMapusv.$(MANSUFFIX) \
-glGetPointerv.$(MANSUFFIX) glGetPolygonStipple.$(MANSUFFIX) \
-glGetString.$(MANSUFFIX) glGetTexEnvfv.$(MANSUFFIX) \
-glGetTexEnviv.$(MANSUFFIX) glGetTexGendv.$(MANSUFFIX) \
-glGetTexGenfv.$(MANSUFFIX) glGetTexGeniv.$(MANSUFFIX) \
-glGetTexImage.$(MANSUFFIX) glGetTexLevelParameterfv.$(MANSUFFIX) \
-glGetTexLevelParameteriv.$(MANSUFFIX) glGetTexParameterfv.$(MANSUFFIX) \
-glGetTexParameteriv.$(MANSUFFIX) glHint.$(MANSUFFIX) \
-glIndexMask.$(MANSUFFIX) glIndexPointer.$(MANSUFFIX) \
-glIndexd.$(MANSUFFIX) glIndexdv.$(MANSUFFIX) \
-glIndexf.$(MANSUFFIX) glIndexfv.$(MANSUFFIX) \
-glIndexi.$(MANSUFFIX) glIndexiv.$(MANSUFFIX) \
-glIndexs.$(MANSUFFIX) glIndexsv.$(MANSUFFIX) \
-glIndexub.$(MANSUFFIX) glIndexubv.$(MANSUFFIX) \
-glInitNames.$(MANSUFFIX) glInterleavedArrays.$(MANSUFFIX) \
-glIsEnabled.$(MANSUFFIX) glIsList.$(MANSUFFIX) \
-glIsTexture.$(MANSUFFIX) glLightModelf.$(MANSUFFIX) \
-glLightModelfv.$(MANSUFFIX) glLightModeli.$(MANSUFFIX) \
-glLightModeliv.$(MANSUFFIX) glLightf.$(MANSUFFIX) \
-glLightfv.$(MANSUFFIX) glLighti.$(MANSUFFIX) \
-glLightiv.$(MANSUFFIX) glLineStipple.$(MANSUFFIX) \
-glLineWidth.$(MANSUFFIX) glListBase.$(MANSUFFIX) \
-glLoadIdentity.$(MANSUFFIX) glLoadMatrixd.$(MANSUFFIX) \
-glLoadMatrixf.$(MANSUFFIX) glLoadName.$(MANSUFFIX) \
-glLogicOp.$(MANSUFFIX) glMap1d.$(MANSUFFIX) \
-glMap1f.$(MANSUFFIX) glMap2d.$(MANSUFFIX) \
-glMap2f.$(MANSUFFIX) glMapGrid1d.$(MANSUFFIX) \
-glMapGrid1f.$(MANSUFFIX) glMapGrid2d.$(MANSUFFIX) \
-glMapGrid2f.$(MANSUFFIX) glMaterialf.$(MANSUFFIX) \
-glMaterialfv.$(MANSUFFIX) glMateriali.$(MANSUFFIX) \
-glMaterialiv.$(MANSUFFIX) glMatrixMode.$(MANSUFFIX) \
-glMultMatrixd.$(MANSUFFIX) glMultMatrixf.$(MANSUFFIX) \
-glNewList.$(MANSUFFIX) glNormal3b.$(MANSUFFIX) \
-glNormal3bv.$(MANSUFFIX) glNormal3d.$(MANSUFFIX) \
-glNormal3dv.$(MANSUFFIX) glNormal3f.$(MANSUFFIX) \
-glNormal3fv.$(MANSUFFIX) glNormal3i.$(MANSUFFIX) \
-glNormal3iv.$(MANSUFFIX) glNormal3s.$(MANSUFFIX) \
-glNormal3sv.$(MANSUFFIX) glNormalPointer.$(MANSUFFIX) \
-glOrtho.$(MANSUFFIX) glPassThrough.$(MANSUFFIX) \
-glPixelMapfv.$(MANSUFFIX) glPixelMapuiv.$(MANSUFFIX) \
-glPixelMapusv.$(MANSUFFIX) glPixelStoref.$(MANSUFFIX) \
-glPixelStorei.$(MANSUFFIX) glPixelTransferf.$(MANSUFFIX) \
-glPixelTransferi.$(MANSUFFIX) glPixelZoom.$(MANSUFFIX) \
-glPointSize.$(MANSUFFIX) glPolygonMode.$(MANSUFFIX) \
-glPolygonOffset.$(MANSUFFIX) glPolygonStipple.$(MANSUFFIX) \
-glPopAttrib.$(MANSUFFIX) glPopClientAttrib.$(MANSUFFIX) \
-glPopMatrix.$(MANSUFFIX) glPopName.$(MANSUFFIX) \
-glPrioritizeTextures.$(MANSUFFIX) glPushAttrib.$(MANSUFFIX) \
-glPushClientAttrib.$(MANSUFFIX) glPushMatrix.$(MANSUFFIX) \
-glPushName.$(MANSUFFIX) glRasterPos2d.$(MANSUFFIX) \
-glRasterPos2dv.$(MANSUFFIX) glRasterPos2f.$(MANSUFFIX) \
-glRasterPos2fv.$(MANSUFFIX) glRasterPos2i.$(MANSUFFIX) \
-glRasterPos2iv.$(MANSUFFIX) glRasterPos2s.$(MANSUFFIX) \
-glRasterPos2sv.$(MANSUFFIX) glRasterPos3d.$(MANSUFFIX) \
-glRasterPos3dv.$(MANSUFFIX) glRasterPos3f.$(MANSUFFIX) \
-glRasterPos3fv.$(MANSUFFIX) glRasterPos3i.$(MANSUFFIX) \
-glRasterPos3iv.$(MANSUFFIX) glRasterPos3s.$(MANSUFFIX) \
-glRasterPos3sv.$(MANSUFFIX) glRasterPos4d.$(MANSUFFIX) \
-glRasterPos4dv.$(MANSUFFIX) glRasterPos4f.$(MANSUFFIX) \
-glRasterPos4fv.$(MANSUFFIX) glRasterPos4i.$(MANSUFFIX) \
-glRasterPos4iv.$(MANSUFFIX) glRasterPos4s.$(MANSUFFIX) \
-glRasterPos4sv.$(MANSUFFIX) glReadBuffer.$(MANSUFFIX) \
-glReadPixels.$(MANSUFFIX) glRectd.$(MANSUFFIX) \
-glRectdv.$(MANSUFFIX) glRectf.$(MANSUFFIX) \
-glRectfv.$(MANSUFFIX) glRecti.$(MANSUFFIX) \
-glRectiv.$(MANSUFFIX) glRects.$(MANSUFFIX) \
-glRectsv.$(MANSUFFIX) glRenderMode.$(MANSUFFIX) \
-glRotated.$(MANSUFFIX) glRotatef.$(MANSUFFIX) \
-glScaled.$(MANSUFFIX) glScalef.$(MANSUFFIX) \
-glScissor.$(MANSUFFIX) glSelectBuffer.$(MANSUFFIX) \
-glShadeModel.$(MANSUFFIX) glStencilFunc.$(MANSUFFIX) \
-glStencilMask.$(MANSUFFIX) glStencilOp.$(MANSUFFIX) \
-glTexCoord1d.$(MANSUFFIX) glTexCoord1dv.$(MANSUFFIX) \
-glTexCoord1f.$(MANSUFFIX) glTexCoord1fv.$(MANSUFFIX) \
-glTexCoord1i.$(MANSUFFIX) glTexCoord1iv.$(MANSUFFIX) \
-glTexCoord1s.$(MANSUFFIX) glTexCoord1sv.$(MANSUFFIX) \
-glTexCoord2d.$(MANSUFFIX) glTexCoord2dv.$(MANSUFFIX) \
-glTexCoord2f.$(MANSUFFIX) glTexCoord2fv.$(MANSUFFIX) \
-glTexCoord2i.$(MANSUFFIX) glTexCoord2iv.$(MANSUFFIX) \
-glTexCoord2s.$(MANSUFFIX) glTexCoord2sv.$(MANSUFFIX) \
-glTexCoord3d.$(MANSUFFIX) glTexCoord3dv.$(MANSUFFIX) \
-glTexCoord3f.$(MANSUFFIX) glTexCoord3fv.$(MANSUFFIX) \
-glTexCoord3i.$(MANSUFFIX) glTexCoord3iv.$(MANSUFFIX) \
-glTexCoord3s.$(MANSUFFIX) glTexCoord3sv.$(MANSUFFIX) \
-glTexCoord4d.$(MANSUFFIX) glTexCoord4dv.$(MANSUFFIX) \
-glTexCoord4f.$(MANSUFFIX) glTexCoord4fv.$(MANSUFFIX) \
-glTexCoord4i.$(MANSUFFIX) glTexCoord4iv.$(MANSUFFIX) \
-glTexCoord4s.$(MANSUFFIX) glTexCoord4sv.$(MANSUFFIX) \
-glTexCoordPointer.$(MANSUFFIX) glTexEnvf.$(MANSUFFIX) \
-glTexEnvfv.$(MANSUFFIX) glTexEnvi.$(MANSUFFIX) \
-glTexEnviv.$(MANSUFFIX) glTexGend.$(MANSUFFIX) \
-glTexGendv.$(MANSUFFIX) glTexGenf.$(MANSUFFIX) \
-glTexGenfv.$(MANSUFFIX) glTexGeni.$(MANSUFFIX) \
-glTexGeniv.$(MANSUFFIX) glTexImage1D.$(MANSUFFIX) \
-glTexImage2D.$(MANSUFFIX) glTexParameterf.$(MANSUFFIX) \
-glTexParameterfv.$(MANSUFFIX) glTexParameteri.$(MANSUFFIX) \
-glTexParameteriv.$(MANSUFFIX) glTexSubImage1D.$(MANSUFFIX) \
-glTexSubImage2D.$(MANSUFFIX) glTranslated.$(MANSUFFIX) \
-glTranslatef.$(MANSUFFIX) glVertex2d.$(MANSUFFIX) \
-glVertex2dv.$(MANSUFFIX) glVertex2f.$(MANSUFFIX) \
-glVertex2fv.$(MANSUFFIX) glVertex2i.$(MANSUFFIX) \
-glVertex2iv.$(MANSUFFIX) glVertex2s.$(MANSUFFIX) \
-glVertex2sv.$(MANSUFFIX) glVertex3d.$(MANSUFFIX) \
-glVertex3dv.$(MANSUFFIX) glVertex3f.$(MANSUFFIX) \
-glVertex3fv.$(MANSUFFIX) glVertex3i.$(MANSUFFIX) \
-glVertex3iv.$(MANSUFFIX) glVertex3s.$(MANSUFFIX) \
-glVertex3sv.$(MANSUFFIX) glVertex4d.$(MANSUFFIX) \
-glVertex4dv.$(MANSUFFIX) glVertex4f.$(MANSUFFIX) \
-glVertex4fv.$(MANSUFFIX) glVertex4i.$(MANSUFFIX) \
-glVertex4iv.$(MANSUFFIX) glVertex4s.$(MANSUFFIX) \
-glVertex4sv.$(MANSUFFIX) glVertexPointer.$(MANSUFFIX) \
-glViewport.$(MANSUFFIX)
-
-LINK_NAMES = \
-glAccum.$(MANSUFFIX) glAlphaFunc.$(MANSUFFIX) \
-glAreTexturesResident.$(MANSUFFIX) glArrayElement.$(MANSUFFIX) \
-glBegin.$(MANSUFFIX) glBindTexture.$(MANSUFFIX) \
-glBitmap.$(MANSUFFIX) glBlendColorEXT.$(MANSUFFIX) \
-glBlendFunc.$(MANSUFFIX) glCallList.$(MANSUFFIX) \
-glCallLists.$(MANSUFFIX) glClear.$(MANSUFFIX) \
-glClearAccum.$(MANSUFFIX) glClearColor.$(MANSUFFIX) \
-glClearDepth.$(MANSUFFIX) glClearIndex.$(MANSUFFIX) \
-glClearStencil.$(MANSUFFIX) glClipPlane.$(MANSUFFIX) \
-glColor3b.$(MANSUFFIX) glColorMask.$(MANSUFFIX) \
-glColorMaterial.$(MANSUFFIX) glColorPointer.$(MANSUFFIX) \
-glCopyPixels.$(MANSUFFIX) glCopyTexImage1D.$(MANSUFFIX) \
-glCopyTexImage2D.$(MANSUFFIX) glCopyTexSubImage1D.$(MANSUFFIX) \
-glCopyTexSubImage2D.$(MANSUFFIX) glCullFace.$(MANSUFFIX) \
-glDeleteLists.$(MANSUFFIX) glDeleteTextures.$(MANSUFFIX) \
-glDepthFunc.$(MANSUFFIX) glDepthMask.$(MANSUFFIX) \
-glDepthRange.$(MANSUFFIX) glDrawArrays.$(MANSUFFIX) \
-glDrawBuffer.$(MANSUFFIX) glDrawElements.$(MANSUFFIX) \
-glDrawPixels.$(MANSUFFIX) glEdgeFlag.$(MANSUFFIX) \
-glEdgeFlagPointer.$(MANSUFFIX) glEnable.$(MANSUFFIX) \
-glEnableClientState.$(MANSUFFIX) glEvalCoord1d.$(MANSUFFIX) \
-glEvalMesh1.$(MANSUFFIX) glEvalPoint1.$(MANSUFFIX) \
-glFeedbackBuffer.$(MANSUFFIX) glFinish.$(MANSUFFIX) \
-glFlush.$(MANSUFFIX) glFogf.$(MANSUFFIX) \
-glFrontFace.$(MANSUFFIX) glFrustum.$(MANSUFFIX) \
-glGenLists.$(MANSUFFIX) glGenTextures.$(MANSUFFIX) \
-glGetBooleanv.$(MANSUFFIX) glGetClipPlane.$(MANSUFFIX) \
-glGetError.$(MANSUFFIX) glGetLightfv.$(MANSUFFIX) \
-glGetMapdv.$(MANSUFFIX) glGetMaterialfv.$(MANSUFFIX) \
-glGetPixelMapfv.$(MANSUFFIX) glGetPointerv.$(MANSUFFIX) \
-glGetPolygonStipple.$(MANSUFFIX) glGetString.$(MANSUFFIX) \
-glGetTexEnvfv.$(MANSUFFIX) glGetTexGendv.$(MANSUFFIX) \
-glGetTexImage.$(MANSUFFIX) glGetTexLevelParameterfv.$(MANSUFFIX) \
-glGetTexParameterfv.$(MANSUFFIX) glHint.$(MANSUFFIX) \
-glIndexMask.$(MANSUFFIX) glIndexPointer.$(MANSUFFIX) \
-glIndexd.$(MANSUFFIX) glInitNames.$(MANSUFFIX) \
-glInterleavedArrays.$(MANSUFFIX) glIsEnabled.$(MANSUFFIX) \
-glIsList.$(MANSUFFIX) glIsTexture.$(MANSUFFIX) \
-glLightModelf.$(MANSUFFIX) glLightf.$(MANSUFFIX) \
-glLineStipple.$(MANSUFFIX) glLineWidth.$(MANSUFFIX) \
-glListBase.$(MANSUFFIX) glLoadIdentity.$(MANSUFFIX) \
-glLoadMatrixd.$(MANSUFFIX) glLoadName.$(MANSUFFIX) \
-glLogicOp.$(MANSUFFIX) glMap1d.$(MANSUFFIX) \
-glMap2d.$(MANSUFFIX) glMapGrid1d.$(MANSUFFIX) \
-glMaterialf.$(MANSUFFIX) glMatrixMode.$(MANSUFFIX) \
-glMultMatrixd.$(MANSUFFIX) glNewList.$(MANSUFFIX) \
-glNormal3b.$(MANSUFFIX) glNormalPointer.$(MANSUFFIX) \
-glOrtho.$(MANSUFFIX) glPassThrough.$(MANSUFFIX) \
-glPixelMapfv.$(MANSUFFIX) glPixelStoref.$(MANSUFFIX) \
-glPixelTransferf.$(MANSUFFIX) glPixelZoom.$(MANSUFFIX) \
-glPointSize.$(MANSUFFIX) glPolygonMode.$(MANSUFFIX) \
-glPolygonOffset.$(MANSUFFIX) glPolygonStipple.$(MANSUFFIX) \
-glPrioritizeTextures.$(MANSUFFIX) glPushAttrib.$(MANSUFFIX) \
-glPushClientAttrib.$(MANSUFFIX) glPushMatrix.$(MANSUFFIX) \
-glPushName.$(MANSUFFIX) glRasterPos2d.$(MANSUFFIX) \
-glReadBuffer.$(MANSUFFIX) glReadPixels.$(MANSUFFIX) \
-glRectd.$(MANSUFFIX) glRenderMode.$(MANSUFFIX) \
-glRotated.$(MANSUFFIX) glScaled.$(MANSUFFIX) \
-glScissor.$(MANSUFFIX) glSelectBuffer.$(MANSUFFIX) \
-glShadeModel.$(MANSUFFIX) glStencilFunc.$(MANSUFFIX) \
-glStencilMask.$(MANSUFFIX) glStencilOp.$(MANSUFFIX) \
-glTexCoord1d.$(MANSUFFIX) glTexCoordPointer.$(MANSUFFIX) \
-glTexEnvf.$(MANSUFFIX) glTexGend.$(MANSUFFIX) \
-glTexImage1D.$(MANSUFFIX) glTexImage2D.$(MANSUFFIX) \
-glTexParameterf.$(MANSUFFIX) glTexSubImage1D.$(MANSUFFIX) \
-glTexSubImage2D.$(MANSUFFIX) glTranslated.$(MANSUFFIX) \
-glVertex2d.$(MANSUFFIX) glVertexPointer.$(MANSUFFIX) \
-glViewport.$(MANSUFFIX)
-
-ALIAS_NAMES = \
-glColor3bv.$(MANSUFFIX) glColor3d.$(MANSUFFIX) \
-glColor3dv.$(MANSUFFIX) glColor3f.$(MANSUFFIX) \
-glColor3fv.$(MANSUFFIX) glColor3i.$(MANSUFFIX) \
-glColor3iv.$(MANSUFFIX) glColor3s.$(MANSUFFIX) \
-glColor3sv.$(MANSUFFIX) glColor3ub.$(MANSUFFIX) \
-glColor3ubv.$(MANSUFFIX) glColor3ui.$(MANSUFFIX) \
-glColor3uiv.$(MANSUFFIX) glColor3us.$(MANSUFFIX) \
-glColor3usv.$(MANSUFFIX) glColor4b.$(MANSUFFIX) \
-glColor4bv.$(MANSUFFIX) glColor4d.$(MANSUFFIX) \
-glColor4dv.$(MANSUFFIX) glColor4f.$(MANSUFFIX) \
-glColor4fv.$(MANSUFFIX) glColor4i.$(MANSUFFIX) \
-glColor4iv.$(MANSUFFIX) glColor4s.$(MANSUFFIX) \
-glColor4sv.$(MANSUFFIX) glColor4ub.$(MANSUFFIX) \
-glColor4ubv.$(MANSUFFIX) glColor4ui.$(MANSUFFIX) \
-glColor4uiv.$(MANSUFFIX) glColor4us.$(MANSUFFIX) \
-glColor4usv.$(MANSUFFIX) glDisable.$(MANSUFFIX) \
-glDisableClientState.$(MANSUFFIX) glEdgeFlagv.$(MANSUFFIX) \
-glEnd.$(MANSUFFIX) glEndList.$(MANSUFFIX) \
-glEvalCoord1dv.$(MANSUFFIX) glEvalCoord1f.$(MANSUFFIX) \
-glEvalCoord1fv.$(MANSUFFIX) glEvalCoord2d.$(MANSUFFIX) \
-glEvalCoord2dv.$(MANSUFFIX) glEvalCoord2f.$(MANSUFFIX) \
-glEvalCoord2fv.$(MANSUFFIX) glEvalMesh2.$(MANSUFFIX) \
-glEvalPoint2.$(MANSUFFIX) glFogfv.$(MANSUFFIX) \
-glFogi.$(MANSUFFIX) glFogiv.$(MANSUFFIX) \
-glGetDoublev.$(MANSUFFIX) glGetFloatv.$(MANSUFFIX) \
-glGetIntegerv.$(MANSUFFIX) glGetLightiv.$(MANSUFFIX) \
-glGetMapfv.$(MANSUFFIX) glGetMapiv.$(MANSUFFIX) \
-glGetMaterialiv.$(MANSUFFIX) glGetPixelMapuiv.$(MANSUFFIX) \
-glGetPixelMapusv.$(MANSUFFIX) glGetTexEnviv.$(MANSUFFIX) \
-glGetTexGenfv.$(MANSUFFIX) glGetTexGeniv.$(MANSUFFIX) \
-glGetTexLevelParameteriv.$(MANSUFFIX) glGetTexParameteriv.$(MANSUFFIX) \
-glIndexdv.$(MANSUFFIX) glIndexf.$(MANSUFFIX) \
-glIndexfv.$(MANSUFFIX) glIndexi.$(MANSUFFIX) \
-glIndexiv.$(MANSUFFIX) glIndexs.$(MANSUFFIX) \
-glIndexsv.$(MANSUFFIX) glIndexub.$(MANSUFFIX) \
-glIndexubv.$(MANSUFFIX) glLightModelfv.$(MANSUFFIX) \
-glLightModeli.$(MANSUFFIX) glLightModeliv.$(MANSUFFIX) \
-glLightfv.$(MANSUFFIX) glLighti.$(MANSUFFIX) \
-glLightiv.$(MANSUFFIX) glLoadMatrixf.$(MANSUFFIX) \
-glMap1f.$(MANSUFFIX) glMap2f.$(MANSUFFIX) \
-glMapGrid1f.$(MANSUFFIX) glMapGrid2d.$(MANSUFFIX) \
-glMapGrid2f.$(MANSUFFIX) glMaterialfv.$(MANSUFFIX) \
-glMateriali.$(MANSUFFIX) glMaterialiv.$(MANSUFFIX) \
-glMultMatrixf.$(MANSUFFIX) glNormal3bv.$(MANSUFFIX) \
-glNormal3d.$(MANSUFFIX) glNormal3dv.$(MANSUFFIX) \
-glNormal3f.$(MANSUFFIX) glNormal3fv.$(MANSUFFIX) \
-glNormal3i.$(MANSUFFIX) glNormal3iv.$(MANSUFFIX) \
-glNormal3s.$(MANSUFFIX) glNormal3sv.$(MANSUFFIX) \
-glPixelMapuiv.$(MANSUFFIX) glPixelMapusv.$(MANSUFFIX) \
-glPixelStorei.$(MANSUFFIX) glPixelTransferi.$(MANSUFFIX) \
-glPopAttrib.$(MANSUFFIX) glPopClientAttrib.$(MANSUFFIX) \
-glPopMatrix.$(MANSUFFIX) glPopName.$(MANSUFFIX) \
-glRasterPos2dv.$(MANSUFFIX) glRasterPos2f.$(MANSUFFIX) \
-glRasterPos2fv.$(MANSUFFIX) glRasterPos2i.$(MANSUFFIX) \
-glRasterPos2iv.$(MANSUFFIX) glRasterPos2s.$(MANSUFFIX) \
-glRasterPos2sv.$(MANSUFFIX) glRasterPos3d.$(MANSUFFIX) \
-glRasterPos3dv.$(MANSUFFIX) glRasterPos3f.$(MANSUFFIX) \
-glRasterPos3fv.$(MANSUFFIX) glRasterPos3i.$(MANSUFFIX) \
-glRasterPos3iv.$(MANSUFFIX) glRasterPos3s.$(MANSUFFIX) \
-glRasterPos3sv.$(MANSUFFIX) glRasterPos4d.$(MANSUFFIX) \
-glRasterPos4dv.$(MANSUFFIX) glRasterPos4f.$(MANSUFFIX) \
-glRasterPos4fv.$(MANSUFFIX) glRasterPos4i.$(MANSUFFIX) \
-glRasterPos4iv.$(MANSUFFIX) glRasterPos4s.$(MANSUFFIX) \
-glRasterPos4sv.$(MANSUFFIX) glRectdv.$(MANSUFFIX) \
-glRectf.$(MANSUFFIX) glRectfv.$(MANSUFFIX) \
-glRecti.$(MANSUFFIX) glRectiv.$(MANSUFFIX) \
-glRects.$(MANSUFFIX) glRectsv.$(MANSUFFIX) \
-glRotatef.$(MANSUFFIX) glScalef.$(MANSUFFIX) \
-glTexCoord1dv.$(MANSUFFIX) glTexCoord1f.$(MANSUFFIX) \
-glTexCoord1fv.$(MANSUFFIX) glTexCoord1i.$(MANSUFFIX) \
-glTexCoord1iv.$(MANSUFFIX) glTexCoord1s.$(MANSUFFIX) \
-glTexCoord1sv.$(MANSUFFIX) glTexCoord2d.$(MANSUFFIX) \
-glTexCoord2dv.$(MANSUFFIX) glTexCoord2f.$(MANSUFFIX) \
-glTexCoord2fv.$(MANSUFFIX) glTexCoord2i.$(MANSUFFIX) \
-glTexCoord2iv.$(MANSUFFIX) glTexCoord2s.$(MANSUFFIX) \
-glTexCoord2sv.$(MANSUFFIX) glTexCoord3d.$(MANSUFFIX) \
-glTexCoord3dv.$(MANSUFFIX) glTexCoord3f.$(MANSUFFIX) \
-glTexCoord3fv.$(MANSUFFIX) glTexCoord3i.$(MANSUFFIX) \
-glTexCoord3iv.$(MANSUFFIX) glTexCoord3s.$(MANSUFFIX) \
-glTexCoord3sv.$(MANSUFFIX) glTexCoord4d.$(MANSUFFIX) \
-glTexCoord4dv.$(MANSUFFIX) glTexCoord4f.$(MANSUFFIX) \
-glTexCoord4fv.$(MANSUFFIX) glTexCoord4i.$(MANSUFFIX) \
-glTexCoord4iv.$(MANSUFFIX) glTexCoord4s.$(MANSUFFIX) \
-glTexCoord4sv.$(MANSUFFIX) glTexEnvfv.$(MANSUFFIX) \
-glTexEnvi.$(MANSUFFIX) glTexEnviv.$(MANSUFFIX) \
-glTexGendv.$(MANSUFFIX) glTexGenf.$(MANSUFFIX) \
-glTexGenfv.$(MANSUFFIX) glTexGeni.$(MANSUFFIX) \
-glTexGeniv.$(MANSUFFIX) glTexParameterfv.$(MANSUFFIX) \
-glTexParameteri.$(MANSUFFIX) glTexParameteriv.$(MANSUFFIX) \
-glTranslatef.$(MANSUFFIX) glVertex2dv.$(MANSUFFIX) \
-glVertex2f.$(MANSUFFIX) glVertex2fv.$(MANSUFFIX) \
-glVertex2i.$(MANSUFFIX) glVertex2iv.$(MANSUFFIX) \
-glVertex2s.$(MANSUFFIX) glVertex2sv.$(MANSUFFIX) \
-glVertex3d.$(MANSUFFIX) glVertex3dv.$(MANSUFFIX) \
-glVertex3f.$(MANSUFFIX) glVertex3fv.$(MANSUFFIX) \
-glVertex3i.$(MANSUFFIX) glVertex3iv.$(MANSUFFIX) \
-glVertex3s.$(MANSUFFIX) glVertex3sv.$(MANSUFFIX) \
-glVertex4d.$(MANSUFFIX) glVertex4dv.$(MANSUFFIX) \
-glVertex4f.$(MANSUFFIX) glVertex4fv.$(MANSUFFIX) \
-glVertex4i.$(MANSUFFIX) glVertex4iv.$(MANSUFFIX) \
-glVertex4s.$(MANSUFFIX) glVertex4sv.$(MANSUFFIX)
-
-
-AllTarget($(MAN_PAGES))
-
-list:
- @for i in $(MAN_PAGES); do echo $$i; done;
-
-install_list:
- @for i in $(MAN_PAGES); do echo $(LIBMANDIR)/$$i; done;
-
-install:: install.man
-
-clean::
- $(RM) $(LINK_NAMES) $(ALIAS_NAMES)
-
-InstallMultipleMan($(MAN_PAGES),$(LIBMANDIR))
-
-LinkFile(glAccum.$(MANSUFFIX), accum.3gl)
-
-LinkFile(glAlphaFunc.$(MANSUFFIX), alphafunc.3gl)
-
-LinkFile(glAreTexturesResident.$(MANSUFFIX), aretexturesresident.3gl)
-
-LinkFile(glArrayElement.$(MANSUFFIX), arrayelement.3gl)
-
-LinkFile(glBegin.$(MANSUFFIX), begin.3gl)
-ManPageAlias(glBegin, $(LIBMANDIR), glEnd)
-
-LinkFile(glBindTexture.$(MANSUFFIX), bindtexture.3gl)
-
-LinkFile(glBitmap.$(MANSUFFIX), bitmap.3gl)
-
-LinkFile(glBlendColorEXT.$(MANSUFFIX), blendcolorext.3gl)
-
-LinkFile(glBlendFunc.$(MANSUFFIX), blendfunc.3gl)
-
-LinkFile(glCallList.$(MANSUFFIX), calllist.3gl)
-
-LinkFile(glCallLists.$(MANSUFFIX), calllists.3gl)
-
-LinkFile(glClear.$(MANSUFFIX), clear.3gl)
-
-LinkFile(glClearAccum.$(MANSUFFIX), clearaccum.3gl)
-
-LinkFile(glClearColor.$(MANSUFFIX), clearcolor.3gl)
-
-LinkFile(glClearDepth.$(MANSUFFIX), cleardepth.3gl)
-
-LinkFile(glClearIndex.$(MANSUFFIX), clearindex.3gl)
-
-LinkFile(glClearStencil.$(MANSUFFIX), clearstencil.3gl)
-
-LinkFile(glClipPlane.$(MANSUFFIX), clipplane.3gl)
-
-LinkFile(glColor3b.$(MANSUFFIX), color.3gl)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor3d)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor3f)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor3i)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor3s)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor3ub)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor3ui)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor3us)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor4b)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor4d)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor4f)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor4i)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor4s)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor4ub)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor4ui)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor4us)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor3bv)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor3dv)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor3fv)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor3iv)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor3sv)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor3ubv)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor3uiv)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor3usv)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor4bv)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor4dv)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor4fv)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor4iv)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor4sv)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor4ubv)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor4uiv)
-ManPageAlias(glColor3b, $(LIBMANDIR), glColor4usv)
-
-LinkFile(glColorMask.$(MANSUFFIX), colormask.3gl)
-
-LinkFile(glColorMaterial.$(MANSUFFIX), colormaterial.3gl)
-
-LinkFile(glColorPointer.$(MANSUFFIX), colorpointer.3gl)
-
-LinkFile(glCopyPixels.$(MANSUFFIX), copypixels.3gl)
-
-LinkFile(glCopyTexImage1D.$(MANSUFFIX), copyteximage1d.3gl)
-
-LinkFile(glCopyTexImage2D.$(MANSUFFIX), copyteximage2d.3gl)
-
-LinkFile(glCopyTexSubImage1D.$(MANSUFFIX), copytexsubimage1d.3gl)
-
-LinkFile(glCopyTexSubImage2D.$(MANSUFFIX), copytexsubimage2d.3gl)
-
-LinkFile(glCullFace.$(MANSUFFIX), cullface.3gl)
-
-LinkFile(glDeleteLists.$(MANSUFFIX), deletelists.3gl)
-
-LinkFile(glDeleteTextures.$(MANSUFFIX), deletetextures.3gl)
-
-LinkFile(glDepthFunc.$(MANSUFFIX), depthfunc.3gl)
-
-LinkFile(glDepthMask.$(MANSUFFIX), depthmask.3gl)
-
-LinkFile(glDepthRange.$(MANSUFFIX), depthrange.3gl)
-
-LinkFile(glDrawArrays.$(MANSUFFIX), drawarrays.3gl)
-
-LinkFile(glDrawBuffer.$(MANSUFFIX), drawbuffer.3gl)
-
-LinkFile(glDrawElements.$(MANSUFFIX), drawelements.3gl)
-
-LinkFile(glDrawPixels.$(MANSUFFIX), drawpixels.3gl)
-
-LinkFile(glEdgeFlag.$(MANSUFFIX), edgeflag.3gl)
-ManPageAlias(glEdgeFlag, $(LIBMANDIR), glEdgeFlagv)
-
-LinkFile(glEdgeFlagPointer.$(MANSUFFIX), edgeflagpointer.3gl)
-
-LinkFile(glEnable.$(MANSUFFIX), enable.3gl)
-ManPageAlias(glEnable, $(LIBMANDIR), glDisable)
-
-LinkFile(glEnableClientState.$(MANSUFFIX), enableclientstate.3gl)
-ManPageAlias(glEnableClientState, $(LIBMANDIR), glDisableClientState)
-
-LinkFile(glEvalCoord1d.$(MANSUFFIX), evalcoord.3gl)
-ManPageAlias(glEvalCoord1d, $(LIBMANDIR), glEvalCoord1f)
-ManPageAlias(glEvalCoord1d, $(LIBMANDIR), glEvalCoord2d)
-ManPageAlias(glEvalCoord1d, $(LIBMANDIR), glEvalCoord2f)
-ManPageAlias(glEvalCoord1d, $(LIBMANDIR), glEvalCoord1dv)
-ManPageAlias(glEvalCoord1d, $(LIBMANDIR), glEvalCoord1fv)
-ManPageAlias(glEvalCoord1d, $(LIBMANDIR), glEvalCoord2dv)
-ManPageAlias(glEvalCoord1d, $(LIBMANDIR), glEvalCoord2fv)
-
-LinkFile(glEvalMesh1.$(MANSUFFIX), evalmesh.3gl)
-ManPageAlias(glEvalMesh1, $(LIBMANDIR), glEvalMesh2)
-
-LinkFile(glEvalPoint1.$(MANSUFFIX), evalpoint.3gl)
-ManPageAlias(glEvalPoint1, $(LIBMANDIR), glEvalPoint2)
-
-LinkFile(glFeedbackBuffer.$(MANSUFFIX), feedbackbuffer.3gl)
-
-LinkFile(glFinish.$(MANSUFFIX), finish.3gl)
-
-LinkFile(glFlush.$(MANSUFFIX), flush.3gl)
-
-LinkFile(glFogf.$(MANSUFFIX), fog.3gl)
-ManPageAlias(glFogf, $(LIBMANDIR), glFogi)
-ManPageAlias(glFogf, $(LIBMANDIR), glFogfv)
-ManPageAlias(glFogf, $(LIBMANDIR), glFogiv)
-
-LinkFile(glFrontFace.$(MANSUFFIX), frontface.3gl)
-
-LinkFile(glFrustum.$(MANSUFFIX), frustum.3gl)
-
-LinkFile(glGenLists.$(MANSUFFIX), genlists.3gl)
-
-LinkFile(glGenTextures.$(MANSUFFIX), gentextures.3gl)
-
-LinkFile(glGetBooleanv.$(MANSUFFIX), get.3gl)
-ManPageAlias(glGetBooleanv, $(LIBMANDIR), glGetDoublev)
-ManPageAlias(glGetBooleanv, $(LIBMANDIR), glGetFloatv)
-ManPageAlias(glGetBooleanv, $(LIBMANDIR), glGetIntegerv)
-
-LinkFile(glGetClipPlane.$(MANSUFFIX), getclipplane.3gl)
-
-LinkFile(glGetError.$(MANSUFFIX), geterror.3gl)
-
-LinkFile(glGetLightfv.$(MANSUFFIX), getlight.3gl)
-ManPageAlias(glGetLightfv, $(LIBMANDIR), glGetLightiv)
-
-LinkFile(glGetMapdv.$(MANSUFFIX), getmap.3gl)
-ManPageAlias(glGetMapdv, $(LIBMANDIR), glGetMapfv)
-ManPageAlias(glGetMapdv, $(LIBMANDIR), glGetMapiv)
-
-LinkFile(glGetMaterialfv.$(MANSUFFIX), getmaterial.3gl)
-ManPageAlias(glGetMaterialfv, $(LIBMANDIR), glGetMaterialiv)
-
-LinkFile(glGetPixelMapfv.$(MANSUFFIX), getpixelmap.3gl)
-ManPageAlias(glGetPixelMapfv, $(LIBMANDIR), glGetPixelMapuiv)
-ManPageAlias(glGetPixelMapfv, $(LIBMANDIR), glGetPixelMapusv)
-
-LinkFile(glGetPointerv.$(MANSUFFIX), getpointerv.3gl)
-
-LinkFile(glGetPolygonStipple.$(MANSUFFIX), getpolygonstipple.3gl)
-
-LinkFile(glGetString.$(MANSUFFIX), getstring.3gl)
-
-LinkFile(glGetTexEnvfv.$(MANSUFFIX), gettexenv.3gl)
-ManPageAlias(glGetTexEnvfv, $(LIBMANDIR), glGetTexEnviv)
-
-LinkFile(glGetTexGendv.$(MANSUFFIX), gettexgen.3gl)
-ManPageAlias(glGetTexGendv, $(LIBMANDIR), glGetTexGenfv)
-ManPageAlias(glGetTexGendv, $(LIBMANDIR), glGetTexGeniv)
-
-LinkFile(glGetTexImage.$(MANSUFFIX), getteximage.3gl)
-
-LinkFile(glGetTexLevelParameterfv.$(MANSUFFIX), gettexlevelparameter.3gl)
-ManPageAlias(glGetTexLevelParameterfv, $(LIBMANDIR), glGetTexLevelParameteriv)
-
-LinkFile(glGetTexParameterfv.$(MANSUFFIX), gettexparameter.3gl)
-ManPageAlias(glGetTexParameterfv, $(LIBMANDIR), glGetTexParameteriv)
-
-LinkFile(glHint.$(MANSUFFIX), hint.3gl)
-
-LinkFile(glIndexd.$(MANSUFFIX), index.3gl)
-ManPageAlias(glIndexd, $(LIBMANDIR), glIndexf)
-ManPageAlias(glIndexd, $(LIBMANDIR), glIndexi)
-ManPageAlias(glIndexd, $(LIBMANDIR), glIndexs)
-ManPageAlias(glIndexd, $(LIBMANDIR), glIndexub)
-ManPageAlias(glIndexd, $(LIBMANDIR), glIndexdv)
-ManPageAlias(glIndexd, $(LIBMANDIR), glIndexfv)
-ManPageAlias(glIndexd, $(LIBMANDIR), glIndexiv)
-ManPageAlias(glIndexd, $(LIBMANDIR), glIndexsv)
-ManPageAlias(glIndexd, $(LIBMANDIR), glIndexubv)
-
-LinkFile(glIndexMask.$(MANSUFFIX), indexmask.3gl)
-
-LinkFile(glIndexPointer.$(MANSUFFIX), indexpointer.3gl)
-
-LinkFile(glInitNames.$(MANSUFFIX), initnames.3gl)
-
-LinkFile(glInterleavedArrays.$(MANSUFFIX), interleavedarrays.3gl)
-
-LinkFile(glIsEnabled.$(MANSUFFIX), isenabled.3gl)
-
-LinkFile(glIsList.$(MANSUFFIX), islist.3gl)
-
-LinkFile(glIsTexture.$(MANSUFFIX), istexture.3gl)
-
-LinkFile(glLightf.$(MANSUFFIX), light.3gl)
-ManPageAlias(glLightf, $(LIBMANDIR), glLighti)
-ManPageAlias(glLightf, $(LIBMANDIR), glLightfv)
-ManPageAlias(glLightf, $(LIBMANDIR), glLightiv)
-
-LinkFile(glLightModelf.$(MANSUFFIX), lightmodel.3gl)
-ManPageAlias(glLightModelf, $(LIBMANDIR), glLightModeli)
-ManPageAlias(glLightModelf, $(LIBMANDIR), glLightModelfv)
-ManPageAlias(glLightModelf, $(LIBMANDIR), glLightModeliv)
-
-LinkFile(glLineStipple.$(MANSUFFIX), linestipple.3gl)
-
-LinkFile(glLineWidth.$(MANSUFFIX), linewidth.3gl)
-
-LinkFile(glListBase.$(MANSUFFIX), listbase.3gl)
-
-LinkFile(glLoadIdentity.$(MANSUFFIX), loadidentity.3gl)
-
-LinkFile(glLoadMatrixd.$(MANSUFFIX), loadmatrix.3gl)
-ManPageAlias(glLoadMatrixd, $(LIBMANDIR), glLoadMatrixf)
-
-LinkFile(glLoadName.$(MANSUFFIX), loadname.3gl)
-
-LinkFile(glLogicOp.$(MANSUFFIX), logicop.3gl)
-
-LinkFile(glMap1d.$(MANSUFFIX), map1.3gl)
-ManPageAlias(glMap1d, $(LIBMANDIR), glMap1f)
-
-LinkFile(glMap2d.$(MANSUFFIX), map2.3gl)
-ManPageAlias(glMap2d, $(LIBMANDIR), glMap2f)
-
-LinkFile(glMapGrid1d.$(MANSUFFIX), mapgrid.3gl)
-ManPageAlias(glMapGrid1d, $(LIBMANDIR), glMapGrid1f)
-ManPageAlias(glMapGrid1d, $(LIBMANDIR), glMapGrid2d)
-ManPageAlias(glMapGrid1d, $(LIBMANDIR), glMapGrid2f)
-
-LinkFile(glMaterialf.$(MANSUFFIX), material.3gl)
-ManPageAlias(glMaterialf, $(LIBMANDIR), glMateriali)
-ManPageAlias(glMaterialf, $(LIBMANDIR), glMaterialfv)
-ManPageAlias(glMaterialf, $(LIBMANDIR), glMaterialiv)
-
-LinkFile(glMatrixMode.$(MANSUFFIX), matrixmode.3gl)
-
-LinkFile(glMultMatrixd.$(MANSUFFIX), multmatrix.3gl)
-ManPageAlias(glMultMatrixd, $(LIBMANDIR), glMultMatrixf)
-
-LinkFile(glNewList.$(MANSUFFIX), newlist.3gl)
-ManPageAlias(glNewList, $(LIBMANDIR), glEndList)
-
-LinkFile(glNormal3b.$(MANSUFFIX), normal.3gl)
-ManPageAlias(glNormal3b, $(LIBMANDIR), glNormal3d)
-ManPageAlias(glNormal3b, $(LIBMANDIR), glNormal3f)
-ManPageAlias(glNormal3b, $(LIBMANDIR), glNormal3i)
-ManPageAlias(glNormal3b, $(LIBMANDIR), glNormal3s)
-ManPageAlias(glNormal3b, $(LIBMANDIR), glNormal3bv)
-ManPageAlias(glNormal3b, $(LIBMANDIR), glNormal3dv)
-ManPageAlias(glNormal3b, $(LIBMANDIR), glNormal3fv)
-ManPageAlias(glNormal3b, $(LIBMANDIR), glNormal3iv)
-ManPageAlias(glNormal3b, $(LIBMANDIR), glNormal3sv)
-
-LinkFile(glNormalPointer.$(MANSUFFIX), normalpointer.3gl)
-
-LinkFile(glOrtho.$(MANSUFFIX), ortho.3gl)
-
-LinkFile(glPassThrough.$(MANSUFFIX), passthrough.3gl)
-
-LinkFile(glPixelMapfv.$(MANSUFFIX), pixelmap.3gl)
-ManPageAlias(glPixelMapfv, $(LIBMANDIR), glPixelMapuiv)
-ManPageAlias(glPixelMapfv, $(LIBMANDIR), glPixelMapusv)
-
-LinkFile(glPixelStoref.$(MANSUFFIX), pixelstore.3gl)
-ManPageAlias(glPixelStoref, $(LIBMANDIR), glPixelStorei)
-
-LinkFile(glPixelTransferf.$(MANSUFFIX), pixeltransfer.3gl)
-ManPageAlias(glPixelTransferf, $(LIBMANDIR), glPixelTransferi)
-
-LinkFile(glPixelZoom.$(MANSUFFIX), pixelzoom.3gl)
-
-LinkFile(glPointSize.$(MANSUFFIX), pointsize.3gl)
-
-LinkFile(glPolygonMode.$(MANSUFFIX), polygonmode.3gl)
-
-LinkFile(glPolygonOffset.$(MANSUFFIX), polygonoffset.3gl)
-
-LinkFile(glPolygonStipple.$(MANSUFFIX), polygonstipple.3gl)
-
-LinkFile(glPrioritizeTextures.$(MANSUFFIX), prioritizetextures.3gl)
-
-LinkFile(glPushAttrib.$(MANSUFFIX), pushattrib.3gl)
-ManPageAlias(glPushAttrib, $(LIBMANDIR), glPopAttrib)
-
-LinkFile(glPushClientAttrib.$(MANSUFFIX), pushclientattrib.3gl)
-ManPageAlias(glPushClientAttrib, $(LIBMANDIR), glPopClientAttrib)
-
-LinkFile(glPushMatrix.$(MANSUFFIX), pushmatrix.3gl)
-ManPageAlias(glPushMatrix, $(LIBMANDIR), glPopMatrix)
-
-LinkFile(glPushName.$(MANSUFFIX), pushname.3gl)
-ManPageAlias(glPushName, $(LIBMANDIR), glPopName)
-
-LinkFile(glRasterPos2d.$(MANSUFFIX), rasterpos.3gl)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos2f)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos2i)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos2s)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos3d)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos3f)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos3i)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos3s)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos4d)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos4f)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos4i)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos4s)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos2dv)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos2fv)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos2iv)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos2sv)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos3dv)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos3fv)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos3iv)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos3sv)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos4dv)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos4fv)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos4iv)
-ManPageAlias(glRasterPos2d, $(LIBMANDIR), glRasterPos4sv)
-
-LinkFile(glReadBuffer.$(MANSUFFIX), readbuffer.3gl)
-
-LinkFile(glReadPixels.$(MANSUFFIX), readpixels.3gl)
-
-LinkFile(glRectd.$(MANSUFFIX), rect.3gl)
-ManPageAlias(glRectd, $(LIBMANDIR), glRectf)
-ManPageAlias(glRectd, $(LIBMANDIR), glRecti)
-ManPageAlias(glRectd, $(LIBMANDIR), glRects)
-ManPageAlias(glRectd, $(LIBMANDIR), glRectdv)
-ManPageAlias(glRectd, $(LIBMANDIR), glRectfv)
-ManPageAlias(glRectd, $(LIBMANDIR), glRectiv)
-ManPageAlias(glRectd, $(LIBMANDIR), glRectsv)
-
-LinkFile(glRenderMode.$(MANSUFFIX), rendermode.3gl)
-
-LinkFile(glRotated.$(MANSUFFIX), rotate.3gl)
-ManPageAlias(glRotated, $(LIBMANDIR), glRotatef)
-
-LinkFile(glScaled.$(MANSUFFIX), scale.3gl)
-ManPageAlias(glScaled, $(LIBMANDIR), glScalef)
-
-LinkFile(glScissor.$(MANSUFFIX), scissor.3gl)
-
-LinkFile(glSelectBuffer.$(MANSUFFIX), selectbuffer.3gl)
-
-LinkFile(glShadeModel.$(MANSUFFIX), shademodel.3gl)
-
-LinkFile(glStencilFunc.$(MANSUFFIX), stencilfunc.3gl)
-
-LinkFile(glStencilMask.$(MANSUFFIX), stencilmask.3gl)
-
-LinkFile(glStencilOp.$(MANSUFFIX), stencilop.3gl)
-
-LinkFile(glTexCoord1d.$(MANSUFFIX), texcoord.3gl)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord1f)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord1i)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord1s)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord2d)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord2f)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord2i)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord2s)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord3d)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord3f)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord3i)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord3s)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord4d)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord4f)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord4i)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord4s)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord1dv)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord1fv)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord1iv)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord1sv)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord2dv)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord2fv)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord2iv)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord2sv)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord3dv)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord3fv)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord3iv)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord3sv)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord4dv)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord4fv)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord4iv)
-ManPageAlias(glTexCoord1d, $(LIBMANDIR), glTexCoord4sv)
-
-LinkFile(glTexCoordPointer.$(MANSUFFIX), texcoordpointer.3gl)
-
-LinkFile(glTexEnvf.$(MANSUFFIX), texenv.3gl)
-ManPageAlias(glTexEnvf, $(LIBMANDIR), glTexEnvi)
-ManPageAlias(glTexEnvf, $(LIBMANDIR), glTexEnvfv)
-ManPageAlias(glTexEnvf, $(LIBMANDIR), glTexEnviv)
-
-LinkFile(glTexGend.$(MANSUFFIX), texgen.3gl)
-ManPageAlias(glTexGend, $(LIBMANDIR), glTexGenf)
-ManPageAlias(glTexGend, $(LIBMANDIR), glTexGeni)
-ManPageAlias(glTexGend, $(LIBMANDIR), glTexGendv)
-ManPageAlias(glTexGend, $(LIBMANDIR), glTexGenfv)
-ManPageAlias(glTexGend, $(LIBMANDIR), glTexGeniv)
-
-LinkFile(glTexImage1D.$(MANSUFFIX), teximage1d.3gl)
-
-LinkFile(glTexImage2D.$(MANSUFFIX), teximage2d.3gl)
-
-LinkFile(glTexParameterf.$(MANSUFFIX), texparameter.3gl)
-ManPageAlias(glTexParameterf, $(LIBMANDIR), glTexParameteri)
-ManPageAlias(glTexParameterf, $(LIBMANDIR), glTexParameterfv)
-ManPageAlias(glTexParameterf, $(LIBMANDIR), glTexParameteriv)
-
-LinkFile(glTexSubImage1D.$(MANSUFFIX), texsubimage1d.3gl)
-
-LinkFile(glTexSubImage2D.$(MANSUFFIX), texsubimage2d.3gl)
-
-LinkFile(glTranslated.$(MANSUFFIX), translate.3gl)
-ManPageAlias(glTranslated, $(LIBMANDIR), glTranslatef)
-
-LinkFile(glVertex2d.$(MANSUFFIX), vertex.3gl)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex2f)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex2i)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex2s)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex3d)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex3f)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex3i)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex3s)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex4d)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex4f)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex4i)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex4s)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex2dv)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex2fv)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex2iv)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex2sv)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex3dv)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex3fv)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex3iv)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex3sv)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex4dv)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex4fv)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex4iv)
-ManPageAlias(glVertex2d, $(LIBMANDIR), glVertex4sv)
-
-LinkFile(glVertexPointer.$(MANSUFFIX), vertexpointer.3gl)
-
-LinkFile(glViewport.$(MANSUFFIX), viewport.3gl)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/RULES b/xc/extras/ogl-sample/main/doc/man/mangl/standard/RULES
deleted file mode 100755
index e6871911d..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/RULES
+++ /dev/null
@@ -1,89 +0,0 @@
-Rules for Open GL man pages:
-
- * Describe commands that differ only by a suffix on the same
- page. Do this regardless of whether the commands take the
- same or different arguments. For example, all 24 Vertex
- commands are described on one page.
-
- Issue - current tools like to separate v and non-v commands.
-
- * Describe commands that operate in obvious pairs on the same
- page. For example, Begin and End, or PushMatrix and PopMatrix.
-
- * Use the _header(desc) macro to begin a manpage. Write the
- 1-line command description "desc" using the imperative tense.
- For example:
-
- _header(Operate on the accumulation buffer)
-
- not
- _header(Operates on the accumulation buffer)
-
- * The order of the entries on a manpage is
-
- header
- PARAMETERS (unless the command takes no parameters)
- DESCRIPTION
- EXAMPLE (optional)
- ERRORS (optional)
- SEE ALSO
- BUGS (optional)
- NOTES (optional)
-
- * Use the _phead(param) macro to describe each parameter or
- group of parameters.
-
- * Begin the description of in-only parameters with the phrase
- "Specifies".
-
- * Begin the description of out-only parameters with the phrase
- "Returns".
-
- * Begin the description of in-and-out parameters with the
- phrase "Specifies and returns". If there is a difference
- between what is specified and what is returned, use two
- paragraphs for the description, the first beginning with
- "Specifies" and the second beginning with "Returns".
-
- * Group like parameters into a single description. For example
- "x,y Specify the x and y coordinates ...", or
- "r,g,b Return the red, green, and blue color values ..."
-
- Possible tools issue.
-
- * Include the default value in the description of parameters
- that directly specify GL state.
-
- * Refer to parameters using the _param# macro, never explicitly
- by name. Note that this rules out clever English tricks that
- count on the macro evaluating to a particular string. For
- example, one cannot say "The second parameter is a floating
- point _param2", where it is expected that _param2 will evaluate
- to the string "value".
-
- * Use _cmnd to refer to the command being described.
-
- * Use _cmnd(basename) to refer to another command. Note that
- basename does not include any prefix, it is added automatically
- by the _cmnd() macro.
-
- * Use _const(basename) to refer to a constant. Note that
- basename does not include any prefix, it is added automatically
- by the _const() macro.
-
- * Use _hex(value) to refer to a hexidecimal value.
- (This should not be required very often in the Open GL.)
-
- * List commands in the see also section in alphabetical order.
- Include commands that return all the state that is set by
- the command being documented.
-
-Limitations of the alpha release:
-
- * The header, command syntax, parameter descriptions, and see
- also sections will be complete.
-
- * The command description may not be complete, but it will at
- least exist.
-
- * The example section may not exist.
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/accum.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/accum.gl
deleted file mode 100755
index 5245f738b..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/accum.gl
+++ /dev/null
@@ -1,170 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Accum,operate on the accumulation buffer)
-_names(Accum)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the accumulation buffer operation.
-Symbolic constants
-_const(ACCUM),
-_const(LOAD),
-_const(ADD),
-_const(MULT),
-and
-_const(RETURN) are accepted.
-_phead(_param2)
-Specifies a floating-point value used in the accumulation buffer operation.
-_param1 determines how _param2 is used.
-.SH DESCRIPTION
-The accumulation buffer is an extended-range color buffer.
-Images are not rendered into it.
-Rather,
-images rendered into one of the color buffers
-are added to the contents of the accumulation buffer after rendering.
-Effects such as antialiasing (of points, lines, and polygons),
-motion blur,
-and depth of field can be created
-by accumulating images generated with different transformation matrices.
-.P
-Each pixel in the accumulation buffer consists of
-red, green, blue, and alpha values.
-The number of bits per component in the accumulation buffer
-depends on the implementation. You can examine this number
-by calling _cmnd(GetIntegerv) four times,
-with arguments _const(ACCUM_RED_BITS),
-_const(ACCUM_GREEN_BITS),
-_const(ACCUM_BLUE_BITS),
-and _const(ACCUM_ALPHA_BITS).
-Regardless of the number of bits per component,
-the range of values stored by each component is [\-1,\ 1].
-The accumulation buffer pixels are mapped one-to-one with frame buffer pixels.
-.P
-_cmnd operates on the accumulation buffer.
-The first argument, _param1,
-is a symbolic constant that selects an accumulation buffer operation.
-The second argument, _param2,
-is a floating-point value to be used in that operation.
-Five operations are specified:
-_const(ACCUM), _const(LOAD), _const(ADD),
-_const(MULT), and _const(RETURN).
-.P
-All accumulation buffer operations are limited
-to the area of the current scissor box and applied identically to
-the red, green, blue, and alpha components of each pixel.
-If a _cmnd operation results in a value outside the range [\-1,\ 1],
-the contents of an accumulation buffer pixel component are undefined.
-.P
-The operations are as follows:
-.TP 14
-_const(ACCUM)
-Obtains R, G, B, and A values
-from the buffer currently selected for reading (see _cmnd(ReadBuffer)).
-Each component value is divided by $2 sup n^-^1$,
-where $n$ is the number of bits allocated to each color component
-in the currently selected buffer.
-The result is a floating-point value in the range [0,\ 1],
-which is multiplied by _param2 and added to the corresponding pixel component
-in the accumulation buffer,
-thereby updating the accumulation buffer.
-.TP
-_const(LOAD)
-Similar to _const(ACCUM),
-except that the current value in the accumulation buffer is not used
-in the calculation of the new value.
-That is, the R, G, B, and A values from the currently selected buffer
-are divided by $2 sup n^-^1$,
-multiplied by _param2,
-and then stored in the corresponding accumulation buffer cell,
-overwriting the current value.
-.TP
-_const(ADD)
-Adds _param2 to each R, G, B, and A
-in the accumulation buffer.
-.TP
-_const(MULT)
-Multiplies each R, G, B, and A
-in the accumulation buffer by _param2 and returns the scaled component
-to its corresponding accumulation buffer location.
-.TP
-_const(RETURN)
-Transfers accumulation buffer values
-to the color buffer or buffers currently selected for writing.
-Each R, G, B, and A component is multiplied by _param2,
-then multiplied by $2 sup n^-^1$,
-clamped to the range [0,$~2 sup n^-^1 $], and stored
-in the corresponding display buffer cell.
-The only fragment operations that are applied to this transfer are
-pixel ownership,
-scissor,
-dithering,
-and color writemasks.
-.P
-To clear the accumulation buffer, call _cmnd(ClearAccum) with R, G, B,
-and A values to set it to, then call _cmnd(Clear) with the
-accumulation buffer enabled.
-.SH NOTES
-Only pixels within the current scissor box are updated by a
-_cmnd operation.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if there is no accumulation buffer.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of
-_cmnd(Begin) and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(ACCUM_RED_BITS)
-.br
-_cmnd(Get) with argument _const(ACCUM_GREEN_BITS)
-.br
-_cmnd(Get) with argument _const(ACCUM_BLUE_BITS)
-.br
-_cmnd(Get) with argument _const(ACCUM_ALPHA_BITS)
-.SH SEE ALSO
-_cmnd(Clear),
-_cmnd(ClearAccum),
-_cmnd(CopyPixels),
-_cmnd(DrawBuffer),
-_cmnd(Get),
-_cmnd(ReadBuffer),
-_cmnd(ReadPixels),
-_cmnd(Scissor),
-_cmnd(StencilOp)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/activetextureARB.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/activetextureARB.gl
deleted file mode 100755
index 93afde44f..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/activetextureARB.gl
+++ /dev/null
@@ -1,70 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn|tbl)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(ActiveTextureARB, select active texture unit)
-_names(ActiveTextureARB)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies which texture unit to make active. The number
-of texture units is implementation dependent, but must be at least
-two. _param1 must be one of _arbconstidx(TEXTURE), where
-0 \(<= $ i $ < _arbconst(MAX_TEXTURE_UNITS), which is an
-implementation-dependent value. The intial value is _arbconst(TEXTURE0).
-.SH DESCRIPTION
-_cmnd selects which texture unit subsequent texture state calls will
-affect. The number of texture units an implementation supports is
-implementation dependent, but must be at least 2.
-.P
-Vertex arrays are client-side GL resources, which are selected by the
-_cmnd(ClientActiveTextureARB) routine.
-.SH NOTES
-_cmnd is only supported if _arbstring(multitexture) is included in the
-string returned by _cmnd(GetString) when called with the argument
-_const(EXTENSIONS).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not one of
-_arbconstidx(TEXTURE),
-.br
-where 0 \(<= $ i $ < _arbconst(MAX_TEXTURE_UNITS).
-.SH SEE ALSO
-_cmnd(ClientActiveTextureARB),
-_cmnd(GetIntegerv),
-_cmnd(MultiTexCoordARB),
-_cmnd(TexParameter)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/alphafunc.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/alphafunc.gl
deleted file mode 100755
index 1bdc2f682..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/alphafunc.gl
+++ /dev/null
@@ -1,128 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(AlphaFunc,specify the alpha test function)
-_names(AlphaFunc)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the alpha comparison function.
-Symbolic constants
-_const(NEVER),
-_const(LESS),
-_const(EQUAL),
-_const(LEQUAL),
-_const(GREATER),
-_const(NOTEQUAL),
-_const(GEQUAL), and
-_const(ALWAYS) are accepted. The initial value is _const(ALWAYS).
-_phead(_param2)
-Specifies the reference value that incoming alpha values are compared to.
-This value is clamped to the range [0,\ 1],
-where 0 represents the lowest possible alpha value
-and 1 the highest possible value.
-The initial reference value is 0.
-.SH DESCRIPTION
-The alpha test discards fragments depending on the outcome of a comparison
-between an incoming fragment's alpha value and a constant reference value.
-_cmnd specifies the reference value and the comparison function.
-The comparison is performed only if alpha testing is enabled. By
-default, it is not enabled.
-(See
-_cmnd(Enable) and _cmnd(Disable) of _const(ALPHA_TEST).)
-.P
-_param1 and _param2 specify the conditions under which
-the pixel is drawn.
-The incoming alpha value is compared to _param2
-using the function specified by _param1.
-If the value passes the comparison,
-the incoming fragment is drawn
-if it also passes subsequent stencil and depth buffer tests.
-If the value fails the comparison,
-no change is made to the frame buffer at that pixel location. The
-comparison functions are as follows:
-.TP 18
-_const(NEVER)
-Never passes.
-.TP
-_const(LESS)
-Passes if the incoming alpha value is less than the reference value.
-.TP
-_const(EQUAL)
-Passes if the incoming alpha value is equal to the reference value.
-.TP
-_const(LEQUAL)
-Passes if the incoming alpha value is less than or equal to the reference value.
-.TP
-_const(GREATER)
-Passes if the incoming alpha value is greater than the reference value.
-.TP
-_const(NOTEQUAL)
-Passes if the incoming alpha value is not equal to the reference value.
-.TP
-_const(GEQUAL)
-Passes if the incoming alpha value is greater than or equal to
-the reference value.
-.TP
-_const(ALWAYS)
-Always passes (initial value).
-.P
-_cmnd operates on all pixel write operations,
-including those resulting from the scan conversion of points,
-lines,
-polygons,
-and bitmaps,
-and from pixel draw and copy operations.
-_cmnd does not affect screen clear operations.
-.SH NOTES
-Alpha testing is performed only in RGBA mode.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(ALPHA_TEST_FUNC)
-.br
-_cmnd(Get) with argument _const(ALPHA_TEST_REF)
-.br
-_cmnd(IsEnabled) with argument _const(ALPHA_TEST)
-.SH SEE ALSO
-_cmnd(BlendFunc),
-_cmnd(Clear),
-_cmnd(DepthFunc),
-_cmnd(Enable),
-_cmnd(StencilFunc)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/aretexturesresident.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/aretexturesresident.gl
deleted file mode 100755
index 1aef150e7..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/aretexturesresident.gl
+++ /dev/null
@@ -1,106 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(AreTexturesResident,determine if textures are loaded in texture memory)
-_names(AreTexturesResident)
-.SH PARAMETERS
-_define(@<__n>@,@<_param1>@)_C_
-_define(@<__textures>@,@<_param2>@)_C_
-_define(@<__residences>@,@<_param3>@)_C_
-_phead(__n)
-Specifies the number of textures to be queried.
-_phead(__textures)
-Specifies an array containing the names of the textures to be queried.
-_phead(__residences)
-Specifies an array in which the texture residence status is returned.
-The residence status of a texture named by an element of __textures is
-returned in the corresponding element of __residences.
-.SH DESCRIPTION
-GL establishes
-a ``working set'' of textures that are resident in texture memory.
-These textures can be bound to a texture target much more efficiently
-than textures that are not resident.
-.P
-_cmnd queries the texture residence status of the __n textures named by
-the elements of __textures.
-If all the named textures are resident,
-_cmnd returns _const(TRUE),
-and the contents of __residences are undisturbed.
-If not all the named textures are resident, _cmnd returns _const(FALSE),
-and detailed status is returned in the __n elements of __residences.
-If an element of __residences is _const(TRUE), then the texture named by
-the corresponding element of __textures is resident.
-.P
-The residence status of a single bound texture may also be queried
-by calling
-_cmnd(GetTexParameter) with the \f2target\fP argument set to the
-target to which the texture is bound, and the \f2pname\fP argument
-set to _const(TEXTURE_RESIDENT).
-This is the only way that the residence status of a default texture can be
-queried.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-_cmnd returns the residency status of the textures at the time of
-invocation. It does not guarantee that the textures will remain
-resident at any other time.
-.P
-If textures reside in virtual memory (there is no texture memory), they
-are considered always resident.
-.P
-Some implementations may not load a texture until the first use of
-that texture.
-.SH ERRORS
-_const(INVALID_VALUE) is generated if __n is negative.
-.P
-_const(INVALID_VALUE) is generated if any element in __textures
-is 0 or does not name a texture. In that case, the function returns
-_const(FALSE) and the contents of _param3 is indeterminate.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetTexParameter) with parameter name _const(TEXTURE_RESIDENT)
-retrieves the residence status of a currently bound texture.
-.SH SEE ALSO
-_cmnd(BindTexture),
-_cmnd(GetTexParameter),
-_cmnd(PrioritizeTextures),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexParameter)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/arrayelement.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/arrayelement.gl
deleted file mode 100755
index fa679b4a0..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/arrayelement.gl
+++ /dev/null
@@ -1,106 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_
-_C_ Anything on a line after _C_ is ignored
-_C_
-_C_ A real line follows.
-_C_
-_define(_filters,tbl|eqn)_C_
-_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_C_
-_C_ Use GL not OpenGL
-_C_
-_C_ Don't change the ordering of the main headers.
-_C_
-_C_ C specification (or fortran) is handled automatically
-_C_
-_C_ .TH is automatically added to the top of this file.
-_C_
-_C_ Below, use current tense, active do not capitalize the first word and dont
-_C_ use a period.
-_C_
-_C_ The function name must appear in (APIFILE) (usually gl.h) as set in
-_C_ Makefile.
-_header(ArrayElement,render a vertex using the specified vertex array element)
-_names(ArrayElement)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies an index into the enabled vertex data arrays.
-.SH DESCRIPTION
-_cmnd commands are used within _cmnd(Begin)/_cmnd(End) pairs to
-specify vertex and attribute data for point, line, and polygon
-primitives. If _const(VERTEX_ARRAY) is enabled when _cmnd is called, a
-single vertex is drawn, using
-vertex and attribute data taken from location _param1 of the enabled
-arrays. If _const(VERTEX_ARRAY) is not enabled, no drawing occurs but
-the attributes corresponding to the enabled arrays are modified.
-.P
-Use _cmnd to construct primitives by indexing vertex data, rather than
-by streaming through arrays of data in first-to-last order. Because
-each call specifies only a single vertex, it is possible to explicitly
-specify per-primitive attributes such as a single normal per
-individual triangle.
-.P
-Changes made to array data between the execution of _cmnd(Begin) and the
-corresponding execution of _cmnd(End) may affect calls to _cmnd that are made
-within the same _cmnd(Begin)/_cmnd(End) period in non-sequential ways.
-That is, a call to
-.br
-_cmnd that precedes a change to array data may
-access the changed data, and a call that follows a change to array data
-may access original data.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-_cmnd is included in display lists. If _cmnd is entered into a
-display list, the necessary array data (determined by the array
-pointers and enables) is also entered into the display list. Because
-the array pointers and enables are client-side state, their values
-affect display lists when the lists are created, not when the lists
-are executed.
-.SH SEE ALSO
-_cmnd(ClientActiveTextureARB),
-_cmnd(ColorPointer),
-_cmnd(DrawArrays),
-_cmnd(EdgeFlagPointer),
-_cmnd(GetPointerv),
-_cmnd(IndexPointer),
-_cmnd(InterleavedArrays),
-_cmnd(NormalPointer),
-_cmnd(TexCoordPointer),
-_cmnd(VertexPointer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/begin.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/begin.gl
deleted file mode 100755
index 6e08bb1b0..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/begin.gl
+++ /dev/null
@@ -1,229 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_header(Begin,delimit the vertices of a primitive or a group of like primitives)
-_names(Begin)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the primitive or primitives that will be created from vertices
-presented between _cmnd(Begin) and the subsequent _cmnd(End).
-Ten symbolic constants are accepted:
-_const(POINTS),
-_const(LINES),
-_const(LINE_STRIP),
-_const(LINE_LOOP),
-_const(TRIANGLES),
-_const(TRIANGLE_STRIP),
-_const(TRIANGLE_FAN),
-_const(QUADS),
-_const(QUAD_STRIP), and
-_const(POLYGON).
-_names(End)
-.SH DESCRIPTION
-_cmnd(Begin) and _cmnd(End) delimit the vertices that define a primitive or
-a group of like primitives.
-_cmnd(Begin) accepts a single argument that specifies in which of ten ways the
-vertices are interpreted.
-Taking $n$ as an integer count starting at one,
-and $N$ as the total number of vertices specified,
-the interpretations are as follows:
-.TP 23
-_const(POINTS)
-Treats each vertex as a single point.
-Vertex $n$ defines point $n$.
-$N$ points are drawn.
-.TP
-_const(LINES)
-Treats each pair of vertices as an independent line segment.
-Vertices $2n^-^1$ and $2n$ define line $n$.
-$N/2$ lines are drawn.
-.TP
-_const(LINE_STRIP)
-Draws a connected group of line segments from the first vertex
-to the last.
-Vertices $n$ and $n~+~1$ define line $n$.
-$N^-^1$ lines are drawn.
-.TP
-_const(LINE_LOOP)
-Draws a connected group of line segments from the first vertex
-to the last,
-then back to the first.
-Vertices $n$ and $n~+~1$ define line $n$.
-The last line, however, is defined by vertices $N$ and $1$.
-$N$ lines are drawn.
-.TP
-_const(TRIANGLES)
-Treats each triplet of vertices as an independent triangle.
-Vertices $3n^-^2$, $3n^-^1$, and $3n$ define triangle $n$.
-$N/3$ triangles are drawn.
-.BP
-.TP
-_const(TRIANGLE_STRIP)
-Draws a connected group of triangles. One triangle is defined for each
-vertex presented after the first two vertices. For odd $n$, vertices
-$n$, $n~+~1$, and $n~+~2$ define triangle $n$. For even $n$, vertices
-$n~+~1$, $n$, and $n~+~2$ define triangle $n$. $N^-^2$ triangles are
-drawn.
-.TP
-_const(TRIANGLE_FAN)
-Draws a connected group of triangles.
-One triangle is defined for each vertex presented after the first two vertices.
-Vertices $1$,
-$n~+~1$,
-and $n~+~2$ define triangle $n$.
-$N^-^2$ triangles are drawn.
-.TP
-_const(QUADS)
-Treats each group of four vertices as an independent quadrilateral.
-Vertices $4n^-^3$, $4n^-^2$, $4n^-^1$, and $4n$
-define quadrilateral $n$.
-$N/4$ quadrilaterals are drawn.
-.TP
-_const(QUAD_STRIP)
-Draws a connected group of quadrilaterals.
-One quadrilateral is defined for each pair of vertices presented
-after the first pair.
-Vertices $2n^-^1$, $2n$, $2n~+~2$, and $2n~+~1$ define quadrilateral $n$.
-$N/2^-^1$ quadrilaterals are drawn.
-Note that the order in which vertices are used to construct a quadrilateral
-from strip data is different from that used with independent data.
-.TP
-_const(POLYGON)
-Draws a single,
-convex polygon.
-Vertices $1$ through $N$ define this polygon.
-.P
-Only a subset of GL commands can be used between _cmnd(Begin) and _cmnd(End).
-The commands are
-_cmnd(Vertex),
-_cmnd(Color),
-_cmnd(Index),
-_cmnd(Normal),
-_cmnd(TexCoord),
-_cmnd(EvalCoord),
-_cmnd(EvalPoint),
-_cmnd(ArrayElement),
-_cmnd(Material), and
-_cmnd(EdgeFlag).
-Also,
-it is acceptable to use
-_cmnd(CallList) or
-_cmnd(CallLists) to execute
-display lists that include only the preceding commands.
-If any other GL command is executed between _cmnd(Begin) and _cmnd(End),
-the error flag is set and the command is ignored.
-.P
-Regardless of the value chosen for _param1(1),
-there is no limit to the number of vertices that can be defined
-between _cmnd(Begin) and _cmnd(End).
-Lines,
-triangles,
-quadrilaterals,
-and polygons that are incompletely specified are not drawn.
-Incomplete specification results when either too few vertices are
-provided to specify even a single primitive or when an incorrect multiple
-of vertices is specified. The incomplete primitive is ignored; the rest are drawn.
-.P
-The minimum specification of vertices
-for each primitive is as follows:
-1 for a point,
-2 for a line,
-3 for a triangle,
-4 for a quadrilateral,
-and 3 for a polygon.
-Modes that require a certain multiple of vertices are
-_const(LINES) (2),
-_const(TRIANGLES) (3),
-_const(QUADS) (4),
-and _const(QUAD_STRIP) (2).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1(1) is set to an unaccepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd(Begin) is executed between a
-_cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd(End) is executed without being
-preceded by a _cmnd(Begin).
-.P
-_const(INVALID_OPERATION) is generated if a command other than
-_cmnd(Vertex),
-_cmnd(Color),
-_cmnd(Index),
-_cmnd(Normal),
-_cmnd(TexCoord),
-_cmnd(EvalCoord),
-_cmnd(EvalPoint),
-_cmnd(ArrayElement),
-_cmnd(Material),
-_cmnd(EdgeFlag),
-_cmnd(CallList), or
-_cmnd(CallLists) is executed between
-the execution of _cmnd(Begin) and the corresponding
-execution _cmnd(End).
-.P
-Execution of
-_cmnd(EnableClientState),
-_cmnd(DisableClientState),
-_cmnd(EdgeFlagPointer),
-_cmnd(TexCoordPointer),
-_cmnd(ColorPointer),
-_cmnd(IndexPointer),
-_cmnd(NormalPointer),
-.br
-_cmnd(VertexPointer),
-_cmnd(InterleavedArrays), or
-_cmnd(PixelStore) is not allowed after a call to _cmnd(Begin) and before
-the corresponding call to _cmnd(End),
-but an error may or may not be generated.
-.SH SEE ALSO
-_cmnd(ArrayElement),
-_cmnd(CallList),
-_cmnd(CallLists),
-_cmnd(Color),
-_cmnd(EdgeFlag),
-_cmnd(EvalCoord),
-.br
-_cmnd(EvalPoint),
-_cmnd(Index),
-_cmnd(Material),
-_cmnd(Normal),
-_cmnd(TexCoord),
-_cmnd(Vertex)
-
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/bindtexture.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/bindtexture.gl
deleted file mode 100755
index 077b8b10c..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/bindtexture.gl
+++ /dev/null
@@ -1,128 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(BindTexture,bind a named texture to a texturing target)
-_names(BindTexture)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the target to which the texture is bound.
-Must be either
-_const(TEXTURE_1D),
-_const(TEXTURE_2D), or
-_const(TEXTURE_3D).
-_phead(_param2)
-Specifies the name of a texture.
-.SH DESCRIPTION
-_cmnd lets you create or use a named texture. Calling _cmnd with
-.br
-_param1 set to
-_const(TEXTURE_1D), _const(TEXTURE_2D), _const(TEXTURE_3D) and _param2
-set to the name
-of the newtexture binds the texture name to the target.
-When a texture is bound to a target, the previous binding for that
-target is automatically broken.
-.P
-Texture names are unsigned integers. The value zero is reserved to
-represent the default texture for each texture target.
-Texture names and the corresponding texture contents are local to
-the shared display-list space (see _cmnd(XCreateContext)) of the current
-GL rendering context;
-two rendering contexts share texture names only if they
-also share display lists.
-.P
-You may use _cmnd(GenTextures) to generate a set of new texture names.
-.P
-When a texture is first bound, it assumes the dimensionality of its
-target: A texture first bound to _const(TEXTURE_1D) becomes
-one-dimensional, and a texture first bound to _const(TEXTURE_2D) becomes
-two-dimensional, and a texture first bound to _const(TEXTURE_3D) becomes
-a three-dimensional texture. The state of a one-dimensional texture
-immediately after it is first bound is equivalent to the state of the
-default _const(TEXTURE_1D) at GL initialization, and similarly for
-two-, and three-dimensional textures.
-.P
-While a texture is bound, GL operations on the target to which it is
-bound affect the bound texture, and queries of the target to which it
-is bound return state from the bound texture. If texture mapping of
-the dimensionality of the target to which a texture is bound is
-active, the bound texture is used.
-In effect, the texture targets become aliases for the textures currently
-bound to them, and the texture name zero refers to the default textures
-that were bound to them at initialization.
-.P
-A texture binding created with _cmnd remains active until a different
-texture is bound to the same target, or until the bound texture is
-deleted with _cmnd(DeleteTextures).
-.P
-Once created, a named texture may be re-bound to the target of the
-matching dimensionality as often as needed.
-It is usually much faster to use _cmnd to bind an existing named
-texture to one of the texture targets than it is to reload the texture image
-using _cmnd(TexImage1D), _cmnd(TexImage2D), or _cmnd(TexImage3D).
-For additional control over performance, use
-_cmnd(PrioritizeTextures).
-.P
-_cmnd is included in display lists.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not one of the allowable
-values.
-.P
-_const(INVALID_OPERATION) is generated if _param2 has a dimensionality
-that doesn't match that of _param1.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(TEXTURE_BINDING_1D)
-.br
-_cmnd(Get) with argument _const(TEXTURE_BINDING_2D)
-.br
-_cmnd(Get) with argument _const(TEXTURE_BINDING_3D)
-.SH SEE ALSO
-_cmnd(AreTexturesResident),
-_cmnd(DeleteTextures),
-_cmnd(GenTextures),
-_cmnd(Get),
-.br
-_cmnd(GetTexParameter),
-_cmnd(IsTexture),
-_cmnd(PrioritizeTextures),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexParameter)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/bitmap.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/bitmap.gl
deleted file mode 100755
index bd628ae9f..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/bitmap.gl
+++ /dev/null
@@ -1,138 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_header(Bitmap,draw a bitmap)
-_names(Bitmap)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1 _param2)
-Specify the pixel width and height of the bitmap image.
-_phead(_param3 _param4)
-Specify the location of the origin in the bitmap image.
-The origin is measured from the lower left corner of the bitmap,
-with right and up being the positive axes.
-_phead(_param5 _param6)
-Specify the \f2x\fP and \f2y\fP offsets to be added to the current raster position
-after the bitmap is drawn.
-_phead(_param7)
-Specifies the address of the bitmap image.
-.SH DESCRIPTION
-A bitmap is a binary image.
-When drawn,
-the bitmap is positioned relative to the current raster position,
-and frame buffer pixels corresponding to 1's in the bitmap are
-written using the current raster color or index.
-Frame buffer pixels corresponding to 0's in the bitmap are not modified.
-.P
-_cmnd takes seven arguments.
-The first pair specifies the width and height of the bitmap image.
-The second pair specifies the location of the bitmap origin relative
-to the lower left corner of the bitmap image.
-The third pair of arguments specifies \f2x\fP and \f2y\fP offsets to be added
-to the current raster position after the bitmap has been drawn.
-The final argument is a pointer to the bitmap image itself.
-.P
-The bitmap image is interpreted like image data for the _cmnd(DrawPixels)
-command,
-with _param1 and _param2 corresponding to the width and height arguments
-of that command,
-and with \f2type\fP set to _const(BITMAP)
-and \f2format\fP set to _const(COLOR_INDEX).
-.BP
-Modes specified using _cmnd(PixelStore) affect the
-interpretation of bitmap image data;
-modes specified using _cmnd(PixelTransfer) do not.
-.P
-If the current raster position is invalid, _cmnd is ignored.
-Otherwise,
-the lower left corner of the bitmap image is positioned at the window coordinates
-.ce
-.sp
-$ x sub w ~=~ \(lf ~ x sub r ~-~ x sub o ~ \(rf $
-.br
-.sp
-.ce
-$ y sub w ~=~ \(lf ~ y sub r ~-~ y sub o ~ \(rf $
-.sp
-where $ ( x sub r , y sub r ) $ is the raster position
-and $ ( x sub o , y sub o ) $ is the bitmap origin.
-Fragments are then generated for each pixel corresponding to a 1 (one)
-in the bitmap image.
-These fragments are generated using the current raster \f2z\fP coordinate,
-color or color index, and current raster texture coordinates.
-They are then treated just as if they had been generated
-by a point, line, or polygon,
-including texture mapping,
-.br
-fogging,
-and all per-fragment operations such as alpha and depth testing.
-.P
-After the bitmap has been drawn,
-the \f2x\fP and \f2y\fP coordinates of the current raster position are offset by
-_param5 and _param6.
-No change is made to the \f2z\fP coordinate of the current raster position,
-or to the current raster color, texture coordinates, or index.
-.SH NOTES
-To set a valid raster position outside the viewport, first set a valid
-raster position inside the viewport, then call _cmnd(Bitmap) with NULL
-as the _param7 parameter and with _param5 and _param6 set to
-the offsets of the new raster position. This technique is useful when
-panning an image around the viewport.
-.SH ERRORS
-_const(INVALID_VALUE) is generated if _param1 or _param2 is negative.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin) and the corresponding execution of
-_cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(CURRENT_RASTER_POSITION)
-.br
-_cmnd(Get) with argument _const(CURRENT_RASTER_COLOR)
-.br
-_cmnd(Get) with argument _const(CURRENT_RASTER_DISTANCE)
-.br
-_cmnd(Get) with argument _const(CURRENT_RASTER_INDEX)
-.br
-_cmnd(Get) with argument _const(CURRENT_RASTER_TEXTURE_COORDS)
-.br
-_cmnd(Get) with argument _const(CURRENT_RASTER_POSITION_VALID)
-.SH SEE ALSO
-_cmnd(DrawPixels),
-_cmnd(PixelStore),
-_cmnd(PixelTransfer),
-_cmnd(RasterPos)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/blendcolor.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/blendcolor.gl
deleted file mode 100755
index 2bae420ab..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/blendcolor.gl
+++ /dev/null
@@ -1,65 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(BlendColor, set the blend color)
-_names(BlendColor)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1 _param2 _param3 _param4)
-specify the components of _const(BLEND_COLOR)
-.SH DESCRIPTION
-The _const(BLEND_COLOR) may be used to calculate the source and destination
-blending factors. The color components are clamped to the range [0,\ 1]
-before being stored. See _cmnd(BlendFunc) for a complete description of the
-blending operations.
-Initially the _const(BLEND_COLOR) is set to (0, 0, 0, 0).
-.SH NOTES
-_cmnd is part of the _arbstring(imaging) subset. _cmnd is present only
-if _arbstring(imaging) is returned when _cmnd(GetString) is called with
-_const(EXTENSIONS) as its argument.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.P
-.SH ASSOCIATED GETS
-_cmnd(Get) with an argument of _const(BLEND_COLOR)
-.SH SEE ALSO
-_cmnd(BlendEquation),
-_cmnd(BlendFunc),
-_cmnd(GetString)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/blendequation.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/blendequation.gl
deleted file mode 100755
index f3c49cda3..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/blendequation.gl
+++ /dev/null
@@ -1,163 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(BlendEquation, set the blend equation)
-_names(BlendEquation)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-specifies how source and destination colors are combined.
-It must be _const(FUNC_ADD), _const(FUNC_SUBTRACT),
-_const(FUNC_REVERSE_SUBTRACT), _const(MIN), _const(MAX).
-
-.SH DESCRIPTION
-The blend equation determines how a new pixel (the ``source'' color)
-is combined with a pixel already in the framebuffer (the ``destination''
-color).
-.TP
-_const(MIN)
-sets the blend equation so that each component of the result color
-is the minimum of the corresponding components of the source and destination
-colors.
-.TP
-_const(MAX)
-sets the blend equation so that each component of the result color
-is the maximum of the corresponding components of the source and destination
-colors.
-.P
-The remaining blend equations use the source and destination blend factors
-specified by _cmnd(BlendFunc).
-See _cmnd(BlendFunc) for a description of the various blend factors.
-.P
-In the equations that follow, source and destination
-color components are referred to as
-$(R sub s, G sub s, B sub s, A sub s )$
-and
-$(R sub d, G sub d, B sub d, A sub d )$,
-respectively.
-The result color is referred to as
-$(R sub r, G sub r, B sub r, A sub r )$.
-The source and destination blend factors are denoted
-$(s sub R, s sub G, s sub B, s sub A )$ and
-$(d sub R, d sub G, d sub B, d sub A )$, respectively.
-For these equations all color components are understood to have values
-in the range [0,\ 1].
-.TP
-_const(FUNC_ADD)
-sets the blend equation so that the source and destination
-data are added.
-Each component of the source color is
-multiplied by the corresponding source factor, then
-each component of the destination color is multiplied
-by the corresponding destination factor.
-The result is the componentwise sum of the two products, clamped to the
-range [0,\ 1].
-.P
-.RS
-.nf
-.IP
-$Rr ~=~ mark min (1, ~R sub s~s sub R ~+~ R sub d~d sub R )$
-$Gr ~=~ lineup min (1, ~G sub s~s sub G ~+~ G sub d~d sub G )$
-$Br ~=~ lineup min (1, ~B sub s~s sub B ~+~ B sub d~d sub B )$
-$Ar ~=~ lineup min (1, ~A sub s~s sub A ~+~ A sub d~d sub A )$
-.fi
-.RE
-.TP
-_const(FUNC_SUBTRACT)
-Is like _const(FUNC_ADD) except the product of the destination factor and
-the destination color is componentwise subtracted from the product of the
-source factor and the source color.
-The result is clamped to the range [0,\ 1].
-.RS
-.nf
-.IP
-$Rr ~=~ mark max (0 , ~R sub s~s sub R ~-~ R sub d~d sub R )$
-$Gr ~=~ lineup max (0 , ~G sub s~s sub G ~-~ G sub d~d sub G )$
-$Br ~=~ lineup max (0 , ~B sub s~s sub B ~-~ B sub d~d sub B )$
-$Ar ~=~ lineup max (0 , ~A sub s~s sub A ~-~ A sub d~d sub A )$
-.fi
-.RE
-.TP
-_const(FUNC_REVERSE_SUBTRACT)
-Is like _const(FUNC_ADD) except the product of the source factor and the
-source color is componentwise subtracted from the product of the destination
-factor and the destination color.
-The result is clamped to the range [0,\ 1].
-.RS
-.nf
-.IP
-$Rr ~=~ mark max (0 , ~R sub d~d sub R ~-~ R sub s~s sub R )$
-$Gr ~=~ lineup max (0 , ~G sub d~d sub G ~-~ G sub s~s sub G )$
-$Br ~=~ lineup max (0 , ~B sub d~d sub B ~-~ B sub s~s sub B )$
-$Ar ~=~ lineup max (0 , ~A sub d~d sub A ~-~ A sub s~s sub A )$
-.fi
-.RE
-.P
-The _const(MIN) and _const(MAX) equations are useful for applications
-that analyze
-.br
-image data (image thresholding against a constant color,
-for example).
-The _const(FUNC_ADD) equation is useful
-for antialiasing and transparency, among other things.
-.P
-Initially, the blend equation is set to _const(FUNC_ADD).
-.P
-.SH NOTES
-_cmnd is part of the _arbstring(imaging) subset. _cmnd is present only
-if _arbstring(imaging) is returned when _cmnd(GetString) is called with
-_const(EXTENSIONS) as its argument.
-.P
-The _const(MIN), and _const(MAX) equations do not use
-the source or destination factors, only the source and destination colors.
-.P
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not one of
-_const(FUNC_ADD), _const(FUNC_SUBTRACT), _const(FUNC_REVERSE_SUBTRACT),
-_const(MAX), or _const(MIN).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-.TP
-_cmnd(Get) with an argument of _const(BLEND_EQUATION)
-.SH SEE ALSO
-_cmnd(GetString),
-_cmnd(BlendColor),
-_cmnd(BlendFunc)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/blendfunc.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/blendfunc.gl
deleted file mode 100755
index 7afec2732..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/blendfunc.gl
+++ /dev/null
@@ -1,264 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(BlendFunc, specify pixel arithmetic)
-_names(BlendFunc)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies how the red, green, blue,
-and alpha source blending factors are computed.
-The following symbolic constants are accepted:
-_const(ZERO),
-_const(ONE),
-_const(DST_COLOR),
-_const(ONE_MINUS_DST_COLOR),
-_const(SRC_ALPHA),
-_const(ONE_MINUS_SRC_ALPHA),
-_const(DST_ALPHA),
-_const(ONE_MINUS_DST_ALPHA), and
-_const(SRC_ALPHA_SATURATE).
-The initial value is _const(ONE).
-.TE
-
-Additionally, if the _arbstring(imaging) extension is supported, the
-following constants are accepted:
-_const(CONSTANT_COLOR),
-_const(ONE_MINUS_CONSTANT_COLOR),
-_const(CONSTANT_ALPHA),
-_const(ONE_MINUS_CONSTANT_ALPHA).
-_phead(_param2)
-Specifies how the red, green, blue,
-and alpha destination blending factors are computed.
-Eight symbolic constants are accepted:
-_const(ZERO),
-_const(ONE),
-_const(SRC_COLOR),
-_const(ONE_MINUS_SRC_COLOR),
-_const(SRC_ALPHA),
-_const(ONE_MINUS_SRC_ALPHA),
-_const(DST_ALPHA), and
-_const(ONE_MINUS_DST_ALPHA).
-The initial value is _const(ZERO).
-.TE
-
-Additionally, if the _arbstring(imaging) extension is supported, the
-following constants are accepted:
-_const(CONSTANT_COLOR),
-_const(ONE_MINUS_CONSTANT_COLOR),
-_const(CONSTANT_ALPHA),
-_const(ONE_MINUS_CONSTANT_ALPHA).
-.SH DESCRIPTION
-In RGBA mode, pixels can be drawn using a function that blends
-the incoming (source) RGBA values with the RGBA values
-that are already in the frame buffer (the destination values).
-Blending is initially disabled.
-Use _cmnd(Enable) and _cmnd(Disable) with argument _const(BLEND)
-to enable and disable blending.
-.P
-_cmnd defines the operation of blending when it is enabled.
-_param1 specifies which of nine methods is used to scale the
-source color components.
-_param2 specifies which of eight methods is used to scale the
-destination color components.
-The eleven possible methods are described in the following table.
-Each method defines four scale factors,
-one each for red, green, blue, and alpha.
-.P
-In the table and in subsequent equations, source and destination
-color components are referred to as
-$(R sub s , G sub s , B sub s , A sub s )$ and
-$(R sub d , G sub d , B sub d , A sub d )$.
-The color specified by _cmnd(BlendColor) is referred to as
-$(R sub c , G sub c , B sub c , A sub c )$.
-They are understood to have integer values between 0 and
-$(k sub R , k sub G , k sub B , k sub A )$,
-where
-.P
-.RS
-.ce
-$k sub c ~=~ 2 sup m sub c - 1$
-.RE
-.P
-and
-$(m sub R , m sub G , m sub B , m sub A )$
-is the number of red,
-green,
-blue,
-and alpha bitplanes.
-.P
-Source and destination scale factors are referred to as
-$(s sub R , s sub G , s sub B , s sub A )$ and
-$(d sub R , d sub G , d sub B , d sub A )$.
-The scale factors described in the table,
-denoted $(f sub R , f sub G , f sub B , f sub A )$,
-represent either source or destination factors.
-All scale factors have range [0,\ 1].
-.P
-.TS
-center;
-lb cb
-l c .
-_
-Parameter $(f sub R , ~~ f sub G , ~~ f sub B , ~~ f sub A )$
-_
-_const(ZERO) $(0, ~0, ~0, ~0 )$
-_const(ONE) $(1, ~1, ~1, ~1 )$
-_const(SRC_COLOR) $(R sub s / k sub R , ~G sub s / k sub G , ~B sub s / k sub B , ~A sub s / k sub A )$
-_const(ONE_MINUS_SRC_COLOR) $(1, ~1, ~1, ~1 ) ~-~ (R sub s / k sub R , ~G sub s / k sub G , ~B sub s / k sub B , ~A sub s / k sub A )$
-_const(DST_COLOR) $(R sub d / k sub R , ~G sub d / k sub G , ~B sub d / k sub B , ~A sub d / k sub A )$
-_const(ONE_MINUS_DST_COLOR) $(1, ~1, ~1, ~1 ) ~-~ (R sub d / k sub R , ~G sub d / k sub G , ~B sub d / k sub B , ~A sub d / k sub A )$
-_const(SRC_ALPHA) $(A sub s / k sub A , ~A sub s / k sub A , ~A sub s / k sub A , ~A sub s / k sub A )$
-_const(ONE_MINUS_SRC_ALPHA) $(1, ~1, ~1, ~1 ) ~-~ (A sub s / k sub A , ~A sub s / k sub A , ~A sub s / k sub A , ~A sub s / k sub A )$
-_const(DST_ALPHA) $(A sub d / k sub A , ~A sub d / k sub A , ~A sub d / k sub A , ~A sub d / k sub A )$
-_const(ONE_MINUS_DST_ALPHA) $(1, ~1, ~1, ~1 ) ~-~ (A sub d / k sub A , ~A sub d / k sub A , ~A sub d / k sub A , ~A sub d / k sub A )$
-_const(SRC_ALPHA_SATURATE) $(i, ~i, ~i, ~1 )$
-_const(CONSTANT_COLOR) $(R sub c, G sub c, B sub c, A sub c)$
-_const(ONE_MINUS_CONSTANT_COLOR) $(1, ~1, ~1, ~1 ) ~-~ (R sub c, G sub c, B sub c, A sub c)$
-_const(CONSTANT_ALPHA) $(A sub c, A sub c, A sub c, A sub c)$
-_const(ONE_MINUS_CONSTANT_ALPHA) $(1, ~1, ~1, ~1 ) ~-~ (A sub c, A sub c, A sub c, A sub c)$
-_
-.TE
-.sp
-In the table,
-.P
-.RS
-.nf
-.IP
-$i ~=~ min (A sub s , ~k sub A ~-~ A sub d ) ~/~ k sub A$
-.fi
-.RE
-.P
-To determine the blended RGBA values of a pixel when drawing in RGBA mode,
-the system uses the following equations:
-.P
-.RS
-.nf
-.IP
-$R sub d ~=~ mark min ( k sub R, ~R sub s~s sub R~+~R sub d~d sub R )$
-$G sub d ~=~ lineup min ( k sub G, ~G sub s~s sub G~+~G sub d~d sub G )$
-$B sub d ~=~ lineup min ( k sub B, ~B sub s~s sub B~+~B sub d~d sub B )$
-$A sub d ~=~ lineup min ( k sub A, ~A sub s~s sub A~+~A sub d~d sub A )$
-.fi
-.RE
-.P
-Despite the apparent precision of the above equations,
-blending arithmetic is not exactly specified,
-because blending operates with imprecise integer color values.
-However,
-a blend factor that should be equal to 1
-is guaranteed not to modify its multiplicand,
-and a blend factor equal to 0 reduces its multiplicand to 0.
-For example,
-when _param1 is _const(SRC_ALPHA),
-_param2 is _const(ONE_MINUS_SRC_ALPHA),
-and $A sub s$ is equal to $k sub A$,
-the equations reduce to simple replacement:
-.P
-.RS
-.nf
-.IP
-$R sub d ~=~ mark R sub s$
-$G sub d ~=~ lineup G sub s$
-$B sub d ~=~ lineup B sub s$
-$A sub d ~=~ lineup A sub s$
-.fi
-.RE
-.P
-.SH EXAMPLES
-.P
-Transparency is best implemented using blend function
-(_const(SRC_ALPHA), _const(ONE_MINUS_SRC_ALPHA))
-with primitives sorted from farthest to nearest.
-Note that this transparency calculation does not require
-the presence of alpha bitplanes in the frame buffer.
-.P
-Blend function
-(_const(SRC_ALPHA), _const(ONE_MINUS_SRC_ALPHA))
-is also useful for rendering antialiased points and lines
-in arbitrary order.
-.P
-Polygon antialiasing is optimized using blend function
-.br
-(_const(SRC_ALPHA_SATURATE), _const(ONE))
-with polygons sorted from nearest to farthest.
-(See the _cmnd(Enable), _cmnd(Disable) reference page and the
-_const(POLYGON_SMOOTH) argument for information on polygon antialiasing.)
-Destination alpha bitplanes,
-which must be present for this blend function to operate correctly,
-store the accumulated coverage.
-.SH NOTES
-Incoming (source) alpha is correctly thought of as a material opacity,
-ranging from 1.0 ($K sub A$), representing complete opacity,
-to 0.0 (0), representing complete
-transparency.
-.P
-When more than one color buffer is enabled for drawing,
-the GL performs blending separately for each enabled buffer,
-using the contents of that buffer for destination color.
-(See _cmnd(DrawBuffer).)
-.P
-Blending affects only RGBA rendering.
-It is ignored by color index renderers.
-.P
-_const(CONSTANT_COLOR), _const(ONE_MINUS_CONSTANT_COLOR),
-_const(CONSTANT_ALPHA), _const(ONE_MINUS_CONSTANT_ALPHA) are only
-available if the _arbstring(imaging) is supported by your implementation.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if either _param1 or _param2 is not an
-accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(BLEND_SRC)
-.br
-_cmnd(Get) with argument _const(BLEND_DST)
-.br
-_cmnd(IsEnabled) with argument _const(BLEND)
-.br
-.SH SEE ALSO
-_cmnd(AlphaFunc),
-_cmnd(BlendColor),
-_cmnd(BlendEquation),
-_cmnd(Clear),
-_cmnd(DrawBuffer),
-_cmnd(Enable),
-_cmnd(LogicOp),
-_cmnd(StencilFunc)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/c b/xc/extras/ogl-sample/main/doc/man/mangl/standard/c
deleted file mode 100755
index 8cbb4d3ad..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/c
+++ /dev/null
@@ -1,2 +0,0 @@
-.Op + c
-.ds BN \f6Graphics Reference, C Edition\f1
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/calllist.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/calllist.gl
deleted file mode 100755
index 340146bf7..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/calllist.gl
+++ /dev/null
@@ -1,77 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_header(CallList,execute a display list)
-_names(CallList)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the integer name of the display list to be executed.
-.SH DESCRIPTION
-_cmnd causes the named display list to be executed.
-The commands saved in the display list are executed in order,
-just as if they were called without using a display list.
-If _param1 has not been defined as a display list,
-_cmnd is ignored.
-.P
-_cmnd can appear inside a display list.
-To avoid the possibility of infinite recursion resulting from display lists
-calling one another,
-a limit is placed on the nesting level of display
-lists during display-list execution.
-This limit is at least 64, and it depends on the implementation.
-.P
-GL state is not saved and restored across a call to _cmnd.
-Thus,
-changes made to GL state during the execution of a display list
-remain after execution of the display list is completed.
-Use _cmnd(PushAttrib),
-_cmnd(PopAttrib),
-_cmnd(PushMatrix),
-and _cmnd(PopMatrix) to preserve GL state across _cmnd calls.
-.SH NOTES
-Display lists can be executed between a call to _cmnd(Begin)
-and the corresponding call to _cmnd(End),
-as long as the display list includes only commands that are allowed
-in this interval.
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(MAX_LIST_NESTING)
-.br
-_cmnd(IsList)
-.SH SEE ALSO
-_cmnd(CallLists),
-_cmnd(DeleteLists),
-_cmnd(GenLists),
-_cmnd(NewList),
-_cmnd(PushAttrib),
-_cmnd(PushMatrix)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/calllists.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/calllists.gl
deleted file mode 100755
index c9a3ee0d5..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/calllists.gl
+++ /dev/null
@@ -1,177 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_header(CallLists,execute a list of display lists)
-_names(CallLists)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the number of display lists to be executed.
-_phead(_param2)
-Specifies the type of values in _param3.
-Symbolic constants
-_const(BYTE),
-_const(UNSIGNED_BYTE),
-_const(SHORT),
-_const(UNSIGNED_SHORT),
-_const(INT),
-_const(UNSIGNED_INT),
-_const(FLOAT),
-_const(2_BYTES),
-_const(3_BYTES), and
-_const(4_BYTES) are accepted.
-_phead(_param3)
-Specifies the address of an array of name offsets in the display list.
-The pointer type is void because the offsets can be bytes,
-shorts,
-ints,
-or floats,
-depending on the value of _param2.
-.SH DESCRIPTION
-_cmnd causes each display list in the list of names passed as _param3
-to be executed.
-As a result,
-the commands saved in each display list are executed in order,
-just as if they were called without using a display list.
-Names of display lists that have not been defined are ignored.
-.P
-_cmnd provides an efficient means for executing more than one display list.
-_param2 allows lists with various name formats to be accepted.
-The formats are as follows:
-.TP 25
-_const(BYTE)
-_param3 is treated as an array of signed bytes,
-each in the range \-128 through 127.
-.TP
-_const(UNSIGNED_BYTE)
-_param3 is treated as an array of unsigned bytes,
-each in the range 0 through 255.
-.TP
-_const(SHORT)
-_param3 is treated as an array of signed two-byte integers,
-each in the range \-32768 through 32767.
-.TP
-_const(UNSIGNED_SHORT)
-_param3 is treated as an array of unsigned two-byte integers,
-each in the range 0 through 65535.
-.TP
-_const(INT)
-_param3 is treated as an array of signed four-byte integers.
-.TP
-_const(UNSIGNED_INT)
-_param3 is treated as an array of unsigned four-byte integers.
-.TP
-_const(FLOAT)
-_param3 is treated as an array of four-byte floating-point values.
-.TP
-_const(2_BYTES)
-_param3 is treated as an array of unsigned bytes.
-Each pair of bytes specifies a single display-list name.
-The value of the pair is computed as 256 times the unsigned value
-of the first byte plus the unsigned value of the second byte.
-.TP
-_const(3_BYTES)
-_param3 is treated as an array of unsigned bytes.
-Each triplet of bytes specifies a single display-list name.
-The value of the triplet is computed as 65536 times the unsigned value
-of the first byte,
-plus 256 times the unsigned value of the second byte,
-plus the unsigned value of the third byte.
-.TP
-_const(4_BYTES)
-_param3 is treated as an array of unsigned bytes.
-Each quadruplet of bytes specifies a single display-list name.
-The value of the quadruplet is computed as 16777216 times the unsigned value
-of the first byte,
-plus 65536 times the unsigned value of the second byte,
-plus 256 times the unsigned value of the third byte,
-plus the unsigned value of the fourth byte.
-.P
-The list of display-list names is not null-terminated.
-Rather,
-_param1 specifies how many names are to be taken from _param3.
-.P
-An additional level of indirection is made available with the
-_cmnd(ListBase) command,
-which specifies an unsigned offset that is added to each display-list
-name specified in _param3 before that display list is executed.
-.P
-_cmnd can appear inside a display list.
-To avoid the possibility of infinite recursion resulting from display lists
-calling one another,
-a limit is placed on the nesting level of display
-lists during display-list execution.
-This limit must be at least 64, and it depends on the implementation.
-.P
-GL state is not saved and restored across a call to _cmnd.
-Thus,
-changes made to GL state during the execution of the display lists
-remain after execution is completed.
-Use _cmnd(PushAttrib),
-_cmnd(PopAttrib),
-_cmnd(PushMatrix),
-and _cmnd(PopMatrix) to preserve GL state across _cmnd calls.
-.SH NOTES
-Display lists can be executed between a call to _cmnd(Begin)
-and the corresponding call to _cmnd(End),
-as long as the display list includes only commands that are allowed
-in this interval.
-.SH ERRORS
-_const(INVALID_VALUE) is generated if _param1 is negative.
-.P
-_const(INVALID_ENUM) is generated if _param2 is not one of
-_const(BYTE),
-_const(UNSIGNED_BYTE),
-_const(SHORT),
-_const(UNSIGNED_SHORT),
-_const(INT),
-_const(UNSIGNED_INT),
-_const(FLOAT),
-_const(2_BYTES),
-_const(3_BYTES),
-_const(4_BYTES).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(LIST_BASE)
-.br
-_cmnd(Get) with argument _const(MAX_LIST_NESTING)
-.br
-_cmnd(IsList)
-.SH SEE ALSO
-_cmnd(CallList),
-_cmnd(DeleteLists),
-_cmnd(GenLists),
-_cmnd(ListBase),
-_cmnd(NewList),
-_cmnd(PushAttrib),
-.br
-_cmnd(PushMatrix)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/clear.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/clear.gl
deleted file mode 100755
index b9d153b48..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/clear.gl
+++ /dev/null
@@ -1,115 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Clear,clear buffers to preset values)
-_names(Clear)
-.SH PARAMETERS
-_phead(_param1)
-Bitwise OR of masks that indicate the buffers to be cleared.
-The four masks are
-_const(COLOR_BUFFER_BIT),
-_const(DEPTH_BUFFER_BIT),
-_const(ACCUM_BUFFER_BIT), and
-_const(STENCIL_BUFFER_BIT).
-.SH DESCRIPTION
-_cmnd sets the bitplane area of the window to values previously selected
-by _cmnd(ClearColor), _cmnd(ClearIndex), _cmnd(ClearDepth),
-_cmnd(ClearStencil), and _cmnd(ClearAccum).
-Multiple color buffers can be cleared simultaneously by selecting
-more than one buffer at a time using _cmnd(DrawBuffer).
-.P
-The pixel ownership test,
-the scissor test,
-dithering, and the buffer writemasks affect the operation of _cmnd.
-The scissor box bounds the cleared region.
-Alpha function,
-blend function,
-logical operation,
-stenciling,
-texture mapping,
-and depth-buffering are ignored by _cmnd.
-.P
-_cmnd takes a single argument that is the bitwise OR of several
-values indicating which buffer is to be cleared.
-.P
-The values are as follows:
-.TP 28
-_const(COLOR_BUFFER_BIT)
-Indicates the buffers currently enabled for color
-writing.
-.TP
-_const(DEPTH_BUFFER_BIT)
-Indicates the depth buffer.
-.TP
-_const(ACCUM_BUFFER_BIT)
-Indicates the accumulation buffer.
-.TP
-_const(STENCIL_BUFFER_BIT)
-Indicates the stencil buffer.
-.P
-The value to which each buffer is cleared depends on the setting of the
-clear value for that buffer.
-.SH NOTES
-If a buffer is not present,
-then a _cmnd directed at that buffer has no effect.
-.SH ERRORS
-_const(INVALID_VALUE) is generated if any bit other than the four defined
-bits is set in _param1.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(ACCUM_CLEAR_VALUE)
-.br
-_cmnd(Get) with argument _const(DEPTH_CLEAR_VALUE)
-.br
-_cmnd(Get) with argument _const(INDEX_CLEAR_VALUE)
-.br
-_cmnd(Get) with argument _const(COLOR_CLEAR_VALUE)
-.br
-_cmnd(Get) with argument _const(STENCIL_CLEAR_VALUE)
-.SH SEE ALSO
-_cmnd(ClearAccum),
-_cmnd(ClearColor),
-_cmnd(ClearDepth),
-_cmnd(ClearIndex),
-_cmnd(ClearStencil),
-_cmnd(ColorMask),
-_cmnd(DepthMask),
-_cmnd(DrawBuffer),
-_cmnd(Scissor),
-_cmnd(StencilMask)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/clearaccum.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/clearaccum.gl
deleted file mode 100755
index 9787d3324..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/clearaccum.gl
+++ /dev/null
@@ -1,58 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(ClearAccum,specify clear values for the accumulation buffer)
-_names(ClearAccum)
-.SH PARAMETERS
-_phead(_param1 _param2 _param3 _param4)
-Specify the red, green, blue, and alpha values used when the
-accumulation buffer is cleared.
-The initial values are all 0.
-.SH DESCRIPTION
-_cmnd specifies the red, green, blue, and alpha values used by _cmnd(Clear)
-to clear the accumulation buffer.
-.P
-Values specified by _cmnd are clamped to the
-range [-1,\ 1].
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(ACCUM_CLEAR_VALUE)
-.SH SEE ALSO
-_cmnd(Accum),
-_cmnd(Clear)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/clearcolor.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/clearcolor.gl
deleted file mode 100755
index 3272b0321..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/clearcolor.gl
+++ /dev/null
@@ -1,57 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(ClearColor,specify clear values for the color buffers)
-_names(ClearColor)
-.SH PARAMETERS
-_phead(_param1 _param2 _param3 _param4)
-Specify the red, green, blue, and alpha values used when the
-color buffers are cleared.
-The initial values are all 0.
-.SH DESCRIPTION
-_cmnd specifies the red,
-green,
-blue,
-and alpha values used by _cmnd(Clear) to clear the color buffers.
-Values specified by _cmnd are clamped to the range [0,\ 1].
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(COLOR_CLEAR_VALUE)
-.SH SEE ALSO
-_cmnd(Clear)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/cleardepth.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/cleardepth.gl
deleted file mode 100755
index d2b4a8e5d..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/cleardepth.gl
+++ /dev/null
@@ -1,53 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(ClearDepth,specify the clear value for the depth buffer)
-_names(ClearDepth)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the depth value used when the depth buffer is cleared. The
-initial value is 1.
-.SH DESCRIPTION
-_cmnd specifies the depth value used by _cmnd(Clear) to clear the depth buffer.
-Values specified by _cmnd are clamped to the range [0,\ 1].
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(DEPTH_CLEAR_VALUE)
-.SH SEE ALSO
-_cmnd(Clear)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/clearindex.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/clearindex.gl
deleted file mode 100755
index d46d44454..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/clearindex.gl
+++ /dev/null
@@ -1,64 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(ClearIndex,specify the clear value for the color index buffers)
-_names(ClearIndex)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the index used when the color index buffers are cleared.
-The initial value is 0.
-.SH DESCRIPTION
-_cmnd specifies the index used by _cmnd(Clear)
-to clear the color index buffers.
-_param1 is not clamped.
-Rather,
-_param1 is converted to a fixed-point value with unspecified precision
-to the right of the binary point.
-The integer part of this value is then masked with $2 sup m^-^1$,
-where $m$ is the number of bits in a color index stored in the frame buffer.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(INDEX_CLEAR_VALUE)
-.br
-_cmnd(Get) with argument _const(INDEX_BITS)
-.SH SEE ALSO
-_cmnd(Clear)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/clearstencil.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/clearstencil.gl
deleted file mode 100755
index e177e1b2c..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/clearstencil.gl
+++ /dev/null
@@ -1,62 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(ClearStencil,specify the clear value for the stencil buffer)
-_names(ClearStencil)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the index used when the stencil buffer is cleared.
-The initial value is 0.
-.SH DESCRIPTION
-_cmnd specifies the index used by _cmnd(Clear) to clear the stencil buffer.
-_param1 is masked with $2 sup m^-^1$,
-where $m$ is the number of bits in the stencil buffer.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(STENCIL_CLEAR_VALUE)
-.br
-_cmnd(Get) with argument _const(STENCIL_BITS)
-.SH SEE ALSO
-_cmnd(Clear),
-_cmnd(StencilFunc),
-_cmnd(StencilOp),
-_cmnd(StencilMask)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/clientactivetextureARB.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/clientactivetextureARB.gl
deleted file mode 100755
index c09ca2377..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/clientactivetextureARB.gl
+++ /dev/null
@@ -1,71 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn|tbl)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(ClientActiveTextureARB, select active texture unit)
-_names(ClientActiveTextureARB)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies which texture unit to make active. The number
-of texture units is implementation dependent, but must be at least
-two. _param1 must be one of _arbconstidx(TEXTURE)
-where 0 \(<= $ i $ < _arbconst(MAX_TEXTURE_UNITS), which is an
-implementation-dependent value. The initial value is
-_arbconst(TEXTURE0).
-.SH DESCRIPTION
-_cmnd selects the vertex array client state parameters to be modified by
-_cmnd(TexCoordPointer), and enabled or disabled with
-_cmnd(EnableClientState) or _cmnd(DisableClientState), respectively,
-when called with a parameter of _const(TEXTURE_COORD_ARRAY).
-.SH NOTES
-_cmnd is supported only if _arbstring(multitexture) is included in the
-string returned by _cmnd(GetString) when called with the argument
-_const(EXTENSIONS).
-.P
-_cmnd sets _arbconst(CLIENT_ACTIVE_TEXTURE) to the active texture unit.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not one of
-_arbconstidx(TEXTURE), where
-0 \(<= $ i $ < _arbconst(MAX_TEXTURE_UNITS).
-.SH SEE ALSO
-_cmnd(ActiveTextureARB),
-_cmnd(DisableClientState),
-_cmnd(EnableClientState),
-_cmnd(MultiTexCoordARB),
-_cmnd(TexCoordPointer)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/clipplane.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/clipplane.gl
deleted file mode 100755
index 67e742d8e..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/clipplane.gl
+++ /dev/null
@@ -1,95 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(ClipPlane,specify a plane against which all geometry is clipped)
-_names(ClipPlane)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies which clipping plane is being positioned.
-Symbolic names of the form _const(CLIP_PLANE)\f2i\fP,
-where \f2i\fP is an integer between 0 and _const(MAX_CLIP_PLANES)$^-^1$,
-are accepted.
-_phead(_param2)
-Specifies the address of an array of four double-precision floating-point values.
-These values are interpreted as a plane equation.
-.SH DESCRIPTION
-Geometry is always clipped against the boundaries of a six-plane frustum
-in \f2x\fP, \f2y\fP, and \f2z\fP.
-_cmnd allows the specification of additional planes,
-not necessarily perpendicular to the \f2x\fP, \f2y\fP, or \f2z\fP axis,
-against which all geometry is clipped.
-To determine the maximum number of additional clipping planes, call
-_cmnd(GetIntegerv) with argument _const(MAX_CLIP_PLANES). All
-implementations support at least six such clipping planes.
-Because the resulting clipping region is the intersection
-of the defined half-spaces,
-it is always convex.
-.P
-_cmnd specifies a half-space using a four-component plane equation.
-When _cmnd is called,
-_param2 is transformed by the inverse of the modelview matrix
-and stored in the resulting eye coordinates.
-Subsequent changes to the modelview matrix have no effect on the
-stored plane-equation components.
-If the dot product of the eye coordinates of a vertex with the
-stored plane equation components is positive or zero,
-the vertex is \f2in\f1 with respect to that clipping plane.
-Otherwise, it is \f2out\fP.
-.P
-To enable and disable clipping planes, call
-_cmnd(Enable) and _cmnd(Disable) with the argument
-_const(CLIP_PLANE)\f2i\fP,
-where \f2i\fP is the plane number.
-.P
-All clipping planes are initially defined as (0, 0, 0, 0) in eye coordinates
-and are disabled.
-.SH NOTES
-It is always the case that _const(CLIP_PLANE)$i$ = _const(CLIP_PLANE0)$~+~i$.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetClipPlane)
-.br
-_cmnd(IsEnabled) with argument _const(CLIP_PLANE)\f2i\fP
-.SH SEE ALSO
-_cmnd(Enable)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/color.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/color.gl
deleted file mode 100755
index b5e93b83e..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/color.gl
+++ /dev/null
@@ -1,103 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Color, set the current color)
-_names(Color,[34]u*[bsifd])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1 _param2 _param3)
-Specify new red, green, and blue values for the current color.
-_phead(_param4)
-Specifies a new alpha value for the current color.
-Included only in the four-argument _cmnd(Color4) commands.
-_names(Color,[34]u*[bsifd]v)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a pointer to an array that contains red, green, blue,
-and (sometimes) alpha values.
-.SH DESCRIPTION
-The GL stores both a current single-valued color index
-and a current four-valued RGBA color.
-_cmnd sets a new four-valued RGBA color.
-_cmnd has two major variants:
-_cmnd(Color3) and _cmnd(Color4).
-_cmnd(Color3) variants specify new red,
-green,
-and blue values explicitly
-and set the current alpha value to 1.0 (full intensity) implicitly.
-_cmnd(Color4) variants specify all four color components explicitly.
-.P
-_cmnd(Color3b), _cmnd(Color4b),
-_cmnd(Color3s), _cmnd(Color4s), _cmnd(Color3i), and _cmnd(Color4i) take
-three or four signed byte, short, or long integers as arguments.
-When \f3v\fP is appended to the name,
-the color commands can take a pointer to an array of such values.
-.P
-Current color values are stored in floating-point format,
-with unspecified mantissa and exponent sizes.
-Unsigned integer color components,
-when specified,
-are linearly mapped to floating-point values such that the largest
-representable value maps to 1.0 (full intensity),
-and 0 maps to 0.0 (zero intensity).
-Signed integer color components,
-when specified,
-are linearly mapped to floating-point values such that the most positive
-representable value maps to 1.0,
-and the most negative representable value maps to \-1.0. (Note that
-this mapping does not convert 0 precisely to 0.0.)
-Floating-point values are mapped directly.
-.P
-Neither floating-point nor signed integer values are clamped
-to the range [0,1] before the current color is updated.
-However,
-color components are clamped to this range before they are interpolated
-or written into a color buffer.
-.SH NOTES
-The initial value for the current color is (1, 1, 1, 1).
-.P
-The current color can be updated at any time.
-In particular,
-_cmnd can be called between a call to _cmnd(Begin) and the corresponding
-call to _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(CURRENT_COLOR)
-.br
-_cmnd(Get) with argument _const(RGBA_MODE)
-.SH SEE ALSO
-_cmnd(Index)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/colormask.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/colormask.gl
deleted file mode 100755
index ef26a9066..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/colormask.gl
+++ /dev/null
@@ -1,73 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_C_ _define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(ColorMask,enable and disable writing of frame buffer color components)
-_names(ColorMask)
-.SH PARAMETERS
-_phead(_param1 _param2 _param3 _param4)
-Specify whether red, green, blue, and alpha can or cannot be written
-into the frame buffer.
-The initial values are all _const(TRUE),
-indicating that the color components can be written.
-.SH DESCRIPTION
-_cmnd specifies whether the individual color components in the frame buffer
-can or cannot be written.
-If _param1 is _const(FALSE),
-for example,
-no change is made to the red component of any pixel in any of the
-color buffers,
-regardless of the drawing operation attempted.
-.P
-Changes to individual bits of components cannot be controlled.
-Rather,
-changes are either enabled or disabled for entire color components.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(COLOR_WRITEMASK)
-.br
-_cmnd(Get) with argument _const(RGBA_MODE)
-.SH SEE ALSO
-_cmnd(Clear),
-_cmnd(Color),
-_cmnd(ColorPointer),
-_cmnd(DepthMask),
-_cmnd(Index),
-_cmnd(IndexPointer),
-_cmnd(IndexMask),
-_cmnd(StencilMask)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/colormaterial.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/colormaterial.gl
deleted file mode 100755
index e5fdaec48..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/colormaterial.gl
+++ /dev/null
@@ -1,108 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(ColorMaterial,cause a material color to track the current color)
-_names(ColorMaterial)
-.SH PARAMETERS
-_phead(_param1)
-Specifies whether front,
-back,
-or both front and back material parameters should track the current color.
-Accepted values are
-_const(FRONT),
-_const(BACK),
-and _const(FRONT_AND_BACK).
-The initial value is _const(FRONT_AND_BACK).
-_phead(_param2)
-Specifies which of several material parameters track the current color.
-Accepted values are
-_const(EMISSION),
-_const(AMBIENT),
-_const(DIFFUSE),
-_const(SPECULAR),
-and _const(AMBIENT_AND_DIFFUSE).
-The initial value is _const(AMBIENT_AND_DIFFUSE).
-.SH DESCRIPTION
-_cmnd specifies which material parameters track the current color.
-When _const(COLOR_MATERIAL) is enabled,
-the material parameter or parameters specified by _param2,
-of the material or materials specified by _param1,
-track the current color at all times.
-.P
-To enable and disable _const(COLOR_MATERIAL), call
-_cmnd(Enable) and _cmnd(Disable) with argument _const(COLOR_MATERIAL).
-_const(COLOR_MATERIAL) is initially disabled.
-.SH NOTES
-_cmnd makes it possible to change a subset of material parameters for each
-vertex using only the _cmnd(Color) command,
-without calling _cmnd(Material).
-If only such a subset of parameters is to be specified for each
-vertex, calling _cmnd is preferable to calling _cmnd(Material).
-.P
-Call _cmnd before enabling _const(COLOR_MATERIAL).
-.P
-Calling _cmnd(DrawElements), _cmnd(DrawArrays), or _cmnd(DrawRangeElements)
-may leave the current color indeterminate, if the color array is enabled.
-If
-_cmnd is enabled while the current color is indeterminate, the
-lighting material state specified by _param1 and _param2 is also indeterminate.
-.P
-If the GL version is 1.1 or greater, and _const(COLOR_MATERIAL) is
-enabled, evaluated color values affect the results of the lighting
-equation as if the current color were being modified, but no change is
-made to the tracking lighting parameter of the current color.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 or _param2 is not an
-accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed between
-the execution of _cmnd(Begin) and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(IsEnabled) with argument _const(COLOR_MATERIAL)
-.br
-_cmnd(Get) with argument _const(COLOR_MATERIAL_PARAMETER)
-.br
-_cmnd(Get) with argument _const(COLOR_MATERIAL_FACE)
-.SH SEE ALSO
-_cmnd(Color),
-_cmnd(ColorPointer),
-_cmnd(DrawArrays),
-_cmnd(DrawElements),
-_cmnd(DrawRangeElements),
-_cmnd(Enable),
-_cmnd(Light),
-_cmnd(LightModel),
-_cmnd(Material)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/colorpointer.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/colorpointer.gl
deleted file mode 100755
index b31ee7cbf..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/colorpointer.gl
+++ /dev/null
@@ -1,145 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_C_ A real line follows.
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_C_ Use GL not OpenGL
-_C_ Don't change the ordering of the main headers.
-_C_ C specification (or fortran) is handled automatically
-_C_ .TH is automatically added to the top of this file.
-_C_ Below, use current tense, active do not capitalize the first word and dont
-_C_ use a period.
-_C_ the function name must appear in (APIFILE) (usually gl.h) as set in
-_C_ Makefile.
-_header(ColorPointer,define an array of colors)
-_names(ColorPointer)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the number of components per color. Must be 3 or 4.
-The initial value is 4.
-_phead(_param2)
-Specifies the data type of each color component in the array.
-Symbolic constants
-_const(BYTE),
-_const(UNSIGNED_BYTE),
-_const(SHORT),
-_const(UNSIGNED_SHORT),
-_const(INT),
-_const(UNSIGNED_INT),
-_const(FLOAT),
-and
-_const(DOUBLE)
-are accepted.
-The initial value is _const(FLOAT).
-_phead(_param3)
-Specifies the byte offset between consecutive colors.
-If _param3 is 0 (the initial value), the colors are understood to be
-tightly packed in the array. The initial value is 0.
-_phead(_param4)
-Specifies a pointer to the first component of the first color element
-in the array.
-.SH DESCRIPTION
-_cmnd specifies the location and data format of an array of color components
-to use when rendering.
-_param1 specifies the number of components per color, and must be 3 or 4.
-_param2 specifies the data type of each color component, and _param3
-specifies the byte stride from one color to the next allowing vertices and
-attributes to be packed into a single array or stored in separate arrays.
-(Single-array storage may be more efficient on some implementations;
-see _cmnd(InterleavedArrays).)
-.P
-When a color array is specified,
-_param1, _param2, _param3, and _param4 are saved as client-side
-state.
-.P
-To enable and disable the color array, call _cmnd(EnableClientState) and
-.br
-_cmnd(DisableClientState) with the argument _const(COLOR_ARRAY). If
-enabled, the color array is used when _cmnd(DrawArrays),
-_cmnd(DrawElements), _cmnd(DrawRangeElements), or _cmnd(ArrayElement) is
-called.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-The color array is initially disabled and isn't accessed when
-_cmnd(ArrayElement), _cmnd(DrawArrays), _cmnd(DrawRangeElements),
-or _cmnd(DrawElements) is called.
-.P
-Execution of _cmnd is not allowed between the execution of
-_cmnd(Begin) and the corresponding execution of _cmnd(End),
-but an error may or may not be generated. If no error is generated,
-the operation is undefined.
-.P
-_cmnd is typically implemented on the client side.
-.P
-Color array parameters are client-side state and are therefore not saved
-or restored by _cmnd(PushAttrib) and _cmnd(PopAttrib).
-Use _cmnd(PushClientAttrib) and _cmnd(PopClientAttrib) instead.
-.SH ERRORS
-_const(INVALID_VALUE) is generated if _param1 is not 3 or 4.
-.P
-_const(INVALID_ENUM) is generated if _param2 is not an accepted value.
-.P
-_const(INVALID_VALUE) is generated if _param3 is negative.
-.SH ASSOCIATED GETS
-_cmnd(IsEnabled) with argument _const(COLOR_ARRAY)
-.br
-_cmnd(Get) with argument _const(COLOR_ARRAY_SIZE)
-.br
-_cmnd(Get) with argument _const(COLOR_ARRAY_TYPE)
-.br
-_cmnd(Get) with argument _const(COLOR_ARRAY_STRIDE)
-.br
-_cmnd(GetPointerv) with argument _const(COLOR_ARRAY_POINTER)
-.SH SEE ALSO
-_C_ no queries or gets listed above, alphabetize commands,
-_C_ seperate with commas not .br. no command appears in the associated gets
-_C_ as well as in SEE ALSO.
-_cmnd(ArrayElement),
-_cmnd(DrawArrays),
-_cmnd(DrawElements),
-_cmnd(EdgeFlagPointer),
-_cmnd(Enable),
-_cmnd(GetPointerv),
-_cmnd(IndexPointer),
-_cmnd(InterleavedArrays),
-_cmnd(NormalPointer),
-_cmnd(PopClientAttrib),
-_cmnd(PushClientAttrib),
-_cmnd(TexCoordPointer),
-_cmnd(VertexPointer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/colorsubtable.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/colorsubtable.gl
deleted file mode 100755
index 9a426aa2d..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/colorsubtable.gl
+++ /dev/null
@@ -1,127 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(ColorSubTable,respecify a portion of a color table)
-_names(ColorSubTable)
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__start>@,@<_param2>@)_C_
-_define(@<__count>@,@<_param3>@)_C_
-_define(@<__format>@,@<_param4>@)_C_
-_define(@<__type>@,@<_param5>@)_C_
-_define(@<__table>@,@<_param6>@)_C_
-.SH PARAMETERS
-_phead(__target)
-Must be one of
-_const(COLOR_TABLE),
-_const(POST_CONVOLUTION_COLOR_TABLE), or
-_const(POST_COLOR_MATRIX_COLOR_TABLE).
-_phead(__start)
-The starting index of the portion of the color table to be replaced.
-_phead(__count)
-The number of table entries to replace.
-_phead(__format)
-The format of the pixel data in __table.
-The allowable values are
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(LUMINANCE),
-_const(LUMINANCE_ALPHA),
-_const(RGB),
-_const(BGR),
-_const(RGBA), and
-_const(BGRA).
-_phead(__type)
-The type of the pixel data in __table.
-The allowable values are
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV).
-_phead(__table)
-Pointer to a one-dimensional array of pixel data that is processed to
-replace the specified region of the color table.
-.SH DESCRIPTION
-_cmnd is used to respecify a contiguous portion of a color table previously
-defined using _cmnd(ColorTable). The pixels referenced by __table replace the
-portion of the existing table from indices __start to
-$_eqnparam2~+~_eqnparam3~-~1$, inclusive. This region may not include any
-entries outside the range of the color table as it was originally specified.
-It is not an error to specify a subtexture with width of 0, but such a
-specification has no effect.
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.P
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not one of the allowable
-values.
-.P
-_const(INVALID_VALUE) is generated if $_eqnparam2~+~_eqnparam3~>~width$.
-.P
-_const(INVALID_ENUM) is generated if __format is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __type is not one of the allowable
-values.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetColorTable),
-_cmnd(GetColorTableParameter)
-.SH SEE ALSO
-_cmnd(ColorSubTable),
-_cmnd(ColorTableParameter),
-_cmnd(CopyColorTable),
-_cmnd(CopyColorSubTable),
-_cmnd(GetColorTable)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/colortable.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/colortable.gl
deleted file mode 100755
index 90b141d3d..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/colortable.gl
+++ /dev/null
@@ -1,317 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(ColorTable,define a color lookup table)
-_names(ColorTable)
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__internalformat>@,@<_param2>@)_C_
-_define(@<__width>@,@<_param3>@)_C_
-_define(@<__format>@,@<_param4>@)_C_
-_define(@<__type>@,@<_param5>@)_C_
-_define(@<__table>@,@<_param6>@)_C_
-.SH PARAMETERS
-_phead(__target)
-Must be one of
-_const(COLOR_TABLE),
-_const(POST_CONVOLUTION_COLOR_TABLE),
-_const(POST_COLOR_MATRIX_COLOR_TABLE),
-_const(PROXY_COLOR_TABLE),
-_const(PROXY_POST_CONVOLUTION_COLOR_TABLE),
-or
-_const(PROXY_POST_COLOR_MATRIX_COLOR_TABLE).
-_phead(__internalformat)
-The internal format of the color table.
-The allowable values are
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(INTENSITY),
-_const(INTENSITY4),
-_const(INTENSITY8),
-_const(INTENSITY12),
-_const(INTENSITY16),
-_const(R3_G3_B2),
-_const(RGB),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12), and
-_const(RGBA16).
-_phead(__width)
-The number of entries in the color lookup table specified by __table.
-_phead(__format)
-The format of the pixel data in __table.
-The allowable values are
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(LUMINANCE),
-_const(LUMINANCE_ALPHA),
-_const(RGB),
-_const(BGR),
-_const(RGBA), and
-_const(BGRA).
-_phead(__type)
-The type of the pixel data in __table.
-The allowable values are
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV).
-_phead(__table)
-Pointer to a one-dimensional array of pixel data that is processed to
-build the color table.
-.SH DESCRIPTION
-_cmnd may be used in two ways:
-to test the actual size and color resolution of a lookup table
-given a particular set of parameters,
-or to load the contents of a color lookup
-table.
-Use the targets _const(PROXY_*) for the first case
-and the other targets for the second case.
-.P
-If __target is _const(COLOR_TABLE),
-_const(POST_CONVOLUTION_COLOR_TABLE),
-or
-_const(POST_COLOR_MATRIX_COLOR_TABLE),
-_cmnd builds a color lookup table from an array of pixels.
-The pixel array specified by __width, __format, __type, and __table
-is extracted from memory and
-processed just as if _cmnd(DrawPixels) were called, but processing
-stops after the final expansion to RGBA is completed.
-.P
-The four scale parameters and the four bias parameters that are defined
-for the table are then used to scale and bias the R, G, B, and A components
-of each pixel.
-(Use _cmnd(ColorTableParameter) to set these scale and bias
-parameters.)
-.P
-Next, the R, G, B, and A values are clamped to the range [0,\ 1].
-Each pixel is then converted to the internal format specified by
-__internalformat.
-This conversion simply maps the component values of the pixel (R, G, B,
-and A) to the values included in the internal format (red, green, blue,
-alpha, luminance, and intensity). The mapping is as follows:
-.P
-.TS
-center;
-lb cb cb cb cb cb cb
-l c c c c c c.
-_
-Internal Format Red Green Blue Alpha Luminance Intensity
-_
-_const(ALPHA) A
-_const(LUMINANCE) R
-_const(LUMINANCE_ALPHA) A R
-_const(INTENSITY) R
-_const(RGB) R G B
-_const(RGBA) R G B A
-_
-.TE
-.P
-Finally, the red, green, blue, alpha, luminance, and/or intensity components of
-the resulting pixels are stored in the color table.
-They form a one-dimensional table with indices in the range
-[0,\ __width\ \-\ 1].
-.P
-If __target is _const(PROXY_*),
-_cmnd recomputes and stores the values of the proxy color table's state
-variables
-_const(COLOR_TABLE_FORMAT),
-_const(COLOR_TABLE_WIDTH),
-_const(COLOR_TABLE_RED_SIZE),
-_const(COLOR_TABLE_GREEN_SIZE),
-_const(COLOR_TABLE_BLUE_SIZE),
-_const(COLOR_TABLE_ALPHA_SIZE),
-_const(COLOR_TABLE_LUMINANCE_SIZE), and
-_const(COLOR_TABLE_INTENSITY_SIZE).
-There is no effect on the image or state of any actual color table.
-If the specified color table is too large to be supported, then all the
-proxy state variables listed above are set to zero.
-Otherwise, the color table could be supported by _cmnd
-using the corresponding non-proxy target,
-and the proxy state variables are set as if that target were being defined.
-.P
-The proxy state variables can be retrieved by calling
-_cmnd(GetColorTableParameter) with a target of
-_const(PROXY_*).
-This allows the application to decide if a particular _cmnd
-command would succeed, and to determine what the resulting color table
-attributes would be.
-.P
-If a color table is enabled, and its width is non-zero, then its
-contents are used to replace a subset of the components of each RGBA
-pixel group, based on the internal format of the table.
-.P
-Each pixel group has color components (R, G, B, A)
-that are in the range [0.0,\ 1.0].
-The color components are rescaled to
-the size of the color lookup table to form an index.
-Then a subset of the components based on the internal format of the table are
-replaced by the table entry selected by that index.
-If the color components and contents of the table are represented as follows:
-.P
-.TS
-center;
-cb cb
-c l.
-_
-Representation Meaning
-_
-\f7r\fP Table index computed from \f7R\fP
-\f7g\fP Table index computed from \f7G\fP
-\f7b\fP Table index computed from \f7B\fP
-\f7a\fP Table index computed from \f7A\fP
-\f7L[i]\fP Luminance value at table index \f7i\fP
-\f7I[i]\fP Intensity value at table index \f7i\fP
-\f7R[i]\fP Red value at table index \f7i\fP
-\f7G[i]\fP Green value at table index \f7i\fP
-\f7B[i]\fP Blue value at table index \f7i\fP
-\f7A[i]\fP Alpha value at table index \f7i\fP
-_
-.TE
-.P
-then the result of color table lookup is as follows:
-.P
-.ne 10
-.TS
-center;
-l l s s s
-l l l l l
-l l l l l.
-_
- Resulting Texture Components
-Table Internal Format R G B A
-_
-_const(ALPHA) R G B A[a]
-_const(LUMINANCE) L[r] L[g] L[b] At
-_const(LUMINANCE_ALPHA) L[r] L[g] L[b] A[a]
-_const(INTENSITY) I[r] I[g] I[b] I[a]
-_const(RGB) R[r] G[g] B[b] A
-_const(RGBA) R[r] G[g] B[b] A[a]
-_
-.TE
-.P
-When _const(COLOR_TABLE) is enabled, the colors resulting from
-the pixel map operation (if it is enabled) are mapped
-by the color lookup table before being passed to the convolution
-operation. The colors resulting from the convolution operation
-are modified by the post convolution color lookup table when
-_const(POST_CONVOLUTION_COLOR_TABLE)
-is enabled. These modified colors are then sent to the color matrix operation.
-Finally, if _const(POST_COLOR_MATRIX_COLOR_TABLE)
-is enabled, the colors resulting from the color matrix operation
-are mapped by the post color matrix color lookup table before being
-used by the histogram operation.
-.P
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.P
-If __target is set to _const(COLOR_TABLE),
-_const(POST_CONVOLUTION_COLOR_TABLE),
-or _const(POST_COLOR_MATRIX_COLOR_TABLE),
-then __width must be a power of two or a _const(INVALID_VALUE)
-error is generated.
-.P
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __internalformat is not one of the
-allowable values.
-.P
-_const(INVALID_VALUE) is generated if __width is less than zero.
-.P
-_const(INVALID_ENUM) is generated if __format is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __type is not one of the allowable
-values.
-.P
-_const(TABLE_TOO_LARGE) is generated if the requested color table
-is too large to be supported by the implementation, and __target is
-not a _const(PROXY_*) target.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetColorTableParameter)
-.SH SEE ALSO
-_cmnd(ColorSubTable),
-_cmnd(ColorTableParameter),
-_cmnd(CopyColorTable),
-_cmnd(CopyColorSubTable),
-_cmnd(GetColorTable)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/colortableparameter.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/colortableparameter.gl
deleted file mode 100755
index e4bcea3ee..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/colortableparameter.gl
+++ /dev/null
@@ -1,94 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl | eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(ColorTableParameter, set color lookup table parameters)
-_names(ColorTableParameter,[fi]v)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__pname>@,@<_param2>@)_C_
-_define(@<__params>@,@<_param3>@)_C_
-_phead(__target)
-The target color table.
-Must be
-_const(COLOR_TABLE),
-_const(POST_CONVOLUTION_COLOR_TABLE), or
-_const(POST_COLOR_MATRIX_COLOR_TABLE).
-_phead(__pname)
-The symbolic name of a texture color lookup table parameter.
-Must be one of
-_const(COLOR_TABLE_SCALE) or
-_const(COLOR_TABLE_BIAS).
-_phead(__params)
-A pointer to an array where the values of the parameters are stored.
-.SH DESCRIPTION
-_cmnd is used to specify the scale factors and bias terms applied to
-color components when they are loaded into a color table. __target
-indicates which color table the scale and bias terms apply to; it
-must be set to
-_const(COLOR_TABLE),
-_const(POST_CONVOLUTION_COLOR_TABLE), or
-_const(POST_COLOR_MATRIX_COLOR_TABLE).
-.P
-__pname must be _const(COLOR_TABLE_SCALE) to set the
-scale factors.
-In this case, __params points to an array of four values, which are
-the scale factors for red, green, blue, and alpha, in that order.
-.P
-__pname must be _const(COLOR_TABLE_BIAS) to set the
-bias terms. In this case,
-__params points to an array of four values, which are the bias
-terms for red, green, blue, and alpha, in that order.
-.P
-The color tables themselves are specified by
-calling _cmnd(ColorTable).
-.SH NOTES
-_cmnd is available only if _arbstring(imaging) is returned from calling
-_cmnd(GetString) with an argument of _const(EXTENSIONS).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target or __pname is not
-an acceptable value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetColorTableParameter)
-.SH SEE ALSO
-_cmnd(ColorTable),
-_cmnd(PixelTransfer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/const.awk b/xc/extras/ogl-sample/main/doc/man/mangl/standard/const.awk
deleted file mode 100755
index 05d1711c1..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/const.awk
+++ /dev/null
@@ -1,104 +0,0 @@
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-
-# compare manpages to gl.h
-#
-# awk -f check.awk /usr/include/GL/gl.h *.gl
-#
-# only checks constants for now - routine names would be nice
-
-BEGIN {
- mode = 0;
-}
-
-#
-# look for definitions in gl.h
-#
-$1 == "#define" {
- if (NF > 2) {
- token = substr($2,4);
- IsDefined[token] = 1;
- }
- continue;
-}
-
-#
-# ignore comments in tex source
-#
-substr($1,1,3) == "_C_" {
- continue;
-}
-
-#
-# check each field for a _const macro, extract the string when found
-#
- {
- for (i=1; i <= length($0); i++) {
- c = substr($0,i,1);
- if (substr($0,i,6) == "_const") {
- mode = 1;
- i += 5;
- }
- else if (mode == 1) {
- if (c == "(") {
- mode = 2;
- newtoken = "";
- }
- }
- else if (mode == 2) {
- if (c == ")") {
- IsSpecified[newtoken] = 1;
- if (!IsDefined[newtoken]) {
- printf("not in gl.h: ");
- printf("%-20s ",FILENAME);
- printf("%s\n",newtoken);
- }
- mode = 0;
- }
- else if (c == " ") {
- }
- else {
- newtoken = sprintf("%s%s",newtoken,c);
- }
- }
-
- }
-}
-
-END {
- for (s in IsDefined) {
- if (!IsSpecified[s]) {
- printf("not in the manpages: %s\n",s);
- }
- }
-}
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/convolutionfilter1d.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/convolutionfilter1d.gl
deleted file mode 100755
index 51b280424..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/convolutionfilter1d.gl
+++ /dev/null
@@ -1,231 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(ConvolutionFilter1D,define a one-dimensional convolution filter)
-_names(ConvolutionFilter1D)
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__internalformat>@,@<_param2>@)_C_
-_define(@<__width>@,@<_param3>@)_C_
-_define(@<__format>@,@<_param4>@)_C_
-_define(@<__type>@,@<_param5>@)_C_
-_define(@<__image>@,@<_param6>@)_C_
-.SH PARAMETERS
-_phead(__target)
-Must be _const(CONVOLUTION_1D).
-_phead(__internalformat)
-The internal format of the convolution filter kernel.
-The allowable values are
-_const(ALPHA),
-_const(LUMINANCE),
-_const(LUMINANCE_ALPHA),
-_const(INTENSITY),
-_const(RGB), and
-_const(RGBA).
-_phead(__width)
-The width of the pixel array referenced by __image.
-_phead(__format)
-The format of the pixel data in __image.
-The allowable values are
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(INTENSITY),
-_const(INTENSITY4),
-_const(INTENSITY8),
-_const(INTENSITY12),
-_const(INTENSITY16),
-_const(R3_G3_B2),
-_const(RGB),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12), or
-_const(RGBA16).
-_phead(__type)
-The type of the pixel data in __image.
-Symbolic constants
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV)
-are accepted.
-_phead(__image)
-Pointer to a one-dimensional array of pixel data that is processed to
-build the convolution filter kernel.
-.SH DESCRIPTION
-_cmnd builds a one-dimensional convolution filter kernel from an array of
-pixels.
-.sp
-The pixel array specified by __width, __format, __type, and __image
-is extracted from memory and
-processed just as if _cmnd(DrawPixels) were called, but processing
-stops after the final expansion to RGBA is completed.
-.sp
-The R, G, B, and A components of each pixel are next scaled by the four
-1D _const(CONVOLUTION_FILTER_SCALE) parameters and biased by the
-four 1D _const(CONVOLUTION_FILTER_BIAS) parameters.
-(The scale and bias parameters are set by _cmnd(ConvolutionParameter)
-using the _const(CONVOLUTION_1D) target and the names
-_const(CONVOLUTION_FILTER_SCALE) and _const(CONVOLUTION_FILTER_BIAS).
-The parameters themselves are vectors of four values that are applied to red,
-green, blue, and alpha, in that order.)
-The R, G, B, and A values are not clamped to [0,1] at any time during this
-process.
-.sp
-Each pixel is then converted to the internal format specified by
-__internalformat.
-This conversion simply maps the component values of the pixel (R, G, B,
-and A) to the values included in the internal format (red, green, blue,
-alpha, luminance, and intensity). The mapping is as follows:
-.sp
-.TS
-center;
-lb cb cb cb cb cb cb
-l c c c c c c.
-_
-Internal Format Red Green Blue Alpha Luminance Intensity
-_
-_const(ALPHA) A
-_const(LUMINANCE) R
-_const(LUMINANCE_ALPHA) A R
-_const(INTENSITY) R
-_const(RGB) R G B
-_const(RGBA) R G B A
-_
-.TE
-.sp
-The red, green, blue, alpha, luminance, and/or intensity components of
-the resulting pixels are stored in floating-point rather than integer
-format.
-They form a one-dimensional filter kernel image indexed with coordinate
-\f2i\fP such that \f2i\fP starts at 0 and increases from left to right.
-Kernel location \f2i\fP is derived from the \f2i\fPth pixel, counting from 0.
-.PP
-Note that after a convolution is performed, the resulting color
-components are also scaled by their corresponding
-_const(POST_CONVOLUTION_c_SCALE) parameters and biased by their
-corresponding _const(POST_CONVOLUTION_c_BIAS) parameters (where
-\f2c\fP takes on the values \f3RED\fP, \f3GREEN\fP, \f3BLUE\fP, and
-\f3ALPHA\fP).
-These parameters are set by _cmnd(PixelTransfer).
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not
-_const(CONVOLUTION_1D).
-.P
-_const(INVALID_ENUM) is generated if __internalformat is not one of the
-allowable values.
-.P
-_const(INVALID_VALUE) is generated if __width is less than zero or greater
-than the maximum supported value.
-This value may be queried with _cmnd(GetConvolutionParameter)
-using target _const(CONVOLUTION_1D) and name
-_const(MAX_CONVOLUTION_WIDTH).
-.P
-_const(INVALID_ENUM) is generated if __format is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __type is not one of the allowable
-values.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.P
-_const(INVALID_OPERATION) is generated if _param4 is one of
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5), or
-_const(UNSIGNED_SHORT_5_6_5_REV)
-and _param5 is not _const(RGB).
-.P
-_const(INVALID_OPERATION) is generated if _param4 is one of
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV)
-and _param5 is neither _const(RGBA) nor _const(BGRA).
-.SH ASSOCIATED GETS
-_cmnd(GetConvolutionParameter), _cmnd(GetConvolutionFilter)
-.SH SEE ALSO
-_cmnd(ConvolutionFilter2D),
-_cmnd(SeparableFilter2D),
-_cmnd(ConvolutionParameter),
-_cmnd(PixelTransfer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/convolutionfilter2d.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/convolutionfilter2d.gl
deleted file mode 100755
index df41d5d39..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/convolutionfilter2d.gl
+++ /dev/null
@@ -1,246 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(ConvolutionFilter2D,define a two-dimensional convolution filter)
-_names(ConvolutionFilter2D)
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__internalformat>@,@<_param2>@)_C_
-_define(@<__width>@,@<_param3>@)_C_
-_define(@<__height>@,@<_param4>@)_C_
-_define(@<__format>@,@<_param5>@)_C_
-_define(@<__type>@,@<_param6>@)_C_
-_define(@<__image>@,@<_param7>@)_C_
-.SH PARAMETERS
-_phead(__target)
-Must be _const(CONVOLUTION_2D).
-_phead(__internalformat)
-The internal format of the convolution filter kernel.
-The allowable values are
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(INTENSITY),
-_const(INTENSITY4),
-_const(INTENSITY8),
-_const(INTENSITY12),
-_const(INTENSITY16),
-_const(R3_G3_B2),
-_const(RGB),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12), or
-_const(RGBA16).
-_phead(__width)
-The width of the pixel array referenced by __image.
-_phead(__height)
-The height of the pixel array referenced by __image.
-_phead(__format)
-The format of the pixel data in __image.
-The allowable values are
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(BGR),
-_const(RGBA),
-_const(BGRA),
-_const(LUMINANCE), and
-_const(LUMINANCE_ALPHA).
-_phead(__type)
-The type of the pixel data in __image.
-Symbolic constants
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV)
-are accepted.
-_phead(__image)
-Pointer to a two-dimensional array of pixel data that is processed to
-build the convolution filter kernel.
-.SH DESCRIPTION
-_cmnd builds a two-dimensional convolution filter kernel from an array of
-pixels.
-.sp
-The pixel array specified by __width, __height, __format, __type, and
-__image is extracted from memory and processed just as if
-_cmnd(DrawPixels) were called, but processing stops after the final
-expansion to RGBA is completed.
-.sp
-The R, G, B, and A components of each pixel are next scaled by the four
-2D _const(CONVOLUTION_FILTER_SCALE) parameters and biased by the
-four 2D _const(CONVOLUTION_FILTER_BIAS) parameters.
-(The scale and bias parameters are set by _cmnd(ConvolutionParameter)
-using the _const(CONVOLUTION_2D) target and the names
-_const(CONVOLUTION_FILTER_SCALE) and _const(CONVOLUTION_FILTER_BIAS).
-The parameters themselves are vectors of four values that are applied to red,
-green, blue, and alpha, in that order.)
-The R, G, B, and A values are not clamped to [0,1] at any time during this
-process.
-.sp
-Each pixel is then converted to the internal format specified by
-__internalformat.
-This conversion simply maps the component values of the pixel (R, G, B,
-and A) to the values included in the internal format (red, green, blue,
-alpha, luminance, and intensity). The mapping is as follows:
-.sp
-.TS
-center;
-lb cb cb cb cb cb cb
-l c c c c c c.
-_
-Internal Format Red Green Blue Alpha Luminance Intensity
-_
-_const(ALPHA) A
-_const(LUMINANCE) R
-_const(LUMINANCE_ALPHA) A R
-_const(INTENSITY) R
-_const(RGB) R G B
-_const(RGBA) R G B A
-_
-.TE
-.sp
-The red, green, blue, alpha, luminance, and/or intensity components of
-the resulting pixels are stored in floating-point rather than integer
-format.
-They form a two-dimensional filter kernel image indexed with coordinates
-\f2i\fP and \f2j\fP such that \f2i\fP starts at zero and increases from left
-to right, and \f2j\fP starts at zero and increases from bottom to top.
-Kernel location \f2i,j\fP is derived from the \f2N\fPth pixel,
-where \f2N\fP is \f2i\fP+\f2j\fP*__width.
-.PP
-Note that after a convolution is performed, the resulting color
-components are also scaled by their corresponding
-_const(POST_CONVOLUTION_c_SCALE) parameters and biased by their
-corresponding _const(POST_CONVOLUTION_c_BIAS) parameters (where
-\f2c\fP takes on the values \f3RED\fP, \f3GREEN\fP, \f3BLUE\fP, and
-\f3ALPHA\fP).
-These parameters are set by _cmnd(PixelTransfer).
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not
-_const(CONVOLUTION_2D).
-.P
-_const(INVALID_ENUM) is generated if __internalformat is not one of the
-allowable values.
-.P
-_const(INVALID_VALUE) is generated if __width is less than zero or greater
-than the maximum supported value.
-This value may be queried with _cmnd(GetConvolutionParameter)
-using target _const(CONVOLUTION_2D) and name
-_const(MAX_CONVOLUTION_WIDTH).
-.P
-_const(INVALID_VALUE) is generated if __height is less than zero or greater
-than the maximum supported value.
-This value may be queried with _cmnd(GetConvolutionParameter)
-using target _const(CONVOLUTION_2D) and name
-_const(MAX_CONVOLUTION_HEIGHT).
-.P
-_const(INVALID_ENUM) is generated if __format is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __type is not one of the allowable
-values.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.P
-_const(INVALID_OPERATION) is generated if _param4 is one of
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5), or
-_const(UNSIGNED_SHORT_5_6_5_REV)
-and _param5 is not _const(RGB).
-.P
-_const(INVALID_OPERATION) is generated if _param4 is one of
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV)
-and _param5 is neither _const(RGBA) nor _const(BGRA).
-.SH ASSOCIATED GETS
-_cmnd(GetConvolutionParameter), _cmnd(GetConvolutionFilter)
-.SH SEE ALSO
-_cmnd(ConvolutionFilter1D),
-_cmnd(SeparableFilter2D),
-_cmnd(ConvolutionParameter),
-_cmnd(PixelTransfer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/convolutionparameter.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/convolutionparameter.gl
deleted file mode 100755
index 089c78f82..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/convolutionparameter.gl
+++ /dev/null
@@ -1,165 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn|tbl)_C_
-_header(ConvolutionParameter,set convolution parameters)
-_names(ConvolutionParameter,[fi])
-.EQ
-delim $$
-.EN
-_define(@<__target>@,@<_param1(1)>@)_C_
-_define(@<__pname>@,@<_param2(1)>@)_C_
-_define(@<__param>@,@<_param3(1)>@)_C_
-.sp -1
-.SH PARAMETERS
-_phead(__target)
-The target for the convolution parameter.
-Must be one of
-_const(CONVOLUTION_1D),
-_const(CONVOLUTION_2D), or
-_const(SEPARABLE_2D).
-_phead(__pname)
-The parameter to be set.
-Must be
-_const(CONVOLUTION_BORDER_MODE).
-_phead(__param)
-The parameter value.
-Must be one of
-_const(REDUCE), _const(CONSTANT_BORDER), _const(REPLICATE_BORDER).
-.sp 2
-_names(ConvolutionParameter,[fi]v)
-_define(@<__targetv>@,@<_param1(2)>@)_C_
-_define(@<__pnamev>@,@<_param2(2)>@)_C_
-_define(@<__paramv>@,@<_param3(2)>@)_C_
-.sp -1
-.SH PARAMETERS
-_phead(__targetv)
-The target for the convolution parameter.
-Must be one of
-_const(CONVOLUTION_1D),
-_const(CONVOLUTION_2D), or
-_const(SEPARABLE_2D).
-_phead(__pnamev)
-The parameter to be set.
-Must be one of
-_const(CONVOLUTION_BORDER_MODE),
-_const(CONVOLUTION_BORDER_COLOR),
-_const(CONVOLUTION_FILTER_SCALE), or
-_const(CONVOLUTION_FILTER_BIAS).
-_phead(__paramv)
-The parameter value.
-If __pnamev is _const(CONVOLUTION_BORDER_MODE), __paramv must be one of
-_const(REDUCE), _const(CONSTANT_BORDER), or _const(REPLICATE_BORDER).
-Otherwise, must be a vector of four values (for red, green, blue, and alpha,
-respectively) to be used for
-scaling (when __pnamev is _const(CONVOLUTION_FILTER_SCALE)), or
-biasing (when __pnamev is _const(CONVOLUTION_FILTER_BIAS)) a convolution
-filter kernel or setting the constant border color (when __pnamev is
-_const(CONVOLUTION_BORDER_COLOR).
-.SH DESCRIPTION
-_cmnd sets the value of a convolution parameter.
-.sp
-__target selects the convolution filter to be affected:
-_const(CONVOLUTION_1D),
-_const(CONVOLUTION_2D), or
-_const(SEPARABLE_2D)
-for the 1D, 2D, or separable 2D filter, respectively.
-.sp
-__pname selects the parameter to be changed.
-_const(CONVOLUTION_FILTER_SCALE) and _const(CONVOLUTION_FILTER_BIAS)
-affect the definition of the convolution filter kernel; see
-_cmnd(ConvolutionFilter1D), _cmnd(ConvolutionFilter2D), and
-_cmnd(SeparableFilter2D) for details.
-In these cases, __paramv is an array of four values to be applied to
-red, green, blue, and alpha values, respectively. The initial value for
-_const(CONVOLUTION_FILTER_SCALE) is (1, 1, 1, 1), and the initial value
-for _const(CONVOLUTION_FILTER_BIAS) is (0, 0, 0, 0).
-.sp
-A __pname value of _const(CONVOLUTION_BORDER_MODE) controls the
-convolution border mode. The accepted modes are:
-.TP
-_const(REDUCE)
-The image resulting from convolution is
-smaller than the source image.
-If the filter width is $Wf$ and height is $Hf$,
-and the source image width is $Ws$ and height is $Hs$,
-then the convolved image width will be $Ws ~-~ Wf ~+~ 1$ and height
-will be $Hs ~-~ Hf ~+~ 1$.
-(If this reduction would generate an image with zero or negative width
-and/or height, the output is simply null, with no error generated.)
-The coordinates of the image resulting from convolution are zero
-through $Ws ~-~ Wf$ in width and zero through $Hs ~-~ Hf$ in
-height.
-.TP
-_const(CONSTANT_BORDER)
-The image resulting from convolution is the same size as the source image, and
-processed as if the source image were surrounded by pixels with their color
-specified by the _const(CONVOLUTION_BORDER_COLOR).
-.TP
-_const(REPLICATE_BORDER)
-The image resulting from convolution is the same size as the source image, and
-processed as if the outermost pixel on the border of the source image were
-replicated.
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.P
-In cases where errors can result from the specification of invalid
-image dimensions, it is the dimensions after convolution that are
-tested, not the dimensions of the source image.
-For example, _cmnd(TexImage1D) requires power-of-two image size.
-When _const(REDUCE) border mode is in effect,
-the source image must be larger than the final power-of-two size
-by one less than the size of the 1D filter kernel.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __pname is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __pname is
-_const(CONVOLUTION_BORDER_MODE) and __param is not one of
-_const(REDUCE), _const(CONSTANT_BORDER), or _const(REPLICATE_BORDER).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetConvolutionParameter)
-.SH SEE ALSO
-_cmnd(ConvolutionFilter1D),
-_cmnd(ConvolutionFilter2D),
-_cmnd(SeparableFilter2D),
-_cmnd(GetConvolutionParameter)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copycolorsubtable.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/copycolorsubtable.gl
deleted file mode 100755
index f2ae390b4..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copycolorsubtable.gl
+++ /dev/null
@@ -1,88 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(CopyColorSubTable,respecify a portion of a color table)
-_names(CopyColorSubTable)
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__start>@,@<_param2>@)_C_
-_define(@<__x>@,@<_param3>@)_C_
-_define(@<__y>@,@<_param4>@)_C_
-_define(@<__count>@,@<_param5>@)_C_
-.SH PARAMETERS
-_phead(__target)
-Must be one of
-_const(COLOR_TABLE),
-_const(POST_CONVOLUTION_COLOR_TABLE), or
-_const(POST_COLOR_MATRIX_COLOR_TABLE).
-_phead(__start)
-The starting index of the portion of the color table to be replaced.
-_phead(__x __y)
-The window coordinates of the left corner of the row of pixels to be
-copied.
-_phead(__count)
-The number of table entries to replace.
-.SH DESCRIPTION
-_cmnd is used to respecify a contiguous portion of a color table previously
-defined using _cmnd(ColorTable). The pixels copied from the framebuffer
-replace the portion of the existing table from indices __start to
-$_eqnparam2~+~_eqnparam3~-~1$, inclusive. This region may not include any
-entries outside the range of the color table, as was originally specified.
-It is not an error to specify a subtexture with width of 0, but such a
-specification has no effect.
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.P
-.SH ERRORS
-_const(INVALID_VALUE) is generated if __target is not a previously defined
-color table.
-.P
-_const(INVALID_VALUE) is generated if __target is not one of the allowable
-values.
-.P
-_const(INVALID_VALUE) is generated if $_eqnparam2~+~_eqnparam3~>~width$.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetColorTable),
-_cmnd(GetColorTableParameter)
-.SH SEE ALSO
-_cmnd(ColorSubTable),
-_cmnd(ColorTableParameter),
-_cmnd(CopyColorTable),
-_cmnd(CopyColorSubTable),
-_cmnd(GetColorTable)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copycolortable.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/copycolortable.gl
deleted file mode 100755
index 9014b3328..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copycolortable.gl
+++ /dev/null
@@ -1,173 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl | eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(CopyColorTable,copy pixels into a color table)
-_names(CopyColorTable)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__internalformat>@,@<_param2>@)_C_
-_define(@<__x>@,@<_param3>@)_C_
-_define(@<__y>@,@<_param4>@)_C_
-_define(@<__width>@,@<_param5>@)_C_
-_phead(__target)
-The color table target. Must be
-_const(COLOR_TABLE),
-_const(POST_CONVOLUTION_COLOR_TABLE),
-or _const(POST_COLOR_MATRIX_COLOR_TABLE).
-_phead(__internalformat)
-The internal storage format of the texture image.
-Must be one of the following symbolic constants:
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(INTENSITY),
-_const(INTENSITY4),
-_const(INTENSITY8),
-_const(INTENSITY12),
-_const(INTENSITY16),
-_const(R3_G3_B2),
-_const(RGB),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12),
-_const(RGBA16).
-_phead(__x)
-The x coordinate of the lower-left corner of the pixel rectangle
-to be transferred to the color table.
-_phead(__y)
-The y coordinate of the lower-left corner of the pixel rectangle
-to be transferred to the color table.
-_phead(__width)
-The width of the pixel rectangle.
-.SH DESCRIPTION
-_cmnd loads a color table with pixels from the current
-_const(READ_BUFFER) (rather than from main memory, as is the case for
-_cmnd(ColorTable)).
-.P
-The screen-aligned pixel rectangle with lower-left corner at (__x,\ __y)
-having width __width and height 1
-is loaded into the color table. If any pixels within
-this region are outside the window that is associated with the GL
-context, the values obtained for those pixels are undefined.
-.P
-The pixels in the rectangle are processed just as if
-_cmnd(ReadPixels) were called, with __internalformat set to RGBA,
-but processing stops after the final conversion to RGBA.
-.P
-The four scale parameters and the four bias parameters that are defined
-for the table are then used to scale and bias the R, G, B, and A components
-of each pixel. The scale and bias parameters are set by calling
-_cmnd(ColorTableParameter).
-.P
-Next, the R, G, B, and A values are clamped to the range [0,1].
-Each pixel is then converted to the internal format specified by
-__internalformat. This conversion simply maps the component values of the pixel (R, G, B,
-and A) to the values included in the internal format (red, green, blue,
-alpha, luminance, and intensity). The mapping is as follows:
-.P
-.TS
-center;
-lb cb cb cb cb cb cb
-l c c c c c c.
-_
-Internal Format Red Green Blue Alpha Luminance Intensity
-_
-_const(ALPHA) A
-_const(LUMINANCE) R
-_const(LUMINANCE_ALPHA) A R
-_const(INTENSITY) R
-_const(RGB) R G B
-_const(RGBA) R G B A
-_
-.TE
-.P
-Finally, the red, green, blue, alpha, luminance, and/or intensity components of
-the resulting pixels are stored in the color table.
-They form a one-dimensional table with indices in the range
-[0,\ __width\ \-\ 1].
-.P
-.SH NOTES
-_cmnd is available only if _arbstring(imaging) is returned from calling
-_cmnd(GetString) with an argument of _const(EXTENSIONS).
-.SH ERRORS
-_const(INVALID_ENUM) is generated when __target is not one of the
-allowable values.
-.P
-_const(INVALID_VALUE) is generated if __width is less than zero.
-.P
-_const(INVALID_VALUE) is generated if __internalformat is not one of the
-allowable values.
-.P
-_const(TABLE_TOO_LARGE) is generated if the requested color table
-is too large to be supported by the implementation.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetColorTable),
-_cmnd(GetColorTableParameter)
-.SH SEE ALSO
-_cmnd(ColorTable),
-_cmnd(ColorTableParameter),
-_cmnd(ReadPixels)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copyconvolutionfilter1d.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/copyconvolutionfilter1d.gl
deleted file mode 100755
index 79e7ce94c..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copyconvolutionfilter1d.gl
+++ /dev/null
@@ -1,177 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(CopyConvolutionFilter1D,copy pixels into a one-dimensional convolution filter)
-_names(CopyConvolutionFilter1D)
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__internalformat>@,@<_param2>@)_C_
-_define(@<__x>@,@<_param3>@)_C_
-_define(@<__y>@,@<_param4>@)_C_
-_define(@<__width>@,@<_param5>@)_C_
-.SH PARAMETERS
-_phead(__target)
-Must be _const(CONVOLUTION_1D).
-_phead(__internalformat)
-The internal format of the convolution filter kernel.
-The allowable values are
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(INTENSITY),
-_const(INTENSITY4),
-_const(INTENSITY8),
-_const(INTENSITY12),
-_const(INTENSITY16),
-_const(R3_G3_B2),
-_const(RGB),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12), or
-_const(RGBA16).
-_phead(__x __y)
-The window space coordinates of the lower-left coordinate of the
-pixel array to copy.
-_phead(__width)
-The width of the pixel array to copy.
-.SH DESCRIPTION
-_cmnd defines a one-dimensional convolution filter kernel with pixels
-from the current _const(READ_BUFFER) (rather than from main memory,
-as is the case for _cmnd(ConvolutionFilter1D)).
-.sp
-The screen-aligned pixel rectangle with lower-left corner at (__x,\ __y),
-width __width and height 1 is used to define
-the convolution filter. If any pixels within this region are
-outside the window that is associated with the GL context, the
-values obtained for those pixels are undefined.
-.sp
-The pixels in the rectangle are processed exactly as if _cmnd(ReadPixels)
-had been called with \f2format\fP
-set to RGBA, but the process stops just before final conversion.
-The R, G, B, and A components of each pixel are next scaled by the four
-1D _const(CONVOLUTION_FILTER_SCALE) parameters and biased by the
-four 1D _const(CONVOLUTION_FILTER_BIAS) parameters.
-(The scale and bias parameters are set by _cmnd(ConvolutionParameter)
-using the _const(CONVOLUTION_1D) target and the names
-_const(CONVOLUTION_FILTER_SCALE) and _const(CONVOLUTION_FILTER_BIAS).
-The parameters themselves are vectors of four values that are applied to red,
-green, blue, and alpha, in that order.)
-The R, G, B, and A values are not clamped to [0,1] at any time during this
-process.
-.sp
-Each pixel is then converted to the internal format specified by
-__internalformat.
-This conversion simply maps the component values of the pixel (R, G, B,
-and A) to the values included in the internal format (red, green, blue,
-alpha, luminance, and intensity). The mapping is as follows:
-.sp
-.TS
-center;
-lb cb cb cb cb cb cb
-l c c c c c c.
-_
-Internal Format Red Green Blue Alpha Luminance Intensity
-_
-_const(ALPHA) A
-_const(LUMINANCE) R
-_const(LUMINANCE_ALPHA) A R
-_const(INTENSITY) R
-_const(RGB) R G B
-_const(RGBA) R G B A
-_
-.TE
-.sp
-The red, green, blue, alpha, luminance, and/or intensity components of
-the resulting pixels are stored in floating-point rather than integer
-format.
-.sp
-Pixel ordering is such that lower x screen coordinates correspond to
-lower \f2i\fP filter image coordinates.
-.PP
-Note that after a convolution is performed, the resulting color
-components are also scaled by their corresponding
-_const(POST_CONVOLUTION_c_SCALE) parameters and biased by their
-corresponding _const(POST_CONVOLUTION_c_BIAS) parameters (where
-\f2c\fP takes on the values \f3RED\fP, \f3GREEN\fP, \f3BLUE\fP, and
-\f3ALPHA\fP).
-These parameters are set by _cmnd(PixelTransfer).
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not
-_const(CONVOLUTION_1D).
-.P
-_const(INVALID_ENUM) is generated if __internalformat is not one of the
-allowable values.
-.P
-_const(INVALID_VALUE) is generated if __width is less than zero or greater
-than the maximum supported value.
-This value may be queried with _cmnd(GetConvolutionParameter)
-using target _const(CONVOLUTION_1D) and name
-_const(MAX_CONVOLUTION_WIDTH).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetConvolutionParameter), _cmnd(GetConvolutionFilter)
-.SH SEE ALSO
-_cmnd(ConvolutionFilter1D),
-_cmnd(ConvolutionParameter),
-_cmnd(PixelTransfer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copyconvolutionfilter2d.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/copyconvolutionfilter2d.gl
deleted file mode 100755
index 3ecdc991a..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copyconvolutionfilter2d.gl
+++ /dev/null
@@ -1,188 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(CopyConvolutionFilter2D,copy pixels into a two-dimensional convolution filter)
-_names(CopyConvolutionFilter2D)
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__internalformat>@,@<_param2>@)_C_
-_define(@<__x>@,@<_param3>@)_C_
-_define(@<__y>@,@<_param4>@)_C_
-_define(@<__width>@,@<_param5>@)_C_
-_define(@<__height>@,@<_param6>@)_C_
-.SH PARAMETERS
-_phead(__target)
-Must be _const(CONVOLUTION_2D).
-_phead(__internalformat)
-The internal format of the convolution filter kernel.
-The allowable values are
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(INTENSITY),
-_const(INTENSITY4),
-_const(INTENSITY8),
-_const(INTENSITY12),
-_const(INTENSITY16),
-_const(R3_G3_B2),
-_const(RGB),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12), or
-_const(RGBA16).
-_phead(__x __y)
-The window space coordinates of the lower-left coordinate of the
-pixel array to copy.
-_phead(__width)
-The width of the pixel array to copy.
-_phead(__height)
-The height of the pixel array to copy.
-.SH DESCRIPTION
-_cmnd defines a two-dimensional convolution filter kernel with pixels
-from the current _const(READ_BUFFER) (rather than from main memory,
-as is the case for _cmnd(ConvolutionFilter2D)).
-.sp
-The screen-aligned pixel rectangle with lower-left corner at (__x,\ __y),
-width __width and height __height
-is used to define the convolution filter. If any pixels within this
-region are
-outside the window that is associated with the GL context, the
-values obtained for those pixels are undefined.
-.sp
-The pixels in the rectangle are processed
-exactly as if _cmnd(ReadPixels) had been called with \f2format\fP
-set to RGBA, but the process stops just before final conversion.
-The R, G, B, and A components of each pixel are next scaled by the four
-2D _const(CONVOLUTION_FILTER_SCALE) parameters and biased by the
-four 2D _const(CONVOLUTION_FILTER_BIAS) parameters.
-(The scale and bias parameters are set by _cmnd(ConvolutionParameter)
-using the _const(CONVOLUTION_2D) target and the names
-_const(CONVOLUTION_FILTER_SCALE) and _const(CONVOLUTION_FILTER_BIAS).
-The parameters themselves are vectors of four values that are applied to red,
-green, blue, and alpha, in that order.)
-The R, G, B, and A values are not clamped to [0,1] at any time during this
-process.
-.sp
-Each pixel is then converted to the internal format specified by
-__internalformat.
-This conversion simply maps the component values of the pixel (R, G, B,
-and A) to the values included in the internal format (red, green, blue,
-alpha, luminance, and intensity). The mapping is as follows:
-.sp
-.TS
-center;
-lb cb cb cb cb cb cb
-l c c c c c c.
-_
-Internal Format Red Green Blue Alpha Luminance Intensity
-_
-_const(ALPHA) A
-_const(LUMINANCE) R
-_const(LUMINANCE_ALPHA) A R
-_const(INTENSITY) R
-_const(RGB) R G B
-_const(RGBA) R G B A
-_
-.TE
-.sp
-The red, green, blue, alpha, luminance, and/or intensity components of
-the resulting pixels are stored in floating-point rather than integer
-format.
-.sp
-Pixel ordering is such that lower x screen coordinates correspond to
-lower \f2i\fP filter image coordinates, and lower y screen coordinates
-correspond to lower \f2j\fP filter image coordinates.
-.PP
-Note that after a convolution is performed, the resulting color
-components are also scaled by their corresponding
-_const(POST_CONVOLUTION_c_SCALE) parameters and biased by their
-corresponding _const(POST_CONVOLUTION_c_BIAS) parameters (where
-\f2c\fP takes on the values \f3RED\fP, \f3GREEN\fP, \f3BLUE\fP, and
-\f3ALPHA\fP).
-These parameters are set by _cmnd(PixelTransfer).
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not
-_const(CONVOLUTION_2D).
-.P
-_const(INVALID_ENUM) is generated if __internalformat is not one of the
-allowable values.
-.P
-_const(INVALID_VALUE) is generated if __width is less than zero or greater
-than the maximum supported value.
-This value may be queried with _cmnd(GetConvolutionParameter)
-using target _const(CONVOLUTION_2D) and name
-_const(MAX_CONVOLUTION_WIDTH).
-.P
-_const(INVALID_VALUE) is generated if __height is less than zero or greater
-than the maximum supported value.
-This value may be queried with _cmnd(GetConvolutionParameter)
-using target _const(CONVOLUTION_2D) and name
-_const(MAX_CONVOLUTION_HEIGHT).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetConvolutionParameter), _cmnd(GetConvolutionFilter)
-.SH SEE ALSO
-_cmnd(ConvolutionFilter2D),
-_cmnd(ConvolutionParameter),
-_cmnd(PixelTransfer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copypixels.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/copypixels.gl
deleted file mode 100755
index d7edced77..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copypixels.gl
+++ /dev/null
@@ -1,258 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_header(CopyPixels,copy pixels in the frame buffer)
-_names(CopyPixels)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1 _param2)
-Specify the window coordinates of the lower left corner
-of the rectangular region of pixels to be copied.
-_phead(_param3 _param4)
-Specify the dimensions of the rectangular region of pixels to be copied.
-Both must be nonnegative.
-_phead(_param5)
-Specifies whether color values,
-depth values,
-or stencil values are to be copied.
-Symbolic constants
-_const(COLOR),
-_const(DEPTH),
-and _const(STENCIL) are accepted.
-.SH DESCRIPTION
-_cmnd copies a screen-aligned rectangle of pixels
-from the specified frame buffer location to a region relative to the
-current raster position.
-Its operation is well defined only if the entire pixel source region
-is within the exposed portion of the window.
-Results of copies from outside the window,
-or from regions of the window that are not exposed,
-are hardware dependent and undefined.
-.P
-_param1 and _param2 specify the window coordinates of
-the lower left corner of the rectangular region to be copied.
-_param3 and _param4 specify the dimensions of the
-rectangular region to be copied.
-Both _param3 and _param4 must not be negative.
-.P
-Several parameters control the processing of the pixel data
-while it is being copied.
-These parameters are set with three commands:
-_cmnd(PixelTransfer),
-_cmnd(PixelMap), and
-_cmnd(PixelZoom).
-This reference page describes the effects on _cmnd of most,
-but not all, of the parameters specified by these three commands.
-.P
-_cmnd copies values from each pixel with the lower left-hand corner at
-(_param1 + $i$, _param2 + $j$) for 0 \(<= $i$ < _param3
-and 0 \(<= $j$ < _param4.
-This pixel is said to be the $i$th pixel in the $j$th row.
-Pixels are copied in row order from the lowest to the highest row,
-left to right in each row.
-.P
-_param5 specifies whether color, depth, or stencil data is to be copied.
-The details of the transfer for each data type are as follows:
-.TP 15
-_const(COLOR)
-Indices or RGBA colors are read from the buffer currently specified as the
-read source buffer (see _cmnd(ReadBuffer)).
-If the GL is in color index mode,
-each index that is read from this buffer is converted
-to a fixed-point format with an unspecified
-number of bits to the right of the binary point.
-Each index is then shifted left by _const(INDEX_SHIFT) bits,
-and added to _const(INDEX_OFFSET).
-If _const(INDEX_SHIFT) is negative,
-the shift is to the right.
-In either case, zero bits fill otherwise unspecified bit locations in the
-result.
-If _const(MAP_COLOR) is true,
-the index is replaced with the value that it references in lookup table
-_const(PIXEL_MAP_I_TO_I).
-Whether the lookup replacement of the index is done or not,
-the integer part of the index is then ANDed with $2 sup b -1$,
-where $b$ is the number of bits in a color index buffer.
-.IP
-If the GL is in RGBA mode,
-the red, green, blue, and alpha components of each pixel that is read
-are converted to an internal floating-point format with unspecified
-precision.
-The conversion maps the largest representable component value to 1.0,
-and component value 0 to 0.0.
-The resulting floating-point color values are then multiplied
-by _const(c_SCALE) and added to _const(c_BIAS),
-where \f2c\fP is RED, GREEN, BLUE, and ALPHA
-for the respective color components.
-The results are clamped to the range [0,1].
-If _const(MAP_COLOR) is true,
-each color component is scaled by the size of lookup table
-_const(PIXEL_MAP_c_TO_c),
-then replaced by the value that it references in that table.
-\f2c\fP is R, G, B, or A.
-.IP
-If the _arbstring(imaging) extension is supported, the color values may
-be
-additionally processed by color-table lookups, color-matrix
-transformations, and convolution filters.
-.IP
-The GL then converts the resulting indices or RGBA colors to fragments
-by attaching the current raster position \f2z\fP coordinate and
-texture coordinates to each pixel,
-then assigning window coordinates
-($x sub r ~+~ i , y sub r ~+~ j$),
-where ($x sub r , y sub r$) is the current raster position,
-and the pixel was the $i$th pixel in the $j$th row.
-These pixel fragments are then treated just like the fragments generated by
-rasterizing points, lines, or polygons.
-Texture mapping,
-fog,
-and all the fragment operations are applied before the fragments are written
-to the frame buffer.
-.TP
-_const(DEPTH)
-Depth values are read from the depth buffer and
-converted directly to an internal floating-point format
-with unspecified precision.
-The resulting floating-point depth value is then multiplied
-by _const(DEPTH_SCALE) and added to _const(DEPTH_BIAS).
-The result is clamped to the range [0,1].
-.IP
-The GL then converts the resulting depth components to fragments
-by attaching the current raster position color or color index and
-texture coordinates to each pixel,
-then assigning window coordinates
-($x sub r ~+~ i , y sub r ~+~ j$),
-where ($x sub r , y sub r$) is the current raster position,
-and the pixel was the $i$th pixel in the $j$th row.
-These pixel fragments are then treated just like the fragments generated by
-rasterizing points, lines, or polygons.
-Texture mapping,
-fog,
-and all the fragment operations are applied before the fragments are written
-to the frame buffer.
-.TP
-_const(STENCIL)
-Stencil indices are read from the stencil buffer and
-converted to an internal fixed-point format
-with an unspecified number of bits to the right of the binary point.
-Each fixed-point index is then shifted left by _const(INDEX_SHIFT) bits,
-and added to _const(INDEX_OFFSET).
-If _const(INDEX_SHIFT) is negative,
-the shift is to the right.
-In either case, zero bits fill otherwise unspecified bit locations in the
-result.
-If _const(MAP_STENCIL) is true,
-the index is replaced with the value that it references in lookup table
-_const(PIXEL_MAP_S_TO_S).
-Whether the lookup replacement of the index is done or not,
-the integer part of the index is then ANDed with $2 sup b -1$,
-where $b$ is the number of bits in the stencil buffer.
-The resulting stencil indices are then written to the stencil buffer
-such that the index read from the $i$th location of the $j$th row
-is written to location
-($x sub r ~+~ i , y sub r ~+~ j$),
-where ($x sub r , y sub r$) is the current raster position.
-Only the pixel ownership test,
-the scissor test,
-and the stencil writemask affect these write operations.
-.P
-The rasterization described thus far assumes pixel zoom factors of 1.0.
-If
-.br
-_cmnd(PixelZoom) is used to change the $x$ and $y$ pixel zoom factors,
-pixels are converted to fragments as follows.
-If ($x sub r$, $y sub r$) is the current raster position,
-and a given pixel is in the $i$th location in the $j$th row of the source
-pixel rectangle,
-then fragments are generated for pixels whose centers are in the rectangle
-with corners at
-.P
-.ce
-($x sub r ~+~ zoom sub x^ i$, $y sub r ~+~ zoom sub y^j$)
-.sp .5
-.ce
- and
-.sp .5
-.ce
-($x sub r ~+~ zoom sub x^ (i ~+~ 1)$, $y sub r ~+~ zoom sub y^ ( j ~+~ 1 )$)
-.P
-where $zoom sub x$ is the value of _const(ZOOM_X) and
-$zoom sub y$ is the value of _const(ZOOM_Y).
-.SH EXAMPLES
-To copy the color pixel in the lower left corner of the window to the current raster position,
-use
-.Ex
-glCopyPixels(0, 0, 1, 1, _const(COLOR));
-.En
-.SH NOTES
-Modes specified by _cmnd(PixelStore) have no effect on the operation
-of _cmnd.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param5 is not an accepted value.
-.P
-_const(INVALID_VALUE) is generated if either _param3 or _param4 is negative.
-.P
-_const(INVALID_OPERATION) is generated if _param5 is _const(DEPTH)
-and there is no depth buffer.
-.P
-_const(INVALID_OPERATION) is generated if _param5 is _const(STENCIL)
-and there is no stencil buffer.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(CURRENT_RASTER_POSITION)
-.br
-_cmnd(Get) with argument _const(CURRENT_RASTER_POSITION_VALID)
-.SH SEE ALSO
-_cmnd(ColorTable),
-_cmnd(ConvolutionFilter1D),
-_cmnd(ConvolutionFilter2D),
-_cmnd(DepthFunc),
-_cmnd(DrawBuffer),
-_cmnd(DrawPixels),
-_cmnd(MatrixMode),
-_cmnd(PixelMap),
-_cmnd(PixelTransfer),
-_cmnd(PixelZoom),
-_cmnd(RasterPos),
-_cmnd(ReadBuffer),
-_cmnd(ReadPixels),
-_cmnd(SeparableFilter2D),
-_cmnd(StencilFunc)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copyteximage1d.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/copyteximage1d.gl
deleted file mode 100755
index 007395ec5..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copyteximage1d.gl
+++ /dev/null
@@ -1,178 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(CopyTexImage1D,copy pixels into a 1D texture image)
-_names(CopyTexImage1D)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the target texture.
-Must be _const(TEXTURE_1D).
-_phead(_param2)
-Specifies the level-of-detail number.
-Level 0 is the base image level.
-Level \f2n\fP is the \f2n\fPth mipmap reduction image.
-_phead(_param3)
-Specifies the internal format of the texture.
-Must be one of the following symbolic constants:
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(INTENSITY),
-_const(INTENSITY4),
-_const(INTENSITY8),
-_const(INTENSITY12),
-_const(INTENSITY16),
-_const(RGB),
-_const(R3_G3_B2),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12), or
-_const(RGBA16).
-_phead(_param4 _param5)
-Specify the window coordinates of the left corner
-of the row of pixels to be copied.
-_phead(_param6)
-Specifies the width of the texture image.
-Must be 0 or $2 sup n ~+~ 2*$_param7 for some integer $n$.
-The height of the texture image is 1.
-_phead(_param7)
-Specifies the width of the border.
-Must be either 0 or 1.
-.SH DESCRIPTION
-_cmnd defines a one-dimensional texture image with pixels from the current
-_const(READ_BUFFER).
-.P
-The screen-aligned pixel row with left corner at $(_eqnparam4, _eqnparam5)$
-and with a length of $_eqnparam6~+~2~*~_eqnparam7$
-defines the texture array
-at the mipmap level specified by _param2.
-_param3 specifies the internal format of the texture array.
-.P
-The pixels in the row are processed exactly as if
-_cmnd(CopyPixels) had been called, but the process stops just before
-final conversion.
-At this point all pixel component values are clamped to the range [0,\ 1]
-and then converted to the texture's internal format for storage in the texel
-array.
-.P
-Pixel ordering is such that lower $x$ screen coordinates correspond to
-lower texture coordinates.
-.P
-If any of the pixels within the specified row of the current
-_const(READ_BUFFER) are outside the window associated with the current
-rendering context, then the values obtained for those pixels are undefined.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-Texturing has no effect in color index mode.
-.P
-1, 2, 3, and 4 are not accepted values for _param3.
-.P
-An image with 0 width indicates a NULL texture.
-.P
-When the _arbstring(imaging) extension is supported, the RGBA components
-copied from the framebuffer may be processed by the imaging pipeline. See
-_cmnd(TexImage1D) for specific details.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not one of the
-allowable values.
-.P
-_const(INVALID_VALUE) is generated if _param2 is less than 0.
-.P
-_const(INVALID_VALUE) may be generated if _param2 is greater
-than $log sub 2 max$,
-where $max$ is the returned value of _const(MAX_TEXTURE_SIZE).
-.P
-_const(INVALID_VALUE) is generated if _param3 is not an
-allowable value.
-.P
-_const(INVALID_VALUE) is generated if _param6 is less than 0
-or greater than
-2 + _const(MAX_TEXTURE_SIZE),
-or if it cannot be represented as $2 sup n ~+~ 2~*~(_eqnparam7)$
-for some integer value of \f2n\fP.
-.P
-_const(INVALID_VALUE) is generated if _param7 is not 0 or 1.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetTexImage)
-.br
-_cmnd(IsEnabled) with argument _const(TEXTURE_1D)
-.SH SEE ALSO
-_cmnd(CopyPixels),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(PixelStore),
-_cmnd(PixelTransfer),
-_cmnd(TexEnv),
-_cmnd(TexGen),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-.br
-_cmnd(TexParameter)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copyteximage2d.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/copyteximage2d.gl
deleted file mode 100755
index b6bec2812..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copyteximage2d.gl
+++ /dev/null
@@ -1,182 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(CopyTexImage2D,copy pixels into a 2D texture image)
-_names(CopyTexImage2D)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the target texture.
-Must be _const(TEXTURE_2D).
-_phead(_param2)
-Specifies the level-of-detail number.
-Level 0 is the base image level.
-Level \f2n\fP is the \f2n\fPth mipmap reduction image.
-_phead(_param3)
-Specifies the internal format of the texture.
-Must be one of the following symbolic constants:
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(INTENSITY),
-_const(INTENSITY4),
-_const(INTENSITY8),
-_const(INTENSITY12),
-_const(INTENSITY16),
-_const(RGB),
-_const(R3_G3_B2),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12), or
-_const(RGBA16).
-_phead(_param4 _param5)
-Specify the window coordinates of the lower left corner
-of the rectangular region of pixels to be copied.
-_phead(_param6)
-Specifies the width of the texture image.
-Must be 0 or $2 sup n ~+~ 2*$_param8 for some integer $n$.
-_phead(_param7)
-Specifies the height of the texture image.
-Must be 0 or $2 sup m ~+~ 2*$_param8 for some integer $m$.
-_phead(_param8)
-Specifies the width of the border.
-Must be either 0 or 1.
-.SH DESCRIPTION
-_cmnd defines a two-dimensional texture image with pixels from the current
-_const(READ_BUFFER).
-.P
-The screen-aligned pixel rectangle with lower left corner at (_param4,
-_param5) and with a width of _param6$~+~2~*~$_param8 and a height of
-_param7$~+~2~*~$_param8
-defines the texture array
-at the mipmap level specified by _param2.
-_param3 specifies the internal format of the texture array.
-.P
-The pixels in the rectangle are processed exactly as if
-_cmnd(CopyPixels) had been called, but the process stops just before
-final conversion.
-At this point all pixel component values are clamped to the range $[0,1]$
-and then converted to the texture's internal format for storage in the texel
-array.
-.P
-Pixel ordering is such that lower $x$ and $y$ screen coordinates correspond to
-lower $s$ and $t$ texture coordinates.
-.P
-If any of the pixels within the specified rectangle of the current
-_const(READ_BUFFER) are outside the window associated with the current
-rendering context, then the values obtained for those pixels are undefined.
-.P
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-Texturing has no effect in color index mode.
-.P
-1, 2, 3, and 4 are not accepted values for _param3.
-.P
-An image with height or width of 0 indicates a NULL texture.
-.P
-When the _arbstring(imaging) extension is supported, the RGBA components
-read from the framebuffer may be processed by the imaging pipeline. See
-_cmnd(TexImage1D) for specific details.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not _const(TEXTURE_2D).
-.P
-_const(INVALID_VALUE) is generated if _param2 is less than 0.
-.P
-_const(INVALID_VALUE) may be generated if _param2 is greater
-than $log sub 2 max$,
-where $max$ is the returned value of _const(MAX_TEXTURE_SIZE).
-.P
-_const(INVALID_VALUE) is generated if _param6 or _param7 is less than 0,
-greater than $2~+~$_const(MAX_TEXTURE_SIZE), or if _param6 or _param7 cannot be
-represented as $2 sup k ~+~ 2~*~$_param8 for some integer
-$k$.
-.P
-_const(INVALID_VALUE) is generated if _param8 is not 0 or 1.
-.P
-_const(INVALID_VALUE) is generated if _param3 is not one of the
-allowable values.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetTexImage)
-.br
-_cmnd(IsEnabled) with argument _const(TEXTURE_2D)
-.SH SEE ALSO
-_cmnd(CopyPixels),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(PixelStore),
-_cmnd(PixelTransfer),
-_cmnd(TexEnv),
-_cmnd(TexGen),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-.br
-_cmnd(TexParameter)
-
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copytexsubimage1d.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/copytexsubimage1d.gl
deleted file mode 100755
index 17a01d7c5..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copytexsubimage1d.gl
+++ /dev/null
@@ -1,138 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(CopyTexSubImage1D,copy a one-dimensional texture subimage)
-_names(CopyTexSubImage1D)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the target texture.
-Must be _const(TEXTURE_1D).
-_phead(_param2)
-Specifies the level-of-detail number.
-Level 0 is the base image level.
-Level \f2n\fP is the \f2n\fPth mipmap reduction image.
-_phead(_param3)
-Specifies the texel offset within the texture array.
-_phead(_param4 _param5)
-Specify the window coordinates of the left corner
-of the row of pixels to be copied.
-_phead(_param6)
-Specifies the width of the texture subimage.
-.SH DESCRIPTION
-_cmnd replaces a portion of a one-dimensional
-texture image with pixels from the current _const(READ_BUFFER) (rather
-than from main memory, as is the case for _cmnd(TexSubImage1D)).
-.P
-The screen-aligned pixel row with left corner at (_param4,\ _param5), and with
-length _param6 replaces the portion of the
-texture array with x indices _param3 through $_eqnparam3 ~+~ _eqnparam6 ~-~ 1$,
-inclusive. The destination in the texture array may not
-include any texels outside the texture array as it was
-originally specified.
-.P
-The pixels in the row are processed exactly as if
-_cmnd(CopyPixels) had been called, but the process stops just before
-final conversion.
-At this point all pixel component values are clamped to the range [0,\ 1]
-and then converted to the texture's internal format for storage in the texel
-array.
-.P
-It is not an error to specify a subtexture with zero width, but
-such a specification has no effect.
-If any of the pixels within the specified row of the current
-_const(READ_BUFFER) are outside the read window associated with the current
-rendering context, then the values obtained for those pixels are undefined.
-.P
-No change is made to the \f2internalformat\fP, \f2width\fP,
-or \f2border\fP parameters of the specified texture
-array or to texel values outside the specified subregion.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-Texturing has no effect in color index mode.
-.P
-_cmnd(PixelStore) and _cmnd(PixelTransfer) modes affect texture images
-in exactly the way they affect _cmnd(DrawPixels).
-.P
-When the _arbstring(imaging) extension is supported, the RGBA components
-copied from the framebuffer may be processed by the imaging pipeline. See
-_cmnd(TexImage1D) for specific details.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not _const(TEXTURE_1D).
-.P
-_const(INVALID_OPERATION) is generated if the texture array has not
-been defined by a previous _cmnd(TexImage1D) or _cmnd(CopyTexImage1D) operation.
-.P
-_const(INVALID_VALUE) is generated if _param2 is less than 0.
-.P
-_const(INVALID_VALUE) may be generated if _param2$>log sub 2$\f2 max\fP,
-where \f2max\fP is the returned value of _const(MAX_TEXTURE_SIZE).
-.P
-_const(INVALID_VALUE) is generated if _param5$ ~<~ ~-b$
-or if _param6$ ~<~ ~-b$, where $b$
-is the border width of the texture array.
-.P
-_const(INVALID_VALUE) is generated if $_eqnparam3 ~<~ ~-b$, or
-$(_eqnparam3~+~_eqnparam6) ~>~ (w-b)$,
-where $w$ is the _const(TEXTURE_WIDTH), and $b$ is the _const(TEXTURE_BORDER)
-of the texture image being modified.
-Note that $w$ includes twice the border width.
-.P
-.SH ASSOCIATED GETS
-_cmnd(GetTexImage)
-.br
-_cmnd(IsEnabled) with argument _const(TEXTURE_1D)
-.SH SEE ALSO
-_cmnd(CopyPixels),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(PixelStore),
-_cmnd(PixelTransfer),
-_cmnd(ReadBuffer),
-_cmnd(TexEnv),
-_cmnd(TexGen),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexParameter),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copytexsubimage2d.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/copytexsubimage2d.gl
deleted file mode 100755
index 850b17014..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copytexsubimage2d.gl
+++ /dev/null
@@ -1,154 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(CopyTexSubImage2D,copy a two-dimensional texture subimage)
-_names(CopyTexSubImage2D)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the target texture.
-Must be _const(TEXTURE_2D).
-_phead(_param2)
-Specifies the level-of-detail number.
-Level 0 is the base image level.
-Level \f2n\fP is the \f2n\fPth mipmap reduction image.
-_phead(_param3)
-Specifies a texel offset in the x direction within the texture array.
-_phead(_param4)
-Specifies a texel offset in the y direction within the texture array.
-_phead(_param5 _param6)
-Specify the window coordinates of the lower left corner
-of the rectangular region of pixels to be copied.
-_phead(_param7)
-Specifies the width of the texture subimage.
-_phead(_param8)
-Specifies the height of the texture subimage.
-.SH DESCRIPTION
-_cmnd replaces a rectangular portion of a two-dimensional
-texture image with pixels from the current _const(READ_BUFFER) (rather
-than from main memory, as is the case for _cmnd(TexSubImage2D)).
-.P
-The screen-aligned pixel rectangle with lower left corner at
-(_param5,\ _param6) and with
-width _param7 and height _param8 replaces the portion of the
-texture array with x indices _param3 through _param3$~+~$_param7$~-~$1,
-inclusive, and y indices _param4 through _param4$~+~$_param8$~-~$1,
-inclusive, at the mipmap level specified by _param2.
-.P
-The pixels in the rectangle are processed exactly as if
-_cmnd(CopyPixels) had been called, but the process stops just before
-final conversion.
-At this point, all pixel component values are clamped to the range [0,\ 1]
-and then converted to the texture's internal format for storage in the texel
-array.
-.P
-The destination rectangle in the texture array may not include any texels
-outside the texture array as it was originally specified.
-It is not an error to specify a subtexture with zero width or height, but
-such a specification has no effect.
-.P
-If any of the pixels within the specified rectangle of the current
-_const(READ_BUFFER) are outside the read window associated with the current
-rendering context, then the values obtained for those pixels are undefined.
-.P
-No change is made to the \f2internalformat\fP, \f2width\fP,
-\f2height\fP, or \f2border\fP parameters of the specified texture
-array or to texel values outside the specified subregion.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-Texturing has no effect in color index mode.
-.P
-_cmnd(PixelStore) and _cmnd(PixelTransfer) modes affect texture images
-in exactly the way they affect _cmnd(DrawPixels).
-.P
-When the _arbstring(imaging) extension is supported, the RGBA components
-read from the framebuffer may be processed by the imaging pipeline. See
-_cmnd(TexImage1D) for specific details.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not _const(TEXTURE_2D).
-.P
-_const(INVALID_OPERATION) is generated if the texture array has not
-been defined by a previous _cmnd(TexImage2D) or _cmnd(CopyTexImage2D) operation.
-.P
-_const(INVALID_VALUE) is generated if _param2 is less than 0.
-.P
-_const(INVALID_VALUE) may be generated if _param2 is greater
-than $log sub 2 max$,
-where $max$ is the returned value of _const(MAX_TEXTURE_SIZE).
-.P
-_const(INVALID_VALUE) is generated if _param5$ ~<~ ~-b$ or if
-_param6$ ~<~ ~-b$,
-where $b$ is the border width of the texture array.
-.P
-_const(INVALID_VALUE) is generated if $_eqnparam3 ~<~ -b$,
-(_param3$~+~$_param7)$~>~(w ~-~b)$,
-_param4$~<~ ~-b$, or
-(_param4$~+~$_param8)$~>~(h ~-~b)$,
-where $w$ is the _const(TEXTURE_WIDTH),
-$h$ is the _const(TEXTURE_HEIGHT),
-and $b$ is the _const(TEXTURE_BORDER)
-of the texture image being modified.
-Note that $w$ and $h$
-include twice the border width.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetTexImage)
-.br
-_cmnd(IsEnabled) with argument _const(TEXTURE_2D)
-.SH SEE ALSO
-_cmnd(CopyPixels),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(PixelStore),
-_cmnd(PixelTransfer),
-_cmnd(ReadBuffer),
-_cmnd(TexEnv),
-_cmnd(TexGen),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexParameter),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copytexsubimage3d.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/copytexsubimage3d.gl
deleted file mode 100755
index 5450cb10a..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/copytexsubimage3d.gl
+++ /dev/null
@@ -1,159 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(CopyTexSubImage3D,copy a three-dimensional texture subimage)
-_names(CopyTexSubImage3D)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the target texture.
-Must be _const(TEXTURE_3D)
-_phead(_param2)
-Specifies the level-of-detail number.
-Level 0 is the base image level.
-Level \f2n\fP is the \f2n\fPth mipmap reduction image.
-_phead(_param3)
-Specifies a texel offset in the x direction within the texture array.
-_phead(_param4)
-Specifies a texel offset in the y direction within the texture array.
-_phead(_param5)
-Specifies a texel offset in the z direction within the texture array.
-_phead(_param6 _param7)
-Specify the window coordinates of the lower left corner
-of the rectangular region of pixels to be copied.
-_phead(_param8)
-Specifies the width of the texture subimage.
-_phead(_param9)
-Specifies the height of the texture subimage.
-.SH DESCRIPTION
-_cmnd replaces a rectangular portion of a three-dimensional
-texture image with pixels from the current _const(READ_BUFFER) (rather
-than from main memory, as is the case for _cmnd(TexSubImage3D)).
-.P
-The screen-aligned pixel rectangle with lower left corner at
-(_param6,\ _param7) and with
-width _param8 and height _param9 replaces the portion of the
-texture array with x indices _param3 through _param3$~+~$_param8$~-~$1,
-inclusive, and y indices _param4 through _param4$~+~$_param9$~-~$1,
-inclusive, at z index _param5 and at the mipmap level specified by _param2.
-.P
-The pixels in the rectangle are processed exactly as if
-_cmnd(CopyPixels) had been called, but the process stops just before
-final conversion.
-At this point, all pixel component values are clamped to the range [0,\ 1]
-and then converted to the texture's internal format for storage in the texel
-array.
-.P
-The destination rectangle in the texture array may not include any texels
-outside the texture array as it was originally specified.
-It is not an error to specify a subtexture with zero width or height, but
-such a specification has no effect.
-.P
-If any of the pixels within the specified rectangle of the current
-_const(READ_BUFFER) are outside the read window associated with the current
-rendering context, then the values obtained for those pixels are undefined.
-.P
-No change is made to the \f2internalformat\fP, \f2width\fP,
-\f2height\fP, \f2depth\fP, or \f2border\fP parameters of the specified texture
-array or to texel values outside the specified subregion.
-.SH NOTES
-_cmnd is available only if the GL version is 1.2 or greater.
-.P
-Texturing has no effect in color index mode.
-.P
-_cmnd(PixelStore) and _cmnd(PixelTransfer) modes affect texture images
-in exactly the way they affect _cmnd(DrawPixels).
-.P
-When the _arbstring(imaging) extension is supported, the RGBA components
-copied from the framebuffer may be processed by the imaging pipeline, as
-if they were a two-dimensional texture. See _cmnd(TexImage2D) for
-specific details.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not _const(TEXTURE_3D).
-.P
-_const(INVALID_OPERATION) is generated if the texture array has not
-been defined by a previous _cmnd(TexImage3D) or _cmnd(CopyTexImage3D) operation.
-.P
-_const(INVALID_VALUE) is generated if _param2 is less than 0.
-.P
-_const(INVALID_VALUE) may be generated if _param2 is greater
-than $log sub 2^max$,
-where $max$ is the returned value of _const(MAX_3D_TEXTURE_SIZE).
-.P
-_const(INVALID_VALUE) is generated if _param6$ ~<~ ~-b$ or if
-_param7$ ~<~ ~-b$,
-where $b$ is the border width of the texture array.
-.P
-_const(INVALID_VALUE) is generated if $_eqnparam3 ~<~ -b$,
-(_param3$~+~$_param8)$~>~(w ~-~b)$,
-_param4$~<~ ~-b$,
-(_param4$~+~$_param9)$~>~(h ~-~b)$,
-_param5$~<~ ~-b$, or _param5$~>~(d ~-~b)$,
-where $w$ is the _const(TEXTURE_WIDTH),
-$h$ is the _const(TEXTURE_HEIGHT),
-$d$ is the _const(TEXTURE_DEPTH),
-and $b$ is the _const(TEXTURE_BORDER)
-of the texture image being modified.
-Note that $w$, $h$, and $d$
-include twice the border width.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetTexImage)
-.br
-_cmnd(IsEnabled) with argument _const(TEXTURE_3D)
-.SH SEE ALSO
-_cmnd(CopyPixels),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(PixelStore),
-_cmnd(PixelTransfer),
-_cmnd(ReadBuffer),
-_cmnd(TexEnv),
-_cmnd(TexGen),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexParameter),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/cullface.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/cullface.gl
deleted file mode 100755
index 1a77d680c..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/cullface.gl
+++ /dev/null
@@ -1,75 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(CullFace,specify whether front- or back-facing facets can be culled)
-_names(CullFace)
-.SH PARAMETERS
-_phead(_param1)
-Specifies whether front- or back-facing facets are candidates for culling.
-Symbolic constants
-_const(FRONT), _const(BACK), and _const(FRONT_AND_BACK) are accepted.
-The initial value is _const(BACK).
-.SH DESCRIPTION
-_cmnd specifies whether front- or back-facing facets are culled
-(as specified by \f2mode\fP) when facet culling is enabled. Facet
-culling is initially disabled.
-To enable and disable facet culling, call the
-_cmnd(Enable) and _cmnd(Disable) commands
-with the argument _const(CULL_FACE).
-Facets include triangles,
-quadrilaterals,
-polygons,
-and rectangles.
-.P
-_cmnd(FrontFace) specifies which of the clockwise and counterclockwise facets
-are front-facing and back-facing.
-See _cmnd(FrontFace).
-.SH NOTES
-If _param1 is _const(FRONT_AND_BACK), no facets are drawn, but other
-primitives such as points and lines are drawn.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(IsEnabled) with argument _const(CULL_FACE)
-.br
-_cmnd(Get) with argument _const(CULL_FACE_MODE)
-.SH SEE ALSO
-_cmnd(Enable),
-_cmnd(FrontFace)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/deletelists.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/deletelists.gl
deleted file mode 100755
index b95fea9d2..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/deletelists.gl
+++ /dev/null
@@ -1,64 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_header(DeleteLists,delete a contiguous group of display lists)
-_names(DeleteLists)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the integer name of the first display list to delete.
-_phead(_param2)
-Specifies the number of display lists to delete.
-.SH DESCRIPTION
-_cmnd causes a contiguous group of display lists to be deleted.
-_param1 is the name of the first display list to be deleted,
-and _param2 is the number of display lists to delete.
-All display lists \fId\fP with _param1 \(<= \fId\fP \(<= _param1 + _param2 \- 1
-are deleted.
-.P
-All storage locations allocated to the specified display lists are freed,
-and the names are available for reuse at a later time.
-Names within the range that do not have an associated display list are ignored.
-If _param2 is 0, nothing happens.
-.SH ERRORS
-_const(INVALID_VALUE) is generated if _param2 is negative.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(CallList),
-_cmnd(CallLists),
-_cmnd(GenLists),
-_cmnd(IsList),
-_cmnd(NewList)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/deletetextures.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/deletetextures.gl
deleted file mode 100755
index f5ad0c0aa..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/deletetextures.gl
+++ /dev/null
@@ -1,75 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(DeleteTextures,delete named textures)
-_names(DeleteTextures)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the number of textures to be deleted.
-_phead(_param2)
-Specifies an array of textures to be deleted.
-.SH DESCRIPTION
-_cmnd deletes _param1 textures named by the elements of the array _param2.
-After a texture is deleted, it has no contents or dimensionality,
-and its name is free for reuse (for example by _cmnd(GenTextures)).
-If a texture that is currently bound is deleted, the binding reverts
-to 0 (the default texture).
-.P
-_cmnd silently ignores 0's and names that do not correspond to
-existing textures.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.SH ERRORS
-_const(INVALID_VALUE) is generated if _param1 is negative.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(IsTexture)
-.SH SEE ALSO
-_cmnd(AreTexturesResident),
-_cmnd(BindTexture),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(GenTextures),
-_cmnd(Get),
-_cmnd(GetTexParameter),
-_cmnd(PrioritizeTextures),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_C_ _cmnd(TexImage3D),
-_cmnd(TexParameter)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/depthfunc.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/depthfunc.gl
deleted file mode 100755
index a41227688..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/depthfunc.gl
+++ /dev/null
@@ -1,105 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(DepthFunc,specify the value used for depth buffer comparisons)
-_names(DepthFunc)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the depth comparison function.
-Symbolic constants
-_const(NEVER),
-_const(LESS),
-_const(EQUAL),
-_const(LEQUAL),
-_const(GREATER),
-_const(NOTEQUAL),
-_const(GEQUAL), and
-_const(ALWAYS) are accepted.
-The initial value is _const(LESS).
-.SH DESCRIPTION
-_cmnd specifies the function used to compare each incoming pixel depth value
-with the depth value present in the depth buffer.
-The comparison is performed only if depth testing is enabled.
-(See _cmnd(Enable) and _cmnd(Disable) of _const(DEPTH_TEST).)
-.P
-_param1 specifies the conditions under which the pixel will be drawn.
-The comparison functions are as follows:
-.TP 16
-_const(NEVER)
-Never passes.
-.TP
-_const(LESS)
-Passes if the incoming depth value is less than the stored depth value.
-.TP
-_const(EQUAL)
-Passes if the incoming depth value is equal to the stored depth value.
-.TP
-_const(LEQUAL)
-Passes if the incoming depth value is less than or equal to
-the stored depth value.
-.TP
-_const(GREATER)
-Passes if the incoming depth value is greater than the stored depth value.
-.TP
-_const(NOTEQUAL)
-Passes if the incoming depth value is not equal to the stored depth value.
-.TP
-_const(GEQUAL)
-Passes if the incoming depth value is greater than or equal to
-the stored depth value.
-.TP
-_const(ALWAYS)
-Always passes.
-.P
-The initial value of _param1 is _const(LESS).
-Initially, depth testing is disabled.
-.NOTES
-Even if the depth buffer exists and the depth mask is non-zero, the
-depth buffer is not updated if the depth test is disabled.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(DEPTH_FUNC)
-.br
-_cmnd(IsEnabled) with argument _const(DEPTH_TEST)
-.SH SEE ALSO
-_cmnd(DepthRange),
-_cmnd(Enable),
-_cmnd(PolygonOffset)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/depthmask.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/depthmask.gl
deleted file mode 100755
index ef57b2ad3..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/depthmask.gl
+++ /dev/null
@@ -1,63 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(DepthMask,enable or disable writing into the depth buffer)
-_names(DepthMask)
-.SH PARAMETERS
-_phead(_param1)
-Specifies whether the depth buffer is enabled for writing.
-If _param1 is _const(FALSE),
-depth buffer writing is disabled.
-Otherwise, it is enabled.
-Initially, depth buffer writing is enabled.
-.SH DESCRIPTION
-_cmnd specifies whether the depth buffer is enabled for writing.
-If _param1 is _const(FALSE),
-depth buffer writing is disabled.
-Otherwise, it is enabled.
-Initially, depth buffer writing is enabled.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(DEPTH_WRITEMASK)
-.SH SEE ALSO
-_cmnd(ColorMask),
-_cmnd(DepthFunc),
-_cmnd(DepthRange),
-_cmnd(IndexMask),
-_cmnd(StencilMask)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/depthrange.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/depthrange.gl
deleted file mode 100755
index b68b32e2a..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/depthrange.gl
+++ /dev/null
@@ -1,79 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(DepthRange,specify mapping of depth values from normalized device coordinates to window coordinates)
-_names(DepthRange)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the mapping of the near clipping plane to window coordinates.
-The initial value is 0.
-_phead(_param2)
-Specifies the mapping of the far clipping plane to window coordinates.
-The initial value is 1.
-.SH DESCRIPTION
-After clipping and division by \f2w\fP,
-depth coordinates range from \-1 to 1,
-corresponding to the near and far clipping planes.
-_cmnd specifies a linear mapping of the normalized depth coordinates
-in this range to window depth coordinates.
-Regardless of the actual depth buffer implementation,
-window coordinate depth values are treated as though they range
-from 0 through 1 (like color components).
-Thus,
-the values accepted by _cmnd are both clamped to this range
-before they are accepted.
-.P
-The setting of (0,1) maps the near plane to 0 and
-the far plane to 1.
-With this mapping,
-the depth buffer range is fully utilized.
-.SH NOTES
-It is not necessary that _param1 be less than _param2.
-Reverse mappings such as $_eqnparam1 ~=~ 1$, and $_eqnparam2 ~=~ 0$
-are acceptable.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(DEPTH_RANGE)
-.SH SEE ALSO
-_cmnd(DepthFunc),
-_cmnd(PolygonOffset),
-_cmnd(Viewport)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/drawarrays.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/drawarrays.gl
deleted file mode 100755
index 388988fad..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/drawarrays.gl
+++ /dev/null
@@ -1,116 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_C_ A real line follows.
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_C_ Use GL not OpenGL
-_C_ Don't change the ordering of the main headers.
-_C_ C specification (or fortran) is handled automatically
-_C_ .TH is automatically added to the top of this file.
-_C_ Below, use current tense, active do not capitalize the first word and dont
-_C_ use a period.
-_header(DrawArrays, render primitives from array data)
-_names(DrawArrays)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies what kind of primitives to render.
-Symbolic constants
-_const(POINTS),
-_const(LINE_STRIP),
-_const(LINE_LOOP),
-_const(LINES),
-_const(TRIANGLE_STRIP),
-_const(TRIANGLE_FAN),
-_const(TRIANGLES),
-_const(QUAD_STRIP),
-_const(QUADS),
-and _const(POLYGON) are accepted.
-_phead(_param2)
-Specifies the starting index in the enabled arrays.
-_phead(_param3)
-Specifies the number of indices to be rendered.
-.SH DESCRIPTION
-_cmnd specifies multiple geometric primitives
-with very few subroutine calls. Instead of calling a GL procedure
-to pass each individual vertex, normal, texture coordinate, edge
-flag, or color, you can prespecify
-separate arrays of vertices, normals, and colors and use them to
-construct a sequence of primitives with a single
-call to _cmnd.
-.P
-When _cmnd is called, it uses _param3 sequential elements from each
-enabled array to construct a sequence of geometric primitives,
-beginning with element _param2. _param1 specifies what kind of
-primitives are constructed, and how the array elements
-construct those primitives. If _const(VERTEX_ARRAY) is not enabled, no
-geometric primitives are generated.
-.P
-Vertex attributes that are modified by _cmnd have an
-unspecified value after _cmnd returns. For example, if
-_const(COLOR_ARRAY) is enabled, the value of the current color is
-undefined after _cmnd executes. Attributes that aren't
-modified remain well defined.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-_cmnd is included in display lists. If _cmnd is entered into a
-display list,
-the necessary array data (determined by the array pointers and
-enables) is also
-entered into the display list. Because the array pointers and
-enables are client-side state, their values affect display lists
-when the lists are created, not when the lists are executed.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_VALUE) is generated if _param3 is negative.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed between
-the execution of _cmnd(Begin) and the corresponding _cmnd(End).
-.SH SEE ALSO
-_cmnd(ArrayElement),
-_cmnd(ColorPointer),
-_cmnd(DrawElements),
-_cmnd(DrawRangeElements),
-_cmnd(EdgeFlagPointer),
-_cmnd(GetPointerv),
-_cmnd(IndexPointer),
-_cmnd(InterleavedArrays),
-_cmnd(NormalPointer),
-_cmnd(TexCoordPointer),
-_cmnd(VertexPointer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/drawbuffer.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/drawbuffer.gl
deleted file mode 100755
index 52699d73e..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/drawbuffer.gl
+++ /dev/null
@@ -1,158 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(DrawBuffer,specify which color buffers are to be drawn into)
-_names(DrawBuffer)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies up to four color buffers to be drawn into.
-Symbolic constants
-_const(NONE),
-_const(FRONT_LEFT),
-_const(FRONT_RIGHT),
-_const(BACK_LEFT),
-_const(BACK_RIGHT),
-_const(FRONT),
-_const(BACK),
-_const(LEFT),
-_const(RIGHT),
-_const(FRONT_AND_BACK), and
-_const(AUX)\f2i\fP,
-where \f2i\fP is between 0 and
-.br
-``_const(AUX_BUFFERS)'' \-1,
-are accepted (_const(AUX_BUFFERS) is not the upper limit; use _cmnd(Get)
-to query the number of available aux buffers.)
-The initial value is _const(FRONT) for single-buffered contexts,
-and _const(BACK) for double-buffered contexts.
-.SH DESCRIPTION
-When colors are written to the frame buffer,
-they are written into the color buffers specified by _cmnd.
-The specifications are as follows:
-.TP 25
-_const(NONE)
-No color buffers are written.
-.TP
-_const(FRONT_LEFT)
-Only the front left color buffer is written.
-.TP
-_const(FRONT_RIGHT)
-Only the front right color buffer is written.
-.TP
-_const(BACK_LEFT)
-Only the back left color buffer is written.
-.TP
-_const(BACK_RIGHT)
-Only the back right color buffer is written.
-.TP
-_const(FRONT)
-Only the front left and front right color buffers are written.
-If there is no front right color buffer,
-only the front left color buffer is written.
-.TP
-_const(BACK)
-Only the back left and back right color buffers are written.
-If there is no back right color buffer,
-only the back left color buffer is written.
-.TP
-_const(LEFT)
-Only the front left and back left color buffers are written.
-If there is no back left color buffer,
-only the front left color buffer is written.
-.TP
-_const(RIGHT)
-Only the front right and back right color buffers are written.
-If there is no back right color buffer,
-only the front right color buffer is written.
-.BP
-.TP
-_const(FRONT_AND_BACK)
-All the front and back color buffers
-(front left, front right, back left, back right)
-are written.
-If there are no back color buffers,
-only the front left and front right color buffers are written.
-If there are no right color buffers,
-only the front left and back left color buffers are written.
-If there are no right or back color buffers,
-only the front left color buffer is written.
-.TP
-_const(AUX)\f2i\fP
-Only auxiliary color buffer \f2i\fP is written.
-.P
-If more than one color buffer is selected for drawing,
-then blending or logical operations are computed and applied independently
-for each color buffer and can produce different results in each buffer.
-.P
-Monoscopic contexts include only
-.I left
-buffers, and stereoscopic contexts include both
-.I left
-and
-.I right
-buffers.
-Likewise, single-buffered contexts include only
-.I front
-buffers, and double-buffered contexts include both
-.I front
-and
-.I back
-buffers.
-The context is selected at GL initialization.
-.SH NOTES
-It is always the case that _const(AUX)$i$ = _const(AUX0) + $i$.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if none of the buffers indicated
-by _param1 exists.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(DRAW_BUFFER)
-.br
-_cmnd(Get) with argument _const(AUX_BUFFERS)
-.SH SEE ALSO
-_cmnd(BlendFunc),
-_cmnd(ColorMask),
-_cmnd(IndexMask),
-_cmnd(LogicOp),
-_cmnd(ReadBuffer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/drawelements.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/drawelements.gl
deleted file mode 100755
index def9ede20..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/drawelements.gl
+++ /dev/null
@@ -1,122 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_C_ A real line follows.
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_C_ Use GL not OpenGL
-_C_ Don't change the ordering of the main headers.
-_C_ C specification (or fortran) is handled automatically
-_C_ .TH is automatically added to the top of this file.
-_C_ Below, use current tense, active do not capitalize the first word and dont
-_C_ use a period.
-_header(DrawElements, render primitives from array data)
-_names(DrawElements)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies what kind of primitives to render.
-Symbolic constants
-_const(POINTS),
-_const(LINE_STRIP),
-_const(LINE_LOOP),
-_const(LINES),
-_const(TRIANGLE_STRIP),
-_const(TRIANGLE_FAN),
-_const(TRIANGLES),
-_const(QUAD_STRIP),
-_const(QUADS),
-and _const(POLYGON) are accepted.
-_phead(_param2)
-Specifies the number of elements to be rendered.
-_phead(_param3)
-Specifies the type of the values in _param4. Must be one of
-_const(UNSIGNED_BYTE), _const(UNSIGNED_SHORT), or
-_const(UNSIGNED_INT).
-_phead(_param4)
-Specifies a pointer to the location where the indices are stored.
-.SH DESCRIPTION
-_cmnd specifies multiple geometric primitives
-with very few subroutine calls. Instead of calling a GL function
-to pass each individual vertex, normal, texture coordinate, edge
-flag, or color, you can prespecify
-separate arrays of vertices, normals, and so on and use them to
-construct a sequence of primitives with a single
-call to _cmnd.
-.P
-When _cmnd is called, it uses _param2 sequential elements from an
-enabled array, starting at _param4 to construct a sequence of
-geometric primitives. _param1 specifies what kind of primitives are
-constructed, and how the array elements construct these primitives. If
-more than one array is enabled, each is used. If
-_const(VERTEX_ARRAY) is not enabled, no geometric primitives are
-constructed.
-.P
-Vertex attributes that are modified by _cmnd have an
-unspecified value after _cmnd returns. For example, if
-_const(COLOR_ARRAY) is enabled, the value of the current color is
-undefined after _cmnd executes. Attributes that aren't
-modified maintain their previous values.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-_cmnd is included in display lists. If _cmnd is entered into a
-display list,
-the necessary array data (determined by the array pointers and
-enables) is also
-entered into the display list. Because the array pointers and
-enables are client-side state, their values affect display lists
-when the lists are created, not when the lists are executed.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_VALUE) is generated if _param2 is negative.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed between
-the execution of _cmnd(Begin) and the corresponding _cmnd(End).
-.SH SEE ALSO
-_cmnd(ArrayElement),
-_cmnd(ColorPointer),
-_cmnd(DrawArrays),
-_cmnd(DrawRangeElements),
-_cmnd(EdgeFlagPointer),
-_cmnd(GetPointerv),
-_cmnd(IndexPointer),
-_cmnd(InterleavedArrays),
-_cmnd(NormalPointer),
-_cmnd(TexCoordPointer),
-_cmnd(VertexPointer)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/drawpixels.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/drawpixels.gl
deleted file mode 100755
index 4bc21e919..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/drawpixels.gl
+++ /dev/null
@@ -1,559 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(DrawPixels,write a block of pixels to the frame buffer)
-_names(DrawPixels)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1 _param2)
-Specify the dimensions of the pixel rectangle to be written
-into the frame buffer.
-_phead(_param3)
-Specifies the format of the pixel data.
-Symbolic constants
-_const(COLOR_INDEX),
-_const(STENCIL_INDEX),
-_const(DEPTH_COMPONENT),
-_const(RGB),
-_const(BGR),
-_const(RGBA),
-_const(BGRA),
-_C_ _const(ABGR_EXT),
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(LUMINANCE), and
-_const(LUMINANCE_ALPHA) are accepted.
-_phead(_param4)
-Specifies the data type for _param5.
-Symbolic constants
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV)
-are accepted.
-_phead(_param5)
-Specifies a pointer to the pixel data.
-.SH DESCRIPTION
-_cmnd reads pixel data from memory and writes it into the frame buffer
-.br
-relative to the current raster position, provided that the raster
-position is valid. Use
-.br
-_cmnd(RasterPos) to set the current raster position; use
-_cmnd(Get) with argument _const(CURRENT_RASTER_POSITION_VALID)
-to determine if the specified raster position is valid, and
-_cmnd(Get) with argument _const(CURRENT_RASTER_POSITION)
-to query the raster position.
-.P
-Several parameters define the encoding of pixel data in memory
-and control the processing of the pixel data
-before it is placed in the frame buffer.
-These parameters are set with four commands:
-_cmnd(PixelStore),
-_cmnd(PixelTransfer),
-_cmnd(PixelMap), and _cmnd(PixelZoom).
-This reference page describes the effects on _cmnd of many,
-but not all, of the parameters specified by these four commands.
-.P
-Data is read from _param5 as a sequence of signed or unsigned bytes,
-signed or unsigned shorts, signed or unsigned integers, or
-single-precision floating-point values, depending on _param4.
-When _param4 is one of _const(UNSIGNED_BYTE), _const(BYTE),
-_const(UNSIGNED_SHORT), _const(SHORT), _const(UNSIGNED_INT),
-_const(INT), or _const(FLOAT) each of these bytes, shorts, integers, or
-floating-point values is interpreted as one color or depth component, or
-one index, depending on _param3.
-When _param4 is one of _const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_SHORT_5_6_5), _const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_5_5_5_1), _const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_10_10_10_2), each unsigned value is interpreted as
-containing all the components for a single pixel, with the color
-components arranged according to _param3.
-When _param4 is one of _const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5_REV), _const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_1_5_5_5_REV), _const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_2_10_10_10_REV), each unsigned value is interpreted
-as containing all color components, specified by _param3, for a single
-pixel in a reversed order. Indices are always treated individually.
-Color components are treated as groups of one, two, three, or four
-values, again based on _param3. Both individual indices and groups of
-components are referred to as pixels.
-If _param4 is _const(BITMAP), the data must be unsigned bytes, and
-_param3 must be either _const(COLOR_INDEX) or _const(STENCIL_INDEX).
-Each unsigned byte is treated as eight 1-bit pixels, with bit ordering
-determined by _const(UNPACK_LSB_FIRST) (see _cmnd(PixelStore)).
-.P
-_param1$~ times ~$_param2 pixels are read from memory,
-starting at location _param5.
-By default, these pixels are taken from adjacent memory locations,
-except that after all _param1 pixels are read,
-the read pointer is advanced to the next four-byte boundary.
-The four-byte row alignment is specified by _cmnd(PixelStore) with
-argument _const(UNPACK_ALIGNMENT),
-and it can be set to one, two, four, or eight bytes.
-Other pixel store parameters specify different read pointer advancements,
-both before the first pixel is read
-and after all _param1 pixels are read.
-See the _cmnd(PixelStore) reference page for details on these options.
-.P
-The _param1$~ times ~$_param2 pixels that are read from memory are
-each operated on in the same way,
-based on the values of several parameters specified by _cmnd(PixelTransfer)
-and _cmnd(PixelMap).
-The details of these operations,
-as well as the target buffer into which the pixels are drawn,
-are specific to the format of the pixels,
-as specified by _param3.
-_param3 can assume one of 13 symbolic values:
-.TP 10
-_const(COLOR_INDEX)
-Each pixel is a single value,
-a color index.
-It is converted to fixed-point format,
-with an unspecified number of bits to the right of the binary point,
-regardless of the memory data type.
-Floating-point values convert to true fixed-point values.
-Signed and unsigned integer data is converted with all fraction bits
-set to 0.
-Bitmap data convert to either 0 or 1.
-.IP
-Each fixed-point index is then shifted left by _const(INDEX_SHIFT) bits
-and added to _const(INDEX_OFFSET).
-If _const(INDEX_SHIFT) is negative,
-the shift is to the right.
-In either case, zero bits fill otherwise unspecified bit locations in the
-result.
-.IP
-If the GL is in RGBA mode,
-the resulting index is converted to an RGBA pixel
-with the help of the _const(PIXEL_MAP_I_TO_R),
-_const(PIXEL_MAP_I_TO_G),
-_const(PIXEL_MAP_I_TO_B),
-and _const(PIXEL_MAP_I_TO_A) tables.
-If the GL is in color index mode,
-and if _const(MAP_COLOR) is true,
-the index is replaced with the value that it references in lookup table
-_const(PIXEL_MAP_I_TO_I).
-Whether the lookup replacement of the index is done or not,
-the integer part of the index is then ANDed with $2 sup b -1$,
-where $b$ is the number of bits in a color index buffer.
-.BP
-.IP
-The GL then converts the resulting indices or RGBA colors to fragments
-by attaching the current raster position \f2z\fP coordinate and
-texture coordinates to each pixel,
-then assigning $x$ and $y$ window coordinates to the $n$th fragment such that
-.sp
-.RS
-.ce
-$x sub n ~=~ x sub r ~+~ n ~ roman mod ~ _eqnparam1$
-.sp
-.ce
-$y sub n ~=~ y sub r ~+~ \(lf n ^/^ _eqnparam1 ~ \(rf$
-.ce 0
-.sp
-.RE
-.IP
-where ($x sub r , y sub r$) is the current raster position.
-These pixel fragments are then treated just like the fragments generated by
-rasterizing points, lines, or polygons.
-Texture mapping,
-fog,
-and all the fragment operations are applied before the fragments are written
-to the frame buffer.
-.TP
-_const(STENCIL_INDEX)
-Each pixel is a single value,
-a stencil index.
-It is converted to fixed-point format,
-with an unspecified number of bits to the right of the binary point,
-regardless of the memory data type.
-Floating-point values convert to true fixed-point values.
-Signed and unsigned integer data is converted with all fraction bits
-set to 0.
-Bitmap data convert to either 0 or 1.
-.IP
-Each fixed-point index is then shifted left by _const(INDEX_SHIFT) bits,
-and added to _const(INDEX_OFFSET).
-If _const(INDEX_SHIFT) is negative,
-the shift is to the right.
-In either case, zero bits fill otherwise unspecified bit locations in the
-result.
-If _const(MAP_STENCIL) is true,
-the index is replaced with the value that it references in lookup table
-_const(PIXEL_MAP_S_TO_S).
-Whether the lookup replacement of the index is done or not,
-the integer part of the index is then ANDed with $2 sup b -1$,
-where $b$ is the number of bits in the stencil buffer.
-The resulting stencil indices are then written to the stencil buffer
-such that the $n$th index is written to location
-.P
-.RS
-.ce
-$x sub n ~=~ x sub r ~+~ n ~ roman mod ~ _eqnparam1$
-.sp
-.ce
-$y sub n ~=~ y sub r ~+~ \(lf ~ n / _eqnparam1 ~ \(rf$
-.fi
-.sp
-.RE
-.IP
-where ($x sub r , y sub r$) is the current raster position.
-Only the pixel ownership test,
-the scissor test,
-and the stencil writemask affect these write operations.
-.TP
-_const(DEPTH_COMPONENT)
-Each pixel is a single-depth component.
-Floating-point data is converted directly to an internal floating-point
-format with unspecified precision.
-Signed integer data is mapped linearly to the internal floating-point
-format such that the most positive representable integer value maps to 1.0,
-and the most negative representable value maps to \-1.0.
-Unsigned integer data is mapped similarly:
-the largest integer value maps to 1.0,
-and 0 maps to 0.0.
-The resulting floating-point depth value is then multiplied
-by _const(DEPTH_SCALE) and added to _const(DEPTH_BIAS).
-The result is clamped to the range [0,1].
-.IP
-The GL then converts the resulting depth components to fragments
-by attaching the current raster position color or color index and
-texture coordinates to each pixel,
-then assigning $x$ and $y$ window coordinates to the $n$th fragment such that
-.P
-.RS
-.ce
-$x sub n ~=~ x sub r ~+~ n ~ roman mod ~ _eqnparam1$
-.sp
-.ce
-$y sub n ~=~ y sub r ~+~ \(lf ~ n / _eqnparam1 ~ \(rf$
-.ce 0
-.sp
-.RE
-.IP
-where ($x sub r , y sub r$) is the current raster position.
-These pixel fragments are then treated just like the fragments generated by
-rasterizing points, lines, or polygons.
-Texture mapping,
-fog,
-and all the fragment operations are applied before the fragments are written
-to the frame buffer.
-.TP
-_const(RGBA)
-.TP
-_const(BGRA)
-_C_ .TP
-_C_ const(ABGR_EXT)
-Each pixel is a four-component group: for _const(RGBA), the red
-component is first, followed by green, followed by blue, followed by
-alpha; for _const(BGRA) the order is blue, green, red and then alpha.
-_C_; for _const(ABGR_EXT) the order is alpha, blue, green, and then red.
-Floating-point values are converted directly to an internal floating-point
-format with unspecified precision.
-Signed integer values are mapped linearly to the internal floating-point
-format such that the most positive representable integer value maps to 1.0,
-and the most negative representable value maps to \-1.0. (Note that
-this mapping does not convert 0 precisely to 0.0.)
-Unsigned integer data is mapped similarly:
-the largest integer value maps to 1.0,
-and 0 maps to 0.0.
-The resulting floating-point color values are then multiplied
-by _const(c_SCALE) and added to _const(c_BIAS),
-where \f2c\fP is RED, GREEN, BLUE, and ALPHA
-for the respective color components.
-The results are clamped to the range [0,1].
-.IP
-If _const(MAP_COLOR) is true,
-each color component is scaled by the size of lookup table
-_const(PIXEL_MAP_c_TO_c),
-then replaced by the value that it references in that table.
-\f2c\fP is R, G, B, or A respectively.
-.BP
-.IP
-The GL then converts the resulting RGBA colors to fragments
-by attaching the current raster position \f2z\fP coordinate and
-texture coordinates to each pixel,
-then assigning $x$ and $y$ window coordinates to the $n$th fragment such that
-.P
-.RS
-.ce
-$x sub n ~=~ x sub r ~+~ n ~ roman mod ~ _eqnparam1$
-.sp
-.ce
-$y sub n ~=~ y sub r ~+~ \(lf ~ n / _eqnparam1 ~ \(rf$
-.ce 0
-.sp
-.RE
-.IP
-where ($x sub r , y sub r$) is the current raster position.
-These pixel fragments are then treated just like the fragments generated by
-rasterizing points, lines, or polygons.
-Texture mapping,
-fog,
-and all the fragment operations are applied before the fragments are written
-to the frame buffer.
-.TP
-_const(RED)
-Each pixel is a single red component.
-This component is converted to the internal floating-point format in
-the same way the red component of an RGBA pixel is. It is
-then converted to an RGBA pixel with green and blue set to 0,
-and alpha set to 1.
-After this conversion, the pixel is treated as if it had been read
-as an RGBA pixel.
-.TP
-_const(GREEN)
-Each pixel is a single green component.
-This component is converted to the internal floating-point format in
-the same way the green component of an RGBA pixel is.
-It is then converted to an RGBA pixel with red and blue set to 0,
-and alpha set to 1.
-After this conversion, the pixel is treated as if it had been read
-as an RGBA pixel.
-.TP
-_const(BLUE)
-Each pixel is a single blue component.
-This component is converted to the internal floating-point format in
-the same way the blue component of an RGBA pixel is.
-It is then converted to an RGBA pixel with red and green set to 0,
-and alpha set to 1.
-After this conversion, the pixel is treated as if it had been read
-as an RGBA pixel.
-.TP
-_const(ALPHA)
-Each pixel is a single alpha component.
-This component is converted to the internal floating-point format in
-the same way the alpha component of an RGBA pixel is.
-It is then converted to an RGBA pixel with red, green, and blue set to 0.
-After this conversion, the pixel is treated as if it had been read
-as an RGBA pixel.
-.BP
-.TP
-_const(RGB)
-.TP
-_const(BGR)
-Each pixel is a three-component group:
-red first, followed by green, followed by blue; for _const(BGR), the
-first component is blue, followed by green and then red.
-Each component is converted to the internal floating-point format in
-the same way the red, green, and blue components of an RGBA pixel are.
-The color triple is converted to an RGBA pixel with alpha set to 1.
-After this conversion, the pixel is treated as if it had been read
-as an RGBA pixel.
-.TP
-_const(LUMINANCE)
-Each pixel is a single luminance component.
-This component is converted to the internal floating-point format in
-the same way the red component of an RGBA pixel is.
-It is then converted to an RGBA pixel with red, green, and blue set to the
-converted luminance value,
-and alpha set to 1.
-After this conversion, the pixel is treated as if it had been read
-as an RGBA pixel.
-.TP
-_const(LUMINANCE_ALPHA)
-Each pixel is a two-component group:
-luminance first, followed by alpha.
-The two components are converted to the internal floating-point format in
-the same way the red component of an RGBA pixel is.
-They are then converted to an RGBA pixel with red, green, and blue set to the
-converted luminance value,
-and alpha set to the converted alpha value.
-After this conversion, the pixel is treated as if it had been read
-as an RGBA pixel.
-.P
-The following table summarizes the meaning of the valid constants for the
-\f2type\fP parameter:
-.sp 2
-.TS
-center;
-lb lb
-l l.
-_
-Type Corresponding Type
-_
-_const(UNSIGNED_BYTE) unsigned 8-bit integer
-_const(BYTE) signed 8-bit integer
-_const(BITMAP) single bits in unsigned 8-bit integers
-_const(UNSIGNED_SHORT) unsigned 16-bit integer
-_const(SHORT) signed 16-bit integer
-_const(UNSIGNED_INT) unsigned 32-bit integer
-_const(INT) 32-bit integer
-_const(FLOAT) single-precision floating-point
-_const(UNSIGNED_BYTE_3_3_2) unsigned 8-bit integer
-_const(UNSIGNED_BYTE_2_3_3_REV) unsigned 8-bit integer with reversed component ordering
-_const(UNSIGNED_SHORT_5_6_5) unsigned 16-bit integer
-_const(UNSIGNED_SHORT_5_6_5_REV) unsigned 16-bit integer with reversed component ordering
-_const(UNSIGNED_SHORT_4_4_4_4) unsigned 16-bit integer
-_const(UNSIGNED_SHORT_4_4_4_4_REV) unsigned 16-bit integer with reversed component ordering
-_const(UNSIGNED_SHORT_5_5_5_1) unsigned 16-bit integer
-_const(UNSIGNED_SHORT_1_5_5_5_REV) unsigned 16-bit integer with reversed component ordering
-_const(UNSIGNED_INT_8_8_8_8) unsigned 32-bit integer
-_const(UNSIGNED_INT_8_8_8_8_REV) unsigned 32-bit integer with reversed component ordering
-_const(UNSIGNED_INT_10_10_10_2) unsigned 32-bit integer
-_const(UNSIGNED_INT_2_10_10_10_REV) unsigned 32-bit integer with reversed component ordering
-_
-.TE
-.sp
-.BP
-.P
-The rasterization described so far assumes pixel zoom factors of 1.
-If
-.br
-_cmnd(PixelZoom) is used to change the $x$ and $y$ pixel zoom factors,
-pixels are converted to fragments as follows.
-If ($x sub r$, $y sub r$) is the current raster position,
-and a given pixel is in the $n$th column and $m$th row
-of the pixel rectangle,
-then fragments are generated for pixels whose centers are in the rectangle
-with corners at
-.sp
-.RS
-.ce
-($x sub r ~+~ zoom sub x^ n$, $y sub r ~+~ zoom sub y^ m$)
-.sp
-.ce
-($x sub r ~+~ zoom sub x^ (n ~+~ 1)$, $y sub r ~+~ zoom sub y^ ( m ~+~ 1 )$)
-.ce 0
-.sp
-.RE
-.P
-where $zoom sub x$ is the value of _const(ZOOM_X) and
-$zoom sub y$ is the value of _const(ZOOM_Y).
-.SH NOTES
-_const(BGR) and _const(BGRA) are only valid for _param3 if the GL
-version is 1.2 or greater.
-.P
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV) are only valid for _param4 if the
-GL version is 1.2 or greater.
-.SH ERRORS
-_const(INVALID_VALUE) is generated if either _param1 or _param2 is negative.
-.P
-_const(INVALID_ENUM) is generated if _param3 or _param4 is not one of
-the accepted values.
-.P
-_const(INVALID_OPERATION) is generated if _param3 is
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(RGBA),
-_const(BGR),
-_const(BGRA),
-_C_ _const(ABGR_EXT),
-_const(LUMINANCE),
-or
-_const(LUMINANCE_ALPHA),
-and the GL is in color index mode.
-.P
-_const(INVALID_ENUM) is generated if _param4 is _const(BITMAP) and
-_param3 is not either _const(COLOR_INDEX) or _const(STENCIL_INDEX).
-.P
-_const(INVALID_OPERATION) is generated if _param3 is _const(STENCIL_INDEX)
-and there is no stencil buffer.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.P
-_const(INVALID_OPERATION) is generated if _param3 is one
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5), of
-_const(UNSIGNED_SHORT_5_6_5_REV)
-and _param3 is not _const(RGB).
-.P
-_const(INVALID_OPERATION) is generated if _param3 is one of
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV)
-and _param3 is neither _const(RGBA) nor _const(BGRA).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(CURRENT_RASTER_POSITION)
-.br
-_cmnd(Get) with argument _const(CURRENT_RASTER_POSITION_VALID)
-.SH SEE ALSO
-_cmnd(AlphaFunc),
-_cmnd(BlendFunc),
-_cmnd(CopyPixels),
-_cmnd(DepthFunc),
-_cmnd(LogicOp),
-_cmnd(PixelMap),
-_cmnd(PixelStore),
-_cmnd(PixelTransfer),
-_cmnd(PixelZoom),
-_cmnd(RasterPos),
-_cmnd(ReadPixels),
-_cmnd(Scissor),
-_cmnd(StencilFunc)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/drawrangeelements.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/drawrangeelements.gl
deleted file mode 100755
index 054bc9b76..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/drawrangeelements.gl
+++ /dev/null
@@ -1,145 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_C_ A real line follows.
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_C_ Use GL not OpenGL
-_C_ Don't change the ordering of the main headers.
-_C_ C specification (or fortran) is handled automatically
-_C_ .TH is automatically added to the top of this file.
-_C_ Below, use current tense, active do not capitalize the first word and dont
-_C_ use a period.
-_header(DrawRangeElements, render primitives from array data)
-_names(DrawRangeElements)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies what kind of primitives to render.
-Symbolic constants
-_const(POINTS),
-_const(LINE_STRIP),
-_const(LINE_LOOP),
-_const(LINES),
-_const(TRIANGLE_STRIP),
-_const(TRIANGLE_FAN),
-_const(TRIANGLES),
-_const(QUAD_STRIP),
-_const(QUADS),
-and _const(POLYGON) are accepted.
-_phead(_param2)
-Specifies the minimum array index contained in _param6(1).
-_phead(_param3)
-Specifies the maximum array index contained in _param6(1).
-_phead(_param4)
-Specifies the number of elements to be rendered.
-_phead(_param5)
-Specifies the type of the values in _param4. Must be one of
-_const(UNSIGNED_BYTE), _const(UNSIGNED_SHORT), or
-_const(UNSIGNED_INT).
-_phead(_param6)
-Specifies a pointer to the location where the indices are stored.
-.SH DESCRIPTION
-_cmnd is a restricted form of _cmnd(DrawElements). _param1, _param2, _param3,
-and _param4 match the corresponding arguments to _cmnd(DrawElements), with
-the additional constraint that all values in the arrays _param4 must lie
-between _param2 and _param3, inclusive.
-.P
-Implementations denote recommended maximum amounts of vertex and
-.br
-index data,
-which may be queried by calling _cmnd(Get) with argument
-_const(MAX_ELEMENTS_VERTICES) and _const(MAX_ELEMENTS_INDICES).
-If $_eqnparam3 ~-~ _eqnparam2 ~+~ 1$ is greater than the value of
-_const(MAX_ELEMENTS_VERTICES), or if _param4 is greater than the value of
-_const(MAX_ELEMENTS_INDICES), then the call may operate at reduced
-performance. There is no requirement that all vertices in the range
-[_param2,\ _param3] be referenced. However, the implementation may
-partially process unused vertices, reducing performance from what could
-be achieved with an optimal index set.
-.P
-When _cmnd is called, it uses _param2 sequential elements from an
-enabled array, starting at _param4 to construct a sequence of
-geometric primitives. _param1 specifies what kind of primitives are
-constructed, and how the array elements construct these primitives. If
-more than one array is enabled, each is used. If
-_const(VERTEX_ARRAY) is not enabled, no geometric primitives are
-constructed.
-.P
-Vertex attributes that are modified by _cmnd have an
-unspecified value after _cmnd returns. For example, if
-_const(COLOR_ARRAY) is enabled, the value of the current color is
-undefined after _cmnd executes. Attributes that aren't
-modified maintain their previous values.
-.SH NOTES
-_cmnd is available only if the GL version is 1.2 or greater.
-.P
-_cmnd is included in display lists. If _cmnd is entered into a
-display list,
-the necessary array data (determined by the array pointers and
-enables) is also
-entered into the display list. Because the array pointers and
-enables are client-side state, their values affect display lists
-when the lists are created, not when the lists are executed.
-.SH ERRORS
-It is an error for indices to lie outside the range [_param2,\ _param3],
-but implementations may not check for this situation. Such indices
-cause implementation-dependent behavior.
-.P
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_VALUE) is generated if _param4 is negative.
-.P
-_const(INVALID_VALUE) is generated if _param3 $<$ _param2.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed between
-the execution of _cmnd(Begin) and the corresponding _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(MAX_ELEMENTS_VERTICES)
-.P
-_cmnd(Get) with argument _const(MAX_ELEMENTS_INDICES)
-.SH SEE ALSO
-_cmnd(ArrayElement),
-_cmnd(ColorPointer),
-_cmnd(DrawArrays),
-_cmnd(DrawElements),
-_cmnd(EdgeFlagPointer),
-_cmnd(GetPointerv),
-_cmnd(IndexPointer),
-_cmnd(InterleavedArrays),
-_cmnd(NormalPointer),
-_cmnd(TexCoordPointer),
-_cmnd(VertexPointer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/edgeflag.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/edgeflag.gl
deleted file mode 100755
index 91c8ed4e1..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/edgeflag.gl
+++ /dev/null
@@ -1,76 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(EdgeFlag,flag edges as either boundary or nonboundary)
-_names(EdgeFlag)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the current edge flag value,
-either _const(TRUE) or _const(FALSE). The initial value is _const(TRUE).
-_names(EdgeFlagv)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a pointer to an array that contains a single boolean element,
-which replaces the current edge flag value.
-.SH DESCRIPTION
-Each vertex of a polygon,
-separate triangle,
-or separate quadrilateral specified between a _cmnd(Begin)/_cmnd(End) pair
-is marked as the start of either a boundary or nonboundary edge.
-If the current edge flag is true when the vertex is specified,
-the vertex is marked as the start of a boundary edge.
-Otherwise, the vertex is marked as the start of a nonboundary edge.
-_cmnd sets the edge flag bit to _const(TRUE) if _param1 is _const(TRUE),
-and to _const(FALSE) otherwise.
-.P
-The vertices of connected triangles and connected quadrilaterals are always
-marked as boundary,
-regardless of the value of the edge flag.
-.P
-Boundary and nonboundary edge flags on vertices are significant only if
-_const(POLYGON_MODE) is set to _const(POINT) or _const(LINE).
-See _cmnd(PolygonMode).
-.SH NOTES
-The current edge flag can be updated at any time.
-In particular,
-_cmnd can be called between a call to _cmnd(Begin) and the corresponding
-call to _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(EDGE_FLAG)
-.SH SEE ALSO
-_cmnd(Begin),
-_cmnd(EdgeFlagPointer),
-_cmnd(PolygonMode)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/edgeflagpointer.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/edgeflagpointer.gl
deleted file mode 100755
index 33ee881d0..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/edgeflagpointer.gl
+++ /dev/null
@@ -1,122 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ Anything on a line after _C_ is ignored
-_C_ A real line follows.
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_C_ Use GL not OpenGL
-_C_ Don't change the ordering of the main headers.
-_C_ C specification (or fortran) is handled automatically
-_C_ .TH is automatically added to the top of this file.
-_C_ Below, use current tense, active do not capitalize the first word and dont
-_C_ use a period.
-_C_ the function name must appear in (APIFILE) (usually gl.h) as set in
-_C_ Makefile.
-_header(EdgeFlagPointer,define an array of edge flags)
-_names(EdgeFlagPointer)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the byte offset between consecutive edge flags.
-If _param1 is 0 (the initial value), the edge flags are understood
-to be tightly packed in the array. The initial value is 0.
-_phead(_param2)
-Specifies a pointer to the first edge flag in the array. The initial
-value is zero.
-.SH DESCRIPTION
-_cmnd specifies the location and data format of an array of boolean edge
-flags to use when rendering. _param1 specifies the byte stride from one
-edge flag to the next allowing vertices and attributes
-to be packed into a single array or stored in separate arrays.
-(Single-array storage may be more efficient on some implementations;
-see _cmnd(InterleavedArrays).)
-.P
-When an edge flag array is
-specified, _param1 and _param2 are saved as client-side
-state.
-.P
-To enable and disable the edge flag array, call _cmnd(EnableClientState) and
-.br
-_cmnd(DisableClientState) with
-the argument _const(EDGE_FLAG_ARRAY). If enabled, the edge flag array is used
-when _cmnd(DrawArrays), _cmnd(DrawElements), or _cmnd(ArrayElement) is called.
-.P
-Use _cmnd(DrawArrays) to construct a sequence of primitives (all of
-the same type)
-from prespecified vertex and vertex attribute arrays.
-Use _cmnd(ArrayElement) to specify primitives
-by indexing vertices and vertex attributes and _cmnd(DrawElements) to
-construct a sequence of primitives by indexing vertices and vertex attributes.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-The edge flag array is initially disabled and it won't be accessed when
-.br
-_cmnd(ArrayElement), _cmnd(DrawElements) or _cmnd(DrawArrays) is called.
-.P
-Execution of _cmnd is not allowed between the execution of
-_cmnd(Begin) and the corresponding execution of _cmnd(End),
-but an error may or may not be generated. If no error is generated,
-the operation is undefined.
-.P
-_cmnd is typically implemented on the client side.
-.P
-Edge flag array parameters are client-side state and are therefore
-not saved or restored by _cmnd(PushAttrib) and _cmnd(PopAttrib).
-Use _cmnd(PushClientAttrib) and
-.br
-_cmnd(PopClientAttrib) instead.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is negative.
-.SH ASSOCIATED GETS
-_cmnd(IsEnabled) with argument _const(EDGE_FLAG_ARRAY)
-.br
-_cmnd(Get) with argument _const(EDGE_FLAG_ARRAY_STRIDE)
-.br
-_cmnd(GetPointerv) with argument _const(EDGE_FLAG_ARRAY_POINTER)
-.SH SEE ALSO
-_cmnd(ArrayElement),
-_cmnd(ColorPointer),
-_cmnd(DrawArrays),
-_cmnd(DrawElements),
-_cmnd(Enable),
-_cmnd(GetPointerv),
-_cmnd(IndexPointer),
-_cmnd(NormalPointer),
-_cmnd(PopClientAttrib),
-.br
-_cmnd(PushClientAttrib),
-_cmnd(TexCoordPointer),
-_cmnd(VertexPointer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/enable.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/enable.gl
deleted file mode 100755
index 763d92ab1..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/enable.gl
+++ /dev/null
@@ -1,516 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn|tbl)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Enable, enable or disable server-side GL capabilities)
-_names(Enable)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a symbolic constant indicating a GL capability.
-_names(Disable)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a symbolic constant indicating a GL capability.
-.SH DESCRIPTION
-_cmnd and _cmnd(Disable) enable and disable various capabilities.
-Use _cmnd(IsEnabled) or _cmnd(Get) to determine the current setting
-of any capability. The initial value for each capability with the
-exception of _const(DITHER) is _const(FALSE). The initial value for
-_const(DITHER) is _const(TRUE).
-.P
-Both _cmnd(Enable) and _cmnd(Disable) take a single argument, _param1,
-which can assume one of the following values:
-.TP 25
-_const(ALPHA_TEST)
-If enabled,
-do alpha testing. See
-_cmnd(AlphaFunc).
-.TP
-_const(AUTO_NORMAL)
-If enabled,
-generate normal vectors when either
-_const(MAP2_VERTEX_3) or
-_const(MAP2_VERTEX_4) is used to generate vertices.
-See _cmnd(Map2).
-.TP
-_const(BLEND)
-If enabled,
-blend the incoming RGBA color values with the values in the color
-buffers. See _cmnd(BlendFunc).
-.TP
-_const(CLIP_PLANE)\f2i\fP
-If enabled,
-clip geometry against user-defined clipping plane \f2i\fP.
-See _cmnd(ClipPlane).
-.TP
-_const(COLOR_LOGIC_OP)
-If enabled,
-apply the currently selected logical operation to the incoming RGBA
-color and color buffer values. See _cmnd(LogicOp).
-.TP
-_const(COLOR_MATERIAL)
-If enabled,
-have one or more material parameters track the current color.
-See _cmnd(ColorMaterial).
-.TP
-_const(COLOR_TABLE)
-If enabled,
-preform a color table lookup on the incoming RGBA color values.
-See _cmnd(ColorTable).
-.TP
-_const(CONVOLUTION_1D)
-If enabled,
-perform a 1D convolution operation on incoming RGBA color values.
-See _cmnd(ConvolutionFilter1D).
-.TP
-_const(CONVOLUTION_2D)
-If enabled,
-perform a 2D convolution operation on incoming RGBA color values.
-See _cmnd(ConvolutionFilter2D).
-.TP
-_const(CULL_FACE)
-If enabled,
-cull polygons based on their winding in window coordinates.
-See _cmnd(CullFace).
-.TP
-_const(DEPTH_TEST)
-If enabled,
-do depth comparisons and update the depth buffer. Note that even if
-the depth buffer exists and the depth mask is non-zero, the
-depth buffer is not updated if the depth test is disabled. See
-_cmnd(DepthFunc) and
-.br
-_cmnd(DepthRange).
-.TP
-_const(DITHER)
-If enabled,
-dither color components or indices before they are written to the
-color buffer.
-.TP
-_const(FOG)
-If enabled,
-blend a fog color into the posttexturing color.
-See _cmnd(Fog).
-.TP
-_const(HISTOGRAM)
-If enabled,
-histogram incoming RGBA color values.
-See _cmnd(Histogram).
-.TP
-_const(INDEX_LOGIC_OP)
-If enabled,
-apply the currently selected logical operation to the incoming index and color
-buffer indices. See
-.br
-_cmnd(LogicOp).
-.TP
-_const(LIGHT)\f2i\fP
-If enabled,
-include light \f2i\fP in the evaluation of the lighting
-equation. See _cmnd(LightModel) and _cmnd(Light).
-.TP
-_const(LIGHTING)
-If enabled,
-use the current lighting parameters to compute the vertex color or index.
-Otherwise, simply associate the current color or index with each
-vertex. See
-.br
-_cmnd(Material), _cmnd(LightModel), and _cmnd(Light).
-.TP
-_const(LINE_SMOOTH)
-If enabled,
-draw lines with correct filtering.
-Otherwise,
-draw aliased lines.
-See _cmnd(LineWidth).
-.TP
-_const(LINE_STIPPLE)
-If enabled,
-use the current line stipple pattern when drawing lines. See
-_cmnd(LineStipple).
-.TP
-_const(MAP1_COLOR_4)
-If enabled,
-calls to
-_cmnd(EvalCoord1),
-_cmnd(EvalMesh1), and
-_cmnd(EvalPoint1) generate RGBA values.
-See _cmnd(Map1).
-.TP
-_const(MAP1_INDEX)
-If enabled,
-calls to
-_cmnd(EvalCoord1),
-_cmnd(EvalMesh1), and
-_cmnd(EvalPoint1) generate color indices.
-See _cmnd(Map1).
-.TP
-_const(MAP1_NORMAL)
-If enabled,
-calls to
-_cmnd(EvalCoord1),
-_cmnd(EvalMesh1), and
-_cmnd(EvalPoint1) generate normals.
-See _cmnd(Map1).
-.TP
-_const(MAP1_TEXTURE_COORD_1)
-If enabled,
-calls to
-_cmnd(EvalCoord1),
-_cmnd(EvalMesh1), and
-_cmnd(EvalPoint1) generate
-\f2s\fP
-texture coordinates.
-See _cmnd(Map1).
-.TP
-_const(MAP1_TEXTURE_COORD_2)
-If enabled,
-calls to
-_cmnd(EvalCoord1),
-_cmnd(EvalMesh1), and
-_cmnd(EvalPoint1) generate
-\f2s\fP and
-\f2t\fP texture coordinates.
-See _cmnd(Map1).
-.TP
-_const(MAP1_TEXTURE_COORD_3)
-If enabled,
-calls to
-_cmnd(EvalCoord1),
-_cmnd(EvalMesh1), and
-_cmnd(EvalPoint1) generate
-\f2s\fP,
-\f2t\fP, and
-\f2r\fP texture coordinates.
-See _cmnd(Map1).
-.TP
-_const(MAP1_TEXTURE_COORD_4)
-If enabled,
-calls to
-_cmnd(EvalCoord1),
-_cmnd(EvalMesh1), and
-_cmnd(EvalPoint1) generate
-\f2s\fP,
-\f2t\fP,
-\f2r\fP, and
-\f2q\fP texture coordinates.
-See _cmnd(Map1).
-.TP
-_const(MAP1_VERTEX_3)
-If enabled,
-calls to
-_cmnd(EvalCoord1),
-_cmnd(EvalMesh1), and
-_cmnd(EvalPoint1) generate
-\f2x\fP, \f2y\fP, and \f2z\fP vertex coordinates.
-See _cmnd(Map1).
-.TP
-_const(MAP1_VERTEX_4)
-If enabled,
-calls to
-_cmnd(EvalCoord1),
-_cmnd(EvalMesh1), and
-_cmnd(EvalPoint1) generate
-homogeneous
-\f2x\fP,
-\f2y\fP,
-\f2z\fP, and
-\f2w\fP vertex coordinates.
-See _cmnd(Map1).
-.TP
-_const(MAP2_COLOR_4)
-If enabled,
-calls to
-_cmnd(EvalCoord2),
-_cmnd(EvalMesh2), and
-_cmnd(EvalPoint2) generate RGBA values.
-See _cmnd(Map2).
-.TP
-_const(MAP2_INDEX)
-If enabled,
-calls to
-_cmnd(EvalCoord2),
-_cmnd(EvalMesh2), and
-_cmnd(EvalPoint2) generate color indices.
-See _cmnd(Map2).
-.TP
-_const(MAP2_NORMAL)
-If enabled,
-calls to
-_cmnd(EvalCoord2),
-_cmnd(EvalMesh2), and
-_cmnd(EvalPoint2) generate normals.
-See _cmnd(Map2).
-.TP
-_const(MAP2_TEXTURE_COORD_1)
-If enabled,
-calls to
-_cmnd(EvalCoord2),
-_cmnd(EvalMesh2), and
-_cmnd(EvalPoint2) generate
-\f2s\fP
-texture coordinates.
-See _cmnd(Map2).
-.TP
-_const(MAP2_TEXTURE_COORD_2)
-If enabled,
-calls to
-_cmnd(EvalCoord2),
-_cmnd(EvalMesh2), and
-_cmnd(EvalPoint2) generate
-\f2s\fP and
-\f2t\fP texture coordinates.
-See _cmnd(Map2).
-.TP
-_const(MAP2_TEXTURE_COORD_3)
-If enabled,
-calls to
-_cmnd(EvalCoord2),
-_cmnd(EvalMesh2), and
-_cmnd(EvalPoint2) generate
-\f2s\fP,
-\f2t\fP, and
-\f2r\fP texture coordinates.
-See _cmnd(Map2).
-.TP
-_const(MAP2_TEXTURE_COORD_4)
-If enabled,
-calls to
-_cmnd(EvalCoord2),
-_cmnd(EvalMesh2), and
-_cmnd(EvalPoint2) generate
-\f2s\fP,
-\f2t\fP,
-\f2r\fP, and
-\f2q\fP texture coordinates.
-See _cmnd(Map2).
-.TP
-_const(MAP2_VERTEX_3)
-If enabled,
-calls to
-_cmnd(EvalCoord2),
-_cmnd(EvalMesh2), and
-_cmnd(EvalPoint2) generate
-\f2x\fP, \f2y\fP, and \f2z\fP vertex coordinates.
-See _cmnd(Map2).
-.TP
-_const(MAP2_VERTEX_4)
-If enabled,
-calls to
-_cmnd(EvalCoord2),
-_cmnd(EvalMesh2), and
-_cmnd(EvalPoint2) generate
-homogeneous
-\f2x\fP,
-\f2y\fP,
-\f2z\fP, and
-\f2w\fP vertex coordinates.
-See _cmnd(Map2).
-.TP
-_const(MINMAX)
-If enabled,
-compute the minimum and maximum values of incoming RGBA color values.
-See _cmnd(Minmax).
-.TP
-_const(NORMALIZE)
-If enabled,
-normal vectors specified with _cmnd(Normal) are scaled to unit length
-after transformation. See _cmnd(Normal).
-.TP
-_const(POINT_SMOOTH)
-If enabled,
-draw points with proper filtering.
-Otherwise,
-draw aliased points.
-See _cmnd(PointSize).
-.TP
-_const(POLYGON_OFFSET_FILL)
-If enabled, and if the polygon is rendered in
-_const(FILL) mode, an offset is added to depth values of a polygon's
-fragments before the depth comparison is performed.
-See _cmnd(PolygonOffset).
-.TP
-_const(POLYGON_OFFSET_LINE)
-If enabled, and if the polygon is rendered in
-_const(LINE) mode, an offset is added to depth values of a polygon's
-fragments before the depth comparison is performed. See _cmnd(PolygonOffset).
-.TP
-_const(POLYGON_OFFSET_POINT)
-If enabled, an offset is added to depth values of a polygon's fragments
-before the depth comparison is performed, if the polygon is rendered in
-_const(POINT) mode. See _cmnd(PolygonOffset).
-.TP
-_const(POLYGON_SMOOTH)
-If enabled, draw polygons with proper filtering.
-Otherwise, draw aliased polygons. For correct anti-aliased polygons,
-an alpha buffer is needed and the polygons must be sorted front to
-back.
-.TP
-_const(POLYGON_STIPPLE)
-If enabled,
-use the current polygon stipple pattern when rendering
-polygons. See _cmnd(PolygonStipple).
-.TP
-_const(POST_COLOR_MATRIX_COLOR_TABLE)
-If enabled,
-preform a color table lookup on RGBA color values after color matrix
-transformation.
-See _cmnd(ColorTable).
-.TP
-_const(POST_CONVOLUTION_COLOR_TABLE)
-If enabled,
-preform a color table lookup on RGBA color values after convolution.
-See _cmnd(ColorTable).
-.TP
-_const(RESCALE_NORMAL)
-If enabled, normal vectors specified with _cmnd(Normal) are scaled to
-unit length after transformation. See _cmnd(Normal).
-.TP
-_const(SEPARABLE_2D)
-If enabled, perform a two-dimensional convolution operation using a separable
-convolution filter on incoming RGBA color values.
-See _cmnd(SeparableFilter2D).
-.TP
-_const(SCISSOR_TEST)
-If enabled,
-discard fragments that are outside the scissor rectangle.
-See _cmnd(Scissor).
-.TP
-_const(STENCIL_TEST)
-If enabled,
-do stencil testing and update the stencil buffer.
-See _cmnd(StencilFunc) and _cmnd(StencilOp).
-.TP
-_const(TEXTURE_1D)
-If enabled, one-dimensional texturing is performed
-(unless two- or three-dimensional texturing is also enabled).
-See _cmnd(TexImage1D).
-.TP
-_const(TEXTURE_2D)
-If enabled, two-dimensional texturing is performed
-(unless three-dimensional texturing is also enabled). See _cmnd(TexImage2D).
-.TP
-_const(TEXTURE_3D)
-If enabled, three-dimensional texturing is performed. See _cmnd(TexImage3D).
-.TP
-_const(TEXTURE_GEN_Q)
-If enabled,
-the \f2q\fP texture coordinate is computed using
-the texture generation function defined with _cmnd(TexGen).
-Otherwise, the current \f2q\fP texture coordinate is used.
-See _cmnd(TexGen).
-.TP
-_const(TEXTURE_GEN_R)
-If enabled,
-the \f2r\fP texture coordinate is computed using
-the texture generation function defined with _cmnd(TexGen).
-Otherwise, the current \f2r\fP texture coordinate is used.
-See _cmnd(TexGen).
-.TP
-_const(TEXTURE_GEN_S)
-If enabled,
-the \f2s\fP texture coordinate is computed using
-the texture generation function defined with _cmnd(TexGen).
-Otherwise, the current \f2s\fP texture coordinate is used.
-See _cmnd(TexGen).
-.TP
-_const(TEXTURE_GEN_T)
-If enabled,
-the \f2t\fP texture coordinate is computed using
-the texture generation function defined with _cmnd(TexGen).
-Otherwise, the current \f2t\fP texture coordinate is used.
-See _cmnd(TexGen).
-.SH NOTES
-_const(POLYGON_OFFSET_FILL), _const(POLYGON_OFFSET_LINE),
-_const(POLYGON_OFFSET_POINT),
-_const(COLOR_LOGIC_OP), and _const(INDEX_LOGIC_OP) are available
-only if the GL version is 1.1 or greater.
-.P
-_const(RESCALE_NORMAL), and _const(TEXTURE_3D) are available only if the
-GL version is 1.2 or greater.
-.P
-_const(COLOR_TABLE), _const(CONVOLUTION_1D), _const(CONVOLUTION_2D),
-_const(HISTOGRAM), _const(MINMAX),
-_const(POST_COLOR_MATRIX_COLOR_TABLE),
-_const(POST_CONVOLUTION_COLOR_TABLE), and
-_const(SEPARABLE_2D) are available only if _arbstring(imaging) is returned
-from _cmnd(Get) with an argument of _const(EXTENSIONS).
-.P
-If _arbstring(multitexture) is supported, _const(TEXTURE_1D),
-_const(TEXTURE_2D), _const(TEXTURE_3D), _const(TEXTURE_GEN_S),
-_const(TEXTURE_GEN_T), _const(TEXTURE_GEN_R), and _const(TEXTURE_GEN_Q)
-enable or disable the respective state for the active texture unit
-specified with _cmnd(ActiveTextureARB).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not one of the values
-listed previously.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd(Enable) or _cmnd(Disable)
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(ActiveTextureARB),
-_cmnd(AlphaFunc),
-_cmnd(BlendFunc),
-_cmnd(ClipPlane),
-_cmnd(ColorMaterial),
-_cmnd(CullFace),
-_cmnd(DepthFunc),
-_cmnd(DepthRange),
-_cmnd(EnableClientState),
-_cmnd(Fog),
-_cmnd(Get),
-_cmnd(IsEnabled),
-_cmnd(Light),
-_cmnd(LightModel),
-_cmnd(LineWidth),
-_cmnd(LineStipple),
-_cmnd(LogicOp),
-_cmnd(Map1),
-_cmnd(Map2),
-_cmnd(Material),
-_cmnd(Normal),
-_cmnd(PointSize),
-_cmnd(PolygonMode),
-_cmnd(PolygonOffset),
-_cmnd(PolygonStipple),
-_cmnd(Scissor),
-_cmnd(StencilFunc),
-_cmnd(StencilOp),
-_cmnd(TexGen),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/enableclientstate.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/enableclientstate.gl
deleted file mode 100755
index a710edbea..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/enableclientstate.gl
+++ /dev/null
@@ -1,134 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_C_ A real line follows.
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_C_ Use GL not OpenGL
-_C_ Don't change the ordering of the main headers.
-_C_ C specification (or fortran) is handled automatically
-_C_ .TH is automatically added to the top of this file.
-_C_ Below, use current tense, active do not capitalize the first word and dont
-_C_ use a period.
-_header(EnableClientState, enable or disable client-side capability)
-_names(EnableClientState)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the capability to enable.
-Symbolic constants
-_const(COLOR_ARRAY),
-_const(EDGE_FLAG_ARRAY),
-_const(INDEX_ARRAY),
-_const(NORMAL_ARRAY),
-_const(TEXTURE_COORD_ARRAY), and
-_const(VERTEX_ARRAY)
-are accepted.
-_names(DisableClientState)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the capability to disable.
-.SH DESCRIPTION
-_cmnd and _cmnd(DisableClientState)
-enable or disable individual client-side capabilities. By default, all
-client-side capabilities are disabled.
-Both
-_cmnd(EnableClientState) and _cmnd(DisableClientState) take a
-single argument, _param1, which can assume one of the following
-values:
-.TP 25
-_const(COLOR_ARRAY)
-If enabled, the color array is enabled for writing and used during
-rendering when _cmnd(ArrayElement), _cmnd(DrawArrays),
-_cmnd(DrawElement), or _cmnd(DrawRangeElements) is called. See
-_cmnd(ColorPointer).
-.TP
-_const(EDGE_FLAG_ARRAY)
-If enabled, the edge flag array is enabled for writing and used during
-rendering when _cmnd(ArrayElement), _cmnd(DrawArrays),
-_cmnd(DrawElement), or _cmnd(DrawRangeElements) is called. See
-_cmnd(EdgeFlagPointer).
-.TP
-_const(INDEX_ARRAY)
-If enabled, the index array is enabled for writing and used during
-rendering when _cmnd(ArrayElement), _cmnd(DrawArrays),
-_cmnd(DrawElement), or _cmnd(DrawRangeElements) is called. See
-_cmnd(IndexPointer).
-.TP
-_const(NORMAL_ARRAY)
-If enabled, the normal array is enabled for writing and used during
-rendering when _cmnd(ArrayElement), _cmnd(DrawArrays),
-_cmnd(DrawElement), or _cmnd(DrawRangeElements) is called. See
-_cmnd(NormalPointer).
-.TP
-_const(TEXTURE_COORD_ARRAY)
-If enabled, the texture coordinate array is enabled for writing and used during
-rendering when _cmnd(ArrayElement), _cmnd(DrawArrays),
-_cmnd(DrawElement), or _cmnd(DrawRangeElements) is called. See
-_cmnd(TexCoordPointer).
-.TP
-_const(VERTEX_ARRAY)
-If enabled, the vertex array is enabled for writing and used during
-rendering when _cmnd(ArrayElement), _cmnd(DrawArrays),
-_cmnd(DrawElement), or _cmnd(DrawRangeElements) is called. See
-_cmnd(VertexPointer).
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-If _arbstring(multitexture) is supported, enabling and disabling
-_const(TEXTURE_COORD_ARRAY) affects the active client texture unit.
-The active client texture unit is controlled with
-_cmnd(ClientActiveTextureARB).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_cmnd is not allowed between the execution of _cmnd(Begin) and the
-corresponding _cmnd(End), but an error may or may not be generated. If
-no error is generated, the behavior is undefined.
-.SH SEE ALSO
-_cmnd(ArrayElement),
-_cmnd(ClientActiveTextureARB),
-_cmnd(ColorPointer),
-_cmnd(DrawArrays),
-_cmnd(DrawElements),
-_cmnd(EdgeFlagPointer),
-_cmnd(Enable),
-_cmnd(GetPointerv),
-_cmnd(IndexPointer),
-_cmnd(InterleavedArrays),
-_cmnd(NormalPointer),
-_cmnd(TexCoordPointer),
-_cmnd(VertexPointer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/evalcoord.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/evalcoord.gl
deleted file mode 100755
index bf4e76425..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/evalcoord.gl
+++ /dev/null
@@ -1,208 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(EvalCoord,evaluate enabled one- and two-dimensional maps)
-.EQ
-delim $$
-.EN
-_names(EvalCoord,[1-2][fd])
-.SH PARAMETERS
-_phead(_param1)
-Specifies a value that is the domain coordinate $u$ to the basis function
-defined in a previous _cmnd(Map1) or _cmnd(Map2) command.
-_phead(_param2)
-Specifies a value that is the domain coordinate $v$ to the basis function
-defined in a previous _cmnd(Map2) command.
-This argument is not present in a _cmnd(EvalCoord1) command.
-_names(EvalCoord,[1-2][fd]v)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a pointer to an array containing
-either one or two domain coordinates.
-The first coordinate is $u$.
-The second coordinate is $v$,
-which is present only in _cmnd(EvalCoord2) versions.
-.SH DESCRIPTION
-_cmnd(EvalCoord1) evaluates enabled one-dimensional maps at argument
-_param1(1).
-_cmnd(EvalCoord2) does the same for two-dimensional maps using
-two domain values,
-_param1(1) and _param2(1).
-To define a map, call _cmnd(Map1) and _cmnd(Map2); to enable and
-disable it, call _cmnd(Enable) and _cmnd(Disable).
-.P
-When one of the _cmnd(EvalCoord) commands is issued,
-all currently enabled maps of the indicated dimension are evaluated.
-Then,
-for each enabled map,
-it is as if the corresponding GL command had been issued with the
-computed value.
-That is,
-if _const(MAP1_INDEX) or
-_const(MAP2_INDEX) is enabled,
-a _cmnd(Index) command is simulated.
-If _const(MAP1_COLOR_4) or
-_const(MAP2_COLOR_4) is enabled,
-a _cmnd(Color) command is simulated.
-If _const(MAP1_NORMAL) or _const(MAP2_NORMAL) is enabled,
-a normal vector is produced,
-and if any of
-_const(MAP1_TEXTURE_COORD_1),
-_const(MAP1_TEXTURE_COORD_2),
-_const(MAP1_TEXTURE_COORD_3),
-_const(MAP1_TEXTURE_COORD_4),
-_const(MAP2_TEXTURE_COORD_1),
-_const(MAP2_TEXTURE_COORD_2),
-_const(MAP2_TEXTURE_COORD_3), or
-_const(MAP2_TEXTURE_COORD_4) is enabled, then an appropriate _cmnd(TexCoord) command is simulated.
-.P
-For color,
-color index,
-normal,
-and texture coordinates the GL uses evaluated values instead of current values for those evaluations
-that are enabled,
-and current values otherwise,
-However,
-the evaluated values do not update the current values.
-Thus, if _cmnd(Vertex) commands are interspersed with _cmnd(EvalCoord)
-commands, the color,
-normal,
-and texture coordinates associated with the _cmnd(Vertex) commands are not
-affected by the values generated by the _cmnd(EvalCoord) commands,
-but only by the most recent
-_cmnd(Color),
-_cmnd(Index),
-_cmnd(Normal), and
-_cmnd(TexCoord) commands.
-.P
-No commands are issued for maps that are not enabled.
-If more than one texture evaluation is enabled for a particular dimension
-(for example, _const(MAP2_TEXTURE_COORD_1) and
-_const(MAP2_TEXTURE_COORD_2)),
-then only the evaluation of the map that produces the larger
-number of coordinates
-(in this case, _const(MAP2_TEXTURE_COORD_2))
-is carried out.
-_const(MAP1_VERTEX_4) overrides _const(MAP1_VERTEX_3),
-and
-_const(MAP2_VERTEX_4) overrides _const(MAP2_VERTEX_3),
-in the same manner.
-If neither a three- nor a four-component vertex map is enabled for the
-specified dimension,
-the _cmnd(EvalCoord) command is ignored.
-.P
-If you have enabled automatic normal generation,
-by calling _cmnd(Enable) with argument _const(AUTO_NORMAL),
-_cmnd(EvalCoord2) generates surface normals analytically,
-regardless of the contents or enabling of the _const(MAP2_NORMAL) map.
-Let
-.sp
-.ce
-.EQ
-bold m ~=~ {partial bold p} over {partial u} ~times~
- {partial bold p} over {partial v}
-.EN
-.ce 0
-.sp
-.br
-Then the generated normal $ bold n $ is
-.br
-.ce
-$bold n ~=~ bold m over { || bold m || }$
-.ce 0
-.sp
-.br
-If automatic normal generation is disabled,
-the corresponding normal map _const(MAP2_NORMAL),
-if enabled,
-is used to produce a normal.
-If neither automatic normal generation nor a normal map is enabled,
-no normal is generated for
-_cmnd(EvalCoord2) commands.
-.SH ASSOCIATED GETS
-.nf
-_cmnd(IsEnabled) with argument _const(MAP1_VERTEX_3)
-.br
-_cmnd(IsEnabled) with argument _const(MAP1_VERTEX_4)
-.br
-_cmnd(IsEnabled) with argument _const(MAP1_INDEX)
-.br
-_cmnd(IsEnabled) with argument _const(MAP1_COLOR_4)
-.br
-_cmnd(IsEnabled) with argument _const(MAP1_NORMAL)
-.br
-_cmnd(IsEnabled) with argument _const(MAP1_TEXTURE_COORD_1)
-.br
-_cmnd(IsEnabled) with argument _const(MAP1_TEXTURE_COORD_2)
-.br
-_cmnd(IsEnabled) with argument _const(MAP1_TEXTURE_COORD_3)
-.br
-_cmnd(IsEnabled) with argument _const(MAP1_TEXTURE_COORD_4)
-.br
-_cmnd(IsEnabled) with argument _const(MAP2_VERTEX_3)
-.br
-_cmnd(IsEnabled) with argument _const(MAP2_VERTEX_4)
-.br
-_cmnd(IsEnabled) with argument _const(MAP2_INDEX)
-.br
-_cmnd(IsEnabled) with argument _const(MAP2_COLOR_4)
-.br
-_cmnd(IsEnabled) with argument _const(MAP2_NORMAL)
-.br
-_cmnd(IsEnabled) with argument _const(MAP2_TEXTURE_COORD_1)
-.br
-_cmnd(IsEnabled) with argument _const(MAP2_TEXTURE_COORD_2)
-.br
-_cmnd(IsEnabled) with argument _const(MAP2_TEXTURE_COORD_3)
-.br
-_cmnd(IsEnabled) with argument _const(MAP2_TEXTURE_COORD_4)
-.br
-_cmnd(IsEnabled) with argument _const(AUTO_NORMAL)
-.br
-_cmnd(GetMap)
-.SH SEE ALSO
-_cmnd(Begin),
-_cmnd(Color),
-_cmnd(Enable),
-_cmnd(EvalMesh),
-_cmnd(EvalPoint),
-_cmnd(Index),
-_cmnd(Map1),
-_cmnd(Map2),
-_cmnd(MapGrid),
-_cmnd(Normal),
-_cmnd(TexCoord),
-_cmnd(Vertex)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/evalmesh.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/evalmesh.gl
deleted file mode 100755
index a5b363814..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/evalmesh.gl
+++ /dev/null
@@ -1,189 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(EvalMesh, compute a one- or two-dimensional grid of points or lines)
-_names(EvalMesh1)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-In _cmnd(EvalMesh1), specifies whether to compute a one-dimensional mesh of points or lines.
-Symbolic constants
-_const(POINT) and
-_const(LINE) are accepted.
-_phead(_param2 _param3)
-Specify the first and last integer values for grid domain variable $i$.
-_names(EvalMesh2)
-.SH PARAMETERS
-_phead(_param1)
-In _cmnd(EvalMesh2), specifies whether to compute a two-dimensional mesh of points, lines,
-or polygons.
-Symbolic constants
-_const(POINT),
-_const(LINE), and
-_const(FILL) are accepted.
-_phead(_param2 _param3)
-Specify the first and last integer values for grid domain variable $i$.
-_phead(_param4 _param5)
-Specify the first and last integer values for grid domain variable $j$.
-.SH DESCRIPTION
-_cmnd(MapGrid) and _cmnd are used in tandem to efficiently
-generate and evaluate a series of evenly-spaced map domain values.
-_cmnd steps through the integer domain of a one- or two-dimensional grid,
-whose range is the domain of the evaluation maps specified by
-_cmnd(Map1) and _cmnd(Map2).
-_param1(1) determines whether the resulting vertices are connected as
-points,
-lines,
-or filled polygons.
-.P
-In the one-dimensional case,
-_cmnd(EvalMesh1),
-the mesh is generated as if the following code fragment were executed:
-.nf
-.IP
-\f7
-glBegin( \f2type\f7 );
-for ( i = _param2; i <= _param3; i += 1 )
- glEvalCoord1( i$^cdot^DELTA u ~+~ u sub 1$ );
-glEnd();
-\fP
-.RE
-.fi
-where
-.sp
-.in
-$ DELTA u ~=~ (u sub 2 ~-~ u sub 1 ) ^/^ n$
-.sp
-.in 0
-.P
-and $n$, $u sub 1$, and $u sub 2$ are the arguments to the most recent
-_cmnd(MapGrid1) command.
-\f2type\fP is _const(POINTS) if _param1(1) is _const(POINT),
-or _const(LINES) if _param1(1) is _const(LINE).
-.P
-The one absolute numeric requirement is that if $i ~=~ n$, then the
-value computed from $ i^cdot^DELTA u ~+~ u sub 1$ is exactly $u sub 2$.
-.P
-In the two-dimensional case, _cmnd(EvalMesh2), let
-.nf
-.IP
-$ DELTA u ~=~ mark ( u sub 2 ~-~ u sub 1 ) ^/^ n$
-.sp
-$ DELTA v ~=~ lineup ( v sub 2 ~-~ v sub 1 ) ^/^ m$,
-.fi
-.RE
-.P
-where $n$, $u sub 1$, $u sub 2$, $m$, $v sub 1$, and $v sub 2$ are the
-arguments to the most recent _cmnd(MapGrid2) command. Then, if
-_param1(2) is _const(FILL), the _cmnd(EvalMesh2) command is equivalent
-to:
-.nf
-.IP
-\f7
-for ( j = _param4; j < _param5; j += 1 ) {
- glBegin( GL_QUAD_STRIP );
- for ( i = _param2; i <= _param3; i += 1 ) {
- glEvalCoord2( i$^cdot^DELTA u ~+~ u sub 1$, j$^cdot^DELTA v ~+~ v sub 1$ );
- glEvalCoord2( i$^cdot^DELTA u ~+~ u sub 1$, (j+1)$^cdot^DELTA v ~+~ v sub 1$ );
- }
- glEnd();
-}
-\fP
-.RE
-.fi
-.P
-If _param1 is _const(LINE), then a call to _cmnd(EvalMesh2) is equivalent to:
-.nf
-.IP
-\f7
-for ( j = _param4; j <= _param5; j += 1 ) {
- glBegin( GL_LINE_STRIP );
- for ( i = _param2; i <= _param3; i += 1 )
- glEvalCoord2( i$^cdot^DELTA u ~+~ u sub 1$, j$^cdot^DELTA v ~+~ v sub 1$ );
- glEnd();
-}
-.sp
-for ( i = _param2; i <= _param3; i += 1 ) {
- glBegin( GL_LINE_STRIP );
- for ( j = _param4; j <= _param4; j += 1 )
- glEvalCoord2( i$^cdot^DELTA u ~+~ u sub 1$, j$^cdot^DELTA v ~+~ v sub 1 $ );
- glEnd();
-}
-\fP
-.RE
-.fi
-.P
-And finally, if _param1 is _const(POINT), then a call to
-_cmnd(EvalMesh2) is equivalent to:
-.nf
-.IP
-\f7
-glBegin( GL_POINTS );
-for ( j = _param4; j <= _param5; j += 1 )
- for ( i = _param2; i <= _param3; i += 1 )
- glEvalCoord2( i$^cdot^DELTA u ~+~ u sub 1$, j$^cdot^DELTA v ~+~ v sub 1$ );
-glEnd();
-\fP
-.RE
-.fi
-.P
-In all three cases, the only absolute numeric requirements are that if $i~=~n$,
-then the value computed from $i^cdot^DELTA u ~+~ u sub 1$ is exactly $u
-sub 2$, and if $j~=~m$, then the value computed from
-$j ^cdot^ DELTA v ~+~ v sub 1$ is exactly $v sub 2$.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(MAP1_GRID_DOMAIN)
-.br
-_cmnd(Get) with argument _const(MAP2_GRID_DOMAIN)
-.br
-_cmnd(Get) with argument _const(MAP1_GRID_SEGMENTS)
-.br
-_cmnd(Get) with argument _const(MAP2_GRID_SEGMENTS)
-.SH SEE ALSO
-_cmnd(Begin),
-_cmnd(EvalCoord),
-_cmnd(EvalPoint),
-_cmnd(Map1),
-_cmnd(Map2),
-_cmnd(MapGrid)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/evalpoint.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/evalpoint.gl
deleted file mode 100755
index 34dcb717c..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/evalpoint.gl
+++ /dev/null
@@ -1,111 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(EvalPoint,generate and evaluate a single point in a mesh)
-_names(EvalPoint,[12])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the integer value for grid domain variable $i$.
-_phead(_param2)
-Specifies the integer value for grid domain variable $j$
-(_cmnd(EvalPoint2) only).
-.SH DESCRIPTION
-_cmnd(MapGrid) and _cmnd(EvalMesh) are used in tandem to efficiently
-generate and evaluate a series of evenly spaced map domain values.
-_cmnd can be used to evaluate a single grid point in the same gridspace
-that is traversed by _cmnd(EvalMesh).
-Calling _cmnd(EvalPoint1) is equivalent to calling
-.nf
-.IP
-\f7
-glEvalCoord1( i$^cdot^DELTA u ~+~ u sub 1$ );
-\fP
-.RE
-.fi
-where
-.sp
-.in
-$DELTA u ~=~ ( u sub 2 - u sub 1 ) ^/^ n$
-.in 0
-.sp
-.P
-and $n$, $u sub 1$, and $u sub 2$
-are the arguments to the most recent _cmnd(MapGrid1) command.
-The one absolute numeric requirement is that if $i~=~n$,
-then the value computed from
-$i ^cdot^ DELTA u ~+~ u sub 1$ is exactly $u sub 2$.
-.P
-In the two-dimensional case, _cmnd(EvalPoint2), let
-.nf
-.IP
-$DELTA u ~=~ mark ( u sub 2 - u sub 1 ) ^/^ n$
-.sp
-$DELTA v ~=~ mark ( v sub 2 - v sub 1 ) ^/^ m,$
-.RE
-.fi
-.P
-where $n$, $u sub 1$, $u sub 2$, $m$, $v sub 1$, and $v sub 2$
-are the arguments to the most recent _cmnd(MapGrid2) command.
-Then the _cmnd(EvalPoint2) command is equivalent to calling
-.nf
-.IP
-\f7
-glEvalCoord2( i$^cdot^DELTA u ~+~ u sub 1$, j$^cdot^DELTA v ~+~ v sub 1$ );
-\fP
-.RE
-.fi
-The only absolute numeric requirements are that if $i~=~n$,
-then the value computed from
-$i ^cdot^DELTA u ~+~ u sub 1$ is exactly $u sub 2$,
-and if $j~=~m$, then the value computed from
-$i ^cdot^DELTA v ~+~ v sub 1$ is exactly $v sub 2$.
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(MAP1_GRID_DOMAIN)
-.br
-_cmnd(Get) with argument _const(MAP2_GRID_DOMAIN)
-.br
-_cmnd(Get) with argument _const(MAP1_GRID_SEGMENTS)
-.br
-_cmnd(Get) with argument _const(MAP2_GRID_SEGMENTS)
-.SH SEE ALSO
-_cmnd(EvalCoord),
-_cmnd(EvalMesh),
-_cmnd(Map1),
-_cmnd(Map2),
-_cmnd(MapGrid)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/feedbackbuffer.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/feedbackbuffer.gl
deleted file mode 100755
index 5d32f36df..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/feedbackbuffer.gl
+++ /dev/null
@@ -1,237 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(FeedbackBuffer,controls feedback mode)
-_names(FeedbackBuffer)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the maximum number of values that can be written into _param3.
-_phead(_param2)
-Specifies a symbolic constant that describes the information
-that will be returned for each vertex.
-_const(2D),
-_const(3D),
-_const(3D_COLOR),
-_const(3D_COLOR_TEXTURE), and
-_const(4D_COLOR_TEXTURE) are accepted.
-_phead(_param3)
-Returns the feedback data.
-.SH DESCRIPTION
-The _cmnd function controls feedback.
-Feedback, like selection, is a GL mode.
-The mode is selected by calling
-_cmnd(RenderMode) with _const(FEEDBACK).
-When the GL is in feedback mode,
-no pixels are produced by rasterization.
-Instead, information about primitives that would have been
-rasterized is fed back to the application using the GL.
-.P
-_cmnd has three arguments:
-_param3 is a pointer to an array of floating-point values
-into which feedback information is placed.
-_param1 indicates the size of the array.
-_param2 is a symbolic constant describing the information
-that is fed back for each vertex.
-_cmnd must be issued before feedback mode is enabled
-(by calling _cmnd(RenderMode) with argument _const(FEEDBACK)).
-Setting _const(FEEDBACK) without establishing the feedback buffer,
-or calling _cmnd while the GL is in feedback mode,
-is an error.
-.P
-When _cmnd(RenderMode) is called while in feedback mode, it returns the number of entries
-placed in the feedback array, and resets the feedback array pointer to the base
-of the feedback buffer. The returned value never exceeds _param1. If the feedback
-data required more room than was available in _param3,
-_cmnd(RenderMode) returns a negative value.
-To take the GL out of feedback mode, call
-_cmnd(RenderMode) with a parameter value other than _const(FEEDBACK).
-.P
-While in feedback mode,
-each primitive, bitmap, or pixel rectangle that would be rasterized
-generates a block of values that are copied into the feedback array.
-If doing so would cause the number of entries to exceed the maximum,
-the block is partially written so as to fill the array
-(if there is any room left at all),
-and an overflow flag is set.
-Each block begins with a code indicating the primitive type,
-followed by values that describe the primitive's vertices and
-associated data.
-Entries are also written for bitmaps and pixel rectangles.
-Feedback occurs after polygon culling and _cmnd(PolygonMode) interpretation
-of polygons has taken place,
-so polygons that are culled are not returned in the feedback buffer.
-It can also occur after polygons with more than three edges are broken up
-into triangles,
-if the GL implementation renders polygons by performing this decomposition.
-.P
-The _cmnd(PassThrough) command can be used to insert a marker
-into the feedback buffer.
-See _cmnd(PassThrough).
-.P
-Following is the grammar for the blocks of values written
-into the feedback buffer.
-Each primitive is indicated with a unique identifying value
-followed by some number of vertices.
-Polygon entries include an integer value indicating how many vertices follow.
-A vertex is fed back as some number of floating-point values,
-as determined by _param2.
-Colors are fed back as four values in RGBA mode and one value
-in color index mode.
-.RS
-.na
-.sp
-feedbackList \(<- feedbackItem feedbackList | feedbackItem
-.sp
-feedbackItem \(<- point | lineSegment | polygon | bitmap | pixelRectangle | passThru
-.sp
-point \(<- _const(POINT_TOKEN) vertex
-.sp
-lineSegment \(<- _const(LINE_TOKEN) vertex vertex | _const(LINE_RESET_TOKEN) vertex vertex
-.sp
-polygon \(<- _const(POLYGON_TOKEN) n polySpec
-.sp
-polySpec \(<- polySpec vertex | vertex vertex vertex
-.sp
-bitmap \(<- _const(BITMAP_TOKEN) vertex
-.sp
-pixelRectangle \(<- _const(DRAW_PIXEL_TOKEN) vertex | _const(COPY_PIXEL_TOKEN) vertex
-.sp
-passThru \(<- _const(PASS_THROUGH_TOKEN) value
-.sp
-vertex \(<- 2d | 3d | 3dColor | 3dColorTexture | 4dColorTexture
-.sp
-2d \(<- value value
-.sp
-3d \(<- value value value
-.sp
-3dColor \(<- value value value color
-.sp
-3dColorTexture \(<- value value value color tex
-.sp
-4dColorTexture \(<- value value value value color tex
-.sp
-color \(<- rgba | index
-.sp
-rgba \(<- value value value value
-.sp
-index \(<- value
-.sp
-tex \(<- value value value value
-.sp
-.RE
-.P
-.I value
-is a floating-point number,
-and
-.I n
-is a floating-point integer giving the number of vertices in the polygon.
-_const(POINT_TOKEN),
-_const(LINE_TOKEN),
-_const(LINE_RESET_TOKEN),
-_const(POLYGON_TOKEN),
-_const(BITMAP_TOKEN),
-_const(DRAW_PIXEL_TOKEN),
-_const(COPY_PIXEL_TOKEN) and
-_const(PASS_THROUGH_TOKEN) are symbolic floating-point constants.
-_const(LINE_RESET_TOKEN) is returned whenever the line stipple pattern
-is reset.
-The data returned as a vertex depends on the feedback _param2.
-.P
-The following table gives the correspondence between _param2
-and the number of values per vertex.
-\f2k\fP is 1 in color index mode and 4 in RGBA mode.
-.sp
-.ne
-.TS
-center tab(:);
-lb lb cb cb cb
-l l c c c.
-_
-Type:Coordinates:Color:Texture:Total Number of Values
-_
-_const(2D):\f2x\fP, \f2y\fP:::2
-_const(3D):\f2x\fP, \f2y\fP, \f2z\fP:::3
-_const(3D_COLOR):\f2x\fP, \f2y\fP, \f2z\fP:$k$::$3 ~+~ k$
-_const(3D_COLOR_TEXTURE):\f2x\fP, \f2y\fP, \f2z\fP,:$k$:4:$7 ~+~ k$
-_const(4D_COLOR_TEXTURE):\f2x\fP, \f2y\fP, \f2z\fP, \f2w\fP:$k$:4:$8 ~+~ k$
-_
-.TE
-
-.P
-Feedback vertex coordinates are in window coordinates,
-except \f2w\fP,
-which is in clip coordinates.
-Feedback colors are lighted, if lighting is enabled.
-Feedback texture coordinates are generated,
-if texture coordinate generation is enabled.
-They are always transformed by the texture matrix.
-.SH NOTES
-_cmnd, when used in a display list, is not compiled into the display list
-but is executed immediately.
-.P
-When the _arbstring(multitexture) extension is supported, _cmnd
-returns only the texture coordinates of texture unit _arbconst(TEXTURE0).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param2 is not an accepted value.
-.P
-_const(INVALID_VALUE) is generated if _param1 is negative.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is called while the
-render mode is _const(FEEDBACK),
-or if _cmnd(RenderMode) is called with argument _const(FEEDBACK) before
-_cmnd is called at least once.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(RENDER_MODE)
-.br
-_cmnd(Get) with argument _const(FEEDBACK_BUFFER_POINTER)
-.br
-_cmnd(Get) with argument _const(FEEDBACK_BUFFER_SIZE)
-.br
-_cmnd(Get) with argument _const(FEEDBACK_BUFFER_TYPE)
-.SH SEE ALSO
-_cmnd(Begin),
-_cmnd(LineStipple),
-_cmnd(PassThrough),
-_cmnd(PolygonMode),
-_cmnd(RenderMode),
-_cmnd(SelectBuffer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/finish.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/finish.gl
deleted file mode 100755
index a10d3eddf..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/finish.gl
+++ /dev/null
@@ -1,53 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Finish,block until all GL execution is complete)
-_names(Finish)
-.SH DESCRIPTION
-_cmnd does not return until the effects of all previously
-called GL commands are complete.
-Such effects include all changes to GL state,
-all changes to connection state,
-and all changes to the frame buffer contents.
-.SH NOTES
-_cmnd requires a round trip to the server.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd is executed between
-the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(Flush)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/flush.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/flush.gl
deleted file mode 100755
index 357f1b50e..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/flush.gl
+++ /dev/null
@@ -1,65 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Flush,force execution of GL commands in finite time)
-_names(Flush)
-.SH DESCRIPTION
-Different GL implementations buffer commands in several different locations,
-including network buffers and the graphics accelerator itself.
-_cmnd empties all of these buffers,
-causing all issued commands to be executed as quickly as
-they are accepted by the actual rendering engine.
-Though this execution may not be completed in any particular
-time period,
-it does complete in finite time.
-.P
-Because any GL program might be executed over a network,
-or on an accelerator that buffers commands,
-all programs should call _cmnd whenever they count on having
-all of their previously issued commands completed.
-For example,
-call _cmnd before waiting for user input that depends on
-the generated image.
-.SH NOTES
-_cmnd can return at any time.
-It does not wait until the execution of all previously
-issued GL commands is complete.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(Finish)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/fog.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/fog.gl
deleted file mode 100755
index a6f4ff44e..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/fog.gl
+++ /dev/null
@@ -1,202 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Fog,specify fog parameters)
-_names(Fog,[fi])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies a single-valued fog parameter.
-_const(FOG_MODE),
-_const(FOG_DENSITY),
-_const(FOG_START),
-_const(FOG_END),
-and
-_const(FOG_INDEX)
-are accepted.
-_phead(_param2)
-Specifies the value that _param1 will be set to.
-_names(Fog,[fi]v)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a fog parameter.
-_const(FOG_MODE),
-_const(FOG_DENSITY),
-_const(FOG_START),
-_const(FOG_END),
-_const(FOG_INDEX),
-and
-_const(FOG_COLOR)
-are accepted.
-_phead(_param2)
-Specifies the value or values to be assigned to _param1.
-_const(FOG_COLOR) requires an array of four values.
-All other parameters accept an array containing only a single value.
-.SH DESCRIPTION
-Fog is initially disabled.
-While enabled, fog affects rasterized geometry,
-bitmaps, and pixel blocks, but not buffer clear operations. To enable
-and disable fog, call _cmnd(Enable) and _cmnd(Disable) with argument
-_const(FOG).
-.P
-_cmnd assigns the value or values in _param2 to the fog parameter
-specified by _param1.
-The following values are accepted for _param1:
-.TP 20
-_const(FOG_MODE)
-_param2 is a single integer or floating-point value that specifies
-the equation to be used to compute the fog blend factor, $f$.
-Three symbolic constants are accepted:
-_const(LINEAR),
-_const(EXP),
-and _const(EXP2).
-The equations corresponding to these symbolic constants are defined below.
-The initial fog mode is _const(EXP).
-.TP
-_const(FOG_DENSITY)
-_param2 is a single integer or floating-point value that specifies $density$,
-the fog density used in both exponential fog equations.
-Only nonnegative densities are accepted.
-The initial fog density is 1.
-.TP
-_const(FOG_START)
-_param2 is a single integer or floating-point value that specifies $start$,
-the near distance used in the linear fog equation.
-The initial near distance is 0.
-.TP
-_const(FOG_END)
-_param2 is a single integer or floating-point value that specifies $end$,
-the far distance used in the linear fog equation.
-The initial far distance is 1.
-.TP
-_const(FOG_INDEX)
-_param2 is a single integer or floating-point value that specifies
-$i sub f$,
-the fog color index.
-The initial fog index is 0.
-.TP
-_const(FOG_COLOR)
-_param2 contains four integer or floating-point values that specify
-$C sub f$, the fog color.
-Integer values are mapped linearly such that the most positive representable
-value maps to 1.0,
-and the most negative representable value maps to \-1.0.
-Floating-point values are mapped directly.
-After conversion,
-all color components are clamped to the range [0,1].
-The initial fog color is (0, 0, 0, 0).
-.P
-Fog blends a fog color with each rasterized pixel fragment's posttexturing
-color using a blending factor $f$.
-Factor $f$ is computed in one of three ways,
-depending on the fog mode.
-Let $z$ be the distance in eye coordinates from the origin to the fragment
-being fogged.
-The equation for _const(LINEAR) fog is
-.ce
-
-.EQ
-f ~=~ {end ~-~ z} over {end ~-~ start}
-.EN
-
-.RE
-.P
-The equation for _const(EXP) fog is
-.ce
-
-.EQ
-f ~=~ e sup {-^(density ~cdot~ z)}
-.EN
-
-.P
-The equation for _const(EXP2) fog is
-.ce
-
-.EQ
-f ~=~ e sup {-^(density ~cdot~ z)} sup 2
-.EN
-
-.P
-Regardless of the fog mode,
-$f$ is clamped to the range [0,\ 1] after it is computed.
-Then,
-if the GL is in RGBA color mode,
-the fragment's red, green, and blue colors, represented by $C sub r$,
-are replaced by
-.sp
-.ce
-.EQ
-{C sub r} sup prime ~=~ f^C sub r ~+~ (1 - f)^C sub f
-.EN
-
-.sp
-Fog does not affect a fragment's alpha component.
-.P
-In color index mode, the fragment's color index $i sub r$ is replaced by
-.sp
-.ce
-.EQ
-{i sub r} sup prime ~=~ i sub r ~+~ (1 - f)^i sub f
-.EN
-.P
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value,
-or if _param1 is _const(FOG_MODE) and _param2 is not an accepted value.
-.P
-_const(INVALID_VALUE) is generated if _param1 is _const(FOG_DENSITY),
-and _param2 is negative.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(IsEnabled) with argument _const(FOG)
-.br
-_cmnd(Get) with argument _const(FOG_COLOR)
-.br
-_cmnd(Get) with argument _const(FOG_INDEX)
-.br
-_cmnd(Get) with argument _const(FOG_DENSITY)
-.br
-_cmnd(Get) with argument _const(FOG_START)
-.br
-_cmnd(Get) with argument _const(FOG_END)
-.br
-_cmnd(Get) with argument _const(FOG_MODE)
-.SH SEE ALSO
-_cmnd(Enable)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/frontface.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/frontface.gl
deleted file mode 100755
index ace895ad6..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/frontface.gl
+++ /dev/null
@@ -1,83 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(FrontFace,define front- and back-facing polygons)
-_names(FrontFace)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the orientation of front-facing polygons.
-_const(CW) and _const(CCW) are accepted.
-The initial value is _const(CCW).
-.SH DESCRIPTION
-In a scene composed entirely of opaque closed surfaces,
-back-facing polygons are never visible.
-Eliminating these invisible polygons has the obvious benefit
-of speeding up the rendering of the image.
-To enable and disable elimination of back-facing polygons, call _cmnd(Enable)
-and _cmnd(Disable) with argument _const(CULL_FACE).
-.P
-The projection of a polygon to window coordinates is said to have
-clockwise winding if an imaginary object following the path
-from its first vertex,
-its second vertex,
-and so on,
-to its last vertex,
-and finally back to its first vertex,
-moves in a clockwise direction about the interior of the polygon.
-The polygon's winding is said to be counterclockwise if the imaginary
-object following the same path moves in a counterclockwise direction
-about the interior of the polygon.
-_cmnd specifies whether polygons with clockwise winding in window coordinates,
-or counterclockwise winding in window coordinates,
-are taken to be front-facing.
-Passing _const(CCW) to _param1 selects counterclockwise polygons as
-front-facing;
-_const(CW) selects clockwise polygons as front-facing.
-By default, counterclockwise polygons are taken to be front-facing.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(FRONT_FACE)
-.SH SEE ALSO
-_cmnd(CullFace),
-_cmnd(LightModel)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/frustum.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/frustum.gl
deleted file mode 100755
index 9688b9a0e..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/frustum.gl
+++ /dev/null
@@ -1,142 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Frustum,multiply the current matrix by a perspective matrix)
-_names(Frustum)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1 _param2)
-Specify the coordinates for the left and right vertical clipping planes.
-_phead(_param3 _param4)
-Specify the coordinates for the bottom and top horizontal clipping planes.
-_phead(_param5 _param6)
-Specify the distances to the near and far depth clipping planes.
-Both distances must be positive.
-.SH DESCRIPTION
-_cmnd describes a perspective matrix that produces a perspective projection.
-The current matrix (see _cmnd(MatrixMode)) is multiplied by this matrix
-and the result replaces the current matrix, as if
-_cmnd(MultMatrix) were called with the following matrix
-as its argument:
-.P
-.sp 5
-.ce
-.EQ
-down 150
-{left [ ~~~ {
-down 165 matrix {
- ccol { {{2 ~ _eqnparam5} over {_eqnparam2 ~-~ _eqnparam1}} above 0 above 0 above 0 }
- ccol { 0 above {{2 ~ _eqnparam5} over {_eqnparam4 ~-~ _eqnparam3}} ~ above 0 above 0 }
- ccol { A ~~~~ above B ~~~~ above C ~~~~ above -1 ~~~~}
- ccol { 0 above 0 above D above 0}
-}}
-~~~ right ]}
-.EN
-.sp
-.ce
-.EQ
-down 130
-{A ~=~ {_eqnparam2 ~+~ _eqnparam1} over {_eqnparam2 ~-~ _eqnparam1}}
-.EN
-.sp
-.ce
-.EQ
-down 130
-{B ~=~ {_eqnparam4 ~+~ _eqnparam3} over {_eqnparam4 ~-~ _eqnparam3}}
-.EN
-.sp
-.ce
-.EQ
-down 130
-{C ~=~ -{{_eqnparam6 ~+~ _eqnparam5} over {_eqnparam6 ~-~ _eqnparam5}}}
-.EN
-.sp
-.ce
-.EQ
-down 130
-{D ~=~ -^{{2 ~ _eqnparam6 ~ _eqnparam5} over {_eqnparam6 ~-~ _eqnparam5}}}
-.EN
-.sp 2
-.P
-Typically, the matrix mode is _const(PROJECTION), and
-(_param1, _param3, \-_param5) and (_param2, _param4, \-_param5)
-specify the points on the near clipping plane that are mapped
-to the lower left and upper right corners of the window,
-assuming that the eye is located at (0, 0, 0).
-\-_param6 specifies the location of the far clipping plane.
-Both _param5 and _param6 must be positive.
-.P
-Use _cmnd(PushMatrix) and _cmnd(PopMatrix) to save and restore
-the current matrix stack.
-.SH NOTES
-Depth buffer precision is affected by the values specified for
-_param5 and _param6.
-The greater the ratio of _param6 to _param5 is,
-the less effective the depth buffer will be at distinguishing between
-surfaces that are near each other.
-If
-.sp
-.ce
-$r ~=~ _eqnparam6 over _eqnparam5$
-.sp
-roughly $log sub 2 (r)$ bits of depth buffer precision are lost.
-Because $r$ approaches infinity as _param5 approaches 0,
-_param5 must never be set to 0.
-.SH ERRORS
-_const(INVALID_VALUE) is generated if _param5 or _param6 is not
-positive, or if _param1 = _param2, or _param3 = _param4.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(MATRIX_MODE)
-.br
-_cmnd(Get) with argument _const(MODELVIEW_MATRIX)
-.br
-_cmnd(Get) with argument _const(PROJECTION_MATRIX)
-.br
-_cmnd(Get) with argument _const(TEXTURE_MATRIX)
-.br
-_cmnd(Get) with argument _const(COLOR_MATRIX)
-.SH SEE ALSO
-_cmnd(Ortho),
-_cmnd(MatrixMode),
-_cmnd(MultMatrix),
-_cmnd(PushMatrix),
-_cmnd(Viewport)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/genlists.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/genlists.gl
deleted file mode 100755
index 35d5830e5..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/genlists.gl
+++ /dev/null
@@ -1,66 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GenLists,generate a contiguous set of empty display lists)
-_names(GenLists)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the number of contiguous empty display lists
-to be generated.
-.SH DESCRIPTION
-_cmnd has one argument, _param1.
-It returns an integer \f2n\fP such that _param1 contiguous
-empty display lists,
-named \f2n\fP, \f2n\fP+1, ..., \f2n\fP+_param1 \-1,
-are created.
-If _param1 is 0,
-if there is no group of _param1 contiguous names available,
-or if any error is generated,
-no display lists are generated,
-and 0 is returned.
-.SH ERRORS
-_const(INVALID_VALUE) is generated if _param1 is negative.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(IsList)
-.SH SEE ALSO
-_cmnd(CallList),
-_cmnd(CallLists),
-_cmnd(DeleteLists),
-_cmnd(NewList)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/gentextures.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/gentextures.gl
deleted file mode 100755
index e20136d01..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/gentextures.gl
+++ /dev/null
@@ -1,77 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GenTextures,generate texture names)
-_names(GenTextures)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the number of texture names to be generated.
-_phead(_param2)
-Specifies an array in which the generated texture names are stored.
-.SH DESCRIPTION
-_cmnd returns _param1 texture names in _param2.
-There is no guarantee that the names form a contiguous set of integers;
-however, it is guaranteed that none of the returned names was in use
-immediately before the call to _cmnd.
-.P
-The generated textures have no dimensionality; they assume the dimensionality
-of the texture target to which they are first bound
-(see _cmnd(BindTexture)).
-.P
-Texture names returned by a call to _cmnd are not returned by
-subsequent calls, unless they are first deleted with
-_cmnd(DeleteTextures).
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.SH ERRORS
-_const(INVALID_VALUE) is generated if _param1 is negative.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(IsTexture)
-.SH SEE ALSO
-_cmnd(BindTexture),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(DeleteTextures),
-_cmnd(Get),
-_cmnd(GetTexParameter),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexParameter)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/get.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/get.gl
deleted file mode 100755
index 4928c44ab..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/get.gl
+++ /dev/null
@@ -1,1791 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Get,return the value or values of a selected parameter)
-_names(GetBooleanv)
-_names(GetDoublev)
-_names(GetFloatv)
-_names(GetIntegerv)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the parameter value to be returned.
-The symbolic constants in the list below are accepted.
-_phead(_param2)
-Returns the value or values of the specified parameter.
-.SH DESCRIPTION
-These four commands return values for simple state variables in GL.
-_param1 is a symbolic constant indicating the state variable to be returned,
-and _param2 is a pointer to an array of the indicated type in
-which to place the returned data.
-.P
-Type conversion is performed if _param2 has a different type than
-the state variable value being requested.
-If _cmnd(GetBooleanv) is called,
-a floating-point (or integer) value is converted to _const(FALSE) if
-and only if it is 0.0 (or 0).
-Otherwise,
-it is converted to _const(TRUE).
-If _cmnd(GetIntegerv) is called, boolean values are returned as
-_const(TRUE) or _const(FALSE), and most floating-point values are
-rounded to the nearest integer value. Floating-point colors and
-normals, however, are returned with a linear mapping that maps 1.0 to
-the most positive representable integer value,
-and \-1.0 to the most negative representable integer value.
-If _cmnd(GetFloatv) or _cmnd(GetDoublev) is called,
-boolean values are returned as _const(TRUE) or _const(FALSE),
-and integer values are converted to floating-point values.
-.P
-The following symbolic constants are accepted by _param1:
-.TP 25
-_const(ACCUM_ALPHA_BITS)
-_param2 returns one value,
-the number of alpha bitplanes in the accumulation buffer.
-.TP
-_const(ACCUM_BLUE_BITS)
-_param2 returns one value,
-the number of blue bitplanes in the accumulation buffer.
-.TP
-_const(ACCUM_CLEAR_VALUE)
-_param2 returns four values:
-the red, green, blue, and alpha values used to clear the accumulation buffer.
-Integer values,
-if requested,
-are linearly mapped from the internal floating-point representation such
-that 1.0 returns the most positive representable integer value,
-and \-1.0 returns the most negative representable integer
-value. The initial value is (0, 0, 0, 0).
-See _cmnd(ClearAccum).
-.TP
-_const(ACCUM_GREEN_BITS)
-_param2 returns one value,
-the number of green bitplanes in the accumulation buffer.
-.TP
-_const(ACCUM_RED_BITS)
-_param2 returns one value,
-the number of red bitplanes in the accumulation buffer.
-.TP
-_arbconst(ACTIVE_TEXTURE)
-_param2 returns a single value indicating the active multitexture unit.
-The initial value is _arbconst(TEXTURE0).
-See _cmnd(ActiveTextureARB).
-.TP
-_const(ALIASED_POINT_SIZE_RANGE)
-_param2 returns two values,
-the smallest and largest supported sizes for aliased points.
-.TP
-_const(ALIASED_LINE_WIDTH_RANGE)
-_param2 returns two values,
-the smallest and largest supported widths for aliased lines.
-.TP
-_const(ALPHA_BIAS)
-_param2 returns one value,
-the alpha bias factor used during pixel transfers. The initial value is 0.
-See _cmnd(PixelTransfer).
-.TP
-_const(ALPHA_BITS)
-_param2 returns one value,
-the number of alpha bitplanes in each color buffer.
-.TP
-_const(ALPHA_SCALE)
-_param2 returns one value,
-the alpha scale factor used during pixel transfers. The initial value is 1.
-See _cmnd(PixelTransfer).
-.TP
-_const(ALPHA_TEST)
-_param2 returns a single boolean value indicating whether alpha testing
-of fragments is enabled. The initial value is _const(FALSE).
-See _cmnd(AlphaFunc).
-.TP
-_const(ALPHA_TEST_FUNC)
-_param2 returns one value,
-the symbolic name of the alpha test function. The initial value is
-_const(ALWAYS).
-See _cmnd(AlphaFunc).
-.TP
-_const(ALPHA_TEST_REF)
-_param2 returns one value,
-the reference value for the alpha test. The initial value is 0.
-See _cmnd(AlphaFunc).
-An integer value,
-if requested,
-is linearly mapped from the internal floating-point representation such
-that 1.0 returns the most positive representable integer value,
-and \-1.0 returns the most negative representable integer value.
-.TP
-_const(ATTRIB_STACK_DEPTH)
-_param2 returns one value,
-the depth of the attribute stack.
-If the stack is empty,
-0 is returned. The initial value is 0.
-See _cmnd(PushAttrib).
-.TP
-_const(AUTO_NORMAL)
-_param2 returns a single boolean value indicating whether 2D map evaluation
-automatically generates surface normals. The initial value is _const(FALSE).
-See _cmnd(Map2).
-.TP
-_const(AUX_BUFFERS)
-_param2 returns one value,
-the number of auxiliary color buffers. The initial value is 0.
-.TP
-_const(BLEND)
-_param2 returns a single boolean value indicating whether blending is
-enabled. The initial value is _const(FALSE).
-See _cmnd(BlendFunc).
-.TP
-_const(BLEND_COLOR)
-_param2 returns four values,
-the red, green, blue, and alpha values which are the components of
-the blend color.
-See _cmnd(BlendColor).
-.TP
-_const(BLEND_DST)
-_param2 returns one value,
-the symbolic constant identifying the destination blend
-function. The initial value is _const(ZERO).
-See _cmnd(BlendFunc).
-.TP
-_const(BLEND_EQUATION)
-_param2 returns one value, a symbolic constant indicating whether
-the blend equation is _const(FUNC_ADD), _const(MIN) or
-_const(MAX). See _cmnd(BlendEquation).
-.TP
-_const(BLEND_SRC)
-_param2 returns one value,
-the symbolic constant identifying the source blend function. The initial
-value is _const(ONE).
-See _cmnd(BlendFunc).
-.TP
-_const(BLUE_BIAS)
-_param2 returns one value,
-the blue bias factor used during pixel transfers. The initial value is 0.
-See
-_cmnd(PixelTransfer).
-.TP
-_const(BLUE_BITS)
-_param2 returns one value,
-the number of blue bitplanes in each color buffer.
-.TP
-_const(BLUE_SCALE)
-_param2 returns one value,
-the blue scale factor used during pixel transfers. The initial value is 1.
-See
-_cmnd(PixelTransfer).
-.TP
-_arbconst(CLIENT_ACTIVE_TEXTURE)
-_param2 returns a single integer value indicating the current client active
-multitexture unit. The initial value is _arbconst(TEXTURE0).
-See _cmnd(ClientActiveTextureARB).
-.TP
-_const(CLIENT_ATTRIB_STACK_DEPTH)
-_param2 returns one value indicating the depth of the
-attribute stack. The initial value is 0.
-See _cmnd(PushClientAttrib).
-.TP
-_const(CLIP_PLANE)\f2i\fP
-_param2 returns a single boolean value indicating whether the specified
-clipping plane is enabled. The initial value is _const(FALSE).
-See _cmnd(ClipPlane).
-.TP
-_const(COLOR_ARRAY)
-_param2 returns a single boolean value indicating whether the color array is enabled. The initial value is _const(FALSE).
-See _cmnd(ColorPointer).
-.TP
-_const(COLOR_ARRAY_SIZE)
-_param2 returns one value,
-the number of components per color in the color array. The initial value
-is 4. See _cmnd(ColorPointer).
-.TP
-_const(COLOR_ARRAY_STRIDE)
-_param2 returns one value,
-the byte offset between consecutive colors in the color array. The initial
-value is 0.
-See _cmnd(ColorPointer).
-.TP
-_const(COLOR_ARRAY_TYPE)
-_param2 returns one value,
-the data type of each component in the color array. The initial value
-is _const(FLOAT). See _cmnd(ColorPointer).
-.TP
-_const(COLOR_CLEAR_VALUE)
-_param2 returns four values:
-the red, green, blue, and alpha values used to clear the color buffers.
-Integer values,
-if requested,
-are linearly mapped from the internal floating-point representation such
-that 1.0 returns the most positive representable integer value,
-and \-1.0 returns the most negative representable integer
-value. The initial value is (0, 0, 0, 0).
-See _cmnd(ClearColor).
-.TP
-_const(COLOR_LOGIC_OP)
-_param2 returns a single boolean value indicating whether a fragment's
-RGBA color values are merged into the framebuffer using a logical
-operation. The initial value is _const(FALSE).
-See _cmnd(LogicOp).
-.TP
-_const(COLOR_MATERIAL)
-_param2 returns a single boolean value indicating whether one or more
-material parameters are tracking the current color. The initial value
-is _const(FALSE).
-See _cmnd(ColorMaterial).
-.TP
-_const(COLOR_MATERIAL_FACE)
-_param2 returns one value,
-a symbolic constant indicating which materials have a parameter that is
-tracking the current color. The initial value is _const(FRONT_AND_BACK).
-See _cmnd(ColorMaterial).
-.TP
-_const(COLOR_MATERIAL_PARAMETER)
-_param2 returns one value,
-a symbolic constant indicating which material parameters are
-tracking the current color. The initial value is
-_const(AMBIENT_AND_DIFFUSE).
-See _cmnd(ColorMaterial).
-.TP
-_const(COLOR_MATRIX)
-_param2 returns sixteen values:
-the color matrix on the top of the color matrix stack. Initially
-this matrix is the identity matrix. See _cmnd(PushMatrix).
-.TP
-_const(COLOR_MATRIX_STACK_DEPTH)
-_param2 returns one value,
-the maximum supported depth of the projection matrix stack. The value must
-be at least 2.
-See _cmnd(PushMatrix).
-.TP
-_const(COLOR_TABLE)
-_param2 returns a single boolean value indicating whether the color table
-lookup is enabled.
-See _cmnd(ColorTable).
-.TP
-_const(COLOR_WRITEMASK)
-_param2 returns four boolean values:
-the red, green, blue, and alpha write enables for the color
-buffers. The initial value is (_const(TRUE), _const(TRUE),
-_const(TRUE), _const(TRUE)).
-See _cmnd(ColorMask).
-.TP
-_const(CONVOLUTION_1D)
-_param2 returns a single boolean value indicating whether 1D convolution
-is enabled. The initial value is _const(FALSE).
-See _cmnd(ConvolutionFilter1D).
-.TP
-_const(CONVOLUTION_2D)
-_param2 returns a single boolean value indicating whether 2D convolution
-is enabled. The initial value is _const(FALSE).
-See _cmnd(ConvolutionFilter2D).
-.TP
-_const(CULL_FACE)
-_param2 returns a single boolean value indicating whether polygon culling
-is enabled. The initial value is _const(FALSE).
-See _cmnd(CullFace).
-.TP
-_const(CULL_FACE_MODE)
-_param2 returns one value,
-a symbolic constant indicating which polygon faces are to be
-culled. The initial value is _const(BACK).
-See _cmnd(CullFace).
-.TP
-_const(CURRENT_COLOR)
-_param2 returns four values:
-the red, green, blue, and alpha values of the current color.
-Integer values,
-if requested,
-are linearly mapped from the internal floating-point representation such
-that 1.0 returns the most positive representable integer value,
-and \-1.0 returns the most negative representable integer value.
-See _cmnd(Color). The initial value is (1, 1, 1, 1).
-.TP
-_const(CURRENT_INDEX)
-_param2 returns one value,
-the current color index. The initial value is 1.
-See _cmnd(Index).
-.TP
-_const(CURRENT_NORMAL)
-_param2 returns three values:
-the \f2x\fP, \f2y\fP, and \f2z\fP values of the current normal.
-Integer values,
-if requested,
-are linearly mapped from the internal floating-point representation such
-that 1.0 returns the most positive representable integer value,
-and \-1.0 returns the most negative representable integer value.
-The initial value is (0, 0, 1). See _cmnd(Normal).
-.TP
-_const(CURRENT_RASTER_COLOR)
-_param2 returns four values:
-the red, green, blue, and alpha values of the current raster position.
-Integer values,
-if requested,
-are linearly mapped from the internal floating-point representation such
-that 1.0 returns the most positive representable integer value,
-and \-1.0 returns the most negative representable integer
-value. The initial value is (1, 1, 1, 1).
-See _cmnd(RasterPos).
-.TP
-_const(CURRENT_RASTER_DISTANCE)
-_param2 returns one value,
-the distance from the eye to the current raster position. The initial
-value is 0.
-See _cmnd(RasterPos).
-.TP
-_const(CURRENT_RASTER_INDEX)
-_param2 returns one value,
-the color index of the current raster position. The initial value is 1.
-See _cmnd(RasterPos).
-.TP
-_const(CURRENT_RASTER_POSITION)
-_param2 returns four values:
-the \f2x\fP, \f2y\fP, \f2z\fP, and \f2w\fP components of the current
-raster position.
-\f2x\fP, \f2y\fP, and \f2z\fP are in window coordinates,
-and \f2w\fP is in clip coordinates. The initial value is (0, 0, 0, 1).
-See _cmnd(RasterPos).
-.TP
-_const(CURRENT_RASTER_POSITION_VALID)
-_param2 returns a single boolean value indicating whether the current
-raster position is valid. The initial value is _const(TRUE).
-See _cmnd(RasterPos).
-.TP
-_const(CURRENT_RASTER_TEXTURE_COORDS)
-_param2 returns four values:
-the \f2s\fP, \f2t\fP, \f2r\fP, and \f2q\fP
-current raster texture coordinates. The initial value is (0, 0, 0, 1).
-See _cmnd(RasterPos) and _cmnd(TexCoord).
-.TP
-_const(CURRENT_TEXTURE_COORDS)
-_param2 returns four values:
-the \f2s\fP, \f2t\fP, \f2r\fP, and \f2q\fP current texture
-coordinates. The initial value is (0, 0, 0, 1).
-See
-_cmnd(TexCoord).
-.TP
-_const(DEPTH_BIAS)
-_param2 returns one value,
-the depth bias factor used during pixel transfers. The initial value is 0.
-See _cmnd(PixelTransfer).
-.TP
-_const(DEPTH_BITS)
-_param2 returns one value,
-the number of bitplanes in the depth buffer.
-.TP
-_const(DEPTH_CLEAR_VALUE)
-_param2 returns one value,
-the value that is used to clear the depth buffer.
-Integer values,
-if requested,
-are linearly mapped from the internal floating-point representation such
-that 1.0 returns the most positive representable integer value,
-and \-1.0 returns the most negative representable integer
-value. The initial value is 1.
-See _cmnd(ClearDepth).
-.TP
-_const(DEPTH_FUNC)
-_param2 returns one value,
-the symbolic constant that indicates the depth comparison
-function. The initial value is _const(LESS).
-See _cmnd(DepthFunc).
-.TP
-_const(DEPTH_RANGE)
-_param2 returns two values:
-the near and far mapping limits for the depth buffer.
-Integer values,
-if requested,
-are linearly mapped from the internal floating-point representation such
-that 1.0 returns the most positive representable integer value,
-and \-1.0 returns the most negative representable integer
-value. The initial value is (0, 1).
-See _cmnd(DepthRange).
-.TP
-_const(DEPTH_SCALE)
-_param2 returns one value,
-the depth scale factor used during pixel transfers. The initial value is 1.
-See _cmnd(PixelTransfer).
-.TP
-_const(DEPTH_TEST)
-_param2 returns a single boolean value indicating whether depth testing
-of fragments is enabled. The initial value is _const(FALSE).
-See _cmnd(DepthFunc) and _cmnd(DepthRange).
-.TP
-_const(DEPTH_WRITEMASK)
-_param2 returns a single boolean value indicating if the depth buffer
-is enabled for writing. The initial value is _const(TRUE).
-See _cmnd(DepthMask).
-.TP
-_const(DITHER)
-_param2 returns a single boolean value indicating whether dithering of
-fragment colors and indices is enabled. The initial value is _const(TRUE).
-.TP
-_const(DOUBLEBUFFER)
-_param2 returns a single boolean value indicating whether double buffering
-is supported.
-.TP
-_const(DRAW_BUFFER)
-_param2 returns one value,
-a symbolic constant indicating which buffers are being drawn to.
-See _cmnd(DrawBuffer). The initial value is _const(BACK) if there
-are back buffers, otherwise it is _const(FRONT).
-.TP
-_const(EDGE_FLAG)
-_param2 returns a single boolean value indicating whether the current
-edge flag is _const(TRUE) or _const(FALSE). The initial value is _const(TRUE).
-See _cmnd(EdgeFlag).
-.TP
-_const(EDGE_FLAG_ARRAY)
-_param2 returns a single boolean value indicating whether the edge
-flag array is enabled. The initial value is _const(FALSE).
-See _cmnd(EdgeFlagPointer).
-.TP
-_const(EDGE_FLAG_ARRAY_STRIDE)
-_param2 returns one value,
-the byte offset between consecutive edge flags in the edge flag
-array. The initial value is 0.
-See _cmnd(EdgeFlagPointer).
-.TP
-_const(FEEDBACK_BUFFER_SIZE)
-_param2 returns one value, the size of the feedback buffer. See
-_cmnd(FeedbackBuffer).
-.TP
-_const(FEEDBACK_BUFFER_TYPE)
-_param2 returns one value, the type of the feedback buffer. See
-_cmnd(FeedbackBuffer).
-.TP
-_const(FOG)
-_param2 returns a single boolean value indicating whether fogging is
-enabled. The initial value is _const(FALSE).
-See _cmnd(Fog).
-.TP
-_const(FOG_COLOR)
-_param2 returns four values:
-the red, green, blue, and alpha components of the fog color.
-Integer values,
-if requested,
-are linearly mapped from the internal floating-point representation such
-that 1.0 returns the most positive representable integer value,
-and \-1.0 returns the most negative representable integer
-value. The initial value is (0, 0, 0, 0).
-See _cmnd(Fog).
-.TP
-_const(FOG_DENSITY)
-_param2 returns one value,
-the fog density parameter. The initial value is 1.
-See _cmnd(Fog).
-.TP
-_const(FOG_END)
-_param2 returns one value,
-the end factor for the linear fog equation. The initial value is 1.
-See _cmnd(Fog).
-.TP
-_const(FOG_HINT)
-_param2 returns one value,
-a symbolic constant indicating the mode of the fog hint. The initial value
-is _const(DONT_CARE).
-See _cmnd(Hint).
-.TP
-_const(FOG_INDEX)
-_param2 returns one value,
-the fog color index. The initial value is 0.
-See _cmnd(Fog).
-.TP
-_const(FOG_MODE)
-_param2 returns one value,
-a symbolic constant indicating which fog equation is selected. The initial
-value is _const(EXP).
-See _cmnd(Fog).
-.TP
-_const(FOG_START)
-_param2 returns one value,
-the start factor for the linear fog equation. The initial value is 0.
-See _cmnd(Fog).
-.TP
-_const(FRONT_FACE)
-_param2 returns one value,
-a symbolic constant indicating whether clockwise or counterclockwise
-polygon winding is treated as front-facing. The initial value is
-_const(CCW).
-See _cmnd(FrontFace).
-.TP
-_const(GREEN_BIAS)
-_param2 returns one value,
-the green bias factor used during pixel transfers. The initial value is 0.
-.TP
-_const(GREEN_BITS)
-_param2 returns one value,
-the number of green bitplanes in each color buffer.
-.TP
-_const(GREEN_SCALE)
-_param2 returns one value,
-the green scale factor used during pixel transfers. The initial value is 1.
-See _cmnd(PixelTransfer).
-.TP
-_const(HISTOGRAM)
-_param2 returns a single boolean value indicating whether histogram is
-enabled. The initial value is _const(FALSE).
-See _cmnd(Histogram).
-.TP
-_const(INDEX_ARRAY)
-_param2 returns a single boolean value indicating whether the color
-index array is enabled. The initial value is _const(FALSE).
-See _cmnd(IndexPointer).
-.TP
-_const(INDEX_ARRAY_STRIDE)
-_param2 returns one value,
-the byte offset between consecutive color indexes in the color index
-array. The initial value is 0.
-See _cmnd(IndexPointer).
-.TP
-_const(INDEX_ARRAY_TYPE)
-_param2 returns one value,
-the data type of indexes in the color index array. The initial value is
-_const(FLOAT).
-See _cmnd(IndexPointer).
-.TP
-_const(INDEX_BITS)
-_param2 returns one value,
-the number of bitplanes in each color index buffer.
-.TP
-_const(INDEX_CLEAR_VALUE)
-_param2 returns one value,
-the color index used to clear the color index buffers. The initial value
-is 0.
-See _cmnd(ClearIndex).
-.TP
-_const(INDEX_LOGIC_OP)
-_param2 returns a single boolean value indicating whether a fragment's index
-values are merged into the framebuffer using a logical
-operation. The initial value is _const(FALSE).
-See _cmnd(LogicOp).
-.TP
-_const(INDEX_MODE)
-_param2 returns a single boolean value indicating whether the GL is in
-color index mode (_const(TRUE)) or RGBA mode (_const(FALSE)).
-.TP
-_const(INDEX_OFFSET)
-_param2 returns one value,
-the offset added to color and stencil indices during pixel
-transfers. The initial value is 0.
-See _cmnd(PixelTransfer).
-.TP
-_const(INDEX_SHIFT)
-_param2 returns one value,
-the amount that color and stencil indices are shifted during pixel
-transfers. The initial value is 0.
-See _cmnd(PixelTransfer).
-.TP
-_const(INDEX_WRITEMASK)
-_param2 returns one value,
-a mask indicating which bitplanes of each color index buffer can be
-written. The initial value is all 1's.
-See _cmnd(IndexMask).
-.TP
-_const(LIGHT)\f2i\fP
-_param2 returns a single boolean value indicating whether the specified
-light is enabled. The initial value is _const(FALSE).
-See _cmnd(Light) and _cmnd(LightModel).
-.TP
-_const(LIGHTING)
-_param2 returns a single boolean value indicating whether lighting is
-enabled. The initial value is _const(FALSE).
-See _cmnd(LightModel).
-.TP
-_const(LIGHT_MODEL_AMBIENT)
-_param2 returns four values:
-the red, green, blue, and alpha components of the ambient intensity of
-the entire scene.
-Integer values,
-if requested,
-are linearly mapped from the internal floating-point representation such
-that 1.0 returns the most positive representable integer value,
-and \-1.0 returns the most negative representable integer
-value. The initial value is (0.2, 0.2, 0.2, 1.0).
-See _cmnd(LightModel).
-.TP
-_const(LIGHT_MODEL_COLOR_CONTROL)
-_param2 returns single enumerated value indicating whether specular
-reflection calculations are separated from normal lighting computations.
-The initial value is _const(SINGLE_COLOR).
-.TP
-_const(LIGHT_MODEL_LOCAL_VIEWER)
-_param2 returns a single boolean value indicating whether specular reflection
-calculations treat the viewer as being local to the scene. The initial
-value is _const(FALSE).
-See _cmnd(LightModel).
-.TP
-_const(LIGHT_MODEL_TWO_SIDE)
-_param2 returns a single boolean value indicating whether separate materials
-are used to compute lighting for front- and back-facing
-polygons. The initial value is _const(FALSE).
-See _cmnd(LightModel).
-.TP
-_const(LINE_SMOOTH)
-_param2 returns a single boolean value indicating whether antialiasing of
-lines is enabled. The initial value is _const(FALSE).
-See _cmnd(LineWidth).
-.TP
-_const(LINE_SMOOTH_HINT)
-_param2 returns one value,
-a symbolic constant indicating the mode of the line antialiasing
-hint. The initial value is _const(DONT_CARE).
-See _cmnd(Hint).
-.TP
-_const(LINE_STIPPLE)
-_param2 returns a single boolean value indicating whether stippling of lines
-is enabled. The initial value is _const(FALSE).
-See _cmnd(LineStipple).
-.TP
-_const(LINE_STIPPLE_PATTERN)
-_param2 returns one value,
-the 16-bit line stipple pattern. The initial value is all 1's.
-See _cmnd(LineStipple).
-.TP
-_const(LINE_STIPPLE_REPEAT)
-_param2 returns one value,
-the line stipple repeat factor. The initial value is 1.
-See _cmnd(LineStipple).
-.TP
-_const(LINE_WIDTH)
-_param2 returns one value,
-the line width as specified with _cmnd(LineWidth). The initial value is
-1.
-.TP
-_const(LINE_WIDTH_GRANULARITY)
-_param2 returns one value,
-the width difference between adjacent supported widths for antialiased lines.
-See _cmnd(LineWidth).
-.TP
-_const(LINE_WIDTH_RANGE)
-_param2 returns two values:
-the smallest and largest supported widths for antialiased
-lines.
-See _cmnd(LineWidth).
-.TP
-_const(LIST_BASE)
-_param2 returns one value,
-the base offset added to all names in arrays presented to
-_cmnd(CallLists). The initial value is 0.
-See _cmnd(ListBase).
-.TP
-_const(LIST_INDEX)
-_param2 returns one value,
-the name of the display list currently under construction.
-0 is returned if no display list is currently under
-construction. The initial value is 0.
-See _cmnd(NewList).
-.TP
-_const(LIST_MODE)
-_param2 returns one value,
-a symbolic constant indicating the construction mode of the display list
-currently under construction. The initial value is 0.
-See _cmnd(NewList).
-.TP
-_const(LOGIC_OP_MODE)
-_param2 returns one value,
-a symbolic constant indicating the selected logic operation
-mode. The initial value is _const(COPY).
-See _cmnd(LogicOp).
-.TP
-_const(MAP1_COLOR_4)
-_param2 returns a single boolean value indicating whether
-1D evaluation generates colors. The initial value is _const(FALSE).
-See _cmnd(Map1).
-.TP
-_const(MAP1_GRID_DOMAIN)
-_param2 returns two values:
-the endpoints of the 1D map's grid domain. The initial value is (0, 1).
-See _cmnd(MapGrid).
-.TP
-_const(MAP1_GRID_SEGMENTS)
-_param2 returns one value,
-the number of partitions in the 1D map's grid domain. The initial value
-is 1.
-See _cmnd(MapGrid).
-.TP
-_const(MAP1_INDEX)
-_param2 returns a single boolean value indicating whether
-1D evaluation generates color indices. The initial value is _const(FALSE).
-See _cmnd(Map1).
-.TP
-_const(MAP1_NORMAL)
-_param2 returns a single boolean value indicating whether
-1D evaluation generates normals. The initial value is _const(FALSE).
-See _cmnd(Map1).
-.TP
-_const(MAP1_TEXTURE_COORD_1)
-_param2 returns a single boolean value indicating whether
-1D evaluation generates 1D texture coordinates. The initial value is
-_const(FALSE).
-See _cmnd(Map1).
-.TP
-_const(MAP1_TEXTURE_COORD_2)
-_param2 returns a single boolean value indicating whether
-1D evaluation generates 2D texture coordinates. The initial value is
-_const(FALSE).
-See _cmnd(Map1).
-.TP
-_const(MAP1_TEXTURE_COORD_3)
-_param2 returns a single boolean value indicating whether
-1D evaluation generates 3D texture coordinates. The initial value is
-_const(FALSE).
-See _cmnd(Map1).
-.TP
-_const(MAP1_TEXTURE_COORD_4)
-_param2 returns a single boolean value indicating whether
-1D evaluation generates 4D texture coordinates. The initial value is
-_const(FALSE).
-See _cmnd(Map1).
-.TP
-_const(MAP1_VERTEX_3)
-_param2 returns a single boolean value indicating whether
-1D evaluation generates 3D vertex coordinates. The initial value is
-_const(FALSE).
-See _cmnd(Map1).
-.TP
-_const(MAP1_VERTEX_4)
-_param2 returns a single boolean value indicating whether
-1D evaluation generates 4D vertex coordinates. The initial value is
-_const(FALSE).
-See _cmnd(Map1).
-.TP
-_const(MAP2_COLOR_4)
-_param2 returns a single boolean value indicating whether
-2D evaluation generates colors. The initial value is _const(FALSE).
-See _cmnd(Map2).
-.TP
-_const(MAP2_GRID_DOMAIN)
-_param2 returns four values:
-the endpoints of the 2D map's $i$ and $j$ grid domains. The initial value
-is (0,1; 0,1).
-See _cmnd(MapGrid).
-.TP
-_const(MAP2_GRID_SEGMENTS)
-_param2 returns two values:
-the number of partitions in the 2D map's $i$ and $j$ grid
-domains. The initial value is (1,1).
-See _cmnd(MapGrid).
-.TP
-_const(MAP2_INDEX)
-_param2 returns a single boolean value indicating whether
-2D evaluation generates color indices. The initial value is _const(FALSE).
-See _cmnd(Map2).
-.TP
-_const(MAP2_NORMAL)
-_param2 returns a single boolean value indicating whether
-2D evaluation generates normals. The initial value is _const(FALSE).
-See _cmnd(Map2).
-.TP
-_const(MAP2_TEXTURE_COORD_1)
-_param2 returns a single boolean value indicating whether
-2D evaluation generates 1D texture coordinates. The initial value is
-_const(FALSE).
-See _cmnd(Map2).
-.TP
-_const(MAP2_TEXTURE_COORD_2)
-_param2 returns a single boolean value indicating whether
-2D evaluation generates 2D texture coordinates. The initial value is
-_const(FALSE).
-See _cmnd(Map2).
-.TP
-_const(MAP2_TEXTURE_COORD_3)
-_param2 returns a single boolean value indicating whether
-2D evaluation generates 3D texture coordinates. The initial value is
-_const(FALSE).
-See _cmnd(Map2).
-.TP
-_const(MAP2_TEXTURE_COORD_4)
-_param2 returns a single boolean value indicating whether
-2D evaluation generates 4D texture coordinates. The initial value is
-_const(FALSE).
-See _cmnd(Map2).
-.TP
-_const(MAP2_VERTEX_3)
-_param2 returns a single boolean value indicating whether
-2D evaluation generates 3D vertex coordinates. The initial value is
-_const(FALSE).
-See _cmnd(Map2).
-.TP
-_const(MAP2_VERTEX_4)
-_param2 returns a single boolean value indicating whether
-2D evaluation generates 4D vertex coordinates. The initial value is
-_const(FALSE).
-See _cmnd(Map2).
-.TP
-_const(MAP_COLOR)
-_param2 returns a single boolean value indicating if colors and
-color indices are to be replaced by table lookup during pixel
-transfers. The initial value is _const(FALSE).
-See _cmnd(PixelTransfer).
-.TP
-_const(MAP_STENCIL)
-_param2 returns a single boolean value indicating if stencil indices
-are to be replaced by table lookup during pixel transfers. The initial
-value is _const(FALSE).
-See _cmnd(PixelTransfer).
-.TP
-_const(MATRIX_MODE)
-_param2 returns one value,
-a symbolic constant indicating which matrix stack is currently the
-target of all matrix operations. The initial value is _const(MODELVIEW).
-See _cmnd(MatrixMode).
-.TP
-_const(MAX_3D_TEXTURE_SIZE)
-_param2 returns one value,
-a rough estimate of the largest 3D texture that the GL can handle.
-If the GL version is 1.2 or greater, use
-_const(PROXY_TEXTURE_3D) to determine if a texture is too large.
-See _cmnd(TexImage3D).
-.TP
-_const(MAX_CLIENT_ATTRIB_STACK_DEPTH)
-_param2 returns one value indicating the maximum supported depth
-of the client attribute stack.
-See _cmnd(PushClientAttrib).
-.TP
-_const(MAX_ATTRIB_STACK_DEPTH)
-_param2 returns one value,
-the maximum supported depth of the attribute stack. The value must be at least 16.
-See _cmnd(PushAttrib).
-.TP
-_const(MAX_CLIP_PLANES)
-_param2 returns one value,
-the maximum number of application-defined clipping planes. The value must be at least 6.
-See _cmnd(ClipPlane).
-.TP
-_const(MAX_COLOR_MATRIX_STACK_DEPTH)
-_param2 returns one value, the maximum supported depth of the color matrix
-stack. The value must be at least 2.
-See _cmnd(PushMatrix).
-.TP
-_const(MAX_ELEMENTS_INDICES)
-_param2 returns one value,
-the recommended maximum number of vertex array indices. See _cmnd(DrawRangeElements).
-.TP
-_const(MAX_ELEMENTS_VERTICES)
-_param2 returns one value,
-the recommended maximum number of vertex array vertices. See _cmnd(DrawRangeElements).
-.TP
-_const(MAX_EVAL_ORDER)
-_param2 returns one value,
-the maximum equation order supported by 1D and 2D
-evaluators. The value must be at least 8.
-See _cmnd(Map1) and _cmnd(Map2).
-.TP
-_const(MAX_LIGHTS)
-_param2 returns one value,
-the maximum number of lights. The value must be at least 8.
-See _cmnd(Light).
-.TP
-_const(MAX_LIST_NESTING)
-_param2 returns one value,
-the maximum recursion depth allowed during display-list
-traversal. The value must be at least 64.
-See _cmnd(CallList).
-.TP
-_const(MAX_MODELVIEW_STACK_DEPTH)
-_param2 returns one value,
-the maximum supported depth of the modelview matrix stack. The value must
-be at least 32.
-See _cmnd(PushMatrix).
-.TP
-_const(MAX_NAME_STACK_DEPTH)
-_param2 returns one value,
-the maximum supported depth of the selection name stack. The value must be at least 64.
-See _cmnd(PushName).
-.TP
-_const(MAX_PIXEL_MAP_TABLE)
-_param2 returns one value,
-the maximum supported size of a _cmnd(PixelMap) lookup table.
-The value must be at least 32.
-See _cmnd(PixelMap).
-.TP
-_const(MAX_PROJECTION_STACK_DEPTH)
-_param2 returns one value,
-the maximum supported depth of the projection matrix stack. The value must be at least 2.
-See _cmnd(PushMatrix).
-.TP
-_const(MAX_TEXTURE_SIZE)
-_param2 returns one value.
-The value gives a rough estimate of the largest texture that
-the GL can handle.
-If the GL version is 1.1 or greater, use
-_const(PROXY_TEXTURE_1D) or _const(PROXY_TEXTURE_2D)
-to determine if a texture is too large.
-See _cmnd(TexImage1D) and _cmnd(TexImage2D).
-.TP
-_const(MAX_TEXTURE_STACK_DEPTH)
-_param2 returns one value,
-the maximum supported depth of the texture matrix stack. The value must be at least 2.
-See _cmnd(PushMatrix).
-.TP
-_arbconst(MAX_TEXTURE_UNITS)
-_param2 returns a single value indicating the number of texture units
-supported. The value must be at least 1.
-See _cmnd(ActiveTextureARB).
-.TP
-_const(MAX_VIEWPORT_DIMS)
-_param2 returns two values:
-the maximum supported width and height of the viewport.
-These must be at least as large as the visible dimensions of the display
-being rendered to.
-See _cmnd(Viewport).
-.TP
-_const(MINMAX)
-_param2 returns a single boolean value indicating whether pixel minmax
-values are computed. The initial value is _const(FALSE).
-See _cmnd(Minmax).
-.TP
-_const(MODELVIEW_MATRIX)
-_param2 returns sixteen values:
-the modelview matrix on the top of the modelview matrix stack. Initially
-this matrix is the identity matrix. See _cmnd(PushMatrix).
-.TP
-_const(MODELVIEW_STACK_DEPTH)
-_param2 returns one value,
-the number of matrices on the modelview matrix stack.
-The initial value is 1.
-See _cmnd(PushMatrix).
-.TP
-_const(NAME_STACK_DEPTH)
-_param2 returns one value,
-the number of names on the selection name stack. The initial value is 0.
-See _cmnd(PushName).
-.TP
-_const(NORMAL_ARRAY)
-_param2 returns a single boolean value, indicating whether the normal
-array is enabled. The initial value is _const(FALSE).
-See _cmnd(NormalPointer).
-.TP
-_const(NORMAL_ARRAY_STRIDE)
-_param2 returns one value,
-the byte offset between consecutive normals in the normal
-array. The initial value is 0.
-See _cmnd(NormalPointer).
-.TP
-_const(NORMAL_ARRAY_TYPE)
-_param2 returns one value,
-the data type of each coordinate in the normal array. The initial value is
-_const(FLOAT).
-See _cmnd(NormalPointer).
-.TP
-_const(NORMALIZE)
-_param2 returns a single boolean value indicating whether normals are
-automatically scaled to unit length after they have been transformed to
-eye coordinates. The initial value is _const(FALSE).
-See _cmnd(Normal).
-.TP
-_const(PACK_ALIGNMENT)
-_param2 returns one value,
-the byte alignment used for writing pixel data to memory. The initial
-value is 4.
-See _cmnd(PixelStore).
-.TP
-_const(PACK_IMAGE_HEIGHT)
-_param2 returns one value,
-the image height used for writing pixel data to memory. The initial
-value is 0.
-See _cmnd(PixelStore).
-.TP
-_const(PACK_LSB_FIRST)
-_param2 returns a single boolean value indicating whether single-bit
-pixels being written to memory are written first to the least significant
-bit of each unsigned byte. The initial value is _const(FALSE).
-See _cmnd(PixelStore).
-.TP
-_const(PACK_ROW_LENGTH)
-_param2 returns one value,
-the row length used for writing pixel data to memory. The initial value is
-0.
-See _cmnd(PixelStore).
-.TP
-_const(PACK_SKIP_IMAGES)
-_param2 returns one value,
-the number of pixel images skipped before the first pixel is written
-into memory. The initial value is 0.
-See _cmnd(PixelStore).
-.TP
-_const(PACK_SKIP_PIXELS)
-_param2 returns one value,
-the number of pixel locations skipped before the first pixel is written
-into memory. The initial value is 0.
-See _cmnd(PixelStore).
-.TP
-_const(PACK_SKIP_ROWS)
-_param2 returns one value,
-the number of rows of pixel locations skipped before the first pixel is written
-into memory. The initial value is 0.
-See _cmnd(PixelStore).
-.TP
-_const(PACK_SWAP_BYTES)
-_param2 returns a single boolean value indicating whether the bytes of
-two-byte and four-byte pixel indices and components are swapped before being
-written to memory. The initial value is _const(FALSE).
-See _cmnd(PixelStore).
-.TP
-_const(PERSPECTIVE_CORRECTION_HINT)
-_param2 returns one value,
-a symbolic constant indicating the mode of the perspective correction
-hint. The initial value is _const(DONT_CARE).
-See _cmnd(Hint).
-.TP
-_const(PIXEL_MAP_A_TO_A_SIZE)
-_param2 returns one value,
-the size of the alpha-to-alpha pixel translation table.
-The initial value is 1.
-See _cmnd(PixelMap).
-.TP
-_const(PIXEL_MAP_B_TO_B_SIZE)
-_param2 returns one value,
-the size of the blue-to-blue pixel translation table.
-The initial value is 1.
-See _cmnd(PixelMap).
-.TP
-_const(PIXEL_MAP_G_TO_G_SIZE)
-_param2 returns one value,
-the size of the green-to-green pixel translation table.
-The initial value is 1.
-See _cmnd(PixelMap).
-.TP
-_const(PIXEL_MAP_I_TO_A_SIZE)
-_param2 returns one value,
-the size of the index-to-alpha pixel translation table.
-The initial value is 1.
-See _cmnd(PixelMap).
-.TP
-_const(PIXEL_MAP_I_TO_B_SIZE)
-_param2 returns one value,
-the size of the index-to-blue pixel translation table.
-The initial value is 1.
-See _cmnd(PixelMap).
-.TP
-_const(PIXEL_MAP_I_TO_G_SIZE)
-_param2 returns one value,
-the size of the index-to-green pixel translation table.
-The initial value is 1.
-See _cmnd(PixelMap).
-.TP
-_const(PIXEL_MAP_I_TO_I_SIZE)
-_param2 returns one value,
-the size of the index-to-index pixel translation table.
-The initial value is 1.
-See _cmnd(PixelMap).
-.TP
-_const(PIXEL_MAP_I_TO_R_SIZE)
-_param2 returns one value,
-the size of the index-to-red pixel translation table.
-The initial value is 1.
-See _cmnd(PixelMap).
-.TP
-_const(PIXEL_MAP_R_TO_R_SIZE)
-_param2 returns one value,
-the size of the red-to-red pixel translation table.
-The initial value is 1.
-See _cmnd(PixelMap).
-.TP
-_const(PIXEL_MAP_S_TO_S_SIZE)
-_param2 returns one value,
-the size of the stencil-to-stencil pixel translation table.
-The initial value is 1.
-See _cmnd(PixelMap).
-.TP
-_const(POINT_SIZE)
-_param2 returns one value,
-the point size as specified by _cmnd(PointSize). The initial value is 1.
-.TP
-_const(POINT_SIZE_GRANULARITY)
-_param2 returns one value,
-the size difference between adjacent supported sizes for antialiased points.
-See _cmnd(PointSize).
-.TP
-_const(POINT_SIZE_RANGE)
-_param2 returns two values:
-the smallest and largest supported sizes for antialiased
-points. The smallest size must be at most 1, and the largest size must
-be at least 1.
-See _cmnd(PointSize).
-.TP
-_const(POINT_SMOOTH)
-_param2 returns a single boolean value indicating whether antialiasing of
-points is enabled. The initial value is _const(FALSE).
-See _cmnd(PointSize).
-.TP
-_const(POINT_SMOOTH_HINT)
-_param2 returns one value,
-a symbolic constant indicating the mode of the point antialiasing
-hint. The initial value is _const(DONT_CARE).
-See _cmnd(Hint).
-.TP
-_const(POLYGON_MODE)
-_param2 returns two values:
-symbolic constants indicating whether front-facing and back-facing polygons
-are rasterized as points, lines, or filled polygons. The initial value is
-_const(FILL).
-See _cmnd(PolygonMode).
-.TP
-_const(POLYGON_OFFSET_FACTOR)
-_param2 returns one value,
-the scaling factor used to determine the variable offset that is added
-to the depth value of each fragment generated when a polygon is
-rasterized. The initial value is 0.
-See _cmnd(PolygonOffset).
-.TP
-_const(POLYGON_OFFSET_UNITS)
-_param2 returns one value.
-This value is multiplied by an implementation-specific value and then
-added to the depth value of each fragment
-generated when a polygon is rasterized. The initial value is 0.
-See _cmnd(PolygonOffset).
-.TP
-_const(POLYGON_OFFSET_FILL)
-_param2 returns a single boolean value indicating whether polygon offset
-is enabled for polygons in fill mode. The initial value is _const(FALSE).
-See _cmnd(PolygonOffset).
-.TP
-_const(POLYGON_OFFSET_LINE)
-_param2 returns a single boolean value indicating whether polygon offset
-is enabled for polygons in line mode. The initial value is _const(FALSE).
-See _cmnd(PolygonOffset).
-.TP
-_const(POLYGON_OFFSET_POINT)
-_param2 returns a single boolean value indicating whether polygon offset
-is enabled for polygons in point mode. The initial value is _const(FALSE).
-See _cmnd(PolygonOffset).
-.TP
-_const(POLYGON_SMOOTH)
-_param2 returns a single boolean value indicating whether antialiasing of
-polygons is enabled. The initial value is _const(FALSE).
-See _cmnd(PolygonMode).
-.TP
-_const(POLYGON_SMOOTH_HINT)
-_param2 returns one value,
-a symbolic constant indicating the mode of the polygon antialiasing
-hint. The initial value is _const(DONT_CARE).
-See _cmnd(Hint).
-.TP
-_const(POLYGON_STIPPLE)
-_param2 returns a single boolean value indicating whether polygon
-stippling is enabled. The initial value is _const(FALSE).
-See _cmnd(PolygonStipple).
-.TP
-_const(POST_COLOR_MATRIX_COLOR_TABLE)
-_param2 returns a single boolean value indicating whether post color
-matrix transformation lookup is enabled. The initial value is
-_const(FALSE).
-See _cmnd(ColorTable).
-.TP
-_const(POST_COLOR_MATRIX_RED_BIAS)
-_param2 returns one value, the red bias factor applied to RGBA fragments
-after color matrix transformations. The initial value is 0.
-See _cmnd(PixelTransfer).
-.TP
-_const(POST_COLOR_MATRIX_GREEN_BIAS)
-_param2 returns one value, the green bias factor applied to RGBA fragments
-after color matrix transformations. The initial value is 0.
-See _cmnd(PixelTransfer)
-.TP
-_const(POST_COLOR_MATRIX_BLUE_BIAS)
-_param2 returns one value, the blue bias factor applied to RGBA fragments
-after color matrix transformations. The initial value is 0.
-See _cmnd(PixelTransfer).
-.TP
-_const(POST_COLOR_MATRIX_ALPHA_BIAS)
-_param2 returns one value, the alpha bias factor applied to RGBA fragments
-after color matrix transformations. The initial value is 0.
-See _cmnd(PixelTransfer).
-.TP
-_const(POST_COLOR_MATRIX_RED_SCALE)
-_param2 returns one value, the red scale factor applied to RGBA fragments
-after color matrix transformations. The initial value is 1.
-See _cmnd(PixelTransfer).
-.TP
-_const(POST_COLOR_MATRIX_GREEN_SCALE)
-_param2 returns one value, the green scale factor applied to RGBA fragments
-after color matrix transformations. The initial value is 1.
-See _cmnd(PixelTransfer).
-.TP
-_const(POST_COLOR_MATRIX_BLUE_SCALE)
-_param2 returns one value, the blue scale factor applied to RGBA fragments
-after color matrix transformations. The initial value is 1.
-See _cmnd(PixelTransfer).
-.TP
-_const(POST_COLOR_MATRIX_ALPHA_SCALE)
-_param2 returns one value, the alpha scale factor applied to RGBA fragments
-after color matrix transformations. The initial value is 1.
-See _cmnd(PixelTransfer).
-.TP
-_const(POST_CONVOLUTION_COLOR_TABLE)
-_param2 returns a single boolean value indicating whether post convolution
-lookup is enabled. The initial value is _const(FALSE).
-See _cmnd(ColorTable).
-.TP
-_const(POST_CONVOLUTION_RED_BIAS)
-_param2 returns one value, the red bias factor applied to RGBA fragments
-after convolution. The initial value is 0.
-See _cmnd(PixelTransfer).
-.TP
-_const(POST_CONVOLUTION_GREEN_BIAS)
-_param2 returns one value, the green bias factor applied to RGBA fragments
-after convolution. The initial value is 0.
-See _cmnd(PixelTransfer).
-.TP
-_const(POST_CONVOLUTION_BLUE_BIAS)
-_param2 returns one value, the blue bias factor applied to RGBA fragments
-after convolution. The initial value is 0.
-See _cmnd(PixelTransfer).
-.TP
-_const(POST_CONVOLUTION_ALPHA_BIAS)
-_param2 returns one value, the alpha bias factor applied to RGBA fragments
-after convolution. The initial value is 0.
-See _cmnd(PixelTransfer).
-.TP
-_const(POST_CONVOLUTION_RED_SCALE)
-_param2 returns one value, the red scale factor applied to RGBA fragments
-after convolution. The initial value is 1.
-See _cmnd(PixelTransfer).
-.TP
-_const(POST_CONVOLUTION_GREEN_SCALE)
-_param2 returns one value, the green scale factor applied to RGBA fragments
-after convolution. The initial value is 1.
-See _cmnd(PixelTransfer).
-.TP
-_const(POST_CONVOLUTION_BLUE_SCALE)
-_param2 returns one value, the blue scale factor applied to RGBA fragments
-after convolution. The initial value is 1.
-See _cmnd(PixelTransfer).
-.TP
-_const(POST_CONVOLUTION_ALPHA_SCALE)
-_param2 returns one value, the alpha scale factor applied to RGBA fragments
-after convolution. The initial value is 1.
-See _cmnd(PixelTransfer).
-.TP
-_const(PROJECTION_MATRIX)
-_param2 returns sixteen values:
-the projection matrix on the top of the projection matrix
-stack. Initially this matrix is the identity matrix.
-See _cmnd(PushMatrix).
-.TP
-_const(PROJECTION_STACK_DEPTH)
-_param2 returns one value,
-the number of matrices on the projection matrix stack.
-The initial value is 1.
-See _cmnd(PushMatrix).
-.TP
-_const(READ_BUFFER)
-_param2 returns one value,
-a symbolic constant indicating which color buffer is selected for
-reading. The initial value is _const(BACK) if there is a back buffer,
-otherwise it is _const(FRONT).
-See
-_cmnd(ReadPixels) and _cmnd(Accum).
-.TP
-_const(RED_BIAS)
-_param2 returns one value,
-the red bias factor used during pixel transfers. The initial value is 0.
-.TP
-_const(RED_BITS)
-_param2 returns one value,
-the number of red bitplanes in each color buffer.
-.TP
-_const(RED_SCALE)
-_param2 returns one value,
-the red scale factor used during pixel transfers. The initial value is 1.
-See _cmnd(PixelTransfer).
-.TP
-_const(RENDER_MODE)
-_param2 returns one value,
-a symbolic constant indicating whether the GL is in render,
-select,
-or feedback mode. The initial value is _const(RENDER).
-See _cmnd(RenderMode).
-.TP
-_const(RESCALE_NORMAL)
-_param2 returns single boolean value
-indicating whether normal rescaling is enabled.
-See _cmnd(Enable).
-.TP
-_const(RGBA_MODE)
-_param2 returns a single boolean value indicating whether the GL is in RGBA
-mode (true) or color index mode (false).
-See _cmnd(Color).
-.TP
-_const(SCISSOR_BOX)
-_param2 returns four values:
-the $x$ and $y$ window coordinates of the scissor box,
-followed by its width and height.
-Initially the $x$ and $y$ window coordinates are both 0 and the
-width and height are set to the size of the window.
-See _cmnd(Scissor).
-.TP
-_const(SCISSOR_TEST)
-_param2 returns a single boolean value indicating whether scissoring is
-enabled. The initial value is _const(FALSE).
-See _cmnd(Scissor).
-.TP
-_const(SELECTION_BUFFER_SIZE)
-_param2 return one value,
-the size of the selection buffer.
-See _cmnd(SelectBuffer).
-.TP
-_const(SEPARABLE_2D)
-_param2 returns a single boolean value indicating whether 2D separable
-convolution is enabled. The initial value is _const(FALSE).
-See _cmnd(SeparableFilter2D).
-.TP
-_const(SHADE_MODEL)
-_param2 returns one value,
-a symbolic constant indicating whether the shading mode is flat or
-smooth. The initial value is _const(SMOOTH).
-See _cmnd(ShadeModel).
-.TP
-_const(SMOOTH_LINE_WIDTH_RANGE)
-_param2 returns two values,
-the smallest and largest supported widths for antialiased lines.
-See _cmnd(LineWidth).
-.TP
-_const(SMOOTH_LINE_WIDTH_GRANULARITY)
-_param2 returns one value,
-the granularity of widths for antialiased lines.
-See _cmnd(LineWidth).
-.TP
-_const(SMOOTH_POINT_SIZE_RANGE)
-_param2 returns two values,
-the smallest and largest supported widths for antialiased points.
-See _cmnd(PointSize).
-.TP
-_const(SMOOTH_POINT_SIZE_GRANULARITY)
-_param2 returns one value,
-the granularity of sizes for antialiased points.
-See _cmnd(PointSize).
-.TP
-_const(STENCIL_BITS)
-_param2 returns one value,
-the number of bitplanes in the stencil buffer.
-.TP
-_const(STENCIL_CLEAR_VALUE)
-_param2 returns one value,
-the index to which the stencil bitplanes are cleared. The initial value is
-0.
-See _cmnd(ClearStencil).
-.TP
-_const(STENCIL_FAIL)
-_param2 returns one value,
-a symbolic constant indicating what action is taken when the stencil
-test fails. The initial value is _const(KEEP).
-See _cmnd(StencilOp).
-.TP
-_const(STENCIL_FUNC)
-_param2 returns one value,
-a symbolic constant indicating what function is used to compare the
-stencil reference value with the stencil buffer value. The initial value
-is _const(ALWAYS).
-See _cmnd(StencilFunc).
-.TP
-_const(STENCIL_PASS_DEPTH_FAIL)
-_param2 returns one value,
-a symbolic constant indicating what action is taken when the stencil
-test passes,
-but the depth test fails. The initial value is _const(KEEP).
-See _cmnd(StencilOp).
-.TP
-_const(STENCIL_PASS_DEPTH_PASS)
-_param2 returns one value,
-a symbolic constant indicating what action is taken when the stencil
-test passes and the depth test passes. The initial value is _const(KEEP).
-See _cmnd(StencilOp).
-.TP
-_const(STENCIL_REF)
-_param2 returns one value,
-the reference value that is compared with the contents of the stencil
-buffer. The initial value is 0.
-See _cmnd(StencilFunc).
-.TP
-_const(STENCIL_TEST)
-_param2 returns a single boolean value indicating whether stencil testing
-of fragments is enabled. The initial value is _const(FALSE).
-See _cmnd(StencilFunc) and _cmnd(StencilOp).
-.TP
-_const(STENCIL_VALUE_MASK)
-_param2 returns one value,
-the mask that is used to mask both the stencil reference value and the
-stencil buffer value before they are compared. The initial value is all 1's.
-See _cmnd(StencilFunc).
-.TP
-_const(STENCIL_WRITEMASK)
-_param2 returns one value,
-the mask that controls writing of the stencil bitplanes. The initial value
-is all 1's. See _cmnd(StencilMask).
-.TP
-_const(STEREO)
-_param2 returns a single boolean value indicating whether stereo buffers
-(left and right) are supported.
-.TP
-_const(SUBPIXEL_BITS)
-_param2 returns one value,
-an estimate of the number of bits of subpixel resolution that are used to
-position rasterized geometry in window coordinates. The initial value
-.br
-is 4.
-.TP
-_const(TEXTURE_1D)
-_param2 returns a single boolean value indicating whether 1D texture
-mapping is enabled. The initial value is _const(FALSE).
-See _cmnd(TexImage1D).
-.TP
-_const(TEXTURE_BINDING_1D)
-_param2 returns a single value, the name of the texture
-currently bound to the target _const(TEXTURE_1D). The initial value is 0.
-See _cmnd(BindTexture).
-.TP
-_const(TEXTURE_2D)
-_param2 returns a single boolean value indicating whether 2D texture
-mapping is enabled. The initial value is _const(FALSE).
-See _cmnd(TexImage2D).
-.TP
-_const(TEXTURE_BINDING_2D)
-_param2 returns a single value, the name of the texture
-currently bound to the target _const(TEXTURE_2D). The initial value is 0.
-See _cmnd(BindTexture).
-.TP
-_const(TEXTURE_3D)
-_param2 returns a single boolean value indicating whether 3D texture
-mapping is enabled. The initial value is _const(FALSE).
-See _cmnd(TexImage3D).
-.TP
-_const(TEXTURE_BINDING_3D)
-_param2 returns a single value, the name of the texture
-currently bound to the target _const(TEXTURE_3D). The initial value is 0.
-See _cmnd(BindTexture).
-.TP
-_const(TEXTURE_COORD_ARRAY)
-_param2 returns a single boolean value indicating whether the texture
-coordinate array is enabled. The initial value is _const(FALSE).
-See _cmnd(TexCoordPointer).
-.TP
-_const(TEXTURE_COORD_ARRAY_SIZE)
-_param2 returns one value,
-the number of coordinates per element in the texture coordinate
-array. The initial value is 4.
-See _cmnd(TexCoordPointer).
-.TP
-_const(TEXTURE_COORD_ARRAY_STRIDE)
-_param2 returns one value,
-the byte offset between consecutive elements in the texture coordinate
-array. The initial value is 0.
-See _cmnd(TexCoordPointer).
-.TP
-_const(TEXTURE_COORD_ARRAY_TYPE)
-_param2 returns one value,
-the data type of the coordinates in the texture coordinate
-array. The initial value is _const(FLOAT).
-See _cmnd(TexCoordPointer).
-.TP
-_const(TEXTURE_GEN_Q)
-_param2 returns a single boolean value indicating whether automatic generation
-of the \f2q\fP texture coordinate is enabled. The initial value is _const(FALSE).
-See _cmnd(TexGen).
-.TP
-_const(TEXTURE_GEN_R)
-_param2 returns a single boolean value indicating whether automatic generation
-of the \f2r\fP texture coordinate is enabled. The initial value is _const(FALSE).
-See _cmnd(TexGen).
-.TP
-_const(TEXTURE_GEN_S)
-_param2 returns a single boolean value indicating whether automatic generation
-of the \f2S\fP texture coordinate is enabled. The initial value is _const(FALSE).
-See _cmnd(TexGen).
-.TP
-_const(TEXTURE_GEN_T)
-_param2 returns a single boolean value indicating whether automatic generation
-of the T texture coordinate is enabled. The initial value is _const(FALSE).
-See _cmnd(TexGen).
-.TP
-_const(TEXTURE_MATRIX)
-_param2 returns sixteen values:
-the texture matrix on the top of the texture matrix stack. Initially this
-matrix is the identity matrix.
-See _cmnd(PushMatrix).
-.TP
-_const(TEXTURE_STACK_DEPTH)
-_param2 returns one value,
-the number of matrices on the texture matrix stack.
-The initial value is 1.
-See _cmnd(PushMatrix).
-.TP
-_const(UNPACK_ALIGNMENT)
-_param2 returns one value,
-the byte alignment used for reading pixel data from memory. The initial
-value is 4.
-See _cmnd(PixelStore).
-.TP
-_const(UNPACK_IMAGE_HEIGHT)
-_param2 returns one value,
-the image height used for reading pixel data from memory. The initial
-is 0.
-See _cmnd(PixelStore).
-.TP
-_const(UNPACK_LSB_FIRST)
-_param2 returns a single boolean value indicating whether single-bit
-pixels being read from memory are read first from the least significant
-bit of each unsigned byte. The initial value is _const(FALSE).
-See _cmnd(PixelStore).
-.TP
-_const(UNPACK_ROW_LENGTH)
-_param2 returns one value,
-the row length used for reading pixel data from memory. The initial value
-is 0.
-See _cmnd(PixelStore).
-.TP
-_const(UNPACK_SKIP_IMAGES)
-_param2 returns one value,
-the number of pixel images skipped before the first pixel is read
-from memory. The initial value is 0.
-See _cmnd(PixelStore).
-.TP
-_const(UNPACK_SKIP_PIXELS)
-_param2 returns one value,
-the number of pixel locations skipped before the first pixel is read
-from memory. The initial value is 0.
-See _cmnd(PixelStore).
-.TP
-_const(UNPACK_SKIP_ROWS)
-_param2 returns one value,
-the number of rows of pixel locations skipped before the first pixel is read
-from memory. The initial value is 0.
-See _cmnd(PixelStore).
-.TP
-_const(UNPACK_SWAP_BYTES)
-_param2 returns a single boolean value indicating whether the bytes of
-two-byte and four-byte pixel indices and components are swapped after being
-read from memory. The initial value is _const(FALSE).
-See _cmnd(PixelStore).
-.TP
-_const(VERTEX_ARRAY)
-_param2 returns a single boolean value indicating whether the vertex
-array is enabled. The initial value is _const(FALSE).
-See _cmnd(VertexPointer).
-.TP
-_const(VERTEX_ARRAY_SIZE)
-_param2 returns one value,
-the number of coordinates per vertex in the vertex array. The initial
-value is 4.
-See _cmnd(VertexPointer).
-.TP
-_const(VERTEX_ARRAY_STRIDE)
-_param2 returns one value,
-the byte offset between consecutive vertices in the vertex
-array. The initial value is 0.
-See _cmnd(VertexPointer).
-.TP
-_const(VERTEX_ARRAY_TYPE)
-_param2 returns one value,
-the data type of each coordinate in the vertex array. The initial value is
-_const(FLOAT).
-See _cmnd(VertexPointer).
-.TP
-_const(VIEWPORT)
-_param2 returns four values:
-the $x$ and $y$ window coordinates of the viewport,
-followed by its width and height.
-Initially the $x$ and $y$ window coordinates are both set to 0,
-and the width and height are set to the width and height of the window into
-which the GL will do its rendering.
-See _cmnd(Viewport).
-.TP
-_const(ZOOM_X)
-_param2 returns one value,
-the $x$ pixel zoom factor. The initial value is 1.
-See _cmnd(PixelZoom).
-.TP
-_const(ZOOM_Y)
-_param2 returns one value,
-the $y$ pixel zoom factor. The initial value is 1.
-See _cmnd(PixelZoom).
-.P
-Many of the boolean parameters can also be queried more easily using
-_cmnd(IsEnabled).
-.SH NOTES
-_const(COLOR_LOGIC_OP),
-_const(COLOR_ARRAY),
-_const(COLOR_ARRAY_SIZE),
-_const(COLOR_ARRAY_STRIDE),
-_const(COLOR_ARRAY_TYPE),
-_const(EDGE_FLAG_ARRAY),
-_const(EDGE_FLAG_ARRAY_STRIDE),
-_const(INDEX_ARRAY),
-_const(INDEX_ARRAY_STRIDE),
-_const(INDEX_ARRAY_TYPE),
-_const(INDEX_LOGIC_OP),
-_const(NORMAL_ARRAY),
-_const(NORMAL_ARRAY_STRIDE),
-_const(NORMAL_ARRAY_TYPE),
-_const(POLYGON_OFFSET_UNITS),
-_const(POLYGON_OFFSET_FACTOR),
-_const(POLYGON_OFFSET_FILL),
-_const(POLYGON_OFFSET_LINE),
-_const(POLYGON_OFFSET_POINT),
-_const(TEXTURE_COORD_ARRAY),
-_const(TEXTURE_COORD_ARRAY_SIZE),
-_const(TEXTURE_COORD_ARRAY_STRIDE),
-_const(TEXTURE_COORD_ARRAY_TYPE),
-_const(VERTEX_ARRAY),
-_const(VERTEX_ARRAY_SIZE),
-_const(VERTEX_ARRAY_STRIDE), and
-_const(VERTEX_ARRAY_TYPE)
-are available only if the GL version is 1.1 or greater.
-.P
-_const(ALIASED_POINT_SIZE_RANGE),
-_const(ALIASED_POINT_SIZE_GRANULARITY),
-_const(FEEDBACK_BUFFER_SIZE),
-_const(FEEDBACK_BUFFER_TYPE),
-_const(LIGHT_MODEL_AMBIENT),
-_const(LIGHT_MODEL_COLOR_CONTROL),
-_const(MAX_3D_TEXTURE_SIZE),
-_const(MAX_ELEMENTS_INDICES),
-_const(MAX_ELEMENTS_VERTICES),
-_const(PACK_IMAGE_HEIGHT),
-_const(PACK_SKIP_IMAGES),
-_const(RESCALE_NORMAL),
-_const(SELECTION_BUFFER_SIZE),
-_const(SMOOTH_LINE_WIDTH_GRANULARITY),
-_const(SMOOTH_LINE_WIDTH_RANGE),
-_const(SMOOTH_POINT_SIZE_GRANULARITY),
-_const(SMOOTH_POINT_SIZE_RANGE),
-_const(TEXTURE_3D),
-_const(TEXTURE_BINDING_3D),
-_const(UNPACK_IMAGE_HEIGHT), and
-_const(UNPACK_SKIP_IMAGES)
-are available only if the GL version is 1.2 or greater.
-.P
-_const(LINE_WIDTH_GRANULARITY) was deprecated in GL version 1.2. Its
-functionality was replaced by _const(SMOOTH_LINE_WIDTH_GRANULARITY).
-.P
-_const(LINE_WIDTH_RANGE) was deprecated in GL version 1.2. Its
-functionality was replaced by _const(SMOOTH_LINE_WIDTH_RANGE).
-.P
-_const(POINT_SIZE_GRANULARITY) was deprecated in GL version 1.2. Its
-functionality was replaced by _const(SMOOTH_POINT_SIZE_GRANULARITY).
-.P
-_const(POINT_SIZE_RANGE) was deprecated in GL version 1.2. Its
-functionality was replaced by _const(SMOOTH_POINT_SIZE_RANGE).
-.P
-_const(BLEND_COLOR),
-_const(BLEND_EQUATION),
-_const(COLOR_MATRIX),
-_const(COLOR_MATRIX_STACK_DEPTH),
-_const(COLOR_TABLE),
-_const(CONVOLUTION_1D),
-_const(CONVOLUTION_2D),
-_const(HISTOGRAM),
-_const(MAX_COLOR_MATRIX_STACK_DEPTH),
-_const(MINMAX),
-_const(POST_COLOR_MATRIX_COLOR_TABLE),
-_const(POST_COLOR_MATRIX_RED_BIAS),
-_const(POST_COLOR_MATRIX_GREEN_BIAS),
-_const(POST_COLOR_MATRIX_BLUE_BIAS),
-_const(POST_COLOR_MATRIX_ALPHA_BIAS),
-_const(POST_COLOR_MATRIX_RED_SCALE),
-_const(POST_COLOR_MATRIX_GREEN_SCALE),
-_const(POST_COLOR_MATRIX_BLUE_SCALE),
-_const(POST_COLOR_MATRIX_ALPHA_SCALE),
-_const(POST_CONVOLUTION_COLOR_TABLE),
-_const(POST_CONVOLUTION_RED_BIAS),
-_const(POST_CONVOLUTION_GREEN_BIAS),
-_const(POST_CONVOLUTION_BLUE_BIAS),
-_const(POST_CONVOLUTION_ALPHA_BIAS),
-_const(POST_CONVOLUTION_RED_SCALE),
-_const(POST_CONVOLUTION_GREEN_SCALE),
-_const(POST_CONVOLUTION_BLUE_SCALE),
-_const(POST_CONVOLUTION_ALPHA_SCALE), and
-_const(SEPARABLE_2D)
-are available only if _arbstring(imaging) is returned from _cmnd(Get)
-when called with the argument _const(EXTENSIONS).
-.P
-_arbconst(ACTIVE_TEXTURE),
-_arbconst(CLIENT_ACTIVE_TEXTURE), and
-_arbconst(MAX_TEXTURE_UNITS) are available only if
-_arbstring(multitexture) is returned from _cmnd(Get) when called with the
-argument _const(EXTENSIONS).
-.P
-When the _arbstring(multitexture) extension is supported, the following
-parameters return the associated value for the active texture unit:
-_const(CURRENT_RASTER_TEXTURE_COORDS),
-_const(TEXTURE_1D), _const(TEXTURE_BINDING_1D),
-_const(TEXTURE_2D), _const(TEXTURE_BINDING_2D),
-_const(TEXTURE_3D), _const(TEXTURE_BINDING_3D),
-_const(TEXTURE_GEN_S),
-_const(TEXTURE_GEN_T),
-_const(TEXTURE_GEN_R),
-_const(TEXTURE_GEN_Q),
-_const(TEXTURE_MATRIX), and
-_const(TEXTURE_STACK_DEPTH).
-Likewise, the following parameters return the associated value for the
-active client texture unit:
-_const(TEXTURE_COORD_ARRAY),
-_const(TEXTURE_COORD_ARRAY_SIZE),
-_const(TEXTURE_COORD_ARRAY_STRIDE),
-_const(TEXTURE_COORD_ARRAY_TYPE).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.P
-.SH SEE ALSO
-_cmnd(GetClipPlane),
-_cmnd(GetColorTable),
-_cmnd(GetColorTableParameter),
-_cmnd(GetConvolutionFilter),
-_cmnd(GetConvolutionParameter),
-_cmnd(GetError),
-_cmnd(GetHistogram),
-_cmnd(GetHistogramParameter),
-_cmnd(GetLight),
-_cmnd(GetMap),
-_cmnd(GetMaterial),
-_cmnd(GetMinmax),
-_cmnd(GetMinmaxParameter),
-_cmnd(GetPixelMap),
-_cmnd(GetPointerv),
-_cmnd(GetPolygonStipple),
-_cmnd(GetSeparableFilter),
-_cmnd(GetString),
-_cmnd(GetTexEnv),
-_cmnd(GetTexGen),
-_cmnd(GetTexImage),
-_cmnd(GetTexLevelParameter),
-_cmnd(GetTexParameter),
-_cmnd(IsEnabled)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getclipplane.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/getclipplane.gl
deleted file mode 100755
index d52878f61..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getclipplane.gl
+++ /dev/null
@@ -1,67 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GetClipPlane,return the coefficients of the specified clipping plane)
-_names(GetClipPlane)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies a clipping plane.
-The number of clipping planes depends on the implementation,
-but at least six clipping planes are supported.
-They are identified by symbolic names of the form _const(CLIP_PLANE)$i$
-where 0 \(<= $ i $ < _const(MAX_CLIP_PLANES).
-_phead(_param2)
-Returns four double-precision values that are the coefficients of the plane equation of _param1 in eye coordinates.
-The initial value is (0, 0, 0, 0).
-.SH DESCRIPTION
-_cmnd returns in _param2 the four coefficients of the plane equation
-for _param1.
-.SH NOTES
-It is always the case that _const(CLIP_PLANE)$i$ = _const(CLIP_PLANE0) + $i$.
-.P
-If an error is generated,
-no change is made to the contents of _param2.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(ClipPlane)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getcolortable.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/getcolortable.gl
deleted file mode 100755
index e801b8926..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getcolortable.gl
+++ /dev/null
@@ -1,155 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(GetColorTable,retrieve contents of a color lookup table)
-_names(GetColorTable)
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__format>@,@<_param2>@)_C_
-_define(@<__type>@,@<_param3>@)_C_
-_define(@<__table>@,@<_param4>@)_C_
-.SH PARAMETERS
-_phead(__target)
-Must be _const(COLOR_TABLE),
-_const(POST_CONVOLUTION_COLOR_TABLE),
-or
-_const(POST_COLOR_MATRIX_COLOR_TABLE).
-_phead(__format)
-The format of the pixel data in __table.
-The possible values are
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(LUMINANCE),
-_const(LUMINANCE_ALPHA),
-_const(RGB),
-_const(BGR),
-_const(RGBA), and
-_const(BGRA).
-_phead(__type)
-The type of the pixel data in __table.
-Symbolic constants
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV)
-are accepted.
-_phead(__table)
-Pointer to a one-dimensional array of pixel data containing the contents
-of the color table.
-.SH DESCRIPTION
-_cmnd returns in __table the contents of the color table specified
-by __target. No pixel transfer operations are performed, but pixel
-storage modes that are applicable to
-_cmnd(ReadPixels) are performed.
-.P
-Color components that are requested in
-the specified __format, but which are not included in the internal
-format of the color lookup table, are returned as zero. The
-assignments of internal color components to the components
-requested by __format are
-.P
-.TS
-center;
-lb lb
-l l.
-_
-Internal Component Resulting Component
-_
-red red
-green green
-blue blue
-alpha alpha
-luminance red
-intensity red
-_
-.TE
-
-.P
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.P
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __format is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __type is not one of the allowable
-values.
-.P
-_const(INVALID_OPERATION) is generated if __type is one of
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5), or
-_const(UNSIGNED_SHORT_5_6_5_REV)
-and __format is not _const(RGB).
-.P
-_const(INVALID_OPERATION) is generated if __type is one of
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV)
-and __format is neither _const(RGBA) nor _const(BGRA).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(ColorTable),
-_cmnd(ColorTableParameter),
-_cmnd(GetColorTableParameter)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getcolortableparameter.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/getcolortableparameter.gl
deleted file mode 100755
index 183f867f4..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getcolortableparameter.gl
+++ /dev/null
@@ -1,124 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl | eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GetColorTableParameter, get color lookup table parameters)
-_names(GetColorTableParameter,[fi]v)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__pname>@,@<_param2>@)_C_
-_define(@<__params>@,@<_param3>@)_C_
-_phead(__target)
-The target color table.
-Must be
-_const(COLOR_TABLE),
-_const(POST_CONVOLUTION_COLOR_TABLE),
-_const(POST_COLOR_MATRIX_COLOR_TABLE),
-_const(PROXY_COLOR_TABLE),
-_const(PROXY_POST_CONVOLUTION_COLOR_TABLE),
-_const(PROXY_POST_COLOR_MATRIX_COLOR_TABLE).
-_phead(__pname)
-The symbolic name of a color lookup table parameter.
-Must be one of
-_const(COLOR_TABLE_BIAS),
-_const(COLOR_TABLE_SCALE),
-_const(COLOR_TABLE_FORMAT),
-_const(COLOR_TABLE_WIDTH),
-_const(COLOR_TABLE_RED_SIZE),
-_const(COLOR_TABLE_GREEN_SIZE),
-_const(COLOR_TABLE_BLUE_SIZE),
-_const(COLOR_TABLE_ALPHA_SIZE),
-_const(COLOR_TABLE_LUMINANCE_SIZE), or
-_const(COLOR_TABLE_INTENSITY_SIZE).
-_phead(__params)
-A pointer to an array where the values of the parameter will be stored.
-.SH DESCRIPTION
-Returns parameters specific to color table __target.
-.P
-When __pname is set to _const(COLOR_TABLE_SCALE) or
-_const(COLOR_TABLE_BIAS), _cmnd returns the color
-table scale or bias parameters for the table specified by __target.
-For these queries, __target must be set to
-_const(COLOR_TABLE),
-_const(POST_CONVOLUTION_COLOR_TABLE),
-or _const(POST_COLOR_MATRIX_COLOR_TABLE) and
-__params points to an array of four elements, which receive
-the scale or bias factors for red, green, blue, and alpha, in that order.
-.P
-_cmnd can also be used to retrieve the format and size parameters
-for a color table. For these queries, set __target to either the
-color table target or the proxy color table target.
-The format and size parameters are set by _cmnd(ColorTable).
-.P
-The following table lists the format and size parameters that may
-be queried.
-For each symbolic constant listed below for __pname,
-__params must point to an array of the
-given length, and receive the values indicated.
-.P
-.TS
-center;
-lb cb lb
-l c l.
-_
-Parameter N Meaning
-_
-_const(COLOR_TABLE_FORMAT) 1 Internal format (e.g. _const(RGBA))
-_const(COLOR_TABLE_WIDTH) 1 Number of elements in table
-_const(COLOR_TABLE_RED_SIZE) 1 Size of red component, in bits
-_const(COLOR_TABLE_GREEN_SIZE) 1 Size of green component
-_const(COLOR_TABLE_BLUE_SIZE) 1 Size of blue component
-_const(COLOR_TABLE_ALPHA_SIZE) 1 Size of alpha component
-_const(COLOR_TABLE_LUMINANCE_SIZE) 1 Size of luminance component
-_const(COLOR_TABLE_INTENSITY_SIZE) 1 Size of intensity component
-_
-.TE
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target or __pname is not
-an acceptable value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(ColorTable),
-_cmnd(TexParameter),
-_cmnd(ColorTableParameter)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getconvolutionfilter.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/getconvolutionfilter.gl
deleted file mode 100755
index c81391012..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getconvolutionfilter.gl
+++ /dev/null
@@ -1,158 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(GetConvolutionFilter,get current 1D or 2D convolution filter kernel)
-_names(GetConvolutionFilter)
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__format>@,@<_param2>@)_C_
-_define(@<__type>@,@<_param3>@)_C_
-_define(@<__image>@,@<_param4>@)_C_
-.SH PARAMETERS
-_phead(__target)
-The filter to be retrieved.
-Must be one of
-_const(CONVOLUTION_1D) or
-_const(CONVOLUTION_2D).
-_phead(__format)
-Format of the output image.
-Must be one of
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(BGR),
-_const(RGBA),
-_const(BGRA),
-_const(LUMINANCE), or
-_const(LUMINANCE_ALPHA).
-_phead(__type)
-Data type of components in the output image.
-Symbolic constants
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV)
-are accepted.
-_phead(__image)
-Pointer to storage for the output image.
-.SH DESCRIPTION
-_cmnd returns the current 1D or 2D convolution filter kernel as an image.
-The one- or two-dimensional image is placed in __image according to the
-specifications in __format and __type.
-No pixel transfer operations are performed on this image, but the relevant
-pixel storage modes are applied.
-.sp
-Color components that are present in __format but not included in the
-internal format of the filter are returned as zero.
-The assignments of internal color components to the components of __format
-are as follows.
-.br
-.bp
-.TS
-center;
-lb lb
-l l.
-_
-Internal Component Resulting Component
-_
-Red Red
-Green Green
-Blue Blue
-Alpha Alpha
-Luminance Red
-Intensity Red
-_
-.TE
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.P
-The current separable 2D filter must be retrieved with
-_cmnd(GetSeparableFilter) rather than _cmnd.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __format is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __type is not one of the allowable
-values.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.P
-_const(INVALID_OPERATION) is generated if _param3 is one of
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5), or
-_const(UNSIGNED_SHORT_5_6_5_REV)
-and _param2 is not _const(RGB).
-.P
-_const(INVALID_OPERATION) is generated if _param3 is one of
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV)
-and _param2 is neither _const(RGBA) nor _const(BGRA).
-.SH ASSOCIATED GETS
-_cmnd(GetConvolutionParameter)
-.SH SEE ALSO
-_cmnd(GetSeparableFilter),
-_cmnd(ConvolutionParameter),
-_cmnd(ConvolutionFilter1D),
-_cmnd(ConvolutionFilter2D)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getconvolutionparameter.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/getconvolutionparameter.gl
deleted file mode 100755
index 1ae71b3d7..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getconvolutionparameter.gl
+++ /dev/null
@@ -1,121 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(GetConvolutionParameter,get convolution parameters)
-_names(GetConvolutionParameter,[fi]v)
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__pname>@,@<_param2>@)_C_
-_define(@<__params>@,@<_param3>@)_C_
-.SH PARAMETERS
-_phead(__target)
-The filter whose parameters are to be retrieved.
-Must be one of
-_const(CONVOLUTION_1D),
-_const(CONVOLUTION_2D), or
-_const(SEPARABLE_2D).
-_phead(__pname)
-The parameter to be retrieved.
-Must be one of
-_const(CONVOLUTION_BORDER_MODE),
-_const(CONVOLUTION_BORDER_COLOR),
-_const(CONVOLUTION_FILTER_SCALE),
-_const(CONVOLUTION_FILTER_BIAS),
-_const(CONVOLUTION_FORMAT),
-_const(CONVOLUTION_WIDTH),
-_const(CONVOLUTION_HEIGHT),
-_const(MAX_CONVOLUTION_WIDTH), or
-_const(MAX_CONVOLUTION_HEIGHT).
-_phead(__params)
-Pointer to storage for the parameters to be retrieved.
-.SH DESCRIPTION
-_cmnd retrieves convolution parameters.
-__target determines which convolution filter is queried.
-__pname determines which parameter is returned:
-.TP
-_const(CONVOLUTION_BORDER_MODE)
-The convolution border mode.
-See _cmnd(ConvolutionParameter) for a list of border modes.
-.TP
-_const(CONVOLUTION_BORDER_COLOR)
-The current convolution border color.
-__params must be a pointer to an array of four elements,
-which will receive the red, green, blue, and alpha border colors.
-.TP
-_const(CONVOLUTION_FILTER_SCALE)
-The current filter scale factors.
-__params must be a pointer to an array of four elements,
-which will receive the red, green, blue, and alpha filter scale
-factors in that order.
-.TP
-_const(CONVOLUTION_FILTER_BIAS)
-The current filter bias factors.
-__params must be a pointer to an array of four elements,
-which will receive the red, green, blue, and alpha filter bias
-terms in that order.
-.TP
-_const(CONVOLUTION_FORMAT)
-The current internal format.
-See _cmnd(ConvolutionFilter1D), _cmnd(ConvolutionFilter2D),
-and _cmnd(SeparableFilter2D) for lists of allowable formats.
-.TP
-_const(CONVOLUTION_WIDTH)
-The current filter image width.
-.TP
-_const(CONVOLUTION_HEIGHT)
-The current filter image height.
-.TP
-_const(MAX_CONVOLUTION_WIDTH)
-The maximum acceptable filter image width.
-.TP
-_const(MAX_CONVOLUTION_HEIGHT)
-The maximum acceptable filter image height.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __pname is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __target is _const(CONVOLUTION_1D)
-and __pname is _const(CONVOLUTION_HEIGHT) or
-_const(MAX_CONVOLUTION_HEIGHT).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(GetConvolutionFilter),
-_cmnd(GetSeparableFilter2D),
-_cmnd(ConvolutionParameter)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/geterror.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/geterror.gl
deleted file mode 100755
index 944b957b4..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/geterror.gl
+++ /dev/null
@@ -1,121 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GetError, return error information)
-_names(GetError)
-.SH DESCRIPTION
-_cmnd returns the value of the error flag.
-Each detectable error is assigned a numeric code and symbolic name.
-When an error occurs,
-the error flag is set to the appropriate error code value.
-No other errors are recorded until _cmnd is called,
-the error code is returned,
-and the flag is reset to _const(NO_ERROR).
-If a call to _cmnd returns _const(NO_ERROR),
-there has been no detectable error since the last call to _cmnd,
-or since the GL was initialized.
-.P
-To allow for distributed implementations,
-there may be several error flags.
-If any single error flag has recorded an error,
-the value of that flag is returned
-and that flag is reset to _const(NO_ERROR)
-when _cmnd is called.
-If more than one flag has recorded an error,
-_cmnd returns and clears an arbitrary error flag value.
-Thus, _cmnd should always be called in a loop,
-until it returns _const(NO_ERROR),
-if all error flags are to be reset.
-.P
-Initially, all error flags are set to _const(NO_ERROR).
-.P
-The following errors are currently defined:
-.TP 30
-_const(NO_ERROR)
-No error has been recorded.
-The value of this symbolic constant is guaranteed to be 0.
-.TP
-_const(INVALID_ENUM)
-An unacceptable value is specified for an enumerated argument.
-The offending command is ignored,
-and has no other side effect than to set the error flag.
-.TP
-_const(INVALID_VALUE)
-A numeric argument is out of range.
-The offending command is ignored,
-and has no other side effect than to set the error flag.
-.TP
-_const(INVALID_OPERATION)
-The specified operation is not allowed in the current state.
-The offending command is ignored,
-and has no other side effect than to set the error flag.
-.TP
-_const(STACK_OVERFLOW)
-This command would cause a stack overflow.
-The offending command is ignored,
-and has no other side effect than to set the error flag.
-.TP
-_const(STACK_UNDERFLOW)
-This command would cause a stack underflow.
-The offending command is ignored,
-and has no other side effect than to set the error flag.
-.TP
-_const(OUT_OF_MEMORY)
-There is not enough memory left to execute the command.
-The state of the GL is undefined,
-except for the state of the error flags,
-after this error is recorded.
-.TP
-_const(TABLE_TOO_LARGE)
-The specified table exceeds the implementation's maximum supported table
-size. The offending command is ignored, and has no other side effect
-than to set the error flag.
-.P
-When an error flag is set,
-results of a GL operation are undefined only if _const(OUT_OF_MEMORY)
-has occurred.
-In all other cases,
-the command generating the error is ignored and has no effect on the GL state
-or frame buffer contents.
-If the generating command returns a value, it returns 0.
-If _cmnd itself generates an error, it returns 0.
-.SH NOTES
-_const(TABLE_TOO_LARGE) was introduced in GL version 1.2.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-In this case _cmnd returns 0.
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/gethistogram.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/gethistogram.gl
deleted file mode 100755
index 1de8aa80a..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/gethistogram.gl
+++ /dev/null
@@ -1,154 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(GetHistogram,get histogram table)
-_names(GetHistogram)
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__reset>@,@<_param2>@)_C_
-_define(@<__format>@,@<_param3>@)_C_
-_define(@<__type>@,@<_param4>@)_C_
-_define(@<__values>@,@<_param5>@)_C_
-.SH PARAMETERS
-_phead(__target)
-Must be
-_const(HISTOGRAM).
-_phead(__reset)
-If _const(TRUE), each component counter that is actually returned
-is reset to zero. (Other counters are unaffected.)
-If _const(FALSE), none of the counters in the histogram table is modified.
-_phead(__format)
-The format of values to be returned in __values.
-Must be one of
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(BGR),
-_const(RGBA),
-_const(BGRA),
-_const(LUMINANCE), or
-_const(LUMINANCE_ALPHA).
-_phead(__type)
-The type of values to be returned in __values.
-Symbolic constants
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV)
-are accepted.
-_phead(__values)
-A pointer to storage for the returned histogram table.
-.SH DESCRIPTION
-_cmnd returns the current histogram table as a one-dimensional image
-with the same width as the histogram.
-No pixel transfer operations are performed on this image, but pixel storage
-modes that are applicable to 1D images are honored.
-.PP
-Color components that are requested in the specified __format, but which
-are not included in the internal format of the histogram, are returned as
-zero.
-.bp
-The assignments of internal color components to the components
-requested by __format are:
-.TS
-center;
-lb lb
-l l.
-_
-Internal Component Resulting Component
-_
-Red Red
-Green Green
-Blue Blue
-Alpha Alpha
-Luminance Red
-_
-.TE
-
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not _const(HISTOGRAM).
-.P
-_const(INVALID_ENUM) is generated if __format is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __type is not one of the allowable
-values.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.P
-.P
-_const(INVALID_OPERATION) is generated if __type is one of
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5), or
-_const(UNSIGNED_SHORT_5_6_5_REV)
-and __format is not _const(RGB).
-.P
-_const(INVALID_OPERATION) is generated if __type is one of
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV)
-and __format is neither _const(RGBA) nor _const(BGRA).
-.SH SEE ALSO
-_cmnd(Histogram),
-_cmnd(ResetHistogram),
-_cmnd(GetHistogramParameter)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/gethistogramparameter.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/gethistogramparameter.gl
deleted file mode 100755
index 8e87f0ac3..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/gethistogramparameter.gl
+++ /dev/null
@@ -1,110 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(GetHistogramParameter,get histogram parameters)
-_names(GetHistogramParameter,[fi]v)
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__pname>@,@<_param2>@)_C_
-_define(@<__params>@,@<_param3>@)_C_
-.SH PARAMETERS
-_phead(__target)
-Must be one of
-_const(HISTOGRAM) or
-_const(PROXY_HISTOGRAM).
-_phead(__pname)
-The name of the parameter to be retrieved.
-Must be one of
-_const(HISTOGRAM_WIDTH),
-_const(HISTOGRAM_FORMAT),
-_const(HISTOGRAM_RED_SIZE),
-_const(HISTOGRAM_GREEN_SIZE),
-_const(HISTOGRAM_BLUE_SIZE),
-_const(HISTOGRAM_ALPHA_SIZE),
-_const(HISTOGRAM_LUMINANCE_SIZE), or
-_const(HISTOGRAM_SINK).
-_phead(__params)
-Pointer to storage for the returned values.
-.SH DESCRIPTION
-_cmnd is used to query parameter values for the current histogram or for
-a proxy. The histogram state information may be queried by calling
-_cmnd(GetHistogramParameter) with a __target of _const(HISTOGRAM) (to
-obtain information for the current histogram table) or
-_const(PROXY_HISTOGRAM) (to obtain information from the most recent
-proxy request) and one of the following values for the __pname argument:
-.P
-.ne
-.TS
-center;
-lb lb
-l l.
-_
-Parameter Description
-_
-_const(HISTOGRAM_WIDTH) Histogram table width
-_const(HISTOGRAM_FORMAT) Internal format
-_const(HISTOGRAM_RED_SIZE) Red component counter size, in bits
-_const(HISTOGRAM_GREEN_SIZE) Green component counter size, in bits
-.TE
-.bp
-.TS
-center;
-lb lb
-l l.
-_
-Parameter Description
-_
-_const(HISTOGRAM_BLUE_SIZE) Blue component counter size, in bits
-_const(HISTOGRAM_ALPHA_SIZE) Alpha component counter size, in bits
-_const(HISTOGRAM_LUMINANCE_SIZE) Luminance component counter size, in bits
-_const(HISTOGRAM_SINK) Value of the \f2sink\fP parameter
-_
-.TE
-
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __pname is not one of the allowable
-values.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(GetHistogram),
-_cmnd(Histogram)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getlight.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/getlight.gl
deleted file mode 100755
index 14843c780..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getlight.gl
+++ /dev/null
@@ -1,192 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GetLight,return light source parameter values)
-_names(GetLight,[fi]v)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies a light source.
-The number of possible lights depends on the implementation,
-but at least eight lights are supported.
-They are identified by symbolic names of the form _const(LIGHT)$i$
-where 0 \(<= $ i $ < _const(MAX_LIGHTS).
-_phead(_param2)
-Specifies a light source parameter for _param1.
-Accepted symbolic names are
-_const(AMBIENT),
-_const(DIFFUSE),
-_const(SPECULAR),
-_const(POSITION),
-_const(SPOT_DIRECTION),
-_const(SPOT_EXPONENT),
-_const(SPOT_CUTOFF),
-_const(CONSTANT_ATTENUATION),
-_const(LINEAR_ATTENUATION), and
-_const(QUADRATIC_ATTENUATION).
-_phead(_param3)
-Returns the requested data.
-.SH DESCRIPTION
-_cmnd returns in _param3 the value or values of a light source parameter.
-_param1 names the light and is a symbolic name of the form _const(LIGHT)$i$
-for 0 \(<= $i$ < _const(MAX_LIGHTS),
-where _const(MAX_LIGHTS) is an implementation dependent constant that is
-greater than or equal to eight.
-_param2 specifies one of ten light source parameters,
-again by symbolic name.
-.P
-The following parameters are defined:
-.TP 20
-_const(AMBIENT)
-_param3 returns four integer or floating-point values representing the
-ambient intensity of the light source.
-Integer values,
-when requested,
-are linearly mapped from the internal floating-point representation
-such that 1.0 maps to the most positive representable integer value,
-and \-1.0 maps to the most negative representable integer value.
-If the internal value is outside the range [\-1, 1],
-the corresponding integer return value is undefined. The initial value is
-(0, 0, 0, 1).
-.TP
-_const(DIFFUSE)
-_param3 returns four integer or floating-point values representing the
-diffuse intensity of the light source.
-Integer values,
-when requested,
-are linearly mapped from the internal floating-point representation
-such that 1.0 maps to the most positive representable integer value,
-and \-1.0 maps to the most negative representable integer value.
-If the internal value is outside the range [\-1, 1],
-the corresponding integer return value is undefined. The initial value
-for _const(LIGHT0) is (1, 1, 1, 1); for other lights, the
-initial value is (0, 0, 0, 0).
-.TP
-_const(SPECULAR)
-_param3 returns four integer or floating-point values representing the
-specular intensity of the light source.
-Integer values,
-when requested,
-are linearly mapped from the internal floating-point representation
-such that 1.0 maps to the most positive representable integer value,
-and \-1.0 maps to the most negative representable integer value.
-If the internal value is outside the range [\-1, 1],
-the corresponding integer return value is undefined. The initial value
-for _const(LIGHT0) is (1, 1, 1, 1); for other lights, the
-initial value is (0, 0, 0, 0).
-.TP
-_const(POSITION)
-_param3 returns four integer or floating-point values representing the
-position of the light source.
-Integer values,
-when requested,
-are computed by rounding the internal floating-point values to the
-nearest integer value.
-The returned values are those maintained in eye coordinates.
-They will not be equal to the values specified using _cmnd(Light),
-unless the modelview matrix was identity at the time _cmnd(Light) was
-called. The initial value is (0, 0, 1, 0).
-.TP
-_const(SPOT_DIRECTION)
-_param3 returns three integer or floating-point values representing the
-direction of the light source.
-Integer values,
-when requested,
-are computed by rounding the internal floating-point values to the
-nearest integer value.
-The returned values are those maintained in eye coordinates.
-They will not be equal to the values specified using _cmnd(Light),
-unless the modelview matrix was identity at the time _cmnd(Light) was called.
-Although spot direction is normalized before being used in the lighting
-equation,
-the returned values are the transformed versions of the specified values
-prior to normalization. The initial value is (0, 0, \-1).
-.TP
-_const(SPOT_EXPONENT)
-_param3 returns a single integer or floating-point value representing the
-spot exponent of the light.
-An integer value,
-when requested,
-is computed by rounding the internal floating-point representation to
-the nearest integer. The initial value is 0.
-.TP
-_const(SPOT_CUTOFF)
-_param3 returns a single integer or floating-point value representing the
-spot cutoff angle of the light.
-An integer value,
-when requested,
-is computed by rounding the internal floating-point representation to
-the nearest integer. The initial value is 180.
-.TP
-_const(CONSTANT_ATTENUATION)
-_param3 returns a single integer or floating-point value representing the
-constant (not distance-related) attenuation of the light.
-An integer value,
-when requested,
-is computed by rounding the internal floating-point representation to
-the nearest integer. The initial value is 1.
-.TP
-_const(LINEAR_ATTENUATION )
-_param3 returns a single integer or floating-point value representing the
-linear attenuation of the light.
-An integer value,
-when requested,
-is computed by rounding the internal floating-point representation to
-the nearest integer. The initial value is 0.
-.TP
-_const(QUADRATIC_ATTENUATION)
-_param3 returns a single integer or floating-point value representing the
-quadratic attenuation of the light.
-An integer value,
-when requested,
-is computed by rounding the internal floating-point representation to
-the nearest integer. The initial value is 0.
-.SH NOTES
-It is always the case that _const(LIGHT)$i$ = _const(LIGHT0) + $i$.
-.P
-If an error is generated,
-no change is made to the contents of _param3.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 or _param2 is not an
-accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(Light)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getmap.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/getmap.gl
deleted file mode 100755
index ed322f092..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getmap.gl
+++ /dev/null
@@ -1,132 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GetMap,return evaluator parameters)
-_names(GetMap,[dfi]v)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the symbolic name of a map.
-Accepted values are
-_const(MAP1_COLOR_4),
-_const(MAP1_INDEX),
-_const(MAP1_NORMAL),
-_const(MAP1_TEXTURE_COORD_1),
-_const(MAP1_TEXTURE_COORD_2),
-_const(MAP1_TEXTURE_COORD_3),
-_const(MAP1_TEXTURE_COORD_4),
-_const(MAP1_VERTEX_3),
-_const(MAP1_VERTEX_4),
-_const(MAP2_COLOR_4),
-_const(MAP2_INDEX),
-_const(MAP2_NORMAL),
-_const(MAP2_TEXTURE_COORD_1),
-_const(MAP2_TEXTURE_COORD_2),
-_const(MAP2_TEXTURE_COORD_3),
-_const(MAP2_TEXTURE_COORD_4),
-_const(MAP2_VERTEX_3), and
-_const(MAP2_VERTEX_4).
-_phead(_param2)
-Specifies which parameter to return.
-Symbolic names
-_const(COEFF),
-_const(ORDER), and
-_const(DOMAIN) are accepted.
-_phead(_param3)
-Returns the requested data.
-.SH DESCRIPTION
-_cmnd(Map1) and _cmnd(Map2) define evaluators.
-_cmnd returns evaluator parameters.
-_param1 chooses a map,
-_param2 selects a specific parameter,
-and _param3 points to storage where the values will be returned.
-.P
-The acceptable values for the _param1 parameter are described
-in the _cmnd(Map1) and _cmnd(Map2) reference pages.
-.P
-_param2 can assume the following values:
-.TP 15
-_const(COEFF)
-_param3 returns the control points for the evaluator function.
-One-dimensional evaluators return $order$ control points,
-and two-dimensional evaluators return $uorder ~times~ vorder$ control points.
-Each control point consists of one, two, three, or four integer,
-single-precision floating-point,
-or double-precision floating-point values,
-depending on the type of the evaluator.
-The GL returns two-dimensional control points in row-major order,
-incrementing the $uorder$ index quickly
-and the $vorder$ index after each row.
-Integer values,
-when requested,
-are computed by rounding the internal floating-point values to the
-nearest integer values.
-.TP
-_const(ORDER)
-_param3 returns the order of the evaluator function.
-One-dimensional evaluators return a single value,
-$order$. The initial value is 1.
-Two-dimensional evaluators return two values,
-$uorder$ and $vorder$. The initial value is 1,1.
-.TP
-_const(DOMAIN)
-_param3 returns the linear $u$ and $v$ mapping parameters.
-One-dimensional evaluators return two values,
-$u1$ and $u2$,
-as specified by _cmnd(Map1).
-Two-dimensional evaluators return four values
-($u1$, $u2$, $v1$, and $v2$)
-as specified by _cmnd(Map2).
-Integer values,
-when requested,
-are computed by rounding the internal floating-point values to the
-nearest integer values.
-.SH NOTES
-If an error is generated,
-no change is made to the contents of _param3.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if either _param1 or _param2 is not
-an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(EvalCoord),
-_cmnd(Map1),
-_cmnd(Map2)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getmaterial.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/getmaterial.gl
deleted file mode 100755
index 0df347ea3..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getmaterial.gl
+++ /dev/null
@@ -1,138 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GetMaterial,return material parameters)
-_names(GetMaterial,[fi]v)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies which of the two materials is being queried.
-_const(FRONT) or _const(BACK) are accepted,
-representing the front and back materials, respectively.
-_phead(_param2)
-Specifies the material parameter to return.
-_const(AMBIENT),
-_const(DIFFUSE),
-_const(SPECULAR),
-_const(EMISSION),
-_const(SHININESS), and
-_const(COLOR_INDEXES)
-are accepted.
-_phead(_param3)
-Returns the requested data.
-.SH DESCRIPTION
-_cmnd returns in _param3 the value or values of parameter _param2
-of material _param1. Six parameters are defined:
-.TP 22
-_const(AMBIENT)
-_param3 returns four integer or floating-point values representing the
-ambient reflectance of the material.
-Integer values,
-when requested,
-are linearly mapped from the internal floating-point representation
-such that 1.0 maps to the most positive representable integer value,
-and \-1.0 maps to the most negative representable integer value.
-If the internal value is outside the range [\-1, 1],
-the corresponding integer return value is undefined. The initial value is
-(0.2, 0.2, 0.2, 1.0)
-.TP
-_const(DIFFUSE)
-_param3 returns four integer or floating-point values representing the
-diffuse reflectance of the material.
-Integer values,
-when requested,
-are linearly mapped from the internal floating-point representation
-such that 1.0 maps to the most positive representable integer value,
-and \-1.0 maps to the most negative representable integer value.
-If the internal value is outside the range [\-1, 1],
-the corresponding integer return value is undefined. The initial value is
-(0.8, 0.8, 0.8, 1.0).
-.TP
-_const(SPECULAR)
-_param3 returns four integer or floating-point values representing the
-specular reflectance of the material.
-Integer values,
-when requested,
-are linearly mapped from the internal floating-point representation
-such that 1.0 maps to the most positive representable integer value,
-and \-1.0 maps to the most negative representable integer value.
-If the internal value is outside the range [\-1, 1],
-the corresponding integer return value is undefined. The initial value is
-(0, 0, 0, 1).
-.TP
-_const(EMISSION)
-_param3 returns four integer or floating-point values representing the
-emitted light intensity of the material.
-Integer values,
-when requested,
-are linearly mapped from the internal floating-point representation
-such that 1.0 maps to the most positive representable integer value,
-and \-1.0 maps to the most negative representable integer value.
-If the internal value is outside the range [\-1, 1.0],
-the corresponding integer return value is undefined. The initial value is
-(0, 0, 0, 1).
-.TP
-_const(SHININESS)
-_param3 returns one integer or floating-point value representing the
-specular exponent of the material.
-Integer values,
-when requested,
-are computed by rounding the internal floating-point value to the
-nearest integer value. The initial value is 0.
-.TP
-_const(COLOR_INDEXES)
-_param3 returns three integer or floating-point values representing the
-ambient, diffuse, and specular indices of the material.
-These indices are used only for color index lighting.
-(All the other parameters are used only for RGBA lighting.)
-Integer values,
-when requested,
-are computed by rounding the internal floating-point values to the
-nearest integer values.
-.SH NOTES
-If an error is generated,
-no change is made to the contents of _param3.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 or _param2 is not an
-accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(Material)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getminmax.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/getminmax.gl
deleted file mode 100755
index b89b86f8d..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getminmax.gl
+++ /dev/null
@@ -1,161 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(GetMinmax,get minimum and maximum pixel values)
-_names(GetMinmax)
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__reset>@,@<_param2>@)_C_
-_define(@<__format>@,@<_param3>@)_C_
-_define(@<__type>@,@<_param4>@)_C_
-_define(@<__values>@,@<_param5>@)_C_
-.SH PARAMETERS
-_phead(__target)
-Must be
-_const(MINMAX).
-_phead(__reset)
-If _const(TRUE), all entries in the minmax table that are actually
-returned are reset to their initial values. (Other entries are unaltered.)
-If _const(FALSE), the minmax table is unaltered.
-_phead(__format)
-The format of the data to be returned in __values.
-Must be one of
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(BGR),
-_const(RGBA),
-_const(BGRA),
-_const(LUMINANCE), or
-_const(LUMINANCE_ALPHA).
-_phead(__type)
-The type of the data to be returned in __values.
-Symbolic constants
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV)
-are accepted.
-_phead(__values)
-A pointer to storage for the returned values.
-.SH DESCRIPTION
-_cmnd returns the accumulated minimum and maximum pixel values (computed on a
-per-component basis) in a one-dimensional image of width 2. The first set
-of return values are the minima, and the second set of return values
-are the maxima.
-The format of the return values is determined by __format, and their type is
-determined by __type.
-.PP
-No pixel transfer operations are performed on the return values, but pixel
-storage modes that are applicable to 1-dimensional images are performed.
-Color components that are requested in the specified __format, but that
-are not included in the internal format of the minmax table, are
-returned as zero. The assignment of internal color components to the
-components requested by __format are as follows:
-.sp
-.TS
-center;
-lb lb
-l l.
-_
-Internal Component Resulting Component
-_
-Red Red
-Green Green
-Blue Blue
-Alpha Alpha
-Luminance Red
-_
-.TE
-
-.PP
-If __reset is _const(TRUE), the minmax table entries corresponding
-to the return values are reset to their initial
-values. Minimum and maximum values that are not returned are not
-modified, even if __reset is _const(TRUE).
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not _const(MINMAX).
-.P
-_const(INVALID_ENUM) is generated if __format is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __type is not one of the allowable
-values.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.P
-_const(INVALID_OPERATION) is generated if __type is one of
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5), or
-_const(UNSIGNED_SHORT_5_6_5_REV)
-and __format is not _const(RGB).
-.P
-_const(INVALID_OPERATION) is generated if __type is one of
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV)
-and __format is neither _const(RGBA) nor _const(BGRA).
-.SH SEE ALSO
-_cmnd(Minmax),
-_cmnd(ResetMinmax),
-_cmnd(GetMinmaxParameter)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getminmaxparameter.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/getminmaxparameter.gl
deleted file mode 100755
index 6a45e3c87..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getminmaxparameter.gl
+++ /dev/null
@@ -1,83 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(GetMinmaxParameter,get minmax parameters)
-_names(GetMinmaxParameter,[fi]v)
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__pname>@,@<_param2>@)_C_
-_define(@<__params>@,@<_param3>@)_C_
-.SH PARAMETERS
-_phead(__target)
-Must be
-_const(MINMAX).
-_phead(__pname)
-The parameter to be retrieved.
-Must be one of
-_const(MINMAX_FORMAT) or
-_const(MINMAX_SINK).
-_phead(__params)
-A pointer to storage for the retrieved parameters.
-.SH DESCRIPTION
-_cmnd retrieves parameters for the current minmax table by setting
-__pname to one of the following values:
-.sp
-
-.TS
-center;
-lb lb
-l l.
-_
-Parameter Description
-_
-_const(MINMAX_FORMAT) Internal format of minmax table
-_const(MINMAX_SINK) Value of the \f2sink\fP parameter
-_
-.TE
-
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not _const(MINMAX).
-.P
-_const(INVALID_ENUM) is generated if __pname is not one of the allowable
-values.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(Minmax),
-_cmnd(GetMinmax)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getpixelmap.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/getpixelmap.gl
deleted file mode 100755
index 258102e2f..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getpixelmap.gl
+++ /dev/null
@@ -1,160 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GetPixelMap,return the specified pixel map)
-_names(GetPixelMap,u*[ifs]v)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the name of the pixel map to return.
-Accepted values are
-_const(PIXEL_MAP_I_TO_I),
-_const(PIXEL_MAP_S_TO_S),
-_const(PIXEL_MAP_I_TO_R),
-_const(PIXEL_MAP_I_TO_G),
-_const(PIXEL_MAP_I_TO_B),
-_const(PIXEL_MAP_I_TO_A),
-_const(PIXEL_MAP_R_TO_R),
-_const(PIXEL_MAP_G_TO_G),
-_const(PIXEL_MAP_B_TO_B), and
-_const(PIXEL_MAP_A_TO_A).
-_phead(_param2)
-Returns the pixel map contents.
-.SH DESCRIPTION
-See the _cmnd(PixelMap) reference page for a description of the acceptable
-values for the _param1 parameter.
-_cmnd returns in _param2 the contents of the pixel map
-specified in _param1.
-Pixel maps are used during the execution of
-_cmnd(ReadPixels),
-_cmnd(DrawPixels),
-_cmnd(CopyPixels),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(ColorTable),
-_cmnd(ColorSubTable),
-_cmnd(CopyColorTable),
-_cmnd(CopyColorSubTable),
-_cmnd(ConvolutionFilter1D),
-_cmnd(ConvolutionFilter2D),
-_cmnd(SeparableFilter2D),
-_cmnd(GetHistogram),
-_cmnd(GetMinmax), and
-_cmnd(GetTexImage)
-to map color indices,
-stencil indices,
-color components,
-and depth components to other values.
-.P
-Unsigned integer values,
-if requested,
-are linearly mapped from the internal fixed or floating-point representation
-such that 1.0 maps to the largest representable integer value,
-and 0.0 maps to 0.
-Return unsigned integer values are undefined if the map value was
-not in the range [0,1].
-.P
-To determine the required size of _param1,
-call _cmnd(Get) with the appropriate symbolic constant.
-.SH NOTES
-If an error is generated,
-no change is made to the contents of _param2.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-.na
-_cmnd(Get) with argument _const(PIXEL_MAP_I_TO_I_SIZE)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_S_TO_S_SIZE)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_I_TO_R_SIZE)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_I_TO_G_SIZE)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_I_TO_B_SIZE)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_I_TO_A_SIZE)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_R_TO_R_SIZE)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_G_TO_G_SIZE)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_B_TO_B_SIZE)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_A_TO_A_SIZE)
-.br
-_cmnd(Get) with argument _const(MAX_PIXEL_MAP_TABLE)
-.SH SEE ALSO
-_cmnd(ColorSubTable),
-_cmnd(ColorTable),
-_cmnd(ConvolutionFilter1D),
-_cmnd(ConvolutionFilter2D),
-_cmnd(CopyColorSubTable),
-_cmnd(CopyColorTable),
-_cmnd(CopyPixels),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(DrawPixels),
-_cmnd(GetHistogram),
-_cmnd(GetMinmax),
-_cmnd(GetTexImage),
-_cmnd(PixelMap),
-_cmnd(PixelTransfer),
-_cmnd(ReadPixels),
-_cmnd(SeparableFilter2D),
-_cmnd(TexImage1D),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D)
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getpointerv.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/getpointerv.gl
deleted file mode 100755
index 5e29417c9..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getpointerv.gl
+++ /dev/null
@@ -1,98 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_C_ A real line follows.
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_C_ Use GL not OpenGL
-_C_ Don't change the ordering of the main headers.
-_C_ C specification (or fortran) is handled automatically
-_C_ .TH is automatically added to the top of this file.
-_C_ Below, use current tense, active do not capitalize the first word and dont
-_C_ use a period.
-_C_ the function name must appear in (APIFILE) (usually gl.h) as set in
-_C_ Makefile.
-_header(GetPointerv, return the address of the specified pointer)
-_names(GetPointerv)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the array or buffer pointer to be returned.
-Symbolic constants
-_const(COLOR_ARRAY_POINTER),
-_const(EDGE_FLAG_ARRAY_POINTER),
-_const(FEEDBACK_BUFFER_POINTER),
-_const(INDEX_ARRAY_POINTER),
-_const(NORMAL_ARRAY_POINTER),
-_const(TEXTURE_COORD_ARRAY_POINTER),
-_const(SELECTION_BUFFER_POINTER),
-and
-_const(VERTEX_ARRAY_POINTER)
-are accepted.
-_phead(_param2)
-Returns the pointer value specified by _param1.
-.SH DESCRIPTION
-_cmnd returns pointer information. _param1
-is a symbolic constant indicating the pointer to be returned, and
-_param2 is a pointer to a location in which to place the returned data.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-The pointers are all client-side state.
-.P
-The initial value for each pointer is 0.
-.P
-When the _arbstring(multitexture) extension is supported, querying the
-_const(TEXTURE_COORD_ARRAY_POINTER) returns the value for the active
-client texture unit.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.SH SEE ALSO
-_C_ no queries or gets listed above, alphabetize commands,
-_C_ seperate with commas not .br. no command appears in the associated gets
-_C_ as well as in SEE ALSO.
-_cmnd(ArrayElement),
-_cmnd(ClientActiveTextureARB),
-_cmnd(ColorPointer),
-_cmnd(DrawArrays),
-_cmnd(EdgeFlagPointer),
-_cmnd(FeedbackBuffer),
-_cmnd(IndexPointer),
-_cmnd(InterleavedArrays),
-_cmnd(NormalPointer),
-_cmnd(SelectBuffer),
-_cmnd(TexCoordPointer),
-_cmnd(VertexPointer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getpolygonstipple.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/getpolygonstipple.gl
deleted file mode 100755
index 2c07bf01e..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getpolygonstipple.gl
+++ /dev/null
@@ -1,69 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GetPolygonStipple,return the polygon stipple pattern)
-_names(GetPolygonStipple)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Returns the stipple pattern. The initial value is all 1's.
-.SH DESCRIPTION
-_cmnd returns to _param1 a $32 ~times~ 32$ polygon stipple pattern.
-The pattern is packed into memory as if _cmnd(ReadPixels)
-with both \f2height\fP and \f2width\fP of 32,
-\f2type\fP of _const(BITMAP),
-and \f2format\fP of _const(COLOR_INDEX) were called,
-and the stipple pattern were stored in an internal $32 ~times~ 32$ color
-index buffer.
-Unlike _cmnd(ReadPixels),
-however,
-pixel transfer operations
-(shift, offset, pixel map)
-are not applied to the returned stipple image.
-.SH NOTES
-If an error is generated,
-no change is made to the contents of _param1.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(PixelStore),
-_cmnd(PixelTransfer),
-_cmnd(PolygonStipple),
-_cmnd(ReadPixels)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getseparablefilter.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/getseparablefilter.gl
deleted file mode 100755
index 0e340d85a..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getseparablefilter.gl
+++ /dev/null
@@ -1,163 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(GetSeparableFilter,get separable convolution filter kernel images)
-_names(GetSeparableFilter)
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__format>@,@<_param2>@)_C_
-_define(@<__type>@,@<_param3>@)_C_
-_define(@<__row>@,@<_param4>@)_C_
-_define(@<__column>@,@<_param5>@)_C_
-_define(@<__span>@,@<_param6>@)_C_
-.SH PARAMETERS
-_phead(__target)
-The separable filter to be retrieved.
-Must be
-_const(SEPARABLE_2D).
-_phead(__format)
-Format of the output images.
-Must be one of
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(BGR)
-_const(RGBA),
-_const(BGRA),
-_const(LUMINANCE), or
-_const(LUMINANCE_ALPHA).
-_phead(__type)
-Data type of components in the output images.
-Symbolic constants
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV)
-are accepted.
-_phead(__row)
-Pointer to storage for the row filter image.
-_phead(__column)
-Pointer to storage for the column filter image.
-_phead(__span)
-Pointer to storage for the span filter image (currently unused).
-.SH DESCRIPTION
-_cmnd returns the two one-dimensional filter kernel images for the
-current separable 2D convolution filter.
-The row image is placed in __row and the column image is placed in
-__column according to the specifications in __format and __type.
-(In the current implementation, __span is not affected in any way.)
-No pixel transfer operations are performed on the images, but the relevant
-pixel storage modes are applied.
-.sp
-Color components that are present in __format but not included in the
-internal format of the filters are returned as zero.
-The assignments of internal color components to the components of __format
-are as follows:
-.sp
-
-.TS
-center;
-cb cb
-l l.
-_
-Internal Component Resulting Component
-_
-Red Red
-Green Green
-Blue Blue
-Alpha Alpha
-Luminance Red
-Intensity Red
-_
-.TE
-
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.P
-Non-separable 2D filters must be retrieved with _cmnd(GetConvolutionFilter).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not _const(SEPARABLE_2D).
-.P
-_const(INVALID_ENUM) is generated if __format is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __type is not one of the allowable
-values.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.P
-_const(INVALID_OPERATION) is generated if __type is one of
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5), or
-_const(UNSIGNED_SHORT_5_6_5_REV)
-and __format is not _const(RGB).
-.P
-_const(INVALID_OPERATION) is generated if __type is one of
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV)
-and __format is neither _const(RGBA) nor _const(BGRA).
-.SH ASSOCIATED GETS
-_cmnd(GetConvolutionParameter)
-.SH SEE ALSO
-_cmnd(GetConvolutionFilter),
-_cmnd(ConvolutionParameter),
-_cmnd(SeparableFilter2D)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getstring.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/getstring.gl
deleted file mode 100755
index 5099f97ad..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getstring.gl
+++ /dev/null
@@ -1,104 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GetString, return a string describing the current GL connection)
-_names(GetString)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a symbolic constant, one of
-_const(VENDOR), _const(RENDERER), _const(VERSION), or _const(EXTENSIONS).
-.SH DESCRIPTION
-_cmnd returns a pointer to a static string
-describing some aspect of the current GL connection.
-_param1 can be one of the following:
-.TP 20
-_const(VENDOR)
-Returns the company responsible for this GL implementation.
-This name does not change from release to release.
-.TP
-_const(RENDERER)
-Returns the name of the renderer.
-This name is typically specific to a particular configuration of a hardware
-platform.
-It does not change from release to release.
-.TP
-_const(VERSION)
-Returns a version or release number.
-.TP
-_const(EXTENSIONS)
-Returns a space-separated list of supported extensions to GL.
-.P
-Because the GL does not include queries for the performance
-characteristics of an implementation, some applications are written to
-recognize known platforms and modify their GL usage based on known
-performance characteristics of these platforms.
-Strings _const(VENDOR) and _const(RENDERER) together uniquely specify
-a platform. They do not change from release to release and should be used
-by platform-recognition algorithms.
-.P
-Some applications want to make use of features that
-are not part of the standard GL. These features
-may be implemented as extensions to the standard GL.
-The _const(EXTENSIONS) string is a space-separated
-list of supported GL extensions.
-(Extension names never contain a space character.)
-.P
-The _const(VERSION) string begins with a version number.
-The version number uses one
-of these forms:
-.P
-\f2major_number.minor_number\fP
-.br
-\f2major_number.minor_number.release_number\fP
-.P
-Vendor-specific information may follow the version
-number. Its format depends on the implementation, but
-a space always separates the version number and
-the vendor-specific information.
-.P
-All strings are null-terminated.
-.SH NOTES
-If an error is generated, _cmnd returns 0.
-.P
-The client and server may support different versions or extensions.
-_cmnd always returns a compatible version number or list of extensions.
-The release number always describes the server.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/gettexenv.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/gettexenv.gl
deleted file mode 100755
index c64f44bcb..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/gettexenv.gl
+++ /dev/null
@@ -1,85 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GetTexEnv,return texture environment parameters)
-_names(GetTexEnv,[fi]v)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a texture environment.
-Must be _const(TEXTURE_ENV).
-_phead(_param2)
-Specifies the symbolic name of a texture environment parameter.
-Accepted values are _const(TEXTURE_ENV_MODE) and _const(TEXTURE_ENV_COLOR).
-_phead(_param3)
-Returns the requested data.
-.SH DESCRIPTION
-_cmnd returns in _param3 selected values of a texture environment that
-was specified with _cmnd(TexEnv).
-_param1 specifies a texture environment.
-Currently, only one texture environment is defined and supported:
-_const(TEXTURE_ENV).
-.P
-_param2 names a specific texture environment parameter, as follows:
-.TP 10
-_const(TEXTURE_ENV_MODE)
-_param3 returns the single-valued texture environment mode,
-a symbolic constant. The initial value is _const(MODULATE).
-.TP
-_const(TEXTURE_ENV_COLOR)
-_param3 returns four integer or floating-point values that are the
-texture environment color.
-Integer values,
-when requested,
-are linearly mapped from the internal floating-point representation
-such that 1.0 maps to the most positive representable integer,
-and \-1.0 maps to the most negative representable integer. The initial
-value is (0, 0, 0, 0).
-.SH NOTES
-If an error is generated,
-no change is made to the contents of _param3.
-.P
-When the _arbstring(multitexture) extension is supported, _cmnd returns
-the texture environment parameters for the active texture unit.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 or _param2 is not an
-accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(ActiveTextureARB),
-_cmnd(TexEnv)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/gettexgen.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/gettexgen.gl
deleted file mode 100755
index b5d2c6e75..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/gettexgen.gl
+++ /dev/null
@@ -1,105 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GetTexGen,return texture coordinate generation parameters)
-_names(GetTexGen,[dfi]v)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies a texture coordinate.
-Must be
-_const(S),
-_const(T),
-_const(R), or
-_const(Q).
-_phead(_param2)
-Specifies the symbolic name of the value(s) to be returned.
-Must be either _const(TEXTURE_GEN_MODE)
-or the name of one of the texture generation plane equations:
-_const(OBJECT_PLANE) or _const(EYE_PLANE).
-_phead(_param3)
-Returns the requested data.
-.SH DESCRIPTION
-_cmnd returns in _param3 selected parameters of a texture coordinate
-generation function that was specified using _cmnd(TexGen).
-_param1 names one of the (\f2s\fP, \f2t\fP, \f2r\fP, \f2q\fP)
-texture coordinates,
-using the symbolic constant
-_const(S),
-_const(T),
-_const(R), or
-_const(Q).
-.P
-_param2 specifies one of three symbolic names:
-.TP 28
-_const(TEXTURE_GEN_MODE)
-_param3 returns the single-valued texture generation function,
-a symbolic constant. The initial value is _const(EYE_LINEAR).
-.TP
-_const(OBJECT_PLANE)
-_param3 returns the four plane equation coefficients that specify
-object linear-coordinate generation.
-Integer values, when requested,
-are mapped directly from the internal floating-point representation.
-.BP
-.TP
-_const(EYE_PLANE)
-_param3 returns the four plane equation coefficients that specify
-eye linear-coordinate generation.
-Integer values,
-when requested,
-are mapped directly from the internal floating-point representation.
-The returned values are those maintained in eye coordinates.
-They are not equal to the values specified using _cmnd(TexGen),
-unless the modelview matrix was identity when _cmnd(TexGen) was called.
-.SH NOTES
-If an error is generated,
-no change is made to the contents of _param3.
-.P
-When the _arbstring(multitexture) extension is supported, _cmnd returns
-the texture coordinate generation parameters for the active texture unit.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 or _param2 is not an
-accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(ActiveTextureARB),
-_cmnd(TexGen)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getteximage.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/getteximage.gl
deleted file mode 100755
index 2c550c466..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/getteximage.gl
+++ /dev/null
@@ -1,218 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GetTexImage,return a texture image)
-_names(GetTexImage)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies which texture is to be obtained.
-_const(TEXTURE_1D), _const(TEXTURE_2D), and _const(TEXTURE_3D) are accepted.
-_phead(_param2)
-Specifies the level-of-detail number of the desired image.
-Level 0 is the base image level.
-Level $n$ is the $n$th mipmap reduction image.
-_phead(_param3)
-Specifies a pixel format for the returned data.
-The supported formats are
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(BGR),
-_const(RGBA),
-_const(BGRA),
-_C_ _const(ABGR_EXT),
-_const(LUMINANCE), and
-_const(LUMINANCE_ALPHA).
-_phead(_param4)
-Specifies a pixel type for the returned data.
-The supported types are
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV).
-_phead(_param5)
-Returns the texture image.
-Should be a pointer to an array of the type specified by _param4.
-.SH DESCRIPTION
-_cmnd returns a texture image into _param5.
-_param1 specifies whether the desired texture image is one specified by
-_cmnd(TexImage1D) (_const(TEXTURE_1D)),
-_cmnd(TexImage2D) (_const(TEXTURE_2D)), or
-_cmnd(TexImage3D) (_const(TEXTURE_3D)).
-_param2 specifies the level-of-detail number of the desired image.
-_param3 and _param4 specify the format and type of the desired image array.
-See the reference pages _cmnd(TexImage1D) and _cmnd(DrawPixels)
-for a description of the acceptable values for the _param3 and _param4
-parameters, respectively.
-.P
-To understand the operation of _cmnd, consider the selected internal
-four-component texture image to be an RGBA color buffer the size of the image.
-The semantics of _cmnd are then identical to those of _cmnd(ReadPixels),
-with the exception that no pixel transfer operations are performed,
-when called with the same _param3 and _param4,
-with \f2x\fP and \f2y\fP set to 0,
-\f2width\fP set to the width of the texture image
-(including border if one was specified),
-and \f2height\fP set to 1 for 1D images,
-or to the height of the texture image
-(including border if one was specified)
-for 2D images.
-.BP
-Because the internal texture image is an RGBA image,
-pixel formats _const(COLOR_INDEX),
-_const(STENCIL_INDEX),
-and _const(DEPTH_COMPONENT) are not accepted,
-and pixel type _const(BITMAP) is not accepted.
-.P
-If the selected texture image does not contain four components,
-the following mappings are applied.
-Single-component textures are treated as RGBA buffers with red set
-to the single-component value,
-green set to 0, blue set to 0, and alpha set to 1.
-Two-component textures are treated as RGBA buffers with red set to
-the value of component zero,
-alpha set to the value of component one,
-and green and blue set to 0.
-Finally,
-three-component textures are treated as RGBA buffers with red set to
-component zero,
-green set to component one,
-blue set to component two,
-and alpha set to 1.
-.P
-To determine the required size of _param5,
-use _cmnd(GetTexLevelParameter) to determine the dimensions of the
-internal texture image,
-then scale the required number of pixels by the storage required for
-each pixel,
-based on _param3 and _param4.
-Be sure to take the pixel storage parameters into account,
-especially _const(PACK_ALIGNMENT).
-.SH NOTES
-If an error is generated,
-no change is made to the contents of _param5.
-.P
-When the _arbstring(multitexture) extension is supported, _cmnd returns
-the texture image for the active texture unit.
-.P
-The types _const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2),
-_const(UNSIGNED_INT_2_10_10_10_REV),
-and the formats
-_const(BGR), and _const(BGRA) are available only if the GL version is
-1.2 or greater.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1, _param3, or _param4 is not
-an accepted value.
-.P
-_const(INVALID_VALUE) is generated if _param2 is less than 0.
-.P
-_const(INVALID_VALUE) may be generated if _param2 is greater
-than $log sub 2 max$,
-where $max$ is the returned value of _const(MAX_TEXTURE_SIZE).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.P
-_const(INVALID_OPERATION) is returned if _param4 is one of
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5), or
-_const(UNSIGNED_SHORT_5_6_5_REV) and _param3 is not _const(RGB).
-.P
-_const(INVALID_OPERATION) is returned if _param4 is one of
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV), and _param3 is neither _const(RGBA)
-or _const(BGRA).
-.SH ASSOCIATED GETS
-_cmnd(GetTexLevelParameter) with argument _const(TEXTURE_WIDTH)
-.br
-_cmnd(GetTexLevelParameter) with argument _const(TEXTURE_HEIGHT)
-.br
-_cmnd(GetTexLevelParameter) with argument _const(TEXTURE_BORDER)
-.br
-_cmnd(GetTexLevelParameter) with argument _const(TEXTURE_INTERNALFORMAT)
-.br
-_cmnd(Get) with arguments _const(PACK_ALIGNMENT) and others
-.SH SEE ALSO
-_cmnd(ActiveTextureARB),
-_cmnd(DrawPixels),
-_cmnd(ReadPixels),
-_cmnd(TexEnv),
-_cmnd(TexGen),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D),
-_cmnd(TexParameter)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/gettexlevelparameter.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/gettexlevelparameter.gl
deleted file mode 100755
index 01fdd7d73..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/gettexlevelparameter.gl
+++ /dev/null
@@ -1,184 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GetTexLevelParameter,return texture parameter values for a specific level of detail)
-_names(GetTexLevelParameter,[fi]v)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the symbolic name of the target texture,
-either _const(TEXTURE_1D), _const(TEXTURE_2D), _const(TEXTURE_3D),
-_const(PROXY_TEXTURE_1D), _const(PROXY_TEXTURE_2D), or
-_const(PROXY_TEXTURE_3D).
-_phead(_param2)
-Specifies the level-of-detail number of the desired image.
-Level 0 is the base image level.
-Level $n$ is the $n$th mipmap reduction image.
-_phead(_param3)
-Specifies the symbolic name of a texture parameter.
-_const(TEXTURE_WIDTH),
-_const(TEXTURE_HEIGHT),
-_const(TEXTURE_DEPTH),
-_const(TEXTURE_INTERNAL_FORMAT),
-_const(TEXTURE_BORDER),
-_const(TEXTURE_RED_SIZE),
-_const(TEXTURE_GREEN_SIZE),
-_const(TEXTURE_BLUE_SIZE),
-_const(TEXTURE_ALPHA_SIZE),
-_const(TEXTURE_LUMINANCE_SIZE), and
-_const(TEXTURE_INTENSITY_SIZE) are accepted.
-_phead(_param4)
-Returns the requested data.
-.SH DESCRIPTION
-_cmnd returns in _param4 texture parameter values for a specific
-level-of-detail value,
-specified as _param2.
-_param1 defines the target texture,
-either _const(TEXTURE_1D), _const(TEXTURE_2D), _const(TEXTURE_3D),
-_const(PROXY_TEXTURE_1D),
-_const(PROXY_TEXTURE_2D), or
-_const(PROXY_TEXTURE_3D).
-.BR
-.P
-_const(MAX_TEXTURE_SIZE), and _const(MAX_3D_TEXTURE_SIZE) are not really
-descriptive enough.
-It has to report the largest square texture image that can be
-accommodated with mipmaps and borders,
-but a long skinny texture, or a texture without mipmaps and borders, may
-easily fit in texture memory.
-The proxy targets allow the user to more accurately query
-whether the GL can accommodate a texture of a given configuration.
-If the texture cannot be accommodated, the texture state variables, which
-may be queried with _cmnd, are set to 0. If the texture can be accommodated,
-the texture state values will be set as they would be set for a
-non-proxy target.
-.P
-_param3 specifies the texture parameter whose value or values
-will be returned.
-.P
-The accepted parameter names are as follows:
-.TP 10
-_const(TEXTURE_WIDTH)
-_param4 returns a single value,
-the width of the texture image.
-This value includes the border of the texture image. The initial value is
-0.
-.TP
-_const(TEXTURE_HEIGHT)
-_param4 returns a single value,
-the height of the texture image.
-This value includes the border of the texture image. The initial value is
-0.
-.TP
-_const(TEXTURE_DEPTH)
-_param4 returns a single value,
-the depth of the texture image.
-This value includes the border of the texture image. The initial value is
-0.
-.TP
-_const(TEXTURE_INTERNAL_FORMAT)
-_param4 returns a single value,
-the internal format of the texture image.
-.TP
-_const(TEXTURE_BORDER)
-_param4 returns a single value,
-the width in pixels of the border of the texture image. The initial value
-is 0.
-.TP
-_const(TEXTURE_RED_SIZE),
-.TP
-_const(TEXTURE_GREEN_SIZE),
-.TP
-_const(TEXTURE_BLUE_SIZE),
-.TP
-_const(TEXTURE_ALPHA_SIZE),
-.TP
-_const(TEXTURE_LUMINANCE_SIZE),
-.TP
-_const(TEXTURE_INTENSITY_SIZE)
-The internal storage resolution of an individual component.
-The resolution chosen by the GL will be a close match for the resolution
-requested by the user with the component argument of _cmnd(TexImage1D),
-_cmnd(TexImage2D), _cmnd(TexImage3D), _cmnd(CopyTexImage1D), and
-_cmnd(CopyTexImage2D). The initial value is 0.
-.SH NOTES
-If an error is generated,
-no change is made to the contents of _param4.
-.P
-_const(TEXTURE_INTERNAL_FORMAT) is available only if the GL version is
-1.1 or greater. In version 1.0, use _const(TEXTURE_COMPONENTS)
-instead.
-.P
-_const(PROXY_TEXTURE_1D) and _const(PROXY_TEXTURE_2D) are
-available only if the GL version is 1.1 or greater.
-.P
-_const(TEXTURE_3D), _const(PROXY_TEXTURE_3D), and _const(TEXTURE_DEPTH)
-are available only if the GL version is 1.2 or greater.
-.P
-When the _arbstring(multitexture) extension is supported, _cmnd returns
-the texture level parameters for the active texture unit.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 or _param3 is not an
-accepted value.
-.P
-_const(INVALID_VALUE) is generated if _param2 is less than 0.
-.P
-_const(INVALID_VALUE) may be generated if _param2 is greater
-than $ log sub 2$ \f2max\fP,
-where \f2max\fP is the returned value of _const(MAX_TEXTURE_SIZE).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(ActiveTextureARB),
-_cmnd(GetTexParameter),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(TexEnv),
-_cmnd(TexGen),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D),
-_cmnd(TexParameter)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/gettexparameter.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/gettexparameter.gl
deleted file mode 100755
index 85d3d71d4..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/gettexparameter.gl
+++ /dev/null
@@ -1,147 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GetTexParameter,return texture parameter values)
-_names(GetTexParameter,[fi]v)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the symbolic name of the target texture.
-_const(TEXTURE_1D),_const(TEXTURE_2D), and _const(TEXTURE_3D) are accepted.
-_phead(_param2)
-Specifies the symbolic name of a texture parameter.
-_const(TEXTURE_MAG_FILTER),
-_const(TEXTURE_MIN_FILTER),
-_const(TEXTURE_MIN_LOD),
-_const(TEXTURE_MAX_LOD),
-_const(TEXTURE_BASE_LEVEL),
-_const(TEXTURE_MAX_LEVEL),
-_const(TEXTURE_WRAP_S),
-_const(TEXTURE_WRAP_T),
-_const(TEXTURE_WRAP_R),
-_const(TEXTURE_BORDER_COLOR),
-_const(TEXTURE_PRIORITY), and
-_const(TEXTURE_RESIDENT) are accepted.
-_phead(_param3)
-Returns the texture parameters.
-.SH DESCRIPTION
-_cmnd returns in _param3 the value or values of the texture parameter
-specified as _param2.
-_param1 defines the target texture,
-either _const(TEXTURE_1D), _const(TEXTURE_2D), or _const(TEXTURE_3D)
-to specify one-, two-, or three-dimensional texturing.
-_param2 accepts the same symbols as _cmnd(TexParameter),
-with the same interpretations:
-.TP 35
-_const(TEXTURE_MAG_FILTER)
-Returns the single-valued texture magnification filter,
-a symbolic constant. The initial value is _const(LINEAR).
-.TP
-_const(TEXTURE_MIN_FILTER)
-Returns the single-valued texture minification filter,
-a symbolic constant. The initial value is _const(NEAREST_MIPMAP_LINEAR).
-.TP
-_const(TEXTURE_MIN_LOD)
-Returns the single-valued texture minimum level-of-detail value. The
-initial value is $-1000$.
-.TP
-_const(TEXTURE_MAX_LOD)
-Returns the single-valued texture maximum level-of-detail value. The
-initial value is 1000.
-.TP
-_const(TEXTURE_BASE_LEVEL)
-Returns the single-valued base texture mipmap level. The initial value is 0.
-.TP
-_const(TEXTURE_MAX_LEVEL)
-Returns the single-valued maximum texture mipmap array level. The initial
-value is 1000.
-.TP
-_const(TEXTURE_WRAP_S)
-Returns the single-valued wrapping function for texture coordinate $s$,
-a symbolic constant. The initial value is _const(REPEAT).
-.TP
-_const(TEXTURE_WRAP_T)
-Returns the single-valued wrapping function for texture coordinate $t$,
-a symbolic constant. The initial value is _const(REPEAT).
-.TP
-_const(TEXTURE_WRAP_R)
-Returns the single-valued wrapping function for texture coordinate $r$,
-a symbolic constant. The initial value is _const(REPEAT).
-.BP
-.TP
-_const(TEXTURE_BORDER_COLOR)
-Returns four integer or floating-point numbers that comprise the RGBA color
-of the texture border.
-Floating-point values are returned in the range [0, 1].
-Integer values are returned as a linear mapping of the internal floating-point
-representation such that 1.0 maps to the most positive representable
-integer and \-1.0 maps to the most negative representable
-integer. The initial value is (0, 0, 0, 0).
-.TP
-_const(TEXTURE_PRIORITY)
-Returns the residence priority of the target texture (or the named
-texture bound to it). The initial value is 1.
-See _cmnd(PrioritizeTextures).
-.TP
-_const(TEXTURE_RESIDENT)
-Returns the residence status of the target texture.
-If the value returned in _param3 is _const(TRUE), the texture is
-resident in texture memory.
-See _cmnd(AreTexturesResident).
-.SH NOTES
-_const(TEXTURE_PRIORITY) and _const(TEXTURE_RESIDENT) are
-available only if the GL version is 1.1 or greater.
-.P
-_const(TEXTURE_3D),
-_const(TEXTURE_MIN_LOD), _const(TEXTURE_MAX_LOD), _const(TEXTURE_BASE_LEVEL),
-_const(TEXTURE_MAX_LEVEL), and _const(TEXTURE_WRAP_R) are available only
-if the GL version is 1.2 or greater.
-.P
-If an error is generated,
-no change is made to the contents of _param3.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 or _param2 is not an
-accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(AreTexturesResident),
-_cmnd(PrioritizeTextures),
-_cmnd(TexParameter)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/hint.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/hint.gl
deleted file mode 100755
index 97b113562..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/hint.gl
+++ /dev/null
@@ -1,118 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Hint,specify implementation-specific hints)
-_names(Hint)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a symbolic constant indicating the behavior to be controlled.
-_const(FOG_HINT),
-_const(LINE_SMOOTH_HINT),
-_const(PERSPECTIVE_CORRECTION_HINT),
-_const(POINT_SMOOTH_HINT), and
-_const(POLYGON_SMOOTH_HINT) are accepted.
-_phead(_param2)
-Specifies a symbolic constant indicating the desired behavior.
-_const(FASTEST),
-_const(NICEST), and
-_const(DONT_CARE) are accepted.
-.SH DESCRIPTION
-Certain aspects of GL behavior,
-when there is room for interpretation,
-can be controlled with hints.
-A hint is specified with two arguments.
-_param1 is a symbolic
-constant indicating the behavior to be controlled,
-and _param2 is another symbolic constant indicating the desired
-behavior. The initial value for each _param1 is _const(DONT_CARE).
-_param2 can be one of the following:
-.TP 20
-_const(FASTEST)
-The most efficient option should be chosen.
-.TP
-_const(NICEST)
-The most correct,
-or highest quality,
-option should be chosen.
-.TP
-_const(DONT_CARE)
-No preference.
-.P
-Though the implementation aspects that can be hinted are well defined,
-the interpretation of the hints depends on the implementation.
-The hint aspects that can be specified with _param1,
-along with suggested semantics,
-are as follows:
-.TP 20
-_const(FOG_HINT)
-Indicates the accuracy of fog calculation.
-If per-pixel fog calculation is not efficiently supported
-by the GL implementation,
-hinting _const(DONT_CARE) or _const(FASTEST) can result in per-vertex
-calculation of fog effects.
-.TP
-_const(LINE_SMOOTH_HINT)
-Indicates the sampling quality of antialiased lines.
-If a larger filter function is applied, hinting _const(NICEST) can
-result in more pixel fragments being generated during rasterization,
-.TP
-_const(PERSPECTIVE_CORRECTION_HINT)
-Indicates the quality of color and texture coordinate interpolation.
-If perspective-corrected parameter interpolation is not efficiently supported
-by the GL implementation,
-hinting _const(DONT_CARE) or _const(FASTEST) can result in simple linear
-interpolation of colors and/or texture coordinates.
-.TP
-_const(POINT_SMOOTH_HINT)
-Indicates the sampling quality of antialiased points.
-If a larger filter function is applied, hinting _const(NICEST) can
-result in more pixel fragments being generated during rasterization,
-.TP
-_const(POLYGON_SMOOTH_HINT)
-Indicates the sampling quality of antialiased polygons.
-Hinting _const(NICEST) can result in more pixel fragments being generated
-during rasterization,
-if a larger filter function is applied.
-.SH NOTES
-The interpretation of hints depends on the implementation.
-Some implementations ignore _cmnd(Hint) settings.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if either _param1 or _param2 is not
-an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/histogram.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/histogram.gl
deleted file mode 100755
index 011a0782e..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/histogram.gl
+++ /dev/null
@@ -1,151 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_header(Histogram,define histogram table)
-_names(Histogram)
-.EQ
-delim $$
-.EN
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__width>@,@<_param2>@)_C_
-_define(@<__internalformat>@,@<_param3>@)_C_
-_define(@<__sink>@,@<_param4>@)_C_
-.SH PARAMETERS
-_phead(__target)
-The histogram whose parameters are to be set.
-Must be one of
-_const(HISTOGRAM) or
-_const(PROXY_HISTOGRAM).
-_phead(__width)
-The number of entries in the histogram table. Must be a power of 2.
-_phead(__internalformat)
-The format of entries in the histogram table.
-Must be one of
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(R3_G3_B2),
-_const(RGB),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12), or
-_const(RGBA16).
-_phead(__sink)
-If _const(TRUE), pixels will be consumed by the histogramming
-process and no drawing or texture loading will take place.
-If _const(FALSE), pixels will proceed to the minmax process after
-histogramming.
-.SH DESCRIPTION
-When _const(HISTOGRAM) is enabled, RGBA color components are converted to
-histogram table indices by clamping to the range [0,1], multiplying by
-the width of the histogram table, and rounding to the nearest integer.
-The table entries selected by the RGBA indices are then incremented.
-(If the internal format of the histogram table includes luminance, then
-the index derived from the R color component determines the luminance
-table entry to be incremented.) If a histogram table entry is incremented
-beyond its maximum value, then its value becomes undefined. (This is
-not an error.)
-.PP
-Histogramming is performed only for RGBA pixels (though these may
-be specified originally as color indices and converted to RGBA by
-index table lookup).
-Histogramming is enabled with _cmnd(Enable) and disabled with _cmnd(Disable).
-.PP
-When __target is _const(HISTOGRAM), _cmnd redefines the current
-histogram table to have __width entries of the format specified by
-__internalformat.
-The entries are indexed 0 through $_eqnparam2 ~-~ 1$, and
-all entries are initialized to zero.
-The values in the previous histogram table, if any, are lost.
-If __sink is _const(TRUE), then pixels are discarded after histogramming;
-no further processing of the pixels takes place, and no drawing,
-texture loading, or pixel readback will result.
-.PP
-When __target is _const(PROXY_HISTOGRAM), _cmnd computes all
-state information as if the histogram table were to be redefined,
-but does not actually define the new table.
-If the requested histogram table is too large to be supported, then the
-state information will be set to zero.
-This provides a way to determine if a histogram table with the given
-parameters can be supported.
-.PP
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not one of the allowable
-values.
-.P
-_const(INVALID_VALUE) is generated if __width is less than zero or is
-not a power of 2.
-.P
-_const(INVALID_ENUM) is generated if __internalformat is not one of the
-allowable values.
-.P
-_const(TABLE_TOO_LARGE) is generated if __target is _const(HISTOGRAM)
-and the histogram table specified is too large for the implementation.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetHistogramParameter)
-.SH SEE ALSO
-_cmnd(GetHistogram),
-_cmnd(ResetHistogram)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/index.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/index.gl
deleted file mode 100755
index 6d52d3b06..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/index.gl
+++ /dev/null
@@ -1,77 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Index,set the current color index)
-.P
-_names(Index,u*[bsifd])
-.SH PARAMETERS
-_phead(_param1)
-Specifies the new value for the current color index.
-.P
-_names(Index,u*[bsifd]v)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a pointer to a one-element array that contains
-the new value for the current color index.
-.SH DESCRIPTION
-_cmnd updates the current (single-valued) color index.
-It takes one argument, the new value for the current color index.
-.P
-The current index is stored as a floating-point value.
-Integer values are converted directly to floating-point values,
-with no special mapping.
-The initial value is 1.
-.P
-Index values outside the representable range of the color index buffer
-are not clamped.
-However,
-before an index is dithered (if enabled) and written to the frame buffer,
-it is converted to fixed-point format.
-Any bits in the integer portion of the resulting fixed-point value
-that do not correspond to bits in the frame buffer are masked out.
-.SH NOTES
-_cmnd(Indexub) and _cmnd(Indexubv) are available only if the GL version is
-1.1 or greater.
-.P
-The current index can be updated at any time.
-In particular,
-_cmnd can be called between a call to _cmnd(Begin) and the corresponding
-call to _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(CURRENT_INDEX)
-.SH SEE ALSO
-_cmnd(Color),
-_cmnd(IndexPointer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/indexmask.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/indexmask.gl
deleted file mode 100755
index 239dbdf04..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/indexmask.gl
+++ /dev/null
@@ -1,74 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(IndexMask,control the writing of individual bits in the color index buffers)
-_names(IndexMask)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies a bit mask to enable and disable the writing of individual bits
-in the color index buffers.
-Initially, the mask is all 1's.
-.SH DESCRIPTION
-_cmnd controls the writing of individual bits in the color index buffers.
-The least significant $n$ bits of _param1,
-where $n$ is the number of bits in a color index buffer,
-specify a mask.
-Where a 1 (one) appears in the mask,
-it's possible to write to the corresponding bit in the color index
-buffer (or buffers).
-Where a 0 (zero) appears,
-the corresponding bit is write-protected.
-.P
-This mask is used only in color index mode,
-and it affects only the buffers currently selected for writing
-(see _cmnd(DrawBuffer)).
-Initially, all bits are enabled for writing.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(INDEX_WRITEMASK)
-.SH SEE ALSO
-_cmnd(ColorMask),
-_cmnd(DepthMask),
-_cmnd(DrawBuffer),
-_cmnd(Index),
-_cmnd(IndexPointer),
-_cmnd(StencilMask)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/indexpointer.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/indexpointer.gl
deleted file mode 100755
index fa8c1026b..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/indexpointer.gl
+++ /dev/null
@@ -1,138 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_C_ A real line follows.
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_C_ Use GL not OpenGL
-_C_ Don't change the ordering of the main headers.
-_C_ C specification (or fortran) is handled automatically
-_C_ .TH is automatically added to the top of this file.
-_C_ Below, use current tense, active do not capitalize the first word and dont
-_C_ use a period.
-_C_ the function name must appear in (APIFILE) (usually gl.h) as set in
-_C_ Makefile.
-_header(IndexPointer,define an array of color indexes)
-_names(IndexPointer)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the data type of each color index in the array.
-Symbolic constants
-_const(UNSIGNED_BYTE),
-_const(SHORT),
-_const(INT),
-_const(FLOAT),
-and _const(DOUBLE)
-are accepted. The initial value is _const(FLOAT).
-_phead(_param2)
-Specifies the byte offset between consecutive color indexes.
-If _param2 is 0 (the initial value), the color indexes are understood to
-be tightly packed in the array.
-The initial value is 0.
-_phead(_param3)
-Specifies a pointer to the first index in the array.
-The initial value is 0.
-.SH DESCRIPTION
-_cmnd specifies the location and data format of an array of color indexes
-to use when rendering.
-_param1 specifies the data type of
-each color index and _param2 gives the byte stride from one
-color index to the next allowing vertices and attributes
-to be packed into a single array or stored in separate arrays.
-(Single-array storage may be more efficient on some implementations;
-see _cmnd(InterleavedArrays).)
-.P
-_param1, _param2, and _param3 are saved as client-side
-state.
-.P
-The color index array is initially disabled. To enable and disable
-the array, call _cmnd(EnableClientState) and
-_cmnd(DisableClientState) with the argument _const(INDEX_ARRAY). If
-enabled, the color index array is used when _cmnd(DrawArrays),
-_cmnd(DrawElements) or _cmnd(ArrayElement) is called.
-.P
-Use _cmnd(DrawArrays) to construct a sequence of primitives (all of
-the same type) from prespecified vertex and vertex attribute arrays.
-Use _cmnd(ArrayElement) to specify primitives
-by indexing vertices and vertex attributes and _cmnd(DrawElements) to
-construct a sequence of primitives by indexing vertices and vertex attributes.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-The color index array is initially disabled, and it isn't accessed when
-_cmnd(ArrayElement), _cmnd(DrawElements), or _cmnd(DrawArrays) is called.
-.P
-Execution of _cmnd is not allowed between
-_cmnd(Begin) and the corresponding _cmnd(End),
-but an error may or may not be generated. If an error is not generated,
-the operation is undefined.
-.P
-_cmnd is typically implemented on the client side.
-.P
-Since the color index array parameters are client-side state, they are
-not saved or restored by _cmnd(PushAttrib) and _cmnd(PopAttrib).
-Use _cmnd(PushClientAttrib) and
-_cmnd(PopClientAttrib) instead.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_VALUE) is generated if _param2 is negative.
-.SH ASSOCIATED GETS
-_cmnd(IsEnabled) with argument _const(INDEX_ARRAY)
-.br
-_cmnd(Get) with argument _const(INDEX_ARRAY_TYPE)
-.br
-_cmnd(Get) with argument _const(INDEX_ARRAY_STRIDE)
-.br
-_cmnd(GetPointerv) with argument _const(INDEX_ARRAY_POINTER)
-.SH SEE ALSO
-_C_ no queries or gets listed above, alphabetize commands,
-_C_ seperate with commas not .br. no command appears in the associated gets
-_C_ as well as in SEE ALSO.
-_cmnd(ArrayElement),
-_cmnd(ColorPointer),
-_cmnd(DrawArrays),
-_cmnd(DrawElements),
-_cmnd(EdgeFlagPointer),
-_cmnd(Enable),
-_cmnd(GetPointerv),
-_cmnd(InterleavedArrays),
-_cmnd(NormalPointer),
-_cmnd(PopClientAttrib),
-_cmnd(PushClientAttrib),
-_cmnd(TexCoordPointer),
-_cmnd(VertexPointer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/initnames.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/initnames.gl
deleted file mode 100755
index 1316454be..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/initnames.gl
+++ /dev/null
@@ -1,57 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_header(InitNames,initialize the name stack)
-_names(InitNames)
-.SH DESCRIPTION
-The name stack is used during selection mode to allow sets of rendering
-commands to be uniquely identified.
-It consists of an ordered set of unsigned integers.
-_cmnd causes the name stack to be initialized to its default empty state.
-.P
-The name stack is always empty while the render mode is not _const(SELECT).
-Calls to _cmnd while the render mode is not _const(SELECT) are ignored.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin) and the corresponding execution of
-_cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(NAME_STACK_DEPTH)
-.br
-_cmnd(Get) with argument _const(MAX_NAME_STACK_DEPTH)
-.SH SEE ALSO
-_cmnd(LoadName),
-_cmnd(PushName),
-_cmnd(RenderMode),
-_cmnd(SelectBuffer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/interleavedarrays.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/interleavedarrays.gl
deleted file mode 100755
index 0f8dfecdb..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/interleavedarrays.gl
+++ /dev/null
@@ -1,130 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_C_ A real line follows.
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_C_ Use GL not OpenGL
-_C_ Don't change the ordering of the main headers.
-_C_ C specification (or fortran) is handled automatically
-_C_ .TH is automatically added to the top of this file.
-_C_ Below, use current tense, active do not capitalize the first word
-_C_ and don't use a period.
-_header(InterleavedArrays, simultaneously specify and enable several interleaved arrays)
-_names(InterleavedArrays)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the type of array to enable. Symbolic constants
-_const(V2F),
-_const(V3F),
-_const(C4UB_V2F),
-_const(C4UB_V3F),
-_const(C3F_V3F),
-_const(N3F_V3F),
-_const(C4F_N3F_V3F),
-_const(T2F_V3F),
-_const(T4F_V4F),
-_const(T2F_C4UB_V3F),
-_const(T2F_C3F_V3F),
-_const(T2F_N3F_V3F),
-_const(T2F_C4F_N3F_V3F),
-and
-_const(T4F_C4F_N3F_V4F)
-are accepted.
-_phead(_param2)
-Specifies the offset in bytes between each aggregate array element.
-.SH DESCRIPTION
-_cmnd lets you specify and enable individual color,
-normal,
-texture and vertex
-arrays whose elements are part of a larger aggregate array element.
-For some implementations, this is more efficient than specifying the arrays
-separately.
-.P
-If _param2 is 0, the aggregate elements are stored consecutively.
-Otherwise, _param2 bytes occur between the beginning of one
-aggregate array element and the beginning of the next aggregate array
-element.
-.P
-_param1 serves as a ``key''
-describing the extraction of individual arrays from the aggregate array.
-If _param1 contains a T, then texture coordinates are
-extracted from the interleaved array. If C is present, color values
-are extracted. If N is present, normal coordinates are extracted.
-Vertex coordinates are always extracted.
-.P
-The digits 2, 3, and 4 denote how many values are extracted.
-F indicates that values are extracted as floating-point values.
-Colors may also be extracted as 4 unsigned bytes if 4UB follows the
-C. If a color is extracted as 4 unsigned bytes, the vertex
-array element which follows is located at the first possible
-floating-point aligned address.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-If _cmnd is called while compiling a display list, it is not
-compiled into the list, and it is executed immediately.
-.P
-Execution of _cmnd is not allowed between the execution of
-_cmnd(Begin) and the corresponding execution of _cmnd(End),
-but an error may or may not be generated. If no error is generated,
-the operation is undefined.
-.P
-_cmnd is typically implemented on the client side.
-.P
-Vertex array parameters are client-side state and are therefore not
-saved or restored by _cmnd(PushAttrib) and _cmnd(PopAttrib).
-Use _cmnd(PushClientAttrib) and _cmnd(PopClientAttrib) instead.
-.P
-When the _arbstring(multitexture) extension is supported, _cmnd
-only updates the texture coordinate array for the active active texture
-unit. The texture coordinate state for other client texture units is not
-update, regardless if they are enabled or not.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_VALUE) is generated if _param2 is negative.
-.SH SEE ALSO
-_cmnd(ArrayElement),
-_cmnd(ClientActiveTextureARB),
-_cmnd(ColorPointer),
-_cmnd(DrawArrays),
-_cmnd(DrawElements),
-_cmnd(EdgeFlagPointer),
-_cmnd(EnableClientState),
-_cmnd(GetPointer),
-_cmnd(IndexPointer),
-_cmnd(NormalPointer),
-_cmnd(TexCoordPointer),
-_cmnd(VertexPointer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/isenabled.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/isenabled.gl
deleted file mode 100755
index a5cf7e5fc..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/isenabled.gl
+++ /dev/null
@@ -1,177 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn|tbl)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(IsEnabled, test whether a capability is enabled)
-_names(IsEnabled)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a symbolic constant indicating a GL capability.
-.SH DESCRIPTION
-_cmnd returns _const(TRUE) if _param1 is an enabled capability
-and returns _const(FALSE) otherwise.
-Initially all capabilities except _const(DITHER) are disabled;
-_const(DITHER) is initially enabled.
-.P
-The following capabilities are accepted for _param1:
-.P
-
-.TS
-lb lb
-l l.
-_
-Constant See
-_
-_const(ALPHA_TEST) _cmnd(AlphaFunc)
-_const(AUTO_NORMAL) _cmnd(EvalCoord)
-_const(BLEND) _cmnd(BlendFunc), _cmnd(LogicOp)
-_const(CLIP_PLANE)\f2i\fP _cmnd(ClipPlane)
-_const(COLOR_ARRAY) _cmnd(ColorPointer)
-_const(COLOR_LOGIC_OP) _cmnd(LogicOp)
-_const(COLOR_MATERIAL) _cmnd(ColorMaterial)
-_const(COLOR_TABLE) _cmnd(ColorTable)
-_const(CONVOLUTION_1D) _cmnd(ConvolutionFilter1D)
-_const(CONVOLUTION_2D) _cmnd(ConvolutionFilter2D)
-_const(CULL_FACE) _cmnd(CullFace)
-_const(DEPTH_TEST) _cmnd(DepthFunc), _cmnd(DepthRange)
-_const(DITHER) _cmnd(Enable)
-_const(EDGE_FLAG_ARRAY) _cmnd(EdgeFlagPointer)
-_const(FOG) _cmnd(Fog)
-_const(HISTOGRAM) _cmnd(Histogram)
-_const(INDEX_ARRAY) _cmnd(IndexPointer)
-_const(INDEX_LOGIC_OP) _cmnd(LogicOp)
-_const(LIGHT)\f2i\fP _cmnd(LightModel), _cmnd(Light)
-_const(LIGHTING) _cmnd(Material), _cmnd(LightModel), _cmnd(Light)
-_const(LINE_SMOOTH) _cmnd(LineWidth)
-_const(LINE_STIPPLE) _cmnd(LineStipple)
-_const(MAP1_COLOR_4) _cmnd(Map1)
-_const(MAP1_INDEX) _cmnd(Map1)
-_const(MAP1_NORMAL) _cmnd(Map1)
-_const(MAP1_TEXTURE_COORD_1) _cmnd(Map1)
-_const(MAP1_TEXTURE_COORD_2) _cmnd(Map1)
-_const(MAP1_TEXTURE_COORD_3) _cmnd(Map1)
-_const(MAP1_TEXTURE_COORD_4) _cmnd(Map1)
-_const(MAP2_COLOR_4) _cmnd(Map2)
-_const(MAP2_INDEX) _cmnd(Map2)
-_const(MAP2_NORMAL) _cmnd(Map2)
-_const(MAP2_TEXTURE_COORD_1) _cmnd(Map2)
-_const(MAP2_TEXTURE_COORD_2) _cmnd(Map2)
-_const(MAP2_TEXTURE_COORD_3) _cmnd(Map2)
-_const(MAP2_TEXTURE_COORD_4) _cmnd(Map2)
-_const(MAP2_VERTEX_3) _cmnd(Map2)
-_const(MAP2_VERTEX_4) _cmnd(Map2)
-_const(MINMAX) _cmnd(Minmax)
-_const(NORMAL_ARRAY) _cmnd(NormalPointer)
-_const(NORMALIZE) _cmnd(Normal)
-_const(POINT_SMOOTH) _cmnd(PointSize)
-_const(POLYGON_SMOOTH) _cmnd(PolygonMode)
-_const(POLYGON_OFFSET_FILL) _cmnd(PolygonOffset)
-_const(POLYGON_OFFSET_LINE) _cmnd(PolygonOffset)
-_const(POLYGON_OFFSET_POINT) _cmnd(PolygonOffset)
-_const(POLYGON_STIPPLE) _cmnd(PolygonStipple)
-_const(POST_COLOR_MATRIX_COLOR_TABLE) _cmnd(ColorTable)
-_const(POST_CONVOLUTION_COLOR_TABLE) _cmnd(ColorTable)
-_const(RESCALE_NORMAL) _cmnd(Normal)
-_const(SCISSOR_TEST) _cmnd(Scissor)
-_const(SEPARABLE_2D) _cmnd(SeparableFilter2D)
-_const(STENCIL_TEST) _cmnd(StencilFunc), _cmnd(StencilOp)
-_const(TEXTURE_1D) _cmnd(TexImage1D)
-_const(TEXTURE_2D) _cmnd(TexImage2D)
-_const(TEXTURE_3D) _cmnd(TexImage3D)
-_const(TEXTURE_COORD_ARRAY) _cmnd(TexCoordPointer)
-_const(TEXTURE_GEN_Q) _cmnd(TexGen)
-_const(TEXTURE_GEN_R) _cmnd(TexGen)
-_const(TEXTURE_GEN_S) _cmnd(TexGen)
-_const(TEXTURE_GEN_T) _cmnd(TexGen)
-_const(VERTEX_ARRAY) _cmnd(VertexPointer)
-_
-.TE
-
-.SH NOTES
-If an error is generated,
-_cmnd returns 0.
-.P
-_const(COLOR_LOGIC_OP),
-_const(COLOR_ARRAY),
-_const(EDGE_FLAG_ARRAY),
-_const(INDEX_ARRAY),
-_const(INDEX_LOGIC_OP),
-_const(NORMAL_ARRAY),
-_const(POLYGON_OFFSET_FILL),
-_const(POLYGON_OFFSET_LINE),
-_const(POLYGON_OFFSET_POINT),
-_const(TEXTURE_COORD_ARRAY), and
-_const(VERTEX_ARRAY)
-are available only
-if the GL version is 1.1 or greater
-.P
-_const(RESCALE_NORMAL), and _const(TEXTURE_3D) are available only if the GL
-version is 1.2 or greater.
-.P
-_const(COLOR_TABLE), _const(CONVOLUTION_1D), _const(CONVOLUTION_2D),
-_const(HISTOGRAM), _const(MINMAX),
-_const(POST_COLOR_MATRIX_COLOR_TABLE),
-_const(POST_CONVOLUTION_COLOR_TABLE), and
-_const(SEPARABLE_2D) are available only if _arbstring(imaging) is
-returned when _cmnd(Get) is called with _const(EXTENSIONS).
-.P
-When the _arbstring(multitexture) extension is supported, the following
-parameters return the associated value for the active texture unit.
-_const(TEXTURE_1D), _const(TEXTURE_BINDING_1D),
-_const(TEXTURE_2D), _const(TEXTURE_BINDING_2D),
-_const(TEXTURE_3D), _const(TEXTURE_BINDING_3D),
-_const(TEXTURE_GEN_S),
-_const(TEXTURE_GEN_T),
-_const(TEXTURE_GEN_R),
-_const(TEXTURE_GEN_Q),
-_const(TEXTURE_MATRIX), and
-_const(TEXTURE_STACK_DEPTH).
-Likewise, the following parameters return the associated value for the
-active client texture unit:
-_const(TEXTURE_COORD_ARRAY),
-_const(TEXTURE_COORD_ARRAY_SIZE),
-_const(TEXTURE_COORD_ARRAY_STRIDE),
-_const(TEXTURE_COORD_ARRAY_TYPE).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(Enable),
-_cmnd(EnableClientState),
-_cmnd(Get)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/islist.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/islist.gl
deleted file mode 100755
index 0bb918aac..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/islist.gl
+++ /dev/null
@@ -1,55 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(IsList,determine if a name corresponds to a display-list)
-_names(IsList)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a potential display-list name.
-.SH DESCRIPTION
-_cmnd returns _const(TRUE) if _param1 is the name
-of a display list and returns _const(FALSE) otherwise.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of
-_cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(CallList),
-_cmnd(CallLists),
-_cmnd(DeleteLists),
-_cmnd(GenLists),
-_cmnd(NewList)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/istexture.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/istexture.gl
deleted file mode 100755
index 6358162e4..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/istexture.gl
+++ /dev/null
@@ -1,63 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(IsTexture,determine if a name corresponds to a texture)
-_names(IsTexture)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a value that may be the name of a texture.
-.SH DESCRIPTION
-_cmnd returns _const(TRUE) if _param1 is currently the name of a texture.
-If _param1 is zero, or is a non-zero value that is not currently the
-name of a texture, or if an error occurs, _cmnd returns _const(FALSE).
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(BindTexture),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(DeleteTextures),
-_cmnd(GenTextures),
-_cmnd(Get),
-_cmnd(GetTexParameter),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexParameter)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/light.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/light.gl
deleted file mode 100755
index 3b6da035d..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/light.gl
+++ /dev/null
@@ -1,240 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Light,set light source parameters)
-_names(Light,[fi])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies a light.
-The number of lights depends on the implementation,
-but at least eight lights are supported.
-They are identified by symbolic names of the form _const(LIGHT)$i$
-where 0 \(<= $ i $ < _const(MAX_LIGHTS).
-_phead(_param2)
-Specifies a single-valued light source parameter for _param1.
-_const(SPOT_EXPONENT),
-_const(SPOT_CUTOFF),
-_const(CONSTANT_ATTENUATION),
-_const(LINEAR_ATTENUATION), and
-_const(QUADRATIC_ATTENUATION) are accepted.
-_phead(_param3)
-Specifies the value that parameter _param2 of light source _param1
-will be set to.
-_names(Light,[fi]v)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a light.
-The number of lights depends on the implementation, but
-at least eight lights are supported.
-They are identified by symbolic names of the form _const(LIGHT)$i$
-where 0 \(<= $ i $ < _const(MAX_LIGHTS).
-_phead(_param2)
-Specifies a light source parameter for _param1.
-_const(AMBIENT),
-_const(DIFFUSE),
-_const(SPECULAR),
-_const(POSITION),
-_const(SPOT_CUTOFF),
-_const(SPOT_DIRECTION),
-_const(SPOT_EXPONENT),
-_const(CONSTANT_ATTENUATION),
-_const(LINEAR_ATTENUATION), and
-_const(QUADRATIC_ATTENUATION) are accepted.
-_phead(_param3)
-Specifies a pointer to the value or values that parameter _param2
-of light source _param1 will be set to.
-.SH DESCRIPTION
-_cmnd sets the values of individual light source parameters.
-_param1 names the light and is a symbolic name of the form _const(LIGHT)$i$,
-where 0 \(<= i < _const(MAX_LIGHTS).
-_param2 specifies one of ten light source parameters,
-again by symbolic name.
-_param3 is either a single value or a pointer to an array that contains
-the new values.
-.P
-To enable and disable lighting calculation, call _cmnd(Enable)
-and _cmnd(Disable) with argument _const(LIGHTING). Lighting is
-initially disabled.
-When it is enabled,
-light sources that are enabled contribute to the lighting calculation.
-Light source $i$ is enabled and disabled using _cmnd(Enable) and
-_cmnd(Disable) with argument _const(LIGHT)$i$.
-.P
-The ten light parameters are as follows:
-.TP 20
-_const(AMBIENT)
-_param3 contains four integer or floating-point values that specify
-the ambient RGBA intensity of the light.
-Integer values are mapped linearly such that the most positive representable
-value maps to 1.0,
-and the most negative representable value maps to \-1.0.
-Floating-point values are mapped directly.
-Neither integer nor floating-point values are clamped.
-The initial ambient light intensity is (0, 0, 0, 1).
-.TP
-_const(DIFFUSE)
-_param3 contains four integer or floating-point values that specify
-the diffuse RGBA intensity of the light.
-Integer values are mapped linearly such that the most positive representable
-value maps to 1.0,
-and the most negative representable value maps to \-1.0.
-Floating-point values are mapped directly.
-Neither integer nor floating-point values are clamped.
-The initial value
-for _const(LIGHT0) is (1, 1, 1, 1); for other lights, the
-initial value is (0, 0, 0, 0).
-.TP
-_const(SPECULAR)
-_param3 contains four integer or floating-point values that specify
-the specular RGBA intensity of the light.
-Integer values are mapped linearly such that the most positive representable
-value maps to 1.0,
-and the most negative representable value maps to \-1.0.
-Floating-point values are mapped directly.
-Neither integer nor floating-point values are clamped.
-The initial value
-for _const(LIGHT0) is (1, 1, 1, 1); for other lights, the
-initial value is (0, 0, 0, 0).
-.TP
-_const(POSITION)
-_param3 contains four integer or floating-point values that specify
-the position of the light in homogeneous object coordinates.
-Both integer and floating-point values are mapped directly.
-Neither integer nor floating-point values are clamped.
-.IP
-The position is transformed by the modelview matrix when
-_cmnd is called (just as if it were a point),
-and it is stored in eye coordinates.
-If the $w$ component of the position is 0,
-the light is treated as a directional source.
-Diffuse and specular lighting calculations take the light's direction,
-but not its actual position,
-into account,
-and attenuation is disabled.
-Otherwise,
-diffuse and specular lighting calculations are based on the actual location
-of the light in eye coordinates,
-and attenuation is enabled.
-The initial position is (0, 0, 1, 0);
-thus, the initial light source is directional,
-parallel to, and in the direction of the $-z$ axis.
-.TP
-_const(SPOT_DIRECTION)
-_param3 contains three integer or floating-point values that specify
-the direction of the light in homogeneous object coordinates.
-Both integer and floating-point values are mapped directly.
-Neither integer nor floating-point values are clamped.
-.IP
-The spot direction is transformed by the inverse of the modelview matrix when
-_cmnd is called (just as if it were a normal),
-and it is stored in eye coordinates.
-It is significant only when _const(SPOT_CUTOFF) is not 180,
-which it is initially.
-The initial direction is (0, 0, \-1).
-.TP
-_const(SPOT_EXPONENT)
-_param3 is a single integer or floating-point value that specifies
-the intensity distribution of the light.
-Integer and floating-point values are mapped directly.
-Only values in the range [0,128] are accepted.
-.IP
-Effective light intensity is attenuated by the cosine of the angle between
-the direction of the light and the direction from the light to the vertex
-being lighted,
-raised to the power of the spot exponent.
-Thus, higher spot exponents result in a more focused light source,
-regardless of the spot cutoff angle (see _const(SPOT_CUTOFF), next paragraph).
-The initial spot exponent is 0,
-resulting in uniform light distribution.
-.TP
-_const(SPOT_CUTOFF)
-_param3 is a single integer or floating-point value that specifies
-the maximum spread angle of a light source.
-Integer and floating-point values are mapped directly.
-Only values in the range [0,90] and the special value 180
-are accepted.
-If the angle between the direction of the light and the direction from the
-light to the vertex being lighted is greater than the spot cutoff angle,
-the light is completely masked.
-.BP
-Otherwise, its intensity is controlled by the spot exponent and the
-attenuation factors.
-The initial spot cutoff is 180,
-resulting in uniform light distribution.
-.TP
-_const(CONSTANT_ATTENUATION)
-.TP
-_const(LINEAR_ATTENUATION )
-.TP
-_const(QUADRATIC_ATTENUATION)
-_param3 is a single integer or floating-point value that specifies
-one of the three light attenuation factors.
-Integer and floating-point values are mapped directly.
-Only nonnegative values are accepted.
-If the light is positional,
-rather than directional,
-its intensity is attenuated by the reciprocal of the sum of the constant
-factor, the linear factor times the distance between the light
-and the vertex being lighted,
-and the quadratic factor times the square of the same distance.
-The initial attenuation factors are (1, 0, 0),
-resulting in no attenuation.
-.SH NOTES
-It is always the case that _const(LIGHT)$i$ = _const(LIGHT0) + $i$.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if either _param1 or _param2
-is not an accepted value.
-.P
-_const(INVALID_VALUE) is generated if a spot exponent value is specified
-outside the range [0,128],
-or if spot cutoff is specified outside the range [0,90] (except for the
-special value 180),
-or if a negative attenuation factor is specified.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed between
-the execution of
-_cmnd(Begin) and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetLight)
-.br
-_cmnd(IsEnabled) with argument _const(LIGHTING)
-.SH SEE ALSO
-_cmnd(ColorMaterial),
-_cmnd(LightModel),
-_cmnd(Material)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/lightmodel.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/lightmodel.gl
deleted file mode 100755
index 15e6ef1de..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/lightmodel.gl
+++ /dev/null
@@ -1,172 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(LightModel,set the lighting model parameters)
-_names(LightModel,[fi])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies a single-valued lighting model parameter.
-_const(LIGHT_MODEL_LOCAL_VIEWER),
-_const(LIGHT_MODEL_COLOR_CONTROL), and
-_const(LIGHT_MODEL_TWO_SIDE) are accepted.
-_phead(_param2)
-Specifies the value that _param2 will be set to.
-_names(LightModel,[fi]v)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a lighting model parameter.
-_const(LIGHT_MODEL_AMBIENT),
-_const(LIGHT_MODEL_COLOR_CONTROL),
-_const(LIGHT_MODEL_LOCAL_VIEWER), and
-_const(LIGHT_MODEL_TWO_SIDE) are accepted.
-_phead(_param2)
-Specifies a pointer to the value or values that _param2 will be set to.
-.SH DESCRIPTION
-_cmnd sets the lighting model parameter.
-_param1 names a parameter and _param2 gives the new value.
-There are three lighting model parameters:
-.TP 10
-_const(LIGHT_MODEL_AMBIENT)
-_param2 contains four integer or floating-point values that specify
-the ambient RGBA intensity of the entire scene.
-Integer values are mapped linearly such that the most positive representable
-value maps to 1.0,
-and the most negative representable value maps to \-1.0.
-Floating-point values are mapped directly.
-Neither integer nor floating-point values are clamped.
-The initial ambient scene intensity is (0.2, 0.2, 0.2, 1.0).
-.TP
-_const(LIGHT_MODEL_COLOR_CONTROL)
-_param2 must be either _const(SEPARATE_SPECULAR_COLOR) or
-_const(SINGLE_COLOR).
-_const(SINGLE_COLOR) specifies that a single color is generated from the
-lighting computation for a vertex. _const(SEPARATE_SPECULAR_COLOR)
-specifies that the specular color computation of lighting be stored
-separately from the remainder of the lighting computation. The specular
-color is summed into the generated fragment's color after the application
-of texture mapping (if enabled). The initial value is _const(SINGLE_COLOR).
-.TP
-_const(LIGHT_MODEL_LOCAL_VIEWER)
-_param2 is a single integer or floating-point value that specifies
-how specular reflection angles are computed.
-If _param2 is 0 (or 0.0), specular reflection angles take the
-view direction to be parallel to and in the direction of the -\f2z\fP axis,
-regardless of the location of the vertex in eye coordinates.
-Otherwise, specular reflections are computed from the origin
-of the eye coordinate system.
-The initial value is 0.
-.TP
-_const(LIGHT_MODEL_TWO_SIDE)
-_param2 is a single integer or floating-point value that specifies
-whether one- or two-sided lighting calculations are done for polygons.
-It has no effect on the lighting calculations for points,
-lines,
-or bitmaps.
-If _param2 is 0 (or 0.0), one-sided lighting is specified,
-and only the \f2front\fP material parameters are used in the
-lighting equation.
-Otherwise, two-sided lighting is specified.
-In this case, vertices of back-facing polygons are lighted using the
-\f2back\fP material parameters,
-and have their normals reversed before the lighting equation is evaluated.
-Vertices of front-facing polygons are always lighted using the
-\f2front\fP material parameters,
-with no change to their normals. The initial value is 0.
-.P
-In RGBA mode, the lighted color of a vertex is the sum of
-the material emission intensity,
-the product of the material ambient reflectance and the lighting model full-scene
-ambient intensity,
-and the contribution of each enabled light source.
-Each light source contributes the sum of three terms:
-ambient, diffuse, and specular.
-The ambient light source contribution is the product of the material ambient
-reflectance and the light's ambient intensity.
-The diffuse light source contribution is the product of the material diffuse
-reflectance,
-the light's diffuse intensity,
-and the dot product of the vertex's normal with the normalized vector from
-the vertex to the light source.
-The specular light source contribution is the product of the material specular
-reflectance,
-the light's specular intensity,
-and the dot product of the normalized vertex-to-eye and vertex-to-light
-vectors,
-raised to the power of the shininess of the material.
-All three light source contributions are attenuated equally based on
-the distance from the vertex to the light source and on light source
-direction, spread exponent, and spread cutoff angle.
-All dot products are replaced with 0 if they evaluate to a negative value.
-.P
-The alpha component of the resulting lighted color is set to the alpha value
-of the material diffuse reflectance.
-.P
-In color index mode,
-the value of the lighted index of a vertex ranges from the ambient
-to the specular values passed to _cmnd(Material) using _const(COLOR_INDEXES).
-Diffuse and specular coefficients,
-computed with a (.30, .59, .11) weighting of the lights' colors,
-the shininess of the material,
-and the same reflection and attenuation equations as in the RGBA case,
-determine how much above ambient the resulting index is.
-.SH NOTES
-_const(LIGHT_MODEL_COLOR_CONTROL) is available only if the GL version is
-1.2 or greater.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_ENUM) is generated if _param1 is
-_const(LIGHT_MODEL_COLOR_CONTROL) and _param2 is not one of
-_const(SINGLE_COLOR) or _const(SEPARATE_SPECULAR_COLOR).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed between
-the execution of _cmnd(Begin) and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(LIGHT_MODEL_AMBIENT)
-.br
-_cmnd(Get) with argument _const(LIGHT_MODEL_COLOR_CONTROL)
-.br
-_cmnd(Get) with argument _const(LIGHT_MODEL_LOCAL_VIEWER)
-.br
-_cmnd(Get) with argument _const(LIGHT_MODEL_TWO_SIDE)
-.br
-_cmnd(IsEnabled) with argument _const(LIGHTING)
-.SH SEE ALSO
-_cmnd(Light),
-_cmnd(Material)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/linestipple.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/linestipple.gl
deleted file mode 100755
index 4291fc679..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/linestipple.gl
+++ /dev/null
@@ -1,100 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(LineStipple,specify the line stipple pattern)
-_names(LineStipple)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies a multiplier for each bit in the line stipple pattern.
-If _param1 is 3,
-for example,
-each bit in the pattern is used three times
-before the next bit in the pattern is used.
-_param1 is clamped to the range [1, 256] and defaults to 1.
-_phead(_param2)
-Specifies a 16-bit integer whose bit pattern determines
-which fragments of a line will be drawn when the line is rasterized.
-Bit zero is used first; the default pattern is all 1's.
-.SH DESCRIPTION
-Line stippling masks out certain fragments produced by rasterization;
-those fragments will not be drawn.
-The masking is achieved by using three parameters:
-the 16-bit line stipple pattern _param2,
-the repeat count _param1,
-and an integer stipple counter $s$.
-.P
-Counter $s$ is reset to 0 whenever _cmnd(Begin) is called,
-and before each line segment of a _cmnd(Begin)(_const(LINES))/_cmnd(End)
-sequence is generated.
-It is incremented after each fragment of a unit width aliased line segment is generated,
-or after each $i$ fragments of an $i$ width line segment are generated.
-The $i$ fragments associated with count $s$ are masked out if
-.sp
-.ce
-_param2 bit $(s ~/~ _eqnparam1) ~roman mod~ 16$
-.sp
-is 0, otherwise these fragments are sent to the frame buffer.
-Bit zero of _param2 is the least significant bit.
-.P
-Antialiased lines are treated as a sequence of $1 times width$ rectangles
-for purposes of stippling.
-Whether rectagle $s$ is rasterized or not depends on the fragment rule
-described for aliased lines,
-counting rectangles rather than groups of fragments.
-.P
-To enable and disable line stippling, call _cmnd(Enable) and _cmnd(Disable)
-with argument _const(LINE_STIPPLE).
-When enabled,
-the line stipple pattern is applied as described above.
-When disabled,
-it is as if the pattern were all 1's.
-Initially, line stippling is disabled.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(LINE_STIPPLE_PATTERN)
-.br
-_cmnd(Get) with argument _const(LINE_STIPPLE_REPEAT)
-.br
-_cmnd(IsEnabled) with argument _const(LINE_STIPPLE)
-.SH SEE ALSO
-_cmnd(LineWidth),
-_cmnd(PolygonStipple)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/linewidth.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/linewidth.gl
deleted file mode 100755
index e8957cefc..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/linewidth.gl
+++ /dev/null
@@ -1,113 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(LineWidth,specify the width of rasterized lines)
-_names(LineWidth)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the width of rasterized lines.
-The initial value is 1.
-.SH DESCRIPTION
-_cmnd specifies the rasterized width of both aliased and antialiased
-lines.
-Using a line width other than 1 has different effects,
-depending on whether line antialiasing is enabled.
-To enable and disable line antialiasing, call
-_cmnd(Enable) and _cmnd(Disable)
-with argument _const(LINE_SMOOTH). Line antialiasing is initially
-disabled.
-.P
-If line antialiasing is disabled,
-the actual width is determined by rounding the supplied width
-to the nearest integer.
-(If the rounding results in the value 0,
-it is as if the line width were 1.)
-If
-$| DELTA x | ~>=~ | DELTA y |$,
-\f2i\fP pixels are filled in each column that is rasterized,
-where \f2i\fP is the rounded value of _param1.
-Otherwise,
-\f2i\fP pixels are filled in each row that is rasterized.
-.P
-If antialiasing is enabled,
-line rasterization produces a fragment for each pixel square
-that intersects the region lying within the rectangle having width
-equal to the current line width,
-length equal to the actual length of the line,
-and centered on the mathematical line segment.
-The coverage value for each fragment is the window coordinate area
-of the intersection of the rectangular region with the corresponding
-pixel square.
-This value is saved and used in the final rasterization step.
-.P
-Not all widths can be supported when line antialiasing is enabled. If an
-unsupported width is requested, the nearest supported width is used.
-Only width 1 is guaranteed to be supported; others depend on the
-implementation. Likewise, there is a range for aliased line widths as well.
-To query the range of supported widths and the size
-difference between supported widths within the range, call _cmnd(Get)
-with arguments _const(ALIASED_LINE_WIDTH_RANGE),
-_const(SMOOTH_LINE_WIDTH_RANGE), _const(SMOOTH_LINE_WIDTH_GRANULARITY).
-.SH NOTES
-The line width specified by _cmnd is always returned when _const(LINE_WIDTH)
-is queried.
-Clamping and rounding for aliased and antialiased lines have no effect
-on the specified value.
-.P
-Nonantialiased line width may be clamped to an implementation-dependent
-maximum. Call _cmnd(Get) with _const(ALIASED_LINE_WIDTH_RANGE) to
-determine the maximum width.
-.SH ERRORS
-_const(INVALID_VALUE) is generated if _param1 is less than or equal to 0.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(LINE_WIDTH)
-.br
-_cmnd(Get) with argument _const(ALIASED_LINE_WIDTH_RANGE)
-.br
-_cmnd(Get) with argument _const(SMOOTH_LINE_WIDTH_RANGE)
-.br
-_cmnd(Get) with argument _const(SMOOTH_LINE_WIDTH_GRANULARITY)
-.br
-_cmnd(IsEnabled) with argument _const(LINE_SMOOTH)
-.SH SEE ALSO
-_cmnd(Enable)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/listbase.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/listbase.gl
deleted file mode 100755
index 486bdf8bb..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/listbase.gl
+++ /dev/null
@@ -1,56 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(ListBase,set the display-list base for _cmnd(CallLists))
-_names(ListBase)
-.SH PARAMETERS
-_phead(_param1)
-Specifies an integer offset that will be added to _cmnd(CallLists)
-offsets to generate display-list names.
-The initial value is 0.
-.SH DESCRIPTION
-_cmnd(CallLists) specifies an array of offsets.
-Display-list names are generated by adding _param1 to each offset.
-Names that reference valid display lists are executed;
-the others are ignored.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(LIST_BASE)
-.SH SEE ALSO
-_cmnd(CallLists)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/loadidentity.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/loadidentity.gl
deleted file mode 100755
index 33629650b..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/loadidentity.gl
+++ /dev/null
@@ -1,75 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(LoadIdentity,replace the current matrix with the identity matrix)
-_names(LoadIdentity)
-.SH DESCRIPTION
-_cmnd replaces the current matrix with the identity matrix.
-It is semantically equivalent to calling _cmnd(LoadMatrix)
-with the identity matrix
-
-.ce
-
-.EQ
-left ( down 20 { ~ matrix {
- ccol { 1 above 0 above 0 above 0~ }
- ccol { 0 above 1 above 0 above 0~ }
- ccol { 0 above 0 above 1 above 0~ }
- ccol { 0 above 0 above 0 above 1 }
-} } ~~ right )
-.EN
-
-
-but in some cases it is more efficient.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(MATRIX_MODE)
-.br
-_cmnd(Get) with argument _const(COLOR_MATRIX)
-.br
-_cmnd(Get) with argument _const(MODELVIEW_MATRIX)
-.br
-_cmnd(Get) with argument _const(PROJECTION_MATRIX)
-.br
-_cmnd(Get) with argument _const(TEXTURE_MATRIX)
-.SH SEE ALSO
-_cmnd(LoadMatrix),
-_cmnd(MatrixMode),
-_cmnd(MultMatrix),
-_cmnd(PushMatrix)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/loadmatrix.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/loadmatrix.gl
deleted file mode 100755
index 132b282f8..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/loadmatrix.gl
+++ /dev/null
@@ -1,108 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(LoadMatrix,replace the current matrix with the specified matrix)
-_names(LoadMatrix,[df])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies a pointer to 16 consecutive values, which are used as the
-elements of a $4 ~times~ 4$ column-major matrix.
-.SH DESCRIPTION
-_cmnd replaces the current matrix with the one whose elements are specified by
-_param1.
-The current matrix is the projection matrix,
-modelview matrix,
-or texture matrix,
-depending on the current matrix mode
-(see _cmnd(MatrixMode)).
-.P
-The current matrix, M, defines a transformation of coordinates.
-For instance, assume M refers to the modelview matrix.
-If $v ~=~ (v[0], v[1], v[2], v[3])$ is the set of object coordinates
-of a vertex,
-and _param1 points to an array of $16$
-single- or double-precision
-floating-point values $m[0], m[1],. . .,m[15]$,
-then the modelview transformation $M(v)$ does the following:
-.P
-
-.ce
-.EQ
-down 130
-{M(v) ~ = ~
-{{ left ( matrix {
- ccol { ~m[0] above m[1] above m[2] above m[3] ~}
- ccol { ~m[4] above m[5] above m[6] above m[7] ~}
- ccol { ~m[8] above m[9] above m[10] above m[11] ~}
- ccol { ~m[12]~ above m[13]~ above m[14]~ above m[15]~}
-} right ) } ~~ times ~~
-{left ( matrix {
-ccol { ~v[0]~ above ~v[1]~ above ~v[2]~ above ~v[3]~ }
-} right )} }}
-.EN
-
-.sp
-.P
-Where ``$times$'' denotes matrix multiplication.
-.P
-Projection and texture transformations are similarly defined.
-.SH NOTES
-While the elements of the matrix may be specified with
-single or double precision, the GL implementation may
-store or operate on these values in less than single
-precision.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(MATRIX_MODE)
-.br
-_cmnd(Get) with argument _const(COLOR_MATRIX)
-.br
-_cmnd(Get) with argument _const(MODELVIEW_MATRIX)
-.br
-_cmnd(Get) with argument _const(PROJECTION_MATRIX)
-.br
-_cmnd(Get) with argument _const(TEXTURE_MATRIX)
-.SH SEE ALSO
-_cmnd(LoadIdentity),
-_cmnd(MatrixMode),
-_cmnd(MultMatrix),
-_cmnd(PushMatrix)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/loadname.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/loadname.gl
deleted file mode 100755
index ead3c0a69..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/loadname.gl
+++ /dev/null
@@ -1,65 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(LoadName,load a name onto the name stack)
-_names(LoadName)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a name that will replace the top value on the name stack.
-.SH DESCRIPTION
-The name stack is used during selection mode to allow sets of rendering
-commands to be uniquely identified.
-It consists of an ordered set of unsigned integers.
-_cmnd causes _param1 to replace the value on the top of the name stack,
-which is initially empty.
-.P
-The name stack is always empty while the render mode is not _const(SELECT).
-Calls to _cmnd while the render mode is not _const(SELECT) are ignored.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd is called while the
-name stack is empty.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed between
-the execution of _cmnd(Begin) and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(NAME_STACK_DEPTH)
-.br
-_cmnd(Get) with argument _const(MAX_NAME_STACK_DEPTH)
-.SH SEE ALSO
-_cmnd(InitNames),
-_cmnd(PushName),
-_cmnd(RenderMode),
-_cmnd(SelectBuffer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/logicop.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/logicop.gl
deleted file mode 100755
index 2f6d0b454..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/logicop.gl
+++ /dev/null
@@ -1,129 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn|tbl)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(LogicOp,specify a logical pixel operation for color index rendering)
-_names(LogicOp)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a symbolic constant that selects a logical operation.
-The following symbols are accepted:
-_const(CLEAR),
-_const(SET),
-_const(COPY),
-_const(COPY_INVERTED),
-_const(NOOP),
-_const(INVERT),
-_const(AND),
-_const(NAND),
-_const(OR),
-_const(NOR),
-_const(XOR),
-_const(EQUIV),
-_const(AND_REVERSE),
-_const(AND_INVERTED),
-_const(OR_REVERSE), and
-_const(OR_INVERTED). The initial value is _const(COPY).
-.SH DESCRIPTION
-_cmnd specifies a logical operation that,
-when enabled,
-is applied between the incoming color index or RGBA color
-and the color index or RGBA color at the corresponding location in the
-frame buffer.
-To enable or disable the logical operation, call
-_cmnd(Enable) and _cmnd(Disable)
-using the symbolic constant _const(COLOR_LOGIC_OP) for RGBA mode or
-_const(INDEX_LOGIC_OP) for color index mode. The initial value is
-disabled for both operations.
-.P
-.ne
-.TS
-center;
-lb lb
-l c.
-_
-Opcode Resulting Operation
-_
-_const(CLEAR) 0
-_const(SET) 1
-_const(COPY) s
-_const(COPY_INVERTED) ~s
-_const(NOOP) d
-_const(INVERT) ~d
-_const(AND) s & d
-_const(NAND) ~(s & d)
-_const(OR) s | d
-_const(NOR) ~(s | d)
-_const(XOR) s ^ d
-_const(EQUIV) ~(s ^ d)
-_const(AND_REVERSE) s & ~d
-_const(AND_INVERTED) ~s & d
-_const(OR_REVERSE) s | ~d
-_const(OR_INVERTED) ~s | d
-_
-.TE
-
-_param1 is a symbolic constant chosen from the list above.
-In the explanation of the logical operations,
-\f2s\fP represents the incoming color index and
-\f2d\fP represents the index in the frame buffer.
-Standard C-language operators are used.
-As these bitwise operators suggest,
-the logical operation is applied independently to each bit pair of the
-source and destination indices or colors.
-.SH NOTES
-Color index logical operations are always supported. RGBA logical
-operations are supported only if the GL version is 1.1 or greater.
-.P
-When more than one RGBA color or index buffer is enabled for drawing,
-logical operations are performed separately for each enabled buffer,
-using for the destination value the contents of that buffer
-(see _cmnd(DrawBuffer)).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(LOGIC_OP_MODE).
-.br
-_cmnd(IsEnabled) with argument _const(COLOR_LOGIC_OP) or _const(INDEX_LOGIC_OP).
-.SH SEE ALSO
-_cmnd(AlphaFunc),
-_cmnd(BlendFunc),
-_cmnd(DrawBuffer),
-_cmnd(Enable),
-_cmnd(StencilOp)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/map1.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/map1.gl
deleted file mode 100755
index c5d847a7f..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/map1.gl
+++ /dev/null
@@ -1,268 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Map1,define a one-dimensional evaluator)
-_names(Map1,[fd])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the kind of values that are generated by the evaluator.
-Symbolic constants
-_const(MAP1_VERTEX_3),
-_const(MAP1_VERTEX_4),
-_const(MAP1_INDEX),
-_const(MAP1_COLOR_4),
-_const(MAP1_NORMAL),
-_const(MAP1_TEXTURE_COORD_1),
-_const(MAP1_TEXTURE_COORD_2),
-_const(MAP1_TEXTURE_COORD_3), and
-_const(MAP1_TEXTURE_COORD_4) are accepted.
-_phead(_param2 _param3)
-Specify a linear mapping of $u$,
-as presented to _cmnd(EvalCoord1),
-to $u hat$,
-the variable that is evaluated by the equations specified by this command.
-_phead(_param4)
-Specifies the number of floats or doubles between
-the beginning of one control point and the beginning of the next one
-in the data structure referenced in _param6.
-This allows control points to be embedded in arbitrary data structures.
-The only constraint is that the values for a particular control point
-must occupy contiguous memory locations.
-_phead(_param5)
-Specifies the number of control points.
-Must be positive.
-_phead(_param6)
-Specifies a pointer to the array of control points.
-
-.SH DESCRIPTION
-Evaluators provide a way to use polynomial or rational polynomial mapping
-to produce vertices,
-normals,
-texture coordinates,
-and colors.
-The values produced by an evaluator are sent to further stages
-of GL processing just as if they had been presented using
-_cmnd(Vertex),
-_cmnd(Normal),
-_cmnd(TexCoord), and
-_cmnd(Color) commands,
-except that the generated values do not update the current normal,
-texture coordinates,
-or color.
-.P
-All polynomial or rational polynomial splines of any degree
-(up to the maximum degree supported by the GL implementation)
-can be described using evaluators.
-These include almost all splines used in computer graphics: B-splines,
-Bezier curves, Hermite splines, and so on.
-.P
-Evaluators define curves based on Bernstein polynomials.
-Define $p ( u hat ^) $ as
-.sp
-.ce
-$p ( u hat ^) ~~=~~ up 10 { sum from i=0 to n } B sub i sup n ( u hat ^) R sub i$
-.sp
-where
-$R sub i$
-is a control point and
-$B sub i sup n ( u hat ^)$
-is the $i$th Bernstein polynomial of degree $n$ (_param5 = $n ~+~ 1$):
-.sp
-.ce
-$B sub i sup n ( u hat ^) ~~=~~ left ( down 20 {cpile { n above i }} ~~ right ) u hat sup i ( 1 - u hat ^) sup { n - i }$
-.sp
-Recall that
-.sp
-.ce
-$0 sup 0 ~==~ 1 $ and $ left ( down 20 {cpile { n above ~0 }} ~~ right ) ~~==~~ 1 $
-.P
-_cmnd is used to define the basis and to specify what kind of values
-are produced.
-Once defined,
-a map can be enabled and disabled by calling _cmnd(Enable) and _cmnd(Disable)
-with the map name, one of the nine predefined values for _param1
-described below.
-_cmnd(EvalCoord1) evaluates the one-dimensional maps that are enabled.
-When
-.br
-_cmnd(EvalCoord1) presents a value $u$,
-the Bernstein functions are evaluated using $u hat$, where
-.br
-
-.ce
-$u hat ~~=~~ {u ~-~ _eqnparam2} over {_eqnparam3 ~-~ _eqnparam2}$
-
-.br
-.P
-_param1 is a symbolic constant that indicates what kind of control points
-are provided in _param6,
-and what output is generated when the map is evaluated.
-It can assume one of nine predefined values:
-.TP 25
-_const(MAP1_VERTEX_3)
-Each control point is three floating-point values representing
-$x$, $y$, and $z$.
-Internal _cmnd(Vertex3) commands are generated when the map is evaluated.
-.TP
-_const(MAP1_VERTEX_4)
-Each control point is four floating-point values representing
-$x$, $y$, $z$, and $w$.
-Internal _cmnd(Vertex4) commands are generated when the map is evaluated.
-.TP
-_const(MAP1_INDEX)
-Each control point is a single floating-point value representing a color index.
-Internal _cmnd(Index) commands are generated when the map is evaluated
-but the current index is not updated with the value of these _cmnd(Index)
-commands.
-.TP
-_const(MAP1_COLOR_4)
-Each control point is four floating-point values representing
-red, green, blue, and alpha.
-Internal _cmnd(Color4) commands are generated when the map is
-evaluated but the current color is not updated with the value of these
-_cmnd(Color4) commands.
-.TP
-_const(MAP1_NORMAL)
-Each control point is three floating-point values representing
-the $x$, $y$, and $z$ components of a normal vector.
-Internal _cmnd(Normal) commands are generated when the map is
-evaluated but the current normal is not updated with the value of
-these _cmnd(Normal) commands.
-.TP
-_const(MAP1_TEXTURE_COORD_1)
-Each control point is a single floating-point value representing
-the $s$ texture coordinate.
-Internal
-.br
-_cmnd(TexCoord1) commands are generated when the map is
-evaluated but the current texture coordinates are not updated with the value
-of these _cmnd(TexCoord) commands.
-.TP
-_const(MAP1_TEXTURE_COORD_2)
-Each control point is two floating-point values representing
-the $s$ and $t$ texture coordinates.
-Internal
-.br
-_cmnd(TexCoord2) commands are generated when the map is
-evaluated but the current texture coordinates are not updated with the value
-of these _cmnd(TexCoord) commands.
-.TP
-_const(MAP1_TEXTURE_COORD_3)
-Each control point is three floating-point values representing
-the $s$, $t$, and $r$ texture coordinates.
-Internal _cmnd(TexCoord3) commands are generated when the map is
-evaluated but the current texture coordinates are not updated with the value
-of these _cmnd(TexCoord) commands.
-.TP
-_const(MAP1_TEXTURE_COORD_4)
-Each control point is four floating-point values representing
-the $s$, $t$, $r$, and $q$ texture coordinates.
-Internal
-.br
-_cmnd(TexCoord4) commands are generated when the map is evaluated but
-the current texture coordinates are not updated with the value
-of these _cmnd(TexCoord) commands.
-.P
-_param4,
-_param5, and
-_param6 define the array addressing for accessing the control points.
-_param6 is the location of the first control point,
-which occupies one, two, three, or four contiguous memory locations,
-depending on which map is being defined.
-_param5 is the number of control points in the array.
-_param4 specifies how many float or double locations to advance the internal
-memory pointer to reach the next control point.
-.SH NOTES
-As is the case with all GL commands that accept pointers to data,
-it is as if the contents of _param6 were copied by _cmnd before _cmnd
-returns.
-Changes to the contents of _param6 have no effect after _cmnd is called.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_VALUE) is generated if _param2 is equal to _param3.
-.P
-_const(INVALID_VALUE) is generated if _param4 is less than the number
-of values in a control point.
-.P
-_const(INVALID_VALUE) is generated if _param5 is less than 1 or
-greater than the return value of _const(MAX_EVAL_ORDER).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of
-_cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.P
-When the _arbstring(multitexture) extension is supported,
-_const(INVALID_OPERATION) is generated if _cmnd is called and the value
-of _arbconst(ACTIVE_TEXTURE) is not _arbconst(TEXTURE0).
-.SH ASSOCIATED GETS
-_cmnd(GetMap)
-.br
-_cmnd(Get) with argument _const(MAX_EVAL_ORDER)
-.br
-_cmnd(IsEnabled) with argument _const(MAP1_VERTEX_3)
-.br
-_cmnd(IsEnabled) with argument _const(MAP1_VERTEX_4)
-.br
-_cmnd(IsEnabled) with argument _const(MAP1_INDEX)
-.br
-_cmnd(IsEnabled) with argument _const(MAP1_COLOR_4)
-.br
-_cmnd(IsEnabled) with argument _const(MAP1_NORMAL)
-.br
-_cmnd(IsEnabled) with argument _const(MAP1_TEXTURE_COORD_1)
-.br
-_cmnd(IsEnabled) with argument _const(MAP1_TEXTURE_COORD_2)
-.br
-_cmnd(IsEnabled) with argument _const(MAP1_TEXTURE_COORD_3)
-.br
-_cmnd(IsEnabled) with argument _const(MAP1_TEXTURE_COORD_4)
-.SH SEE ALSO
-_cmnd(Begin),
-_cmnd(Color),
-_cmnd(Enable),
-_cmnd(EvalCoord),
-_cmnd(EvalMesh),
-_cmnd(EvalPoint),
-_cmnd(Map2),
-_cmnd(MapGrid),
-_cmnd(Normal),
-_cmnd(TexCoord),
-_cmnd(Vertex)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/map2.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/map2.gl
deleted file mode 100755
index 1293961aa..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/map2.gl
+++ /dev/null
@@ -1,317 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Map2,define a two-dimensional evaluator)
-_names(Map2,[fd])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the kind of values that are generated by the evaluator.
-Symbolic constants
-_const(MAP2_VERTEX_3),
-_const(MAP2_VERTEX_4),
-_const(MAP2_INDEX),
-_const(MAP2_COLOR_4),
-_const(MAP2_NORMAL),
-_const(MAP2_TEXTURE_COORD_1),
-_const(MAP2_TEXTURE_COORD_2),
-_const(MAP2_TEXTURE_COORD_3), and
-_const(MAP2_TEXTURE_COORD_4) are accepted.
-_phead(_param2 _param3)
-Specify a linear mapping of $u$,
-as presented to _cmnd(EvalCoord2),
-to $u hat$,
-one of the two variables that are evaluated by the equations specified
-by this command. Initially, _param2 is 0 and _param3 is 1.
-_phead(_param4)
-Specifies the number of floats or doubles between
-the beginning of control point
-$R sub ij$
-and the beginning of control point
-$R sub { (i+1) j }$,
-where $i$ and $j$ are the $u$ and $v$ control point indices, respectively.
-This allows control points to be embedded in arbitrary data structures.
-The only constraint is that the values for a particular control point
-must occupy contiguous memory locations. The initial value of _param4 is 0.
-_phead(_param5)
-Specifies the dimension of the control point array in the $u$ axis.
-Must be positive. The initial value is 1.
-_phead(_param6 _param7)
-Specify a linear mapping of $v$,
-as presented to _cmnd(EvalCoord2),
-to $v hat$,
-one of the two variables that are evaluated by the equations specified
-by this command. Initially, _param6 is 0 and _param7 is 1.
-_phead(_param8)
-Specifies the number of floats or doubles between
-the beginning of control point
-$R sub ij$
-and the beginning of control point
-$R sub { i (j+1) }$,
-where $i$ and $j$ are the $u$ and $v$ control point indices, respectively.
-This allows control points to be embedded in arbitrary data structures.
-The only constraint is that the values for a particular control point
-must occupy contiguous memory locations. The initial value of _param8 is 0.
-_phead(_param9)
-Specifies the dimension of the control point array in the $v$ axis.
-Must be positive. The initial value is 1.
-_phead(_param10)
-Specifies a pointer to the array of control points.
-.SH DESCRIPTION
-Evaluators provide a way to use polynomial or rational polynomial mapping
-to produce vertices,
-normals,
-texture coordinates,
-and colors.
-The values produced by an evaluator are sent on to further stages
-of GL processing just as if they had been presented using
-_cmnd(Vertex),
-_cmnd(Normal),
-_cmnd(TexCoord), and
-_cmnd(Color) commands,
-except that the generated values do not update the current normal,
-texture coordinates,
-or color.
-.P
-All polynomial or rational polynomial splines of any degree
-(up to the maximum degree supported by the GL implementation)
-can be described using evaluators.
-These include almost all surfaces used in computer graphics,
-including B-spline surfaces,
-NURBS surfaces,
-Bezier surfaces, and so on.
-.P
-Evaluators define surfaces based on bivariate Bernstein polynomials.
-Define $p ( u hat , v hat ) $ as
-.ce
-.sp
-.EQ
-p ( u hat , v hat ) ~~=~~
- down 30 {{size 18 {sum}} from {size 8 {i~=~0}} to {size 9 {n}} } ~
- {{size 18 {sum}} from {size 8 {j~=~0}} to {size 9 {m}} } ~
- up 15 { B sub i sup n ( u hat ) ~ B sub j sup m ( v hat ) ~ R sub ij }
-.EN
-.sp
-.P
-where $R sub ij$ is a control point,
-$B sub i sup n ( u hat )$
-is the $i$th Bernstein polynomial of degree
-.br
-$n$ (_param5 = $n ~+~ 1$)
-.ce
-.sp
-.EQ
-B sub i sup n ( u hat ) ~~=~~ left ( down 20 {cpile { n above i }} ~ right
-) u hat sup i ( 1 - u hat ) sup { n - i }
-.EN
-.sp
-and $B sub j sup m ( v hat )$
-is the $j$th Bernstein polynomial of degree $m$ (_param9 = $m ~+~ 1$)
-.ce
-.sp
-.EQ
-B sub j sup m ( v hat ) ~~=~~ left ( ^down 20 {cpile { m above j }} ~^ right ) v hat sup j ( 1 - v hat ) sup { m - j }
-.EN
-.sp
-Recall that
-.ce
-$0 sup 0 ~==~ 1 $ and $ left ( ^ down 20 {cpile { n above 0 }} ~^ right ) ~~==~~ 1 $
-.sp
-_cmnd is used to define the basis and to specify what kind of values
-are produced.
-Once defined,
-a map can be enabled and disabled by calling _cmnd(Enable) and _cmnd(Disable)
-with the map name, one of the nine predefined values for _param1,
-described below.
-When _cmnd(EvalCoord2) presents values $u$ and $v$,
-the bivariate Bernstein polynomials are evaluated using $u hat$ and $v hat$,
-where
-.sp
-.ce
-$u hat ~~=~~ {u ~-~ _eqnparam2} over {_eqnparam3 ~-~ _eqnparam2}$
-.sp
-.ce
-$v hat ~~=~~ {v ~-~ _eqnparam6} over {_eqnparam7 ~-~ _eqnparam6}$
-.sp
-_param1 is a symbolic constant that indicates what kind of control points
-are provided in _param10,
-and what output is generated when the map is evaluated.
-It can assume one of nine predefined values:
-.TP 25
-_const(MAP2_VERTEX_3)
-Each control point is three floating-point values representing
-$x$, $y$, and $z$.
-Internal _cmnd(Vertex3) commands are generated when the map is evaluated.
-.TP
-_const(MAP2_VERTEX_4)
-Each control point is four floating-point values representing
-$x$, $y$, $z$, and $w$.
-Internal _cmnd(Vertex4) commands are generated when the map is evaluated.
-.TP
-_const(MAP2_INDEX)
-Each control point is a single floating-point value representing a color index.
-Internal _cmnd(Index) commands are generated when the map is evaluated
-but the current index is not updated with the value of these
-_cmnd(Index) commands.
-.TP
-_const(MAP2_COLOR_4)
-Each control point is four floating-point values representing
-red, green, blue, and alpha.
-Internal _cmnd(Color4) commands are generated when the map is
-evaluated but the current color is not updated with the value of
-these _cmnd(Color4) commands.
-.TP
-_const(MAP2_NORMAL)
-Each control point is three floating-point values representing
-the $x$, $y$, and $z$ components of a normal vector.
-Internal _cmnd(Normal) commands are generated when the map is
-evaluated but the current normal is not updated with the value of
-these _cmnd(Normal) commands.
-.TP
-_const(MAP2_TEXTURE_COORD_1)
-Each control point is a single floating-point value representing
-the $s$ texture coordinate.
-Internal
-.br
-_cmnd(TexCoord1) commands are generated when the map is evaluated but
-the current texture coordinates are not updated with the value
-of these _cmnd(TexCoord) commands.
-.TP
-_const(MAP2_TEXTURE_COORD_2)
-Each control point is two floating-point values representing
-the $s$ and $t$ texture coordinates.
-Internal
-.br
-_cmnd(TexCoord2) commands are generated when the map is evaluated but
-the current texture coordinates are not updated with the value
-of these _cmnd(TexCoord) commands.
-.TP
-_const(MAP2_TEXTURE_COORD_3)
-Each control point is three floating-point values representing
-the $s$, $t$, and $r$ texture coordinates.
-Internal _cmnd(TexCoord3) commands are generated when the map is
-evaluated but the current texture coordinates are not updated with the value
-of these _cmnd(TexCoord) commands.
-.TP
-_const(MAP2_TEXTURE_COORD_4)
-Each control point is four floating-point values representing
-the $s$, $t$, $r$, and $q$ texture coordinates.
-Internal
-.br
-_cmnd(TexCoord4) commands are generated when the map is evaluated but the current texture coordinates are not updated with the value
-of these _cmnd(TexCoord) commands.
-.P
-_param4,
-_param5,
-_param8,
-_param9, and
-_param10 define the array addressing for accessing the control points.
-_param10 is the location of the first control point,
-which occupies one, two, three, or four contiguous memory locations,
-depending on which map is being defined.
-There are $ _eqnparam5 ~times~ _eqnparam9 $ control points in the array.
-_param4 specifies how many float or double locations are skipped to advance
-the internal memory pointer from control point
-$R sub {i j} $ to control point $R sub {(i+1) j} $.
-_param8 specifies how many float or double locations are skipped to advance
-the internal memory pointer from control point
-$R sub {i j} $ to control point $R sub {i (j+1) } $.
-.SH NOTES
-As is the case with all GL commands that accept pointers to data,
-it is as if the contents of _param10 were copied by _cmnd before _cmnd
-returns.
-Changes to the contents of _param10 have no effect after _cmnd is called.
-.P
-Initially, _const(AUTO_NORMAL) is enabled. If _const(AUTO_NORMAL) is enabled,
-normal vectors are generated when either
-_const(MAP2_VERTEX_3) or _const(MAP2_VERTEX_4) is used to generate
-vertices.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_VALUE) is generated if _param2 is equal to _param3,
-or if _param6 is equal to _param7.
-.P
-_const(INVALID_VALUE) is generated if either _param4 or _param8
-is less than the number of values in a control point.
-.P
-_const(INVALID_VALUE) is generated if either _param5 or _param9
-is less than 1 or greater than the return value of _const(MAX_EVAL_ORDER).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of
-_cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.P
-When the _arbstring(multitexture) extension is supported,
-_const(INVALID_OPERATION) is generated if _cmnd is called and the value
-of _arbconst(ACTIVE_TEXTURE) is not _arbconst(TEXTURE0).
-.SH ASSOCIATED GETS
-_cmnd(GetMap)
-.br
-_cmnd(Get) with argument _const(MAX_EVAL_ORDER)
-.br
-_cmnd(IsEnabled) with argument _const(MAP2_VERTEX_3)
-.br
-_cmnd(IsEnabled) with argument _const(MAP2_VERTEX_4)
-.br
-_cmnd(IsEnabled) with argument _const(MAP2_INDEX)
-.br
-_cmnd(IsEnabled) with argument _const(MAP2_COLOR_4)
-.br
-_cmnd(IsEnabled) with argument _const(MAP2_NORMAL)
-.br
-_cmnd(IsEnabled) with argument _const(MAP2_TEXTURE_COORD_1)
-.br
-_cmnd(IsEnabled) with argument _const(MAP2_TEXTURE_COORD_2)
-.br
-_cmnd(IsEnabled) with argument _const(MAP2_TEXTURE_COORD_3)
-.br
-_cmnd(IsEnabled) with argument _const(MAP2_TEXTURE_COORD_4)
-.SH SEE ALSO
-_cmnd(Begin),
-_cmnd(Color),
-_cmnd(Enable),
-_cmnd(EvalCoord),
-_cmnd(EvalMesh),
-_cmnd(EvalPoint),
-_cmnd(Map1),
-_cmnd(MapGrid),
-_cmnd(Normal),
-_cmnd(TexCoord),
-_cmnd(Vertex)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/mapgrid.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/mapgrid.gl
deleted file mode 100755
index fe4e4c2e2..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/mapgrid.gl
+++ /dev/null
@@ -1,125 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(MapGrid,define a one- or two-dimensional mesh)
-_names(MapGrid,[12]u*[df])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the number of partitions in the grid range interval
-[_param2, _param3].
-Must be positive.
-_phead(_param2 _param3)
-Specify the mappings for integer grid domain values $i~=~0$ and $i~=~_eqnparam1$.
-_phead(_param4)
-Specifies the number of partitions in the grid range interval
-[_param5, _param6]
-.br
-(_cmnd(MapGrid2) only).
-_phead(_param5 _param6)
-Specify the mappings for integer grid domain values $j~=~0$ and $j~=~_eqnparam4$
-.br
-(_cmnd(MapGrid2) only).
-.SH DESCRIPTION
-_cmnd and _cmnd(EvalMesh) are used together to efficiently
-generate and evaluate a series of evenly-spaced map domain values.
-_cmnd(EvalMesh) steps through the integer domain
-of a one- or two-dimensional grid,
-whose range is the domain of the evaluation maps specified by
-_cmnd(Map1) and _cmnd(Map2).
-.P
-_cmnd(MapGrid1) and _cmnd(MapGrid2) specify the linear grid mappings
-between the $i$
-(or $i$ and $j$)
-integer grid coordinates,
-to the $u$
-(or $u$ and $v$)
-floating-point evaluation map coordinates.
-See _cmnd(Map1) and _cmnd(Map2) for details of how $u$ and $v$ coordinates
-are evaluated.
-.P
-_cmnd(MapGrid1) specifies a single linear mapping
-such that integer grid coordinate 0 maps exactly to _param2,
-and integer grid coordinate _param1 maps exactly to _param3.
-All other integer grid coordinates $i$ are mapped so that
-.sp
-.ce
-.EQ
-u ~=~ i (_eqnparam3 - _eqnparam2) / _eqnparam1 ~+~ _eqnparam2
-.EN
-.sp
-_cmnd(MapGrid2) specifies two such linear mappings.
-One maps integer grid coordinate $i~=~0$ exactly to _param2,
-and integer grid coordinate $i~=~_eqnparam1$ exactly to _param3.
-The other maps integer grid coordinate $j~=~0$ exactly to _param5,
-and integer grid coordinate $j~=~_eqnparam4$ exactly to _param6.
-Other integer grid coordinates $i$ and $j$ are mapped such that
-.P
-.ce
-.EQ
-u ~=~ i (_eqnparam3 - _eqnparam2) / _eqnparam1 ~+~ _eqnparam2
-.EN
-.P
-.ce
-.EQ
-v ~=~ j (_eqnparam6 - _eqnparam5) / _eqnparam4 ~+~ _eqnparam5
-.EN
-.P
-The mappings specified by _cmnd are used identically by
-_cmnd(EvalMesh) and _cmnd(EvalPoint).
-.SH ERRORS
-_const(INVALID_VALUE) is generated if either _param1 or _param4 is not
-positive.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(MAP1_GRID_DOMAIN)
-.br
-_cmnd(Get) with argument _const(MAP2_GRID_DOMAIN)
-.br
-_cmnd(Get) with argument _const(MAP1_GRID_SEGMENTS)
-.br
-_cmnd(Get) with argument _const(MAP2_GRID_SEGMENTS)
-.SH SEE ALSO
-_cmnd(EvalCoord),
-_cmnd(EvalMesh),
-_cmnd(EvalPoint),
-_cmnd(Map1),
-_cmnd(Map2)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/material.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/material.gl
deleted file mode 100755
index 900ec9109..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/material.gl
+++ /dev/null
@@ -1,200 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Material,specify material parameters for the lighting model)
-_names(Material,[fi])
-.SH PARAMETERS
-_phead(_param1)
-Specifies which face or faces are being updated.
-Must be one of
-_const(FRONT),
-_const(BACK), or
-_const(FRONT_AND_BACK).
-_phead(_param2)
-Specifies the single-valued material parameter of the face or faces
-that is being updated.
-Must be _const(SHININESS).
-_phead(_param3)
-Specifies the value that parameter _const(SHININESS) will be set to.
-_names(Material,[fi]v)
-.SH PARAMETERS
-_phead(_param1)
-Specifies which face or faces are being updated.
-Must be one of
-_const(FRONT),
-_const(BACK), or
-_const(FRONT_AND_BACK).
-_phead(_param2)
-Specifies the material parameter of the face or faces that is being updated.
-Must be one of
-_const(AMBIENT),
-_const(DIFFUSE),
-_const(SPECULAR),
-_const(EMISSION),
-_const(SHININESS),
-_const(AMBIENT_AND_DIFFUSE), or
-_const(COLOR_INDEXES).
-_phead(_param3)
-Specifies a pointer to the value or values that _param2 will be set to.
-.SH DESCRIPTION
-_cmnd assigns values to material parameters.
-There are two matched sets of material parameters.
-One,
-the \f2front-facing\fP set,
-is used to shade points,
-lines,
-bitmaps,
-and all polygons
-(when two-sided lighting is disabled),
-or just front-facing polygons
-(when two-sided lighting is enabled).
-The other set,
-\f2back-facing\fP,
-is used to shade back-facing polygons only when two-sided lighting is enabled.
-Refer to the _cmnd(LightModel) reference page for details concerning one- and
-two-sided lighting calculations.
-.P
-_cmnd takes three arguments.
-The first,
-_param1,
-specifies whether the
-_const(FRONT) materials, the
-_const(BACK) materials, or both
-_const(FRONT_AND_BACK) materials will be modified.
-The second,
-_param2,
-specifies which of several parameters in one or both sets will be modified.
-The third,
-_param3,
-specifies what value or values will be assigned to the specified parameter.
-.P
-Material parameters are used in the lighting equation that is optionally
-applied to each vertex.
-The equation is discussed in the _cmnd(LightModel) reference page.
-The parameters that can be specified using _cmnd,
-and their interpretations by the lighting equation, are as follows:
-.TP 20
-_const(AMBIENT)
-_param3 contains four integer or floating-point values that specify
-the ambient RGBA reflectance of the material.
-Integer values are mapped linearly such that the most positive representable
-value maps to 1.0,
-and the most negative representable value maps to \-1.0.
-Floating-point values are mapped directly.
-Neither integer nor floating-point values are clamped.
-The initial ambient reflectance for both front- and back-facing materials
-is (0.2, 0.2, 0.2, 1.0).
-.TP
-_const(DIFFUSE)
-_param3 contains four integer or floating-point values that specify
-the diffuse RGBA reflectance of the material.
-Integer values are mapped linearly such that the most positive representable
-value maps to 1.0,
-and the most negative representable value maps to \-1.0.
-Floating-point values are mapped directly.
-Neither integer nor floating-point values are clamped.
-The initial diffuse reflectance for both front- and back-facing materials
-is (0.8, 0.8, 0.8, 1.0).
-.TP
-_const(SPECULAR)
-_param3 contains four integer or floating-point values that specify
-the specular RGBA reflectance of the material.
-Integer values are mapped linearly such that the most positive representable
-value maps to 1.0,
-and the most negative representable value maps to \-1.0.
-Floating-point values are mapped directly.
-Neither integer nor floating-point values are clamped.
-The initial specular reflectance for both front- and back-facing materials
-is (0, 0, 0, 1).
-.TP
-_const(EMISSION)
-_param3 contains four integer or floating-point values that specify
-the RGBA emitted light intensity of the material.
-Integer values are mapped linearly such that the most positive representable
-value maps to 1.0,
-and the most negative representable value maps to \-1.0.
-Floating-point values are mapped directly.
-Neither integer nor floating-point values are clamped.
-The initial emission intensity for both front- and back-facing materials
-is (0, 0, 0, 1).
-.TP
-_const(SHININESS)
-_param3 is a single integer or floating-point value that specifies
-the RGBA specular exponent of the material.
-Integer and floating-point values are mapped directly.
-Only values in the range [0,128] are accepted.
-The initial specular exponent for both front- and back-facing materials
-is 0.
-.TP
-_const(AMBIENT_AND_DIFFUSE)
-Equivalent to calling _cmnd twice with the same parameter values,
-once with _const(AMBIENT) and once with _const(DIFFUSE).
-.TP
-_const(COLOR_INDEXES)
-_param3 contains three integer or floating-point values specifying
-the color indices for ambient,
-diffuse,
-and specular lighting.
-These three values,
-and _const(SHININESS),
-are the only material values used by the color index mode lighting equation.
-Refer to the _cmnd(LightModel) reference page for a discussion
-of color index lighting.
-.SH NOTES
-The material parameters can be updated at any time.
-In particular,
-_cmnd can be called between a call to _cmnd(Begin) and the corresponding
-call to _cmnd(End).
-If only a single material parameter is to be changed per vertex,
-however,
-_cmnd(ColorMaterial) is preferred over _cmnd
-(see _cmnd(ColorMaterial)).
-.P
-While the ambient, diffuse, specular and emission material parameters
-all have alpha components, only the diffuse alpha component is used in
-the lighting computation.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if either _param1 or _param2 is not
-an accepted value.
-.P
-_const(INVALID_VALUE) is generated if a specular exponent outside the range
-[0,128] is specified.
-.SH ASSOCIATED GETS
-_cmnd(GetMaterial)
-.SH SEE ALSO
-_cmnd(ColorMaterial),
-_cmnd(Light),
-_cmnd(LightModel)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/matrixmode.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/matrixmode.gl
deleted file mode 100755
index 3b478e4ae..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/matrixmode.gl
+++ /dev/null
@@ -1,81 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(MatrixMode,specify which matrix is the current matrix)
-_names(MatrixMode)
-.SH PARAMETERS
-_phead(_param1)
-Specifies which matrix stack is the target
-for subsequent matrix operations.
-Three values are accepted:
-_const(MODELVIEW),
-_const(PROJECTION), and
-_const(TEXTURE).
-The initial value is _const(MODELVIEW).
-.TE
-
-Additionally, if the _arbstring(imaging) extension is supported,
-_const(COLOR) is also accepted.
-.SH DESCRIPTION
-_cmnd sets the current matrix mode.
-_param1 can assume one of four values:
-.TP 25
-_const(MODELVIEW)
-Applies subsequent matrix operations to the modelview matrix stack.
-.TP
-_const(PROJECTION)
-Applies subsequent matrix operations to the projection matrix stack.
-.TP
-_const(TEXTURE)
-Applies subsequent matrix operations to the texture matrix stack.
-.TP
-_const(COLOR)
-Applies subsequent matrix operations to the color matrix stack.
-.P
-To find out which matrix stack is currently the target of all matrix
-operations, call _cmnd(Get) with argument _const(MATRIX_MODE). The initial
-value is _const(MODELVIEW).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(MATRIX_MODE)
-.SH SEE ALSO
-_cmnd(LoadMatrix),
-_cmnd(PushMatrix)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/minmax.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/minmax.gl
deleted file mode 100755
index e177e0139..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/minmax.gl
+++ /dev/null
@@ -1,134 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(Minmax,define minmax table)
-_names(Minmax)
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__internalformat>@,@<_param2>@)_C_
-_define(@<__sink>@,@<_param3>@)_C_
-.SH PARAMETERS
-_phead(__target)
-The minmax table whose parameters are to be set.
-Must be
-_const(MINMAX).
-_phead(__internalformat)
-The format of entries in the minmax table.
-Must be one of
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(R3_G3_B2),
-_const(RGB),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12), or
-_const(RGBA16).
-_phead(__sink)
-If _const(TRUE), pixels will be consumed by the minmax
-process and no drawing or texture loading will take place.
-If _const(FALSE), pixels will proceed to the final conversion process after
-minmax.
-.SH DESCRIPTION
-When _const(MINMAX) is enabled, the RGBA components of incoming pixels are
-compared to the minimum and maximum values for each component, which are
-stored in the 2-element minmax table.
-(The first element stores the minima, and the second element stores
-the maxima.)
-If a pixel component is greater than the corresponding component
-in the maximum element, then the maximum element is updated with the
-pixel component value.
-If a pixel component is less than the corresponding component in
-the minimum element, then the minimum element is updated with the
-pixel component value.
-(In both cases, if the internal format of the minmax table includes
-luminance, then the R color component of incoming pixels is used
-for comparison.)
-The contents of the minmax table may be retrieved at a later time
-by calling _cmnd(GetMinmax).
-The minmax operation is enabled or disabled by calling _cmnd(Enable) or
-_cmnd(Disable), respectively, with an argument of _const(MINMAX).
-.P
-_cmnd redefines the current minmax table to have entries of the format
-specified by __internalformat.
-The maximum element is initialized with the smallest possible component
-values, and the minimum element is initialized with the largest possible
-component values.
-The values in the previous minmax table, if any, are lost.
-If __sink is _const(TRUE), then pixels are discarded after minmax;
-no further processing of the pixels takes place, and no drawing,
-texture loading, or pixel readback will result.
-.P
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __internalformat is not one of the
-allowable values.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetMinmaxParameter)
-.SH SEE ALSO
-_cmnd(GetMinmax),
-_cmnd(ResetMinmax)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/multitexcoordARB.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/multitexcoordARB.gl
deleted file mode 100755
index 944528cf8..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/multitexcoordARB.gl
+++ /dev/null
@@ -1,102 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(MultiTexCoordARB, set the current texture coordinates)
-_names(MultiTexCoord,[1-4]u*[sifdb]ARB)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies texture unit whose coordinates should be modified. The number
-of texture units is implementation dependent, but must be at least
-two. Must be one of _arbconstidx(TEXTURE) where 0 \(<= $ i $ <
-_arbconst(MAX_TEXTURE_UNITS), which is an implementation-dependent value.
-_phead(_param2 _param3 _param4 _param5)
-Specify _param2, _param3, _param4, and _param5 texture coordinates for
-_param1 texture unit. Not all parameters are present in all forms
-of the command.
-_names(MultiTexCoord,[1-4]u*[sifdb]vARB)
-.SH PARAMETERS
-_phead(_param1)
-Specifies texture unit whose coordinates should be modified. The number
-of texture units is implementation dependent, but must be at least
-two. Must be one of _arbconstidx(TEXTURE),
-where 0 \(<= $ i $ < the implementation-dependent value of
-_const(MAX_TEXTURE_UNITS_ARB).
-_phead(_param2)
-Specifies a pointer to an array of one, two, three, or four elements,
-which in turn specify the _param2(1), _param3(1), _param4(1),
-and _param5(1) texture coordinates.
-.SH DESCRIPTION
-_cmnd specifies texture coordinates in one, two, three, or four
-dimensions.
-_cmnd(MultiTexCoord1ARB) sets the current texture
-coordinates to (_param2(1),\ 0,\ 0,\ 1);
-a call to _cmnd(MultiTexCoord2ARB)
-sets them to (_param2(1),\ _param3(1),\ 0,\ 1).
-Similarly, _cmnd(MultiTexCoord3ARB) specifies the texture coordinates as
-(_param2(1),\ _param3(1),\ _param4(1),\ 1), and
-_cmnd(MultiTexCoord4ARB)
-defines all four components explicitly as
-(_param2(1),\ _param3(1),\ _param4(1),\ _param5(1)).
-.P
-The current texture coordinates are part of the data
-that is associated with each vertex and with the current
-raster position.
-Initially, the values for
-_param2(1), _param3(1), _param4(1), _param5(1) are (0,\ 0,\ 0,\ 1).
-.P
-.SH NOTES
-_cmnd is only supported if _arbstring(multitexture) is included in the
-string returned by _cmnd(GetString) when called with the argument
-_const(EXTENSIONS).
-.P
-The current texture coordinates can be updated at any time.
-In particular,
-_cmnd can be called between a call to _cmnd(Begin) and the corresponding
-call to _cmnd(End).
-.P
-It is always the case that _arbconstidx(TEXTURE) = _arbconst(TEXTURE0) + $i$.
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(CURRENT_TEXTURE_COORDS) with appropriate
-texture unit selected.
-.SH SEE ALSO
-_cmnd(ActiveTextureARB),
-_cmnd(ClientActiveTextureARB),
-_cmnd(TexCoord),
-_cmnd(TexCoordPointer),
-_cmnd(Vertex)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/multmatrix.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/multmatrix.gl
deleted file mode 100755
index fe0af0ee5..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/multmatrix.gl
+++ /dev/null
@@ -1,132 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(MultMatrix,multiply the current matrix with the specified matrix)
-_names(MultMatrix,[df])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Points to 16 consecutive values that are used as the elements of
-a $4 ~times~ 4$ column-major matrix.
-.SH DESCRIPTION
-_cmnd multiplies the current matrix with the one specified using _param1, and
-replaces the current matrix with the product.
-.P
-The current matrix is determined by the current matrix mode (see _cmnd(MatrixMode)). It is either the projection matrix,
-modelview matrix,
-or the texture matrix.
-.SH EXAMPLES
-If the current matrix is $C$, and the coordinates
-to be transformed are, $v ~=~ (v[0], v[1], v[2], v[3])$.
-Then the current transformation is $C ~times~ v$, or
-.sp
-.ce
-.EQ
-down 130
-{{ left ( matrix {
- ccol { c[0] above c[1] above c[2] above c[3] }
- ccol { c[4] above c[5] above c[6] above c[7] }
- ccol { c[8] above c[9] above c[10] above c[11] }
- ccol { c[12]~ above c[13]~ above c[14]~ above c[15]~ }
-} right ) } ~~ times ~~
-{left ( matrix {
-ccol { v[0]~ above v[1]~ above v[2]~ above v[3]~ }
-} right )} }
-.EN
-.sp
-.P
-Calling _cmnd with an argument of $_eqnparam1 ~=~ m[0], m[1], ..., m[15]$
-replaces the current transformation with $(C ~times~ M) ~times~ v$,
-or
-.sp
-.ce
-.EQ
-down 130
-{{ left ( matrix {
- ccol { c[0] above c[1] above c[2] above c[3] }
- ccol { c[4] above c[5] above c[6] above c[7] }
- ccol { c[8] above c[9] above c[10] above c[11] }
- ccol { c[12]~ above c[13]~ above c[14]~ above c[15]~ }
-} right ) } ~~ times ~~
-{ left ( matrix {
- ccol { m[0] above m[1] above m[2] above m[3] }
- ccol { m[4] above m[5] above m[6] above m[7] }
- ccol { m[8] above m[9] above m[10] above m[11] }
- ccol { m[12]~ above m[13]~ above m[14]~ above m[15]~ }
-} right ) } ~~ times ~~
-{left ( matrix {
-ccol { v[0]~ above v[1]~ above v[2]~ above v[3]~ }
-} right )} }
-.EN
-.sp
-.P
-Where '$times$' denotes matrix multiplication, and
-$v$ is represented as a $4 ~times~ 1$ matrix.
-.br
-.SH NOTES
-While the elements of the matrix may be specified with
-single or double precision, the GL may store or operate on these
-values in less than single precision.
-.P
-In many computer languages $4 ~times~ 4$ arrays are represented
-in row-major order. The transformations just described
-represent these matrices in column-major order.
-The order of the multiplication is important. For example, if the current
-transformation is a rotation, and _cmnd is called with a translation matrix,
-the translation is done directly on the coordinates to be transformed,
-while the rotation is done on the results of that translation.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(MATRIX_MODE)
-.br
-_cmnd(Get) with argument _const(COLOR_MATRIX)
-.br
-_cmnd(Get) with argument _const(MODELVIEW_MATRIX)
-.br
-_cmnd(Get) with argument _const(PROJECTION_MATRIX)
-.br
-_cmnd(Get) with argument _const(TEXTURE_MATRIX)
-.SH SEE ALSO
-_cmnd(LoadIdentity),
-_cmnd(LoadMatrix),
-_cmnd(MatrixMode),
-_cmnd(PushMatrix)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/newlist.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/newlist.gl
deleted file mode 100755
index 495b3590b..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/newlist.gl
+++ /dev/null
@@ -1,163 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_header(NewList,create or replace a display list)
-_names(NewList)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the display-list name.
-_phead(_param2)
-Specifies the compilation mode,
-which can be
-_const(COMPILE) or
-_const(COMPILE_AND_EXECUTE).
-_names(EndList)
-.SH DESCRIPTION
-Display lists are groups of GL commands that have been stored
-for subsequent execution.
-Display lists are created with _cmnd.
-All subsequent commands are placed in the display list,
-in the order issued,
-until _cmnd(EndList) is called.
-.P
-_cmnd has two arguments.
-The first argument,
-_param1(1),
-is a positive integer that becomes the unique name for the display list.
-Names can be created and reserved with _cmnd(GenLists)
-and tested for uniqueness with _cmnd(IsList).
-The second argument,
-_param2(1),
-is a symbolic constant that can assume one of two values:
-.TP 30
-_const(COMPILE)
-Commands are merely compiled.
-.TP
-_const(COMPILE_AND_EXECUTE)
-Commands are executed as they are compiled into the display list.
-.P
-Certain commands are not compiled into the display list
-but are executed immediately,
-regardless of the display-list mode.
-These commands are
-_cmnd(AreTexturesResident),
-_cmnd(ColorPointer),
-_cmnd(DeleteLists),
-_cmnd(DeleteTextures),
-_cmnd(DisableClientState),
-_cmnd(EdgeFlagPointer),
-_cmnd(EnableClientState),
-_cmnd(FeedbackBuffer),
-_cmnd(Finish),
-_cmnd(Flush),
-_cmnd(GenLists),
-_cmnd(GenTextures),
-_cmnd(IndexPointer),
-_cmnd(InterleavedArrays),
-_cmnd(IsEnabled),
-_cmnd(IsList),
-_cmnd(IsTexture),
-_cmnd(NormalPointer),
-_cmnd(PopClientAttrib),
-_cmnd(PixelStore),
-_cmnd(PushClientAttrib),
-_cmnd(ReadPixels),
-_cmnd(RenderMode),
-_cmnd(SelectBuffer),
-_cmnd(TexCoordPointer),
-_cmnd(VertexPointer),
-and all of the _cmnd(Get) commands.
-.P
-Similarly,
-_cmnd(TexImage1D), _cmnd(TexImage2D), and _cmnd(TexImage3D)
-are executed immediately and not compiled into the display list when their
-first argument is _const(PROXY_TEXTURE_1D), _const(PROXY_TEXTURE_1D), or
-_const(PROXY_TEXTURE_3D), respectively.
-.P
-When the _arbstring(imaging) extension is supported,
-_cmnd(Histogram) executes immediately when its argument is
-_const(PROXY_HISTOGRAM). Similarly, _cmnd(ColorTable) executes
-immediately when its first argument is _cmnd(PROXY_COLOR_TABLE),
-_cmnd(PROXY_POST_CONVOLUTION_COLOR_TABLE), or
-_cmnd(PROXY_POST_COLOR_MATRIX_COLOR_TABLE).
-.P
-When the _arbstring(multitexture) extension is supported,
-_cmnd(ClientActiveTextureARB) is not compiled into display lists, but
-executed immediately.
-.P
-When _cmnd(EndList) is encountered,
-the display-list definition is completed by associating the list
-with the unique name _param1(1)
-(specified in the _cmnd(NewList) command).
-If a display list with name _param1(1) already exists,
-it is replaced only when _cmnd(EndList) is called.
-.SH NOTES
-_cmnd(CallList) and _cmnd(CallLists) can be entered into display lists.
-Commands in the display list or lists executed by _cmnd(CallList)
-or _cmnd(CallLists) are not included in the display list being created,
-even if the list creation mode is _const(COMPILE_AND_EXECUTE).
-.P
-A display list is just a group of commands and arguments, so errors
-generated by commands in a display list must be generated when the list is
-executed. If the list is created in _const(COMPILE) mode, errors are
-not generated until the list is executed.
-.SH ERRORS
-_const(INVALID_VALUE) is generated if _param1(1) is 0.
-.P
-_const(INVALID_ENUM) is generated if _param2(1) is not an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd(EndList) is called
-without a preceding _cmnd(NewList),
-or if _cmnd(NewList) is called while a display list is being defined.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd(NewList) or _cmnd(EndList)
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.P
-_const(OUT_OF_MEMORY) is generated if there is insufficient memory to
-compile the display list. If the GL version is 1.1 or greater, no
-change is made to the previous contents of the display list, if any,
-and no other change is made to the GL state. (It is as if no attempt
-had been made to create the new display list.)
-.SH ASSOCIATED GETS
-_cmnd(IsList)
-.br
-_cmnd(Get) with argument _const(LIST_INDEX)
-.br
-_cmnd(Get) with argument _const(LIST_MODE)
-.SH SEE ALSO
-_cmnd(CallList),
-_cmnd(CallLists),
-_cmnd(DeleteLists),
-_cmnd(GenLists)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/normal.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/normal.gl
deleted file mode 100755
index d8d6d865c..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/normal.gl
+++ /dev/null
@@ -1,87 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Normal,set the current normal vector)
-.EQ
-delim $$
-.EN
-_names(Normal,3[bdfis])
-.SH PARAMETERS
-_phead(_param1 _param2 _param3)
-Specify the $x$, $y$, and $z$ coordinates of the new current normal.
-The initial value of the current normal is the unit vector, (0, 0, 1).
-.P
-_names(Normal,3[bsidf]v)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a pointer to an array of three elements:
-the $x$, $y$, and $z$ coordinates of the new current normal.
-.P
-.SH DESCRIPTION
-The current normal is set to the given coordinates
-whenever _cmnd is issued.
-Byte, short, or integer arguments are converted to floating-point
-format with a linear mapping that maps the most positive representable integer
-value to 1.0,
-and the most negative representable integer value to \-1.0.
-.P
-Normals specified with _cmnd need not have unit length.
-If _const(NORMALIZE) is enabled,
-then normals of any length specified with _cmnd are normalized after transformation.
-If _const(RESCALE_NORMAL) is enabled, normals are scaled by a scaling factor
-derived from the modelview matrix. _const(RESCALE_NORMAL) requires that the
-originally specified normals were of unit length, and that the modelview
-matrix contain only uniform scales for proper results.
-To enable and disable normalization, call _cmnd(Enable) and _cmnd(Disable)
-with either _const(NORMALIZE) or _const(RESCALE_NORMAL).
-Normalization is initially disabled.
-.SH NOTES
-The current normal can be updated at any time.
-In particular, _cmnd can be called between a call to _cmnd(Begin) and
-the corresponding call to _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(CURRENT_NORMAL)
-.br
-_cmnd(IsEnabled) with argument _const(NORMALIZE)
-.br
-_cmnd(IsEnabled) with argument _const(RESCALE_NORMAL)
-.SH SEE ALSO
-_cmnd(Begin),
-_cmnd(Color),
-_cmnd(Index),
-_cmnd(NormalPointer),
-_cmnd(TexCoord),
-_cmnd(Vertex)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/normalpointer.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/normalpointer.gl
deleted file mode 100755
index 4b464d0e9..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/normalpointer.gl
+++ /dev/null
@@ -1,138 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_C_ A real line follows.
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_C_ Use GL not OpenGL
-_C_ Don't change the ordering of the main headers.
-_C_ C specification (or fortran) is handled automatically
-_C_ .TH is automatically added to the top of this file.
-_C_ Below, use current tense, active do not capitalize the first word and dont
-_C_ use a period.
-_C_ the function name must appear in (APIFILE) (usually gl.h) as set in
-_C_ Makefile.
-_header(NormalPointer,define an array of normals)
-_names(NormalPointer)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the data type of each coordinate in the array.
-Symbolic constants
-_const(BYTE),
-_const(SHORT),
-_const(INT),
-_const(FLOAT), and
-_const(DOUBLE)
-are accepted. The initial value is _const(FLOAT).
-_phead(_param2)
-Specifies the byte offset between consecutive normals. If _param2 is 0\-
-the initial value\-the normals are understood to be tightly packed in
-the array.
-The initial value is 0.
-_phead(_param3)
-Specifies a pointer to the first coordinate of the first normal in the
-array.
-The initial value is 0.
-.SH DESCRIPTION
-_cmnd specifies the location and data format of an array of normals
-to use when rendering.
-_param1 specifies the data type of
-the normal coordinates and _param2 gives the byte stride from one
-normal to the next, allowing vertices and attributes
-to be packed into a single array or stored in separate arrays.
-(Single-array storage may be more efficient on some implementations;
-see _cmnd(InterleavedArrays).)
-When a normal array is specified, _param1, _param2, and _param3 are
-saved as client-side state.
-.P
-To enable and disable the normal array, call _cmnd(EnableClientState) and
-_cmnd(DisableClientState) with the argument _const(NORMAL_ARRAY). If
-enabled, the normal array is used
-when _cmnd(DrawArrays), _cmnd(DrawElements), or _cmnd(ArrayElement) is called.
-.P
-Use _cmnd(DrawArrays) to construct a sequence of primitives (all of the
-same type) from prespecified vertex and vertex attribute arrays.
-Use _cmnd(ArrayElement) to specify primitives
-by indexing vertices and vertex attributes and _cmnd(DrawElements) to
-construct a sequence of primitives by indexing vertices and vertex attributes.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-The normal array is initially disabled and isn't accessed when
-_cmnd(ArrayElement), _cmnd(DrawElements), or _cmnd(DrawArrays) is called.
-.P
-Execution of _cmnd is not allowed between
-_cmnd(Begin) and the corresponding _cmnd(End),
-but an error may or may not be generated. If an error is not generated,
-the operation is undefined.
-.P
-_cmnd is typically implemented on the client side.
-.P
-Since the normal array parameters are client-side state, they are not
-saved or restored by _cmnd(PushAttrib) and _cmnd(PopAttrib).
-Use _cmnd(PushClientAttrib) and
-_cmnd(PopClientAttrib) instead.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_VALUE) is generated if _param2 is negative.
-.SH ASSOCIATED GETS
-_cmnd(IsEnabled) with argument _const(NORMAL_ARRAY)
-.br
-_cmnd(Get) with argument _const(NORMAL_ARRAY_TYPE)
-.br
-_cmnd(Get) with argument _const(NORMAL_ARRAY_STRIDE)
-.br
-_cmnd(GetPointerv) with argument _const(NORMAL_ARRAY_POINTER)
-.SH SEE ALSO
-_C_ no queries or gets listed above,
-_C_ alphabetize commands
-_C_ seperate with commas not .br.
-_C_ no command appears in the associated gets as well as in SEE ALSO.
-_cmnd(ArrayElement),
-_cmnd(ColorPointer),
-_cmnd(DrawArrays),
-_cmnd(DrawElements),
-_cmnd(EdgeFlagPointer),
-_cmnd(Enable),
-_cmnd(GetPointerv),
-_cmnd(IndexPointer),
-_cmnd(InterleavedArrays),
-_cmnd(PopClientAttrib),
-_cmnd(PushClientAttrib),
-_cmnd(TexCoordPointer),
-_cmnd(VertexPointer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/ortho.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/ortho.gl
deleted file mode 100755
index d9887b90b..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/ortho.gl
+++ /dev/null
@@ -1,114 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Ortho,multiply the current matrix with an orthographic matrix)
-_names(Ortho)
-.SH PARAMETERS
-_phead(_param1 _param2)
-Specify the coordinates for the left and right vertical clipping planes.
-_phead(_param3 _param4)
-Specify the coordinates for the bottom and top horizontal clipping planes.
-_phead(_param5 _param6)
-Specify the distances to the nearer and farther depth clipping planes.
-These values are negative if the plane is to be behind the viewer.
-.SH DESCRIPTION
-_cmnd describes a transformation that produces a parallel projection.
-The current matrix (see _cmnd(MatrixMode)) is multiplied by this matrix
-and the result replaces the current matrix, as if
-_cmnd(MultMatrix) were called with the following matrix
-as its argument:
-.sp
-.ce
-.EQ
-left ( matrix {
- ccol { {2 over {_eqnparam2 - _eqnparam1}} above 0 above 0 above 0 }
- ccol { 0 above {2 over {_eqnparam4 - _eqnparam3}} above 0 above 0 }
- ccol { 0 above 0 above {-2 over {_eqnparam6 - _eqnparam5}} above 0 }
- ccol { {t sub x}~ above {t sub y}~ above {t sub z}~ above 1~ }
-} right )
-.EN
-.BP
-.P
-where
-.ce
-.EQ
-t sub x ~=~ -^{{_eqnparam2 ~+~ _eqnparam1} over {_eqnparam2 ~-~ _eqnparam1}}
-.EN
-
-.ce
-.EQ
-t sub y ~=~ -^{{_eqnparam4 ~+~ _eqnparam3} over {_eqnparam4 ~-~ _eqnparam3}}
-.EN
-
-.ce
-.EQ
-t sub z ~=~ -^{{_eqnparam6 ~+~ _eqnparam5} over {_eqnparam6 ~-~ _eqnparam5}}
-.EN
-
-.RE
-.P
-Typically, the matrix mode is _const(PROJECTION), and
-(_param1, _param3, \-_param5) and (_param2, _param4, \-_param5)
-specify the points on the near clipping plane that are mapped
-to the lower left and upper right corners of the window,
-respectively,
-assuming that the eye is located at (0, 0, 0).
-\-_param6 specifies the location of the far clipping plane.
-Both _param5 and _param6 can be either positive or negative.
-.P
-Use _cmnd(PushMatrix) and _cmnd(PopMatrix) to save and restore
-the current matrix stack.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of
-_cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(MATRIX_MODE)
-.br
-_cmnd(Get) with argument _const(COLOR_MATRIX)
-.br
-_cmnd(Get) with argument _const(MODELVIEW_MATRIX)
-.br
-_cmnd(Get) with argument _const(PROJECTION_MATRIX)
-.br
-_cmnd(Get) with argument _const(TEXTURE_MATRIX)
-.SH SEE ALSO
-_cmnd(Frustum),
-_cmnd(MatrixMode),
-_cmnd(MultMatrix),
-_cmnd(PushMatrix),
-_cmnd(Viewport)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/passthrough.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/passthrough.gl
deleted file mode 100755
index 14b9827db..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/passthrough.gl
+++ /dev/null
@@ -1,72 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(PassThrough,place a marker in the feedback buffer)
-_names(PassThrough)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a marker value to be placed in the feedback buffer
-following a _const(PASS_THROUGH_TOKEN).
-.SH DESCRIPTION
-.P
-Feedback is a GL render mode.
-The mode is selected by calling
-_cmnd(RenderMode) with _const(FEEDBACK).
-When the GL is in feedback mode,
-no pixels are produced by rasterization.
-Instead,
-information about primitives that would have been rasterized
-is fed back to the application using the GL.
-See the _cmnd(FeedbackBuffer) reference page for a description of the
-feedback buffer and the values in it.
-.P
-_cmnd inserts a user-defined marker in the feedback buffer
-when it is executed in feedback mode.
-_param1 is returned as if it were a primitive;
-it is indicated with its own unique identifying value:
-_const(PASS_THROUGH_TOKEN).
-The order of _cmnd commands with respect to the specification
-of graphics primitives is maintained.
-.SH NOTES
-_cmnd is ignored if the GL is not in feedback mode.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd is executed between
-the execution of _cmnd(Begin) and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(RENDER_MODE)
-.SH SEE ALSO
-_cmnd(FeedbackBuffer),
-_cmnd(RenderMode)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/pixelmap.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/pixelmap.gl
deleted file mode 100755
index 9b3ddca84..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/pixelmap.gl
+++ /dev/null
@@ -1,250 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(PixelMap,set up pixel transfer maps)
-_names(PixelMap,u*[fis]v)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-.na
-Specifies a symbolic map name.
-Must be one of the following:
-_const(PIXEL_MAP_I_TO_I),
-_const(PIXEL_MAP_S_TO_S),
-_const(PIXEL_MAP_I_TO_R),
-_const(PIXEL_MAP_I_TO_G),
-_const(PIXEL_MAP_I_TO_B),
-_const(PIXEL_MAP_I_TO_A),
-_const(PIXEL_MAP_R_TO_R),
-_const(PIXEL_MAP_G_TO_G),
-_const(PIXEL_MAP_B_TO_B), or
-_const(PIXEL_MAP_A_TO_A).
-_phead(_param2)
-Specifies the size of the map being defined.
-_phead(_param3)
-Specifies an array of _param2 values.
-.SH DESCRIPTION
-_cmnd sets up translation tables,
-or \f2maps\fP,
-used by
-_cmnd(CopyPixels),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(DrawPixels),
-_cmnd(ReadPixels),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D), and
-_cmnd(TexSubImage3D).
-Additionally, if the _arbstring(imaging) subset is supported, the
-routines
-_cmnd(ColorTable),
-_cmnd(ColorSubTable),
-_cmnd(ConvolutionFilter1D),
-_cmnd(ConvolutionFilter2D),
-_cmnd(Histogram),
-_cmnd(Minmax), and
-_cmnd(SeparableFilter2D).
-Use of these maps is described completely in the
-_cmnd(PixelTransfer) reference page,
-and partly in the reference pages for the pixel and texture image commands.
-Only the specification of the maps is described in this reference page.
-.P
-_param1 is a symbolic map name,
-indicating one of ten maps to set.
-_param2 specifies the number of entries in the map,
-and _param3 is a pointer to an array of _param2 map values.
-.P
-The ten maps are as follows:
-.TP 30
-_const(PIXEL_MAP_I_TO_I)
-Maps color indices to color indices.
-.TP
-_const(PIXEL_MAP_S_TO_S)
-Maps stencil indices to stencil indices.
-.TP
-_const(PIXEL_MAP_I_TO_R)
-Maps color indices to red components.
-.TP
-_const(PIXEL_MAP_I_TO_G)
-Maps color indices to green components.
-.TP
-_const(PIXEL_MAP_I_TO_B)
-Maps color indices to blue components.
-.TP
-_const(PIXEL_MAP_I_TO_A)
-Maps color indices to alpha components.
-.TP
-_const(PIXEL_MAP_R_TO_R)
-Maps red components to red components.
-.TP
-_const(PIXEL_MAP_G_TO_G)
-Maps green components to green components.
-.TP
-_const(PIXEL_MAP_B_TO_B)
-Maps blue components to blue components.
-.TP
-_const(PIXEL_MAP_A_TO_A)
-Maps alpha components to alpha components.
-.P
-The entries in a map can be specified as single-precision
-floating-point numbers,
-unsigned short integers,
-or unsigned long integers.
-Maps that store color component values
-(all but _const(PIXEL_MAP_I_TO_I) and _const(PIXEL_MAP_S_TO_S))
-retain their values in floating-point format,
-with unspecified mantissa and exponent sizes.
-Floating-point values specified by _cmnd(PixelMapfv) are converted directly
-to the internal floating-point format of these maps,
-then clamped to the range [0,1].
-Unsigned integer values specified by _cmnd(PixelMapusv) and
-_cmnd(PixelMapuiv) are converted linearly such that
-the largest representable integer maps to 1.0,
-and 0 maps to 0.0.
-.P
-Maps that store indices,
-_const(PIXEL_MAP_I_TO_I) and _const(PIXEL_MAP_S_TO_S),
-retain their values in fixed-point format,
-with an unspecified number of bits to the right of the binary point.
-Floating-point values specified by _cmnd(PixelMapfv) are converted directly
-to the internal fixed-point format of these maps.
-Unsigned integer values specified by _cmnd(PixelMapusv) and
-_cmnd(PixelMapuiv) specify integer values,
-with all 0's to the right of the binary point.
-.P
-The following table shows the initial sizes and values for each of the maps.
-Maps that are indexed by either color or stencil indices must have
-_param2 = $2 sup n$ for some $n$ or the results are undefined.
-The maximum allowable size for each map depends on the implementation
-and can be determined by calling _cmnd(Get) with argument
-_const(MAX_PIXEL_MAP_TABLE).
-The single maximum applies to all maps; it is at
-least 32.
-.bp
-.TS
-center tab(:) delim($$) ;
-lb cb cb cb cb
-l c c c c.
-_
-_param1:Lookup Index:Lookup Value:Initial Size:Initial Value
-_
-_const(PIXEL_MAP_I_TO_I):color index:color index:1:0
-_const(PIXEL_MAP_S_TO_S):stencil index :stencil index :1:0
-_const(PIXEL_MAP_I_TO_R):color index :R:1:0
-_const(PIXEL_MAP_I_TO_G):color index :G:1:0
-_const(PIXEL_MAP_I_TO_B):color index:B:1:0
-_const(PIXEL_MAP_I_TO_A):color index:A:1:0
-_const(PIXEL_MAP_R_TO_R):R:R:1:0
-_const(PIXEL_MAP_G_TO_G):G:G:1:0
-_const(PIXEL_MAP_B_TO_B):B:B:1:0
-_const(PIXEL_MAP_A_TO_A):A:A:1:0
-_
-.TE
-
-.RE
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_VALUE) is generated if _param2 is less than one
-or larger than _const(MAX_PIXEL_MAP_TABLE).
-.P
-_const(INVALID_VALUE) is generated if _param1 is
-_const(PIXEL_MAP_I_TO_I),
-_const(PIXEL_MAP_S_TO_S),
-_const(PIXEL_MAP_I_TO_R),
-_const(PIXEL_MAP_I_TO_G),
-_const(PIXEL_MAP_I_TO_B), or
-_const(PIXEL_MAP_I_TO_A),
-and _param2 is not a power of two.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetPixelMap)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_I_TO_I_SIZE)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_S_TO_S_SIZE)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_I_TO_R_SIZE)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_I_TO_G_SIZE)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_I_TO_B_SIZE)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_I_TO_A_SIZE)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_R_TO_R_SIZE)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_G_TO_G_SIZE)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_B_TO_B_SIZE)
-.br
-_cmnd(Get) with argument _const(PIXEL_MAP_A_TO_A_SIZE)
-.br
-_cmnd(Get) with argument _const(MAX_PIXEL_MAP_TABLE)
-.SH SEE ALSO
-_cmnd(ColorTable),
-_cmnd(ColorSubTable),
-_cmnd(ConvolutionFilter1D),
-_cmnd(ConvolutionFilter2D),
-_cmnd(CopyPixels),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(DrawPixels),
-_cmnd(Histogram),
-_cmnd(Minmax),
-_cmnd(PixelStore),
-_cmnd(PixelTransfer),
-_cmnd(ReadPixels),
-_cmnd(SeparableFilter2D),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/pixelstore.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/pixelstore.gl
deleted file mode 100755
index 810f03a69..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/pixelstore.gl
+++ /dev/null
@@ -1,513 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(PixelStore,set pixel storage modes)
-_names(PixelStore,[fi])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the symbolic name of the parameter to be set.
-Six values affect the packing of pixel data into memory:
-_const(PACK_SWAP_BYTES),
-_const(PACK_LSB_FIRST),
-_const(PACK_ROW_LENGTH),
-_const(PACK_IMAGE_HEIGHT),
-_const(PACK_SKIP_PIXELS),
-_const(PACK_SKIP_ROWS),
-_const(PACK_SKIP_IMAGES), and
-_const(PACK_ALIGNMENT).
-Six more affect the unpacking of pixel data \f2from\fP memory:
-_const(UNPACK_SWAP_BYTES),
-_const(UNPACK_LSB_FIRST),
-_const(UNPACK_ROW_LENGTH),
-_const(UNPACK_IMAGE_HEIGHT),
-_const(UNPACK_SKIP_PIXELS),
-_const(UNPACK_SKIP_ROWS),
-_const(UNPACK_SKIP_IMAGES), and
-_const(UNPACK_ALIGNMENT).
-_phead(_param2)
-Specifies the value that _param1 is set to.
-.SH DESCRIPTION
-
-_cmnd sets pixel storage modes that affect the operation of subsequent
-_cmnd(DrawPixels) and _cmnd(ReadPixels) as well as the unpacking of
-polygon stipple patterns (see _cmnd(PolygonStipple)), bitmaps (see
-_cmnd(Bitmap)), texture patterns (see _cmnd(TexImage1D),
-_cmnd(TexImage2D), _cmnd(TexImage3D), _cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D), _cmnd(TexSubImage3D)).
-Additionally, if the _arbstring(imaging) extension is supported, pixle
-storage modes affect convlution filters
-(see _cmnd(ConvolutionFilter1D), _cmnd(ConvolutionFilter2D), and
-_cmnd(SeparableFilter2D), color table (see _cmnd(ColorTable), and
-_cmnd(ColorSubTable), and unpacking histogram (See _cmnd(Histogram)),
-and minmax (See _cmnd(Minmax)) data.
-.P
-_param1 is a symbolic constant indicating the parameter to be set, and
-_param2 is the new value. Six of the twelve storage parameters affect
-how pixel data is returned to client memory.
-They are as follows:
-.TP 10
-_const(PACK_SWAP_BYTES)
-If true,
-byte ordering for multibyte color components,
-depth components,
-color indices,
-or stencil indices
-is reversed.
-That is,
-if a four-byte component consists of bytes
-$b sub 0$,
-$b sub 1$,
-$b sub 2$,
-$b sub 3$,
-it is stored in memory as
-$b sub 3$,
-$b sub 2$,
-$b sub 1$,
-$b sub 0$
-if _const(PACK_SWAP_BYTES) is true.
-_const(PACK_SWAP_BYTES) has no effect on the memory order of components
-within a pixel,
-only on the order of bytes within components or indices.
-For example,
-the three components of a _const(RGB) format pixel are always stored with
-red first,
-green second,
-and blue third,
-regardless of the value of _const(PACK_SWAP_BYTES).
-.TP
-_const(PACK_LSB_FIRST)
-If true,
-bits are ordered within a byte from least significant to most significant;
-otherwise,
-the first bit in each byte is the most significant one.
-This parameter is significant for bitmap data only.
-.TP
-_const(PACK_ROW_LENGTH)
-If greater than 0,
-_const(PACK_ROW_LENGTH) defines the number of pixels in a row.
-If the first pixel of a row is placed at location $p$ in memory,
-then the location of the first pixel of the next row is obtained by skipping
-.sp
-.ce
-$k ~=~~ left { ^ lpile { n l above {a over s left ceiling { s n l } over a right ceiling}} ~~ lpile {s ~>=~ a above s ~<~ a }$
-.sp
-components or indices,
-where $n$ is the number of components or indices in a pixel,
-$l$ is the number of pixels in a row
-(_const(PACK_ROW_LENGTH) if it is greater than 0,
-the $width$ argument to the pixel routine otherwise),
-$a$ is the value of _const(PACK_ALIGNMENT), and
-$s$ is the size, in bytes, of a single component
-(if $ a < s$, then it is as if $a ~=~ s$).
-In the case of 1-bit values,
-the location of the next row is obtained by skipping
-.sp
-.ce
-$k ~=~ 8 a left ceiling { n l } over { 8 a } ^ right ceiling$
-.sp
-components or indices.
-.IP
-The word \f2component\fP in this description refers to the nonindex values
-red,
-green,
-blue,
-alpha,
-and depth.
-Storage format _const(RGB),
-for example,
-has three components per pixel:
-first red,
-then green,
-and finally blue.
-.TP
-_const(PACK_IMAGE_HEIGHT)
-If greater than 0,
-_const(PACK_IMAGE_HEIGHT) defines the number of pixels in an image
-three-dimensional texture volume.
-Where ``image'' is defined by all pixels sharing the same third
-dimension index.
-If the first pixel of a row is placed at location $p$ in memory,
-then the location of the first pixel of the next row is obtained by skipping
-.sp
-.ce
-$k ~=~~ left { ~ lpile { n l h above {a over s left ceiling { s n l h }
-over a ^ right ceiling}} ~~ lpile {s ~>=~ a above s ~<~ a }$
-.sp
-components or indices, where $n$ is the number of components or indices
-in a pixel, $l$ is the number of pixels in a row
-(_const(PACK_ROW_LENGTH) if it is greater than 0, the
-$width$ argument to _cmnd(TexImage3d) otherwise), $h$ is the number of
-rows in a pixel image (_const(PACK_IMAGE_HEIGHT) if it is greater than
-0, the $height$ arguemnt to the _cmnd(TexImage3D) routine otherwise),
-$a$ is the value of
-_const(PACK_ALIGNMENT), and $s$ is the size, in bytes, of a single
-component (if $ a < s$, then it is as if $a = s$).
-.IP
-The word \f2component\fP in this description refers to the nonindex values
-red,
-green,
-blue,
-alpha,
-and depth.
-Storage format _const(RGB),
-for example,
-has three components per pixel:
-first red,
-then green,
-and finally blue.
-.TP
-_const(PACK_SKIP_PIXELS), _const(PACK_SKIP_ROWS), and _const(PACK_SKIP_IMAGES)
-These values are provided as a convenience to the programmer;
-they provide no functionality that cannot be duplicated simply by
-incrementing the pointer passed to _cmnd(ReadPixels).
-Setting _const(PACK_SKIP_PIXELS) to $i$ is equivalent to incrementing
-the pointer by $i n$ components or indices,
-where $n$ is the number of components or indices in each pixel.
-Setting _const(PACK_SKIP_ROWS) to $j$ is equivalent to incrementing
-the pointer by $j m$ components or indices,
-where $m$ is the number of components or indices per row,
-as just computed in the _const(PACK_ROW_LENGTH) section.
-Setting _const(PACK_SKIP_IMAGES) to $k$ is equivalent to incrementing
-the pointer by $k p$, where $p$ is the number of components or indices
-per image, as computed in the _const(PACK_IMAGE_HEIGHT) section.
-.TP
-_const(PACK_ALIGNMENT)
-Specifies the alignment requirements for the start of each pixel row in memory.
-The allowable values are
-1 (byte-alignment),
-2 (rows aligned to even-numbered bytes),
-4 (word-alignment), and
-8 (rows start on double-word boundaries).
-.P
-The other six of the twelve storage parameters affect how pixel data is
-read from client memory.
-These values are significant for _cmnd(DrawPixels),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D),
-_cmnd(Bitmap), and
-_cmnd(PolygonStipple).
-.P
-Additionally, if the _arbstring(imaging) extension is supported,
-_cmnd(ColorTable),
-_cmnd(ColorSubTable),
-_cmnd(ConvolutionFilter1D),
-_cmnd(ConvolutionFilter2D), and
-_cmnd(SeparableFilter2D).
-They are as follows:
-.TP
-_const(UNPACK_SWAP_BYTES)
-If true,
-byte ordering for multibyte color components,
-depth components,
-color indices,
-or stencil indices
-is reversed.
-That is,
-if a four-byte component consists of bytes
-$b sub 0$,
-$b sub 1$,
-$b sub 2$,
-$b sub 3$,
-it is taken from memory as
-$b sub 3$,
-$b sub 2$,
-$b sub 1$,
-$b sub 0$
-if _const(UNPACK_SWAP_BYTES) is true.
-_const(UNPACK_SWAP_BYTES) has no effect on the memory order of components
-within a pixel,
-only on the order of bytes within components or indices.
-For example,
-the three components of a _const(RGB) format pixel are always stored with
-red first,
-green second,
-and blue third,
-regardless of the value of _const(UNPACK_SWAP_BYTES).
-.TP
-_const(UNPACK_LSB_FIRST)
-If true,
-bits are ordered within a byte from least significant to most significant;
-otherwise,
-the first bit in each byte is the most significant one.
-This is relevant only for bitmap data.
-.TP
-_const(UNPACK_ROW_LENGTH)
-If greater than 0,
-_const(UNPACK_ROW_LENGTH) defines the number of pixels in a row.
-If the first pixel of a row is placed at location $p$ in memory,
-then the location of the first pixel of the next row is obtained by skipping
-.sp
-.ce
-$k ~=~~ left { ~ lpile { n l above {a over s left ceiling { s n l }
-over a ^ right ceiling}} ~~ lpile {s ~>=~ a above s ~<~ a }$
-.sp
-components or indices,
-where $n$ is the number of components or indices in a pixel,
-$l$ is the number of pixels in a row
-(_const(UNPACK_ROW_LENGTH) if it is greater than 0,
-the $width$ argument to the pixel routine otherwise),
-$a$ is the value of _const(UNPACK_ALIGNMENT), and
-$s$ is the size, in bytes, of a single component
-(if $ a < s$, then it is as if $a = s$).
-In the case of 1-bit values,
-the location of the next row is obtained by skipping
-.sp
-.ce
-$k ~=~ 8 a left ceiling { n l } over { 8 a } right ceiling$
-.sp
-components or indices.
-.IP
-The word \f2component\fP in this description refers to the nonindex values
-red,
-green,
-blue,
-alpha,
-and depth.
-Storage format _const(RGB),
-for example,
-has three components per pixel:
-first red,
-then green,
-and finally blue.
-.TP
-_const(UNPACK_IMAGE_HEIGHT)
-If greater than 0,
-_const(UNPACK_IMAGE_HEIGHT) defines the number of pixels in an image of
-a three-dimensional texture volume. Where ``image'' is defined by all
-pixel sharing the same third dimension index.
-If the first pixel of a row is placed at location $p$ in memory,
-then the location of the first pixel of the next row is obtained by skipping
-.sp
-.ce
-$k ~=~~ left {~ lpile { n l h above {a over s left ceiling { s n l h }
-over a ^ right ceiling}} ~~ lpile {s ~ >=~ a above s ~<~ a }$
-.sp
-components or indices,
-where $n$ is the number of components or indices in a pixel,
-$l$ is the number of pixels in a row
-(_const(UNPACK_ROW_LENGTH) if it is greater than 0,
-the $width$ argument to _cmnd(TexImage3D) otherwise),
-$h$ is the number of rows in an image (_const(UNPACK_IMAGE_HEIGHT) if
-it is greater than 0, the $height$ argument to _cmnd(TexImage3D) otherwise),
-$a$ is the value of _const(UNPACK_ALIGNMENT), and
-$s$ is the size, in bytes, of a single component
-(if $ a < s$, then it is as if $a ~=~ s$).
-.IP
-The word \f2component\fP in this description refers to the nonindex values
-red,
-green,
-blue,
-alpha,
-and depth.
-Storage format _const(RGB),
-for example,
-has three components per pixel:
-first red,
-then green,
-and finally blue.
-.TP
-_const(UNPACK_SKIP_PIXELS) and _const(UNPACK_SKIP_ROWS)
-These values are provided as a convenience to the programmer;
-they provide no functionality that cannot be duplicated by
-incrementing the pointer passed to
-_cmnd(DrawPixels),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(Bitmap), or
-_cmnd(PolygonStipple).
-Setting _const(UNPACK_SKIP_PIXELS) to $i$ is equivalent to incrementing
-the pointer by $i n$ components or indices,
-where $n$ is the number of components or indices in each pixel.
-Setting _const(UNPACK_SKIP_ROWS) to $j$ is equivalent to incrementing
-the pointer by $j k$ components or indices,
-where $k$ is the number of components or indices per row,
-as just computed in the _const(UNPACK_ROW_LENGTH) section.
-.TP
-_const(UNPACK_ALIGNMENT)
-Specifies the alignment requirements for the start of each pixel row in memory.
-The allowable values are
-1 (byte-alignment),
-2 (rows aligned to even-numbered bytes),
-4 (word-alignment), and
-8 (rows start on double-word boundaries).
-.P
-The following table gives the type,
-initial value,
-and range of valid values for each storage parameter
-that can be set with _cmnd.
-.sp
-
-.TS
-center tab(:) delim($$) ;
-lb cb cb cb
-l c c c.
-_
-_param1:Type:Initial Value:Valid Range
-_
-_const(PACK_SWAP_BYTES):boolean:false:true or false
-_const(PACK_LSB_FIRST):boolean:false:true or false
-_const(PACK_ROW_LENGTH):integer:0:[0,\(if)
-_const(PACK_IMAGE_HEIGHT):integer:0:[0, \(if)
-_const(PACK_SKIP_ROWS):integer:0:[0,\(if)
-_const(PACK_SKIP_PIXELS):integer:0:[0,\(if)
-_const(PACK_SKIP_IMAGES):integer:0:[0,\(if)
-_const(PACK_ALIGNMENT):integer:4:1, 2, 4, or 8
-_
-_const(UNPACK_SWAP_BYTES):boolean:false:true or false
-_const(UNPACK_LSB_FIRST):boolean:false:true or false
-_const(UNPACK_ROW_LENGTH):integer:0:[0,\(if)
-_const(UNPACK_IMAGE_HEIGHT):integer:0:[0,\(if)
-_const(UNPACK_SKIP_ROWS):integer:0:[0,\(if)
-_const(UNPACK_SKIP_PIXELS):integer:0:[0,\(if)
-_const(UNPACK_SKIP_IMAGES):integer:0:[0,\(if)
-_const(UNPACK_ALIGNMENT):integer:4:1, 2, 4, or 8
-_
-.TE
-
-.sp
-_cmnd(PixelStoref) can be used to set any pixel store parameter.
-If the parameter type is boolean,
-then if _param2 is 0,
-the parameter is false;
-otherwise it is set to true.
-If _param1 is a integer type parameter,
-_param2 is rounded to the nearest integer.
-.P
-Likewise, _cmnd(PixelStorei) can also be used to set any of the
-pixel store parameters.
-Boolean parameters are set to false if _param2 is 0 and true otherwise.
-.SH NOTES
-The pixel storage modes in effect when
-_cmnd(DrawPixels),
-_cmnd(ReadPixels),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D),
-_cmnd(Bitmap),
-or _cmnd(PolygonStipple) is placed in a display list control the interpretation
-of memory data.
-Likewise, if the _arbstring(imaging) extension is supported, the pixel
-storage modes in effect when
-_cmnd(ColorTable),
-_cmnd(ColorSubTable),
-_cmnd(ConvolutionFilter1D),
-_cmnd(ConvolutionFilter2D), of
-_cmnd(SeparableFilter2D) is placed in a display list control the
-intrepretation of memory data.
-The pixel storage modes in effect when a display list is executed are
-not significant.
-.P
-Pixel storage modes are client state and must be pushed and restored
-using
-.br
-_cmnd(PushClientAttrib) and _cmnd(PopClientAttrib).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_VALUE) is generated if a negative row length,
-pixel skip,
-or row skip value is specified,
-or if alignment is specified as other than 1, 2, 4, or 8.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(PACK_SWAP_BYTES)
-.br
-_cmnd(Get) with argument _const(PACK_LSB_FIRST)
-.br
-_cmnd(Get) with argument _const(PACK_ROW_LENGTH)
-.br
-_cmnd(Get) with argument _const(PACK_IMAGE_HEIGHT)
-.br
-_cmnd(Get) with argument _const(PACK_SKIP_ROWS)
-.br
-_cmnd(Get) with argument _const(PACK_SKIP_PIXELS)
-.br
-_cmnd(Get) with argument _const(PACK_SKIP_IMAGES)
-.br
-_cmnd(Get) with argument _const(PACK_ALIGNMENT)
-.br
-_cmnd(Get) with argument _const(UNPACK_SWAP_BYTES)
-.br
-_cmnd(Get) with argument _const(UNPACK_LSB_FIRST)
-.br
-_cmnd(Get) with argument _const(UNPACK_ROW_LENGTH)
-.br
-_cmnd(Get) with argument _const(UNPACK_IMAGE_HEIGHT)
-.br
-_cmnd(Get) with argument _const(UNPACK_SKIP_ROWS)
-.br
-_cmnd(Get) with argument _const(UNPACK_SKIP_PIXELS)
-.br
-_cmnd(Get) with argument _const(UNPACK_SKIP_IMAGES)
-.br
-_cmnd(Get) with argument _const(UNPACK_ALIGNMENT)
-.SH SEE ALSO
-_cmnd(Bitmap),
-_cmnd(ColorTable),
-_cmnd(ColorSubTable),
-_cmnd(ConvolutionFilter1D),
-_cmnd(ConvolutionFilter2D),
-_cmnd(SeparableFilter2D),
-_cmnd(DrawPixels),
-_cmnd(Histogram),
-_cmnd(Minmax),
-_cmnd(PixelMap),
-_cmnd(PixelTransfer),
-_cmnd(PixelZoom),
-_cmnd(PolygonStipple),
-_cmnd(PushClientAttrib),
-_cmnd(ReadPixels),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/pixeltransfer.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/pixeltransfer.gl
deleted file mode 100755
index 81ad90f06..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/pixeltransfer.gl
+++ /dev/null
@@ -1,446 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(PixelTransfer, set pixel transfer modes)
-_names(PixelTransfer,[fi])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the symbolic name of the pixel transfer parameter to be set.
-Must be one of the following:
-_const(MAP_COLOR),
-_const(MAP_STENCIL),
-_const(INDEX_SHIFT),
-_const(INDEX_OFFSET),
-_const(RED_SCALE),
-_const(RED_BIAS),
-_const(GREEN_SCALE),
-_const(GREEN_BIAS),
-_const(BLUE_SCALE),
-_const(BLUE_BIAS),
-_const(ALPHA_SCALE),
-_const(ALPHA_BIAS),
-_const(DEPTH_SCALE), or
-_const(DEPTH_BIAS).
-.IP
-Additionally, if the _arbstring(imaging) extension is supported, the
-following symbolic names are accepted:
-_const(POST_COLOR_MATRIX_RED_SCALE),
-_const(POST_COLOR_MATRIX_GREEN_SCALE),
-_const(POST_COLOR_MATRIX_BLUE_SCALE),
-_const(POST_COLOR_MATRIX_ALPHA_SCALE),
-_const(POST_COLOR_MATRIX_RED_BIAS),
-_const(POST_COLOR_MATRIX_GREEN_BIAS),
-_const(POST_COLOR_MATRIX_BLUE_BIAS),
-_const(POST_COLOR_MATRIX_ALPHA_BIAS),
-_const(POST_CONVOLUTION_RED_SCALE),
-_const(POST_CONVOLUTION_GREEN_SCALE),
-_const(POST_CONVOLUTION_BLUE_SCALE),
-_const(POST_CONVOLUTION_ALPHA_SCALE),
-_const(POST_CONVOLUTION_RED_BIAS),
-_const(POST_CONVOLUTION_GREEN_BIAS),
-_const(POST_CONVOLUTION_BLUE_BIAS), and
-_const(POST_CONVOLUTION_ALPHA_BIAS).
-_phead(_param2)
-Specifies the value that _param1 is set to.
-.SH DESCRIPTION
-_cmnd sets pixel transfer modes that affect the operation of subsequent
-_cmnd(CopyPixels),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(DrawPixels),
-_cmnd(ReadPixels),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D), and
-_cmnd(TexSubImage3D) commands.
-Additionally, if the _arbstring(imaging) subset is supported, the
-routines
-_cmnd(ColorTable),
-_cmnd(ColorSubTable),
-_cmnd(ConvolutionFilter1D),
-_cmnd(ConvolutionFilter2D),
-_cmnd(Histogram),
-_cmnd(Minmax), and
-_cmnd(SeparableFilter2D) are also affected.
-The algorithms that are specified by pixel transfer modes operate on
-pixels after they are read from the frame buffer
-(_cmnd(CopyPixels)
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D), and
-_cmnd(ReadPixels)),
-or unpacked from client memory
-(_cmnd(DrawPixels), _cmnd(TexImage1D), _cmnd(TexImage2D), _cmnd(TexImage3D),
-_cmnd(TexSubImage1D), _cmnd(TexSubImage2D), and _cmnd(TexSubImage3D)).
-Pixel transfer operations happen in the same order,
-and in the same manner,
-regardless of the command that resulted in the pixel operation.
-Pixel storage modes
-(see _cmnd(PixelStore))
-control the unpacking of pixels being read from client memory,
-and the packing of pixels being written back into client memory.
-.P
-Pixel transfer operations handle four fundamental pixel types:
-\f2color\fP,
-\f2color index\fP,
-\f2depth\fP, and
-\f2stencil\fP.
-\f2Color\fP pixels consist of four floating-point values
-with unspecified mantissa and exponent sizes,
-scaled such that 0 represents zero intensity
-and 1 represents full intensity.
-\f2Color indices\fP comprise a single fixed-point value,
-with unspecified precision to the right of the binary point.
-\f2Depth\fP pixels comprise a single floating-point value,
-with unspecified mantissa and exponent sizes,
-scaled such that 0.0 represents the minimum depth buffer value,
-and 1.0 represents the maximum depth buffer value.
-Finally,
-\f2stencil\fP pixels comprise a single fixed-point value,
-with unspecified precision to the right of the binary point.
-.BP
-.P
-The pixel transfer operations performed on the four basic pixel types are
-as follows:
-.TP 12
-Color
-Each of the four color components is multiplied by a scale factor,
-then added to a bias factor.
-That is,
-the red component is multiplied by _const(RED_SCALE),
-then added to _const(RED_BIAS);
-the green component is multiplied by _const(GREEN_SCALE),
-then added to _const(GREEN_BIAS);
-the blue component is multiplied by _const(BLUE_SCALE),
-then added to _const(BLUE_BIAS); and
-the alpha component is multiplied by _const(ALPHA_SCALE),
-then added to _const(ALPHA_BIAS).
-After all four color components are scaled and biased,
-each is clamped to the range [0,1].
-All color, scale, and bias values are specified with _cmnd.
-.IP
-If _const(MAP_COLOR) is true,
-each color component is scaled by the size of the corresponding
-color-to-color map,
-then replaced by the contents of that map indexed by the scaled component.
-That is,
-the red component is scaled by _const(PIXEL_MAP_R_TO_R_SIZE),
-then replaced by the contents of _const(PIXEL_MAP_R_TO_R) indexed by itself.
-The green component is scaled by _const(PIXEL_MAP_G_TO_G_SIZE),
-then replaced by the contents of _const(PIXEL_MAP_G_TO_G) indexed by itself.
-The blue component is scaled by _const(PIXEL_MAP_B_TO_B_SIZE),
-then replaced by the contents of _const(PIXEL_MAP_B_TO_B) indexed by itself.
-And
-the alpha component is scaled by _const(PIXEL_MAP_A_TO_A_SIZE),
-then replaced by the contents of _const(PIXEL_MAP_A_TO_A) indexed by itself.
-All components taken from the maps are then clamped to the range [0,1].
-_const(MAP_COLOR) is specified with _cmnd.
-The contents of the various maps are specified with _cmnd(PixelMap).
-.IP
-If the _arbstring(imaging) extension is supported, each of the four
-color components may be scaled and biased after tranformation by the
-color matrix.
-That is,
-the red component is multiplied by _const(POST_COLOR_MATRIX_RED_SCALE),
-then added to _const(POST_COLOR_MATRIX_RED_BIAS);
-the green component is multiplied by _const(POST_COLOR_MATRIX_GREEN_SCALE),
-then added to _const(POST_COLOR_MATRIX_GREEN_BIAS);
-the blue component is multiplied by _const(POST_COLOR_MATRIX_BLUE_SCALE),
-then added to _const(POST_COLOR_MATRIX_BLUE_BIAS); and
-the alpha component is multiplied by _const(POST_COLOR_MATRIX_ALPHA_SCALE),
-then added to _const(POST_COLOR_MATRIX_ALPHA_BIAS).
-After all four color components are scaled and biased,
-each is clamped to the range [0,1].
-.IP
-Similiarly, if the _arbstring(imaging) extension is supported, each of
-the four color components may be scaled and biased after processing by
-the enabled convolution filter.
-That is,
-the red component is multiplied by _const(POST_CONVOLUTION_RED_SCALE),
-then added to _const(POST_CONVOLUTION_RED_BIAS);
-the green component is multiplied by _const(POST_CONVOLUTION_GREEN_SCALE),
-then added to _const(POST_CONVOLUTION_GREEN_BIAS);
-the blue component is multiplied by _const(POST_CONVOLUTION_BLUE_SCALE),
-then added to _const(POST_CONVOLUTION_BLUE_BIAS); and
-the alpha component is multiplied by _const(POST_CONVOLUTION_ALPHA_SCALE),
-then added to _const(POST_CONVOLUTION_ALPHA_BIAS).
-After all four color components are scaled and biased,
-each is clamped to the range [0,1].
-.TP
-Color index
-Each color index is shifted left by _const(INDEX_SHIFT) bits; any bits
-beyond the number of fraction bits carried
-by the fixed-point index are filled with zeros.
-If _const(INDEX_SHIFT) is negative,
-the shift is to the right,
-again zero filled.
-Then _const(INDEX_OFFSET) is added to the index.
-_const(INDEX_SHIFT) and _const(INDEX_OFFSET) are specified with
-.br
-_cmnd.
-.IP
-From this point, operation diverges depending on the required format of
-the resulting pixels.
-If the resulting pixels are to be written to a color index buffer,
-or if they are being read back to client memory in _const(COLOR_INDEX) format,
-the pixels continue to be treated as indices.
-If _const(MAP_COLOR) is true,
-each index is masked by $2 sup n ~-~ 1$,
-where $n$ is _const(PIXEL_MAP_I_TO_I_SIZE),
-then replaced by the contents of _const(PIXEL_MAP_I_TO_I) indexed by the
-masked value.
-_const(MAP_COLOR) is specified with _cmnd.
-The contents of the index map is specified with _cmnd(PixelMap).
-.IP
-If the resulting pixels are to be written to an RGBA color buffer,
-or if they are read back to client memory in a format other than
-_const(COLOR_INDEX),
-the pixels are converted from indices to colors by referencing the
-four maps
-_const(PIXEL_MAP_I_TO_R),
-_const(PIXEL_MAP_I_TO_G),
-_const(PIXEL_MAP_I_TO_B), and
-_const(PIXEL_MAP_I_TO_A).
-Before being dereferenced,
-the index is masked by $2 sup n ~-~ 1$,
-where $n$ is
-_const(PIXEL_MAP_I_TO_R_SIZE) for the red map,
-_const(PIXEL_MAP_I_TO_G_SIZE) for the green map,
-_const(PIXEL_MAP_I_TO_B_SIZE) for the blue map, and
-_const(PIXEL_MAP_I_TO_A_SIZE) for the alpha map.
-All components taken from the maps are then clamped to the range [0,1].
-The contents of the four maps is specified with _cmnd(PixelMap).
-.TP
-Depth
-Each depth value is multiplied by _const(DEPTH_SCALE),
-added to _const(DEPTH_BIAS),
-then clamped to the range [0,1].
-.TP
-Stencil
-Each index is shifted _const(INDEX_SHIFT) bits just as a color index is,
-then added to _const(INDEX_OFFSET).
-If _const(MAP_STENCIL) is true,
-each index is masked by $2 sup n ~-~ 1$,
-where $n$ is _const(PIXEL_MAP_S_TO_S_SIZE),
-then replaced by the contents of _const(PIXEL_MAP_S_TO_S) indexed by the
-masked value.
-.P
-The following table gives the type,
-initial value,
-and range of valid values for each of the pixel transfer parameters
-that are set with _cmnd.
-.sp
-
-.TS
-center tab(:);
-lb cb cb cb
-l c c c.
-_
-_param1:Type:Initial Value:Valid Range
-_
-_const(MAP_COLOR):boolean:false:true/false
-_const(MAP_STENCIL):boolean:false:true/false
-_const(INDEX_SHIFT):integer:0:(-\(if,\(if)
-_const(INDEX_OFFSET):integer:0:(-\(if,\(if)
-_const(RED_SCALE):float:1:(-\(if,\(if)
-_const(GREEN_SCALE):float:1:(-\(if,\(if)
-_const(BLUE_SCALE):float:1:(-\(if,\(if)
-_const(ALPHA_SCALE):float:1:(-\(if,\(if)
-_const(DEPTH_SCALE):float:1:(-\(if,\(if)
-_const(RED_BIAS):float:0:(-\(if,\(if)
-_const(GREEN_BIAS):float:0:(-\(if,\(if)
-_const(BLUE_BIAS):float:0:(-\(if,\(if)
-_const(ALPHA_BIAS):float:0:(-\(if,\(if)
-_const(DEPTH_BIAS):float:0:(-\(if,\(if)
-_const(POST_COLOR_MATRIX_RED_SCALE):float:1:(-\(if,\(if)
-_const(POST_COLOR_MATRIX_GREEN_SCALE):float:1:(-\(if,\(if)
-_const(POST_COLOR_MATRIX_BLUE_SCALE):float:1:(-\(if,\(if)
-_const(POST_COLOR_MATRIX_ALPHA_SCALE):float:1:(-\(if,\(if)
-_const(POST_COLOR_MATRIX_RED_BIAS):float:0:(-\(if,\(if)
-_const(POST_COLOR_MATRIX_GREEN_BIAS):float:0:(-\(if,\(if)
-_const(POST_COLOR_MATRIX_BLUE_BIAS):float:0:(-\(if,\(if)
-_const(POST_COLOR_MATRIX_ALPHA_BIAS):float:0:(-\(if,\(if)
-_const(POST_CONVOLUTION_RED_SCALE):float:1:(-\(if,\(if)
-_const(POST_CONVOLUTION_GREEN_SCALE):float:1:(-\(if,\(if)
-_const(POST_CONVOLUTION_BLUE_SCALE):float:1:(-\(if,\(if)
-_const(POST_CONVOLUTION_ALPHA_SCALE):float:1:(-\(if,\(if)
-_const(POST_CONVOLUTION_RED_BIAS):float:0:(-\(if,\(if)
-_const(POST_CONVOLUTION_GREEN_BIAS):float:0:(-\(if,\(if)
-_const(POST_CONVOLUTION_BLUE_BIAS):float:0:(-\(if,\(if)
-_const(POST_CONVOLUTION_ALPHA_BIAS):float:0:(-\(if,\(if)
-_
-.TE
-
-.sp
-_cmnd(PixelTransferf) can be used to set any pixel transfer parameter.
-If the parameter type is boolean,
-0 implies false and any other value implies true.
-If _param1 is an integer parameter,
-_param2 is rounded to the nearest integer.
-.P
-Likewise,
-_cmnd(PixelTransferi) can be used to set any of the
-pixel transfer parameters.
-Boolean parameters are set to false if _param2 is 0 and to true otherwise.
-_param2 is converted to floating point before being assigned to real-valued parameters.
-.SH NOTES
-If a
-_cmnd(ColorTable),
-_cmnd(ColorSubTable),
-_cmnd(ConvolutionFilter1D),
-_cmnd(ConvolutionFilter2D),
-_cmnd(CopyPixels),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(DrawPixels),
-_cmnd(ReadPixels),
-_cmnd(SeparableFilter2D),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D), or
-_cmnd(TexSubImage3D).
-command is placed in a display list
-(see _cmnd(NewList) and _cmnd(CallList)),
-the pixel transfer mode settings in effect when the display list is
-.I executed
-are the ones that are used.
-They may be different from the settings when the command was compiled
-into the display list.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(MAP_COLOR)
-.br
-_cmnd(Get) with argument _const(MAP_STENCIL)
-.br
-_cmnd(Get) with argument _const(INDEX_SHIFT)
-.br
-_cmnd(Get) with argument _const(INDEX_OFFSET)
-.br
-_cmnd(Get) with argument _const(RED_SCALE)
-.br
-_cmnd(Get) with argument _const(RED_BIAS)
-.br
-_cmnd(Get) with argument _const(GREEN_SCALE)
-.br
-_cmnd(Get) with argument _const(GREEN_BIAS)
-.br
-_cmnd(Get) with argument _const(BLUE_SCALE)
-.br
-_cmnd(Get) with argument _const(BLUE_BIAS)
-.br
-_cmnd(Get) with argument _const(ALPHA_SCALE)
-.br
-_cmnd(Get) with argument _const(ALPHA_BIAS)
-.br
-_cmnd(Get) with argument _const(DEPTH_SCALE)
-.br
-_cmnd(Get) with argument _const(DEPTH_BIAS)
-.br
-_cmnd(Get) with argument _const(POST_COLOR_MATRIX_RED_SCALE)
-.br
-_cmnd(Get) with argument _const(POST_COLOR_MATRIX_RED_BIAS)
-.br
-_cmnd(Get) with argument _const(POST_COLOR_MATRIX_GREEN_SCALE)
-.br
-_cmnd(Get) with argument _const(POST_COLOR_MATRIX_GREEN_BIAS)
-.br
-_cmnd(Get) with argument _const(POST_COLOR_MATRIX_BLUE_SCALE)
-.br
-_cmnd(Get) with argument _const(POST_COLOR_MATRIX_BLUE_BIAS)
-.br
-_cmnd(Get) with argument _const(POST_COLOR_MATRIX_ALPHA_SCALE)
-.br
-_cmnd(Get) with argument _const(POST_COLOR_MATRIX_ALPHA_BIAS)
-.br
-_cmnd(Get) with argument _const(POST_CONVOLUTION_RED_SCALE)
-.br
-_cmnd(Get) with argument _const(POST_CONVOLUTION_RED_BIAS)
-.br
-_cmnd(Get) with argument _const(POST_CONVOLUTION_GREEN_SCALE)
-.br
-_cmnd(Get) with argument _const(POST_CONVOLUTION_GREEN_BIAS)
-.br
-_cmnd(Get) with argument _const(POST_CONVOLUTION_BLUE_SCALE)
-.br
-_cmnd(Get) with argument _const(POST_CONVOLUTION_BLUE_BIAS)
-.br
-_cmnd(Get) with argument _const(POST_CONVOLUTION_ALPHA_SCALE)
-.br
-_cmnd(Get) with argument _const(POST_CONVOLUTION_ALPHA_BIAS)
-.SH SEE ALSO
-_cmnd(CallList),
-_cmnd(ColorTable),
-_cmnd(ColorSubTable),
-_cmnd(ConvolutionFilter1D),
-_cmnd(ConvolutionFilter2D),
-_cmnd(CopyPixels),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(DrawPixels),
-_cmnd(NewList),
-_cmnd(PixelMap),
-_cmnd(PixelStore),
-_cmnd(PixelZoom),
-_cmnd(ReadPixels),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/pixelzoom.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/pixelzoom.gl
deleted file mode 100755
index af53325ba..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/pixelzoom.gl
+++ /dev/null
@@ -1,75 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(PixelZoom,specify the pixel zoom factors)
-_names(PixelZoom)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1 _param2)
-Specify the $x$ and $y$ zoom factors for pixel write operations.
-.SH DESCRIPTION
-_cmnd specifies values for the $x$ and $y$ zoom factors.
-During the execution of _cmnd(DrawPixels) or _cmnd(CopyPixels),
-if ($xr $, $yr $) is the current raster position,
-and a given element is in the $m$th row and $n$th column of the pixel rectangle,
-then pixels whose centers are in the rectangle with corners at
-.sp
-.ce
-($xr ~+~ n cdot _eqnparam1$, $yr ~+~ m cdot _eqnparam2$)
-.sp
-.ce
-($xr ~+~ (n+1) cdot _eqnparam1$, $yr ~+~ (m+1) cdot _eqnparam2$)
-.sp
-are candidates for replacement.
-Any pixel whose center lies on the bottom or left edge of this rectangular
-region is also modified.
-.P
-Pixel zoom factors are not limited to positive values.
-Negative zoom factors reflect the resulting image about the current
-raster position.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(ZOOM_X)
-.br
-_cmnd(Get) with argument _const(ZOOM_Y)
-.SH SEE ALSO
-_cmnd(CopyPixels),
-_cmnd(DrawPixels)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/pointsize.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/pointsize.gl
deleted file mode 100755
index 0795df0d8..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/pointsize.gl
+++ /dev/null
@@ -1,145 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(PointSize,specify the diameter of rasterized points)
-_names(PointSize)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the diameter of rasterized points.
-The initial value is 1.
-.SH DESCRIPTION
-_cmnd specifies the rasterized diameter of both aliased and antialiased
-points.
-Using a point size other than 1 has different effects,
-depending on whether point antialiasing is enabled.
-To enable and disable point antialiasing, call
-_cmnd(Enable) and _cmnd(Disable)
-with argument _const(POINT_SMOOTH). Point antialiasing is initially disabled.
-.P
-If point antialiasing is disabled,
-the actual size is determined by rounding the supplied size
-to the nearest integer.
-(If the rounding results in the value 0,
-it is as if the point size were 1.)
-If the rounded size is odd,
-then the center point
-($ x $, $ y $)
-of the pixel fragment that represents the point is computed as
-.sp
-.ce
-( $ \(lf ~ x sub w ~ \(rf ~+~ .5 $, $ \(lf ~ y sub w ~ \(rf ~+~ .5 $)
-.sp
-where $w$ subscripts indicate window coordinates.
-All pixels that lie within the square grid of the rounded size centered at
-($ x $, $ y $)
-make up the fragment.
-If the size is even,
-the center point is
-.sp
-.ce
-( $ \(lf ~ x sub w ~+~ .5 ~ \(rf$, $ \(lf ~ y sub w ~+~ .5 ~ \(rf $)
-.sp
-and the rasterized fragment's centers are the half-integer window coordinates
-within the square of the rounded size centered at
-($ x $, $ y $).
-All pixel fragments produced in rasterizing a nonantialiased point are
-assigned the same associated data,
-that of the vertex corresponding to the point.
-.P
-If antialiasing is enabled,
-then point rasterization produces a fragment for each pixel square
-that intersects the region lying within the circle having diameter
-equal to the current point size and centered at the point's
-($ x sub w $, $ y sub w $).
-The coverage value for each fragment is the window coordinate area
-of the intersection of the circular region with the corresponding pixel square.
-This value is saved and used in the final rasterization step.
-The data associated with each fragment is the data associated with
-the point being rasterized.
-.P
-Not all sizes are supported when point antialiasing is enabled.
-If an unsupported size is requested,
-the nearest supported size is used.
-Only size 1 is guaranteed to be supported;
-others depend on the implementation.
-To query the range of supported sizes and the size difference between
-supported sizes within the range, call
-_cmnd(Get) with arguments
-_const(SMOOTH_POINT_SIZE_RANGE) and
-_const(SMOOTH_POINT_SIZE_GRANULARITY).
-For aliased points, query the supported ranges and granularity with
-_cmnd(Get) with arguments
-_const(ALIASED_POINT_SIZE_RANGE) and
-_const(ALIASED_POINT_SIZE_GRANULARITY).
-.SH NOTES
-The point size specified by _cmnd is always returned when _const(POINT_SIZE)
-is queried.
-Clamping and rounding for aliased and antialiased points have no effect
-on the specified value.
-.P
-A non-antialiased point size may be clamped to an implementation-dependent
-maximum.
-Although this maximum cannot be queried,
-it must be no less than the maximum value for antialiased points,
-rounded to the nearest integer value.
-.P
-_const(POINT_SIZE_RANGE) and _const(POINT_SIZE_GRANULARITY) are
-deprecated in GL versions 1.2 and greater. Their functionality has been
-replaced by _const(SMOOTH_POINT_SIZE_RANGE) and
-_const(SMOOTH_POINT_SIZE_GRANULARITY).
-.SH ERRORS
-_const(INVALID_VALUE) is generated if _param1 is less than or equal to 0.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(POINT_SIZE)
-.br
-_cmnd(Get) with argument _const(ALIASED_POINT_SIZE_RANGE)
-.br
-_cmnd(Get) with argument _const(ALIASED_POINT_SIZE_GRANULARITY)
-.br
-_cmnd(Get) with argument _const(SMOOTH_POINT_SIZE_RANGE)
-.br
-_cmnd(Get) with argument _const(SMOOTH_POINT_SIZE_GRANULARITY)
-.br
-_cmnd(IsEnabled) with argument _const(POINT_SMOOTH)
-.SH SEE ALSO
-_cmnd(Enable)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/polygonmode.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/polygonmode.gl
deleted file mode 100755
index 2a54f5d98..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/polygonmode.gl
+++ /dev/null
@@ -1,117 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(PolygonMode,select a polygon rasterization mode)
-_names(PolygonMode)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the polygons that _param2 applies to.
-Must be
-_const(FRONT) for front-facing polygons,
-_const(BACK) for back-facing polygons,
-or _const(FRONT_AND_BACK) for front- and back-facing polygons.
-_phead(_param2)
-Specifies how polygons will be rasterized.
-Accepted values are
-_const(POINT),
-_const(LINE), and
-_const(FILL).
-The initial value is _const(FILL) for both front- and back-facing polygons.
-.SH DESCRIPTION
-_cmnd controls the interpretation of polygons for rasterization.
-_param1 describes which polygons _param2 applies to:
-front-facing polygons (_const(FRONT)),
-back-facing polygons (_const(BACK)),
-or both (_const(FRONT_AND_BACK)).
-The polygon mode affects only the final rasterization of polygons.
-In particular,
-a polygon's vertices are lit and
-the polygon is clipped and possibly culled before these modes are applied.
-.P
-Three modes are defined and can be specified in _param2:
-.TP 14
-_const(POINT)
-Polygon vertices that are marked as the start of a boundary edge
-are drawn as points.
-Point attributes such as
-_const(POINT_SIZE) and
-_const(POINT_SMOOTH) control
-the rasterization of the points.
-Polygon rasterization attributes other than _const(POLYGON_MODE) have no effect.
-.TP
-_const(LINE)
-Boundary edges of the polygon are drawn as line segments.
-They are treated as connected line segments for line stippling;
-the line stipple counter and pattern are not reset between segments
-(see _cmnd(LineStipple)).
-Line attributes such as
-_const(LINE_WIDTH) and
-_const(LINE_SMOOTH) control
-the rasterization of the lines.
-Polygon rasterization attributes other than _const(POLYGON_MODE) have no effect.
-.TP
-_const(FILL)
-The interior of the polygon is filled.
-Polygon attributes such as
-_const(POLYGON_STIPPLE) and
-_const(POLYGON_SMOOTH) control the rasterization of the polygon.
-.SH EXAMPLES
-To draw a surface with filled back-facing polygons
-and outlined front-facing polygons,
-call
-.Ex 1
-glPolygonMode(_const(FRONT), _const(LINE));
-.Ee
-.SH NOTES
-Vertices are marked as boundary or nonboundary with an edge flag.
-Edge flags are generated internally by the GL when it decomposes
-polygons; they can be set explicitly using _cmnd(EdgeFlag).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if either _param1 or _param2 is not
-an accepted value.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(POLYGON_MODE)
-.SH SEE ALSO
-_cmnd(Begin),
-_cmnd(EdgeFlag),
-_cmnd(LineStipple),
-_cmnd(LineWidth),
-_cmnd(PointSize),
-_cmnd(PolygonStipple)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/polygonoffset.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/polygonoffset.gl
deleted file mode 100755
index 4ec2114e2..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/polygonoffset.gl
+++ /dev/null
@@ -1,87 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(PolygonOffset, set the scale and units used to calculate depth values)
-_names(PolygonOffset)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies a scale factor that is used to create a variable
-depth offset for each polygon. The initial value is 0.
-_phead(_param2)
-Is multiplied by an implementation-specific value to
-create a constant depth offset. The initial value is 0.
-.SH DESCRIPTION
-When _const(POLYGON_OFFSET_FILL), _const(POLYGON_OFFSET_LINE), or
-_const(POLYGON_OFFSET_POINT) is enabled, each
-fragment's \f2depth\fP value will be offset after it is interpolated
-from the \f2depth\fP values of the appropriate vertices.
-The value of the offset is $_eqnparam1 ~*~ DZ ~~+~~ r ~*~ _eqnparam2$,
-where $DZ~$ is a measurement of the change in depth relative to the screen
-area of the polygon, and $r$ is the smallest value that is guaranteed to
-produce a resolvable offset for a given implementation.
-The offset is added before the depth test is performed and before
-the value is written into the depth buffer.
-.P
-_cmnd is useful for rendering hidden-line images, for applying decals
-to surfaces, and for rendering solids with highlighted edges.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-_cmnd has no effect on depth coordinates placed in the
-feedback buffer.
-.P
-_cmnd has no effect on selection.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.bp
-.SH ASSOCIATED GETS
-_cmnd(IsEnabled) with argument
-_const(POLYGON_OFFSET_FILL),
-_const(POLYGON_OFFSET_LINE),
-or _const(POLYGON_OFFSET_POINT).
-.P
-_cmnd(Get) with argument _const(POLYGON_OFFSET_FACTOR) or
-_const(POLYGON_OFFSET_UNITS).
-.SH SEE ALSO
-_cmnd(DepthFunc),
-_cmnd(Enable),
-_cmnd(Get),
-_cmnd(IsEnabled)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/polygonstipple.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/polygonstipple.gl
deleted file mode 100755
index d63cd4b53..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/polygonstipple.gl
+++ /dev/null
@@ -1,97 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(PolygonStipple,set the polygon stippling pattern)
-_names(PolygonStipple)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies a pointer to a $32 ~times~ 32$ stipple pattern that will be unpacked
-from memory in the same way that _cmnd(DrawPixels) unpacks pixels.
-.SH DESCRIPTION
-Polygon stippling,
-like line stippling
-(see _cmnd(LineStipple)),
-masks out certain fragments produced by rasterization,
-creating a pattern.
-Stippling is independent of polygon antialiasing.
-.P
-_param1 is a pointer to a $32 ~times~ 32$ stipple pattern that is stored
-in memory just like the pixel data supplied to a _cmnd(DrawPixels)
-call with
-.I
-height
-and
-.I width
-both equal to 32, a pixel format
-of _const(COLOR_INDEX), and data type
-of _const(BITMAP).
-That is,
-the stipple pattern is represented as a $32 ~times~ 32$ array
-of 1-bit color indices packed in unsigned bytes.
-_cmnd(PixelStore) parameters like _const(UNPACK_SWAP_BYTES)
-and _const(UNPACK_LSB_FIRST) affect the assembling of the bits into a
-stipple pattern.
-Pixel transfer operations
-(shift, offset, pixel map)
-are not applied to the stipple image,
-however.
-.P
-To enable and disable polygon stippling, call
-_cmnd(Enable) and _cmnd(Disable)
-with argument _const(POLYGON_STIPPLE). Polygon stippling is initially
-disabled. If it's enabled,
-a rasterized polygon fragment with window coordinates $x sub w$ and $y sub w$
-is sent to the next stage of the GL if and only if the
-($x sub w~roman mod~32$)th bit in the ($y sub w~roman mod~32$)th row
-of the stipple pattern is 1 (one).
-When polygon stippling is disabled, it is as if the stipple pattern
-consists of all 1's.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetPolygonStipple)
-.br
-_cmnd(IsEnabled) with argument _const(POLYGON_STIPPLE)
-.SH SEE ALSO
-_cmnd(DrawPixels),
-_cmnd(LineStipple),
-_cmnd(PixelStore),
-_cmnd(PixelTransfer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/prioritizetextures.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/prioritizetextures.gl
deleted file mode 100755
index bdbde4d8f..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/prioritizetextures.gl
+++ /dev/null
@@ -1,98 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(PrioritizeTextures, set texture residence priority)
-_names(PrioritizeTextures)
-.SH PARAMETERS
-_define(@<__n>@,@<_param1>@)_C_
-_define(@<__textures>@,@<_param2>@)_C_
-_define(@<__priorities>@,@<_param3>@)_C_
-_phead(__n)
-Specifies the number of textures to be prioritized.
-_phead(__textures)
-Specifies an array containing the names of the textures to be prioritized.
-_phead(__priorities)
-Specifies an array containing the texture priorities.
-A priority given in an element of __priorities applies to the texture
-named by the corresponding element of __textures.
-.SH DESCRIPTION
-_cmnd assigns the __n texture priorities given in __priorities to the
-__n textures named in __textures.
-.P
-The GL establishes
-a ``working set'' of textures that are resident in texture memory.
-These textures may be bound to a texture target much more efficiently
-than textures that are not resident.
-By specifying a priority for each texture,
-_cmnd allows applications to guide the GL implementation in determining
-which textures should be resident.
-.P
-The priorities given in __priorities are clamped to the range [0,\1]
-before they are assigned.
-0 indicates the lowest priority; textures with priority 0
-are least likely to be resident.
-1 indicates the highest priority; textures with priority 1
-are most likely to be resident.
-However, textures are not guaranteed to be resident until they are used.
-.P
-_cmnd silently ignores attempts to prioritize texture 0, or any texture
-name that does not correspond to an existing texture.
-.P
-_cmnd does not require that any of the textures named by __textures
-be bound to a texture target.
-_cmnd(TexParameter) may also be used to set a texture's priority,
-but only if the texture is currently bound.
-This is the only way to set the priority of a default texture.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.SH ERRORS
-_const(INVALID_VALUE) is generated if __n is negative.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetTexParameter) with parameter name _const(TEXTURE_PRIORITY)
-retrieves the priority of a currently bound texture.
-.SH SEE ALSO
-_cmnd(AreTexturesResident),
-_cmnd(BindTexture),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexParameter)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/pushattrib.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/pushattrib.gl
deleted file mode 100755
index a1b1001b9..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/pushattrib.gl
+++ /dev/null
@@ -1,279 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn|tbl)_C_
-_header(PushAttrib,push and pop the server attribute stack)
-_names(PushAttrib)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a mask that indicates which attributes to save. Values for
-_param1 are listed below.
-_names(PopAttrib)
-.SH DESCRIPTION
-_cmnd takes one argument,
-a mask that indicates which groups of state variables
-to save on the attribute stack.
-Symbolic constants are used to set bits in the mask.
-_param1(1)
-is typically constructed by ORing several of these constants together.
-The special mask
-_const(ALL_ATTRIB_BITS)
-can be used to save all stackable states.
-.P
-The symbolic mask constants and their associated GL state are as follows
-(the second column lists which attributes are saved):
-.P
-.TS
-;
-l l .
-_const(ACCUM_BUFFER_BIT) Accumulation buffer clear value
-
-_const(COLOR_BUFFER_BIT) _const(ALPHA_TEST) enable bit
- Alpha test function and reference value
- _const(BLEND) enable bit
- Blending source and destination functions
- Constant blend color
- Blending equation
- _const(DITHER) enable bit
- _const(DRAW_BUFFER) setting
- _const(COLOR_LOGIC_OP) enable bit
- _const(INDEX_LOGIC_OP) enable bit
- Logic op function
- Color mode and index mode clear values
- Color mode and index mode writemasks
-
-_const(CURRENT_BIT) Current RGBA color
- Current color index
- Current normal vector
- Current texture coordinates
- Current raster position
- _const(CURRENT_RASTER_POSITION_VALID) flag
- RGBA color associated with current raster position
- Color index associated with current raster position
- Texture coordinates associated with current raster position
- _const(EDGE_FLAG) flag
-
-_const(DEPTH_BUFFER_BIT) _const(DEPTH_TEST) enable bit
- Depth buffer test function
- Depth buffer clear value
- _const(DEPTH_WRITEMASK) enable bit
-
-_const(ENABLE_BIT) _const(ALPHA_TEST) flag
- _const(AUTO_NORMAL) flag
- _const(BLEND) flag
- Enable bits for the user-definable clipping planes
- _const(COLOR_MATERIAL)
- _const(CULL_FACE) flag
- _const(DEPTH_TEST) flag
- _const(DITHER) flag
- _const(FOG) flag
- _const(LIGHT)\f2i\fP where 0\ <= \f2i\fP<_const(MAX_LIGHTS)
- _const(LIGHTING) flag
- _const(LINE_SMOOTH) flag
- _const(LINE_STIPPLE) flag
- _const(COLOR_LOGIC_OP) flag
- _const(INDEX_LOGIC_OP) flag
- _const(MAP1_)\f2x\fP where \f2x\fP is a map type
- _const(MAP2_)\f2x\fP where \f2x\fP is a map type
- _const(NORMALIZE) flag
- _const(POINT_SMOOTH) flag
- _const(POLYGON_OFFSET_LINE) flag
- _const(POLYGON_OFFSET_FILL) flag
- _const(POLYGON_OFFSET_POINT) flag
- _const(POLYGON_SMOOTH) flag
- _const(POLYGON_STIPPLE) flag
- _const(SCISSOR_TEST) flag
- _const(STENCIL_TEST) flag
- _const(TEXTURE_1D) flag
- _const(TEXTURE_2D) flag
- _const(TEXTURE_3D) flag
- Flags _const(TEXTURE_GEN_)\f2x\fP where \f2x\fP is S, T, R, or Q
-
-_const(EVAL_BIT) _const(MAP1_)\f2x\fP enable bits, where \f2x\fP is a map type
- _const(MAP2_)\f2x\fP enable bits, where \f2x\fP is a map type
- 1D grid endpoints and divisions
- 2D grid endpoints and divisions
- _const(AUTO_NORMAL) enable bit
-
-_const(FOG_BIT) _const(FOG) enable bit
- Fog color
- Fog density
- Linear fog start
- Linear fog end
- Fog index
- _const(FOG_MODE) value
-
-_const(HINT_BIT) _const(PERSPECTIVE_CORRECTION_HINT) setting
- _const(POINT_SMOOTH_HINT) setting
- _const(LINE_SMOOTH_HINT) setting
- _const(POLYGON_SMOOTH_HINT) setting
- _const(FOG_HINT) setting
-
-_const(LIGHTING_BIT) _const(COLOR_MATERIAL) enable bit
- _const(COLOR_MATERIAL_FACE) value
- Color material parameters that are tracking the current color
- Ambient scene color
- _const(LIGHT_MODEL_LOCAL_VIEWER) value
- _const(LIGHT_MODEL_TWO_SIDE) setting
- _const(LIGHTING) enable bit
- Enable bit for each light
- Ambient, diffuse, and specular intensity for each light
- Direction, position, exponent, and cutoff angle for each light
- Constant, linear, and quadratic attenuation factors for each light
- Ambient, diffuse, specular, and emissive color for each material
- Ambient, diffuse, and specular color indices for each material
- Specular exponent for each material
- _const(SHADE_MODEL) setting
-
-_const(LINE_BIT) _const(LINE_SMOOTH) flag
- _const(LINE_STIPPLE) enable bit
- Line stipple pattern and repeat counter
- Line width
-
-_const(LIST_BIT) _const(LIST_BASE) setting
-
-_const(PIXEL_MODE_BIT) _const(RED_BIAS) and _const(RED_SCALE) settings
- _const(GREEN_BIAS) and _const(GREEN_SCALE) values
- _const(BLUE_BIAS) and _const(BLUE_SCALE)
- _const(ALPHA_BIAS) and _const(ALPHA_SCALE)
- _const(DEPTH_BIAS) and _const(DEPTH_SCALE)
- _const(INDEX_OFFSET) and _const(INDEX_SHIFT) values
- _const(MAP_COLOR) and _const(MAP_STENCIL) flags
- _const(ZOOM_X) and _const(ZOOM_Y) factors
- _const(READ_BUFFER) setting
-
-_const(POINT_BIT) _const(POINT_SMOOTH) flag
- Point size
-
-_const(POLYGON_BIT) _const(CULL_FACE) enable bit
- _const(CULL_FACE_MODE) value
- _const(FRONT_FACE) indicator
- _const(POLYGON_MODE) setting
- _const(POLYGON_SMOOTH) flag
- _const(POLYGON_STIPPLE) enable bit
- _const(POLYGON_OFFSET_FILL) flag
- _const(POLYGON_OFFSET_LINE) flag
- _const(POLYGON_OFFSET_POINT) flag
- _const(POLYGON_OFFSET_FACTOR)
- _const(POLYGON_OFFSET_UNITS)
-
-_const(POLYGON_STIPPLE_BIT) Polygon stipple image
-
-_const(SCISSOR_BIT) _const(SCISSOR_TEST) flag
- Scissor box
-
-_const(STENCIL_BUFFER_BIT) _const(STENCIL_TEST) enable bit
- Stencil function and reference value
- Stencil value mask
- Stencil fail, pass, and depth buffer pass actions
- Stencil buffer clear value
- Stencil buffer writemask
-
-_const(TEXTURE_BIT) Enable bits for the four texture coordinates
- Border color for each texture image
- Minification function for each texture image
- Magnification function for each texture image
- Texture coordinates and wrap mode for each texture image
- Color and mode for each texture environment
- Enable bits _const(TEXTURE_GEN_)\f2x\fP, \f2x\fP is S, T, R, and Q
- _const(TEXTURE_GEN_MODE) setting for S, T, R, and Q
- _cmnd(TexGen) plane equations for S, T, R, and Q
- Current texture bindings (for example, _const(TEXTURE_BINDING_2D))
-
-_const(TRANSFORM_BIT) Coefficients of the six clipping planes
- Enable bits for the user-definable clipping planes
- _const(MATRIX_MODE) value
- _const(NORMALIZE) flag
- _const(RESCALE_NORMAL) flag
-
-_const(VIEWPORT_BIT) Depth range (near and far)
- Viewport origin and extent
-.TE
-.P
-_cmnd(PopAttrib) restores the values of the state variables saved with the last
-.br
-_cmnd(PushAttrib) command.
-Those not saved are left unchanged.
-.P
-It is an error to push attributes onto a full stack,
-or to pop attributes off an empty stack.
-In either case, the error flag is set
-and no other change is made to GL state.
-.P
-Initially, the attribute stack is empty.
-.SH NOTES
-Not all values for GL state can be saved on the attribute stack.
-For example,
-render mode state,
-and select and feedback state cannot be saved.
-Client state must be saved with
-_cmnd(PushClientAttrib).
-.P
-The depth of the attribute stack depends on the implementation,
-but it must be at least 16.
-.P
-When the _arbstring(multitexture) extension is supported, pushing and
-popping texture state applies to all supported texture units.
-.SH ERRORS
-_const(STACK_OVERFLOW) is generated if _cmnd(PushAttrib) is called while
-the attribute stack is full.
-.P
-_const(STACK_UNDERFLOW) is generated if _cmnd(PopAttrib) is called while
-the attribute stack is empty.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd(PushAttrib) or _cmnd(PopAttrib)
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(ATTRIB_STACK_DEPTH)
-.br
-_cmnd(Get) with argument _const(MAX_ATTRIB_STACK_DEPTH)
-.SH SEE ALSO
-_cmnd(Get),
-_cmnd(GetClipPlane),
-_cmnd(GetError),
-_cmnd(GetLight),
-_cmnd(GetMap),
-_cmnd(GetMaterial),
-.br
-_cmnd(GetPixelMap),
-_cmnd(GetPolygonStipple),
-_cmnd(GetString),
-_cmnd(GetTexEnv),
-_cmnd(GetTexGen),
-_cmnd(GetTexImage),
-_cmnd(GetTexLevelParameter),
-_cmnd(GetTexParameter),
-_cmnd(IsEnabled),
-_cmnd(PushClientAttrib)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/pushclientattrib.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/pushclientattrib.gl
deleted file mode 100755
index 16d5284f0..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/pushclientattrib.gl
+++ /dev/null
@@ -1,111 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn|tbl)_C_
-_header(PushClientAttrib,push and pop the client attribute stack)
-_names(PushClientAttrib)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a mask that indicates which attributes to save. Values for
-_param1 are listed below.
-_names(PopClientAttrib)
-.SH DESCRIPTION
-_cmnd takes one argument,
-a mask that indicates which groups of client-state variables
-to save on the client attribute stack.
-Symbolic constants are used to set bits in the mask.
-_param1(1)
-is typically constructed by OR'ing several of these constants together.
-The special mask
-_const(CLIENT_ALL_ATTRIB_BITS)
-can be used to save all stackable client state.
-.P
-The symbolic mask constants and their associated GL client state are as follows
-(the second column lists which attributes are saved):
-.P
-_const(CLIENT_PIXEL_STORE_BIT) Pixel storage modes
-.br
-_const(CLIENT_VERTEX_ARRAY_BIT) Vertex arrays (and enables)
-.P
-_cmnd(PopClientAttrib) restores the values of the client-state variables
-saved with the last _cmnd(PushClientAttrib).
-Those not saved are left unchanged.
-.P
-It is an error to push attributes onto a full client attribute stack,
-or to pop attributes off an empty stack.
-In either case, the error flag is set,
-and no other change is made to GL state.
-.P
-Initially, the client attribute stack is empty.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-Not all values for GL client state can be saved on the attribute stack.
-For example, select and feedback state cannot be saved.
-.P
-The depth of the attribute stack depends on the implementation,
-but it must be at least 16.
-.P
-Use _cmnd(PushAttrib) and _cmnd(PopAttrib) to push and restore
-state which is kept on the server. Only pixel storage modes and
-vertex array state may be pushed and popped with
-_cmnd(PushClientAttrib) and _cmnd(PopClientAttrib).
-.P
-When the _arbstring(multitexture) extension is supported, pushing and
-popping client vertex array state apples to all supported texture units,
-and the active client texture state.
-.SH ERRORS
-_const(STACK_OVERFLOW) is generated if _cmnd(PushClientAttrib) is called while
-the attribute stack is full.
-.P
-_const(STACK_UNDERFLOW) is generated if _cmnd(PopClientAttrib) is called while
-the attribute stack is empty.
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(ATTRIB_STACK_DEPTH)
-.br
-_cmnd(Get) with argument _const(MAX_CLIENT_ATTRIB_STACK_DEPTH)
-.SH SEE ALSO
-_cmnd(ColorPointer),
-_cmnd(DisableClientState),
-_cmnd(EdgeFlagPointer),
-_cmnd(EnableClientState),
-_cmnd(Get),
-_cmnd(GetError),
-_cmnd(IndexPointer),
-_cmnd(NormalPointer),
-_cmnd(NewList),
-_cmnd(PixelStore),
-_cmnd(PushAttrib),
-_cmnd(TexCoordPointer),
-_cmnd(VertexPointer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/pushmatrix.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/pushmatrix.gl
deleted file mode 100755
index 5052213a8..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/pushmatrix.gl
+++ /dev/null
@@ -1,107 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_header(PushMatrix,push and pop the current matrix stack)
-_names(PushMatrix)
-_names(PopMatrix)
-.SH DESCRIPTION
-There is a stack of matrices for each of the matrix modes.
-In _const(MODELVIEW) mode,
-the stack depth is at least 32.
-In the other modes,
-_const(COLOR), const(PROJECTION), and _const(TEXTURE),
-the depth is at least 2.
-The current matrix in any mode is the matrix on the top of the stack
-for that mode.
-.P
-_cmnd pushes the current matrix stack down by one,
-duplicating the current matrix.
-That is,
-after a _cmnd call,
-the matrix on top of the stack is identical to the one below it.
-.P
-_cmnd(PopMatrix) pops the current matrix stack,
-replacing the current matrix with the one below it on the stack.
-.P
-Initially, each of the stacks contains one matrix, an identity matrix.
-.P
-It is an error to push a full matrix stack,
-or to pop a matrix stack that contains only a single matrix.
-In either case, the error flag is set
-and no other change is made to GL state.
-.SH ERRORS
-_const(STACK_OVERFLOW) is generated if _cmnd(PushMatrix) is called while
-the current matrix stack is full.
-.P
-_const(STACK_UNDERFLOW) is generated if _cmnd(PopMatrix) is called while
-the current matrix stack contains only a single matrix.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd(PushMatrix) or _cmnd(PopMatrix)
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(MATRIX_MODE)
-.br
-_cmnd(Get) with argument _const(COLOR_MATRIX)
-.br
-_cmnd(Get) with argument _const(MODELVIEW_MATRIX)
-.br
-_cmnd(Get) with argument _const(PROJECTION_MATRIX)
-.br
-_cmnd(Get) with argument _const(TEXTURE_MATRIX)
-.br
-_cmnd(Get) with argument _const(COLOR_STACK_DEPTH)
-.br
-_cmnd(Get) with argument _const(MODELVIEW_STACK_DEPTH)
-.br
-_cmnd(Get) with argument _const(PROJECTION_STACK_DEPTH)
-.br
-_cmnd(Get) with argument _const(TEXTURE_STACK_DEPTH)
-.br
-_cmnd(Get) with argument _const(MAX_MODELVIEW_STACK_DEPTH)
-.br
-_cmnd(Get) with argument _const(MAX_PROJECTION_STACK_DEPTH)
-.br
-_cmnd(Get) with argument _const(MAX_TEXTURE_STACK_DEPTH)
-.SH SEE ALSO
-_cmnd(Frustum),
-_cmnd(LoadIdentity),
-_cmnd(LoadMatrix),
-_cmnd(MatrixMode),
-_cmnd(MultMatrix),
-_cmnd(Ortho),
-_cmnd(Rotate),
-_cmnd(Scale),
-_cmnd(Translate),
-_cmnd(Viewport)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/pushname.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/pushname.gl
deleted file mode 100755
index e78fbf51d..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/pushname.gl
+++ /dev/null
@@ -1,81 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_header(PushName,push and pop the name stack)
-_names(PushName)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a name that will be pushed onto the name stack.
-_names(PopName)
-.SH DESCRIPTION
-The name stack is used during selection mode to allow sets of rendering
-commands to be uniquely identified.
-It consists of an ordered set of unsigned integers and is initially empty.
-.P
-_cmnd causes _param1(1) to be pushed onto the name stack.
-_cmnd(PopName) pops one name off the top of the stack.
-.P
-The maximum name stack depth is implementation-dependent; call
-_const(MAX_NAME_STACK_DEPTH) to find out the value for a particular
-implementation. It is an
-error to push a name onto a full stack,
-or to pop a name off an empty stack.
-It is also an error to manipulate the name stack between the execution of
-_cmnd(Begin) and the corresponding execution of _cmnd(End).
-In any of these cases, the error flag is set and no other change is
-made to GL state.
-.P
-The name stack is always empty while the render mode is not _const(SELECT).
-Calls to _cmnd(PushName) or _cmnd(PopName) while the render mode is not
-_const(SELECT) are ignored.
-.SH ERRORS
-_const(STACK_OVERFLOW) is generated if _cmnd(PushName) is called while the
-name stack is full.
-.P
-_const(STACK_UNDERFLOW) is generated if _cmnd(PopName) is called while the
-name stack is empty.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd(PushName) or _cmnd(PopName)
-is executed between a call to _cmnd(Begin) and the corresponding call to
-_cmnd(End).
-.bp
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(NAME_STACK_DEPTH)
-.br
-_cmnd(Get) with argument _const(MAX_NAME_STACK_DEPTH)
-.SH SEE ALSO
-_cmnd(InitNames),
-_cmnd(LoadName),
-_cmnd(RenderMode),
-_cmnd(SelectBuffer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/rasterpos.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/rasterpos.gl
deleted file mode 100755
index b24bf8b44..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/rasterpos.gl
+++ /dev/null
@@ -1,173 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(RasterPos,specify the raster position for pixel operations)
-_names(RasterPos,[2-4][sifd])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1 _param2 _param3 _param4)
-Specify the $x$, $y$, $z$, and $w$ object coordinates
-(if present)
-for the raster position.
-_names(RasterPos,[2-4][sifd]v)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a pointer to an array of two,
-three,
-or four elements,
-specifying $x$, $y$, $z$, and $w$ coordinates, respectively.
-.SH DESCRIPTION
-The GL maintains a 3D position in window coordinates.
-This position,
-called the raster position,
-is used to position pixel and bitmap write operations. It is
-maintained with subpixel accuracy.
-See _cmnd(Bitmap), _cmnd(DrawPixels), and _cmnd(CopyPixels).
-.P
-The current raster position consists of three window coordinates
-($x$, $y$, $z$),
-a clip coordinate value ($w$),
-an eye coordinate distance,
-a valid bit,
-and associated color data and texture coordinates.
-The $w$ coordinate is a clip coordinate,
-because $w$ is not projected to window coordinates.
-_cmnd(RasterPos4) specifies object coordinates $x$, $y$, $z$, and $w$
-explicitly.
-_cmnd(RasterPos3) specifies object coordinate $x$, $y$, and $z$ explicitly,
-while $w$ is implicitly set to 1.
-_cmnd(RasterPos2) uses the argument values for $x$ and $y$ while
-implicitly setting $z$ and $w$ to 0 and 1.
-.P
-The object coordinates presented by _cmnd are treated just like those
-of a _cmnd(Vertex) command:
-They are transformed by the current modelview and projection matrices
-and passed to the clipping stage.
-If the vertex is not culled,
-then it is projected and scaled to window coordinates,
-which become the new current raster position,
-and the _const(CURRENT_RASTER_POSITION_VALID) flag is set.
-If the vertex
-.I is
-culled,
-then the valid bit is cleared and the current raster position
-and associated color and texture coordinates are undefined.
-.P
-The current raster position also includes some associated color data
-and texture coordinates.
-If lighting is enabled,
-then _const(CURRENT_RASTER_COLOR)
-(in RGBA mode)
-or _const(CURRENT_RASTER_INDEX)
-(in color index mode)
-is set to the color produced by the lighting calculation
-(see _cmnd(Light), _cmnd(LightModel), and
-.br
-_cmnd(ShadeModel)).
-If lighting is disabled,
-current color
-(in RGBA mode, state variable _const(CURRENT_COLOR))
-or color index
-(in color index mode, state variable _const(CURRENT_INDEX))
-is used to update the current raster color.
-.P
-Likewise,
-_const(CURRENT_RASTER_TEXTURE_COORDS) is updated as a function
-of _const(CURRENT_TEXTURE_COORDS),
-based on the texture matrix and the texture generation functions
-(see _cmnd(TexGen)).
-Finally,
-the distance from the origin of the eye coordinate system to the
-vertex as transformed by only the modelview matrix replaces
-_const(CURRENT_RASTER_DISTANCE).
-.P
-Initially, the current raster position is (0, 0, 0, 1),
-the current raster distance is 0,
-the valid bit is set,
-the associated RGBA color is (1, 1, 1, 1),
-the associated color index is 1,
-and the associated texture coordinates are (0, 0, 0, 1).
-In RGBA mode,
-_const(CURRENT_RASTER_INDEX) is always 1;
-in color index mode,
-the current raster RGBA color always maintains its initial value.
-.SH NOTES
-The raster position is modified both by _cmnd and by _cmnd(Bitmap).
-.P
-When the raster position coordinates are invalid,
-drawing commands that are based on the raster position are
-ignored (that is, they do not result in changes to GL state).
-.P
-Calling _cmnd(DrawElements), or _cmnd(DrawRangeElements) may leave the
-current color or index indeterminate.
-If _cmnd is executed while the current color or index is indeterminate, the
-current raster color or current raster index remains indeterminate.
-.P
-To set a valid raster position outside the viewport, first set a valid
-raster position, then call _cmnd(Bitmap) with NULL as the \f2bitmap\fP
-parameter.
-.P
-When the _arbstring(imaging) extension is supported, there are distinct
-raster texture coordinates for each texture unit. Each texture unit's
-current ratster texture coordinates are updated by _cmnd.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(CURRENT_RASTER_POSITION)
-.br
-_cmnd(Get) with argument _const(CURRENT_RASTER_POSITION_VALID)
-.br
-_cmnd(Get) with argument _const(CURRENT_RASTER_DISTANCE)
-.br
-_cmnd(Get) with argument _const(CURRENT_RASTER_COLOR)
-.br
-_cmnd(Get) with argument _const(CURRENT_RASTER_INDEX)
-.br
-_cmnd(Get) with argument _const(CURRENT_RASTER_TEXTURE_COORDS)
-.SH SEE ALSO
-_cmnd(Bitmap),
-_cmnd(CopyPixels),
-_cmnd(DrawArrays),
-_cmnd(DrawElements),
-_cmnd(DrawRangeElements),
-_cmnd(DrawPixels),
-_cmnd(TexCoord),
-_cmnd(TexGen),
-_cmnd(Vertex)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/readbuffer.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/readbuffer.gl
deleted file mode 100755
index 4d65606fc..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/readbuffer.gl
+++ /dev/null
@@ -1,98 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(ReadBuffer,select a color buffer source for pixels)
-_names(ReadBuffer)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a color buffer.
-Accepted values are
-_const(FRONT_LEFT),
-_const(FRONT_RIGHT),
-_const(BACK_LEFT),
-_const(BACK_RIGHT),
-_const(FRONT),
-_const(BACK),
-_const(LEFT),
-_const(RIGHT), and
-_const(AUX)\f2i\fP,
-where \f2i\fP is between 0 and _const(AUX_BUFFERS) \-1.
-.SH DESCRIPTION
-_cmnd specifies a color buffer as the source for subsequent
-_cmnd(ReadPixels), _cmnd(CopyTexImage1D), _cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D), _cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D), and
-_cmnd(CopyPixels) commands.
-_param1 accepts one of twelve or more predefined values.
-(_const(AUX0) through _const(AUX3) are always defined.)
-In a fully configured system,
-_const(FRONT),
-_const(LEFT), and
-_const(FRONT_LEFT) all name the front left buffer,
-_const(FRONT_RIGHT) and
-_const(RIGHT) name the front right buffer, and
-_const(BACK_LEFT) and
-_const(BACK) name the back left buffer.
-.P
-Nonstereo double-buffered configurations have only a front left and a
-back left buffer.
-Single-buffered configurations have a front left and a front right
-buffer if stereo, and only a front left buffer if nonstereo.
-It is an error to specify a nonexistent buffer to _cmnd.
-.P
-_param1 is initially _const(FRONT) in single-buffered configurations,
-and _const(BACK) in double-buffered configurations.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not one of the twelve
-(or more) accepted values.
-.P
-_const(INVALID_OPERATION) is generated if _param1 specifies a buffer
-that does not exist.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(READ_BUFFER)
-.SH SEE ALSO
-_cmnd(CopyPixels),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(DrawBuffer),
-_cmnd(ReadPixels)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/readpixels.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/readpixels.gl
deleted file mode 100755
index ed699ffa1..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/readpixels.gl
+++ /dev/null
@@ -1,357 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(ReadPixels,read a block of pixels from the frame buffer)
-_names(ReadPixels)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1 _param2)
-Specify the window coordinates of the first pixel
-that is read from the frame buffer.
-This location is the lower left corner of a rectangular block of pixels.
-_phead(_param3 _param4)
-Specify the dimensions of the pixel rectangle.
-_param3 and _param4 of one correspond to a single pixel.
-_phead(_param5)
-Specifies the format of the pixel data.
-The following symbolic values are accepted:
-_const(COLOR_INDEX),
-_const(STENCIL_INDEX),
-_const(DEPTH_COMPONENT),
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(BGR),
-_const(RGBA),
-_const(BGRA),
-_C_ _const(ABGR_EXT),
-_const(LUMINANCE), and
-_const(LUMINANCE_ALPHA).
-_phead(_param6)
-Specifies the data type of the pixel data.
-Must be one of
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV).
-_phead(_param7)
-Returns the pixel data.
-.SH DESCRIPTION
-_cmnd returns pixel data from the frame buffer,
-starting with the pixel whose lower left corner
-is at location (_param1, _param2),
-into client memory starting at location _param7.
-Several parameters control the processing of the pixel data before
-it is placed into client memory.
-These parameters are set with three commands:
-_cmnd(PixelStore),
-_cmnd(PixelTransfer), and
-_cmnd(PixelMap).
-This reference page describes the effects on _cmnd of most,
-but not all of the parameters specified by these three commands.
-.P
-When the _arbstring(imaging) extension is supported, the pixel data may
-be processed by additional operations including color table lookup,
-color matrix tranformations, convolutions, histograms and minimum and
-maximun pixel value computations.
-.P
-_cmnd returns values from each pixel with lower left corner at
-(_param1 + $i$, _param2 + $j$) for 0 \(<= $i$ < _param3 and
-0 \(<= $j$ < _param4.
-This pixel is said to be the $i$th pixel in the $j$th row.
-Pixels are returned in row order from the lowest to the highest row,
-left to right in each row.
-.P
-_param5 specifies the format for the returned pixel values;
-accepted values are:
-.TP 10
-_const(COLOR_INDEX)
-Color indices are read from the color buffer
-selected by _cmnd(ReadBuffer).
-Each index is converted to fixed point,
-shifted left or right depending on the value and sign of _const(INDEX_SHIFT),
-and added to _const(INDEX_OFFSET).
-If _const(MAP_COLOR) is _const(TRUE),
-indices are replaced by their mappings in the table _const(PIXEL_MAP_I_TO_I).
-.TP
-_const(STENCIL_INDEX)
-Stencil values are read from the stencil buffer.
-Each index is converted to fixed point,
-shifted left or right depending on the value and sign of _const(INDEX_SHIFT),
-and added to _const(INDEX_OFFSET).
-If _const(MAP_STENCIL) is _const(TRUE),
-indices are replaced by their mappings in the table _const(PIXEL_MAP_S_TO_S).
-.TP
-_const(DEPTH_COMPONENT)
-Depth values are read from the depth buffer.
-Each component is converted to floating point such that the minimum depth
-value maps to 0 and the maximum value maps to 1.
-Each component is then multiplied by _const(DEPTH_SCALE),
-added to _const(DEPTH_BIAS),
-and finally clamped to the range [0,1].
-.TP
-_const(RED)
-.TP
-_const(GREEN)
-.TP
-_const(BLUE)
-.TP
-_const(ALPHA)
-.TP
-_const(RGB)
-.TP
-_const(BGR)
-.TP
-_const(RGBA)
-.TP
-_const(BGRA)
-.TP
-_C_ _const(ABGR_EXT)
-_const(LUMINANCE)
-.TP
-_const(LUMINANCE_ALPHA)
-Processing differs depending on whether color buffers store color indices
-or RGBA color components.
-If color indices are stored,
-they are read from the color buffer selected by _cmnd(ReadBuffer).
-Each index is converted to fixed point,
-shifted left or right depending on the value and sign of _const(INDEX_SHIFT),
-and added to _const(INDEX_OFFSET).
-Indices are then replaced by the red,
-green,
-blue,
-and alpha values obtained by indexing the tables
-_const(PIXEL_MAP_I_TO_R),
-_const(PIXEL_MAP_I_TO_G),
-_const(PIXEL_MAP_I_TO_B), and
-_const(PIXEL_MAP_I_TO_A).
-Each table must be of size $2 sup n$, but $n$ may be different for
-different tables.
-Before an index is used to look up a value in a table of
-size $2 sup n$, it must be masked against $2 sup n - 1$.
-.IP
-If RGBA color components are stored in the color buffers,
-they are read from the color buffer selected by _cmnd(ReadBuffer).
-Each color component is converted to floating point such that zero intensity
-maps to 0.0 and full intensity maps to 1.0.
-Each component is then multiplied by _const(c_SCALE) and
-added to _const(c_BIAS),
-where \f2c\fP is RED, GREEN, BLUE, or ALPHA.
-Finally,
-if _const(MAP_COLOR) is _const(TRUE),
-each component is clamped to the range [0,\ 1],
-scaled to the size of its corresponding table, and is then
-replaced by its mapping in the table
-_const(PIXEL_MAP_c_TO_c),
-where \f2c\fP is R, G, B, or A.
-.IP
-Unneeded data is then discarded.
-For example,
-_const(RED) discards the green, blue, and alpha components,
-while _const(RGB) discards only the alpha component.
-_const(LUMINANCE) computes a single-component value as the sum of
-the red,
-green,
-and blue components,
-and _const(LUMINANCE_ALPHA) does the same,
-while keeping alpha as a second value.
-The final values are clamped to the range [0,\ 1].
-.P
-The shift,
-scale,
-bias,
-and lookup factors just described are all specified by
-.br
-_cmnd(PixelTransfer).
-The lookup table contents themselves are specified by _cmnd(PixelMap).
-.P
-Finally, the indices or components
-are converted to the proper format,
-as specified by _param6.
-If _param5 is _const(COLOR_INDEX) or _const(STENCIL_INDEX)
-and _param6 is not _const(FLOAT),
-each index is masked with the mask value given in the following table.
-If _param6 is _const(FLOAT), then each integer index is converted to
-single-precision floating-point format.
-.P
-If _param5 is
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(BGR),
-_const(RGBA),
-_const(BGRA),
-_C_ _const(ABGR_EXT),
-_const(LUMINANCE), or
-_const(LUMINANCE_ALPHA) and _param6 is not _const(FLOAT),
-each component is multiplied by the multiplier shown in the following table.
-If type is _const(FLOAT), then each component is passed as is
-(or converted to the client's single-precision floating-point format if
-it is different from the one used by the GL).
-.P
-.TS
-center tab(:);
-l cb cb
-l c c.
-_
-_param6:index mask:component conversion
-_
-.sp .5
-_const(UNSIGNED_BYTE):$2"^"8 - 1$:$(2"^"8 - 1) c$
-_const(BYTE):$2"^"7 - 1$:$[(2"^"8 - 1) c - 1] / 2$
-_const(BITMAP):$1$:$1$
-_const(UNSIGNED_SHORT):$2"^"16 - 1$:$(2"^"16 - 1) c$
-_const(SHORT):$2"^"15 - 1$:$[(2"^"16 - 1) c - 1] / 2$
-_const(UNSIGNED_INT):$2"^"32 - 1$:$(2"^"32 - 1) c$
-_const(INT):$2"^"31 - 1$:$[(2"^"32 - 1) c - 1] / 2$
-_const(FLOAT):none:$c$
-_
-.TE
-.P
-Return values are placed in memory as follows.
-If _param5 is
-_const(COLOR_INDEX),
-_const(STENCIL_INDEX),
-_const(DEPTH_COMPONENT),
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA), or
-_const(LUMINANCE),
-a single value is returned and the data for the $i$th pixel in the $j$th row
-is placed in location $(j)~_eqnparam3~+~i$.
-_const(RGB) and _const(BGR) return three values,
-_const(RGBA) and _const(BGRA) return four values,
-_C_ and _const(ABGR_EXT) return four values,
-and _const(LUMINANCE_ALPHA) returns two values for each pixel,
-with all values corresponding to a single pixel occupying contiguous space
-in _param7.
-Storage parameters set by _cmnd(PixelStore),
-such as _const(PACK_LSB_FIRST) and _const(PACK_SWAP_BYTES),
-affect the way that data is written into memory.
-See _cmnd(PixelStore) for a description.
-.SH NOTES
-Values for pixels that lie outside the window
-connected to the current GL context are undefined.
-.P
-If an error is generated,
-no change is made to the contents of _param7.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param5 or _param6 is not an
-accepted value.
-.P
-_const(INVALID_ENUM) is generated if _param6 is _const(BITMAP) and _param5 is
-not _const(COLOR_INDEX) or _const(STENCIL_INDEX).
-.P
-_const(INVALID_VALUE) is generated if either _param3 or _param4 is negative.
-.P
-_const(INVALID_OPERATION) is generated if _param5 is _const(COLOR_INDEX)
-and the color buffers store RGBA color components.
-.P
-_const(INVALID_OPERATION) is generated if _param5 is _const(STENCIL_INDEX)
-and there is no stencil buffer.
-.P
-_const(INVALID_OPERATION) is generated if _param5 is _const(DEPTH_COMPONENT)
-and there is no depth buffer.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.P
-_const(INVALID_OPERATION) is generated if _param6 is one of
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5), or
-_const(UNSIGNED_SHORT_5_6_5_REV)
-and _param5 is not _const(RGB).
-.P
-_const(INVALID_OPERATION) is generated if _param6 is one of
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV)
-and _param5 is neither _const(RGBA) nor _const(BGRA).
-.P
-The formats _const(BGR), and _const(BGRA) and types
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV) are available only if the GL version
-is 1.2 or greater.
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(INDEX_MODE)
-.SH SEE ALSO
-_cmnd(CopyPixels),
-_cmnd(DrawPixels),
-_cmnd(PixelMap),
-_cmnd(PixelStore),
-_cmnd(PixelTransfer),
-.br
-_cmnd(ReadBuffer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/rect.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/rect.gl
deleted file mode 100755
index 1b312a3b0..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/rect.gl
+++ /dev/null
@@ -1,77 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_header(Rect,draw a rectangle)
-_names(Rect,[dfis])
-.SH PARAMETERS
-_phead(_param1 _param2)
-Specify one vertex of a rectangle.
-_phead(_param3 _param4)
-Specify the opposite vertex of the rectangle.
-_names(Rect,[dfis]v)
-.BP
-.SH PARAMETERS
-_phead(_param1)
-Specifies a pointer to one vertex of a rectangle.
-_phead(_param2)
-Specifies a pointer to the opposite vertex of the rectangle.
-.SH DESCRIPTION
-_cmnd supports efficient specification of rectangles as two corner points.
-Each
-rectangle command takes four arguments,
-organized either as two consecutive pairs of (\f2x\fP,\f2y\fP) coordinates,
-or as two pointers to arrays,
-each containing an (\f2x\fP,\f2y\fP) pair.
-The resulting rectangle is defined in the \f2z\fP = 0 plane.
-.P
-_cmnd(Rect)(_param1(1), _param2(1), _param3(1), _param4(1))
-is exactly equivalent to the following sequence:
-.Ex 6
-glBegin(_const(POLYGON));
-glVertex2(_param1(1), _param2(1));
-glVertex2(_param3(1), _param2(1));
-glVertex2(_param3(1), _param4(1));
-glVertex2(_param1(1), _param4(1));
-glEnd();
-.Ee
-Note that if the second vertex is above and to the right of the first vertex,
-the rectangle is constructed with a counterclockwise winding.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(Begin),
-_cmnd(Vertex)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/rendermode.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/rendermode.gl
deleted file mode 100755
index 52b8b6b37..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/rendermode.gl
+++ /dev/null
@@ -1,124 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(RenderMode,set rasterization mode)
-_names(RenderMode)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the rasterization mode.
-Three values are accepted:
-_const(RENDER),
-_const(SELECT), and
-_const(FEEDBACK).
-The initial value is _const(RENDER).
-.SH DESCRIPTION
-_cmnd sets the rasterization mode.
-It takes one argument,
-_param1,
-which can assume one of three predefined values:
-.TP 16
-_const(RENDER)
-Render mode. Primitives are rasterized,
-producing pixel fragments,
-which are written into the frame buffer.
-This is the normal mode
-and also the default mode.
-.TP
-_const(SELECT)
-Selection mode.
-No pixel fragments are produced,
-and no change to the frame buffer contents is made.
-Instead,
-a record of the names of primitives that would have been drawn
-if the render mode had been _const(RENDER) is returned in a select buffer,
-which must be created (see _cmnd(SelectBuffer)) before selection mode
-is entered.
-.TP
-_const(FEEDBACK)
-Feedback mode.
-No pixel fragments are produced,
-and no change to the frame buffer contents is made.
-Instead,
-the coordinates and attributes of vertices that would have been drawn
-if the render mode had been _const(RENDER) is returned in a feedback buffer,
-which must be created (see _cmnd(FeedbackBuffer)) before feedback mode
-is entered.
-.P
-The return value of _cmnd is determined by the render mode at the time
-_cmnd is called,
-rather than by _param1.
-The values returned for the three render modes are as follows:
-.TP 16
-_const(RENDER)
-0.
-.TP
-_const(SELECT)
-The number of hit records transferred to the select buffer.
-.TP
-_const(FEEDBACK)
-The number of values (not vertices) transferred to the feedback buffer.
-.P
-See the _cmnd(SelectBuffer) and _cmnd(FeedbackBuffer) reference pages for
-more details concerning selection and feedback operation.
-.SH NOTES
-If an error is generated,
-_cmnd returns 0 regardless of the current render mode.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not one of the three
-accepted values.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd(SelectBuffer) is called
-while the render mode is _const(SELECT),
-or if _cmnd is called with argument _const(SELECT) before
-_cmnd(SelectBuffer) is called at least once.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd(FeedbackBuffer) is called
-while the render mode is _const(FEEDBACK),
-or if _cmnd is called with argument _const(FEEDBACK) before
-_cmnd(FeedbackBuffer) is called at least once.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(RENDER_MODE)
-.SH SEE ALSO
-_cmnd(FeedbackBuffer),
-_cmnd(InitNames),
-_cmnd(LoadName),
-_cmnd(PassThrough),
-_cmnd(PushName),
-_cmnd(SelectBuffer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/resethistogram.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/resethistogram.gl
deleted file mode 100755
index 661c0adf9..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/resethistogram.gl
+++ /dev/null
@@ -1,55 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(ResetHistogram,reset histogram table entries to zero)
-_names(ResetHistogram)
-_define(@<__target>@,@<_param1>@)_C_
-.SH PARAMETERS
-_phead(__target)
-Must be
-_const(HISTOGRAM).
-.SH DESCRIPTION
-_cmnd resets all the elements of the current histogram table to zero.
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not _const(HISTOGRAM).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(Histogram)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/resetminmax.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/resetminmax.gl
deleted file mode 100755
index e53419378..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/resetminmax.gl
+++ /dev/null
@@ -1,58 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(ResetMinmax,reset minmax table entries to initial values)
-_names(ResetMinmax)
-_define(@<__target>@,@<_param1>@)_C_
-.SH PARAMETERS
-_phead(__target)
-Must be
-_const(MINMAX).
-.SH DESCRIPTION
-_cmnd resets the elements of the current minmax table to their
-initial values: the ``maximum'' element receives the minimum possible
-component values, and the ``minimum'' element receives the maximum
-possible component values.
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not _const(MINMAX).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.SH SEE ALSO
-_cmnd(Minmax)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/rotate.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/rotate.gl
deleted file mode 100755
index 5700a28e4..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/rotate.gl
+++ /dev/null
@@ -1,114 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Rotate,multiply the current matrix by a rotation matrix)
-_names(Rotate,[df])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the angle of rotation, in degrees.
-_phead(_param2 _param3 _param4)
-Specify the \f2x\fP, \f2y\fP, and \f2z\fP coordinates of a vector, respectively.
-.SH DESCRIPTION
-_cmnd produces a rotation of _param1 degrees around
-the vector $(_eqnparam2, _eqnparam3, _eqnparam4)$.
-The current matrix (see _cmnd(MatrixMode)) is multiplied by a rotation
-matrix with the product
-replacing the current matrix, as if _cmnd(MultMatrix) were called
-with the following matrix as its argument:
-.P
-.ce
-.EQ
-left ( ~ down 20 matrix {
- ccol {
- _eqnparam2 sup 2 (1 ^-^ c)~+~ c above
- _eqnparam3 _eqnparam2 (1 ^-^ c)~+~ _eqnparam4 s above
- _eqnparam2 _eqnparam4 (1 ^-^ c)~-~_eqnparam3 s above
- ~0
- }
- ccol {
- ~~ _eqnparam2 _eqnparam3 (1 ^-^ c)~-~_eqnparam4 s above
- ~~ _eqnparam3 sup 2 (1 ^-^ c)~+~ c above
- ~~ _eqnparam3 _eqnparam4 (1 ^-^ c)~+~ _eqnparam2 s above
- ~~ ~0
- }
- ccol {
- ~~ _eqnparam2 _eqnparam4 (1 ^-^ c)~+~ _eqnparam3 s above
- ~~ _eqnparam3 _eqnparam4 (1 ^-^ c)~-~ _eqnparam2 s above
- ~~ _eqnparam4 sup 2 (1 ^-^ c) ~+~ c above
- ~~ ~0
- }
- ccol { ~0 above ~0 above ~0 above ~1}
-} ~~ right )
-.EN
-.P
-.sp
-Where $c ~=~ cos (_eqnparam1)$, $s ~=~ sin (_eqnparam1)$, and
-$||(~_eqnparam2, _eqnparam3, _eqnparam4~)|| ~=~ 1$ (if not, the GL
-will normalize this vector).
-.sp
-.sp
-.P
-If the matrix mode is either _const(MODELVIEW) or _const(PROJECTION),
-all objects drawn after _cmnd is called are rotated.
-Use _cmnd(PushMatrix) and _cmnd(PopMatrix) to save and restore
-the unrotated coordinate system.
-.SH NOTES
-This rotation follows the right-hand rule, so
-if the vector $(_eqnparam2, _eqnparam3, _eqnparam4)$ points toward the
-user, the rotation will be counterclockwise.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(MATRIX_MODE)
-.br
-_cmnd(Get) with argument _const(COLOR_MATRIX)
-.br
-_cmnd(Get) with argument _const(MODELVIEW_MATRIX)
-.br
-_cmnd(Get) with argument _const(PROJECTION_MATRIX)
-.br
-_cmnd(Get) with argument _const(TEXTURE_MATRIX)
-.SH SEE ALSO
-_cmnd(MatrixMode),
-_cmnd(MultMatrix),
-_cmnd(PushMatrix),
-_cmnd(Scale),
-_cmnd(Translate)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/scale.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/scale.gl
deleted file mode 100755
index 392f7273b..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/scale.gl
+++ /dev/null
@@ -1,99 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Scale,multiply the current matrix by a general scaling matrix)
-_names(Scale,[df])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1 _param2 _param3)
-Specify scale factors along the \f2x\fP, \f2y\fP, and \f2z\fP axes, respectively.
-.SH DESCRIPTION
-_cmnd produces a nonuniform scaling along the \f2x\fP, \f2y\fP, and
-\f2z\fP axes.
-The three parameters indicate the desired scale factor along
-each of the three axes.
-.P
-The current matrix
-(see _cmnd(MatrixMode))
-is multiplied by this scale matrix,
-and the product replaces the current matrix
-as if _cmnd were called with the following matrix
-as its argument:
-
-.P
-.ce
-.EQ
-left ( ~ down 20 matrix {
- ccol { ~_eqnparam1 above ~0 above ~0 above ~0 }
- ccol { ~0 above ~_eqnparam2 above ~0 above ~0 }
- ccol { ~0 above ~0 above ~_eqnparam3 above ~0 }
- ccol { ~0 above ~0 above ~0 above ~1}
-} ~~ right )
-.EN
-.sp
-If the matrix mode is either _const(MODELVIEW) or _const(PROJECTION),
-all objects drawn after _cmnd is called are scaled.
-.P
-Use _cmnd(PushMatrix) and _cmnd(PopMatrix) to save and restore
-the unscaled coordinate system.
-.SH NOTES
-If scale factors other than 1 are applied to the modelview matrix
-and lighting is enabled, lighting often appears wrong.
-In that case, enable automatic normalization of normals by
-calling _cmnd(Enable) with the argument _const(NORMALIZE).
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of
-_cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(MATRIX_MODE)
-.br
-_cmnd(Get) with argument _const(COLOR_MATRIX)
-.br
-_cmnd(Get) with argument _const(MODELVIEW_MATRIX)
-.br
-_cmnd(Get) with argument _const(PROJECTION_MATRIX)
-.br
-_cmnd(Get) with argument _const(TEXTURE_MATRIX)
-.SH SEE ALSO
-_cmnd(MatrixMode),
-_cmnd(MultMatrix),
-_cmnd(PushMatrix),
-_cmnd(Rotate),
-_cmnd(Translate)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/scissor.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/scissor.gl
deleted file mode 100755
index 2665ff5ac..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/scissor.gl
+++ /dev/null
@@ -1,81 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Scissor, define the scissor box)
-_names(Scissor)
-.SH PARAMETERS
-_phead(_param1 _param2)
-Specify the lower left corner of the scissor box.
-Initially (0, 0).
-_phead(_param3 _param4)
-Specify the width and height of the scissor box.
-When a GL context is first attached to a window,
-_param3 and _param4 are set to the dimensions of that window.
-.SH DESCRIPTION
-_cmnd defines a rectangle, called the scissor box,
-in window coordinates.
-The first two arguments,
-_param1 and _param2,
-specify the lower left corner of the box.
-_param3 and _param4 specify the width and height of the box.
-.P
-To enable and disable the scissor test, call
-_cmnd(Enable) and _cmnd(Disable) with argument
-_const(SCISSOR_TEST). The test is initially disabled.
-While the test is enabled, only pixels that lie within the scissor box
-can be modified by drawing commands.
-Window coordinates have integer values at the shared corners of
-frame buffer pixels.
-\f7glScissor(0,0,1,1)\fP allows modification of only the lower left
-pixel in the window, and \f7glScissor(0,0,0,0)\fP doesn't allow
-modification of any pixels in the window.
-.P
-When the scissor test is disabled,
-it is as though the scissor box includes the entire window.
-.SH ERRORS
-_const(INVALID_VALUE) is generated if either _param3 or _param4 is negative.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.bp
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(SCISSOR_BOX)
-.br
-_cmnd(IsEnabled) with argument _const(SCISSOR_TEST)
-.SH SEE ALSO
-_cmnd(Enable),
-_cmnd(Viewport)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/selectbuffer.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/selectbuffer.gl
deleted file mode 100755
index c1772410c..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/selectbuffer.gl
+++ /dev/null
@@ -1,127 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(SelectBuffer,establish a buffer for selection mode values)
-_names(SelectBuffer)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the size of _param2.
-_phead(_param2)
-Returns the selection data.
-.SH DESCRIPTION
-_cmnd has two arguments:
-_param2 is a pointer to an array of unsigned integers,
-and _param1 indicates the size of the array.
-_param2 returns values from the name stack
-(see _cmnd(InitNames), _cmnd(LoadName), _cmnd(PushName))
-when the rendering mode is _const(SELECT) (see _cmnd(RenderMode)).
-_cmnd must be issued before selection mode is enabled,
-and it must not be issued while the rendering mode is _const(SELECT).
-.P
-A programmer can use selection to determine which primitives
-are drawn into some region of a window.
-The region is defined by the current modelview and perspective matrices.
-.P
-In selection mode, no pixel fragments are produced from rasterization.
-Instead,
-if a primitive or a raster position intersects the clipping
-volume defined by the viewing frustum
-and the user-defined clipping planes,
-this primitive causes a selection hit.
-(With polygons, no hit occurs if the polygon is culled.)
-When a change is made to the name stack,
-or when _cmnd(RenderMode) is called,
-a hit record is copied to _param2 if any hits have occurred since the
-last such event
-(name stack change or
-_cmnd(RenderMode) call).
-The hit record consists of the number of names in the name stack at the
-time of the event, followed by the minimum and maximum depth values
-of all vertices that hit since the previous event,
-followed by the name stack contents,
-bottom name first.
-.P
-Depth values (which are in the range [0,1]) are multiplied by 2^32 - 1,
-before being placed in the hit record.
-.P
-An internal index into _param2 is reset to 0 whenever selection mode
-is entered.
-Each time a hit record is copied into _param2,
-the index is incremented to point to the cell just past the end
-of the block of names \- that is, to the next available cell.
-If the hit record is larger than the number of remaining locations in _param2,
-as much data as can fit is copied,
-and the overflow flag is set.
-If the name stack is empty when a hit record is copied,
-that record consists of 0 followed by the minimum and maximum depth values.
-.P
-To exit selection mode, call _cmnd(RenderMode) with an argument
-other than _const(SELECT).
-Whenever _cmnd(RenderMode) is called while the render mode is _const(SELECT),
-it returns the number of hit records copied to _param2,
-resets the overflow flag and the selection buffer pointer,
-and initializes the name stack to be empty.
-If the overflow bit was set when _cmnd(RenderMode) was called,
-a negative hit record count is returned.
-.SH NOTES
-The contents of _param2 is undefined until _cmnd(RenderMode) is called
-with an argument other than _const(SELECT).
-.P
-_cmnd(Begin)/_cmnd(End) primitives and calls to _cmnd(RasterPos)
-can result in hits.
-.SH ERRORS
-_const(INVALID_VALUE) is generated if _param1 is negative.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is called while the
-render mode is _const(SELECT),
-or if _cmnd(RenderMode) is called with argument _const(SELECT) before
-_cmnd is called at least once.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(NAME_STACK_DEPTH)
-.br
-_cmnd(Get) with argument _const(SELECTION_BUFFER_SIZE)
-.br
-_cmnd(GetPointerv) with argument _const(SELECTION_BUFFER_POINTER)
-.SH SEE ALSO
-_cmnd(FeedbackBuffer),
-_cmnd(InitNames),
-_cmnd(LoadName),
-_cmnd(PushName),
-_cmnd(RenderMode)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/separablefilter2d.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/separablefilter2d.gl
deleted file mode 100755
index dae44bb89..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/separablefilter2d.gl
+++ /dev/null
@@ -1,254 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl)_C_
-_header(SeparableFilter2D,define a separable two-dimensional convolution filter)
-_names(SeparableFilter2D)
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__internalformat>@,@<_param2>@)_C_
-_define(@<__width>@,@<_param3>@)_C_
-_define(@<__height>@,@<_param4>@)_C_
-_define(@<__format>@,@<_param5>@)_C_
-_define(@<__type>@,@<_param6>@)_C_
-_define(@<__row>@,@<_param7>@)_C_
-_define(@<__column>@,@<_param8>@)_C_
-.SH PARAMETERS
-_phead(__target)
-Must be _const(SEPARABLE_2D).
-_phead(__internalformat)
-The internal format of the convolution filter kernel.
-The allowable values are
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(INTENSITY),
-_const(INTENSITY4),
-_const(INTENSITY8),
-_const(INTENSITY12),
-_const(INTENSITY16),
-_const(R3_G3_B2),
-_const(RGB),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12), or
-_const(RGBA16).
-_phead(__width)
-The number of elements in the pixel array referenced by __row.
-(This is the width of the separable filter kernel.)
-_phead(__height)
-The number of elements in the pixel array referenced by __column.
-(This is the height of the separable filter kernel.)
-_phead(__format)
-The format of the pixel data in __row and __column.
-The allowable values are
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(BGR),
-_const(RGBA),
-_const(BGRA),
-_const(INTENSITY),
-_const(LUMINANCE), and
-_const(LUMINANCE_ALPHA).
-_phead(__type)
-The type of the pixel data in __row and __column.
-Symbolic constants
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV)
-are accepted.
-_phead(__row)
-Pointer to a one-dimensional array of pixel data that is processed to
-build the row filter kernel.
-_phead(__column)
-Pointer to a one-dimensional array of pixel data that is processed to
-build the column filter kernel.
-.SH DESCRIPTION
-_cmnd builds a two-dimensional separable convolution filter kernel from
-two arrays of pixels.
-.sp
-The pixel arrays specified by (__width, __format, __type, __row)
-and (__height, __format, __type, __column) are processed just as if
-they had been passed to _cmnd(DrawPixels),
-but processing stops after the final expansion to RGBA is completed.
-.sp
-Next, the R, G, B, and A components of all pixels in both arrays are scaled
-by the four separable 2D _const(CONVOLUTION_FILTER_SCALE) parameters and
-biased by the four separable 2D _const(CONVOLUTION_FILTER_BIAS) parameters.
-(The scale and bias parameters are set by _cmnd(ConvolutionParameter)
-using the _const(SEPARABLE_2D) target and the names
-_const(CONVOLUTION_FILTER_SCALE) and _const(CONVOLUTION_FILTER_BIAS).
-The parameters themselves are vectors of four values that are applied to red,
-green, blue, and alpha, in that order.)
-The R, G, B, and A values are not clamped to [0,1] at any time during this
-process.
-.sp
-Each pixel is then converted to the internal format specified by
-__internalformat.
-This conversion simply maps the component values of the pixel (R, G, B,
-and A) to the values included in the internal format (red, green, blue,
-alpha, luminance, and intensity). The mapping is as follows:
-.bp
-.TS
-center;
-l c c c c c c.
-_
-Internal Format Red Green Blue Alpha Luminance Intensity
-_
-_const(LUMINANCE) R
-_const(LUMINANCE_ALPHA) A R
-_const(INTENSITY) R
-_const(RGB) R G B
-_const(RGBA) R G B A
-_
-.TE
-
-.sp
-The red, green, blue, alpha, luminance, and/or intensity components of
-the resulting pixels are stored in floating-point rather than integer
-format.
-They form two one-dimensional filter kernel images.
-The row image is indexed by coordinate \f2i\fP starting at zero and
-increasing from left to right.
-Each location in the row image is derived from element \f2i\fP of __row.
-The column image is indexed by coordinate \f2j\fP starting at zero
-and increasing from bottom to top.
-Each location in the column image is derived from element \f2j\fP of __column.
-.PP
-Note that after a convolution is performed, the resulting color
-components are also scaled by their corresponding
-_const(POST_CONVOLUTION_c_SCALE) parameters and biased by their
-corresponding _const(POST_CONVOLUTION_c_BIAS) parameters (where
-\f2c\fP takes on the values \f3RED\fP, \f3GREEN\fP, \f3BLUE\fP, and
-\f3ALPHA\fP).
-These parameters are set by _cmnd(PixelTransfer).
-.SH NOTES
-_cmnd is present only if _arbstring(imaging) is returned when _cmnd(GetString)
-is called with an argument of _const(EXTENSIONS).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not
-_const(SEPARABLE_2D).
-.P
-_const(INVALID_ENUM) is generated if __internalformat is not one of the
-allowable values.
-.P
-_const(INVALID_VALUE) is generated if __width is less than zero or greater
-than the maximum supported value.
-This value may be queried with _cmnd(GetConvolutionParameter)
-using target _const(SEPARABLE_2D) and name
-_const(MAX_CONVOLUTION_WIDTH).
-.P
-_const(INVALID_VALUE) is generated if __height is less than zero or greater
-than the maximum supported value.
-This value may be queried with _cmnd(GetConvolutionParameter)
-using target _const(SEPARABLE_2D) and name
-_const(MAX_CONVOLUTION_HEIGHT).
-.P
-_const(INVALID_ENUM) is generated if __format is not one of the allowable
-values.
-.P
-_const(INVALID_ENUM) is generated if __type is not one of the allowable
-values.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.P
-_const(INVALID_OPERATION) is generated if _param4 is one of
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5), or
-_const(UNSIGNED_SHORT_5_6_5_REV)
-and _param5 is not _const(RGB).
-.P
-_const(INVALID_OPERATION) is generated if _param4 is one of
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV)
-and _param5 is neither _const(RGBA) nor _const(BGRA).
-.SH ASSOCIATED GETS
-_cmnd(GetConvolutionParameter), _cmnd(GetSeparableFilter)
-.SH SEE ALSO
-_cmnd(ConvolutionFilter1D),
-_cmnd(ConvolutionFilter2D),
-_cmnd(ConvolutionParameter),
-_cmnd(PixelTransfer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/shademodel.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/shademodel.gl
deleted file mode 100755
index 8255bc3c7..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/shademodel.gl
+++ /dev/null
@@ -1,104 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(ShadeModel,select flat or smooth shading)
-_names(ShadeModel)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies a symbolic value representing a shading technique.
-Accepted values are _const(FLAT) and _const(SMOOTH).
-The initial value is _const(SMOOTH).
-.SH DESCRIPTION
-GL primitives can have either flat or smooth shading.
-Smooth shading,
-the default,
-causes the computed colors of vertices to be interpolated as the
-primitive is rasterized,
-typically assigning different colors to each resulting pixel fragment.
-Flat shading selects the computed color of just one vertex
-and assigns it to all the pixel fragments
-generated by rasterizing a single primitive.
-In either case, the computed color of a vertex is the result of
-lighting if lighting is enabled,
-or it is the current color at the time the vertex was specified if
-lighting is disabled.
-.P
-Flat and smooth shading are indistinguishable for points.
-Starting when _cmnd(Begin) is issued and counting vertices and
-primitives from 1, the GL gives each flat-shaded line segment $i$ the
-computed color of vertex $i ~+~ 1$, its second vertex.
-Counting similarly from 1,
-the GL gives each flat-shaded polygon the computed color of the vertex listed
-in the following table.
-This is the last vertex to specify the polygon in all cases except single
-polygons,
-where the first vertex specifies the flat-shaded color.
-.sp
-.TS
-center;
-lb cb
-l c .
-_
-Primitive Type of Polygon $i$ Vertex
-_
-Single polygon ($ i ~==~ 1 $) 1
-Triangle strip $i ~+~ 2$
-Triangle fan $i ~+~ 2$
-Independent triangle $ 3 i$
-Quad strip $2 i ~+~ 2$
-Independent quad $ 4 i $
-_
-.TE
-.sp
-Flat and smooth shading are specified by _cmnd with _param1 set to
-_const(FLAT) and _const(SMOOTH), respectively.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is any value other than
-_const(FLAT) or _const(SMOOTH).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(SHADE_MODEL)
-.SH SEE ALSO
-_cmnd(Begin),
-_cmnd(Color),
-_cmnd(Light),
-_cmnd(LightModel)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/stencilfunc.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/stencilfunc.gl
deleted file mode 100755
index 7d284a33d..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/stencilfunc.gl
+++ /dev/null
@@ -1,159 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(StencilFunc,set function and reference value for stencil testing)
-.EQ
-delim $$
-.EN
-_names(StencilFunc)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the test function.
-Eight tokens are valid:
-_const(NEVER),
-_const(LESS),
-_const(LEQUAL),
-_const(GREATER),
-_const(GEQUAL),
-_const(EQUAL),
-_const(NOTEQUAL), and
-_const(ALWAYS). The initial value is _const(ALWAYS).
-_phead(_param2)
-Specifies the reference value for the stencil test.
-_param2 is clamped to the range [0,$2 sup n - 1$],
-where $n$ is the number of bitplanes in the stencil buffer. The
-initial value is 0.
-_phead(_param3)
-Specifies a mask that is ANDed with both the reference value
-and the stored stencil value when the test is done. The initial value
-is all 1's.
-.SH DESCRIPTION
-Stenciling,
-like depth-buffering,
-enables and disables drawing on a per-pixel basis.
-You draw into the stencil planes using GL drawing primitives,
-then render geometry and images,
-using the stencil planes to mask out portions of the screen.
-Stenciling is typically used in multipass rendering algorithms
-to achieve special effects,
-such as decals,
-outlining,
-and constructive solid geometry rendering.
-.P
-The stencil test conditionally eliminates a pixel based on the outcome
-of a comparison between the reference value
-and the value in the stencil buffer.
-To enable and disable the test, call _cmnd(Enable) and _cmnd(Disable)
-with argument _const(STENCIL_TEST).
-To specify actions based on the outcome of the stencil test, call
-_cmnd(StencilOp).
-.P
-_param1 is a symbolic constant that determines the stencil comparison function.
-It accepts one of eight values,
-shown in the following list.
-_param2 is an integer reference value that is used in the stencil comparison.
-It is clamped to the range [0,$2 sup n - 1$],
-where $n$ is the number of bitplanes in the stencil buffer.
-_param3 is bitwise ANDed with both the reference value
-and the stored stencil value,
-with the ANDed values participating in the comparison.
-.P
-If \f2stencil\fP represents the value stored in the corresponding
-stencil buffer location,
-the following list shows the effect of each comparison function
-that can be specified by _param1.
-Only if the comparison succeeds is the pixel passed through
-to the next stage in the rasterization process
-(see _cmnd(StencilOp)).
-All tests treat \f2stencil\fP values as unsigned integers in the range
-[0,$2 sup n - 1$],
-where $n$ is the number of bitplanes in the stencil buffer.
-.P
-The following values are accepted by _param1:
-.TP 18
-_const(NEVER)
-Always fails.
-.TP
-_const(LESS)
-Passes if ( _param2 & _param3 ) < ( \f2stencil\fP & _param3 ).
-.TP
-_const(LEQUAL)
-Passes if ( _param2 & _param3 ) \(<= ( \f2stencil\fP & _param3 ).
-.TP
-_const(GREATER)
-Passes if ( _param2 & _param3 ) > ( \f2stencil\fP & _param3 ).
-.TP
-_const(GEQUAL)
-Passes if ( _param2 & _param3 ) \(>= ( \f2stencil\fP & _param3 ).
-.TP
-_const(EQUAL)
-Passes if ( _param2 & _param3 ) = ( \f2stencil\fP & _param3 ).
-.TP
-_const(NOTEQUAL)
-Passes if ( _param2 & _param3 ) \(!= ( \f2stencil\fP & _param3 ).
-.TP
-_const(ALWAYS)
-Always passes.
-.SH NOTES
-Initially, the stencil test is disabled.
-If there is no stencil buffer,
-no stencil modification can occur and it is as if
-the stencil test always passes.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not one of the eight
-accepted values.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(STENCIL_FUNC)
-.br
-_cmnd(Get) with argument _const(STENCIL_VALUE_MASK)
-.br
-_cmnd(Get) with argument _const(STENCIL_REF)
-.br
-_cmnd(Get) with argument _const(STENCIL_BITS)
-.br
-_cmnd(IsEnabled) with argument _const(STENCIL_TEST)
-.SH SEE ALSO
-_cmnd(AlphaFunc),
-_cmnd(BlendFunc),
-_cmnd(DepthFunc),
-_cmnd(Enable),
-_cmnd(IsEnabled),
-_cmnd(LogicOp),
-_cmnd(StencilOp)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/stencilmask.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/stencilmask.gl
deleted file mode 100755
index ac6c08010..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/stencilmask.gl
+++ /dev/null
@@ -1,70 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(StencilMask,control the writing of individual bits in the stencil planes)
-_names(StencilMask)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies a bit mask to enable and disable writing of individual bits
-in the stencil planes.
-Initially, the mask is all 1's.
-.SH DESCRIPTION
-_cmnd controls the writing of individual bits in the stencil planes.
-The least significant $n$ bits of _param1,
-where $n$ is the number of bits in the stencil buffer,
-specify a mask.
-Where a 1 appears in the mask,
-it's possible to write to the corresponding bit in the stencil buffer.
-Where a 0 appears,
-the corresponding bit is write-protected.
-Initially, all bits are enabled for writing.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(STENCIL_WRITEMASK)
-.br
-_cmnd(Get) with argument _const(STENCIL_BITS)
-.SH SEE ALSO
-_cmnd(ColorMask),
-_cmnd(DepthMask),
-_cmnd(IndexMask),
-_cmnd(StencilFunc),
-_cmnd(StencilOp)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/stencilop.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/stencilop.gl
deleted file mode 100755
index 6aa66736f..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/stencilop.gl
+++ /dev/null
@@ -1,155 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(StencilOp,set stencil test actions)
-.EQ
-delim $$
-.EN
-_names(StencilOp)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the action to take when the stencil test fails.
-Six symbolic constants are accepted:
-_const(KEEP),
-_const(ZERO),
-_const(REPLACE),
-_const(INCR),
-_const(DECR), and
-_const(INVERT). The initial value is _const(KEEP).
-_phead(_param2)
-Specifies the stencil action when the stencil test passes,
-but the depth test fails.
-_param2 accepts the same symbolic constants as _param1. The initial value
-is _const(KEEP).
-_phead(_param3)
-Specifies the stencil action when both the stencil test and the depth
-test pass, or when the stencil test passes and either there is no
-depth buffer or depth testing is not enabled.
-_param3 accepts the same symbolic constants as _param1. The initial value
-is _const(KEEP).
-.SH DESCRIPTION
-Stenciling,
-like depth-buffering,
-enables and disables drawing on a per-pixel basis.
-You draw into the stencil planes using GL drawing primitives,
-then render geometry and images,
-using the stencil planes to mask out portions of the screen.
-Stenciling is typically used in multipass rendering algorithms
-to achieve special effects,
-such as decals,
-outlining,
-and constructive solid geometry rendering.
-.P
-The stencil test conditionally eliminates a pixel based on the outcome
-of a comparison between the value in the stencil buffer and a
-reference value. To enable and disable the test, call _cmnd(Enable)
-and _cmnd(Disable) with argument
-_const(STENCIL_TEST); to control it, call _cmnd(StencilFunc).
-.P
-_cmnd takes three arguments that indicate what happens
-to the stored stencil value while stenciling is enabled.
-If the stencil test fails,
-no change is made to the pixel's color or depth buffers,
-and _param1 specifies what happens to the stencil buffer contents.
-The following six actions are possible.
-.TP 16
-_const( KEEP)
-Keeps the current value.
-.TP
-_const( ZERO)
-Sets the stencil buffer value to 0.
-.TP
-_const( REPLACE)
-Sets the stencil buffer value to \f2ref\fP,
-as specified by _cmnd(StencilFunc).
-.TP
-_const( INCR)
-Increments the current stencil buffer value.
-Clamps to the maximum representable unsigned value.
-.TP
-_const( DECR)
-Decrements the current stencil buffer value.
-Clamps to 0.
-.TP
-_const( INVERT)
-Bitwise inverts the current stencil buffer value.
-.P
-Stencil buffer values are treated as unsigned integers.
-When incremented and decremented,
-values are clamped to 0 and $2 sup n - 1$,
-where $n$ is the value returned by querying _const(STENCIL_BITS).
-.P
-The other two arguments to _cmnd specify stencil buffer actions
-that depend on whether subsequent depth buffer tests succeed (_param3)
-or fail (_param2) (see
-.br
-_cmnd(DepthFunc)).
-The actions are specified using the same six symbolic constants as _param1.
-Note that _param2 is ignored when there is no depth buffer,
-or when the depth buffer is not enabled.
-In these cases, _param1 and _param3 specify stencil action when the
-stencil test fails and passes,
-respectively.
-.SH NOTES
-Initially the stencil test is disabled.
-If there is no stencil buffer,
-no stencil modification can occur
-and it is as if the stencil tests always pass,
-regardless of any call to _cmnd.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1,
-_param2, or _param3 is any value other than the six defined constant values.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(STENCIL_FAIL)
-.br
-_cmnd(Get) with argument _const(STENCIL_PASS_DEPTH_PASS)
-.br
-_cmnd(Get) with argument _const(STENCIL_PASS_DEPTH_FAIL)
-.br
-_cmnd(Get) with argument _const(STENCIL_BITS)
-.br
-_cmnd(IsEnabled) with argument _const(STENCIL_TEST)
-.SH SEE ALSO
-_cmnd(AlphaFunc),
-_cmnd(BlendFunc),
-_cmnd(DepthFunc),
-_cmnd(Enable),
-_cmnd(LogicOp),
-_cmnd(StencilFunc)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/texcoord.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/texcoord.gl
deleted file mode 100755
index ef5be9513..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/texcoord.gl
+++ /dev/null
@@ -1,92 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(TexCoord, set the current texture coordinates)
-_names(TexCoord,[1-4]u*[sifdb])
-.SH PARAMETERS
-_phead(_param1 _param2 _param3 _param4)
-Specify \f2s\fP, \f2t\fP, \f2r\fP, and \f2q\fP texture coordinates.
-Not all parameters are present in all forms of the command.
-_names(TexCoord,[1-4]u*[sifdb]v)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a pointer to an array of one, two, three, or four elements,
-which in turn specify the
-\f2s\fP,
-\f2t\fP,
-\f2r\fP, and
-\f2q\fP texture coordinates.
-.SH DESCRIPTION
-_cmnd specifies texture coordinates in
-one,
-two,
-three, or
-four dimensions.
-_cmnd(TexCoord1) sets the current texture coordinates to
-(_param1(1), 0, 0, 1);
-a call to
-.br
-_cmnd(TexCoord2) sets them to
-(_param1(1), _param2(1), 0, 1).
-.BP
-Similarly, _cmnd(TexCoord3) specifies the texture coordinates as
-(_param1(1), _param2(1), _param3(1), 1), and
-_cmnd(TexCoord4) defines all four components explicitly as
-(_param1(1), _param2(1), _param3(1), _param4(1)).
-.P
-The current texture coordinates are part of the data
-that is associated with each vertex and with the current
-raster position.
-Initially, the values for
-\f2s\fP,
-\f2t\fP,
-\f2r\fP, and
-\f2q\fP
-are (0, 0, 0, 1).
-.P
-.SH NOTES
-The current texture coordinates can be updated at any time.
-In particular,
-_cmnd can be called between a call to _cmnd(Begin) and the corresponding
-call to _cmnd(End).
-.P
-When the _arbstring(imaging) extension is supported, _cmnd always
-updates texture unit _arbconst(TEXTURE0).
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(CURRENT_TEXTURE_COORDS)
-.SH SEE ALSO
-_cmnd(TexCoordPointer),
-_cmnd(Vertex)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/texcoordpointer.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/texcoordpointer.gl
deleted file mode 100755
index 327732aca..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/texcoordpointer.gl
+++ /dev/null
@@ -1,154 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_C_ A real line follows.
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_C_ Use GL not OpenGL
-_C_ Don't change the ordering of the main headers.
-_C_ C specification (or fortran) is handled automatically
-_C_ .TH is automatically added to the top of this file.
-_C_ Below, use current tense, active do not capitalize the first word and dont
-_C_ use a period.
-_C_ the function name must appear in (APIFILE) (usually gl.h) as set in
-_C_ Makefile.
-_header(TexCoordPointer,define an array of texture coordinates)
-_names(TexCoordPointer)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the number of coordinates per array element. Must be 1, 2, 3
-or 4. The initial value is 4.
-_phead(_param2)
-Specifies the data type of each texture coordinate.
-Symbolic constants
-_const(SHORT),
-_const(INT),
-_const(FLOAT),
-or _const(DOUBLE)
-are accepted. The initial value is _const(FLOAT).
-_phead(_param3)
-Specifies the byte offset between consecutive array elements.
-If _param3 is 0, the array elements are understood
-to be tightly packed. The initial value is 0.
-_phead(_param4)
-Specifies a pointer to the first coordinate of the first element in the
-array. The initial value is 0.
-.SH DESCRIPTION
-_cmnd specifies the location and data format of an array of texture
-coordinates to use when rendering.
-_param1 specifies the number of coordinates per
-element, and must be 1, 2, 3, or 4.
-_param2 specifies the data type of each texture coordinate
-and _param3 specifies the byte stride from one
-array element to the next allowing vertices and attributes
-to be packed into a single array or stored in separate arrays.
-(Single-array storage may be more efficient on some implementations;
-see
-.br
-_cmnd(InterleavedArrays).)
-When a texture
-coordinate array is specified, _param1, _param2, _param3, and _param4
-are saved client-side state.
-.P
-To enable and disable the texture coordinate array, call
-_cmnd(EnableClientState) and _cmnd(DisableClientState) with the argument
-_const(TEXTURE_COORD_ARRAY). If
-enabled, the texture coordinate array is used
-when _cmnd(DrawArrays), _cmnd(DrawElements), _cmnd(DrawRangeElements) or
-_cmnd(ArrayElement) is called.
-.P
-Use _cmnd(DrawArrays) to construct a sequence of primitives (all of the
-same type) from prespecified vertex and vertex attribute arrays.
-Use _cmnd(ArrayElement) to specify primitives
-by indexing vertices and vertex attributes and _cmnd(DrawElements) to
-construct a sequence of primitives by indexing vertices and vertex attributes.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-The texture coordinate array is initially disabled and it won't be
-accessed when
-_cmnd(ArrayElement), _cmnd(DrawElements), _cmnd(DrawRangeElements), or
-_cmnd(DrawArrays) is called.
-.P
-Execution of _cmnd is not allowed between the execution of
-_cmnd(Begin) and the corresponding execution of _cmnd(End),
-but an error may or may not be generated. If no error is generated,
-the operation is undefined.
-.P
-_cmnd is typically implemented on the client side with no protocol.
-.P
-The texture coordinate array parameters are client-side state and are
-therefore not saved or restored by _cmnd(PushAttrib) and _cmnd(PopAttrib).
-Use _cmnd(PushClientAttrib) and
-_cmnd(PopClientAttrib) instead.
-.P
-When the _arbstring(imaging) extension is supported, _cmnd updates the
-texture coordinate array state of the active client texture unit,
-specified with _cmnd(ClientActiveTextureARB).
-.SH ERRORS
-_const(INVALID_VALUE) is generated if _param1 is not 1, 2, 3, or 4.
-.P
-_const(INVALID_ENUM) is generated if _param2 is not an accepted value.
-.P
-_const(INVALID_VALUE) is generated if _param3 is negative.
-.SH ASSOCIATED GETS
-_cmnd(IsEnabled) with argument _const(TEXTURE_COORD_ARRAY)
-.br
-_cmnd(Get) with argument _const(TEXTURE_COORD_ARRAY_SIZE)
-.br
-_cmnd(Get) with argument _const(TEXTURE_COORD_ARRAY_TYPE)
-.br
-_cmnd(GetPointerv) with argument _const(TEXTURE_COORD_ARRAY_POINTER)
-.SH SEE ALSO
-_C_ no queries or gets listed above, alphabetize commands,
-_C_ seperate with commas not .br. no command appears in the associated gets
-_C_ as well as in SEE ALSO.
-_cmnd(ArrayElement),
-_cmnd(ClientActiveTextureARB),
-_cmnd(ColorPointer),
-_cmnd(DrawArrays),
-_cmnd(DrawElements),
-_cmnd(DrawRangeElements),
-_cmnd(EdgeFlagPointer),
-_cmnd(Enable),
-_cmnd(GetPointerv),
-_cmnd(IndexPointer),
-_cmnd(NormalPointer),
-_cmnd(PopClientAttrib),
-_cmnd(PushClientAttrib),
-_cmnd(TexCoord),
-_cmnd(VertexPointer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/texenv.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/texenv.gl
deleted file mode 100755
index f33860972..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/texenv.gl
+++ /dev/null
@@ -1,183 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(TexEnv, set texture environment parameters)
-_names(TexEnv,[fi])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies a texture environment.
-Must be _const(TEXTURE_ENV).
-_phead(_param2)
-Specifies the symbolic name of a single-valued texture environment parameter.
-Must be _const(TEXTURE_ENV_MODE).
-_phead(_param3)
-Specifies a single symbolic constant, one of _const(MODULATE),
-_const(DECAL), _const(BLEND), or _const(REPLACE).
-_names(TexEnv,[fi]v)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a texture environment.
-Must be _const(TEXTURE_ENV).
-_phead(_param2)
-Specifies the symbolic name of a texture environment parameter.
-Accepted values are _const(TEXTURE_ENV_MODE) and _const(TEXTURE_ENV_COLOR).
-_phead(_param3)
-Specifies a pointer to a parameter array that contains
-either a single symbolic constant or an RGBA color.
-.SH DESCRIPTION
-A texture environment specifies how texture values are interpreted
-when a fragment is textured.
-_param1 must be _const(TEXTURE_ENV).
-_param2 can be either _const(TEXTURE_ENV_MODE) or _const(TEXTURE_ENV_COLOR).
-.P
-If _param2 is _const(TEXTURE_ENV_MODE),
-then _param3 is (or points to) the symbolic name of a texture function.
-Four texture functions may be specified:
-_const(MODULATE),
-_const(DECAL),
-_const(BLEND), and
-_const(REPLACE).
-.P
-A texture function acts on the fragment to be textured using
-the texture image value that applies to the fragment
-(see _cmnd(TexParameter))
-and produces an RGBA color for that fragment.
-The following table shows how the RGBA color is produced for each
-of the three texture functions that can be chosen.
-$C$ is a triple of color values (RGB) and $A$ is the associated alpha value.
-RGBA values extracted from a texture image are in the range [0,1].
-The subscript $f$ refers to the incoming fragment,
-the subscript $t$ to the texture image,
-the subscript $c$ to the texture environment color,
-and subscript $v$ indicates a value produced by the texture function.
-.P
-A texture image can have up to four components per texture element
-(see _cmnd(TexImage1D), _cmnd(TexImage2D), _cmnd(TexImage3D),
-_cmnd(CopyTexImage1D), and _cmnd(CopyTexImage2D)).
-In a one-component image,
-$L sub t$ indicates that single component.
-A two-component image uses $L sub t$ and $A sub t$.
-A three-component image has only a color value, $C sub t$.
-A four-component image has both a color value $C sub t$
-and an alpha value $A sub t$.
-.sp
-.ne
-.TS
-center tab(:) ;
-cb cb s s s
-ci c c c c
-c c c c c.
-_
-Base internal:Texture functions
-format:_const(MODULATE):_const(DECAL):_const(BLEND):_const(REPLACE)
-_
-_const(ALPHA):$C sub v ~=~ C sub f$:undefined:$C sub v ~=~ C sub f$:$C sub v ~=~ C sub f$
-\^ :$A sub v ~=~ A sub f A sub t$:\^:$A sub v ~=~ A sub f$:$A sub v ~=~ A sub t$
-_
-_const(LUMINANCE):$C sub v ~=~ L sub t C sub f$:undefined:$C sub v ~=~ ( 1 - L sub t ) C sub f$:$C sub v ~=~ L sub t$
-: : :$+ L sub t C sub c$:
-1: $A sub v ~=~ A sub f$:\^: $A sub v ~=~ A sub f$:$A sub v ~=~ A sub f$
-_
-_const(LUMINANCE):$C sub v ~=~ L sub t C sub f$:undefined:$C sub v ~=~ ( 1 - L sub t ) C sub f $:$C sub v ~=~ L sub t$
-\\f3_ALPHA\fP: : : $+ L sub t C sub c$
-2:$A sub v ~=~ A sub t A sub f$:\^:$A sub v ~=~ A sub t A sub f$:$A sub v ~=~ A sub t$
-_
-_const(INTENSITY):$C sub v ~=~ C sub f I sub t$:undefined:$C sub v ~=~ ( 1 - I sub t ) C sub f$ :$C sub v ~=~ I sub t$
-: : :$+ I sub t C sub c$
-c\^ :$A sub v ~=~ A sub f I sub t$:\^:$A sub v ~=~ ( 1 - I sub t ) A sub f $:$A sub v ~=~ I sub t$
-: : :$+ I sub t A sub c$:
-_
-_const(RGB):$C sub v ~=~ C sub t C sub f$:$C sub v ~=~ C sub t$:$C sub v ~=~ (1 - C sub t) C sub f $:$C sub v ~=~ C sub t$
-: : : $+ C sub t C sub c$
-3:$A sub v ~=~ A sub f$:$A sub v ~=~ A sub f$:$A sub v ~=~ A sub f$:$A sub v ~=~ A sub f$
-_
-_const(RGBA):$C sub v ~=~ C sub t C sub f$:$C sub v ~=~ ( 1 - A sub t ) C sub f $:$C sub v ~=~ (1 - C sub t) C sub f $:$C sub v ~=~ C sub t$
-: :$+ A sub t C sub t$: $+ C sub t C sub c$
-4:$A sub v ~=~ A sub t A sub f$:$A sub v ~=~ A sub f$:$A sub v ~=~ A sub t A sub f$:$A sub v ~=~ A sub t$
-_
-.TE
-.bp
-If _param2 is _const(TEXTURE_ENV_COLOR),
-_param3 is a pointer to an array that holds an RGBA color consisting of four
-values.
-Integer color components are interpreted linearly such that the most
-positive integer maps to 1.0,
-and the most negative integer maps to -1.0.
-The values are clamped to the range [0,1] when they are specified.
-$C sub c$ takes these four values.
-.P
-_const(TEXTURE_ENV_MODE) defaults to _const(MODULATE) and
-_const(TEXTURE_ENV_COLOR) defaults to (0, 0, 0, 0).
-.SH NOTES
-_const(REPLACE) may only be used if the GL version is 1.1 or greater.
-.P
-Internal formats other than 1, 2, 3, or 4 may only be used if the GL
-version is 1.1 or greater.
-.P
-When the _arbstring(multitexture) extension is supported, _cmnd controls
-the texture environment for the current active texture unit, selected by
-_cmnd(ActiveTextureARB).
-.sh ERRORS
-_const(INVALID_ENUM) is generated when _param1 or _param2 is not
-one of the accepted defined values,
-or when _param3 should have a defined constant value
-(based on the value of _param2)
-and does not.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetTexEnv)
-.SH SEE ALSO
-_cmnd(ActiveTextureARB),
-_cmnd(CopyPixels),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexParameter),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/texgen.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/texgen.gl
deleted file mode 100755
index 66e29f1be..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/texgen.gl
+++ /dev/null
@@ -1,243 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(TexGen,control the generation of texture coordinates)
-_names(TexGen,[ifd])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies a texture coordinate.
-Must be one of _const(S), _const(T), _const(R), or _const(Q).
-_phead(_param2)
-Specifies the symbolic name of the texture-coordinate generation function.
-Must be _const(TEXTURE_GEN_MODE).
-_phead(_param3)
-Specifies a single-valued texture generation parameter,
-one of _const(OBJECT_LINEAR), _const(EYE_LINEAR), or _const(SPHERE_MAP).
-_names(TexGen,[ifd]v)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a texture coordinate.
-Must be one of _const(S), _const(T), _const(R), or _const(Q).
-_phead(_param2)
-Specifies the symbolic name of the texture-coordinate generation function
-or function parameters.
-Must be
-_const(TEXTURE_GEN_MODE),
-_const(OBJECT_PLANE), or
-_const(EYE_PLANE).
-_phead(_param3)
-Specifies a pointer to an array of texture generation parameters.
-If _param2 is _const(TEXTURE_GEN_MODE),
-then the array must contain a single symbolic constant,
-one of
-_const(OBJECT_LINEAR),
-_const(EYE_LINEAR), or
-_const(SPHERE_MAP).
-Otherwise,
-_param3 holds the coefficients for the texture-coordinate generation function
-specified by _param2.
-.SH DESCRIPTION
-_cmnd selects a texture-coordinate generation function
-or supplies coefficients for one of the functions.
-_param1 names one of the (\f2s\fP, \f2t\fP, \f2r\fP, \f2q\fP) texture
-coordinates; it must be one of the symbols
-_const(S),
-_const(T),
-_const(R), or
-_const(Q).
-_param2 must be one of three symbolic constants:
-_const(TEXTURE_GEN_MODE),
-_const(OBJECT_PLANE), or
-_const(EYE_PLANE).
-If _param2 is _const(TEXTURE_GEN_MODE),
-then _param3 chooses a mode,
-one of
-_const(OBJECT_LINEAR),
-_const(EYE_LINEAR), or
-_const(SPHERE_MAP).
-If _param2 is either _const(OBJECT_PLANE) or _const(EYE_PLANE),
-_param3 contains coefficients for the corresponding
-texture generation function.
-.P
-If the texture generation function is _const(OBJECT_LINEAR),
-the function
-.P
-.ce
-$g ~=~ p sub 1^x sub o ~+~ p sub 2^y sub o ~+~ p sub 3^z sub o ~+~ p sub 4^w sub o$
-.P
-.br
-is used, where $g$ is the value computed for the coordinate named in _param1,
-$p sub 1$,
-$p sub 2$,
-$p sub 3$,
-and
-$p sub 4$ are the four values supplied in _param3, and
-$x sub o$,
-$y sub o$,
-$z sub o$, and
-$w sub o$ are the object coordinates of the vertex.
-This function can be used, for example, to texture-map terrain using sea level
-as a reference plane
-(defined by $p sub 1$, $p sub 2$, $p sub 3$, and $p sub 4$).
-The altitude of a terrain vertex is computed by the _const(OBJECT_LINEAR)
-coordinate generation function as its distance from sea level;
-that altitude can then be used to index the texture image to map white snow
-onto peaks and green grass onto foothills.
-.P
-If the texture generation function is _const(EYE_LINEAR), the function
-.P
-.ce
-$g ~=~ p sub 1 sup prime ^x sub e ~+~ p sub 2 sup prime ^y sub e ~+~ p sub 3 sup prime ^z sub e ~+~ p sub 4 sup prime ^w sub e$
-.P
-.br
-is used, where
-.P
-.ce
-$( p sub 1 sup prime
-~~p sub 2 sup prime~~p sub 3 sup prime~~
-{ p sub 4 sup prime}) ~=~ ( p sub 1~~ p sub 2~~ p sub 3~~ p sub 4 ) ~M sup -1$
-.P
-.br
-and
-$x sub e$,
-$y sub e$,
-$z sub e$, and
-$w sub e$ are the eye coordinates of the vertex,
-$p sub 1$,
-$p sub 2$,
-$p sub 3$,
-and
-$p sub 4$ are the values supplied in _param3, and
-$M$ is the modelview matrix when _cmnd is invoked.
-If $M$ is poorly conditioned or singular,
-texture coordinates generated by the resulting function may be inaccurate
-or undefined.
-.P
-Note that the values in _param3 define a reference plane in eye coordinates.
-The modelview matrix that is applied to them may not be the same one
-in effect when the polygon vertices are transformed.
-This function establishes a field of texture coordinates
-that can produce dynamic contour lines on moving objects.
-.P
-If _param2 is _const(SPHERE_MAP) and _param1 is either
-_const(S) or
-_const(T),
-$s$ and $t$ texture coordinates are generated as follows.
-Let \f2u\fP be the unit vector pointing from the origin to the polygon vertex
-(in eye coordinates).
-Let \f2n\fP sup prime be the current normal,
-after transformation to eye coordinates.
-Let
-.P
-.ce
-$f ~=~ ( f sub x~~f sub y~~f sub z ) sup T$
-be the reflection vector such that
-.P
-.ce
-$f ~=~ u ~-~ 2 n sup prime n sup prime sup T u$
-.br
-.P
-Finally, let $ m ~=~ 2 sqrt { f sub x sup {~2} ~+~ f sub y sup {~2} ~+~ (f sub z ~+~ 1 ) sup 2}$.
-Then the values assigned to the $s$ and $t$ texture coordinates are
-.P
-.ce 1
-$s ~=~ f sub x over m ~+~ 1 over 2$
-.sp
-.ce 1
-$t ~=~ f sub y over m ~+~ 1 over 2$
-.P
-To enable or disable a texture-coordinate generation function, call
-_cmnd(Enable) or _cmnd(Disable)
-with one of the symbolic texture-coordinate names
-(_const(TEXTURE_GEN_S),
-_const(TEXTURE_GEN_T),
-_const(TEXTURE_GEN_R), or
-_const(TEXTURE_GEN_Q)) as the argument.
-When enabled,
-the specified texture coordinate is computed
-according to the generating function associated with that coordinate.
-When disabled,
-subsequent vertices take the specified texture coordinate
-from the current set of texture coordinates. Initially, all texture
-generation functions are set to _const(EYE_LINEAR) and are disabled.
-Both $s$ plane equations are (1, 0, 0, 0),
-both $t$ plane equations are (0, 1, 0, 0),
-and all $r$ and $q$ plane equations are (0, 0, 0, 0).
-.P
-When the _arbstring(multitexture) extension is supported, _cmnd set the
-texture generation parameters for the currently active texture unit,
-selected with _cmnd(ActiveTextureARB).
-.SH ERRORS
-_const(INVALID_ENUM) is generated when _param1 or _param2 is not an
-accepted defined value,
-or when _param2 is _const(TEXTURE_GEN_MODE) and _param3 is not an
-accepted defined value.
-.P
-_const(INVALID_ENUM) is generated when _param2 is _const(TEXTURE_GEN_MODE),
-_param3 is _const(SPHERE_MAP),
-and _param1 is either _const(R) or _const(Q).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetTexGen)
-.br
-_cmnd(IsEnabled) with argument _const(TEXTURE_GEN_S)
-.br
-_cmnd(IsEnabled) with argument _const(TEXTURE_GEN_T)
-.br
-_cmnd(IsEnabled) with argument _const(TEXTURE_GEN_R)
-.br
-_cmnd(IsEnabled) with argument _const(TEXTURE_GEN_Q)
-.SH SEE ALSO
-_cmnd(ActiveTextureARB),
-_cmnd(CopyPixels),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(TexEnv),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexParameter),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/teximage1d.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/teximage1d.gl
deleted file mode 100755
index e93a63ac5..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/teximage1d.gl
+++ /dev/null
@@ -1,461 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(TexImage1D,specify a one-dimensional texture image)
-_names(TexImage1D)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the target texture.
-Must be _const(TEXTURE_1D) or _const(PROXY_TEXTURE_1D).
-_phead(_param2)
-Specifies the level-of-detail number.
-Level 0 is the base image level.
-Level \f2n\fP is the \f2n\fPth mipmap reduction image.
-_phead(_param3)
-Specifies the number of color components in the texture.
-Must be 1, 2, 3, or 4, or one of the following symbolic constants:
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(INTENSITY),
-_const(INTENSITY4),
-_const(INTENSITY8),
-_const(INTENSITY12),
-_const(INTENSITY16),
-_const(RGB),
-_const(R3_G3_B2),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12), or
-_const(RGBA16).
-_phead(_param4)
-Specifies the width of the texture image.
-Must be $2 sup n + 2 ( _eqnparam5 )$ for some integer $n$. All
-implementations support texture images that are at least 64 texels
-wide. The height of the 1D texture image is 1.
-_phead(_param5)
-Specifies the width of the border.
-Must be either 0 or 1.
-_phead(_param6)
-Specifies the format of the pixel data.
-The following symbolic values are accepted:
-_const(COLOR_INDEX),
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(BGR),
-_const(RGBA),
-_const(BGRA),
-_C_ _const(ABGR_EXT),
-_const(LUMINANCE), and
-_const(LUMINANCE_ALPHA).
-_phead(_param7)
-Specifies the data type of the pixel data.
-The following symbolic values are accepted:
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV).
-_phead(_param8)
-Specifies a pointer to the image data in memory.
-.SH DESCRIPTION
-Texturing maps a portion of a specified texture image
-onto each graphical primitive for which texturing is enabled.
-To enable and disable one-dimensional texturing, call _cmnd(Enable)
-and _cmnd(Disable) with argument _const(TEXTURE_1D).
-.P
-Texture images are defined with _cmnd.
-The arguments describe the parameters of the texture image,
-such as width,
-width of the border,
-level-of-detail number
-(see _cmnd(TexParameter)),
-and the internal resolution and format used to store the image.
-The last three arguments describe how the image is represented in
-memory; they are identical to the pixel formats used for
-_cmnd(DrawPixels).
-.P
-If _param1 is _const(PROXY_TEXTURE_1D), no data is read from _param8, but
-all of the texture image state is recalculated, checked for
-consistency, and checked against the implementation's capabilities.
-If the implementation cannot handle a texture of the
-requested texture size, it sets all of the image state to 0,
-but does not generate an error (see _cmnd(GetError)). To query for an
-entire mipmap array, use an image array level greater than or equal to
-1.
-.P
-If _param1 is _const(TEXTURE_1D),
-data is read from _param8 as a sequence of signed or unsigned bytes,
-shorts,
-or longs,
-or single-precision floating-point values,
-depending on _param7.
-These values are grouped into sets of one,
-two,
-three,
-or four values,
-depending on _param6,
-to form elements.
-If _param7 is _const(BITMAP),
-the data is considered as a string of unsigned bytes
-(and _param6 must be _const(COLOR_INDEX)).
-Each data byte is treated as eight 1-bit elements,
-with bit ordering determined by _const(UNPACK_LSB_FIRST)
-(see _cmnd(PixelStore)).
-.P
-The first element corresponds to the left end of the texture array.
-Subsequent elements progress left-to-right through the remaining texels
-in the texture array.
-The final element corresponds to the right end of the texture array.
-.P
-_param6 determines the composition of each element in _param8.
-It can assume one of eleven symbolic values:
-.TP 10
-_const(COLOR_INDEX)
-Each element is a single value,
-a color index.
-The GL converts it to fixed point
-(with an unspecified number of zero bits to the right of the binary point),
-shifted left or right depending on the value and sign of _const(INDEX_SHIFT),
-and added to _const(INDEX_OFFSET)
-(see _cmnd(PixelTransfer)).
-The resulting index is converted to a set of color components
-using the
-_const(PIXEL_MAP_I_TO_R),
-_const(PIXEL_MAP_I_TO_G),
-_const(PIXEL_MAP_I_TO_B), and
-_const(PIXEL_MAP_I_TO_A) tables,
-and clamped to the range [0,1].
-.TP
-_const(RED)
-Each element is a single red component.
-The GL converts it to floating point and assembles it into an RGBA element
-by attaching 0 for green and blue, and 1 for alpha.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS).
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(GREEN)
-Each element is a single green component.
-The GL converts it to floating point and assembles it into an RGBA element
-by attaching 0 for red and blue, and 1 for alpha.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(BLUE)
-Each element is a single blue component.
-The GL converts it to floating point and assembles it into an RGBA element
-by attaching 0 for red and green, and 1 for alpha.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(ALPHA)
-Each element is a single alpha component.
-The GL converts it to floating point and assembles it into an RGBA element
-by attaching 0 for red, green, and blue.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(RGB)
-.TP
-_const(BGR)
-Each element is an RGB triple.
-The GL converts it to floating point and assembles it into an RGBA element
-by attaching 1 for alpha.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(RGBA)
-.TP
-_const(BGRA)
-_C_ .TP
-_C_ _const(ABGR_EXT)
-Each element contains all four components.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(LUMINANCE)
-Each element is a single luminance value.
-The GL converts it to floating point,
-then assembles it into an RGBA element by replicating the luminance value
-three times for red, green, and blue and attaching 1 for alpha.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(LUMINANCE_ALPHA)
-Each element is a luminance/alpha pair.
-The GL converts it to floating point,
-then assembles it into an RGBA element by replicating the luminance value
-three times for red, green, and blue.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1] (see _cmnd(PixelTransfer)).
-.P
-If an application wants to store the texture at a certain
-resolution or in a certain format, it can request the resolution
-and format with _param3. The GL will choose an internal
-representation that closely approximates that requested by _param3, but
-it may not match exactly.
-(The representations specified by _const(LUMINANCE), _const(LUMINANCE_ALPHA), _const(RGB),
-and _const(RGBA) must match exactly. The numeric values 1, 2, 3, and 4 may also be used to
-specify the preceding representations.)
-.P
-Use the _const(PROXY_TEXTURE_1D) target to try out a resolution and
-format. The implementation will
-update and recompute its best match for the requested storage resolution
-and format. To query this state, call _cmnd(GetTexLevelParameter).
-If the texture cannot be accommodated, texture state is set to 0.
-.P
-A one-component texture image uses only the red component of the RGBA
-color from _param8.
-A two-component image uses the R and A values.
-A three-component image uses the R, G, and B values.
-A four-component image uses all of the RGBA components.
-.SH NOTES
-Texturing has no effect in color index mode.
-.P
-If the _arbstring(imaging) extension is supported, RGBA elements may
-also be processed by the imaging pipeline. The following stages may be
-applied to an RGBA color before color component clamping to the range
-[0,\ 1]:
-.TP 3
-1. Color component replacement by the color table specified for
-_const(COLOR_TABLE), if enabled. See _cmnd(ColorTable).
-.TP
-2. One-dimensional convolution filtering, if enabled. See
-_cmnd(ConvolutionFilter1D).
-.IP
-If a convolution filter changes the __width of the texture (by
-processing with a _const(CONVOLUTION_BORDER_MODE) of _const(REDUCE), for
-example), the _param4 must $2 sup n + 2 ( _eqnparam5 )$, for some
-integer $n$, after filtering.
-.TP
-3. RGBA components may be multiplied by _const(POST_CONVOLUTION_c_SCALE),
-and added to _const(POST_CONVOLUTION_c_BIAS), if enabled. See
-_cmnd(PixelTransfer).
-.TP
-4. Color component replacement by the color table specified for
-_const(POST_CONVOLUTION_COLOR_TABLE), if enabled. See _cmnd(ColorTable).
-.TP
-5. Transformation by the color matrix. See _cmnd(MatrixMode).
-.TP
-6. RGBA components may be multiplied by _const(POST_COLOR_MATRIX_c_SCALE),
-and added to _const(POST_COLOR_MATRIX_c_BIAS), if enabled. See
-_cmnd(PixelTransfer).
-.TP
-7. Color component replacement by the color table specified for
-_const(POST_COLOR_MATRIX_COLOR_TABLE), if enabled. See _cmnd(ColorTable).
-.P
-The texture image can be represented by the same data formats
-as the pixels in a _cmnd(DrawPixels) command,
-except that _const(STENCIL_INDEX) and _const(DEPTH_COMPONENT)
-cannot be used.
-_cmnd(PixelStore) and _cmnd(PixelTransfer) modes affect texture images
-in exactly the way they affect _cmnd(DrawPixels).
-.P
-_C_ _const(ABGR_EXT) is
-_C_ part of the _extname(EXT_abgr) extension, not part of
-_C_ the core GL command set. If _extstring(EXT_abgr) is included
-_C_ in the string returned by _cmnd(GetString), when called with
-_C_ argument _const(EXTENSIONS), extension _extname(EXT_abgr) is
-_C_ supported by the connection.
-_C_ .P
-_const(PROXY_TEXTURE_1D) may be used only if the GL version is 1.1 or greater.
-.P
-Internal formats other than 1, 2, 3, or 4 may be
-used only if the GL version is 1.1 or greater.
-.P
-In GL version 1.1 or greater,
-_param8 may be a null pointer. In this case texture memory is
-allocated to accommodate a texture of width _param4.
-You can then download subtextures to initialize the
-texture memory. The image is undefined if the program tries to apply
-an uninitialized portion of the texture image to a primitive.
-.P
-Formats _const(BGR), and _const(BGRA) and types
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV) are available only if the GL version
-is 1.2 or greater.
-.P
-When the _arbstring(multitexture) extension is supported, _cmnd
-specifies the one-dimensional texture for the current texture unit,
-specified with _cmnd(ActiveTextureARB).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not _const(TEXTURE_1D)
-or _const(PROXY_TEXTURE_1D).
-.P
-_const(INVALID_ENUM) is generated if _param6 is not an accepted
-format constant.
-Format constants other than _const(STENCIL_INDEX) and _const(DEPTH_COMPONENT)
-are accepted.
-.P
-_const(INVALID_ENUM) is generated if _param7 is not a type constant.
-.P
-_const(INVALID_ENUM) is generated if _param7 is _const(BITMAP) and
-_param6 is not _const(COLOR_INDEX).
-.P
-_const(INVALID_VALUE) is generated if _param2 is less than 0.
-.P
-_const(INVALID_VALUE) may be generated if _param2 is greater than $log
-sub 2$\f2max\fP,
-where \f2max\fP is the returned value of _const(MAX_TEXTURE_SIZE).
-.P
-_const(INVALID_VALUE) is generated if _param3 is not 1, 2, 3, 4, or
-one of the accepted resolution and format symbolic constants.
-.P
-_const(INVALID_VALUE) is generated if _param4 is less than 0
-or greater than 2 + _const(MAX_TEXTURE_SIZE),
-or if it cannot be represented as $2 sup n ~+~ 2(_eqnparam5)$
-for some integer value of \f2n\fP.
-.P
-_const(INVALID_VALUE) is generated if _param5 is not 0 or 1.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.P
-_const(INVALID_OPERATION) is generated if _param7 is one of
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5), or
-_const(UNSIGNED_SHORT_5_6_5_REV)
-and _param6 is not _const(RGB).
-.P
-_const(INVALID_OPERATION) is generated if _param7 is one of
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV)
-and _param6 is neither _const(RGBA) nor _const(BGRA).
-.SH ASSOCIATED GETS
-_cmnd(GetTexImage)
-.br
-_cmnd(IsEnabled) with argument _const(TEXTURE_1D)
-.SH SEE ALSO
-_cmnd(ActiveTextureARB),
-_cmnd(ColorTable),
-_cmnd(ConvolutionFilter1D),
-_cmnd(CopyPixels),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(DrawPixels),
-_cmnd(MatrixMode),
-_cmnd(PixelStore),
-_cmnd(PixelTransfer),
-_cmnd(TexEnv),
-_cmnd(TexGen),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D),
-_cmnd(TexParameter)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/teximage2d.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/teximage2d.gl
deleted file mode 100755
index 0e7203a99..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/teximage2d.gl
+++ /dev/null
@@ -1,487 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(TexImage2D,specify a two-dimensional texture image)
-_names(TexImage2D)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the target texture.
-Must be _const(TEXTURE_2D) or _const(PROXY_TEXTURE_2D).
-_phead(_param2)
-Specifies the level-of-detail number.
-Level 0 is the base image level.
-Level \f2n\fP is the \f2n\fPth mipmap reduction image.
-_phead(_param3)
-Specifies the number of color components in the texture.
-Must be 1, 2, 3, or 4, or one of the following symbolic constants:
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(INTENSITY),
-_const(INTENSITY4),
-_const(INTENSITY8),
-_const(INTENSITY12),
-_const(INTENSITY16),
-_const(R3_G3_B2),
-_const(RGB),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12), or
-_const(RGBA16).
-_phead(_param4)
-Specifies the width of the texture image.
-Must be $2 sup n ~+~ 2 ( _eqnparam6 )$ for some integer $n$. All
-implementations support texture images that are at least 64 texels
-wide.
-_phead(_param5)
-Specifies the height of the texture image.
-Must be $2 sup m ~+~ 2 ( _eqnparam6 )$ for some integer $m$. All
-implementations support texture images that are at least 64 texels
-high.
-_phead(_param6)
-Specifies the width of the border.
-Must be either 0 or 1.
-_phead(_param7)
-Specifies the format of the pixel data.
-The following symbolic values are accepted:
-_const(COLOR_INDEX),
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(BGR)
-_const(RGBA),
-_const(BGRA),
-_C_ _const(ABGR_EXT),
-_const(LUMINANCE), and
-_const(LUMINANCE_ALPHA).
-_phead(_param8)
-Specifies the data type of the pixel data.
-The following symbolic values are accepted:
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV).
-_phead(_param9)
-Specifies a pointer to the image data in memory.
-.SH DESCRIPTION
-Texturing maps a portion of a specified texture image
-onto each graphical primitive for which texturing is enabled.
-To enable and disable two-dimensional texturing, call _cmnd(Enable)
-and _cmnd(Disable) with argument _const(TEXTURE_2D).
-.P
-To define texture images, call _cmnd.
-The arguments describe the parameters of the texture image,
-such as height,
-width,
-width of the border,
-level-of-detail number
-(see _cmnd(TexParameter)),
-and number of color components provided.
-The last three arguments describe how the image is represented in memory;
-they are identical to the pixel formats used for _cmnd(DrawPixels).
-.P
-If _param1 is _const(PROXY_TEXTURE_2D), no data is read from _param9, but
-all of the texture image state is recalculated, checked for
-consistency, and checked
-against the implementation's capabilities. If the implementation cannot
-handle a texture of the requested texture size, it sets
-all of the image state to 0,
-but does not generate an error (see _cmnd(GetError)). To query for an
-entire mipmap array, use an image array level greater than or equal to
-1.
-.P
-If _param1 is _const(TEXTURE_2D),
-data is read from _param9 as a sequence of signed or unsigned bytes,
-shorts,
-or longs,
-or single-precision floating-point values,
-depending on _param8.
-These values are grouped into sets of one,
-two,
-three,
-or four values,
-depending on _param7,
-to form elements.
-If _param8 is _const(BITMAP),
-the data is considered as a string of unsigned bytes (and
-_param7 must be _const(COLOR_INDEX)).
-.bp
-Each data byte is treated as eight 1-bit elements,
-with bit ordering determined by _const(UNPACK_LSB_FIRST)
-(see _cmnd(PixelStore)).
-.P
-The first element corresponds to the lower left corner of the texture
-image.
-Subsequent elements progress left-to-right through the remaining texels
-in the lowest row of the texture image, and then in successively higher
-rows of the texture image.
-The final element corresponds to the upper right corner of the texture
-image.
-.P
-_param7 determines the composition of each element in _param9.
-It can assume one of eleven symbolic values:
-.TP 10
-_const(COLOR_INDEX)
-Each element is a single value,
-a color index.
-The GL converts it to fixed point
-(with an unspecified number of zero bits to the right of the binary point),
-shifted left or right depending on the value and sign of _const(INDEX_SHIFT),
-and added to _const(INDEX_OFFSET)
-(see
-.br
-_cmnd(PixelTransfer)).
-The resulting index is converted to a set of color components
-using the
-_const(PIXEL_MAP_I_TO_R),
-_const(PIXEL_MAP_I_TO_G),
-_const(PIXEL_MAP_I_TO_B), and
-_const(PIXEL_MAP_I_TO_A) tables,
-and clamped to the range [0,1].
-.TP
-_const(RED)
-Each element is a single red component.
-The GL converts it to floating point and assembles it into an RGBA element
-by attaching 0 for green and blue, and 1 for alpha.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(GREEN)
-Each element is a single green component.
-The GL converts it to floating point and assembles it into an RGBA element
-by attaching 0 for red and blue, and 1 for alpha.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(BLUE)
-Each element is a single blue component.
-The GL converts it to floating point and assembles it into an RGBA element
-by attaching 0 for red and green, and 1 for alpha.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(ALPHA)
-Each element is a single alpha component.
-The GL converts it to floating point and assembles it into an RGBA element
-by attaching 0 for red, green, and blue.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(RGB)
-.TP
-_const(BGR)
-Each element is an RGB triple.
-The GL converts it to floating point and assembles it into an RGBA element
-by attaching 1 for alpha.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see
-.br
-_cmnd(PixelTransfer)).
-.TP
-_const(RGBA)
-.TP
-_const(BGRA)
-_C_ .TP
-_C_ _const(ABGR_EXT)
-Each element contains all four components.
-Each component is multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(LUMINANCE)
-Each element is a single luminance value.
-The GL converts it to floating point,
-then assembles it into an RGBA element by replicating the luminance value
-three times for red, green, and blue and attaching 1 for alpha.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(LUMINANCE_ALPHA)
-Each element is a luminance/alpha pair.
-The GL converts it to floating point,
-then assembles it into an RGBA element by replicating the luminance value
-three times for red, green, and blue.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see
-.br
-_cmnd(PixelTransfer)).
-.P
-Refer to the _cmnd(DrawPixels) reference page for a description of
-the acceptable values for the _param8 parameter.
-.P
-If an application wants to store the texture at a certain
-resolution or in a certain format, it can request the resolution
-and format with _param3. The GL will choose an internal
-representation that closely approximates that requested by _param3, but
-it may not match exactly.
-(The representations specified by _const(LUMINANCE),
-_const(LUMINANCE_ALPHA), _const(RGB),
-and _const(RGBA) must match exactly. The numeric values 1, 2, 3, and 4
-may also be used to specify the above representations.)
-.P
-Use the _const(PROXY_TEXTURE_2D) target to try out a resolution and
-format. The implementation will
-update and recompute its best match for the requested storage resolution
-and format. To then query this state, call
-_cmnd(GetTexLevelParameter).
-If the texture cannot be accommodated, texture state is set to 0.
-.P
-A one-component texture image uses only the red component of the RGBA
-color extracted from _param9.
-A two-component image uses the R and A values.
-A three-component image uses the R, G, and B values.
-A four-component image uses all of the RGBA components.
-.SH NOTES
-Texturing has no effect in color index mode.
-.P
-If the _arbstring(imaging) extension is supported, RGBA elements may
-also be processed by the imaging pipeline. The following stages may be
-applied to an RGBA color before color component clamping to the range
-[0,\ 1]:
-.TP 3
-1. Color component replacement by the color table specified for
-_const(COLOR_TABLE), if enabled. See _cmnd(ColorTable).
-.TP
-2. Two-dimensional Convolution filtering, if enabled. See
-_cmnd(ConvolutionFilter1D).
-.IP
-If a convolution filter changes the __width of the texture (by
-processing with a _const(CONVOLUTION_BORDER_MODE) of _const(REDUCE), for
-example), the _param4 must $2 sup n + 2 ( _eqnparam5 )$, for some
-integer $n$, and _param5 must be $2 sup m + ( _eqnparam6 )$, for some
-integer $m$, after filtering.
-.TP
-3. RGBA components may be multiplied by _const(POST_CONVOLUTION_c_SCALE),
-and added to _const(POST_CONVOLUTION_c_BIAS), if enabled. See
-_cmnd(PixelTransfer).
-.TP
-4. Color component replacement by the color table specified for
-_const(POST_CONVOLUTION_COLOR_TABLE), if enabled. See _cmnd(ColorTable).
-.TP
-5. Transformation by the color matrix. See _cmnd(MatrixMode).
-.TP
-6. RGBA components may be multiplied by _const(POST_COLOR_MATRIX_c_SCALE),
-and added to _const(POST_COLOR_MATRIX_c_BIAS), if enabled. See
-_cmnd(PixelTransfer).
-.TP
-7. Color component replacement by the color table specified for
-_const(POST_COLOR_MATRIX_COLOR_TABLE), if enabled. See
-_cmnd(ColorTable).
-.P
-The texture image can be represented by the same data formats
-as the pixels in a _cmnd(DrawPixels) command,
-except that _const(STENCIL_INDEX) and _const(DEPTH_COMPONENT)
-cannot be used.
-_cmnd(PixelStore) and _cmnd(PixelTransfer) modes affect texture images
-in exactly the way they affect _cmnd(DrawPixels).
-.P
-_C_ _const(ABGR_EXT) is
-_C_ part of the _extname(EXT_abgr) extension, not part of
-_C_ the core GL command set. If _extstring(EXT_abgr) is included
-_C_ in the string returned by _cmnd(GetString), when called with
-_C_ argument _const(EXTENSIONS), extension _extname(EXT_abgr) is
-_C_ supported by the GL.
-.P
-_cmnd and _const(PROXY_TEXTURE_2D) are available only if the GL
-version is 1.1 or greater.
-.P
-Internal formats other than 1, 2, 3, or 4 may be used only if the GL
-version is 1.1 or greater.
-.P
-In GL version 1.1 or greater, _param9 may be a null pointer.
-In this case texture memory is
-allocated to accommodate a texture of width _param4 and height _param5.
-You can then download subtextures to initialize this
-texture memory.
-The image is undefined if the user tries to apply
-an uninitialized portion of the texture image to a primitive.
-.P
-Formats _const(BGR), and _const(BGRA) and types
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV) are available only if the GL version
-is 1.2 or greater.
-.P
-When the _arbstring(multitexture) extension is supported, _cmnd
-specifies the two-dimensional texture for the current texture unit,
-specified with _cmnd(ActiveTextureARB).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not _const(TEXTURE_2D)
-or _const(PROXY_TEXTURE_2D).
-.P
-_const(INVALID_ENUM) is generated if _param7 is not an accepted
-format constant.
-Format constants other than _const(STENCIL_INDEX) and _const(DEPTH_COMPONENT)
-are accepted.
-.P
-_const(INVALID_ENUM) is generated if _param8 is not a type constant.
-.P
-_const(INVALID_ENUM) is generated if _param8 is _const(BITMAP) and
-_param7 is not _const(COLOR_INDEX).
-.P
-_const(INVALID_VALUE) is generated if _param2 is less than 0.
-.P
-_const(INVALID_VALUE) may be generated if _param2 is greater than $log
-sub 2$\f2max\fP,
-where \f2max\fP is the returned value of _const(MAX_TEXTURE_SIZE).
-.P
-_const(INVALID_VALUE) is generated if _param3 is not 1, 2, 3, 4, or one of the
-accepted resolution and format symbolic constants.
-.P
-_const(INVALID_VALUE) is generated if _param4 or _param5 is less than 0
-or greater than 2 + _const(MAX_TEXTURE_SIZE),
-or if either cannot be represented as $2 sup k ~+~ 2(_eqnparam6)$ for some
-integer value of \f2k\fP.
-.P
-_const(INVALID_VALUE) is generated if _param6 is not 0 or 1.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.P
-_const(INVALID_OPERATION) is generated if _param8 is one of
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5), or
-_const(UNSIGNED_SHORT_5_6_5_REV)
-and _param7 is not _const(RGB).
-.P
-_const(INVALID_OPERATION) is generated if _param8 is one of
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV)
-and _param7 is neither _const(RGBA) nor _const(BGRA).
-.SH ASSOCIATED GETS
-_cmnd(GetTexImage)
-.br
-_cmnd(IsEnabled) with argument _const(TEXTURE_2D)
-.SH SEE ALSO
-_cmnd(ColorTable),
-_cmnd(ConvolutionFilter2D),
-_cmnd(CopyPixels),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(DrawPixels),
-_cmnd(MatrixMode),
-_cmnd(PixelStore),
-_cmnd(PixelTransfer),
-_cmnd(SeparableFilter2D),
-_cmnd(TexEnv),
-_cmnd(TexGen),
-_cmnd(TexImage1D),
-_cmnd(TexImage3D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D),
-_cmnd(TexParameter)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/teximage3d.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/teximage3d.gl
deleted file mode 100755
index e857156cc..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/teximage3d.gl
+++ /dev/null
@@ -1,488 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(TexImage3D,specify a three-dimensional texture image)
-_names(TexImage3D)
-.EQ
-delim $$
-.EN
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__level>@,@<_param2>@)_C_
-_define(@<__internalformat>@,@<_param3>@)_C_
-_define(@<__width>@,@<_param4>@)_C_
-_define(@<__height>@,@<_param5>@)_C_
-_define(@<__depth>@,@<_param6>@)_C_
-_define(@<__border>@,@<_param7>@)_C_
-_define(@<__eqnborder>@,@<_eqnparam7>@)_C_
-_define(@<__format>@,@<_param8>@)_C_
-_define(@<__type>@,@<_param9>@)_C_
-_define(@<__pixels>@,@<_param10>@)_C_
-.SH PARAMETERS
-_phead(__target)
-Specifies the target texture.
-Must be _const(TEXTURE_3D) or _const(PROXY_TEXTURE_3D).
-_phead(__level)
-Specifies the level-of-detail number.
-Level 0 is the base image level.
-Level $n$ is the $n sup th$ mipmap reduction image.
-_phead(__internalformat)
-Specifies the number of color components in the texture.
-Must be 1, 2, 3, or 4, or one of the following symbolic constants:
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(INTENSITY),
-_const(INTENSITY4),
-_const(INTENSITY8),
-_const(INTENSITY12),
-_const(INTENSITY16),
-_const(R3_G3_B2),
-_const(RGB),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12), or
-_const(RGBA16).
-_phead(__width)
-Specifies the width of the texture image.
-Must be $2 sup n ~+~ 2 ( __eqnborder )$ for some integer $n$. All
-implementations support texture images that are at least 64 texels
-wide.
-_phead(__height)
-Specifies the height of the texture image.
-Must be $2 sup m ~+~ 2 ( __eqnborder )$ for some integer $m$. All
-implementations support texture images that are at least 64 texels
-high.
-_phead(__depth)
-Specifies the depth of the texture image.
-Must be $2 sup k ~+~ 2 ( __eqnborder )$ for some integer $k$. All
-implementations support texture images that are at least 64 texels
-deep.
-_phead(__border)
-Specifies the width of the border.
-Must be either 0 or 1.
-_phead(__format)
-Specifies the format of the pixel data.
-The following symbolic values are accepted:
-_const(COLOR_INDEX),
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(BGR),
-_const(RGBA),
-_const(BGRA),
-_C_ _const(ABGR_EXT),
-_const(LUMINANCE), and
-_const(LUMINANCE_ALPHA).
-_phead(__type)
-Specifies the data type of the pixel data.
-The following symbolic values are accepted:
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT)
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV).
-_phead(__pixels)
-Specifies a pointer to the image data in memory.
-.SH DESCRIPTION
-Texturing maps a portion of a specified texture image
-onto each graphical primitive for which texturing is enabled.
-To enable and disable three-dimensional texturing, call _cmnd(Enable)
-and _cmnd(Disable) with argument _const(TEXTURE_3D).
-.P
-To define texture images, call _cmnd.
-The arguments describe the parameters of the texture image,
-such as height,
-width, depth,
-width of the border,
-level-of-detail number
-(see _cmnd(TexParameter)),
-and number of color components provided.
-The last three arguments describe how the image is represented in memory;
-they are identical to the pixel formats used for _cmnd(DrawPixels).
-.P
-If __target is _const(PROXY_TEXTURE_3D), no data is read from __pixels, but
-all of the texture image state is recalculated, checked for
-consistency, and checked
-against the implementation's capabilities. If the implementation cannot
-handle a texture of the requested texture size, it sets
-all of the image state to 0,
-but does not generate an error (see _cmnd(GetError)). To query for an
-entire mipmap array, use an image array level greater than or equal to
-1.
-.P
-If __target is _const(TEXTURE_3D),
-data is read from __pixels as a sequence of signed or unsigned bytes,
-shorts,
-or longs,
-or single-precision floating-point values,
-depending on __type.
-These values are grouped into sets of one,
-two,
-three,
-or four values,
-depending on __format,
-to form elements.
-If __type is _const(BITMAP),
-the data is considered as a string of unsigned bytes (and
-__format must be _const(COLOR_INDEX)).
-Each data byte is treated as eight 1-bit elements,
-with bit ordering determined by _const(UNPACK_LSB_FIRST)
-(see _cmnd(PixelStore)).
-.P
-The first element corresponds to the lower left corner of the texture
-image.
-Subsequent elements progress left-to-right through the remaining texels
-in the lowest row of the texture image, and then in successively higher
-rows of the texture image.
-The final element corresponds to the upper right corner of the texture
-image.
-.P
-__format determines the composition of each element in __pixels.
-It can assume one of eleven symbolic values:
-.TP 10
-_const(COLOR_INDEX)
-Each element is a single value,
-a color index.
-The GL converts it to fixed point
-(with an unspecified number of zero bits to the right of the binary point),
-shifted left or right depending on the value and sign of _const(INDEX_SHIFT),
-and added to _const(INDEX_OFFSET)
-(see
-.br
-_cmnd(PixelTransfer)).
-The resulting index is converted to a set of color components
-using the
-_const(PIXEL_MAP_I_TO_R),
-_const(PIXEL_MAP_I_TO_G),
-_const(PIXEL_MAP_I_TO_B), and
-_const(PIXEL_MAP_I_TO_A) tables,
-and clamped to the range [0,1].
-.TP
-_const(RED)
-Each element is a single red component.
-The GL converts it to floating point and assembles it into an RGBA element
-by attaching 0 for green and blue, and 1 for alpha.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(GREEN)
-Each element is a single green component.
-The GL converts it to floating point and assembles it into an RGBA element
-by attaching 0 for red and blue, and 1 for alpha.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(BLUE)
-Each element is a single blue component.
-The GL converts it to floating point and assembles it into an RGBA element
-by attaching 0 for red and green, and 1 for alpha.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(ALPHA)
-Each element is a single alpha component.
-The GL converts it to floating point and assembles it into an RGBA element
-by attaching 0 for red, green, and blue.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(RGB)
-.TP
-_const(BGR)
-Each element is an RGB triple.
-The GL converts it to floating point and assembles it into an RGBA element
-by attaching 1 for alpha.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see
-.br
-_cmnd(PixelTransfer)).
-.TP
-_const(RGBA)
-.TP
-_const(BGRA)
-_C_ .TP
-_C_ _const(ABGR_EXT)
-Each element contains all four components.
-Each component is multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(LUMINANCE)
-Each element is a single luminance value.
-The GL converts it to floating point,
-then assembles it into an RGBA element by replicating the luminance value
-three times for red, green, and blue and attaching 1 for alpha.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see _cmnd(PixelTransfer)).
-.TP
-_const(LUMINANCE_ALPHA)
-Each element is a luminance/alpha pair.
-The GL converts it to floating point,
-then assembles it into an RGBA element by replicating the luminance value
-three times for red, green, and blue.
-Each component is then multiplied by the signed scale factor _const(c_SCALE),
-added to the signed bias _const(c_BIAS),
-and clamped to the range [0,1]
-(see
-.br
-_cmnd(PixelTransfer)).
-.P
-Refer to the _cmnd(DrawPixels) reference page for a description of
-the acceptable values for the __type parameter.
-.P
-If an application wants to store the texture at a certain
-resolution or in a certain format, it can request the resolution
-and format with __internalformat. The GL will choose an internal
-representation that closely approximates that requested by __internalformat, but
-it may not match exactly.
-(The representations specified by _const(LUMINANCE),
-_const(LUMINANCE_ALPHA), _const(RGB),
-and _const(RGBA) must match exactly. The numeric values 1, 2, 3, and 4
-may also be used to specify the above representations.)
-.P
-Use the _const(PROXY_TEXTURE_3D) target to try out a resolution and
-format. The implementation will
-update and recompute its best match for the requested storage resolution
-and format. To then query this state, call
-_cmnd(GetTexLevelParameter).
-If the texture cannot be accommodated, texture state is set to 0.
-.P
-A one-component texture image uses only the red component of the RGBA
-color extracted from __pixels.
-A two-component image uses the R and A values.
-A three-component image uses the R, G, and B values.
-A four-component image uses all of the RGBA components.
-.SH NOTES
-Texturing has no effect in color index mode.
-.P
-The texture image can be represented by the same data formats
-as the pixels in a _cmnd(DrawPixels) command,
-except that _const(STENCIL_INDEX) and _const(DEPTH_COMPONENT)
-cannot be used.
-_cmnd(PixelStore) and _cmnd(PixelTransfer) modes affect texture images
-in exactly the way they affect _cmnd(DrawPixels).
-.P
-_C_ _const(ABGR_EXT) is
-_C_ part of the _extname(EXT_abgr) extension, not part of
-_C_ the core GL command set. If _extstring(EXT_abgr) is included
-_C_ in the string returned by _cmnd(GetString), when called with
-_C_ argument _const(EXTENSIONS), extension _extname(EXT_abgr) is
-_C_ supported by the GL.
-.P
-_cmnd is available only if the GL version is 1.2 or greater.
-.P
-Internal formats other than 1, 2, 3, or 4 may be used only if the GL
-version is 1.1 or greater.
-.P
-__pixels may be a null pointer.
-In this case texture memory is
-allocated to accommodate a texture of width __width, height __height,
-and depth __depth.
-You can then download subtextures to initialize this
-texture memory.
-The image is undefined if the user tries to apply
-an uninitialized portion of the texture image to a primitive.
-.P
-Formats _const(BGR), and _const(BGRA) and types
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV) are available only if the GL version
-is 1.2 or greater.
-.P
-When the _arbstring(multitexture) extension is supported, _cmnd
-specifies the three-dimensional texture for the current texture unit,
-specified with _cmnd(ActiveTextureARB).
-.P
-If the _arbstring(imaging) extension is supported, RGBA elements may
-also be processed by the imaging pipeline. The following stages may be
-applied to an RGBA color before color component clamping to the range
-[0,\ 1]:
-.TP 3
-1. Color component replacement by the color table specified for
-_const(COLOR_TABLE), if enabled. See _cmnd(ColorTable).
-.TP
-2. Color component replacement by the color table specified for
-_const(POST_CONVOLUTION_COLOR_TABLE), if enabled. See _cmnd(ColorTable).
-.TP
-3. Transformation by the color matrix. See _cmnd(MatrixMode).
-.TP
-4. RGBA components may be multiplied by _const(POST_COLOR_MATRIX_c_SCALE),
-and added to _const(POST_COLOR_MATRIX_c_BIAS), if enabled. See
-_cmnd(PixelTransfer).
-.TP
-5. Color component replacement by the color table specified for
-_const(POST_COLOR_MATRIX_COLOR_TABLE), if enabled. See
-_cmnd(ColorTable).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not _const(TEXTURE_3D)
-or _const(PROXY_TEXTURE_3D).
-.P
-_const(INVALID_ENUM) is generated if __format is not an accepted
-format constant.
-Format constants other than _const(STENCIL_INDEX) and _const(DEPTH_COMPONENT)
-are accepted.
-.P
-_const(INVALID_ENUM) is generated if __type is not a type constant.
-.P
-_const(INVALID_ENUM) is generated if __type is _const(BITMAP) and
-__format is not _const(COLOR_INDEX).
-.P
-_const(INVALID_VALUE) is generated if __level is less than 0.
-.P
-.P
-_const(INVALID_VALUE) may be generated if __level is greater than $log
-sub 2$\f2max\fP,
-where \f2max\fP is the returned value of _const(MAX_TEXTURE_SIZE).
-.P
-_const(INVALID_VALUE) is generated if __internalformat is not 1, 2, 3, 4, or one of the
-accepted resolution and format symbolic constants.
-.P
-_const(INVALID_VALUE) is generated if __width, __height, or __depth
-is less than 0 or greater than 2 + _const(MAX_TEXTURE_SIZE),
-or if either cannot be represented as $2 sup k ~+~ 2( __eqnborder )$ for some
-integer value of \f2k\fP.
-.P
-_const(INVALID_VALUE) is generated if __border is not 0 or 1.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.P
-_const(INVALID_OPERATION) is generated if _param9 is one of
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5), or
-_const(UNSIGNED_SHORT_5_6_5_REV)
-and _param8 is not _const(RGB).
-.P
-_const(INVALID_OPERATION) is generated if _param9 is one of
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV)
-and _param8 is neither _const(RGBA) nor _const(BGRA).
-.SH ASSOCIATED GETS
-_cmnd(GetTexImage)
-.br
-_cmnd(IsEnabled) with argument _const(TEXTURE_3D)
-.SH SEE ALSO
-_cmnd(ActiveTextureARB),
-_cmnd(CopyPixels),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(DrawPixels),
-_cmnd(PixelStore),
-_cmnd(PixelTransfer),
-_cmnd(TexEnv),
-_cmnd(TexGen),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D),
-_cmnd(TexParameter)
-
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/texparameter.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/texparameter.gl
deleted file mode 100755
index 47863ba2a..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/texparameter.gl
+++ /dev/null
@@ -1,335 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(TexParameter, set texture parameters)
-_names(TexParameter,[fi])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the target texture,
-which must be either _const(TEXTURE_1D), _const(TEXTURE_2D), or
-_const(TEXTURE_3D).
-_phead(_param2)
-Specifies the symbolic name of a single-valued texture parameter.
-_param2 can be one of the following:
-_const(TEXTURE_MIN_FILTER),
-_const(TEXTURE_MAG_FILTER),
-_const(TEXTURE_MIN_LOD),
-_const(TEXTURE_MAX_LOD),
-_const(TEXTURE_BASE_LEVEL),
-_const(TEXTURE_MAX_LEVEL),
-_const(TEXTURE_WRAP_S),
-_const(TEXTURE_WRAP_T),
-_const(TEXTURE_WRAP_R), or
-_const(TEXTURE_PRIORITY).
-_phead(_param3)
-Specifies the value of _param2.
-_names(TexParameter,[fi]v)
-.SH PARAMETERS
-_phead(_param1)
-Specifies the target texture,
-which must be either _const(TEXTURE_1D), _const(TEXTURE_2D) or
-_const(TEXTURE_3D).
-_phead(_param2)
-Specifies the symbolic name of a texture parameter.
-_param2 can be one of the following:
-_const(TEXTURE_MIN_FILTER),
-_const(TEXTURE_MAG_FILTER),
-_const(TEXTURE_MIN_LOD),
-_const(TEXTURE_MAX_LOD),
-_const(TEXTURE_BASE_LEVEL),
-_const(TEXTURE_MAX_LEVEL),
-_const(TEXTURE_WRAP_S),
-_const(TEXTURE_WRAP_T),
-_const(TEXTURE_WRAP_R),
-_const(TEXTURE_BORDER_COLOR), or
-_const(TEXTURE_PRIORITY).
-_phead(_param3)
-Specifies a pointer to an array where the value or values of _param2
-are stored.
-.SH DESCRIPTION
-Texture mapping is a technique that applies an image onto an object's surface
-as if the image were a decal or cellophane shrink-wrap.
-The image is created in texture space,
-with an ($s$, $t$) coordinate system.
-A texture is a one- or two-dimensional image and a set of parameters
-that determine how samples are derived from the image.
-.P
-_cmnd assigns the value or values in _param3 to the texture parameter
-specified as _param2.
-_param1 defines the target texture,
-either _const(TEXTURE_1D), _const(TEXTURE_2D), or _const(TEXTURE_3D).
-The following symbols are accepted in _param2:
-.TP 10
-_const(TEXTURE_MIN_FILTER)
-The texture minifying function is used whenever the pixel being textured
-maps to an area greater than one texture element.
-There are six defined minifying functions.
-Two of them use the nearest one or nearest four texture elements
-to compute the texture value.
-The other four use mipmaps.
-.IP
-A mipmap is an ordered set of arrays representing the same image
-at progressively lower resolutions.
-If the texture has dimensions $2 sup n ~times~ 2 sup m$, there are
-$ bold max ( n, m ) + 1 $ mipmaps.
-The first mipmap is the original texture,
-with dimensions $2 sup n ~times~ 2 sup m$.
-Each subsequent mipmap has dimensions $2 sup { k - 1 } ~times~ 2 sup { l - 1 }$,
-where $2 sup k ~times~ 2 sup l$ are the dimensions of the previous mipmap,
-until either $k ~=~ 0$ or $l~=~0$.
-At that point,
-subsequent mipmaps have dimension $ 1 ~times~ 2 sup { l - 1 } $
-or $ 2 sup { k - 1} ~times~ 1 $ until the final mipmap,
-which has dimension $1 ~times~ 1$.
-To define the mipmaps, call _cmnd(TexImage1D), _cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(CopyTexImage1D), or _cmnd(CopyTexImage2D)
-with the \f2level\fP argument indicating the order of the mipmaps.
-Level 0 is the original texture;
-level $ bold max ( n, m ) $ is the final $1 ~times~ 1$ mipmap.
-.IP
-_param3 supplies a function for minifying the texture as one of the following:
-.RS 10
-.TP 10
-_const(NEAREST)
-Returns the value of the texture element that is nearest
-(in Manhattan distance)
-to the center of the pixel being textured.
-.TP
-_const(LINEAR)
-Returns the weighted average of the four texture elements
-that are closest to the center of the pixel being textured.
-These can include border texture elements,
-depending on the values of _const(TEXTURE_WRAP_S) and _const(TEXTURE_WRAP_T),
-and on the exact mapping.
-.TP
-_const(NEAREST_MIPMAP_NEAREST)
-Chooses the mipmap that most closely matches the size of the pixel
-being textured and uses the _const(NEAREST) criterion
-(the texture element nearest to the center of the pixel)
-to produce a texture value.
-.TP
-_const(LINEAR_MIPMAP_NEAREST)
-Chooses the mipmap that most closely matches the size of the pixel
-being textured and uses the _const(LINEAR) criterion
-(a weighted average of the four texture elements that are closest
-to the center of the pixel)
-to produce a texture value.
-.TP
-_const(NEAREST_MIPMAP_LINEAR)
-Chooses the two mipmaps that most closely match the size of the pixel
-being textured and uses the _const(NEAREST) criterion
-(the texture element nearest to the center of the pixel)
-to produce a texture value from each mipmap.
-The final texture value is a weighted average of those two values.
-.TP
-_const(LINEAR_MIPMAP_LINEAR)
-Chooses the two mipmaps that most closely match the size of the pixel
-being textured and uses the _const(LINEAR) criterion
-(a weighted average of the four texture elements that are closest
-to the center of the pixel)
-to produce a texture value from each mipmap.
-The final texture value is a weighted average of those two values.
-.RE
-.IP
-As more texture elements are sampled in the minification process,
-fewer aliasing artifacts will be apparent.
-While the _const(NEAREST) and _const(LINEAR) minification functions can be
-faster than the other four,
-they sample only one or four texture elements to determine the texture value
-of the pixel being rendered and can produce moire patterns
-or ragged transitions.
-The initial value of _const(TEXTURE_MIN_FILTER) is
-_const(NEAREST_MIPMAP_LINEAR).
-.TP 10
-_const(TEXTURE_MAG_FILTER)
-The texture magnification function is used when the pixel being textured
-maps to an area less than or equal to one texture element.
-It sets the texture magnification function to either _const(NEAREST)
-or _const(LINEAR) (see below). _const(NEAREST) is generally faster
-than _const(LINEAR),
-but it can produce textured images with sharper edges
-because the transition between texture elements is not as smooth.
-The initial value of _const(TEXTURE_MAG_FILTER) is _const(LINEAR).
-.RS 10
-.TP 10
-_const(NEAREST)
-Returns the value of the texture element that is nearest
-(in Manhattan distance)
-to the center of the pixel being textured.
-.TP
-_const(LINEAR)
-Returns the weighted average of the four texture elements
-that are closest to the center of the pixel being textured.
-These can include border texture elements,
-depending on the values of _const(TEXTURE_WRAP_S) and _const(TEXTURE_WRAP_T),
-and on the exact mapping.
-.P
-.RE
-.P
-.TP 10
-_const(TEXTURE_MIN_LOD)
-Sets the minimum level-of-detail parameter. This floating-point value
-limits the selection of highest resolution mipmap (lowest mipmap
-level). The initial value is -1000.
-.P
-.TP 10
-_const(TEXTURE_MAX_LOD)
-Sets the maximum level-of-detail parameter. This floating-point value
-limits the selection of the lowest resolution mipmap (highest mipmap
-level). The initial value is 1000.
-.P
-.TP 10
-_const(TEXTURE_BASE_LEVEL)
-Specifies the index of the lowest defined mipmap level. This is an
-integer value. The initial value is 0.
-.P
-.TP 10
-_const(TEXTURE_MAX_LEVEL)
-Sets the index of the highest defined mipmap level. This is an integer
-value. The initial value is 1000.
-.P
-.TP 10
-_const(TEXTURE_WRAP_S)
-Sets the wrap parameter for texture coordinate $s$ to either
-_const(CLAMP), _const(CLAMP_TO_EDGE), or _const(REPEAT).
-_const(CLAMP) causes $s$ coordinates to be clamped to the range [0,1]
-and is useful for preventing wrapping artifacts when mapping
-a single image onto an object.
-_const(CLAMP_TO_EDGE) causes $s$ coordinates to be clamped to the range
-$left [ {1 over 2N}, 1 - {1 over 2N} right ]$, where $N$ is the size
-of the texture in the direction of clamping.
-_const(REPEAT) causes the integer part of the $s$ coordinate to be ignored;
-the GL uses only the fractional part,
-thereby creating a repeating pattern.
-Border texture elements are accessed only if wrapping is set to _const(CLAMP).
-Initially, _const(TEXTURE_WRAP_S) is set to _const(REPEAT).
-.P
-.TP 10
-_const(TEXTURE_WRAP_T)
-Sets the wrap parameter for texture coordinate $t$ to either
-_const(CLAMP), _const(CLAMP_TO_EDGE), or _const(REPEAT).
-See the discussion under _const(TEXTURE_WRAP_S).
-Initially, _const(TEXTURE_WRAP_T) is set to _const(REPEAT).
-.TP 10
-_const(TEXTURE_WRAP_R)
-Sets the wrap parameter for texture coordinate $r$ to either
-_const(CLAMP), _const(CLAMP_TO_EDGE), or _const(REPEAT).
-See the discussion under _const(TEXTURE_WRAP_S).
-Initially, _const(TEXTURE_WRAP_R) is set to _const(REPEAT).
-.TP
-_const(TEXTURE_BORDER_COLOR)
-Sets a border color.
-_param3 contains four values that comprise the RGBA color
-of the texture border.
-Integer color components are interpreted linearly such that the most
-positive integer maps to 1.0,
-and the most negative integer maps to -1.0.
-The values are clamped to the range [0,1] when they are specified.
-Initially, the border color is (0, 0, 0, 0).
-.TP 10
-_const(TEXTURE_PRIORITY)
-Specifies the texture residence priority of the currently bound texture.
-Permissible values are in the range [0,\ 1].
-See _cmnd(PrioritizeTextures) and _cmnd(BindTexture) for more information.
-.SH NOTES
-_const(TEXTURE_3D), _const(TEXTURE_MIN_LOD), _const(TEXTURE_MAX_LOD),
-_const(TEXTURE_BASE_LEVEL), and _const(TEXTURE_MAX_LEVEL) are only
-available if the GL version is 1.2 or greater.
-.P
-Suppose that a program has enabled texturing
-(by calling _cmnd(Enable)
-with argument _const(TEXTURE_1D), _const(TEXTURE_2D), or _const(TEXTURE_3D))
-and has set _const(TEXTURE_MIN_FILTER) to one of the functions
-that requires a mipmap.
-If either the dimensions of the texture images currently defined
-(with previous calls to _cmnd(TexImage1D), _cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(CopyTexImage1D), or _cmnd(CopyTexImage2D))
-do not follow the proper sequence for mipmaps
-(described above),
-or there are fewer texture images defined than are needed,
-or the set of texture images have differing numbers of texture components,
-then it is as if texture mapping were disabled.
-.P
-Linear filtering accesses the four nearest texture elements only in 2D
-textures.
-In 1D textures, linear filtering accesses the two nearest texture
-elements.
-.P
-When the _arbstring(multitexture) extension is supported, _cmnd
-specifies the texture parameters for the active texture unit, specified
-by calling _cmnd(ActiveTextureARB).
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 or _param2 is not
-one of the accepted defined values.
-.P
-_const(INVALID_ENUM) is generated if _param3 should have a defined
-constant value (based on the value of _param2) and does not.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.SH ASSOCIATED GETS
-_cmnd(GetTexParameter)
-.br
-_cmnd(GetTexLevelParameter)
-.SH SEE ALSO
-_cmnd(ActiveTextureARB),
-_cmnd(BindTexture),
-_cmnd(CopyPixels),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(DrawPixels),
-_cmnd(PixelStore),
-_cmnd(PixelTransfer),
-_cmnd(PrioritizeTextures),
-_cmnd(TexEnv),
-_cmnd(TexGen),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D)
-
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/texsubimage1d.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/texsubimage1d.gl
deleted file mode 100755
index 834f2a33b..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/texsubimage1d.gl
+++ /dev/null
@@ -1,212 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(TexSubImage1D,specify a one-dimensional texture subimage)
-_names(TexSubImage1D)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the target texture.
-Must be _const(TEXTURE_1D).
-_phead(_param2)
-Specifies the level-of-detail number.
-Level 0 is the base image level.
-Level \f2n\fP is the \f2n\fPth mipmap reduction image.
-_phead(_param3)
-Specifies a texel offset in the x direction within the texture array.
-_phead(_param4)
-Specifies the width of the texture subimage.
-_phead(_param5)
-Specifies the format of the pixel data.
-The following symbolic values are accepted:
-_const(COLOR_INDEX),
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(BGR),
-_const(RGBA),
-_const(BGRA),
-_C_ _const(ABGR_EXT),
-_const(LUMINANCE), and
-_const(LUMINANCE_ALPHA).
-_phead(_param6)
-Specifies the data type of the pixel data.
-The following symbolic values are accepted:
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV).
-_phead(_param7)
-Specifies a pointer to the image data in memory.
-.SH DESCRIPTION
-Texturing maps a portion of a specified texture image
-onto each graphical primitive for which texturing is enabled.
-To enable or disable one-dimensional texturing, call _cmnd(Enable)
-and _cmnd(Disable) with argument _const(TEXTURE_1D).
-.P
-_cmnd redefines a contiguous subregion of an existing one-dimensional
-texture image.
-The texels referenced by _param7 replace the portion of the
-existing texture array with x indices _param3 and
-$_eqnparam3~+~_eqnparam4~-~1$,inclusive.
-This region may not include any texels outside the range of the
-texture array as it was originally specified.
-It is not an error to specify a subtexture with width of 0, but
-such a specification has no effect.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-Texturing has no effect in color index mode.
-.P
-_cmnd(PixelStore) and _cmnd(PixelTransfer) modes affect texture images
-in exactly the way they affect _cmnd(DrawPixels).
-.P
-Formats _const(BGR), and _const(BGRA) and types
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV) are available only if the GL version
-is 1.2 or greater.
-.P
-When the _arbstring(multitexture) extension is supported, _cmnd
-specifies a one-dimensional sub texture for the current texture unit,
-specified with _cmnd(ActiveTextureARB).
-.P
-When the _arbstring(imaging) extension is supported, the RGBA components
-specified in _param7 may be processed by the imaging pipeline. See
-_cmnd(TexImage1D) for specific details.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not one of the
-allowable values.
-.P
-_const(INVALID_OPERATION) is generated if the texture array has not
-been defined by a previous _cmnd(TexImage1D) operation.
-.P
-_const(INVALID_VALUE) is generated if _param2 is less than 0.
-.P
-_const(INVALID_VALUE) may be generated if _param2 is greater
-than $log sub 2$\f2max\fP,
-where \f2max\fP is the returned value of _const(MAX_TEXTURE_SIZE).
-.P
-_const(INVALID_VALUE) is generated if $_eqnparam3 ~<~ ~-b$,
-or if $(_eqnparam3~+~_eqnparam4) ~>~ (w ~-~ b)$,
-where $w$ is the _const(TEXTURE_WIDTH), and $b$ is
-the width of the _const(TEXTURE_BORDER)
-of the texture image being modified.
-Note that $w$ includes twice the border width.
-.P
-_const(INVALID_VALUE) is generated if _param4 is less than 0.
-.P
-_const(INVALID_ENUM) is generated if _param5 is not an accepted
-format constant.
-.P
-_const(INVALID_ENUM) is generated if _param6 is not a type constant.
-.P
-_const(INVALID_ENUM) is generated if _param6 is _const(BITMAP) and
-_param5 is not _const(COLOR_INDEX).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.P
-_const(INVALID_OPERATION) is generated if _param6 is one of
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5), or
-_const(UNSIGNED_SHORT_5_6_5_REV)
-and _param5 is not _const(RGB).
-.P
-_const(INVALID_OPERATION) is generated if _param6 is one of
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV)
-and _param5 is neither _const(RGBA) nor _const(BGRA).
-.SH ASSOCIATED GETS
-_cmnd(GetTexImage)
-.br
-_cmnd(IsEnabled) with argument _const(TEXTURE_1D)
-.SH SEE ALSO
-_cmnd(ActiveTextureARB),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(DrawPixels),
-_cmnd(PixelStore),
-_cmnd(PixelTransfer),
-_cmnd(TexEnv),
-_cmnd(TexGen),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexParameter),
-_cmnd(TexSubImage2D),
-_cmnd(TexSubImage3D)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/texsubimage2d.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/texsubimage2d.gl
deleted file mode 100755
index b014f1f91..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/texsubimage2d.gl
+++ /dev/null
@@ -1,217 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(TexSubImage2D,specify a two-dimensional texture subimage)
-_names(TexSubImage2D)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the target texture.
-Must be _const(TEXTURE_2D).
-_phead(_param2)
-Specifies the level-of-detail number.
-Level 0 is the base image level.
-Level \f2n\fP is the \f2n\fPth mipmap reduction image.
-_phead(_param3)
-Specifies a texel offset in the x direction within the texture array.
-_phead(_param4)
-Specifies a texel offset in the y direction within the texture array.
-_phead(_param5)
-Specifies the width of the texture subimage.
-_phead(_param6)
-Specifies the height of the texture subimage.
-_phead(_param7)
-Specifies the format of the pixel data.
-The following symbolic values are accepted:
-_const(COLOR_INDEX),
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(BGR),
-_const(RGBA),
-_const(BGRA),
-_C_ _const(ABGR_EXT),
-_const(LUMINANCE), and
-_const(LUMINANCE_ALPHA).
-_phead(_param8)
-Specifies the data type of the pixel data.
-The following symbolic values are accepted:
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV).
-_phead(_param9)
-Specifies a pointer to the image data in memory.
-.SH DESCRIPTION
-Texturing maps a portion of a specified texture image
-onto each graphical primitive for which texturing is enabled.
-To enable and disable two-dimensional texturing, call _cmnd(Enable)
-and _cmnd(Disable) with argument _const(TEXTURE_2D).
-.P
-_cmnd redefines a contiguous subregion of an existing two-dimensional
-texture image.
-The texels referenced by _param9 replace the portion of the
-existing texture array with x indices _param3 and $_eqnparam3~+~_eqnparam5~-~1$,
-inclusive,
-and y indices _param4 and $_eqnparam4~+~_eqnparam6~-~1$, inclusive.
-This region may not include any texels outside the range of the
-texture array as it was originally specified.
-It is not an error to specify a subtexture with zero width or height, but
-such a specification has no effect.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-Texturing has no effect in color index mode.
-.P
-_cmnd(PixelStore) and _cmnd(PixelTransfer) modes affect texture images
-in exactly the way they affect _cmnd(DrawPixels).
-.P
-Formats _const(BGR), and _const(BGRA) and types
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV) are available only if the GL version
-is 1.2 or greater.
-.P
-When the _arbstring(multitexture) extension is supported, _cmnd
-specifies a two-dimensional sub texture for the current texture unit,
-specified with _cmnd(ActiveTextureARB).
-.P
-When the _arbstring(imaging) extension is supported, the RGBA components
-specified in _param9 may be processed by the imaging pipeline. See
-_cmnd(TexImage1D) for specific details.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if _param1 is not _const(TEXTURE_2D).
-.P
-_const(INVALID_OPERATION) is generated if the texture array has not
-been defined by a previous _cmnd(TexImage2D) operation.
-.P
-_const(INVALID_VALUE) is generated if _param2 is less than 0.
-.P
-_const(INVALID_VALUE) may be generated if _param2 is greater
-than $log sub 2$\f2max\fP,
-where \f2max\fP is the returned value of _const(MAX_TEXTURE_SIZE).
-.P
-_const(INVALID_VALUE) is generated if $_eqnparam3 ~<~ ~-b$,
-$(_eqnparam3~+~_eqnparam5) ~>~ (w~-~b)$,
-$_eqnparam4 ~<~ ~-b$, or $(_eqnparam4 ~+~ _eqnparam6) ~>~ (h~-~b)$,
-where $w$ is the _const(TEXTURE_WIDTH),
-$h$ is the _const(TEXTURE_HEIGHT), and $b$ is the border width
-of the texture image being modified.
-Note that $w$ and $h$ include twice the border width.
-.P
-_const(INVALID_VALUE) is generated if _param5 or _param6 is less than 0.
-.P
-_const(INVALID_ENUM) is generated if _param7 is not an accepted
-format constant.
-.P
-_const(INVALID_ENUM) is generated if _param8 is not a type constant.
-.P
-_const(INVALID_ENUM) is generated if _param8 is _const(BITMAP) and
-_param7 is not _const(COLOR_INDEX).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.P
-_const(INVALID_OPERATION) is generated if _param8 is one of
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5), or
-_const(UNSIGNED_SHORT_5_6_5_REV)
-and _param7 is not _const(RGB).
-.P
-_const(INVALID_OPERATION) is generated if _param8 is one of
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV)
-and _param7 is neither _const(RGBA) nor _const(BGRA).
-.SH ASSOCIATED GETS
-_cmnd(GetTexImage)
-.br
-_cmnd(IsEnabled) with argument _const(TEXTURE_2D)
-.SH SEE ALSO
-_cmnd(ActiveTextureARB),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(DrawPixels),
-_cmnd(PixelStore),
-_cmnd(PixelTransfer),
-_cmnd(TexEnv),
-_cmnd(TexGen),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage3D),
-_cmnd(TexParameter)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/texsubimage3d.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/texsubimage3d.gl
deleted file mode 100755
index be4d509fd..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/texsubimage3d.gl
+++ /dev/null
@@ -1,241 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(TexSubImage3D,specify a three-dimensional texture subimage)
-_names(TexSubImage3D)
-.EQ
-delim $$
-.EN
-_define(@<__target>@,@<_param1>@)_C_
-_define(@<__level>@,@<_param2>@)_C_
-_define(@<__xoffset>@,@<_param3>@)_C_
-_define(@<__eqnxoffset>@,@<_eqnparam3>@)_C_
-_define(@<__yoffset>@,@<_param4>@)_C_
-_define(@<__eqnyoffset>@,@<_eqnparam4>@)_C_
-_define(@<__zoffset>@,@<_param5>@)_C_
-_define(@<__eqnzoffset>@,@<_eqnparam5>@)_C_
-_define(@<__width>@,@<_param6>@)_C_
-_define(@<__eqnwidth>@,@<_eqnparam6>@)_C_
-_define(@<__height>@,@<_param7>@)_C_
-_define(@<__eqnheight>@,@<_eqnparam7>@)_C_
-_define(@<__depth>@,@<_param8>@)_C_
-_define(@<__eqndepth>@,@<_eqnparam8>@)_C_
-_define(@<__format>@,@<_param9>@)_C_
-_define(@<__type>@,@<_param10>@)_C_
-_define(@<__pixels>@,@<_param11>@)_C_
-.SH PARAMETERS
-_phead(__target)
-Specifies the target texture.
-Must be _const(TEXTURE_3D).
-_phead(__level)
-Specifies the level-of-detail number.
-Level 0 is the base image level.
-Level \f2n\fP is the \f2n\fPth mipmap reduction image.
-_phead(__xoffset)
-Specifies a texel offset in the x direction within the texture array.
-_phead(__yoffset)
-Specifies a texel offset in the y direction within the texture array.
-_phead(__zoffset)
-Specifies a texel offset in the z direction within the texture array.
-_phead(__width)
-Specifies the width of the texture subimage.
-_phead(__height)
-Specifies the height of the texture subimage.
-_phead(__depth)
-Specifies the depth of the texture subimage.
-_phead(__format)
-Specifies the format of the pixel data.
-The following symbolic values are accepted:
-_const(COLOR_INDEX),
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(BGR),
-_const(RGBA),
-_const(BGRA),
-_C_ _const(ABGR_EXT),
-_const(LUMINANCE), and
-_const(LUMINANCE_ALPHA).
-_phead(__type)
-Specifies the data type of the pixel data.
-The following symbolic values are accepted:
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV).
-_phead(__pixels)
-Specifies a pointer to the image data in memory.
-.SH DESCRIPTION
-Texturing maps a portion of a specified texture image
-onto each graphical primitive for which texturing is enabled.
-To enable and disable three-dimensional texturing, call _cmnd(Enable)
-and _cmnd(Disable) with argument _const(TEXTURE_3D).
-.P
-_cmnd redefines a contiguous subregion of an existing three-dimensional
-texture image.
-The texels referenced by __pixels replace the portion of the
-existing texture array with x indices __xoffset and
-$__eqnxoffset ~+~ __eqnwidth ~-~ 1$, inclusive,
-y indices __yoffset and $__eqnyoffset ~+~ __eqnheight ~-~ 1$, inclusive,
-and z indices __zoffset and $__eqnzoffset ~+~ __eqndepth ~-~ 1$, inclusive.
-This region may not include any texels outside the range of the
-texture array as it was originally specified.
-It is not an error to specify a subtexture with zero width, height, or
-depth but such a specification has no effect.
-.SH NOTES
-_cmnd is available only if the GL version is 1.2 or greater.
-.P
-Texturing has no effect in color index mode.
-.P
-_cmnd(PixelStore) and _cmnd(PixelTransfer) modes affect texture images
-in exactly the way they affect _cmnd(DrawPixels).
-.P
-Formats _const(BGR), and _const(BGRA) and types
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV) are available only if the GL version
-is 1.2 or greater.
-.P
-When the _arbstring(multitexture) extension is supported, _cmnd
-specifies a three-dimensional sub texture for the current texture unit,
-specified with _cmnd(ActiveTextureARB).
-.P
-When the _arbstring(imaging) extension is supported, the RGBA components
-specified in __pixels may be processed by the imaging pipeline. See
-_cmnd(TexImage3D) for specific details.
-.SH ERRORS
-_const(INVALID_ENUM) is generated if __target is not _const(TEXTURE_3D).
-.P
-_const(INVALID_OPERATION) is generated if the texture array has not
-been defined by a previous _cmnd(TexImage3D) operation.
-.P
-_const(INVALID_VALUE) is generated if __level is less than 0.
-.P
-_const(INVALID_VALUE) may be generated if __level is greater
-than $log sub 2$\f2max\fP,
-where \f2max\fP is the returned value of _const(MAX_TEXTURE_SIZE).
-.P
-_const(INVALID_VALUE) is generated if $__eqnxoffset ~<~ ~-b$,
-$(__eqnxoffset ~+~ __eqnwidth) ~>~ (w~-~b)$,
-$__eqnyoffset ~<~ ~-b$, or $(__eqnyoffset ~+~ __eqnheight) ~>~ (h~-~b)$,
-or $__eqnzoffset ~<~ ~-b$, or $(__eqnzoffset ~+~ __eqndepth) ~>~ (d~-~b)$,
-where $w$ is the _const(TEXTURE_WIDTH),
-$h$ is the _const(TEXTURE_HEIGHT), $d$ is the _const(TEXTURE_DEPTH)
-and $b$ is the border width of the texture image being modified.
-Note that $w$, $h$, and $d$ include twice the border width.
-.P
-_const(INVALID_VALUE) is generated if __width, __height, or __depth
-is less than 0.
-.P
-_const(INVALID_ENUM) is generated if __format is not an accepted
-format constant.
-.P
-_const(INVALID_ENUM) is generated if __type is not a type constant.
-.P
-_const(INVALID_ENUM) is generated if __type is _const(BITMAP) and
-__format is not _const(COLOR_INDEX).
-.P
-_const(INVALID_OPERATION) is generated if _cmnd is executed
-between the execution of _cmnd(Begin) and the corresponding
-execution of _cmnd(End).
-.P
-_const(INVALID_OPERATION) is generated if __type is one of
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5), or
-_const(UNSIGNED_SHORT_5_6_5_REV)
-and __format is not _const(RGB).
-.P
-_const(INVALID_OPERATION) is generated if __type is one of
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV)
-and __format is neither _const(RGBA) nor _const(BGRA).
-.SH ASSOCIATED GETS
-_cmnd(GetTexImage)
-.br
-_cmnd(IsEnabled) with argument _const(TEXTURE_3D)
-.SH SEE ALSO
-_cmnd(ActiveTextureARB),
-_cmnd(CopyTexImage1D),
-_cmnd(CopyTexImage2D),
-_cmnd(CopyTexSubImage1D),
-_cmnd(CopyTexSubImage2D),
-_cmnd(CopyTexSubImage3D),
-_cmnd(DrawPixels),
-_cmnd(PixelStore),
-_cmnd(PixelTransfer),
-_cmnd(TexEnv),
-_cmnd(TexGen),
-_cmnd(TexImage1D),
-_cmnd(TexImage2D),
-_cmnd(TexImage3D),
-_cmnd(TexSubImage1D),
-_cmnd(TexSubImage2D),
-_cmnd(TexParameter)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/translate.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/translate.gl
deleted file mode 100755
index 4b42d45a4..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/translate.gl
+++ /dev/null
@@ -1,94 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Translate,multiply the current matrix by a translation matrix)
-_names(Translate,[df])
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1 _param2 _param3)
-Specify the \f2x\fP, \f2y\fP, and \f2z\fP coordinates of a translation vector.
-.SH DESCRIPTION
-_cmnd produces a translation by
-$(_eqnparam1,_eqnparam2,_eqnparam3)$.
-The current matrix
-(see
-.br
-_cmnd(MatrixMode))
-is multiplied by this translation matrix,
-with the product replacing the current matrix, as if
-_cmnd(MultMatrix) were called with the following matrix
-for its argument:
-.sp
-.ce
-.EQ
-left ( ~ down 20 matrix {
- ccol { 1~~ above 0~~ above 0~~ above 0~~ }
- ccol { 0~~ above 1~~ above 0~~ above 0~~ }
- ccol { 0~~ above 0~~ above 1~~ above 0~~ }
- ccol { _eqnparam1~ above _eqnparam2~ above _eqnparam3~ above 1}
-} ~~right )
-.EN
-.sp
-.RE
-If the matrix mode is either _const(MODELVIEW) or _const(PROJECTION),
-all objects drawn after a call to _cmnd are translated.
-.P
-Use _cmnd(PushMatrix) and
-_cmnd(PopMatrix) to save and restore
-the untranslated coordinate system.
-.SH ERRORS
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.bp
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(MATRIX_MODE)
-.br
-_cmnd(Get) with argument _const(COLOR_MATRIX)
-.br
-_cmnd(Get) with argument _const(MODELVIEW_MATRIX)
-.br
-_cmnd(Get) with argument _const(PROJECTION_MATRIX)
-.br
-_cmnd(Get) with argument _const(TEXTURE_MATRIX)
-.SH SEE ALSO
-_cmnd(MatrixMode),
-_cmnd(MultMatrix),
-_cmnd(PushMatrix),
-_cmnd(Rotate),
-_cmnd(Scale)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/vertex.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/vertex.gl
deleted file mode 100755
index a9ab1642f..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/vertex.gl
+++ /dev/null
@@ -1,76 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Vertex,specify a vertex)
-_names(Vertex,[234]u*[sifdb])
-.SH PARAMETERS
-_phead(_param1 _param2 _param3 _param4)
-Specify \f2x\fP, \f2y\fP, \f2z\fP, and \f2w\fP coordinates of a vertex.
-Not all parameters are present in all forms of the command.
-_names(Vertex,[234]u*[sifdb]v)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a pointer to an array of two, three, or four elements.
-The elements of a two-element array are \f2x\fP and \f2y\fP;
-of a three-element array, \f2x\fP, \f2y\fP, and \f2z\fP;
-and of a four-element array, \f2x\fP, \f2y\fP, \f2z\fP, and \f2w\fP.
-.SH DESCRIPTION
-_cmnd commands are used within _cmnd(Begin)/_cmnd(End) pairs to specify
-point, line, and polygon vertices.
-The current color,
-normal,
-and texture coordinates are associated with the vertex when _cmnd is called.
-.P
-When only \f2x\fP and \f2y\fP are specified,
-\f2z\fP defaults to 0 and \f2w\fP defaults to 1.
-When \f2x, y,\fP and \f2z\fP are specified,
-\f2w\fP defaults to 1.
-.SH NOTES
-Invoking _cmnd outside of a _cmnd(Begin)/_cmnd(End) pair
-results in undefined behavior.
-.SH SEE ALSO
-_cmnd(Begin),
-_cmnd(CallList),
-_cmnd(Color),
-_cmnd(EdgeFlag),
-_cmnd(EvalCoord),
-_cmnd(Index),
-_cmnd(Material),
-.br
-_cmnd(Normal),
-_cmnd(Rect),
-_cmnd(TexCoord),
-_cmnd(VertexPointer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/vertexpointer.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/vertexpointer.gl
deleted file mode 100755
index b03af49de..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/vertexpointer.gl
+++ /dev/null
@@ -1,143 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_C_ A real line follows.
-_define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_C_ Use GL not OpenGL
-_C_ Don't change the ordering of the main headers.
-_C_ C specification (or fortran) is handled automatically
-_C_ .TH is automatically added to the top of this file.
-_C_ Below, use current tense, active do not capitalize the first word and dont
-_C_ use a period.
-_C_ the function name must appear in (APIFILE) (usually gl.h) as set in
-_C_ Makefile.
-_header(VertexPointer,define an array of vertex data)
-_names(VertexPointer)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the number of coordinates per vertex; must be 2, 3, or
-4. The initial value is 4.
-_phead(_param2)
-Specifies the data type of each coordinate in the array.
-Symbolic constants
-_const(SHORT),
-_const(INT),
-_const(FLOAT),
-and _const(DOUBLE)
-are accepted. The initial value is _const(FLOAT).
-_phead(_param3)
-Specifies the byte offset between consecutive
-vertices. If _param3 is 0, the vertices are understood to be tightly packed in
-the array. The initial value
-is 0.
-_phead(_param4)
-Specifies a pointer to the first coordinate of the first vertex in the
-array. The initial value is 0.
-.SH DESCRIPTION
-_cmnd specifies the location and data format of an array of vertex coordinates
-to use when rendering.
-_param1 specifies the number of coordinates per vertex and
-_param2 the data type of
-the coordinates. _param3 specifies the byte stride from one
-vertex to the next allowing vertices and attributes
-to be packed into a single array or stored in separate arrays.
-(Single-array storage may be more efficient on some implementations;
-see _cmnd(InterleavedArrays).)
-When a vertex array is
-specified, _param1, _param2, _param3, and _param4 are saved as client-side
-state.
-.P
-To enable and disable the vertex array, call _cmnd(EnableClientState) and
-.br
-_cmnd(DisableClientState) with the argument _const(VERTEX_ARRAY). If
-enabled, the vertex array is used when
-_cmnd(DrawArrays), _cmnd(DrawElements), or _cmnd(ArrayElement) is called.
-.P
-Use _cmnd(DrawArrays) to construct a sequence of primitives (all of
-the same type)
-from prespecified vertex and vertex attribute arrays.
-Use _cmnd(ArrayElement) to specify primitives
-by indexing vertices and vertex attributes and _cmnd(DrawElements) to
-construct a sequence of primitives by indexing vertices and vertex attributes.
-.SH NOTES
-_cmnd is available only if the GL version is 1.1 or greater.
-.P
-The vertex array is initially disabled and isn't accessed when
-_cmnd(ArrayElement), _cmnd(DrawElements) or _cmnd(DrawArrays) is called.
-.P
-Execution of _cmnd is not allowed between the execution of
-_cmnd(Begin) and the corresponding execution of _cmnd(End),
-but an error may or may not be generated. If no error is generated,
-the operation is undefined.
-.P
-_cmnd is typically implemented on the client side.
-.P
-Vertex array parameters are client-side state and are therefore not
-saved or restored by _cmnd(PushAttrib) and _cmnd(PopAttrib).
-Use _cmnd(PushClientAttrib) and _cmnd(PopClientAttrib) instead.
-.SH ERRORS
-_const(INVALID_VALUE) is generated if _param1 is not 2, 3, or 4.
-.P
-_const(INVALID_ENUM) is generated if _param2 is is not an accepted value.
-.P
-_const(INVALID_VALUE) is generated if _param3 is negative.
-.SH ASSOCIATED GETS
-_cmnd(IsEnabled) with argument _const(VERTEX_ARRAY)
-.br
-_cmnd(Get) with argument _const(VERTEX_ARRAY_SIZE)
-.br
-_cmnd(Get) with argument _const(VERTEX_ARRAY_TYPE)
-.br
-_cmnd(Get) with argument _const(VERTEX_ARRAY_STRIDE)
-.br
-_cmnd(GetPointerv) with argument _const(VERTEX_ARRAY_POINTER)
-.SH SEE ALSO
-_cmnd(ArrayElement),
-_cmnd(ColorPointer),
-_cmnd(DrawArrays),
-_cmnd(DrawElements),
-_cmnd(DrawRangeElements),
-_cmnd(EdgeFlagPointer),
-_cmnd(Enable),
-_cmnd(GetPointerv),
-_cmnd(IndexPointer),
-_cmnd(InterleavedArrays),
-_cmnd(NormalPointer),
-_cmnd(PopClientAttrib),
-_cmnd(PushClientAttrib),
-_cmnd(TexCoordPointer)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/standard/viewport.gl b/xc/extras/ogl-sample/main/doc/man/mangl/standard/viewport.gl
deleted file mode 100755
index b923cb8e7..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/standard/viewport.gl
+++ /dev/null
@@ -1,84 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Viewport,set the viewport)
-_names(Viewport)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1 _param2)
-Specify the lower left corner of the viewport rectangle,
-in pixels. The initial value is (0,0).
-_phead(_param3 _param4)
-Specify the width and height
-of the viewport.
-When a GL context is first attached to a window,
-_param3 and _param4 are set to the dimensions of that window.
-.SH DESCRIPTION
-_cmnd specifies the affine transformation of $x$ and $y$ from
-normalized device coordinates to window coordinates.
-Let ($x sub nd$, $y sub nd$) be normalized device coordinates.
-Then the window coordinates ($x sub w$, $y sub w$) are computed as follows:
-.sp
-.ce
-.EQ
-x sub w ~=~ ( x sub nd ~+~ 1 ) left ( _eqnparam3 over 2 right ) ~+~ _eqnparam1
-.EN
-.sp
-.ce
-.EQ
-y sub w ~=~ ( y sub nd ~+~ 1 ) left ( _eqnparam4 over 2 right ) ~+~ _eqnparam2
-.EN
-.RE
-.P
-Viewport width and height are silently clamped
-to a range that depends on the implementation.
-To query this range, call _cmnd(Get) with argument
-_const(MAX_VIEWPORT_DIMS).
-.SH ERRORS
-_const(INVALID_VALUE) is generated if either _param3 or _param4 is negative.
-.P
-_const(INVALID_OPERATION) is generated if _cmnd
-is executed between the execution of _cmnd(Begin)
-and the corresponding execution of _cmnd(End).
-.bp
-.SH ASSOCIATED GETS
-_cmnd(Get) with argument _const(VIEWPORT)
-.br
-_cmnd(Get) with argument _const(MAX_VIEWPORT_DIMS)
-.SH SEE ALSO
-_cmnd(DepthRange)
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/style b/xc/extras/ogl-sample/main/doc/man/mangl/style
deleted file mode 100755
index 0624efff2..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/style
+++ /dev/null
@@ -1,4 +0,0 @@
-The template gives the basic style.
-
-Don't use 'expects' in paramter descriptions; doing so will make Mark
-unresponsible for his actions.
diff --git a/xc/extras/ogl-sample/main/doc/man/mangl/template b/xc/extras/ogl-sample/main/doc/man/mangl/template
deleted file mode 100755
index 204270b4f..000000000
--- a/xc/extras/ogl-sample/main/doc/man/mangl/template
+++ /dev/null
@@ -1,86 +0,0 @@
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_C_
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_
-_C_ _define(_filters,tbl|eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_C_
-_C_ Uncomment the next line if you need a different basename
-_C_ _define(@<_basename>@,specialName)_C_
-_C_
-_C_ Uncomment the next line if you want to change the 'same command' message
-_C_ _define(@<_samething>@,All these commands do the same thing.)_C_
-_C_
-_header(Color,one line description of command)
-_names(color,[0-9]u*[bsifd])
-.SH PARAMETERS
-_phead(_param1)
-Description of first parameter to _cmnd
-_phead(_param2)
-Description of second parameter
-...
-_phead(_paramN)
-Description of last parameter
-_names(color,[0-9]u*[bsifd]v)
-.SH PARAMETERS
-_phead(_param1)
-Description of 1st parameter of the second command form
-_samething
-.SH DESCRIPTION
-This command does something related to the GL.
-Its name is _cmnd.
-_param1 is the 1st argument for the last specified command form.
-So is (in this case) _param1(2).
-_param1(1) is the 1st parameter
-of the first command form of _cmnd.
-.SH EXAMPLES
-.Ex 5
- _cmnd\&(_param1, _param2, _paramN); /* Do something */
-.SH NOTES
-Use of the arguments _const(SILLY_VALUE) or _hex(ffe) may cause drowsiness.
-.SH ERRORS
-This command may cause errors. They cannot be detected.
-.SH ASSOCIATED GETS
-call foo with argument bar
-.br
-call foo2 with argument bar2
-.SH SEE ALSO
-_cmnd(c),
-_cmnd(clear),
-_cmnd(drawbitmap),
-_cmnd(n),
-_cmnd(v)
-.SH BUGS
-_cmnd is not actually implemented.
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/GNUmakefile b/xc/extras/ogl-sample/main/doc/man/manglu/GNUmakefile
deleted file mode 100755
index a1d590ceb..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/GNUmakefile
+++ /dev/null
@@ -1,55 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/doc/man/manglu/Attic/GNUmakefile,v 1.1.1.1 2001/03/19 17:45:27 dawes Exp $
-
-COMMONPREF = standard
-include $(ROOT)/usr/include/make/commondefs
-
-SUBDIRS = \
- standard \
- ftn \
- html \
- html_ftn \
- $(NULL)
-
-default $(ALLTARGS): $(_FORCE)
- $(SUBDIRS_MAKERULE)
-
-distoss:
- $(MAKE) $(COMMONPREF)$@
- $(SUBDIRS_MAKERULE)
-
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/ftn/Distfile b/xc/extras/ogl-sample/main/doc/man/manglu/ftn/Distfile
deleted file mode 100755
index d26feabc5..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/ftn/Distfile
+++ /dev/null
@@ -1,64 +0,0 @@
-#
-# $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/doc/man/manglu/ftn/Attic/Distfile,v 1.1.1.1 2001/03/19 17:45:27 dawes Exp $
-#
-
-DISTDIR_SI = /xc/doc/man/GL/glu_ftn
-
-DISTFILES_SI = \
- Imakefile \
- fglubegincurve.3gl \
- fglubeginpolygon.3gl \
- fglubeginsurface.3gl \
- fglubegintrim.3gl \
- fglubuild1dmipmaplevels.3gl \
- fglubuild1dmipmaps.3gl \
- fglubuild2dmipmaplevels.3gl \
- fglubuild2dmipmaps.3gl \
- fglubuild3dmipmaplevels.3gl \
- fglubuild3dmipmaps.3gl \
- fglucheckextension.3gl \
- fglucylinder.3gl \
- fgludeletenurbsrenderer.3gl \
- fgludeletequadric.3gl \
- fgludeletetess.3gl \
- fgludisk.3gl \
- fgluerrorstring.3gl \
- fglugetnurbsproperty.3gl \
- fglugetstring.3gl \
- fglugettessproperty.3gl \
- fgluloadsamplingmatrices.3gl \
- fglulookat.3gl \
- fglunewnurbsrenderer.3gl \
- fglunewquadric.3gl \
- fglunewtess.3gl \
- fglunextcontour.3gl \
- fglunurbscallback.3gl \
- fglunurbscallbackdata.3gl \
- fglunurbscallbackdataext.3gl \
- fglunurbscurve.3gl \
- fglunurbsproperty.3gl \
- fglunurbssurface.3gl \
- fgluortho2d.3gl \
- fglupartialdisk.3gl \
- fgluperspective.3gl \
- fglupickmatrix.3gl \
- fgluproject.3gl \
- fglupwlcurve.3gl \
- fgluquadriccallback.3gl \
- fgluquadricdrawstyle.3gl \
- fgluquadricnormals.3gl \
- fgluquadricorientation.3gl \
- fgluquadrictexture.3gl \
- fgluscaleimage.3gl \
- fglusphere.3gl \
- fglutessbegincontour.3gl \
- fglutessbeginpolygon.3gl \
- fglutesscallback.3gl \
- fglutessendpolygon.3gl \
- fglutessnormal.3gl \
- fglutessproperty.3gl \
- fglutessvertex.3gl \
- fgluunproject.3gl \
- fgluunproject4.3gl \
- $(NULL)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/ftn/GNUmakefile b/xc/extras/ogl-sample/main/doc/man/manglu/ftn/GNUmakefile
deleted file mode 100755
index e35750a47..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/ftn/GNUmakefile
+++ /dev/null
@@ -1,102 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/doc/man/manglu/ftn/Attic/GNUmakefile,v 1.1.1.1 2001/03/19 17:45:27 dawes Exp $
-
-# NOTES:
-# - The file "lor-c.mn" contains the source for the List of Routines section
-# of the C edition of the GL Reference Guide. The usual targets
-# lor-c.p, lor-c.ps, and lor-c.psv exist for it; however, it does not have
-# a .3g suffix because we don't want to include it as a on-line man page.
-# The file should be generated!!!
-
-COMMONPREF = standard
-include $(ROOT)/usr/include/make/commondefs
-
-DEPTH = ../..
-LANGOPT = f
-PREFIX = glu
-IDB_PATH = /usr/catman/g_man/cat3/standard
-
-MANPREF = man
-include $(DEPTH)/mandefs
-
-APIFILE = $(ROOT)/usr/include/GL/glu.h
-
-VERSION = Version 1.2
-DATE = 10 Nov 1998
-RELEASE = 1.0
-MMFLAGS = -rs2
-
-LEGALSUF1 = gl#
-LEGALSUF2 = gl#
-LEGALSUF3 = gl#
-LEGALSUF4 = gl#
-
-LOCALPRINTLISTFILTER = | sed -e '/^intro\.p$$/d' | (echo intro.p ; cat )
-
-default:
- $(MAKE) links
- $(MAKE) manpages
-
-headers headers_install libs libs_install install apps:
-
-distsi: default
- $(MAKE) $(COMMONPREF)$@
-
-distoss:
- $(MAKE) $(COMMONPREF)$@
-
-links:
- cd ../standard ; \
- for i in *.gl ; do \
- ( cd ../ftn ; if test ! -L fglu$$i ; then \
- /bin/ln -s ../standard/$$i fglu$$i; fi ) ; \
- done
-
-manpages: $(patsubst %.gl,%.3gl,$(wildcard *.gl))
-
-const.diff: const.awk *.gl $(ROOT)/usr/include/GL/gl.h
- awk -f const.awk $(ROOT)/usr/include/GL/gl.h *.gl | \
- sort | uniq > const.diff
-
-clean:
- rm -f *.gl
-
-clobber: clean
- rm -f *.3gl
-
-include $(DEPTH)/manrules
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/ftn/Imakefile b/xc/extras/ogl-sample/main/doc/man/manglu/ftn/Imakefile
deleted file mode 100755
index f321c491f..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/ftn/Imakefile
+++ /dev/null
@@ -1,216 +0,0 @@
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-#ifdef ManPageAlias
-#undef ManPageAlias
-#endif
-#define ManPageAlias(file,destdir,alias) @@\
-alias.$(MANSUFFIX): file.$(MANSUFFIX) @@\
- echo .so `basename destdir`/file.$(MANSUFFIX) > alias.$(MANSUFFIX) @@\
-
-MANSUFFIX = 3gl
-
-MAN_PAGES = \
-fgluBeginCurve.$(MANSUFFIX) fgluBeginPolygon.$(MANSUFFIX) \
-fgluBeginSurface.$(MANSUFFIX) fgluBeginTrim.$(MANSUFFIX) \
-fgluBuild1DMipmaps.$(MANSUFFIX) fgluBuild2DMipmaps.$(MANSUFFIX) \
-fgluCylinder.$(MANSUFFIX) fgluDeleteNurbsRenderer.$(MANSUFFIX) \
-fgluDeleteQuadric.$(MANSUFFIX) fgluDeleteTess.$(MANSUFFIX) \
-fgluDisk.$(MANSUFFIX) fgluEndCurve.$(MANSUFFIX) \
-fgluEndPolygon.$(MANSUFFIX) fgluEndSurface.$(MANSUFFIX) \
-fgluEndTrim.$(MANSUFFIX) fgluErrorString.$(MANSUFFIX) \
-fgluGetNurbsProperty.$(MANSUFFIX) fgluGetString.$(MANSUFFIX) \
-fgluGetTessProperty.$(MANSUFFIX) fgluLoadSamplingMatrices.$(MANSUFFIX) \
-fgluLookAt.$(MANSUFFIX) fgluNewNurbsRenderer.$(MANSUFFIX) \
-fgluNewQuadric.$(MANSUFFIX) fgluNewTess.$(MANSUFFIX) \
-fgluNextContour.$(MANSUFFIX) fgluNurbsCallback.$(MANSUFFIX) \
-fgluNurbsCallbackDataEXT.$(MANSUFFIX) fgluNurbsCurve.$(MANSUFFIX) \
-fgluNurbsProperty.$(MANSUFFIX) fgluNurbsSurface.$(MANSUFFIX) \
-fgluOrtho2D.$(MANSUFFIX) fgluPartialDisk.$(MANSUFFIX) \
-fgluPerspective.$(MANSUFFIX) fgluPickMatrix.$(MANSUFFIX) \
-fgluProject.$(MANSUFFIX) fgluPwlCurve.$(MANSUFFIX) \
-fgluQuadricCallback.$(MANSUFFIX) fgluQuadricDrawStyle.$(MANSUFFIX) \
-fgluQuadricNormals.$(MANSUFFIX) fgluQuadricOrientation.$(MANSUFFIX) \
-fgluQuadricTexture.$(MANSUFFIX) fgluScaleImage.$(MANSUFFIX) \
-fgluSphere.$(MANSUFFIX) fgluTessBeginContour.$(MANSUFFIX) \
-fgluTessBeginPolygon.$(MANSUFFIX) fgluTessCallback.$(MANSUFFIX) \
-fgluTessEndContour.$(MANSUFFIX) fgluTessEndPolygon.$(MANSUFFIX) \
-fgluTessNormal.$(MANSUFFIX) fgluTessProperty.$(MANSUFFIX) \
-fgluTessVertex.$(MANSUFFIX) fgluUnProject.$(MANSUFFIX)
-
-LINK_NAMES = \
-fgluBeginCurve.$(MANSUFFIX) fgluBeginPolygon.$(MANSUFFIX) \
-fgluBeginSurface.$(MANSUFFIX) fgluBeginTrim.$(MANSUFFIX) \
-fgluBuild1DMipmaps.$(MANSUFFIX) fgluBuild2DMipmaps.$(MANSUFFIX) \
-fgluCylinder.$(MANSUFFIX) fgluDeleteNurbsRenderer.$(MANSUFFIX) \
-fgluDeleteQuadric.$(MANSUFFIX) fgluDeleteTess.$(MANSUFFIX) \
-fgluDisk.$(MANSUFFIX) fgluErrorString.$(MANSUFFIX) \
-fgluGetNurbsProperty.$(MANSUFFIX) fgluGetString.$(MANSUFFIX) \
-fgluGetTessProperty.$(MANSUFFIX) fgluLoadSamplingMatrices.$(MANSUFFIX) \
-fgluLookAt.$(MANSUFFIX) fgluNewNurbsRenderer.$(MANSUFFIX) \
-fgluNewQuadric.$(MANSUFFIX) fgluNewTess.$(MANSUFFIX) \
-fgluNextContour.$(MANSUFFIX) fgluNurbsCallback.$(MANSUFFIX) \
-fgluNurbsCallbackDataEXT.$(MANSUFFIX) fgluNurbsCurve.$(MANSUFFIX) \
-fgluNurbsProperty.$(MANSUFFIX) fgluNurbsSurface.$(MANSUFFIX) \
-fgluOrtho2D.$(MANSUFFIX) fgluPartialDisk.$(MANSUFFIX) \
-fgluPerspective.$(MANSUFFIX) fgluPickMatrix.$(MANSUFFIX) \
-fgluProject.$(MANSUFFIX) fgluPwlCurve.$(MANSUFFIX) \
-fgluQuadricCallback.$(MANSUFFIX) fgluQuadricDrawStyle.$(MANSUFFIX) \
-fgluQuadricNormals.$(MANSUFFIX) fgluQuadricOrientation.$(MANSUFFIX) \
-fgluQuadricTexture.$(MANSUFFIX) fgluScaleImage.$(MANSUFFIX) \
-fgluSphere.$(MANSUFFIX) fgluTessBeginContour.$(MANSUFFIX) \
-fgluTessBeginPolygon.$(MANSUFFIX) fgluTessCallback.$(MANSUFFIX) \
-fgluTessEndPolygon.$(MANSUFFIX) fgluTessNormal.$(MANSUFFIX) \
-fgluTessProperty.$(MANSUFFIX) fgluTessVertex.$(MANSUFFIX) \
-fgluUnProject.$(MANSUFFIX)
-
-ALIAS_NAMES = \
-fgluEndCurve.$(MANSUFFIX) fgluEndPolygon.$(MANSUFFIX) \
-fgluEndSurface.$(MANSUFFIX) fgluEndTrim.$(MANSUFFIX) \
-fgluTessEndContour.$(MANSUFFIX)
-
-
-AllTarget($(MAN_PAGES))
-
-list:
- @for i in $(MAN_PAGES); do echo $$i; done;
-
-install_list:
- @for i in $(MAN_PAGES); do echo $(LIBMANDIR)/$$i; done;
-
-install:: install.man
-
-clean::
- $(RM) $(LINK_NAMES) $(ALIAS_NAMES)
-
-InstallMultipleMan($(MAN_PAGES),$(LIBMANDIR))
-
-LinkFile(fgluBeginCurve.$(MANSUFFIX), fglubegincurve.3gl)
-ManPageAlias(fgluBeginCurve, $(LIBMANDIR), fgluEndCurve)
-
-LinkFile(fgluBeginPolygon.$(MANSUFFIX), fglubeginpolygon.3gl)
-ManPageAlias(fgluBeginPolygon, $(LIBMANDIR), fgluEndPolygon)
-
-LinkFile(fgluBeginSurface.$(MANSUFFIX), fglubeginsurface.3gl)
-ManPageAlias(fgluBeginSurface, $(LIBMANDIR), fgluEndSurface)
-
-LinkFile(fgluBeginTrim.$(MANSUFFIX), fglubegintrim.3gl)
-ManPageAlias(fgluBeginTrim, $(LIBMANDIR), fgluEndTrim)
-
-LinkFile(fgluBuild1DMipmaps.$(MANSUFFIX), fglubuild1dmipmaps.3gl)
-
-LinkFile(fgluBuild2DMipmaps.$(MANSUFFIX), fglubuild2dmipmaps.3gl)
-
-LinkFile(fgluCylinder.$(MANSUFFIX), fglucylinder.3gl)
-
-LinkFile(fgluDeleteNurbsRenderer.$(MANSUFFIX), fgludeletenurbsrenderer.3gl)
-
-LinkFile(fgluDeleteQuadric.$(MANSUFFIX), fgludeletequadric.3gl)
-
-LinkFile(fgluDeleteTess.$(MANSUFFIX), fgludeletetess.3gl)
-
-LinkFile(fgluDisk.$(MANSUFFIX), fgludisk.3gl)
-
-LinkFile(fgluErrorString.$(MANSUFFIX), fgluerrorstring.3gl)
-
-LinkFile(fgluGetNurbsProperty.$(MANSUFFIX), fglugetnurbsproperty.3gl)
-
-LinkFile(fgluGetString.$(MANSUFFIX), fglugetstring.3gl)
-
-LinkFile(fgluGetTessProperty.$(MANSUFFIX), fglugettessproperty.3gl)
-
-LinkFile(fgluLoadSamplingMatrices.$(MANSUFFIX), fgluloadsamplingmatrices.3gl)
-
-LinkFile(fgluLookAt.$(MANSUFFIX), fglulookat.3gl)
-
-LinkFile(fgluNewNurbsRenderer.$(MANSUFFIX), fglunewnurbsrenderer.3gl)
-
-LinkFile(fgluNewQuadric.$(MANSUFFIX), fglunewquadric.3gl)
-
-LinkFile(fgluNewTess.$(MANSUFFIX), fglunewtess.3gl)
-
-LinkFile(fgluNextContour.$(MANSUFFIX), fglunextcontour.3gl)
-
-LinkFile(fgluNurbsCallback.$(MANSUFFIX), fglunurbscallback.3gl)
-
-LinkFile(fgluNurbsCallbackDataEXT.$(MANSUFFIX), fglunurbscallbackdataext.3gl)
-
-LinkFile(fgluNurbsCurve.$(MANSUFFIX), fglunurbscurve.3gl)
-
-LinkFile(fgluNurbsProperty.$(MANSUFFIX), fglunurbsproperty.3gl)
-
-LinkFile(fgluNurbsSurface.$(MANSUFFIX), fglunurbssurface.3gl)
-
-LinkFile(fgluOrtho2D.$(MANSUFFIX), fgluortho2d.3gl)
-
-LinkFile(fgluPartialDisk.$(MANSUFFIX), fglupartialdisk.3gl)
-
-LinkFile(fgluPerspective.$(MANSUFFIX), fgluperspective.3gl)
-
-LinkFile(fgluPickMatrix.$(MANSUFFIX), fglupickmatrix.3gl)
-
-LinkFile(fgluProject.$(MANSUFFIX), fgluproject.3gl)
-
-LinkFile(fgluPwlCurve.$(MANSUFFIX), fglupwlcurve.3gl)
-
-LinkFile(fgluQuadricCallback.$(MANSUFFIX), fgluquadriccallback.3gl)
-
-LinkFile(fgluQuadricDrawStyle.$(MANSUFFIX), fgluquadricdrawstyle.3gl)
-
-LinkFile(fgluQuadricNormals.$(MANSUFFIX), fgluquadricnormals.3gl)
-
-LinkFile(fgluQuadricOrientation.$(MANSUFFIX), fgluquadricorientation.3gl)
-
-LinkFile(fgluQuadricTexture.$(MANSUFFIX), fgluquadrictexture.3gl)
-
-LinkFile(fgluScaleImage.$(MANSUFFIX), fgluscaleimage.3gl)
-
-LinkFile(fgluSphere.$(MANSUFFIX), fglusphere.3gl)
-
-LinkFile(fgluTessBeginContour.$(MANSUFFIX), fglutessbegincontour.3gl)
-ManPageAlias(fgluTessBeginContour, $(LIBMANDIR), fgluTessEndContour)
-
-LinkFile(fgluTessBeginPolygon.$(MANSUFFIX), fglutessbeginpolygon.3gl)
-
-LinkFile(fgluTessCallback.$(MANSUFFIX), fglutesscallback.3gl)
-
-LinkFile(fgluTessEndPolygon.$(MANSUFFIX), fglutessendpolygon.3gl)
-
-LinkFile(fgluTessNormal.$(MANSUFFIX), fglutessnormal.3gl)
-
-LinkFile(fgluTessProperty.$(MANSUFFIX), fglutessproperty.3gl)
-
-LinkFile(fgluTessVertex.$(MANSUFFIX), fglutessvertex.3gl)
-
-LinkFile(fgluUnProject.$(MANSUFFIX), fgluunproject.3gl)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/ftn/f b/xc/extras/ogl-sample/main/doc/man/manglu/ftn/f
deleted file mode 100755
index c4b555609..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/ftn/f
+++ /dev/null
@@ -1 +0,0 @@
-.Op + f
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/html/Distfile b/xc/extras/ogl-sample/main/doc/man/manglu/html/Distfile
deleted file mode 100755
index f7c90c1be..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/html/Distfile
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/doc/man/manglu/html/Attic/Distfile,v 1.1.1.1 2001/03/19 17:45:27 dawes Exp $
-#
-
-DISTDIR_SI = /xc/doc/hardcopy/GL/html/glu
-
-DISTFILES_SI = \
- begincurve.html \
- beginpolygon.html \
- beginsurface.html \
- begintrim.html \
- build1dmipmaplevels.html \
- build1dmipmaps.html \
- build2dmipmaplevels.html \
- build2dmipmaps.html \
- build3dmipmaplevels.html \
- build3dmipmaps.html \
- checkextension.html \
- cylinder.html \
- deletenurbsrenderer.html \
- deletequadric.html \
- deletetess.html \
- disk.html \
- errorstring.html \
- getnurbsproperty.html \
- getstring.html \
- gettessproperty.html \
- loadsamplingmatrices.html \
- lookat.html \
- newnurbsrenderer.html \
- newquadric.html \
- newtess.html \
- nextcontour.html \
- nurbscallback.html \
- nurbscallbackdata.html \
- nurbscallbackdataext.html \
- nurbscurve.html \
- nurbsproperty.html \
- nurbssurface.html \
- ortho2d.html \
- partialdisk.html \
- perspective.html \
- pickmatrix.html \
- project.html \
- pwlcurve.html \
- quadriccallback.html \
- quadricdrawstyle.html \
- quadricnormals.html \
- quadricorientation.html \
- quadrictexture.html \
- scaleimage.html \
- sphere.html \
- tessbegincontour.html \
- tessbeginpolygon.html \
- tesscallback.html \
- tessendpolygon.html \
- tessnormal.html \
- tessproperty.html \
- tessvertex.html \
- unproject.html \
- unproject4.html \
- $(NULL)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/html/GNUmakefile b/xc/extras/ogl-sample/main/doc/man/manglu/html/GNUmakefile
deleted file mode 100755
index ad2697798..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/html/GNUmakefile
+++ /dev/null
@@ -1,68 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/doc/man/manglu/html/Attic/GNUmakefile,v 1.1.1.1 2001/03/19 17:45:27 dawes Exp $
-
-COMMONPREF = standard
-include $(ROOT)/usr/include/make/commondefs
-
-DEPTH = ../..
-LANGOPT = c
-PREFIX = gl
-MANSRC = ../standard
-
-MANPREF = man
-include $(DEPTH)/mandefs
-
-VPATH = $(shell cd $(MANSRC) ; pwd)
-
-default:
- $(MAKE) html
-
-headers headers_install libs libs_install install apps:
-
-distsi: default
- $(MAKE) $(COMMONPREF)$@
-
-distoss:
- $(MAKE) $(COMMONPREF)$@
-
-html: $(patsubst %.3gl,%.html,$(notdir $(wildcard $(MANSRC)/*.3gl)))
-
-clobber:
- rm -rf *.html
-
-include $(DEPTH)/manrules
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/html_ftn/Distfile b/xc/extras/ogl-sample/main/doc/man/manglu/html_ftn/Distfile
deleted file mode 100755
index 129251b86..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/html_ftn/Distfile
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/doc/man/manglu/html_ftn/Attic/Distfile,v 1.1.1.1 2001/03/19 17:45:27 dawes Exp $
-#
-
-DISTDIR_SI = /xc/doc/hardcopy/GL/html/glu_ftn
-
-DISTFILES_SI = \
- fglubegincurve.html \
- fglubeginpolygon.html \
- fglubeginsurface.html \
- fglubegintrim.html \
- fglubuild1dmipmaplevels.html \
- fglubuild1dmipmaps.html \
- fglubuild2dmipmaplevels.html \
- fglubuild2dmipmaps.html \
- fglubuild3dmipmaplevels.html \
- fglubuild3dmipmaps.html \
- fglucheckextension.html \
- fglucylinder.html \
- fgludeletenurbsrenderer.html \
- fgludeletequadric.html \
- fgludeletetess.html \
- fgludisk.html \
- fgluerrorstring.html \
- fglugetnurbsproperty.html \
- fglugetstring.html \
- fglugettessproperty.html \
- fgluloadsamplingmatrices.html \
- fglulookat.html \
- fglunewnurbsrenderer.html \
- fglunewquadric.html \
- fglunewtess.html \
- fglunextcontour.html \
- fglunurbscallback.html \
- fglunurbscallbackdata.html \
- fglunurbscallbackdataext.html \
- fglunurbscurve.html \
- fglunurbsproperty.html \
- fglunurbssurface.html \
- fgluortho2d.html \
- fglupartialdisk.html \
- fgluperspective.html \
- fglupickmatrix.html \
- fgluproject.html \
- fglupwlcurve.html \
- fgluquadriccallback.html \
- fgluquadricdrawstyle.html \
- fgluquadricnormals.html \
- fgluquadricorientation.html \
- fgluquadrictexture.html \
- fgluscaleimage.html \
- fglusphere.html \
- fglutessbegincontour.html \
- fglutessbeginpolygon.html \
- fglutesscallback.html \
- fglutessendpolygon.html \
- fglutessnormal.html \
- fglutessproperty.html \
- fglutessvertex.html \
- fgluunproject.html \
- fgluunproject4.html \
- $(NULL)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/html_ftn/GNUmakefile b/xc/extras/ogl-sample/main/doc/man/manglu/html_ftn/GNUmakefile
deleted file mode 100755
index 8caca69a6..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/html_ftn/GNUmakefile
+++ /dev/null
@@ -1,69 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/doc/man/manglu/html_ftn/Attic/GNUmakefile,v 1.1.1.1 2001/03/19 17:45:27 dawes Exp $
-
-COMMONPREF = standard
-include $(ROOT)/usr/include/make/commondefs
-
-DEPTH = ../..
-LANGOPT = c
-PREFIX = gl
-MANSRC = ../ftn
-
-MANPREF = man
-include $(DEPTH)/mandefs
-
-# Dependencies are in the man page source directory
-VPATH = $(shell cd $(MANSRC) ; pwd)
-
-default:
- $(MAKE) html
-
-headers headers_install libs libs_install install apps:
-
-distsi: default
- $(MAKE) $(COMMONPREF)$@
-
-distoss:
- $(MAKE) $(COMMONPREF)$@
-
-html: $(patsubst %.3gl,%.html,$(notdir $(wildcard $(MANSRC)/*.3gl)))
-
-clobber:
- rm -rf *.html
-
-include $(DEPTH)/manrules
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/Distfile b/xc/extras/ogl-sample/main/doc/man/manglu/standard/Distfile
deleted file mode 100755
index 8538de894..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/Distfile
+++ /dev/null
@@ -1,64 +0,0 @@
-#
-# $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/doc/man/manglu/standard/Attic/Distfile,v 1.1.1.1 2001/03/19 17:45:27 dawes Exp $
-#
-
-DISTDIR_SI = /xc/doc/man/GL/glu
-
-DISTFILES_SI = \
- Imakefile \
- begincurve.3gl \
- beginpolygon.3gl \
- beginsurface.3gl \
- begintrim.3gl \
- build1dmipmaplevels.3gl \
- build1dmipmaps.3gl \
- build2dmipmaplevels.3gl \
- build2dmipmaps.3gl \
- build3dmipmaplevels.3gl \
- build3dmipmaps.3gl \
- checkextension.3gl \
- cylinder.3gl \
- deletenurbsrenderer.3gl \
- deletequadric.3gl \
- deletetess.3gl \
- disk.3gl \
- errorstring.3gl \
- getnurbsproperty.3gl \
- getstring.3gl \
- gettessproperty.3gl \
- loadsamplingmatrices.3gl \
- lookat.3gl \
- newnurbsrenderer.3gl \
- newquadric.3gl \
- newtess.3gl \
- nextcontour.3gl \
- nurbscallback.3gl \
- nurbscallbackdata.3gl \
- nurbscallbackdataext.3gl \
- nurbscurve.3gl \
- nurbsproperty.3gl \
- nurbssurface.3gl \
- ortho2d.3gl \
- partialdisk.3gl \
- perspective.3gl \
- pickmatrix.3gl \
- project.3gl \
- pwlcurve.3gl \
- quadriccallback.3gl \
- quadricdrawstyle.3gl \
- quadricnormals.3gl \
- quadricorientation.3gl \
- quadrictexture.3gl \
- scaleimage.3gl \
- sphere.3gl \
- tessbegincontour.3gl \
- tessbeginpolygon.3gl \
- tesscallback.3gl \
- tessendpolygon.3gl \
- tessnormal.3gl \
- tessproperty.3gl \
- tessvertex.3gl \
- unproject.3gl \
- unproject4.3gl \
- $(NULL)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/GNUmakefile b/xc/extras/ogl-sample/main/doc/man/manglu/standard/GNUmakefile
deleted file mode 100755
index 685e8255d..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/GNUmakefile
+++ /dev/null
@@ -1,93 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/doc/man/manglu/standard/Attic/GNUmakefile,v 1.1.1.1 2001/03/19 17:45:27 dawes Exp $
-
-# NOTES:
-# - The file "lor-c.mn" contains the source for the List of Routines section
-# of the C edition of the GL Reference Guide. The usual targets
-# lor-c.p, lor-c.ps, and lor-c.psv exist for it; however, it does not have
-# a .3g suffix because we don't want to include it as a on-line man page.
-# The file should be generated!!!
-
-COMMONPREF = standard
-include $(ROOT)/usr/include/make/commondefs
-
-DEPTH = ../..
-LANGOPT = c
-PREFIX = glu
-IDB_PATH = /usr/catman/g_man/cat3/standard
-
-MANPREF = man
-include $(DEPTH)/mandefs
-
-APIFILE = $(ROOT)/usr/include/GL/glu.h
-
-VERSION = Version 1.2
-DATE = 6 March 1997
-RELEASE = 1.2.0
-MMFLAGS = -rs2
-
-LEGALSUF1 = 3g#
-LEGALSUF2 = 3g#
-LEGALSUF3 = 3g#
-LEGALSUF4 = 3g#
-
-LOCALPRINTLISTFILTER = | sed -e '/^intro\.p$$/d' | (echo intro.p ; cat )
-
-default:
- $(MAKE) manpages
-
-headers headers_install libs libs_install apps:
-
-distsi: default
- $(MAKE) $(COMMONPREF)$@
-
-distoss:
- $(MAKE) $(COMMONPREF)$@
-
-manpages: $(patsubst %.gl,%.3gl,$(wildcard *.gl))
-
-install: manpages
- for file in *.3gl; do \
- install -D -m 644 $$file ${ROOT}/usr/man/man3/glu`basename $$file .3gl`.3gl ; \
- done
-
-
-clobber:
- rm -f *.3gl
-
-include $(DEPTH)/manrules
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/Imakefile b/xc/extras/ogl-sample/main/doc/man/manglu/standard/Imakefile
deleted file mode 100755
index fa72cb85a..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/Imakefile
+++ /dev/null
@@ -1,216 +0,0 @@
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-#ifdef ManPageAlias
-#undef ManPageAlias
-#endif
-#define ManPageAlias(file,destdir,alias) @@\
-alias.$(MANSUFFIX): file.$(MANSUFFIX) @@\
- echo .so `basename destdir`/file.$(MANSUFFIX) > alias.$(MANSUFFIX) @@\
-
-MANSUFFIX = 3gl
-
-MAN_PAGES = \
-gluBeginCurve.$(MANSUFFIX) gluBeginPolygon.$(MANSUFFIX) \
-gluBeginSurface.$(MANSUFFIX) gluBeginTrim.$(MANSUFFIX) \
-gluBuild1DMipmaps.$(MANSUFFIX) gluBuild2DMipmaps.$(MANSUFFIX) \
-gluCylinder.$(MANSUFFIX) gluDeleteNurbsRenderer.$(MANSUFFIX) \
-gluDeleteQuadric.$(MANSUFFIX) gluDeleteTess.$(MANSUFFIX) \
-gluDisk.$(MANSUFFIX) gluEndCurve.$(MANSUFFIX) \
-gluEndPolygon.$(MANSUFFIX) gluEndSurface.$(MANSUFFIX) \
-gluEndTrim.$(MANSUFFIX) gluErrorString.$(MANSUFFIX) \
-gluGetNurbsProperty.$(MANSUFFIX) gluGetString.$(MANSUFFIX) \
-gluGetTessProperty.$(MANSUFFIX) gluLoadSamplingMatrices.$(MANSUFFIX) \
-gluLookAt.$(MANSUFFIX) gluNewNurbsRenderer.$(MANSUFFIX) \
-gluNewQuadric.$(MANSUFFIX) gluNewTess.$(MANSUFFIX) \
-gluNextContour.$(MANSUFFIX) gluNurbsCallback.$(MANSUFFIX) \
-gluNurbsCallbackDataEXT.$(MANSUFFIX) gluNurbsCurve.$(MANSUFFIX) \
-gluNurbsProperty.$(MANSUFFIX) gluNurbsSurface.$(MANSUFFIX) \
-gluOrtho2D.$(MANSUFFIX) gluPartialDisk.$(MANSUFFIX) \
-gluPerspective.$(MANSUFFIX) gluPickMatrix.$(MANSUFFIX) \
-gluProject.$(MANSUFFIX) gluPwlCurve.$(MANSUFFIX) \
-gluQuadricCallback.$(MANSUFFIX) gluQuadricDrawStyle.$(MANSUFFIX) \
-gluQuadricNormals.$(MANSUFFIX) gluQuadricOrientation.$(MANSUFFIX) \
-gluQuadricTexture.$(MANSUFFIX) gluScaleImage.$(MANSUFFIX) \
-gluSphere.$(MANSUFFIX) gluTessBeginContour.$(MANSUFFIX) \
-gluTessBeginPolygon.$(MANSUFFIX) gluTessCallback.$(MANSUFFIX) \
-gluTessEndContour.$(MANSUFFIX) gluTessEndPolygon.$(MANSUFFIX) \
-gluTessNormal.$(MANSUFFIX) gluTessProperty.$(MANSUFFIX) \
-gluTessVertex.$(MANSUFFIX) gluUnProject.$(MANSUFFIX)
-
-LINK_NAMES = \
-gluBeginCurve.$(MANSUFFIX) gluBeginPolygon.$(MANSUFFIX) \
-gluBeginSurface.$(MANSUFFIX) gluBeginTrim.$(MANSUFFIX) \
-gluBuild1DMipmaps.$(MANSUFFIX) gluBuild2DMipmaps.$(MANSUFFIX) \
-gluCylinder.$(MANSUFFIX) gluDeleteNurbsRenderer.$(MANSUFFIX) \
-gluDeleteQuadric.$(MANSUFFIX) gluDeleteTess.$(MANSUFFIX) \
-gluDisk.$(MANSUFFIX) gluErrorString.$(MANSUFFIX) \
-gluGetNurbsProperty.$(MANSUFFIX) gluGetString.$(MANSUFFIX) \
-gluGetTessProperty.$(MANSUFFIX) gluLoadSamplingMatrices.$(MANSUFFIX) \
-gluLookAt.$(MANSUFFIX) gluNewNurbsRenderer.$(MANSUFFIX) \
-gluNewQuadric.$(MANSUFFIX) gluNewTess.$(MANSUFFIX) \
-gluNextContour.$(MANSUFFIX) gluNurbsCallback.$(MANSUFFIX) \
-gluNurbsCallbackDataEXT.$(MANSUFFIX) gluNurbsCurve.$(MANSUFFIX) \
-gluNurbsProperty.$(MANSUFFIX) gluNurbsSurface.$(MANSUFFIX) \
-gluOrtho2D.$(MANSUFFIX) gluPartialDisk.$(MANSUFFIX) \
-gluPerspective.$(MANSUFFIX) gluPickMatrix.$(MANSUFFIX) \
-gluProject.$(MANSUFFIX) gluPwlCurve.$(MANSUFFIX) \
-gluQuadricCallback.$(MANSUFFIX) gluQuadricDrawStyle.$(MANSUFFIX) \
-gluQuadricNormals.$(MANSUFFIX) gluQuadricOrientation.$(MANSUFFIX) \
-gluQuadricTexture.$(MANSUFFIX) gluScaleImage.$(MANSUFFIX) \
-gluSphere.$(MANSUFFIX) gluTessBeginContour.$(MANSUFFIX) \
-gluTessBeginPolygon.$(MANSUFFIX) gluTessCallback.$(MANSUFFIX) \
-gluTessEndPolygon.$(MANSUFFIX) gluTessNormal.$(MANSUFFIX) \
-gluTessProperty.$(MANSUFFIX) gluTessVertex.$(MANSUFFIX) \
-gluUnProject.$(MANSUFFIX)
-
-ALIAS_NAMES = \
-gluEndCurve.$(MANSUFFIX) gluEndPolygon.$(MANSUFFIX) \
-gluEndSurface.$(MANSUFFIX) gluEndTrim.$(MANSUFFIX) \
-gluTessEndContour.$(MANSUFFIX)
-
-
-AllTarget($(MAN_PAGES))
-
-list:
- @for i in $(MAN_PAGES); do echo $$i; done;
-
-install_list:
- @for i in $(MAN_PAGES); do echo $(LIBMANDIR)/$$i; done;
-
-install:: install.man
-
-clean::
- $(RM) $(LINK_NAMES) $(ALIAS_NAMES)
-
-InstallMultipleMan($(MAN_PAGES),$(LIBMANDIR))
-
-LinkFile(gluBeginCurve.$(MANSUFFIX), begincurve.3gl)
-ManPageAlias(gluBeginCurve, $(LIBMANDIR), gluEndCurve)
-
-LinkFile(gluBeginPolygon.$(MANSUFFIX), beginpolygon.3gl)
-ManPageAlias(gluBeginPolygon, $(LIBMANDIR), gluEndPolygon)
-
-LinkFile(gluBeginSurface.$(MANSUFFIX), beginsurface.3gl)
-ManPageAlias(gluBeginSurface, $(LIBMANDIR), gluEndSurface)
-
-LinkFile(gluBeginTrim.$(MANSUFFIX), begintrim.3gl)
-ManPageAlias(gluBeginTrim, $(LIBMANDIR), gluEndTrim)
-
-LinkFile(gluBuild1DMipmaps.$(MANSUFFIX), build1dmipmaps.3gl)
-
-LinkFile(gluBuild2DMipmaps.$(MANSUFFIX), build2dmipmaps.3gl)
-
-LinkFile(gluCylinder.$(MANSUFFIX), cylinder.3gl)
-
-LinkFile(gluDeleteNurbsRenderer.$(MANSUFFIX), deletenurbsrenderer.3gl)
-
-LinkFile(gluDeleteQuadric.$(MANSUFFIX), deletequadric.3gl)
-
-LinkFile(gluDeleteTess.$(MANSUFFIX), deletetess.3gl)
-
-LinkFile(gluDisk.$(MANSUFFIX), disk.3gl)
-
-LinkFile(gluErrorString.$(MANSUFFIX), errorstring.3gl)
-
-LinkFile(gluGetNurbsProperty.$(MANSUFFIX), getnurbsproperty.3gl)
-
-LinkFile(gluGetString.$(MANSUFFIX), getstring.3gl)
-
-LinkFile(gluGetTessProperty.$(MANSUFFIX), gettessproperty.3gl)
-
-LinkFile(gluLoadSamplingMatrices.$(MANSUFFIX), loadsamplingmatrices.3gl)
-
-LinkFile(gluLookAt.$(MANSUFFIX), lookat.3gl)
-
-LinkFile(gluNewNurbsRenderer.$(MANSUFFIX), newnurbsrenderer.3gl)
-
-LinkFile(gluNewQuadric.$(MANSUFFIX), newquadric.3gl)
-
-LinkFile(gluNewTess.$(MANSUFFIX), newtess.3gl)
-
-LinkFile(gluNextContour.$(MANSUFFIX), nextcontour.3gl)
-
-LinkFile(gluNurbsCallback.$(MANSUFFIX), nurbscallback.3gl)
-
-LinkFile(gluNurbsCallbackDataEXT.$(MANSUFFIX), nurbscallbackdataext.3gl)
-
-LinkFile(gluNurbsCurve.$(MANSUFFIX), nurbscurve.3gl)
-
-LinkFile(gluNurbsProperty.$(MANSUFFIX), nurbsproperty.3gl)
-
-LinkFile(gluNurbsSurface.$(MANSUFFIX), nurbssurface.3gl)
-
-LinkFile(gluOrtho2D.$(MANSUFFIX), ortho2d.3gl)
-
-LinkFile(gluPartialDisk.$(MANSUFFIX), partialdisk.3gl)
-
-LinkFile(gluPerspective.$(MANSUFFIX), perspective.3gl)
-
-LinkFile(gluPickMatrix.$(MANSUFFIX), pickmatrix.3gl)
-
-LinkFile(gluProject.$(MANSUFFIX), project.3gl)
-
-LinkFile(gluPwlCurve.$(MANSUFFIX), pwlcurve.3gl)
-
-LinkFile(gluQuadricCallback.$(MANSUFFIX), quadriccallback.3gl)
-
-LinkFile(gluQuadricDrawStyle.$(MANSUFFIX), quadricdrawstyle.3gl)
-
-LinkFile(gluQuadricNormals.$(MANSUFFIX), quadricnormals.3gl)
-
-LinkFile(gluQuadricOrientation.$(MANSUFFIX), quadricorientation.3gl)
-
-LinkFile(gluQuadricTexture.$(MANSUFFIX), quadrictexture.3gl)
-
-LinkFile(gluScaleImage.$(MANSUFFIX), scaleimage.3gl)
-
-LinkFile(gluSphere.$(MANSUFFIX), sphere.3gl)
-
-LinkFile(gluTessBeginContour.$(MANSUFFIX), tessbegincontour.3gl)
-ManPageAlias(gluTessBeginContour, $(LIBMANDIR), gluTessEndContour)
-
-LinkFile(gluTessBeginPolygon.$(MANSUFFIX), tessbeginpolygon.3gl)
-
-LinkFile(gluTessCallback.$(MANSUFFIX), tesscallback.3gl)
-
-LinkFile(gluTessEndPolygon.$(MANSUFFIX), tessendpolygon.3gl)
-
-LinkFile(gluTessNormal.$(MANSUFFIX), tessnormal.3gl)
-
-LinkFile(gluTessProperty.$(MANSUFFIX), tessproperty.3gl)
-
-LinkFile(gluTessVertex.$(MANSUFFIX), tessvertex.3gl)
-
-LinkFile(gluUnProject.$(MANSUFFIX), unproject.3gl)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/begincurve.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/begincurve.gl
deleted file mode 100755
index df5202ee4..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/begincurve.gl
+++ /dev/null
@@ -1,79 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(BeginCurve, delimit a NURBS curve definition)
-_names(BeginCurve)
-_names(EndCurve,,noheader)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the NURBS object (created with _cmnd(NewNurbsRenderer)).
-.SH DESCRIPTION
-Use _cmnd(BeginCurve) to mark the beginning of a NURBS
-curve definition.
-After
-calling _cmnd(BeginCurve), make one or more calls to
-_cmnd(NurbsCurve) to define the attributes of the curve.
-Exactly one of the calls to _cmnd(NurbsCurve) must have
-a curve type of _const(MAP1_VERTEX_3) or _const(MAP1_VERTEX_4).
-To mark the end of the NURBS curve definition, call _cmnd(EndCurve).
-.P
-GL evaluators are used to render the NURBS curve as a series of line
-segments.
-Evaluator state is preserved during rendering
-with _glcmnd(PushAttrib)(_const(EVAL_BIT)) and
-_glcmnd(PopAttrib)().
-See the _glcmnd(PushAttrib) reference page for details on exactly what state
-these calls preserve.
-.SH EXAMPLE
-The following commands render a textured NURBS curve with normals;
-texture coordinates and normals are also specified as NURBS curves:
-.sp
-.Ex
-gluBeginCurve(nobj);
- gluNurbsCurve(nobj, ..., GL_MAP1_TEXTURE_COORD_2);
- gluNurbsCurve(nobj, ..., GL_MAP1_NORMAL);
- gluNurbsCurve(nobj, ..., GL_MAP1_VERTEX_4);
-gluEndCurve(nobj);
-.Ee
-.SH SEE ALSO
-_cmnd(BeginSurface), _cmnd(BeginTrim), _cmnd(NewNurbsRenderer),
-_cmnd(NurbsCurve),
-_glcmnd(PopAttrib), _glcmnd(PushAttrib)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/beginpolygon.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/beginpolygon.gl
deleted file mode 100755
index 74c7ac6c2..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/beginpolygon.gl
+++ /dev/null
@@ -1,89 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(BeginPolygon, delimit a polygon description)
-_names(BeginPolygon)
-_names(EndPolygon,,noheader)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the tessellation object (created with _cmnd(NewTess)).
-.SH DESCRIPTION
-_cmnd(BeginPolygon) and _cmnd(EndPolygon) delimit the definition of a
-nonconvex polygon.
-To define such a polygon, first call _cmnd(BeginPolygon).
-Then define the contours of the polygon
-by calling
-_cmnd(TessVertex) for each vertex
-and _cmnd(NextContour) to start each new contour.
-Finally, call _cmnd(EndPolygon)
-to signal the end of the definition.
-See the _cmnd(TessVertex) and
-_cmnd(NextContour) reference pages for more details.
-.P
-Once _cmnd(EndPolygon) is called, the polygon is tessellated, and the
-resulting triangles are described through callbacks.
-See _cmnd(TessCallback) for descriptions of the callback functions.
-.SH NOTES
-This command is obsolete and is provided for backward compatibility
-only. Calls to _cmnd(BeginPolygon) are mapped to
-_cmnd(TessBeginPolygon)
-followed by
-_cmnd(TessBeginContour). Calls to _cmnd(EndPolygon) are mapped
-to _cmnd(TessEndContour) followed by _cmnd(TessEndPolygon).
-.SH EXAMPLE
-A quadrilateral with a triangular hole in it can be described like this:
-.sp
-.Ex
-gluBeginPolygon(tobj);
- gluTessVertex(tobj, v1, v1);
- gluTessVertex(tobj, v2, v2);
- gluTessVertex(tobj, v3, v3);
- gluTessVertex(tobj, v4, v4);
-gluNextContour(tobj, GLU_INTERIOR);
- gluTessVertex(tobj, v5, v5);
- gluTessVertex(tobj, v6, v6);
- gluTessVertex(tobj, v7, v7);
-gluEndPolygon(tobj);
-.Ee
-.SH SEE ALSO
-_cmnd(NewTess), _cmnd(NextContour), _cmnd(TessCallback), _cmnd(TessVertex),
-_cmnd(TessBeginPolygon), _cmnd(TessBeginContour)
-
-
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/beginsurface.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/beginsurface.gl
deleted file mode 100755
index c5107c219..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/beginsurface.gl
+++ /dev/null
@@ -1,84 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(BeginSurface, delimit a NURBS surface definition)
-_names(BeginSurface)
-_names(EndSurface,,noheader)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the NURBS object (created with _cmnd(NewNurbsRenderer)).
-.SH DESCRIPTION
-Use _cmnd(BeginSurface) to mark the beginning of a NURBS
-surface definition. After
-calling _cmnd(BeginSurface), make one or more calls to
-_cmnd(NurbsSurface) to define the attributes of the surface.
-Exactly one of these calls to _cmnd(NurbsSurface) must have a
-surface type of _const(MAP2_VERTEX_3) or _const(MAP2_VERTEX_4).
-To mark the end of the NURBS surface definition, call
-_cmnd(EndSurface).
-.P
-Trimming of NURBS surfaces is supported with _cmnd(BeginTrim),
-_cmnd(PwlCurve), _cmnd(NurbsCurve), and _cmnd(EndTrim). See the
-_cmnd(BeginTrim) reference page for details.
-.P
-GL evaluators are used to render the NURBS surface as a set of polygons.
-Evaluator state is preserved during rendering
-with _glcmnd(PushAttrib)(_const(EVAL_BIT)) and
-_glcmnd(PopAttrib)().
-See the _glcmnd(PushAttrib) reference page for details on exactly what state
-these calls preserve.
-.SH EXAMPLE
-The following commands render a textured NURBS surface with normals;
-the texture coordinates and normals are also described as NURBS surfaces:
-.sp
-.Ex
-gluBeginSurface(nobj);
- gluNurbsSurface(nobj, ..., GL_MAP2_TEXTURE_COORD_2);
- gluNurbsSurface(nobj, ..., GL_MAP2_NORMAL);
- gluNurbsSurface(nobj, ..., GL_MAP2_VERTEX_4);
-gluEndSurface(nobj);
-.Ee
-.sp
-.SH SEE ALSO
-_cmnd(BeginCurve), _cmnd(BeginTrim), _cmnd(NewNurbsRenderer),
-_cmnd(NurbsCurve), _cmnd(NurbsSurface), _cmnd(PwlCurve)
-
-
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/begintrim.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/begintrim.gl
deleted file mode 100755
index f8ae1b453..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/begintrim.gl
+++ /dev/null
@@ -1,120 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(BeginTrim, delimit a NURBS trimming loop definition)
-_names(BeginTrim)
-_names(EndTrim,,noheader)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the NURBS object (created with _cmnd(NewNurbsRenderer)).
-.SH DESCRIPTION
-Use _cmnd(BeginTrim) to mark the beginning of a
-trimming loop, and _cmnd(EndTrim) to mark the end
-of a trimming loop. A trimming loop is
-a set of oriented curve segments (forming a closed curve) that
-define boundaries of a NURBS surface. You include these
-trimming loops in the definition of a NURBS
-surface, between calls to _cmnd(BeginSurface) and _cmnd(EndSurface).
-.P
-The definition for a NURBS surface can contain many
-trimming loops. For example, if you wrote a definition
-for a NURBS surface that resembled a rectangle with
-a hole punched out, the definition would contain two
-trimming loops. One loop would define the outer edge
-of the rectangle; the other would define
-the hole punched out of the rectangle. The definitions
-of each of these trimming loops would be bracketed by a
-_cmnd(BeginTrim)/_cmnd(EndTrim) pair.
-.P
-The definition of a single closed trimming loop can consist
-of multiple curve segments, each described as a piecewise
-linear curve (see _cmnd(PwlCurve)) or as a single NURBS
-curve (see _cmnd(NurbsCurve)), or as a combination of
-both in any order. The only library calls that can
-appear in a trimming loop definition (between the calls
-to _cmnd(BeginTrim) and _cmnd(EndTrim)) are
-_cmnd(PwlCurve) and _cmnd(NurbsCurve).
-.P
-The area of the NURBS surface that is displayed is the
-region in the domain to the left of the trimming curve
-as the curve parameter increases. Thus, the retained
-region of the NURBS surface is inside a
-counterclockwise trimming loop and outside a clockwise
-trimming loop. For the rectangle mentioned earlier,
-the trimming loop for the outer edge of the rectangle runs
-counterclockwise, while the trimming loop for the punched-out hole
-runs clockwise.
-.P
-If you use more than one curve to define a single trimming
-loop, the curve segments must form a closed loop (that is,
-the endpoint of each curve must be the starting point of the
-next curve, and the endpoint of the final curve must
-be the starting point of the first curve). If the
-endpoints of the curve are sufficiently close together
-but not exactly coincident, they will be coerced to match.
-If the endpoints are not sufficiently close, an error results
-(see _cmnd(NurbsCallback)).
-.P
-If a trimming loop definition contains multiple curves,
-the direction of the curves must be consistent (that is, the
-inside must be to the left of all of the curves). Nested
-trimming loops are legal as long as the curve orientations
-alternate correctly.
-If trimming curves are self-intersecting,
-or intersect one another, an error results.
-.P
-If no trimming information is given
-for a NURBS surface, the entire surface is drawn.
-.SH EXAMPLE
-This code fragment defines a trimming loop that consists of one
-piecewise linear curve, and two NURBS curves:
-.sp
-.Ex
-gluBeginTrim(nobj);
- gluPwlCurve(..., GLU_MAP1_TRIM_2);
- gluNurbsCurve(..., GLU_MAP1_TRIM_2);
- gluNurbsCurve(..., GLU_MAP1_TRIM_3);
-gluEndTrim(nobj);
-.Ee
-.SH SEE ALSO
-_cmnd(BeginSurface), _cmnd(NewNurbsRenderer), _cmnd(NurbsCallback),
-_cmnd(NurbsCurve), _cmnd(PwlCurve)
-
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/build1dmipmaplevels.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/build1dmipmaplevels.gl
deleted file mode 100755
index 5e156557d..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/build1dmipmaplevels.gl
+++ /dev/null
@@ -1,229 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Build1DMipmapLevels, builds a subset of one-dimensional mipmap levels)
-_names(Build1DMipmapLevels)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the target texture. Must be _const(TEXTURE_1D).
-_phead(_param2)
-Requests the internal storage format of the texture image. The most
-current version of the SGI implementation of GLU does not check this
-value for validity before passing it on to the underlying OpenGL
-implementation. A value that is not accepted by the OpenGL
-implementation will lead to an OpenGL error. The benefit of not
-checking this value at the GLU level is that OpenGL extensions can add
-new internal texture formats without requiring a revision of the GLU
-implementation. Older implementations of GLU check this value and
-raise a GLU error if it is not 1, 2, 3, or 4 or one of the following
-symbolic constants:
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(INTENSITY),
-_const(INTENSITY4),
-_const(INTENSITY8),
-_const(INTENSITY12),
-_const(INTENSITY16),
-_const(RGB),
-_const(R3_G3_B2),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12) or
-_const(RGBA16).
-_phead(_param3)
-Specifies the width in pixels of the texture image.
-This should be a power of 2.
-_phead(_param4)
-Specifies the format of the pixel data.
-Must be one of:
-_const(COLOR_INDEX),
-_const(DEPTH_COMPONENT),
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(RGBA),
-_const(BGR),
-_const(BGRA),
-_const(LUMINANCE), or
-_const(LUMINANCE_ALPHA).
-_phead(_param5)
-Specifies the data type for _param9.
-Must be one of: _const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV).
-_phead(_param6)
-Specifies the mipmap level of the image data.
-_phead(_param7)
-Specifies the minimum mipmap level to pass to _glcmnd(TexImage1D).
-_phead(_param8)
-Specifies the maximum mipmap level to pass to _glcmnd(TexImage1D).
-_phead(_param9)
-Specifies a pointer to the image data in memory.
-.SH DESCRIPTION
-_cmnd builds a subset of prefiltered one-dimensional texture maps of decreasing
-resolutions called a mipmap. This is used for the antialiasing of
-texture mapped primitives.
-.P
-A return value of zero indicates success, otherwise a GLU error code is
-returned (see _cmnd(ErrorString)).
-.P
-A series of mipmap levels from _param7 to _param8 is built by decimating
-_param9 in half
-until size $1 ~times~ 1$ is reached. At each level, each texel in the
-halved mipmap level is an average of the corresponding two texels in the larger
-mipmap level.
-_glcmnd(TexImage1D) is called to load these mipmap levels from _param7
-to _param8. If _param8 is larger than the highest mipmap level for the
-texture of the specified size, then a GLU error code is returned (see
-_cmnd(ErrorString)) and nothing is loaded.
-.P
-For example, if _param6 is 2 and _param3 is 16, the
-following levels are possible: $16 ~times~ 1$, $8 ~times~ 1$, $4 ~times~ 1$,
-$2 ~times~ 1$, $1 ~times~ 1$. These correspond
-to levels 2 through 6 respectively.
-If _param7 is 3 and _param8 is 5, then only mipmap levels $8 ~times~ 1$,
-$4 ~times~ 1$ and $2 ~times~ 1$ are
-loaded. However, if _param8 is 7 then an error is returned and nothing is
-loaded since _param8 is larger than the highest mipmap level which is, in
-this case, 6.
-.P
-The highest mipmap level can be derived from the formula
-${log sub 2} (_param3^{2 sup _param6})$.
-.P
-See the _glcmnd(TexImage1D) reference page for a description of the
-acceptable values for _param5 parameter. See the _glcmnd(DrawPixels)
-reference page for a description of the acceptable values
-for _param6 parameter.
-.bp
-.SH NOTES
-_cmnd is only available if the GLU version is 1.3 or greater.
-.P
-Formats _const(BGR), and _const(BGRA), and types
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV) are only available if the GL version
-is 1.2 or greater.
-.SH ERRORS
-_gluconst(INVALID_VALUE) is returned if _param6 > _param7, _param7 < 0,
-_param8 < _param7 or _param8 is > the highest mipmap level for _param9.
-.P
-_gluconst(INVALID_VALUE) is returned if _param3 is < 1.
-.P
-_gluconst(INVALID_ENUM) is returned if _param2, _param4, or _param5 are not
-legal.
-.P
-_gluconst(INVALID_OPERATION) is returned if _param5 is _const(UNSIGNED_BYTE_3_3_2) or _const(UNSIGNED_BYTE_2_3_3_REV)
-and _param4 is not _const(RGB).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param5 is _const(UNSIGNED_SHORT_5_6_5) or _const(UNSIGNED_SHORT_5_6_5_REV)
-and _param4 is not _const(RGB).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param5 is _const(UNSIGNED_SHORT_4_4_4_4) or _const(UNSIGNED_SHORT_4_4_4_4_REV)
-and _param4 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param5 is _const(UNSIGNED_SHORT_5_5_5_1) or _const(UNSIGNED_SHORT_1_5_5_5_REV)
-and _param4 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param5 is _const(UNSIGNED_INT_8_8_8_8) or _const(UNSIGNED_INT_8_8_8_8_REV)
-and _param4 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param5 is _const(UNSIGNED_INT_10_10_10_2) or _const(UNSIGNED_INT_2_10_10_10_REV)
-and _param4 is neither _const(RGBA) nor _const(BGRA).
-.SH SEE ALSO
-_glcmnd(DrawPixels), _glcmnd(TexImage1D), _glcmnd(TexImage2D),
-_glcmnd(TexImage3D),
-_cmnd(Build1DMipmaps), _cmnd(Build2DMipmaps), _cmnd(Build3DMipmaps),
-_cmnd(ErrorString),
-_glcmnd(GetTexImage),
-_glcmnd(GetTexLevelParameter),
-_cmnd(Build2DMipmapLevels), _cmnd(Build3DMipmapLevels)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/build1dmipmaps.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/build1dmipmaps.gl
deleted file mode 100755
index 1e81656de..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/build1dmipmaps.gl
+++ /dev/null
@@ -1,235 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Build1DMipmaps, builds a one-dimensional mipmap)
-_names(Build1DMipmaps)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the target texture. Must be _const(TEXTURE_1D).
-_phead(_param2)
-Requests the internal storage format of the texture image. The most
-current version of the SGI implementation of GLU does not check this
-value for validity before passing it on to the underlying OpenGL
-implementation. A value that is not accepted by the OpenGL
-implementation will lead to an OpenGL error. The benefit of not
-checking this value at the GLU level is that OpenGL extensions can add
-new internal texture formats without requiring a revision of the GLU
-implementation. Older implementations of GLU check this value and
-raise a GLU error if it is not 1, 2, 3, or 4 or one of the following
-symbolic constants:
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(INTENSITY),
-_const(INTENSITY4),
-_const(INTENSITY8),
-_const(INTENSITY12),
-_const(INTENSITY16),
-_const(RGB),
-_const(R3_G3_B2),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12), or
-_const(RGBA16).
-_phead(_param3)
-Specifies the width, in pixels, of the texture image.
-_phead(_param4)
-Specifies the format of the pixel data.
-Must be one of
-_const(COLOR_INDEX),
-_const(DEPTH_COMPONENT),
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(RGBA),
-_const(BGR),
-_const(BGRA),
-_const(LUMINANCE),
-_const(LUMINANCE_ALPHA).
-_phead(_param5)
-Specifies the data type for _param6.
-Must be one of
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV).
-_phead(_param6)
-Specifies a pointer to the image data in memory.
-.SH DESCRIPTION
-_cmnd builds a series of prefiltered one-dimensional texture maps of decreasing
-resolutions called a mipmap. This is used for the antialiasing of
-texture mapped primitives.
-.P
-A return value of zero indicates success, otherwise a GLU error code is
-returned (see _cmnd(ErrorString)).
-.P
-Initially, the _param3 of _param6 is checked to see if it is
-a power of 2. If not, a copy of _param6 is scaled up or down to the
-nearest power of 2. (If _param3 is exactly between powers of 2, then
-the copy of _param6 will scale upwards.) This copy will be used for
-subsequent mipmapping operations described below.
-For example, if _param3 is 57 then a copy of _param6
-will scale up to 64 before mipmapping
-takes place.
-.P
-Then, proxy textures (see _glcmnd(TexImage1D)) are used to determine if
-the implementation can fit the requested texture. If not, _param3 is
-continually halved until it fits.
-.P
-Next, a series of mipmap levels is built by decimating a copy of
-_param6 in half
-until size $1 ~times~ 1$ is reached. At each level, each texel in the
-halved mipmap level is an average of the corresponding two texels in the larger
-mipmap level.
-.P
-_glcmnd(TexImage1D) is called to load each of these mipmap levels.
-Level 0 is a copy of _param6.
-The highest level is ${log sub 2}(_param3)$.
-For example, if _param3 is 64 and the implementation can store a texture of
-this size, the following mipmap levels are
-built: $64 ~times~ 1$, $32 ~times~ 1$, $16 ~times~ 1$, $8 ~times~ 1$,
-$4 ~times~ 1$, $2 ~times~ 1$ and $1 ~times~ 1$. These correspond to
-levels 0 through 6, respectively.
-.P
-See the _glcmnd(TexImage1D) reference page for a description of the
-acceptable values for the _param5 parameter. See the _glcmnd(DrawPixels)
-reference page for a description of the acceptable values
-for the _param6 parameter.
-.SH NOTES
-Note that there is no direct way of querying the maximum level. This can
-be derived indirectly via _glcmnd(GetTexLevelParameter). First, query
-for the
-width actually used at level 0.
-(The width may not be equal to _param3 since
-proxy textures might have scaled it to fit the implementation.)
-Then the maximum
-level can be derived from the formula ${log sub 2}(_param3)$.
-.P
-Formats _const(BGR), and _const(BGRA), and types
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV) are only available if the GL version
-is 1.2 or greater, and if the GLU version is 1.3 or greater.
-.SH ERRORS
-_gluconst(INVALID_VALUE) is returned if _param3 is < 1.
-.P
-_gluconst(INVALID_ENUM) is returned if _param4 or _param5 are not legal.
-.P
-_gluconst(INVALID_OPERATION) is returned if _param5 is _const(UNSIGNED_BYTE_3_3_2) or _const(UNSIGNED_BYTE_2_3_3_REV)
-and _param4 is not _const(RGB).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param5 is _const(UNSIGNED_SHORT_5_6_5) or _const(UNSIGNED_SHORT_5_6_5_REV)
-and _param4 is not _const(RGB).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param5 is _const(UNSIGNED_SHORT_4_4_4_4) or _const(UNSIGNED_SHORT_4_4_4_4_REV)
-and _param4 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param5 is _const(UNSIGNED_SHORT_5_5_5_1) or _const(UNSIGNED_SHORT_1_5_5_5_REV)
-and _param4 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param5 is _const(UNSIGNED_INT_8_8_8_8) or _const(UNSIGNED_INT_8_8_8_8_REV)
-and _param4 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param5 is _const(UNSIGNED_INT_10_10_10_2) or _const(UNSIGNED_INT_2_10_10_10_REV)
-and _param4 is neither _const(RGBA) nor _const(BGRA).
-.SH SEE ALSO
-_glcmnd(DrawPixels),
-_glcmnd(TexImage1D),
-_glcmnd(TexImage2D),
-_glcmnd(TexImage3D),
-_cmnd(Build2DMipmaps),
-_cmnd(Build3DMipmaps),
-_cmnd(ErrorString),
-_glcmnd(GetTexImage),
-_glcmnd(GetTexLevelParameter),
-_cmnd(Build1DMipmapLevels),
-_cmnd(Build2DMipmapLevels),
-_cmnd(Build3DMipmapLevels)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/build2dmipmaplevels.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/build2dmipmaplevels.gl
deleted file mode 100755
index 7d06061b6..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/build2dmipmaplevels.gl
+++ /dev/null
@@ -1,234 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Build2DMipmapLevels, builds a subset of two-dimensional mipmap levels)
-_names(Build2DMipmapLevels)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the target texture. Must be _const(TEXTURE_2D).
-_phead(_param2)
-Requests the internal storage format of the texture image. The most
-current version of the SGI implementation of GLU does not check this
-value for validity before passing it on to the underlying OpenGL
-implementation. A value that is not accepted by the OpenGL
-implementation will lead to an OpenGL error. The benefit of not
-checking this value at the GLU level is that OpenGL extensions can add
-new internal texture formats without requiring a revision of the GLU
-implementation. Older implementations of GLU check this value and
-raise a GLU error if it is not 1, 2, 3, or 4 or one of the following
-symbolic constants:
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(INTENSITY),
-_const(INTENSITY4),
-_const(INTENSITY8),
-_const(INTENSITY12),
-_const(INTENSITY16),
-_const(RGB),
-_const(R3_G3_B2),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12) or
-_const(RGBA16).
-_phead(_param3 _param4)
-Specifies the width and height, respectively, in pixels of the texture image.
-These should be a power of 2.
-_phead(_param5)
-Specifies the format of the pixel data.
-Must be one of
-_const(COLOR_INDEX),
-_const(DEPTH_COMPONENT),
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(RGBA),
-_const(BGR),
-_const(BGRA),
-_const(LUMINANCE), or
-_const(LUMINANCE_ALPHA).
-_phead(_param6)
-Specifies the data type for _param10.
-Must be one of
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2) or
-_const(UNSIGNED_INT_2_10_10_10_REV).
-_phead(_param7)
-Specifies the mipmap level of the image data.
-_phead(_param8)
-Specifies the minimum mipmap level to pass to _glcmnd(TexImage2D).
-_phead(_param9)
-Specifies the maximum mipmap level to pass to _glcmnd(TexImage2D).
-_phead(_param10)
-Specifies a pointer to the image data in memory.
-.SH DESCRIPTION
-_cmnd builds a subset of prefiltered two-dimensional texture maps of decreasing
-resolutions called a mipmap. This is used for the antialiasing of
-texture mapped primitives.
-.P
-A return value of zero indicates success, otherwise a GLU error code is
-returned (see _cmnd(ErrorString)).
-.P
-A series of mipmap levels from _param8 to _param9 is built by decimating
-_param10 in half along
-both dimensions until size $1 ~times~ 1$ is reached. At each level, each texel in the
-halved mipmap level is an average of the corresponding four texels in the larger
-mipmap level. (In the case of rectangular images, the decimation will ultimately
-reach an $N ~times~ 1$ or $1 ~times~ N$ configuration. Here, two texels are
-averaged instead.)
-_glcmnd(TexImage2D) is called to load these mipmap levels from _param8
-to _param9. If _param9 is larger than the highest mipmap level for the
-texture of the specified size, then a GLU error code is returned (see
-_cmnd(ErrorString)) and nothing is loaded.
-.P
-For example, if _param7 is 2 and _param3 is 16 and _param4 is 8, the
-following levels are possible: $16 ~times~ 8$, $8 ~times~ 4$, $4 ~times~ 2$,
-$2 ~times~ 1$, $1 ~times~ 1$. These correspond to levels 2 through 6
-respectively. If _param8 is 3 and _param9 is 5, then only mipmap levels
-$8 ~times~ 4$, $4 ~times~ 2$ and $2 ~times~ 1$ are loaded. However, if _param9
-is 7 then an error is returned and nothing is loaded since _param9 is
-larger than the highest mipmap level which is, in this case, 6.
-.P
-The highest mipmap level can be derived from the formula
-log2(max(_param3,_param4)*(2^_param7)).
-.P
-See the _glcmnd(TexImage1D) reference page for a description of the
-acceptable values for _param5 parameter. See the _glcmnd(DrawPixels)
-reference page for a description of the acceptable values
-for _param6 parameter.
-.SH NOTES
-_cmnd is only available if the GLU version is 1.3 or greater.
-.P
-Formats _const(BGR), and _const(BGRA), and types
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV) are only available if the GL version
-is 1.2 or greater.
-.SH ERRORS
-_gluconst(INVALID_VALUE) is returned if _param7 > _param8, _param8 < 0,
-_param9 < _param8 or _param9 is > the highest mipmap level for _param10.
-.P
-_gluconst(INVALID_VALUE) is returned if _param3 or _param4 is < 1.
-.P
-_gluconst(INVALID_ENUM) is returned if _param2, _param5, or _param6 is not
-legal.
-.P
-_gluconst(INVALID_OPERATION) is returned if _param6 is _const(UNSIGNED_BYTE_3_3_2) or _const(UNSIGNED_BYTE_2_3_3_REV)
-and _param5 is not _const(RGB).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param6 is _const(UNSIGNED_SHORT_5_6_5) or _const(UNSIGNED_SHORT_5_6_5_REV)
-and _param5 is not _const(RGB).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param6 is _const(UNSIGNED_SHORT_4_4_4_4) or _const(UNSIGNED_SHORT_4_4_4_4_REV)
-and _param5 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param6 is _const(UNSIGNED_SHORT_5_5_5_1) or _const(UNSIGNED_SHORT_1_5_5_5_REV)
-and _param5 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param6 is _const(UNSIGNED_INT_8_8_8_8) or _const(UNSIGNED_INT_8_8_8_8_REV)
-and _param5 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param6 is _const(UNSIGNED_INT_10_10_10_2) or _const(UNSIGNED_INT_2_10_10_10_REV)
-and _param5 is neither _const(RGBA) nor _const(BGRA).
-.SH SEE ALSO
-_glcmnd(DrawPixels),
-_glcmnd(TexImage1D),
-_glcmnd(TexImage2D),
-_glcmnd(TexImage3D),
-_cmnd(Build1DMipmaps),
-_cmnd(Build2DMipmaps),
-_cmnd(Build3DMipmaps),
-_cmnd(ErrorString),
-_glcmnd(GetTexImage),
-_glcmnd(GetTexLevelParameter),
-_cmnd(Build1DMipmapLevels),
-_cmnd(Build3DMipmapLevels)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/build2dmipmaps.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/build2dmipmaps.gl
deleted file mode 100755
index 73c2494bc..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/build2dmipmaps.gl
+++ /dev/null
@@ -1,242 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Build2DMipmaps, builds a two-dimensional mipmap)
-_names(Build2DMipmaps)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the target texture. Must be _const(TEXTURE_2D).
-_phead(_param2)
-Requests the internal storage format of the texture image. The most
-current version of the SGI implementation of GLU does not check this
-value for validity before passing it on to the underlying OpenGL
-implementation. A value that is not accepted by the OpenGL
-implementation will lead to an OpenGL error. The benefit of not
-checking this value at the GLU level is that OpenGL extensions can add
-new internal texture formats without requiring a revision of the GLU
-implementation. Older implementations of GLU check this value and
-raise a GLU error if it is not 1, 2, 3, or 4 or one of the following
-symbolic constants:
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(INTENSITY),
-_const(INTENSITY4),
-_const(INTENSITY8),
-_const(INTENSITY12),
-_const(INTENSITY16),
-_const(RGB),
-_const(R3_G3_B2),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12) or
-_const(RGBA16).
-_phead(_param3 _param4)
-Specifies in pixels the width and height, respectively, of the texture image.
-_phead(_param5)
-Specifies the format of the pixel data.
-Must be one of
-_const(COLOR_INDEX),
-_const(DEPTH_COMPONENT),
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(RGBA),
-_const(BGR),
-_const(BGRA),
-_const(LUMINANCE), or
-_const(LUMINANCE_ALPHA).
-_phead(_param6)
-Specifies the data type for _param7.
-Must be one of
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV).
-_phead(_param7)
-Specifies a pointer to the image data in memory.
-
-
-.SH DESCRIPTION
-_cmnd builds a series of prefiltered two-dimensional texture maps of decreasing
-resolutions called a mipmap. This is used for the antialiasing of
-texture-mapped primitives.
-.P
-A return value of zero indicates success, otherwise a GLU error code is
-returned (see _cmnd(ErrorString)).
-.P
-Initially, the _param3 and _param4 of _param7 are checked to see if they
-are a power of 2. If not, a copy of _param7 (not _param7), is scaled up
-or down to the nearest power of 2. This copy will be used for subsequent
-mipmapping operations described below. (If _param3 or _param4 is exactly
-between powers of 2, then the copy of _param7 will scale upwards.) For
-example, if _param3 is 57 and _param4 is 23 then a copy of _param7 will
-scale up to 64 in _param3 and down to 16 in depth, before mipmapping takes
-place.
-.P
-Then, proxy textures (see _glcmnd(TexImage2D)) are used to determine if
-the implementation can fit the requested texture. If not, both dimensions
-are continually halved until it fits. (If the OpenGL version is \(<= 1.0,
-both maximum texture dimensions are clamped to the value returned
-by _glcmnd(GetIntegerv) with the argument _const(MAX_TEXTURE_SIZE).)
-.P
-Next, a series of mipmap levels is built by decimating a copy of _param7
-in half along both dimensions until size $1 ~times~ 1$ is reached. At
-each level,
-each texel in the halved mipmap level is an average of the corresponding
-four texels in the larger mipmap level. (In the case of rectangular
-images, the decimation will ultimately reach an $N ~times~ 1$ or
-$1 ~times~ N$ configuration. Here, two texels are averaged instead.)
-.P
-_glcmnd(TexImage2D) is called to load each of these mipmap levels.
-Level 0 is a copy of _param7. The highest level is
-${log sub 2} ( max (_eqnparam3,_eqnparam4))$. For example,
-if _param3 is 64 and _param4 is 16
-and the implementation can store a texture of this size, the following
-mipmap levels are built: $64 ~times~ 16$, $32 ~times~ 8$, $16 ~times~ 4$,
-$8 ~times~ 2$, $4 ~times~ 1$, $2 ~times~ 1$ and $1 ~times~ 1$. These correspond to
-levels 0 through 6, respectively.
-.P
-See the _glcmnd(TexImage1D) reference page for a description of the
-acceptable values for _param5 parameter. See the _glcmnd(DrawPixels)
-reference page for a description of the acceptable values
-for _param6 parameter.
-.SH NOTES
-
-Note that there is no direct way of querying the maximum level. This can
-be derived indirectly via _glcmnd(GetTexLevelParameter). First, query
-for the width and height actually used at level 0. (The width and
-height may not be equal to _param3 and _param4 respectively since proxy
-textures might have scaled them to fit the implementation.) Then the
-maximum level can be derived from the formula
-${log sub 2}( max (_param3,_param4))$.
-.SH NOTES
-Formats _const(BGR), and _const(BGRA), and types
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV) are only available if the GL version
-is 1.2 or greater and if the GLU version is 1.3 or greater.
-.SH ERRORS
-_gluconst(INVALID_VALUE) is returned if _param3, or _param4 is < 1.
-.P
-_gluconst(INVALID_ENUM) is returned if _param2, _param5, or _param6 is not
-legal.
-.P
-_gluconst(INVALID_OPERATION) is returned if _param6 is _const(UNSIGNED_BYTE_3_3_2) or _const(UNSIGNED_BYTE_2_3_3_REV)
-and _param5 is not _const(RGB).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param6 is _const(UNSIGNED_SHORT_5_6_5) or _const(UNSIGNED_SHORT_5_6_5_REV)
-and _param5 is not _const(RGB).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param6 is _const(UNSIGNED_SHORT_4_4_4_4) or _const(UNSIGNED_SHORT_4_4_4_4_REV)
-and _param5 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param6 is _const(UNSIGNED_SHORT_5_5_5_1) or _const(UNSIGNED_SHORT_1_5_5_5_REV)
-and _param5 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param6 is _const(UNSIGNED_INT_8_8_8_8) or _const(UNSIGNED_INT_8_8_8_8_REV)
-and _param5 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param6 is _const(UNSIGNED_INT_10_10_10_2) or _const(UNSIGNED_INT_2_10_10_10_REV)
-and _param5 is neither _const(RGBA) nor _const(BGRA).
-.SH SEE ALSO
-_glcmnd(DrawPixels),
-_glcmnd(TexImage1D),
-_glcmnd(TexImage2D),
-_glcmnd(TexImage3D),
-_cmnd(Build1DMipmaps),
-_cmnd(Build3DMipmaps),
-_cmnd(ErrorString),
-_glcmnd(GetTexImage),
-_glcmnd(GetTexLevelParameter),
-_cmnd(Build1DMipmapLevels),
-_cmnd(Build2DMipmapLevels),
-_cmnd(Build3DMipmapLevels)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/build3dmipmaplevels.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/build3dmipmaplevels.gl
deleted file mode 100755
index 94bc0899d..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/build3dmipmaplevels.gl
+++ /dev/null
@@ -1,236 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Build3DMipmapLevels, builds a subset of three-dimensional mipmap levels)
-_names(Build3DMipmapLevels)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the target texture. Must be _const(TEXTURE_3D).
-_phead(_param2)
-Requests the internal storage format of the texture image. The most
-current version of the SGI implementation of GLU does not check this
-value for validity before passing it on to the underlying OpenGL
-implementation. A value that is not accepted by the OpenGL
-implementation will lead to an OpenGL error. The benefit of not
-checking this value at the GLU level is that OpenGL extensions can add
-new internal texture formats without requiring a revision of the GLU
-implementation. Older implementations of GLU check this value and
-raise a GLU error if it is not 1, 2, 3, or 4 or one of the following
-symbolic constants:
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(INTENSITY),
-_const(INTENSITY4),
-_const(INTENSITY8),
-_const(INTENSITY12),
-_const(INTENSITY16),
-_const(RGB),
-_const(R3_G3_B2),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12), or
-_const(RGBA16).
-_phead(_param3 _param4 _param5)
-Specifies in pixels the width, height and depth respectively, of the texture
-image. These should be a power of 2.
-_phead(_param6)
-Specifies the format of the pixel data.
-Must be one of
-_const(COLOR_INDEX),
-_const(DEPTH_COMPONENT),
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(RGBA),
-_const(BGR),
-_const(BGRA),
-_const(LUMINANCE), or
-_const(LUMINANCE_ALPHA).
-_phead(_param7)
-Specifies the data type for _param11.
-Must be one of
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV).
-_phead(_param8)
-Specifies the mipmap level of the image data.
-_phead(_param9)
-Specifies the minimum mipmap level to pass to _glcmnd(TexImage3D).
-_phead(_param10)
-Specifies the maximum mipmap level to pass to _glcmnd(TexImage3D).
-_phead(_param11)
-Specifies a pointer to the image data in memory.
-.SH DESCRIPTION
-_cmnd builds a subset of prefiltered three-dimensional texture maps of
-decreasing resolutions called a mipmap. This is used for the antialiasing of
-texture mapped primitives.
-.P
-A return value of zero indicates success, otherwise a GLU error code is
-returned (see _cmnd(ErrorString)).
-.P
-A series of mipmap levels from _param9 to _param10 is built by
-decimating _param11 in half along both dimensions until size $1 ~times~ 1
-~times~ 1$ is reached. At each level, each texel in the halved mipmap
-level is an average of the corresponding eight texels in the larger
-mipmap level. (If exactly one of the dimensions is 1, four texels are
-averaged. If exactly two of the dimensions are 1, two texels are
-averaged.) _glcmnd(TexImage3D) is called to load these mipmap levels
-from _param9 to _param10. If _param10 is larger than the highest mipmap
-level for the texture of the specified size, then a GLU error code is
-returned (see _cmnd(ErrorString)) and nothing is loaded.
-.P
-For example, if _param8 is 2 and _param3 is 16, _param4 is 8 and _param5
-is 4, the following levels are possible: $16 ~times~ 8 ~times~ 4$, $8 ~times~
-4 ~times~ 2$, $4 ~times~ 2 ~times~ 1$, $2 ~times~ 1 ~times~ 1$,
-$1 ~times~ 1 ~times~ 1$.
-These correspond to levels 2 through 6 respectively. If _param9 is
-3 and _param10 is 5, then only mipmap levels $8 ~times~ 4 ~times~ 2$, $4
-~times~ 2 ~times~ 1$ and $2 ~times~ 1 ~times~ 1$ are loaded. However, if
-_param10 is 7 then an error is returned and nothing is loaded, since
-_param10 is larger than the highest mipmap level which is, in this case,
-6.
-.P
-The highest mipmap level can be derived from the formula
-${log sub 2} ( max (_eqnparam3,_eqnparam4,_eqnparam5)^{2 sup _eqnparam8})$.
-.P
-See the _glcmnd(TexImage1D) reference page for a description of the
-acceptable values for _param6 parameter. See the _glcmnd(DrawPixels)
-reference page for a description of the acceptable values
-for _param7 parameter.
-.SH NOTES
-_cmnd is only available if the GLU version is 1.3 or greater.
-.P
-Formats _const(BGR), and _const(BGRA), and types
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV) are only available if the GL version
-is 1.2 or greater.
-.SH ERRORS
-_gluconst(INVALID_VALUE) is returned if _param8 > _param9, _param9 < 0,
-_param10 < _param9 or _param10 is > the highest mipmap level for _param11.
-.P
-_gluconst(INVALID_VALUE) is returned if _param3, _param4, or _param5 is < 1.
-.P
-_gluconst(INVALID_ENUM) is returned if _param2, _param6, or _param7 is not
-legal.
-.P
-_gluconst(INVALID_OPERATION) is returned if _param7 is _const(UNSIGNED_BYTE_3_3_2) or _const(UNSIGNED_BYTE_2_3_3_REV)
-and _param6 is not _const(RGB).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param7 is _const(UNSIGNED_SHORT_5_6_5) or _const(UNSIGNED_SHORT_5_6_5_REV)
-and _param6 is not _const(RGB).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param7 is _const(UNSIGNED_SHORT_4_4_4_4) or _const(UNSIGNED_SHORT_4_4_4_4_REV)
-and _param6 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param7 is _const(UNSIGNED_SHORT_5_5_5_1) or _const(UNSIGNED_SHORT_1_5_5_5_REV)
-and _param6 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param7 is _const(UNSIGNED_INT_8_8_8_8) or _const(UNSIGNED_INT_8_8_8_8_REV)
-and _param6 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param7 is _const(UNSIGNED_INT_10_10_10_2) or _const(UNSIGNED_INT_2_10_10_10_REV)
-and _param6 is neither _const(RGBA) nor _const(BGRA).
-.SH SEE ALSO
-_glcmnd(DrawPixels),
-_glcmnd(TexImage1D),
-_glcmnd(TexImage2D),
-_glcmnd(TexImage3D),
-_cmnd(Build1DMipmaps),
-_cmnd(Build2DMipmaps),
-_cmnd(Build3DMipmaps),
-_cmnd(ErrorString),
-_glcmnd(GetTexImage),
-_glcmnd(GetTexLevelParameter),
-_cmnd(Build1DMipmapLevels),
-_cmnd(Build2DMipmapLevels)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/build3dmipmaps.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/build3dmipmaps.gl
deleted file mode 100755
index 7799f073a..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/build3dmipmaps.gl
+++ /dev/null
@@ -1,243 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Build3DMipmaps, builds a three-dimensional mipmap)
-_names(Build3DMipmaps)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the target texture. Must be _const(TEXTURE_3D).
-_phead(_param2)
-Requests the internal storage format of the texture image. The most
-current version of the SGI implementation of GLU does not check this
-value for validity before passing it on to the underlying OpenGL
-implementation. A value that is not accepted by the OpenGL
-implementation will lead to an OpenGL error. The benefit of not
-checking this value at the GLU level is that OpenGL extensions can add
-new internal texture formats without requiring a revision of the GLU
-implementation. Older implementations of GLU check this value and
-raise a GLU error if it is not 1, 2, 3, or 4 or one of the following
-symbolic constants:
-_const(ALPHA),
-_const(ALPHA4),
-_const(ALPHA8),
-_const(ALPHA12),
-_const(ALPHA16),
-_const(LUMINANCE),
-_const(LUMINANCE4),
-_const(LUMINANCE8),
-_const(LUMINANCE12),
-_const(LUMINANCE16),
-_const(LUMINANCE_ALPHA),
-_const(LUMINANCE4_ALPHA4),
-_const(LUMINANCE6_ALPHA2),
-_const(LUMINANCE8_ALPHA8),
-_const(LUMINANCE12_ALPHA4),
-_const(LUMINANCE12_ALPHA12),
-_const(LUMINANCE16_ALPHA16),
-_const(INTENSITY),
-_const(INTENSITY4),
-_const(INTENSITY8),
-_const(INTENSITY12),
-_const(INTENSITY16),
-_const(RGB),
-_const(R3_G3_B2),
-_const(RGB4),
-_const(RGB5),
-_const(RGB8),
-_const(RGB10),
-_const(RGB12),
-_const(RGB16),
-_const(RGBA),
-_const(RGBA2),
-_const(RGBA4),
-_const(RGB5_A1),
-_const(RGBA8),
-_const(RGB10_A2),
-_const(RGBA12), or
-_const(RGBA16).
-_phead(_param3 _param4 _param5)
-Specifies in pixels the width, height and depth respectively, in pixels
-of the texture image.
-_phead(_param6)
-Specifies the format of the pixel data.
-Must be one of
-_const(COLOR_INDEX),
-_const(DEPTH_COMPONENT),
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(RGBA),
-_const(BGR),
-_const(BGRA),
-_const(LUMINANCE), or
-_const(LUMINANCE_ALPHA).
-_phead(_param7)
-Specifies the data type for _param8.
-Must be one of:
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV).
-_phead(_param8)
-Specifies a pointer to the image data in memory.
-.SH DESCRIPTION
-_cmnd builds a series of prefiltered three-dimensional texture maps of
-decreasing resolutions called a mipmap. This is used for the antialiasing of
-texture-mapped primitives.
-.P
-A return value of zero indicates success, otherwise a GLU error code is
-returned (see _cmnd(ErrorString)).
-.P
-Initially, the _param3, _param4 and _param5 of _param8 are checked to
-see if they are a power of 2. If not, a copy of _param8 (not _param8),
-is scaled up or down to the nearest power of 2. (If _param3, _param4 or
-_param5 is exactly between powers of 2, then the copy of _param8 will
-scale upwards.) This copy will be used for subsequent mipmapping
-operations described below. For example, if _param3 is 57, _param4 is
-23 and _param5 is 24 then a copy of _param8 will scale up to 64 in
-width, down to 16 in height and up to 32 in depth, before mipmapping
-takes place.
-.P
-Then, proxy textures (see _glcmnd(TexImage3D)) are used to determine if
-the implementation can fit the requested texture. If not, all three dimensions
-are continually halved until it fits.
-.P
-Next, a series of mipmap levels is built by decimating a copy of _param8
-in half along all three dimensions until size $1 ~times~ 1 ~times~ 1$ is
-reached. At each level, each texel in the halved mipmap level is an
-average of the corresponding eight texels in the larger mipmap
-level. (If exactly one of the dimensions is 1, four texels are averaged.
-If exactly two of the dimensions are 1, two texels are averaged.)
-.P
-_glcmnd(TexImage3D) is called to load each of these mipmap levels.
-Level 0 is a copy of _param8. The highest level is
-${log sub 2} ( max (_eqnparam3,_eqnparam4,_eqnparam5))$.
-For example, if _param3 is 64, _param4 is
-16 and _param5 is 32, and the implementation can store a texture of this
-size, the following mipmap levels are built: $64 ~times~ 16 ~times~ 32$,
-$32 ~times~ 8 ~times~ 16$, $16 ~times~ 4 ~times~ 8$,
-$8 ~times~ 2 ~times~ 4$, $4 ~times~ 1 ~times~ 2$,
-$2 ~times~ 1 ~times~ 1$
-and $1 ~times~ 1 ~times~ 1$. These correspond
-to levels 0 through 6, respectively.
-.P
-See the _glcmnd(TexImage1D) reference page for a description of the
-acceptable values for _param6 parameter. See the _glcmnd(DrawPixels)
-reference page for a description of the acceptable values
-for _param7 parameter.
-.SH NOTES
-Note that there is no direct way of querying the maximum level. This can
-be derived indirectly via _glcmnd(GetTexLevelParameter). First, query
-for the width, height and depth actually used at level 0. (The width,
-height and depth may not be equal to _param3, _param4 and _param5
-respectively since proxy textures might have scaled them to fit the
-implementation.) Then the maximum level can be derived from the formula
-${log sub 2} ( max (_eqnparam3,_eqnparam4,_eqnparam5))$.
-.P
-_cmnd is only available if the GLU version is 1.3 or greater.
-.P
-Formats _const(BGR), and _const(BGRA), and types
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV) are only available if the GL version
-is 1.2 or greater.
-.SH ERRORS
-_gluconst(INVALID_VALUE) is returned if _param3, _param4, or _param5 is < 1.
-.P
-_gluconst(INVALID_ENUM) is returned if _param2, _param6, or _param7 is not
-legal.
-.P
-_gluconst(INVALID_OPERATION) is returned if _param7 is _const(UNSIGNED_BYTE_3_3_2) or _const(UNSIGNED_BYTE_2_3_3_REV)
-and _param6 is not _const(RGB).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param7 is _const(UNSIGNED_SHORT_5_6_5) or _const(UNSIGNED_SHORT_5_6_5_REV)
-and _param6 is not _const(RGB).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param7 is _const(UNSIGNED_SHORT_4_4_4_4) or _const(UNSIGNED_SHORT_4_4_4_4_REV)
-and _param6 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param7 is _const(UNSIGNED_SHORT_5_5_5_1) or _const(UNSIGNED_SHORT_1_5_5_5_REV)
-and _param6 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param7 is _const(UNSIGNED_INT_8_8_8_8) or _const(UNSIGNED_INT_8_8_8_8_REV)
-and _param6 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param7 is _const(UNSIGNED_INT_10_10_10_2) or _const(UNSIGNED_INT_2_10_10_10_REV)
-and _param6 is neither _const(RGBA) nor _const(BGRA).
-.SH SEE ALSO
-_glcmnd(DrawPixels),
-_glcmnd(TexImage1D),
-_glcmnd(TexImage2D),
-_glcmnd(TexImage3D),
-_cmnd(Build1DMipmaps),
-_cmnd(Build3DMipmaps),
-_cmnd(ErrorString),
-_glcmnd(GetTexImage),
-_glcmnd(GetTexLevelParameter),
-_cmnd(Build1DMipmapLevels),
-_cmnd(Build2DMipmapLevels),
-_cmnd(Build3DMipmapLevels)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/c b/xc/extras/ogl-sample/main/doc/man/manglu/standard/c
deleted file mode 100755
index 8cbb4d3ad..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/c
+++ /dev/null
@@ -1,2 +0,0 @@
-.Op + c
-.ds BN \f6Graphics Reference, C Edition\f1
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/checkextension.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/checkextension.gl
deleted file mode 100755
index 43f30c0d3..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/checkextension.gl
+++ /dev/null
@@ -1,68 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(CheckExtension, determines if an extension name is supported)
-_names(CheckExtension)
-.SH PARAMETERS
-_phead(_param1)
-Specifies an extension name.
-_phead(_param2)
-Specifies a space-separated list of extension names supported.
-.SH DESCRIPTION
-_cmnd returns _const(TRUE) if _param1 is supported otherwise
-_const(FALSE) is returned.
-.P
-This is used to check for the presence for OpenGL, GLU or GLX extension names
-by passing the extension strings returned by _glcmnd(GetString),
-_cmnd(GetString), _glcmnd(XGetClientString),
-_glcmnd(XQueryExtensionsString), or _glcmnd(XQueryServerString),
-respectively, as _param2.
-.SH NOTES
-Cases where one extension name is a substring of another are
-correctly handled.
-.P
-There may or may not be leading or trailing blanks in _param2.
-.P
-Extension names should not contain embedded spaces.
-.P
-All strings are null-terminated.
-.SH SEE ALSO
-_glcmnd(GetString),
-_cmnd(GetString),
-_glcmnd(XGetClientString),
-_glcmnd(XQueryExtensionsString),
-_glcmnd(XQueryServerString)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/cylinder.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/cylinder.gl
deleted file mode 100755
index 42605f762..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/cylinder.gl
+++ /dev/null
@@ -1,77 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Cylinder, draw a cylinder)
-_names(Cylinder)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the quadrics object (created with _cmnd(NewQuadric)).
-_phead(_param2)
-Specifies the radius of the cylinder at \f2z\fP = 0.
-_phead(_param3)
-Specifies the radius of the cylinder at \f2z\fP = _param4.
-_phead(_param4)
-Specifies the height of the cylinder.
-_phead(_param5)
-Specifies the number of subdivisions around the \f2z\fP axis.
-_phead(_param6)
-Specifies the number of subdivisions along the \f2z\fP axis.
-.SH DESCRIPTION
-_cmnd draws a cylinder oriented along the \f2z\fP axis. The base of the cylinder
-is placed at \f2z\fP = 0, and the top at $ z ~=~ _eqnparam4 $. Like a sphere,
-a cylinder is subdivided around the \f2z\fP axis into slices, and along the
-\f2z\fP axis into stacks.
-.P
-Note that if _param3 is set to 0.0, this routine generates a cone.
-.P
-If the orientation is set to _gluconst(OUTSIDE)
-(with _cmnd(QuadricOrientation)), then any generated normals
-point away from the \f2z\fP axis. Otherwise, they point toward the
-\f2z\fP axis.
-.P
-If texturing is turned on (with _cmnd(QuadricTexture)), then texture
-coordinates are generated so that \f2t\fP ranges linearly from 0.0
-at \f2z\fP = 0 to 1.0 at \f2z\fP = _param4, and \f2s\fP
-ranges from 0.0 at the +\f2y\fP axis, to 0.25 at the +\f2x\fP axis,
-to 0.5 at the -\f2y\fP axis, to 0.75 at the \-\f2x\fP axis,
-and back to 1.0 at the +\f2y\fP axis.
-.SH SEE ALSO
-_cmnd(Disk), _cmnd(NewQuadric), _cmnd(PartialDisk), _cmnd(QuadricTexture),
-_cmnd(Sphere)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/deletenurbsrenderer.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/deletenurbsrenderer.gl
deleted file mode 100755
index 54d8312ae..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/deletenurbsrenderer.gl
+++ /dev/null
@@ -1,52 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(DeleteNurbsRenderer, destroy a NURBS object)
-_names(DeleteNurbsRenderer)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the NURBS object to be destroyed.
-.SH DESCRIPTION
-_cmnd destroys the NURBS object (which was created with
-_cmnd(NewNurbsRenderer)) and frees any memory it uses.
-Once
-_cmnd has been called, _param1 cannot be used again.
-.SH SEE ALSO
-_cmnd(NewNurbsRenderer)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/deletequadric.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/deletequadric.gl
deleted file mode 100755
index e0794766a..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/deletequadric.gl
+++ /dev/null
@@ -1,52 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(DeleteQuadric, destroy a quadrics object)
-_names(DeleteQuadric)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the quadrics object to be destroyed.
-.SH DESCRIPTION
-_cmnd destroys the quadrics object (created with _cmnd(NewQuadric))
-and frees any memory it uses.
-Once _cmnd has been called, _param1 cannot be used again.
-.SH SEE ALSO
-_cmnd(NewQuadric)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/deletetess.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/deletetess.gl
deleted file mode 100755
index e7f946347..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/deletetess.gl
+++ /dev/null
@@ -1,51 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(DeleteTess, destroy a tessellation object)
-_names(DeleteTess)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the tessellation object to destroy.
-.SH DESCRIPTION
-_cmnd destroys the indicated tessellation object (which was created
-with _cmnd(NewTess)) and frees any memory that it used.
-.SH SEE ALSO
-_cmnd(BeginPolygon), _cmnd(NewTess), _cmnd(TessCallback)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/disk.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/disk.gl
deleted file mode 100755
index 5b0e907fd..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/disk.gl
+++ /dev/null
@@ -1,79 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Disk, draw a disk)
-_names(Disk)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the quadrics object (created with _cmnd(NewQuadric)).
-_phead(_param2)
-Specifies the inner radius of the disk (may be 0).
-_phead(_param3)
-Specifies the outer radius of the disk.
-_phead(_param4)
-Specifies the number of subdivisions around the \f2z\fP axis.
-_phead(_param5)
-Specifies the number of concentric rings about the origin into which
-the disk is subdivided.
-.SH DESCRIPTION
-_cmnd renders a disk on the \f2z\fP = 0 plane. The disk has a radius of
-_param3, and contains a concentric circular hole with a radius
-of _param2. If _param2 is 0, then no hole is generated. The disk is
-subdivided around the \f2z\fP axis into slices (like pizza slices), and also
-about the \f2z\fP axis into rings
-(as specified by _param4 and _param5, respectively).
-.P
-With respect to orientation, the +\f2z\fP side of the disk is considered to be
-"outside" (see _cmnd(QuadricOrientation)).
-This means that if the
-orientation is set to _gluconst(OUTSIDE), then any normals generated
-point along the +\f2z\fP axis. Otherwise, they point along the \-\f2z\fP
-axis.
-.P
-If texturing has been turned on (with _cmnd(QuadricTexture)),
-texture coordinates are generated
-linearly such that where $ r ~=~ _eqnparam3 $, the value at (\f2r\fP, 0, 0) is
-(1, 0.5), at (0, \f2r\fP, 0) it is (0.5, 1), at (\-\f2r\fP, 0, 0)
-it is (0, 0.5), and
-at (0, \-\f2r\fP, 0) it is (0.5, 0).
-.SH SEE ALSO
-_cmnd(Cylinder), _cmnd(NewQuadric), _cmnd(PartialDisk),
-_cmnd(QuadricOrientation),
-_cmnd(QuadricTexture), _cmnd(Sphere)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/errorstring.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/errorstring.gl
deleted file mode 100755
index f3b0baea7..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/errorstring.gl
+++ /dev/null
@@ -1,65 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(ErrorString, produce an error string from a GL or GLU error code)
-_names(ErrorString)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies a GL or GLU error code.
-.SH DESCRIPTION
-_cmnd produces an error string from a GL or GLU error code. The string
-is in ISO Latin 1 format. For example,
-_cmnd(ErrorString)(_const(OUT_OF_MEMORY)) returns the string
-\f2out of memory\fP.
-.P
-The standard GLU error codes are _gluconst(INVALID_ENUM),
-_gluconst(INVALID_VALUE),
-and _gluconst(OUT_OF_MEMORY).
-Certain other GLU functions can return specialized error codes
-through callbacks.
-See the _glcmnd(GetError) reference page for the list of
-GL error codes.
-.SH ERRORS
-_xconst(NULL) is returned if _param1 is not a valid GL or GLU error code.
-.SH SEE ALSO
-_glcmnd(GetError),
-_cmnd(NurbsCallback),
-_cmnd(QuadricCallback),
-_cmnd(TessCallback)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/getnurbsproperty.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/getnurbsproperty.gl
deleted file mode 100755
index fda630f8c..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/getnurbsproperty.gl
+++ /dev/null
@@ -1,68 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GetNurbsProperty, get a NURBS property)
-_names(GetNurbsProperty)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the NURBS object (created with _cmnd(NewNurbsRenderer)).
-_phead(_param2)
-Specifies the property whose value is to be fetched. Valid values are
-_gluconst(CULLING),
-_gluconst(SAMPLING_TOLERANCE),
-_gluconst(DISPLAY_MODE),
-_gluconst(AUTO_LOAD_MATRIX),
-_gluconst(PARAMETRIC_TOLERANCE),
-_gluconst(SAMPLING_METHOD),
-_gluconst(U_STEP),
-_gluconst(V_STEP) and
-_gluconst(NURBS_MODE).
-_phead(_param3)
-Specifies a pointer to the location into which the value of the
-named property is written.
-.SH DESCRIPTION
-_cmnd retrieves properties stored in a NURBS object. These
-properties affect the way that NURBS curves and surfaces
-are rendered. See the
-_cmnd(NurbsProperty) reference page for information about what the
-properties are and what they do.
-.SH SEE ALSO
-_cmnd(NewNurbsRenderer),
-_cmnd(NurbsProperty)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/getstring.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/getstring.gl
deleted file mode 100755
index a7cf5b037..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/getstring.gl
+++ /dev/null
@@ -1,85 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GetString, return a string describing the GLU version or GLU extensions )
-_names(GetString)
-.SH PARAMETERS
-_phead(_param1)
-Specifies a symbolic constant, one of
-_gluconst(VERSION), or _gluconst(EXTENSIONS).
-.SH DESCRIPTION
-_cmnd returns a pointer to a static string describing the
-GLU version or the GLU extensions that are supported.
-.P
-The version number is one of the following
-forms:
-.P
-\f2major_number.minor_number\fP
-.br
-\f2major_number.minor_number.release_number\fP.
-.P
-The version string is of the following form:
-.P
-\f2version number<space>vendor-specific information\fP
-.P
-Vendor-specific information is optional.
-Its format and contents depend on the implementation.
-.P
-The standard GLU contains a basic set of features and capabilities.
-If a company or group of companies wish to support other features,
-these may be included as extensions to the GLU.
-If _param1 is
-_gluconst(EXTENSIONS), then _cmnd
-returns a space-separated list of names of supported GLU extensions.
-(Extension names never contain spaces.)
-.P
-All strings are null-terminated.
-.SH NOTES
-_cmnd only returns information about GLU extensions. Call
-@<\f3glGetString\fP>@dnl
- to get a list of GL extensions.
-.P
-_cmnd is an initialization routine. Calling it after
-a _glcmnd(NewList) results in undefined behavior.
-.SH ERRORS
-NULL is returned if _param1 is not
-_gluconst(VERSION) or _gluconst(EXTENSIONS).
-.P
-.SH SEE ALSO
-@<\f3glGetString\fP>@dnl
-
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/gettessproperty.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/gettessproperty.gl
deleted file mode 100755
index 678fc8f18..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/gettessproperty.gl
+++ /dev/null
@@ -1,63 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(GetTessProperty, get a tessellation object property)
-_names(GetTessProperty)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the tessellation object (created with _cmnd(NewTess)).
-_phead(_param2)
-Specifies the property whose value is to be fetched. Valid values are
-_gluconst(TESS_WINDING_RULE),
-_gluconst(TESS_BOUNDARY_ONLY), and
-_gluconst(TESS_TOLERANCE).
-_phead(_param3)
-Specifies a pointer to the location into which the value of the
-named property is written.
-.SH DESCRIPTION
-_cmnd retrieves properties stored in a tessellation object. These
-properties affect the way that tessellation objects
-are interpreted and rendered. See the
-_cmnd(TessProperty) reference page for information about the
-properties and what they do.
-.SH SEE ALSO
-_cmnd(NewTess),
-_cmnd(TessProperty)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/loadsamplingmatrices.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/loadsamplingmatrices.gl
deleted file mode 100755
index 8701435b1..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/loadsamplingmatrices.gl
+++ /dev/null
@@ -1,71 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(LoadSamplingMatrices, load NURBS sampling and culling matrices)
-_names(LoadSamplingMatrices)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the NURBS object (created with _cmnd(NewNurbsRenderer)).
-_phead(_param2)
-Specifies a modelview matrix (as from a _glcmnd(GetFloatv) call).
-_phead(_param3)
-Specifies a projection matrix (as from a _glcmnd(GetFloatv) call).
-_phead(_param4)
-Specifies a viewport (as from a _glcmnd(GetIntegerv) call).
-.SH DESCRIPTION
-_cmnd uses _param2, _param3, and _param4 to recompute the sampling and culling
-matrices stored in _param1.
-The sampling matrix determines how finely a NURBS curve or surface
-must be tessellated to satisfy the sampling tolerance (as determined by the
-_gluconst(SAMPLING_TOLERANCE) property).
-The culling matrix is used in deciding if a NURBS curve or surface
-should be culled before
-rendering (when the _gluconst(CULLING) property is turned on).
-.P
-_cmnd is necessary only if the _gluconst(AUTO_LOAD_MATRIX) property is turned
-off (see _cmnd(NurbsProperty)).
-Although it can be convenient to leave the _gluconst(AUTO_LOAD_MATRIX)
-property turned on, there can be a performance penalty for doing so.
-(A round trip to the GL server is needed to fetch the current values
-of the modelview matrix, projection matrix, and viewport.)
-.SH SEE ALSO
-_cmnd(GetNurbsProperty),
-_cmnd(NewNurbsRenderer),
-_cmnd(NurbsProperty)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/lookat.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/lookat.gl
deleted file mode 100755
index a3a9b220c..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/lookat.gl
+++ /dev/null
@@ -1,108 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(LookAt, define a viewing transformation)
-_names(LookAt)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1 _param2 _param3)
-Specifies the position of the eye point.
-_phead(_param4 _param5 _param6)
-Specifies the position of the reference point.
-_phead(_param7 _param8 _param9)
-Specifies the direction of the \f2up\fP vector.
-.SH DESCRIPTION
-_cmnd creates a viewing matrix derived from an eye point, a reference
-point indicating the center of the scene, and an \f2UP\fP vector.
-.P
-The matrix
-maps the reference point to the negative \f2z\fP axis and the
-eye point to the origin.
-When a typical projection matrix is used,
-the center of the scene therefore maps to the center of the viewport.
-Similarly, the direction described by the \f2UP\fP
-vector projected onto the viewing plane is mapped to the positive \f2y\fP
-axis so that it points upward in the viewport.
-The \f2UP\fP vector must not be parallel to the line of sight from the
-eye point to the reference point.
-.P
-Let
-.sp
-.EQ
-F ~=~ left ( down 20 { ~ matrix {
- ccol {_eqnparam4 above _eqnparam5 above _eqnparam6}
- ccol { ~-~ above ~-~ above ~-~}
- ccol {_eqnparam1 above _eqnparam2 above _eqnparam3}
-} } ~~ right )
-
-.EN
-
-.sp
-Let \f2UP\fP be the vector $(_eqnparam7, _eqnparam8, _eqnparam9)$.
-.P
-Then normalize as follows:
-.EQ
-f ~=~ F over {|| F ||}
-.EN
-.P
-.EQ
-UP sup prime ~=~ UP over {|| UP ||}
-.EN
-.sp
-.P
-Finally, let $s ~=~ f ~times~ UP sup prime$, and $u ~=~ s ~times~ f$.
-.P
-.sp
-M is then constructed as follows:
-.EQ
-M ~=~ left ( matrix {
- ccol { ~s[0] above ~u[0] above -f[0] above 0 }
- ccol { ~s[1] above ~u[1] above -f[1] above 0 }
- ccol { ~s[2] above ~u[2] above -f[2] above 0 }
- ccol { 0 above 0 above 0 above 1 }
-} ~~right )
-.EN
-.P
-and _cmnd is equivalent to
-.Ex
-glMultMatrixf(M);
-glTranslated (-eyex, -eyey, -eyez);
-.Ee
-.SH SEE ALSO
-_glcmnd(Frustum), _cmnd(Perspective)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/newnurbsrenderer.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/newnurbsrenderer.gl
deleted file mode 100755
index 1b2ce71e5..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/newnurbsrenderer.gl
+++ /dev/null
@@ -1,51 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(NewNurbsRenderer, create a NURBS object)
-_names(NewNurbsRenderer)
-.EQ
-delim $$
-.EN
-.SH DESCRIPTION
-_cmnd creates and returns a pointer to
-a new NURBS object.
-This object must be referred to when calling
-NURBS rendering and control functions. A return value of
-0 means that there is not enough memory to allocate the object.
-.SH SEE ALSO
-_cmnd(BeginCurve), _cmnd(BeginSurface), _cmnd(BeginTrim), _cmnd(DeleteNurbsRenderer), _cmnd(NurbsCallback), _cmnd(NurbsProperty)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/newquadric.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/newquadric.gl
deleted file mode 100755
index 96b09a7e7..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/newquadric.gl
+++ /dev/null
@@ -1,53 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(NewQuadric, create a quadrics object)
-_names(NewQuadric)
-.EQ
-delim $$
-.EN
-.SH DESCRIPTION
-_cmnd creates and returns a pointer to
-a new quadrics object. This object must be referred to when
-calling quadrics rendering and control functions. A return value of
-0 means that there is not enough memory to allocate the object.
-.SH SEE ALSO
-_cmnd(Cylinder), _cmnd(DeleteQuadric), _cmnd(Disk),
-_cmnd(PartialDisk), _cmnd(QuadricCallback), _cmnd(QuadricDrawStyle),
-_cmnd(QuadricNormals), _cmnd(QuadricOrientation),
-_cmnd(QuadricTexture),
-_cmnd(Sphere)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/newtess.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/newtess.gl
deleted file mode 100755
index ffa2e0c81..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/newtess.gl
+++ /dev/null
@@ -1,50 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(NewTess, create a tessellation object)
-_names(NewTess)
-.EQ
-delim $$
-.EN
-.SH DESCRIPTION
-_cmnd creates and returns a pointer to a new tessellation object.
-This object must be referred to when calling
-tessellation functions. A return value of
-0 means that there is not enough memory to allocate the object.
-.SH SEE ALSO
-_cmnd(TessBeginPolygon), _cmnd(DeleteTess), _cmnd(TessCallback)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/nextcontour.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/nextcontour.gl
deleted file mode 100755
index 9194b35d3..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/nextcontour.gl
+++ /dev/null
@@ -1,117 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(NextContour, mark the beginning of another contour)
-_names(NextContour)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the tessellation object (created with _cmnd(NewTess)).
-_phead(_param2)
-Specifies the type of the contour being defined. Valid values are
-_gluconst(EXTERIOR),
-_gluconst(INTERIOR),
-_gluconst(UNKNOWN),
-_gluconst(CCW), and
-_gluconst(CW).
-.SH DESCRIPTION
-_cmnd is used in describing polygons with multiple contours. After the first
-contour has been described through a series of _cmnd(TessVertex) calls,
-a _cmnd call indicates that the previous contour is complete and that the
-next contour is about to begin.
-Another series of _cmnd(TessVertex) calls is then used to describe the new
-contour. This process can be repeated until all contours have been described.
-.P
-_param2 defines what type of contour follows.
-The legal contour types are as follows:
-.TP 18
-_gluconst(EXTERIOR)
-An exterior contour defines an exterior boundary of the polygon.
-.TP
-_gluconst(INTERIOR)
-An interior contour defines an interior boundary of the polygon (such as
-a hole).
-.TP
-_gluconst(UNKNOWN)
-An unknown contour is analyzed by the library to determine if it is interior
-or exterior.
-.TP
-_gluconst(CCW),
-.TP
-_gluconst(CW)
-The first _gluconst(CCW) or _gluconst(CW) contour defined is considered to
-be exterior. All other contours are considered to be exterior if they
-are oriented in the same direction (clockwise or counterclockwise) as
-the first contour, and interior if they are not.
-.P
-If one contour is of type _gluconst(CCW) or _gluconst(CW), then all
-contours must be of the same type (if they are not, then all _gluconst(CCW)
-and _gluconst(CW) contours will be changed to _gluconst(UNKNOWN)).
-.P
-Note that there is no real difference between the _gluconst(CCW) and
-_gluconst(CW) contour types.
-.P
-Before the first contour is described, _cmnd can be called to
-define the type of the first contour.
-If _cmnd is not called before the first contour, then the first contour is
-marked _gluconst(EXTERIOR).
-.P
-This command is obsolete and is provided for backward compatibility
-only. Calls to _cmnd are mapped to _cmnd(TessEndContour)
-followed by
-_cmnd(TessBeginContour).
-.SH EXAMPLE
-A quadrilateral with a triangular hole in it can be described as follows:
-.sp
-.Ex
-gluBeginPolygon(tobj);
- gluTessVertex(tobj, v1, v1);
- gluTessVertex(tobj, v2, v2);
- gluTessVertex(tobj, v3, v3);
- gluTessVertex(tobj, v4, v4);
-gluNextContour(tobj, GLU_INTERIOR);
- gluTessVertex(tobj, v5, v5);
- gluTessVertex(tobj, v6, v6);
- gluTessVertex(tobj, v7, v7);
-gluEndPolygon(tobj);
-.Ee
-.SH SEE ALSO
-_cmnd(BeginPolygon), _cmnd(NewTess), _cmnd(TessCallback), _cmnd(TessVertex),
-_cmnd(TessBeginContour)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/nurbscallback.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/nurbscallback.gl
deleted file mode 100755
index 91f89e367..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/nurbscallback.gl
+++ /dev/null
@@ -1,241 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(NurbsCallback, define a callback for a NURBS object)
-_names(NurbsCallback)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the NURBS object (created with _cmnd(NewNurbsRenderer)).
-_phead(_param2)
-Specifies the callback being defined.
-Valid values are _gluconst(NURBS_BEGIN), _gluconst(NURBS_VERTEX), _gluconst(NURBS_NORMAL), _gluconst(NURBS_COLOR), _gluconst(NURBS_TEXTURE_COORD), _gluconst(NURBS_END), _gluconst(NURBS_BEGIN_DATA), _gluconst(NURBS_VERTEX_DATA), _gluconst(NURBS_NORMAL_DATA), _gluconst(NURBS_COLOR_DATA), _gluconst(NURBS_TEXTURE_COORD_DATA), _gluconst(NURBS_END_DATA), and _gluconst(NURBS_ERROR).
-_phead(_param3)
-Specifies the function that the callback calls.
-.SH DESCRIPTION
-_cmnd is used to define a callback to be used by a NURBS
-object.
-If the specified callback is already defined, then it is replaced. If
-_param3 is NULL, then this callback will not get
-invoked and the related data, if any, will be lost.
-.P
-Except the error callback, these callbacks are used by NURBS tessellator (when _gluconst(NURBS_MODE) is set to be _gluconst(NURBS_TESSELLATOR)) to return back the OpenGL
-polygon primitives resulting from the tessellation. Note that there are two
-versions of each callback: one with a user data pointer and one without. If both versions for a particular callback are specified then the callback with
-the user data pointer will be used. Note that ``userData'' is a copy of the pointer that was specified at the last call to _cmnd(NurbsCallbackData).
-.P
-The error callback function is effective no matter which value that
-_gluconst(NURBS_MODE) is set to.
-All other callback functions are effective only when _gluconst(NURBS_MODE)
-is set to _gluconst(NURBS_TESSELLATOR).
-.P
-The legal callbacks are as follows:
-.TP 10
-_gluconst(NURBS_BEGIN)
-The begin callback indicates the start of a primitive. The function
-takes a single argument of type GLenum, which can be one of
-_const(LINES), _const(LINE_STRIP), _const(TRIANGLE_FAN), _const(TRIANGLE_STRIP), _const(TRIANGLES), or _const(QUAD_STRIP). The
-default begin callback function is NULL. The function prototype
-for this callback looks like:
-.RS
-.Ex
-void begin ( GLenum type );
-.Ee
-.RE
-.TP
-_gluconst(NURBS_BEGIN_DATA)
-The same as the _gluconst(NURBS_BEGIN) callback except that it takes an
-additional pointer argument. This pointer is a copy of the pointer that
-was specified at the last call to _cmnd(NurbsCallbackData). The
-default callback function is NULL. The function prototype for this
-callback function looks like:
-.RS
-.Ex
-void beginData (GLenum type, void *userData);
-.Ee
-.RE
-.TP
-_gluconst(NURBS_VERTEX)
-The vertex callback indicates a vertex of the primitive. The
-coordinates of the vertex are stored in the parameter ``vertex''. All
-the generated vertices have dimension 3, that is, homogeneous
-coordinates have been transformed into affine coordinates. The default
-vertex callback function is NULL. The function prototype for this
-callback function looks like:
-.RS
-.Ex
-void vertex ( GLfloat *vertex );
-.Ee
-.RE
-.TP
-_gluconst(NURBS_VERTEX_DATA)
-This is the same as the _gluconst(NURBS_VERTEX) callback, except that
-it takes an additional pointer argument. This pointer is a copy of the
-pointer that was specified at the last call to
-_cmnd(NurbsCallbackData). The default callback function is NULL. The
-function prototype for this callback function looks like:
-.RS
-.Ex
-void vertexData ( GLfloat *vertex, void *userData );
-.Ee
-.RE
-.TP
-_gluconst(NURBS_NORMAL)
-The normal callback is invoked as the vertex normal is generated.
-The components of the normal are stored in the parameter ``normal''.
-In the case of a NURBS curve, the callback function is effective only when
-the user provides a normal map (_const(MAP1_NORMAL)).
-In the case of a NURBS surface, if a normal map (_const(MAP2_NORMAL)) is provided, then the generated normal is computed from the normal map.
-If a normal map is not provided then a surface normal is computed in
-a manner similar to that described for evaluators when _const(AUTO_NORMAL)
-is enabled.
-.bp
-The default normal callback function is NULL. The function
-prototype for this callback function looks like:
-.RS
-.Ex
-void normal ( GLfloat *normal );
-.Ee
-.RE
-.TP
-_gluconst(NURBS_NORMAL_DATA)
-The same as the _gluconst(NURBS_NORMAL) callback except that it
-takes an additional pointer argument. This pointer is a copy of the pointer
-that was specified at the last call to _cmnd(NurbsCallbackData). The default callback function is NULL. The function prototype for this callback function looks like:
-.RS
-.Ex
-void normalData ( GLfloat *normal, void *userData );
-.Ee
-.RE
-.TP
-_gluconst(NURBS_COLOR)
-The color callback is invoked as the color of a vertex is generated.
-The components of the color are stored in the parameter ``color''.
-This callback is effective only when the user provides a color map
-(_const(MAP1_COLOR_4) or _const(MAP2_COLOR_4)). ``color'' contains four components: R,G,B,A. The default color callback function is NULL. The prototype for
-this callback function looks like:
-.RS
-.Ex
-void color ( GLfloat *color );
-.Ee
-.RE
-.TP
-_gluconst(NURBS_COLOR_DATA)
-The same as the _gluconst(NURBS_COLOR) callback except that it
-takes an additional pointer argument. This pointer is a copy of the pointer
-that was specified at the last call to _cmnd(NurbsCallbackData). The default callback function is NULL. The function prototype for this callback function looks like:
-.RS
-.Ex
-void colorData ( GLfloat *color, void *userData );
-.Ee
-.RE
-.TP
-_gluconst(NURBS_TEXTURE_COORD)
-The texture callback is invoked as the texture coordinates
-of a vertex are generated. These coordinates are stored in the parameter
-``texCoord''. The number of texture coordinates can be 1, 2, 3, or 4 depending
-on which type of texture map is specified
-(_const(MAP1_TEXTURE_COORD_1),
-_const(MAP1_TEXTURE_COORD_2),
-_const(MAP1_TEXTURE_COORD_3),
-_const(MAP1_TEXTURE_COORD_4),
-_const(MAP2_TEXTURE_COORD_1),
-_const(MAP2_TEXTURE_COORD_2),
-_const(MAP2_TEXTURE_COORD_3),
-_const(MAP2_TEXTURE_COORD_4)).
-If no texture map is specified, this callback function will not be called.
-.bp
-The default texture callback function is NULL. The function prototype
-for this callback function looks like:
-.RS
-.Ex
-void texCoord ( GLfloat *texCoord );
-.Ee
-.RE
-.TP
- _gluconst(NURBS_TEXTURE_COORD_DATA)
-This is the same as the _gluconst(NURBS_TEXTURE_COORD) callback, except that it
-takes an additional pointer argument. This pointer is a copy of the pointer
-that was specified at the last call to _cmnd(NurbsCallbackData). The default callback function is NULL. The function prototype for this callback function looks like:
-.RS
-.Ex
-void texCoordData (GLfloat *texCoord, void *userData);
-.Ee
-.RE
-.TP
-_gluconst(NURBS_END)
-The end callback is invoked at the end of a primitive. The default end callback function is NULL. The function prototype for this callback function looks like:
-.RS
-.Ex
-void end ( void );
-.Ee
-.RE
-.TP
-_gluconst(NURBS_END_DATA)
-This is the same as the _gluconst(NURBS_END) callback, except that it
-takes an additional pointer argument. This pointer is a copy of the pointer
-that was specified at the last call to _cmnd(NurbsCallbackData). The default callback function is NULL. The function prototype for this callback function looks like:
-.RS
-.Ex
-void endData ( void *userData );
-.Ee
-.RE
-.TP
-_gluconst(NURBS_ERROR)
-The error function is called when an error is encountered.
-Its single argument
-is of type GLenum, and it indicates the specific error that occurred.
-There are 37 errors unique to NURBS named
-_gluconst(NURBS_ERROR1) through _gluconst(NURBS_ERROR37).
-Character strings describing these errors can be retrieved with
-_cmnd(ErrorString).
-.bp
-.SH NOTES
-_cmnd is available only if the GLU version is 1.2 or greater.
-.P
-GLU version 1.2 supports only the _gluconst(ERROR) parameter for
-_param2. The _gluconst(ERROR) value is deprecated in GLU version 1.3 in
-favor of _gluconst(NURBS_ERROR). All other accepted values for _param3
-are available only if the GLU version is 1.3 or greater.
-.SH SEE ALSO
-_cmnd(ErrorString),
-_cmnd(NewNurbsRenderer),
-_cmnd(NurbsCallbackData),
-_cmnd(NurbsProperty)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/nurbscallbackdata.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/nurbscallbackdata.gl
deleted file mode 100755
index 15630be1f..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/nurbscallbackdata.gl
+++ /dev/null
@@ -1,56 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(NurbsCallbackData, set a user data pointer)
-_names(NurbsCallbackData)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the NURBS object (created with _cmnd(NewNurbsRenderer)).
-_phead(_param2)
-Specifies a pointer to the user's data.
-.SH DESCRIPTION
-_cmnd is used to pass a pointer to the application's data to NURBS
-tessellator. A copy of this pointer will be passed by the tessellator
-in the NURBS callback functions (set by _cmnd(NurbsCallback)).
-.SH NOTES
-_cmnd is available only if the GLU version is 1.3 or greater.
-.SH SEE ALSO
-_cmnd(NewNurbsRenderer),
-_cmnd(NurbsCallback)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/nurbscallbackdataext.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/nurbscallbackdataext.gl
deleted file mode 100755
index a12a1468c..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/nurbscallbackdataext.gl
+++ /dev/null
@@ -1,53 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(NurbsCallbackDataEXT, set a user data pointer)
-_names(NurbsCallbackDataEXT)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the NURBS object (created with _cmnd(NewNurbsRenderer)).
-_phead(_param2)
-Specifies a pointer to the user's data.
-.SH DESCRIPTION
-_cmnd is used to pass a pointer to the application's data to NURBS
-tessellator. A copy of this pointer will be passed by the tessellator
-in the NURBS callback functions (set by _cmnd(NurbsCallback)).
-.SH SEE ALSO
-_cmnd(NurbsCallback)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/nurbscurve.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/nurbscurve.gl
deleted file mode 100755
index e68cbebb9..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/nurbscurve.gl
+++ /dev/null
@@ -1,104 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(NurbsCurve, define the shape of a NURBS curve)
-_names(NurbsCurve)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the NURBS object (created with _cmnd(NewNurbsRenderer)).
-_phead(_param2)
-Specifies the number of knots in _param3.
-_param2 equals the number of control points plus the order.
-_phead(_param3)
-Specifies an array of _param2 nondecreasing knot values.
-_phead(_param4)
-Specifies the offset (as a number of single-precision floating-point values)
-between successive curve control points.
-_phead(_param5)
-Specifies a pointer to an array of control points. The coordinates must
-agree with _param7, specified below.
-_phead(_param6)
-Specifies the order of the NURBS curve. _param6 equals degree + 1, hence
-a cubic curve has an order of 4.
-_phead(_param7)
-Specifies the type of the curve. If this curve is defined within a
-_cmnd(BeginCurve)/_cmnd(EndCurve) pair, then
-the type can be any of the valid
-one-dimensional evaluator types (such as _const(MAP1_VERTEX_3) or
-_const(MAP1_COLOR_4)). Between a _cmnd(BeginTrim)/_cmnd(EndTrim) pair,
-the only valid types are _gluconst(MAP1_TRIM_2) and _gluconst(MAP1_TRIM_3).
-.SH DESCRIPTION
-Use _cmnd to describe a NURBS curve.
-.P
-When _cmnd appears between a _cmnd(BeginCurve)/_cmnd(EndCurve) pair, it is
-used to describe a curve to be rendered.
-Positional, texture, and color coordinates are associated
-by presenting each as a separate _cmnd between a
-_cmnd(BeginCurve)/_cmnd(EndCurve) pair. No more than
-one call to _cmnd for each of color, position, and texture
-data can be made within a single _cmnd(BeginCurve)/_cmnd(EndCurve)
-pair. Exactly one call must be made to describe the position of the
-curve (a _param7 of _const(MAP1_VERTEX_3) or _const(MAP1_VERTEX_4)).
-.P
-When _cmnd appears between a _cmnd(BeginTrim)/_cmnd(EndTrim) pair, it is
-used to describe a trimming curve on a NURBS surface. If _param7 is
-_gluconst(MAP1_TRIM_2), then it describes a curve in two-dimensional (\f2u\fP
-and \f2v\fP)
-parameter space. If it is _gluconst(MAP1_TRIM_3), then it describes a
-curve in two-dimensional homogeneous (\f2u\fP, \f2v\fP, and \f2w\fP)
-parameter space.
-See the _cmnd(BeginTrim) reference page for more discussion about trimming
-curves.
-.SH EXAMPLE
-The following commands render a textured NURBS curve with normals:
-.sp
-.Ex
-gluBeginCurve(nobj);
- gluNurbsCurve(nobj, ..., GL_MAP1_TEXTURE_COORD_2);
- gluNurbsCurve(nobj, ..., GL_MAP1_NORMAL);
- gluNurbsCurve(nobj, ..., GL_MAP1_VERTEX_4);
-gluEndCurve(nobj);
-.Ee
-.sp
-.SH NOTES
-To define trim curves which stitch well, use _cmnd(PwlCurve).
-.SH SEE ALSO
-_cmnd(BeginCurve), _cmnd(BeginTrim), _cmnd(NewNurbsRenderer), _cmnd(PwlCurve)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/nurbsproperty.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/nurbsproperty.gl
deleted file mode 100755
index 4cf6ae77d..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/nurbsproperty.gl
+++ /dev/null
@@ -1,215 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(NurbsProperty, set a NURBS property)
-_names(NurbsProperty)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the NURBS object (created with _cmnd(NewNurbsRenderer)).
-_phead(_param2)
-Specifies the property to be set. Valid values are
-_gluconst(SAMPLING_TOLERANCE),
-_gluconst(DISPLAY_MODE),
-_gluconst(CULLING),
-_gluconst(AUTO_LOAD_MATRIX),
-_gluconst(PARAMETRIC_TOLERANCE),
-_gluconst(SAMPLING_METHOD),
-_gluconst(U_STEP),
-_gluconst(V_STEP), or
-_gluconst(NURBS_MODE).
-_phead(_param3)
-Specifies the value of the indicated property.
-It may be a numeric value, or one of
-_gluconst(OUTLINE_POLYGON),
-_gluconst(FILL),
-_gluconst(OUTLINE_PATCH),
-_const(TRUE),
-_const(FALSE),
-_gluconst(PATH_LENGTH),
-_gluconst(PARAMETRIC_ERROR),
-_gluconst(DOMAIN_DISTANCE),
-_gluconst(NURBS_RENDERER), or
-_gluconst(NURBS_TESSELLATOR).
-.SH DESCRIPTION
-_cmnd is used to control properties stored in a NURBS object. These
-properties affect the way that a NURBS curve is rendered. The accepted
-values for _param2 are as follows:
-.TP 15
-_gluconst(NURBS_MODE)
-_param3 should be set to be either _gluconst(NURBS_RENDERER) or
-_gluconst(NURBS_TESSELLATOR). When set to _gluconst(NURBS_RENDERER), NURBS objects
-are tessellated into OpenGL primitives and sent to the pipeline for
-rendering. When set to _gluconst(NURBS_TESSELLATOR), NURBS objects are
-tessellated into OpenGL primitives but the vertices, normals, colors, and/or textures are
-retrieved back through a callback interface (see _cmnd(NurbsCallback)). This allows the user to cache the
-tessellated results for further processing.
-The initial value is _gluconst(NURBS_RENDERER).
-.TP
-_gluconst(SAMPLING_METHOD)
-Specifies how a NURBS surface should be
-tessellated.
-_param3 may be one of _gluconst(PATH_LENGTH),
-_gluconst(PARAMETRIC_ERROR), _gluconst(DOMAIN_DISTANCE),
-_gluconst(OBJECT_PATH_LENGTH), or
-_gluconst(OBJECT_PARAMETRIC_ERROR).
-When set to _gluconst(PATH_LENGTH), the surface is rendered so that
-the maximum length, in
-pixels, of the edges of the tessellation polygons is no greater than
-what is specified by _gluconst(SAMPLING_TOLERANCE).
-.IP
-_gluconst(PARAMETRIC_ERROR) specifies that the surface is rendered in such a
-way that the value specified by _gluconst(PARAMETRIC_TOLERANCE) describes the
-maximum distance, in pixels, between the tessellation polygons and the
-surfaces they approximate.
-.IP
-_gluconst(DOMAIN_DISTANCE) allows users to specify, in parametric coordinates,
-how many sample points per unit length are taken in \f2u\fP, \f2v\fP
-direction.
-.IP
-_gluconst(OBJECT_PATH_LENGTH) is similar to _gluconst(PATH_LENGTH)
-except that it is view independent, that is, the surface is rendered so that the maximum length, in object space, of edges of the tessellation polygons is no greater than what is specified by _gluconst(SAMPLING_TOLERANCE).
-.IP
-_gluconst(OBJECT_PARAMETRIC_ERROR) is similar to _gluconst(PARAMETRIC_ERROR) except that it is view independent, that is, the surface is rendered in such a way that the value specified by _gluconst(PARAMETRIC_TOLERANCE) describes the maximum distance, in object space, between the tessellation polygons and the surfaces they approximate.
-.IP
-The initial value of _gluconst(SAMPLING_METHOD) is _gluconst(PATH_LENGTH).
-.TP
-_gluconst(SAMPLING_TOLERANCE)
-Specifies the maximum length, in pixels or in object space length unit,
-to use when the sampling method is set to _gluconst(PATH_LENGTH) or
-_gluconst(OBJECT_PATH_LENGTH).
-The NURBS code is conservative when rendering a curve
-or surface, so the actual length can be somewhat shorter. The initial
-value is 50.0 pixels.
-.TP
-_gluconst(PARAMETRIC_TOLERANCE)
-Specifies the maximum distance, in pixels or in object space length unit,
-to use when the sampling method is _gluconst(PARAMETRIC_ERROR) or
-_gluconst(OBJECT_PARAMETRIC_ERROR).
-The initial value is 0.5.
-.TP
-_gluconst(U_STEP)
-Specifies the number of sample points per unit length taken
-along the \f2u\fP axis in parametric coordinates. It is needed when
-_gluconst(SAMPLING_METHOD) is set to _gluconst(DOMAIN_DISTANCE).
-The initial value is 100.
-.TP
-_gluconst(V_STEP)
-Specifies the number of sample points per unit length taken
-along the \f2v\fP axis in parametric coordinate. It is needed when
-_gluconst(SAMPLING_METHOD) is set to _gluconst(DOMAIN_DISTANCE). The initial
-value is 100.
-.TP
-_gluconst(DISPLAY_MODE)
-_param3 can be set to
-_gluconst(OUTLINE_POLYGON), _gluconst(FILL), or
-_gluconst(OUTLINE_PATCH).
-When _gluconst(NURBS_MODE) is set to be _gluconst(NURBS_RENDERER),
-_param3 defines how a NURBS surface should be rendered.
-When _param3 is set to _gluconst(FILL), the surface is rendered as a
-set of polygons. When _param3 is set to
-_gluconst(OUTLINE_POLYGON), the NURBS library draws only the outlines
-of the polygons created by tessellation. When _param3 is set to
-_gluconst(OUTLINE_PATCH) just the outlines of patches and trim
-curves defined by the user are drawn.
-.IP
-When _gluconst(NURBS_MODE) is set to be _gluconst(NURBS_TESSELLATOR),
-_param3 defines how a NURBS surface should be tessellated.
-When _gluconst(DISPLAY_MODE) is set to _gluconst(FILL) or
-_gluconst(OUTLINE_POLYGON),
-the NURBS surface is tessellated into OpenGL triangle primitives which can be
-retrieved back through callback functions. If _gluconst(DISPLAY_MODE) is set to
-_gluconst(OUTLINE_PATCH), only the outlines of the patches and trim curves are generated as a sequence of line strips which can be retrieved back through callback functions.
-.IP
-The initial value is _gluconst(FILL).
-.TP
-_gluconst(CULLING)
-_param3 is a boolean value that, when set to _const(TRUE), indicates that
-a NURBS curve should be discarded prior to tessellation if its control points
-lie outside the current viewport. The initial value is _const(FALSE).
-.TP
-_gluconst(AUTO_LOAD_MATRIX)
-_param3 is a boolean value. When set to _const(TRUE), the NURBS code
-downloads the projection matrix, the modelview matrix, and the
-viewport from the GL server to compute sampling and
-culling
-matrices for each NURBS curve that is rendered. Sampling and culling matrices
-are required to determine the tessellation of a NURBS surface into line segments
-or polygons and to cull a NURBS surface if it lies outside the viewport.
-.IP
-If this mode is set to _const(FALSE), then the program needs
-to provide a projection matrix, a modelview matrix, and a viewport
-for the NURBS renderer to use to construct sampling and culling matrices.
-This can be done with the _cmnd(LoadSamplingMatrices) function.
-This mode is initially set to _const(TRUE).
-Changing it from _const(TRUE) to _const(FALSE) does not affect
-the sampling and culling matrices until
-_cmnd(LoadSamplingMatrices)
-is called.
-.SH NOTES
-If _gluconst(AUTO_LOAD_MATRIX) is true, sampling and culling may be
-executed incorrectly if NURBS routines are compiled into a display list.
-.P
-A _param2 of
-_gluconst(PARAMETRIC_TOLERANCE),
-_gluconst(SAMPLING_METHOD),
-_gluconst(U_STEP), or
-_gluconst(V_STEP),
-or a _param3 of
-_gluconst(PATH_LENGTH),
-_gluconst(PARAMETRIC_ERROR),
-_gluconst(DOMAIN_DISTANCE)
-are only available if the GLU version is 1.1 or greater. They are not
-valid parameters in GLU 1.0.
-.P
-_cmnd(GetString) can
-be used to determine the GLU version.
-.P
-_gluconst(NURBS_MODE) is only availble if the GLU version is 1.3 or
-greater.
-.P
-The _gluconst(OBJECT_PATH_LENGTH) and _gluconst(OBJECT_PARAMETRIC_ERROR)
-values for the _gluconst(SAMPLING_METHOD) property are only available if
-the GLU version is 1.3 or greater.
-.SH SEE ALSO
-_cmnd(GetNurbsProperty),
-_cmnd(LoadSamplingMatrices),
-_cmnd(NewNurbsRenderer),
-_cmnd(GetString),
-_cmnd(NurbsCallback)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/nurbssurface.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/nurbssurface.gl
deleted file mode 100755
index fdf926c1a..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/nurbssurface.gl
+++ /dev/null
@@ -1,121 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(NurbsSurface, define the shape of a NURBS surface)
-_names(NurbsSurface)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the NURBS object (created with _cmnd(NewNurbsRenderer)).
-_phead(_param2)
-Specifies the number of knots in the parametric \f2u\fP direction.
-_phead(_param3)
-Specifies an array of _param2 nondecreasing knot values in the parametric
-\f2u\fP direction.
-_phead(_param4)
-Specifies the number of knots in the parametric \f2v\fP direction.
-_phead(_param5)
-Specifies an array of _param4 nondecreasing knot values in the parametric
-\f2v\fP direction.
-_phead(_param6)
-Specifies the offset (as a number of single-precision floating point values)
-between successive control points in the parametric \f2u\fP direction
-in _param8.
-_phead(_param7)
-Specifies the offset (in single-precision floating-point values)
-between successive control points in the parametric \f2v\fP direction
-in _param8.
-_phead(_param8)
-Specifies an array containing control points for the NURBS surface.
-The offsets between successive control points in the parametric \f2u\fP
-and \f2v\fP directions are given by _param6 and _param7.
-_phead(_param9)
-Specifies the order of the NURBS surface in the parametric \f2u\fP
-direction. The order is one more than the degree, hence
-a surface that is cubic in \f2u\fP has a \f2u\fP order of 4.
-_phead(_param10)
-Specifies the order of the NURBS surface in the parametric \f2v\fP
-direction. The order is one more than the degree, hence
-a surface that is cubic in \f2v\fP has a \f2v\fP order of 4.
-_phead(_param11)
-Specifies type of the surface. _param11 can be any of the valid
-two-dimensional evaluator types (such as _const(MAP2_VERTEX_3) or
-_const(MAP2_COLOR_4)).
-.SH DESCRIPTION
-Use _cmnd within a NURBS (Non-Uniform Rational B-Spline) surface
-definition to describe the shape of a NURBS surface (before
-any trimming). To mark the beginning of
-a NURBS surface definition, use the _cmnd(BeginSurface) command.
-To mark the end of a NURBS surface definition, use the
-_cmnd(EndSurface) command. Call _cmnd within a NURBS
-surface definition only.
-.P
-Positional, texture, and color coordinates are associated
-with a surface by presenting each as a separate _cmnd between a
-_cmnd(BeginSurface)/_cmnd(EndSurface) pair. No more than
-one call to _cmnd for each of color, position, and texture
-data can be made within a single _cmnd(BeginSurface)/_cmnd(EndSurface)
-pair. Exactly one call must be made to describe the position of the
-surface (a _param11 of _const(MAP2_VERTEX_3) or _const(MAP2_VERTEX_4)).
-.P
-A NURBS surface can be trimmed by using the commands
-_cmnd(NurbsCurve) and _cmnd(PwlCurve) between calls to
-_cmnd(BeginTrim) and _cmnd(EndTrim).
-.P
-Note that a _cmnd with _param2 knots in the \f2u\fP direction
-and _param4 knots in the \f2v\fP direction with orders
-_param9 and _param10 must have
-(_param2 - _param9) $times$ (_param4 - _param10) control points.
-.SH EXAMPLE
-The following commands render a textured NURBS surface with normals;
-the texture coordinates and normals are also NURBS surfaces:
-.sp
-.Ex
-gluBeginSurface(nobj);
- gluNurbsSurface(nobj, ..., GL_MAP2_TEXTURE_COORD_2);
- gluNurbsSurface(nobj, ..., GL_MAP2_NORMAL);
- gluNurbsSurface(nobj, ..., GL_MAP2_VERTEX_4);
-gluEndSurface(nobj);
-.Ee
-.sp
-.SH SEE ALSO
-_cmnd(BeginSurface), _cmnd(BeginTrim), _cmnd(NewNurbsRenderer),
-_cmnd(NurbsCurve),
-_cmnd(PwlCurve)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/ortho2d.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/ortho2d.gl
deleted file mode 100755
index 549f83b7c..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/ortho2d.gl
+++ /dev/null
@@ -1,54 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Ortho2D, define a 2D orthographic projection matrix)
-_names(Ortho2D)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1 _param2)
-Specify the coordinates for the left and right vertical clipping planes.
-_phead(_param3 _param4)
-Specify the coordinates for the bottom and top horizontal clipping planes.
-.SH DESCRIPTION
-_cmnd sets up a two-dimensional orthographic viewing region.
-This is equivalent to calling _glcmnd(Ortho) with $ near ~=~ -1 $ and
-$ far ~=~ 1 $.
-.SH SEE ALSO
-_glcmnd(Ortho), _cmnd(Perspective)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/partialdisk.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/partialdisk.gl
deleted file mode 100755
index 4e8bffb0c..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/partialdisk.gl
+++ /dev/null
@@ -1,92 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(PartialDisk, draw an arc of a disk)
-_names(PartialDisk)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies a quadrics object (created with _cmnd(NewQuadric)).
-_phead(_param2)
-Specifies the inner radius of the partial disk (can be 0).
-_phead(_param3)
-Specifies the outer radius of the partial disk.
-_phead(_param4)
-Specifies the number of subdivisions around the \f2z\fP axis.
-_phead(_param5)
-Specifies the number of concentric rings about the origin into which
-the partial disk is subdivided.
-_phead(_param6)
-Specifies the starting angle, in degrees, of the disk portion.
-_phead(_param7)
-Specifies the sweep angle, in degrees, of the disk portion.
-.SH DESCRIPTION
-_cmnd renders a partial disk on the $ z ~=~ 0 $ plane. A partial disk is
-similar to a full disk, except that only the subset of the disk from
-_param6 through _param6 + _param7 is included (where 0 degrees is along the
-+\f2y\f axis,
-90 degrees along the +\f2x\fP axis, 180 degrees along the \-\f2y\fP axis, and
-270 degrees along the \-\f2x\fP axis).
-.P
-The partial disk has a radius of
-_param3, and contains a concentric circular hole with a radius
-of _param2. If _param2 is 0, then no hole is generated. The partial disk is
-subdivided around the \f2z\fP axis into slices (like pizza slices), and also
-about the \f2z\fP axis into rings
-(as specified by _param4 and _param5, respectively).
-.P
-With respect to orientation, the +\f2z\fP
-side of the partial disk is considered to
-be outside (see _cmnd(QuadricOrientation)).
-This means that if the
-orientation is set to _gluconst(OUTSIDE), then any normals generated
-point along the +\f2z\fP axis. Otherwise, they point along the \-\f2z\fP
-axis.
-.P
-If texturing is turned on (with _cmnd(QuadricTexture)), texture
-coordinates are generated
-linearly such that where $ r ~=~ _eqnparam3 $, the value at (\f2r\fP, 0, 0) is
-(1.0, 0.5), at (0, \f2r\fP, 0) it is (0.5, 1.0), at (\-\f2r\fP, 0, 0)
-it is (0.0, 0.5), and
-at (0, \-\f2r\fP, 0) it is (0.5, 0.0).
-.SH SEE ALSO
-_cmnd(Cylinder), _cmnd(Disk), _cmnd(NewQuadric), _cmnd(QuadricOrientation),
-_cmnd(QuadricTexture),
-_cmnd(Sphere)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/perspective.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/perspective.gl
deleted file mode 100755
index 69e0c740a..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/perspective.gl
+++ /dev/null
@@ -1,106 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Perspective, set up a perspective projection matrix)
-_names(Perspective)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the field of view angle, in degrees, in the \f2y\fP direction.
-_phead(_param2)
-Specifies the aspect ratio that determines
-the field of view in the \f2x\fP direction.
-The aspect ratio is the ratio of \f2x\fP (width) to \f2y\fP (height).
-_phead(_param3)
-Specifies the distance from the viewer to the near clipping plane
-(always positive).
-_phead(_param4)
-Specifies the distance from the viewer to the far clipping plane
-(always positive).
-.SH DESCRIPTION
-_cmnd specifies a viewing frustum into the world coordinate system.
-In general, the aspect ratio in _cmnd should match the aspect ratio
-of the associated viewport. For example, $ _eqnparam2 ~=~ 2.0 $ means
-the viewer's
-angle of view is twice as wide in \f2x\fP as it is in \f2y\fP.
-If the viewport is
-twice as wide as it is tall, it displays the image without distortion.
-.P
-The matrix generated by _cmnd is multipled by the current matrix,
-just as if _glcmnd(MultMatrix) were called with the generated matrix.
-To load the perspective matrix onto the current matrix stack instead,
-precede the call to _cmnd with a call to _glcmnd(LoadIdentity).
-.P
-Given \f2f\fP defined as follows:
-.sp
-.ce
-.EQ
-f ~=~ cotangent"("{_eqnparam1 over 2}")"
-.EN
-.bp
-The generated matrix is
-.sp
-.ce
-.EQ
-left ( ~~ down 130 { matrix {
- ccol { {f over _eqnparam2} above 0 above 0 above 0 }
- ccol { 0 above f above 0 above 0 }
- ccol { 0 above 0 above {{_eqnparam4 + _eqnparam3} over {_eqnparam3 - _eqnparam4}} above -1 }
- ccol { 0 above 0 above {{2 * _eqnparam4 * _eqnparam3} over {_eqnparam3 - _eqnparam4}} above 0}
-}} ~~~ right )
-.EN
-
-.SH NOTES
-Depth buffer precision is affected by the values specified for
-_param3 and _param4.
-The greater the ratio of _param4 to _param3 is,
-the less effective the depth buffer will be at distinguishing between
-surfaces that are near each other.
-If
-.sp
-.ce
-$r ~=~ _eqnparam4 over _eqnparam3$
-.sp
-.P
-roughly $log sub 2 r$ bits of depth buffer precision are lost.
-Because $r$ approaches infinity as _param3 approaches 0,
-_param3 must never be set to 0.
-.SH SEE ALSO
-_glcmnd(Frustum), _glcmnd(LoadIdentity),
-_glcmnd(MultMatrix), _cmnd(Ortho2D)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/pickmatrix.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/pickmatrix.gl
deleted file mode 100755
index 1f28b9e89..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/pickmatrix.gl
+++ /dev/null
@@ -1,105 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(PickMatrix, define a picking region)
-_names(PickMatrix)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1 _param2)
-Specify the center of a picking region in window coordinates.
-_phead(_param3 _param4)
-Specify the width and height, respectively, of the picking region in window
-coordinates.
-_phead(_param5)
-Specifies the current viewport (as from a _glcmnd(GetIntegerv) call).
-.SH DESCRIPTION
-_cmnd creates a projection matrix that can be used to restrict drawing
-to a small region of the viewport.
-This is typically useful to
-determine what objects are being drawn near the cursor.
-Use _cmnd to
-restrict drawing to a small region around the cursor.
-Then,
-enter selection mode (with _glcmnd(RenderMode)) and rerender the scene.
-All primitives that would have been drawn near
-the cursor are identified and stored in the selection buffer.
-.P
-The matrix created by _cmnd is multiplied by the current matrix just
-as if _glcmnd(MultMatrix) is called with the generated matrix.
-To effectively use the generated pick matrix for picking,
-first call _glcmnd(LoadIdentity) to load an identity matrix onto the
-perspective matrix stack.
-Then call _cmnd,
-and finally, call a command (such as _cmnd(Perspective))
-to multiply the perspective matrix by the pick matrix.
-.P
-When using _cmnd to pick NURBS, be careful to turn off the NURBS
-property
-_gluconst(AUTO_LOAD_MATRIX). If _gluconst(AUTO_LOAD_MATRIX) is not
-turned off, then any NURBS surface rendered is subdivided differently with
-the pick matrix than the way it was subdivided without the pick matrix.
-.bp
-.SH EXAMPLE
-When rendering a scene as follows:
-.sp
-.Ex
-glMatrixMode(GL_PROJECTION);
-glLoadIdentity();
-gluPerspective(...);
-glMatrixMode(GL_MODELVIEW);
-/* Draw the scene */
-.Ee
-.sp
-a portion of the viewport can be selected as a pick region like this:
-.sp
-.Ex
-glMatrixMode(GL_PROJECTION);
-glLoadIdentity();
-gluPickMatrix(x, y, width, height, viewport);
-gluPerspective(...);
-glMatrixMode(GL_MODELVIEW);
-/* Draw the scene */
-.Ee
-.SH SEE ALSO
-_glcmnd(Get),
-_glcmnd(LoadIndentity),
-_glcmnd(MultMatrix),
-_glcmnd(RenderMode),
-_cmnd(Perspective)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/project.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/project.gl
deleted file mode 100755
index 84895c318..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/project.gl
+++ /dev/null
@@ -1,91 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Project, map object coordinates to window coordinates)
-_names(Project)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1 _param2 _param3)
-Specify the object coordinates.
-_phead(_param4)
-Specifies the current modelview matrix (as from a _glcmnd(GetDoublev) call).
-_phead(_param5)
-Specifies the current projection matrix (as from a _glcmnd(GetDoublev) call).
-_phead(_param6)
-Specifies the current viewport (as from a _glcmnd(GetIntegerv) call).
-_phead(_param7 _param8 _param9)
-Return the computed window coordinates.
-.SH DESCRIPTION
-_cmnd transforms the specified object coordinates into window coordinates
-using _param4, _param5, and _param6. The result is stored
-in _param7, _param8, and _param9. A return value of
-_const(TRUE) indicates success, a return value of _const(FALSE)
-indicates failure.
-.P
-To compute the coordinates,
-let $v ~=~ (_eqnparam1, _eqnparam2, _eqnparam3, 1.0)$
-represented as a matrix with 4 rows and 1 column.
-Then _cmnd computes $v sup prime$
-as follows:
-.sp
-.EQ
-v sup prime ~=~ P ~times~ M ~times~ v
-.EN
-.sp
-where $P$ is the current projection matrix _param5, $M$ is the current
-modelview matrix _param4 (both represented as
-$4 times 4$ matrices in column-major order) and '$times$' represents
-matrix multiplication.
-.P
-The window coordinates are then computed as follows:
-.sp
-.EQ
-_eqnparam7 ~=~ _eqnparam6 (0) ~+~ _eqnparam6 (2) ~*~ (v sup prime (0) ~+~ 1)~/~2
-.EN
-.sp
-.EQ
-_eqnparam8 ~=~ _eqnparam6 (1) ~+~ _eqnparam6 (3)~*~(v sup prime (1) ~+~ 1)~/~2 .EN
-.sp
-.EQ
-_eqnparam9 ~=~ (v sup prime (2) ~+~ 1)~/~ 2
-.EN
-.sp
-.SH SEE ALSO
-_glcmnd(Get), _cmnd(UnProject)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/pwlcurve.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/pwlcurve.gl
deleted file mode 100755
index a200a007e..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/pwlcurve.gl
+++ /dev/null
@@ -1,78 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(PwlCurve, describe a piecewise linear NURBS trimming curve)
-_names(PwlCurve)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the NURBS object (created with _cmnd(NewNurbsRenderer)).
-_phead(_param2)
-Specifies the number of points on the curve.
-_phead(_param3)
-Specifies an array containing the curve points.
-_phead(_param4)
-Specifies the offset (a number of single-precision floating-point values)
-between points on the curve.
-_phead(_param5)
-Specifies the type of curve.
-Must be either _gluconst(MAP1_TRIM_2) or _gluconst(MAP1_TRIM_3).
-.SH DESCRIPTION
-_cmnd describes a piecewise linear trimming curve for a NURBS surface.
-A piecewise linear curve consists of a list of
-coordinates of points in the parameter space for the
-NURBS surface to be trimmed. These points are connected
-with line segments to form a curve. If the curve is
-an approximation to a curve that is not piecewise linear,
-the points should be close enough in parameter space that the
-resulting path appears curved at the resolution used in the application.
-.P
-If _param5 is
-_gluconst(MAP1_TRIM_2), then it describes a curve in two-dimensional (\f2u\fP
-and \f2v\fP) parameter space. If it is _gluconst(MAP1_TRIM_3), then it
-describes a curve in two-dimensional homogeneous (\f2u\fP, \f2v\fP,
-and \f2w\fP) parameter space.
-See the _cmnd(BeginTrim) reference page for more information
-about trimming curves.
-.SH NOTES
-To describe a trim curve that closely follows the contours of a NURBS
-surface, call _cmnd(NurbsCurve).
-.SH SEE ALSO
-_cmnd(BeginCurve), _cmnd(BeginTrim), _cmnd(NewNurbsRenderer), _cmnd(NurbsCurve)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/quadriccallback.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/quadriccallback.gl
deleted file mode 100755
index e070a8005..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/quadriccallback.gl
+++ /dev/null
@@ -1,64 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(QuadricCallback, define a callback for a quadrics object)
-_names(QuadricCallback)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the quadrics object (created with _cmnd(NewQuadric)).
-_phead(_param2)
-Specifies the callback being defined.
-The only valid value is _gluconst(ERROR).
-_phead(_param3)
-Specifies the function to be called.
-.SH DESCRIPTION
-_cmnd is used to define a new callback to be used by a quadrics object.
-If the specified callback is already defined, then it is replaced. If
-_param3 is NULL, then any existing callback is erased.
-.P
-The one legal callback is _gluconst(ERROR):
-.TP 15
-_gluconst(ERROR)
-The function is called when an error is encountered. Its single argument
-is of type GLenum, and it indicates the specific error that occurred.
-Character strings describing these errors can be retrieved with the
-_cmnd(ErrorString) call.
-.SH SEE ALSO
-_cmnd(ErrorString), _cmnd(NewQuadric)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/quadricdrawstyle.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/quadricdrawstyle.gl
deleted file mode 100755
index b4bdc4188..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/quadricdrawstyle.gl
+++ /dev/null
@@ -1,72 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(QuadricDrawStyle, specify the draw style desired for quadrics)
-_names(QuadricDrawStyle)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the quadrics object (created with _cmnd(NewQuadric)).
-_phead(_param2)
-Specifies the desired draw style. Valid values are
-_gluconst(FILL),
-_gluconst(LINE),
-_gluconst(SILHOUETTE), and
-_gluconst(POINT).
-.SH DESCRIPTION
-_cmnd specifies the draw style for quadrics rendered with
-_param1. The legal values are as follows:
-.TP 15
-_gluconst(FILL)
-Quadrics are rendered with polygon primitives. The polygons
-are drawn in a counterclockwise fashion with respect to their
-normals (as defined with _cmnd(QuadricOrientation)).
-.TP
-_gluconst(LINE)
-Quadrics are rendered as a set of lines.
-.TP
-_gluconst(SILHOUETTE)
-Quadrics are rendered as a set of lines, except that edges separating
-coplanar faces will not be drawn.
-.TP
-_gluconst(POINT)
-Quadrics are rendered as a set of points.
-.SH SEE ALSO
-_cmnd(NewQuadric), _cmnd(QuadricNormals), _cmnd(QuadricOrientation),
-_cmnd(QuadricTexture)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/quadricnormals.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/quadricnormals.gl
deleted file mode 100755
index a538eef5c..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/quadricnormals.gl
+++ /dev/null
@@ -1,66 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(QuadricNormals, specify what kind of normals are desired for quadrics)
-_names(QuadricNormals)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifes the quadrics object (created with _cmnd(NewQuadric)).
-_phead(_param2)
-Specifies the desired type of normals. Valid values are
-_gluconst(NONE),
-_gluconst(FLAT), and
-_gluconst(SMOOTH).
-.SH DESCRIPTION
-_cmnd specifies what kind of normals are desired for quadrics rendered with
-_param1. The legal values are as follows:
-.TP 15
-_gluconst(NONE)
-No normals are generated.
-.TP
-_gluconst(FLAT)
-One normal is generated for every facet of a quadric.
-.TP
-_gluconst(SMOOTH)
-One normal is generated for every vertex of a quadric. This is the
-initial value.
-.SH SEE ALSO
-_cmnd(NewQuadric), _cmnd(QuadricDrawStyle), _cmnd(QuadricOrientation),
-_cmnd(QuadricTexture)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/quadricorientation.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/quadricorientation.gl
deleted file mode 100755
index 66af7d3d3..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/quadricorientation.gl
+++ /dev/null
@@ -1,64 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(QuadricOrientation, specify inside/outside orientation for quadrics)
-_names(QuadricOrientation)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the quadrics object (created with _cmnd(NewQuadric)).
-_phead(_param2)
-Specifies the desired orientation. Valid values are
-_gluconst(OUTSIDE) and
-_gluconst(INSIDE).
-.SH DESCRIPTION
-_cmnd specifies what kind of orientation is desired for quadrics rendered
-with _param1. The _param2 values are as follows:
-.TP 15
-_gluconst(OUTSIDE)
-Quadrics are drawn with normals pointing outward (the initial value).
-.TP
-_gluconst(INSIDE)
-Quadrics are drawn with normals pointing inward.
-.P
-Note that the interpretation of \f2outward\fP and \f2inward\fP depends on the
-quadric being drawn.
-.SH SEE ALSO
-_cmnd(NewQuadric), _cmnd(QuadricDrawStyle), _cmnd(QuadricNormals),
-_cmnd(QuadricTexture)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/quadrictexture.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/quadrictexture.gl
deleted file mode 100755
index 0cbcb48cb..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/quadrictexture.gl
+++ /dev/null
@@ -1,60 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(QuadricTexture, specify if texturing is desired for quadrics)
-_names(QuadricTexture)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the quadrics object (created with _cmnd(NewQuadric)).
-_phead(_param2)
-Specifies a flag indicating if texture coordinates should be generated.
-.SH DESCRIPTION
-_cmnd specifies if texture coordinates should be generated
-for quadrics rendered with _param1.
-If the value of _param2 is _const(TRUE), then texture coordinates
-are generated, and if _param2 is _const(FALSE), they are not. The
-initial value is _const(FALSE).
-.P
-The manner in which texture coordinates are generated depends
-upon the specific quadric rendered.
-.SH SEE ALSO
-_cmnd(NewQuadric), _cmnd(QuadricDrawStyle), _cmnd(QuadricNormals),
-_cmnd(QuadricOrientation)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/scaleimage.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/scaleimage.gl
deleted file mode 100755
index a1b3dddd0..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/scaleimage.gl
+++ /dev/null
@@ -1,175 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(ScaleImage, scale an image to an arbitrary size)
-_names(ScaleImage)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the format of the pixel data.
-The following symbolic values are valid:
-_const(COLOR_INDEX),
-_const(STENCIL_INDEX),
-_const(DEPTH_COMPONENT),
-_const(RED),
-_const(GREEN),
-_const(BLUE),
-_const(ALPHA),
-_const(RGB),
-_const(RGBA),
-_const(BGR),
-_const(BGRA),
-_const(LUMINANCE), and
-_const(LUMINANCE_ALPHA).
-_phead(_param2 _param3)
-Specify in pixels the width and height, respectively, of the source image.
-_phead(_param4)
-Specifies the data type for _param5. Must be one of
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV).
-_phead(_param5)
-Specifies a pointer to the source image.
-_phead(_param6 _param7)
-Specify the width and height, respectively, in pixels of the destination image.
-_phead(_param8)
-Specifies the data type for _param9. Must be one of
-_const(UNSIGNED_BYTE),
-_const(BYTE),
-_const(BITMAP),
-_const(UNSIGNED_SHORT),
-_const(SHORT),
-_const(UNSIGNED_INT),
-_const(INT),
-_const(FLOAT),
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), or
-_const(UNSIGNED_INT_2_10_10_10_REV).
-_phead(_param9)
-Specifies a pointer to the destination image.
-.SH DESCRIPTION
-_cmnd scales a pixel image using the appropriate pixel store modes to
-unpack data from the source image and pack data into the destination image.
-.P
-When shrinking an image, _cmnd uses a box filter to sample the source image
-and create pixels for the destination image. When magnifying an image,
-the pixels from the source image are linearly interpolated to create the
-destination image.
-.P
-A return value of zero indicates success, otherwise a GLU error code is returned (see _cmnd(ErrorString)).
-.P
-See the _glcmnd(ReadPixels) reference page for a description of
-the acceptable values for the _param1, _param4, and _param8 parameters.
-.SH NOTES
-Formats _const(BGR), and _const(BGRA), and types
-_const(UNSIGNED_BYTE_3_3_2),
-_const(UNSIGNED_BYTE_2_3_3_REV),
-_const(UNSIGNED_SHORT_5_6_5),
-_const(UNSIGNED_SHORT_5_6_5_REV),
-_const(UNSIGNED_SHORT_4_4_4_4),
-_const(UNSIGNED_SHORT_4_4_4_4_REV),
-_const(UNSIGNED_SHORT_5_5_5_1),
-_const(UNSIGNED_SHORT_1_5_5_5_REV),
-_const(UNSIGNED_INT_8_8_8_8),
-_const(UNSIGNED_INT_8_8_8_8_REV),
-_const(UNSIGNED_INT_10_10_10_2), and
-_const(UNSIGNED_INT_2_10_10_10_REV) are only available if the GL version
-is 1.2 or greater.
-.SH ERRORS
-_gluconst(INVALID_VALUE) is returned if _param2, _param3, _param6, or _param7
-is negative.
-.P
-_gluconst(INVALID_ENUM) is returned if _param1, _param4, or _param8 is not
-legal.
-.P
-_gluconst(INVALID_OPERATION) is returned if _param4 or _param8 is
-_const(UNSIGNED_BYTE_3_3_2) or _const(UNSIGNED_BYTE_2_3_3_REV)
-and _param1 is not _const(RGB).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param4 or _param8 is
-_const(UNSIGNED_SHORT_5_6_5) or _const(UNSIGNED_SHORT_5_6_5_REV)
-and _param1 is not _const(RGB).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param4 or _param8 is
-_const(UNSIGNED_SHORT_4_4_4_4) or _const(UNSIGNED_SHORT_4_4_4_4_REV)
-and _param1 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param4 or _param8 is
-_const(UNSIGNED_SHORT_5_5_5_1) or _const(UNSIGNED_SHORT_1_5_5_5_REV)
-and _param1 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param4 or _param8 is
-_const(UNSIGNED_INT_8_8_8_8) or _const(UNSIGNED_INT_8_8_8_8_REV)
-and _param1 is neither _const(RGBA) nor _const(BGRA).
-.P
-_gluconst(INVALID_OPERATION) is returned if _param4 or _param8 is
-_const(UNSIGNED_INT_10_10_10_2) or _const(UNSIGNED_INT_2_10_10_10_REV)
-and _param1 is neither _const(RGBA) nor _const(BGRA).
-.SH SEE ALSO
-_glcmnd(DrawPixels), _glcmnd(ReadPixels), _cmnd(Build1DMipmaps), _cmnd(Build2DMipmaps),
-_cmnd(Build3DMipmaps),
-.BR
-_cmnd(ErrorString)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/sphere.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/sphere.gl
deleted file mode 100755
index a4cc0e2f3..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/sphere.gl
+++ /dev/null
@@ -1,77 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(Sphere, draw a sphere)
-_names(Sphere)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the quadrics object (created with _cmnd(NewQuadric)).
-_phead(_param2)
-Specifies the radius of the sphere.
-_phead(_param3)
-Specifies the number of subdivisions around the \f2z\fP axis
-(similar to lines of longitude).
-_phead(_param4)
-Specifies the number of subdivisions along the \f2z\fP axis
-(similar to lines of latitude).
-.SH DESCRIPTION
-_cmnd draws a sphere of the given radius centered around the origin. The
-sphere is subdivided around the \f2z\fP axis into slices and along the
-\f2z\fP axis
-into stacks (similar to lines of longitude and latitude).
-.P
-If the orientation is set to _gluconst(OUTSIDE)
-(with _cmnd(QuadricOrientation)), then any normals generated
-point away from the center of the sphere.
-Otherwise, they point toward the center of the sphere.
-.P
-If texturing is turned on (with _cmnd(QuadricTexture)), then texture
-coordinates are
-generated so that \f2t\fP ranges from 0.0 at $ z ~=~ -^_eqnparam2 $ to 1.0 at
-$ z ~=~ _eqnparam2 $ (\f2t\fP increases linearly along longitudinal
-lines),
-and \f2s\fP ranges from 0.0 at the +\f2y\fP axis, to 0.25 at the
-+\f2x\fP axis,
-to 0.5 at the \-\f2y\fP axis, to 0.75 at the \-\f2x\fP axis, and back to 1.0
-at the +\f2y\fP axis.
-.SH SEE ALSO
-_cmnd(Cylinder), _cmnd(Disk), _cmnd(NewQuadric),
-_cmnd(PartialDisk), _cmnd(QuadricOrientation),
-_cmnd(QuadricTexture)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/tessbegincontour.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/tessbegincontour.gl
deleted file mode 100755
index 07a84dc2b..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/tessbegincontour.gl
+++ /dev/null
@@ -1,58 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(TessBeginContour, delimit a contour description)
-_names(TessBeginContour)
-_names(TessEndContour,,noheader)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the tessellation object (created with _cmnd(NewTess)).
-.SH DESCRIPTION
-_cmnd(TessBeginContour) and _cmnd(TessEndContour) delimit the definition of a
-polygon contour. Within each _cmnd(TessBeginContour)/_cmnd(TessEndContour)
-pair, there can be zero or more calls to _cmnd(TessVertex). The vertices
-specify a closed contour (the last vertex of each contour is automatically linked
-to the first). See the _cmnd(TessVertex) reference page for more details.
-_cmnd can only be called between _cmnd(TessBeginPolygon) and _cmnd(TessEndPolygon).
-.SH SEE ALSO
-_cmnd(NewTess), _cmnd(TessBeginPolygon), _cmnd(TessVertex),
-_cmnd(TessCallback),
-_cmnd(TessProperty), _cmnd(TessNormal),
-_cmnd(TessEndPolygon)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/tessbeginpolygon.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/tessbeginpolygon.gl
deleted file mode 100755
index 339f10853..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/tessbeginpolygon.gl
+++ /dev/null
@@ -1,88 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(TessBeginPolygon, delimit a polygon description)
-_names(TessBeginPolygon)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the tessellation object (created with _cmnd(NewTess)).
-_phead(_param2)
-Specifies a pointer to user polygon data.
-.SH DESCRIPTION
-_cmnd(TessBeginPolygon) and _cmnd(TessEndPolygon) delimit the definition of a
-convex, concave or self-intersecting polygon. Within each _cmnd(TessBeginPolygon)/_cmnd(TessEndPolygon)
-pair, there must be one or more calls to _cmnd(TessBeginContour)/_cmnd(TessEndContour).
-Within each contour, there are zero or more calls to _cmnd(TessVertex). The vertices
-specify a closed contour (the last vertex of each contour is automatically linked
-to the first). See the _cmnd(TessVertex), _cmnd(TessBeginContour), and
-_cmnd(TessEndContour) reference pages for more details.
-.P
-_param2 is a pointer to a user-defined data structure. If the appropriate callback(s)
-are specified (see _cmnd(TessCallback)), then this pointer is returned to the
-callback function(s). Thus, it is a convenient way to store per-polygon information.
-.P
-Once _cmnd(TessEndPolygon) is called, the polygon is tessellated, and the
-resulting triangles are described through callbacks.
-See _cmnd(TessCallback) for descriptions of the callback functions.
-.SH EXAMPLE
-A quadrilateral with a triangular hole in it can be described as follows:
-.sp
-.Ex
-gluTessBeginPolygon(tobj, NULL);
- gluTessBeginContour(tobj);
- gluTessVertex(tobj, v1, v1);
- gluTessVertex(tobj, v2, v2);
- gluTessVertex(tobj, v3, v3);
- gluTessVertex(tobj, v4, v4);
- gluTessEndContour(tobj);
-.bp
- gluTessBeginContour(tobj);
- gluTessVertex(tobj, v5, v5);
- gluTessVertex(tobj, v6, v6);
- gluTessVertex(tobj, v7, v7);
- gluTessEndContour(tobj);
-gluTessEndPolygon(tobj);
-.Ee
-.sp
-.SH SEE ALSO
-_cmnd(NewTess), _cmnd(TessBeginContour), _cmnd(TessVertex),
-_cmnd(TessCallback),
-_cmnd(TessProperty), _cmnd(TessNormal),
-_cmnd(TessEndPolygon)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/tesscallback.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/tesscallback.gl
deleted file mode 100755
index ae76ad2c7..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/tesscallback.gl
+++ /dev/null
@@ -1,307 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(TessCallback, define a callback for a tessellation object)
-_names(TessCallback)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the tessellation object (created with _cmnd(NewTess)).
-_phead(_param2)
-Specifies the callback being defined. The following values are valid:
-_gluconst(TESS_BEGIN),
-_gluconst(TESS_BEGIN_DATA),
-_gluconst(TESS_EDGE_FLAG),
-_gluconst(TESS_EDGE_FLAG_DATA),
-_gluconst(TESS_VERTEX),
-_gluconst(TESS_VERTEX_DATA),
-_gluconst(TESS_END),
-_gluconst(TESS_END_DATA),
-_gluconst(TESS_COMBINE),
-_gluconst(TESS_COMBINE_DATA),
-_gluconst(TESS_ERROR), and
-_gluconst(TESS_ERROR_DATA).
-_phead(_param3)
-Specifies the function to be called.
-.SH DESCRIPTION
-_cmnd is used to indicate a callback to be used by a tessellation object.
-If the specified callback is already defined, then it is replaced. If
-_param3 is NULL, then the existing callback becomes undefined.
-.P
-These callbacks are used by the tessellation object to describe how a
-polygon specified by the user is broken into triangles. Note that there
-are two versions of each callback: one with user-specified polygon data
-and one without. If both versions of a particular callback are specified,
-then the callback with user-specified polygon data will be used. Note
-that the \f2polygon_data\fP parameter used by some of the functions is
-a copy of the pointer that was specified when
-_cmnd(TessBeginPolygon) was called. The legal callbacks are as follows:
-.TP 10
-_gluconst(TESS_BEGIN)
-The begin callback is invoked like _glcmnd(Begin) to indicate the start of
-a (triangle) primitive. The function takes a single argument of type
-GLenum. If the _gluconst(TESS_BOUNDARY_ONLY) property is set to
-_const(FALSE), then the argument is set to either
-_const(TRIANGLE_FAN), _const(TRIANGLE_STRIP), or _const(TRIANGLES). If
-the _gluconst(TESS_BOUNDARY_ONLY) property is set to _const(TRUE),
-then the argument will be set to _const(LINE_LOOP). The function
-prototype for this callback is:
-.RS
-.Ex
-void begin ( GLenum type );
-.Ee
-.RE
-.TP
-_gluconst(TESS_BEGIN_DATA)
-The same as the _gluconst(TESS_BEGIN) callback except that it
-takes an additional pointer argument. This pointer is identical to the
-opaque pointer provided when
-_cmnd(TessBeginPolygon) was called. The function prototype for this callback
-is:
-.RS
-.Ex
-void beginData ( GLenum type, void *polygon_data );
-.Ee
-.RE
-.TP
-_gluconst(TESS_EDGE_FLAG)
-The edge flag callback is similar to _glcmnd(EdgeFlag). The function
-takes a single boolean flag that indicates which edges lie on the
-polygon boundary. If the flag is _const(TRUE), then each vertex
-that follows begins an edge that lies on the polygon boundary, that is,
-an edge that separates an interior region from an exterior one.
-If the flag is _const(FALSE), then each vertex that follows begins an edge
-that lies in the polygon interior. The edge flag callback (if defined) is
-invoked before the first vertex callback.
-.IP
-Since triangle fans and triangle strips do not support edge flags, the begin
-callback is not called with _const(TRIANGLE_FAN) or _const(TRIANGLE_STRIP)
-if a non-NULL edge flag callback is provided. (If the callback is
-initialized to NULL, there is no impact on performance). Instead, the fans and
-strips are converted to independent triangles. The function prototype
-for this callback is:
-.RS
-.Ex
-void edgeFlag ( GLboolean flag );
-.Ee
-.RE
-.TP
-_gluconst(TESS_EDGE_FLAG_DATA)
-The same as the _gluconst(TESS_EDGE_FLAG) callback except that it takes an additional pointer
-argument. This pointer is identical to the opaque pointer provided when
-_cmnd(TessBeginPolygon) was called. The function prototype for this callback
-is:
-.RS
-.Ex
-void edgeFlagData ( GLboolean flag, void *polygon_data );
-.Ee
-.RE
-.TP
-_gluconst(TESS_VERTEX)
-The vertex callback is invoked between the begin and end callbacks.
-It is similar to _glcmnd(Vertex), and it defines the vertices of the triangles
-created by the tessellation process. The function
-takes a pointer as its only argument. This pointer is identical to
-the opaque pointer provided by the user when the vertex was described
-(see _cmnd(TessVertex)). The function prototype for this callback is:
-.RS
-.Ex
-void vertex ( void *vertex_data );
-.Ee
-.RE
-.TP
-_gluconst(TESS_VERTEX_DATA)
-The same as the _gluconst(TESS_VERTEX) callback except that it takes an additional pointer
-argument. This pointer is identical to the opaque pointer provided when
-_cmnd(TessBeginPolygon) was called. The function prototype for this callback
-is:
-.RS
-.Ex
-void vertexData ( void *vertex_data, void *polygon_data );
-.Ee
-.RE
-.TP
-_gluconst(TESS_END)
-The end callback serves the same purpose as _glcmnd(End). It indicates the
-end of a primitive and it takes no arguments. The function prototype for this
-callback is:
-.RS
-.Ex
-void end ( void );
-.Ee
-.RE
-.TP
-_gluconst(TESS_END_DATA)
-The same as the _gluconst(TESS_END) callback except that it takes an additional pointer
-argument. This pointer is identical to the opaque pointer provided when
-_cmnd(TessBeginPolygon) was called. The function prototype for this callback
-is:
-.RS
-.Ex
-void endData ( void *polygon_data);
-.Ee
-.RE
-.TP 10
-_gluconst(TESS_COMBINE)
-The combine callback is called to create a new vertex when the tessellation
-detects an intersection, or wishes to merge features. The function takes
-four arguments: an array of three elements each of type GLdouble, an array
-of four pointers, an array of four elements each of type GLfloat, and a
-pointer to a pointer. The prototype is:
-.RS
-.Ex
-void combine( GLdouble coords[3], void *vertex_data[4],
- GLfloat weight[4], void **outData );
-.Ee
-.RE
-.IP
-The vertex is defined as a linear combination of up to four existing vertices,
-stored in \f2vertex_data\fP. The coefficients of the linear
-combination are given by \f2weight\fP; these weights always add up to 1.
-All vertex pointers are valid even when some of the weights are 0.
-\f2coords\fP gives the location of the new vertex.
-.IP
-The user must allocate another vertex, interpolate parameters using
-\f2vertex_data\fP and \f2weight\fP, and return the new vertex pointer in
-\f2outData\fP. This handle is supplied during rendering callbacks.
-The user is responsible for freeing the memory some time after
-_cmnd(TessEndPolygon) is called.
-.IP
-For example, if the polygon lies in an arbitrary plane in 3-space,
-and a color is associated with each vertex, the
-_gluconst(TESS_COMBINE) callback might look like this:
-.RS
-.Ex
-void myCombine( GLdouble coords[3], VERTEX *d[4],
- GLfloat w[4], VERTEX **dataOut )
-{
- VERTEX *new = new_vertex();
-
- new->x = coords[0];
- new->y = coords[1];
- new->z = coords[2];
- new->r = w[0]*d[0]->r + w[1]*d[1]->r + w[2]*d[2]->r + w[3]*d[3]->r;
- new->g = w[0]*d[0]->g + w[1]*d[1]->g + w[2]*d[2]->g + w[3]*d[3]->g;
- new->b = w[0]*d[0]->b + w[1]*d[1]->b + w[2]*d[2]->b + w[3]*d[3]->b;
- new->a = w[0]*d[0]->a + w[1]*d[1]->a + w[2]*d[2]->a + w[3]*d[3]->a;
- *dataOut = new;
-}
-.Ee
-.RE
-.IP
-If the tessellation detects an intersection, then the _gluconst(TESS_COMBINE) or
-_gluconst(TESS_COMBINE_DATA) callback (see below) must be defined, and it must
-write a non-NULL pointer into \f2dataOut\fP. Otherwise the
-_gluconst(TESS_NEED_COMBINE_CALLBACK) error occurs, and no
-output is generated.
-.TP
-_gluconst(TESS_COMBINE_DATA)
-The same as the _gluconst(TESS_COMBINE) callback except that it takes an additional pointer
-argument. This pointer is identical to the opaque pointer provided when
-_cmnd(TessBeginPolygon) was called. The function prototype for this callback
-is:
-.RS
-.Ex
-void combineData ( GLdouble coords[3], void *vertex_data[4],
- GLfloat weight[4], void **outData,
- void *polygon_data );
-.Ee
-.RE
-.TP 10
-_gluconst(TESS_ERROR)
-The error callback is called when an error is encountered. The one argument
-is of type GLenum; it indicates the specific error that occurred and will be
-set to one of _gluconst(TESS_MISSING_BEGIN_POLYGON), _gluconst(TESS_MISSING_END_POLYGON),
-_gluconst(TESS_MISSING_BEGIN_CONTOUR), _gluconst(TESS_MISSING_END_CONTOUR),
-_gluconst(TESS_COORD_TOO_LARGE), _gluconst(TESS_NEED_COMBINE_CALLBACK) or
-_gluconst(OUT_OF_MEMORY). Character
-strings describing these errors can be retrieved with the
-_cmnd(ErrorString) call. The function prototype for this callback is:
-.RS
-.Ex
-void error ( GLenum errno );
-.Ee
-.RE
-.IP
-The GLU library will recover from the first four
-errors by inserting the missing call(s).
-_gluconst(TESS_COORD_TOO_LARGE) indicates that some vertex coordinate exceeded
-the predefined constant _gluconst(TESS_MAX_COORD) in absolute value, and
-that the value has been clamped. (Coordinate values must be small
-enough so that two can be multiplied together without overflow.)
-_gluconst(TESS_NEED_COMBINE_CALLBACK) indicates that the tessellation
-detected an intersection between two edges in the input data, and the
-_gluconst(TESS_COMBINE) or _gluconst(TESS_COMBINE_DATA) callback was
-not provided. No output is generated. _gluconst(OUT_OF_MEMORY) indicates
-that there is not enough memory so no output is generated.
-.TP
-_gluconst(TESS_ERROR_DATA)
-The same as the _gluconst(TESS_ERROR) callback except that it takes an additional pointer
-argument. This pointer is identical to the opaque pointer provided when
-_cmnd(TessBeginPolygon) was called. The function prototype for this callback
-is:
-.RS
-.Ex
-void errorData ( GLenum errno, void *polygon_data );
-.Ee
-.RE
-.SH EXAMPLE
-Polygons tessellated can be rendered directly like this:
-.sp
-.Ex
-gluTessCallback(tobj, GLU_TESS_BEGIN, glBegin);
-gluTessCallback(tobj, GLU_TESS_VERTEX, glVertex3dv);
-gluTessCallback(tobj, GLU_TESS_END, glEnd);
-gluTessCallback(tobj, GLU_TESS_COMBINE, myCombine);
-gluTessBeginPolygon(tobj, NULL);
- gluTessBeginContour(tobj);
- gluTessVertex(tobj, v, v);
- ...
- gluTessEndContour(tobj);
-gluTessEndPolygon(tobj);
-.Ee
-.sp
-Typically, the tessellated polygon should be stored in a display list so that
-it does not need to be retessellated every time it is rendered.
-.SH SEE ALSO
-_glcmnd(Begin), _glcmnd(EdgeFlag), _glcmnd(Vertex), _cmnd(NewTess),
-_cmnd(ErrorString), _cmnd(TessVertex),
-_cmnd(TessBeginPolygon),
-_cmnd(TessBeginContour), _cmnd(TessProperty), _cmnd(TessNormal)
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/tessendpolygon.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/tessendpolygon.gl
deleted file mode 100755
index 20532003d..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/tessendpolygon.gl
+++ /dev/null
@@ -1,86 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(TessEndPolygon, delimit a polygon description)
-_names(TessEndPolygon)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the tessellation object (created with _cmnd(NewTess)).
-.SH DESCRIPTION
-_cmnd(TessBeginPolygon) and _cmnd(TessEndPolygon) delimit the definition of a
-convex, concave or self-intersecting polygon. Within each _cmnd(TessBeginPolygon)/_cmnd(TessEndPolygon)
-pair, there must be one or more calls to _cmnd(TessBeginContour)/_cmnd(TessEndContour).
-Within each contour, there are zero or more calls to _cmnd(TessVertex). The vertices
-specify a closed contour (the last vertex of each contour is automatically linked
-to the first). See the _cmnd(TessVertex), _cmnd(TessBeginContour) and
-_cmnd(TessEndContour) reference pages for more details.
-.P
-Once _cmnd(TessEndPolygon) is called, the polygon is tessellated, and the
-resulting triangles are described through callbacks.
-See _cmnd(TessCallback) for descriptions of the callback functions.
-.SH EXAMPLE
-A quadrilateral with a triangular hole in it can be described like this:
-.sp
-.Ex
-gluTessBeginPolygon(tobj, NULL);
- gluTessBeginContour(tobj);
- gluTessVertex(tobj, v1, v1);
- gluTessVertex(tobj, v2, v2);
- gluTessVertex(tobj, v3, v3);
- gluTessVertex(tobj, v4, v4);
- gluTessEndContour(tobj);
- gluTessBeginContour(tobj);
- gluTessVertex(tobj, v5, v5);
- gluTessVertex(tobj, v6, v6);
- gluTessVertex(tobj, v7, v7);
- gluTessEndContour(tobj);
-gluTessEndPolygon(tobj);
-.Ee
-.bp
-In the above example the pointers, $v1$ through $v7$,
-should point to different
-addresses,
-since the values stored at these addresses will not be read by
-the tesselator until _cmnd(TessEndPolygon) is called.
-.SH SEE ALSO
-_cmnd(NewTess), _cmnd(TessBeginContour), _cmnd(TessVertex),
-_cmnd(TessCallback),
-_cmnd(TessProperty), _cmnd(TessNormal),
-_cmnd(TessBeginPolygon)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/tessnormal.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/tessnormal.gl
deleted file mode 100755
index 70b748945..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/tessnormal.gl
+++ /dev/null
@@ -1,78 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(TessNormal, specify a normal for a polygon)
-_names(TessNormal)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the tessellation object (created with _cmnd(NewTess)).
-_phead(_param2)
-Specifies the first component of the normal.
-_phead(_param3)
-Specifies the second component of the normal.
-_phead(_param4)
-Specifies the third component of the normal.
-.SH DESCRIPTION
-_cmnd describes a normal for a polygon that the program is defining.
-All input data will be projected onto a plane perpendicular to one of
-the three coordinate axes before tessellation and all output triangles
-will be oriented CCW with
-respect to the normal (CW orientation can be obtained by reversing the
-sign of the supplied normal). For example, if you know that all polygons
-lie in the x-y plane, call _cmnd(TessNormal)(tess, 0.0, 0.0, 1.0)
-before rendering any polygons.
-.P
-If the supplied normal is (0.0, 0.0, 0.0) (the initial value), the normal is
-determined as follows. The direction of the normal, up to its sign, is
-found by fitting a plane to the vertices, without regard to how the
-vertices are connected. It is expected that the input data lies approximately
-in the plane; otherwise, projection perpendicular to one of the three
-coordinate axes may substantially change the geometry. The sign of the
-normal is chosen so that the sum of the signed areas of all input
-contours is nonnegative (where a CCW contour has positive area).
-.P
-The supplied normal persists until it is changed by another call to
-_cmnd(TessNormal).
-.SH SEE ALSO
-_cmnd(TessBeginPolygon),
-_cmnd(TessEndPolygon)
-
-
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/tessproperty.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/tessproperty.gl
deleted file mode 100755
index d47737620..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/tessproperty.gl
+++ /dev/null
@@ -1,112 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(TessProperty, set a tessellation object property)
-_names(TessProperty)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the tessellation object (created with _cmnd(NewTess)).
-_phead(_param2)
-Specifies the property to be set. Valid values are
-_gluconst(TESS_WINDING_RULE),
-_gluconst(TESS_BOUNDARY_ONLY),
-_gluconst(TESS_TOLERANCE).
-_phead(_param3)
-Specifies the value of the indicated property.
-.SH DESCRIPTION
-_cmnd is used to control properties stored in a tessellation object. These
-properties affect the way that the polygons are interpreted and rendered.
-The legal values for _param2 are as follows:
-.TP 15
-_gluconst(TESS_WINDING_RULE)
-Determines which parts of the polygon are on the "interior".
-_param3 may be set to one of _gluconst(TESS_WINDING_ODD),
-_gluconst(TESS_WINDING_NONZERO), _gluconst(TESS_WINDING_POSITIVE), or
-_gluconst(TESS_WINDING_NEGATIVE), or _gluconst(TESS_WINDING_ABS_GEQ_TWO).
-.IP
-To understand how the winding rule works, consider that the input
-contours partition the plane into regions. The winding rule determines which
-of these regions are inside the polygon.
-.IP
-For a single contour C, the winding number of a point x is simply the signed
-number of revolutions we make around x as we travel once around C
-(where CCW is positive). When there are several contours, the individual
-winding numbers are summed. This procedure associates a signed integer
-value with each point x in the plane. Note that the winding number is the
-same for all points in a single region.
-.bp
-.IP
-The winding rule classifies a region as "inside" if its winding number
-belongs to the chosen category (odd, nonzero, positive, negative, or
-absolute value of at least two). The previous GLU tessellator (prior to
-GLU 1.2) used the "odd" rule. The "nonzero" rule is another common way to
-define the interior. The other three rules are useful for polygon CSG
-operations.
-.TP
-_gluconst(TESS_BOUNDARY_ONLY)
-Is a boolean value ("value" should be set
-to GL_TRUE or GL_FALSE). When set to GL_TRUE, a set of closed contours
-separating the polygon interior and exterior are returned instead of a
-tessellation. Exterior contours are oriented CCW with respect to the
-normal; interior contours are oriented CW. The _gluconst(TESS_BEGIN)
-and _gluconst(TESS_BEGIN_DATA) callbacks use the type GL_LINE_LOOP for
-each contour.
-.TP
-_gluconst(TESS_TOLERANCE)
-Specifies a tolerance for merging features to reduce the size of the output.
-For example, two vertices that are very close to each other might be
-replaced by a single vertex. The tolerance is multiplied by the largest
-coordinate magnitude of any input vertex; this specifies the maximum
-distance that any feature can move as the result of a single merge
-operation. If a single feature takes part in several merge operations, the
-total distance moved could be larger.
-.IP
-Feature merging is completely optional; the tolerance is only a hint.
-The implementation is free to merge in some cases and not in others, or to
-never merge features at all. The initial tolerance is 0.
-.IP
-The current implementation merges vertices only if they are exactly
-coincident, regardless of the current tolerance. A vertex is spliced into
-an edge only if the implementation is unable to distinguish which side of
-the edge the vertex lies on. Two edges are merged only when both endpoints
-are identical.
-.SH SEE ALSO
-_cmnd(GetTessProperty),
-_cmnd(NewTess)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/tessvertex.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/tessvertex.gl
deleted file mode 100755
index 6184c288e..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/tessvertex.gl
+++ /dev/null
@@ -1,112 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(TessVertex, specify a vertex on a polygon)
-_names(TessVertex)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1)
-Specifies the tessellation object (created with _cmnd(NewTess)).
-_phead(_param2)
-Specifies the location of the vertex.
-_phead(_param3)
-Specifies an opaque pointer passed back to the program with the vertex callback
-(as specified by _cmnd(TessCallback)).
-.SH DESCRIPTION
-_cmnd describes a vertex on a polygon that the program defines. Successive
-_cmnd calls describe a closed contour. For example,
-to describe a quadrilateral _cmnd should be called four times.
-_cmnd can only be called between _cmnd(TessBeginContour) and
-_cmnd(TessEndContour).
-.P
-_param3 normally points to a structure containing the vertex
-location, as well as other per-vertex attributes such as color and normal.
-This pointer is passed back to the user through the _gluconst(TESS_VERTEX)
-or _gluconst(TESS_VERTEX_DATA) callback after tessellation
-(see the _cmnd(TessCallback) reference page).
-.SH EXAMPLE
-A quadrilateral with a triangular hole in it can be described as follows:
-.sp
-.Ex
-gluTessBeginPolygon(tobj, NULL);
- gluTessBeginContour(tobj);
- gluTessVertex(tobj, v1, v1);
- gluTessVertex(tobj, v2, v2);
- gluTessVertex(tobj, v3, v3);
- gluTessVertex(tobj, v4, v4);
- gluTessEndContour(tobj);
- gluTessBeginContour(tobj);
- gluTessVertex(tobj, v5, v5);
- gluTessVertex(tobj, v6, v6);
- gluTessVertex(tobj, v7, v7);
- gluTessEndContour(tobj);
-gluTessEndPolygon(tobj);
-.Ee
-.sp
-.SH NOTES
-It is a common error to use a local variable for _param2 or _param3 and store
-values into it as part of a loop.
-For example:
-.Ex
-for (i = 0; i < NVERTICES; ++i) {
- GLdouble data[3];
- data[0] = vertex[i][0];
- data[1] = vertex[i][1];
- data[2] = vertex[i][2];
- gluTessVertex(tobj, data, data);
- }
-.Ee
-.P
-This doesn't work.
-Because the pointers specified by _param2 and _param3 might not be
-dereferenced until _cmnd(TessEndPolygon) is executed,
-all the vertex coordinates but the very last set could be overwritten
-before tessellation begins.
-.P
-Two common symptoms of this problem are consists of a single point
-(when a local variable is used for _param3) and a
-_gluconst(TESS_NEED_COMBINE_CALLBACK) error (when a local variable is
-used for _param2).
-.SH SEE ALSO
-_cmnd(TessBeginPolygon), _cmnd(NewTess), _cmnd(TessBeginContour),
-_cmnd(TessCallback),
-_cmnd(TessProperty), _cmnd(TessNormal),
-_cmnd(TessEndPolygon)
-
-
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/unproject.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/unproject.gl
deleted file mode 100755
index 867ffd2a3..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/unproject.gl
+++ /dev/null
@@ -1,83 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(UnProject, map window coordinates to object coordinates)
-_names(UnProject)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1 _param2 _param3)
-Specify the window coordinates to be mapped.
-_phead(_param4)
-Specifies the modelview matrix (as from a _glcmnd(GetDoublev) call).
-_phead(_param5)
-Specifies the projection matrix (as from a _glcmnd(GetDoublev) call).
-_phead(_param6)
-Specifies the viewport (as from a _glcmnd(GetIntegerv) call).
-_phead(_param7 _param8 _param9)
-Returns the computed object coordinates.
-.SH DESCRIPTION
-_cmnd maps the specified window coordinates into object
-coordinates using _param4, _param5, and _param6.
-The result is stored in _param7, _param8, and _param9. A return value of
-_const(TRUE) indicates success; a return value of _const(FALSE)
-indicates failure.
-.P
-To compute the coordinates (_param7, _param8, and _param9),
-_cmnd multiplies the normalized device coordinates by the inverse of
-_param4*_param5 as follows:
-
-.P
-.ce
-.EQ
-left ( down 70 {cpile { ~_eqnparam7 above ~_eqnparam8 above ~_eqnparam9
-above ~W}} ~~ right ) ~=~ INV(P M)
-left ( down 140 {cpile {
-{ {2(_eqnparam1 ~-~ _eqnparam6[0])} over {_eqnparam6 [2]} ~-~ 1 }
-above
-{ {2(_eqnparam2 ~-~ _eqnparam6[1])} over {_eqnparam6[3]} ~-~ 1 }
-above
-{ 2(_eqnparam3) ~-~ 1 }
-above
-1}} ~~ right )
-.EN
-.bp
-$INV()$ denotes matrix inversion.
-W is an unused variable, included for consistent matrix notation.
-.SH SEE ALSO
-_glcmnd(Get), _cmnd(Project)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/unproject4.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/unproject4.gl
deleted file mode 100755
index 0cc14b661..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/unproject4.gl
+++ /dev/null
@@ -1,102 +0,0 @@
-_C_ License Applicability. Except to the extent portions of this file are
-_C_ made subject to an alternative license as permitted in the SGI Free
-_C_ Software License B, Version 1.1 (the "License"), the contents of this
-_C_ file are subject only to the provisions of the License. You may not use
-_C_ this file except in compliance with the License. You may obtain a copy
-_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-_C_
-_C_ http://oss.sgi.com/projects/FreeB
-_C_
-_C_ Note that, as provided in the License, the Software is distributed on an
-_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-_C_
-_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
-_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-_C_ Copyright in any portions created by third parties is as indicated
-_C_ elsewhere herein. All Rights Reserved.
-_C_
-_C_ Additional Notice Provisions: The application programming interfaces
-_C_ established by SGI in conjunction with the Original Code are The
-_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
-_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
-_C_ published by SGI, but has not been independently verified as being
-_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
-_C_
-_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-_C_ The first character in this file must be an '_'!
-_C_ Anything on a line after _C_ is ignored
-_define(_filters,eqn)_C_
-_C_ eqn is automatically replaced with neqn for nroff
-_header(UnProject4, map window and clip coordinates to object coordinates)
-_names(UnProject4)
-.EQ
-delim $$
-.EN
-.SH PARAMETERS
-_phead(_param1 _param2 _param3)
-Specify the window coordinates to be mapped.
-_phead(_param4)
-Specify the clip w coordinate to be mapped.
-_phead(_param5)
-Specifies the modelview matrix (as from a _glcmnd(GetDoublev) call).
-_phead(_param6)
-Specifies the projection matrix (as from a _glcmnd(GetDoublev) call).
-_phead(_param7)
-Specifies the viewport (as from a _glcmnd(GetIntegerv) call).
-_phead(_param8 _param9)
-Specifies the near and far planes (as from a _glcmnd(GetDoublev) call).
-_phead(_param10 _param11 _param12 _param13)
-Returns the computed object coordinates.
-.SH DESCRIPTION
-_cmnd maps the specified window coordinates _param1, _param2 and _param3
-and its clip w coordinate _param4
-into object
-coordinates (_param10, _param11, _param12, _param13)
-using _param5, _param6 and _param7. _param4 can be other than
-1 as for vertices in _glcmnd(FeedbackBuffer) when data type
-_const(4D_COLOR_TEXTURE) is returned.
-This also handles the case
-where the _param8 and _param9 planes are different from the default,
-0 and 1, respectively.
-A return
-value of _const(TRUE) indicates success; a return value of _const(FALSE)
-indicates failure.
-.P
-To compute the coordinates (_param10, _param11, _param12 and _param13),
-_cmnd multiplies the normalized device coordinates by the inverse of
-_param5*_param6 as follows:
-
-.P
-.ce
-.EQ
-left ( down 70 {cpile { ~_eqnparam10 above ~_eqnparam11 above ~_eqnparam12
-above ~_eqnparam13}} ~~ right ) ~=~ INV(P M)
-left ( down 140 {cpile {
-{ {2(_eqnparam1 ~-~ _eqnparam7[0])} over {_eqnparam7[2]} ~-~ 1 }
-above
-{ {2(_eqnparam2 ~-~ _eqnparam7[1])} over {_eqnparam7[3]} ~-~ 1 }
-above
-{ {2(_eqnparam3 ~-~ _eqnparam8)} over {(_eqnparam9 ~-~ _eqnparam8)} ~-~ 1 }
-above
-_eqnparam4}} ~~ right )
-.EN
-.sp
-$INV()$ denotes matrix inversion.
-.P
-_cmnd is equivalent to _cmnd(UnProject) when _param4 is 1, _param8 is 0 and
-_param9 is 1.
-.SH NOTES
-_cmnd is available only if the GLU version is 1.3 or greater.
-.SH SEE ALSO
-_glcmnd(Get),
-_glcmnd(FeedbackBuffer),
-_cmnd(Project),
-_cmnd(UnProject)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglw/Distfile b/xc/extras/ogl-sample/main/doc/man/manglw/Distfile
deleted file mode 100755
index 6bf42c0e1..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglw/Distfile
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-#
-
-DISTDIR_SI = /xc/doc/man/GL/glw
-
-DISTFILES_SI = \
- glwcreatemdrawingarea.3gl \
- glwdrawingarea.3gl \
- glwdrawingareamakecurrent.3gl \
- glwdrawingareaswapbuffers.3gl \
- $(NULL)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglw/GNUmakefile b/xc/extras/ogl-sample/main/doc/man/manglw/GNUmakefile
deleted file mode 100755
index d87aa5187..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglw/GNUmakefile
+++ /dev/null
@@ -1,83 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-
-COMMONPREF = standard
-include $(ROOT)/usr/include/make/commondefs
-
-DEPTH = ..
-LANGOPT = c
-PREFIX = GLw
-IDB_PATH = /usr/share/catman/g_man/cat3/glw
-
-MANPREF = man
-include $(DEPTH)/mandefs
-
-APIFILE = $(ROOT)/usr/include/GL/gl.h
-
-VERSION = Version 1.0
-DATE = Aug 1998
-MMFLAGS = -rs2
-
-LEGALSUF1 = gl#
-LEGALSUF2 = gl#
-LEGALSUF3 = gl#
-LEGALSUF4 = gl#
-LEGALSUF5 = gl#
-
-LOCALPRINTLISTFILTER = | sed -e '/^intro\.p$$/d' | (echo intro.p ; cat )
-
-default:
- $(MAKE) manpages
-
-headers headers_install libs libs_install apps:
-
-distsi: default
- $(MAKE) $(COMMONPREF)$@
-
-distoss:
- $(MAKE) $(COMMONPREF)$@
-
-manpages: $(patsubst %.gl,%.3gl,$(wildcard *.gl))
-
-install: manpages
- for file in *.3gl; do \
- install -D -m 644 $$file ${ROOT}/usr/man/man3/`basename $$file .3gl`.3gl ; \
- done
-
-clobber:
- rm -f *.3gl
-
-include $(DEPTH)/manrules
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/doc/man/manglw/glwcreatemdrawingarea.gl b/xc/extras/ogl-sample/main/doc/man/manglw/glwcreatemdrawingarea.gl
deleted file mode 100755
index ab839f737..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglw/glwcreatemdrawingarea.gl
+++ /dev/null
@@ -1,50 +0,0 @@
-.\" **
-.\" ** (c) Copyright 1993, 1994, 1995, 1996 Silicon Graphics, Inc.
-.\" **
-.\" ** (c) Copyright 1989, 1990, 1991 Open Software Foundation, Inc.
-.\" ** All Rights Reserved.
-.\" **
-.\" ** (c) Copyright 1987, 1988, 1989, by Hewlett-Packard Company
-.\" **
-.\" ** (c) Copyright 1987, 1988 by Digital Equipment Corporation,
-.\" ** Maynard, MA. All Rights Reserved.
-.\" **
-.\" **
-.TH GLwCreateMDrawingArea 3X "" "" "" ""
-.SH NAME
-\fBGLwCreateMDrawingArea \(em Create a Motif/OpenGL Drawing Widget.\fP
-.iX "GLwCreateMDrawingArea"
-.iX "creation functions"
-.sp 1
-.SH SYNOPSIS
-\fB#include <X11/GLw/GLwMDrawA.h>\fP
-.br
-Widget \fBGLwCreateMDrawingArea\fP( Widget \fIparent\fP,
- String \fIname\fP,
- ArgList \fIarglist\fP,
- Cardinal \fIargcount\fP )
-.fi
-\fP
-.SH DESCRIPTION
-\fBGLwCreateMDrawingArea\fP creates an instance of a GLwMDrawingArea
-widget and returns the associated widget ID.
-.sp 1
-.IP "\fIparent\fP" .95i
-Specifies the parent widget ID
-.IP "\fIname\fP" .95i
-Specifies the name of the created widget
-.IP "\fIarglist\fP" .95i
-Specifies the argument list
-.IP "\fIargcount\fP" .95i
-Specifies the number of attribute/value pairs in the argument list
-(\fIarglist\fP)
-.sp 1
-.PP
-For a complete definition of GLwMDrawingArea and its associated resources, see
-\fBGLwDrawingArea(3X)\fP.
-.sp 1
-.SH RETURN VALUE
-Returns the GLwMDrawingArea widget ID.
-.sp 1
-.SH SEE ALSO
-\fBGLwDrawingArea(3X)\fP.
diff --git a/xc/extras/ogl-sample/main/doc/man/manglw/glwdrawingarea.gl b/xc/extras/ogl-sample/main/doc/man/manglw/glwdrawingarea.gl
deleted file mode 100755
index f25a4f5c6..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglw/glwdrawingarea.gl
+++ /dev/null
@@ -1,485 +0,0 @@
-.\" **
-.\" ** (c) Copyright 1993, 1994, 1995, 1996 Silicon Graphics, Inc.
-.\" **
-.\" ** (c) Copyright 1989, 1990, 1991 Open Software Foundation, Inc.
-.\" ** All Rights Reserved.
-.\" **
-.\" ** (c) Copyright 1987, 1988, 1989, by Hewlett-Packard Company
-.\" **
-.\" ** (c) Copyright 1987, 1988 by Digital Equipment Corporation,
-.\" ** Maynard, MA. All Rights Reserved.
-.\" **
-.\" **
-.TH GLwDrawingArea 3X "" "" "" ""
-.SH NAME
-\fBGLwDrawingArea, GLwMDrawingArea \(em OpenGL drawing widgets.\fP
-.iX "GLwDrawingArea" "GLwMDrawingArea"
-.iX "widget class" "OpenGL" "Draw"
-.sp 1
-.SH SYNOPSIS
-\fB#include <X11/GLw/GLwDrawA.h>
-.br
-\fBld ... -lGLw -lGL -l<anywidgetlibrary> -lXext -lXt -lX11 -lm
-.sp
-\fB#include <X11/GLw/GLwMDrawA.h>
-.br
-\fBld ... -lGLw -lGL -lXm -lXext -lXt -lX11 -lm
-.sp 1
-.SH DESCRIPTION
-\fBGLwDrawingArea\fP and \fBGLwMDrawingArea\fP are widgets suitable
-for OpenGL drawing. They
-provide a window with the appropriate visual and colormaps needed for
-OpenGL, based on supplied parameters. GLwDrawingArea and
-GLwMDrawingArea also provide
-callbacks for redraw, resize, input, and initialization.
-.PP
-GLwDrawingArea is not a part of any widget set, but depends only on Xt.
-GLwDrawingArea can be used with any widget set. GLwMDrawingArea
-is identical to
-GLwDrawingArea except that it is a subclass of the Motif\(Tm widget
-class XmPrimitive and
-has resources and defaults suitable for use with Motif. For example,
-GLwMDrawingArea provides the default Motif background and foreground colors
-for resources, and deals better with keyboard traversal. Although the
-GLwDrawingArea widget can be used in a Motif program, it is recommended that
-GLwMDrawingArea be used instead.
-.PP
-Since both GLwDrawingArea and GLwMDrawingArea
-widgets behave almost identically, the
-remainder of this manual page will refer only to GLwDrawingArea, except when
-the behaviors differ. Unless explicitly stated, all statements
-about GLwDrawingArea also apply to GLwMDrawingArea.
-.PP
-Among the information provided when creating a GLwDrawingArea is
-information necessary to determine the visual. This may be provided
-in three ways, all of them through resources. A specific visualInfo
-structure may be passed in. (This visualInfo must have been obtained
-elsewhere; it is the application designer's responsibility to make
-sure that it is compatible with the OpenGL rendering done by the
-application). Alternatively, an attribute list may be provided. This
-attribute list is formatted identically to that used for direct open
-GL programming. Finally, each attribute can be specified as an
-individual resource. The latter method is the simplest, and is the
-only method that works from resource files.
-.PP
-In addition to allocating the visual, the GLwDrawingArea will also
-allocate the colormap unless one is provided by the application. (If
-one is provided it is the application writer's responsibility to
-guarantee compatibility between the colormap and the visual). If
-an application creates multiple GLwDrawingAreas with the same visual,
-the same colormap will be used. (However the colormap
-will not be shared among separate applications).
-.PP
-Creating the widget does not actually create the window until it is
-realized, and consequently, the application should not perform any
-OpenGL operations
-to the window immediately after creation. Instead the application
-must wait until after it has realized the window. Alternatively, the
-\fBginit\fP callback may be used to indicate when the window has been
-created. Upon receiving this callback, the application can perform
-all OpenGL initialization for the window, and can subsequently perform
-other operations on it. The initialization is discussed in more
-detail below.
-.PP
-Applications select which GLwDrawingArea they are accessing using either
-\fBglXMakeCurrent\fP or the convenience function
-\fBGLwDrawingAreaMakeCurrent\fP which uses a widget instead of a
-display and window. If there is only one GLwDrawingArea this need
-only be called once, however if there is more than one GLwDrawingArea
-it should be called at the start of each callback.
-Callbacks in this case include not only
-callbacks provided by the widget itself, but any other callback that
-leads to GL activity such as a timeout or a workproc.
-.PP
-If an application is using double buffering, it may call
-\fBGLwDrawingAreaSwapBuffers\fP instead of \fBglXSwapBuffers\fP. This
-allows the use of the widget instead of the display and window.
-.ne 5
-.SS "GLwDrawingArea Classes"
-GLwDrawingArea inherits behavior and resources from the \fBCore\fP class.
-.br
-The class pointer is \fBglwDrawingAreaWidgetClass\fP.
-.br
-The class name is \fBGLwDrawingArea\fP.
-.PP
-.ne 5
-.SS "GLwMDrawingArea Classes"
-GLwMDrawingArea inherits behavior and resources from the
-\fBXmPrimitive\fP and \fBCore\fP classes.
-.br
-The class pointer is \fBglwMDrawingAreaWidgetClass\fP.
-.br
-The class name is \fBGLwMDrawingArea\fP.
-.sp 1
-.SS "New Resources"
-The following tables define a set of widget resources used by the programmer
-to specify data. The programmer can also set the resource values for the
-inherited classes to set attributes for this widget. To reference a
-resource by name or by class in a .Xdefaults file, remove the \fBGLwN\fP or
-\fBGLwC\fP prefix and use the remaining letters.
-There are two tables included. The first table includes resources
-that correspond directly to the attributes used by \fBglXChooseVisual\fP.
-As with \fBglXChooseVisual\fP, all Boolean resources default to FALSE
-and all integer resources default to 0, except redSize, greenSize and
-blueSize which default to 1. These resources can all be
-set only at creation time, and are used to determine the visual. If
-either the \fIGLwNattribList\fP or \fIGLwNvisualInfo\fP resource is
-set, these resources are ignored. The specific meaning of these
-resources is discussed in the \fBglXChooseVisual\fP manual page and
-will not be discussed here.
-.sp 1
-.ne 18
-.TS
-center allbox;
-lBp8 lBp8 lBp8 lBp8
-lp8 lp8 lp8 lp8.
-Name Class Type OpenGL attribute
-GLwNbufferSize GLwCBufferSize int GLX_BUFFER_SIZE
-GLwNlevel GLwCLevel int GLX_LEVEL
-GLwNrgba GLwCRgba Boolean GLX_RGBA
-GLwNdoublebuffer GLwCDoublebuffer Boolean GLX_DOUBLEBUFFER
-GLwNstereo GLwCStereo Boolean GLX_STEREO
-GLwNauxBuffers GLwCAuxBuffers Boolean GLX_AUX_BUFFERS
-GLwNredSize GLwCColorSize int GLX_RED_SIZE
-GLwNgreenSize GLwCColorSize int GLX_GREEN_SIZE
-GLwNblueSize GLwCColorSize int GLX_BLUE_SIZE
-GLwNalphaSize GLwCAlphaSize int GLX_ALPHA_SIZE
-GLwNdepthSize GLwCDepthSize int GLX_DEPTH_SIZE
-GLwNstencilSize GLwCStencilSize int GLX_STENCIL_SIZE
-GLwNaccumRedSize GLwCAccumColorSize int GLX_ACCUM_RED_SIZE
-GLwNaccumGreenSize GLwCAccumColorSize int GLX_ACCUM_GREEN_SIZE
-GLwNaccumBlueSize GLwCAccumColorSize int GLX_ACCUM_BLUE_SIZE
-GLwNaccumAlphaSize GLwCAccumAlphaSize int GLX_ACCUM_ALPHA_SIZE
-.TE
-.sp 1
-.PP
-The following table lists other resources of the GLwDrawingArea
-widget. each of these will be described subsequently.
-The codes in the access column indicate if the given resource can be
-set at creation time (\fBC\fP),
-set by using \fBXtSetValues\fP (\fBS\fP),
-retrieved by using \fBXtGetValues\fP (\fBG\fP), or is not applicable
-(\fBN/A\fP).
-.sp 1
-.ne 12
-.TS
-center;
-lp8B lp8B lp8B lp8B lp8B
-lp8 lp8 lp8 lp8 lp8.
-Name Class Type Def Acc
-_
-GLwNallocateBackground GLwCAllocateColors Boolean F CG
-GLwNallocateOtherColors GLwCAllocateColors Boolean F CG
-GLwNattribList GLwCAttribList int * NULL CG
-GLwNexposeCallback GLwCCallback XtCallbackList NULL C
-GLwNginitCallback GLwCCallback XtCallbackList NULL C
-GLwNinputCallback GLwCCallback XtCallbackList NULL C
-GLwNinstallBackground GLwCInstallBackground Boolean T CG
-GLwNinstallColormap GLwCInstallColormap Boolean T CG
-GLwNresizeCallback GLwCCallback XtCallbackList NULL C
-GLwNvisualInfo GLwCVisualInfo XVisualInfo* NULL CG
-.TE
-.sp 1
-.IP "\fBGLwNallocateBackground\fP"
-If TRUE, the background pixel and pixmap will be allocated if
-appropriate using the newly calculated colormap and visual. If FALSE,
-they will retain values calculated using the parent's colormap and
-visual. Applications which wish to have X clear their background for
-them will usually set this to TRUE. Applications clearing their own
-background will often set this to FALSE, although they may set this to
-TRUE if they query the background for their own use. One reason to
-leave this resource FALSE is that if color index mode is in use this
-avoid using up a pixel from the newly allocated colormap. Also, on
-hardware that supports only one colormap, the application may need to
-do more careful color allocation to avoid flashing between the OpenGL
-colormap and the default X colormap.
-(Note that because of the way Xt works, the background colors
-are originally calculated using the default colormap; if this resource
-is set they can be recalculated correctly. If a colormap was
-explicitly supplied to the widget rather than being dynamically
-calculated, these resources are always calculated using that colormap.)
-.IP "\fBGLwNallocateOtherColors\fP"
-This is similar to \fBGLwNallocateBackground\fP, but allocates other
-colors normally allocated by widgets. Although the GLwDrawingArea
-and GLwMDrawingArea widget do not make use of these colors the
-application may choose to query them. For the non-Motif
-GLwDrawingArea widget there are no other colors allocated, so this
-resource is a no-op. For the Motif GLwMDrawingArea are widget, the
-XmPrimitive resources \fBXmNforeground\fP, \fBXmNhighlightColor\fP,
-and \fBXmNhighlightPixmap\fP are calculated.
-.IP "\fBGLwNattribList\fP"
-Contains the list of attributes suitable for a call to
-\fBglXChooseVisual\fP. If this resource is NULL, it is calculated
-based on the attribute resources. If it is not NULL, the attribute
-resources are ignored.
-.IP "\fBGLwNexposeCallback\fP"
-Specifies the list of callbacks that is
-called when the widget receives an exposure event.
-The callback reason is \fBGLwCR_EXPOSE\fP.
-The callback structure also includes the exposure event. The
-application will generally want to redraw the scene.
-.IP "\fBGLwNginitCallback\fP"
-Specifies the list of callbacks that is
-called when the widget is first realized. Since no OpenGL operations can
-be done before the widget is realized, this callback can be used to
-perform any appropriate OpenGL initialization such as creating a context.
-The callback reason is \fBGLwCR_GINIT\fP.
-.IP "\fBGLwNinputCallback\fP"
-Specifies the list of callbacks that is
-called when the widget receives a keyboard
-or mouse event. By default, the input callback is called on each key
-press and key release, on each mouse button press and release, and
-whenever the mouse is moved while a button is pressed. However this
-can be changed by providing a different translation table.
-The callback structure also includes the input event.
-The callback reason is \fBGLwCR_INPUT\fP.
-.IP ""
-The input callback is provided as a programming convenience, as it
-provides a convenient way to catch all input events. However, a more
-modular program can often be obtained by providing specific actions and
-translations in the application rather than using a single catch all
-callback. Use of explicit translations can also provide for more
-customization.
-.IP "\fBGLwNinstallBackground\fP"
-If set to TRUE, the background is installed on the window. If set to
-FALSE, the window has no background. This resource has no effect
-unless \fBGLwNallocateBackground\fP is also TRUE.
-.IP "\fBGLwNinstallColormap\fP"
-If set to TRUE, the widget will call \fIXSetWMColormapWindows\fP to
-tell the window manager to install the colormap when the window's
-shell has focus. If set to FALSE, this will not be called. For
-applications with multiple GLwDrawingAreas sharing a single colormap,
-it is most efficient to set this resource to TRUE for exactly one
-GLwDrawingArea with each colormap. If an application needs
-additional control over the order of colormaps, this resource can be
-set to FALSE, with the application calling \fIXSetWMColormapWindows\fP
-explicitly.
-.IP "\fBGLwNresizeCallback\fP"
-Specifies the list of callbacks that is
-called when the GLwDrawingArea is resized.
-The callback reason is \fBGLwCR_RESIZE\fP.
-.IP "\fBGLwNvisualInfo\fP"
-Contains a pointer to the window's visual info structure. If NULL,
-the visualInfo is calculated at widget creation time based on the
-\fIGLwNattributeList\fP resource (which is itself calculated from the
-various resources). If \fBGLwNvisualInfo\fP is not NULL the
-\fIGLwNattributList\fP and the attribute resources are ignored.
-.sp 1
-.SS "Inherited Resources"
-Both GLwDrawingArea and GLwMDrawingArea inherit behavior and resources
-from the core superclass. Other than the behavior of the colormap and
-background resources described previously, all defaults are the same as
-for core.
-.PP
-In addition, the Motif version GLwMDrawingArea also inherits from XmPrimitive.
-The behavior of the color resources has been described previously.
-The \fITraversalOn\fP resource is disabled for this widget, but if
-keyboard input is required it should be enabled. (Also, the
-application should call \fBXmProcessTraversal(widget, XmTRAVERSE_CURRENT)\fP
-whenever mouse button 1 is clicked in the widget. This is similar to
-the requirements of the Motif Drawing area.) Because Motif gets
-confused by having multiple visuals in one top level shell,
-\fBXmNhighlightOnEnter\fP has been disabled, and
-\fBXmNhighlightThickness\fP has been set to 0.
-.SS "Callback Information"
-A pointer to the following structure is passed to each callback:
-.sp 1
-.ne 6
-.nf
-.ta .25i 1.3i
-\fBtypedef struct\fP
-{
- \fBint\fP \fIreason\fP;
- \fBXEvent\fP \fI*event\fP;
- \fBDimension\fP \fIwidth, height\fP;
-} \fBGLwDrawingAreaCallbackStruct\fP;
-.fi
-.sp 1
-.IP "\fIreason\fP" .75i
-Indicates why the callback was invoked. Appropriate values are
-stated in the above resource descriptions. For Motif programmers, the
-values \fBGLwCR_EXPOSE\fP, \fBGLwCR_RESIZE\fP, and \fBGLwCR_INPUT\fP
-are equal to \fBXmCR_EXPOSE\fP, \fBXmCR_RESIZE\fP, and
-\fBXmCR_INPUT\fP respectively. \fBGLwCR_GINIT\fP does not have a
-Motif equivalent.
-.IP "\fIevent\fP" .75i
-Points to the \fBXEvent\fP that triggered the callback.
-This is NULL for \fBGLwNginitCallback and \fBGLwNresizeCallback\fP.
-.IP "\fIwidth\fP and \fIheight\fP" .75i
-Are set to the width and height of the window.
-.br
-.ne 10
-.sp 1 \"Adds space before the SS
-.SS "Translations"
-GLwDrawingArea has the translations listed below.
-\fB
-.nf
-.ta 1.5i
-.ne 5
-<KeyDown>: glwInput()
-<KeyUp>: glwInput()
-<BtnDown>: glwInput()
-<BtnUp>: glwInput()
-<BtnMotion>: glwInput()
-.fi
-.PP
-GLwMDrawingArea has the following additional translation:
-\fB
-.nf
-.ta 1.5i
-<Key>osfHelp: PrimitiveHelp()
-.fi
-.PP
-An application wishing to catch other events than these defaults can
-do so by installing a different translation table.
-\fP
-.sp 1 \"Adds space before the SS
-.SS "Action Routines"
-The GLwDrawingArea has the following action routine:
-.IP "\fBglwInput()\fP:"
-Called whenever one of the above translations specifies that input has
-occurred. Its sole purpose is to call the input callback.
-.sp 1
-.SH INITIALIZATION
-.PP
-When the widget is initially created (e.g. through
-\fBXtCreateWidget(3X)\fP) the associated window is not actually
-created. Instead, window creation is delayed until the widget is
-realized. However, \fBglXchooseVisual\fP is called immediately, so
-information based on its results is available.
-.PP
-Between the time the widget is created and it is realized,
-the following apply:
-.TP
-\(bu
-No OpenGL operations can be done to the window
-.TP
-\(bu
-No resize callbacks are generated.
-.TP
-\(bu
-The normal window is available (XtWindow returns NULL).
-.TP
-\(bu
-\fBGLwDrawingAreaMakeCurrent\fP (and \fBglXMakeCurrent\fP) should not
-be called.
-.PP
-When the widget is realized, the following actions take place:
-.PP
-.TP
-\(bu
-The window is created.
-.TP
-\(bu
-The \fBginit\fP callback is called. The user may use this callback to
-perform any needed OpenGL initialization to the window.
-.sp 1
-.SH NOTES
-.PP
-When using the input callback to receive keyboard input, the keycode
-in the event must be converted to a KeySym. Use
-\fBXLookupKeysym(3X)\fP or \fBXLookupString(3X)\fP to do the
-conversion. Keyboard input can also be dealt using translations, in
-which case no such conversion is required.
-.PP
-Motif programmers should keep in mind that OSF uses virtual
-bindings and replaces some of the key bindings. As a common example,
-if the ESC key is to be used to exit the program (as it often is in GL
-programs), the translation should specify <key>osfCancel instead of
-<key>Escape.
-.PP
-Motif programmers may also create a GLwMDrawingArea widget with the Motif
-style \fBGLwCreateMDrawingArea\fP.
-.sp 1
-.ne 10
-.SH EXAMPLE
-Here are some code fragments that create a GLwDrawingArea widget, and manage
-the appropriate callbacks.
-.sp
-.nf
-\f(CW
- #include <stdlib.h>
- #include <X11/GLw/GLwDrawA.h>
- static GLXContext glx_context; /* assume only one context */
- . . .
-
- main()
- {
- Arg args[10];
- int n;
-
- Widget parent; /* The parent of the gl widget */
- Widget glw; /* The GLwDrawingArea widget */
- . . .
-
- /* Create the widget using RGB mode. This can also be set
- * in an X Defaults file
- */
- n = 0;
- XtSetArg(args[n], GLwNrgba, True); n++;
- glw = XtCreateManagedWidget("glw", glwDrawingAreaWidgetClass,
- parent, args, n);
- XtAddCallback(glw, GLwNexposeCallback, exposeCB, NULL);
- XtAddCallback(glw, GLwNresizeCallback, resizeCB, NULL);
- XtAddCallback(glw, GLwNginitCallback, ginitCB, NULL);
- /* Also add input callback if needed */
- . . .
- }
-
- static void
- exposeCB(Widget w, XtPointer client_data,
- GLwDrawingAreaCallbackStruct *call_data)
- {
- GLwDrawingAreaMakeCurrent(w, glx_context);
- /* redraw the display */
- }
-
- static void
- resizeCB(Widget w, XtPointer client_data,
- GLwDrawingAreaCallbackStruct *call_data)
- {
- GLwDrawingAreaMakeCurrent(w, glx_context);
- /* perform any resize actions */
- }
-
- static void
- ginitCB(Widget w, XtPointer client_data,
- GLwDrawingAreaCallbackStruct *call_data)
- {
- Arg args[1];
- XVisualInfo *vi;
-
- XtSetArg(args[0], GLwNvisualInfo, &vi);
- XtGetValues(w, args, 1);
-
- /* create a visual context */
- glx_context = glXCreateContext(XtDisplay(w), vi,
- NULL, GL_FALSE);
- GLwDrawingAreaMakeCurrent(w, glx_context);
- /* Perform any necessary graphics initialization.*/
- }
-\fP
-.fi
-.P
-The Motif program need only differ by including
-\fBGLwMDrawingArea.h\fP instead of \fBGLwDrawingArea.h\fP and by creating a widget of type
-\fBGLwMDrawingAreaWidgetClass\fP instead of \fBGLwDrawingAreaWidgetClass\fP. As an
-alternative, the Motif program could use \fBGLwCreateMDraw(3X)\fP instead.
-.sp 1
-.SH WARNINGS
-.PP
-If a GLwDrawingArea widget is created as a child of an already realized
-widget, the GLwDrawingArea widget will be created immediately, without giving
-the user an opportunity to add the \fBginit\fP callback. In such a
-case, initialization should be done immediately after creating the
-widget rather than by using the callback.
-.PP
-If the non-Motif GLwDrawingArea widget is used in a Motif program and
-keyboard traversal is attempted, the behavior is undefined if the user
-traverses into the GLwDrawingArea widget.
-.SH SEE ALSO
-\fBglXChooseVisual(3G)\fP, \fBGLwDrawingAreaMakeCurrent(3X)\fP,
-\fBglXMakeCurrent(3G)\fP, \fBGLwDrawingAreaSwapBuffers(3X)\fP
-\fBGLwCreateMDraw(3X)\fP, \fBCore(3X)\fP, \fBXmPrimitive(3X)\fP,
-\fBVirtualBindings(3X)\fP, \fBXSetWMColormapWindows(3X11)\fP
-and the OpenGL spec.
diff --git a/xc/extras/ogl-sample/main/doc/man/manglw/glwdrawingareamakecurrent.gl b/xc/extras/ogl-sample/main/doc/man/manglw/glwdrawingareamakecurrent.gl
deleted file mode 100755
index de51e4d51..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglw/glwdrawingareamakecurrent.gl
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" **
-.\" ** (c) Copyright 1993, 1994, 1995, 1996 Silicon Graphics, Inc.
-.\" **
-.\" ** (c) Copyright 1989, 1990, 1991 Open Software Foundation, Inc.
-.\" ** All Rights Reserved.
-.\" **
-.\" ** (c) Copyright 1987, 1988, 1989, by Hewlett-Packard Company
-.\" **
-.\" ** (c) Copyright 1987, 1988 by Digital Equipment Corporation,
-.\" ** Maynard, MA. All Rights Reserved.
-.\" **
-.\" **
-.TH GLwDrawingAreaMakeCurrent 3X "" "" "" ""
-.SH NAME
-\fBGLwDrawingAreaMakeCurrent \(em Make the current GLwDrawingArea current.\fP
-.iX "GLwDrawingAreaMakeCurrent"
-.iX "GLwDrawingArea"
-.sp 1
-.SH SYNOPSIS
-\fB#include <X11/GLw/GLwDraw.h>\fP
-.br
-void \fBGLwDrawingAreaMakeCurrent\fP( Widget \fIw\fP,
- GLXContext \fIctx\fP )
-.fi
-.SH DESCRIPTION
-\fBGLwDrawingAreaMakeCurrent\fP is a front end to \fBglXMakeCurrent\fP,
-however instead of passing in a Display and a Window, a Widget is
-passed in.
-.SH SEE ALSO
-\fBGLwMDrawingArea(3X)\fP, \fBglXMakeCurrent(3G)\fP.
diff --git a/xc/extras/ogl-sample/main/doc/man/manglw/glwdrawingareaswapbuffers.gl b/xc/extras/ogl-sample/main/doc/man/manglw/glwdrawingareaswapbuffers.gl
deleted file mode 100755
index c7a28b411..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manglw/glwdrawingareaswapbuffers.gl
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" **
-.\" ** (c) Copyright 1993, 1994, 1995, 1996 Silicon Graphics, Inc.
-.\" **
-.\" ** (c) Copyright 1989, 1990, 1991 Open Software Foundation, Inc.
-.\" ** All Rights Reserved.
-.\" **
-.\" ** (c) Copyright 1987, 1988, 1989, by Hewlett-Packard Company
-.\" **
-.\" ** (c) Copyright 1987, 1988 by Digital Equipment Corporation,
-.\" ** Maynard, MA. All Rights Reserved.
-.\" **
-.\" **
-.TH GLwDrawingAreaSwapBuffers 3X "" "" "" ""
-.SH NAME
-\fBGLwDrawingAreaSwapBuffers \(em Swap buffers in a GLwDrawingArea.\fP
-.iX "GLwDrawingAreaSwapBuffers"
-.iX "GLwDrawingArea"
-.sp 1
-.SH SYNOPSIS
-\fB#include <X11/GLw/GLwDraw.h>\fP
-.br
-void \fBGLwDrawingAreaSwapBuffers\fP( Widget \fIw\fP )
-.br
-.fi
-.SH DESCRIPTION
-\fBGLwDrawingAreaSwapBuffers\fP is a front end to \fBglXSwapBuffers\fP,
-however instead of passing in a Display and a Window, a Widget is
-passed in.
-.SH SEE ALSO
-\fBGLwMDrawingArea(3X)\fP, \fBglXSwapBuffers(3G)\fP.
diff --git a/xc/extras/ogl-sample/main/doc/man/manrules b/xc/extras/ogl-sample/main/doc/man/manrules
deleted file mode 100755
index 66f45a8c7..000000000
--- a/xc/extras/ogl-sample/main/doc/man/manrules
+++ /dev/null
@@ -1,181 +0,0 @@
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/doc/man/Attic/manrules,v 1.1.1.1 2001/03/19 17:45:27 dawes Exp $
-
-# Generic rules for making manpages
-#
-# Usage:
-# make <name>.psv # view page with $(PSVIEW) (no file created)
-# make <name>.xpsv # view page with $(XPSVIEW) (no file created)
-# make <name>.dit # view page with $(DITVIEW) (no file created)
-# make <name>.p # print page (no file created)
-# make <name>.ps # create PostScript for page
-# make <name>.z # create online packed version; view with
-# # man -d <name>.z
-# make <name>.tr # create troff source for man page
-# make print-list # writes a list of the hardcopy (.p) targets
-# # for the current directory to stdout
-#
-# make default # the standard SGI targets
-# make install
-# make clean
-# make clobber
-#
-#
-
-TT = /tmp/mmdoc$$$$
-
-# To provide override, define MANPREF
-$(MANPREF)default: $(MANPREF)_force
- @$(LISTLEGAL) \
- | sed -e 's/\.$(LEGALSUF1)$$/.z/' -e 's/\.$(LEGALSUF2)$$/.z/' \
- -e 's/\.$(LEGALSUF3)$$/.z/' -e 's/\.$(LEGALSUF4)$$/.z/' \
- | xargs -l4 $(MAKE)
-
-# remove all .z, .ps, and unsuffixed versions of legal man filenames (except
-# a, c, f, and p).
-$(MANPREF)clean:
- find . \( -name '*.z' -o -name '*.ps' \) -print | xargs rm -f
- $(LISTLEGAL) \
- | sed -e 's/\.$(LEGALSUF1)$$//' -e 's/\.$(LEGALSUF2)$$//' \
- -e 's/\.$(LEGALSUF3)$$//' -e 's/\.$(LEGALSUF4)$$//' \
- | sed '/^[acfp]$$/d' \
- | xargs rm -f
- rm -f $(LDIRT)
-
-$(MANPREF)clobber: $(MANPREF)clean
-
-#
-# Define generic build rules
-#
-# Some directories have multiple sections in them (like 3c, 3, 3x, etc)
-# and so we must define more than 1 default rule.
-#
-# The .mn suffix is for pages that are part of the printed GL Reference Manual
-# but not of the online man pages.
-#
-.SUFFIXES:.z .p .ps .dit .tr .psv .xpsv .1 .1c .1g .1m .1w .1X .2 .2b .3 .3a .3b .3c .3f .gl .3m .3n .3p .3r .3s .3t .3w .3x .3y .4 .5 .5w .6 .6d .7 .7p .7m .3X11 .3Xt .3i .mn .3l .3gl .html
-
-.gl.3gl:
- @echo "\t$(MMDOC) Op=$(LANGOPT) $< > $@"
- @$(ADDMAGIC) | $(THTOUPPER) > $@
-
-.1.z .1c.z .1g.z .1m.z .1w.z .1X.z .2.z .2b.z .3.z .3a.z .3f.z .3c.z .3p.z .3y.z .3r.z .3x.z .3n.z .3w.z .3s.z .3b.z .3m.z .3t.z .4.z .5.z .5w.z .6.z .6d.z .7.z .7p.z .7m.z .gl.z .3X11.z .3Xt.z .3i.z .3l.z:
- @echo "\t$(MMDOC) Op=$(LANGOPT) $< | pack > $*.z"
- @$(ADDMAGIC) | $(THTOUPPER) > $(TT) ; $(RUNMMDOC) $(TT) > $* ; \
- rm -f $(TT)
- @rm -f $*.z; pack -f $* > /dev/null
-
-.1.p .1c.p .1g.p .1m.p .1w.p .1X.p .2.p .2b.p .3.p .3a.p .3f.p .3c.p .3p.p .3y.p .3r.p .3x.p .3n.p .3w.p .3s.p .3b.p .3m.p .3t.p .4.p .5.p .5w.p .6.p .6d.p .7.p .7p.p .7m.p .3X11.p .3Xt.p .3i.p .3l.p:
- @echo "\t$(MMDOC) -Tpsc -rC5 Op=$(LANGOPT) $<"
- @$(ADDMAGIC) > $(TT) ; $(RUNMMDOC) -Tpsc -rC5 $(TT) ; rm -f $(TT)
-
-.gl.p .mn.p:
- @echo "\t$(MMDOC) -Tpsc -rC5 Op=$(LANGOPT) $<"
- @$(ADDGLMAGIC) > $(TT) ; $(RUNMMDOC) -Tpsc -rC5 $(TT) ; rm -f $(TT)
-
-.1.ps .1c.ps .1g.ps .1m.ps .1w.ps .1X.ps .2.ps .2b.ps .3.ps .3a.ps .3f.ps .3c.ps .3p.ps .3y.ps .3r.ps .3x.ps .3n.ps .3w.ps .3s.ps .3b.ps .3m.ps .3t.ps .4.ps .5.ps .5w.ps .6.ps .6d.ps .7.ps .7p.ps .7m.ps .3X11.ps .3Xt.ps .3i.ps .3l.ps:
- @echo "\t$(MMDOC) -TPS Op=$(LANGOPT) $< > $@"
- @$(ADDMAGIC) > $(TT) ; $(RUNMMDOC) -TPS $(TT) > $@ ; rm -f $(TT)
-
-.gl.ps .mn.ps:
- @echo "\t$(MMDOC) -TPS Op=$(LANGOPT) $< > $@"
- @$(ADDGLMAGIC) > $(TT) ; $(RUNMMDOC) -TPS $(TT) > $@ ; rm -f $(TT)
-
-.gl.tr .mn.tr:
-# @echo "\t$(ADDGLMAGIC) $< > $@"
- @$(ADDGLMAGIC) > $@
-
-.tr.ps:
- @echo "\t$(MMDOC) -TPS Op=$(LANGOPT) $< > $@"
- @$(RUNMMDOC) -TPS $< > $@
-
-.1.psv .1c.psv .1g.psv .1m.psv .1w.psv .1X.psv .2.psv .2b.psv .3.psv .3a.psv.3f.psv .3c.psv .3p.psv .3y.psv .3r.psv .3x.psv .3n.psv .3w.psv .3s.psv .3b.psv .3m.psv .3t.psv .4.psv .5.psv .5w.psv .6.psv .6d.psv .7.psv .7p.psv .7m.psv .3X11.psv .3Xt.psv .3i.psv .3l.psv:
- @echo "\t$(MMDOC) -TPS -rC4 Op=$(LANGOPT) $< | $(PSVIEW) $(PSVIEWOPTS)"
- @$(ADDMAGIC) > $(TT) ; $(RUNMMDOC) -TPS -rC4 $(TT) | $(PSVIEW) $(PSVIEWOPTS); rm -f $(TT)
-
-.gl.psv .mn.psv:
- @echo "\t$(MMDOC) -TPS -rC4 Op=$(LANGOPT) $< | $(PSVIEW) $(PSVIEWOPTS)"
- @$(ADDGLMAGIC) > $(TT) ; $(RUNMMDOC) -TPS -rC4 $(TT) | $(PSVIEW) $(PSVIEWOPTS); rm -f $(TT)
-
-.1.xpsv .1c.xpsv .1g.xpsv .1m.xpsv .1w.xpsv .1X.xpsv .2.xpsv .2b.xpsv .3.xpsv .3a.xpsv .3f.xpsv .3c.xpsv .3p.xpsv .3y.xpsv .3r.xpsv .3x.xpsv .3n.xpsv .3w.xpsv .3s.xpsv .3b.xpsv .3m.xpsv .3t.xpsv .4.xpsv .5.xpsv .5w.xpsv .6.xpsv .6d.xpsv .7.xpsv .7p.xpsv .7m.xpsv .3X11.xpsv .3Xt.xpsv .3i.xpsv .3l.xpsv .3il.xpsv:
- @echo "\t$(MMDOC) -TPS -rC4 Op=$(LANGOPT) $< | $(XPSVIEW) $(XPSVIEWOPTS)"
- @$(ADDMAGIC) > $(TT) ; $(RUNMMDOC) -TPS -rC4 $(TT) | $(XPSVIEW) $(XPSVIEWOPTS); rm -f $(TT)
-
-.gl.xpsv .mn.xpsv:
- @echo "\t$(MMDOC) -TPS -rC4 Op=$(LANGOPT) $< | $(XPSVIEW) $(XPSVIEWOPTS)"
- @$(ADDGLMAGIC) > $(TT) ; $(RUNMMDOC) -TPS -rC4 $(TT) | $(XPSVIEW) $(XPSVIEWOPTS); rm -f $(TT)
-
-.1.dit .1c.dit .1g.dit .1m.dit .1w.dit .1X.dit .2.dit .2b.dit .3.dit .3a.dit .3f.dit .3c.dit .3p.dit .3y.dit .3r.dit .3x.dit .3n.dit .3w.dit .3s.dit .3b.dit .3m.dit .3t.dit .4.dit .5.dit .5w.dit .6.dit .6d.dit .7.dit .7p.dit .7m.dit .3X11.dit .3Xt.dit .3i.dit .3l.dit:
- @echo "\t$(MMDOC) -TX100 -rC4 Op=$(LANGOPT) $< | $(DITVIEW)"
- @$(ADDMAGIC) > $(TT) ; $(RUNMMDOC) -TX100 -rC4 $(TT) | $(DITVIEW)
-
-.gl.dit .mn.dit:
- @echo "\t$(MMDOC) -TX100 -rC4 Op=$(LANGOPT) $< | $(DITVIEW)"
- @$(ADDGLMAGIC) > $(TT) ; $(RUNMMDOC) -TX100 -rC4 $(TT) | $(DITVIEW)
-
-# The Irix man -d option must have a full pathname. This assumes
-# that $(VPATH) is the full pathname to the dependency directory.
-ifeq ($(OS),IRIX)
-.3gl.html:
- man -d $(VPATH)/$(<F) | $(MAN2HTML) > $@
-endif
-ifeq ($(OS),Linux)
-.3gl.html:
- man -M . $< | $(MAN2HTML) > $@
-endif
-
-# write a list of the hardcopy (.p) targets for the current directory to stdout
-# use LOCALPRINTLISTFILTER to do directory-dependent filtering, e.g reordering
-# to put intro.p first
-print-list: $(MANPREF)_force
- @$(LISTLEGAL) \
- | sed -e 's/\.$(LEGALSUF1)$$/.p/' -e 's/\.$(LEGALSUF2)$$/.p/' \
- -e 's/\.$(LEGALSUF3)$$/.p/' -e 's/\.$(LEGALSUF4)$$/.p/' \
- | sort -t. +0 -1 \
- $(LOCALPRINTLISTFILTER)
-
-$(MANPREF)install: $(MANPREF)default MakeOtherInstalls
- $(INSTALL) -idb $(IDB_TAG) -m 444 -F $(IDB_PATH) *.z
-
-# only look for aliases in legal man page filenames
-MakeOtherInstalls: $(MANPREF)_force
- @echo "\tmaking symlink install lines"
- @$(LISTLEGAL) \
- | xargs $(GETNAMES) opt=$(LANGOPT) \
- | $(ADDINST) $(IDB_TAG) $(IDB_PATH) $(INSTALL) > $(TT); \
- sh $(TT); rm -f $(TT)
-
-$(MANPREF)_force:
diff --git a/xc/extras/ogl-sample/main/doc/man/tools/GNUmakefile b/xc/extras/ogl-sample/main/doc/man/tools/GNUmakefile
deleted file mode 100755
index 1420ea5d3..000000000
--- a/xc/extras/ogl-sample/main/doc/man/tools/GNUmakefile
+++ /dev/null
@@ -1,49 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/doc/man/tools/Attic/GNUmakefile,v 1.1.1.1 2001/03/19 17:45:27 dawes Exp $
-
-COMMONPREF = standard
-include $(ROOT)/usr/include/make/commondefs
-
-default headers headers_install libs libs_install install apps:
- chmod +x mdate.pl mmdoc glman
-
-distsi distoss:
- $(MAKE) $(COMMONPREF)$@
-
-$(COMMONTARGS): % : $(COMMONPREF)%
-
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/doc/man/tools/constCheck.pl b/xc/extras/ogl-sample/main/doc/man/tools/constCheck.pl
deleted file mode 100755
index ab6ffc8a3..000000000
--- a/xc/extras/ogl-sample/main/doc/man/tools/constCheck.pl
+++ /dev/null
@@ -1,160 +0,0 @@
-#! /usr/sbin/perl
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/doc/man/tools/Attic/constCheck.pl,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-
-#-----------------------------------------------------------------------------
-#
-# Command line options
-#
-
-use Getopt::Std;
-getopts( 'v' );
-
-$verbose = 1 if $opt_v;
-
-#-----------------------------------------------------------------------------
-#
-# Configuration Variables
-#
-
-$ROOT = $ENV{'ROOT'};
-
-#-----------------------------------------------------------------------------
-#
-# Reference Files
-#
-
-$gl_h = "$ROOT/usr/include/GL/gl.h";
-$glu_h = "$ROOT/usr/include/GL/glu.h";
-$glx_h = "$ROOT/usr/include/GL/glx.h";
-$glxtokens_h = "$ROOT/usr/include/GL/glxtokens.h";
-
-
-#-----------------------------------------------------------------------------
-#
-# Build lookup tables
-#
-
-%glTokens = ();
-open( INFILE, "$gl_h" );
-while ( <INFILE> ) {
- $glTokens{$1} = 1 if /^\#\s*define\s+GL_([\w\d_]+)/;
-}
-close( INFILE );
-
-%gluTokens = ();
-open( INFILE, "$glu_h" );
-while ( <INFILE> ) {
- $gluTokens{$1} = 1 if /^\#\s*define\s+GLU_([\w\d_]+)/;
-}
-close( INFILE );
-
-%glxTokens = ();
-open( INFILE, "$glx_h" );
-while ( <INFILE> ) {
- $glxTokens{$1} = 1 if /^\#\s*define\s+GLX_([\w\d_]+)/;
-}
-close( INFILE );
-
-open( INFILE, "$glxtokens_h" );
-while ( <INFILE> ) {
- $glxTokens{$1} = 1 if /^\#\s*define\s+GLX_([\w\d_]+)/;
-}
-close( INFILE );
-
-
-#-----------------------------------------------------------------------------
-#
-# Check files
-#
-
-$fmt = "[%s:%d] Undefined %s constant : '%s'\n";
-
-foreach $file ( @ARGV ) {
- $line = 1;
- open( INFILE, "$file" ) || ( warn "Unable to open file '$file'\n", next );
-
- print "Checking '$file' ...\n" if $verbose;
-
- while ( <INFILE> ) {
- @words = split;
- @tokens = grep( /_\w*const\([\w\d_]+\)/, @words );
-
- foreach ( @tokens ) {
- /(_\w*const)\(([\w\d]+)\)/;
- $constTag = $1;
- $token = $2;
-
- SWITCH : {
- $constTag =~ /_const|_econst|_extstring/
- && do {
- printf( $fmt, $file, $line, "GL", $token)
- unless $glTokens{$token} == 1;
- last SWITCH;
- };
-
- #
- # _arbconst's tack an extra "_ARB" onto the end of the
- # token. We need to check that.
- #
- $constTag =~ /_arbconst/
- && do {
- $arbToken = $token . "_ARB";
- printf( $fmt, $file, $line, "GL", $token)
- unless $glTokens{$arbToken} == 1;
- last SWITCH;
- };
-
- $constTag =~ /_gluconst/
- && do {
- printf( $fmt, $file, $line, "GLU", $token)
- unless $gluTokens{$token} == 1;
- last SWITCH;
- };
-
- $constTag =~ /_glxconst|_glxerror|_glxextstring/
- && do {
- printf( $fmt, $file, $line, "GLX", $token)
- unless $glxTokens{$token} == 1;
- last SWITCH;
- };
- }
- }
-
- $line++;
- }
- close( INFILE );
-}
diff --git a/xc/extras/ogl-sample/main/doc/man/tools/glman b/xc/extras/ogl-sample/main/doc/man/tools/glman
deleted file mode 100755
index 6ba5fe5ae..000000000
--- a/xc/extras/ogl-sample/main/doc/man/tools/glman
+++ /dev/null
@@ -1,57 +0,0 @@
-#! /bin/sh
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/doc/man/tools/Attic/glman,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-
-# $1 is the value of $PREFIX, $2 is the value of $DEPTH,
-# $3 is the target name, and $4 is the api file name.
-# $5 is M4 options (if any)
-
-bNamE=`echo $3 | sed -e s/\\\..*//`
-maCdIr=$2/macros
-export maCdIr
-m4opts=$5
-
-case `pwd` in
- *ftn) mKHeaD=mkhead.ftn.awk ; SeTUp=setup.ftn ;;
- *) mKHeaD=mkhead.awk ; SeTUp=setup ;;
-esac
-
-trap "rm -rf glmanm4.$$" 0 1 2 15
-
-aPiFile=${4:-$ROOT/usr/include/GL/gl.h}
-
-awk -f $2/macros/$mKHeaD -v prefix=$1 -v basename=$bNamE $aPiFile >glmanm4.$$
-cat $2/macros/$SeTUp glmanm4.$$ $3 | m4 $m4opts
diff --git a/xc/extras/ogl-sample/main/doc/man/tools/man2html b/xc/extras/ogl-sample/main/doc/man/tools/man2html
deleted file mode 100755
index 4953a6632..000000000
--- a/xc/extras/ogl-sample/main/doc/man/tools/man2html
+++ /dev/null
@@ -1,608 +0,0 @@
-#!/usr/bin/perl
-#!/usr/local/bin/perl
-##---------------------------------------------------------------------------##
-## File:
-## @(#) man2html 1.2 97/08/12 12:57:30 @(#)
-## Author:
-## Earl Hood, ehood@medusa.acs.uci.edu
-## Description:
-## man2html is a Perl program to convert formatted nroff output
-## to HTML.
-##
-## Recommend command-line options based on platform:
-##
-## Platform Options
-## ---------------------------------------------------------------------
-## c2mp <None, the defaults should be okay>
-## hp9000s700/800 -leftm 1 -topm 8
-## sun4 -sun
-## ---------------------------------------------------------------------
-##
-##---------------------------------------------------------------------------##
-## Copyright (C) 1995-1997 Earl Hood, ehood@medusa.acs.uci.edu
-##
-## 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 of the License, 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
-##---------------------------------------------------------------------------##
-
-package Man2Html;
-
-use Getopt::Long;
-
-($PROG = $0) =~ s/.*\///;
-$VERSION = "3.0.1";
-
-## Input and outputs filehandles
-$InFH = \*STDIN unless $InFH;
-$OutFH = \*STDOUT unless $OutFH;
-
-## Backspace character: Used in overstriking detection
-*bs = \"\b";
-
-## Hash of section titles and their HTML tag wrapper.
-## This list allows customization of what HTML tag is used for
-## a given section head.
-##
-## The section title can be a regular expression. Therefore, one must
-## be careful about quoting special characters.
-##
-%SectionHead = (
-
- '\S.*OPTIONS.*' => '<H2>',
- 'AUTHORS?' => '<H2>',
- 'BUGS' => '<H2>',
- 'COMPATIBILITY' => '<H2>',
- 'DEPENDENCIES' => '<H2>',
- 'DESCRIPTION' => '<H2>',
- 'DIAGNOSTICS' => '<H2>',
- 'ENVIRONMENT' => '<H2>',
- 'ERRORS' => '<H2>',
- 'EXAMPLES' => '<H2>',
- 'EXTERNAL INFLUENCES' => '<H2>',
- 'FILES' => '<H2>',
- 'LIMITATIONS' => '<H2>',
- 'NAME' => '<H2>',
- 'NOTES?' => '<H2>',
- 'OPTIONS' => '<H2>',
- 'REFERENCES' => '<H2>',
- 'RETURN VALUE' => '<H2>',
- 'SECTION.*:' => '<H2>',
- 'SEE ALSO' => '<H2>',
- 'STANDARDS CONFORMANCE' => '<H2>',
- 'STYLE CONVENTION' => '<H2>',
- 'SYNOPSIS' => '<H2>',
- 'SYNTAX' => '<H2>',
- 'WARNINGS' => '<H2>',
- '\s+Section.*:' => '<H3>',
-
-);
-
-## Fallback tag if above is not found
-$HeadFallback = '<H2>';
-
-## Other gobals
-
-$Bare = 0; # Skip printing HTML head/foot flag
-$BTag = 'B'; # Overstrike tag
-$CgiUrl = ''; # CGI URL expression
-$Compress = 0; # Do blank line compression flag
-$K = 0; # Do keyword search processing flag
-$NoDepage = 0; # Do not strip page information
-$NoHeads = 0; # Do no header detection flag
-$SeeAlso = 0; # Do only SEE ALSO xrefs flag
-$Solaris = 0; # Solaris keyword search processing flag
-$Sun = 0; # Headers not overstriken flag
-$Title = ''; # Title
-$UTag = 'I'; # Underline tag
-$ftsz = 7; # Bottome margin size
-$hdsz = 7; # Top margin size
-$leftm = ''; # Left margin pad
-$leftmsz = 0; # Left margin size
-$pgsz = 66; # Size of page size
-$txsz = 52; # Text body length size
-
-#############################################################################
-## Main Block
-#############################################################################
-{
- if (get_cli_opts()) {
- if ($K) {
- man_k();
- } else {
- do_it();
- }
- } else {
- usage();
- }
-}
-
-#############################################################################
-## Subroutines
-#############################################################################
-
-sub do_it {
-
- ## Define while loop and then eval it when used. The reason
- ## is to avoid the regular expression reevaulation in the
- ## section head detection code.
-
- $doitcode =<<'EndOfDoItCode';
-
- my($line, $tmp, $i, $head, $preindent, $see_also, $do);
-
- $see_also = !$SeeAlso;
- print $OutFH "<!-- Manpage converted by man2html $VERSION -->\n";
- LOOP: while(!eof($InFH)) {
- $blank = 0;
- for ($i=0; $i < $hdsz; $i++) {
- last LOOP unless defined($_ = <$InFH>);
- }
- for ($i=0; $i < $txsz; $i++) {
- last LOOP unless defined($_ = <$InFH>);
-
- ## Check if compress consecutive blank lines
- if ($Compress and !/\S/) {
- if ($blank) { next; } else { $blank = 1; }
- } else {
- $blank = 0;
- }
-
- ## Try to check if line space is needed at page boundaries ##
- if (!$NoDepage && ($i==0 || $i==($txsz-1)) && !/^\s*$/) {
- /^(\s*)/; $tmp = length($1);
- if ($do) {
- if ($tmp < $preindent) { print $OutFH "\n"; }
- } else {
- $do = 1;
- }
- $preindent = $tmp;
- } else {
- $do = 0; $preindent = 0;
- }
-
- ## Interpret line
- $line = $_;
- entitize(\$_); # Convert [$<>] to entity references
-
- ## Check for 'SEE ALSO' link only
- if (!$see_also && $CgiUrl && $SeeAlso) {
- ($tmp = $line) =~ s/.\010//go;
- if ($tmp =~ /^\s*SEE\s+ALSO\s*$/o) { $see_also = 1; }
- else { $see_also = 0; }
- }
-
- ## Create anchor links for manpage references
- s/((((.\010)+)?[\+_\.\w-])+\(((.\010)+)?
- \d((.\010)+)?\w?\))
- /make_xref($1)
- /geox if $see_also;
-
- ## Emphasize underlined words
- # s/((_\010[^_])+[\.\(\)_]?(_\010[^_])+\)?)/emphasize($1)/oge;
- # s/((_\010[^_])+([\.\(\)_]?(_\010[^_])+)?)/emphasize($1)/oge;
- #
- # The previous expressions were trying to be clever about
- # detecting underlined text which contain non-alphanumeric
- # characters. nroff will not underline non-alphanumeric
- # characters in an underlined phrase, and the above was trying
- # to detect that. It does not work all the time, and it
- # screws up other text, so a simplified expression is used.
-
- s/((_\010[^_])+)/emphasize($1)/oge;
-
- $secth = 0;
- ## Check for strong text and headings
- if ($Sun || /.\010./o) {
- if (!$NoHeads) {
- $line =~ s/.\010//go;
- $tmp = $HeadFallback;
-EndOfDoItCode
-
- ## Create switch statement for detecting a heading
- ##
- $doitcode .= "HEADSW: {\n";
- foreach $head (keys %SectionHead) {
- $doitcode .= join("", "\$tmp = '$SectionHead{$head}', ",
- "\$secth = 1, last HEADSW ",
- "if \$line =~ /^$leftm$head/o;\n");
- }
- $doitcode .= "}\n";
-
- ## Rest of routine
- ##
- $doitcode .=<<'EndOfDoItCode';
- if ($secth || $line =~ /^$leftm\S/o) {
- chop $line;
- $_ = $tmp . $line . $tmp;
- s%<([^>]*)>$%</$1>%;
- $_ = "\n</PRE>\n" . $_ . "<PRE>\n";
- } else {
- s/(((.\010)+.)+)/strongize($1)/oge;
- }
- } else {
- s/(((.\010)+.)+)/strongize($1)/oge;
- }
- }
- print $OutFH $_;
- }
-
- for ($i=0; $i < $ftsz; $i++) {
- last LOOP unless defined($_ = <$InFH>);
- }
- }
-EndOfDoItCode
-
-
- ## Perform processing.
-
- printhead() unless $Bare;
- print $OutFH "<PRE>\n";
- eval $doitcode; # $doitcode defined above
- print $OutFH "</PRE>\n";
- printtail() unless $Bare;
-}
-
-##---------------------------------------------------------------------------
-##
-sub get_cli_opts {
- return 0 unless
- GetOptions(
- "bare", # Leave out HTML, HEAD, BODY tags.
- "belem=s", # HTML Element for overstriked text (def: "B")
- "botm=i", # Number of lines for bottom margin (def: 7)
- "cgiurl=s", # CGI URL for linking to other manpages
- "cgiurlexp=s", # CGI URL Perl expr for linking to other manpages
- "compress", # Compress consecutive blank lines
- "headmap=s", # Filename of user section head map file
- "k", # Process input from 'man -k' output.
- "leftm=i", # Character width of left margin (def: 0)
- "nodepage", # Do not remove pagination lines
- "noheads", # Do not detect for section heads
- "pgsize=i", # Number of lines in a page (def: 66)
- "seealso", # Link to other manpages only in the SEE ALSO section
- "solaris", # Parse 'man -k' output from a solaris system
- "sun", # Section heads are not overstriked in input
- "title=s", # Title of manpage (def: Not defined)
- "topm=i", # Number of lines for top margin (def: 7)
- "uelem=s", # HTML Element for underlined text (def: "I")
-
- "help" # Short usage message
- );
- return 0 if defined($opt_help);
-
- $pgsz = $opt_pgsize || $pgsz;
- if (defined($opt_nodepage)) {
- $hdsz = 0;
- $ftsz = 0;
- } else {
- $hdsz = $opt_topm if defined($opt_topm);
- $ftsz = $opt_botm if defined($opt_botm);
- }
- $txsz = $pgsz - ($hdsz + $ftsz);
- $leftmsz = $opt_leftm if defined($opt_leftm);
- $leftm = ' ' x $leftmsz;
-
- $Bare = defined($opt_bare);
- $Compress = defined($opt_compress);
- $K = defined($opt_k);
- $NoDepage = defined($opt_nodepage);
- $NoHeads = defined($opt_noheads);
- $SeeAlso = defined($opt_seealso);
- $Solaris = defined($opt_solaris);
- $Sun = defined($opt_sun);
-
- $Title = $opt_title || $Title;
- $CgiUrl = $opt_cgiurlexp ||
- ($opt_cgiurl ? qq{return "$opt_cgiurl"} : '');
-
- $BTag = $opt_belem || $BTag;
- $UTag = $opt_uelem || $UTag;
- $BTag =~ s/[<>]//g;
- $UTag =~ s/[<>]//g;
-
- if (defined($opt_headmap)) {
- require $opt_headmap or warn "Unable to read $opt_headmap\n";
- }
- 1;
-}
-
-##---------------------------------------------------------------------------
-sub printhead {
- print $OutFH "<HTML>\n";
- print $OutFH "<HEAD>\n",
- "<TITLE>$Title</TITLE>\n",
- "</HEAD>\n" if $Title;
- print $OutFH "<BODY>\n";
- print $OutFH "<H1>$Title</H1>\n",
- "<HR>\n" if $Title;
-}
-
-##---------------------------------------------------------------------------
-sub printtail {
- print $OutFH <<EndOfRef;
-<HR>
-<ADDRESS>
-Man(1) output converted with
-<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
-</ADDRESS>
-</BODY>
-</HTML>
-EndOfRef
-}
-
-##---------------------------------------------------------------------------
-sub emphasize {
- my($txt) = shift;
- $txt =~ s/.\010//go;
- $txt = "<$UTag>$txt</$UTag>";
- $txt;
-}
-
-##---------------------------------------------------------------------------
-sub strongize {
- my($txt) = shift;
- $txt =~ s/.\010//go;
- $txt = "<$BTag>$txt</$BTag>";
- $txt;
-}
-
-##---------------------------------------------------------------------------
-sub entitize {
- my($txt) = shift;
-
- ## Check for special characters in overstrike text ##
- $$txt =~ s/_\010\&/strike('_', '&')/geo;
- $$txt =~ s/_\010</strike('_', '<')/geo;
- $$txt =~ s/_\010>/strike('_', '>')/geo;
-
- $$txt =~ s/(\&\010)+\&/strike('&', '&')/geo;
- $$txt =~ s/(<\010)+</strike('<', '<')/geo;
- $$txt =~ s/(>\010)+>/strike('>', '>')/geo;
-
- ## Check for special characters in regular text. Must be careful
- ## to check before/after character in expression because it might be
- ## a special character.
- $$txt =~ s/([^\010]\&[^\010])/htmlize2($1)/geo;
- $$txt =~ s/([^\010]<[^\010])/htmlize2($1)/geo;
- $$txt =~ s/([^\010]>[^\010])/htmlize2($1)/geo;
-}
-
-##---------------------------------------------------------------------------
-## escape special characters in a string, in-place
-##
-sub htmlize {
- my($str) = shift;
- $$str =~ s/&/\&amp;/g;
- $$str =~ s/</\&lt;/g;
- $$str =~ s/>/\&gt;/g;
- $$str;
-}
-
-##---------------------------------------------------------------------------
-## htmlize2() is used by entitize.
-##
-sub htmlize2 {
- my($str) = shift;
- $str =~ s/&/\&amp;/g;
- $str =~ s/</\&lt;/g;
- $str =~ s/>/\&gt;/g;
- $str;
-}
-
-##---------------------------------------------------------------------------
-## strike converts HTML special characters in overstriked text
-## into entity references. The entities are overstriked so
-## strongize() and emphasize() will recognize the entity to be
-## wrapped in tags.
-##
-sub strike {
- my($w, $char) = @_;
- my($ret);
- if ($w eq '_') {
- if ($char eq '&') {
- $ret = "_$bs\&_${bs}a_${bs}m_${bs}p_${bs};";
- } elsif ($char eq '<') {
- $ret = "_$bs\&_${bs}l_${bs}t_${bs};";
- } elsif ($char eq '>') {
- $ret = "_$bs\&_${bs}g_${bs}t_${bs};";
- } else {
- warn qq|Unrecognized character, "$char", passed to strike()\n|;
- }
- } else {
- if ($char eq '&') {
- $ret = "\&$bs\&a${bs}am${bs}mp${bs}p;${bs};";
- } elsif ($char eq '<') {
- $ret = "\&$bs\&l${bs}lt${bs}t;${bs};";
- } elsif ($char eq '>') {
- $ret = "\&$bs\&g${bs}gt${bs}t;${bs};";
- } else {
- warn qq|Unrecognized character, "$char", passed to strike()\n|;
- }
- }
- $ret;
-}
-
-##---------------------------------------------------------------------------
-## make_xref() converts a manpage crossreference into a hyperlink.
-##
-sub make_xref {
- my $str = shift;
- $str =~ s/.\010//go; # Remove overstriking
-
- if ($CgiUrl) {
- my($title,$section,$subsection) =
- ($str =~ /([\+_\.\w-]+)\((\d)(\w?)\)/);
-
- $title =~ s/\+/%2B/g;
- my($href) = (eval $CgiUrl);
- qq|<B><A HREF="$href">$str</A></B>|;
- } else {
- qq|<B>$str</B>|;
- }
-}
-
-##---------------------------------------------------------------------------
-## man_k() process a keyword search. The problem we have is there
-## is no standard for keyword search results from man. Solaris
-## systems have a different enough format to warrent dealing
-## with it as a special case. For other cases, we try our best.
-## Unfortunately, there are some lines of results that may be
-## skipped.
-##
-sub man_k {
- my($line,$refs,$section,$subsection,$desc,$i,
- %Sec1, %Sec1sub, %Sec2, %Sec2sub, %Sec3, %Sec3sub,
- %Sec4, %Sec4sub, %Sec5, %Sec5sub, %Sec6, %Sec6sub,
- %Sec7, %Sec7sub, %Sec8, %Sec8sub, %Sec9, %Sec9sub,
- %SecN, %SecNsub, %SecNsec);
-
- printhead() unless $Bare;
- print $OutFH "<!-- Man keyword results converted by ",
- "man2html $VERSION -->\n";
-
- while ($line = <$InFH>) {
- next if $line !~ /\(\d\w?\)\s+-\s/; # check if line can be handled
- ($refs,$section,$subsection,$desc) =
- $line =~ /^\s*(.*)\((\d)(\w?)\)\s*-\s*(.*)$/;
-
- if ($Solaris) {
- $refs =~ s/^\s*([\+_\.\w-]+)\s+([\+_\.\w-]+)\s*$/$1/;
- # <topic> <manpage>
- } else {
- $refs =~ s/\s(and|or)\s/,/gi; # Convert and/or to commas
- $refs =~ s/^[^:\s]:\s*//; # Remove prefixed whatis path
- }
- $refs =~ s/\s//g; # Remove all whitespace
- $refs =~ s/,/, /g; # Put space after comma
- htmlize(\$desc); # Check for special chars in desc
- $desc =~ s/^(.)/\U$1/; # Uppercase first letter in desc
-
- if ($section eq '1') {
- $Sec1{$refs} = $desc; $Sec1sub{$refs} = $subsection;
- } elsif ($section eq '2') {
- $Sec2{$refs} = $desc; $Sec2sub{$refs} = $subsection;
- } elsif ($section eq '3') {
- $Sec3{$refs} = $desc; $Sec3sub{$refs} = $subsection;
- } elsif ($section eq '4') {
- $Sec4{$refs} = $desc; $Sec4sub{$refs} = $subsection;
- } elsif ($section eq '5') {
- $Sec5{$refs} = $desc; $Sec5sub{$refs} = $subsection;
- } elsif ($section eq '6') {
- $Sec6{$refs} = $desc; $Sec6sub{$refs} = $subsection;
- } elsif ($section eq '7') {
- $Sec7{$refs} = $desc; $Sec7sub{$refs} = $subsection;
- } elsif ($section eq '8') {
- $Sec8{$refs} = $desc; $Sec8sub{$refs} = $subsection;
- } elsif ($section eq '9') {
- $Sec9{$refs} = $desc; $Sec9sub{$refs} = $subsection;
- } else { # Catch all
- $SecN{$refs} = $desc; $SecNsec{$refs} = $section;
- $SecNsub{$refs} = $subsection;
- }
- }
- print_mank_sec(\%Sec1, 1, \%Sec1sub);
- print_mank_sec(\%Sec2, 2, \%Sec2sub);
- print_mank_sec(\%Sec3, 3, \%Sec3sub);
- print_mank_sec(\%Sec4, 4, \%Sec4sub);
- print_mank_sec(\%Sec5, 5, \%Sec5sub);
- print_mank_sec(\%Sec6, 6, \%Sec6sub);
- print_mank_sec(\%Sec7, 7, \%Sec7sub);
- print_mank_sec(\%Sec8, 8, \%Sec8sub);
- print_mank_sec(\%Sec9, 9, \%Sec9sub);
- print_mank_sec(\%SecN, 'N', \%SecNsub, \%SecNsec);
-
- printtail() unless $Bare;
-}
-##---------------------------------------------------------------------------
-## print_mank_sec() prints out manpage cross-refs of a specific section.
-##
-sub print_mank_sec {
- my($sec, $sect, $secsub, $secsec) = @_;
- my(@array, @refs, $href, $item, $title, $subsection, $i, $section,
- $xref);
- $section = $sect;
-
- @array = sort keys %$sec;
- if ($#array >= 0) {
- print $OutFH "<H2>Section $section</H2>\n",
- "<DL COMPACT>\n";
- foreach $item (@array) {
- @refs = split(/,/, $item);
- $section = $secsec->{$item} if $sect eq 'N';
- $subsection = $secsub->{$item};
- if ($CgiUrl) {
- ($title = $refs[0]) =~ s/\(\)//g; # watch out for extra ()'s
- $xref = eval $CgiUrl;
- }
- print $OutFH "<DT>\n";
- $i = 0;
- foreach (@refs) {
- if ($CgiUrl) {
- print $OutFH qq|<B><A HREF="$xref">$_</A></B>|;
- } else {
- print $OutFH $_;
- }
- print $OutFH ", " if $i < $#refs;
- $i++;
- }
- print $OutFH " ($section$subsection)\n",
- "</DT><DD>\n",
- $sec->{$item}, "</DD>\n";
- }
- print $OutFH "</DL>\n";
- }
-}
-
-##---------------------------------------------------------------------------
-##
-sub usage {
- print $OutFH <<EndOfUsage;
-Usage: $PROG [ options ] < infile > outfile
-Options:
- -bare : Do not put in HTML, HEAD, BODY tags
- -belem <elem> : HTML Element for overstriked text (def: "B")
- -botm <#> : Number of lines for bottom margin (def: 7)
- -cgiurl <url> : URL for linking to other manpages
- -cgiurlexp <url> : Perl expression URL for linking to other manpages
- -compress : Compress consective blank lines
- -headmap <file> : Filename of user section head map file
- -help : This message
- -k : Process a keyword search result
- -leftm <#> : Character width of left margin (def: 0)
- -nodepage : Do not remove pagination lines
- -noheads : Turn off section head detection
- -pgsize <#> : Number of lines in a page (def: 66)
- -seealso : Link to other manpages only in the SEE ALSO section
- -solaris : Process keyword search result in Solaris format
- -sun : Section heads are not overstriked in input
- -title <string> : Title of manpage (def: Not defined)
- -topm <#> : Number of lines for top margin (def: 7)
- -uelem <elem> : HTML Element for underlined text (def: "I")
-
-Description:
- $PROG takes formatted manpages from STDIN and converts it to HTML sent
- to STDOUT. The -topm and -botm arguments are the number of lines to the
- main body text and NOT to the running headers/footers.
-
-Version:
- $VERSION
- Copyright (C) 1995-1997 Earl Hood, ehood\@medusa.acs.uci.edu
- $PROG comes with ABSOLUTELY NO WARRANTY and $PROG may be copied only
- under the terms of the GNU General Public License, which may be found in
- the $PROG distribution.
-
-EndOfUsage
- exit 0;
-}
diff --git a/xc/extras/ogl-sample/main/doc/man/tools/mdate.pl b/xc/extras/ogl-sample/main/doc/man/tools/mdate.pl
deleted file mode 100755
index ae6e6455c..000000000
--- a/xc/extras/ogl-sample/main/doc/man/tools/mdate.pl
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/perl
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/doc/man/tools/Attic/mdate.pl,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-
-foreach (@ARGV) {
- ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,
- $mtime,$ctime,$blksize,$blocks) = stat($_);
-
- if ($mtime) {
- ($tm_sec,$tm_min,$tm_hour,$tm_mday,$tm_mon,$tm_year,$tm_wday,
- $tm_yday,$tm_isdst) = localtime($mtime);
-
- if ($tm_mday) {
- print "-rd", $tm_mday, " -rm", $tm_mon, " -ry", $tm_year, "\n";
- }
- }
-}
diff --git a/xc/extras/ogl-sample/main/doc/man/tools/mmdoc b/xc/extras/ogl-sample/main/doc/man/tools/mmdoc
deleted file mode 100755
index ac2e01f67..000000000
--- a/xc/extras/ogl-sample/main/doc/man/tools/mmdoc
+++ /dev/null
@@ -1,220 +0,0 @@
-#! /bin/sh -x
-
-# @(#)mmdoc 1.21 /doccenter/tmadm/src/shell/s.mmdoc
-# general documentation generator
-#
-# Files begining with a ".TH" macro are treated as manual pages.
-# Files whose first line is
-# '\" x
-# where "x" is a string begining with "c", "e", "t" are also treated as
-# manual pages.
-# Files whose first line is
-# '\"! text
-# are processed by the command line "text" with the file provided
-# as the standard input.
-# Files whose first line is
-# '\"macro name
-# where "name" is the name of a file in TMMACRO will be run off with
-# that macro package. "name"s begining "-" will be flag arguments
-# to nroff.
-# All others are handed to nroff with -cm and mmdoc
-#
-# Assumes mdate.pl will be found by the current search path.
-#
-umask 0 # nroff must be able to write into files it closes
-while [ -n "$1" ]
-do
- case $1 in
- -D )
- DrafT=-rC3
- export DrafT
- ;;
- -T* )
- TERM=`expr $1 : '-T\(.*\)'`
- case ${TERM} in
- eps)
- post="|deps"
- flavor=troff
- ;;
- aps)
- post="|apsend b=m305"
- flavor=troff
- ;;
- Aps) # This is a fake out so that collections
- # can be sent as a unit to APS-5
- # instead of series of calls. Used only by
- # collection routine 'tcol_final'
- post=
- flavor=troff
- TERM=aps
- ;;
- image)
- post="|apsend b=m305 d=i"
- flavor=troff
- TERM=aps
- ;;
- i300)
- post="|dimpress"
- flavor=troff
- ;;
- 8300)
- post="|dimpress"
- flavor=troff
- TERM=aps
- ;;
- psc)
- post="|psdit |lp -oh"
- flavor=troff
- export TERM
- ;;
-
- PS)
- post="|psdit"
- flavor=troff
- TERM=psc
- export TERM
- ;;
- X100)
- post=""
- flavor=troff
- TERM=X100
- export TERM
- ;;
- *)
- post=
- flavor=nroff
- ;;
- esac
- export post flavor
- ;;
- -r[ymd]* )
- DocdatE="$DocdatE $1"
- export DocdatE
- dateset=yes
- ;;
- -?* )
- flags="$flags $1"
- export flags
- ;;
- - | * )
- break
- esac
- shift
-done
-if [ $# = 0 ]
-then
- set -- -
-fi
-for i
-{
- if [ "$i" != "-" -a ! -s "$i" ]
- then
- echo "Cannot input file: $i"
- continue
- fi
- case $i in
- - )
- ;;
- * )
- Line1=`line <$i`
- if [ ! "${dateset}" ]
- then
- # DocdatE is intentionally capitalized that way
- # to cut the possibility of env name collision.
- DocdatE=`mdate.pl $i`
- export DocdatE
- fi
- esac
-
- MacrO=${TMMACRO}
-
- case "${Line1}" in
- .TH* | "'\\\" "[cet]* )
- man -T${TERM} -d ${DocdatE} $*
- ;;
- "'\\\"!"* )
- cmd=`echo "${Line1}" | sed 's/^....//'`
- if [ "$flavor" != troff ]
- then
- cmd=`echo " ${cmd} " | sed 's/ eqn / neqn /'`
- fi
- Line1=`sed -n -e 2p -e 2q ${i}`
- export Line1
- if [ "$flavor" = troff ]
- then
- eval '<$i' $cmd
- #eval `parse "$cmd" ${i}`
- else
- TERM=lp
- eval '<$i' $cmd
- fi
- ;;
- "'\\\"macro"* )
- cmd=`echo "${Line1}" |
- sed ' s/.."macro//'"
- s:[ ]\([^- ]\): ${TMMACRO?}/\1:g"`
- cmd=`echo $cmd|sed "s;[ ]*.*/stdmacro;${MacrO?}/strings.mm ${MacrO?}/stdmacro;"`
- cmd="$cmd $OTHERFILES"
- if [ "$flavor" = troff ]
- then
- case "$cmd" in
- *stdmacro*)
- case "$flags" in
- *-rs[0-9]*)
- ;;
- *)
- flags="${flags} -rs1"
- esac
- esac
- eval troff -T${TERM} ${DrafT} ${DocdatE} ${flags} ${cmd} $i ${post}
- else
- eval nroff ${DrafT} ${DocdatE} ${flags} ${cmd} $i
- fi
- ;;
- "'\\\"text"* )
- cmd=`echo "${Line1}" |
- sed ' s/.."text//'"
- s:[ ]\([^- ]\): ${TMMACRO?}/\1:g"`
- cmd=`echo $cmd|sed "s;[ ]*.*/docmacs;${MacrO?}/docmacs;"`
- if [ "$flavor" = troff ]
- then
- eval troff -T${TERM} ${DrafT} ${DocdatE} ${flags} ${cmd} $i ${post}
- else
- eval nroff ${DrafT} ${DocdatE} ${flags} ${cmd} $i
- fi
- ;;
- .tH* )
- # Right now 2/12/85 this stuff not used for DSG work.
- # No enhancements to do troff done yet.
- # Will do as necessary
- if [ -r ${TMMACRO}/mandocvar ]
- then
- . ${TMMACRO}/mandocvar
- fi
- nroff -T${TERM} ${DocdatE} ${flags} \
- -can ${MacrO?}/mandoc ${i} |
- col
- ;;
- .pH* | '' | * )
- if [ -r ${TMMACRO}/mmdocvar ]
- then
- . ${TMMACRO}/mmdocvar
- fi
- if [ "$flavor" = troff ]
- then
- eval troff -T${TERM} -rW${Width:-5}i \
- -rL${Length:-8.5}i \
- ${DocdatE} ${DrafT} ${flags} \
- /usr/bin/mmt $i ${post}
- else
- TERM=lp
- nroff -T${TERM} -u${Overstrike:-1} -rW${Width:-79} \
- -rO${Offset:-0} -rL${Length:-66} \
- ${DocdatE} ${DrafT} ${flags} \
- ${MacrO?}/newmm \
- ${MacrO?}/mmdoc ${TMMACRO}/custom $i |
- col
- fi
- ;;
- esac
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/Distfile b/xc/extras/ogl-sample/main/gfx/lib/glu/Distfile
deleted file mode 100755
index 3d55b3680..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/Distfile
+++ /dev/null
@@ -1,212 +0,0 @@
-#
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/Attic/Distfile,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-#
-
-DISTDIR_SI = /xc/lib/GL/glu
-
-DISTFILES_SI = \
- Imakefile \
- include/gluos.h \
- libnurbs/interface/bezierEval.cc \
- libnurbs/interface/bezierEval.h \
- libnurbs/interface/bezierPatchMesh.cc \
- libnurbs/interface/bezierPatchMesh.h \
- libnurbs/interface/bezierPatch.cc \
- libnurbs/interface/bezierPatch.h \
- libnurbs/interface/glcurveval.cc \
- libnurbs/interface/glcurveval.h \
- libnurbs/interface/glimports.h \
- libnurbs/interface/glinterface.cc \
- libnurbs/interface/glrenderer.cc \
- libnurbs/interface/glrenderer.h \
- libnurbs/interface/glsurfeval.cc \
- libnurbs/interface/glsurfeval.h \
- libnurbs/interface/incurveeval.cc \
- libnurbs/interface/insurfeval.cc \
- libnurbs/interface/Imakefile \
- libnurbs/interface/mystdio.h \
- libnurbs/interface/mystdlib.h \
- libnurbs/internals/arcsorter.cc \
- libnurbs/internals/arcsorter.h \
- libnurbs/internals/arctess.cc \
- libnurbs/internals/arctess.h \
- libnurbs/internals/arc.cc \
- libnurbs/internals/arc.h \
- libnurbs/internals/backend.cc \
- libnurbs/internals/backend.h \
- libnurbs/internals/basiccrveval.cc \
- libnurbs/internals/basiccrveval.h \
- libnurbs/internals/basicsurfeval.cc \
- libnurbs/internals/basicsurfeval.h \
- libnurbs/internals/bezierarc.h \
- libnurbs/internals/bin.cc \
- libnurbs/internals/bin.h \
- libnurbs/internals/bufpool.cc \
- libnurbs/internals/bufpool.h \
- libnurbs/internals/cachingeval.cc \
- libnurbs/internals/cachingeval.h \
- libnurbs/internals/ccw.cc \
- libnurbs/internals/checker.h \
- libnurbs/internals/coveandtiler.cc \
- libnurbs/internals/coveandtiler.h \
- libnurbs/internals/curvelist.cc \
- libnurbs/internals/curvelist.h \
- libnurbs/internals/curvesub.cc \
- libnurbs/internals/curve.cc \
- libnurbs/internals/curve.h \
- libnurbs/internals/dataTransform.cc \
- libnurbs/internals/dataTransform.h \
- libnurbs/internals/defines.h \
- libnurbs/internals/displaylist.cc \
- libnurbs/internals/displaylist.h \
- libnurbs/internals/displaymode.h \
- libnurbs/internals/flistsorter.cc \
- libnurbs/internals/flistsorter.h \
- libnurbs/internals/flist.cc \
- libnurbs/internals/flist.h \
- libnurbs/internals/gridline.h \
- libnurbs/internals/gridtrimvertex.h \
- libnurbs/internals/gridvertex.h \
- libnurbs/internals/hull.cc \
- libnurbs/internals/hull.h \
- libnurbs/internals/intersect.cc \
- libnurbs/internals/Imakefile \
- libnurbs/internals/jarcloc.h \
- libnurbs/internals/knotvector.cc \
- libnurbs/internals/knotvector.h \
- libnurbs/internals/knot.h \
- libnurbs/internals/mapdescv.cc \
- libnurbs/internals/mapdesc.cc \
- libnurbs/internals/mapdesc.h \
- libnurbs/internals/maplist.cc \
- libnurbs/internals/maplist.h \
- libnurbs/internals/mesher.cc \
- libnurbs/internals/mesher.h \
- libnurbs/internals/monotonizer.cc \
- libnurbs/internals/monotonizer.h \
- libnurbs/internals/monoTriangulationBackend.cc \
- libnurbs/internals/myassert.h \
- libnurbs/internals/mybstring.h \
- libnurbs/internals/mycode.cc \
- libnurbs/internals/mymath.h \
- libnurbs/internals/mysetjmp.h \
- libnurbs/internals/mystring.h \
- libnurbs/internals/nurbsconsts.h \
- libnurbs/internals/nurbsinterfac.cc \
- libnurbs/internals/nurbstess.cc \
- libnurbs/internals/nurbstess.h \
- libnurbs/internals/patchlist.cc \
- libnurbs/internals/patchlist.h \
- libnurbs/internals/patch.cc \
- libnurbs/internals/patch.h \
- libnurbs/internals/pwlarc.h \
- libnurbs/internals/quilt.cc \
- libnurbs/internals/quilt.h \
- libnurbs/internals/reader.cc \
- libnurbs/internals/reader.h \
- libnurbs/internals/renderhints.cc \
- libnurbs/internals/renderhints.h \
- libnurbs/internals/README.Copyright \
- libnurbs/internals/simplemath.h \
- libnurbs/internals/slicer.cc \
- libnurbs/internals/slicer.h \
- libnurbs/internals/sorter.cc \
- libnurbs/internals/sorter.h \
- libnurbs/internals/splitarcs.cc \
- libnurbs/internals/subdivider.cc \
- libnurbs/internals/subdivider.h \
- libnurbs/internals/tobezier.cc \
- libnurbs/internals/trimline.cc \
- libnurbs/internals/trimline.h \
- libnurbs/internals/trimregion.cc \
- libnurbs/internals/trimregion.h \
- libnurbs/internals/trimvertex.h \
- libnurbs/internals/trimvertpool.cc \
- libnurbs/internals/trimvertpool.h \
- libnurbs/internals/types.h \
- libnurbs/internals/uarray.cc \
- libnurbs/internals/uarray.h \
- libnurbs/internals/varray.cc \
- libnurbs/internals/varray.h \
- libnurbs/Imakefile \
- libnurbs/nurbtess/definitions.h \
- libnurbs/nurbtess/directedLine.cc \
- libnurbs/nurbtess/directedLine.h \
- libnurbs/nurbtess/glimports.h \
- libnurbs/nurbtess/gridWrap.cc \
- libnurbs/nurbtess/gridWrap.h \
- libnurbs/nurbtess/Imakefile \
- libnurbs/nurbtess/monoChain.cc \
- libnurbs/nurbtess/monoChain.h \
- libnurbs/nurbtess/monoPolyPart.cc \
- libnurbs/nurbtess/monoPolyPart.h \
- libnurbs/nurbtess/monoTriangulation.cc \
- libnurbs/nurbtess/monoTriangulation.h \
- libnurbs/nurbtess/mystdio.h \
- libnurbs/nurbtess/mystdlib.h \
- libnurbs/nurbtess/partitionX.cc \
- libnurbs/nurbtess/partitionX.h \
- libnurbs/nurbtess/partitionY.cc \
- libnurbs/nurbtess/partitionY.h \
- libnurbs/nurbtess/polyDBG.cc \
- libnurbs/nurbtess/polyDBG.h \
- libnurbs/nurbtess/polyUtil.cc \
- libnurbs/nurbtess/polyUtil.h \
- libnurbs/nurbtess/primitiveStream.cc \
- libnurbs/nurbtess/primitiveStream.h \
- libnurbs/nurbtess/quicksort.cc \
- libnurbs/nurbtess/quicksort.h \
- libnurbs/nurbtess/rectBlock.cc \
- libnurbs/nurbtess/rectBlock.h \
- libnurbs/nurbtess/sampleCompBot.cc \
- libnurbs/nurbtess/sampleCompBot.h \
- libnurbs/nurbtess/sampleCompRight.cc \
- libnurbs/nurbtess/sampleCompRight.h \
- libnurbs/nurbtess/sampleCompTop.cc \
- libnurbs/nurbtess/sampleCompTop.h \
- libnurbs/nurbtess/sampleComp.cc \
- libnurbs/nurbtess/sampleComp.h \
- libnurbs/nurbtess/sampledLine.cc \
- libnurbs/nurbtess/sampledLine.h \
- libnurbs/nurbtess/sampleMonoPoly.cc \
- libnurbs/nurbtess/sampleMonoPoly.h \
- libnurbs/nurbtess/searchTree.cc \
- libnurbs/nurbtess/searchTree.h \
- libnurbs/nurbtess/zlassert.h \
- libtess/dict-list.h \
- libtess/dict.c \
- libtess/dict.h \
- libtess/geom.c \
- libtess/geom.h \
- libtess/Imakefile \
- libtess/memalloc-non-thread-safe.c \
- libtess/memalloc-non-thread-safe.h \
- libtess/memalloc.c \
- libtess/memalloc.h \
- libtess/mesh.c \
- libtess/mesh.h \
- libtess/normal.c \
- libtess/normal.h \
- libtess/priorityq-heap.c \
- libtess/priorityq-heap.h \
- libtess/priorityq-sort.h \
- libtess/priorityq.c \
- libtess/priorityq.h \
- libtess/render.c \
- libtess/render.h \
- libtess/README \
- libtess/sweep.c \
- libtess/sweep.h \
- libtess/tessmono.c \
- libtess/tessmono.h \
- libtess/tess.c \
- libtess/tess.h \
- libutil/error.c \
- libutil/glue.c \
- libutil/gluint.h \
- libutil/Imakefile \
- libutil/mipmap.c \
- libutil/project.c \
- libutil/quad.c \
- libutil/registry.c \
- $(NULL)
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/GNUmakefile b/xc/extras/ogl-sample/main/gfx/lib/glu/GNUmakefile
deleted file mode 100755
index 485d88e3f..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/GNUmakefile
+++ /dev/null
@@ -1,108 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/Attic/GNUmakefile,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-
-COMMONPREF = standard
-include $(ROOT)/usr/include/make/commondefs
-include $(ROOT)/usr/include/libspec/libspecdefs
-
-TARGET = libGLU.so.1
-
-TARGETS = $(TARGET)
-
-LLDLIBS = -lGL -lm
-ifeq ($(OS),Linux)
-# use g++ rather than ld
-LD=g++
-LDDSOFLAGS=-shared -Wl,-soname=$(TARGET) -Wl,--whole-archive
-LDFLAGS=-Wl,--no-whole-archive
-else
-LLDLIBS += -lc -lC
-endif
-DSONAME = $(TARGET)
-DSOEXPORTS = glu.exports
-
-SUBDIRS = \
- include \
- libutil \
- libtess \
- libnurbs \
- $(NULL)
-
-UTIL = libutil/libutil.a
-TESS = libtess/libtess.a
-NURB_INTERNAL = libnurbs/internals/libinternals.a
-NURB_INTERFACE = libnurbs/interface/libinterface.a
-NURB_TESS = libnurbs/nurbtess/libnurbtess.a
-SRCLIBS = $(UTIL) $(TESS) $(NURB_INTERNAL) $(NURB_INTERFACE) $(NURB_TESS)
-
-default libs: $(_FORCE)
- cd libutil; $(MAKE);
- cd libtess; $(MAKE);
- cd libnurbs/internals; $(MAKE);
- cd libnurbs/interface; $(MAKE);
- cd libnurbs/nurbtess; $(MAKE);
- $(MAKE) $(TARGET);
-
-headers headers_install apps:
-
-libs_install install: default
- $(INSTALL) -F $(LIB_LOCATION) $(TARGET);
-
-distsi distoss:
- $(MAKE) $(COMMONPREF)$@
- $(SUBDIRS_MAKERULE)
-
-$(TARGET): $(DSOEXPORTS) $(SRCLIBS)
- $(LD) $(LDDSOFLAGS) $(SRCLIBS) $(LDFLAGS) -o $@;
-
-$(DSOEXPORTS): $(LIBSPEC_PARSER) $(TYPEMAPSDIR)/$(C_TYPEMAP) \
- $(SPECDIR)/$(GLU_SPEC) exports.ls GNUmakefile
- rm -f $@.tmp.ls;
- cat exports.ls > $@.tmp.ls;
- $(LIBSPEC) -DOUTPUT="$@" -DPROCPREFIX="glu" \
- -DTYPEMAP=$(TYPEMAPSDIR)/$(C_TYPEMAP) \
- -P $(LIBSPEC_PARSER) $@.tmp.ls "$(SPECDIR)/$(GLU_SPEC)" > $@;
- sort +1 $@ -o $@;
- rm $@.tmp.ls;
-
-# local dirt, cpp output files and assembler listings
-LDIRT = $(DSOEXPORTS)
-
-include $(COMMONRULES)
-
-$(COMMONTARGS): % : $(COMMONPREF)%
- $(SUBDIRS_MAKERULE)
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/Imakefile b/xc/extras/ogl-sample/main/gfx/lib/glu/Imakefile
deleted file mode 100755
index c63186b50..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/Imakefile
+++ /dev/null
@@ -1,66 +0,0 @@
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-#define DoNormalLib NormalLibGlu
-#define DoSharedLib SharedLibGlu
-#define DoDebugLib DebugLibGlu
-#define DoProfileLib ProfileLibGlu
-#define IHaveSubdirs
-#define LibName GLU
-#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
-#define SoRev SOGLUREV
-
-#if defined(LinuxArchitecture)
-#define SharedLibraryCcCmd CplusplusCmd
-SHLIBLDFLAGS = -shared -Wl,--whole-archive
-REQUIREDLIBS = -Wl,--no-whole-archive
-#else
-REQUIREDLIBS = -lGL -lm -lc -lC
-#endif
-
-SUBDIRS = \
- libnurbs \
- libtess \
- libutil
-
-OBJS = \
- libutil/libutil.a \
- libtess/libtess.a \
- libnurbs/internals/libinternals.a \
- libnurbs/interface/libinterface.a \
- libnurbs/nurbtess/libnurbtess.a
-
-MakeSubdirs($(SUBDIRS))
-DependSubdirs($(SUBDIRS))
-
-#include <Library.tmpl>
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/exports.ls b/xc/extras/ogl-sample/main/gfx/lib/glu/exports.ls
deleted file mode 100755
index 73b238352..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/exports.ls
+++ /dev/null
@@ -1,106 +0,0 @@
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-
-#
-# This awk script is used to generate exports
-#
-# Declare the language and type map to use and initialize any special tables
-# required for processing.
-#
-# $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/Attic/exports.ls,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-
-function initialize() {
-
- # these should be defined on the command line that invokes libspec
- proc_prefix = PROCPREFIX;
- typeMapFile = TYPEMAP;
- future = FUTURE;
-
- # Initialization for sanitizing function names:
- MaxIDLen = 31;
-}
-
-function main( i, param, cmdlen, varsize) {
-
- if (("extension", "not_implemented") in propListValues) return;
-
- if (future == "yes") {
- if (!(("extension", "future") in propListValues)) return;
- } else {
- if (("extension", "future") in propListValues) return;
- }
-
- # If not C, who cares?
- # if (!(("languages","c") in propListValues)) return
-
- # Is the name distinguishable in its first MaxIDLen characters?
-
- TruncatedName = substr(functionName, 1, MaxIDLen - length(proc_prefix));
- if (TruncatedName in OriginalNames) {
- if (functionName != OriginalNames[TruncatedName]) {
- ErrorMessage = sprintf("the name %s is indistinguishable from %s",
- functionName, OriginalNames[TruncatedName]);
- Warning(ErrorMessage);
- }
- } else {
- OriginalNames[TruncatedName] = functionName;
- }
-
- # OUTPUT should be defined on the command line that invokes libspec
- #
- # Print the function declaration
- #
- printf "%s%s\n", proc_prefix, functionName;
-
- # handle alias
- aliasName = "";
- if ("alias" in propList) {
- aliasName = propList["alias"];
- sub( ",", "", aliasName);
- printf "%s%s\n", proc_prefix, aliasName;
- }
- if ("aliasprivate" in propList) {
- aliasName = propList["aliasprivate"];
- sub( ",", "", aliasName);
- printf "%s%s\n", proc_prefix, aliasName;
- }
-}
-
-function finalize()
-{
-}
-
-function Warning(message) {
- Stderr = "cat 1>&2";
- print "ERROR: " message | Stderr;
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/include/gluos.h b/xc/extras/ogl-sample/main/gfx/lib/glu/include/gluos.h
deleted file mode 100755
index a8025a9e9..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/include/gluos.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-** gluos.h - operating system dependencies for GLU
-**
-*/
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/include/gluos.h,v 1.3 2001/04/06 17:44:57 dawes Exp $ */
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-
-#define WIN32_LEAN_AND_MEAN
-#define NOGDI
-#define NOIME
-#include <windows.h>
-
-/* Disable warnings */
-#pragma warning(disable : 4101)
-#pragma warning(disable : 4244)
-#pragma warning(disable : 4761)
-
-#else
-
-/* Disable Microsoft-specific keywords */
-#define GLAPIENTRY
-#define WINGDIAPI
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/GNUmakefile b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/GNUmakefile
deleted file mode 100755
index 3e4487903..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/GNUmakefile
+++ /dev/null
@@ -1,54 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/Attic/GNUmakefile,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-
-COMMONPREF = standard
-include $(ROOT)/usr/include/make/commondefs
-
-SUBDIRS = \
- internals \
- interface \
- nurbtess \
- $(NULL)
-
-default $(ALLTARGS): $(_FORCE)
- $(SUBDIRS_MAKERULE)
-
-distoss:
- $(MAKE) $(COMMONPREF)$@
- $(SUBDIRS_MAKERULE)
-
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/Imakefile b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/Imakefile
deleted file mode 100755
index aa5f72dfe..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/Imakefile
+++ /dev/null
@@ -1,43 +0,0 @@
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-#define IHaveSubdirs
-#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
-
-SUBDIRS = \
- internals \
- interface \
- nurbtess
-
-MakeSubdirs($(SUBDIRS))
-DependSubdirs($(SUBDIRS))
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/GNUmakefile b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/GNUmakefile
deleted file mode 100755
index 288f3c6dc..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/GNUmakefile
+++ /dev/null
@@ -1,75 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Attic/GNUmakefile,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-
-include $(ROOT)/usr/include/make/commondefs
-
-TARGET = libinterface.a
-
-TARGETS = $(TARGET)
-
-LCXXDEFS = -DNDEBUG -DLIBRARYBUILD
-LCXXINCS = -I. -I../../include -I../internals -I../nurbtess
-
-HFILES = \
- glcurveval.h \
- glrenderer.h \
- glsurfeval.h \
- bezierPatch.h \
- bezierEval.h \
- bezierPatchMesh.h \
- $(NULL)
-
-CCFILES = \
- glcurveval.cc \
- glinterface.cc \
- glrenderer.cc \
- glsurfeval.cc \
- insurfeval.cc \
- bezierPatch.cc \
- bezierEval.cc \
- bezierPatchMesh.cc \
- incurveeval.cc \
- $(NULL)
-
-default libs libs_install install: $(TARGET)
-
-headers headers_install apps:
-
-$(TARGET): $(OBJECTS)
- $(AR) crl $@ $(OBJECTS);
-
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Imakefile b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Imakefile
deleted file mode 100755
index edb8cd83b..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Imakefile
+++ /dev/null
@@ -1,63 +0,0 @@
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-#include <Library.tmpl>
-
-OBJS = \
- bezierEval.o \
- bezierPatch.o \
- bezierPatchMesh.o \
- glcurveval.o \
- glinterface.o \
- glrenderer.o \
- glsurfeval.o \
- incurveeval.o \
- insurfeval.o
-
-INCLUDES = \
- -I../internals \
- -I../nurbtess \
- -I../../include \
- -I$(TOP)/include \
- -I$(TOP)/include/GL
-
-DEFINES = \
- -DLIBRARYBUILD \
- -DNDEBUG
-
-NormalCplusplusObjectRule()
-
-NormalLibraryTarget(interface, $(OBJS))
-
-DependTarget()
-CleanTarget()
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierEval.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierEval.cc
deleted file mode 100755
index 98a371199..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierEval.cc
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Attic/bezierEval.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <assert.h>
-#include <math.h>
-#include "bezierEval.h"
-
-#define TOLERANCE 0.0001
-
-#ifndef MAX_ORDER
-#define MAX_ORDER 16
-#endif
-
-#ifndef MAX_DIMENSION
-#define MAX_DIMENSION 4
-#endif
-
-static void normalize(float vec[3]);
-static void crossProduct(float x[3], float y[3], float ret[3]);
-static void bezierCurveEvalfast(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retpoint[]);
-
-static float binomialCoefficients[8][8] = {
- {1,0,0,0,0,0,0,0},
- {1,1,0,0,0,0,0,0},
- {1,2,1,0,0,0,0,0},
- {1,3,3,1,0,0,0,0},
- {1,4,6,4,1,0,0,0},
- {1,5,10,10,5,1,0,0},
- {1,6,15,20,15,6,1,0},
- {1,7,21,35,35,21,7,1}
-};
-
-void bezierCurveEval(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retpoint[])
-{
- float uprime = (u-u0)/(u1-u0);
- float *ctlptr = ctlpoints;
- float oneMinusX = 1.0-uprime;
- float XPower = 1.0;
-
- int i,k;
- for(k=0; k<dimension; k++)
- retpoint[k] = (*(ctlptr + k));
-
- for(i=1; i<order; i++){
- ctlptr += stride;
- XPower *= uprime;
- for(k=0; k<dimension; k++) {
- retpoint[k] = retpoint[k]*oneMinusX + ctlptr[k]* binomialCoefficients[order-1][i] * XPower;
- }
- }
-}
-
-
-
-/*order = degree +1 >=1.
- */
-void bezierCurveEvalfast(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retpoint[])
-{
- float uprime = (u-u0)/(u1-u0);
- float buf[MAX_ORDER][MAX_ORDER][MAX_DIMENSION];
- float* ctlptr = ctlpoints;
- int r, i,j;
- for(i=0; i<order; i++) {
- for(j=0; j<dimension; j++)
- buf[0][i][j] = ctlptr[j];
- ctlptr += stride;
- }
- for(r=1; r<order; r++){
- for(i=0; i<order-r; i++) {
- for(j=0; j<dimension; j++)
- buf[r][i][j] = (1-uprime)*buf[r-1][i][j] + uprime*buf[r-1][i+1][j];
- }
- }
-
- for(j=0; j<dimension; j++)
- retpoint[j] = buf[order-1][0][j];
-}
-
-
-
-/*order = degree +1 >=1.
- */
-void bezierCurveEvalDer(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retDer[])
-{
- int i,k;
- float width = u1-u0;
- float *ctlptr = ctlpoints;
-
- float buf[MAX_ORDER][MAX_DIMENSION];
- if(order == 1){
- for(k=0; k<dimension; k++)
- retDer[k]=0;
- }
- for(i=0; i<order-1; i++){
- for(k=0; k<dimension; k++) {
- buf[i][k] = (ctlptr[stride+k] - ctlptr[k])*(order-1)/width;
- }
- ctlptr += stride;
- }
-
- bezierCurveEval(u0, u1, order-1, (float*) buf, MAX_DIMENSION, dimension, u, retDer);
-}
-
-void bezierCurveEvalDerGen(int der, float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retDer[])
-{
- int i,k,r;
- float *ctlptr = ctlpoints;
- float width=u1-u0;
- float buf[MAX_ORDER][MAX_ORDER][MAX_DIMENSION];
- if(der<0) der=0;
- for(i=0; i<order; i++){
- for(k=0; k<dimension; k++){
- buf[0][i][k] = ctlptr[k];
- }
- ctlptr += stride;
- }
-
-
- for(r=1; r<=der; r++){
- for(i=0; i<order-r; i++){
- for(k=0; k<dimension; k++){
- buf[r][i][k] = (buf[r-1][i+1][k] - buf[r-1][i][k])*(order-r)/width;
- }
- }
- }
-
- bezierCurveEval(u0, u1, order-der, (float *) (buf[der]), MAX_DIMENSION, dimension, u, retDer);
-}
-
-/*the Bezier bivarite polynomial is:
- * sum[i:0,uorder-1][j:0,vorder-1] { ctlpoints[i*ustride+j*vstride] * B(i)*B(j)
- * where B(i) and B(j) are basis functions
- */
-void bezierSurfEvalDerGen(int uder, int vder, float u0, float u1, int uorder, float v0, float v1, int vorder, int dimension, float *ctlpoints, int ustride, int vstride, float u, float v, float ret[])
-{
- int i,j,k;
- float newPoints[MAX_ORDER][MAX_DIMENSION];
-
- for(i=0; i<uorder; i++){
-
- bezierCurveEvalDerGen(vder, v0, v1, vorder, ctlpoints+ustride*i, vstride, dimension, v, newPoints[i]);
-
- }
-
- bezierCurveEvalDerGen(uder, u0, u1, uorder, (float *) newPoints, MAX_DIMENSION, dimension, u, ret);
-}
-
-
-/*division by w is performed*/
-void bezierSurfEval(float u0, float u1, int uorder, float v0, float v1, int vorder, int dimension, float *ctlpoints, int ustride, int vstride, float u, float v, float ret[])
-{
- bezierSurfEvalDerGen(0, 0, u0, u1, uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u, v, ret);
- if(dimension == 4) /*homogeneous*/{
- ret[0] /= ret[3];
- ret[1] /= ret[3];
- ret[2] /= ret[3];
- }
-}
-
-void bezierSurfEvalNormal(float u0, float u1, int uorder, float v0, float v1, int vorder, int dimension, float *ctlpoints, int ustride, int vstride, float u, float v, float retNormal[])
-{
- float partialU[4];
- float partialV[4];
- assert(dimension>=3 && dimension <=4);
- bezierSurfEvalDerGen(1,0, u0, u1, uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u, v, partialU);
- bezierSurfEvalDerGen(0,1, u0, u1, uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u, v, partialV);
-
- if(dimension == 3){/*inhomogeneous*/
- crossProduct(partialU, partialV, retNormal);
-
- normalize(retNormal);
-
- return;
- }
- else { /*homogeneous*/
- float val[4]; /*the point coordinates (without derivative)*/
- float newPartialU[MAX_DIMENSION];
- float newPartialV[MAX_DIMENSION];
- int i;
- bezierSurfEvalDerGen(0,0, u0, u1, uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u, v, val);
-
- for(i=0; i<=2; i++){
- newPartialU[i] = partialU[i] * val[3] - val[i] * partialU[3];
- newPartialV[i] = partialV[i] * val[3] - val[i] * partialV[3];
- }
- crossProduct(newPartialU, newPartialV, retNormal);
- normalize(retNormal);
- }
-}
-
-/*if size is 0, then nothing is done*/
-static void normalize(float vec[3])
-{
- float size = sqrt(vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2]);
-
- if(size < TOLERANCE)
- {
-#ifdef DEBUG
- fprintf(stderr, "Warning: in oglBSpline.c normal is 0\n");
-#endif
- return;
- }
- else {
- vec[0] = vec[0]/size;
- vec[1] = vec[1]/size;
- vec[2] = vec[2]/size;
- }
-}
-
-
-static void crossProduct(float x[3], float y[3], float ret[3])
-{
- ret[0] = x[1]*y[2] - y[1]*x[2];
- ret[1] = x[2]*y[0] - y[2]*x[0];
- ret[2] = x[0]*y[1] - y[0]*x[1];
-
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierEval.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierEval.h
deleted file mode 100755
index 325123c54..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierEval.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Attic/bezierEval.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _BEZIEREVAL_H
-#define _BEZIEREVAL_H
-
-void bezierCurveEval(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retpoint[]);
-void bezierCurveEvalDer(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retDer[]);
-void bezierCurveEvalDerGen(int der, float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retDer[]);
-
-
-void bezierSurfEvalDerGen(int uder, int vder, float u0, float u1, int uorder, float v0, float v1, int vorder, int dimension, float *ctlpoints, int ustride, int vstride, float u, float v, float ret[]);
-
-void bezierSurfEval(float u0, float u1, int uorder, float v0, float v1, int vorder, int dimension, float *ctlpoints, int ustride, int vstride, float u, float v, float ret[]);
-
-void bezierSurfEvalNormal(float u0, float u1, int uorder, float v0, float v1, int vorder, int dimension, float *ctlpoints, int ustride, int vstride, float u, float v, float retNormal[]);
-
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierPatch.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierPatch.cc
deleted file mode 100755
index 73d261aaf..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierPatch.cc
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Attic/bezierPatch.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include "gluos.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <assert.h>
-#include <GL/glu.h> /*for drawing bzier patch*/
-#include "bezierPatch.h"
-#include "bezierEval.h"
-
-/*
- *allocate an instance of bezierPatch. The control points are unknown. But
- *the space of this array is allocated with size of
- * uorder*vorder*dimension
- *
- */
-bezierPatch* bezierPatchMake(float umin, float vmin, float umax, float vmax, int uorder, int vorder, int dimension)
-{
- bezierPatch* ret = (bezierPatch*) malloc(sizeof(bezierPatch));
- assert(ret);
- ret->umin = umin;
- ret->vmin = vmin;
- ret->umax = umax;
- ret->vmax = vmax;
- ret->uorder = uorder;
- ret->vorder = vorder;
- ret->dimension = dimension;
- ret->ctlpoints = (float*) malloc(sizeof(float) * dimension * uorder * vorder);
- assert(ret->ctlpoints);
-
- ret->next = NULL;
-
- return ret;
-}
-
-bezierPatch* bezierPatchMake2(float umin, float vmin, float umax, float vmax, int uorder, int vorder, int dimension, int ustride, int vstride, float* ctlpoints)
-{
- bezierPatch* ret = (bezierPatch*) malloc(sizeof(bezierPatch));
- assert(ret);
- ret->umin = umin;
- ret->vmin = vmin;
- ret->umax = umax;
- ret->vmax = vmax;
- ret->uorder = uorder;
- ret->vorder = vorder;
- ret->dimension = dimension;
- ret->ctlpoints = (float*) malloc(sizeof(float) * dimension * uorder * vorder);
- assert(ret->ctlpoints);
-
- /*copy the control points there*/
- int the_ustride = vorder * dimension;
- int the_vstride = dimension;
- for(int i=0; i<uorder; i++)
- for(int j=0; j<vorder; j++)
- for(int k=0; k<dimension; k++)
- ret->ctlpoints[i * the_ustride + j*the_vstride+k] = ctlpoints[i*ustride+j*vstride+k];
-
- ret->next = NULL;
-
- return ret;
-}
-
-/*
- *deallocate the space as allocated by Make
- */
-void bezierPatchDelete(bezierPatch *b)
-{
- free(b->ctlpoints);
- free(b);
-}
-
-/*delete the whole linked list
- */
-void bezierPatchDeleteList(bezierPatch *b)
-{
- bezierPatch *temp;
- for(temp = b; temp != NULL; temp = temp->next)
- bezierPatchDelete(temp);
-}
-
-bezierPatch* bezierPatchInsert(bezierPatch *list, bezierPatch *b)
-{
- b->next = list;
- return b;
-}
-
-/*print the data stored in this patch*/
-void bezierPatchPrint(bezierPatch *b)
-{
- printf("bezierPatch:\n");
- printf("umin,umax=(%f,%f), (vmin, vmax)=(%f,%f)\n", b->umin, b->umax, b->vmin, b->vmax);
- printf("uorder=%i, vorder=%i\n", b->uorder, b->vorder);
- printf("idmension = %i\n", b->dimension);
-}
-
-/*print the whole list*/
-void bezierPatchPrintList(bezierPatch *list)
-{
- bezierPatch* temp;
- for(temp=list; temp != NULL; temp = temp->next)
- bezierPatchPrint(temp);
-}
-
-void bezierPatchEval(bezierPatch *b, float u, float v, float ret[])
-{
- if( u >= b->umin && u<= b->umax
- && v >= b->vmin && v<= b->vmax)
- {
-
- bezierSurfEval(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret);
-
- }
- else if(b->next != NULL)
- bezierPatchEval(b->next, u,v, ret);
- else
- bezierSurfEval(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret);
-}
-
-/*the returned normal is normlized
- */
-void bezierPatchEvalNormal(bezierPatch *b, float u, float v, float ret[])
-{
- bezierSurfEvalNormal(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret);
-
- if( u >= b->umin && u<= b->umax
- && v >= b->vmin && v<= b->vmax)
- {
- bezierSurfEvalNormal(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret);
- }
- else if(b->next != NULL)
- bezierPatchEvalNormal(b->next, u,v, ret);
- else
- bezierSurfEvalNormal(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret);
-
-}
-
-void bezierPatchDraw(bezierPatch *bpatch, int u_reso, int v_reso)
-{
- if(bpatch->dimension == 3)
- glMap2f(GL_MAP2_VERTEX_3, bpatch->umin, bpatch->umax, 3*bpatch->vorder, bpatch->uorder, bpatch->vmin, bpatch->vmax,3, bpatch->vorder, (GLfloat*) bpatch->ctlpoints);
- else
- glMap2f(GL_MAP2_VERTEX_4, bpatch->umin, bpatch->umax, 4*bpatch->vorder, bpatch->uorder, bpatch->vmin, bpatch->vmax,3, bpatch->vorder, (GLfloat*) bpatch->ctlpoints);
-
- glMapGrid2f(u_reso, bpatch->umin, bpatch->umax,
- v_reso, bpatch->vmin, bpatch->vmax);
- glEvalMesh2(GL_LINE, 0, u_reso, 0, v_reso);
-}
-
-void bezierPatchListDraw(bezierPatch *list, int u_reso, int v_reso)
-{
- bezierPatch *temp;
-glEnable(GL_LIGHTING);
-glEnable(GL_LIGHT0);
-glEnable(GL_MAP2_VERTEX_3);
-glEnable(GL_AUTO_NORMAL);
-glEnable(GL_NORMALIZE);
-glColor3f(1,0,0);
-#ifdef DEBUG
-printf("mapmap\n");
-#endif
-
-
- for(temp = list; temp != NULL; temp = temp->next)
- bezierPatchDraw(temp, u_reso, v_reso);
-}
-
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierPatch.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierPatch.h
deleted file mode 100755
index 44de66107..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierPatch.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Attic/bezierPatch.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _BEZIERPATCH_H
-#define _BEZIERPATCH_H
-
-typedef struct bezierPatch{
- float umin, vmin, umax, vmax;
- int uorder; /*order= degree + 1*/
- int vorder;
-
- /*
- *the control points are stored in a one dimensional array.
- *the surface is defined as:
- * s(u,v) = sum_{i,j} P(i,j) * B_i(u) * B_j(v).
- *where P(i,j) are the control points, B_i(.) are Bezier
- *basis functions.
- *Each control point can have dimension 3 or 4: (x,y,z,w).
- *The components of P(i,j) are stored in a one dimensional
- *array:
- * ctlpoints[]
- *in the order of:
- * P[0,0], P[0,1], ..., P[0,vorder-1],
- * P[1,0], P[1,1], ..., P[1,vorder-1],
- * ...
- * P[uorder-1,0], P[uorder-1,1], ..., P[uorder-1,vorder-1].
- */
- int dimension;
- float* ctlpoints;
-
- /*
- *in case we have to manage multiple bezierPatches.
- */
- struct bezierPatch *next;
-
-} bezierPatch;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-bezierPatch* bezierPatchMake(float umin, float vmin, float umax, float vmax, int urder, int vorder, int dimension);
-
-bezierPatch* bezierPatchMake2(float umin, float vmin, float umax, float vmax, int urder, int vorder, int dimension, int ustride, int vstride, float *ctlpoints);
-
-
-bezierPatch* bezierPatchInsert(bezierPatch *list, bezierPatch *b);
-
-void bezierPatchDelete(bezierPatch *b);
-
-void bezierPatchDeleteList(bezierPatch *b);
-
-void bezierPatchPrint(bezierPatch *b);
-
-void bezierPatchPrintList(bezierPatch *list);
-
-void bezierPatchEval(bezierPatch *b, float u, float v, float ret[]);
-
-void bezierPatchEvalNormal(bezierPatch *b, float u, float v, float retNormal[]);
-
-void bezierPatchEval(bezierPatch *b, float u, float v, float ret[]);
-
-void bezierPatchEvalNormal(bezierPatch *b, float u, float v, float ret[]);
-
-
-void bezierPatchDraw(bezierPatch *bpatch, int u_reso, int v_reso);
-
-void bezierPatchListDraw(bezierPatch *list, int u_reso, int v_reso);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierPatchMesh.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierPatchMesh.cc
deleted file mode 100755
index d035d4038..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierPatchMesh.cc
+++ /dev/null
@@ -1,613 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Attic/bezierPatchMesh.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include "gluos.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <assert.h>
-#include <GL/gl.h>
-#include "bezierEval.h"
-#include "bezierPatchMesh.h"
-
-static int isDegenerate(float A[2], float B[2], float C[2]);
-
-void drawStrips(float *vertex_array, float *normal_array, int *length_array, GLenum *type_array, int num_strips)
-{
- int i,j,k;
- k=0;
- /*k is the index of the first component of the current vertex*/
- for(i=0; i<num_strips; i++)
- {
- glBegin(type_array[i]);
- for(j=0; j<length_array[i]; j++)
- {
- glNormal3fv(normal_array+k);
- glVertex3fv(vertex_array+k);
- k += 3;
- }
- glEnd();
- }
-}
-
-void bezierPatchMeshListDelDeg(bezierPatchMesh* list)
-{
- bezierPatchMesh* temp;
- for(temp=list; temp != NULL; temp = temp->next)
- {
- bezierPatchMeshDelDeg(temp);
- }
-}
-
-void bezierPatchMeshListDelete(bezierPatchMesh *list)
-{
- if(list == NULL) return;
- bezierPatchMeshListDelete(list->next);
- bezierPatchMeshDelete(list);
-}
-
-
-
-
-bezierPatchMesh* bezierPatchMeshListReverse(bezierPatchMesh* list)
-{
- bezierPatchMesh* ret=NULL;
- bezierPatchMesh* temp;
- bezierPatchMesh* nextone;
- for(temp = list; temp != NULL; temp = nextone)
- {
- nextone = temp->next;
- ret=bezierPatchMeshListInsert(ret, temp);
- }
- return ret;
-}
-
-/*maptype is either GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4
- */
-bezierPatchMesh *bezierPatchMeshMake(int maptype, float umin, float umax, int ustride, int uorder, float vmin, float vmax, int vstride, int vorder, float *ctlpoints, int size_UVarray, int size_length_array)
-{
- int i,j,k;
- int dimension;
- int the_ustride;
- int the_vstride;
-
- bezierPatchMesh *ret = (bezierPatchMesh*) malloc(sizeof(bezierPatchMesh));
- assert(ret);
-
- ret->bpatch = NULL;
- ret->bpatch_normal = NULL;
- ret->bpatch_color = NULL;
- ret->bpatch_texcoord = NULL;
-
- if(maptype == GL_MAP2_VERTEX_3) dimension = 3;
- else if (maptype==GL_MAP2_VERTEX_4) dimension = 4;
- else {
- fprintf(stderr, "error in inMap2f, maptype=%i is wrong, maptype,map is invalid\n", maptype);
- return NULL;
- }
-
- ret->bpatch = bezierPatchMake(umin, vmin, umax, vmax, uorder, vorder, dimension);
- /*copy the control points there*/
- the_ustride = vorder * dimension;
- the_vstride = dimension;
- for(i=0; i<uorder; i++)
- for(j=0; j<vorder; j++)
- for(k=0; k<dimension; k++)
- ret->bpatch->ctlpoints[i * the_ustride + j*the_vstride+k] = ctlpoints[i*ustride+j*vstride+k];
-
-
- ret->size_UVarray = size_UVarray;
- ret->size_length_array = size_length_array;
- ret->UVarray = (float*) malloc(sizeof(float) * size_UVarray);
- assert(ret->UVarray);
- ret->length_array = (int *)malloc(sizeof(int) * size_length_array);
- assert(ret->length_array);
- ret->type_array = (GLenum *)malloc(sizeof(GLenum) * size_length_array);
- assert(ret->type_array);
-
- ret->index_UVarray = 0;
- ret->index_length_array = 0;
-
- ret->vertex_array = NULL;
- ret->normal_array = NULL;
- ret->color_array = NULL;
- ret->texcoord_array = NULL;
-
- ret->next = NULL;
- return ret;
-}
-
-bezierPatchMesh *bezierPatchMeshMake2(int size_UVarray, int size_length_array)
-{
- bezierPatchMesh *ret = (bezierPatchMesh*) malloc(sizeof(bezierPatchMesh));
- assert(ret);
-
- ret->bpatch = NULL;
- ret->bpatch_normal = NULL;
- ret->bpatch_color = NULL;
- ret->bpatch_texcoord = NULL;
-
- ret->size_UVarray = size_UVarray;
- ret->size_length_array = size_length_array;
- ret->UVarray = (float*) malloc(sizeof(float) * size_UVarray);
- assert(ret->UVarray);
- ret->length_array = (int *)malloc(sizeof(int) * size_length_array);
- assert(ret->length_array);
- ret->type_array = (GLenum *)malloc(sizeof(GLenum) * size_length_array);
- assert(ret->type_array);
-
- ret->index_UVarray = 0;
- ret->index_length_array = 0;
-
- ret->vertex_array = NULL;
- ret->normal_array = NULL;
- ret->color_array = NULL;
- ret->texcoord_array = NULL;
-
- ret->next = NULL;
- return ret;
-}
-
-void bezierPatchMeshPutPatch(bezierPatchMesh *bpm, int maptype, float umin, float umax, int ustride, int uorder, float vmin, float vmax, int vstride, int vorder, float *ctlpoints)
-{
- switch(maptype){
- case GL_MAP2_VERTEX_3:
- bpm->bpatch = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 3, ustride, vstride, ctlpoints);
- break;
- case GL_MAP2_VERTEX_4:
- bpm->bpatch = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 4,ustride, vstride, ctlpoints );
- break;
- case GL_MAP2_NORMAL:
- bpm->bpatch_normal = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 3, ustride, vstride, ctlpoints);
- break;
- case GL_MAP2_INDEX:
- bpm->bpatch_color = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 1, ustride, vstride, ctlpoints);
- break;
- case GL_MAP2_COLOR_4:
- bpm->bpatch_color = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 4, ustride, vstride, ctlpoints);
- break;
- case GL_MAP2_TEXTURE_COORD_1:
- bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 1, ustride, vstride, ctlpoints);
- break;
- case GL_MAP2_TEXTURE_COORD_2:
- bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 2, ustride, vstride, ctlpoints);
- break;
- case GL_MAP2_TEXTURE_COORD_3:
- bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 3, ustride, vstride, ctlpoints);
- break;
- case GL_MAP2_TEXTURE_COORD_4:
- bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 4, ustride, vstride, ctlpoints);
- break;
- default:
- fprintf(stderr, "error in bezierPatchMeshPutPatch, maptype=%i is wrong, maptype,map is invalid\n", maptype);
- }
-}
-
-
-/*delete everything including the arrays. So if you want to output the
- *pointers of the arrays, you should not use this function to deallocate space.
- *you should dealocate manually
- */
-void bezierPatchMeshDelete(bezierPatchMesh *bpm)
-{
- if(bpm->bpatch != NULL)
- bezierPatchDelete(bpm->bpatch);
- if(bpm->bpatch_normal != NULL)
- bezierPatchDelete(bpm->bpatch_normal);
- if(bpm->bpatch_color != NULL)
- bezierPatchDelete(bpm->bpatch_color);
- if(bpm->bpatch_texcoord != NULL)
- bezierPatchDelete(bpm->bpatch_texcoord);
-
- free(bpm->UVarray);
- free(bpm->length_array);
- free(bpm->vertex_array);
- free(bpm->normal_array);
- free(bpm->type_array);
- free(bpm);
-}
-
-/*begin a strip
- *type is the primitive type:
- */
-void bezierPatchMeshBeginStrip(bezierPatchMesh *bpm, GLenum type)
-{
- bpm->counter = 0;
- bpm->type = type;
-}
-
-/*signal the end of the current strip*/
-void bezierPatchMeshEndStrip(bezierPatchMesh *bpm)
-{
- int i;
-
- /*if there are no vertices in this strip, then nothing needs to be done*/
- if(bpm->counter == 0) return;
-
- /*if the length_array is full, it should be expanded*/
- if(bpm->index_length_array >= bpm->size_length_array)
- {
- int *temp = (int*) malloc(sizeof(int) * (bpm->size_length_array*2 + 1));
- assert(temp);
- GLenum *temp_type = (GLenum*) malloc(sizeof(GLenum) * (bpm->size_length_array*2 + 1));
- assert(temp_type);
- /*update the size*/
- bpm->size_length_array = bpm->size_length_array*2 + 1;
-
- /*copy*/
- for(i=0; i<bpm->index_length_array; i++)
- {
- temp[i] = bpm->length_array[i];
- temp_type[i] = bpm->type_array[i];
- }
-
- /*deallocate old array*/
- free(bpm->length_array);
- free(bpm->type_array);
-
- /*point to the new array which is twice as bigger*/
- bpm->length_array = temp;
- bpm->type_array = temp_type;
- }
- bpm->type_array[bpm->index_length_array] = bpm->type;
- bpm->length_array[bpm->index_length_array++] = bpm->counter;
-
-}
-
-/*insert (u,v) */
-void bezierPatchMeshInsertUV(bezierPatchMesh *bpm, float u, float v)
-{
- int i;
- /*if the UVarray is full, it should be expanded*/
- if(bpm->index_UVarray+1 >= bpm->size_UVarray)
- {
- float *temp = (float*) malloc(sizeof(float) * (bpm->size_UVarray * 2 + 2));
- assert(temp);
-
- /*update the size*/
- bpm->size_UVarray = bpm->size_UVarray*2 + 2;
-
- /*copy*/
- for(i=0; i<bpm->index_UVarray; i++)
- {
- temp[i] = bpm->UVarray[i];
- }
-
- /*deallocate old array*/
- free(bpm->UVarray);
-
- /*pointing to the new arrays*/
- bpm->UVarray = temp;
- }
- /*insert the new UV*/
- bpm->UVarray[bpm->index_UVarray] = u;
- bpm->index_UVarray++;
- bpm->UVarray[bpm->index_UVarray] = v;
- bpm->index_UVarray++;
-
- /*update counter: one more vertex*/
- bpm->counter++;
-
-
-}
-
-void bezierPatchMeshPrint(bezierPatchMesh *bpm)
-{
- int i;
- printf("the bezier patch is\n");
- bezierPatchPrint(bpm->bpatch);
- printf("index_length_array= %i\n", bpm->index_length_array);
- printf("size_length_array =%i\n", bpm->size_length_array);
- printf("index_UVarray =%i\n", bpm->index_UVarray);
- printf("size_UVarray =%i\n", bpm->size_UVarray);
- printf("UVarray is\n");
- for(i=0; i<bpm->index_UVarray; i++)
- printf("%f ", bpm->UVarray[i]);
-
- printf("length_array is\n");
- for(i=0; i<bpm->index_length_array; i++)
- printf("%i ", bpm->length_array[i]);
- printf("\n");
-
-}
-
-/*insert a new patch in front of the current linked list and return the new list*/
-bezierPatchMesh* bezierPatchMeshListInsert(bezierPatchMesh* list, bezierPatchMesh* bpm)
-{
- bpm->next=list;
- return bpm;
-}
-
-/*print all the patches*/
-void bezierPatchMeshListPrint(bezierPatchMesh* list)
-{
- bezierPatchMesh *temp;
- for(temp = list; temp != NULL; temp = temp->next)
- {
- bezierPatchMeshPrint(temp);
- }
-}
-
-int bezierPatchMeshListTotalStrips(bezierPatchMesh* list)
-{
- int sum=0;
- bezierPatchMesh *temp;
- for(temp=list; temp != NULL; temp = temp->next)
- {
- sum += temp->index_length_array;
- }
- return sum;
-}
-
-int bezierPatchMeshListTotalVert(bezierPatchMesh* list)
-{
- int sum=0;
- bezierPatchMesh *temp;
- for(temp=list; temp != NULL; temp = temp->next)
- {
- sum += temp->index_UVarray;
- }
- return sum/2;
-}
-
-int bezierPatchMeshListNumTriangles(bezierPatchMesh* list)
-{
- int sum=0;
- bezierPatchMesh* temp;
- for(temp=list; temp != NULL; temp = temp->next)
- {
- sum += bezierPatchMeshNumTriangles(temp);
- }
- return sum;
-}
-
-int bezierPatchMeshNumTriangles(bezierPatchMesh* bpm)
-{
- int i;
- int sum=0;
- for(i=0; i<bpm->index_length_array; i++)
- {
- switch(bpm->type_array[i])
- {
- case GL_TRIANGLES:
- sum += bpm->length_array[i]/3;
- break;
- case GL_TRIANGLE_FAN:
- if(bpm->length_array[i] > 2)
- sum += bpm->length_array[i]-2;
- break;
- case GL_TRIANGLE_STRIP:
- if(bpm->length_array[i] > 2)
- sum += bpm->length_array[i]-2;
- break;
- case GL_QUAD_STRIP:
- if(bpm->length_array[i]>2)
- sum += (bpm->length_array[i]-2);
- break;
- default:
- fprintf(stderr,"error in bezierPatchMeshListNumTriangles, type invalid\n");
- }
- }
- return sum;
-}
-
-/*delete degenerate triangles*/
-void bezierPatchMeshDelDeg(bezierPatchMesh* bpm)
-{
- if(bpm == NULL) return;
- int i,j,k;
- int *new_length_array;
- GLenum *new_type_array;
- int index_new_length_array;
- float *new_UVarray;
- int index_new_UVarray;
-
- new_length_array = (int*)malloc(sizeof(int) * bpm->index_length_array);
- assert(new_length_array);
- new_type_array = (GLenum*)malloc(sizeof(GLenum) * bpm->index_length_array);
- assert(new_length_array);
- new_UVarray = (float*) malloc(sizeof(float) * bpm->index_UVarray);
- assert(new_UVarray);
-
- index_new_length_array = 0;
- index_new_UVarray=0;
- k=0;
- for(i=0; i<bpm->index_length_array; i++){
-
- /*(if not degenerate, we have to copy*/
- if( (bpm->length_array[i] != 3) || (!isDegenerate(bpm->UVarray+k, bpm->UVarray+k+2, bpm->UVarray+k+4)))
- {
- for(j=0; j<2* bpm->length_array[i]; j++)
- new_UVarray[index_new_UVarray++] = bpm->UVarray[k++];
-
- new_length_array[index_new_length_array] = bpm->length_array[i];
- new_type_array[index_new_length_array] = bpm->type_array[i];
- index_new_length_array++;
- }
- else
- {
- k += 6;
- }
- }
- free(bpm->UVarray);
- free(bpm->length_array);
- free(bpm->type_array);
- bpm->UVarray=new_UVarray;
- bpm->length_array=new_length_array;
- bpm->type_array=new_type_array;
- bpm->index_UVarray = index_new_UVarray;
- bpm->index_length_array = index_new_length_array;
-
-}
-
-/*(u,v) to XYZ
- *the xyz and normals are stored in vertex_array,
- *and normal_array. the spaces of both are allocated here
- */
-void bezierPatchMeshEval(bezierPatchMesh* bpm)
-{
- int i,j,k,l;
- float u,v;
- float u0 = bpm->bpatch->umin;
- float u1 = bpm->bpatch->umax;
- int uorder = bpm->bpatch->uorder;
- float v0 = bpm->bpatch->vmin;
- float v1 = bpm->bpatch->vmax;
- int vorder = bpm->bpatch->vorder;
- int dimension = bpm->bpatch->dimension;
- int ustride = dimension * vorder;
- int vstride = dimension;
- float *ctlpoints = bpm->bpatch->ctlpoints;
-
- bpm->vertex_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3);
- assert(bpm->vertex_array);
- bpm->normal_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3);
- assert(bpm->normal_array);
-
- k=0;
- l=0;
- for(i=0; i<bpm->index_length_array; i++)
- {
- for(j=0; j<bpm->length_array[i]; j++)
- {
- u = bpm->UVarray[k];
- v = bpm->UVarray[k+1];
- bezierSurfEval(u0,u1,uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u,v, bpm->vertex_array+l);
- bezierSurfEvalNormal(u0,u1,uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u,v, bpm->normal_array+l);
- k += 2;
- l += 3;
- }
- }
-}
-
-void bezierPatchMeshListEval(bezierPatchMesh* list)
-{
- bezierPatchMesh* temp;
- for(temp = list; temp != NULL; temp = temp->next)
- {
- bezierPatchMeshEval(temp);
- }
-}
-
-void bezierPatchMeshDraw(bezierPatchMesh* bpm)
-{
- int i,j,k;
- k=0;
- /*k is the index of the first component of the current vertex*/
- for(i=0; i<bpm->index_length_array; i++)
- {
- glBegin(bpm->type_array[i]);
- for(j=0; j<bpm->length_array[i]; j++)
- {
- glNormal3fv(bpm->normal_array+k);
- glVertex3fv(bpm->vertex_array+k);
- k+= 3;
- }
- glEnd();
- }
-}
-
-void bezierPatchMeshListDraw(bezierPatchMesh* list)
-{
- bezierPatchMesh* temp;
- for(temp = list; temp != NULL; temp = temp->next)
- {
- bezierPatchMeshDraw(temp);
- }
-}
-
-void bezierPatchMeshListCollect(bezierPatchMesh* list, float **vertex_array, float **normal_array, int **length_array, GLenum **type_array, int *num_strips)
-{
- int i,j,k,l;
- bezierPatchMesh *temp;
- int total_num_vertices = bezierPatchMeshListTotalVert(list);
- (*vertex_array) = (float *) malloc(sizeof(float) * total_num_vertices*3);
- assert(*vertex_array);
- (*normal_array) = (float *) malloc(sizeof(float) * total_num_vertices*3);
- assert(*normal_array);
-
- *num_strips = bezierPatchMeshListTotalStrips(list);
-
- *length_array = (int*) malloc(sizeof(int) * (*num_strips));
- assert(*length_array);
-
- *type_array = (GLenum*) malloc(sizeof(GLenum) * (*num_strips));
- assert(*type_array);
-
- k=0;
- l=0;
- for(temp = list; temp != NULL; temp = temp->next)
- {
- int x=0;
- for(i=0; i<temp->index_length_array; i++)
- {
- for(j=0; j<temp->length_array[i]; j++)
- {
- (*vertex_array)[k] = temp->vertex_array[x];
- (*vertex_array)[k+1] = temp->vertex_array[x+1];
- (*vertex_array)[k+2] = temp->vertex_array[x+2];
-
- (*normal_array)[k] = temp->normal_array[x];
- (*normal_array)[k+1] = temp->normal_array[x+1];
- (*normal_array)[k+2] = temp->normal_array[x+2];
-
- x += 3;
- k += 3;
- }
- (*type_array)[l] = temp->type_array[i];
- (*length_array)[l++] = temp->length_array[i];
- }
- }
-}
-
-
-
-static int isDegenerate(float A[2], float B[2], float C[2])
-{
- if( (A[0] == B[0] && A[1]==B[1]) ||
- (A[0] == C[0] && A[1]==C[1]) ||
- (B[0] == C[0] && B[1]==C[1])
- )
- return 1;
- else
- return 0;
-}
-
-
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierPatchMesh.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierPatchMesh.h
deleted file mode 100755
index 81e8dae52..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierPatchMesh.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Attic/bezierPatchMesh.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _BEZIERPATCHMESH_H
-#define _BEZIERPATCHMESH_H
-
-#include "bezierPatch.h"
-
-typedef struct bezierPatchMesh{
- bezierPatch *bpatch; /*vertex*/
- bezierPatch *bpatch_normal;
- bezierPatch *bpatch_texcoord; /*s,t,r,q*/
- bezierPatch *bpatch_color; /*RGBA*/
-
- float *UVarray; /*all UV components of all vertices of all strips*/
- int *length_array; /*[i] is the number of vertices in the ith strip*/
- GLenum *type_array; /*[i] is the type of the ith primitive*/
-
- /*to support dynamic insertion*/
- int size_UVarray;
- int index_UVarray;
- int size_length_array;
- int index_length_array;
-
- int counter; /*track the current strip size*/
- GLenum type; /*track the current type: 0: GL_TRIANGLES, 1: GL_TRIANGLE_STRIP*/
-
- /*we eventually want to evaluate from (u,v) to (x,y,z) and draw them*/
- float *vertex_array; /*each vertex contains three components*/
- float *normal_array; /*each normal contains three components*/
- float *color_array;
- float *texcoord_array;
-
- /*in case we need a linked list*/
- struct bezierPatchMesh *next;
-} bezierPatchMesh;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-
-bezierPatchMesh *bezierPatchMeshMake(int maptype, float umin, float umax, int ustride, int uorder, float vmin, float vmax, int vstride, int vorder, float *ctlpoints, int size_UVarray, int size_length_array);
-
-/*initilize patches to be null*/
-bezierPatchMesh *bezierPatchMeshMake2(int size_UVarray, int size_length_array);
-
-void bezierPatchMeshPutPatch(bezierPatchMesh *bpm, int maptype, float umin, float umax, int ustride, int uorder, float vmin, float vmax, int vstride, int vorder, float *ctlpoints);
-
-void bezierPatchMeshDelete(bezierPatchMesh *bpm);
-
-void bezierPatchMeshBeginStrip(bezierPatchMesh *bpm, GLenum type);
-
-void bezierPatchMeshEndStrip(bezierPatchMesh *bpm);
-
-void bezierPatchMeshInsertUV(bezierPatchMesh *bpm, float u, float v);
-
-void bezierPatchMeshPrint(bezierPatchMesh *bpm);
-
-bezierPatchMesh* bezierPatchMeshListInsert(bezierPatchMesh* list, bezierPatchMesh* bpm);
-
-void bezierPatchMeshListPrint(bezierPatchMesh* list);
-
-int bezierPatchMeshListTotalStrips(bezierPatchMesh* list);
-
-int bezierPatchMeshListTotalVert(bezierPatchMesh* list);
-int bezierPatchMeshNumTriangles(bezierPatchMesh* bpm);
-int bezierPatchMeshListNumTriangles(bezierPatchMesh* list);
-
-void bezierPatchMeshDelDeg(bezierPatchMesh* bpm);
-
-
-void bezierPatchMeshEval(bezierPatchMesh* bpm);
-
-void bezierPatchMeshDraw(bezierPatchMesh* bpm);
-
-void bezierPatchMeshListDraw(bezierPatchMesh* list);
-void bezierPatchMeshListEval(bezierPatchMesh* list);
-void bezierPatchMeshListCollect(bezierPatchMesh* list, float **vertex_array, float **normal_array, int **length_array, GLenum **type_array, int *num_strips);
-
-void bezierPatchMeshListDelDeg(bezierPatchMesh* list);
-void bezierPatchMeshListDelete(bezierPatchMesh *list);
-bezierPatchMesh* bezierPatchMeshListReverse(bezierPatchMesh* list);
-void drawStrips(float *vertex_array, float *normal_array, int *length_array, GLenum *type_array, int num_strips);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glcurveval.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glcurveval.cc
deleted file mode 100755
index 826e0b883..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glcurveval.cc
+++ /dev/null
@@ -1,400 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glcurveval.cc,v 1.2 2001/01/21 21:19:07 tsi Exp $ */
-
-/*
- * glcurveval.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Attic/glcurveval.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-/* Polynomial Evaluator Interface */
-
-#include "gluos.h"
-#include "glimports.h"
-#include "glrenderer.h"
-#include "glcurveval.h"
-#include "nurbsconsts.h"
-
-OpenGLCurveEvaluator::OpenGLCurveEvaluator(void)
-{
- //no default callback functions
- beginCallBackN = NULL;
- endCallBackN = NULL;
- vertexCallBackN = NULL;
- normalCallBackN = NULL;
- colorCallBackN = NULL;
- texcoordCallBackN = NULL;
- beginCallBackData = NULL;
- endCallBackData = NULL;
- vertexCallBackData = NULL;
- normalCallBackData = NULL;
- colorCallBackData = NULL;
- texcoordCallBackData = NULL;
-
- userData = NULL;
-
- vertex_flag = 0;
- normal_flag = 0;
- color_flag = 0;
- texcoord_flag = 0;
-
- em_vertex.uprime = -1.0;
- em_normal.uprime = -1.0;
- em_color.uprime = -1.0;
- em_texcoord.uprime = -1.0;
-}
-
-OpenGLCurveEvaluator::~OpenGLCurveEvaluator(void)
-{
-}
-
-/* added nonsense to avoid the warning messages at compile time */
-void
-OpenGLCurveEvaluator::addMap(CurveMap *m)
-{
- m = m;
-}
-
-void
-OpenGLCurveEvaluator::range1f(long type, REAL *from, REAL *to)
-{
- type = type;
- from = from;
- to = to;
-}
-
-void
-OpenGLCurveEvaluator::domain1f(REAL ulo, REAL uhi)
-{
- ulo = ulo;
- uhi = uhi;
-}
-
-void
-OpenGLCurveEvaluator::bgnline(void)
-{
- if(output_triangles)
- beginCallBack(GL_LINE_STRIP, userData);
- else
- glBegin((GLenum) GL_LINE_STRIP);
-}
-
-void
-OpenGLCurveEvaluator::endline(void)
-{
- if(output_triangles)
- endCallBack(userData);
- else
- glEnd();
-}
-
-/*---------------------------------------------------------------------------
- * disable - turn off a curve map
- *---------------------------------------------------------------------------
- */
-void
-OpenGLCurveEvaluator::disable(long type)
-{
- glDisable((GLenum) type);
-}
-
-/*---------------------------------------------------------------------------
- * enable - turn on a curve map
- *---------------------------------------------------------------------------
- */
-void
-OpenGLCurveEvaluator::enable(long type)
-{
- glEnable((GLenum) type);
-}
-
-/*-------------------------------------------------------------------------
- * mapgrid1f - define a lattice of points with origin and offset
- *-------------------------------------------------------------------------
- */
-void
-OpenGLCurveEvaluator::mapgrid1f(long nu, REAL u0, REAL u1)
-{
- if(output_triangles)
- {
- global_grid_u0 = (int)u0;
- global_grid_u1 = (int)u1;
- global_grid_nu = nu;
- }
- else
- glMapGrid1f((GLint) nu, (GLfloat) u0, (GLfloat) u1);
-}
-
-/*-------------------------------------------------------------------------
- * bgnmap1 - preamble to curve definition and evaluations
- *-------------------------------------------------------------------------
- */
-void
-OpenGLCurveEvaluator::bgnmap1f(long)
-{
- if(output_triangles)
- {
- //initialized so that no maps are set initially
- vertex_flag = 0;
- normal_flag = 0;
- color_flag = 0;
- texcoord_flag = 0;
- //no need to worry about gl states when doing callback
- }
- else
- glPushAttrib((GLbitfield) GL_EVAL_BIT);
-}
-
-/*-------------------------------------------------------------------------
- * endmap1 - postamble to a curve map
- *-------------------------------------------------------------------------
- */
-void
-OpenGLCurveEvaluator::endmap1f(void)
-{
- if(output_triangles)
- {
-
- }
- else
- glPopAttrib();
-}
-
-/*-------------------------------------------------------------------------
- * map1f - pass a desription of a curve map
- *-------------------------------------------------------------------------
- */
-void
-OpenGLCurveEvaluator::map1f(
- long type, /* map type */
- REAL ulo, /* lower parametric bound */
- REAL uhi, /* upper parametric bound */
- long stride, /* distance to next point in REALS */
- long order, /* parametric order */
- REAL *pts /* control points */
-)
-{
- if(output_triangles)
- {
- int dimension;
- int which;
- switch(type){
- case GL_MAP1_VERTEX_3:
- which = 0;
- dimension = 3;
- break;
- case GL_MAP1_VERTEX_4:
- which=0;
- dimension = 4;
- break;
- case GL_MAP1_INDEX:
- which=2;
- dimension = 1;
- break;
- case GL_MAP1_COLOR_4:
- which=2;
- dimension = 4;
- break;
- case GL_MAP1_NORMAL:
- which=1;
- dimension = 3;
- break;
- case GL_MAP1_TEXTURE_COORD_1:
- which=3;
- dimension = 1;
- break;
- case GL_MAP1_TEXTURE_COORD_2:
- which=3;
- dimension = 2;
- break;
-
- case GL_MAP1_TEXTURE_COORD_3:
- which=3;
- dimension = 3;
- break;
- case GL_MAP1_TEXTURE_COORD_4:
- which=3;
- dimension = 4;
- break;
- }
- inMap1f(which, dimension, ulo, uhi, stride, order, pts);
- }
- else
- glMap1f((GLenum) type, (GLfloat) ulo, (GLfloat) uhi, (GLint) stride,
- (GLint) order, (const GLfloat *) pts);
-}
-
-/*-------------------------------------------------------------------------
- * mapmesh1f - evaluate a mesh of points on lattice
- *-------------------------------------------------------------------------
- */
-void OpenGLCurveEvaluator::mapmesh1f(long style, long from, long to)
-{
- if(output_triangles)
- {
- inMapMesh1f((int) from, (int) to);
- }
- else
- {
- switch(style) {
- default:
- case N_MESHFILL:
- case N_MESHLINE:
- glEvalMesh1((GLenum) GL_LINE, (GLint) from, (GLint) to);
- break;
- case N_MESHPOINT:
- glEvalMesh1((GLenum) GL_POINT, (GLint) from, (GLint) to);
- break;
- }
- }
-}
-
-/*-------------------------------------------------------------------------
- * evalpoint1i - evaluate a point on a curve
- *-------------------------------------------------------------------------
- */
-void OpenGLCurveEvaluator::evalpoint1i(long i)
-{
- glEvalPoint1((GLint) i);
-}
-
-/*-------------------------------------------------------------------------
- * evalcoord1f - evaluate a point on a curve
- *-------------------------------------------------------------------------
- */
-void OpenGLCurveEvaluator::evalcoord1f(long, REAL u)
-{
- glEvalCoord1f((GLfloat) u);
-}
-
-void
-OpenGLCurveEvaluator::putCallBack(GLenum which, GLvoid (GLAPIENTRY *fn)(...))
-{
- switch(which)
- {
- case GLU_NURBS_BEGIN:
- beginCallBackN = (void (GLAPIENTRY *) (GLenum)) fn;
- break;
- case GLU_NURBS_END:
- endCallBackN = (void (GLAPIENTRY *) (void)) fn;
- break;
- case GLU_NURBS_VERTEX:
- vertexCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn;
- break;
- case GLU_NURBS_NORMAL:
- normalCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn;
- break;
- case GLU_NURBS_COLOR:
- colorCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn;
- break;
- case GLU_NURBS_TEXTURE_COORD:
- texcoordCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn;
- break;
- case GLU_NURBS_BEGIN_DATA:
- beginCallBackData = (void (GLAPIENTRY *) (GLenum, void*)) fn;
- break;
- case GLU_NURBS_END_DATA:
- endCallBackData = (void (GLAPIENTRY *) (void*)) fn;
- break;
- case GLU_NURBS_VERTEX_DATA:
- vertexCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn;
- break;
- case GLU_NURBS_NORMAL_DATA:
- normalCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn;
- break;
- case GLU_NURBS_COLOR_DATA:
- colorCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn;
- break;
- case GLU_NURBS_TEXTURE_COORD_DATA:
- texcoordCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn;
- break;
- }
-}
-
-void
-OpenGLCurveEvaluator::beginCallBack(GLenum which, void *data)
-{
- if(beginCallBackData)
- beginCallBackData(which, data);
- else if(beginCallBackN)
- beginCallBackN(which);
-}
-
-void
-OpenGLCurveEvaluator::endCallBack(void *data)
-{
- if(endCallBackData)
- endCallBackData(data);
- else if(endCallBackN)
- endCallBackN();
-}
-
-void
-OpenGLCurveEvaluator::vertexCallBack(const GLfloat *vert, void* data)
-{
- if(vertexCallBackData)
- vertexCallBackData(vert, data);
- else if(vertexCallBackN)
- vertexCallBackN(vert);
-}
-
-
-void
-OpenGLCurveEvaluator::normalCallBack(const GLfloat *normal, void* data)
-{
- if(normalCallBackData)
- normalCallBackData(normal, data);
- else if(normalCallBackN)
- normalCallBackN(normal);
-}
-
-void
-OpenGLCurveEvaluator::colorCallBack(const GLfloat *color, void* data)
-{
- if(colorCallBackData)
- colorCallBackData(color, data);
- else if(colorCallBackN)
- colorCallBackN(color);
-}
-
-void
-OpenGLCurveEvaluator::texcoordCallBack(const GLfloat *texcoord, void* data)
-{
- if(texcoordCallBackData)
- texcoordCallBackData(texcoord, data);
- else if(texcoordCallBackN)
- texcoordCallBackN(texcoord);
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glcurveval.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glcurveval.h
deleted file mode 100755
index 9210dc723..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glcurveval.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * glcurveval.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Attic/glcurveval.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gluglcurveval_h_
-#define __gluglcurveval_h_
-
-#include "gluos.h"
-#include <GL/gl.h>
-#include "basiccrveval.h"
-
-class CurveMap;
-
-/*for internal evaluator callback stuff*/
-#ifndef IN_MAX_BEZIER_ORDER
-#define IN_MAX_BEZIER_ORDER 40 /*XXX should be bigger than machine order*/
-#endif
-
-#ifndef IN_MAX_DIMENSION
-#define IN_MAX_DIMENSION 4
-#endif
-
-typedef struct curveEvalMachine{
- REAL uprime; //cached previously evaluated uprime
- int k; //the dimension
- REAL u1;
- REAL u2;
- int ustride;
- int uorder;
- REAL ctlpoints[IN_MAX_BEZIER_ORDER*IN_MAX_DIMENSION];
- REAL ucoeff[IN_MAX_BEZIER_ORDER];//cache the polynomial values
-} curveEvalMachine;
-
-class OpenGLCurveEvaluator : public BasicCurveEvaluator {
-public:
- OpenGLCurveEvaluator(void);
- ~OpenGLCurveEvaluator(void);
- void range1f(long, REAL *, REAL *);
- void domain1f(REAL, REAL);
- void addMap(CurveMap *);
-
- void enable(long);
- void disable(long);
- void bgnmap1f(long);
- void map1f(long, REAL, REAL, long, long, REAL *);
- void mapgrid1f(long, REAL, REAL);
- void mapmesh1f(long, long, long);
- void evalpoint1i(long);
- void evalcoord1f(long, REAL);
- void endmap1f(void);
-
- void bgnline(void);
- void endline(void);
-
- void put_vertices_call_back(int flag)
- {
- output_triangles = flag;
- }
- void putCallBack(GLenum which, GLvoid (GLAPIENTRY *fn)(...));
- void set_callback_userData(void *data)
- {
- userData = data;
- }
-
-/*------------------begin for curveEvalMachine------------*/
-curveEvalMachine em_vertex;
-curveEvalMachine em_normal;
-curveEvalMachine em_color;
-curveEvalMachine em_texcoord;
-int vertex_flag; //whether there is a vertex map or not
-int normal_flag; //whether there is a normal map or not
-int color_flag; //whether there is a color map or not
-int texcoord_flag; //whether there is a texture map or not
-
-int global_grid_u0;
-int global_grid_u1;
-int global_grid_nu;
-
-void inMap1f(int which, //0: vert, 1: norm, 2: color, 3: tex
- int dimension,
- REAL ulower,
- REAL uupper,
- int ustride,
- int uorder,
- REAL *ctlpoints);
-
-void inPreEvaluate(int order, REAL vprime, REAL *coeff);
-void inDoDomain1(curveEvalMachine *em, REAL u, REAL *retPoint);
-void inDoEvalCoord1(REAL u);
-void inMapMesh1f(int umin, int umax);
-
-void (GLAPIENTRY *beginCallBackN) (GLenum type);
-void (GLAPIENTRY *endCallBackN) (void);
-void (GLAPIENTRY *vertexCallBackN) (const GLfloat *vert);
-void (GLAPIENTRY *normalCallBackN) (const GLfloat *normal);
-void (GLAPIENTRY *colorCallBackN) (const GLfloat *color);
-void (GLAPIENTRY *texcoordCallBackN) (const GLfloat *texcoord);
-
-void (GLAPIENTRY *beginCallBackData) (GLenum type, void* data);
-void (GLAPIENTRY *endCallBackData) (void* data);
-void (GLAPIENTRY *vertexCallBackData) (const GLfloat *vert, void* data);
-void (GLAPIENTRY *normalCallBackData) (const GLfloat *normal, void* data);
-void (GLAPIENTRY *colorCallBackData) (const GLfloat *color, void* data);
-void (GLAPIENTRY *texcoordCallBackData) (const GLfloat *texcoord, void* data);
-
-void* userData; //the opaque pointer for Data callback functions
-void beginCallBack(GLenum type, void* data);
-void endCallBack(void* data);
-void vertexCallBack(const GLfloat *vert, void *data);
-void normalCallBack(const GLfloat *normal, void* data);
-void colorCallBack(const GLfloat *color, void* data);
-void texcoordCallBack(const GLfloat *texcoord, void* data);
-
-
-/*------------------end for curveEvalMachine------------*/
-
-private:
- int output_triangles; //true 1; false 0
-};
-
-#endif /* __gluglcurveval_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glimports.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glimports.h
deleted file mode 100755
index 0ca1f42e0..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glimports.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * glimports.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Attic/glimports.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gluimports_h_
-#define __gluimports_h_
-
-#include "mystdlib.h"
-#include "mystdio.h"
-
-#endif /* __gluimports_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glinterface.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glinterface.cc
deleted file mode 100755
index 7a9a5c850..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glinterface.cc
+++ /dev/null
@@ -1,468 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glinterface.cc,v 1.3 2001/04/03 02:18:40 dawes Exp $ */
-
-#include "gluos.h"
-#include <GL/gl.h>
-#include <GL/glu.h>
-#include <stdio.h>
-#include "glimports.h"
-#include "glrenderer.h"
-#include "nurbsconsts.h"
-
-/*#define DOWN_LOAD_NURBS*/
-#ifdef DOWN_LOAD_NURBS
-
-#include "oglTrimNurbs.h"
-static int surfcount = 0;
-static oglTrimNurbs* otn = NULL;
-nurbSurf* tempNurb = NULL;
-oglTrimLoops* tempTrim = NULL;
-#endif
-
-
-//for LOD
-extern "C" {void glu_LOD_eval_list(GLUnurbs *nurb, int level);}
-
-void glu_LOD_eval_list(GLUnurbs *nurb, int level)
-{
- nurb->LOD_eval_list(level);
-}
-
-GLUnurbs * GLAPIENTRY
-gluNewNurbsRenderer(void)
-{
- GLUnurbs *t;
-
- t = new GLUnurbs();
- return t;
-}
-
-void GLAPIENTRY
-gluDeleteNurbsRenderer(GLUnurbs *r)
-{
- delete r;
-}
-
-extern "C"
-void GLAPIENTRY
-
-gluDeleteNurbsTessellatorEXT(GLUnurbsObj *r)
-{
- delete r;
-}
-
-void GLAPIENTRY
-gluBeginSurface(GLUnurbs *r)
-{
-#ifdef DOWN_LOAD_NURBS
-surfcount++;
-tempTrim = OTL_make(10,10);
-#endif
- r->bgnsurface(0);
-}
-
-void GLAPIENTRY
-gluBeginCurve(GLUnurbs *r)
-{
- r->bgncurve(0);
-}
-
-void GLAPIENTRY
-gluEndCurve(GLUnurbs *r)
-{
- r->endcurve();
-}
-
-void GLAPIENTRY
-gluEndSurface(GLUnurbs *r)
-{
-#ifdef DOWN_LOAD_NURBS
-if(surfcount == 1)
- otn = OTN_make(1);
-OTN_insert(otn, tempNurb, tempTrim);
-if(surfcount >= 1)
-{
-#ifdef DEBUG
-printf("write file\n");
-#endif
-OTN_write(otn, "out.otn");
-
-}
-#endif
-
- r->endsurface();
-}
-
-void GLAPIENTRY
-gluBeginTrim(GLUnurbs *r)
-{
-#ifdef DOWN_LOAD_NURBS
-OTL_bgnTrim(tempTrim);
-#endif
-
- r->bgntrim();
-}
-
-void GLAPIENTRY
-gluEndTrim(GLUnurbs *r)
-{
-#ifdef DOWN_LOAD_NURBS
-OTL_endTrim(tempTrim);
-#endif
- r->endtrim();
-}
-
-void GLAPIENTRY
-gluPwlCurve(GLUnurbs *r, GLint count, INREAL array[],
- GLint stride, GLenum type)
-{
-#ifdef DOWN_LOAD_NURBS
-OTL_pwlCurve(tempTrim, count, array, stride, type);
-#endif
-
- int realType;
- switch(type) {
- case GLU_MAP1_TRIM_2:
- realType = N_P2D;
- break;
- case GLU_MAP1_TRIM_3:
- realType = N_P2DR;
- break;
- default:
- realType = type;
- break;
- }
- r->pwlcurve(count, array, sizeof(INREAL) * stride, realType);
-}
-
-void GLAPIENTRY
-gluNurbsCurve(GLUnurbs *r, GLint nknots, INREAL knot[], GLint stride,
- INREAL ctlarray[], GLint order, GLenum type)
-{
-#ifdef DOWN_LOAD_NURBS
-OTL_nurbsCurve(tempTrim, nknots, knot, stride, ctlarray, order, type);
-#endif
-
- int realType;
-
- switch(type) {
- case GLU_MAP1_TRIM_2:
- realType = N_P2D;
- break;
- case GLU_MAP1_TRIM_3:
- realType = N_P2DR;
- break;
- default:
- realType = type;
- break;
- }
-
- r->nurbscurve(nknots, knot, sizeof(INREAL) * stride, ctlarray, order,
- realType);
-}
-
-void GLAPIENTRY
-gluNurbsSurface(GLUnurbs *r, GLint sknot_count, GLfloat *sknot,
- GLint tknot_count, GLfloat *tknot,
- GLint s_stride, GLint t_stride,
- GLfloat *ctlarray, GLint sorder, GLint torder,
- GLenum type)
-{
-#ifdef DOWN_LOAD_NURBS
- {
- int dimension;
- switch(type){
- case GL_MAP2_VERTEX_3:
- dimension = 3;
- break;
- case GL_MAP2_VERTEX_4:
- dimension = 4;
- break;
- default:
- fprintf(stderr, "error in glinterface.c++, type no implemented\n");
- exit(1);
- }
-tempNurb = nurbSurfMake(sknot_count, sknot,
- tknot_count, tknot,
- sorder, torder,
- dimension,
- ctlarray,
- s_stride, t_stride);
-
- }
-#endif
-
- r->nurbssurface(sknot_count, sknot, tknot_count, tknot,
- sizeof(INREAL) * s_stride, sizeof(INREAL) * t_stride,
- ctlarray, sorder, torder, type);
-}
-
-void GLAPIENTRY
-gluLoadSamplingMatrices(GLUnurbs *r, const GLfloat modelMatrix[16],
- const GLfloat projMatrix[16],
- const GLint viewport[4])
-{
- r->useGLMatrices(modelMatrix, projMatrix, viewport);
-}
-
-void GLAPIENTRY
-gluNurbsProperty(GLUnurbs *r, GLenum property, GLfloat value)
-{
- GLfloat nurbsValue;
-
- switch (property) {
- case GLU_AUTO_LOAD_MATRIX:
- r->setautoloadmode(value);
- return;
-
- case GLU_CULLING:
- if (value != 0.0) {
- nurbsValue = N_CULLINGON;
- } else {
- nurbsValue = N_NOCULLING;
- }
- r->setnurbsproperty(GL_MAP2_VERTEX_3, N_CULLING, nurbsValue);
- r->setnurbsproperty(GL_MAP2_VERTEX_4, N_CULLING, nurbsValue);
- r->setnurbsproperty(GL_MAP1_VERTEX_3, N_CULLING, nurbsValue);
- r->setnurbsproperty(GL_MAP1_VERTEX_4, N_CULLING, nurbsValue);
- return;
-
- case GLU_SAMPLING_METHOD:
- if (value == GLU_PATH_LENGTH) {
- nurbsValue = N_PATHLENGTH;
- } else if (value == GLU_PARAMETRIC_ERROR) {
- nurbsValue = N_PARAMETRICDISTANCE;
- } else if (value == GLU_DOMAIN_DISTANCE) {
- nurbsValue = N_DOMAINDISTANCE;
- r->set_is_domain_distance_sampling(1); //optimzing untrimmed case
-
- } else if (value == GLU_OBJECT_PARAMETRIC_ERROR) {
- nurbsValue = N_OBJECTSPACE_PARA;
- r->setautoloadmode( 0.0 );
- r->setSamplingMatrixIdentity();
- } else if (value == GLU_OBJECT_PATH_LENGTH) {
- nurbsValue = N_OBJECTSPACE_PATH;
- r->setautoloadmode( 0.0 );
- r->setSamplingMatrixIdentity();
- } else {
- r->postError(GLU_INVALID_VALUE);
- return;
- }
-
- r->setnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMETHOD, nurbsValue);
- r->setnurbsproperty(GL_MAP2_VERTEX_4, N_SAMPLINGMETHOD, nurbsValue);
- r->setnurbsproperty(GL_MAP1_VERTEX_3, N_SAMPLINGMETHOD, nurbsValue);
- r->setnurbsproperty(GL_MAP1_VERTEX_4, N_SAMPLINGMETHOD, nurbsValue);
- return;
-
- case GLU_SAMPLING_TOLERANCE:
- r->setnurbsproperty(GL_MAP2_VERTEX_3, N_PIXEL_TOLERANCE, value);
- r->setnurbsproperty(GL_MAP2_VERTEX_4, N_PIXEL_TOLERANCE, value);
- r->setnurbsproperty(GL_MAP1_VERTEX_3, N_PIXEL_TOLERANCE, value);
- r->setnurbsproperty(GL_MAP1_VERTEX_4, N_PIXEL_TOLERANCE, value);
- return;
-
- case GLU_PARAMETRIC_TOLERANCE:
- r->setnurbsproperty(GL_MAP2_VERTEX_3, N_ERROR_TOLERANCE, value);
- r->setnurbsproperty(GL_MAP2_VERTEX_4, N_ERROR_TOLERANCE, value);
- r->setnurbsproperty(GL_MAP1_VERTEX_3, N_ERROR_TOLERANCE, value);
- r->setnurbsproperty(GL_MAP1_VERTEX_4, N_ERROR_TOLERANCE, value);
- return;
-
-
- case GLU_DISPLAY_MODE:
-
- if (value == GLU_FILL) {
- nurbsValue = N_FILL;
- } else if (value == GLU_OUTLINE_POLYGON) {
- nurbsValue = N_OUTLINE_POLY;
- } else if (value == GLU_OUTLINE_PATCH) {
- nurbsValue = N_OUTLINE_PATCH;
- } else {
- r->postError(GLU_INVALID_VALUE);
- return;
- }
- r->setnurbsproperty(N_DISPLAY, nurbsValue);
-
- break;
-
- case GLU_U_STEP:
- r->setnurbsproperty(GL_MAP1_VERTEX_3, N_S_STEPS, value);
- r->setnurbsproperty(GL_MAP1_VERTEX_4, N_S_STEPS, value);
- r->setnurbsproperty(GL_MAP2_VERTEX_3, N_S_STEPS, value);
- r->setnurbsproperty(GL_MAP2_VERTEX_4, N_S_STEPS, value);
-
- //added for optimizing untrimmed case
- r->set_domain_distance_u_rate(value);
- break;
-
- case GLU_V_STEP:
- r->setnurbsproperty(GL_MAP1_VERTEX_3, N_T_STEPS, value);
- r->setnurbsproperty(GL_MAP1_VERTEX_4, N_T_STEPS, value);
- r->setnurbsproperty(GL_MAP2_VERTEX_3, N_T_STEPS, value);
- r->setnurbsproperty(GL_MAP2_VERTEX_4, N_T_STEPS, value);
-
- //added for optimizing untrimmed case
- r->set_domain_distance_v_rate(value);
- break;
-
- case GLU_NURBS_MODE:
- if(value == GLU_NURBS_RENDERER)
- r->put_callbackFlag(0);
- else if(value == GLU_NURBS_TESSELLATOR)
- r->put_callbackFlag(1);
- else
- r->postError(GLU_INVALID_ENUM);
- break;
-
- default:
- r->postError(GLU_INVALID_ENUM);
- return;
- }
-}
-
-void GLAPIENTRY
-gluGetNurbsProperty(GLUnurbs *r, GLenum property, GLfloat *value)
-{
- GLfloat nurbsValue;
-
- switch(property) {
- case GLU_AUTO_LOAD_MATRIX:
- if (r->getautoloadmode()) {
- *value = GL_TRUE;
- } else {
- *value = GL_FALSE;
- }
- break;
- case GLU_CULLING:
- r->getnurbsproperty(GL_MAP2_VERTEX_3, N_CULLING, &nurbsValue);
- if (nurbsValue == N_CULLINGON) {
- *value = GL_TRUE;
- } else {
- *value = GL_FALSE;
- }
- break;
- case GLU_SAMPLING_METHOD:
- r->getnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMETHOD, value);
- if(*value == N_PATHLENGTH)
- *value = GLU_PATH_LENGTH;
- else if(*value == N_PARAMETRICDISTANCE)
- *value = GLU_PARAMETRIC_ERROR;
- else if(*value == N_DOMAINDISTANCE)
- *value = GLU_DOMAIN_DISTANCE;
- else if(*value == N_OBJECTSPACE_PATH)
- *value = GLU_OBJECT_PATH_LENGTH;
- else if(*value == N_OBJECTSPACE_PARA)
- *value = GLU_OBJECT_PARAMETRIC_ERROR;
- break;
- case GLU_SAMPLING_TOLERANCE:
- r->getnurbsproperty(GL_MAP2_VERTEX_3, N_PIXEL_TOLERANCE, value);
- break;
- case GLU_PARAMETRIC_TOLERANCE:
- r->getnurbsproperty(GL_MAP2_VERTEX_3, N_ERROR_TOLERANCE, value);
- break;
-
- case GLU_U_STEP:
- r->getnurbsproperty(GL_MAP2_VERTEX_3, N_S_STEPS, value);
- break;
- case GLU_V_STEP:
- r->getnurbsproperty(GL_MAP2_VERTEX_3, N_T_STEPS, value);
- break;
- case GLU_DISPLAY_MODE:
- r->getnurbsproperty(N_DISPLAY, &nurbsValue);
- if (nurbsValue == N_FILL) {
- *value = GLU_FILL;
- } else if (nurbsValue == N_OUTLINE_POLY) {
- *value = GLU_OUTLINE_POLYGON;
- } else {
- *value = GLU_OUTLINE_PATCH;
- }
- break;
-
- case GLU_NURBS_MODE:
- if(r->is_callback())
- *value = GLU_NURBS_TESSELLATOR;
- else
- *value = GLU_NURBS_RENDERER;
- break;
-
- default:
- r->postError(GLU_INVALID_ENUM);
- return;
- }
-}
-
-extern "C" void GLAPIENTRY
-gluNurbsCallback(GLUnurbs *r, GLenum which, GLvoid (*fn)(GLvoid))
-{
- switch (which) {
- case GLU_NURBS_BEGIN:
- case GLU_NURBS_END:
- case GLU_NURBS_VERTEX:
- case GLU_NURBS_NORMAL:
- case GLU_NURBS_TEXTURE_COORD:
- case GLU_NURBS_COLOR:
- case GLU_NURBS_BEGIN_DATA:
- case GLU_NURBS_END_DATA:
- case GLU_NURBS_VERTEX_DATA:
- case GLU_NURBS_NORMAL_DATA:
- case GLU_NURBS_TEXTURE_COORD_DATA:
- case GLU_NURBS_COLOR_DATA:
- r->putSurfCallBack(which, (GLvoid (*)(...))fn);
- break;
-
- case GLU_NURBS_ERROR:
- r->errorCallback = (void (*)( GLenum )) fn;
- break;
- default:
- r->postError(GLU_INVALID_ENUM);
- return;
- }
-}
-
-extern "C"
-void GLAPIENTRY
-gluNurbsCallbackDataEXT(GLUnurbs* r, void* userData)
-{
- r->setNurbsCallbackData(userData);
-}
-
-extern "C"
-void GLAPIENTRY
-gluNurbsCallbackData(GLUnurbs* r, void* userData)
-{
- gluNurbsCallbackDataEXT(r,userData);
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glrenderer.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glrenderer.cc
deleted file mode 100755
index 114ad06d3..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glrenderer.cc
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Attic/glrenderer.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include "gluos.h"
-#include "glimports.h"
-#include "glrenderer.h"
-
-GLUnurbs::GLUnurbs()
- : NurbsTessellator(curveEvaluator, surfaceEvaluator)
-{
- redefineMaps();
- defineMap(GL_MAP2_NORMAL, 0, 3);
- defineMap(GL_MAP1_NORMAL, 0, 3);
- defineMap(GL_MAP2_TEXTURE_COORD_1, 0, 1);
- defineMap(GL_MAP1_TEXTURE_COORD_1, 0, 1);
- defineMap(GL_MAP2_TEXTURE_COORD_2, 0, 2);
- defineMap(GL_MAP1_TEXTURE_COORD_2, 0, 2);
- defineMap(GL_MAP2_TEXTURE_COORD_3, 0, 3);
- defineMap(GL_MAP1_TEXTURE_COORD_3, 0, 3);
- defineMap(GL_MAP2_TEXTURE_COORD_4, 1, 4);
- defineMap(GL_MAP1_TEXTURE_COORD_4, 1, 4);
- defineMap(GL_MAP2_VERTEX_4, 1, 4);
- defineMap(GL_MAP1_VERTEX_4, 1, 4);
- defineMap(GL_MAP2_VERTEX_3, 0, 3);
- defineMap(GL_MAP1_VERTEX_3, 0, 3);
- defineMap(GL_MAP2_COLOR_4, 0, 4);
- defineMap(GL_MAP1_COLOR_4, 0, 4);
- defineMap(GL_MAP2_INDEX, 0, 1);
- defineMap(GL_MAP1_INDEX, 0, 1);
-
- setnurbsproperty(GL_MAP1_VERTEX_3, N_SAMPLINGMETHOD, (float) N_PATHLENGTH);
- setnurbsproperty(GL_MAP1_VERTEX_4, N_SAMPLINGMETHOD, (float) N_PATHLENGTH);
- setnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMETHOD, (float) N_PATHLENGTH);
- setnurbsproperty(GL_MAP2_VERTEX_4, N_SAMPLINGMETHOD, (float) N_PATHLENGTH);
-
- setnurbsproperty(GL_MAP1_VERTEX_3, N_PIXEL_TOLERANCE, (float) 50.0);
- setnurbsproperty(GL_MAP1_VERTEX_4, N_PIXEL_TOLERANCE, (float) 50.0);
- setnurbsproperty(GL_MAP2_VERTEX_3, N_PIXEL_TOLERANCE, (float) 50.0);
- setnurbsproperty(GL_MAP2_VERTEX_4, N_PIXEL_TOLERANCE, (float) 50.0);
-
- setnurbsproperty(GL_MAP1_VERTEX_3, N_ERROR_TOLERANCE, (float) 0.50);
- setnurbsproperty(GL_MAP1_VERTEX_4, N_ERROR_TOLERANCE, (float) 0.50);
- setnurbsproperty(GL_MAP2_VERTEX_3, N_ERROR_TOLERANCE, (float) 0.50);
- setnurbsproperty(GL_MAP2_VERTEX_4, N_ERROR_TOLERANCE, (float) 0.50);
-
- setnurbsproperty(GL_MAP1_VERTEX_3, N_S_STEPS, (float) 100.0);
- setnurbsproperty(GL_MAP1_VERTEX_4, N_S_STEPS, (float) 100.0);
- setnurbsproperty(GL_MAP2_VERTEX_3, N_S_STEPS, (float) 100.0);
- setnurbsproperty(GL_MAP2_VERTEX_4, N_S_STEPS, (float) 100.0);
-
- //added for optimizing untrimmed case
- set_domain_distance_u_rate(100.0);
-
- setnurbsproperty(GL_MAP1_VERTEX_3, N_T_STEPS, (float) 100.0);
- setnurbsproperty(GL_MAP1_VERTEX_4, N_T_STEPS, (float) 100.0);
- setnurbsproperty(GL_MAP2_VERTEX_3, N_T_STEPS, (float) 100.0);
- setnurbsproperty(GL_MAP2_VERTEX_4, N_T_STEPS, (float) 100.0);
-
- //added for optimizing untrimmed case
- set_domain_distance_v_rate(100.0);
- set_is_domain_distance_sampling(0); //since the default is path_length
-
- //default autoloadmode is true
- autoloadmode = 1;
-
- //default callbackFlag is 0
- callbackFlag = 0;
-
- errorCallback = NULL;
-}
-
-void
-GLUnurbs::bgnrender(void)
-{
- if (autoloadmode) {
- loadGLMatrices();
- }
-}
-
-void
-GLUnurbs::endrender(void)
-{
-}
-
-void
-GLUnurbs::errorHandler(int i)
-{
- int gluError;
-
- gluError = i + (GLU_NURBS_ERROR1 - 1);
- postError( gluError );
-}
-
-void
-GLUnurbs::loadGLMatrices(void)
-{
- GLfloat vmat[4][4];
- GLint viewport[4];
-
- grabGLMatrix((GLfloat (*)[4]) vmat);
- loadCullingMatrix((GLfloat (*)[4]) vmat);
- ::glGetIntegerv((GLenum) GL_VIEWPORT, (GLint *) viewport);
- loadSamplingMatrix((const GLfloat (*)[4]) vmat, (const GLint *) viewport);
-}
-
-void
-GLUnurbs::useGLMatrices(const GLfloat modelMatrix[16],
- const GLfloat projMatrix[16],
- const GLint viewport[4])
-{
- GLfloat vmat[4][4];
-
- multmatrix4d(vmat, (const GLfloat (*)[4]) modelMatrix,
- (const GLfloat (*)[4]) projMatrix);
- loadCullingMatrix((GLfloat (*)[4]) vmat);
- loadSamplingMatrix((const GLfloat (*)[4]) vmat, (const GLint *) viewport);
-}
-
-/*--------------------------------------------------------------------------
- * grabGLMatrix
- *--------------------------------------------------------------------------
- */
-
-void
-GLUnurbs::grabGLMatrix(GLfloat vmat[4][4])
-{
- GLfloat m1[4][4], m2[4][4];
-
- ::glGetFloatv((GLenum) GL_MODELVIEW_MATRIX, (GLfloat *) &(m1[0][0]));
- ::glGetFloatv((GLenum) GL_PROJECTION_MATRIX, (GLfloat *) &(m2[0][0]));
- multmatrix4d((GLfloat (*)[4]) vmat,
- (GLfloat (*)[4]) m1, (GLfloat (*)[4]) m2);
-}
-
-//for object space tesselation: view independent
-void
-GLUnurbs::setSamplingMatrixIdentity( void )
-{
- INREAL smat[4][4] = {
- {1,0,0,0},
- {0,1,0,0},
- {0,0,1,0},
- {0,0,0,1}
- };
- const long rstride = sizeof(smat[0]) / sizeof(smat[0][0]);
- const long cstride = 1;
-
- setnurbsproperty(GL_MAP1_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride,
- cstride);
- setnurbsproperty(GL_MAP1_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride,
- cstride);
- setnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride,
- cstride);
- setnurbsproperty(GL_MAP2_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride,
- cstride);
-}
-
-
-void
-GLUnurbs::loadSamplingMatrix(const GLfloat vmat[4][4],
- const GLint viewport[4])
-{
-
- /* rescale the mapping to correspond to pixels in x/y */
- REAL xsize = 0.5 * (REAL) (viewport[2]);
- REAL ysize = 0.5 * (REAL) (viewport[3]);
-
- INREAL smat[4][4];
- smat[0][0] = vmat[0][0] * xsize;
- smat[1][0] = vmat[1][0] * xsize;
- smat[2][0] = vmat[2][0] * xsize;
- smat[3][0] = vmat[3][0] * xsize;
-
- smat[0][1] = vmat[0][1] * ysize;
- smat[1][1] = vmat[1][1] * ysize;
- smat[2][1] = vmat[2][1] * ysize;
- smat[3][1] = vmat[3][1] * ysize;
-
- smat[0][2] = 0.0;
- smat[1][2] = 0.0;
- smat[2][2] = 0.0;
- smat[3][2] = 0.0;
-
- smat[0][3] = vmat[0][3];
- smat[1][3] = vmat[1][3];
- smat[2][3] = vmat[2][3];
- smat[3][3] = vmat[3][3];
-
- const long rstride = sizeof(smat[0]) / sizeof(smat[0][0]);
- const long cstride = 1;
-
- setnurbsproperty(GL_MAP1_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride,
- cstride);
- setnurbsproperty(GL_MAP1_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride,
- cstride);
- setnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride,
- cstride);
- setnurbsproperty(GL_MAP2_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride,
- cstride);
-}
-
-void
-GLUnurbs::loadCullingMatrix(GLfloat vmat[4][4])
-{
- INREAL cmat[4][4];
-
- cmat[0][0] = vmat[0][0];
- cmat[0][1] = vmat[0][1];
- cmat[0][2] = vmat[0][2];
- cmat[0][3] = vmat[0][3];
-
- cmat[1][0] = vmat[1][0];
- cmat[1][1] = vmat[1][1];
- cmat[1][2] = vmat[1][2];
- cmat[1][3] = vmat[1][3];
-
- cmat[2][0] = vmat[2][0];
- cmat[2][1] = vmat[2][1];
- cmat[2][2] = vmat[2][2];
- cmat[2][3] = vmat[2][3];
-
- cmat[3][0] = vmat[3][0];
- cmat[3][1] = vmat[3][1];
- cmat[3][2] = vmat[3][2];
- cmat[3][3] = vmat[3][3];
-
- const long rstride = sizeof(cmat[0]) / sizeof(cmat[0][0]);
- const long cstride = 1;
-
- setnurbsproperty(GL_MAP2_VERTEX_3, N_CULLINGMATRIX, &cmat[0][0], rstride,
- cstride);
- setnurbsproperty(GL_MAP2_VERTEX_4, N_CULLINGMATRIX, &cmat[0][0], rstride,
- cstride);
- //added for curves by zl
- setnurbsproperty(GL_MAP1_VERTEX_3, N_CULLINGMATRIX, &cmat[0][0], rstride,
- cstride);
- setnurbsproperty(GL_MAP1_VERTEX_4, N_CULLINGMATRIX, &cmat[0][0], rstride,
- cstride);
-}
-
-/*---------------------------------------------------------------------
- * A = B * MAT ; transform a 4d vector through a 4x4 matrix
- *---------------------------------------------------------------------
- */
-void
-GLUnurbs::transform4d(GLfloat A[4], GLfloat B[4], GLfloat mat[4][4])
-{
-
- A[0] = B[0]*mat[0][0] + B[1]*mat[1][0] + B[2]*mat[2][0] + B[3]*mat[3][0];
- A[1] = B[0]*mat[0][1] + B[1]*mat[1][1] + B[2]*mat[2][1] + B[3]*mat[3][1];
- A[2] = B[0]*mat[0][2] + B[1]*mat[1][2] + B[2]*mat[2][2] + B[3]*mat[3][2];
- A[3] = B[0]*mat[0][3] + B[1]*mat[1][3] + B[2]*mat[2][3] + B[3]*mat[3][3];
-}
-
-/*---------------------------------------------------------------------
- * new = [left][right] ; multiply two matrices together
- *---------------------------------------------------------------------
- */
-void
-GLUnurbs::multmatrix4d (GLfloat n[4][4], const GLfloat left[4][4],
- const GLfloat right[4][4])
-{
- transform4d ((GLfloat *) n[0],(GLfloat *) left[0],(GLfloat (*)[4]) right);
- transform4d ((GLfloat *) n[1],(GLfloat *) left[1],(GLfloat (*)[4]) right);
- transform4d ((GLfloat *) n[2],(GLfloat *) left[2],(GLfloat (*)[4]) right);
- transform4d ((GLfloat *) n[3],(GLfloat *) left[3],(GLfloat (*)[4]) right);
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glrenderer.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glrenderer.h
deleted file mode 100755
index 6b2280953..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glrenderer.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * glrenderer.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Attic/glrenderer.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gluglrenderer_h_
-#define __gluglrenderer_h_
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-#include "nurbstess.h"
-#include "glsurfeval.h"
-#include "glcurveval.h"
-
-class GLUnurbs : public NurbsTessellator {
-
-public:
- GLUnurbs( void );
- void loadGLMatrices( void );
- void useGLMatrices( const GLfloat modelMatrix[16],
- const GLfloat projMatrix[16],
- const GLint viewport[4] );
- void setSamplingMatrixIdentity( void );
-
- void errorHandler( int );
- void bgnrender( void );
- void endrender( void );
- void setautoloadmode( INREAL value )
- {
-
- if (value) autoloadmode = GL_TRUE;
- else autoloadmode = GL_FALSE;
-
- }
- GLboolean getautoloadmode( void ) { return autoloadmode; }
-
- void (GLAPIENTRY *errorCallback)( GLenum );
- void postError( int which )
- { if (errorCallback) (*errorCallback)( (GLenum)which ); }
-
- void putSurfCallBack(GLenum which, GLvoid (GLAPIENTRY *fn)(...))
- {
- curveEvaluator.putCallBack(which, fn);
- surfaceEvaluator.putCallBack(which, fn);
- }
-
- int get_vertices_call_back()
- {
- return surfaceEvaluator.get_vertices_call_back();
- }
-
- void put_vertices_call_back(int flag)
- {
- surfaceEvaluator.put_vertices_call_back(flag);
- }
-
- int get_callback_auto_normal()
- {
- return surfaceEvaluator.get_callback_auto_normal();
- }
-
- void put_callback_auto_normal(int flag)
- {
- surfaceEvaluator.put_callback_auto_normal(flag);
- }
-
- void setNurbsCallbackData(void* userData)
- {
- curveEvaluator.set_callback_userData(userData);
- surfaceEvaluator.set_callback_userData(userData);
- }
-
-
- //for LOD
- void LOD_eval_list(int level)
- {
- surfaceEvaluator.LOD_eval_list(level);
- }
-
- //NEWCALLBACK
- int is_callback()
- {
- return callbackFlag;
- }
- void put_callbackFlag(int flag)
- {
- callbackFlag = flag;
- surfaceEvaluator.put_vertices_call_back(flag);
- curveEvaluator.put_vertices_call_back(flag);
- }
-
-private:
- GLboolean autoloadmode;
- OpenGLSurfaceEvaluator surfaceEvaluator;
- OpenGLCurveEvaluator curveEvaluator;
-
- void loadSamplingMatrix( const GLfloat vmat[4][4],
- const GLint viewport[4] );
- void loadCullingMatrix( GLfloat vmat[4][4] );
- static void grabGLMatrix( GLfloat vmat[4][4] );
- static void transform4d( GLfloat A[4], GLfloat B[4],
- GLfloat mat[4][4] );
- static void multmatrix4d( GLfloat n[4][4], const GLfloat left[4][4],
- const GLfloat right[4][4] );
-
- int callbackFlag;
-};
-
-#endif /* __gluglrenderer_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glsurfeval.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glsurfeval.cc
deleted file mode 100755
index 7d678f85c..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glsurfeval.cc
+++ /dev/null
@@ -1,1293 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * glsurfeval.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Attic/glsurfeval.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-/* Polynomial Evaluator Interface */
-#include "gluos.h"
-#include <stdio.h>
-#include "glimports.h"
-#include "glrenderer.h"
-#include "glsurfeval.h"
-#include "nurbsconsts.h"
-#include "bezierPatchMesh.h"
-
-
-//extern int surfcount;
-//int surfcount=0;
-
-/*#define USE_INTERNAL_EVAL*/ //use internal evaluator
-
-/*whether do evaluation or not*/
-/*#define NO_EVALUATION*/
-
-//#define USE_LOD //for LOD test, have to turn on USE_LOD in insurfeval.c++ too
-
-/*for statistics*/
-//#define STATISTICS
-#ifdef STATISTICS
-static int STAT_num_of_triangles=0;
-static int STAT_num_of_eval_vertices=0;
-static int STAT_num_of_quad_strips=0;
-#endif
-
-/*for output triangles*/
-/*#define OUTPUT_TRIANGLES*/
-
-
-/*#define FOR_CHRIS*/
-#ifdef FOR_CHRIS
-extern "C" { void evalUStripExt(int n_upper, REAL v_upper, REAL* upper_val,
- int n_lower, REAL v_lower, REAL* lower_val);}
-
-extern "C" { void evalVStripExt(int n_left, REAL u_left, REAL* left_val,
- int n_right, REAL u_right, REAL* right_val);
- }
-#endif
-
-
-/**************begin for LOD_eval_list***********/
-void OpenGLSurfaceEvaluator::LOD_eval_list(int level)
-{
- if(level == 0)
- LOD_eval_level = 1;
- else if(level == 1)
- LOD_eval_level = 2;
- else if(level == 2)
- LOD_eval_level = 4;
- else
- LOD_eval_level = 8;
-
- inBPMListEvalEM(global_bpm);
-}
-
-
-OpenGLSurfaceEvaluator::OpenGLSurfaceEvaluator()
-{
- int i;
-
- for (i=0; i<VERTEX_CACHE_SIZE; i++) {
- vertexCache[i] = new StoredVertex;
- }
- tmeshing = 0;
- which = 0;
- vcount = 0;
-
- global_uorder = 0;
- global_vorder = 0;
- global_uprime = -1.0;
- global_vprime = -1.0;
- global_vprime_BV = -1.0;
- global_uprime_BU = -1.0;
- global_uorder_BU = 0;
- global_vorder_BU = 0;
- global_uorder_BV = 0;
- global_vorder_BV = 0;
- global_baseData = NULL;
-
- global_bpm = NULL;
- output_triangles = 0; //don't output triangles by default
-
- //no default callback functions
- beginCallBackN = NULL;
- endCallBackN = NULL;
- vertexCallBackN = NULL;
- normalCallBackN = NULL;
- colorCallBackN = NULL;
- texcoordCallBackN = NULL;
- beginCallBackData = NULL;
- endCallBackData = NULL;
- vertexCallBackData = NULL;
- normalCallBackData = NULL;
- colorCallBackData = NULL;
- texcoordCallBackData = NULL;
-
- userData = NULL;
-
- auto_normal_flag = 0;
- callback_auto_normal = 0; //default of GLU_CALLBACK_AUTO_NORMAL is 0
- vertex_flag = 0;
- normal_flag = 0;
- color_flag = 0;
- texcoord_flag = 0;
-
- em_vertex.uprime = -1.0;
- em_vertex.vprime = -1.0;
- em_normal.uprime = -1.0;
- em_normal.vprime = -1.0;
- em_color.uprime = -1.0;
- em_color.vprime = -1.0;
- em_texcoord.uprime = -1.0;
- em_texcoord.vprime = -1.0;
-
-#ifdef USE_LOD
- LOD_eval_level = 1;
-#endif
-}
-
-OpenGLSurfaceEvaluator::~OpenGLSurfaceEvaluator()
-{
- for (int ii= 0; ii< VERTEX_CACHE_SIZE; ii++) {
- delete vertexCache[ii];
- vertexCache[ii]= 0;
- }
-}
-
-/*---------------------------------------------------------------------------
- * disable - turn off a map
- *---------------------------------------------------------------------------
- */
-void
-OpenGLSurfaceEvaluator::disable(long type)
-{
- glDisable((GLenum) type);
-}
-
-/*---------------------------------------------------------------------------
- * enable - turn on a map
- *---------------------------------------------------------------------------
- */
-void
-OpenGLSurfaceEvaluator::enable(long type)
-{
- glEnable((GLenum) type);
-}
-
-/*-------------------------------------------------------------------------
- * mapgrid2f - define a lattice of points with origin and offset
- *-------------------------------------------------------------------------
- */
-void
-OpenGLSurfaceEvaluator::mapgrid2f(long nu, REAL u0, REAL u1, long nv, REAL v0, REAL v1)
-{
-#ifdef USE_INTERNAL_EVAL
- inMapGrid2f((int) nu, (REAL) u0, (REAL) u1, (int) nv,
- (REAL) v0, (REAL) v1);
-#else
-
- if(output_triangles)
- {
- global_grid_u0 = u0;
- global_grid_u1 = u1;
- global_grid_nu = nu;
- global_grid_v0 = v0;
- global_grid_v1 = v1;
- global_grid_nv = nv;
- }
- else
- glMapGrid2d((GLint) nu, (GLdouble) u0, (GLdouble) u1, (GLint) nv,
- (GLdouble) v0, (GLdouble) v1);
-
-#endif
-}
-
-void
-OpenGLSurfaceEvaluator::polymode(long style)
-{
- if(! output_triangles)
- {
- switch(style) {
- default:
- case N_MESHFILL:
-
- glPolygonMode((GLenum) GL_FRONT_AND_BACK, (GLenum) GL_FILL);
- break;
- case N_MESHLINE:
- glPolygonMode((GLenum) GL_FRONT_AND_BACK, (GLenum) GL_LINE);
- break;
- case N_MESHPOINT:
- glPolygonMode((GLenum) GL_FRONT_AND_BACK, (GLenum) GL_POINT);
- break;
- }
- }
-}
-
-void
-OpenGLSurfaceEvaluator::bgnline(void)
-{
- if(output_triangles)
- bezierPatchMeshBeginStrip(global_bpm, GL_LINE_STRIP);
- else
- glBegin((GLenum) GL_LINE_STRIP);
-}
-
-void
-OpenGLSurfaceEvaluator::endline(void)
-{
- if(output_triangles)
- bezierPatchMeshEndStrip(global_bpm);
- else
- glEnd();
-}
-
-void
-OpenGLSurfaceEvaluator::range2f(long type, REAL *from, REAL *to)
-{
-}
-
-void
-OpenGLSurfaceEvaluator::domain2f(REAL ulo, REAL uhi, REAL vlo, REAL vhi)
-{
-}
-
-void
-OpenGLSurfaceEvaluator::bgnclosedline(void)
-{
- if(output_triangles)
- bezierPatchMeshBeginStrip(global_bpm, GL_LINE_LOOP);
- else
- glBegin((GLenum) GL_LINE_LOOP);
-}
-
-void
-OpenGLSurfaceEvaluator::endclosedline(void)
-{
- if(output_triangles)
- bezierPatchMeshEndStrip(global_bpm);
- else
- glEnd();
-}
-
-
-
-
-
-void
-OpenGLSurfaceEvaluator::bgntmesh(void)
-{
-
- tmeshing = 1;
- which = 0;
- vcount = 0;
-
- if(output_triangles)
- bezierPatchMeshBeginStrip(global_bpm, GL_TRIANGLES);
- else
- glBegin((GLenum) GL_TRIANGLES);
-
-}
-
-void
-OpenGLSurfaceEvaluator::swaptmesh(void)
-{
- which = 1 - which;
-
-}
-
-void
-OpenGLSurfaceEvaluator::endtmesh(void)
-{
- tmeshing = 0;
-
-
- if(output_triangles)
- bezierPatchMeshEndStrip(global_bpm);
- else
- glEnd();
-}
-
-void
-OpenGLSurfaceEvaluator::bgntfan(void)
-{
-
- if(output_triangles)
- bezierPatchMeshBeginStrip(global_bpm, GL_TRIANGLE_FAN);
- else
- glBegin((GLenum) GL_TRIANGLE_FAN);
-
-}
-void
-OpenGLSurfaceEvaluator::endtfan(void)
-{
- if(output_triangles)
- bezierPatchMeshEndStrip(global_bpm);
- else
- glEnd();
-}
-
-void
-OpenGLSurfaceEvaluator::evalUStrip(int n_upper, REAL v_upper, REAL* upper_val, int n_lower, REAL v_lower, REAL* lower_val)
-{
-#ifdef USE_INTERNAL_EVAL
- inEvalUStrip(n_upper, v_upper, upper_val,
- n_lower, v_lower, lower_val);
-#else
-
-#ifdef FOR_CHRIS
- evalUStripExt(n_upper, v_upper, upper_val,
- n_lower, v_lower, lower_val);
- return;
-
-#endif
- int i,j,k,l;
- REAL leftMostV[2];
-
- /*
- *the algorithm works by scanning from left to right.
- *leftMostV: the left most of the remaining verteces (on both upper and lower).
- * it could an element of upperVerts or lowerVerts.
- *i: upperVerts[i] is the first vertex to the right of leftMostV on upper line
- *j: lowerVerts[j] is the first vertex to the right of leftMostV on lower line
- */
-
- /*initialize i,j,and leftMostV
- */
- if(upper_val[0] <= lower_val[0])
- {
- i=1;
- j=0;
-
- leftMostV[0] = upper_val[0];
- leftMostV[1] = v_upper;
- }
- else
- {
- i=0;
- j=1;
-
- leftMostV[0] = lower_val[0];
- leftMostV[1] = v_lower;
-
- }
-
- /*the main loop.
- *the invariance is that:
- *at the beginning of each loop, the meaning of i,j,and leftMostV are
- *maintained
- */
- while(1)
- {
- if(i >= n_upper) /*case1: no more in upper*/
- {
- if(j<n_lower-1) /*at least two vertices in lower*/
- {
- bgntfan();
- coord2f(leftMostV[0], leftMostV[1]);
-// glNormal3fv(leftMostNormal);
-// glVertex3fv(leftMostXYZ);
-
- while(j<n_lower){
- coord2f(lower_val[j], v_lower);
-// glNormal3fv(lowerNormal[j]);
-// glVertex3fv(lowerXYZ[j]);
- j++;
-
- }
- endtfan();
- }
- break; /*exit the main loop*/
- }
- else if(j>= n_lower) /*case2: no more in lower*/
- {
- if(i<n_upper-1) /*at least two vertices in upper*/
- {
- bgntfan();
- coord2f(leftMostV[0], leftMostV[1]);
-// glNormal3fv(leftMostNormal);
-// glVertex3fv(leftMostXYZ);
-
- for(k=n_upper-1; k>=i; k--) /*reverse order for two-side lighting*/
- {
- coord2f(upper_val[k], v_upper);
-// glNormal3fv(upperNormal[k]);
-// glVertex3fv(upperXYZ[k]);
- }
-
- endtfan();
- }
- break; /*exit the main loop*/
- }
- else /* case3: neither is empty, plus the leftMostV, there is at least one triangle to output*/
- {
- if(upper_val[i] <= lower_val[j])
- {
- bgntfan();
- coord2f(lower_val[j], v_lower);
-// glNormal3fv(lowerNormal[j]);
-// glVertex3fv(lowerXYZ[j]);
-
- /*find the last k>=i such that
- *upperverts[k][0] <= lowerverts[j][0]
- */
- k=i;
-
- while(k<n_upper)
- {
- if(upper_val[k] > lower_val[j])
- break;
- k++;
-
- }
- k--;
-
-
- for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/
- {
- coord2f(upper_val[l], v_upper);
-// glNormal3fv(upperNormal[l]);
-// glVertex3fv(upperXYZ[l]);
-
- }
- coord2f(leftMostV[0], leftMostV[1]);
-// glNormal3fv(leftMostNormal);
-// glVertex3fv(leftMostXYZ);
-
- endtfan();
-
- /*update i and leftMostV for next loop
- */
- i = k+1;
-
- leftMostV[0] = upper_val[k];
- leftMostV[1] = v_upper;
-// leftMostNormal = upperNormal[k];
-// leftMostXYZ = upperXYZ[k];
- }
- else /*upperVerts[i][0] > lowerVerts[j][0]*/
- {
- bgntfan();
- coord2f(upper_val[i], v_upper);
-// glNormal3fv(upperNormal[i]);
-// glVertex3fv(upperXYZ[i]);
-
- coord2f(leftMostV[0], leftMostV[1]);
-// glNormal3fv(leftMostNormal);
-// glVertex3fv(leftMostXYZ);
-
-
- /*find the last k>=j such that
- *lowerverts[k][0] < upperverts[i][0]
- */
- k=j;
- while(k< n_lower)
- {
- if(lower_val[k] >= upper_val[i])
- break;
- coord2f(lower_val[k], v_lower);
-// glNormal3fv(lowerNormal[k]);
-// glVertex3fv(lowerXYZ[k]);
-
- k++;
- }
- endtfan();
-
- /*update j and leftMostV for next loop
- */
- j=k;
- leftMostV[0] = lower_val[j-1];
- leftMostV[1] = v_lower;
-
-// leftMostNormal = lowerNormal[j-1];
-// leftMostXYZ = lowerXYZ[j-1];
- }
- }
- }
- //clean up
-// free(upperXYZ);
-// free(lowerXYZ);
-// free(upperNormal);
-// free(lowerNormal);
-#endif
-
-}
-
-
-void
-OpenGLSurfaceEvaluator::evalVStrip(int n_left, REAL u_left, REAL* left_val, int n_right, REAL u_right, REAL* right_val)
-{
-#ifdef USE_INTERNAL_EVAL
- inEvalVStrip(n_left, u_left, left_val,
- n_right, u_right, right_val);
-#else
-
-#ifdef FOR_CHRIS
- evalVStripExt(n_left, u_left, left_val,
- n_right, u_right, right_val);
- return;
-
-#endif
-
- int i,j,k,l;
- REAL botMostV[2];
- /*
- *the algorithm works by scanning from bot to top.
- *botMostV: the bot most of the remaining verteces (on both left and right).
- * it could an element of leftVerts or rightVerts.
- *i: leftVerts[i] is the first vertex to the top of botMostV on left line
- *j: rightVerts[j] is the first vertex to the top of botMostV on rightline
- */
-
- /*initialize i,j,and botMostV
- */
- if(left_val[0] <= right_val[0])
- {
- i=1;
- j=0;
-
- botMostV[0] = u_left;
- botMostV[1] = left_val[0];
- }
- else
- {
- i=0;
- j=1;
-
- botMostV[0] = u_right;
- botMostV[1] = right_val[0];
- }
-
- /*the main loop.
- *the invariance is that:
- *at the beginning of each loop, the meaning of i,j,and botMostV are
- *maintained
- */
- while(1)
- {
- if(i >= n_left) /*case1: no more in left*/
- {
- if(j<n_right-1) /*at least two vertices in right*/
- {
- bgntfan();
- coord2f(botMostV[0], botMostV[1]);
- while(j<n_right){
- coord2f(u_right, right_val[j]);
-// glNormal3fv(rightNormal[j]);
-// glVertex3fv(rightXYZ[j]);
- j++;
-
- }
- endtfan();
- }
- break; /*exit the main loop*/
- }
- else if(j>= n_right) /*case2: no more in right*/
- {
- if(i<n_left-1) /*at least two vertices in left*/
- {
- bgntfan();
- coord2f(botMostV[0], botMostV[1]);
-// glNormal3fv(botMostNormal);
-// glVertex3fv(botMostXYZ);
-
- for(k=n_left-1; k>=i; k--) /*reverse order for two-side lighting*/
- {
- coord2f(u_left, left_val[k]);
-// glNormal3fv(leftNormal[k]);
-// glVertex3fv(leftXYZ[k]);
- }
-
- endtfan();
- }
- break; /*exit the main loop*/
- }
- else /* case3: neither is empty, plus the botMostV, there is at least one triangle to output*/
- {
- if(left_val[i] <= right_val[j])
- {
- bgntfan();
- coord2f(u_right, right_val[j]);
-// glNormal3fv(rightNormal[j]);
-// glVertex3fv(rightXYZ[j]);
-
- /*find the last k>=i such that
- *leftverts[k][0] <= rightverts[j][0]
- */
- k=i;
-
- while(k<n_left)
- {
- if(left_val[k] > right_val[j])
- break;
- k++;
-
- }
- k--;
-
-
- for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/
- {
- coord2f(u_left, left_val[l]);
-// glNormal3fv(leftNormal[l]);
-// glVertex3fv(leftXYZ[l]);
-
- }
- coord2f(botMostV[0], botMostV[1]);
-// glNormal3fv(botMostNormal);
-// glVertex3fv(botMostXYZ);
-
- endtfan();
-
- /*update i and botMostV for next loop
- */
- i = k+1;
-
- botMostV[0] = u_left;
- botMostV[1] = left_val[k];
-// botMostNormal = leftNormal[k];
-// botMostXYZ = leftXYZ[k];
- }
- else /*left_val[i] > right_val[j])*/
- {
- bgntfan();
- coord2f(u_left, left_val[i]);
-// glNormal3fv(leftNormal[i]);
-// glVertex3fv(leftXYZ[i]);
-
- coord2f(botMostV[0], botMostV[1]);
-// glNormal3fv(botMostNormal);
-// glVertex3fv(botMostXYZ);
-
-
- /*find the last k>=j such that
- *rightverts[k][0] < leftverts[i][0]
- */
- k=j;
- while(k< n_right)
- {
- if(right_val[k] >= left_val[i])
- break;
- coord2f(u_right, right_val[k]);
-// glNormal3fv(rightNormal[k]);
-// glVertex3fv(rightXYZ[k]);
-
- k++;
- }
- endtfan();
-
- /*update j and botMostV for next loop
- */
- j=k;
- botMostV[0] = u_right;
- botMostV[1] = right_val[j-1];
-
-// botMostNormal = rightNormal[j-1];
-// botMostXYZ = rightXYZ[j-1];
- }
- }
- }
- //clean up
-// free(leftXYZ);
-// free(leftNormal);
-// free(rightXYZ);
-// free(rightNormal);
-#endif
-}
-
-
-void
-OpenGLSurfaceEvaluator::bgnqstrip(void)
-{
- if(output_triangles)
- bezierPatchMeshBeginStrip(global_bpm, GL_QUAD_STRIP);
- else
- glBegin((GLenum) GL_QUAD_STRIP);
-
-#ifdef STATISTICS
- STAT_num_of_quad_strips++;
-#endif
-}
-
-void
-OpenGLSurfaceEvaluator::endqstrip(void)
-{
- if(output_triangles)
- bezierPatchMeshEndStrip(global_bpm);
- else
- glEnd();
-
-}
-
-/*-------------------------------------------------------------------------
- * bgnmap2f - preamble to surface definition and evaluations
- *-------------------------------------------------------------------------
- */
-void
-OpenGLSurfaceEvaluator::bgnmap2f(long)
-{
- if(output_triangles)
- {
- /*deallocate the space which may has been
- *allocated by global_bpm previously
- */
- if(global_bpm != NULL) {
- bezierPatchMeshListDelete(global_bpm);
- global_bpm = NULL;
- }
-
-
- /*
- auto_normal_flag = 1; //always output normal in callback mode.
- //we could have used the following code,
- //but Inspector doesn't have gl context
- //before it calls tessellator.
- //this way is temporary.
- */
- //NEWCALLBACK
- //if one of the two normal callback functions are set,
- //then set
- if(normalCallBackN != NULL ||
- normalCallBackData != NULL)
- auto_normal_flag = 1;
- else
- auto_normal_flag = 0;
-
- //initialize so that no maps initially
- vertex_flag = 0;
- normal_flag = 0;
- color_flag = 0;
- texcoord_flag = 0;
-
- /*
- if(glIsEnabled(GL_AUTO_NORMAL) == GL_TRUE)
- auto_normal_flag = 1;
- else if (callback_auto_normal == 1)
- auto_normal_flag = 1;
- else
- auto_normal_flag = 0;
- */
-
- //NEWCALLBACK: no need to worry about gl states when gling clalback
- }
- else
- {
- glPushAttrib((GLbitfield) GL_EVAL_BIT);
-
- /*to avoid side effect, we restor the opengl state for GL_POLYGON_MODE
- */
- glGetIntegerv(GL_POLYGON_MODE, gl_polygon_mode);
- }
-
-}
-
-/*-------------------------------------------------------------------------
- * endmap2f - postamble to a map
- *-------------------------------------------------------------------------
- */
-void
-OpenGLSurfaceEvaluator::endmap2f(void)
-{
-
- if(output_triangles)
- {
- //bezierPatchMeshListDelDeg(global_bpm);
-
- // bezierPatchMeshListEval(global_bpm);
-
- //surfcount++;
- //printf("surfcount=%i\n", surfcount);
- //if(surfcount == 8) exit(0);
-
- inBPMListEvalEM(global_bpm);
-
-
-
-/*
- global_bpm = bezierPatchMeshListReverse(global_bpm);
- {
- float *vertex_array;
- float *normal_array;
- int *length_array;
- int *type_array;
- int num_strips;
- bezierPatchMeshListCollect(global_bpm, &vertex_array, &normal_array, &length_array, &type_array, &num_strips);
- drawStrips(vertex_array, normal_array, length_array, type_array, num_strips);
- free(vertex_array);
- free(normal_array);
- free(length_array);
- free(type_array);
- }
-*/
-
- //bezierPatchMeshListPrint(global_bpm);
- //bezierPatchMeshListDraw(global_bpm);
-
-// printf("num triangles=%i\n", bezierPatchMeshListNumTriangles(global_bpm));
-
-#ifdef USE_LOD
-#else
- bezierPatchMeshListDelete(global_bpm);
- global_bpm = NULL;
-#endif
-
- }
-else
- {
-#ifndef USE_LOD
-glPopAttrib();
-#endif
-
-#ifdef STATISTICS
- fprintf(stderr, "num_vertices=%i,num_triangles=%i,num_quads_strips=%i\n", STAT_num_of_eval_vertices,STAT_num_of_triangles,STAT_num_of_quad_strips);
-#endif
-
- /*to restore the gl_polygon_mode
- */
-#ifndef USE_LOD
- glPolygonMode( GL_FRONT, (GLenum) gl_polygon_mode[0]);
- glPolygonMode( GL_BACK, (GLenum) gl_polygon_mode[1]);
-#endif
-}
-
-}
-
-/*-------------------------------------------------------------------------
- * map2f - pass a desription of a surface map
- *-------------------------------------------------------------------------
- */
-void
-OpenGLSurfaceEvaluator::map2f(
- long _type,
- REAL _ulower, /* u lower domain coord */
- REAL _uupper, /* u upper domain coord */
- long _ustride, /* interpoint distance */
- long _uorder, /* parametric order */
- REAL _vlower, /* v lower domain coord */
- REAL _vupper, /* v upper domain coord */
- long _vstride, /* interpoint distance */
- long _vorder, /* parametric order */
- REAL *pts) /* control points */
-{
-#ifdef USE_INTERNAL_EVAL
- inMap2f((int) _type, (REAL) _ulower, (REAL) _uupper,
- (int) _ustride, (int) _uorder, (REAL) _vlower,
- (REAL) _vupper, (int) _vstride, (int) _vorder,
- (REAL *) pts);
-#else
-
-
-
- if(output_triangles)
- {
- if(global_bpm == NULL)
- global_bpm = bezierPatchMeshMake2(10,10);
- if(
- (global_bpm->bpatch == NULL &&
- (_type == GL_MAP2_VERTEX_3 || _type == GL_MAP2_VERTEX_4))
- ||
- (global_bpm->bpatch_normal == NULL &&
- (_type == GL_MAP2_NORMAL))
- ||
- (global_bpm->bpatch_color == NULL &&
- (_type == GL_MAP2_INDEX || _type == GL_MAP2_COLOR_4))
- ||
- (global_bpm->bpatch_texcoord == NULL &&
- (_type == GL_MAP2_TEXTURE_COORD_1 ||
- _type == GL_MAP2_TEXTURE_COORD_2 ||
- _type == GL_MAP2_TEXTURE_COORD_3 ||
- _type == GL_MAP2_TEXTURE_COORD_4 )
- ))
- {
- bezierPatchMeshPutPatch(global_bpm, (int) _type, _ulower, _uupper,(int) _ustride,(int) _uorder,_vlower, _vupper, (int) _vstride, (int) _vorder, pts);
- }
- else /*new surface patch (with multiple maps) starts*/
- {
- bezierPatchMesh *temp = bezierPatchMeshMake2(10,10);
- bezierPatchMeshPutPatch(temp, (int) _type, _ulower, _uupper,(int) _ustride,(int) _uorder,_vlower, _vupper, (int) _vstride, (int) _vorder, pts);
- global_bpm = bezierPatchMeshListInsert(global_bpm, temp);
-
- /*
- global_bpm = bezierPatchMeshListInsert(global_bpm,
- bezierPatchMeshMake(
- (int) _type, _ulower, _uupper,(int) _ustride, (int) _uorder, _vlower, _vupper, (int) _vstride, (int) _vorder, pts, 10, 10));
- */
- }
- }
- else /*not output triangles*/
- {
- glMap2f((GLenum) _type, (GLfloat) _ulower, (GLfloat) _uupper,
- (GLint) _ustride, (GLint) _uorder, (GLfloat) _vlower,
- (GLfloat) _vupper, (GLint) _vstride, (GLint) _vorder,
- (const GLfloat *) pts);
- }
-
-#endif
-}
-
-
-/*-------------------------------------------------------------------------
- * mapmesh2f - evaluate a mesh of points on lattice
- *-------------------------------------------------------------------------
- */
-void
-OpenGLSurfaceEvaluator::mapmesh2f(long style, long umin, long umax, long vmin, long vmax)
-{
-#ifdef NO_EVALUATION
-return;
-#endif
-
-#ifdef USE_INTERNAL_EVAL
- inEvalMesh2((int)umin, (int)vmin, (int)umax, (int)vmax);
-#else
-
-
-
-if(output_triangles)
-{
-#ifdef USE_LOD
- bezierPatchMeshBeginStrip(global_bpm, GL_POLYGON);
- bezierPatchMeshInsertUV(global_bpm, global_grid_u0, global_grid_v0);
- bezierPatchMeshInsertUV(global_bpm, global_grid_u1, global_grid_v1);
- bezierPatchMeshInsertUV(global_bpm, (REAL)global_grid_nu, (REAL)global_grid_nv);
- bezierPatchMeshInsertUV(global_bpm, (REAL)umin, (REAL)vmin);
- bezierPatchMeshInsertUV(global_bpm, (REAL)umax, (REAL)vmax);
- bezierPatchMeshEndStrip(global_bpm);
-
-#else
-
- REAL du, dv;
- long i,j;
- long row;
- if(global_grid_nu == 0 || global_grid_nv == 0)
- return; /*no points need to be output*/
- du = (global_grid_u1 - global_grid_u0) / (REAL)global_grid_nu;
- dv = (global_grid_v1 - global_grid_v0) / (REAL)global_grid_nv;
-
- if(global_grid_nu >= global_grid_nv){
-
- for(i=umin; i<umax; i++){
- REAL u1 = (i==global_grid_nu)? global_grid_u1:(global_grid_u0 + i*du);
- REAL u2 = ((i+1) == global_grid_nu)? global_grid_u1: (global_grid_u0+(i+1)*du);
-
- bgnqstrip();
- for(j=vmax; j>=vmin; j--){
- REAL v1 = (j == global_grid_nv)? global_grid_v1: (global_grid_v0 +j*dv);
-
- coord2f(u1, v1);
- coord2f(u2, v1);
- }
- endqstrip();
- }
- }
- else{
-
- for(i=vmin; i<vmax; i++){
- REAL v1 = (i==global_grid_nv)? global_grid_v1:(global_grid_v0 + i*dv);
- REAL v2 = ((i+1) == global_grid_nv)? global_grid_v1: (global_grid_v0+(i+1)*dv);
-
- bgnqstrip();
- for(j=umax; j>=umin; j--){
- REAL u1 = (j == global_grid_nu)? global_grid_u1: (global_grid_u0 +j*du);
- coord2f(u1, v2);
- coord2f(u1, v1);
- }
- endqstrip();
- }
- }
-#endif
-}
-else
-{
- switch(style) {
- default:
- case N_MESHFILL:
- glEvalMesh2((GLenum) GL_FILL, (GLint) umin, (GLint) umax,
- (GLint) vmin, (GLint) vmax);
- break;
- case N_MESHLINE:
- glEvalMesh2((GLenum) GL_LINE, (GLint) umin, (GLint) umax,
- (GLint) vmin, (GLint) vmax);
- break;
- case N_MESHPOINT:
- glEvalMesh2((GLenum) GL_POINT, (GLint) umin, (GLint) umax,
- (GLint) vmin, (GLint) vmax);
- break;
- }
- }
-
-#endif
-
-#ifdef STATISTICS
- STAT_num_of_quad_strips += (umax-umin)*(vmax-vmin);
-#endif
-}
-
-/*-------------------------------------------------------------------------
- * evalcoord2f - evaluate a point on a surface
- *-------------------------------------------------------------------------
- */
-void
-OpenGLSurfaceEvaluator::evalcoord2f(long, REAL u, REAL v)
-{
-
-
-#ifdef NO_EVALUATION
-return;
-#endif
-
-
- newtmeshvert(u, v);
-}
-
-/*-------------------------------------------------------------------------
- * evalpoint2i - evaluate a grid point
- *-------------------------------------------------------------------------
- */
-void
-OpenGLSurfaceEvaluator::evalpoint2i(long u, long v)
-{
-#ifdef NO_EVALUATION
-return;
-#endif
-
- newtmeshvert(u, v);
-}
-
-void
-OpenGLSurfaceEvaluator::point2i( long u, long v )
-{
-#ifdef NO_EVALUATION
-return;
-#else
-
-#ifdef USE_INTERNAL_EVAL
- inEvalPoint2( (int)u, (int)v);
-#else
-
-
-if(output_triangles)
-{
-
- REAL du, dv;
- REAL fu,fv;
- du = (global_grid_u1 - global_grid_u0) / (REAL)global_grid_nu;
- dv = (global_grid_v1 - global_grid_v0) / (REAL)global_grid_nv;
- fu = (u==global_grid_nu)? global_grid_u1:(global_grid_u0 + u*du);
- fv = (v == global_grid_nv)? global_grid_v1: (global_grid_v0 +v*dv);
- coord2f(fu,fv);
-}
-else
- glEvalPoint2((GLint) u, (GLint) v);
-
-
-#endif
-
-#ifdef STATISTICS
- STAT_num_of_eval_vertices++;
-#endif
-
-#endif
-
-}
-
-void
-OpenGLSurfaceEvaluator::coord2f( REAL u, REAL v )
-{
-#ifdef NO_EVALUATION
-return;
-#else
-
-#ifdef USE_INTERNAL_EVAL
- inEvalCoord2f( u, v);
-#else
-
-
-if(output_triangles)
- bezierPatchMeshInsertUV(global_bpm, u,v);
-else
- glEvalCoord2f((GLfloat) u, (GLfloat) v);
-
-
-#endif
-
-
-#ifdef STATISTICS
- STAT_num_of_eval_vertices++;
-#endif
-
-#endif
-}
-
-void
-OpenGLSurfaceEvaluator::newtmeshvert( long u, long v )
-{
-#ifdef NO_EVALUATION
-return;
-#else
-
- if (tmeshing) {
-
- if (vcount == 2) {
- vertexCache[0]->invoke(this);
- vertexCache[1]->invoke(this);
- point2i( u, v);
-
- } else {
- vcount++;
- }
-
- vertexCache[which]->saveEvalPoint(u, v);
- which = 1 - which;
- } else {
- point2i( u, v);
- }
-#endif
-}
-
-void
-OpenGLSurfaceEvaluator::newtmeshvert( REAL u, REAL v )
-{
-#ifdef NO_EVALUATION
-return;
-#else
- if (tmeshing) {
-
-
- if (vcount == 2) {
- vertexCache[0]->invoke(this);
- vertexCache[1]->invoke(this);
- coord2f(u,v);
-
- } else {
- vcount++;
- }
-
- vertexCache[which]->saveEvalCoord(u, v);
- which = 1 - which;
- } else {
-
- coord2f( u, v);
- }
-#endif
-
-}
-
-void
-OpenGLSurfaceEvaluator::putCallBack(GLenum which, GLvoid (GLAPIENTRY *fn)(...))
-{
- switch(which)
- {
- case GLU_NURBS_BEGIN:
- beginCallBackN = (void (GLAPIENTRY *) (GLenum)) fn;
- break;
- case GLU_NURBS_END:
- endCallBackN = (void (GLAPIENTRY *) (void)) fn;
- break;
- case GLU_NURBS_VERTEX:
- vertexCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn;
- break;
- case GLU_NURBS_NORMAL:
- normalCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn;
- break;
- case GLU_NURBS_COLOR:
- colorCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn;
- break;
- case GLU_NURBS_TEXTURE_COORD:
- texcoordCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn;
- break;
- case GLU_NURBS_BEGIN_DATA:
- beginCallBackData = (void (GLAPIENTRY *) (GLenum, void*)) fn;
- break;
- case GLU_NURBS_END_DATA:
- endCallBackData = (void (GLAPIENTRY *) (void*)) fn;
- break;
- case GLU_NURBS_VERTEX_DATA:
- vertexCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn;
- break;
- case GLU_NURBS_NORMAL_DATA:
- normalCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn;
- break;
- case GLU_NURBS_COLOR_DATA:
- colorCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn;
- break;
- case GLU_NURBS_TEXTURE_COORD_DATA:
- texcoordCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn;
- break;
-
- }
-}
-
-
-void
-OpenGLSurfaceEvaluator::beginCallBack(GLenum which, void *data)
-{
- if(beginCallBackData)
- beginCallBackData(which, data);
- else if(beginCallBackN)
- beginCallBackN(which);
-}
-
-void
-OpenGLSurfaceEvaluator::endCallBack(void *data)
-{
- if(endCallBackData)
- endCallBackData(data);
- else if(endCallBackN)
- endCallBackN();
-}
-
-void
-OpenGLSurfaceEvaluator::vertexCallBack(const GLfloat *vert, void* data)
-{
- if(vertexCallBackData)
- vertexCallBackData(vert, data);
- else if(vertexCallBackN)
- vertexCallBackN(vert);
-}
-
-
-void
-OpenGLSurfaceEvaluator::normalCallBack(const GLfloat *normal, void* data)
-{
- if(normalCallBackData)
- normalCallBackData(normal, data);
- else if(normalCallBackN)
- normalCallBackN(normal);
-}
-
-void
-OpenGLSurfaceEvaluator::colorCallBack(const GLfloat *color, void* data)
-{
- if(colorCallBackData)
- colorCallBackData(color, data);
- else if(colorCallBackN)
- colorCallBackN(color);
-}
-
-void
-OpenGLSurfaceEvaluator::texcoordCallBack(const GLfloat *texcoord, void* data)
-{
- if(texcoordCallBackData)
- texcoordCallBackData(texcoord, data);
- else if(texcoordCallBackN)
- texcoordCallBackN(texcoord);
-}
-
-
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glsurfeval.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glsurfeval.h
deleted file mode 100755
index f2ff67391..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glsurfeval.h
+++ /dev/null
@@ -1,404 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * glsurfeval.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Attic/glsurfeval.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gluglsurfeval_h_
-#define __gluglsurfeval_h_
-
-#include "basicsurfeval.h"
-#include "bezierPatchMesh.h" //in case output triangles
-#include "GL/gl.h"
-
-class SurfaceMap;
-class OpenGLSurfaceEvaluator;
-class StoredVertex;
-
-#define TYPECOORD 1
-#define TYPEPOINT 2
-
-/* Cache up to 3 vertices from tmeshes */
-#define VERTEX_CACHE_SIZE 3
-
-/*for internal evaluator callback stuff*/
-#ifndef IN_MAX_BEZIER_ORDER
-#define IN_MAX_BEZIER_ORDER 40 /*XXX should be bigger than machine order*/
-#endif
-
-#ifndef IN_MAX_DIMENSION
-#define IN_MAX_DIMENSION 4
-#endif
-
-typedef struct surfEvalMachine{
- REAL uprime;//cached previusly evaluated uprime.
- REAL vprime;
- int k; /*the dimension*/
- REAL u1;
- REAL u2;
- int ustride;
- int uorder;
- REAL v1;
- REAL v2;
- int vstride;
- int vorder;
- REAL ctlPoints[IN_MAX_BEZIER_ORDER*IN_MAX_BEZIER_ORDER*IN_MAX_DIMENSION];
- REAL ucoeff[IN_MAX_BEZIER_ORDER]; /*cache the polynomial values*/
- REAL vcoeff[IN_MAX_BEZIER_ORDER];
- REAL ucoeffDeriv[IN_MAX_BEZIER_ORDER]; /*cache the polynomial derivatives*/
- REAL vcoeffDeriv[IN_MAX_BEZIER_ORDER];
-} surfEvalMachine;
-
-
-
-class StoredVertex {
-public:
- StoredVertex() { type = 0; }
- ~StoredVertex(void) {}
- void saveEvalCoord(REAL x, REAL y)
- {coord[0] = x; coord[1] = y; type = TYPECOORD; }
- void saveEvalPoint(long x, long y)
- {point[0] = x; point[1] = y; type = TYPEPOINT; }
- void invoke(OpenGLSurfaceEvaluator *eval);
-
-private:
- int type;
- REAL coord[2];
- long point[2];
-};
-
-class OpenGLSurfaceEvaluator : public BasicSurfaceEvaluator {
-public:
- OpenGLSurfaceEvaluator();
- ~OpenGLSurfaceEvaluator( void );
- void polymode( long style );
- void range2f( long, REAL *, REAL * );
- void domain2f( REAL, REAL, REAL, REAL );
- void addMap( SurfaceMap * ) { }
-
- void enable( long );
- void disable( long );
- void bgnmap2f( long );
- void map2f( long, REAL, REAL, long, long,
- REAL, REAL, long, long, REAL * );
- void mapgrid2f( long, REAL, REAL, long, REAL, REAL );
- void mapmesh2f( long, long, long, long, long );
- void evalcoord2f( long, REAL, REAL );
- void evalpoint2i( long, long );
- void endmap2f( void );
-
- void bgnline( void );
- void endline( void );
- void bgnclosedline( void );
- void endclosedline( void );
- void bgntmesh( void );
- void swaptmesh( void );
- void endtmesh( void );
- void bgnqstrip( void );
- void endqstrip( void );
-
- void bgntfan( void );
- void endtfan( void );
- void evalUStrip(int n_upper, REAL v_upper, REAL* upper_val,
- int n_lower, REAL v_lower, REAL* lower_val);
- void evalVStrip(int n_left, REAL u_left, REAL* left_val,
- int n_right, REAL u_right, REAL* right_val);
-
- void coord2f( REAL, REAL );
- void point2i( long, long );
-
- void newtmeshvert( REAL, REAL );
- void newtmeshvert( long, long );
-
- void putCallBack(GLenum which, GLvoid (GLAPIENTRY *fn)(...));
- int get_vertices_call_back()
- {
- return output_triangles;
- }
- void put_vertices_call_back(int flag)
- {
- output_triangles = flag;
- }
-
- void put_callback_auto_normal(int flag)
- {
- callback_auto_normal = flag;
- }
-
- int get_callback_auto_normal()
- {
- return callback_auto_normal;
- }
-
- void set_callback_userData(void* data)
- {
- userData = data;
- }
-
- /**************begin for LOD_eval_list***********/
- void LOD_eval_list(int level);
-
-
-
-
-private:
- StoredVertex *vertexCache[VERTEX_CACHE_SIZE];
- int tmeshing;
- int which;
- int vcount;
-
- GLint gl_polygon_mode[2];/*to save and restore so that
- *no side effect
- */
- bezierPatchMesh *global_bpm; //for output triangles
- int output_triangles; //true 1 or false 0
-
-
-
- void (GLAPIENTRY *beginCallBackN) (GLenum type);
- void (GLAPIENTRY *endCallBackN) (void);
- void (GLAPIENTRY *vertexCallBackN) (const GLfloat *vert);
- void (GLAPIENTRY *normalCallBackN) (const GLfloat *normal);
- void (GLAPIENTRY *colorCallBackN) (const GLfloat *color);
- void (GLAPIENTRY *texcoordCallBackN) (const GLfloat *texcoord);
-
- void (GLAPIENTRY *beginCallBackData) (GLenum type, void* data);
- void (GLAPIENTRY *endCallBackData) (void* data);
- void (GLAPIENTRY *vertexCallBackData) (const GLfloat *vert, void* data);
- void (GLAPIENTRY *normalCallBackData) (const GLfloat *normal, void* data);
- void (GLAPIENTRY *colorCallBackData) (const GLfloat *color, void* data);
- void (GLAPIENTRY *texcoordCallBackData) (const GLfloat *texcoord, void* data);
-
- void beginCallBack (GLenum type, void* data);
- void endCallBack (void* data);
- void vertexCallBack (const GLfloat *vert, void* data);
- void normalCallBack (const GLfloat *normal, void* data);
- void colorCallBack (const GLfloat *color, void* data);
- void texcoordCallBack (const GLfloat *texcoord, void* data);
-
-
- void* userData; //the opaque pointer for Data callback functions.
-
- /*LOD evaluation*/
- void LOD_triangle(REAL A[2], REAL B[2], REAL C[2],
- int level);
- void LOD_eval(int num_vert, REAL* verts, int type, int level);
-
- int LOD_eval_level; //set by LOD_eval_list()
-
- /*************begin for internal evaluators*****************/
-
- /*the following global variables are only defined in this file.
- *They are used to cache the precomputed Bezier polynomial values.
- *These calues may be used consecutively in which case we don't have
- *recompute these values again.
- */
- int global_uorder; /*store the uorder in the previous evaluation*/
- int global_vorder; /*store the vorder in the previous evaluation*/
- REAL global_uprime;
- REAL global_vprime;
- REAL global_vprime_BV;
- REAL global_uprime_BU;
- int global_uorder_BV; /*store the uorder in the previous evaluation*/
- int global_vorder_BV; /*store the vorder in the previous evaluation*/
- int global_uorder_BU; /*store the uorder in the previous evaluation*/
- int global_vorder_BU; /*store the vorder in the previous evaluation*/
-
- REAL global_ucoeff[IN_MAX_BEZIER_ORDER]; /*cache the polynomial values*/
- REAL global_vcoeff[IN_MAX_BEZIER_ORDER];
- REAL global_ucoeffDeriv[IN_MAX_BEZIER_ORDER]; /*cache the polynomial derivatives*/
- REAL global_vcoeffDeriv[IN_MAX_BEZIER_ORDER];
-
- REAL global_BV[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION];
- REAL global_PBV[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION];
- REAL global_BU[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION];
- REAL global_PBU[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION];
- REAL* global_baseData;
-
- int global_ev_k; /*the dimension*/
- REAL global_ev_u1;
- REAL global_ev_u2;
- int global_ev_ustride;
- int global_ev_uorder;
- REAL global_ev_v1;
- REAL global_ev_v2;
- int global_ev_vstride;
- int global_ev_vorder;
- REAL global_ev_ctlPoints[IN_MAX_BEZIER_ORDER*IN_MAX_BEZIER_ORDER*IN_MAX_DIMENSION];
-
- REAL global_grid_u0;
- REAL global_grid_u1;
- int global_grid_nu;
- REAL global_grid_v0;
- REAL global_grid_v1;
- int global_grid_nv;
-
-/*functions*/
- void inDoDomain2WithDerivs(int k, REAL u, REAL v,
- REAL u1, REAL u2, int uorder,
- REAL v1, REAL v2, int vorder,
- REAL *baseData,
- REAL *retPoint, REAL *retdu, REAL *retdv);
- void inPreEvaluate(int order, REAL vprime, REAL *coeff);
- void inPreEvaluateWithDeriv(int order, REAL vprime, REAL *coeff, REAL *coeffDeriv);
- void inComputeFirstPartials(REAL *p, REAL *pu, REAL *pv);
- void inComputeNormal2(REAL *pu, REAL *pv, REAL *n);
- void inDoEvalCoord2(REAL u, REAL v,
- REAL *retPoint, REAL *retNormal);
- void inDoEvalCoord2NOGE(REAL u, REAL v,
- REAL *retPoint, REAL *retNormal);
- void inMap2f(int k,
- REAL ulower,
- REAL uupper,
- int ustride,
- int uorder,
- REAL vlower,
- REAL vupper,
- int vstride,
- int vorder,
- REAL *ctlPoints);
-
- void inMapGrid2f(int nu, REAL u0, REAL u1,
- int nv, REAL v0, REAL v1);
-
- void inEvalMesh2(int lowU, int lowV, int highU, int highV);
- void inEvalPoint2(int i, int j);
- void inEvalCoord2f(REAL u, REAL v);
-
-void inEvalULine(int n_points, REAL v, REAL* u_vals,
- int stride, REAL ret_points[][3], REAL ret_normals[][3]);
-
-void inEvalVLine(int n_points, REAL u, REAL* v_vals,
- int stride, REAL ret_points[][3], REAL ret_normals[][3]);
-
-void inEvalUStrip(int n_upper, REAL v_upper, REAL* upper_val,
- int n_lower, REAL v_lower, REAL* lower_val
- );
-void inEvalVStrip(int n_left, REAL u_left, REAL* left_val, int n_right, REAL u_right, REAL* right_val);
-
-void inPreEvaluateBV(int k, int uorder, int vorder, REAL vprime, REAL *baseData);
-void inPreEvaluateBU(int k, int uorder, int vorder, REAL uprime, REAL *baseData);
-void inPreEvaluateBV_intfac(REAL v )
- {
- inPreEvaluateBV(global_ev_k, global_ev_uorder, global_ev_vorder, (v-global_ev_v1)/(global_ev_v2-global_ev_v1), global_ev_ctlPoints);
- }
-
-void inPreEvaluateBU_intfac(REAL u)
- {
- inPreEvaluateBU(global_ev_k, global_ev_uorder, global_ev_vorder, (u-global_ev_u1)/(global_ev_u2-global_ev_u1), global_ev_ctlPoints);
- }
-
-void inDoDomain2WithDerivsBV(int k, REAL u, REAL v,
- REAL u1, REAL u2, int uorder,
- REAL v1, REAL v2, int vorder,
- REAL *baseData,
- REAL *retPoint, REAL* retdu, REAL *retdv);
-
-void inDoDomain2WithDerivsBU(int k, REAL u, REAL v,
- REAL u1, REAL u2, int uorder,
- REAL v1, REAL v2, int vorder,
- REAL *baseData,
- REAL *retPoint, REAL* retdu, REAL *retdv);
-
-
-void inDoEvalCoord2NOGE_BV(REAL u, REAL v,
- REAL *retPoint, REAL *retNormal);
-
-void inDoEvalCoord2NOGE_BU(REAL u, REAL v,
- REAL *retPoint, REAL *retNormal);
-
-void inBPMEval(bezierPatchMesh* bpm);
-void inBPMListEval(bezierPatchMesh* list);
-
-/*-------------begin for surfEvalMachine -------------*/
-surfEvalMachine em_vertex;
-surfEvalMachine em_normal;
-surfEvalMachine em_color;
-surfEvalMachine em_texcoord;
-
-int auto_normal_flag; //whether to output normla or not in callback
- //determined by GL_AUTO_NORMAL and callback_auto_normal
-int callback_auto_normal; //GLU_CALLBACK_AUTO_NORMAL_EXT
-int vertex_flag;
-int normal_flag;
-int color_flag;
-int texcoord_flag;
-
-void inMap2fEM(int which, //0:vert,1:norm,2:color,3:tex
- int dimension,
- REAL ulower,
- REAL uupper,
- int ustride,
- int uorder,
- REAL vlower,
- REAL vupper,
- int vstride,
- int vorder,
- REAL *ctlPoints);
-
-void inDoDomain2WithDerivsEM(surfEvalMachine *em, REAL u, REAL v,
- REAL *retPoint, REAL *retdu, REAL *retdv);
-void inDoDomain2EM(surfEvalMachine *em, REAL u, REAL v,
- REAL *retPoint);
- void inDoEvalCoord2EM(REAL u, REAL v);
-
-void inBPMEvalEM(bezierPatchMesh* bpm);
-void inBPMListEvalEM(bezierPatchMesh* list);
-
-/*-------------end for surfEvalMachine -------------*/
-
-
- /*************end for internal evaluators*****************/
-
-};
-
-inline void StoredVertex::invoke(OpenGLSurfaceEvaluator *eval)
-{
- switch(type) {
- case TYPECOORD:
- eval->coord2f(coord[0], coord[1]);
- break;
- case TYPEPOINT:
- eval->point2i(point[0], point[1]);
- break;
- default:
- break;
- }
-}
-
-#endif /* __gluglsurfeval_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/incurveeval.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/incurveeval.cc
deleted file mode 100755
index ed87a1a3c..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/incurveeval.cc
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Attic/incurveeval.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "glcurveval.h"
-
-
-/*
- *compute the Bezier polynomials C[n,j](v) for all j at v with
- *return values stored in coeff[], where
- * C[n,j](v) = (n,j) * v^j * (1-v)^(n-j),
- * j=0,1,2,...,n.
- *order : n+1
- *vprime: v
- *coeff : coeff[j]=C[n,j](v), this array store the returned values.
- *The algorithm is a recursive scheme:
- * C[0,0]=1;
- * C[n,j](v) = (1-v)*C[n-1,j](v) + v*C[n-1,j-1](v), n>=1
- *This code is copied from opengl/soft/so_eval.c:PreEvaluate
- */
-void OpenGLCurveEvaluator::inPreEvaluate(int order, REAL vprime, REAL *coeff)
-{
- int i, j;
- REAL oldval, temp;
- REAL oneMinusvprime;
-
- /*
- * Minor optimization
- * Compute orders 1 and 2 outright, and set coeff[0], coeff[1] to
- * their i==1 loop values to avoid the initialization and the i==1 loop.
- */
- if (order == 1) {
- coeff[0] = 1.0;
- return;
- }
-
- oneMinusvprime = 1-vprime;
- coeff[0] = oneMinusvprime;
- coeff[1] = vprime;
- if (order == 2) return;
-
- for (i = 2; i < order; i++) {
- oldval = coeff[0] * vprime;
- coeff[0] = oneMinusvprime * coeff[0];
- for (j = 1; j < i; j++) {
- temp = oldval;
- oldval = coeff[j] * vprime;
- coeff[j] = temp + oneMinusvprime * coeff[j];
- }
- coeff[j] = oldval;
- }
-}
-
-void OpenGLCurveEvaluator::inMap1f(int which, //0: vert, 1: norm, 2: color, 3: tex
- int k, //dimension
- REAL ulower,
- REAL uupper,
- int ustride,
- int uorder,
- REAL *ctlpoints)
-{
- int i,j,x;
- curveEvalMachine *temp_em;
- switch(which){
- case 0: //vertex
- vertex_flag = 1;
- temp_em = &em_vertex;
- break;
- case 1: //normal
- normal_flag = 1;
- temp_em = &em_normal;
- break;
- case 2: //color
- color_flag = 1;
- temp_em = &em_color;
- break;
- default:
- texcoord_flag = 1;
- temp_em = &em_texcoord;
- break;
- }
-
- REAL *data = temp_em->ctlpoints;
- temp_em->uprime = -1; //initialized
- temp_em->k = k;
- temp_em->u1 = ulower;
- temp_em->u2 = uupper;
- temp_em->ustride = ustride;
- temp_em->uorder = uorder;
- /*copy the control points*/
- for(i=0; i<uorder; i++){
- for(x=0; x<k; x++){
- data[x] = ctlpoints[x];
- }
- ctlpoints += ustride;
- data += k;
- }
-}
-
-void OpenGLCurveEvaluator::inDoDomain1(curveEvalMachine *em, REAL u, REAL *retPoint)
-{
- int j, row;
- REAL the_uprime;
- REAL p;
- REAL *data;
-
- if(em->u2 == em->u1)
- return;
- the_uprime = (u-em->u1) / (em->u2-em->u1);
- /*use already cached values if possible*/
- if(em->uprime != the_uprime){
- inPreEvaluate(em->uorder, the_uprime, em->ucoeff);
- em->uprime = the_uprime;
- }
-
- for(j=0; j<em->k; j++){
- data = em->ctlpoints+j;
- retPoint[j] = 0.0;
- for(row=0; row<em->uorder; row++)
- {
- retPoint[j] += em->ucoeff[row] * (*data);
- data += em->k;
- }
- }
-}
-
-void OpenGLCurveEvaluator::inDoEvalCoord1(REAL u)
-{
- REAL temp_vertex[4];
- REAL temp_normal[3];
- REAL temp_color[4];
- REAL temp_texcoord[4];
- if(texcoord_flag) //there is a texture map
- {
- inDoDomain1(&em_texcoord, u, temp_texcoord);
- texcoordCallBack(temp_texcoord, userData);
- }
-#ifdef DEBUG
-printf("color_flag = %i\n", color_flag);
-#endif
- if(color_flag) //there is a color map
- {
- inDoDomain1(&em_color, u, temp_color);
- colorCallBack(temp_color, userData);
- }
- if(normal_flag) //there is a normal map
- {
- inDoDomain1(&em_normal, u, temp_normal);
- normalCallBack(temp_normal, userData);
- }
- if(vertex_flag)
- {
- inDoDomain1(&em_vertex, u, temp_vertex);
- vertexCallBack(temp_vertex, userData);
- }
-}
-
-void OpenGLCurveEvaluator::inMapMesh1f(int umin, int umax)
-{
- REAL du, u;
- int i;
- if(global_grid_nu == 0)
- return; //no points to output
- du = (global_grid_u1 - global_grid_u0) / (REAL) global_grid_nu;
- bgnline();
- for(i=umin; i<= umax; i++){
- u = (i==global_grid_nu)? global_grid_u1: global_grid_u0 + i*du;
- inDoEvalCoord1(u);
- }
- endline();
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/insurfeval.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/insurfeval.cc
deleted file mode 100755
index 8b57f9274..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/insurfeval.cc
+++ /dev/null
@@ -1,2067 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Attic/insurfeval.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include "gluos.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <GL/gl.h>
-#include <math.h>
-#include <assert.h>
-
-#include "glsurfeval.h"
-
-//extern int surfcount;
-
-//#define CRACK_TEST
-
-#define AVOID_ZERO_NORMAL
-
-#ifdef AVOID_ZERO_NORMAL
-#define myabs(x) ((x>0)? x: (-x))
-#define MYZERO 0.000001
-#define MYDELTA 0.001
-#endif
-
-//#define USE_LOD
-#ifdef USE_LOD
-//#define LOD_EVAL_COORD(u,v) inDoEvalCoord2EM(u,v)
-#define LOD_EVAL_COORD(u,v) glEvalCoord2f(u,v)
-
-static void LOD_interpolate(REAL A[2], REAL B[2], REAL C[2], int j, int k, int pow2_level,
- REAL& u, REAL& v)
-{
- REAL a,a1,b,b1;
-
- a = ((REAL) j) / ((REAL) pow2_level);
- a1 = 1-a;
-
- if(j != 0)
- {
- b = ((REAL) k) / ((REAL)j);
- b1 = 1-b;
- }
- REAL x,y,z;
- x = a1;
- if(j==0)
- {
- y=0; z=0;
- }
- else{
- y = b1*a;
- z = b *a;
- }
-
- u = x*A[0] + y*B[0] + z*C[0];
- v = x*A[1] + y*B[1] + z*C[1];
-}
-
-void OpenGLSurfaceEvaluator::LOD_triangle(REAL A[2], REAL B[2], REAL C[2],
- int level)
-{
- int k,j;
- int pow2_level;
- /*compute 2^level*/
- pow2_level = 1;
-
- for(j=0; j<level; j++)
- pow2_level *= 2;
- for(j=0; j<=pow2_level-1; j++)
- {
- REAL u,v;
-
-/* beginCallBack(GL_TRIANGLE_STRIP);*/
-glBegin(GL_TRIANGLE_STRIP);
- LOD_interpolate(A,B,C, j+1, j+1, pow2_level, u,v);
-#ifdef USE_LOD
- LOD_EVAL_COORD(u,v);
-// glEvalCoord2f(u,v);
-#else
- inDoEvalCoord2EM(u,v);
-#endif
-
- for(k=0; k<=j; k++)
- {
- LOD_interpolate(A,B,C,j,j-k,pow2_level, u,v);
-#ifdef USE_LOD
- LOD_EVAL_COORD(u,v);
-// glEvalCoord2f(u,v);
-#else
- inDoEvalCoord2EM(u,v);
-#endif
-
- LOD_interpolate(A,B,C,j+1,j-k,pow2_level, u,v);
-
-#ifdef USE_LOD
- LOD_EVAL_COORD(u,v);
-// glEvalCoord2f(u,v);
-#else
- inDoEvalCoord2EM(u,v);
-#endif
- }
-// endCallBack();
-glEnd();
- }
-}
-
-void OpenGLSurfaceEvaluator::LOD_eval(int num_vert, REAL* verts, int type,
- int level
- )
-{
- int i,k;
- switch(type){
- case GL_TRIANGLE_STRIP:
- case GL_QUAD_STRIP:
- for(i=2, k=4; i<=num_vert-2; i+=2, k+=4)
- {
- LOD_triangle(verts+k-4, verts+k-2, verts+k,
- level
- );
- LOD_triangle(verts+k-2, verts+k+2, verts+k,
- level
- );
- }
- if(num_vert % 2 ==1)
- {
- LOD_triangle(verts+2*(num_vert-3), verts+2*(num_vert-2), verts+2*(num_vert-1),
- level
- );
- }
- break;
- case GL_TRIANGLE_FAN:
- for(i=1, k=2; i<=num_vert-2; i++, k+=2)
- {
- LOD_triangle(verts,verts+k, verts+k+2,
- level
- );
- }
- break;
-
- default:
- fprintf(stderr, "typy not supported in LOD_\n");
- }
-}
-
-
-#endif //USE_LOD
-
-//#define GENERIC_TEST
-#ifdef GENERIC_TEST
-extern float xmin, xmax, ymin, ymax, zmin, zmax; /*bounding box*/
-extern int temp_signal;
-
-static void gTessVertexSphere(float u, float v, float temp_normal[3], float temp_vertex[3])
-{
- float r=2.0;
- float Ox = 0.5*(xmin+xmax);
- float Oy = 0.5*(ymin+ymax);
- float Oz = 0.5*(zmin+zmax);
- float nx = cos(v) * sin(u);
- float ny = sin(v) * sin(u);
- float nz = cos(u);
- float x= Ox+r * nx;
- float y= Oy+r * ny;
- float z= Oz+r * nz;
-
- temp_normal[0] = nx;
- temp_normal[1] = ny;
- temp_normal[2] = nz;
- temp_vertex[0] = x;
- temp_vertex[1] = y;
- temp_vertex[2] = z;
-
-// glNormal3f(nx,ny,nz);
-// glVertex3f(x,y,z);
-}
-
-static void gTessVertexCyl(float u, float v, float temp_normal[3], float temp_vertex[3])
-{
- float r=2.0;
- float Ox = 0.5*(xmin+xmax);
- float Oy = 0.5*(ymin+ymax);
- float Oz = 0.5*(zmin+zmax);
- float nx = cos(v);
- float ny = sin(v);
- float nz = 0;
- float x= Ox+r * nx;
- float y= Oy+r * ny;
- float z= Oz - 2*u;
-
- temp_normal[0] = nx;
- temp_normal[1] = ny;
- temp_normal[2] = nz;
- temp_vertex[0] = x;
- temp_vertex[1] = y;
- temp_vertex[2] = z;
-
-/*
- glNormal3f(nx,ny,nz);
- glVertex3f(x,y,z);
-*/
-}
-
-#endif //GENERIC_TEST
-
-void OpenGLSurfaceEvaluator::inBPMListEval(bezierPatchMesh* list)
-{
- bezierPatchMesh* temp;
- for(temp = list; temp != NULL; temp = temp->next)
- {
- inBPMEval(temp);
- }
-}
-
-void OpenGLSurfaceEvaluator::inBPMEval(bezierPatchMesh* bpm)
-{
- int i,j,k,l;
- float u,v;
-
- int ustride = bpm->bpatch->dimension * bpm->bpatch->vorder;
- int vstride = bpm->bpatch->dimension;
- inMap2f(
- (bpm->bpatch->dimension == 3)? GL_MAP2_VERTEX_3 : GL_MAP2_VERTEX_4,
- bpm->bpatch->umin,
- bpm->bpatch->umax,
- ustride,
- bpm->bpatch->uorder,
- bpm->bpatch->vmin,
- bpm->bpatch->vmax,
- vstride,
- bpm->bpatch->vorder,
- bpm->bpatch->ctlpoints);
-
- bpm->vertex_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3+1); /*in case the origional dimenion is 4, then we need 4 space to pass to evaluator.*/
- assert(bpm->vertex_array);
- bpm->normal_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3);
- assert(bpm->normal_array);
-#ifdef CRACK_TEST
-if( global_ev_u1 ==2 && global_ev_u2 == 3
- && global_ev_v1 ==2 && global_ev_v2 == 3)
-{
-REAL vertex[4];
-REAL normal[4];
-#ifdef DEBUG
-printf("***number 1\n");
-#endif
-
-beginCallBack(GL_QUAD_STRIP, NULL);
-inEvalCoord2f(3.0, 3.0);
-inEvalCoord2f(2.0, 3.0);
-inEvalCoord2f(3.0, 2.7);
-inEvalCoord2f(2.0, 2.7);
-inEvalCoord2f(3.0, 2.0);
-inEvalCoord2f(2.0, 2.0);
-endCallBack(NULL);
-
-
-beginCallBack(GL_TRIANGLE_STRIP, NULL);
-inEvalCoord2f(2.0, 3.0);
-inEvalCoord2f(2.0, 2.0);
-inEvalCoord2f(2.0, 2.7);
-endCallBack(NULL);
-
-}
-
-/*
-if( global_ev_u1 ==2 && global_ev_u2 == 3
- && global_ev_v1 ==1 && global_ev_v2 == 2)
-{
-#ifdef DEBUG
-printf("***number 2\n");
-#endif
-beginCallBack(GL_QUAD_STRIP);
-inEvalCoord2f(2.0, 2.0);
-inEvalCoord2f(2.0, 1.0);
-inEvalCoord2f(3.0, 2.0);
-inEvalCoord2f(3.0, 1.0);
-endCallBack();
-}
-*/
-if( global_ev_u1 ==1 && global_ev_u2 == 2
- && global_ev_v1 ==2 && global_ev_v2 == 3)
-{
-#ifdef DEBUG
-printf("***number 3\n");
-#endif
-beginCallBack(GL_QUAD_STRIP, NULL);
-inEvalCoord2f(2.0, 3.0);
-inEvalCoord2f(1.0, 3.0);
-inEvalCoord2f(2.0, 2.3);
-inEvalCoord2f(1.0, 2.3);
-inEvalCoord2f(2.0, 2.0);
-inEvalCoord2f(1.0, 2.0);
-endCallBack(NULL);
-
-beginCallBack(GL_TRIANGLE_STRIP, NULL);
-inEvalCoord2f(2.0, 2.3);
-inEvalCoord2f(2.0, 2.0);
-inEvalCoord2f(2.0, 3.0);
-endCallBack(NULL);
-
-}
-return;
-#endif
-
- k=0;
- l=0;
-
- for(i=0; i<bpm->index_length_array; i++)
- {
- beginCallBack(bpm->type_array[i], userData);
- for(j=0; j<bpm->length_array[i]; j++)
- {
- u = bpm->UVarray[k];
- v = bpm->UVarray[k+1];
- inDoEvalCoord2NOGE(u,v,
- bpm->vertex_array+l,
- bpm->normal_array+l);
-
- normalCallBack(bpm->normal_array+l, userData);
- vertexCallBack(bpm->vertex_array+l, userData);
-
- k += 2;
- l += 3;
- }
- endCallBack(userData);
- }
-}
-
-void OpenGLSurfaceEvaluator::inEvalPoint2(int i, int j)
-{
- REAL du, dv;
- REAL point[4];
- REAL normal[3];
- REAL u,v;
- du = (global_grid_u1 - global_grid_u0) / (REAL)global_grid_nu;
- dv = (global_grid_v1 - global_grid_v0) / (REAL)global_grid_nv;
- u = (i==global_grid_nu)? global_grid_u1:(global_grid_u0 + i*du);
- v = (j == global_grid_nv)? global_grid_v1: (global_grid_v0 +j*dv);
- inDoEvalCoord2(u,v,point,normal);
-}
-
-void OpenGLSurfaceEvaluator::inEvalCoord2f(REAL u, REAL v)
-{
-
- REAL point[4];
- REAL normal[3];
- inDoEvalCoord2(u,v,point, normal);
-}
-
-
-
-/*define a grid. store the values into the global variabls:
- * global_grid_*
- *These values will be used later by evaluating functions
- */
-void OpenGLSurfaceEvaluator::inMapGrid2f(int nu, REAL u0, REAL u1,
- int nv, REAL v0, REAL v1)
-{
- global_grid_u0 = u0;
- global_grid_u1 = u1;
- global_grid_nu = nu;
- global_grid_v0 = v0;
- global_grid_v1 = v1;
- global_grid_nv = nv;
-}
-
-void OpenGLSurfaceEvaluator::inEvalMesh2(int lowU, int lowV, int highU, int highV)
-{
- REAL du, dv;
- int i,j;
- int row;
- REAL point[4];
- REAL normal[3];
- if(global_grid_nu == 0 || global_grid_nv == 0)
- return; /*no points need to be output*/
- du = (global_grid_u1 - global_grid_u0) / (REAL)global_grid_nu;
- dv = (global_grid_v1 - global_grid_v0) / (REAL)global_grid_nv;
-
- if(global_grid_nu >= global_grid_nv){
- for(i=lowU; i<highU; i++){
- REAL u1 = (i==global_grid_nu)? global_grid_u1:(global_grid_u0 + i*du);
- REAL u2 = ((i+1) == global_grid_nu)? global_grid_u1: (global_grid_u0+(i+1)*du);
-
- bgnqstrip();
- for(j=highV; j>=lowV; j--){
- REAL v1 = (j == global_grid_nv)? global_grid_v1: (global_grid_v0 +j*dv);
-
- inDoEvalCoord2(u1, v1, point, normal);
- inDoEvalCoord2(u2, v1, point, normal);
- }
- endqstrip();
- }
- }
-
- else{
- for(i=lowV; i<highV; i++){
- REAL v1 = (i==global_grid_nv)? global_grid_v1:(global_grid_v0 + i*dv);
- REAL v2 = ((i+1) == global_grid_nv)? global_grid_v1: (global_grid_v0+(i+1)*dv);
-
- bgnqstrip();
- for(j=highU; j>=lowU; j--){
- REAL u1 = (j == global_grid_nu)? global_grid_u1: (global_grid_u0 +j*du);
- inDoEvalCoord2(u1, v2, point, normal);
- inDoEvalCoord2(u1, v1, point, normal);
- }
- endqstrip();
- }
- }
-
-}
-
-void OpenGLSurfaceEvaluator::inMap2f(int k,
- REAL ulower,
- REAL uupper,
- int ustride,
- int uorder,
- REAL vlower,
- REAL vupper,
- int vstride,
- int vorder,
- REAL *ctlPoints)
-{
- int i,j,x;
- REAL *data = global_ev_ctlPoints;
-
-
-
- if(k == GL_MAP2_VERTEX_3) k=3;
- else if (k==GL_MAP2_VERTEX_4) k =4;
- else {
- printf("error in inMap2f, maptype=%i is wrong, k,map is not updated\n", k);
- return;
- }
-
- global_ev_k = k;
- global_ev_u1 = ulower;
- global_ev_u2 = uupper;
- global_ev_ustride = ustride;
- global_ev_uorder = uorder;
- global_ev_v1 = vlower;
- global_ev_v2 = vupper;
- global_ev_vstride = vstride;
- global_ev_vorder = vorder;
-
- /*copy the contrl points from ctlPoints to global_ev_ctlPoints*/
- for (i=0; i<uorder; i++) {
- for (j=0; j<vorder; j++) {
- for (x=0; x<k; x++) {
- data[x] = ctlPoints[x];
- }
- ctlPoints += vstride;
- data += k;
- }
- ctlPoints += ustride - vstride * vorder;
- }
-
-}
-
-
-/*
- *given a point p with homegeneous coordiante (x,y,z,w),
- *let pu(x,y,z,w) be its partial derivative vector with
- *respect to u
- *and pv(x,y,z,w) be its partial derivative vector with repect to v.
- *This function returns the partial derivative vectors of the
- *inhomegensous coordinates, i.e.,
- * (x/w, y/w, z/w) with respect to u and v.
- */
-void OpenGLSurfaceEvaluator::inComputeFirstPartials(REAL *p, REAL *pu, REAL *pv)
-{
- pu[0] = pu[0]*p[3] - pu[3]*p[0];
- pu[1] = pu[1]*p[3] - pu[3]*p[1];
- pu[2] = pu[2]*p[3] - pu[3]*p[2];
-
- pv[0] = pv[0]*p[3] - pv[3]*p[0];
- pv[1] = pv[1]*p[3] - pv[3]*p[1];
- pv[2] = pv[2]*p[3] - pv[3]*p[2];
-}
-
-/*compute the cross product of pu and pv and normalize.
- *the normal is returned in retNormal
- * pu: dimension 3
- * pv: dimension 3
- * n: return normal, of dimension 3
- */
-void OpenGLSurfaceEvaluator::inComputeNormal2(REAL *pu, REAL *pv, REAL *n)
-{
- REAL mag;
-
- n[0] = pu[1]*pv[2] - pu[2]*pv[1];
- n[1] = pu[2]*pv[0] - pu[0]*pv[2];
- n[2] = pu[0]*pv[1] - pu[1]*pv[0];
-
- mag = sqrt(n[0]*n[0] + n[1]*n[1] + n[2]*n[2]);
-
- assert(mag > 0.0); /*better be some threshold*/
- n[0] /= mag;
- n[1] /= mag;
- n[2] /= mag;
-
-}
-
-
-
-/*Compute point and normal
- *see the head of inDoDomain2WithDerivs
- *for the meaning of the arguments
- */
-void OpenGLSurfaceEvaluator::inDoEvalCoord2(REAL u, REAL v,
- REAL *retPoint, REAL *retNormal)
-{
-
- REAL du[4];
- REAL dv[4];
-
-
- assert(global_ev_k>=3 && global_ev_k <= 4);
- /*compute homegeneous point and partial derivatives*/
- inDoDomain2WithDerivs(global_ev_k, u, v, global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, retPoint, du, dv);
-
-#ifdef AVOID_ZERO_NORMAL
-
- if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO)
- {
-
- REAL tempdu[4];
- REAL tempdata[4];
- REAL u1 = global_ev_u1;
- REAL u2 = global_ev_u2;
- if(u-MYDELTA*(u2-u1) < u1)
- u = u+ MYDELTA*(u2-u1);
- else
- u = u-MYDELTA*(u2-u1);
- inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, tempdu, dv);
- }
- if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO)
- {
- REAL tempdv[4];
- REAL tempdata[4];
- REAL v1 = global_ev_v1;
- REAL v2 = global_ev_v2;
- if(v-MYDELTA*(v2-v1) < v1)
- v = v+ MYDELTA*(v2-v1);
- else
- v = v-MYDELTA*(v2-v1);
- inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, du, tempdv);
- }
-#endif
-
-
- /*compute normal*/
- switch(global_ev_k){
- case 3:
- inComputeNormal2(du, dv, retNormal);
-
- break;
- case 4:
- inComputeFirstPartials(retPoint, du, dv);
- inComputeNormal2(du, dv, retNormal);
- /*transform the homegeneous coordinate of retPoint into inhomogenous one*/
- retPoint[0] /= retPoint[3];
- retPoint[1] /= retPoint[3];
- retPoint[2] /= retPoint[3];
- break;
- }
- /*output this vertex*/
-/* inMeshStreamInsert(global_ms, retPoint, retNormal);*/
-
-
-
- glNormal3fv(retNormal);
- glVertex3fv(retPoint);
-
-
-
-
- #ifdef DEBUG
- printf("vertex(%f,%f,%f)\n", retPoint[0],retPoint[1],retPoint[2]);
- #endif
-
-
-
-}
-
-/*Compute point and normal
- *see the head of inDoDomain2WithDerivs
- *for the meaning of the arguments
- */
-void OpenGLSurfaceEvaluator::inDoEvalCoord2NOGE_BU(REAL u, REAL v,
- REAL *retPoint, REAL *retNormal)
-{
-
- REAL du[4];
- REAL dv[4];
-
-
- assert(global_ev_k>=3 && global_ev_k <= 4);
- /*compute homegeneous point and partial derivatives*/
-// inPreEvaluateBU(global_ev_k, global_ev_uorder, global_ev_vorder, (u-global_ev_u1)/(global_ev_u2-global_ev_u1), global_ev_ctlPoints);
- inDoDomain2WithDerivsBU(global_ev_k, u, v, global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, retPoint, du, dv);
-
-
-#ifdef AVOID_ZERO_NORMAL
-
- if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO)
- {
-
- REAL tempdu[4];
- REAL tempdata[4];
- REAL u1 = global_ev_u1;
- REAL u2 = global_ev_u2;
- if(u-MYDELTA*(u2-u1) < u1)
- u = u+ MYDELTA*(u2-u1);
- else
- u = u-MYDELTA*(u2-u1);
- inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, tempdu, dv);
- }
- if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO)
- {
- REAL tempdv[4];
- REAL tempdata[4];
- REAL v1 = global_ev_v1;
- REAL v2 = global_ev_v2;
- if(v-MYDELTA*(v2-v1) < v1)
- v = v+ MYDELTA*(v2-v1);
- else
- v = v-MYDELTA*(v2-v1);
- inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, du, tempdv);
- }
-#endif
-
- /*compute normal*/
- switch(global_ev_k){
- case 3:
- inComputeNormal2(du, dv, retNormal);
- break;
- case 4:
- inComputeFirstPartials(retPoint, du, dv);
- inComputeNormal2(du, dv, retNormal);
- /*transform the homegeneous coordinate of retPoint into inhomogenous one*/
- retPoint[0] /= retPoint[3];
- retPoint[1] /= retPoint[3];
- retPoint[2] /= retPoint[3];
- break;
- }
-}
-
-/*Compute point and normal
- *see the head of inDoDomain2WithDerivs
- *for the meaning of the arguments
- */
-void OpenGLSurfaceEvaluator::inDoEvalCoord2NOGE_BV(REAL u, REAL v,
- REAL *retPoint, REAL *retNormal)
-{
-
- REAL du[4];
- REAL dv[4];
-
-
- assert(global_ev_k>=3 && global_ev_k <= 4);
- /*compute homegeneous point and partial derivatives*/
-// inPreEvaluateBV(global_ev_k, global_ev_uorder, global_ev_vorder, (v-global_ev_v1)/(global_ev_v2-global_ev_v1), global_ev_ctlPoints);
-
- inDoDomain2WithDerivsBV(global_ev_k, u, v, global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, retPoint, du, dv);
-
-
-#ifdef AVOID_ZERO_NORMAL
-
- if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO)
- {
-
- REAL tempdu[4];
- REAL tempdata[4];
- REAL u1 = global_ev_u1;
- REAL u2 = global_ev_u2;
- if(u-MYDELTA*(u2-u1) < u1)
- u = u+ MYDELTA*(u2-u1);
- else
- u = u-MYDELTA*(u2-u1);
- inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, tempdu, dv);
- }
- if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO)
- {
- REAL tempdv[4];
- REAL tempdata[4];
- REAL v1 = global_ev_v1;
- REAL v2 = global_ev_v2;
- if(v-MYDELTA*(v2-v1) < v1)
- v = v+ MYDELTA*(v2-v1);
- else
- v = v-MYDELTA*(v2-v1);
- inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, du, tempdv);
- }
-#endif
-
- /*compute normal*/
- switch(global_ev_k){
- case 3:
- inComputeNormal2(du, dv, retNormal);
- break;
- case 4:
- inComputeFirstPartials(retPoint, du, dv);
- inComputeNormal2(du, dv, retNormal);
- /*transform the homegeneous coordinate of retPoint into inhomogenous one*/
- retPoint[0] /= retPoint[3];
- retPoint[1] /= retPoint[3];
- retPoint[2] /= retPoint[3];
- break;
- }
-}
-
-
-/*Compute point and normal
- *see the head of inDoDomain2WithDerivs
- *for the meaning of the arguments
- */
-void OpenGLSurfaceEvaluator::inDoEvalCoord2NOGE(REAL u, REAL v,
- REAL *retPoint, REAL *retNormal)
-{
-
- REAL du[4];
- REAL dv[4];
-
-
- assert(global_ev_k>=3 && global_ev_k <= 4);
- /*compute homegeneous point and partial derivatives*/
- inDoDomain2WithDerivs(global_ev_k, u, v, global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, retPoint, du, dv);
-
-
-#ifdef AVOID_ZERO_NORMAL
-
- if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO)
- {
-
- REAL tempdu[4];
- REAL tempdata[4];
- REAL u1 = global_ev_u1;
- REAL u2 = global_ev_u2;
- if(u-MYDELTA*(u2-u1) < u1)
- u = u+ MYDELTA*(u2-u1);
- else
- u = u-MYDELTA*(u2-u1);
- inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, tempdu, dv);
- }
- if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO)
- {
- REAL tempdv[4];
- REAL tempdata[4];
- REAL v1 = global_ev_v1;
- REAL v2 = global_ev_v2;
- if(v-MYDELTA*(v2-v1) < v1)
- v = v+ MYDELTA*(v2-v1);
- else
- v = v-MYDELTA*(v2-v1);
- inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, du, tempdv);
- }
-#endif
-
- /*compute normal*/
- switch(global_ev_k){
- case 3:
- inComputeNormal2(du, dv, retNormal);
- break;
- case 4:
- inComputeFirstPartials(retPoint, du, dv);
- inComputeNormal2(du, dv, retNormal);
- /*transform the homegeneous coordinate of retPoint into inhomogenous one*/
- retPoint[0] /= retPoint[3];
- retPoint[1] /= retPoint[3];
- retPoint[2] /= retPoint[3];
- break;
- }
-// glNormal3fv(retNormal);
-// glVertex3fv(retPoint);
-}
-
-void OpenGLSurfaceEvaluator::inPreEvaluateBV(int k, int uorder, int vorder, REAL vprime, REAL *baseData)
-{
- int j,row,col;
- REAL p, pdv;
- REAL *data;
-
- if(global_vprime != vprime || global_vorder != vorder) {
- inPreEvaluateWithDeriv(vorder, vprime, global_vcoeff, global_vcoeffDeriv);
- global_vprime = vprime;
- global_vorder = vorder;
- }
-
- for(j=0; j<k; j++){
- data = baseData+j;
- for(row=0; row<uorder; row++){
- p = global_vcoeff[0] * (*data);
- pdv = global_vcoeffDeriv[0] * (*data);
- data += k;
- for(col = 1; col < vorder; col++){
- p += global_vcoeff[col] * (*data);
- pdv += global_vcoeffDeriv[col] * (*data);
- data += k;
- }
- global_BV[row][j] = p;
- global_PBV[row][j] = pdv;
- }
- }
-}
-
-void OpenGLSurfaceEvaluator::inPreEvaluateBU(int k, int uorder, int vorder, REAL uprime, REAL *baseData)
-{
- int j,row,col;
- REAL p, pdu;
- REAL *data;
-
- if(global_uprime != uprime || global_uorder != uorder) {
- inPreEvaluateWithDeriv(uorder, uprime, global_ucoeff, global_ucoeffDeriv);
- global_uprime = uprime;
- global_uorder = uorder;
- }
-
- for(j=0; j<k; j++){
- data = baseData+j;
- for(col=0; col<vorder; col++){
- data = baseData+j + k*col;
- p = global_ucoeff[0] * (*data);
- pdu = global_ucoeffDeriv[0] * (*data);
- data += k*uorder;
- for(row = 1; row < uorder; row++){
- p += global_ucoeff[row] * (*data);
- pdu += global_ucoeffDeriv[row] * (*data);
- data += k * uorder;
- }
- global_BU[col][j] = p;
- global_PBU[col][j] = pdu;
- }
- }
-}
-
-void OpenGLSurfaceEvaluator::inDoDomain2WithDerivsBU(int k, REAL u, REAL v,
- REAL u1, REAL u2, int uorder,
- REAL v1, REAL v2, int vorder,
- REAL *baseData,
- REAL *retPoint, REAL* retdu, REAL *retdv)
-{
- int j, row, col;
-
- REAL vprime;
-
-
- if((u2 == u1) || (v2 == v1))
- return;
-
- vprime = (v - v1) / (v2 - v1);
-
-
- if(global_vprime != vprime || global_vorder != vorder) {
- inPreEvaluateWithDeriv(vorder, vprime, global_vcoeff, global_vcoeffDeriv);
- global_vprime = vprime;
- global_vorder = vorder;
- }
-
-
- for(j=0; j<k; j++)
- {
- retPoint[j] = retdu[j] = retdv[j] = 0.0;
- for (col = 0; col < vorder; col++) {
- retPoint[j] += global_BU[col][j] * global_vcoeff[col];
- retdu[j] += global_PBU[col][j] * global_vcoeff[col];
- retdv[j] += global_BU[col][j] * global_vcoeffDeriv[col];
- }
- }
-}
-
-void OpenGLSurfaceEvaluator::inDoDomain2WithDerivsBV(int k, REAL u, REAL v,
- REAL u1, REAL u2, int uorder,
- REAL v1, REAL v2, int vorder,
- REAL *baseData,
- REAL *retPoint, REAL* retdu, REAL *retdv)
-{
- int j, row, col;
- REAL uprime;
-
-
- if((u2 == u1) || (v2 == v1))
- return;
- uprime = (u - u1) / (u2 - u1);
-
-
- if(global_uprime != uprime || global_uorder != uorder) {
- inPreEvaluateWithDeriv(uorder, uprime, global_ucoeff, global_ucoeffDeriv);
- global_uprime = uprime;
- global_uorder = uorder;
- }
-
-
- for(j=0; j<k; j++)
- {
- retPoint[j] = retdu[j] = retdv[j] = 0.0;
- for (row = 0; row < uorder; row++) {
- retPoint[j] += global_BV[row][j] * global_ucoeff[row];
- retdu[j] += global_BV[row][j] * global_ucoeffDeriv[row];
- retdv[j] += global_PBV[row][j] * global_ucoeff[row];
- }
- }
-}
-
-
-/*
- *given a Bezier surface, and parameter (u,v), compute the point in the object space,
- *and the normal
- *k: the dimension of the object space: usually 2,3,or 4.
- *u,v: the paramter pair.
- *u1,u2,uorder: the Bezier polynomial of u coord is defined on [u1,u2] with order uorder.
- *v1,v2,vorder: the Bezier polynomial of v coord is defined on [v1,v2] with order vorder.
- *baseData: contrl points. arranged as: (u,v,k).
- *retPoint: the computed point (one point) with dimension k.
- *retdu: the computed partial derivative with respect to u.
- *retdv: the computed partial derivative with respect to v.
- */
-void OpenGLSurfaceEvaluator::inDoDomain2WithDerivs(int k, REAL u, REAL v,
- REAL u1, REAL u2, int uorder,
- REAL v1, REAL v2, int vorder,
- REAL *baseData,
- REAL *retPoint, REAL *retdu, REAL *retdv)
-{
- int j, row, col;
- REAL uprime;
- REAL vprime;
- REAL p;
- REAL pdv;
- REAL *data;
-
- if((u2 == u1) || (v2 == v1))
- return;
- uprime = (u - u1) / (u2 - u1);
- vprime = (v - v1) / (v2 - v1);
-
- /* Compute coefficients for values and derivs */
-
- /* Use already cached values if possible */
- if(global_uprime != uprime || global_uorder != uorder) {
- inPreEvaluateWithDeriv(uorder, uprime, global_ucoeff, global_ucoeffDeriv);
- global_uorder = uorder;
- global_uprime = uprime;
- }
- if (global_vprime != vprime ||
- global_vorder != vorder) {
- inPreEvaluateWithDeriv(vorder, vprime, global_vcoeff, global_vcoeffDeriv);
- global_vorder = vorder;
- global_vprime = vprime;
- }
-
- for (j = 0; j < k; j++) {
- data=baseData+j;
- retPoint[j] = retdu[j] = retdv[j] = 0.0;
- for (row = 0; row < uorder; row++) {
- /*
- ** Minor optimization.
- ** The col == 0 part of the loop is extracted so we don't
- ** have to initialize p and pdv to 0.
- */
- p = global_vcoeff[0] * (*data);
- pdv = global_vcoeffDeriv[0] * (*data);
- data += k;
- for (col = 1; col < vorder; col++) {
- /* Incrementally build up p, pdv value */
- p += global_vcoeff[col] * (*data);
- pdv += global_vcoeffDeriv[col] * (*data);
- data += k;
- }
- /* Use p, pdv value to incrementally add up r, du, dv */
- retPoint[j] += global_ucoeff[row] * p;
- retdu[j] += global_ucoeffDeriv[row] * p;
- retdv[j] += global_ucoeff[row] * pdv;
- }
- }
-}
-
-
-/*
- *compute the Bezier polynomials C[n,j](v) for all j at v with
- *return values stored in coeff[], where
- * C[n,j](v) = (n,j) * v^j * (1-v)^(n-j),
- * j=0,1,2,...,n.
- *order : n+1
- *vprime: v
- *coeff : coeff[j]=C[n,j](v), this array store the returned values.
- *The algorithm is a recursive scheme:
- * C[0,0]=1;
- * C[n,j](v) = (1-v)*C[n-1,j](v) + v*C[n-1,j-1](v), n>=1
- *This code is copied from opengl/soft/so_eval.c:PreEvaluate
- */
-void OpenGLSurfaceEvaluator::inPreEvaluate(int order, REAL vprime, REAL *coeff)
-{
- int i, j;
- REAL oldval, temp;
- REAL oneMinusvprime;
-
- /*
- * Minor optimization
- * Compute orders 1 and 2 outright, and set coeff[0], coeff[1] to
- * their i==1 loop values to avoid the initialization and the i==1 loop.
- */
- if (order == 1) {
- coeff[0] = 1.0;
- return;
- }
-
- oneMinusvprime = 1-vprime;
- coeff[0] = oneMinusvprime;
- coeff[1] = vprime;
- if (order == 2) return;
-
- for (i = 2; i < order; i++) {
- oldval = coeff[0] * vprime;
- coeff[0] = oneMinusvprime * coeff[0];
- for (j = 1; j < i; j++) {
- temp = oldval;
- oldval = coeff[j] * vprime;
- coeff[j] = temp + oneMinusvprime * coeff[j];
- }
- coeff[j] = oldval;
- }
-}
-
-/*
- *compute the Bezier polynomials C[n,j](v) and derivatives for all j at v with
- *return values stored in coeff[] and coeffDeriv[].
- *see the head of function inPreEvaluate for the definition of C[n,j](v)
- *and how to compute the values.
- *The algorithm to compute the derivative is:
- * dC[0,0](v) = 0.
- * dC[n,j](v) = n*(dC[n-1,j-1](v) - dC[n-1,j](v)).
- *
- *This code is copied from opengl/soft/so_eval.c:PreEvaluateWidthDeriv
- */
-void OpenGLSurfaceEvaluator::inPreEvaluateWithDeriv(int order, REAL vprime,
- REAL *coeff, REAL *coeffDeriv)
-{
- int i, j;
- REAL oldval, temp;
- REAL oneMinusvprime;
-
- oneMinusvprime = 1-vprime;
- /*
- * Minor optimization
- * Compute orders 1 and 2 outright, and set coeff[0], coeff[1] to
- * their i==1 loop values to avoid the initialization and the i==1 loop.
- */
- if (order == 1) {
- coeff[0] = 1.0;
- coeffDeriv[0] = 0.0;
- return;
- } else if (order == 2) {
- coeffDeriv[0] = -1.0;
- coeffDeriv[1] = 1.0;
- coeff[0] = oneMinusvprime;
- coeff[1] = vprime;
- return;
- }
- coeff[0] = oneMinusvprime;
- coeff[1] = vprime;
- for (i = 2; i < order - 1; i++) {
- oldval = coeff[0] * vprime;
- coeff[0] = oneMinusvprime * coeff[0];
- for (j = 1; j < i; j++) {
- temp = oldval;
- oldval = coeff[j] * vprime;
- coeff[j] = temp + oneMinusvprime * coeff[j];
- }
- coeff[j] = oldval;
- }
- coeffDeriv[0] = -coeff[0];
- /*
- ** Minor optimization:
- ** Would make this a "for (j=1; j<order-1; j++)" loop, but it is always
- ** executed at least once, so this is more efficient.
- */
- j=1;
- do {
- coeffDeriv[j] = coeff[j-1] - coeff[j];
- j++;
- } while (j < order - 1);
- coeffDeriv[j] = coeff[j-1];
-
- oldval = coeff[0] * vprime;
- coeff[0] = oneMinusvprime * coeff[0];
- for (j = 1; j < i; j++) {
- temp = oldval;
- oldval = coeff[j] * vprime;
- coeff[j] = temp + oneMinusvprime * coeff[j];
- }
- coeff[j] = oldval;
-}
-
-void OpenGLSurfaceEvaluator::inEvalULine(int n_points, REAL v, REAL* u_vals,
- int stride, REAL ret_points[][3], REAL ret_normals[][3])
-{
- int i,k;
- REAL temp[4];
-inPreEvaluateBV_intfac(v);
-
- for(i=0,k=0; i<n_points; i++, k += stride)
- {
- inDoEvalCoord2NOGE_BV(u_vals[k],v,temp, ret_normals[i]);
-
- ret_points[i][0] = temp[0];
- ret_points[i][1] = temp[1];
- ret_points[i][2] = temp[2];
-
- }
-
-}
-
-void OpenGLSurfaceEvaluator::inEvalVLine(int n_points, REAL u, REAL* v_vals,
- int stride, REAL ret_points[][3], REAL ret_normals[][3])
-{
- int i,k;
- REAL temp[4];
-inPreEvaluateBU_intfac(u);
- for(i=0,k=0; i<n_points; i++, k += stride)
- {
- inDoEvalCoord2NOGE_BU(u, v_vals[k], temp, ret_normals[i]);
- ret_points[i][0] = temp[0];
- ret_points[i][1] = temp[1];
- ret_points[i][2] = temp[2];
- }
-}
-
-
-/*triangulate a strip bounded by two lines which are parallel to U-axis
- *upperVerts: the verteces on the upper line
- *lowerVertx: the verteces on the lower line
- *n_upper >=1
- *n_lower >=1
- */
-void OpenGLSurfaceEvaluator::inEvalUStrip(int n_upper, REAL v_upper, REAL* upper_val, int n_lower, REAL v_lower, REAL* lower_val)
-{
- int i,j,k,l;
- REAL leftMostV[2];
- typedef REAL REAL3[3];
-
- REAL3* upperXYZ = (REAL3*) malloc(sizeof(REAL3)*n_upper);
- assert(upperXYZ);
- REAL3* upperNormal = (REAL3*) malloc(sizeof(REAL3) * n_upper);
- assert(upperNormal);
- REAL3* lowerXYZ = (REAL3*) malloc(sizeof(REAL3)*n_lower);
- assert(lowerXYZ);
- REAL3* lowerNormal = (REAL3*) malloc(sizeof(REAL3) * n_lower);
- assert(lowerNormal);
-
- inEvalULine(n_upper, v_upper, upper_val, 1, upperXYZ, upperNormal);
- inEvalULine(n_lower, v_lower, lower_val, 1, lowerXYZ, lowerNormal);
-
-
-
- REAL* leftMostXYZ;
- REAL* leftMostNormal;
-
- /*
- *the algorithm works by scanning from left to right.
- *leftMostV: the left most of the remaining verteces (on both upper and lower).
- * it could an element of upperVerts or lowerVerts.
- *i: upperVerts[i] is the first vertex to the right of leftMostV on upper line *j: lowerVerts[j] is the first vertex to the right of leftMostV on lower line */
-
- /*initialize i,j,and leftMostV
- */
- if(upper_val[0] <= lower_val[0])
- {
- i=1;
- j=0;
-
- leftMostV[0] = upper_val[0];
- leftMostV[1] = v_upper;
- leftMostXYZ = upperXYZ[0];
- leftMostNormal = upperNormal[0];
- }
- else
- {
- i=0;
- j=1;
-
- leftMostV[0] = lower_val[0];
- leftMostV[1] = v_lower;
-
- leftMostXYZ = lowerXYZ[0];
- leftMostNormal = lowerNormal[0];
- }
-
- /*the main loop.
- *the invariance is that:
- *at the beginning of each loop, the meaning of i,j,and leftMostV are
- *maintained
- */
- while(1)
- {
- if(i >= n_upper) /*case1: no more in upper*/
- {
- if(j<n_lower-1) /*at least two vertices in lower*/
- {
- bgntfan();
- glNormal3fv(leftMostNormal);
- glVertex3fv(leftMostXYZ);
-
- while(j<n_lower){
- glNormal3fv(lowerNormal[j]);
- glVertex3fv(lowerXYZ[j]);
- j++;
-
- }
- endtfan();
- }
- break; /*exit the main loop*/
- }
- else if(j>= n_lower) /*case2: no more in lower*/
- {
- if(i<n_upper-1) /*at least two vertices in upper*/
- {
- bgntfan();
- glNormal3fv(leftMostNormal);
- glVertex3fv(leftMostXYZ);
-
- for(k=n_upper-1; k>=i; k--) /*reverse order for two-side lighting*/
- {
- glNormal3fv(upperNormal[k]);
- glVertex3fv(upperXYZ[k]);
- }
-
- endtfan();
- }
- break; /*exit the main loop*/
- }
- else /* case3: neither is empty, plus the leftMostV, there is at least one triangle to output*/
- {
- if(upper_val[i] <= lower_val[j])
- {
- bgntfan();
-
- glNormal3fv(lowerNormal[j]);
- glVertex3fv(lowerXYZ[j]);
-
- /*find the last k>=i such that
- *upperverts[k][0] <= lowerverts[j][0]
- */
- k=i;
-
- while(k<n_upper)
- {
- if(upper_val[k] > lower_val[j])
- break;
- k++;
-
- }
- k--;
-
-
- for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/
- {
- glNormal3fv(upperNormal[l]);
- glVertex3fv(upperXYZ[l]);
-
- }
- glNormal3fv(leftMostNormal);
- glVertex3fv(leftMostXYZ);
-
- endtfan();
-
- /*update i and leftMostV for next loop
- */
- i = k+1;
-
- leftMostV[0] = upper_val[k];
- leftMostV[1] = v_upper;
- leftMostNormal = upperNormal[k];
- leftMostXYZ = upperXYZ[k];
- }
- else /*upperVerts[i][0] > lowerVerts[j][0]*/
- {
- bgntfan();
- glNormal3fv(upperNormal[i]);
- glVertex3fv(upperXYZ[i]);
-
- glNormal3fv(leftMostNormal);
- glVertex3fv(leftMostXYZ);
-
-
- /*find the last k>=j such that
- *lowerverts[k][0] < upperverts[i][0]
- */
- k=j;
- while(k< n_lower)
- {
- if(lower_val[k] >= upper_val[i])
- break;
- glNormal3fv(lowerNormal[k]);
- glVertex3fv(lowerXYZ[k]);
-
- k++;
- }
- endtfan();
-
- /*update j and leftMostV for next loop
- */
- j=k;
- leftMostV[0] = lower_val[j-1];
- leftMostV[1] = v_lower;
-
- leftMostNormal = lowerNormal[j-1];
- leftMostXYZ = lowerXYZ[j-1];
- }
- }
- }
- //clean up
- free(upperXYZ);
- free(lowerXYZ);
- free(upperNormal);
- free(lowerNormal);
-}
-
-/*triangulate a strip bounded by two lines which are parallel to V-axis
- *leftVerts: the verteces on the left line
- *rightVertx: the verteces on the right line
- *n_left >=1
- *n_right >=1
- */
-void OpenGLSurfaceEvaluator::inEvalVStrip(int n_left, REAL u_left, REAL* left_val, int n_right, REAL u_right, REAL* right_val)
-{
- int i,j,k,l;
- REAL botMostV[2];
- typedef REAL REAL3[3];
-
- REAL3* leftXYZ = (REAL3*) malloc(sizeof(REAL3)*n_left);
- assert(leftXYZ);
- REAL3* leftNormal = (REAL3*) malloc(sizeof(REAL3) * n_left);
- assert(leftNormal);
- REAL3* rightXYZ = (REAL3*) malloc(sizeof(REAL3)*n_right);
- assert(rightXYZ);
- REAL3* rightNormal = (REAL3*) malloc(sizeof(REAL3) * n_right);
- assert(rightNormal);
-
- inEvalVLine(n_left, u_left, left_val, 1, leftXYZ, leftNormal);
- inEvalVLine(n_right, u_right, right_val, 1, rightXYZ, rightNormal);
-
-
-
- REAL* botMostXYZ;
- REAL* botMostNormal;
-
- /*
- *the algorithm works by scanning from bot to top.
- *botMostV: the bot most of the remaining verteces (on both left and right).
- * it could an element of leftVerts or rightVerts.
- *i: leftVerts[i] is the first vertex to the top of botMostV on left line
- *j: rightVerts[j] is the first vertex to the top of botMostV on rightline */
-
- /*initialize i,j,and botMostV
- */
- if(left_val[0] <= right_val[0])
- {
- i=1;
- j=0;
-
- botMostV[0] = u_left;
- botMostV[1] = left_val[0];
- botMostXYZ = leftXYZ[0];
- botMostNormal = leftNormal[0];
- }
- else
- {
- i=0;
- j=1;
-
- botMostV[0] = u_right;
- botMostV[1] = right_val[0];
-
- botMostXYZ = rightXYZ[0];
- botMostNormal = rightNormal[0];
- }
-
- /*the main loop.
- *the invariance is that:
- *at the beginning of each loop, the meaning of i,j,and botMostV are
- *maintained
- */
- while(1)
- {
- if(i >= n_left) /*case1: no more in left*/
- {
- if(j<n_right-1) /*at least two vertices in right*/
- {
- bgntfan();
- glNormal3fv(botMostNormal);
- glVertex3fv(botMostXYZ);
-
- while(j<n_right){
- glNormal3fv(rightNormal[j]);
- glVertex3fv(rightXYZ[j]);
- j++;
-
- }
- endtfan();
- }
- break; /*exit the main loop*/
- }
- else if(j>= n_right) /*case2: no more in right*/
- {
- if(i<n_left-1) /*at least two vertices in left*/
- {
- bgntfan();
- glNormal3fv(botMostNormal);
- glVertex3fv(botMostXYZ);
-
- for(k=n_left-1; k>=i; k--) /*reverse order for two-side lighting*/
- {
- glNormal3fv(leftNormal[k]);
- glVertex3fv(leftXYZ[k]);
- }
-
- endtfan();
- }
- break; /*exit the main loop*/
- }
- else /* case3: neither is empty, plus the botMostV, there is at least one triangle to output*/
- {
- if(left_val[i] <= right_val[j])
- {
- bgntfan();
-
- glNormal3fv(rightNormal[j]);
- glVertex3fv(rightXYZ[j]);
-
- /*find the last k>=i such that
- *leftverts[k][0] <= rightverts[j][0]
- */
- k=i;
-
- while(k<n_left)
- {
- if(left_val[k] > right_val[j])
- break;
- k++;
-
- }
- k--;
-
-
- for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/
- {
- glNormal3fv(leftNormal[l]);
- glVertex3fv(leftXYZ[l]);
-
- }
- glNormal3fv(botMostNormal);
- glVertex3fv(botMostXYZ);
-
- endtfan();
-
- /*update i and botMostV for next loop
- */
- i = k+1;
-
- botMostV[0] = u_left;
- botMostV[1] = left_val[k];
- botMostNormal = leftNormal[k];
- botMostXYZ = leftXYZ[k];
- }
- else /*left_val[i] > right_val[j])*/
- {
- bgntfan();
- glNormal3fv(leftNormal[i]);
- glVertex3fv(leftXYZ[i]);
-
- glNormal3fv(botMostNormal);
- glVertex3fv(botMostXYZ);
-
-
- /*find the last k>=j such that
- *rightverts[k][0] < leftverts[i][0]
- */
- k=j;
- while(k< n_right)
- {
- if(right_val[k] >= left_val[i])
- break;
- glNormal3fv(rightNormal[k]);
- glVertex3fv(rightXYZ[k]);
-
- k++;
- }
- endtfan();
-
- /*update j and botMostV for next loop
- */
- j=k;
- botMostV[0] = u_right;
- botMostV[1] = right_val[j-1];
-
- botMostNormal = rightNormal[j-1];
- botMostXYZ = rightXYZ[j-1];
- }
- }
- }
- //clean up
- free(leftXYZ);
- free(leftXYZ);
- free(rightNormal);
- free(rightNormal);
-}
-
-/*-----------------------begin evalMachine-------------------*/
-void OpenGLSurfaceEvaluator::inMap2fEM(int which, int k,
- REAL ulower,
- REAL uupper,
- int ustride,
- int uorder,
- REAL vlower,
- REAL vupper,
- int vstride,
- int vorder,
- REAL *ctlPoints)
-{
- int i,j,x;
- surfEvalMachine *temp_em;
- switch(which){
- case 0: //vertex
- vertex_flag = 1;
- temp_em = &em_vertex;
- break;
- case 1: //normal
- normal_flag = 1;
- temp_em = &em_normal;
- break;
- case 2: //color
- color_flag = 1;
- temp_em = &em_color;
- break;
- default:
- texcoord_flag = 1;
- temp_em = &em_texcoord;
- break;
- }
-
- REAL *data = temp_em->ctlPoints;
-
- temp_em->uprime = -1;//initilized
- temp_em->vprime = -1;
-
- temp_em->k = k;
- temp_em->u1 = ulower;
- temp_em->u2 = uupper;
- temp_em->ustride = ustride;
- temp_em->uorder = uorder;
- temp_em->v1 = vlower;
- temp_em->v2 = vupper;
- temp_em->vstride = vstride;
- temp_em->vorder = vorder;
-
- /*copy the contrl points from ctlPoints to global_ev_ctlPoints*/
- for (i=0; i<uorder; i++) {
- for (j=0; j<vorder; j++) {
- for (x=0; x<k; x++) {
- data[x] = ctlPoints[x];
- }
- ctlPoints += vstride;
- data += k;
- }
- ctlPoints += ustride - vstride * vorder;
- }
-}
-
-void OpenGLSurfaceEvaluator::inDoDomain2WithDerivsEM(surfEvalMachine *em, REAL u, REAL v,
- REAL *retPoint, REAL *retdu, REAL *retdv)
-{
- int j, row, col;
- REAL the_uprime;
- REAL the_vprime;
- REAL p;
- REAL pdv;
- REAL *data;
-
- if((em->u2 == em->u1) || (em->v2 == em->v1))
- return;
- the_uprime = (u - em->u1) / (em->u2 - em->u1);
- the_vprime = (v - em->v1) / (em->v2 - em->v1);
-
- /* Compute coefficients for values and derivs */
-
- /* Use already cached values if possible */
- if(em->uprime != the_uprime) {
- inPreEvaluateWithDeriv(em->uorder, the_uprime, em->ucoeff, em->ucoeffDeriv);
- em->uprime = the_uprime;
- }
- if (em->vprime != the_vprime) {
- inPreEvaluateWithDeriv(em->vorder, the_vprime, em->vcoeff, em->vcoeffDeriv);
- em->vprime = the_vprime;
- }
-
- for (j = 0; j < em->k; j++) {
- data=em->ctlPoints+j;
- retPoint[j] = retdu[j] = retdv[j] = 0.0;
- for (row = 0; row < em->uorder; row++) {
- /*
- ** Minor optimization.
- ** The col == 0 part of the loop is extracted so we don't
- ** have to initialize p and pdv to 0.
- */
- p = em->vcoeff[0] * (*data);
- pdv = em->vcoeffDeriv[0] * (*data);
- data += em->k;
- for (col = 1; col < em->vorder; col++) {
- /* Incrementally build up p, pdv value */
- p += em->vcoeff[col] * (*data);
- pdv += em->vcoeffDeriv[col] * (*data);
- data += em->k;
- }
- /* Use p, pdv value to incrementally add up r, du, dv */
- retPoint[j] += em->ucoeff[row] * p;
- retdu[j] += em->ucoeffDeriv[row] * p;
- retdv[j] += em->ucoeff[row] * pdv;
- }
- }
-}
-
-void OpenGLSurfaceEvaluator::inDoDomain2EM(surfEvalMachine *em, REAL u, REAL v,
- REAL *retPoint)
-{
- int j, row, col;
- REAL the_uprime;
- REAL the_vprime;
- REAL p;
- REAL *data;
-
- if((em->u2 == em->u1) || (em->v2 == em->v1))
- return;
- the_uprime = (u - em->u1) / (em->u2 - em->u1);
- the_vprime = (v - em->v1) / (em->v2 - em->v1);
-
- /* Compute coefficients for values and derivs */
-
- /* Use already cached values if possible */
- if(em->uprime != the_uprime) {
- inPreEvaluate(em->uorder, the_uprime, em->ucoeff);
- em->uprime = the_uprime;
- }
- if (em->vprime != the_vprime) {
- inPreEvaluate(em->vorder, the_vprime, em->vcoeff);
- em->vprime = the_vprime;
- }
-
- for (j = 0; j < em->k; j++) {
- data=em->ctlPoints+j;
- retPoint[j] = 0.0;
- for (row = 0; row < em->uorder; row++) {
- /*
- ** Minor optimization.
- ** The col == 0 part of the loop is extracted so we don't
- ** have to initialize p and pdv to 0.
- */
- p = em->vcoeff[0] * (*data);
- data += em->k;
- for (col = 1; col < em->vorder; col++) {
- /* Incrementally build up p, pdv value */
- p += em->vcoeff[col] * (*data);
- data += em->k;
- }
- /* Use p, pdv value to incrementally add up r, du, dv */
- retPoint[j] += em->ucoeff[row] * p;
- }
- }
-}
-
-
-void OpenGLSurfaceEvaluator::inDoEvalCoord2EM(REAL u, REAL v)
-{
- REAL temp_vertex[5];
- REAL temp_normal[3];
- REAL temp_color[4];
- REAL temp_texcoord[4];
-
- if(texcoord_flag)
- {
- inDoDomain2EM(&em_texcoord, u,v, temp_texcoord);
- texcoordCallBack(temp_texcoord, userData);
- }
- if(color_flag)
- {
- inDoDomain2EM(&em_color, u,v, temp_color);
- colorCallBack(temp_color, userData);
- }
-
- if(normal_flag) //there is a normla map
- {
- inDoDomain2EM(&em_normal, u,v, temp_normal);
- normalCallBack(temp_normal, userData);
-
- if(vertex_flag)
- {
- inDoDomain2EM(&em_vertex, u,v,temp_vertex);
- if(em_vertex.k == 4)
- {
- temp_vertex[0] /= temp_vertex[3];
- temp_vertex[1] /= temp_vertex[3];
- temp_vertex[2] /= temp_vertex[3];
- }
- temp_vertex[3]=u;
- temp_vertex[4]=v;
- vertexCallBack(temp_vertex, userData);
- }
- }
- else if(auto_normal_flag) //no normal map but there is a normal callbackfunctin
- {
- REAL du[4];
- REAL dv[4];
-
- /*compute homegeneous point and partial derivatives*/
- inDoDomain2WithDerivsEM(&em_vertex, u,v,temp_vertex,du,dv);
-
- if(em_vertex.k ==4)
- inComputeFirstPartials(temp_vertex, du, dv);
-
-#ifdef AVOID_ZERO_NORMAL
- if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO)
- {
-
- REAL tempdu[4];
- REAL tempdata[4];
- REAL u1 = em_vertex.u1;
- REAL u2 = em_vertex.u2;
- if(u-MYDELTA*(u2-u1) < u1)
- u = u+ MYDELTA*(u2-u1);
- else
- u = u-MYDELTA*(u2-u1);
- inDoDomain2WithDerivsEM(&em_vertex,u,v, tempdata, tempdu, dv);
-
- if(em_vertex.k ==4)
- inComputeFirstPartials(temp_vertex, du, dv);
- }
- else if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO)
- {
- REAL tempdv[4];
- REAL tempdata[4];
- REAL v1 = em_vertex.v1;
- REAL v2 = em_vertex.v2;
- if(v-MYDELTA*(v2-v1) < v1)
- v = v+ MYDELTA*(v2-v1);
- else
- v = v-MYDELTA*(v2-v1);
- inDoDomain2WithDerivsEM(&em_vertex,u,v, tempdata, du, tempdv);
-
- if(em_vertex.k ==4)
- inComputeFirstPartials(temp_vertex, du, dv);
- }
-#endif
-
- /*compute normal*/
- switch(em_vertex.k){
- case 3:
-
- inComputeNormal2(du, dv, temp_normal);
- break;
- case 4:
-
-// inComputeFirstPartials(temp_vertex, du, dv);
- inComputeNormal2(du, dv, temp_normal);
-
- /*transform the homegeneous coordinate of retPoint into inhomogenous one*/
- temp_vertex[0] /= temp_vertex[3];
- temp_vertex[1] /= temp_vertex[3];
- temp_vertex[2] /= temp_vertex[3];
- break;
- }
- normalCallBack(temp_normal, userData);
- temp_vertex[3] = u;
- temp_vertex[4] = v;
- vertexCallBack(temp_vertex, userData);
-
- }/*end if auto_normal*/
- else //no normal map, and no normal callback function
- {
- if(vertex_flag)
- {
- inDoDomain2EM(&em_vertex, u,v,temp_vertex);
- if(em_vertex.k == 4)
- {
- temp_vertex[0] /= temp_vertex[3];
- temp_vertex[1] /= temp_vertex[3];
- temp_vertex[2] /= temp_vertex[3];
- }
- temp_vertex[3] = u;
- temp_vertex[4] = v;
- vertexCallBack(temp_vertex, userData);
- }
- }
-}
-
-
-void OpenGLSurfaceEvaluator::inBPMEvalEM(bezierPatchMesh* bpm)
-{
- int i,j,k,l;
- float u,v;
-
- int ustride;
- int vstride;
-
-#ifdef USE_LOD
- if(bpm->bpatch != NULL)
- {
- bezierPatch* p=bpm->bpatch;
- ustride = p->dimension * p->vorder;
- vstride = p->dimension;
-
- glMap2f( (p->dimension == 3)? GL_MAP2_VERTEX_3 : GL_MAP2_VERTEX_4,
- p->umin,
- p->umax,
- ustride,
- p->uorder,
- p->vmin,
- p->vmax,
- vstride,
- p->vorder,
- p->ctlpoints);
-
-
-/*
- inMap2fEM(0, p->dimension,
- p->umin,
- p->umax,
- ustride,
- p->uorder,
- p->vmin,
- p->vmax,
- vstride,
- p->vorder,
- p->ctlpoints);
-*/
- }
-#else
-
- if(bpm->bpatch != NULL){
- bezierPatch* p = bpm->bpatch;
- ustride = p->dimension * p->vorder;
- vstride = p->dimension;
- inMap2fEM(0, p->dimension,
- p->umin,
- p->umax,
- ustride,
- p->uorder,
- p->vmin,
- p->vmax,
- vstride,
- p->vorder,
- p->ctlpoints);
- }
- if(bpm->bpatch_normal != NULL){
- bezierPatch* p = bpm->bpatch_normal;
- ustride = p->dimension * p->vorder;
- vstride = p->dimension;
- inMap2fEM(1, p->dimension,
- p->umin,
- p->umax,
- ustride,
- p->uorder,
- p->vmin,
- p->vmax,
- vstride,
- p->vorder,
- p->ctlpoints);
- }
- if(bpm->bpatch_color != NULL){
- bezierPatch* p = bpm->bpatch_color;
- ustride = p->dimension * p->vorder;
- vstride = p->dimension;
- inMap2fEM(2, p->dimension,
- p->umin,
- p->umax,
- ustride,
- p->uorder,
- p->vmin,
- p->vmax,
- vstride,
- p->vorder,
- p->ctlpoints);
- }
- if(bpm->bpatch_texcoord != NULL){
- bezierPatch* p = bpm->bpatch_texcoord;
- ustride = p->dimension * p->vorder;
- vstride = p->dimension;
- inMap2fEM(3, p->dimension,
- p->umin,
- p->umax,
- ustride,
- p->uorder,
- p->vmin,
- p->vmax,
- vstride,
- p->vorder,
- p->ctlpoints);
- }
-#endif
-
-
- k=0;
- for(i=0; i<bpm->index_length_array; i++)
- {
-#ifdef USE_LOD
- if(bpm->type_array[i] == GL_POLYGON) //a mesh
- {
- GLfloat *temp = bpm->UVarray+k;
- GLfloat u0 = temp[0];
- GLfloat v0 = temp[1];
- GLfloat u1 = temp[2];
- GLfloat v1 = temp[3];
- GLint nu = (GLint) ( temp[4]);
- GLint nv = (GLint) ( temp[5]);
- GLint umin = (GLint) ( temp[6]);
- GLint vmin = (GLint) ( temp[7]);
- GLint umax = (GLint) ( temp[8]);
- GLint vmax = (GLint) ( temp[9]);
-
- glMapGrid2f(LOD_eval_level*nu, u0, u1, LOD_eval_level*nv, v0, v1);
- glEvalMesh2(GL_FILL, LOD_eval_level*umin, LOD_eval_level*umax, LOD_eval_level*vmin, LOD_eval_level*vmax);
- }
- else
- {
- LOD_eval(bpm->length_array[i], bpm->UVarray+k, bpm->type_array[i],
- 0
- );
- }
- k+= 2*bpm->length_array[i];
-
-#else //undef USE_LOD
-
-#ifdef CRACK_TEST
-if( bpm->bpatch->umin == 2 && bpm->bpatch->umax == 3
- && bpm->bpatch->vmin ==2 && bpm->bpatch->vmax == 3)
-{
-REAL vertex[4];
-REAL normal[4];
-#ifdef DEBUG
-printf("***number ****1\n");
-#endif
-
-beginCallBack(GL_QUAD_STRIP, NULL);
-inDoEvalCoord2EM(3.0, 3.0);
-inDoEvalCoord2EM(2.0, 3.0);
-inDoEvalCoord2EM(3.0, 2.7);
-inDoEvalCoord2EM(2.0, 2.7);
-inDoEvalCoord2EM(3.0, 2.0);
-inDoEvalCoord2EM(2.0, 2.0);
-endCallBack(NULL);
-
-beginCallBack(GL_TRIANGLE_STRIP, NULL);
-inDoEvalCoord2EM(2.0, 3.0);
-inDoEvalCoord2EM(2.0, 2.0);
-inDoEvalCoord2EM(2.0, 2.7);
-endCallBack(NULL);
-
-}
-if( bpm->bpatch->umin == 1 && bpm->bpatch->umax == 2
- && bpm->bpatch->vmin ==2 && bpm->bpatch->vmax == 3)
-{
-#ifdef DEBUG
-printf("***number 3\n");
-#endif
-beginCallBack(GL_QUAD_STRIP, NULL);
-inDoEvalCoord2EM(2.0, 3.0);
-inDoEvalCoord2EM(1.0, 3.0);
-inDoEvalCoord2EM(2.0, 2.3);
-inDoEvalCoord2EM(1.0, 2.3);
-inDoEvalCoord2EM(2.0, 2.0);
-inDoEvalCoord2EM(1.0, 2.0);
-endCallBack(NULL);
-
-beginCallBack(GL_TRIANGLE_STRIP, NULL);
-inDoEvalCoord2EM(2.0, 2.3);
-inDoEvalCoord2EM(2.0, 2.0);
-inDoEvalCoord2EM(2.0, 3.0);
-endCallBack(NULL);
-
-}
-return;
-#endif //CRACK_TEST
-
- beginCallBack(bpm->type_array[i], userData);
-
- for(j=0; j<bpm->length_array[i]; j++)
- {
- u = bpm->UVarray[k];
- v = bpm->UVarray[k+1];
-#ifdef USE_LOD
- LOD_EVAL_COORD(u,v);
-// glEvalCoord2f(u,v);
-#else
-
-#ifdef GENERIC_TEST
- float temp_normal[3];
- float temp_vertex[3];
- if(temp_signal == 0)
- {
- gTessVertexSphere(u,v, temp_normal, temp_vertex);
-//printf("normal=(%f,%f,%f)\n", temp_normal[0], temp_normal[1], temp_normal[2])//printf("veretx=(%f,%f,%f)\n", temp_vertex[0], temp_vertex[1], temp_vertex[2]);
- normalCallBack(temp_normal, userData);
- vertexCallBack(temp_vertex, userData);
- }
- else if(temp_signal == 1)
- {
- gTessVertexCyl(u,v, temp_normal, temp_vertex);
-//printf("normal=(%f,%f,%f)\n", temp_normal[0], temp_normal[1], temp_normal[2])//printf("veretx=(%f,%f,%f)\n", temp_vertex[0], temp_vertex[1], temp_vertex[2]);
- normalCallBack(temp_normal, userData);
- vertexCallBack(temp_vertex, userData);
- }
- else
-#endif //GENERIC_TEST
-
- inDoEvalCoord2EM(u,v);
-
-#endif //USE_LOD
-
- k += 2;
- }
- endCallBack(userData);
-
-#endif //USE_LOD
- }
-}
-
-void OpenGLSurfaceEvaluator::inBPMListEvalEM(bezierPatchMesh* list)
-{
- bezierPatchMesh* temp;
- for(temp = list; temp != NULL; temp = temp->next)
- {
- inBPMEvalEM(temp);
- }
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/mystdio.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/mystdio.h
deleted file mode 100755
index 1cc50d5b2..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/mystdio.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * mystdio.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Attic/mystdio.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glumystdio_h_
-#define __glumystdio_h_
-
-#ifdef STANDALONE
-inline void dprintf( char *, ... ) { }
-#endif
-
-#ifdef LIBRARYBUILD
-#ifndef NDEBUG
-#include <stdio.h>
-#define dprintf printf
-#else
-inline void dprintf( char *, ... ) { }
-#endif
-#endif
-
-#ifdef GLBUILD
-inline void dprintf( char *, ... ) { }
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#endif /* __glumystdio_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/mystdlib.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/mystdlib.h
deleted file mode 100755
index de0878bdf..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/mystdlib.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * mystdlib.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/Attic/mystdlib.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glumystdlib_h_
-#define __glumystdlib_h_
-
-#ifdef STANDALONE
-typedef unsigned int size_t;
-extern "C" void abort( void );
-extern "C" void * malloc( size_t );
-extern "C" void free( void * );
-#endif
-
-#ifdef LIBRARYBUILD
-#include <stdlib.h>
-#endif
-
-#ifdef GLBUILD
-typedef unsigned int size_t;
-extern "C" void abort( void );
-extern "C" void * malloc( size_t );
-extern "C" void free( void * );
-#endif
-
-#endif /* __glumystdlib_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/GNUmakefile b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/GNUmakefile
deleted file mode 100755
index 44a72c282..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/GNUmakefile
+++ /dev/null
@@ -1,160 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/GNUmakefile,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-
-include $(ROOT)/usr/include/make/commondefs
-
-TARGET = libinternals.a
-
-TARGETS = $(TARGET)
-
-LCXXDEFS = -DNDEBUG -DLIBRARYBUILD
-LCXXINCS = -I../nurbtess -I../interface -I../../include
-
-HFILES = \
- arc.h \
- arcsorter.h \
- arctess.h \
- backend.h \
- basiccrveval.h \
- basicsurfeval.h \
- bezierarc.h \
- bin.h \
- bufpool.h \
- cachingeval.h \
- coveandtiler.h \
- curve.h \
- curvelist.h \
- defines.h \
- displaylist.h \
- displaymode.h \
- flist.h \
- flistsorter.h \
- glimports.h \
- gridline.h \
- gridtrimvertex.h \
- gridvertex.h \
- hull.h \
- jarcloc.h \
- knotvector.h \
- mapdesc.h \
- maplist.h \
- mesher.h \
- monotonizer.h \
- myassert.h \
- mymath.h \
- mysetjmp.h \
- mystdio.h \
- mystdlib.h \
- mystring.h \
- nurbsconsts.h \
- nurbstess.h \
- patch.h \
- patchlist.h \
- pwlarc.h \
- quilt.h \
- reader.h \
- renderhints.h \
- simplemath.h \
- slicer.h \
- sorter.h \
- subdivider.h \
- trimline.h \
- trimregion.h \
- trimvertex.h \
- trimvertpool.h \
- types.h \
- uarray.h \
- varray.h \
- dataTransform.h \
- $(NULL)
-
-CCFILES = \
- arc.cc \
- arcsorter.cc \
- arctess.cc \
- backend.cc \
- basiccrveval.cc \
- basicsurfeval.cc \
- bin.cc \
- bufpool.cc \
- cachingeval.cc \
- ccw.cc \
- coveandtiler.cc \
- curve.cc \
- curvelist.cc \
- curvesub.cc \
- displaylist.cc \
- flist.cc \
- flistsorter.cc \
- hull.cc \
- intersect.cc \
- knotvector.cc \
- mapdesc.cc \
- mapdescv.cc \
- maplist.cc \
- mesher.cc \
- monotonizer.cc \
- mycode.cc \
- nurbsinterfac.cc \
- nurbstess.cc \
- patch.cc \
- patchlist.cc \
- quilt.cc \
- reader.cc \
- renderhints.cc \
- slicer.cc \
- sorter.cc \
- splitarcs.cc \
- subdivider.cc \
- tobezier.cc \
- trimline.cc \
- trimregion.cc \
- trimvertpool.cc \
- uarray.cc \
- varray.cc \
- dataTransform.cc \
- monoTriangulationBackend.cc \
- $(NULL)
-
-default libs libs_install install: $(TARGET)
-
-headers headers_install apps:
-
-$(TARGET): $(OBJECTS)
- $(AR) crl $@ $(OBJECTS);
-
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Imakefile b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Imakefile
deleted file mode 100755
index 968384985..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Imakefile
+++ /dev/null
@@ -1,98 +0,0 @@
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-#include <Library.tmpl>
-
-OBJS = \
- arc.o \
- arcsorter.o \
- arctess.o \
- backend.o \
- basiccrveval.o \
- basicsurfeval.o \
- bin.o \
- bufpool.o \
- cachingeval.o \
- ccw.o \
- coveandtiler.o \
- curve.o \
- curvelist.o \
- curvesub.o \
- dataTransform.o \
- displaylist.o \
- flist.o \
- flistsorter.o \
- hull.o \
- intersect.o \
- knotvector.o \
- mapdesc.o \
- mapdescv.o \
- maplist.o \
- mesher.o \
- monoTriangulationBackend.o \
- monotonizer.o \
- mycode.o \
- nurbsinterfac.o \
- nurbstess.o \
- patch.o \
- patchlist.o \
- quilt.o \
- reader.o \
- renderhints.o \
- slicer.o \
- sorter.o \
- splitarcs.o \
- subdivider.o \
- tobezier.o \
- trimline.o \
- trimregion.o \
- trimvertpool.o \
- uarray.o \
- varray.o
-
-INCLUDES = \
- -I../nurbtess \
- -I../../include \
- -I$(TOP)/include \
- -I$(TOP)/include/GL
-
-DEFINES = \
- -DLIBRARYBUILD \
- -DNDEBUG
-
-NormalCplusplusObjectRule()
-
-NormalLibraryTarget(internals, $(OBJS))
-
-DependTarget()
-CleanTarget()
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arc.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arc.cc
deleted file mode 100755
index 1d55bc723..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arc.cc
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * arc.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/arc.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include <stdio.h>
-#include "glimports.h"
-#include "mystdio.h"
-#include "myassert.h"
-#include "arc.h"
-#include "bin.h"
-#include "bezierarc.h"
-#include "pwlarc.h"
-#include "simplemath.h"
-
-/* local preprocessor definitions */
-#define ZERO 0.00001/*0.000001*/
-
-const int Arc::bezier_tag = (1<<13);
-const int Arc::arc_tag = (1<<3);
-const int Arc::tail_tag = (1<<6);
-
-/*--------------------------------------------------------------------------
- * makeSide - attach a pwl arc to an arc and mark it as a border arc
- *--------------------------------------------------------------------------
- */
-
-void
-Arc::makeSide( PwlArc *pwl, arc_side side )
-{
- assert( pwl != 0);
- assert( pwlArc == 0 );
- assert( pwl->npts > 0 );
- assert( pwl->pts != 0);
- pwlArc = pwl;
- clearbezier();
- setside( side );
-}
-
-
-/*--------------------------------------------------------------------------
- * numpts - count number of points on arc loop
- *--------------------------------------------------------------------------
- */
-
-int
-Arc::numpts( void )
-{
- Arc_ptr jarc = this;
- int npts = 0;
- do {
- npts += jarc->pwlArc->npts;
- jarc = jarc->next;
- } while( jarc != this );
- return npts;
-}
-
-/*--------------------------------------------------------------------------
- * markverts - mark each point with id of arc
- *--------------------------------------------------------------------------
- */
-
-void
-Arc::markverts( void )
-{
- Arc_ptr jarc = this;
-
- do {
- TrimVertex *p = jarc->pwlArc->pts;
- for( int i=0; i<jarc->pwlArc->npts; i++ )
- p[i].nuid = jarc->nuid;
- jarc = jarc->next;
- } while( jarc != this );
-}
-
-/*--------------------------------------------------------------------------
- * getextrema - find axis extrema on arc loop
- *--------------------------------------------------------------------------
- */
-
-void
-Arc::getextrema( Arc_ptr extrema[4] )
-{
- REAL leftpt, botpt, rightpt, toppt;
-
- extrema[0] = extrema[1] = extrema[2] = extrema[3] = this;
-
- leftpt = rightpt = this->tail()[0];
- botpt = toppt = this->tail()[1];
-
- for( Arc_ptr jarc = this->next; jarc != this; jarc = jarc->next ) {
- if ( jarc->tail()[0] < leftpt ||
- (jarc->tail()[0] <= leftpt && jarc->rhead()[0]<=leftpt)) {
- leftpt = jarc->pwlArc->pts->param[0];
- extrema[1] = jarc;
- }
- if ( jarc->tail()[0] > rightpt ||
- (jarc->tail()[0] >= rightpt && jarc->rhead()[0] >= rightpt)) {
- rightpt = jarc->pwlArc->pts->param[0];
- extrema[3] = jarc;
- }
- if ( jarc->tail()[1] < botpt ||
- (jarc->tail()[1] <= botpt && jarc->rhead()[1] <= botpt )) {
- botpt = jarc->pwlArc->pts->param[1];
- extrema[2] = jarc;
- }
- if ( jarc->tail()[1] > toppt ||
- (jarc->tail()[1] >= toppt && jarc->rhead()[1] >= toppt)) {
- toppt = jarc->pwlArc->pts->param[1];
- extrema[0] = jarc;
- }
- }
-}
-
-
-/*-------------------------------------------------------------------------
- * show - print to the stdout the vertices of a pwl arc
- *-------------------------------------------------------------------------
- */
-
-void
-Arc::show()
-{
-#ifndef NDEBUG
- dprintf( "\tPWLARC NP: %d FL: 1\n", pwlArc->npts );
- for( int i = 0; i < pwlArc->npts; i++ ) {
- dprintf( "\t\tVERTEX %f %f\n", pwlArc->pts[i].param[0],
- pwlArc->pts[i].param[1] );
- }
-#endif
-}
-
-/*-------------------------------------------------------------------------
- * print - print out the vertices of all pwl arcs on a loop
- *-------------------------------------------------------------------------
- */
-
-void
-Arc::print( void )
-{
- Arc_ptr jarc = this;
-
- if( ! this ) {
-#ifndef NDEBUG
- dprintf( "\n\nEMPTY TRIM\n\n" );
-#endif
- return;
- }
-
-#ifndef NDEBUG
- dprintf( "BGNTRIM\n" );
-#endif
- do {
- jarc->show( );
- jarc = jarc->next;
- } while (jarc != this);
-#ifndef NDEBUG
- dprintf("ENDTRIM\n" );
-#endif
-}
-
-/*-------------------------------------------------------------------------
- * isDisconnected - check if tail of arc and head of prev meet
- *-------------------------------------------------------------------------
- */
-
-int
-Arc::isDisconnected( void )
-{
- if( pwlArc == 0 ) return 0;
- if( prev->pwlArc == 0 ) return 0;
-
- REAL *p0 = tail();
- REAL *p1 = prev->rhead();
-
- if( ((p0[0] - p1[0]) > ZERO) || ((p1[0] - p0[0]) > ZERO) ||
- ((p0[1] - p1[1]) > ZERO) || ((p1[1] - p0[1]) > ZERO) ) {
-#ifndef NDEBUG
- dprintf( "x coord = %f %f %f\n", p0[0], p1[0], p0[0] - p1[0] );
- dprintf( "y coord = %f %f %f\n", p0[1], p1[1], p0[1] - p1[1] );
-#endif
- return 1;
- } else {
- /* average two points together */
- p0[0] = p1[0] = (p1[0] + p0[0]) * 0.5;
- p0[1] = p1[1] = (p1[1] + p0[1]) * 0.5;
- return 0;
- }
-}
-
-/*-------------------------------------------------------------------------
- * neq_vert - assert that two 2D vertices are not equal
- *-------------------------------------------------------------------------
- */
-
-inline static int
-neq_vert( REAL *v1, REAL *v2 )
-{
- return ((v1[0] != v2[0]) || (v1[1] != v2[1] )) ? 1 : 0;
-}
-
-/*-------------------------------------------------------------------------
- * check - verify consistency of a loop, including
- * 1) if pwl, no two consecutive vertices are identical
- * 2) the circular link pointers are valid
- * 3) the geometric info at the head and tail are consistent
- *-------------------------------------------------------------------------
- */
-
-int
-Arc::check( void )
-{
- if( this == 0 ) return 1;
- Arc_ptr jarc = this;
- do {
- assert( (jarc->pwlArc != 0) || (jarc->bezierArc != 0) );
-
- if (jarc->prev == 0 || jarc->next == 0) {
-#ifndef NDEBUG
- dprintf( "checkjarc:null next/prev pointer\n");
- jarc->print( );
-#endif
- return 0;
- }
-
- if (jarc->next->prev != jarc) {
-#ifndef NDEBUG
- dprintf( "checkjarc: pointer linkage screwed up\n");
- jarc->print( );
-#endif
- return 0;
- }
-
- if( jarc->pwlArc ) {
-#ifndef NDEBUG
- assert( jarc->pwlArc->npts >= 1 );
- assert( jarc->pwlArc->npts < 100000 );
-/*
- for( int i=0; i < jarc->pwlArc->npts-1; i++ )
- assert( neq_vert( jarc->pwlArc->pts[i].param,
- jarc->pwlArc->pts[i+1].param) );
-*/
-#endif
- if( jarc->prev->pwlArc ) {
- if( jarc->tail()[1] != jarc->prev->rhead()[1] ) {
-#ifndef NDEBUG
- dprintf( "checkjarc: geometric linkage screwed up 1\n");
- jarc->prev->show();
- jarc->show();
-#endif
- return 0;
- }
- if( jarc->tail()[0] != jarc->prev->rhead()[0] ) {
-
-#ifndef NDEBUG
- dprintf( "checkjarc: geometric linkage screwed up 2\n");
- jarc->prev->show();
- jarc->show();
-#endif
- return 0;
- }
- }
- if( jarc->next->pwlArc ) {
- if( jarc->next->tail()[0] != jarc->rhead()[0] ) {
-#ifndef NDEBUG
- dprintf( "checkjarc: geometric linkage screwed up 3\n");
- jarc->show();
- jarc->next->show();
-#endif
- return 0;
- }
- if( jarc->next->tail()[1] != jarc->rhead()[1] ) {
-#ifndef NDEBUG
- dprintf( "checkjarc: geometric linkage screwed up 4\n");
- jarc->show();
- jarc->next->show();
-#endif
- return 0;
- }
- }
- if( jarc->isbezier() ) {
- assert( jarc->pwlArc->npts == 2 );
- assert( (jarc->pwlArc->pts[0].param[0] == \
- jarc->pwlArc->pts[1].param[0]) ||\
- (jarc->pwlArc->pts[0].param[1] == \
- jarc->pwlArc->pts[1].param[1]) );
- }
- }
- jarc = jarc->next;
- } while (jarc != this);
- return 1;
-}
-
-
-#define TOL 0.00001
-
-inline long tooclose( REAL x, REAL y )
-{
- return (abs(x-y) < TOL) ? 1 : 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * append - append a jordan arc to a circularly linked list
- *--------------------------------------------------------------------------
- */
-
-Arc_ptr
-Arc::append( Arc_ptr jarc )
-{
- if( jarc != 0 ) {
- next = jarc->next;
- prev = jarc;
- next->prev = prev->next = this;
- } else {
- next = prev = this;
- }
- return this;
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arc.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arc.h
deleted file mode 100755
index 216ba1937..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arc.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * arc.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/arc.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gluarc_h_
-#define __gluarc_h_
-
-#include "myassert.h"
-#include "bufpool.h"
-#include "mystdio.h"
-#include "types.h"
-#include "pwlarc.h"
-#include "trimvertex.h"
-
-class Bin;
-class Arc;
-class BezierArc;
-
-typedef class Arc *Arc_ptr;
-
-enum arc_side { arc_none = 0, arc_right, arc_top, arc_left, arc_bottom };
-
-
-class Arc: public PooledObj { /* an arc, in two list, the trim list and bin */
-
-public:
- static const int bezier_tag;
- static const int arc_tag;
- static const int tail_tag;
- Arc_ptr prev; /* trim list pointer */
- Arc_ptr next; /* trim list pointer */
- Arc_ptr link; /* bin pointers */
- BezierArc * bezierArc; /* associated bezier arc */
- PwlArc * pwlArc; /* associated pwl arc */
- long type; /* curve type */
- long nuid;
-
- inline Arc( Arc *, PwlArc * );
- inline Arc( arc_side, long );
-
- Arc_ptr append( Arc_ptr );
- int check( void );
- int isMonotone( void );
- int isDisconnected( void );
- int numpts( void );
- void markverts( void );
- void getextrema( Arc_ptr[4] );
- void print( void );
- void show( void );
- void makeSide( PwlArc *, arc_side );
- inline int isTessellated() { return pwlArc ? 1 : 0; }
- inline long isbezier() { return type & bezier_tag; }
- inline void setbezier() { type |= bezier_tag; }
- inline void clearbezier() { type &= ~bezier_tag; }
- inline long npts() { return pwlArc->npts; }
- inline TrimVertex * pts() { return pwlArc->pts; }
- inline REAL * tail() { return pwlArc->pts[0].param; }
- inline REAL * head() { return next->pwlArc->pts[0].param; }
- inline REAL * rhead() { return pwlArc->pts[pwlArc->npts-1].param; }
- inline long ismarked() { return type & arc_tag; }
- inline void setmark() { type |= arc_tag; }
- inline void clearmark() { type &= (~arc_tag); }
- inline void clearside() { type &= ~(0x7 << 8); }
- inline void setside( arc_side s ) { clearside(); type |= (((long)s)<<8); }
- inline arc_side getside() { return (arc_side) ((type>>8) & 0x7); }
- inline int getitail() { return type & tail_tag; }
- inline void setitail() { type |= tail_tag; }
- inline void clearitail() { type &= (~tail_tag); }
-};
-
-/*--------------------------------------------------------------------------
- * Arc - initialize a new Arc with the same type and uid of
- * a given Arc and a given pwl arc
- *--------------------------------------------------------------------------
- */
-
-inline
-Arc::Arc( Arc *j, PwlArc *p )
-{
- bezierArc = NULL;
- pwlArc = p;
- type = j->type;
- nuid = j->nuid;
-}
-
-/*--------------------------------------------------------------------------
- * Arc - initialize a new Arc with the same type and uid of
- * a given Arc and a given pwl arc
- *--------------------------------------------------------------------------
- */
-
-inline
-Arc::Arc( arc_side side, long _nuid )
-{
- bezierArc = NULL;
- pwlArc = NULL;
- type = 0;
- setside( side );
- nuid = _nuid;
-}
-
-#endif /* __gluarc_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arcsorter.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arcsorter.cc
deleted file mode 100755
index dc1270753..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arcsorter.cc
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * arcsorter.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/arcsorter.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gluarcsorter_c_
-#define __gluarcsorter_c_
-
-#include "glimports.h"
-#include "arc.h"
-#include "arcsorter.h"
-#include "subdivider.h"
-
-ArcSorter::ArcSorter(Subdivider &s) : Sorter( sizeof( Arc ** ) ), subdivider(s)
-{
-}
-
-int
-ArcSorter::qscmp( char *, char * )
-{
- dprintf( "ArcSorter::qscmp: pure virtual called\n" );
- return 0;
-}
-
-void
-ArcSorter::qsort( Arc **a, int n )
-{
- Sorter::qsort( (void *) a, n );
-}
-
-void
-ArcSorter::qsexc( char *i, char *j )// i<-j, j<-i
-{
- Arc **jarc1 = (Arc **) i;
- Arc **jarc2 = (Arc **) j;
- Arc *tmp = *jarc1;
- *jarc1 = *jarc2;
- *jarc2 = tmp;
-}
-
-void
-ArcSorter::qstexc( char *i, char *j, char *k )// i<-k, k<-j, j<-i
-{
- Arc **jarc1 = (Arc **) i;
- Arc **jarc2 = (Arc **) j;
- Arc **jarc3 = (Arc **) k;
- Arc *tmp = *jarc1;
- *jarc1 = *jarc3;
- *jarc3 = *jarc2;
- *jarc2 = tmp;
-}
-
-
-ArcSdirSorter::ArcSdirSorter( Subdivider &s ) : ArcSorter(s)
-{
-}
-
-int
-ArcSdirSorter::qscmp( char *i, char *j )
-{
- Arc *jarc1 = *(Arc **) i;
- Arc *jarc2 = *(Arc **) j;
-
- int v1 = (jarc1->getitail() ? 0 : (jarc1->pwlArc->npts - 1));
- int v2 = (jarc2->getitail() ? 0 : (jarc2->pwlArc->npts - 1));
-
- REAL diff = jarc1->pwlArc->pts[v1].param[1] -
- jarc2->pwlArc->pts[v2].param[1];
-
- if( diff < 0.0)
- return -1;
- else if( diff > 0.0)
- return 1;
- else {
- if( v1 == 0 ) {
- if( jarc2->tail()[0] < jarc1->tail()[0] ) {
- return subdivider.ccwTurn_sl( jarc2, jarc1 ) ? 1 : -1;
- } else {
- return subdivider.ccwTurn_sr( jarc2, jarc1 ) ? -1 : 1;
- }
- } else {
- if( jarc2->head()[0] < jarc1->head()[0] ) {
- return subdivider.ccwTurn_sl( jarc1, jarc2 ) ? -1 : 1;
- } else {
- return subdivider.ccwTurn_sr( jarc1, jarc2 ) ? 1 : -1;
- }
- }
- }
-}
-
-ArcTdirSorter::ArcTdirSorter( Subdivider &s ) : ArcSorter(s)
-{
-}
-
-/*----------------------------------------------------------------------------
- * ArcTdirSorter::qscmp -
- * compare two axis monotone arcs that are incident
- * to the line T == compare_value. Determine which of the
- * two intersects that line with a LESSER S value. If
- * jarc1 does, return 1. If jarc2 does, return -1.
- *----------------------------------------------------------------------------
- */
-int
-ArcTdirSorter::qscmp( char *i, char *j )
-{
- Arc *jarc1 = *(Arc **) i;
- Arc *jarc2 = *(Arc **) j;
-
- int v1 = (jarc1->getitail() ? 0 : (jarc1->pwlArc->npts - 1));
- int v2 = (jarc2->getitail() ? 0 : (jarc2->pwlArc->npts - 1));
-
- REAL diff = jarc1->pwlArc->pts[v1].param[0] -
- jarc2->pwlArc->pts[v2].param[0];
-
- if( diff < 0.0)
- return 1;
- else if( diff > 0.0)
- return -1;
- else {
- if( v1 == 0 ) {
- if (jarc2->tail()[1] < jarc1->tail()[1]) {
- return subdivider.ccwTurn_tl( jarc2, jarc1 ) ? 1 : -1;
- } else {
- return subdivider.ccwTurn_tr( jarc2, jarc1 ) ? -1 : 1;
- }
- } else {
- if( jarc2->head()[1] < jarc1->head()[1] ) {
- return subdivider.ccwTurn_tl( jarc1, jarc2 ) ? -1 : 1;
- } else {
- return subdivider.ccwTurn_tr( jarc1, jarc2 ) ? 1 : -1;
- }
- }
- }
-}
-
-
-
-#endif /* __gluarcsorter_c_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arcsorter.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arcsorter.h
deleted file mode 100755
index 901a15261..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arcsorter.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * arcsorter.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/arcsorter.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gluarcsorter_h_
-#define __gluarcsorter_h_
-
-#include "sorter.h"
-#include "arcsorter.h"
-
-class Arc;
-class Subdivider;
-
-class ArcSorter : private Sorter {
-public:
- ArcSorter(Subdivider &);
- void qsort( Arc **a, int n );
-protected:
- virtual int qscmp( char *, char * );
- Subdivider& subdivider;
-private:
- void qsexc( char *i, char *j ); // i<-j, j<-i
- void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i
-};
-
-
-class ArcSdirSorter : public ArcSorter {
-public:
- ArcSdirSorter( Subdivider & );
-private:
- int qscmp( char *, char * );
-};
-
-
-class ArcTdirSorter : public ArcSorter {
-public:
- ArcTdirSorter( Subdivider & );
-private:
- int qscmp( char *, char * );
-};
-
-#endif /* __gluarcsorter_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arctess.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arctess.cc
deleted file mode 100755
index 5db4e1727..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arctess.cc
+++ /dev/null
@@ -1,609 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * arctessellator.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/arctess.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "mystdio.h"
-#include "myassert.h"
-#include "arctess.h"
-#include "bufpool.h"
-#include "simplemath.h"
-#include "bezierarc.h"
-#include "trimvertex.h"
-#include "trimvertpool.h"
-
-#define NOELIMINATION
-
-#define steps_function(large, small, rate) (max(1, 1+ (int) ((large-small)/rate)));
-
-/*-----------------------------------------------------------------------------
- * ArcTessellator - construct an ArcTessellator
- *-----------------------------------------------------------------------------
- */
-
-ArcTessellator::ArcTessellator( TrimVertexPool& t, Pool& p )
- : trimvertexpool(t), pwlarcpool(p)
-{
-}
-
-/*-----------------------------------------------------------------------------
- * ~ArcTessellator - destroy an ArcTessellator
- *-----------------------------------------------------------------------------
- */
-
-ArcTessellator::~ArcTessellator( void )
-{
-}
-
-/*-----------------------------------------------------------------------------
- * bezier - construct a bezier arc and attach it to an Arc
- *-----------------------------------------------------------------------------
- */
-
-void
-ArcTessellator::bezier( Arc *arc, REAL s1, REAL s2, REAL t1, REAL t2 )
-{
- assert( arc != 0 );
- assert( ! arc->isTessellated() );
-
-#ifndef NDEBUG
- switch( arc->getside() ) {
- case arc_left:
- assert( s1 == s2 );
- assert( t2 < t1 );
- break;
- case arc_right:
- assert( s1 == s2 );
- assert( t1 < t2 );
- break;
- case arc_top:
- assert( t1 == t2 );
- assert( s2 < s1 );
- break;
- case arc_bottom:
- assert( t1 == t2 );
- assert( s1 < s2 );
- break;
- case arc_none:
- (void) abort();
- break;
- }
-#endif
-
- TrimVertex *p = trimvertexpool.get(2);
- arc->pwlArc = new(pwlarcpool) PwlArc( 2, p );
- p[0].param[0] = s1;
- p[0].param[1] = t1;
- p[1].param[0] = s2;
- p[1].param[1] = t2;
- assert( (s1 == s2) || (t1 == t2) );
- arc->setbezier();
-}
-
-
-/*-----------------------------------------------------------------------------
- * pwl_left - construct a left boundary pwl arc and attach it to an arc
- *-----------------------------------------------------------------------------
- */
-
-void
-ArcTessellator::pwl_left( Arc *arc, REAL s, REAL t1, REAL t2, REAL rate )
-{
- assert( t2 < t1 );
-
-/* if(rate <= 0.06) rate = 0.06;*/
-/* int nsteps = 1 + (int) ((t1 - t2) / rate ); */
- int nsteps = steps_function(t1, t2, rate);
-
-
- REAL stepsize = (t1 - t2) / (REAL) nsteps;
-
- TrimVertex *newvert = trimvertexpool.get( nsteps+1 );
- int i;
- for( i = nsteps; i > 0; i-- ) {
- newvert[i].param[0] = s;
- newvert[i].param[1] = t2;
- t2 += stepsize;
- }
- newvert[i].param[0] = s;
- newvert[i].param[1] = t1;
-
- arc->makeSide( new(pwlarcpool) PwlArc( nsteps+1, newvert ), arc_left );
-}
-
-/*-----------------------------------------------------------------------------
- * pwl_right - construct a right boundary pwl arc and attach it to an arc
- *-----------------------------------------------------------------------------
- */
-
-void
-ArcTessellator::pwl_right( Arc *arc, REAL s, REAL t1, REAL t2, REAL rate )
-{
- assert( t1 < t2 );
-
-/* if(rate <= 0.06) rate = 0.06;*/
-
-/* int nsteps = 1 + (int) ((t2 - t1) / rate ); */
- int nsteps = steps_function(t2,t1,rate);
- REAL stepsize = (t2 - t1) / (REAL) nsteps;
-
- TrimVertex *newvert = trimvertexpool.get( nsteps+1 );
- int i;
- for( i = 0; i < nsteps; i++ ) {
- newvert[i].param[0] = s;
- newvert[i].param[1] = t1;
- t1 += stepsize;
- }
- newvert[i].param[0] = s;
- newvert[i].param[1] = t2;
-
- arc->makeSide( new(pwlarcpool) PwlArc( nsteps+1, newvert ), arc_right );
-}
-
-
-/*-----------------------------------------------------------------------------
- * pwl_top - construct a top boundary pwl arc and attach it to an arc
- *-----------------------------------------------------------------------------
- */
-
-void
-ArcTessellator::pwl_top( Arc *arc, REAL t, REAL s1, REAL s2, REAL rate )
-{
- assert( s2 < s1 );
-
-/* if(rate <= 0.06) rate = 0.06;*/
-
-/* int nsteps = 1 + (int) ((s1 - s2) / rate ); */
- int nsteps = steps_function(s1,s2,rate);
- REAL stepsize = (s1 - s2) / (REAL) nsteps;
-
- TrimVertex *newvert = trimvertexpool.get( nsteps+1 );
- int i;
- for( i = nsteps; i > 0; i-- ) {
- newvert[i].param[0] = s2;
- newvert[i].param[1] = t;
- s2 += stepsize;
- }
- newvert[i].param[0] = s1;
- newvert[i].param[1] = t;
-
- arc->makeSide( new(pwlarcpool) PwlArc( nsteps+1, newvert ), arc_top );
-}
-
-/*-----------------------------------------------------------------------------
- * pwl_bottom - construct a bottom boundary pwl arc and attach it to an arc
- *-----------------------------------------------------------------------------
- */
-
-void
-ArcTessellator::pwl_bottom( Arc *arc, REAL t, REAL s1, REAL s2, REAL rate )
-{
- assert( s1 < s2 );
-
-/* if(rate <= 0.06) rate = 0.06;*/
-
-/* int nsteps = 1 + (int) ((s2 - s1) / rate ); */
- int nsteps = steps_function(s2,s1,rate);
- REAL stepsize = (s2 - s1) / (REAL) nsteps;
-
- TrimVertex *newvert = trimvertexpool.get( nsteps+1 );
- int i;
- for( i = 0; i < nsteps; i++ ) {
- newvert[i].param[0] = s1;
- newvert[i].param[1] = t;
- s1 += stepsize;
- }
- newvert[i].param[0] = s2;
- newvert[i].param[1] = t;
-
- arc->makeSide( new(pwlarcpool) PwlArc( nsteps+1, newvert ), arc_bottom );
-}
-
-/*-----------------------------------------------------------------------------
- * pwl - construct a pwl arc and attach it to an arc
- *-----------------------------------------------------------------------------
- */
-
-void
-ArcTessellator::pwl( Arc *arc, REAL s1, REAL s2, REAL t1, REAL t2, REAL rate )
-{
-
-/* if(rate <= 0.06) rate = 0.06;*/
-
- int snsteps = 1 + (int) (abs(s2 - s1) / rate );
- int tnsteps = 1 + (int) (abs(t2 - t1) / rate );
- int nsteps = max(1,max( snsteps, tnsteps ));
-
- REAL sstepsize = (s2 - s1) / (REAL) nsteps;
- REAL tstepsize = (t2 - t1) / (REAL) nsteps;
- TrimVertex *newvert = trimvertexpool.get( nsteps+1 );
- long i;
- for( i = 0; i < nsteps; i++ ) {
- newvert[i].param[0] = s1;
- newvert[i].param[1] = t1;
- s1 += sstepsize;
- t1 += tstepsize;
- }
- newvert[i].param[0] = s2;
- newvert[i].param[1] = t2;
-
- /* arc->makeSide( new(pwlarcpool) PwlArc( nsteps+1, newvert ), arc_bottom ); */
- arc->pwlArc = new(pwlarcpool) PwlArc( nsteps+1, newvert );
-
- arc->clearbezier();
- arc->clearside( );
-}
-
-
-/*-----------------------------------------------------------------------------
- * tessellateLinear - constuct a linear pwl arc and attach it to an Arc
- *-----------------------------------------------------------------------------
- */
-
-void
-ArcTessellator::tessellateLinear( Arc *arc, REAL geo_stepsize, REAL arc_stepsize, int isrational )
-{
- assert( arc->pwlArc == NULL );
- REAL s1, s2, t1, t2;
-
- //we don't need to scale by arc_stepsize if the trim curve
- //is piecewise linear. Reason: In pwl_right, pwl_left, pwl_top, pwl_left,
- //and pwl, the nsteps is computed by deltaU (or V) /stepsize.
- //The quantity deltaU/arc_stepsize doesn't have any meaning. And
- //it causes problems: see bug 517641
- REAL stepsize = geo_stepsize; /* * arc_stepsize*/;
-
- BezierArc *b = arc->bezierArc;
-
- if( isrational ) {
- s1 = b->cpts[0] / b->cpts[2];
- t1 = b->cpts[1] / b->cpts[2];
- s2 = b->cpts[b->stride+0] / b->cpts[b->stride+2];
- t2 = b->cpts[b->stride+1] / b->cpts[b->stride+2];
- } else {
- s1 = b->cpts[0];
- t1 = b->cpts[1];
- s2 = b->cpts[b->stride+0];
- t2 = b->cpts[b->stride+1];
- }
- if( s1 == s2 )
- if( t1 < t2 )
- pwl_right( arc, s1, t1, t2, stepsize );
- else
- pwl_left( arc, s1, t1, t2, stepsize );
- else if( t1 == t2 )
- if( s1 < s2 )
- pwl_bottom( arc, t1, s1, s2, stepsize );
- else
- pwl_top( arc, t1, s1, s2, stepsize );
- else
- pwl( arc, s1, s2, t1, t2, stepsize );
-}
-
-/*-----------------------------------------------------------------------------
- * tessellateNonlinear - constuct a nonlinear pwl arc and attach it to an Arc
- *-----------------------------------------------------------------------------
- */
-
-void
-ArcTessellator::tessellateNonlinear( Arc *arc, REAL geo_stepsize, REAL arc_stepsize, int isrational )
-{
- assert( arc->pwlArc == NULL );
-
- REAL stepsize = geo_stepsize * arc_stepsize;
-
- BezierArc *bezierArc = arc->bezierArc;
-
- REAL size; //bounding box size of the curve in UV
- {
- int i,j;
- REAL min_u, min_v, max_u,max_v;
- min_u = max_u = bezierArc->cpts[0];
- min_v = max_v = bezierArc->cpts[1];
- for(i=1, j=2; i<bezierArc->order; i++, j+= bezierArc->stride)
- {
- if(bezierArc->cpts[j] < min_u)
- min_u = bezierArc->cpts[j];
- if(bezierArc->cpts[j] > max_u)
- max_u = bezierArc->cpts[j];
- if(bezierArc->cpts[j+1] < min_v)
- min_v = bezierArc->cpts[j+1];
- if(bezierArc->cpts[j+1] > max_v)
- max_v = bezierArc->cpts[j+1];
- }
-
- size = max_u - min_u;
- if(size < max_v - min_v)
- size = max_v - min_v;
- }
-
- /*int nsteps = 1 + (int) (1.0/stepsize);*/
-
- int nsteps = (int) (size/stepsize);
- if(nsteps <=0)
- nsteps=1;
-
- TrimVertex *vert = trimvertexpool.get( nsteps+1 );
- REAL dp = 1.0/nsteps;
-
-
- arc->pwlArc = new(pwlarcpool) PwlArc();
- arc->pwlArc->pts = vert;
-
- if( isrational ) {
- REAL pow_u[MAXORDER], pow_v[MAXORDER], pow_w[MAXORDER];
- trim_power_coeffs( bezierArc, pow_u, 0 );
- trim_power_coeffs( bezierArc, pow_v, 1 );
- trim_power_coeffs( bezierArc, pow_w, 2 );
-
- /* compute first point exactly */
- REAL *b = bezierArc->cpts;
- vert->param[0] = b[0]/b[2];
- vert->param[1] = b[1]/b[2];
-
- /* strength reduction on p = dp * step would introduce error */
- int step;
- int ocanremove = 0;
- register long order = bezierArc->order;
- for( step=1, ++vert; step<nsteps; step++, vert++ ) {
- register REAL p = dp * step;
- register REAL u = pow_u[0];
- register REAL v = pow_v[0];
- register REAL w = pow_w[0];
- for( register int i = 1; i < order; i++ ) {
- u = u * p + pow_u[i];
- v = v * p + pow_v[i];
- w = w * p + pow_w[i];
- }
- vert->param[0] = u/w;
- vert->param[1] = v/w;
-#ifndef NOELIMINATION
- REAL ds = abs(vert[0].param[0] - vert[-1].param[0]);
- REAL dt = abs(vert[0].param[1] - vert[-1].param[1]);
- int canremove = (ds<geo_stepsize && dt<geo_stepsize) ? 1 : 0;
- REAL ods=0.0, odt=0.0;
-
- if( ocanremove && canremove ) {
- REAL nds = ds + ods;
- REAL ndt = dt + odt;
- if( nds<geo_stepsize && ndt<geo_stepsize ) {
- // remove previous point
- --vert;
- vert[0].param[0] = vert[1].param[0];
- vert[0].param[1] = vert[1].param[1];
- ods = nds;
- odt = ndt;
- ocanremove = 1;
- } else {
- ocanremove = canremove;
- ods = ds;
- odt = dt;
- }
- } else {
- ocanremove = canremove;
- ods = ds;
- odt = dt;
- }
-#endif
- }
-
- /* compute last point exactly */
- b += (order - 1) * bezierArc->stride;
- vert->param[0] = b[0]/b[2];
- vert->param[1] = b[1]/b[2];
-
- } else {
- REAL pow_u[MAXORDER], pow_v[MAXORDER];
- trim_power_coeffs( bezierArc, pow_u, 0 );
- trim_power_coeffs( bezierArc, pow_v, 1 );
-
- /* compute first point exactly */
- REAL *b = bezierArc->cpts;
- vert->param[0] = b[0];
- vert->param[1] = b[1];
-
- /* strength reduction on p = dp * step would introduce error */
- int step;
- int ocanremove = 0;
- register long order = bezierArc->order;
- for( step=1, ++vert; step<nsteps; step++, vert++ ) {
- register REAL p = dp * step;
- register REAL u = pow_u[0];
- register REAL v = pow_v[0];
- for( register int i = 1; i < bezierArc->order; i++ ) {
- u = u * p + pow_u[i];
- v = v * p + pow_v[i];
- }
- vert->param[0] = u;
- vert->param[1] = v;
-#ifndef NOELIMINATION
- REAL ds = abs(vert[0].param[0] - vert[-1].param[0]);
- REAL dt = abs(vert[0].param[1] - vert[-1].param[1]);
- int canremove = (ds<geo_stepsize && dt<geo_stepsize) ? 1 : 0;
- REAL ods=0.0, odt=0.0;
-
- if( ocanremove && canremove ) {
- REAL nds = ds + ods;
- REAL ndt = dt + odt;
- if( nds<geo_stepsize && ndt<geo_stepsize ) {
- // remove previous point
- --vert;
- vert[0].param[0] = vert[1].param[0];
- vert[0].param[1] = vert[1].param[1];
- ods = nds;
- odt = ndt;
- ocanremove = 1;
- } else {
- ocanremove = canremove;
- ods = ds;
- odt = dt;
- }
- } else {
- ocanremove = canremove;
- ods = ds;
- odt = dt;
- }
-#endif
- }
-
- /* compute last point exactly */
- b += (order - 1) * bezierArc->stride;
- vert->param[0] = b[0];
- vert->param[1] = b[1];
- }
- arc->pwlArc->npts = vert - arc->pwlArc->pts + 1;
-/*
- for( TrimVertex *vt=pwlArc->pts; vt != vert-1; vt++ ) {
- if( tooclose( vt[0].param[0], vt[1].param[0] ) )
- vt[1].param[0] = vt[0].param[0];
- if( tooclose( vt[0].param[1], vt[1].param[1] ) )
- vt[1].param[1] = vt[0].param[1];
- }
-*/
-}
-
-const REAL ArcTessellator::gl_Bernstein[][MAXORDER][MAXORDER] = {
- {
- {1, 0, 0, 0, 0, 0, 0, 0 },
- {0, 0, 0, 0, 0, 0, 0, 0 },
- {0, 0, 0, 0, 0, 0, 0, 0 },
- {0, 0, 0, 0, 0, 0, 0, 0 },
- {0, 0, 0, 0, 0, 0, 0, 0 },
- {0, 0, 0, 0, 0, 0, 0, 0 },
- {0, 0, 0, 0, 0, 0, 0, 0 },
- {0, 0, 0, 0, 0, 0, 0, 0 }
- },
- {
- {-1, 1, 0, 0, 0, 0, 0, 0 },
- {1, 0, 0, 0, 0, 0, 0, 0 },
- {0, 0, 0, 0, 0, 0, 0, 0 },
- {0, 0, 0, 0, 0, 0, 0, 0 },
- {0, 0, 0, 0, 0, 0, 0, 0 },
- {0, 0, 0, 0, 0, 0, 0, 0 },
- {0, 0, 0, 0, 0, 0, 0, 0 },
- {0, 0, 0, 0, 0, 0, 0, 0 }
- },
- {
- {1, -2, 1, 0, 0, 0, 0, 0 },
- {-2, 2, 0, 0, 0, 0, 0, 0 },
- {1, 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, 3, -3, 1, 0, 0, 0, 0 },
- {3, -6, 3, 0, 0, 0, 0, 0 },
- {-3, 3, 0, 0, 0, 0, 0, 0 },
- {1, 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, -4, 6, -4, 1, 0, 0, 0 },
- {-4, 12, -12, 4, 0, 0, 0, 0 },
- {6, -12, 6, 0, 0, 0, 0, 0 },
- {-4, 4, 0, 0, 0, 0, 0, 0 },
- {1, 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, 5, -10, 10, -5, 1, 0, 0 },
- {5, -20, 30, -20, 5, 0, 0, 0 },
- {-10, 30, -30, 10, 0, 0, 0, 0 },
- {10, -20, 10, 0, 0, 0, 0, 0 },
- {-5, 5, 0, 0, 0, 0, 0, 0 },
- {1, 0, 0, 0, 0, 0, 0, 0 },
- {0, 0, 0, 0, 0, 0, 0, 0 },
- {0, 0, 0, 0, 0, 0, 0, 0 }
- },
- {
- {1, -6, 15, -20, 15, -6, 1, 0 },
- {-6, 30, -60, 60, -30, 6, 0, 0 },
- {15, -60, 90, -60, 15, 0, 0, 0 },
- {-20, 60, -60, 20, 0, 0, 0, 0 },
- {15, -30, 15, 0, 0, 0, 0, 0 },
- {-6, 6, 0, 0, 0, 0, 0, 0 },
- {1, 0, 0, 0, 0, 0, 0, 0 },
- {0, 0, 0, 0, 0, 0, 0, 0 }
- },
- {
- {-1, 7, -21, 35, -35, 21, -7, 1 },
- {7, -42, 105, -140, 105, -42, 7, 0 },
- {-21, 105, -210, 210, -105, 21, 0, 0 },
- {35, -140, 210, -140, 35, 0, 0, 0 },
- {-35, 105, -105, 35, 0, 0, 0, 0 },
- {21, -42, 21, 0, 0, 0, 0, 0 },
- {-7, 7, 0, 0, 0, 0, 0, 0 },
- {1, 0, 0, 0, 0, 0, 0, 0 }
- }};
-
-
-/*-----------------------------------------------------------------------------
- * trim_power_coeffs - compute power basis coefficients from bezier coeffients
- *-----------------------------------------------------------------------------
- */
-void
-ArcTessellator::trim_power_coeffs( BezierArc *bez_arc, REAL *p, int coord )
-{
- register int stride = bez_arc->stride;
- register int order = bez_arc->order;
- register REAL *base = bez_arc->cpts + coord;
-
- REAL const (*mat)[MAXORDER][MAXORDER] = &gl_Bernstein[order-1];
- REAL const (*lrow)[MAXORDER] = &(*mat)[order];
-
- /* WIN32 didn't like the following line within the for-loop */
- REAL const (*row)[MAXORDER] = &(*mat)[0];
- for( ; row != lrow; row++ ) {
- register REAL s = 0.0;
- register REAL *point = base;
- register REAL const *mlast = *row + order;
- for( REAL const *m = *row; m != mlast; m++, point += stride )
- s += *(m) * (*point);
- *(p++) = s;
- }
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arctess.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arctess.h
deleted file mode 100755
index 1d56b6db5..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arctess.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * arctess.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/arctess.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gluarctess_h_
-#define __gluarctess_h_
-
-#include "defines.h"
-#include "types.h"
-#include "arc.h"
-
-class BezierArc;
-class Pool;
-class TrimVertexPool;
-
-class ArcTessellator {
-public:
- ArcTessellator( TrimVertexPool&, Pool& );
- ~ArcTessellator( void );
- void bezier( Arc_ptr, REAL, REAL, REAL, REAL );
- void pwl( Arc_ptr, REAL, REAL, REAL, REAL, REAL );
- void pwl_left( Arc_ptr, REAL, REAL, REAL, REAL );
- void pwl_right( Arc_ptr, REAL, REAL, REAL, REAL );
- void pwl_top( Arc_ptr, REAL, REAL, REAL, REAL );
- void pwl_bottom( Arc_ptr, REAL, REAL, REAL, REAL );
- void tessellateLinear( Arc_ptr, REAL, REAL, int );
- void tessellateNonlinear( Arc_ptr, REAL, REAL, int );
-private:
- static const REAL gl_Bernstein[][MAXORDER][MAXORDER];
- Pool& pwlarcpool;
- TrimVertexPool& trimvertexpool;
- static void trim_power_coeffs( BezierArc *, REAL[MAXORDER], int );
-};
-
-#endif /* __gluarctess_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/backend.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/backend.cc
deleted file mode 100755
index 06fcaa62b..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/backend.cc
+++ /dev/null
@@ -1,591 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * backend.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/backend.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-/* Bezier surface backend
- - interprets display mode (wireframe,shaded,...)
-*/
-#include <stdio.h>
-#include "glimports.h"
-#include "mystdio.h"
-#include "backend.h"
-#include "basiccrveval.h"
-#include "basicsurfeval.h"
-#include "nurbsconsts.h"
-
-#define NOWIREFRAME
-
-
-/*-------------------------------------------------------------------------
- * bgnsurf - preamble to surface definition and evaluations
- *-------------------------------------------------------------------------
- */
-void
-Backend::bgnsurf( int wiretris, int wirequads, long nuid )
-{
-/*#ifndef NOWIREFRAME*/ //need this for old version
- wireframetris = wiretris;
- wireframequads = wirequads;
-/*#endif*/
-
- /*in the spec, GLU_DISPLAY_MODE is either
- * GLU_FILL
- * GLU_OUTLINE_POLY
- * GLU_OUTLINE_PATCH.
- *In fact, GLU_FLL is has the same effect as
- * set GL_FRONT_AND_BACK to be GL_FILL
- * and GLU_OUTLINE_POLY is the same as set
- * GL_FRONT_AND_BACK to be GL_LINE
- *It is more efficient to do this once at the beginning of
- *each surface than to do it for each primitive.
- * The internal has more options: outline_triangle and outline_quad
- *can be seperated. But since this is not in spec, and more importantly,
- *this is not so useful, so we don't need to keep this option.
- */
-
- surfaceEvaluator.bgnmap2f( nuid );
-
- if(wiretris)
- surfaceEvaluator.polymode(N_MESHLINE);
- else
- surfaceEvaluator.polymode(N_MESHFILL);
-}
-
-void
-Backend::patch( REAL ulo, REAL uhi, REAL vlo, REAL vhi )
-{
- surfaceEvaluator.domain2f( ulo, uhi, vlo, vhi );
-}
-
-void
-Backend::surfbbox( long type, REAL *from, REAL *to )
-{
- surfaceEvaluator.range2f( type, from, to );
-}
-
-/*-------------------------------------------------------------------------
- * surfpts - pass a desription of a surface map
- *-------------------------------------------------------------------------
- */
-void
-Backend::surfpts(
- long type, /* geometry, color, texture, normal */
- REAL *pts, /* control points */
- long ustride, /* distance to next point in u direction */
- long vstride, /* distance to next point in v direction */
- int uorder, /* u parametric order */
- int vorder, /* v parametric order */
- REAL ulo, /* u lower bound */
- REAL uhi, /* u upper bound */
- REAL vlo, /* v lower bound */
- REAL vhi ) /* v upper bound */
-{
- surfaceEvaluator.map2f( type,ulo,uhi,ustride,uorder,vlo,vhi,vstride,vorder,pts );
- surfaceEvaluator.enable( type );
-}
-
-/*-------------------------------------------------------------------------
- * surfgrid - define a lattice of points with origin and offset
- *-------------------------------------------------------------------------
- */
-void
-Backend::surfgrid( REAL u0, REAL u1, long nu, REAL v0, REAL v1, long nv )
-{
- surfaceEvaluator.mapgrid2f( nu, u0, u1, nv, v0, v1 );
-}
-
-/*-------------------------------------------------------------------------
- * surfmesh - evaluate a mesh of points on lattice
- *-------------------------------------------------------------------------
- */
-void
-Backend::surfmesh( long u, long v, long n, long m )
-{
-#ifndef NOWIREFRAME
- if( wireframequads ) {
- long v0, v1;
- long u0f = u, u1f = u+n;
- long v0f = v, v1f = v+m;
- long parity = (u & 1);
-
- for( v0 = v0f, v1 = v0f++ ; v0<v1f; v0 = v1, v1++ ) {
- surfaceEvaluator.bgnline();
- for( long u = u0f; u<=u1f; u++ ) {
- if( parity ) {
- surfaceEvaluator.evalpoint2i( u, v0 );
- surfaceEvaluator.evalpoint2i( u, v1 );
- } else {
- surfaceEvaluator.evalpoint2i( u, v1 );
- surfaceEvaluator.evalpoint2i( u, v0 );
- }
- parity = 1 - parity;
- }
- surfaceEvaluator.endline();
- }
- } else {
- surfaceEvaluator.mapmesh2f( N_MESHFILL, u, u+n, v, v+m );
- }
-#else
- if( wireframequads ) {
-
- surfaceEvaluator.mapmesh2f( N_MESHLINE, u, u+n, v, v+m );
- } else {
-
- surfaceEvaluator.mapmesh2f( N_MESHFILL, u, u+n, v, v+m );
- }
-#endif
-}
-
-/*-------------------------------------------------------------------------
- * endsurf - postamble to surface
- *-------------------------------------------------------------------------
- */
-void
-Backend::endsurf( void )
-{
- surfaceEvaluator.endmap2f();
-}
-
-/***************************************/
-void
-Backend::bgntfan( void )
-{
- surfaceEvaluator.bgntfan();
-/*
- if(wireframetris)
- surfaceEvaluator.polymode( N_MESHLINE );
- else
- surfaceEvaluator.polymode( N_MESHFILL );
-*/
-}
-
-void
-Backend::endtfan( void )
-{
- surfaceEvaluator.endtfan();
-}
-
-void
-Backend::bgnqstrip( void )
-{
- surfaceEvaluator.bgnqstrip();
-/*
- if(wireframequads)
- surfaceEvaluator.polymode( N_MESHLINE );
- else
- surfaceEvaluator.polymode( N_MESHFILL );
-*/
-}
-
-void
-Backend::endqstrip( void )
-{
- surfaceEvaluator.endqstrip();
-}
-
-void
-Backend::evalUStrip(int n_upper, REAL v_upper, REAL* upper_val,
- int n_lower, REAL v_lower, REAL* lower_val
- )
-{
- surfaceEvaluator.evalUStrip(n_upper, v_upper, upper_val,
- n_lower, v_lower, lower_val);
-}
-
-void
-Backend::evalVStrip(int n_left, REAL u_left, REAL* left_val,
- int n_right, REAL u_right, REAL* right_val
- )
-{
- surfaceEvaluator.evalVStrip(n_left, u_left, left_val,
- n_right, u_right, right_val);
-}
-
-/***************************************/
-
-
-/*-------------------------------------------------------------------------
- * bgntmesh - preamble to a triangle mesh
- *-------------------------------------------------------------------------
- */
-void
-Backend::bgntmesh( char * )
-{
-#ifndef NOWIREFRAME
-
- meshindex = 0; /* I think these need to be initialized to zero */
- npts = 0;
-
- if( !wireframetris ) {
- surfaceEvaluator.bgntmesh();
- }
-#else
-
- if( wireframetris ) {
- surfaceEvaluator.bgntmesh();
- surfaceEvaluator.polymode( N_MESHLINE );
- } else {
- surfaceEvaluator.bgntmesh();
- surfaceEvaluator.polymode( N_MESHFILL );
- }
-#endif
-}
-
-void
-Backend::tmeshvert( GridTrimVertex *v )
-{
- if( v->isGridVert() ) {
- tmeshvert( v->g );
- } else {
- tmeshvert( v->t );
- }
-}
-
-void
-Backend::tmeshvertNOGE(TrimVertex *t)
-{
-// surfaceEvaluator.inDoEvalCoord2NOGE( t->param[0], t->param[1], temp, ttt);
-#ifdef USE_OPTTT
- surfaceEvaluator.inDoEvalCoord2NOGE( t->param[0], t->param[1], t->cache_point, t->cache_normal);
-#endif
-}
-
-//opt for a line with the same u.
-void
-Backend::tmeshvertNOGE_BU(TrimVertex *t)
-{
-#ifdef USE_OPTTT
- surfaceEvaluator.inDoEvalCoord2NOGE_BU( t->param[0], t->param[1], t->cache_point, t->cache_normal);
-#endif
-}
-
-//opt for a line with the same v.
-void
-Backend::tmeshvertNOGE_BV(TrimVertex *t)
-{
-#ifdef USE_OPTTT
- surfaceEvaluator.inDoEvalCoord2NOGE_BV( t->param[0], t->param[1], t->cache_point, t->cache_normal);
-#endif
-}
-
-void
-Backend::preEvaluateBU(REAL u)
-{
- surfaceEvaluator.inPreEvaluateBU_intfac(u);
-}
-
-void
-Backend::preEvaluateBV(REAL v)
-{
- surfaceEvaluator.inPreEvaluateBV_intfac(v);
-}
-
-
-/*-------------------------------------------------------------------------
- * tmeshvert - evaluate a point on a triangle mesh
- *-------------------------------------------------------------------------
- */
-void
-Backend::tmeshvert( TrimVertex *t )
-{
-
- const long nuid = t->nuid;
- const REAL u = t->param[0];
- const REAL v = t->param[1];
-
-#ifndef NOWIREFRAME
- npts++;
- if( wireframetris ) {
- if( npts >= 3 ) {
- surfaceEvaluator.bgnclosedline();
- if( mesh[0][2] == 0 )
- surfaceEvaluator.evalcoord2f( mesh[0][3], mesh[0][0], mesh[0][1] );
- else
- surfaceEvaluator.evalpoint2i( (long) mesh[0][0], (long) mesh[0][1] );
- if( mesh[1][2] == 0 )
- surfaceEvaluator.evalcoord2f( mesh[1][3], mesh[1][0], mesh[1][1] );
- else
- surfaceEvaluator.evalpoint2i( (long) mesh[1][0], (long) mesh[1][1] );
- surfaceEvaluator.evalcoord2f( nuid, u, v );
- surfaceEvaluator.endclosedline();
- }
- mesh[meshindex][0] = u;
- mesh[meshindex][1] = v;
- mesh[meshindex][2] = 0;
- mesh[meshindex][3] = nuid;
- meshindex = (meshindex+1) % 2;
- } else {
- surfaceEvaluator.evalcoord2f( nuid, u, v );
- }
-#else
-
- surfaceEvaluator.evalcoord2f( 0, u, v );
-//for uninitial memory read surfaceEvaluator.evalcoord2f( nuid, u, v );
-#endif
-}
-
-//the same as tmeshvert(trimvertex), for efficiency purpose
-void
-Backend::tmeshvert( REAL u, REAL v )
-{
-
- const long nuid = 0;
-
-
-#ifndef NOWIREFRAME
- npts++;
- if( wireframetris ) {
- if( npts >= 3 ) {
- surfaceEvaluator.bgnclosedline();
- if( mesh[0][2] == 0 )
- surfaceEvaluator.evalcoord2f( mesh[0][3], mesh[0][0], mesh[0][1] );
- else
- surfaceEvaluator.evalpoint2i( (long) mesh[0][0], (long) mesh[0][1] );
- if( mesh[1][2] == 0 )
- surfaceEvaluator.evalcoord2f( mesh[1][3], mesh[1][0], mesh[1][1] );
- else
- surfaceEvaluator.evalpoint2i( (long) mesh[1][0], (long) mesh[1][1] );
- surfaceEvaluator.evalcoord2f( nuid, u, v );
- surfaceEvaluator.endclosedline();
- }
- mesh[meshindex][0] = u;
- mesh[meshindex][1] = v;
- mesh[meshindex][2] = 0;
- mesh[meshindex][3] = nuid;
- meshindex = (meshindex+1) % 2;
- } else {
- surfaceEvaluator.evalcoord2f( nuid, u, v );
- }
-#else
-
- surfaceEvaluator.evalcoord2f( 0, u, v );
-#endif
-}
-
-/*-------------------------------------------------------------------------
- * tmeshvert - evaluate a grid point of a triangle mesh
- *-------------------------------------------------------------------------
- */
-void
-Backend::tmeshvert( GridVertex *g )
-{
- const long u = g->gparam[0];
- const long v = g->gparam[1];
-
-#ifndef NOWIREFRAME
- npts++;
- if( wireframetris ) {
- if( npts >= 3 ) {
- surfaceEvaluator.bgnclosedline();
- if( mesh[0][2] == 0 )
- surfaceEvaluator.evalcoord2f( (long) mesh[0][3], mesh[0][0], mesh[0][1] );
- else
- surfaceEvaluator.evalpoint2i( (long) mesh[0][0], (long) mesh[0][1] );
- if( mesh[1][2] == 0 )
- surfaceEvaluator.evalcoord2f( (long) mesh[1][3], mesh[1][0], mesh[1][1] );
- else
- surfaceEvaluator.evalpoint2i( (long) mesh[1][0], (long) mesh[1][1] );
- surfaceEvaluator.evalpoint2i( u, v );
- surfaceEvaluator.endclosedline();
- }
- mesh[meshindex][0] = u;
- mesh[meshindex][1] = v;
- mesh[meshindex][2] = 1;
- meshindex = (meshindex+1) % 2;
- } else {
- surfaceEvaluator.evalpoint2i( u, v );
- }
-#else
- surfaceEvaluator.evalpoint2i( u, v );
-#endif
-}
-
-/*-------------------------------------------------------------------------
- * swaptmesh - perform a swap of the triangle mesh pointers
- *-------------------------------------------------------------------------
- */
-void
-Backend::swaptmesh( void )
-{
-#ifndef NOWIREFRAME
- if( wireframetris ) {
- meshindex = 1 - meshindex;
- } else {
- surfaceEvaluator.swaptmesh();
- }
-#else
- surfaceEvaluator.swaptmesh();
-#endif
-}
-
-/*-------------------------------------------------------------------------
- * endtmesh - postamble to triangle mesh
- *-------------------------------------------------------------------------
- */
-void
-Backend::endtmesh( void )
-{
-#ifndef NOWIREFRAME
- if( ! wireframetris )
- surfaceEvaluator.endtmesh();
-#else
- surfaceEvaluator.endtmesh();
-/* surfaceEvaluator.polymode( N_MESHFILL );*/
-#endif
-}
-
-
-/*-------------------------------------------------------------------------
- * bgnoutline - preamble to outlined rendering
- *-------------------------------------------------------------------------
- */
-void
-Backend::bgnoutline( void )
-{
- surfaceEvaluator.bgnline();
-}
-
-/*-------------------------------------------------------------------------
- * linevert - evaluate a point on an outlined contour
- *-------------------------------------------------------------------------
- */
-void
-Backend::linevert( TrimVertex *t )
-{
- surfaceEvaluator.evalcoord2f( t->nuid, t->param[0], t->param[1] );
-}
-
-/*-------------------------------------------------------------------------
- * linevert - evaluate a grid point of an outlined contour
- *-------------------------------------------------------------------------
- */
-void
-Backend::linevert( GridVertex *g )
-{
- surfaceEvaluator.evalpoint2i( g->gparam[0], g->gparam[1] );
-}
-
-/*-------------------------------------------------------------------------
- * endoutline - postamble to outlined rendering
- *-------------------------------------------------------------------------
- */
-void
-Backend::endoutline( void )
-{
- surfaceEvaluator.endline();
-}
-
-/*-------------------------------------------------------------------------
- * triangle - output a triangle
- *-------------------------------------------------------------------------
- */
-void
-Backend::triangle( TrimVertex *a, TrimVertex *b, TrimVertex *c )
-{
-/* bgntmesh( "spittriangle" );*/
- bgntfan();
- tmeshvert( a );
- tmeshvert( b );
- tmeshvert( c );
- endtfan();
-/* endtmesh();*/
-}
-
-void
-Backend::bgncurv( void )
-{
- curveEvaluator.bgnmap1f( 0 );
-}
-
-void
-Backend::segment( REAL ulo, REAL uhi )
-{
- curveEvaluator.domain1f( ulo, uhi );
-}
-
-void
-Backend::curvpts(
- long type, /* geometry, color, texture, normal */
- REAL *pts, /* control points */
- long stride, /* distance to next point */
- int order, /* parametric order */
- REAL ulo, /* lower parametric bound */
- REAL uhi ) /* upper parametric bound */
-
-{
- curveEvaluator.map1f( type, ulo, uhi, stride, order, pts );
- curveEvaluator.enable( type );
-}
-
-void
-Backend::curvgrid( REAL u0, REAL u1, long nu )
-{
- curveEvaluator.mapgrid1f( nu, u0, u1 );
-}
-
-void
-Backend::curvmesh( long from, long n )
-{
- curveEvaluator.mapmesh1f( N_MESHFILL, from, from+n );
-}
-
-void
-Backend::curvpt(REAL u)
-{
- curveEvaluator.evalcoord1f( 0, u );
-}
-
-void
-Backend::bgnline( void )
-{
- curveEvaluator.bgnline();
-}
-
-void
-Backend::endline( void )
-{
- curveEvaluator.endline();
-}
-
-void
-Backend::endcurv( void )
-{
- curveEvaluator.endmap1f();
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/backend.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/backend.h
deleted file mode 100755
index 3c09d112f..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/backend.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * backend.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/backend.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glubackend_h_
-#define __glubackend_h_
-
-#include "trimvertex.h"
-#include "gridvertex.h"
-#include "gridtrimvertex.h"
-
-class BasicCurveEvaluator;
-class BasicSurfaceEvaluator;
-
-class Backend {
-private:
- BasicCurveEvaluator& curveEvaluator;
- BasicSurfaceEvaluator& surfaceEvaluator;
-public:
- Backend( BasicCurveEvaluator &c, BasicSurfaceEvaluator& e )
- : curveEvaluator(c), surfaceEvaluator(e) {}
-
- /* surface backend routines */
- void bgnsurf( int, int, long );
- void patch( REAL, REAL, REAL, REAL );
- void surfpts( long, REAL *, long, long, int, int,
- REAL, REAL, REAL, REAL );
- void surfbbox( long, REAL *, REAL * );
- void surfgrid( REAL, REAL, long, REAL, REAL, long );
- void surfmesh( long, long, long, long );
- void bgntmesh( char * );
- void endtmesh( void );
- void swaptmesh( void );
- void tmeshvert( GridTrimVertex * );
- void tmeshvert( TrimVertex * );
- void tmeshvert( GridVertex * );
- void tmeshvert( REAL u, REAL v );
- void linevert( TrimVertex * );
- void linevert( GridVertex * );
- void bgnoutline( void );
- void endoutline( void );
- void endsurf( void );
- void triangle( TrimVertex*, TrimVertex*, TrimVertex* );
-
- void bgntfan();
- void endtfan();
- void bgnqstrip();
- void endqstrip();
- void evalUStrip(int n_upper, REAL v_upper, REAL* upper_val,
- int n_lower, REAL v_lower, REAL* lower_val
- );
- void evalVStrip(int n_left, REAL u_left, REAL* left_val,
- int n_right, REAL v_right, REAL* right_val
- );
- void tmeshvertNOGE(TrimVertex *t);
- void tmeshvertNOGE_BU(TrimVertex *t);
- void tmeshvertNOGE_BV(TrimVertex *t);
- void preEvaluateBU(REAL u);
- void preEvaluateBV(REAL v);
-
-
- /* curve backend routines */
- void bgncurv( void );
- void segment( REAL, REAL );
- void curvpts( long, REAL *, long, int, REAL, REAL );
- void curvgrid( REAL, REAL, long );
- void curvmesh( long, long );
- void curvpt( REAL );
- void bgnline( void );
- void endline( void );
- void endcurv( void );
-private:
-#ifndef NOWIREFRAME
- int wireframetris;
- int wireframequads;
- int npts;
- REAL mesh[3][4];
- int meshindex;
-#endif
-};
-
-#endif /* __glubackend_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/basiccrveval.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/basiccrveval.cc
deleted file mode 100755
index 83a917421..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/basiccrveval.cc
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * basiccrveval.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/basiccrveval.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "mystdio.h"
-#include "types.h"
-#include "basiccrveval.h"
-
-void
-BasicCurveEvaluator::domain1f( REAL, REAL )
-{
-#ifndef NDEBUG
- dprintf( "domain1f\n" );
-#endif
-}
-
-void
-BasicCurveEvaluator::range1f( long type, REAL *, REAL * )
-{
-#ifndef NDEBUG
- dprintf( "range1f\n" );
-#endif
-}
-
-void
-BasicCurveEvaluator::enable( long )
-{
-#ifndef NDEBUG
- dprintf( "enable\n" );
-#endif
-}
-
-void
-BasicCurveEvaluator::disable( long )
-{
-#ifndef NDEBUG
- dprintf( "disable\n" );
-#endif
-}
-
-void
-BasicCurveEvaluator::bgnmap1f( long )
-{
-#ifndef NDEBUG
- dprintf( "bgnmap1f\n" );
-#endif
-}
-
-void
-BasicCurveEvaluator::map1f( long, REAL, REAL, long, long, REAL * )
-{
-#ifndef NDEBUG
- dprintf( "map1f\n" );
-#endif
-}
-
-void
-BasicCurveEvaluator::mapgrid1f( long, REAL, REAL )
-{
-#ifndef NDEBUG
- dprintf( "mapgrid1f\n" );
-#endif
-}
-
-void
-BasicCurveEvaluator::mapmesh1f( long, long, long )
-{
-#ifndef NDEBUG
- dprintf( "mapmesh1f\n" );
-#endif
-}
-
-void
-BasicCurveEvaluator::evalcoord1f( long, REAL )
-{
-#ifndef NDEBUG
- dprintf( "evalcoord1f\n" );
-#endif
-}
-
-void
-BasicCurveEvaluator::endmap1f( void )
-{
-#ifndef NDEBUG
- dprintf( "endmap1f\n" );
-#endif
-}
-
-void
-BasicCurveEvaluator::bgnline( void )
-{
-#ifndef NDEBUG
- dprintf( "bgnline\n" );
-#endif
-}
-
-void
-BasicCurveEvaluator::endline( void )
-{
-#ifndef NDEBUG
- dprintf( "endline\n" );
-#endif
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/basiccrveval.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/basiccrveval.h
deleted file mode 100755
index d2d65dbdc..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/basiccrveval.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * basiccurveeval.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/basiccrveval.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glubasiccrveval_h_
-#define __glubasiccrveval_h_
-
-#include "types.h"
-#include "displaymode.h"
-#include "cachingeval.h"
-
-class BasicCurveEvaluator : public CachingEvaluator {
-public:
- virtual void domain1f( REAL, REAL );
- virtual void range1f( long, REAL *, REAL * );
-
- virtual void enable( long );
- virtual void disable( long );
- virtual void bgnmap1f( long );
- virtual void map1f( long, REAL, REAL, long, long, REAL * );
- virtual void mapgrid1f( long, REAL, REAL );
- virtual void mapmesh1f( long, long, long );
- virtual void evalcoord1f( long, REAL );
- virtual void endmap1f( void );
-
- virtual void bgnline( void );
- virtual void endline( void );
-};
-
-#endif /* __glubasiccrveval_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/basicsurfeval.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/basicsurfeval.cc
deleted file mode 100755
index ddf95bbf9..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/basicsurfeval.cc
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * basicsurfaceevaluator.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/basicsurfeval.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "mystdio.h"
-#include "types.h"
-#include "basicsurfeval.h"
-
-void
-BasicSurfaceEvaluator::domain2f( REAL, REAL, REAL, REAL )
-{
-#ifndef NDEBUG
- dprintf( "domain2f\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::polymode( long )
-{
-#ifndef NDEBUG
- dprintf( "polymode\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::range2f( long type, REAL *from, REAL *to )
-{
-#ifndef NDEBUG
- dprintf( "range2f type %ld, from (%g,%g), to (%g,%g)\n",
- type, from[0], from[1], to[0], to[1] );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::enable( long )
-{
-#ifndef NDEBUG
- dprintf( "enable\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::disable( long )
-{
-#ifndef NDEBUG
- dprintf( "disable\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::bgnmap2f( long )
-{
-#ifndef NDEBUG
- dprintf( "bgnmap2f\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::endmap2f( void )
-{
-#ifndef NDEBUG
- dprintf( "endmap2f\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::map2f( long, REAL, REAL, long, long,
- REAL, REAL, long, long,
- REAL * )
-{
-#ifndef NDEBUG
- dprintf( "map2f\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::mapgrid2f( long, REAL, REAL, long, REAL, REAL )
-{
-#ifndef NDEBUG
- dprintf( "mapgrid2f\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::mapmesh2f( long, long, long, long, long )
-{
-#ifndef NDEBUG
- dprintf( "mapmesh2f\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::evalcoord2f( long, REAL, REAL )
-{
-#ifndef NDEBUG
- dprintf( "evalcoord2f\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::evalpoint2i( long, long )
-{
-#ifndef NDEBUG
- dprintf( "evalpoint2i\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::bgnline( void )
-{
-#ifndef NDEBUG
- dprintf( "bgnline\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::endline( void )
-{
-#ifndef NDEBUG
- dprintf( "endline\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::bgnclosedline( void )
-{
-#ifndef NDEBUG
- dprintf( "bgnclosedline\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::endclosedline( void )
-{
-#ifndef NDEBUG
- dprintf( "endclosedline\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::bgntfan( void )
-{
-#ifndef NDEBUG
- dprintf( "bgntfan\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::endtfan( void )
-{
-}
-
-
-void
-BasicSurfaceEvaluator::bgntmesh( void )
-{
-#ifndef NDEBUG
- dprintf( "bgntmesh\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::swaptmesh( void )
-{
-#ifndef NDEBUG
- dprintf( "swaptmesh\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::endtmesh( void )
-{
-#ifndef NDEBUG
- dprintf( "endtmesh\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::bgnqstrip( void )
-{
-#ifndef NDEBUG
- dprintf( "bgnqstrip\n" );
-#endif
-}
-
-void
-BasicSurfaceEvaluator::endqstrip( void )
-{
-#ifndef NDEBUG
- dprintf( "endqstrip\n" );
-#endif
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/basicsurfeval.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/basicsurfeval.h
deleted file mode 100755
index ced71ceb6..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/basicsurfeval.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * basicsurfeval.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/basicsurfeval.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glubasicsurfeval_h_
-#define __glubasicsurfeval_h_
-
-#include "types.h"
-#include "displaymode.h"
-#include "cachingeval.h"
-
-class BasicSurfaceEvaluator : public CachingEvaluator {
-public:
- virtual void range2f( long, REAL *, REAL * );
- virtual void domain2f( REAL, REAL, REAL, REAL );
-
- virtual void enable( long );
- virtual void disable( long );
- virtual void bgnmap2f( long );
- virtual void map2f( long, REAL, REAL, long, long,
- REAL, REAL, long, long,
- REAL * );
- virtual void mapgrid2f( long, REAL, REAL, long, REAL, REAL );
- virtual void mapmesh2f( long, long, long, long, long );
- virtual void evalcoord2f( long, REAL, REAL );
- virtual void evalpoint2i( long, long );
- virtual void endmap2f( void );
-
- virtual void polymode( long );
- virtual void bgnline( void );
- virtual void endline( void );
- virtual void bgnclosedline( void );
- virtual void endclosedline( void );
- virtual void bgntmesh( void );
- virtual void swaptmesh( void );
- virtual void endtmesh( void );
- virtual void bgnqstrip( void );
- virtual void endqstrip( void );
-
- virtual void bgntfan( void );
- virtual void endtfan( void );
-
- virtual void evalUStrip(int n_upper, REAL v_upper, REAL* upper_val,
- int n_lower, REAL v_lower, REAL* lower_val
- ) = 0;
-
- virtual void evalVStrip(int n_left, REAL u_left, REAL* left_val,
- int n_right, REAL u_right, REAL* right_val
- ) = 0;
- virtual void inDoEvalCoord2NOGE(REAL u, REAL v, REAL* ret_point, REAL* ret_normal) = 0;
- virtual void inDoEvalCoord2NOGE_BU(REAL u, REAL v, REAL* ret_point, REAL* ret_normal) = 0;
- virtual void inDoEvalCoord2NOGE_BV(REAL u, REAL v, REAL* ret_point, REAL* ret_normal) = 0;
- virtual void inPreEvaluateBV_intfac(REAL v ) = 0;
- virtual void inPreEvaluateBU_intfac(REAL u ) = 0;
-
-};
-
-#endif /* __glubasicsurfeval_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bezierarc.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bezierarc.h
deleted file mode 100755
index 318185562..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bezierarc.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * bezierarc.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/bezierarc.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glubezierarc_h
-#define __glubezierarc_h
-
-#include "myassert.h"
-
-class Mapdesc;
-
-struct BezierArc : public PooledObj { /* a bezier arc */
- REAL * cpts; /* control points of arc */
- int order; /* order of arc */
- int stride; /* REAL distance between points */
- long type; /* curve type */
- Mapdesc * mapdesc;
-};
-
-#endif /* __glubezierarc_h */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bin.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bin.cc
deleted file mode 100755
index bc0e93136..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bin.cc
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * bin.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/bin.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "mystdio.h"
-#include "myassert.h"
-#include "bin.h"
-
-/*----------------------------------------------------------------------------
- * Constructor and destructor
- *----------------------------------------------------------------------------
- */
-Bin::Bin()
-{
- head = NULL;
-}
-
-Bin::~Bin()
-{
- assert( head == NULL);
-}
-
-/*----------------------------------------------------------------------------
- * remove_this_arc - remove given Arc_ptr from bin
- *----------------------------------------------------------------------------
- */
-
-void
-Bin::remove_this_arc( Arc_ptr arc )
-{
- Arc_ptr *j;
- for( j = &(head); (*j != 0) && (*j != arc); j = &((*j)->link) );
-
- if( *j != 0 ) {
- if( *j == current )
- current = (*j)->link;
- *j = (*j)->link;
- }
-}
-
-/*----------------------------------------------------------------------------
- * numarcs - count number of arcs in bin
- *----------------------------------------------------------------------------
- */
-
-int
-Bin::numarcs()
-{
- long count = 0;
- for( Arc_ptr jarc = firstarc(); jarc; jarc = nextarc() )
- count++;
- return count;
-}
-
-/*----------------------------------------------------------------------------
- * adopt - place an orphaned arcs into their new parents bin
- *----------------------------------------------------------------------------
- */
-
-void
-Bin::adopt()
-{
- markall();
-
- Arc_ptr orphan;
- while( (orphan = removearc()) != NULL ) {
- for( Arc_ptr parent = orphan->next; parent != orphan; parent = parent->next ) {
- if (! parent->ismarked() ) {
- orphan->link = parent->link;
- parent->link = orphan;
- orphan->clearmark();
- break;
- }
- }
- }
-}
-
-
-/*----------------------------------------------------------------------------
- * show - print out descriptions of the arcs in the bin
- *----------------------------------------------------------------------------
- */
-
-void
-Bin::show( char *name )
-{
-#ifndef NDEBUG
- dprintf( "%s\n", name );
- for( Arc_ptr jarc = firstarc(); jarc; jarc = nextarc() )
- jarc->show( );
-#endif
-}
-
-
-
-/*----------------------------------------------------------------------------
- * markall - mark all arcs with an identifying tag
- *----------------------------------------------------------------------------
- */
-
-void
-Bin::markall()
-{
- for( Arc_ptr jarc=firstarc(); jarc; jarc=nextarc() )
- jarc->setmark();
-}
-
-/*----------------------------------------------------------------------------
- * listBezier - print out all arcs that are untessellated border arcs
- *----------------------------------------------------------------------------
- */
-
-void
-Bin::listBezier( void )
-{
- for( Arc_ptr jarc=firstarc(); jarc; jarc=nextarc() ) {
- if( jarc->isbezier( ) ) {
- assert( jarc->pwlArc->npts == 2 );
- TrimVertex *pts = jarc->pwlArc->pts;
- REAL s1 = pts[0].param[0];
- REAL t1 = pts[0].param[1];
- REAL s2 = pts[1].param[0];
- REAL t2 = pts[1].param[1];
-#ifndef NDEBUG
- dprintf( "arc (%g,%g) (%g,%g)\n", s1, t1, s2, t2 );
-#endif
- }
- }
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bin.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bin.h
deleted file mode 100755
index ba5f604f9..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bin.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * bin.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/bin.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glubin_h_
-#define __glubin_h_
-
-#include "myassert.h"
-#include "arc.h"
-#include "defines.h"
-
-class Bin
-{ /* a linked list of jordan arcs */
-private:
- Arc_ptr head;/*first arc on list */
- Arc_ptr current; /* current arc on list */
-public:
- Bin();
- ~Bin();
- inline Arc_ptr firstarc( void );
- inline Arc_ptr nextarc( void );
- inline Arc_ptr removearc( void );
- inline int isnonempty( void ) { return (head ? 1 : 0); }
- inline void addarc( Arc_ptr );
- void remove_this_arc( Arc_ptr );
- int numarcs( void );
- void adopt( void );
- void markall( void );
- void show( char * );
- void listBezier( void );
-};
-
-/*----------------------------------------------------------------------------
- * Bin::addarc - add an Arc_ptr to head of linked list of Arc_ptr
- *----------------------------------------------------------------------------
- */
-
-inline void
-Bin::addarc( Arc_ptr jarc )
-{
- jarc->link = head;
- head = jarc;
-}
-
-/*----------------------------------------------------------------------------
- * Bin::removearc - remove first Arc_ptr from bin
- *----------------------------------------------------------------------------
- */
-
-inline Arc_ptr
-Bin::removearc( void )
-{
- Arc_ptr jarc = head;
-
- if( jarc ) head = jarc->link;
- return jarc;
-}
-
-
-/*----------------------------------------------------------------------------
- * BinIter::nextarc - return current arc in bin and advance pointer to next arc
- *----------------------------------------------------------------------------
- */
-
-inline Arc_ptr
-Bin::nextarc( void )
-{
- Arc_ptr jarc = current;
-
-#ifdef DEBUG
- assert( jarc->check() != 0 );
-#endif
-
- if( jarc ) current = jarc->link;
- return jarc;
-}
-
-/*----------------------------------------------------------------------------
- * BinIter::firstarc - set current arc to first arc of bin advance to next arc
- *----------------------------------------------------------------------------
- */
-
-inline Arc_ptr
-Bin::firstarc( void )
-{
- current = head;
- return nextarc( );
-}
-
-#endif /* __glubin_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bufpool.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bufpool.cc
deleted file mode 100755
index 5af61c896..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bufpool.cc
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * bufpool.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/bufpool.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "myassert.h"
-#include "bufpool.h"
-
-
-/*-----------------------------------------------------------------------------
- * Pool - allocate a new pool of buffers
- *-----------------------------------------------------------------------------
- */
-Pool::Pool( int _buffersize, int initpoolsize, char *n )
-{
- buffersize= (_buffersize < sizeof(Buffer)) ? sizeof(Buffer) : _buffersize;
- initsize = initpoolsize * buffersize;
- nextsize = initsize;
- name = n;
- magic = is_allocated;
- nextblock = 0;
- curblock = 0;
- freelist = 0;
- nextfree = 0;
-}
-
-/*-----------------------------------------------------------------------------
- * ~Pool - free a pool of buffers and the pool itself
- *-----------------------------------------------------------------------------
- */
-
-Pool::~Pool( void )
-{
- assert( (this != 0) && (magic == is_allocated) );
-
- while( nextblock ) {
- delete [] blocklist[--nextblock];
- blocklist[nextblock] = 0;
- }
- magic = is_free;
-}
-
-
-void Pool::grow( void )
-{
- assert( (this != 0) && (magic == is_allocated) );
- curblock = new char[nextsize];
- blocklist[nextblock++] = curblock;
- nextfree = nextsize;
- nextsize *= 2;
-}
-
-/*-----------------------------------------------------------------------------
- * Pool::clear - free buffers associated with pool but keep pool
- *-----------------------------------------------------------------------------
- */
-
-void
-Pool::clear( void )
-{
- assert( (this != 0) && (magic == is_allocated) );
-
- while( nextblock ) {
- delete [] blocklist[--nextblock];
- blocklist[nextblock] = 0;
- }
- curblock = 0;
- freelist = 0;
- nextfree = 0;
- if( nextsize > initsize )
- nextsize /= 2;
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bufpool.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bufpool.h
deleted file mode 100755
index 981e4db81..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bufpool.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * bufpool.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/bufpool.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glubufpool_h_
-#define __glubufpool_h_
-
-#include "myassert.h"
-#include "mystdlib.h"
-
-#define NBLOCKS 32
-
-class Buffer {
- friend class Pool;
- Buffer * next; /* next buffer on free list */
-};
-
-class Pool {
-public:
- Pool( int, int, char * );
- ~Pool( void );
- inline void* new_buffer( void );
- inline void free_buffer( void * );
- void clear( void );
-
-private:
- void grow( void );
-
-protected:
- Buffer *freelist; /* linked list of free buffers */
- char *blocklist[NBLOCKS]; /* blocks of malloced memory */
- int nextblock; /* next free block index */
- char *curblock; /* last malloced block */
- int buffersize; /* bytes per buffer */
- int nextsize; /* size of next block of memory */
- int nextfree; /* byte offset past next free buffer */
- int initsize;
- enum Magic { is_allocated = 0xf3a1, is_free = 0xf1a2 };
- char *name; /* name of the pool */
- Magic magic; /* marker for valid pool */
-};
-
-/*-----------------------------------------------------------------------------
- * Pool::free_buffer - return a buffer to a pool
- *-----------------------------------------------------------------------------
- */
-
-inline void
-Pool::free_buffer( void *b )
-{
- assert( (this != 0) && (magic == is_allocated) );
-
- /* add buffer to singly connected free list */
-
- ((Buffer *) b)->next = freelist;
- freelist = (Buffer *) b;
-}
-
-
-/*-----------------------------------------------------------------------------
- * Pool::new_buffer - allocate a buffer from a pool
- *-----------------------------------------------------------------------------
- */
-
-inline void *
-Pool::new_buffer( void )
-{
- void *buffer;
-
- assert( (this != 0) && (magic == is_allocated) );
-
- /* find free buffer */
-
- if( freelist ) {
- buffer = (void *) freelist;
- freelist = freelist->next;
- } else {
- if( ! nextfree )
- grow( );
- nextfree -= buffersize;;
- buffer = (void *) (curblock + nextfree);
- }
- return buffer;
-}
-
-class PooledObj {
-public:
- inline void * operator new( size_t, Pool & );
- inline void * operator new( size_t, void *);
- inline void * operator new( size_t s)
- { return ::new char[s]; }
- inline void operator delete( void * ) { assert( 0 ); }
- inline void deleteMe( Pool & );
-};
-
-inline void *
-PooledObj::operator new( size_t, Pool& pool )
-{
- return pool.new_buffer();
-}
-
-inline void
-PooledObj::deleteMe( Pool& pool )
-{
- pool.free_buffer( (void *) this );
-}
-
-#endif /* __glubufpool_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/cachingeval.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/cachingeval.cc
deleted file mode 100755
index 05b0cfc22..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/cachingeval.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * cachingeval.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/cachingeval.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "cachingeval.h"
-
-int
-CachingEvaluator::canRecord( void )
-{
- return 0;
-}
-
-int
-CachingEvaluator::canPlayAndRecord( void )
-{
- return 0;
-}
-
-int
-CachingEvaluator::createHandle( int )
-{
- return 0;
-}
-
-void
-CachingEvaluator::beginOutput( ServiceMode, int )
-{
-}
-
-void
-CachingEvaluator::endOutput( void )
-{
-}
-
-void
-CachingEvaluator::discardRecording( int )
-{
-}
-
-void
-CachingEvaluator::playRecording( int )
-{
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/cachingeval.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/cachingeval.h
deleted file mode 100755
index 5a6493736..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/cachingeval.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * cachingeval.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/cachingeval.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glucachingval_h_
-#define __glucachingval_h_
-
-class CachingEvaluator {
-public:
- enum ServiceMode { play, record, playAndRecord };
- virtual int canRecord( void );
- virtual int canPlayAndRecord( void );
- virtual int createHandle( int handle );
- virtual void beginOutput( ServiceMode, int handle );
- virtual void endOutput( void );
- virtual void discardRecording( int handle );
- virtual void playRecording( int handle );
-};
-#endif /* __glucachingval_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/ccw.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/ccw.cc
deleted file mode 100755
index 5bfcdc2eb..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/ccw.cc
+++ /dev/null
@@ -1,567 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * ccw.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/ccw.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "mystdio.h"
-#include "myassert.h"
-#include "subdivider.h"
-#include "types.h"
-#include "arc.h"
-#include "trimvertex.h"
-#include "simplemath.h"
-
-inline int
-Subdivider::bbox( TrimVertex *a, TrimVertex *b, TrimVertex *c, int p )
-{
- return bbox( a->param[p], b->param[p], c->param[p],
- a->param[1-p], b->param[1-p], c->param[1-p] );
-}
-
-int
-Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
-{
- register TrimVertex *v1 = &j1->pwlArc->pts[j1->pwlArc->npts-1];
- register TrimVertex *v1last = &j1->pwlArc->pts[0];
- register TrimVertex *v2 = &j2->pwlArc->pts[0];
- register TrimVertex *v2last = &j2->pwlArc->pts[j2->pwlArc->npts-1];
- register TrimVertex *v1next = v1-1;
- register TrimVertex *v2next = v2+1;
- int sgn;
-
- assert( v1 != v1last );
- assert( v2 != v2last );
-
-#ifndef NDEBUG
- dprintf( "arc_ccw_turn, p = %d\n", 0 );
-#endif
-
- // the arcs lie on the line (0 == v1->param[0])
- if( v1->param[0] == v1next->param[0] && v2->param[0] == v2next->param[0] )
- return 0;
-
- if( v2next->param[0] < v2->param[0] || v1next->param[0] < v1->param[0] )
- ::mylongjmp( jumpbuffer, 28 );
-
- if( v1->param[1] < v2->param[1] )
- return 0;
- else if( v1->param[1] > v2->param[1] )
- return 1;
-
- while( 1 ) {
- if( v1next->param[0] < v2next->param[0] ) {
-#ifndef NDEBUG
- dprintf( "case a\n" );
-#endif
- assert( v1->param[0] <= v1next->param[0] );
- assert( v2->param[0] <= v1next->param[0] );
- switch( bbox( v2, v2next, v1next, 1 ) ) {
- case -1:
- return 0;
- case 0:
- sgn = ccw( v1next, v2, v2next );
- if( sgn != -1 ) {
- return sgn;
- } else {
-#ifdef DEBUG
- dprintf( "decr\n" );
-#endif
- v1 = v1next--;
- if( v1 == v1last ) {
-#ifdef DEBUG
- dprintf( "no good results\n" );
-#endif
- return 0; // ill-conditioned, guess answer
- }
- }
- break;
- case 1:
- return 1;
- }
- } else if( v1next->param[0] > v2next->param[0] ) {
-#ifndef NDEBUG
- dprintf( "case b\n" );
-#endif
- assert( v1->param[0] <= v2next->param[0] );
- assert( v2->param[0] <= v2next->param[0] );
- switch( bbox( v1, v1next, v2next, 1 ) ) {
- case -1:
- return 1;
- case 0:
- sgn = ccw( v1next, v1, v2next );
- if( sgn != -1 ) {
- return sgn;
- } else {
-#ifdef DEBUG
- dprintf( "incr\n" );
-#endif
- v2 = v2next++;
- if( v2 == v2last ) {
-#ifdef DEBUG
- dprintf( "no good results\n" );
-#endif
- return 0; // ill-conditioned, guess answer
- }
- }
- break;
- case 1:
- return 0;
- }
- } else {
-#ifndef NDEBUG
- dprintf( "case ab\n" );
-#endif
- if( v1next->param[1] < v2next->param[1] )
- return 0;
- else if( v1next->param[1] > v2next->param[1] )
- return 1;
- else {
-#ifdef DEBUG
- dprintf( "incr\n" );
-#endif
- v2 = v2next++;
- if( v2 == v2last ) {
-#ifdef DEBUG
- dprintf( "no good results\n" );
-#endif
- return 0; // ill-conditioned, guess answer
- }
- }
- }
- }
-}
-
-int
-Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
-{
- register TrimVertex *v1 = &j1->pwlArc->pts[j1->pwlArc->npts-1];
- register TrimVertex *v1last = &j1->pwlArc->pts[0];
- register TrimVertex *v2 = &j2->pwlArc->pts[0];
- register TrimVertex *v2last = &j2->pwlArc->pts[j2->pwlArc->npts-1];
- register TrimVertex *v1next = v1-1;
- register TrimVertex *v2next = v2+1;
- int sgn;
-
- assert( v1 != v1last );
- assert( v2 != v2last );
-
-#ifndef NDEBUG
- dprintf( "arc_ccw_turn, p = %d\n", 0 );
-#endif
-
- // the arcs lie on the line (0 == v1->param[0])
- if( v1->param[0] == v1next->param[0] && v2->param[0] == v2next->param[0] )
- return 0;
-
- if( v2next->param[0] > v2->param[0] || v1next->param[0] > v1->param[0] )
- ::mylongjmp( jumpbuffer, 28 );
-
- if( v1->param[1] < v2->param[1] )
- return 1;
- else if( v1->param[1] > v2->param[1] )
- return 0;
-
- while( 1 ) {
- if( v1next->param[0] > v2next->param[0] ) {
-#ifndef NDEBUG
- dprintf( "case c\n" );
-#endif
- assert( v1->param[0] >= v1next->param[0] );
- assert( v2->param[0] >= v1next->param[0] );
- switch( bbox( v2next, v2, v1next, 1 ) ) {
- case -1:
- return 1;
- case 0:
- sgn = ccw( v1next, v2, v2next );
- if( sgn != -1 )
- return sgn;
- else {
- v1 = v1next--;
-#ifdef DEBUG
- dprintf( "decr\n" );
-#endif
- if( v1 == v1last ) {
-#ifdef DEBUG
- dprintf( "no good results\n" );
-#endif
- return 0; // ill-conditioned, guess answer
- }
- }
- break;
- case 1:
- return 0;
- }
- } else if( v1next->param[0] < v2next->param[0] ) {
-#ifndef NDEBUG
- dprintf( "case d\n" );
-#endif
- assert( v1->param[0] >= v2next->param[0] );
- assert( v2->param[0] >= v2next->param[0] );
- switch( bbox( v1next, v1, v2next, 1 ) ) {
- case -1:
- return 0;
- case 0:
- sgn = ccw( v1next, v1, v2next );
- if( sgn != -1 )
- return sgn;
- else {
- v2 = v2next++;
-#ifdef DEBUG
- dprintf( "incr\n" );
-#endif
- if( v2 == v2last ) {
-#ifdef DEBUG
- dprintf( "no good results\n" );
-#endif
- return 0; // ill-conditioned, guess answer
- }
- }
- break;
- case 1:
- return 1;
- }
- } else {
-#ifdef DEBUG
- dprintf( "case cd\n" );
-#endif
- if( v1next->param[1] < v2next->param[1] )
- return 1;
- else if( v1next->param[1] > v2next->param[1] )
- return 0;
- else {
- v2 = v2next++;
-#ifdef DEBUG
- dprintf( "incr\n" );
-#endif
- if( v2 == v2last ) {
-#ifdef DEBUG
- dprintf( "no good results\n" );
-#endif
- return 0; // ill-conditioned, guess answer
- }
- }
- }
- }
-}
-
-int
-Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
-{
- register TrimVertex *v1 = &j1->pwlArc->pts[j1->pwlArc->npts-1];
- register TrimVertex *v1last = &j1->pwlArc->pts[0];
- register TrimVertex *v2 = &j2->pwlArc->pts[0];
- register TrimVertex *v2last = &j2->pwlArc->pts[j2->pwlArc->npts-1];
- register TrimVertex *v1next = v1-1;
- register TrimVertex *v2next = v2+1;
- int sgn;
-
- assert( v1 != v1last );
- assert( v2 != v2last );
-
-#ifndef NDEBUG
- dprintf( "arc_ccw_turn, p = %d\n", 1 );
-#endif
-
- // the arcs lie on the line (1 == v1->param[1])
- if( v1->param[1] == v1next->param[1] && v2->param[1] == v2next->param[1] )
- return 0;
-
- if( v2next->param[1] < v2->param[1] || v1next->param[1] < v1->param[1] )
- ::mylongjmp( jumpbuffer, 28 );
-
- if( v1->param[0] < v2->param[0] )
- return 1;
- else if( v1->param[0] > v2->param[0] )
- return 0;
-
- while( 1 ) {
- if( v1next->param[1] < v2next->param[1] ) {
-#ifndef NDEBUG
- dprintf( "case a\n" );
-#endif
- assert( v1->param[1] <= v1next->param[1] );
- assert( v2->param[1] <= v1next->param[1] );
- switch( bbox( v2, v2next, v1next, 0 ) ) {
- case -1:
- return 1;
- case 0:
- sgn = ccw( v1next, v2, v2next );
- if( sgn != -1 ) {
- return sgn;
- } else {
-#ifdef DEBUG
- dprintf( "decr\n" );
-#endif
- v1 = v1next--;
- if( v1 == v1last ) {
-#ifdef DEBUG
- dprintf( "no good results\n" );
-#endif
- return 0; // ill-conditioned, guess answer
- }
- }
- break;
- case 1:
- return 0;
- }
- } else if( v1next->param[1] > v2next->param[1] ) {
-#ifndef NDEBUG
- dprintf( "case b\n" );
-#endif
- assert( v1->param[1] <= v2next->param[1] );
- assert( v2->param[1] <= v2next->param[1] );
- switch( bbox( v1, v1next, v2next, 0 ) ) {
- case -1:
- return 0;
- case 0:
- sgn = ccw( v1next, v1, v2next );
- if( sgn != -1 ) {
- return sgn;
- } else {
-#ifdef DEBUG
- dprintf( "incr\n" );
-#endif
- v2 = v2next++;
- if( v2 == v2last ) {
-#ifdef DEBUG
- dprintf( "no good results\n" );
-#endif
- return 0; // ill-conditioned, guess answer
- }
- }
- break;
- case 1:
- return 1;
- }
- } else {
-#ifdef DEBUG
- dprintf( "case ab\n" );
-#endif
- if( v1next->param[0] < v2next->param[0] )
- return 1;
- else if( v1next->param[0] > v2next->param[0] )
- return 0;
- else {
-#ifdef DEBUG
- dprintf( "incr\n" );
-#endif
- v2 = v2next++;
- if( v2 == v2last ) {
-#ifdef DEBUG
- dprintf( "no good results\n" );
-#endif
- return 0; // ill-conditioned, guess answer
- }
- }
- }
- }
-}
-
-int
-Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
-{
- register TrimVertex *v1 = &j1->pwlArc->pts[j1->pwlArc->npts-1];
- register TrimVertex *v1last = &j1->pwlArc->pts[0];
- register TrimVertex *v2 = &j2->pwlArc->pts[0];
- register TrimVertex *v2last = &j2->pwlArc->pts[j2->pwlArc->npts-1];
- register TrimVertex *v1next = v1-1;
- register TrimVertex *v2next = v2+1;
- int sgn;
-
- assert( v1 != v1last );
- assert( v2 != v2last );
-
-#ifndef NDEBUG
- dprintf( "arc_ccw_turn, p = %d\n", 1 );
-#endif
-
- // the arcs lie on the line (1 == v1->param[1])
- if( v1->param[1] == v1next->param[1] && v2->param[1] == v2next->param[1] )
- return 0;
-
- if( v2next->param[1] > v2->param[1] || v1next->param[1] > v1->param[1] )
- ::mylongjmp( jumpbuffer, 28 );
-
- if( v1->param[0] < v2->param[0] )
- return 0;
- else if( v1->param[0] > v2->param[0] )
- return 1;
-
- while( 1 ) {
- if( v1next->param[1] > v2next->param[1] ) {
-#ifndef NDEBUG
- dprintf( "case c\n" );
-#endif
- assert( v1->param[1] >= v1next->param[1] );
- assert( v2->param[1] >= v1next->param[1] );
- switch( bbox( v2next, v2, v1next, 0 ) ) {
- case -1:
- return 0;
- case 0:
- sgn = ccw( v1next, v2, v2next );
- if( sgn != -1 )
- return sgn;
- else {
- v1 = v1next--;
-#ifdef DEBUG
- dprintf( "decr\n" );
-#endif
- if( v1 == v1last ) {
-#ifdef DEBUG
- dprintf( "no good results\n" );
-#endif
- return 0; // ill-conditioned, guess answer
- }
- }
- break;
- case 1:
- return 1;
- }
- } else if( v1next->param[1] < v2next->param[1] ) {
-#ifndef NDEBUG
- dprintf( "case d\n" );
- assert( v1->param[1] >= v2next->param[1] );
- assert( v2->param[1] >= v2next->param[1] );
-#endif
- switch( bbox( v1next, v1, v2next, 0 ) ) {
- case -1:
- return 1;
- case 0:
- sgn = ccw( v1next, v1, v2next );
- if( sgn != -1 )
- return sgn;
- else {
- v2 = v2next++;
-#ifdef DEBUG
- dprintf( "incr\n" );
-#endif
- if( v2 == v2last ) {
-#ifdef DEBUG
- dprintf( "no good results\n" );
-#endif
- return 0; // ill-conditioned, guess answer
- }
- }
- break;
- case 1:
- return 0;
- }
- } else {
-#ifdef DEBUG
- dprintf( "case cd\n" );
-#endif
- if( v1next->param[0] < v2next->param[0] )
- return 0;
- else if( v1next->param[0] > v2next->param[0] )
- return 1;
- else {
- v2 = v2next++;
-#ifdef DEBUG
- dprintf( "incr\n" );
-#endif
- if( v2 == v2last ) {
-#ifdef DEBUG
- dprintf( "no good results\n" );
-#endif
- return 0; // ill-conditioned, guess answer
- }
- }
- }
- }
-}
-
-
-#ifndef NDEBUG
-int
-Subdivider::bbox( register REAL sa, register REAL sb, register REAL sc,
- register REAL ta, register REAL tb, register REAL tc )
-#else
-int
-Subdivider::bbox( register REAL sa, register REAL sb, register REAL sc,
- register REAL , register REAL , register REAL )
-#endif
-{
-#ifndef NDEBUG
- assert( tc >= ta );
- assert( tc <= tb );
-#endif
-
- if( sa < sb ) {
- if( sc <= sa ) {
- return -1;
- } else if( sb <= sc ) {
- return 1;
- } else {
- return 0;
- }
- } else if( sa > sb ) {
- if( sc >= sa ) {
- return 1;
- } else if( sb >= sc ) {
- return -1;
- } else {
- return 0;
- }
- } else {
- if( sc > sa ) {
- return 1;
- } else if( sb > sc ) {
- return -1;
- } else {
- return 0;
- }
- }
-}
-
-/*----------------------------------------------------------------------------
- * ccw - determine how three points are oriented by computing their
- * determinant.
- * Return 1 if the vertices are ccw oriented,
- * 0 if they are cw oriented, or
- * -1 if the computation is ill-conditioned.
- *----------------------------------------------------------------------------
- */
-int
-Subdivider::ccw( TrimVertex *a, TrimVertex *b, TrimVertex *c )
-{
- REAL d = det3( a, b, c );
- if( abs(d) < 0.0001 ) return -1;
- return (d < 0.0) ? 0 : 1;
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/coveandtiler.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/coveandtiler.cc
deleted file mode 100755
index 73e9f79dc..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/coveandtiler.cc
+++ /dev/null
@@ -1,442 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * coveandtiler.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/coveandtiler.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "myassert.h"
-#include "mystdio.h"
-#include "coveandtiler.h"
-#include "gridvertex.h"
-#include "gridtrimvertex.h"
-#include "uarray.h"
-#include "backend.h"
-
-
-const int CoveAndTiler::MAXSTRIPSIZE = 1000;
-
-CoveAndTiler::CoveAndTiler( Backend& b )
- : backend( b )
-{ }
-
-CoveAndTiler::~CoveAndTiler( void )
-{ }
-
-inline void
-CoveAndTiler::output( GridVertex &gv )
-{
- backend.tmeshvert( &gv );
-}
-
-inline void
-CoveAndTiler::output( TrimVertex *tv )
-{
- backend.tmeshvert( tv );
-}
-
-inline void
-CoveAndTiler::output( GridTrimVertex& g )
-{
- backend.tmeshvert( &g );
-}
-
-void
-CoveAndTiler::coveAndTile( void )
-{
- long ustart = (top.ustart >= bot.ustart) ? top.ustart : bot.ustart;
- long uend = (top.uend <= bot.uend) ? top.uend : bot.uend;
- if( ustart <= uend ) {
- tile( bot.vindex, ustart, uend );
- if( top.ustart >= bot.ustart )
- coveUpperLeft();
- else
- coveLowerLeft();
-
- if( top.uend <= bot.uend )
- coveUpperRight();
- else
- coveLowerRight();
- } else {
- TrimVertex blv, tlv, *bl, *tl;
- GridTrimVertex bllv, tllv;
- TrimVertex *lf = left.first();
- TrimVertex *ll = left.last();
- if( lf->param[0] >= ll->param[0] ) {
- blv.param[0] = lf->param[0];
- blv.param[1] = ll->param[1];
- blv.nuid = 0; // XXX
- assert( blv.param[1] == bot.vval );
- bl = &blv;
- tl = lf;
- tllv.set( lf );
- if( ll->param[0] > uarray.uarray[top.ustart-1] ) {
- bllv.set( ll );
- assert( ll->param[0] <= uarray.uarray[bot.ustart] );
- } else {
- bllv.set( top.ustart-1, bot.vindex );
- }
- coveUpperLeftNoGrid( bl );
- } else {
- tlv.param[0] = ll->param[0];
- tlv.param[1] = lf->param[1];
- tlv.nuid = 0; // XXX
- assert( tlv.param[1] == top.vval );
- tl = &tlv;
- bl = ll;
- bllv.set( ll );
- if( lf->param[0] > uarray.uarray[bot.ustart-1] ) {
- assert( lf->param[0] <= uarray.uarray[bot.ustart] );
- tllv.set( lf );
- } else {
- tllv.set( bot.ustart-1, top.vindex );
- }
- coveLowerLeftNoGrid( tl );
- }
-
- TrimVertex brv, trv, *br, *tr;
- GridTrimVertex brrv, trrv;
- TrimVertex *rf = right.first();
- TrimVertex *rl = right.last();
-
- if( rf->param[0] <= rl->param[0] ) {
- brv.param[0] = rf->param[0];
- brv.param[1] = rl->param[1];
- brv.nuid = 0; // XXX
- assert( brv.param[1] == bot.vval );
- br = &brv;
- tr = rf;
- trrv.set( rf );
- if( rl->param[0] < uarray.uarray[top.uend+1] ) {
- assert( rl->param[0] >= uarray.uarray[top.uend] );
- brrv.set( rl );
- } else {
- brrv.set( top.uend+1, bot.vindex );
- }
- coveUpperRightNoGrid( br );
- } else {
- trv.param[0] = rl->param[0];
- trv.param[1] = rf->param[1];
- trv.nuid = 0; // XXX
- assert( trv.param[1] == top.vval );
- tr = &trv;
- br = rl;
- brrv.set( rl );
- if( rf->param[0] < uarray.uarray[bot.uend+1] ) {
- assert( rf->param[0] >= uarray.uarray[bot.uend] );
- trrv.set( rf );
- } else {
- trrv.set( bot.uend+1, top.vindex );
- }
- coveLowerRightNoGrid( tr );
- }
-
- backend.bgntmesh( "doit" );
- output(trrv);
- output(tllv);
- output( tr );
- output( tl );
- output( br );
- output( bl );
- output(brrv);
- output(bllv);
- backend.endtmesh();
- }
-}
-
-void
-CoveAndTiler::tile( long vindex, long ustart, long uend )
-{
- long numsteps = uend - ustart;
-
- if( numsteps == 0 ) return;
-
- if( numsteps > MAXSTRIPSIZE ) {
- long umid = ustart + (uend - ustart) / 2;
- tile( vindex, ustart, umid );
- tile( vindex, umid, uend );
- } else {
- backend.surfmesh( ustart, vindex-1, numsteps, 1 );
- }
-}
-
-void
-CoveAndTiler::coveUpperRight( void )
-{
- GridVertex tgv( top.uend, top.vindex );
- GridVertex gv( top.uend, bot.vindex );
-
- right.first();
- backend.bgntmesh( "coveUpperRight" );
- output( right.next() );
- output( tgv );
- backend.swaptmesh();
- output( gv );
- coveUR();
- backend.endtmesh();
-}
-
-void
-CoveAndTiler::coveUpperRightNoGrid( TrimVertex* br )
-{
- backend.bgntmesh( "coveUpperRight" );
- output( right.first() );
- output( right.next() );
- backend.swaptmesh();
- output( br );
- coveUR();
- backend.endtmesh();
-}
-
-void
-CoveAndTiler::coveUR( )
-{
- GridVertex gv( top.uend, bot.vindex );
- TrimVertex *vert = right.next();
- if( vert == NULL ) return;
-
- assert( vert->param[0] >= uarray.uarray[gv.gparam[0]] );
-
- if( gv.nextu() >= bot.uend ) {
- for( ; vert; vert = right.next() ) {
- output( vert );
- backend.swaptmesh();
- }
- } else while( 1 ) {
- if( vert->param[0] < uarray.uarray[gv.gparam[0]] ) {
- output( vert );
- backend.swaptmesh();
- vert = right.next();
- if( vert == NULL ) break;
- } else {
- backend.swaptmesh();
- output( gv );
- if( gv.nextu() == bot.uend ) {
- for( ; vert; vert = right.next() ) {
- output( vert );
- backend.swaptmesh();
- }
- break;
- }
- }
- }
-}
-
-void
-CoveAndTiler::coveUpperLeft( void )
-{
- GridVertex tgv( top.ustart, top.vindex );
- GridVertex gv( top.ustart, bot.vindex );
-
- left.first();
- backend.bgntmesh( "coveUpperLeft" );
- output( tgv );
- output( left.next() );
- output( gv );
- backend.swaptmesh();
- coveUL();
- backend.endtmesh();
-}
-
-void
-CoveAndTiler::coveUpperLeftNoGrid( TrimVertex* bl )
-{
- backend.bgntmesh( "coveUpperLeftNoGrid" );
- output( left.first() );
- output( left.next() );
- output( bl );
- backend.swaptmesh();
- coveUL();
- backend.endtmesh();
-}
-
-void
-CoveAndTiler::coveUL()
-{
- GridVertex gv( top.ustart, bot.vindex );
- TrimVertex *vert = left.next();
- if( vert == NULL ) return;
- assert( vert->param[0] <= uarray.uarray[gv.gparam[0]] );
-
- if( gv.prevu() <= bot.ustart ) {
- for( ; vert; vert = left.next() ) {
- backend.swaptmesh();
- output( vert );
- }
- } else while( 1 ) {
- if( vert->param[0] > uarray.uarray[gv.gparam[0]] ) {
- backend.swaptmesh();
- output( vert );
- vert = left.next();
- if( vert == NULL ) break;
- } else {
- output( gv );
- backend.swaptmesh();
- if( gv.prevu() == bot.ustart ) {
- for( ; vert; vert = left.next() ) {
- backend.swaptmesh();
- output( vert );
- }
- break;
- }
- }
- }
-}
-
-void
-CoveAndTiler::coveLowerLeft( void )
-{
- GridVertex bgv( bot.ustart, bot.vindex );
- GridVertex gv( bot.ustart, top.vindex );
-
- left.last();
- backend.bgntmesh( "coveLowerLeft" );
- output( left.prev() );
- output( bgv );
- backend.swaptmesh();
- output( gv );
- coveLL();
- backend.endtmesh();
-}
-
-void
-CoveAndTiler::coveLowerLeftNoGrid( TrimVertex* tl )
-{
- backend.bgntmesh( "coveLowerLeft" );
- output( left.last() );
- output( left.prev() );
- backend.swaptmesh();
- output( tl );
- coveLL( );
- backend.endtmesh();
-}
-
-void
-CoveAndTiler::coveLL()
-{
- GridVertex gv( bot.ustart, top.vindex );
- TrimVertex *vert = left.prev();
- if( vert == NULL ) return;
- assert( vert->param[0] <= uarray.uarray[gv.gparam[0]] );
-
- if( gv.prevu() <= top.ustart ) {
- for( ; vert; vert = left.prev() ) {
- output( vert );
- backend.swaptmesh();
- }
- } else while( 1 ) {
- if( vert->param[0] > uarray.uarray[gv.gparam[0]] ){
- output( vert );
- backend.swaptmesh();
- vert = left.prev();
- if( vert == NULL ) break;
- } else {
- backend.swaptmesh();
- output( gv );
- if( gv.prevu() == top.ustart ) {
- for( ; vert; vert = left.prev() ) {
- output( vert );
- backend.swaptmesh();
- }
- break;
- }
- }
- }
-}
-
-void
-CoveAndTiler::coveLowerRight( void )
-{
- GridVertex bgv( bot.uend, bot.vindex );
- GridVertex gv( bot.uend, top.vindex );
-
- right.last();
- backend.bgntmesh( "coveLowerRight" );
- output( bgv );
- output( right.prev() );
- output( gv );
- backend.swaptmesh();
- coveLR();
- backend.endtmesh( );
-}
-
-void
-CoveAndTiler::coveLowerRightNoGrid( TrimVertex* tr )
-{
- backend.bgntmesh( "coveLowerRIght" );
- output( right.last() );
- output( right.prev() );
- output( tr );
- backend.swaptmesh();
- coveLR();
- backend.endtmesh();
-}
-
-void
-CoveAndTiler::coveLR( )
-{
- GridVertex gv( bot.uend, top.vindex );
- TrimVertex *vert = right.prev();
- if( vert == NULL ) return;
- assert( vert->param[0] >= uarray.uarray[gv.gparam[0]] );
-
- if( gv.nextu() >= top.uend ) {
- for( ; vert; vert = right.prev() ) {
- backend.swaptmesh();
- output( vert );
- }
- } else while( 1 ) {
- if( vert->param[0] < uarray.uarray[gv.gparam[0]] ) {
- backend.swaptmesh();
- output( vert );
- vert = right.prev();
- if( vert == NULL ) break;
- } else {
- output( gv );
- backend.swaptmesh();
- if( gv.nextu() == top.uend ) {
- for( ; vert; vert = right.prev() ) {
- backend.swaptmesh();
- output( vert );
- }
- break;
- }
- }
- }
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/coveandtiler.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/coveandtiler.h
deleted file mode 100755
index 7313c088d..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/coveandtiler.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * coveandtiler.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/coveandtiler.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glucoveandtiler_h
-#define __glucoveandtiler_h
-
-#include "trimregion.h"
-
-class Backend;
-class TrimVertex;
-class GridVertex;
-class GridTrimVertex;
-
-class CoveAndTiler : virtual public TrimRegion {
-public:
- CoveAndTiler( Backend& );
- ~CoveAndTiler( void );
- void coveAndTile( void );
-private:
- Backend& backend;
- static const int MAXSTRIPSIZE;
- void tile( long, long, long );
- void coveLowerLeft( void );
- void coveLowerRight( void );
- void coveUpperLeft( void );
- void coveUpperRight( void );
- void coveUpperLeftNoGrid( TrimVertex * );
- void coveUpperRightNoGrid( TrimVertex * );
- void coveLowerLeftNoGrid( TrimVertex * );
- void coveLowerRightNoGrid( TrimVertex * );
- void coveLL( void );
- void coveLR( void );
- void coveUL( void );
- void coveUR( void );
- inline void output( GridTrimVertex& );
- inline void output( GridVertex& );
- inline void output( TrimVertex* );
-};
-
-#endif /* __glucoveandtiler_h */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curve.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curve.cc
deleted file mode 100755
index ceaaf9ff9..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curve.cc
+++ /dev/null
@@ -1,203 +0,0 @@
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curve.cc,v 1.3 2001/04/27 12:58:28 dawes Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * curve.c++
- *
- * $Date: 2001/05/01 17:07:32 $ $Revision: 1.1.1.2 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/curve.cc,v 1.1.1.2 2001/05/01 17:07:32 dawes Exp $
- */
-
-#include "glimports.h"
-#include "myassert.h"
-#include "mystdio.h"
-#include "mymath.h"
-#include "curve.h"
-#include "mapdesc.h"
-#include "types.h"
-#include "quilt.h"
-#include "nurbsconsts.h"
-#include "gluint.h"
-
-/*--------------------------------------------------------------------------
- * Curve::Curve - copy curve from quilt and transform control points
- *--------------------------------------------------------------------------
- */
-
-Curve::Curve( Quilt_ptr geo, REAL pta, REAL ptb, Curve *c )
-{
- mapdesc = geo->mapdesc;
- next = c;
- needsSampling = mapdesc->isRangeSampling() ? 1 : 0;
- cullval = mapdesc->isCulling() ? CULL_ACCEPT : CULL_TRIVIAL_ACCEPT;
- order = geo->qspec[0].order;
- stride = MAXCOORDS;
-
- REAL *ps = geo->cpts;
- Quiltspec_ptr qs = geo->qspec;
- ps += qs->offset;
- ps += qs->index * qs->order * qs->stride;
- REAL *pend = ps + qs->order * qs->stride;
-
- if( needsSampling )
- mapdesc->xformSampling( ps, qs->order, qs->stride, spts, stride );
-
- if( cullval == CULL_ACCEPT )
- mapdesc->xformCulling( ps, qs->order, qs->stride, cpts, stride );
-
- /* set untrimmed curve range */
- range[0] = qs->breakpoints[qs->index];
- range[1] = qs->breakpoints[qs->index+1];
- range[2] = range[1] - range[0];
-
- if( range[0] != pta ) {
- Curve lower( *this, pta, 0 );
- lower.next = next;
- *this = lower;
- }
- if( range[1] != ptb ) {
- Curve lower( *this, ptb, 0 );
- }
-}
-
-/*--------------------------------------------------------------------------
- * Curve::Curve - subdivide a curve along an isoparametric line
- *--------------------------------------------------------------------------
- */
-
-Curve::Curve( Curve& upper, REAL value, Curve *c )
-{
- Curve &lower = *this;
-
- lower.next = c;
- lower.mapdesc = upper.mapdesc;
- lower.needsSampling = upper.needsSampling;
- lower.order = upper.order;
- lower.stride = upper.stride;
- lower.cullval = upper.cullval;
-
- REAL d = (value - upper.range[0]) / upper.range[2];
-
- if( needsSampling )
- mapdesc->subdivide( upper.spts, lower.spts, d, upper.stride, upper.order );
-
- if( cullval == CULL_ACCEPT )
- mapdesc->subdivide( upper.cpts, lower.cpts, d, upper.stride, upper.order );
-
- lower.range[0] = upper.range[0];
- lower.range[1] = value;
- lower.range[2] = value - upper.range[0];
- upper.range[0] = value;
- upper.range[2] = upper.range[1] - value;
-}
-
-
-/*--------------------------------------------------------------------------
- * Curve::clamp - clamp the sampling rate to a given maximum
- *--------------------------------------------------------------------------
- */
-
-void
-Curve::clamp( void )
-{
- if( stepsize < minstepsize )
- stepsize = mapdesc->clampfactor * minstepsize;
-}
-
-void
-Curve::setstepsize( REAL max )
-{
- stepsize = ( max >= 1.0 ) ? (range[2] / max) : range[2];
- minstepsize = stepsize;
-}
-
-void
-Curve::getstepsize( void )
-{
- minstepsize= 0;
-
- if( mapdesc->isConstantSampling() ) {
- // fixed number of samples per patch in each direction
- // maxrate is number of s samples per patch
- setstepsize( mapdesc->maxrate );
- } else if( mapdesc->isDomainSampling() ) {
- // maxrate is number of s samples per unit s length of domain
- setstepsize( mapdesc->maxrate * range[2] );
- } else {
- // upper bound on path length between sample points
-
- assert( order <= MAXORDER );
-
- /* points have been transformed, therefore they are homogeneous */
- REAL tmp[MAXORDER][MAXCOORDS];
- const int tstride = sizeof(tmp[0]) / sizeof(REAL);
- int val = mapdesc->project( spts, stride, &tmp[0][0], tstride, order );
-
- if( val == 0 ) {
- // control points cross infinity, therefore derivatives are undefined
- setstepsize( mapdesc->maxrate );
- } else {
- REAL t = mapdesc->getProperty( N_PIXEL_TOLERANCE );
- if( mapdesc->isParametricDistanceSampling() ) {
- REAL d = mapdesc->calcPartialVelocity( &tmp[0][0], tstride, order, 2, range[2] );
- stepsize = (d > 0.0) ? ::SQRT( 8.0 * t / d ) : range[2];
- minstepsize = ( mapdesc->maxrate > 0.0 ) ? (range[2] / mapdesc->maxrate) : 0.0;
- } else if( mapdesc->isPathLengthSampling() ) {
- // t is upper bound on path (arc) length
- REAL d = mapdesc->calcPartialVelocity( &tmp[0][0], tstride, order, 1, range[2] );
- stepsize = ( d > 0.0 ) ? (t / d) : range[2];
- minstepsize = ( mapdesc->maxrate > 0.0 ) ? (range[2] / mapdesc->maxrate) : 0.0;
- } else {
- // control points cross infinity, therefore partials are undefined
- setstepsize( mapdesc->maxrate );
- }
- }
- }
-}
-
-int
-Curve::needsSamplingSubdivision( void )
-{
- return ( stepsize < minstepsize ) ? 1 : 0;
-}
-
-int
-Curve::cullCheck( void )
-{
- if( cullval == CULL_ACCEPT )
- cullval = mapdesc->cullCheck( cpts, order, stride );
- return cullval;
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curve.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curve.h
deleted file mode 100755
index f9355867a..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curve.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * curve.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/curve.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glucurve_h_
-#define __glucurve_h_
-
-#include "types.h"
-#include "defines.h"
-
-class Mapdesc;
-class Quilt;
-
-
-class Curve {
-public:
-friend class Curvelist;
- Curve( Quilt *, REAL, REAL, Curve * );
- Curve( Curve&, REAL, Curve * );
- Curve * next;
-private:
- Mapdesc * mapdesc;
- int stride;
- int order;
- int cullval;
- int needsSampling;
- REAL cpts[MAXORDER*MAXCOORDS];
- REAL spts[MAXORDER*MAXCOORDS];
- REAL stepsize;
- REAL minstepsize;
- REAL range[3];
-
- void clamp( void );
- void setstepsize( REAL );
- void getstepsize( void );
- int cullCheck( void );
- int needsSamplingSubdivision( void );
-};
-#endif /* __glucurve_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curvelist.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curvelist.cc
deleted file mode 100755
index dc08dfd0a..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curvelist.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * curvelist.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/curvelist.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "myassert.h"
-#include "mystdio.h"
-#include "quilt.h"
-#include "curvelist.h"
-#include "curve.h"
-#include "nurbsconsts.h"
-#include "types.h"
-
-Curvelist::Curvelist( Quilt *quilts, REAL pta, REAL ptb )
-{
- curve = 0;
- for( Quilt *q = quilts; q; q = q->next )
- curve = new Curve( q, pta, ptb, curve );
- range[0] = pta;
- range[1] = ptb;
- range[2] = ptb - pta;
-}
-
-Curvelist::Curvelist( Curvelist &upper, REAL value )
-{
- Curvelist &lower = *this;
- curve = 0;
- for( Curve *c = upper.curve; c; c = c->next )
- curve = new Curve( *c, value, curve );
-
- lower.range[0] = upper.range[0];
- lower.range[1] = value;
- lower.range[2] = value - upper.range[0];
- upper.range[0] = value;
- upper.range[2] = upper.range[1] - value;
-}
-
-Curvelist::~Curvelist()
-{
- while( curve ) {
- Curve *c = curve;
- curve = curve->next;
- delete c;
- }
-}
-
-int
-Curvelist::cullCheck( void )
-{
- for( Curve *c = curve; c; c = c->next )
- if( c->cullCheck() == CULL_TRIVIAL_REJECT )
- return CULL_TRIVIAL_REJECT;
- return CULL_ACCEPT;
-}
-
-void
-Curvelist::getstepsize( void )
-{
- stepsize = range[2];
- Curve *c;
- for( c = curve; c; c = c->next ) {
- c->getstepsize();
- c->clamp();
- stepsize = ((c->stepsize < stepsize) ? c->stepsize : stepsize);
- if( c->needsSamplingSubdivision() ) break;
- }
- needsSubdivision = ( c ) ? 1 : 0;
-}
-
-int
-Curvelist::needsSamplingSubdivision( void )
-{
- return needsSubdivision;
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curvelist.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curvelist.h
deleted file mode 100755
index 2b90e0de3..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curvelist.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * curvelist.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/curvelist.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glucurvelist_h_
-#define __glucurvelist_h_
-
-#include "types.h"
-#include "defines.h"
-
-class Mapdesc;
-class Quilt;
-class Curve;
-
-class Curvelist
-{
-friend class Subdivider;
-public:
- Curvelist( Quilt *, REAL, REAL );
- Curvelist( Curvelist &, REAL );
- ~Curvelist( void );
- int cullCheck( void );
- void getstepsize( void );
- int needsSamplingSubdivision();
-private:
- Curve *curve;
- float range[3];
- int needsSubdivision;
- float stepsize;
-};
-#endif /* __glucurvelist_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curvesub.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curvesub.cc
deleted file mode 100755
index cfe278aed..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curvesub.cc
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * curvesub.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/curvesub.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "myassert.h"
-#include "mystdio.h"
-#include "subdivider.h"
-#include "renderhints.h"
-#include "backend.h"
-#include "quilt.h"
-#include "curvelist.h"
-#include "curve.h"
-#include "nurbsconsts.h"
-
-/*--------------------------------------------------------------------------
- * drawCurves - main curve rendering entry point
- *--------------------------------------------------------------------------
- */
-
-void
-Subdivider::drawCurves( void )
-{
- REAL from[1], to[1];
- Flist bpts;
- qlist->getRange( from, to, bpts );
-
- renderhints.init( );
-
- backend.bgncurv();
- for( int i=bpts.start; i<bpts.end-1; i++ ) {
- REAL pta, ptb;
- pta = bpts.pts[i];
- ptb = bpts.pts[i+1];
-
- qlist->downloadAll( &pta, &ptb, backend );
-
- Curvelist curvelist( qlist, pta, ptb );
- samplingSplit( curvelist, renderhints.maxsubdivisions );
- }
- backend.endcurv();
-}
-
-
-/*--------------------------------------------------------------------------
- * samplingSplit - recursively subdivide patch, cull check each subpatch
- *--------------------------------------------------------------------------
- */
-
-void
-Subdivider::samplingSplit( Curvelist& curvelist, int subdivisions )
-{
- if( curvelist.cullCheck() == CULL_TRIVIAL_REJECT ) return;
-
- curvelist.getstepsize();
-
- if( curvelist.needsSamplingSubdivision() && (subdivisions > 0) ) {
- REAL mid = ( curvelist.range[0] + curvelist.range[1] ) * 0.5;
- Curvelist lowerlist( curvelist, mid );
- samplingSplit( lowerlist, subdivisions-1 ); // lower
- samplingSplit( curvelist, subdivisions-1 ); // upper
- } else {
- long nu = 1 + ((long) (curvelist.range[2] / curvelist.stepsize));
- backend.curvgrid( curvelist.range[0], curvelist.range[1], nu );
- backend.curvmesh( 0, nu );
- }
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/dataTransform.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/dataTransform.cc
deleted file mode 100755
index 68ca7f53d..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/dataTransform.cc
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/dataTransform.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "glimports.h"
-#include "myassert.h"
-#include "nurbsconsts.h"
-#include "trimvertex.h"
-#include "dataTransform.h"
-
-extern directedLine* arcLoopToDLineLoop(Arc_ptr loop);
-
-static directedLine* copy_loop(Arc_ptr loop, Real2* vertArray, int& index, directedLine dline_buf[], sampledLine sline_buf[], int& index_dline)
-{
- directedLine *ret;
- int old_index = index;
- int i = index;
- int j;
- for(j=0; j<loop->pwlArc->npts-1; j++, i++)
- {
- vertArray[i][0] = loop->pwlArc->pts[j].param[0];
- vertArray[i][1] = loop->pwlArc->pts[j].param[1];
- }
- loop->clearmark();
-
- for(Arc_ptr jarc = loop->next; jarc != loop; jarc=jarc->next)
- {
- for(j=0; j<jarc->pwlArc->npts-1; j++, i++)
- {
- vertArray[i][0] = jarc->pwlArc->pts[j].param[0];
- vertArray[i][1] = jarc->pwlArc->pts[j].param[1];
- }
- jarc->clearmark();
- }
- //copy the first vertex again
- vertArray[i][0] = loop->pwlArc->pts[0].param[0];
- vertArray[i][1] = loop->pwlArc->pts[0].param[1];
- i++;
- index=i;
-
- directedLine* dline;
- sampledLine* sline;
- sline = &sline_buf[index_dline];
- dline = &dline_buf[index_dline];
- sline->init(2, &vertArray[old_index]);
- dline->init(INCREASING, sline);
- ret = dline;
- index_dline++;
-
- for(i=old_index+1; i<= index-2; i++)
- {
- sline = &sline_buf[index_dline];
- dline = &dline_buf[index_dline];
- sline->init(2, &vertArray[i]);
- dline->init(INCREASING, sline);
- ret->insert(dline);
- index_dline++;
- }
- return ret;
-}
-
-static int num_edges(Bin& bin)
-{
- int sum=0;
- for(Arc_ptr jarc = bin.firstarc(); jarc; jarc=bin.nextarc())
- sum += jarc->pwlArc->npts-1;
- return sum;
-}
-/*
-directedLine* bin_to_DLineLoops(Bin& bin)
-{
- directedLine *ret=NULL;
- directedLine *temp;
-
- int numedges = num_edges(bin);
- directedLine* dline_buf = new directedLine[numedges]; //not work for N32?
- sampledLine* sline_buf=new sampledLine[numedges];
-
- Real2* vertArray = new Real2[numedges*2];
- int index = 0;
- int index_dline = 0;
- bin.markall();
-
- for(Arc_ptr jarc = bin.firstarc(); jarc; jarc=bin.nextarc())
- {
- if(jarc->ismarked())
- {
- assert(jarc->check() != 0);
- Arc_ptr jarchead = jarc;
- do {
- jarc->clearmark();
- jarc = jarc->next;
- } while(jarc != jarchead);
- temp=copy_loop(jarchead, vertArray, index, dline_buf, sline_buf, index_dline);
- ret = temp->insertPolygon(ret);
- }
- }
-
- return ret;
-}
-*/
-
-
-directedLine* bin_to_DLineLoops(Bin& bin)
-{
- directedLine *ret=NULL;
- directedLine *temp;
- bin.markall();
- for(Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc()){
- if(jarc->ismarked()) {
- assert(jarc->check() != 0);
- Arc_ptr jarchead = jarc;
- do {
- jarc->clearmark();
- jarc = jarc->next;
- } while(jarc != jarchead);
- temp = arcLoopToDLineLoop(jarc);
- ret = temp->insertPolygon(ret);
- }
- }
- return ret;
-}
-
-directedLine* o_pwlcurve_to_DLines(directedLine* original, O_pwlcurve* pwl)
-{
- directedLine* ret = original;
- for(Int i=0; i<pwl->npts-1; i++)
- {
- sampledLine* sline = new sampledLine(2);
- sline->setPoint(0, pwl->pts[i].param);
- sline->setPoint(1, pwl->pts[i+1].param);
- directedLine* dline = new directedLine(INCREASING, sline);
- if(ret == NULL)
- ret = dline;
- else
- ret->insert(dline);
- }
- return ret;
-}
-
-directedLine* o_curve_to_DLineLoop(O_curve* cur)
-{
- directedLine *ret;
- if(cur == NULL)
- return NULL;
- assert(cur->curvetype == ct_pwlcurve);
- ret = o_pwlcurve_to_DLines(NULL, cur->curve.o_pwlcurve);
- for(O_curve* temp = cur->next; temp != NULL; temp = temp->next)
- {
- assert(temp->curvetype == ct_pwlcurve);
- ret = o_pwlcurve_to_DLines(ret, temp->curve.o_pwlcurve);
- }
- return ret;
-}
-
-directedLine* o_trim_to_DLineLoops(O_trim* trim)
-{
- O_trim* temp;
- directedLine *ret;
- if(trim == NULL)
- return NULL;
- ret = o_curve_to_DLineLoop(trim->o_curve);
-
- for(temp=trim->next; temp != NULL; temp = temp->next)
- {
- ret = ret->insertPolygon(o_curve_to_DLineLoop(temp->o_curve));
- }
- return ret;
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/dataTransform.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/dataTransform.h
deleted file mode 100755
index 624a041f2..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/dataTransform.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/dataTransform.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _DATA_TRANSFORM_H
-#define _DATA_TRANSFORM_H
-
-#include "reader.h"
-#include "directedLine.h"
-#include "bin.h"
-directedLine* bin_to_DLineLoops(Bin& bin);
-
-/*transform the pwlcurve into a number of directedline lines
- *insert these directedlines into orignal which is supposed to be
- *the part of the trimming loop obtained so far.
- *return the updated trimkming loop.
- */
-directedLine* o_pwlcurve_to_DLines(directedLine* original, O_pwlcurve* pwl);
-
-/*transform a trim loop (curve) into a directedLine loop
- */
-directedLine* o_curve_to_DLineLoop(O_curve* curve);
-
-/*transform a list of trim loops (trim) into
- *a list of polygons represented as directedLine*.
- */
-directedLine* o_trim_to_DLineLoops(O_trim* trim);
-
-
-#endif
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/defines.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/defines.h
deleted file mode 100755
index e8a6eefe0..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/defines.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * defines.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/defines.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gludefines_h_
-#define __gludefines_h_
-
-/* culling constants */
-#define CULL_TRIVIAL_REJECT 0
-#define CULL_TRIVIAL_ACCEPT 1
-#define CULL_ACCEPT 2
-
-/* maximum order of a B-Spline */
-#define MAXORDER 24
-
-/* maximum dimension of any B-spline range space */
-#define MAXCOORDS 5
-
-#endif /* __gludefines_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/displaylist.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/displaylist.cc
deleted file mode 100755
index 61b8b8f21..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/displaylist.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * displaylist.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/displaylist.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "mystdio.h"
-#include "nurbstess.h"
-#include "displaylist.h"
-
-
-DisplayList::DisplayList( NurbsTessellator *_nt ) :
- dlnodePool( sizeof( Dlnode ), 1, "dlnodepool" )
-{
- lastNode = &nodes;
- nt = _nt;
-}
-
-DisplayList::~DisplayList( void )
-{
- for( Dlnode *nextNode; nodes; nodes = nextNode ) {
- nextNode = nodes->next;
- if( nodes->cleanup != 0 ) (nt->*nodes->cleanup)( nodes->arg );
- //nodes->deleteMe(dlnodePool);
- }
-}
-
-void
-DisplayList::play( void )
-{
- for( Dlnode *node = nodes; node; node = node->next )
- if( node->work != 0 ) (nt->*node->work)( node->arg );
-}
-
-void
-DisplayList::endList( void )
-{
- *lastNode = 0;
-}
-
-void
-DisplayList::append( PFVS work, void *arg, PFVS cleanup )
-{
- Dlnode *node = new(dlnodePool) Dlnode( work, arg, cleanup );
- *lastNode = node;
- lastNode = &(node->next);
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/displaylist.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/displaylist.h
deleted file mode 100755
index 61acb75bd..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/displaylist.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * displaylist.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/displaylist.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gludisplaylist_h_
-#define __gludisplaylist_h_
-
-#include "glimports.h"
-#include "mysetjmp.h"
-#include "mystdio.h"
-#include "bufpool.h"
-
-class NurbsTessellator;
-
-typedef void (NurbsTessellator::*PFVS)( void * );
-
-struct Dlnode : public PooledObj {
- Dlnode( PFVS, void *, PFVS );
- PFVS work;
- void * arg;
- PFVS cleanup;
- Dlnode * next;
-};
-
-inline
-Dlnode::Dlnode( PFVS _work, void *_arg, PFVS _cleanup )
-{
- work = _work;
- arg = _arg;
- cleanup = _cleanup;
-}
-
-class DisplayList {
-public:
- DisplayList( NurbsTessellator * );
- ~DisplayList( void );
- void play( void );
- void append( PFVS work, void *arg, PFVS cleanup );
- void endList( void );
-private:
- Dlnode *nodes;
- Pool dlnodePool;
- Dlnode **lastNode;
- NurbsTessellator *nt;
-};
-
-#endif /* __gludisplaylist_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/displaymode.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/displaymode.h
deleted file mode 100755
index fe8ba6b8b..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/displaymode.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/displaymode.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef __gludisplaymode_h_
-#define __gludisplaymode_h_
-
-#define N_MESHFILL 0
-#define N_MESHLINE 1
-#define N_MESHPOINT 2
-
-#endif /* __gludisplaymode_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/flist.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/flist.cc
deleted file mode 100755
index 902b23c33..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/flist.cc
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * flist.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/flist.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "myassert.h"
-#include "mystdio.h"
-#include "flist.h"
-
-/*----------------------------------------------------------------------------
- * Flist::Flist - initialize a REAL number array
- *----------------------------------------------------------------------------
- */
-Flist::Flist( void )
-{
- npts = 0;
- pts = 0;
- start = end = 0;
-}
-
-/*----------------------------------------------------------------------------
- * Flist::~Flist - free a REAL number array
- *----------------------------------------------------------------------------
- */
-Flist::~Flist( void )
-{
- if( npts ) delete[] pts;
-}
-
-void
-Flist::add( REAL x )
-{
- pts[end++] = x;
- assert( end <= npts );
-}
-
-/*----------------------------------------------------------------------------
- * Flist::filter - remove duplicate numbers from array
- *----------------------------------------------------------------------------
- */
-void Flist::filter( void )
-{
- sorter.qsort( pts, end );
- start = 0;
-
- int j = 0;
- for( int i = 1; i < end; i++ ) {
- if( pts[i] == pts[i-j-1] )
- j++;
- pts[i-j] = pts[i];
- }
- end -= j;
-}
-
-/*----------------------------------------------------------------------------
- * Flist::grow - ensure that array is large enough
- *----------------------------------------------------------------------------
- */
-void Flist::grow( int maxpts )
-{
- if( npts < maxpts ) {
- if( npts ) delete[] pts;
- npts = 2 * maxpts;
- pts = new REAL[npts];
- assert( pts != 0 );
- }
- start = end = 0;
-}
-
-/*----------------------------------------------------------------------------
- * Flist::taper - ignore head and tail of array
- *----------------------------------------------------------------------------
- */
-void Flist::taper( REAL from, REAL to )
-{
- while( pts[start] != from )
- start++;
-
- while( pts[end-1] != to )
- end--;
-}
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/flist.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/flist.h
deleted file mode 100755
index d5cd4d564..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/flist.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * flist.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/flist.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gluflist_h_
-#define __gluflist_h_
-
-#include "types.h"
-#include "flistsorter.h"
-
-class Flist {
-public:
- REAL * pts; /* head of array */
- int npts; /* number of points in array */
- int start; /* first important point index */
- int end; /* last important point index */
-
- Flist( void );
- ~Flist( void );
- void add( REAL x );
- void filter( void );
- void grow( int);
- void taper( REAL , REAL );
-protected:
- FlistSorter sorter;
-};
-
-#endif /* __gluflist_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/flistsorter.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/flistsorter.cc
deleted file mode 100755
index 328bc4b25..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/flistsorter.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * flistsorter.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/flistsorter.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "flistsorter.h"
-
-FlistSorter::FlistSorter( void ) : Sorter( sizeof( REAL ) )
-{
-}
-
-void
-FlistSorter::qsort( REAL *p, int n )
-{
- Sorter::qsort( (char *)p, n );
-}
-
-int
-FlistSorter::qscmp( char *i, char *j )
-{
- REAL f0 = *(REAL *)i;
- REAL f1 = *(REAL *)j;
- return (f0 < f1) ? -1 : 1;
-}
-
-void
-FlistSorter::qsexc( char *i, char *j )
-{
- REAL *f0 = (REAL *)i;
- REAL *f1 = (REAL *)j;
- REAL tmp = *f0;
- *f0 = *f1;
- *f1 = tmp;
-}
-
-void
-FlistSorter::qstexc( char *i, char *j, char *k )
-{
- REAL *f0 = (REAL *)i;
- REAL *f1 = (REAL *)j;
- REAL *f2 = (REAL *)k;
- REAL tmp = *f0;
- *f0 = *f2;
- *f2 = *f1;
- *f1 = tmp;
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/flistsorter.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/flistsorter.h
deleted file mode 100755
index 3bc1408e3..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/flistsorter.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * flistsorter.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/flistsorter.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gluflistsorter_h_
-#define __gluflistsorter_h_
-
-#include "sorter.h"
-#include "types.h"
-
-class FlistSorter : public Sorter {
-public:
- FlistSorter(void);
- void qsort( REAL *a, int n );
-
-protected:
- virtual int qscmp( char *, char * );
- virtual void qsexc( char *i, char *j ); // i<-j, j<-i
- virtual void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i
-};
-#endif /* __gluflistsorter_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/gridline.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/gridline.h
deleted file mode 100755
index 3879074fe..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/gridline.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * gridline.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/gridline.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glugridline_h_
-#define __glugridline_h_
-
-struct Gridline {
- long v;
- REAL vval;
- long vindex;
- long ustart;
- long uend;
- };
-#endif /* __glugridline_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/gridtrimvertex.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/gridtrimvertex.h
deleted file mode 100755
index 7f83e7237..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/gridtrimvertex.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * gridtrimvertex.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/gridtrimvertex.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glugridtrimvertex_h_
-#define __glugridtrimvertex_h_
-
-#include "mystdlib.h"
-#include "bufpool.h"
-#include "trimvertex.h"
-#include "gridvertex.h"
-
-class GridTrimVertex : public PooledObj
-{
-private:
- TrimVertex dummyt;
- GridVertex dummyg;
-public:
- GridTrimVertex() { g = 0; t = 0; }
- TrimVertex *t;
- GridVertex *g;
-
- inline void set( long, long );
- inline void set( REAL, REAL );
- inline void set( TrimVertex * );
- inline void clear( void ) { t = 0; g = 0; };
- inline int isGridVert() { return g ? 1 : 0 ; }
- inline int isTrimVert() { return t ? 1 : 0 ; }
- inline void output();
-};
-
-inline void
-GridTrimVertex::set( long x, long y )
-{
- g = &dummyg;
- dummyg.gparam[0] = x;
- dummyg.gparam[1] = y;
-}
-
-inline void
-GridTrimVertex::set( REAL x, REAL y )
-{
- g = 0;
- t = &dummyt;
- dummyt.param[0] = x;
- dummyt.param[1] = y;
- dummyt.nuid = 0;
-}
-
-inline void
-GridTrimVertex::set( TrimVertex *v )
-{
- g = 0;
- t = v;
-}
-
-typedef GridTrimVertex *GridTrimVertex_p;
-#endif /* __glugridtrimvertex_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/gridvertex.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/gridvertex.h
deleted file mode 100755
index fba84742d..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/gridvertex.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * gridvertex.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/gridvertex.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glugridvertex_h_
-#define __glugridvertex_h_
-
-struct GridVertex {
- long gparam[2];
- GridVertex( void ) {}
- GridVertex( long u, long v ) { gparam[0] = u, gparam[1] = v; }
- void set( long u, long v ) { gparam[0] = u, gparam[1] = v; }
- long nextu() { return gparam[0]++; }
- long prevu() { return gparam[0]--; }
-};
-
-#endif /* __glugridvertex_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/hull.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/hull.cc
deleted file mode 100755
index fb8fee63f..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/hull.cc
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * hull.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/hull.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "myassert.h"
-#include "mystdio.h"
-#include "hull.h"
-#include "gridvertex.h"
-#include "gridtrimvertex.h"
-#include "gridline.h"
-#include "trimline.h"
-#include "uarray.h"
-#include "trimregion.h"
-
-Hull::Hull( void )
-{}
-
-Hull::~Hull( void )
-{}
-
-/*----------------------------------------------------------------------
- * Hull:init - this routine does the initialization needed before any
- * calls to nextupper or nextlower can be made.
- *----------------------------------------------------------------------
- */
-void
-Hull::init( void )
-{
- TrimVertex *lfirst = left.first();
- TrimVertex *llast = left.last();
- if( lfirst->param[0] <= llast->param[0] ) {
- fakeleft.init( left.first() );
- upper.left = &fakeleft;
- lower.left = &left;
- } else {
- fakeleft.init( left.last() );
- lower.left = &fakeleft;
- upper.left = &left;
- }
- upper.left->last();
- lower.left->first();
-
- if( top.ustart <= top.uend ) {
- upper.line = &top;
- upper.index = top.ustart;
- } else
- upper.line = 0;
-
- if( bot.ustart <= bot.uend ) {
- lower.line = &bot;
- lower.index = bot.ustart;
- } else
- lower.line = 0;
-
- TrimVertex *rfirst = right.first();
- TrimVertex *rlast = right.last();
- if( rfirst->param[0] <= rlast->param[0] ) {
- fakeright.init( right.last() );
- lower.right = &fakeright;
- upper.right = &right;
- } else {
- fakeright.init( right.first() );
- upper.right = &fakeright;
- lower.right = &right;
- }
- upper.right->first();
- lower.right->last();
-}
-
-/*----------------------------------------------------------------------
- * nextupper - find next vertex on upper hull of trim region.
- * - if vertex is on trim curve, set vtop point to
- * that vertex. if vertex is on grid, set vtop to
- * point to temporary area and stuff coordinants into
- * temporary vertex. Also, place grid coords in temporary
- * grid vertex.
- *----------------------------------------------------------------------
- */
-GridTrimVertex *
-Hull::nextupper( GridTrimVertex *gv )
-{
- if( upper.left ) {
- gv->set( upper.left->prev() );
- if( gv->isTrimVert() ) return gv;
- upper.left = 0;
- }
-
- if( upper.line ) {
- assert( upper.index <= upper.line->uend );
- gv->set( uarray.uarray[upper.index], upper.line->vval );
- gv->set( upper.index, upper.line->vindex );
- if( upper.index++ == upper.line->uend ) upper.line = 0;
- return gv;
- }
-
- if( upper.right ) {
- gv->set( upper.right->next() );
- if( gv->isTrimVert() ) return gv;
- upper.right = 0;
- }
-
- return 0;
-}
-
-GridTrimVertex *
-Hull::nextlower( register GridTrimVertex *gv )
-{
- if( lower.left ) {
- gv->set( lower.left->next() );
- if( gv->isTrimVert() ) return gv;
- lower.left = 0;
- }
-
- if( lower.line ) {
- gv->set( uarray.uarray[lower.index], lower.line->vval );
- gv->set( lower.index, lower.line->vindex );
- if( lower.index++ == lower.line->uend ) lower.line = 0;
- return gv;
- }
-
- if( lower.right ) {
- gv->set( lower.right->prev() );
- if( gv->isTrimVert() ) return gv;
- lower.right = 0;
- }
-
- return 0;
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/hull.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/hull.h
deleted file mode 100755
index 1dc83fe5c..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/hull.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * hull.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/hull.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gluhull_h_
-#define __gluhull_h_
-
-#include "trimline.h"
-#include "trimregion.h"
-
-class GridTrimVertex;
-class Gridline;
-class Uarray;
-
-class Hull : virtual public TrimRegion {
-public:
- Hull( void );
- ~Hull( void );
- void init( void );
- GridTrimVertex * nextlower( GridTrimVertex * );
- GridTrimVertex * nextupper( GridTrimVertex * );
-private:
- struct Side {
- Trimline *left;
- Gridline *line;
- Trimline *right;
- long index;
- };
-
- Side lower;
- Side upper;
- Trimline fakeleft;
- Trimline fakeright;
-};
-
-
-#endif /* __gluhull_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/intersect.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/intersect.cc
deleted file mode 100755
index d1beb38ea..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/intersect.cc
+++ /dev/null
@@ -1,662 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * intersect.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/intersect.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "myassert.h"
-#include "mystdio.h"
-#include "subdivider.h"
-#include "arc.h"
-#include "bin.h"
-#include "backend.h"
-#include "trimvertpool.h"
-
-/*#define NOTDEF*/
-
-enum i_result { INTERSECT_VERTEX, INTERSECT_EDGE };
-
-/* local functions */
-static int arc_classify( Arc_ptr, int, REAL );
-static enum i_result pwlarc_intersect( PwlArc *, int, REAL, int, int[3] );
-
-
-void
-Subdivider::partition( Bin & bin, Bin & left, Bin & intersections,
- Bin & right, Bin & unknown, int param, REAL value )
-{
- Bin headonleft, headonright, tailonleft, tailonright;
-
- for( Arc_ptr jarc = bin.removearc(); jarc; jarc = bin.removearc() ) {
-
- REAL tdiff = jarc->tail()[param] - value;
- REAL hdiff = jarc->head()[param] - value;
-
- if( tdiff > 0.0 ) {
- if( hdiff > 0.0 ) {
- right.addarc( jarc );
- } else if( hdiff == 0.0 ) {
- tailonright.addarc( jarc );
- } else {
- Arc_ptr jtemp;
- switch( arc_split(jarc, param, value, 0) ) {
- case 2:
- tailonright.addarc( jarc );
- headonleft.addarc( jarc->next );
- break;
- case 31:
- assert( jarc->head()[param] > value );
- right.addarc( jarc );
- tailonright.addarc( jtemp = jarc->next );
- headonleft.addarc( jtemp->next );
- break;
- case 32:
- assert( jarc->head()[param] <= value );
- tailonright .addarc( jarc );
- headonleft.addarc( jtemp = jarc->next );
- left.addarc( jtemp->next );
- break;
- case 4:
- right.addarc( jarc );
- tailonright.addarc( jtemp = jarc->next );
- headonleft.addarc( jtemp = jtemp->next );
- left.addarc( jtemp->next );
- }
- }
- } else if( tdiff == 0.0 ) {
- if( hdiff > 0.0 ) {
- headonright.addarc( jarc );
- } else if( hdiff == 0.0 ) {
- unknown.addarc( jarc );
- } else {
- headonleft.addarc( jarc );
- }
- } else {
- if( hdiff > 0.0 ) {
- Arc_ptr jtemp;
- switch( arc_split(jarc, param, value, 1) ) {
- case 2:
- tailonleft.addarc( jarc );
- headonright.addarc( jarc->next );
- break;
- case 31:
- assert( jarc->head()[param] < value );
- left.addarc( jarc );
- tailonleft.addarc( jtemp = jarc->next );
- headonright.addarc( jtemp->next );
- break;
- case 32:
- assert( jarc->head()[param] >= value );
- tailonleft.addarc( jarc );
- headonright.addarc( jtemp = jarc->next );
- right.addarc( jtemp->next );
- break;
- case 4:
- left.addarc( jarc );
- tailonleft.addarc( jtemp = jarc->next );
- headonright.addarc( jtemp = jtemp->next );
- right.addarc( jtemp->next );
- }
- } else if( hdiff == 0.0 ) {
- tailonleft.addarc( jarc );
- } else {
- left.addarc( jarc );
- }
- }
- }
- if( param == 0 ) {
- classify_headonleft_s( headonleft, intersections, left, value );
- classify_tailonleft_s( tailonleft, intersections, left, value );
- classify_headonright_s( headonright, intersections, right, value );
- classify_tailonright_s( tailonright, intersections, right, value );
- } else {
- classify_headonleft_t( headonleft, intersections, left, value );
- classify_tailonleft_t( tailonleft, intersections, left, value );
- classify_headonright_t( headonright, intersections, right, value );
- classify_tailonright_t( tailonright, intersections, right, value );
- }
-}
-
-inline static void
-vert_interp( TrimVertex *n, TrimVertex *l, TrimVertex *r, int p, REAL val )
-{
- assert( val > l->param[p]);
- assert( val < r->param[p]);
-
- n->nuid = l->nuid;
-
- n->param[p] = val;
- if( l->param[1-p] != r->param[1-p] ) {
- REAL ratio = (val - l->param[p]) / (r->param[p] - l->param[p]);
- n->param[1-p] = l->param[1-p] +
- ratio * (r->param[1-p] - l->param[1-p]);
- } else {
- n->param[1-p] = l->param[1-p];
- }
-}
-
-int
-Subdivider::arc_split( Arc_ptr jarc, int param, REAL value, int dir )
-{
- int maxvertex = jarc->pwlArc->npts;
- Arc_ptr jarc1, jarc2, jarc3;
- TrimVertex* v = jarc->pwlArc->pts;
-
- int loc[3];
- switch( pwlarc_intersect( jarc->pwlArc, param, value, dir, loc ) ) {
-
- // When the parameter value lands on a vertex, life is sweet
- case INTERSECT_VERTEX: {
- jarc1 = new(arcpool) Arc( jarc, new( pwlarcpool) PwlArc( maxvertex-loc[1], &v[loc[1]] ) );
- jarc->pwlArc->npts = loc[1] + 1;
- jarc1->next = jarc->next;
- jarc1->next->prev = jarc1;
- jarc->next = jarc1;
- jarc1->prev = jarc;
- assert(jarc->check() != 0);
- return 2;
- }
-
- // When the parameter value intersects an edge, we have to
- // interpolate a new vertex. There are special cases
- // if the new vertex is adjacent to one or both of the
- // endpoints of the arc.
- case INTERSECT_EDGE: {
- int i, j;
- if( dir == 0 ) {
- i = loc[0];
- j = loc[2];
- } else {
- i = loc[2];
- j = loc[0];
- }
-
-#ifndef NOTDEF
- // The split is between vertices at index j and i, in that
- // order (j < i)
-
- // JEB: This code is my idea of how to do the split without
- // increasing the number of links. I'm doing this so that
- // the is_rect routine can recognize rectangles created by
- // subdivision. In exchange for simplifying the curve list,
- // however, it costs in allocated space and vertex copies.
-
- TrimVertex *newjunk = trimvertexpool.get(maxvertex -i+1 /*-j*/);
- int k;
- for(k=0; k<maxvertex-i; k++)
- {
- newjunk[k+1] = v[i+k];
- newjunk[k+1].nuid = jarc->nuid;
- }
-
- TrimVertex *vcopy = trimvertexpool.get(maxvertex);
- for(k=0; k<maxvertex; k++)
- {
- vcopy[k].param[0] = v[k].param[0];
- vcopy[k].param[1] = v[k].param[1];
- }
- jarc->pwlArc->pts=vcopy;
-
- v[i].nuid = jarc->nuid;
- v[j].nuid = jarc->nuid;
- vert_interp( &newjunk[0], &v[loc[0]], &v[loc[2]], param, value );
-
- if( showingDegenerate() )
- backend.triangle( &v[i], &newjunk[0], &v[j] );
-
- vcopy[j+1].param[0]=newjunk[0].param[0];
- vcopy[j+1].param[1]=newjunk[0].param[1];
-
-
- jarc1 = new(arcpool) Arc( jarc,
- new(pwlarcpool) PwlArc(maxvertex-i+1 , newjunk ) );
-
- jarc->pwlArc->npts = j+2;
- jarc1->next = jarc->next;
- jarc1->next->prev = jarc1;
- jarc->next = jarc1;
- jarc1->prev = jarc;
- assert(jarc->check() != 0);
-
- return 2;
-#endif //not NOTDEF
- // JEB: This is the original version:
-#ifdef NOTDEF
-
- TrimVertex *newjunk = trimvertexpool.get(3);
- v[i].nuid = jarc->nuid;
- v[j].nuid = jarc->nuid;
- newjunk[0] = v[j];
- newjunk[2] = v[i];
- vert_interp( &newjunk[1], &v[loc[0]], &v[loc[2]], param, value );
-
- if( showingDegenerate() )
- backend.triangle( &newjunk[2], &newjunk[1], &newjunk[0] );
-
- // New vertex adjacent to both endpoints
- if (maxvertex == 2) {
- jarc1 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk+1 ) );
- jarc->pwlArc->npts = 2;
- jarc->pwlArc->pts = newjunk;
- jarc1->next = jarc->next;
- jarc1->next->prev = jarc1;
- jarc->next = jarc1;
- jarc1->prev = jarc;
- assert(jarc->check() != 0);
-
- return 2;
-
- // New vertex adjacent to ending point of arc
- } else if (maxvertex - j == 2) {
- jarc1 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk ) );
- jarc2 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk+1 ) );
- jarc->pwlArc->npts = maxvertex-1;
- jarc2->next = jarc->next;
- jarc2->next->prev = jarc2;
- jarc->next = jarc1;
- jarc1->prev = jarc;
- jarc1->next = jarc2;
- jarc2->prev = jarc1;
- assert(jarc->check() != 0);
- return 31;
-
- // New vertex adjacent to starting point of arc
- } else if (i == 1) {
- jarc1 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk+1 ) );
- jarc2 = new(arcpool) Arc( jarc,
- new(pwlarcpool) PwlArc( maxvertex-1, &jarc->pwlArc->pts[1] ) );
- jarc->pwlArc->npts = 2;
- jarc->pwlArc->pts = newjunk;
- jarc2->next = jarc->next;
- jarc2->next->prev = jarc2;
- jarc->next = jarc1;
- jarc1->prev = jarc;
- jarc1->next = jarc2;
- jarc2->prev = jarc1;
- assert(jarc->check() != 0);
- return 32;
-
- // It's somewhere in the middle
- } else {
- jarc1 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk ) );
- jarc2 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk+1 ) );
- jarc3 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( maxvertex-i, v+i ) );
- jarc->pwlArc->npts = j + 1;
- jarc3->next = jarc->next;
- jarc3->next->prev = jarc3;
- jarc->next = jarc1;
- jarc1->prev = jarc;
- jarc1->next = jarc2;
- jarc2->prev = jarc1;
- jarc2->next = jarc3;
- jarc3->prev = jarc2;
- assert(jarc->check() != 0);
- return 4;
- }
-#endif // NOTDEF
- }
- default:
- return -1; //picked -1 since it's not used
- }
-}
-
-/*----------------------------------------------------------------------------
- * pwlarc_intersect - find intersection of pwlArc and isoparametric line
- *----------------------------------------------------------------------------
- */
-
-static enum i_result
-pwlarc_intersect(
- PwlArc *pwlArc,
- int param,
- REAL value,
- int dir,
- int loc[3] )
-{
- assert( pwlArc->npts > 0 );
-
- if( dir ) {
- TrimVertex *v = pwlArc->pts;
- int imin = 0;
- int imax = pwlArc->npts - 1;
- assert( value > v[imin].param[param] );
- assert( value < v[imax].param[param] );
- while( (imax - imin) > 1 ) {
- int imid = (imax + imin)/2;
- if( v[imid].param[param] > value )
- imax = imid;
- else if( v[imid].param[param] < value )
- imin = imid;
- else {
- loc[1] = imid;
- return INTERSECT_VERTEX;
- }
- }
- loc[0] = imin;
- loc[2] = imax;
- return INTERSECT_EDGE;
- } else {
- TrimVertex *v = pwlArc->pts;
- int imax = 0;
- int imin = pwlArc->npts - 1;
- assert( value > v[imin].param[param] );
- assert( value < v[imax].param[param] );
- while( (imin - imax) > 1 ) {
- int imid = (imax + imin)/2;
- if( v[imid].param[param] > value )
- imax = imid;
- else if( v[imid].param[param] < value )
- imin = imid;
- else {
- loc[1] = imid;
- return INTERSECT_VERTEX;
- }
- }
- loc[0] = imin;
- loc[2] = imax;
- return INTERSECT_EDGE;
- }
-}
-
-/*----------------------------------------------------------------------------
- * arc_classify - determine which side of a line a jarc lies
- *----------------------------------------------------------------------------
- */
-
-static int
-arc_classify( Arc_ptr jarc, int param, REAL value )
-{
- REAL tdiff, hdiff;
- if( param == 0 ) {
- tdiff = jarc->tail()[0] - value;
- hdiff = jarc->head()[0] - value;
- } else {
- tdiff = jarc->tail()[1] - value;
- hdiff = jarc->head()[1] - value;
- }
-
- if( tdiff > 0.0 ) {
- if( hdiff > 0.0 ) {
- return 0x11;
- } else if( hdiff == 0.0 ) {
- return 0x12;
- } else {
- return 0x10;
- }
- } else if( tdiff == 0.0 ) {
- if( hdiff > 0.0 ) {
- return 0x21;
- } else if( hdiff == 0.0 ) {
- return 0x22;
- } else {
- return 0x20;
- }
- } else {
- if( hdiff > 0.0 ) {
- return 0x01;
- } else if( hdiff == 0.0 ) {
- return 0x02;
- } else {
- return 0;
- }
- }
-}
-
-void
-Subdivider::classify_tailonleft_s( Bin& bin, Bin& in, Bin& out, REAL val )
-{
- /* tail at left, head on line */
- Arc_ptr j;
-
- while( (j = bin.removearc()) != NULL ) {
- assert( arc_classify( j, 0, val ) == 0x02 );
- j->clearitail();
-
- REAL diff = j->next->head()[0] - val;
- if( diff > 0.0 ) {
- in.addarc( j );
- } else if( diff < 0.0 ) {
- if( ccwTurn_sl( j, j->next ) )
- out.addarc( j );
- else
- in.addarc( j );
- } else {
- if( j->next->tail()[1] > j->next->head()[1] )
- in.addarc(j);
- else
- out.addarc(j);
- }
- }
-}
-
-void
-Subdivider::classify_tailonleft_t( Bin& bin, Bin& in, Bin& out, REAL val )
-{
- /* tail at left, head on line */
- Arc_ptr j;
-
- while( (j = bin.removearc()) != NULL ) {
- assert( arc_classify( j, 1, val ) == 0x02 );
- j->clearitail();
-
- REAL diff = j->next->head()[1] - val;
- if( diff > 0.0 ) {
- in.addarc( j );
- } else if( diff < 0.0 ) {
- if( ccwTurn_tl( j, j->next ) )
- out.addarc( j );
- else
- in.addarc( j );
- } else {
- if (j->next->tail()[0] > j->next->head()[0] )
- out.addarc( j );
- else
- in.addarc( j );
- }
- }
-}
-
-void
-Subdivider::classify_headonleft_s( Bin& bin, Bin& in, Bin& out, REAL val )
-{
- /* tail on line, head at left */
- Arc_ptr j;
-
- while( (j = bin.removearc()) != NULL ) {
- assert( arc_classify( j, 0, val ) == 0x20 );
-
- j->setitail();
-
- REAL diff = j->prev->tail()[0] - val;
- if( diff > 0.0 ) {
- out.addarc( j );
- } else if( diff < 0.0 ) {
- if( ccwTurn_sl( j->prev, j ) )
- out.addarc( j );
- else
- in.addarc( j );
- } else {
- if( j->prev->tail()[1] > j->prev->head()[1] )
- in.addarc( j );
- else
- out.addarc( j );
- }
- }
-}
-
-void
-Subdivider::classify_headonleft_t( Bin& bin, Bin& in, Bin& out, REAL val )
-{
- /* tail on line, head at left */
- Arc_ptr j;
-
- while( (j = bin.removearc()) != NULL ) {
- assert( arc_classify( j, 1, val ) == 0x20 );
- j->setitail();
-
- REAL diff = j->prev->tail()[1] - val;
- if( diff > 0.0 ) {
- out.addarc( j );
- } else if( diff < 0.0 ) {
- if( ccwTurn_tl( j->prev, j ) )
- out.addarc( j );
- else
- in.addarc( j );
- } else {
- if( j->prev->tail()[0] > j->prev->head()[0] )
- out.addarc( j );
- else
- in.addarc( j );
- }
- }
-}
-
-
-void
-Subdivider::classify_tailonright_s( Bin& bin, Bin& in, Bin& out, REAL val )
-{
- /* tail at right, head on line */
- Arc_ptr j;
-
- while( (j = bin.removearc()) != NULL ) {
- assert( arc_classify( j, 0, val ) == 0x12);
-
- j->clearitail();
-
- REAL diff = j->next->head()[0] - val;
- if( diff > 0.0 ) {
- if( ccwTurn_sr( j, j->next ) )
- out.addarc( j );
- else
- in.addarc( j );
- } else if( diff < 0.0 ) {
- in.addarc( j );
- } else {
- if( j->next->tail()[1] > j->next->head()[1] )
- out.addarc( j );
- else
- in.addarc( j );
- }
- }
-}
-
-void
-Subdivider::classify_tailonright_t( Bin& bin, Bin& in, Bin& out, REAL val )
-{
- /* tail at right, head on line */
- Arc_ptr j;
-
- while( (j = bin.removearc()) != NULL ) {
- assert( arc_classify( j, 1, val ) == 0x12);
-
- j->clearitail();
-
- REAL diff = j->next->head()[1] - val;
- if( diff > 0.0 ) {
- if( ccwTurn_tr( j, j->next ) )
- out.addarc( j );
- else
- in.addarc( j );
- } else if( diff < 0.0 ) {
- in.addarc( j );
- } else {
- if( j->next->tail()[0] > j->next->head()[0] )
- in.addarc( j );
- else
- out.addarc( j );
- }
- }
-}
-
-void
-Subdivider::classify_headonright_s( Bin& bin, Bin& in, Bin& out, REAL val )
-{
- /* tail on line, head at right */
- Arc_ptr j;
-
- while( (j = bin.removearc()) != NULL ) {
- assert( arc_classify( j, 0, val ) == 0x21 );
-
- j->setitail();
-
- REAL diff = j->prev->tail()[0] - val;
- if( diff > 0.0 ) {
- if( ccwTurn_sr( j->prev, j ) )
- out.addarc( j );
- else
- in.addarc( j );
- } else if( diff < 0.0 ) {
- out.addarc( j );
- } else {
- if( j->prev->tail()[1] > j->prev->head()[1] )
- out.addarc( j );
- else
- in.addarc( j );
- }
- }
-}
-
-void
-Subdivider::classify_headonright_t( Bin& bin, Bin& in, Bin& out, REAL val )
-{
- /* tail on line, head at right */
- Arc_ptr j;
-
- while( (j = bin.removearc()) != NULL ) {
- assert( arc_classify( j, 1, val ) == 0x21 );
-
- j->setitail();
-
- REAL diff = j->prev->tail()[1] - val;
- if( diff > 0.0 ) {
- if( ccwTurn_tr( j->prev, j ) )
- out.addarc( j );
- else
- in.addarc( j );
- } else if( diff < 0.0 ) {
- out.addarc( j );
- } else {
- if( j->prev->tail()[0] > j->prev->head()[0] )
- in.addarc( j );
- else
- out.addarc( j );
- }
- }
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/jarcloc.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/jarcloc.h
deleted file mode 100755
index 4b51d2081..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/jarcloc.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * jarcloc.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/jarcloc.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glujarcloc_h_
-#define __glujarcloc_h_
-
-#include "arc.h"
-
-class Jarcloc {
-private:
- Arc_ptr arc;
- TrimVertex *p;
- TrimVertex *plast;
-public:
- inline void init( Arc_ptr a, long first, long last ) { arc = a; p=&a->pwlArc->pts[first]; plast = &a->pwlArc->pts[last]; }
- inline TrimVertex * getnextpt( void );
- inline TrimVertex * getprevpt( void );
- inline void reverse();
-};
-
-inline void
-Jarcloc::reverse()
-{
- if( plast == &arc->pwlArc->pts[0] )
- plast = &arc->pwlArc->pts[arc->pwlArc->npts - 1];
- else
- plast = &arc->pwlArc->pts[0];
-}
-
-inline TrimVertex *
-Jarcloc::getnextpt()
-{
- assert( p <= plast );
- if( p == plast ) {
- arc = arc->next;
- p = &arc->pwlArc->pts[0];
- plast = &arc->pwlArc->pts[arc->pwlArc->npts - 1];
- assert( p < plast );
- }
- return p++;
-}
-
-inline TrimVertex *
-Jarcloc::getprevpt()
-{
- assert( p >= plast );
- if( p == plast ) {
- arc = arc->prev;
- p = &arc->pwlArc->pts[arc->pwlArc->npts - 1];
- plast = &arc->pwlArc->pts[0];
- assert( p > plast );
- }
- return p--;
-}
-#endif /* __glujarcloc_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/knotvector.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/knotvector.cc
deleted file mode 100755
index 1f3370956..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/knotvector.cc
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * knotvector.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/knotvector.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "mystdio.h"
-#include "myassert.h"
-#include "knotvector.h"
-#include "defines.h"
-
-
-void Knotvector::init( long _knotcount, long _stride, long _order, INREAL *_knotlist )
-{
- knotcount = _knotcount;
- stride = _stride;
- order = _order;
- knotlist = new Knot[_knotcount];
- assert( knotlist != 0 );
-
- for( int i = 0; i != _knotcount; i++ )
- knotlist[i] = (Knot) _knotlist[i];
-}
-
-Knotvector::Knotvector( void )
-{
- knotlist = 0;
-}
-
-Knotvector::~Knotvector( void )
-{
- if( knotlist ) delete[] knotlist;
-}
-
-int Knotvector::validate( void )
-{
- /* kindex is used as an array index so subtract one first,
- * this propagates throughout the code so study carefully */
- long kindex = knotcount-1;
-
- if( order < 1 || order > MAXORDER ) {
- // spline order un-supported
- return( 1 );
- }
-
- if( knotcount < (2 * order) ) {
- // too few knots
- return( 2 );
- }
-
- if( identical( knotlist[kindex-(order-1)], knotlist[order-1]) ) {
- // valid knot range is empty
- return( 3 );
- }
-
- for( long i = 0; i < kindex; i++)
- if( knotlist[i] > knotlist[i+1] ) {
- // decreasing knot sequence
- return( 4 );
- }
-
- /* check for valid multiplicity */
-
- /* kindex is currently the index of the last knot.
- * In the next loop it is decremented to ignore the last knot
- * and the loop stops when kindex is 2 so as to ignore the first
- * knot as well. These knots are not used in computing
- * knot multiplicities.
- */
-
- long multi = 1;
- for( ; kindex >= 1; kindex-- ) {
- if( knotlist[kindex] - knotlist[kindex-1] < TOLERANCE ) {
- multi++;
- continue;
- }
- if ( multi > order ) {
- // knot multiplicity greater than order of spline
- return( 5 );
- }
- multi = 1;
- }
-
- if ( multi > order ) {
- // knot multiplicity greater than order of spline
- return( 5 );
- }
-
- return 0;
-}
-
-void Knotvector::show( char *msg )
-{
-#ifndef NDEBUG
- dprintf( "%s\n", msg );
- dprintf( "order = %ld, count = %ld\n", order, knotcount );
-
- for( int i=0; i<knotcount; i++ )
- dprintf( "knot[%d] = %g\n", i, knotlist[i] );
-#endif
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/knotvector.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/knotvector.h
deleted file mode 100755
index 804b22b84..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/knotvector.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * knotvector.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/knotvector.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gluknotvector_h_
-#define __gluknotvector_h_
-
-#include "types.h"
-
-struct Knotvector { /* a knot vector */
- Knotvector( void );
- ~Knotvector( void );
- void init( long, long, long, INREAL * );
- int validate( void );
- void show( char * );
-
- long order; /* order of spline */
- long knotcount; /* number of knots */
- long stride; /* bytes between points */
- Knot * knotlist; /* global knot vector */
-};
-
-/* tolerance to test knot coincidence */
-#define TOLERANCE 1.0e-5
-
-inline int
-identical( Knot x, Knot y )
-{
- return ((x-y) < TOLERANCE) ? 1 : 0;
-}
-#endif /* __gluknotvector_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdesc.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdesc.cc
deleted file mode 100755
index 845574d1d..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdesc.cc
+++ /dev/null
@@ -1,843 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * mapdesc.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/mapdesc.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include <stdio.h>
-#include "glimports.h"
-#include "mystdio.h"
-#include "myassert.h"
-#include "mystring.h"
-#include "mymath.h"
-#include "backend.h"
-#include "nurbsconsts.h"
-#include "mapdesc.h"
-
-Mapdesc::Mapdesc( long _type, int _israt, int _ncoords, Backend& b )
- : backend( b )
-{
- type = _type;
- isrational = _israt;
- ncoords = _ncoords;
- hcoords = _ncoords + (_israt ? 0 : 1 );
- inhcoords = _ncoords - (_israt ? 1 : 0 );
- mask = ((1<<(inhcoords*2))-1);
- next = 0;
-
- assert( hcoords <= MAXCOORDS );
- assert( inhcoords >= 1 );
-
- pixel_tolerance = 1.0;
- error_tolerance = 1.0;
- bbox_subdividing = N_NOBBOXSUBDIVISION;
- culling_method = N_NOCULLING;
- sampling_method = N_NOSAMPLING;
- clampfactor = N_NOCLAMPING;
- minsavings = N_NOSAVINGSSUBDIVISION;
- s_steps = 0.0;
- t_steps = 0.0;
- maxrate = ( s_steps < 0.0 ) ? 0.0 : s_steps;
- maxsrate = ( s_steps < 0.0 ) ? 0.0 : s_steps;
- maxtrate = ( t_steps < 0.0 ) ? 0.0 : t_steps;
- identify( bmat );
- identify( cmat );
- identify( smat );
- for( int i = 0; i != inhcoords; i++ )
- bboxsize[i] = 1.0;
-}
-
-void
-Mapdesc::setBboxsize( INREAL *mat )
-{
- for( int i = 0; i != inhcoords; i++ )
- bboxsize[i] = (REAL) mat[i];
-}
-
-void
-Mapdesc::identify( REAL dest[MAXCOORDS][MAXCOORDS] )
-{
- memset( dest, 0, sizeof( dest ) );
- for( int i=0; i != hcoords; i++ )
- dest[i][i] = 1.0;
-}
-
-void
-Mapdesc::surfbbox( REAL bb[2][MAXCOORDS] )
-{
- backend.surfbbox( type, bb[0], bb[1] );
-}
-
-void
-Mapdesc::copy( REAL dest[MAXCOORDS][MAXCOORDS], long n, INREAL *src,
- long rstride, long cstride )
-{
- assert( n >= 0 );
- for( int i=0; i != n; i++ )
- for( int j=0; j != n; j++ )
- dest[i][j] = src[i*rstride + j*cstride];
-}
-
-/*--------------------------------------------------------------------------
- * copyPt - copy a homogeneous point
- *--------------------------------------------------------------------------
- */
-void
-Mapdesc::copyPt( REAL *d, REAL *s )
-{
- assert( hcoords > 0 );
- switch( hcoords ) {
- case 4:
- d[3] = s[3];
- d[2] = s[2];
- d[1] = s[1];
- d[0] = s[0];
- break;
- case 3:
- d[2] = s[2];
- d[1] = s[1];
- d[0] = s[0];
- break;
- case 2:
- d[1] = s[1];
- d[0] = s[0];
- break;
- case 1:
- d[0] = s[0];
- break;
- case 5:
- d[4] = s[4];
- d[3] = s[3];
- d[2] = s[2];
- d[1] = s[1];
- d[0] = s[0];
- break;
- default:
- memcpy( d, s, hcoords * sizeof( REAL ) );
- break;
- }
-}
-
-/*--------------------------------------------------------------------------
- * sumPt - compute affine combination of two homogeneous points
- *--------------------------------------------------------------------------
- */
-void
-Mapdesc::sumPt( REAL *dst, REAL *src1, REAL *src2, register REAL alpha, register REAL beta )
-{
- assert( hcoords > 0 );
- switch( hcoords ) {
- case 4:
- dst[3] = src1[3] * alpha + src2[3] * beta;
- dst[2] = src1[2] * alpha + src2[2] * beta;
- dst[1] = src1[1] * alpha + src2[1] * beta;
- dst[0] = src1[0] * alpha + src2[0] * beta;
- break;
- case 3:
- dst[2] = src1[2] * alpha + src2[2] * beta;
- dst[1] = src1[1] * alpha + src2[1] * beta;
- dst[0] = src1[0] * alpha + src2[0] * beta;
- break;
- case 2:
- dst[1] = src1[1] * alpha + src2[1] * beta;
- dst[0] = src1[0] * alpha + src2[0] * beta;
- break;
- case 1:
- dst[0] = src1[0] * alpha + src2[0] * beta;
- break;
- case 5:
- dst[4] = src1[4] * alpha + src2[4] * beta;
- dst[3] = src1[3] * alpha + src2[3] * beta;
- dst[2] = src1[2] * alpha + src2[2] * beta;
- dst[1] = src1[1] * alpha + src2[1] * beta;
- dst[0] = src1[0] * alpha + src2[0] * beta;
- break;
- default: {
- for( int i = 0; i != hcoords; i++ )
- dst[i] = src1[i] * alpha + src2[i] * beta;
- }
- break;
- }
-}
-
-/*--------------------------------------------------------------------------
- * clipbits - compute bit-vector indicating point/window position
- * of a (transformed) homogeneous point
- *--------------------------------------------------------------------------
- */
-unsigned int
-Mapdesc::clipbits( REAL *p )
-{
- assert( inhcoords >= 0 );
- assert( inhcoords <= 3 );
-
- register int nc = inhcoords;
- register REAL pw = p[nc];
- register REAL nw = -pw;
- register unsigned int bits = 0;
-
- if( pw == 0.0 ) return mask;
-
- if( pw > 0.0 ) {
- switch( nc ) {
- case 3:
- if( p[2] <= pw ) bits |= (1<<5);
- if( p[2] >= nw ) bits |= (1<<4);
- if( p[1] <= pw ) bits |= (1<<3);
- if( p[1] >= nw ) bits |= (1<<2);
- if( p[0] <= pw ) bits |= (1<<1);
- if( p[0] >= nw ) bits |= (1<<0);
- return bits;
- case 2:
- if( p[1] <= pw ) bits |= (1<<3);
- if( p[1] >= nw ) bits |= (1<<2);
- if( p[0] <= pw ) bits |= (1<<1);
- if( p[0] >= nw ) bits |= (1<<0);
- return bits;
- case 1:
- if( p[0] <= pw ) bits |= (1<<1);
- if( p[0] >= nw ) bits |= (1<<0);
- return bits;
- default: {
- int bit = 1;
- for( int i=0; i<nc; i++ ) {
- if( p[i] >= nw ) bits |= bit;
- bit <<= 1;
- if( p[i] <= pw ) bits |= bit;
- bit <<= 1;
- }
- abort();
- break;
- }
- }
- } else {
- switch( nc ) {
- case 3:
- if( p[2] <= nw ) bits |= (1<<5);
- if( p[2] >= pw ) bits |= (1<<4);
- if( p[1] <= nw ) bits |= (1<<3);
- if( p[1] >= pw ) bits |= (1<<2);
- if( p[0] <= nw ) bits |= (1<<1);
- if( p[0] >= pw ) bits |= (1<<0);
- return bits;
- case 2:
- if( p[1] <= nw ) bits |= (1<<3);
- if( p[1] >= pw ) bits |= (1<<2);
- if( p[0] <= nw ) bits |= (1<<1);
- if( p[0] >= pw ) bits |= (1<<0);
- return bits;
- case 1:
- if( p[0] <= nw ) bits |= (1<<1);
- if( p[0] >= pw ) bits |= (1<<0);
- return bits;
- default: {
- int bit = 1;
- for( int i=0; i<nc; i++ ) {
- if( p[i] >= pw ) bits |= bit;
- bit <<= 1;
- if( p[i] <= nw ) bits |= bit;
- bit <<= 1;
- }
- abort();
- break;
- }
- }
- }
- return bits;
-}
-
-/*--------------------------------------------------------------------------
- * xformRational - transform a homogeneous point
- *--------------------------------------------------------------------------
- */
-void
-Mapdesc::xformRational( Maxmatrix mat, REAL *d, REAL *s )
-{
- assert( hcoords >= 0 );
-
- if( hcoords == 3 ) {
- REAL x = s[0];
- REAL y = s[1];
- REAL z = s[2];
- d[0] = x*mat[0][0]+y*mat[1][0]+z*mat[2][0];
- d[1] = x*mat[0][1]+y*mat[1][1]+z*mat[2][1];
- d[2] = x*mat[0][2]+y*mat[1][2]+z*mat[2][2];
- } else if( hcoords == 4 ) {
- REAL x = s[0];
- REAL y = s[1];
- REAL z = s[2];
- REAL w = s[3];
- d[0] = x*mat[0][0]+y*mat[1][0]+z*mat[2][0]+w*mat[3][0];
- d[1] = x*mat[0][1]+y*mat[1][1]+z*mat[2][1]+w*mat[3][1];
- d[2] = x*mat[0][2]+y*mat[1][2]+z*mat[2][2]+w*mat[3][2];
- d[3] = x*mat[0][3]+y*mat[1][3]+z*mat[2][3]+w*mat[3][3];
- } else {
- for( int i=0; i != hcoords; i++ ) {
- d[i] = 0;
- for( int j = 0; j != hcoords; j++ )
- d[i] += s[j] * mat[j][i];
- }
- }
-}
-
-/*--------------------------------------------------------------------------
- * xformNonrational - transform a inhomogeneous point to a homogeneous point
- *--------------------------------------------------------------------------
- */
-void
-Mapdesc::xformNonrational( Maxmatrix mat, REAL *d, REAL *s )
-{
- if( inhcoords == 2 ) {
- REAL x = s[0];
- REAL y = s[1];
- d[0] = x*mat[0][0]+y*mat[1][0]+mat[2][0];
- d[1] = x*mat[0][1]+y*mat[1][1]+mat[2][1];
- d[2] = x*mat[0][2]+y*mat[1][2]+mat[2][2];
- } else if( inhcoords == 3 ) {
- REAL x = s[0];
- REAL y = s[1];
- REAL z = s[2];
- d[0] = x*mat[0][0]+y*mat[1][0]+z*mat[2][0]+mat[3][0];
- d[1] = x*mat[0][1]+y*mat[1][1]+z*mat[2][1]+mat[3][1];
- d[2] = x*mat[0][2]+y*mat[1][2]+z*mat[2][2]+mat[3][2];
- d[3] = x*mat[0][3]+y*mat[1][3]+z*mat[2][3]+mat[3][3];
- } else {
- assert( inhcoords >= 0 );
- for( int i=0; i != hcoords; i++ ) {
- d[i] = mat[inhcoords][i];
- for( int j = 0; j < inhcoords; j++ )
- d[i] += s[j] * mat[j][i];
- }
- }
-}
-
-/*--------------------------------------------------------------------------
- * xformAndCullCheck - transform a set of points that may be EITHER
- * homogeneous or inhomogeneous depending on the map description and
- * check if they are either completely inside, completely outside,
- * or intersecting the viewing frustrum.
- *--------------------------------------------------------------------------
- */
-int
-Mapdesc::xformAndCullCheck(
- REAL *pts, int uorder, int ustride, int vorder, int vstride )
-{
- assert( uorder > 0 );
- assert( vorder > 0 );
-
- unsigned int inbits = mask;
- unsigned int outbits = 0;
-
- REAL *p = pts;
- for( REAL *pend = p + uorder * ustride; p != pend; p += ustride ) {
- REAL *q = p;
- for( REAL *qend = q + vorder * vstride; q != qend; q += vstride ) {
- REAL cpts[MAXCOORDS];
- xformCulling( cpts, q );
- unsigned int bits = clipbits( cpts );
- outbits |= bits;
- inbits &= bits;
- if( ( outbits == mask ) && ( inbits != mask ) ) return CULL_ACCEPT;
- }
- }
-
- if( outbits != mask ) {
- return CULL_TRIVIAL_REJECT;
- } else if( inbits == mask ) {
- return CULL_TRIVIAL_ACCEPT;
- } else {
- return CULL_ACCEPT;
- }
-}
-
-/*--------------------------------------------------------------------------
- * cullCheck - check if a set of homogeneous transformed points are
- * either completely inside, completely outside,
- * or intersecting the viewing frustrum.
- *--------------------------------------------------------------------------
- */
-int
-Mapdesc::cullCheck( REAL *pts, int uorder, int ustride, int vorder, int vstride )
-{
- unsigned int inbits = mask;
- unsigned int outbits = 0;
-
- REAL *p = pts;
- for( REAL *pend = p + uorder * ustride; p != pend; p += ustride ) {
- REAL *q = p;
- for( REAL *qend = q + vorder * vstride; q != qend; q += vstride ) {
- unsigned int bits = clipbits( q );
- outbits |= bits;
- inbits &= bits;
- if( ( outbits == mask ) && ( inbits != mask ) ) return CULL_ACCEPT;
- }
- }
-
- if( outbits != mask ) {
- return CULL_TRIVIAL_REJECT;
- } else if( inbits == mask ) {
- return CULL_TRIVIAL_ACCEPT;
- } else {
- return CULL_ACCEPT;
- }
-}
-
-/*--------------------------------------------------------------------------
- * cullCheck - check if a set of homogeneous transformed points are
- * either completely inside, completely outside,
- * or intersecting the viewing frustrum.
- *--------------------------------------------------------------------------
- */
-int
-Mapdesc::cullCheck( REAL *pts, int order, int stride )
-{
- unsigned int inbits = mask;
- unsigned int outbits = 0;
-
- REAL *p = pts;
- for( REAL *pend = p + order * stride; p != pend; p += stride ) {
- unsigned int bits = clipbits( p );
- outbits |= bits;
- inbits &= bits;
- if( ( outbits == mask ) && ( inbits != mask ) ) return CULL_ACCEPT;
- }
-
- if( outbits != mask ) {
- return CULL_TRIVIAL_REJECT;
- } else if( inbits == mask ) {
- return CULL_TRIVIAL_ACCEPT;
- } else {
- return CULL_ACCEPT;
- }
-}
-
-/*--------------------------------------------------------------------------
- * xformSampling - transform a set of points that may be EITHER
- * homogeneous or inhomogeneous depending on the map description
- * into sampling space
- *--------------------------------------------------------------------------
- */
-void
-Mapdesc::xformSampling( REAL *pts, int order, int stride, REAL *sp, int outstride )
-{
- xformMat( smat, pts, order, stride, sp, outstride );
-}
-
-void
-Mapdesc::xformBounding( REAL *pts, int order, int stride, REAL *sp, int outstride )
-{
- xformMat( bmat, pts, order, stride, sp, outstride );
-}
-
-/*--------------------------------------------------------------------------
- * xformCulling - transform a set of points that may be EITHER
- * homogeneous or inhomogeneous depending on the map description
- * into culling space
- *--------------------------------------------------------------------------
- */
-void
-Mapdesc::xformCulling( REAL *pts, int order, int stride, REAL *cp, int outstride )
-{
- xformMat( cmat, pts, order, stride, cp, outstride );
-}
-
-/*--------------------------------------------------------------------------
- * xformCulling - transform a set of points that may be EITHER
- * homogeneous or inhomogeneous depending on the map description
- * into culling space
- *--------------------------------------------------------------------------
- */
-void
-Mapdesc::xformCulling( REAL *pts,
- int uorder, int ustride,
- int vorder, int vstride,
- REAL *cp, int outustride, int outvstride )
-{
- xformMat( cmat, pts, uorder, ustride, vorder, vstride, cp, outustride, outvstride );
-}
-
-/*--------------------------------------------------------------------------
- * xformSampling - transform a set of points that may be EITHER
- * homogeneous or inhomogeneous depending on the map description
- * into sampling space
- *--------------------------------------------------------------------------
- */
-void
-Mapdesc::xformSampling( REAL *pts,
- int uorder, int ustride,
- int vorder, int vstride,
- REAL *sp, int outustride, int outvstride )
-{
- xformMat( smat, pts, uorder, ustride, vorder, vstride, sp, outustride, outvstride );
-}
-
-void
-Mapdesc::xformBounding( REAL *pts,
- int uorder, int ustride,
- int vorder, int vstride,
- REAL *sp, int outustride, int outvstride )
-{
- xformMat( bmat, pts, uorder, ustride, vorder, vstride, sp, outustride, outvstride );
-}
-
-void
-Mapdesc::xformMat(
- Maxmatrix mat,
- REAL * pts,
- int order,
- int stride,
- REAL * cp,
- int outstride )
-{
- if( isrational ) {
- REAL *pend = pts + order * stride;
- for( REAL *p = pts ; p != pend; p += stride ) {
- xformRational( mat, cp, p );
- cp += outstride;
- }
- } else {
- REAL *pend = pts + order * stride;
- for( REAL *p = pts ; p != pend; p += stride ) {
- xformNonrational( mat, cp, p );
- cp += outstride;
- }
- }
-}
-
-void
-Mapdesc::xformMat( Maxmatrix mat, REAL *pts,
- int uorder, int ustride,
- int vorder, int vstride,
- REAL *cp, int outustride, int outvstride )
-{
- if( isrational ) {
- REAL *pend = pts + uorder * ustride;
- for( REAL *p = pts ; p != pend; p += ustride ) {
- REAL *cpts2 = cp;
- REAL *qend = p + vorder * vstride;
- for( REAL *q = p; q != qend; q += vstride ) {
- xformRational( mat, cpts2, q );
- cpts2 += outvstride;
- }
- cp += outustride;
- }
- } else {
- REAL *pend = pts + uorder * ustride;
- for( REAL *p = pts ; p != pend; p += ustride ) {
- REAL *cpts2 = cp;
- REAL *qend = p + vorder * vstride;
- for( REAL *q = p; q != qend; q += vstride ) {
- xformNonrational( mat, cpts2, q );
- cpts2 += outvstride;
- }
- cp += outustride;
- }
- }
-}
-
-/*--------------------------------------------------------------------------
- * subdivide - subdivide a curve along an isoparametric line
- *--------------------------------------------------------------------------
- */
-
-void
-Mapdesc::subdivide( REAL *src, REAL *dst, REAL v, int stride, int order )
-{
- REAL mv = 1.0 - v;
-
- for( REAL *send=src+stride*order; src!=send; send-=stride, dst+=stride ) {
- copyPt( dst, src );
- REAL *qpnt = src + stride;
- for( REAL *qp=src; qpnt!=send; qp=qpnt, qpnt+=stride )
- sumPt( qp, qp, qpnt, mv, v );
- }
-}
-
-/*--------------------------------------------------------------------------
- * subdivide - subdivide a patch along an isoparametric line
- *--------------------------------------------------------------------------
- */
-
-void
-Mapdesc::subdivide( REAL *src, REAL *dst, REAL v,
- int so, int ss, int to, int ts )
-{
- REAL mv = 1.0 - v;
-
- for( REAL *slast = src+ss*so; src != slast; src += ss, dst += ss ) {
- REAL *sp = src;
- REAL *dp = dst;
- for( REAL *send = src+ts*to; sp != send; send -= ts, dp += ts ) {
- copyPt( dp, sp );
- REAL *qp = sp;
- for( REAL *qpnt = sp+ts; qpnt != send; qp = qpnt, qpnt += ts )
- sumPt( qp, qp, qpnt, mv, v );
- }
- }
-}
-
-
-#define sign(x) ((x > 0) ? 1 : ((x < 0.0) ? -1 : 0))
-
-/*--------------------------------------------------------------------------
- * project - project a set of homogeneous coordinates into inhomogeneous ones
- *--------------------------------------------------------------------------
- */
-int
-Mapdesc::project( REAL *src, int rstride, int cstride,
- REAL *dest, int trstride, int tcstride,
- int nrows, int ncols )
-{
- int s = sign( src[inhcoords] );
- REAL *rlast = src + nrows * rstride;
- REAL *trptr = dest;
- for( REAL *rptr=src; rptr != rlast; rptr+=rstride, trptr+=trstride ) {
- REAL *clast = rptr + ncols * cstride;
- REAL *tcptr = trptr;
- for( REAL *cptr = rptr; cptr != clast; cptr+=cstride, tcptr+=tcstride ) {
- REAL *coordlast = cptr + inhcoords;
- if( sign( *coordlast ) != s ) return 0;
- REAL *tcoord = tcptr;
- for( REAL *coord = cptr; coord != coordlast; coord++, tcoord++ ) {
- *tcoord = *coord / *coordlast;
- }
- }
- }
- return 1;
-}
-
-/*--------------------------------------------------------------------------
- * project - project a set of homogeneous coordinates into inhomogeneous ones
- *--------------------------------------------------------------------------
- */
-int
-Mapdesc::project( REAL *src, int stride, REAL *dest, int tstride, int ncols )
-{
- int s = sign( src[inhcoords] );
-
- REAL *clast = src + ncols * stride;
- for( REAL *cptr = src, *tcptr = dest; cptr != clast; cptr+=stride, tcptr+=tstride ) {
- REAL *coordlast = cptr + inhcoords;
- if( sign( *coordlast ) != s ) return 0;
- for( REAL *coord = cptr, *tcoord = tcptr; coord != coordlast; coord++, tcoord++ )
- *tcoord = *coord / *coordlast;
- }
-
- return 1;
-}
-
-int
-Mapdesc::bboxTooBig(
- REAL *p,
- int rstride,
- int cstride,
- int nrows,
- int ncols,
- REAL bb[2][MAXCOORDS] )
-{
- REAL bbpts[MAXORDER][MAXORDER][MAXCOORDS];
- const int trstride = sizeof(bbpts[0]) / sizeof(REAL);
- const int tcstride = sizeof(bbpts[0][0]) / sizeof(REAL);
-
- // points have been transformed, therefore they are homogeneous
- // project points
- int val = project( p, rstride, cstride,
- &bbpts[0][0][0], trstride, tcstride, nrows, ncols );
- if( val == 0 ) return -1;
-
- // compute bounding box
- bbox( bb, &bbpts[0][0][0], trstride, tcstride, nrows, ncols );
-
- // find out if bounding box can't fit in unit cube
- if( bbox_subdividing == N_BBOXROUND ) {
- for( int k=0; k != inhcoords; k++ )
- if( ceilf(bb[1][k]) - floorf(bb[0][k]) > bboxsize[k] ) return 1;
- } else {
- for( int k=0; k != inhcoords; k++ )
- if( bb[1][k] - bb[0][k] > bboxsize[k] ) return 1;
- }
- return 0;
-}
-
-void
-Mapdesc::bbox(
- REAL bb[2][MAXCOORDS],
- REAL *p,
- int rstride,
- int cstride,
- int nrows,
- int ncols )
-{
- int k;
- for( k=0; k != inhcoords; k++ )
- bb[0][k] = bb[1][k] = p[k];
-
- for( int i=0; i != nrows; i++ )
- for( int j=0; j != ncols; j++ )
- for( k=0; k != inhcoords; k++ ) {
- REAL x = p[i*rstride + j*cstride + k];
- if( x < bb[0][k] ) bb[0][k] = x;
- else if( x > bb[1][k] ) bb[1][k] = x;
- }
-}
-
-/*--------------------------------------------------------------------------
- * calcVelocityRational - calculate upper bound on first partial derivative
- * of a homogeneous set of points and bounds on each row of points.
- *--------------------------------------------------------------------------
- */
-REAL
-Mapdesc::calcVelocityRational( REAL *p, int stride, int ncols )
-{
- REAL tmp[MAXORDER][MAXCOORDS];
-
- assert( ncols <= MAXORDER );
-
- const int tstride = sizeof(tmp[0]) / sizeof(REAL);
-
- if( project( p, stride, &tmp[0][0], tstride, ncols ) ) {
- return calcPartialVelocity( &tmp[0][0], tstride, ncols, 1, 1.0 );
- } else { /* XXX */
- return calcPartialVelocity( &tmp[0][0], tstride, ncols, 1, 1.0 );
- }
-}
-
-/*--------------------------------------------------------------------------
- * calcVelocityNonrational - calculate upper bound on first partial
- * derivative of a inhomogeneous set of points.
- *--------------------------------------------------------------------------
- */
-REAL
-Mapdesc::calcVelocityNonrational( REAL *pts, int stride, int ncols )
-{
- return calcPartialVelocity( pts, stride, ncols, 1, 1.0 );
-}
-
-int
-Mapdesc::isProperty( long property )
-{
- switch ( property ) {
- case N_PIXEL_TOLERANCE:
- case N_ERROR_TOLERANCE:
- case N_CULLING:
- case N_BBOX_SUBDIVIDING:
- case N_S_STEPS:
- case N_T_STEPS:
- case N_SAMPLINGMETHOD:
- case N_CLAMPFACTOR:
- case N_MINSAVINGS:
- return 1;
- default:
- return 0;
- }
-}
-
-REAL
-Mapdesc::getProperty( long property )
-{
- switch ( property ) {
- case N_PIXEL_TOLERANCE:
- return pixel_tolerance;
- case N_ERROR_TOLERANCE:
- return error_tolerance;
- case N_CULLING:
- return culling_method;
- case N_BBOX_SUBDIVIDING:
- return bbox_subdividing;
- case N_S_STEPS:
- return s_steps;
- case N_T_STEPS:
- return t_steps;
- case N_SAMPLINGMETHOD:
- return sampling_method;
- case N_CLAMPFACTOR:
- return clampfactor;
- case N_MINSAVINGS:
- return minsavings;
- default:
- abort();
- return -1; //not necessary, needed to shut up compiler
- }
-}
-
-void
-Mapdesc::setProperty( long property, REAL value )
-{
-
- switch ( property ) {
- case N_PIXEL_TOLERANCE:
- pixel_tolerance = value;
- break;
- case N_ERROR_TOLERANCE:
- error_tolerance = value;
- break;
- case N_CULLING:
- culling_method = value;
- break;
- case N_BBOX_SUBDIVIDING:
- if( value <= 0.0 ) value = N_NOBBOXSUBDIVISION;
- bbox_subdividing = value;
- break;
- case N_S_STEPS:
- if( value < 0.0 ) value = 0.0;
- s_steps = value;
- maxrate = ( value < 0.0 ) ? 0.0 : value;
- maxsrate = ( value < 0.0 ) ? 0.0 : value;
- break;
- case N_T_STEPS:
- if( value < 0.0 ) value = 0.0;
- t_steps = value;
- maxtrate = ( value < 0.0 ) ? 0.0 : value;
- break;
- case N_SAMPLINGMETHOD:
- sampling_method = value;
- break;
- case N_CLAMPFACTOR:
- if( value <= 0.0 ) value = N_NOCLAMPING;
- clampfactor = value;
- break;
- case N_MINSAVINGS:
- if( value <= 0.0 ) value = N_NOSAVINGSSUBDIVISION;
- minsavings = value;
- break;
- default:
- abort();
- break;
- }
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdesc.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdesc.h
deleted file mode 100755
index 09251f17d..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdesc.h
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * mapdesc.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/mapdesc.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glumapdesc_h_
-#define __glumapdesc_h_
-
-#include "mystdio.h"
-#include "types.h"
-#include "defines.h"
-#include "bufpool.h"
-#include "nurbsconsts.h"
-
-typedef REAL Maxmatrix[MAXCOORDS][MAXCOORDS];
-
-class Backend;
-
-class Mapdesc : public PooledObj {
- friend class Maplist;
-
-public:
- Mapdesc( long, int, int, Backend & );
- int isProperty( long );
- REAL getProperty( long );
- void setProperty( long, REAL );
- int isConstantSampling( void );
- int isDomainSampling( void );
- int isRangeSampling( void );
- int isSampling( void );
- int isParametricDistanceSampling( void );
- int isObjectSpaceParaSampling( void );
- int isObjectSpacePathSampling( void );
- int isSurfaceAreaSampling( void );
- int isPathLengthSampling( void );
- int isCulling( void );
- int isBboxSubdividing( void );
- long getType( void );
-
- /* curve routines */
- void subdivide( REAL *, REAL *, REAL, int, int );
- int cullCheck( REAL *, int, int );
- void xformBounding( REAL *, int, int, REAL *, int );
- void xformCulling( REAL *, int, int, REAL *, int );
- void xformSampling( REAL *, int, int, REAL *, int );
- void xformMat( Maxmatrix, REAL *, int, int, REAL *, int );
- REAL calcPartialVelocity ( REAL *, int, int, int, REAL );
- int project( REAL *, int, REAL *, int, int );
- REAL calcVelocityRational( REAL *, int, int );
- REAL calcVelocityNonrational( REAL *, int, int );
-
- /* surface routines */
- void subdivide( REAL *, REAL *, REAL, int, int, int, int );
- int cullCheck( REAL *, int, int, int, int );
- void xformBounding( REAL *, int, int, int, int, REAL *, int, int );
- void xformCulling( REAL *, int, int, int, int, REAL *, int, int );
- void xformSampling( REAL *, int, int, int, int, REAL *, int, int );
- void xformMat( Maxmatrix, REAL *, int, int, int, int, REAL *, int, int );
- REAL calcPartialVelocity ( REAL *, REAL *, int, int, int, int, int, int, REAL, REAL, int );
- int project( REAL *, int, int, REAL *, int, int, int, int);
- void surfbbox( REAL bb[2][MAXCOORDS] );
-
- int bboxTooBig( REAL *, int, int, int, int, REAL [2][MAXCOORDS] );
- int xformAndCullCheck( REAL *, int, int, int, int );
-
- void identify( REAL[MAXCOORDS][MAXCOORDS] );
- void setBboxsize( INREAL *);
- inline void setBmat( INREAL*, long, long );
- inline void setCmat( INREAL*, long, long );
- inline void setSmat( INREAL*, long, long );
- inline int isRational( void );
- inline int getNcoords( void );
-
- REAL pixel_tolerance; /* pathlength sampling tolerance */
- REAL error_tolerance; /* parametric error sampling tolerance*/
- REAL object_space_error_tolerance; /* object space tess*/
- REAL clampfactor;
- REAL minsavings;
- REAL maxrate;
- REAL maxsrate;
- REAL maxtrate;
- REAL bboxsize[MAXCOORDS];
-
-private:
- long type;
- int isrational;
- int ncoords;
- int hcoords;
- int inhcoords;
- int mask;
- Maxmatrix bmat;
- Maxmatrix cmat;
- Maxmatrix smat;
- REAL s_steps; /* max samples in s direction */
- REAL t_steps; /* max samples in t direction */
- REAL sampling_method;
- REAL culling_method; /* check for culling */
- REAL bbox_subdividing;
- Mapdesc * next;
- Backend & backend;
-
- void bbox( REAL [2][MAXCOORDS], REAL *, int, int, int, int );
- REAL maxDifference( int, REAL *, int );
- static void copy( Maxmatrix, long, INREAL *, long, long );
-
- /* individual control point routines */
- static void transform4d( float[4], float[4], float[4][4] );
- static void multmatrix4d ( float[4][4], const float[4][4],
- const float[4][4] );
- void copyPt( REAL *, REAL * );
- void sumPt( REAL *, REAL *, REAL *, REAL, REAL );
- void xformSampling( REAL *, REAL * );
- void xformCulling( REAL *, REAL * );
- void xformRational( Maxmatrix, REAL *, REAL * );
- void xformNonrational( Maxmatrix, REAL *, REAL * );
- unsigned int clipbits( REAL * );
-};
-
-inline void
-Mapdesc::setBmat( INREAL *mat, long rstride, long cstride )
-{
- copy( bmat, hcoords, mat, rstride, cstride );
-}
-
-inline void
-Mapdesc::setCmat( INREAL *mat, long rstride, long cstride )
-{
- copy( cmat, hcoords, mat, rstride, cstride );
-}
-
-inline void
-Mapdesc::setSmat( INREAL *mat, long rstride, long cstride )
-{
- copy( smat, hcoords, mat, rstride, cstride );
-}
-
-inline long
-Mapdesc::getType( void )
-{
- return type;
-}
-
-inline void
-Mapdesc::xformCulling( REAL *d, REAL *s )
-{
- if( isrational )
- xformRational( cmat, d, s );
- else
- xformNonrational( cmat, d, s );
-}
-
-inline void
-Mapdesc::xformSampling( REAL *d, REAL *s )
-{
- if( isrational )
- xformRational( smat, d, s );
- else
- xformNonrational( smat, d, s );
-}
-
-inline int
-Mapdesc::isRational( void )
-{
- return isrational ? 1 : 0;
-}
-
-inline int
-Mapdesc::getNcoords( void )
-{
- return ncoords;
-}
-
-inline int
-Mapdesc::isConstantSampling( void )
-{
- return ((sampling_method == N_FIXEDRATE) ? 1 : 0);
-}
-
-inline int
-Mapdesc::isDomainSampling( void )
-{
- return ((sampling_method == N_DOMAINDISTANCE) ? 1 : 0);
-}
-
-inline int
-Mapdesc::isParametricDistanceSampling( void )
-{
- return ((sampling_method == N_PARAMETRICDISTANCE) ? 1 : 0);
-}
-
-inline int
-Mapdesc::isObjectSpaceParaSampling( void )
-{
- return ((sampling_method == N_OBJECTSPACE_PARA) ? 1 : 0);
-}
-
-inline int
-Mapdesc::isObjectSpacePathSampling( void )
-{
- return ((sampling_method == N_OBJECTSPACE_PATH) ? 1 : 0);
-}
-
-inline int
-Mapdesc::isSurfaceAreaSampling( void )
-{
- return ((sampling_method == N_SURFACEAREA) ? 1 : 0);
-}
-
-inline int
-Mapdesc::isPathLengthSampling( void )
-{
- return ((sampling_method == N_PATHLENGTH) ? 1 : 0);
-}
-
-inline int
-Mapdesc::isRangeSampling( void )
-{
- return ( isParametricDistanceSampling() || isPathLengthSampling() ||
- isSurfaceAreaSampling() ||
- isObjectSpaceParaSampling() ||
- isObjectSpacePathSampling());
-}
-
-inline int
-Mapdesc::isSampling( void )
-{
- return isRangeSampling() || isConstantSampling() || isDomainSampling();
-}
-
-inline int
-Mapdesc::isCulling( void )
-{
- return ((culling_method != N_NOCULLING) ? 1 : 0);
-}
-
-inline int
-Mapdesc::isBboxSubdividing( void )
-{
- return ((bbox_subdividing != N_NOBBOXSUBDIVISION) ? 1 : 0);
-}
-#endif /* __glumapdesc_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdescv.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdescv.cc
deleted file mode 100755
index 8b04ac13c..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdescv.cc
+++ /dev/null
@@ -1,243 +0,0 @@
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdescv.cc,v 1.3 2001/04/27 12:58:28 dawes Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * mapdescv.c++
- *
- * $Date: 2001/05/01 17:07:32 $ $Revision: 1.1.1.2 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/mapdescv.cc,v 1.1.1.2 2001/05/01 17:07:32 dawes Exp $
- */
-
-#include "glimports.h"
-#include "mystdio.h"
-#include "myassert.h"
-#include "mystring.h"
-#include "mymath.h"
-#include "nurbsconsts.h"
-#include "mapdesc.h"
-#include "gluint.h"
-
-/*--------------------------------------------------------------------------
- * calcPartialVelocity - calculate maximum magnitude of a given partial
- * derivative
- *--------------------------------------------------------------------------
- */
-REAL
-Mapdesc::calcPartialVelocity (
- REAL *p,
- int stride,
- int ncols,
- int partial,
- REAL range )
-{
- REAL tmp[MAXORDER][MAXCOORDS];
- REAL mag[MAXORDER];
-
- assert( ncols <= MAXORDER );
-
- int j, k, t;
- // copy inhomogeneous control points into temporary array
- for( j=0; j != ncols; j++ )
- for( k=0; k != inhcoords; k++ )
- tmp[j][k] = p[j*stride + k];
-
- for( t=0; t != partial; t++ )
- for( j=0; j != ncols-t-1; j++ )
- for( k=0; k != inhcoords; k++ )
- tmp[j][k] = tmp[j+1][k] - tmp[j][k];
-
- // compute magnitude and store in mag array
- for( j=0; j != ncols-partial; j++ ) {
- mag[j] = 0.0;
- for( k=0; k != inhcoords; k++ )
- mag[j] += tmp[j][k] * tmp[j][k];
- }
-
- // compute scale factor
- REAL fac = 1;
- REAL invt = 1.0 / range;
- for( t = ncols-1; t != ncols-1-partial; t-- )
- fac *= t * invt;
-
- // compute max magnitude of all entries in array
- REAL max = 0.0;
- for( j=0; j != ncols-partial; j++ )
- if( mag[j] > max ) max = mag[j];
- max = fac * ::SQRT( (float) max );
-
- return max;
-}
-
-/*--------------------------------------------------------------------------
- * calcPartialVelocity - calculate maximum magnitude of a given partial
- * derivative
- *--------------------------------------------------------------------------
- */
-REAL
-Mapdesc::calcPartialVelocity (
- REAL *dist,
- REAL *p,
- int rstride,
- int cstride,
- int nrows,
- int ncols,
- int spartial,
- int tpartial,
- REAL srange,
- REAL trange,
- int side )
-{
- REAL tmp[MAXORDER][MAXORDER][MAXCOORDS];
- REAL mag[MAXORDER][MAXORDER];
-
- assert( nrows <= MAXORDER );
- assert( ncols <= MAXORDER );
-
- REAL *tp = &tmp[0][0][0];
- REAL *mp = &mag[0][0];
- const int istride = sizeof( tmp[0]) / sizeof( tmp[0][0][0] );
- const int jstride = sizeof( tmp[0][0]) / sizeof( tmp[0][0][0] );
- const int kstride = sizeof( tmp[0][0][0]) / sizeof( tmp[0][0][0] );
- const int mistride = sizeof( mag[0]) / sizeof( mag[0][0] );
- const int mjstride = sizeof( mag[0][0]) / sizeof( mag[0][0] );
- const int idist = nrows * istride;
- const int jdist = ncols * jstride;
- const int kdist = inhcoords * kstride;
- const int id = idist - spartial * istride;
- const int jd = jdist - tpartial * jstride;
-
- {
- // copy control points
- REAL *ti = tp;
- REAL *qi = p;
- REAL *til = tp + idist;
- for( ; ti != til; ) {
- REAL *tj = ti;
- REAL *qj = qi;
- REAL *tjl = ti + jdist;
- for( ; tj != tjl; ) {
- for( int k=0; k != inhcoords; k++ ) {
- tj[k] = qj[k];
- }
- tj += jstride;
- qj += cstride;
- }
- ti += istride;
- qi += rstride;
- }
- }
-
- {
- // compute (s)-partial derivative control points
- REAL *til = tp + idist - istride;
- const REAL *till = til - ( spartial * istride );
- for( ; til != till; til -= istride )
- for( REAL *ti = tp; ti != til; ti += istride )
- for( REAL *tj = ti, *tjl = tj + jdist; tj != tjl; tj += jstride )
- for( int k=0; k != inhcoords; k++ )
- tj[k] = tj[k+istride] - tj[k];
- }
-
- {
- // compute (s,t)-partial derivative control points
- REAL *tjl = tp + jdist - jstride;
- const REAL *tjll = tjl - ( tpartial * jstride );
- for( ; tjl != tjll; tjl -= jstride )
- for( REAL *tj = tp; tj != tjl; tj += jstride )
- for( REAL *ti = tj, *til = ti + id; ti != til; ti += istride )
- for( int k=0; k != inhcoords; k++ )
- ti[k] = ti[k+jstride] - ti[k];
-
- }
-
- REAL max = 0.0;
- {
- // compute magnitude and store in mag array
- memset( (void *) mp, 0, sizeof( mag ) );
- for( REAL *ti = tp, *mi = mp, *til = tp + id; ti != til; ti += istride, mi += mistride )
- for( REAL *tj = ti, *mj = mi, *tjl = ti + jd; tj != tjl; tj += jstride, mj += mjstride ) {
- for( int k=0; k != inhcoords; k++ )
- *mj += tj[k] * tj[k];
- if( *mj > max ) max = *mj;
- }
-
- }
-
- int i, j;
-
- // compute scale factor
- REAL fac = 1.0;
- {
- REAL invs = 1.0 / srange;
- REAL invt = 1.0 / trange;
- for( int s = nrows-1, slast = s-spartial; s != slast; s-- )
- fac *= s * invs;
- for( int t = ncols-1, tlast = t-tpartial; t != tlast; t-- )
- fac *= t * invt;
- }
-
- if( side == 0 ) {
- // compute max magnitude of first and last column
- dist[0] = 0.0;
- dist[1] = 0.0;
- for( i=0; i != nrows-spartial; i++ ) {
- j = 0;
- if( mag[i][j] > dist[0] ) dist[0] = mag[i][j];
-
- j = ncols-tpartial-1;
- if( mag[i][j] > dist[1] ) dist[1] = mag[i][j];
- }
- dist[0] = fac * ::SQRT( dist[0] );
- dist[1] = fac * ::SQRT( dist[1] );
- } else if( side == 1 ) {
- // compute max magnitude of first and last row
- dist[0] = 0.0;
- dist[1] = 0.0;
- for( j=0; j != ncols-tpartial; j++ ) {
- i = 0;
- if( mag[i][j] > dist[0] ) dist[0] = mag[i][j];
-
- i = nrows-spartial-1;
- if( mag[i][j] > dist[1] ) dist[1] = mag[i][j];
- }
- dist[0] = fac * ::SQRT( dist[0] );
- dist[1] = fac * ::SQRT( dist[1] );
- }
-
- max = fac * ::SQRT( (float) max );
-
- return max;
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/maplist.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/maplist.cc
deleted file mode 100755
index 0eaf6cdd0..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/maplist.cc
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * maplist.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/maplist.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "mystdio.h"
-#include "myassert.h"
-#include "mymath.h"
-#include "nurbsconsts.h"
-#include "maplist.h"
-#include "mapdesc.h"
-#include "backend.h"
-
-Maplist::Maplist( Backend& b )
- : mapdescPool( sizeof( Mapdesc ), 10, "mapdesc pool" ),
- backend( b )
-{
- maps = 0; lastmap = &maps;
-}
-
-void
-Maplist::initialize( void )
-{
- freeMaps();
- define( N_P2D, 0, 2 );
- define( N_P2DR, 1, 3 );
-}
-
-void
-Maplist::add( long type, int israt, int ncoords )
-{
- *lastmap = new(mapdescPool) Mapdesc( type, israt, ncoords, backend );
- lastmap = &((*lastmap)->next);
-}
-
-void
-Maplist::define( long type, int israt, int ncoords )
-{
- Mapdesc *m = locate( type );
- assert( m == NULL || ( m->isrational == israt && m->ncoords == ncoords ) );
- add( type, israt, ncoords );
-}
-
-void
-Maplist::remove( Mapdesc *m )
-{
- for( Mapdesc **curmap = &maps; *curmap; curmap = &((*curmap)->next) ) {
- if( *curmap == m ) {
- *curmap = m->next;
- m->deleteMe( mapdescPool );
- return;
- }
- }
- abort();
-}
-
-void
-Maplist::freeMaps( void )
-{
- mapdescPool.clear();
- maps = 0;
- lastmap = &maps;
-}
-
-Mapdesc *
-Maplist::find( long type )
-{
- Mapdesc *val = locate( type );
- assert( val != 0 );
- return val;
-}
-
-Mapdesc *
-Maplist::locate( long type )
-{
- Mapdesc *m;
- for( m = maps; m; m = m->next )
- if( m->getType() == type ) break;
- return m;
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/maplist.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/maplist.h
deleted file mode 100755
index 0693fd40c..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/maplist.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * maplist.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/maplist.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glumaplist_h_
-#define __glumaplist_h_
-
-#include "types.h"
-#include "defines.h"
-#include "bufpool.h"
-
-class Backend;
-class Mapdesc;
-
-class Maplist {
-public:
- Maplist( Backend & );
- void define( long, int, int );
- inline void undefine( long );
- inline int isMap( long );
-
- void initialize( void );
- Mapdesc * find( long );
- Mapdesc * locate( long );
-
-private:
- Pool mapdescPool;
- Mapdesc * maps;
- Mapdesc ** lastmap;
- Backend & backend;
-
- void add( long, int, int );
- void remove( Mapdesc * );
- void freeMaps( void );
-};
-
-inline int
-Maplist::isMap( long type )
-{
- return (locate( type ) ? 1 : 0);
-}
-
-inline void
-Maplist::undefine( long type )
-{
- Mapdesc *m = locate( type );
- assert( m != 0 );
- remove( m );
-}
-#endif /* __glumaplist_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mesher.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mesher.cc
deleted file mode 100755
index a18e970fe..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mesher.cc
+++ /dev/null
@@ -1,488 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * mesher.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/mesher.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "myassert.h"
-#include "mystdio.h"
-#include "mesher.h"
-#include "gridvertex.h"
-#include "gridtrimvertex.h"
-#include "jarcloc.h"
-#include "gridline.h"
-#include "trimline.h"
-#include "uarray.h"
-#include "backend.h"
-
-
-const float Mesher::ZERO = 0.0;
-
-Mesher::Mesher( Backend& b )
- : backend( b ),
- p( sizeof( GridTrimVertex ), 100, "GridTrimVertexPool" )
-{
- stacksize = 0;
- vdata = 0;
- lastedge = 0; //needed to prevent purify UMR
-}
-
-Mesher::~Mesher( void )
-{
- if( vdata ) delete[] vdata;
-}
-
-void
-Mesher::init( unsigned int npts )
-{
- p.clear();
- if( stacksize < npts ) {
- stacksize = 2 * npts;
- if( vdata ) delete[] vdata;
- vdata = new GridTrimVertex_p[stacksize];
- }
-}
-
-inline void
-Mesher::push( GridTrimVertex *gt )
-{
- assert( itop+1 != stacksize );
- vdata[++itop] = gt;
-}
-
-inline void
-Mesher::pop( long )
-{
-}
-
-inline void
-Mesher::openMesh()
-{
- backend.bgntmesh( "addedge" );
-}
-
-inline void
-Mesher::closeMesh()
-{
- backend.endtmesh();
-}
-
-inline void
-Mesher::swapMesh()
-{
- backend.swaptmesh();
-}
-
-inline void
-Mesher::clearStack()
-{
- itop = -1;
- last[0] = 0;
-}
-
-void
-Mesher::finishLower( GridTrimVertex *gtlower )
-{
- for( push(gtlower);
- nextlower( gtlower=new(p) GridTrimVertex );
- push(gtlower) )
- addLower();
- addLast();
-}
-
-void
-Mesher::finishUpper( GridTrimVertex *gtupper )
-{
- for( push(gtupper);
- nextupper( gtupper=new(p) GridTrimVertex );
- push(gtupper) )
- addUpper();
- addLast();
-}
-
-void
-Mesher::mesh( void )
-{
- GridTrimVertex *gtlower, *gtupper;
-
- Hull::init( );
- nextupper( gtupper = new(p) GridTrimVertex );
- nextlower( gtlower = new(p) GridTrimVertex );
-
- clearStack();
- openMesh();
- push(gtupper);
-
- nextupper( gtupper = new(p) GridTrimVertex );
- nextlower( gtlower );
-
- assert( gtupper->t && gtlower->t );
-
- if( gtupper->t->param[0] < gtlower->t->param[0] ) {
- push(gtupper);
- lastedge = 1;
- if( nextupper( gtupper=new(p) GridTrimVertex ) == 0 ) {
- finishLower(gtlower);
- return;
- }
- } else if( gtupper->t->param[0] > gtlower->t->param[0] ) {
- push(gtlower);
- lastedge = 0;
- if( nextlower( gtlower=new(p) GridTrimVertex ) == 0 ) {
- finishUpper(gtupper);
- return;
- }
- } else {
- if( lastedge == 0 ) {
- push(gtupper);
- lastedge = 1;
- if( nextupper(gtupper=new(p) GridTrimVertex) == 0 ) {
- finishLower(gtlower);
- return;
- }
- } else {
- push(gtlower);
- lastedge = 0;
- if( nextlower( gtlower=new(p) GridTrimVertex ) == 0 ) {
- finishUpper(gtupper);
- return;
- }
- }
- }
-
- while ( 1 ) {
- if( gtupper->t->param[0] < gtlower->t->param[0] ) {
- push(gtupper);
- addUpper();
- if( nextupper( gtupper=new(p) GridTrimVertex ) == 0 ) {
- finishLower(gtlower);
- return;
- }
- } else if( gtupper->t->param[0] > gtlower->t->param[0] ) {
- push(gtlower);
- addLower();
- if( nextlower( gtlower=new(p) GridTrimVertex ) == 0 ) {
- finishUpper(gtupper);
- return;
- }
- } else {
- if( lastedge == 0 ) {
- push(gtupper);
- addUpper();
- if( nextupper( gtupper=new(p) GridTrimVertex ) == 0 ) {
- finishLower(gtlower);
- return;
- }
- } else {
- push(gtlower);
- addLower();
- if( nextlower( gtlower=new(p) GridTrimVertex ) == 0 ) {
- finishUpper(gtupper);
- return;
- }
- }
- }
- }
-}
-
-inline int
-Mesher::isCcw( int ilast )
-{
- REAL area = det3( vdata[ilast]->t, vdata[itop-1]->t, vdata[itop-2]->t );
- return (area < ZERO) ? 0 : 1;
-}
-
-inline int
-Mesher::isCw( int ilast )
-{
- REAL area = det3( vdata[ilast]->t, vdata[itop-1]->t, vdata[itop-2]->t );
- return (area > -ZERO) ? 0 : 1;
-}
-
-inline int
-Mesher::equal( int x, int y )
-{
- return( last[0] == vdata[x] && last[1] == vdata[y] );
-}
-
-inline void
-Mesher::copy( int x, int y )
-{
- last[0] = vdata[x]; last[1] = vdata[y];
-}
-
-inline void
-Mesher::move( int x, int y )
-{
- vdata[x] = vdata[y];
-}
-
-inline void
-Mesher::output( int x )
-{
- backend.tmeshvert( vdata[x] );
-}
-
-/*---------------------------------------------------------------------------
- * addedge - addedge an edge to the triangulation
- *
- * This code has been re-written to generate large triangle meshes
- * from a monotone polygon. Although smaller triangle meshes
- * could be generated faster and with less code, larger meshes
- * actually give better SYSTEM performance. This is because
- * vertices are processed in the backend slower than they are
- * generated by this code and any decrease in the number of vertices
- * results in a decrease in the time spent in the backend.
- *---------------------------------------------------------------------------
- */
-
-void
-Mesher::addLast( )
-{
- register int ilast = itop;
-
- if( lastedge == 0 ) {
- if( equal( 0, 1 ) ) {
- output( ilast );
- swapMesh();
- for( register int i = 2; i < ilast; i++ ) {
- swapMesh();
- output( i );
- }
- copy( ilast, ilast-1 );
- } else if( equal( ilast-2, ilast-1) ) {
- swapMesh();
- output( ilast );
- for( register int i = ilast-3; i >= 0; i-- ) {
- output( i );
- swapMesh();
- }
- copy( 0, ilast );
- } else {
- closeMesh(); openMesh();
- output( ilast );
- output( 0 );
- for( register int i = 1; i < ilast; i++ ) {
- swapMesh();
- output( i );
- }
- copy( ilast, ilast-1 );
- }
- } else {
- if( equal( 1, 0) ) {
- swapMesh();
- output( ilast );
- for( register int i = 2; i < ilast; i++ ) {
- output( i );
- swapMesh();
- }
- copy( ilast-1, ilast );
- } else if( equal( ilast-1, ilast-2) ) {
- output( ilast );
- swapMesh();
- for( register int i = ilast-3; i >= 0; i-- ) {
- swapMesh();
- output( i );
- }
- copy( ilast, 0 );
- } else {
- closeMesh(); openMesh();
- output( 0 );
- output( ilast );
- for( register int i = 1; i < ilast; i++ ) {
- output( i );
- swapMesh();
- }
- copy( ilast-1, ilast );
- }
- }
- closeMesh();
- //for( register long k=0; k<=ilast; k++ ) pop( k );
-}
-
-void
-Mesher::addUpper( )
-{
- register int ilast = itop;
-
- if( lastedge == 0 ) {
- if( equal( 0, 1 ) ) {
- output( ilast );
- swapMesh();
- for( register int i = 2; i < ilast; i++ ) {
- swapMesh();
- output( i );
- }
- copy( ilast, ilast-1 );
- } else if( equal( ilast-2, ilast-1) ) {
- swapMesh();
- output( ilast );
- for( register int i = ilast-3; i >= 0; i-- ) {
- output( i );
- swapMesh();
- }
- copy( 0, ilast );
- } else {
- closeMesh(); openMesh();
- output( ilast );
- output( 0 );
- for( register int i = 1; i < ilast; i++ ) {
- swapMesh();
- output( i );
- }
- copy( ilast, ilast-1 );
- }
- lastedge = 1;
- //for( register long k=0; k<ilast-1; k++ ) pop( k );
- move( 0, ilast-1 );
- move( 1, ilast );
- itop = 1;
- } else {
- if( ! isCcw( ilast ) ) return;
- do {
- itop--;
- } while( (itop > 1) && isCcw( ilast ) );
-
- if( equal( ilast-1, ilast-2 ) ) {
- output( ilast );
- swapMesh();
- for( register int i=ilast-3; i>=itop-1; i-- ) {
- swapMesh();
- output( i );
- }
- copy( ilast, itop-1 );
- } else if( equal( itop, itop-1 ) ) {
- swapMesh();
- output( ilast );
- for( register int i = itop+1; i < ilast; i++ ) {
- output( i );
- swapMesh();
- }
- copy( ilast-1, ilast );
- } else {
- closeMesh(); openMesh();
- output( ilast );
- output( ilast-1 );
- for( register int i=ilast-2; i>=itop-1; i-- ) {
- swapMesh();
- output( i );
- }
- copy( ilast, itop-1 );
- }
- //for( register int k=itop; k<ilast; k++ ) pop( k );
- move( itop, ilast );
- }
-}
-
-void
-Mesher::addLower()
-{
- register int ilast = itop;
-
- if( lastedge == 1 ) {
- if( equal( 1, 0) ) {
- swapMesh();
- output( ilast );
- for( register int i = 2; i < ilast; i++ ) {
- output( i );
- swapMesh();
- }
- copy( ilast-1, ilast );
- } else if( equal( ilast-1, ilast-2) ) {
- output( ilast );
- swapMesh();
- for( register int i = ilast-3; i >= 0; i-- ) {
- swapMesh();
- output( i );
- }
- copy( ilast, 0 );
- } else {
- closeMesh(); openMesh();
- output( 0 );
- output( ilast );
- for( register int i = 1; i < ilast; i++ ) {
- output( i );
- swapMesh();
- }
- copy( ilast-1, ilast );
- }
-
- lastedge = 0;
- //for( register long k=0; k<ilast-1; k++ ) pop( k );
- move( 0, ilast-1 );
- move( 1, ilast );
- itop = 1;
- } else {
- if( ! isCw( ilast ) ) return;
- do {
- itop--;
- } while( (itop > 1) && isCw( ilast ) );
-
- if( equal( ilast-2, ilast-1) ) {
- swapMesh();
- output( ilast );
- for( register int i=ilast-3; i>=itop-1; i--) {
- output( i );
- swapMesh( );
- }
- copy( itop-1, ilast );
- } else if( equal( itop-1, itop) ) {
- output( ilast );
- swapMesh();
- for( register int i=itop+1; i<ilast; i++ ) {
- swapMesh( );
- output( i );
- }
- copy( ilast, ilast-1 );
- } else {
- closeMesh(); openMesh();
- output( ilast-1 );
- output( ilast );
- for( register int i=ilast-2; i>=itop-1; i-- ) {
- output( i );
- swapMesh( );
- }
- copy( itop-1, ilast );
- }
- //for( register int k=itop; k<ilast; k++ ) pop( k );
- move( itop, ilast );
- }
-}
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mesher.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mesher.h
deleted file mode 100755
index 688e3d21f..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mesher.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * mesher.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/mesher.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glumesher_h_
-#define __glumesher_h_
-
-#include "hull.h"
-
-class TrimRegion;
-class Backend;
-class Pool;
-class GridTrimVertex;
-
-
-class Mesher : virtual public TrimRegion, public Hull {
-public:
- Mesher( Backend & );
- ~Mesher( void );
- void init( unsigned int );
- void mesh( void );
-
-private:
- static const float ZERO;
- Backend& backend;
-
- Pool p;
- unsigned int stacksize;
- GridTrimVertex ** vdata;
- GridTrimVertex * last[2];
- int itop;
- int lastedge;
-
- inline void openMesh( void );
- inline void swapMesh( void );
- inline void closeMesh( void );
- inline int isCcw( int );
- inline int isCw( int );
- inline void clearStack( void );
- inline void push( GridTrimVertex * );
- inline void pop( long );
- inline void move( int, int );
- inline int equal( int, int );
- inline void copy( int, int );
- inline void output( int );
- void addUpper( void );
- void addLower( void );
- void addLast( void );
- void finishUpper( GridTrimVertex * );
- void finishLower( GridTrimVertex * );
-};
-#endif /* __glumesher_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/monoTriangulationBackend.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/monoTriangulationBackend.cc
deleted file mode 100755
index 33c11d81e..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/monoTriangulationBackend.cc
+++ /dev/null
@@ -1,397 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/monoTriangulationBackend.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include "monoTriangulation.h"
-#include "polyUtil.h"
-#include "backend.h"
-#include "arc.h"
-
-void reflexChain::outputFan(Real v[2], Backend* backend)
-{
- Int i;
- TrimVertex trimVert;
- backend->bgntfan();
-
- /*
- trimVert.param[0]=v[0];
- trimVert.param[1]=v[1];
- backend->tmeshvert(&trimVert);
- */
- backend->tmeshvert(v[0], v[1]);
-
- if(isIncreasing) {
- for(i=0; i<index_queue; i++)
- {
- /*
- trimVert.param[0]=queue[i][0];
- trimVert.param[1]=queue[i][1];
- backend->tmeshvert(&trimVert);
- */
- backend->tmeshvert(queue[i][0], queue[i][1]);
- }
- }
- else {
- for(i=index_queue-1; i>=0; i--)
- {
- /*
- trimVert.param[0]=queue[i][0];
- trimVert.param[1]=queue[i][1];
- backend->tmeshvert(&trimVert);
- */
- backend->tmeshvert(queue[i][0], queue[i][1]);
- }
- }
- backend->endtfan();
-}
-
-void reflexChain::processNewVertex(Real v[2], Backend* backend)
-{
- Int i,j,k;
- Int isReflex;
- TrimVertex trimVert;
- /*if there are at most one vertex in the queue, then simply insert
- */
- if(index_queue <=1){
- insert(v);
- return;
- }
-
- /*there are at least two vertices in the queue*/
- j=index_queue-1;
-
- for(i=j; i>=1; i--) {
- if(isIncreasing) {
- isReflex = (area(queue[i-1], queue[i], v) <= 0.0);
- }
- else /*decreasing*/{
- isReflex = (area(v, queue[i], queue[i-1]) <= 0.0);
- }
- if(isReflex) {
- break;
- }
- }
-
- /*
- *if i<j then vertices: i+1--j are convex
- * output triangle fan:
- * v, and queue[i], i+1, ..., j
- */
- if(i<j)
- {
- backend->bgntfan();
- /*
- trimVert.param[0]=v[0];
- trimVert.param[1]=v[1];
- backend->tmeshvert(& trimVert);
- */
- backend->tmeshvert(v[0], v[1]);
-
- if(isIncreasing) {
- for(k=i; k<=j; k++)
- {
- /*
- trimVert.param[0]=queue[k][0];
- trimVert.param[1]=queue[k][1];
- backend->tmeshvert(& trimVert);
- */
- backend->tmeshvert(queue[k][0], queue[k][1]);
- }
- }
- else {
- for(k=j; k>=i; k--)
- {
- /*
- trimVert.param[0]=queue[k][0];
- trimVert.param[1]=queue[k][1];
- backend->tmeshvert(& trimVert);
- */
- backend->tmeshvert(queue[k][0], queue[k][1]);
- }
- }
-
- backend->endtfan();
- }
-
- /*delete vertices i+1--j from the queue*/
- index_queue = i+1;
- /*finally insert v at the end of the queue*/
- insert(v);
-
-}
-
-
-void monoTriangulationRec(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_current,
- vertexArray* dec_chain, Int dec_current,
- Backend* backend)
-{
- assert( inc_chain != NULL && dec_chain != NULL);
- assert( ! (inc_current>=inc_chain->getNumElements() &&
- dec_current>=dec_chain->getNumElements()));
- Int inc_nVertices;
- Int dec_nVertices;
- Real** inc_array ;
- Real** dec_array ;
- Int i;
- assert( ! ( (inc_chain==NULL) && (dec_chain==NULL)));
-
- if(inc_current>=inc_chain->getNumElements()) /*no more vertices on inc_chain*/
- {
-
- dec_array = dec_chain->getArray();
- dec_nVertices = dec_chain->getNumElements();
- reflexChain rChain(20,0);
- /*put the top vertex into the reflex chain*/
- rChain.processNewVertex(topVertex, backend);
- /*process all the vertices on the dec_chain*/
- for(i=dec_current; i<dec_nVertices; i++){
- rChain.processNewVertex(dec_array[i], backend);
- }
- /*process the bottom vertex*/
- rChain.processNewVertex(botVertex, backend);
-
- }
- else if(dec_current>= dec_chain->getNumElements()) /*no more vertices on dec_chain*/
- {
- inc_array = inc_chain->getArray();
- inc_nVertices= inc_chain->getNumElements();
- reflexChain rChain(20,1);
- /*put the top vertex into the reflex chain*/
- rChain.processNewVertex(topVertex, backend);
- /*process all the vertices on the inc_chain*/
- for(i=inc_current; i<inc_nVertices; i++){
- rChain.processNewVertex(inc_array[i], backend);
- }
- /*process the bottom vertex*/
- rChain.processNewVertex(botVertex, backend);
- }
- else /*neither chain is empty*/
- {
- inc_array = inc_chain -> getArray();
- dec_array = dec_chain -> getArray();
- inc_nVertices= inc_chain->getNumElements();
- dec_nVertices= dec_chain->getNumElements();
- /*if top of inc_chain is 'lower' than top of dec_chain, process all the
- *vertices on the dec_chain which are higher than top of inc_chain
- */
- if(compV2InY(inc_array[inc_current], dec_array[dec_current]) <= 0)
- {
-
- reflexChain rChain(20, 0);
- rChain.processNewVertex(topVertex, backend);
- for(i=dec_current; i<dec_nVertices; i++)
- {
- if(compV2InY(inc_array[inc_current], dec_array[i]) <= 0)
- rChain.processNewVertex(dec_array[i], backend);
- else
- break;
- }
- rChain.outputFan(inc_array[inc_current], backend);
- monoTriangulationRec(dec_array[i-1], botVertex,
- inc_chain, inc_current,
- dec_chain, i,
- backend);
- }
- else /*compV2InY(inc_array[inc_current], dec_array[dec_current]) > 0*/
- {
-
- reflexChain rChain(20, 1);
- rChain.processNewVertex(topVertex, backend);
- for(i=inc_current; i<inc_nVertices; i++)
- {
- if(compV2InY(inc_array[i], dec_array[dec_current]) >0)
- rChain.processNewVertex(inc_array[i], backend);
- else
- break;
- }
- rChain.outputFan(dec_array[dec_current], backend);
- monoTriangulationRec(inc_array[i-1], botVertex,
- inc_chain, i,
- dec_chain, dec_current,
- backend);
- }
- }/*end case neither is empty*/
-}
-
-
-void monoTriangulationFunBackend(Arc_ptr loop, Int (*compFun)(Real*, Real*), Backend* backend)
-{
- Int i;
- /*find the top vertex, bottom vertex, inccreasing chain, and decreasing chain,
- *then call monoTriangulationRec
- */
- Arc_ptr tempV;
- Arc_ptr topV;
- Arc_ptr botV;
- topV = botV = loop;
- for(tempV = loop->next; tempV != loop; tempV = tempV->next)
- {
- if(compFun(topV->tail(), tempV->tail())<0) {
- topV = tempV;
- }
- if(compFun(botV->tail(), tempV->tail())>0) {
- botV = tempV;
- }
- }
-
- /*creat increase and decrease chains*/
- vertexArray inc_chain(20); /*this is a dynamic array*/
- for(i=1; i<=topV->pwlArc->npts-2; i++) { /*the first vertex is the top vertex which doesn't belong to inc_chain*/
- inc_chain.appendVertex(topV->pwlArc->pts[i].param);
- }
- for(tempV = topV->next; tempV != botV; tempV = tempV->next)
- {
- for(i=0; i<=tempV->pwlArc->npts-2; i++){
- inc_chain.appendVertex(tempV->pwlArc->pts[i].param);
- }
- }
-
- vertexArray dec_chain(20);
- for(tempV = topV->prev; tempV != botV; tempV = tempV->prev)
- {
- for(i=tempV->pwlArc->npts-2; i>=0; i--){
- dec_chain.appendVertex(tempV->pwlArc->pts[i].param);
- }
- }
- for(i=botV->pwlArc->npts-2; i>=1; i--){
- dec_chain.appendVertex(tempV->pwlArc->pts[i].param);
- }
-
- monoTriangulationRecFunBackend(topV->tail(), botV->tail(), &inc_chain, 0, &dec_chain, 0, compFun, backend);
-
-}
-
-/*if compFun == compV2InY, top to bottom: V-monotone
- *if compFun == compV2InX, right to left: U-monotone
- */
-void monoTriangulationRecFunBackend(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_current,
- vertexArray* dec_chain, Int dec_current,
- Int (*compFun)(Real*, Real*),
- Backend* backend)
-{
- assert( inc_chain != NULL && dec_chain != NULL);
- assert( ! (inc_current>=inc_chain->getNumElements() &&
- dec_current>=dec_chain->getNumElements()));
- Int inc_nVertices;
- Int dec_nVertices;
- Real** inc_array ;
- Real** dec_array ;
- Int i;
- assert( ! ( (inc_chain==NULL) && (dec_chain==NULL)));
-
- if(inc_current>=inc_chain->getNumElements()) /*no more vertices on inc_chain*/
- {
-
- dec_array = dec_chain->getArray();
- dec_nVertices = dec_chain->getNumElements();
- reflexChain rChain(20,0);
- /*put the top vertex into the reflex chain*/
- rChain.processNewVertex(topVertex, backend);
- /*process all the vertices on the dec_chain*/
- for(i=dec_current; i<dec_nVertices; i++){
- rChain.processNewVertex(dec_array[i], backend);
- }
- /*process the bottom vertex*/
- rChain.processNewVertex(botVertex, backend);
-
- }
- else if(dec_current>= dec_chain->getNumElements()) /*no more vertices on dec_chain*/
- {
- inc_array = inc_chain->getArray();
- inc_nVertices= inc_chain->getNumElements();
- reflexChain rChain(20,1);
- /*put the top vertex into the reflex chain*/
- rChain.processNewVertex(topVertex, backend);
- /*process all the vertices on the inc_chain*/
- for(i=inc_current; i<inc_nVertices; i++){
- rChain.processNewVertex(inc_array[i], backend);
- }
- /*process the bottom vertex*/
- rChain.processNewVertex(botVertex, backend);
- }
- else /*neither chain is empty*/
- {
- inc_array = inc_chain -> getArray();
- dec_array = dec_chain -> getArray();
- inc_nVertices= inc_chain->getNumElements();
- dec_nVertices= dec_chain->getNumElements();
- /*if top of inc_chain is 'lower' than top of dec_chain, process all the
- *vertices on the dec_chain which are higher than top of inc_chain
- */
- if(compFun(inc_array[inc_current], dec_array[dec_current]) <= 0)
- {
-
- reflexChain rChain(20, 0);
- rChain.processNewVertex(topVertex, backend);
- for(i=dec_current; i<dec_nVertices; i++)
- {
- if(compFun(inc_array[inc_current], dec_array[i]) <= 0)
- rChain.processNewVertex(dec_array[i], backend);
- else
- break;
- }
- rChain.outputFan(inc_array[inc_current], backend);
- monoTriangulationRecFunBackend(dec_array[i-1], botVertex,
- inc_chain, inc_current,
- dec_chain, i,
- compFun,
- backend);
- }
- else /*compFun(inc_array[inc_current], dec_array[dec_current]) > 0*/
- {
-
- reflexChain rChain(20, 1);
- rChain.processNewVertex(topVertex, backend);
- for(i=inc_current; i<inc_nVertices; i++)
- {
- if(compFun(inc_array[i], dec_array[dec_current]) >0)
- rChain.processNewVertex(inc_array[i], backend);
- else
- break;
- }
- rChain.outputFan(dec_array[dec_current], backend);
- monoTriangulationRecFunBackend(inc_array[i-1], botVertex,
- inc_chain, i,
- dec_chain, dec_current,
- compFun,
- backend);
- }
- }/*end case neither is empty*/
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/monotonizer.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/monotonizer.cc
deleted file mode 100755
index 59f98866b..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/monotonizer.cc
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * monotonizer.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/monotonizer.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "mystdio.h"
-#include "myassert.h"
-#include "arc.h"
-#include "arctess.h"
-#include "bezierarc.h"
-#include "bin.h"
-#include "mapdesc.h"
-#include "nurbsconsts.h"
-#include "subdivider.h"
-
-/*-----------------------------------------------------------------------------
- * Subdivider::decompose - break all curves into monotone arcs
- *-----------------------------------------------------------------------------
- */
-int
-Subdivider::decompose( Bin& bin, REAL geo_stepsize )
-{
- Arc_ptr jarc;
- for( jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) {
- if( ! jarc->isTessellated() ) {
- /* points have not been transformed, therefore they may be either
- homogeneous or inhomogeneous */
- tessellate( jarc, geo_stepsize );
- if( jarc->isDisconnected() || jarc->next->isDisconnected() )
- return 1;
- }
- }
-
- for( jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) {
- monotonize( jarc, bin );
- }
-
-#ifndef NDEBUG
- for( jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) {
- assert( isMonotone( jarc ) != 0 );
- }
-#endif
-
- return 0;
-}
-
-void
-Subdivider::tessellate( Arc_ptr jarc, REAL geo_stepsize )
-{
- BezierArc *b = jarc->bezierArc;
- Mapdesc *mapdesc = b->mapdesc;
-
- if( mapdesc->isRational() ) {
- REAL max = mapdesc->calcVelocityRational( b->cpts, b->stride, b->order );
- REAL arc_stepsize = (max > 1.0) ? (1.0/max) : 1.0;
- if( jarc->bezierArc->order != 2 )
- arctessellator.tessellateNonlinear( jarc, geo_stepsize, arc_stepsize, 1 );
- else {
- arctessellator.tessellateLinear( jarc, geo_stepsize, arc_stepsize, 1 );
- }
- } else {
- REAL max = mapdesc->calcVelocityNonrational( b->cpts, b->stride, b->order );
- REAL arc_stepsize = (max > 1.0) ? (1.0/max) : 1.0;
- if( jarc->bezierArc->order != 2 )
- arctessellator.tessellateNonlinear( jarc, geo_stepsize, arc_stepsize, 0 );
- else {
- arctessellator.tessellateLinear( jarc, geo_stepsize, arc_stepsize, 0 );
- }
- }
-}
-
-/*-------------------------------------------------------------------------
- * Subdivider::monotonize - break up a jordan arc into s,t-monotone
- * components. This code will remove degenerate segments, including
- * arcs of only a single point.
- *-------------------------------------------------------------------------
- */
-void
-Subdivider::monotonize( Arc_ptr jarc, Bin& bin )
-{
- TrimVertex *firstvert = jarc->pwlArc->pts;
- TrimVertex *lastvert = firstvert + (jarc->pwlArc->npts - 1);
- long uid = jarc->nuid;
- arc_side side = jarc->getside();
- dir sdir = none;
- dir tdir = none;
- int degenerate = 1;
-
- int nudegenerate;
- int change;
-
- TrimVertex *vert;
- for( vert = firstvert; vert != lastvert; vert++ ) {
-
- nudegenerate = 1;
- change = 0;
-
- /* check change relative to s axis, clear degenerate bit if needed */
- REAL sdiff = vert[1].param[0] - vert[0].param[0];
- if( sdiff == 0 ) {
- if( sdir != same ) {
- sdir = same;
- change = 1;
- }
- } else if( sdiff < 0.0 ) {
- if( sdir != down ) {
- sdir = down;
- change = 1;
- }
- nudegenerate = 0;
- } else {
- if( sdir != up ) {
- sdir = up;
- change = 1;
- }
- nudegenerate = 0;
- }
-
- /* check change relative to t axis, clear degenerate bit if needed */
- REAL tdiff = vert[1].param[1] - vert[0].param[1];
- if( tdiff == 0 ) {
- if( tdir != same ) {
- tdir = same;
- change = 1;
- }
- } else if( tdiff < 0.0 ) {
- if( tdir != down ) {
- tdir = down;
- change = 1;
- }
- nudegenerate = 0;
- } else {
- if( tdir != up ) {
- tdir = up;
- change = 1;
- }
- nudegenerate = 0;
- }
-
- if( change ) {
- if( ! degenerate ) {
- /* make last segment into separate pwl curve */
- jarc->pwlArc->npts = vert - firstvert + 1;
- jarc = (new(arcpool) Arc( side, uid ))->append( jarc );
- jarc->pwlArc = new(pwlarcpool) PwlArc();
- bin.addarc( jarc );
- }
- firstvert = jarc->pwlArc->pts = vert;
- degenerate = nudegenerate;
- }
- }
- jarc->pwlArc->npts = vert - firstvert + 1;
-
- if( degenerate ) {
- /* remove jarc from circularly linked list */
- jarc->prev->next = jarc->next;
- jarc->next->prev = jarc->prev;
-
- assert( jarc->prev->check( ) != 0 );
- assert( jarc->next->check( ) != 0 );
-
- /* remove jarc from bin */
- bin.remove_this_arc( jarc );
-
- jarc->pwlArc->deleteMe( pwlarcpool ); jarc->pwlArc = 0;
- jarc->deleteMe( arcpool );
- }
-}
-
-/*-------------------------------------------------------------------------
- * Subdivider::isMonotone - return true if arc is monotone AND non-degenerate
- *-------------------------------------------------------------------------
- */
-int
-Subdivider::isMonotone( Arc_ptr jarc )
-{
- TrimVertex *firstvert = jarc->pwlArc->pts;
- TrimVertex *lastvert = firstvert + (jarc->pwlArc->npts - 1);
-
- if( firstvert == lastvert ) return 1;
-
- TrimVertex *vert = firstvert;
- enum dir sdir;
- enum dir tdir;
-
- REAL diff = vert[1].param[0] - vert[0].param[0];
- if( diff == 0.0 )
- sdir = same;
- else if( diff < 0.0 )
- sdir = down;
- else
- sdir = up;
-
- diff = vert[1].param[1] - vert[0].param[1];
- if( diff == 0.0 )
- tdir = same;
- else if( diff < 0.0 )
- tdir = down;
- else
- tdir = up;
-
- if( (sdir == same) && (tdir == same) ) return 0;
-
- for( ++vert ; vert != lastvert; vert++ ) {
- diff = vert[1].param[0] - vert[0].param[0];
- if( diff == 0.0 ) {
- if( sdir != same ) return 0;
- } else if( diff < 0.0 ) {
- if( sdir != down ) return 0;
- } else {
- if( sdir != up ) return 0;
- }
-
- diff = vert[1].param[1] - vert[0].param[1];
- if( diff == 0.0 ) {
- if( tdir != same ) return 0;
- } else if( diff < 0.0 ) {
- if( tdir != down ) return 0;
- } else {
- if( tdir != up ) return 0;
- }
- }
- return 1;
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/monotonizer.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/monotonizer.h
deleted file mode 100644
index 4a91f072c..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/monotonizer.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/**************************************************************************
- * *
- * Copyright (C) 1999, Silicon Graphics, Inc. *
- * *
- * These coded instructions, statements, and computer programs contain *
- * unpublished proprietary information of Silicon Graphics, Inc., and *
- * are protected by Federal copyright law. They may not be disclosed *
- * to third parties or copied or duplicated in any form, in whole or *
- * in part, without the prior written consent of Silicon Graphics, Inc. *
- * *
- **************************************************************************/
-
-/*
- * monotonizer.h
- *
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/monotonizer.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glumonotonizer_h_
-#define __glumonotonizer_h_
-
-#include "mysetjmp.h"
-#include "types.h"
-
-class Arc;
-class ArcTessellator;
-class Pool;
-class Bin;
-class PwlArcPool;
-class Mapdesc;
-
-class Monotonizer {
- ArcTessellator& arctessellator;
- Pool& arcpool;
- Pool& pwlarcpool;
- jmp_buf& nurbsJmpBuf;
-
- enum dir { down, same, up, none };
- void tessellate( Arc *, REAL );
- void monotonize( Arc *, Bin & );
- int isMonotone( Arc * );
-public:
- Monotonizer( ArcTessellator& at, Pool& ap, Pool& p, jmp_buf& j )
- : arctessellator(at), arcpool(ap), pwlarcpool(p), nurbsJmpBuf(j) {}
- int decompose( Bin &, REAL );
-};
-#endif /* __glumonotonizer_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/myassert.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/myassert.h
deleted file mode 100755
index 3ee813fb1..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/myassert.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * myassert.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/myassert.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glumyassert_h_
-#define __glumyassert_h_
-
-#ifdef STANDALONE
-#define assert(EX) ((void)0)
-#endif
-
-#ifdef LIBRARYBUILD
-#include <assert.h>
-#endif
-
-#ifdef GLBUILD
-#define assert(EX) ((void)0)
-#endif
-
-#endif /* __glumyassert_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mycode.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mycode.cc
deleted file mode 100755
index 9f2e96cd7..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mycode.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/mycode.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include "mymath.h"
-
-#ifdef NEEDCEILF
-
-float ceilf( float x )
-{
- if( x < 0 ) {
- float nx = -x;
- int ix = (int) nx;
- return (float) -ix;
- } else {
- int ix = (int) x;
- if( x == (float) ix ) return x;
- return (float) (ix+1);
- }
-}
-
-float floorf( float x )
-{
- if( x < 0 ) {
- float nx = -x;
- int ix = (int) nx;
- if( nx == (float) ix ) return x;
- return (float) -(ix+1);
- } else {
- int ix = (int) x;
- return (float) ix;
- }
-}
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mymath.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mymath.h
deleted file mode 100755
index 222a1f9d5..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mymath.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * mymath.h
- *
- * Date Revision
- * Header: //depot/main/gfx/lib/glu/libnurbs/internals/mymath.h#4
- */
-
-
-
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mymath.h,v 1.3 2002/05/31 16:36:49 dawes Exp $ */
-
-#ifndef __glumymath_h_
-#define __glumymath_h_
-
-#ifdef GLBUILD
-#define sqrtf gl_fsqrt
-#endif
-
-#ifdef __UNIXOS2__
-#define sqrtf sqrt
-#endif
-
-#if GLBUILD | STANDALONE
-#define M_SQRT2 1.41421356237309504880
-#define ceilf myceilf
-#define floorf myfloorf
-#define sqrtf sqrt
-extern "C" double sqrt(double);
-extern "C" float ceilf(float);
-extern "C" float floorf(float);
-#ifndef NEEDCEILF
-#define NEEDCEILF
-#endif
-#elif defined(NEEDCEILF)
-extern "C" float ceilf(float);
-extern "C" float floorf(float);
-#endif
-
-#ifdef LIBRARYBUILD
-#include <math.h>
-#endif
-
-#endif /* __glumymath_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mysetjmp.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mysetjmp.h
deleted file mode 100755
index 7d30d8843..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mysetjmp.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * mysetjmp.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/mysetjmp.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glumysetjmp_h_
-#define __glumysetjmp_h_
-
-#ifdef STANDALONE
-struct JumpBuffer;
-extern "C" JumpBuffer *newJumpbuffer( void );
-extern "C" void deleteJumpbuffer(JumpBuffer *);
-extern "C" void mylongjmp( JumpBuffer *, int );
-extern "C" int mysetjmp( JumpBuffer * );
-#endif
-
-#ifdef GLBUILD
-#define setjmp gl_setjmp
-#define longjmp gl_longjmp
-#endif
-
-#if LIBRARYBUILD | GLBUILD
-#include <setjmp.h>
-#include <stdlib.h>
-
-struct JumpBuffer {
- jmp_buf buf;
-};
-
-inline JumpBuffer *
-newJumpbuffer( void )
-{
- return (JumpBuffer *) malloc( sizeof( JumpBuffer ) );
-}
-
-inline void
-deleteJumpbuffer(JumpBuffer *jb)
-{
- free( (void *) jb);
-}
-
-inline void
-mylongjmp( JumpBuffer *j, int code )
-{
- ::longjmp( j->buf, code );
-}
-
-inline int
-mysetjmp( JumpBuffer *j )
-{
- return ::setjmp( j->buf );
-}
-#endif
-
-#endif /* __glumysetjmp_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mystring.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mystring.h
deleted file mode 100755
index 5dd2472e3..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mystring.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * mystring.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/mystring.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glumystring_h_
-#define __glumystring_h_
-
-#ifdef STANDALONE
-typedef unsigned int size_t;
-extern "C" void * memcpy(void *, const void *, size_t);
-extern "C" void * memset(void *, int, size_t);
-#endif
-
-#ifdef GLBUILD
-#define memcpy(a,b,c) bcopy(b,a,c)
-#define memset(a,b,c) bzero(a,c)
-extern "C" void bcopy(const void *, void *, int);
-extern "C" void bzero(void *, int);
-#endif
-
-#ifdef LIBRARYBUILD
-#include <string.h>
-#endif
-
-#endif /* __glumystring_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/nurbsconsts.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/nurbsconsts.h
deleted file mode 100755
index ea6c6016b..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/nurbsconsts.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * nurbsconsts.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/nurbsconsts.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glunurbsconsts_h_
-#define __glunurbsconsts_h_
-
-/* NURBS Properties - one set per map,
- each takes a single INREAL arg */
-#define N_SAMPLING_TOLERANCE 1
-#define N_S_RATE 6
-#define N_T_RATE 7
-#define N_CLAMPFACTOR 13
-#define N_NOCLAMPING 0.0
-#define N_MINSAVINGS 14
-#define N_NOSAVINGSSUBDIVISION 0.0
-
-/* NURBS Properties - one set per map,
- each takes an enumerated value */
-#define N_CULLING 2
-#define N_NOCULLING 0.0
-#define N_CULLINGON 1.0
-#define N_SAMPLINGMETHOD 10
-#define N_NOSAMPLING 0.0
-#define N_FIXEDRATE 3.0
-#define N_DOMAINDISTANCE 2.0
-#define N_PARAMETRICDISTANCE 5.0
-#define N_PATHLENGTH 6.0
-#define N_SURFACEAREA 7.0
-#define N_OBJECTSPACE_PARA 8.0
-#define N_OBJECTSPACE_PATH 9.0
-#define N_BBOX_SUBDIVIDING 17
-#define N_NOBBOXSUBDIVISION 0.0
-#define N_BBOXTIGHT 1.0
-#define N_BBOXROUND 2.0
-
-/* NURBS Rendering Properties - one set per renderer
- each takes an enumerated value */
-#define N_DISPLAY 3
-#define N_FILL 1.0
-#define N_OUTLINE_POLY 2.0
-#define N_OUTLINE_TRI 3.0
-#define N_OUTLINE_QUAD 4.0
-#define N_OUTLINE_PATCH 5.0
-#define N_OUTLINE_PARAM 6.0
-#define N_OUTLINE_PARAM_S 7.0
-#define N_OUTLINE_PARAM_ST 8.0
-#define N_OUTLINE_SUBDIV 9.0
-#define N_OUTLINE_SUBDIV_S 10.0
-#define N_OUTLINE_SUBDIV_ST 11.0
-#define N_ISOLINE_S 12.0
-#define N_ERRORCHECKING 4
-#define N_NOMSG 0.0
-#define N_MSG 1.0
-
-/* GL 4.0 propeties not defined above */
-#ifndef N_PIXEL_TOLERANCE
-#define N_PIXEL_TOLERANCE N_SAMPLING_TOLERANCE
-#define N_ERROR_TOLERANCE 20
-#define N_SUBDIVISIONS 5
-#define N_TILES 8
-#define N_TMP1 9
-#define N_TMP2 N_SAMPLINGMETHOD
-#define N_TMP3 11
-#define N_TMP4 12
-#define N_TMP5 N_CLAMPFACTOR
-#define N_TMP6 N_MINSAVINGS
-#define N_S_STEPS N_S_RATE
-#define N_T_STEPS N_T_RATE
-#endif
-
-/* NURBS Rendering Properties - one set per map,
- each takes an INREAL matrix argument */
-#define N_CULLINGMATRIX 1
-#define N_SAMPLINGMATRIX 2
-#define N_BBOXMATRIX 3
-
-
-/* NURBS Rendering Properties - one set per map,
- each takes an INREAL vector argument */
-#define N_BBOXSIZE 4
-
-/* type argument for trimming curves */
-#ifndef N_P2D
-#define N_P2D 0x8
-#define N_P2DR 0xd
-#endif
-
-#endif /* __glunurbsconsts_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/nurbsinterfac.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/nurbsinterfac.cc
deleted file mode 100755
index cd31071e0..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/nurbsinterfac.cc
+++ /dev/null
@@ -1,539 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * nurbsinterfac.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/nurbsinterfac.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "mystdio.h"
-#include "nurbsconsts.h"
-#include "nurbstess.h"
-#include "bufpool.h"
-#include "quilt.h"
-#include "displaylist.h"
-#include "knotvector.h"
-#include "mapdesc.h"
-
-#define THREAD( work, arg, cleanup ) \
- if( dl ) {\
- arg->save = 1;\
- dl->append( (PFVS)&NurbsTessellator::work, (void *) arg, (PFVS)&NurbsTessellator::cleanup );\
- } else {\
- arg->save = 0;\
- work( arg );\
- }
-
-#define THREAD2( work ) \
- if( dl ) {\
- dl->append( (PFVS)&NurbsTessellator::work, 0, 0 );\
- } else {\
- work( );\
- }
-
-NurbsTessellator::NurbsTessellator( BasicCurveEvaluator &c, BasicSurfaceEvaluator& e)
- : subdivider( renderhints, backend ),
- backend( c, e ),
- maplist( backend ),
- o_pwlcurvePool( sizeof( O_pwlcurve ), 32, "o_pwlcurvePool" ),
- o_nurbscurvePool( sizeof( O_nurbscurve ), 32, "o_nurbscurvePool"),
- o_curvePool( sizeof( O_curve ), 32, "o_curvePool" ),
- o_trimPool( sizeof( O_trim ), 32, "o_trimPool" ),
- o_surfacePool( sizeof( O_surface ), 1, "o_surfacePool" ),
- o_nurbssurfacePool( sizeof( O_nurbssurface ), 4, "o_nurbssurfacePool" ),
- propertyPool( sizeof( Property ), 32, "propertyPool" ),
- quiltPool( sizeof( Quilt ), 32, "quiltPool" )
-{
- dl = 0;
- inSurface = 0;
- inCurve = 0;
- inTrim = 0;
- playBack = 0;
- jumpbuffer = newJumpbuffer();
- subdivider.setJumpbuffer( jumpbuffer );
-}
-
-NurbsTessellator::~NurbsTessellator( void )
-{
- if( inTrim ) {
- do_nurbserror( 12 );
- endtrim();
- }
-
- if( inSurface ) {
- *nextNurbssurface = 0;
- do_freeall();
- }
-
- if (jumpbuffer) {
- deleteJumpbuffer(jumpbuffer);
- jumpbuffer= 0;
- }
-}
-
-/*-----------------------------------------------------------------------------
- * bgnsurface - allocate and initialize an o_surface structure
- *
- * Client: GL user
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::bgnsurface( long nuid )
-{
- O_surface *o_surface = new(o_surfacePool) O_surface;
- o_surface->nuid = nuid;
- THREAD( do_bgnsurface, o_surface, do_freebgnsurface );
-}
-
-/*-----------------------------------------------------------------------------
- * bgncurve - allocate an initialize an o_curve structure
- *
- * Client: GL user
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::bgncurve( long nuid )
-{
- O_curve *o_curve = new(o_curvePool) O_curve;
- o_curve->nuid = nuid;
- THREAD( do_bgncurve, o_curve, do_freebgncurve );
-}
-/*-----------------------------------------------------------------------------
- * endcurve -
- *
- * Client:
- *-----------------------------------------------------------------------------
- */
-
-void
-NurbsTessellator::endcurve( void )
-{
- THREAD2( do_endcurve );
-}
-
-/*-----------------------------------------------------------------------------
- * endsurface - user level end of surface call
- *
- * Client: GL user
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::endsurface( void )
-{
- THREAD2( do_endsurface );
-}
-
-
-/*-----------------------------------------------------------------------------
- * bgntrim - allocate and initialize a new trim loop structure (o_trim )
- *
- * Client: GL user
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::bgntrim( void )
-{
- O_trim *o_trim = new(o_trimPool) O_trim;
- THREAD( do_bgntrim, o_trim, do_freebgntrim );
-}
-
-/*-----------------------------------------------------------------------------
- * endtrim -
- *
- * Client: GL user
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::endtrim( void )
-{
- THREAD2( do_endtrim );
-}
-
-
-/*-----------------------------------------------------------------------------
- * pwlcurve -
- *
- * count - number of points on curve
- * array - array of points on curve
- * byte_stride - distance between points in bytes
- * type - valid data flag
- *
- * Client: Gl user
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::pwlcurve( long count, INREAL array[], long byte_stride, long type )
-{
- Mapdesc *mapdesc = maplist.locate( type );
-
- if( mapdesc == 0 ) {
- do_nurbserror( 35 );
- isDataValid = 0;
- return;
- }
-
- if ( (type != N_P2D) && (type != N_P2DR) ) {
- do_nurbserror( 22 );
- isDataValid = 0;
- return;
- }
- if( count < 0 ) {
- do_nurbserror( 33 );
- isDataValid = 0;
- return;
- }
- if( byte_stride < 0 ) {
- do_nurbserror( 34 );
- isDataValid = 0;
- return;
- }
-
-#ifdef NOTDEF
- if( mapdesc->isRational() ) {
- INREAL *p = array;
- INREAL x = p[0]; INREAL y = p[1]; INREAL w = p[2];
- p = (INREAL *) (((char *) p) + byte_stride);
- for( long i = 1; i != count; i++ ) {
- if( p[0] == x && p[1] == y && p[2] == w ) break;
- x = p[0]; y = p[1]; w = p[2];
- p = (INREAL *) (((char *) p) + byte_stride);
- }
- if( i != count ) {
- do_nurbserror( 37 );
- dprintf( "point %d (%f,%f)\n", i, x, y );
- isDataValid = 0;
- return;
- }
- } else {
- INREAL *p = array;
- INREAL x = p[0]; INREAL y = p[1];
- p = (INREAL *) (((char *) p) + byte_stride);
- for( long i = 1; i != count; i++ ) {
- if( p[0] == x && p[1] == y ) break;
- x = p[0]; y = p[1];
- p = (INREAL *) (((char *) p) + byte_stride);
- }
- if( i != count ) {
- do_nurbserror( 37 );
- dprintf( "point %d (%f,%f)\n", i, x, y );
- isDataValid = 0;
- return;
- }
- }
-#endif
-
- O_pwlcurve *o_pwlcurve = new(o_pwlcurvePool) O_pwlcurve( type, count, array, byte_stride, extTrimVertexPool.get((int)count) );
- THREAD( do_pwlcurve, o_pwlcurve, do_freepwlcurve );
-}
-
-
-/*-----------------------------------------------------------------------------
- * nurbscurve -
- *
- * Client: GL user
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::nurbscurve(
- long nknots, /* number of p knots */
- INREAL knot[], /* nondecreasing knot values in p */
- long byte_stride, /* distance in bytes between control points */
- INREAL ctlarray[], /* pointer to first control point */
- long order, /* order of spline */
- long type ) /* description of range space */
-{
-
- Mapdesc *mapdesc = maplist.locate( type );
-
- if( mapdesc == 0 ) {
- do_nurbserror( 35 );
- isDataValid = 0;
- return;
- }
-
- if( ctlarray == 0 ) {
- do_nurbserror( 36 );
- isDataValid = 0;
- return;
- }
-
- if( byte_stride < 0 ) {
- do_nurbserror( 34 );
- isDataValid = 0;
- return;
- }
-
- Knotvector knots;
-
- knots.init( nknots, byte_stride, order, knot );
- if( do_check_knots( &knots, "curve" ) ) return;
-
- O_nurbscurve *o_nurbscurve = new(o_nurbscurvePool) O_nurbscurve(type);
- o_nurbscurve->bezier_curves = new(quiltPool) Quilt(mapdesc);
- o_nurbscurve->bezier_curves->toBezier( knots,ctlarray, mapdesc->getNcoords() );
-
- THREAD( do_nurbscurve, o_nurbscurve, do_freenurbscurve );
-}
-
-
-/*-----------------------------------------------------------------------------
- * nurbssurface -
- *
- * Client: User routine
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::nurbssurface(
- long sknot_count, /* number of s knots */
- INREAL sknot[], /* nondecreasing knot values in s */
- long tknot_count, /* number of t knots */
- INREAL tknot[], /* nondecreasing knot values in t */
- long s_byte_stride, /* s step size in memory bytes */
- long t_byte_stride, /* t step size in memory bytes */
- INREAL ctlarray[], /* pointer to first control point */
- long sorder, /* order of the spline in s parameter */
- long torder, /* order of the spline in t parameter */
- long type) /* description of range space */
-{
- Mapdesc *mapdesc = maplist.locate( type );
-
- if( mapdesc == 0 ) {
- do_nurbserror( 35 );
- isDataValid = 0;
- return;
- }
-
- if( s_byte_stride < 0 ) {
- do_nurbserror( 34 );
- isDataValid = 0;
- return;
- }
-
- if( t_byte_stride < 0 ) {
- do_nurbserror( 34 );
- isDataValid = 0;
- return;
- }
-
- Knotvector sknotvector, tknotvector;
-
- sknotvector.init( sknot_count, s_byte_stride, sorder, sknot );
- if( do_check_knots( &sknotvector, "surface" ) ) return;
-
- tknotvector.init( tknot_count, t_byte_stride, torder, tknot );
- if( do_check_knots( &tknotvector, "surface" ) ) return;
-
- O_nurbssurface *o_nurbssurface = new(o_nurbssurfacePool) O_nurbssurface(type);
- o_nurbssurface->bezier_patches = new(quiltPool) Quilt(mapdesc);
-
- o_nurbssurface->bezier_patches->toBezier( sknotvector, tknotvector,
- ctlarray, mapdesc->getNcoords() );
- THREAD( do_nurbssurface, o_nurbssurface, do_freenurbssurface );
-}
-
-
-/*-----------------------------------------------------------------------------
- * setnurbsproperty -
- *
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::setnurbsproperty( long tag, INREAL value )
-{
- if( ! renderhints.isProperty( tag ) ) {
- do_nurbserror( 26 );
- } else {
- Property *prop = new(propertyPool) Property( tag, value );
- THREAD( do_setnurbsproperty, prop, do_freenurbsproperty );
- }
-}
-
-/*-----------------------------------------------------------------------------
- * setnurbsproperty -
- *
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::setnurbsproperty( long type, long tag, INREAL value )
-{
- Mapdesc *mapdesc = maplist.locate( type );
-
- if( mapdesc == 0 ) {
- do_nurbserror( 35 );
- return;
- }
-
- if( ! mapdesc->isProperty( tag ) ) {
- do_nurbserror( 26 );
- return;
- }
-
- Property *prop = new(propertyPool) Property( type, tag, value );
- THREAD( do_setnurbsproperty2, prop, do_freenurbsproperty );
-}
-
-
-/*-----------------------------------------------------------------------------
- * getnurbsproperty -
- *
- *-----------------------------------------------------------------------------
- */
-
-void
-NurbsTessellator::getnurbsproperty( long tag, INREAL *value )
-{
- if( renderhints.isProperty( tag ) ) {
- *value = renderhints.getProperty( tag );
- } else {
- do_nurbserror( 26 );
- }
-}
-
-/*-----------------------------------------------------------------------------
- * getnurbsproperty -
- *
- *-----------------------------------------------------------------------------
- */
-
-void
-NurbsTessellator::getnurbsproperty( long type, long tag, INREAL *value )
-{
- Mapdesc *mapdesc = maplist.locate( type );
-
- if( mapdesc == 0 )
- do_nurbserror( 35 );
-
- if( mapdesc->isProperty( tag ) ) {
- *value = mapdesc->getProperty( tag );
- } else {
- do_nurbserror( 26 );
- }
-}
-
-/*--------------------------------------------------------------------------
- * setnurbsproperty - accept a user supplied matrix as culling or sampling mat
- *--------------------------------------------------------------------------
- */
-
-void
-NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat )
-{
- // XXX - cannot be put in display list
- Mapdesc *mapdesc = maplist.locate( type );
-
- if( mapdesc == 0 ) {
- do_nurbserror( 35 );
- isDataValid = 0;
- } else if( purpose == N_BBOXSIZE ) {
- mapdesc->setBboxsize( mat );
- } else {
-#ifndef NDEBUG
- dprintf( "ERRORRORRORR!!!\n");
-#endif
- }
-}
-
-/*--------------------------------------------------------------------------
- * setnurbsproperty - accept a user supplied matrix as culling or sampling mat
- *--------------------------------------------------------------------------
- */
-
-void
-NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat,
- long rstride, long cstride )
-{
- // XXX - cannot be put in display list
- Mapdesc *mapdesc = maplist.locate( type );
-
- if( mapdesc == 0 ) {
- do_nurbserror( 35 );
- isDataValid = 0;
- } else if( purpose == N_CULLINGMATRIX ) {
- mapdesc->setCmat( mat, rstride, cstride );
- } else if( purpose == N_SAMPLINGMATRIX ) {
- mapdesc->setSmat( mat, rstride, cstride );
- } else if( purpose == N_BBOXMATRIX ) {
- mapdesc->setBmat( mat, rstride, cstride );
- } else {
-#ifndef NDEBUG
- dprintf( "ERRORRORRORR!!!\n");
-#endif
- }
-}
-
-void
-NurbsTessellator::redefineMaps( void )
-{
- maplist.initialize();
-}
-
-void
-NurbsTessellator::defineMap( long type, long rational, long ncoords )
-{
- maplist.define( type, (int) rational, (int) ncoords );
-}
-
-void
-NurbsTessellator::discardRecording( void *_dl )
-{
- delete (DisplayList *) _dl;
-}
-
-void *
-NurbsTessellator::beginRecording( void )
-{
- dl = new DisplayList( this );
- return (void *) dl;
-}
-
-void
-NurbsTessellator::endRecording( void )
-{
- dl->endList();
- dl = 0;
-}
-
-void
-NurbsTessellator::playRecording( void *_dl )
-{
- playBack = 1;
- bgnrender();
- ((DisplayList *)_dl)->play();
- endrender();
- playBack = 0;
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/nurbstess.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/nurbstess.cc
deleted file mode 100755
index c2a86533f..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/nurbstess.cc
+++ /dev/null
@@ -1,693 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * nurbstess.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/nurbstess.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "myassert.h"
-#include "mysetjmp.h"
-#include "mystdio.h"
-#include "nurbsconsts.h"
-#include "nurbstess.h"
-#include "bufpool.h"
-#include "quilt.h"
-#include "knotvector.h"
-#include "mapdesc.h"
-#include "maplist.h"
-
-void
-NurbsTessellator::set_domain_distance_u_rate(REAL u_rate)
-{
- subdivider.set_domain_distance_u_rate(u_rate);
-}
-
-void
-NurbsTessellator::set_domain_distance_v_rate(REAL v_rate)
-{
- subdivider.set_domain_distance_v_rate(v_rate);
-}
-
-void
-NurbsTessellator::set_is_domain_distance_sampling(int flag)
-{
- subdivider.set_is_domain_distance_sampling(flag);
-}
-
-void
-NurbsTessellator::resetObjects( void )
-{
- subdivider.clear();
-}
-
-void
-NurbsTessellator::makeobj( int )
-{
-#ifndef NDEBUG
- dprintf( "makeobj\n" );
-#endif
-}
-
-void
-NurbsTessellator::closeobj( void )
-{
-#ifndef NDEBUG
- dprintf( "closeobj\n" );
-#endif
-}
-
-void
-NurbsTessellator::bgnrender( void )
-{
-#ifndef NDEBUG
- dprintf( "bgnrender\n" );
-#endif
-}
-
-void
-NurbsTessellator::endrender( void )
-{
-#ifndef NDEBUG
- dprintf( "endrender\n" );
-#endif
-}
-
-/*-----------------------------------------------------------------------------
- * do_freebgnsurface - free o_surface structure
- *
- * Client: do_freeall(), bgnsurface()
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::do_freebgnsurface( O_surface *o_surface )
-{
- o_surface->deleteMe( o_surfacePool );
-}
-
-
-/*-----------------------------------------------------------------------------
- * do_bgnsurface - begin the display of a surface
- *
- * Client: bgnsurface()
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::do_bgnsurface( O_surface *o_surface )
-{
- if( inSurface ) {
- do_nurbserror( 27 );
- endsurface();
- }
- inSurface = 1;
-
- if( ! playBack ) bgnrender();
-
- isTrimModified = 0;
- isSurfaceModified = 0;
- isDataValid = 1;
- numTrims = 0;
- currentSurface = o_surface;
- nextTrim = &( currentSurface->o_trim );
- nextNurbssurface = &( currentSurface->o_nurbssurface );
-}
-
-/*-----------------------------------------------------------------------------
- * do_bgncurve - begin the display of a curve
- *
- * Client: bgncurve()
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::do_bgncurve( O_curve *o_curve )
-{
- if ( inCurve ) {
- do_nurbserror( 6 );
- endcurve();
- }
-
- inCurve = 1;
- currentCurve = o_curve;
- currentCurve->curvetype = ct_none;
-
- if( inTrim ) {
- if( *nextCurve != o_curve ) {
- isCurveModified = 1;
- *nextCurve = o_curve;
- }
- } else {
- if( ! playBack ) bgnrender();
- isDataValid = 1;
- }
- nextCurve = &(o_curve->next);
- nextPwlcurve = &(o_curve->curve.o_pwlcurve);
- nextNurbscurve = &(o_curve->curve.o_nurbscurve);
-}
-
-/*-----------------------------------------------------------------------------
- * do_endcurve -
- *
- * Client: endcurve()
- *-----------------------------------------------------------------------------
- */
-
-void
-NurbsTessellator::do_endcurve( void )
-{
- if( ! inCurve ) {
- do_nurbserror( 7 );
- return;
- }
- inCurve = 0;
-
- *nextCurve = 0;
- if (currentCurve->curvetype == ct_nurbscurve)
- *nextNurbscurve = 0;
- else
- *nextPwlcurve = 0;
-
- if ( ! inTrim ) {
- if( ! isDataValid ) {
- do_freecurveall( currentCurve );
- return;
- }
-
- int errval;
- errval = ::mysetjmp( jumpbuffer );
- if( errval == 0 ) {
- if( currentCurve->curvetype == ct_nurbscurve ) {
- subdivider.beginQuilts();
- for( O_nurbscurve *n = currentCurve->curve.o_nurbscurve; n != 0; n = n->next )
- subdivider.addQuilt( n->bezier_curves );
- subdivider.endQuilts();
- subdivider.drawCurves();
- if( ! playBack ) endrender();
- } else {
- /* XXX */
- if( ! playBack ) endrender();
- /*do_draw_pwlcurve( currentCurve->curve.o_pwlcurve ) */;
- do_nurbserror( 9 );
- }
- } else {
- if( ! playBack ) endrender();
- do_nurbserror( errval );
- }
- do_freecurveall( currentCurve );
- resetObjects();
- }
-}
-
-/*-----------------------------------------------------------------------------
- * do_endsurface - mark end of surface, display surface, free immediate data
- *
- * Client:
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::do_endsurface( void )
-{
- if( inTrim ) {
- do_nurbserror( 12 );
- endtrim();
- }
-
- if( ! inSurface ) {
- do_nurbserror( 13 );
- return;
- }
- inSurface = 0;
-
- *nextNurbssurface = 0;
-
- if( ! isDataValid ) {
- do_freeall( );
- return;
- }
-
- if( *nextTrim != 0 ) {
- isTrimModified = 1;
- *nextTrim = 0;
- }
-
- int errval;
-
- errval = ::mysetjmp( jumpbuffer );
- if( errval == 0 ) {
- if( numTrims > 0 ) {
-
- subdivider.beginTrims();
- for( O_trim *trim = currentSurface->o_trim; trim; trim = trim->next ) {
- subdivider.beginLoop();
- for( O_curve *curve = trim->o_curve; curve; curve = curve->next ) {
- curve->used = 0;
- assert( curve->curvetype != ct_none );
- if (curve->curvetype == ct_pwlcurve) {
- O_pwlcurve *c = curve->curve.o_pwlcurve;
- subdivider.addArc( c->npts, c->pts, curve->nuid );
- } else {
- Quilt *quilt = curve->curve.o_nurbscurve->bezier_curves;
- Quiltspec *qspec = quilt->qspec;
- REAL *cpts = quilt->cpts + qspec->offset;
- REAL *cptsend = cpts + (qspec->width * qspec->order * qspec->stride);
- for( ; cpts != cptsend; cpts += qspec->order*qspec->stride )
- subdivider.addArc( cpts, quilt, curve->nuid );
- }
- }
- subdivider.endLoop();
- }
- subdivider.endTrims();
- }
-
- subdivider.beginQuilts();
- for( O_nurbssurface *n = currentSurface->o_nurbssurface; n; n = n->next )
- subdivider.addQuilt( n->bezier_patches );
- subdivider.endQuilts();
- subdivider.drawSurfaces( currentSurface->nuid );
- if( ! playBack ) endrender();
- } else {
- if( ! playBack ) endrender();
- do_nurbserror( errval );
- }
-
- do_freeall( );
- resetObjects();
-}
-
-/*-----------------------------------------------------------------------------
- * do_freeall - free all data allocated in immediate mode
- *
- * Client:
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::do_freeall( void )
-{
- for( O_trim *o_trim = currentSurface->o_trim; o_trim; ) {
- O_trim *next_o_trim = o_trim->next;
- for( O_curve *curve = o_trim->o_curve; curve; ) {
- O_curve *next_o_curve = curve->next;
- do_freecurveall( curve );
- curve = next_o_curve;
- }
- if( o_trim->save == 0 ) do_freebgntrim( o_trim );
- o_trim = next_o_trim;
- }
-
- O_nurbssurface *nurbss, *next_nurbss;
- for( nurbss= currentSurface->o_nurbssurface; nurbss; nurbss = next_nurbss) {
- next_nurbss = nurbss->next;
- if( nurbss->save == 0 )
- do_freenurbssurface( nurbss );
- else
- nurbss->used = 0;
- }
-
- if( currentSurface->save == 0 ) do_freebgnsurface( currentSurface );
-}
-
-void
-NurbsTessellator::do_freecurveall( O_curve *curve )
-{
- assert( curve->curvetype != ct_none );
-
- if( curve->curvetype == ct_nurbscurve ) {
- O_nurbscurve *ncurve, *next_ncurve;
- for( ncurve=curve->curve.o_nurbscurve; ncurve; ncurve=next_ncurve ) {
- next_ncurve = ncurve->next;
- if( ncurve->save == 0 )
- do_freenurbscurve( ncurve );
- else
- ncurve->used = 0;
- }
- } else {
- O_pwlcurve *pcurve, *next_pcurve;
- for( pcurve=curve->curve.o_pwlcurve; pcurve; pcurve=next_pcurve ) {
- next_pcurve = pcurve->next;
- if( pcurve->save == 0 )
- do_freepwlcurve( pcurve );
- else
- pcurve->used = 0;
- }
- }
- if( curve->save == 0 )
- do_freebgncurve( curve );
-}
-
-
-/*-----------------------------------------------------------------------------
- * do_freebgntrim - free the space allocated for a trim loop
- *
- * Client:
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::do_freebgntrim( O_trim *o_trim )
-{
- o_trim->deleteMe( o_trimPool );
-}
-
-
-/*-----------------------------------------------------------------------------
- * do_bgntrim - link in a trim loop to the current trimmed surface description
- *
- * Client: bgntrim()
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::do_bgntrim( O_trim *o_trim )
-{
-
- if( ! inSurface ) {
- do_nurbserror( 15 );
- bgnsurface( 0 );
- inSurface = 2;
- }
-
- if( inTrim ) {
- do_nurbserror( 16 );
- endtrim();
- }
- inTrim = 1;
-
- if( *nextTrim != o_trim ) {
- isTrimModified = 1;
- *nextTrim = o_trim;
- }
-
- currentTrim = o_trim;
- nextTrim = &(o_trim->next);
- nextCurve = &(o_trim->o_curve);
-}
-
-
-/*-----------------------------------------------------------------------------
- * do_endtrim - mark the end of the current trim loop
- *
- * Client: endtrim()
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::do_endtrim( void )
-{
- if( ! inTrim ) {
- do_nurbserror( 17 );
- return;
- }
- inTrim = 0;
-
- if( currentTrim->o_curve == 0 ) {
- do_nurbserror( 18 );
- isDataValid = 0;
- }
-
- numTrims++;
-
- if( *nextCurve != 0 ) {
- isTrimModified = 1;
- *nextCurve = 0;
- }
-}
-
-/*-----------------------------------------------------------------------------
- * do_freepwlcurve -
- *
- * Client:
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::do_freepwlcurve( O_pwlcurve *o_pwlcurve )
-{
- o_pwlcurve->deleteMe( o_pwlcurvePool );
-}
-
-void
-NurbsTessellator::do_freebgncurve( O_curve *o_curve )
-{
- o_curve->deleteMe( o_curvePool );
-}
-
-/*-----------------------------------------------------------------------------
- * do_pwlcurve - link in pwl trim loop to the current surface description
- *
- * Client: pwlcurve()
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::do_pwlcurve( O_pwlcurve *o_pwlcurve )
-{
- if( ! inTrim ) {
- do_nurbserror( 19 );
- if( o_pwlcurve->save == 0 )
- do_freepwlcurve(o_pwlcurve );
- return;
- }
-
- if( ! inCurve ) {
- bgncurve( 0 );
- inCurve = 2;
- }
-
- if( o_pwlcurve->used ) {
- do_nurbserror( 20 );
- isDataValid = 0;
- return;
- } else
- o_pwlcurve->used = 1;
-
- if( currentCurve->curvetype == ct_none ) {
- currentCurve->curvetype = ct_pwlcurve;
- } else if( currentCurve->curvetype != ct_pwlcurve ) {
- do_nurbserror( 21 );
- isDataValid = 0;
- return;
- }
-
- if( *nextPwlcurve != o_pwlcurve ) {
- isCurveModified = 1;
- *nextPwlcurve = o_pwlcurve;
- }
- nextPwlcurve = &(o_pwlcurve->next);
-
- if( o_pwlcurve->owner != currentCurve ) {
- isCurveModified = 1;
- o_pwlcurve->owner = currentCurve;
- }
-
- if( (inCurve == 2) )
- endcurve();
-}
-
-
-/*-----------------------------------------------------------------------------
- * do_freenurbscurve -
- *
- * Client:
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::do_freenurbscurve( O_nurbscurve *o_nurbscurve )
-{
- o_nurbscurve->bezier_curves->deleteMe( quiltPool );
- o_nurbscurve->deleteMe( o_nurbscurvePool );
-}
-
-
-/*-----------------------------------------------------------------------------
- * do_nurbscurve -
- *
- * Client: nurbscurve()
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::do_nurbscurve( O_nurbscurve *o_nurbscurve )
-{
- if ( ! inCurve ) {
- bgncurve( 0 );
- inCurve = 2;
- }
-
- if( o_nurbscurve->used ) {
- /* error - curve was already called in current surface */
- do_nurbserror( 23 );
- isDataValid = 0;
- return;
- } else
- o_nurbscurve->used = 1;
-
- if( currentCurve->curvetype == ct_none ) {
- currentCurve->curvetype = ct_nurbscurve;
- } else if( currentCurve->curvetype != ct_nurbscurve ) {
- do_nurbserror( 24 );
- isDataValid = 0;
- return;
- }
-
- if( *nextNurbscurve != o_nurbscurve ) {
- isCurveModified = 1;
- *nextNurbscurve = o_nurbscurve;
- }
-
- nextNurbscurve = &(o_nurbscurve->next);
-
- if( o_nurbscurve->owner != currentCurve ) {
- isCurveModified = 1;
- o_nurbscurve->owner = currentCurve;
- }
-
- if( o_nurbscurve->owner == 0 )
- isCurveModified = 1;
-
- if( inCurve == 2 )
- endcurve();
-}
-
-
-/*-----------------------------------------------------------------------------
- * do_freenurbssurface -
- *
- * Client:
- *-----------------------------------------------------------------------------
- */
-
-void
-NurbsTessellator::do_freenurbssurface( O_nurbssurface *o_nurbssurface )
-{
- o_nurbssurface->bezier_patches->deleteMe( quiltPool );
- o_nurbssurface->deleteMe( o_nurbssurfacePool );
-}
-
-/*-----------------------------------------------------------------------------
- * do_nurbssurface -
- *
- * Client: nurbssurface()
- *-----------------------------------------------------------------------------
- */
-void
-NurbsTessellator::do_nurbssurface( O_nurbssurface *o_nurbssurface )
-{
- if( ! inSurface ) {
- bgnsurface( 0 );
- inSurface = 2;
- }
-
- if( o_nurbssurface->used ) {
- /* error - surface was already called in current block */
- do_nurbserror( 25 );
- isDataValid = 0;
- return;
- } else
- o_nurbssurface->used = 1;
-
- if( *nextNurbssurface != o_nurbssurface ) {
- isSurfaceModified = 1;
- *nextNurbssurface = o_nurbssurface;
- }
-
- if( o_nurbssurface->owner != currentSurface ) {
- isSurfaceModified = 1;
- o_nurbssurface->owner = currentSurface;
- }
- nextNurbssurface = &(o_nurbssurface->next);
-
- if( inSurface == 2 )
- endsurface();
-}
-
-
-/*-----------------------------------------------------------------------------
- * do_freenurbsproperty
- *
- *-----------------------------------------------------------------------------
- */
-
-void
-NurbsTessellator::do_freenurbsproperty( Property *prop )
-{
- prop->deleteMe( propertyPool );
-}
-
-
-/*-----------------------------------------------------------------------------
- * do_setnurbsproperty -
- *
- *-----------------------------------------------------------------------------
- */
-
-void
-NurbsTessellator::do_setnurbsproperty( Property *prop )
-{
- renderhints.setProperty( prop->tag, prop->value );
- if( prop->save == 0 )
- do_freenurbsproperty( prop );
-}
-
-void
-NurbsTessellator::do_setnurbsproperty2( Property *prop )
-{
- Mapdesc *mapdesc = maplist.find( prop->type );
-
- mapdesc->setProperty( prop->tag, prop->value );
- if( prop->save == 0 )
- do_freenurbsproperty( prop );
-}
-
-void
-NurbsTessellator::errorHandler( int )
-{
-}
-
-void
-NurbsTessellator::do_nurbserror( int msg )
-{
- errorHandler( msg );
-}
-
-int
-NurbsTessellator::do_check_knots( Knotvector *knots, char *msg )
-{
- int status = knots->validate();
- if( status ) {
- do_nurbserror( status );
- if( renderhints.errorchecking != N_NOMSG ) knots->show( msg );
- }
- return status;
-}
-
-
-
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/nurbstess.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/nurbstess.h
deleted file mode 100755
index 4758fa593..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/nurbstess.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * nurbstess.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/nurbstess.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glunurbstess_h_
-#define __glunurbstess_h_
-
-#include "mysetjmp.h"
-#include "subdivider.h"
-#include "renderhints.h"
-#include "backend.h"
-#include "maplist.h"
-#include "reader.h"
-#include "nurbsconsts.h"
-
-class Knotvector;
-class Quilt;
-class DisplayList;
-class BasicCurveEvaluator;
-class BasicSurfaceEvaluator;
-
-class NurbsTessellator {
-public:
- NurbsTessellator( BasicCurveEvaluator &c,
- BasicSurfaceEvaluator &e );
- ~NurbsTessellator( void );
-
- void getnurbsproperty( long, INREAL * );
- void getnurbsproperty( long, long, INREAL * );
- void setnurbsproperty( long, INREAL );
- void setnurbsproperty( long, long, INREAL );
- void setnurbsproperty( long, long, INREAL * );
- void setnurbsproperty( long, long, INREAL *, long, long );
-
- // called before a tessellation begins/ends
- virtual void bgnrender( void );
- virtual void endrender( void );
-
- // called to make a display list of the output vertices
- virtual void makeobj( int n );
- virtual void closeobj( void );
-
- // called when a error occurs
- virtual void errorHandler( int );
-
- void bgnsurface( long );
- void endsurface( void );
- void bgntrim( void );
- void endtrim( void );
- void bgncurve( long );
- void endcurve( void );
- void pwlcurve( long, INREAL[], long, long );
- void nurbscurve( long, INREAL[], long, INREAL[], long, long );
- void nurbssurface( long, INREAL[], long, INREAL[], long, long,
- INREAL[], long, long, long );
-
- void defineMap( long, long, long );
- void redefineMaps( void );
-
- // recording of input description
- void discardRecording( void * );
- void * beginRecording( void );
- void endRecording( void );
- void playRecording( void * );
-
- //for optimizing untrimmed nurbs in the case of domain distance sampling
- void set_domain_distance_u_rate(REAL u_rate);
- void set_domain_distance_v_rate(REAL v_rate);
- void set_is_domain_distance_sampling(int flag);
-
-
-protected:
- Renderhints renderhints;
- Maplist maplist;
- Backend backend;
-
-private:
-
- void resetObjects( void );
- int do_check_knots( Knotvector *, char * );
- void do_nurbserror( int );
- void do_bgncurve( O_curve * );
- void do_endcurve( void );
- void do_freeall( void );
- void do_freecurveall( O_curve * );
- void do_freebgntrim( O_trim * );
- void do_freebgncurve( O_curve * );
- void do_freepwlcurve( O_pwlcurve * );
- void do_freenurbscurve( O_nurbscurve * );
- void do_freenurbssurface( O_nurbssurface * );
- void do_freebgnsurface( O_surface * );
- void do_bgnsurface( O_surface * );
- void do_endsurface( void );
- void do_bgntrim( O_trim * );
- void do_endtrim( void );
- void do_pwlcurve( O_pwlcurve * );
- void do_nurbscurve( O_nurbscurve * );
- void do_nurbssurface( O_nurbssurface * );
- void do_freenurbsproperty( Property * );
- void do_setnurbsproperty( Property * );
- void do_setnurbsproperty2( Property * );
-
- Subdivider subdivider;
- JumpBuffer* jumpbuffer;
- Pool o_pwlcurvePool;
- Pool o_nurbscurvePool;
- Pool o_curvePool;
- Pool o_trimPool;
- Pool o_surfacePool;
- Pool o_nurbssurfacePool;
- Pool propertyPool;
-public:
- Pool quiltPool;
-private:
- TrimVertexPool extTrimVertexPool;
-
- int inSurface; /* bgnsurface seen */
- int inCurve; /* bgncurve seen */
- int inTrim; /* bgntrim seen */
- int isCurveModified; /* curve changed */
- int isTrimModified; /* trim curves changed */
- int isSurfaceModified; /* surface changed */
- int isDataValid; /* all data is good */
- int numTrims; /* valid trim regions */
- int playBack;
-
- O_trim** nextTrim; /* place to link o_trim */
- O_curve** nextCurve; /* place to link o_curve */
- O_nurbscurve** nextNurbscurve; /* place to link o_nurbscurve */
- O_pwlcurve** nextPwlcurve; /* place to link o_pwlcurve */
- O_nurbssurface** nextNurbssurface; /* place to link o_nurbssurface */
-
- O_surface* currentSurface;
- O_trim* currentTrim;
- O_curve* currentCurve;
-
- DisplayList *dl;
-
-};
-
-#endif /* __glunurbstess_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/patch.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/patch.cc
deleted file mode 100755
index b5ff8ad8a..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/patch.cc
+++ /dev/null
@@ -1,508 +0,0 @@
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/patch.cc,v 1.3 2001/04/27 12:58:28 dawes Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * patch.c++
- *
- * $Date: 2001/05/01 17:07:32 $ $Revision: 1.1.1.2 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/patch.cc,v 1.1.1.2 2001/05/01 17:07:32 dawes Exp $
- */
-
-#include <stdio.h>
-#include "glimports.h"
-#include "mystdio.h"
-#include "myassert.h"
-#include "mymath.h"
-#include "mystring.h"
-#include "patch.h"
-#include "mapdesc.h"
-#include "quilt.h"
-#include "nurbsconsts.h"
-#include "simplemath.h" //for abs function in ::singleStep();
-#include "gluint.h"
-
-
-/*--------------------------------------------------------------------------
- * Patch - copy patch from quilt and transform control points
- *--------------------------------------------------------------------------
- */
-
-Patch::Patch( Quilt_ptr geo, REAL *pta, REAL *ptb, Patch *n )
-{
-/* pspec[i].range is uninit here */
- mapdesc = geo->mapdesc;
- cullval = mapdesc->isCulling() ? CULL_ACCEPT : CULL_TRIVIAL_ACCEPT;
- notInBbox = mapdesc->isBboxSubdividing() ? 1 : 0;
- needsSampling = mapdesc->isRangeSampling() ? 1 : 0;
- pspec[0].order = geo->qspec[0].order;
- pspec[1].order = geo->qspec[1].order;
- pspec[0].stride = pspec[1].order * MAXCOORDS;
- pspec[1].stride = MAXCOORDS;
-
- /* transform control points to sampling and culling spaces */
- REAL *ps = geo->cpts;
- geo->select( pta, ptb );
- ps += geo->qspec[0].offset;
- ps += geo->qspec[1].offset;
- ps += geo->qspec[0].index * geo->qspec[0].order * geo->qspec[0].stride;
- ps += geo->qspec[1].index * geo->qspec[1].order * geo->qspec[1].stride;
-
- if( needsSampling ) {
- mapdesc->xformSampling( ps, geo->qspec[0].order, geo->qspec[0].stride,
- geo->qspec[1].order, geo->qspec[1].stride,
- spts, pspec[0].stride, pspec[1].stride );
- }
-
- if( cullval == CULL_ACCEPT ) {
- mapdesc->xformCulling( ps, geo->qspec[0].order, geo->qspec[0].stride,
- geo->qspec[1].order, geo->qspec[1].stride,
- cpts, pspec[0].stride, pspec[1].stride );
- }
-
- if( notInBbox ) {
- mapdesc->xformBounding( ps, geo->qspec[0].order, geo->qspec[0].stride,
- geo->qspec[1].order, geo->qspec[1].stride,
- bpts, pspec[0].stride, pspec[1].stride );
- }
-
- /* set scale range */
- pspec[0].range[0] = geo->qspec[0].breakpoints[geo->qspec[0].index];
- pspec[0].range[1] = geo->qspec[0].breakpoints[geo->qspec[0].index+1];
- pspec[0].range[2] = pspec[0].range[1] - pspec[0].range[0];
-
- pspec[1].range[0] = geo->qspec[1].breakpoints[geo->qspec[1].index];
- pspec[1].range[1] = geo->qspec[1].breakpoints[geo->qspec[1].index+1];
- pspec[1].range[2] = pspec[1].range[1] - pspec[1].range[0];
-
- // may need to subdivide to match range of sub-patch
- if( pspec[0].range[0] != pta[0] ) {
- assert( pspec[0].range[0] < pta[0] );
- Patch lower( *this, 0, pta[0], 0 );
- *this = lower;
- }
-
- if( pspec[0].range[1] != ptb[0] ) {
- assert( pspec[0].range[1] > ptb[0] );
- Patch upper( *this, 0, ptb[0], 0 );
- }
-
- if( pspec[1].range[0] != pta[1] ) {
- assert( pspec[1].range[0] < pta[1] );
- Patch lower( *this, 1, pta[1], 0 );
- *this = lower;
- }
-
- if( pspec[1].range[1] != ptb[1] ) {
- assert( pspec[1].range[1] > ptb[1] );
- Patch upper( *this, 1, ptb[1], 0 );
- }
- checkBboxConstraint();
- next = n;
-}
-
-/*--------------------------------------------------------------------------
- * Patch - subdivide a patch along an isoparametric line
- *--------------------------------------------------------------------------
- */
-
-Patch::Patch( Patch& upper, int param, REAL value, Patch *n )
-{
- Patch& lower = *this;
-
- lower.cullval = upper.cullval;
- lower.mapdesc = upper.mapdesc;
- lower.notInBbox = upper.notInBbox;
- lower.needsSampling = upper.needsSampling;
- lower.pspec[0].order = upper.pspec[0].order;
- lower.pspec[1].order = upper.pspec[1].order;
- lower.pspec[0].stride = upper.pspec[0].stride;
- lower.pspec[1].stride = upper.pspec[1].stride;
- lower.next = n;
-
- /* reset scale range */
- switch( param ) {
- case 0: {
- REAL d = (value-upper.pspec[0].range[0]) / upper.pspec[0].range[2];
- if( needsSampling )
- mapdesc->subdivide( upper.spts, lower.spts, d, pspec[1].order,
- pspec[1].stride, pspec[0].order, pspec[0].stride );
-
- if( cullval == CULL_ACCEPT )
- mapdesc->subdivide( upper.cpts, lower.cpts, d, pspec[1].order,
- pspec[1].stride, pspec[0].order, pspec[0].stride );
-
- if( notInBbox )
- mapdesc->subdivide( upper.bpts, lower.bpts, d, pspec[1].order,
- pspec[1].stride, pspec[0].order, pspec[0].stride );
-
- lower.pspec[0].range[0] = upper.pspec[0].range[0];
- lower.pspec[0].range[1] = value;
- lower.pspec[0].range[2] = value - upper.pspec[0].range[0];
- upper.pspec[0].range[0] = value;
- upper.pspec[0].range[2] = upper.pspec[0].range[1] - value;
-
- lower.pspec[1].range[0] = upper.pspec[1].range[0];
- lower.pspec[1].range[1] = upper.pspec[1].range[1];
- lower.pspec[1].range[2] = upper.pspec[1].range[2];
- break;
- }
- case 1: {
- REAL d = (value-upper.pspec[1].range[0]) / upper.pspec[1].range[2];
- if( needsSampling )
- mapdesc->subdivide( upper.spts, lower.spts, d, pspec[0].order,
- pspec[0].stride, pspec[1].order, pspec[1].stride );
- if( cullval == CULL_ACCEPT )
- mapdesc->subdivide( upper.cpts, lower.cpts, d, pspec[0].order,
- pspec[0].stride, pspec[1].order, pspec[1].stride );
- if( notInBbox )
- mapdesc->subdivide( upper.bpts, lower.bpts, d, pspec[0].order,
- pspec[0].stride, pspec[1].order, pspec[1].stride );
- lower.pspec[0].range[0] = upper.pspec[0].range[0];
- lower.pspec[0].range[1] = upper.pspec[0].range[1];
- lower.pspec[0].range[2] = upper.pspec[0].range[2];
-
- lower.pspec[1].range[0] = upper.pspec[1].range[0];
- lower.pspec[1].range[1] = value;
- lower.pspec[1].range[2] = value - upper.pspec[1].range[0];
- upper.pspec[1].range[0] = value;
- upper.pspec[1].range[2] = upper.pspec[1].range[1] - value;
- break;
- }
- }
-
- // inherit bounding box
- if( mapdesc->isBboxSubdividing() && ! notInBbox )
- memcpy( lower.bb, upper.bb, sizeof( bb ) );
-
- lower.checkBboxConstraint();
- upper.checkBboxConstraint();
-}
-
-/*--------------------------------------------------------------------------
- * clamp - clamp the sampling rate to a given maximum
- *--------------------------------------------------------------------------
- */
-
-void
-Patch::clamp( void )
-{
- if( mapdesc->clampfactor != N_NOCLAMPING ) {
- pspec[0].clamp( mapdesc->clampfactor );
- pspec[1].clamp( mapdesc->clampfactor );
- }
-}
-
-void
-Patchspec::clamp( REAL clampfactor )
-{
- if( sidestep[0] < minstepsize )
- sidestep[0] = clampfactor * minstepsize;
- if( sidestep[1] < minstepsize )
- sidestep[1] = clampfactor * minstepsize;
- if( stepsize < minstepsize )
- stepsize = clampfactor * minstepsize;
-}
-
-void
-Patch::checkBboxConstraint( void )
-{
- if( notInBbox &&
- mapdesc->bboxTooBig( bpts, pspec[0].stride, pspec[1].stride,
- pspec[0].order, pspec[1].order, bb ) != 1 ) {
- notInBbox = 0;
- }
-}
-
-void
-Patch::bbox( void )
-{
- if( mapdesc->isBboxSubdividing() )
- mapdesc->surfbbox( bb );
-}
-
-/*--------------------------------------------------------------------------
- * getstepsize - compute the sampling density across the patch
- * and determine if patch needs to be subdivided
- *--------------------------------------------------------------------------
- */
-
-void
-Patch::getstepsize( void )
-{
- pspec[0].minstepsize = pspec[1].minstepsize = 0;
- pspec[0].needsSubdivision = pspec[1].needsSubdivision = 0;
-
- if( mapdesc->isConstantSampling() ) {
- // fixed number of samples per patch in each direction
- // maxsrate is number of s samples per patch
- // maxtrate is number of t samples per patch
- pspec[0].getstepsize( mapdesc->maxsrate );
- pspec[1].getstepsize( mapdesc->maxtrate );
-
- } else if( mapdesc->isDomainSampling() ) {
- // maxsrate is number of s samples per unit s length of domain
- // maxtrate is number of t samples per unit t length of domain
- pspec[0].getstepsize( mapdesc->maxsrate * pspec[0].range[2] );
- pspec[1].getstepsize( mapdesc->maxtrate * pspec[1].range[2] );
-
- } else if( ! needsSampling ) {
- pspec[0].singleStep();
- pspec[1].singleStep();
- } else {
- // upper bound on path length between sample points
- REAL tmp[MAXORDER][MAXORDER][MAXCOORDS];
- const int trstride = sizeof(tmp[0]) / sizeof(REAL);
- const int tcstride = sizeof(tmp[0][0]) / sizeof(REAL);
-
- assert( pspec[0].order <= MAXORDER );
-
- /* points have been transformed, therefore they are homogeneous */
-
- int val = mapdesc->project( spts, pspec[0].stride, pspec[1].stride,
- &tmp[0][0][0], trstride, tcstride,
- pspec[0].order, pspec[1].order );
- if( val == 0 ) {
- // control points cross infinity, therefore partials are undefined
- pspec[0].getstepsize( mapdesc->maxsrate );
- pspec[1].getstepsize( mapdesc->maxtrate );
- } else {
- REAL t1 = mapdesc->getProperty( N_PIXEL_TOLERANCE );
-// REAL t2 = mapdesc->getProperty( N_ERROR_TOLERANCE );
- pspec[0].minstepsize = ( mapdesc->maxsrate > 0.0 ) ?
- (pspec[0].range[2] / mapdesc->maxsrate) : 0.0;
- pspec[1].minstepsize = ( mapdesc->maxtrate > 0.0 ) ?
- (pspec[1].range[2] / mapdesc->maxtrate) : 0.0;
- if( mapdesc->isParametricDistanceSampling() ||
- mapdesc->isObjectSpaceParaSampling() ) {
-
- REAL t2;
- t2 = mapdesc->getProperty( N_ERROR_TOLERANCE );
-
- // t2 is upper bound on the distance between surface and tessellant
- REAL ssv[2], ttv[2];
- REAL ss = mapdesc->calcPartialVelocity( ssv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 2, 0, pspec[0].range[2], pspec[1].range[2], 0 );
- REAL st = mapdesc->calcPartialVelocity( 0, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 1, 1, pspec[0].range[2], pspec[1].range[2], -1 );
- REAL tt = mapdesc->calcPartialVelocity( ttv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 0, 2, pspec[0].range[2], pspec[1].range[2], 1 );
- //make sure that ss st and tt are nonnegative:
- if(ss <0) ss = -ss;
- if(st <0) st = -st;
- if(tt <0) tt = -tt;
-
- if( ss != 0.0 && tt != 0.0 ) {
- /* printf( "ssv[0] %g ssv[1] %g ttv[0] %g ttv[1] %g\n",
- ssv[0], ssv[1], ttv[0], ttv[1] ); */
- REAL ttq = ::SQRT( (float) ss );
- REAL ssq = ::SQRT( (float) tt );
- REAL ds = ::SQRT( 4 * t2 * ttq / ( ss * ttq + st * ssq ) );
- REAL dt = ::SQRT( 4 * t2 * ssq / ( tt * ssq + st * ttq ) );
- pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2];
- REAL scutoff = 2.0 * t2 / ( pspec[0].range[2] * pspec[0].range[2]);
- pspec[0].sidestep[0] = (ssv[0] > scutoff) ? ::SQRT( 2.0 * t2 / ssv[0] ) : pspec[0].range[2];
- pspec[0].sidestep[1] = (ssv[1] > scutoff) ? ::SQRT( 2.0 * t2 / ssv[1] ) : pspec[0].range[2];
-
- pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2];
- REAL tcutoff = 2.0 * t2 / ( pspec[1].range[2] * pspec[1].range[2]);
- pspec[1].sidestep[0] = (ttv[0] > tcutoff) ? ::SQRT( 2.0 * t2 / ttv[0] ) : pspec[1].range[2];
- pspec[1].sidestep[1] = (ttv[1] > tcutoff) ? ::SQRT( 2.0 * t2 / ttv[1] ) : pspec[1].range[2];
- } else if( ss != 0.0 ) {
- REAL x = pspec[1].range[2] * st;
- REAL ds = ( ::SQRT( x * x + 8.0 * t2 * ss ) - x ) / ss;
- pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2];
- REAL scutoff = 2.0 * t2 / ( pspec[0].range[2] * pspec[0].range[2]);
- pspec[0].sidestep[0] = (ssv[0] > scutoff) ? ::SQRT( 2.0 * t2 / ssv[0] ) : pspec[0].range[2];
- pspec[0].sidestep[1] = (ssv[1] > scutoff) ? ::SQRT( 2.0 * t2 / ssv[1] ) : pspec[0].range[2];
- pspec[1].singleStep();
- } else if( tt != 0.0 ) {
- REAL x = pspec[0].range[2] * st;
- REAL dt = ( ::SQRT( x * x + 8.0 * t2 * tt ) - x ) / tt;
- pspec[0].singleStep();
- REAL tcutoff = 2.0 * t2 / ( pspec[1].range[2] * pspec[1].range[2]);
- pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2];
- pspec[1].sidestep[0] = (ttv[0] > tcutoff) ? ::SQRT( 2.0 * t2 / ttv[0] ) : pspec[1].range[2];
- pspec[1].sidestep[1] = (ttv[1] > tcutoff) ? ::SQRT( 2.0 * t2 / ttv[1] ) : pspec[1].range[2];
- } else {
- if( 4.0 * t2 > st * pspec[0].range[2] * pspec[1].range[2] ) {
- pspec[0].singleStep();
- pspec[1].singleStep();
- } else {
- REAL area = 4.0 * t2 / st;
- REAL ds = ::SQRT( area * pspec[0].range[2] / pspec[1].range[2] );
- REAL dt = ::SQRT( area * pspec[1].range[2] / pspec[0].range[2] );
- pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2];
- pspec[0].sidestep[0] = pspec[0].range[2];
- pspec[0].sidestep[1] = pspec[0].range[2];
-
- pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2];
- pspec[1].sidestep[0] = pspec[1].range[2];
- pspec[1].sidestep[1] = pspec[1].range[2];
- }
- }
- } else if( mapdesc->isPathLengthSampling() ||
- mapdesc->isObjectSpacePathSampling()) {
- // t1 is upper bound on path length
- REAL msv[2], mtv[2];
- REAL ms = mapdesc->calcPartialVelocity( msv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 1, 0, pspec[0].range[2], pspec[1].range[2], 0 );
- REAL mt = mapdesc->calcPartialVelocity( mtv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 0, 1, pspec[0].range[2], pspec[1].range[2], 1 );
- REAL side_scale = 1.0;
-
- if( ms != 0.0 ) {
- if( mt != 0.0 ) {
-/* REAL d = t1 / ( ms * ms + mt * mt );*/
-/* REAL ds = mt * d;*/
- REAL ds = t1 / (2.0*ms);
-/* REAL dt = ms * d;*/
- REAL dt = t1 / (2.0*mt);
- pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2];
- pspec[0].sidestep[0] = ( msv[0] * pspec[0].range[2] > t1 ) ? (side_scale* t1 / msv[0]) : pspec[0].range[2];
- pspec[0].sidestep[1] = ( msv[1] * pspec[0].range[2] > t1 ) ? (side_scale* t1 / msv[1]) : pspec[0].range[2];
-
- pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2];
- pspec[1].sidestep[0] = ( mtv[0] * pspec[1].range[2] > t1 ) ? (side_scale*t1 / mtv[0]) : pspec[1].range[2];
- pspec[1].sidestep[1] = ( mtv[1] * pspec[1].range[2] > t1 ) ? (side_scale*t1 / mtv[1]) : pspec[1].range[2];
- } else {
- pspec[0].stepsize = ( t1 < ms * pspec[0].range[2] ) ? (t1 / ms) : pspec[0].range[2];
- pspec[0].sidestep[0] = ( msv[0] * pspec[0].range[2] > t1 ) ? (t1 / msv[0]) : pspec[0].range[2];
- pspec[0].sidestep[1] = ( msv[1] * pspec[0].range[2] > t1 ) ? (t1 / msv[1]) : pspec[0].range[2];
-
- pspec[1].singleStep();
- }
- } else {
- if( mt != 0.0 ) {
- pspec[0].singleStep();
-
- pspec[1].stepsize = ( t1 < mt * pspec[1].range[2] ) ? (t1 / mt) : pspec[1].range[2];
- pspec[1].sidestep[0] = ( mtv[0] * pspec[1].range[2] > t1 ) ? (t1 / mtv[0]) : pspec[1].range[2];
- pspec[1].sidestep[1] = ( mtv[1] * pspec[1].range[2] > t1 ) ? (t1 / mtv[1]) : pspec[1].range[2];
- } else {
- pspec[0].singleStep();
- pspec[1].singleStep();
- }
- }
- } else if( mapdesc->isSurfaceAreaSampling() ) {
- // t is the square root of area
-/*
- REAL msv[2], mtv[2];
- REAL ms = mapdesc->calcPartialVelocity( msv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 1, 0, pspec[0].range[2], pspec[1].range[2], 0 );
- REAL mt = mapdesc->calcPartialVelocity( mtv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 0, 1, pspec[0].range[2], pspec[1].range[2], 1 );
- if( ms != 0.0 && mt != 0.0 ) {
- REAL d = 1.0 / (ms * mt);
- t *= M_SQRT2;
- REAL ds = t * ::SQRT( d * pspec[0].range[2] / pspec[1].range[2] );
- REAL dt = t * ::SQRT( d * pspec[1].range[2] / pspec[0].range[2] );
- pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2];
- pspec[0].sidestep[0] = ( msv[0] * pspec[0].range[2] > t ) ? (t / msv[0]) : pspec[0].range[2];
- pspec[0].sidestep[1] = ( msv[1] * pspec[0].range[2] > t ) ? (t / msv[1]) : pspec[0].range[2];
-
- pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2];
- pspec[1].sidestep[0] = ( mtv[0] * pspec[1].range[2] > t ) ? (t / mtv[0]) : pspec[1].range[2];
- pspec[1].sidestep[1] = ( mtv[1] * pspec[1].range[2] > t ) ? (t / mtv[1]) : pspec[1].range[2];
- } else {
- pspec[0].singleStep();
- pspec[1].singleStep();
- }
-*/
- } else {
- pspec[0].singleStep();
- pspec[1].singleStep();
- }
- }
- }
-
-#ifdef DEBUG
- dprintf( "sidesteps %g %g %g %g, stepsize %g %g\n",
- pspec[0].sidestep[0], pspec[0].sidestep[1],
- pspec[1].sidestep[0], pspec[1].sidestep[1],
- pspec[0].stepsize, pspec[1].stepsize );
-#endif
-
- if( mapdesc->minsavings != N_NOSAVINGSSUBDIVISION ) {
- REAL savings = 1./(pspec[0].stepsize * pspec[1].stepsize) ;
- savings-= (2./( pspec[0].sidestep[0] + pspec[0].sidestep[1] )) *
- (2./( pspec[1].sidestep[0] + pspec[1].sidestep[1] ));
-
- savings *= pspec[0].range[2] * pspec[1].range[2];
- if( savings > mapdesc->minsavings ) {
- pspec[0].needsSubdivision = pspec[1].needsSubdivision = 1;
- }
- }
-
- if( pspec[0].stepsize < pspec[0].minstepsize ) pspec[0].needsSubdivision = 1;
- if( pspec[1].stepsize < pspec[1].minstepsize ) pspec[1].needsSubdivision = 1;
- needsSampling = (needsSampling ? needsSamplingSubdivision() : 0);
-}
-
-void
-Patchspec::singleStep()
-{
- stepsize = sidestep[0] = sidestep[1] = abs(range[2]);
-}
-
-void
-Patchspec::getstepsize( REAL max ) // max is number of samples for entire patch
-{
- stepsize = ( max >= 1.0 ) ? range[2] / max : range[2];
- if (stepsize < 0.0) {
- stepsize = -stepsize;
- }
- sidestep[0] = sidestep[1] = minstepsize = stepsize;
-}
-
-int
-Patch::needsSamplingSubdivision( void )
-{
- return (pspec[0].needsSubdivision || pspec[1].needsSubdivision) ? 1 : 0;
-}
-
-int
-Patch::needsNonSamplingSubdivision( void )
-{
- return notInBbox;
-}
-
-int
-Patch::needsSubdivision( int param )
-{
- return pspec[param].needsSubdivision;
-}
-
-int
-Patch::cullCheck( void )
-{
- if( cullval == CULL_ACCEPT )
- cullval = mapdesc->cullCheck( cpts, pspec[0].order, pspec[0].stride,
- pspec[1].order, pspec[1].stride );
- return cullval;
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/patch.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/patch.h
deleted file mode 100755
index 1ca355ef0..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/patch.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * patch.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/patch.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glupatch_h_
-#define __glupatch_h_
-
-#include "types.h"
-#include "defines.h"
-
-class Quilt;
-class Mapdesc;
-
-
-struct Pspec {
- REAL range[3];
- REAL sidestep[2];
- REAL stepsize;
- REAL minstepsize;
- int needsSubdivision;
-};
-
-struct Patchspec : public Pspec {
- int order;
- int stride;
- void clamp( REAL );
- void getstepsize( REAL );
- void singleStep( void );
-};
-
-class Patch {
-public:
-friend class Subdivider;
-friend class Quilt;
-friend class Patchlist;
- Patch( Quilt *, REAL*, REAL *, Patch * );
- Patch( Patch &, int, REAL, Patch * );
- void bbox( void );
- void clamp( void );
- void getstepsize( void );
- int cullCheck( void );
- int needsSubdivision( int );
- int needsSamplingSubdivision( void );
- int needsNonSamplingSubdivision( void );
-
- int get_uorder() {return pspec[0].order;}
- int get_vorder() {return pspec[1].order;}
-
-private:
-
- Mapdesc* mapdesc;
- Patch* next;
- int cullval;
- int notInBbox;
- int needsSampling;
- REAL cpts[MAXORDER*MAXORDER*MAXCOORDS]; //culling pts
- REAL spts[MAXORDER*MAXORDER*MAXCOORDS]; //sampling pts
- REAL bpts[MAXORDER*MAXORDER*MAXCOORDS]; //bbox pts
- Patchspec pspec[2];
- void checkBboxConstraint( void );
- REAL bb[2][MAXCOORDS];
-};
-#endif /* __glupatch_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/patchlist.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/patchlist.cc
deleted file mode 100755
index 512ca0b80..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/patchlist.cc
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * patchlist.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/patchlist.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include <stdio.h>
-#include "glimports.h"
-#include "myassert.h"
-#include "mystdio.h"
-#include "quilt.h"
-#include "patchlist.h"
-#include "patch.h"
-#include "nurbsconsts.h"
-
-Patchlist::Patchlist( Quilt *quilts, REAL *pta, REAL *ptb )
-{
- patch = 0;
- for( Quilt *q = quilts; q; q = q->next )
- patch = new Patch( q, pta, ptb, patch );
- pspec[0].range[0] = pta[0];
- pspec[0].range[1] = ptb[0];
- pspec[0].range[2] = ptb[0] - pta[0];
-
- pspec[1].range[0] = pta[1];
- pspec[1].range[1] = ptb[1];
- pspec[1].range[2] = ptb[1] - pta[1];
-}
-
-Patchlist::Patchlist( Patchlist &upper, int param, REAL value)
-{
- Patchlist &lower = *this;
- patch = 0;
- for( Patch *p = upper.patch; p; p = p->next )
- patch = new Patch( *p, param, value, patch );
-
- if( param == 0 ) {
- lower.pspec[0].range[0] = upper.pspec[0].range[0];
- lower.pspec[0].range[1] = value;
- lower.pspec[0].range[2] = value - upper.pspec[0].range[0];
- upper.pspec[0].range[0] = value;
- upper.pspec[0].range[2] = upper.pspec[0].range[1] - value;
- lower.pspec[1] = upper.pspec[1];
- } else {
- lower.pspec[0] = upper.pspec[0];
- lower.pspec[1].range[0] = upper.pspec[1].range[0];
- lower.pspec[1].range[1] = value;
- lower.pspec[1].range[2] = value - upper.pspec[1].range[0];
- upper.pspec[1].range[0] = value;
- upper.pspec[1].range[2] = upper.pspec[1].range[1] - value;
- }
-}
-
-Patchlist::~Patchlist()
-{
- while( patch ) {
- Patch *p = patch;
- patch = patch->next;
- delete p;
- }
-}
-
-int
-Patchlist::cullCheck( void )
-{
- for( Patch *p = patch; p; p = p->next )
- if( p->cullCheck() == CULL_TRIVIAL_REJECT )
- return CULL_TRIVIAL_REJECT;
- return CULL_ACCEPT;
-}
-
-void
-Patchlist::getRanges(REAL ranges[4])
-{
- ranges[0] = pspec[0].range[0];
- ranges[1] = pspec[0].range[1];
- ranges[2] = pspec[1].range[0];
- ranges[3] = pspec[1].range[1];
-}
-
-void
-Patchlist::getstepsize( void )
-{
- pspec[0].stepsize = pspec[0].range[2];
- pspec[0].sidestep[0] = pspec[0].range[2];
- pspec[0].sidestep[1] = pspec[0].range[2];
-
- pspec[1].stepsize = pspec[1].range[2];
- pspec[1].sidestep[0] = pspec[1].range[2];
- pspec[1].sidestep[1] = pspec[1].range[2];
-
- for( Patch *p = patch; p; p = p->next ) {
- p->getstepsize();
- p->clamp();
- pspec[0].stepsize = ((p->pspec[0].stepsize < pspec[0].stepsize) ? p->pspec[0].stepsize : pspec[0].stepsize);
- pspec[0].sidestep[0] = ((p->pspec[0].sidestep[0] < pspec[0].sidestep[0]) ? p->pspec[0].sidestep[0] : pspec[0].sidestep[0]);
- pspec[0].sidestep[1] = ((p->pspec[0].sidestep[1] < pspec[0].sidestep[1]) ? p->pspec[0].sidestep[1] : pspec[0].sidestep[1]);
- pspec[1].stepsize = ((p->pspec[1].stepsize < pspec[1].stepsize) ? p->pspec[1].stepsize : pspec[1].stepsize);
- pspec[1].sidestep[0] = ((p->pspec[1].sidestep[0] < pspec[1].sidestep[0]) ? p->pspec[1].sidestep[0] : pspec[1].sidestep[0]);
- pspec[1].sidestep[1] = ((p->pspec[1].sidestep[1] < pspec[1].sidestep[1]) ? p->pspec[1].sidestep[1] : pspec[1].sidestep[1]);
- }
-}
-
-void
-Patchlist::bbox( void )
-{
- for( Patch *p = patch; p; p = p->next )
- p->bbox();
-}
-
-int
-Patchlist::needsNonSamplingSubdivision( void )
-{
- notInBbox = 0;
- for( Patch *p = patch; p; p = p->next )
- notInBbox |= p->needsNonSamplingSubdivision();
- return notInBbox;
-}
-
-int
-Patchlist::needsSamplingSubdivision( void )
-{
- pspec[0].needsSubdivision = 0;
- pspec[1].needsSubdivision = 0;
-
- for( Patch *p = patch; p; p = p->next ) {
- pspec[0].needsSubdivision |= p->pspec[0].needsSubdivision;
- pspec[1].needsSubdivision |= p->pspec[0].needsSubdivision;
- }
- return (pspec[0].needsSubdivision || pspec[1].needsSubdivision) ? 1 : 0;
-}
-
-int
-Patchlist::needsSubdivision( int param )
-{
- return pspec[param].needsSubdivision;
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/patchlist.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/patchlist.h
deleted file mode 100755
index 81bfc5b84..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/patchlist.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * patchlist.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/patchlist.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glupatchlist_h_
-#define __glupatchlist_h_
-
-#include "types.h"
-#include "defines.h"
-#include "patch.h"
-
-class Quilt;
-
-class Patchlist {
-friend class Subdivider;
-public:
- Patchlist( Quilt *, REAL *, REAL * );
- Patchlist( Patchlist &, int , REAL );
- ~Patchlist();
- void bbox();
- int cullCheck( void );
- void getstepsize( void );
- int needsNonSamplingSubdivision( void );
- int needsSamplingSubdivision( void );
- int needsSubdivision( int );
- REAL getStepsize( int );
- void getRanges(REAL ranges[4]);
-
- int get_uorder();
- int get_vorder();
-private:
- Patch *patch;
- int notInBbox;
- int needsSampling;
- Pspec pspec[2];
-};
-
-inline REAL
-Patchlist::getStepsize( int param )
-{
- return pspec[param].stepsize;
-}
-
-inline int
-Patchlist::get_uorder()
-{
- return patch->get_uorder();
-
-}
-
-inline int
- Patchlist::get_vorder()
-{
- return patch->get_vorder();
-}
-
-
-
-
-
-#endif /* __glupatchlist_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/pwlarc.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/pwlarc.h
deleted file mode 100755
index d4e598eef..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/pwlarc.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * pwlarc.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/pwlarc.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glupwlarc_h_
-#define __glupwlarc_h_
-
-#include "myassert.h"
-#include "nurbsconsts.h"
-
-class TrimVertex;
-
-class PwlArc : public PooledObj { /* a piecewise-linear arc */
-public:
- TrimVertex * pts; /* sample points */
- int npts; /* number of sample points */
- long type; /* curve type */
- inline PwlArc( void );
- inline PwlArc( int, TrimVertex * );
- inline PwlArc( int, TrimVertex *, long );
-};
-
-inline
-PwlArc::PwlArc( void )
-{
- type = N_P2D;
- pts = 0;
- npts = -1;
-}
-
-inline
-PwlArc::PwlArc( int _npts, TrimVertex *_pts )
-{
- pts = _pts;
- npts = _npts;
- type = N_P2D;
-}
-
-inline
-PwlArc::PwlArc( int _npts, TrimVertex *_pts, long _type )
-{
- pts = _pts;
- npts = _npts;
- type = _type;
-}
-
-#endif /* __glupwlarc_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/quilt.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/quilt.cc
deleted file mode 100755
index 58582014e..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/quilt.cc
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * quilt.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/quilt.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "mystdio.h"
-#include "myassert.h"
-#include "quilt.h"
-#include "backend.h"
-#include "mapdesc.h"
-#include "flist.h"
-#include "knotvector.h"
-#include "patchlist.h"
-#include "math.h" //fabs()
-#include "simplemath.h" //min()
-
-/* local preprocessor definitions */
-#define DEF_PATCH_STEPSIZE .4
-#define fsizeof(x) (sizeof(x)/sizeof(REAL))
-
-
-Quilt::Quilt( Mapdesc *_mapdesc )
-{
- mapdesc = _mapdesc;
-}
-
-void
-Quilt::deleteMe( Pool& p )
-{
- for( Quiltspec *q=qspec; q != eqspec; q++ ) {
-#if 1
- if( q->breakpoints) delete[] q->breakpoints; q->breakpoints = 0;
-#else
- if( q->breakpoints) {
- delete[] q->breakpoints;
- q->breakpoints = 0;
-printf("in here\n");
- }
-#endif
- }
- if( cpts ) delete[] cpts;
- cpts = 0;
- PooledObj::deleteMe( p );
-}
-
-void
-Quilt::show( void )
-{
-#ifndef NDEBUG
- int nc = mapdesc->getNcoords();
- REAL *ps = cpts;
- ps += qspec[0].offset;
- ps += qspec[1].offset;
- for( int i=0; i!= qspec[0].order * qspec[0].width; i++ ) {
- for( int j = 0; j!= qspec[1].order * qspec[1].width; j++ ) {
- for( int k=0; k < nc; k++ )
- dprintf( "%g ", ps[i*qspec[0].stride + j*qspec[1].stride + k] );
- dprintf( "\n" );
- }
- dprintf( "\n" );
- }
- dprintf( "\n" );
-#endif
-}
-
-/*--------------------------------------------------------------------------
- * Quilt::select - find which map in each quilt contains the points
- * pta and ptb with pta[i] < ptb[i]
- *--------------------------------------------------------------------------
- */
-
-void
-Quilt::select( REAL *pta, REAL *ptb )
-{
- int dim = eqspec - qspec;
- int i, j;
- for( i=0; i<dim; i++) {
- for( j=qspec[i].width-1; j>=0; j-- )
- if( (qspec[i].breakpoints[j] <= pta[i] ) &&
- (ptb[i] <= qspec[i].breakpoints[j+1] ) )
- break;
- assert( j != -1 );
- qspec[i].index = j;
- }
-}
-
-void
-Quilt::download( Backend &backend )
-{
- if( getDimension() == 2 ) {
- REAL *ps = cpts;
- ps += qspec[0].offset;
- ps += qspec[1].offset;
- ps += qspec[0].index * qspec[0].order * qspec[0].stride;
- ps += qspec[1].index * qspec[1].order * qspec[1].stride;
- backend.surfpts( mapdesc->getType(), ps,
- qspec[0].stride,
- qspec[1].stride,
- qspec[0].order,
- qspec[1].order,
- qspec[0].breakpoints[qspec[0].index],
- qspec[0].breakpoints[qspec[0].index+1],
- qspec[1].breakpoints[qspec[1].index],
- qspec[1].breakpoints[qspec[1].index+1] );
- } else {
- REAL *ps = cpts;
- ps += qspec[0].offset;
- ps += qspec[0].index * qspec[0].order * qspec[0].stride;
- backend.curvpts( mapdesc->getType(), ps,
- qspec[0].stride,
- qspec[0].order,
- qspec[0].breakpoints[qspec[0].index],
- qspec[0].breakpoints[qspec[0].index+1] );
- }
-}
-
-/*--------------------------------------------------------------------------
- * Quilt::downloadAll - download each map that contains the current patch
- *--------------------------------------------------------------------------
- */
-
-void
-Quilt::downloadAll( REAL *pta, REAL *ptb, Backend &backend )
-{
- for( Quilt *m = this; m; m=m->next ) {
- m->select( pta, ptb );
- m->download( backend );
- }
-}
-
-/*--------------------------------------------------------------------------
- * Quilt::isCulled - determine if an entire quilt is trivially rejected.
- *--------------------------------------------------------------------------
- */
-
-int
-Quilt::isCulled( void )
-{
- if( mapdesc->isCulling() )
- return mapdesc->xformAndCullCheck( cpts + qspec[0].offset + qspec[1].offset,
- qspec[0].order * qspec[0].width, qspec[0].stride,
- qspec[1].order * qspec[1].width, qspec[1].stride );
- else
- return CULL_ACCEPT;
-}
-
-/*---------------------------------------------------------------------------
- * Quilt::getRange - retrieve the valid paramater range of a set of quilts
- *---------------------------------------------------------------------------
- */
-void
-Quilt::getRange( REAL *from, REAL *to, Flist& slist, Flist &tlist )
-{
- getRange( from, to, 0, slist );
- getRange( from, to, 1, tlist );
-}
-
-/*---------------------------------------------------------------------------
- * Quilt::getRange - retrieve the valid paramater range of a set of quilts
- *---------------------------------------------------------------------------
- */
-void
-Quilt::getRange( REAL *from, REAL *to, int i, Flist &list )
-{
- Quilt *maps = this;
- from[i] = maps->qspec[i].breakpoints[0];
- to[i] = maps->qspec[i].breakpoints[maps->qspec[i].width];
- int maxpts = 0;
- Quilt_ptr m;
- for( m=maps; m; m=m->next ) {
- if( m->qspec[i].breakpoints[0] > from[i] )
- from[i] = m->qspec[i].breakpoints[0];
- if( m->qspec[i].breakpoints[m->qspec[i].width] < to[i] )
- to[i] = m->qspec[i].breakpoints[m->qspec[i].width];
- maxpts += m->qspec[i].width + 1;
- }
-
- list.grow( maxpts );
-
- for( m=maps; m; m=m->next )
- for( int j=0; j<=m->qspec[i].width; j++ ) {
- list.add( m->qspec[i].breakpoints[j] );
- }
-
- list.filter( );
- list.taper( from[i], to[i] );
-}
-
-void
-Quilt::getRange( REAL *from, REAL *to, Flist& slist )
-{
- getRange( from, to, 0, slist );
-}
-
-void
-Quilt::findRates( Flist& slist, Flist& tlist, REAL rate[2] )
-{
- findSampleRates( slist, tlist );
- rate[0] = qspec[0].step_size;
- rate[1] = qspec[1].step_size;
-
- for( Quilt *q = next; q; q = q->next ) {
- q->findSampleRates( slist, tlist );
- if( q->qspec[0].step_size < rate[0] )
- rate[0] = q->qspec[0].step_size;
- if( q->qspec[1].step_size < rate[1] )
- rate[1] = q->qspec[1].step_size;
- }
-}
-
-void
-Quilt::findSampleRates( Flist& slist, Flist& tlist )
-{
- qspec[0].step_size = DEF_PATCH_STEPSIZE *
- (qspec[0].breakpoints[qspec[0].width] - qspec[0].breakpoints[0]);
- qspec[1].step_size = DEF_PATCH_STEPSIZE *
- (qspec[1].breakpoints[qspec[1].width] - qspec[1].breakpoints[0]);
-
- for( int i = slist.start; i < slist.end-1; i++ ) {
- for( int j = tlist.start; j < tlist.end-1; j++ ) {
-
- REAL pta[2], ptb[2];
- pta[0] = slist.pts[i];
- ptb[0] = slist.pts[i+1];
- pta[1] = tlist.pts[j];
- ptb[1] = tlist.pts[j+1];
- Patchlist patchlist( this, pta, ptb );
- patchlist.getstepsize();
-
- {
- float edge_len_s = min(fabs(ptb[0]-pta[0]),1.0);
- float edge_len_t = min(fabs(ptb[1]-pta[1]),1.0);
-
- if( patchlist.getStepsize(0)/edge_len_s < qspec[0].step_size )
- qspec[0].step_size = patchlist.getStepsize(0)/edge_len_s;
- if( patchlist.getStepsize(1)/edge_len_t < qspec[1].step_size )
- qspec[1].step_size = patchlist.getStepsize(1)/edge_len_t;
- }
- }
- }
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/quilt.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/quilt.h
deleted file mode 100755
index b1ef6302b..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/quilt.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * quilt.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/quilt.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gluquilt_h_
-#define __gluquilt_h_
-
-#include "defines.h"
-#include "bufpool.h"
-#include "types.h"
-
-class Backend;
-class Mapdesc;
-class Flist;
-class Knotvector;
-
-/* constants for memory allocation of NURBS to Bezier conversion */
-#define MAXDIM 2
-
-struct Quiltspec { /* a specification for a dimension of a quilt */
- int stride; /* words between points */
- int width; /* number of segments */
- int offset; /* words to first point */
- int order; /* order */
- int index; /* current segment number */
- int bdry[2]; /* boundary edge flag */
- REAL step_size;
- Knot * breakpoints;
-};
-
-typedef Quiltspec *Quiltspec_ptr;
-
-class Quilt : public PooledObj { /* an array of bezier patches */
-public:
- Quilt( Mapdesc * );
- Mapdesc * mapdesc; /* map descriptor */
- REAL * cpts; /* control points */
- Quiltspec qspec[MAXDIM]; /* the dimensional data */
- Quiltspec_ptr eqspec; /* qspec trailer */
- Quilt *next; /* next quilt in linked list */
-
-public:
- void deleteMe( Pool& );
- void toBezier( Knotvector &, INREAL *, long );
- void toBezier( Knotvector &, Knotvector &, INREAL *, long );
- void select( REAL *, REAL * );
- int getDimension( void ) { return eqspec - qspec; }
- void download( Backend & );
- void downloadAll( REAL *, REAL *, Backend & );
- int isCulled( void );
- void getRange( REAL *, REAL *, Flist&, Flist & );
- void getRange( REAL *, REAL *, int, Flist & );
- void getRange( REAL *, REAL *, Flist& );
- void findRates( Flist& slist, Flist& tlist, REAL[2] );
- void findSampleRates( Flist& slist, Flist& tlist );
- void show();
-};
-
-typedef class Quilt *Quilt_ptr;
-
-#endif /* __gluquilt_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/reader.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/reader.cc
deleted file mode 100755
index 3f77898dd..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/reader.cc
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * reader.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/reader.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include <stdio.h>
-#include "glimports.h"
-#include "nurbsconsts.h"
-#include "reader.h"
-#include "trimvertex.h"
-#include "simplemath.h"
-
-//when read a pwlCurve, if two consecutive points are the same, then
-//eliminate one of them. This makes the tessellator more robust. The spec
-//assumes the application makes sure there are no redundant points.
-//but in Inspector, the trim curves seem to have redundant points a lot.
-//I guess other similar users may have the same problem.
-
-#define ELIMINATE_REDUNDANT_POINTS
-
-#ifdef ELIMINATE_REDUNDANT_POINTS
-#define equal(x,y) ( abs(x-y) <= 0.00001)
-#endif
-
-#ifdef ELIMINATE_REDUNDANT_POINTS
-O_pwlcurve::O_pwlcurve( long _type, long count, INREAL *array, long byte_stride, TrimVertex *trimpts )
-{
- next = 0;
- used = 0;
- owner = 0;
- pts = trimpts;
- npts = (int) count;
- int i;
-
- /* copy user data into internal trimming data structures */
- switch( _type ) {
- case N_P2D: {
- TrimVertex *v = pts;
- TrimVertex *prev = NULL;
- int num = 0;
- int doit;
- for(i=0; i<count; i++) {
- doit = 1;
- if(prev != NULL)
- {
- if(equal(prev->param[0], array[0]) && equal(prev->param[1], array[1]))
- {
- doit = 0;
- }
- }
-
- if(doit)
- {
- v->param[0] = (REAL) array[0];
- v->param[1] = (REAL) array[1];
- prev = v;
- v++;
- num++;
- }
- array = (INREAL *) (((char *) array) + byte_stride);
- }
- npts = num;
- break;
- }
- case N_P2DR: {
- TrimVertex *v = pts;
- for( TrimVertex *lastv = v + count; v != lastv; v++ ) {
- v->param[0] = (REAL) array[0] / (REAL) array[2];
- v->param[1] = (REAL) array[1] / (REAL) array[2];
- array = (INREAL *) (((char *) array) + byte_stride);
- }
- break;
- }
- }
-}
-#else
-O_pwlcurve::O_pwlcurve( long _type, long count, INREAL *array, long byte_stride, TrimVertex *trimpts )
-{
- next = 0;
- used = 0;
- owner = 0;
- pts = trimpts;
- npts = (int) count;
-
- /* copy user data into internal trimming data structures */
- switch( _type ) {
- case N_P2D: {
- TrimVertex *v = pts;
- for( TrimVertex *lastv = v + count; v != lastv; v++ ) {
- v->param[0] = (REAL) array[0];
- v->param[1] = (REAL) array[1];
- array = (INREAL *) (((char *) array) + byte_stride);
- }
- break;
- }
- case N_P2DR: {
- TrimVertex *v = pts;
- for( TrimVertex *lastv = v + count; v != lastv; v++ ) {
- v->param[0] = (REAL) array[0] / (REAL) array[2];
- v->param[1] = (REAL) array[1] / (REAL) array[2];
- array = (INREAL *) (((char *) array) + byte_stride);
- }
- break;
- }
- }
-}
-#endif
-
-
-
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/reader.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/reader.h
deleted file mode 100755
index 77b2240b8..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/reader.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * reader.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/reader.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glureader_h_
-#define __glureader_h_
-
-#include "bufpool.h"
-#include "types.h"
-
-enum Curvetype { ct_nurbscurve, ct_pwlcurve, ct_none };
-
-struct Property;
-struct O_surface;
-struct O_nurbssurface;
-struct O_trim;
-struct O_pwlcurve;
-struct O_nurbscurve;
-struct O_curve;
-class Quilt;
-class TrimVertex;
-
-
-struct O_curve : public PooledObj {
- union {
- O_nurbscurve *o_nurbscurve;
- O_pwlcurve *o_pwlcurve;
- } curve;
- Curvetype curvetype; /* arc type: pwl or nurbs */
- O_curve * next; /* next arc in loop */
- O_surface * owner; /* owning surface */
- int used; /* curve called in cur surf */
- int save; /* 1 if in display list */
- long nuid;
- O_curve() { next = 0; used = 0; owner = 0;
- curve.o_pwlcurve = 0; }
- };
-
-struct O_nurbscurve : public PooledObj {
- Quilt *bezier_curves; /* array of bezier curves */
- long type; /* range descriptor */
- REAL tesselation; /* tesselation tolerance */
- int method; /* tesselation method */
- O_nurbscurve * next; /* next curve in list */
- int used; /* curve called in cur surf */
- int save; /* 1 if in display list */
- O_curve * owner; /* owning curve */
- O_nurbscurve( long _type )
- { type = _type; owner = 0; next = 0; used = 0; }
- };
-
-class O_pwlcurve : public PooledObj {
-public:
- TrimVertex *pts; /* array of trim vertices */
- int npts; /* number of trim vertices */
- O_pwlcurve * next; /* next curve in list */
- int used; /* curve called in cur surf */
- int save; /* 1 if in display list */
- O_curve * owner; /* owning curve */
- O_pwlcurve( long, long, INREAL *, long, TrimVertex * );
- };
-
-struct O_trim : public PooledObj {
- O_curve *o_curve; /* closed trim loop */
- O_trim * next; /* next loop along trim */
- int save; /* 1 if in display list */
- O_trim() { next = 0; o_curve = 0; }
- };
-
-struct O_nurbssurface : public PooledObj {
- Quilt * bezier_patches;/* array of bezier patches */
- long type; /* range descriptor */
- O_surface * owner; /* owning surface */
- O_nurbssurface * next; /* next surface in chain */
- int save; /* 1 if in display list */
- int used; /* 1 if prev called in block */
- O_nurbssurface( long _type )
- { type = _type; owner = 0; next = 0; used = 0; }
- };
-
-struct O_surface : public PooledObj {
- O_nurbssurface * o_nurbssurface; /* linked list of surfaces */
- O_trim * o_trim; /* list of trim loops */
- int save; /* 1 if in display list */
- long nuid;
- O_surface() { o_trim = 0; o_nurbssurface = 0; }
- };
-
-struct Property : public PooledObj {
- long type;
- long tag;
- REAL value;
- int save; /* 1 if in display list */
- Property( long _type, long _tag, INREAL _value )
- { type = _type; tag = _tag; value = (REAL) _value; }
- Property( long _tag, INREAL _value )
- { type = 0; tag = _tag; value = (REAL) _value; }
- };
-
-class NurbsTessellator;
-#endif /* __glureader_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/renderhints.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/renderhints.cc
deleted file mode 100755
index 4cc5c7c54..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/renderhints.cc
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * renderhints.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/renderhints.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "mystdio.h"
-#include "renderhints.h"
-#include "defines.h"
-#include "nurbsconsts.h"
-
-
-/*--------------------------------------------------------------------------
- * Renderhints::Renderhints - set all window specific options
- *--------------------------------------------------------------------------
- */
-Renderhints::Renderhints()
-{
- display_method = N_FILL;
- errorchecking = N_MSG;
- subdivisions = 6.0;
- tmp1 = 0.0;
-}
-
-void
-Renderhints::init( void )
-{
- maxsubdivisions = (int) subdivisions;
- if( maxsubdivisions < 0 ) maxsubdivisions = 0;
-
-
- if( display_method == N_FILL ) {
- wiretris = 0;
- wirequads = 0;
- } else if( display_method == N_OUTLINE_TRI ) {
- wiretris = 1;
- wirequads = 0;
- } else if( display_method == N_OUTLINE_QUAD ) {
- wiretris = 0;
- wirequads = 1;
- } else {
- wiretris = 1;
- wirequads = 1;
- }
-}
-
-int
-Renderhints::isProperty( long property )
-{
- switch ( property ) {
- case N_DISPLAY:
- case N_ERRORCHECKING:
- case N_SUBDIVISIONS:
- case N_TMP1:
- return 1;
- default:
- return 0;
- }
-}
-
-REAL
-Renderhints::getProperty( long property )
-{
- switch ( property ) {
- case N_DISPLAY:
- return display_method;
- case N_ERRORCHECKING:
- return errorchecking;
- case N_SUBDIVISIONS:
- return subdivisions;
- case N_TMP1:
- return tmp1;
- default:
- abort();
- return -1; //not necessary, needed to shut up compiler
- }
-}
-
-void
-Renderhints::setProperty( long property, REAL value )
-{
- switch ( property ) {
- case N_DISPLAY:
- display_method = value;
- break;
- case N_ERRORCHECKING:
- errorchecking = value;
- break;
- case N_SUBDIVISIONS:
- subdivisions = value;
- break;
- case N_TMP1: /* unused */
- tmp1 = value;
- break;
- default:
- abort();
- break;
- }
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/renderhints.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/renderhints.h
deleted file mode 100755
index ce82e00dd..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/renderhints.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * renderhints.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/renderhints.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glurenderhints_h_
-#define __glurenderhints_h_
-
-#include "types.h"
-
-class Renderhints {
-public:
- Renderhints( void );
- void init( void );
- int isProperty( long );
- REAL getProperty( long );
- void setProperty( long, REAL );
-
- REAL display_method; /* display mode */
- REAL errorchecking; /* activate error checking */
- REAL subdivisions; /* maximum number of subdivisions per patch */
- REAL tmp1; /* unused */
-
- int displaydomain;
- int maxsubdivisions;
- int wiretris;
- int wirequads;
-};
-
-#endif /* __glurenderhints_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/simplemath.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/simplemath.h
deleted file mode 100755
index 31300f473..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/simplemath.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * simplemath.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/simplemath.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glusimplemath_h_
-#define __glusimplemath_h_
-
-/* simple inline routines */
-
-inline int
-max( int x, int y ) { return ( x < y ) ? y : x; }
-
-inline REAL
-min( REAL x, REAL y ) { return ( x > y ) ? y : x; }
-
-inline REAL
-abs( REAL x ) { return ( x < 0.0 ) ? -x : x; }
-
-#endif /* __glusimplemath_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/slicer.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/slicer.cc
deleted file mode 100755
index 464b38897..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/slicer.cc
+++ /dev/null
@@ -1,1287 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * slicer.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/slicer.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-#include "glimports.h"
-#include "mystdio.h"
-#include "myassert.h"
-#include "bufpool.h"
-#include "slicer.h"
-#include "backend.h"
-#include "arc.h"
-#include "gridtrimvertex.h"
-#include "trimvertex.h"
-#include "varray.h"
-
-#include "polyUtil.h" //for area()
-
-//static int count=0;
-
-/*USE_OPTTT is initiated in trimvertex.h*/
-
-#ifdef USE_OPTTT
- #include <GL/gl.h>
-#endif
-
-//#define USE_READ_FLAG //whether to use new or old tesselator
- //if defined, it reads "flagFile",
- // if the number is 1, then use new tess
- // otherwise, use the old tess.
- //if not defined, then use new tess.
-#ifdef USE_READ_FLAG
-static Int read_flag(char* name);
-Int newtess_flag = read_flag("flagFile");
-#endif
-
-//#define COUNT_TRIANGLES
-#ifdef COUNT_TRIANGLES
-Int num_triangles = 0;
-Int num_quads = 0;
-#endif
-
-#define max(a,b) ((a>b)? a:b)
-#define ZERO 0.00001 /*determing whether a loop is a rectngle or not*/
-#define equalRect(a,b) ((fabs(a-b) <= ZERO)? 1:0) //only used in tessellating a rectangle
-
-static Int is_Convex(Arc_ptr loop)
-{
- if(area(loop->tail(), loop->head(), loop->next->head()) <0 )
- return 0;
- for(Arc_ptr jarc = loop->next; jarc != loop; jarc = jarc->next)
- {
- if(area(jarc->tail(), jarc->head(), jarc->next->head()) < 0)
- return 0;
- }
- return 1;
-}
-
-/******triangulate a monotone polygon**************/
-#include "monoTriangulation.h"
-static int is_U_monotone(Arc_ptr loop)
-{
- int n_changes=0;
- int prev_sign;
- int cur_sign;
- Arc_ptr temp;
-
- cur_sign = compV2InX(loop->head(), loop->tail());
-
- n_changes = (compV2InX(loop->prev->head(), loop->prev->tail())
- != cur_sign);
-
- for(temp=loop->next; temp != loop; temp = temp->next)
- {
- prev_sign = cur_sign;
- cur_sign = compV2InX(temp->head(), temp->tail());
- if(cur_sign != prev_sign)
- {
-#ifdef DEBUG
- printf("***change signe\n");
-#endif
- n_changes++;
- }
- }
- if(n_changes == 2) return 1;
- else
- return 0;
-}
-
-inline int compInY(REAL a[2], REAL b[2])
-{
- if(a[1] < b[1])
- return -1;
- else if (a[1] > b[1])
- return 1;
- else if(a[0] > b[0])
- return 1;
- else return -1;
-}
-
-void monoTriangulationLoop(Arc_ptr loop, Backend& backend, primStream* pStream)
-{
- int i;
- //find the top, bottom, increasing and decreasing chain
- //then call monoTrianulation
- Arc_ptr jarc, temp;
- Arc_ptr top;
- Arc_ptr bot;
- top = bot = loop;
- if(compInY(loop->tail(), loop->prev->tail()) < 0)
- {
- //first find bot
- for(temp = loop->next; temp != loop; temp = temp->next)
- {
- if(compInY(temp->tail(), temp->prev->tail()) > 0)
- break;
- }
- bot = temp->prev;
- //then find top
- for(temp=loop->prev; temp != loop; temp = temp->prev)
- {
- if(compInY(temp->tail(), temp->prev->tail()) > 0)
- break;
- }
- top = temp;
- }
- else //loop > loop->prev
- {
- for(temp=loop->next; temp != loop; temp = temp->next)
- {
- if(compInY(temp->tail(), temp->prev->tail()) < 0)
- break;
- }
- top = temp->prev;
- for(temp=loop->prev; temp != loop; temp = temp->prev)
- {
- if(compInY(temp->tail(), temp->prev->tail()) < 0)
- break;
- }
- bot = temp;
- }
- //creat increase and decrease chains
- vertexArray inc_chain(50); //this is a dynamci array
- for(i=1; i<=top->pwlArc->npts-2; i++)
- {
- //the first vertex is the top which doesn't below to inc_chain
- inc_chain.appendVertex(top->pwlArc->pts[i].param);
- }
- for(jarc=top->next; jarc != bot; jarc = jarc->next)
- {
- for(i=0; i<=jarc->pwlArc->npts-2; i++)
- {
- inc_chain.appendVertex(jarc->pwlArc->pts[i].param);
- }
-
- }
- vertexArray dec_chain(50);
- for(jarc = top->prev; jarc != bot; jarc = jarc->prev)
- {
- for(i=jarc->pwlArc->npts-2; i>=0; i--)
- {
- dec_chain.appendVertex(jarc->pwlArc->pts[i].param);
- }
- }
- for(i=bot->pwlArc->npts-2; i>=1; i--)
- {
- dec_chain.appendVertex(jarc->pwlArc->pts[i].param);
- }
-
- monoTriangulationRec(top->tail(), bot->tail(), &inc_chain, 0,
- &dec_chain, 0, &backend);
-
-}
-
-/********tesselate a rectanlge (OPTIMIZATION**************/
-static void triangulateRectGen(Arc_ptr loop, int n_ulines, int n_vlines, Backend& backend);
-
-static Int is_rect(Arc_ptr loop)
-{
- Int nlines =1;
- for(Arc_ptr jarc = loop->next; jarc != loop; jarc = jarc->next)
- {
- nlines++;
- if(nlines == 5)
- break;
- }
- if(nlines != 4)
- return 0;
-
-
-/*
-printf("here1\n");
-printf("loop->tail=(%f,%f)\n", loop->tail()[0], loop->tail()[1]);
-printf("loop->head=(%f,%f)\n", loop->head()[0], loop->head()[1]);
-printf("loop->next->tail=(%f,%f)\n", loop->next->tail()[0], loop->next->tail()[1]);
-printf("loop->next->head=(%f,%f)\n", loop->next->head()[0], loop->next->head()[1]);
-if(fabs(loop->tail()[0] - loop->head()[0])<0.000001)
- printf("equal 1\n");
-if(loop->next->tail()[1] == loop->next->head()[1])
- printf("equal 2\n");
-*/
-
- if( (fabs(loop->tail()[0] - loop->head()[0])<=ZERO) &&
- (fabs(loop->next->tail()[1] - loop->next->head()[1])<=ZERO) &&
- (fabs(loop->prev->tail()[1] - loop->prev->head()[1])<=ZERO) &&
- (fabs(loop->prev->prev->tail()[0] - loop->prev->prev->head()[0])<=ZERO)
- )
- return 1;
- else if
- ( (fabs(loop->tail()[1] - loop->head()[1]) <= ZERO) &&
- (fabs(loop->next->tail()[0] - loop->next->head()[0]) <= ZERO) &&
- (fabs(loop->prev->tail()[0] - loop->prev->head()[0]) <= ZERO) &&
- (fabs(loop->prev->prev->tail()[1] - loop->prev->prev->head()[1]) <= ZERO)
- )
- return 1;
- else
- return 0;
-}
-
-
-//a line with the same u for opt
-static void evalLineNOGE_BU(TrimVertex *verts, int n, Backend& backend)
-{
- int i;
- backend.preEvaluateBU(verts[0].param[0]);
- for(i=0; i<n; i++)
- backend.tmeshvertNOGE_BU(&verts[i]);
-}
-
-//a line with the same v for opt
-static void evalLineNOGE_BV(TrimVertex *verts, int n, Backend& backend)
-{
- int i;
- backend.preEvaluateBV(verts[0].param[1]);
-
- for(i=0; i<n; i++)
- backend.tmeshvertNOGE_BV(&verts[i]);
-}
-static void evalLineNOGE(TrimVertex *verts, int n, Backend& backend)
-{
-
- if(verts[0].param[0] == verts[n-1].param[0]) //all u;s are equal
- evalLineNOGE_BU(verts, n, backend);
- else if(verts[0].param[1] == verts[n-1].param[1]) //all v's are equal
- evalLineNOGE_BV(verts, n, backend);
- else
- {
- int i;
- for(i=0; i<n; i++)
- backend.tmeshvertNOGE(&verts[i]);
- }
-}
-
-
-inline void OPT_OUTVERT(TrimVertex& vv, Backend& backend)
-{
-
-#ifdef USE_OPTTT
- glNormal3fv(vv.cache_normal);
- glVertex3fv(vv.cache_point);
-#else
-
- backend.tmeshvert(&vv);
-
-#endif
-
-}
-
-static void triangulateRectAux(PwlArc* top, PwlArc* bot, PwlArc* left, PwlArc* right, Backend& backend);
-
-static void triangulateRect(Arc_ptr loop, Backend& backend, int TB_or_LR, int ulinear, int vlinear)
-{
- int i;
- //we know the loop is a rectangle, but not sure which is top
- Arc_ptr top, bot, left, right;
- if(loop->tail()[1] == loop->head()[1])
- {
- if(loop->tail()[1] > loop->prev->prev->tail()[1])
- {
-
- top = loop;
- }
- else{
-
- top = loop->prev->prev;
- }
- }
- else
- {
- if(loop->tail()[0] > loop->prev->prev->tail()[0])
- {
- //loop is the right arc
-
- top = loop->next;
- }
- else
- {
-
- top = loop->prev;
- }
- }
- left = top->next;
- bot = left->next;
- right= bot->next;
-
- //if u, v are both nonlinear, then if the
- //boundary is tessellated dense, we also
- //sample the inside to get a better tesslletant.
- if( (!ulinear) && (!vlinear))
- {
- int nu = top->pwlArc->npts;
- if(nu < bot->pwlArc->npts)
- nu = bot->pwlArc->npts;
- int nv = left->pwlArc->npts;
- if(nv < right->pwlArc->npts)
- nv = right->pwlArc->npts;
-/*
- if(nu > 2 && nv > 2)
- {
- triangulateRectGen(top, nu-2, nv-2, backend);
- return;
- }
-*/
- }
-
- if(TB_or_LR == 1)
- triangulateRectAux(top->pwlArc, bot->pwlArc, left->pwlArc, right->pwlArc, backend);
- else if(TB_or_LR == -1)
- triangulateRectAux(left->pwlArc, right->pwlArc, bot->pwlArc, top->pwlArc, backend);
- else
- {
- Int maxPointsTB = top->pwlArc->npts + bot->pwlArc->npts;
- Int maxPointsLR = left->pwlArc->npts + right->pwlArc->npts;
-
- if(maxPointsTB < maxPointsLR)
- triangulateRectAux(left->pwlArc, right->pwlArc, bot->pwlArc, top->pwlArc, backend);
- else
- triangulateRectAux(top->pwlArc, bot->pwlArc, left->pwlArc, right->pwlArc, backend);
- }
-}
-
-static void triangulateRectAux(PwlArc* top, PwlArc* bot, PwlArc* left, PwlArc* right, Backend& backend)
-{ //if(maxPointsTB >= maxPointsLR)
- {
-
- Int d, topd_left, topd_right, botd_left, botd_right, i,j;
- d = left->npts /2;
-
-#ifdef USE_OPTTT
- evalLineNOGE(top->pts, top->npts, backend);
- evalLineNOGE(bot->pts, bot->npts, backend);
- evalLineNOGE(left->pts, left->npts, backend);
- evalLineNOGE(right->pts, right->npts, backend);
-#endif
-
- if(top->npts == 2) {
- backend.bgntfan();
- OPT_OUTVERT(top->pts[0], backend);//the root
- for(i=0; i<left->npts; i++){
- OPT_OUTVERT(left->pts[i], backend);
- }
- for(i=1; i<= bot->npts-2; i++){
- OPT_OUTVERT(bot->pts[i], backend);
- }
- backend.endtfan();
-
- backend.bgntfan();
- OPT_OUTVERT(bot->pts[bot->npts-2], backend);
- for(i=0; i<right->npts; i++){
- OPT_OUTVERT(right->pts[i], backend);
- }
- backend.endtfan();
- }
- else if(bot->npts == 2) {
- backend.bgntfan();
- OPT_OUTVERT(bot->pts[0], backend);//the root
- for(i=0; i<right->npts; i++){
- OPT_OUTVERT(right->pts[i], backend);
- }
- for(i=1; i<= top->npts-2; i++){
- OPT_OUTVERT(top->pts[i], backend);
- }
- backend.endtfan();
-
- backend.bgntfan();
- OPT_OUTVERT(top->pts[top->npts-2], backend);
- for(i=0; i<left->npts; i++){
- OPT_OUTVERT(left->pts[i], backend);
- }
- backend.endtfan();
- }
- else { //both top and bot have >=3 points
-
- backend.bgntfan();
-
- OPT_OUTVERT(top->pts[top->npts-2], backend);
-
- for(i=0; i<=d; i++)
- {
- OPT_OUTVERT(left->pts[i], backend);
- }
- backend.endtfan();
-
- backend.bgntfan();
-
- OPT_OUTVERT(bot->pts[1], backend);
-
- OPT_OUTVERT(top->pts[top->npts-2], backend);
-
- for(i=d; i< left->npts; i++)
- {
- OPT_OUTVERT(left->pts[i], backend);
- }
- backend.endtfan();
-
- d = right->npts/2;
- //output only when d<right->npts-1 and
- //
- if(d<right->npts-1)
- {
- backend.bgntfan();
- // backend.tmeshvert(& top->pts[1]);
- OPT_OUTVERT(top->pts[1], backend);
- for(i=d; i< right->npts; i++)
- {
- // backend.tmeshvert(& right->pts[i]);
-
- OPT_OUTVERT(right->pts[i], backend);
-
- }
- backend.endtfan();
- }
-
- backend.bgntfan();
- // backend.tmeshvert(& bot->pts[bot->npts-2]);
- OPT_OUTVERT( bot->pts[bot->npts-2], backend);
- for(i=0; i<=d; i++)
- {
- // backend.tmeshvert(& right->pts[i]);
- OPT_OUTVERT(right->pts[i], backend);
-
- }
-
- // backend.tmeshvert(& top->pts[1]);
- OPT_OUTVERT(top->pts[1], backend);
-
- backend.endtfan();
-
-
- topd_left = top->npts-2;
- topd_right = 1; //topd_left>= topd_right
-
- botd_left = 1;
- botd_right = bot->npts-2; //botd_left<= bot_dright
-
-
- if(top->npts < bot->npts)
- {
- int delta=bot->npts - top->npts;
- int u = delta/2;
- botd_left = 1+ u;
- botd_right = bot->npts-2-( delta-u);
-
- if(botd_left >1)
- {
- backend.bgntfan();
- // backend.tmeshvert(& top->pts[top->npts-2]);
- OPT_OUTVERT(top->pts[top->npts-2], backend);
- for(i=1; i<= botd_left; i++)
- {
- // backend.tmeshvert(& bot->pts[i]);
- OPT_OUTVERT(bot->pts[i] , backend);
- }
- backend.endtfan();
- }
- if(botd_right < bot->npts-2)
- {
- backend.bgntfan();
- OPT_OUTVERT(top->pts[1], backend);
- for(i=botd_right; i<= bot->npts-2; i++)
- OPT_OUTVERT(bot->pts[i], backend);
- backend.endtfan();
- }
- }
- else if(top->npts> bot->npts)
- {
- int delta=top->npts-bot->npts;
- int u = delta/2;
- topd_left = top->npts-2 - u;
- topd_right = 1+delta-u;
-
- if(topd_left < top->npts-2)
- {
- backend.bgntfan();
- // backend.tmeshvert(& bot->pts[1]);
- OPT_OUTVERT(bot->pts[1], backend);
- for(i=topd_left; i<= top->npts-2; i++)
- {
- // backend.tmeshvert(& top->pts[i]);
- OPT_OUTVERT(top->pts[i], backend);
- }
- backend.endtfan();
- }
- if(topd_right > 1)
- {
- backend.bgntfan();
- OPT_OUTVERT(bot->pts[bot->npts-2], backend);
- for(i=1; i<= topd_right; i++)
- OPT_OUTVERT(top->pts[i], backend);
- backend.endtfan();
- }
- }
-
- if(topd_left <= topd_right)
- return;
-
- backend.bgnqstrip();
- for(j=botd_left, i=topd_left; i>=topd_right; i--,j++)
- {
- // backend.tmeshvert(& top->pts[i]);
- // backend.tmeshvert(& bot->pts[j]);
- OPT_OUTVERT(top->pts[i], backend);
- OPT_OUTVERT(bot->pts[j], backend);
- }
- backend.endqstrip();
-
- }
- }
-}
-
-
-static void triangulateRectCenter(int n_ulines, REAL* u_val,
- int n_vlines, REAL* v_val,
- Backend& backend)
-{
- TrimVertex trimVert;
- trimVert.nuid = 0;//????
-
- backend.surfgrid(u_val[0], u_val[n_ulines-1], n_ulines-1,
- v_val[n_vlines-1], v_val[0], n_vlines-1);
-
- if(n_ulines>1 && n_vlines>1)
- backend.surfmesh(0,0,n_ulines-1,n_vlines-1);
-
- return;
-
- /*
- for(i=0; i<n_vlines-1; i++)
- {
-
- backend.bgnqstrip();
- for(j=0; j<n_ulines; j++)
- {
- trimVert.param[0] = u_val[j];
- trimVert.param[1] = v_val[i+1];
- backend.tmeshvert(& trimVert);
-
- trimVert.param[1] = v_val[i];
- backend.tmeshvert(& trimVert);
- }
- backend.endqstrip();
-
- }
- */
-}
-
-//it works for top, bot, left ad right, you need ot select correct arguments
-static void triangulateRectTopGen(Arc_ptr arc, int n_ulines, REAL* u_val, Real v, int dir, int is_u, Backend& backend)
-{
-
- if(is_u)
- {
- int i,k;
- REAL* upper_val = (REAL*) malloc(sizeof(REAL) * arc->pwlArc->npts);
- assert(upper_val);
- if(dir)
- {
- for(k=0,i=arc->pwlArc->npts-1; i>=0; i--,k++)
- {
- upper_val[k] = arc->pwlArc->pts[i].param[0];
- }
- backend.evalUStrip(arc->pwlArc->npts, arc->pwlArc->pts[0].param[1],
- upper_val,
- n_ulines, v, u_val);
- }
- else
- {
- for(k=0,i=0; i<arc->pwlArc->npts; i++,k++)
- {
- upper_val[k] = arc->pwlArc->pts[i].param[0];
-
- }
-
- backend.evalUStrip(
- n_ulines, v, u_val,
- arc->pwlArc->npts, arc->pwlArc->pts[0].param[1], upper_val
- );
- }
-
- free(upper_val);
- return;
- }
- else //is_v
- {
- int i,k;
- REAL* left_val = (REAL*) malloc(sizeof(REAL) * arc->pwlArc->npts);
- assert(left_val);
- if(dir)
- {
- for(k=0,i=arc->pwlArc->npts-1; i>=0; i--,k++)
- {
- left_val[k] = arc->pwlArc->pts[i].param[1];
- }
- backend.evalVStrip(arc->pwlArc->npts, arc->pwlArc->pts[0].param[0],
- left_val,
- n_ulines, v, u_val);
- }
- else
- {
- for(k=0,i=0; i<arc->pwlArc->npts; i++,k++)
- {
- left_val[k] = arc->pwlArc->pts[i].param[1];
- }
- backend.evalVStrip(
- n_ulines, v, u_val,
- arc->pwlArc->npts, arc->pwlArc->pts[0].param[0], left_val
- );
- }
- free(left_val);
- return;
- }
-
- //the following is a different version of the above code. If you comment
- //the above code, the following code will still work. The reason to leave
- //the folliwng code here is purely for testing purpose.
- /*
- int i,j;
- PwlArc* parc = arc->pwlArc;
- int d1 = parc->npts-1;
- int d2 = 0;
- TrimVertex trimVert;
- trimVert.nuid = 0;//????
- REAL* temp_u_val = u_val;
- if(dir ==0) //have to reverse u_val
- {
- temp_u_val = (REAL*) malloc(sizeof(REAL) * n_ulines);
- assert(temp_u_val);
- for(i=0; i<n_ulines; i++)
- temp_u_val[i] = u_val[n_ulines-1-i];
- }
- u_val = temp_u_val;
-
- if(parc->npts > n_ulines)
- {
- d1 = n_ulines-1;
-
- backend.bgntfan();
- if(is_u){
- trimVert.param[0] = u_val[0];
- trimVert.param[1] = v;
- }
- else
- {
- trimVert.param[1] = u_val[0];
- trimVert.param[0] = v;
- }
-
- backend.tmeshvert(& trimVert);
- for(i=d1; i< parc->npts; i++)
- backend.tmeshvert(& parc->pts[i]);
- backend.endtfan();
-
-
- }
- else if(parc->npts < n_ulines)
- {
- d2 = n_ulines-parc->npts;
-
-
- backend.bgntfan();
- backend.tmeshvert(& parc->pts[parc->npts-1]);
- for(i=0; i<= d2; i++)
- {
- if(is_u){
- trimVert.param[0] = u_val[i];
- trimVert.param[1] = v;
- }
- else
- {
- trimVert.param[1] = u_val[i];
- trimVert.param[0] = v;
- }
- backend.tmeshvert(&trimVert);
- }
- backend.endtfan();
-
- }
- if(d1>0){
-
-
- backend.bgnqstrip();
- for(i=d1, j=d2; i>=0; i--, j++)
- {
- backend.tmeshvert(& parc->pts[i]);
-
- if(is_u){
- trimVert.param[0] = u_val[j];
- trimVert.param[1] = v;
- }
- else{
- trimVert.param[1] = u_val[j];
- trimVert.param[0] = v;
- }
- backend.tmeshvert(&trimVert);
-
-
-
- }
- backend.endqstrip();
-
-
- }
- if(dir == 0) //temp_u_val was mallocated
- free(temp_u_val);
- */
-}
-
-//n_ulines is the number of ulines inside, and n_vlines is the number of vlines
-//inside, different from meanings elsewhere!!!
-static void triangulateRectGen(Arc_ptr loop, int n_ulines, int n_vlines, Backend& backend)
-{
-
- int i;
- //we know the loop is a rectangle, but not sure which is top
- Arc_ptr top, bot, left, right;
-
- if(equalRect(loop->tail()[1] , loop->head()[1]))
- {
-
- if(loop->tail()[1] > loop->prev->prev->tail()[1])
- {
-
- top = loop;
- }
- else{
-
- top = loop->prev->prev;
- }
- }
- else
- {
- if(loop->tail()[0] > loop->prev->prev->tail()[0])
- {
- //loop is the right arc
-
- top = loop->next;
- }
- else
- {
-
- top = loop->prev;
- }
- }
-
- left = top->next;
- bot = left->next;
- right= bot->next;
-
-#ifdef COUNT_TRIANGLES
- num_triangles += loop->pwlArc->npts +
- left->pwlArc->npts +
- bot->pwlArc->npts +
- right->pwlArc->npts
- + 2*n_ulines + 2*n_vlines
- -8;
- num_quads += (n_ulines-1)*(n_vlines-1);
-#endif
-/*
- backend.surfgrid(left->tail()[0], right->tail()[0], n_ulines+1,
- top->tail()[1], bot->tail()[1], n_vlines+1);
-// if(n_ulines>1 && n_vlines>1)
- backend.surfmesh(0,0,n_ulines+1,n_vlines+1);
-return;
-*/
- REAL* u_val=(REAL*) malloc(sizeof(REAL)*n_ulines);
- assert(u_val);
- REAL* v_val=(REAL*)malloc(sizeof(REAL) * n_vlines);
- assert(v_val);
- REAL u_stepsize = (right->tail()[0] - left->tail()[0])/( (REAL) n_ulines+1);
- REAL v_stepsize = (top->tail()[1] - bot->tail()[1])/( (REAL) n_vlines+1);
- Real temp=left->tail()[0]+u_stepsize;
- for(i=0; i<n_ulines; i++)
- {
- u_val[i] = temp;
- temp += u_stepsize;
- }
- temp = bot->tail()[1] + v_stepsize;
- for(i=0; i<n_vlines; i++)
- {
- v_val[i] = temp;
- temp += v_stepsize;
- }
-
- triangulateRectTopGen(top, n_ulines, u_val, v_val[n_vlines-1], 1,1, backend);
- triangulateRectTopGen(bot, n_ulines, u_val, v_val[0], 0, 1, backend);
- triangulateRectTopGen(left, n_vlines, v_val, u_val[0], 1, 0, backend);
- triangulateRectTopGen(right, n_vlines, v_val, u_val[n_ulines-1], 0,0, backend);
-
-
-
-
- //triangulate the center
- triangulateRectCenter(n_ulines, u_val, n_vlines, v_val, backend);
-
- free(u_val);
- free(v_val);
-
-}
-
-
-
-
-/**********for reading newtess_flag from a file**********/
-static Int read_flag(char* name)
-{
- Int ret;
- FILE* fp = fopen(name, "r");
- if(fp == NULL)
- {
- fprintf(stderr, "can't open file %s\n", name);
- exit(1);
- }
- fscanf(fp, "%i", &ret);
- fclose(fp);
- return ret;
-}
-
-
-/***********nextgen tess****************/
-#include "sampleMonoPoly.h"
-directedLine* arcToDLine(Arc_ptr arc)
-{
- int i;
- Real vert[2];
- directedLine* ret;
- sampledLine* sline = new sampledLine(arc->pwlArc->npts);
- for(i=0; i<arc->pwlArc->npts; i++)
- {
- vert[0] = arc->pwlArc->pts[i].param[0];
- vert[1] = arc->pwlArc->pts[i].param[1];
- sline->setPoint(i, vert);
- }
- ret = new directedLine(INCREASING, sline);
- return ret;
-}
-
-/*an pwlArc may not be a straight line*/
-directedLine* arcToMultDLines(directedLine* original, Arc_ptr arc)
-{
- directedLine* ret = original;
- int is_linear = 0;
- if(arc->pwlArc->npts == 2 )
- is_linear = 1;
- else if(area(arc->pwlArc->pts[0].param, arc->pwlArc->pts[1].param, arc->pwlArc->pts[arc->pwlArc->npts-1].param) == 0.0)
- is_linear = 1;
-
- if(is_linear)
- {
- directedLine *dline = arcToDLine(arc);
- if(ret == NULL)
- ret = dline;
- else
- ret->insert(dline);
- return ret;
- }
- else /*not linear*/
- {
- for(Int i=0; i<arc->pwlArc->npts-1; i++)
- {
- Real vert[2][2];
- vert[0][0] = arc->pwlArc->pts[i].param[0];
- vert[0][1] = arc->pwlArc->pts[i].param[1];
- vert[1][0] = arc->pwlArc->pts[i+1].param[0];
- vert[1][1] = arc->pwlArc->pts[i+1].param[1];
-
- sampledLine *sline = new sampledLine(2, vert);
- directedLine *dline = new directedLine(INCREASING, sline);
- if(ret == NULL)
- ret = dline;
- else
- ret->insert(dline);
- }
- return ret;
- }
-}
-
-
-
-directedLine* arcLoopToDLineLoop(Arc_ptr loop)
-{
- directedLine* ret;
-
- if(loop == NULL)
- return NULL;
- ret = arcToMultDLines(NULL, loop);
-//ret->printSingle();
- for(Arc_ptr temp = loop->next; temp != loop; temp = temp->next){
- ret = arcToMultDLines(ret, temp);
-//ret->printSingle();
- }
-
- return ret;
-}
-
-/*
-void Slicer::evalRBArray(rectBlockArray* rbArray, gridWrap* grid)
-{
- TrimVertex *trimVert = (TrimVertex*)malloc(sizeof(TrimVertex));
- trimVert -> nuid = 0;//????
-
- Real* u_values = grid->get_u_values();
- Real* v_values = grid->get_v_values();
-
- Int i,j,k,l;
-
- for(l=0; l<rbArray->get_n_elements(); l++)
- {
- rectBlock* block = rbArray->get_element(l);
- for(k=0, i=block->get_upGridLineIndex(); i>block->get_lowGridLineIndex(); i--, k++)
- {
-
- backend.bgnqstrip();
- for(j=block->get_leftIndices()[k+1]; j<= block->get_rightIndices()[k+1]; j++)
- {
- trimVert->param[0] = u_values[j];
- trimVert->param[1] = v_values[i];
- backend.tmeshvert(trimVert);
-
- trimVert->param[1] = v_values[i-1];
- backend.tmeshvert(trimVert);
-
- }
- backend.endqstrip();
-
- }
- }
-
- free(trimVert);
-}
-*/
-
-void Slicer::evalRBArray(rectBlockArray* rbArray, gridWrap* grid)
-{
- Int i,j,k;
-
- Int n_vlines=grid->get_n_vlines();
- //the reason to switch the position of v_max and v_min is because of the
- //the orientation problem. glEvalMesh generates quad_strip clockwise, but
- //we need counter-clockwise.
- backend.surfgrid(grid->get_u_min(), grid->get_u_max(), grid->get_n_ulines()-1,
- grid->get_v_max(), grid->get_v_min(), n_vlines-1);
-
-
- for(j=0; j<rbArray->get_n_elements(); j++)
- {
- rectBlock* block = rbArray->get_element(j);
- Int low = block->get_lowGridLineIndex();
- Int high = block->get_upGridLineIndex();
-
- for(k=0, i=high; i>low; i--, k++)
- {
- backend.surfmesh(block->get_leftIndices()[k+1], n_vlines-1-i, block->get_rightIndices()[k+1]-block->get_leftIndices()[k+1], 1);
- }
- }
-}
-
-
-void Slicer::evalStream(primStream* pStream)
-{
- Int i,j,k;
- k=0;
-/* TrimVertex X;*/
- TrimVertex *trimVert =/*&X*/ (TrimVertex*)malloc(sizeof(TrimVertex));
- trimVert -> nuid = 0;//???
- Real* vertices = pStream->get_vertices(); //for efficiency
- for(i=0; i<pStream->get_n_prims(); i++)
- {
-
- //ith primitive has #vertices = lengths[i], type=types[i]
- switch(pStream->get_type(i)){
- case PRIMITIVE_STREAM_FAN:
-
- backend.bgntfan();
-
- for(j=0; j<pStream->get_length(i); j++)
- {
- trimVert->param[0] = vertices[k];
- trimVert->param[1] = vertices[k+1];
- backend.tmeshvert(trimVert);
-
-// backend.tmeshvert(vertices[k], vertices[k+1]);
- k += 2;
- }
- backend.endtfan();
- break;
-
- default:
- fprintf(stderr, "evalStream: not implemented yet\n");
- exit(1);
-
- }
- }
- free(trimVert);
-}
-
-
-
-
-void Slicer::slice_new(Arc_ptr loop)
-{
-//count++;
-//if(count == 78) count=1;
-//printf("count=%i\n", count);
-//if( ! (4<= count && count <=4)) return;
-
-
- Int num_ulines;
- Int num_vlines;
- Real uMin, uMax, vMin, vMax;
- Real mydu, mydv;
- uMin = uMax = loop->tail()[0];
- vMin = vMax = loop->tail()[1];
- mydu = (du>0)? du: -du;
- mydv = (dv>0)? dv: -dv;
-
- for(Arc_ptr jarc=loop->next; jarc != loop; jarc = jarc->next)
- {
-
- if(jarc->tail()[0] < uMin)
- uMin = jarc->tail()[0];
- if(jarc->tail()[0] > uMax)
- uMax = jarc->tail()[0];
- if(jarc->tail()[1] < vMin)
- vMin = jarc->tail()[1];
- if(jarc->tail()[1] > vMax)
- vMax = jarc->tail()[1];
- }
-
- if(mydu > uMax - uMin)
- num_ulines = 2;
- else
- {
- num_ulines = 3 + (Int) ((uMax-uMin)/mydu);
- }
- if(mydv>=vMax-vMin)
- num_vlines = 2;
- else
- {
- num_vlines = 2+(Int)((vMax-vMin)/mydv);
- }
-
- Int isRect = is_rect(loop);
-
- if(isRect && (num_ulines<=2 || num_vlines<=2))
- {
- if(vlinear)
- triangulateRect(loop, backend, 1, ulinear, vlinear);
- else if(ulinear)
- triangulateRect(loop, backend, -1, ulinear, vlinear);
- else
- triangulateRect(loop, backend, 0, ulinear, vlinear);
- }
-
- else if(isRect)
- {
- triangulateRectGen(loop, num_ulines-2, num_vlines-2, backend);
- }
- else if( (num_ulines<=2 || num_vlines <=2) && ulinear)
- {
- monoTriangulationFunBackend(loop, compV2InY, &backend);
- }
- else if( (!ulinear) && (!vlinear) && (num_ulines == 2) && (num_vlines > 2))
- {
- monoTriangulationFunBackend(loop, compV2InY, &backend);
- }
- else
- {
- directedLine* poly = arcLoopToDLineLoop(loop);
-
- gridWrap grid(num_ulines, num_vlines, uMin, uMax, vMin, vMax);
- primStream pStream(20, 20);
- rectBlockArray rbArray(20);
-
- sampleMonoPoly(poly, &grid, ulinear, vlinear, &pStream, &rbArray);
-
- evalStream(&pStream);
-
- evalRBArray(&rbArray, &grid);
-
-#ifdef COUNT_TRIANGLES
- num_triangles += pStream.num_triangles();
- num_quads += rbArray.num_quads();
-#endif
- poly->deleteSinglePolygonWithSline();
- }
-
-#ifdef COUNT_TRIANGLES
- printf("num_triangles=%i\n", num_triangles);
- printf("num_quads = %i\n", num_quads);
-#endif
-}
-
-void Slicer::slice(Arc_ptr loop)
-{
-#ifdef USE_READ_FLAG
- if(read_flag("flagFile"))
- slice_new(loop);
- else
- slice_old(loop);
-
-#else
- slice_new(loop);
-#endif
-
-}
-
-
-
-Slicer::Slicer( Backend &b )
- : CoveAndTiler( b ), Mesher( b ), backend( b )
-{
- ulinear = 0;
- vlinear = 0;
-}
-
-Slicer::~Slicer()
-{
-}
-
-void
-Slicer::setisolines( int x )
-{
- isolines = x;
-}
-
-void
-Slicer::setstriptessellation( REAL x, REAL y )
-{
- assert(x > 0 && y > 0);
- du = x;
- dv = y;
- setDu( du );
-}
-
-void
-Slicer::slice_old( Arc_ptr loop )
-{
- loop->markverts();
-
- Arc_ptr extrema[4];
- loop->getextrema( extrema );
-
- unsigned int npts = loop->numpts();
- TrimRegion::init( npts, extrema[0] );
-
- Mesher::init( npts );
-
- long ulines = uarray.init( du, extrema[1], extrema[3] );
-//printf("ulines = %i\n", ulines);
- Varray varray;
- long vlines = varray.init( dv, extrema[0], extrema[2] );
-//printf("vlines = %i\n", vlines);
- long botv = 0;
- long topv;
- TrimRegion::init( varray.varray[botv] );
- getGridExtent( &extrema[0]->pwlArc->pts[0], &extrema[0]->pwlArc->pts[0] );
-
- for( long quad=0; quad<varray.numquads; quad++ ) {
- backend.surfgrid( uarray.uarray[0],
- uarray.uarray[ulines-1],
- ulines-1,
- varray.vval[quad],
- varray.vval[quad+1],
- varray.voffset[quad+1] - varray.voffset[quad] );
-
- for( long i=varray.voffset[quad]+1; i <= varray.voffset[quad+1]; i++ ) {
- topv = botv++;
- advance( topv - varray.voffset[quad],
- botv - varray.voffset[quad],
- varray.varray[botv] );
- if( i == vlines )
- getPts( extrema[2] );
- else
- getPts( backend );
- getGridExtent();
- if( isolines ) {
- outline();
- } else {
- if( canTile() )
- coveAndTile();
- else
- mesh();
- }
- }
- }
-}
-
-
-void
-Slicer::outline( void )
-{
- GridTrimVertex upper, lower;
- Hull::init( );
-
- backend.bgnoutline();
- while( (nextupper( &upper )) ) {
- if( upper.isGridVert() )
- backend.linevert( upper.g );
- else
- backend.linevert( upper.t );
- }
- backend.endoutline();
-
- backend.bgnoutline();
- while( (nextlower( &lower )) ) {
- if( lower.isGridVert() )
- backend.linevert( lower.g );
- else
- backend.linevert( lower.t );
- }
- backend.endoutline();
-}
-
-
-void
-Slicer::outline( Arc_ptr jarc )
-{
- jarc->markverts();
-
- if( jarc->pwlArc->npts >= 2 ) {
- backend.bgnoutline();
- for( int j = jarc->pwlArc->npts-1; j >= 0; j-- )
- backend.linevert( &(jarc->pwlArc->pts[j]) );
- backend.endoutline();
- }
-}
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/slicer.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/slicer.h
deleted file mode 100755
index b0a30313d..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/slicer.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * slicer.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/slicer.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gluslicer_h_
-#define __gluslicer_h_
-
-#include "trimregion.h"
-#include "mesher.h"
-#include "coveandtiler.h"
-#include "primitiveStream.h"
-#include "rectBlock.h"
-
-class Backend;
-class Arc;
-class TrimVertex;
-
-class Slicer : public CoveAndTiler, public Mesher {
-public:
- Slicer( Backend & );
- ~Slicer( void );
- void slice( Arc_ptr );
- void slice_old( Arc_ptr);
- void slice_new( Arc_ptr );
- void evalStream(primStream* );
- void evalRBArray(rectBlockArray* rbArray, gridWrap* grid);
-
- void outline( Arc_ptr );
- void setstriptessellation( REAL, REAL );
- void setisolines( int );
-
- void set_ulinear(int ulinear_flag)
- {
- ulinear = ulinear_flag;
- }
- void set_vlinear(int vlinear_flag)
- {
- vlinear = vlinear_flag;
- }
-private:
- Backend& backend;
- REAL oneOverDu;
- REAL du, dv;
- int isolines;
-
- void outline( void );
- void initGridlines( void );
- void advanceGridlines( long );
-
- int ulinear; //indicate whether uorder is 2 or not
- int vlinear; //indicate whether vorder is 2 or not
-};
-#endif /* __gluslicer_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/sorter.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/sorter.cc
deleted file mode 100755
index 4bab2f29d..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/sorter.cc
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * sorter.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/sorter.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "sorter.h"
-#include "mystdio.h"
-
-Sorter::Sorter( int _es )
-{
- es = _es;
-}
-
-void
-Sorter::qsort( void *a, int n )
-{
- qs1( (char *)a, ((char *)a)+n*es);
-}
-
-int
-Sorter::qscmp( char *, char * )
-{
- dprintf( "Sorter::qscmp: pure virtual called\n" );
- return 0;
-}
-
-
-void
-Sorter::qsexc( char *, char * )
-{
- dprintf( "Sorter::qsexc: pure virtual called\n" );
-}
-
-
-void
-Sorter::qstexc( char *, char *, char * )
-{
- dprintf( "Sorter::qstexc: pure virtual called\n" );
-}
-
-void
-Sorter::qs1( char *a, char *l )
-{
- char *i, *j;
- char *lp, *hp;
- int c;
- unsigned int n;
-
-start:
- if((n=l-a) <= es)
- return;
- n = es * (n / (2*es));
- hp = lp = a+n;
- i = a;
- j = l-es;
- while(1) {
- if(i < lp) {
- if((c = qscmp(i, lp)) == 0) {
- qsexc(i, lp -= es);
- continue;
- }
- if(c < 0) {
- i += es;
- continue;
- }
- }
-
-loop:
- if(j > hp) {
- if((c = qscmp(hp, j)) == 0) {
- qsexc(hp += es, j);
- goto loop;
- }
- if(c > 0) {
- if(i == lp) {
- qstexc(i, hp += es, j);
- i = lp += es;
- goto loop;
- }
- qsexc(i, j);
- j -= es;
- i += es;
- continue;
- }
- j -= es;
- goto loop;
- }
-
- if(i == lp) {
- if(lp-a >= l-hp) {
- qs1(hp+es, l);
- l = lp;
- } else {
- qs1(a, lp);
- a = hp+es;
- }
- goto start;
- }
-
- qstexc(j, lp -= es, i);
- j = hp -= es;
- }
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/sorter.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/sorter.h
deleted file mode 100755
index 6c01a5eff..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/sorter.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/sorter.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef __glusorter_h_
-#define __glusorter_h_
-
-class Sorter {
-public:
- Sorter( int es );
- void qsort( void *a, int n );
-
-protected:
- virtual int qscmp( char *, char * );
- virtual void qsexc( char *i, char *j ); // i<-j, j<-i
- virtual void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i
-
-private:
- void qs1( char *, char * );
- int es;
-};
-#endif /* __glusorter_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/splitarcs.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/splitarcs.cc
deleted file mode 100755
index ed672fdff..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/splitarcs.cc
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * splitarcs.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/splitarcs.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "myassert.h"
-#include "mysetjmp.h"
-#include "mystdio.h"
-#include "subdivider.h"
-#include "arcsorter.h"
-#include "arc.h"
-#include "bin.h"
-
-/* local preprocessor definitions */
-#define MAXARCS 10
-
-/*----------------------------------------------------------------------------
- * Subdivider::split - split trim regions in source bin by line (param == value).
- *----------------------------------------------------------------------------
- */
-
-void
-Subdivider::split( Bin& bin, Bin& left, Bin& right, int param, REAL value )
-{
- Bin intersections, unknown;
-
- partition( bin, left, intersections, right, unknown, param, value );
-
- int count = intersections.numarcs();
- if( count % 2 ) {
-#ifndef NDEBUG
- left.show( "left" );
- intersections.show( "intersections" );
- right.show( "right" );
-#endif
- ::mylongjmp( jumpbuffer, 29 );
- }
-
- Arc_ptr arclist[MAXARCS], *list;
- if( count >= MAXARCS ) {
- list = new Arc_ptr[count];
- } else {
- list = arclist;
- }
-
- Arc_ptr jarc, *last, *lptr;
- for( last = list; (jarc=intersections.removearc()) != NULL; last++ )
- *last = jarc;
-
- if( param == 0 ) { /* sort into increasing t order */
- ArcSdirSorter sorter(*this);
- sorter.qsort( list, count );
-
- //::qsort ((void *)list, count, sizeof(Arc_ptr), (cmpfunc)compare_s);
- for( lptr=list; lptr<last; lptr+=2 )
- check_s ( lptr[0], lptr[1] );
- for( lptr=list; lptr<last; lptr+=2 )
- join_s ( left, right, lptr[0], lptr[1] );
- for( lptr=list; lptr != last; lptr++ ) {
- if( ((*lptr)->head()[0] <= value) && ((*lptr)->tail()[0] <= value) )
- left.addarc( *lptr );
- else
- right.addarc( *lptr );
- }
- } else { /* sort into decreasing s order */
- ArcTdirSorter sorter(*this);
- sorter.qsort( list, count );
- //::qsort ((void *)list, count, sizeof(Arc_ptr), (cmpfunc)compare_t);
- for( lptr=list; lptr<last; lptr+=2 )
- check_t ( lptr[0], lptr[1] );
- for( lptr=list; lptr<last; lptr+=2 )
- join_t ( left, right, lptr[0], lptr[1] );
- for( lptr=list; lptr != last; lptr++ ) {
- if( ((*lptr)->head()[1] <= value) && ((*lptr)->tail()[1] <= value) )
- left.addarc( *lptr );
- else
- right.addarc( *lptr );
- }
- }
-
- if( list != arclist ) delete[] list;
- unknown.adopt();
-}
-
-
-void
-Subdivider::check_s( Arc_ptr jarc1, Arc_ptr jarc2 )
-{
- assert( jarc1->check( ) != 0 );
- assert( jarc2->check( ) != 0 );
- assert( jarc1->next->check( ) != 0 );
- assert( jarc2->next->check( ) != 0 );
- assert( jarc1 != jarc2 );
-
- /* XXX - if these assertions fail, it is due to user error or
- undersampling */
- if( ! ( jarc1->tail()[0] < (jarc1)->head()[0] ) ) {
-#ifndef NDEBUG
- dprintf( "s difference %f\n", (jarc1)->tail()[0] - (jarc1)->head()[0] );
-#endif
- ::mylongjmp( jumpbuffer, 28 );
- }
-
- if( ! ( jarc2->tail()[0] > (jarc2)->head()[0] ) ) {
-#ifndef NDEBUG
- dprintf( "s difference %f\n", (jarc2)->tail()[0] - (jarc2)->head()[0] );
-#endif
- ::mylongjmp( jumpbuffer, 28 );
- }
-}
-
-inline void
-Subdivider::link( Arc_ptr jarc1, Arc_ptr jarc2, Arc_ptr up, Arc_ptr down )
-{
- up->nuid = down->nuid = 0; // XXX
-
- up->next = jarc2;
- down->next = jarc1;
- up->prev = jarc1->prev;
- down->prev = jarc2->prev;
-
- down->next->prev = down;
- up->next->prev = up;
- down->prev->next = down;
- up->prev->next = up;
-}
-
-inline void
-Subdivider::simple_link( Arc_ptr jarc1, Arc_ptr jarc2 )
-{
- Arc_ptr tmp = jarc2->prev;
- jarc2->prev = jarc1->prev;
- jarc1->prev = tmp;
- jarc2->prev->next = jarc2;
- jarc1->prev->next = jarc1;
-}
-
-
-/*----------------------------------------------------------------------------
- * join - add a pair of oppositely directed jordan arcs between two arcs
- *----------------------------------------------------------------------------
- */
-
-void
-Subdivider::join_s( Bin& left, Bin& right, Arc_ptr jarc1, Arc_ptr jarc2 )
-{
- assert( jarc1->check( ) != 0);
- assert( jarc2->check( ) != 0);
- assert( jarc1 != jarc2 );
-
- if( ! jarc1->getitail() )
- jarc1 = jarc1->next;
-
- if( ! jarc2->getitail() )
- jarc2 = jarc2->next;
-
- REAL s = jarc1->tail()[0];
- REAL t1 = jarc1->tail()[1];
- REAL t2 = jarc2->tail()[1];
-
- if( t1 == t2 ) {
- simple_link( jarc1, jarc2 );
- } else {
- Arc_ptr newright = new(arcpool) Arc( arc_right, 0 );
- Arc_ptr newleft = new(arcpool) Arc( arc_left, 0 );
- assert( t1 < t2 );
- if( isBezierArcType() ) {
- arctessellator.bezier( newright, s, s, t1, t2 );
- arctessellator.bezier( newleft, s, s, t2, t1 );
- } else {
- arctessellator.pwl_right( newright, s, t1, t2, stepsizes[0] );
- arctessellator.pwl_left( newleft, s, t2, t1, stepsizes[2] );
- }
- link( jarc1, jarc2, newright, newleft );
- left.addarc( newright );
- right.addarc( newleft );
- }
-
- assert( jarc1->check( ) != 0 );
- assert( jarc2->check( ) != 0 );
- assert( jarc1->next->check( ) != 0);
- assert( jarc2->next->check( ) != 0);
-}
-
-void
-Subdivider::check_t( Arc_ptr jarc1, Arc_ptr jarc2 )
-{
- assert( jarc1->check( ) != 0 );
- assert( jarc2->check( ) != 0 );
- assert( jarc1->next->check( ) != 0 );
- assert( jarc2->next->check( ) != 0 );
- assert( jarc1 != jarc2 );
-
- /* XXX - if these assertions fail, it is due to user error or
- undersampling */
- if( ! ( jarc1->tail()[1] < (jarc1)->head()[1] ) ) {
-#ifndef NDEBUG
- dprintf( "t difference %f\n", jarc1->tail()[1] - (jarc1)->head()[1] );
-#endif
- ::mylongjmp( jumpbuffer, 28 );
- }
-
- if( ! ( jarc2->tail()[1] > (jarc2)->head()[1] ) ) {
-#ifndef NDEBUG
- dprintf( "t difference %f\n", jarc2->tail()[1] - (jarc2)->head()[1] );
-#endif
- ::mylongjmp( jumpbuffer, 28 );
- }
-}
-
-/*----------------------------------------------------------------------------
- * join_t - add a pair of oppositely directed jordan arcs between two arcs
- *----------------------------------------------------------------------------
- */
-
-void
-Subdivider::join_t( Bin& bottom, Bin& top, Arc_ptr jarc1, Arc_ptr jarc2 )
-{
- assert( jarc1->check( ) != 0 );
- assert( jarc2->check( ) != 0 );
- assert( jarc1->next->check( ) != 0 );
- assert( jarc2->next->check( ) != 0 );
- assert( jarc1 != jarc2 );
-
- if( ! jarc1->getitail() )
- jarc1 = jarc1->next;
-
- if( ! jarc2->getitail() )
- jarc2 = jarc2->next;
-
- REAL s1 = jarc1->tail()[0];
- REAL s2 = jarc2->tail()[0];
- REAL t = jarc1->tail()[1];
-
- if( s1 == s2 ) {
- simple_link( jarc1, jarc2 );
- } else {
- Arc_ptr newtop = new(arcpool) Arc( arc_top, 0 );
- Arc_ptr newbot = new(arcpool) Arc( arc_bottom, 0 );
- assert( s1 > s2 );
- if( isBezierArcType() ) {
- arctessellator.bezier( newtop, s1, s2, t, t );
- arctessellator.bezier( newbot, s2, s1, t, t );
- } else {
- arctessellator.pwl_top( newtop, t, s1, s2, stepsizes[1] );
- arctessellator.pwl_bottom( newbot, t, s2, s1, stepsizes[3] );
- }
- link( jarc1, jarc2, newtop, newbot );
- bottom.addarc( newtop );
- top.addarc( newbot );
- }
-
- assert( jarc1->check( ) != 0 );
- assert( jarc2->check( ) != 0 );
- assert( jarc1->next->check( ) != 0 );
- assert( jarc2->next->check( ) != 0 );
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/subdivider.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/subdivider.cc
deleted file mode 100755
index f02462912..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/subdivider.cc
+++ /dev/null
@@ -1,912 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * subdivider.cxx
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/subdivider.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "myassert.h"
-#include "mystdio.h"
-#include "subdivider.h"
-#include "arc.h"
-#include "bezierarc.h"
-#include "bin.h"
-#include "renderhints.h"
-#include "backend.h"
-#include "mapdesc.h"
-#include "quilt.h"
-#include "patchlist.h"
-#include "patch.h"
-#include "nurbsconsts.h"
-#include "trimvertpool.h"
-#include "simplemath.h"
-
-#include "polyUtil.h" //for function area()
-
-//#define PARTITION_TEST
-#ifdef PARTITION_TEST
-#include "partitionY.h"
-#include "monoTriangulation.h"
-#include "dataTransform.h"
-#include "monoChain.h"
-
-#endif
-
-
-#define OPTIMIZE_UNTRIMED_CASE
-
-
-Bin*
-Subdivider::makePatchBoundary( const REAL *from, const REAL *to )
-{
- Bin* ret = new Bin();
- REAL smin = from[0];
- REAL smax = to[0];
- REAL tmin = from[1];
- REAL tmax = to[1];
-
- pjarc = 0;
-
- Arc_ptr jarc = new(arcpool) Arc( arc_bottom, 0 );
- arctessellator.bezier( jarc, smin, smax, tmin, tmin );
- ret->addarc( jarc );
- pjarc = jarc->append( pjarc );
-
- jarc = new(arcpool) Arc( arc_right, 0 );
- arctessellator.bezier( jarc, smax, smax, tmin, tmax );
- ret->addarc( jarc );
- pjarc = jarc->append( pjarc );
-
- jarc = new(arcpool) Arc( arc_top, 0 );
- arctessellator.bezier( jarc, smax, smin, tmax, tmax );
- ret->addarc( jarc );
- pjarc = jarc->append( pjarc );
-
- jarc = new(arcpool) Arc( arc_left, 0 );
- arctessellator.bezier( jarc, smin, smin, tmax, tmin );
- ret->addarc( jarc );
- jarc->append( pjarc );
-
- assert( jarc->check() != 0 );
- return ret;
-}
-
-/*---------------------------------------------------------------------------
- * Subdivider - construct a subdivider
- *---------------------------------------------------------------------------
- */
-
-Subdivider::Subdivider( Renderhints& r, Backend& b )
- : arcpool( sizeof( Arc), 1, "arcpool" ),
- bezierarcpool( sizeof( BezierArc ), 1, "Bezarcpool" ),
- pwlarcpool( sizeof( PwlArc ), 1, "Pwlarcpool" ),
- renderhints( r ),
- arctessellator( trimvertexpool, pwlarcpool ),
- backend( b ),
- slicer( b )
-{
-}
-
-void
-Subdivider::setJumpbuffer( JumpBuffer *j )
-{
- jumpbuffer = j;
-}
-
-/*---------------------------------------------------------------------------
- * clear - reset all state after possible error condition
- *---------------------------------------------------------------------------
- */
-
-void
-Subdivider::clear( void )
-{
- trimvertexpool.clear();
- arcpool.clear();
- pwlarcpool.clear();
- bezierarcpool.clear();
-}
-
-/*---------------------------------------------------------------------------
- * ~Subdivider - destroy a subdivider
- *---------------------------------------------------------------------------
- */
-
-Subdivider::~Subdivider( void )
-{
-}
-
-/*---------------------------------------------------------------------------
- * addArc - add a bezier arc to a trim loop and to a bin
- *---------------------------------------------------------------------------
- */
-void
-Subdivider::addArc( REAL *cpts, Quilt *quilt, long _nuid )
-{
- BezierArc *bezierArc = new(bezierarcpool) BezierArc;
- Arc *jarc = new(arcpool) Arc( arc_none, _nuid );
- jarc->pwlArc = 0;
- jarc->bezierArc = bezierArc;
- bezierArc->order = quilt->qspec->order;
- bezierArc->stride = quilt->qspec->stride;
- bezierArc->mapdesc = quilt->mapdesc;
- bezierArc->cpts = cpts;
- initialbin.addarc( jarc );
- pjarc = jarc->append( pjarc );
-}
-
-/*---------------------------------------------------------------------------
- * addArc - add a pwl arc to a trim loop and to a bin
- *---------------------------------------------------------------------------
- */
-
-void
-Subdivider::addArc( int npts, TrimVertex *pts, long _nuid )
-{
- Arc *jarc = new(arcpool) Arc( arc_none, _nuid );
- jarc->pwlArc = new(pwlarcpool) PwlArc( npts, pts );
- initialbin.addarc( jarc );
- pjarc = jarc->append( pjarc );
-}
-
-void
-Subdivider::beginQuilts( void )
-{
- qlist = 0;
-}
-
-void
-Subdivider::addQuilt( Quilt *quilt )
-{
- quilt->next = qlist;
- qlist = quilt;
-}
-
-/*---------------------------------------------------------------------------
- * drawSurfaces - main entry point for surface tessellation
- *---------------------------------------------------------------------------
- */
-
-void
-Subdivider::drawSurfaces( long nuid )
-{
- renderhints.init( );
-
- if (qlist == NULL)
- {
- //initialbin could be nonempty due to some errors
- freejarcs(initialbin);
- return;
- }
-
- for( Quilt *q = qlist; q; q = q->next ) {
- if( q->isCulled( ) == CULL_TRIVIAL_REJECT ) {
- freejarcs( initialbin );
- return;
- }
- }
-
-
- REAL from[2], to[2];
- qlist->getRange( from, to, spbrkpts, tpbrkpts );
-#ifdef OPTIMIZE_UNTRIMED_CASE
- //perform optimization only when the samplng method is
- //DOMAIN_DISTANCE and the display methdo is either
- //fill or outline_polygon.
- int optimize = (is_domain_distance_sampling && (renderhints.display_method != N_OUTLINE_PATCH));
-#endif
-
- if( ! initialbin.isnonempty() ) {
-#ifdef OPTIMIZE_UNTRIMED_CASE
- if(! optimize )
- {
-
- makeBorderTrim( from, to );
- }
-#else
- makeBorderTrim( from, to );
-#endif
- } else {
- REAL rate[2];
- qlist->findRates( spbrkpts, tpbrkpts, rate );
-
- if( decompose( initialbin, min(rate[0], rate[1]) ) )
- mylongjmp( jumpbuffer, 31 );
- }
-
- backend.bgnsurf( renderhints.wiretris, renderhints.wirequads, nuid );
-
-#ifdef PARTITION_TEST
- if( initialbin.isnonempty() && spbrkpts.end-2 == spbrkpts.start &&
- tpbrkpts.end-2 == tpbrkpts.start)
-{
- for(int i=spbrkpts.start; i<spbrkpts.end-1; i++){
- for(int j=tpbrkpts.start; j<tpbrkpts.end-1; j++){
- Real pta[2], ptb[2];
- pta[0] = spbrkpts.pts[i];
- ptb[0] = spbrkpts.pts[i+1];
- pta[1] = tpbrkpts.pts[j];
- ptb[1] = tpbrkpts.pts[j+1];
- qlist->downloadAll(pta, ptb, backend);
-
- directedLine *poly;
-
- {
-
- poly = bin_to_DLineLoops(initialbin);
-
- poly=poly->deleteDegenerateLinesAllPolygons();
-
- sampledLine* retSampledLines;
-//printf("before MC_partition\n");
- poly = MC_partitionY(poly, &retSampledLines);
-//printf("after MC_partition\n");
-
- }
-
-
- {
- primStream pStream(5000,5000);
- directedLine* temp;
-
- for(temp=poly; temp != NULL; temp=temp->getNextPolygon())
-
- monoTriangulation(temp, &pStream);
-
- slicer.evalStream(&pStream);
-
- }
- //need to clean up space
- }
- }
- freejarcs( initialbin );
- backend.endsurf();
- return;
-
- /*
- printf("num_polygons=%i\n", poly->numPolygons());
- printf("num_edges=%i\n", poly->numEdgesAllPolygons());
- poly->writeAllPolygons("zloutputFile");
- return;
- {
- primStream pStream(20,20);
- for(directedLine* tempD = poly; tempD != NULL; tempD = tempD->getNextPolygon())
- monoTriangulation(tempD, &pStream);
- }
- return;
- */
-}
-#endif //PARTITION_TEST
-
-
-#ifdef OPTIMIZE_UNTRIMED_CASE
- if( (!initialbin.isnonempty()) && optimize )
- {
- int i,j;
- int num_u_steps;
- int num_v_steps;
- for(i=spbrkpts.start; i<spbrkpts.end-1; i++){
- for(j=tpbrkpts.start; j<tpbrkpts.end-1; j++){
- Real pta[2], ptb[2];
- pta[0] = spbrkpts.pts[i];
- ptb[0] = spbrkpts.pts[i+1];
- pta[1] = tpbrkpts.pts[j];
- ptb[1] = tpbrkpts.pts[j+1];
- qlist->downloadAll(pta, ptb, backend);
-
- num_u_steps = (int) (domain_distance_u_rate * (ptb[0]-pta[0]));
- num_v_steps = (int) (domain_distance_v_rate * (ptb[1]-pta[1]));
-
- if(num_u_steps <= 0) num_u_steps = 1;
- if(num_v_steps <= 0) num_v_steps = 1;
-
- backend.surfgrid(pta[0], ptb[0], num_u_steps,
- ptb[1], pta[1], num_v_steps);
- backend.surfmesh(0,0,num_u_steps,num_v_steps);
-
-
-
- continue;
- /* the following is left for reference purpose, don't delete
- {
- Bin* tempSource;
- Patchlist patchlist(qlist, pta, ptb);
- patchlist.getstepsize();
-
- tempSource=makePatchBoundary(pta, ptb);
-
- tessellation(*tempSource, patchlist);
-
- render(*tempSource);
- delete tempSource;
- }
- */
- }
- }
- }
- else
- subdivideInS( initialbin );
-#else
-
- subdivideInS( initialbin );
-#endif
-
- backend.endsurf();
-
-}
-
-void
-Subdivider::subdivideInS( Bin& source )
-{
- if( renderhints.display_method == N_OUTLINE_PARAM ) {
- outline( source );
- freejarcs( source );
- } else {
- setArcTypeBezier();
- setNonDegenerate();
- splitInS( source, spbrkpts.start, spbrkpts.end );
- }
-}
-
-
-/*---------------------------------------------------------------------------
- * splitInS - split a patch and a bin by an isoparametric line
- *---------------------------------------------------------------------------
- */
-
-void
-Subdivider::splitInS( Bin& source, int start, int end )
-{
- if( source.isnonempty() ) {
- if( start != end ) {
- int i = start + (end - start) / 2;
- Bin left, right;
- split( source, left, right, 0, spbrkpts.pts[i] );
- splitInS( left, start, i );
- splitInS( right, i+1, end );
- } else {
- if( start == spbrkpts.start || start == spbrkpts.end ) {
- freejarcs( source );
- } else if( renderhints.display_method == N_OUTLINE_PARAM_S ) {
- outline( source );
- freejarcs( source );
- } else {
- setArcTypeBezier();
- setNonDegenerate();
- s_index = start;
- splitInT( source, tpbrkpts.start, tpbrkpts.end );
- }
- }
- }
-}
-
-/*---------------------------------------------------------------------------
- * splitInT - split a patch and a bin by an isoparametric line
- *---------------------------------------------------------------------------
- */
-
-void
-Subdivider::splitInT( Bin& source, int start, int end )
-{
- if( source.isnonempty() ) {
- if( start != end ) {
- int i = start + (end - start) / 2;
- Bin left, right;
- split( source, left, right, 1, tpbrkpts.pts[i] );
- splitInT( left, start, i );
- splitInT( right, i+1, end );
- } else {
- if( start == tpbrkpts.start || start == tpbrkpts.end ) {
- freejarcs( source );
- } else if( renderhints.display_method == N_OUTLINE_PARAM_ST ) {
- outline( source );
- freejarcs( source );
- } else {
- t_index = start;
- setArcTypeBezier();
- setDegenerate();
-
- REAL pta[2], ptb[2];
- pta[0] = spbrkpts.pts[s_index-1];
- pta[1] = tpbrkpts.pts[t_index-1];
-
- ptb[0] = spbrkpts.pts[s_index];
- ptb[1] = tpbrkpts.pts[t_index];
- qlist->downloadAll( pta, ptb, backend );
-
- Patchlist patchlist( qlist, pta, ptb );
-/*
-printf("-------samplingSplit-----\n");
-source.show("samplingSplit source");
-*/
- samplingSplit( source, patchlist, renderhints.maxsubdivisions, 0 );
- setNonDegenerate();
- setArcTypeBezier();
- }
- }
- }
-}
-
-/*--------------------------------------------------------------------------
- * samplingSplit - recursively subdivide patch, cull check each subpatch
- *--------------------------------------------------------------------------
- */
-
-void
-Subdivider::samplingSplit(
- Bin& source,
- Patchlist& patchlist,
- int subdivisions,
- int param )
-{
- if( ! source.isnonempty() ) return;
-
- if( patchlist.cullCheck() == CULL_TRIVIAL_REJECT ) {
- freejarcs( source );
- return;
- }
-
- patchlist.getstepsize();
-
- if( renderhints.display_method == N_OUTLINE_PATCH ) {
- tessellation( source, patchlist );
- outline( source );
- freejarcs( source );
- return;
- }
-
- //patchlist.clamp();
-
- tessellation( source, patchlist );
-
- if( patchlist.needsSamplingSubdivision() && (subdivisions > 0) ) {
- if( ! patchlist.needsSubdivision( 0 ) )
- param = 1;
- else if( ! patchlist.needsSubdivision( 1 ) )
- param = 0;
- else
- param = 1 - param;
-
- Bin left, right;
- REAL mid = ( patchlist.pspec[param].range[0] +
- patchlist.pspec[param].range[1] ) * 0.5;
- split( source, left, right, param, mid );
- Patchlist subpatchlist( patchlist, param, mid );
- samplingSplit( left, subpatchlist, subdivisions-1, param );
- samplingSplit( right, patchlist, subdivisions-1, param );
- } else {
- setArcTypePwl();
- setDegenerate();
- nonSamplingSplit( source, patchlist, subdivisions, param );
- setDegenerate();
- setArcTypeBezier();
- }
-}
-
-void
-Subdivider::nonSamplingSplit(
- Bin& source,
- Patchlist& patchlist,
- int subdivisions,
- int param )
-{
- if( patchlist.needsNonSamplingSubdivision() && (subdivisions > 0) ) {
- param = 1 - param;
-
- Bin left, right;
- REAL mid = ( patchlist.pspec[param].range[0] +
- patchlist.pspec[param].range[1] ) * 0.5;
- split( source, left, right, param, mid );
- Patchlist subpatchlist( patchlist, param, mid );
- if( left.isnonempty() )
- if( subpatchlist.cullCheck() == CULL_TRIVIAL_REJECT )
- freejarcs( left );
- else
- nonSamplingSplit( left, subpatchlist, subdivisions-1, param );
- if( right.isnonempty() )
- if( patchlist.cullCheck() == CULL_TRIVIAL_REJECT )
- freejarcs( right );
- else
- nonSamplingSplit( right, patchlist, subdivisions-1, param );
-
- } else {
- // make bbox calls
- patchlist.bbox();
- backend.patch( patchlist.pspec[0].range[0], patchlist.pspec[0].range[1],
- patchlist.pspec[1].range[0], patchlist.pspec[1].range[1] );
-
- if( renderhints.display_method == N_OUTLINE_SUBDIV ) {
- outline( source );
- freejarcs( source );
- } else {
- setArcTypePwl();
- setDegenerate();
- findIrregularS( source );
- monosplitInS( source, smbrkpts.start, smbrkpts.end );
- }
- }
-}
-
-/*--------------------------------------------------------------------------
- * tessellation - set tessellation of interior and boundary of patch
- *--------------------------------------------------------------------------
- */
-
-void
-Subdivider::tessellation( Bin& bin, Patchlist &patchlist )
-{
- // tessellate unsampled trim curves
- tessellate( bin, patchlist.pspec[1].sidestep[1], patchlist.pspec[0].sidestep[1],
- patchlist.pspec[1].sidestep[0], patchlist.pspec[0].sidestep[0] );
-
- // set interior sampling rates
- slicer.setstriptessellation( patchlist.pspec[0].stepsize, patchlist.pspec[1].stepsize );
-
- //added by zl: set the order which will be used in slicer.c++
- slicer.set_ulinear( (patchlist.get_uorder() == 2));
- slicer.set_vlinear( (patchlist.get_vorder() == 2));
-
- // set boundary sampling rates
- stepsizes[0] = patchlist.pspec[1].stepsize;
- stepsizes[1] = patchlist.pspec[0].stepsize;
- stepsizes[2] = patchlist.pspec[1].stepsize;
- stepsizes[3] = patchlist.pspec[0].stepsize;
-}
-
-/*---------------------------------------------------------------------------
- * monosplitInS - split a patch and a bin by an isoparametric line
- *---------------------------------------------------------------------------
- */
-
-void
-Subdivider::monosplitInS( Bin& source, int start, int end )
-{
- if( source.isnonempty() ) {
- if( start != end ) {
- int i = start + (end - start) / 2;
- Bin left, right;
- split( source, left, right, 0, smbrkpts.pts[i] );
- monosplitInS( left, start, i );
- monosplitInS( right, i+1, end );
- } else {
- if( renderhints.display_method == N_OUTLINE_SUBDIV_S ) {
- outline( source );
- freejarcs( source );
- } else {
- setArcTypePwl();
- setDegenerate();
- findIrregularT( source );
- monosplitInT( source, tmbrkpts.start, tmbrkpts.end );
- }
- }
- }
-}
-
-/*---------------------------------------------------------------------------
- * monosplitInT - split a patch and a bin by an isoparametric line
- *---------------------------------------------------------------------------
- */
-
-void
-Subdivider::monosplitInT( Bin& source, int start, int end )
-{
- if( source.isnonempty() ) {
- if( start != end ) {
- int i = start + (end - start) / 2;
- Bin left, right;
- split( source, left, right, 1, tmbrkpts.pts[i] );
- monosplitInT( left, start, i );
- monosplitInT( right, i+1, end );
- } else {
- if( renderhints.display_method == N_OUTLINE_SUBDIV_ST ) {
- outline( source );
- freejarcs( source );
- } else {
-/*
-printf("*******render\n");
-source.show("source\n");
-*/
- render( source );
- freejarcs( source );
- }
- }
- }
-}
-
-
-/*----------------------------------------------------------------------------
- * findIrregularS - determine points of non-monotonicity is s direction
- *----------------------------------------------------------------------------
- */
-
-void
-Subdivider::findIrregularS( Bin& bin )
-{
- assert( bin.firstarc()->check() != 0 );
-
- smbrkpts.grow( bin.numarcs() );
-
- for( Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) {
- REAL *a = jarc->prev->tail();
- REAL *b = jarc->tail();
- REAL *c = jarc->head();
-
- if( b[1] == a[1] && b[1] == c[1] ) continue;
-
- //corrected code
- if((b[1]<=a[1] && b[1] <= c[1]) ||
- (b[1]>=a[1] && b[1] >= c[1]))
- {
- //each arc (jarc, jarc->prev, jarc->next) is a
- //monotone arc consisting of multiple line segements.
- //it may happen that jarc->prev and jarc->next are the same,
- //that is, jarc->prev and jarc form a closed loop.
- //In such case, a and c will be the same.
- if(a[0]==c[0] && a[1] == c[1])
- {
- if(jarc->pwlArc->npts >2)
- {
- c = jarc->pwlArc->pts[jarc->pwlArc->npts-2].param;
- }
- else
- {
- assert(jarc->prev->pwlArc->npts>2);
- a = jarc->prev->pwlArc->pts[jarc->prev->pwlArc->npts-2].param;
- }
-
- }
- if(area(a,b,c) < 0)
- {
- smbrkpts.add(b[0]);
- }
-
- }
-
- /* old code,
- if( b[1] <= a[1] && b[1] <= c[1] ) {
- if( ! ccwTurn_tr( jarc->prev, jarc ) )
- smbrkpts.add( b[0] );
- } else if( b[1] >= a[1] && b[1] >= c[1] ) {
- if( ! ccwTurn_tl( jarc->prev, jarc ) )
- smbrkpts.add( b[0] );
- }
- */
-
- }
-
- smbrkpts.filter();
-}
-
-/*----------------------------------------------------------------------------
- * findIrregularT - determine points of non-monotonicity in t direction
- * where one arc is parallel to the s axis.
- *----------------------------------------------------------------------------
- */
-
-void
-Subdivider::findIrregularT( Bin& bin )
-{
- assert( bin.firstarc()->check() != 0 );
-
- tmbrkpts.grow( bin.numarcs() );
-
- for( Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) {
- REAL *a = jarc->prev->tail();
- REAL *b = jarc->tail();
- REAL *c = jarc->head();
-
- if( b[0] == a[0] && b[0] == c[0] ) continue;
-
- if( b[0] <= a[0] && b[0] <= c[0] ) {
- if( a[1] != b[1] && b[1] != c[1] ) continue;
- if( ! ccwTurn_sr( jarc->prev, jarc ) )
- tmbrkpts.add( b[1] );
- } else if ( b[0] >= a[0] && b[0] >= c[0] ) {
- if( a[1] != b[1] && b[1] != c[1] ) continue;
- if( ! ccwTurn_sl( jarc->prev, jarc ) )
- tmbrkpts.add( b[1] );
- }
- }
- tmbrkpts.filter( );
-}
-
-/*-----------------------------------------------------------------------------
- * makeBorderTrim - if no user input trimming data then create
- * a trimming curve around the boundaries of the Quilt. The curve consists of
- * four Jordan arcs, one for each side of the Quilt, connected, of course,
- * head to tail.
- *-----------------------------------------------------------------------------
- */
-
-void
-Subdivider::makeBorderTrim( const REAL *from, const REAL *to )
-{
- REAL smin = from[0];
- REAL smax = to[0];
- REAL tmin = from[1];
- REAL tmax = to[1];
-
- pjarc = 0;
-
- Arc_ptr jarc = new(arcpool) Arc( arc_bottom, 0 );
- arctessellator.bezier( jarc, smin, smax, tmin, tmin );
- initialbin.addarc( jarc );
- pjarc = jarc->append( pjarc );
-
- jarc = new(arcpool) Arc( arc_right, 0 );
- arctessellator.bezier( jarc, smax, smax, tmin, tmax );
- initialbin.addarc( jarc );
- pjarc = jarc->append( pjarc );
-
- jarc = new(arcpool) Arc( arc_top, 0 );
- arctessellator.bezier( jarc, smax, smin, tmax, tmax );
- initialbin.addarc( jarc );
- pjarc = jarc->append( pjarc );
-
- jarc = new(arcpool) Arc( arc_left, 0 );
- arctessellator.bezier( jarc, smin, smin, tmax, tmin );
- initialbin.addarc( jarc );
- jarc->append( pjarc );
-
- assert( jarc->check() != 0 );
-}
-
-/*----------------------------------------------------------------------------
- * render - renders all monotone regions in a bin and frees the bin
- *----------------------------------------------------------------------------
- */
-
-void
-Subdivider::render( Bin& bin )
-{
- bin.markall();
-
-#ifdef N_ISOLINE_S
- slicer.setisolines( ( renderhints.display_method == N_ISOLINE_S ) ? 1 : 0 );
-#else
- slicer.setisolines( 0 );
-#endif
-
- for( Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) {
- if( jarc->ismarked() ) {
- assert( jarc->check( ) != 0 );
- Arc_ptr jarchead = jarc;
- do {
- jarc->clearmark();
- jarc = jarc->next;
- } while (jarc != jarchead);
- slicer.slice( jarc );
- }
- }
-}
-
-/*---------------------------------------------------------------------------
- * outline - render the trimmed patch by outlining the boundary
- *---------------------------------------------------------------------------
- */
-
-void
-Subdivider::outline( Bin& bin )
-{
- bin.markall();
- for( Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) {
- if( jarc->ismarked() ) {
- assert( jarc->check( ) != 0 );
- Arc_ptr jarchead = jarc;
- do {
- slicer.outline( jarc );
- jarc->clearmark();
- jarc = jarc->prev;
- } while (jarc != jarchead);
- }
- }
-}
-
-/*---------------------------------------------------------------------------
- * freejarcs - free all arcs in a bin
- *---------------------------------------------------------------------------
- */
-
-void
-Subdivider::freejarcs( Bin& bin )
-{
- bin.adopt(); /* XXX - should not be necessary */
-
- Arc_ptr jarc;
- while( (jarc = bin.removearc()) != NULL ) {
- if( jarc->pwlArc ) jarc->pwlArc->deleteMe( pwlarcpool ); jarc->pwlArc = 0;
- if( jarc->bezierArc) jarc->bezierArc->deleteMe( bezierarcpool ); jarc->bezierArc = 0;
- jarc->deleteMe( arcpool );
- }
-}
-
-/*----------------------------------------------------------------------------
- * tessellate - tessellate all Bezier arcs in a bin
- * 1) only accepts linear Bezier arcs as input
- * 2) the Bezier arcs are stored in the pwlArc structure
- * 3) only vertical or horizontal lines work
- * -- should
- * 1) represent Bezier arcs in BezierArc structure
- * (this requires a multitude of changes to the code)
- * 2) accept high degree Bezier arcs (hard)
- * 3) map the curve onto the surface to determine tessellation
- * 4) work for curves of arbitrary geometry
- *----------------------------------------------------------------------------
- */
-
-
-void
-Subdivider::tessellate( Bin& bin, REAL rrate, REAL trate, REAL lrate, REAL brate )
-{
- for( Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) {
- if( jarc->isbezier( ) ) {
- assert( jarc->pwlArc->npts == 2 );
- TrimVertex *pts = jarc->pwlArc->pts;
- REAL s1 = pts[0].param[0];
- REAL t1 = pts[0].param[1];
- REAL s2 = pts[1].param[0];
- REAL t2 = pts[1].param[1];
-
- jarc->pwlArc->deleteMe( pwlarcpool ); jarc->pwlArc = 0;
-
- switch( jarc->getside() ) {
- case arc_left:
- assert( s1 == s2 );
- arctessellator.pwl_left( jarc, s1, t1, t2, lrate );
- break;
- case arc_right:
- assert( s1 == s2 );
- arctessellator.pwl_right( jarc, s1, t1, t2, rrate );
- break;
- case arc_top:
- assert( t1 == t2 );
- arctessellator.pwl_top( jarc, t1, s1, s2, trate );
- break;
- case arc_bottom:
- assert( t1 == t2 );
- arctessellator.pwl_bottom( jarc, t1, s1, s2, brate );
- break;
- case arc_none:
- (void) abort();
- break;
- }
- assert( ! jarc->isbezier() );
- assert( jarc->check() != 0 );
- }
- }
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/subdivider.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/subdivider.h
deleted file mode 100755
index 92d41a687..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/subdivider.h
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * subdivider.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/subdivider.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glusubdivider_h_
-#define __glusubdivider_h_
-
-#include "mysetjmp.h"
-#include "bin.h"
-#include "flist.h"
-#include "slicer.h"
-#include "arctess.h"
-#include "trimvertex.h"
-#include "trimvertpool.h"
-
-class Arc;
-class Pool;
-class Renderhints;
-class Quilt;
-class Patchlist;
-class Curvelist;
-class JumpBuffer;
-
-class Subdivider {
-public:
- Subdivider( Renderhints&, Backend& );
- ~Subdivider( void );
- void clear( void );
-
- void beginTrims( void ) {}
- void beginLoop( void );
- void addArc( REAL *, Quilt *, long );
- void addArc( int, TrimVertex *, long );
- void endLoop( void ) {}
- void endTrims( void ) {}
-
- void beginQuilts( void );
- void addQuilt( Quilt * );
- void endQuilts( void ) {}
-
- void drawCurves( void );
- void drawSurfaces( long );
-
- int ccwTurn_sl( Arc_ptr, Arc_ptr );
- int ccwTurn_sr( Arc_ptr , Arc_ptr );
- int ccwTurn_tl( Arc_ptr , Arc_ptr );
- int ccwTurn_tr( Arc_ptr , Arc_ptr );
-
- void setJumpbuffer( JumpBuffer * );
-
- void set_domain_distance_u_rate(REAL u_rate)
- {
- domain_distance_u_rate = u_rate;
- }
- void set_domain_distance_v_rate(REAL v_rate)
- {
- domain_distance_v_rate = v_rate;
- }
- void set_is_domain_distance_sampling(int flag)
- {
- is_domain_distance_sampling = flag;
- }
-
-private:
- void classify_headonleft_s( Bin &, Bin &, Bin &, REAL );
- void classify_tailonleft_s( Bin &, Bin &, Bin &, REAL );
- void classify_headonright_s( Bin &, Bin &, Bin &, REAL );
- void classify_tailonright_s( Bin &, Bin &, Bin &, REAL );
- void classify_headonleft_t( Bin &, Bin &, Bin &, REAL );
- void classify_tailonleft_t( Bin &, Bin &, Bin &, REAL );
- void classify_headonright_t( Bin &, Bin &, Bin &, REAL );
- void classify_tailonright_t( Bin &, Bin &, Bin &, REAL );
-
- enum dir { down, same, up, none };
- void tessellate( Arc_ptr, REAL );
- void monotonize( Arc_ptr , Bin & );
- int isMonotone( Arc_ptr );
- int decompose( Bin &, REAL );
-
-
- Slicer slicer;
- ArcTessellator arctessellator;
- Pool arcpool;
- Pool bezierarcpool;
- Pool pwlarcpool;
- TrimVertexPool trimvertexpool;
-
- JumpBuffer* jumpbuffer;
- Renderhints& renderhints;
- Backend& backend;
-
- Bin initialbin;
- Arc_ptr pjarc;
- int s_index;
- int t_index;
- Quilt * qlist;
- Flist spbrkpts;
- Flist tpbrkpts;
- Flist smbrkpts;
- Flist tmbrkpts;
- REAL stepsizes[4];
- int showDegenerate;
- int isArcTypeBezier;
-
- void samplingSplit( Curvelist&, int );
-
- void subdivideInS( Bin& );
- void splitInS( Bin&, int, int );
- void splitInT( Bin&, int, int );
- void samplingSplit( Bin&, Patchlist&, int, int );
- void nonSamplingSplit( Bin&, Patchlist&, int, int );
- void tessellation( Bin&, Patchlist& );
- void monosplitInS( Bin&, int, int );
- void monosplitInT( Bin&, int, int );
-
- void outline( Bin & );
- void freejarcs( Bin & );
- void render( Bin & );
- void split( Bin &, Bin &, Bin &, int, REAL );
- void tessellate( Bin &, REAL, REAL, REAL, REAL );
-
- inline void setDegenerate( void ) { showDegenerate = 1; }
- inline void setNonDegenerate( void ) { showDegenerate = 0; }
- inline int showingDegenerate( void ) { return showDegenerate; }
- inline void setArcTypeBezier( void ) { isArcTypeBezier = 1; }
- inline void setArcTypePwl( void ) { isArcTypeBezier = 0; }
- inline int isBezierArcType( void ) { return isArcTypeBezier; }
-
- void makeBorderTrim( const REAL *, const REAL * );
- void split( Bin &, int, const REAL *, int, int );
- void partition( Bin &, Bin &, Bin &, Bin &, Bin &, int, REAL );
- void findIrregularS( Bin & );
- void findIrregularT( Bin & );
-
-
- inline int bbox( TrimVertex *, TrimVertex *, TrimVertex *, int );
- static int bbox( REAL, REAL, REAL, REAL, REAL, REAL );
- static int ccw( TrimVertex *, TrimVertex *, TrimVertex * );
- void join_s( Bin &, Bin &, Arc_ptr, Arc_ptr );
- void join_t( Bin &, Bin &, Arc_ptr , Arc_ptr );
- int arc_split( Arc_ptr , int, REAL, int );
- void check_s( Arc_ptr , Arc_ptr );
- void check_t( Arc_ptr , Arc_ptr );
- inline void link( Arc_ptr , Arc_ptr , Arc_ptr , Arc_ptr );
- inline void simple_link( Arc_ptr , Arc_ptr );
-
- Bin* makePatchBoundary( const REAL *from, const REAL *to );
-
- /*in domain distance method, the tessellation is controled by two numbers:
- *GLU_U_STEP: number of u-segments per unit u length of domain
- *GLU_V_STEP: number of v-segments per unit v length of domain
- *These two numbers are normally stored in mapdesc->maxs(t)rate.
- *I (ZL) put these two numbers here so that I can optimize the untrimmed
- *case in the case of domain distance sampling.
- *These two numbers are set by set_domain_distance_u_rate() and ..._v_..().
- */
- REAL domain_distance_u_rate;
- REAL domain_distance_v_rate;
- int is_domain_distance_sampling;
-};
-
-inline void
-Subdivider::beginLoop( void )
-{
- pjarc = 0;
-}
-
-
-#endif /* __glusubdivider_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/tobezier.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/tobezier.cc
deleted file mode 100755
index 12a31447f..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/tobezier.cc
+++ /dev/null
@@ -1,689 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * tobezier.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/tobezier.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "myassert.h"
-#include "mystdio.h"
-#include "mystring.h"
-#include "quilt.h"
-#include "knotvector.h"
-
-/* local type definitions */
-struct Breakpt { /* breakpoints */
- Knot value; /* value */
- int multi; /* multiplicity */
- int def; /* deficit */
-};
-
-struct Knotspec { /* knotvector format */
- long order; /* order of spline */
- Knot_ptr inkbegin; /* input knot sequence */
- Knot_ptr inkend; /* location after last knot */
- Knot_ptr outkbegin; /* in-process knot subsequence */
- Knot_ptr outkend; /* location after last knot */
- Knot_ptr kleft; /* */
- Knot_ptr kright; /* */
- Knot_ptr kfirst; /* */
- Knot_ptr klast; /* */
- Knot_ptr sbegin; /* conversion factor values */
- Breakpt * bbegin; /* in-process breakpoints */
- Breakpt * bend; /* last breakpoint */
- int ncoords; /* coordinates per control point */
- int prestride; /* stride between input points */
- int poststride; /* stride between output points */
- int preoffset; /* scaled point offset */
- int postoffset; /* scaled point offset */
- int prewidth; /* width of dimension */
- int postwidth; /* width of dimension */
- int istransformed; /* was dimension transformed */
- Knotspec * next; /* next knotspec */
- Knotspec * kspectotrans; /* knotspec in transformation direction */
-
- Knotspec( void );
- ~Knotspec( void );
- void factors( void );
- void insert( REAL * );
- void preselect();
- void select( void );
- void copy( INREAL *, REAL * );
- void breakpoints( void );
- void knots( void );
- void transform( REAL * );
- void showpts( REAL * );
-
- void pt_io_copy( REAL *, INREAL * );
- void pt_oo_copy( REAL *, REAL * );
- void pt_oo_sum( REAL*, REAL*, REAL*, Knot, Knot );
-};
-
-struct Splinespec { /* a non-uniform tensor element */
- Splinespec( int );
- ~Splinespec(void);
- Knotspec *kspec; /* format of each param. dir. */
- int dim; /* domain dimension */
- REAL * outcpts; /* Bezier control points */
-
- void kspecinit( Knotvector & );
- void kspecinit( Knotvector &, Knotvector & );
- void select( void );
- void layout( long );
- void setupquilt( Quilt_ptr );
- void copy( INREAL * );
- void transform( void );
-};
-
-/*-----------------------------------------------------------------------------
- * Quilt::toBezier - convert from NURBS to rational Bezier
- *-----------------------------------------------------------------------------
- */
-
-void
-Quilt::toBezier(
- Knotvector& knotvector, /* a knot vector */
- INREAL *ctlpts, /* input contol points */
- long ncoords ) /* number of coordinates per control point */
-{
- Splinespec spline( 1 );
- spline.kspecinit( knotvector );
- spline.select();
- spline.layout( ncoords );
- spline.setupquilt( this );
- spline.copy( ctlpts );
- spline.transform();
-}
-
-void
-Quilt::toBezier(
- Knotvector& sknotvector, /* a knot vector */
- Knotvector& tknotvector, /* a knot vector */
- INREAL *ctlpts, /* input contol points */
- long ncoords ) /* number of coordinates per control point */
-{
- Splinespec spline( 2 );
- spline.kspecinit( sknotvector, tknotvector );
- spline.select();
- spline.layout( ncoords );
- spline.setupquilt( this );
- spline.copy( ctlpts );
- spline.transform();
-}
-Splinespec::Splinespec( int dimen )
-{
- dim = dimen;
-}
-
-Splinespec::~Splinespec( void )
-{
- /* Note: do NOT delete 'outcpts' here since its address (not contents)
- * is copied in 'cpts' in this file in function Splinespec::setupquilt().
- * This block of memory will eventually be deleted in file quilt.c++ in
- * function Quilt::deleteMe() through 'cpts' so do NOT delete it here!
- */
- Knotspec *ktrav= kspec; //start at beginning of list
- while (ktrav != 0) { //any items to delete?
- Knotspec *deleteThis= ktrav; //remember to delete this
- ktrav= ktrav->next; //go to next item if any
- delete deleteThis; //delete it
- }
-} /* ~Splinespec() */
-
-/*-----------------------------------------------------------------------------
- * Splinespec::kspecinit - initialize Splinespec structure
- *
- * Client: Quilt::toBezier
- *-----------------------------------------------------------------------------
- */
-
-void
-Splinespec::kspecinit( Knotvector& knotvector )
-{
- kspec = new Knotspec;
- kspec->inkbegin = knotvector.knotlist;
- kspec->inkend = knotvector.knotlist + knotvector.knotcount;
- kspec->prestride = (int) knotvector.stride;
- kspec->order = knotvector.order;
- kspec->next = NULL;
-}
-
-void
-Splinespec::kspecinit( Knotvector& sknotvector, Knotvector& tknotvector )
-{
- kspec = new Knotspec;
- Knotspec *tkspec = new Knotspec;
-
- kspec->inkbegin = sknotvector.knotlist;
- kspec->inkend = sknotvector.knotlist + sknotvector.knotcount;
- kspec->prestride = (int) sknotvector.stride;
- kspec->order = sknotvector.order;
- kspec->next = tkspec;
-
- tkspec->inkbegin = tknotvector.knotlist;
- tkspec->inkend = tknotvector.knotlist + tknotvector.knotcount;
- tkspec->prestride = (int) tknotvector.stride;
- tkspec->order = tknotvector.order;
- tkspec->next = NULL;
-}
-
-
-/*-----------------------------------------------------------------------------
- * Splinespec::select - select the subsegments to copy
- *
- * Client: gl_quilt_to_bezier
- *-----------------------------------------------------------------------------
- */
-
-void
-Splinespec::select( )
-{
- for( Knotspec *knotspec = kspec; knotspec; knotspec = knotspec->next ) {
- knotspec->preselect();
- knotspec->select();
- }
-}
-
-/*-----------------------------------------------------------------------------
- * Splinespec::layout -
- *
- * Client: gl_quilt_to_bezier
- *-----------------------------------------------------------------------------
- */
-
-void
-Splinespec::layout( long ncoords )
-{
-
- long stride = ncoords;
- for( Knotspec *knotspec = kspec; knotspec; knotspec=knotspec->next ) {
- knotspec->poststride = (int) stride;
- stride *= ((knotspec->bend-knotspec->bbegin)*knotspec->order + knotspec->postoffset);
- knotspec->preoffset *= knotspec->prestride;
- knotspec->prewidth *= knotspec->poststride;
- knotspec->postwidth *= knotspec->poststride;
- knotspec->postoffset *= knotspec->poststride;
- knotspec->ncoords = (int) ncoords;
- }
- outcpts = new REAL[stride];
- assert( outcpts != 0 );
-}
-
-/*-----------------------------------------------------------------------------
- * Splinespec::copy - copy the control points of current subobject
- *
- * Client: gl_quilt_to_bezier
- *-----------------------------------------------------------------------------
- */
-
-void
-Splinespec::copy( INREAL *incpts )
-{
- kspec->copy( incpts, outcpts );
-}
-
-/*-----------------------------------------------------------------------------
- * Splinespec::setupquilt - assign all quilt variables from knotspec
- *
- * Client: gl_quilt_to_bezier
- *-----------------------------------------------------------------------------
- */
-
-void
-Splinespec::setupquilt( Quilt_ptr quilt )
-{
- Quiltspec_ptr qspec = quilt->qspec;
- quilt->eqspec = qspec + dim;
- for( Knotspec *knotspec = kspec; knotspec; knotspec=knotspec->next, qspec++ ) {
- qspec->stride = knotspec->poststride;
- qspec->width = knotspec->bend - knotspec->bbegin;
- qspec->order = (int) knotspec->order;
- qspec->offset = knotspec->postoffset;
- qspec->index = 0;
- qspec->bdry[0] = (knotspec->kleft == knotspec->kfirst) ? 1 : 0;
- qspec->bdry[1] = (knotspec->kright == knotspec->klast) ? 1 : 0;
- qspec->breakpoints = new Knot[qspec->width+1];
- Knot_ptr k = qspec->breakpoints;
- for( Breakpt *bk = knotspec->bbegin; bk <= knotspec->bend; bk++ )
- *(k++) = bk->value;
- }
- quilt->cpts = outcpts;
- quilt->next = 0;
-}
-
-/*-----------------------------------------------------------------------------
- * Splinespec::transform - convert a spline to Bezier format
- *
- * Client: gl_quilt_to_bezier
- *-----------------------------------------------------------------------------
- */
-
-void
-Splinespec::transform( void )
-{
- Knotspec *knotspec;
- for( knotspec = kspec; knotspec; knotspec=knotspec->next )
- knotspec->istransformed = 0;
-
- for( knotspec = kspec; knotspec; knotspec=knotspec->next ) {
- for( Knotspec *kspec2 = kspec; kspec2; kspec2=kspec2->next )
- kspec2->kspectotrans = knotspec;
- kspec->transform( outcpts );
- knotspec->istransformed = 1;
- }
-}
-
-
-/*-----------------------------------------------------------------------------
- * Knotspec::Knotspec - constuct a knot spec
- *-----------------------------------------------------------------------------
- */
-
-Knotspec::Knotspec( void )
-{
- bbegin = 0;
- sbegin = 0;
- outkbegin = 0;
-}
-
-/*-----------------------------------------------------------------------------
- * Knotspec::copy - copy the control points along minor direction
- *
- * Client: Splinespec::copy
- *-----------------------------------------------------------------------------
- */
-
-void
-Knotspec::copy( INREAL *inpt, REAL *outpt )
-{
- inpt = (INREAL *) (((char *) inpt) + preoffset);
-
- if( next ) {
- for( REAL *lpt=outpt+prewidth; outpt != lpt; outpt += poststride ) {
- next->copy( inpt, outpt );
- inpt = (INREAL *) (((char *) inpt) + prestride);
- }
- } else {
- for( REAL *lpt=outpt+prewidth; outpt != lpt; outpt += poststride ) {
- pt_io_copy( outpt, inpt );
- inpt = (INREAL *) (((char *) inpt) + prestride);
- }
- }
-}
-
-/*-----------------------------------------------------------------------------
- * Knotspec::showpts - print out points before transformation
- *
- * Client: Knotspec::select
- *-----------------------------------------------------------------------------
- */
-void
-Knotspec::showpts( REAL *outpt )
-{
- if( next ) {
- for( REAL *lpt=outpt+prewidth; outpt != lpt; outpt += poststride )
- next->showpts( outpt );
- } else {
- for( REAL *lpt=outpt+prewidth; outpt != lpt; outpt += poststride )
- dprintf( "show %g %g %g\n", outpt[0], outpt[1], outpt[2] );
- }
-}
-
-/*-----------------------------------------------------------------------------
- * Knotspec::factors - precompute scale factors
- * - overwrites knot vector, actual new knot vector is NOT produced
- *
- * Client: Knotspec::select
- *-----------------------------------------------------------------------------
- */
-
-void
-Knotspec::factors( void )
-{
- Knot *mid = (outkend - 1) - order + bend->multi;
- Knot_ptr fptr = sbegin;
-
- for( Breakpt *bpt = bend; bpt >= bbegin; bpt-- ) {
- mid -= bpt->multi; // last knot less than knot to insert
- int def = bpt->def - 1; // number of knots to insert
- if( def <= 0 ) continue;
- Knot kv = bpt->value; // knot to insert
-
- Knot *kf = (mid-def) + (order-1);
- for( Knot *kl = kf + def; kl != kf; kl-- ) {
- Knot *kh, *kt;
- for( kt=kl, kh=mid; kt != kf; kh--, kt-- )
- *(fptr++) = (kv - *kh) / (*kt - *kh);
- *kl = kv;
- }
- }
-}
-
-/*-----------------------------------------------------------------------------
- * Knotspec::insert - convert subobject in direction of kspec into Bezier
- *
- * Client: Knotspec::transform
- *-----------------------------------------------------------------------------
- */
-
-void
-Knotspec::insert( REAL *p )
-{
- Knot_ptr fptr = sbegin;
- REAL *srcpt = p + prewidth - poststride;
- REAL *dstpt = p + postwidth + postoffset - poststride;
- Breakpt *bpt = bend;
-
- for( REAL *pend = srcpt - poststride*bpt->def; srcpt != pend; pend +=poststride ) {
- REAL *p1 = srcpt;
- for( REAL *p2 = srcpt-poststride; p2 != pend; p1 = p2, p2 -= poststride ) {
- pt_oo_sum( p1, p1, p2, *fptr, 1.0-*fptr );
- fptr++;
- }
- }
-
- for( --bpt; bpt >= bbegin; bpt-- ) {
-
- for( int multi = bpt->multi; multi > 0; multi-- ) {
- pt_oo_copy( dstpt, srcpt );
- dstpt -= poststride;
- srcpt -= poststride;
- }
-
- for( REAL *pend = srcpt - poststride*bpt->def; srcpt != pend; pend +=poststride, dstpt-=poststride ) {
- pt_oo_copy( dstpt, srcpt );
- REAL *p1 = srcpt;
-
- for( REAL *p2 = srcpt-poststride; p2 != pend; p1=p2, p2 -= poststride ) {
- pt_oo_sum( p1, p1, p2, *fptr, 1.0-*fptr );
- fptr++;
- }
- }
- }
-}
-
-/*-----------------------------------------------------------------------------
- * Knotspec::preselect - initialize kspec for processing
- *
- * Client: Splinespec::select
- *-----------------------------------------------------------------------------
- */
-
-void
-Knotspec::preselect( void )
-{
- Knot kval;
-
- /* position klast after last knot of "last" breakpoint */
- for( klast = inkend - order, kval = *klast; klast != inkend; klast++ )
- if( ! identical( *klast, kval ) ) break;
-
- /* position kfirst after last knot of "first" breakpoint */
- for( kfirst = inkbegin+order-1, kval= *kfirst; kfirst != inkend; kfirst++ )
- if( ! identical( *kfirst, kval ) ) break;
-
- /* compute multiplicity of first breakpoint */
- Knot_ptr k;
- for( k = kfirst - 1; k >= inkbegin; k-- )
- if( ! identical( kval, *k ) ) break;
- k++;
-
- /* allocate space for breakpoints -
- use worst case estimate on number of breakpoints */
-
- bbegin = new Breakpt[(klast - kfirst)+1];
- /* record multiplicity and value of first breakpoint */
- bbegin->multi = kfirst - k;
- bbegin->value = kval;
- bend = bbegin;
-
- kleft = kright = kfirst;
-}
-
-
-/*-----------------------------------------------------------------------------
- * Knotspec::select - Knotspec::select segments and precompute scale factors
- *
- * Client: Splinespec::select
- *-----------------------------------------------------------------------------
- */
-
-void
-Knotspec::select( void )
-{
- breakpoints();
- knots();
- factors();
-
- preoffset = kleft - (inkbegin + order);
- postwidth = (int)((bend - bbegin) * order);
- prewidth = (int)((outkend - outkbegin) - order);
- postoffset = (bbegin->def > 1) ? (bbegin->def-1) : 0;
-}
-
-/*-----------------------------------------------------------------------------
- * Knotspec::breakpoints - compute breakpoints for knotspec
- *
- * Client: Knotspec::select
- *-----------------------------------------------------------------------------
- */
-
-void
-Knotspec::breakpoints( void )
-{
- Breakpt *ubpt = bbegin;
- Breakpt *ubend = bend;
- long nfactors = 0;
-
- ubpt->value = ubend->value;
- ubpt->multi = ubend->multi;
-
- kleft = kright;
-
- for( ; kright != klast; kright++ ) {
- if ( identical(*kright,ubpt->value) ) {
- (ubpt->multi)++;
- } else {
- ubpt->def = (int) (order - ubpt->multi);
- nfactors += (ubpt->def * (ubpt->def - 1)) / 2;
- (++ubpt)->value = *kright;
- ubpt->multi = 1;
- }
- }
- ubpt->def = (int) (order - ubpt->multi);
- nfactors += (ubpt->def * (ubpt->def - 1)) / 2;
-
- bend = ubpt;
-
- if( nfactors ) {
- sbegin = new Knot[nfactors];
- } else {
- sbegin = NULL;
- }
-}
-
-
-/*-----------------------------------------------------------------------------
- * Knotspec::knots - copy relevant subsequence of knots into temporary area
- *
- * Client: Knotspec::select
- *-----------------------------------------------------------------------------
- */
-
-void
-Knotspec::knots( void )
-{
- Knot_ptr inkpt = kleft - order;
- Knot_ptr inkend = kright + bend->def;
-
- /* allocate space for knots and factors */
- outkbegin = new Knot[inkend-inkpt];
- Knot_ptr outkpt;
- for( outkpt = outkbegin; inkpt != inkend; inkpt++, outkpt++ )
- *outkpt = *inkpt;
-
- outkend = outkpt;
-}
-
-
-/*-----------------------------------------------------------------------------
- * Knotspec::transform - convert a spline along a given direction
- *
- * Client: Splienspec::transform
- *-----------------------------------------------------------------------------
- */
-
-void
-Knotspec::transform( REAL *p )
-{
- if( next ) {
- if( this == kspectotrans ) {
- next->transform( p );
- } else {
- if( istransformed ) {
- p += postoffset;
- for( REAL *pend = p + postwidth; p != pend; p += poststride )
- next->transform( p );
- } else {
- REAL *pend = p + prewidth;
- for( ; p != pend; p += poststride )
- next->transform( p );
- }
- }
- } else {
- if( this == kspectotrans ) {
- insert( p );
- } else {
- if( istransformed ) {
- p += postoffset;
- for( REAL *pend = p + postwidth; p != pend; p += poststride )
- kspectotrans->insert( p );
- } else {
- REAL *pend = p + prewidth;
- for( ; p != pend; p += poststride )
- kspectotrans->insert( p );
- }
- }
- }
-}
-
-/*-----------------------------------------------------------------------------
- * Knotspec::~Knotspec - free space alocated for knotspec
- *-----------------------------------------------------------------------------
- */
-
-Knotspec::~Knotspec( void )
-{
- if( bbegin ) delete[] bbegin;
- if( sbegin ) delete[] sbegin;
- if( outkbegin ) delete[] outkbegin;
-}
-
-
-/*-----------------------------------------------------------------------------
- * pt_io_copy - make internal copy of input cntrl pt. of x coords
- *-----------------------------------------------------------------------------
- */
-
-void
-Knotspec::pt_io_copy( REAL *topt, INREAL *frompt )
-{
- switch( ncoords ) {
- case 4:
- topt[3] = (REAL) frompt[3];
- case 3:
- topt[2] = (REAL) frompt[2];
- case 2:
- topt[1] = (REAL) frompt[1];
- case 1:
- topt[0] = (REAL) frompt[0];
- break;
- default: {
- for( int i = 0; i < ncoords; i++ )
- *topt++ = (REAL) *frompt++;
- }
- }
-}
-
-/*-----------------------------------------------------------------------------
- * pt_oo_copy - make internal copy of internal cntrl pt. of x coords
- *-----------------------------------------------------------------------------
- */
-
-void
-Knotspec::pt_oo_copy( REAL *topt, REAL *frompt )
-{
- switch( ncoords ) {
- case 4:
- topt[3] = frompt[3];
- case 3:
- topt[2] = frompt[2];
- case 2:
- topt[1] = frompt[1];
- case 1:
- topt[0] = frompt[0];
- break;
- default:
- memcpy( topt, frompt, ncoords * sizeof( REAL ) );
- }
-}
-
-/*-----------------------------------------------------------------------------
- * pt_oo_sum - compute affine combination of internal cntrl pts
- *-----------------------------------------------------------------------------
- */
-
-void
-Knotspec::pt_oo_sum( REAL *x, REAL *y, REAL *z, Knot a, Knot b )
-{
- switch( ncoords ) {
- case 4:
- x[3] = a * y[3] + b * z[3];
- case 3:
- x[2] = a * y[2] + b * z[2];
- case 2:
- x[1] = a * y[1] + b * z[1];
- case 1:
- x[0] = a * y[0] + b * z[0];
- break;
- default: {
- for( int i = 0; i < ncoords; i++ )
- *x++ = a * *y++ + b * *z++;
- }
- }
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimline.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimline.cc
deleted file mode 100755
index 5027b0512..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimline.cc
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * trimline.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/trimline.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "myassert.h"
-#include "mystdio.h"
-#include "trimline.h"
-#include "backend.h"
-
-Trimline::Trimline()
-{
- size = 0; pts = 0; numverts = 0;
- tinterp = &t; binterp = &b;
-}
-
-Trimline::~Trimline()
-{
- if( pts ) delete[] pts;
-}
-
-void
-Trimline::init( TrimVertex *v )
-{
- reset();
- grow(1);
- append(v);
-}
-
-inline void
-Trimline::grow( long npts )
-{
- if( size < npts ) {
- size = 2 * npts;
- if( pts ) delete[] pts;
- pts = new TrimVertex_p[size];
- }
-}
-
-inline void
-Trimline::append( TrimVertex *v )
-{
- assert( numverts != size );
- pts[numverts++] = v;
-}
-
-void
-Trimline::init( long npts, Arc_ptr jarc, long last )
-{
- jarcl.init( jarc, 0, last );
- grow( npts + 2 );
-}
-
-inline void
-Trimline::swap()
-{
- TrimVertex *tmp=tinterp;
- tinterp=binterp;
- binterp=tmp;
-}
-
-void
-Trimline::getNextPt()
-{
- *binterp = *jarcl.getnextpt();
-}
-
-void
-Trimline::getPrevPt()
-{
- *binterp = *jarcl.getprevpt();
-}
-
-/*----------------------------------------------------------------------
- * getNextPts - make arrays of pointers to trim points on left and right
- * hulls of trim strip.
- *----------------------------------------------------------------------
- */
-void
-Trimline::getNextPts( REAL vval, Backend& backend )
-{
- reset(); swap(); append( tinterp );
- assert( tinterp->param[1] >= vval );
-
- register TrimVertex *p;
- for( p=jarcl.getnextpt() ; p->param[1] >= vval; p=jarcl.getnextpt() ) {
- append( p );
- }
-
- /* compute and copy pointer to final point on left hull */
- if( interpvert( last(), p, binterp, vval ) ) {
- binterp->nuid = p->nuid;
- backend.triangle( p, binterp, last() );
- append( binterp );
- }
- jarcl.reverse();
- (void) jarcl.getprevpt(); /* reset jarcl to proper position */
- jarcl.reverse();
-}
-
-void
-Trimline::getPrevPts( REAL vval, Backend& backend )
-{
- reset(); swap(); append( tinterp );
- assert( tinterp->param[1] >= vval );
-
- register TrimVertex *q;
- for( q=jarcl.getprevpt(); q->param[1] >= vval; q=jarcl.getprevpt() ) {
- append( q );
- }
-
- /* compute and copy pointer to final point on right hull */
- if( interpvert( q, last(), binterp, vval ) ) {
- binterp->nuid = q->nuid;
- backend.triangle( last(), binterp, q );
- append( binterp );
- }
- jarcl.reverse();
- (void) jarcl.getnextpt(); /* reset jarcl to proper position */
- jarcl.reverse();
-}
-
-void
-Trimline::getNextPts( Arc_ptr botarc )
-{
- reset(); swap(); append( tinterp );
-
- PwlArc *lastpwl = botarc->prev->pwlArc;
- TrimVertex *lastpt1 = &lastpwl->pts[lastpwl->npts-1];
- TrimVertex *lastpt2 = botarc->pwlArc->pts;
-
- register TrimVertex *p = jarcl.getnextpt();
- for( append( p ); p != lastpt2; append( p ) ) {
- assert( p != lastpt1 );
- p = jarcl.getnextpt();
- }
-}
-
-void
-Trimline::getPrevPts( Arc_ptr botarc )
-{
- reset(); swap(); append( tinterp );
-
- PwlArc *lastpwl = botarc->prev->pwlArc;
- TrimVertex *lastpt1 = &lastpwl->pts[lastpwl->npts-1];
- TrimVertex *lastpt2 = botarc->pwlArc->pts;
-
- register TrimVertex *q = jarcl.getprevpt();
- for( append( q ); q != lastpt1; append( q ) ) {
- assert( q != lastpt2 );
- q = jarcl.getprevpt();
- }
-}
-
-
-long
-Trimline::interpvert( TrimVertex *a, TrimVertex *b, TrimVertex *c, REAL vval )
-{
- REAL denom = a->param[1] - b->param[1];
-
- if(denom != 0) {
- if( vval == a->param[1] ) {
- c->param[0] = a->param[0];
- c->param[1] = a->param[1];
- c->nuid = a->nuid;
- return 0;
- } else if( vval == b->param[1] ) {
- c->param[0] = b->param[0];
- c->param[1] = b->param[1];
- c->nuid = b->nuid;
- return 0;
- } else {
- REAL r = (a->param[1] - vval)/denom;
- c->param[0] = a->param[0] - r * (a->param[0] - b->param[0]);
- c->param[1] = vval;
- return 1;
- }
- } else {
- c->param[0] = a->param[0];
- c->param[1] = a->param[1];
- c->nuid = a->nuid;
- return 0;
- }
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimline.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimline.h
deleted file mode 100755
index 5a84309d7..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimline.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * trimline.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/trimline.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glutrimline_h_
-#define __glutrimline_h_
-
-class Arc;
-class Backend;
-
-#include "trimvertex.h"
-#include "jarcloc.h"
-
-
-class Trimline {
-private:
- TrimVertex** pts;
- long numverts;
- long i;
- long size;
- Jarcloc jarcl;
- TrimVertex t, b;
- TrimVertex *tinterp, *binterp;
- void reset( void ) { numverts = 0; }
- inline void grow( long );
- inline void swap( void );
- inline void append( TrimVertex * );
- static long interpvert( TrimVertex *, TrimVertex *, TrimVertex *, REAL );
-
-
-
-public:
- Trimline();
- ~Trimline();
- void init( TrimVertex * );
- void init( long, Arc_ptr, long );
- void getNextPt( void );
- void getPrevPt( void );
- void getNextPts( REAL, Backend & );
- void getPrevPts( REAL, Backend & );
- void getNextPts( Arc_ptr );
- void getPrevPts( Arc_ptr );
- inline TrimVertex * next( void );
- inline TrimVertex * prev( void );
- inline TrimVertex * first( void );
- inline TrimVertex * last( void );
-};
-
-inline TrimVertex *
-Trimline::next( void )
-{
- if( i < numverts) return pts[i++]; else return 0;
-}
-
-inline TrimVertex *
-Trimline::prev( void )
-{
- if( i >= 0 ) return pts[i--]; else return 0;
-}
-
-inline TrimVertex *
-Trimline::first( void )
-{
- i = 0; return pts[i];
-}
-
-inline TrimVertex *
-Trimline::last( void )
-{
- i = numverts; return pts[--i];
-}
-#endif /* __glutrimline_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimregion.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimregion.cc
deleted file mode 100755
index f8e7eb31e..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimregion.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * trimregion.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/trimregion.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "myassert.h"
-#include "mystdio.h"
-#include "trimregion.h"
-#include "backend.h"
-
-TrimRegion::TrimRegion( void )
-{
-}
-
-void
-TrimRegion::setDu( REAL du )
-{
- oneOverDu = 1.0/du;
-}
-
-void
-TrimRegion::init( long npts, Arc_ptr extrema )
-{
- left.init( npts, extrema, extrema->pwlArc->npts - 1 );
- left.getNextPt();
-
- right.init( npts, extrema, 0 );
- right.getPrevPt();
-}
-
-void
-TrimRegion::getPts( Arc_ptr extrema )
-{
- left.getNextPts( extrema );
- right.getPrevPts( extrema );
-}
-
-void
-TrimRegion::getPts( Backend &backend )
-{
- left.getNextPts( bot.vval, backend );
- right.getPrevPts( bot.vval, backend );
-}
-
-void
-TrimRegion::getGridExtent( void )
-{
- getGridExtent( left.last(), right.last() );
-}
-
-void
-TrimRegion::getGridExtent( TrimVertex *l, TrimVertex *r )
-{
- bot.ustart = (long) ((l->param[0] - uarray.uarray[0])*oneOverDu);
- if( l->param[0] >= uarray.uarray[bot.ustart] ) bot.ustart++;
-// if( l->param[0] > uarray.uarray[bot.ustart] ) bot.ustart++;
- assert( l->param[0] <= uarray.uarray[bot.ustart] );
- assert( l->param[0] >= uarray.uarray[bot.ustart-1] );
-
- bot.uend = (long) ((r->param[0] - uarray.uarray[0])*oneOverDu);
- if( uarray.uarray[bot.uend] >= r->param[0] ) bot.uend--;
-// if( uarray.uarray[bot.uend] > r->param[0] ) bot.uend--;
- assert( r->param[0] >= uarray.uarray[bot.uend] );
- assert( r->param[0] <= uarray.uarray[bot.uend+1] );
-}
-
-int
-TrimRegion::canTile( void )
-{
- TrimVertex *lf = left.first();
- TrimVertex *ll = left.last();
- TrimVertex *l = ( ll->param[0] > lf->param[0] ) ? ll : lf;
-
- TrimVertex *rf = right.first();
- TrimVertex *rl = right.last();
- TrimVertex *r = ( rl->param[0] < rf->param[0] ) ? rl : rf;
- return (l->param[0] <= r->param[0]) ? 1 : 0;
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimregion.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimregion.h
deleted file mode 100755
index 012f9a862..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimregion.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * trimregion.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/trimregion.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glutrimregion_h_
-#define __glutrimregion_h_
-
-#include "trimline.h"
-#include "gridline.h"
-#include "uarray.h"
-
-class Arc;
-class Backend;
-
-class TrimRegion {
-public:
- TrimRegion();
- Trimline left;
- Trimline right;
- Gridline top;
- Gridline bot;
- Uarray uarray;
-
- void init( REAL );
- void advance( REAL, REAL, REAL );
- void setDu( REAL );
- void init( long, Arc_ptr );
- void getPts( Arc_ptr );
- void getPts( Backend & );
- void getGridExtent( TrimVertex *, TrimVertex * );
- void getGridExtent( void );
- int canTile( void );
-private:
- REAL oneOverDu;
-};
-
-inline void
-TrimRegion::init( REAL vval )
-{
- bot.vval = vval;
-}
-
-inline void
-TrimRegion::advance( REAL topVindex, REAL botVindex, REAL botVval )
-{
- top.vindex = (long) topVindex;
- bot.vindex = (long) botVindex;
- top.vval = bot.vval;
- bot.vval = botVval;
- top.ustart = bot.ustart;
- top.uend = bot.uend;
-}
-#endif /* __glutrimregion_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimvertex.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimvertex.h
deleted file mode 100755
index aa9df050f..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimvertex.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * trimvertex.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/trimvertex.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glutrimvertex_h_
-#define __glutrimvertex_h_
-
-#include "types.h"
-
-/*#define USE_OPTTT*/
-
-class TrimVertex { /* a vertex on a trim curve */
-public:
- REAL param[2]; /* parametric space coords */
-#ifdef USE_OPTTT
- REAL cache_point[4]; //only when USE_OPTTT is on in slicer.c++
- REAL cache_normal[3];
-#endif
- long nuid;
-};
-
-typedef class TrimVertex *TrimVertex_p;
-
-inline REAL
-det3( TrimVertex *a, TrimVertex *b, TrimVertex *c )
-{
- return a->param[0] * (b->param[1]-c->param[1]) +
- b->param[0] * (c->param[1]-a->param[1]) +
- c->param[0] * (a->param[1]-b->param[1]);
-}
-
-#endif /* __glutrimvertex_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimvertpool.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimvertpool.cc
deleted file mode 100755
index e52b1dc43..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimvertpool.cc
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * trimvertexpool.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/trimvertpool.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "myassert.h"
-#include "mystdio.h"
-#include "mystring.h"
-#include "trimvertex.h"
-#include "trimvertpool.h"
-#include "bufpool.h"
-
-/*----------------------------------------------------------------------------
- * TrimVertexPool::TrimVertexPool
- *----------------------------------------------------------------------------
- */
-TrimVertexPool::TrimVertexPool( void )
- : pool( sizeof(TrimVertex)*3, 32, "Threevertspool" )
-{
- // initialize array of pointers to vertex lists
- nextvlistslot = 0;
- vlistsize = INIT_VERTLISTSIZE;
- vlist = new TrimVertex_p[vlistsize];
-}
-
-/*----------------------------------------------------------------------------
- * TrimVertexPool::~TrimVertexPool
- *----------------------------------------------------------------------------
- */
-TrimVertexPool::~TrimVertexPool( void )
-{
- // free all arrays of TrimVertices vertices
- while( nextvlistslot ) {
- delete vlist[--nextvlistslot];
- }
-
- // reallocate space for array of pointers to vertex lists
- if( vlist ) delete[] vlist;
-}
-
-/*----------------------------------------------------------------------------
- * TrimVertexPool::clear
- *----------------------------------------------------------------------------
- */
-void
-TrimVertexPool::clear( void )
-{
- // reinitialize pool of 3 vertex arrays
- pool.clear();
-
- // free all arrays of TrimVertices vertices
- while( nextvlistslot ) {
- delete vlist[--nextvlistslot];
- vlist[nextvlistslot] = 0;
- }
-
- // reallocate space for array of pointers to vertex lists
- if( vlist ) delete[] vlist;
- vlist = new TrimVertex_p[vlistsize];
-}
-
-
-/*----------------------------------------------------------------------------
- * TrimVertexPool::get - allocate a vertex list
- *----------------------------------------------------------------------------
- */
-TrimVertex *
-TrimVertexPool::get( int n )
-{
- TrimVertex *v;
- if( n == 3 ) {
- v = (TrimVertex *) pool.new_buffer();
- } else {
- if( nextvlistslot == vlistsize ) {
- vlistsize *= 2;
- TrimVertex_p *nvlist = new TrimVertex_p[vlistsize];
- memcpy( nvlist, vlist, nextvlistslot * sizeof(TrimVertex_p) );
- if( vlist ) delete[] vlist;
- vlist = nvlist;
- }
- v = vlist[nextvlistslot++] = new TrimVertex[n];
- }
- return v;
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimvertpool.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimvertpool.h
deleted file mode 100755
index e5b38c228..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimvertpool.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * trimvertexpool.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/trimvertpool.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glutrimvertpool_h_
-#define __glutrimvertpool_h_
-
-#include "bufpool.h"
-
-class TrimVertex;
-
-#define INIT_VERTLISTSIZE 200
-
-class TrimVertexPool {
-public:
- TrimVertexPool( void );
- ~TrimVertexPool( void );
- void clear( void );
- TrimVertex * get( int );
-private:
- Pool pool;
- TrimVertex ** vlist;
- int nextvlistslot;
- int vlistsize;
-};
-#endif /* __glutrimvertpool_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/types.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/types.h
deleted file mode 100755
index cf1761f13..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/types.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * types.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/types.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glutypes_h_
-#define __glutypes_h_
-
-//typedef double INREAL;
-#define INREAL float
-typedef float REAL;
-typedef void (*Pfvv)( void );
-typedef void (*Pfvf)( float * );
-typedef int (*cmpfunc)(const void *, const void *);
-typedef REAL Knot, *Knot_ptr;/* knot values */
-
-#endif /* __glutypes_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/uarray.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/uarray.cc
deleted file mode 100755
index 330b69c51..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/uarray.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * uarray.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/uarray.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "myassert.h"
-#include "mystdio.h"
-#include "uarray.h"
-#include "arc.h"
-
-Uarray::Uarray( void )
-{
- uarray = 0;
- size = 0;
-}
-
-Uarray::~Uarray( void )
-{
- if( uarray ) delete[] uarray;
-}
-
-long
-Uarray::init( REAL delta, Arc_ptr lo, Arc_ptr hi )
-{
- ulines = (long) ((hi->tail()[0] - lo->tail()[0])/delta) + 3;
- if( size < ulines ) {
- size = ulines * 2;
- if( uarray ) delete[] uarray;
- uarray = new REAL[size];
- assert( uarray != 0);
- }
- uarray[0] = lo->tail()[0] - delta/2.0;
- for( long i = 1 ; i != ulines; i++ )
- uarray[i] = uarray[0] + i*delta;
- return ulines;
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/uarray.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/uarray.h
deleted file mode 100755
index bd6421aae..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/uarray.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * uarray.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/uarray.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gluuarray_h_
-#define __gluuarray_h_
-
-#include "types.h"
-
-class Arc;
-typedef class Arc *Arc_ptr;
-
-class Uarray {
-private:
- long size;
- long ulines;
-public:
- Uarray();
- ~Uarray();
- long init( REAL, Arc_ptr, Arc_ptr );
- REAL * uarray;
-};
-
-#endif /* __gluuarray_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/varray.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/varray.cc
deleted file mode 100755
index d540d50d2..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/varray.cc
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * varray.c++
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/varray.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#include "glimports.h"
-#include "myassert.h"
-#include "mystdio.h"
-#include "varray.h"
-#include "arc.h"
-#include "math.h" // fabs()
-
-#define TINY 0.0001
-inline long sgn( REAL x )
-{
- return (x < -TINY) ? -1 : ((x > TINY) ? 1 : 0 );
-}
-
-
-Varray::Varray( void )
-{
- varray = 0;
- size = 0;
-}
-
-Varray::~Varray( void )
-{
- if( varray ) delete[] varray;
-}
-
-inline void
-Varray::update( Arc_ptr arc, long dir[2], REAL val )
-{
- register long ds = sgn(arc->tail()[0] - arc->prev->tail()[0]);
- register long dt = sgn(arc->tail()[1] - arc->prev->tail()[1]);
-
- if( dir[0] != ds || dir[1] != dt ) {
- dir[0] = ds;
- dir[1] = dt;
- append( val );
- }
-}
-
-void
-Varray::grow( long guess )
-{
- if( size < guess ) {
- size = guess * 2;
- if( varray ) delete[] varray;
- varray = new REAL[size];
- assert( varray != 0 );
- }
-}
-
-long
-Varray::init( REAL delta, Arc_ptr toparc, Arc_ptr botarc )
-{
- Arc_ptr left = toparc->next;
- Arc_ptr right = toparc;
- long ldir[2], rdir[2];
-
- ldir[0] = sgn( left->tail()[0] - left->prev->tail()[0] );
- ldir[1] = sgn( left->tail()[1] - left->prev->tail()[1] );
- rdir[0] = sgn( right->tail()[0] - right->prev->tail()[0] );
- rdir[1] = sgn( right->tail()[1] - right->prev->tail()[1] );
-
- vval[0] = toparc->tail()[1];
- numquads = 0;
-
- while( 1 ) {
- switch( sgn( left->tail()[1] - right->prev->tail()[1] ) ) {
- case 1:
- left = left->next;
- update( left, ldir, left->prev->tail()[1] );
- break;
- case -1:
- right = right->prev;
- update( right, rdir, right->tail()[1] );
- break;
- case 0:
- if( fabs(left->tail()[1] - botarc->tail()[1]) < TINY) goto end;
- if( fabs(left->tail()[0]-right->prev->tail()[0]) < TINY &&
- fabs(left->tail()[1]-right->prev->tail()[1]) < TINY) goto end;
- left = left->next;
- break;
- }
- }
-
-end:
- append( botarc->tail()[1] );
-
- grow( ((long) ((vval[0] - vval[numquads])/delta)) + numquads + 2 );
-
- long i, index = 0;
- for( i=0; i<numquads; i++ ) {
- voffset[i] = index;
- varray[index++] = vval[i];
- REAL dist = vval[i] - vval[i+1];
- if( dist > delta ) {
- long steps = ((long) (dist/delta)) +1;
- float deltav = - dist / (REAL) steps;
- for( long j=1; j<steps; j++ )
- varray[index++] = vval[i] + j * deltav;
- }
- }
- voffset[i] = index;
- varray[index] = vval[i];
- return index;
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/varray.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/varray.h
deleted file mode 100755
index e807ee67b..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/varray.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * varray.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/Attic/varray.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gluvarray_h_
-#define __gluvarray_h_
-
-#include "types.h"
-
-class Arc;
-
-class Varray {
-public:
- Varray();
- ~Varray();
- long init( REAL, Arc *, Arc * );
- REAL * varray;
- REAL vval[1000];
- long voffset[1000];
- long numquads;
-
-private:
- long size;
- inline void update( Arc *, long[2], REAL );
- void grow( long );
- inline void append( REAL );
-};
-
-inline void
-Varray::append( REAL v )
-{
- if( v != vval[numquads] )
- vval[++numquads] = v;
-}
-
-
-#endif /* __gluvarray_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/GNUmakefile b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/GNUmakefile
deleted file mode 100755
index e17a19999..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/GNUmakefile
+++ /dev/null
@@ -1,99 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/GNUmakefile,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-
-include $(ROOT)/usr/include/make/commondefs
-
-TARGET = libnurbtess.a
-
-TARGETS = $(TARGET)
-
-LCXXINCS = -I../../include
-
-HFILES = \
- definitions.h \
- directedLine.h \
- gridWrap.h \
- monoTriangulation.h \
- partitionY.h \
- polyDBG.h \
- polyUtil.h \
- primitiveStream.h \
- quicksort.h \
- rectBlock.h \
- sampleComp.h \
- sampleCompBot.h \
- sampleCompRight.h \
- sampleCompTop.h \
- sampleMonoPoly.h \
- sampledLine.h \
- searchTree.h \
- zlassert.h \
- partitionX.h \
- monoChain.h \
- monoPolyPart.h \
- $(NULL)
-
-CCFILES = \
- directedLine.cc \
- gridWrap.cc \
- monoTriangulation.cc \
- partitionY.cc \
- polyDBG.cc \
- polyUtil.cc \
- primitiveStream.cc \
- quicksort.cc \
- rectBlock.cc \
- sampleComp.cc \
- sampleCompBot.cc \
- sampleCompRight.cc \
- sampleCompTop.cc \
- sampleMonoPoly.cc \
- sampledLine.cc \
- searchTree.cc \
- partitionX.cc \
- monoChain.cc \
- monoPolyPart.cc \
- $(NULL)
-
-default libs libs_install install: $(TARGET)
-
-headers headers_install apps:
-
-$(TARGET): $(OBJECTS)
- $(AR) crl $@ $(OBJECTS);
-
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Imakefile b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Imakefile
deleted file mode 100755
index f3e98209d..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Imakefile
+++ /dev/null
@@ -1,72 +0,0 @@
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-#include <Library.tmpl>
-
-OBJS = \
- directedLine.o \
- gridWrap.o \
- monoChain.o \
- monoTriangulation.o \
- partitionX.o \
- partitionY.o \
- polyDBG.o \
- polyUtil.o \
- primitiveStream.o \
- quicksort.o \
- rectBlock.o \
- sampleComp.o \
- sampleCompBot.o \
- sampleCompRight.o \
- sampleCompTop.o \
- sampleMonoPoly.o \
- sampledLine.o \
- searchTree.o \
- monoPolyPart.o
-
-INCLUDES = \
- -I../internals \
- -I../../include \
- -I$(TOP)/include \
- -I$(TOP)/include/GL
-
-DEFINES = \
- -DLIBRARYBUILD \
- -DNDEBUG
-
-NormalCplusplusObjectRule()
-
-NormalLibraryTarget(nurbtess, $(OBJS))
-
-DependTarget()
-CleanTarget()
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/definitions.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/definitions.h
deleted file mode 100755
index 21cedcf3d..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/definitions.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/definitions.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _DEFINITIONS_H
-#define _DEFINITIONS_H
-
-typedef float Real;
-typedef int Int;
-typedef Real Real2[2];
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/directedLine.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/directedLine.cc
deleted file mode 100755
index 981be0de5..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/directedLine.cc
+++ /dev/null
@@ -1,846 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/directedLine.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-#include "glimports.h"
-#include "zlassert.h"
-
-#include "quicksort.h"
-#include "directedLine.h"
-#include "polyDBG.h"
-
-//we must return the newLine
-directedLine* directedLine::deleteChain(directedLine* begin, directedLine* end)
-{
- if(begin->head()[0] == end->tail()[0] &&
- begin->head()[1] == end->tail()[1]
- )
- {
- directedLine *ret = begin->prev;
- begin->prev->next = end->next;
- end->next->prev = begin->prev;
- delete begin->sline;
- delete end->sline;
- delete begin;
- delete end;
-
- return ret;
- }
-
- directedLine* newLine;
- sampledLine* sline = new sampledLine(begin->head(), end->tail());
- newLine = new directedLine(INCREASING, sline);
- directedLine *p = begin->prev;
- directedLine *n = end->next;
- p->next = newLine;
- n->prev = newLine;
- newLine->prev = p;
- newLine->next = n;
-
- delete begin->sline;
- delete end->sline;
- delete begin;
- delete end;
- return newLine;
-}
-
-
-void directedLine::deleteSingleLine(directedLine* dline)
-{
- //make sure that dline->prev->tail is the same as
- //dline->next->head. This is for numerical erros.
- //for example, if we delete a line which is almost degeneate
- //within (epsilon), then we want to make that the polygon after deletion
- //is still a valid polygon
-
- dline->next->head()[0] = dline->prev->tail()[0];
- dline->next->head()[1] = dline->prev->tail()[1];
-
- dline->prev->next = dline->next;
- dline->next->prev = dline->prev;
-
- delete dline;
-
-}
-
-static Int myequal(Real a[2], Real b[2])
-{
- /*
- if(a[0]==b[0] && a[1] == b[1])
- return 1;
- else
- return 0;
- */
-
-
- if(fabs(a[0]-b[0]) < 0.00001 &&
- fabs(a[1]-b[1]) < 0.00001)
- return 1;
- else
- return 0;
-
-}
-
-directedLine* directedLine::deleteDegenerateLines()
-{
- //if there is only one edge or two edges, don't do anything
- if(this->next == this)
- return this;
- if(this->next == this->prev)
- return this;
-
- //find a nondegenerate line
- directedLine* temp;
- directedLine* first = NULL;
- if(! myequal(head(), tail()))
- /*
- if(head()[0] != tail()[0] ||
- head()[1] != tail()[1])
- */
- first = this;
- else
- {
- for(temp = this->next; temp != this; temp = temp->next)
- {
- /*
- if(temp->head()[0] != temp->tail()[0] ||
- temp->head()[1] != temp->tail()[1])
- */
- if(! myequal(temp->head(), temp->tail()))
- {
- first = temp;
- break;
- }
-
- }
- }
-
- //if there are no non-degenerate lines, then we simply return NULL.
- if(first == NULL)
- {
- deleteSinglePolygonWithSline();
- return NULL;
- }
-
- directedLine* tempNext = NULL;
- for(temp =first->next; temp != first; temp = tempNext)
- {
- tempNext = temp->getNext();
-/*
- if(temp->head()[0] == temp->tail()[0] &&
- temp->head()[1] == temp->tail()[1])
-*/
-
- if(myequal(temp->head(), temp->tail()))
- deleteSingleLine(temp);
- }
- return first;
-}
-
-directedLine* directedLine::deleteDegenerateLinesAllPolygons()
-{
- directedLine* temp;
- directedLine *tempNext = NULL;
- directedLine* ret= NULL;
- directedLine* retEnd = NULL;
- for(temp=this; temp != NULL; temp = tempNext)
- {
- tempNext = temp->nextPolygon;
- temp->nextPolygon = NULL;
- if(ret == NULL)
- {
- ret = retEnd = temp->deleteDegenerateLines();
-
- }
- else
- {
- directedLine *newPolygon = temp->deleteDegenerateLines();
- if(newPolygon != NULL)
- {
- retEnd->nextPolygon = temp->deleteDegenerateLines();
- retEnd = retEnd->nextPolygon;
- }
- }
- }
- return ret;
-}
-
-directedLine* directedLine::cutIntersectionAllPoly(int &cutOccur)
-{
- directedLine* temp;
- directedLine *tempNext = NULL;
- directedLine* ret= NULL;
- directedLine* retEnd = NULL;
- cutOccur = 0;
- for(temp=this; temp != NULL; temp = tempNext)
- {
- int eachCutOccur=0;
- tempNext = temp->nextPolygon;
- temp->nextPolygon = NULL;
- if(ret == NULL)
- {
-
- ret = retEnd = DBG_cutIntersectionPoly(temp, eachCutOccur);
- if(eachCutOccur)
- cutOccur = 1;
- }
- else
- {
-
- retEnd->nextPolygon = DBG_cutIntersectionPoly(temp, eachCutOccur);
- retEnd = retEnd->nextPolygon;
- if(eachCutOccur)
- cutOccur = 1;
- }
- }
- return ret;
-}
-
-
-void directedLine::deleteSinglePolygonWithSline()
-{
- directedLine *temp, *tempNext;
- prev->next = NULL;
- for(temp=this; temp != NULL; temp = tempNext)
- {
- tempNext = temp->next;
- delete temp->sline;
- delete temp;
- }
-}
-
-void directedLine::deletePolygonListWithSline()
-{
- directedLine *temp, *tempNext;
- for(temp=this; temp != NULL; temp=tempNext)
- {
- tempNext = temp->nextPolygon;
- temp->deleteSinglePolygonWithSline();
- }
-}
-
-void directedLine::deleteSinglePolygon()
-{
- directedLine *temp, *tempNext;
- prev->next = NULL;
- for(temp=this; temp != NULL; temp = tempNext)
- {
- tempNext = temp->next;
- delete temp;
- }
-}
-
-void directedLine::deletePolygonList()
-{
- directedLine *temp, *tempNext;
- for(temp=this; temp != NULL; temp=tempNext)
- {
- tempNext = temp->nextPolygon;
- temp->deleteSinglePolygon();
- }
-}
-
-
-/*a loop by itself*/
-directedLine::directedLine(short dir, sampledLine* sl)
-{
- direction = dir;
- sline = sl;
- next = this;
- prev = this;
- nextPolygon = NULL;
-// prevPolygon = NULL;
- rootBit = 0;/*important to initilzae to 0 meaning not root yet*/
-
- rootLink = NULL;
-
-}
-
-void directedLine::init(short dir, sampledLine* sl)
-{
- direction = dir;
- sline = sl;
-}
-
-directedLine::directedLine()
-{
- next = this;
- prev = this;
- nextPolygon = NULL;
- rootBit = 0;/*important to initilzae to 0 meaning not root yet*/
- rootLink = NULL;
-}
-
-directedLine::~directedLine()
-{
-}
-
-Real* directedLine::head()
-{
-
- return (direction==INCREASING)? (sline->get_points())[0] : (sline->get_points())[sline->get_npoints()-1];
-}
-
-/*inline*/ Real* directedLine::getVertex(Int i)
-{
- return (direction==INCREASING)? (sline->get_points())[i] : (sline->get_points())[sline->get_npoints() - 1 -i];
-}
-
-Real* directedLine::tail()
-{
- return (direction==DECREASING)? (sline->get_points())[0] : (sline->get_points())[sline->get_npoints()-1];
-}
-
- /*insert a new line between prev and this*/
-void directedLine::insert(directedLine* nl)
-{
- nl->next = this;
- nl->prev = prev;
- prev->next = nl;
- prev = nl;
- nl->rootLink = this; /*assuming that 'this' is the root!!!*/
-}
-
-Int directedLine::numEdges()
-{
- Int ret=0;
- directedLine* temp;
- if(next == this) return 1;
-
- ret = 1;
- for(temp = next; temp != this; temp = temp->next)
- ret++;
- return ret;
-}
-
-Int directedLine::numEdgesAllPolygons()
-{
- Int ret=0;
- directedLine* temp;
- for(temp=this; temp!= NULL; temp=temp->nextPolygon)
- {
- ret += temp->numEdges();
- }
- return ret;
-}
-
-/*return 1 if the double linked list forms a polygon.
- */
-short directedLine::isPolygon()
-{
- directedLine* temp;
-
- /*a polygon contains at least 3 edges*/
- if(numEdges() <=2) return 0;
-
- /*check this edge*/
- if(! isConnected()) return 0;
-
- /*check all other edges*/
- for(temp=next; temp != this; temp = temp->next){
- if(!isConnected()) return 0;
- }
- return 1;
-}
-
-/*check if the head of this edge is connected to
- *the tail of the prev
- */
-short directedLine::isConnected()
-{
- if( (head()[0] == prev->tail()[0]) && (head()[1] == prev->tail()[1]))
- return 1;
- else
- return 0;
-}
-
-Int compV2InY(Real A[2], Real B[2])
-{
- if(A[1] < B[1]) return -1;
- if(A[1] == B[1] && A[0] < B[0]) return -1;
- if(A[1] == B[1] && A[0] == B[0]) return 0;
- return 1;
-}
-
-Int compV2InX(Real A[2], Real B[2])
-{
- if(A[0] < B[0]) return -1;
- if(A[0] == B[0] && A[1] < B[1]) return -1;
- if(A[0] == B[0] && A[1] == B[1]) return 0;
- return 1;
-}
-
-/*compare two vertices NOT lines!
- *A vertex is the head of a directed line.
- *(x_1, y_1) <= (x_2, y_2) if
- *either y_1 < y_2
- *or y_1 == y_2 && x_1 < x_2.
- *return -1 if this->head() <= nl->head(),
- *return 1 otherwise
- */
-Int directedLine::compInY(directedLine* nl)
-{
- if(head()[1] < nl->head()[1]) return -1;
- if(head()[1] == nl->head()[1] && head()[0] < nl->head()[0]) return -1;
- return 1;
-}
-
-/*compare two vertices NOT lines!
- *A vertex is the head of a directed line.
- *(x_1, y_1) <= (x_2, y_2) if
- *either x_1 < x_2
- *or x_1 == x_2 && y_1 < y_2.
- *return -1 if this->head() <= nl->head(),
- *return 1 otherwise
- */
-Int directedLine::compInX(directedLine* nl)
-{
- if(head()[0] < nl->head()[0]) return -1;
- if(head()[0] == nl->head()[0] && head()[1] < nl->head()[1]) return -1;
- return 1;
-}
-
-/*used by sort precedures
- */
-static Int compInY2(directedLine* v1, directedLine* v2)
-{
- return v1->compInY(v2);
-}
-#ifdef NOT_USED
-static Int compInX(directedLine* v1, directedLine* v2)
-{
- return v1->compInX(v2);
-}
-#endif
-
-/*sort all the vertices NOT the lines!
- *a vertex is the head of a directed line
- */
-directedLine** directedLine::sortAllPolygons()
-{
- Int total_num_edges = 0;
- directedLine** array = toArrayAllPolygons(total_num_edges);
- quicksort( (void**)array, 0, total_num_edges-1, (Int (*)(void *, void *)) compInY2);
-
- return array;
-}
-
-void directedLine::printSingle()
-{
- if(direction == INCREASING)
- printf("direction is INCREASING\n");
- else
- printf("direction is DECREASING\n");
- printf("head=%f,%f)\n", head()[0], head()[1]);
- sline->print();
-}
-
-/*print one polygon*/
-void directedLine::printList()
-{
- directedLine* temp;
- printSingle();
- for(temp = next; temp!=this; temp=temp->next)
- temp->printSingle();
-}
-
-/*print all the polygons*/
-void directedLine::printAllPolygons()
-{
- directedLine *temp;
- for(temp = this; temp!=NULL; temp = temp->nextPolygon)
- {
- printf("polygon:\n");
- temp->printList();
- }
-}
-
-/*insert this polygon into the head of the old polygon List*/
-directedLine* directedLine::insertPolygon(directedLine* oldList)
-{
- /*this polygon is a root*/
- setRootBit();
- if(oldList == NULL) return this;
- nextPolygon = oldList;
-/* oldList->prevPolygon = this;*/
- return this;
-}
-
-/*cutoff means delete. but we don't deallocate any space,
- *so we use cutoff instead of delete
- */
-directedLine* directedLine::cutoffPolygon(directedLine *p)
-{
- directedLine* temp;
- directedLine* prev_polygon = NULL;
- if(p == NULL) return this;
-
- for(temp=this; temp != p; temp = temp->nextPolygon)
- {
- if(temp == NULL)
- {
- fprintf(stderr, "in cutoffPolygon, not found\n");
- exit(1);
- }
- prev_polygon = temp;
- }
-
-/* prev_polygon = p->prevPolygon;*/
-
- p->resetRootBit();
- if(prev_polygon == NULL) /*this is the one to cutoff*/
- return nextPolygon;
- else {
- prev_polygon->nextPolygon = p->nextPolygon;
- return this;
- }
-}
-
-Int directedLine::numPolygons()
-{
- if(nextPolygon == NULL) return 1;
- else return 1+nextPolygon->numPolygons();
-}
-
-
-/*let array[index ...] denote
- *all the edges in this polygon
- *return the next available index of array.
- */
-Int directedLine::toArraySinglePolygon(directedLine** array, Int index)
-{
- directedLine *temp;
- array[index++] = this;
- for(temp = next; temp != this; temp = temp->next)
- {
- array[index++] = temp;
- }
- return index;
-}
-
-/*the space is allocated. The caller is responsible for
- *deallocate the space.
- *total_num_edges is set to be the total number of edges of all polygons
- */
-directedLine** directedLine::toArrayAllPolygons(Int& total_num_edges)
-{
- total_num_edges=numEdgesAllPolygons();
- directedLine** ret = (directedLine**) malloc(sizeof(directedLine*) * total_num_edges);
- assert(ret);
-
- directedLine *temp;
- Int index = 0;
- for(temp=this; temp != NULL; temp=temp->nextPolygon) {
- index = temp->toArraySinglePolygon(ret, index);
- }
- return ret;
-}
-
-/*assume the polygon is a simple polygon, return
- *the area enclosed by it.
- *if thee order is counterclock wise, the area is positive.
- */
-Real directedLine::polyArea()
-{
- directedLine* temp;
- Real ret=0.0;
- Real x1,y1,x2,y2;
- x1 = this->head()[0];
- y1 = this->head()[1];
- x2 = this->next->head()[0];
- y2 = this->next->head()[1];
- ret = -(x2*y1-x1*y2);
- for(temp=this->next; temp!=this; temp = temp->next)
- {
- x1 = temp->head()[0];
- y1 = temp->head()[1];
- x2 = temp->next->head()[0];
- y2 = temp->next->head()[1];
- ret += -( x2*y1-x1*y2);
- }
- return 0.5*ret;
-}
-
-/*******************split or combine polygons begin********************/
-/*conect a diagonal of a single simple polygon or two simple polygons.
- *If the two vertices v1 (head) and v2 (head) are in the same simple polygon,
- *then we actually split the simple polygon into two polygons.
- *If instead two vertices velong to two difference polygons,
- *then we combine the two polygons into one polygon.
- *It is upto the caller to decide whether this is a split or a
- *combination.
- *
- *Case Split:
- *split a single simple polygon into two simple polygons by
- *connecting a diagonal (two vertices).
- *v1, v2: the two vertices are the head() of the two directedLines.
- * this routine generates one new sampledLine which is returned in
- *generatedLine,
- *and it generates two directedLines returned in ret_p1 and ret_p2.
- *ret_p1 and ret_p2 are used as the entry to the two new polygons.
- *Notice the caller should not deallocate the space of v2 and v2 after
- *calling this function, since all of the edges are connected to
- *ret_p1 or ret_p2.
- *
- *combine:
- *combine two simpolygons into one by connecting one diagonal.
- *the returned polygon is returned in ret_p1.
- */
-/*ARGSUSED*/
-void directedLine::connectDiagonal(directedLine* v1, directedLine* v2,
- directedLine** ret_p1,
- directedLine** ret_p2,
- sampledLine** generatedLine,
- directedLine* polygonList )
-{
- sampledLine *nsline = new sampledLine(2);
-
-
-
- nsline->setPoint(0, v1->head());
- nsline->setPoint(1, v2->head());
-
-
-
- /*the increasing line is from v1 head to v2 head*/
- directedLine* newLineInc = new directedLine(INCREASING, nsline);
-
-
-
- directedLine* newLineDec = new directedLine(DECREASING, nsline);
-
-
- directedLine* v1Prev = v1->prev;
- directedLine* v2Prev = v2->prev;
-
- v1 ->prev = newLineDec;
- v2Prev ->next = newLineDec;
- newLineDec->next = v1;
- newLineDec->prev = v2Prev;
-
- v2 ->prev = newLineInc;
- v1Prev ->next = newLineInc;
- newLineInc->next = v2;
- newLineInc->prev = v1Prev;
-
- *ret_p1 = newLineDec;
- *ret_p2 = newLineInc;
- *generatedLine = nsline;
-}
-
-//see the function connectDiangle
-/*ARGSUSED*/
-void directedLine::connectDiagonal_2slines(directedLine* v1, directedLine* v2,
- directedLine** ret_p1,
- directedLine** ret_p2,
- directedLine* polygonList )
-{
- sampledLine *nsline = new sampledLine(2);
- sampledLine *nsline2 = new sampledLine(2);
-
- nsline->setPoint(0, v1->head());
- nsline->setPoint(1, v2->head());
- nsline2->setPoint(0, v1->head());
- nsline2->setPoint(1, v2->head());
-
- /*the increasing line is from v1 head to v2 head*/
- directedLine* newLineInc = new directedLine(INCREASING, nsline);
-
- directedLine* newLineDec = new directedLine(DECREASING, nsline2);
-
- directedLine* v1Prev = v1->prev;
- directedLine* v2Prev = v2->prev;
-
- v1 ->prev = newLineDec;
- v2Prev ->next = newLineDec;
- newLineDec->next = v1;
- newLineDec->prev = v2Prev;
-
- v2 ->prev = newLineInc;
- v1Prev ->next = newLineInc;
- newLineInc->next = v2;
- newLineInc->prev = v1Prev;
-
- *ret_p1 = newLineDec;
- *ret_p2 = newLineInc;
-
-}
-
-Int directedLine::samePolygon(directedLine* v1, directedLine* v2)
-{
- if(v1 == v2) return 1;
- directedLine *temp;
- for(temp = v1->next; temp != v1; temp = temp->next)
- {
- if(temp == v2) return 1;
- }
- return 0;
-}
-
-directedLine* directedLine::findRoot()
-{
- if(rootBit) return this;
- directedLine* temp;
- for(temp = next; temp != this; temp = temp->next)
- if(temp -> rootBit ) return temp;
- return NULL; /*should not happen*/
-}
-
-directedLine* directedLine::rootLinkFindRoot()
-{
- directedLine* tempRoot;
- directedLine* tempLink;
- tempRoot = this;
- tempLink = rootLink;
- while(tempLink != NULL){
- tempRoot = tempLink;
- tempLink = tempRoot->rootLink;
- }
- return tempRoot;
-}
-
-/*******************split or combine polygons end********************/
-
-/*****************IO stuff begin*******************/
-
-/*format:
- *#polygons
- * #vertices
- * vertices
- * #vertices
- * vertices
- *...
- */
-void directedLine::writeAllPolygons(char* filename)
-{
- FILE* fp = fopen(filename, "w");
- assert(fp);
- Int nPolygons = numPolygons();
- directedLine *root;
- fprintf(fp, "%i\n", nPolygons);
- for(root = this; root != NULL; root = root->nextPolygon)
- {
- directedLine *temp;
- Int npoints=0;
- npoints = root->get_npoints()-1;
- for(temp = root->next; temp != root; temp=temp->next)
- npoints += temp->get_npoints()-1;
- fprintf(fp, "%i\n", npoints/*root->numEdges()*/);
-
-
- for(Int i=0; i<root->get_npoints()-1; i++){
- fprintf(fp, "%f ", root->getVertex(i)[0]);
- fprintf(fp, "%f ", root->getVertex(i)[1]);
- }
-
- for(temp=root->next; temp != root; temp = temp->next)
- {
- for(Int i=0; i<temp->get_npoints()-1; i++){
-
- fprintf(fp, "%f ", temp->getVertex(i)[0]);
- fprintf(fp, "%f ", temp->getVertex(i)[1]);
- }
- fprintf(fp,"\n");
- }
- fprintf(fp, "\n");
- }
- fclose(fp);
-}
-
-directedLine* readAllPolygons(char* filename)
-{
- Int i,j;
- FILE* fp = fopen(filename, "r");
- assert(fp);
- Int nPolygons;
- fscanf(fp, "%i", &nPolygons);
- directedLine *ret = NULL;
-
- for(i=0; i<nPolygons; i++)
- {
- Int nEdges;
- fscanf(fp, "%i", &nEdges);
- Real vert[2][2];
- Real VV[2][2];
- /*the first two vertices*/
- fscanf(fp, "%f", &(vert[0][0]));
- fscanf(fp, "%f", &(vert[0][1]));
- fscanf(fp, "%f", &(vert[1][0]));
- fscanf(fp, "%f", &(vert[1][1]));
- VV[1][0] = vert[0][0];
- VV[1][1] = vert[0][1];
- sampledLine *sLine = new sampledLine(2, vert);
- directedLine *thisPoly = new directedLine(INCREASING, sLine);
-thisPoly->rootLinkSet(NULL);
-
- directedLine *dLine;
- for(j=2; j<nEdges; j++)
- {
- vert[0][0]=vert[1][0];
- vert[0][1]=vert[1][1];
- fscanf(fp, "%f", &(vert[1][0]));
- fscanf(fp, "%f", &(vert[1][1]));
- sLine = new sampledLine(2,vert);
- dLine = new directedLine(INCREASING, sLine);
-dLine->rootLinkSet(thisPoly);
- thisPoly->insert(dLine);
- }
-
- VV[0][0]=vert[1][0];
- VV[0][1]=vert[1][1];
- sLine = new sampledLine(2,VV);
- dLine = new directedLine(INCREASING, sLine);
-dLine->rootLinkSet(thisPoly);
- thisPoly->insert(dLine);
-
- ret = thisPoly->insertPolygon(ret);
- }
- fclose(fp);
- return ret;
-}
-
-
-
-
-
-
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/directedLine.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/directedLine.h
deleted file mode 100755
index 91fc4989f..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/directedLine.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/directedLine.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _DIRECTEDLINE_H
-#define _DIRECTEDLINE_H
-
-#include "definitions.h"
-#include "sampledLine.h"
-
-enum {INCREASING, DECREASING};
-
-class directedLine {
- short direction; /*INCREASING or DECREASING*/
- sampledLine* sline;
- directedLine* next; /*double linked list*/
- directedLine* prev; /*double linked list*/
-
- /*in case we need a list of polygons each
- *consisting of a double linked list
- */
- directedLine* nextPolygon;
-
- /*optimization make cutoff polygon faster*/
-/* directedLine* prevPolygon;*/
-
- Int rootBit; /*1 if this is a root of the polygon, set by setRootBit*/
- /*and reset by resetRootBit()*/
-
- directedLine* rootLink; /*fast root-finding*/
-
-
-
-public:
- directedLine(short dir, sampledLine* sl);
- directedLine();
- ~directedLine();
-
- void init(short dir, sampledLine* sl);
-
- Real* head(); /*points[0] if INCREASING, points[n-1] otherwise*/
- Real* tail(); /*points[n-1] if INCREASING, points[0] otherwise*/
- Real* getVertex(Int i); /*points[i] if INCREASING, points[n-1-i] otherwise*/
- Int get_npoints() {return sline->get_npoints();}
- directedLine* getPrev() {return prev;}
- directedLine* getNext() {return next;}
- directedLine* getNextPolygon() {return nextPolygon;}
- sampledLine* getSampledLine() {return sline;}
-
- short getDirection(){return direction;}
- void putDirection(short dir) {direction = dir;}
- void putPrev(directedLine *p) {prev = p;}
- void putNext(directedLine *p) {next = p;}
-
- /*insert a new line between prev and this*/
- void insert(directedLine* nl);
-
- /*delete all the polygons following the link: nextPolygon.
- *notice that sampledLine is not deleted. The caller is
- *responsible for that
- */
- void deletePolygonList();
- void deleteSinglePolygon();
-
- void deleteSinglePolygonWithSline(); //also delete sanmpled line
- void deletePolygonListWithSline(); //also delete sanmpled line
-
- void deleteSingleLine(directedLine* dline);
- directedLine* deleteDegenerateLines();
- directedLine* deleteDegenerateLinesAllPolygons();
- directedLine* cutIntersectionAllPoly(int& cutOccur);
-
- /*check to see if the list forms a closed polygon
- *return 1 if yes
- */
- short isPolygon();
-
- Int compInY(directedLine* nl);
- Int compInX(directedLine* nl);
-
- /*return an array of pointers.
- *the
- */
- directedLine** sortAllPolygons();
-
- Int numEdges();
- Int numEdgesAllPolygons();
- Int numPolygons();
-
- /*check if the head of this edge is connected to
- *the tail of the prev
- */
- short isConnected();
-
- Real polyArea();
-
- void printSingle();
- void printList();
- void printAllPolygons();
- void writeAllPolygons(char* filename);
-
-
- /*insert a polygon: using nextPolygon*/
- directedLine* insertPolygon(directedLine* newpolygon);
- directedLine* cutoffPolygon(directedLine *p);
-
- Int toArraySinglePolygon(directedLine** array, Int index);
- directedLine** toArrayAllPolygons(Int& total_num_edges);
-
- void connectDiagonal(directedLine* v1, directedLine* v2,
- directedLine** ret_p1,
- directedLine** ret_p2,
- sampledLine** generatedLine, directedLine* list);
-
- /*generate two slines
- */
- void connectDiagonal_2slines(directedLine* v1, directedLine* v2,
- directedLine** ret_p1,
- directedLine** ret_p2,
- directedLine* list);
-
- Int samePolygon(directedLine* v1, directedLine* v2);
- void setRootBit() {rootBit = 1;}
- void resetRootBit() {rootBit = 0;}
- directedLine* findRoot();
-
- void rootLinkSet(directedLine* r) {rootLink = r;}
- directedLine* rootLinkFindRoot();
-
- //the chain from begin to end is deleted (the space is deallocated)
- //and a new edge(which connectes the head of begin and the tail of end)
- // is inserted. The new polygon is returned.
- //notice that "this" is arbitrary
- directedLine* deleteChain(directedLine* begin, directedLine* end);
-};
-
-directedLine* readAllPolygons(char* filename);
-
-extern Int compV2InY(Real A[2], Real B[2]);
-extern Int compV2InX(Real A[2], Real B[2]);
-
-#endif
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/glimports.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/glimports.h
deleted file mode 100755
index e93618b58..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/glimports.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * glimports.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/glimports.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __gluimports_h_
-#define __gluimports_h_
-
-#include "mystdlib.h"
-#include "mystdio.h"
-
-#endif /* __gluimports_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/gridWrap.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/gridWrap.cc
deleted file mode 100755
index 7a3b39822..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/gridWrap.cc
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/gridWrap.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include "gluos.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <GL/gl.h>
-#include "zlassert.h"
-#include "gridWrap.h"
-
-
-/*******************grid structure****************************/
-void gridWrap::print()
-{
- printf("n_ulines = %i\n", n_ulines);
- printf("n_vlines = %i\n", n_vlines);
- printf("u_min=%f, umax=%f, vmin=%f, vmax=%f\n", u_min, u_max, v_min, v_max);
-}
-
-gridWrap::gridWrap(Int nUlines, Real* uvals,
- Int nVlines, Real* vvals)
-{
- assert(nUlines>=2);
- assert(nVlines>=2);
-
- is_uniform = 0;
- n_ulines = nUlines;
- n_vlines = nVlines;
- u_min = uvals[0];
- u_max = uvals[nUlines-1];
- v_min = vvals[0];
- v_max = vvals[nVlines-1];
- u_values = (Real*) malloc(sizeof(Real) * n_ulines);
- assert(u_values);
- v_values = (Real*) malloc(sizeof(Real) * n_vlines);
- assert(v_values);
-
- Int i;
- for(i=0; i<n_ulines; i++)
- u_values[i] = uvals[i];
- for(i=0; i<n_vlines; i++)
- v_values[i] = vvals[i];
-}
-
-gridWrap::gridWrap(Int nUlines, Int nVlines,
- Real uMin, Real uMax,
- Real vMin, Real vMax
- )
-{
- is_uniform = 1;
- n_ulines = nUlines;
- n_vlines = nVlines;
- u_min = uMin;
- u_max = uMax;
- v_min = vMin;
- v_max = vMax;
- u_values = (Real*) malloc(sizeof(Real) * n_ulines);
- assert(u_values);
- v_values = (Real*) malloc(sizeof(Real) * n_vlines);
- assert(v_values);
-
- Int i;
- assert(nUlines>=2);
- assert(nVlines>=2);
- Real du = (uMax-uMin)/(nUlines-1);
- Real dv = (vMax-vMin)/(nVlines-1);
-
- float tempu=uMin;
- u_values[0] = tempu;
- for(i=1; i<nUlines; i++)
- {
- tempu += du;
- u_values[i] = tempu;
- }
- u_values[nUlines-1] = uMax;
-
- float tempv=vMin;
- v_values[0] = tempv;
- for(i=1; i<nVlines; i++)
- {
- tempv += dv;
- v_values[i] = tempv;
- }
- v_values[nVlines-1] = vMax;
-}
-
-gridWrap::~gridWrap()
-{
- free(u_values);
- free(v_values);
-}
-
-void gridWrap::draw()
-{
- int i,j;
- glBegin(GL_POINTS);
- for(i=0; i<n_ulines; i++)
- for(j=0; j<n_vlines; j++)
- glVertex2f(get_u_value(i), get_v_value(j));
- glEnd();
-}
-
-void gridWrap::outputFanWithPoint(Int v, Int uleft, Int uright, Real vert[2], primStream* pStream)
-{
- Int i;
- if(uleft >= uright)
- return; //no triangles to output.
-
- pStream->begin();
- pStream->insert(vert);
-
- assert(vert[1] != v_values[v]); //don't output degenerate triangles
-
- if(vert[1] > v_values[v]) //vertex is above this grid line: notice the orientation
- {
- for(i=uleft; i<=uright; i++)
- pStream->insert(u_values[i], v_values[v]);
- }
- else //vertex is below the grid line
- {
- for(i=uright; i>= uleft; i--)
- pStream->insert(u_values[i], v_values[v]);
- }
-
- pStream->end(PRIMITIVE_STREAM_FAN);
-}
-
-
-
-/*each chain stores a number of consecutive
- *V-lines within a grid.
- *There is one grid vertex on each V-line.
- * The total number of V-lines is:
- * nVlines.
- * with respect to the grid, the index of the first V-line is
- * firstVlineIndex.
- * So with respect to the grid, the index of the ith V-line is
- * firstVlineIndex-i.
- * the grid-index of the uline at the ith vline (recall that each vline has one grid point)
- * is ulineIndices[i]. The u_value is cached in ulineValues[i], that is,
- * ulineValues[i] = grid->get_u_value(ulineIndices[i])
- */
-gridBoundaryChain::gridBoundaryChain(
- gridWrap* gr,
- Int first_vline_index,
- Int n_vlines,
- Int* uline_indices,
- Int* inner_indices
- )
-: grid(gr), firstVlineIndex(first_vline_index), nVlines(n_vlines)
-{
- ulineIndices = (Int*) malloc(sizeof(Int) * n_vlines);
- assert(ulineIndices);
-
- innerIndices = (Int*) malloc(sizeof(Int) * n_vlines);
- assert(innerIndices);
-
- vertices = (Real2*) malloc(sizeof(Real2) * n_vlines);
- assert(vertices);
-
-
-
- Int i;
- for(i=0; i<n_vlines; i++){
- ulineIndices[i] = uline_indices[i];
- innerIndices[i] = inner_indices[i];
- }
-
- for(i=0; i<n_vlines; i++){
- vertices[i][0] = gr->get_u_value(ulineIndices[i]);
- vertices[i][1] = gr->get_v_value(first_vline_index-i);
- }
-}
-
-void gridBoundaryChain::draw()
-{
- Int i;
- glBegin(GL_LINE_STRIP);
- for(i=0; i<nVlines; i++)
- {
- glVertex2fv(vertices[i]);
- }
- glEnd();
-}
-
-void gridBoundaryChain::drawInner()
-{
- Int i;
- for(i=1; i<nVlines; i++)
- {
- glBegin(GL_LINE_STRIP);
- glVertex2f(grid->get_u_value(innerIndices[i]), get_v_value(i-1) );
- glVertex2f(grid->get_u_value(innerIndices[i]), get_v_value(i) );
- glEnd();
- }
-}
-
-Int gridBoundaryChain::lookfor(Real v, Int i1, Int i2)
-{
- Int mid;
- while(i1 < i2-1)
- {
- mid = (i1+i2)/2;
- if(v > vertices[mid][1])
- {
- i2 = mid;
- }
- else
- i1 = mid;
- }
- return i1;
-}
-
-/*output the fan of the right end between grid line i-1 and grid line i*/
-void gridBoundaryChain::rightEndFan(Int i, primStream* pStream)
-{
- Int j;
- if(getUlineIndex(i) > getUlineIndex(i-1))
- {
- pStream->begin();
- pStream->insert(get_vertex(i-1));
- for(j=getUlineIndex(i-1); j<= getUlineIndex(i); j++)
- pStream->insert(grid->get_u_value(j), get_v_value(i));
- pStream->end(PRIMITIVE_STREAM_FAN);
- }
- else if(getUlineIndex(i) < getUlineIndex(i-1))
- {
- pStream->begin();
- pStream->insert(get_vertex(i));
- for(j=getUlineIndex(i-1); j>= getUlineIndex(i); j--)
- pStream->insert(grid->get_u_value(j), get_v_value(i-1));
- pStream->end(PRIMITIVE_STREAM_FAN);
- }
- //otherside, the two are equal, so there is no fan to output
-}
-
-
-/*output the fan of the left end between grid line i-1 and grid line i*/
-void gridBoundaryChain::leftEndFan(Int i, primStream* pStream)
-{
- Int j;
- if(getUlineIndex(i) < getUlineIndex(i-1))
- {
- pStream->begin();
- pStream->insert(get_vertex(i-1));
- for(j=getUlineIndex(i); j<= getUlineIndex(i-1); j++)
- pStream->insert(grid->get_u_value(j), get_v_value(i));
- pStream->end(PRIMITIVE_STREAM_FAN);
- }
- else if(getUlineIndex(i) > getUlineIndex(i-1))
- {
- pStream->begin();
- pStream->insert(get_vertex(i));
- for(j=getUlineIndex(i); j>= getUlineIndex(i-1); j--)
- pStream->insert(grid->get_u_value(j), get_v_value(i-1));
- pStream->end(PRIMITIVE_STREAM_FAN);
- }
- /*otherwisem, the two are equal, so there is no fan to outout*/
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/gridWrap.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/gridWrap.h
deleted file mode 100755
index 7f1f46b27..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/gridWrap.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/gridWrap.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _GRIDWRAP_H
-#define _GRIDWRAP_H
-
-#include <stdio.h>
-#include "definitions.h"
-
-#include "primitiveStream.h"
-#include "zlassert.h"
-
-class gridWrap{
- Int n_ulines;
- Int n_vlines;
- Real u_min, u_max;
- Real v_min, v_max;
-
- /*cache the coordinate values for efficiency.
- *these are redundant information when
- *the grid is uniform.
- */
- Real* u_values; /*size is n_ulines*/
- Real* v_values; /*size is n_vlines*/
-
- Int is_uniform;
-
-public:
- //uniform grid constructor
- gridWrap(Int nUlines, Int nVlines,
- Real uMin, Real uMax,
- Real vMin, Real vMax
- );
-
- //nonuniform grid constructor.
- gridWrap(Int nUlines, Real *uvals,
- Int nVlines, Real *vvlas
- );
- ~gridWrap();
-
- void print();
- Int get_n_ulines() {return n_ulines;}
- Int get_n_vlines() {return n_vlines;}
- Real get_u_min() {return u_min;}
- Real get_u_max() {return u_max;}
- Real get_v_min() {return v_min;}
- Real get_v_max() {return v_max;}
-
- Real get_u_value(Int i)
- {
- assert(i<n_ulines);
- /*if(i>=n_ulines){printf("ERROR, n_ulines=%i,i=%i\n",n_ulines,i);exit(0);}*/
- return u_values[i];}
- Real get_v_value(Int j) {return v_values[j];}
-
- Real* get_u_values() {return u_values;}
- Real* get_v_values() {return v_values;}
-
- void outputFanWithPoint(Int v, Int uleft, Int uright,
- Real vert[2], primStream* pStream);
-
- void draw();
-
- Int isUniform() {return is_uniform;}
-};
-
-class gridBoundaryChain{
- gridWrap* grid;
- Int firstVlineIndex;
- Int nVlines;
- Int* ulineIndices; /*each v line has a boundary*/
- Int* innerIndices; /*the segment of the vertical gridline from */
- /*(innerIndices[i], i) to (innerIndices[i+1], i-1) */
- /*is inside the polygon: i=1,...,nVlines-1*/
-
- Real2* vertices; /*one grid point at each grid V-line, cached for efficiency*/
-
-public:
- gridBoundaryChain(gridWrap* gr, Int first_vline_index, Int n_vlines, Int* uline_indices, Int* inner_indices);
-
- ~gridBoundaryChain()
- {
- free(innerIndices);
- free(ulineIndices);
- free(vertices);
- }
-
- /*i indexes the vlines in this chain.
- */
- Int getVlineIndex(Int i) {return firstVlineIndex-i;}
- Int getUlineIndex(Int i) {return ulineIndices[i];}
- Real get_u_value(Int i) {return vertices[i][0];}
- Real get_v_value(Int i) {return vertices[i][1];}
- Int get_nVlines() {return nVlines;}
- Int getInnerIndex(Int i) {return innerIndices[i];}
- Real getInner_u_value(Int i) {return grid->get_u_value(innerIndices[i]);}
-
- Real* get_vertex(Int i) {return vertices[i];}
- gridWrap* getGrid() {return grid;}
- void leftEndFan(Int i, primStream* pStream);
- void rightEndFan(Int i, primStream* pStream);
-
- Int lookfor(Real v, Int i1, Int i2); //find i in [i1,i2] so that vertices[i][1]>= v > vertices[i+1][1]
- void draw();
- void drawInner();
-};
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoChain.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoChain.cc
deleted file mode 100755
index 80a9ac20b..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoChain.cc
+++ /dev/null
@@ -1,934 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/monoChain.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include "gluos.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <GL/gl.h>
-
-#include "glimports.h"
-#include "zlassert.h"
-
-#include "monoChain.h"
-#include "quicksort.h"
-#include "searchTree.h"
-#include "polyUtil.h"
-
-#ifndef max
-#define max(a,b) ((a>b)? a:b)
-#endif
-#ifndef min
-#define min(a,b) ((a>b)? b:a)
-#endif
-
-extern Int isCusp(directedLine *v);
-extern Int deleteRepeatDiagonals(Int num_diagonals, directedLine** diagonal_vertices, directedLine** new_vertices);
-
-//for debug purpose only
-static void drawDiagonals(Int num_diagonals, directedLine** diagonal_vertices)
-{
- Int i,k;
- for(i=0; i<num_diagonals; i++)
- {
- glBegin(GL_LINE);
- glVertex2fv(diagonal_vertices[2*i]->head());
- glVertex2fv(diagonal_vertices[2*i+1]->head());
- glEnd();
- }
-}
-
-/*given (x_1, y_1) and (x_2, y_2), and y
- *return x such that (x,y) is on the line
- */
-inline Real intersectHoriz(Real x1, Real y1, Real x2, Real y2, Real y)
-{
- return ((y2==y1)? (x1+x2)*0.5 : x1 + ((y-y1)/(y2-y1)) * (x2-x1));
-}
-
-//compare the heads of the two chains
-static int compChainHeadInY(monoChain* mc1, monoChain* mc2)
-{
- return compV2InY(mc1->getHead()->head(), mc2->getHead()->head());
-}
-
-monoChain::monoChain(directedLine* cHead, directedLine* cTail)
-{
- chainHead = cHead;
- chainTail = cTail;
- next = this;
- prev = this;
-
- nextPolygon = NULL;
-
- //compute bounding box
- directedLine* temp;
- minX = maxX = chainTail->head()[0];
- minY = maxY = chainTail->head()[1];
-
- for(temp=chainHead; temp!=cTail; temp = temp->getNext())
- {
- if(temp->head()[0] < minX)
- minX = temp->head()[0];
- if(temp->head()[0] > maxX)
- maxX = temp->head()[0];
-
- if(temp->head()[1] < minY)
- minY = temp->head()[1];
- if(temp->head()[1] > maxY)
- maxY = temp->head()[1];
- }
-
- //check whether the chain is increasing or decreasing
- if(chainHead->compInY(chainTail) <0)
- isIncrease = 1;
- else
- isIncrease = 0;
-
- //initilize currrent, this is used for accelerating search
- if(isIncrease)
- current = chainHead;
- else
- current = chainTail;
-
- isKey = 0;
-}
-
-//insert a new line between prev and this
-void monoChain::insert(monoChain* nc)
-{
- nc->next = this;
- nc->prev = prev;
- prev->next = nc;
- prev = nc;
-}
-
-void monoChain::deleteLoop()
-{
- monoChain *temp, *tempNext;
- prev->next = NULL;
- for(temp=this; temp != NULL; temp = tempNext)
- {
- tempNext = temp->next;
- delete temp;
- }
-}
-
-void monoChain::deleteLoopList()
-{
- monoChain *temp, *tempNext;
- for(temp=this; temp != NULL; temp = tempNext)
- {
- tempNext = temp->nextPolygon;
- temp->deleteLoop();
- }
-}
-
-Int monoChain::toArraySingleLoop(monoChain** array, Int index)
-{
- monoChain *temp;
- array[index++] = this;
- for(temp = next; temp != this; temp = temp->next)
- {
- array[index++] = temp;
- }
- return index;
-}
-
-monoChain** monoChain::toArrayAllLoops(Int& num_chains)
-{
- num_chains = numChainsAllLoops();
- monoChain **ret = (monoChain**) malloc(sizeof(monoChain*) * num_chains);
- assert(ret);
- monoChain *temp;
- Int index = 0;
- for(temp = this; temp != NULL; temp=temp->nextPolygon){
- index = temp->toArraySingleLoop(ret, index);
- }
- return ret;
-}
-
-Int monoChain::numChainsSingleLoop()
-{
- Int ret=0;
- monoChain* temp;
- if(next == this) return 1;
- ret = 1;
- for(temp=next; temp != this; temp = temp->next)
- ret++;
- return ret;
-}
-
-Int monoChain::numChainsAllLoops()
-{
- Int ret=0;
- monoChain *temp;
- for(temp =this; temp != NULL; temp = temp->nextPolygon)
- ret += temp->numChainsSingleLoop();
- return ret;
-}
-
-//update 'current'
-Real monoChain::chainIntersectHoriz(Real y)
-{
- directedLine* temp;
- if(isIncrease)
- {
- for(temp= current; temp != chainTail; temp = temp->getNext())
- {
- if(temp->head()[1] > y)
- break;
- }
- current = temp->getPrev();
- }
- else
- {
- for(temp = current; temp != chainHead; temp = temp->getPrev())
- {
- if(temp->head()[1] > y)
- break;
- }
- current = temp->getNext();
- }
- return intersectHoriz(current->head()[0], current->head()[1], current->tail()[0], current->tail()[1], y);
-}
-
-monoChain* directedLineLoopToMonoChainLoop(directedLine* loop)
-{
- directedLine *temp;
- monoChain *ret=NULL;
-
- //find the first cusp
- directedLine *prevCusp=NULL;
- directedLine *firstCusp;
-
- if(isCusp(loop))
- prevCusp = loop;
- else
- {
- for(temp = loop->getNext(); temp != loop; temp = temp->getNext())
- if(isCusp(temp))
- break;
- prevCusp = temp;
- }
- firstCusp = prevCusp;
-//printf("first cusp is (%f,%f), (%f,%f), (%f,%f)\n", prevCusp->getPrev()->head()[0], prevCusp->getPrev()->head()[1], prevCusp->head()[0], prevCusp->head()[1], prevCusp->tail()[0], prevCusp->tail()[1]);
-
- for(temp = prevCusp->getNext(); temp != loop; temp = temp->getNext())
- {
- if(isCusp(temp))
- {
-//printf("the cusp is (%f,%f), (%f,%f), (%f,%f)\n", temp->getPrev()->head()[0], temp->getPrev()->head()[1], temp->head()[0], temp->head()[1], temp->tail()[0], temp->tail()[1]);
- if(ret == NULL)
- {
- ret = new monoChain(prevCusp, temp);
- }
- else
- ret->insert(new monoChain(prevCusp, temp));
- prevCusp = temp;
- }
- }
- ret->insert(new monoChain(prevCusp, firstCusp));
-
- return ret;
-}
-
-monoChain* directedLineLoopListToMonoChainLoopList(directedLine* list)
-{
- directedLine* temp;
- monoChain* mc;
- monoChain* mcEnd;
- mc = directedLineLoopToMonoChainLoop(list);
- mcEnd = mc;
- for(temp = list->getNextPolygon(); temp != NULL; temp = temp->getNextPolygon())
- {
- monoChain *newLoop = directedLineLoopToMonoChainLoop(temp);
- mcEnd->setNextPolygon(newLoop);
- mcEnd = newLoop;
- }
- return mc;
-}
-
-/*compare two edges of a polygon.
- *edge A < edge B if there is a horizontal line so that the intersection
- *with A is to the left of the intersection with B.
- *This function is used in sweepY for the dynamic search tree insertion to
- *order the edges.
- * Implementation: (x_1,y_1) and (x_2, y_2)
- */
-static Int compEdges(directedLine *e1, directedLine *e2)
-{
- Real* head1 = e1->head();
- Real* tail1 = e1->tail();
- Real* head2 = e2->head();
- Real* tail2 = e2->tail();
-/*
- Real h10 = head1[0];
- Real h11 = head1[1];
- Real t10 = tail1[0];
- Real t11 = tail1[1];
- Real h20 = head2[0];
- Real h21 = head2[1];
- Real t20 = tail2[0];
- Real t21 = tail2[1];
-*/
- Real e1_Ymax, e1_Ymin, e2_Ymax, e2_Ymin;
-/*
- if(h11>t11) {
- e1_Ymax= h11;
- e1_Ymin= t11;
- }
- else{
- e1_Ymax = t11;
- e1_Ymin = h11;
- }
-
- if(h21>t21) {
- e2_Ymax= h21;
- e2_Ymin= t21;
- }
- else{
- e2_Ymax = t21;
- e2_Ymin = h21;
- }
-*/
-
- if(head1[1]>tail1[1]) {
- e1_Ymax= head1[1];
- e1_Ymin= tail1[1];
- }
- else{
- e1_Ymax = tail1[1];
- e1_Ymin = head1[1];
- }
-
- if(head2[1]>tail2[1]) {
- e2_Ymax= head2[1];
- e2_Ymin= tail2[1];
- }
- else{
- e2_Ymax = tail2[1];
- e2_Ymin = head2[1];
- }
-
-
- /*Real e1_Ymax = max(head1[1], tail1[1]);*/ /*max(e1->head()[1], e1->tail()[1]);*/
- /*Real e1_Ymin = min(head1[1], tail1[1]);*/ /*min(e1->head()[1], e1->tail()[1]);*/
- /*Real e2_Ymax = max(head2[1], tail2[1]);*/ /*max(e2->head()[1], e2->tail()[1]);*/
- /*Real e2_Ymin = min(head2[1], tail2[1]);*/ /*min(e2->head()[1], e2->tail()[1]);*/
-
- Real Ymax = min(e1_Ymax, e2_Ymax);
- Real Ymin = max(e1_Ymin, e2_Ymin);
-
- Real y = 0.5*(Ymax + Ymin);
-
-/* Real x1 = intersectHoriz(e1->head()[0], e1->head()[1], e1->tail()[0], e1->tail()[1], y);
- Real x2 = intersectHoriz(e2->head()[0], e2->head()[1], e2->tail()[0], e2->tail()[1], y);
-*/
-/*
- Real x1 = intersectHoriz(h10, h11, t10, t11, y);
- Real x2 = intersectHoriz(h20, h21, t20, t21, y);
-*/
- Real x1 = intersectHoriz(head1[0], head1[1], tail1[0], tail1[1], y);
- Real x2 = intersectHoriz(head2[0], head2[1], tail2[0], tail2[1], y);
-
- if(x1<= x2) return -1;
- else return 1;
-}
-
-Int compChains(monoChain* mc1, monoChain* mc2)
-{
- Real y;
- assert(mc1->isKey || mc2->isKey);
- if(mc1->isKey)
- y = mc1->keyY;
- else
- y = mc2->keyY;
- directedLine *d1 = mc1->find(y);
- directedLine *d2 = mc2->find(y);
- mc2->find(y);
-// Real x1 = mc1->chainIntersectHoriz(y);
-// Real x2 = mc2->chainIntersectHoriz(y);
- return compEdges(d1, d2);
-}
-
-//this function modifies current for efficiency
-directedLine* monoChain::find(Real y)
-{
- directedLine *ret;
- directedLine *temp;
- assert(current->head()[1] <= y);
- if(isIncrease)
- {
- assert(chainTail->head()[1] >=y);
- for(temp=current; temp!=chainTail; temp = temp->getNext())
- {
- if(temp->head()[1] > y)
- break;
- }
- current = temp->getPrev();
- ret = current;
- }
- else
- {
- for(temp=current; temp != chainHead; temp = temp->getPrev())
- {
- if(temp->head()[1] > y)
- break;
- }
- current = temp->getNext();
- ret = temp;
- }
- return ret;
-}
-
-void monoChain::printOneChain()
-{
- directedLine* temp;
- for(temp = chainHead; temp != chainTail; temp = temp->getNext())
- {
- printf("(%f,%f) ", temp->head()[0], temp->head()[1]);
- }
- printf("(%f,%f) \n", chainTail->head()[0], chainTail->head()[1]);
-}
-
-void monoChain::printChainLoop()
-{
- monoChain* temp;
- this->printOneChain();
- for(temp = next; temp != this; temp = temp->next)
- {
- temp->printOneChain();
- }
- printf("\n");
-}
-
-void monoChain::printAllLoops()
-{
- monoChain* temp;
- for(temp=this; temp != NULL; temp = temp->nextPolygon)
- temp->printChainLoop();
-}
-
-//return 1 if error occures
-Int MC_sweepY(Int nVertices, monoChain** sortedVertices, sweepRange** ret_ranges)
-{
- Int i;
- Real keyY;
- Int errOccur=0;
-//printf("enter MC_sweepY\n");
-//printf("nVertices=%i\n", nVertices);
- /*for each vertex in the sorted list, update the binary search tree.
- *and store the range information for each vertex.
- */
- treeNode* searchTree = NULL;
-//printf("nVertices=%i\n", nVertices);
- for(i=0; i<nVertices; i++)
- {
- monoChain* vert = sortedVertices[i];
- keyY = vert->getHead()->head()[1]; //the sweep line
- directedLine *dline = vert->getHead();
- directedLine *dlinePrev = dline->getPrev();
- if(isBelow(dline, dline) && isBelow(dline, dlinePrev))
- {
-//printf("case 1\n");
- //this<v and prev < v
- //delete both edges
- vert->isKey = 1;
- vert->keyY = keyY;
- treeNode* thisNode = TreeNodeFind(searchTree, vert, (Int (*) (void *, void *))compChains);
- vert->isKey = 0;
-
- vert->getPrev()->isKey = 1;
- vert->getPrev()->keyY = keyY;
- treeNode* prevNode = TreeNodeFind(searchTree, vert->getPrev(), (Int (*) (void *, void *))compChains);
- vert->getPrev()->isKey = 0;
-
- if(cuspType(dline) == 1)//interior cusp
- {
-
- treeNode* leftEdge = TreeNodePredecessor(prevNode);
- treeNode* rightEdge = TreeNodeSuccessor(thisNode);
- if(leftEdge == NULL || rightEdge == NULL)
- {
- errOccur = 1;
- goto JUMP_HERE;
- }
-
- directedLine* leftEdgeDline = ((monoChain* ) leftEdge->key)->find(keyY);
-
-
-
- directedLine* rightEdgeDline = ((monoChain* ) rightEdge->key)->find(keyY);
-
- ret_ranges[i] = sweepRangeMake(leftEdgeDline, 1, rightEdgeDline, 1);
- }
- else /*exterior cusp*/
- {
- ret_ranges[i] = sweepRangeMake( dline, 1, dlinePrev, 1);
- }
-
- searchTree = TreeNodeDeleteSingleNode(searchTree, thisNode);
- searchTree = TreeNodeDeleteSingleNode(searchTree, prevNode);
-
- }
- else if(isAbove(dline, dline) && isAbove(dline, dlinePrev))
- {
-//printf("case 2\n");
- //insert both edges
- treeNode* thisNode = TreeNodeMake(vert);
- treeNode* prevNode = TreeNodeMake(vert->getPrev());
-
- vert->isKey = 1;
- vert->keyY = keyY;
- searchTree = TreeNodeInsert(searchTree, thisNode, (Int (*) (void *, void *))compChains);
- vert->isKey = 0;
-
- vert->getPrev()->isKey = 1;
- vert->getPrev()->keyY = keyY;
- searchTree = TreeNodeInsert(searchTree, prevNode, (Int (*) (void *, void *))compChains);
- vert->getPrev()->isKey = 0;
-
- if(cuspType(dline) == 1) //interior cusp
- {
-//printf("cuspType is 1\n");
- treeNode* leftEdge = TreeNodePredecessor(thisNode);
- treeNode* rightEdge = TreeNodeSuccessor(prevNode);
- if(leftEdge == NULL || rightEdge == NULL)
- {
- errOccur = 1;
- goto JUMP_HERE;
- }
-//printf("leftEdge is %i, rightEdge is %i\n", leftEdge, rightEdge);
- directedLine* leftEdgeDline = ((monoChain*) leftEdge->key)->find(keyY);
- directedLine* rightEdgeDline = ((monoChain*) rightEdge->key)->find(keyY);
- ret_ranges[i] = sweepRangeMake( leftEdgeDline, 1, rightEdgeDline, 1);
- }
- else //exterior cusp
- {
-//printf("cuspType is not 1\n");
- ret_ranges[i] = sweepRangeMake(dlinePrev, 1, dline, 1);
- }
- }
- else
- {
-//printf("%i,%i\n", isAbove(dline, dline), isAbove(dline, dlinePrev));
- errOccur = 1;
- goto JUMP_HERE;
-
- fprintf(stderr, "error in MC_sweepY\n");
- exit(1);
- }
- }
-
- JUMP_HERE:
- //finally clean up space: delete the search tree
- TreeNodeDeleteWholeTree(searchTree);
- return errOccur;
-}
-
-void MC_findDiagonals(Int total_num_edges, monoChain** sortedVertices,
- sweepRange** ranges, Int& num_diagonals,
- directedLine** diagonal_vertices)
-{
- Int i,j,k;
- k=0;
- //reset 'current' of all the monoChains
- for(i=0; i<total_num_edges; i++)
- sortedVertices[i]->resetCurrent();
-
- for(i=0; i<total_num_edges; i++)
- {
- directedLine* vert = sortedVertices[i]->getHead();
- directedLine* thisEdge = vert;
- directedLine* prevEdge = vert->getPrev();
- if(isBelow(vert, thisEdge) && isBelow(vert, prevEdge) && compEdges(prevEdge, thisEdge)<0)
- {
- //this is an upward interior cusp
- diagonal_vertices[k++] = vert;
-
- directedLine* leftEdge = ranges[i]->left;
- directedLine* rightEdge = ranges[i]->right;
-
- directedLine* leftVert = leftEdge;
- directedLine* rightVert = rightEdge->getNext();
- assert(leftVert->head()[1] >= vert->head()[1]);
- assert(rightVert->head()[1] >= vert->head()[1]);
- directedLine* minVert = (leftVert->head()[1] <= rightVert->head()[1])?leftVert:rightVert;
- Int found = 0;
- for(j=i+1; j<total_num_edges; j++)
- {
- if(sortedVertices[j]->getHead()->head()[1] > minVert->head()[1])
- break;
-
- if(sweepRangeEqual(ranges[i], ranges[j]))
- {
- found = 1;
- break;
- }
- }
-
- if(found)
- diagonal_vertices[k++] = sortedVertices[j]->getHead();
- else
- diagonal_vertices[k++] = minVert;
- }
- else if(isAbove(vert, thisEdge) && isAbove(vert, prevEdge) && compEdges(prevEdge, thisEdge)>0)
- {
- //downward interior cusp
- diagonal_vertices[k++] = vert;
- directedLine* leftEdge = ranges[i]->left;
- directedLine* rightEdge = ranges[i]->right;
- directedLine* leftVert = leftEdge->getNext();
- directedLine* rightVert = rightEdge;
- assert(leftVert->head()[1] <= vert->head()[1]);
- assert(rightVert->head()[1] <= vert->head()[1]);
- directedLine* maxVert = (leftVert->head()[1] > rightVert->head()[1])? leftVert:rightVert;
- Int found=0;
- for(j=i-1; j>=0; j--)
- {
- if(sortedVertices[j]->getHead()->head()[1] < maxVert->head()[1])
- break;
- if(sweepRangeEqual(ranges[i], ranges[j]))
- {
- found = 1;
- break;
- }
- }
- if(found)
- diagonal_vertices[k++] = sortedVertices[j]->getHead();
- else
- diagonal_vertices[k++] = maxVert;
- }
- }
- num_diagonals = k/2;
-}
-
-
-
-
-directedLine* MC_partitionY(directedLine *polygons, sampledLine **retSampledLines)
-{
-//printf("enter mc_partitionY\n");
- Int total_num_chains = 0;
- monoChain* loopList = directedLineLoopListToMonoChainLoopList(polygons);
- monoChain** array = loopList->toArrayAllLoops(total_num_chains);
-
- if(total_num_chains<=2) //there is just one single monotone polygon
- {
- loopList->deleteLoopList();
- free(array);
- *retSampledLines = NULL;
- return polygons;
- }
-
-//loopList->printAllLoops();
-//printf("total_num_chains=%i\n", total_num_chains);
- quicksort( (void**)array, 0, total_num_chains-1, (Int (*)(void*, void*))compChainHeadInY);
-//printf("after quicksort\n");
-
- sweepRange** ranges = (sweepRange**)malloc(sizeof(sweepRange*) * (total_num_chains));
- assert(ranges);
-
- if(MC_sweepY(total_num_chains, array, ranges))
- {
- loopList->deleteLoopList();
- free(array);
- *retSampledLines = NULL;
- return NULL;
- }
-//printf("after MC_sweepY\n");
-
-
- Int num_diagonals;
- /*number diagonals is < total_num_edges*total_num_edges*/
- directedLine** diagonal_vertices = (directedLine**) malloc(sizeof(directedLine*) * total_num_chains*2/*total_num_edges*/);
- assert(diagonal_vertices);
-
-//printf("before call MC_findDiagonales\n");
-
- MC_findDiagonals(total_num_chains, array, ranges, num_diagonals, diagonal_vertices);
-//printf("after call MC_findDia, num_diagnla=%i\n", num_diagonals);
-
- directedLine* ret_polygons = polygons;
- sampledLine* newSampledLines = NULL;
- Int i,k;
-
- num_diagonals=deleteRepeatDiagonals(num_diagonals, diagonal_vertices, diagonal_vertices);
-
-
-
-//drawDiagonals(num_diagonals, diagonal_vertices);
-//printf("diagoanls are \n");
-//for(i=0; i<num_diagonals; i++)
-// {
-// printf("(%f,%f)\n", diagonal_vertices[2*i]->head()[0], diagonal_vertices[2*i]->head()[1]);
-// printf("**(%f,%f)\n", diagonal_vertices[2*i+1]->head()[0], diagonal_vertices[2*i+1]->head()[1]);
-// }
-
- Int *removedDiagonals=(Int*)malloc(sizeof(Int) * num_diagonals);
- for(i=0; i<num_diagonals; i++)
- removedDiagonals[i] = 0;
-// printf("first pass\n");
-
-
- for(i=0,k=0; i<num_diagonals; i++,k+=2)
- {
-
-
- directedLine* v1=diagonal_vertices[k];
- directedLine* v2=diagonal_vertices[k+1];
- directedLine* ret_p1;
- directedLine* ret_p2;
-
- /*we ahve to determine whether v1 and v2 belong to the same polygon before
- *their structure are modified by connectDiagonal().
- */
-/*
- directedLine *root1 = v1->findRoot();
- directedLine *root2 = v2->findRoot();
- assert(root1);
- assert(root2);
-*/
-
-directedLine* root1 = v1->rootLinkFindRoot();
-directedLine* root2 = v2->rootLinkFindRoot();
-
- if(root1 != root2)
- {
-
- removedDiagonals[i] = 1;
- sampledLine* generatedLine;
-
-
-
- v1->connectDiagonal(v1,v2, &ret_p1, &ret_p2, &generatedLine, ret_polygons);
-
-
-
- newSampledLines = generatedLine->insert(newSampledLines);
-/*
- ret_polygons = ret_polygons->cutoffPolygon(root1);
-
- ret_polygons = ret_polygons->cutoffPolygon(root2);
- ret_polygons = ret_p1->insertPolygon(ret_polygons);
-root1->rootLinkSet(ret_p1);
-root2->rootLinkSet(ret_p1);
-ret_p1->rootLinkSet(NULL);
-ret_p2->rootLinkSet(ret_p1);
-*/
- ret_polygons = ret_polygons->cutoffPolygon(root2);
-
-
-
-root2->rootLinkSet(root1);
-ret_p1->rootLinkSet(root1);
-ret_p2->rootLinkSet(root1);
-
- /*now that we have connected the diagonal v1 and v2,
- *we have to check those unprocessed diagonals which
- *have v1 or v2 as an end point. Notice that the head of v1
- *has the same coodinates as the head of v2->prev, and the head of
- *v2 has the same coordinate as the head of v1->prev.
- *Suppose these is a diagonal (v1, x). If (v1,x) is still a valid
- *diagonal, then x should be on the left hand side of the directed line: *v1->prev->head -- v1->head -- v1->tail. Otherwise, (v1,x) should be
- *replaced by (v2->prev, x), that is, x is on the left of
- * v2->prev->prev->head, v2->prev->head, v2->prev->tail.
- */
- Int ii, kk;
- for(ii=0, kk=0; ii<num_diagonals; ii++, kk+=2)
- if( removedDiagonals[ii]==0)
- {
- directedLine* d1=diagonal_vertices[kk];
- directedLine* d2=diagonal_vertices[kk+1];
- /*check d1, and replace diagonal_vertices[kk] if necessary*/
- if(d1 == v1) {
- /*check if d2 is to left of v1->prev->head:v1->head:v1->tail*/
- if(! pointLeft2Lines(v1->getPrev()->head(),
- v1->head(), v1->tail(), d2->head()))
- {
-/*
- assert(pointLeft2Lines(v2->getPrev()->getPrev()->head(),
- v2->getPrev()->head(),
- v2->getPrev()->tail(), d2->head()));
-*/
- diagonal_vertices[kk] = v2->getPrev();
- }
- }
- if(d1 == v2) {
- /*check if d2 is to left of v2->prev->head:v2->head:v2->tail*/
- if(! pointLeft2Lines(v2->getPrev()->head(),
- v2->head(), v2->tail(), d2->head()))
- {
-/*
- assert(pointLeft2Lines(v1->getPrev()->getPrev()->head(),
- v1->getPrev()->head(),
- v1->getPrev()->tail(), d2->head()));
-*/
- diagonal_vertices[kk] = v1->getPrev();
- }
- }
- /*check d2 and replace diagonal_vertices[k+1] if necessary*/
- if(d2 == v1) {
- /*check if d1 is to left of v1->prev->head:v1->head:v1->tail*/
- if(! pointLeft2Lines(v1->getPrev()->head(),
- v1->head(), v1->tail(), d1->head()))
- {
-/* assert(pointLeft2Lines(v2->getPrev()->getPrev()->head(),
- v2->getPrev()->head(),
- v2->getPrev()->tail(), d1->head()));
-*/
- diagonal_vertices[kk+1] = v2->getPrev();
- }
- }
- if(d2 == v2) {
- /*check if d1 is to left of v2->prev->head:v2->head:v2->tail*/
- if(! pointLeft2Lines(v2->getPrev()->head(),
- v2->head(), v2->tail(), d1->head()))
- {
-/* assert(pointLeft2Lines(v1->getPrev()->getPrev()->head(),
- v1->getPrev()->head(),
- v1->getPrev()->tail(), d1->head()));
-*/
- diagonal_vertices[kk+1] = v1->getPrev();
- }
- }
- }
-}/*end if (root1 not equal to root 2)*/
-}
-
- /*second pass, now all diagoals should belong to the same polygon*/
-//printf("second pass: \n");
-
-// for(i=0; i<num_diagonals; i++)
-// printf("%i ", removedDiagonals[i]);
-
-
- for(i=0,k=0; i<num_diagonals; i++, k += 2)
- if(removedDiagonals[i] == 0)
- {
-
-
- directedLine* v1=diagonal_vertices[k];
- directedLine* v2=diagonal_vertices[k+1];
-
-
-
- directedLine* ret_p1;
- directedLine* ret_p2;
-
- /*we ahve to determine whether v1 and v2 belong to the same polygon before
- *their structure are modified by connectDiagonal().
- */
- directedLine *root1 = v1->findRoot();
-/*
- directedLine *root2 = v2->findRoot();
-
-
-
- assert(root1);
- assert(root2);
- assert(root1 == root2);
- */
- sampledLine* generatedLine;
-
-
-
- v1->connectDiagonal(v1,v2, &ret_p1, &ret_p2, &generatedLine, ret_polygons);
- newSampledLines = generatedLine->insert(newSampledLines);
-
- ret_polygons = ret_polygons->cutoffPolygon(root1);
-
- ret_polygons = ret_p1->insertPolygon(ret_polygons);
-
- ret_polygons = ret_p2->insertPolygon(ret_polygons);
-
-
-
- for(Int j=i+1; j<num_diagonals; j++)
- {
- if(removedDiagonals[j] ==0)
- {
-
- directedLine* temp1=diagonal_vertices[2*j];
- directedLine* temp2=diagonal_vertices[2*j+1];
- if(temp1==v1 || temp1==v2 || temp2==v1 || temp2==v2)
- if(! temp1->samePolygon(temp1, temp2))
- {
- /*if temp1 and temp2 are in different polygons,
- *then one of them must be v1 or v2.
- */
-
-
-
- assert(temp1==v1 || temp1 == v2 || temp2==v1 || temp2 ==v2);
- if(temp1==v1)
- {
- diagonal_vertices[2*j] = v2->getPrev();
- }
- if(temp2==v1)
- {
- diagonal_vertices[2*j+1] = v2->getPrev();
- }
- if(temp1==v2)
- {
- diagonal_vertices[2*j] = v1->getPrev();
- }
- if(temp2==v2)
- {
- diagonal_vertices[2*j+1] = v1->getPrev();
- }
- }
- }
- }
-
- }
-
-
- //clean up
- loopList->deleteLoopList();
- free(array);
- free(ranges);
- free(diagonal_vertices);
- free(removedDiagonals);
-
- *retSampledLines = newSampledLines;
- return ret_polygons;
-}
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoChain.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoChain.h
deleted file mode 100755
index 93cd66776..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoChain.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/monoChain.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _MONO_CHAIN_H
-#define _MONO_CHAIN_H
-
-#include "directedLine.h"
-#include "partitionY.h"
-
-class monoChain;
-
-class monoChain{
- directedLine* chainHead;
- directedLine* chainTail;
- monoChain* next;
- monoChain* prev;
- monoChain* nextPolygon; //a list of polygons
-
- //cached informatin
- //bounding box
- Real minX, maxX, minY, maxY;
- Int isIncrease;
-
- //for efficiently comparing two chains
-
- directedLine* current;
-
-public:
- monoChain(directedLine* cHead, directedLine* cTail);
- ~monoChain() {}
-
- inline void setNext(monoChain* n) {next = n;}
- inline void setPrev(monoChain* p) {prev = p;}
- inline void setNextPolygon(monoChain* np) {nextPolygon = np;}
- inline monoChain* getNext() {return next;}
- inline monoChain* getPrev() {return prev;}
- inline directedLine* getHead() {return chainHead;}
- inline directedLine* getTail() {return chainTail;}
-
- inline void resetCurrent() { current = ((isIncrease==1)? chainHead:chainTail);}
-
- void deleteLoop();
- void deleteLoopList();
-
- //insert a new chain between prev and this
- void insert(monoChain* nc);
-
- Int numChainsSingleLoop();
- Int numChainsAllLoops();
- monoChain** toArrayAllLoops(Int& num_chains);
- Int toArraySingleLoop(monoChain** array, Int index);
-
- Int isKey;
- Real keyY; //the current horizotal line
- Real chainIntersectHoriz(Real y); //updates current incrementally for efficiency
- directedLine* find(Real y);//find dline so that y intersects dline.
-
- void printOneChain();
- void printChainLoop();
- void printAllLoops();
-
-};
-
-monoChain* directedLineLoopToMonoChainLoop(directedLine* loop);
-monoChain* directedLineLoopListToMonoChainLoopList(directedLine* list);
-Int MC_sweepY(Int nVertices, monoChain** sortedVertices, sweepRange** ret_ranges);
-
-void MC_findDiagonals(Int total_num_edges, monoChain** sortedVertices,
- sweepRange** ranges, Int& num_diagonals,
- directedLine** diagonal_vertices);
-
-directedLine* MC_partitionY(directedLine *polygons, sampledLine **retSampledLines);
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoPolyPart.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoPolyPart.cc
deleted file mode 100755
index bf0c822d9..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoPolyPart.cc
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
- *monoPolyPart.C
- *
- *To partition a v-monotone polygon into some uv-monotone polygons.
- *The algorithm is different from the general monotone partition algorithm.
- *while the general monotone partition algorithm works for this special case,
- *but it is more expensive (O(nlogn)). The algorithm implemented here takes
- *advantage of the fact that the input is a v-monotone polygon and it is
- *conceptually simpler and computationally cheaper (a linear time algorithm).
- *The algorithm is described in Zicheng Liu's paper
- * "Quality-Oriented Linear Time Tessellation".
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "directedLine.h"
-#include "monoPolyPart.h"
-
-/*a vertex is u_maximal if both of its two neightbors are to the left of this
- *vertex
- */
-static Int is_u_maximal(directedLine* v)
-{
- if (compV2InX(v->getPrev()->head(), v->head()) == -1 &&
- compV2InX(v->getNext()->head(), v->head()) == -1)
- return 1;
- else
- return 0;
-}
-
-/*a vertex is u_minimal if both of its two neightbors are to the right of this
- *vertex
- */
-static Int is_u_minimal(directedLine* v)
-{
- if (compV2InX(v->getPrev()->head(), v->head()) == 1 &&
- compV2InX(v->getNext()->head(), v->head()) == 1)
- return 1;
- else
- return 0;
-}
-
-/*poly: a v-monotone polygon
- *return: a linked list of uv-monotone polygons.
- */
-directedLine* monoPolyPart(directedLine* polygon)
-{
- //handle special cases:
- if(polygon == NULL)
- return NULL;
- if(polygon->getPrev() == polygon)
- return polygon;
- if(polygon->getPrev() == polygon->getNext())
- return polygon;
- if(polygon->getPrev()->getPrev() == polygon->getNext())
- return polygon;
-
- //find the top and bottom vertexes
- directedLine *tempV, *topV, *botV;
- topV = botV = polygon;
- for(tempV = polygon->getNext(); tempV != polygon; tempV = tempV->getNext())
- {
- if(compV2InY(topV->head(), tempV->head())<0) {
- topV = tempV;
- }
- if(compV2InY(botV->head(), tempV->head())>0) {
- botV = tempV;
- }
- }
-
- //initilization
- directedLine *A, *B, *C, *D, *G, *H;
- //find A:the first u_maximal vertex on the left chain
- //and C: the left most vertex between top and A
- A = NULL;
- C = topV;
- for(tempV=topV->getNext(); tempV != botV; tempV = tempV->getNext())
- {
- if(tempV->head()[0] < C->head()[0])
- C = tempV;
-
- if(is_u_maximal(tempV))
- {
- A = tempV;
- break;
- }
- }
- if(A == NULL)
- {
- A = botV;
- if(A->head()[0] < C->head()[0])
- C = A;
- }
-
- //find B: the first u_minimal vertex on the right chain
- //and D: the right most vertex between top and B
- B = NULL;
- D = topV;
- for(tempV=topV->getPrev(); tempV != botV; tempV = tempV->getPrev())
- {
- if(tempV->head()[0] > D->head()[0])
- D = tempV;
- if(is_u_minimal(tempV))
- {
- B = tempV;
- break;
- }
- }
- if(B == NULL)
- {
- B = botV;
- if(B->head()[0] > D->head()[0])
- D = B;
- }
-
- //error checking XXX
- if(C->head()[0] >= D->head()[0])
- return polygon;
-
- //find G on the left chain that is right above B
- for(tempV=topV; compV2InY(tempV->head(), B->head()) == 1; tempV=tempV->getNext());
- G = tempV->getPrev();
- //find H on the right chain that is right above A
- for(tempV=topV; compV2InY(tempV->head(), A->head()) == 1; tempV = tempV->getPrev());
- H = tempV->getNext();
-
- //Main Loop
- directedLine* ret = NULL;
- directedLine* currentPolygon = polygon;
- while(1)
- {
- //if both B and D are equal to botV, then this polygon is already
- //u-monotone
- if(A == botV && B == botV)
- {
- ret = currentPolygon->insertPolygon(ret);
- return ret;
- }
- else //not u-monotone
- {
- directedLine *ret_p1, *ret_p2;
- if(compV2InY(A->head(),B->head()) == 1) //A is above B
- {
- directedLine* E = NULL;
- for(tempV = C; tempV != D; tempV = tempV->getPrev())
- {
- if(tempV->head()[0] >= A->head()[0])
- {
- E = tempV;
- break;
- }
- }
-
- if(E == NULL)
- E = D;
- if(E->head()[0]> H->head()[0])
- E = H;
- //connect AE and output polygon ECA
- polygon->connectDiagonal_2slines(A, E,
- &ret_p1,
- &ret_p2,
- NULL);
- ret = ret_p2->insertPolygon(ret);
- currentPolygon = ret_p1;
-
- if(E == D)
- D = ret_p1;
- if(E == H)
- H = ret_p1;
- if(G->head()[1] >= A->head()[1])
- G = A;
- //update A to be the next u-maxiaml vertex on left chain
- //and C the leftmost vertex between the old A and the new A
- C = A;
- for(tempV = A->getNext(); tempV != botV; tempV = tempV->getNext())
- {
-
- if(tempV->head()[0] < C->head()[0])
- C = tempV;
- if(is_u_maximal(tempV))
- {
- A = tempV;
- break;
- }
- }
-
- if(tempV == botV)
- {
- A = botV;
- if(botV->head()[0] < C->head()[0])
- C = botV;
- }
- //update H
-
- if(A == botV)
- H = botV;
- else
- {
- for(tempV = H; compV2InY(tempV->head(), A->head()) == 1; tempV = tempV->getPrev());
- H = tempV->getNext();
- }
-
- }
- else //A is below B
- {
-
- directedLine* F = NULL;
- for(tempV = D; tempV != C; tempV = tempV->getNext())
- {
- if(tempV->head()[0] <= B->head()[0])
- {
- F = tempV;
- break;
- }
- }
- if(F == NULL)
- F = C;
- if(F->head()[0] < G->head()[0])
- F = G;
-
- //connect FB
- polygon->connectDiagonal_2slines(F, B,
- &ret_p1,
- &ret_p2,
- NULL);
- ret = ret_p2->insertPolygon(ret);
- currentPolygon = ret_p1;
- B = ret_p1;
- if(H ->head()[1] >= B->head()[1])
- H = ret_p1;
-
- //update B to be the next u-minimal vertex on right chain
- //and D the rightmost vertex between the old B and the new B
- D = B;
- for(tempV = B->getPrev(); tempV != botV; tempV = tempV->getPrev())
- {
- if(tempV->head()[0] > D->head()[0])
- D = tempV;
- if(is_u_minimal(tempV))
- {
- B = tempV;
- break;
- }
- }
- if(tempV == botV)
- {
- B = botV;
- if(botV->head()[0] > D->head()[0])
- D = botV;
- }
- //update G
- if(B == botV)
- G = botV;
- else
- {
- for(tempV = G; compV2InY(tempV->head(), B->head()) == 1; tempV = tempV->getNext());
- G = tempV->getPrev();
- }
- } //end of A is below B
- } //end not u-monotone
- } //end of main loop
-}
-
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoPolyPart.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoPolyPart.h
deleted file mode 100755
index 7034c8f6c..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoPolyPart.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
- *monoPolyPart.h
- */
-
-#ifndef _MONO_POLY_PART_H
-#define _MONO_POLY_PART_H
-
-class directedLine;
-
-directedLine* monoPolyPart(directedLine* polygon);
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoTriangulation.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoTriangulation.cc
deleted file mode 100755
index 47921685a..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoTriangulation.cc
+++ /dev/null
@@ -1,1479 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/monoTriangulation.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "glimports.h"
-#include "zlassert.h"
-
-#include "monoTriangulation.h"
-#include "polyUtil.h" /*for area*/
-#include "partitionX.h"
-#include "monoPolyPart.h"
-
-
-
-extern directedLine* polygonConvert(directedLine* polygon);
-
-/*poly is NOT deleted
- */
-void monoTriangulationOpt(directedLine* poly, primStream* pStream)
-{
- Int n_cusps;
- Int n_edges = poly->numEdges();
- directedLine** cusps = (directedLine**) malloc(sizeof(directedLine*)*n_edges);
- assert(cusps);
- findInteriorCuspsX(poly, n_cusps, cusps);
- if(n_cusps ==0) //u monotine
- {
- monoTriangulationFun(poly, compV2InX, pStream);
- }
- else if(n_cusps == 1) // one interior cusp
- {
- directedLine* new_polygon = polygonConvert(cusps[0]);
- directedLine* other = findDiagonal_singleCuspX(new_polygon);
- //<other> should NOT be null unless there are self-intersecting
- //trim curves. In that case, we don't want to core dump, instead,
- //we triangulate anyway, and print out error message.
- if(other == NULL)
- {
- monoTriangulationFun(poly, compV2InX, pStream);
- }
- else
- {
- directedLine* ret_p1;
- directedLine* ret_p2;
-
- new_polygon->connectDiagonal_2slines(new_polygon, other,
- &ret_p1,
- &ret_p2,
- new_polygon);
-
- monoTriangulationFun(ret_p1, compV2InX, pStream);
- monoTriangulationFun(ret_p2, compV2InX, pStream);
-
- ret_p1->deleteSinglePolygonWithSline();
- ret_p2->deleteSinglePolygonWithSline();
- }
- }
- else
- {
- //we need a general partitionX funtion (supposed to be in partitionX.C,
- //not implemented yet. XXX
- monoTriangulationFun(poly, compV2InY, pStream);
- }
-
- free(cusps);
-}
-
-void monoTriangulationRecOpt(Real* topVertex, Real* botVertex,
- vertexArray* left_chain, Int left_current,
- vertexArray* right_chain, Int right_current,
- primStream* pStream)
-{
- Int i,j;
- Int n_left = left_chain->getNumElements();
- Int n_right = right_chain->getNumElements();
- if(left_current>= n_left-1 ||
- right_current>= n_right-1)
- {
- monoTriangulationRec(topVertex, botVertex, left_chain, left_current,
- right_chain, right_current, pStream);
- return;
- }
- //now both left and right have at least two vertices each.
- Real left_v = left_chain->getVertex(left_current)[1];
- Real right_v = right_chain->getVertex(right_current)[1];
-
- if(left_v <= right_v) //first left vertex is below right
- {
- //find the last vertex of right which is above or equal to left
- for(j=right_current; j<=n_right-1; j++)
- {
- if(right_chain->getVertex(j)[1] < left_v)
- break;
- }
- monoTriangulationRecGen(topVertex, left_chain->getVertex(left_current),
- left_chain, left_current, left_current,
- right_chain, right_current, j-1,
- pStream);
- monoTriangulationRecOpt(right_chain->getVertex(j-1),
- botVertex,
- left_chain, left_current,
- right_chain, j,
- pStream);
- }
- else //first right vertex is strictly below left
- {
- //find the last vertex of left which is strictly above right
- for(i=left_current; i<=n_left-1; i++)
- {
- if(left_chain->getVertex(i)[1] <= right_v)
- break;
- }
- monoTriangulationRecGen(topVertex, right_chain->getVertex(right_current),
- left_chain, left_current, i-1,
- right_chain, right_current, right_current,
- pStream);
- monoTriangulationRecOpt(left_chain->getVertex(i-1),
- botVertex,
- left_chain, i,
- right_chain, right_current,
- pStream);
- }
-}
-
-
-void monoTriangulationRecGenTBOpt(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_current, Int inc_end,
- vertexArray* dec_chain, Int dec_current, Int dec_end,
- primStream* pStream)
-{
- pStream->triangle(topVertex, inc_chain->getVertex(inc_current), dec_chain->getVertex(dec_current));
-
-/*printf("**(%f,%f)\n", inc_chain->getArray()[0][0],inc_chain->getArray()[0][1]);*/
- triangulateXYMonoTB(inc_end-inc_current+1, inc_chain->getArray()+inc_current, dec_end-dec_current+1, dec_chain->getArray()+dec_current, pStream);
-
- pStream->triangle(botVertex, dec_chain->getVertex(dec_end), inc_chain->getVertex(inc_end));
-}
-
-
-/*n_left>=1
- *n_right>=1
- *the strip is going top to bottom. compared to the funtion
- * triangulateXYmono()
- */
-void triangulateXYMonoTB(Int n_left, Real** leftVerts,
- Int n_right, Real** rightVerts,
- primStream* pStream)
-{
-
-
- Int i,j,k,l;
- Real* topMostV;
-
- assert(n_left>=1 && n_right>=1);
- if(leftVerts[0][1] >= rightVerts[0][1])
- {
- i=1;
- j=0;
- topMostV = leftVerts[0];
- }
- else
- {
- i=0;
- j=1;
- topMostV = rightVerts[0];
- }
-
- while(1)
- {
- if(i >= n_left) /*case1: no more in left*/
- {
-
- if(j<n_right-1) /*at least two vertices in right*/
- {
- pStream->begin();
- pStream->insert(topMostV);
- for(k=n_right-1; k>=j; k--)
- pStream->insert(rightVerts[j]);
-
- pStream->end(PRIMITIVE_STREAM_FAN);
-
- }
-
- break;
- }
- else if(j>= n_right) /*case2: no more in right*/
- {
-
- if(i<n_left-1) /*at least two vertices in left*/
- {
- pStream->begin();
- pStream->insert(topMostV);
-
- for(k=i; k<n_left; k++)
- pStream->insert(leftVerts[k]);
-
- pStream->end(PRIMITIVE_STREAM_FAN);
- }
-
- break;
- }
- else /* case3: neither is empty, plus the topMostV, there is at least one triangle to output*/
- {
-
- if(leftVerts[i][1] >= rightVerts[j][1])
- {
- pStream->begin();
- pStream->insert(rightVerts[j]); /*the origin of this fan*/
-
- pStream->insert(topMostV);
-
- /*find the last k>=i such that
- *leftverts[k][1] >= rightverts[j][1]
- */
- k=i;
- while(k<n_left)
- {
- if(leftVerts[k][1] < rightVerts[j][1])
- break;
- k++;
- }
- k--;
- for(l=i; l<=k; l++)
- {
- pStream->insert(leftVerts[l]);
- }
-
- pStream->end(PRIMITIVE_STREAM_FAN);
- //update i for next loop
- i = k+1;
- topMostV = leftVerts[k];
-
- }
- else /*leftVerts[i][1] < rightVerts[j][1]*/
- {
- pStream->begin();
- pStream->insert(leftVerts[i]);/*the origion of this fan*/
-
- /*find the last k>=j such that
- *rightverts[k][1] > leftverts[i][1]*/
- k=j;
- while(k< n_right)
- {
- if(rightVerts[k][1] <= leftVerts[i][1])
- break;
- k++;
- }
- k--;
-
- for(l=k; l>= j; l--)
- pStream->insert(rightVerts[l]);
-
- pStream->insert(topMostV);
- pStream->end(PRIMITIVE_STREAM_FAN);
- j=k+1;
- topMostV = rightVerts[j-1];
- }
- }
- }
-}
-
-static int chainConvex(vertexArray* inc_chain, Int inc_current, Int inc_end)
-{
- Int i;
- //if there are no more than 2 vertices, return 1
- if(inc_current >= inc_end-1) return 1;
- for(i=inc_current; i<= inc_end-2; i++)
- {
- if(area(inc_chain->getVertex(i), inc_chain->getVertex(i+1), inc_chain->getVertex(i+2)) <0)
- return 0;
- }
- return 1;
-}
-
-static int chainConcave(vertexArray* dec_chain, Int dec_current, Int dec_end)
-{
- Int i;
- //if there are no more than 2 vertices, return 1
- if(dec_current >= dec_end -1) return 1;
- for(i=dec_current; i<=dec_end-2; i++)
- {
- if(area(dec_chain->getVertex(i), dec_chain->getVertex(i+1), dec_chain->getVertex(i+2)) >0)
- return 0;
- }
- return 1;
-}
-
-void monoTriangulationRecGenInU(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_current, Int inc_end,
- vertexArray* dec_chain, Int dec_current, Int dec_end,
- primStream* pStream)
-{
-
-}
-
-void monoTriangulationRecGenOpt(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_current, Int inc_end,
- vertexArray* dec_chain, Int dec_current, Int dec_end,
- primStream* pStream)
-{
- Int i;
- //copy this to a polygon: directedLine Lioop
- sampledLine* sline;
- directedLine* dline;
- directedLine* poly;
-
- if(inc_current <= inc_end) //at least one vertex in inc_chain
- {
- sline = new sampledLine(topVertex, inc_chain->getVertex(inc_current));
- poly = new directedLine(INCREASING, sline);
- for(i=inc_current; i<=inc_end-1; i++)
- {
- sline = new sampledLine(inc_chain->getVertex(i), inc_chain->getVertex(i+1));
- dline = new directedLine(INCREASING, sline);
- poly->insert(dline);
- }
- sline = new sampledLine(inc_chain->getVertex(inc_end), botVertex);
- dline = new directedLine(INCREASING, sline);
- poly->insert(dline);
- }
- else //inc_chian is empty
- {
- sline = new sampledLine(topVertex, botVertex);
- dline = new directedLine(INCREASING, sline);
- poly = dline;
- }
-
- assert(poly != NULL);
-
- if(dec_current <= dec_end) //at least on vertex in dec_Chain
- {
- sline = new sampledLine(botVertex, dec_chain->getVertex(dec_end));
- dline = new directedLine(INCREASING, sline);
- poly->insert(dline);
- for(i=dec_end; i>dec_current; i--)
- {
- sline = new sampledLine(dec_chain->getVertex(i), dec_chain->getVertex(i-1));
- dline = new directedLine(INCREASING, sline);
- poly->insert(dline);
- }
- sline = new sampledLine(dec_chain->getVertex(dec_current), topVertex);
- dline = new directedLine(INCREASING, sline);
- poly->insert(dline);
- }
- else //dec_chain is empty
- {
- sline = new sampledLine(botVertex, topVertex);
- dline = new directedLine(INCREASING, sline);
- poly->insert(dline);
- }
-
- {
- Int n_cusps;
- Int n_edges = poly->numEdges();
- directedLine** cusps = (directedLine**) malloc(sizeof(directedLine*)*n_edges);
- assert(cusps);
- findInteriorCuspsX(poly, n_cusps, cusps);
-
- if(n_cusps ==0) //u monotine
- {
- monoTriangulationFun(poly, compV2InX, pStream);
- }
- else if(n_cusps == 1) // one interior cusp
- {
- directedLine* new_polygon = polygonConvert(cusps[0]);
- directedLine* other = findDiagonal_singleCuspX(new_polygon);
- //<other> should NOT be null unless there are self-intersecting
- //trim curves. In that case, we don't want to core dump, instead,
- //we triangulate anyway, and print out error message.
- if(other == NULL)
- {
- monoTriangulationFun(poly, compV2InX, pStream);
- }
- else
- {
- directedLine* ret_p1;
- directedLine* ret_p2;
-
- new_polygon->connectDiagonal_2slines(new_polygon, other,
- &ret_p1,
- &ret_p2,
- new_polygon);
-
- monoTriangulationFun(ret_p1, compV2InX, pStream);
- monoTriangulationFun(ret_p2, compV2InX, pStream);
-
- ret_p1->deleteSinglePolygonWithSline();
- ret_p2->deleteSinglePolygonWithSline();
- }
- }
- else
- {
- //we need a general partitionX funtion (supposed to be in partitionX.C,
- //not implemented yet. XXX
- //monoTriangulationFun(poly, compV2InY, pStream);
-
- directedLine* new_polygon = polygonConvert(poly);
- directedLine* list = monoPolyPart(new_polygon);
- for(directedLine* temp = list; temp != NULL; temp = temp->getNextPolygon())
- {
- monoTriangulationFun(temp, compV2InX, pStream);
- }
- //clean up
- list->deletePolygonListWithSline();
-
- }
-
- free(cusps);
- /*
- if(numInteriorCuspsX(poly) == 0) //is u monotone
- monoTriangulationFun(poly, compV2InX, pStream);
- else //it is not u motone
- monoTriangulationFun(poly, compV2InY, pStream);
- */
- //clean up space
- poly->deleteSinglePolygonWithSline();
- return;
- }
-
- //apparently the following code is not reachable,
- //it is for test purpose
- if(inc_current > inc_end || dec_current>dec_end)
- {
- monoTriangulationRecGen(topVertex, botVertex, inc_chain, inc_current, inc_end,
- dec_chain, dec_current, dec_end,
- pStream);
- return;
- }
-
-
- if(
- area(dec_chain->getVertex(dec_current),
- topVertex,
- inc_chain->getVertex(inc_current)) >=0
- && chainConvex(inc_chain, inc_current, inc_end)
- && chainConcave(dec_chain, dec_current, dec_end)
- && area(inc_chain->getVertex(inc_end), botVertex, dec_chain->getVertex(dec_end)) >=0
- )
- {
- monoTriangulationRecFunGen(topVertex, botVertex,
- inc_chain, inc_current, inc_end,
- dec_chain, dec_current, dec_end,
- compV2InX, pStream);
- }
- else
- {
- monoTriangulationRecGen(topVertex, botVertex, inc_chain, inc_current, inc_end,
- dec_chain, dec_current, dec_end,
- pStream);
- }
-}
-
-/*if inc_current>inc_end, then inc_chain has no points to be considered
- *same for dec_chain
- */
-void monoTriangulationRecGen(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_current, Int inc_end,
- vertexArray* dec_chain, Int dec_current, Int dec_end,
- primStream* pStream)
-{
- Real** inc_array ;
- Real** dec_array ;
- Int i;
-
- if(inc_current > inc_end && dec_current>dec_end)
- return;
- else if(inc_current>inc_end) /*no more vertices on inc_chain*/
- {
- dec_array = dec_chain->getArray();
- reflexChain rChain(100,0);
- /*put the top vertex into the reflex chain*/
- rChain.processNewVertex(topVertex, pStream);
- /*process all the vertices on the dec_chain*/
- for(i=dec_current; i<=dec_end; i++){
- rChain.processNewVertex(dec_array[i], pStream);
- }
- /*process the bottom vertex*/
- rChain.processNewVertex(botVertex, pStream);
- }
- else if(dec_current> dec_end) /*no more vertices on dec_chain*/
- {
- inc_array = inc_chain->getArray();
-
- reflexChain rChain(100,1);
- /*put the top vertex into the reflex chain*/
- rChain.processNewVertex(topVertex, pStream);
- /*process all the vertices on the inc_chain*/
- for(i=inc_current; i<=inc_end; i++){
- rChain.processNewVertex(inc_array[i], pStream);
- }
- /*process the bottom vertex*/
- rChain.processNewVertex(botVertex, pStream);
- }
- else /*neither chain is empty*/
- {
- inc_array = inc_chain -> getArray();
- dec_array = dec_chain -> getArray();
-
- /*if top of inc_chain is 'lower' than top of dec_chain, process all the
- *vertices on the dec_chain which are higher than top of inc_chain
- */
- if(compV2InY(inc_array[inc_current], dec_array[dec_current]) <= 0)
- {
-
- reflexChain rChain(100, 0);
- rChain.processNewVertex(topVertex, pStream);
- for(i=dec_current; i<=dec_end; i++)
- {
- if(compV2InY(inc_array[inc_current], dec_array[i]) <= 0)
- rChain.processNewVertex(dec_array[i], pStream);
- else
- break;
- }
- rChain.outputFan(inc_array[inc_current], pStream);
- monoTriangulationRecGen(dec_array[i-1], botVertex,
- inc_chain, inc_current, inc_end,
- dec_chain, i, dec_end,
- pStream);
- }
- else /*compV2InY(inc_array[inc_current], dec_array[dec_current]) > 0*/
- {
-
- reflexChain rChain(100, 1);
- rChain.processNewVertex(topVertex, pStream);
- for(i=inc_current; i<=inc_end; i++)
- {
- if(compV2InY(inc_array[i], dec_array[dec_current]) >0)
- rChain.processNewVertex(inc_array[i], pStream);
- else
- break;
- }
- rChain.outputFan(dec_array[dec_current], pStream);
- monoTriangulationRecGen(inc_array[i-1], botVertex,
- inc_chain, i, inc_end,
- dec_chain, dec_current,dec_end,
- pStream);
- }
- }/*end case neither is empty*/
-}
-
-void monoTriangulationFun(directedLine* monoPolygon, Int (*compFun)(Real*, Real*), primStream* pStream)
-{
- Int i;
- /*find the top vertex, bottom vertex, inccreasing chain, and decreasing chain,
- *then call monoTriangulationRec
- */
- directedLine* tempV;
- directedLine* topV;
- directedLine* botV;
- topV = botV = monoPolygon;
- for(tempV = monoPolygon->getNext(); tempV != monoPolygon; tempV = tempV->getNext())
- {
- if(compFun(topV->head(), tempV->head())<0) {
- topV = tempV;
- }
- if(compFun(botV->head(), tempV->head())>0) {
- botV = tempV;
- }
- }
-
- /*creat increase and decrease chains*/
- vertexArray inc_chain(20); /*this is a dynamic array*/
- for(i=1; i<=topV->get_npoints()-2; i++) { /*the first vertex is the top vertex which doesn't belong to inc_chain*/
- inc_chain.appendVertex(topV->getVertex(i));
- }
- for(tempV = topV->getNext(); tempV != botV; tempV = tempV->getNext())
- {
- for(i=0; i<=tempV->get_npoints()-2; i++){
- inc_chain.appendVertex(tempV->getVertex(i));
- }
- }
-
- vertexArray dec_chain(20);
- for(tempV = topV->getPrev(); tempV != botV; tempV = tempV->getPrev())
- {
- for(i=tempV->get_npoints()-2; i>=0; i--){
- dec_chain.appendVertex(tempV->getVertex(i));
- }
- }
- for(i=botV->get_npoints()-2; i>=1; i--){
- dec_chain.appendVertex(tempV->getVertex(i));
- }
-
- monoTriangulationRecFun(topV->head(), botV->head(), &inc_chain, 0, &dec_chain, 0, compFun, pStream);
-
-}
-
-void monoTriangulation(directedLine* monoPolygon, primStream* pStream)
-{
- Int i;
- /*find the top vertex, bottom vertex, inccreasing chain, and decreasing chain,
- *then call monoTriangulationRec
- */
- directedLine* tempV;
- directedLine* topV;
- directedLine* botV;
- topV = botV = monoPolygon;
- for(tempV = monoPolygon->getNext(); tempV != monoPolygon; tempV = tempV->getNext())
- {
- if(compV2InY(topV->head(), tempV->head())<0) {
- topV = tempV;
- }
- if(compV2InY(botV->head(), tempV->head())>0) {
- botV = tempV;
- }
- }
- /*creat increase and decrease chains*/
- vertexArray inc_chain(20); /*this is a dynamic array*/
- for(i=1; i<=topV->get_npoints()-2; i++) { /*the first vertex is the top vertex which doesn't belong to inc_chain*/
- inc_chain.appendVertex(topV->getVertex(i));
- }
- for(tempV = topV->getNext(); tempV != botV; tempV = tempV->getNext())
- {
- for(i=0; i<=tempV->get_npoints()-2; i++){
- inc_chain.appendVertex(tempV->getVertex(i));
- }
- }
-
- vertexArray dec_chain(20);
- for(tempV = topV->getPrev(); tempV != botV; tempV = tempV->getPrev())
- {
- for(i=tempV->get_npoints()-2; i>=0; i--){
- dec_chain.appendVertex(tempV->getVertex(i));
- }
- }
- for(i=botV->get_npoints()-2; i>=1; i--){
- dec_chain.appendVertex(tempV->getVertex(i));
- }
-
- monoTriangulationRec(topV->head(), botV->head(), &inc_chain, 0, &dec_chain, 0, pStream);
-
-}
-
-/*the chain could be increasing or decreasing, although we use the
- * name inc_chain.
- *the argument is_increase_chain indicates whether this chain
- *is increasing (left chain in V-monotone case) or decreaing (right chain
- *in V-monotone case).
- */
-void monoTriangulation2(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_smallIndex,
- Int inc_largeIndex,
- Int is_increase_chain,
- primStream* pStream)
-{
- assert( inc_chain != NULL);
- Real** inc_array ;
-
- if(inc_smallIndex > inc_largeIndex)
- return; //no triangles
- if(inc_smallIndex == inc_largeIndex)
- {
- if(is_increase_chain)
- pStream->triangle(inc_chain->getVertex(inc_smallIndex), botVertex, topVertex);
- else
- pStream->triangle(inc_chain->getVertex(inc_smallIndex), topVertex, botVertex);
- return;
- }
- Int i;
-
- if(is_increase_chain && botVertex[1] == inc_chain->getVertex(inc_largeIndex)[1])
- {
- pStream->triangle(botVertex, inc_chain->getVertex(inc_largeIndex-1),
- inc_chain->getVertex(inc_largeIndex));
- monoTriangulation2(topVertex, botVertex, inc_chain, inc_smallIndex,
- inc_largeIndex-1,
- is_increase_chain,
- pStream);
- return;
- }
- else if( (!is_increase_chain) && topVertex[1] == inc_chain->getVertex(inc_smallIndex)[1])
- {
- pStream->triangle(topVertex, inc_chain->getVertex(inc_smallIndex+1),
- inc_chain->getVertex(inc_smallIndex));
- monoTriangulation2(topVertex, botVertex, inc_chain, inc_smallIndex+1,
- inc_largeIndex, is_increase_chain, pStream);
- return ;
- }
-
- inc_array = inc_chain->getArray();
-
- reflexChain rChain(20,is_increase_chain); /*1 means the chain is increasing*/
-
- rChain.processNewVertex(topVertex, pStream);
-
- for(i=inc_smallIndex; i<=inc_largeIndex; i++){
- rChain.processNewVertex(inc_array[i], pStream);
- }
- rChain.processNewVertex(botVertex, pStream);
-
-}
-
-/*if compFun == compV2InY, top to bottom: V-monotone
- *if compFun == compV2InX, right to left: U-monotone
- */
-void monoTriangulationRecFunGen(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_current, Int inc_end,
- vertexArray* dec_chain, Int dec_current, Int dec_end,
- Int (*compFun)(Real*, Real*),
- primStream* pStream)
-{
- assert( inc_chain != NULL && dec_chain != NULL);
- assert( ! (inc_current> inc_end &&
- dec_current> dec_end));
- Int inc_nVertices;
- Int dec_nVertices;
- Real** inc_array ;
- Real** dec_array ;
- Int i;
- assert( ! ( (inc_chain==NULL) && (dec_chain==NULL)));
-
- if(inc_current> inc_end) /*no more vertices on inc_chain*/
- {
-
- dec_array = dec_chain->getArray();
- reflexChain rChain(20,0);
- /*put the top vertex into the reflex chain*/
- rChain.processNewVertex(topVertex, pStream);
- /*process all the vertices on the dec_chain*/
- for(i=dec_current; i<=dec_end; i++){
- rChain.processNewVertex(dec_array[i], pStream);
- }
- /*process the bottom vertex*/
- rChain.processNewVertex(botVertex, pStream);
-
- }
- else if(dec_current> dec_end) /*no more vertices on dec_chain*/
- {
- inc_array = inc_chain->getArray();
- reflexChain rChain(20,1);
- /*put the top vertex into the reflex chain*/
- rChain.processNewVertex(topVertex, pStream);
- /*process all the vertices on the inc_chain*/
- for(i=inc_current; i<=inc_end; i++){
- rChain.processNewVertex(inc_array[i], pStream);
- }
- /*process the bottom vertex*/
- rChain.processNewVertex(botVertex, pStream);
- }
- else /*neither chain is empty*/
- {
- inc_array = inc_chain -> getArray();
- dec_array = dec_chain -> getArray();
-
- /*if top of inc_chain is 'lower' than top of dec_chain, process all the
- *vertices on the dec_chain which are higher than top of inc_chain
- */
- if(compFun(inc_array[inc_current], dec_array[dec_current]) <= 0)
- {
-
- reflexChain rChain(20, 0);
- rChain.processNewVertex(topVertex, pStream);
- for(i=dec_current; i<=dec_end; i++)
- {
- if(compFun(inc_array[inc_current], dec_array[i]) <= 0)
- rChain.processNewVertex(dec_array[i], pStream);
- else
- break;
- }
- rChain.outputFan(inc_array[inc_current], pStream);
- monoTriangulationRecFunGen(dec_array[i-1], botVertex,
- inc_chain, inc_current, inc_end,
- dec_chain, i, dec_end,
- compFun,
- pStream);
- }
- else /*compFun(inc_array[inc_current], dec_array[dec_current]) > 0*/
- {
-
- reflexChain rChain(20, 1);
- rChain.processNewVertex(topVertex, pStream);
- for(i=inc_current; i<=inc_end; i++)
- {
- if(compFun(inc_array[i], dec_array[dec_current]) >0)
- rChain.processNewVertex(inc_array[i], pStream);
- else
- break;
- }
- rChain.outputFan(dec_array[dec_current], pStream);
- monoTriangulationRecFunGen(inc_array[i-1], botVertex,
- inc_chain, i,inc_end,
- dec_chain, dec_current,dec_end,
- compFun,
- pStream);
- }
- }/*end case neither is empty*/
-}
-
-/*if compFun == compV2InY, top to bottom: V-monotone
- *if compFun == compV2InX, right to left: U-monotone
- */
-void monoTriangulationRecFun(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_current,
- vertexArray* dec_chain, Int dec_current,
- Int (*compFun)(Real*, Real*),
- primStream* pStream)
-{
- assert( inc_chain != NULL && dec_chain != NULL);
- assert( ! (inc_current>=inc_chain->getNumElements() &&
- dec_current>=dec_chain->getNumElements()));
- Int inc_nVertices;
- Int dec_nVertices;
- Real** inc_array ;
- Real** dec_array ;
- Int i;
- assert( ! ( (inc_chain==NULL) && (dec_chain==NULL)));
-
- if(inc_current>=inc_chain->getNumElements()) /*no more vertices on inc_chain*/
- {
-
- dec_array = dec_chain->getArray();
- dec_nVertices = dec_chain->getNumElements();
- reflexChain rChain(20,0);
- /*put the top vertex into the reflex chain*/
- rChain.processNewVertex(topVertex, pStream);
- /*process all the vertices on the dec_chain*/
- for(i=dec_current; i<dec_nVertices; i++){
- rChain.processNewVertex(dec_array[i], pStream);
- }
- /*process the bottom vertex*/
- rChain.processNewVertex(botVertex, pStream);
-
- }
- else if(dec_current>= dec_chain->getNumElements()) /*no more vertices on dec_chain*/
- {
- inc_array = inc_chain->getArray();
- inc_nVertices= inc_chain->getNumElements();
- reflexChain rChain(20,1);
- /*put the top vertex into the reflex chain*/
- rChain.processNewVertex(topVertex, pStream);
- /*process all the vertices on the inc_chain*/
- for(i=inc_current; i<inc_nVertices; i++){
- rChain.processNewVertex(inc_array[i], pStream);
- }
- /*process the bottom vertex*/
- rChain.processNewVertex(botVertex, pStream);
- }
- else /*neither chain is empty*/
- {
- inc_array = inc_chain -> getArray();
- dec_array = dec_chain -> getArray();
- inc_nVertices= inc_chain->getNumElements();
- dec_nVertices= dec_chain->getNumElements();
- /*if top of inc_chain is 'lower' than top of dec_chain, process all the
- *vertices on the dec_chain which are higher than top of inc_chain
- */
- if(compFun(inc_array[inc_current], dec_array[dec_current]) <= 0)
- {
-
- reflexChain rChain(20, 0);
- rChain.processNewVertex(topVertex, pStream);
- for(i=dec_current; i<dec_nVertices; i++)
- {
- if(compFun(inc_array[inc_current], dec_array[i]) <= 0)
- rChain.processNewVertex(dec_array[i], pStream);
- else
- break;
- }
- rChain.outputFan(inc_array[inc_current], pStream);
- monoTriangulationRecFun(dec_array[i-1], botVertex,
- inc_chain, inc_current,
- dec_chain, i,
- compFun,
- pStream);
- }
- else /*compFun(inc_array[inc_current], dec_array[dec_current]) > 0*/
- {
-
- reflexChain rChain(20, 1);
- rChain.processNewVertex(topVertex, pStream);
- for(i=inc_current; i<inc_nVertices; i++)
- {
- if(compFun(inc_array[i], dec_array[dec_current]) >0)
- rChain.processNewVertex(inc_array[i], pStream);
- else
- break;
- }
- rChain.outputFan(dec_array[dec_current], pStream);
- monoTriangulationRecFun(inc_array[i-1], botVertex,
- inc_chain, i,
- dec_chain, dec_current,
- compFun,
- pStream);
- }
- }/*end case neither is empty*/
-}
-
-
-void monoTriangulationRec(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_current,
- vertexArray* dec_chain, Int dec_current,
- primStream* pStream)
-{
- assert( inc_chain != NULL && dec_chain != NULL);
- assert( ! (inc_current>=inc_chain->getNumElements() &&
- dec_current>=dec_chain->getNumElements()));
- Int inc_nVertices;
- Int dec_nVertices;
- Real** inc_array ;
- Real** dec_array ;
- Int i;
- assert( ! ( (inc_chain==NULL) && (dec_chain==NULL)));
-
- if(inc_current>=inc_chain->getNumElements()) /*no more vertices on inc_chain*/
- {
-
- dec_array = dec_chain->getArray();
- dec_nVertices = dec_chain->getNumElements();
- reflexChain rChain(20,0);
- /*put the top vertex into the reflex chain*/
- rChain.processNewVertex(topVertex, pStream);
- /*process all the vertices on the dec_chain*/
- for(i=dec_current; i<dec_nVertices; i++){
- rChain.processNewVertex(dec_array[i], pStream);
- }
- /*process the bottom vertex*/
- rChain.processNewVertex(botVertex, pStream);
-
- }
- else if(dec_current>= dec_chain->getNumElements()) /*no more vertices on dec_chain*/
- {
- inc_array = inc_chain->getArray();
- inc_nVertices= inc_chain->getNumElements();
- reflexChain rChain(20,1);
- /*put the top vertex into the reflex chain*/
- rChain.processNewVertex(topVertex, pStream);
- /*process all the vertices on the inc_chain*/
- for(i=inc_current; i<inc_nVertices; i++){
- rChain.processNewVertex(inc_array[i], pStream);
- }
- /*process the bottom vertex*/
- rChain.processNewVertex(botVertex, pStream);
- }
- else /*neither chain is empty*/
- {
- inc_array = inc_chain -> getArray();
- dec_array = dec_chain -> getArray();
- inc_nVertices= inc_chain->getNumElements();
- dec_nVertices= dec_chain->getNumElements();
- /*if top of inc_chain is 'lower' than top of dec_chain, process all the
- *vertices on the dec_chain which are higher than top of inc_chain
- */
- if(compV2InY(inc_array[inc_current], dec_array[dec_current]) <= 0)
- {
-
- reflexChain rChain(20, 0);
- rChain.processNewVertex(topVertex, pStream);
- for(i=dec_current; i<dec_nVertices; i++)
- {
- if(compV2InY(inc_array[inc_current], dec_array[i]) <= 0)
- rChain.processNewVertex(dec_array[i], pStream);
- else
- break;
- }
- rChain.outputFan(inc_array[inc_current], pStream);
- monoTriangulationRec(dec_array[i-1], botVertex,
- inc_chain, inc_current,
- dec_chain, i,
- pStream);
- }
- else /*compV2InY(inc_array[inc_current], dec_array[dec_current]) > 0*/
- {
-
- reflexChain rChain(20, 1);
- rChain.processNewVertex(topVertex, pStream);
- for(i=inc_current; i<inc_nVertices; i++)
- {
- if(compV2InY(inc_array[i], dec_array[dec_current]) >0)
- rChain.processNewVertex(inc_array[i], pStream);
- else
- break;
- }
- rChain.outputFan(dec_array[dec_current], pStream);
- monoTriangulationRec(inc_array[i-1], botVertex,
- inc_chain, i,
- dec_chain, dec_current,
- pStream);
- }
- }/*end case neither is empty*/
-}
-
-
-
-/* the name here assumes that the polygon is Y-monotone, but
- *this function also works for X-monotone polygons.
- * a monotne polygon consists of two extrem verteices: topVertex and botVertex, and
- *two monotone chains: inc_chain, and dec_chain. The edges of the increasing chain (inc_chain)
- *is ordered by following pointer: next, while the edges of the decreasing chain (dec_chain)
- *is ordered by following pointer: prev
- * inc_index index the vertex which is the toppest of the inc_chain which we are handling currently.
- * dec_index index the vertex which is the toppest of the dec_chain which we are handling currently.
- */
-void monoTriangulationRec(directedLine* inc_chain, Int inc_index,
- directedLine* dec_chain, Int dec_index,
- directedLine* topVertex, Int top_index,
- directedLine* botVertex,
- primStream* pStream)
-{
- Int i;
- directedLine *temp, *oldtemp;
- Int tempIndex, oldtempIndex;
-
- assert(inc_chain != NULL && dec_chain != NULL);
-
- if(inc_chain == botVertex) {
- reflexChain rChain(20, 0);
- rChain.processNewVertex(topVertex->getVertex(top_index), pStream);
- for(i=dec_index; i< dec_chain->get_npoints(); i++){
- rChain.processNewVertex(dec_chain->getVertex(i), pStream);
- }
- for(temp = dec_chain->getPrev(); temp != botVertex; temp = temp->getPrev())
- {
- for(i=0; i<temp->get_npoints(); i++){
- rChain.processNewVertex(temp->getVertex(i), pStream);
- }
- }
- }
- else if(dec_chain==botVertex) {
- reflexChain rChain(20, 1);
- rChain.processNewVertex(topVertex->getVertex(top_index), pStream);
- for(i=inc_index; i< inc_chain->get_npoints(); i++){
- rChain.processNewVertex(inc_chain->getVertex(i), pStream);
- }
- for(temp = inc_chain->getPrev(); temp != botVertex; temp = temp->getNext())
- {
- for(i=0; i<temp->get_npoints(); i++){
- rChain.processNewVertex(temp->getVertex(i), pStream);
- }
- }
- }
- else /*neither reached the bottom*/{
- if(compV2InY(inc_chain->getVertex(inc_index), dec_chain->getVertex(dec_index)) <=0) {
- reflexChain rChain(20, 0);
- rChain.processNewVertex(topVertex -> getVertex(top_index), pStream);
- temp = dec_chain;
- tempIndex = dec_index;
- while( compV2InY(inc_chain->getVertex(inc_index), temp->getVertex(tempIndex))<=0) {
- oldtemp = temp;
- oldtempIndex = tempIndex;
- rChain.processNewVertex(temp->getVertex(tempIndex), pStream);
-
- if(tempIndex == temp->get_npoints()-1){
- tempIndex = 0;
- temp = temp->getPrev();
- }
- else{
- tempIndex++;
- }
- }
- rChain.outputFan(inc_chain->getVertex(inc_index), pStream);
- monoTriangulationRec(inc_chain, inc_index, temp, tempIndex, oldtemp, oldtempIndex, botVertex, pStream);
- }
- else /* >0*/ {
- reflexChain rChain(20, 1);
- rChain.processNewVertex(topVertex -> getVertex(top_index), pStream);
- temp = inc_chain;
- tempIndex = inc_index;
- while( compV2InY(temp->getVertex(tempIndex), dec_chain->getVertex(dec_index))>0){
- oldtemp = temp;
- oldtempIndex = tempIndex;
- rChain.processNewVertex(temp->getVertex(tempIndex), pStream);
-
- if(tempIndex == temp->get_npoints()-1){
- tempIndex = 0;
- temp = temp->getNext();
- }
- else{
- tempIndex++;
- }
- }
- rChain.outputFan(dec_chain->getVertex(dec_index), pStream);
- monoTriangulationRec(temp, tempIndex, dec_chain, dec_index, oldtemp, oldtempIndex, botVertex, pStream);
- }
- } /*end case neither reached the bottom*/
-}
-
-/***************************vertexArray begin here**********************************/
-vertexArray::vertexArray(Real2* vertices, Int nVertices)
-{
- Int i;
- size = index = nVertices;
- array = (Real**) malloc(sizeof(Real*) * nVertices);
- assert(array);
- for(i=0; i<nVertices; i++)
- {
- array[i] = vertices[i];
- array[i] = vertices[i];
- }
-}
-
-vertexArray::vertexArray(Int s)
-{
- size = s;
- array = (Real**) malloc(sizeof(Real*) * s);
- assert(array);
- index = 0;
-}
-
-vertexArray::~vertexArray()
-{
- free(array);
-}
-
-void vertexArray::appendVertex(Real* ptr)
-{
- Int i;
- if(index >= size){
- Real** temp = (Real**) malloc(sizeof(Real*) * (2*size +1));
- assert(temp);
- for(i=0; i<index; i++)
- temp[i] = array[i];
- free(array);
- array = temp;
- size = 2*size+1;
- }
- array[index++] = ptr;
-}
-
-void vertexArray::print()
-{
- printf("vertex Array:index=%i, size=%i\n", index, size);
- for(Int i=0; i<index; i++)
- {
- printf("(%f,%f) ", array[i][0], array[i][1]);
- }
- printf("\n");
-}
-
-/*find the first i such that array[i][1] >= v
- * and array[i+1][1] <v
- * if index == 0 (the array is empty, return -1.
- * if v is above all, return -1.
- * if v is below all, return index-1.
- */
-Int vertexArray::findIndexAbove(Real v)
-{
- Int i;
- if(index == 0)
- return -1;
- else if(array[0][1] < v)
- return -1;
- else
- {
- for(i=1; i<index; i++)
- {
- if(array[i][1] < v)
- break;
- }
- return i-1;
- }
-}
-
-/*find the first i<=endIndex such that array[i][1] <= v
- * and array[i-1][1] > v
- *if sartIndex>endIndex, then return endIndex+1.
- *otherwise, startIndex<=endIndex, it is assumed that
- * 0<=startIndex<=endIndex<index.
- * if v is below all, return endIndex+1
- * if v is above all, return startIndex.
- */
-Int vertexArray::findIndexBelowGen(Real v, Int startIndex, Int endIndex)
-{
- Int i;
- if(startIndex > endIndex)
- return endIndex+1;
- else if(array[endIndex][1] > v)
- return endIndex+1;
- else //now array[endIndex][1] <= v
- {
- for(i=endIndex-1; i>=startIndex; i--)
- {
- if(array[i][1] > v)
- break;
- }
- return i+1;
- }
-}
-
-/*find the first i<=endIndex such that array[i-1][1] >= v
- * and array[i][1] < v
- *if sartIndex>endIndex, then return endIndex+1.
- *otherwise, startIndex<=endIndex, it is assumed that
- * 0<=startIndex<=endIndex<index.
- * if v is below or equal to all, return endIndex+1
- * if v is strictly above all, return startIndex.
- */
-Int vertexArray::findIndexStrictBelowGen(Real v, Int startIndex, Int endIndex)
-{
- Int i;
- if(startIndex > endIndex)
- return endIndex+1;
- else if(array[endIndex][1] >= v)
- return endIndex+1;
- else //now array[endIndex][1] < v
- {
- for(i=endIndex-1; i>=startIndex; i--)
- {
- if(array[i][1] >= v)
- break;
- }
- return i+1;
- }
-}
-
-/*find the first i>startIndex such that array[i-1][1] > v
- * and array[i][1] >=v
- *if sartIndex>endIndex, then return startIndex-1.
- *otherwise, startIndex<=endIndex, it is assumed that
- * 0<=startIndex<=endIndex<index.
- * if v is strictly above all, return startIndex-1
- * if v is strictly below all, return endIndex.
- */
-Int vertexArray::findIndexFirstAboveEqualGen(Real v, Int startIndex, Int endIndex)
-{
-
- Int i;
- if(startIndex > endIndex)
- return startIndex-1;
- else if(array[startIndex][1] < v)
- return startIndex-1;
- else //now array[startIndex][1] >= v
- {
-
- for(i=startIndex; i<=endIndex; i++)
- {
- if(array[i][1] <= v)
- break;
- }
- if(i>endIndex) // v is strictly below all
- return endIndex;
- else if(array[i][1] == v)
- return i;
- else
- return i-1;
- }
-
-}
-
-
-/*find the first i>=startIndex such that array[i][1] >= v
- * and array[i+1][1] <v
- *if sartIndex>endIndex, then return startIndex-1.
- *otherwise, startIndex<=endIndex, it is assumed that
- * 0<=startIndex<=endIndex<index.
- * if v is above all, return startIndex-1
- * if v is below all, return endIndex.
- */
-Int vertexArray::findIndexAboveGen(Real v, Int startIndex, Int endIndex)
-{
- Int i;
- if(startIndex > endIndex)
- return startIndex-1;
- else if(array[startIndex][1] < v)
- return startIndex-1;
- else //now array[startIndex][1] >= v
- {
- for(i=startIndex+1; i<=endIndex; i++)
- {
- if(array[i][1] < v)
- break;
- }
- return i-1;
- }
-}
-
-Int vertexArray::findDecreaseChainFromEnd(Int begin, Int end)
-{
- Int i = end;
- Real prevU = array[i][0];
- Real thisU;
- for(i=end-1; i>=begin; i--){
- thisU = array[i][0];
- if(thisU < prevU)
- prevU = thisU;
- else
- break;
- }
- return i;
-}
-
-//if(V(start) == v, return start, other wise return the
-//last i so that V(i)==v
-Int vertexArray::skipEqualityFromStart(Real v, Int start, Int end)
-{
- Int i;
- if(array[start][1] != v)
- return start;
- //now array[start][1] == v
- for(i=start+1; i<= end; i++)
- if(array[i][1] != v)
- break;
- return i-1;
-}
-
-
-/***************************vertexArray end****************************************/
-
-
-
-/***************************relfex chain stuff begin here*****************************/
-
-reflexChain::reflexChain(Int size, Int is_increasing)
-{
- queue = (Real2*) malloc(sizeof(Real2) * size);
- assert(queue);
- index_queue = 0;
- size_queue = size;
- isIncreasing = is_increasing;
-}
-
-reflexChain::~reflexChain()
-{
- free(queue);
-}
-
-/*put (u,v) at the end of the queue
- *pay attention to space
- */
-void reflexChain::insert(Real u, Real v)
-{
- Int i;
- if(index_queue >= size_queue) {
- Real2 *temp = (Real2*) malloc(sizeof(Real2) * (2*size_queue+1));
- assert(temp);
-
- /*copy*/
- for(i=0; i<index_queue; i++){
- temp[i][0] = queue[i][0];
- temp[i][1] = queue[i][1];
- }
-
- free(queue);
- queue = temp;
- size_queue = 2*size_queue + 1;
- }
-
- queue[index_queue][0] = u;
- queue[index_queue][1] = v;
- index_queue ++;
-}
-
-void reflexChain::insert(Real v[2])
-{
- insert(v[0], v[1]);
-}
-
-/*
-static Real area(Real A[2], Real B[2], Real C[2])
-{
- Real Bx, By, Cx, Cy;
- Bx = B[0] - A[0];
- By = B[1] - A[1];
- Cx = C[0] - A[0];
- Cy = C[1] - A[1];
- return Bx*Cy - Cx*By;
-}
-*/
-
-/*the chain is reflex, and the vertex v is
- *on the other side of the chain, so that
- *we can outout the fan with v as the
- *the center
- */
-void reflexChain::outputFan(Real v[2], primStream* pStream)
-{
- Int i;
- pStream->begin();
- pStream->insert(v);
- if(isIncreasing) {
- for(i=0; i<index_queue; i++)
- pStream->insert(queue[i]);
- }
- else {
- for(i=index_queue-1; i>=0; i--)
- pStream->insert(queue[i]);
- }
- pStream->end(PRIMITIVE_STREAM_FAN);
-}
-
-void reflexChain::processNewVertex(Real v[2], primStream* pStream)
-{
- Int i,j,k;
- Int isReflex;
- /*if there are at most one vertex in the queue, then simply insert
- */
- if(index_queue <=1){
- insert(v);
- return;
- }
-
- /*there are at least two vertices in the queue*/
- j=index_queue-1;
-
- for(i=j; i>=1; i--) {
- if(isIncreasing) {
- isReflex = (area(queue[i-1], queue[i], v) <= 0.0);
- }
- else /*decreasing*/{
- isReflex = (area(v, queue[i], queue[i-1]) <= 0.0);
- }
- if(isReflex) {
- break;
- }
- }
-
- /*
- *if i<j then vertices: i+1--j are convex
- * output triangle fan:
- * v, and queue[i], i+1, ..., j
- */
- if(i<j)
- {
- pStream->begin();
- pStream->insert(v);
- if(isIncreasing) {
- for(k=i; k<=j; k++)
- pStream->insert(queue[k]);
- }
- else {
- for(k=j; k>=i; k--)
- pStream->insert(queue[k]);
- }
-
- pStream->end(PRIMITIVE_STREAM_FAN);
- }
-
- /*delete vertices i+1--j from the queue*/
- index_queue = i+1;
- /*finally insert v at the end of the queue*/
- insert(v);
-
-}
-
-void reflexChain::print()
-{
- Int i;
- printf("reflex chain: isIncreasing=%i\n", isIncreasing);
- for(i=0; i<index_queue; i++) {
- printf("(%f,%f) ", queue[i][0], queue[i][1]);
- }
- printf("\n");
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoTriangulation.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoTriangulation.h
deleted file mode 100755
index 3c3c397aa..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoTriangulation.h
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/monoTriangulation.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _MONO_TRIANGULATION_H
-#define _MONO_TRIANGULATION_H
-
-#include "definitions.h"
-#include "primitiveStream.h"
-#include "directedLine.h"
-
-class Backend;
-class Arc;
-typedef Arc *Arc_ptr;
-
-class reflexChain{
- Real2 *queue;
- /*the order of the polygon vertices: either q[0],q[1].., or
- * q[n-1], q[n-2], ..., q[0]
- *this order determines the interior of the polygon, so it
- *also used to determines whether a chain is reflex or convex
- */
- Int isIncreasing;
- Int index_queue;
- Int size_queue; /*allocated size*/
-
-public:
- reflexChain(Int size, Int isIncreasing);
- ~reflexChain();
-
- void insert(Real u, Real v);
- void insert(Real v[2]);
-
- void processNewVertex(Real v[2], primStream* pStream);
- void outputFan(Real v[2], primStream* pStream);
-
- void processNewVertex(Real v[2], Backend* backend);
- void outputFan(Real v[2], Backend* backend);
-
- void print();
-};
-
-/*dynamic array of pointers to reals.
- *Intended to store an array of (u,v).
- *Notice that it doesn't allocate or dealocate the space
- *for the (u,v) themselfs. So it assums that someone else
- *is taking care of them, while this class only plays with
- *the pointers.
- */
-class vertexArray{
- Real** array;
- Int index;
- Int size;
-public:
- vertexArray(Int s);
- vertexArray(Real vertices[][2], Int nVertices);
- ~vertexArray();
- void appendVertex(Real* ptr); /*the content (pointed by ptr is NOT copied*/
- Real* getVertex(Int i) {return array[i];}
- Real** getArray() {return array;}
- Int getNumElements() {return index;}
- Int findIndexAbove(Real v);
- Int findIndexAboveGen(Real v, Int startIndex, Int EndIndex);
- Int findIndexBelowGen(Real v, Int startIndex, Int EndIndex);
- Int findIndexStrictBelowGen(Real v, Int startIndex, Int EndIndex);
- Int findIndexFirstAboveEqualGen(Real v, Int startIndex, Int endIndex);
- Int skipEqualityFromStart(Real v, Int start, Int end);
- //return i such that fron [i+1, end] is strictly U-monotone (left to right
- Int findDecreaseChainFromEnd(Int begin, Int end);
- void print();
-};
-
-void monoTriangulation(directedLine* monoPolygon, primStream* pStream);
-
-void monoTriangulationRec(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_current,
- vertexArray* dec_chain, Int dec_current,
- primStream* pStream);
-
-void monoTriangulationRec(directedLine* inc_chain, Int inc_index,
- directedLine* dec_chain, Int dec_index,
- directedLine* topVertex, Int top_index,
- directedLine* botVertex,
- primStream* pStream);
-
-/*the chain could be increasing or decreasing, although we use the
- * name inc_chain.
- *the argument is_increase_chain indicates whether this chain
- *is increasing (left chain in V-monotone case) or decreaing (right chain
- *in V-monotone case).
- */
-void monoTriangulation2(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_smallIndex,
- Int inc_largeIndex,
- Int is_increase_chain,
- primStream* pStream);
-void monoTriangulationRecGen(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_current, Int inc_end,
- vertexArray* dec_chain, Int dec_current, Int dec_end,
- primStream* pStream);
-
-void monoTriangulationRecGenOpt(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_current, Int inc_end,
- vertexArray* dec_chain, Int dec_current, Int dec_end,
- primStream* pStream);
-
-void triangulateXYMonoTB(Int n_left, Real** leftVerts,
- Int n_right, Real** rightVerts,
- primStream* pStream);
-
-void monoTriangulationRecGenTBOpt(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_current, Int inc_end,
- vertexArray* dec_chain, Int dec_current, Int dec_end,
- primStream* pStream);
-
-void monoTriangulationRecOpt(Real* topVertex, Real* botVertex,
- vertexArray* left_chain, Int left_current,
- vertexArray* right_chain, Int right_current,
- primStream* pStream);
-
-void monoTriangulationRecFunGen(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_current, Int inc_end,
- vertexArray* dec_chain, Int dec_current, Int dec_end,
- Int (*compFun)(Real*, Real*),
- primStream* pStream);
-
-void monoTriangulationRecFun(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_current,
- vertexArray* dec_chain, Int dec_current,
- Int (*compFun)(Real*, Real*),
- primStream* pStream);
-void monoTriangulationFun(directedLine* monoPolygon,
- Int (*compFun)(Real*, Real*), primStream* pStream);
-
-
-
-
-void monoTriangulationRec(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_current,
- vertexArray* dec_chain, Int dec_current,
- Backend* backend);
-
-void monoTriangulationFunBackend(Arc_ptr loop, Int (*compFun)(Real*, Real*), Backend* backend);
-
-void monoTriangulationRecFunBackend(Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_current,
- vertexArray* dec_chain, Int dec_current,
- Int (*compFun)(Real*, Real*),
- Backend* backend);
-
-void monoTriangulationOpt(directedLine* poly, primStream* pStream);
-
-#endif
-
-
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/mystdio.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/mystdio.h
deleted file mode 100755
index 0120ea349..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/mystdio.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * mystdio.h
- *
- * $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/mystdio.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glumystdio_h_
-#define __glumystdio_h_
-
-#ifdef STANDALONE
-inline void dprintf( char *, ... ) { }
-#endif
-
-#ifdef LIBRARYBUILD
-#ifndef NDEBUG
-#include <stdio.h>
-#define dprintf printf
-#else
-inline void dprintf( char *, ... ) { }
-#endif
-#endif
-
-#ifdef GLBUILD
-inline void dprintf( char *, ... ) { }
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#endif /* __glumystdio_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/mystdlib.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/mystdlib.h
deleted file mode 100755
index 5742d5ae5..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/mystdlib.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
- * mystdlib.h
- *
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/mystdlib.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef __glumystdlib_h_
-#define __glumystdlib_h_
-
-#ifdef STANDALONE
-typedef unsigned int size_t;
-extern "C" void abort( void );
-extern "C" void * malloc( size_t );
-extern "C" void free( void * );
-#endif
-
-#ifdef LIBRARYBUILD
-#include <stdlib.h>
-#endif
-
-#ifdef GLBUILD
-typedef unsigned int size_t;
-extern "C" void abort( void );
-extern "C" void * malloc( size_t );
-extern "C" void free( void * );
-#endif
-
-#endif /* __glumystdlib_h_ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/partitionX.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/partitionX.cc
deleted file mode 100755
index 9515a2036..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/partitionX.cc
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/partitionX.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "partitionX.h"
-
-#define CONCAVITY_ZERO 1.0e-6 //this number is used to test whether a vertex is concave (refelx)
- //or not. The test needs to compute the area of the three adjacent
- //vertices to see if the are is positive or negative.
-
-Int isCuspX(directedLine *v)
-{
- //if v->prev <= v && v->next <= v
- //|| v->prev >= v && v->next >= v
- Real* T = v->head();
- Real* P = v->getPrev()->head();
- Real* N = v->getNext()->head();
- if(
- (compV2InX(T,P) != -1 &&
- compV2InX(T,N) != -1
- ) ||
- (compV2InX(T,P) != 1 &&
- compV2InX(T,N) != 1
- )
- )
- return 1;
- else
- return 0;
-}
-
-Int isReflexX(directedLine* v)
-{
- Real* A = v->getPrev()->head();
- Real* B = v->head();
- Real* C = v->tail();
- Real Bx,By, Cx, Cy;
- //scale them in case they are too small
- Bx = 10*(B[0] - A[0]);
- By = 10*(B[1] - A[1]);
- Cx = 10*(C[0] - A[0]);
- Cy = 10*(C[1] - A[1]);
-
- if(Bx*Cy - Cx*By < -CONCAVITY_ZERO) return 1;
- else return 0;
-}
-
-
-/*return
- *0: not-cusp
- *1: interior cusp
- *2: exterior cusp
- */
-Int cuspTypeX(directedLine *v)
-{
- if(! isCuspX(v)) return 0;
- else
- {
-//printf("isCusp,%f,%f\n", v->head()[0], v->head()[1]);
- if(isReflexX(v))
- {
-// printf("isReflex\n");
- return 1;
- }
- else
- {
-// printf("not isReflex\n");
- return 2;
- }
- }
-}
-
-Int numInteriorCuspsX(directedLine *polygon)
-{
- directedLine *temp;
- int ret = 0;
- if(cuspTypeX(polygon) == 1)
- ret++;
- for(temp = polygon->getNext(); temp != polygon; temp = temp->getNext())
- if(cuspTypeX(temp) == 1)
- ret++;
- return ret;
-}
-
-
-void findInteriorCuspsX(directedLine *polygon, Int& ret_n_interior_cusps,
- directedLine** ret_interior_cusps)
-{
- directedLine *temp;
- ret_n_interior_cusps = 0;
- if(cuspTypeX(polygon) == 1)
- {
- ret_interior_cusps[ret_n_interior_cusps++] = polygon;
- }
- for(temp = polygon->getNext(); temp != polygon; temp = temp->getNext())
- if(cuspTypeX(temp) == 1)
- {
- ret_interior_cusps[ret_n_interior_cusps++] = temp;
- }
-}
-
-directedLine* findDiagonal_singleCuspX(directedLine* cusp)
-{
- directedLine* temp;
- Int is_minimal = ((compV2InX(cusp->head(), cusp->tail()) == -1)? 1:0);
-
- if(is_minimal)
- for(temp = cusp->getNext(); temp != cusp; temp = temp->getNext())
- {
- if(compV2InX(cusp->head(), temp->head()) == 1)
- {
- return temp;
- }
- }
- else //is maxmal
- for(temp = cusp->getNext(); temp != cusp; temp = temp->getNext())
- {
- if(compV2InX(cusp->head(), temp->head()) == -1)
- {
- return temp;
- }
- }
- return NULL;
-}
-
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/partitionX.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/partitionX.h
deleted file mode 100755
index db549cfa5..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/partitionX.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/partitionX.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _PARTITIONX_H
-#define _PARTITIONX_H
-
-#include "directedLine.h"
-
-Int isCuspX(directedLine *v);
-Int isReflexX(directedLine *v);
-Int cuspTypeX(directedLine *v);
-
-//assuming the array of ret_interior_cusps has been allocated
-void findInteriorCuspsX(directedLine* polygon, Int& ret_n_interior_cusps,
- directedLine** ret_interior_cusps);
-
-Int numInteriorCuspsX(directedLine* polygon);
-
-/*a single polygon with a single cusp
- *return the diagonal vertex corresponding to this cusp
- */
-directedLine* findDiagonal_singleCuspX(directedLine* cusp);
-
-#endif
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/partitionY.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/partitionY.cc
deleted file mode 100755
index 59e771920..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/partitionY.cc
+++ /dev/null
@@ -1,838 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/partitionY.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <time.h>
-
-#include "zlassert.h"
-#include "partitionY.h"
-#include "searchTree.h"
-#include "quicksort.h"
-#include "polyUtil.h"
-
-
-#define max(a,b) ((a>b)? a:b)
-#define min(a,b) ((a>b)? b:a)
-
-
-/*retrurn
- *-1: if A < B (Ya<Yb) || (Ya==Yb)
- * 0: if A == B
- * 1: if A>B
- */
-static Int compVertInY(Real A[2], Real B[2])
-{
- if( (A[1] < B[1]) || (A[1]==B[1] && A[0]<B[0]))
- return -1;
- else if
- ( A[1] == B[1] && A[0] == B[0]) return 0;
- else
- return 1;
-}
-
-/*v is a vertex: the head of en edge,
- *e is an edge,
- *return 1 if e is below v: assume v1 and v2 are the two endpoints of e:
- * v1<= v, v2<=v.
- */
-Int isBelow(directedLine *v, directedLine *e)
-{
- Real* vert = v->head();
- if( compVertInY(e->head(), vert) != 1
- && compVertInY(e->tail(), vert) != 1
- )
- return 1;
- else
- return 0;
-}
-
-/*v is a vertex: the head of en edge,
- *e is an edge,
- *return 1 if e is below v: assume v1 and v2 are the two endpoints of e:
- * v1>= v, v2>=v.
- */
-Int isAbove(directedLine *v, directedLine *e)
-{
- Real* vert = v->head();
- if( compVertInY(e->head(), vert) != -1
- && compVertInY(e->tail(), vert) != -1
- )
- return 1;
- else
- return 0;
-}
-
-Int isCusp(directedLine *v)
-{
- Real *A=v->getPrev()->head();
- Real *B=v->head();
- Real *C=v->tail();
- if(A[1] < B[1] && B[1] < C[1])
- return 0;
- else if(A[1] > B[1] && B[1] > C[1])
- return 0;
- else if(A[1] < B[1] && C[1] < B[1])
- return 1;
- else if(A[1] > B[1] && C[1] > B[1])
- return 1;
-
- if(isAbove(v, v) && isAbove(v, v->getPrev()) ||
- isBelow(v, v) && isBelow(v, v->getPrev()))
- return 1;
- else
- return 0;
-}
-
-/*crossproduct is strictly less than 0*/
-Int isReflex(directedLine *v)
-{
- Real* A = v->getPrev()->head();
- Real* B = v->head();
- Real* C = v->tail();
- Real Bx,By, Cx, Cy;
- Bx = B[0] - A[0];
- By = B[1] - A[1];
- Cx = C[0] - A[0];
- Cy = C[1] - A[1];
-
- if(Bx*Cy - Cx*By < 0) return 1;
- else return 0;
-}
-
- /*return
- *0: not-cusp
- *1: interior cusp
- *2: exterior cusp
- */
-Int cuspType(directedLine *v)
-{
- if(! isCusp(v)) return 0;
- else if(isReflex(v)) return 1;
- else
- return 2;
-}
-
-sweepRange* sweepRangeMake(directedLine* left, Int leftType,
- directedLine* right, Int rightType)
-{
- sweepRange* ret = (sweepRange*)malloc(sizeof(sweepRange));
- assert(ret);
- ret->left = left;
- ret->leftType = leftType;
- ret->right = right;
- ret->rightType = rightType;
- return ret;
-}
-
-void sweepRangeDelete(sweepRange* range)
-{
- free(range);
-}
-
-Int sweepRangeEqual(sweepRange* src1, sweepRange* src2)
-{
- Int leftEqual;
- Int rightEqual;
-
-
- /*The case when both are vertices should not happen*/
- assert(! (src1->leftType == 0 && src2->leftType == 0));
- if(src1->leftType == 0 && src2->leftType == 1){
- if(src1->left == src2->left ||
- src1->left->getPrev() == src2->left
- )
- leftEqual = 1;
- else
- leftEqual = 0;
- }
- else if(src1->leftType == 1 && src2->leftType == 1){
- if(src1->left == src2->left)
- leftEqual = 1;
- else
- leftEqual = 0;
- }
- else /*src1->leftType == 1 && src2->leftType == 0*/{
- if(src1->left == src2->left ||
- src1->left == src2->left->getPrev()
- )
- leftEqual = 1;
- else
- leftEqual = 0;
- }
-
- /*the same thing for right*/
- /*The case when both are vertices should not happen*/
- assert(! (src1->rightType == 0 && src2->rightType == 0));
- if(src1->rightType == 0 && src2->rightType == 1){
- if(src1->right == src2->right ||
- src1->right->getPrev() == src2->right
- )
- rightEqual = 1;
- else
- rightEqual = 0;
- }
- else if(src1->rightType == 1 && src2->rightType == 1){
- if(src1->right == src2->right)
- rightEqual = 1;
- else
- rightEqual = 0;
- }
- else /*src1->rightType == 1 && src2->rightType == 0*/{
- if(src1->right == src2->right ||
- src1->right == src2->right->getPrev()
- )
- rightEqual = 1;
- else
- rightEqual = 0;
- }
-
- return (leftEqual == 1 || rightEqual == 1);
-}
-
-/*given (x_1, y_1) and (x_2, y_2), and y
- *return x such that (x,y) is on the line
- */
-inline/*static*/ Real intersectHoriz(Real x1, Real y1, Real x2, Real y2, Real y)
-{
- return ((y2==y1)? (x1+x2)*0.5 : x1 + ((y-y1)/(y2-y1)) * (x2-x1));
-/*
- if(y2 == y1) return (x1+x2)*0.5;
- else return x1 + ((y-y1)/(y2-y1)) * (x2-x1);
-*/
-}
-
-/*compare two edges of a polygon.
- *edge A < edge B if there is a horizontal line so that the intersection
- *with A is to the left of the intersection with B.
- *This function is used in sweepY for the dynamic search tree insertion to
- *order the edges.
- * Implementation: (x_1,y_1) and (x_2, y_2)
- */
-static Int compEdges(directedLine *e1, directedLine *e2)
-{
- Real* head1 = e1->head();
- Real* tail1 = e1->tail();
- Real* head2 = e2->head();
- Real* tail2 = e2->tail();
-/*
- Real h10 = head1[0];
- Real h11 = head1[1];
- Real t10 = tail1[0];
- Real t11 = tail1[1];
- Real h20 = head2[0];
- Real h21 = head2[1];
- Real t20 = tail2[0];
- Real t21 = tail2[1];
-*/
- Real e1_Ymax, e1_Ymin, e2_Ymax, e2_Ymin;
-/*
- if(h11>t11) {
- e1_Ymax= h11;
- e1_Ymin= t11;
- }
- else{
- e1_Ymax = t11;
- e1_Ymin = h11;
- }
-
- if(h21>t21) {
- e2_Ymax= h21;
- e2_Ymin= t21;
- }
- else{
- e2_Ymax = t21;
- e2_Ymin = h21;
- }
-*/
-
- if(head1[1]>tail1[1]) {
- e1_Ymax= head1[1];
- e1_Ymin= tail1[1];
- }
- else{
- e1_Ymax = tail1[1];
- e1_Ymin = head1[1];
- }
-
- if(head2[1]>tail2[1]) {
- e2_Ymax= head2[1];
- e2_Ymin= tail2[1];
- }
- else{
- e2_Ymax = tail2[1];
- e2_Ymin = head2[1];
- }
-
-
- /*Real e1_Ymax = max(head1[1], tail1[1]);*/ /*max(e1->head()[1], e1->tail()[1]);*/
- /*Real e1_Ymin = min(head1[1], tail1[1]);*/ /*min(e1->head()[1], e1->tail()[1]);*/
- /*Real e2_Ymax = max(head2[1], tail2[1]);*/ /*max(e2->head()[1], e2->tail()[1]);*/
- /*Real e2_Ymin = min(head2[1], tail2[1]);*/ /*min(e2->head()[1], e2->tail()[1]);*/
-
- Real Ymax = min(e1_Ymax, e2_Ymax);
- Real Ymin = max(e1_Ymin, e2_Ymin);
-
- Real y = 0.5*(Ymax + Ymin);
-
-/* Real x1 = intersectHoriz(e1->head()[0], e1->head()[1], e1->tail()[0], e1->tail()[1], y);
- Real x2 = intersectHoriz(e2->head()[0], e2->head()[1], e2->tail()[0], e2->tail()[1], y);
-*/
-/*
- Real x1 = intersectHoriz(h10, h11, t10, t11, y);
- Real x2 = intersectHoriz(h20, h21, t20, t21, y);
-*/
- Real x1 = intersectHoriz(head1[0], head1[1], tail1[0], tail1[1], y);
- Real x2 = intersectHoriz(head2[0], head2[1], tail2[0], tail2[1], y);
-
- if(x1<= x2) return -1;
- else return 1;
-}
-
-/*used by sort precedures
- */
-static Int compInY(directedLine* v1, directedLine* v2)
-{
- return v1->compInY(v2);
-}
-
-void findDiagonals(Int total_num_edges, directedLine** sortedVertices, sweepRange** ranges, Int& num_diagonals, directedLine** diagonal_vertices)
-{
- Int i,j,k;
-
- k=0;
-
- for(i=0; i<total_num_edges; i++)
- {
- directedLine* vert =sortedVertices[i];
- directedLine* thisEdge = vert;
- directedLine* prevEdge = vert->getPrev();
-/*
-printf("find i=%i\n", i);
-printf("the vertex is\n");
-vert->printSingle();
-*/
- if(isBelow(vert, thisEdge) && isBelow(vert, prevEdge) && compEdges(prevEdge, thisEdge)<0)
- {
- /*this is an upward interior cusp*/
- diagonal_vertices[k++] = vert;
-
- for(j=i+1; j<total_num_edges; j++)
- if(sweepRangeEqual(ranges[i], ranges[j]))
- {
- diagonal_vertices[k++] = sortedVertices[j];
- break;
- }
- assert(j<total_num_edges);
-
-
- }
- else if(isAbove(vert, thisEdge) && isAbove(vert, prevEdge) && compEdges(prevEdge, thisEdge)>0)
- {
- /*this is an downward interior cusp*/
- diagonal_vertices[k++] = vert;
- for(j=i-1; j>=0; j--)
- if(sweepRangeEqual(ranges[i], ranges[j]))
- {
- diagonal_vertices[k++] = sortedVertices[j];
- break;
- }
-/* printf("j=%i\n", j);*/
- assert(j>=0);
-
-
-
- }
- }
- num_diagonals = k/2;
-}
-
-/*get rid of repeated diagonlas so that each diagonal appears only once in the array
- */
-Int deleteRepeatDiagonals(Int num_diagonals, directedLine** diagonal_vertices, directedLine** new_vertices)
-{
- Int i,k;
- Int j,l;
- Int index;
- index=0;
- for(i=0,k=0; i<num_diagonals; i++, k+=2)
- {
- Int isRepeated=0;
- /*check the diagonla (diagonal_vertice[k], diagonal_vertices[k+1])
- *is repeated or not
- */
- for(j=0,l=0; j<index; j++, l+=2)
- {
- if(
- (diagonal_vertices[k] == new_vertices[l] &&
- diagonal_vertices[k+1] == new_vertices[l+1]
- )
- ||
- (
- diagonal_vertices[k] == new_vertices[l+1] &&
- diagonal_vertices[k+1] == new_vertices[l]
- )
- )
- {
- isRepeated=1;
- break;
- }
- }
- if(! isRepeated)
- {
- new_vertices[index+index] = diagonal_vertices[k];
- new_vertices[index+index+1] = diagonal_vertices[k+1];
- index++;
- }
- }
- return index;
-}
-
-/*for debug only*/
-directedLine** DBGfindDiagonals(directedLine *polygons, Int& num_diagonals)
-{
- Int total_num_edges = 0;
- directedLine** array = polygons->toArrayAllPolygons(total_num_edges);
- quicksort( (void**)array, 0, total_num_edges-1, (Int (*)(void*, void*)) compInY);
- sweepRange** ranges = (sweepRange**) malloc(sizeof(sweepRange*) * total_num_edges);
- assert(ranges);
-
- sweepY(total_num_edges, array, ranges);
-
- directedLine** diagonal_vertices = (directedLine**) malloc(sizeof(directedLine*) * total_num_edges);
- assert(diagonal_vertices);
- findDiagonals(total_num_edges, array, ranges, num_diagonals, diagonal_vertices);
-
- num_diagonals=deleteRepeatDiagonals(num_diagonals, diagonal_vertices, diagonal_vertices);
- return diagonal_vertices;
-
-}
-
-
-/*partition into Y-monotone polygons*/
-directedLine* partitionY(directedLine *polygons, sampledLine **retSampledLines)
-{
- Int total_num_edges = 0;
- directedLine** array = polygons->toArrayAllPolygons(total_num_edges);
-
- quicksort( (void**)array, 0, total_num_edges-1, (Int (*)(void*, void*)) compInY);
-
- sweepRange** ranges = (sweepRange**) malloc(sizeof(sweepRange*) * (total_num_edges));
- assert(ranges);
-
-
-
- sweepY(total_num_edges, array, ranges);
-
-
-
- /*the diagonal vertices are stored as:
- *v0-v1: 1st diagonal
- *v2-v3: 2nd diagonal
- *v5-v5: 3rd diagonal
- *...
- */
-
-
- Int num_diagonals;
- /*number diagonals is < total_num_edges*total_num_edges*/
- directedLine** diagonal_vertices = (directedLine**) malloc(sizeof(directedLine*) * total_num_edges*2/*total_num_edges*/);
- assert(diagonal_vertices);
-
-
-
- findDiagonals(total_num_edges, array, ranges, num_diagonals, diagonal_vertices);
-
-
-
- directedLine* ret_polygons = polygons;
- sampledLine* newSampledLines = NULL;
- Int i,k;
-
-num_diagonals=deleteRepeatDiagonals(num_diagonals, diagonal_vertices, diagonal_vertices);
-
-
-
- Int *removedDiagonals=(Int*)malloc(sizeof(Int) * num_diagonals);
- for(i=0; i<num_diagonals; i++)
- removedDiagonals[i] = 0;
-
-
-
-
-
- for(i=0,k=0; i<num_diagonals; i++,k+=2)
- {
-
-
- directedLine* v1=diagonal_vertices[k];
- directedLine* v2=diagonal_vertices[k+1];
- directedLine* ret_p1;
- directedLine* ret_p2;
-
- /*we ahve to determine whether v1 and v2 belong to the same polygon before
- *their structure are modified by connectDiagonal().
- */
-/*
- directedLine *root1 = v1->findRoot();
- directedLine *root2 = v2->findRoot();
- assert(root1);
- assert(root2);
-*/
-
-directedLine* root1 = v1->rootLinkFindRoot();
-directedLine* root2 = v2->rootLinkFindRoot();
-
- if(root1 != root2)
- {
-
- removedDiagonals[i] = 1;
- sampledLine* generatedLine;
-
-
-
- v1->connectDiagonal(v1,v2, &ret_p1, &ret_p2, &generatedLine, ret_polygons);
-
-
-
- newSampledLines = generatedLine->insert(newSampledLines);
-/*
- ret_polygons = ret_polygons->cutoffPolygon(root1);
-
- ret_polygons = ret_polygons->cutoffPolygon(root2);
- ret_polygons = ret_p1->insertPolygon(ret_polygons);
-root1->rootLinkSet(ret_p1);
-root2->rootLinkSet(ret_p1);
-ret_p1->rootLinkSet(NULL);
-ret_p2->rootLinkSet(ret_p1);
-*/
- ret_polygons = ret_polygons->cutoffPolygon(root2);
-
-
-
-root2->rootLinkSet(root1);
-ret_p1->rootLinkSet(root1);
-ret_p2->rootLinkSet(root1);
-
- /*now that we have connected the diagonal v1 and v2,
- *we have to check those unprocessed diagonals which
- *have v1 or v2 as an end point. Notice that the head of v1
- *has the same coodinates as the head of v2->prev, and the head of
- *v2 has the same coordinate as the head of v1->prev.
- *Suppose these is a diagonal (v1, x). If (v1,x) is still a valid
- *diagonal, then x should be on the left hand side of the directed line: *v1->prev->head -- v1->head -- v1->tail. Otherwise, (v1,x) should be
- *replaced by (v2->prev, x), that is, x is on the left of
- * v2->prev->prev->head, v2->prev->head, v2->prev->tail.
- */
- Int ii, kk;
- for(ii=0, kk=0; ii<num_diagonals; ii++, kk+=2)
- if( removedDiagonals[ii]==0)
- {
- directedLine* d1=diagonal_vertices[kk];
- directedLine* d2=diagonal_vertices[kk+1];
- /*check d1, and replace diagonal_vertices[kk] if necessary*/
- if(d1 == v1) {
- /*check if d2 is to left of v1->prev->head:v1->head:v1->tail*/
- if(! pointLeft2Lines(v1->getPrev()->head(),
- v1->head(), v1->tail(), d2->head()))
- {
-/*
- assert(pointLeft2Lines(v2->getPrev()->getPrev()->head(),
- v2->getPrev()->head(),
- v2->getPrev()->tail(), d2->head()));
-*/
- diagonal_vertices[kk] = v2->getPrev();
- }
- }
- if(d1 == v2) {
- /*check if d2 is to left of v2->prev->head:v2->head:v2->tail*/
- if(! pointLeft2Lines(v2->getPrev()->head(),
- v2->head(), v2->tail(), d2->head()))
- {
-/*
- assert(pointLeft2Lines(v1->getPrev()->getPrev()->head(),
- v1->getPrev()->head(),
- v1->getPrev()->tail(), d2->head()));
-*/
- diagonal_vertices[kk] = v1->getPrev();
- }
- }
- /*check d2 and replace diagonal_vertices[k+1] if necessary*/
- if(d2 == v1) {
- /*check if d1 is to left of v1->prev->head:v1->head:v1->tail*/
- if(! pointLeft2Lines(v1->getPrev()->head(),
- v1->head(), v1->tail(), d1->head()))
- {
-/* assert(pointLeft2Lines(v2->getPrev()->getPrev()->head(),
- v2->getPrev()->head(),
- v2->getPrev()->tail(), d1->head()));
-*/
- diagonal_vertices[kk+1] = v2->getPrev();
- }
- }
- if(d2 == v2) {
- /*check if d1 is to left of v2->prev->head:v2->head:v2->tail*/
- if(! pointLeft2Lines(v2->getPrev()->head(),
- v2->head(), v2->tail(), d1->head()))
- {
-/* assert(pointLeft2Lines(v1->getPrev()->getPrev()->head(),
- v1->getPrev()->head(),
- v1->getPrev()->tail(), d1->head()));
-*/
- diagonal_vertices[kk+1] = v1->getPrev();
- }
- }
- }
-}/*end if (root1 not equal to root 2)*/
-}
-
- /*second pass, now all diagoals should belong to the same polygon*/
-
-
-
- for(i=0,k=0; i<num_diagonals; i++, k += 2)
- if(removedDiagonals[i] == 0)
- {
-
-
- directedLine* v1=diagonal_vertices[k];
- directedLine* v2=diagonal_vertices[k+1];
-
-
-
- directedLine* ret_p1;
- directedLine* ret_p2;
-
- /*we ahve to determine whether v1 and v2 belong to the same polygon before
- *their structure are modified by connectDiagonal().
- */
- directedLine *root1 = v1->findRoot();
-/*
- directedLine *root2 = v2->findRoot();
-
-
-
- assert(root1);
- assert(root2);
- assert(root1 == root2);
- */
- sampledLine* generatedLine;
-
-
-
- v1->connectDiagonal(v1,v2, &ret_p1, &ret_p2, &generatedLine, ret_polygons);
- newSampledLines = generatedLine->insert(newSampledLines);
-
- ret_polygons = ret_polygons->cutoffPolygon(root1);
-
- ret_polygons = ret_p1->insertPolygon(ret_polygons);
-
- ret_polygons = ret_p2->insertPolygon(ret_polygons);
-
-
-
- for(Int j=i+1; j<num_diagonals; j++)
- {
- if(removedDiagonals[j] ==0)
- {
-
- directedLine* temp1=diagonal_vertices[2*j];
- directedLine* temp2=diagonal_vertices[2*j+1];
- if(temp1==v1 || temp1==v2 || temp2==v1 || temp2==v2)
- if(! temp1->samePolygon(temp1, temp2))
- {
- /*if temp1 and temp2 are in different polygons,
- *then one of them must be v1 or v2.
- */
-
-
-
- assert(temp1==v1 || temp1 == v2 || temp2==v1 || temp2 ==v2);
- if(temp1==v1)
- {
- diagonal_vertices[2*j] = v2->getPrev();
- }
- if(temp2==v1)
- {
- diagonal_vertices[2*j+1] = v2->getPrev();
- }
- if(temp1==v2)
- {
- diagonal_vertices[2*j] = v1->getPrev();
- }
- if(temp2==v2)
- {
- diagonal_vertices[2*j+1] = v1->getPrev();
- }
- }
- }
- }
-
- }
-
- /*clean up spaces*/
- free(array);
- free(ranges);
- free(diagonal_vertices);
- free(removedDiagonals);
-
- *retSampledLines = newSampledLines;
- return ret_polygons;
-}
-
-/*given a set of simple polygons where the interior
- *is decided by left-hand principle,
- *return a range (sight) for each vertex. This is called
- *Trapezoidalization.
- */
-void sweepY(Int nVertices, directedLine** sortedVertices, sweepRange** ret_ranges)
-{
- Int i;
- /*for each vertex in the sorted list, update the binary search tree.
- *and store the range information for each vertex.
- */
- treeNode* searchTree = NULL;
- for(i=0; i<nVertices;i++)
- {
-
- directedLine* vert = sortedVertices[i];
-
- directedLine* thisEdge = vert;
- directedLine* prevEdge = vert->getPrev();
-
- if(isBelow(vert, thisEdge) && isAbove(vert, prevEdge))
- {
-
- /*case 1: this < v < prev
- *the polygon is going down at v, the interior is to
- *the right hand side.
- * find the edge to the right of thisEdge for right range.
- * delete thisEdge
- * insert prevEdge
- */
- treeNode* thisNode = TreeNodeFind(searchTree, thisEdge, ( Int (*) (void *, void *))compEdges);
- assert(thisNode);
-
- treeNode* succ = TreeNodeSuccessor(thisNode);
- assert(succ);
- searchTree = TreeNodeDeleteSingleNode(searchTree, thisNode);
- searchTree = TreeNodeInsert(searchTree, TreeNodeMake(prevEdge), ( Int (*) (void *, void *))compEdges);
-
-
- ret_ranges[i] = sweepRangeMake(vert, 0, (directedLine*) (succ->key), 1);
-
- }
- else if(isAbove(vert, thisEdge) && isBelow(vert, prevEdge))
- {
-
- /*case 2: this > v > prev
- *the polygon is going up at v, the interior is to
- *the left hand side.
- * find the edge to the left of thisEdge for left range.
- * delete prevEdge
- * insert thisEdge
- */
- treeNode* prevNode = TreeNodeFind(searchTree, prevEdge, ( Int (*) (void *, void *))compEdges);
- assert(prevNode);
- treeNode* pred = TreeNodePredecessor(prevNode);
- searchTree = TreeNodeDeleteSingleNode(searchTree, prevNode);
- searchTree = TreeNodeInsert(searchTree, TreeNodeMake(thisEdge), ( Int (*) (void *, void *))compEdges);
- ret_ranges[i] = sweepRangeMake((directedLine*)(pred->key), 1, vert, 0);
- }
- else if(isAbove(vert, thisEdge) && isAbove(vert, prevEdge))
- {
-
- /*case 3: insert both edges*/
- treeNode* thisNode = TreeNodeMake(thisEdge);
- treeNode* prevNode = TreeNodeMake(prevEdge);
- searchTree = TreeNodeInsert(searchTree, thisNode, ( Int (*) (void *, void *))compEdges);
- searchTree = TreeNodeInsert(searchTree, prevNode, ( Int (*) (void *, void *))compEdges);
- if(compEdges(thisEdge, prevEdge)<0) /*interior cusp*/
- {
-
- treeNode* leftEdge = TreeNodePredecessor(thisNode);
- treeNode* rightEdge = TreeNodeSuccessor(prevNode);
- ret_ranges[i] = sweepRangeMake( (directedLine*) leftEdge->key, 1,
- (directedLine*) rightEdge->key, 1
- );
- }
- else /*exterior cusp*/
- {
-
- ret_ranges[i] = sweepRangeMake( prevEdge, 1, thisEdge, 1);
- }
- }
- else if(isBelow(vert, thisEdge) && isBelow(vert, prevEdge))
- {
-
- /*case 4: delete both edges*/
- treeNode* thisNode = TreeNodeFind(searchTree, thisEdge, ( Int (*) (void *, void *))compEdges);
- treeNode* prevNode = TreeNodeFind(searchTree, prevEdge, ( Int (*) (void *, void *))compEdges);
- if(compEdges(thisEdge, prevEdge)>0) /*interior cusp*/
- {
- treeNode* leftEdge = TreeNodePredecessor(prevNode);
- treeNode* rightEdge = TreeNodeSuccessor(thisNode);
- ret_ranges[i] = sweepRangeMake( (directedLine*) leftEdge->key, 1,
- (directedLine*) rightEdge->key, 1
- );
- }
- else /*exterior cusp*/
- {
- ret_ranges[i] = sweepRangeMake( thisEdge, 1, prevEdge, 1);
- }
- searchTree = TreeNodeDeleteSingleNode(searchTree, thisNode);
- searchTree = TreeNodeDeleteSingleNode(searchTree, prevNode);
- }
- else
- {
- fprintf(stderr,"error in partitionY.C, invalid case\n");
- printf("vert is\n");
- vert->printSingle();
- printf("thisEdge is\n");
- thisEdge->printSingle();
- printf("prevEdge is\n");
- prevEdge->printSingle();
-
- exit(1);
- }
- }
-
- /*finaly clean up space: delete the search tree*/
- TreeNodeDeleteWholeTree(searchTree);
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/partitionY.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/partitionY.h
deleted file mode 100755
index 93e8a59ad..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/partitionY.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
- *partitionY.h:
- *partition a polygon into a Y-monotone polygon:
- * A polygon is Y-monotone if the boundary can be split into two polygon chains
- *A and B such that each chain is Y-monotonic that is the intersection of any
- *horizontal line intersects each chain has at most one connected componenets
- * (empty, single point or a single line).
- *
- * A vertex is a cusp if both its ajacent vertices are either at or above v,
- *or both at or below v. In addition, at least one of the ajacent verteces is
- *strictly below or above v.
- * A vertex is a relex vertex if the internals angle is strictly greater than
- *180. In other words, if the the signed area is negative:
- *(x1, y1), (x2, y2), (x3, y3) are the three vertices along a polygon, the
- *order is such that left hand side is inside the polygon. Then (x2,y2) is
- *reflex if:
- * (x2-x1, y2-y1) cross (x3-x1, y3-y1) <0.
- *A vertex is an interior cusp if it is a cusp and a reflex.
- *A vertex is an exterior cusp if it is a cusp but not a reflex.
- *
- * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/partitionY.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
- */
-
-#ifndef _PARTITIONY_H
-#define _PARTITIONY_H
-
-#include "directedLine.h"
-
-/*whether an edge is below a vertex*/
-Int isBelow(directedLine *v, directedLine *e);
-
-/*whether an edge is above a vertex*/
-Int isAbove(directedLine *v, directedLine *e);
-
-/*not-cusp,
- *inerior cusp
- *exterior cusp
- */
-Int cuspType(directedLine *v);
-
-/*used in trapezoidalization*/
-typedef struct sweepRange{
- directedLine *left;
- Int leftType; /*either a vertex (leftType=0) or an edge (leftType =1) */
- directedLine *right;
- Int rightType; /*either a vertex (rightType=0) or an edge (rightType =1) */
-} sweepRange;
-
-sweepRange* sweepRangeMake(directedLine* left, Int leftType,
- directedLine* right, Int rightType);
-
-void sweepRangeDelete(sweepRange* range);
-Int sweepRangeEqual(sweepRange* sr1, sweepRange* sr2);
-
-/*given a set of simple polygons where the interior
- *is decided by left-hand principle,
- *return a range (sight) for each vertex. This is called
- *Trapezoidalization.
- */
-void sweepY(Int nVertices, directedLine **sortedVerteces, sweepRange** ret_ranges);
-
-
-directedLine* partitionY(directedLine *polygons, sampledLine **retSampledLines);
-
-void findDiagonals(Int total_num_edges, directedLine** sortedVertices, sweepRange** ranges, Int& num_diagonals, directedLine** diagonal_vertices);
-
-directedLine** DBGfindDiagonals(directedLine *polygons, Int& num_diagonals);
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyDBG.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyDBG.cc
deleted file mode 100755
index ea4ad7116..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyDBG.cc
+++ /dev/null
@@ -1,730 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/polyDBG.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-#include "zlassert.h"
-#include "polyDBG.h"
-
-
-static Real area(Real A[2], Real B[2], Real C[2])
-{
- Real Bx, By, Cx, Cy;
- Bx = B[0] - A[0];
- By = B[1] - A[1];
- Cx = C[0] - A[0];
- Cy = C[1] - A[1];
- return Bx*Cy - Cx*By;
-}
-
-Int DBG_isConvex(directedLine *poly)
-{
- directedLine* temp;
- if(area(poly->head(), poly->tail(), poly->getNext()->tail()) < 0.00000)
- return 0;
- for(temp = poly->getNext(); temp != poly; temp = temp->getNext())
- {
- if(area(temp->head(), temp->tail(), temp->getNext()->tail()) < 0.00000)
- return 0;
- }
- return 1;
-}
-
-Int DBG_is_U_monotone(directedLine* poly)
-{
- Int n_changes = 0;
- Int prev_sign;
- Int cur_sign;
- directedLine* temp;
- cur_sign = compV2InX(poly->tail(), poly->head());
-
- n_changes = (compV2InX(poly->getPrev()->tail(), poly->getPrev()->head())
- != cur_sign);
-
- for(temp = poly->getNext(); temp != poly; temp = temp->getNext())
- {
- prev_sign = cur_sign;
- cur_sign = compV2InX(temp->tail(), temp->head());
-
- if(cur_sign != prev_sign)
- n_changes++;
- }
-
- if(n_changes ==2) return 1;
- else return 0;
-}
-
-/*if u-monotone, and there is a long horizontal edge*/
-Int DBG_is_U_direction(directedLine* poly)
-{
-/*
- if(! DBG_is_U_monotone(poly))
- return 0;
-*/
- Int V_count = 0;
- Int U_count = 0;
- directedLine* temp;
- if( fabs(poly->head()[0] - poly->tail()[0]) <= fabs(poly->head()[1]-poly->tail()[1]))
- V_count += poly->get_npoints();
- else
- U_count += poly->get_npoints();
- /*
- else if(poly->head()[1] == poly->tail()[1])
- U_count += poly->get_npoints();
- */
- for(temp = poly->getNext(); temp != poly; temp = temp->getNext())
- {
- if( fabs(temp->head()[0] - temp->tail()[0]) <= fabs(temp->head()[1]-temp->tail()[1]))
- V_count += temp->get_npoints();
- else
- U_count += temp->get_npoints();
- /*
- if(temp->head()[0] == temp->tail()[0])
- V_count += temp->get_npoints();
- else if(temp->head()[1] == temp->tail()[1])
- U_count += temp->get_npoints();
- */
- }
-
- if(U_count > V_count) return 1;
- else return 0;
-}
-
-/*given two line segments, determine whether
- *they intersect each other or not.
- *return 1 if they do,
- *return 0 otherwise
- */
-Int DBG_edgesIntersect(directedLine* l1, directedLine* l2)
-{
- if(l1->getNext() == l2)
- {
- if(area(l1->head(), l1->tail(), l2->tail()) == 0) //colinear
- {
- if( (l1->tail()[0] - l1->head()[0])*(l2->tail()[0]-l2->head()[0]) +
- (l1->tail()[1] - l1->head()[1])*(l2->tail()[1]-l2->head()[1]) >=0)
- return 0; //not intersect
- else
- return 1;
- }
- //else we use the normal code
- }
- else if(l1->getPrev() == l2)
- {
- if(area(l2->head(), l2->tail(), l1->tail()) == 0) //colinear
- {
- if( (l2->tail()[0] - l2->head()[0])*(l1->tail()[0]-l1->head()[0]) +
- (l2->tail()[1] - l2->head()[1])*(l1->tail()[1]-l1->head()[1]) >=0)
- return 0; //not intersect
- else
- return 1;
- }
- //else we use the normal code
- }
- else //the two edges are not connected
- {
- if((l1->head()[0] == l2->head()[0] &&
- l1->head()[1] == l2->head()[1]) ||
- (l1->tail()[0] == l2->tail()[0] &&
- l1->tail()[1] == l2->tail()[1]))
- return 1;
-
- }
-
-
- if(
- (
- area(l1->head(), l1->tail(), l2->head())
- *
- area(l1->head(), l1->tail(), l2->tail())
- < 0
- )
- &&
- (
- area(l2->head(), l2->tail(), l1->head())
- *area(l2->head(), l2->tail(), l1->tail())
- < 0
- )
- )
- return 1;
- else
- return 0;
-}
-
-/*whether AB and CD intersect
- *return 1 if they do
- *retur 0 otheriwse
- */
-Int DBG_edgesIntersectGen(Real A[2], Real B[2], Real C[2], Real D[2])
-{
- if(
- (
- area(A, B, C) * area(A,B,D) <0
- )
- &&
- (
- area(C,D,A) * area(C,D,B) < 0
- )
- )
- return 1;
- else
- return 0;
-}
-
-/*determien whether (A,B) interesect chain[start] to [end]
- */
-Int DBG_intersectChain(vertexArray* chain, Int start, Int end, Real A[2], Real B[2])
-{
- Int i;
- for(i=start; i<=end-2; i++)
- if(DBG_edgesIntersectGen(chain->getVertex(i), chain->getVertex(i+1), A, B))
- return 1;
-
- return 0;
-}
-
-/*determine whether a polygon intersect itself or not
- *return 1 is it does,
- * 0 otherwise
- */
-Int DBG_polygonSelfIntersect(directedLine* poly)
-{
- directedLine* temp1;
- directedLine* temp2;
- temp1=poly;
- for(temp2=temp1->getNext(); temp2 != temp1; temp2=temp2->getNext())
- {
- if(DBG_edgesIntersect(temp1, temp2))
- {
- return 1;
- }
-
- }
-
- for(temp1=poly->getNext(); temp1 != poly; temp1 = temp1->getNext())
- for(temp2=temp1->getNext(); temp2 != temp1; temp2=temp2->getNext())
- {
- if(DBG_edgesIntersect(temp1, temp2))
- {
- return 1;
- }
- }
- return 0;
-}
-
-/*check whether a line segment intersects a polygon
- */
-Int DBG_edgeIntersectPoly(directedLine* edge, directedLine* poly)
-{
- directedLine* temp;
- if(DBG_edgesIntersect(edge, poly))
- return 1;
- for(temp=poly->getNext(); temp != poly; temp=temp->getNext())
- if(DBG_edgesIntersect(edge, temp))
- return 1;
- return 0;
-}
-
-/*check whether two polygons intersect
- */
-Int DBG_polygonsIntersect(directedLine* p1, directedLine* p2)
-{
- directedLine* temp;
- if(DBG_edgeIntersectPoly(p1, p2))
- return 1;
- for(temp=p1->getNext(); temp!= p1; temp = temp->getNext())
- if(DBG_edgeIntersectPoly(temp, p2))
- return 1;
- return 0;
-}
-
-/*check whether there are polygons intersecting each other in
- *a list of polygons
- */
-Int DBG_polygonListIntersect(directedLine* pList)
-{
- directedLine *temp;
- for(temp=pList; temp != NULL; temp = temp->getNextPolygon())
- if(DBG_polygonSelfIntersect(temp))
- return 1;
- directedLine* temp2;
- for(temp=pList; temp!=NULL; temp=temp->getNextPolygon())
- {
- for(temp2=temp->getNextPolygon(); temp2 != NULL; temp2=temp2->getNextPolygon())
- if(DBG_polygonsIntersect(temp, temp2))
- return 1;
- }
-
- return 0;
-}
-
-
-Int DBG_isCounterclockwise(directedLine* poly)
-{
- return (poly->polyArea() > 0);
-}
-
-/*ray: v0 with direction (dx,dy).
- *edge: v1-v2.
- * the extra point v10[2] is given for the information at
- *v1. Basically this edge is connectd to edge
- * v10-v1. If v1 is on the ray,
- * then we need v10 to determine whether this ray intersects
- * the edge or not (that is, return 1 or return 0).
- * If v1 is on the ray, then if v2 and v10 are on the same side of the ray,
- * we return 0, otherwise return 1.
- *For v2, if v2 is on the ray, we always return 0.
- *Notice that v1 and v2 are not symmetric. So the edge is directed!!!
- * The purpose for this convention is such that: a point is inside a polygon
- * if and only if it intersets with odd number of edges.
- */
-Int DBG_rayIntersectEdge(Real v0[2], Real dx, Real dy, Real v10[2], Real v1[2], Real v2[2])
-{
-/*
-if( (v1[1] >= v0[1] && v2[1]<= v0[1] )
- ||(v2[1] >= v0[1] && v1[1]<= v0[1] )
- )
- printf("rayIntersectEdge, *********\n");
-*/
-
- Real denom = (v2[0]-v1[0])*(-dy) - (v2[1]-v1[1]) * (-dx);
- Real nomRay = (v2[0]-v1[0]) * (v0[1] - v1[1]) - (v2[1]-v1[1])*(v0[0]-v1[0]);
- Real nomEdge = (v0[0]-v1[0]) * (-dy) - (v0[1]-v1[1])*(-dx);
-
-
- /*if the ray is parallel to the edge, return 0: not intersect*/
- if(denom == 0.0)
- return 0;
-
- /*if v0 is on the edge, return 0: not intersect*/
- if(nomRay == 0.0)
- return 0;
-
- /*if v1 is on the positive ray, and the neighbor of v1 crosses the ray
- *return 1: intersect
- */
- if(nomEdge == 0)
- { /*v1 is on the positive or negative ray*/
-
-/*
- printf("v1 is on the ray\n");
-*/
-
- if(dx*(v1[0]-v0[0])>=0 && dy*(v1[1]-v0[1])>=0) /*v1 on positive ray*/
- {
- if(area(v0, v1, v10) * area(v0, v1, v2) >0)
- return 0;
- else
- return 1;
- }
- else /*v1 on negative ray*/
- return 0;
- }
-
- /*if v2 is on the ray, always return 0: not intersect*/
- if(nomEdge == denom) {
-/* printf("v2 is on the ray\n");*/
- return 0;
- }
-
- /*finally */
- if(denom*nomRay>0 && denom*nomEdge>0 && nomEdge/denom <=1.0)
- return 1;
- return 0;
-}
-
-
-/*return the number of intersections*/
-Int DBG_rayIntersectPoly(Real v0[2], Real dx, Real dy, directedLine* poly)
-{
- directedLine* temp;
- Int count=0;
- if(DBG_rayIntersectEdge(v0, dx, dy, poly->getPrev()->head(), poly->head(), poly->tail()))
- count++;
-
- for(temp=poly->getNext(); temp != poly; temp = temp->getNext())
- if(DBG_rayIntersectEdge(v0, dx, dy, temp->getPrev()->head(), temp->head(), temp->tail()))
- count++;
-/*printf("ray intersect poly: count=%i\n", count);*/
- return count;
-}
-
-Int DBG_pointInsidePoly(Real v[2], directedLine* poly)
-{
-/*
-printf("enter pointInsidePoly , v=(%f,%f)\n", v[0], v[1]);
-printf("the polygon is\n");
-poly->printList();
-*/
- /*for debug purpose*/
- assert( (DBG_rayIntersectPoly(v,1,0,poly) % 2 )
- == (DBG_rayIntersectPoly(v,1,0.1234, poly) % 2 )
- );
- if(DBG_rayIntersectPoly(v, 1, 0, poly) % 2 == 1)
- return 1;
- else
- return 0;
-}
-
-/*return the number of polygons which contain thie polygon
- * as a subset
- */
-Int DBG_enclosingPolygons(directedLine* poly, directedLine* list)
-{
- directedLine* temp;
- Int count=0;
-/*
-printf("%i\n", DBG_pointInsidePoly(poly->head(),
- list->getNextPolygon()
- ->getNextPolygon()
- ->getNextPolygon()
- ->getNextPolygon()
-));
-*/
-
- for(temp = list; temp != NULL; temp = temp->getNextPolygon())
- {
- if(poly != temp)
- if(DBG_pointInsidePoly(poly->head(), temp))
- count++;
-/* printf("count=%i\n", count);*/
- }
- return count;
-}
-
-void DBG_reverse(directedLine* poly)
-{
- if(poly->getDirection() == INCREASING)
- poly->putDirection(DECREASING);
- else
- poly->putDirection(INCREASING);
-
- directedLine* oldNext = poly->getNext();
- poly->putNext(poly->getPrev());
- poly->putPrev(oldNext);
-
- directedLine* temp;
- for(temp=oldNext; temp!=poly; temp = oldNext)
- {
- if(temp->getDirection() == INCREASING)
- temp->putDirection(DECREASING);
- else
- temp->putDirection(INCREASING);
-
- oldNext = temp->getNext();
- temp->putNext(temp->getPrev());
- temp->putPrev(oldNext);
- }
- printf("reverse done\n");
-}
-
-Int DBG_checkConnectivity(directedLine *polygon)
-{
- if(polygon == NULL) return 1;
- directedLine* temp;
- if(polygon->head()[0] != polygon->getPrev()->tail()[0] ||
- polygon->head()[1] != polygon->getPrev()->tail()[1])
- return 0;
- for(temp=polygon->getNext(); temp != polygon; temp=temp->getNext())
- {
- if(temp->head()[0] != temp->getPrev()->tail()[0] ||
- temp->head()[1] != temp->getPrev()->tail()[1])
- return 0;
- }
- return 1;
-}
-
-/*print out error message.
- *If it cannot modify the polygon list to make it satify the
- *requirements, return 1.
- *otherwise modify the polygon list, and return 0
- */
-Int DBG_check(directedLine *polyList)
-{
- directedLine* temp;
- if(polyList == NULL) return 0;
-
- /*if there are intersections, print out error message
- */
- if(DBG_polygonListIntersect(polyList))
- {
- fprintf(stderr, "DBG_check: there are self intersections, don't know to modify the polygons\n");
- return 1;
- }
-
- /*check the connectivity of each polygon*/
- for(temp = polyList; temp!= NULL; temp = temp ->getNextPolygon())
- {
- if(! DBG_checkConnectivity(temp))
- {
- fprintf(stderr, "DBG_check, polygon not connected\n");
- return 1;
- }
- }
-
- /*check the orientation of each polygon*/
- for(temp = polyList; temp!= NULL; temp = temp ->getNextPolygon())
- {
-
-
- Int correctDir;
-
- if( DBG_enclosingPolygons(temp, polyList) % 2 == 0)
- correctDir = 1; /*counterclockwise*/
- else
- correctDir = 0; /*clockwise*/
-
- Int actualDir = DBG_isCounterclockwise(temp);
-
- if(correctDir != actualDir)
- {
- fprintf(stderr, "DBG_check: polygon with incorrect orientations. reversed\n");
-
- DBG_reverse(temp);
- }
-
- }
- return 0;
-}
-
-/**************handle self intersections*****************/
-//determine whether e interects [begin, end] or not
-static directedLine* DBG_edgeIntersectChainD(directedLine *e,
- directedLine *begin, directedLine *end)
-{
- directedLine *temp;
- for(temp=begin; temp != end; temp = temp->getNext())
- {
- if(DBG_edgesIntersect(e, temp))
- return temp;
- }
- if(DBG_edgesIntersect(e, end))
- return end;
- return NULL;
-}
-
-//given a polygon, cut the edges off and finally obtain a
-//a polygon without intersections. The cut-off edges are
-//dealloated. The new polygon is returned.
-directedLine* DBG_cutIntersectionPoly(directedLine *polygon, int& cutOccur)
-{
- directedLine *begin, *end, *next;
- begin = polygon;
- end = polygon;
- cutOccur = 0;
- while( (next = end->getNext()) != begin)
- {
- directedLine *interc = NULL;
- if( (interc = DBG_edgeIntersectChainD(next, begin, end)))
- {
- int fixed = 0;
- if(DBG_edgesIntersect(next, interc->getNext()))
- {
- //trying to fix it
- Real buf[2];
- int i;
- Int n=5;
- buf[0] = interc->tail()[0];
- buf[1] = interc->tail()[1];
-
- for(i=1; i<n; i++)
- {
- Real r = ((Real)i) / ((Real) n);
- Real u = (1-r) * interc->head()[0] + r * interc->tail()[0];
- Real v = (1-r) * interc->head()[1] + r * interc->tail()[1];
- interc->tail()[0] = interc->getNext()->head()[0] = u;
- interc->tail()[1] = interc->getNext()->head()[1] = v;
- if( (! DBG_edgesIntersect(next, interc)) &&
- (! DBG_edgesIntersect(next, interc->getNext())))
- break; //we fixed it
- }
- if(i==n) // we didn't fix it
- {
- fixed = 0;
- //back to original
- interc->tail()[0] = interc->getNext()->head()[0] = buf[0];
- interc->tail()[1] = interc->getNext()->head()[1] = buf[1];
- }
- else
- {
- fixed = 1;
- }
- }
- if(fixed == 0)
- {
- cutOccur = 1;
- begin->deleteSingleLine(next);
-
- if(begin != end)
- {
- if(DBG_polygonSelfIntersect(begin))
- {
- directedLine* newEnd = end->getPrev();
- begin->deleteSingleLine(end);
- end = newEnd;
- }
- }
- }
- else
- {
- end = end->getNext();
- }
- }
- else
- {
- end = end->getNext();
- }
- }
- return begin;
-}
-
-//given a polygon, cut the edges off and finally obtain a
-//a polygon without intersections. The cut-off edges are
-//dealloated. The new polygon is returned.
-static directedLine* DBG_cutIntersectionPoly_notwork(directedLine *polygon)
-{
- directedLine *crt;//current polygon
- directedLine *begin;
- directedLine *end;
- directedLine *temp;
- crt = polygon;
- int find=0;
- while(1)
- {
-//printf("loop\n");
- //if there are less than 3 edges, we should stop
- if(crt->getPrev()->getPrev() == crt)
- return NULL;
-
- if(DBG_edgesIntersect(crt, crt->getNext()) ||
- (crt->head()[0] == crt->getNext()->tail()[0] &&
- crt->head()[1] == crt->getNext()->tail()[1])
- )
- {
- find = 1;
- crt=crt->deleteChain(crt, crt->getNext());
- }
- else
- {
- //now we know crt and crt->getNext do not intersect
- begin = crt;
- end = crt->getNext();
-//printf("begin=(%f,%f)\n", begin->head()[0], begin->head()[1]);
-//printf("end=(%f,%f)\n", end->head()[0], end->head()[1]);
- for(temp=end->getNext(); temp!=begin; temp= temp->getNext())
- {
-//printf("temp=(%f,%f)\n", temp->head()[0], temp->head()[1]);
- directedLine *intersect = DBG_edgeIntersectChainD(temp, begin, end);
- if(intersect != NULL)
- {
- crt = crt->deleteChain(intersect, temp);
- find=1;
- break; //the for loop
- }
- else
- {
- end = temp;
- }
- }
- }
- if(find == 0)
- return crt;
- else
- find = 0; //go to next loop
-}
-}
-
-directedLine* DBG_cutIntersectionAllPoly(directedLine* list)
-{
- directedLine* temp;
- directedLine* tempNext=NULL;
- directedLine* ret = NULL;
- int cutOccur=0;
- for(temp=list; temp != NULL; temp = tempNext)
- {
- directedLine *left;
- tempNext = temp->getNextPolygon();
-
- left = DBG_cutIntersectionPoly(temp, cutOccur);
- if(left != NULL)
- ret=left->insertPolygon(ret);
- }
- return ret;
-}
-
-sampledLine* DBG_collectSampledLinesAllPoly(directedLine *polygonList)
-{
- directedLine *temp;
- sampledLine* tempHead = NULL;
- sampledLine* tempTail = NULL;
- sampledLine* cHead = NULL;
- sampledLine* cTail = NULL;
-
- if(polygonList == NULL)
- return NULL;
-
- DBG_collectSampledLinesPoly(polygonList, cHead, cTail);
-
- assert(cHead);
- assert(cTail);
- for(temp = polygonList->getNextPolygon(); temp != NULL; temp = temp->getNextPolygon())
- {
- DBG_collectSampledLinesPoly(temp, tempHead, tempTail);
- cTail->insert(tempHead);
- cTail = tempTail;
- }
- return cHead;
-}
-
-void DBG_collectSampledLinesPoly(directedLine *polygon, sampledLine*& retHead, sampledLine*& retTail)
-{
- directedLine *temp;
- sampledLine *ret = NULL;
- retHead = NULL;
- retTail = NULL;
- if(polygon == NULL)
- return;
-
- retHead = retTail = polygon->getSampledLine();
- for(temp = polygon->getNext(); temp != polygon; temp=temp->getNext())
- {
- retHead = temp->getSampledLine()->insert(retHead);
- }
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyDBG.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyDBG.h
deleted file mode 100755
index 0d58a9bc7..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyDBG.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/polyDBG.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _POLYDBG_H
-#define _POLYDBG_H
-
-#include "definitions.h"
-#include "directedLine.h"
-#include "monoTriangulation.h"
-
-Int DBG_edgesIntersectGen(Real A[2], Real B[2], Real C[2], Real D[2]);
-Int DBG_intersectChain(vertexArray* chain, Int start, Int end, Real A[2], Real B[2]);
-
-
-Int DBG_edgesIntersect(directedLine* l1, directedLine* l2);
-Int DBG_polygonSelfIntersect(directedLine* poly);
-Int DBG_edgeIntersectPoly(directedLine* edge, directedLine* poly);
-Int DBG_polygonsIntersect(directedLine* p1, directedLine* p2);
-Int DBG_polygonListIntersect(directedLine* pList);
-
-Int DBG_isCounterclockwise(directedLine* poly);
-Int DBG_rayIntersectEdge(Real v0[2], Real dx, Real dy, Real v10[2], Real v1[2], Real v2[2]);
-Int DBG_pointInsidePoly(Real v[2], directedLine* poly);
-Int DBG_enclosingPolygons(directedLine* poly, directedLine* list);
-void DBG_reverse(directedLine* poly);
-Int DBG_check(directedLine *polyList);
-
-Int DBG_isConvex(directedLine *poly);
-Int DBG_is_U_direction(directedLine *poly);
-Int DBG_is_U_monotone(directedLine* poly);
-
-directedLine* DBG_cutIntersectionAllPoly(directedLine* list);
-directedLine* DBG_cutIntersectionPoly(directedLine *polygon, int& cutOccur);
-
-sampledLine* DBG_collectSampledLinesAllPoly(directedLine *polygonList);
-
-void DBG_collectSampledLinesPoly(directedLine *polygon, sampledLine*& retHead, sampledLine*& retTail);
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyUtil.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyUtil.cc
deleted file mode 100755
index fcebcc818..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyUtil.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/polyUtil.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "polyUtil.h"
-
-Real area(Real A[2], Real B[2], Real C[2])
-{
- Real Bx, By, Cx, Cy;
- Bx = B[0] - A[0];
- By = B[1] - A[1];
- Cx = C[0] - A[0];
- Cy = C[1] - A[1];
- return Bx*Cy - Cx*By;
-
-/* return (B[0]-A[0])*(C[1]-A[1]) - (C[0]-A[0])*(B[1]-A[1]);*/
-}
-
-/*given a directed line A->B, and a point P,
- *determine whether P is to the left of AB.
- *the line A->B (imagine it has beedn extended both
- *end to the infinity) divides the plan into two
- *half planes. When we walk from A to B, one
- *half is to the left and the other half is to the right.
- *return 1 if P is to the left.
- *if P is on AB, 0 is returned.
- */
-Int pointLeftLine(Real A[2], Real B[2], Real P[2])
-{
- if(area(A, B, P) >0) return 1;
- else return 0;
-}
-
-/*given two directed line: A -> B -> C, and another point P.
- *determine whether P is to the left hand side of A->B->C.
- *Think of BA and BC extended as two rays. So that the plane is
- * divided into two parts. One part is to the left we walk from A
- *to B and to C, the other part is to the right.
- * In order for P to be the left, P must be either to the left
- *of
- */
-Int pointLeft2Lines(Real A[2], Real B[2], Real C[2], Real P[2])
-{
- Int C_left_AB = (area(A, B, C)>0);
- Int P_left_AB = (area(A, B, P)>0);
- Int P_left_BC = (area(B, C, P)>0);
-
- if(C_left_AB)
- {
- return (P_left_AB && P_left_BC);
- }
- else
- return (P_left_AB || P_left_BC);
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyUtil.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyUtil.h
deleted file mode 100755
index 26d84821b..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyUtil.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/polyUtil.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _POLYUTIL_H
-#define _POLYUTIL_H
-
-#include "definitions.h"
-
-Real area(Real A[2], Real B[2], Real C[2]);
-
-Int pointLeftLine(Real A[2], Real B[2], Real P[2]);
-Int pointLeft2Lines(Real A[2], Real B[2], Real C[2], Real P[2]);
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/primitiveStream.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/primitiveStream.cc
deleted file mode 100755
index 4c9feee12..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/primitiveStream.cc
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/primitiveStream.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include "gluos.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <assert.h>
-#include <GL/gl.h>
-
-#include "primitiveStream.h"
-
-Int primStream::num_triangles()
-{
- Int i;
- Int ret=0;
- for(i=0; i<index_lengths; i++)
- {
- ret += lengths[i]-2;
- }
- return ret;
-}
-
-
-
-/*the begining of inserting a new primitive.
- *reset counter to be 0.
- */
-void primStream::begin()
-{
- counter = 0;
-}
-
-void primStream::insert(Real u, Real v)
-{
- /*if the space cannot hold u and v,
- *we have to expand the array
- */
- if(index_vertices+1 >= size_vertices) {
- Real* temp = (Real*) malloc (sizeof(Real) * (2*size_vertices + 2));
- assert(temp);
-
- /*copy*/
- for(Int i=0; i<index_vertices; i++)
- temp[i] = vertices[i];
-
- free(vertices);
- vertices = temp;
- size_vertices = 2*size_vertices + 2;
- }
-
- vertices[index_vertices++] = u;
- vertices[index_vertices++] = v;
- counter++;
-}
-
-/*the end of a primitive.
- *increase index_lengths
- */
-void primStream::end(Int type)
-{
- Int i;
- /*if there is no vertex in this primitive,
- *nothing needs to be done
- */
- if(counter == 0) return ;
-
- if(index_lengths >= size_lengths){
- Int* temp = (Int*) malloc(sizeof(Int) * (2*size_lengths + 2));
- assert(temp);
- Int* tempTypes = (Int*) malloc(sizeof(Int) * (2*size_lengths + 2));
- assert(tempTypes);
-
- /*copy*/
- for(i=0; i<index_lengths; i++){
- temp[i] = lengths[i];
- tempTypes[i] = types[i];
- }
-
- free(lengths);
- free(types);
- lengths = temp;
- types = tempTypes;
- size_lengths = 2*size_lengths + 2;
- }
- lengths[index_lengths] = counter;
- types[index_lengths] = type;
- index_lengths++;
-}
-
-void primStream::print()
-{
- Int i,j,k;
- printf("index_lengths=%i,size_lengths=%i\n", index_lengths, size_lengths);
- printf("index_vertices=%i,size_vertices=%i\n", index_vertices, size_vertices);
- k=0;
- for(i=0; i<index_lengths; i++)
- {
- if(types[i] == PRIMITIVE_STREAM_FAN)
- printf("primitive-FAN:\n");
- else
- printf("primitive-STRIP:\n");
- for(j=0; j<lengths[i]; j++)
- {
- printf("(%f,%f) ", vertices[k], vertices[k+1]);
- k += 2;
- }
- printf("\n");
- }
-}
-
-primStream::primStream(Int sizeLengths, Int sizeVertices)
-{
- lengths = (Int*)malloc (sizeof(Int) * sizeLengths);
- assert(lengths);
- types = (Int*)malloc (sizeof(Int) * sizeLengths);
- assert(types);
-
- vertices = (Real*) malloc(sizeof(Real) * sizeVertices);
- assert(vertices);
-
- index_lengths = 0;
- index_vertices = 0;
- size_lengths = sizeLengths;
- size_vertices = sizeVertices;
-}
-
-primStream::~primStream()
-{
- free(lengths);
- free(types);
- free(vertices);
-}
-
-void primStream::draw()
-{
- Int i,j,k;
- k=0;
- for(i=0; i<index_lengths; i++)
- {
- switch(types[i]){
- case PRIMITIVE_STREAM_FAN:
- glBegin(GL_TRIANGLE_FAN);
- break;
- case PRIMITIVE_STREAM_STRIP:
- glBegin(GL_TRIANGLE_STRIP);
- break;
- }
-
- for(j=0; j<lengths[i]; j++){
- glVertex2fv(vertices+k);
- k += 2;
- }
- glEnd();
- }
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/primitiveStream.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/primitiveStream.h
deleted file mode 100755
index b28a190cd..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/primitiveStream.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/primitiveStream.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-/*we do not use the constans GL_... so that this file is independent of
- *<GL/gl.h>
- */
-
-#ifndef _PRIMITIVE_STREAM_H
-#define _PRIMITIVE_STREAM_H
-
-enum {PRIMITIVE_STREAM_FAN, PRIMITIVE_STREAM_STRIP};
-
-#include "definitions.h"
-
-class primStream {
- Int *lengths; /*length[i]=number of vertices of ith primitive*/
- Int *types; /*each primive has a type: FAN or STREAM*/
- Real *vertices; /*the size >= 2 * num_vertices, each vertex (u,v)*/
-
- /*the following size information are used for dynamic arrays*/
- Int index_lengths; /*the current available entry*/
- Int size_lengths; /*the allocated size of the array: lengths*/
- Int index_vertices;
- Int size_vertices;
-
- /*the vertex is inserted one by one. counter is used to
- *count the number of vertices which have been inserted so far in
- *the current primitive
- */
- Int counter;
-
-public:
- primStream(Int sizeLengths, Int sizeVertices);
- ~primStream();
-
- Int get_n_prims() //num of primitives
- {
- return index_lengths;
- }
- Int get_type(Int i) //the type of ith primitive
- {
- return types[i];
- }
- Int get_length(Int i) //the length of the ith primitive
- {
- return lengths[i];
- }
- Real* get_vertices() {return vertices;}
-
- /*the begining of inserting a new primitive.
- *reset counter to be 0.
- */
- void begin();
- void insert(Real u, Real v);
- void insert(Real v[2]) {insert(v[0], v[1]);}
- void end(Int type);
-
- Int num_triangles();
-
- void triangle(Real A[2], Real B[2], Real C[2])
- {
- begin();
- insert(A);
- insert(B);
- insert(C);
- end(PRIMITIVE_STREAM_FAN);
- }
- void print();
- void draw(); /*using GL to draw the primitives*/
-};
-
-
-
-
-
-
-
-
-#endif
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/quicksort.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/quicksort.cc
deleted file mode 100755
index f4bdd5c7f..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/quicksort.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Date Revision
-*/
-/*
-** Header: //depot/main/gfx/lib/glu/libnurbs/nurbtess/quicksort.cc#3
-*/
-
-
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/quicksort.cc,v 1.2 2002/01/23 17:06:18 dawes Exp $ */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-static void swap(void *v[], int i, int j);
-
-/*as an example to use this function to
- *sort integers, you need to supply the function
- *int comp(int *i1, int *i2)
- *{
- * if( *i1 < * i2) return -1;
- * else return 1;
- *}
- *and an array of pointers to integers:
- * int *v[100] (allocate space for where each v[i] points to).
- *then you can call:
- * quicksort( (void**)v, left, right, (int (*)(void *, void *))comp)
- */
-void quicksort(void *v[], int left, int right,
- int (*comp) (void *, void *))
-{
- int i, last;
- if(left >= right) /*do nothing if array contains */
- return; /*fewer than two elements*/
-
- swap(v, left, (left+right)/2);
- last = left;
- for(i=left+1; i<=right; i++)
- if((*comp)(v[i], v[left])<0)
- swap(v, ++last, i);
- swap(v, left, last);
- quicksort(v, left, last-1, comp);
- quicksort(v, last+1, right, comp);
-}
-
-static void swap(void *v[], int i, int j)
-{
- void *temp;
- temp = v[i];
- v[i] = v[j];
- v[j] = temp;
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/quicksort.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/quicksort.h
deleted file mode 100755
index d5f3b0b86..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/quicksort.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/quicksort.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _QUICKSORT_H
-#define _QUICKSORT_H
-
-#include <stdlib.h>
-#include <stdio.h>
-
-void quicksort(void *v[], int left, int right,
- int (*comp) (void *, void *));
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/rectBlock.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/rectBlock.cc
deleted file mode 100755
index 43b8033ce..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/rectBlock.cc
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/rectBlock.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include "gluos.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include "glimports.h"
-#include "zlassert.h"
-#include <GL/gl.h>
-
-#include "rectBlock.h"
-
-rectBlock::rectBlock(gridBoundaryChain* left, gridBoundaryChain* right, Int beginVline, Int endVline)
-{
- Int i;
-
-
- upGridLineIndex = left->getVlineIndex(beginVline);
-
- lowGridLineIndex = left->getVlineIndex(endVline);
-
- Int n = upGridLineIndex-lowGridLineIndex+1; //number of grid lines
- leftIndices = (Int*) malloc(sizeof(Int) * n);
- assert(leftIndices);
- rightIndices = (Int*) malloc(sizeof(Int) * n);
- assert(rightIndices);
- for(i=0; i<n; i++)
- {
-
- leftIndices[i] = left->getInnerIndex(i+beginVline);
- rightIndices[i] = right->getInnerIndex(i+beginVline);
- }
-}
-
-
-rectBlock::~rectBlock()
-{
- free(leftIndices);
- free(rightIndices);
-}
-
-void rectBlock::print()
-{
- Int i;
- printf("block:\n");
- for(i=upGridLineIndex; i >= lowGridLineIndex; i--)
- {
- printf("gridline %i, (%i,%i)\n", i, leftIndices[upGridLineIndex-i], rightIndices[upGridLineIndex-i]);
- }
-}
-
-
-
-void rectBlock::draw(Real* u_values, Real* v_values)
-{
- Int i,j,k;
- //upgrid line to bot grid line
-#ifdef DEBUG
-printf("upGridLineIndex=%i, lowGridLineIndex=%i\n", upGridLineIndex, lowGridLineIndex);
-#endif
- for(k=0, i=upGridLineIndex; i > lowGridLineIndex; i--, k++)
- {
- glBegin(GL_QUAD_STRIP);
-
- for(j=leftIndices[k+1]; j<= rightIndices[k+1]; j++)
- {
- glVertex2f(u_values[j], v_values[i]);
- glVertex2f(u_values[j], v_values[i-1]);
- }
- glEnd();
- }
-}
-
-
-Int rectBlock::num_quads()
-{
- Int ret=0;
- Int k,i;
- for(k=0, i=upGridLineIndex; i>lowGridLineIndex; i--, k++)
- {
- ret += (rightIndices[k+1]-leftIndices[k+1]);
- }
- return ret;
-}
-
-Int rectBlockArray::num_quads()
-{
- Int ret=0;
- for(Int i=0; i<n_elements; i++)
- ret += array[i]->num_quads();
- return ret;
-}
-
-rectBlockArray::rectBlockArray(Int s)
-{
- Int i;
- n_elements = 0;
- size = s;
- array = (rectBlock**) malloc(sizeof(rectBlock*) * s);
- assert(array);
-//initialization
- for(i=0; i<s; i++)
- array[i] = NULL;
-}
-
-rectBlockArray::~rectBlockArray()
-{
- Int i;
- for(i=0; i<size; i++)
- {
- if(array[i] != NULL)
- delete array[i];
- }
- free(array);
-}
-
-//put to the end of the array, check the size
-void rectBlockArray::insert(rectBlock* newBlock)
-{
- Int i;
- if(n_elements == size) //full
- {
- rectBlock** temp = (rectBlock**) malloc(sizeof(rectBlock) * (2*size+1));
- assert(temp);
- //initialization
- for(i=0; i<2*size+1; i++)
- temp[i] = NULL;
-
- for(i=0; i<n_elements; i++)
- temp[i] = array[i];
-
- free(array);
- array = temp;
- size = 2*size + 1;
- }
-
- array[n_elements++] = newBlock;
-}
-
-void rectBlockArray::print()
-{
- Int i;
- for(i=0; i<n_elements; i++)
- array[i]->print();
-}
-
-void rectBlockArray::draw(Real* u_values, Real* v_values)
-{
- Int i;
- for(i=0; i<n_elements; i++)
- array[i]->draw(u_values, v_values);
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/rectBlock.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/rectBlock.h
deleted file mode 100755
index 3371b22a4..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/rectBlock.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/rectBlock.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _RECTBLOCK_H
-#define _RECTBLOCK_H
-
-#include "definitions.h"
-#include "gridWrap.h"
-
-class rectBlock{
- Int upGridLineIndex;
- Int lowGridLineIndex;
- Int* leftIndices; //up to bottome
- Int* rightIndices; //up to bottom
-public:
- //the arrays are copies.
- rectBlock(gridBoundaryChain* left, gridBoundaryChain* right, Int beginVline, Int endVline);
- ~rectBlock(); //free the two arrays
-
- Int get_upGridLineIndex() {return upGridLineIndex;}
- Int get_lowGridLineIndex() {return lowGridLineIndex;}
- Int* get_leftIndices() {return leftIndices;}
- Int* get_rightIndices() {return rightIndices;}
-
- Int num_quads();
-
- void print();
- void draw(Real* u_values, Real* v_values);
-};
-
-
-class rectBlockArray{
- rectBlock** array;
- Int n_elements;
- Int size;
-public:
- rectBlockArray(Int s);
- ~rectBlockArray();//delete avarything including the blocks
-
- Int get_n_elements() {return n_elements;}
- rectBlock* get_element(Int i) {return array[i];}
- void insert(rectBlock* newBlock); //only take the pointer, not ther cotent
-
- Int num_quads();
-
- void print();
- void draw(Real* u_values, Real* v_values);
-};
-
-
-
-#endif
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleComp.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleComp.cc
deleted file mode 100755
index 7e60232ce..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleComp.cc
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/sampleComp.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "glimports.h"
-#include "sampleComp.h"
-#include "sampleCompTop.h"
-#include "sampleCompBot.h"
-#include "sampleCompRight.h"
-
-
-
-#define max(a,b) ((a>b)? a:b)
-#define min(a,b) ((a>b)? b:a)
-
-void sampleConnectedComp(Real* topVertex, Real* botVertex,
- vertexArray* leftChain,
- Int leftStartIndex, Int leftEndIndex,
- vertexArray* rightChain,
- Int rightStartIndex, Int rightEndIndex,
- gridBoundaryChain* leftGridChain,
- gridBoundaryChain* rightGridChain,
- Int gridIndex1, Int gridIndex2,
- Int up_leftCornerWhere,
- Int up_leftCornerIndex,
- Int up_rightCornerWhere,
- Int up_rightCornerIndex,
- Int down_leftCornerWhere,
- Int down_leftCornerIndex,
- Int down_rightCornerWhere,
- Int down_rightCornerIndex,
- primStream* pStream,
- rectBlockArray* rbArray
- )
-{
-
- sampleCompLeft(topVertex, botVertex,
- leftChain,
- leftStartIndex, leftEndIndex,
- rightChain,
- rightStartIndex, rightEndIndex,
- leftGridChain,
- gridIndex1,
- gridIndex2,
- up_leftCornerWhere,
- up_leftCornerIndex,
- down_leftCornerWhere,
- down_leftCornerIndex,
- pStream);
-
-
- sampleCompRight(topVertex, botVertex,
- leftChain,
- leftStartIndex, leftEndIndex,
- rightChain,
- rightStartIndex,
- rightEndIndex,
- rightGridChain,
- gridIndex1, gridIndex2,
- up_rightCornerWhere,
- up_rightCornerIndex,
- down_rightCornerWhere,
- down_rightCornerIndex,
- pStream);
-
-
- sampleCompTop(topVertex,
- leftChain,
- leftStartIndex,
- rightChain,
- rightStartIndex,
- leftGridChain,
- rightGridChain,
- gridIndex1,
- up_leftCornerWhere,
- up_leftCornerIndex,
- up_rightCornerWhere,
- up_rightCornerIndex,
- pStream);
-
- sampleCompBot(botVertex,
- leftChain,
- leftEndIndex,
- rightChain,
- rightEndIndex,
- leftGridChain,
- rightGridChain,
- gridIndex2,
- down_leftCornerWhere,
- down_leftCornerIndex,
- down_rightCornerWhere,
- down_rightCornerIndex,
- pStream);
-
-
- //the center
-
- rbArray->insert(new rectBlock(leftGridChain, rightGridChain, gridIndex1, gridIndex2));
-
-
-}
-
-/*notice that we need rightChain because the
- *corners could be on the rightChain.
- *here comp means component.
- */
-void sampleCompLeft(Real* topVertex, Real* botVertex,
- vertexArray* leftChain,
- Int leftStartIndex, Int leftEndIndex,
- vertexArray* rightChain,
- Int rightStartIndex, Int rightEndIndex,
- gridBoundaryChain* leftGridChain,
- Int gridIndex1, Int gridIndex2,
- Int up_leftCornerWhere,
- Int up_leftCornerIndex,
- Int down_leftCornerWhere,
- Int down_leftCornerIndex,
- primStream* pStream)
-{
- /*find out whether there is a trim vertex which is
- *inbetween the top and bot grid lines or not.
- */
- Int midIndex1;
- Int midIndex2;
- Int gridMidIndex1, gridMidIndex2;
- //midIndex1: array[i] <= v, array[i-1] > v
- //midIndex2: array[i] >= v, array[i+1] < v
- // v(gridMidIndex1) >= v(midindex1) > v(gridMidIndex1+1)
- // v(gridMidIndex2-1) >= v(midIndex2) > v(gridMidIndex2) ??
- midIndex1 = leftChain->findIndexBelowGen(
- leftGridChain->get_v_value(gridIndex1),
- leftStartIndex,
- leftEndIndex);
-
- midIndex2 = -1; /*initilization*/
- if(midIndex1<= leftEndIndex && gridIndex1<gridIndex2)
- if(leftChain->getVertex(midIndex1)[1] >= leftGridChain->get_v_value(gridIndex2))
- {
- midIndex2 = leftChain->findIndexAboveGen(
- leftGridChain->get_v_value(gridIndex2),
- midIndex1, //midIndex1 <= midIndex2.
- leftEndIndex);
- gridMidIndex1 = leftGridChain->lookfor(leftChain->getVertex(midIndex1)[1],
- gridIndex1, gridIndex2);
- gridMidIndex2 = 1+leftGridChain->lookfor(leftChain->getVertex(midIndex2)[1],
- gridMidIndex1, gridIndex2);
- }
-
-
- /*to interprete the corner information*/
- Real* cornerTop;
- Real* cornerBot;
- Int cornerLeftStart;
- Int cornerLeftEnd;
- Int cornerRightUpEnd;
- Int cornerRightDownStart;
- if(up_leftCornerWhere == 0) /*left corner is on left chain*/
- {
- cornerTop = leftChain->getVertex(up_leftCornerIndex);
- cornerLeftStart = up_leftCornerIndex+1;
- cornerRightUpEnd = -1; /*no right*/
- }
- else if(up_leftCornerWhere == 1) /*left corner is on top*/
- {
- cornerTop = topVertex;
- cornerLeftStart = leftStartIndex;
- cornerRightUpEnd = -1; /*no right*/
- }
- else /*left corner is on right chain*/
- {
- cornerTop = topVertex;
- cornerLeftStart = leftStartIndex;
- cornerRightUpEnd = up_leftCornerIndex;
- }
-
- if(down_leftCornerWhere == 0) /*left corner is on left chain*/
- {
- cornerBot = leftChain->getVertex(down_leftCornerIndex);
- cornerLeftEnd = down_leftCornerIndex-1;
- cornerRightDownStart = rightEndIndex+1; /*no right*/
- }
- else if(down_leftCornerWhere == 1) /*left corner is on bot*/
- {
- cornerBot = botVertex;
- cornerLeftEnd = leftEndIndex;
- cornerRightDownStart = rightEndIndex+1; /*no right*/
- }
- else /*left corner is on the right chian*/
- {
- cornerBot = botVertex;
- cornerLeftEnd = leftEndIndex;
- cornerRightDownStart = down_leftCornerIndex;
- }
-
-
-
-
- /*sample*/
- if(midIndex2 >= 0) /*there is a trim point inbewteen grid lines*/
- {
-
- sampleLeftSingleTrimEdgeRegionGen(cornerTop, leftChain->getVertex(midIndex1),
- leftChain,
- cornerLeftStart,
- midIndex1-1,
- leftGridChain,
- gridIndex1,
- gridMidIndex1,
- rightChain,
- rightStartIndex,
- cornerRightUpEnd,
- 0, //no right down section
- -1,
- pStream);
-
- sampleLeftSingleTrimEdgeRegionGen(leftChain->getVertex(midIndex2),
- cornerBot,
- leftChain,
- midIndex2+1,
- cornerLeftEnd,
- leftGridChain,
- gridMidIndex2,
- gridIndex2,
- rightChain,
- 0, //no right up section
- -1,
- cornerRightDownStart,
- rightEndIndex,
- pStream);
-
-
- sampleLeftStripRecF(leftChain,
- midIndex1,
- midIndex2,
- leftGridChain,
- gridMidIndex1,
- gridMidIndex2,
- pStream);
- }
- else
- {
- sampleLeftSingleTrimEdgeRegionGen(cornerTop, cornerBot,
- leftChain,
- cornerLeftStart,
- cornerLeftEnd,
- leftGridChain,
- gridIndex1,
- gridIndex2,
- rightChain,
- rightStartIndex,
- cornerRightUpEnd,
- cornerRightDownStart,
- rightEndIndex,
- pStream);
- }
-}
-
-void sampleLeftSingleTrimEdgeRegionGen(Real topVert[2], Real botVert[2],
- vertexArray* leftChain,
- Int leftStart,
- Int leftEnd,
- gridBoundaryChain* gridChain,
- Int gridBeginIndex,
- Int gridEndIndex,
- vertexArray* rightChain,
- Int rightUpBegin,
- Int rightUpEnd,
- Int rightDownBegin,
- Int rightDownEnd,
- primStream* pStream)
-{
- Int i,j,k;
-
- /*creat an array to store all the up and down secments of the right chain,
- *and the left end grid points
- *
- *although vertex array is a dynamic array, but to gain efficiency,
- *it is better to initiliza the exact array size
- */
- vertexArray vArray(gridEndIndex-gridBeginIndex+1 +
- max(0,rightUpEnd - rightUpBegin+1)+
- max(0,rightDownEnd - rightDownBegin+1));
-
- /*append the vertices on the up section of thr right chain*/
- for(i=rightUpBegin; i<= rightUpEnd; i++)
- vArray.appendVertex(rightChain->getVertex(i));
-
- /*append the vertices of the left extremal grid points,
- *and at the same time, perform triangulation for the stair cases
- */
- vArray.appendVertex(gridChain->get_vertex(gridBeginIndex));
-
- for(k=1, i=gridBeginIndex+1; i<=gridEndIndex; i++, k++)
- {
- vArray.appendVertex(gridChain->get_vertex(i));
-
- /*output the fan of the grid points of the (i)th and (i-1)th grid line.
- */
- if(gridChain->getUlineIndex(i) < gridChain->getUlineIndex(i-1))
- {
- pStream->begin();
- pStream->insert(gridChain->get_vertex(i-1));
- for(j=gridChain->getUlineIndex(i); j<= gridChain->getUlineIndex(i-1); j++)
- pStream->insert(gridChain->getGrid()->get_u_value(j), gridChain->get_v_value(i));
- pStream->end(PRIMITIVE_STREAM_FAN);
- }
- else if(gridChain->getUlineIndex(i) > gridChain->getUlineIndex(i-1))
- {
- pStream->begin();
- pStream->insert(gridChain->get_vertex(i));
- for(j=gridChain->getUlineIndex(i); j>= gridChain->getUlineIndex(i-1); j--)
- pStream->insert(gridChain->getGrid()->get_u_value(j), gridChain->get_v_value(i-1));
- pStream->end(PRIMITIVE_STREAM_FAN);
- }
- /*otherwisem, the two are equal, so there is no fan to outout*/
- }
-
- /*then append all the vertices on the down section of the right chain*/
- for(i=rightDownBegin; i<= rightDownEnd; i++)
- vArray.appendVertex(rightChain->getVertex(i));
-
- monoTriangulationRecGen(topVert, botVert,
- leftChain, leftStart, leftEnd,
- &vArray, 0, vArray.getNumElements()-1,
- pStream);
-
-}
-
-
-
-
-
-
-
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleComp.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleComp.h
deleted file mode 100755
index 7afb7272e..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleComp.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/sampleComp.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _SAMPLECOMP_H
-#define _SAMPLECOMP_H
-
-#include "sampleMonoPoly.h"
-#include "rectBlock.h"
-
-void sampleConnectedComp(Real* topVertex, Real* botVertex,
- vertexArray* leftChain,
- Int leftStartIndex, Int botLeftIndex,
- vertexArray* rightChain,
- Int rightStartIndex, Int botRightIndex,
- gridBoundaryChain* leftGridChain,
- gridBoundaryChain* rightGridChain,
- Int gridIndex1, Int gridIndex2,
- Int up_leftCornerWhere,
- Int up_leftCornerIndex,
- Int up_rightCornerWhere,
- Int up_rightCornerIndex,
- Int down_leftCornerWhere,
- Int down_leftCornerIndex,
- Int down_rightCornerWhere,
- Int down_rightCornerIndex,
- primStream* pStream,
- rectBlockArray* rbArray
- );
-
-void sampleCompLeft(Real* topVertex, Real* botVertex,
- vertexArray* leftChain,
- Int leftStartIndex, Int leftEndIndex,
- vertexArray* rightChain,
- Int rightStartIndex, Int rightEndIndex,
- gridBoundaryChain* leftGridChain,
- Int gridIndex1, Int gridIndex2,
- Int up_leftCornerWhere,
- Int up_leftCornerIndex,
- Int down_leftCornerWhere,
- Int down_leftCornerIndex,
- primStream* pStream);
-
-void sampleLeftSingleTrimEdgeRegionGen(Real topVert[2], Real botVert[2],
- vertexArray* leftChain,
- Int leftStart,
- Int leftEnd,
- gridBoundaryChain* gridChain,
- Int gridBegindex,
- Int gridEndIndex,
- vertexArray* rightChain,
- Int rightUpBegin,
- Int rightUpEnd,
- Int rightDownBegin,
- Int rightDownEnd,
- primStream* pStream);
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompBot.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompBot.cc
deleted file mode 100755
index afc3a3647..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompBot.cc
+++ /dev/null
@@ -1,846 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/sampleCompBot.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "zlassert.h"
-#include "sampleCompBot.h"
-#include "sampleCompRight.h"
-
-#define max(a,b) ((a>b)? a:b)
-
-//return: index_mono, index_pass
-//from [pass, mono] is strictly U-monotone
-//from [corner, pass] is <u
-// vertex[pass][0] >= u
-//if everybost is <u, then pass = end+1.
-//otherwise both mono and pass are meanng full and we have corner<=pass<=mono<=end
-void findBotLeftSegment(vertexArray* leftChain,
- Int leftEnd,
- Int leftCorner,
- Real u,
- Int& ret_index_mono,
- Int& ret_index_pass)
-{
- Int i;
-
- assert(leftCorner <= leftEnd);
- for(i=leftCorner; i<= leftEnd; i++)
- if(leftChain->getVertex(i)[0] >= u)
- break;
- ret_index_pass = i;
- if(ret_index_pass <= leftEnd)
- {
- for(i=ret_index_pass; i< leftEnd; i++)
- {
- if(leftChain->getVertex(i+1)[0] <= leftChain->getVertex(i)[0])
- break;
- }
- ret_index_mono = i;
- }
-
-}
-
-void findBotRightSegment(vertexArray* rightChain,
- Int rightEnd,
- Int rightCorner,
- Real u,
- Int& ret_index_mono,
- Int& ret_index_pass)
-{
- Int i;
- assert(rightCorner <= rightEnd);
- for(i=rightCorner; i<= rightEnd; i++)
- if(rightChain->getVertex(i)[0] <= u)
- break;
-
-
-
- ret_index_pass = i;
-
- if(ret_index_pass <= rightEnd)
- {
- for(i=ret_index_pass; i< rightEnd; i++)
- {
- if(rightChain->getVertex(i+1)[0] >= rightChain->getVertex(i)[0])
- break;
- }
- ret_index_mono = i;
- }
-}
-
-
-void sampleBotRightWithGridLinePost(Real* botVertex,
- vertexArray* rightChain,
- Int rightEnd,
- Int segIndexMono,
- Int segIndexPass,
- Int rightCorner,
- gridWrap* grid,
- Int gridV,
- Int leftU,
- Int rightU,
- primStream* pStream)
-{
- //the possible section which is to the right of rightU
- if(segIndexPass > rightCorner) //from corner to pass-1 is > u.
- {
- Real *tempBot;
- if(segIndexPass <= rightEnd) //there is a point to the left of u
- tempBot = rightChain->getVertex(segIndexPass);
- else //nothing is to the left of u.
- tempBot = botVertex;
- Real tempTop[2];
- tempTop[0] = grid->get_u_value(rightU);
- tempTop[1] = grid->get_v_value(gridV);
-
- monoTriangulation2(tempTop, tempBot,
- rightChain,
- rightCorner,
- segIndexPass-1,
- 0, // a decrease chain
- pStream);
- }
-
- //the possible section which is strictly Umonotone
- if(segIndexPass <= rightEnd) //segIndex pass and mono exist
- {
- //if there are grid points which are to the left of botVertex
- //then we should use botVertex to form a fan with these points to
- //optimize the triangulation
- int do_optimize = 1;
- if(botVertex[0] <= grid->get_u_value(leftU))
- do_optimize = 0;
- else
- {
- //we also have to make sure that botVertex is the left most vertex on the chain
- int i;
- for(i=segIndexMono; i<=rightEnd; i++)
- if(rightChain->getVertex(i)[0] <= botVertex[0])
- {
- do_optimize = 0;
- break;
- }
- }
-
- if(do_optimize)
- {
- //find midU so that grid->get_u_value(midU) <= botVertex[0]
- //and grid->get_u_value(midU) > botVertex[0]
- int midU = leftU;
- while(grid->get_u_value(midU) <= botVertex[0])
- {
- midU++;
- if(midU > rightU)
- break;
- }
- midU--;
-
- grid->outputFanWithPoint(gridV, leftU, midU, botVertex, pStream);
- stripOfFanRight(rightChain, segIndexMono, segIndexPass, grid, gridV, midU, rightU, pStream, 1);
- Real tempTop[2];
- tempTop[0] = grid->get_u_value(midU);
- tempTop[1] = grid->get_v_value(gridV);
- monoTriangulation2(tempTop, botVertex, rightChain, segIndexMono, rightEnd, 0, pStream);
- }
- else //not optimize
- {
- stripOfFanRight(rightChain, segIndexMono, segIndexPass, grid, gridV, leftU, rightU, pStream, 1);
- Real tempTop[2];
- tempTop[0] = grid->get_u_value(leftU);
- tempTop[1] = grid->get_v_value(gridV);
- monoTriangulation2(tempTop, botVertex, rightChain, segIndexMono, rightEnd, 0, pStream);
- }
- }
- else //the botVertex forms a fan witht eh grid points
- grid->outputFanWithPoint(gridV, leftU, rightU, botVertex, pStream);
-}
-
-void sampleBotRightWithGridLine(Real* botVertex,
- vertexArray* rightChain,
- Int rightEnd,
- Int rightCorner,
- gridWrap* grid,
- Int gridV,
- Int leftU,
- Int rightU,
- primStream* pStream)
-{
- //if right chaain is empty, then there is only one bot vertex with
- //one grid line
- if(rightEnd<rightCorner){
- grid->outputFanWithPoint(gridV, leftU, rightU, botVertex, pStream);
- return;
- }
-
- Int segIndexMono, segIndexPass;
- findBotRightSegment(rightChain,
- rightEnd,
- rightCorner,
- grid->get_u_value(rightU),
- segIndexMono,
- segIndexPass);
-
- sampleBotRightWithGridLinePost(botVertex,
- rightChain,
- rightEnd,
- segIndexMono,
- segIndexPass,
- rightCorner,
- grid,
- gridV,
- leftU,
- rightU,
- pStream);
-}
-
-
-void sampleBotLeftWithGridLinePost(Real* botVertex,
- vertexArray* leftChain,
- Int leftEnd,
- Int segIndexMono,
- Int segIndexPass,
- Int leftCorner,
- gridWrap* grid,
- Int gridV,
- Int leftU,
- Int rightU,
- primStream* pStream)
-{
-
- //the possible section which is to the left of leftU
- if(segIndexPass > leftCorner) //at least leftCorner is to the left of leftU
- {
- Real *tempBot;
- if(segIndexPass <= leftEnd) //from corner to pass-1 is <u
- tempBot = leftChain->getVertex(segIndexPass);
- else //nothing is to the rigth of u
- tempBot = botVertex;
- Real tempTop[2];
- tempTop[0] = grid->get_u_value(leftU);
- tempTop[1] = grid->get_v_value(gridV);
- monoTriangulation2(tempTop, tempBot, leftChain, leftCorner, segIndexPass-1,
- 1, //a increase chain,
- pStream);
- }
- //the possible section which is strictly Umonotone
- if(segIndexPass <= leftEnd) //segIndexpass and mono exist
- {
- stripOfFanLeft(leftChain, segIndexMono, segIndexPass, grid, gridV, leftU, rightU, pStream, 1);
- Real tempTop[2];
- tempTop[0] = grid->get_u_value(rightU);
- tempTop[1] = grid->get_v_value(gridV);
-
- monoTriangulation2(tempTop, botVertex, leftChain, segIndexMono, leftEnd,
- 1, //increase chain
- pStream);
- }
- else //the botVertex forms a fan with the grid points
- {
- grid->outputFanWithPoint(gridV, leftU, rightU, botVertex, pStream);
- }
-
-}
-
-void sampleBotLeftWithGridLine(Real* botVertex,
- vertexArray* leftChain,
- Int leftEnd,
- Int leftCorner,
- gridWrap* grid,
- Int gridV,
- Int leftU,
- Int rightU,
- primStream* pStream)
-{
-
- //if leftChain is empty, then there is only one botVertex with one grid line
- if(leftEnd< leftCorner){
- grid->outputFanWithPoint(gridV, leftU, rightU, botVertex, pStream);
- return;
- }
-
- Int segIndexPass, segIndexMono;
- findBotLeftSegment(leftChain, leftEnd, leftCorner, grid->get_u_value(leftU), segIndexMono, segIndexPass);
-
- sampleBotLeftWithGridLinePost(botVertex,
- leftChain,
- leftEnd,
- segIndexMono,
- segIndexPass,
- leftCorner,
- grid,
- gridV,
- leftU, rightU, pStream);
-}
-
-//return 1 if separator exists, 0 otherwise
-Int findBotSeparator(vertexArray* leftChain,
- Int leftEnd,
- Int leftCorner,
- vertexArray* rightChain,
- Int rightEnd,
- Int rightCorner,
- Int& ret_sep_left,
- Int& ret_sep_right)
-{
- Int oldLeftI, oldRightI, newLeftI, newRightI;
- Int i,j,k;
- Real leftMax /*= leftChain->getVertex(leftCorner)[0]*/;
- Real rightMin /*= rightChain->getVertex(rightCorner)[0]*/;
- if(leftChain->getVertex(leftCorner)[1] < rightChain->getVertex(rightCorner)[1])//leftlower
- {
- oldLeftI = leftCorner-1;
- oldRightI = rightCorner;
- leftMax = leftChain->getVertex(leftCorner)[0] - 1.0 ; //initilize to be left of leftCorner
- rightMin = rightChain->getVertex(rightCorner)[0];
- }
- else //rightlower
- {
- oldLeftI = leftCorner;
- oldRightI = rightCorner-1;
- leftMax = leftChain->getVertex(leftCorner)[0];
- rightMin = rightChain->getVertex(rightCorner)[0] + 1.0;
- }
-
- //i: the current working leftChain Index
- //j: the curent working right chian index
- //if(left(i) is lower than right(j), then the two chains above right(j) are separated.
- //else the two chains below left(i) are separated.
- i = leftCorner;
- j = rightCorner;
- while(1)
- {
- newLeftI = oldLeftI;
- newRightI = oldRightI;
- if(i> leftEnd) //left chain is doen , go through remaining right chain
- {
- for(k=j+1; k<= rightEnd; k++)
- {
- if(rightChain->getVertex(k)[0] > leftMax) //no conflict
- {
- //update oldRightI if necessary
- if(rightChain->getVertex(k)[0] < rightMin)
- {
- rightMin = rightChain->getVertex(k)[0];
- oldRightI = k;
- }
- }
- else //there is a conflict
- break; //the for-loop, above right(k+1) is separated: oldLeftI, oldRightI
- }
- break; //the while loop
- }
- else if(j > rightEnd) //right Chain is doen
- {
- for(k=i+1; k<= leftEnd; k++)
- {
- if(leftChain->getVertex(k)[0] < rightMin) //no conflict
- {
- //update oldLeftI if necessary
- if(leftChain->getVertex(k)[0] > leftMax)
- {
- leftMax = leftChain->getVertex(k)[0];
- oldLeftI = k;
- }
- }
- else //there is a conflict
- break; //the for-loop, above left(k+1) is separated: oldLeftI, oldRightI
- }
- break; //the while loop
- }
- else if(leftChain->getVertex(i)[1] < rightChain->getVertex(j)[1]) //left lower
- {
-
- if(leftChain->getVertex(i)[0] > leftMax) //update leftMax amd newLeftI
- {
- leftMax = leftChain->getVertex(i)[0];
- newLeftI = i;
- }
- for(k=j+1; k<= rightEnd; k++) //update rightMin and newRightI;
- {
- if(rightChain->getVertex(k)[1] < leftChain->getVertex(i)[1]) //right gets lower
- break;
- if(rightChain->getVertex(k)[0] < rightMin)
- {
- rightMin = rightChain->getVertex(k)[0];
- newRightI = k;
- }
- }
- j = k; //next working j, since j will he lower than i in next loop
- if(leftMax >= rightMin) //there is a conflict
- break;
- else //still no conflict
- {
- oldLeftI = newLeftI;
- oldRightI = newRightI;
-
- }
- }
- else //right lower
- {
- if(rightChain->getVertex(j)[0] < rightMin)
- {
- rightMin = rightChain->getVertex(j)[0];
- newRightI = j;
- }
- for(k=i+1; k<= leftEnd; k++)
- {
- if(leftChain->getVertex(k)[1] < rightChain->getVertex(j)[1])
- break;
- if(leftChain->getVertex(k)[0] > leftMax)
- {
- leftMax = leftChain->getVertex(k)[0];
- newLeftI = k;
- }
- }
- i=k; //nexct working i, since i will be lower than j next loop
- if(leftMax >= rightMin) //there is conflict
- break;
- else //still no conflict
- {
- oldLeftI = newLeftI;
- oldRightI = newRightI;
- }
- }
- }//end of while loop
- //now oldLeftI and oldRight I are the desired separator index notice that they are not
- //necessarily valid
- if(oldLeftI < leftCorner || oldRightI < rightCorner)
- return 0; //no separator
- else
- {
- ret_sep_left = oldLeftI;
- ret_sep_right = oldRightI;
- return 1;
- }
-}
-
-void sampleCompBot(Real* botVertex,
- vertexArray* leftChain,
- Int leftEnd,
- vertexArray* rightChain,
- Int rightEnd,
- gridBoundaryChain* leftGridChain,
- gridBoundaryChain* rightGridChain,
- Int gridIndex,
- Int down_leftCornerWhere,
- Int down_leftCornerIndex,
- Int down_rightCornerWhere,
- Int down_rightCornerIndex,
- primStream* pStream)
-{
-
- if(down_leftCornerWhere == 1 && down_rightCornerWhere == 1) //the bot is botVertex with possible grid points
- {
-
- leftGridChain->getGrid()->outputFanWithPoint(leftGridChain->getVlineIndex(gridIndex),
- leftGridChain->getUlineIndex(gridIndex),
- rightGridChain->getUlineIndex(gridIndex),
- botVertex,
- pStream);
- return;
- }
- else if(down_leftCornerWhere != 0)
- {
-
- Real* tempBot;
- Int tempRightEnd;
- if(down_leftCornerWhere == 1){
- tempRightEnd = rightEnd;
- tempBot = botVertex;
- }
- else
- {
- tempRightEnd = down_leftCornerIndex-1;
- tempBot = rightChain->getVertex(down_leftCornerIndex);
- }
-
- sampleBotRightWithGridLine(tempBot,
- rightChain,
- tempRightEnd,
- down_rightCornerIndex,
- rightGridChain->getGrid(),
- leftGridChain->getVlineIndex(gridIndex),
- leftGridChain->getUlineIndex(gridIndex),
- rightGridChain->getUlineIndex(gridIndex),
- pStream);
- }
- else if(down_rightCornerWhere != 2)
- {
-
- Real* tempBot;
- Int tempLeftEnd;
- if(down_rightCornerWhere == 1){
- tempLeftEnd = leftEnd;
- tempBot = botVertex;
- }
- else //right corner is on left chain
- {
- tempLeftEnd = down_rightCornerIndex-1;
- tempBot = leftChain->getVertex(down_rightCornerIndex);
- }
-
-
- sampleBotLeftWithGridLine(tempBot, leftChain, tempLeftEnd, down_leftCornerIndex,
- leftGridChain->getGrid(),
- leftGridChain->getVlineIndex(gridIndex),
- leftGridChain->getUlineIndex(gridIndex),
- rightGridChain->getUlineIndex(gridIndex),
- pStream);
-
- }
- else //down_leftCornereWhere == 0, down_rightCornerwhere == 2
- {
- sampleCompBotSimple(botVertex,
- leftChain,
- leftEnd,
- rightChain,
- rightEnd,
- leftGridChain,
- rightGridChain,
- gridIndex,
- down_leftCornerWhere,
- down_leftCornerIndex,
- down_rightCornerWhere,
- down_rightCornerIndex,
- pStream);
-
- return;
-
-#ifdef NOT_REACHABLE
- //the following code is trying to do some optimization, but not quite working. so it is not reachable, but leave it here for reference
- Int sep_left, sep_right;
- if(findBotSeparator(leftChain, leftEnd, down_leftCornerIndex,
- rightChain, rightEnd, down_rightCornerIndex,
- sep_left, sep_right)
- )//separator exiosts
- {
-
- if(leftChain->getVertex(sep_left)[0] >= leftGridChain->get_u_value(gridIndex) &&
- rightChain->getVertex(sep_right)[0] <= rightGridChain->get_u_value(gridIndex))
- {
- Int gridSep;
- Int segLeftMono, segLeftPass, segRightMono, segRightPass;
- findBotLeftSegment(leftChain,
- sep_left,
- down_leftCornerIndex,
- leftGridChain->get_u_value(gridIndex),
- segLeftMono,
- segLeftPass);
- findBotRightSegment(rightChain,
- sep_right,
- down_rightCornerIndex,
- rightGridChain->get_u_value(gridIndex),
- segRightMono,
- segRightPass);
- if(leftChain->getVertex(segLeftMono)[1] <= rightChain->getVertex(segRightMono)[1])
- {
- gridSep = rightGridChain->getUlineIndex(gridIndex);
- while(leftGridChain->getGrid()->get_u_value(gridSep) > leftChain->getVertex(segLeftMono)[0])
- gridSep--;
- }
- else
- {
- gridSep = leftGridChain->getUlineIndex(gridIndex);
- while(leftGridChain->getGrid()->get_u_value(gridSep) < rightChain->getVertex(segRightMono)[0])
- gridSep++;
- }
-
- sampleBotLeftWithGridLinePost(leftChain->getVertex(segLeftMono),
- leftChain,
- segLeftMono-1,
- segLeftMono-1,
- segLeftPass,
- down_leftCornerIndex,
- leftGridChain->getGrid(),
- leftGridChain->getVlineIndex(gridIndex),
- leftGridChain->getUlineIndex(gridIndex),
- gridSep,
- pStream);
- sampleBotRightWithGridLinePost(rightChain->getVertex(segRightMono),
- rightChain,
- segRightMono-1,
- segRightMono-1,
- segRightPass,
- down_rightCornerIndex,
- rightGridChain->getGrid(),
- rightGridChain->getVlineIndex(gridIndex),
- gridSep,
- rightGridChain->getUlineIndex(gridIndex),
- pStream);
- Real tempTop[2];
- tempTop[0] = leftGridChain->getGrid()->get_u_value(gridSep);
- tempTop[1] = leftGridChain->get_v_value(gridIndex);
- monoTriangulationRecGen(tempTop, botVertex,
- leftChain, segLeftMono, leftEnd,
- rightChain, segRightMono, rightEnd,
- pStream);
- }//end if both sides have vertices inside the gridboundary points
- else if(leftChain->getVertex(sep_left)[0] >= leftGridChain->get_u_value(gridIndex)) //left n right out
-
- {
- Int segLeftMono, segLeftPass;
- findBotLeftSegment(leftChain,
- sep_left,
- down_leftCornerIndex,
- leftGridChain->get_u_value(gridIndex),
- segLeftMono,
- segLeftPass);
- assert(segLeftPass <= sep_left); //make sure there is a point to the right of u.
- monoTriangulation2(leftGridChain->get_vertex(gridIndex),
- leftChain->getVertex(segLeftPass),
- leftChain,
- down_leftCornerIndex,
- segLeftPass-1,
- 1, //a increase chain
- pStream);
- stripOfFanLeft(leftChain, segLeftMono, segLeftPass,
- leftGridChain->getGrid(),
- leftGridChain->getVlineIndex(gridIndex),
- leftGridChain->getUlineIndex(gridIndex),
- rightGridChain->getUlineIndex(gridIndex),
- pStream,1 );
-/*
- sampleBotLeftWithGridLinePost(leftChain->getVertex(segLeftMono),
- leftChain,
- segLeftMono-1,
- segLeftMono-1,
- segLeftPass,
- down_leftCornerIndex,
- leftGridChain->getGrid(),
- leftGridChain->getVlineIndex(gridIndex),
- leftGridChain->getUlineIndex(gridIndex),
- rightGridChain->getUlineIndex(gridIndex),
- pStream);
-*/
-
- monoTriangulationRecGen(rightGridChain->get_vertex(gridIndex),
- botVertex,
- leftChain, segLeftMono, leftEnd,
- rightChain, down_rightCornerIndex, rightEnd,
- pStream);
- }//end left in right out
- else if(rightChain->getVertex(sep_right)[0] <= rightGridChain->get_u_value(gridIndex))//left out right in
- {
- Int segRightMono, segRightPass;
- findBotRightSegment(rightChain, sep_right, down_rightCornerIndex,
- rightGridChain->get_u_value(gridIndex),
- segRightMono,
- segRightPass);
-
- assert(segRightPass <= sep_right); //make sure there is a point to the left of u.
- monoTriangulation2(rightGridChain->get_vertex(gridIndex),
- rightChain->getVertex(segRightPass),
- rightChain,
- down_rightCornerIndex,
- segRightPass-1,
- 0, // a decrease chain
- pStream);
-
- stripOfFanRight(rightChain, segRightMono, segRightPass,
- rightGridChain->getGrid(),
- rightGridChain->getVlineIndex(gridIndex),
- leftGridChain->getUlineIndex(gridIndex),
- rightGridChain->getUlineIndex(gridIndex),
- pStream, 1);
-
-
- monoTriangulationRecGen(leftGridChain->get_vertex(gridIndex),
- botVertex,
- leftChain, down_leftCornerIndex, leftEnd,
- rightChain, segRightMono, rightEnd,
- pStream);
-
- }//end left out right in
- else //left out, right out
- {
- sampleCompBotSimple(botVertex,
- leftChain,
- leftEnd,
- rightChain,
- rightEnd,
- leftGridChain,
- rightGridChain,
- gridIndex,
- down_leftCornerWhere,
- down_leftCornerIndex,
- down_rightCornerWhere,
- down_rightCornerIndex,
- pStream);
-
- }//end leftout right out
- }//end if separator exists
- else //no separator
- {
-
- sampleCompBotSimple(botVertex,
- leftChain,
- leftEnd,
- rightChain,
- rightEnd,
- leftGridChain,
- rightGridChain,
- gridIndex,
- down_leftCornerWhere,
- down_leftCornerIndex,
- down_rightCornerWhere,
- down_rightCornerIndex,
- pStream);
- }
-#endif
- }//end id 0 2
-}//end if the functin
-
-
-void sampleCompBotSimple(Real* botVertex,
- vertexArray* leftChain,
- Int leftEnd,
- vertexArray* rightChain,
- Int rightEnd,
- gridBoundaryChain* leftGridChain,
- gridBoundaryChain* rightGridChain,
- Int gridIndex,
- Int down_leftCornerWhere,
- Int down_leftCornerIndex,
- Int down_rightCornerWhere,
- Int down_rightCornerIndex,
- primStream* pStream)
-{
- //the plan is to use monotriangulation algorithm.
- Int i,k;
- Real* ActualTop;
- Real* ActualBot;
- Int ActualLeftStart, ActualLeftEnd;
- Int ActualRightStart, ActualRightEnd;
-
- //creat an array to store the points on the grid line
- gridWrap* grid = leftGridChain->getGrid();
- Int gridV = leftGridChain->getVlineIndex(gridIndex);
- Int gridLeftU = leftGridChain->getUlineIndex(gridIndex);
- Int gridRightU = rightGridChain->getUlineIndex(gridIndex);
- Real2* gridPoints = (Real2*) malloc(sizeof(Real2) * (gridRightU - gridLeftU +1));
- assert(gridPoints);
-
- for(k=0, i=gridRightU; i>= gridLeftU; i--, k++)
- {
- gridPoints[k][0] = grid->get_u_value(i);
- gridPoints[k][1] = grid->get_v_value(gridV);
- }
-
- if(down_rightCornerWhere != 0) //rightCorner is not on lef
- ActualLeftEnd = leftEnd;
- else
- ActualLeftEnd = down_rightCornerIndex-1; //down_rightCornerIndex will be th actualBot
-
- if(down_leftCornerWhere != 0) //left corner is not on let chian
- ActualLeftStart = leftEnd+1; //meaning that there is no actual left section
- else
- ActualLeftStart = down_leftCornerIndex;
-
- vertexArray ActualLeftChain(max(0, ActualLeftEnd - ActualLeftStart +1) + gridRightU - gridLeftU +1);
-
- for(i=0; i<gridRightU - gridLeftU +1 ; i++)
- ActualLeftChain.appendVertex(gridPoints[i]);
- for(i=ActualLeftStart; i<= ActualLeftEnd; i++)
- ActualLeftChain.appendVertex(leftChain->getVertex(i));
-
- //determine ActualRightStart
- if(down_rightCornerWhere != 2) //right is not on right
- ActualRightStart = rightEnd +1; //meaning no section on right
- else
- ActualRightStart = down_rightCornerIndex;
-
- //determine actualrightEnd
- if(down_leftCornerWhere != 2) //left is not on right
- {
-
- ActualRightEnd = rightEnd;
- }
- else //left corner is on right
- {
- ActualRightEnd = down_leftCornerIndex-1; //down_leftCornerIndex will be the bot
-
- }
-
- //actual bot
- if(down_rightCornerWhere == 2)
- {
- if(down_leftCornerWhere == 2)
- ActualBot = rightChain->getVertex(down_leftCornerIndex);
- else
- ActualBot = botVertex;
- }
- else if(down_rightCornerWhere == 1) //right corner bot
- ActualBot = botVertex;
- else //down_rightCornerWhere == 0
- ActualBot = leftChain->getVertex(down_rightCornerIndex);
-
- ActualTop = gridPoints[0];
-/*
-printf("in bot simple, actual leftChain is \n");
-ActualLeftChain.print();
-printf("Actual Top = %f,%f\n", ActualTop[0],ActualTop[1]);
-printf("Actual Bot = %f,%f\n", ActualBot[0],ActualBot[1]);
-printf("Actual right start = %i, end=%i\n",ActualRightStart, ActualRightEnd);
-*/
- if(rightChain->getVertex(ActualRightStart)[1] == ActualTop[1])
- monoTriangulationRecGenOpt(rightChain->getVertex(ActualRightStart),
- ActualBot,
- &ActualLeftChain,
- 0,
- ActualLeftChain.getNumElements()-1,
- rightChain,
- ActualRightStart+1,
- ActualRightEnd,
- pStream);
- else
- monoTriangulationRecGenOpt(ActualTop, ActualBot,
- &ActualLeftChain,
- 1, //the first one is the top vertex
- ActualLeftChain.getNumElements()-1,
- rightChain,
- ActualRightStart,
- ActualRightEnd,
- pStream);
- free(gridPoints);
-}
-
-
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompBot.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompBot.h
deleted file mode 100755
index 5b9f529cd..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompBot.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/sampleCompBot.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _SAMPLECOMPBOT_H
-#define _SAMPLECOMPBOT_H
-
-#include "sampleMonoPoly.h"
-
-void findBotLeftSegment(vertexArray* leftChain,
- Int leftEnd,
- Int leftCorner,
- Real u,
- Int& ret_index_mono,
- Int& ret_index_pass);
-
-void findBotRightSegment(vertexArray* rightChain,
- Int rightEnd,
- Int rightCorner,
- Real u,
- Int& ret_index_mono,
- Int& ret_index_pass);
-
-
-void sampleBotRightWithGridLinePost(Real* botVertex,
- vertexArray* rightChain,
- Int rightEnd,
- Int segIndexMono,
- Int segIndexPass,
- Int rightCorner,
- gridWrap* grid,
- Int gridV,
- Int leftU,
- Int rightU,
- primStream* pStream);
-
-
-void sampleBotRightWithGridLine(Real* botVertex,
- vertexArray* rightChain,
- Int rightEnd,
- Int rightCorner,
- gridWrap* grid,
- Int gridV,
- Int leftU,
- Int rightU,
- primStream* pStream);
-
-
-void sampleBotLeftWithGridLinePost(Real* botVertex,
- vertexArray* leftChain,
- Int leftEnd,
- Int segIndexMono,
- Int segIndexPass,
- Int leftCorner,
- gridWrap* grid,
- Int gridV,
- Int leftU,
- Int rightU,
- primStream* pStream);
-
-
-void sampleBotLeftWithGridLine(Real* botVertex,
- vertexArray* leftChain,
- Int leftEnd,
- Int leftCorner,
- gridWrap* grid,
- Int gridV,
- Int leftU,
- Int rightU,
- primStream* pStream);
-
-
-Int findBotSeparator(vertexArray* leftChain,
- Int leftEnd,
- Int leftCorner,
- vertexArray* rightChain,
- Int rightEnd,
- Int rightCorner,
- Int& ret_sep_left,
- Int& ret_sep_right);
-
-void sampleCompBot(Real* botVertex,
- vertexArray* leftChain,
- Int leftEnd,
- vertexArray* rightChain,
- Int rightEnd,
- gridBoundaryChain* leftGridChain,
- gridBoundaryChain* rightGridChain,
- Int gridIndex,
- Int down_leftCornerWhere,
- Int down_leftCornerIndex,
- Int down_rightCornerWhere,
- Int down_rightCornerIndex,
- primStream* pStream);
-
-void sampleCompBotSimple(Real* botVertex,
- vertexArray* leftChain,
- Int leftEnd,
- vertexArray* rightChain,
- Int rightEnd,
- gridBoundaryChain* leftGridChain,
- gridBoundaryChain* rightGridChain,
- Int gridIndex,
- Int down_leftCornerWhere,
- Int down_leftCornerIndex,
- Int down_rightCornerWhere,
- Int down_rightCornerIndex,
- primStream* pStream);
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompRight.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompRight.cc
deleted file mode 100755
index 54d251db0..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompRight.cc
+++ /dev/null
@@ -1,645 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/sampleCompRight.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "glimports.h"
-#include "zlassert.h"
-#include "sampleCompRight.h"
-
-#define max(a,b) ((a>b)? a:b)
-#define min(a,b) ((a>b)? b:a)
-
-
-
-#ifdef NOT_TAKEOUT
-
-/*notice that we need leftChain because the
- *corners could be on the leftChain.
- */
-void sampleCompRight(Real* topVertex, Real* botVertex,
- vertexArray* leftChain,
- Int leftStartIndex, Int leftEndIndex,
- vertexArray* rightChain,
- Int rightStartIndex, Int rightEndIndex,
- gridBoundaryChain* rightGridChain,
- Int gridIndex1, Int gridIndex2,
- Int up_rightCornerWhere,
- Int up_rightCornerIndex,
- Int down_rightCornerWhere,
- Int down_rightCornerIndex,
- primStream* pStream)
-{
- /*find out whether there is a trim vertex which is
- *inbetween the top and bot grid lines or not.
- */
- Int midIndex1;
- Int midIndex2;
- Int gridMidIndex1, gridMidIndex2;
- //midIndex1: array[i] <= v, array[i+1] > v
- //midIndex2: array[i] >= v, array[i+1] < v
- midIndex1 = rightChain->findIndexBelowGen(rightGridChain->get_v_value(gridIndex1),
- rightStartIndex,
- rightEndIndex);
- midIndex2 = -1; //initilization
- if(midIndex1 <= rightEndIndex && gridIndex1 < gridIndex2)
- if(rightChain->getVertex(midIndex1)[1] >= rightGridChain->get_v_value(gridIndex2))
- {
- //midIndex2 must exist:
- midIndex2 = rightChain->findIndexAboveGen(rightGridChain->get_v_value(gridIndex2),
- midIndex1, //midIndex1<=midIndex2
- rightEndIndex);
- //find gridMidIndex1 so that either it=gridIndex1 when the gridline is
- // at the same height as trim vertex midIndex1, or it is the last one
- //which is strictly above midIndex1.
- {
- Real temp = rightChain->getVertex(midIndex1)[1];
- if(rightGridChain->get_v_value(gridIndex1) == temp)
- gridMidIndex1 = gridIndex1;
- else
- {
- gridMidIndex1 = gridIndex1;
- while(rightGridChain->get_v_value(gridMidIndex1) > temp)
- gridMidIndex1++;
- gridMidIndex1--;
- }
- }//end of find gridMindIndex1
- //find gridMidIndex2 so that it is the (first one below or equal
- //midIndex) last one above or equal midIndex2
- {
- Real temp = rightChain->getVertex(midIndex2)[1];
- for(gridMidIndex2 = gridMidIndex1+1; gridMidIndex2 <= gridIndex2; gridMidIndex2++)
- if(rightGridChain->get_v_value(gridMidIndex2) <= temp)
- break;
-
- assert(gridMidIndex2 <= gridIndex2);
- }//end of find gridMidIndex2
- }
-
-
-
- //to interprete the corner information
- Real* cornerTop;
- Real* cornerBot;
- Int cornerRightStart;
- Int cornerRightEnd;
- Int cornerLeftUpEnd;
- Int cornerLeftDownStart;
- if(up_rightCornerWhere == 2) //right corner is on right chain
- {
- cornerTop = rightChain->getVertex(up_rightCornerIndex);
- cornerRightStart = up_rightCornerIndex+1;
- cornerLeftUpEnd = -1; //no left
- }
- else if(up_rightCornerWhere == 1) //right corner is on top
- {
- cornerTop = topVertex;
- cornerRightStart = rightStartIndex;
- cornerLeftUpEnd = -1; //no left
- }
- else //right corner is on left chain
- {
- cornerTop = topVertex;
- cornerRightStart = rightStartIndex;
- cornerLeftUpEnd = up_rightCornerIndex;
- }
-
- if(down_rightCornerWhere == 2) //right corner is on right chan
- {
- cornerBot = rightChain->getVertex(down_rightCornerIndex);
- cornerRightEnd = down_rightCornerIndex-1;
- cornerLeftDownStart = leftEndIndex+1; //no left
- }
- else if (down_rightCornerWhere == 1) //right corner is at bot
- {
- cornerBot = botVertex;
- cornerRightEnd = rightEndIndex;
- cornerLeftDownStart = leftEndIndex+1; //no left
- }
- else //right corner is on the left chain
- {
- cornerBot = botVertex;
- cornerRightEnd = rightEndIndex;
- cornerLeftDownStart = down_rightCornerIndex;
- }
-
- //sample
- if(midIndex2 >= 0) //there is a trm point between grid lines
- {
-
- sampleRightSingleTrimEdgeRegionGen(cornerTop, rightChain->getVertex(midIndex1),
- rightChain,
- cornerRightStart,
- midIndex1-1,
- rightGridChain,
- gridIndex1,
- gridMidIndex1,
- leftChain,
- leftStartIndex,
- cornerLeftUpEnd,
- 0, //no left down section,
- -1,
- pStream);
-
- sampleRightSingleTrimEdgeRegionGen(rightChain->getVertex(midIndex2),
- cornerBot,
- rightChain,
- midIndex2+1,
- cornerRightEnd,
- rightGridChain,
- gridMidIndex2,
- gridIndex2,
- leftChain,
- 0, //no left up section
- -1,
- cornerLeftDownStart,
- leftEndIndex,
- pStream);
-
- sampleRightStripRecF(rightChain,
- midIndex1,
- midIndex2,
- rightGridChain,
- gridMidIndex1,
- gridMidIndex2,
- pStream);
-
- }
- else
- {
- sampleRightSingleTrimEdgeRegionGen(cornerTop, cornerBot,
- rightChain,
- cornerRightStart,
- cornerRightEnd,
- rightGridChain,
- gridIndex1,
- gridIndex2,
- leftChain,
- leftStartIndex,
- cornerLeftUpEnd,
- cornerLeftDownStart,
- leftEndIndex,
- pStream);
- }
-}
-
-void sampleRightSingleTrimEdgeRegionGen(Real topVertex[2], Real botVertex[2],
- vertexArray* rightChain,
- Int rightStart,
- Int rightEnd,
- gridBoundaryChain* gridChain,
- Int gridBeginIndex,
- Int gridEndIndex,
- vertexArray* leftChain,
- Int leftUpBegin,
- Int leftUpEnd,
- Int leftDownBegin,
- Int leftDownEnd,
- primStream* pStream)
-{
- Int i,k;
- /*creat an array to store all the up and down secments of the left chain,
- *and the right end grid points
- *
- *although vertex array is a dynamic array, but to gain efficiency,
- *it is better to initiliza the exact array size
- */
- vertexArray vArray(gridEndIndex-gridBeginIndex+1 +
- max(0,leftUpEnd - leftUpBegin+1)+
- max(0,leftDownEnd - leftDownBegin+1));
- //append the vertices on the up section of the left chain
- for(i=leftUpBegin; i<= leftUpEnd; i++)
- vArray.appendVertex(leftChain->getVertex(i));
-
- //append the vertices of the right extremal grid points,
- //and at the same time, perform triangulation for the stair cases
- vArray.appendVertex(gridChain->get_vertex(gridBeginIndex));
-
- for(k=1, i=gridBeginIndex+1; i<= gridEndIndex; i++, k++)
- {
- vArray.appendVertex(gridChain->get_vertex(i));
-
- //output the fan of the grid points of the (i)th and (i-1)th grid line.
- gridChain->rightEndFan(i, pStream);
- }
-
- //append all the vertices on the down section of the left chain
- for(i=leftDownBegin; i<= leftDownEnd; i++)
- vArray.appendVertex(leftChain->getVertex(i));
- monoTriangulationRecGen(topVertex, botVertex,
- &vArray, 0, vArray.getNumElements()-1,
- rightChain, rightStart, rightEnd,
- pStream);
-}
-
-void sampleRightSingleTrimEdgeRegion(Real upperVert[2], Real lowerVert[2],
- gridBoundaryChain* gridChain,
- Int beginIndex,
- Int endIndex,
- primStream* pStream)
-{
- Int i,k;
- vertexArray vArray(endIndex-beginIndex+1);
- vArray.appendVertex(gridChain->get_vertex(beginIndex));
- for(k=1, i=beginIndex+1; i<= endIndex; i++, k++)
- {
- vArray.appendVertex(gridChain->get_vertex(i));
- //output the fan of the grid points of the (i)_th and i-1th gridLine
- gridChain->rightEndFan(i, pStream);
- }
- monoTriangulation2(upperVert, lowerVert, &vArray, 0, endIndex-beginIndex,
- 1, //increase chain (to the left)
- pStream);
-}
-
-
-/*the gridlines from rightGridChainStartIndex to
- *rightGridChainEndIndex are assumed to form a
- *connected componenet
- *the trm vertex of topRightIndex is assumed to be below
- *or equal the first gridLine, and the trm vertex of
- *botRightIndex is assumed to be above or equal the last gridline
- **there could be multipe trm vertices equal to the last gridline, but
- **only one could be equal to top gridline. shape: ____| (recall that
- **for left chain recF, we allow shape: |----
- *if botRightIndex<topRightIndex, then no connected componenet exists, and
- *no triangles are generated.
- *Othewise, botRightIndex>= topRightIndex, there is at least one triangles to
- *output
- */
-void sampleRightStripRecF(vertexArray* rightChain,
- Int topRightIndex,
- Int botRightIndex,
- gridBoundaryChain* rightGridChain,
- Int rightGridChainStartIndex,
- Int rightGridChainEndIndex,
- primStream* pStream
- )
-{
-
- //sstop conditionL: if topRightIndex > botRightIndex, then stop
- if(topRightIndex > botRightIndex)
- return;
-
- //if there is only one grid line, return
- if(rightGridChainStartIndex >= rightGridChainEndIndex)
- return;
-
-
- assert(rightChain->getVertex(topRightIndex)[1] <= rightGridChain->get_v_value(rightGridChainStartIndex) &&
- rightChain->getVertex(botRightIndex)[1] >= rightGridChain->get_v_value(rightGridChainEndIndex));
-
- //firstfind the first trim vertex which is strictly below the second top
- //grid line: index1.
- Real secondGridChainV = rightGridChain->get_v_value(rightGridChainStartIndex+1);
- Int index1 = topRightIndex;
- while(rightChain->getVertex(index1)[1] >= secondGridChainV){
- index1++;
- if(index1 > botRightIndex)
- break;
- }
- //now rightChain->getVertex(index1-1)[1] >= secondGridChainV and
- //rightChain->getVertex(index1)[1] < secondGridChainV and
- //we should include index1-1 to perform a gridStep
- index1--;
-
- //now we have rightChain->getVertex(index1)[1] >= secondGridChainV, and
- //rightChain->getVertex(index1+1)[1] < secondGridChainV
- sampleRightOneGridStep(rightChain, topRightIndex, index1, rightGridChain, rightGridChainStartIndex, pStream);
-
- //if rightChain->getVertex(index1)[1] ==secondGridChainV then we can
- //recurvesively to the rest
- if(rightChain->getVertex(index1)[1] == secondGridChainV)
- {
-
-
- sampleRightStripRecF(rightChain, index1, botRightIndex, rightGridChain, rightGridChainStartIndex+1, rightGridChainEndIndex, pStream);
- }
- else if(index1 < botRightIndex)
- {
- //otherwise, we have rightChain->getVertex(index1)[1] > secondV
- //let the next trim vertex be nextTrimVertex, (which should be strictly
- //below the second grid line). Find the last grid line index2 which is STRICTLY ABOVE
- //nextTrimVertex.
- //sample one trm edge region.
- Real *uppervert, *lowervert;
- uppervert = rightChain->getVertex(index1);
- lowervert = rightChain->getVertex(index1+1); //okay since index1<botRightindex
- Int index2 = rightGridChainStartIndex+1;
- while(rightGridChain->get_v_value(index2) > lowervert[1])
- {
- index2++;
- if(index2 > rightGridChainEndIndex)
- break;
- }
- index2--;
-
- sampleRightSingleTrimEdgeRegion(uppervert, lowervert, rightGridChain, rightGridChainStartIndex+1, index2, pStream);
-
- //recursion
- sampleRightStripRecF(rightChain, index1+1, botRightIndex, rightGridChain, index2, rightGridChainEndIndex, pStream);
- }
-}
-
-//the degenerate case of sampleRightOneGridStep
-void sampleRightOneGridStepNoMiddle(vertexArray* rightChain,
- Int beginRightIndex,
- Int endRightIndex,
- gridBoundaryChain* rightGridChain,
- Int rightGridChainStartIndex,
- primStream* pStream)
-{
- /*since there is no middle, there is at most one point which is on the
- *second grid line, there could be multiple points on the first (top)
- *grid line.
- */
- rightGridChain->rightEndFan(rightGridChainStartIndex+1, pStream);
- monoTriangulation2(rightGridChain->get_vertex(rightGridChainStartIndex),
- rightGridChain->get_vertex(rightGridChainStartIndex+1),
- rightChain,
- beginRightIndex,
- endRightIndex,
- 0, //decrease chain
- pStream);
-}
-
-//sampling the right area in between two grid lines
-//shape: _________|
-void sampleRightOneGridStep(vertexArray* rightChain,
- Int beginRightIndex,
- Int endRightIndex,
- gridBoundaryChain* rightGridChain,
- Int rightGridChainStartIndex,
- primStream* pStream)
-{
- if(checkMiddle(rightChain, beginRightIndex, endRightIndex,
- rightGridChain->get_v_value(rightGridChainStartIndex),
- rightGridChain->get_v_value(rightGridChainStartIndex+1))<0)
- {
- sampleRightOneGridStepNoMiddle(rightChain, beginRightIndex, endRightIndex, rightGridChain, rightGridChainStartIndex, pStream);
- return;
- }
-
- //copy into a polygn
- {
- directedLine* poly = NULL;
- sampledLine* sline;
- directedLine* dline;
- gridWrap* grid = rightGridChain->getGrid();
- float vert1[2];
- float vert2[2];
- Int i;
-
- Int innerInd = rightGridChain->getInnerIndex(rightGridChainStartIndex+1);
- Int upperInd = rightGridChain->getUlineIndex(rightGridChainStartIndex);
- Int lowerInd = rightGridChain->getUlineIndex(rightGridChainStartIndex+1);
- Real upperV = rightGridChain->get_v_value(rightGridChainStartIndex);
- Real lowerV = rightGridChain->get_v_value(rightGridChainStartIndex+1);
-
- //the upper gridline
- vert1[1]=vert2[1]=upperV;
- for(i=upperInd;
- i>innerInd;
- i--)
- {
- vert1[0]=grid->get_u_value(i);
- vert2[0]=grid->get_u_value(i-1);
- sline = new sampledLine(vert1, vert2);
- dline = new directedLine(INCREASING, sline);
- if(poly == NULL)
- poly = dline;
- else
- poly->insert(dline);
- }
-
- //the vertical grid line segment
- vert1[0]=vert2[0] = grid->get_u_value(innerInd);
- vert1[1]=upperV;
- vert2[1]=lowerV;
- sline=new sampledLine(vert1, vert2);
- dline=new directedLine(INCREASING, sline);
- if(poly == NULL)
- poly = dline;
- else
- poly->insert(dline);
-
- //the lower grid line
- vert1[1]=vert2[1]=lowerV;
- for(i=innerInd; i<lowerInd; i++)
- {
- vert1[0] = grid->get_u_value(i);
- vert2[0] = grid->get_u_value(i+1);
- sline = new sampledLine(vert1, vert2);
- dline = new directedLine(INCREASING, sline);
- poly->insert(dline);
- }
-
- //the edge connecting lower grid to right chain
- vert1[0]=grid->get_u_value(lowerInd);
- sline = new sampledLine(vert1, rightChain->getVertex(endRightIndex));
- dline = new directedLine(INCREASING, sline);
- poly->insert(dline);
-
-
- //the right Chain
- for(i=endRightIndex; i>beginRightIndex; i--)
- {
- sline = new sampledLine(rightChain->getVertex(i), rightChain->getVertex(i-1));
- dline = new directedLine(INCREASING, sline);
- poly->insert(dline);
- }
-
- //the edge connecting right chain with upper grid
- vert2[1]=upperV;
- vert2[0]=grid->get_u_value(upperInd);
- sline = new sampledLine(rightChain->getVertex(beginRightIndex), vert2);
- dline = new directedLine(INCREASING, sline);
- poly->insert(dline);
- monoTriangulationOpt(poly, pStream);
- //clean up
- poly->deleteSinglePolygonWithSline();
-
- return;
- }
-
- //this following code cannot be reached, but leave it for debuggig purpose.
- Int i;
- //find the maximal U-monotone chain of beginRightIndex, beginRightIndex+1,...
- i=beginRightIndex;
- Real prevU = rightChain->getVertex(i)[0];
- for(i=beginRightIndex+1; i<= endRightIndex; i++){
- Real thisU = rightChain->getVertex(i)[0];
- if(thisU < prevU)
- prevU = thisU;
- else
- break;
- }
- //from beginRightIndex to i-1 is strictly U-monotne
- //if(i-1==beginRightIndex and the vertex of rightchain is on the first
- //gridline, then we should use 2 vertices on the right chain. Of we only
- //use one (begin), we would output degenrate triangles.
- if(i-1 == beginRightIndex && rightChain->getVertex(beginRightIndex)[1] == rightGridChain->get_v_value(rightGridChainStartIndex))
- i++;
-
- Int j = endRightIndex -1;
- if(rightGridChain->getInnerIndex(rightGridChainStartIndex+1) < rightGridChain->getUlineIndex(rightGridChainStartIndex+1))
- {
- j = rightChain->findDecreaseChainFromEnd(i-1/*beginRightIndex*/, endRightIndex);
- Int temp = endRightIndex;
- //now from j+1 to end is strictly U-monotone.
- //if j+1 is on the last grid line, then we wat to skip to the vertex
- //whcih is strictly above the second grid line. This vertex must exist
- //since there is a middle vertex
- if(j+1 == endRightIndex)
- {
- while(rightChain->getVertex(j+1)[1] == rightGridChain->get_v_value(rightGridChainStartIndex+1))
- j--;
-
- monoTriangulation2(rightChain->getVertex(j+1),
- rightGridChain->get_vertex(rightGridChainStartIndex+1),
- rightChain,
- j+2,
- endRightIndex,
- 0, //a decrease chain
- pStream);
-
- temp = j+1;
- }
-
- stripOfFanRight(rightChain, temp, j+1, rightGridChain->getGrid(),
- rightGridChain->getVlineIndex(rightGridChainStartIndex+1),
- rightGridChain->getInnerIndex(rightGridChainStartIndex+1),
- rightGridChain->getUlineIndex(rightGridChainStartIndex+1),
- pStream,
- 0 //the grid line is below the trim line
- );
-
- }
-
-
- stripOfFanRight(rightChain, i-1, beginRightIndex, rightGridChain->getGrid(),
- rightGridChain->getVlineIndex(rightGridChainStartIndex),
- rightGridChain->getInnerIndex(rightGridChainStartIndex+1),
- rightGridChain->getUlineIndex(rightGridChainStartIndex),
- pStream,
- 1 //the grid line is above the trm lines
- );
-
- //monotone triangulate the remaining rightchain together with the
- //two vertices on the two grid v-lines
- Real vert[2][2];
- vert[0][0] = vert[1][0] = rightGridChain->getInner_u_value(rightGridChainStartIndex+1);
- vert[0][1] = rightGridChain->get_v_value(rightGridChainStartIndex);
- vert[1][1] = rightGridChain->get_v_value(rightGridChainStartIndex+1);
-
- monoTriangulation2(&vert[0][0],
- &vert[1][0],
- rightChain,
- i-1,
- j+1,
- 0, ///a decreae chain
- pStream);
-}
-
-#endif
-
-void stripOfFanRight(vertexArray* rightChain,
- Int largeIndex,
- Int smallIndex,
- gridWrap* grid,
- Int vlineIndex,
- Int ulineSmallIndex,
- Int ulineLargeIndex,
- primStream* pStream,
- Int gridLineUp /*1 if the grid line is above the trim lines*/
- )
-{
- assert(largeIndex >= smallIndex);
-
- Real grid_v_value;
- grid_v_value = grid->get_v_value(vlineIndex);
-
- Real2* trimVerts=(Real2*) malloc(sizeof(Real2)* (largeIndex-smallIndex+1));
- assert(trimVerts);
-
-
- Real2* gridVerts=(Real2*) malloc(sizeof(Real2)* (ulineLargeIndex-ulineSmallIndex+1));
- assert(gridVerts);
-
- Int k,i;
- if(! gridLineUp) /*trim line is above grid line, so trim vertices are going right when index increases*/
- for(k=0, i=smallIndex; i<=largeIndex; i++, k++)
- {
- trimVerts[k][0] = rightChain->getVertex(i)[0];
- trimVerts[k][1] = rightChain->getVertex(i)[1];
- }
- else
- for(k=0, i=largeIndex; i>=smallIndex; i--, k++)
- {
- trimVerts[k][0] = rightChain->getVertex(i)[0];
- trimVerts[k][1] = rightChain->getVertex(i)[1];
- }
-
- for(k=0, i=ulineSmallIndex; i<= ulineLargeIndex; i++, k++)
- {
- gridVerts[k][0] = grid->get_u_value(i);
- gridVerts[k][1] = grid_v_value;
- }
-
- if(gridLineUp)
- triangulateXYMono(
- ulineLargeIndex-ulineSmallIndex+1, gridVerts,
- largeIndex-smallIndex+1, trimVerts,
- pStream);
- else
- triangulateXYMono(largeIndex-smallIndex+1, trimVerts,
- ulineLargeIndex-ulineSmallIndex+1, gridVerts,
- pStream);
- free(trimVerts);
- free(gridVerts);
-}
-
-
-
-
-
-
-
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompRight.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompRight.h
deleted file mode 100755
index eabefedb0..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompRight.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/sampleCompRight.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _SAMPLECOMPRIGHT_H
-#define _SAMPLECOMPRIGHT_H
-
-#define NOT_TAKEOUT
-
-#include "sampleMonoPoly.h"
-void stripOfFanRight(vertexArray* rightChain,
- Int largeIndex,
- Int smallIndex,
- gridWrap* grid,
- Int vlineIndex,
- Int ulineSmallIndex,
- Int ulineLargeIndex,
- primStream* pStream,
- Int gridLineUp /*1 if grid line is above the trim lines */
- );
-
-#ifdef NOT_TAKEOUT
-void sampleRightStripRecF(vertexArray* rightChain,
- Int topRightIndex,
- Int botRightIndex,
- gridBoundaryChain* rightGridChain,
- Int rightGridChainStartIndex,
- Int rightGridChainEndIndex,
- primStream* pStream
- );
-//the degenerate case of sampleRightOneGridStep
-void sampleRightOneGridStepNoMiddle(vertexArray* rightChain,
- Int beginRightIndex,
- Int endRightIndex,
- gridBoundaryChain* rightGridChain,
- Int rightGridChainStartIndex,
- primStream* pStream);
-//sampling the right area in between two grid lines
-//shape: _________|
-void sampleRightOneGridStep(vertexArray* rightChain,
- Int beginRightIndex,
- Int endRightIndex,
- gridBoundaryChain* rightGridChain,
- Int rightGridChainStartIndex,
- primStream* pStream);
-void sampleRightSingleTrimEdgeRegion(Real upperVert[2], Real lowerVert[2],
- gridBoundaryChain* gridChain,
- Int beginIndex,
- Int endIndex,
- primStream* pStream);
-//the degenerate case of sampleRightOneGridStep
-void sampleRightOneGridStepNoMiddle(vertexArray* rightChain,
- Int beginRightIndex,
- Int endRightIndex,
- gridBoundaryChain* rightGridChain,
- Int rightGridChainStartIndex,
- primStream* pStream);
-
-void sampleCompRight(Real* topVertex, Real* botVertex,
- vertexArray* leftChain,
- Int leftStartIndex, Int leftEndIndex,
- vertexArray* rightChain,
- Int rightStartIndex, Int rightEndIndex,
- gridBoundaryChain* rightGridChain,
- Int gridIndex1, Int gridIndex2,
- Int up_leftCornerWhere,
- Int up_leftCornerIndex,
- Int down_leftCornerWhere,
- Int down_leftCornerIndex,
- primStream* pStream);
-
-void sampleRightSingleTrimEdgeRegionGen(Real topVert[2], Real botVert[2],
- vertexArray* rightChain,
- Int rightStart,
- Int rightEnd,
- gridBoundaryChain* gridChain,
- Int gridBegindex,
- Int gridEndIndex,
- vertexArray* leftChain,
- Int leftUpBegin,
- Int leftUpEnd,
- Int leftDownBegin,
- Int leftDownEnd,
- primStream* pStream);
-#endif
-
-#endif
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompTop.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompTop.cc
deleted file mode 100755
index aed0521be..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompTop.cc
+++ /dev/null
@@ -1,1033 +0,0 @@
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompTop.cc,v 1.2 2001/04/01 13:59:57 tsi Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/04/09 16:27:24 $ $Revision: 1.1.1.2 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/sampleCompTop.cc,v 1.1.1.2 2001/04/09 16:27:24 dawes Exp $
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-#include "zlassert.h"
-#include "sampleCompTop.h"
-#include "sampleCompRight.h"
-
-#define max(a,b) ((a>b)? a:b)
-
-//return : index_small, and index_large,
-//from [small, large] is strictly U-monotne,
-//from [large+1, end] is <u
-//and vertex[large][0] is >= u
-//if eveybody is <u, the large = start-1.
-//otherwise both large and small are meaningful and we have start<=small<=large<=end
-void findTopLeftSegment(vertexArray* leftChain,
- Int leftStart,
- Int leftEnd,
- Real u,
- Int& ret_index_small,
- Int& ret_index_large
- )
-{
- Int i;
- assert(leftStart <= leftEnd);
- for(i=leftEnd; i>= leftStart; i--)
- {
- if(leftChain->getVertex(i)[0] >= u)
- break;
- }
- ret_index_large = i;
- if(ret_index_large >= leftStart)
- {
- for(i=ret_index_large; i>leftStart; i--)
- {
- if(leftChain->getVertex(i-1)[0] <= leftChain->getVertex(i)[0])
- break;
- }
- ret_index_small = i;
- }
-}
-
-void findTopRightSegment(vertexArray* rightChain,
- Int rightStart,
- Int rightEnd,
- Real u,
- Int& ret_index_small,
- Int& ret_index_large)
-{
- Int i;
- assert(rightStart<=rightEnd);
- for(i=rightEnd; i>=rightStart; i--)
- {
- if(rightChain->getVertex(i)[0] <= u)
- break;
- }
- ret_index_large = i;
- if(ret_index_large >= rightStart)
- {
- for(i=ret_index_large; i>rightStart;i--)
- {
- if(rightChain->getVertex(i-1)[0] >= rightChain->getVertex(i)[0])
- break;
- }
- ret_index_small = i;
- }
-}
-
-
-void sampleTopRightWithGridLinePost(Real* topVertex,
- vertexArray* rightChain,
- Int rightStart,
- Int segIndexSmall,
- Int segIndexLarge,
- Int rightEnd,
- gridWrap* grid,
- Int gridV,
- Int leftU,
- Int rightU,
- primStream* pStream)
-{
- //the possible section which is to the right of rightU
- if(segIndexLarge < rightEnd)
- {
- Real *tempTop;
- if(segIndexLarge >= rightStart)
- tempTop = rightChain->getVertex(segIndexLarge);
- else
- tempTop = topVertex;
- Real tempBot[2];
- tempBot[0] = grid->get_u_value(rightU);
- tempBot[1] = grid->get_v_value(gridV);
-monoTriangulationRecGenOpt(tempTop, tempBot,
- NULL, 1,0,
- rightChain, segIndexLarge+1, rightEnd,
- pStream);
-/*
- monoTriangulation2(tempTop, tempBot,
- rightChain,
- segIndexLarge+1,
- rightEnd,
- 0, //a decrease chian
- pStream);
-*/
-
- }
-
- //the possible section which is strictly Umonotone
- if(segIndexLarge >= rightStart)
- {
- stripOfFanRight(rightChain, segIndexLarge, segIndexSmall, grid, gridV, leftU, rightU, pStream, 0);
- Real tempBot[2];
- tempBot[0] = grid->get_u_value(leftU);
- tempBot[1] = grid->get_v_value(gridV);
- monoTriangulation2(topVertex, tempBot, rightChain, rightStart, segIndexSmall, 0, pStream);
- }
- else //the topVertex forms a fan with the grid points
- grid->outputFanWithPoint(gridV, leftU, rightU, topVertex, pStream);
-}
-
-void sampleTopRightWithGridLine(Real* topVertex,
- vertexArray* rightChain,
- Int rightStart,
- Int rightEnd,
- gridWrap* grid,
- Int gridV,
- Int leftU,
- Int rightU,
- primStream* pStream
- )
-{
- //if right chian is empty, then there is only one topVertex with one grid line
- if(rightEnd < rightStart){
- grid->outputFanWithPoint(gridV, leftU, rightU, topVertex, pStream);
- return;
- }
-
- Int segIndexSmall, segIndexLarge;
- findTopRightSegment(rightChain,
- rightStart,
- rightEnd,
- grid->get_u_value(rightU),
- segIndexSmall,
- segIndexLarge
- );
- sampleTopRightWithGridLinePost(topVertex, rightChain,
- rightStart,
- segIndexSmall,
- segIndexLarge,
- rightEnd,
- grid,
- gridV,
- leftU,
- rightU,
- pStream);
-}
-
-
-void sampleTopLeftWithGridLinePost(Real* topVertex,
- vertexArray* leftChain,
- Int leftStart,
- Int segIndexSmall,
- Int segIndexLarge,
- Int leftEnd,
- gridWrap* grid,
- Int gridV,
- Int leftU,
- Int rightU,
- primStream* pStream)
-{
- //the possible section which is to the left of leftU
-
- if(segIndexLarge < leftEnd)
- {
- Real *tempTop;
- if(segIndexLarge >= leftStart)
- tempTop = leftChain->getVertex(segIndexLarge);
- else
- tempTop = topVertex;
- Real tempBot[2];
- tempBot[0] = grid->get_u_value(leftU);
- tempBot[1] = grid->get_v_value(gridV);
-
- monoTriangulation2(tempTop, tempBot,
- leftChain,
- segIndexLarge+1,
- leftEnd,
- 1, //a increase chian
- pStream);
- }
-
- //the possible section which is strictly Umonotone
- if(segIndexLarge >= leftStart)
- {
- //if there are grid points which are to the right of topV,
- //then we should use topVertex to form a fan with these points to
- //optimize the triangualtion
- int do_optimize=1;
- if(topVertex[0] >= grid->get_u_value(rightU))
- do_optimize = 0;
- else
- {
- //we also have to make sure that topVertex are the right most vertex
- //on the chain.
- int i;
- for(i=leftStart; i<=segIndexSmall; i++)
- if(leftChain->getVertex(i)[0] >= topVertex[0])
- {
- do_optimize = 0;
- break;
- }
- }
-
- if(do_optimize)
- {
- //find midU so that grid->get_u_value(midU) >= topVertex[0]
- //and grid->get_u_value(midU-1) < topVertex[0]
- int midU=rightU;
- while(grid->get_u_value(midU) >= topVertex[0])
- {
- midU--;
- if(midU < leftU)
- break;
- }
- midU++;
-
- grid->outputFanWithPoint(gridV, midU, rightU, topVertex, pStream);
- stripOfFanLeft(leftChain, segIndexLarge, segIndexSmall, grid, gridV, leftU, midU, pStream, 0);
- Real tempBot[2];
- tempBot[0] = grid->get_u_value(midU);
- tempBot[1] = grid->get_v_value(gridV);
- monoTriangulation2(topVertex, tempBot, leftChain, leftStart, segIndexSmall, 1, pStream);
- }
- else //not optimize
- {
-
- stripOfFanLeft(leftChain, segIndexLarge, segIndexSmall, grid, gridV, leftU, rightU, pStream, 0);
- Real tempBot[2];
- tempBot[0] = grid->get_u_value(rightU);
- tempBot[1] = grid->get_v_value(gridV);
- monoTriangulation2(topVertex, tempBot, leftChain, leftStart, segIndexSmall, 1, pStream);
- }
- }
- else //the topVertex forms a fan with the grid points
- grid->outputFanWithPoint(gridV, leftU, rightU, topVertex, pStream);
-}
-
-
-void sampleTopLeftWithGridLine(Real* topVertex,
- vertexArray* leftChain,
- Int leftStart,
- Int leftEnd,
- gridWrap* grid,
- Int gridV,
- Int leftU,
- Int rightU,
- primStream* pStream
- )
-{
- Int segIndexSmall, segIndexLarge;
- //if left chain is empty, then there is only one top vertex with one grid
- // line
- if(leftEnd < leftStart) {
- grid->outputFanWithPoint(gridV, leftU, rightU, topVertex, pStream);
- return;
- }
- findTopLeftSegment(leftChain,
- leftStart,
- leftEnd,
- grid->get_u_value(leftU),
- segIndexSmall,
- segIndexLarge
- );
- sampleTopLeftWithGridLinePost(topVertex,
- leftChain,
- leftStart,
- segIndexSmall,
- segIndexLarge,
- leftEnd,
- grid,
- gridV,
- leftU,
- rightU,
- pStream);
-}
-
-
-//return 1 if saprator exits, 0 otherwise
-Int findTopSeparator(vertexArray* leftChain,
- Int leftStartIndex,
- Int leftEndIndex,
- vertexArray* rightChain,
- Int rightStartIndex,
- Int rightEndIndex,
- Int& ret_sep_left,
- Int& ret_sep_right)
-{
-
- Int oldLeftI, oldRightI, newLeftI, newRightI;
- Int i,j,k;
- Real leftMax /*= leftChain->getVertex(leftEndIndex)[0]*/;
- Real rightMin /*= rightChain->getVertex(rightEndIndex)[0]*/;
- if(leftChain->getVertex(leftEndIndex)[1] > rightChain->getVertex(rightEndIndex)[1]) //left higher
- {
- oldLeftI = leftEndIndex+1;
- oldRightI = rightEndIndex;
- leftMax = leftChain->getVertex(leftEndIndex)[0] - 1.0; //initilza to left of leftU
- rightMin = rightChain->getVertex(rightEndIndex)[0];
- }
- else
- {
- oldLeftI = leftEndIndex;
- oldRightI = rightEndIndex+1;
- leftMax = leftChain->getVertex(leftEndIndex)[0];
- rightMin = rightChain->getVertex(rightEndIndex)[0] + 1.0;
- }
-
- //i: the current working leftChain index,
- //j: the current working rightChain index,
- //if left(i) is higher than right(j), then the two chains beloew right(j) are separated.
- //else the two chains below left(i) are separeated.
- i=leftEndIndex;
- j=rightEndIndex;
- while(1)
- {
- newLeftI = oldLeftI;
- newRightI = oldRightI;
-
- if(i<leftStartIndex) //left chain is done, go through remining right chain.
- {
- for(k=j-1; k>= rightStartIndex; k--)
- {
- if(rightChain->getVertex(k)[0] > leftMax) //no conflict
- {
- //update oldRightI if necessary
- if(rightChain->getVertex(k)[0] < rightMin)
- {
- rightMin = rightChain->getVertex(k)[0];
- oldRightI = k;
- }
- }
- else //there is a conflict
- break; //the for-loop. below right(k-1) is seperated: oldLeftI, oldRightI.
- }
- break; //the while loop
- }
- else if(j<rightStartIndex) //rightChain is done
- {
- for(k=i-1; k>= leftStartIndex; k--)
- {
- if(leftChain->getVertex(k)[0] < rightMin) //no conflict
- {
- //update oldLeftI if necessary
- if(leftChain->getVertex(k)[0] > leftMax)
- {
- leftMax = leftChain->getVertex(k)[0];
- oldLeftI = k;
- }
- }
- else //there is a conflict
- break; //the for loop
- }
- break; //the while loop
- }
- else if(leftChain->getVertex(i)[1] > rightChain->getVertex(j)[1]) //left hgiher
- {
- if(leftChain->getVertex(i)[0] > leftMax) //update leftMax and newLeftI.
- {
- leftMax = leftChain->getVertex(i)[0];
- newLeftI = i;
- }
- for(k=j-1; k>= rightStartIndex; k--) //update rightMin and newRightI.
- {
- if(rightChain->getVertex(k)[1] > leftChain->getVertex(i)[1])
- break;
- if(rightChain->getVertex(k)[0] < rightMin)
- {
- rightMin = rightChain->getVertex(k)[0];
- newRightI = k;
- }
- }
- j = k; //next working j, since j will be higher than i in next loop
- if(leftMax >= rightMin) //there is a conflict
- break;
- else //still no conflict
- {
- oldLeftI = newLeftI;
- oldRightI = newRightI;
- }
- }
- else //right higher
- {
- if(rightChain->getVertex(j)[0] < rightMin)
- {
- rightMin = rightChain->getVertex(j)[0];
- newRightI = j;
- }
- for(k=i-1; k>= leftStartIndex; k--)
- {
- if(leftChain->getVertex(k)[1] > rightChain->getVertex(j)[1])
- break;
- if(leftChain->getVertex(k)[0] > leftMax)
- {
- leftMax = leftChain->getVertex(k)[0];
- newLeftI = k;
- }
- }
- i = k; //next working i, since i will be higher than j next loop
-
- if(leftMax >= rightMin) //there is a conflict
- break;
- else //still no conflict
- {
- oldLeftI = newLeftI;
- oldRightI = newRightI;
- }
- }
- }//end of while loop
- //now oldLeftI and oldRightI are the desired separeator index, notice that there are not necessarily valid
- if(oldLeftI > leftEndIndex || oldRightI > rightEndIndex)
- return 0;
- else
- {
- ret_sep_left = oldLeftI;
- ret_sep_right = oldRightI;
- return 1;
- }
-}
-
-
-void sampleCompTop(Real* topVertex,
- vertexArray* leftChain,
- Int leftStartIndex,
- vertexArray* rightChain,
- Int rightStartIndex,
- gridBoundaryChain* leftGridChain,
- gridBoundaryChain* rightGridChain,
- Int gridIndex1,
- Int up_leftCornerWhere,
- Int up_leftCornerIndex,
- Int up_rightCornerWhere,
- Int up_rightCornerIndex,
- primStream* pStream)
-{
- if(up_leftCornerWhere == 1 && up_rightCornerWhere == 1) //the top is topVertex with possible grid points
- {
- leftGridChain->getGrid()->outputFanWithPoint(leftGridChain->getVlineIndex(gridIndex1),
- leftGridChain->getUlineIndex(gridIndex1),
- rightGridChain->getUlineIndex(gridIndex1),
- topVertex,
- pStream);
- return;
- }
-
- else if(up_leftCornerWhere != 0)
- {
- Real* tempTop;
- Int tempRightStart;
- if(up_leftCornerWhere == 1){
- tempRightStart = rightStartIndex;
- tempTop = topVertex;
- }
- else
- {
- tempRightStart = up_leftCornerIndex+1;
- tempTop = rightChain->getVertex(up_leftCornerIndex);
- }
- sampleTopRightWithGridLine(tempTop, rightChain, tempRightStart, up_rightCornerIndex,
- rightGridChain->getGrid(),
- leftGridChain->getVlineIndex(gridIndex1),
- leftGridChain->getUlineIndex(gridIndex1),
- rightGridChain->getUlineIndex(gridIndex1),
- pStream);
- }
- else if(up_rightCornerWhere != 2)
- {
- Real* tempTop;
- Int tempLeftStart;
- if(up_rightCornerWhere == 1)
- {
- tempLeftStart = leftStartIndex;
- tempTop = topVertex;
- }
- else //0
- {
- tempLeftStart = up_rightCornerIndex+1;
- tempTop = leftChain->getVertex(up_rightCornerIndex);
- }
-/*
- sampleTopLeftWithGridLine(tempTop, leftChain, tempLeftStart, up_leftCornerIndex,
- leftGridChain->getGrid(),
- leftGridChain->getVlineIndex(gridIndex1),
- leftGridChain->getUlineIndex(gridIndex1),
- rightGridChain->getUlineIndex(gridIndex1),
- pStream);
-*/
- sampleCompTopSimple(topVertex,
- leftChain,
- leftStartIndex,
- rightChain,
- rightStartIndex,
- leftGridChain,
- rightGridChain,
- gridIndex1,
- up_leftCornerWhere,
- up_leftCornerIndex,
- up_rightCornerWhere,
- up_rightCornerIndex,
- pStream);
- }
- else //up_leftCornerWhere == 0, up_rightCornerWhere == 2.
- {
- sampleCompTopSimple(topVertex,
- leftChain,
- leftStartIndex,
- rightChain,
- rightStartIndex,
- leftGridChain,
- rightGridChain,
- gridIndex1,
- up_leftCornerWhere,
- up_leftCornerIndex,
- up_rightCornerWhere,
- up_rightCornerIndex,
- pStream);
- return;
-#ifdef NOT_REACHABLE //code is not reachable, for test purpose only
- //the following code is trying to do some optimization, but not quite working, also see sampleCompBot.C:
- Int sep_left, sep_right;
- if(findTopSeparator(leftChain,
- leftStartIndex,
- up_leftCornerIndex,
- rightChain,
- rightStartIndex,
- up_rightCornerIndex,
- sep_left,
- sep_right)
- ) //separator exists
- {
-
- if( leftChain->getVertex(sep_left)[0] >= leftGridChain->get_u_value(gridIndex1) &&
- rightChain->getVertex(sep_right)[0] <= rightGridChain->get_u_value(gridIndex1))
- {
- Int gridSep;
- Int segLeftSmall, segLeftLarge, segRightSmall, segRightLarge;
- Int valid=1; //whether the gridStep is valid or not.
- findTopLeftSegment(leftChain,
- sep_left,
- up_leftCornerIndex,
- leftGridChain->get_u_value(gridIndex1),
- segLeftSmall,
- segLeftLarge);
- findTopRightSegment(rightChain,
- sep_right,
- up_rightCornerIndex,
- rightGridChain->get_u_value(gridIndex1),
- segRightSmall,
- segRightLarge);
- if(leftChain->getVertex(segLeftSmall)[1] >= rightChain->getVertex(segRightSmall)[1])
- {
- gridSep = rightGridChain->getUlineIndex(gridIndex1);
- while(leftGridChain->getGrid()->get_u_value(gridSep) > leftChain->getVertex(segLeftSmall)[0])
- gridSep--;
- if(segLeftSmall<segLeftLarge)
- if(leftGridChain->getGrid()->get_u_value(gridSep) < leftChain->getVertex(segLeftSmall+1)[0])
- {
- valid = 0;
- }
- }
- else
- {
- gridSep = leftGridChain->getUlineIndex(gridIndex1);
- while(leftGridChain->getGrid()->get_u_value(gridSep) < rightChain->getVertex(segRightSmall)[0])
- gridSep++;
- if(segRightSmall<segRightLarge)
- if(leftGridChain->getGrid()->get_u_value(gridSep) > rightChain->getVertex(segRightSmall+1)[0])
- {
- valid = 0;
- }
- }
-
- if(! valid)
- {
- sampleCompTopSimple(topVertex,
- leftChain,
- leftStartIndex,
- rightChain,
- rightStartIndex,
- leftGridChain,
- rightGridChain,
- gridIndex1,
- up_leftCornerWhere,
- up_leftCornerIndex,
- up_rightCornerWhere,
- up_rightCornerIndex,
- pStream);
- }
- else
- {
- sampleTopLeftWithGridLinePost(leftChain->getVertex(segLeftSmall),
- leftChain,
- segLeftSmall+1,
- segLeftSmall+1,
- segLeftLarge,
- up_leftCornerIndex,
- leftGridChain->getGrid(),
- leftGridChain->getVlineIndex(gridIndex1),
- leftGridChain->getUlineIndex(gridIndex1),
- gridSep,
- pStream);
- sampleTopRightWithGridLinePost(rightChain->getVertex(segRightSmall),
- rightChain,
- segRightSmall+1,
- segRightSmall+1,
- segRightLarge,
- up_rightCornerIndex,
- leftGridChain->getGrid(),
- leftGridChain->getVlineIndex(gridIndex1),
- gridSep,
- rightGridChain->getUlineIndex(gridIndex1),
- pStream);
- Real tempBot[2];
- tempBot[0] = leftGridChain->getGrid()->get_u_value(gridSep);
- tempBot[1] = leftGridChain->get_v_value(gridIndex1);
- monoTriangulationRecGen(topVertex, tempBot,
- leftChain, leftStartIndex, segLeftSmall,
- rightChain, rightStartIndex, segRightSmall,
- pStream);
- }
- }//end if both sides have vetices inside the gridboundary points
- else if(leftChain->getVertex(sep_left)[0] >= leftGridChain->get_u_value(gridIndex1)) //left is in, right is nout
- {
-
- Int segLeftSmall, segLeftLarge;
- findTopLeftSegment(leftChain,
- sep_left,
- up_leftCornerIndex,
- leftGridChain->get_u_value(gridIndex1),
- segLeftSmall,
- segLeftLarge);
- assert(segLeftLarge >= sep_left);
- monoTriangulation2(leftChain->getVertex(segLeftLarge),
- leftGridChain->get_vertex(gridIndex1),
- leftChain,
- segLeftLarge+1,
- up_leftCornerIndex,
- 1, //a increase chain,
- pStream);
-
- stripOfFanLeft(leftChain, segLeftLarge, segLeftSmall,
- leftGridChain->getGrid(),
- leftGridChain->getVlineIndex(gridIndex1),
- leftGridChain->getUlineIndex(gridIndex1),
- rightGridChain->getUlineIndex(gridIndex1),
- pStream, 0);
-
-
- monoTriangulationRecGen(topVertex, rightGridChain->get_vertex(gridIndex1),
- leftChain, leftStartIndex, segLeftSmall,
- rightChain, rightStartIndex, up_rightCornerIndex,
- pStream);
- }//end left in right out
- else if(rightChain->getVertex(sep_right)[0] <= rightGridChain->get_u_value(gridIndex1))
- {
- Int segRightSmall, segRightLarge;
- findTopRightSegment(rightChain,
- sep_right,
- up_rightCornerIndex,
- rightGridChain->get_u_value(gridIndex1),
- segRightSmall,
- segRightLarge);
- assert(segRightLarge>=sep_right);
- monoTriangulation2(rightChain->getVertex(segRightLarge),
- rightGridChain->get_vertex(gridIndex1),
- rightChain,
- segRightLarge+1,
- up_rightCornerIndex,
- 0, //a decrease chain
- pStream);
- stripOfFanRight(rightChain, segRightLarge, segRightSmall,
- rightGridChain->getGrid(),
- rightGridChain->getVlineIndex(gridIndex1),
- leftGridChain->getUlineIndex(gridIndex1),
- rightGridChain->getUlineIndex(gridIndex1),
- pStream, 0);
-
-
- monoTriangulationRecGen(topVertex, leftGridChain->get_vertex(gridIndex1),
- leftChain, leftStartIndex, up_leftCornerIndex,
- rightChain, rightStartIndex,segRightSmall,
- pStream);
-
- }//end left out rigth in
- else //left out , right out
- {
-
- sampleCompTopSimple(topVertex,
- leftChain,
- leftStartIndex,
- rightChain,
- rightStartIndex,
- leftGridChain,
- rightGridChain,
- gridIndex1,
- up_leftCornerWhere,
- up_leftCornerIndex,
- up_rightCornerWhere,
- up_rightCornerIndex,
- pStream);
- }//end leftout, right out
- }//end if separator exixts.
- else //no separator
- {
-
- sampleCompTopSimple(topVertex,
- leftChain,
- leftStartIndex,
- rightChain,
- rightStartIndex,
- leftGridChain,
- rightGridChain,
- gridIndex1,
- up_leftCornerWhere,
- up_leftCornerIndex,
- up_rightCornerWhere,
- up_rightCornerIndex,
- pStream);
- }
-#endif
- }//end if 0,2
-}//end if the function
-
-
-static void sampleCompTopSimpleOpt(gridWrap* grid,
- Int gridV,
- Real* topVertex, Real* botVertex,
- vertexArray* inc_chain, Int inc_current, Int inc_end,
- vertexArray* dec_chain, Int dec_current, Int dec_end,
- primStream* pStream)
-{
- if(gridV <= 0 || dec_end<dec_current || inc_end <inc_current)
- {
- monoTriangulationRecGenOpt(topVertex, botVertex,
- inc_chain, inc_current, inc_end,
- dec_chain, dec_current, dec_end,
- pStream);
- return;
- }
- if(grid->get_v_value(gridV+1) >= topVertex[1])
- {
- monoTriangulationRecGenOpt(topVertex, botVertex,
- inc_chain, inc_current, inc_end,
- dec_chain, dec_current, dec_end,
- pStream);
- return;
- }
- Int i,j,k;
- Real currentV = grid->get_v_value(gridV+1);
- if(inc_chain->getVertex(inc_end)[1] <= currentV &&
- dec_chain->getVertex(dec_end)[1] < currentV)
- {
- //find i bottom up so that inc_chain[i]<= curentV and inc_chain[i-1] > currentV,
- //find j botom up so that dec_chain[j] < currentV and dec_chain[j-1] >= currentV
- for(i=inc_end; i >= inc_current; i--)
- {
- if(inc_chain->getVertex(i)[1] > currentV)
- break;
- }
- i++;
- for(j=dec_end; j >= dec_current; j--)
- {
- if(dec_chain->getVertex(j)[1] >= currentV)
- break;
- }
- j++;
- if(inc_chain->getVertex(i)[1] <= dec_chain->getVertex(j)[1])
- {
- //find the k so that dec_chain[k][1] < inc_chain[i][1]
- for(k=j; k<=dec_end; k++)
- {
- if(dec_chain->getVertex(k)[1] < inc_chain->getVertex(i)[1])
- break;
- }
- //we know that dec_chain[j][1] >= inc_chian[i][1]
- //we know that dec_chain[k-1][1]>=inc_chain[i][1]
- //we know that dec_chian[k][1] < inc_chain[i][1]
- //find l in [j, k-1] so that dec_chain[l][0] 0 is closest to
- // inc_chain[i]
- int l;
- int tempI = j;
- Real tempMin = fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(j)[0]);
- for(l=j+1; l<= k-1; l++)
- {
- if(fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(l)[0])
- <= tempMin)
- {
- tempMin = fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(l)[0]);
- tempI = l;
- }
- }
- //inc_chain[i] and dec_chain[tempI] are connected.
- monoTriangulationRecGenOpt(dec_chain->getVertex(tempI),
- botVertex,
- inc_chain, i, inc_end,
- dec_chain, tempI + 1, dec_end,
- pStream);
- //recursively do the rest
- sampleCompTopSimpleOpt(grid,
- gridV+1,
- topVertex, inc_chain->getVertex(i),
- inc_chain, inc_current, i-1,
- dec_chain, dec_current, tempI,
- pStream);
- }
- else
- {
- //find the k so that inc_chain[k][1] <= dec_chain[j][1]
- for(k=i; k<=inc_end; k++)
- {
- if(inc_chain->getVertex(k)[1] <= dec_chain->getVertex(j)[1])
- break;
- }
- //we know that inc_chain[i] > dec_chain[j]
- //we know that inc_chain[k-1][1] > dec_chain[j][1]
- //we know that inc_chain[k][1] <= dec_chain[j][1]
- //so we find l between [i,k-1] so that
- //inc_chain[l][0] is the closet to dec_chain[j][0]
- int tempI = i;
- int l;
- Real tempMin = fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(j)[0]);
- for(l=i+1; l<=k-1; l++)
- {
- if(fabs(inc_chain->getVertex(l)[0] - dec_chain->getVertex(j)[0]) <= tempMin)
- {
- tempMin = fabs(inc_chain->getVertex(l)[0] - dec_chain->getVertex(j)[0]);
- tempI = l;
- }
- }
-
- //inc_chain[tempI] and dec_chain[j] are connected
-
- monoTriangulationRecGenOpt(inc_chain->getVertex(tempI),
- botVertex,
- inc_chain, tempI+1, inc_end,
- dec_chain, j, dec_end,
- pStream);
-
- //recurvesily do the rest
- sampleCompTopSimpleOpt(grid, gridV+1,
- topVertex, dec_chain->getVertex(j),
- inc_chain, inc_current, tempI,
- dec_chain, dec_current, j-1,
- pStream);
- }
- }
- else //go to the next higher gridV
- {
- sampleCompTopSimpleOpt(grid,
- gridV+1,
- topVertex, botVertex,
- inc_chain, inc_current, inc_end,
- dec_chain, dec_current, dec_end,
- pStream);
- }
-}
-
-void sampleCompTopSimple(Real* topVertex,
- vertexArray* leftChain,
- Int leftStartIndex,
- vertexArray* rightChain,
- Int rightStartIndex,
- gridBoundaryChain* leftGridChain,
- gridBoundaryChain* rightGridChain,
- Int gridIndex1,
- Int up_leftCornerWhere,
- Int up_leftCornerIndex,
- Int up_rightCornerWhere,
- Int up_rightCornerIndex,
- primStream* pStream)
-{
- //the plan is to use monotriangulation algortihm.
- Int i,k;
- Real* ActualTop;
- Real* ActualBot;
- Int ActualLeftStart, ActualLeftEnd;
- Int ActualRightStart, ActualRightEnd;
-
- //creat an array to store the points on the grid line
- gridWrap* grid = leftGridChain->getGrid();
- Int gridV = leftGridChain->getVlineIndex(gridIndex1);
- Int gridLeftU = leftGridChain->getUlineIndex(gridIndex1);
- Int gridRightU = rightGridChain->getUlineIndex(gridIndex1);
-
- Real2* gridPoints = (Real2*) malloc(sizeof(Real2) * (gridRightU - gridLeftU +1));
- assert(gridPoints);
-
- for(k=0, i=gridRightU; i>= gridLeftU; i--, k++)
- {
- gridPoints[k][0] = grid->get_u_value(i);
- gridPoints[k][1] = grid->get_v_value(gridV);
- }
-
- if(up_leftCornerWhere != 2)
- ActualRightStart = rightStartIndex;
- else
- ActualRightStart = up_leftCornerIndex+1; //up_leftCornerIndex will be the ActualTop
-
- if(up_rightCornerWhere != 2) //right corner is not on right chain
- ActualRightEnd = rightStartIndex-1; //meaning that there is no actual rigth section
- else
- ActualRightEnd = up_rightCornerIndex;
-
- vertexArray ActualRightChain(max(0, ActualRightEnd-ActualRightStart+1) + gridRightU-gridLeftU+1);
-
- for(i=ActualRightStart; i<= ActualRightEnd; i++)
- ActualRightChain.appendVertex(rightChain->getVertex(i));
- for(i=0; i<gridRightU-gridLeftU+1; i++)
- ActualRightChain.appendVertex(gridPoints[i]);
-
- //determine ActualLeftEnd
- if(up_leftCornerWhere != 0)
- ActualLeftEnd = leftStartIndex-1;
- else
- ActualLeftEnd = up_leftCornerIndex;
-
- if(up_rightCornerWhere != 0)
- ActualLeftStart = leftStartIndex;
- else
- ActualLeftStart = up_rightCornerIndex+1; //up_rightCornerIndex will be the actual top
-
- if(up_leftCornerWhere == 0)
- {
- if(up_rightCornerWhere == 0)
- ActualTop = leftChain->getVertex(up_rightCornerIndex);
- else
- ActualTop = topVertex;
- }
- else if(up_leftCornerWhere == 1)
- ActualTop = topVertex;
- else //up_leftCornerWhere == 2
- ActualTop = rightChain->getVertex(up_leftCornerIndex);
-
- ActualBot = gridPoints[gridRightU - gridLeftU];
-
-
-
-
- if(leftChain->getVertex(ActualLeftEnd)[1] == ActualBot[1])
- {
-/*
- monoTriangulationRecGenOpt(ActualTop, leftChain->getVertex(ActualLeftEnd),
- leftChain,
- ActualLeftStart, ActualLeftEnd-1,
- &ActualRightChain,
- 0,
- ActualRightChain.getNumElements()-1,
- pStream);
-*/
-
- sampleCompTopSimpleOpt(grid, gridV,
- ActualTop, leftChain->getVertex(ActualLeftEnd),
- leftChain,
- ActualLeftStart, ActualLeftEnd-1,
- &ActualRightChain,
- 0,
- ActualRightChain.getNumElements()-1,
- pStream);
-
- }
- else
- {
-/*
- monoTriangulationRecGenOpt(ActualTop, ActualBot, leftChain,
- ActualLeftStart, ActualLeftEnd,
- &ActualRightChain,
- 0, ActualRightChain.getNumElements()-2, //the last is the bot.
- pStream);
-*/
-
- sampleCompTopSimpleOpt(grid, gridV,
- ActualTop, ActualBot, leftChain,
- ActualLeftStart, ActualLeftEnd,
- &ActualRightChain,
- 0, ActualRightChain.getNumElements()-2, //the last is the bot.
- pStream);
-
-
- }
-
- free(gridPoints);
-
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompTop.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompTop.h
deleted file mode 100755
index 51d86fcf0..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompTop.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/sampleCompTop.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _SAMPLECOMPTOP_H
-#define _SAMPLECOMPTOP_H
-
-#include "sampleMonoPoly.h"
-
-void sampleCompTop(Real* topVertex,
- vertexArray* leftChain,
- Int leftStartIndex,
- vertexArray* rightChain,
- Int rightStartIndex,
- gridBoundaryChain* leftGridChain,
- gridBoundaryChain* rightGridChain,
- Int gridIndex1,
- Int up_leftCornerWhere,
- Int up_leftCornerIndex,
- Int up_rightCornerWhere,
- Int up_rightCornerIndex,
- primStream* pStream);
-
-void sampleCompTopSimple(Real* topVertex,
- vertexArray* leftChain,
- Int leftStartIndex,
- vertexArray* rightChain,
- Int rightStartIndex,
- gridBoundaryChain* leftGridChain,
- gridBoundaryChain* rightGridChain,
- Int gridIndex1,
- Int up_leftCornerWhere,
- Int up_leftCornerIndex,
- Int up_rightCornerWhere,
- Int up_rightCornerIndex,
- primStream* pStream);
-
-#endif
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleMonoPoly.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleMonoPoly.cc
deleted file mode 100755
index cae2d2ddb..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleMonoPoly.cc
+++ /dev/null
@@ -1,2426 +0,0 @@
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleMonoPoly.cc,v 1.2 2001/04/01 13:59:58 tsi Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/04/09 16:27:24 $ $Revision: 1.1.1.2 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/sampleMonoPoly.cc,v 1.1.1.2 2001/04/09 16:27:24 dawes Exp $
-*/
-
-#include "gluos.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-
-#ifndef max
-#define max(a,b) ((a>b)? a:b)
-#endif
-#ifndef min
-#define min(a,b) ((a>b)? b:a)
-#endif
-
-#include <GL/gl.h>
-
-#include "glimports.h"
-#include "zlassert.h"
-#include "sampleMonoPoly.h"
-#include "sampleComp.h"
-#include "polyDBG.h"
-#include "partitionX.h"
-
-
-#define ZERO 0.00001
-
-//#define MYDEBUG
-
-//#define SHORTEN_GRID_LINE
-//see work/newtess/internal/test/problems
-
-
-/*split a polygon so that each vertex correcpond to one edge
- *the head of the first edge of the returned plygon must be the head of the first
- *edge of the origianl polygon. This is crucial for the code in sampleMonoPoly function
- */
- directedLine* polygonConvert(directedLine* polygon)
-{
- int i;
- directedLine* ret;
- sampledLine* sline;
- sline = new sampledLine(2);
- sline->setPoint(0, polygon->getVertex(0));
- sline->setPoint(1, polygon->getVertex(1));
- ret=new directedLine(INCREASING, sline);
- for(i=1; i<= polygon->get_npoints()-2; i++)
- {
- sline = new sampledLine(2);
- sline->setPoint(0, polygon->getVertex(i));
- sline->setPoint(1, polygon->getVertex(i+1));
- ret->insert(new directedLine(INCREASING, sline));
- }
-
- for(directedLine *temp = polygon->getNext(); temp != polygon; temp = temp->getNext())
- {
- for(i=0; i<= temp->get_npoints()-2; i++)
- {
- sline = new sampledLine(2);
- sline->setPoint(0, temp->getVertex(i));
- sline->setPoint(1, temp->getVertex(i+1));
- ret->insert(new directedLine(INCREASING, sline));
- }
- }
- return ret;
-}
-
-void triangulateConvexPolyVertical(directedLine* topV, directedLine* botV, primStream *pStream)
-{
- Int i,j;
- Int n_leftVerts;
- Int n_rightVerts;
- Real** leftVerts;
- Real** rightVerts;
- directedLine* tempV;
- n_leftVerts = 0;
- for(tempV = topV; tempV != botV; tempV = tempV->getNext())
- {
- n_leftVerts += tempV->get_npoints();
- }
- n_rightVerts=0;
- for(tempV = botV; tempV != topV; tempV = tempV->getNext())
- {
- n_rightVerts += tempV->get_npoints();
- }
-
- Real2* temp_leftVerts = (Real2 *) malloc(sizeof(Real2) * n_leftVerts);
- assert(temp_leftVerts);
- Real2* temp_rightVerts = (Real2 *) malloc(sizeof(Real2) * n_rightVerts);
- assert(temp_rightVerts);
-
- leftVerts = (Real**) malloc(sizeof(Real2*) * n_leftVerts);
- assert(leftVerts);
- rightVerts = (Real**) malloc(sizeof(Real2*) * n_rightVerts);
- assert(rightVerts);
- for(i=0; i<n_leftVerts; i++)
- leftVerts[i] = temp_leftVerts[i];
- for(i=0; i<n_rightVerts; i++)
- rightVerts[i] = temp_rightVerts[i];
-
- i=0;
- for(tempV = topV; tempV != botV; tempV = tempV->getNext())
- {
- for(j=1; j<tempV->get_npoints(); j++)
- {
- leftVerts[i][0] = tempV->getVertex(j)[0];
- leftVerts[i][1] = tempV->getVertex(j)[1];
- i++;
- }
- }
- n_leftVerts = i;
- i=0;
- for(tempV = topV->getPrev(); tempV != botV->getPrev(); tempV = tempV->getPrev())
- {
- for(j=tempV->get_npoints()-1; j>=1; j--)
- {
- rightVerts[i][0] = tempV->getVertex(j)[0];
- rightVerts[i][1] = tempV->getVertex(j)[1];
- i++;
- }
- }
- n_rightVerts = i;
- triangulateXYMonoTB(n_leftVerts, leftVerts, n_rightVerts, rightVerts, pStream);
- free(leftVerts);
- free(rightVerts);
- free(temp_leftVerts);
- free(temp_rightVerts);
-}
-
-void triangulateConvexPolyHoriz(directedLine* leftV, directedLine* rightV, primStream *pStream)
-{
- Int i,j;
- Int n_lowerVerts;
- Int n_upperVerts;
- Real2 *lowerVerts;
- Real2 *upperVerts;
- directedLine* tempV;
- n_lowerVerts=0;
- for(tempV = leftV; tempV != rightV; tempV = tempV->getNext())
- {
- n_lowerVerts += tempV->get_npoints();
- }
- n_upperVerts=0;
- for(tempV = rightV; tempV != leftV; tempV = tempV->getNext())
- {
- n_upperVerts += tempV->get_npoints();
- }
- lowerVerts = (Real2 *) malloc(sizeof(Real2) * n_lowerVerts);
- assert(n_lowerVerts);
- upperVerts = (Real2 *) malloc(sizeof(Real2) * n_upperVerts);
- assert(n_upperVerts);
- i=0;
- for(tempV = leftV; tempV != rightV; tempV = tempV->getNext())
- {
- for(j=0; j<tempV->get_npoints(); j++)
- {
- lowerVerts[i][0] = tempV->getVertex(j)[0];
- lowerVerts[i][1] = tempV->getVertex(j)[1];
- i++;
- }
- }
- i=0;
- for(tempV = leftV->getPrev(); tempV != rightV->getPrev(); tempV = tempV->getPrev())
- {
- for(j=tempV->get_npoints()-1; j>=0; j--)
- {
- upperVerts[i][0] = tempV->getVertex(j)[0];
- upperVerts[i][1] = tempV->getVertex(j)[1];
- i++;
- }
- }
- triangulateXYMono(n_upperVerts, upperVerts, n_lowerVerts, lowerVerts, pStream);
- free(lowerVerts);
- free(upperVerts);
-}
-void triangulateConvexPoly(directedLine* polygon, Int ulinear, Int vlinear, primStream* pStream)
-{
- /*find left, right, top , bot
- */
- directedLine* tempV;
- directedLine* topV;
- directedLine* botV;
- directedLine* leftV;
- directedLine* rightV;
- topV = botV = polygon;
-
- for(tempV = polygon->getNext(); tempV != polygon; tempV = tempV->getNext())
- {
- if(compV2InY(topV->head(), tempV->head())<0) {
-
- topV = tempV;
- }
- if(compV2InY(botV->head(), tempV->head())>0) {
-
- botV = tempV;
- }
- }
- //find leftV
- for(tempV = topV; tempV != botV; tempV = tempV->getNext())
- {
- if(tempV->tail()[0] >= tempV->head()[0])
- break;
- }
- leftV = tempV;
- //find rightV
- for(tempV = botV; tempV != topV; tempV = tempV->getNext())
- {
- if(tempV->tail()[0] <= tempV->head()[0])
- break;
- }
- rightV = tempV;
- if(vlinear)
- {
- triangulateConvexPolyHoriz( leftV, rightV, pStream);
- }
- else if(ulinear)
- {
- triangulateConvexPolyVertical(topV, botV, pStream);
- }
- else
- {
- if(DBG_is_U_direction(polygon))
- {
- triangulateConvexPolyHoriz( leftV, rightV, pStream);
- }
- else
- triangulateConvexPolyVertical(topV, botV, pStream);
- }
-}
-
-/*for debug purpose*/
-void drawCorners(
- Real* topV, Real* botV,
- vertexArray* leftChain,
- vertexArray* rightChain,
- gridBoundaryChain* leftGridChain,
- gridBoundaryChain* rightGridChain,
- Int gridIndex1,
- Int gridIndex2,
- Int leftCornerWhere,
- Int leftCornerIndex,
- Int rightCornerWhere,
- Int rightCornerIndex,
- Int bot_leftCornerWhere,
- Int bot_leftCornerIndex,
- Int bot_rightCornerWhere,
- Int bot_rightCornerIndex)
-{
- Real* leftCornerV;
- Real* rightCornerV;
- Real* bot_leftCornerV;
- Real* bot_rightCornerV;
-
- if(leftCornerWhere == 1)
- leftCornerV = topV;
- else if(leftCornerWhere == 0)
- leftCornerV = leftChain->getVertex(leftCornerIndex);
- else
- leftCornerV = rightChain->getVertex(leftCornerIndex);
-
- if(rightCornerWhere == 1)
- rightCornerV = topV;
- else if(rightCornerWhere == 0)
- rightCornerV = leftChain->getVertex(rightCornerIndex);
- else
- rightCornerV = rightChain->getVertex(rightCornerIndex);
-
- if(bot_leftCornerWhere == 1)
- bot_leftCornerV = botV;
- else if(bot_leftCornerWhere == 0)
- bot_leftCornerV = leftChain->getVertex(bot_leftCornerIndex);
- else
- bot_leftCornerV = rightChain->getVertex(bot_leftCornerIndex);
-
- if(bot_rightCornerWhere == 1)
- bot_rightCornerV = botV;
- else if(bot_rightCornerWhere == 0)
- bot_rightCornerV = leftChain->getVertex(bot_rightCornerIndex);
- else
- bot_rightCornerV = rightChain->getVertex(bot_rightCornerIndex);
-
- Real topGridV = leftGridChain->get_v_value(gridIndex1);
- Real topGridU1 = leftGridChain->get_u_value(gridIndex1);
- Real topGridU2 = rightGridChain->get_u_value(gridIndex1);
- Real botGridV = leftGridChain->get_v_value(gridIndex2);
- Real botGridU1 = leftGridChain->get_u_value(gridIndex2);
- Real botGridU2 = rightGridChain->get_u_value(gridIndex2);
-
- glBegin(GL_LINE_STRIP);
- glVertex2fv(leftCornerV);
- glVertex2f(topGridU1, topGridV);
- glEnd();
-
- glBegin(GL_LINE_STRIP);
- glVertex2fv(rightCornerV);
- glVertex2f(topGridU2, topGridV);
- glEnd();
-
- glBegin(GL_LINE_STRIP);
- glVertex2fv(bot_leftCornerV);
- glVertex2f(botGridU1, botGridV);
- glEnd();
-
- glBegin(GL_LINE_STRIP);
- glVertex2fv(bot_rightCornerV);
- glVertex2f(botGridU2, botGridV);
- glEnd();
-
-
-}
-
-void toVertexArrays(directedLine* topV, directedLine* botV, vertexArray& leftChain, vertexArray& rightChain)
-{
- Int i;
- directedLine* tempV;
- for(i=1; i<=topV->get_npoints()-2; i++) { /*the first vertex is the top vertex which doesn't belong to inc_chain*/
- leftChain.appendVertex(topV->getVertex(i));
- }
- for(tempV = topV->getNext(); tempV != botV; tempV = tempV->getNext())
- {
- for(i=0; i<=tempV->get_npoints()-2; i++){
- leftChain.appendVertex(tempV->getVertex(i));
- }
- }
-
- for(tempV = topV->getPrev(); tempV != botV; tempV = tempV->getPrev())
- {
- for(i=tempV->get_npoints()-2; i>=0; i--){
- rightChain.appendVertex(tempV->getVertex(i));
- }
- }
- for(i=botV->get_npoints()-2; i>=1; i--){
- rightChain.appendVertex(tempV->getVertex(i));
- }
-}
-
-
-void findTopAndBot(directedLine* polygon, directedLine*& topV, directedLine*& botV)
-{
- assert(polygon);
- directedLine* tempV;
- topV = botV = polygon;
- for(tempV = polygon->getNext(); tempV != polygon; tempV = tempV->getNext())
- {
- if(compV2InY(topV->head(), tempV->head())<0) {
- topV = tempV;
- }
- if(compV2InY(botV->head(), tempV->head())>0) {
- botV = tempV;
- }
- }
-}
-
-void findGridChains(directedLine* topV, directedLine* botV,
- gridWrap* grid,
- gridBoundaryChain*& leftGridChain,
- gridBoundaryChain*& rightGridChain)
-{
- /*find the first(top) and the last (bottom) grid line which intersect the
- *this polygon
- */
- Int firstGridIndex; /*the index in the grid*/
- Int lastGridIndex;
-
- firstGridIndex = (Int) ((topV->head()[1] - grid->get_v_min()) / (grid->get_v_max() - grid->get_v_min()) * (grid->get_n_vlines()-1));
-
- if(botV->head()[1] < grid->get_v_min())
- lastGridIndex = 0;
- else
- lastGridIndex = (Int) ((botV->head()[1] - grid->get_v_min()) / (grid->get_v_max() - grid->get_v_min()) * (grid->get_n_vlines()-1)) + 1;
-
- /*find the interval inside the polygon for each gridline*/
- Int *leftGridIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1));
- assert(leftGridIndices);
- Int *rightGridIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1));
- assert(rightGridIndices);
- Int *leftGridInnerIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1));
- assert(leftGridInnerIndices);
- Int *rightGridInnerIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1));
- assert(rightGridInnerIndices);
-
- findLeftGridIndices(topV, firstGridIndex, lastGridIndex, grid, leftGridIndices, leftGridInnerIndices);
-
- findRightGridIndices(topV, firstGridIndex, lastGridIndex, grid, rightGridIndices, rightGridInnerIndices);
-
- leftGridChain = new gridBoundaryChain(grid, firstGridIndex, firstGridIndex-lastGridIndex+1, leftGridIndices, leftGridInnerIndices);
-
- rightGridChain = new gridBoundaryChain(grid, firstGridIndex, firstGridIndex-lastGridIndex+1, rightGridIndices, rightGridInnerIndices);
-
- free(leftGridIndices);
- free(rightGridIndices);
- free(leftGridInnerIndices);
- free(rightGridInnerIndices);
-}
-
-void findDownCorners(Real *botVertex,
- vertexArray *leftChain, Int leftChainStartIndex, Int leftChainEndIndex,
- vertexArray *rightChain, Int rightChainStartIndex, Int rightChainEndIndex,
- Real v,
- Real uleft,
- Real uright,
- Int& ret_leftCornerWhere, /*0: left chain, 1: topvertex, 2: rightchain*/
- Int& ret_leftCornerIndex, /*useful when ret_leftCornerWhere == 0 or 2*/
- Int& ret_rightCornerWhere, /*0: left chain, 1: topvertex, 2: rightchain*/
- Int& ret_rightCornerIndex /*useful when ret_leftCornerWhere == 0 or 2*/
- )
-{
-#ifdef MYDEBUG
-printf("*************enter find donw corner\n");
-printf("finddownCorner: v=%f, uleft=%f, uright=%f\n", v, uleft, uright);
-printf("(%i,%i,%i,%i)\n", leftChainStartIndex, leftChainEndIndex,rightChainStartIndex, rightChainEndIndex);
-printf("left chain is\n");
-leftChain->print();
-printf("right chain is\n");
-rightChain->print();
-#endif
-
- assert(v > botVertex[1]);
- Real leftGridPoint[2];
- leftGridPoint[0] = uleft;
- leftGridPoint[1] = v;
- Real rightGridPoint[2];
- rightGridPoint[0] = uright;
- rightGridPoint[1] = v;
-
- Int i;
- Int index1, index2;
-
- index1 = leftChain->findIndexBelowGen(v, leftChainStartIndex, leftChainEndIndex);
- index2 = rightChain->findIndexBelowGen(v, rightChainStartIndex, rightChainEndIndex);
-
- if(index2 <= rightChainEndIndex) //index2 was found above
- index2 = rightChain->skipEqualityFromStart(v, index2, rightChainEndIndex);
-
- if(index1>leftChainEndIndex && index2 > rightChainEndIndex) /*no point below v on left chain or right chain*/
- {
-
- /*the botVertex is the only vertex below v*/
- ret_leftCornerWhere = 1;
- ret_rightCornerWhere = 1;
- }
- else if(index1>leftChainEndIndex ) /*index2 <= rightChainEndIndex*/
- {
-
- ret_rightCornerWhere = 2; /*on right chain*/
- ret_rightCornerIndex = index2;
-
-
- Real tempMin = rightChain->getVertex(index2)[0];
- Real tempI = index2;
- for(i=index2+1; i<= rightChainEndIndex; i++)
- if(rightChain->getVertex(i)[0] < tempMin)
- {
- tempI = i;
- tempMin = rightChain->getVertex(i)[0];
- }
-
-
- //we consider whether we can use botVertex as left corner. First check
- //if (leftGirdPoint, botVertex) interesects right chian or not.
- if(DBG_intersectChain(rightChain, rightChainStartIndex,rightChainEndIndex,
- leftGridPoint, botVertex))
- {
- ret_leftCornerWhere = 2;//right
- ret_leftCornerIndex = index2; //should use tempI???
- }
- else if(botVertex[0] < tempMin)
- ret_leftCornerWhere = 1; //bot
- else
- {
- ret_leftCornerWhere = 2; //right
- ret_leftCornerIndex = (int)tempI;
- }
- }
- else if(index2> rightChainEndIndex) /*index1<=leftChainEndIndex*/
- {
- ret_leftCornerWhere = 0; /*left chain*/
- ret_leftCornerIndex = index1;
-
- /*find the vertex on the left chain with the maximum u,
- *either this vertex or the botvertex can be used as the right corner
- */
-
- int tempI;
- //skip those points which are equal to v. (avoid degeneratcy)
- for(tempI = index1; tempI <= leftChainEndIndex; tempI++)
- if(leftChain->getVertex(tempI)[1] < v)
- break;
- if(tempI > leftChainEndIndex)
- ret_rightCornerWhere = 1;
- else
- {
- Real tempMax = leftChain->getVertex(tempI)[0];
- for(i=tempI; i<= leftChainEndIndex; i++)
- if(leftChain->getVertex(i)[0] > tempMax)
- {
- tempI = i;
- tempMax = leftChain->getVertex(i)[0];
- }
-
-
-
- //we consider whether we can use botVertex as a corner. So first we check
- //whether (rightGridPoint, botVertex) interescts the left chain or not.
- if(DBG_intersectChain(leftChain, leftChainStartIndex,leftChainEndIndex,
- rightGridPoint, botVertex))
- {
- ret_rightCornerWhere = 0;
- ret_rightCornerIndex = index1; //should use tempI???
- }
- else if(botVertex[0] > tempMax)
- {
-
- ret_rightCornerWhere = 1;
- }
- else
- {
- ret_rightCornerWhere = 0;
- ret_rightCornerIndex = tempI;
- }
- }
-
- }
- else /*index1<=leftChainEndIndex and index2 <=rightChainEndIndex*/
- {
- if(leftChain->getVertex(index1)[1] >= rightChain->getVertex(index2)[1]) /*left point above right point*/
- {
- ret_leftCornerWhere = 0; /*on left chain*/
- ret_leftCornerIndex = index1;
-
- Real tempMax;
- Int tempI;
-
- tempI = index1;
- tempMax = leftChain->getVertex(index1)[0];
-
- /*find the maximum u for all the points on the left above the right point index2*/
- for(i=index1+1; i<= leftChainEndIndex; i++)
- {
- if(leftChain->getVertex(i)[1] < rightChain->getVertex(index2)[1])
- break;
-
- if(leftChain->getVertex(i)[0]>tempMax)
- {
- tempI = i;
- tempMax = leftChain->getVertex(i)[0];
- }
- }
- //we consider if we can use rightChain(index2) as right corner
- //we check if (rightChain(index2), rightGidPoint) intersecs left chain or not.
- if(DBG_intersectChain(leftChain, leftChainStartIndex,leftChainEndIndex, rightGridPoint, rightChain->getVertex(index2)))
- {
- ret_rightCornerWhere = 0;
- ret_rightCornerIndex = index1; //should use tempI???
- }
- else if(tempMax >= rightChain->getVertex(index2)[0] ||
- tempMax >= uright
- )
- {
-
- ret_rightCornerWhere = 0; /*on left Chain*/
- ret_rightCornerIndex = tempI;
- }
- else
- {
- ret_rightCornerWhere = 2; /*on right chain*/
- ret_rightCornerIndex = index2;
- }
- }
- else /*left below right*/
- {
- ret_rightCornerWhere = 2; /*on the right*/
- ret_rightCornerIndex = index2;
-
- Real tempMin;
- Int tempI;
-
- tempI = index2;
- tempMin = rightChain->getVertex(index2)[0];
-
- /*find the minimum u for all the points on the right above the left poitn index1*/
- for(i=index2+1; i<= rightChainEndIndex; i++)
- {
- if( rightChain->getVertex(i)[1] < leftChain->getVertex(index1)[1])
- break;
- if(rightChain->getVertex(i)[0] < tempMin)
- {
- tempI = i;
- tempMin = rightChain->getVertex(i)[0];
- }
- }
-
- //we consider if we can use leftchain(index1) as left corner.
- //we check if (leftChain(index1) intersects right chian or not
- if(DBG_intersectChain(rightChain, rightChainStartIndex, rightChainEndIndex, leftGridPoint, leftChain->getVertex(index1)))
- {
- ret_leftCornerWhere = 2;
- ret_leftCornerIndex = index2; //should use tempI???
- }
- else if(tempMin <= leftChain->getVertex(index1)[0] ||
- tempMin <= uleft)
- {
- ret_leftCornerWhere = 2; /* on right chain*/
- ret_leftCornerIndex = tempI;
- }
- else
- {
- ret_leftCornerWhere = 0; /*on left chain*/
- ret_leftCornerIndex = index1;
- }
- }
- }
-
-}
-
-
-void findUpCorners(Real *topVertex,
- vertexArray *leftChain, Int leftChainStartIndex, Int leftChainEndIndex,
- vertexArray *rightChain, Int rightChainStartIndex, Int rightChainEndIndex,
- Real v,
- Real uleft,
- Real uright,
- Int& ret_leftCornerWhere, /*0: left chain, 1: topvertex, 2: rightchain*/
- Int& ret_leftCornerIndex, /*useful when ret_leftCornerWhere == 0 or 2*/
- Int& ret_rightCornerWhere, /*0: left chain, 1: topvertex, 2: rightchain*/
- Int& ret_rightCornerIndex /*useful when ret_leftCornerWhere == 0 or 2*/
- )
-{
-#ifdef MYDEBUG
-printf("***********enter findUpCorners\n");
-#endif
-
- assert(v < topVertex[1]);
- Real leftGridPoint[2];
- leftGridPoint[0] = uleft;
- leftGridPoint[1] = v;
- Real rightGridPoint[2];
- rightGridPoint[0] = uright;
- rightGridPoint[1] = v;
-
- Int i;
- Int index1, index2;
-
- index1 = leftChain->findIndexFirstAboveEqualGen(v, leftChainStartIndex, leftChainEndIndex);
-
-
- index2 = rightChain->findIndexFirstAboveEqualGen(v, rightChainStartIndex, rightChainEndIndex);
-
- if(index2>= leftChainStartIndex) //index2 was found above
- index2 = rightChain->skipEqualityFromStart(v, index2, rightChainEndIndex);
-
- if(index1<leftChainStartIndex && index2 <rightChainStartIndex) /*no point above v on left chain or right chain*/
- {
- /*the topVertex is the only vertex above v*/
- ret_leftCornerWhere = 1;
- ret_rightCornerWhere = 1;
- }
- else if(index1<leftChainStartIndex ) /*index2 >= rightChainStartIndex*/
- {
- ret_rightCornerWhere = 2; /*on right chain*/
- ret_rightCornerIndex = index2;
-
- //find the minimum u on right top, either that, or top, or right[index2] is the left corner
- Real tempMin = rightChain->getVertex(index2)[0];
- Int tempI = index2;
- for(i=index2-1; i>=rightChainStartIndex; i--)
- if(rightChain->getVertex(i)[0] < tempMin)
- {
- tempMin = rightChain->getVertex(i)[0];
- tempI = i;
- }
- //chech whether (leftGridPoint, top) intersects rightchai,
- //if yes, use right corner as left corner
- //if not, use top or right[tempI] as left corner
- if(DBG_intersectChain(rightChain, rightChainStartIndex, rightChainEndIndex,
- leftGridPoint, topVertex))
- {
- ret_leftCornerWhere = 2; //rightChain
- ret_leftCornerIndex = index2;
- }
- else if(topVertex[0] < tempMin)
- ret_leftCornerWhere = 1; /*topvertex*/
- else
- {
- ret_leftCornerWhere = 2; //right chain
- ret_leftCornerIndex = tempI;
- }
-
- }
- else if(index2< rightChainStartIndex) /*index1>=leftChainStartIndex*/
- {
- ret_leftCornerWhere = 0; /*left chain*/
- ret_leftCornerIndex = index1;
-
- //find the maximum u on the left top section. either that or topvertex, or left[index1] is the right corner
- Real tempMax = leftChain->getVertex(index1)[0];
- Int tempI = index1;
-
- for(i=index1-1; i>=leftChainStartIndex; i--){
-
- if(leftChain->getVertex(i)[0] > tempMax)
- {
-
- tempMax = leftChain->getVertex(i)[0];
- tempI = i;
- }
- }
- //check whether (rightGridPoint, top) intersects leftChain or not
- //if yes, we use leftCorner as the right corner
- //if not, we use either top or left[tempI] as the right corner
- if(DBG_intersectChain(leftChain, leftChainStartIndex,leftChainEndIndex,
- rightGridPoint, topVertex))
- {
- ret_rightCornerWhere = 0; //left chan
- ret_rightCornerIndex = index1;
- }
- else if(topVertex[0] > tempMax)
- ret_rightCornerWhere = 1;//topVertex
- else
- {
- ret_rightCornerWhere = 0;//left chain
- ret_rightCornerIndex = tempI;
- }
- }
- else /*index1>=leftChainStartIndex and index2 >=rightChainStartIndex*/
- {
- if(leftChain->getVertex(index1)[1] <= rightChain->getVertex(index2)[1]) /*left point below right point*/
- {
- ret_leftCornerWhere = 0; /*on left chain*/
- ret_leftCornerIndex = index1;
-
- Real tempMax;
- Int tempI;
-
- tempI = index1;
- tempMax = leftChain->getVertex(index1)[0];
-
- /*find the maximum u for all the points on the left below the right point index2*/
- for(i=index1-1; i>= leftChainStartIndex; i--)
- {
- if(leftChain->getVertex(i)[1] > rightChain->getVertex(index2)[1])
- break;
-
- if(leftChain->getVertex(i)[0]>tempMax)
- {
- tempI = i;
- tempMax = leftChain->getVertex(i)[0];
- }
- }
- //chek whether (rightChain(index2), rightGridPoint) intersects leftchian or not
- if(DBG_intersectChain(leftChain, leftChainStartIndex, leftChainEndIndex, rightGridPoint, rightChain->getVertex(index2)))
- {
- ret_rightCornerWhere = 0;
- ret_rightCornerIndex = index1;
- }
- else if(tempMax >= rightChain->getVertex(index2)[0] ||
- tempMax >= uright)
- {
- ret_rightCornerWhere = 0; /*on left Chain*/
- ret_rightCornerIndex = tempI;
- }
- else
- {
- ret_rightCornerWhere = 2; /*on right chain*/
- ret_rightCornerIndex = index2;
- }
- }
- else /*left above right*/
- {
- ret_rightCornerWhere = 2; /*on the right*/
- ret_rightCornerIndex = index2;
-
- Real tempMin;
- Int tempI;
-
- tempI = index2;
- tempMin = rightChain->getVertex(index2)[0];
-
- /*find the minimum u for all the points on the right below the left poitn index1*/
- for(i=index2-1; i>= rightChainStartIndex; i--)
- {
- if( rightChain->getVertex(i)[1] > leftChain->getVertex(index1)[1])
- break;
- if(rightChain->getVertex(i)[0] < tempMin)
- {
- tempI = i;
- tempMin = rightChain->getVertex(i)[0];
- }
- }
- //check whether (leftGRidPoint,left(index1)) interesect right chain
- if(DBG_intersectChain(rightChain, rightChainStartIndex, rightChainEndIndex,
- leftGridPoint, leftChain->getVertex(index1)))
- {
- ret_leftCornerWhere = 2; //right
- ret_leftCornerIndex = index2;
- }
- else if(tempMin <= leftChain->getVertex(index1)[0] ||
- tempMin <= uleft)
- {
- ret_leftCornerWhere = 2; /* on right chain*/
- ret_leftCornerIndex = tempI;
- }
- else
- {
- ret_leftCornerWhere = 0; /*on left chain*/
- ret_leftCornerIndex = index1;
- }
- }
- }
-#ifdef MYDEBUG
-printf("***********leave findUpCorners\n");
-#endif
-}
-
-//return 1 if neck exists, 0 othewise
-Int findNeckF(vertexArray *leftChain, Int botLeftIndex,
- vertexArray *rightChain, Int botRightIndex,
- gridBoundaryChain* leftGridChain,
- gridBoundaryChain* rightGridChain,
- Int gridStartIndex,
- Int& neckLeft,
- Int& neckRight)
-{
-/*
-printf("enter findNeckF, botleft, botright=%i,%i,gstartindex=%i\n",botLeftIndex,botRightIndex,gridStartIndex);
-printf("leftChain is\n");
-leftChain->print();
-printf("rightChain is\n");
-rightChain->print();
-*/
-
- Int lowerGridIndex; //the grid below leftChain and rightChian vertices
- Int i;
- Int n_vlines = leftGridChain->get_nVlines();
- Real v;
- if(botLeftIndex >= leftChain->getNumElements() ||
- botRightIndex >= rightChain->getNumElements())
- return 0; //no neck exists
-
- v=min(leftChain->getVertex(botLeftIndex)[1], rightChain->getVertex(botRightIndex)[1]);
-
-
-
-
- for(i=gridStartIndex; i<n_vlines; i++)
- if(leftGridChain->get_v_value(i) <= v &&
- leftGridChain->getUlineIndex(i)<= rightGridChain->getUlineIndex(i))
- break;
-
- lowerGridIndex = i;
-
- if(lowerGridIndex == n_vlines) //the two trm vertex are higher than all gridlines
- return 0;
- else
- {
- Int botLeft2, botRight2;
-/*
-printf("leftGridChain->get_v_)value=%f\n",leftGridChain->get_v_value(lowerGridIndex), botLeftIndex);
-printf("leftChain->get_vertex(0)=(%f,%f)\n", leftChain->getVertex(0)[0],leftChain->getVertex(0)[1]);
-printf("leftChain->get_vertex(1)=(%f,%f)\n", leftChain->getVertex(1)[0],leftChain->getVertex(1)[1]);
-printf("leftChain->get_vertex(2)=(%f,%f)\n", leftChain->getVertex(2)[0],leftChain->getVertex(2)[1]);
-*/
- botLeft2 = leftChain->findIndexFirstAboveEqualGen(leftGridChain->get_v_value(lowerGridIndex), botLeftIndex, leftChain->getNumElements()-1) -1 ;
-
-/*
-printf("botLeft2=%i\n", botLeft2);
-printf("leftChain->getNumElements=%i\n", leftChain->getNumElements());
-*/
-
- botRight2 = rightChain->findIndexFirstAboveEqualGen(leftGridChain->get_v_value(lowerGridIndex), botRightIndex, rightChain->getNumElements()-1) -1;
- if(botRight2 < botRightIndex) botRight2=botRightIndex;
-
- if(botLeft2 < botLeftIndex) botLeft2 = botLeftIndex;
-
- assert(botLeft2 >= botLeftIndex);
- assert(botRight2 >= botRightIndex);
- //find nectLeft so that it is th erightmost vertex on letChain
-
- Int tempI = botLeftIndex;
- Real temp = leftChain->getVertex(tempI)[0];
- for(i=botLeftIndex+1; i<= botLeft2; i++)
- if(leftChain->getVertex(i)[0] > temp)
- {
- temp = leftChain->getVertex(i)[0];
- tempI = i;
- }
- neckLeft = tempI;
-
- tempI = botRightIndex;
- temp = rightChain->getVertex(tempI)[0];
- for(i=botRightIndex+1; i<= botRight2; i++)
- if(rightChain->getVertex(i)[0] < temp)
- {
- temp = rightChain->getVertex(i)[0];
- tempI = i;
- }
- neckRight = tempI;
- return 1;
- }
-}
-
-
-
-/*find i>=botLeftIndex,j>=botRightIndex so that
- *(leftChain[i], rightChain[j]) is a neck.
- */
-void findNeck(vertexArray *leftChain, Int botLeftIndex,
- vertexArray *rightChain, Int botRightIndex,
- Int& leftLastIndex, /*left point of the neck*/
- Int& rightLastIndex /*right point of the neck*/
- )
-{
- assert(botLeftIndex < leftChain->getNumElements() &&
- botRightIndex < rightChain->getNumElements());
-
- /*now the neck exists for sure*/
-
- if(leftChain->getVertex(botLeftIndex)[1] <= rightChain->getVertex(botRightIndex)[1]) //left below right
- {
-
- leftLastIndex = botLeftIndex;
-
- /*find i so that rightChain[i][1] >= leftchainbotverte[1], and i+1<
- */
- rightLastIndex=rightChain->findIndexAboveGen(leftChain->getVertex(botLeftIndex)[1], botRightIndex+1, rightChain->getNumElements()-1);
- }
- else //left above right
- {
-
- rightLastIndex = botRightIndex;
-
- leftLastIndex = leftChain->findIndexAboveGen(rightChain->getVertex(botRightIndex)[1],
- botLeftIndex+1,
- leftChain->getNumElements()-1);
- }
-}
-
-
-
-void findLeftGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGridIndex, gridWrap* grid, Int* ret_indices, Int* ret_innerIndices)
-{
-
- Int i,k,isHoriz;
- Int n_ulines = grid->get_n_ulines();
- Real uMin = grid->get_u_min();
- Real uMax = grid->get_u_max();
- Real vMin = grid->get_v_min();
- Real vMax = grid->get_v_max();
- Real slop, uinterc;
-
-#ifdef SHORTEN_GRID_LINE
- //uintercBuf stores all the interction u value for each grid line
- //notice that lastGridIndex<= firstGridIndex
- Real *uintercBuf = (Real *) malloc (sizeof(Real) * (firstGridIndex-lastGridIndex+1));
- assert(uintercBuf);
-#endif
-
- /*initialization to make vtail bigger than grid->...*/
- directedLine* dLine = topEdge;
- Real vtail = grid->get_v_value(firstGridIndex) + 1.0;
- Real tempMaxU = grid->get_u_min();
-
-
- /*for each grid line*/
- for(k=0, i=firstGridIndex; i>=lastGridIndex; i--, k++)
- {
-
- Real grid_v_value = grid->get_v_value(i);
-
- /*check whether this grid line is below the current trim edge.*/
- if(vtail > grid_v_value)
- {
- /*since the grid line is below the trim edge, we
- *find the trim edge which will contain the trim line
- */
- while( (vtail=dLine->tail()[1]) > grid_v_value){
-
- tempMaxU = max(tempMaxU, dLine->tail()[0]);
- dLine = dLine -> getNext();
- }
-
- if( fabs(dLine->head()[1] - vtail) < ZERO)
- isHoriz = 1;
- else
- {
- isHoriz = 0;
- slop = (dLine->head()[0] - dLine->tail()[0]) / (dLine->head()[1]-vtail);
- }
- }
-
- if(isHoriz)
- {
- uinterc = max(dLine->head()[0], dLine->tail()[0]);
- }
- else
- {
- uinterc = slop * (grid_v_value - vtail) + dLine->tail()[0];
- }
-
- tempMaxU = max(tempMaxU, uinterc);
-
- if(uinterc < uMin && uinterc >= uMin - ZERO)
- uinterc = uMin;
- if(uinterc > uMax && uinterc <= uMax + ZERO)
- uinterc = uMax;
-
-#ifdef SHORTEN_GRID_LINE
- uintercBuf[k] = uinterc;
-#endif
-
- assert(uinterc >= uMin && uinterc <= uMax);
- if(uinterc == uMax)
- ret_indices[k] = n_ulines-1;
- else
- ret_indices[k] = (Int)(((uinterc-uMin)/(uMax - uMin)) * (n_ulines-1)) + 1;
- if(ret_indices[k] >= n_ulines)
- ret_indices[k] = n_ulines-1;
-
-
- ret_innerIndices[k] = (Int)(((tempMaxU-uMin)/(uMax - uMin)) * (n_ulines-1)) + 1;
-
- /*reinitialize tempMaxU for next grdiLine*/
- tempMaxU = uinterc;
- }
-#ifdef SHORTEN_GRID_LINE
- //for each grid line, compare the left grid point with the
- //intersection point. If the two points are too close, then
- //we should move the grid point one grid to the right
- //and accordingly we should update the inner index.
- for(k=0, i=firstGridIndex; i>=lastGridIndex; i--, k++)
- {
- //check gridLine i
- //check ret_indices[k]
- Real a = grid->get_u_value(ret_indices[k]-1);
- Real b = grid->get_u_value(ret_indices[k]);
- assert(uintercBuf[k] >= a && uintercBuf < b);
- if( (b-uintercBuf[k]) <= 0.2 * (b-a)) //interc is very close to b
- {
- ret_indices[k]++;
- }
-
- //check ret_innerIndices[k]
- if(k>0)
- {
- if(ret_innerIndices[k] < ret_indices[k-1])
- ret_innerIndices[k] = ret_indices[k-1];
- if(ret_innerIndices[k] < ret_indices[k])
- ret_innerIndices[k] = ret_indices[k];
- }
- }
- //clean up
- free(uintercBuf);
-#endif
-}
-
-void findRightGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGridIndex, gridWrap* grid, Int* ret_indices, Int* ret_innerIndices)
-{
-
- Int i,k;
- Int n_ulines = grid->get_n_ulines();
- Real uMin = grid->get_u_min();
- Real uMax = grid->get_u_max();
- Real vMin = grid->get_v_min();
- Real vMax = grid->get_v_max();
- Real slop, uinterc;
-
-#ifdef SHORTEN_GRID_LINE
- //uintercBuf stores all the interction u value for each grid line
- //notice that firstGridIndex >= lastGridIndex
- Real *uintercBuf = (Real *) malloc (sizeof(Real) * (firstGridIndex-lastGridIndex+1));
- assert(uintercBuf);
-#endif
-
- /*initialization to make vhead bigger than grid->v_value...*/
- directedLine* dLine = topEdge->getPrev();
- Real vhead = dLine->tail()[1];
- Real tempMinU = grid->get_u_max();
-
- /*for each grid line*/
- for(k=0, i=firstGridIndex; i>=lastGridIndex; i--, k++)
- {
-
- Real grid_v_value = grid->get_v_value(i);
-
-
- /*check whether this grid line is below the current trim edge.*/
- if(vhead >= grid_v_value)
- {
- /*since the grid line is below the tail of the trim edge, we
- *find the trim edge which will contain the trim line
- */
- while( (vhead=dLine->head()[1]) > grid_v_value){
- tempMinU = min(tempMinU, dLine->head()[0]);
- dLine = dLine -> getPrev();
- }
-
- /*skip the equality in the case of degenerat case: horizontal */
- while(dLine->head()[1] == grid_v_value)
- dLine = dLine->getPrev();
-
- assert( dLine->tail()[1] != dLine->head()[1]);
- slop = (dLine->tail()[0] - dLine->head()[0]) / (dLine->tail()[1]-dLine->head()[1]);
- /*
- if(dLine->tail()[1] == vhead)
- isHoriz = 1;
- else
- {
- isHoriz = 0;
- slop = (dLine->tail()[0] - dLine->head()[0]) / (dLine->tail()[1]-vhead);
- }
- */
- }
- uinterc = slop * (grid_v_value - dLine->head()[1]) + dLine->head()[0];
-
- //in case unterc is outside of the grid due to floating point
- if(uinterc < uMin)
- uinterc = uMin;
- else if(uinterc > uMax)
- uinterc = uMax;
-
-#ifdef SHORTEN_GRID_LINE
- uintercBuf[k] = uinterc;
-#endif
-
- tempMinU = min(tempMinU, uinterc);
-
- assert(uinterc >= uMin && uinterc <= uMax);
-
- if(uinterc == uMin)
- ret_indices[k] = 0;
- else
- ret_indices[k] = (int)ceil((((uinterc-uMin)/(uMax - uMin)) * (n_ulines-1))) -1;
-/*
-if(ret_indices[k] >= grid->get_n_ulines())
- {
- printf("ERROR3\n");
- exit(0);
-}
-if(ret_indices[k] < 0)
- {
- printf("ERROR4\n");
- exit(0);
-}
-*/
- ret_innerIndices[k] = (int)ceil ((((tempMinU-uMin)/(uMax - uMin)) * (n_ulines-1))) -1;
-
- tempMinU = uinterc;
- }
-#ifdef SHORTEN_GRID_LINE
- //for each grid line, compare the left grid point with the
- //intersection point. If the two points are too close, then
- //we should move the grid point one grid to the right
- //and accordingly we should update the inner index.
- for(k=0, i=firstGridIndex; i>=lastGridIndex; i--, k++)
- {
- //check gridLine i
- //check ret_indices[k]
- Real a = grid->get_u_value(ret_indices[k]);
- Real b = grid->get_u_value(ret_indices[k]+1);
- assert(uintercBuf[k] > a && uintercBuf <= b);
- if( (uintercBuf[k]-a) <= 0.2 * (b-a)) //interc is very close to a
- {
- ret_indices[k]--;
- }
-
- //check ret_innerIndices[k]
- if(k>0)
- {
- if(ret_innerIndices[k] > ret_indices[k-1])
- ret_innerIndices[k] = ret_indices[k-1];
- if(ret_innerIndices[k] > ret_indices[k])
- ret_innerIndices[k] = ret_indices[k];
- }
- }
- //clean up
- free(uintercBuf);
-#endif
-}
-
-
-void sampleMonoPoly(directedLine* polygon, gridWrap* grid, Int ulinear, Int vlinear, primStream* pStream, rectBlockArray* rbArray)
-{
-/*
-{
-grid->print();
-polygon->writeAllPolygons("zloutputFile");
-exit(0);
-}
-*/
-
-if(grid->get_n_ulines() == 2 ||
- grid->get_n_vlines() == 2)
-{
- if(ulinear && grid->get_n_ulines() == 2)
- {
- monoTriangulationFun(polygon, compV2InY, pStream);
- return;
- }
- else if(DBG_isConvex(polygon) && polygon->numEdges() >=4)
- {
- triangulateConvexPoly(polygon, ulinear, vlinear, pStream);
- return;
- }
- else if(vlinear || DBG_is_U_direction(polygon))
- {
- Int n_cusps;//num interior cusps
- Int n_edges = polygon->numEdges();
- directedLine** cusps = (directedLine**) malloc(sizeof(directedLine*) * n_edges);
- assert(cusps);
- findInteriorCuspsX(polygon, n_cusps, cusps);
-
- if(n_cusps == 0) //u_monotone
- {
-
- monoTriangulationFun(polygon, compV2InX, pStream);
-
- free(cusps);
- return;
- }
- else if(n_cusps == 1) //one interior cusp
- {
-
- directedLine* new_polygon = polygonConvert(cusps[0]);
-
- directedLine* other = findDiagonal_singleCuspX( new_polygon);
-
-
-
- //<other> should NOT be null unless there are self-intersecting
- //trim curves. In that case, we don't want to core dump, instead,
- //we triangulate anyway, and print out error message.
- if(other == NULL)
- {
- monoTriangulationFun(polygon, compV2InX, pStream);
- free(cusps);
- return;
- }
-
- directedLine* ret_p1;
- directedLine* ret_p2;
-
- new_polygon->connectDiagonal_2slines(new_polygon, other,
- &ret_p1,
- &ret_p2,
- new_polygon);
-
- monoTriangulationFun(ret_p1, compV2InX, pStream);
- monoTriangulationFun(ret_p2, compV2InX, pStream);
-
- ret_p1->deleteSinglePolygonWithSline();
- ret_p2->deleteSinglePolygonWithSline();
-
- free(cusps);
- return;
- }
- free(cusps);
- }
-}
-
- /*find the top and bottom of the polygon. It is supposed to be
- *a V-monotone polygon
- */
-
- directedLine* tempV;
- directedLine* topV;
- directedLine* botV;
- topV = botV = polygon;
-
- for(tempV = polygon->getNext(); tempV != polygon; tempV = tempV->getNext())
- {
- if(compV2InY(topV->head(), tempV->head())<0) {
-
- topV = tempV;
- }
- if(compV2InY(botV->head(), tempV->head())>0) {
-
- botV = tempV;
- }
- }
-
- /*find the first(top) and the last (bottom) grid line which intersect the
- *this polygon
- */
- Int firstGridIndex; /*the index in the grid*/
- Int lastGridIndex;
- firstGridIndex = (Int) ((topV->head()[1] - grid->get_v_min()) / (grid->get_v_max() - grid->get_v_min()) * (grid->get_n_vlines()-1));
- lastGridIndex = (Int) ((botV->head()[1] - grid->get_v_min()) / (grid->get_v_max() - grid->get_v_min()) * (grid->get_n_vlines()-1)) + 1;
-
-
- /*find the interval inside the polygon for each gridline*/
- Int *leftGridIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1));
- assert(leftGridIndices);
- Int *rightGridIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1));
- assert(rightGridIndices);
- Int *leftGridInnerIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1));
- assert(leftGridInnerIndices);
- Int *rightGridInnerIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1));
- assert(rightGridInnerIndices);
-
- findLeftGridIndices(topV, firstGridIndex, lastGridIndex, grid, leftGridIndices, leftGridInnerIndices);
-
- findRightGridIndices(topV, firstGridIndex, lastGridIndex, grid, rightGridIndices, rightGridInnerIndices);
-
- gridBoundaryChain leftGridChain(grid, firstGridIndex, firstGridIndex-lastGridIndex+1, leftGridIndices, leftGridInnerIndices);
-
- gridBoundaryChain rightGridChain(grid, firstGridIndex, firstGridIndex-lastGridIndex+1, rightGridIndices, rightGridInnerIndices);
-
-
-
-// leftGridChain.draw();
-// leftGridChain.drawInner();
-// rightGridChain.draw();
-// rightGridChain.drawInner();
- /*(1) determine the grid boundaries (left and right).
- *(2) process polygon into two monotone chaines: use vertexArray
- *(3) call sampleMonoPolyRec
- */
-
- /*copy the two chains into vertexArray datastructure*/
- Int i;
- vertexArray leftChain(20); /*this is a dynamic array*/
- for(i=1; i<=topV->get_npoints()-2; i++) { /*the first vertex is the top vertex which doesn't belong to inc_chain*/
- leftChain.appendVertex(topV->getVertex(i));
- }
- for(tempV = topV->getNext(); tempV != botV; tempV = tempV->getNext())
- {
- for(i=0; i<=tempV->get_npoints()-2; i++){
- leftChain.appendVertex(tempV->getVertex(i));
- }
- }
-
- vertexArray rightChain(20);
- for(tempV = topV->getPrev(); tempV != botV; tempV = tempV->getPrev())
- {
- for(i=tempV->get_npoints()-2; i>=0; i--){
- rightChain.appendVertex(tempV->getVertex(i));
- }
- }
- for(i=botV->get_npoints()-2; i>=1; i--){
- rightChain.appendVertex(tempV->getVertex(i));
- }
-
- sampleMonoPolyRec(topV->head(),
- botV->head(),
- &leftChain,
- 0,
- &rightChain,
- 0,
- &leftGridChain,
- &rightGridChain,
- 0,
- pStream,
- rbArray);
-
-
- /*cleanup space*/
- free(leftGridIndices);
- free(rightGridIndices);
- free(leftGridInnerIndices);
- free(rightGridInnerIndices);
-}
-
-void sampleMonoPolyRec(
- Real* topVertex,
- Real* botVertex,
- vertexArray* leftChain,
- Int leftStartIndex,
- vertexArray* rightChain,
- Int rightStartIndex,
- gridBoundaryChain* leftGridChain,
- gridBoundaryChain* rightGridChain,
- Int gridStartIndex,
- primStream* pStream,
- rectBlockArray* rbArray)
-{
-
- /*find the first connected component, and the four corners.
- */
- Int index1, index2; /*the first and last grid line of the first connected component*/
-
- if(topVertex[1] <= botVertex[1])
- return;
-
- /*find i so that the grid line is below the top vertex*/
- Int i=gridStartIndex;
- while (i < leftGridChain->get_nVlines())
- {
- if(leftGridChain->get_v_value(i) < topVertex[1])
- break;
- i++;
- }
-
- /*find the first connected component starting with i*/
- /*find index1 so that left_uline_index <= right_uline_index, that is, this
- *grid line contains at least one inner grid point
- */
- index1=i;
- int num_skipped_grid_lines=0;
- while(index1 < leftGridChain->get_nVlines())
- {
- if(leftGridChain->getUlineIndex(index1) <= rightGridChain->getUlineIndex(index1))
- break;
- num_skipped_grid_lines++;
- index1++;
- }
-
-
-
- if(index1 >= leftGridChain->get_nVlines()) /*no grid line exists which has inner point*/
- {
- /*stop recursion, ...*/
- /*monotone triangulate it...*/
-// printf("no grid line exists\n");
-/*
- monoTriangulationRecOpt(topVertex, botVertex, leftChain, leftStartIndex,
- rightChain, rightStartIndex, pStream);
-*/
-
-if(num_skipped_grid_lines <2)
- {
- monoTriangulationRecGenOpt(topVertex, botVertex, leftChain, leftStartIndex,
- leftChain->getNumElements()-1,
- rightChain, rightStartIndex,
- rightChain->getNumElements()-1,
- pStream);
- }
-else
- {
- //the optimum way to triangulate is top-down since this polygon
- //is narrow-long.
- monoTriangulationRec(topVertex, botVertex, leftChain, leftStartIndex,
- rightChain, rightStartIndex, pStream);
- }
-
-/*
- monoTriangulationRec(topVertex, botVertex, leftChain, leftStartIndex,
- rightChain, rightStartIndex, pStream);
-*/
-
-/* monoTriangulationRecGenTBOpt(topVertex, botVertex,
- leftChain, leftStartIndex, leftChain->getNumElements()-1,
- rightChain, rightStartIndex, rightChain->getNumElements()-1,
- pStream);*/
-
-
-
- }
- else
- {
-
- /*find index2 so that left_inner_index <= right_inner_index holds until index2*/
- index2=index1+1;
- if(index2 < leftGridChain->get_nVlines())
- while(leftGridChain->getInnerIndex(index2) <= rightGridChain->getInnerIndex(index2))
- {
- index2++;
- if(index2 >= leftGridChain->get_nVlines())
- break;
- }
-
- index2--;
-
-
-
- /*the neck*/
- Int neckLeftIndex;
- Int neckRightIndex;
-
- /*the four corners*/
- Int up_leftCornerWhere;
- Int up_leftCornerIndex;
- Int up_rightCornerWhere;
- Int up_rightCornerIndex;
- Int down_leftCornerWhere;
- Int down_leftCornerIndex;
- Int down_rightCornerWhere;
- Int down_rightCornerIndex;
-
- Real* tempBotVertex; /*the bottom vertex for this component*/
- Real* nextTopVertex=NULL; /*for the recursion*/
- Int nextLeftStartIndex=0;
- Int nextRightStartIndex=0;
-
- /*find the points below the grid line index2 on both chains*/
- Int botLeftIndex = leftChain->findIndexStrictBelowGen(
- leftGridChain->get_v_value(index2),
- leftStartIndex,
- leftChain->getNumElements()-1);
- Int botRightIndex = rightChain->findIndexStrictBelowGen(
- rightGridChain->get_v_value(index2),
- rightStartIndex,
- rightChain->getNumElements()-1);
- /*if either botLeftIndex>= numelements,
- * or botRightIndex >= numelemnet,
- *then there is no neck exists. the bottom vertex is botVertex,
- */
- if(! findNeckF(leftChain, botLeftIndex, rightChain, botRightIndex,
- leftGridChain, rightGridChain, index2, neckLeftIndex, neckRightIndex))
- /*
- if(botLeftIndex == leftChain->getNumElements() ||
- botRightIndex == rightChain->getNumElements())
- */
- {
-#ifdef MYDEBUG
- printf("neck NOT exists, botRightIndex=%i\n", botRightIndex);
-#endif
-
- tempBotVertex = botVertex;
- nextTopVertex = botVertex;
- botLeftIndex = leftChain->getNumElements()-1;
- botRightIndex = rightChain->getNumElements()-1;
- }
- else /*neck exists*/
- {
-#ifdef MYDEBUG
- printf("neck exists\n");
-#endif
-
- /*
- findNeck(leftChain, botLeftIndex,
- rightChain, botRightIndex,
- neckLeftIndex,
- neckRightIndex);
- */
-#ifdef MYDEBUG
-printf("neck is found, neckLeftIndex=%i, neckRightIndex=%i\n", neckLeftIndex, neckRightIndex);
-glBegin(GL_LINES);
-glVertex2fv(leftChain->getVertex(neckLeftIndex));
-glVertex2fv(rightChain->getVertex(neckRightIndex));
-glEnd();
-#endif
-
- if(leftChain->getVertex(neckLeftIndex)[1] <= rightChain->getVertex(neckRightIndex)[1])
- {
- tempBotVertex = leftChain->getVertex(neckLeftIndex);
- botLeftIndex = neckLeftIndex-1;
- botRightIndex = neckRightIndex;
- nextTopVertex = rightChain->getVertex(neckRightIndex);
- nextLeftStartIndex = neckLeftIndex;
- nextRightStartIndex = neckRightIndex+1;
- }
- else
- {
- tempBotVertex = rightChain->getVertex(neckRightIndex);
- botLeftIndex = neckLeftIndex;
- botRightIndex = neckRightIndex-1;
- nextTopVertex = leftChain->getVertex(neckLeftIndex);
- nextLeftStartIndex = neckLeftIndex+1;
- nextRightStartIndex = neckRightIndex;
- }
- }
-
- findUpCorners(topVertex,
- leftChain,
- leftStartIndex, botLeftIndex,
- rightChain,
- rightStartIndex, botRightIndex,
- leftGridChain->get_v_value(index1),
- leftGridChain->get_u_value(index1),
- rightGridChain->get_u_value(index1),
- up_leftCornerWhere,
- up_leftCornerIndex,
- up_rightCornerWhere,
- up_rightCornerIndex);
-
- findDownCorners(tempBotVertex,
- leftChain,
- leftStartIndex, botLeftIndex,
- rightChain,
- rightStartIndex, botRightIndex,
- leftGridChain->get_v_value(index2),
- leftGridChain->get_u_value(index2),
- rightGridChain->get_u_value(index2),
- down_leftCornerWhere,
- down_leftCornerIndex,
- down_rightCornerWhere,
- down_rightCornerIndex);
-#ifdef MYDEBUG
- printf("find corners done, down_leftwhere=%i, down_righwhere=%i,\n",down_leftCornerWhere, down_rightCornerWhere );
- printf("find corners done, up_leftwhere=%i, up_righwhere=%i,\n",up_leftCornerWhere, up_rightCornerWhere );
- printf("find corners done, up_leftindex=%i, up_righindex=%i,\n",up_leftCornerIndex, up_rightCornerIndex );
- printf("find corners done, down_leftindex=%i, down_righindex=%i,\n",down_leftCornerIndex, down_rightCornerIndex );
-#endif
-
-/*
- drawCorners(topVertex,
- tempBotVertex,
- leftChain,
- rightChain,
- leftGridChain,
- rightGridChain,
- index1,
- index2,
- up_leftCornerWhere,
- up_leftCornerIndex,
- up_rightCornerWhere,
- up_rightCornerIndex,
- down_leftCornerWhere,
- down_leftCornerIndex,
- down_rightCornerWhere,
- down_rightCornerIndex);
-*/
-
-
- sampleConnectedComp(topVertex, tempBotVertex,
- leftChain,
- leftStartIndex, botLeftIndex,
- rightChain,
- rightStartIndex, botRightIndex,
- leftGridChain,
- rightGridChain,
- index1, index2,
- up_leftCornerWhere,
- up_leftCornerIndex,
- up_rightCornerWhere,
- up_rightCornerIndex,
- down_leftCornerWhere,
- down_leftCornerIndex,
- down_rightCornerWhere,
- down_rightCornerIndex,
- pStream,
- rbArray
- );
-
- /*recursion*/
-
- sampleMonoPolyRec(
- nextTopVertex,
- botVertex,
- leftChain,
- nextLeftStartIndex,
- rightChain,
- nextRightStartIndex,
- leftGridChain,
- rightGridChain,
- index2+1,
- pStream, rbArray);
-
-
- }
-
-}
-
-void sampleLeftStrip(vertexArray* leftChain,
- Int topLeftIndex,
- Int botLeftIndex,
- gridBoundaryChain* leftGridChain,
- Int leftGridChainStartIndex,
- Int leftGridChainEndIndex,
- primStream* pStream
- )
-{
- assert(leftChain->getVertex(topLeftIndex)[1] > leftGridChain->get_v_value(leftGridChainStartIndex));
- assert(leftChain->getVertex(topLeftIndex+1)[1] <= leftGridChain->get_v_value(leftGridChainStartIndex));
- assert(leftChain->getVertex(botLeftIndex)[1] <= leftGridChain->get_v_value(leftGridChainEndIndex));
- assert(leftChain->getVertex(botLeftIndex-1)[1] > leftGridChain->get_v_value(leftGridChainEndIndex));
-
- /*
- *(1)find the last grid line which doesn'; pass below
- * this first edge, sample this region: one trim edge and
- * possily multiple grid lines.
- */
- Real *upperVert, *lowerVert; /*the end points of the first trim edge*/
- upperVert = leftChain->getVertex(topLeftIndex);
- lowerVert = leftChain->getVertex(topLeftIndex+1);
-
- Int index = leftGridChainStartIndex;
- while(leftGridChain->get_v_value(index) >= lowerVert[1]){
- index++;
- if(index > leftGridChainEndIndex)
- break;
- }
- index--;
-
- sampleLeftSingleTrimEdgeRegion(upperVert, lowerVert,
- leftGridChain,
- leftGridChainStartIndex,
- index,
- pStream);
- sampleLeftStripRec(leftChain, topLeftIndex+1, botLeftIndex,
- leftGridChain, index, leftGridChainEndIndex,
- pStream);
-
-}
-
-void sampleLeftStripRec(vertexArray* leftChain,
- Int topLeftIndex,
- Int botLeftIndex,
- gridBoundaryChain* leftGridChain,
- Int leftGridChainStartIndex,
- Int leftGridChainEndIndex,
- primStream* pStream
- )
-{
- /*now top left trim vertex is below the top grid line.
- */
- /*stop condition: if topLeftIndex >= botLeftIndex, then stop.
- */
- if(topLeftIndex >= botLeftIndex)
- return;
-
- /*find the last trim vertex which is above the second top grid line:
- * index1.
- *and sampleLeftOneGridStep(leftchain, topLeftIndex, index1, leftGridChain,
- * leftGridChainStartIndex).
- * index1 could be equal to topLeftIndex.
- */
- Real secondGridChainV = leftGridChain->get_v_value(leftGridChainStartIndex+1);
- assert(leftGridChainStartIndex < leftGridChainEndIndex);
- Int index1 = topLeftIndex;
- while(leftChain->getVertex(index1)[1] > secondGridChainV)
- index1++;
- index1--;
-
- sampleLeftOneGridStep(leftChain, topLeftIndex, index1, leftGridChain, leftGridChainStartIndex, pStream);
-
-
- /*
- * Let the next trim vertex be nextTrimVertIndex (which should be
- * below the second grid line).
- * Find the last grid line index2 which is above nextTrimVert.
- * sampleLeftSingleTrimEdgeRegion(uppervert[2], lowervert[2],
- * leftGridChain, leftGridChainStartIndex+1, index2).
- */
- Real *uppervert, *lowervert;
- uppervert = leftChain->getVertex(index1);
- lowervert = leftChain->getVertex(index1+1);
- Int index2 = leftGridChainStartIndex+1;
-
- while(leftGridChain->get_v_value(index2) >= lowervert[1])
- {
- index2++;
- if(index2 > leftGridChainEndIndex)
- break;
- }
- index2--;
- sampleLeftSingleTrimEdgeRegion(uppervert, lowervert, leftGridChain, leftGridChainStartIndex+1, index2, pStream);
-
- /* sampleLeftStripRec(leftChain,
- nextTrimVertIndex,
- botLeftIndex,
- leftGridChain,
- index2,
- leftGridChainEndIndex
- )
- *
- */
- sampleLeftStripRec(leftChain, index1+1, botLeftIndex, leftGridChain, index2, leftGridChainEndIndex, pStream);
-
-}
-
-
-/***************begin RecF***********************/
-/* the gridlines from leftGridChainStartIndex to
- * leftGridChainEndIndex are assumed to form a
- * connected component.
- * the trim vertex of topLeftIndex is assumed to
- * be below the first gridline, and the tim vertex
- * of botLeftIndex is assumed to be above the last
- * grid line.
- * If botLeftIndex < topLeftIndex, then no connected componeent exists, and this funcion returns without
- * outputing any triangles.
- * Otherwise botLeftIndex >= topLeftIndex, there is at least one triangle to output.
- */
-void sampleLeftStripRecF(vertexArray* leftChain,
- Int topLeftIndex,
- Int botLeftIndex,
- gridBoundaryChain* leftGridChain,
- Int leftGridChainStartIndex,
- Int leftGridChainEndIndex,
- primStream* pStream
- )
-{
- /*now top left trim vertex is below the top grid line.
- */
- /*stop condition: if topLeftIndex > botLeftIndex, then stop.
- */
- if(topLeftIndex > botLeftIndex)
- return;
-
- /*if there is only one grid Line, return.*/
-
- if(leftGridChainStartIndex>=leftGridChainEndIndex)
- return;
-
-
- assert(leftChain->getVertex(topLeftIndex)[1] <= leftGridChain->get_v_value(leftGridChainStartIndex) &&
- leftChain->getVertex(botLeftIndex)[1] >= leftGridChain->get_v_value(leftGridChainEndIndex));
-
- /*firs find the first trim vertex which is below or equal to the second top grid line:
- * index1.
- */
- Real secondGridChainV = leftGridChain->get_v_value(leftGridChainStartIndex+1);
-
-
- Int index1 = topLeftIndex;
-
- while(leftChain->getVertex(index1)[1] > secondGridChainV){
- index1++;
- if(index1>botLeftIndex)
- break;
- }
-
- /*now leftChain->getVertex(index-1)[1] > secondGridChainV and
- * leftChain->getVertex(index)[1] <= secondGridChainV
- *If equality holds, then we should include the vertex index1, otherwise we include only index1-1, to
- *perform sampleOneGridStep.
- */
- if(index1>botLeftIndex)
- index1--;
- else if(leftChain->getVertex(index1)[1] < secondGridChainV)
- index1--;
-
- /*now we have leftChain->getVertex(index1)[1] >= secondGridChainV, and
- * leftChain->getVertex(index1+1)[1] <= secondGridChainV
- */
-
-
- sampleLeftOneGridStep(leftChain, topLeftIndex, index1, leftGridChain, leftGridChainStartIndex, pStream);
-
-
- /*if leftChain->getVertex(index1)[1] == secondGridChainV, then we can recursively do the rest.
- */
- if(leftChain->getVertex(index1)[1] == secondGridChainV)
- {
-
- sampleLeftStripRecF(leftChain, index1, botLeftIndex,leftGridChain, leftGridChainStartIndex+1, leftGridChainEndIndex, pStream);
- }
- else if(index1 < botLeftIndex)
- {
-
- /* Otherwise, we have leftChain->getVertex(index1)[1] > secondGridChainV,
- * let the next trim vertex be nextTrimVertIndex (which should be strictly
- * below the second grid line).
- * Find the last grid line index2 which is above nextTrimVert.
- * sampleLeftSingleTrimEdgeRegion(uppervert[2], lowervert[2],
- * leftGridChain, leftGridChainStartIndex+1, index2).
- */
- Real *uppervert, *lowervert;
- uppervert = leftChain->getVertex(index1);
- lowervert = leftChain->getVertex(index1+1); //okay since index1<botLeftIndex
- Int index2 = leftGridChainStartIndex+1;
-
-
- while(leftGridChain->get_v_value(index2) >= lowervert[1])
- {
- index2++;
- if(index2 > leftGridChainEndIndex)
- break;
- }
- index2--;
-
-
- sampleLeftSingleTrimEdgeRegion(uppervert, lowervert, leftGridChain, leftGridChainStartIndex+1, index2, pStream);
-
- /*recursion*/
-
- sampleLeftStripRecF(leftChain, index1+1, botLeftIndex, leftGridChain, index2, leftGridChainEndIndex, pStream);
- }
-
-}
-
-/***************End RecF***********************/
-
-/*sample the left area in between one trim edge and multiple grid lines.
- * all the grid lines should be in between the two end poins of the
- *trim edge.
- */
-void sampleLeftSingleTrimEdgeRegion(Real upperVert[2], Real lowerVert[2],
- gridBoundaryChain* gridChain,
- Int beginIndex,
- Int endIndex,
- primStream* pStream)
-{
- Int i,j,k;
-
- vertexArray vArray(endIndex-beginIndex+1);
- vArray.appendVertex(gridChain->get_vertex(beginIndex));
-
- for(k=1, i=beginIndex+1; i<=endIndex; i++, k++)
- {
- vArray.appendVertex(gridChain->get_vertex(i));
-
- /*output the fan of the grid points of the (i)th and (i-1)th grid line.
- */
- if(gridChain->getUlineIndex(i) < gridChain->getUlineIndex(i-1))
- {
- pStream->begin();
- pStream->insert(gridChain->get_vertex(i-1));
- for(j=gridChain->getUlineIndex(i); j<= gridChain->getUlineIndex(i-1); j++)
- pStream->insert(gridChain->getGrid()->get_u_value(j), gridChain->get_v_value(i));
- pStream->end(PRIMITIVE_STREAM_FAN);
- }
- else if(gridChain->getUlineIndex(i) > gridChain->getUlineIndex(i-1))
- {
- pStream->begin();
- pStream->insert(gridChain->get_vertex(i));
- for(j=gridChain->getUlineIndex(i); j>= gridChain->getUlineIndex(i-1); j--)
- pStream->insert(gridChain->getGrid()->get_u_value(j), gridChain->get_v_value(i-1));
- pStream->end(PRIMITIVE_STREAM_FAN);
- }
- /*otherwisem, the two are equal, so there is no fan to outout*/
- }
-
- monoTriangulation2(upperVert, lowerVert, &vArray, 0, endIndex-beginIndex,
- 0, /*decreasing chain*/
- pStream);
-}
-
-/*return i, such that from begin to i-1 the chain is strictly u-monotone.
- */
-Int findIncreaseChainFromBegin(vertexArray* chain, Int begin ,Int end)
-{
- Int i=begin;
- Real prevU = chain->getVertex(i)[0];
- Real thisU;
- for(i=begin+1; i<=end; i++){
- thisU = chain->getVertex(i)[0];
-
- if(prevU < thisU){
- prevU = thisU;
- }
- else
- break;
- }
- return i;
-}
-
-/*check whether there is a vertex whose v value is strictly
- *inbetween vup vbelow
- *if no middle exists return -1, else return the idnex.
- */
-Int checkMiddle(vertexArray* chain, Int begin, Int end,
- Real vup, Real vbelow)
-{
- Int i;
- for(i=begin; i<=end; i++)
- {
- if(chain->getVertex(i)[1] < vup && chain->getVertex(i)[1]>vbelow)
- return i;
- }
- return -1;
-}
-
-/*the degenerat case of sampleLeftOneGridStep*/
-void sampleLeftOneGridStepNoMiddle(vertexArray* leftChain,
- Int beginLeftIndex,
- Int endLeftIndex,
- gridBoundaryChain* leftGridChain,
- Int leftGridChainStartIndex,
- primStream* pStream)
-{
- /*since there is no middle, there is at most one point which is on the
- *second grid line, there could be multiple points on the first (top)
- *grid line.
- */
-
- leftGridChain->leftEndFan(leftGridChainStartIndex+1, pStream);
-
- monoTriangulation2(leftGridChain->get_vertex(leftGridChainStartIndex),
- leftGridChain->get_vertex(leftGridChainStartIndex+1),
- leftChain,
- beginLeftIndex,
- endLeftIndex,
- 1, //is increase chain.
- pStream);
-}
-
-
-
-/*sampling the left area in between two grid lines.
- */
-void sampleLeftOneGridStep(vertexArray* leftChain,
- Int beginLeftIndex,
- Int endLeftIndex,
- gridBoundaryChain* leftGridChain,
- Int leftGridChainStartIndex,
- primStream* pStream
- )
-{
- if(checkMiddle(leftChain, beginLeftIndex, endLeftIndex,
- leftGridChain->get_v_value(leftGridChainStartIndex),
- leftGridChain->get_v_value(leftGridChainStartIndex+1))<0)
-
- {
-
- sampleLeftOneGridStepNoMiddle(leftChain, beginLeftIndex, endLeftIndex, leftGridChain, leftGridChainStartIndex, pStream);
- return;
- }
-
- //copy into a polygon
- {
- directedLine* poly = NULL;
- sampledLine* sline;
- directedLine* dline;
- gridWrap* grid = leftGridChain->getGrid();
- Real vert1[2];
- Real vert2[2];
- Int i;
-
- Int innerInd = leftGridChain->getInnerIndex(leftGridChainStartIndex+1);
- Int upperInd = leftGridChain->getUlineIndex(leftGridChainStartIndex);
- Int lowerInd = leftGridChain->getUlineIndex(leftGridChainStartIndex+1);
- Real upperV = leftGridChain->get_v_value(leftGridChainStartIndex);
- Real lowerV = leftGridChain->get_v_value(leftGridChainStartIndex+1);
-
- //the upper gridline
- vert1[1] = vert2[1] = upperV;
- for(i=innerInd; i>upperInd; i--)
- {
- vert1[0]=grid->get_u_value(i);
- vert2[0]=grid->get_u_value(i-1);
- sline = new sampledLine(vert1, vert2);
- dline = new directedLine(INCREASING, sline);
- if(poly == NULL)
- poly = dline;
- else
- poly->insert(dline);
- }
-
- //the edge connecting upper grid with left chain
- vert1[0] = grid->get_u_value(upperInd);
- vert1[1] = upperV;
- sline = new sampledLine(vert1, leftChain->getVertex(beginLeftIndex));
- dline = new directedLine(INCREASING, sline);
- if(poly == NULL)
- poly = dline;
- else
- poly->insert(dline);
-
- //the left chain
- for(i=beginLeftIndex; i<endLeftIndex; i++)
- {
- sline = new sampledLine(leftChain->getVertex(i), leftChain->getVertex(i+1));
- dline = new directedLine(INCREASING, sline);
- poly->insert(dline);
- }
-
- //the edge connecting left chain with lower gridline
- vert2[0] = grid->get_u_value(lowerInd);
- vert2[1] = lowerV;
- sline = new sampledLine(leftChain->getVertex(endLeftIndex), vert2);
- dline = new directedLine(INCREASING, sline);
- poly->insert(dline);
-
- //the lower grid line
- vert1[1] = vert2[1] = lowerV;
- for(i=lowerInd; i<innerInd; i++)
- {
- vert1[0] = grid->get_u_value(i);
- vert2[0] = grid->get_u_value(i+1);
- sline = new sampledLine(vert1, vert2);
- dline = new directedLine(INCREASING, sline);
- poly->insert(dline);
- }
-
- //the vertical grid line segement
- vert1[0]=vert2[0] = grid->get_u_value(innerInd);
- vert2[1]=upperV;
- vert1[1]=lowerV;
- sline=new sampledLine(vert1, vert2);
- dline=new directedLine(INCREASING, sline);
- poly->insert(dline);
- monoTriangulationOpt(poly, pStream);
- //cleanup
- poly->deleteSinglePolygonWithSline();
- return;
- }
-
-
-
-
-
- Int i;
- if(1/*leftGridChain->getUlineIndex(leftGridChainStartIndex) >=
- leftGridChain->getUlineIndex(leftGridChainStartIndex+1)*/
- ) /*the second grid line is beyond the first one to the left*/
- {
- /*find the maximal U-monotone chain
- * of endLeftIndex, endLeftIndex-1, ...,
- */
- i=endLeftIndex;
- Real prevU = leftChain->getVertex(i)[0];
- for(i=endLeftIndex-1; i>=beginLeftIndex; i--){
- Real thisU = leftChain->getVertex(i)[0];
- if( prevU < thisU){
- prevU = thisU;
- }
- else
- break;
- }
- /*from endLeftIndex to i+1 is strictly U- monotone */
- /*if i+1==endLeftIndex and the vertex and leftchain is on the second gridline, then
- *we should use 2 vertices on the leftchain. If we only use one (endLeftIndex), then we
- *we would output degenerate triangles
- */
- if(i+1 == endLeftIndex && leftChain->getVertex(endLeftIndex)[1] == leftGridChain->get_v_value(1+leftGridChainStartIndex))
- i--;
-
- Int j = beginLeftIndex/*endLeftIndex*/+1;
-
-
- if(leftGridChain->getInnerIndex(leftGridChainStartIndex+1) > leftGridChain->getUlineIndex(leftGridChainStartIndex))
- {
- j = findIncreaseChainFromBegin(leftChain, beginLeftIndex, i+1/*endLeftIndex*/);
-
- Int temp = beginLeftIndex;
- /*now from begin to j-1 is strictly u-monotone*/
- /*if j-1 is on the first grid line, then we want to skip to the vertex which is strictly
- *below the grid line. This vertexmust exist since there is a 'corner turn' inbetween the two grid lines
- */
- if(j-1 == beginLeftIndex)
- {
- while(leftChain->getVertex(j-1)[1] == leftGridChain->get_v_value(leftGridChainStartIndex))
- j++;
-
- Real vert[2];
- vert[0] = leftGridChain->get_u_value(leftGridChainStartIndex);
- vert[1] = leftGridChain->get_v_value(leftGridChainStartIndex);
-
- monoTriangulation2(
- vert/*leftChain->getVertex(beginLeftIndex)*/,
- leftChain->getVertex(j-1),
- leftChain,
- beginLeftIndex,
- j-2,
- 1,
- pStream //increase chain
- );
-
- temp = j-1;
- }
-
- stripOfFanLeft(leftChain, j-1, temp/*beginLeftIndex*/, leftGridChain->getGrid(),
- leftGridChain->getVlineIndex(leftGridChainStartIndex),
- leftGridChain->getUlineIndex(leftGridChainStartIndex),
- leftGridChain->getInnerIndex(leftGridChainStartIndex+1),
- pStream,
- 1 /*the grid line is above the trim line*/
- );
- }
-
- stripOfFanLeft(leftChain, endLeftIndex, i+1, leftGridChain->getGrid(),
- leftGridChain->getVlineIndex(leftGridChainStartIndex+1),
- leftGridChain->getUlineIndex(leftGridChainStartIndex+1),
- leftGridChain->getInnerIndex(leftGridChainStartIndex+1),
- pStream,
- 0 /*the grid line is below the trim lines*/
- );
-
- /*monotone triangulate the remaining left chain togther with the
- *two vertices on the two grid v-lines.
- */
- Real vert[2][2];
- vert[0][0]=vert[1][0] = leftGridChain->getInner_u_value(leftGridChainStartIndex+1);
- vert[0][1] = leftGridChain->get_v_value(leftGridChainStartIndex);
- vert[1][1] = leftGridChain->get_v_value(leftGridChainStartIndex+1);
-
-// vertexArray right(vert, 2);
-
- monoTriangulation2(
- &vert[0][0], /*top vertex */
- &vert[1][0], /*bottom vertex*/
- leftChain,
- /*beginLeftIndex*/j-1,
- i+1,
- 1, /*an increasing chain*/
- pStream);
- }
- else /*the second one is shorter than the first one to the left*/
- {
- /*find the maximal U-monotone chain of beginLeftIndex, beginLeftIndex+1,...,
- */
- i=beginLeftIndex;
- Real prevU = leftChain->getVertex(i)[0];
- for(i=beginLeftIndex+1; i<=endLeftIndex; i++){
- Real thisU = leftChain->getVertex(i)[0];
-
- if(prevU < thisU){
- prevU = thisU;
- }
- else
- break;
- }
- /*from beginLeftIndex to i-1 is strictly U-monotone*/
-
-
- stripOfFanLeft(leftChain, i-1, beginLeftIndex, leftGridChain->getGrid(),
- leftGridChain->getVlineIndex(leftGridChainStartIndex),
- leftGridChain->getUlineIndex(leftGridChainStartIndex),
- leftGridChain->getUlineIndex(leftGridChainStartIndex+1),
- pStream,
- 1 /*the grid line is above the trim lines*/
- );
- /*monotone triangulate the remaining left chain together with the
- *two vertices on the two grid v-lines.
- */
- Real vert[2][2];
- vert[0][0]=vert[1][0] = leftGridChain->get_u_value(leftGridChainStartIndex+1);
- vert[0][1] = leftGridChain->get_v_value(leftGridChainStartIndex);
- vert[1][1] = leftGridChain->get_v_value(leftGridChainStartIndex+1);
-
- vertexArray right(vert, 2);
-
- monoTriangulation2(
- &vert[0][0], //top vertex
- &vert[1][0], //bottom vertex
- leftChain,
- i-1,
- endLeftIndex,
- 1, /*an increase chain*/
- pStream);
-
- }
-}
-
-/*n_upper>=1
- *n_lower>=1
- */
-void triangulateXYMono(Int n_upper, Real upperVerts[][2],
- Int n_lower, Real lowerVerts[][2],
- primStream* pStream)
-{
- Int i,j,k,l;
- Real* leftMostV;
-
- assert(n_upper>=1 && n_lower>=1);
- if(upperVerts[0][0] <= lowerVerts[0][0])
- {
- i=1;
- j=0;
- leftMostV = upperVerts[0];
- }
- else
- {
- i=0;
- j=1;
- leftMostV = lowerVerts[0];
- }
-
- while(1)
- {
- if(i >= n_upper) /*case1: no more in upper*/
- {
-
- if(j<n_lower-1) /*at least two vertices in lower*/
- {
- pStream->begin();
- pStream->insert(leftMostV);
- while(j<n_lower){
- pStream->insert(lowerVerts[j]);
- j++;
- }
- pStream->end(PRIMITIVE_STREAM_FAN);
- }
-
- break;
- }
- else if(j>= n_lower) /*case2: no more in lower*/
- {
-
- if(i<n_upper-1) /*at least two vertices in upper*/
- {
- pStream->begin();
- pStream->insert(leftMostV);
-
- for(k=n_upper-1; k>=i; k--)
- pStream->insert(upperVerts[k]);
-
- pStream->end(PRIMITIVE_STREAM_FAN);
- }
-
- break;
- }
- else /* case3: neither is empty, plus the leftMostV, there is at least one triangle to output*/
- {
-
- if(upperVerts[i][0] <= lowerVerts[j][0])
- {
- pStream->begin();
- pStream->insert(lowerVerts[j]); /*the origin of this fan*/
-
- /*find the last k>=i such that
- *upperverts[k][0] <= lowerverts[j][0]
- */
- k=i;
- while(k<n_upper)
- {
- if(upperVerts[k][0] > lowerVerts[j][0])
- break;
- k++;
- }
- k--;
- for(l=k; l>=i; l--)/*the reverse is for two-face lighting*/
- {
- pStream->insert(upperVerts[l]);
- }
- pStream->insert(leftMostV);
-
- pStream->end(PRIMITIVE_STREAM_FAN);
- //update i for next loop
- i = k+1;
- leftMostV = upperVerts[k];
-
- }
- else /*upperVerts[i][0] > lowerVerts[j][0]*/
- {
- pStream->begin();
- pStream->insert(upperVerts[i]);/*the origion of this fan*/
- pStream->insert(leftMostV);
- /*find the last k>=j such that
- *lowerverts[k][0] < upperverts[i][0]*/
- k=j;
- while(k< n_lower)
- {
- if(lowerVerts[k][0] >= upperVerts[i][0])
- break;
- pStream->insert(lowerVerts[k]);
- k++;
- }
- pStream->end(PRIMITIVE_STREAM_FAN);
- j=k;
- leftMostV = lowerVerts[j-1];
- }
- }
- }
-}
-
-
-void stripOfFanLeft(vertexArray* leftChain,
- Int largeIndex,
- Int smallIndex,
- gridWrap* grid,
- Int vlineIndex,
- Int ulineSmallIndex,
- Int ulineLargeIndex,
- primStream* pStream,
- Int gridLineUp /*1 if the grid line is above the trim lines*/
- )
-{
- assert(largeIndex >= smallIndex);
-
- Real grid_v_value;
- grid_v_value = grid->get_v_value(vlineIndex);
-
- Real2* trimVerts=(Real2*) malloc(sizeof(Real2)* (largeIndex-smallIndex+1));
- assert(trimVerts);
-
-
- Real2* gridVerts=(Real2*) malloc(sizeof(Real2)* (ulineLargeIndex-ulineSmallIndex+1));
- assert(gridVerts);
-
- Int k,i;
- if(gridLineUp) /*trim line is below grid line, so trim vertices are going right when index increases*/
- for(k=0, i=smallIndex; i<=largeIndex; i++, k++)
- {
- trimVerts[k][0] = leftChain->getVertex(i)[0];
- trimVerts[k][1] = leftChain->getVertex(i)[1];
- }
- else
- for(k=0, i=largeIndex; i>=smallIndex; i--, k++)
- {
- trimVerts[k][0] = leftChain->getVertex(i)[0];
- trimVerts[k][1] = leftChain->getVertex(i)[1];
- }
-
- for(k=0, i=ulineSmallIndex; i<= ulineLargeIndex; i++, k++)
- {
- gridVerts[k][0] = grid->get_u_value(i);
- gridVerts[k][1] = grid_v_value;
- }
-
- if(gridLineUp)
- triangulateXYMono(
- ulineLargeIndex-ulineSmallIndex+1, gridVerts,
- largeIndex-smallIndex+1, trimVerts,
- pStream);
- else
- triangulateXYMono(largeIndex-smallIndex+1, trimVerts,
- ulineLargeIndex-ulineSmallIndex+1, gridVerts,
- pStream);
- free(trimVerts);
- free(gridVerts);
-}
-
-
-
-
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleMonoPoly.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleMonoPoly.h
deleted file mode 100755
index 57604daf2..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleMonoPoly.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/sampleMonoPoly.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _SAMPLEMONOPOLY_H
-#define _SAMPLEMONOPOLY_H
-
-#include "monoTriangulation.h"
-#include "gridWrap.h"
-#include "rectBlock.h"
-
-
-void triangulateXYMono(Int n_upper, Real upperVerts[][2],
- Int n_lower, Real lowerVerts[][2],
- primStream* pStream);
-
-void stripOfFanLeft(vertexArray* leftChain,
- Int largeIndex,
- Int smallIndex,
- gridWrap* grid,
- Int vlineIndex,
- Int ulineSmallIndex,
- Int ulineLargeIndex,
- primStream* pStream,
- Int gridLineUp
- );
-void sampleLeftOneGridStep(vertexArray* leftChain,
- Int beginLeftIndex,
- Int endLeftIndex,
- gridBoundaryChain* leftGridChain,
- Int leftGridChainStartIndex,
- primStream* pStream
- );
-
-void sampleLeftSingleTrimEdgeRegion(Real upperVert[2], Real lowerVert[2],
- gridBoundaryChain* gridChain,
- Int beginIndex,
- Int endIndex,
- primStream* pStream);
-
-void sampleLeftStripRec(vertexArray* leftChain,
- Int topLeftIndex,
- Int botLeftIndex,
- gridBoundaryChain* leftGridChain,
- Int leftGridChainStartIndex,
- Int leftGridChainEndIndex,
- primStream* pStream
- );
-
-void sampleLeftStrip(vertexArray* leftChain,
- Int topLeftIndex,
- Int botLeftIndex,
- gridBoundaryChain* leftGridChain,
- Int leftGridChainStartIndex,
- Int leftGridChainEndIndex,
- primStream* pStream
- );
-
-void findLeftGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGridIndex, gridWrap* grid, Int* ret_indices, Int* ret_inner);
-
-void findRightGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGridIndex, gridWrap* grid, Int* ret_indices, Int* ret_inner);
-
-void sampleMonoPoly(directedLine* polygon, gridWrap* grid, Int ulinear, Int vlinear, primStream *pStream, rectBlockArray* rbArray);
-
-void sampleMonoPolyRec(
- Real* topVertex,
- Real* botVertex,
- vertexArray* leftChain,
- Int leftStartIndex,
- vertexArray* rightChain,
- Int rightStartIndex,
- gridBoundaryChain* leftGridChain,
- gridBoundaryChain* rightGridChain,
- Int gridStartIndex,
- primStream* pStream,
- rectBlockArray* rbArray
- );
-
-void sampleLeftStripRecF(vertexArray* leftChain,
- Int topLeftIndex,
- Int botLeftIndex,
- gridBoundaryChain* leftGridChain,
- Int leftGridChainStartIndex,
- Int leftGridChainEndIndex,
- primStream* pStream
- );
-
-void findUpCorners(Real *topVertex,
- vertexArray *leftChain,
- Int leftChainStartIndex, Int leftChainEndIndex,
- vertexArray *rightChain,
- Int rightChainStartIndex, Int rightChainEndIndex,
- Real v,
- Real uleft,
- Real uright,
- Int& ret_leftCornerWhere,
- Int& ret_leftCornerIndex,
- Int& ret_rightCornerWhere,
- Int& ret_rightCornerIndex
- );
-void findDownCorners(Real *botVertex,
- vertexArray *leftChain, Int leftChainStartIndex, Int leftChainEndIndex,
- vertexArray *rightChain, Int rightChainStartIndex, Int rightChainEndIndex,
- Real v,
- Real uleft,
- Real uright,
- Int& ret_leftCornerWhere,
- Int& ret_leftCornerIndex,
- Int& ret_rightCornerWhere,
- Int& ret_rightCornerIndex
- );
-void findNeck(vertexArray *leftChain, Int botLeftIndex,
- vertexArray *rightChain, Int botRightIndex,
- Int& leftLastIndex, /*left point of the neck*/
- Int& rightLastIndex /*right point of the neck*/
- );
-
-Int findNeckF(vertexArray *leftChain, Int botLeftIndex,
- vertexArray *rightChain, Int botRightIndex,
- gridBoundaryChain* leftGridChain,
- gridBoundaryChain* rightGridChain,
- Int gridStartIndex,
- Int& neckLeft,
- Int& neckRight);
-
-void findTopAndBot(directedLine* polygon,
- directedLine*& topV,
- directedLine*& botV);
-void findGridChains(directedLine* top, directedLine* bot,
- gridWrap* grid,
- gridBoundaryChain*& leftGridChain,
- gridBoundaryChain*& rightGridChain);
-void toVertexArrays(directedLine* topV, directedLine* botV, vertexArray& leftChain, vertexArray& rightChain);
-
-void drawCorners(
- Real* topV, Real* botV,
- vertexArray* leftChain,
- vertexArray* rightChain,
- gridBoundaryChain* leftGridChain,
- gridBoundaryChain* rightGridChain,
- Int gridIndex1,
- Int gridIndex2,
- Int leftCornerWhere,
- Int leftCornerIndex,
- Int rightCornerWhere,
- Int rightCornerIndex,
- Int bot_leftCornerWhere,
- Int bot_leftCornerIndex,
- Int bot_rightCornerWhere,
- Int bot_rightCornerIndex);
-
-Int checkMiddle(vertexArray* chain, Int begin, Int end,
- Real vup, Real vbelow);
-
-#endif
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampledLine.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampledLine.cc
deleted file mode 100755
index 082048c0b..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampledLine.cc
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/sampledLine.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h> //for fabs()
-#include "glimports.h"
-#include "zlassert.h"
-#include "sampledLine.h"
-
-void sampledLine::setPoint(Int i, Real p[2])
-{
- points[i][0]=p[0];
- points[i][1]=p[1];
-}
-
-
-/*insert this single line in front of the oldList*/
-sampledLine* sampledLine::insert(sampledLine *oldList)
-{
- next = oldList;
- return this;
-}
-
-void sampledLine::deleteList()
-{
- sampledLine *temp, *tempNext;
- for(temp = this; temp != NULL; temp = tempNext)
- {
- tempNext = temp->next;
- delete temp;
- }
-}
-
-
-/*space of points[][2] is allocated*/
-sampledLine::sampledLine(Int n_points)
-{
- npoints = n_points;
- points = (Real2*) malloc(sizeof(Real2) * n_points);
- assert(points);
- next = NULL;
-}
-
-/*space of points[][2] is allocated and
- *points are copied
- */
-sampledLine::sampledLine(Int n_points, Real2 pts[])
-{
- int i;
- npoints = n_points;
- points = (Real2*) malloc(sizeof(Real2) * n_points);
- assert(points);
- for(i=0; i<npoints; i++) {
- points[i][0] = pts[i][0];
- points[i][1] = pts[i][1];
- }
- next = NULL;
-}
-
-sampledLine::sampledLine(Real pt1[2], Real pt2[2])
-{
- int i;
- npoints = 2;
- points = (Real2*) malloc(sizeof(Real2) * 2);
- assert(points);
- points[0][0] = pt1[0];
- points[0][1] = pt1[1];
- points[1][0] = pt2[0];
- points[1][1] = pt2[1];
- next = NULL;
-}
-
-//needs tp call init to setup
-sampledLine::sampledLine()
-{
-}
-
-//warning: ONLY pointer is copies!!!
-void sampledLine::init(Int n_points, Real2 *pts)
-{
- npoints = n_points;
- points = pts;
-}
-
-/*points[] is dealocated
- */
-sampledLine::~sampledLine()
-{
- free(points);
-}
-
-void sampledLine::print()
-{
- int i;
- printf("npoints=%i\n", npoints);
-
- for(i=0; i<npoints; i++){
- printf("(%f,%f)\n", points[i][0], points[i][1]);
- }
-
-}
-
-void sampledLine::tessellate(Real u_reso, Real v_reso)
-{
- int i;
-
- Int nu, nv, n;
- nu = 1+(Int) (fabs((points[npoints-1][0] - points[0][0])) * u_reso);
- nv = 1+(Int) (fabs((points[npoints-1][1] - points[0][1])) * v_reso);
-
- if(nu > nv) n = nu;
- else
- n = nv;
- if(n<1)
- n = 1;
- //du dv could be negative
- Real du = (points[npoints-1][0] - points[0][0])/n;
- Real dv = (points[npoints-1][1] - points[0][1])/n;
- Real2 *temp = (Real2*) malloc(sizeof(Real2) * (n+1));
- assert(temp);
-
- Real u,v;
- for(i=0, u=points[0][0], v=points[0][1]; i<n; i++, u+=du, v+=dv)
- {
- temp[i][0] = u;
- temp[i][1] = v;
- }
- temp[n][0] = points[npoints-1][0];
- temp[n][1] = points[npoints-1][1];
-
- free(points);
-
- npoints = n+1;
- points = temp;
-
-}
-
-void sampledLine::tessellateAll(Real u_reso, Real v_reso)
-{
- sampledLine* temp;
- for(temp = this; temp != NULL; temp = temp->next)
- {
- temp->tessellate(u_reso, v_reso);
- }
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampledLine.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampledLine.h
deleted file mode 100755
index 8b9ece79b..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampledLine.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/sampledLine.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _SAMPLEDLINE_H
-#define _SAMPLEDLINE_H
-
-#include "definitions.h"
-
-class sampledLine{
- Int npoints;
- Real2 *points;
-
-public:
- sampledLine(Int n_points);
- sampledLine(Int n_points, Real pts[][2]);
- sampledLine(Real pt1[2], Real pt2[2]);
- sampledLine(); //special, careful about memory
- ~sampledLine();
-
- void init(Int n_points, Real2 *pts);//special, careful about memory
-
- void setPoint(Int i, Real p[2]) ;
-
- sampledLine* insert(sampledLine *nline);
- void deleteList();
-
- Int get_npoints() {return npoints;}
- Real2* get_points() {return points;}
-
- //u_reso is number of segments (may not be integer) per unit u
- void tessellate(Real u_reso, Real v_reso);//n segments
- void tessellateAll(Real u_reso, Real v_reso);
-
- void print();
-
- sampledLine* next;
-};
-
-
-
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/searchTree.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/searchTree.cc
deleted file mode 100755
index 02be9bf96..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/searchTree.cc
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/searchTree.cc,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "zlassert.h"
-
-#include "searchTree.h"
-
-#define max(a,b) ((a>b)? a:b)
-
-treeNode* TreeNodeMake(void *key)
-{
- treeNode *ret = (treeNode*) malloc(sizeof(treeNode));
- assert(ret);
- ret->key = key;
- ret->parent = NULL;
- ret->left = NULL;
- ret->right = NULL;
- return ret;
-}
-
-void TreeNodeDeleteSingleNode(treeNode* node)
-{
- free(node);
-}
-
-void TreeNodeDeleteWholeTree(treeNode* node)
-{
- if(node == NULL) return;
- TreeNodeDeleteWholeTree(node->left);
- TreeNodeDeleteWholeTree(node->right);
- TreeNodeDeleteSingleNode(node);
-}
-
-void TreeNodePrint(treeNode* node,
- void (*keyPrint) (void*))
-{
- if(node ==NULL) return;
- TreeNodePrint(node->left, keyPrint);
- keyPrint(node->key);
- TreeNodePrint(node->right, keyPrint);
-}
-
-int TreeNodeDepth(treeNode* root)
-{
- if(root == NULL) return 0;
- else{
- int leftdepth = TreeNodeDepth(root->left);
- int rightdepth = TreeNodeDepth(root->right);
- return 1 + max(leftdepth, rightdepth);
- }
-}
-
-/*return the node with the key.
- *NULL is returned if not found
- */
-treeNode* TreeNodeFind(treeNode* tree, void* key,
- int (*compkey) (void*, void*))
-{
- if(tree == NULL)
- return NULL;
- if(key == tree->key)
- return tree;
- else if(compkey(key, tree->key) < 0)
- return TreeNodeFind(tree->left, key, compkey);
- else
- return TreeNodeFind(tree->right, key, compkey);
-}
-
-
-treeNode* TreeNodeInsert(treeNode* root, treeNode* newnode,
- int (*compkey) (void *, void *))
-{
- treeNode *y = NULL;
- treeNode *x = root;
- /*going down the tree from the root.
- *x traces the path, y is the parent of x.
- */
- while (x != NULL){
- y = x;
- if(compkey(newnode->key,x->key) < 0) /*if newnode < x*/
- x = x->left;
- else
- x = x->right;
- }
-
- /*now y has the property that
- * if newnode < y, then y->left is NULL
- * if newnode > y, then y->right is NULL.
- *So we want to isnert newnode to be the child of y
- */
- newnode->parent = y;
- if(y == NULL)
- return newnode;
- else if( compkey(newnode->key, y->key) <0)
- {
- y->left = newnode;
- }
- else
- {
- y->right = newnode;
- }
-
- return root;
-}
-
-treeNode* TreeNodeDeleteSingleNode(treeNode* tree, treeNode* node)
-{
- treeNode* y;
- treeNode* x;
- treeNode* ret;
- if(node==NULL) return tree;
-
- if(node->left == NULL || node->right == NULL) {
-
- y = node;
- if(y->left != NULL)
- x = y->left;
- else
- x = y->right;
-
- if( x != NULL)
- x->parent = y->parent;
-
- if(y->parent == NULL) /*y is the root which has at most one child x*/
- ret = x;
- else /*y is not the root*/
- {
- if(y == y->parent->left)
- y->parent->left = x;
- else
- y->parent->right = x;
- ret = tree;
- }
- }
- else { /*node has two children*/
-
- y = TreeNodeSuccessor(node);
- assert(y->left == NULL);
-
- if(y == node->right) /*y is the right child if node*/
- {
- y->parent = node->parent;
- y->left = node->left;
- node->left->parent = y;
-
- }
- else /*y != node->right*/
- {
- x = y->right;
- if(x!= NULL)
- x->parent = y->parent;
-
- assert(y->parent != NULL);
- if(y == y->parent->left)
- y->parent->left = x;
- else
- y->parent->right = x;
- /*move y to the position of node*/
- y->parent = node->parent;
- y->left = node->left;
- y->right = node->right;
- node->left->parent = y;
- node->right->parent = y;
- }
- if(node->parent != NULL) {
- if(node->parent->left == node)
- node->parent->left = y;
- else
- node->parent->right = y;
- ret = tree; /*the root if the tree doesn't change*/
- }
- else /*node->parent is NULL: node is the root*/
- ret = y;
- }
-
- /*finally free the node, and return the new root*/
- TreeNodeDeleteSingleNode(node);
- return ret;
-}
-
-
-/*the minimum node in the tree rooted by node
- */
-treeNode* TreeNodeMinimum(treeNode* node)
-{
- treeNode* temp = node;
- if(temp == NULL) return NULL;
- while(temp->left != NULL) {
- temp = temp->left;
- }
- return temp;
-}
-
-/*the maximum node in the tree rooted by node
- */
-treeNode* TreeNodeMaximum(treeNode* node)
-{
- treeNode* temp = node;
- if(temp == NULL) return NULL;
- while(temp->right != NULL) {
- temp = temp->right;
- }
- return temp;
-}
-
-/*return the first node (in sorted order) which is to the right of this node
- */
-treeNode* TreeNodeSuccessor(treeNode* node)
-{
- if(node == NULL) return NULL;
- if(node->right != NULL)
- return TreeNodeMinimum(node->right);
- else{ /*node->right is NULL*/
-
- /*find the first right-ancestor*/
- treeNode *y = node->parent;
- treeNode* x = node;
- while(y != NULL && x == y->right) /*if y is a left parent of x*/
- {
-
- x = y;
- y = y->parent;
- }
- return y;
- }
-}
-
-/*return the first node (in sorted order) which is to the left of this node
- */
-treeNode* TreeNodePredecessor(treeNode* node)
-{
- if(node == NULL) return NULL;
- if(node->left != NULL)
- return TreeNodeMaximum(node->left);
- else{ /*node->left is NULL*/
- /*find the first left-ancestor*/
- treeNode *y = node->parent;
- treeNode *x = node;
- while(y != NULL && x == y->left) /*if y is a right parent of x*/
- {
- x = y;
- y = y->parent;
- }
- return y;
- }
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/searchTree.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/searchTree.h
deleted file mode 100755
index e36b2c937..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/searchTree.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/searchTree.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef _SEARCHTREE_H
-#define _SEARCHTREE_H
-
-typedef struct treeNode{
- void *key;
- struct treeNode* parent;
- struct treeNode* left; /*children*/
- struct treeNode* right;
-} treeNode;
-
-treeNode* TreeNodeMake(void *key);
-void TreeNodeDeleteSingleNode(treeNode* node);
-void TreeNodeDeleteWholeTree(treeNode* node);
-void TreeNodePrint(treeNode* node,
- void (*keyPrint) (void*));
-int TreeNodeDepth(treeNode* root);
-treeNode* TreeNodeMinimum(treeNode* node);
-treeNode* TreeNodeMaximum(treeNode* node);
-treeNode* TreeNodePredecessor(treeNode* node);
-treeNode* TreeNodeSuccessor(treeNode* node);
-treeNode* TreeNodeFind(treeNode* tree, void* key,
- int (*compkey) (void*, void*));
-
-treeNode* TreeNodeInsert(treeNode* root, treeNode* newnode,
- int (*comp) (void *, void *));
-treeNode* TreeNodeDeleteSingleNode(treeNode* tree, treeNode* node);
-
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/zlassert.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/zlassert.h
deleted file mode 100755
index 77238085f..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/zlassert.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-*/
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/zlassert.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-/*XXXblythe this file should be deleted*/
-#include <assert.h>
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/GNUmakefile b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/GNUmakefile
deleted file mode 100755
index 370b253b6..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/GNUmakefile
+++ /dev/null
@@ -1,110 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/GNUmakefile,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-
-OBJECT_STYLE = N32
-
-include $(ROOT)/usr/include/make/commondefs
-
-TARGET = libtess.a
-
-TARGETS = $(TARGET)
-
-LCINCS = -I../include
-
-# Compilation flags:
-#
-# -DNDEBUG is for the production code; it removes all assertion checks
-# (note that <assert.h> looks at this symbol).
-#
-# -DNO_MALLOPT uses regular malloc instead of the mallopt() version.
-# ***** Unless you use this flag, you must use "-lmalloc" to link
-# ***** your application!
-#
-# -DMEMORY_DEBUG turns on the M_DEBUG option of mallopt; this can
-# increase the running time a LOT.
-#
-# -DGLU_TESS_API_FLOAT compiles a single-precision version of the library.
-#
-# -float prevents automatic promotion to double precision; this will produce
-# faster code when compiled with -DGLU_TESS_API_FLOAT.
-#
-# -DNO_BRANCH_CONDITIONS uses & and | instead of && and || on a couple
-# of heavily-used tests (VertEq and VertLeq); some compilers can generate
-# better code with these (use special instructions to avoid branching).
-#
-# -DFOR_TRITE_TEST_PROGRAM is *only* for use with the test program called
-# "trite". It uses some variables which are defined by the test program,
-# so you won't be able to link it with anything else.
-
-HFILES = \
- dict.h \
- dict-list.h \
- geom.h \
- memalloc.h \
- mesh.h \
- normal.h \
- priorityq-heap.h \
- priorityq-heap.c \
- priorityq-sort.h \
- priorityq.h \
- render.h \
- sweep.h \
- tess.h \
- tessmono.h \
- $(NULL)
-
-CFILES = \
- dict.c \
- geom.c \
- memalloc.c \
- mesh.c \
- normal.c \
- priorityq.c \
- render.c \
- sweep.c \
- tess.c \
- tessmono.c \
- $(NULL)
-
-default libs libs_install install: $(TARGET)
-
-headers headers_install apps:
-
-$(TARGET): $(OBJECTS)
- $(AR) crl $@ $(OBJECTS);
-
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Imakefile b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Imakefile
deleted file mode 100755
index fb99ce22e..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Imakefile
+++ /dev/null
@@ -1,61 +0,0 @@
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-#include <Library.tmpl>
-
-OBJS = \
- dict.o \
- geom.o \
- memalloc.o \
- mesh.o \
- normal.o \
- priorityq.o \
- render.o \
- sweep.o \
- tess.o \
- tessmono.o
-
-INCLUDES = \
- -I../include \
- -I$(TOP)/include \
- -I$(TOP)/include/GL
-
-DEFINES = \
- -DNDEBUG
-
-NormalLibraryObjectRule()
-
-NormalLibraryTarget(tess, $(OBJS))
-
-DependTarget()
-CleanTarget()
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/README b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/README
deleted file mode 100644
index 0e18248f2..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/README
+++ /dev/null
@@ -1,447 +0,0 @@
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/README,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-General Polygon Tesselation
----------------------------
-
- This note describes a tesselator for polygons consisting of one or
- more closed contours. It is backward-compatible with the current
- OpenGL Utilities tesselator, and is intended to replace it. Here is
- a summary of the major differences:
-
- - input contours can be intersecting, self-intersecting, or degenerate.
-
- - supports a choice of several winding rules for determining which parts
- of the polygon are on the "interior". This makes it possible to do
- CSG operations on polygons.
-
- - boundary extraction: instead of tesselating the polygon, returns a
- set of closed contours which separate the interior from the exterior.
-
- - returns the output as a small number of triangle fans and strips,
- rather than a list of independent triangles (when possible).
-
- - output is available as an explicit mesh (a quad-edge structure),
- in addition to the normal callback interface.
-
- - the algorithm used is extremely robust.
-
-
-The interface
--------------
-
- The tesselator state is maintained in a "tesselator object".
- These are allocated and destroyed using
-
- GLUtesselator *gluNewTess( void );
- void gluDeleteTess( GLUtesselator *tess );
-
- Several tesselator objects may be used simultaneously.
-
- Inputs
- ------
-
- The input contours are specified with the following routines:
-
- void gluTessBeginPolygon( GLUtesselator *tess );
- void gluTessBeginContour( GLUtesselator *tess );
- void gluTessVertex( GLUtesselator *tess, GLUcoord coords[3], void *data );
- void gluTessEndContour( GLUtesselator *tess );
- void gluTessEndPolygon( GLUtesselator *tess );
-
- Within each BeginPolygon/EndPolygon pair, there can be zero or more
- calls to BeginContour/EndContour. Within each contour, there are zero
- or more calls to gluTessVertex(). The vertices specify a closed
- contour (the last vertex of each contour is automatically linked to
- the first).
-
- "coords" give the coordinates of the vertex in 3-space. For useful
- results, all vertices should lie in some plane, since the vertices
- are projected onto a plane before tesselation. "data" is a pointer
- to a user-defined vertex structure, which typically contains other
- information such as color, texture coordinates, normal, etc. It is
- used to refer to the vertex during rendering.
-
- The library can be compiled in single- or double-precision; the type
- GLUcoord represents either "float" or "double" accordingly. The GLU
- version will be available in double-precision only. Compile with
- GLU_TESS_API_FLOAT defined to get the single-precision version.
-
- When EndPolygon is called, the tesselation algorithm determines
- which regions are interior to the given contours, according to one
- of several "winding rules" described below. The interior regions
- are then tesselated, and the output is provided as callbacks.
-
-
- Rendering Callbacks
- -------------------
-
- Callbacks are specified by the client using
-
- void gluTessCallback( GLUtesselator *tess, GLenum which, void (*fn)());
-
- If "fn" is NULL, any previously defined callback is discarded.
-
- The callbacks used to provide output are: /* which == */
-
- void begin( GLenum type ); /* GLU_TESS_BEGIN */
- void edgeFlag( GLboolean flag ); /* GLU_TESS_EDGE_FLAG */
- void vertex( void *data ); /* GLU_TESS_VERTEX */
- void end( void ); /* GLU_TESS_END */
-
- Any of the callbacks may be left undefined; if so, the corresponding
- information will not be supplied during rendering.
-
- The "begin" callback indicates the start of a primitive; type is one
- of GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, or GL_TRIANGLES (but see the
- notes on "boundary extraction" below).
-
- It is followed by any number of "vertex" callbacks, which supply the
- vertices in the same order as expected by the corresponding glBegin()
- call. After the last vertex of a given primitive, there is a callback
- to "end".
-
- If the "edgeFlag" callback is provided, no triangle fans or strips
- will be used. When edgeFlag is called, if "flag" is GL_TRUE then each
- vertex which follows begins an edge which lies on the polygon boundary
- (ie. an edge which separates an interior region from an exterior one).
- If "flag" is GL_FALSE, each vertex which follows begins an edge which lies
- in the polygon interior. "edgeFlag" will be called before the first
- call to "vertex".
-
- Other Callbacks
- ---------------
-
- void mesh( GLUmesh *mesh ); /* GLU_TESS_MESH */
-
- - Returns an explicit mesh, represented using the quad-edge structure
- (Guibas/Stolfi '85). Other implementations of this interface might
- use a different mesh structure, so this is available only only as an
- SGI extension. When the mesh is no longer needed, it should be freed
- using
-
- void gluDeleteMesh( GLUmesh *mesh );
-
- There is a brief description of this data structure in the include
- file "mesh.h". For the full details, see L. Guibas and J. Stolfi,
- Primitives for the manipulation of general subdivisions and the
- computation of Voronoi diagrams, ACM Transactions on Graphics,
- 4(2):74-123, April 1985. For an introduction, see the course notes
- for CS348a, "Mathematical Foundations of Computer Graphics",
- available at the Stanford bookstore (and taught during the fall
- quarter).
-
- void error( GLenum errno ); /* GLU_TESS_ERROR */
-
- - errno is one of GLU_TESS_MISSING_BEGIN_POLYGON,
- GLU_TESS_MISSING_END_POLYGON,
- GLU_TESS_MISSING_BEGIN_CONTOUR,
- GLU_TESS_MISSING_END_CONTOUR,
- GLU_TESS_COORD_TOO_LARGE,
- GLU_TESS_NEED_COMBINE_CALLBACK
-
- The first four are obvious. The interface recovers from these
- errors by inserting the missing call(s).
-
- GLU_TESS_COORD_TOO_LARGE says that some vertex coordinate exceeded
- the predefined constant GLU_TESS_MAX_COORD in absolute value, and
- that the value has been clamped. (Coordinate values must be small
- enough so that two can be multiplied together without overflow.)
-
- GLU_TESS_NEED_COMBINE_CALLBACK says that the algorithm detected an
- intersection between two edges in the input data, and the "combine"
- callback (below) was not provided. No output will be generated.
-
-
- void combine( GLUcoord coords[3], void *data[4], /* GLU_TESS_COMBINE */
- GLUcoord weight[4], void **outData );
-
- - When the algorithm detects an intersection, or wishes to merge
- features, it needs to create a new vertex. The vertex is defined
- as a linear combination of up to 4 existing vertices, referenced
- by data[0..3]. The coefficients of the linear combination are
- given by weight[0..3]; these weights always sum to 1.0. All vertex
- pointers are valid even when some of the weights are zero.
- "coords" gives the location of the new vertex.
-
- The user must allocate another vertex, interpolate parameters
- using "data" and "weights", and return the new vertex pointer in
- "outData". This handle is supplied during rendering callbacks.
- For example, if the polygon lies in an arbitrary plane in 3-space,
- and we associate a color with each vertex, the combine callback might
- look like this:
-
- void myCombine( GLUcoord coords[3], VERTEX *d[4],
- GLUcoord w[4], VERTEX **dataOut )
- {
- VERTEX *new = new_vertex();
-
- new->x = coords[0];
- new->y = coords[1];
- new->z = coords[2];
- new->r = w[0]*d[0]->r + w[1]*d[1]->r + w[2]*d[2]->r + w[3]*d[3]->r;
- new->g = w[0]*d[0]->g + w[1]*d[1]->g + w[2]*d[2]->g + w[3]*d[3]->g;
- new->b = w[0]*d[0]->b + w[1]*d[1]->b + w[2]*d[2]->b + w[3]*d[3]->b;
- new->a = w[0]*d[0]->a + w[1]*d[1]->a + w[2]*d[2]->a + w[3]*d[3]->a;
- *dataOut = new;
- }
-
- If the algorithm detects an intersection, then the "combine" callback
- must be defined, and must write a non-NULL pointer into "dataOut".
- Otherwise the GLU_TESS_NEED_COMBINE_CALLBACK error occurs, and no
- output is generated. This is the only error that can occur during
- tesselation and rendering.
-
-
- Control over Tesselation
- ------------------------
-
- void gluTessProperty( GLUtesselator *tess, GLenum which, GLUcoord value );
-
- Properties defined:
-
- - GLU_TESS_WINDING_RULE. Possible values:
-
- GLU_TESS_WINDING_ODD
- GLU_TESS_WINDING_NONZERO
- GLU_TESS_WINDING_POSITIVE
- GLU_TESS_WINDING_NEGATIVE
- GLU_TESS_WINDING_ABS_GEQ_TWO
-
- The input contours parition the plane into regions. A winding
- rule determines which of these regions are inside the polygon.
-
- For a single contour C, the winding number of a point x is simply
- the signed number of revolutions we make around x as we travel
- once around C (where CCW is positive). When there are several
- contours, the individual winding numbers are summed. This
- procedure associates a signed integer value with each point x in
- the plane. Note that the winding number is the same for all
- points in a single region.
-
- The winding rule classifies a region as "inside" if its winding
- number belongs to the chosen category (odd, nonzero, positive,
- negative, or absolute value of at least two). The current GLU
- tesselator implements the "odd" rule. The "nonzero" rule is another
- common way to define the interior. The other three rules are
- useful for polygon CSG operations (see below).
-
- - GLU_TESS_BOUNDARY_ONLY. Values: TRUE (non-zero) or FALSE (zero).
-
- If TRUE, returns a set of closed contours which separate the
- polygon interior and exterior (rather than a tesselation).
- Exterior contours are oriented CCW with respect to the normal,
- interior contours are oriented CW. The GLU_TESS_BEGIN callback
- uses the type GL_LINE_LOOP for each contour.
-
- - GLU_TESS_TOLERANCE. Value: a real number between 0.0 and 1.0.
-
- This specifies a tolerance for merging features to reduce the size
- of the output. For example, two vertices which are very close to
- each other might be replaced by a single vertex. The tolerance
- is multiplied by the largest coordinate magnitude of any input vertex;
- this specifies the maximum distance that any feature can move as the
- result of a single merge operation. If a single feature takes part
- in several merge operations, the total distance moved could be larger.
-
- Feature merging is completely optional; the tolerance is only a hint.
- The implementation is free to merge in some cases and not in others,
- or to never merge features at all. The default tolerance is zero.
-
- The current implementation merges vertices only if they are exactly
- coincident, regardless of the current tolerance. A vertex is
- spliced into an edge only if the implementation is unable to
- distinguish which side of the edge the vertex lies on.
- Two edges are merged only when both endpoints are identical.
-
-
- void gluTessNormal( GLUtesselator *tess,
- GLUcoord x, GLUcoord y, GLUcoord z )
-
- - Lets the user supply the polygon normal, if known. All input data
- is projected into a plane perpendicular to the normal before
- tesselation. All output triangles are oriented CCW with
- respect to the normal (CW orientation can be obtained by
- reversing the sign of the supplied normal). For example, if
- you know that all polygons lie in the x-y plane, call
- "gluTessNormal(tess, 0.0, 0.0, 1.0)" before rendering any polygons.
-
- - If the supplied normal is (0,0,0) (the default value), the
- normal is determined as follows. The direction of the normal,
- up to its sign, is found by fitting a plane to the vertices,
- without regard to how the vertices are connected. It is
- expected that the input data lies approximately in plane;
- otherwise projection perpendicular to the computed normal may
- substantially change the geometry. The sign of the normal is
- chosen so that the sum of the signed areas of all input contours
- is non-negative (where a CCW contour has positive area).
-
- - The supplied normal persists until it is changed by another
- call to gluTessNormal.
-
-
- Backward compatibility with the GLU tesselator
- ----------------------------------------------
-
- The preferred interface is the one described above. The following
- routines are obsolete, and are provided only for backward compatibility:
-
- typedef GLUtesselator GLUtriangulatorObj; /* obsolete name */
-
- void gluBeginPolygon( GLUtesselator *tess );
- void gluNextContour( GLUtesselator *tess, GLenum type );
- void gluEndPolygon( GLUtesselator *tess );
-
- "type" is one of GLU_EXTERIOR, GLU_INTERIOR, GLU_CCW, GLU_CW, or
- GLU_UNKNOWN. It is ignored by the current GLU tesselator.
-
- GLU_BEGIN, GLU_VERTEX, GLU_END, GLU_ERROR, and GLU_EDGE_FLAG are defined
- as synonyms for GLU_TESS_BEGIN, GLU_TESS_VERTEX, GLU_TESS_END,
- GLU_TESS_ERROR, and GLU_TESS_EDGE_FLAG.
-
-
-Polygon CSG operations
-----------------------
-
- The features of the tesselator make it easy to find the union, difference,
- or intersection of several polygons.
-
- First, assume that each polygon is defined so that the winding number
- is 0 for each exterior region, and 1 for each interior region. Under
- this model, CCW contours define the outer boundary of the polygon, and
- CW contours define holes. Contours may be nested, but a nested
- contour must be oriented oppositely from the contour that contains it.
-
- If the original polygons do not satisfy this description, they can be
- converted to this form by first running the tesselator with the
- GLU_TESS_BOUNDARY_ONLY property turned on. This returns a list of
- contours satisfying the restriction above. By allocating two
- tesselator objects, the callbacks from one tesselator can be fed
- directly to the input of another.
-
- Given two or more polygons of the form above, CSG operations can be
- implemented as follows:
-
- Union
- Draw all the input contours as a single polygon. The winding number
- of each resulting region is the number of original polygons
- which cover it. The union can be extracted using the
- GLU_TESS_WINDING_NONZERO or GLU_TESS_WINDING_POSITIVE winding rules.
- Note that with the nonzero rule, we would get the same result if
- all contour orientations were reversed.
-
- Intersection (two polygons at a time only)
- Draw a single polygon using the contours from both input polygons.
- Extract the result using GLU_TESS_WINDING_ABS_GEQ_TWO. (Since this
- winding rule looks at the absolute value, reversing all contour
- orientations does not change the result.)
-
- Difference
-
- Suppose we want to compute A \ (B union C union D). Draw a single
- polygon consisting of the unmodified contours from A, followed by
- the contours of B,C,D with the vertex order reversed (this changes
- the winding number of the interior regions to -1). To extract the
- result, use the GLU_TESS_WINDING_POSITIVE rule.
-
- If B,C,D are the result of a GLU_TESS_BOUNDARY_ONLY call, an
- alternative to reversing the vertex order is to reverse the sign of
- the supplied normal. For example in the x-y plane, call
- gluTessNormal( tess, 0.0, 0.0, -1.0 ).
-
-
-Performance
------------
-
- The tesselator is not intended for immediate-mode rendering; when
- possible the output should be cached in a user structure or display
- list. General polygon tesselation is an inherently difficult problem,
- especially given the goal of extreme robustness.
-
- The implementation makes an effort to output a small number of fans
- and strips; this should improve the rendering performance when the
- output is used in a display list.
-
- Single-contour input polygons are first tested to see whether they can
- be rendered as a triangle fan with respect to the first vertex (to
- avoid running the full decomposition algorithm on convex polygons).
- Non-convex polygons may be rendered by this "fast path" as well, if
- the algorithm gets lucky in its choice of a starting vertex.
-
- For best performance follow these guidelines:
-
- - supply the polygon normal, if available, using gluTessNormal().
- This represents about 10% of the computation time. For example,
- if all polygons lie in the x-y plane, use gluTessNormal(tess,0,0,1).
-
- - render many polygons using the same tesselator object, rather than
- allocating a new tesselator for each one. (In a multi-threaded,
- multi-processor environment you may get better performance using
- several tesselators.)
-
-
-Comparison with the GLU tesselator
-----------------------------------
-
- On polygons which make it through the "fast path", the tesselator is
- 3 to 5 times faster than the GLU tesselator.
-
- On polygons which don't make it through the fast path (but which don't
- have self-intersections or degeneracies), it is about 2 times slower.
-
- On polygons with self-intersections or degeneraces, there is nothing
- to compare against.
-
- The new tesselator generates many more fans and strips, reducing the
- number of vertices that need to be sent to the hardware.
-
- Key to the statistics:
-
- vert number of input vertices on all contours
- cntr number of input contours
- tri number of triangles in all output primitives
- strip number of triangle strips
- fan number of triangle fans
- ind number of independent triangles
- ms number of milliseconds for tesselation
- (on a 150MHz R4400 Indy)
-
- Convex polygon examples:
-
-New: 3 vert, 1 cntr, 1 tri, 0 strip, 0 fan, 1 ind, 0.0459 ms
-Old: 3 vert, 1 cntr, 1 tri, 0 strip, 0 fan, 1 ind, 0.149 ms
-New: 4 vert, 1 cntr, 2 tri, 0 strip, 1 fan, 0 ind, 0.0459 ms
-Old: 4 vert, 1 cntr, 2 tri, 0 strip, 0 fan, 2 ind, 0.161 ms
-New: 36 vert, 1 cntr, 34 tri, 0 strip, 1 fan, 0 ind, 0.153 ms
-Old: 36 vert, 1 cntr, 34 tri, 0 strip, 0 fan, 34 ind, 0.621 ms
-
- Concave single-contour polygons:
-
-New: 5 vert, 1 cntr, 3 tri, 0 strip, 1 fan, 0 ind, 0.052 ms
-Old: 5 vert, 1 cntr, 3 tri, 0 strip, 0 fan, 3 ind, 0.252 ms
-New: 19 vert, 1 cntr, 17 tri, 2 strip, 2 fan, 1 ind, 0.911 ms
-Old: 19 vert, 1 cntr, 17 tri, 0 strip, 0 fan, 17 ind, 0.529 ms
-New: 151 vert, 1 cntr, 149 tri, 13 strip, 18 fan, 3 ind, 6.82 ms
-Old: 151 vert, 1 cntr, 149 tri, 0 strip, 3 fan, 143 ind, 2.7 ms
-New: 574 vert, 1 cntr, 572 tri, 59 strip, 54 fan, 11 ind, 26.6 ms
-Old: 574 vert, 1 cntr, 572 tri, 0 strip, 31 fan, 499 ind, 12.4 ms
-
- Multiple contours, but no intersections:
-
-New: 7 vert, 2 cntr, 7 tri, 1 strip, 0 fan, 0 ind, 0.527 ms
-Old: 7 vert, 2 cntr, 7 tri, 0 strip, 0 fan, 7 ind, 0.274 ms
-New: 81 vert, 6 cntr, 89 tri, 9 strip, 7 fan, 6 ind, 3.88 ms
-Old: 81 vert, 6 cntr, 89 tri, 0 strip, 13 fan, 61 ind, 2.2 ms
-New: 391 vert, 19 cntr, 413 tri, 37 strip, 32 fan, 26 ind, 20.2 ms
-Old: 391 vert, 19 cntr, 413 tri, 0 strip, 25 fan, 363 ind, 8.68 ms
-
- Self-intersecting and degenerate examples:
-
-Bowtie: 4 vert, 1 cntr, 2 tri, 0 strip, 0 fan, 2 ind, 0.483 ms
-Star: 5 vert, 1 cntr, 5 tri, 0 strip, 0 fan, 5 ind, 0.91 ms
-Random: 24 vert, 7 cntr, 46 tri, 2 strip, 12 fan, 7 ind, 5.32 ms
-Font: 333 vert, 2 cntr, 331 tri, 32 strip, 16 fan, 3 ind, 14.1 ms
-: 167 vert, 35 cntr, 254 tri, 8 strip, 56 fan, 52 ind, 46.3 ms
-: 78 vert, 1 cntr, 2675 tri, 148 strip, 207 fan, 180 ind, 243 ms
-: 12480 vert, 2 cntr, 12478 tri, 736 strip,1275 fan, 5 ind, 1010 ms
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/alg-outline b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/alg-outline
deleted file mode 100644
index 28cc18730..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/alg-outline
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/alg-outline,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-This is only a very brief overview. There is quite a bit of
-additional documentation in the source code itself.
-
-
-Goals of robust tesselation
----------------------------
-
-The tesselation algorithm is fundamentally a 2D algorithm. We
-initially project all data into a plane; our goal is to robustly
-tesselate the projected data. The same topological tesselation is
-then applied to the input data.
-
-Topologically, the output should always be a tesselation. If the
-input is even slightly non-planar, then some triangles will
-necessarily be back-facing when viewed from some angles, but the goal
-is to minimize this effect.
-
-The algorithm needs some capability of cleaning up the input data as
-well as the numerical errors in its own calculations. One way to do
-this is to specify a tolerance as defined above, and clean up the
-input and output during the line sweep process. At the very least,
-the algorithm must handle coincident vertices, vertices incident to an
-edge, and coincident edges.
-
-
-Phases of the algorithm
------------------------
-
-1. Find the polygon normal N.
-2. Project the vertex data onto a plane. It does not need to be
- perpendicular to the normal, eg. we can project onto the plane
- perpendicular to the coordinate axis whose dot product with N
- is largest.
-3. Using a line-sweep algorithm, partition the plane into x-monotone
- regions. Any vertical line intersects an x-monotone region in
- at most one interval.
-4. Triangulate the x-monotone regions.
-5. Group the triangles into strips and fans.
-
-
-Finding the normal vector
--------------------------
-
-A common way to find a polygon normal is to compute the signed area
-when the polygon is projected along the three coordinate axes. We
-can't do this, since contours can have zero area without being
-degenerate (eg. a bowtie).
-
-We fit a plane to the vertex data, ignoring how they are connected
-into contours. Ideally this would be a least-squares fit; however for
-our purpose the accuracy of the normal is not important. Instead we
-find three vertices which are widely separated, and compute the normal
-to the triangle they form. The vertices are chosen so that the
-triangle has an area at least 1/sqrt(3) times the largest area of any
-triangle formed using the input vertices.
-
-The contours do affect the orientation of the normal; after computing
-the normal, we check that the sum of the signed contour areas is
-non-negative, and reverse the normal if necessary.
-
-
-Projecting the vertices
------------------------
-
-We project the vertices onto a plane perpendicular to one of the three
-coordinate axes. This helps numerical accuracy by removing a
-transformation step between the original input data and the data
-processed by the algorithm. The projection also compresses the input
-data; the 2D distance between vertices after projection may be smaller
-than the original 2D distance. However by choosing the coordinate
-axis whose dot product with the normal is greatest, the compression
-factor is at most 1/sqrt(3).
-
-Even though the *accuracy* of the normal is not that important (since
-we are projecting perpendicular to a coordinate axis anyway), the
-*robustness* of the computation is important. For example, if there
-are many vertices which lie almost along a line, and one vertex V
-which is well-separated from the line, then our normal computation
-should involve V otherwise the results will be garbage.
-
-The advantage of projecting perpendicular to the polygon normal is
-that computed intersection points will be as close as possible to
-their ideal locations. To get this behavior, define TRUE_PROJECT.
-
-
-The Line Sweep
---------------
-
-There are three data structures: the mesh, the event queue, and the
-edge dictionary.
-
-The mesh is a "quad-edge" data structure which records the topology of
-the current decomposition; for details see the include file "mesh.h".
-
-The event queue simply holds all vertices (both original and computed
-ones), organized so that we can quickly extract the vertex with the
-minimum x-coord (and among those, the one with the minimum y-coord).
-
-The edge dictionary describes the current intersection of the sweep
-line with the regions of the polygon. This is just an ordering of the
-edges which intersect the sweep line, sorted by their current order of
-intersection. For each pair of edges, we store some information about
-the monotone region between them -- these are call "active regions"
-(since they are crossed by the current sweep line).
-
-The basic algorithm is to sweep from left to right, processing each
-vertex. The processed portion of the mesh (left of the sweep line) is
-a planar decomposition. As we cross each vertex, we update the mesh
-and the edge dictionary, then we check any newly adjacent pairs of
-edges to see if they intersect.
-
-A vertex can have any number of edges. Vertices with many edges can
-be created as vertices are merged and intersection points are
-computed. For unprocessed vertices (right of the sweep line), these
-edges are in no particular order around the vertex; for processed
-vertices, the topological ordering should match the geometric ordering.
-
-The vertex processing happens in two phases: first we process are the
-left-going edges (all these edges are currently in the edge
-dictionary). This involves:
-
- - deleting the left-going edges from the dictionary;
- - relinking the mesh if necessary, so that the order of these edges around
- the event vertex matches the order in the dictionary;
- - marking any terminated regions (regions which lie between two left-going
- edges) as either "inside" or "outside" according to their winding number.
-
-When there are no left-going edges, and the event vertex is in an
-"interior" region, we need to add an edge (to split the region into
-monotone pieces). To do this we simply join the event vertex to the
-rightmost left endpoint of the upper or lower edge of the containing
-region.
-
-Then we process the right-going edges. This involves:
-
- - inserting the edges in the edge dictionary;
- - computing the winding number of any newly created active regions.
- We can compute this incrementally using the winding of each edge
- that we cross as we walk through the dictionary.
- - relinking the mesh if necessary, so that the order of these edges around
- the event vertex matches the order in the dictionary;
- - checking any newly adjacent edges for intersection and/or merging.
-
-If there are no right-going edges, again we need to add one to split
-the containing region into monotone pieces. In our case it is most
-convenient to add an edge to the leftmost right endpoint of either
-containing edge; however we may need to change this later (see the
-code for details).
-
-
-Invariants
-----------
-
-These are the most important invariants maintained during the sweep.
-We define a function VertLeq(v1,v2) which defines the order in which
-vertices cross the sweep line, and a function EdgeLeq(e1,e2; loc)
-which says whether e1 is below e2 at the sweep event location "loc".
-This function is defined only at sweep event locations which lie
-between the rightmost left endpoint of {e1,e2}, and the leftmost right
-endpoint of {e1,e2}.
-
-Invariants for the Edge Dictionary.
-
- - Each pair of adjacent edges e2=Succ(e1) satisfies EdgeLeq(e1,e2)
- at any valid location of the sweep event.
- - If EdgeLeq(e2,e1) as well (at any valid sweep event), then e1 and e2
- share a common endpoint.
- - For each e in the dictionary, e->Dst has been processed but not e->Org.
- - Each edge e satisfies VertLeq(e->Dst,event) && VertLeq(event,e->Org)
- where "event" is the current sweep line event.
- - No edge e has zero length.
- - No two edges have identical left and right endpoints.
-
-Invariants for the Mesh (the processed portion).
-
- - The portion of the mesh left of the sweep line is a planar graph,
- ie. there is *some* way to embed it in the plane.
- - No processed edge has zero length.
- - No two processed vertices have identical coordinates.
- - Each "inside" region is monotone, ie. can be broken into two chains
- of monotonically increasing vertices according to VertLeq(v1,v2)
- - a non-invariant: these chains may intersect (slightly) due to
- numerical errors, but this does not affect the algorithm's operation.
-
-Invariants for the Sweep.
-
- - If a vertex has any left-going edges, then these must be in the edge
- dictionary at the time the vertex is processed.
- - If an edge is marked "fixUpperEdge" (it is a temporary edge introduced
- by ConnectRightVertex), then it is the only right-going edge from
- its associated vertex. (This says that these edges exist only
- when it is necessary.)
-
-
-Robustness
-----------
-
-The key to the robustness of the algorithm is maintaining the
-invariants above, especially the correct ordering of the edge
-dictionary. We achieve this by:
-
- 1. Writing the numerical computations for maximum precision rather
- than maximum speed.
-
- 2. Making no assumptions at all about the results of the edge
- intersection calculations -- for sufficiently degenerate inputs,
- the computed location is not much better than a random number.
-
- 3. When numerical errors violate the invariants, restore them
- by making *topological* changes when necessary (ie. relinking
- the mesh structure).
-
-
-Triangulation and Grouping
---------------------------
-
-We finish the line sweep before doing any triangulation. This is
-because even after a monotone region is complete, there can be further
-changes to its vertex data because of further vertex merging.
-
-After triangulating all monotone regions, we want to group the
-triangles into fans and strips. We do this using a greedy approach.
-The triangulation itself is not optimized to reduce the number of
-primitives; we just try to get a reasonable decomposition of the
-computed triangulation.
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/dict-list.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/dict-list.h
deleted file mode 100755
index 91a2b5b8d..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/dict-list.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/dict-list.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef __dict_list_h_
-#define __dict_list_h_
-
-/* Use #define's so that another heap implementation can use this one */
-
-#define DictKey DictListKey
-#define Dict DictList
-#define DictNode DictListNode
-
-#define dictNewDict(frame,leq) __gl_dictListNewDict(frame,leq)
-#define dictDeleteDict(dict) __gl_dictListDeleteDict(dict)
-
-#define dictSearch(dict,key) __gl_dictListSearch(dict,key)
-#define dictInsert(dict,key) __gl_dictListInsert(dict,key)
-#define dictInsertBefore(dict,node,key) __gl_dictListInsertBefore(dict,node,key)
-#define dictDelete(dict,node) __gl_dictListDelete(dict,node)
-
-#define dictKey(n) __gl_dictListKey(n)
-#define dictSucc(n) __gl_dictListSucc(n)
-#define dictPred(n) __gl_dictListPred(n)
-#define dictMin(d) __gl_dictListMin(d)
-#define dictMax(d) __gl_dictListMax(d)
-
-
-
-typedef void *DictKey;
-typedef struct Dict Dict;
-typedef struct DictNode DictNode;
-
-Dict *dictNewDict(
- void *frame,
- int (*leq)(void *frame, DictKey key1, DictKey key2) );
-
-void dictDeleteDict( Dict *dict );
-
-/* Search returns the node with the smallest key greater than or equal
- * to the given key. If there is no such key, returns a node whose
- * key is NULL. Similarly, Succ(Max(d)) has a NULL key, etc.
- */
-DictNode *dictSearch( Dict *dict, DictKey key );
-DictNode *dictInsertBefore( Dict *dict, DictNode *node, DictKey key );
-void dictDelete( Dict *dict, DictNode *node );
-
-#define __gl_dictListKey(n) ((n)->key)
-#define __gl_dictListSucc(n) ((n)->next)
-#define __gl_dictListPred(n) ((n)->prev)
-#define __gl_dictListMin(d) ((d)->head.next)
-#define __gl_dictListMax(d) ((d)->head.prev)
-#define __gl_dictListInsert(d,k) (dictInsertBefore((d),&(d)->head,(k)))
-
-
-/*** Private data structures ***/
-
-struct DictNode {
- DictKey key;
- DictNode *next;
- DictNode *prev;
-};
-
-struct Dict {
- DictNode head;
- void *frame;
- int (*leq)(void *frame, DictKey key1, DictKey key2);
-};
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/dict.c b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/dict.c
deleted file mode 100755
index 9d0b7265a..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/dict.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/dict.c,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include <stddef.h>
-#include "dict-list.h"
-#include "memalloc.h"
-
-/* really __gl_dictListNewDict */
-Dict *dictNewDict( void *frame,
- int (*leq)(void *frame, DictKey key1, DictKey key2) )
-{
- Dict *dict = (Dict *) memAlloc( sizeof( Dict ));
- DictNode *head;
-
- if (dict == NULL) return NULL;
-
- head = &dict->head;
-
- head->key = NULL;
- head->next = head;
- head->prev = head;
-
- dict->frame = frame;
- dict->leq = leq;
-
- return dict;
-}
-
-/* really __gl_dictListDeleteDict */
-void dictDeleteDict( Dict *dict )
-{
- DictNode *node;
-
- for( node = dict->head.next; node != &dict->head; node = node->next ) {
- memFree( node );
- }
- memFree( dict );
-}
-
-/* really __gl_dictListInsertBefore */
-DictNode *dictInsertBefore( Dict *dict, DictNode *node, DictKey key )
-{
- DictNode *newNode;
-
- do {
- node = node->prev;
- } while( node->key != NULL && ! (*dict->leq)(dict->frame, node->key, key));
-
- newNode = (DictNode *) memAlloc( sizeof( DictNode ));
- if (newNode == NULL) return NULL;
-
- newNode->key = key;
- newNode->next = node->next;
- node->next->prev = newNode;
- newNode->prev = node;
- node->next = newNode;
-
- return newNode;
-}
-
-/* really __gl_dictListDelete */
-void dictDelete( Dict *dict, DictNode *node ) /*ARGSUSED*/
-{
- node->next->prev = node->prev;
- node->prev->next = node->next;
- memFree( node );
-}
-
-/* really __gl_dictListSearch */
-DictNode *dictSearch( Dict *dict, DictKey key )
-{
- DictNode *node = &dict->head;
-
- do {
- node = node->next;
- } while( node->key != NULL && ! (*dict->leq)(dict->frame, key, node->key));
-
- return node;
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/dict.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/dict.h
deleted file mode 100755
index b460ef82a..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/dict.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/dict.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef __dict_list_h_
-#define __dict_list_h_
-
-/* Use #define's so that another heap implementation can use this one */
-
-#define DictKey DictListKey
-#define Dict DictList
-#define DictNode DictListNode
-
-#define dictNewDict(frame,leq) __gl_dictListNewDict(frame,leq)
-#define dictDeleteDict(dict) __gl_dictListDeleteDict(dict)
-
-#define dictSearch(dict,key) __gl_dictListSearch(dict,key)
-#define dictInsert(dict,key) __gl_dictListInsert(dict,key)
-#define dictInsertBefore(dict,node,key) __gl_dictListInsertBefore(dict,node,key)
-#define dictDelete(dict,node) __gl_dictListDelete(dict,node)
-
-#define dictKey(n) __gl_dictListKey(n)
-#define dictSucc(n) __gl_dictListSucc(n)
-#define dictPred(n) __gl_dictListPred(n)
-#define dictMin(d) __gl_dictListMin(d)
-#define dictMax(d) __gl_dictListMax(d)
-
-
-
-typedef void *DictKey;
-typedef struct Dict Dict;
-typedef struct DictNode DictNode;
-
-Dict *dictNewDict(
- void *frame,
- int (*leq)(void *frame, DictKey key1, DictKey key2) );
-
-void dictDeleteDict( Dict *dict );
-
-/* Search returns the node with the smallest key greater than or equal
- * to the given key. If there is no such key, returns a node whose
- * key is NULL. Similarly, Succ(Max(d)) has a NULL key, etc.
- */
-DictNode *dictSearch( Dict *dict, DictKey key );
-DictNode *dictInsertBefore( Dict *dict, DictNode *node, DictKey key );
-void dictDelete( Dict *dict, DictNode *node );
-
-#define __gl_dictListKey(n) ((n)->key)
-#define __gl_dictListSucc(n) ((n)->next)
-#define __gl_dictListPred(n) ((n)->prev)
-#define __gl_dictListMin(d) ((d)->head.next)
-#define __gl_dictListMax(d) ((d)->head.prev)
-#define __gl_dictListInsert(d,k) (dictInsertBefore((d),&(d)->head,(k)))
-
-
-/*** Private data structures ***/
-
-struct DictNode {
- DictKey key;
- DictNode *next;
- DictNode *prev;
-};
-
-struct Dict {
- DictNode head;
- void *frame;
- int (*leq)(void *frame, DictKey key1, DictKey key2);
-};
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/geom.c b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/geom.c
deleted file mode 100755
index 94e35439c..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/geom.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/geom.c,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include "gluos.h"
-#include <assert.h>
-#include "mesh.h"
-#include "geom.h"
-
-int __gl_vertLeq( GLUvertex *u, GLUvertex *v )
-{
- /* Returns TRUE if u is lexicographically <= v. */
-
- return VertLeq( u, v );
-}
-
-GLdouble __gl_edgeEval( GLUvertex *u, GLUvertex *v, GLUvertex *w )
-{
- /* Given three vertices u,v,w such that VertLeq(u,v) && VertLeq(v,w),
- * evaluates the t-coord of the edge uw at the s-coord of the vertex v.
- * Returns v->t - (uw)(v->s), ie. the signed distance from uw to v.
- * If uw is vertical (and thus passes thru v), the result is zero.
- *
- * The calculation is extremely accurate and stable, even when v
- * is very close to u or w. In particular if we set v->t = 0 and
- * let r be the negated result (this evaluates (uw)(v->s)), then
- * r is guaranteed to satisfy MIN(u->t,w->t) <= r <= MAX(u->t,w->t).
- */
- GLdouble gapL, gapR;
-
- assert( VertLeq( u, v ) && VertLeq( v, w ));
-
- gapL = v->s - u->s;
- gapR = w->s - v->s;
-
- if( gapL + gapR > 0 ) {
- if( gapL < gapR ) {
- return (v->t - u->t) + (u->t - w->t) * (gapL / (gapL + gapR));
- } else {
- return (v->t - w->t) + (w->t - u->t) * (gapR / (gapL + gapR));
- }
- }
- /* vertical line */
- return 0;
-}
-
-GLdouble __gl_edgeSign( GLUvertex *u, GLUvertex *v, GLUvertex *w )
-{
- /* Returns a number whose sign matches EdgeEval(u,v,w) but which
- * is cheaper to evaluate. Returns > 0, == 0 , or < 0
- * as v is above, on, or below the edge uw.
- */
- GLdouble gapL, gapR;
-
- assert( VertLeq( u, v ) && VertLeq( v, w ));
-
- gapL = v->s - u->s;
- gapR = w->s - v->s;
-
- if( gapL + gapR > 0 ) {
- return (v->t - w->t) * gapL + (v->t - u->t) * gapR;
- }
- /* vertical line */
- return 0;
-}
-
-
-/***********************************************************************
- * Define versions of EdgeSign, EdgeEval with s and t transposed.
- */
-
-GLdouble __gl_transEval( GLUvertex *u, GLUvertex *v, GLUvertex *w )
-{
- /* Given three vertices u,v,w such that TransLeq(u,v) && TransLeq(v,w),
- * evaluates the t-coord of the edge uw at the s-coord of the vertex v.
- * Returns v->s - (uw)(v->t), ie. the signed distance from uw to v.
- * If uw is vertical (and thus passes thru v), the result is zero.
- *
- * The calculation is extremely accurate and stable, even when v
- * is very close to u or w. In particular if we set v->s = 0 and
- * let r be the negated result (this evaluates (uw)(v->t)), then
- * r is guaranteed to satisfy MIN(u->s,w->s) <= r <= MAX(u->s,w->s).
- */
- GLdouble gapL, gapR;
-
- assert( TransLeq( u, v ) && TransLeq( v, w ));
-
- gapL = v->t - u->t;
- gapR = w->t - v->t;
-
- if( gapL + gapR > 0 ) {
- if( gapL < gapR ) {
- return (v->s - u->s) + (u->s - w->s) * (gapL / (gapL + gapR));
- } else {
- return (v->s - w->s) + (w->s - u->s) * (gapR / (gapL + gapR));
- }
- }
- /* vertical line */
- return 0;
-}
-
-GLdouble __gl_transSign( GLUvertex *u, GLUvertex *v, GLUvertex *w )
-{
- /* Returns a number whose sign matches TransEval(u,v,w) but which
- * is cheaper to evaluate. Returns > 0, == 0 , or < 0
- * as v is above, on, or below the edge uw.
- */
- GLdouble gapL, gapR;
-
- assert( TransLeq( u, v ) && TransLeq( v, w ));
-
- gapL = v->t - u->t;
- gapR = w->t - v->t;
-
- if( gapL + gapR > 0 ) {
- return (v->s - w->s) * gapL + (v->s - u->s) * gapR;
- }
- /* vertical line */
- return 0;
-}
-
-
-int __gl_vertCCW( GLUvertex *u, GLUvertex *v, GLUvertex *w )
-{
- /* For almost-degenerate situations, the results are not reliable.
- * Unless the floating-point arithmetic can be performed without
- * rounding errors, *any* implementation will give incorrect results
- * on some degenerate inputs, so the client must have some way to
- * handle this situation.
- */
- return (u->s*(v->t - w->t) + v->s*(w->t - u->t) + w->s*(u->t - v->t)) >= 0;
-}
-
-/* Given parameters a,x,b,y returns the value (b*x+a*y)/(a+b),
- * or (x+y)/2 if a==b==0. It requires that a,b >= 0, and enforces
- * this in the rare case that one argument is slightly negative.
- * The implementation is extremely stable numerically.
- * In particular it guarantees that the result r satisfies
- * MIN(x,y) <= r <= MAX(x,y), and the results are very accurate
- * even when a and b differ greatly in magnitude.
- */
-#define RealInterpolate(a,x,b,y) \
- (a = (a < 0) ? 0 : a, b = (b < 0) ? 0 : b, \
- ((a <= b) ? ((b == 0) ? ((x+y) / 2) \
- : (x + (y-x) * (a/(a+b)))) \
- : (y + (x-y) * (b/(a+b)))))
-
-#ifndef FOR_TRITE_TEST_PROGRAM
-#define Interpolate(a,x,b,y) RealInterpolate(a,x,b,y)
-#else
-
-/* Claim: the ONLY property the sweep algorithm relies on is that
- * MIN(x,y) <= r <= MAX(x,y). This is a nasty way to test that.
- */
-#include <stdlib.h>
-extern int RandomInterpolate;
-
-GLdouble Interpolate( GLdouble a, GLdouble x, GLdouble b, GLdouble y)
-{
-printf("*********************%d\n",RandomInterpolate);
- if( RandomInterpolate ) {
- a = 1.2 * drand48() - 0.1;
- a = (a < 0) ? 0 : ((a > 1) ? 1 : a);
- b = 1.0 - a;
- }
- return RealInterpolate(a,x,b,y);
-}
-
-#endif
-
-#define Swap(a,b) if (1) { GLUvertex *t = a; a = b; b = t; } else
-
-void __gl_edgeIntersect( GLUvertex *o1, GLUvertex *d1,
- GLUvertex *o2, GLUvertex *d2,
- GLUvertex *v )
-/* Given edges (o1,d1) and (o2,d2), compute their point of intersection.
- * The computed point is guaranteed to lie in the intersection of the
- * bounding rectangles defined by each edge.
- */
-{
- GLdouble z1, z2;
-
- /* This is certainly not the most efficient way to find the intersection
- * of two line segments, but it is very numerically stable.
- *
- * Strategy: find the two middle vertices in the VertLeq ordering,
- * and interpolate the intersection s-value from these. Then repeat
- * using the TransLeq ordering to find the intersection t-value.
- */
-
- if( ! VertLeq( o1, d1 )) { Swap( o1, d1 ); }
- if( ! VertLeq( o2, d2 )) { Swap( o2, d2 ); }
- if( ! VertLeq( o1, o2 )) { Swap( o1, o2 ); Swap( d1, d2 ); }
-
- if( ! VertLeq( o2, d1 )) {
- /* Technically, no intersection -- do our best */
- v->s = (o2->s + d1->s) / 2;
- } else if( VertLeq( d1, d2 )) {
- /* Interpolate between o2 and d1 */
- z1 = EdgeEval( o1, o2, d1 );
- z2 = EdgeEval( o2, d1, d2 );
- if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; }
- v->s = Interpolate( z1, o2->s, z2, d1->s );
- } else {
- /* Interpolate between o2 and d2 */
- z1 = EdgeSign( o1, o2, d1 );
- z2 = -EdgeSign( o1, d2, d1 );
- if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; }
- v->s = Interpolate( z1, o2->s, z2, d2->s );
- }
-
- /* Now repeat the process for t */
-
- if( ! TransLeq( o1, d1 )) { Swap( o1, d1 ); }
- if( ! TransLeq( o2, d2 )) { Swap( o2, d2 ); }
- if( ! TransLeq( o1, o2 )) { Swap( o1, o2 ); Swap( d1, d2 ); }
-
- if( ! TransLeq( o2, d1 )) {
- /* Technically, no intersection -- do our best */
- v->t = (o2->t + d1->t) / 2;
- } else if( TransLeq( d1, d2 )) {
- /* Interpolate between o2 and d1 */
- z1 = TransEval( o1, o2, d1 );
- z2 = TransEval( o2, d1, d2 );
- if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; }
- v->t = Interpolate( z1, o2->t, z2, d1->t );
- } else {
- /* Interpolate between o2 and d2 */
- z1 = TransSign( o1, o2, d1 );
- z2 = -TransSign( o1, d2, d1 );
- if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; }
- v->t = Interpolate( z1, o2->t, z2, d2->t );
- }
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/geom.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/geom.h
deleted file mode 100755
index b74fb96cc..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/geom.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/geom.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef __geom_h_
-#define __geom_h_
-
-#include "mesh.h"
-
-#ifdef NO_BRANCH_CONDITIONS
-/* MIPS architecture has special instructions to evaluate boolean
- * conditions -- more efficient than branching, IF you can get the
- * compiler to generate the right instructions (SGI compiler doesn't)
- */
-#define VertEq(u,v) (((u)->s == (v)->s) & ((u)->t == (v)->t))
-#define VertLeq(u,v) (((u)->s < (v)->s) | \
- ((u)->s == (v)->s & (u)->t <= (v)->t))
-#else
-#define VertEq(u,v) ((u)->s == (v)->s && (u)->t == (v)->t)
-#define VertLeq(u,v) (((u)->s < (v)->s) || \
- ((u)->s == (v)->s && (u)->t <= (v)->t))
-#endif
-
-#define EdgeEval(u,v,w) __gl_edgeEval(u,v,w)
-#define EdgeSign(u,v,w) __gl_edgeSign(u,v,w)
-
-/* Versions of VertLeq, EdgeSign, EdgeEval with s and t transposed. */
-
-#define TransLeq(u,v) (((u)->t < (v)->t) || \
- ((u)->t == (v)->t && (u)->s <= (v)->s))
-#define TransEval(u,v,w) __gl_transEval(u,v,w)
-#define TransSign(u,v,w) __gl_transSign(u,v,w)
-
-
-#define EdgeGoesLeft(e) VertLeq( (e)->Dst, (e)->Org )
-#define EdgeGoesRight(e) VertLeq( (e)->Org, (e)->Dst )
-
-#define ABS(x) ((x) < 0 ? -(x) : (x))
-#define VertL1dist(u,v) (ABS(u->s - v->s) + ABS(u->t - v->t))
-
-#define VertCCW(u,v,w) __gl_vertCCW(u,v,w)
-
-int __gl_vertLeq( GLUvertex *u, GLUvertex *v );
-GLdouble __gl_edgeEval( GLUvertex *u, GLUvertex *v, GLUvertex *w );
-GLdouble __gl_edgeSign( GLUvertex *u, GLUvertex *v, GLUvertex *w );
-GLdouble __gl_transEval( GLUvertex *u, GLUvertex *v, GLUvertex *w );
-GLdouble __gl_transSign( GLUvertex *u, GLUvertex *v, GLUvertex *w );
-int __gl_vertCCW( GLUvertex *u, GLUvertex *v, GLUvertex *w );
-void __gl_edgeIntersect( GLUvertex *o1, GLUvertex *d1,
- GLUvertex *o2, GLUvertex *d2,
- GLUvertex *v );
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/memalloc.c b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/memalloc.c
deleted file mode 100755
index c2bb9b670..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/memalloc.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/memalloc.c,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include "memalloc.h"
-#include "string.h"
-
-int __gl_memInit( size_t maxFast )
-{
-#ifndef NO_MALLOPT
-/* mallopt( M_MXFAST, maxFast );*/
-#ifdef MEMORY_DEBUG
- mallopt( M_DEBUG, 1 );
-#endif
-#endif
- return 1;
-}
-
-#ifdef MEMORY_DEBUG
-void *__gl_memAlloc( size_t n )
-{
- return memset( malloc( n ), 0xa5, n );
-}
-#endif
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/memalloc.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/memalloc.h
deleted file mode 100755
index 543913209..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/memalloc.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libtess/memalloc.h,v 1.2 2001/03/02 03:42:45 dawes Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/04/09 16:27:24 $ $Revision: 1.1.1.2 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/memalloc.h,v 1.1.1.2 2001/04/09 16:27:24 dawes Exp $
-*/
-
-#ifndef __memalloc_simple_h_
-#define __memalloc_simple_h_
-
-#include <stdlib.h>
-
-#define memRealloc realloc
-#define memFree free
-
-#define memInit __gl_memInit
-/*extern void __gl_memInit( size_t );*/
-extern int __gl_memInit( size_t );
-
-#ifndef MEMORY_DEBUG
-#define memAlloc malloc
-#else
-#define memAlloc __gl_memAlloc
-extern void * __gl_memAlloc( size_t );
-#endif
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/mesh.c b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/mesh.c
deleted file mode 100755
index 9c3689f44..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/mesh.c
+++ /dev/null
@@ -1,796 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/mesh.c,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include "gluos.h"
-#include <stddef.h>
-#include <assert.h>
-#include "mesh.h"
-#include "memalloc.h"
-
-#define TRUE 1
-#define FALSE 0
-
-static GLUvertex *allocVertex()
-{
- return (GLUvertex *)memAlloc( sizeof( GLUvertex ));
-}
-
-static GLUface *allocFace()
-{
- return (GLUface *)memAlloc( sizeof( GLUface ));
-}
-
-/************************ Utility Routines ************************/
-
-/* Allocate and free half-edges in pairs for efficiency.
- * The *only* place that should use this fact is allocation/free.
- */
-typedef struct { GLUhalfEdge e, eSym; } EdgePair;
-
-/* MakeEdge creates a new pair of half-edges which form their own loop.
- * No vertex or face structures are allocated, but these must be assigned
- * before the current edge operation is completed.
- */
-static GLUhalfEdge *MakeEdge( GLUhalfEdge *eNext )
-{
- GLUhalfEdge *e;
- GLUhalfEdge *eSym;
- GLUhalfEdge *ePrev;
- EdgePair *pair = (EdgePair *)memAlloc( sizeof( EdgePair ));
- if (pair == NULL) return NULL;
-
- e = &pair->e;
- eSym = &pair->eSym;
-
- /* Make sure eNext points to the first edge of the edge pair */
- if( eNext->Sym < eNext ) { eNext = eNext->Sym; }
-
- /* Insert in circular doubly-linked list before eNext.
- * Note that the prev pointer is stored in Sym->next.
- */
- ePrev = eNext->Sym->next;
- eSym->next = ePrev;
- ePrev->Sym->next = e;
- e->next = eNext;
- eNext->Sym->next = eSym;
-
- e->Sym = eSym;
- e->Onext = e;
- e->Lnext = eSym;
- e->Org = NULL;
- e->Lface = NULL;
- e->winding = 0;
- e->activeRegion = NULL;
-
- eSym->Sym = e;
- eSym->Onext = eSym;
- eSym->Lnext = e;
- eSym->Org = NULL;
- eSym->Lface = NULL;
- eSym->winding = 0;
- eSym->activeRegion = NULL;
-
- return e;
-}
-
-/* Splice( a, b ) is best described by the Guibas/Stolfi paper or the
- * CS348a notes (see mesh.h). Basically it modifies the mesh so that
- * a->Onext and b->Onext are exchanged. This can have various effects
- * depending on whether a and b belong to different face or vertex rings.
- * For more explanation see __gl_meshSplice() below.
- */
-static void Splice( GLUhalfEdge *a, GLUhalfEdge *b )
-{
- GLUhalfEdge *aOnext = a->Onext;
- GLUhalfEdge *bOnext = b->Onext;
-
- aOnext->Sym->Lnext = b;
- bOnext->Sym->Lnext = a;
- a->Onext = bOnext;
- b->Onext = aOnext;
-}
-
-/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the
- * origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives
- * a place to insert the new vertex in the global vertex list. We insert
- * the new vertex *before* vNext so that algorithms which walk the vertex
- * list will not see the newly created vertices.
- */
-static void MakeVertex( GLUvertex *newVertex,
- GLUhalfEdge *eOrig, GLUvertex *vNext )
-{
- GLUhalfEdge *e;
- GLUvertex *vPrev;
- GLUvertex *vNew = newVertex;
-
- assert(vNew != NULL);
-
- /* insert in circular doubly-linked list before vNext */
- vPrev = vNext->prev;
- vNew->prev = vPrev;
- vPrev->next = vNew;
- vNew->next = vNext;
- vNext->prev = vNew;
-
- vNew->anEdge = eOrig;
- vNew->data = NULL;
- /* leave coords, s, t undefined */
-
- /* fix other edges on this vertex loop */
- e = eOrig;
- do {
- e->Org = vNew;
- e = e->Onext;
- } while( e != eOrig );
-}
-
-/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left
- * face of all edges in the face loop to which eOrig belongs. "fNext" gives
- * a place to insert the new face in the global face list. We insert
- * the new face *before* fNext so that algorithms which walk the face
- * list will not see the newly created faces.
- */
-static void MakeFace( GLUface *newFace, GLUhalfEdge *eOrig, GLUface *fNext )
-{
- GLUhalfEdge *e;
- GLUface *fPrev;
- GLUface *fNew = newFace;
-
- assert(fNew != NULL);
-
- /* insert in circular doubly-linked list before fNext */
- fPrev = fNext->prev;
- fNew->prev = fPrev;
- fPrev->next = fNew;
- fNew->next = fNext;
- fNext->prev = fNew;
-
- fNew->anEdge = eOrig;
- fNew->data = NULL;
- fNew->trail = NULL;
- fNew->marked = FALSE;
-
- /* The new face is marked "inside" if the old one was. This is a
- * convenience for the common case where a face has been split in two.
- */
- fNew->inside = fNext->inside;
-
- /* fix other edges on this face loop */
- e = eOrig;
- do {
- e->Lface = fNew;
- e = e->Lnext;
- } while( e != eOrig );
-}
-
-/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),
- * and removes from the global edge list.
- */
-static void KillEdge( GLUhalfEdge *eDel )
-{
- GLUhalfEdge *ePrev, *eNext;
-
- /* Half-edges are allocated in pairs, see EdgePair above */
- if( eDel->Sym < eDel ) { eDel = eDel->Sym; }
-
- /* delete from circular doubly-linked list */
- eNext = eDel->next;
- ePrev = eDel->Sym->next;
- eNext->Sym->next = ePrev;
- ePrev->Sym->next = eNext;
-
- memFree( eDel );
-}
-
-
-/* KillVertex( vDel ) destroys a vertex and removes it from the global
- * vertex list. It updates the vertex loop to point to a given new vertex.
- */
-static void KillVertex( GLUvertex *vDel, GLUvertex *newOrg )
-{
- GLUhalfEdge *e, *eStart = vDel->anEdge;
- GLUvertex *vPrev, *vNext;
-
- /* change the origin of all affected edges */
- e = eStart;
- do {
- e->Org = newOrg;
- e = e->Onext;
- } while( e != eStart );
-
- /* delete from circular doubly-linked list */
- vPrev = vDel->prev;
- vNext = vDel->next;
- vNext->prev = vPrev;
- vPrev->next = vNext;
-
- memFree( vDel );
-}
-
-/* KillFace( fDel ) destroys a face and removes it from the global face
- * list. It updates the face loop to point to a given new face.
- */
-static void KillFace( GLUface *fDel, GLUface *newLface )
-{
- GLUhalfEdge *e, *eStart = fDel->anEdge;
- GLUface *fPrev, *fNext;
-
- /* change the left face of all affected edges */
- e = eStart;
- do {
- e->Lface = newLface;
- e = e->Lnext;
- } while( e != eStart );
-
- /* delete from circular doubly-linked list */
- fPrev = fDel->prev;
- fNext = fDel->next;
- fNext->prev = fPrev;
- fPrev->next = fNext;
-
- memFree( fDel );
-}
-
-
-/****************** Basic Edge Operations **********************/
-
-/* __gl_meshMakeEdge creates one edge, two vertices, and a loop (face).
- * The loop consists of the two new half-edges.
- */
-GLUhalfEdge *__gl_meshMakeEdge( GLUmesh *mesh )
-{
- GLUvertex *newVertex1= allocVertex();
- GLUvertex *newVertex2= allocVertex();
- GLUface *newFace= allocFace();
- GLUhalfEdge *e;
-
- /* if any one is null then all get freed */
- if (newVertex1 == NULL || newVertex2 == NULL || newFace == NULL) {
- if (newVertex1 != NULL) memFree(newVertex1);
- if (newVertex2 != NULL) memFree(newVertex2);
- if (newFace != NULL) memFree(newFace);
- return NULL;
- }
-
- e = MakeEdge( &mesh->eHead );
- if (e == NULL) return NULL;
-
- MakeVertex( newVertex1, e, &mesh->vHead );
- MakeVertex( newVertex2, e->Sym, &mesh->vHead );
- MakeFace( newFace, e, &mesh->fHead );
- return e;
-}
-
-
-/* __gl_meshSplice( eOrg, eDst ) is the basic operation for changing the
- * mesh connectivity and topology. It changes the mesh so that
- * eOrg->Onext <- OLD( eDst->Onext )
- * eDst->Onext <- OLD( eOrg->Onext )
- * where OLD(...) means the value before the meshSplice operation.
- *
- * This can have two effects on the vertex structure:
- * - if eOrg->Org != eDst->Org, the two vertices are merged together
- * - if eOrg->Org == eDst->Org, the origin is split into two vertices
- * In both cases, eDst->Org is changed and eOrg->Org is untouched.
- *
- * Similarly (and independently) for the face structure,
- * - if eOrg->Lface == eDst->Lface, one loop is split into two
- * - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one
- * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.
- *
- * Some special cases:
- * If eDst == eOrg, the operation has no effect.
- * If eDst == eOrg->Lnext, the new face will have a single edge.
- * If eDst == eOrg->Lprev, the old face will have a single edge.
- * If eDst == eOrg->Onext, the new vertex will have a single edge.
- * If eDst == eOrg->Oprev, the old vertex will have a single edge.
- */
-int __gl_meshSplice( GLUhalfEdge *eOrg, GLUhalfEdge *eDst )
-{
- int joiningLoops = FALSE;
- int joiningVertices = FALSE;
-
- if( eOrg == eDst ) return 1;
-
- if( eDst->Org != eOrg->Org ) {
- /* We are merging two disjoint vertices -- destroy eDst->Org */
- joiningVertices = TRUE;
- KillVertex( eDst->Org, eOrg->Org );
- }
- if( eDst->Lface != eOrg->Lface ) {
- /* We are connecting two disjoint loops -- destroy eDst->Lface */
- joiningLoops = TRUE;
- KillFace( eDst->Lface, eOrg->Lface );
- }
-
- /* Change the edge structure */
- Splice( eDst, eOrg );
-
- if( ! joiningVertices ) {
- GLUvertex *newVertex= allocVertex();
- if (newVertex == NULL) return 0;
-
- /* We split one vertex into two -- the new vertex is eDst->Org.
- * Make sure the old vertex points to a valid half-edge.
- */
- MakeVertex( newVertex, eDst, eOrg->Org );
- eOrg->Org->anEdge = eOrg;
- }
- if( ! joiningLoops ) {
- GLUface *newFace= allocFace();
- if (newFace == NULL) return 0;
-
- /* We split one loop into two -- the new loop is eDst->Lface.
- * Make sure the old face points to a valid half-edge.
- */
- MakeFace( newFace, eDst, eOrg->Lface );
- eOrg->Lface->anEdge = eOrg;
- }
-
- return 1;
-}
-
-
-/* __gl_meshDelete( eDel ) removes the edge eDel. There are several cases:
- * if (eDel->Lface != eDel->Rface), we join two loops into one; the loop
- * eDel->Lface is deleted. Otherwise, we are splitting one loop into two;
- * the newly created loop will contain eDel->Dst. If the deletion of eDel
- * would create isolated vertices, those are deleted as well.
- *
- * This function could be implemented as two calls to __gl_meshSplice
- * plus a few calls to memFree, but this would allocate and delete
- * unnecessary vertices and faces.
- */
-int __gl_meshDelete( GLUhalfEdge *eDel )
-{
- GLUhalfEdge *eDelSym = eDel->Sym;
- int joiningLoops = FALSE;
-
- /* First step: disconnect the origin vertex eDel->Org. We make all
- * changes to get a consistent mesh in this "intermediate" state.
- */
- if( eDel->Lface != eDel->Rface ) {
- /* We are joining two loops into one -- remove the left face */
- joiningLoops = TRUE;
- KillFace( eDel->Lface, eDel->Rface );
- }
-
- if( eDel->Onext == eDel ) {
- KillVertex( eDel->Org, NULL );
- } else {
- /* Make sure that eDel->Org and eDel->Rface point to valid half-edges */
- eDel->Rface->anEdge = eDel->Oprev;
- eDel->Org->anEdge = eDel->Onext;
-
- Splice( eDel, eDel->Oprev );
- if( ! joiningLoops ) {
- GLUface *newFace= allocFace();
- if (newFace == NULL) return 0;
-
- /* We are splitting one loop into two -- create a new loop for eDel. */
- MakeFace( newFace, eDel, eDel->Lface );
- }
- }
-
- /* Claim: the mesh is now in a consistent state, except that eDel->Org
- * may have been deleted. Now we disconnect eDel->Dst.
- */
- if( eDelSym->Onext == eDelSym ) {
- KillVertex( eDelSym->Org, NULL );
- KillFace( eDelSym->Lface, NULL );
- } else {
- /* Make sure that eDel->Dst and eDel->Lface point to valid half-edges */
- eDel->Lface->anEdge = eDelSym->Oprev;
- eDelSym->Org->anEdge = eDelSym->Onext;
- Splice( eDelSym, eDelSym->Oprev );
- }
-
- /* Any isolated vertices or faces have already been freed. */
- KillEdge( eDel );
-
- return 1;
-}
-
-
-/******************** Other Edge Operations **********************/
-
-/* All these routines can be implemented with the basic edge
- * operations above. They are provided for convenience and efficiency.
- */
-
-
-/* __gl_meshAddEdgeVertex( eOrg ) creates a new edge eNew such that
- * eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex.
- * eOrg and eNew will have the same left face.
- */
-GLUhalfEdge *__gl_meshAddEdgeVertex( GLUhalfEdge *eOrg )
-{
- GLUhalfEdge *eNewSym;
- GLUhalfEdge *eNew = MakeEdge( eOrg );
- if (eNew == NULL) return NULL;
-
- eNewSym = eNew->Sym;
-
- /* Connect the new edge appropriately */
- Splice( eNew, eOrg->Lnext );
-
- /* Set the vertex and face information */
- eNew->Org = eOrg->Dst;
- {
- GLUvertex *newVertex= allocVertex();
- if (newVertex == NULL) return NULL;
-
- MakeVertex( newVertex, eNewSym, eNew->Org );
- }
- eNew->Lface = eNewSym->Lface = eOrg->Lface;
-
- return eNew;
-}
-
-
-/* __gl_meshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,
- * such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org.
- * eOrg and eNew will have the same left face.
- */
-GLUhalfEdge *__gl_meshSplitEdge( GLUhalfEdge *eOrg )
-{
- GLUhalfEdge *eNew;
- GLUhalfEdge *tempHalfEdge= __gl_meshAddEdgeVertex( eOrg );
- if (tempHalfEdge == NULL) return NULL;
-
- eNew = tempHalfEdge->Sym;
-
- /* Disconnect eOrg from eOrg->Dst and connect it to eNew->Org */
- Splice( eOrg->Sym, eOrg->Sym->Oprev );
- Splice( eOrg->Sym, eNew );
-
- /* Set the vertex and face information */
- eOrg->Dst = eNew->Org;
- eNew->Dst->anEdge = eNew->Sym; /* may have pointed to eOrg->Sym */
- eNew->Rface = eOrg->Rface;
- eNew->winding = eOrg->winding; /* copy old winding information */
- eNew->Sym->winding = eOrg->Sym->winding;
-
- return eNew;
-}
-
-
-/* __gl_meshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst
- * to eDst->Org, and returns the corresponding half-edge eNew.
- * If eOrg->Lface == eDst->Lface, this splits one loop into two,
- * and the newly created loop is eNew->Lface. Otherwise, two disjoint
- * loops are merged into one, and the loop eDst->Lface is destroyed.
- *
- * If (eOrg == eDst), the new face will have only two edges.
- * If (eOrg->Lnext == eDst), the old face is reduced to a single edge.
- * If (eOrg->Lnext->Lnext == eDst), the old face is reduced to two edges.
- */
-GLUhalfEdge *__gl_meshConnect( GLUhalfEdge *eOrg, GLUhalfEdge *eDst )
-{
- GLUhalfEdge *eNewSym;
- int joiningLoops = FALSE;
- GLUhalfEdge *eNew = MakeEdge( eOrg );
- if (eNew == NULL) return NULL;
-
- eNewSym = eNew->Sym;
-
- if( eDst->Lface != eOrg->Lface ) {
- /* We are connecting two disjoint loops -- destroy eDst->Lface */
- joiningLoops = TRUE;
- KillFace( eDst->Lface, eOrg->Lface );
- }
-
- /* Connect the new edge appropriately */
- Splice( eNew, eOrg->Lnext );
- Splice( eNewSym, eDst );
-
- /* Set the vertex and face information */
- eNew->Org = eOrg->Dst;
- eNewSym->Org = eDst->Org;
- eNew->Lface = eNewSym->Lface = eOrg->Lface;
-
- /* Make sure the old face points to a valid half-edge */
- eOrg->Lface->anEdge = eNewSym;
-
- if( ! joiningLoops ) {
- GLUface *newFace= allocFace();
- if (newFace == NULL) return NULL;
-
- /* We split one loop into two -- the new loop is eNew->Lface */
- MakeFace( newFace, eNew, eOrg->Lface );
- }
- return eNew;
-}
-
-
-/******************** Other Operations **********************/
-
-/* __gl_meshZapFace( fZap ) destroys a face and removes it from the
- * global face list. All edges of fZap will have a NULL pointer as their
- * left face. Any edges which also have a NULL pointer as their right face
- * are deleted entirely (along with any isolated vertices this produces).
- * An entire mesh can be deleted by zapping its faces, one at a time,
- * in any order. Zapped faces cannot be used in further mesh operations!
- */
-void __gl_meshZapFace( GLUface *fZap )
-{
- GLUhalfEdge *eStart = fZap->anEdge;
- GLUhalfEdge *e, *eNext, *eSym;
- GLUface *fPrev, *fNext;
-
- /* walk around face, deleting edges whose right face is also NULL */
- eNext = eStart->Lnext;
- do {
- e = eNext;
- eNext = e->Lnext;
-
- e->Lface = NULL;
- if( e->Rface == NULL ) {
- /* delete the edge -- see __gl_MeshDelete above */
-
- if( e->Onext == e ) {
- KillVertex( e->Org, NULL );
- } else {
- /* Make sure that e->Org points to a valid half-edge */
- e->Org->anEdge = e->Onext;
- Splice( e, e->Oprev );
- }
- eSym = e->Sym;
- if( eSym->Onext == eSym ) {
- KillVertex( eSym->Org, NULL );
- } else {
- /* Make sure that eSym->Org points to a valid half-edge */
- eSym->Org->anEdge = eSym->Onext;
- Splice( eSym, eSym->Oprev );
- }
- KillEdge( e );
- }
- } while( e != eStart );
-
- /* delete from circular doubly-linked list */
- fPrev = fZap->prev;
- fNext = fZap->next;
- fNext->prev = fPrev;
- fPrev->next = fNext;
-
- memFree( fZap );
-}
-
-
-/* __gl_meshNewMesh() creates a new mesh with no edges, no vertices,
- * and no loops (what we usually call a "face").
- */
-GLUmesh *__gl_meshNewMesh( void )
-{
- GLUvertex *v;
- GLUface *f;
- GLUhalfEdge *e;
- GLUhalfEdge *eSym;
- GLUmesh *mesh = (GLUmesh *)memAlloc( sizeof( GLUmesh ));
- if (mesh == NULL) {
- return NULL;
- }
-
- v = &mesh->vHead;
- f = &mesh->fHead;
- e = &mesh->eHead;
- eSym = &mesh->eHeadSym;
-
- v->next = v->prev = v;
- v->anEdge = NULL;
- v->data = NULL;
-
- f->next = f->prev = f;
- f->anEdge = NULL;
- f->data = NULL;
- f->trail = NULL;
- f->marked = FALSE;
- f->inside = FALSE;
-
- e->next = e;
- e->Sym = eSym;
- e->Onext = NULL;
- e->Lnext = NULL;
- e->Org = NULL;
- e->Lface = NULL;
- e->winding = 0;
- e->activeRegion = NULL;
-
- eSym->next = eSym;
- eSym->Sym = e;
- eSym->Onext = NULL;
- eSym->Lnext = NULL;
- eSym->Org = NULL;
- eSym->Lface = NULL;
- eSym->winding = 0;
- eSym->activeRegion = NULL;
-
- return mesh;
-}
-
-
-/* __gl_meshUnion( mesh1, mesh2 ) forms the union of all structures in
- * both meshes, and returns the new mesh (the old meshes are destroyed).
- */
-GLUmesh *__gl_meshUnion( GLUmesh *mesh1, GLUmesh *mesh2 )
-{
- GLUface *f1 = &mesh1->fHead;
- GLUvertex *v1 = &mesh1->vHead;
- GLUhalfEdge *e1 = &mesh1->eHead;
- GLUface *f2 = &mesh2->fHead;
- GLUvertex *v2 = &mesh2->vHead;
- GLUhalfEdge *e2 = &mesh2->eHead;
-
- /* Add the faces, vertices, and edges of mesh2 to those of mesh1 */
- if( f2->next != f2 ) {
- f1->prev->next = f2->next;
- f2->next->prev = f1->prev;
- f2->prev->next = f1;
- f1->prev = f2->prev;
- }
-
- if( v2->next != v2 ) {
- v1->prev->next = v2->next;
- v2->next->prev = v1->prev;
- v2->prev->next = v1;
- v1->prev = v2->prev;
- }
-
- if( e2->next != e2 ) {
- e1->Sym->next->Sym->next = e2->next;
- e2->next->Sym->next = e1->Sym->next;
- e2->Sym->next->Sym->next = e1;
- e1->Sym->next = e2->Sym->next;
- }
-
- memFree( mesh2 );
- return mesh1;
-}
-
-
-#ifdef DELETE_BY_ZAPPING
-
-/* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
- */
-void __gl_meshDeleteMesh( GLUmesh *mesh )
-{
- GLUface *fHead = &mesh->fHead;
-
- while( fHead->next != fHead ) {
- __gl_meshZapFace( fHead->next );
- }
- assert( mesh->vHead.next == &mesh->vHead );
-
- memFree( mesh );
-}
-
-#else
-
-/* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
- */
-void __gl_meshDeleteMesh( GLUmesh *mesh )
-{
- GLUface *f, *fNext;
- GLUvertex *v, *vNext;
- GLUhalfEdge *e, *eNext;
-
- for( f = mesh->fHead.next; f != &mesh->fHead; f = fNext ) {
- fNext = f->next;
- memFree( f );
- }
-
- for( v = mesh->vHead.next; v != &mesh->vHead; v = vNext ) {
- vNext = v->next;
- memFree( v );
- }
-
- for( e = mesh->eHead.next; e != &mesh->eHead; e = eNext ) {
- /* One call frees both e and e->Sym (see EdgePair above) */
- eNext = e->next;
- memFree( e );
- }
-
- memFree( mesh );
-}
-
-#endif
-
-#ifndef NDEBUG
-
-/* __gl_meshCheckMesh( mesh ) checks a mesh for self-consistency.
- */
-void __gl_meshCheckMesh( GLUmesh *mesh )
-{
- GLUface *fHead = &mesh->fHead;
- GLUvertex *vHead = &mesh->vHead;
- GLUhalfEdge *eHead = &mesh->eHead;
- GLUface *f, *fPrev;
- GLUvertex *v, *vPrev;
- GLUhalfEdge *e, *ePrev;
-
- fPrev = fHead;
- for( fPrev = fHead ; (f = fPrev->next) != fHead; fPrev = f) {
- assert( f->prev == fPrev );
- e = f->anEdge;
- do {
- assert( e->Sym != e );
- assert( e->Sym->Sym == e );
- assert( e->Lnext->Onext->Sym == e );
- assert( e->Onext->Sym->Lnext == e );
- assert( e->Lface == f );
- e = e->Lnext;
- } while( e != f->anEdge );
- }
- assert( f->prev == fPrev && f->anEdge == NULL && f->data == NULL );
-
- vPrev = vHead;
- for( vPrev = vHead ; (v = vPrev->next) != vHead; vPrev = v) {
- assert( v->prev == vPrev );
- e = v->anEdge;
- do {
- assert( e->Sym != e );
- assert( e->Sym->Sym == e );
- assert( e->Lnext->Onext->Sym == e );
- assert( e->Onext->Sym->Lnext == e );
- assert( e->Org == v );
- e = e->Onext;
- } while( e != v->anEdge );
- }
- assert( v->prev == vPrev && v->anEdge == NULL && v->data == NULL );
-
- ePrev = eHead;
- for( ePrev = eHead ; (e = ePrev->next) != eHead; ePrev = e) {
- assert( e->Sym->next == ePrev->Sym );
- assert( e->Sym != e );
- assert( e->Sym->Sym == e );
- assert( e->Org != NULL );
- assert( e->Dst != NULL );
- assert( e->Lnext->Onext->Sym == e );
- assert( e->Onext->Sym->Lnext == e );
- }
- assert( e->Sym->next == ePrev->Sym
- && e->Sym == &mesh->eHeadSym
- && e->Sym->Sym == e
- && e->Org == NULL && e->Dst == NULL
- && e->Lface == NULL && e->Rface == NULL );
-}
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/mesh.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/mesh.h
deleted file mode 100755
index 77a0d61f5..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/mesh.h
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/mesh.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef __mesh_h_
-#define __mesh_h_
-
-#include <GL/glu.h>
-
-typedef struct GLUmesh GLUmesh;
-
-typedef struct GLUvertex GLUvertex;
-typedef struct GLUface GLUface;
-typedef struct GLUhalfEdge GLUhalfEdge;
-
-typedef struct ActiveRegion ActiveRegion; /* Internal data */
-
-/* The mesh structure is similar in spirit, notation, and operations
- * to the "quad-edge" structure (see L. Guibas and J. Stolfi, Primitives
- * for the manipulation of general subdivisions and the computation of
- * Voronoi diagrams, ACM Transactions on Graphics, 4(2):74-123, April 1985).
- * For a simplified description, see the course notes for CS348a,
- * "Mathematical Foundations of Computer Graphics", available at the
- * Stanford bookstore (and taught during the fall quarter).
- * The implementation also borrows a tiny subset of the graph-based approach
- * use in Mantyla's Geometric Work Bench (see M. Mantyla, An Introduction
- * to Sold Modeling, Computer Science Press, Rockville, Maryland, 1988).
- *
- * The fundamental data structure is the "half-edge". Two half-edges
- * go together to make an edge, but they point in opposite directions.
- * Each half-edge has a pointer to its mate (the "symmetric" half-edge Sym),
- * its origin vertex (Org), the face on its left side (Lface), and the
- * adjacent half-edges in the CCW direction around the origin vertex
- * (Onext) and around the left face (Lnext). There is also a "next"
- * pointer for the global edge list (see below).
- *
- * The notation used for mesh navigation:
- * Sym = the mate of a half-edge (same edge, but opposite direction)
- * Onext = edge CCW around origin vertex (keep same origin)
- * Dnext = edge CCW around destination vertex (keep same dest)
- * Lnext = edge CCW around left face (dest becomes new origin)
- * Rnext = edge CCW around right face (origin becomes new dest)
- *
- * "prev" means to substitute CW for CCW in the definitions above.
- *
- * The mesh keeps global lists of all vertices, faces, and edges,
- * stored as doubly-linked circular lists with a dummy header node.
- * The mesh stores pointers to these dummy headers (vHead, fHead, eHead).
- *
- * The circular edge list is special; since half-edges always occur
- * in pairs (e and e->Sym), each half-edge stores a pointer in only
- * one direction. Starting at eHead and following the e->next pointers
- * will visit each *edge* once (ie. e or e->Sym, but not both).
- * e->Sym stores a pointer in the opposite direction, thus it is
- * always true that e->Sym->next->Sym->next == e.
- *
- * Each vertex has a pointer to next and previous vertices in the
- * circular list, and a pointer to a half-edge with this vertex as
- * the origin (NULL if this is the dummy header). There is also a
- * field "data" for client data.
- *
- * Each face has a pointer to the next and previous faces in the
- * circular list, and a pointer to a half-edge with this face as
- * the left face (NULL if this is the dummy header). There is also
- * a field "data" for client data.
- *
- * Note that what we call a "face" is really a loop; faces may consist
- * of more than one loop (ie. not simply connected), but there is no
- * record of this in the data structure. The mesh may consist of
- * several disconnected regions, so it may not be possible to visit
- * the entire mesh by starting at a half-edge and traversing the edge
- * structure.
- *
- * The mesh does NOT support isolated vertices; a vertex is deleted along
- * with its last edge. Similarly when two faces are merged, one of the
- * faces is deleted (see __gl_meshDelete below). For mesh operations,
- * all face (loop) and vertex pointers must not be NULL. However, once
- * mesh manipulation is finished, __gl_MeshZapFace can be used to delete
- * faces of the mesh, one at a time. All external faces can be "zapped"
- * before the mesh is returned to the client; then a NULL face indicates
- * a region which is not part of the output polygon.
- */
-
-struct GLUvertex {
- GLUvertex *next; /* next vertex (never NULL) */
- GLUvertex *prev; /* previous vertex (never NULL) */
- GLUhalfEdge *anEdge; /* a half-edge with this origin */
- void *data; /* client's data */
-
- /* Internal data (keep hidden) */
- GLdouble coords[3]; /* vertex location in 3D */
- GLdouble s, t; /* projection onto the sweep plane */
- long pqHandle; /* to allow deletion from priority queue */
-};
-
-struct GLUface {
- GLUface *next; /* next face (never NULL) */
- GLUface *prev; /* previous face (never NULL) */
- GLUhalfEdge *anEdge; /* a half edge with this left face */
- void *data; /* room for client's data */
-
- /* Internal data (keep hidden) */
- GLUface *trail; /* "stack" for conversion to strips */
- GLboolean marked; /* flag for conversion to strips */
- GLboolean inside; /* this face is in the polygon interior */
-};
-
-struct GLUhalfEdge {
- GLUhalfEdge *next; /* doubly-linked list (prev==Sym->next) */
- GLUhalfEdge *Sym; /* same edge, opposite direction */
- GLUhalfEdge *Onext; /* next edge CCW around origin */
- GLUhalfEdge *Lnext; /* next edge CCW around left face */
- GLUvertex *Org; /* origin vertex (Overtex too long) */
- GLUface *Lface; /* left face */
-
- /* Internal data (keep hidden) */
- ActiveRegion *activeRegion; /* a region with this upper edge (sweep.c) */
- int winding; /* change in winding number when crossing
- from the right face to the left face */
-};
-
-#define Rface Sym->Lface
-#define Dst Sym->Org
-
-#define Oprev Sym->Lnext
-#define Lprev Onext->Sym
-#define Dprev Lnext->Sym
-#define Rprev Sym->Onext
-#define Dnext Rprev->Sym /* 3 pointers */
-#define Rnext Oprev->Sym /* 3 pointers */
-
-
-struct GLUmesh {
- GLUvertex vHead; /* dummy header for vertex list */
- GLUface fHead; /* dummy header for face list */
- GLUhalfEdge eHead; /* dummy header for edge list */
- GLUhalfEdge eHeadSym; /* and its symmetric counterpart */
-};
-
-/* The mesh operations below have three motivations: completeness,
- * convenience, and efficiency. The basic mesh operations are MakeEdge,
- * Splice, and Delete. All the other edge operations can be implemented
- * in terms of these. The other operations are provided for convenience
- * and/or efficiency.
- *
- * When a face is split or a vertex is added, they are inserted into the
- * global list *before* the existing vertex or face (ie. e->Org or e->Lface).
- * This makes it easier to process all vertices or faces in the global lists
- * without worrying about processing the same data twice. As a convenience,
- * when a face is split, the "inside" flag is copied from the old face.
- * Other internal data (v->data, v->activeRegion, f->data, f->marked,
- * f->trail, e->winding) is set to zero.
- *
- * ********************** Basic Edge Operations **************************
- *
- * __gl_meshMakeEdge( mesh ) creates one edge, two vertices, and a loop.
- * The loop (face) consists of the two new half-edges.
- *
- * __gl_meshSplice( eOrg, eDst ) is the basic operation for changing the
- * mesh connectivity and topology. It changes the mesh so that
- * eOrg->Onext <- OLD( eDst->Onext )
- * eDst->Onext <- OLD( eOrg->Onext )
- * where OLD(...) means the value before the meshSplice operation.
- *
- * This can have two effects on the vertex structure:
- * - if eOrg->Org != eDst->Org, the two vertices are merged together
- * - if eOrg->Org == eDst->Org, the origin is split into two vertices
- * In both cases, eDst->Org is changed and eOrg->Org is untouched.
- *
- * Similarly (and independently) for the face structure,
- * - if eOrg->Lface == eDst->Lface, one loop is split into two
- * - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one
- * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.
- *
- * __gl_meshDelete( eDel ) removes the edge eDel. There are several cases:
- * if (eDel->Lface != eDel->Rface), we join two loops into one; the loop
- * eDel->Lface is deleted. Otherwise, we are splitting one loop into two;
- * the newly created loop will contain eDel->Dst. If the deletion of eDel
- * would create isolated vertices, those are deleted as well.
- *
- * ********************** Other Edge Operations **************************
- *
- * __gl_meshAddEdgeVertex( eOrg ) creates a new edge eNew such that
- * eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex.
- * eOrg and eNew will have the same left face.
- *
- * __gl_meshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,
- * such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org.
- * eOrg and eNew will have the same left face.
- *
- * __gl_meshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst
- * to eDst->Org, and returns the corresponding half-edge eNew.
- * If eOrg->Lface == eDst->Lface, this splits one loop into two,
- * and the newly created loop is eNew->Lface. Otherwise, two disjoint
- * loops are merged into one, and the loop eDst->Lface is destroyed.
- *
- * ************************ Other Operations *****************************
- *
- * __gl_meshNewMesh() creates a new mesh with no edges, no vertices,
- * and no loops (what we usually call a "face").
- *
- * __gl_meshUnion( mesh1, mesh2 ) forms the union of all structures in
- * both meshes, and returns the new mesh (the old meshes are destroyed).
- *
- * __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
- *
- * __gl_meshZapFace( fZap ) destroys a face and removes it from the
- * global face list. All edges of fZap will have a NULL pointer as their
- * left face. Any edges which also have a NULL pointer as their right face
- * are deleted entirely (along with any isolated vertices this produces).
- * An entire mesh can be deleted by zapping its faces, one at a time,
- * in any order. Zapped faces cannot be used in further mesh operations!
- *
- * __gl_meshCheckMesh( mesh ) checks a mesh for self-consistency.
- */
-
-GLUhalfEdge *__gl_meshMakeEdge( GLUmesh *mesh );
-int __gl_meshSplice( GLUhalfEdge *eOrg, GLUhalfEdge *eDst );
-int __gl_meshDelete( GLUhalfEdge *eDel );
-
-GLUhalfEdge *__gl_meshAddEdgeVertex( GLUhalfEdge *eOrg );
-GLUhalfEdge *__gl_meshSplitEdge( GLUhalfEdge *eOrg );
-GLUhalfEdge *__gl_meshConnect( GLUhalfEdge *eOrg, GLUhalfEdge *eDst );
-
-GLUmesh *__gl_meshNewMesh( void );
-GLUmesh *__gl_meshUnion( GLUmesh *mesh1, GLUmesh *mesh2 );
-void __gl_meshDeleteMesh( GLUmesh *mesh );
-void __gl_meshZapFace( GLUface *fZap );
-
-#ifdef NDEBUG
-#define __gl_meshCheckMesh( mesh )
-#else
-void __gl_meshCheckMesh( GLUmesh *mesh );
-#endif
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/normal.c b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/normal.c
deleted file mode 100755
index 1c5976505..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/normal.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libtess/normal.c,v 1.3 2002/02/22 21:32:49 dawes Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-*/
-
-#include "gluos.h"
-#include "mesh.h"
-#include "tess.h"
-#include "normal.h"
-#include <math.h>
-#include <assert.h>
-
-#define TRUE 1
-#define FALSE 0
-
-#define Dot(u,v) (u[0]*v[0] + u[1]*v[1] + u[2]*v[2])
-
-static void Normalize( GLdouble v[3] )
-{
- GLdouble len = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
-
- assert( len > 0 );
- len = sqrt( len );
- v[0] /= len;
- v[1] /= len;
- v[2] /= len;
-}
-
-#define ABS(x) ((x) < 0 ? -(x) : (x))
-
-static int LongAxis( GLdouble v[3] )
-{
- int i = 0;
-
- if( ABS(v[1]) > ABS(v[0]) ) { i = 1; }
- if( ABS(v[2]) > ABS(v[i]) ) { i = 2; }
- return i;
-}
-
-static void ComputeNormal( GLUtesselator *tess, GLdouble norm[3] )
-{
- GLUvertex *v, *v1, *v2;
- GLdouble c, tLen2, maxLen2;
- GLdouble maxVal[3], minVal[3], d1[3], d2[3], tNorm[3];
- GLUvertex *maxVert[3], *minVert[3];
- GLUvertex *vHead = &tess->mesh->vHead;
- int i;
-
- maxVal[0] = maxVal[1] = maxVal[2] = -2 * GLU_TESS_MAX_COORD;
- minVal[0] = minVal[1] = minVal[2] = 2 * GLU_TESS_MAX_COORD;
-
- for( v = vHead->next; v != vHead; v = v->next ) {
- for( i = 0; i < 3; ++i ) {
- c = v->coords[i];
- if( c < minVal[i] ) { minVal[i] = c; minVert[i] = v; }
- if( c > maxVal[i] ) { maxVal[i] = c; maxVert[i] = v; }
- }
- }
-
- /* Find two vertices separated by at least 1/sqrt(3) of the maximum
- * distance between any two vertices
- */
- i = 0;
- if( maxVal[1] - minVal[1] > maxVal[0] - minVal[0] ) { i = 1; }
- if( maxVal[2] - minVal[2] > maxVal[i] - minVal[i] ) { i = 2; }
- if( minVal[i] >= maxVal[i] ) {
- /* All vertices are the same -- normal doesn't matter */
- norm[0] = 0; norm[1] = 0; norm[2] = 1;
- return;
- }
-
- /* Look for a third vertex which forms the triangle with maximum area
- * (Length of normal == twice the triangle area)
- */
- maxLen2 = 0;
- v1 = minVert[i];
- v2 = maxVert[i];
- d1[0] = v1->coords[0] - v2->coords[0];
- d1[1] = v1->coords[1] - v2->coords[1];
- d1[2] = v1->coords[2] - v2->coords[2];
- for( v = vHead->next; v != vHead; v = v->next ) {
- d2[0] = v->coords[0] - v2->coords[0];
- d2[1] = v->coords[1] - v2->coords[1];
- d2[2] = v->coords[2] - v2->coords[2];
- tNorm[0] = d1[1]*d2[2] - d1[2]*d2[1];
- tNorm[1] = d1[2]*d2[0] - d1[0]*d2[2];
- tNorm[2] = d1[0]*d2[1] - d1[1]*d2[0];
- tLen2 = tNorm[0]*tNorm[0] + tNorm[1]*tNorm[1] + tNorm[2]*tNorm[2];
- if( tLen2 > maxLen2 ) {
- maxLen2 = tLen2;
- norm[0] = tNorm[0];
- norm[1] = tNorm[1];
- norm[2] = tNorm[2];
- }
- }
-
- if( maxLen2 <= 0 ) {
- /* All points lie on a single line -- any decent normal will do */
- norm[0] = norm[1] = norm[2] = 0;
- norm[LongAxis(d1)] = 1;
- }
-}
-
-
-static void CheckOrientation( GLUtesselator *tess )
-{
- GLdouble area;
- GLUface *f, *fHead = &tess->mesh->fHead;
- GLUvertex *v, *vHead = &tess->mesh->vHead;
- GLUhalfEdge *e;
-
- /* When we compute the normal automatically, we choose the orientation
- * so that the the sum of the signed areas of all contours is non-negative.
- */
- area = 0;
- for( f = fHead->next; f != fHead; f = f->next ) {
- e = f->anEdge;
- if( e->winding <= 0 ) continue;
- do {
- area += (e->Org->s - e->Dst->s) * (e->Org->t + e->Dst->t);
- e = e->Lnext;
- } while( e != f->anEdge );
- }
- if( area < 0 ) {
- /* Reverse the orientation by flipping all the t-coordinates */
- for( v = vHead->next; v != vHead; v = v->next ) {
- v->t = - v->t;
- }
- tess->tUnit[0] = - tess->tUnit[0];
- tess->tUnit[1] = - tess->tUnit[1];
- tess->tUnit[2] = - tess->tUnit[2];
- }
-}
-
-#ifdef FOR_TRITE_TEST_PROGRAM
-#include <stdlib.h>
-extern int RandomSweep;
-#define S_UNIT_X (RandomSweep ? (2*drand48()-1) : 1.0)
-#define S_UNIT_Y (RandomSweep ? (2*drand48()-1) : 0.0)
-#else
-#if defined(SLANTED_SWEEP)
-/* The "feature merging" is not intended to be complete. There are
- * special cases where edges are nearly parallel to the sweep line
- * which are not implemented. The algorithm should still behave
- * robustly (ie. produce a reasonable tesselation) in the presence
- * of such edges, however it may miss features which could have been
- * merged. We could minimize this effect by choosing the sweep line
- * direction to be something unusual (ie. not parallel to one of the
- * coordinate axes).
- */
-#define S_UNIT_X 0.50941539564955385 /* Pre-normalized */
-#define S_UNIT_Y 0.86052074622010633
-#else
-#define S_UNIT_X 1.0
-#define S_UNIT_Y 0.0
-#endif
-#endif
-
-/* Determine the polygon normal and project vertices onto the plane
- * of the polygon.
- */
-void __gl_projectPolygon( GLUtesselator *tess )
-{
- GLUvertex *v, *vHead = &tess->mesh->vHead;
- GLdouble norm[3];
-#if defined(FOR_TRITE_TEST_PROGRAM) || defined(TRUE_PROJECT)
- Gldouble w;
-#endif
- GLdouble *sUnit, *tUnit;
- int i, computedNormal = FALSE;
-
- norm[0] = tess->normal[0];
- norm[1] = tess->normal[1];
- norm[2] = tess->normal[2];
- if( norm[0] == 0 && norm[1] == 0 && norm[2] == 0 ) {
- ComputeNormal( tess, norm );
- computedNormal = TRUE;
- }
- sUnit = tess->sUnit;
- tUnit = tess->tUnit;
- i = LongAxis( norm );
-
-#if defined(FOR_TRITE_TEST_PROGRAM) || defined(TRUE_PROJECT)
- /* Choose the initial sUnit vector to be approximately perpendicular
- * to the normal.
- */
- Normalize( norm );
-
- sUnit[i] = 0;
- sUnit[(i+1)%3] = S_UNIT_X;
- sUnit[(i+2)%3] = S_UNIT_Y;
-
- /* Now make it exactly perpendicular */
- w = Dot( sUnit, norm );
- sUnit[0] -= w * norm[0];
- sUnit[1] -= w * norm[1];
- sUnit[2] -= w * norm[2];
- Normalize( sUnit );
-
- /* Choose tUnit so that (sUnit,tUnit,norm) form a right-handed frame */
- tUnit[0] = norm[1]*sUnit[2] - norm[2]*sUnit[1];
- tUnit[1] = norm[2]*sUnit[0] - norm[0]*sUnit[2];
- tUnit[2] = norm[0]*sUnit[1] - norm[1]*sUnit[0];
- Normalize( tUnit );
-#else
- /* Project perpendicular to a coordinate axis -- better numerically */
- sUnit[i] = 0;
- sUnit[(i+1)%3] = S_UNIT_X;
- sUnit[(i+2)%3] = S_UNIT_Y;
-
- tUnit[i] = 0;
- tUnit[(i+1)%3] = (norm[i] > 0) ? -S_UNIT_Y : S_UNIT_Y;
- tUnit[(i+2)%3] = (norm[i] > 0) ? S_UNIT_X : -S_UNIT_X;
-#endif
-
- /* Project the vertices onto the sweep plane */
- for( v = vHead->next; v != vHead; v = v->next ) {
- v->s = Dot( v->coords, sUnit );
- v->t = Dot( v->coords, tUnit );
- }
- if( computedNormal ) {
- CheckOrientation( tess );
- }
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/normal.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/normal.h
deleted file mode 100755
index 0dfaf34ad..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/normal.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/normal.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef __normal_h_
-#define __normal_h_
-
-#include "tess.h"
-
-/* __gl_projectPolygon( tess ) determines the polygon normal
- * and project vertices onto the plane of the polygon.
- */
-void __gl_projectPolygon( GLUtesselator *tess );
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq-heap.c b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq-heap.c
deleted file mode 100755
index 846af1b8a..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq-heap.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/priorityq-heap.c,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include <stddef.h>
-#include <assert.h>
-#include "priorityq-heap.h"
-#include "memalloc.h"
-
-#define INIT_SIZE 32
-
-#define TRUE 1
-#define FALSE 0
-
-#ifdef FOR_TRITE_TEST_PROGRAM
-#define LEQ(x,y) (*pq->leq)(x,y)
-#else
-/* Violates modularity, but a little faster */
-#include "geom.h"
-#define LEQ(x,y) VertLeq((GLUvertex *)x, (GLUvertex *)y)
-#endif
-
-/* really __gl_pqHeapNewPriorityQ */
-PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) )
-{
- PriorityQ *pq = (PriorityQ *)memAlloc( sizeof( PriorityQ ));
- if (pq == NULL) return NULL;
-
- pq->size = 0;
- pq->max = INIT_SIZE;
- pq->nodes = (PQnode *)memAlloc( (INIT_SIZE + 1) * sizeof(pq->nodes[0]) );
- if (pq->nodes == NULL) {
- memFree(pq);
- return NULL;
- }
-
- pq->handles = (PQhandleElem *)memAlloc( (INIT_SIZE + 1) * sizeof(pq->handles[0]) );
- if (pq->handles == NULL) {
- memFree(pq->nodes);
- memFree(pq);
- return NULL;
- }
-
- pq->initialized = FALSE;
- pq->freeList = 0;
- pq->leq = leq;
-
- pq->nodes[1].handle = 1; /* so that Minimum() returns NULL */
- pq->handles[1].key = NULL;
- return pq;
-}
-
-/* really __gl_pqHeapDeletePriorityQ */
-void pqDeletePriorityQ( PriorityQ *pq )
-{
- memFree( pq->handles );
- memFree( pq->nodes );
- memFree( pq );
-}
-
-
-static void FloatDown( PriorityQ *pq, long curr )
-{
- PQnode *n = pq->nodes;
- PQhandleElem *h = pq->handles;
- PQhandle hCurr, hChild;
- long child;
-
- hCurr = n[curr].handle;
- for( ;; ) {
- child = curr << 1;
- if( child < pq->size && LEQ( h[n[child+1].handle].key,
- h[n[child].handle].key )) {
- ++child;
- }
-
- assert(child <= pq->max);
-
- hChild = n[child].handle;
- if( child > pq->size || LEQ( h[hCurr].key, h[hChild].key )) {
- n[curr].handle = hCurr;
- h[hCurr].node = curr;
- break;
- }
- n[curr].handle = hChild;
- h[hChild].node = curr;
- curr = child;
- }
-}
-
-
-static void FloatUp( PriorityQ *pq, long curr )
-{
- PQnode *n = pq->nodes;
- PQhandleElem *h = pq->handles;
- PQhandle hCurr, hParent;
- long parent;
-
- hCurr = n[curr].handle;
- for( ;; ) {
- parent = curr >> 1;
- hParent = n[parent].handle;
- if( parent == 0 || LEQ( h[hParent].key, h[hCurr].key )) {
- n[curr].handle = hCurr;
- h[hCurr].node = curr;
- break;
- }
- n[curr].handle = hParent;
- h[hParent].node = curr;
- curr = parent;
- }
-}
-
-/* really __gl_pqHeapInit */
-void pqInit( PriorityQ *pq )
-{
- long i;
-
- /* This method of building a heap is O(n), rather than O(n lg n). */
-
- for( i = pq->size; i >= 1; --i ) {
- FloatDown( pq, i );
- }
- pq->initialized = TRUE;
-}
-
-/* really __gl_pqHeapInsert */
-/* returns LONG_MAX iff out of memory */
-PQhandle pqInsert( PriorityQ *pq, PQkey keyNew )
-{
- long curr;
- PQhandle free;
-
- curr = ++ pq->size;
- if( (curr*2) > pq->max ) {
- PQnode *saveNodes= pq->nodes;
- PQhandleElem *saveHandles= pq->handles;
-
- /* If the heap overflows, double its size. */
- pq->max <<= 1;
- pq->nodes = (PQnode *)memRealloc( pq->nodes,
- (size_t)
- ((pq->max + 1) * sizeof( pq->nodes[0] )));
- if (pq->nodes == NULL) {
- pq->nodes = saveNodes; /* restore ptr to free upon return */
- return LONG_MAX;
- }
- pq->handles = (PQhandleElem *)memRealloc( pq->handles,
- (size_t)
- ((pq->max + 1) *
- sizeof( pq->handles[0] )));
- if (pq->handles == NULL) {
- pq->handles = saveHandles; /* restore ptr to free upon return */
- return LONG_MAX;
- }
- }
-
- if( pq->freeList == 0 ) {
- free = curr;
- } else {
- free = pq->freeList;
- pq->freeList = pq->handles[free].node;
- }
-
- pq->nodes[curr].handle = free;
- pq->handles[free].node = curr;
- pq->handles[free].key = keyNew;
-
- if( pq->initialized ) {
- FloatUp( pq, curr );
- }
- assert(free != LONG_MAX);
- return free;
-}
-
-/* really __gl_pqHeapExtractMin */
-PQkey pqExtractMin( PriorityQ *pq )
-{
- PQnode *n = pq->nodes;
- PQhandleElem *h = pq->handles;
- PQhandle hMin = n[1].handle;
- PQkey min = h[hMin].key;
-
- if( pq->size > 0 ) {
- n[1].handle = n[pq->size].handle;
- h[n[1].handle].node = 1;
-
- h[hMin].key = NULL;
- h[hMin].node = pq->freeList;
- pq->freeList = hMin;
-
- if( -- pq->size > 0 ) {
- FloatDown( pq, 1 );
- }
- }
- return min;
-}
-
-/* really __gl_pqHeapDelete */
-void pqDelete( PriorityQ *pq, PQhandle hCurr )
-{
- PQnode *n = pq->nodes;
- PQhandleElem *h = pq->handles;
- long curr;
-
- assert( hCurr >= 1 && hCurr <= pq->max && h[hCurr].key != NULL );
-
- curr = h[hCurr].node;
- n[curr].handle = n[pq->size].handle;
- h[n[curr].handle].node = curr;
-
- if( curr <= -- pq->size ) {
- if( curr <= 1 || LEQ( h[n[curr>>1].handle].key, h[n[curr].handle].key )) {
- FloatDown( pq, curr );
- } else {
- FloatUp( pq, curr );
- }
- }
- h[hCurr].key = NULL;
- h[hCurr].node = pq->freeList;
- pq->freeList = hCurr;
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq-heap.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq-heap.h
deleted file mode 100755
index cb3b88031..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq-heap.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/priorityq-heap.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef __priorityq_heap_h_
-#define __priorityq_heap_h_
-
-/* Use #define's so that another heap implementation can use this one */
-
-#define PQkey PQHeapKey
-#define PQhandle PQHeapHandle
-#define PriorityQ PriorityQHeap
-
-#define pqNewPriorityQ(leq) __gl_pqHeapNewPriorityQ(leq)
-#define pqDeletePriorityQ(pq) __gl_pqHeapDeletePriorityQ(pq)
-
-/* The basic operations are insertion of a new key (pqInsert),
- * and examination/extraction of a key whose value is minimum
- * (pqMinimum/pqExtractMin). Deletion is also allowed (pqDelete);
- * for this purpose pqInsert returns a "handle" which is supplied
- * as the argument.
- *
- * An initial heap may be created efficiently by calling pqInsert
- * repeatedly, then calling pqInit. In any case pqInit must be called
- * before any operations other than pqInsert are used.
- *
- * If the heap is empty, pqMinimum/pqExtractMin will return a NULL key.
- * This may also be tested with pqIsEmpty.
- */
-#define pqInit(pq) __gl_pqHeapInit(pq)
-#define pqInsert(pq,key) __gl_pqHeapInsert(pq,key)
-#define pqMinimum(pq) __gl_pqHeapMinimum(pq)
-#define pqExtractMin(pq) __gl_pqHeapExtractMin(pq)
-#define pqDelete(pq,handle) __gl_pqHeapDelete(pq,handle)
-#define pqIsEmpty(pq) __gl_pqHeapIsEmpty(pq)
-
-
-/* Since we support deletion the data structure is a little more
- * complicated than an ordinary heap. "nodes" is the heap itself;
- * active nodes are stored in the range 1..pq->size. When the
- * heap exceeds its allocated size (pq->max), its size doubles.
- * The children of node i are nodes 2i and 2i+1.
- *
- * Each node stores an index into an array "handles". Each handle
- * stores a key, plus a pointer back to the node which currently
- * represents that key (ie. nodes[handles[i].node].handle == i).
- */
-
-typedef void *PQkey;
-typedef long PQhandle;
-typedef struct PriorityQ PriorityQ;
-
-typedef struct { PQhandle handle; } PQnode;
-typedef struct { PQkey key; PQhandle node; } PQhandleElem;
-
-struct PriorityQ {
- PQnode *nodes;
- PQhandleElem *handles;
- long size, max;
- PQhandle freeList;
- int initialized;
- int (*leq)(PQkey key1, PQkey key2);
-};
-
-PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) );
-void pqDeletePriorityQ( PriorityQ *pq );
-
-void pqInit( PriorityQ *pq );
-PQhandle pqInsert( PriorityQ *pq, PQkey key );
-PQkey pqExtractMin( PriorityQ *pq );
-void pqDelete( PriorityQ *pq, PQhandle handle );
-
-
-#define __gl_pqHeapMinimum(pq) ((pq)->handles[(pq)->nodes[1].handle].key)
-#define __gl_pqHeapIsEmpty(pq) ((pq)->size == 0)
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq-sort.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq-sort.h
deleted file mode 100755
index 5a9504da5..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq-sort.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/priorityq-sort.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef __priorityq_sort_h_
-#define __priorityq_sort_h_
-
-#include "priorityq-heap.h"
-
-#undef PQkey
-#undef PQhandle
-#undef PriorityQ
-#undef pqNewPriorityQ
-#undef pqDeletePriorityQ
-#undef pqInit
-#undef pqInsert
-#undef pqMinimum
-#undef pqExtractMin
-#undef pqDelete
-#undef pqIsEmpty
-
-/* Use #define's so that another heap implementation can use this one */
-
-#define PQkey PQSortKey
-#define PQhandle PQSortHandle
-#define PriorityQ PriorityQSort
-
-#define pqNewPriorityQ(leq) __gl_pqSortNewPriorityQ(leq)
-#define pqDeletePriorityQ(pq) __gl_pqSortDeletePriorityQ(pq)
-
-/* The basic operations are insertion of a new key (pqInsert),
- * and examination/extraction of a key whose value is minimum
- * (pqMinimum/pqExtractMin). Deletion is also allowed (pqDelete);
- * for this purpose pqInsert returns a "handle" which is supplied
- * as the argument.
- *
- * An initial heap may be created efficiently by calling pqInsert
- * repeatedly, then calling pqInit. In any case pqInit must be called
- * before any operations other than pqInsert are used.
- *
- * If the heap is empty, pqMinimum/pqExtractMin will return a NULL key.
- * This may also be tested with pqIsEmpty.
- */
-#define pqInit(pq) __gl_pqSortInit(pq)
-#define pqInsert(pq,key) __gl_pqSortInsert(pq,key)
-#define pqMinimum(pq) __gl_pqSortMinimum(pq)
-#define pqExtractMin(pq) __gl_pqSortExtractMin(pq)
-#define pqDelete(pq,handle) __gl_pqSortDelete(pq,handle)
-#define pqIsEmpty(pq) __gl_pqSortIsEmpty(pq)
-
-
-/* Since we support deletion the data structure is a little more
- * complicated than an ordinary heap. "nodes" is the heap itself;
- * active nodes are stored in the range 1..pq->size. When the
- * heap exceeds its allocated size (pq->max), its size doubles.
- * The children of node i are nodes 2i and 2i+1.
- *
- * Each node stores an index into an array "handles". Each handle
- * stores a key, plus a pointer back to the node which currently
- * represents that key (ie. nodes[handles[i].node].handle == i).
- */
-
-typedef PQHeapKey PQkey;
-typedef PQHeapHandle PQhandle;
-typedef struct PriorityQ PriorityQ;
-
-struct PriorityQ {
- PriorityQHeap *heap;
- PQkey *keys;
- PQkey **order;
- PQhandle size, max;
- int initialized;
- int (*leq)(PQkey key1, PQkey key2);
-};
-
-PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) );
-void pqDeletePriorityQ( PriorityQ *pq );
-
-int pqInit( PriorityQ *pq );
-PQhandle pqInsert( PriorityQ *pq, PQkey key );
-PQkey pqExtractMin( PriorityQ *pq );
-void pqDelete( PriorityQ *pq, PQhandle handle );
-
-PQkey pqMinimum( PriorityQ *pq );
-int pqIsEmpty( PriorityQ *pq );
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq.c b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq.c
deleted file mode 100755
index 9b837d6eb..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/priorityq.c,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include "gluos.h"
-#include <stddef.h>
-#include <assert.h>
-#include <limits.h> /* LONG_MAX */
-#include "memalloc.h"
-
-/* Include all the code for the regular heap-based queue here. */
-
-#include "priorityq-heap.c"
-
-/* Now redefine all the function names to map to their "Sort" versions. */
-
-#include "priorityq-sort.h"
-
-/* really __gl_pqSortNewPriorityQ */
-PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) )
-{
- PriorityQ *pq = (PriorityQ *)memAlloc( sizeof( PriorityQ ));
- if (pq == NULL) return NULL;
-
- pq->heap = __gl_pqHeapNewPriorityQ( leq );
- if (pq->heap == NULL) {
- memFree(pq);
- return NULL;
- }
-
- pq->keys = (PQHeapKey *)memAlloc( INIT_SIZE * sizeof(pq->keys[0]) );
- if (pq->keys == NULL) {
- __gl_pqHeapDeletePriorityQ(pq->heap);
- memFree(pq);
- return NULL;
- }
-
- pq->size = 0;
- pq->max = INIT_SIZE;
- pq->initialized = FALSE;
- pq->leq = leq;
- return pq;
-}
-
-/* really __gl_pqSortDeletePriorityQ */
-void pqDeletePriorityQ( PriorityQ *pq )
-{
- assert(pq != NULL);
- if (pq->heap != NULL) __gl_pqHeapDeletePriorityQ( pq->heap );
- if (pq->order != NULL) memFree( pq->order );
- if (pq->keys != NULL) memFree( pq->keys );
- memFree( pq );
-}
-
-
-#define LT(x,y) (! LEQ(y,x))
-#define GT(x,y) (! LEQ(x,y))
-#define Swap(a,b) if(1){PQkey *tmp = *a; *a = *b; *b = tmp;}else
-
-/* really __gl_pqSortInit */
-int pqInit( PriorityQ *pq )
-{
- PQkey **p, **r, **i, **j, *piv;
- struct { PQkey **p, **r; } Stack[50], *top = Stack;
- unsigned long seed = 2016473283;
-
- /* Create an array of indirect pointers to the keys, so that we
- * the handles we have returned are still valid.
- */
-/*
- pq->order = (PQHeapKey **)memAlloc( (size_t)
- (pq->size * sizeof(pq->order[0])) );
-*/
- pq->order = (PQHeapKey **)memAlloc( (size_t)
- ((pq->size+1) * sizeof(pq->order[0])) );
-/* the previous line is a patch to compensate for the fact that IBM */
-/* machines return a null on a malloc of zero bytes (unlike SGI), */
-/* so we have to put in this defense to guard against a memory */
-/* fault four lines down. from fossum@austin.ibm.com. */
- if (pq->order == NULL) return 0;
-
- p = pq->order;
- r = p + pq->size - 1;
- for( piv = pq->keys, i = p; i <= r; ++piv, ++i ) {
- *i = piv;
- }
-
- /* Sort the indirect pointers in descending order,
- * using randomized Quicksort
- */
- top->p = p; top->r = r; ++top;
- while( --top >= Stack ) {
- p = top->p;
- r = top->r;
- while( r > p + 10 ) {
- seed = seed * 1539415821 + 1;
- i = p + seed % (r - p + 1);
- piv = *i;
- *i = *p;
- *p = piv;
- i = p - 1;
- j = r + 1;
- do {
- do { ++i; } while( GT( **i, *piv ));
- do { --j; } while( LT( **j, *piv ));
- Swap( i, j );
- } while( i < j );
- Swap( i, j ); /* Undo last swap */
- if( i - p < r - j ) {
- top->p = j+1; top->r = r; ++top;
- r = i-1;
- } else {
- top->p = p; top->r = i-1; ++top;
- p = j+1;
- }
- }
- /* Insertion sort small lists */
- for( i = p+1; i <= r; ++i ) {
- piv = *i;
- for( j = i; j > p && LT( **(j-1), *piv ); --j ) {
- *j = *(j-1);
- }
- *j = piv;
- }
- }
- pq->max = pq->size;
- pq->initialized = TRUE;
- __gl_pqHeapInit( pq->heap ); /* always succeeds */
-
-#ifndef NDEBUG
- p = pq->order;
- r = p + pq->size - 1;
- for( i = p; i < r; ++i ) {
- assert( LEQ( **(i+1), **i ));
- }
-#endif
-
- return 1;
-}
-
-/* really __gl_pqSortInsert */
-/* returns LONG_MAX iff out of memory */
-PQhandle pqInsert( PriorityQ *pq, PQkey keyNew )
-{
- long curr;
-
- if( pq->initialized ) {
- return __gl_pqHeapInsert( pq->heap, keyNew );
- }
- curr = pq->size;
- if( ++ pq->size >= pq->max ) {
- PQkey *saveKey= pq->keys;
-
- /* If the heap overflows, double its size. */
- pq->max <<= 1;
- pq->keys = (PQHeapKey *)memRealloc( pq->keys,
- (size_t)
- (pq->max * sizeof( pq->keys[0] )));
- if (pq->keys == NULL) {
- pq->keys = saveKey; /* restore ptr to free upon return */
- return LONG_MAX;
- }
- }
- assert(curr != LONG_MAX);
- pq->keys[curr] = keyNew;
-
- /* Negative handles index the sorted array. */
- return -(curr+1);
-}
-
-/* really __gl_pqSortExtractMin */
-PQkey pqExtractMin( PriorityQ *pq )
-{
- PQkey sortMin, heapMin;
-
- if( pq->size == 0 ) {
- return __gl_pqHeapExtractMin( pq->heap );
- }
- sortMin = *(pq->order[pq->size-1]);
- if( ! __gl_pqHeapIsEmpty( pq->heap )) {
- heapMin = __gl_pqHeapMinimum( pq->heap );
- if( LEQ( heapMin, sortMin )) {
- return __gl_pqHeapExtractMin( pq->heap );
- }
- }
- do {
- -- pq->size;
- } while( pq->size > 0 && *(pq->order[pq->size-1]) == NULL );
- return sortMin;
-}
-
-/* really __gl_pqSortMinimum */
-PQkey pqMinimum( PriorityQ *pq )
-{
- PQkey sortMin, heapMin;
-
- if( pq->size == 0 ) {
- return __gl_pqHeapMinimum( pq->heap );
- }
- sortMin = *(pq->order[pq->size-1]);
- if( ! __gl_pqHeapIsEmpty( pq->heap )) {
- heapMin = __gl_pqHeapMinimum( pq->heap );
- if( LEQ( heapMin, sortMin )) {
- return heapMin;
- }
- }
- return sortMin;
-}
-
-/* really __gl_pqSortIsEmpty */
-int pqIsEmpty( PriorityQ *pq )
-{
- return (pq->size == 0) && __gl_pqHeapIsEmpty( pq->heap );
-}
-
-/* really __gl_pqSortDelete */
-void pqDelete( PriorityQ *pq, PQhandle curr )
-{
- if( curr >= 0 ) {
- __gl_pqHeapDelete( pq->heap, curr );
- return;
- }
- curr = -(curr+1);
- assert( curr < pq->max && pq->keys[curr] != NULL );
-
- pq->keys[curr] = NULL;
- while( pq->size > 0 && *(pq->order[pq->size-1]) == NULL ) {
- -- pq->size;
- }
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq.h
deleted file mode 100755
index cc793d9e0..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/priorityq.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/priorityq.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef __priorityq_sort_h_
-#define __priorityq_sort_h_
-
-#include "priorityq-heap.h"
-
-#undef PQkey
-#undef PQhandle
-#undef PriorityQ
-#undef pqNewPriorityQ
-#undef pqDeletePriorityQ
-#undef pqInit
-#undef pqInsert
-#undef pqMinimum
-#undef pqExtractMin
-#undef pqDelete
-#undef pqIsEmpty
-
-/* Use #define's so that another heap implementation can use this one */
-
-#define PQkey PQSortKey
-#define PQhandle PQSortHandle
-#define PriorityQ PriorityQSort
-
-#define pqNewPriorityQ(leq) __gl_pqSortNewPriorityQ(leq)
-#define pqDeletePriorityQ(pq) __gl_pqSortDeletePriorityQ(pq)
-
-/* The basic operations are insertion of a new key (pqInsert),
- * and examination/extraction of a key whose value is minimum
- * (pqMinimum/pqExtractMin). Deletion is also allowed (pqDelete);
- * for this purpose pqInsert returns a "handle" which is supplied
- * as the argument.
- *
- * An initial heap may be created efficiently by calling pqInsert
- * repeatedly, then calling pqInit. In any case pqInit must be called
- * before any operations other than pqInsert are used.
- *
- * If the heap is empty, pqMinimum/pqExtractMin will return a NULL key.
- * This may also be tested with pqIsEmpty.
- */
-#define pqInit(pq) __gl_pqSortInit(pq)
-#define pqInsert(pq,key) __gl_pqSortInsert(pq,key)
-#define pqMinimum(pq) __gl_pqSortMinimum(pq)
-#define pqExtractMin(pq) __gl_pqSortExtractMin(pq)
-#define pqDelete(pq,handle) __gl_pqSortDelete(pq,handle)
-#define pqIsEmpty(pq) __gl_pqSortIsEmpty(pq)
-
-
-/* Since we support deletion the data structure is a little more
- * complicated than an ordinary heap. "nodes" is the heap itself;
- * active nodes are stored in the range 1..pq->size. When the
- * heap exceeds its allocated size (pq->max), its size doubles.
- * The children of node i are nodes 2i and 2i+1.
- *
- * Each node stores an index into an array "handles". Each handle
- * stores a key, plus a pointer back to the node which currently
- * represents that key (ie. nodes[handles[i].node].handle == i).
- */
-
-typedef PQHeapKey PQkey;
-typedef PQHeapHandle PQhandle;
-typedef struct PriorityQ PriorityQ;
-
-struct PriorityQ {
- PriorityQHeap *heap;
- PQkey *keys;
- PQkey **order;
- PQhandle size, max;
- int initialized;
- int (*leq)(PQkey key1, PQkey key2);
-};
-
-PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) );
-void pqDeletePriorityQ( PriorityQ *pq );
-
-int pqInit( PriorityQ *pq );
-PQhandle pqInsert( PriorityQ *pq, PQkey key );
-PQkey pqExtractMin( PriorityQ *pq );
-void pqDelete( PriorityQ *pq, PQhandle handle );
-
-PQkey pqMinimum( PriorityQ *pq );
-int pqIsEmpty( PriorityQ *pq );
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/render.c b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/render.c
deleted file mode 100755
index 4e107442a..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/render.c
+++ /dev/null
@@ -1,505 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/render.c,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include "gluos.h"
-#include <assert.h>
-#include <stddef.h>
-#include "mesh.h"
-#include "tess.h"
-#include "render.h"
-
-#define TRUE 1
-#define FALSE 0
-
-/* This structure remembers the information we need about a primitive
- * to be able to render it later, once we have determined which
- * primitive is able to use the most triangles.
- */
-struct FaceCount {
- long size; /* number of triangles used */
- GLUhalfEdge *eStart; /* edge where this primitive starts */
- void (*render)(GLUtesselator *, GLUhalfEdge *, long);
- /* routine to render this primitive */
-};
-
-static struct FaceCount MaximumFan( GLUhalfEdge *eOrig );
-static struct FaceCount MaximumStrip( GLUhalfEdge *eOrig );
-
-static void RenderFan( GLUtesselator *tess, GLUhalfEdge *eStart, long size );
-static void RenderStrip( GLUtesselator *tess, GLUhalfEdge *eStart, long size );
-static void RenderTriangle( GLUtesselator *tess, GLUhalfEdge *eStart,
- long size );
-
-static void RenderMaximumFaceGroup( GLUtesselator *tess, GLUface *fOrig );
-static void RenderLonelyTriangles( GLUtesselator *tess, GLUface *head );
-
-
-
-/************************ Strips and Fans decomposition ******************/
-
-/* __gl_renderMesh( tess, mesh ) takes a mesh and breaks it into triangle
- * fans, strips, and separate triangles. A substantial effort is made
- * to use as few rendering primitives as possible (ie. to make the fans
- * and strips as large as possible).
- *
- * The rendering output is provided as callbacks (see the api).
- */
-void __gl_renderMesh( GLUtesselator *tess, GLUmesh *mesh )
-{
- GLUface *f;
-
- /* Make a list of separate triangles so we can render them all at once */
- tess->lonelyTriList = NULL;
-
- for( f = mesh->fHead.next; f != &mesh->fHead; f = f->next ) {
- f->marked = FALSE;
- }
- for( f = mesh->fHead.next; f != &mesh->fHead; f = f->next ) {
-
- /* We examine all faces in an arbitrary order. Whenever we find
- * an unprocessed face F, we output a group of faces including F
- * whose size is maximum.
- */
- if( f->inside && ! f->marked ) {
- RenderMaximumFaceGroup( tess, f );
- assert( f->marked );
- }
- }
- if( tess->lonelyTriList != NULL ) {
- RenderLonelyTriangles( tess, tess->lonelyTriList );
- tess->lonelyTriList = NULL;
- }
-}
-
-
-static void RenderMaximumFaceGroup( GLUtesselator *tess, GLUface *fOrig )
-{
- /* We want to find the largest triangle fan or strip of unmarked faces
- * which includes the given face fOrig. There are 3 possible fans
- * passing through fOrig (one centered at each vertex), and 3 possible
- * strips (one for each CCW permutation of the vertices). Our strategy
- * is to try all of these, and take the primitive which uses the most
- * triangles (a greedy approach).
- */
- GLUhalfEdge *e = fOrig->anEdge;
- struct FaceCount max, newFace;
-
- max.size = 1;
- max.eStart = e;
- max.render = &RenderTriangle;
-
- if( ! tess->flagBoundary ) {
- newFace = MaximumFan( e ); if( newFace.size > max.size ) { max = newFace; }
- newFace = MaximumFan( e->Lnext ); if( newFace.size > max.size ) { max = newFace; }
- newFace = MaximumFan( e->Lprev ); if( newFace.size > max.size ) { max = newFace; }
-
- newFace = MaximumStrip( e ); if( newFace.size > max.size ) { max = newFace; }
- newFace = MaximumStrip( e->Lnext ); if( newFace.size > max.size ) { max = newFace; }
- newFace = MaximumStrip( e->Lprev ); if( newFace.size > max.size ) { max = newFace; }
- }
- (*(max.render))( tess, max.eStart, max.size );
-}
-
-
-/* Macros which keep track of faces we have marked temporarily, and allow
- * us to backtrack when necessary. With triangle fans, this is not
- * really necessary, since the only awkward case is a loop of triangles
- * around a single origin vertex. However with strips the situation is
- * more complicated, and we need a general tracking method like the
- * one here.
- */
-#define Marked(f) (! (f)->inside || (f)->marked)
-
-#define AddToTrail(f,t) ((f)->trail = (t), (t) = (f), (f)->marked = TRUE)
-
-#define FreeTrail(t) if( 1 ) { \
- while( (t) != NULL ) { \
- (t)->marked = FALSE; t = (t)->trail; \
- } \
- } else /* absorb trailing semicolon */
-
-
-
-static struct FaceCount MaximumFan( GLUhalfEdge *eOrig )
-{
- /* eOrig->Lface is the face we want to render. We want to find the size
- * of a maximal fan around eOrig->Org. To do this we just walk around
- * the origin vertex as far as possible in both directions.
- */
- struct FaceCount newFace = { 0, NULL, &RenderFan };
- GLUface *trail = NULL;
- GLUhalfEdge *e;
-
- for( e = eOrig; ! Marked( e->Lface ); e = e->Onext ) {
- AddToTrail( e->Lface, trail );
- ++newFace.size;
- }
- for( e = eOrig; ! Marked( e->Rface ); e = e->Oprev ) {
- AddToTrail( e->Rface, trail );
- ++newFace.size;
- }
- newFace.eStart = e;
- /*LINTED*/
- FreeTrail( trail );
- return newFace;
-}
-
-
-#define IsEven(n) (((n) & 1) == 0)
-
-static struct FaceCount MaximumStrip( GLUhalfEdge *eOrig )
-{
- /* Here we are looking for a maximal strip that contains the vertices
- * eOrig->Org, eOrig->Dst, eOrig->Lnext->Dst (in that order or the
- * reverse, such that all triangles are oriented CCW).
- *
- * Again we walk forward and backward as far as possible. However for
- * strips there is a twist: to get CCW orientations, there must be
- * an *even* number of triangles in the strip on one side of eOrig.
- * We walk the strip starting on a side with an even number of triangles;
- * if both side have an odd number, we are forced to shorten one side.
- */
- struct FaceCount newFace = { 0, NULL, &RenderStrip };
- long headSize = 0, tailSize = 0;
- GLUface *trail = NULL;
- GLUhalfEdge *e, *eTail, *eHead;
-
- for( e = eOrig; ! Marked( e->Lface ); ++tailSize, e = e->Onext ) {
- AddToTrail( e->Lface, trail );
- ++tailSize;
- e = e->Dprev;
- if( Marked( e->Lface )) break;
- AddToTrail( e->Lface, trail );
- }
- eTail = e;
-
- for( e = eOrig; ! Marked( e->Rface ); ++headSize, e = e->Dnext ) {
- AddToTrail( e->Rface, trail );
- ++headSize;
- e = e->Oprev;
- if( Marked( e->Rface )) break;
- AddToTrail( e->Rface, trail );
- }
- eHead = e;
-
- newFace.size = tailSize + headSize;
- if( IsEven( tailSize )) {
- newFace.eStart = eTail->Sym;
- } else if( IsEven( headSize )) {
- newFace.eStart = eHead;
- } else {
- /* Both sides have odd length, we must shorten one of them. In fact,
- * we must start from eHead to guarantee inclusion of eOrig->Lface.
- */
- --newFace.size;
- newFace.eStart = eHead->Onext;
- }
- /*LINTED*/
- FreeTrail( trail );
- return newFace;
-}
-
-
-static void RenderTriangle( GLUtesselator *tess, GLUhalfEdge *e, long size )
-{
- /* Just add the triangle to a triangle list, so we can render all
- * the separate triangles at once.
- */
- assert( size == 1 );
- AddToTrail( e->Lface, tess->lonelyTriList );
-}
-
-
-static void RenderLonelyTriangles( GLUtesselator *tess, GLUface *f )
-{
- /* Now we render all the separate triangles which could not be
- * grouped into a triangle fan or strip.
- */
- GLUhalfEdge *e;
- int newState;
- int edgeState = -1; /* force edge state output for first vertex */
-
- CALL_BEGIN_OR_BEGIN_DATA( GL_TRIANGLES );
-
- for( ; f != NULL; f = f->trail ) {
- /* Loop once for each edge (there will always be 3 edges) */
-
- e = f->anEdge;
- do {
- if( tess->flagBoundary ) {
- /* Set the "edge state" to TRUE just before we output the
- * first vertex of each edge on the polygon boundary.
- */
- newState = ! e->Rface->inside;
- if( edgeState != newState ) {
- edgeState = newState;
- CALL_EDGE_FLAG_OR_EDGE_FLAG_DATA( edgeState );
- }
- }
- CALL_VERTEX_OR_VERTEX_DATA( e->Org->data );
-
- e = e->Lnext;
- } while( e != f->anEdge );
- }
- CALL_END_OR_END_DATA();
-}
-
-
-static void RenderFan( GLUtesselator *tess, GLUhalfEdge *e, long size )
-{
- /* Render as many CCW triangles as possible in a fan starting from
- * edge "e". The fan *should* contain exactly "size" triangles
- * (otherwise we've goofed up somewhere).
- */
- CALL_BEGIN_OR_BEGIN_DATA( GL_TRIANGLE_FAN );
- CALL_VERTEX_OR_VERTEX_DATA( e->Org->data );
- CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data );
-
- while( ! Marked( e->Lface )) {
- e->Lface->marked = TRUE;
- --size;
- e = e->Onext;
- CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data );
- }
-
- assert( size == 0 );
- CALL_END_OR_END_DATA();
-}
-
-
-static void RenderStrip( GLUtesselator *tess, GLUhalfEdge *e, long size )
-{
- /* Render as many CCW triangles as possible in a strip starting from
- * edge "e". The strip *should* contain exactly "size" triangles
- * (otherwise we've goofed up somewhere).
- */
- CALL_BEGIN_OR_BEGIN_DATA( GL_TRIANGLE_STRIP );
- CALL_VERTEX_OR_VERTEX_DATA( e->Org->data );
- CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data );
-
- while( ! Marked( e->Lface )) {
- e->Lface->marked = TRUE;
- --size;
- e = e->Dprev;
- CALL_VERTEX_OR_VERTEX_DATA( e->Org->data );
- if( Marked( e->Lface )) break;
-
- e->Lface->marked = TRUE;
- --size;
- e = e->Onext;
- CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data );
- }
-
- assert( size == 0 );
- CALL_END_OR_END_DATA();
-}
-
-
-/************************ Boundary contour decomposition ******************/
-
-/* __gl_renderBoundary( tess, mesh ) takes a mesh, and outputs one
- * contour for each face marked "inside". The rendering output is
- * provided as callbacks (see the api).
- */
-void __gl_renderBoundary( GLUtesselator *tess, GLUmesh *mesh )
-{
- GLUface *f;
- GLUhalfEdge *e;
-
- for( f = mesh->fHead.next; f != &mesh->fHead; f = f->next ) {
- if( f->inside ) {
- CALL_BEGIN_OR_BEGIN_DATA( GL_LINE_LOOP );
- e = f->anEdge;
- do {
- CALL_VERTEX_OR_VERTEX_DATA( e->Org->data );
- e = e->Lnext;
- } while( e != f->anEdge );
- CALL_END_OR_END_DATA();
- }
- }
-}
-
-
-/************************ Quick-and-dirty decomposition ******************/
-
-#define SIGN_INCONSISTENT 2
-
-static int ComputeNormal( GLUtesselator *tess, GLdouble norm[3], int check )
-/*
- * If check==FALSE, we compute the polygon normal and place it in norm[].
- * If check==TRUE, we check that each triangle in the fan from v0 has a
- * consistent orientation with respect to norm[]. If triangles are
- * consistently oriented CCW, return 1; if CW, return -1; if all triangles
- * are degenerate return 0; otherwise (no consistent orientation) return
- * SIGN_INCONSISTENT.
- */
-{
- CachedVertex *v0 = tess->cache;
- CachedVertex *vn = v0 + tess->cacheCount;
- CachedVertex *vc;
- GLdouble dot, xc, yc, zc, xp, yp, zp, n[3];
- int sign = 0;
-
- /* Find the polygon normal. It is important to get a reasonable
- * normal even when the polygon is self-intersecting (eg. a bowtie).
- * Otherwise, the computed normal could be very tiny, but perpendicular
- * to the true plane of the polygon due to numerical noise. Then all
- * the triangles would appear to be degenerate and we would incorrectly
- * decompose the polygon as a fan (or simply not render it at all).
- *
- * We use a sum-of-triangles normal algorithm rather than the more
- * efficient sum-of-trapezoids method (used in CheckOrientation()
- * in normal.c). This lets us explicitly reverse the signed area
- * of some triangles to get a reasonable normal in the self-intersecting
- * case.
- */
- if( ! check ) {
- norm[0] = norm[1] = norm[2] = 0.0;
- }
-
- vc = v0 + 1;
- xc = vc->coords[0] - v0->coords[0];
- yc = vc->coords[1] - v0->coords[1];
- zc = vc->coords[2] - v0->coords[2];
- while( ++vc < vn ) {
- xp = xc; yp = yc; zp = zc;
- xc = vc->coords[0] - v0->coords[0];
- yc = vc->coords[1] - v0->coords[1];
- zc = vc->coords[2] - v0->coords[2];
-
- /* Compute (vp - v0) cross (vc - v0) */
- n[0] = yp*zc - zp*yc;
- n[1] = zp*xc - xp*zc;
- n[2] = xp*yc - yp*xc;
-
- dot = n[0]*norm[0] + n[1]*norm[1] + n[2]*norm[2];
- if( ! check ) {
- /* Reverse the contribution of back-facing triangles to get
- * a reasonable normal for self-intersecting polygons (see above)
- */
- if( dot >= 0 ) {
- norm[0] += n[0]; norm[1] += n[1]; norm[2] += n[2];
- } else {
- norm[0] -= n[0]; norm[1] -= n[1]; norm[2] -= n[2];
- }
- } else if( dot != 0 ) {
- /* Check the new orientation for consistency with previous triangles */
- if( dot > 0 ) {
- if( sign < 0 ) return SIGN_INCONSISTENT;
- sign = 1;
- } else {
- if( sign > 0 ) return SIGN_INCONSISTENT;
- sign = -1;
- }
- }
- }
- return sign;
-}
-
-/* __gl_renderCache( tess ) takes a single contour and tries to render it
- * as a triangle fan. This handles convex polygons, as well as some
- * non-convex polygons if we get lucky.
- *
- * Returns TRUE if the polygon was successfully rendered. The rendering
- * output is provided as callbacks (see the api).
- */
-GLboolean __gl_renderCache( GLUtesselator *tess )
-{
- CachedVertex *v0 = tess->cache;
- CachedVertex *vn = v0 + tess->cacheCount;
- CachedVertex *vc;
- GLdouble norm[3];
- int sign;
-
- if( tess->cacheCount < 3 ) {
- /* Degenerate contour -- no output */
- return TRUE;
- }
-
- norm[0] = tess->normal[0];
- norm[1] = tess->normal[1];
- norm[2] = tess->normal[2];
- if( norm[0] == 0 && norm[1] == 0 && norm[2] == 0 ) {
- ComputeNormal( tess, norm, FALSE );
- }
-
- sign = ComputeNormal( tess, norm, TRUE );
- if( sign == SIGN_INCONSISTENT ) {
- /* Fan triangles did not have a consistent orientation */
- return FALSE;
- }
- if( sign == 0 ) {
- /* All triangles were degenerate */
- return TRUE;
- }
-
- /* Make sure we do the right thing for each winding rule */
- switch( tess->windingRule ) {
- case GLU_TESS_WINDING_ODD:
- case GLU_TESS_WINDING_NONZERO:
- break;
- case GLU_TESS_WINDING_POSITIVE:
- if( sign < 0 ) return TRUE;
- break;
- case GLU_TESS_WINDING_NEGATIVE:
- if( sign > 0 ) return TRUE;
- break;
- case GLU_TESS_WINDING_ABS_GEQ_TWO:
- return TRUE;
- }
-
- CALL_BEGIN_OR_BEGIN_DATA( tess->boundaryOnly ? GL_LINE_LOOP
- : (tess->cacheCount > 3) ? GL_TRIANGLE_FAN
- : GL_TRIANGLES );
-
- CALL_VERTEX_OR_VERTEX_DATA( v0->data );
- if( sign > 0 ) {
- for( vc = v0+1; vc < vn; ++vc ) {
- CALL_VERTEX_OR_VERTEX_DATA( vc->data );
- }
- } else {
- for( vc = vn-1; vc > v0; --vc ) {
- CALL_VERTEX_OR_VERTEX_DATA( vc->data );
- }
- }
- CALL_END_OR_END_DATA();
- return TRUE;
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/render.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/render.h
deleted file mode 100755
index f4ea9fab5..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/render.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/render.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef __render_h_
-#define __render_h_
-
-#include "mesh.h"
-
-/* __gl_renderMesh( tess, mesh ) takes a mesh and breaks it into triangle
- * fans, strips, and separate triangles. A substantial effort is made
- * to use as few rendering primitives as possible (ie. to make the fans
- * and strips as large as possible).
- *
- * The rendering output is provided as callbacks (see the api).
- */
-void __gl_renderMesh( GLUtesselator *tess, GLUmesh *mesh );
-void __gl_renderBoundary( GLUtesselator *tess, GLUmesh *mesh );
-
-GLboolean __gl_renderCache( GLUtesselator *tess );
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/sweep.c b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/sweep.c
deleted file mode 100755
index c4bf4e616..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/sweep.c
+++ /dev/null
@@ -1,1358 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-*/
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libtess/sweep.c,v 1.3 2002/02/22 21:32:49 dawes Exp $ */
-
-#include "gluos.h"
-#include <assert.h>
-#include <stddef.h>
-#include <setjmp.h> /* longjmp */
-#include <limits.h> /* LONG_MAX */
-
-#include "mesh.h"
-#include "geom.h"
-#include "tess.h"
-#include "dict.h"
-#include "priorityq.h"
-#include "memalloc.h"
-#include "sweep.h"
-
-#define TRUE 1
-#define FALSE 0
-
-#ifdef FOR_TRITE_TEST_PROGRAM
-extern void DebugEvent( GLUtesselator *tess );
-#else
-#define DebugEvent( tess )
-#endif
-
-/*
- * Invariants for the Edge Dictionary.
- * - each pair of adjacent edges e2=Succ(e1) satisfies EdgeLeq(e1,e2)
- * at any valid location of the sweep event
- * - if EdgeLeq(e2,e1) as well (at any valid sweep event), then e1 and e2
- * share a common endpoint
- * - for each e, e->Dst has been processed, but not e->Org
- * - each edge e satisfies VertLeq(e->Dst,event) && VertLeq(event,e->Org)
- * where "event" is the current sweep line event.
- * - no edge e has zero length
- *
- * Invariants for the Mesh (the processed portion).
- * - the portion of the mesh left of the sweep line is a planar graph,
- * ie. there is *some* way to embed it in the plane
- * - no processed edge has zero length
- * - no two processed vertices have identical coordinates
- * - each "inside" region is monotone, ie. can be broken into two chains
- * of monotonically increasing vertices according to VertLeq(v1,v2)
- * - a non-invariant: these chains may intersect (very slightly)
- *
- * Invariants for the Sweep.
- * - if none of the edges incident to the event vertex have an activeRegion
- * (ie. none of these edges are in the edge dictionary), then the vertex
- * has only right-going edges.
- * - if an edge is marked "fixUpperEdge" (it is a temporary edge introduced
- * by ConnectRightVertex), then it is the only right-going edge from
- * its associated vertex. (This says that these edges exist only
- * when it is necessary.)
- */
-
-#define MAX(x,y) ((x) >= (y) ? (x) : (y))
-#define MIN(x,y) ((x) <= (y) ? (x) : (y))
-
-/* When we merge two edges into one, we need to compute the combined
- * winding of the new edge.
- */
-#define AddWinding(eDst,eSrc) (eDst->winding += eSrc->winding, \
- eDst->Sym->winding += eSrc->Sym->winding)
-
-static void SweepEvent( GLUtesselator *tess, GLUvertex *vEvent );
-static void WalkDirtyRegions( GLUtesselator *tess, ActiveRegion *regUp );
-static int CheckForRightSplice( GLUtesselator *tess, ActiveRegion *regUp );
-
-static int EdgeLeq( GLUtesselator *tess, ActiveRegion *reg1,
- ActiveRegion *reg2 )
-/*
- * Both edges must be directed from right to left (this is the canonical
- * direction for the upper edge of each region).
- *
- * The strategy is to evaluate a "t" value for each edge at the
- * current sweep line position, given by tess->event. The calculations
- * are designed to be very stable, but of course they are not perfect.
- *
- * Special case: if both edge destinations are at the sweep event,
- * we sort the edges by slope (they would otherwise compare equally).
- */
-{
- GLUvertex *event = tess->event;
- GLUhalfEdge *e1, *e2;
- GLdouble t1, t2;
-
- e1 = reg1->eUp;
- e2 = reg2->eUp;
-
- if( e1->Dst == event ) {
- if( e2->Dst == event ) {
- /* Two edges right of the sweep line which meet at the sweep event.
- * Sort them by slope.
- */
- if( VertLeq( e1->Org, e2->Org )) {
- return EdgeSign( e2->Dst, e1->Org, e2->Org ) <= 0;
- }
- return EdgeSign( e1->Dst, e2->Org, e1->Org ) >= 0;
- }
- return EdgeSign( e2->Dst, event, e2->Org ) <= 0;
- }
- if( e2->Dst == event ) {
- return EdgeSign( e1->Dst, event, e1->Org ) >= 0;
- }
-
- /* General case - compute signed distance *from* e1, e2 to event */
- t1 = EdgeEval( e1->Dst, event, e1->Org );
- t2 = EdgeEval( e2->Dst, event, e2->Org );
- return (t1 >= t2);
-}
-
-
-static void DeleteRegion( GLUtesselator *tess, ActiveRegion *reg )
-{
- if( reg->fixUpperEdge ) {
- /* It was created with zero winding number, so it better be
- * deleted with zero winding number (ie. it better not get merged
- * with a real edge).
- */
- assert( reg->eUp->winding == 0 );
- }
- reg->eUp->activeRegion = NULL;
- dictDelete( tess->dict, reg->nodeUp ); /* __gl_dictListDelete */
- memFree( reg );
-}
-
-
-static int FixUpperEdge( ActiveRegion *reg, GLUhalfEdge *newEdge )
-/*
- * Replace an upper edge which needs fixing (see ConnectRightVertex).
- */
-{
- assert( reg->fixUpperEdge );
- if ( !__gl_meshDelete( reg->eUp ) ) return 0;
- reg->fixUpperEdge = FALSE;
- reg->eUp = newEdge;
- newEdge->activeRegion = reg;
-
- return 1;
-}
-
-static ActiveRegion *TopLeftRegion( ActiveRegion *reg )
-{
- GLUvertex *org = reg->eUp->Org;
- GLUhalfEdge *e;
-
- /* Find the region above the uppermost edge with the same origin */
- do {
- reg = RegionAbove( reg );
- } while( reg->eUp->Org == org );
-
- /* If the edge above was a temporary edge introduced by ConnectRightVertex,
- * now is the time to fix it.
- */
- if( reg->fixUpperEdge ) {
- e = __gl_meshConnect( RegionBelow(reg)->eUp->Sym, reg->eUp->Lnext );
- if (e == NULL) return NULL;
- if ( !FixUpperEdge( reg, e ) ) return NULL;
- reg = RegionAbove( reg );
- }
- return reg;
-}
-
-static ActiveRegion *TopRightRegion( ActiveRegion *reg )
-{
- GLUvertex *dst = reg->eUp->Dst;
-
- /* Find the region above the uppermost edge with the same destination */
- do {
- reg = RegionAbove( reg );
- } while( reg->eUp->Dst == dst );
- return reg;
-}
-
-static ActiveRegion *AddRegionBelow( GLUtesselator *tess,
- ActiveRegion *regAbove,
- GLUhalfEdge *eNewUp )
-/*
- * Add a new active region to the sweep line, *somewhere* below "regAbove"
- * (according to where the new edge belongs in the sweep-line dictionary).
- * The upper edge of the new region will be "eNewUp".
- * Winding number and "inside" flag are not updated.
- */
-{
- ActiveRegion *regNew = (ActiveRegion *)memAlloc( sizeof( ActiveRegion ));
- if (regNew == NULL) longjmp(tess->env,1);
-
- regNew->eUp = eNewUp;
- /* __gl_dictListInsertBefore */
- regNew->nodeUp = dictInsertBefore( tess->dict, regAbove->nodeUp, regNew );
- if (regNew->nodeUp == NULL) longjmp(tess->env,1);
- regNew->fixUpperEdge = FALSE;
- regNew->sentinel = FALSE;
- regNew->dirty = FALSE;
-
- eNewUp->activeRegion = regNew;
- return regNew;
-}
-
-static GLboolean IsWindingInside( GLUtesselator *tess, int n )
-{
- switch( tess->windingRule ) {
- case GLU_TESS_WINDING_ODD:
- return (n & 1);
- case GLU_TESS_WINDING_NONZERO:
- return (n != 0);
- case GLU_TESS_WINDING_POSITIVE:
- return (n > 0);
- case GLU_TESS_WINDING_NEGATIVE:
- return (n < 0);
- case GLU_TESS_WINDING_ABS_GEQ_TWO:
- return (n >= 2) || (n <= -2);
- default:
- return FALSE;
- }
-}
-
-
-static void ComputeWinding( GLUtesselator *tess, ActiveRegion *reg )
-{
- reg->windingNumber = RegionAbove(reg)->windingNumber + reg->eUp->winding;
- reg->inside = IsWindingInside( tess, reg->windingNumber );
-}
-
-
-static void FinishRegion( GLUtesselator *tess, ActiveRegion *reg )
-/*
- * Delete a region from the sweep line. This happens when the upper
- * and lower chains of a region meet (at a vertex on the sweep line).
- * The "inside" flag is copied to the appropriate mesh face (we could
- * not do this before -- since the structure of the mesh is always
- * changing, this face may not have even existed until now).
- */
-{
- GLUhalfEdge *e = reg->eUp;
- GLUface *f = e->Lface;
-
- f->inside = reg->inside;
- f->anEdge = e; /* optimization for __gl_meshTessellateMonoRegion() */
- DeleteRegion( tess, reg );
-}
-
-
-static GLUhalfEdge *FinishLeftRegions( GLUtesselator *tess,
- ActiveRegion *regFirst, ActiveRegion *regLast )
-/*
- * We are given a vertex with one or more left-going edges. All affected
- * edges should be in the edge dictionary. Starting at regFirst->eUp,
- * we walk down deleting all regions where both edges have the same
- * origin vOrg. At the same time we copy the "inside" flag from the
- * active region to the face, since at this point each face will belong
- * to at most one region (this was not necessarily true until this point
- * in the sweep). The walk stops at the region above regLast; if regLast
- * is NULL we walk as far as possible. At the same time we relink the
- * mesh if necessary, so that the ordering of edges around vOrg is the
- * same as in the dictionary.
- */
-{
- ActiveRegion *reg, *regPrev;
- GLUhalfEdge *e, *ePrev;
-
- regPrev = regFirst;
- ePrev = regFirst->eUp;
- while( regPrev != regLast ) {
- regPrev->fixUpperEdge = FALSE; /* placement was OK */
- reg = RegionBelow( regPrev );
- e = reg->eUp;
- if( e->Org != ePrev->Org ) {
- if( ! reg->fixUpperEdge ) {
- /* Remove the last left-going edge. Even though there are no further
- * edges in the dictionary with this origin, there may be further
- * such edges in the mesh (if we are adding left edges to a vertex
- * that has already been processed). Thus it is important to call
- * FinishRegion rather than just DeleteRegion.
- */
- FinishRegion( tess, regPrev );
- break;
- }
- /* If the edge below was a temporary edge introduced by
- * ConnectRightVertex, now is the time to fix it.
- */
- e = __gl_meshConnect( ePrev->Lprev, e->Sym );
- if (e == NULL) longjmp(tess->env,1);
- if ( !FixUpperEdge( reg, e ) ) longjmp(tess->env,1);
- }
-
- /* Relink edges so that ePrev->Onext == e */
- if( ePrev->Onext != e ) {
- if ( !__gl_meshSplice( e->Oprev, e ) ) longjmp(tess->env,1);
- if ( !__gl_meshSplice( ePrev, e ) ) longjmp(tess->env,1);
- }
- FinishRegion( tess, regPrev ); /* may change reg->eUp */
- ePrev = reg->eUp;
- regPrev = reg;
- }
- return ePrev;
-}
-
-
-static void AddRightEdges( GLUtesselator *tess, ActiveRegion *regUp,
- GLUhalfEdge *eFirst, GLUhalfEdge *eLast, GLUhalfEdge *eTopLeft,
- GLboolean cleanUp )
-/*
- * Purpose: insert right-going edges into the edge dictionary, and update
- * winding numbers and mesh connectivity appropriately. All right-going
- * edges share a common origin vOrg. Edges are inserted CCW starting at
- * eFirst; the last edge inserted is eLast->Oprev. If vOrg has any
- * left-going edges already processed, then eTopLeft must be the edge
- * such that an imaginary upward vertical segment from vOrg would be
- * contained between eTopLeft->Oprev and eTopLeft; otherwise eTopLeft
- * should be NULL.
- */
-{
- ActiveRegion *reg, *regPrev;
- GLUhalfEdge *e, *ePrev;
- int firstTime = TRUE;
-
- /* Insert the new right-going edges in the dictionary */
- e = eFirst;
- do {
- assert( VertLeq( e->Org, e->Dst ));
- AddRegionBelow( tess, regUp, e->Sym );
- e = e->Onext;
- } while ( e != eLast );
-
- /* Walk *all* right-going edges from e->Org, in the dictionary order,
- * updating the winding numbers of each region, and re-linking the mesh
- * edges to match the dictionary ordering (if necessary).
- */
- if( eTopLeft == NULL ) {
- eTopLeft = RegionBelow( regUp )->eUp->Rprev;
- }
- regPrev = regUp;
- ePrev = eTopLeft;
- for( ;; ) {
- reg = RegionBelow( regPrev );
- e = reg->eUp->Sym;
- if( e->Org != ePrev->Org ) break;
-
- if( e->Onext != ePrev ) {
- /* Unlink e from its current position, and relink below ePrev */
- if ( !__gl_meshSplice( e->Oprev, e ) ) longjmp(tess->env,1);
- if ( !__gl_meshSplice( ePrev->Oprev, e ) ) longjmp(tess->env,1);
- }
- /* Compute the winding number and "inside" flag for the new regions */
- reg->windingNumber = regPrev->windingNumber - e->winding;
- reg->inside = IsWindingInside( tess, reg->windingNumber );
-
- /* Check for two outgoing edges with same slope -- process these
- * before any intersection tests (see example in __gl_computeInterior).
- */
- regPrev->dirty = TRUE;
- if( ! firstTime && CheckForRightSplice( tess, regPrev )) {
- AddWinding( e, ePrev );
- DeleteRegion( tess, regPrev );
- if ( !__gl_meshDelete( ePrev ) ) longjmp(tess->env,1);
- }
- firstTime = FALSE;
- regPrev = reg;
- ePrev = e;
- }
- regPrev->dirty = TRUE;
- assert( regPrev->windingNumber - e->winding == reg->windingNumber );
-
- if( cleanUp ) {
- /* Check for intersections between newly adjacent edges. */
- WalkDirtyRegions( tess, regPrev );
- }
-}
-
-
-static void CallCombine( GLUtesselator *tess, GLUvertex *isect,
- void *data[4], GLfloat weights[4], int needed )
-{
- GLdouble coords[3];
-
- /* Copy coord data in case the callback changes it. */
- coords[0] = isect->coords[0];
- coords[1] = isect->coords[1];
- coords[2] = isect->coords[2];
-
- isect->data = NULL;
- CALL_COMBINE_OR_COMBINE_DATA( coords, data, weights, &isect->data );
- if( isect->data == NULL ) {
- if( ! needed ) {
- isect->data = data[0];
- } else if( ! tess->fatalError ) {
- /* The only way fatal error is when two edges are found to intersect,
- * but the user has not provided the callback necessary to handle
- * generated intersection points.
- */
- CALL_ERROR_OR_ERROR_DATA( GLU_TESS_NEED_COMBINE_CALLBACK );
- tess->fatalError = TRUE;
- }
- }
-}
-
-static void SpliceMergeVertices( GLUtesselator *tess, GLUhalfEdge *e1,
- GLUhalfEdge *e2 )
-/*
- * Two vertices with idential coordinates are combined into one.
- * e1->Org is kept, while e2->Org is discarded.
- */
-{
- void *data[4] = { NULL, NULL, NULL, NULL };
- GLfloat weights[4] = { 0.5, 0.5, 0.0, 0.0 };
-
- data[0] = e1->Org->data;
- data[1] = e2->Org->data;
- CallCombine( tess, e1->Org, data, weights, FALSE );
- if ( !__gl_meshSplice( e1, e2 ) ) longjmp(tess->env,1);
-}
-
-static void VertexWeights( GLUvertex *isect, GLUvertex *org, GLUvertex *dst,
- GLfloat *weights )
-/*
- * Find some weights which describe how the intersection vertex is
- * a linear combination of "org" and "dest". Each of the two edges
- * which generated "isect" is allocated 50% of the weight; each edge
- * splits the weight between its org and dst according to the
- * relative distance to "isect".
- */
-{
- GLdouble t1 = VertL1dist( org, isect );
- GLdouble t2 = VertL1dist( dst, isect );
-
- weights[0] = 0.5 * t2 / (t1 + t2);
- weights[1] = 0.5 * t1 / (t1 + t2);
- isect->coords[0] += weights[0]*org->coords[0] + weights[1]*dst->coords[0];
- isect->coords[1] += weights[0]*org->coords[1] + weights[1]*dst->coords[1];
- isect->coords[2] += weights[0]*org->coords[2] + weights[1]*dst->coords[2];
-}
-
-
-static void GetIntersectData( GLUtesselator *tess, GLUvertex *isect,
- GLUvertex *orgUp, GLUvertex *dstUp,
- GLUvertex *orgLo, GLUvertex *dstLo )
-/*
- * We've computed a new intersection point, now we need a "data" pointer
- * from the user so that we can refer to this new vertex in the
- * rendering callbacks.
- */
-{
- void *data[4];
- GLfloat weights[4];
-
- data[0] = orgUp->data;
- data[1] = dstUp->data;
- data[2] = orgLo->data;
- data[3] = dstLo->data;
-
- isect->coords[0] = isect->coords[1] = isect->coords[2] = 0;
- VertexWeights( isect, orgUp, dstUp, &weights[0] );
- VertexWeights( isect, orgLo, dstLo, &weights[2] );
-
- CallCombine( tess, isect, data, weights, TRUE );
-}
-
-static int CheckForRightSplice( GLUtesselator *tess, ActiveRegion *regUp )
-/*
- * Check the upper and lower edge of "regUp", to make sure that the
- * eUp->Org is above eLo, or eLo->Org is below eUp (depending on which
- * origin is leftmost).
- *
- * The main purpose is to splice right-going edges with the same
- * dest vertex and nearly identical slopes (ie. we can't distinguish
- * the slopes numerically). However the splicing can also help us
- * to recover from numerical errors. For example, suppose at one
- * point we checked eUp and eLo, and decided that eUp->Org is barely
- * above eLo. Then later, we split eLo into two edges (eg. from
- * a splice operation like this one). This can change the result of
- * our test so that now eUp->Org is incident to eLo, or barely below it.
- * We must correct this condition to maintain the dictionary invariants.
- *
- * One possibility is to check these edges for intersection again
- * (ie. CheckForIntersect). This is what we do if possible. However
- * CheckForIntersect requires that tess->event lies between eUp and eLo,
- * so that it has something to fall back on when the intersection
- * calculation gives us an unusable answer. So, for those cases where
- * we can't check for intersection, this routine fixes the problem
- * by just splicing the offending vertex into the other edge.
- * This is a guaranteed solution, no matter how degenerate things get.
- * Basically this is a combinatorial solution to a numerical problem.
- */
-{
- ActiveRegion *regLo = RegionBelow(regUp);
- GLUhalfEdge *eUp = regUp->eUp;
- GLUhalfEdge *eLo = regLo->eUp;
-
- if( VertLeq( eUp->Org, eLo->Org )) {
- if( EdgeSign( eLo->Dst, eUp->Org, eLo->Org ) > 0 ) return FALSE;
-
- /* eUp->Org appears to be below eLo */
- if( ! VertEq( eUp->Org, eLo->Org )) {
- /* Splice eUp->Org into eLo */
- if ( __gl_meshSplitEdge( eLo->Sym ) == NULL) longjmp(tess->env,1);
- if ( !__gl_meshSplice( eUp, eLo->Oprev ) ) longjmp(tess->env,1);
- regUp->dirty = regLo->dirty = TRUE;
-
- } else if( eUp->Org != eLo->Org ) {
- /* merge the two vertices, discarding eUp->Org */
- pqDelete( tess->pq, eUp->Org->pqHandle ); /* __gl_pqSortDelete */
- SpliceMergeVertices( tess, eLo->Oprev, eUp );
- }
- } else {
- if( EdgeSign( eUp->Dst, eLo->Org, eUp->Org ) < 0 ) return FALSE;
-
- /* eLo->Org appears to be above eUp, so splice eLo->Org into eUp */
- RegionAbove(regUp)->dirty = regUp->dirty = TRUE;
- if (__gl_meshSplitEdge( eUp->Sym ) == NULL) longjmp(tess->env,1);
- if ( !__gl_meshSplice( eLo->Oprev, eUp ) ) longjmp(tess->env,1);
- }
- return TRUE;
-}
-
-static int CheckForLeftSplice( GLUtesselator *tess, ActiveRegion *regUp )
-/*
- * Check the upper and lower edge of "regUp", to make sure that the
- * eUp->Dst is above eLo, or eLo->Dst is below eUp (depending on which
- * destination is rightmost).
- *
- * Theoretically, this should always be true. However, splitting an edge
- * into two pieces can change the results of previous tests. For example,
- * suppose at one point we checked eUp and eLo, and decided that eUp->Dst
- * is barely above eLo. Then later, we split eLo into two edges (eg. from
- * a splice operation like this one). This can change the result of
- * the test so that now eUp->Dst is incident to eLo, or barely below it.
- * We must correct this condition to maintain the dictionary invariants
- * (otherwise new edges might get inserted in the wrong place in the
- * dictionary, and bad stuff will happen).
- *
- * We fix the problem by just splicing the offending vertex into the
- * other edge.
- */
-{
- ActiveRegion *regLo = RegionBelow(regUp);
- GLUhalfEdge *eUp = regUp->eUp;
- GLUhalfEdge *eLo = regLo->eUp;
- GLUhalfEdge *e;
-
- assert( ! VertEq( eUp->Dst, eLo->Dst ));
-
- if( VertLeq( eUp->Dst, eLo->Dst )) {
- if( EdgeSign( eUp->Dst, eLo->Dst, eUp->Org ) < 0 ) return FALSE;
-
- /* eLo->Dst is above eUp, so splice eLo->Dst into eUp */
- RegionAbove(regUp)->dirty = regUp->dirty = TRUE;
- e = __gl_meshSplitEdge( eUp );
- if (e == NULL) longjmp(tess->env,1);
- if ( !__gl_meshSplice( eLo->Sym, e ) ) longjmp(tess->env,1);
- e->Lface->inside = regUp->inside;
- } else {
- if( EdgeSign( eLo->Dst, eUp->Dst, eLo->Org ) > 0 ) return FALSE;
-
- /* eUp->Dst is below eLo, so splice eUp->Dst into eLo */
- regUp->dirty = regLo->dirty = TRUE;
- e = __gl_meshSplitEdge( eLo );
- if (e == NULL) longjmp(tess->env,1);
- if ( !__gl_meshSplice( eUp->Lnext, eLo->Sym ) ) longjmp(tess->env,1);
- e->Rface->inside = regUp->inside;
- }
- return TRUE;
-}
-
-
-static int CheckForIntersect( GLUtesselator *tess, ActiveRegion *regUp )
-/*
- * Check the upper and lower edges of the given region to see if
- * they intersect. If so, create the intersection and add it
- * to the data structures.
- *
- * Returns TRUE if adding the new intersection resulted in a recursive
- * call to AddRightEdges(); in this case all "dirty" regions have been
- * checked for intersections, and possibly regUp has been deleted.
- */
-{
- ActiveRegion *regLo = RegionBelow(regUp);
- GLUhalfEdge *eUp = regUp->eUp;
- GLUhalfEdge *eLo = regLo->eUp;
- GLUvertex *orgUp = eUp->Org;
- GLUvertex *orgLo = eLo->Org;
- GLUvertex *dstUp = eUp->Dst;
- GLUvertex *dstLo = eLo->Dst;
- GLdouble tMinUp, tMaxLo;
- GLUvertex isect, *orgMin;
- GLUhalfEdge *e;
-
- assert( ! VertEq( dstLo, dstUp ));
- assert( EdgeSign( dstUp, tess->event, orgUp ) <= 0 );
- assert( EdgeSign( dstLo, tess->event, orgLo ) >= 0 );
- assert( orgUp != tess->event && orgLo != tess->event );
- assert( ! regUp->fixUpperEdge && ! regLo->fixUpperEdge );
-
- if( orgUp == orgLo ) return FALSE; /* right endpoints are the same */
-
- tMinUp = MIN( orgUp->t, dstUp->t );
- tMaxLo = MAX( orgLo->t, dstLo->t );
- if( tMinUp > tMaxLo ) return FALSE; /* t ranges do not overlap */
-
- if( VertLeq( orgUp, orgLo )) {
- if( EdgeSign( dstLo, orgUp, orgLo ) > 0 ) return FALSE;
- } else {
- if( EdgeSign( dstUp, orgLo, orgUp ) < 0 ) return FALSE;
- }
-
- /* At this point the edges intersect, at least marginally */
- DebugEvent( tess );
-
- __gl_edgeIntersect( dstUp, orgUp, dstLo, orgLo, &isect );
- /* The following properties are guaranteed: */
- assert( MIN( orgUp->t, dstUp->t ) <= isect.t );
- assert( isect.t <= MAX( orgLo->t, dstLo->t ));
- assert( MIN( dstLo->s, dstUp->s ) <= isect.s );
- assert( isect.s <= MAX( orgLo->s, orgUp->s ));
-
- if( VertLeq( &isect, tess->event )) {
- /* The intersection point lies slightly to the left of the sweep line,
- * so move it until it''s slightly to the right of the sweep line.
- * (If we had perfect numerical precision, this would never happen
- * in the first place). The easiest and safest thing to do is
- * replace the intersection by tess->event.
- */
- isect.s = tess->event->s;
- isect.t = tess->event->t;
- }
- /* Similarly, if the computed intersection lies to the right of the
- * rightmost origin (which should rarely happen), it can cause
- * unbelievable inefficiency on sufficiently degenerate inputs.
- * (If you have the test program, try running test54.d with the
- * "X zoom" option turned on).
- */
- orgMin = VertLeq( orgUp, orgLo ) ? orgUp : orgLo;
- if( VertLeq( orgMin, &isect )) {
- isect.s = orgMin->s;
- isect.t = orgMin->t;
- }
-
- if( VertEq( &isect, orgUp ) || VertEq( &isect, orgLo )) {
- /* Easy case -- intersection at one of the right endpoints */
- (void) CheckForRightSplice( tess, regUp );
- return FALSE;
- }
-
- if( (! VertEq( dstUp, tess->event )
- && EdgeSign( dstUp, tess->event, &isect ) >= 0)
- || (! VertEq( dstLo, tess->event )
- && EdgeSign( dstLo, tess->event, &isect ) <= 0 ))
- {
- /* Very unusual -- the new upper or lower edge would pass on the
- * wrong side of the sweep event, or through it. This can happen
- * due to very small numerical errors in the intersection calculation.
- */
- if( dstLo == tess->event ) {
- /* Splice dstLo into eUp, and process the new region(s) */
- if (__gl_meshSplitEdge( eUp->Sym ) == NULL) longjmp(tess->env,1);
- if ( !__gl_meshSplice( eLo->Sym, eUp ) ) longjmp(tess->env,1);
- regUp = TopLeftRegion( regUp );
- if (regUp == NULL) longjmp(tess->env,1);
- eUp = RegionBelow(regUp)->eUp;
- FinishLeftRegions( tess, RegionBelow(regUp), regLo );
- AddRightEdges( tess, regUp, eUp->Oprev, eUp, eUp, TRUE );
- return TRUE;
- }
- if( dstUp == tess->event ) {
- /* Splice dstUp into eLo, and process the new region(s) */
- if (__gl_meshSplitEdge( eLo->Sym ) == NULL) longjmp(tess->env,1);
- if ( !__gl_meshSplice( eUp->Lnext, eLo->Oprev ) ) longjmp(tess->env,1);
- regLo = regUp;
- regUp = TopRightRegion( regUp );
- e = RegionBelow(regUp)->eUp->Rprev;
- regLo->eUp = eLo->Oprev;
- eLo = FinishLeftRegions( tess, regLo, NULL );
- AddRightEdges( tess, regUp, eLo->Onext, eUp->Rprev, e, TRUE );
- return TRUE;
- }
- /* Special case: called from ConnectRightVertex. If either
- * edge passes on the wrong side of tess->event, split it
- * (and wait for ConnectRightVertex to splice it appropriately).
- */
- if( EdgeSign( dstUp, tess->event, &isect ) >= 0 ) {
- RegionAbove(regUp)->dirty = regUp->dirty = TRUE;
- if (__gl_meshSplitEdge( eUp->Sym ) == NULL) longjmp(tess->env,1);
- eUp->Org->s = tess->event->s;
- eUp->Org->t = tess->event->t;
- }
- if( EdgeSign( dstLo, tess->event, &isect ) <= 0 ) {
- regUp->dirty = regLo->dirty = TRUE;
- if (__gl_meshSplitEdge( eLo->Sym ) == NULL) longjmp(tess->env,1);
- eLo->Org->s = tess->event->s;
- eLo->Org->t = tess->event->t;
- }
- /* leave the rest for ConnectRightVertex */
- return FALSE;
- }
-
- /* General case -- split both edges, splice into new vertex.
- * When we do the splice operation, the order of the arguments is
- * arbitrary as far as correctness goes. However, when the operation
- * creates a new face, the work done is proportional to the size of
- * the new face. We expect the faces in the processed part of
- * the mesh (ie. eUp->Lface) to be smaller than the faces in the
- * unprocessed original contours (which will be eLo->Oprev->Lface).
- */
- if (__gl_meshSplitEdge( eUp->Sym ) == NULL) longjmp(tess->env,1);
- if (__gl_meshSplitEdge( eLo->Sym ) == NULL) longjmp(tess->env,1);
- if ( !__gl_meshSplice( eLo->Oprev, eUp ) ) longjmp(tess->env,1);
- eUp->Org->s = isect.s;
- eUp->Org->t = isect.t;
- eUp->Org->pqHandle = pqInsert( tess->pq, eUp->Org ); /* __gl_pqSortInsert */
- if (eUp->Org->pqHandle == LONG_MAX) {
- pqDeletePriorityQ(tess->pq); /* __gl_pqSortDeletePriorityQ */
- tess->pq = NULL;
- longjmp(tess->env,1);
- }
- GetIntersectData( tess, eUp->Org, orgUp, dstUp, orgLo, dstLo );
- RegionAbove(regUp)->dirty = regUp->dirty = regLo->dirty = TRUE;
- return FALSE;
-}
-
-static void WalkDirtyRegions( GLUtesselator *tess, ActiveRegion *regUp )
-/*
- * When the upper or lower edge of any region changes, the region is
- * marked "dirty". This routine walks through all the dirty regions
- * and makes sure that the dictionary invariants are satisfied
- * (see the comments at the beginning of this file). Of course
- * new dirty regions can be created as we make changes to restore
- * the invariants.
- */
-{
- ActiveRegion *regLo = RegionBelow(regUp);
- GLUhalfEdge *eUp, *eLo;
-
- for( ;; ) {
- /* Find the lowest dirty region (we walk from the bottom up). */
- while( regLo->dirty ) {
- regUp = regLo;
- regLo = RegionBelow(regLo);
- }
- if( ! regUp->dirty ) {
- regLo = regUp;
- regUp = RegionAbove( regUp );
- if( regUp == NULL || ! regUp->dirty ) {
- /* We've walked all the dirty regions */
- return;
- }
- }
- regUp->dirty = FALSE;
- eUp = regUp->eUp;
- eLo = regLo->eUp;
-
- if( eUp->Dst != eLo->Dst ) {
- /* Check that the edge ordering is obeyed at the Dst vertices. */
- if( CheckForLeftSplice( tess, regUp )) {
-
- /* If the upper or lower edge was marked fixUpperEdge, then
- * we no longer need it (since these edges are needed only for
- * vertices which otherwise have no right-going edges).
- */
- if( regLo->fixUpperEdge ) {
- DeleteRegion( tess, regLo );
- if ( !__gl_meshDelete( eLo ) ) longjmp(tess->env,1);
- regLo = RegionBelow( regUp );
- eLo = regLo->eUp;
- } else if( regUp->fixUpperEdge ) {
- DeleteRegion( tess, regUp );
- if ( !__gl_meshDelete( eUp ) ) longjmp(tess->env,1);
- regUp = RegionAbove( regLo );
- eUp = regUp->eUp;
- }
- }
- }
- if( eUp->Org != eLo->Org ) {
- if( eUp->Dst != eLo->Dst
- && ! regUp->fixUpperEdge && ! regLo->fixUpperEdge
- && (eUp->Dst == tess->event || eLo->Dst == tess->event) )
- {
- /* When all else fails in CheckForIntersect(), it uses tess->event
- * as the intersection location. To make this possible, it requires
- * that tess->event lie between the upper and lower edges, and also
- * that neither of these is marked fixUpperEdge (since in the worst
- * case it might splice one of these edges into tess->event, and
- * violate the invariant that fixable edges are the only right-going
- * edge from their associated vertex).
- */
- if( CheckForIntersect( tess, regUp )) {
- /* WalkDirtyRegions() was called recursively; we're done */
- return;
- }
- } else {
- /* Even though we can't use CheckForIntersect(), the Org vertices
- * may violate the dictionary edge ordering. Check and correct this.
- */
- (void) CheckForRightSplice( tess, regUp );
- }
- }
- if( eUp->Org == eLo->Org && eUp->Dst == eLo->Dst ) {
- /* A degenerate loop consisting of only two edges -- delete it. */
- AddWinding( eLo, eUp );
- DeleteRegion( tess, regUp );
- if ( !__gl_meshDelete( eUp ) ) longjmp(tess->env,1);
- regUp = RegionAbove( regLo );
- }
- }
-}
-
-
-static void ConnectRightVertex( GLUtesselator *tess, ActiveRegion *regUp,
- GLUhalfEdge *eBottomLeft )
-/*
- * Purpose: connect a "right" vertex vEvent (one where all edges go left)
- * to the unprocessed portion of the mesh. Since there are no right-going
- * edges, two regions (one above vEvent and one below) are being merged
- * into one. "regUp" is the upper of these two regions.
- *
- * There are two reasons for doing this (adding a right-going edge):
- * - if the two regions being merged are "inside", we must add an edge
- * to keep them separated (the combined region would not be monotone).
- * - in any case, we must leave some record of vEvent in the dictionary,
- * so that we can merge vEvent with features that we have not seen yet.
- * For example, maybe there is a vertical edge which passes just to
- * the right of vEvent; we would like to splice vEvent into this edge.
- *
- * However, we don't want to connect vEvent to just any vertex. We don''t
- * want the new edge to cross any other edges; otherwise we will create
- * intersection vertices even when the input data had no self-intersections.
- * (This is a bad thing; if the user's input data has no intersections,
- * we don't want to generate any false intersections ourselves.)
- *
- * Our eventual goal is to connect vEvent to the leftmost unprocessed
- * vertex of the combined region (the union of regUp and regLo).
- * But because of unseen vertices with all right-going edges, and also
- * new vertices which may be created by edge intersections, we don''t
- * know where that leftmost unprocessed vertex is. In the meantime, we
- * connect vEvent to the closest vertex of either chain, and mark the region
- * as "fixUpperEdge". This flag says to delete and reconnect this edge
- * to the next processed vertex on the boundary of the combined region.
- * Quite possibly the vertex we connected to will turn out to be the
- * closest one, in which case we won''t need to make any changes.
- */
-{
- GLUhalfEdge *eNew;
- GLUhalfEdge *eTopLeft = eBottomLeft->Onext;
- ActiveRegion *regLo = RegionBelow(regUp);
- GLUhalfEdge *eUp = regUp->eUp;
- GLUhalfEdge *eLo = regLo->eUp;
- int degenerate = FALSE;
-
- if( eUp->Dst != eLo->Dst ) {
- (void) CheckForIntersect( tess, regUp );
- }
-
- /* Possible new degeneracies: upper or lower edge of regUp may pass
- * through vEvent, or may coincide with new intersection vertex
- */
- if( VertEq( eUp->Org, tess->event )) {
- if ( !__gl_meshSplice( eTopLeft->Oprev, eUp ) ) longjmp(tess->env,1);
- regUp = TopLeftRegion( regUp );
- if (regUp == NULL) longjmp(tess->env,1);
- eTopLeft = RegionBelow( regUp )->eUp;
- FinishLeftRegions( tess, RegionBelow(regUp), regLo );
- degenerate = TRUE;
- }
- if( VertEq( eLo->Org, tess->event )) {
- if ( !__gl_meshSplice( eBottomLeft, eLo->Oprev ) ) longjmp(tess->env,1);
- eBottomLeft = FinishLeftRegions( tess, regLo, NULL );
- degenerate = TRUE;
- }
- if( degenerate ) {
- AddRightEdges( tess, regUp, eBottomLeft->Onext, eTopLeft, eTopLeft, TRUE );
- return;
- }
-
- /* Non-degenerate situation -- need to add a temporary, fixable edge.
- * Connect to the closer of eLo->Org, eUp->Org.
- */
- if( VertLeq( eLo->Org, eUp->Org )) {
- eNew = eLo->Oprev;
- } else {
- eNew = eUp;
- }
- eNew = __gl_meshConnect( eBottomLeft->Lprev, eNew );
- if (eNew == NULL) longjmp(tess->env,1);
-
- /* Prevent cleanup, otherwise eNew might disappear before we've even
- * had a chance to mark it as a temporary edge.
- */
- AddRightEdges( tess, regUp, eNew, eNew->Onext, eNew->Onext, FALSE );
- eNew->Sym->activeRegion->fixUpperEdge = TRUE;
- WalkDirtyRegions( tess, regUp );
-}
-
-/* Because vertices at exactly the same location are merged together
- * before we process the sweep event, some degenerate cases can't occur.
- * However if someone eventually makes the modifications required to
- * merge features which are close together, the cases below marked
- * TOLERANCE_NONZERO will be useful. They were debugged before the
- * code to merge identical vertices in the main loop was added.
- */
-#define TOLERANCE_NONZERO FALSE
-
-static void ConnectLeftDegenerate( GLUtesselator *tess,
- ActiveRegion *regUp, GLUvertex *vEvent )
-/*
- * The event vertex lies exacty on an already-processed edge or vertex.
- * Adding the new vertex involves splicing it into the already-processed
- * part of the mesh.
- */
-{
- GLUhalfEdge *e, *eTopLeft, *eTopRight, *eLast;
- ActiveRegion *reg;
-
- e = regUp->eUp;
- if( VertEq( e->Org, vEvent )) {
- /* e->Org is an unprocessed vertex - just combine them, and wait
- * for e->Org to be pulled from the queue
- */
- assert( TOLERANCE_NONZERO );
- SpliceMergeVertices( tess, e, vEvent->anEdge );
- return;
- }
-
- if( ! VertEq( e->Dst, vEvent )) {
- /* General case -- splice vEvent into edge e which passes through it */
- if (__gl_meshSplitEdge( e->Sym ) == NULL) longjmp(tess->env,1);
- if( regUp->fixUpperEdge ) {
- /* This edge was fixable -- delete unused portion of original edge */
- if ( !__gl_meshDelete( e->Onext ) ) longjmp(tess->env,1);
- regUp->fixUpperEdge = FALSE;
- }
- if ( !__gl_meshSplice( vEvent->anEdge, e ) ) longjmp(tess->env,1);
- SweepEvent( tess, vEvent ); /* recurse */
- return;
- }
-
- /* vEvent coincides with e->Dst, which has already been processed.
- * Splice in the additional right-going edges.
- */
- assert( TOLERANCE_NONZERO );
- regUp = TopRightRegion( regUp );
- reg = RegionBelow( regUp );
- eTopRight = reg->eUp->Sym;
- eTopLeft = eLast = eTopRight->Onext;
- if( reg->fixUpperEdge ) {
- /* Here e->Dst has only a single fixable edge going right.
- * We can delete it since now we have some real right-going edges.
- */
- assert( eTopLeft != eTopRight ); /* there are some left edges too */
- DeleteRegion( tess, reg );
- if ( !__gl_meshDelete( eTopRight ) ) longjmp(tess->env,1);
- eTopRight = eTopLeft->Oprev;
- }
- if ( !__gl_meshSplice( vEvent->anEdge, eTopRight ) ) longjmp(tess->env,1);
- if( ! EdgeGoesLeft( eTopLeft )) {
- /* e->Dst had no left-going edges -- indicate this to AddRightEdges() */
- eTopLeft = NULL;
- }
- AddRightEdges( tess, regUp, eTopRight->Onext, eLast, eTopLeft, TRUE );
-}
-
-
-static void ConnectLeftVertex( GLUtesselator *tess, GLUvertex *vEvent )
-/*
- * Purpose: connect a "left" vertex (one where both edges go right)
- * to the processed portion of the mesh. Let R be the active region
- * containing vEvent, and let U and L be the upper and lower edge
- * chains of R. There are two possibilities:
- *
- * - the normal case: split R into two regions, by connecting vEvent to
- * the rightmost vertex of U or L lying to the left of the sweep line
- *
- * - the degenerate case: if vEvent is close enough to U or L, we
- * merge vEvent into that edge chain. The subcases are:
- * - merging with the rightmost vertex of U or L
- * - merging with the active edge of U or L
- * - merging with an already-processed portion of U or L
- */
-{
- ActiveRegion *regUp, *regLo, *reg;
- GLUhalfEdge *eUp, *eLo, *eNew;
- ActiveRegion tmp;
-
- /* assert( vEvent->anEdge->Onext->Onext == vEvent->anEdge ); */
-
- /* Get a pointer to the active region containing vEvent */
- tmp.eUp = vEvent->anEdge->Sym;
- /* __GL_DICTLISTKEY */ /* __gl_dictListSearch */
- regUp = (ActiveRegion *)dictKey( dictSearch( tess->dict, &tmp ));
- regLo = RegionBelow( regUp );
- eUp = regUp->eUp;
- eLo = regLo->eUp;
-
- /* Try merging with U or L first */
- if( EdgeSign( eUp->Dst, vEvent, eUp->Org ) == 0 ) {
- ConnectLeftDegenerate( tess, regUp, vEvent );
- return;
- }
-
- /* Connect vEvent to rightmost processed vertex of either chain.
- * e->Dst is the vertex that we will connect to vEvent.
- */
- reg = VertLeq( eLo->Dst, eUp->Dst ) ? regUp : regLo;
-
- if( regUp->inside || reg->fixUpperEdge) {
- if( reg == regUp ) {
- eNew = __gl_meshConnect( vEvent->anEdge->Sym, eUp->Lnext );
- if (eNew == NULL) longjmp(tess->env,1);
- } else {
- GLUhalfEdge *tempHalfEdge= __gl_meshConnect( eLo->Dnext, vEvent->anEdge);
- if (tempHalfEdge == NULL) longjmp(tess->env,1);
-
- eNew = tempHalfEdge->Sym;
- }
- if( reg->fixUpperEdge ) {
- if ( !FixUpperEdge( reg, eNew ) ) longjmp(tess->env,1);
- } else {
- ComputeWinding( tess, AddRegionBelow( tess, regUp, eNew ));
- }
- SweepEvent( tess, vEvent );
- } else {
- /* The new vertex is in a region which does not belong to the polygon.
- * We don''t need to connect this vertex to the rest of the mesh.
- */
- AddRightEdges( tess, regUp, vEvent->anEdge, vEvent->anEdge, NULL, TRUE );
- }
-}
-
-
-static void SweepEvent( GLUtesselator *tess, GLUvertex *vEvent )
-/*
- * Does everything necessary when the sweep line crosses a vertex.
- * Updates the mesh and the edge dictionary.
- */
-{
- ActiveRegion *regUp, *reg;
- GLUhalfEdge *e, *eTopLeft, *eBottomLeft;
-
- tess->event = vEvent; /* for access in EdgeLeq() */
- DebugEvent( tess );
-
- /* Check if this vertex is the right endpoint of an edge that is
- * already in the dictionary. In this case we don't need to waste
- * time searching for the location to insert new edges.
- */
- e = vEvent->anEdge;
- while( e->activeRegion == NULL ) {
- e = e->Onext;
- if( e == vEvent->anEdge ) {
- /* All edges go right -- not incident to any processed edges */
- ConnectLeftVertex( tess, vEvent );
- return;
- }
- }
-
- /* Processing consists of two phases: first we "finish" all the
- * active regions where both the upper and lower edges terminate
- * at vEvent (ie. vEvent is closing off these regions).
- * We mark these faces "inside" or "outside" the polygon according
- * to their winding number, and delete the edges from the dictionary.
- * This takes care of all the left-going edges from vEvent.
- */
- regUp = TopLeftRegion( e->activeRegion );
- if (regUp == NULL) longjmp(tess->env,1);
- reg = RegionBelow( regUp );
- eTopLeft = reg->eUp;
- eBottomLeft = FinishLeftRegions( tess, reg, NULL );
-
- /* Next we process all the right-going edges from vEvent. This
- * involves adding the edges to the dictionary, and creating the
- * associated "active regions" which record information about the
- * regions between adjacent dictionary edges.
- */
- if( eBottomLeft->Onext == eTopLeft ) {
- /* No right-going edges -- add a temporary "fixable" edge */
- ConnectRightVertex( tess, regUp, eBottomLeft );
- } else {
- AddRightEdges( tess, regUp, eBottomLeft->Onext, eTopLeft, eTopLeft, TRUE );
- }
-}
-
-
-/* Make the sentinel coordinates big enough that they will never be
- * merged with real input features. (Even with the largest possible
- * input contour and the maximum tolerance of 1.0, no merging will be
- * done with coordinates larger than 3 * GLU_TESS_MAX_COORD).
- */
-#define SENTINEL_COORD (4 * GLU_TESS_MAX_COORD)
-
-static void AddSentinel( GLUtesselator *tess, GLdouble t )
-/*
- * We add two sentinel edges above and below all other edges,
- * to avoid special cases at the top and bottom.
- */
-{
- GLUhalfEdge *e;
- ActiveRegion *reg = (ActiveRegion *)memAlloc( sizeof( ActiveRegion ));
- if (reg == NULL) longjmp(tess->env,1);
-
- e = __gl_meshMakeEdge( tess->mesh );
- if (e == NULL) longjmp(tess->env,1);
-
- e->Org->s = SENTINEL_COORD;
- e->Org->t = t;
- e->Dst->s = -SENTINEL_COORD;
- e->Dst->t = t;
- tess->event = e->Dst; /* initialize it */
-
- reg->eUp = e;
- reg->windingNumber = 0;
- reg->inside = FALSE;
- reg->fixUpperEdge = FALSE;
- reg->sentinel = TRUE;
- reg->dirty = FALSE;
- reg->nodeUp = dictInsert( tess->dict, reg ); /* __gl_dictListInsertBefore */
- if (reg->nodeUp == NULL) longjmp(tess->env,1);
-}
-
-
-static void InitEdgeDict( GLUtesselator *tess )
-/*
- * We maintain an ordering of edge intersections with the sweep line.
- * This order is maintained in a dynamic dictionary.
- */
-{
- /* __gl_dictListNewDict */
- tess->dict = dictNewDict( tess, (int (*)(void *, DictKey, DictKey)) EdgeLeq );
- if (tess->dict == NULL) longjmp(tess->env,1);
-
- AddSentinel( tess, -SENTINEL_COORD );
- AddSentinel( tess, SENTINEL_COORD );
-}
-
-
-static void DoneEdgeDict( GLUtesselator *tess )
-{
- ActiveRegion *reg;
- int fixedEdges = 0;
-
- /* __GL_DICTLISTKEY */ /* __GL_DICTLISTMIN */
- while( (reg = (ActiveRegion *)dictKey( dictMin( tess->dict ))) != NULL ) {
- /*
- * At the end of all processing, the dictionary should contain
- * only the two sentinel edges, plus at most one "fixable" edge
- * created by ConnectRightVertex().
- */
- if( ! reg->sentinel ) {
- assert( reg->fixUpperEdge );
- assert( fixedEdges == 0 );
- ++fixedEdges;
- }
- assert( reg->windingNumber == 0 );
- DeleteRegion( tess, reg );
-/* __gl_meshDelete( reg->eUp );*/
- }
- dictDeleteDict( tess->dict ); /* __gl_dictListDeleteDict */
-}
-
-
-static void RemoveDegenerateEdges( GLUtesselator *tess )
-/*
- * Remove zero-length edges, and contours with fewer than 3 vertices.
- */
-{
- GLUhalfEdge *e, *eNext, *eLnext;
- GLUhalfEdge *eHead = &tess->mesh->eHead;
-
- /*LINTED*/
- for( e = eHead->next; e != eHead; e = eNext ) {
- eNext = e->next;
- eLnext = e->Lnext;
-
- if( VertEq( e->Org, e->Dst ) && e->Lnext->Lnext != e ) {
- /* Zero-length edge, contour has at least 3 edges */
-
- SpliceMergeVertices( tess, eLnext, e ); /* deletes e->Org */
- if ( !__gl_meshDelete( e ) ) longjmp(tess->env,1); /* e is a self-loop */
- e = eLnext;
- eLnext = e->Lnext;
- }
- if( eLnext->Lnext == e ) {
- /* Degenerate contour (one or two edges) */
-
- if( eLnext != e ) {
- if( eLnext == eNext || eLnext == eNext->Sym ) { eNext = eNext->next; }
- if ( !__gl_meshDelete( eLnext ) ) longjmp(tess->env,1);
- }
- if( e == eNext || e == eNext->Sym ) { eNext = eNext->next; }
- if ( !__gl_meshDelete( e ) ) longjmp(tess->env,1);
- }
- }
-}
-
-static int InitPriorityQ( GLUtesselator *tess )
-/*
- * Insert all vertices into the priority queue which determines the
- * order in which vertices cross the sweep line.
- */
-{
- PriorityQ *pq;
- GLUvertex *v, *vHead;
-
- /* __gl_pqSortNewPriorityQ */
- pq = tess->pq = pqNewPriorityQ( (int (*)(PQkey, PQkey)) __gl_vertLeq );
- if (pq == NULL) return 0;
-
- vHead = &tess->mesh->vHead;
- for( v = vHead->next; v != vHead; v = v->next ) {
- v->pqHandle = pqInsert( pq, v ); /* __gl_pqSortInsert */
- if (v->pqHandle == LONG_MAX) break;
- }
- if (v != vHead || !pqInit( pq ) ) { /* __gl_pqSortInit */
- pqDeletePriorityQ(tess->pq); /* __gl_pqSortDeletePriorityQ */
- tess->pq = NULL;
- return 0;
- }
-
- return 1;
-}
-
-
-static void DonePriorityQ( GLUtesselator *tess )
-{
- pqDeletePriorityQ( tess->pq ); /* __gl_pqSortDeletePriorityQ */
-}
-
-
-static int RemoveDegenerateFaces( GLUmesh *mesh )
-/*
- * Delete any degenerate faces with only two edges. WalkDirtyRegions()
- * will catch almost all of these, but it won't catch degenerate faces
- * produced by splice operations on already-processed edges.
- * The two places this can happen are in FinishLeftRegions(), when
- * we splice in a "temporary" edge produced by ConnectRightVertex(),
- * and in CheckForLeftSplice(), where we splice already-processed
- * edges to ensure that our dictionary invariants are not violated
- * by numerical errors.
- *
- * In both these cases it is *very* dangerous to delete the offending
- * edge at the time, since one of the routines further up the stack
- * will sometimes be keeping a pointer to that edge.
- */
-{
- GLUface *f, *fNext;
- GLUhalfEdge *e;
-
- /*LINTED*/
- for( f = mesh->fHead.next; f != &mesh->fHead; f = fNext ) {
- fNext = f->next;
- e = f->anEdge;
- assert( e->Lnext != e );
-
- if( e->Lnext->Lnext == e ) {
- /* A face with only two edges */
- AddWinding( e->Onext, e );
- if ( !__gl_meshDelete( e ) ) return 0;
- }
- }
- return 1;
-}
-
-int __gl_computeInterior( GLUtesselator *tess )
-/*
- * __gl_computeInterior( tess ) computes the planar arrangement specified
- * by the given contours, and further subdivides this arrangement
- * into regions. Each region is marked "inside" if it belongs
- * to the polygon, according to the rule given by tess->windingRule.
- * Each interior region is guaranteed be monotone.
- */
-{
- GLUvertex *v, *vNext;
-
- tess->fatalError = FALSE;
-
- /* Each vertex defines an event for our sweep line. Start by inserting
- * all the vertices in a priority queue. Events are processed in
- * lexicographic order, ie.
- *
- * e1 < e2 iff e1.x < e2.x || (e1.x == e2.x && e1.y < e2.y)
- */
- RemoveDegenerateEdges( tess );
- if ( !InitPriorityQ( tess ) ) return 0; /* if error */
- InitEdgeDict( tess );
-
- /* __gl_pqSortExtractMin */
- while( (v = (GLUvertex *)pqExtractMin( tess->pq )) != NULL ) {
- for( ;; ) {
- vNext = (GLUvertex *)pqMinimum( tess->pq ); /* __gl_pqSortMinimum */
- if( vNext == NULL || ! VertEq( vNext, v )) break;
-
- /* Merge together all vertices at exactly the same location.
- * This is more efficient than processing them one at a time,
- * simplifies the code (see ConnectLeftDegenerate), and is also
- * important for correct handling of certain degenerate cases.
- * For example, suppose there are two identical edges A and B
- * that belong to different contours (so without this code they would
- * be processed by separate sweep events). Suppose another edge C
- * crosses A and B from above. When A is processed, we split it
- * at its intersection point with C. However this also splits C,
- * so when we insert B we may compute a slightly different
- * intersection point. This might leave two edges with a small
- * gap between them. This kind of error is especially obvious
- * when using boundary extraction (GLU_TESS_BOUNDARY_ONLY).
- */
- vNext = (GLUvertex *)pqExtractMin( tess->pq ); /* __gl_pqSortExtractMin*/
- SpliceMergeVertices( tess, v->anEdge, vNext->anEdge );
- }
- SweepEvent( tess, v );
- }
-
- /* Set tess->event for debugging purposes */
- /* __GL_DICTLISTKEY */ /* __GL_DICTLISTMIN */
- tess->event = ((ActiveRegion *) dictKey( dictMin( tess->dict )))->eUp->Org;
- DebugEvent( tess );
- DoneEdgeDict( tess );
- DonePriorityQ( tess );
-
- if ( !RemoveDegenerateFaces( tess->mesh ) ) return 0;
- __gl_meshCheckMesh( tess->mesh );
-
- return 1;
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/sweep.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/sweep.h
deleted file mode 100755
index 17ea81b01..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/sweep.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/sweep.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef __sweep_h_
-#define __sweep_h_
-
-#include "mesh.h"
-
-/* __gl_computeInterior( tess ) computes the planar arrangement specified
- * by the given contours, and further subdivides this arrangement
- * into regions. Each region is marked "inside" if it belongs
- * to the polygon, according to the rule given by tess->windingRule.
- * Each interior region is guaranteed be monotone.
- */
-int __gl_computeInterior( GLUtesselator *tess );
-
-
-/* The following is here *only* for access by debugging routines */
-
-#include "dict.h"
-
-/* For each pair of adjacent edges crossing the sweep line, there is
- * an ActiveRegion to represent the region between them. The active
- * regions are kept in sorted order in a dynamic dictionary. As the
- * sweep line crosses each vertex, we update the affected regions.
- */
-
-struct ActiveRegion {
- GLUhalfEdge *eUp; /* upper edge, directed right to left */
- DictNode *nodeUp; /* dictionary node corresponding to eUp */
- int windingNumber; /* used to determine which regions are
- * inside the polygon */
- GLboolean inside; /* is this region inside the polygon? */
- GLboolean sentinel; /* marks fake edges at t = +/-infinity */
- GLboolean dirty; /* marks regions where the upper or lower
- * edge has changed, but we haven't checked
- * whether they intersect yet */
- GLboolean fixUpperEdge; /* marks temporary edges introduced when
- * we process a "right vertex" (one without
- * any edges leaving to the right) */
-};
-
-#define RegionBelow(r) ((ActiveRegion *) dictKey(dictPred((r)->nodeUp)))
-#define RegionAbove(r) ((ActiveRegion *) dictKey(dictSucc((r)->nodeUp)))
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/tess.c b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/tess.c
deleted file mode 100755
index 6d91eef83..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/tess.c
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-*/
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libtess/tess.c,v 1.3 2001/10/28 03:32:22 tsi Exp $ */
-
-#include "gluos.h"
-#include <stddef.h>
-#include <assert.h>
-#include <setjmp.h>
-#include "memalloc.h"
-#include "tess.h"
-#include "mesh.h"
-#include "normal.h"
-#include "sweep.h"
-#include "tessmono.h"
-#include "render.h"
-
-#define GLU_TESS_DEFAULT_TOLERANCE 0.0
-#define GLU_TESS_MESH 100112 /* void (*)(GLUmesh *mesh) */
-
-#define TRUE 1
-#define FALSE 0
-
-/*ARGSUSED*/ static void GLAPIENTRY noBegin( GLenum type ) {}
-/*ARGSUSED*/ static void GLAPIENTRY noEdgeFlag( GLboolean boundaryEdge ) {}
-/*ARGSUSED*/ static void GLAPIENTRY noVertex( void *data ) {}
-/*ARGSUSED*/ static void GLAPIENTRY noEnd( void ) {}
-/*ARGSUSED*/ static void GLAPIENTRY noError( GLenum errnum ) {}
-/*ARGSUSED*/ static void GLAPIENTRY noCombine( GLdouble coords[3], void *data[4],
- GLfloat weight[4], void **dataOut ) {}
-/*ARGSUSED*/ static void GLAPIENTRY noMesh( GLUmesh *mesh ) {}
-
-
-/*ARGSUSED*/ void GLAPIENTRY __gl_noBeginData( GLenum type,
- void *polygonData ) {}
-/*ARGSUSED*/ void GLAPIENTRY __gl_noEdgeFlagData( GLboolean boundaryEdge,
- void *polygonData ) {}
-/*ARGSUSED*/ void GLAPIENTRY __gl_noVertexData( void *data,
- void *polygonData ) {}
-/*ARGSUSED*/ void GLAPIENTRY __gl_noEndData( void *polygonData ) {}
-/*ARGSUSED*/ void GLAPIENTRY __gl_noErrorData( GLenum errnum,
- void *polygonData ) {}
-/*ARGSUSED*/ void GLAPIENTRY __gl_noCombineData( GLdouble coords[3],
- void *data[4],
- GLfloat weight[4],
- void **outData,
- void *polygonData ) {}
-
-/* Half-edges are allocated in pairs (see mesh.c) */
-typedef struct { GLUhalfEdge e, eSym; } EdgePair;
-
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-#define MAX_FAST_ALLOC (MAX(sizeof(EdgePair), \
- MAX(sizeof(GLUvertex),sizeof(GLUface))))
-
-
-GLUtesselator * GLAPIENTRY
-gluNewTess( void )
-{
- GLUtesselator *tess;
-
- /* Only initialize fields which can be changed by the api. Other fields
- * are initialized where they are used.
- */
-
- if (memInit( MAX_FAST_ALLOC ) == 0) {
- return 0; /* out of memory */
- }
- tess = (GLUtesselator *)memAlloc( sizeof( GLUtesselator ));
- if (tess == NULL) {
- return 0; /* out of memory */
- }
-
- tess->state = T_DORMANT;
-
- tess->normal[0] = 0;
- tess->normal[1] = 0;
- tess->normal[2] = 0;
-
- tess->relTolerance = GLU_TESS_DEFAULT_TOLERANCE;
- tess->windingRule = GLU_TESS_WINDING_ODD;
- tess->flagBoundary = FALSE;
- tess->boundaryOnly = FALSE;
-
- tess->callBegin = &noBegin;
- tess->callEdgeFlag = &noEdgeFlag;
- tess->callVertex = &noVertex;
- tess->callEnd = &noEnd;
-
- tess->callError = &noError;
- tess->callCombine = &noCombine;
- tess->callMesh = &noMesh;
-
- tess->callBeginData= &__gl_noBeginData;
- tess->callEdgeFlagData= &__gl_noEdgeFlagData;
- tess->callVertexData= &__gl_noVertexData;
- tess->callEndData= &__gl_noEndData;
- tess->callErrorData= &__gl_noErrorData;
- tess->callCombineData= &__gl_noCombineData;
-
- tess->polygonData= NULL;
-
- return tess;
-}
-
-static void MakeDormant( GLUtesselator *tess )
-{
- /* Return the tessellator to its original dormant state. */
-
- if( tess->mesh != NULL ) {
- __gl_meshDeleteMesh( tess->mesh );
- }
- tess->state = T_DORMANT;
- tess->lastEdge = NULL;
- tess->mesh = NULL;
-}
-
-#define RequireState( tess, s ) if( tess->state != s ) GotoState(tess,s)
-
-static void GotoState( GLUtesselator *tess, enum TessState newState )
-{
- while( tess->state != newState ) {
- /* We change the current state one level at a time, to get to
- * the desired state.
- */
- if( tess->state < newState ) {
- switch( tess->state ) {
- case T_DORMANT:
- CALL_ERROR_OR_ERROR_DATA( GLU_TESS_MISSING_BEGIN_POLYGON );
- gluTessBeginPolygon( tess, NULL );
- break;
- case T_IN_POLYGON:
- CALL_ERROR_OR_ERROR_DATA( GLU_TESS_MISSING_BEGIN_CONTOUR );
- gluTessBeginContour( tess );
- break;
- default:
- break;
- }
- } else {
- switch( tess->state ) {
- case T_IN_CONTOUR:
- CALL_ERROR_OR_ERROR_DATA( GLU_TESS_MISSING_END_CONTOUR );
- gluTessEndContour( tess );
- break;
- case T_IN_POLYGON:
- CALL_ERROR_OR_ERROR_DATA( GLU_TESS_MISSING_END_POLYGON );
- /* gluTessEndPolygon( tess ) is too much work! */
- MakeDormant( tess );
- break;
- default:
- break;
- }
- }
- }
-}
-
-
-void GLAPIENTRY
-gluDeleteTess( GLUtesselator *tess )
-{
- RequireState( tess, T_DORMANT );
- memFree( tess );
-}
-
-
-void GLAPIENTRY
-gluTessProperty( GLUtesselator *tess, GLenum which, GLdouble value )
-{
- GLenum windingRule;
-
- switch( which ) {
- case GLU_TESS_TOLERANCE:
- if( value < 0.0 || value > 1.0 ) break;
- tess->relTolerance = value;
- return;
-
- case GLU_TESS_WINDING_RULE:
- windingRule = (GLenum) value;
- if( windingRule != value ) break; /* not an integer */
-
- switch( windingRule ) {
- case GLU_TESS_WINDING_ODD:
- case GLU_TESS_WINDING_NONZERO:
- case GLU_TESS_WINDING_POSITIVE:
- case GLU_TESS_WINDING_NEGATIVE:
- case GLU_TESS_WINDING_ABS_GEQ_TWO:
- tess->windingRule = windingRule;
- return;
- default:
- break;
- }
-
- case GLU_TESS_BOUNDARY_ONLY:
- tess->boundaryOnly = (value != 0);
- return;
-
- default:
- CALL_ERROR_OR_ERROR_DATA( GLU_INVALID_ENUM );
- return;
- }
- CALL_ERROR_OR_ERROR_DATA( GLU_INVALID_VALUE );
-}
-
-/* Returns tessellator property */
-void GLAPIENTRY
-gluGetTessProperty( GLUtesselator *tess, GLenum which, GLdouble *value )
-{
- switch (which) {
- case GLU_TESS_TOLERANCE:
- /* tolerance should be in range [0..1] */
- assert(0.0 <= tess->relTolerance && tess->relTolerance <= 1.0);
- *value= tess->relTolerance;
- break;
- case GLU_TESS_WINDING_RULE:
- assert(tess->windingRule == GLU_TESS_WINDING_ODD ||
- tess->windingRule == GLU_TESS_WINDING_NONZERO ||
- tess->windingRule == GLU_TESS_WINDING_POSITIVE ||
- tess->windingRule == GLU_TESS_WINDING_NEGATIVE ||
- tess->windingRule == GLU_TESS_WINDING_ABS_GEQ_TWO);
- *value= tess->windingRule;
- break;
- case GLU_TESS_BOUNDARY_ONLY:
- assert(tess->boundaryOnly == TRUE || tess->boundaryOnly == FALSE);
- *value= tess->boundaryOnly;
- break;
- default:
- *value= 0.0;
- CALL_ERROR_OR_ERROR_DATA( GLU_INVALID_ENUM );
- break;
- }
-} /* gluGetTessProperty() */
-
-void GLAPIENTRY
-gluTessNormal( GLUtesselator *tess, GLdouble x, GLdouble y, GLdouble z )
-{
- tess->normal[0] = x;
- tess->normal[1] = y;
- tess->normal[2] = z;
-}
-
-void GLAPIENTRY
-gluTessCallback( GLUtesselator *tess, GLenum which,
- GLvoid (GLAPIENTRY *fn)(GLvoid))
-{
- switch( which ) {
- case GLU_TESS_BEGIN:
- tess->callBegin = (fn == NULL) ? &noBegin : (void (GLAPIENTRY *)(GLenum)) fn;
- return;
- case GLU_TESS_BEGIN_DATA:
- tess->callBeginData = (fn == NULL) ?
- &__gl_noBeginData : (void (GLAPIENTRY *)(GLenum, void *)) fn;
- return;
- case GLU_TESS_EDGE_FLAG:
- tess->callEdgeFlag = (fn == NULL) ? &noEdgeFlag :
- (void (GLAPIENTRY *)(GLboolean)) fn;
- /* If the client wants boundary edges to be flagged,
- * we render everything as separate triangles (no strips or fans).
- */
- tess->flagBoundary = (fn != NULL);
- return;
- case GLU_TESS_EDGE_FLAG_DATA:
- tess->callEdgeFlagData= (fn == NULL) ?
- &__gl_noEdgeFlagData : (void (GLAPIENTRY *)(GLboolean, void *)) fn;
- /* If the client wants boundary edges to be flagged,
- * we render everything as separate triangles (no strips or fans).
- */
- tess->flagBoundary = (fn != NULL);
- return;
- case GLU_TESS_VERTEX:
- tess->callVertex = (fn == NULL) ? &noVertex :
- (void (GLAPIENTRY *)(void *)) fn;
- return;
- case GLU_TESS_VERTEX_DATA:
- tess->callVertexData = (fn == NULL) ?
- &__gl_noVertexData : (void (GLAPIENTRY *)(void *, void *)) fn;
- return;
- case GLU_TESS_END:
- tess->callEnd = (fn == NULL) ? &noEnd : (void (GLAPIENTRY *)(void)) fn;
- return;
- case GLU_TESS_END_DATA:
- tess->callEndData = (fn == NULL) ? &__gl_noEndData :
- (void (GLAPIENTRY *)(void *)) fn;
- return;
- case GLU_TESS_ERROR:
- tess->callError = (fn == NULL) ? &noError : (void (GLAPIENTRY *)(GLenum)) fn;
- return;
- case GLU_TESS_ERROR_DATA:
- tess->callErrorData = (fn == NULL) ?
- &__gl_noErrorData : (void (GLAPIENTRY *)(GLenum, void *)) fn;
- return;
- case GLU_TESS_COMBINE:
- tess->callCombine = (fn == NULL) ? &noCombine :
- (void (GLAPIENTRY *)(GLdouble [3],void *[4], GLfloat [4], void ** )) fn;
- return;
- case GLU_TESS_COMBINE_DATA:
- tess->callCombineData = (fn == NULL) ? &__gl_noCombineData :
- (void (GLAPIENTRY *)(GLdouble [3],
- void *[4],
- GLfloat [4],
- void **,
- void *)) fn;
- return;
- case GLU_TESS_MESH:
- tess->callMesh = (fn == NULL) ? &noMesh : (void (GLAPIENTRY *)(GLUmesh *)) fn;
- return;
- default:
- CALL_ERROR_OR_ERROR_DATA( GLU_INVALID_ENUM );
- return;
- }
-}
-
-static int AddVertex( GLUtesselator *tess, GLdouble coords[3], void *data )
-{
- GLUhalfEdge *e;
-
- e = tess->lastEdge;
- if( e == NULL ) {
- /* Make a self-loop (one vertex, one edge). */
-
- e = __gl_meshMakeEdge( tess->mesh );
- if (e == NULL) return 0;
- if ( !__gl_meshSplice( e, e->Sym ) ) return 0;
- } else {
- /* Create a new vertex and edge which immediately follow e
- * in the ordering around the left face.
- */
- if (__gl_meshSplitEdge( e ) == NULL) return 0;
- e = e->Lnext;
- }
-
- /* The new vertex is now e->Org. */
- e->Org->data = data;
- e->Org->coords[0] = coords[0];
- e->Org->coords[1] = coords[1];
- e->Org->coords[2] = coords[2];
-
- /* The winding of an edge says how the winding number changes as we
- * cross from the edge''s right face to its left face. We add the
- * vertices in such an order that a CCW contour will add +1 to
- * the winding number of the region inside the contour.
- */
- e->winding = 1;
- e->Sym->winding = -1;
-
- tess->lastEdge = e;
-
- return 1;
-}
-
-
-static void CacheVertex( GLUtesselator *tess, GLdouble coords[3], void *data )
-{
- CachedVertex *v = &tess->cache[tess->cacheCount];
-
- v->data = data;
- v->coords[0] = coords[0];
- v->coords[1] = coords[1];
- v->coords[2] = coords[2];
- ++tess->cacheCount;
-}
-
-
-static int EmptyCache( GLUtesselator *tess )
-{
- CachedVertex *v = tess->cache;
- CachedVertex *vLast;
-
- tess->mesh = __gl_meshNewMesh();
- if (tess->mesh == NULL) return 0;
-
- for( vLast = v + tess->cacheCount; v < vLast; ++v ) {
- if ( !AddVertex( tess, v->coords, v->data ) ) return 0;
- }
- tess->cacheCount = 0;
- tess->emptyCache = FALSE;
-
- return 1;
-}
-
-
-void GLAPIENTRY
-gluTessVertex( GLUtesselator *tess, GLdouble coords[3], void *data )
-{
- int i, tooLarge = FALSE;
- GLdouble x, clamped[3];
-
- RequireState( tess, T_IN_CONTOUR );
-
- if( tess->emptyCache ) {
- if ( !EmptyCache( tess ) ) {
- CALL_ERROR_OR_ERROR_DATA( GLU_OUT_OF_MEMORY );
- return;
- }
- tess->lastEdge = NULL;
- }
- for( i = 0; i < 3; ++i ) {
- x = coords[i];
- if( x < - GLU_TESS_MAX_COORD ) {
- x = - GLU_TESS_MAX_COORD;
- tooLarge = TRUE;
- }
- if( x > GLU_TESS_MAX_COORD ) {
- x = GLU_TESS_MAX_COORD;
- tooLarge = TRUE;
- }
- clamped[i] = x;
- }
- if( tooLarge ) {
- CALL_ERROR_OR_ERROR_DATA( GLU_TESS_COORD_TOO_LARGE );
- }
-
- if( tess->mesh == NULL ) {
- if( tess->cacheCount < TESS_MAX_CACHE ) {
- CacheVertex( tess, clamped, data );
- return;
- }
- if ( !EmptyCache( tess ) ) {
- CALL_ERROR_OR_ERROR_DATA( GLU_OUT_OF_MEMORY );
- return;
- }
- }
- if ( !AddVertex( tess, clamped, data ) ) {
- CALL_ERROR_OR_ERROR_DATA( GLU_OUT_OF_MEMORY );
- }
-}
-
-
-void GLAPIENTRY
-gluTessBeginPolygon( GLUtesselator *tess, void *data )
-{
- RequireState( tess, T_DORMANT );
-
- tess->state = T_IN_POLYGON;
- tess->cacheCount = 0;
- tess->emptyCache = FALSE;
- tess->mesh = NULL;
-
- tess->polygonData= data;
-}
-
-
-void GLAPIENTRY
-gluTessBeginContour( GLUtesselator *tess )
-{
- RequireState( tess, T_IN_POLYGON );
-
- tess->state = T_IN_CONTOUR;
- tess->lastEdge = NULL;
- if( tess->cacheCount > 0 ) {
- /* Just set a flag so we don't get confused by empty contours
- * -- these can be generated accidentally with the obsolete
- * NextContour() interface.
- */
- tess->emptyCache = TRUE;
- }
-}
-
-
-void GLAPIENTRY
-gluTessEndContour( GLUtesselator *tess )
-{
- RequireState( tess, T_IN_CONTOUR );
- tess->state = T_IN_POLYGON;
-}
-
-void GLAPIENTRY
-gluTessEndPolygon( GLUtesselator *tess )
-{
- GLUmesh *mesh;
-
- if (setjmp(tess->env) != 0) {
- /* come back here if out of memory */
- CALL_ERROR_OR_ERROR_DATA( GLU_OUT_OF_MEMORY );
- return;
- }
-
- RequireState( tess, T_IN_POLYGON );
- tess->state = T_DORMANT;
-
- if( tess->mesh == NULL ) {
- if( ! tess->flagBoundary && tess->callMesh == &noMesh ) {
-
- /* Try some special code to make the easy cases go quickly
- * (eg. convex polygons). This code does NOT handle multiple contours,
- * intersections, edge flags, and of course it does not generate
- * an explicit mesh either.
- */
- if( __gl_renderCache( tess )) {
- tess->polygonData= NULL;
- return;
- }
- }
- if ( !EmptyCache( tess ) ) longjmp(tess->env,1); /* could've used a label*/
- }
-
- /* Determine the polygon normal and project vertices onto the plane
- * of the polygon.
- */
- __gl_projectPolygon( tess );
-
- /* __gl_computeInterior( tess ) computes the planar arrangement specified
- * by the given contours, and further subdivides this arrangement
- * into regions. Each region is marked "inside" if it belongs
- * to the polygon, according to the rule given by tess->windingRule.
- * Each interior region is guaranteed be monotone.
- */
- if ( !__gl_computeInterior( tess ) ) {
- longjmp(tess->env,1); /* could've used a label */
- }
-
- mesh = tess->mesh;
- if( ! tess->fatalError ) {
- int rc = 1;
-
- /* If the user wants only the boundary contours, we throw away all edges
- * except those which separate the interior from the exterior.
- * Otherwise we tessellate all the regions marked "inside".
- */
- if( tess->boundaryOnly ) {
- rc = __gl_meshSetWindingNumber( mesh, 1, TRUE );
- } else {
- rc = __gl_meshTessellateInterior( mesh );
- }
- if (rc == 0) longjmp(tess->env,1); /* could've used a label */
-
- __gl_meshCheckMesh( mesh );
-
- if( tess->callBegin != &noBegin || tess->callEnd != &noEnd
- || tess->callVertex != &noVertex || tess->callEdgeFlag != &noEdgeFlag
- || tess->callBeginData != &__gl_noBeginData
- || tess->callEndData != &__gl_noEndData
- || tess->callVertexData != &__gl_noVertexData
- || tess->callEdgeFlagData != &__gl_noEdgeFlagData )
- {
- if( tess->boundaryOnly ) {
- __gl_renderBoundary( tess, mesh ); /* output boundary contours */
- } else {
- __gl_renderMesh( tess, mesh ); /* output strips and fans */
- }
- }
- if( tess->callMesh != &noMesh ) {
-
- /* Throw away the exterior faces, so that all faces are interior.
- * This way the user doesn't have to check the "inside" flag,
- * and we don't need to even reveal its existence. It also leaves
- * the freedom for an implementation to not generate the exterior
- * faces in the first place.
- */
- __gl_meshDiscardExterior( mesh );
- (*tess->callMesh)( mesh ); /* user wants the mesh itself */
- tess->mesh = NULL;
- tess->polygonData= NULL;
- return;
- }
- }
- __gl_meshDeleteMesh( mesh );
- tess->polygonData= NULL;
- tess->mesh = NULL;
-}
-
-
-/*XXXblythe unused function*/
-#if 0
-void GLAPIENTRY
-gluDeleteMesh( GLUmesh *mesh )
-{
- __gl_meshDeleteMesh( mesh );
-}
-#endif
-
-
-
-/*******************************************************/
-
-/* Obsolete calls -- for backward compatibility */
-
-void GLAPIENTRY
-gluBeginPolygon( GLUtesselator *tess )
-{
- gluTessBeginPolygon( tess, NULL );
- gluTessBeginContour( tess );
-}
-
-
-/*ARGSUSED*/
-void GLAPIENTRY
-gluNextContour( GLUtesselator *tess, GLenum type )
-{
- gluTessEndContour( tess );
- gluTessBeginContour( tess );
-}
-
-
-void GLAPIENTRY
-gluEndPolygon( GLUtesselator *tess )
-{
- gluTessEndContour( tess );
- gluTessEndPolygon( tess );
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/tess.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/tess.h
deleted file mode 100755
index 1f966a65b..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/tess.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/Attic/tess.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef __tess_h_
-#define __tess_h_
-
-#include <GL/glu.h>
-#include <setjmp.h>
-#include "mesh.h"
-#include "dict.h"
-#include "priorityq.h"
-
-/* The begin/end calls must be properly nested. We keep track of
- * the current state to enforce the ordering.
- */
-enum TessState { T_DORMANT, T_IN_POLYGON, T_IN_CONTOUR };
-
-/* We cache vertex data for single-contour polygons so that we can
- * try a quick-and-dirty decomposition first.
- */
-#define TESS_MAX_CACHE 100
-
-typedef struct CachedVertex {
- GLdouble coords[3];
- void *data;
-} CachedVertex;
-
-struct GLUtesselator {
-
- /*** state needed for collecting the input data ***/
-
- enum TessState state; /* what begin/end calls have we seen? */
-
- GLUhalfEdge *lastEdge; /* lastEdge->Org is the most recent vertex */
- GLUmesh *mesh; /* stores the input contours, and eventually
- the tessellation itself */
-
- void (GLAPIENTRY *callError)( GLenum errnum );
-
- /*** state needed for projecting onto the sweep plane ***/
-
- GLdouble normal[3]; /* user-specified normal (if provided) */
- GLdouble sUnit[3]; /* unit vector in s-direction (debugging) */
- GLdouble tUnit[3]; /* unit vector in t-direction (debugging) */
-
- /*** state needed for the line sweep ***/
-
- GLdouble relTolerance; /* tolerance for merging features */
- GLenum windingRule; /* rule for determining polygon interior */
- GLboolean fatalError; /* fatal error: needed combine callback */
-
- Dict *dict; /* edge dictionary for sweep line */
- PriorityQ *pq; /* priority queue of vertex events */
- GLUvertex *event; /* current sweep event being processed */
-
- void (GLAPIENTRY *callCombine)( GLdouble coords[3], void *data[4],
- GLfloat weight[4], void **outData );
-
- /*** state needed for rendering callbacks (see render.c) ***/
-
- GLboolean flagBoundary; /* mark boundary edges (use EdgeFlag) */
- GLboolean boundaryOnly; /* Extract contours, not triangles */
- GLUface *lonelyTriList;
- /* list of triangles which could not be rendered as strips or fans */
-
- void (GLAPIENTRY *callBegin)( GLenum type );
- void (GLAPIENTRY *callEdgeFlag)( GLboolean boundaryEdge );
- void (GLAPIENTRY *callVertex)( void *data );
- void (GLAPIENTRY *callEnd)( void );
- void (GLAPIENTRY *callMesh)( GLUmesh *mesh );
-
-
- /*** state needed to cache single-contour polygons for renderCache() */
-
- GLboolean emptyCache; /* empty cache on next vertex() call */
- int cacheCount; /* number of cached vertices */
- CachedVertex cache[TESS_MAX_CACHE]; /* the vertex data */
-
- /*** rendering callbacks that also pass polygon data ***/
- void (GLAPIENTRY *callBeginData)( GLenum type, void *polygonData );
- void (GLAPIENTRY *callEdgeFlagData)( GLboolean boundaryEdge,
- void *polygonData );
- void (GLAPIENTRY *callVertexData)( void *data, void *polygonData );
- void (GLAPIENTRY *callEndData)( void *polygonData );
- void (GLAPIENTRY *callErrorData)( GLenum errnum, void *polygonData );
- void (GLAPIENTRY *callCombineData)( GLdouble coords[3], void *data[4],
- GLfloat weight[4], void **outData,
- void *polygonData );
-
- jmp_buf env; /* place to jump to when memAllocs fail */
-
- void *polygonData; /* client data for current polygon */
-};
-
-void GLAPIENTRY __gl_noBeginData( GLenum type, void *polygonData );
-void GLAPIENTRY __gl_noEdgeFlagData( GLboolean boundaryEdge, void *polygonData );
-void GLAPIENTRY __gl_noVertexData( void *data, void *polygonData );
-void GLAPIENTRY __gl_noEndData( void *polygonData );
-void GLAPIENTRY __gl_noErrorData( GLenum errnum, void *polygonData );
-void GLAPIENTRY __gl_noCombineData( GLdouble coords[3], void *data[4],
- GLfloat weight[4], void **outData,
- void *polygonData );
-
-#define CALL_BEGIN_OR_BEGIN_DATA(a) \
- if (tess->callBeginData != &__gl_noBeginData) \
- (*tess->callBeginData)((a),tess->polygonData); \
- else (*tess->callBegin)((a));
-
-#define CALL_VERTEX_OR_VERTEX_DATA(a) \
- if (tess->callVertexData != &__gl_noVertexData) \
- (*tess->callVertexData)((a),tess->polygonData); \
- else (*tess->callVertex)((a));
-
-#define CALL_EDGE_FLAG_OR_EDGE_FLAG_DATA(a) \
- if (tess->callEdgeFlagData != &__gl_noEdgeFlagData) \
- (*tess->callEdgeFlagData)((a),tess->polygonData); \
- else (*tess->callEdgeFlag)((a));
-
-#define CALL_END_OR_END_DATA() \
- if (tess->callEndData != &__gl_noEndData) \
- (*tess->callEndData)(tess->polygonData); \
- else (*tess->callEnd)();
-
-#define CALL_COMBINE_OR_COMBINE_DATA(a,b,c,d) \
- if (tess->callCombineData != &__gl_noCombineData) \
- (*tess->callCombineData)((a),(b),(c),(d),tess->polygonData); \
- else (*tess->callCombine)((a),(b),(c),(d));
-
-#define CALL_ERROR_OR_ERROR_DATA(a) \
- if (tess->callErrorData != &__gl_noErrorData) \
- (*tess->callErrorData)((a),tess->polygonData); \
- else (*tess->callError)((a));
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/tessmono.c b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/tessmono.c
deleted file mode 100755
index b29f6027d..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/tessmono.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-*/
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libtess/tessmono.c,v 1.2 2001/04/03 02:18:40 dawes Exp $ */
-
-#include "gluos.h"
-#include <stdlib.h>
-#include "geom.h"
-#include "mesh.h"
-#include "tessmono.h"
-#include <assert.h>
-
-#define AddWinding(eDst,eSrc) (eDst->winding += eSrc->winding, \
- eDst->Sym->winding += eSrc->Sym->winding)
-
-/* __gl_meshTessellateMonoRegion( face ) tessellates a monotone region
- * (what else would it do?) The region must consist of a single
- * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this
- * case means that any vertical line intersects the interior of the
- * region in a single interval.
- *
- * Tessellation consists of adding interior edges (actually pairs of
- * half-edges), to split the region into non-overlapping triangles.
- *
- * The basic idea is explained in Preparata and Shamos (which I don''t
- * have handy right now), although their implementation is more
- * complicated than this one. The are two edge chains, an upper chain
- * and a lower chain. We process all vertices from both chains in order,
- * from right to left.
- *
- * The algorithm ensures that the following invariant holds after each
- * vertex is processed: the untessellated region consists of two
- * chains, where one chain (say the upper) is a single edge, and
- * the other chain is concave. The left vertex of the single edge
- * is always to the left of all vertices in the concave chain.
- *
- * Each step consists of adding the rightmost unprocessed vertex to one
- * of the two chains, and forming a fan of triangles from the rightmost
- * of two chain endpoints. Determining whether we can add each triangle
- * to the fan is a simple orientation test. By making the fan as large
- * as possible, we restore the invariant (check it yourself).
- */
-int __gl_meshTessellateMonoRegion( GLUface *face )
-{
- GLUhalfEdge *up, *lo;
-
- /* All edges are oriented CCW around the boundary of the region.
- * First, find the half-edge whose origin vertex is rightmost.
- * Since the sweep goes from left to right, face->anEdge should
- * be close to the edge we want.
- */
- up = face->anEdge;
- assert( up->Lnext != up && up->Lnext->Lnext != up );
-
- for( ; VertLeq( up->Dst, up->Org ); up = up->Lprev )
- ;
- for( ; VertLeq( up->Org, up->Dst ); up = up->Lnext )
- ;
- lo = up->Lprev;
-
- while( up->Lnext != lo ) {
- if( VertLeq( up->Dst, lo->Org )) {
- /* up->Dst is on the left. It is safe to form triangles from lo->Org.
- * The EdgeGoesLeft test guarantees progress even when some triangles
- * are CW, given that the upper and lower chains are truly monotone.
- */
- while( lo->Lnext != up && (EdgeGoesLeft( lo->Lnext )
- || EdgeSign( lo->Org, lo->Dst, lo->Lnext->Dst ) <= 0 )) {
- GLUhalfEdge *tempHalfEdge= __gl_meshConnect( lo->Lnext, lo );
- if (tempHalfEdge == NULL) return 0;
- lo = tempHalfEdge->Sym;
- }
- lo = lo->Lprev;
- } else {
- /* lo->Org is on the left. We can make CCW triangles from up->Dst. */
- while( lo->Lnext != up && (EdgeGoesRight( up->Lprev )
- || EdgeSign( up->Dst, up->Org, up->Lprev->Org ) >= 0 )) {
- GLUhalfEdge *tempHalfEdge= __gl_meshConnect( up, up->Lprev );
- if (tempHalfEdge == NULL) return 0;
- up = tempHalfEdge->Sym;
- }
- up = up->Lnext;
- }
- }
-
- /* Now lo->Org == up->Dst == the leftmost vertex. The remaining region
- * can be tessellated in a fan from this leftmost vertex.
- */
- assert( lo->Lnext != up );
- while( lo->Lnext->Lnext != up ) {
- GLUhalfEdge *tempHalfEdge= __gl_meshConnect( lo->Lnext, lo );
- if (tempHalfEdge == NULL) return 0;
- lo = tempHalfEdge->Sym;
- }
-
- return 1;
-}
-
-
-/* __gl_meshTessellateInterior( mesh ) tessellates each region of
- * the mesh which is marked "inside" the polygon. Each such region
- * must be monotone.
- */
-int __gl_meshTessellateInterior( GLUmesh *mesh )
-{
- GLUface *f, *next;
-
- /*LINTED*/
- for( f = mesh->fHead.next; f != &mesh->fHead; f = next ) {
- /* Make sure we don''t try to tessellate the new triangles. */
- next = f->next;
- if( f->inside ) {
- if ( !__gl_meshTessellateMonoRegion( f ) ) return 0;
- }
- }
-
- return 1;
-}
-
-
-/* __gl_meshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces
- * which are not marked "inside" the polygon. Since further mesh operations
- * on NULL faces are not allowed, the main purpose is to clean up the
- * mesh so that exterior loops are not represented in the data structure.
- */
-void __gl_meshDiscardExterior( GLUmesh *mesh )
-{
- GLUface *f, *next;
-
- /*LINTED*/
- for( f = mesh->fHead.next; f != &mesh->fHead; f = next ) {
- /* Since f will be destroyed, save its next pointer. */
- next = f->next;
- if( ! f->inside ) {
- __gl_meshZapFace( f );
- }
- }
-}
-
-#define MARKED_FOR_DELETION 0x7fffffff
-
-/* __gl_meshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the
- * winding numbers on all edges so that regions marked "inside" the
- * polygon have a winding number of "value", and regions outside
- * have a winding number of 0.
- *
- * If keepOnlyBoundary is TRUE, it also deletes all edges which do not
- * separate an interior region from an exterior one.
- */
-int __gl_meshSetWindingNumber( GLUmesh *mesh, int value,
- GLboolean keepOnlyBoundary )
-{
- GLUhalfEdge *e, *eNext;
-
- for( e = mesh->eHead.next; e != &mesh->eHead; e = eNext ) {
- eNext = e->next;
- if( e->Rface->inside != e->Lface->inside ) {
-
- /* This is a boundary edge (one side is interior, one is exterior). */
- e->winding = (e->Lface->inside) ? value : -value;
- } else {
-
- /* Both regions are interior, or both are exterior. */
- if( ! keepOnlyBoundary ) {
- e->winding = 0;
- } else {
- if ( !__gl_meshDelete( e ) ) return 0;
- }
- }
- }
- return 1;
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/tessmono.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/tessmono.h
deleted file mode 100755
index 200d9c865..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libtess/tessmono.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/*
-** Author: Eric Veach, July 1994.
-**
-*/
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libtess/tessmono.h,v 1.2 2001/04/03 02:18:40 dawes Exp $ */
-
-#ifndef __tessmono_h_
-#define __tessmono_h_
-
-/* __gl_meshTessellateMonoRegion( face ) tessellates a monotone region
- * (what else would it do?) The region must consist of a single
- * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this
- * case means that any vertical line intersects the interior of the
- * region in a single interval.
- *
- * Tessellation consists of adding interior edges (actually pairs of
- * half-edges), to split the region into non-overlapping triangles.
- *
- * __gl_meshTessellateInterior( mesh ) tessellates each region of
- * the mesh which is marked "inside" the polygon. Each such region
- * must be monotone.
- *
- * __gl_meshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces
- * which are not marked "inside" the polygon. Since further mesh operations
- * on NULL faces are not allowed, the main purpose is to clean up the
- * mesh so that exterior loops are not represented in the data structure.
- *
- * __gl_meshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the
- * winding numbers on all edges so that regions marked "inside" the
- * polygon have a winding number of "value", and regions outside
- * have a winding number of 0.
- *
- * If keepOnlyBoundary is TRUE, it also deletes all edges which do not
- * separate an interior region from an exterior one.
- */
-
-int __gl_meshTessellateMonoRegion( GLUface *face );
-int __gl_meshTessellateInterior( GLUmesh *mesh );
-void __gl_meshDiscardExterior( GLUmesh *mesh );
-int __gl_meshSetWindingNumber( GLUmesh *mesh, int value,
- GLboolean keepOnlyBoundary );
-
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/GNUmakefile b/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/GNUmakefile
deleted file mode 100755
index 0bb443775..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/GNUmakefile
+++ /dev/null
@@ -1,68 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-# $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/Attic/GNUmakefile,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-
-OBJECT_STYLE = N32
-
-include $(ROOT)/usr/include/make/commondefs
-
-TARGET = libutil.a
-
-TARGETS = $(TARGET)
-
-LCINCS = -I../include
-
-HFILES = \
- gluint.h \
- $(NULL)
-
-CFILES = \
- error.c \
- glue.c \
- mipmap.c \
- project.c \
- quad.c \
- registry.c \
- $(NULL)
-
-default libs libs_install install: $(TARGET)
-
-headers headers_install apps:
-
-$(TARGET): $(OBJECTS)
- $(AR) crl $@ $(OBJECTS);
-
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/Imakefile b/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/Imakefile
deleted file mode 100755
index 5ffeec402..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/Imakefile
+++ /dev/null
@@ -1,57 +0,0 @@
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-#include <Library.tmpl>
-
-OBJS = \
- error.o \
- glue.o \
- mipmap.o \
- project.o \
- quad.o \
- registry.o
-
-INCLUDES = \
- -I../include \
- -I$(TOP)/include \
- -I$(TOP)/include/GL
-
-DEFINES = \
- -DNDEBUG
-
-NormalLibraryObjectRule()
-
-NormalLibraryTarget(util, $(OBJS))
-
-DependTarget()
-CleanTarget()
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/error.c b/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/error.c
deleted file mode 100755
index 2d1f36ea0..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/error.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/Attic/error.c,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include "gluos.h"
-#include "gluint.h"
-#include <GL/glu.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-static const char *glErrorStrings[GL_OUT_OF_MEMORY - GL_INVALID_ENUM + 1] = {
- "invalid enumerant",
- "invalid value",
- "invalid operation",
- "stack overflow",
- "stack underflow",
- "out of memory",
-};
-
-static const char *gluErrorStrings[GLU_INVALID_OPERATION - GLU_INVALID_ENUM + 1] = {
- "invalid enumerant",
- "invalid value",
- "out of memory",
- "", /* never used but need placeholder */
- "invalid operation",
-};
-
-#define NERRORS (sizeof(errorStrings)/sizeof(errorStrings[0]))
-
-const GLubyte* GLAPIENTRY
-gluErrorString(GLenum errorCode)
-{
- if (errorCode == 0) {
- return (const unsigned char *) "no error";
- }
- if ((errorCode >= GL_INVALID_ENUM) && (errorCode <= GL_OUT_OF_MEMORY)) {
- return (const unsigned char *) glErrorStrings[errorCode - GL_INVALID_ENUM];
- }
- if (errorCode == GL_TABLE_TOO_LARGE) {
- return (const unsigned char *) "table too large";
- }
- if ((errorCode >= GLU_INVALID_ENUM) && (errorCode <= GLU_INVALID_OPERATION)) {
- return (const unsigned char *) gluErrorStrings[errorCode - GLU_INVALID_ENUM];
- }
- if ((errorCode >= GLU_NURBS_ERROR1) && (errorCode <= GLU_NURBS_ERROR37)) {
- return (const unsigned char *) __gluNURBSErrorString(errorCode - (GLU_NURBS_ERROR1 - 1));
- }
- if ((errorCode >= GLU_TESS_ERROR1) && (errorCode <= GLU_TESS_ERROR8)) {
- return (const unsigned char *) __gluTessErrorString(errorCode - (GLU_TESS_ERROR1 - 1));
- }
-
- return 0;
-}
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/glue.c b/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/glue.c
deleted file mode 100755
index 59e09914e..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/glue.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/Attic/glue.c,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include <stdlib.h>
-#include "gluint.h"
-
-static char *__gluNurbsErrors[] = {
- " ",
- "spline order un-supported",
- "too few knots",
- "valid knot range is empty",
- "decreasing knot sequence knot",
- "knot multiplicity greater than order of spline",
- "gluEndCurve() must follow gluBeginCurve()",
- "gluBeginCurve() must precede gluEndCurve()",
- "missing or extra geometric data",
- "can't draw piecewise linear trimming curves",
- "missing or extra domain data",
- "missing or extra domain data",
- "gluEndTrim() must precede gluEndSurface()",
- "gluBeginSurface() must precede gluEndSurface()",
- "curve of improper type passed as trim curve",
- "gluBeginSurface() must precede gluBeginTrim()",
- "gluEndTrim() must follow gluBeginTrim()",
- "gluBeginTrim() must precede gluEndTrim()",
- "invalid or missing trim curve",
- "gluBeginTrim() must precede gluPwlCurve()",
- "piecewise linear trimming curve referenced twice",
- "piecewise linear trimming curve and nurbs curve mixed",
- "improper usage of trim data type",
- "nurbs curve referenced twice",
- "nurbs curve and piecewise linear trimming curve mixed",
- "nurbs surface referenced twice",
- "invalid property",
- "gluEndSurface() must follow gluBeginSurface()",
- "intersecting or misoriented trim curves",
- "intersecting trim curves",
- "UNUSED",
- "unconnected trim curves",
- "unknown knot error",
- "negative vertex count encountered",
- "negative byte-stride encounteed",
- "unknown type descriptor",
- "null control point reference",
- "duplicate point on piecewise linear trimming curve",
-};
-
-const char *__gluNURBSErrorString( int errno )
-{
- return __gluNurbsErrors[errno];
-}
-
-static char *__gluTessErrors[] = {
- " ",
- "gluTessBeginPolygon() must precede a gluTessEndPolygon()",
- "gluTessBeginContour() must precede a gluTessEndContour()",
- "gluTessEndPolygon() must follow a gluTessBeginPolygon()",
- "gluTessEndContour() must follow a gluTessBeginContour()",
- "a coordinate is too large",
- "need combine callback",
-};
-
-const char *__gluTessErrorString( int errno )
-{
- return __gluTessErrors[errno];
-} /* __glTessErrorString() */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/gluint.h b/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/gluint.h
deleted file mode 100755
index 8cb85bc2b..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/gluint.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/Attic/gluint.h,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#ifndef __gluint_h__
-#define __gluint_h__
-
-extern const char *__gluNURBSErrorString( int errno );
-
-extern const char *__gluTessErrorString( int errno );
-
-#ifdef _EXTENSIONS_
-#define COS cosf
-#define SIN sinf
-#define SQRT sqrtf
-#else
-#define COS cos
-#define SIN sin
-#define SQRT sqrt
-#endif
-
-#endif /* __gluint_h__ */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/mipmap.c b/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/mipmap.c
deleted file mode 100755
index f82ebb1bb..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/mipmap.c
+++ /dev/null
@@ -1,8831 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libutil/mipmap.c,v 1.5 2002/02/22 21:32:49 dawes Exp $ */
-
-#include "gluos.h"
-#include <assert.h>
-#include <GL/glu.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h> /* UINT_MAX */
-#include <math.h>
-#include "gluint.h"
-
-typedef union {
- unsigned char ub[4];
- unsigned short us[2];
- unsigned int ui;
- char b[4];
- short s[2];
- int i;
- float f;
-} Type_Widget;
-
-/* Pixel storage modes */
-typedef struct {
- GLint pack_alignment;
- GLint pack_row_length;
- GLint pack_skip_rows;
- GLint pack_skip_pixels;
- GLint pack_lsb_first;
- GLint pack_swap_bytes;
- GLint pack_skip_images;
- GLint pack_image_height;
-
- GLint unpack_alignment;
- GLint unpack_row_length;
- GLint unpack_skip_rows;
- GLint unpack_skip_pixels;
- GLint unpack_lsb_first;
- GLint unpack_swap_bytes;
- GLint unpack_skip_images;
- GLint unpack_image_height;
-} PixelStorageModes;
-
-static int gluBuild1DMipmapLevelsCore(GLenum, GLint,
- GLsizei,
- GLsizei,
- GLenum, GLenum, GLint, GLint, GLint,
- const void *);
-static int gluBuild2DMipmapLevelsCore(GLenum, GLint,
- GLsizei, GLsizei,
- GLsizei, GLsizei,
- GLenum, GLenum, GLint, GLint, GLint,
- const void *);
-static int gluBuild3DMipmapLevelsCore(GLenum, GLint,
- GLsizei, GLsizei, GLsizei,
- GLsizei, GLsizei, GLsizei,
- GLenum, GLenum, GLint, GLint, GLint,
- const void *);
-
-/*
- * internal function declarations
- */
-static GLfloat bytes_per_element(GLenum type);
-static GLint elements_per_group(GLenum format, GLenum type);
-static GLint is_index(GLenum format);
-static GLint image_size(GLint width, GLint height, GLenum format, GLenum type);
-static void fill_image(const PixelStorageModes *,
- GLint width, GLint height, GLenum format,
- GLenum type, GLboolean index_format,
- const void *userdata, GLushort *newimage);
-static void empty_image(const PixelStorageModes *,
- GLint width, GLint height, GLenum format,
- GLenum type, GLboolean index_format,
- const GLushort *oldimage, void *userdata);
-static void scale_internal(GLint components, GLint widthin, GLint heightin,
- const GLushort *datain,
- GLint widthout, GLint heightout,
- GLushort *dataout);
-
-static void scale_internal_ubyte(GLint components, GLint widthin,
- GLint heightin, const GLubyte *datain,
- GLint widthout, GLint heightout,
- GLubyte *dataout, GLint element_size,
- GLint ysize, GLint group_size);
-static void scale_internal_byte(GLint components, GLint widthin,
- GLint heightin, const GLbyte *datain,
- GLint widthout, GLint heightout,
- GLbyte *dataout, GLint element_size,
- GLint ysize, GLint group_size);
-static void scale_internal_ushort(GLint components, GLint widthin,
- GLint heightin, const GLushort *datain,
- GLint widthout, GLint heightout,
- GLushort *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes);
-static void scale_internal_short(GLint components, GLint widthin,
- GLint heightin, const GLshort *datain,
- GLint widthout, GLint heightout,
- GLshort *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes);
-static void scale_internal_uint(GLint components, GLint widthin,
- GLint heightin, const GLuint *datain,
- GLint widthout, GLint heightout,
- GLuint *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes);
-static void scale_internal_int(GLint components, GLint widthin,
- GLint heightin, const GLint *datain,
- GLint widthout, GLint heightout,
- GLint *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes);
-static void scale_internal_float(GLint components, GLint widthin,
- GLint heightin, const GLfloat *datain,
- GLint widthout, GLint heightout,
- GLfloat *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes);
-
-static int checkMipmapArgs(GLenum, GLenum, GLenum);
-static GLboolean legalFormat(GLenum);
-static GLboolean legalType(GLenum);
-static GLboolean isTypePackedPixel(GLenum);
-static GLboolean isLegalFormatForPackedPixelType(GLenum, GLenum);
-static GLboolean isLegalLevels(GLint, GLint, GLint, GLint);
-static void closestFit(GLenum, GLint, GLint, GLint, GLenum, GLenum,
- GLint *, GLint *);
-
-/* all extract/shove routines must return double to handle unsigned ints */
-static GLdouble extractUbyte(int, const void *);
-static void shoveUbyte(GLdouble, int, void *);
-static GLdouble extractSbyte(int, const void *);
-static void shoveSbyte(GLdouble, int, void *);
-static GLdouble extractUshort(int, const void *);
-static void shoveUshort(GLdouble, int, void *);
-static GLdouble extractSshort(int, const void *);
-static void shoveSshort(GLdouble, int, void *);
-static GLdouble extractUint(int, const void *);
-static void shoveUint(GLdouble, int, void *);
-static GLdouble extractSint(int, const void *);
-static void shoveSint(GLdouble, int, void *);
-static GLdouble extractFloat(int, const void *);
-static void shoveFloat(GLdouble, int, void *);
-static void halveImageSlice(int, GLdouble (*)(int, const void *),
- void (*)(GLdouble, int, void *),
- GLint, GLint, GLint,
- const void *, void *,
- GLint, GLint, GLint, GLint, GLint);
-static void halveImage3D(int, GLdouble (*)(int, const void *),
- void (*)(GLdouble, int, void *),
- GLint, GLint, GLint,
- const void *, void *,
- GLint, GLint, GLint, GLint, GLint);
-
-/* packedpixel type scale routines */
-static void extract332(int,const void *, GLfloat []);
-static void shove332(const GLfloat [],int ,void *);
-static void extract233rev(int,const void *, GLfloat []);
-static void shove233rev(const GLfloat [],int ,void *);
-static void extract565(int,const void *, GLfloat []);
-static void shove565(const GLfloat [],int ,void *);
-static void extract565rev(int,const void *, GLfloat []);
-static void shove565rev(const GLfloat [],int ,void *);
-static void extract4444(int,const void *, GLfloat []);
-static void shove4444(const GLfloat [],int ,void *);
-static void extract4444rev(int,const void *, GLfloat []);
-static void shove4444rev(const GLfloat [],int ,void *);
-static void extract5551(int,const void *, GLfloat []);
-static void shove5551(const GLfloat [],int ,void *);
-static void extract1555rev(int,const void *, GLfloat []);
-static void shove1555rev(const GLfloat [],int ,void *);
-static void extract8888(int,const void *, GLfloat []);
-static void shove8888(const GLfloat [],int ,void *);
-static void extract8888rev(int,const void *, GLfloat []);
-static void shove8888rev(const GLfloat [],int ,void *);
-static void extract1010102(int,const void *, GLfloat []);
-static void shove1010102(const GLfloat [],int ,void *);
-static void extract2101010rev(int,const void *, GLfloat []);
-static void shove2101010rev(const GLfloat [],int ,void *);
-static void scaleInternalPackedPixel(int,
- void (*)(int, const void *,GLfloat []),
- void (*)(const GLfloat [],int, void *),
- GLint,GLint, const void *,
- GLint,GLint,void *,GLint,GLint,GLint);
-static void halveImagePackedPixel(int,
- void (*)(int, const void *,GLfloat []),
- void (*)(const GLfloat [],int, void *),
- GLint, GLint, const void *,
- void *, GLint, GLint, GLint);
-static void halve1DimagePackedPixel(int,
- void (*)(int, const void *,GLfloat []),
- void (*)(const GLfloat [],int, void *),
- GLint, GLint, const void *,
- void *, GLint, GLint, GLint);
-
-static void halve1Dimage_ubyte(GLint, GLuint, GLuint,const GLubyte *,
- GLubyte *, GLint, GLint, GLint);
-static void halve1Dimage_byte(GLint, GLuint, GLuint,const GLbyte *, GLbyte *,
- GLint, GLint, GLint);
-static void halve1Dimage_ushort(GLint, GLuint, GLuint, const GLushort *,
- GLushort *, GLint, GLint, GLint, GLint);
-static void halve1Dimage_short(GLint, GLuint, GLuint,const GLshort *, GLshort *,
- GLint, GLint, GLint, GLint);
-static void halve1Dimage_uint(GLint, GLuint, GLuint, const GLuint *, GLuint *,
- GLint, GLint, GLint, GLint);
-static void halve1Dimage_int(GLint, GLuint, GLuint, const GLint *, GLint *,
- GLint, GLint, GLint, GLint);
-static void halve1Dimage_float(GLint, GLuint, GLuint, const GLfloat *, GLfloat *,
- GLint, GLint, GLint, GLint);
-
-static GLint imageSize3D(GLint, GLint, GLint, GLenum,GLenum);
-static void fillImage3D(const PixelStorageModes *, GLint, GLint, GLint,GLenum,
- GLenum, GLboolean, const void *, GLushort *);
-static void emptyImage3D(const PixelStorageModes *,
- GLint, GLint, GLint, GLenum,
- GLenum, GLboolean,
- const GLushort *, void *);
-static void scaleInternal3D(GLint, GLint, GLint, GLint, const GLushort *,
- GLint, GLint, GLint, GLushort *);
-
-static void retrieveStoreModes(PixelStorageModes *psm)
-{
- glGetIntegerv(GL_UNPACK_ALIGNMENT, &psm->unpack_alignment);
- glGetIntegerv(GL_UNPACK_ROW_LENGTH, &psm->unpack_row_length);
- glGetIntegerv(GL_UNPACK_SKIP_ROWS, &psm->unpack_skip_rows);
- glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &psm->unpack_skip_pixels);
- glGetIntegerv(GL_UNPACK_LSB_FIRST, &psm->unpack_lsb_first);
- glGetIntegerv(GL_UNPACK_SWAP_BYTES, &psm->unpack_swap_bytes);
-
- glGetIntegerv(GL_PACK_ALIGNMENT, &psm->pack_alignment);
- glGetIntegerv(GL_PACK_ROW_LENGTH, &psm->pack_row_length);
- glGetIntegerv(GL_PACK_SKIP_ROWS, &psm->pack_skip_rows);
- glGetIntegerv(GL_PACK_SKIP_PIXELS, &psm->pack_skip_pixels);
- glGetIntegerv(GL_PACK_LSB_FIRST, &psm->pack_lsb_first);
- glGetIntegerv(GL_PACK_SWAP_BYTES, &psm->pack_swap_bytes);
-}
-
-static void retrieveStoreModes3D(PixelStorageModes *psm)
-{
- glGetIntegerv(GL_UNPACK_ALIGNMENT, &psm->unpack_alignment);
- glGetIntegerv(GL_UNPACK_ROW_LENGTH, &psm->unpack_row_length);
- glGetIntegerv(GL_UNPACK_SKIP_ROWS, &psm->unpack_skip_rows);
- glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &psm->unpack_skip_pixels);
- glGetIntegerv(GL_UNPACK_LSB_FIRST, &psm->unpack_lsb_first);
- glGetIntegerv(GL_UNPACK_SWAP_BYTES, &psm->unpack_swap_bytes);
- glGetIntegerv(GL_UNPACK_SKIP_IMAGES, &psm->unpack_skip_images);
- glGetIntegerv(GL_UNPACK_IMAGE_HEIGHT, &psm->unpack_image_height);
-
- glGetIntegerv(GL_PACK_ALIGNMENT, &psm->pack_alignment);
- glGetIntegerv(GL_PACK_ROW_LENGTH, &psm->pack_row_length);
- glGetIntegerv(GL_PACK_SKIP_ROWS, &psm->pack_skip_rows);
- glGetIntegerv(GL_PACK_SKIP_PIXELS, &psm->pack_skip_pixels);
- glGetIntegerv(GL_PACK_LSB_FIRST, &psm->pack_lsb_first);
- glGetIntegerv(GL_PACK_SWAP_BYTES, &psm->pack_swap_bytes);
- glGetIntegerv(GL_PACK_SKIP_IMAGES, &psm->pack_skip_images);
- glGetIntegerv(GL_PACK_IMAGE_HEIGHT, &psm->pack_image_height);
-}
-
-static int computeLog(GLuint value)
-{
- int i;
-
- i = 0;
-
- /* Error! */
- if (value == 0) return -1;
-
- for (;;) {
- if (value & 1) {
- /* Error ! */
- if (value != 1) return -1;
- return i;
- }
- value = value >> 1;
- i++;
- }
-}
-
-/*
-** Compute the nearest power of 2 number. This algorithm is a little
-** strange, but it works quite well.
-*/
-static int nearestPower(GLuint value)
-{
- int i;
-
- i = 1;
-
- /* Error! */
- if (value == 0) return -1;
-
- for (;;) {
- if (value == 1) {
- return i;
- } else if (value == 3) {
- return i*4;
- }
- value = value >> 1;
- i *= 2;
- }
-}
-
-#define __GLU_SWAP_2_BYTES(s)\
-(GLushort)(((GLushort)((const GLubyte*)(s))[1])<<8 | ((const GLubyte*)(s))[0])
-
-#define __GLU_SWAP_4_BYTES(s)\
-(GLuint)(((GLuint)((const GLubyte*)(s))[3])<<24 | \
- ((GLuint)((const GLubyte*)(s))[2])<<16 | \
- ((GLuint)((const GLubyte*)(s))[1])<<8 | ((const GLubyte*)(s))[0])
-
-static void halveImage(GLint components, GLuint width, GLuint height,
- const GLushort *datain, GLushort *dataout)
-{
- int i, j, k;
- int newwidth, newheight;
- int delta;
- GLushort *s;
- const GLushort *t;
-
- newwidth = width / 2;
- newheight = height / 2;
- delta = width * components;
- s = dataout;
- t = datain;
-
- /* Piece o' cake! */
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- s[0] = (t[0] + t[components] + t[delta] +
- t[delta+components] + 2) / 4;
- s++; t++;
- }
- t += components;
- }
- t += delta;
- }
-}
-
-static void halveImage_ubyte(GLint components, GLuint width, GLuint height,
- const GLubyte *datain, GLubyte *dataout,
- GLint element_size, GLint ysize, GLint group_size)
-{
- int i, j, k;
- int newwidth, newheight;
- GLubyte *s;
- const char *t;
-
- /* handle case where there is only 1 column/row */
- if (width == 1 || height == 1) {
- assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
- halve1Dimage_ubyte(components,width,height,datain,dataout,
- element_size,ysize,group_size);
- return;
- }
-
- newwidth = width / 2;
- newheight = height / 2;
- s = dataout;
- t = (const char *)datain;
-
- /* Piece o' cake! */
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- s[0] = (*(const GLubyte*)t +
- *(const GLubyte*)(t+group_size) +
- *(const GLubyte*)(t+ysize) +
- *(const GLubyte*)(t+ysize+group_size) + 2) / 4;
- s++; t += element_size;
- }
- t += group_size;
- }
- t += ysize;
- }
-}
-
-/* */
-static void halve1Dimage_ubyte(GLint components, GLuint width, GLuint height,
- const GLubyte *dataIn, GLubyte *dataOut,
- GLint element_size, GLint ysize,
- GLint group_size)
-{
- GLint halfWidth= width / 2;
- GLint halfHeight= height / 2;
- const char *src= (const char *) dataIn;
- GLubyte *dest= dataOut;
- int jj;
-
- assert(width == 1 || height == 1); /* must be 1D */
- assert(width != height); /* can't be square */
-
- if (height == 1) { /* 1 row */
- assert(width != 1); /* widthxheight can't be 1x1 */
- halfHeight= 1;
-
- for (jj= 0; jj< halfWidth; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
- *dest= (*(const GLubyte*)src +
- *(const GLubyte*)(src+group_size)) / 2;
-
- src+= element_size;
- dest++;
- }
- src+= group_size; /* skip to next 2 */
- }
- {
- int padBytes= ysize - (width*group_size);
- src+= padBytes; /* for assertion only */
- }
- }
- else if (width == 1) { /* 1 column */
- int padBytes= ysize - (width * group_size);
- assert(height != 1); /* widthxheight can't be 1x1 */
- halfWidth= 1;
- /* one vertical column with possible pad bytes per row */
- /* average two at a time */
-
- for (jj= 0; jj< halfHeight; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
- *dest= (*(const GLubyte*)src + *(const GLubyte*)(src+ysize)) / 2;
-
- src+= element_size;
- dest++;
- }
- src+= padBytes; /* add pad bytes, if any, to get to end to row */
- src+= ysize;
- }
- }
-
- assert(src == &((const char *)dataIn)[ysize*height]);
- assert((char *)dest == &((char *)dataOut)
- [components * element_size * halfWidth * halfHeight]);
-} /* halve1Dimage_ubyte() */
-
-static void halveImage_byte(GLint components, GLuint width, GLuint height,
- const GLbyte *datain, GLbyte *dataout,
- GLint element_size,
- GLint ysize, GLint group_size)
-{
- int i, j, k;
- int newwidth, newheight;
- GLbyte *s;
- const char *t;
-
- /* handle case where there is only 1 column/row */
- if (width == 1 || height == 1) {
- assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
- halve1Dimage_byte(components,width,height,datain,dataout,
- element_size,ysize,group_size);
- return;
- }
-
- newwidth = width / 2;
- newheight = height / 2;
- s = dataout;
- t = (const char *)datain;
-
- /* Piece o' cake! */
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- s[0] = (*(const GLbyte*)t +
- *(const GLbyte*)(t+group_size) +
- *(const GLbyte*)(t+ysize) +
- *(const GLbyte*)(t+ysize+group_size) + 2) / 4;
- s++; t += element_size;
- }
- t += group_size;
- }
- t += ysize;
- }
-}
-
-static void halve1Dimage_byte(GLint components, GLuint width, GLuint height,
- const GLbyte *dataIn, GLbyte *dataOut,
- GLint element_size,GLint ysize, GLint group_size)
-{
- GLint halfWidth= width / 2;
- GLint halfHeight= height / 2;
- const char *src= (const char *) dataIn;
- GLbyte *dest= dataOut;
- int jj;
-
- assert(width == 1 || height == 1); /* must be 1D */
- assert(width != height); /* can't be square */
-
- if (height == 1) { /* 1 row */
- assert(width != 1); /* widthxheight can't be 1x1 */
- halfHeight= 1;
-
- for (jj= 0; jj< halfWidth; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
- *dest= (*(const GLbyte*)src + *(const GLbyte*)(src+group_size)) / 2;
-
- src+= element_size;
- dest++;
- }
- src+= group_size; /* skip to next 2 */
- }
- {
- int padBytes= ysize - (width*group_size);
- src+= padBytes; /* for assertion only */
- }
- }
- else if (width == 1) { /* 1 column */
- int padBytes= ysize - (width * group_size);
- assert(height != 1); /* widthxheight can't be 1x1 */
- halfWidth= 1;
- /* one vertical column with possible pad bytes per row */
- /* average two at a time */
-
- for (jj= 0; jj< halfHeight; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
- *dest= (*(const GLbyte*)src + *(const GLbyte*)(src+ysize)) / 2;
-
- src+= element_size;
- dest++;
- }
- src+= padBytes; /* add pad bytes, if any, to get to end to row */
- src+= ysize;
- }
-
- assert(src == &((const char *)dataIn)[ysize*height]);
- }
-
- assert((char *)dest == &((char *)dataOut)
- [components * element_size * halfWidth * halfHeight]);
-} /* halve1Dimage_byte() */
-
-static void halveImage_ushort(GLint components, GLuint width, GLuint height,
- const GLushort *datain, GLushort *dataout,
- GLint element_size, GLint ysize, GLint group_size,
- GLint myswap_bytes)
-{
- int i, j, k;
- int newwidth, newheight;
- GLushort *s;
- const char *t;
-
- /* handle case where there is only 1 column/row */
- if (width == 1 || height == 1) {
- assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
- halve1Dimage_ushort(components,width,height,datain,dataout,
- element_size,ysize,group_size, myswap_bytes);
- return;
- }
-
- newwidth = width / 2;
- newheight = height / 2;
- s = dataout;
- t = (const char *)datain;
-
- /* Piece o' cake! */
- if (!myswap_bytes)
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- s[0] = (*(const GLushort*)t +
- *(const GLushort*)(t+group_size) +
- *(const GLushort*)(t+ysize) +
- *(const GLushort*)(t+ysize+group_size) + 2) / 4;
- s++; t += element_size;
- }
- t += group_size;
- }
- t += ysize;
- }
- else
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- s[0] = (__GLU_SWAP_2_BYTES(t) +
- __GLU_SWAP_2_BYTES(t+group_size) +
- __GLU_SWAP_2_BYTES(t+ysize) +
- __GLU_SWAP_2_BYTES(t+ysize+group_size)+ 2)/4;
- s++; t += element_size;
- }
- t += group_size;
- }
- t += ysize;
- }
-}
-
-static void halve1Dimage_ushort(GLint components, GLuint width, GLuint height,
- const GLushort *dataIn, GLushort *dataOut,
- GLint element_size, GLint ysize,
- GLint group_size, GLint myswap_bytes)
-{
- GLint halfWidth= width / 2;
- GLint halfHeight= height / 2;
- const char *src= (const char *) dataIn;
- GLushort *dest= dataOut;
- int jj;
-
- assert(width == 1 || height == 1); /* must be 1D */
- assert(width != height); /* can't be square */
-
- if (height == 1) { /* 1 row */
- assert(width != 1); /* widthxheight can't be 1x1 */
- halfHeight= 1;
-
- for (jj= 0; jj< halfWidth; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLushort ushort[BOX2];
- if (myswap_bytes) {
- ushort[0]= __GLU_SWAP_2_BYTES(src);
- ushort[1]= __GLU_SWAP_2_BYTES(src+group_size);
- }
- else {
- ushort[0]= *(const GLushort*)src;
- ushort[1]= *(const GLushort*)(src+group_size);
- }
-
- *dest= (ushort[0] + ushort[1]) / 2;
- src+= element_size;
- dest++;
- }
- src+= group_size; /* skip to next 2 */
- }
- {
- int padBytes= ysize - (width*group_size);
- src+= padBytes; /* for assertion only */
- }
- }
- else if (width == 1) { /* 1 column */
- int padBytes= ysize - (width * group_size);
- assert(height != 1); /* widthxheight can't be 1x1 */
- halfWidth= 1;
- /* one vertical column with possible pad bytes per row */
- /* average two at a time */
-
- for (jj= 0; jj< halfHeight; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLushort ushort[BOX2];
- if (myswap_bytes) {
- ushort[0]= __GLU_SWAP_2_BYTES(src);
- ushort[1]= __GLU_SWAP_2_BYTES(src+ysize);
- }
- else {
- ushort[0]= *(const GLushort*)src;
- ushort[1]= *(const GLushort*)(src+ysize);
- }
- *dest= (ushort[0] + ushort[1]) / 2;
-
- src+= element_size;
- dest++;
- }
- src+= padBytes; /* add pad bytes, if any, to get to end to row */
- src+= ysize;
- }
-
- assert(src == &((const char *)dataIn)[ysize*height]);
- }
-
- assert((char *)dest == &((char *)dataOut)
- [components * element_size * halfWidth * halfHeight]);
-
-} /* halve1Dimage_ushort() */
-
-
-static void halveImage_short(GLint components, GLuint width, GLuint height,
- const GLshort *datain, GLshort *dataout,
- GLint element_size, GLint ysize, GLint group_size,
- GLint myswap_bytes)
-{
- int i, j, k;
- int newwidth, newheight;
- GLshort *s;
- const char *t;
-
- /* handle case where there is only 1 column/row */
- if (width == 1 || height == 1) {
- assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
- halve1Dimage_short(components,width,height,datain,dataout,
- element_size,ysize,group_size, myswap_bytes);
- return;
- }
-
- newwidth = width / 2;
- newheight = height / 2;
- s = dataout;
- t = (const char *)datain;
-
- /* Piece o' cake! */
- if (!myswap_bytes)
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- s[0] = (*(const GLshort*)t +
- *(const GLshort*)(t+group_size) +
- *(const GLshort*)(t+ysize) +
- *(const GLshort*)(t+ysize+group_size) + 2) / 4;
- s++; t += element_size;
- }
- t += group_size;
- }
- t += ysize;
- }
- else
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- GLushort b;
- GLint buf;
- b = __GLU_SWAP_2_BYTES(t);
- buf = *(const GLshort*)&b;
- b = __GLU_SWAP_2_BYTES(t+group_size);
- buf += *(const GLshort*)&b;
- b = __GLU_SWAP_2_BYTES(t+ysize);
- buf += *(const GLshort*)&b;
- b = __GLU_SWAP_2_BYTES(t+ysize+group_size);
- buf += *(const GLshort*)&b;
- s[0] = (GLshort)((buf+2)/4);
- s++; t += element_size;
- }
- t += group_size;
- }
- t += ysize;
- }
-}
-
-static void halve1Dimage_short(GLint components, GLuint width, GLuint height,
- const GLshort *dataIn, GLshort *dataOut,
- GLint element_size, GLint ysize,
- GLint group_size, GLint myswap_bytes)
-{
- GLint halfWidth= width / 2;
- GLint halfHeight= height / 2;
- const char *src= (const char *) dataIn;
- GLshort *dest= dataOut;
- int jj;
-
- assert(width == 1 || height == 1); /* must be 1D */
- assert(width != height); /* can't be square */
-
- if (height == 1) { /* 1 row */
- assert(width != 1); /* widthxheight can't be 1x1 */
- halfHeight= 1;
-
- for (jj= 0; jj< halfWidth; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLshort sshort[BOX2];
- if (myswap_bytes) {
- sshort[0]= __GLU_SWAP_2_BYTES(src);
- sshort[1]= __GLU_SWAP_2_BYTES(src+group_size);
- }
- else {
- sshort[0]= *(const GLshort*)src;
- sshort[1]= *(const GLshort*)(src+group_size);
- }
-
- *dest= (sshort[0] + sshort[1]) / 2;
- src+= element_size;
- dest++;
- }
- src+= group_size; /* skip to next 2 */
- }
- {
- int padBytes= ysize - (width*group_size);
- src+= padBytes; /* for assertion only */
- }
- }
- else if (width == 1) { /* 1 column */
- int padBytes= ysize - (width * group_size);
- assert(height != 1); /* widthxheight can't be 1x1 */
- halfWidth= 1;
- /* one vertical column with possible pad bytes per row */
- /* average two at a time */
-
- for (jj= 0; jj< halfHeight; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLshort sshort[BOX2];
- if (myswap_bytes) {
- sshort[0]= __GLU_SWAP_2_BYTES(src);
- sshort[1]= __GLU_SWAP_2_BYTES(src+ysize);
- }
- else {
- sshort[0]= *(const GLshort*)src;
- sshort[1]= *(const GLshort*)(src+ysize);
- }
- *dest= (sshort[0] + sshort[1]) / 2;
-
- src+= element_size;
- dest++;
- }
- src+= padBytes; /* add pad bytes, if any, to get to end to row */
- src+= ysize;
- }
-
- assert(src == &((const char *)dataIn)[ysize*height]);
- }
-
- assert((char *)dest == &((char *)dataOut)
- [components * element_size * halfWidth * halfHeight]);
-
-} /* halve1Dimage_short() */
-
-
-static void halveImage_uint(GLint components, GLuint width, GLuint height,
- const GLuint *datain, GLuint *dataout,
- GLint element_size, GLint ysize, GLint group_size,
- GLint myswap_bytes)
-{
- int i, j, k;
- int newwidth, newheight;
- GLuint *s;
- const char *t;
-
- /* handle case where there is only 1 column/row */
- if (width == 1 || height == 1) {
- assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
- halve1Dimage_uint(components,width,height,datain,dataout,
- element_size,ysize,group_size, myswap_bytes);
- return;
- }
-
- newwidth = width / 2;
- newheight = height / 2;
- s = dataout;
- t = (const char *)datain;
-
- /* Piece o' cake! */
- if (!myswap_bytes)
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- /* need to cast to double to hold large unsigned ints */
- s[0] = ((double)*(const GLuint*)t +
- (double)*(const GLuint*)(t+group_size) +
- (double)*(const GLuint*)(t+ysize) +
- (double)*(const GLuint*)(t+ysize+group_size))/4 + 0.5;
- s++; t += element_size;
-
- }
- t += group_size;
- }
- t += ysize;
- }
- else
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- /* need to cast to double to hold large unsigned ints */
- GLdouble buf;
- buf = (GLdouble)__GLU_SWAP_4_BYTES(t) +
- (GLdouble)__GLU_SWAP_4_BYTES(t+group_size) +
- (GLdouble)__GLU_SWAP_4_BYTES(t+ysize) +
- (GLdouble)__GLU_SWAP_4_BYTES(t+ysize+group_size);
- s[0] = (GLuint)(buf/4 + 0.5);
-
- s++; t += element_size;
- }
- t += group_size;
- }
- t += ysize;
- }
-}
-
-/* */
-static void halve1Dimage_uint(GLint components, GLuint width, GLuint height,
- const GLuint *dataIn, GLuint *dataOut,
- GLint element_size, GLint ysize,
- GLint group_size, GLint myswap_bytes)
-{
- GLint halfWidth= width / 2;
- GLint halfHeight= height / 2;
- const char *src= (const char *) dataIn;
- GLuint *dest= dataOut;
- int jj;
-
- assert(width == 1 || height == 1); /* must be 1D */
- assert(width != height); /* can't be square */
-
- if (height == 1) { /* 1 row */
- assert(width != 1); /* widthxheight can't be 1x1 */
- halfHeight= 1;
-
- for (jj= 0; jj< halfWidth; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLuint uint[BOX2];
- if (myswap_bytes) {
- uint[0]= __GLU_SWAP_4_BYTES(src);
- uint[1]= __GLU_SWAP_4_BYTES(src+group_size);
- }
- else {
- uint[0]= *(const GLuint*)src;
- uint[1]= *(const GLuint*)(src+group_size);
- }
- *dest= ((double)uint[0]+(double)uint[1])/2.0;
-
- src+= element_size;
- dest++;
- }
- src+= group_size; /* skip to next 2 */
- }
- {
- int padBytes= ysize - (width*group_size);
- src+= padBytes; /* for assertion only */
- }
- }
- else if (width == 1) { /* 1 column */
- int padBytes= ysize - (width * group_size);
- assert(height != 1); /* widthxheight can't be 1x1 */
- halfWidth= 1;
- /* one vertical column with possible pad bytes per row */
- /* average two at a time */
-
- for (jj= 0; jj< halfHeight; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLuint uint[BOX2];
- if (myswap_bytes) {
- uint[0]= __GLU_SWAP_4_BYTES(src);
- uint[1]= __GLU_SWAP_4_BYTES(src+ysize);
- }
- else {
- uint[0]= *(const GLuint*)src;
- uint[1]= *(const GLuint*)(src+ysize);
- }
- *dest= ((double)uint[0]+(double)uint[1])/2.0;
-
- src+= element_size;
- dest++;
- }
- src+= padBytes; /* add pad bytes, if any, to get to end to row */
- src+= ysize;
- }
-
- assert(src == &((const char *)dataIn)[ysize*height]);
- }
-
- assert((char *)dest == &((char *)dataOut)
- [components * element_size * halfWidth * halfHeight]);
-
-} /* halve1Dimage_uint() */
-
-static void halveImage_int(GLint components, GLuint width, GLuint height,
- const GLint *datain, GLint *dataout, GLint element_size,
- GLint ysize, GLint group_size, GLint myswap_bytes)
-{
- int i, j, k;
- int newwidth, newheight;
- GLint *s;
- const char *t;
-
- /* handle case where there is only 1 column/row */
- if (width == 1 || height == 1) {
- assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
- halve1Dimage_int(components,width,height,datain,dataout,
- element_size,ysize,group_size, myswap_bytes);
- return;
- }
-
- newwidth = width / 2;
- newheight = height / 2;
- s = dataout;
- t = (const char *)datain;
-
- /* Piece o' cake! */
- if (!myswap_bytes)
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- s[0] = ((float)*(const GLint*)t +
- (float)*(const GLint*)(t+group_size) +
- (float)*(const GLint*)(t+ysize) +
- (float)*(const GLint*)(t+ysize+group_size))/4 + 0.5;
- s++; t += element_size;
- }
- t += group_size;
- }
- t += ysize;
- }
- else
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- GLuint b;
- GLfloat buf;
- b = __GLU_SWAP_4_BYTES(t);
- buf = *(GLint*)&b;
- b = __GLU_SWAP_4_BYTES(t+group_size);
- buf += *(GLint*)&b;
- b = __GLU_SWAP_4_BYTES(t+ysize);
- buf += *(GLint*)&b;
- b = __GLU_SWAP_4_BYTES(t+ysize+group_size);
- buf += *(GLint*)&b;
- s[0] = (GLint)(buf/4 + 0.5);
-
- s++; t += element_size;
- }
- t += group_size;
- }
- t += ysize;
- }
-}
-
-/* */
-static void halve1Dimage_int(GLint components, GLuint width, GLuint height,
- const GLint *dataIn, GLint *dataOut,
- GLint element_size, GLint ysize,
- GLint group_size, GLint myswap_bytes)
-{
- GLint halfWidth= width / 2;
- GLint halfHeight= height / 2;
- const char *src= (const char *) dataIn;
- GLint *dest= dataOut;
- int jj;
-
- assert(width == 1 || height == 1); /* must be 1D */
- assert(width != height); /* can't be square */
-
- if (height == 1) { /* 1 row */
- assert(width != 1); /* widthxheight can't be 1x1 */
- halfHeight= 1;
-
- for (jj= 0; jj< halfWidth; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLuint uint[BOX2];
- if (myswap_bytes) {
- uint[0]= __GLU_SWAP_4_BYTES(src);
- uint[1]= __GLU_SWAP_4_BYTES(src+group_size);
- }
- else {
- uint[0]= *(const GLuint*)src;
- uint[1]= *(const GLuint*)(src+group_size);
- }
- *dest= ((float)uint[0]+(float)uint[1])/2.0;
-
- src+= element_size;
- dest++;
- }
- src+= group_size; /* skip to next 2 */
- }
- {
- int padBytes= ysize - (width*group_size);
- src+= padBytes; /* for assertion only */
- }
- }
- else if (width == 1) { /* 1 column */
- int padBytes= ysize - (width * group_size);
- assert(height != 1); /* widthxheight can't be 1x1 */
- halfWidth= 1;
- /* one vertical column with possible pad bytes per row */
- /* average two at a time */
-
- for (jj= 0; jj< halfHeight; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLuint uint[BOX2];
- if (myswap_bytes) {
- uint[0]= __GLU_SWAP_4_BYTES(src);
- uint[1]= __GLU_SWAP_4_BYTES(src+ysize);
- }
- else {
- uint[0]= *(const GLuint*)src;
- uint[1]= *(const GLuint*)(src+ysize);
- }
- *dest= ((float)uint[0]+(float)uint[1])/2.0;
-
- src+= element_size;
- dest++;
- }
- src+= padBytes; /* add pad bytes, if any, to get to end to row */
- src+= ysize;
- }
-
- assert(src == &((const char *)dataIn)[ysize*height]);
- }
-
- assert((char *)dest == &((char *)dataOut)
- [components * element_size * halfWidth * halfHeight]);
-
-} /* halve1Dimage_int() */
-
-
-static void halveImage_float(GLint components, GLuint width, GLuint height,
- const GLfloat *datain, GLfloat *dataout,
- GLint element_size, GLint ysize, GLint group_size,
- GLint myswap_bytes)
-{
- int i, j, k;
- int newwidth, newheight;
- GLfloat *s;
- const char *t;
-
- /* handle case where there is only 1 column/row */
- if (width == 1 || height == 1) {
- assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
- halve1Dimage_float(components,width,height,datain,dataout,
- element_size,ysize,group_size, myswap_bytes);
- return;
- }
-
- newwidth = width / 2;
- newheight = height / 2;
- s = dataout;
- t = (const char *)datain;
-
- /* Piece o' cake! */
- if (!myswap_bytes)
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- s[0] = (*(const GLfloat*)t +
- *(const GLfloat*)(t+group_size) +
- *(const GLfloat*)(t+ysize) +
- *(const GLfloat*)(t+ysize+group_size)) / 4;
- s++; t += element_size;
- }
- t += group_size;
- }
- t += ysize;
- }
- else
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- GLuint b;
- b = __GLU_SWAP_4_BYTES(t);
- s[0] = *(GLfloat*)&b;
- b = __GLU_SWAP_4_BYTES(t+group_size);
- s[0] += *(GLfloat*)&b;
- b = __GLU_SWAP_4_BYTES(t+ysize);
- s[0] += *(GLfloat*)&b;
- b = __GLU_SWAP_4_BYTES(t+ysize+group_size);
- s[0] += *(GLfloat*)&b;
- s[0] /= 4;
- s++; t += element_size;
- }
- t += group_size;
- }
- t += ysize;
- }
-}
-
-/* */
-static void halve1Dimage_float(GLint components, GLuint width, GLuint height,
- const GLfloat *dataIn, GLfloat *dataOut,
- GLint element_size, GLint ysize,
- GLint group_size, GLint myswap_bytes)
-{
- GLint halfWidth= width / 2;
- GLint halfHeight= height / 2;
- const char *src= (const char *) dataIn;
- GLfloat *dest= dataOut;
- int jj;
-
- assert(width == 1 || height == 1); /* must be 1D */
- assert(width != height); /* can't be square */
-
- if (height == 1) { /* 1 row */
- assert(width != 1); /* widthxheight can't be 1x1 */
- halfHeight= 1;
-
- for (jj= 0; jj< halfWidth; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLfloat sfloat[BOX2];
- if (myswap_bytes) {
- sfloat[0]= __GLU_SWAP_4_BYTES(src);
- sfloat[1]= __GLU_SWAP_4_BYTES(src+group_size);
- }
- else {
- sfloat[0]= *(const GLfloat*)src;
- sfloat[1]= *(const GLfloat*)(src+group_size);
- }
-
- *dest= (sfloat[0] + sfloat[1]) / 2.0;
- src+= element_size;
- dest++;
- }
- src+= group_size; /* skip to next 2 */
- }
- {
- int padBytes= ysize - (width*group_size);
- src+= padBytes; /* for assertion only */
- }
- }
- else if (width == 1) { /* 1 column */
- int padBytes= ysize - (width * group_size);
- assert(height != 1); /* widthxheight can't be 1x1 */
- halfWidth= 1;
- /* one vertical column with possible pad bytes per row */
- /* average two at a time */
-
- for (jj= 0; jj< halfHeight; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLfloat sfloat[BOX2];
- if (myswap_bytes) {
- sfloat[0]= __GLU_SWAP_4_BYTES(src);
- sfloat[1]= __GLU_SWAP_4_BYTES(src+ysize);
- }
- else {
- sfloat[0]= *(const GLfloat*)src;
- sfloat[1]= *(const GLfloat*)(src+ysize);
- }
- *dest= (sfloat[0] + sfloat[1]) / 2.0;
-
- src+= element_size;
- dest++;
- }
- src+= padBytes; /* add pad bytes, if any, to get to end to row */
- src+= ysize; /* skip to odd row */
- }
- }
-
- assert(src == &((const char *)dataIn)[ysize*height]);
- assert((char *)dest == &((char *)dataOut)
- [components * element_size * halfWidth * halfHeight]);
-} /* halve1Dimage_float() */
-
-static void scale_internal(GLint components, GLint widthin, GLint heightin,
- const GLushort *datain,
- GLint widthout, GLint heightout,
- GLushort *dataout)
-{
- float x, lowx, highx, convx, halfconvx;
- float y, lowy, highy, convy, halfconvy;
- float xpercent,ypercent;
- float percent;
- /* Max components in a format is 4, so... */
- float totals[4];
- float area;
- int i,j,k,yint,xint,xindex,yindex;
- int temp;
-
- if (widthin == widthout*2 && heightin == heightout*2) {
- halveImage(components, widthin, heightin, datain, dataout);
- return;
- }
- convy = (float) heightin/heightout;
- convx = (float) widthin/widthout;
- halfconvx = convx/2;
- halfconvy = convy/2;
- for (i = 0; i < heightout; i++) {
- y = convy * (i+0.5);
- if (heightin > heightout) {
- highy = y + halfconvy;
- lowy = y - halfconvy;
- } else {
- highy = y + 0.5;
- lowy = y - 0.5;
- }
- for (j = 0; j < widthout; j++) {
- x = convx * (j+0.5);
- if (widthin > widthout) {
- highx = x + halfconvx;
- lowx = x - halfconvx;
- } else {
- highx = x + 0.5;
- lowx = x - 0.5;
- }
-
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy)
- ** to (highx, highy) on input data into this pixel on output
- ** data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
- area = 0.0;
-
- y = lowy;
- yint = floor(y);
- while (y < highy) {
- yindex = (yint + heightin) % heightin;
- if (highy < yint+1) {
- ypercent = highy - y;
- } else {
- ypercent = yint+1 - y;
- }
-
- x = lowx;
- xint = floor(x);
-
- while (x < highx) {
- xindex = (xint + widthin) % widthin;
- if (highx < xint+1) {
- xpercent = highx - x;
- } else {
- xpercent = xint+1 - x;
- }
-
- percent = xpercent * ypercent;
- area += percent;
- temp = (xindex + (yindex * widthin)) * components;
- for (k = 0; k < components; k++) {
- totals[k] += datain[temp + k] * percent;
- }
-
- xint++;
- x = xint;
- }
- yint++;
- y = yint;
- }
-
- temp = (j + (i * widthout)) * components;
- for (k = 0; k < components; k++) {
- /* totals[] should be rounded in the case of enlarging an RGB
- * ramp when the type is 332 or 4444
- */
- dataout[temp + k] = (totals[k]+0.5)/area;
- }
- }
- }
-}
-
-static void scale_internal_ubyte(GLint components, GLint widthin,
- GLint heightin, const GLubyte *datain,
- GLint widthout, GLint heightout,
- GLubyte *dataout, GLint element_size,
- GLint ysize, GLint group_size)
-{
- float convx;
- float convy;
- float percent;
- /* Max components in a format is 4, so... */
- float totals[4];
- float area;
- int i,j,k,xindex;
-
- const char *temp, *temp0;
- const char *temp_index;
- int outindex;
-
- int lowx_int, highx_int, lowy_int, highy_int;
- float x_percent, y_percent;
- float lowx_float, highx_float, lowy_float, highy_float;
- float convy_float, convx_float;
- int convy_int, convx_int;
- int l, m;
- const char *left, *right;
-
- if (widthin == widthout*2 && heightin == heightout*2) {
- halveImage_ubyte(components, widthin, heightin,
- (const GLubyte *)datain, (GLubyte *)dataout,
- element_size, ysize, group_size);
- return;
- }
- convy = (float) heightin/heightout;
- convx = (float) widthin/widthout;
- convy_int = floor(convy);
- convy_float = convy - convy_int;
- convx_int = floor(convx);
- convx_float = convx - convx_int;
-
- area = convx * convy;
-
- lowy_int = 0;
- lowy_float = 0;
- highy_int = convy_int;
- highy_float = convy_float;
-
- for (i = 0; i < heightout; i++) {
- lowx_int = 0;
- lowx_float = 0;
- highx_int = convx_int;
- highx_float = convx_float;
-
- for (j = 0; j < widthout; j++) {
-
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy)
- ** to (highx, highy) on input data into this pixel on output
- ** data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
-
- /* calculate the value for pixels in the 1st row */
- xindex = lowx_int*group_size;
- if((highy_int>lowy_int) && (highx_int>lowx_int)) {
-
- y_percent = 1-lowy_float;
- temp = (const char *)datain + xindex + lowy_int * ysize;
- percent = y_percent * (1-lowx_float);
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * percent;
- }
- left = temp;
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * y_percent;
- }
- }
- temp += group_size;
- right = temp;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * percent;
- }
-
- /* calculate the value for pixels in the last row */
- y_percent = highy_float;
- percent = y_percent * (1-lowx_float);
- temp = (const char *)datain + xindex + highy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * percent;
- }
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * y_percent;
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * percent;
- }
-
-
- /* calculate the value for pixels in the 1st and last column */
- for(m = lowy_int+1; m < highy_int; m++) {
- left += ysize;
- right += ysize;
- for (k = 0; k < components;
- k++, left += element_size, right += element_size) {
- totals[k] += (GLubyte)(*(left))*(1-lowx_float)
- +(GLubyte)(*(right))*highx_float;
- }
- }
- } else if (highy_int > lowy_int) {
- x_percent = highx_float - lowx_float;
- percent = (1-lowy_float)*x_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * percent;
- }
- for(m = lowy_int+1; m < highy_int; m++) {
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * x_percent;
- }
- }
- percent = x_percent * highy_float;
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * percent;
- }
- } else if (highx_int > lowx_int) {
- y_percent = highy_float - lowy_float;
- percent = (1-lowx_float)*y_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * percent;
- }
- for (l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * y_percent;
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * percent;
- }
- } else {
- percent = (highy_float-lowy_float)*(highx_float-lowx_float);
- temp = (const char *)datain + xindex + lowy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * percent;
- }
- }
-
-
-
- /* this is for the pixels in the body */
- temp0 = (const char *)datain + xindex + group_size +
- (lowy_int+1)*ysize;
- for (m = lowy_int+1; m < highy_int; m++) {
- temp = temp0;
- for(l = lowx_int+1; l < highx_int; l++) {
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index));
- }
- temp += group_size;
- }
- temp0 += ysize;
- }
-
- outindex = (j + (i * widthout)) * components;
- for (k = 0; k < components; k++) {
- dataout[outindex + k] = totals[k]/area;
- /*printf("totals[%d] = %f\n", k, totals[k]);*/
- }
- lowx_int = highx_int;
- lowx_float = highx_float;
- highx_int += convx_int;
- highx_float += convx_float;
- if(highx_float > 1) {
- highx_float -= 1.0;
- highx_int++;
- }
- }
- lowy_int = highy_int;
- lowy_float = highy_float;
- highy_int += convy_int;
- highy_float += convy_float;
- if(highy_float > 1) {
- highy_float -= 1.0;
- highy_int++;
- }
- }
-}
-
-static void scale_internal_byte(GLint components, GLint widthin,
- GLint heightin, const GLbyte *datain,
- GLint widthout, GLint heightout,
- GLbyte *dataout, GLint element_size,
- GLint ysize, GLint group_size)
-{
- float convx;
- float convy;
- float percent;
- /* Max components in a format is 4, so... */
- float totals[4];
- float area;
- int i,j,k,xindex;
-
- const char *temp, *temp0;
- const char *temp_index;
- int outindex;
-
- int lowx_int, highx_int, lowy_int, highy_int;
- float x_percent, y_percent;
- float lowx_float, highx_float, lowy_float, highy_float;
- float convy_float, convx_float;
- int convy_int, convx_int;
- int l, m;
- const char *left, *right;
-
- if (widthin == widthout*2 && heightin == heightout*2) {
- halveImage_byte(components, widthin, heightin,
- (const GLbyte *)datain, (GLbyte *)dataout,
- element_size, ysize, group_size);
- return;
- }
- convy = (float) heightin/heightout;
- convx = (float) widthin/widthout;
- convy_int = floor(convy);
- convy_float = convy - convy_int;
- convx_int = floor(convx);
- convx_float = convx - convx_int;
-
- area = convx * convy;
-
- lowy_int = 0;
- lowy_float = 0;
- highy_int = convy_int;
- highy_float = convy_float;
-
- for (i = 0; i < heightout; i++) {
- lowx_int = 0;
- lowx_float = 0;
- highx_int = convx_int;
- highx_float = convx_float;
-
- for (j = 0; j < widthout; j++) {
-
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy)
- ** to (highx, highy) on input data into this pixel on output
- ** data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
-
- /* calculate the value for pixels in the 1st row */
- xindex = lowx_int*group_size;
- if((highy_int>lowy_int) && (highx_int>lowx_int)) {
-
- y_percent = 1-lowy_float;
- temp = (const char *)datain + xindex + lowy_int * ysize;
- percent = y_percent * (1-lowx_float);
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * percent;
- }
- left = temp;
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * y_percent;
- }
- }
- temp += group_size;
- right = temp;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * percent;
- }
-
- /* calculate the value for pixels in the last row */
- y_percent = highy_float;
- percent = y_percent * (1-lowx_float);
- temp = (const char *)datain + xindex + highy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * percent;
- }
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * y_percent;
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * percent;
- }
-
-
- /* calculate the value for pixels in the 1st and last column */
- for(m = lowy_int+1; m < highy_int; m++) {
- left += ysize;
- right += ysize;
- for (k = 0; k < components;
- k++, left += element_size, right += element_size) {
- totals[k] += (GLbyte)(*(left))*(1-lowx_float)
- +(GLbyte)(*(right))*highx_float;
- }
- }
- } else if (highy_int > lowy_int) {
- x_percent = highx_float - lowx_float;
- percent = (1-lowy_float)*x_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * percent;
- }
- for(m = lowy_int+1; m < highy_int; m++) {
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * x_percent;
- }
- }
- percent = x_percent * highy_float;
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * percent;
- }
- } else if (highx_int > lowx_int) {
- y_percent = highy_float - lowy_float;
- percent = (1-lowx_float)*y_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * percent;
- }
- for (l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * y_percent;
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * percent;
- }
- } else {
- percent = (highy_float-lowy_float)*(highx_float-lowx_float);
- temp = (const char *)datain + xindex + lowy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * percent;
- }
- }
-
-
-
- /* this is for the pixels in the body */
- temp0 = (const char *)datain + xindex + group_size +
- (lowy_int+1)*ysize;
- for (m = lowy_int+1; m < highy_int; m++) {
- temp = temp0;
- for(l = lowx_int+1; l < highx_int; l++) {
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index));
- }
- temp += group_size;
- }
- temp0 += ysize;
- }
-
- outindex = (j + (i * widthout)) * components;
- for (k = 0; k < components; k++) {
- dataout[outindex + k] = totals[k]/area;
- /*printf("totals[%d] = %f\n", k, totals[k]);*/
- }
- lowx_int = highx_int;
- lowx_float = highx_float;
- highx_int += convx_int;
- highx_float += convx_float;
- if(highx_float > 1) {
- highx_float -= 1.0;
- highx_int++;
- }
- }
- lowy_int = highy_int;
- lowy_float = highy_float;
- highy_int += convy_int;
- highy_float += convy_float;
- if(highy_float > 1) {
- highy_float -= 1.0;
- highy_int++;
- }
- }
-}
-
-static void scale_internal_ushort(GLint components, GLint widthin,
- GLint heightin, const GLushort *datain,
- GLint widthout, GLint heightout,
- GLushort *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes)
-{
- float convx;
- float convy;
- float percent;
- /* Max components in a format is 4, so... */
- float totals[4];
- float area;
- int i,j,k,xindex;
-
- const char *temp, *temp0;
- const char *temp_index;
- int outindex;
-
- int lowx_int, highx_int, lowy_int, highy_int;
- float x_percent, y_percent;
- float lowx_float, highx_float, lowy_float, highy_float;
- float convy_float, convx_float;
- int convy_int, convx_int;
- int l, m;
- const char *left, *right;
-
- if (widthin == widthout*2 && heightin == heightout*2) {
- halveImage_ushort(components, widthin, heightin,
- (const GLushort *)datain, (GLushort *)dataout,
- element_size, ysize, group_size, myswap_bytes);
- return;
- }
- convy = (float) heightin/heightout;
- convx = (float) widthin/widthout;
- convy_int = floor(convy);
- convy_float = convy - convy_int;
- convx_int = floor(convx);
- convx_float = convx - convx_int;
-
- area = convx * convy;
-
- lowy_int = 0;
- lowy_float = 0;
- highy_int = convy_int;
- highy_float = convy_float;
-
- for (i = 0; i < heightout; i++) {
- lowx_int = 0;
- lowx_float = 0;
- highx_int = convx_int;
- highx_float = convx_float;
-
- for (j = 0; j < widthout; j++) {
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy)
- ** to (highx, highy) on input data into this pixel on output
- ** data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
-
- /* calculate the value for pixels in the 1st row */
- xindex = lowx_int*group_size;
- if((highy_int>lowy_int) && (highx_int>lowx_int)) {
-
- y_percent = 1-lowy_float;
- temp = (const char *)datain + xindex + lowy_int * ysize;
- percent = y_percent * (1-lowx_float);
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
- left = temp;
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(temp_index) * y_percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- right = temp;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the last row */
- y_percent = highy_float;
- percent = y_percent * (1-lowx_float);
- temp = (const char *)datain + xindex + highy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(temp_index) * y_percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the 1st and last column */
- for(m = lowy_int+1; m < highy_int; m++) {
- left += ysize;
- right += ysize;
- for (k = 0; k < components;
- k++, left += element_size, right += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(left) * (1-lowx_float) +
- __GLU_SWAP_2_BYTES(right) * highx_float;
- } else {
- totals[k] += *(const GLushort*)left * (1-lowx_float)
- + *(const GLushort*)right * highx_float;
- }
- }
- }
- } else if (highy_int > lowy_int) {
- x_percent = highx_float - lowx_float;
- percent = (1-lowy_float)*x_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
- for(m = lowy_int+1; m < highy_int; m++) {
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(temp_index) * x_percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * x_percent;
- }
- }
- }
- percent = x_percent * highy_float;
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
- } else if (highx_int > lowx_int) {
- y_percent = highy_float - lowy_float;
- percent = (1-lowx_float)*y_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
- for (l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(temp_index) * y_percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
- } else {
- percent = (highy_float-lowy_float)*(highx_float-lowx_float);
- temp = (const char *)datain + xindex + lowy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
- }
-
- /* this is for the pixels in the body */
- temp0 = (const char *)datain + xindex + group_size +
- (lowy_int+1)*ysize;
- for (m = lowy_int+1; m < highy_int; m++) {
- temp = temp0;
- for(l = lowx_int+1; l < highx_int; l++) {
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index);
- } else {
- totals[k] += *(const GLushort*)temp_index;
- }
- }
- temp += group_size;
- }
- temp0 += ysize;
- }
-
- outindex = (j + (i * widthout)) * components;
- for (k = 0; k < components; k++) {
- dataout[outindex + k] = totals[k]/area;
- /*printf("totals[%d] = %f\n", k, totals[k]);*/
- }
- lowx_int = highx_int;
- lowx_float = highx_float;
- highx_int += convx_int;
- highx_float += convx_float;
- if(highx_float > 1) {
- highx_float -= 1.0;
- highx_int++;
- }
- }
- lowy_int = highy_int;
- lowy_float = highy_float;
- highy_int += convy_int;
- highy_float += convy_float;
- if(highy_float > 1) {
- highy_float -= 1.0;
- highy_int++;
- }
- }
-}
-
-static void scale_internal_short(GLint components, GLint widthin,
- GLint heightin, const GLshort *datain,
- GLint widthout, GLint heightout,
- GLshort *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes)
-{
- float convx;
- float convy;
- float percent;
- /* Max components in a format is 4, so... */
- float totals[4];
- float area;
- int i,j,k,xindex;
-
- const char *temp, *temp0;
- const char *temp_index;
- int outindex;
-
- int lowx_int, highx_int, lowy_int, highy_int;
- float x_percent, y_percent;
- float lowx_float, highx_float, lowy_float, highy_float;
- float convy_float, convx_float;
- int convy_int, convx_int;
- int l, m;
- const char *left, *right;
-
- GLushort swapbuf; /* unsigned buffer */
-
- if (widthin == widthout*2 && heightin == heightout*2) {
- halveImage_short(components, widthin, heightin,
- (const GLshort *)datain, (GLshort *)dataout,
- element_size, ysize, group_size, myswap_bytes);
- return;
- }
- convy = (float) heightin/heightout;
- convx = (float) widthin/widthout;
- convy_int = floor(convy);
- convy_float = convy - convy_int;
- convx_int = floor(convx);
- convx_float = convx - convx_int;
-
- area = convx * convy;
-
- lowy_int = 0;
- lowy_float = 0;
- highy_int = convy_int;
- highy_float = convy_float;
-
- for (i = 0; i < heightout; i++) {
- lowx_int = 0;
- lowx_float = 0;
- highx_int = convx_int;
- highx_float = convx_float;
-
- for (j = 0; j < widthout; j++) {
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy)
- ** to (highx, highy) on input data into this pixel on output
- ** data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
-
- /* calculate the value for pixels in the 1st row */
- xindex = lowx_int*group_size;
- if((highy_int>lowy_int) && (highx_int>lowx_int)) {
-
- y_percent = 1-lowy_float;
- temp = (const char *)datain + xindex + lowy_int * ysize;
- percent = y_percent * (1-lowx_float);
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * percent;
- }
- }
- left = temp;
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * y_percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- right = temp;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the last row */
- y_percent = highy_float;
- percent = y_percent * (1-lowx_float);
- temp = (const char *)datain + xindex + highy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * percent;
- }
- }
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * y_percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the 1st and last column */
- for(m = lowy_int+1; m < highy_int; m++) {
- left += ysize;
- right += ysize;
- for (k = 0; k < components;
- k++, left += element_size, right += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(left);
- totals[k] += *(const GLshort*)&swapbuf * (1-lowx_float);
- swapbuf = __GLU_SWAP_2_BYTES(right);
- totals[k] += *(const GLshort*)&swapbuf * highx_float;
- } else {
- totals[k] += *(const GLshort*)left * (1-lowx_float)
- + *(const GLshort*)right * highx_float;
- }
- }
- }
- } else if (highy_int > lowy_int) {
- x_percent = highx_float - lowx_float;
- percent = (1-lowy_float)*x_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * percent;
- }
- }
- for(m = lowy_int+1; m < highy_int; m++) {
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * x_percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * x_percent;
- }
- }
- }
- percent = x_percent * highy_float;
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * percent;
- }
- }
- } else if (highx_int > lowx_int) {
- y_percent = highy_float - lowy_float;
- percent = (1-lowx_float)*y_percent;
-
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * percent;
- }
- }
- for (l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * y_percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * percent;
- }
- }
- } else {
- percent = (highy_float-lowy_float)*(highx_float-lowx_float);
- temp = (const char *)datain + xindex + lowy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * percent;
- }
- }
- }
-
- /* this is for the pixels in the body */
- temp0 = (const char *)datain + xindex + group_size +
- (lowy_int+1)*ysize;
- for (m = lowy_int+1; m < highy_int; m++) {
- temp = temp0;
- for(l = lowx_int+1; l < highx_int; l++) {
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf;
- } else {
- totals[k] += *(const GLshort*)temp_index;
- }
- }
- temp += group_size;
- }
- temp0 += ysize;
- }
-
- outindex = (j + (i * widthout)) * components;
- for (k = 0; k < components; k++) {
- dataout[outindex + k] = totals[k]/area;
- /*printf("totals[%d] = %f\n", k, totals[k]);*/
- }
- lowx_int = highx_int;
- lowx_float = highx_float;
- highx_int += convx_int;
- highx_float += convx_float;
- if(highx_float > 1) {
- highx_float -= 1.0;
- highx_int++;
- }
- }
- lowy_int = highy_int;
- lowy_float = highy_float;
- highy_int += convy_int;
- highy_float += convy_float;
- if(highy_float > 1) {
- highy_float -= 1.0;
- highy_int++;
- }
- }
-}
-
-static void scale_internal_uint(GLint components, GLint widthin,
- GLint heightin, const GLuint *datain,
- GLint widthout, GLint heightout,
- GLuint *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes)
-{
- float convx;
- float convy;
- float percent;
- /* Max components in a format is 4, so... */
- float totals[4];
- float area;
- int i,j,k,xindex;
-
- const char *temp, *temp0;
- const char *temp_index;
- int outindex;
-
- int lowx_int, highx_int, lowy_int, highy_int;
- float x_percent, y_percent;
- float lowx_float, highx_float, lowy_float, highy_float;
- float convy_float, convx_float;
- int convy_int, convx_int;
- int l, m;
- const char *left, *right;
-
- if (widthin == widthout*2 && heightin == heightout*2) {
- halveImage_uint(components, widthin, heightin,
- (const GLuint *)datain, (GLuint *)dataout,
- element_size, ysize, group_size, myswap_bytes);
- return;
- }
- convy = (float) heightin/heightout;
- convx = (float) widthin/widthout;
- convy_int = floor(convy);
- convy_float = convy - convy_int;
- convx_int = floor(convx);
- convx_float = convx - convx_int;
-
- area = convx * convy;
-
- lowy_int = 0;
- lowy_float = 0;
- highy_int = convy_int;
- highy_float = convy_float;
-
- for (i = 0; i < heightout; i++) {
- lowx_int = 0;
- lowx_float = 0;
- highx_int = convx_int;
- highx_float = convx_float;
-
- for (j = 0; j < widthout; j++) {
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy)
- ** to (highx, highy) on input data into this pixel on output
- ** data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
-
- /* calculate the value for pixels in the 1st row */
- xindex = lowx_int*group_size;
- if((highy_int>lowy_int) && (highx_int>lowx_int)) {
-
- y_percent = 1-lowy_float;
- temp = (const char *)datain + xindex + lowy_int * ysize;
- percent = y_percent * (1-lowx_float);
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * percent;
- }
- }
- left = temp;
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_4_BYTES(temp_index) * y_percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- right = temp;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the last row */
- y_percent = highy_float;
- percent = y_percent * (1-lowx_float);
- temp = (const char *)datain + xindex + highy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * percent;
- }
- }
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_4_BYTES(temp_index) * y_percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the 1st and last column */
- for(m = lowy_int+1; m < highy_int; m++) {
- left += ysize;
- right += ysize;
- for (k = 0; k < components;
- k++, left += element_size, right += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_4_BYTES(left) * (1-lowx_float)
- + __GLU_SWAP_4_BYTES(right) * highx_float;
- } else {
- totals[k] += *(const GLuint*)left * (1-lowx_float)
- + *(const GLuint*)right * highx_float;
- }
- }
- }
- } else if (highy_int > lowy_int) {
- x_percent = highx_float - lowx_float;
- percent = (1-lowy_float)*x_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * percent;
- }
- }
- for(m = lowy_int+1; m < highy_int; m++) {
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_4_BYTES(temp_index) * x_percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * x_percent;
- }
- }
- }
- percent = x_percent * highy_float;
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * percent;
- }
- }
- } else if (highx_int > lowx_int) {
- y_percent = highy_float - lowy_float;
- percent = (1-lowx_float)*y_percent;
-
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * percent;
- }
- }
- for (l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_4_BYTES(temp_index) * y_percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * percent;
- }
- }
- } else {
- percent = (highy_float-lowy_float)*(highx_float-lowx_float);
- temp = (const char *)datain + xindex + lowy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * percent;
- }
- }
- }
-
- /* this is for the pixels in the body */
- temp0 = (const char *)datain + xindex + group_size +
- (lowy_int+1)*ysize;
- for (m = lowy_int+1; m < highy_int; m++) {
- temp = temp0;
- for(l = lowx_int+1; l < highx_int; l++) {
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index);
- } else {
- totals[k] += *(const GLuint*)temp_index;
- }
- }
- temp += group_size;
- }
- temp0 += ysize;
- }
-
- outindex = (j + (i * widthout)) * components;
- for (k = 0; k < components; k++) {
- /* clamp at UINT_MAX */
- float value= totals[k]/area;
- if (value >= (float) UINT_MAX) { /* need '=' */
- dataout[outindex + k] = UINT_MAX;
- }
- else dataout[outindex + k] = value;
- }
- lowx_int = highx_int;
- lowx_float = highx_float;
- highx_int += convx_int;
- highx_float += convx_float;
- if(highx_float > 1) {
- highx_float -= 1.0;
- highx_int++;
- }
- }
- lowy_int = highy_int;
- lowy_float = highy_float;
- highy_int += convy_int;
- highy_float += convy_float;
- if(highy_float > 1) {
- highy_float -= 1.0;
- highy_int++;
- }
- }
-}
-
-
-
-static void scale_internal_int(GLint components, GLint widthin,
- GLint heightin, const GLint *datain,
- GLint widthout, GLint heightout,
- GLint *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes)
-{
- float convx;
- float convy;
- float percent;
- /* Max components in a format is 4, so... */
- float totals[4];
- float area;
- int i,j,k,xindex;
-
- const char *temp, *temp0;
- const char *temp_index;
- int outindex;
-
- int lowx_int, highx_int, lowy_int, highy_int;
- float x_percent, y_percent;
- float lowx_float, highx_float, lowy_float, highy_float;
- float convy_float, convx_float;
- int convy_int, convx_int;
- int l, m;
- const char *left, *right;
-
- GLuint swapbuf; /* unsigned buffer */
-
- if (widthin == widthout*2 && heightin == heightout*2) {
- halveImage_int(components, widthin, heightin,
- (const GLint *)datain, (GLint *)dataout,
- element_size, ysize, group_size, myswap_bytes);
- return;
- }
- convy = (float) heightin/heightout;
- convx = (float) widthin/widthout;
- convy_int = floor(convy);
- convy_float = convy - convy_int;
- convx_int = floor(convx);
- convx_float = convx - convx_int;
-
- area = convx * convy;
-
- lowy_int = 0;
- lowy_float = 0;
- highy_int = convy_int;
- highy_float = convy_float;
-
- for (i = 0; i < heightout; i++) {
- lowx_int = 0;
- lowx_float = 0;
- highx_int = convx_int;
- highx_float = convx_float;
-
- for (j = 0; j < widthout; j++) {
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy)
- ** to (highx, highy) on input data into this pixel on output
- ** data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
-
- /* calculate the value for pixels in the 1st row */
- xindex = lowx_int*group_size;
- if((highy_int>lowy_int) && (highx_int>lowx_int)) {
-
- y_percent = 1-lowy_float;
- temp = (const char *)datain + xindex + lowy_int * ysize;
- percent = y_percent * (1-lowx_float);
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLint*)temp_index * percent;
- }
- }
- left = temp;
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * y_percent;
- } else {
- totals[k] += *(const GLint*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- right = temp;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLint*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the last row */
- y_percent = highy_float;
- percent = y_percent * (1-lowx_float);
- temp = (const char *)datain + xindex + highy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLint*)temp_index * percent;
- }
- }
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * y_percent;
- } else {
- totals[k] += *(const GLint*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLint*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the 1st and last column */
- for(m = lowy_int+1; m < highy_int; m++) {
- left += ysize;
- right += ysize;
- for (k = 0; k < components;
- k++, left += element_size, right += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(left);
- totals[k] += *(const GLint*)&swapbuf * (1-lowx_float);
- swapbuf = __GLU_SWAP_4_BYTES(right);
- totals[k] += *(const GLint*)&swapbuf * highx_float;
- } else {
- totals[k] += *(const GLint*)left * (1-lowx_float)
- + *(const GLint*)right * highx_float;
- }
- }
- }
- } else if (highy_int > lowy_int) {
- x_percent = highx_float - lowx_float;
- percent = (1-lowy_float)*x_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLint*)temp_index * percent;
- }
- }
- for(m = lowy_int+1; m < highy_int; m++) {
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * x_percent;
- } else {
- totals[k] += *(const GLint*)temp_index * x_percent;
- }
- }
- }
- percent = x_percent * highy_float;
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLint*)temp_index * percent;
- }
- }
- } else if (highx_int > lowx_int) {
- y_percent = highy_float - lowy_float;
- percent = (1-lowx_float)*y_percent;
-
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLint*)temp_index * percent;
- }
- }
- for (l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * y_percent;
- } else {
- totals[k] += *(const GLint*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLint*)temp_index * percent;
- }
- }
- } else {
- percent = (highy_float-lowy_float)*(highx_float-lowx_float);
- temp = (const char *)datain + xindex + lowy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLint*)temp_index * percent;
- }
- }
- }
-
- /* this is for the pixels in the body */
- temp0 = (const char *)datain + xindex + group_size +
- (lowy_int+1)*ysize;
- for (m = lowy_int+1; m < highy_int; m++) {
- temp = temp0;
- for(l = lowx_int+1; l < highx_int; l++) {
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf;
- } else {
- totals[k] += *(const GLint*)temp_index;
- }
- }
- temp += group_size;
- }
- temp0 += ysize;
- }
-
- outindex = (j + (i * widthout)) * components;
- for (k = 0; k < components; k++) {
- dataout[outindex + k] = totals[k]/area;
- /*printf("totals[%d] = %f\n", k, totals[k]);*/
- }
- lowx_int = highx_int;
- lowx_float = highx_float;
- highx_int += convx_int;
- highx_float += convx_float;
- if(highx_float > 1) {
- highx_float -= 1.0;
- highx_int++;
- }
- }
- lowy_int = highy_int;
- lowy_float = highy_float;
- highy_int += convy_int;
- highy_float += convy_float;
- if(highy_float > 1) {
- highy_float -= 1.0;
- highy_int++;
- }
- }
-}
-
-
-
-static void scale_internal_float(GLint components, GLint widthin,
- GLint heightin, const GLfloat *datain,
- GLint widthout, GLint heightout,
- GLfloat *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes)
-{
- float convx;
- float convy;
- float percent;
- /* Max components in a format is 4, so... */
- float totals[4];
- float area;
- int i,j,k,xindex;
-
- const char *temp, *temp0;
- const char *temp_index;
- int outindex;
-
- int lowx_int, highx_int, lowy_int, highy_int;
- float x_percent, y_percent;
- float lowx_float, highx_float, lowy_float, highy_float;
- float convy_float, convx_float;
- int convy_int, convx_int;
- int l, m;
- const char *left, *right;
-
- GLuint swapbuf; /* unsigned buffer */
-
- if (widthin == widthout*2 && heightin == heightout*2) {
- halveImage_float(components, widthin, heightin,
- (const GLfloat *)datain, (GLfloat *)dataout,
- element_size, ysize, group_size, myswap_bytes);
- return;
- }
- convy = (float) heightin/heightout;
- convx = (float) widthin/widthout;
- convy_int = floor(convy);
- convy_float = convy - convy_int;
- convx_int = floor(convx);
- convx_float = convx - convx_int;
-
- area = convx * convy;
-
- lowy_int = 0;
- lowy_float = 0;
- highy_int = convy_int;
- highy_float = convy_float;
-
- for (i = 0; i < heightout; i++) {
- lowx_int = 0;
- lowx_float = 0;
- highx_int = convx_int;
- highx_float = convx_float;
-
- for (j = 0; j < widthout; j++) {
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy)
- ** to (highx, highy) on input data into this pixel on output
- ** data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
-
- /* calculate the value for pixels in the 1st row */
- xindex = lowx_int*group_size;
- if((highy_int>lowy_int) && (highx_int>lowx_int)) {
-
- y_percent = 1-lowy_float;
- temp = (const char *)datain + xindex + lowy_int * ysize;
- percent = y_percent * (1-lowx_float);
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLfloat*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * percent;
- }
- }
- left = temp;
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLfloat*)&swapbuf * y_percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- right = temp;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLfloat*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the last row */
- y_percent = highy_float;
- percent = y_percent * (1-lowx_float);
- temp = (const char *)datain + xindex + highy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLfloat*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * percent;
- }
- }
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLfloat*)&swapbuf * y_percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLfloat*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the 1st and last column */
- for(m = lowy_int+1; m < highy_int; m++) {
- left += ysize;
- right += ysize;
- for (k = 0; k < components;
- k++, left += element_size, right += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(left);
- totals[k] += *(const GLfloat*)&swapbuf * (1-lowx_float);
- swapbuf = __GLU_SWAP_4_BYTES(right);
- totals[k] += *(const GLfloat*)&swapbuf * highx_float;
- } else {
- totals[k] += *(const GLfloat*)left * (1-lowx_float)
- + *(const GLfloat*)right * highx_float;
- }
- }
- }
- } else if (highy_int > lowy_int) {
- x_percent = highx_float - lowx_float;
- percent = (1-lowy_float)*x_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLfloat*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * percent;
- }
- }
- for(m = lowy_int+1; m < highy_int; m++) {
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLfloat*)&swapbuf * x_percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * x_percent;
- }
- }
- }
- percent = x_percent * highy_float;
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLfloat*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * percent;
- }
- }
- } else if (highx_int > lowx_int) {
- y_percent = highy_float - lowy_float;
- percent = (1-lowx_float)*y_percent;
-
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLfloat*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * percent;
- }
- }
- for (l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLfloat*)&swapbuf * y_percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLfloat*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * percent;
- }
- }
- } else {
- percent = (highy_float-lowy_float)*(highx_float-lowx_float);
- temp = (const char *)datain + xindex + lowy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLfloat*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * percent;
- }
- }
- }
-
- /* this is for the pixels in the body */
- temp0 = (const char *)datain + xindex + group_size +
- (lowy_int+1)*ysize;
- for (m = lowy_int+1; m < highy_int; m++) {
- temp = temp0;
- for(l = lowx_int+1; l < highx_int; l++) {
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLfloat*)&swapbuf;
- } else {
- totals[k] += *(const GLfloat*)temp_index;
- }
- }
- temp += group_size;
- }
- temp0 += ysize;
- }
-
- outindex = (j + (i * widthout)) * components;
- for (k = 0; k < components; k++) {
- dataout[outindex + k] = totals[k]/area;
- /*printf("totals[%d] = %f\n", k, totals[k]);*/
- }
- lowx_int = highx_int;
- lowx_float = highx_float;
- highx_int += convx_int;
- highx_float += convx_float;
- if(highx_float > 1) {
- highx_float -= 1.0;
- highx_int++;
- }
- }
- lowy_int = highy_int;
- lowy_float = highy_float;
- highy_int += convy_int;
- highy_float += convy_float;
- if(highy_float > 1) {
- highy_float -= 1.0;
- highy_int++;
- }
- }
-}
-
-static int checkMipmapArgs(GLenum internalFormat, GLenum format, GLenum type)
-{
- if (!legalFormat(format) || !legalType(type)) {
- return GLU_INVALID_ENUM;
- }
- if (format == GL_STENCIL_INDEX) {
- return GLU_INVALID_ENUM;
- }
-
- if (!isLegalFormatForPackedPixelType(format, type)) {
- return GLU_INVALID_OPERATION;
- }
-
- return 0;
-} /* checkMipmapArgs() */
-
-static GLboolean legalFormat(GLenum format)
-{
- switch(format) {
- case GL_COLOR_INDEX:
- case GL_STENCIL_INDEX:
- case GL_DEPTH_COMPONENT:
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_RGB:
- case GL_RGBA:
- case GL_LUMINANCE:
- case GL_LUMINANCE_ALPHA:
- case GL_BGR:
- case GL_BGRA:
- return GL_TRUE;
- default:
- return GL_FALSE;
- }
-}
-
-static GLboolean legalType(GLenum type)
-{
- switch(type) {
- case GL_BITMAP:
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- return GL_TRUE;
- default:
- return GL_FALSE;
- }
-}
-
-/* */
-static GLboolean isTypePackedPixel(GLenum type)
-{
- assert(legalType(type));
-
- if (type == GL_UNSIGNED_BYTE_3_3_2 ||
- type == GL_UNSIGNED_BYTE_2_3_3_REV ||
- type == GL_UNSIGNED_SHORT_5_6_5 ||
- type == GL_UNSIGNED_SHORT_5_6_5_REV ||
- type == GL_UNSIGNED_SHORT_4_4_4_4 ||
- type == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
- type == GL_UNSIGNED_SHORT_5_5_5_1 ||
- type == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
- type == GL_UNSIGNED_INT_8_8_8_8 ||
- type == GL_UNSIGNED_INT_8_8_8_8_REV ||
- type == GL_UNSIGNED_INT_10_10_10_2 ||
- type == GL_UNSIGNED_INT_2_10_10_10_REV) {
- return 1;
- }
- else return 0;
-} /* isTypePackedPixel() */
-
-/* Determines if the packed pixel type is compatible with the format */
-static GLboolean isLegalFormatForPackedPixelType(GLenum format, GLenum type)
-{
- /* if not a packed pixel type then return true */
- if (!isTypePackedPixel(type)) {
- return GL_TRUE;
- }
-
- /* 3_3_2/2_3_3_REV & 5_6_5/5_6_5_REV are only compatible with RGB */
- if ((type == GL_UNSIGNED_BYTE_3_3_2 || type == GL_UNSIGNED_BYTE_2_3_3_REV||
- type == GL_UNSIGNED_SHORT_5_6_5|| type == GL_UNSIGNED_SHORT_5_6_5_REV)
- && format != GL_RGB)
- return GL_FALSE;
-
- /* 4_4_4_4/4_4_4_4_REV & 5_5_5_1/1_5_5_5_REV & 8_8_8_8/8_8_8_8_REV &
- * 10_10_10_2/2_10_10_10_REV are only compatible with RGBA, BGRA & ABGR_EXT.
- */
- if ((type == GL_UNSIGNED_SHORT_4_4_4_4 ||
- type == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
- type == GL_UNSIGNED_SHORT_5_5_5_1 ||
- type == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
- type == GL_UNSIGNED_INT_8_8_8_8 ||
- type == GL_UNSIGNED_INT_8_8_8_8_REV ||
- type == GL_UNSIGNED_INT_10_10_10_2 ||
- type == GL_UNSIGNED_INT_2_10_10_10_REV) &&
- (format != GL_RGBA &&
- format != GL_BGRA)) {
- return GL_FALSE;
- }
-
- return GL_TRUE;
-} /* isLegalFormatForPackedPixelType() */
-
-static GLboolean isLegalLevels(GLint userLevel,GLint baseLevel,GLint maxLevel,
- GLint totalLevels)
-{
- if (baseLevel < 0 || baseLevel < userLevel || maxLevel < baseLevel ||
- totalLevels < maxLevel)
- return GL_FALSE;
- else return GL_TRUE;
-} /* isLegalLevels() */
-
-/* Given user requested texture size, determine if it fits. If it
- * doesn't then halve both sides and make the determination again
- * until it does fit (for IR only).
- * Note that proxy textures are not implemented in RE* even though
- * they advertise the texture extension.
- * Note that proxy textures are implemented but not according to spec in
- * IMPACT*.
- */
-static void closestFit(GLenum target, GLint width, GLint height,
- GLint internalFormat, GLenum format, GLenum type,
- GLint *newWidth, GLint *newHeight)
-{
- /* Use proxy textures if OpenGL version is >= 1.1 */
- if ( (strtod((const char *)glGetString(GL_VERSION),NULL) >= 1.1)
- ) {
- GLint widthPowerOf2= nearestPower(width);
- GLint heightPowerOf2= nearestPower(height);
- GLint proxyWidth;
-
- do {
- /* compute level 1 width & height, clamping each at 1 */
- GLint widthAtLevelOne= (widthPowerOf2 > 1) ?
- widthPowerOf2 >> 1 :
- widthPowerOf2;
- GLint heightAtLevelOne= (heightPowerOf2 > 1) ?
- heightPowerOf2 >> 1 :
- heightPowerOf2;
- GLenum proxyTarget;
- assert(widthAtLevelOne > 0); assert(heightAtLevelOne > 0);
-
- /* does width x height at level 1 & all their mipmaps fit? */
- if (target == GL_TEXTURE_2D || target == GL_PROXY_TEXTURE_2D) {
- proxyTarget = GL_PROXY_TEXTURE_2D;
- glTexImage2D(proxyTarget, 1, /* must be non-zero */
- internalFormat,
- widthAtLevelOne,heightAtLevelOne,0,format,type,NULL);
- } else
-#if defined(GL_ARB_texture_cube_map)
- if ((target == GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB) ||
- (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB) ||
- (target == GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB) ||
- (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB) ||
- (target == GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB) ||
- (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)) {
- proxyTarget = GL_PROXY_TEXTURE_CUBE_MAP_ARB;
- glTexImage2D(proxyTarget, 1, /* must be non-zero */
- internalFormat,
- widthAtLevelOne,heightAtLevelOne,0,format,type,NULL);
- } else
-#endif /* GL_ARB_texture_cube_map */
- {
- assert(target == GL_TEXTURE_1D || target == GL_PROXY_TEXTURE_1D);
- proxyTarget = GL_PROXY_TEXTURE_1D;
- glTexImage1D(proxyTarget, 1, /* must be non-zero */
- internalFormat,widthAtLevelOne,0,format,type,NULL);
- }
- glGetTexLevelParameteriv(proxyTarget, 1,GL_TEXTURE_WIDTH,&proxyWidth);
- /* does it fit??? */
- if (proxyWidth == 0) { /* nope, so try again with these sizes */
- if (widthPowerOf2 == 1 && heightPowerOf2 == 1) {
- /* An 1x1 texture couldn't fit for some reason, so
- * break out. This should never happen. But things
- * happen. The disadvantage with this if-statement is
- * that we will never be aware of when this happens
- * since it will silently branch out.
- */
- goto noProxyTextures;
- }
- widthPowerOf2= widthAtLevelOne;
- heightPowerOf2= heightAtLevelOne;
- }
- /* else it does fit */
- } while (proxyWidth == 0);
- /* loop must terminate! */
-
- /* return the width & height at level 0 that fits */
- *newWidth= widthPowerOf2;
- *newHeight= heightPowerOf2;
-/*printf("Proxy Textures\n");*/
- } /* if gluCheckExtension() */
- else { /* no texture extension, so do this instead */
- GLint maxsize;
-
-noProxyTextures:
-
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize);
- /* clamp user's texture sizes to maximum sizes, if necessary */
- *newWidth = nearestPower(width);
- if (*newWidth > maxsize) *newWidth = maxsize;
- *newHeight = nearestPower(height);
- if (*newHeight > maxsize) *newHeight = maxsize;
-/*printf("NO proxy textures\n");*/
- }
-} /* closestFit() */
-
-GLint GLAPIENTRY
-gluScaleImage(GLenum format, GLsizei widthin, GLsizei heightin,
- GLenum typein, const void *datain,
- GLsizei widthout, GLsizei heightout, GLenum typeout,
- void *dataout)
-{
- int components;
- GLushort *beforeImage;
- GLushort *afterImage;
- PixelStorageModes psm;
-
- if (widthin == 0 || heightin == 0 || widthout == 0 || heightout == 0) {
- return 0;
- }
- if (widthin < 0 || heightin < 0 || widthout < 0 || heightout < 0) {
- return GLU_INVALID_VALUE;
- }
- if (!legalFormat(format) || !legalType(typein) || !legalType(typeout)) {
- return GLU_INVALID_ENUM;
- }
- if (!isLegalFormatForPackedPixelType(format, typein)) {
- return GLU_INVALID_OPERATION;
- }
- if (!isLegalFormatForPackedPixelType(format, typeout)) {
- return GLU_INVALID_OPERATION;
- }
- beforeImage =
- malloc(image_size(widthin, heightin, format, GL_UNSIGNED_SHORT));
- afterImage =
- malloc(image_size(widthout, heightout, format, GL_UNSIGNED_SHORT));
- if (beforeImage == NULL || afterImage == NULL) {
- return GLU_OUT_OF_MEMORY;
- }
-
- retrieveStoreModes(&psm);
- fill_image(&psm,widthin, heightin, format, typein, is_index(format),
- datain, beforeImage);
- components = elements_per_group(format, 0);
- scale_internal(components, widthin, heightin, beforeImage,
- widthout, heightout, afterImage);
- empty_image(&psm,widthout, heightout, format, typeout,
- is_index(format), afterImage, dataout);
- free((GLbyte *) beforeImage);
- free((GLbyte *) afterImage);
-
- return 0;
-}
-
-int gluBuild1DMipmapLevelsCore(GLenum target, GLint internalFormat,
- GLsizei width,
- GLsizei widthPowerOf2,
- GLenum format, GLenum type,
- GLint userLevel, GLint baseLevel,GLint maxLevel,
- const void *data)
-{
- GLint newwidth;
- GLint level, levels;
- GLushort *newImage;
- GLint newImage_width;
- GLushort *otherImage;
- GLushort *imageTemp;
- GLint memreq;
- GLint cmpts;
- PixelStorageModes psm;
-
- assert(checkMipmapArgs(internalFormat,format,type) == 0);
- assert(width >= 1);
-
- otherImage = NULL;
-
- newwidth= widthPowerOf2;
- levels = computeLog(newwidth);
-
- levels+= userLevel;
-
- retrieveStoreModes(&psm);
- newImage = (GLushort *)
- malloc(image_size(width, 1, format, GL_UNSIGNED_SHORT));
- newImage_width = width;
- if (newImage == NULL) {
- return GLU_OUT_OF_MEMORY;
- }
- fill_image(&psm,width, 1, format, type, is_index(format),
- data, newImage);
- cmpts = elements_per_group(format,type);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 2);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- /*
- ** If swap_bytes was set, swapping occurred in fill_image.
- */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
-
- for (level = userLevel; level <= levels; level++) {
- if (newImage_width == newwidth) {
- /* Use newImage for this level */
- if (baseLevel <= level && level <= maxLevel) {
- glTexImage1D(target, level, internalFormat, newImage_width,
- 0, format, GL_UNSIGNED_SHORT, (void *) newImage);
- }
- } else {
- if (otherImage == NULL) {
- memreq = image_size(newwidth, 1, format, GL_UNSIGNED_SHORT);
- otherImage = (GLushort *) malloc(memreq);
- if (otherImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- return GLU_OUT_OF_MEMORY;
- }
- }
- scale_internal(cmpts, newImage_width, 1, newImage,
- newwidth, 1, otherImage);
- /* Swap newImage and otherImage */
- imageTemp = otherImage;
- otherImage = newImage;
- newImage = imageTemp;
-
- newImage_width = newwidth;
- if (baseLevel <= level && level <= maxLevel) {
- glTexImage1D(target, level, internalFormat, newImage_width,
- 0, format, GL_UNSIGNED_SHORT, (void *) newImage);
- }
- }
- if (newwidth > 1) newwidth /= 2;
- }
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
-
- free((GLbyte *) newImage);
- if (otherImage) {
- free((GLbyte *) otherImage);
- }
- return 0;
-}
-
-GLint GLAPIENTRY
-gluBuild1DMipmapLevels(GLenum target, GLint internalFormat,
- GLsizei width,
- GLenum format, GLenum type,
- GLint userLevel, GLint baseLevel, GLint maxLevel,
- const void *data)
-{
- int levels;
-
- int rc= checkMipmapArgs(internalFormat,format,type);
- if (rc != 0) return rc;
-
- if (width < 1) {
- return GLU_INVALID_VALUE;
- }
-
- levels = computeLog(width);
-
- levels+= userLevel;
- if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels))
- return GLU_INVALID_VALUE;
-
- return gluBuild1DMipmapLevelsCore(target, internalFormat,
- width,
- width,format, type,
- userLevel, baseLevel, maxLevel,
- data);
-} /* gluBuild1DMipmapLevels() */
-
-GLint GLAPIENTRY
-gluBuild1DMipmaps(GLenum target, GLint internalFormat, GLsizei width,
- GLenum format, GLenum type,
- const void *data)
-{
- GLint widthPowerOf2;
- int levels;
- GLint dummy;
-
- int rc= checkMipmapArgs(internalFormat,format,type);
- if (rc != 0) return rc;
-
- if (width < 1) {
- return GLU_INVALID_VALUE;
- }
-
- closestFit(target,width,1,internalFormat,format,type,&widthPowerOf2,&dummy);
- levels = computeLog(widthPowerOf2);
-
- return gluBuild1DMipmapLevelsCore(target,internalFormat,
- width,
- widthPowerOf2,
- format,type,0,0,levels,data);
-}
-
-static int bitmapBuild2DMipmaps(GLenum target, GLint internalFormat,
- GLint width, GLint height, GLenum format,
- GLenum type, const void *data)
-{
- GLint newwidth, newheight;
- GLint level, levels;
- GLushort *newImage;
- GLint newImage_width;
- GLint newImage_height;
- GLushort *otherImage;
- GLushort *imageTemp;
- GLint memreq;
-#if 0
- GLint maxsize;
-#endif
- GLint cmpts;
- PixelStorageModes psm;
-
- retrieveStoreModes(&psm);
-
-#if 0
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize);
- newwidth = nearestPower(width);
- if (newwidth > maxsize) newwidth = maxsize;
- newheight = nearestPower(height);
- if (newheight > maxsize) newheight = maxsize;
-#else
- closestFit(target,width,height,internalFormat,format,type,
- &newwidth,&newheight);
-#endif
- levels = computeLog(newwidth);
- level = computeLog(newheight);
- if (level > levels) levels=level;
-
- otherImage = NULL;
- newImage = (GLushort *)
- malloc(image_size(width, height, format, GL_UNSIGNED_SHORT));
- newImage_width = width;
- newImage_height = height;
- if (newImage == NULL) {
- return GLU_OUT_OF_MEMORY;
- }
-
- fill_image(&psm,width, height, format, type, is_index(format),
- data, newImage);
-
- cmpts = elements_per_group(format,type);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 2);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- /*
- ** If swap_bytes was set, swapping occurred in fill_image.
- */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
-
- for (level = 0; level <= levels; level++) {
- if (newImage_width == newwidth && newImage_height == newheight) { /* Use newImage for this level */
- glTexImage2D(target, level, internalFormat, newImage_width,
- newImage_height, 0, format, GL_UNSIGNED_SHORT,
- (void *) newImage);
- } else {
- if (otherImage == NULL) {
- memreq =
- image_size(newwidth, newheight, format, GL_UNSIGNED_SHORT);
- otherImage = (GLushort *) malloc(memreq);
- if (otherImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- return GLU_OUT_OF_MEMORY;
- }
- }
- scale_internal(cmpts, newImage_width, newImage_height, newImage,
- newwidth, newheight, otherImage);
- /* Swap newImage and otherImage */
- imageTemp = otherImage;
- otherImage = newImage;
- newImage = imageTemp;
-
- newImage_width = newwidth;
- newImage_height = newheight;
- glTexImage2D(target, level, internalFormat, newImage_width,
- newImage_height, 0, format, GL_UNSIGNED_SHORT,
- (void *) newImage);
- }
- if (newwidth > 1) newwidth /= 2;
- if (newheight > 1) newheight /= 2;
- }
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
-
- free((GLbyte *) newImage);
- if (otherImage) {
- free((GLbyte *) otherImage);
- }
- return 0;
-}
-
-/* To make swapping images less error prone */
-#define __GLU_INIT_SWAP_IMAGE void *tmpImage
-#define __GLU_SWAP_IMAGE(a,b) tmpImage = a; a = b; b = tmpImage;
-
-static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat,
- GLsizei width, GLsizei height,
- GLsizei widthPowerOf2,
- GLsizei heightPowerOf2,
- GLenum format, GLenum type,
- GLint userLevel,
- GLint baseLevel,GLint maxLevel,
- const void *data)
-{
- GLint newwidth, newheight;
- GLint level, levels;
- const void *usersImage; /* passed from user. Don't touch! */
- void *srcImage, *dstImage; /* scratch area to build mipmapped images */
- __GLU_INIT_SWAP_IMAGE;
- GLint memreq;
- GLint cmpts;
-
- GLint myswap_bytes, groups_per_line, element_size, group_size;
- GLint rowsize, padding;
- PixelStorageModes psm;
-
- assert(checkMipmapArgs(internalFormat,format,type) == 0);
- assert(width >= 1 && height >= 1);
-
- if(type == GL_BITMAP) {
- return bitmapBuild2DMipmaps(target, internalFormat, width, height,
- format, type, data);
- }
-
- srcImage = dstImage = NULL;
-
- newwidth= widthPowerOf2;
- newheight= heightPowerOf2;
- levels = computeLog(newwidth);
- level = computeLog(newheight);
- if (level > levels) levels=level;
-
- levels+= userLevel;
-
- retrieveStoreModes(&psm);
- myswap_bytes = psm.unpack_swap_bytes;
- cmpts = elements_per_group(format,type);
- if (psm.unpack_row_length > 0) {
- groups_per_line = psm.unpack_row_length;
- } else {
- groups_per_line = width;
- }
-
- element_size = bytes_per_element(type);
- group_size = element_size * cmpts;
- if (element_size == 1) myswap_bytes = 0;
-
- rowsize = groups_per_line * group_size;
- padding = (rowsize % psm.unpack_alignment);
- if (padding) {
- rowsize += psm.unpack_alignment - padding;
- }
- usersImage = (const GLubyte *) data + psm.unpack_skip_rows * rowsize +
- psm.unpack_skip_pixels * group_size;
-
- glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
-
- level = userLevel;
-
- /* already power-of-two square */
- if (width == newwidth && height == newheight) {
- /* Use usersImage for level userLevel */
- if (baseLevel <= level && level <= maxLevel) {
- glTexImage2D(target, level, internalFormat, width,
- height, 0, format, type,
- usersImage);
- }
- if(levels == 0) { /* we're done. clean up and return */
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- return 0;
- }
- {
- int nextWidth= newwidth/2;
- int nextHeight= newheight/2;
-
- /* clamp to 1 */
- if (nextWidth < 1) nextWidth= 1;
- if (nextHeight < 1) nextHeight= 1;
- memreq = image_size(nextWidth, nextHeight, format, type);
- }
-
- switch(type) {
- case GL_UNSIGNED_BYTE:
- dstImage = (GLubyte *)malloc(memreq);
- break;
- case GL_BYTE:
- dstImage = (GLbyte *)malloc(memreq);
- break;
- case GL_UNSIGNED_SHORT:
- dstImage = (GLushort *)malloc(memreq);
- break;
- case GL_SHORT:
- dstImage = (GLshort *)malloc(memreq);
- break;
- case GL_UNSIGNED_INT:
- dstImage = (GLuint *)malloc(memreq);
- break;
- case GL_INT:
- dstImage = (GLint *)malloc(memreq);
- break;
- case GL_FLOAT:
- dstImage = (GLfloat *)malloc(memreq);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- dstImage = (GLubyte *)malloc(memreq);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- dstImage = (GLushort *)malloc(memreq);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- dstImage = (GLuint *)malloc(memreq);
- break;
- default:
- return GLU_INVALID_ENUM;
- }
- if (dstImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- return GLU_OUT_OF_MEMORY;
- }
- else
- switch(type) {
- case GL_UNSIGNED_BYTE:
- halveImage_ubyte(cmpts, width, height,
- (const GLubyte *)usersImage, (GLubyte *)dstImage,
- element_size, rowsize, group_size);
- break;
- case GL_BYTE:
- halveImage_byte(cmpts, width, height,
- (const GLbyte *)usersImage, (GLbyte *)dstImage,
- element_size, rowsize, group_size);
- break;
- case GL_UNSIGNED_SHORT:
- halveImage_ushort(cmpts, width, height,
- (const GLushort *)usersImage, (GLushort *)dstImage,
- element_size, rowsize, group_size, myswap_bytes);
- break;
- case GL_SHORT:
- halveImage_short(cmpts, width, height,
- (const GLshort *)usersImage, (GLshort *)dstImage,
- element_size, rowsize, group_size, myswap_bytes);
- break;
- case GL_UNSIGNED_INT:
- halveImage_uint(cmpts, width, height,
- (const GLuint *)usersImage, (GLuint *)dstImage,
- element_size, rowsize, group_size, myswap_bytes);
- break;
- case GL_INT:
- halveImage_int(cmpts, width, height,
- (const GLint *)usersImage, (GLint *)dstImage,
- element_size, rowsize, group_size, myswap_bytes);
- break;
- case GL_FLOAT:
- halveImage_float(cmpts, width, height,
- (const GLfloat *)usersImage, (GLfloat *)dstImage,
- element_size, rowsize, group_size, myswap_bytes);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- assert(format == GL_RGB);
- halveImagePackedPixel(3,extract332,shove332,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- assert(format == GL_RGB);
- halveImagePackedPixel(3,extract233rev,shove233rev,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- halveImagePackedPixel(3,extract565,shove565,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- halveImagePackedPixel(3,extract565rev,shove565rev,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- halveImagePackedPixel(4,extract4444,shove4444,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- halveImagePackedPixel(4,extract4444rev,shove4444rev,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- halveImagePackedPixel(4,extract5551,shove5551,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- halveImagePackedPixel(4,extract1555rev,shove1555rev,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- halveImagePackedPixel(4,extract8888,shove8888,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- halveImagePackedPixel(4,extract8888rev,shove8888rev,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- halveImagePackedPixel(4,extract1010102,shove1010102,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- halveImagePackedPixel(4,extract2101010rev,shove2101010rev,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- default:
- assert(0);
- break;
- }
- newwidth = width/2;
- newheight = height/2;
- /* clamp to 1 */
- if (newwidth < 1) newwidth= 1;
- if (newheight < 1) newheight= 1;
-
- myswap_bytes = 0;
- rowsize = newwidth * group_size;
- memreq = image_size(newwidth, newheight, format, type);
- /* Swap srcImage and dstImage */
- __GLU_SWAP_IMAGE(srcImage,dstImage);
- switch(type) {
- case GL_UNSIGNED_BYTE:
- dstImage = (GLubyte *)malloc(memreq);
- break;
- case GL_BYTE:
- dstImage = (GLbyte *)malloc(memreq);
- break;
- case GL_UNSIGNED_SHORT:
- dstImage = (GLushort *)malloc(memreq);
- break;
- case GL_SHORT:
- dstImage = (GLshort *)malloc(memreq);
- break;
- case GL_UNSIGNED_INT:
- dstImage = (GLuint *)malloc(memreq);
- break;
- case GL_INT:
- dstImage = (GLint *)malloc(memreq);
- break;
- case GL_FLOAT:
- dstImage = (GLfloat *)malloc(memreq);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- dstImage = (GLubyte *)malloc(memreq);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- dstImage = (GLushort *)malloc(memreq);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- dstImage = (GLuint *)malloc(memreq);
- break;
- default:
- return GLU_INVALID_ENUM;
- }
- if (dstImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- return GLU_OUT_OF_MEMORY;
- }
- /* level userLevel+1 is in srcImage; level userLevel already saved */
- level = userLevel+1;
- } else { /* user's image is *not* nice power-of-2 sized square */
- memreq = image_size(newwidth, newheight, format, type);
- switch(type) {
- case GL_UNSIGNED_BYTE:
- dstImage = (GLubyte *)malloc(memreq);
- break;
- case GL_BYTE:
- dstImage = (GLbyte *)malloc(memreq);
- break;
- case GL_UNSIGNED_SHORT:
- dstImage = (GLushort *)malloc(memreq);
- break;
- case GL_SHORT:
- dstImage = (GLshort *)malloc(memreq);
- break;
- case GL_UNSIGNED_INT:
- dstImage = (GLuint *)malloc(memreq);
- break;
- case GL_INT:
- dstImage = (GLint *)malloc(memreq);
- break;
- case GL_FLOAT:
- dstImage = (GLfloat *)malloc(memreq);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- dstImage = (GLubyte *)malloc(memreq);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- dstImage = (GLushort *)malloc(memreq);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- dstImage = (GLuint *)malloc(memreq);
- break;
- default:
- return GLU_INVALID_ENUM;
- }
-
- if (dstImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- return GLU_OUT_OF_MEMORY;
- }
-
- switch(type) {
- case GL_UNSIGNED_BYTE:
- scale_internal_ubyte(cmpts, width, height,
- (const GLubyte *)usersImage, newwidth, newheight,
- (GLubyte *)dstImage, element_size,
- rowsize, group_size);
- break;
- case GL_BYTE:
- scale_internal_byte(cmpts, width, height,
- (const GLbyte *)usersImage, newwidth, newheight,
- (GLbyte *)dstImage, element_size,
- rowsize, group_size);
- break;
- case GL_UNSIGNED_SHORT:
- scale_internal_ushort(cmpts, width, height,
- (const GLushort *)usersImage, newwidth, newheight,
- (GLushort *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_SHORT:
- scale_internal_short(cmpts, width, height,
- (const GLshort *)usersImage, newwidth, newheight,
- (GLshort *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_UNSIGNED_INT:
- scale_internal_uint(cmpts, width, height,
- (const GLuint *)usersImage, newwidth, newheight,
- (GLuint *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_INT:
- scale_internal_int(cmpts, width, height,
- (const GLint *)usersImage, newwidth, newheight,
- (GLint *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_FLOAT:
- scale_internal_float(cmpts, width, height,
- (const GLfloat *)usersImage, newwidth, newheight,
- (GLfloat *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- scaleInternalPackedPixel(3,extract332,shove332,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- scaleInternalPackedPixel(3,extract233rev,shove233rev,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- scaleInternalPackedPixel(3,extract565,shove565,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- scaleInternalPackedPixel(3,extract565rev,shove565rev,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- scaleInternalPackedPixel(4,extract4444,shove4444,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- scaleInternalPackedPixel(4,extract4444rev,shove4444rev,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- scaleInternalPackedPixel(4,extract5551,shove5551,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- scaleInternalPackedPixel(4,extract1555rev,shove1555rev,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- scaleInternalPackedPixel(4,extract8888,shove8888,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- scaleInternalPackedPixel(4,extract8888rev,shove8888rev,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- scaleInternalPackedPixel(4,extract1010102,shove1010102,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- scaleInternalPackedPixel(4,extract2101010rev,shove2101010rev,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- default:
- assert(0);
- break;
- }
- myswap_bytes = 0;
- rowsize = newwidth * group_size;
- /* Swap dstImage and srcImage */
- __GLU_SWAP_IMAGE(srcImage,dstImage);
-
- if(levels != 0) { /* use as little memory as possible */
- {
- int nextWidth= newwidth/2;
- int nextHeight= newheight/2;
- if (nextWidth < 1) nextWidth= 1;
- if (nextHeight < 1) nextHeight= 1;
-
- memreq = image_size(nextWidth, nextHeight, format, type);
- }
-
- switch(type) {
- case GL_UNSIGNED_BYTE:
- dstImage = (GLubyte *)malloc(memreq);
- break;
- case GL_BYTE:
- dstImage = (GLbyte *)malloc(memreq);
- break;
- case GL_UNSIGNED_SHORT:
- dstImage = (GLushort *)malloc(memreq);
- break;
- case GL_SHORT:
- dstImage = (GLshort *)malloc(memreq);
- break;
- case GL_UNSIGNED_INT:
- dstImage = (GLuint *)malloc(memreq);
- break;
- case GL_INT:
- dstImage = (GLint *)malloc(memreq);
- break;
- case GL_FLOAT:
- dstImage = (GLfloat *)malloc(memreq);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- dstImage = (GLubyte *)malloc(memreq);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- dstImage = (GLushort *)malloc(memreq);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- dstImage = (GLuint *)malloc(memreq);
- break;
- default:
- return GLU_INVALID_ENUM;
- }
- if (dstImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- return GLU_OUT_OF_MEMORY;
- }
- }
- /* level userLevel is in srcImage; nothing saved yet */
- level = userLevel;
- }
-
- glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
- if (baseLevel <= level && level <= maxLevel) {
- glTexImage2D(target, level, internalFormat, newwidth, newheight, 0,
- format, type, (void *)srcImage);
- }
-
- level++; /* update current level for the loop */
- for (; level <= levels; level++) {
- switch(type) {
- case GL_UNSIGNED_BYTE:
- halveImage_ubyte(cmpts, newwidth, newheight,
- (GLubyte *)srcImage, (GLubyte *)dstImage, element_size,
- rowsize, group_size);
- break;
- case GL_BYTE:
- halveImage_byte(cmpts, newwidth, newheight,
- (GLbyte *)srcImage, (GLbyte *)dstImage, element_size,
- rowsize, group_size);
- break;
- case GL_UNSIGNED_SHORT:
- halveImage_ushort(cmpts, newwidth, newheight,
- (GLushort *)srcImage, (GLushort *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_SHORT:
- halveImage_short(cmpts, newwidth, newheight,
- (GLshort *)srcImage, (GLshort *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_UNSIGNED_INT:
- halveImage_uint(cmpts, newwidth, newheight,
- (GLuint *)srcImage, (GLuint *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_INT:
- halveImage_int(cmpts, newwidth, newheight,
- (GLint *)srcImage, (GLint *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_FLOAT:
- halveImage_float(cmpts, newwidth, newheight,
- (GLfloat *)srcImage, (GLfloat *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- halveImagePackedPixel(3,extract332,shove332,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- halveImagePackedPixel(3,extract233rev,shove233rev,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- halveImagePackedPixel(3,extract565,shove565,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- halveImagePackedPixel(3,extract565rev,shove565rev,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- halveImagePackedPixel(4,extract4444,shove4444,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- halveImagePackedPixel(4,extract4444rev,shove4444rev,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- halveImagePackedPixel(4,extract5551,shove5551,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- halveImagePackedPixel(4,extract1555rev,shove1555rev,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- halveImagePackedPixel(4,extract8888,shove8888,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- halveImagePackedPixel(4,extract8888rev,shove8888rev,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- halveImagePackedPixel(4,extract1010102,shove1010102,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- halveImagePackedPixel(4,extract2101010rev,shove2101010rev,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- default:
- assert(0);
- break;
- }
-
- __GLU_SWAP_IMAGE(srcImage,dstImage);
-
- if (newwidth > 1) { newwidth /= 2; rowsize /= 2;}
- if (newheight > 1) newheight /= 2;
- {
- /* compute amount to pad per row, if any */
- int rowPad= rowsize % psm.unpack_alignment;
-
- /* should row be padded? */
- if (rowPad == 0) { /* nope, row should not be padded */
- /* call tex image with srcImage untouched since it's not padded */
- if (baseLevel <= level && level <= maxLevel) {
- glTexImage2D(target, level, internalFormat, newwidth, newheight, 0,
- format, type, (void *) srcImage);
- }
- }
- else { /* yes, row should be padded */
- /* compute length of new row in bytes, including padding */
- int newRowLength= rowsize + psm.unpack_alignment - rowPad;
- int ii; unsigned char *dstTrav, *srcTrav; /* indices for copying */
-
- /* allocate new image for mipmap of size newRowLength x newheight */
- void *newMipmapImage= malloc((size_t) (newRowLength*newheight));
- if (newMipmapImage == NULL) {
- /* out of memory so return */
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- return GLU_OUT_OF_MEMORY;
- }
-
- /* copy image from srcImage into newMipmapImage by rows */
- for (ii= 0,
- dstTrav= (unsigned char *) newMipmapImage,
- srcTrav= (unsigned char *) srcImage;
- ii< newheight;
- ii++,
- dstTrav+= newRowLength, /* make sure the correct distance... */
- srcTrav+= rowsize) { /* ...is skipped */
- memcpy(dstTrav,srcTrav,rowsize);
- /* note that the pad bytes are not visited and will contain
- * garbage, which is ok.
- */
- }
-
- /* ...and use this new image for mipmapping instead */
- if (baseLevel <= level && level <= maxLevel) {
- glTexImage2D(target, level, internalFormat, newwidth, newheight, 0,
- format, type, newMipmapImage);
- }
- free(newMipmapImage); /* don't forget to free it! */
- } /* else */
- }
- } /* for level */
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
-
- free(srcImage); /*if you get to here, a srcImage has always been malloc'ed*/
- if (dstImage) { /* if it's non-rectangular and only 1 level */
- free(dstImage);
- }
- return 0;
-} /* gluBuild2DMipmapLevelsCore() */
-
-GLint GLAPIENTRY
-gluBuild2DMipmapLevels(GLenum target, GLint internalFormat,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- GLint userLevel, GLint baseLevel, GLint maxLevel,
- const void *data)
-{
- int level, levels;
-
- int rc= checkMipmapArgs(internalFormat,format,type);
- if (rc != 0) return rc;
-
- if (width < 1 || height < 1) {
- return GLU_INVALID_VALUE;
- }
-
- levels = computeLog(width);
- level = computeLog(height);
- if (level > levels) levels=level;
-
- levels+= userLevel;
- if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels))
- return GLU_INVALID_VALUE;
-
- return gluBuild2DMipmapLevelsCore(target, internalFormat,
- width, height,
- width, height,
- format, type,
- userLevel, baseLevel, maxLevel,
- data);
-} /* gluBuild2DMipmapLevels() */
-
-GLint GLAPIENTRY
-gluBuild2DMipmaps(GLenum target, GLint internalFormat,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const void *data)
-{
- GLint widthPowerOf2, heightPowerOf2;
- int level, levels;
-
- int rc= checkMipmapArgs(internalFormat,format,type);
- if (rc != 0) return rc;
-
- if (width < 1 || height < 1) {
- return GLU_INVALID_VALUE;
- }
-
- closestFit(target,width,height,internalFormat,format,type,
- &widthPowerOf2,&heightPowerOf2);
-
- levels = computeLog(widthPowerOf2);
- level = computeLog(heightPowerOf2);
- if (level > levels) levels=level;
-
- return gluBuild2DMipmapLevelsCore(target,internalFormat,
- width, height,
- widthPowerOf2,heightPowerOf2,
- format,type,
- 0,0,levels,data);
-} /* gluBuild2DMipmaps() */
-
-#if 0
-/*
-** This routine is for the limited case in which
-** type == GL_UNSIGNED_BYTE && format != index &&
-** unpack_alignment = 1 && unpack_swap_bytes == false
-**
-** so all of the work data can be kept as ubytes instead of shorts.
-*/
-static int fastBuild2DMipmaps(const PixelStorageModes *psm,
- GLenum target, GLint components, GLint width,
- GLint height, GLenum format,
- GLenum type, void *data)
-{
- GLint newwidth, newheight;
- GLint level, levels;
- GLubyte *newImage;
- GLint newImage_width;
- GLint newImage_height;
- GLubyte *otherImage;
- GLubyte *imageTemp;
- GLint memreq;
-#if 0
- GLint maxsize;
-#endif
- GLint cmpts;
-
-
-#if 0
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize);
- newwidth = nearestPower(width);
- if (newwidth > maxsize) newwidth = maxsize;
- newheight = nearestPower(height);
- if (newheight > maxsize) newheight = maxsize;
-#else
- closestFit(target,width,height,components,format,type,
- &newwidth,&newheight);
-#endif
- levels = computeLog(newwidth);
- level = computeLog(newheight);
- if (level > levels) levels=level;
-
- cmpts = elements_per_group(format,type);
-
- otherImage = NULL;
- /**
- ** No need to copy the user data if its in the packed correctly.
- ** Make sure that later routines don't change that data.
- */
- if (psm->unpack_skip_rows == 0 && psm->unpack_skip_pixels == 0) {
- newImage = (GLubyte *)data;
- newImage_width = width;
- newImage_height = height;
- } else {
- GLint rowsize;
- GLint groups_per_line;
- GLint elements_per_line;
- const GLubyte *start;
- const GLubyte *iter;
- GLubyte *iter2;
- GLint i, j;
-
- newImage = (GLubyte *)
- malloc(image_size(width, height, format, GL_UNSIGNED_BYTE));
- newImage_width = width;
- newImage_height = height;
- if (newImage == NULL) {
- return GLU_OUT_OF_MEMORY;
- }
-
- /*
- ** Abbreviated version of fill_image for this restricted case.
- */
- if (psm->unpack_row_length > 0) {
- groups_per_line = psm->unpack_row_length;
- } else {
- groups_per_line = width;
- }
- rowsize = groups_per_line * cmpts;
- elements_per_line = width * cmpts;
- start = (const GLubyte *) data + psm->unpack_skip_rows * rowsize +
- psm->unpack_skip_pixels * cmpts;
- iter2 = newImage;
-
- for (i = 0; i < height; i++) {
- iter = start;
- for (j = 0; j < elements_per_line; j++) {
- *iter2 = *iter;
- iter++;
- iter2++;
- }
- start += rowsize;
- }
- }
-
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
-
- for (level = 0; level <= levels; level++) {
- if (newImage_width == newwidth && newImage_height == newheight) {
- /* Use newImage for this level */
- glTexImage2D(target, level, components, newImage_width,
- newImage_height, 0, format, GL_UNSIGNED_BYTE,
- (void *) newImage);
- } else {
- if (otherImage == NULL) {
- memreq =
- image_size(newwidth, newheight, format, GL_UNSIGNED_BYTE);
- otherImage = (GLubyte *) malloc(memreq);
- if (otherImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm->unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm->unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm->unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH,psm->unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES,psm->unpack_swap_bytes);
- return GLU_OUT_OF_MEMORY;
- }
- }
-/*
- scale_internal_ubyte(cmpts, newImage_width, newImage_height,
- newImage, newwidth, newheight, otherImage);
-*/
- /* Swap newImage and otherImage */
- imageTemp = otherImage;
- otherImage = newImage;
- newImage = imageTemp;
-
- newImage_width = newwidth;
- newImage_height = newheight;
- glTexImage2D(target, level, components, newImage_width,
- newImage_height, 0, format, GL_UNSIGNED_BYTE,
- (void *) newImage);
- }
- if (newwidth > 1) newwidth /= 2;
- if (newheight > 1) newheight /= 2;
- }
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm->unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm->unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm->unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm->unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm->unpack_swap_bytes);
-
- if (newImage != (const GLubyte *)data) {
- free((GLbyte *) newImage);
- }
- if (otherImage && otherImage != (const GLubyte *)data) {
- free((GLbyte *) otherImage);
- }
- return 0;
-}
-#endif
-
-/*
- * Utility Routines
- */
-static GLint elements_per_group(GLenum format, GLenum type)
-{
- /*
- * Return the number of elements per group of a specified format
- */
-
- /* If the type is packedpixels then answer is 1 (ignore format) */
- if (type == GL_UNSIGNED_BYTE_3_3_2 ||
- type == GL_UNSIGNED_BYTE_2_3_3_REV ||
- type == GL_UNSIGNED_SHORT_5_6_5 ||
- type == GL_UNSIGNED_SHORT_5_6_5_REV ||
- type == GL_UNSIGNED_SHORT_4_4_4_4 ||
- type == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
- type == GL_UNSIGNED_SHORT_5_5_5_1 ||
- type == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
- type == GL_UNSIGNED_INT_8_8_8_8 ||
- type == GL_UNSIGNED_INT_8_8_8_8_REV ||
- type == GL_UNSIGNED_INT_10_10_10_2 ||
- type == GL_UNSIGNED_INT_2_10_10_10_REV) {
- return 1;
- }
-
- /* Types are not packed pixels, so get elements per group */
- switch(format) {
- case GL_RGB:
- case GL_BGR:
- return 3;
- case GL_LUMINANCE_ALPHA:
- return 2;
- case GL_RGBA:
- case GL_BGRA:
- return 4;
- default:
- return 1;
- }
-}
-
-static GLfloat bytes_per_element(GLenum type)
-{
- /*
- * Return the number of bytes per element, based on the element type
- */
- switch(type) {
- case GL_BITMAP:
- return 1.0 / 8.0;
- case GL_UNSIGNED_SHORT:
- return(sizeof(GLushort));
- case GL_SHORT:
- return(sizeof(GLshort));
- case GL_UNSIGNED_BYTE:
- return(sizeof(GLubyte));
- case GL_BYTE:
- return(sizeof(GLbyte));
- case GL_INT:
- return(sizeof(GLint));
- case GL_UNSIGNED_INT:
- return(sizeof(GLuint));
- case GL_FLOAT:
- return(sizeof(GLfloat));
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- return(sizeof(GLubyte));
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- return(sizeof(GLushort));
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- return(sizeof(GLuint));
- default:
- return 4;
- }
-}
-
-static GLint is_index(GLenum format)
-{
- return format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX;
-}
-
-/*
-** Compute memory required for internal packed array of data of given type
-** and format.
-*/
-static GLint image_size(GLint width, GLint height, GLenum format, GLenum type)
-{
- int bytes_per_row;
- int components;
-
-assert(width > 0);
-assert(height > 0);
- components = elements_per_group(format,type);
- if (type == GL_BITMAP) {
- bytes_per_row = (width + 7) / 8;
- } else {
- bytes_per_row = bytes_per_element(type) * width;
- }
- return bytes_per_row * height * components;
-}
-
-/*
-** Extract array from user's data applying all pixel store modes.
-** The internal format used is an array of unsigned shorts.
-*/
-static void fill_image(const PixelStorageModes *psm,
- GLint width, GLint height, GLenum format,
- GLenum type, GLboolean index_format,
- const void *userdata, GLushort *newimage)
-{
- GLint components;
- GLint element_size;
- GLint rowsize;
- GLint padding;
- GLint groups_per_line;
- GLint group_size;
- GLint elements_per_line;
- const GLubyte *start;
- const GLubyte *iter;
- GLushort *iter2;
- GLint i, j, k;
- GLint myswap_bytes;
-
- myswap_bytes = psm->unpack_swap_bytes;
- components = elements_per_group(format,type);
- if (psm->unpack_row_length > 0) {
- groups_per_line = psm->unpack_row_length;
- } else {
- groups_per_line = width;
- }
-
- /* All formats except GL_BITMAP fall out trivially */
- if (type == GL_BITMAP) {
- GLint bit_offset;
- GLint current_bit;
-
- rowsize = (groups_per_line * components + 7) / 8;
- padding = (rowsize % psm->unpack_alignment);
- if (padding) {
- rowsize += psm->unpack_alignment - padding;
- }
- start = (const GLubyte *) userdata + psm->unpack_skip_rows * rowsize +
- (psm->unpack_skip_pixels * components / 8);
- elements_per_line = width * components;
- iter2 = newimage;
- for (i = 0; i < height; i++) {
- iter = start;
- bit_offset = (psm->unpack_skip_pixels * components) % 8;
- for (j = 0; j < elements_per_line; j++) {
- /* Retrieve bit */
- if (psm->unpack_lsb_first) {
- current_bit = iter[0] & (1 << bit_offset);
- } else {
- current_bit = iter[0] & (1 << (7 - bit_offset));
- }
- if (current_bit) {
- if (index_format) {
- *iter2 = 1;
- } else {
- *iter2 = 65535;
- }
- } else {
- *iter2 = 0;
- }
- bit_offset++;
- if (bit_offset == 8) {
- bit_offset = 0;
- iter++;
- }
- iter2++;
- }
- start += rowsize;
- }
- } else {
- element_size = bytes_per_element(type);
- group_size = element_size * components;
- if (element_size == 1) myswap_bytes = 0;
-
- rowsize = groups_per_line * group_size;
- padding = (rowsize % psm->unpack_alignment);
- if (padding) {
- rowsize += psm->unpack_alignment - padding;
- }
- start = (const GLubyte *) userdata + psm->unpack_skip_rows * rowsize +
- psm->unpack_skip_pixels * group_size;
- elements_per_line = width * components;
-
- iter2 = newimage;
- for (i = 0; i < height; i++) {
- iter = start;
- for (j = 0; j < elements_per_line; j++) {
- Type_Widget widget;
- float extractComponents[4];
-
- switch(type) {
- case GL_UNSIGNED_BYTE_3_3_2:
- extract332(0,iter,extractComponents);
- for (k = 0; k < 3; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- extract233rev(0,iter,extractComponents);
- for (k = 0; k < 3; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_BYTE:
- if (index_format) {
- *iter2++ = *iter;
- } else {
- *iter2++ = (*iter) * 257;
- }
- break;
- case GL_BYTE:
- if (index_format) {
- *iter2++ = *((const GLbyte *) iter);
- } else {
- /* rough approx */
- *iter2++ = (*((const GLbyte *) iter)) * 516;
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- extract565(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 3; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- extract565rev(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 3; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- extract4444(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- extract4444rev(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- extract5551(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- extract1555rev(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT:
- case GL_SHORT:
- if (myswap_bytes) {
- widget.ub[0] = iter[1];
- widget.ub[1] = iter[0];
- } else {
- widget.ub[0] = iter[0];
- widget.ub[1] = iter[1];
- }
- if (type == GL_SHORT) {
- if (index_format) {
- *iter2++ = widget.s[0];
- } else {
- /* rough approx */
- *iter2++ = widget.s[0]*2;
- }
- } else {
- *iter2++ = widget.us[0];
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- extract8888(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- extract8888rev(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- extract1010102(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- extract2101010rev(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- if (myswap_bytes) {
- widget.ub[0] = iter[3];
- widget.ub[1] = iter[2];
- widget.ub[2] = iter[1];
- widget.ub[3] = iter[0];
- } else {
- widget.ub[0] = iter[0];
- widget.ub[1] = iter[1];
- widget.ub[2] = iter[2];
- widget.ub[3] = iter[3];
- }
- if (type == GL_FLOAT) {
- if (index_format) {
- *iter2++ = widget.f;
- } else {
- *iter2++ = 65535 * widget.f;
- }
- } else if (type == GL_UNSIGNED_INT) {
- if (index_format) {
- *iter2++ = widget.ui;
- } else {
- *iter2++ = widget.ui >> 16;
- }
- } else {
- if (index_format) {
- *iter2++ = widget.i;
- } else {
- *iter2++ = widget.i >> 15;
- }
- }
- break;
- }
- iter += element_size;
- } /* for j */
- start += rowsize;
-#if 1
- /* want 'iter' pointing at start, not within, row for assertion
- * purposes
- */
- iter= start;
-#endif
- } /* for i */
-
- /* iterators should be one byte past end */
- if (!isTypePackedPixel(type)) {
- assert(iter2 == &newimage[width*height*components]);
- }
- else {
- assert(iter2 == &newimage[width*height*
- elements_per_group(format,0)]);
- }
- assert( iter == &((const GLubyte *)userdata)[rowsize*height +
- psm->unpack_skip_rows * rowsize +
- psm->unpack_skip_pixels * group_size] );
-
- } /* else */
-} /* fill_image() */
-
-/*
-** Insert array into user's data applying all pixel store modes.
-** The internal format is an array of unsigned shorts.
-** empty_image() because it is the opposite of fill_image().
-*/
-static void empty_image(const PixelStorageModes *psm,
- GLint width, GLint height, GLenum format,
- GLenum type, GLboolean index_format,
- const GLushort *oldimage, void *userdata)
-{
- GLint components;
- GLint element_size;
- GLint rowsize;
- GLint padding;
- GLint groups_per_line;
- GLint group_size;
- GLint elements_per_line;
- GLubyte *start;
- GLubyte *iter;
- const GLushort *iter2;
- GLint i, j, k;
- GLint myswap_bytes;
-
- myswap_bytes = psm->pack_swap_bytes;
- components = elements_per_group(format,type);
- if (psm->pack_row_length > 0) {
- groups_per_line = psm->pack_row_length;
- } else {
- groups_per_line = width;
- }
-
- /* All formats except GL_BITMAP fall out trivially */
- if (type == GL_BITMAP) {
- GLint bit_offset;
- GLint current_bit;
-
- rowsize = (groups_per_line * components + 7) / 8;
- padding = (rowsize % psm->pack_alignment);
- if (padding) {
- rowsize += psm->pack_alignment - padding;
- }
- start = (GLubyte *) userdata + psm->pack_skip_rows * rowsize +
- (psm->pack_skip_pixels * components / 8);
- elements_per_line = width * components;
- iter2 = oldimage;
- for (i = 0; i < height; i++) {
- iter = start;
- bit_offset = (psm->pack_skip_pixels * components) % 8;
- for (j = 0; j < elements_per_line; j++) {
- if (index_format) {
- current_bit = iter2[0] & 1;
- } else {
- if (iter2[0] > 32767) {
- current_bit = 1;
- } else {
- current_bit = 0;
- }
- }
-
- if (current_bit) {
- if (psm->pack_lsb_first) {
- *iter |= (1 << bit_offset);
- } else {
- *iter |= (1 << (7 - bit_offset));
- }
- } else {
- if (psm->pack_lsb_first) {
- *iter &= ~(1 << bit_offset);
- } else {
- *iter &= ~(1 << (7 - bit_offset));
- }
- }
-
- bit_offset++;
- if (bit_offset == 8) {
- bit_offset = 0;
- iter++;
- }
- iter2++;
- }
- start += rowsize;
- }
- } else {
- float shoveComponents[4];
-
- element_size = bytes_per_element(type);
- group_size = element_size * components;
- if (element_size == 1) myswap_bytes = 0;
-
- rowsize = groups_per_line * group_size;
- padding = (rowsize % psm->pack_alignment);
- if (padding) {
- rowsize += psm->pack_alignment - padding;
- }
- start = (GLubyte *) userdata + psm->pack_skip_rows * rowsize +
- psm->pack_skip_pixels * group_size;
- elements_per_line = width * components;
-
- iter2 = oldimage;
- for (i = 0; i < height; i++) {
- iter = start;
- for (j = 0; j < elements_per_line; j++) {
- Type_Widget widget;
-
- switch(type) {
- case GL_UNSIGNED_BYTE_3_3_2:
- for (k = 0; k < 3; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove332(shoveComponents,0,(void *)iter);
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- for (k = 0; k < 3; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove233rev(shoveComponents,0,(void *)iter);
- break;
- case GL_UNSIGNED_BYTE:
- if (index_format) {
- *iter = *iter2++;
- } else {
- *iter = *iter2++ >> 8;
- }
- break;
- case GL_BYTE:
- if (index_format) {
- *((GLbyte *) iter) = *iter2++;
- } else {
- *((GLbyte *) iter) = *iter2++ >> 9;
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- for (k = 0; k < 3; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove565(shoveComponents,0,(void *)&widget.us[0]);
- if (myswap_bytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- }
- else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- for (k = 0; k < 3; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove565rev(shoveComponents,0,(void *)&widget.us[0]);
- if (myswap_bytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- }
- else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove4444(shoveComponents,0,(void *)&widget.us[0]);
- if (myswap_bytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove4444rev(shoveComponents,0,(void *)&widget.us[0]);
- if (myswap_bytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove5551(shoveComponents,0,(void *)&widget.us[0]);
- if (myswap_bytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove1555rev(shoveComponents,0,(void *)&widget.us[0]);
- if (myswap_bytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT:
- case GL_SHORT:
- if (type == GL_SHORT) {
- if (index_format) {
- widget.s[0] = *iter2++;
- } else {
- widget.s[0] = *iter2++ >> 1;
- }
- } else {
- widget.us[0] = *iter2++;
- }
- if (myswap_bytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- iter[0] = widget.ub[0];
- iter[1] = widget.ub[1];
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove8888(shoveComponents,0,(void *)&widget.ui);
- if (myswap_bytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- *(GLuint *)iter= widget.ui;
- }
-
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove8888rev(shoveComponents,0,(void *)&widget.ui);
- if (myswap_bytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- *(GLuint *)iter= widget.ui;
- }
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove1010102(shoveComponents,0,(void *)&widget.ui);
- if (myswap_bytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- *(GLuint *)iter= widget.ui;
- }
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove2101010rev(shoveComponents,0,(void *)&widget.ui);
- if (myswap_bytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- *(GLuint *)iter= widget.ui;
- }
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- if (type == GL_FLOAT) {
- if (index_format) {
- widget.f = *iter2++;
- } else {
- widget.f = *iter2++ / (float) 65535.0;
- }
- } else if (type == GL_UNSIGNED_INT) {
- if (index_format) {
- widget.ui = *iter2++;
- } else {
- widget.ui = (unsigned int) *iter2++ * 65537;
- }
- } else {
- if (index_format) {
- widget.i = *iter2++;
- } else {
- widget.i = ((unsigned int) *iter2++ * 65537)/2;
- }
- }
- if (myswap_bytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- iter[0] = widget.ub[0];
- iter[1] = widget.ub[1];
- iter[2] = widget.ub[2];
- iter[3] = widget.ub[3];
- }
- break;
- }
- iter += element_size;
- } /* for j */
- start += rowsize;
-#if 1
- /* want 'iter' pointing at start, not within, row for assertion
- * purposes
- */
- iter= start;
-#endif
- } /* for i */
-
- /* iterators should be one byte past end */
- if (!isTypePackedPixel(type)) {
- assert(iter2 == &oldimage[width*height*components]);
- }
- else {
- assert(iter2 == &oldimage[width*height*
- elements_per_group(format,0)]);
- }
- assert( iter == &((GLubyte *)userdata)[rowsize*height +
- psm->pack_skip_rows * rowsize +
- psm->pack_skip_pixels * group_size] );
-
- } /* else */
-} /* empty_image() */
-
-/*--------------------------------------------------------------------------
- * Decimation of packed pixel types
- *--------------------------------------------------------------------------
- */
-static void extract332(int isSwap,
- const void *packedPixel, GLfloat extractComponents[])
-{
- GLubyte ubyte= *(const GLubyte *)packedPixel;
-
- isSwap= isSwap; /* turn off warnings */
-
- /* 11100000 == 0xe0 */
- /* 00011100 == 0x1c */
- /* 00000011 == 0x03 */
-
- extractComponents[0]= (float)((ubyte & 0xe0) >> 5) / 7.0;
- extractComponents[1]= (float)((ubyte & 0x1c) >> 2) / 7.0; /* 7 = 2^3-1 */
- extractComponents[2]= (float)((ubyte & 0x03) ) / 3.0; /* 3 = 2^2-1 */
-} /* extract332() */
-
-static void shove332(const GLfloat shoveComponents[],
- int index, void *packedPixel)
-{
- /* 11100000 == 0xe0 */
- /* 00011100 == 0x1c */
- /* 00000011 == 0x03 */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLubyte *)packedPixel)[index] =
- ((GLubyte)((shoveComponents[0] * 7)+0.5) << 5) & 0xe0;
- ((GLubyte *)packedPixel)[index] |=
- ((GLubyte)((shoveComponents[1] * 7)+0.5) << 2) & 0x1c;
- ((GLubyte *)packedPixel)[index] |=
- ((GLubyte)((shoveComponents[2] * 3)+0.5) ) & 0x03;
-} /* shove332() */
-
-static void extract233rev(int isSwap,
- const void *packedPixel, GLfloat extractComponents[])
-{
- GLubyte ubyte= *(const GLubyte *)packedPixel;
-
- isSwap= isSwap; /* turn off warnings */
-
- /* 0000,0111 == 0x07 */
- /* 0011,1000 == 0x38 */
- /* 1100,0000 == 0xC0 */
-
- extractComponents[0]= (float)((ubyte & 0x07) ) / 7.0;
- extractComponents[1]= (float)((ubyte & 0x38) >> 3) / 7.0;
- extractComponents[2]= (float)((ubyte & 0xC0) >> 6) / 3.0;
-} /* extract233rev() */
-
-static void shove233rev(const GLfloat shoveComponents[],
- int index, void *packedPixel)
-{
- /* 0000,0111 == 0x07 */
- /* 0011,1000 == 0x38 */
- /* 1100,0000 == 0xC0 */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLubyte *)packedPixel)[index] =
- ((GLubyte)((shoveComponents[0] * 7.0)+0.5) ) & 0x07;
- ((GLubyte *)packedPixel)[index]|=
- ((GLubyte)((shoveComponents[1] * 7.0)+0.5) << 3) & 0x38;
- ((GLubyte *)packedPixel)[index]|=
- ((GLubyte)((shoveComponents[2] * 3.0)+0.5) << 6) & 0xC0;
-} /* shove233rev() */
-
-static void extract565(int isSwap,
- const void *packedPixel, GLfloat extractComponents[])
-{
- GLushort ushort= *(const GLushort *)packedPixel;
-
- if (isSwap) {
- ushort= __GLU_SWAP_2_BYTES(packedPixel);
- }
- else {
- ushort= *(const GLushort *)packedPixel;
- }
-
- /* 11111000,00000000 == 0xf800 */
- /* 00000111,11100000 == 0x07e0 */
- /* 00000000,00011111 == 0x001f */
-
- extractComponents[0]=(float)((ushort & 0xf800) >> 11) / 31.0;/* 31 = 2^5-1*/
- extractComponents[1]=(float)((ushort & 0x07e0) >> 5) / 63.0;/* 63 = 2^6-1*/
- extractComponents[2]=(float)((ushort & 0x001f) ) / 31.0;
-} /* extract565() */
-
-static void shove565(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- /* 11111000,00000000 == 0xf800 */
- /* 00000111,11100000 == 0x07e0 */
- /* 00000000,00011111 == 0x001f */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLushort *)packedPixel)[index] =
- ((GLushort)((shoveComponents[0] * 31)+0.5) << 11) & 0xf800;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[1] * 63)+0.5) << 5) & 0x07e0;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[2] * 31)+0.5) ) & 0x001f;
-} /* shove565() */
-
-static void extract565rev(int isSwap,
- const void *packedPixel, GLfloat extractComponents[])
-{
- GLushort ushort= *(const GLushort *)packedPixel;
-
- if (isSwap) {
- ushort= __GLU_SWAP_2_BYTES(packedPixel);
- }
- else {
- ushort= *(const GLushort *)packedPixel;
- }
-
- /* 00000000,00011111 == 0x001f */
- /* 00000111,11100000 == 0x07e0 */
- /* 11111000,00000000 == 0xf800 */
-
- extractComponents[0]= (float)((ushort & 0x001F) ) / 31.0;
- extractComponents[1]= (float)((ushort & 0x07E0) >> 5) / 63.0;
- extractComponents[2]= (float)((ushort & 0xF800) >> 11) / 31.0;
-} /* extract565rev() */
-
-static void shove565rev(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- /* 00000000,00011111 == 0x001f */
- /* 00000111,11100000 == 0x07e0 */
- /* 11111000,00000000 == 0xf800 */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLushort *)packedPixel)[index] =
- ((GLushort)((shoveComponents[0] * 31.0)+0.5) ) & 0x001F;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[1] * 63.0)+0.5) << 5) & 0x07E0;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[2] * 31.0)+0.5) << 11) & 0xF800;
-} /* shove565rev() */
-
-static void extract4444(int isSwap,const void *packedPixel,
- GLfloat extractComponents[])
-{
- GLushort ushort;
-
- if (isSwap) {
- ushort= __GLU_SWAP_2_BYTES(packedPixel);
- }
- else {
- ushort= *(const GLushort *)packedPixel;
- }
-
- /* 11110000,00000000 == 0xf000 */
- /* 00001111,00000000 == 0x0f00 */
- /* 00000000,11110000 == 0x00f0 */
- /* 00000000,00001111 == 0x000f */
-
- extractComponents[0]= (float)((ushort & 0xf000) >> 12) / 15.0;/* 15=2^4-1 */
- extractComponents[1]= (float)((ushort & 0x0f00) >> 8) / 15.0;
- extractComponents[2]= (float)((ushort & 0x00f0) >> 4) / 15.0;
- extractComponents[3]= (float)((ushort & 0x000f) ) / 15.0;
-} /* extract4444() */
-
-static void shove4444(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
- assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLushort *)packedPixel)[index] =
- ((GLushort)((shoveComponents[0] * 15)+0.5) << 12) & 0xf000;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[1] * 15)+0.5) << 8) & 0x0f00;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[2] * 15)+0.5) << 4) & 0x00f0;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[3] * 15)+0.5) ) & 0x000f;
-} /* shove4444() */
-
-static void extract4444rev(int isSwap,const void *packedPixel,
- GLfloat extractComponents[])
-{
- GLushort ushort;
-
- if (isSwap) {
- ushort= __GLU_SWAP_2_BYTES(packedPixel);
- }
- else {
- ushort= *(const GLushort *)packedPixel;
- }
-
- /* 00000000,00001111 == 0x000f */
- /* 00000000,11110000 == 0x00f0 */
- /* 00001111,00000000 == 0x0f00 */
- /* 11110000,00000000 == 0xf000 */
-
- /* 15 = 2^4-1 */
- extractComponents[0]= (float)((ushort & 0x000F) ) / 15.0;
- extractComponents[1]= (float)((ushort & 0x00F0) >> 4) / 15.0;
- extractComponents[2]= (float)((ushort & 0x0F00) >> 8) / 15.0;
- extractComponents[3]= (float)((ushort & 0xF000) >> 12) / 15.0;
-} /* extract4444rev() */
-
-static void shove4444rev(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- /* 00000000,00001111 == 0x000f */
- /* 00000000,11110000 == 0x00f0 */
- /* 00001111,00000000 == 0x0f00 */
- /* 11110000,00000000 == 0xf000 */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
- assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLushort *)packedPixel)[index] =
- ((GLushort)((shoveComponents[0] * 15)+0.5) ) & 0x000F;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[1] * 15)+0.5) << 4) & 0x00F0;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[2] * 15)+0.5) << 8) & 0x0F00;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[3] * 15)+0.5) << 12) & 0xF000;
-} /* shove4444rev() */
-
-static void extract5551(int isSwap,const void *packedPixel,
- GLfloat extractComponents[])
-{
- GLushort ushort;
-
- if (isSwap) {
- ushort= __GLU_SWAP_2_BYTES(packedPixel);
- }
- else {
- ushort= *(const GLushort *)packedPixel;
- }
-
- /* 11111000,00000000 == 0xf800 */
- /* 00000111,11000000 == 0x07c0 */
- /* 00000000,00111110 == 0x003e */
- /* 00000000,00000001 == 0x0001 */
-
- extractComponents[0]=(float)((ushort & 0xf800) >> 11) / 31.0;/* 31 = 2^5-1*/
- extractComponents[1]=(float)((ushort & 0x07c0) >> 6) / 31.0;
- extractComponents[2]=(float)((ushort & 0x003e) >> 1) / 31.0;
- extractComponents[3]=(float)((ushort & 0x0001) );
-} /* extract5551() */
-
-static void shove5551(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- /* 11111000,00000000 == 0xf800 */
- /* 00000111,11000000 == 0x07c0 */
- /* 00000000,00111110 == 0x003e */
- /* 00000000,00000001 == 0x0001 */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
- assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLushort *)packedPixel)[index] =
- ((GLushort)((shoveComponents[0] * 31)+0.5) << 11) & 0xf800;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[1] * 31)+0.5) << 6) & 0x07c0;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[2] * 31)+0.5) << 1) & 0x003e;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[3])+0.5) ) & 0x0001;
-} /* shove5551() */
-
-static void extract1555rev(int isSwap,const void *packedPixel,
- GLfloat extractComponents[])
-{
- GLushort ushort;
-
- if (isSwap) {
- ushort= __GLU_SWAP_2_BYTES(packedPixel);
- }
- else {
- ushort= *(const GLushort *)packedPixel;
- }
-
- /* 00000000,00011111 == 0x001F */
- /* 00000011,11100000 == 0x03E0 */
- /* 01111100,00000000 == 0x7C00 */
- /* 10000000,00000000 == 0x8000 */
-
- /* 31 = 2^5-1 */
- extractComponents[0]= (float)((ushort & 0x001F) ) / 31.0;
- extractComponents[1]= (float)((ushort & 0x03E0) >> 5) / 31.0;
- extractComponents[2]= (float)((ushort & 0x7C00) >> 10) / 31.0;
- extractComponents[3]= (float)((ushort & 0x8000) >> 15);
-} /* extract1555rev() */
-
-static void shove1555rev(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- /* 00000000,00011111 == 0x001F */
- /* 00000011,11100000 == 0x03E0 */
- /* 01111100,00000000 == 0x7C00 */
- /* 10000000,00000000 == 0x8000 */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
- assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLushort *)packedPixel)[index] =
- ((GLushort)((shoveComponents[0] * 31)+0.5) ) & 0x001F;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[1] * 31)+0.5) << 5) & 0x03E0;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[2] * 31)+0.5) << 10) & 0x7C00;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[3])+0.5) << 15) & 0x8000;
-} /* shove1555rev() */
-
-static void extract8888(int isSwap,
- const void *packedPixel, GLfloat extractComponents[])
-{
- GLuint uint;
-
- if (isSwap) {
- uint= __GLU_SWAP_4_BYTES(packedPixel);
- }
- else {
- uint= *(const GLuint *)packedPixel;
- }
-
- /* 11111111,00000000,00000000,00000000 == 0xff000000 */
- /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */
- /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */
- /* 00000000,00000000,00000000,11111111 == 0x000000ff */
-
- /* 255 = 2^8-1 */
- extractComponents[0]= (float)((uint & 0xff000000) >> 24) / 255.0;
- extractComponents[1]= (float)((uint & 0x00ff0000) >> 16) / 255.0;
- extractComponents[2]= (float)((uint & 0x0000ff00) >> 8) / 255.0;
- extractComponents[3]= (float)((uint & 0x000000ff) ) / 255.0;
-} /* extract8888() */
-
-static void shove8888(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- /* 11111111,00000000,00000000,00000000 == 0xff000000 */
- /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */
- /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */
- /* 00000000,00000000,00000000,11111111 == 0x000000ff */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
- assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLuint *)packedPixel)[index] =
- ((GLuint)((shoveComponents[0] * 255)+0.5) << 24) & 0xff000000;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[1] * 255)+0.5) << 16) & 0x00ff0000;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[2] * 255)+0.5) << 8) & 0x0000ff00;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[3] * 255)+0.5) ) & 0x000000ff;
-} /* shove8888() */
-
-static void extract8888rev(int isSwap,
- const void *packedPixel,GLfloat extractComponents[])
-{
- GLuint uint;
-
- if (isSwap) {
- uint= __GLU_SWAP_4_BYTES(packedPixel);
- }
- else {
- uint= *(const GLuint *)packedPixel;
- }
-
- /* 00000000,00000000,00000000,11111111 == 0x000000ff */
- /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */
- /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */
- /* 11111111,00000000,00000000,00000000 == 0xff000000 */
-
- /* 255 = 2^8-1 */
- extractComponents[0]= (float)((uint & 0x000000FF) ) / 255.0;
- extractComponents[1]= (float)((uint & 0x0000FF00) >> 8) / 255.0;
- extractComponents[2]= (float)((uint & 0x00FF0000) >> 16) / 255.0;
- extractComponents[3]= (float)((uint & 0xFF000000) >> 24) / 255.0;
-} /* extract8888rev() */
-
-static void shove8888rev(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- /* 00000000,00000000,00000000,11111111 == 0x000000ff */
- /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */
- /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */
- /* 11111111,00000000,00000000,00000000 == 0xff000000 */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
- assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLuint *)packedPixel)[index] =
- ((GLuint)((shoveComponents[0] * 255)+0.5) ) & 0x000000FF;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[1] * 255)+0.5) << 8) & 0x0000FF00;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[2] * 255)+0.5) << 16) & 0x00FF0000;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[3] * 255)+0.5) << 24) & 0xFF000000;
-} /* shove8888rev() */
-
-static void extract1010102(int isSwap,
- const void *packedPixel,GLfloat extractComponents[])
-{
- GLuint uint;
-
- if (isSwap) {
- uint= __GLU_SWAP_4_BYTES(packedPixel);
- }
- else {
- uint= *(const GLuint *)packedPixel;
- }
-
- /* 11111111,11000000,00000000,00000000 == 0xffc00000 */
- /* 00000000,00111111,11110000,00000000 == 0x003ff000 */
- /* 00000000,00000000,00001111,11111100 == 0x00000ffc */
- /* 00000000,00000000,00000000,00000011 == 0x00000003 */
-
- /* 1023 = 2^10-1 */
- extractComponents[0]= (float)((uint & 0xffc00000) >> 22) / 1023.0;
- extractComponents[1]= (float)((uint & 0x003ff000) >> 12) / 1023.0;
- extractComponents[2]= (float)((uint & 0x00000ffc) >> 2) / 1023.0;
- extractComponents[3]= (float)((uint & 0x00000003) ) / 3.0;
-} /* extract1010102() */
-
-static void shove1010102(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- /* 11111111,11000000,00000000,00000000 == 0xffc00000 */
- /* 00000000,00111111,11110000,00000000 == 0x003ff000 */
- /* 00000000,00000000,00001111,11111100 == 0x00000ffc */
- /* 00000000,00000000,00000000,00000011 == 0x00000003 */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
- assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLuint *)packedPixel)[index] =
- ((GLuint)((shoveComponents[0] * 1023)+0.5) << 22) & 0xffc00000;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[1] * 1023)+0.5) << 12) & 0x003ff000;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[2] * 1023)+0.5) << 2) & 0x00000ffc;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[3] * 3)+0.5) ) & 0x00000003;
-} /* shove1010102() */
-
-static void extract2101010rev(int isSwap,
- const void *packedPixel,
- GLfloat extractComponents[])
-{
- GLuint uint;
-
- if (isSwap) {
- uint= __GLU_SWAP_4_BYTES(packedPixel);
- }
- else {
- uint= *(const GLuint *)packedPixel;
- }
-
- /* 00000000,00000000,00000011,11111111 == 0x000003FF */
- /* 00000000,00001111,11111100,00000000 == 0x000FFC00 */
- /* 00111111,11110000,00000000,00000000 == 0x3FF00000 */
- /* 11000000,00000000,00000000,00000000 == 0xC0000000 */
-
- /* 1023 = 2^10-1 */
- extractComponents[0]= (float)((uint & 0x000003FF) ) / 1023.0;
- extractComponents[1]= (float)((uint & 0x000FFC00) >> 10) / 1023.0;
- extractComponents[2]= (float)((uint & 0x3FF00000) >> 20) / 1023.0;
- extractComponents[3]= (float)((uint & 0xC0000000) >> 30) / 3.0;
- /* 3 = 2^2-1 */
-} /* extract2101010rev() */
-
-static void shove2101010rev(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- /* 00000000,00000000,00000011,11111111 == 0x000003FF */
- /* 00000000,00001111,11111100,00000000 == 0x000FFC00 */
- /* 00111111,11110000,00000000,00000000 == 0x3FF00000 */
- /* 11000000,00000000,00000000,00000000 == 0xC0000000 */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
- assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLuint *)packedPixel)[index] =
- ((GLuint)((shoveComponents[0] * 1023)+0.5) ) & 0x000003FF;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[1] * 1023)+0.5) << 10) & 0x000FFC00;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[2] * 1023)+0.5) << 20) & 0x3FF00000;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[3] * 3)+0.5) << 30) & 0xC0000000;
-} /* shove2101010rev() */
-
-static void scaleInternalPackedPixel(int components,
- void (*extractPackedPixel)
- (int, const void *,GLfloat []),
- void (*shovePackedPixel)
- (const GLfloat [], int, void *),
- GLint widthIn,GLint heightIn,
- const void *dataIn,
- GLint widthOut,GLint heightOut,
- void *dataOut,
- GLint pixelSizeInBytes,
- GLint rowSizeInBytes,GLint isSwap)
-{
- float convx;
- float convy;
- float percent;
-
- /* Max components in a format is 4, so... */
- float totals[4];
- float extractTotals[4], extractMoreTotals[4], shoveTotals[4];
-
- float area;
- int i,j,k,xindex;
-
- const char *temp, *temp0;
-#if 0
- const char *temp_index;
-#endif
- int outindex;
-
- int lowx_int, highx_int, lowy_int, highy_int;
- float x_percent, y_percent;
- float lowx_float, highx_float, lowy_float, highy_float;
- float convy_float, convx_float;
- int convy_int, convx_int;
- int l, m;
- const char *left, *right;
-
- if (widthIn == widthOut*2 && heightIn == heightOut*2) {
- halveImagePackedPixel(components,extractPackedPixel,shovePackedPixel,
- widthIn, heightIn, dataIn, dataOut,
- pixelSizeInBytes,rowSizeInBytes,isSwap);
- return;
- }
- convy = (float) heightIn/heightOut;
- convx = (float) widthIn/widthOut;
- convy_int = floor(convy);
- convy_float = convy - convy_int;
- convx_int = floor(convx);
- convx_float = convx - convx_int;
-
- area = convx * convy;
-
- lowy_int = 0;
- lowy_float = 0;
- highy_int = convy_int;
- highy_float = convy_float;
-
- for (i = 0; i < heightOut; i++) {
- lowx_int = 0;
- lowx_float = 0;
- highx_int = convx_int;
- highx_float = convx_float;
-
- for (j = 0; j < widthOut; j++) {
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy)
- ** to (highx, highy) on input data into this pixel on output
- ** data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
-
- /* calculate the value for pixels in the 1st row */
- xindex = lowx_int*pixelSizeInBytes;
- if((highy_int>lowy_int) && (highx_int>lowx_int)) {
-
- y_percent = 1-lowy_float;
- temp = (const char *)dataIn + xindex + lowy_int * rowSizeInBytes;
- percent = y_percent * (1-lowx_float);
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * percent;
- }
-#endif
- left = temp;
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += pixelSizeInBytes;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(temp_index) * y_percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * y_percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * y_percent;
- }
-#endif
- }
- temp += pixelSizeInBytes;
- right = temp;
- percent = y_percent * highx_float;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * percent;
- }
-#endif
-
- /* calculate the value for pixels in the last row */
-
- y_percent = highy_float;
- percent = y_percent * (1-lowx_float);
- temp = (const char *)dataIn + xindex + highy_int * rowSizeInBytes;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * percent;
- }
-#endif
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += pixelSizeInBytes;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(temp_index) * y_percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * y_percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * y_percent;
- }
-#endif
-
- }
- temp += pixelSizeInBytes;
- percent = y_percent * highx_float;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * percent;
- }
-#endif
-
- /* calculate the value for pixels in the 1st and last column */
- for(m = lowy_int+1; m < highy_int; m++) {
- left += rowSizeInBytes;
- right += rowSizeInBytes;
-#if 0
- for (k = 0; k < components;
- k++, left += element_size, right += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(left) * (1-lowx_float) +
- __GLU_SWAP_2_BYTES(right) * highx_float;
- } else {
- totals[k] += *(const GLushort*)left * (1-lowx_float)
- + *(const GLushort*)right * highx_float;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,left,extractTotals);
- (*extractPackedPixel)(isSwap,right,extractMoreTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= (extractTotals[k]*(1-lowx_float) +
- extractMoreTotals[k]*highx_float);
- }
-#endif
- }
- } else if (highy_int > lowy_int) {
- x_percent = highx_float - lowx_float;
- percent = (1-lowy_float)*x_percent;
- temp = (const char *)dataIn + xindex + lowy_int*rowSizeInBytes;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * percent;
- }
-#endif
- for(m = lowy_int+1; m < highy_int; m++) {
- temp += rowSizeInBytes;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(temp_index) * x_percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * x_percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * x_percent;
- }
-#endif
- }
- percent = x_percent * highy_float;
- temp += rowSizeInBytes;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * percent;
- }
-#endif
- } else if (highx_int > lowx_int) {
- y_percent = highy_float - lowy_float;
- percent = (1-lowx_float)*y_percent;
- temp = (const char *)dataIn + xindex + lowy_int*rowSizeInBytes;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * percent;
- }
-#endif
- for (l = lowx_int+1; l < highx_int; l++) {
- temp += pixelSizeInBytes;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(temp_index) * y_percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * y_percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * y_percent;
- }
-#endif
- }
- temp += pixelSizeInBytes;
- percent = y_percent * highx_float;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * percent;
- }
-#endif
- } else {
- percent = (highy_float-lowy_float)*(highx_float-lowx_float);
- temp = (const char *)dataIn + xindex + lowy_int * rowSizeInBytes;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * percent;
- }
-#endif
- }
-
- /* this is for the pixels in the body */
- temp0 = (const char *)dataIn + xindex + pixelSizeInBytes + (lowy_int+1)*rowSizeInBytes;
- for (m = lowy_int+1; m < highy_int; m++) {
- temp = temp0;
- for(l = lowx_int+1; l < highx_int; l++) {
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index);
- } else {
- totals[k] += *(const GLushort*)temp_index;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k];
- }
-#endif
- temp += pixelSizeInBytes;
- }
- temp0 += rowSizeInBytes;
- }
-
- outindex = (j + (i * widthOut)); /* * (components == 1) */
-#if 0
- for (k = 0; k < components; k++) {
- dataout[outindex + k] = totals[k]/area;
- /*printf("totals[%d] = %f\n", k, totals[k]);*/
- }
-#else
- for (k = 0; k < components; k++) {
- shoveTotals[k]= totals[k]/area;
- }
- (*shovePackedPixel)(shoveTotals,outindex,(void *)dataOut);
-#endif
- lowx_int = highx_int;
- lowx_float = highx_float;
- highx_int += convx_int;
- highx_float += convx_float;
- if(highx_float > 1) {
- highx_float -= 1.0;
- highx_int++;
- }
- }
- lowy_int = highy_int;
- lowy_float = highy_float;
- highy_int += convy_int;
- highy_float += convy_float;
- if(highy_float > 1) {
- highy_float -= 1.0;
- highy_int++;
- }
- }
-
- assert(outindex == (widthOut*heightOut - 1));
-} /* scaleInternalPackedPixel() */
-
-/* rowSizeInBytes is at least the width (in bytes) due to padding on
- * inputs; not always equal. Output NEVER has row padding.
- */
-static void halveImagePackedPixel(int components,
- void (*extractPackedPixel)
- (int, const void *,GLfloat []),
- void (*shovePackedPixel)
- (const GLfloat [],int, void *),
- GLint width, GLint height,
- const void *dataIn, void *dataOut,
- GLint pixelSizeInBytes,
- GLint rowSizeInBytes, GLint isSwap)
-{
- /* handle case where there is only 1 column/row */
- if (width == 1 || height == 1) {
- assert(!(width == 1 && height == 1)); /* can't be 1x1 */
- halve1DimagePackedPixel(components,extractPackedPixel,shovePackedPixel,
- width,height,dataIn,dataOut,pixelSizeInBytes,
- rowSizeInBytes,isSwap);
- return;
- }
-
- {
- int ii, jj;
-
- int halfWidth= width / 2;
- int halfHeight= height / 2;
- const char *src= (const char *) dataIn;
- int padBytes= rowSizeInBytes - (width*pixelSizeInBytes);
- int outIndex= 0;
-
- for (ii= 0; ii< halfHeight; ii++) {
- for (jj= 0; jj< halfWidth; jj++) {
-#define BOX4 4
- float totals[4]; /* 4 is maximum components */
- float extractTotals[BOX4][4]; /* 4 is maximum components */
- int cc;
-
- (*extractPackedPixel)(isSwap,src,
- &extractTotals[0][0]);
- (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes),
- &extractTotals[1][0]);
- (*extractPackedPixel)(isSwap,(src+rowSizeInBytes),
- &extractTotals[2][0]);
- (*extractPackedPixel)(isSwap,
- (src+rowSizeInBytes+pixelSizeInBytes),
- &extractTotals[3][0]);
- for (cc = 0; cc < components; cc++) {
- int kk;
-
- /* grab 4 pixels to average */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
- * extractTotals[2][RED]+extractTotals[3][RED];
- * totals[RED]/= 4.0;
- */
- for (kk = 0; kk < BOX4; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (float)BOX4;
- }
- (*shovePackedPixel)(totals,outIndex,dataOut);
-
- outIndex++;
- /* skip over to next square of 4 */
- src+= pixelSizeInBytes + pixelSizeInBytes;
- }
- /* skip past pad bytes, if any, to get to next row */
- src+= padBytes;
-
- /* src is at beginning of a row here, but it's the second row of
- * the square block of 4 pixels that we just worked on so we
- * need to go one more row.
- * i.e.,
- * OO...
- * here -->OO...
- * but want -->OO...
- * OO...
- * ...
- */
- src+= rowSizeInBytes;
- }
-
- /* both pointers must reach one byte after the end */
- assert(src == &((const char *)dataIn)[rowSizeInBytes*height]);
- assert(outIndex == halfWidth * halfHeight);
- }
-} /* halveImagePackedPixel() */
-
-static void halve1DimagePackedPixel(int components,
- void (*extractPackedPixel)
- (int, const void *,GLfloat []),
- void (*shovePackedPixel)
- (const GLfloat [],int, void *),
- GLint width, GLint height,
- const void *dataIn, void *dataOut,
- GLint pixelSizeInBytes,
- GLint rowSizeInBytes, GLint isSwap)
-{
- int halfWidth= width / 2;
- int halfHeight= height / 2;
- const char *src= (const char *) dataIn;
- int jj;
-
- assert(width == 1 || height == 1); /* must be 1D */
- assert(width != height); /* can't be square */
-
- if (height == 1) { /* 1 row */
- int outIndex= 0;
-
- assert(width != 1); /* widthxheight can't be 1x1 */
- halfHeight= 1;
-
- /* one horizontal row with possible pad bytes */
-
- for (jj= 0; jj< halfWidth; jj++) {
-#define BOX2 2
- float totals[4]; /* 4 is maximum components */
- float extractTotals[BOX2][4]; /* 4 is maximum components */
- int cc;
-
- /* average two at a time, instead of four */
- (*extractPackedPixel)(isSwap,src,
- &extractTotals[0][0]);
- (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes),
- &extractTotals[1][0]);
- for (cc = 0; cc < components; cc++) {
- int kk;
-
- /* grab 2 pixels to average */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED];
- * totals[RED]/= 2.0;
- */
- for (kk = 0; kk < BOX2; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (float)BOX2;
- }
- (*shovePackedPixel)(totals,outIndex,dataOut);
-
- outIndex++;
- /* skip over to next group of 2 */
- src+= pixelSizeInBytes + pixelSizeInBytes;
- }
-
- {
- int padBytes= rowSizeInBytes - (width*pixelSizeInBytes);
- src+= padBytes; /* for assertion only */
- }
- assert(src == &((const char *)dataIn)[rowSizeInBytes]);
- assert(outIndex == halfWidth * halfHeight);
- }
- else if (width == 1) { /* 1 column */
- int outIndex= 0;
-
- assert(height != 1); /* widthxheight can't be 1x1 */
- halfWidth= 1;
- /* one vertical column with possible pad bytes per row */
- /* average two at a time */
-
- for (jj= 0; jj< halfHeight; jj++) {
-#define BOX2 2
- float totals[4]; /* 4 is maximum components */
- float extractTotals[BOX2][4]; /* 4 is maximum components */
- int cc;
-
- /* average two at a time, instead of four */
- (*extractPackedPixel)(isSwap,src,
- &extractTotals[0][0]);
- (*extractPackedPixel)(isSwap,(src+rowSizeInBytes),
- &extractTotals[1][0]);
- for (cc = 0; cc < components; cc++) {
- int kk;
-
- /* grab 2 pixels to average */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED];
- * totals[RED]/= 2.0;
- */
- for (kk = 0; kk < BOX2; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (float)BOX2;
- }
- (*shovePackedPixel)(totals,outIndex,dataOut);
-
- outIndex++;
- src+= rowSizeInBytes + rowSizeInBytes; /* go to row after next */
- }
-
- assert(src == &((const char *)dataIn)[rowSizeInBytes*height]);
- assert(outIndex == halfWidth * halfHeight);
- }
-} /* halve1DimagePackedPixel() */
-
-/*===========================================================================*/
-
-static GLint imageSize3D(GLint width, GLint height, GLint depth,
- GLenum format, GLenum type)
-{
- int components= elements_per_group(format,type);
- int bytes_per_row= bytes_per_element(type) * width;
-
-assert(width > 0 && height > 0 && depth > 0);
-assert(type != GL_BITMAP);
-
- return bytes_per_row * height * depth * components;
-} /* imageSize3D() */
-
-static void fillImage3D(const PixelStorageModes *psm,
- GLint width, GLint height, GLint depth, GLenum format,
- GLenum type, GLboolean indexFormat,
- const void *userImage, GLushort *newImage)
-{
- int myswapBytes;
- int components;
- int groupsPerLine;
- int elementSize;
- int groupSize;
- int rowSize;
- int padding;
- int elementsPerLine;
- int rowsPerImage;
- int imageSize;
- const GLubyte *start, *rowStart, *iter;
- GLushort *iter2;
- int ww, hh, dd, k;
-
- myswapBytes= psm->unpack_swap_bytes;
- components= elements_per_group(format,type);
- if (psm->unpack_row_length > 0) {
- groupsPerLine= psm->unpack_row_length;
- }
- else {
- groupsPerLine= width;
- }
- elementSize= bytes_per_element(type);
- groupSize= elementSize * components;
- if (elementSize == 1) myswapBytes= 0;
-
- /* 3dstuff begin */
- if (psm->unpack_image_height > 0) {
- rowsPerImage= psm->unpack_image_height;
- }
- else {
- rowsPerImage= height;
- }
- /* 3dstuff end */
-
- rowSize= groupsPerLine * groupSize;
- padding= rowSize % psm->unpack_alignment;
- if (padding) {
- rowSize+= psm->unpack_alignment - padding;
- }
-
- imageSize= rowsPerImage * rowSize; /* 3dstuff */
-
- start= (const GLubyte *)userImage + psm->unpack_skip_rows * rowSize +
- psm->unpack_skip_pixels * groupSize +
- /*3dstuff*/
- psm->unpack_skip_images * imageSize;
- elementsPerLine = width * components;
-
- iter2= newImage;
- for (dd= 0; dd < depth; dd++) {
- rowStart= start;
-
- for (hh= 0; hh < height; hh++) {
- iter= rowStart;
-
- for (ww= 0; ww < elementsPerLine; ww++) {
- Type_Widget widget;
- float extractComponents[4];
-
- switch(type) {
- case GL_UNSIGNED_BYTE:
- if (indexFormat) {
- *iter2++ = *iter;
- } else {
- *iter2++ = (*iter) * 257;
- }
- break;
- case GL_BYTE:
- if (indexFormat) {
- *iter2++ = *((const GLbyte *) iter);
- } else {
- /* rough approx */
- *iter2++ = (*((const GLbyte *) iter)) * 516;
- }
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- extract332(0,iter,extractComponents);
- for (k = 0; k < 3; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- extract233rev(0,iter,extractComponents);
- for (k = 0; k < 3; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- extract565(myswapBytes,iter,extractComponents);
- for (k = 0; k < 3; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- extract565rev(myswapBytes,iter,extractComponents);
- for (k = 0; k < 3; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- extract4444(myswapBytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- extract4444rev(myswapBytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- extract5551(myswapBytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- extract1555rev(myswapBytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT:
- case GL_SHORT:
- if (myswapBytes) {
- widget.ub[0] = iter[1];
- widget.ub[1] = iter[0];
- } else {
- widget.ub[0] = iter[0];
- widget.ub[1] = iter[1];
- }
- if (type == GL_SHORT) {
- if (indexFormat) {
- *iter2++ = widget.s[0];
- } else {
- /* rough approx */
- *iter2++ = widget.s[0]*2;
- }
- } else {
- *iter2++ = widget.us[0];
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- extract8888(myswapBytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- extract8888rev(myswapBytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- extract1010102(myswapBytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- extract2101010rev(myswapBytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- if (myswapBytes) {
- widget.ub[0] = iter[3];
- widget.ub[1] = iter[2];
- widget.ub[2] = iter[1];
- widget.ub[3] = iter[0];
- } else {
- widget.ub[0] = iter[0];
- widget.ub[1] = iter[1];
- widget.ub[2] = iter[2];
- widget.ub[3] = iter[3];
- }
- if (type == GL_FLOAT) {
- if (indexFormat) {
- *iter2++ = widget.f;
- } else {
- *iter2++ = 65535 * widget.f;
- }
- } else if (type == GL_UNSIGNED_INT) {
- if (indexFormat) {
- *iter2++ = widget.ui;
- } else {
- *iter2++ = widget.ui >> 16;
- }
- } else {
- if (indexFormat) {
- *iter2++ = widget.i;
- } else {
- *iter2++ = widget.i >> 15;
- }
- }
- break;
- default:
- assert(0);
- }
-
- iter+= elementSize;
- } /* for ww */
- rowStart+= rowSize;
-
- iter= rowStart; /* for assertion purposes */
- } /* for hh */
-
- start+= imageSize;
- } /* for dd */
-
- /* iterators should be one byte past end */
- if (!isTypePackedPixel(type)) {
- assert(iter2 == &newImage[width*height*depth*components]);
- }
- else {
- assert(iter2 == &newImage[width*height*depth*
- elements_per_group(format,0)]);
- }
- assert( iter == &((const GLubyte *)userImage)[rowSize*height*depth +
- psm->unpack_skip_rows * rowSize +
- psm->unpack_skip_pixels * groupSize +
- /*3dstuff*/
- psm->unpack_skip_images * imageSize] );
-} /* fillImage3D () */
-
-static void scaleInternal3D(GLint components,
- GLint widthIn, GLint heightIn, GLint depthIn,
- const GLushort *dataIn,
- GLint widthOut, GLint heightOut, GLint depthOut,
- GLushort *dataOut)
-{
- float x, lowx, highx, convx, halfconvx;
- float y, lowy, highy, convy, halfconvy;
- float z, lowz, highz, convz, halfconvz;
- float xpercent,ypercent,zpercent;
- float percent;
- /* Max components in a format is 4, so... */
- float totals[4];
- float volume;
- int i,j,d,k,zint,yint,xint,xindex,yindex,zindex;
- int temp;
-
- convz = (float) depthIn/depthOut;
- convy = (float) heightIn/heightOut;
- convx = (float) widthIn/widthOut;
- halfconvx = convx/2;
- halfconvy = convy/2;
- halfconvz = convz/2;
- for (d = 0; d < depthOut; d++) {
- z = convz * (d+0.5);
- if (depthIn > depthOut) {
- highz = z + halfconvz;
- lowz = z - halfconvz;
- } else {
- highz = z + 0.5;
- lowz = z - 0.5;
- }
- for (i = 0; i < heightOut; i++) {
- y = convy * (i+0.5);
- if (heightIn > heightOut) {
- highy = y + halfconvy;
- lowy = y - halfconvy;
- } else {
- highy = y + 0.5;
- lowy = y - 0.5;
- }
- for (j = 0; j < widthOut; j++) {
- x = convx * (j+0.5);
- if (widthIn > widthOut) {
- highx = x + halfconvx;
- lowx = x - halfconvx;
- } else {
- highx = x + 0.5;
- lowx = x - 0.5;
- }
-
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy,
- ** lowz) to (highx, highy, highz) on input data into this pixel
- ** on output data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
- volume = 0.0;
-
- z = lowz;
- zint = floor(z);
- while (z < highz) {
- zindex = (zint + depthIn) % depthIn;
- if (highz < zint+1) {
- zpercent = highz - z;
- } else {
- zpercent = zint+1 - z;
- }
-
- y = lowy;
- yint = floor(y);
- while (y < highy) {
- yindex = (yint + heightIn) % heightIn;
- if (highy < yint+1) {
- ypercent = highy - y;
- } else {
- ypercent = yint+1 - y;
- }
-
- x = lowx;
- xint = floor(x);
-
- while (x < highx) {
- xindex = (xint + widthIn) % widthIn;
- if (highx < xint+1) {
- xpercent = highx - x;
- } else {
- xpercent = xint+1 - x;
- }
-
- percent = xpercent * ypercent * zpercent;
- volume += percent;
-
- temp = (xindex + (yindex*widthIn) +
- (zindex*widthIn*heightIn)) * components;
- for (k = 0; k < components; k++) {
- assert(0 <= (temp+k) &&
- (temp+k) <
- (widthIn*heightIn*depthIn*components));
- totals[k] += dataIn[temp + k] * percent;
- }
-
- xint++;
- x = xint;
- } /* while x */
-
- yint++;
- y = yint;
- } /* while y */
-
- zint++;
- z = zint;
- } /* while z */
-
- temp = (j + (i * widthOut) +
- (d*widthOut*heightOut)) * components;
- for (k = 0; k < components; k++) {
- /* totals[] should be rounded in the case of enlarging an
- * RGB ramp when the type is 332 or 4444
- */
- assert(0 <= (temp+k) &&
- (temp+k) < (widthOut*heightOut*depthOut*components));
- dataOut[temp + k] = (totals[k]+0.5)/volume;
- }
- } /* for j */
- } /* for i */
- } /* for d */
-} /* scaleInternal3D() */
-
-static void emptyImage3D(const PixelStorageModes *psm,
- GLint width, GLint height, GLint depth,
- GLenum format, GLenum type, GLboolean indexFormat,
- const GLushort *oldImage, void *userImage)
-{
- int myswapBytes;
- int components;
- int groupsPerLine;
- int elementSize;
- int groupSize;
- int rowSize;
- int padding;
- GLubyte *start, *rowStart, *iter;
- int elementsPerLine;
- const GLushort *iter2;
- int ii, jj, dd, k;
- int rowsPerImage;
- int imageSize;
-
- myswapBytes= psm->pack_swap_bytes;
- components = elements_per_group(format,type);
- if (psm->pack_row_length > 0) {
- groupsPerLine = psm->pack_row_length;
- }
- else {
- groupsPerLine = width;
- }
-
- elementSize= bytes_per_element(type);
- groupSize= elementSize * components;
- if (elementSize == 1) myswapBytes= 0;
-
- /* 3dstuff begin */
- if (psm->pack_image_height > 0) {
- rowsPerImage= psm->pack_image_height;
- }
- else {
- rowsPerImage= height;
- }
-
- /* 3dstuff end */
-
- rowSize = groupsPerLine * groupSize;
- padding = rowSize % psm->pack_alignment;
- if (padding) {
- rowSize+= psm->pack_alignment - padding;
- }
-
- imageSize= rowsPerImage * rowSize; /* 3dstuff */
-
- start = (GLubyte *)userImage + psm->pack_skip_rows * rowSize +
- psm->pack_skip_pixels * groupSize +
- /*3dstuff*/
- psm->pack_skip_images * imageSize;
- elementsPerLine= width * components;
-
- iter2 = oldImage;
- for (dd= 0; dd < depth; dd++) {
- rowStart= start;
-
- for (ii= 0; ii< height; ii++) {
- iter = rowStart;
-
- for (jj = 0; jj < elementsPerLine; jj++) {
- Type_Widget widget;
- float shoveComponents[4];
-
- switch(type){
- case GL_UNSIGNED_BYTE:
- if (indexFormat) {
- *iter = *iter2++;
- } else {
- *iter = *iter2++ >> 8;
- }
- break;
- case GL_BYTE:
- if (indexFormat) {
- *((GLbyte *) iter) = *iter2++;
- } else {
- *((GLbyte *) iter) = *iter2++ >> 9;
- }
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- for (k = 0; k < 3; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove332(shoveComponents,0,(void *)iter);
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- for (k = 0; k < 3; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove233rev(shoveComponents,0,(void *)iter);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- for (k = 0; k < 3; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove565(shoveComponents,0,(void *)&widget.us[0]);
- if (myswapBytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- }
- else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- for (k = 0; k < 3; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove565rev(shoveComponents,0,(void *)&widget.us[0]);
- if (myswapBytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- }
- else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove4444(shoveComponents,0,(void *)&widget.us[0]);
- if (myswapBytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove4444rev(shoveComponents,0,(void *)&widget.us[0]);
- if (myswapBytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove5551(shoveComponents,0,(void *)&widget.us[0]);
- if (myswapBytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove1555rev(shoveComponents,0,(void *)&widget.us[0]);
- if (myswapBytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT:
- case GL_SHORT:
- if (type == GL_SHORT) {
- if (indexFormat) {
- widget.s[0] = *iter2++;
- } else {
- widget.s[0] = *iter2++ >> 1;
- }
- } else {
- widget.us[0] = *iter2++;
- }
- if (myswapBytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- iter[0] = widget.ub[0];
- iter[1] = widget.ub[1];
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove8888(shoveComponents,0,(void *)&widget.ui);
- if (myswapBytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- *(GLuint *)iter= widget.ui;
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove8888rev(shoveComponents,0,(void *)&widget.ui);
- if (myswapBytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- *(GLuint *)iter= widget.ui;
- }
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove1010102(shoveComponents,0,(void *)&widget.ui);
- if (myswapBytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- *(GLuint *)iter= widget.ui;
- }
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove2101010rev(shoveComponents,0,(void *)&widget.ui);
- if (myswapBytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- *(GLuint *)iter= widget.ui;
- }
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- if (type == GL_FLOAT) {
- if (indexFormat) {
- widget.f = *iter2++;
- } else {
- widget.f = *iter2++ / (float) 65535.0;
- }
- } else if (type == GL_UNSIGNED_INT) {
- if (indexFormat) {
- widget.ui = *iter2++;
- } else {
- widget.ui = (unsigned int) *iter2++ * 65537;
- }
- } else {
- if (indexFormat) {
- widget.i = *iter2++;
- } else {
- widget.i = ((unsigned int) *iter2++ * 65537)/2;
- }
- }
- if (myswapBytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- iter[0] = widget.ub[0];
- iter[1] = widget.ub[1];
- iter[2] = widget.ub[2];
- iter[3] = widget.ub[3];
- }
- break;
- default:
- assert(0);
- }
-
- iter+= elementSize;
- } /* for jj */
-
- rowStart+= rowSize;
- } /* for ii */
-
- start+= imageSize;
- } /* for dd */
-
- /* iterators should be one byte past end */
- if (!isTypePackedPixel(type)) {
- assert(iter2 == &oldImage[width*height*depth*components]);
- }
- else {
- assert(iter2 == &oldImage[width*height*depth*
- elements_per_group(format,0)]);
- }
- assert( iter == &((GLubyte *)userImage)[rowSize*height*depth +
- psm->unpack_skip_rows * rowSize +
- psm->unpack_skip_pixels * groupSize +
- /*3dstuff*/
- psm->unpack_skip_images * imageSize] );
-} /* emptyImage3D() */
-
-int gluScaleImage3D(GLenum format,
- GLint widthIn, GLint heightIn, GLint depthIn,
- GLenum typeIn, const void *dataIn,
- GLint widthOut, GLint heightOut, GLint depthOut,
- GLenum typeOut, void *dataOut)
-{
- int components;
- GLushort *beforeImage, *afterImage;
- PixelStorageModes psm;
-
- if (widthIn == 0 || heightIn == 0 || depthIn == 0 ||
- widthOut == 0 || heightOut == 0 || depthOut == 0) {
- return 0;
- }
-
- if (widthIn < 0 || heightIn < 0 || depthIn < 0 ||
- widthOut < 0 || heightOut < 0 || depthOut < 0) {
- return GLU_INVALID_VALUE;
- }
-
- if (!legalFormat(format) || !legalType(typeIn) || !legalType(typeOut) ||
- typeIn == GL_BITMAP || typeOut == GL_BITMAP) {
- return GLU_INVALID_ENUM;
- }
- if (!isLegalFormatForPackedPixelType(format, typeIn)) {
- return GLU_INVALID_OPERATION;
- }
- if (!isLegalFormatForPackedPixelType(format, typeOut)) {
- return GLU_INVALID_OPERATION;
- }
-
- beforeImage = malloc(imageSize3D(widthIn, heightIn, depthIn, format,
- GL_UNSIGNED_SHORT));
- afterImage = malloc(imageSize3D(widthOut, heightOut, depthOut, format,
- GL_UNSIGNED_SHORT));
- if (beforeImage == NULL || afterImage == NULL) {
- return GLU_OUT_OF_MEMORY;
- }
- retrieveStoreModes3D(&psm);
-
- fillImage3D(&psm,widthIn,heightIn,depthIn,format,typeIn, is_index(format),
- dataIn, beforeImage);
- components = elements_per_group(format,0);
- scaleInternal3D(components,widthIn,heightIn,depthIn,beforeImage,
- widthOut,heightOut,depthOut,afterImage);
- emptyImage3D(&psm,widthOut,heightOut,depthOut,format,typeOut,
- is_index(format),afterImage, dataOut);
- free((void *) beforeImage);
- free((void *) afterImage);
-
- return 0;
-} /* gluScaleImage3D() */
-
-static void closestFit3D(GLenum target, GLint width, GLint height, GLint depth,
- GLint internalFormat, GLenum format, GLenum type,
- GLint *newWidth, GLint *newHeight, GLint *newDepth)
-{
- GLint widthPowerOf2= nearestPower(width);
- GLint heightPowerOf2= nearestPower(height);
- GLint depthPowerOf2= nearestPower(depth);
- GLint proxyWidth;
-
- do {
- /* compute level 1 width & height & depth, clamping each at 1 */
- GLint widthAtLevelOne= (widthPowerOf2 > 1) ?
- widthPowerOf2 >> 1 :
- widthPowerOf2;
- GLint heightAtLevelOne= (heightPowerOf2 > 1) ?
- heightPowerOf2 >> 1 :
- heightPowerOf2;
- GLint depthAtLevelOne= (depthPowerOf2 > 1) ?
- depthPowerOf2 >> 1 :
- depthPowerOf2;
- GLenum proxyTarget = 0;
- assert(widthAtLevelOne > 0);
- assert(heightAtLevelOne > 0);
- assert(depthAtLevelOne > 0);
-
- /* does width x height x depth at level 1 & all their mipmaps fit? */
- if (target == GL_TEXTURE_3D || target == GL_PROXY_TEXTURE_3D) {
- proxyTarget = GL_PROXY_TEXTURE_3D;
- glTexImage3D(proxyTarget, 1, /* must be non-zero */
- internalFormat,
- widthAtLevelOne,heightAtLevelOne,depthAtLevelOne,
- 0,format,type,NULL);
- }
- glGetTexLevelParameteriv(proxyTarget, 1,GL_TEXTURE_WIDTH,&proxyWidth);
- /* does it fit??? */
- if (proxyWidth == 0) { /* nope, so try again with these sizes */
- if (widthPowerOf2 == 1 && heightPowerOf2 == 1 &&
- depthPowerOf2 == 1) {
- *newWidth= *newHeight= *newDepth= 1; /* must fit 1x1x1 texture */
- return;
- }
- widthPowerOf2= widthAtLevelOne;
- heightPowerOf2= heightAtLevelOne;
- depthPowerOf2= depthAtLevelOne;
- }
- /* else it does fit */
- } while (proxyWidth == 0);
- /* loop must terminate! */
-
- /* return the width & height at level 0 that fits */
- *newWidth= widthPowerOf2;
- *newHeight= heightPowerOf2;
- *newDepth= depthPowerOf2;
-/*printf("Proxy Textures\n");*/
-} /* closestFit3D() */
-
-static void halveImagePackedPixelSlice(int components,
- void (*extractPackedPixel)
- (int, const void *,GLfloat []),
- void (*shovePackedPixel)
- (const GLfloat [],int, void *),
- GLint width, GLint height, GLint depth,
- const void *dataIn, void *dataOut,
- GLint pixelSizeInBytes,
- GLint rowSizeInBytes,
- GLint imageSizeInBytes,
- GLint isSwap)
-{
- int ii, jj;
- int halfWidth= width / 2;
- int halfHeight= height / 2;
- int halfDepth= depth / 2;
- const char *src= (const char *)dataIn;
- int outIndex= 0;
-
- assert((width == 1 || height == 1) && depth >= 2);
-
- if (width == height) { /* a 1-pixel column viewed from top */
- assert(width == 1 && height == 1);
- assert(depth >= 2);
-
- for (ii= 0; ii< halfDepth; ii++) {
- float totals[4];
- float extractTotals[BOX2][4];
- int cc;
-
- (*extractPackedPixel)(isSwap,src,&extractTotals[0][0]);
- (*extractPackedPixel)(isSwap,(src+imageSizeInBytes),
- &extractTotals[1][0]);
- for (cc = 0; cc < components; cc++) {
- int kk;
-
- /* average 2 pixels since only a column */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED];
- * totals[RED]/= 2.0;
- */
- for (kk = 0; kk < BOX2; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (float)BOX2;
- } /* for cc */
-
- (*shovePackedPixel)(totals,outIndex,dataOut);
- outIndex++;
- /* skip over to next group of 2 */
- src+= imageSizeInBytes + imageSizeInBytes;
- } /* for ii */
- }
- else if (height == 1) { /* horizontal slice viewed from top */
- assert(width != 1);
-
- for (ii= 0; ii< halfDepth; ii++) {
- for (jj= 0; jj< halfWidth; jj++) {
- float totals[4];
- float extractTotals[BOX4][4];
- int cc;
-
- (*extractPackedPixel)(isSwap,src,
- &extractTotals[0][0]);
- (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes),
- &extractTotals[1][0]);
- (*extractPackedPixel)(isSwap,(src+imageSizeInBytes),
- &extractTotals[2][0]);
- (*extractPackedPixel)(isSwap,
- (src+imageSizeInBytes+pixelSizeInBytes),
- &extractTotals[3][0]);
- for (cc = 0; cc < components; cc++) {
- int kk;
-
- /* grab 4 pixels to average */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
- * extractTotals[2][RED]+extractTotals[3][RED];
- * totals[RED]/= 4.0;
- */
- for (kk = 0; kk < BOX4; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (float)BOX4;
- }
- (*shovePackedPixel)(totals,outIndex,dataOut);
-
- outIndex++;
- /* skip over to next horizontal square of 4 */
- src+= imageSizeInBytes + imageSizeInBytes;
- }
- }
-
- /* assert() */
- }
- else if (width == 1) { /* vertical slice viewed from top */
- assert(height != 1);
-
- for (ii= 0; ii< halfDepth; ii++) {
- for (jj= 0; jj< halfHeight; jj++) {
- float totals[4];
- float extractTotals[BOX4][4];
- int cc;
-
- (*extractPackedPixel)(isSwap,src,
- &extractTotals[0][0]);
- (*extractPackedPixel)(isSwap,(src+rowSizeInBytes),
- &extractTotals[1][0]);
- (*extractPackedPixel)(isSwap,(src+imageSizeInBytes),
- &extractTotals[2][0]);
- (*extractPackedPixel)(isSwap,
- (src+imageSizeInBytes+rowSizeInBytes),
- &extractTotals[3][0]);
- for (cc = 0; cc < components; cc++) {
- int kk;
-
- /* grab 4 pixels to average */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
- * extractTotals[2][RED]+extractTotals[3][RED];
- * totals[RED]/= 4.0;
- */
- for (kk = 0; kk < BOX4; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (float)BOX4;
- }
- (*shovePackedPixel)(totals,outIndex,dataOut);
-
- outIndex++;
-
- /* skip over to next vertical square of 4 */
- src+= imageSizeInBytes + imageSizeInBytes;
- }
- }
- /* assert() */
- }
-
-} /* halveImagePackedPixelSlice() */
-
-static void halveImagePackedPixel3D(int components,
- void (*extractPackedPixel)
- (int, const void *,GLfloat []),
- void (*shovePackedPixel)
- (const GLfloat [],int, void *),
- GLint width, GLint height, GLint depth,
- const void *dataIn, void *dataOut,
- GLint pixelSizeInBytes,
- GLint rowSizeInBytes,
- GLint imageSizeInBytes,
- GLint isSwap)
-{
- if (depth == 1) {
- assert(1 <= width && 1 <= height);
-
- halveImagePackedPixel(components,extractPackedPixel,shovePackedPixel,
- width,height,dataIn,dataOut,pixelSizeInBytes,
- rowSizeInBytes,isSwap);
- return;
- }
- /* a horizontal or vertical slice viewed from top */
- else if (width == 1 || height == 1) {
- assert(1 <= depth);
-
- halveImagePackedPixelSlice(components,
- extractPackedPixel,shovePackedPixel,
- width, height, depth, dataIn, dataOut,
- pixelSizeInBytes, rowSizeInBytes,
- imageSizeInBytes, isSwap);
- return;
- }
- {
- int ii, jj, dd;
-
- int halfWidth= width / 2;
- int halfHeight= height / 2;
- int halfDepth= depth / 2;
- const char *src= (const char *) dataIn;
- int padBytes= rowSizeInBytes - (width*pixelSizeInBytes);
- int outIndex= 0;
-
- for (dd= 0; dd < halfDepth; dd++) {
- for (ii= 0; ii< halfHeight; ii++) {
- for (jj= 0; jj< halfWidth; jj++) {
-#define BOX8 8
- float totals[4]; /* 4 is maximum components */
- float extractTotals[BOX8][4]; /* 4 is maximum components */
- int cc;
-
- (*extractPackedPixel)(isSwap,src,
- &extractTotals[0][0]);
- (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes),
- &extractTotals[1][0]);
- (*extractPackedPixel)(isSwap,(src+rowSizeInBytes),
- &extractTotals[2][0]);
- (*extractPackedPixel)(isSwap,
- (src+rowSizeInBytes+pixelSizeInBytes),
- &extractTotals[3][0]);
-
- (*extractPackedPixel)(isSwap,(src+imageSizeInBytes),
- &extractTotals[4][0]);
- (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes+imageSizeInBytes),
- &extractTotals[5][0]);
- (*extractPackedPixel)(isSwap,(src+rowSizeInBytes+imageSizeInBytes),
- &extractTotals[6][0]);
- (*extractPackedPixel)(isSwap,
- (src+rowSizeInBytes+pixelSizeInBytes+imageSizeInBytes),
- &extractTotals[7][0]);
- for (cc = 0; cc < components; cc++) {
- int kk;
-
- /* grab 8 pixels to average */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
- * extractTotals[2][RED]+extractTotals[3][RED]+
- * extractTotals[4][RED]+extractTotals[5][RED]+
- * extractTotals[6][RED]+extractTotals[7][RED];
- * totals[RED]/= 8.0;
- */
- for (kk = 0; kk < BOX8; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (float)BOX8;
- }
- (*shovePackedPixel)(totals,outIndex,dataOut);
-
- outIndex++;
- /* skip over to next square of 4 */
- src+= pixelSizeInBytes + pixelSizeInBytes;
- }
- /* skip past pad bytes, if any, to get to next row */
- src+= padBytes;
-
- /* src is at beginning of a row here, but it's the second row of
- * the square block of 4 pixels that we just worked on so we
- * need to go one more row.
- * i.e.,
- * OO...
- * here -->OO...
- * but want -->OO...
- * OO...
- * ...
- */
- src+= rowSizeInBytes;
- }
-
- src+= imageSizeInBytes;
- } /* for dd */
-
- /* both pointers must reach one byte after the end */
- assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]);
- assert(outIndex == halfWidth * halfHeight * halfDepth);
- } /* for dd */
-
-} /* halveImagePackedPixel3D() */
-
-static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat,
- GLsizei width,
- GLsizei height,
- GLsizei depth,
- GLsizei widthPowerOf2,
- GLsizei heightPowerOf2,
- GLsizei depthPowerOf2,
- GLenum format, GLenum type,
- GLint userLevel,
- GLint baseLevel,GLint maxLevel,
- const void *data)
-{
- GLint newWidth, newHeight, newDepth;
- GLint level, levels;
- const void *usersImage;
- void *srcImage, *dstImage;
- __GLU_INIT_SWAP_IMAGE;
- GLint memReq;
- GLint cmpts;
-
- GLint myswapBytes, groupsPerLine, elementSize, groupSize;
- GLint rowsPerImage, imageSize;
- GLint rowSize, padding;
- PixelStorageModes psm;
-
- assert(checkMipmapArgs(internalFormat,format,type) == 0);
- assert(width >= 1 && height >= 1 && depth >= 1);
- assert(type != GL_BITMAP);
-
- srcImage = dstImage = NULL;
-
- newWidth= widthPowerOf2;
- newHeight= heightPowerOf2;
- newDepth= depthPowerOf2;
- levels = computeLog(newWidth);
- level = computeLog(newHeight);
- if (level > levels) levels=level;
- level = computeLog(newDepth);
- if (level > levels) levels=level;
-
- levels+= userLevel;
-
- retrieveStoreModes3D(&psm);
- myswapBytes = psm.unpack_swap_bytes;
- cmpts = elements_per_group(format,type);
- if (psm.unpack_row_length > 0) {
- groupsPerLine = psm.unpack_row_length;
- } else {
- groupsPerLine = width;
- }
-
- elementSize = bytes_per_element(type);
- groupSize = elementSize * cmpts;
- if (elementSize == 1) myswapBytes = 0;
-
- /* 3dstuff begin */
- if (psm.unpack_image_height > 0) {
- rowsPerImage= psm.unpack_image_height;
- }
- else {
- rowsPerImage= height;
- }
-
- /* 3dstuff end */
- rowSize = groupsPerLine * groupSize;
- padding = (rowSize % psm.unpack_alignment);
- if (padding) {
- rowSize += psm.unpack_alignment - padding;
- }
-
- imageSize= rowsPerImage * rowSize; /* 3dstuff */
-
- usersImage = (const GLubyte *)data + psm.unpack_skip_rows * rowSize +
- psm.unpack_skip_pixels * groupSize +
- /* 3dstuff */
- psm.unpack_skip_images * imageSize;
-
- glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, 0);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, 0);
-
- level = userLevel;
-
- if (width == newWidth && height == newHeight && depth == newDepth) {
- /* Use usersImage for level userLevel */
- if (baseLevel <= level && level <= maxLevel) {
- glTexImage3D(target, level, internalFormat, width,
- height, depth, 0, format, type,
- usersImage);
- }
- if(levels == 0) { /* we're done. clean up and return */
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
- return 0;
- }
- {
- int nextWidth= newWidth/2;
- int nextHeight= newHeight/2;
- int nextDepth= newDepth/2;
-
- /* clamp to 1 */
- if (nextWidth < 1) nextWidth= 1;
- if (nextHeight < 1) nextHeight= 1;
- if (nextDepth < 1) nextDepth= 1;
- memReq = imageSize3D(nextWidth, nextHeight, nextDepth, format, type);
- }
- switch(type) {
- case GL_UNSIGNED_BYTE:
- dstImage = (GLubyte *)malloc(memReq);
- break;
- case GL_BYTE:
- dstImage = (GLbyte *)malloc(memReq);
- break;
- case GL_UNSIGNED_SHORT:
- dstImage = (GLushort *)malloc(memReq);
- break;
- case GL_SHORT:
- dstImage = (GLshort *)malloc(memReq);
- break;
- case GL_UNSIGNED_INT:
- dstImage = (GLuint *)malloc(memReq);
- break;
- case GL_INT:
- dstImage = (GLint *)malloc(memReq);
- break;
- case GL_FLOAT:
- dstImage = (GLfloat *)malloc(memReq);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- dstImage = (GLubyte *)malloc(memReq);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- dstImage = (GLushort *)malloc(memReq);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- dstImage = (GLuint *)malloc(memReq);
- break;
- default:
- return GLU_INVALID_ENUM; /* assertion */
- }
- if (dstImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
- return GLU_OUT_OF_MEMORY;
- }
- else
- switch(type) {
- case GL_UNSIGNED_BYTE:
- if (depth > 1) {
- halveImage3D(cmpts,extractUbyte,shoveUbyte,
- width,height,depth,
- usersImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_ubyte(cmpts,width,height,usersImage,dstImage,
- elementSize,rowSize,groupSize);
- }
- break;
- case GL_BYTE:
- if (depth > 1) {
- halveImage3D(cmpts,extractSbyte,shoveSbyte,
- width,height,depth,
- usersImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_byte(cmpts,width,height,usersImage,dstImage,
- elementSize,rowSize,groupSize);
- }
- break;
- case GL_UNSIGNED_SHORT:
- if (depth > 1) {
- halveImage3D(cmpts,extractUshort,shoveUshort,
- width,height,depth,
- usersImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_ushort(cmpts,width,height,usersImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_SHORT:
- if (depth > 1) {
- halveImage3D(cmpts,extractSshort,shoveSshort,
- width,height,depth,
- usersImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_short(cmpts,width,height,usersImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_UNSIGNED_INT:
- if (depth > 1) {
- halveImage3D(cmpts,extractUint,shoveUint,
- width,height,depth,
- usersImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_uint(cmpts,width,height,usersImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_INT:
- if (depth > 1) {
- halveImage3D(cmpts,extractSint,shoveSint,
- width,height,depth,
- usersImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_int(cmpts,width,height,usersImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_FLOAT:
- if (depth > 1 ) {
- halveImage3D(cmpts,extractFloat,shoveFloat,
- width,height,depth,
- usersImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_float(cmpts,width,height,usersImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- assert(format == GL_RGB);
- halveImagePackedPixel3D(3,extract332,shove332,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- assert(format == GL_RGB);
- halveImagePackedPixel3D(3,extract233rev,shove233rev,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- halveImagePackedPixel3D(3,extract565,shove565,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- halveImagePackedPixel3D(3,extract565rev,shove565rev,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- halveImagePackedPixel3D(4,extract4444,shove4444,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- halveImagePackedPixel3D(4,extract4444rev,shove4444rev,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- halveImagePackedPixel3D(4,extract5551,shove5551,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- halveImagePackedPixel3D(4,extract1555rev,shove1555rev,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- halveImagePackedPixel3D(4,extract8888,shove8888,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- halveImagePackedPixel3D(4,extract8888rev,shove8888rev,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- halveImagePackedPixel3D(4,extract1010102,shove1010102,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- halveImagePackedPixel3D(4,extract2101010rev,shove2101010rev,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- default:
- assert(0);
- break;
- }
- newWidth = width/2;
- newHeight = height/2;
- newDepth = depth/2;
- /* clamp to 1 */
- if (newWidth < 1) newWidth= 1;
- if (newHeight < 1) newHeight= 1;
- if (newDepth < 1) newDepth= 1;
-
- myswapBytes = 0;
- rowSize = newWidth * groupSize;
- imageSize= rowSize * newHeight; /* 3dstuff */
- memReq = imageSize3D(newWidth, newHeight, newDepth, format, type);
- /* Swap srcImage and dstImage */
- __GLU_SWAP_IMAGE(srcImage,dstImage);
- switch(type) {
- case GL_UNSIGNED_BYTE:
- dstImage = (GLubyte *)malloc(memReq);
- break;
- case GL_BYTE:
- dstImage = (GLbyte *)malloc(memReq);
- break;
- case GL_UNSIGNED_SHORT:
- dstImage = (GLushort *)malloc(memReq);
- break;
- case GL_SHORT:
- dstImage = (GLshort *)malloc(memReq);
- break;
- case GL_UNSIGNED_INT:
- dstImage = (GLuint *)malloc(memReq);
- break;
- case GL_INT:
- dstImage = (GLint *)malloc(memReq);
- break;
- case GL_FLOAT:
- dstImage = (GLfloat *)malloc(memReq);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- dstImage = (GLubyte *)malloc(memReq);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- dstImage = (GLushort *)malloc(memReq);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- dstImage = (GLuint *)malloc(memReq);
- break;
- default:
- return GLU_INVALID_ENUM; /* assertion */
- }
- if (dstImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
- return GLU_OUT_OF_MEMORY;
- }
- /* level userLevel+1 is in srcImage; level userLevel already saved */
- level = userLevel+1;
- } else {/* user's image is *not* nice power-of-2 sized square */
- memReq = imageSize3D(newWidth, newHeight, newDepth, format, type);
- switch(type) {
- case GL_UNSIGNED_BYTE:
- dstImage = (GLubyte *)malloc(memReq);
- break;
- case GL_BYTE:
- dstImage = (GLbyte *)malloc(memReq);
- break;
- case GL_UNSIGNED_SHORT:
- dstImage = (GLushort *)malloc(memReq);
- break;
- case GL_SHORT:
- dstImage = (GLshort *)malloc(memReq);
- break;
- case GL_UNSIGNED_INT:
- dstImage = (GLuint *)malloc(memReq);
- break;
- case GL_INT:
- dstImage = (GLint *)malloc(memReq);
- break;
- case GL_FLOAT:
- dstImage = (GLfloat *)malloc(memReq);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- dstImage = (GLubyte *)malloc(memReq);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- dstImage = (GLushort *)malloc(memReq);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- dstImage = (GLuint *)malloc(memReq);
- break;
- default:
- return GLU_INVALID_ENUM; /* assertion */
- }
-
- if (dstImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
- return GLU_OUT_OF_MEMORY;
- }
- /*printf("Build3DMipmaps(): ScaleImage3D %d %d %d->%d %d %d\n",
- width,height,depth,newWidth,newHeight,newDepth);*/
-
- gluScaleImage3D(format, width, height, depth, type, usersImage,
- newWidth, newHeight, newDepth, type, dstImage);
-
- myswapBytes = 0;
- rowSize = newWidth * groupSize;
- imageSize = rowSize * newHeight; /* 3dstuff */
- /* Swap dstImage and srcImage */
- __GLU_SWAP_IMAGE(srcImage,dstImage);
-
- if(levels != 0) { /* use as little memory as possible */
- {
- int nextWidth= newWidth/2;
- int nextHeight= newHeight/2;
- int nextDepth= newDepth/2;
- if (nextWidth < 1) nextWidth= 1;
- if (nextHeight < 1) nextHeight= 1;
- if (nextDepth < 1) nextDepth= 1;
-
- memReq = imageSize3D(nextWidth, nextHeight, nextDepth, format, type);
- }
- switch(type) {
- case GL_UNSIGNED_BYTE:
- dstImage = (GLubyte *)malloc(memReq);
- break;
- case GL_BYTE:
- dstImage = (GLbyte *)malloc(memReq);
- break;
- case GL_UNSIGNED_SHORT:
- dstImage = (GLushort *)malloc(memReq);
- break;
- case GL_SHORT:
- dstImage = (GLshort *)malloc(memReq);
- break;
- case GL_UNSIGNED_INT:
- dstImage = (GLuint *)malloc(memReq);
- break;
- case GL_INT:
- dstImage = (GLint *)malloc(memReq);
- break;
- case GL_FLOAT:
- dstImage = (GLfloat *)malloc(memReq);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- dstImage = (GLubyte *)malloc(memReq);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- dstImage = (GLushort *)malloc(memReq);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- dstImage = (GLuint *)malloc(memReq);
- break;
- default:
- return GLU_INVALID_ENUM; /* assertion */
- }
- if (dstImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
- return GLU_OUT_OF_MEMORY;
- }
- }
- /* level userLevel is in srcImage; nothing saved yet */
- level = userLevel;
- }
-
- glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
- if (baseLevel <= level && level <= maxLevel) {
- glTexImage3D(target, level, internalFormat, newWidth, newHeight, newDepth,
- 0,format, type, (void *)srcImage);
- }
- level++; /* update current level for the loop */
- for (; level <= levels; level++) {
- switch(type) {
- case GL_UNSIGNED_BYTE:
- if (newDepth > 1) {
- halveImage3D(cmpts,extractUbyte,shoveUbyte,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_ubyte(cmpts,newWidth,newHeight,srcImage,dstImage,
- elementSize,rowSize,groupSize);
- }
- break;
- case GL_BYTE:
- if (newDepth > 1) {
- halveImage3D(cmpts,extractSbyte,shoveSbyte,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_byte(cmpts,newWidth,newHeight,srcImage,dstImage,
- elementSize,rowSize,groupSize);
- }
- break;
- case GL_UNSIGNED_SHORT:
- if (newDepth > 1) {
- halveImage3D(cmpts,extractUshort,shoveUshort,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_ushort(cmpts,newWidth,newHeight,srcImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_SHORT:
- if (newDepth > 1) {
- halveImage3D(cmpts,extractSshort,shoveSshort,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_short(cmpts,newWidth,newHeight,srcImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_UNSIGNED_INT:
- if (newDepth > 1) {
- halveImage3D(cmpts,extractUint,shoveUint,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_uint(cmpts,newWidth,newHeight,srcImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_INT:
- if (newDepth > 1) {
- halveImage3D(cmpts,extractSint,shoveSint,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_int(cmpts,newWidth,newHeight,srcImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_FLOAT:
- if (newDepth > 1) {
- halveImage3D(cmpts,extractFloat,shoveFloat,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_float(cmpts,newWidth,newHeight,srcImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- halveImagePackedPixel3D(3,extract332,shove332,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- halveImagePackedPixel3D(3,extract233rev,shove233rev,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- halveImagePackedPixel3D(3,extract565,shove565,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- halveImagePackedPixel3D(3,extract565rev,shove565rev,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- halveImagePackedPixel3D(4,extract4444,shove4444,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- halveImagePackedPixel3D(4,extract4444rev,shove4444rev,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- halveImagePackedPixel3D(4,extract5551,shove5551,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- halveImagePackedPixel3D(4,extract1555rev,shove1555rev,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- halveImagePackedPixel3D(4,extract8888,shove8888,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- halveImagePackedPixel3D(4,extract8888rev,shove8888rev,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- halveImagePackedPixel3D(4,extract1010102,shove1010102,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- halveImagePackedPixel3D(4,extract2101010rev,shove2101010rev,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- default:
- assert(0);
- break;
- }
-
- __GLU_SWAP_IMAGE(srcImage,dstImage);
-
- if (newWidth > 1) { newWidth /= 2; rowSize /= 2;}
- if (newHeight > 1) { newHeight /= 2; imageSize = rowSize * newHeight; }
- if (newDepth > 1) newDepth /= 2;
- {
- /* call tex image with srcImage untouched since it's not padded */
- if (baseLevel <= level && level <= maxLevel) {
- glTexImage3D(target, level, internalFormat, newWidth, newHeight,
- newDepth,0, format, type, (void *) srcImage);
- }
- }
- } /* for level */
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
-
- free(srcImage); /*if you get to here, a srcImage has always been malloc'ed*/
- if (dstImage) { /* if it's non-rectangular and only 1 level */
- free(dstImage);
- }
- return 0;
-} /* gluBuild3DMipmapLevelsCore() */
-
-GLint GLAPIENTRY
-gluBuild3DMipmapLevels(GLenum target, GLint internalFormat,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type,
- GLint userLevel, GLint baseLevel, GLint maxLevel,
- const void *data)
-{
- int level, levels;
-
- int rc= checkMipmapArgs(internalFormat,format,type);
- if (rc != 0) return rc;
-
- if (width < 1 || height < 1 || depth < 1) {
- return GLU_INVALID_VALUE;
- }
-
- if(type == GL_BITMAP) {
- return GLU_INVALID_ENUM;
- }
-
- levels = computeLog(width);
- level = computeLog(height);
- if (level > levels) levels=level;
- level = computeLog(depth);
- if (level > levels) levels=level;
-
- levels+= userLevel;
- if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels))
- return GLU_INVALID_VALUE;
-
- return gluBuild3DMipmapLevelsCore(target, internalFormat,
- width, height, depth,
- width, height, depth,
- format, type,
- userLevel, baseLevel, maxLevel,
- data);
-} /* gluBuild3DMipmapLevels() */
-
-GLint GLAPIENTRY
-gluBuild3DMipmaps(GLenum target, GLint internalFormat,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, const void *data)
-{
- GLint widthPowerOf2, heightPowerOf2, depthPowerOf2;
- int level, levels;
-
- int rc= checkMipmapArgs(internalFormat,format,type);
- if (rc != 0) return rc;
-
- if (width < 1 || height < 1 || depth < 1) {
- return GLU_INVALID_VALUE;
- }
-
- if(type == GL_BITMAP) {
- return GLU_INVALID_ENUM;
- }
-
- closestFit3D(target,width,height,depth,internalFormat,format,type,
- &widthPowerOf2,&heightPowerOf2,&depthPowerOf2);
-
- levels = computeLog(widthPowerOf2);
- level = computeLog(heightPowerOf2);
- if (level > levels) levels=level;
- level = computeLog(depthPowerOf2);
- if (level > levels) levels=level;
-
- return gluBuild3DMipmapLevelsCore(target, internalFormat,
- width, height, depth,
- widthPowerOf2, heightPowerOf2,
- depthPowerOf2,
- format, type, 0, 0, levels,
- data);
-} /* gluBuild3DMipmaps() */
-
-static GLdouble extractUbyte(int isSwap, const void *ubyte)
-{
- isSwap= isSwap; /* turn off warnings */
-
- assert(*((const GLubyte *)ubyte) <= 255);
-
- return (GLdouble)(*((const GLubyte *)ubyte));
-} /* extractUbyte() */
-
-static void shoveUbyte(GLdouble value, int index, void *data)
-{
- assert(0.0 <= value && value < 256.0);
-
- ((GLubyte *)data)[index]= (GLubyte)value;
-} /* shoveUbyte() */
-
-static GLdouble extractSbyte(int isSwap, const void *sbyte)
-{
- isSwap= isSwap; /* turn off warnings */
-
- assert(*((const GLbyte *)sbyte) <= 127);
-
- return (GLdouble)(*((const GLbyte *)sbyte));
-} /* extractSbyte() */
-
-static void shoveSbyte(GLdouble value, int index, void *data)
-{
- ((GLbyte *)data)[index]= (GLbyte)value;
-} /* shoveSbyte() */
-
-static GLdouble extractUshort(int isSwap, const void *uitem)
-{
- GLushort ushort;
-
- if (isSwap) {
- ushort= __GLU_SWAP_2_BYTES(uitem);
- }
- else {
- ushort= *(const GLushort *)uitem;
- }
-
- assert(ushort <= 65535);
-
- return (GLdouble)ushort;
-} /* extractUshort() */
-
-static void shoveUshort(GLdouble value, int index, void *data)
-{
- assert(0.0 <= value && value < 65536.0);
-
- ((GLushort *)data)[index]= (GLushort)value;
-} /* shoveUshort() */
-
-static GLdouble extractSshort(int isSwap, const void *sitem)
-{
- GLshort sshort;
-
- if (isSwap) {
- sshort= __GLU_SWAP_2_BYTES(sitem);
- }
- else {
- sshort= *(const GLshort *)sitem;
- }
-
- assert(sshort <= 32767);
-
- return (GLdouble)sshort;
-} /* extractSshort() */
-
-static void shoveSshort(GLdouble value, int index, void *data)
-{
- assert(0.0 <= value && value < 32768.0);
-
- ((GLshort *)data)[index]= (GLshort)value;
-} /* shoveSshort() */
-
-static GLdouble extractUint(int isSwap, const void *uitem)
-{
- GLuint uint;
-
- if (isSwap) {
- uint= __GLU_SWAP_4_BYTES(uitem);
- }
- else {
- uint= *(const GLuint *)uitem;
- }
-
- assert(uint <= 0xffffffff);
-
- return (GLdouble)uint;
-} /* extractUint() */
-
-static void shoveUint(GLdouble value, int index, void *data)
-{
- assert(0.0 <= value && value <= (GLdouble) UINT_MAX);
-
- ((GLuint *)data)[index]= (GLuint)value;
-} /* shoveUint() */
-
-static GLdouble extractSint(int isSwap, const void *sitem)
-{
- GLint sint;
-
- if (isSwap) {
- sint= __GLU_SWAP_4_BYTES(sitem);
- }
- else {
- sint= *(const GLint *)sitem;
- }
-
- assert(sint <= 0x7fffffff);
-
- return (GLdouble)sint;
-} /* extractSint() */
-
-static void shoveSint(GLdouble value, int index, void *data)
-{
- assert(0.0 <= value && value <= (GLdouble) INT_MAX);
-
- ((GLint *)data)[index]= (GLint)value;
-} /* shoveSint() */
-
-static GLdouble extractFloat(int isSwap, const void *item)
-{
- GLfloat ffloat;
-
- if (isSwap) {
- ffloat= __GLU_SWAP_4_BYTES(item);
- }
- else {
- ffloat= *(const GLfloat *)item;
- }
-
- assert(ffloat <= 1.0);
-
- return (GLdouble)ffloat;
-} /* extractFloat() */
-
-static void shoveFloat(GLdouble value, int index, void *data)
-{
- assert(0.0 <= value && value <= 1.0);
-
- ((GLfloat *)data)[index]= value;
-} /* shoveFloat() */
-
-static void halveImageSlice(int components,
- GLdouble (*extract)(int, const void *),
- void (*shove)(GLdouble, int, void *),
- GLint width, GLint height, GLint depth,
- const void *dataIn, void *dataOut,
- GLint elementSizeInBytes,
- GLint groupSizeInBytes,
- GLint rowSizeInBytes,
- GLint imageSizeInBytes,
- GLint isSwap)
-{
- int ii, jj;
- int halfWidth= width / 2;
- int halfHeight= height / 2;
- int halfDepth= depth / 2;
- const char *src= (const char *)dataIn;
- int padBytes= rowSizeInBytes - (width * groupSizeInBytes);
- int outIndex= 0;
-
- assert((width == 1 || height == 1) && depth >= 2);
-
- if (width == height) { /* a 1-pixel column viewed from top */
- /* printf("1-column\n");*/
- assert(width == 1 && height == 1);
- assert(depth >= 2);
-
- for (ii= 0; ii< halfDepth; ii++) {
- int cc;
-
- for (cc = 0; cc < components; cc++) {
- double totals[4];
- double extractTotals[BOX2][4];
- int kk;
-
- extractTotals[0][cc]= (*extract)(isSwap,src);
- extractTotals[1][cc]= (*extract)(isSwap,(src+imageSizeInBytes));
-
- /* average 2 pixels since only a column */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED];
- * totals[RED]/= 2.0;
- */
- for (kk = 0; kk < BOX2; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (double)BOX2;
-
- (*shove)(totals[cc],outIndex,dataOut);
- outIndex++;
- src+= elementSizeInBytes;
- } /* for cc */
-
- /* skip over to next group of 2 */
- src+= rowSizeInBytes;
- } /* for ii */
-
- assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]);
- assert(outIndex == halfDepth * components);
- }
- else if (height == 1) { /* horizontal slice viewed from top */
- /* printf("horizontal slice\n"); */
- assert(width != 1);
-
- for (ii= 0; ii< halfDepth; ii++) {
- for (jj= 0; jj< halfWidth; jj++) {
- int cc;
-
- for (cc = 0; cc < components; cc++) {
- int kk;
- double totals[4];
- double extractTotals[BOX4][4];
-
- extractTotals[0][cc]=(*extract)(isSwap,src);
- extractTotals[1][cc]=(*extract)(isSwap,
- (src+groupSizeInBytes));
- extractTotals[2][cc]=(*extract)(isSwap,
- (src+imageSizeInBytes));
- extractTotals[3][cc]=(*extract)(isSwap,
- (src+imageSizeInBytes+groupSizeInBytes));
-
- /* grab 4 pixels to average */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
- * extractTotals[2][RED]+extractTotals[3][RED];
- * totals[RED]/= 4.0;
- */
- for (kk = 0; kk < BOX4; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (double)BOX4;
-
- (*shove)(totals[cc],outIndex,dataOut);
- outIndex++;
-
- src+= elementSizeInBytes;
- } /* for cc */
-
- /* skip over to next horizontal square of 4 */
- src+= groupSizeInBytes;
- } /* for jj */
- src+= padBytes;
-
- src+= rowSizeInBytes;
- } /* for ii */
-
- assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]);
- assert(outIndex == halfWidth * halfDepth * components);
- }
- else if (width == 1) { /* vertical slice viewed from top */
- /* printf("vertical slice\n"); */
- assert(height != 1);
-
- for (ii= 0; ii< halfDepth; ii++) {
- for (jj= 0; jj< halfHeight; jj++) {
- int cc;
-
- for (cc = 0; cc < components; cc++) {
- int kk;
- double totals[4];
- double extractTotals[BOX4][4];
-
- extractTotals[0][cc]=(*extract)(isSwap,src);
- extractTotals[1][cc]=(*extract)(isSwap,
- (src+rowSizeInBytes));
- extractTotals[2][cc]=(*extract)(isSwap,
- (src+imageSizeInBytes));
- extractTotals[3][cc]=(*extract)(isSwap,
- (src+imageSizeInBytes+rowSizeInBytes));
-
- /* grab 4 pixels to average */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
- * extractTotals[2][RED]+extractTotals[3][RED];
- * totals[RED]/= 4.0;
- */
- for (kk = 0; kk < BOX4; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (double)BOX4;
-
- (*shove)(totals[cc],outIndex,dataOut);
- outIndex++;
-
- src+= elementSizeInBytes;
- } /* for cc */
- src+= padBytes;
-
- /* skip over to next vertical square of 4 */
- src+= rowSizeInBytes;
- } /* for jj */
-
- src+= imageSizeInBytes;
- } /* for ii */
-
- assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]);
- assert(outIndex == halfHeight * halfDepth * components);
- }
-
-} /* halveImageSlice() */
-
-static void halveImage3D(int components,
- GLdouble (*extract)(int, const void *),
- void (*shove)(GLdouble, int, void *),
- GLint width, GLint height, GLint depth,
- const void *dataIn, void *dataOut,
- GLint elementSizeInBytes,
- GLint groupSizeInBytes,
- GLint rowSizeInBytes,
- GLint imageSizeInBytes,
- GLint isSwap)
-{
- assert(depth > 1);
-
- /* a horizontal/vertical/one-column slice viewed from top */
- if (width == 1 || height == 1) {
- assert(1 <= depth);
-
- halveImageSlice(components,extract,shove, width, height, depth,
- dataIn, dataOut, elementSizeInBytes, groupSizeInBytes,
- rowSizeInBytes, imageSizeInBytes, isSwap);
- return;
- }
- {
- int ii, jj, dd;
-
- int halfWidth= width / 2;
- int halfHeight= height / 2;
- int halfDepth= depth / 2;
- const char *src= (const char *) dataIn;
- int padBytes= rowSizeInBytes - (width*groupSizeInBytes);
- int outIndex= 0;
-
- for (dd= 0; dd < halfDepth; dd++) {
- for (ii= 0; ii< halfHeight; ii++) {
- for (jj= 0; jj< halfWidth; jj++) {
- int cc;
-
- for (cc= 0; cc < components; cc++) {
- int kk;
-#define BOX8 8
- double totals[4]; /* 4 is maximum components */
- double extractTotals[BOX8][4]; /* 4 is maximum components */
-
- extractTotals[0][cc]= (*extract)(isSwap,src);
- extractTotals[1][cc]= (*extract)(isSwap,
- (src+groupSizeInBytes));
- extractTotals[2][cc]= (*extract)(isSwap,
- (src+rowSizeInBytes));
- extractTotals[3][cc]= (*extract)(isSwap,
- (src+rowSizeInBytes+groupSizeInBytes));
-
- extractTotals[4][cc]= (*extract)(isSwap,
- (src+imageSizeInBytes));
-
- extractTotals[5][cc]= (*extract)(isSwap,
- (src+groupSizeInBytes+imageSizeInBytes));
- extractTotals[6][cc]= (*extract)(isSwap,
- (src+rowSizeInBytes+imageSizeInBytes));
- extractTotals[7][cc]= (*extract)(isSwap,
- (src+rowSizeInBytes+groupSizeInBytes+imageSizeInBytes));
-
- totals[cc]= 0.0;
-
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
- * extractTotals[2][RED]+extractTotals[3][RED]+
- * extractTotals[4][RED]+extractTotals[5][RED]+
- * extractTotals[6][RED]+extractTotals[7][RED];
- * totals[RED]/= 8.0;
- */
- for (kk = 0; kk < BOX8; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (double)BOX8;
-
- (*shove)(totals[cc],outIndex,dataOut);
-
- outIndex++;
-
- src+= elementSizeInBytes; /* go to next component */
- } /* for cc */
-
- /* skip over to next square of 4 */
- src+= groupSizeInBytes;
- } /* for jj */
- /* skip past pad bytes, if any, to get to next row */
- src+= padBytes;
-
- /* src is at beginning of a row here, but it's the second row of
- * the square block of 4 pixels that we just worked on so we
- * need to go one more row.
- * i.e.,
- * OO...
- * here -->OO...
- * but want -->OO...
- * OO...
- * ...
- */
- src+= rowSizeInBytes;
- } /* for ii */
-
- src+= imageSizeInBytes;
- } /* for dd */
-
- /* both pointers must reach one byte after the end */
- assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]);
- assert(outIndex == halfWidth * halfHeight * halfDepth * components);
- }
-} /* halveImage3D() */
-
-
-
-/*** mipmap.c ***/
-
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/project.c b/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/project.c
deleted file mode 100755
index 06958c37d..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/project.c
+++ /dev/null
@@ -1,379 +0,0 @@
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libutil/project.c,v 1.3 2002/02/22 21:32:49 dawes Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#include "gluos.h"
-#include <math.h>
-#include <GL/gl.h>
-#include <GL/glu.h>
-#include "gluint.h"
-
-/*
-** Make m an identity matrix
-*/
-static void __gluMakeIdentityd(GLdouble m[16])
-{
- m[0+4*0] = 1; m[0+4*1] = 0; m[0+4*2] = 0; m[0+4*3] = 0;
- m[1+4*0] = 0; m[1+4*1] = 1; m[1+4*2] = 0; m[1+4*3] = 0;
- m[2+4*0] = 0; m[2+4*1] = 0; m[2+4*2] = 1; m[2+4*3] = 0;
- m[3+4*0] = 0; m[3+4*1] = 0; m[3+4*2] = 0; m[3+4*3] = 1;
-}
-
-static void __gluMakeIdentityf(GLfloat m[16])
-{
- m[0+4*0] = 1; m[0+4*1] = 0; m[0+4*2] = 0; m[0+4*3] = 0;
- m[1+4*0] = 0; m[1+4*1] = 1; m[1+4*2] = 0; m[1+4*3] = 0;
- m[2+4*0] = 0; m[2+4*1] = 0; m[2+4*2] = 1; m[2+4*3] = 0;
- m[3+4*0] = 0; m[3+4*1] = 0; m[3+4*2] = 0; m[3+4*3] = 1;
-}
-
-void GLAPIENTRY
-gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top)
-{
- glOrtho(left, right, bottom, top, -1, 1);
-}
-
-#define __glPi 3.14159265358979323846
-
-void GLAPIENTRY
-gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar)
-{
- GLdouble m[4][4];
- double sine, cotangent, deltaZ;
- double radians = fovy / 2 * __glPi / 180;
-
- deltaZ = zFar - zNear;
- sine = sin(radians);
- if ((deltaZ == 0) || (sine == 0) || (aspect == 0)) {
- return;
- }
- cotangent = COS(radians) / sine;
-
- __gluMakeIdentityd(&m[0][0]);
- m[0][0] = cotangent / aspect;
- m[1][1] = cotangent;
- m[2][2] = -(zFar + zNear) / deltaZ;
- m[2][3] = -1;
- m[3][2] = -2 * zNear * zFar / deltaZ;
- m[3][3] = 0;
- glMultMatrixd(&m[0][0]);
-}
-
-static void normalize(float v[3])
-{
- float r;
-
- r = sqrt( v[0]*v[0] + v[1]*v[1] + v[2]*v[2] );
- if (r == 0.0) return;
-
- v[0] /= r;
- v[1] /= r;
- v[2] /= r;
-}
-
-static void cross(float v1[3], float v2[3], float result[3])
-{
- result[0] = v1[1]*v2[2] - v1[2]*v2[1];
- result[1] = v1[2]*v2[0] - v1[0]*v2[2];
- result[2] = v1[0]*v2[1] - v1[1]*v2[0];
-}
-
-void GLAPIENTRY
-gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx,
- GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy,
- GLdouble upz)
-{
- float forward[3], side[3], up[3];
- GLfloat m[4][4];
-
- forward[0] = centerx - eyex;
- forward[1] = centery - eyey;
- forward[2] = centerz - eyez;
-
- up[0] = upx;
- up[1] = upy;
- up[2] = upz;
-
- normalize(forward);
-
- /* Side = forward x up */
- cross(forward, up, side);
- normalize(side);
-
- /* Recompute up as: up = side x forward */
- cross(side, forward, up);
-
- __gluMakeIdentityf(&m[0][0]);
- m[0][0] = side[0];
- m[1][0] = side[1];
- m[2][0] = side[2];
-
- m[0][1] = up[0];
- m[1][1] = up[1];
- m[2][1] = up[2];
-
- m[0][2] = -forward[0];
- m[1][2] = -forward[1];
- m[2][2] = -forward[2];
-
- glMultMatrixf(&m[0][0]);
- glTranslated(-eyex, -eyey, -eyez);
-}
-
-static void __gluMultMatrixVecd(const GLdouble matrix[16], const GLdouble in[4],
- GLdouble out[4])
-{
- int i;
-
- for (i=0; i<4; i++) {
- out[i] =
- in[0] * matrix[0*4+i] +
- in[1] * matrix[1*4+i] +
- in[2] * matrix[2*4+i] +
- in[3] * matrix[3*4+i];
- }
-}
-
-/*
-** inverse = invert(src)
-*/
-static int __gluInvertMatrixd(const GLdouble src[16], GLdouble inverse[16])
-{
- int i, j, k, swap;
- double t;
- GLdouble temp[4][4];
-
- for (i=0; i<4; i++) {
- for (j=0; j<4; j++) {
- temp[i][j] = src[i*4+j];
- }
- }
- __gluMakeIdentityd(inverse);
-
- for (i = 0; i < 4; i++) {
- /*
- ** Look for largest element in column
- */
- swap = i;
- for (j = i + 1; j < 4; j++) {
- if (fabs(temp[j][i]) > fabs(temp[i][i])) {
- swap = j;
- }
- }
-
- if (swap != i) {
- /*
- ** Swap rows.
- */
- for (k = 0; k < 4; k++) {
- t = temp[i][k];
- temp[i][k] = temp[swap][k];
- temp[swap][k] = t;
-
- t = inverse[i*4+k];
- inverse[i*4+k] = inverse[swap*4+k];
- inverse[swap*4+k] = t;
- }
- }
-
- if (temp[i][i] == 0) {
- /*
- ** No non-zero pivot. The matrix is singular, which shouldn't
- ** happen. This means the user gave us a bad matrix.
- */
- return GL_FALSE;
- }
-
- t = temp[i][i];
- for (k = 0; k < 4; k++) {
- temp[i][k] /= t;
- inverse[i*4+k] /= t;
- }
- for (j = 0; j < 4; j++) {
- if (j != i) {
- t = temp[j][i];
- for (k = 0; k < 4; k++) {
- temp[j][k] -= temp[i][k]*t;
- inverse[j*4+k] -= inverse[i*4+k]*t;
- }
- }
- }
- }
- return GL_TRUE;
-}
-
-static void __gluMultMatricesd(const GLdouble a[16], const GLdouble b[16],
- GLdouble r[16])
-{
- int i, j;
-
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 4; j++) {
- r[i*4+j] =
- a[i*4+0]*b[0*4+j] +
- a[i*4+1]*b[1*4+j] +
- a[i*4+2]*b[2*4+j] +
- a[i*4+3]*b[3*4+j];
- }
- }
-}
-
-GLint GLAPIENTRY
-gluProject(GLdouble objx, GLdouble objy, GLdouble objz,
- const GLdouble modelMatrix[16],
- const GLdouble projMatrix[16],
- const GLint viewport[4],
- GLdouble *winx, GLdouble *winy, GLdouble *winz)
-{
- double in[4];
- double out[4];
-
- in[0]=objx;
- in[1]=objy;
- in[2]=objz;
- in[3]=1.0;
- __gluMultMatrixVecd(modelMatrix, in, out);
- __gluMultMatrixVecd(projMatrix, out, in);
- if (in[3] == 0.0) return(GL_FALSE);
- in[0] /= in[3];
- in[1] /= in[3];
- in[2] /= in[3];
- /* Map x, y and z to range 0-1 */
- in[0] = in[0] * 0.5 + 0.5;
- in[1] = in[1] * 0.5 + 0.5;
- in[2] = in[2] * 0.5 + 0.5;
-
- /* Map x,y to viewport */
- in[0] = in[0] * viewport[2] + viewport[0];
- in[1] = in[1] * viewport[3] + viewport[1];
-
- *winx=in[0];
- *winy=in[1];
- *winz=in[2];
- return(GL_TRUE);
-}
-
-GLint GLAPIENTRY
-gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz,
- const GLdouble modelMatrix[16],
- const GLdouble projMatrix[16],
- const GLint viewport[4],
- GLdouble *objx, GLdouble *objy, GLdouble *objz)
-{
- double finalMatrix[16];
- double in[4];
- double out[4];
-
- __gluMultMatricesd(modelMatrix, projMatrix, finalMatrix);
- if (!__gluInvertMatrixd(finalMatrix, finalMatrix)) return(GL_FALSE);
-
- in[0]=winx;
- in[1]=winy;
- in[2]=winz;
- in[3]=1.0;
-
- /* Map x and y from window coordinates */
- in[0] = (in[0] - viewport[0]) / viewport[2];
- in[1] = (in[1] - viewport[1]) / viewport[3];
-
- /* Map to range -1 to 1 */
- in[0] = in[0] * 2 - 1;
- in[1] = in[1] * 2 - 1;
- in[2] = in[2] * 2 - 1;
-
- __gluMultMatrixVecd(finalMatrix, in, out);
- if (out[3] == 0.0) return(GL_FALSE);
- out[0] /= out[3];
- out[1] /= out[3];
- out[2] /= out[3];
- *objx = out[0];
- *objy = out[1];
- *objz = out[2];
- return(GL_TRUE);
-}
-
-GLint GLAPIENTRY
-gluUnProject4(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw,
- const GLdouble modelMatrix[16],
- const GLdouble projMatrix[16],
- const GLint viewport[4],
- GLclampd near, GLclampd far,
- GLdouble *objx, GLdouble *objy, GLdouble *objz,
- GLdouble *objw)
-{
- double finalMatrix[16];
- double in[4];
- double out[4];
-
- __gluMultMatricesd(modelMatrix, projMatrix, finalMatrix);
- if (!__gluInvertMatrixd(finalMatrix, finalMatrix)) return(GL_FALSE);
-
- in[0]=winx;
- in[1]=winy;
- in[2]=winz;
- in[3]=clipw;
-
- /* Map x and y from window coordinates */
- in[0] = (in[0] - viewport[0]) / viewport[2];
- in[1] = (in[1] - viewport[1]) / viewport[3];
- in[2] = (in[2] - near) / (far - near);
-
- /* Map to range -1 to 1 */
- in[0] = in[0] * 2 - 1;
- in[1] = in[1] * 2 - 1;
- in[2] = in[2] * 2 - 1;
-
- __gluMultMatrixVecd(finalMatrix, in, out);
- if (out[3] == 0.0) return(GL_FALSE);
- *objx = out[0];
- *objy = out[1];
- *objz = out[2];
- *objw = out[3];
- return(GL_TRUE);
-}
-
-void GLAPIENTRY
-gluPickMatrix(GLdouble x, GLdouble y, GLdouble deltax, GLdouble deltay,
- GLint viewport[4])
-{
- if (deltax <= 0 || deltay <= 0) {
- return;
- }
-
- /* Translate and scale the picked region to the entire window */
- glTranslatef((viewport[2] - 2 * (x - viewport[0])) / deltax,
- (viewport[3] - 2 * (y - viewport[1])) / deltay, 0);
- glScalef(viewport[2] / deltax, viewport[3] / deltay, 1.0);
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/quad.c b/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/quad.c
deleted file mode 100755
index 258b95a6e..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/quad.c
+++ /dev/null
@@ -1,1161 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libutil/quad.c,v 1.3 2001/10/28 03:32:24 tsi Exp $ */
-
-#include "gluos.h"
-#include "gluint.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/gl.h>
-#include <GL/glu.h>
-
-/* Make it not a power of two to avoid cache thrashing on the chip */
-#define CACHE_SIZE 240
-
-#define PI 3.14159265358979323846
-
-struct GLUquadric {
- GLint normals;
- GLboolean textureCoords;
- GLint orientation;
- GLint drawStyle;
- void (GLAPIENTRY *errorCallback)( GLint );
-};
-
-GLUquadric * GLAPIENTRY
-gluNewQuadric(void)
-{
- GLUquadric *newstate;
-
- newstate = (GLUquadric *) malloc(sizeof(GLUquadric));
- if (newstate == NULL) {
- /* Can't report an error at this point... */
- return NULL;
- }
- newstate->normals = GLU_SMOOTH;
- newstate->textureCoords = GL_FALSE;
- newstate->orientation = GLU_OUTSIDE;
- newstate->drawStyle = GLU_FILL;
- newstate->errorCallback = NULL;
- return newstate;
-}
-
-
-void GLAPIENTRY
-gluDeleteQuadric(GLUquadric *state)
-{
- free(state);
-}
-
-static void gluQuadricError(GLUquadric *qobj, GLenum which)
-{
- if (qobj->errorCallback) {
- qobj->errorCallback(which);
- }
-}
-
-void GLAPIENTRY
-gluQuadricCallback(GLUquadric *qobj, GLenum which,
- GLvoid (GLAPIENTRY *fn)(GLvoid))
-{
- switch (which) {
- case GLU_ERROR:
- qobj->errorCallback = (void (GLAPIENTRY *)(GLint)) fn;
- break;
- default:
- gluQuadricError(qobj, GLU_INVALID_ENUM);
- return;
- }
-}
-
-void GLAPIENTRY
-gluQuadricNormals(GLUquadric *qobj, GLenum normals)
-{
- switch (normals) {
- case GLU_SMOOTH:
- case GLU_FLAT:
- case GLU_NONE:
- break;
- default:
- gluQuadricError(qobj, GLU_INVALID_ENUM);
- return;
- }
- qobj->normals = normals;
-}
-
-void GLAPIENTRY
-gluQuadricTexture(GLUquadric *qobj, GLboolean textureCoords)
-{
- qobj->textureCoords = textureCoords;
-}
-
-void GLAPIENTRY
-gluQuadricOrientation(GLUquadric *qobj, GLenum orientation)
-{
- switch(orientation) {
- case GLU_OUTSIDE:
- case GLU_INSIDE:
- break;
- default:
- gluQuadricError(qobj, GLU_INVALID_ENUM);
- return;
- }
- qobj->orientation = orientation;
-}
-
-void GLAPIENTRY
-gluQuadricDrawStyle(GLUquadric *qobj, GLenum drawStyle)
-{
- switch(drawStyle) {
- case GLU_POINT:
- case GLU_LINE:
- case GLU_FILL:
- case GLU_SILHOUETTE:
- break;
- default:
- gluQuadricError(qobj, GLU_INVALID_ENUM);
- return;
- }
- qobj->drawStyle = drawStyle;
-}
-
-void GLAPIENTRY
-gluCylinder(GLUquadric *qobj, GLdouble baseRadius, GLdouble topRadius,
- GLdouble height, GLint slices, GLint stacks)
-{
- GLint i, j;
- GLfloat sinCache[CACHE_SIZE];
- GLfloat cosCache[CACHE_SIZE];
- GLfloat sinCache2[CACHE_SIZE];
- GLfloat cosCache2[CACHE_SIZE];
- GLfloat sinCache3[CACHE_SIZE];
- GLfloat cosCache3[CACHE_SIZE];
- GLfloat angle;
- GLfloat zLow, zHigh;
- GLfloat sintemp, costemp;
- GLfloat length;
- GLfloat deltaRadius;
- GLfloat zNormal;
- GLfloat xyNormalRatio;
- GLfloat radiusLow, radiusHigh;
- int needCache2, needCache3;
-
- if (slices >= CACHE_SIZE) slices = CACHE_SIZE-1;
-
- if (slices < 2 || stacks < 1 || baseRadius < 0.0 || topRadius < 0.0 ||
- height < 0.0) {
- gluQuadricError(qobj, GLU_INVALID_VALUE);
- return;
- }
-
- /* Compute length (needed for normal calculations) */
- deltaRadius = baseRadius - topRadius;
- length = SQRT(deltaRadius*deltaRadius + height*height);
- if (length == 0.0) {
- gluQuadricError(qobj, GLU_INVALID_VALUE);
- return;
- }
-
- /* Cache is the vertex locations cache */
- /* Cache2 is the various normals at the vertices themselves */
- /* Cache3 is the various normals for the faces */
- needCache2 = needCache3 = 0;
- if (qobj->normals == GLU_SMOOTH) {
- needCache2 = 1;
- }
-
- if (qobj->normals == GLU_FLAT) {
- if (qobj->drawStyle != GLU_POINT) {
- needCache3 = 1;
- }
- if (qobj->drawStyle == GLU_LINE) {
- needCache2 = 1;
- }
- }
-
- zNormal = deltaRadius / length;
- xyNormalRatio = height / length;
-
- for (i = 0; i < slices; i++) {
- angle = 2 * PI * i / slices;
- if (needCache2) {
- if (qobj->orientation == GLU_OUTSIDE) {
- sinCache2[i] = xyNormalRatio * SIN(angle);
- cosCache2[i] = xyNormalRatio * COS(angle);
- } else {
- sinCache2[i] = -xyNormalRatio * SIN(angle);
- cosCache2[i] = -xyNormalRatio * COS(angle);
- }
- }
- sinCache[i] = SIN(angle);
- cosCache[i] = COS(angle);
- }
-
- if (needCache3) {
- for (i = 0; i < slices; i++) {
- angle = 2 * PI * (i-0.5) / slices;
- if (qobj->orientation == GLU_OUTSIDE) {
- sinCache3[i] = xyNormalRatio * SIN(angle);
- cosCache3[i] = xyNormalRatio * COS(angle);
- } else {
- sinCache3[i] = -xyNormalRatio * SIN(angle);
- cosCache3[i] = -xyNormalRatio * COS(angle);
- }
- }
- }
-
- sinCache[slices] = sinCache[0];
- cosCache[slices] = cosCache[0];
- if (needCache2) {
- sinCache2[slices] = sinCache2[0];
- cosCache2[slices] = cosCache2[0];
- }
- if (needCache3) {
- sinCache3[slices] = sinCache3[0];
- cosCache3[slices] = cosCache3[0];
- }
-
- switch (qobj->drawStyle) {
- case GLU_FILL:
- /* Note:
- ** An argument could be made for using a TRIANGLE_FAN for the end
- ** of the cylinder of either radii is 0.0 (a cone). However, a
- ** TRIANGLE_FAN would not work in smooth shading mode (the common
- ** case) because the normal for the apex is different for every
- ** triangle (and TRIANGLE_FAN doesn't let me respecify that normal).
- ** Now, my choice is GL_TRIANGLES, or leave the GL_QUAD_STRIP and
- ** just let the GL trivially reject one of the two triangles of the
- ** QUAD. GL_QUAD_STRIP is probably faster, so I will leave this code
- ** alone.
- */
- for (j = 0; j < stacks; j++) {
- zLow = j * height / stacks;
- zHigh = (j + 1) * height / stacks;
- radiusLow = baseRadius - deltaRadius * ((float) j / stacks);
- radiusHigh = baseRadius - deltaRadius * ((float) (j + 1) / stacks);
-
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i <= slices; i++) {
- switch(qobj->normals) {
- case GLU_FLAT:
- glNormal3f(sinCache3[i], cosCache3[i], zNormal);
- break;
- case GLU_SMOOTH:
- glNormal3f(sinCache2[i], cosCache2[i], zNormal);
- break;
- case GLU_NONE:
- default:
- break;
- }
- if (qobj->orientation == GLU_OUTSIDE) {
- if (qobj->textureCoords) {
- glTexCoord2f(1 - (float) i / slices,
- (float) j / stacks);
- }
- glVertex3f(radiusLow * sinCache[i],
- radiusLow * cosCache[i], zLow);
- if (qobj->textureCoords) {
- glTexCoord2f(1 - (float) i / slices,
- (float) (j+1) / stacks);
- }
- glVertex3f(radiusHigh * sinCache[i],
- radiusHigh * cosCache[i], zHigh);
- } else {
- if (qobj->textureCoords) {
- glTexCoord2f(1 - (float) i / slices,
- (float) (j+1) / stacks);
- }
- glVertex3f(radiusHigh * sinCache[i],
- radiusHigh * cosCache[i], zHigh);
- if (qobj->textureCoords) {
- glTexCoord2f(1 - (float) i / slices,
- (float) j / stacks);
- }
- glVertex3f(radiusLow * sinCache[i],
- radiusLow * cosCache[i], zLow);
- }
- }
- glEnd();
- }
- break;
- case GLU_POINT:
- glBegin(GL_POINTS);
- for (i = 0; i < slices; i++) {
- switch(qobj->normals) {
- case GLU_FLAT:
- case GLU_SMOOTH:
- glNormal3f(sinCache2[i], cosCache2[i], zNormal);
- break;
- case GLU_NONE:
- default:
- break;
- }
- sintemp = sinCache[i];
- costemp = cosCache[i];
- for (j = 0; j <= stacks; j++) {
- zLow = j * height / stacks;
- radiusLow = baseRadius - deltaRadius * ((float) j / stacks);
-
- if (qobj->textureCoords) {
- glTexCoord2f(1 - (float) i / slices,
- (float) j / stacks);
- }
- glVertex3f(radiusLow * sintemp,
- radiusLow * costemp, zLow);
- }
- }
- glEnd();
- break;
- case GLU_LINE:
- for (j = 1; j < stacks; j++) {
- zLow = j * height / stacks;
- radiusLow = baseRadius - deltaRadius * ((float) j / stacks);
-
- glBegin(GL_LINE_STRIP);
- for (i = 0; i <= slices; i++) {
- switch(qobj->normals) {
- case GLU_FLAT:
- glNormal3f(sinCache3[i], cosCache3[i], zNormal);
- break;
- case GLU_SMOOTH:
- glNormal3f(sinCache2[i], cosCache2[i], zNormal);
- break;
- case GLU_NONE:
- default:
- break;
- }
- if (qobj->textureCoords) {
- glTexCoord2f(1 - (float) i / slices,
- (float) j / stacks);
- }
- glVertex3f(radiusLow * sinCache[i],
- radiusLow * cosCache[i], zLow);
- }
- glEnd();
- }
- /* Intentionally fall through here... */
- case GLU_SILHOUETTE:
- for (j = 0; j <= stacks; j += stacks) {
- zLow = j * height / stacks;
- radiusLow = baseRadius - deltaRadius * ((float) j / stacks);
-
- glBegin(GL_LINE_STRIP);
- for (i = 0; i <= slices; i++) {
- switch(qobj->normals) {
- case GLU_FLAT:
- glNormal3f(sinCache3[i], cosCache3[i], zNormal);
- break;
- case GLU_SMOOTH:
- glNormal3f(sinCache2[i], cosCache2[i], zNormal);
- break;
- case GLU_NONE:
- default:
- break;
- }
- if (qobj->textureCoords) {
- glTexCoord2f(1 - (float) i / slices,
- (float) j / stacks);
- }
- glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i],
- zLow);
- }
- glEnd();
- }
- for (i = 0; i < slices; i++) {
- switch(qobj->normals) {
- case GLU_FLAT:
- case GLU_SMOOTH:
- glNormal3f(sinCache2[i], cosCache2[i], 0.0);
- break;
- case GLU_NONE:
- default:
- break;
- }
- sintemp = sinCache[i];
- costemp = cosCache[i];
- glBegin(GL_LINE_STRIP);
- for (j = 0; j <= stacks; j++) {
- zLow = j * height / stacks;
- radiusLow = baseRadius - deltaRadius * ((float) j / stacks);
-
- if (qobj->textureCoords) {
- glTexCoord2f(1 - (float) i / slices,
- (float) j / stacks);
- }
- glVertex3f(radiusLow * sintemp,
- radiusLow * costemp, zLow);
- }
- glEnd();
- }
- break;
- default:
- break;
- }
-}
-
-void GLAPIENTRY
-gluDisk(GLUquadric *qobj, GLdouble innerRadius, GLdouble outerRadius,
- GLint slices, GLint loops)
-{
- gluPartialDisk(qobj, innerRadius, outerRadius, slices, loops, 0.0, 360.0);
-}
-
-void GLAPIENTRY
-gluPartialDisk(GLUquadric *qobj, GLdouble innerRadius,
- GLdouble outerRadius, GLint slices, GLint loops,
- GLdouble startAngle, GLdouble sweepAngle)
-{
- GLint i, j;
- GLfloat sinCache[CACHE_SIZE];
- GLfloat cosCache[CACHE_SIZE];
- GLfloat angle;
- GLfloat sintemp, costemp;
- GLfloat deltaRadius;
- GLfloat radiusLow, radiusHigh;
- GLfloat texLow = 0, texHigh = 0;
- GLfloat angleOffset;
- GLint slices2;
- GLint finish;
-
- if (slices >= CACHE_SIZE) slices = CACHE_SIZE-1;
- if (slices < 2 || loops < 1 || outerRadius <= 0.0 || innerRadius < 0.0 ||
- innerRadius > outerRadius) {
- gluQuadricError(qobj, GLU_INVALID_VALUE);
- return;
- }
-
- if (sweepAngle < -360.0) sweepAngle = 360.0;
- if (sweepAngle > 360.0) sweepAngle = 360.0;
- if (sweepAngle < 0) {
- startAngle += sweepAngle;
- sweepAngle = -sweepAngle;
- }
-
- if (sweepAngle == 360.0) {
- slices2 = slices;
- } else {
- slices2 = slices + 1;
- }
-
- /* Compute length (needed for normal calculations) */
- deltaRadius = outerRadius - innerRadius;
-
- /* Cache is the vertex locations cache */
-
- angleOffset = startAngle / 180.0 * PI;
- for (i = 0; i <= slices; i++) {
- angle = angleOffset + ((PI * sweepAngle) / 180.0) * i / slices;
- sinCache[i] = SIN(angle);
- cosCache[i] = COS(angle);
- }
-
- if (sweepAngle == 360.0) {
- sinCache[slices] = sinCache[0];
- cosCache[slices] = cosCache[0];
- }
-
- switch(qobj->normals) {
- case GLU_FLAT:
- case GLU_SMOOTH:
- if (qobj->orientation == GLU_OUTSIDE) {
- glNormal3f(0.0, 0.0, 1.0);
- } else {
- glNormal3f(0.0, 0.0, -1.0);
- }
- break;
- default:
- case GLU_NONE:
- break;
- }
-
- switch (qobj->drawStyle) {
- case GLU_FILL:
- if (innerRadius == 0.0) {
- finish = loops - 1;
- /* Triangle strip for inner polygons */
- glBegin(GL_TRIANGLE_FAN);
- if (qobj->textureCoords) {
- glTexCoord2f(0.5, 0.5);
- }
- glVertex3f(0.0, 0.0, 0.0);
- radiusLow = outerRadius -
- deltaRadius * ((float) (loops-1) / loops);
- if (qobj->textureCoords) {
- texLow = radiusLow / outerRadius / 2;
- }
-
- if (qobj->orientation == GLU_OUTSIDE) {
- for (i = slices; i >= 0; i--) {
- if (qobj->textureCoords) {
- glTexCoord2f(texLow * sinCache[i] + 0.5,
- texLow * cosCache[i] + 0.5);
- }
- glVertex3f(radiusLow * sinCache[i],
- radiusLow * cosCache[i], 0.0);
- }
- } else {
- for (i = 0; i <= slices; i++) {
- if (qobj->textureCoords) {
- glTexCoord2f(texLow * sinCache[i] + 0.5,
- texLow * cosCache[i] + 0.5);
- }
- glVertex3f(radiusLow * sinCache[i],
- radiusLow * cosCache[i], 0.0);
- }
- }
- glEnd();
- } else {
- finish = loops;
- }
- for (j = 0; j < finish; j++) {
- radiusLow = outerRadius - deltaRadius * ((float) j / loops);
- radiusHigh = outerRadius - deltaRadius * ((float) (j + 1) / loops);
- if (qobj->textureCoords) {
- texLow = radiusLow / outerRadius / 2;
- texHigh = radiusHigh / outerRadius / 2;
- }
-
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i <= slices; i++) {
- if (qobj->orientation == GLU_OUTSIDE) {
- if (qobj->textureCoords) {
- glTexCoord2f(texLow * sinCache[i] + 0.5,
- texLow * cosCache[i] + 0.5);
- }
- glVertex3f(radiusLow * sinCache[i],
- radiusLow * cosCache[i], 0.0);
-
- if (qobj->textureCoords) {
- glTexCoord2f(texHigh * sinCache[i] + 0.5,
- texHigh * cosCache[i] + 0.5);
- }
- glVertex3f(radiusHigh * sinCache[i],
- radiusHigh * cosCache[i], 0.0);
- } else {
- if (qobj->textureCoords) {
- glTexCoord2f(texHigh * sinCache[i] + 0.5,
- texHigh * cosCache[i] + 0.5);
- }
- glVertex3f(radiusHigh * sinCache[i],
- radiusHigh * cosCache[i], 0.0);
-
- if (qobj->textureCoords) {
- glTexCoord2f(texLow * sinCache[i] + 0.5,
- texLow * cosCache[i] + 0.5);
- }
- glVertex3f(radiusLow * sinCache[i],
- radiusLow * cosCache[i], 0.0);
- }
- }
- glEnd();
- }
- break;
- case GLU_POINT:
- glBegin(GL_POINTS);
- for (i = 0; i < slices2; i++) {
- sintemp = sinCache[i];
- costemp = cosCache[i];
- for (j = 0; j <= loops; j++) {
- radiusLow = outerRadius - deltaRadius * ((float) j / loops);
-
- if (qobj->textureCoords) {
- texLow = radiusLow / outerRadius / 2;
-
- glTexCoord2f(texLow * sinCache[i] + 0.5,
- texLow * cosCache[i] + 0.5);
- }
- glVertex3f(radiusLow * sintemp, radiusLow * costemp, 0.0);
- }
- }
- glEnd();
- break;
- case GLU_LINE:
- if (innerRadius == outerRadius) {
- glBegin(GL_LINE_STRIP);
-
- for (i = 0; i <= slices; i++) {
- if (qobj->textureCoords) {
- glTexCoord2f(sinCache[i] / 2 + 0.5,
- cosCache[i] / 2 + 0.5);
- }
- glVertex3f(innerRadius * sinCache[i],
- innerRadius * cosCache[i], 0.0);
- }
- glEnd();
- break;
- }
- for (j = 0; j <= loops; j++) {
- radiusLow = outerRadius - deltaRadius * ((float) j / loops);
- if (qobj->textureCoords) {
- texLow = radiusLow / outerRadius / 2;
- }
-
- glBegin(GL_LINE_STRIP);
- for (i = 0; i <= slices; i++) {
- if (qobj->textureCoords) {
- glTexCoord2f(texLow * sinCache[i] + 0.5,
- texLow * cosCache[i] + 0.5);
- }
- glVertex3f(radiusLow * sinCache[i],
- radiusLow * cosCache[i], 0.0);
- }
- glEnd();
- }
- for (i=0; i < slices2; i++) {
- sintemp = sinCache[i];
- costemp = cosCache[i];
- glBegin(GL_LINE_STRIP);
- for (j = 0; j <= loops; j++) {
- radiusLow = outerRadius - deltaRadius * ((float) j / loops);
- if (qobj->textureCoords) {
- texLow = radiusLow / outerRadius / 2;
- }
-
- if (qobj->textureCoords) {
- glTexCoord2f(texLow * sinCache[i] + 0.5,
- texLow * cosCache[i] + 0.5);
- }
- glVertex3f(radiusLow * sintemp, radiusLow * costemp, 0.0);
- }
- glEnd();
- }
- break;
- case GLU_SILHOUETTE:
- if (sweepAngle < 360.0) {
- for (i = 0; i <= slices; i+= slices) {
- sintemp = sinCache[i];
- costemp = cosCache[i];
- glBegin(GL_LINE_STRIP);
- for (j = 0; j <= loops; j++) {
- radiusLow = outerRadius - deltaRadius * ((float) j / loops);
-
- if (qobj->textureCoords) {
- texLow = radiusLow / outerRadius / 2;
- glTexCoord2f(texLow * sinCache[i] + 0.5,
- texLow * cosCache[i] + 0.5);
- }
- glVertex3f(radiusLow * sintemp, radiusLow * costemp, 0.0);
- }
- glEnd();
- }
- }
- for (j = 0; j <= loops; j += loops) {
- radiusLow = outerRadius - deltaRadius * ((float) j / loops);
- if (qobj->textureCoords) {
- texLow = radiusLow / outerRadius / 2;
- }
-
- glBegin(GL_LINE_STRIP);
- for (i = 0; i <= slices; i++) {
- if (qobj->textureCoords) {
- glTexCoord2f(texLow * sinCache[i] + 0.5,
- texLow * cosCache[i] + 0.5);
- }
- glVertex3f(radiusLow * sinCache[i],
- radiusLow * cosCache[i], 0.0);
- }
- glEnd();
- if (innerRadius == outerRadius) break;
- }
- break;
- default:
- break;
- }
-}
-
-void GLAPIENTRY
-gluSphere(GLUquadric *qobj, GLdouble radius, GLint slices, GLint stacks)
-{
- GLint i, j;
- GLfloat sinCache1a[CACHE_SIZE];
- GLfloat cosCache1a[CACHE_SIZE];
- GLfloat sinCache2a[CACHE_SIZE];
- GLfloat cosCache2a[CACHE_SIZE];
- GLfloat sinCache3a[CACHE_SIZE];
- GLfloat cosCache3a[CACHE_SIZE];
- GLfloat sinCache1b[CACHE_SIZE];
- GLfloat cosCache1b[CACHE_SIZE];
- GLfloat sinCache2b[CACHE_SIZE];
- GLfloat cosCache2b[CACHE_SIZE];
- GLfloat sinCache3b[CACHE_SIZE];
- GLfloat cosCache3b[CACHE_SIZE];
- GLfloat angle;
- GLfloat zLow, zHigh;
- GLfloat sintemp1, sintemp2 = 0, sintemp3 = 0, sintemp4 = 0;
- GLfloat costemp1, costemp2 = 0, costemp3 = 0, costemp4 = 0;
- GLboolean needCache2, needCache3;
- GLint start, finish;
-
- if (slices >= CACHE_SIZE) slices = CACHE_SIZE-1;
- if (stacks >= CACHE_SIZE) stacks = CACHE_SIZE-1;
- if (slices < 2 || stacks < 1 || radius < 0.0) {
- gluQuadricError(qobj, GLU_INVALID_VALUE);
- return;
- }
-
- /* Cache is the vertex locations cache */
- /* Cache2 is the various normals at the vertices themselves */
- /* Cache3 is the various normals for the faces */
- needCache2 = needCache3 = GL_FALSE;
-
- if (qobj->normals == GLU_SMOOTH) {
- needCache2 = GL_TRUE;
- }
-
- if (qobj->normals == GLU_FLAT) {
- if (qobj->drawStyle != GLU_POINT) {
- needCache3 = GL_TRUE;
- }
- if (qobj->drawStyle == GLU_LINE) {
- needCache2 = GL_TRUE;
- }
- }
-
- for (i = 0; i < slices; i++) {
- angle = 2 * PI * i / slices;
- sinCache1a[i] = SIN(angle);
- cosCache1a[i] = COS(angle);
- if (needCache2) {
- sinCache2a[i] = sinCache1a[i];
- cosCache2a[i] = cosCache1a[i];
- }
- }
-
- for (j = 0; j <= stacks; j++) {
- angle = PI * j / stacks;
- if (needCache2) {
- if (qobj->orientation == GLU_OUTSIDE) {
- sinCache2b[j] = SIN(angle);
- cosCache2b[j] = COS(angle);
- } else {
- sinCache2b[j] = -SIN(angle);
- cosCache2b[j] = -COS(angle);
- }
- }
- sinCache1b[j] = radius * SIN(angle);
- cosCache1b[j] = radius * COS(angle);
- }
- /* Make sure it comes to a point */
- sinCache1b[0] = 0;
- sinCache1b[stacks] = 0;
-
- if (needCache3) {
- for (i = 0; i < slices; i++) {
- angle = 2 * PI * (i-0.5) / slices;
- sinCache3a[i] = SIN(angle);
- cosCache3a[i] = COS(angle);
- }
- for (j = 0; j <= stacks; j++) {
- angle = PI * (j - 0.5) / stacks;
- if (qobj->orientation == GLU_OUTSIDE) {
- sinCache3b[j] = SIN(angle);
- cosCache3b[j] = COS(angle);
- } else {
- sinCache3b[j] = -SIN(angle);
- cosCache3b[j] = -COS(angle);
- }
- }
- }
-
- sinCache1a[slices] = sinCache1a[0];
- cosCache1a[slices] = cosCache1a[0];
- if (needCache2) {
- sinCache2a[slices] = sinCache2a[0];
- cosCache2a[slices] = cosCache2a[0];
- }
- if (needCache3) {
- sinCache3a[slices] = sinCache3a[0];
- cosCache3a[slices] = cosCache3a[0];
- }
-
- switch (qobj->drawStyle) {
- case GLU_FILL:
- /* Do ends of sphere as TRIANGLE_FAN's (if not texturing)
- ** We don't do it when texturing because we need to respecify the
- ** texture coordinates of the apex for every adjacent vertex (because
- ** it isn't a constant for that point)
- */
- if (!(qobj->textureCoords)) {
- start = 1;
- finish = stacks - 1;
-
- /* Low end first (j == 0 iteration) */
- sintemp2 = sinCache1b[1];
- zHigh = cosCache1b[1];
- switch(qobj->normals) {
- case GLU_FLAT:
- sintemp3 = sinCache3b[1];
- costemp3 = cosCache3b[1];
- break;
- case GLU_SMOOTH:
- sintemp3 = sinCache2b[1];
- costemp3 = cosCache2b[1];
- glNormal3f(sinCache2a[0] * sinCache2b[0],
- cosCache2a[0] * sinCache2b[0],
- cosCache2b[0]);
- break;
- default:
- break;
- }
- glBegin(GL_TRIANGLE_FAN);
- glVertex3f(0.0, 0.0, radius);
- if (qobj->orientation == GLU_OUTSIDE) {
- for (i = slices; i >= 0; i--) {
- switch(qobj->normals) {
- case GLU_SMOOTH:
- glNormal3f(sinCache2a[i] * sintemp3,
- cosCache2a[i] * sintemp3,
- costemp3);
- break;
- case GLU_FLAT:
- if (i != slices) {
- glNormal3f(sinCache3a[i+1] * sintemp3,
- cosCache3a[i+1] * sintemp3,
- costemp3);
- }
- break;
- case GLU_NONE:
- default:
- break;
- }
- glVertex3f(sintemp2 * sinCache1a[i],
- sintemp2 * cosCache1a[i], zHigh);
- }
- } else {
- for (i = 0; i <= slices; i++) {
- switch(qobj->normals) {
- case GLU_SMOOTH:
- glNormal3f(sinCache2a[i] * sintemp3,
- cosCache2a[i] * sintemp3,
- costemp3);
- break;
- case GLU_FLAT:
- glNormal3f(sinCache3a[i] * sintemp3,
- cosCache3a[i] * sintemp3,
- costemp3);
- break;
- case GLU_NONE:
- default:
- break;
- }
- glVertex3f(sintemp2 * sinCache1a[i],
- sintemp2 * cosCache1a[i], zHigh);
- }
- }
- glEnd();
-
- /* High end next (j == stacks-1 iteration) */
- sintemp2 = sinCache1b[stacks-1];
- zHigh = cosCache1b[stacks-1];
- switch(qobj->normals) {
- case GLU_FLAT:
- sintemp3 = sinCache3b[stacks];
- costemp3 = cosCache3b[stacks];
- break;
- case GLU_SMOOTH:
- sintemp3 = sinCache2b[stacks-1];
- costemp3 = cosCache2b[stacks-1];
- glNormal3f(sinCache2a[stacks] * sinCache2b[stacks],
- cosCache2a[stacks] * sinCache2b[stacks],
- cosCache2b[stacks]);
- break;
- default:
- break;
- }
- glBegin(GL_TRIANGLE_FAN);
- glVertex3f(0.0, 0.0, -radius);
- if (qobj->orientation == GLU_OUTSIDE) {
- for (i = 0; i <= slices; i++) {
- switch(qobj->normals) {
- case GLU_SMOOTH:
- glNormal3f(sinCache2a[i] * sintemp3,
- cosCache2a[i] * sintemp3,
- costemp3);
- break;
- case GLU_FLAT:
- glNormal3f(sinCache3a[i] * sintemp3,
- cosCache3a[i] * sintemp3,
- costemp3);
- break;
- case GLU_NONE:
- default:
- break;
- }
- glVertex3f(sintemp2 * sinCache1a[i],
- sintemp2 * cosCache1a[i], zHigh);
- }
- } else {
- for (i = slices; i >= 0; i--) {
- switch(qobj->normals) {
- case GLU_SMOOTH:
- glNormal3f(sinCache2a[i] * sintemp3,
- cosCache2a[i] * sintemp3,
- costemp3);
- break;
- case GLU_FLAT:
- if (i != slices) {
- glNormal3f(sinCache3a[i+1] * sintemp3,
- cosCache3a[i+1] * sintemp3,
- costemp3);
- }
- break;
- case GLU_NONE:
- default:
- break;
- }
- glVertex3f(sintemp2 * sinCache1a[i],
- sintemp2 * cosCache1a[i], zHigh);
- }
- }
- glEnd();
- } else {
- start = 0;
- finish = stacks;
- }
- for (j = start; j < finish; j++) {
- zLow = cosCache1b[j];
- zHigh = cosCache1b[j+1];
- sintemp1 = sinCache1b[j];
- sintemp2 = sinCache1b[j+1];
- switch(qobj->normals) {
- case GLU_FLAT:
- sintemp4 = sinCache3b[j+1];
- costemp4 = cosCache3b[j+1];
- break;
- case GLU_SMOOTH:
- if (qobj->orientation == GLU_OUTSIDE) {
- sintemp3 = sinCache2b[j+1];
- costemp3 = cosCache2b[j+1];
- sintemp4 = sinCache2b[j];
- costemp4 = cosCache2b[j];
- } else {
- sintemp3 = sinCache2b[j];
- costemp3 = cosCache2b[j];
- sintemp4 = sinCache2b[j+1];
- costemp4 = cosCache2b[j+1];
- }
- break;
- default:
- break;
- }
-
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i <= slices; i++) {
- switch(qobj->normals) {
- case GLU_SMOOTH:
- glNormal3f(sinCache2a[i] * sintemp3,
- cosCache2a[i] * sintemp3,
- costemp3);
- break;
- case GLU_FLAT:
- case GLU_NONE:
- default:
- break;
- }
- if (qobj->orientation == GLU_OUTSIDE) {
- if (qobj->textureCoords) {
- glTexCoord2f(1 - (float) i / slices,
- 1 - (float) (j+1) / stacks);
- }
- glVertex3f(sintemp2 * sinCache1a[i],
- sintemp2 * cosCache1a[i], zHigh);
- } else {
- if (qobj->textureCoords) {
- glTexCoord2f(1 - (float) i / slices,
- 1 - (float) j / stacks);
- }
- glVertex3f(sintemp1 * sinCache1a[i],
- sintemp1 * cosCache1a[i], zLow);
- }
- switch(qobj->normals) {
- case GLU_SMOOTH:
- glNormal3f(sinCache2a[i] * sintemp4,
- cosCache2a[i] * sintemp4,
- costemp4);
- break;
- case GLU_FLAT:
- glNormal3f(sinCache3a[i] * sintemp4,
- cosCache3a[i] * sintemp4,
- costemp4);
- break;
- case GLU_NONE:
- default:
- break;
- }
- if (qobj->orientation == GLU_OUTSIDE) {
- if (qobj->textureCoords) {
- glTexCoord2f(1 - (float) i / slices,
- 1 - (float) j / stacks);
- }
- glVertex3f(sintemp1 * sinCache1a[i],
- sintemp1 * cosCache1a[i], zLow);
- } else {
- if (qobj->textureCoords) {
- glTexCoord2f(1 - (float) i / slices,
- 1 - (float) (j+1) / stacks);
- }
- glVertex3f(sintemp2 * sinCache1a[i],
- sintemp2 * cosCache1a[i], zHigh);
- }
- }
- glEnd();
- }
- break;
- case GLU_POINT:
- glBegin(GL_POINTS);
- for (j = 0; j <= stacks; j++) {
- sintemp1 = sinCache1b[j];
- costemp1 = cosCache1b[j];
- switch(qobj->normals) {
- case GLU_FLAT:
- case GLU_SMOOTH:
- sintemp2 = sinCache2b[j];
- costemp2 = cosCache2b[j];
- break;
- default:
- break;
- }
- for (i = 0; i < slices; i++) {
- switch(qobj->normals) {
- case GLU_FLAT:
- case GLU_SMOOTH:
- glNormal3f(sinCache2a[i] * sintemp2,
- cosCache2a[i] * sintemp2,
- costemp2);
- break;
- case GLU_NONE:
- default:
- break;
- }
-
- zLow = j * radius / stacks;
-
- if (qobj->textureCoords) {
- glTexCoord2f(1 - (float) i / slices,
- 1 - (float) j / stacks);
- }
- glVertex3f(sintemp1 * sinCache1a[i],
- sintemp1 * cosCache1a[i], costemp1);
- }
- }
- glEnd();
- break;
- case GLU_LINE:
- case GLU_SILHOUETTE:
- for (j = 1; j < stacks; j++) {
- sintemp1 = sinCache1b[j];
- costemp1 = cosCache1b[j];
- switch(qobj->normals) {
- case GLU_FLAT:
- case GLU_SMOOTH:
- sintemp2 = sinCache2b[j];
- costemp2 = cosCache2b[j];
- break;
- default:
- break;
- }
-
- glBegin(GL_LINE_STRIP);
- for (i = 0; i <= slices; i++) {
- switch(qobj->normals) {
- case GLU_FLAT:
- glNormal3f(sinCache3a[i] * sintemp2,
- cosCache3a[i] * sintemp2,
- costemp2);
- break;
- case GLU_SMOOTH:
- glNormal3f(sinCache2a[i] * sintemp2,
- cosCache2a[i] * sintemp2,
- costemp2);
- break;
- case GLU_NONE:
- default:
- break;
- }
- if (qobj->textureCoords) {
- glTexCoord2f(1 - (float) i / slices,
- 1 - (float) j / stacks);
- }
- glVertex3f(sintemp1 * sinCache1a[i],
- sintemp1 * cosCache1a[i], costemp1);
- }
- glEnd();
- }
- for (i = 0; i < slices; i++) {
- sintemp1 = sinCache1a[i];
- costemp1 = cosCache1a[i];
- switch(qobj->normals) {
- case GLU_FLAT:
- case GLU_SMOOTH:
- sintemp2 = sinCache2a[i];
- costemp2 = cosCache2a[i];
- break;
- default:
- break;
- }
-
- glBegin(GL_LINE_STRIP);
- for (j = 0; j <= stacks; j++) {
- switch(qobj->normals) {
- case GLU_FLAT:
- glNormal3f(sintemp2 * sinCache3b[j],
- costemp2 * sinCache3b[j],
- cosCache3b[j]);
- break;
- case GLU_SMOOTH:
- glNormal3f(sintemp2 * sinCache2b[j],
- costemp2 * sinCache2b[j],
- cosCache2b[j]);
- break;
- case GLU_NONE:
- default:
- break;
- }
-
- if (qobj->textureCoords) {
- glTexCoord2f(1 - (float) i / slices,
- 1 - (float) j / stacks);
- }
- glVertex3f(sintemp1 * sinCache1b[j],
- costemp1 * sinCache1b[j], cosCache1b[j]);
- }
- glEnd();
- }
- break;
- default:
- break;
- }
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/registry.c b/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/registry.c
deleted file mode 100755
index 038998376..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/registry.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2001/03/19 17:45:28 $ $Revision: 1.1.1.1 $
-** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libutil/Attic/registry.c,v 1.1.1.1 2001/03/19 17:45:28 dawes Exp $
-*/
-
-#include "gluos.h"
-#include <GL/glu.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-static const GLubyte versionString[] = "1.3";
-static const GLubyte extensionString[] =
- "GLU_EXT_nurbs_tessellator "
- "GLU_EXT_object_space_tess "
- ;
-
-const GLubyte * GLAPIENTRY
-gluGetString(GLenum name)
-{
-
- if (name == GLU_VERSION) {
- return versionString;
- } else if (name == GLU_EXTENSIONS) {
- return extensionString;
- }
- return NULL;
-}
-
-/* extName is an extension name.
- * extString is a string of extensions separated by blank(s). There may or
- * may not be leading or trailing blank(s) in extString.
- * This works in cases of extensions being prefixes of another like
- * GL_EXT_texture and GL_EXT_texture3D.
- * Returns GL_TRUE if extName is found otherwise it returns GL_FALSE.
- */
-GLboolean GLAPIENTRY
-gluCheckExtension(const GLubyte *extName, const GLubyte *extString)
-{
- GLboolean flag = GL_FALSE;
- char *word;
- char *lookHere;
- char *deleteThis;
-
- if (extString == NULL) return GL_FALSE;
-
- deleteThis = lookHere = (char *)malloc(strlen((const char *)extString)+1);
- if (lookHere == NULL)
- return GL_FALSE;
- /* strtok() will modify string, so copy it somewhere */
- strcpy(lookHere,(const char *)extString);
-
- while ((word= strtok(lookHere," ")) != NULL) {
- if (strcmp(word,(const char *)extName) == 0) {
- flag = GL_TRUE;
- break;
- }
- lookHere = NULL; /* get next token */
- }
- free((void *)deleteThis);
- return flag;
-} /* gluCheckExtension() */
-
-
-
-/*** registry.c ***/
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/Distfile b/xc/extras/ogl-sample/main/gfx/lib/glw/Distfile
deleted file mode 100755
index 3270654bf..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glw/Distfile
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-#
-
-DISTFILES_SI = \
- GLwDrawA.h /xc/include/GL/GLwDrawA.h \
- GLwMDrawA.h /xc/include/GL/GLwMDrawA.h \
- Imakefile /xc/lib/GL/glw/Imakefile \
- GLwDrawAP.h /xc/lib/GL/glw/GLwDrawAP.h \
- GLwMDrawAP.h /xc/lib/GL/glw/GLwMDrawAP.h \
- GLwDAUtil.c /xc/lib/GL/glw/GLwDAUtil.c \
- GLwDrawA.c /xc/lib/GL/glw/GLwDrawA.c \
- GLwMDrawA.c /xc/lib/GL/glw/GLwMDrawA.c \
- $(NULL)
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDAUtil.c b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDAUtil.c
deleted file mode 100755
index ba4ce5bd5..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDAUtil.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/* utility routines for GLX.
- * Since these routines are used both in the Motif and X versions of
- * the widget, they cannot peek directly into the structure
- *
- */
-
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glw/GLwDAUtil.c,v 1.3 2001/05/02 13:37:45 dawes Exp $ */
-
-#include <X11/IntrinsicP.h>
-#include <X11/StringDefs.h>
-#include <GL/glx.h>
-#include <GL/gl.h>
-
-/*
- * By default only a static library is created because most of the UNIX
- * loaders, if not all, complain about unresolved symbols even if the
- * application doesn't use the modules in which such symbols are referenced.
- * However, if your system supports libraries with weak symbols (e.g.
- * Solaris, FreeBSD and Linux) it is possible to fool the loader using these
- * weak symbols.
- */
-#ifdef USE_XM_STUBS
-#pragma weak _XmPrimitiveHighlightPixmapDefault = _Xm_Stub_Pointer_
-#pragma weak _XmHighlightColorDefault = _Xm_Stub_Pointer_
-#pragma weak _XmForegroundColorDefault = _Xm_Stub_Pointer_
-#pragma weak _XmBackgroundColorDefault = _Xm_Stub_Pointer_
-#pragma weak _XmStrings = _Xm_Stub_Pointer_
-#pragma weak xmPrimitiveClassRec = _Xm_Stub_Pointer_
-
-static XtPointer _Xm_Stub_Pointer_ = NULL;
-#endif
-
-void GLwDrawingAreaMakeCurrent (Widget w, GLXContext ctx)
-{
- glXMakeCurrent (XtDisplay(w), XtWindow(w), ctx);
-}
-
-void GLwDrawingAreaSwapBuffers (Widget w)
-{
- glXSwapBuffers (XtDisplay(w), XtWindow(w));
-}
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.c b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.c
deleted file mode 100755
index ed5d7fa88..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.c
+++ /dev/null
@@ -1,732 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.c,v 1.4 2001/10/28 03:32:25 tsi Exp $ */
-
-#include <stdio.h>
-#include <GL/glx.h>
-#include <GL/gl.h>
-#ifdef __GLX_MOTIF
-#include "GLwMDrawAP.h"
-#else /* not __GLX_MOTIF */
-#include "GLwDrawAP.h"
-#include <X11/IntrinsicP.h>
-#include <X11/StringDefs.h>
-#endif /* __GLX_MOTIF */
-#include <assert.h>
-
-#ifdef __GLX_MOTIF
-/* The MOTIF version differs only in the inclusion of the primitive
- * widget class and in a vew variable and type name differences.
- * Rather than put ifdefs all over the place, we just use a few defines
- * to make it use motif types and names
- */
-#define GLwDrawingAreaWidget GLwMDrawingAreaWidget
-#define GLwDrawingAreaClassRec GLwMDrawingAreaClassRec
-#define glwDrawingAreaClassRec glwMDrawingAreaClassRec
-#define glwDrawingAreaWidgetClass glwMDrawingAreaWidgetClass
-#define GLwDrawingAreaRec GLwMDrawingAreaRec
-#endif /* __GLX_MOTIF */
-
-/* forward definitions */
-/* resource default procs */
-static void createColormap(GLwDrawingAreaWidget w,
- int offset, XrmValue *value);
-
-/* widget methods */
-static void Initialize(GLwDrawingAreaWidget req, GLwDrawingAreaWidget new,
- ArgList args, Cardinal *num_args);
-static void Realize(Widget w, Mask *valueMask,
- XSetWindowAttributes *attributes);
-static void Redraw(GLwDrawingAreaWidget w, XEvent *event, Region region);
-static void Resize(GLwDrawingAreaWidget glw);
-static void Destroy(GLwDrawingAreaWidget glw);
-
-#define offset(field) XtOffset(GLwDrawingAreaWidget, glwDrawingArea.field)
-
-static char defaultTranslations[] =
-#ifdef __GLX_MOTIF
- "<Key>osfHelp:PrimitiveHelp() \n"
-#endif
- "<KeyDown>: glwInput() \n\
- <KeyUp>: glwInput() \n\
- <BtnDown>: glwInput() \n\
- <BtnUp>: glwInput() \n\
- <BtnMotion>: glwInput() ";
-
-static void glwInput(GLwDrawingAreaWidget glw, XEvent *event,
- String *, Cardinal *);
-
-static XtActionsRec actions[] = {
- { "glwInput", (XtActionProc) glwInput }, /* key or mouse input */
-};
-
-/*
- * There is a bit of unusual handling of the resources here.
- * Because Xt insists on allocating the colormap resource when it is
- * processing the core resources (even if we redeclare the colormap
- * resource here, we need to do a little trick. When Xt first allocates
- * the colormap, we allow it to allocate the default one, since we have
- * not yet determined the appropriate visual (which is determined from
- * resources parsed after the colormap). We also let it allocate colors
- * in that default colormap.
- *
- * In the initialize proc we calculate the actual visual. Then, we
- * reobtain the colormap resource using XtGetApplicationResources in
- * the initialize proc. If requested, we also reallocate colors in
- * that colormap using the same method.
- */
-
-static XtResource resources[] = {
- /* The GLX attributes. Add any new attributes here */
-
- {GLwNbufferSize, GLwCBufferSize, XtRInt, sizeof (int),
- offset(bufferSize), XtRImmediate, (XtPointer) 0},
-
- {GLwNlevel, GLwCLevel, XtRInt, sizeof (int),
- offset(level), XtRImmediate, (XtPointer) 0},
-
- {GLwNrgba, GLwCRgba, XtRBoolean, sizeof (Boolean),
- offset(rgba), XtRImmediate, (XtPointer) FALSE},
-
- {GLwNdoublebuffer, GLwCDoublebuffer, XtRBoolean, sizeof (Boolean),
- offset(doublebuffer), XtRImmediate, (XtPointer) FALSE},
-
- {GLwNstereo, GLwCStereo, XtRBoolean, sizeof (Boolean),
- offset(stereo), XtRImmediate, (XtPointer) FALSE},
-
- {GLwNauxBuffers, GLwCAuxBuffers, XtRInt, sizeof (int),
- offset(auxBuffers), XtRImmediate, (XtPointer) 0},
-
- {GLwNredSize, GLwCColorSize, XtRInt, sizeof (int),
- offset(redSize), XtRImmediate, (XtPointer) 1},
-
- {GLwNgreenSize, GLwCColorSize, XtRInt, sizeof (int),
- offset(greenSize), XtRImmediate, (XtPointer) 1},
-
- {GLwNblueSize, GLwCColorSize, XtRInt, sizeof (int),
- offset(blueSize), XtRImmediate, (XtPointer) 1},
-
- {GLwNalphaSize, GLwCAlphaSize, XtRInt, sizeof (int),
- offset(alphaSize), XtRImmediate, (XtPointer) 0},
-
- {GLwNdepthSize, GLwCDepthSize, XtRInt, sizeof (int),
- offset(depthSize), XtRImmediate, (XtPointer) 0},
-
- {GLwNstencilSize, GLwCStencilSize, XtRInt, sizeof (int),
- offset(stencilSize), XtRImmediate, (XtPointer) 0},
-
- {GLwNaccumRedSize, GLwCAccumColorSize, XtRInt, sizeof (int),
- offset(accumRedSize), XtRImmediate, (XtPointer) 0},
-
- {GLwNaccumGreenSize, GLwCAccumColorSize, XtRInt, sizeof (int),
- offset(accumGreenSize), XtRImmediate, (XtPointer) 0},
-
- {GLwNaccumBlueSize, GLwCAccumColorSize, XtRInt, sizeof (int),
- offset(accumBlueSize), XtRImmediate, (XtPointer) 0},
-
- {GLwNaccumAlphaSize, GLwCAccumAlphaSize, XtRInt, sizeof (int),
- offset(accumAlphaSize), XtRImmediate, (XtPointer) 0},
-
- /* the attribute list */
- {GLwNattribList, GLwCAttribList, XtRPointer, sizeof(int *),
- offset(attribList), XtRImmediate, (XtPointer) NULL},
-
- /* the visual info */
- {GLwNvisualInfo, GLwCVisualInfo, GLwRVisualInfo, sizeof (XVisualInfo *),
- offset(visualInfo), XtRImmediate, (XtPointer) NULL},
-
-/* miscellaneous resources */
- {GLwNinstallColormap, GLwCInstallColormap, XtRBoolean, sizeof (Boolean),
- offset(installColormap), XtRImmediate, (XtPointer) TRUE},
-
- {GLwNallocateBackground, GLwCAllocateColors, XtRBoolean, sizeof (Boolean),
- offset(allocateBackground), XtRImmediate, (XtPointer) FALSE},
-
- {GLwNallocateOtherColors, GLwCAllocateColors, XtRBoolean, sizeof (Boolean),
- offset(allocateOtherColors), XtRImmediate, (XtPointer) FALSE},
-
- {GLwNinstallBackground, GLwCInstallBackground, XtRBoolean, sizeof (Boolean),
- offset(installBackground), XtRImmediate, (XtPointer) TRUE},
-
- {GLwNginitCallback, GLwCCallback, XtRCallback, sizeof (XtCallbackList),
- offset(ginitCallback), XtRImmediate, (XtPointer) NULL},
-
- {GLwNinputCallback, GLwCCallback, XtRCallback, sizeof (XtCallbackList),
- offset(inputCallback), XtRImmediate, (XtPointer) NULL},
-
- {GLwNresizeCallback, GLwCCallback, XtRCallback, sizeof (XtCallbackList),
- offset(resizeCallback), XtRImmediate, (XtPointer) NULL},
-
- {GLwNexposeCallback, GLwCCallback, XtRCallback, sizeof (XtCallbackList),
- offset(exposeCallback), XtRImmediate, (XtPointer) NULL},
-
-#ifdef __GLX_MOTIF
- /* Changes to Motif primitive resources */
- {XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof (Boolean),
- XtOffset (GLwDrawingAreaWidget, primitive.traversal_on), XmRImmediate,
- (XtPointer) FALSE},
-
- /* highlighting is normally disabled, as when Motif tries to disable
- * highlighting, it tries to reset the color back to the parent's
- * background (usually Motif blue). Unfortunately, that is in a
- * different colormap, and doesn't work too well.
- */
- {XmNhighlightOnEnter, XmCHighlightOnEnter, XmRBoolean, sizeof (Boolean),
- XtOffset (GLwDrawingAreaWidget, primitive.highlight_on_enter),
- XmRImmediate, (XtPointer) FALSE},
-
- {XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension,
- sizeof (Dimension),
- XtOffset (GLwDrawingAreaWidget, primitive.highlight_thickness),
- XmRImmediate, (XtPointer) 0},
-
-#endif /* __GLX_MOTIF */
-};
-
-/* The following resources are reobtained using XtGetApplicationResources
- * in the initialize proc.
- */
-/* The colormap */
-static XtResource initializeResources[] = {
- /* reobtain the colormap with the new visual */
- {XtNcolormap, XtCColormap, XtRColormap, sizeof(Colormap),
- XtOffset(GLwDrawingAreaWidget, core.colormap),
- XtRCallProc,(XtPointer) createColormap},
-};
-
-/* reallocate any colors we need in the new colormap */
-
-/* The background is obtained only if the allocateBackground resource is TRUE*/
-static XtResource backgroundResources[] = {
-#ifdef __GLX_MOTIF
- {
- XmNbackground, XmCBackground, XmRPixel,
- sizeof (Pixel), XtOffset(GLwDrawingAreaWidget, core.background_pixel),
- XmRCallProc, (XtPointer) _XmBackgroundColorDefault
- },
- {
- XmNbackgroundPixmap, XmCPixmap, XmRXmBackgroundPixmap,
- sizeof (Pixmap), XtOffset(GLwDrawingAreaWidget, core.background_pixmap),
- XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP
- },
-
-#else /* ! __GLX_MOTIF */
- {XtNbackground, XtCBackground, XtRPixel,sizeof(Pixel),
- XtOffset(GLwDrawingAreaWidget,core.background_pixel),
- XtRString, (XtPointer)"XtDefaultBackground"},
- {XtNbackgroundPixmap, XtCPixmap, XtRPixmap, sizeof(Pixmap),
- XtOffset(GLwDrawingAreaWidget,core.background_pixmap),
- XtRImmediate, (XtPointer)XtUnspecifiedPixmap},
-#endif /* __GLX_MOTIF */
-};
-
-/* The other colors such as the foreground are allocated only if
- * allocateOtherColors are set. These resources only exist in Motif.
- */
-
-#ifdef __GLX_MOTIF
-static XtResource otherColorResources[] = {
- {
- XmNforeground, XmCForeground, XmRPixel,
- sizeof (Pixel), XtOffset(GLwDrawingAreaWidget, primitive.foreground),
- XmRCallProc, (XtPointer) _XmForegroundColorDefault
- },
-
- {
- XmNhighlightColor, XmCHighlightColor, XmRPixel, sizeof (Pixel),
- XtOffset(GLwDrawingAreaWidget, primitive.highlight_color),
- XmRCallProc, (XtPointer) _XmHighlightColorDefault
- },
-
- {
- XmNhighlightPixmap, XmCHighlightPixmap, XmRPrimHighlightPixmap,
- sizeof (Pixmap),
- XtOffset(GLwDrawingAreaWidget, primitive.highlight_pixmap),
- XmRCallProc, (XtPointer) _XmPrimitiveHighlightPixmapDefault
- },
-};
-#endif /* __GLX_MOTIF */
-
-struct attribInfo
-{
- int offset;
- int attribute;
-};
-
-static struct attribInfo intAttribs[] =
-{
- { offset(bufferSize), GLX_BUFFER_SIZE },
- { offset(level), GLX_LEVEL },
- { offset(auxBuffers), GLX_AUX_BUFFERS },
- { offset(redSize), GLX_RED_SIZE },
- { offset(greenSize), GLX_GREEN_SIZE },
- { offset(blueSize), GLX_BLUE_SIZE },
- { offset(alphaSize), GLX_ALPHA_SIZE },
- { offset(depthSize), GLX_DEPTH_SIZE },
- { offset(stencilSize), GLX_STENCIL_SIZE },
- { offset(accumRedSize), GLX_ACCUM_RED_SIZE },
- { offset(accumGreenSize), GLX_ACCUM_GREEN_SIZE },
- { offset(accumBlueSize), GLX_ACCUM_BLUE_SIZE },
- { offset(accumAlphaSize), GLX_ACCUM_ALPHA_SIZE },
- { 0, None },
-};
-
-static struct attribInfo booleanAttribs[] =
-{
- { offset(rgba), GLX_RGBA },
- { offset(doublebuffer), GLX_DOUBLEBUFFER },
- { offset(stereo), GLX_STEREO },
- { 0, None },
-};
-
-#undef offset
-
-
-GLwDrawingAreaClassRec glwDrawingAreaClassRec =
-{
- { /* core fields */
-#ifdef __GLX_MOTIF
- /* superclass */ (WidgetClass) &xmPrimitiveClassRec,
- /* class_name */ "GLwMDrawingArea",
-#else /* not __GLX_MOTIF */
- /* superclass */ (WidgetClass) &widgetClassRec,
- /* class_name */ "GLwDrawingArea",
-#endif /* __GLX_MOTIF */
- /* widget_size */ sizeof(GLwDrawingAreaRec),
- /* class_initialize */ NULL,
- /* class_part_initialize */ NULL,
- /* class_inited */ FALSE,
- /* initialize */ (XtInitProc) Initialize,
- /* initialize_hook */ NULL,
- /* realize */ Realize,
- /* actions */ actions,
- /* num_actions */ XtNumber(actions),
- /* resources */ resources,
- /* num_resources */ XtNumber(resources),
- /* xrm_class */ NULLQUARK,
- /* compress_motion */ TRUE,
- /* compress_exposure */ TRUE,
- /* compress_enterleave */ TRUE,
- /* visible_interest */ TRUE,
- /* destroy */ (XtWidgetProc) Destroy,
- /* resize */ (XtWidgetProc) Resize,
- /* expose */ (XtExposeProc) Redraw,
- /* set_values */ NULL,
- /* set_values_hook */ NULL,
- /* set_values_almost */ XtInheritSetValuesAlmost,
- /* get_values_hook */ NULL,
- /* accept_focus */ NULL,
- /* version */ XtVersion,
- /* callback_private */ NULL,
- /* tm_table */ defaultTranslations,
- /* query_geometry */ XtInheritQueryGeometry,
- /* display_accelerator */ XtInheritDisplayAccelerator,
- /* extension */ NULL
- },
-#ifdef __GLX_MOTIF /* primitive resources */
- {
- /* border_highlight */ XmInheritBorderHighlight,
- /* border_unhighlight */ XmInheritBorderUnhighlight,
- /* translations */ XtInheritTranslations,
- /* arm_and_activate */ NULL,
- /* get_resources */ NULL,
- /* num get_resources */ 0,
- /* extension */ NULL,
- }
-#endif /* __GLX_MOTIF */
-};
-
-WidgetClass glwDrawingAreaWidgetClass = (WidgetClass)&glwDrawingAreaClassRec;
-
-static void error(Widget w, char *string)
-{
- char buf[100];
-#ifdef __GLX_MOTIF
- sprintf (buf, "GLwMDrawingArea: %s\n", string);
-#else
- sprintf (buf, "GLwDrawingArea: %s\n", string);
-#endif
- XtAppError(XtWidgetToApplicationContext(w), buf);
-}
-
-static void warning(Widget w, char *string)
-{
- char buf[100];
-#ifdef __GLX_MOTIF
- sprintf (buf, "GLwMDraw: %s\n", string);
-#else
- sprintf (buf, "GLwDraw: %s\n", string);
-#endif
- XtAppWarning(XtWidgetToApplicationContext(w), buf);
-}
-
-/* resource initialization methods */
-/* Initialize the attribList based on the attributes */
-static void createAttribList(GLwDrawingAreaWidget w)
-{
- int listLength;
- register struct attribInfo *ap;
- int *ip;
-
- /* first find out how long a list we need */
- listLength=1; /* include the terminating NULL */
- for (ap = booleanAttribs; ap->attribute; ap++)
- {
- if (*(Boolean *)(((char *)w)+ap->offset))
- listLength++; /* one word for a boolean */
- }
- for (ap = intAttribs; ap->attribute; ap++)
- {
- if (*(int *)(((char *)w)+ap->offset))
- listLength+=2; /* one word for an int */
- }
- w->glwDrawingArea.attribList = (int *)XtMalloc(listLength*sizeof(int));
- ip = w->glwDrawingArea.attribList;
- for (ap = booleanAttribs; ap->attribute; ap++)
- {
- if (*(Boolean *)(((char *)w)+ap->offset))
- *ip++ = ap->attribute;
- }
- for (ap = intAttribs; ap->attribute; ap++)
- {
- if (*(int *)(((char *)w)+ap->offset))
- {
- *ip++ = ap->attribute;
- *ip++ = *(int *)(((char *)w)+ap->offset);
- }
- }
- *ip = None;
-}
-
-/* Initialize the visualInfo based on the attribute list */
-static void createVisualInfo(GLwDrawingAreaWidget w)
-{
- assert(w->glwDrawingArea.attribList);
- w->glwDrawingArea.visualInfo = glXChooseVisual(XtDisplay(w),
- XScreenNumberOfScreen(XtScreen(w)),
- w->glwDrawingArea.attribList);
- if (!w->glwDrawingArea.visualInfo)
- error((Widget)w,"requested visual not supported");
-}
-
-/* Initialize the colormap based on the visual info.
- * This routine maintains a cache of visual-infos to colormaps. If two
- * widgets share the same visual info, they share the same colormap.
- * This function is called by the callProc of the colormap resource entry.
- */
-static void createColormap(GLwDrawingAreaWidget w,
- int offset, XrmValue *value)
-{
- static struct cmapCache
- {
- Visual *visual;
- Colormap cmap;
- int screen;
- } *cmapCache;
- static int cacheEntries=0;
- static int cacheMalloced=0;
-
- register int i;
-
- assert(w->glwDrawingArea.visualInfo);
-
- /* see if we can find it in the cache */
- for (i=0; i<cacheEntries; i++)
- if (cmapCache[i].visual == w->glwDrawingArea.visualInfo->visual &&
- cmapCache[i].screen == w->glwDrawingArea.visualInfo->screen)
- {
- value->addr = (XtPointer) (&cmapCache[i].cmap);
- return;
- }
- /* not in the cache, create a new entry */
- if (cacheEntries >= cacheMalloced)
- {
- /* need to malloc a new one. Since we are likely to have only a
- * few colormaps, we allocate one the first time, and double
- * each subsequent time.
- */
- if (cacheMalloced == 0)
- {
- cacheMalloced = 1;
- cmapCache = (struct cmapCache *)XtMalloc(sizeof(struct cmapCache));
- }
- else
- {
- cacheMalloced <<= 1;
- cmapCache = (struct cmapCache *)XtRealloc((char *) cmapCache,
- sizeof(struct cmapCache)*
- cacheMalloced);
- }
- }
-
- cmapCache[cacheEntries].cmap = XCreateColormap (XtDisplay(w),
- RootWindow(XtDisplay(w),
- w->glwDrawingArea.visualInfo->screen),
- w->glwDrawingArea.visualInfo->visual,
- AllocNone);
- cmapCache[cacheEntries].visual = w->glwDrawingArea.visualInfo->visual;
- cmapCache[cacheEntries].screen = w->glwDrawingArea.visualInfo->screen;
- value->addr = (XtPointer) (&cmapCache[cacheEntries++].cmap);
-}
-
-static void
-Initialize (GLwDrawingAreaWidget req, GLwDrawingAreaWidget new,
- ArgList args, Cardinal *num_args)
-{
-
- if (req->core.width == 0)
- new->core.width = 100;
- if (req->core.height == 0)
- new->core.width = 100;
-
- /* create the attribute list if needed */
- if (new->glwDrawingArea.attribList == NULL)
- {
- new->glwDrawingArea.myList = TRUE;
- createAttribList(new);
- }
- else
- new->glwDrawingArea.myList = FALSE;
-
- /* determine the visual info if needed */
- if (new->glwDrawingArea.visualInfo == NULL)
- {
- new->glwDrawingArea.myVisual = TRUE;
- createVisualInfo(new);
- }
- else
- new->glwDrawingArea.myVisual = FALSE;
-
- new->core.depth = new->glwDrawingArea.visualInfo->depth;
-
- /* Reobtain the colormap and colors in it using XtGetApplicationResources*/
- XtGetApplicationResources((Widget) new, new,
- initializeResources,
- XtNumber(initializeResources),
- args, *num_args);
-
- /* obtain the color resources if appropriate */
- if (req->glwDrawingArea.allocateBackground)
- XtGetApplicationResources((Widget) new, new,
- backgroundResources,
- XtNumber(backgroundResources),
- args, *num_args);
-
-#ifdef __GLX_MOTIF
- if (req->glwDrawingArea.allocateOtherColors)
- XtGetApplicationResources((Widget) new, new,
- otherColorResources,
- XtNumber(otherColorResources),
- args, *num_args);
-#endif /* __GLX_MOTIF */
-
-}
-
-static void
-Realize(Widget w, Mask *valueMask, XSetWindowAttributes *attributes)
-{
- register GLwDrawingAreaWidget glw = (GLwDrawingAreaWidget)w;
- GLwDrawingAreaCallbackStruct cb;
-
- /* if we haven't requested that the background be both installed and
- * allocated, don't install it.
- */
- if (!(glw->glwDrawingArea.installBackground &&
- glw->glwDrawingArea.allocateBackground))
- *valueMask &= ~CWBackPixel;
-
- XtCreateWindow (w, (unsigned int)InputOutput,
- glw->glwDrawingArea.visualInfo->visual,
- *valueMask, attributes);
-
- /* if appropriate, call XSetWMColormapWindows to install the colormap */
- if (glw->glwDrawingArea.installColormap)
- {
- Widget parentShell = XtParent(w);
- Status status;
- Window *windowsReturn;
- int countReturn;
-
- while (parentShell && !XtIsShell(parentShell))
- parentShell = XtParent(parentShell);
- if (parentShell && XtWindow(parentShell))
- {
- /* check to see if there is already a property */
- status = XGetWMColormapWindows(XtDisplay(parentShell),
- XtWindow(parentShell),
- &windowsReturn, &countReturn);
-
- /* if no property, just create one */
- if (!status)
- {
- Window windows[2];
- windows[0] = XtWindow(w);
- windows[1] = XtWindow(parentShell);
- XSetWMColormapWindows(XtDisplay(parentShell),
- XtWindow(parentShell),
- windows, 2);
- }
- /* there was a property, add myself to the beginning */
- else
- {
- Window *windows = (Window *)XtMalloc((sizeof(Window))*
- (countReturn+1));
- register int i;
- windows[0] = XtWindow(w);
- for (i=0; i<countReturn; i++)
- windows[i+1] = windowsReturn[i];
- XSetWMColormapWindows(XtDisplay(parentShell),
- XtWindow(parentShell),
- windows, countReturn+1);
- XtFree((char *) windows);
- XFree((char *) windowsReturn);
- }
- }
- else
- warning((Widget)w,
- "Could not set colormap property on parent shell");
- }
- cb.reason = GLwCR_GINIT;
- cb.event = NULL;
- cb.width = glw->core.width;
- cb.height = glw->core.height;
- XtCallCallbackList((Widget) glw, glw->glwDrawingArea.ginitCallback, &cb);
-}
-
-static void
-Redraw(GLwDrawingAreaWidget w, XEvent *event, Region region)
-{
- GLwDrawingAreaCallbackStruct cb;
-
- cb.reason = GLwCR_EXPOSE;
- cb.event = event;
- cb.width = w->core.width;
- cb.height = w->core.height;
- XtCallCallbackList ((Widget) w, w->glwDrawingArea.exposeCallback, &cb);
-}
-
-static void
-Resize(GLwDrawingAreaWidget glw)
-{
- GLwDrawingAreaCallbackStruct cb;
-
- /* if we get a resize event before being realized, we can't handle it */
- if (!XtIsRealized((Widget)glw))
- return;
- cb.reason = GLwCR_RESIZE;
- cb.event = NULL;
- cb.width = glw->core.width;
- cb.height = glw->core.height;
- XtCallCallbackList ((Widget) glw, glw->glwDrawingArea.resizeCallback, &cb);
-}
-
-static void
-Destroy(GLwDrawingAreaWidget glw)
-{
- if (glw->glwDrawingArea.myList && glw->glwDrawingArea.attribList)
- XtFree ((XtPointer)glw->glwDrawingArea.attribList);
- if (glw->glwDrawingArea.myVisual && glw->glwDrawingArea.visualInfo)
- XFree ((XtPointer)glw->glwDrawingArea.visualInfo);
-
- /* if my colormap was installed, remove it */
- if (glw->glwDrawingArea.installColormap)
- {
- Widget parentShell = XtParent(glw);
- Status status;
- Window *windowsReturn;
- int countReturn;
- register int i;
-
- /* find the parent shell */
- while (parentShell && !XtIsShell(parentShell))
- parentShell = XtParent(parentShell);
-
- if (parentShell && XtWindow(parentShell))
- {
- /* make sure there is a property */
- status = XGetWMColormapWindows(XtDisplay(parentShell),
- XtWindow(parentShell),
- &windowsReturn, &countReturn);
-
- /* if no property, just return. If there was a property,
- * continue
- */
- if (status)
- {
- /* search for a match */
- for (i=0; i<countReturn; i++)
- {
- if (windowsReturn[i] == XtWindow(glw))
- {
- /* we found a match, now copu the rest down */
- for (i++; i<countReturn; i++)
- {
- windowsReturn[i-1] = windowsReturn[i];
- }
- XSetWMColormapWindows(XtDisplay(parentShell),
- XtWindow(parentShell),
- windowsReturn, countReturn-1);
- break; /* from outer for */
- }
- }
- XFree((char *) windowsReturn);
- }
- }
- }
-}
-
-/* Action routine for keyboard and mouse events */
-/* ARGSUSED */
-static void glwInput (GLwDrawingAreaWidget glw, XEvent *event,
- String * params, Cardinal * numParams)
-{
- GLwDrawingAreaCallbackStruct cb;
-
- cb.reason = GLwCR_INPUT;
- cb.event = event;
- cb.width = glw->core.width;
- cb.height = glw->core.height;
- XtCallCallbackList ((Widget) glw, glw->glwDrawingArea.inputCallback, &cb);
-}
-
-#ifdef __GLX_MOTIF
-/* Provide a Motif-style create routine */
-Widget GLwCreateMDrawingArea(Widget parent, char *name,
- ArgList arglist, Cardinal argcount)
-{
- return (XtCreateWidget (name, glwMDrawingAreaWidgetClass, parent, arglist,
- argcount));
-}
-#endif
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.h b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.h
deleted file mode 100755
index d8f8ffefc..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-/*
-** This file has been slightly modified from the original by Carlos A. M. dos
-** Santos <casantos@cpmet.ufpel.tche.br> for integration into XFree86 source
-** tree and for generating both Motif(TM) 1.2 and 2.x versions of the widgets
-** in the same library.
-*/
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.h,v 1.4 2002/05/31 16:36:50 dawes Exp $ */
-
-#ifndef _GLwDrawA_h
-#define _GLwDrawA_h
-
-#ifdef __GLX_MOTIF
-# ifndef __GLX_INCLUDE_XM_H /* Defined during library compilation */
-# include <Xm/Xm.h> /* We need to know about XmVERSION early */
-# endif
-#endif
-
-#include <GL/glx.h>
-#include <GL/gl.h>
-
-/****************************************************************
- *
- * GLwDrawingArea widgets
- *
- ****************************************************************/
-
-/* Resources:
-
- Name Class RepType Default Value
- ---- ----- ------- -------------
- attribList AttribList int * NULL
- visualInfo VisualInfo VisualInfo NULL
- installColormap InstallColormap Boolean TRUE
- allocateBackground AllocateColors Boolean FALSE
- allocateOtherColors AllocateColors Boolean FALSE
- installBackground InstallBackground Boolean TRUE
- exposeCallback Callback Pointer NULL
- ginitCallback Callback Pointer NULL
- inputCallback Callback Pointer NULL
- resizeCallback Callback Pointer NULL
-
-*** The following resources all correspond to the GLX configuration
-*** attributes and are used to create the attribList if it is NULL
- bufferSize BufferSize int 0
- level Level int 0
- rgba Rgba Boolean FALSE
- doublebuffer Doublebuffer Boolean FALSE
- stereo Stereo Boolean FALSE
- auxBuffers AuxBuffers int 0
- redSize ColorSize int 1
- greenSize ColorSize int 1
- blueSize ColorSize int 1
- alphaSize AlphaSize int 0
- depthSize DepthSize int 0
- stencilSize StencilSize int 0
- accumRedSize AccumColorSize int 0
- accumGreenSize AccumColorSize int 0
- accumBlueSize AccumColorSize int 0
- accumAlphaSize AccumAlphaSize int 0
-*/
-
-#define GLwNattribList "attribList"
-#define GLwCAttribList "AttribList"
-#define GLwNvisualInfo "visualInfo"
-#define GLwCVisualInfo "VisualInfo"
-#define GLwRVisualInfo "VisualInfo"
-
-#define GLwNinstallColormap "installColormap"
-#define GLwCInstallColormap "InstallColormap"
-#define GLwNallocateBackground "allocateBackground"
-#define GLwNallocateOtherColors "allocateOtherColors"
-#define GLwCAllocateColors "AllocateColors"
-#define GLwNinstallBackground "installBackground"
-#define GLwCInstallBackground "InstallBackground"
-
-#define GLwCCallback "Callback"
-#define GLwNexposeCallback "exposeCallback"
-#define GLwNginitCallback "ginitCallback"
-#define GLwNresizeCallback "resizeCallback"
-#define GLwNinputCallback "inputCallback"
-
-#define GLwNbufferSize "bufferSize"
-#define GLwCBufferSize "BufferSize"
-#define GLwNlevel "level"
-#define GLwCLevel "Level"
-#define GLwNrgba "rgba"
-#define GLwCRgba "Rgba"
-#define GLwNdoublebuffer "doublebuffer"
-#define GLwCDoublebuffer "Doublebuffer"
-#define GLwNstereo "stereo"
-#define GLwCStereo "Stereo"
-#define GLwNauxBuffers "auxBuffers"
-#define GLwCAuxBuffers "AuxBuffers"
-#define GLwNredSize "redSize"
-#define GLwNgreenSize "greenSize"
-#define GLwNblueSize "blueSize"
-#define GLwCColorSize "ColorSize"
-#define GLwNalphaSize "alphaSize"
-#define GLwCAlphaSize "AlphaSize"
-#define GLwNdepthSize "depthSize"
-#define GLwCDepthSize "DepthSize"
-#define GLwNstencilSize "stencilSize"
-#define GLwCStencilSize "StencilSize"
-#define GLwNaccumRedSize "accumRedSize"
-#define GLwNaccumGreenSize "accumGreenSize"
-#define GLwNaccumBlueSize "accumBlueSize"
-#define GLwCAccumColorSize "AccumColorSize"
-#define GLwNaccumAlphaSize "accumAlphaSize"
-#define GLwCAccumAlphaSize "AccumAlphaSize"
-
-#ifdef __GLX_MOTIF
-
-#if XmVERSION == 1
-/*
-# define _GLwMDrawingAreaClassRec _GLwM1DrawingAreaClassRec
-# define _GLwMDrawingAreaRec _GLwM1DrawingAreaRec
-*/
-# define glwMDrawingAreaWidgetClass glwM1DrawingAreaWidgetClass
-# define glwMDrawingAreaClassRec glwM1DrawingAreaClassRec
-# define GLwCreateMDrawingArea GLwCreateM1DrawingArea
-#elif XmVERSION == 2
-/*
-# define _GLwMDrawingAreaClassRec _GLwM2DrawingAreaClassRec
-# define _GLwMDrawingAreaRec _GLwM2DrawingAreaRec
-*/
-# define glwMDrawingAreaWidgetClass glwM2DrawingAreaWidgetClass
-# define glwMDrawingAreaClassRec glwM2DrawingAreaClassRec
-# define GLwCreateMDrawingArea GLwCreateM2DrawingArea
-#else
-#error "Sorry, unknown Motif version."
-#endif /* XmVERSION */
-
-typedef struct _GLwMDrawingAreaClassRec *GLwMDrawingAreaWidgetClass;
-typedef struct _GLwMDrawingAreaRec *GLwMDrawingAreaWidget;
-
-extern WidgetClass glwMDrawingAreaWidgetClass;
-
-#else /* not __GLX_MOTIF */
-
-typedef struct _GLwDrawingAreaClassRec *GLwDrawingAreaWidgetClass;
-typedef struct _GLwDrawingAreaRec *GLwDrawingAreaWidget;
-
-extern WidgetClass glwDrawingAreaWidgetClass;
-
-#endif /* __GLX_MOTIF */
-
-/* Callback reasons */
-#ifdef __GLX_MOTIF
-#define GLwCR_EXPOSE XmCR_EXPOSE
-#define GLwCR_RESIZE XmCR_RESIZE
-#define GLwCR_INPUT XmCR_INPUT
-#else /* not __GLX_MOTIF */
-/* The same values as Motif, but don't use Motif constants */
-#define GLwCR_EXPOSE 38
-#define GLwCR_RESIZE 39
-#define GLwCR_INPUT 40
-#endif /* __GLX_MOTIF */
-
-#define GLwCR_GINIT 32135 /* Arbitrary number that should neverr clash*/
-
-typedef struct
-{
- int reason;
- XEvent *event;
- Dimension width, height; /* for resize callback */
-} GLwDrawingAreaCallbackStruct;
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-/* front ends to glXMakeCurrent and glXSwapBuffers */
-extern void GLwDrawingAreaMakeCurrent (Widget w, GLXContext ctx);
-extern void GLwDrawingAreaSwapBuffers (Widget w);
-
-#ifdef __GLX_MOTIF
-#ifdef _NO_PROTO
-extern Widget GLwCreateMDrawingArea ();
-#else /* _NO_PROTO */
-
-extern Widget GLwCreateMDrawingArea (Widget parent, char *name,
- ArgList arglist, Cardinal argcount);
-#endif /* _NO_PROTO */
-
-#endif /* __GLX_MOTIF */
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _GLwDrawA_h */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawAP.h b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawAP.h
deleted file mode 100755
index 6ee9d45ec..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawAP.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-/*
-** This file has been slightly modified from the original by Carlos A. M. dos
-** Santos <casantos@cpmet.ufpel.tche.br> for integration into XFree86 source
-** tree and for generating both Motif(TM) 1.2 and 2.x versions of the widgets
-** in the same library.
-*/
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawAP.h,v 1.3 2001/05/02 13:37:45 dawes Exp $ */
-
-#ifndef _GLwDrawAP_h
-#define _GLwDrawAP_h
-
-#ifdef __GLX_MOTIF
-# ifndef __GLX_INCLUDE_PRIMITIVE_P_H /* Used during library compilation */
-# include <Xm/PrimitiveP.h>
-# endif
-# include <GL/GLwMDrawA.h> /* includes IntrinsicP.h */
-#else
-# include <X11/IntrinsicP.h>
-# include <GL/GLwDrawA.h>
-#endif
-
-typedef struct _GLwDrawingAreaClassPart
-{
- char* extension;
-} GLwDrawingAreaClassPart;
-
-#ifdef __GLX_MOTIF
-typedef struct _GLwMDrawingAreaClassRec {
- CoreClassPart core_class;
- XmPrimitiveClassPart primitive_class;
- GLwDrawingAreaClassPart glwDrawingArea_class;
-} GLwMDrawingAreaClassRec;
-
-extern GLwMDrawingAreaClassRec glwMDrawingAreaClassRec;
-
-#else /* not __GLX_MOTIF */
-
-typedef struct _GLwDrawingAreaClassRec {
- CoreClassPart core_class;
- GLwDrawingAreaClassPart glwDrawingArea_class;
-} GLwDrawingAreaClassRec;
-
-extern GLwDrawingAreaClassRec glwDrawingAreaClassRec;
-#endif /* __GLX_MOTIF */
-
-typedef struct {
- /* resources */
- int * attribList;
- XVisualInfo * visualInfo;
- Boolean myList; /* TRUE if we malloced the attribList*/
- Boolean myVisual; /* TRUE if we created the visualInfo*/
- Boolean installColormap;
- Boolean allocateBackground;
- Boolean allocateOtherColors;
- Boolean installBackground;
- XtCallbackList ginitCallback;
- XtCallbackList resizeCallback;
- XtCallbackList exposeCallback;
- XtCallbackList inputCallback;
- /* specific attributes; add as we get new attributes */
- int bufferSize;
- int level;
- Boolean rgba;
- Boolean doublebuffer;
- Boolean stereo;
- int auxBuffers;
- int redSize;
- int greenSize;
- int blueSize;
- int alphaSize;
- int depthSize;
- int stencilSize;
- int accumRedSize;
- int accumGreenSize;
- int accumBlueSize;
- int accumAlphaSize;
-} GLwDrawingAreaPart;
-
-#ifdef __GLX_MOTIF
-typedef struct _GLwMDrawingAreaRec {
- CorePart core;
- XmPrimitivePart primitive;
- GLwDrawingAreaPart glwDrawingArea;
-} GLwMDrawingAreaRec;
-#else /* not __GLX_MOTIF */
-typedef struct _GLwDrawingAreaRec {
- CorePart core;
- GLwDrawingAreaPart glwDrawingArea;
-} GLwDrawingAreaRec;
-#endif /* __GLX_MOTIF */
-
-#endif /* _GLwDrawP_h */
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.c b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.c
deleted file mode 100755
index 35c34aabb..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#ifndef __GLX_MOTIF
-#define __GLX_MOTIF 1
-#endif
-#include "GLwDrawA.c"
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.h b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.h
deleted file mode 100755
index d51abc8f6..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-/*
-** This file has been slightly modified from the original by Carlos A. M. dos
-** Santos <casantos@cpmet.ufpel.tche.br> for integration into XFree86 source
-** tree and for generating both Motif(TM) 1.2 and 2.x versions of the widgets
-** in the same library.
-*/
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.h,v 1.3 2001/05/02 13:37:45 dawes Exp $ */
-
-#ifndef __GLX_MOTIF
-#define __GLX_MOTIF 1
-#endif
-#include <GL/GLwDrawA.h>
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawAP.h b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawAP.h
deleted file mode 100755
index 4289c7bce..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawAP.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-/*
-** This file has been slightly modified from the original by Carlos A. M. dos
-** Santos <casantos@cpmet.ufpel.tche.br> for integration into XFree86 source
-** tree and for generating both Motif(TM) 1.2 and 2.x versions of the widgets
-** in the same library.
-*/
-/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawAP.h,v 1.3 2001/05/02 13:37:45 dawes Exp $ */
-
-#ifndef __GLX_MOTIF
-#define __GLX_MOTIF 1
-#endif
-#include <GL/GLwDrawAP.h>
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/GNUmakefile b/xc/extras/ogl-sample/main/gfx/lib/glw/GNUmakefile
deleted file mode 100755
index ba2a99ee1..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glw/GNUmakefile
+++ /dev/null
@@ -1,74 +0,0 @@
-#!gmake
-#
-# License Applicability. Except to the extent portions of this file are
-# made subject to an alternative license as permitted in the SGI Free
-# Software License B, Version 1.1 (the "License"), the contents of this
-# file are subject only to the provisions of the License. You may not use
-# this file except in compliance with the License. You may obtain a copy
-# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-#
-# http://oss.sgi.com/projects/FreeB
-#
-# Note that, as provided in the License, the Software is distributed on an
-# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-#
-# Original Code. The Original Code is: OpenGL Sample Implementation,
-# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-# Copyright in any portions created by third parties is as indicated
-# elsewhere herein. All Rights Reserved.
-#
-# Additional Notice Provisions: The application programming interfaces
-# established by SGI in conjunction with the Original Code are The
-# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-# Window System(R) (Version 1.3), released October 19, 1998. This software
-# was created using the OpenGL(R) version 1.2.1 Sample Implementation
-# published by SGI, but has not been independently verified as being
-# compliant with the OpenGL(R) version 1.2.1 Specification.
-#
-
-include $(ROOT)/usr/include/make/commondefs
-
-TARGET = libGLw.a
-
-TARGETS = $(TARGET)
-
-CFILES = \
- GLwDrawA.c \
- $(NULL)
-
-MOTIF_CFILES = \
- GLwMDrawA.c \
- GLwDAUtil.c \
- $(NULL)
-
-ifeq ($(HAVE_MOTIF),1)
-LCDEFS += -D__GLX_MOTIF=1
-CFILES += $(MOTIF_CFILES)
-ifeq ($(OS),Linux)
-# assume motif is in / rather than $ROOT
-LCINCS += -I/usr/X11R6/include
-endif
-endif
-
-INSTALLFLAGS += -srcdst
-
-default libs: $(TARGET)
-
-headers headers_install apps:
-
-libs_install install: default
- $(INSTALL) -F $(ROOT)/usr/include/X11/GLw GLwDrawA.h
- $(INSTALL) -F $(ROOT)/usr/include/X11/GLw GLwMDrawA.h
- $(INSTALL) -F $(LIB_LOCATION) $(TARGET);
-
-$(TARGET): $(OBJECTS)
- $(AR) crl $@ $(OBJECTS);
-
-include $(COMMONRULES)
diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/Imakefile b/xc/extras/ogl-sample/main/gfx/lib/glw/Imakefile
deleted file mode 100755
index 9d8c9000e..000000000
--- a/xc/extras/ogl-sample/main/gfx/lib/glw/Imakefile
+++ /dev/null
@@ -1,50 +0,0 @@
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-#include <Library.tmpl>
-
-OBJS = \
- GLwDAUtil.o \
- GLwDrawA.o \
- GLwMDrawA.o
-
-INCLUDES = \
- -I$(TOP)/include \
- -I$(TOP)/include/GL
-
-NormalLibraryObjectRule()
-
-NormalLibraryTarget(GLw, $(OBJS))
-
-DependTarget()
-CleanTarget()
diff --git a/xc/include/GL/glxproto.h b/xc/include/GL/glxproto.h
index 2fe8e7ac7..2721e49d3 100644
--- a/xc/include/GL/glxproto.h
+++ b/xc/include/GL/glxproto.h
@@ -1,7 +1,7 @@
#ifndef _GLX_glxproto_h_
#define _GLX_glxproto_h_
-/* $XFree86: xc/include/GL/glxproto.h,v 1.5 2001/08/01 00:44:34 tsi Exp $ */
+/* $XFree86: xc/include/GL/glxproto.h,v 1.4 2001/04/10 16:07:49 dawes Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
@@ -1831,4 +1831,13 @@ typedef struct {
#define X_GLXvop_QueryContextInfoEXT 1024
+/* New extension opcodes */
+
+#define X_GLrop_WindowPos3fARB 230
+#define X_GLrop_PointParameterfARB 2065
+#define X_GLrop_PointParameterfvARB 2066
+#define X_GLrop_ActiveStencilFaceEXT 4220
+
+
+
#endif /* _GLX_glxproto_h_ */
diff --git a/xc/include/extensions/Imakefile b/xc/include/extensions/Imakefile
index 2f9717d07..0386c0a9d 100644
--- a/xc/include/extensions/Imakefile
+++ b/xc/include/extensions/Imakefile
@@ -5,7 +5,7 @@ XCOMM $Xorg: Imakefile,v 1.3 2000/08/18 04:05:44 coskrey Exp $
XCOMM $XFree86: xc/include/extensions/Imakefile,v 3.49 2002/10/16 00:31:25 dawes Exp $
-#if BuildScreenSaverExt || BuildScreenSaveLibrary
+#if BuildScreenSaverExt || BuildScreenSaverLibrary
SCREENSAVERHEADERS = saver.h saverproto.h scrnsaver.h
#endif
diff --git a/xc/lib/GL/GL/GLos2.def b/xc/lib/GL/GL/GLos2.def
deleted file mode 100644
index 95a4240ea..000000000
--- a/xc/lib/GL/GL/GLos2.def
+++ /dev/null
@@ -1,428 +0,0 @@
-LIBRARY GL
-DESCRIPTION "@#XFREE86:4.0#@ $XFree86: xc/lib/GL/GL/GLos2.def,v 1.1 2001/03/22 21:47:56 dawes Exp $"
-CODE
- PRELOAD
-DATA
- MULTIPLE NONSHARED
-STACKSIZE 131072
-EXPORTS
- glClearIndex @ 1
- glClearColor @ 2
- glClear @ 3
- glIndexMask @ 4
- glColorMask @ 5
- glAlphaFunc @ 6
- glBlendFunc @ 7
- glLogicOp @ 8
- glCullFace @ 9
- glFrontFace @ 10
- glPointSize @ 11
- glLineWidth @ 12
- glLineStipple @ 13
- glPolygonMode @ 14
- glPolygonStipple @ 15
- glGetPolygonStipple @ 16
- glEdgeFlag @ 17
- glEdgeFlagv @ 18
- glScissor @ 19
- glClipPlane @ 20
- glGetClipPlane @ 21
- glDrawBuffer @ 22
- glReadBuffer @ 23
- glEnable @ 24
- glDisable @ 25
- glIsEnabled @ 26
- glGetBooleanv @ 27
- glGetDoublev @ 28
- glGetFloatv @ 29
- glGetIntegerv @ 30
- glPushAttrib @ 31
- glPopAttrib @ 32
- glRenderMode @ 33
- glGetError @ 34
- glGetString @ 35
- glFinish @ 36
- glFlush @ 37
- glHint @ 38
- glClearDepth @ 39
- glDepthFunc @ 40
- glDepthMask @ 41
- glDepthRange @ 42
- glClearAccum @ 43
- glAccum @ 44
- glMatrixMode @ 45
- glOrtho @ 46
- glFrustum @ 47
- glViewport @ 48
- glPushMatrix @ 49
- glPopMatrix @ 50
- glLoadIdentity @ 51
- glLoadMatrixd @ 52
- glLoadMatrixf @ 53
- glMultMatrixd @ 54
- glMultMatrixf @ 55
- glRotated @ 56
- glRotatef @ 57
- glScaled @ 58
- glScalef @ 59
- glTranslated @ 60
- glTranslatef @ 61
- glIsList @ 62
- glDeleteLists @ 63
- glGenLists @ 64
- glNewList @ 65
- glEndList @ 66
- glCallList @ 67
- glCallLists @ 68
- glListBase @ 69
- glBegin @ 70
- glEnd @ 71
- glVertex2d @ 72
- glVertex2f @ 73
- glVertex2i @ 74
- glVertex2s @ 75
- glVertex3d @ 76
- glVertex3f @ 77
- glVertex3i @ 78
- glVertex3s @ 79
- glVertex4d @ 80
- glVertex4f @ 81
- glVertex4i @ 82
- glVertex4s @ 83
- glVertex2dv @ 84
- glVertex2fv @ 85
- glVertex2iv @ 86
- glVertex2sv @ 87
- glVertex3dv @ 88
- glVertex3fv @ 89
- glVertex3iv @ 90
- glVertex3sv @ 91
- glVertex4dv @ 92
- glVertex4fv @ 93
- glVertex4iv @ 94
- glVertex4sv @ 95
- glNormal3b @ 96
- glNormal3d @ 97
- glNormal3f @ 98
- glNormal3i @ 99
- glNormal3s @ 100
- glNormal3bv @ 101
- glNormal3dv @ 102
- glNormal3fv @ 103
- glNormal3iv @ 104
- glNormal3sv @ 105
- glIndexd @ 106
- glIndexf @ 107
- glIndexi @ 108
- glIndexs @ 109
- glIndexdv @ 110
- glIndexfv @ 111
- glIndexiv @ 112
- glIndexsv @ 113
- glColor3b @ 114
- glColor3d @ 115
- glColor3f @ 116
- glColor3i @ 117
- glColor3s @ 118
- glColor3ub @ 119
- glColor3ui @ 120
- glColor3us @ 121
- glColor4b @ 122
- glColor4d @ 123
- glColor4f @ 124
- glColor4i @ 125
- glColor4s @ 126
- glColor4ub @ 127
- glColor4ui @ 128
- glColor4us @ 129
- glColor3bv @ 130
- glColor3dv @ 131
- glColor3fv @ 132
- glColor3iv @ 133
- glColor3sv @ 134
- glColor3ubv @ 135
- glColor3uiv @ 136
- glColor3usv @ 137
- glColor4bv @ 138
- glColor4dv @ 139
- glColor4fv @ 140
- glColor4iv @ 141
- glColor4sv @ 142
- glColor4ubv @ 143
- glColor4uiv @ 144
- glColor4usv @ 145
- glTexCoord1d @ 146
- glTexCoord1f @ 147
- glTexCoord1i @ 148
- glTexCoord1s @ 149
- glTexCoord2d @ 150
- glTexCoord2f @ 151
- glTexCoord2i @ 152
- glTexCoord2s @ 153
- glTexCoord3d @ 154
- glTexCoord3f @ 155
- glTexCoord3i @ 156
- glTexCoord3s @ 157
- glTexCoord4d @ 158
- glTexCoord4f @ 159
- glTexCoord4i @ 160
- glTexCoord4s @ 161
- glTexCoord1dv @ 162
- glTexCoord1fv @ 163
- glTexCoord1iv @ 164
- glTexCoord1sv @ 165
- glTexCoord2dv @ 166
- glTexCoord2fv @ 167
- glTexCoord2iv @ 168
- glTexCoord2sv @ 169
- glTexCoord3dv @ 170
- glTexCoord3fv @ 171
- glTexCoord3iv @ 172
- glTexCoord3sv @ 173
- glTexCoord4dv @ 174
- glTexCoord4fv @ 175
- glTexCoord4iv @ 176
- glTexCoord4sv @ 177
- glRasterPos2d @ 178
- glRasterPos2f @ 179
- glRasterPos2i @ 180
- glRasterPos2s @ 181
- glRasterPos3d @ 182
- glRasterPos3f @ 183
- glRasterPos3i @ 184
- glRasterPos3s @ 185
- glRasterPos4d @ 186
- glRasterPos4f @ 187
- glRasterPos4i @ 188
- glRasterPos4s @ 189
- glRasterPos2dv @ 190
- glRasterPos2fv @ 191
- glRasterPos2iv @ 192
- glRasterPos2sv @ 193
- glRasterPos3dv @ 194
- glRasterPos3fv @ 195
- glRasterPos3iv @ 196
- glRasterPos3sv @ 197
- glRasterPos4dv @ 198
- glRasterPos4fv @ 199
- glRasterPos4iv @ 200
- glRasterPos4sv @ 201
- glRectd @ 202
- glRectf @ 203
- glRecti @ 204
- glRects @ 205
- glRectdv @ 206
- glRectfv @ 207
- glRectiv @ 208
- glRectsv @ 209
- glShadeModel @ 210
- glLightf @ 211
- glLighti @ 212
- glLightfv @ 213
- glLightiv @ 214
- glGetLightfv @ 215
- glGetLightiv @ 216
- glLightModelf @ 217
- glLightModeli @ 218
- glLightModelfv @ 219
- glLightModeliv @ 220
- glMaterialf @ 221
- glMateriali @ 222
- glMaterialfv @ 223
- glMaterialiv @ 224
- glGetMaterialfv @ 225
- glGetMaterialiv @ 226
- glColorMaterial @ 227
- glPixelZoom @ 228
- glPixelStoref @ 229
- glPixelStorei @ 230
- glPixelTransferf @ 231
- glPixelTransferi @ 232
- glPixelMapfv @ 233
- glPixelMapuiv @ 234
- glPixelMapusv @ 235
- glGetPixelMapfv @ 236
- glGetPixelMapuiv @ 237
- glGetPixelMapusv @ 238
- glBitmap @ 239
- glReadPixels @ 240
- glDrawPixels @ 241
- glCopyPixels @ 242
- glStencilFunc @ 243
- glStencilMask @ 244
- glStencilOp @ 245
- glClearStencil @ 246
- glTexGend @ 247
- glTexGenf @ 248
- glTexGeni @ 249
- glTexGendv @ 250
- glTexGenfv @ 251
- glTexGeniv @ 252
- glGetTexGendv @ 253
- glGetTexGenfv @ 254
- glGetTexGeniv @ 255
- glTexEnvf @ 256
- glTexEnvi @ 257
- glTexEnvfv @ 258
- glTexEnviv @ 259
- glGetTexEnvfv @ 260
- glGetTexEnviv @ 261
- glTexParameterf @ 262
- glTexParameteri @ 263
- glTexParameterfv @ 264
- glTexParameteriv @ 265
- glGetTexParameterfv @ 266
- glGetTexParameteriv @ 267
- glGetTexLevelParameterfv @ 268
- glGetTexLevelParameteriv @ 269
- glTexImage1D @ 270
- glTexImage2D @ 271
- glGetTexImage @ 272
- glMap1d @ 273
- glMap1f @ 274
- glMap2d @ 275
- glMap2f @ 276
- glGetMapdv @ 277
- glGetMapfv @ 278
- glGetMapiv @ 279
- glEvalCoord1d @ 280
- glEvalCoord1f @ 281
- glEvalCoord1dv @ 282
- glEvalCoord1fv @ 283
- glEvalCoord2d @ 284
- glEvalCoord2f @ 285
- glEvalCoord2dv @ 286
- glEvalCoord2fv @ 287
- glMapGrid1d @ 288
- glMapGrid1f @ 289
- glMapGrid2d @ 290
- glMapGrid2f @ 291
- glEvalPoint1 @ 292
- glEvalPoint2 @ 293
- glEvalMesh1 @ 294
- glEvalMesh2 @ 295
- glFogf @ 296
- glFogi @ 297
- glFogfv @ 298
- glFogiv @ 299
- glFeedbackBuffer @ 300
- glPassThrough @ 301
- glSelectBuffer @ 302
- glInitNames @ 303
- glLoadName @ 304
- glPushName @ 305
- glPopName @ 306
-; glBlendEquationEXT @ 307
-; glBlendColorEXT @ 308
- glPolygonOffset @ 309
-; glVertexPointerEXT @ 310
-; glNormalPointerEXT @ 311
-; glColorPointerEXT @ 312
-; glIndexPointerEXT @ 313
-; glTexCoordPointerEXT @ 314
-; glEdgeFlagPointerEXT @ 315
-; glGetPointervEXT @ 316
-; glArrayElementEXT @ 317
-; glDrawArraysEXT @ 318
-; OSMesaCreateContext @ 319
-; OSMesaDestroyContext @ 320
-; OSMesaMakeCurrent @ 321
-; XMesaCreateContext @ 322
-; XMesaDestroyContext @ 323
-; XMesaMakeCurrent @ 326
-; XMesaGetCurrentContext @ 327
-; XMesaSwapBuffers @ 328
-; XMesaGetBackBuffer @ 329
- glXChooseVisual @ 330
- glXCreateContext @ 331
- glXDestroyContext @ 332
- glXMakeCurrent @ 333
- glXCopyContext @ 334
- glXSwapBuffers @ 335
- glXCreateGLXPixmap @ 336
- glXDestroyGLXPixmap @ 337
- glXQueryExtension @ 338
- glXQueryVersion @ 339
- glXIsDirect @ 340
- glXGetConfig @ 341
- glXGetCurrentContext @ 342
- glXGetCurrentDrawable @ 343
- glXWaitGL @ 344
- glXWaitX @ 345
- glXUseXFont @ 346
- glXQueryExtensionsString @ 347
- glXQueryServerString @ 348
- glXGetClientString @ 349
- glPushClientAttrib @ 350
- glPopClientAttrib @ 351
- glIndexub @ 352
- glIndexubv @ 353
- glVertexPointer @ 354
- glNormalPointer @ 355
- glColorPointer @ 356
- glIndexPointer @ 357
- glTexCoordPointer @ 358
- glEdgeFlagPointer @ 359
- glGetPointerv @ 360
- glArrayElement @ 361
- glDrawArrays @ 362
- glDrawElements @ 363
- glInterleavedArrays @ 364
- glGenTextures @ 365
- glDeleteTextures @ 366
- glBindTexture @ 367
- glPrioritizeTextures @ 368
- glAreTexturesResident @ 369
- glIsTexture @ 370
- glTexSubImage1D @ 371
- glTexSubImage2D @ 372
- glCopyTexImage1D @ 373
- glCopyTexImage2D @ 374
- glCopyTexSubImage1D @ 375
- glCopyTexSubImage2D @ 376
-; glWindowPos2iMESA @ 377
-; glWindowPos2sMESA @ 378
-; glWindowPos2fMESA @ 379
-; glWindowPos2dMESA @ 380
-; glWindowPos2ivMESA @ 381
-; glWindowPos2svMESA @ 382
-; glWindowPos2fvMESA @ 383
-; glWindowPos2dvMESA @ 384
-; glWindowPos3iMESA @ 385
-; glWindowPos3sMESA @ 386
-; glWindowPos3fMESA @ 387
-; glWindowPos3dMESA @ 388
-; glWindowPos3ivMESA @ 389
-; glWindowPos3svMESA @ 390
-; glWindowPos3fvMESA @ 391
-; glWindowPos3dvMESA @ 392
-; glWindowPos4iMESA @ 393
-; glWindowPos4sMESA @ 394
-; glWindowPos4fMESA @ 395
-; glWindowPos4dMESA @ 396
-; glWindowPos4ivMESA @ 397
-; glWindowPos4svMESA @ 398
-; glWindowPos4fvMESA @ 399
-; glWindowPos4dvMESA @ 400
-; glXCreateGLXPixmapMESA @ 401
-; glXReleaseBuffersMESA @ 402
-; OSMesaGetCurrentContext @ 403
-; OSMesaPixelStore @ 404
-; OSMesaGetIntegerv @ 405
-; XMesaCreateVisual @ 406
-; XMesaDestroyVisual @ 407
-; XMesaCreateWindowBuffer @ 408
-; XMesaCreatePixmapBuffer @ 409
-; XMesaDestroyBuffer @ 410
-; XMesaGetCurrentBuffer @ 411
-; XMesaFlush @ 412
-; XMesaGetString @ 413
-; glPolygonOffsetEXT @ 414
- glDisableClientState @ 450
- glEnableClientState @ 451
- glXFreeContextEXT @ 452
- glXGetContextIDEXT @ 453
- glXGetCurrentDisplay @ 454
- glXImportContextEXT @ 455
- glXQueryContextInfoEXT @ 456
- glXGetCurrentDrawableEXT @ 457
diff --git a/xc/lib/GL/GL/GLos2.rsp b/xc/lib/GL/GL/GLos2.rsp
deleted file mode 100644
index 10b1b5486..000000000
--- a/xc/lib/GL/GL/GLos2.rsp
+++ /dev/null
@@ -1,6 +0,0 @@
-glx\clientattrib.obj glx\compsize.obj glx\eval.obj glx\g_render.obj+
-glx\g_single.obj glx\g_vendpriv.obj glx\glxcmds.obj glx\glxext.obj+
-glx\pixel.obj glx\pixelstore.obj glx\render2.obj glx\renderpix.obj+
-glx\single2.obj glx\singlepix.obj glx\vertarr.obj /NOI /NOL /NOD /BAT
-GL.dll
-GL.map
diff --git a/xc/lib/GL/dri/Imakefile b/xc/lib/GL/dri/Imakefile
index 5625cd56c..c85308fc2 100644
--- a/xc/lib/GL/dri/Imakefile
+++ b/xc/lib/GL/dri/Imakefile
@@ -21,17 +21,13 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
-I$(MESASRCDIR)/include -I$(MESASRCDIR)/src
#endif
-#if GlxBuiltInTdfx
- TDFX_DEFS = -DUSE_TDFX
-#endif
-
#if GlxUseBuiltInDRIDriver
GLX_DEFS = -DBUILT_IN_DRI_DRIVER
#endif
PATHDEFINES = -DDEFAULT_DRIVER_DIR=\"$(MODULEDIR)/dri\"
- DEFINES = $(ALLOC_DEFINES) GlxDefines $(TDFX_DEFS) $(GLX_DEFS) $(PATHDEFINES)
+ DEFINES = $(ALLOC_DEFINES) GlxDefines $(GLX_DEFS) $(PATHDEFINES)
INCLUDES = -I$(XLIBSRC) -I$(EXTINCSRC) -I$(XF86OSSRC) $(DRI_INCS)
SRCS = XF86dri.c dri_util.c $(DRI_SRCS)
OBJS = XF86dri.o dri_util.o $(DRI_OBJS)
diff --git a/xc/lib/GL/dri/dri_glx.c b/xc/lib/GL/dri/dri_glx.c
index d962e8585..c910dcaf7 100644
--- a/xc/lib/GL/dri/dri_glx.c
+++ b/xc/lib/GL/dri/dri_glx.c
@@ -49,11 +49,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <stdarg.h>
-typedef void *(*CreateScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc,
- int numConfigs, __GLXvisualConfig *config);
-
-
-
#ifdef BUILT_IN_DRI_DRIVER
extern void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
@@ -68,6 +63,12 @@ extern void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
#define DEFAULT_DRIVER_DIR "/usr/X11R6/lib/modules/dri"
#endif
+static __DRIdriver *Drivers = NULL;
+
+
+/*
+ * printf wrappers
+ */
static void InfoMessageF(const char *f, ...)
{
@@ -94,36 +95,6 @@ static void ErrorMessageF(const char *f, ...)
}
}
-#if 0
-static void PrintF(const char *f, ...)
-{
- va_list args;
- const char *env;
-
- if ((env = getenv("LIBGL_DEBUG")) && strstr(env, "verbose")) {
- va_start(args, f);
- vfprintf(stderr, f, args);
- va_end(args);
- }
-}
-#endif
-
-static void ErrorMessage(const char *msg)
-{
- if (getenv("LIBGL_DEBUG")) {
- fprintf(stderr, "libGL error: %s\n", msg);
- }
-}
-
-
-static void InfoMessage(const char *msg)
-{
- const char *env = getenv("LIBGL_DEBUG");
- if (env && strstr(env, "verbose")) {
- fprintf(stderr, "libGL: %s\n", msg);
- }
-}
-
/*
* We'll save a pointer to this function when we couldn't find a
@@ -194,7 +165,6 @@ static void ExtractDir(int index, const char *paths, int dirLen, char *dir)
}
-
/*
* Try to dlopen() the named driver. This function adds the
* "_dri.so" suffix to the driver name and searches the
@@ -205,10 +175,19 @@ static void ExtractDir(int index, const char *paths, int dirLen, char *dir)
* Return:
* handle from dlopen, or NULL if driver file not found.
*/
-static void *OpenDriver(const char *driverName)
+static __DRIdriver *OpenDriver(const char *driverName)
{
char *libPaths = NULL;
int i;
+ __DRIdriver *driver;
+
+ /* First, search Drivers list to see if we've already opened this driver */
+ for (driver = Drivers; driver; driver = driver->next) {
+ if (strcmp(driver->name, driverName) == 0) {
+ /* found it */
+ return driver;
+ }
+ }
if (geteuid() == getuid()) {
/* don't allow setuid apps to use LIBGL_DRIVERS_PATH */
@@ -224,95 +203,107 @@ static void *OpenDriver(const char *driverName)
void *handle;
ExtractDir(i, libPaths, 1000, libDir);
if (!libDir[0])
- return NULL;
+ break; /* ran out of paths to search */
snprintf(realDriverName, 200, "%s/%s_dri.so", libDir, driverName);
InfoMessageF("OpenDriver: trying %s\n", realDriverName);
handle = dlopen(realDriverName, RTLD_NOW | RTLD_GLOBAL);
if (handle) {
- return handle;
+ /* allocate __DRIdriver struct */
+ driver = (__DRIdriver *) Xmalloc(sizeof(__DRIdriver));
+ if (!driver)
+ return NULL; /* out of memory! */
+ /* init the struct */
+ driver->name = __glXstrdup(driverName);
+ if (!driver->name) {
+ Xfree(driver);
+ return NULL; /* out of memory! */
+ }
+ driver->createScreenFunc = (CreateScreenFunc)
+ dlsym(handle, "__driCreateScreen");
+ if (!driver->createScreenFunc) {
+ /* If the driver doesn't have this symbol then something's
+ * really, really wrong.
+ */
+ ErrorMessageF("__driCreateScreen() not defined in %s_dri.so!\n",
+ driverName);
+ Xfree(driver);
+ dlclose(handle);
+ continue;
+ }
+ driver->registerExtensionsFunc = (RegisterExtensionsFunc)
+ dlsym(handle, "__driRegisterExtensions");
+ driver->handle = handle;
+ /* put at head of linked list */
+ driver->next = Drivers;
+ Drivers = driver;
+ return driver;
}
else {
- ErrorMessageF("dlopen failed: %s\n", dlerror());
+ ErrorMessageF("dlopen %s failed (%s)\n", realDriverName, dlerror());
}
}
+ ErrorMessageF("unable to find driver: %s_dri.so\n", driverName);
return NULL;
}
-
/*
- * Initialize two arrays: an array of createScreen function pointers
- * and an array of dlopen library handles. Arrays are indexed by
- * screen number.
- * We use the DRI in order to find the __driCreateScreen function
- * exported by each screen on a display.
+ * Given a display pointer and screen number, determine the name of
+ * the DRI driver for the screen. (I.e. "r128", "tdfx", etc).
+ * Return True for success, False for failure.
*/
-static void Find_CreateScreenFuncs(Display *dpy,
- CreateScreenFunc *createFuncs,
- void **libraryHandles)
+static Bool GetDriverName(Display *dpy, int scrNum, char **driverName)
{
- const int numScreens = ScreenCount(dpy);
- int scrn;
+ int directCapable;
+ Bool b;
+ int driverMajor, driverMinor, driverPatch;
- __glXRegisterExtensions();
+ *driverName = NULL;
- for (scrn = 0; scrn < numScreens; scrn++) {
- int directCapable;
- Bool b;
- int driverMajor, driverMinor, driverPatch;
- char *driverName = NULL;
- void *handle;
-
- /* defaults */
- createFuncs[scrn] = DummyCreateScreen;
- libraryHandles[scrn] = NULL;
-
- if (!XF86DRIQueryDirectRenderingCapable(dpy, scrn, &directCapable)) {
- ErrorMessage("XF86DRIQueryDirectRenderingCapable failed");
- continue;
- }
- if (!directCapable) {
- ErrorMessage("XF86DRIQueryDirectRenderingCapable returned false");
- continue;
- }
+ if (!XF86DRIQueryDirectRenderingCapable(dpy, scrNum, &directCapable)) {
+ ErrorMessageF("XF86DRIQueryDirectRenderingCapable failed");
+ return False;
+ }
+ if (!directCapable) {
+ ErrorMessageF("XF86DRIQueryDirectRenderingCapable returned false");
+ return False;
+ }
- /*
- * Use DRI to find the device driver for use on screen number 'scrn'.
- */
- b = XF86DRIGetClientDriverName(dpy, scrn, &driverMajor, &driverMinor,
- &driverPatch, &driverName);
- if (!b) {
- ErrorMessageF("Cannot determine driver name for screen %d\n", scrn);
- continue;
- }
+ b = XF86DRIGetClientDriverName(dpy, scrNum, &driverMajor, &driverMinor,
+ &driverPatch, driverName);
+ if (!b) {
+ ErrorMessageF("Cannot determine driver name for screen %d\n", scrNum);
+ return False;
+ }
+ InfoMessageF("XF86DRIGetClientDriverName: %d.%d.%d %s (screen %d)\n",
+ driverMajor, driverMinor, driverPatch, *driverName, scrNum);
- /*
- * Open the driver module and save the pointer to its
- * __driCreateScreen function.
- */
- handle = OpenDriver(driverName);
- if (handle) {
- CreateScreenFunc createScreenFunc;
- createScreenFunc = (CreateScreenFunc) dlsym(handle, "__driCreateScreen");
- if (createScreenFunc) {
- /* success! */
- createFuncs[scrn] = createScreenFunc;
- libraryHandles[scrn] = handle;
- continue; /* onto the next screen */
- }
- else {
- ErrorMessage("driCreateScreen() not defined in driver!");
- dlclose(handle);
- }
- }
- } /* for scrn */
+ return True;
}
+
+/*
+ * Given a display pointer and screen number, return a __DRIdriver handle.
+ * Return NULL if anything goes wrong.
+ */
+__DRIdriver *driGetDriver(Display *dpy, int scrNum)
+{
+ char *driverName;
+
+ if (GetDriverName(dpy, scrNum, &driverName)) {
+ return OpenDriver(driverName);
+ }
+ return NULL;
+}
+
+
#endif /* BUILT_IN_DRI_DRIVER */
+/* This function isn't currently used.
+ */
static void driDestroyDisplay(Display *dpy, void *private)
{
__DRIdisplayPrivate *pdpyp = (__DRIdisplayPrivate *)private;
@@ -330,12 +321,18 @@ static void driDestroyDisplay(Display *dpy, void *private)
}
+/*
+ * Allocate, initialize and return a __DRIdisplayPrivate object.
+ * This is called from __glXInitialize() when we are given a new
+ * display pointer.
+ */
void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp)
{
const int numScreens = ScreenCount(dpy);
__DRIdisplayPrivate *pdpyp;
int eventBase, errorBase;
int major, minor, patch;
+ int scrn;
/* Initialize these fields to NULL in case we fail.
* If we don't do this we may later get segfaults trying to free random
@@ -366,147 +363,110 @@ void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp)
/* allocate array of pointers to createScreen funcs */
pdisp->createScreen = (CreateScreenFunc *) Xmalloc(numScreens * sizeof(void *));
- if (!pdisp->createScreen)
+ if (!pdisp->createScreen) {
+ XFree(pdpyp);
return NULL;
+ }
/* allocate array of library handles */
pdpyp->libraryHandles = (void **) Xmalloc(numScreens * sizeof(void*));
if (!pdpyp->libraryHandles) {
Xfree(pdisp->createScreen);
+ XFree(pdpyp);
return NULL;
}
#ifdef BUILT_IN_DRI_DRIVER
- /* we'll statically bind to the __driCreateScreen function */
- {
- int i;
- for (i = 0; i < numScreens; i++) {
- pdisp->createScreen[i] = __driCreateScreen;
- pdpyp->libraryHandles[i] = NULL;
- }
+ /* we'll statically bind to the built-in __driCreateScreen function */
+ for (scrn = 0; scrn < numScreens; scrn++) {
+ pdisp->createScreen[scrn] = __driCreateScreen;
+ pdpyp->libraryHandles[scrn] = NULL;
}
+
#else
- Find_CreateScreenFuncs(dpy, pdisp->createScreen, pdpyp->libraryHandles);
+ /* dynamically discover DRI drivers for all screens, saving each
+ * driver's "__driCreateScreen" function pointer. That's the bootstrap
+ * entrypoint for all DRI drivers.
+ */
+ __glXRegisterExtensions();
+ for (scrn = 0; scrn < numScreens; scrn++) {
+ __DRIdriver *driver = driGetDriver(dpy, scrn);
+ if (driver) {
+ pdisp->createScreen[scrn] = driver->createScreenFunc;
+ pdpyp->libraryHandles[scrn] = driver->handle;
+ }
+ else {
+ pdisp->createScreen[scrn] = DummyCreateScreen;
+ pdpyp->libraryHandles[scrn] = NULL;
+ }
+ }
#endif
return (void *)pdpyp;
}
-#ifndef BUILT_IN_DRI_DRIVER
-/*
- * Use the DRI and dlopen/dlsym facilities to find the GL extensions
- * possible on the given display and screen.
- */
-static void
-register_extensions_on_screen(Display *dpy, int scrNum)
-{
- int eventBase, errorBase;
- Bool b, b2;
- int driMajor, driMinor, driPatch;
- int driverMajor, driverMinor, driverPatch;
- char *driverName = NULL;
- void *handle;
-
- /*
- * Check if the DRI extension is available, check the DRI version,
- * determine the 3D driver for the screen.
- */
- b = XF86DRIQueryExtension(dpy, &eventBase, &errorBase);
- if (!b) {
- InfoMessage("XF86DRIQueryExtension failed");
- return;
- }
-
- b = XF86DRIQueryDirectRenderingCapable(dpy, scrNum, &b2);
- if (!b || !b2) {
- InfoMessage("XF86DRIQueryDirectRenderingCapable failed");
- return;
- }
-
- b = XF86DRIQueryVersion(dpy, &driMajor, &driMinor, &driPatch);
- if (!b) {
- InfoMessage("XF86DRIQueryVersion failed");
- }
-
- b = XF86DRIGetClientDriverName(dpy, scrNum, &driverMajor, &driverMinor,
- &driverPatch, &driverName);
- if (!b) {
- InfoMessage("XF86DRIGetClientDriverName failed");
- return;
- }
- else {
- InfoMessageF("XF86DRIGetClientDriverName: %d.%d.%d %s (screen %d)\n",
- driverMajor, driverMinor, driverPatch, driverName, scrNum);
- }
-
- /*
- * OK, now we know the name of the relevant driver for this screen.
- * dlopen() the driver library file, get a pointer to the driver's
- * __driRegisterExtensions() function, and call it if it exists.
- */
- handle = OpenDriver(driverName);
- if (handle) {
- typedef void *(*RegisterExtFunc)(void);
- RegisterExtFunc registerExtFunc = (RegisterExtFunc) dlsym(handle,
- "__driRegisterExtensions");
- if (registerExtFunc) {
- (*registerExtFunc)();
- }
- dlclose(handle);
- return;
- }
-}
-#endif /* !BUILT_IN_DRI_DRIVER */
-
-
/*
** Here we'll query the DRI driver for each screen and let each
** driver register its GL extension functions. We only have to
-** do this once. But it MUST be done before we create any contexts
-** (i.e. before any dispatch tables are created) and before
-** glXGetProcAddressARB() returns.
+** do this once.
**
-** Currently called by glXGetProcAddress(), __glXInitialize(), and
-** __glXNewIndirectAPI().
+** In older versions of libGL (prior to October 2002) we _always_
+** called this function during libGL start-up. Now, we only call
+** it from glXGetProcAddress() as a last resort.
+**
+** Two key things changed along the way:
+** 1. _glapi_get_proc_address() now generates new dispatch stub functions
+** anytime it gets an unknown "gl*" function name. I.e. we always return
+** a valid function address and later patch it up to use the correct
+** dispatch offset.
+** 2. The GL API dispatch table is a fixed size (with plenty of extra slots).
+** This means we don't have to register all new functions before we create
+** the first dispatch table.
*/
void
__glXRegisterExtensions(void)
{
+#ifndef BUILT_IN_DRI_DRIVER
static GLboolean alreadyCalled = GL_FALSE;
+ int displayNum, maxDisplays;
- if (alreadyCalled) {
+ if (alreadyCalled)
return;
+ alreadyCalled = GL_TRUE;
+
+ if (getenv("LIBGL_MULTIHEAD")) {
+ /* we'd like to always take this path but doing so causes a second
+ * or more of delay while the XOpenDisplay() function times out.
+ */
+ maxDisplays = 10; /* infinity, really */
+ }
+ else {
+ /* just open the :0 display */
+ maxDisplays = 1;
}
-#ifndef BUILT_IN_DRI_DRIVER
- {
- int displayNum, maxDisplays;
- if (getenv("LIBGL_MULTIHEAD"))
- maxDisplays = 10; /* infinity, really */
- else
- maxDisplays = 1;
- for (displayNum = 0; displayNum < maxDisplays; displayNum++) {
- char displayName[200];
- Display *dpy;
- snprintf(displayName, 199, ":%d.0", displayNum);
- dpy = XOpenDisplay(displayName);
- if (dpy) {
- const int numScreens = ScreenCount(dpy);
- int screenNum;
- for (screenNum = 0; screenNum < numScreens; screenNum++) {
- register_extensions_on_screen(dpy, screenNum);
+ for (displayNum = 0; displayNum < maxDisplays; displayNum++) {
+ char displayName[200];
+ Display *dpy;
+ snprintf(displayName, 199, ":%d.0", displayNum);
+ dpy = XOpenDisplay(displayName);
+ if (dpy) {
+ const int numScreens = ScreenCount(dpy);
+ int screenNum;
+ for (screenNum = 0; screenNum < numScreens; screenNum++) {
+ __DRIdriver *driver = driGetDriver(dpy, screenNum);
+ if (driver && driver->registerExtensionsFunc) {
+ (*driver->registerExtensionsFunc)();
}
- XCloseDisplay(dpy);
- }
- else {
- break;
}
+ XCloseDisplay(dpy);
+ }
+ else {
+ break;
}
}
-
- alreadyCalled = GL_TRUE;
#endif
}
diff --git a/xc/lib/GL/dri/dri_util.c b/xc/lib/GL/dri/dri_util.c
index a9a39215c..3152dd5aa 100644
--- a/xc/lib/GL/dri/dri_util.c
+++ b/xc/lib/GL/dri/dri_util.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/dri/dri_util.c,v 1.1 2002/02/22 21:32:52 dawes Exp $ */
+/* $XFree86$ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -60,6 +60,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifdef GLX_DIRECT_RENDERING
#include <assert.h>
+#include <stdarg.h>
#include <unistd.h>
#include <X11/Xlibint.h>
#include <Xext.h>
@@ -118,42 +119,37 @@ __driUtilMessage(const char *f, ...)
/*****************************************************************/
+
/*
- * Return pointer to the __GLXvisualConfig specified by dpy, scrn and vid.
- * Return NULL if not found.
+ * Initialize a __GLcontextModes structure with the GLX parameters
+ * specified by the given visual ID. Too bad that the __GLXvisualConfig
+ * and __GLcontextModes structures are so similar, but separate.
*/
-static __GLXvisualConfig *
-__driFindGlxConfig(Display *dpy, int scrn, VisualID vid)
+static GLboolean
+findConfigMode(Display *dpy, int scrn, VisualID vid, __GLcontextModes *modes)
{
- __GLXdisplayPrivate *priv;
- __GLXscreenConfigs *glxScrnConfigs;
- __GLXvisualConfig *glxConfigs;
- int numConfigs, i;
-
- priv = __glXInitialize(dpy);
- assert(priv);
-
- glxScrnConfigs = priv->screenConfigs;
- assert(glxScrnConfigs);
-
- numConfigs = glxScrnConfigs[scrn].numConfigs;
- glxConfigs = glxScrnConfigs[scrn].configs;
-
- for (i = 0; i < numConfigs; i++) {
- if (glxConfigs[i].vid == vid) {
- return glxConfigs +i;
+ const __GLXvisualConfig *config;
+ const __DRIscreen *pDRIScreen;
+ const __DRIscreenPrivate *screenPriv;
+ int i;
+
+ pDRIScreen = __glXFindDRIScreen(dpy, scrn);
+ if (!pDRIScreen)
+ return GL_FALSE;
+ screenPriv = (const __DRIscreenPrivate *) pDRIScreen->private;
+
+ /* Search list of configs for matching vid */
+ config = NULL;
+ for (i = 0; i < screenPriv->numConfigs; i++) {
+ if (screenPriv->configs[i].vid == vid) {
+ config = screenPriv->configs + i;
+ break;
}
}
- return NULL;
-}
-
+ if (!config)
+ return GL_FALSE;
-/* This function comes from programs/Xserver/GL/glx/glxcmds.c
- */
-static void
-__glXFormatGLModes(__GLcontextModes *modes, const __GLXvisualConfig *config)
-{
- /*__glXMemset(modes, 0, sizeof(__GLcontextModes));*/
+ /* return mode parameters */
memset(modes, 0, sizeof(__GLcontextModes));
modes->rgbMode = (config->rgba != 0);
@@ -187,8 +183,9 @@ __glXFormatGLModes(__GLcontextModes *modes, const __GLXvisualConfig *config)
modes->stencilBits = config->stencilSize;
modes->numAuxBuffers = 0; /* XXX: should be picked up from the visual */
-
modes->level = config->level;
+
+ return GL_TRUE;
}
@@ -244,6 +241,7 @@ static Bool __driWindowExists(Display *dpy, GLXDrawable draw)
XWindowAttributes xwa;
int (*oldXErrorHandler)(Display *, XErrorEvent *);
+ XSync(dpy, GL_FALSE);
__driWindowExistsFlag = GL_TRUE;
oldXErrorHandler = XSetErrorHandler(__driWindowExistsErrorHandler);
XGetWindowAttributes(dpy, draw, &xwa); /* dummy request */
@@ -261,7 +259,7 @@ static void __driGarbageCollectDrawables(void *drawHash)
do {
__DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)pdraw->private;
dpy = pdp->driScreenPriv->display;
- XSync(dpy, GL_FALSE);
+ /* XXX someday, use libGL's __glXWindowExists() function */
if (!__driWindowExists(dpy, draw)) {
/* Destroy the local drawable data in the hash table, if the
drawable no longer exists in the Xserver */
@@ -485,7 +483,7 @@ static Bool driBindContext2(Display *dpy, int scrn,
*/
if (!pdp->pStamp || *pdp->pStamp != pdp->lastStamp) {
DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
- __driUtilUpdateDrawableInfo(dpy, scrn, pdp);
+ __driUtilUpdateDrawableInfo(pdp);
DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
}
@@ -585,8 +583,7 @@ static Bool driBindContext(Display *dpy, int scrn,
* info.
*/
void
-__driUtilUpdateDrawableInfo(Display *dpy, int scrn,
- __DRIdrawablePrivate *pdp)
+__driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp)
{
__DRIscreenPrivate *psp;
__DRIcontextPrivate *pcp = pdp->driContextPriv;
@@ -612,7 +609,8 @@ __driUtilUpdateDrawableInfo(Display *dpy, int scrn,
DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
- if (!XF86DRIGetDrawableInfo(dpy, scrn, pdp->draw,
+ if (!__driFindDrawable(psp->drawHash, pdp->draw) ||
+ !XF86DRIGetDrawableInfo(pdp->display, pdp->screen, pdp->draw,
&pdp->index, &pdp->lastStamp,
&pdp->x, &pdp->y, &pdp->w, &pdp->h,
&pdp->numClipRects, &pdp->pClipRects,
@@ -621,21 +619,36 @@ __driUtilUpdateDrawableInfo(Display *dpy, int scrn,
&pdp->numBackClipRects,
&pdp->pBackClipRects
)) {
+ /* Error -- eg the window may have been destroyed. Keep going
+ * with no cliprects.
+ */
+ pdp->pStamp = &pdp->lastStamp; /* prevent endless loop */
pdp->numClipRects = 0;
pdp->pClipRects = NULL;
pdp->numBackClipRects = 0;
- pdp->pBackClipRects = 0;
- /* ERROR!!! */
+ pdp->pBackClipRects = NULL;
}
+ else
+ pdp->pStamp = &(psp->pSAREA->drawableTable[pdp->index].stamp);
DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
- pdp->pStamp = &(psp->pSAREA->drawableTable[pdp->index].stamp);
}
/*****************************************************************/
/*
+ * Called directly from glXSwapBuffers().
+ */
+static void driSwapBuffers( Display *dpy, void *drawablePrivate )
+{
+ __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
+ dPriv->swapBuffers(dPriv);
+ (void) dpy;
+}
+
+
+/*
* This is called via __DRIscreenRec's createDrawable pointer.
* libGL doesn't use it at this time. See comments in glxclient.h.
*/
@@ -655,7 +668,6 @@ static void *driCreateDrawable(Display *dpy, int scrn, GLXDrawable draw,
__DRIscreen *pDRIScreen;
__DRIscreenPrivate *psp;
__DRIdrawablePrivate *pdp;
- __GLXvisualConfig *config;
__GLcontextModes modes;
pdp = (__DRIdrawablePrivate *)Xmalloc(sizeof(__DRIdrawablePrivate));
@@ -681,6 +693,8 @@ static void *driCreateDrawable(Display *dpy, int scrn, GLXDrawable draw,
pdp->numBackClipRects = 0;
pdp->pClipRects = NULL;
pdp->pBackClipRects = NULL;
+ pdp->display = dpy;
+ pdp->screen = scrn;
if (!(pDRIScreen = __glXFindDRIScreen(dpy, scrn))) {
(void)XF86DRIDestroyDrawable(dpy, scrn, pdp->draw);
@@ -694,21 +708,18 @@ static void *driCreateDrawable(Display *dpy, int scrn, GLXDrawable draw,
pdp->driScreenPriv = psp;
pdp->driContextPriv = &psp->dummyContextPriv;
- config = __driFindGlxConfig(dpy, scrn, vid);
- if (!config)
+ if (!findConfigMode(dpy, scrn, vid, &modes))
return NULL;
- /* convert GLXvisualConfig struct to GLcontextModes struct */
- __glXFormatGLModes(&modes, config);
-
- if (!(*psp->DriverAPI.CreateBuffer)(dpy, psp, pdp, &modes, isPixmap)) {
+ if (!(*psp->DriverAPI.CreateBuffer)(psp, pdp, &modes, isPixmap)) {
(void)XF86DRIDestroyDrawable(dpy, scrn, pdp->draw);
Xfree(pdp);
return NULL;
}
pdraw->destroyDrawable = driDestroyDrawable;
- pdraw->swapBuffers = psp->DriverAPI.SwapBuffers;
+ pdraw->swapBuffers = driSwapBuffers; /* called by glXSwapBuffers() */
+ pdp->swapBuffers = psp->DriverAPI.SwapBuffers;
return (void *) pdp;
}
@@ -735,8 +746,14 @@ static void driDestroyDrawable(Display *dpy, void *drawablePrivate)
(*psp->DriverAPI.DestroyBuffer)(pdp);
if (__driWindowExists(dpy, pdp->draw))
(void)XF86DRIDestroyDrawable(dpy, scrn, pdp->draw);
- if (pdp->pClipRects)
+ if (pdp->pClipRects) {
Xfree(pdp->pClipRects);
+ pdp->pClipRects = NULL;
+ }
+ if (pdp->pBackClipRects) {
+ Xfree(pdp->pBackClipRects);
+ pdp->pBackClipRects = NULL;
+ }
Xfree(pdp);
}
}
@@ -758,8 +775,8 @@ static void driDestroyContext(Display *dpy, int scrn, void *contextPrivate)
psp->fullscreen = NULL;
}
}
- __driGarbageCollectDrawables(pcp->driScreenPriv->drawHash);
(*pcp->driScreenPriv->DriverAPI.DestroyContext)(pcp);
+ __driGarbageCollectDrawables(pcp->driScreenPriv->drawHash);
(void)XF86DRIDestroyContext(dpy, scrn, pcp->contextID);
Xfree(pcp);
}
@@ -773,7 +790,6 @@ static void *driCreateContext(Display *dpy, XVisualInfo *vis,
__DRIcontextPrivate *pcp;
__DRIcontextPrivate *pshare = (__DRIcontextPrivate *) sharedPrivate;
__DRIscreenPrivate *psp;
- __GLXvisualConfig *config;
__GLcontextModes modes;
void *shareCtx;
@@ -840,13 +856,11 @@ static void *driCreateContext(Display *dpy, XVisualInfo *vis,
/* Setup a __GLcontextModes struct corresponding to vis->visualid
* and create the rendering context.
*/
- config = __driFindGlxConfig(dpy, vis->screen, vis->visualid);
- if (!config)
+ if (!findConfigMode(dpy, vis->screen, vis->visualid, &modes))
return NULL;
- __glXFormatGLModes(&modes, config);
shareCtx = pshare ? pshare->driverPrivate : NULL;
- if (!(*psp->DriverAPI.CreateContext)(dpy, &modes, pcp, shareCtx)) {
+ if (!(*psp->DriverAPI.CreateContext)(&modes, pcp, shareCtx)) {
(void)XF86DRIDestroyContext(dpy, vis->screen, pcp->contextID);
Xfree(pcp);
return NULL;
@@ -904,7 +918,7 @@ static void driDestroyScreen(Display *dpy, int scrn, void *screenPrivate)
__DRIscreenPrivate *
__driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
- int numConfigs, __GLXvisualConfig *config,
+ int numConfigs, __GLXvisualConfig *configs,
const struct __DriverAPIRec *driverAPI)
{
int directCapable;
@@ -929,6 +943,9 @@ __driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
psp->display = dpy;
psp->myNum = scrn;
+ psp->numConfigs = numConfigs;
+ psp->configs = configs;
+
if (!XF86DRIOpenConnection(dpy, scrn, &hSAREA, &BusID)) {
Xfree(psp);
return NULL;
@@ -953,6 +970,7 @@ __driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
Xfree(BusID); /* No longer needed */
if (drmGetMagic(psp->fd, &magic)) {
+ fprintf(stderr, "libGL error: drmGetMagic failed\n");
(void)drmClose(psp->fd);
Xfree(psp);
(void)XF86DRICloseConnection(dpy, scrn);
@@ -975,6 +993,7 @@ __driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
}
if (!XF86DRIAuthConnection(dpy, scrn, magic)) {
+ fprintf(stderr, "libGL error: XF86DRIAuthConnection failed\n");
(void)drmClose(psp->fd);
Xfree(psp);
(void)XF86DRICloseConnection(dpy, scrn);
@@ -991,6 +1010,21 @@ __driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
&psp->ddxMinor,
&psp->ddxPatch,
&driverName)) {
+ fprintf(stderr, "libGL error: XF86DRIGetClientDriverName failed\n");
+ (void)drmClose(psp->fd);
+ Xfree(psp);
+ (void)XF86DRICloseConnection(dpy, scrn);
+ return NULL;
+ }
+
+ /*
+ * Get the DRI X extension version.
+ */
+ if (!XF86DRIQueryVersion(dpy,
+ &psp->driMajor,
+ &psp->driMinor,
+ &psp->driPatch)) {
+ fprintf(stderr, "libGL error: XF86DRIQueryVersion failed\n");
(void)drmClose(psp->fd);
Xfree(psp);
(void)XF86DRICloseConnection(dpy, scrn);
@@ -1013,6 +1047,7 @@ __driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
&psp->fbStride,
&psp->devPrivSize,
&psp->pDevPriv)) {
+ fprintf(stderr, "libGL error: XF86DRIGetDeviceInfo failed\n");
(void)drmClose(psp->fd);
Xfree(psp);
(void)XF86DRICloseConnection(dpy, scrn);
@@ -1026,6 +1061,7 @@ __driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
* Map the framebuffer region.
*/
if (drmMap(psp->fd, hFB, psp->fbSize, (drmAddressPtr)&psp->pFB)) {
+ fprintf(stderr, "libGL error: drmMap of framebuffer failed\n");
Xfree(psp->pDevPriv);
(void)drmClose(psp->fd);
Xfree(psp);
@@ -1038,6 +1074,7 @@ __driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
* each DRI driver's "createScreen" function.
*/
if (drmMap(psp->fd, hSAREA, SAREA_MAX, (drmAddressPtr)&psp->pSAREA)) {
+ fprintf(stderr, "libGL error: drmMap of sarea failed\n");
(void)drmUnmap((drmAddress)psp->pFB, psp->fbSize);
Xfree(psp->pDevPriv);
(void)drmClose(psp->fd);
@@ -1049,6 +1086,7 @@ __driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
/* Initialize the screen specific GLX driver */
if (psp->DriverAPI.InitDriver) {
if (!(*psp->DriverAPI.InitDriver)(psp)) {
+ fprintf(stderr, "libGL error: InitDriver failed\n");
(void)drmUnmap((drmAddress)psp->pSAREA, SAREA_MAX);
(void)drmUnmap((drmAddress)psp->pFB, psp->fbSize);
Xfree(psp->pDevPriv);
diff --git a/xc/lib/GL/dri/dri_util.h b/xc/lib/GL/dri/dri_util.h
index 624fadb5c..18f9c160f 100644
--- a/xc/lib/GL/dri/dri_util.h
+++ b/xc/lib/GL/dri/dri_util.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/dri/dri_util.h,v 1.1 2002/02/22 21:32:52 dawes Exp $ */
+/* $XFree86$ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -32,6 +32,24 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Brian Paul <brian@precisioninsight.com>
*/
+/*
+ * This module acts as glue between GLX and the actual hardware driver.
+ * A DRI driver doesn't really _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.
+ */
+
+
+
#ifndef _DRI_UTIL_H_
#define _DRI_UTIL_H_
@@ -39,11 +57,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define CAPI /* XXX this should be globally defined somewhere */
-#include <stdarg.h>
-#include "glxclient.h"
-#include "xf86dri.h"
-#include "sarea.h"
-#include "GL/internal/glcore.h"
+#include "glxclient.h" /* for GLXDrawable */
+#include "xf86dri.h" /* for XF86DRIClipRectPtr */
+#include "sarea.h" /* for XF86DRISAREAPtr */
+#include "GL/internal/glcore.h" /* for __GLcontextModes */
typedef struct __DRIdisplayPrivateRec __DRIdisplayPrivate;
@@ -52,22 +69,22 @@ typedef struct __DRIcontextPrivateRec __DRIcontextPrivate;
typedef struct __DRIdrawablePrivateRec __DRIdrawablePrivate;
-#define DRI_VALIDATE_DRAWABLE_INFO_ONCE(dpy, scrn, pDrawPriv) \
+#define DRI_VALIDATE_DRAWABLE_INFO_ONCE(pDrawPriv) \
do { \
if (*(pDrawPriv->pStamp) != pDrawPriv->lastStamp) { \
- __driUtilUpdateDrawableInfo(dpy, scrn, pDrawPriv); \
+ __driUtilUpdateDrawableInfo(pDrawPriv); \
} \
} while (0)
-#define DRI_VALIDATE_DRAWABLE_INFO(dpy, psp, pdp) \
+#define DRI_VALIDATE_DRAWABLE_INFO(psp, pdp) \
do { \
while (*(pdp->pStamp) != pdp->lastStamp) { \
DRM_UNLOCK(psp->fd, &psp->pSAREA->lock, \
pdp->driContextPriv->hHWContext); \
\
DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \
- DRI_VALIDATE_DRAWABLE_INFO_ONCE(dpy, psp->myNum, pdp); \
+ DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp); \
DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \
\
DRM_LIGHT_LOCK(psp->fd, &psp->pSAREA->lock, \
@@ -76,21 +93,25 @@ do { \
} while (0)
+/* Each DRI driver must have one of these structs with all the pointers
+ * set to appropriate functions within the driver.
+ * When glXCreateContext is called, for example, it'll call a helper
+ * function dri_util.c which in turn will jump through the CreateContext
+ * pointer in this structure.
+ */
struct __DriverAPIRec {
GLboolean (*InitDriver)(__DRIscreenPrivate *driScrnPriv);
void (*DestroyScreen)(__DRIscreenPrivate *driScrnPriv);
- GLboolean (*CreateContext)(Display *dpy,
- const __GLcontextModes *glVis,
+ GLboolean (*CreateContext)(const __GLcontextModes *glVis,
__DRIcontextPrivate *driContextPriv,
void *sharedContextPrivate);
void (*DestroyContext)(__DRIcontextPrivate *driContextPriv);
- GLboolean (*CreateBuffer)(Display *dpy,
- __DRIscreenPrivate *driScrnPriv,
+ GLboolean (*CreateBuffer)(__DRIscreenPrivate *driScrnPriv,
__DRIdrawablePrivate *driDrawPriv,
const __GLcontextModes *glVis,
GLboolean pixmapBuffer);
void (*DestroyBuffer)(__DRIdrawablePrivate *driDrawPriv);
- void (*SwapBuffers)(Display *dpy, void *drawablePrivate);
+ void (*SwapBuffers)(__DRIdrawablePrivate *driDrawPriv);
GLboolean (*MakeCurrent)(__DRIcontextPrivate *driContextPriv,
__DRIdrawablePrivate *driDrawPriv,
__DRIdrawablePrivate *driReadPriv);
@@ -170,6 +191,18 @@ struct __DRIdrawablePrivateRec {
** Pointer to screen on which this drawable was created.
*/
__DRIscreenPrivate *driScreenPriv;
+
+ /*
+ ** Basically just need these for when the locking code needs to call
+ ** __driUtilUpdateDrawableInfo() which calls XF86DRIGetDrawableInfo().
+ */
+ Display *display;
+ int screen;
+
+ /*
+ ** Called via glXSwapBuffers().
+ */
+ void (*swapBuffers)( __DRIdrawablePrivate *dPriv );
};
struct __DRIcontextPrivateRec {
@@ -228,7 +261,14 @@ struct __DRIscreenPrivateRec {
int ddxPatch;
/*
- ** DRM version information.
+ ** DRI X extension version information.
+ */
+ int driMajor;
+ int driMinor;
+ int driPatch;
+
+ /*
+ ** DRM (kernel module) version information.
*/
int drmMajor;
int drmMinor;
@@ -300,6 +340,12 @@ struct __DRIscreenPrivateRec {
/* If we're in full screen mode (via DRIOpenFullScreen), this points
to the drawable that was bound. Otherwise, this is NULL. */
__DRIdrawablePrivate *fullscreen;
+
+ /*
+ ** Number of visuals (configs) for this screen, and a pointer to them.
+ */
+ int numConfigs;
+ __GLXvisualConfig *configs;
};
@@ -309,8 +355,8 @@ __driUtilMessage(const char *f, ...);
extern void
-__driUtilUpdateDrawableInfo(Display *dpy, int scrn,
- __DRIdrawablePrivate *pdp);
+__driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp);
+
extern __DRIscreenPrivate *
__driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
diff --git a/xc/lib/GL/dri/drm/Imakefile b/xc/lib/GL/dri/drm/Imakefile
index 4cddab977..e878b2502 100644
--- a/xc/lib/GL/dri/drm/Imakefile
+++ b/xc/lib/GL/dri/drm/Imakefile
@@ -31,7 +31,8 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
OS_SUBDIR = linux
OS_SUBDIR2 = linux
#endif
-#if defined(FreeBSDArchitecture) || defined(BSDOSArchitecture) || defined(NetBSDArchitecture)
+#if defined(FreeBSDArchitecture) || defined(BSDOSArchitecture) || \
+ defined(NetBSDArchitecture)
OS_SUBDIR = bsd
OS_SUBDIR2 = linux
#endif
diff --git a/xc/lib/GL/glx/compsize.c b/xc/lib/GL/glx/compsize.c
index f6840ed62..7476a3d7f 100644
--- a/xc/lib/GL/glx/compsize.c
+++ b/xc/lib/GL/glx/compsize.c
@@ -205,6 +205,10 @@ GLint __glTexParameterfv_size(GLenum e)
case GL_TEXTURE_BASE_LEVEL:
case GL_TEXTURE_MAX_LEVEL:
return 1;
+ case GL_TEXTURE_COMPARE_MODE_ARB: /* GL_ARB_shadow */
+ case GL_TEXTURE_COMPARE_FUNC_ARB: /* GL_ARB_shadow */
+ case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: /* GL_ARB_shadow_ambient */
+ return 1;
default:
return 0;
}
@@ -267,6 +271,7 @@ GLint __glTexImage1D_size(GLenum format, GLenum type, GLsizei w)
case GL_ALPHA:
case GL_LUMINANCE:
case GL_INTENSITY:
+ case GL_DEPTH_COMPONENT:
elements = 1;
break;
case GL_LUMINANCE_ALPHA:
@@ -347,6 +352,7 @@ GLint __glTexImage2D_size(GLenum format, GLenum type, GLsizei w, GLsizei h)
case GL_ALPHA:
case GL_LUMINANCE:
case GL_INTENSITY:
+ case GL_DEPTH_COMPONENT:
elements = 1;
break;
case GL_LUMINANCE_ALPHA:
@@ -596,3 +602,18 @@ GLint __glConvolutionParameteriv_size(GLenum pname)
{
return __glConvolutionParameterfv_size(pname);
}
+
+GLint __glPointParameterfvARB_size(GLenum e)
+{
+ switch (e) {
+ case GL_POINT_DISTANCE_ATTENUATION_ARB:
+ return 3;
+ case GL_POINT_SIZE_MIN_ARB:
+ case GL_POINT_SIZE_MAX_ARB:
+ case GL_POINT_FADE_THRESHOLD_SIZE_ARB:
+ return 1;
+ default:
+ return -1;
+ }
+}
+
diff --git a/xc/lib/GL/glx/g_render.c b/xc/lib/GL/glx/g_render.c
index 68ba03728..479393fec 100644
--- a/xc/lib/GL/glx/g_render.c
+++ b/xc/lib/GL/glx/g_render.c
@@ -29,6 +29,7 @@
*/
#include "packrender.h"
+#include "size.h"
void glCallList(GLuint list)
{
@@ -3460,3 +3461,134 @@ void glMultTransposeMatrixdARB(const GLdouble *m)
__GLX_END(132);
}
+
+/*
+ * New extension functions
+ */
+
+void glPointParameterfARB(GLenum pname, GLfloat param)
+{
+ __GLX_DECLARE_VARIABLES();
+ __GLX_LOAD_VARIABLES();
+ __GLX_BEGIN(X_GLrop_PointParameterfARB,12);
+ __GLX_PUT_LONG(4,pname);
+ __GLX_PUT_FLOAT(8,param);
+ __GLX_END(12);
+}
+
+void glPointParameterfvARB(GLenum pname, const GLfloat *params)
+{
+ __GLX_DECLARE_VARIABLES();
+ __GLX_LOAD_VARIABLES();
+ if (pname == GL_POINT_DISTANCE_ATTENUATION_ARB) {
+ /* params is float[3] */
+ __GLX_BEGIN(X_GLrop_PointParameterfvARB,20);
+ __GLX_PUT_LONG(4,pname);
+ __GLX_PUT_FLOAT(8,params[0]);
+ __GLX_PUT_FLOAT(12,params[1]);
+ __GLX_PUT_FLOAT(16,params[2]);
+ __GLX_END(20);
+ }
+ else {
+ /* params is float[1] */
+ __GLX_BEGIN(X_GLrop_PointParameterfvARB,12);
+ __GLX_PUT_LONG(4,pname);
+ __GLX_PUT_FLOAT(8,params[0]);
+ __GLX_END(12);
+ }
+}
+
+void glWindowPos2dARB(GLdouble x, GLdouble y)
+{
+ glWindowPos3fARB(x, y, 0.0);
+}
+
+void glWindowPos2iARB(GLint x, GLint y)
+{
+ glWindowPos3fARB(x, y, 0.0);
+}
+
+void glWindowPos2fARB(GLfloat x, GLfloat y)
+{
+ glWindowPos3fARB(x, y, 0.0);
+}
+
+void glWindowPos2sARB(GLshort x, GLshort y)
+{
+ glWindowPos3fARB(x, y, 0.0);
+}
+
+void glWindowPos2dvARB(const GLdouble * p)
+{
+ glWindowPos3fARB(p[0], p[1], 0.0);
+}
+
+void glWindowPos2fvARB(const GLfloat * p)
+{
+ glWindowPos3fARB(p[0], p[1], 0.0);
+}
+
+void glWindowPos2ivARB(const GLint * p)
+{
+ glWindowPos3fARB(p[0], p[1], 0.0);
+}
+
+void glWindowPos2svARB(const GLshort * p)
+{
+ glWindowPos3fARB(p[0], p[1], 0.0);
+}
+
+void glWindowPos3dARB(GLdouble x, GLdouble y, GLdouble z)
+{
+ glWindowPos3fARB(x, y, z);
+}
+
+void glWindowPos3fARB(GLfloat x, GLfloat y, GLfloat z)
+{
+ __GLX_DECLARE_VARIABLES();
+ __GLX_LOAD_VARIABLES();
+ __GLX_BEGIN(X_GLrop_WindowPos3fARB,16);
+ __GLX_PUT_FLOAT(4,x);
+ __GLX_PUT_FLOAT(8,y);
+ __GLX_PUT_FLOAT(12,z);
+ __GLX_END(16);
+}
+
+void glWindowPos3iARB(GLint x, GLint y, GLint z)
+{
+ glWindowPos3fARB(x, y, z);
+}
+
+void glWindowPos3sARB(GLshort x, GLshort y, GLshort z)
+{
+ glWindowPos3fARB(x, y, z);
+}
+
+void glWindowPos3dvARB(const GLdouble * p)
+{
+ glWindowPos3fARB(p[0], p[1], p[2]);
+}
+
+void glWindowPos3fvARB(const GLfloat * p)
+{
+ glWindowPos3fARB(p[0], p[1], p[2]);
+}
+
+void glWindowPos3ivARB(const GLint * p)
+{
+ glWindowPos3fARB(p[0], p[1], p[2]);
+}
+
+void glWindowPos3svARB(const GLshort * p)
+{
+ glWindowPos3fARB(p[0], p[1], p[2]);
+}
+
+void glActiveStencilFaceEXT(GLenum face)
+{
+ __GLX_DECLARE_VARIABLES();
+ __GLX_LOAD_VARIABLES();
+ __GLX_BEGIN(X_GLrop_ActiveStencilFaceEXT,8);
+ __GLX_PUT_LONG(4,face);
+ __GLX_END(8);
+}
diff --git a/xc/lib/GL/glx/glxclient.h b/xc/lib/GL/glx/glxclient.h
index ee19a19e4..41be50f7b 100644
--- a/xc/lib/GL/glx/glxclient.h
+++ b/xc/lib/GL/glx/glxclient.h
@@ -87,6 +87,7 @@ typedef struct __DRIdisplayRec __DRIdisplay;
typedef struct __DRIscreenRec __DRIscreen;
typedef struct __DRIcontextRec __DRIcontext;
typedef struct __DRIdrawableRec __DRIdrawable;
+typedef struct __DRIdriverRec __DRIdriver;
extern __DRIscreen *__glXFindDRIScreen(Display *dpy, int scrn);
@@ -216,12 +217,31 @@ struct __DRIdrawableRec {
void *private;
};
+
+typedef void *(*CreateScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc,
+ int numConfigs, __GLXvisualConfig *config);
+
+typedef void *(*RegisterExtensionsFunc)(void);
+
+/*
+** We keep a linked list of these structures, one per DRI device driver.
+*/
+struct __DRIdriverRec {
+ const char *name;
+ void *handle;
+ CreateScreenFunc createScreenFunc;
+ RegisterExtensionsFunc registerExtensionsFunc;
+ struct __DRIdriverRec *next;
+};
+
/*
** Function to create and DRI display data and initialize the display
** dependent methods.
*/
extern void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp);
+extern __DRIdriver *driGetDriver(Display *dpy, int scrNum);
+
extern void DRI_glXUseXFont( Font font, int first, int count, int listbase );
#endif
@@ -404,7 +424,6 @@ struct __GLXcontextRec {
** context is not current to any drawable.
*/
GLXDrawable currentDrawable;
- GLXDrawable currentReadable;
/*
** Constant strings that describe the server implementation
@@ -548,6 +567,10 @@ extern __GLXdisplayPrivate *__glXInitialize(Display*);
/* Query drivers for dynamically registered extensions */
extern void __glXRegisterExtensions(void);
+/* Functions for extending the GLX API: */
+extern void *__glXRegisterGLXFunction(const char *funcName, void *funcAddr);
+extern void __glXRegisterGLXExtensionString(const char *extName);
+
/************************************************************************/
@@ -631,48 +654,6 @@ extern void __glXInitVertexArrayState(__GLXcontext*);
*/
extern void __glXClientInfo ( Display *dpy, int opcode );
-/*
-** Size routines. These determine how much data needs to be transfered
-** based on the clients arguments. If an enumerant or other value
-** is illegal these procedures return 0.
-*/
-extern GLint __glCallLists_size(GLint, GLenum);
-extern GLint __glColorTableParameterfv_size(GLenum);
-extern GLint __glColorTableParameteriv_size(GLenum);
-extern GLint __glConvolutionParameterfv_size(GLenum);
-extern GLint __glConvolutionParameteriv_size(GLenum);
-extern GLint __glDrawPixels_size(GLenum, GLenum, GLint, GLint);
-extern GLint __glReadPixels_size(GLenum, GLenum, GLint, GLint);
-extern GLint __glLightModelfv_size(GLenum);
-extern GLint __glLightModeliv_size(GLenum);
-extern GLint __glLightfv_size(GLenum);
-extern GLint __glLightiv_size(GLenum);
-extern GLint __glMaterialfv_size(GLenum);
-extern GLint __glMaterialiv_size(GLenum);
-extern GLint __glFogfv_size(GLenum);
-extern GLint __glFogiv_size(GLenum);
-extern GLint __glTexImage1D_size(GLenum, GLenum, GLint);
-extern GLint __glTexImage2D_size(GLenum, GLenum, GLint, GLint);
-extern GLint __glTexImage3D_size(GLenum, GLenum, GLint, GLint, GLint);
-extern GLint __glTexEnvfv_size(GLenum);
-extern GLint __glTexEnviv_size(GLenum);
-extern GLint __glTexGenfv_size(GLenum);
-extern GLint __glTexGendv_size(GLenum);
-extern GLint __glTexGeniv_size(GLenum);
-extern GLint __glTexParameterfv_size(GLenum);
-extern GLint __glTexParameteriv_size(GLenum);
-extern GLint __glGetMaterialfv_size(GLenum);
-extern GLint __glGetMaterialiv_size(GLenum);
-extern GLint __glGetLightfv_size(GLenum);
-extern GLint __glGetLightiv_size(GLenum);
-extern GLint __glGetTexParameterfv_size(GLenum);
-extern GLint __glGetTexParameteriv_size(GLenum);
-extern GLint __glGetTexEnvfv_size(GLenum);
-extern GLint __glGetTexEnviv_size(GLenum);
-extern GLint __glGetTexGenfv_size(GLenum);
-extern GLint __glGetTexGendv_size(GLenum);
-extern GLint __glGetTexGeniv_size(GLenum);
-
/************************************************************************/
/*
@@ -697,4 +678,10 @@ extern void _XSend(Display*, const void*, long);
#endif
+extern char *__glXstrdup(const char *str);
+
+extern int __glXGetInternalVersion(void);
+
+extern Bool __glXWindowExists(Display *dpy, GLXDrawable draw);
+
#endif /* !__GLX_client_h__ */
diff --git a/xc/lib/GL/glx/glxcmds.c b/xc/lib/GL/glx/glxcmds.c
index c12064234..58ad05b16 100644
--- a/xc/lib/GL/glx/glxcmds.c
+++ b/xc/lib/GL/glx/glxcmds.c
@@ -38,6 +38,7 @@
#include "glxclient.h"
#include <extutil.h>
#include <Xext.h>
+#include <assert.h>
#include <string.h>
#include "glapi.h"
#ifdef GLX_DIRECT_RENDERING
@@ -45,18 +46,26 @@
#endif
static const char __glXGLClientExtensions[] =
+ "GL_ARB_depth_texture "
"GL_ARB_imaging "
"GL_ARB_multitexture "
+ "GL_ARB_point_parameters "
+ "GL_ARB_shadow "
+ "GL_ARB_shadow_ambient "
"GL_ARB_texture_border_clamp "
"GL_ARB_texture_cube_map "
"GL_ARB_texture_env_add "
"GL_ARB_texture_env_combine "
+ "GL_ARB_texture_env_crossbar "
"GL_ARB_texture_env_dot3 "
+ "GL_ARB_texture_mirrored_repeat "
"GL_ARB_transpose_matrix "
+ "GL_ARB_window_pos "
"GL_EXT_abgr "
"GL_EXT_blend_color "
"GL_EXT_blend_minmax "
"GL_EXT_blend_subtract "
+ "GL_EXT_stencil_two_side "
"GL_EXT_texture_env_add "
"GL_EXT_texture_env_combine "
"GL_EXT_texture_env_dot3 "
@@ -65,12 +74,15 @@ static const char __glXGLClientExtensions[] =
static const char __glXGLXClientVendorName[] = "SGI";
static const char __glXGLXClientVersion[] = "1.2";
-static const char __glXGLXClientExtensions[] =
+static const char __glXGLXDefaultClientExtensions[] =
"GLX_EXT_visual_info "
"GLX_EXT_visual_rating "
"GLX_EXT_import_context "
;
+static const char *__glXGLXClientExtensions = __glXGLXDefaultClientExtensions;
+
+
/*
** Create a new context.
*/
@@ -87,6 +99,9 @@ GLXContext CreateContext(Display *dpy, XVisualInfo *vis,
__GLXdisplayPrivate *priv;
#endif
+ if (!dpy || !vis)
+ return NULL;
+
opcode = __glXSetupForCommand(dpy);
if (!opcode) {
return NULL;
@@ -1012,6 +1027,7 @@ XVisualInfo *GLX_PREFIX(glXChooseVisual)(Display *dpy, int screen, int *attribLi
else
score += AuxScore(auxBuffers, val);
if (transparentPixel) {
+ __GLX_GCONF(GLX_TRANSPARENT_TYPE_EXT);
if (transparentPixelValue != val)
continue;
if (transparentPixelValue == GLX_TRANSPARENT_TYPE_EXT) {
@@ -1210,7 +1226,7 @@ static char *combine_strings( const char *cext_string, const char *sext_string )
*/
if ( (clen = strlen( cext_string)) > (slen = strlen( sext_string)) ) {
combo_string = (char *) Xmalloc( slen + 2 );
- s1 = (char *) malloc( slen + 2 ); strcpy( s1, sext_string );
+ s1 = (char *) Xmalloc( slen + 2 ); strcpy( s1, sext_string );
s2 = cext_string;
} else {
combo_string = (char *) Xmalloc( clen + 2 );
@@ -1602,7 +1618,7 @@ void GLX_PREFIX(glXDestroyWindow)(Display *dpy, GLXWindow window)
GLXDrawable glXGetCurrentReadDrawable(void)
{
GLXContext gc = __glXGetCurrentContext();
- return gc->currentReadable;
+ return gc->currentDrawable;
}
@@ -2016,6 +2032,21 @@ Bool GLX_PREFIX(glXSet3DfxModeMESA)( int mode )
}
+
+/* strdup() is actually not a standard ANSI C or POSIX routine.
+ * Irix will not define it if ANSI mode is in effect.
+ */
+char *
+__glXstrdup(const char *str)
+{
+ char *copy;
+ copy = (char *) Xmalloc(strlen(str) + 1);
+ if (!copy)
+ return NULL;
+ strcpy(copy, str);
+ return copy;
+}
+
/*
** glXGetProcAddress support
*/
@@ -2023,142 +2054,250 @@ Bool GLX_PREFIX(glXSet3DfxModeMESA)( int mode )
struct name_address_pair {
const char *Name;
GLvoid *Address;
+ struct name_address_pair *Next;
};
static struct name_address_pair GLX_functions[] = {
/*** GLX_VERSION_1_0 ***/
- { "glXChooseVisual", (GLvoid *) glXChooseVisual },
- { "glXCopyContext", (GLvoid *) glXCopyContext },
- { "glXCreateContext", (GLvoid *) glXCreateContext },
- { "glXCreateGLXPixmap", (GLvoid *) glXCreateGLXPixmap },
- { "glXDestroyContext", (GLvoid *) glXDestroyContext },
- { "glXDestroyGLXPixmap", (GLvoid *) glXDestroyGLXPixmap },
- { "glXGetConfig", (GLvoid *) glXGetConfig },
- { "glXGetCurrentContext", (GLvoid *) glXGetCurrentContext },
- { "glXGetCurrentDrawable", (GLvoid *) glXGetCurrentDrawable },
- { "glXIsDirect", (GLvoid *) glXIsDirect },
- { "glXMakeCurrent", (GLvoid *) glXMakeCurrent },
- { "glXQueryExtension", (GLvoid *) glXQueryExtension },
- { "glXQueryVersion", (GLvoid *) glXQueryVersion },
- { "glXSwapBuffers", (GLvoid *) glXSwapBuffers },
- { "glXUseXFont", (GLvoid *) glXUseXFont },
- { "glXWaitGL", (GLvoid *) glXWaitGL },
- { "glXWaitX", (GLvoid *) glXWaitX },
+ { "glXChooseVisual", (GLvoid *) glXChooseVisual, NULL },
+ { "glXCopyContext", (GLvoid *) glXCopyContext, NULL },
+ { "glXCreateContext", (GLvoid *) glXCreateContext, NULL },
+ { "glXCreateGLXPixmap", (GLvoid *) glXCreateGLXPixmap, NULL },
+ { "glXDestroyContext", (GLvoid *) glXDestroyContext, NULL },
+ { "glXDestroyGLXPixmap", (GLvoid *) glXDestroyGLXPixmap, NULL },
+ { "glXGetConfig", (GLvoid *) glXGetConfig, NULL },
+ { "glXGetCurrentContext", (GLvoid *) glXGetCurrentContext, NULL },
+ { "glXGetCurrentDrawable", (GLvoid *) glXGetCurrentDrawable, NULL },
+ { "glXIsDirect", (GLvoid *) glXIsDirect, NULL },
+ { "glXMakeCurrent", (GLvoid *) glXMakeCurrent, NULL },
+ { "glXQueryExtension", (GLvoid *) glXQueryExtension, NULL },
+ { "glXQueryVersion", (GLvoid *) glXQueryVersion, NULL },
+ { "glXSwapBuffers", (GLvoid *) glXSwapBuffers, NULL },
+ { "glXUseXFont", (GLvoid *) glXUseXFont, NULL },
+ { "glXWaitGL", (GLvoid *) glXWaitGL, NULL },
+ { "glXWaitX", (GLvoid *) glXWaitX, NULL },
/*** GLX_VERSION_1_1 ***/
- { "glXGetClientString", (GLvoid *) glXGetClientString },
- { "glXQueryExtensionsString", (GLvoid *) glXQueryExtensionsString },
- { "glXQueryServerString", (GLvoid *) glXQueryServerString },
+ { "glXGetClientString", (GLvoid *) glXGetClientString, NULL },
+ { "glXQueryExtensionsString", (GLvoid *) glXQueryExtensionsString, NULL },
+ { "glXQueryServerString", (GLvoid *) glXQueryServerString, NULL },
/*** GLX_VERSION_1_2 ***/
- { "glXGetCurrentDisplay", (GLvoid *) glXGetCurrentDisplay },
+ { "glXGetCurrentDisplay", (GLvoid *) glXGetCurrentDisplay, NULL },
/*** GLX_VERSION_1_3 ***/
- { "glXChooseFBConfig", (GLvoid *) glXChooseFBConfig },
- { "glXCreateNewContext", (GLvoid *) glXCreateNewContext },
- { "glXCreatePbuffer", (GLvoid *) glXCreatePbuffer },
- { "glXCreatePixmap", (GLvoid *) glXCreatePixmap },
- { "glXCreateWindow", (GLvoid *) glXCreateWindow },
- { "glXDestroyPbuffer", (GLvoid *) glXDestroyPbuffer },
- { "glXDestroyPixmap", (GLvoid *) glXDestroyPixmap },
- { "glXDestroyWindow", (GLvoid *) glXDestroyWindow },
- { "glXGetCurrentReadDrawable", (GLvoid *) glXGetCurrentReadDrawable },
- { "glXGetFBConfigAttrib", (GLvoid *) glXGetFBConfigAttrib },
- { "glXGetFBConfigs", (GLvoid *) glXGetFBConfigs },
- { "glXGetSelectedEvent", (GLvoid *) glXGetSelectedEvent },
- { "glXGetVisualFromFBConfig", (GLvoid *) glXGetVisualFromFBConfig },
- { "glXMakeContextCurrent", (GLvoid *) glXMakeContextCurrent },
- { "glXQueryContext", (GLvoid *) glXQueryContext },
- { "glXQueryDrawable", (GLvoid *) glXQueryDrawable },
- { "glXSelectEvent", (GLvoid *) glXSelectEvent },
+ { "glXChooseFBConfig", (GLvoid *) glXChooseFBConfig, NULL },
+ { "glXCreateNewContext", (GLvoid *) glXCreateNewContext, NULL },
+ { "glXCreatePbuffer", (GLvoid *) glXCreatePbuffer, NULL },
+ { "glXCreatePixmap", (GLvoid *) glXCreatePixmap, NULL },
+ { "glXCreateWindow", (GLvoid *) glXCreateWindow, NULL },
+ { "glXDestroyPbuffer", (GLvoid *) glXDestroyPbuffer, NULL },
+ { "glXDestroyPixmap", (GLvoid *) glXDestroyPixmap, NULL },
+ { "glXDestroyWindow", (GLvoid *) glXDestroyWindow, NULL },
+ { "glXGetCurrentReadDrawable", (GLvoid *) glXGetCurrentReadDrawable, NULL },
+ { "glXGetFBConfigAttrib", (GLvoid *) glXGetFBConfigAttrib, NULL },
+ { "glXGetFBConfigs", (GLvoid *) glXGetFBConfigs, NULL },
+ { "glXGetSelectedEvent", (GLvoid *) glXGetSelectedEvent, NULL },
+ { "glXGetVisualFromFBConfig", (GLvoid *) glXGetVisualFromFBConfig, NULL },
+ { "glXMakeContextCurrent", (GLvoid *) glXMakeContextCurrent, NULL },
+ { "glXQueryContext", (GLvoid *) glXQueryContext, NULL },
+ { "glXQueryDrawable", (GLvoid *) glXQueryDrawable, NULL },
+ { "glXSelectEvent", (GLvoid *) glXSelectEvent, NULL },
/*** GLX_SGI_swap_control ***/
- { "glXSwapIntervalSGI", (GLvoid *) glXSwapIntervalSGI },
+ { "glXSwapIntervalSGI", (GLvoid *) glXSwapIntervalSGI, NULL },
/*** GLX_SGI_video_sync ***/
- { "glXGetVideoSyncSGI", (GLvoid *) glXGetVideoSyncSGI },
- { "glXWaitVideoSyncSGI", (GLvoid *) glXWaitVideoSyncSGI },
+ { "glXGetVideoSyncSGI", (GLvoid *) glXGetVideoSyncSGI, NULL },
+ { "glXWaitVideoSyncSGI", (GLvoid *) glXWaitVideoSyncSGI, NULL },
/*** GLX_SGI_make_current_read ***/
- { "glXMakeCurrentReadSGI", (GLvoid *) glXMakeCurrentReadSGI },
- { "glXGetCurrentReadDrawableSGI", (GLvoid *) glXGetCurrentReadDrawableSGI },
+ { "glXMakeCurrentReadSGI", (GLvoid *) glXMakeCurrentReadSGI, NULL },
+ { "glXGetCurrentReadDrawableSGI", (GLvoid *) glXGetCurrentReadDrawableSGI, NULL },
/*** GLX_SGIX_video_source ***/
#if defined(_VL_H)
- { "glXCreateGLXVideoSourceSGIX", (GLvoid *) glXCreateGLXVideoSourceSGIX },
- { "glXDestroyGLXVideoSourceSGIX", (GLvoid *) glXDestroyGLXVideoSourceSGIX },
+ { "glXCreateGLXVideoSourceSGIX", (GLvoid *) glXCreateGLXVideoSourceSGIX, NULL },
+ { "glXDestroyGLXVideoSourceSGIX", (GLvoid *) glXDestroyGLXVideoSourceSGIX, NULL },
#endif
/*** GLX_EXT_import_context ***/
- { "glXFreeContextEXT", (GLvoid *) glXFreeContextEXT },
- { "glXGetContextIDEXT", (GLvoid *) glXGetContextIDEXT },
- { "glXGetCurrentDisplayEXT", (GLvoid *) glXGetCurrentDisplayEXT },
- { "glXImportContextEXT", (GLvoid *) glXImportContextEXT },
- { "glXQueryContextInfoEXT", (GLvoid *) glXQueryContextInfoEXT },
+ { "glXFreeContextEXT", (GLvoid *) glXFreeContextEXT, NULL },
+ { "glXGetContextIDEXT", (GLvoid *) glXGetContextIDEXT, NULL },
+ { "glXGetCurrentDisplayEXT", (GLvoid *) glXGetCurrentDisplayEXT, NULL },
+ { "glXImportContextEXT", (GLvoid *) glXImportContextEXT, NULL },
+ { "glXQueryContextInfoEXT", (GLvoid *) glXQueryContextInfoEXT, NULL },
/*** GLX_SGIX_fbconfig ***/
- { "glXGetFBConfigAttribSGIX", (GLvoid *) glXGetFBConfigAttribSGIX },
- { "glXChooseFBConfigSGIX", (GLvoid *) glXChooseFBConfigSGIX },
- { "glXCreateGLXPixmapWithConfigSGIX", (GLvoid *) glXCreateGLXPixmapWithConfigSGIX },
- { "glXCreateContextWithConfigSGIX", (GLvoid *) glXCreateContextWithConfigSGIX },
- { "glXGetVisualFromFBConfigSGIX", (GLvoid *) glXGetVisualFromFBConfigSGIX },
- { "glXGetFBConfigFromVisualSGIX", (GLvoid *) glXGetFBConfigFromVisualSGIX },
+ { "glXGetFBConfigAttribSGIX", (GLvoid *) glXGetFBConfigAttribSGIX, NULL },
+ { "glXChooseFBConfigSGIX", (GLvoid *) glXChooseFBConfigSGIX, NULL },
+ { "glXCreateGLXPixmapWithConfigSGIX", (GLvoid *) glXCreateGLXPixmapWithConfigSGIX, NULL },
+ { "glXCreateContextWithConfigSGIX", (GLvoid *) glXCreateContextWithConfigSGIX, NULL },
+ { "glXGetVisualFromFBConfigSGIX", (GLvoid *) glXGetVisualFromFBConfigSGIX, NULL },
+ { "glXGetFBConfigFromVisualSGIX", (GLvoid *) glXGetFBConfigFromVisualSGIX, NULL },
/*** GLX_SGIX_pbuffer ***/
- { "glXCreateGLXPbufferSGIX", (GLvoid *) glXCreateGLXPbufferSGIX },
- { "glXDestroyGLXPbufferSGIX", (GLvoid *) glXDestroyGLXPbufferSGIX },
- { "glXQueryGLXPbufferSGIX", (GLvoid *) glXQueryGLXPbufferSGIX },
- { "glXSelectEventSGIX", (GLvoid *) glXSelectEventSGIX },
- { "glXGetSelectedEventSGIX", (GLvoid *) glXGetSelectedEventSGIX },
+ { "glXCreateGLXPbufferSGIX", (GLvoid *) glXCreateGLXPbufferSGIX, NULL },
+ { "glXDestroyGLXPbufferSGIX", (GLvoid *) glXDestroyGLXPbufferSGIX, NULL },
+ { "glXQueryGLXPbufferSGIX", (GLvoid *) glXQueryGLXPbufferSGIX, NULL },
+ { "glXSelectEventSGIX", (GLvoid *) glXSelectEventSGIX, NULL },
+ { "glXGetSelectedEventSGIX", (GLvoid *) glXGetSelectedEventSGIX, NULL },
/*** GLX_SGI_cushion ***/
- { "glXCushionSGI", (GLvoid *) glXCushionSGI },
+ { "glXCushionSGI", (GLvoid *) glXCushionSGI, NULL },
/*** GLX_SGIX_video_resize ***/
- { "glXBindChannelToWindowSGIX", (GLvoid *) glXBindChannelToWindowSGIX },
- { "glXChannelRectSGIX", (GLvoid *) glXChannelRectSGIX },
- { "glXQueryChannelRectSGIX", (GLvoid *) glXQueryChannelRectSGIX },
- { "glXQueryChannelDeltasSGIX", (GLvoid *) glXQueryChannelDeltasSGIX },
- { "glXChannelRectSyncSGIX", (GLvoid *) glXChannelRectSyncSGIX },
+ { "glXBindChannelToWindowSGIX", (GLvoid *) glXBindChannelToWindowSGIX, NULL },
+ { "glXChannelRectSGIX", (GLvoid *) glXChannelRectSGIX, NULL },
+ { "glXQueryChannelRectSGIX", (GLvoid *) glXQueryChannelRectSGIX, NULL },
+ { "glXQueryChannelDeltasSGIX", (GLvoid *) glXQueryChannelDeltasSGIX, NULL },
+ { "glXChannelRectSyncSGIX", (GLvoid *) glXChannelRectSyncSGIX, NULL },
/*** GLX_SGIX_dmbuffer **/
#if defined(_DM_BUFFER_H_)
- { "glXAssociateDMPbufferSGIX", (GLvoid *) glXAssociateDMPbufferSGIX },
+ { "glXAssociateDMPbufferSGIX", (GLvoid *) glXAssociateDMPbufferSGIX, NULL },
#endif
/*** GLX_SGIX_swap_group ***/
- { "glXJoinSwapGroupSGIX", (GLvoid *) glXJoinSwapGroupSGIX },
+ { "glXJoinSwapGroupSGIX", (GLvoid *) glXJoinSwapGroupSGIX, NULL },
/*** GLX_SGIX_swap_barrier ***/
- { "glXBindSwapBarrierSGIX", (GLvoid *) glXBindSwapBarrierSGIX },
- { "glXQueryMaxSwapBarriersSGIX", (GLvoid *) glXQueryMaxSwapBarriersSGIX },
+ { "glXBindSwapBarrierSGIX", (GLvoid *) glXBindSwapBarrierSGIX, NULL },
+ { "glXQueryMaxSwapBarriersSGIX", (GLvoid *) glXQueryMaxSwapBarriersSGIX, NULL },
/*** GLX_SUN_get_transparent_index ***/
- { "glXGetTransparentIndexSUN", (GLvoid *) glXGetTransparentIndexSUN },
+ { "glXGetTransparentIndexSUN", (GLvoid *) glXGetTransparentIndexSUN, NULL },
/*** GLX_MESA_copy_sub_buffer ***/
- { "glXCopySubBufferMESA", (GLvoid *) glXCopySubBufferMESA },
+ { "glXCopySubBufferMESA", (GLvoid *) glXCopySubBufferMESA, NULL },
/*** GLX_MESA_pixmap_colormap ***/
- { "glXCreateGLXPixmapMESA", (GLvoid *) glXCreateGLXPixmapMESA },
+ { "glXCreateGLXPixmapMESA", (GLvoid *) glXCreateGLXPixmapMESA, NULL },
/*** GLX_MESA_release_buffers ***/
- { "glXReleaseBuffersMESA", (GLvoid *) glXReleaseBuffersMESA },
+ { "glXReleaseBuffersMESA", (GLvoid *) glXReleaseBuffersMESA, NULL },
/*** GLX_MESA_set_3dfx_mode ***/
- { "glXSet3DfxModeMESA", (GLvoid *) glXSet3DfxModeMESA },
+ { "glXSet3DfxModeMESA", (GLvoid *) glXSet3DfxModeMESA, NULL },
/*** GLX_ARB_get_proc_address ***/
- { "glXGetProcAddressARB", (GLvoid *) glXGetProcAddressARB },
-
- { NULL, NULL } /* end of list */
+ { "glXGetProcAddressARB", (GLvoid *) glXGetProcAddressARB, NULL },
+
+ /*** GLX 1.4 ***/
+ { "glXGetProcAddress", (GLvoid *) glXGetProcAddress, NULL },
+
+ /*** GLX_???_allocate_memory ***/
+ { "glXAllocateMemoryNV", (GLvoid *) glXAllocateMemoryNV, NULL },
+ { "glXFreeMemoryNV", (GLvoid *) glXFreeMemoryNV, NULL },
+
+ /*** GLX_MESA_agp_pointer ***/
+ { "glXGetAGPOffsetMESA", (GLvoid *) glXGetAGPOffsetMESA, NULL },
+
+ /***
+ *** Internal functions useful to DRI drivers
+ *** With this, the DRI drivers shouldn't need dlopen()/dlsym() to
+ *** access internal libGL functions which may or may not exist.
+ ***/
+ { "__glXInitialize", (GLvoid *) __glXInitialize, NULL },
+ { "__glXFindDRIScreen", (GLvoid *) __glXFindDRIScreen, NULL },
+ { "__glXGetInternalVersion", (GLvoid *) __glXGetInternalVersion, NULL },
+ { "__glXRegisterGLXExtensionString", (GLvoid *) __glXRegisterGLXExtensionString, NULL },
+ { "__glXRegisterGLXFunction", (GLvoid *) __glXRegisterGLXFunction, NULL },
+ { "__glXWindowExists", (GLvoid *) __glXWindowExists, NULL },
+
+ { NULL, NULL, NULL } /* end of list */
};
+static struct name_address_pair *Dynamic_GLX_functions = NULL;
+
+
+/*
+ * Drivers can call this function to append the name of a new GLX
+ * extension string to __glXGLXClientExtensions. Then, when the user
+ * calls glXGetClientString() they'll see it listed.
+ * This is a companion to __glXRegisterGLXFunction().
+ */
+void
+__glXRegisterGLXExtensionString(const char *extName)
+{
+ char *newList;
+ if (!extName)
+ return;
+ newList = Xmalloc(strlen(__glXGLXClientExtensions) +
+ strlen(extName) + 2); /* 2 for ' ' and '\0' */
+ if (!newList)
+ return;
+ strcpy(newList, __glXGLXClientExtensions);
+ strcat(newList, " ");
+ strcat(newList, extName);
+ if (__glXGLXClientExtensions != __glXGLXDefaultClientExtensions)
+ Xfree((void *) __glXGLXClientExtensions);
+ __glXGLXClientExtensions = newList;
+}
+
+
+/*
+ * DRI drivers should call this function if they want to extend
+ * the GLX API. After registering a new GLX function, the user
+ * can query and use it by calling glXGetProcAddress().
+ * Input: funcName - name of new GLX function
+ * funcAddr - pointer to the function.
+ * Return: address of previously registered function with this
+ * name, or NULL.
+ */
+void *
+__glXRegisterGLXFunction(const char *funcName, void *funcAddr)
+{
+ struct name_address_pair *ext;
+
+ assert(funcName);
+ assert(funcName[0] == 'g');
+ assert(funcName[1] == 'l');
+ assert(funcName[2] == 'X');
+
+ /* look if the function is already registered */
+ for (ext = Dynamic_GLX_functions; ext; ext = ext->Next) {
+ if (strcmp(ext->Name, funcName) == 0) {
+ /* It's up the caller to use this return value if he wants
+ * to chain-call or wrap the previously registered function.
+ */
+ void *prevAddr = ext->Address;
+ ext->Address = funcAddr;
+ return prevAddr;
+ }
+ }
+
+ /* add new function */
+ ext = Xmalloc(sizeof(struct name_address_pair));
+ if (!ext)
+ return NULL;
+ ext->Name = __glXstrdup(funcName);
+ if (!ext->Name) {
+ Xfree(ext);
+ return NULL;
+ }
+ ext->Address = funcAddr;
+ ext->Next = Dynamic_GLX_functions;
+ Dynamic_GLX_functions = ext;
+ return NULL;
+}
+
+
static const GLvoid *
get_glx_proc_address(const char *funcName)
{
+ const struct name_address_pair *ext;
GLuint i;
+
+ /* try dynamic functions */
+ for (ext = Dynamic_GLX_functions; ext; ext = ext->Next) {
+ if (strcmp(ext->Name, funcName) == 0) {
+ return ext->Address;
+ }
+ }
+
+ /* try static functions */
for (i = 0; GLX_functions[i].Name; i++) {
if (strcmp(GLX_functions[i].Name, funcName) == 0)
return GLX_functions[i].Address;
@@ -2168,21 +2307,161 @@ get_glx_proc_address(const char *funcName)
#ifndef GLX_BUILT_IN_XMESA
-void (*glXGetProcAddressARB(const GLubyte *procName))()
+void (*glXGetProcAddressARB(const GLubyte *procName))( void )
{
- typedef void (*gl_function)();
+ typedef void (*gl_function)( void );
gl_function f;
-#if defined(GLX_DIRECT_RENDERING)
- __glXRegisterExtensions();
-#endif
-
f = (gl_function) get_glx_proc_address((const char *) procName);
if (f) {
return f;
}
-
+#if defined(GLX_DIRECT_RENDERING)
+ else if (procName[0] == 'g' && procName[1] == 'l' && procName[2] == 'X') {
+ /* The user might be asking for a glX function that might be
+ * dynamically added by a driver. Call __glXRegisterExtensions()
+ * to try to make that happen.
+ */
+ __glXRegisterExtensions();
+ f = (gl_function) get_glx_proc_address((const char *) procName);
+ return f; /* may be NULL */
+ }
+#endif
+ /* try regular "gl*" functions */
f = (gl_function) _glapi_get_proc_address((const char *) procName);
return f;
}
+
+/* GLX 1.4 */
+void (*glXGetProcAddress(const GLubyte *procName))( void )
+{
+ return glXGetProcAddressARB(procName);
+}
#endif
+
+
+/*
+ * AGP memory allocation
+ */
+void *GLX_PREFIX(glXAllocateMemoryNV)(GLsizei size,
+ GLfloat readFrequency,
+ GLfloat writeFrequency,
+ GLfloat priority)
+{
+ /* This is special - search the list of dynamically-added functions
+ * and call the allocator if present.
+ * More typically, the user will have gotten a pointer to
+ * glXAllocateMemoryNV() via glXGetProcAddress() so we won't be
+ * doing this.
+ */
+ typedef void * (*allocFunc)(GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority);
+ const struct name_address_pair *ext;
+ static allocFunc f = (allocFunc) NULL;
+
+ if (!f) {
+ for (ext = Dynamic_GLX_functions; ext; ext = ext->Next) {
+ if (strcmp(ext->Name, "glXAllocateMemoryNV") == 0) {
+ f = (allocFunc) ext->Address;
+ break;
+ }
+ }
+ }
+ if (f)
+ return (*f)(size, readFrequency, writeFrequency, priority);
+ return NULL;
+}
+
+
+void GLX_PREFIX(glXFreeMemoryNV)(GLvoid *pointer)
+{
+ /* This is special - search the list of dynamically-added functions
+ * and call the free func if present.
+ * More typically, the user will have gotten a pointer to
+ * glXFreeMemoryNV() via glXGetProcAddress() so we won't be
+ * doing this.
+ */
+ typedef void * (*freeFunc)(GLvoid *pointer);
+ const struct name_address_pair *ext;
+ static freeFunc f = (freeFunc) NULL;
+
+ if (!f) {
+ for (ext = Dynamic_GLX_functions; ext; ext = ext->Next) {
+ if (strcmp(ext->Name, "glXFreeMemoryNV") == 0) {
+ f = (freeFunc) ext->Address;
+ break;
+ }
+ }
+ }
+ if (f)
+ (*f)(pointer);
+}
+
+
+GLuint GLX_PREFIX(glXGetAGPOffsetMESA)( const GLvoid *pointer )
+{
+ /* This is special - search the list of dynamically-added functions
+ * and call the free func if present.
+ * More typically, the user will have gotten a pointer to
+ * glXGetAGPOffsetMESA() via glXGetProcAddress() so we won't be
+ * doing this.
+ */
+ typedef GLuint (*getAGPOffsetFunc)(const GLvoid *pointer);
+ const struct name_address_pair *ext;
+ static getAGPOffsetFunc f = (getAGPOffsetFunc) NULL;
+
+ if (!f) {
+ for (ext = Dynamic_GLX_functions; ext; ext = ext->Next) {
+ if (strcmp(ext->Name, "glXGetAGPOffsetMESA") == 0) {
+ f = (getAGPOffsetFunc) ext->Address;
+ break;
+ }
+ }
+ }
+ if (f)
+ return (*f)(pointer);
+ else
+ return ~0;
+}
+
+
+
+/*
+ * Return our version number (YYYYMMDD format). This might be used by
+ * the DRI drivers to determine how new libGL is at runtime.
+ */
+int __glXGetInternalVersion(void)
+{
+ /* History:
+ * 20021121 - Initial version
+ * 20021128 - Added __glXWindowExists() function
+ */
+ return 20021128;
+}
+
+
+
+static Bool windowExistsFlag;
+
+static int windowExistsErrorHandler(Display *dpy, XErrorEvent *xerr)
+{
+ if (xerr->error_code == BadWindow) {
+ windowExistsFlag = GL_FALSE;
+ }
+ return 0;
+}
+
+/*
+ * Utility function useful to DRI drivers.
+ */
+Bool __glXWindowExists(Display *dpy, GLXDrawable draw)
+{
+ XWindowAttributes xwa;
+ int (*oldXErrorHandler)(Display *, XErrorEvent *);
+
+ XSync(dpy, GL_FALSE);
+ windowExistsFlag = GL_TRUE;
+ oldXErrorHandler = XSetErrorHandler(windowExistsErrorHandler);
+ XGetWindowAttributes(dpy, draw, &xwa); /* dummy request */
+ XSetErrorHandler(oldXErrorHandler);
+ return windowExistsFlag;
+}
diff --git a/xc/lib/GL/glx/glxext.c b/xc/lib/GL/glx/glxext.c
index 110ee0c48..89f95c676 100644
--- a/xc/lib/GL/glx/glxext.c
+++ b/xc/lib/GL/glx/glxext.c
@@ -450,6 +450,11 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv)
if (priv->driDisplay.private &&
priv->driDisplay.createScreen &&
priv->driDisplay.createScreen[i]) {
+ /* register glx extensions */
+ __DRIdriver *driver = driGetDriver(dpy, i);
+ if (driver && driver->registerExtensionsFunc)
+ (*driver->registerExtensionsFunc)();
+ /* screen initialization (bootstrap the driver) */
psc->driScreen.private =
(*(priv->driDisplay.createScreen[i]))(dpy, i, &psc->driScreen,
psc->numConfigs,
@@ -868,7 +873,7 @@ Bool GLX_PREFIX(glXMakeCurrent)(Display *dpy, GLXDrawable draw, GLXContext gc)
if (!bindReturnValue) {
/* The make current failed. */
- if (!gc->isDirect) {
+ if (gc && !gc->isDirect) {
SyncHandle();
}
diff --git a/xc/lib/GL/glx/indirect.h b/xc/lib/GL/glx/indirect.h
index f2a818196..676f08ace 100644
--- a/xc/lib/GL/glx/indirect.h
+++ b/xc/lib/GL/glx/indirect.h
@@ -381,7 +381,7 @@ void __indirect_glTexGeni(GLenum coord, GLenum pname, GLint param);
void __indirect_glTexGeniv(GLenum coord, GLenum pname, const GLint *params);
void __indirect_glTexImage1D(GLenum target, GLint level, GLint components, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *image);
void __indirect_glTexImage2D(GLenum target, GLint level, GLint components, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *image);
-void __indirect_glTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *image);
+void __indirect_glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *image);
void __indirect_glTexParameterf(GLenum target, GLenum pname, GLfloat param);
void __indirect_glTexParameterfv(GLenum target, GLenum pname, const GLfloat *params);
void __indirect_glTexParameteri(GLenum target, GLenum pname, GLint param);
@@ -460,4 +460,26 @@ void __indirect_glMultTransposeMatrixfARB(const GLfloat *m);
void __indirect_glLoadTransposeMatrixdARB(const GLdouble *m);
void __indirect_glMultTransposeMatrixdARB(const GLdouble *m);
+void __indirect_glPointParameterfARB(GLenum pname, GLfloat param);
+void __indirect_glPointParameterfvARB(GLenum pname, const GLfloat *params);
+void __indirect_glActiveStencilFaceEXT(GLenum mode);
+
+void __indirect_glWindowPos2dARB(GLdouble x, GLdouble y);
+void __indirect_glWindowPos2iARB(GLint x, GLint y);
+void __indirect_glWindowPos2fARB(GLfloat x, GLfloat y);
+void __indirect_glWindowPos2iARB(GLint x, GLint y);
+void __indirect_glWindowPos2sARB(GLshort x, GLshort y);
+void __indirect_glWindowPos2dvARB(const GLdouble * p);
+void __indirect_glWindowPos2fvARB(const GLfloat * p);
+void __indirect_glWindowPos2ivARB(const GLint * p);
+void __indirect_glWindowPos2svARB(const GLshort * p);
+void __indirect_glWindowPos3dARB(GLdouble x, GLdouble y, GLdouble z);
+void __indirect_glWindowPos3fARB(GLfloat x, GLfloat y, GLfloat z);
+void __indirect_glWindowPos3iARB(GLint x, GLint y, GLint z);
+void __indirect_glWindowPos3sARB(GLshort x, GLshort y, GLshort z);
+void __indirect_glWindowPos3dvARB(const GLdouble * p);
+void __indirect_glWindowPos3fvARB(const GLfloat * p);
+void __indirect_glWindowPos3ivARB(const GLint * p);
+void __indirect_glWindowPos3svARB(const GLshort * p);
+
#endif /* _INDIRECT_H_ */
diff --git a/xc/lib/GL/glx/indirect_init.c b/xc/lib/GL/glx/indirect_init.c
index ea85a2033..778e8c43e 100644
--- a/xc/lib/GL/glx/indirect_init.c
+++ b/xc/lib/GL/glx/indirect_init.c
@@ -51,13 +51,6 @@ __GLapi *__glXNewIndirectAPI(void)
__GLapi *glAPI;
GLuint entries;
- /* Have to register dynamic extensions before allocating any
- * dispatch tables.
- */
-#if defined(GLX_DIRECT_RENDERING)
- __glXRegisterExtensions();
-#endif
-
entries = _glapi_get_dispatch_table_size();
glAPI = (__GLapi *) Xmalloc(entries * sizeof(void *));
@@ -493,5 +486,31 @@ __GLapi *__glXNewIndirectAPI(void)
glAPI->MultTransposeMatrixdARB = __indirect_glMultTransposeMatrixdARB;
glAPI->MultTransposeMatrixfARB = __indirect_glMultTransposeMatrixfARB;
+ /* ARB 14. GL_ARB_point_parameters */
+ glAPI->PointParameterfEXT = __indirect_glPointParameterfARB;
+ glAPI->PointParameterfvEXT = __indirect_glPointParameterfvARB;
+
+ /* ARB 15. GL_ARB_window_pos */
+ glAPI->WindowPos2dMESA = __indirect_glWindowPos2dARB;
+ glAPI->WindowPos2iMESA = __indirect_glWindowPos2iARB;
+ glAPI->WindowPos2fMESA = __indirect_glWindowPos2fARB;
+ glAPI->WindowPos2iMESA = __indirect_glWindowPos2iARB;
+ glAPI->WindowPos2sMESA = __indirect_glWindowPos2sARB;
+ glAPI->WindowPos2dvMESA = __indirect_glWindowPos2dvARB;
+ glAPI->WindowPos2fvMESA = __indirect_glWindowPos2fvARB;
+ glAPI->WindowPos2ivMESA = __indirect_glWindowPos2ivARB;
+ glAPI->WindowPos2svMESA = __indirect_glWindowPos2svARB;
+ glAPI->WindowPos3dMESA = __indirect_glWindowPos3dARB;
+ glAPI->WindowPos3fMESA = __indirect_glWindowPos3fARB;
+ glAPI->WindowPos3iMESA = __indirect_glWindowPos3iARB;
+ glAPI->WindowPos3sMESA = __indirect_glWindowPos3sARB;
+ glAPI->WindowPos3dvMESA = __indirect_glWindowPos3dvARB;
+ glAPI->WindowPos3fvMESA = __indirect_glWindowPos3fvARB;
+ glAPI->WindowPos3ivMESA = __indirect_glWindowPos3ivARB;
+ glAPI->WindowPos3svMESA = __indirect_glWindowPos3svARB;
+
+ /* 268. GL_EXT_stencil_two_side */
+ glAPI->ActiveStencilFaceEXT = __indirect_glActiveStencilFaceEXT;
+
return glAPI;
}
diff --git a/xc/lib/GL/glx/indirect_wrap.h b/xc/lib/GL/glx/indirect_wrap.h
index 047576157..c29f640a0 100644
--- a/xc/lib/GL/glx/indirect_wrap.h
+++ b/xc/lib/GL/glx/indirect_wrap.h
@@ -633,4 +633,28 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define glMultTransposeMatrixdARB __indirect_glMultTransposeMatrixdARB
#define glMultTransposeMatrixfARB __indirect_glMultTransposeMatrixfARB
+#define glPointParameterfARB __indirect_glPointParameterfARB
+#define glPointParameterfvARB __indirect_glPointParameterfvARB
+
+#define glActiveStencilFaceEXT __indirect_glActiveStencilFaceEXT
+
+#define glWindowPos2dARB __indirect_glWindowPos2dARB
+#define glWindowPos2iARB __indirect_glWindowPos2iARB
+#define glWindowPos2fARB __indirect_glWindowPos2fARB
+#define glWindowPos2iARB __indirect_glWindowPos2iARB
+#define glWindowPos2sARB __indirect_glWindowPos2sARB
+#define glWindowPos2dvARB __indirect_glWindowPos2dvARB
+#define glWindowPos2fvARB __indirect_glWindowPos2fvARB
+#define glWindowPos2ivARB __indirect_glWindowPos2ivARB
+#define glWindowPos2svARB __indirect_glWindowPos2svARB
+#define glWindowPos3dARB __indirect_glWindowPos3dARB
+#define glWindowPos3fARB __indirect_glWindowPos3fARB
+#define glWindowPos3iARB __indirect_glWindowPos3iARB
+#define glWindowPos3sARB __indirect_glWindowPos3sARB
+#define glWindowPos3dvARB __indirect_glWindowPos3dvARB
+#define glWindowPos3fvARB __indirect_glWindowPos3fvARB
+#define glWindowPos3ivARB __indirect_glWindowPos3ivARB
+#define glWindowPos3svARB __indirect_glWindowPos3svARB
+
+
#endif /* _INDIRECT_WRAP_H_ */
diff --git a/xc/lib/GL/glx/render2.c b/xc/lib/GL/glx/render2.c
index d19a1de4f..0c543b182 100644
--- a/xc/lib/GL/glx/render2.c
+++ b/xc/lib/GL/glx/render2.c
@@ -35,6 +35,7 @@
*/
#include "packrender.h"
+#include "size.h"
/*
** This file contains routines that might need to be transported as
diff --git a/xc/lib/GL/glx/renderpix.c b/xc/lib/GL/glx/renderpix.c
index 453d00030..971d4767a 100644
--- a/xc/lib/GL/glx/renderpix.c
+++ b/xc/lib/GL/glx/renderpix.c
@@ -743,7 +743,7 @@ void glSeparableFilter2D(GLenum target, GLenum internalformat,
}
}
-void glTexImage3D(GLenum target, GLint level, GLenum internalformat,
+void glTexImage3D(GLenum target, GLint level, GLint internalformat,
GLsizei width, GLsizei height, GLsizei depth, GLint border,
GLenum format, GLenum type, const GLvoid *image)
{
diff --git a/xc/lib/GL/glx/size.h b/xc/lib/GL/glx/size.h
index e436c07a4..955cee6f5 100644
--- a/xc/lib/GL/glx/size.h
+++ b/xc/lib/GL/glx/size.h
@@ -66,5 +66,6 @@ extern GLint __glTexImage2D_size(GLenum format, GLenum type, GLsizei w, GLsizei
extern GLint __glTexImage3D_size(GLenum format, GLenum type, GLsizei w, GLsizei h, GLsizei d);
extern GLint __glTexParameterfv_size(GLenum e);
extern GLint __glTexParameteriv_size(GLenum e);
+extern GLint __glPointParameterfvARB_size(GLenum e);
#endif /* _size_h_ */
diff --git a/xc/lib/GL/include/GL/internal/glcore.h b/xc/lib/GL/include/GL/internal/glcore.h
index 699a4b677..ecf9aa92b 100644
--- a/xc/lib/GL/include/GL/internal/glcore.h
+++ b/xc/lib/GL/include/GL/internal/glcore.h
@@ -385,7 +385,7 @@ typedef struct __GLexportsRec {
GLboolean (*destroyContext)(__GLcontext *gc);
GLboolean (*loseCurrent)(__GLcontext *gc);
/* oldglPriv isn't used anymore, kept for backwards compatibility */
- GLboolean (*makeCurrent)(__GLcontext *gc, __GLdrawablePrivate *oldglPriv);
+ GLboolean (*makeCurrent)(__GLcontext *gc);
GLboolean (*shareContext)(__GLcontext *gc, __GLcontext *gcShare);
GLboolean (*copyContext)(__GLcontext *dst, const __GLcontext *src, GLuint mask);
GLboolean (*forceCurrent)(__GLcontext *gc);
diff --git a/xc/lib/GL/mesa/src/Imakefile.inc b/xc/lib/GL/mesa/src/Imakefile.inc
index e435bef36..cf7b978c1 100644
--- a/xc/lib/GL/mesa/src/Imakefile.inc
+++ b/xc/lib/GL/mesa/src/Imakefile.inc
@@ -31,7 +31,6 @@ COREMESABASESRCS = \
$(MESABUILDDIR)buffers.c \
$(MESABUILDDIR)clip.c \
$(MESABUILDDIR)colortab.c \
- $(MESABUILDDIR)config.c \
$(MESABUILDDIR)context.c \
$(MESABUILDDIR)convolve.c \
$(MESABUILDDIR)debug.c \
@@ -56,7 +55,6 @@ COREMESABASESRCS = \
$(MESABUILDDIR)light.c \
$(MESABUILDDIR)lines.c \
$(MESABUILDDIR)matrix.c \
- $(MESABUILDDIR)mem.c \
$(MESABUILDDIR)mmath.c \
$(MESABUILDDIR)pixel.c \
$(MESABUILDDIR)points.c \
@@ -64,6 +62,7 @@ COREMESABASESRCS = \
$(MESABUILDDIR)rastpos.c \
$(MESABUILDDIR)state.c \
$(MESABUILDDIR)stencil.c \
+ $(MESABUILDDIR)texcompress.c \
$(MESABUILDDIR)texformat.c \
$(MESABUILDDIR)teximage.c \
$(MESABUILDDIR)texobj.c \
@@ -105,11 +104,9 @@ COREMESASRCS = $(COREMESABASESRCS) \
$(MESABUILDDIR)swrast/s_lines.c \
$(MESABUILDDIR)swrast/s_logic.c \
$(MESABUILDDIR)swrast/s_masking.c \
- $(MESABUILDDIR)swrast/s_pb.c \
$(MESABUILDDIR)swrast/s_pixeltex.c \
$(MESABUILDDIR)swrast/s_points.c \
$(MESABUILDDIR)swrast/s_readpix.c \
- $(MESABUILDDIR)swrast/s_scissor.c \
$(MESABUILDDIR)swrast/s_span.c \
$(MESABUILDDIR)swrast/s_stencil.c \
$(MESABUILDDIR)swrast/s_texture.c \
@@ -153,7 +150,6 @@ LinkSourceFile(blend.c, $(MESASRCDIR)/src)
LinkSourceFile(buffers.c, $(MESASRCDIR)/src)
LinkSourceFile(clip.c, $(MESASRCDIR)/src)
LinkSourceFile(colortab.c, $(MESASRCDIR)/src)
-LinkSourceFile(config.c, $(MESASRCDIR)/src)
LinkSourceFile(context.c, $(MESASRCDIR)/src)
LinkSourceFile(convolve.c, $(MESASRCDIR)/src)
LinkSourceFile(debug.c, $(MESASRCDIR)/src)
@@ -182,7 +178,6 @@ LinkSourceFile(imports.c, $(MESASRCDIR)/src)
LinkSourceFile(light.c, $(MESASRCDIR)/src)
LinkSourceFile(lines.c, $(MESASRCDIR)/src)
LinkSourceFile(matrix.c, $(MESASRCDIR)/src)
-LinkSourceFile(mem.c, $(MESASRCDIR)/src)
LinkSourceFile(mmath.c, $(MESASRCDIR)/src)
LinkSourceFile(pixel.c, $(MESASRCDIR)/src)
LinkSourceFile(points.c, $(MESASRCDIR)/src)
@@ -190,6 +185,7 @@ LinkSourceFile(polygon.c, $(MESASRCDIR)/src)
LinkSourceFile(rastpos.c, $(MESASRCDIR)/src)
LinkSourceFile(state.c, $(MESASRCDIR)/src)
LinkSourceFile(stencil.c, $(MESASRCDIR)/src)
+LinkSourceFile(texcompress.c, $(MESASRCDIR)/src)
LinkSourceFile(texformat.c, $(MESASRCDIR)/src)
LinkSourceFile(teximage.c, $(MESASRCDIR)/src)
LinkSourceFile(texobj.c, $(MESASRCDIR)/src)
@@ -219,7 +215,6 @@ COREMESABASEOBJS = \
$(MESABUILDDIR)buffers.o \
$(MESABUILDDIR)clip.o \
$(MESABUILDDIR)colortab.o \
- $(MESABUILDDIR)config.o \
$(MESABUILDDIR)context.o \
$(MESABUILDDIR)convolve.o \
$(MESABUILDDIR)debug.o \
@@ -244,7 +239,6 @@ COREMESABASEOBJS = \
$(MESABUILDDIR)light.o \
$(MESABUILDDIR)lines.o \
$(MESABUILDDIR)matrix.o \
- $(MESABUILDDIR)mem.o \
$(MESABUILDDIR)mmath.o \
$(MESABUILDDIR)pixel.o \
$(MESABUILDDIR)points.o \
@@ -252,6 +246,7 @@ COREMESABASEOBJS = \
$(MESABUILDDIR)rastpos.o \
$(MESABUILDDIR)state.o \
$(MESABUILDDIR)stencil.o \
+ $(MESABUILDDIR)texcompress.o \
$(MESABUILDDIR)texformat.o \
$(MESABUILDDIR)teximage.o \
$(MESABUILDDIR)texobj.o \
@@ -287,7 +282,6 @@ COREMESABASEUOBJS = $(MESABUILDDIR)unshared/accum.o \
$(MESABUILDDIR)unshared/buffers.o \
$(MESABUILDDIR)unshared/clip.o \
$(MESABUILDDIR)unshared/colortab.o \
- $(MESABUILDDIR)unshared/config.o \
$(MESABUILDDIR)unshared/context.o \
$(MESABUILDDIR)unshared/convolve.o \
$(MESABUILDDIR)unshared/debug.o \
@@ -312,7 +306,6 @@ COREMESABASEUOBJS = $(MESABUILDDIR)unshared/accum.o \
$(MESABUILDDIR)unshared/light.o \
$(MESABUILDDIR)unshared/lines.o \
$(MESABUILDDIR)unshared/matrix.o \
- $(MESABUILDDIR)unshared/mem.o \
$(MESABUILDDIR)unshared/mmath.o \
$(MESABUILDDIR)unshared/pixel.o \
$(MESABUILDDIR)unshared/points.o \
@@ -320,6 +313,7 @@ COREMESABASEUOBJS = $(MESABUILDDIR)unshared/accum.o \
$(MESABUILDDIR)unshared/rastpos.o \
$(MESABUILDDIR)unshared/state.o \
$(MESABUILDDIR)unshared/stencil.o \
+ $(MESABUILDDIR)unshared/texcompress.o \
$(MESABUILDDIR)unshared/texformat.o \
$(MESABUILDDIR)unshared/teximage.o \
$(MESABUILDDIR)unshared/texobj.o \
@@ -357,7 +351,6 @@ COREMESABASEDOBJS = $(MESABUILDDIR)debugger/accum.o \
$(MESABUILDDIR)debugger/buffers.o \
$(MESABUILDDIR)debugger/clip.o \
$(MESABUILDDIR)debugger/colortab.o \
- $(MESABUILDDIR)debugger/config.o \
$(MESABUILDDIR)debugger/context.o \
$(MESABUILDDIR)debugger/convolve.o \
$(MESABUILDDIR)debugger/debug.o \
@@ -382,7 +375,6 @@ COREMESABASEDOBJS = $(MESABUILDDIR)debugger/accum.o \
$(MESABUILDDIR)debugger/light.o \
$(MESABUILDDIR)debugger/lines.o \
$(MESABUILDDIR)debugger/matrix.o \
- $(MESABUILDDIR)debugger/mem.o \
$(MESABUILDDIR)debugger/mmath.o \
$(MESABUILDDIR)debugger/pixel.o \
$(MESABUILDDIR)debugger/points.o \
@@ -390,6 +382,7 @@ COREMESABASEDOBJS = $(MESABUILDDIR)debugger/accum.o \
$(MESABUILDDIR)debugger/rastpos.o \
$(MESABUILDDIR)debugger/state.o \
$(MESABUILDDIR)debugger/stencil.o \
+ $(MESABUILDDIR)debugger/texcompress.o \
$(MESABUILDDIR)debugger/texformat.o \
$(MESABUILDDIR)debugger/teximage.o \
$(MESABUILDDIR)debugger/texobj.o \
@@ -424,7 +417,6 @@ COREMESABASEPOBJS = $(MESABUILDDIR)profiled/accum.o \
$(MESABUILDDIR)profiled/buffers.o \
$(MESABUILDDIR)profiled/clip.o \
$(MESABUILDDIR)profiled/colortab.o \
- $(MESABUILDDIR)profiled/config.o \
$(MESABUILDDIR)profiled/context.o \
$(MESABUILDDIR)profiled/convolve.o \
$(MESABUILDDIR)profiled/debug.o \
@@ -449,7 +441,6 @@ COREMESABASEPOBJS = $(MESABUILDDIR)profiled/accum.o \
$(MESABUILDDIR)profiled/light.o \
$(MESABUILDDIR)profiled/lines.o \
$(MESABUILDDIR)profiled/matrix.o \
- $(MESABUILDDIR)profiled/mem.o \
$(MESABUILDDIR)profiled/mmath.o \
$(MESABUILDDIR)profiled/pixel.o \
$(MESABUILDDIR)profiled/points.o \
@@ -457,6 +448,7 @@ COREMESABASEPOBJS = $(MESABUILDDIR)profiled/accum.o \
$(MESABUILDDIR)profiled/rastpos.o \
$(MESABUILDDIR)profiled/state.o \
$(MESABUILDDIR)profiled/stencil.o \
+ $(MESABUILDDIR)profiled/texcompress.o \
$(MESABUILDDIR)profiled/texformat.o \
$(MESABUILDDIR)profiled/teximage.o \
$(MESABUILDDIR)profiled/texobj.o \
diff --git a/xc/lib/GL/mesa/src/OSmesa/OSmesa-def.cpp b/xc/lib/GL/mesa/src/OSmesa/OSmesa-def.cpp
deleted file mode 100644
index a2ec77a4d..000000000
--- a/xc/lib/GL/mesa/src/OSmesa/OSmesa-def.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-LIBRARY libOSmesa
-VERSION LIBRARY_VERSION
-EXPORTS
- OSMesaCreateContext
- OSMesaDestroyContext
- OSMesaGetColorBuffer
- OSMesaGetCurrentContext
- OSMesaGetDepthBuffer
- OSMesaGetIntegerv
- OSMesaMakeCurrent
- OSMesaPixelStore
- _glapi_Context
- _glapi_noop_enable_warnings
- _glapi_add_entrypoint
- _glapi_get_dispatch_table_size
- _glapi_set_dispatch
- _glapi_check_multithread
- _glapi_set_context
- glTexCoordPointer
- glColorPointer
- glNormalPointer
- glVertexPointer
- glDrawElements
-
-/* $XFree86: xc/lib/GL/mesa/src/OSmesa/OSmesa-def.cpp,v 1.1 2000/08/09 23:40:12 dawes Exp $ */
diff --git a/xc/lib/GL/mesa/src/X86/Imakefile b/xc/lib/GL/mesa/src/X86/Imakefile
index 7e1f86661..1538929ab 100644
--- a/xc/lib/GL/mesa/src/X86/Imakefile
+++ b/xc/lib/GL/mesa/src/X86/Imakefile
@@ -53,7 +53,6 @@ NormalLintTarget($(SRCS))
ObjectFromAsmSource(common_x86_asm, NullParameter)
ObjectFromAsmSource(x86_cliptest, NullParameter)
-ObjectFromAsmSource(x86_vertex, NullParameter)
ObjectFromAsmSource(x86_xform2, NullParameter)
ObjectFromAsmSource(x86_xform3, NullParameter)
ObjectFromAsmSource(x86_xform4, NullParameter)
@@ -64,7 +63,6 @@ ObjectFromAsmSource(mmx_blend, NullParameter)
#if MesaUse3DNow
ObjectFromAsmSource(3dnow_normal, NullParameter)
-ObjectFromAsmSource(3dnow_vertex, NullParameter)
ObjectFromAsmSource(3dnow_xform1, NullParameter)
ObjectFromAsmSource(3dnow_xform2, NullParameter)
ObjectFromAsmSource(3dnow_xform3, NullParameter)
@@ -73,7 +71,6 @@ ObjectFromAsmSource(3dnow_xform4, NullParameter)
#if MesaUseKatmai
ObjectFromAsmSource(sse_normal, NullParameter)
-ObjectFromAsmSource(sse_vertex, NullParameter)
ObjectFromAsmSource(sse_xform1, NullParameter)
ObjectFromAsmSource(sse_xform2, NullParameter)
ObjectFromAsmSource(sse_xform3, NullParameter)
diff --git a/xc/lib/GL/mesa/src/X86/Imakefile.inc b/xc/lib/GL/mesa/src/X86/Imakefile.inc
index 143073c74..3a5ec1d23 100644
--- a/xc/lib/GL/mesa/src/X86/Imakefile.inc
+++ b/xc/lib/GL/mesa/src/X86/Imakefile.inc
@@ -11,7 +11,6 @@ MESA_X86_SRCS = $(MESAX86BUILDDIR)common_x86.c \
$(MESAX86BUILDDIR)glapi_x86.S \
$(MESAX86BUILDDIR)x86.c \
$(MESAX86BUILDDIR)x86_cliptest.S \
- $(MESAX86BUILDDIR)x86_vertex.S \
$(MESAX86BUILDDIR)x86_xform2.S \
$(MESAX86BUILDDIR)x86_xform3.S \
$(MESAX86BUILDDIR)x86_xform4.S
@@ -22,7 +21,6 @@ LinkSourceFile(common_x86_asm.S, $(MESASRCDIR)/src/X86)
LinkSourceFile(glapi_x86.S, $(MESASRCDIR)/src/X86)
LinkSourceFile(x86.c, $(MESASRCDIR)/src/X86)
LinkSourceFile(x86_cliptest.S, $(MESASRCDIR)/src/X86)
-LinkSourceFile(x86_vertex.S, $(MESASRCDIR)/src/X86)
LinkSourceFile(x86_xform2.S, $(MESASRCDIR)/src/X86)
LinkSourceFile(x86_xform3.S, $(MESASRCDIR)/src/X86)
LinkSourceFile(x86_xform4.S, $(MESASRCDIR)/src/X86)
@@ -32,7 +30,6 @@ MESA_X86_OBJS = $(MESAX86BUILDDIR)common_x86.o \
$(MESAX86BUILDDIR)common_x86_asm.o \
$(MESAX86BUILDDIR)x86.o \
$(MESAX86BUILDDIR)x86_cliptest.o \
- $(MESAX86BUILDDIR)x86_vertex.o \
$(MESAX86BUILDDIR)x86_xform2.o \
$(MESAX86BUILDDIR)x86_xform3.o \
$(MESAX86BUILDDIR)x86_xform4.o
@@ -42,7 +39,6 @@ MESA_X86_UOBJS = $(MESAX86BUILDDIR)unshared/common_x86.o \
$(MESAX86BUILDDIR)common_x86_asm.o \
$(MESAX86BUILDDIR)unshared/x86.o \
$(MESAX86BUILDDIR)x86_cliptest.o \
- $(MESAX86BUILDDIR)x86_vertex.o \
$(MESAX86BUILDDIR)x86_xform2.o \
$(MESAX86BUILDDIR)x86_xform3.o \
$(MESAX86BUILDDIR)x86_xform4.o
@@ -54,7 +50,6 @@ MESA_X86_DOBJS = $(MESAX86BUILDDIR)debugger/common_x86.o \
$(MESAX86BUILDDIR)common_x86_asm.o \
$(MESAX86BUILDDIR)debugger/x86.o \
$(MESAX86BUILDDIR)x86_cliptest.o \
- $(MESAX86BUILDDIR)x86_vertex.o \
$(MESAX86BUILDDIR)x86_xform2.o \
$(MESAX86BUILDDIR)x86_xform3.o \
$(MESAX86BUILDDIR)x86_xform4.o
@@ -63,7 +58,6 @@ MESA_X86_POBJS = $(MESAX86BUILDDIR)profiled/common_x86.o \
$(MESAX86BUILDDIR)common_x86_asm.o \
$(MESAX86BUILDDIR)profiled/x86.o \
$(MESAX86BUILDDIR)x86_cliptest.o \
- $(MESAX86BUILDDIR)x86_vertex.o \
$(MESAX86BUILDDIR)x86_xform2.o \
$(MESAX86BUILDDIR)x86_xform3.o \
$(MESAX86BUILDDIR)x86_xform4.o
@@ -90,7 +84,6 @@ MESA_MMX_DEFS = -DUSE_MMX_ASM
#if MesaUse3DNow
MESA_3DNOW_SRCS = $(MESAX86BUILDDIR)3dnow.c \
$(MESAX86BUILDDIR)3dnow_normal.S \
- $(MESAX86BUILDDIR)3dnow_vertex.S \
$(MESAX86BUILDDIR)3dnow_xform1.S \
$(MESAX86BUILDDIR)3dnow_xform2.S \
$(MESAX86BUILDDIR)3dnow_xform3.S \
@@ -99,7 +92,6 @@ MESA_3DNOW_SRCS = $(MESAX86BUILDDIR)3dnow.c \
#ifdef NeedToLinkMesaSrc
LinkSourceFile(3dnow.c, $(MESASRCDIR)/src/X86)
LinkSourceFile(3dnow_normal.S, $(MESASRCDIR)/src/X86)
-LinkSourceFile(3dnow_vertex.S, $(MESASRCDIR)/src/X86)
LinkSourceFile(3dnow_xform1.S, $(MESASRCDIR)/src/X86)
LinkSourceFile(3dnow_xform2.S, $(MESASRCDIR)/src/X86)
LinkSourceFile(3dnow_xform3.S, $(MESASRCDIR)/src/X86)
@@ -107,7 +99,6 @@ LinkSourceFile(3dnow_xform4.S, $(MESASRCDIR)/src/X86)
#endif
MESA_3DNOW_OBJS = $(MESAX86BUILDDIR)3dnow.o \
$(MESAX86BUILDDIR)3dnow_normal.o \
- $(MESAX86BUILDDIR)3dnow_vertex.o \
$(MESAX86BUILDDIR)3dnow_xform1.o \
$(MESAX86BUILDDIR)3dnow_xform2.o \
$(MESAX86BUILDDIR)3dnow_xform3.o \
@@ -116,7 +107,6 @@ MESA_3DNOW_OBJS = $(MESAX86BUILDDIR)3dnow.o \
#ifdef DoSharedLib
MESA_3DNOW_UOBJS = $(MESAX86BUILDDIR)unshared/3dnow.o \
$(MESAX86BUILDDIR)3dnow_normal.o \
- $(MESAX86BUILDDIR)3dnow_vertex.o \
$(MESAX86BUILDDIR)3dnow_xform1.o \
$(MESAX86BUILDDIR)3dnow_xform2.o \
$(MESAX86BUILDDIR)3dnow_xform3.o \
@@ -127,7 +117,6 @@ MESA_3DNOW_UOBJS = $(MESA_3DNOW_OBJS)
MESA_3DNOW_DOBJS = $(MESAX86BUILDDIR)debugger/3dnow.o \
$(MESAX86BUILDDIR)3dnow_normal.o \
- $(MESAX86BUILDDIR)3dnow_vertex.o \
$(MESAX86BUILDDIR)3dnow_xform1.o \
$(MESAX86BUILDDIR)3dnow_xform2.o \
$(MESAX86BUILDDIR)3dnow_xform3.o \
@@ -135,7 +124,6 @@ MESA_3DNOW_DOBJS = $(MESAX86BUILDDIR)debugger/3dnow.o \
MESA_3DNOW_POBJS = $(MESAX86BUILDDIR)profiled/3dnow.o \
$(MESAX86BUILDDIR)3dnow_normal.o \
- $(MESAX86BUILDDIR)3dnow_vertex.o \
$(MESAX86BUILDDIR)3dnow_xform1.o \
$(MESAX86BUILDDIR)3dnow_xform2.o \
$(MESAX86BUILDDIR)3dnow_xform3.o \
@@ -147,7 +135,6 @@ MESA_3DNOW_DEFS = -DUSE_3DNOW_ASM
#if MesaUseKatmai
MESA_SSE_SRCS = $(MESAX86BUILDDIR)sse.c \
$(MESAX86BUILDDIR)sse_normal.S \
- $(MESAX86BUILDDIR)sse_vertex.S \
$(MESAX86BUILDDIR)sse_xform1.S \
$(MESAX86BUILDDIR)sse_xform2.S \
$(MESAX86BUILDDIR)sse_xform3.S \
@@ -156,7 +143,6 @@ MESA_SSE_SRCS = $(MESAX86BUILDDIR)sse.c \
#ifdef NeedToLinkMesaSrc
LinkSourceFile(sse.c, $(MESASRCDIR)/src/X86)
LinkSourceFile(sse_normal.S, $(MESASRCDIR)/src/X86)
-LinkSourceFile(sse_vertex.S, $(MESASRCDIR)/src/X86)
LinkSourceFile(sse_xform1.S, $(MESASRCDIR)/src/X86)
LinkSourceFile(sse_xform2.S, $(MESASRCDIR)/src/X86)
LinkSourceFile(sse_xform3.S, $(MESASRCDIR)/src/X86)
@@ -165,7 +151,6 @@ LinkSourceFile(sse_xform4.S, $(MESASRCDIR)/src/X86)
MESA_SSE_OBJS = $(MESAX86BUILDDIR)sse.o \
$(MESAX86BUILDDIR)sse_normal.o \
- $(MESAX86BUILDDIR)sse_vertex.o \
$(MESAX86BUILDDIR)sse_xform1.o \
$(MESAX86BUILDDIR)sse_xform2.o \
$(MESAX86BUILDDIR)sse_xform3.o \
@@ -174,7 +159,6 @@ MESA_SSE_OBJS = $(MESAX86BUILDDIR)sse.o \
#if DoSharedLib
MESA_SSE_UOBJS = $(MESAX86BUILDDIR)unshared/sse.o \
$(MESAX86BUILDDIR)sse_normal.o \
- $(MESAX86BUILDDIR)sse_vertex.o \
$(MESAX86BUILDDIR)sse_xform1.o \
$(MESAX86BUILDDIR)sse_xform2.o \
$(MESAX86BUILDDIR)sse_xform3.o \
@@ -185,7 +169,6 @@ MESA_SSE_UOBJS = $(MESA_SSE_OBJS)
MESA_SSE_DOBJS = $(MESAX86BUILDDIR)debugger/sse.o \
$(MESAX86BUILDDIR)sse_normal.o \
- $(MESAX86BUILDDIR)sse_vertex.o \
$(MESAX86BUILDDIR)sse_xform1.o \
$(MESAX86BUILDDIR)sse_xform2.o \
$(MESAX86BUILDDIR)sse_xform3.o \
@@ -193,7 +176,6 @@ MESA_SSE_DOBJS = $(MESAX86BUILDDIR)debugger/sse.o \
MESA_SSE_POBJS = $(MESAX86BUILDDIR)profiled/sse.o \
$(MESAX86BUILDDIR)sse_normal.o \
- $(MESAX86BUILDDIR)sse_vertex.o \
$(MESAX86BUILDDIR)sse_xform1.o \
$(MESAX86BUILDDIR)sse_xform2.o \
$(MESAX86BUILDDIR)sse_xform3.o \
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_context.h b/xc/lib/GL/mesa/src/drv/ffb/ffb_context.h
index 4c7c38978..6e68b6dd2 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_context.h
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_context.h
@@ -3,7 +3,6 @@
#ifndef _FFB_CONTEXT_H
#define _FFB_CONTEXT_H
-#include <X11/Xlibint.h>
#include "dri_util.h"
#include "mtypes.h"
@@ -269,7 +268,6 @@ do { if ((STATE_MASK) & ~((FMESA)->state_dirty)) { \
drmContext hHWContext;
drmLock *driHwLock;
int driFd;
- Display *display;
unsigned int clear_pixel;
unsigned int clear_depth;
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c
index e14b6d443..d0137000f 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c
@@ -26,10 +26,6 @@
*/
#include "mtypes.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
#include "mm.h"
#include "ffb_dd.h"
#include "ffb_span.h"
@@ -41,7 +37,7 @@
#include "ffb_lock.h"
#include "extensions.h"
-#define FFB_DATE "20010624"
+#define FFB_DATE "20021125"
/* Mesa's Driver Functions */
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c
index e82c9ab51..da1de18f3 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c
@@ -26,10 +26,6 @@
*/
#include "mtypes.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
#include "mm.h"
#include "ffb_dd.h"
#include "ffb_span.h"
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_points.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_points.c
index a92c69d09..ee956d371 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_points.c
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_points.c
@@ -27,20 +27,13 @@
#include "mtypes.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "mm.h"
#include "ffb_dd.h"
-#include "ffb_span.h"
-#include "ffb_depth.h"
#include "ffb_context.h"
#include "ffb_vb.h"
-#include "ffb_lines.h"
#include "ffb_points.h"
#include "ffb_tris.h"
#include "ffb_lock.h"
-#include "extensions.h"
+
#undef FFB_POINT_TRACE
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_rendertmp.h b/xc/lib/GL/mesa/src/drv/ffb/ffb_rendertmp.h
index de5185909..d1a376cd5 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_rendertmp.h
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_rendertmp.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_rendertmp.h,v 1.1 2002/02/22 21:32:59 dawes Exp $ */
+/* $XFree86$ */
#define IMPL_LOCAL_VARS \
ffbContextPtr fmesa = FFB_CONTEXT(ctx); \
@@ -56,8 +56,8 @@ static void TAG(ffb_vb_points)(GLcontext *ctx, GLuint start, GLuint count, GLuin
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_POINTS);
if (ctx->_TriangleCaps & DD_POINT_SMOOTH) {
@@ -90,8 +90,8 @@ static void TAG(ffb_vb_lines)(GLcontext *ctx, GLuint start, GLuint count, GLuint
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_LINES);
for (i = start + 1; i < count; i += 2) {
@@ -123,8 +123,8 @@ static void TAG(ffb_vb_line_loop)(GLcontext *ctx, GLuint start, GLuint count, GL
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_LINE_LOOP);
if ((flags & PRIM_BEGIN) != 0) {
@@ -185,8 +185,8 @@ static void TAG(ffb_vb_line_strip)(GLcontext *ctx, GLuint start, GLuint count, G
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_LINE_STRIP);
FFBFifo(fmesa, (1 + FFB_PRIM_COLOR_COST +
@@ -278,8 +278,8 @@ static void TAG(ffb_vb_triangles)(GLcontext *ctx, GLuint start, GLuint count, GL
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_TRIANGLES);
for (i = start + 2; i < count; i += 3) {
@@ -321,8 +321,8 @@ static void TAG(ffb_vb_tri_strip)(GLcontext *ctx, GLuint start, GLuint count, GL
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_TRIANGLE_STRIP);
if ((flags & PRIM_PARITY) != 0)
@@ -394,8 +394,8 @@ static void TAG(ffb_vb_tri_fan)(GLcontext *ctx, GLuint start, GLuint count, GLui
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_TRIANGLE_FAN);
@@ -464,8 +464,8 @@ static void TAG(ffb_vb_poly)(GLcontext *ctx, GLuint start, GLuint count, GLuint
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_POLYGON);
@@ -508,8 +508,8 @@ static void TAG(ffb_vb_quads)(GLcontext *ctx, GLuint start, GLuint count, GLuint
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_QUADS);
@@ -557,8 +557,8 @@ static void TAG(ffb_vb_quad_strip)(GLcontext *ctx, GLuint start, GLuint count, G
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_QUAD_STRIP);
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_state.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_state.c
index 3853fd3a0..6f33a35d2 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_state.c
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_state.c
@@ -27,9 +27,6 @@
#include "mtypes.h"
-#include <stdio.h>
-#include <stdlib.h>
-
#include "mm.h"
#include "ffb_dd.h"
#include "ffb_span.h"
@@ -37,8 +34,6 @@
#include "ffb_context.h"
#include "ffb_vb.h"
#include "ffb_tris.h"
-#include "ffb_lines.h"
-#include "ffb_points.h"
#include "ffb_state.h"
#include "ffb_lock.h"
#include "extensions.h"
@@ -56,6 +51,7 @@
static unsigned int ffbComputeAlphaFunc(GLcontext *ctx)
{
unsigned int xclip;
+ GLubyte alphaRef;
#ifdef STATE_TRACE
fprintf(stderr, "ffbDDAlphaFunc: func(%s) ref(%02x)\n",
@@ -77,12 +73,13 @@ static unsigned int ffbComputeAlphaFunc(GLcontext *ctx)
return FFB_XCLIP_TEST_ALWAYS | 0x00;
}
- xclip |= (ctx->Color.AlphaRef & 0xff);
+ CLAMPED_FLOAT_TO_UBYTE(alphaRef, ctx->Color.AlphaRef);
+ xclip |= (alphaRef & 0xff);
return xclip;
}
-static void ffbDDAlphaFunc(GLcontext *ctx, GLenum func, GLchan ref)
+static void ffbDDAlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
@@ -448,7 +445,7 @@ void ffbCalcViewport(GLcontext *ctx)
ffbCalcViewportRegs(ctx);
- fmesa->setupnewinputs |= VERT_CLIP;
+ fmesa->setupnewinputs |= VERT_BIT_CLIP;
}
static void ffbDDViewport(GLcontext *ctx, GLint x, GLint y,
@@ -468,32 +465,32 @@ static void ffbDDScissor(GLcontext *ctx, GLint cx, GLint cy,
ffbCalcViewport(ctx);
}
-static void ffbDDSetDrawBuffer(GLcontext *ctx, GLenum buffer)
+static void ffbDDDrawBuffer(GLcontext *ctx, GLenum buffer)
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
unsigned int fbc = fmesa->fbc;
#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDSetDrawBuffer: mode(%s)\n",
+ fprintf(stderr, "ffbDDDrawBuffer: mode(%s)\n",
_mesa_lookup_enum_by_nr(buffer));
#endif
- fbc &= ~(FFB_FBC_WB_AB);
+ fbc &= ~(FFB_FBC_WB_AB | FFB_FBC_RB_MASK);
switch (buffer) {
- case GL_FRONT_LEFT:
+ case FRONT_LEFT_BIT:
if (fmesa->back_buffer == 0)
- fbc |= FFB_FBC_WB_B;
+ fbc |= FFB_FBC_WB_B | FFB_FBC_RB_B;
else
- fbc |= FFB_FBC_WB_A;
+ fbc |= FFB_FBC_WB_A | FFB_FBC_RB_A;
break;
- case GL_BACK_LEFT:
+ case BACK_LEFT_BIT:
if (fmesa->back_buffer == 0)
- fbc |= FFB_FBC_WB_A;
+ fbc |= FFB_FBC_WB_A | FFB_FBC_RB_A;
else
- fbc |= FFB_FBC_WB_B;
+ fbc |= FFB_FBC_WB_B | FFB_FBC_RB_B;
break;
- case GL_FRONT_AND_BACK:
+ case BACK_LEFT_BIT | FRONT_LEFT_BIT:
fbc |= FFB_FBC_WB_AB;
break;
@@ -507,8 +504,18 @@ static void ffbDDSetDrawBuffer(GLcontext *ctx, GLenum buffer)
}
}
-static void ffbDDSetReadBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
- GLenum buffer)
+
+static void ffbDDReadBuffer(GLcontext *ctx, GLenum buffer)
+{
+ /* no-op, unless you implement h/w glRead/CopyPixels */
+}
+
+
+/*
+ * Specifies buffer for sw fallbacks (spans)
+ */
+static void ffbDDSetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
+ GLuint bufferBit)
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
unsigned int fbc = fmesa->fbc;
@@ -518,15 +525,15 @@ static void ffbDDSetReadBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
_mesa_lookup_enum_by_nr(buffer));
#endif
fbc &= ~(FFB_FBC_RB_MASK);
- switch (buffer) {
- case GL_FRONT_LEFT:
+ switch (bufferBit) {
+ case FRONT_LEFT_BIT:
if (fmesa->back_buffer == 0)
fbc |= FFB_FBC_RB_B;
else
fbc |= FFB_FBC_RB_A;
break;
- case GL_BACK_LEFT:
+ case BACK_LEFT_BIT:
if (fmesa->back_buffer == 0)
fbc |= FFB_FBC_RB_A;
else
@@ -543,13 +550,17 @@ static void ffbDDSetReadBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
}
}
-static void ffbDDClearColor(GLcontext *ctx, const GLchan color[4])
+static void ffbDDClearColor(GLcontext *ctx, const GLfloat color[4])
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
- fmesa->clear_pixel = ((color[0] << 0) |
- (color[1] << 8) |
- (color[2] << 16));
+ GLubyte c[4];
+ CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
+
+ fmesa->clear_pixel = ((c[0] << 0) |
+ (c[1] << 8) |
+ (c[2] << 16));
}
static void ffbDDClearDepth(GLcontext *ctx, GLclampd depth)
@@ -842,14 +853,14 @@ static void ffbDDEnable(GLcontext *ctx, GLenum cap, GLboolean state)
tmp = fmesa->fbc & ~FFB_FBC_YE_MASK;
if (state) {
ffbDDStencilFunc(ctx,
- ctx->Stencil.Function,
- ctx->Stencil.Ref,
- ctx->Stencil.ValueMask);
- ffbDDStencilMask(ctx, ctx->Stencil.WriteMask);
+ ctx->Stencil.Function[0],
+ ctx->Stencil.Ref[0],
+ ctx->Stencil.ValueMask[0]);
+ ffbDDStencilMask(ctx, ctx->Stencil.WriteMask[0]);
ffbDDStencilOp(ctx,
- ctx->Stencil.FailFunc,
- ctx->Stencil.ZFailFunc,
- ctx->Stencil.ZPassFunc);
+ ctx->Stencil.FailFunc[0],
+ ctx->Stencil.ZFailFunc[0],
+ ctx->Stencil.ZPassFunc[0]);
tmp |= FFB_FBC_YE_MASK;
} else {
fmesa->stencil = 0xf0000000;
@@ -1017,7 +1028,7 @@ static void ffbDDUpdateState(GLcontext *ctx, GLuint newstate)
if (newstate & _NEW_TEXTURE)
FALLBACK( ctx, FFB_BADATTR_TEXTURE,
- (ctx->Texture._ReallyEnabled != 0));
+ (ctx->Texture._EnabledUnits != 0));
#ifdef STATE_TRACE
fprintf(stderr, "ffbDDUpdateState: newstate(%08x)\n", newstate);
@@ -1078,7 +1089,8 @@ void ffbDDInitStateFuncs(GLcontext *ctx)
ctx->Driver.StencilOp = NULL;
}
- ctx->Driver.SetDrawBuffer = ffbDDSetDrawBuffer;
+ ctx->Driver.DrawBuffer = ffbDDDrawBuffer;
+ ctx->Driver.ReadBuffer = ffbDDReadBuffer;
ctx->Driver.ClearColor = ffbDDClearColor;
ctx->Driver.ClearDepth = ffbDDClearDepth;
ctx->Driver.ClearStencil = ffbDDClearStencil;
@@ -1107,7 +1119,7 @@ void ffbDDInitStateFuncs(GLcontext *ctx)
{
struct swrast_device_driver *swdd =
_swrast_GetDeviceDriverReference(ctx);
- swdd->SetReadBuffer = ffbDDSetReadBuffer;
+ swdd->SetBuffer = ffbDDSetBuffer;
}
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c
index 792198652..d0d3c3b9d 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c
@@ -25,16 +25,13 @@
* David S. Miller <davem@redhat.com>
*/
-#include <stdio.h>
-#include <stdlib.h>
-
#include "glheader.h"
#include "mtypes.h"
#include "macros.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
-#include "swrast_setup/ss_context.h"
+#include "swrast/s_context.h"
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
@@ -926,7 +923,7 @@ void ffbFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
void ffbDDInitRenderFuncs( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
- SScontext *swsetup = SWSETUP_CONTEXT(ctx);
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
static int firsttime = 1;
if (firsttime) {
@@ -944,6 +941,6 @@ void ffbDDInitRenderFuncs( GLcontext *ctx )
tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- swsetup->Driver.Start = ffbSWRenderStart;
- swsetup->Driver.Finish = ffbSWRenderFinish;
+ swrast->Driver.SpanRenderStart = ffbSWRenderStart;
+ swrast->Driver.SpanRenderFinish = ffbSWRenderFinish;
}
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c
index 2e8c6687f..09c9d041e 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c
@@ -28,7 +28,7 @@
#include "ffb_xmesa.h"
#include "ffb_context.h"
#include "ffb_vb.h"
-#include "mem.h"
+#include "imports.h"
#include "tnl/t_context.h"
#include "swrast_setup/swrast_setup.h"
#include "math/m_translate.h"
@@ -175,12 +175,12 @@ static void ffbDDBuildVertices(GLcontext *ctx, GLuint start, GLuint count,
if (!newinputs)
return;
- if (newinputs & VERT_CLIP) {
+ if (newinputs & VERT_BIT_CLIP) {
setup_tab[fmesa->setupindex].emit(ctx, start, count);
} else {
GLuint ind = 0;
- if (newinputs & VERT_RGBA)
+ if (newinputs & VERT_BIT_COLOR0)
ind |= (FFB_VB_RGBA_BIT | FFB_VB_TWOSIDE_BIT);
ind &= fmesa->setupindex;
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h b/xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h
index f0c1bf355..58b0391c7 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h,v 1.1 2002/02/22 21:32:59 dawes Exp $ */
+/* $XFree86$ */
static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end)
{
@@ -13,8 +13,8 @@ static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end)
#endif
#endif
#if (IND & FFB_VB_XYZ_BIT)
- GLfloat (*proj)[4] = VB->ProjectedClipPtr->data;
- GLuint proj_stride = VB->ProjectedClipPtr->stride;
+ GLfloat (*proj)[4] = VB->NdcPtr->data;
+ GLuint proj_stride = VB->NdcPtr->stride;
const GLubyte *mask = VB->ClipMask;
#endif
ffb_vertex *v = &fmesa->verts[start];
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c
index d274410ea..329911bdc 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c,v 1.1 2002/02/22 21:32:59 dawes Exp $
+/* $XFree86$
*
* GLX Hardware Device Driver for Sun Creator/Creator3D
* Copyright (C) 2001 David S. Miller
@@ -30,7 +30,7 @@
#include "context.h"
#include "light.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
#include "simple_list.h"
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c
index b851a3240..eff0d5d9f 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c
@@ -27,15 +27,12 @@
#ifdef GLX_DIRECT_RENDERING
-#include <X11/Xlibint.h>
-#include <stdio.h>
-
#include "ffb_xmesa.h"
#include "context.h"
#include "matrix.h"
#include "simple_list.h"
#include "mmath.h"
-#include "mem.h"
+#include "imports.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
@@ -43,9 +40,6 @@
#include "tnl/t_pipeline.h"
#include "array_cache/acache.h"
-
-#include "xf86dri.h"
-
#include "ffb_context.h"
#include "ffb_dd.h"
#include "ffb_span.h"
@@ -176,7 +170,7 @@ static const struct gl_pipeline_stage *ffb_pipeline[] = {
/* Create and initialize the Mesa and driver specific context data */
static GLboolean
-ffbCreateContext(Display *dpy, const __GLcontextModes *mesaVis,
+ffbCreateContext(const __GLcontextModes *mesaVis,
__DRIcontextPrivate *driContextPriv,
void *sharedContextPrivate)
{
@@ -208,7 +202,6 @@ ffbCreateContext(Display *dpy, const __GLcontextModes *mesaVis,
ffbScreen = (ffbScreenPrivate *) sPriv->private;
/* Dri stuff. */
- fmesa->display = dpy;
fmesa->hHWContext = driContextPriv->hHWContext;
fmesa->driFd = sPriv->fd;
fmesa->driHwLock = &sPriv->pSAREA->lock;
@@ -315,8 +308,7 @@ ffbDestroyContext(__DRIcontextPrivate *driContextPriv)
/* Create and initialize the Mesa and driver specific pixmap buffer data */
static GLboolean
-ffbCreateBuffer(Display *dpy,
- __DRIscreenPrivate *driScrnPriv,
+ffbCreateBuffer(__DRIscreenPrivate *driScrnPriv,
__DRIdrawablePrivate *driDrawPriv,
const __GLcontextModes *mesaVis,
GLboolean isPixmap )
@@ -346,9 +338,8 @@ ffbDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
#define USE_FAST_SWAP
static void
-ffbSwapBuffers(Display *dpy, void *drawablePrivate)
+ffbSwapBuffers( __DRIdrawablePrivate *dPriv )
{
- __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
ffbContextPtr fmesa = (ffbContextPtr) dPriv->driContextPriv->driverPrivate;
unsigned int fbc, wid, wid_reg_val, dac_db_bit;
unsigned int shadow_dac_addr, active_dac_addr;
@@ -360,7 +351,7 @@ ffbSwapBuffers(Display *dpy, void *drawablePrivate)
return;
/* Flush pending rendering commands */
- _mesa_swapbuffers(fmesa->glCtx);
+ _mesa_notifySwapBuffers(fmesa->glCtx);
ffb = fmesa->regs;
dac = fmesa->ffbScreen->dac;
@@ -557,7 +548,7 @@ void ffbXMesaUpdateState(ffbContextPtr fmesa)
__DRIscreenPrivate *sPriv = fmesa->driScreen;
int stamp = dPriv->lastStamp;
- DRI_VALIDATE_DRAWABLE_INFO(fmesa->display, sPriv, dPriv);
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
if (dPriv->lastStamp != stamp) {
GLcontext *ctx = fmesa->glCtx;
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_context.c b/xc/lib/GL/mesa/src/drv/gamma/gamma_context.c
index 4365505b1..f7db2adea 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_context.c
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_context.c
@@ -19,7 +19,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
+ * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
*
* 3DLabs Gamma driver.
*
@@ -35,14 +35,13 @@
#include "context.h"
#include "simple_list.h"
-#include "mem.h"
+#include "imports.h"
#include "matrix.h"
#include "extensions.h"
#if defined(USE_X86_ASM)
#include "X86/common_x86_asm.h"
#endif
#include "simple_list.h"
-#include "mem.h"
#include "mm.h"
@@ -66,7 +65,7 @@ static const struct gl_pipeline_stage *gamma_pipeline[] = {
0,
};
-GLboolean gammaCreateContext( Display *dpy, const __GLcontextModes *glVisual,
+GLboolean gammaCreateContext( const __GLcontextModes *glVisual,
__DRIcontextPrivate *driContextPriv,
void *sharedContextPrivate)
{
@@ -74,7 +73,7 @@ GLboolean gammaCreateContext( Display *dpy, const __GLcontextModes *glVisual,
__DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
gammaContextPtr gmesa;
gammaScreenPtr gammascrn;
- drm_gamma_sarea_t *saPriv=(drm_gamma_sarea_t *)(((char*)sPriv->pSAREA)+
+ GLINTSAREADRIPtr saPriv=(GLINTSAREADRIPtr)(((char*)sPriv->pSAREA)+
sizeof(XF86DRISAREARec));
gmesa = (gammaContextPtr) CALLOC( sizeof(*gmesa) );
@@ -86,14 +85,12 @@ GLboolean gammaCreateContext( Display *dpy, const __GLcontextModes *glVisual,
else
shareCtx = NULL;
- gmesa->glCtx = _mesa_create_context(glVisual, shareCtx, gmesa, GL_TRUE);
+ gmesa->glCtx = _mesa_create_context(glVisual, shareCtx, (void *) gmesa, GL_TRUE);
if (!gmesa->glCtx) {
FREE(gmesa);
return GL_FALSE;
}
- gmesa->display = dpy;
-
gmesa->driContext = driContextPriv;
gmesa->driScreen = sPriv;
gmesa->driDrawable = NULL; /* Set by XMesaMakeCurrent */
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_context.h b/xc/lib/GL/mesa/src/drv/gamma/gamma_context.h
index e37c4c3e4..ce1994471 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_context.h
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_context.h
@@ -1,4 +1,3 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_context.h,v 1.3 2002/09/18 17:11:40 tsi Exp $ */
/*
* Copyright 2001 by Alan Hourihane.
*
@@ -20,7 +19,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
+ * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
*
*/
@@ -34,7 +33,7 @@
#include "gamma_screen.h"
#include "macros.h"
#include "mtypes.h"
-#include "drm.h"
+#include "glint_dri.h"
#include "mm.h"
typedef union {
@@ -59,8 +58,7 @@ typedef union {
extern void gammaDDUpdateHWState(GLcontext *ctx);
extern gammaScreenPtr gammaCreateScreen(__DRIscreenPrivate *sPriv);
extern void gammaDestroyScreen(__DRIscreenPrivate *sPriv);
-extern GLboolean gammaCreateContext( Display *dpy,
- const __GLcontextModes *glVisual,
+extern GLboolean gammaCreateContext( const __GLcontextModes *glVisual,
__DRIcontextPrivate *driContextPriv,
void *sharedContextPrivate);
@@ -144,7 +142,7 @@ struct gamma_texture_object_t {
int bound;
PMemBlock MemBlock;
- char *BufAddr;
+ char * BufAddr;
GLuint min_level;
GLuint max_level;
@@ -205,6 +203,9 @@ void gammaPrintGlobalLRU( gammaContextPtr gmesa );
extern void gammaFallback( gammaContextPtr gmesa, GLuint bit, GLboolean mode );
#define FALLBACK( imesa, bit, mode ) gammaFallback( imesa, bit, mode )
+void gammaSwapOutTexObj( gammaContextPtr gmesa, gammaTextureObjectPtr t );
+void gammaUpdateTexLRU( gammaContextPtr gmesa, gammaTextureObjectPtr t );
+
/* Use the templated vertex formats. Only one of these is used in gamma.
*/
#define TAG(x) gamma##x
@@ -238,7 +239,7 @@ struct gamma_context {
GLuint new_state;
GLuint dirty;
- drm_gamma_sarea_t *sarea;
+ GLINTSAREADRIPtr sarea;
/* Temporaries for translating away float colors:
*/
@@ -247,8 +248,6 @@ struct gamma_context {
/* Mirrors of some DRI state
*/
- Display *display; /* X server display */
-
drmContext hHWContext;
drmLock *driHwLock;
int driFd;
@@ -299,7 +298,7 @@ struct gamma_context {
memHeap_t *texHeap;
- int lastSwap;
+ unsigned int lastSwap;
int texAge;
int ctxAge;
int dirtyAge;
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_dd.c b/xc/lib/GL/mesa/src/drv/gamma/gamma_dd.c
index c65a3e8fb..5bd84026e 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_dd.c
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_dd.c
@@ -19,7 +19,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
+ * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
*
*/
@@ -30,15 +30,15 @@
#include "X86/common_x86_asm.h"
#endif
-#include "swrast/swrast.h"
#include "context.h"
+#include "swrast/swrast.h"
-#define GAMMA_DATE "20010624"
+#define GAMMA_DATE "20021125"
/* Return the width and height of the current color buffer.
*/
-static void gammaDDGetBufferSize(GLframebuffer *buffer,
+static void gammaDDGetBufferSize( GLframebuffer *buffer,
GLuint *width, GLuint *height )
{
GET_CURRENT_CONTEXT(ctx);
@@ -105,6 +105,7 @@ 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;
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_lock.c b/xc/lib/GL/mesa/src/drv/gamma/gamma_lock.c
index 4ef9cb131..12a48ee1f 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_lock.c
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_lock.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_lock.c,v 1.2 2002/02/26 23:37:33 tsi Exp $ */
#include "gamma_context.h"
@@ -31,7 +30,7 @@ void gammaGetLock( gammaContextPtr gmesa, 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( gmesa->display, sPriv, dPriv );
+ DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
if ( gmesa->lastStamp != dPriv->lastStamp ) {
gmesa->lastStamp = dPriv->lastStamp;
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_macros.h b/xc/lib/GL/mesa/src/drv/gamma/gamma_macros.h
index 2ef58c63b..bf9cf5f11 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_macros.h
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_macros.h
@@ -246,15 +246,15 @@ do { \
} while (0)
#ifdef DO_VALIDATE
-#define VALIDATE_DRAWABLE_INFO_NO_LOCK(gcp) \
+#define VALIDATE_DRAWABLE_INFO_NO_LOCK(gcp) \
do { \
- __DRIscreenPrivate *psp = gcp->driScreen; \
- __DRIdrawablePrivate *pdp = gcp->driDrawable; \
+ /*__DRIscreenPrivate *psp = gcp->driScreen;*/ \
+ __DRIdrawablePrivate *pdp = gcp->driDrawable; \
\
if (*(pdp->pStamp) != pdp->lastStamp) { \
int old_index = pdp->index; \
while (*(pdp->pStamp) != pdp->lastStamp) { \
- DRI_VALIDATE_DRAWABLE_INFO_ONCE(gcp->display, psp->myNum, pdp);\
+ DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp); \
} \
if (pdp->index != old_index) { \
gcp->Window &= ~W_GIDMask; \
@@ -262,8 +262,8 @@ do { \
CHECK_WC_DMA_BUFFER(gcp, 1); \
WRITE(gcp->WCbuf, GLINTWindow, gcp->Window|(gcp->FrameCount<<9));\
} \
- \
- gammaUpdateViewportOffset( gcp->glCtx); \
+ \
+ gammaUpdateViewportOffset( gcp->glCtx); \
\
if (pdp->numClipRects == 1 && \
pdp->pClipRects->x1 == pdp->x && \
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_render.c b/xc/lib/GL/mesa/src/drv/gamma/gamma_render.c
index 3bf35db0e..145e29c54 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_render.c
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_render.c
@@ -19,7 +19,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
+ * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
*
* 3DLabs Gamma driver.
*
@@ -28,7 +28,7 @@
#include "glheader.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mtypes.h"
#include "mmath.h"
@@ -67,8 +67,8 @@ static void gamma_emit( GLcontext *ctx, GLuint start, GLuint end)
coord = VB->ClipPtr->data;
coord_stride = VB->ClipPtr->stride;
} else {
- coord = VB->ProjectedClipPtr->data;
- coord_stride = VB->ProjectedClipPtr->stride;
+ coord = VB->NdcPtr->data;
+ coord_stride = VB->NdcPtr->stride;
}
if (VB->importable_data) {
@@ -179,7 +179,7 @@ static void VERT_FALLBACK( GLcontext *ctx,
tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK );
tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 );
tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start, count, flags );
- GAMMA_CONTEXT(ctx)->SetupNewInputs = VERT_CLIP;
+ GAMMA_CONTEXT(ctx)->SetupNewInputs = VERT_BIT_CLIP;
}
static const GLuint hw_prim[GL_POLYGON+1] = {
@@ -274,20 +274,20 @@ static GLboolean gamma_run_render( GLcontext *ctx,
static void gamma_check_render( GLcontext *ctx,
struct gl_pipeline_stage *stage )
{
- GLuint inputs = VERT_CLIP|VERT_RGBA;
+ GLuint inputs = VERT_BIT_CLIP | VERT_BIT_COLOR0;
if (ctx->RenderMode == GL_RENDER) {
if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
- inputs |= VERT_SPEC_RGB;
+ inputs |= VERT_BIT_COLOR1;
if (ctx->Texture.Unit[0]._ReallyEnabled)
- inputs |= VERT_TEX(0);
+ inputs |= VERT_BIT_TEX0;
if (ctx->Texture.Unit[1]._ReallyEnabled)
- inputs |= VERT_TEX(1);
+ inputs |= VERT_BIT_TEX1;
if (ctx->Fog.Enabled)
- inputs |= VERT_FOG_COORD;
+ inputs |= VERT_BIT_FOG;
}
stage->inputs = inputs;
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_screen.c b/xc/lib/GL/mesa/src/drv/gamma/gamma_screen.c
index f826a5038..85cd1e516 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_screen.c
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_screen.c
@@ -19,7 +19,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
+ * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
*
*/
@@ -27,7 +27,7 @@
#include "gamma_vb.h"
#include "glint_dri.h"
-#include "mem.h"
+#include "imports.h"
gammaScreenPtr gammaCreateScreen( __DRIscreenPrivate *sPriv )
{
@@ -36,15 +36,12 @@ gammaScreenPtr gammaCreateScreen( __DRIscreenPrivate *sPriv )
int i;
#if 0
- /* Check the DRI version */
- {
- int major, minor, patch;
- if ( XF86DRIQueryVersion( sPriv->display, &major, &minor, &patch ) ) {
- if ( major != 3 || minor != 1 || patch < 0 ) {
- __driUtilMessage( "r128 DRI driver expected DRI version 3.1.x but got version %d.%d.%d", major, minor, patch );
- return GL_FALSE;
- }
- }
+ /* Check the DRI externsion version */
+ if ( sPriv->driMajor != 3 || sPriv->driMinor != 1 ) {
+ __driUtilMessage( "Gamma DRI driver expected DRI version 4.0.x "
+ "but got version %d.%d.%d",
+ sPriv->driMajor, sPriv->driMinor, sPriv->driPatch );
+ return NULL;
}
/* Check that the DDX driver version is compatible */
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_span.c b/xc/lib/GL/mesa/src/drv/gamma/gamma_span.c
index 6f6f64b31..180bf26a4 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_span.c
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_span.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_span.c,v 1.2 2002/02/26 23:37:33 tsi Exp $ */
+/* $XFree86$ */
#include "gamma_context.h"
#include "gamma_lock.h"
@@ -156,7 +156,7 @@ do { \
-#if 0 /* unused */
+#if 0 /* Unused */
/* 32 bit depthbuffer functions.
*/
#define WRITE_DEPTH( _x, _y, d ) \
@@ -260,17 +260,17 @@ done:
}
#endif
-static void gammaSetReadBuffer( GLcontext *ctx,
- GLframebuffer *colorBuffer,
- GLenum mode )
+static void gammaSetBuffer( GLcontext *ctx,
+ GLframebuffer *colorBuffer,
+ GLuint bufferBit )
{
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- switch ( mode ) {
- case GL_FRONT_LEFT:
+ switch ( bufferBit ) {
+ case FRONT_LEFT_BIT:
gmesa->readOffset = 0;
break;
- case GL_BACK_LEFT:
+ case BACK_LEFT_BIT:
gmesa->readOffset = gmesa->driScreen->fbHeight * gmesa->driScreen->fbWidth * gmesa->gammaScreen->cpp;
break;
}
@@ -282,7 +282,7 @@ void gammaDDInitSpanFuncs( GLcontext *ctx )
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
- swdd->SetReadBuffer = gammaSetReadBuffer;
+ swdd->SetBuffer = gammaSetBuffer;
switch ( gmesa->gammaScreen->cpp ) {
case 2:
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_state.c b/xc/lib/GL/mesa/src/drv/gamma/gamma_state.c
index 7da907805..867cd678b 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_state.c
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_state.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_state.c,v 1.3 2002/09/10 00:39:37 dawes Exp $ */
/*
* Copyright 2001 by Alan Hourihane.
*
@@ -20,12 +19,11 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
+ * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
*
* 3DLabs Gamma driver
*/
-#include <X11/Xlibint.h>
#include "gamma_context.h"
#include "gamma_macros.h"
#include "macros.h"
@@ -48,11 +46,12 @@ static void gammaUpdateAlphaMode( GLcontext *ctx )
CARD32 a = gmesa->AlphaTestMode;
CARD32 b = gmesa->AlphaBlendMode;
CARD32 f = gmesa->AB_FBReadMode_Save = 0;
+ GLubyte refByte = (GLint) (ctx->Color.AlphaRef * 255.0);
a &= ~(AT_CompareMask | AT_RefValueMask);
b &= ~(AB_SrcBlendMask | AB_DstBlendMask);
- a |= ctx->Color.AlphaRef << 4;
+ a |= refByte << 4;
switch ( ctx->Color.AlphaFunc ) {
case GL_NEVER:
@@ -167,9 +166,10 @@ static void gammaUpdateAlphaMode( GLcontext *ctx )
gmesa->AB_FBReadMode_Save = f;
}
-static void gammaDDAlphaFunc( GLcontext *ctx, GLenum func, GLchan ref )
+static void gammaDDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref )
{
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
+ (void) ref;
FLUSH_BATCH( gmesa );
@@ -1016,12 +1016,17 @@ static void gammaDDShadeModel( GLcontext *ctx, GLenum mode )
* Miscellaneous
*/
-static void gammaDDClearColor( GLcontext *ctx, const GLchan color[4])
+static void gammaDDClearColor( GLcontext *ctx, const GLfloat color[4])
{
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
+ GLubyte c[4];
+ UNCLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
+ UNCLAMPED_FLOAT_TO_UBYTE(c[3], color[3]);
gmesa->ClearColor = gammaPackColor( gmesa->gammaScreen->cpp,
- color[0], color[1], color[2], color[3] );
+ c[0], c[1], c[2], c[3] );
if (gmesa->gammaScreen->cpp == 2) gmesa->ClearColor |= gmesa->ClearColor<<16;
}
@@ -1042,7 +1047,7 @@ static void gammaDDLogicalOpcode( GLcontext *ctx, GLenum opcode )
gmesa->dirty |= GAMMA_UPLOAD_LOGICOP;
}
-static void gammaDDSetDrawBuffer( GLcontext *ctx, GLenum mode )
+static void gammaDDDrawBuffer( GLcontext *ctx, GLenum mode )
{
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
@@ -1050,14 +1055,19 @@ static void gammaDDSetDrawBuffer( GLcontext *ctx, GLenum mode )
switch ( mode ) {
case GL_FRONT_LEFT:
- gmesa->drawOffset = 0;
+ gmesa->drawOffset = gmesa->readOffset = 0;
break;
case GL_BACK_LEFT:
- gmesa->drawOffset = gmesa->driScreen->fbHeight * gmesa->driScreen->fbWidth * gmesa->gammaScreen->cpp;
+ gmesa->drawOffset = gmesa->readOffset = gmesa->driScreen->fbHeight * gmesa->driScreen->fbWidth * gmesa->gammaScreen->cpp;
break;
}
}
+static void gammaDDReadBuffer( GLcontext *ctx, GLenum mode )
+{
+ /* XXX anything? */
+}
+
/* =============================================================
* Window position and viewport transformation
*/
@@ -1132,84 +1142,72 @@ void gammaUpdateViewportOffset( GLcontext *ctx )
static void gammaLoadHWMatrix(GLcontext *ctx)
{
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
+ const GLfloat *m;
gmesa->TransformMode &= ~XM_XformTexture;
switch (ctx->Transform.MatrixMode) {
case GL_MODELVIEW:
gmesa->TransformMode |= XM_UseModelViewMatrix;
+ m = ctx->ModelviewMatrixStack.Top->m;
CHECK_DMA_BUFFER(gmesa, 16);
- WRITEF(gmesa->buf, ModelViewMatrix0, ctx->ModelView.m[0]);
- WRITEF(gmesa->buf, ModelViewMatrix1, ctx->ModelView.m[1]);
- WRITEF(gmesa->buf, ModelViewMatrix2, ctx->ModelView.m[2]);
- WRITEF(gmesa->buf, ModelViewMatrix3, ctx->ModelView.m[3]);
- WRITEF(gmesa->buf, ModelViewMatrix4, ctx->ModelView.m[4]);
- WRITEF(gmesa->buf, ModelViewMatrix5, ctx->ModelView.m[5]);
- WRITEF(gmesa->buf, ModelViewMatrix6, ctx->ModelView.m[6]);
- WRITEF(gmesa->buf, ModelViewMatrix7, ctx->ModelView.m[7]);
- WRITEF(gmesa->buf, ModelViewMatrix8, ctx->ModelView.m[8]);
- WRITEF(gmesa->buf, ModelViewMatrix9, ctx->ModelView.m[9]);
- WRITEF(gmesa->buf, ModelViewMatrix10, ctx->ModelView.m[10]);
- WRITEF(gmesa->buf, ModelViewMatrix11, ctx->ModelView.m[11]);
- WRITEF(gmesa->buf, ModelViewMatrix12, ctx->ModelView.m[12]);
- WRITEF(gmesa->buf, ModelViewMatrix13, ctx->ModelView.m[13]);
- WRITEF(gmesa->buf, ModelViewMatrix14, ctx->ModelView.m[14]);
- WRITEF(gmesa->buf, ModelViewMatrix15, ctx->ModelView.m[15]);
+ WRITEF(gmesa->buf, ModelViewMatrix0, m[0]);
+ WRITEF(gmesa->buf, ModelViewMatrix1, m[1]);
+ WRITEF(gmesa->buf, ModelViewMatrix2, m[2]);
+ WRITEF(gmesa->buf, ModelViewMatrix3, m[3]);
+ WRITEF(gmesa->buf, ModelViewMatrix4, m[4]);
+ WRITEF(gmesa->buf, ModelViewMatrix5, m[5]);
+ WRITEF(gmesa->buf, ModelViewMatrix6, m[6]);
+ WRITEF(gmesa->buf, ModelViewMatrix7, m[7]);
+ WRITEF(gmesa->buf, ModelViewMatrix8, m[8]);
+ WRITEF(gmesa->buf, ModelViewMatrix9, m[9]);
+ WRITEF(gmesa->buf, ModelViewMatrix10, m[10]);
+ WRITEF(gmesa->buf, ModelViewMatrix11, m[11]);
+ WRITEF(gmesa->buf, ModelViewMatrix12, m[12]);
+ WRITEF(gmesa->buf, ModelViewMatrix13, m[13]);
+ WRITEF(gmesa->buf, ModelViewMatrix14, m[14]);
+ WRITEF(gmesa->buf, ModelViewMatrix15, m[15]);
break;
case GL_PROJECTION:
+ m = ctx->ProjectionMatrixStack.Top->m;
CHECK_DMA_BUFFER(gmesa, 16);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix0,
- ctx->ProjectionMatrix.m[0]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix1,
- ctx->ProjectionMatrix.m[1]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix2,
- ctx->ProjectionMatrix.m[2]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix3,
- ctx->ProjectionMatrix.m[3]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix4,
- ctx->ProjectionMatrix.m[4]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix5,
- ctx->ProjectionMatrix.m[5]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix6,
- ctx->ProjectionMatrix.m[6]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix7,
- ctx->ProjectionMatrix.m[7]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix8,
- ctx->ProjectionMatrix.m[8]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix9,
- ctx->ProjectionMatrix.m[9]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix10,
- ctx->ProjectionMatrix.m[10]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix11,
- ctx->ProjectionMatrix.m[11]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix12,
- ctx->ProjectionMatrix.m[12]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix13,
- ctx->ProjectionMatrix.m[13]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix14,
- ctx->ProjectionMatrix.m[14]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix15,
- ctx->ProjectionMatrix.m[15]);
+ WRITEF(gmesa->buf, ModelViewProjectionMatrix0, m[0]);
+ WRITEF(gmesa->buf, ModelViewProjectionMatrix1, m[1]);
+ WRITEF(gmesa->buf, ModelViewProjectionMatrix2, m[2]);
+ WRITEF(gmesa->buf, ModelViewProjectionMatrix3, m[3]);
+ WRITEF(gmesa->buf, ModelViewProjectionMatrix4, m[4]);
+ WRITEF(gmesa->buf, ModelViewProjectionMatrix5, m[5]);
+ WRITEF(gmesa->buf, ModelViewProjectionMatrix6, m[6]);
+ WRITEF(gmesa->buf, ModelViewProjectionMatrix7, m[7]);
+ WRITEF(gmesa->buf, ModelViewProjectionMatrix8, m[8]);
+ WRITEF(gmesa->buf, ModelViewProjectionMatrix9, m[9]);
+ WRITEF(gmesa->buf, ModelViewProjectionMatrix10, m[10]);
+ WRITEF(gmesa->buf, ModelViewProjectionMatrix11, m[11]);
+ WRITEF(gmesa->buf, ModelViewProjectionMatrix12, m[12]);
+ WRITEF(gmesa->buf, ModelViewProjectionMatrix13, m[13]);
+ WRITEF(gmesa->buf, ModelViewProjectionMatrix14, m[14]);
+ WRITEF(gmesa->buf, ModelViewProjectionMatrix15, m[15]);
break;
case GL_TEXTURE:
+ m = ctx->TextureMatrixStack[0].Top->m;
CHECK_DMA_BUFFER(gmesa, 16);
gmesa->TransformMode |= XM_XformTexture;
- WRITEF(gmesa->buf, TextureMatrix0, ctx->TextureMatrix[0].m[0]);
- WRITEF(gmesa->buf, TextureMatrix1, ctx->TextureMatrix[0].m[1]);
- WRITEF(gmesa->buf, TextureMatrix2, ctx->TextureMatrix[0].m[2]);
- WRITEF(gmesa->buf, TextureMatrix3, ctx->TextureMatrix[0].m[3]);
- WRITEF(gmesa->buf, TextureMatrix4, ctx->TextureMatrix[0].m[4]);
- WRITEF(gmesa->buf, TextureMatrix5, ctx->TextureMatrix[0].m[5]);
- WRITEF(gmesa->buf, TextureMatrix6, ctx->TextureMatrix[0].m[6]);
- WRITEF(gmesa->buf, TextureMatrix7, ctx->TextureMatrix[0].m[7]);
- WRITEF(gmesa->buf, TextureMatrix8, ctx->TextureMatrix[0].m[8]);
- WRITEF(gmesa->buf, TextureMatrix9, ctx->TextureMatrix[0].m[9]);
- WRITEF(gmesa->buf, TextureMatrix10, ctx->TextureMatrix[0].m[10]);
- WRITEF(gmesa->buf, TextureMatrix11, ctx->TextureMatrix[0].m[11]);
- WRITEF(gmesa->buf, TextureMatrix12, ctx->TextureMatrix[0].m[12]);
- WRITEF(gmesa->buf, TextureMatrix13, ctx->TextureMatrix[0].m[13]);
- WRITEF(gmesa->buf, TextureMatrix14, ctx->TextureMatrix[0].m[14]);
- WRITEF(gmesa->buf, TextureMatrix15, ctx->TextureMatrix[0].m[15]);
+ WRITEF(gmesa->buf, TextureMatrix0, m[0]);
+ WRITEF(gmesa->buf, TextureMatrix1, m[1]);
+ WRITEF(gmesa->buf, TextureMatrix2, m[2]);
+ WRITEF(gmesa->buf, TextureMatrix3, m[3]);
+ WRITEF(gmesa->buf, TextureMatrix4, m[4]);
+ WRITEF(gmesa->buf, TextureMatrix5, m[5]);
+ WRITEF(gmesa->buf, TextureMatrix6, m[6]);
+ WRITEF(gmesa->buf, TextureMatrix7, m[7]);
+ WRITEF(gmesa->buf, TextureMatrix8, m[8]);
+ WRITEF(gmesa->buf, TextureMatrix9, m[9]);
+ WRITEF(gmesa->buf, TextureMatrix10, m[10]);
+ WRITEF(gmesa->buf, TextureMatrix11, m[11]);
+ WRITEF(gmesa->buf, TextureMatrix12, m[12]);
+ WRITEF(gmesa->buf, TextureMatrix13, m[13]);
+ WRITEF(gmesa->buf, TextureMatrix14, m[14]);
+ WRITEF(gmesa->buf, TextureMatrix15, m[15]);
break;
default:
@@ -1666,7 +1664,7 @@ void gammaDDUpdateHWState( GLcontext *ctx )
}
-void gammaDDUpdateState( GLcontext *ctx, GLuint new_state )
+static void gammaDDUpdateState( GLcontext *ctx, GLuint new_state )
{
_swrast_InvalidateState( ctx, new_state );
_swsetup_InvalidateState( ctx, new_state );
@@ -1692,7 +1690,8 @@ void gammaDDInitStateFuncs( GLcontext *ctx )
ctx->Driver.Clear = gammaDDClear;
ctx->Driver.ClearIndex = NULL;
ctx->Driver.ClearColor = gammaDDClearColor;
- ctx->Driver.SetDrawBuffer = gammaDDSetDrawBuffer;
+ ctx->Driver.DrawBuffer = gammaDDDrawBuffer;
+ ctx->Driver.ReadBuffer = gammaDDReadBuffer;
ctx->Driver.IndexMask = NULL;
ctx->Driver.ColorMask = gammaDDColorMask;
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_tex.c b/xc/lib/GL/mesa/src/drv/gamma/gamma_tex.c
index 647cc1cd2..638af8cff 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_tex.c
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_tex.c
@@ -1,12 +1,7 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_tex.c,v 1.2 2002/02/26 23:37:33 tsi Exp $ */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <X11/Xarch.h>
#include "glheader.h"
#include "mtypes.h"
-#include "mem.h"
+#include "imports.h"
#include "simple_list.h"
#include "enums.h"
#include "texstore.h"
@@ -21,11 +16,12 @@
/*
* Compute the 'S2.4' lod bias factor from the floating point OpenGL bias.
*/
+#if 0
static GLuint gammaComputeLodBias(GLfloat bias)
{
return bias;
}
-
+#endif
static void gammaSetTexWrapping(gammaTextureObjectPtr t,
GLenum wraps, GLenum wrapt)
@@ -142,7 +138,7 @@ static void gammaTexParameter( GLcontext *ctx, GLenum target,
break;
case GL_TEXTURE_BORDER_COLOR:
- gammaSetTexBorderColor( gmesa, t, tObj->BorderColor );
+ gammaSetTexBorderColor( gmesa, t, tObj->_BorderChan );
break;
case GL_TEXTURE_BASE_LEVEL:
@@ -203,10 +199,12 @@ static void gammaTexEnv( GLcontext *ctx, GLenum target,
break;
case GL_TEXTURE_LOD_BIAS_EXT:
-#if 0 /* !?!?! */
+#if 0 /* ?!?!?! */
{
struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;
gammaTextureObjectPtr t = (gammaTextureObjectPtr) tObj->DriverData;
+ (void) t;
+ /* XXX Looks like there's something missing here */
}
#endif
break;
@@ -216,6 +214,7 @@ static void gammaTexEnv( GLcontext *ctx, GLenum target,
}
}
+#if 0
static void gammaTexImage1D( GLcontext *ctx, GLenum target, GLint level,
GLint internalFormat,
GLint width, GLint border,
@@ -233,7 +232,9 @@ static void gammaTexImage1D( GLcontext *ctx, GLenum target, GLint level,
width, border, format, type,
pixels, pack, texObj, texImage );
}
+#endif
+#if 0
static void gammaTexSubImage1D( GLcontext *ctx,
GLenum target,
GLint level,
@@ -253,6 +254,7 @@ static void gammaTexSubImage1D( GLcontext *ctx,
format, type, pixels, pack, texObj,
texImage);
}
+#endif
static void gammaTexImage2D( GLcontext *ctx, GLenum target, GLint level,
GLint internalFormat,
@@ -326,7 +328,7 @@ static void gammaBindTexture( GLcontext *ctx, GLenum target,
t->TextureFilterMode = TextureFilterModeEnable;
-#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+#ifdef MESA_LITTLE_ENDIAN
t->TextureFormat = (TF_LittleEndian |
#else
t->TextureFormat = (TF_BigEndian |
@@ -341,7 +343,7 @@ static void gammaBindTexture( GLcontext *ctx, GLenum target,
gammaSetTexWrapping( t, tObj->WrapS, tObj->WrapT );
gammaSetTexFilter( gmesa, t, tObj->MinFilter, tObj->MagFilter, bias );
- gammaSetTexBorderColor( gmesa, t, tObj->BorderColor );
+ gammaSetTexBorderColor( gmesa, t, tObj->_BorderChan );
}
}
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_texmem.c b/xc/lib/GL/mesa/src/drv/gamma/gamma_texmem.c
index 191769f54..851e1436d 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_texmem.c
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_texmem.c
@@ -1,7 +1,3 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_texmem.c,v 1.3 2002/09/18 17:11:40 tsi Exp $ */
-
-#include <stdlib.h>
-#include <stdio.h>
#include "glheader.h"
#include "macros.h"
@@ -10,6 +6,7 @@
#include "enums.h"
#include "mm.h"
+#include "glint_dri.h"
#include "gamma_context.h"
#include "gamma_lock.h"
@@ -321,7 +318,7 @@ void gammaPrintLocalLRU( gammaContextPtr gmesa )
void gammaPrintGlobalLRU( gammaContextPtr gmesa )
{
int i, j;
- drm_gamma_tex_region_t *list = gmesa->sarea->texList;
+ GAMMATextureRegionPtr list = gmesa->sarea->texList;
for (i = 0, j = GAMMA_NR_TEX_REGIONS ; i < GAMMA_NR_TEX_REGIONS ; i++) {
fprintf(stderr, "list[%d] age %d next %d prev %d\n",
@@ -337,7 +334,7 @@ void gammaPrintGlobalLRU( gammaContextPtr gmesa )
void gammaResetGlobalLRU( gammaContextPtr gmesa )
{
- drm_gamma_tex_region_t *list = gmesa->sarea->texList;
+ GAMMATextureRegionPtr list = gmesa->sarea->texList;
int sz = 1 << gmesa->gammaScreen->logTextureGranularity;
int i;
@@ -369,7 +366,7 @@ void gammaUpdateTexLRU( gammaContextPtr gmesa, gammaTextureObjectPtr t )
int logsz = gmesa->gammaScreen->logTextureGranularity;
int start = t->MemBlock->ofs >> logsz;
int end = (t->MemBlock->ofs + t->MemBlock->size - 1) >> logsz;
- drm_gamma_tex_region_t *list = gmesa->sarea->texList;
+ GAMMATextureRegionPtr list = gmesa->sarea->texList;
gmesa->texAge = ++gmesa->sarea->texAge;
@@ -502,7 +499,7 @@ void gammaUploadTexImages( gammaContextPtr gmesa, gammaTextureObjectPtr t )
}
ofs = t->MemBlock->ofs;
- t->BufAddr = (char *)(long)(gmesa->LBWindowBase + ofs); /* ??? */
+ t->BufAddr = (char *)(unsigned long)(gmesa->LBWindowBase + ofs); /* ??? */
if (t == gmesa->CurrentTexObj[0])
gmesa->dirty |= GAMMA_UPLOAD_TEX0;
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_texstate.c b/xc/lib/GL/mesa/src/drv/gamma/gamma_texstate.c
index a37f4317f..3591bd24a 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_texstate.c
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_texstate.c
@@ -1,7 +1,3 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_texstate.c,v 1.3 2002/09/18 17:11:40 tsi Exp $ */
-
-#include <stdlib.h>
-#include <stdio.h>
#include "glheader.h"
#include "macros.h"
@@ -151,7 +147,7 @@ static void gammaUpdateTexUnit( GLcontext *ctx, GLuint unit )
/* fprintf(stderr, "%s\n", __FUNCTION__); */
- if (texUnit->_ReallyEnabled == TEXTURE0_2D)
+ if (texUnit->_ReallyEnabled == TEXTURE_2D_BIT)
{
struct gl_texture_object *tObj = texUnit->_Current;
gammaTextureObjectPtr t = (gammaTextureObjectPtr)tObj->DriverData;
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_tris.c b/xc/lib/GL/mesa/src/drv/gamma/gamma_tris.c
index a6e78b405..f03910302 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_tris.c
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_tris.c
@@ -19,15 +19,12 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- * Keith Whitwell, <keithw@valinux.com>
+ * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
+ * Keith Whitwell, <keith@tungstengraphics.com>
*
* 3DLabs Gamma driver.
*/
-#include <stdio.h>
-#include <stdlib.h>
-
#include "gamma_context.h"
#include "gamma_vb.h"
#include "gamma_tris.h"
@@ -154,6 +151,7 @@ gamma_fallback_line( gammaContextPtr gmesa,
}
+#if 0
static void
gamma_fallback_point( gammaContextPtr gmesa,
const gammaVertex *v0 )
@@ -163,6 +161,7 @@ gamma_fallback_point( gammaContextPtr gmesa,
gamma_translate_vertex( ctx, v0, &v[0] );
_swrast_Point( ctx, &v[0] );
}
+#endif
/***********************************************************************
@@ -180,7 +179,7 @@ gamma_fallback_point( gammaContextPtr gmesa,
#define LINE_FALLBACK (0)
#define TRI_FALLBACK (0)
-void gammaChooseRasterState(GLcontext *ctx)
+static void gammaChooseRasterState(GLcontext *ctx)
{
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
GLuint flags = ctx->_TriangleCaps;
@@ -193,7 +192,7 @@ void gammaChooseRasterState(GLcontext *ctx)
else
gmesa->Begin &= ~B_AntiAliasEnable;
- if ( ctx->Texture._ReallyEnabled ) {
+ if ( ctx->Texture.Unit[0]._ReallyEnabled ) {
ind |= GAMMA_RAST_TEX_BIT;
gmesa->Begin |= B_TextureEnable;
} else
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_vb.c b/xc/lib/GL/mesa/src/drv/gamma/gamma_vb.c
index cb8baf807..10907a90c 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_vb.c
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_vb.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_vb.c,v 1.2 2002/02/26 23:37:34 tsi Exp $ */
/*
* Copyright 2001 by Alan Hourihane.
*
@@ -20,15 +19,15 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- * Keith Whitwell, <keithw@valinux.com>
+ * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
+ * Keith Whitwell, <keith@tungstengraphics.com>
*
* 3DLabs Gamma driver.
*/
#include "glheader.h"
#include "mtypes.h"
-#include "mem.h"
+#include "imports.h"
#include "macros.h"
#include "colormac.h"
#include "mmath.h"
@@ -46,7 +45,9 @@
#define GAMMA_RGBA_BIT 0x2
#define GAMMA_XYZW_BIT 0x4
#define GAMMA_PTEX_BIT 0x8
-#define GAMMA_MAX_SETUP 0x10
+#define GAMMA_FOG_BIT 0x10
+#define GAMMA_SPEC_BIT 0x20
+#define GAMMA_MAX_SETUP 0x40
static struct {
void (*emit)( GLcontext *, GLuint, GLuint, void *, GLuint );
@@ -58,12 +59,9 @@ static struct {
GLuint vertex_format;
} setup_tab[GAMMA_MAX_SETUP];
-
-/* Only one vertex format, atm, so no need to give them names:
- */
-#define TINY_VERTEX_FORMAT 0
-#define NOTEX_VERTEX_FORMAT 0
-#define TEX0_VERTEX_FORMAT 0
+#define TINY_VERTEX_FORMAT 1
+#define NOTEX_VERTEX_FORMAT 2
+#define TEX0_VERTEX_FORMAT 3
#define TEX1_VERTEX_FORMAT 0
#define PROJ_TEX1_VERTEX_FORMAT 0
#define TEX2_VERTEX_FORMAT 0
@@ -72,8 +70,8 @@ static struct {
#define DO_XYZW (IND & GAMMA_XYZW_BIT)
#define DO_RGBA (IND & GAMMA_RGBA_BIT)
-#define DO_SPEC 0
-#define DO_FOG 0
+#define DO_SPEC (IND & GAMMA_SPEC_BIT)
+#define DO_FOG (IND & GAMMA_FOG_BIT)
#define DO_TEX0 (IND & GAMMA_TEX0_BIT)
#define DO_TEX1 0
#define DO_TEX2 0
@@ -81,10 +79,11 @@ static struct {
#define DO_PTEX (IND & GAMMA_PTEX_BIT)
#define VERTEX gammaVertex
+#define VERTEX_COLOR gamma_color_t
#define GET_VIEWPORT_MAT() 0
#define GET_TEXSOURCE(n) n
-#define GET_VERTEX_FORMAT() 0
-#define GET_VERTEX_STORE() (GLubyte *)(GAMMA_CONTEXT(ctx)->verts)
+#define GET_VERTEX_FORMAT() GAMMA_CONTEXT(ctx)->vertex_format
+#define GET_VERTEX_STORE() GAMMA_CONTEXT(ctx)->verts
#define GET_VERTEX_STRIDE_SHIFT() GAMMA_CONTEXT(ctx)->vertex_stride_shift
#define INVALIDATE_STORED_VERTICES()
#define GET_UBYTE_COLOR_STORE() &GAMMA_CONTEXT(ctx)->UbyteColor
@@ -93,7 +92,7 @@ static struct {
#define HAVE_HW_VIEWPORT 1
#define HAVE_HW_DIVIDE 1
#define HAVE_RGBA_COLOR 0 /* we're BGRA */
-#define HAVE_TINY_VERTICES 0
+#define HAVE_TINY_VERTICES 1
#define HAVE_NOTEX_VERTICES 1
#define HAVE_TEX0_VERTICES 1
#define HAVE_TEX1_VERTICES 0
@@ -123,11 +122,14 @@ static struct {
* Generate vertex emit and interp functions *
***********************************************************************/
-
#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT)
#define TAG(x) x##_wg
#include "tnl_dd/t_dd_vbtmp.h"
+#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_SPEC_BIT)
+#define TAG(x) x##_wgs
+#include "tnl_dd/t_dd_vbtmp.h"
+
#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_TEX0_BIT)
#define TAG(x) x##_wgt0
#include "tnl_dd/t_dd_vbtmp.h"
@@ -136,83 +138,124 @@ static struct {
#define TAG(x) x##_wgpt0
#include "tnl_dd/t_dd_vbtmp.h"
+#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_SPEC_BIT|GAMMA_TEX0_BIT)
+#define TAG(x) x##_wgst0
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_SPEC_BIT|GAMMA_TEX0_BIT|\
+ GAMMA_PTEX_BIT)
+#define TAG(x) x##_wgspt0
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_FOG_BIT)
+#define TAG(x) x##_wgf
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_SPEC_BIT)
+#define TAG(x) x##_wgfs
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_TEX0_BIT)
+#define TAG(x) x##_wgft0
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_TEX0_BIT|\
+ GAMMA_PTEX_BIT)
+#define TAG(x) x##_wgfpt0
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_SPEC_BIT|\
+ GAMMA_TEX0_BIT)
+#define TAG(x) x##_wgfst0
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_SPEC_BIT|\
+ GAMMA_TEX0_BIT|GAMMA_PTEX_BIT)
+#define TAG(x) x##_wgfspt0
+#include "tnl_dd/t_dd_vbtmp.h"
+
#define IND (GAMMA_TEX0_BIT)
#define TAG(x) x##_t0
#include "tnl_dd/t_dd_vbtmp.h"
+#define IND (GAMMA_FOG_BIT)
+#define TAG(x) x##_f
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (GAMMA_FOG_BIT|GAMMA_TEX0_BIT)
+#define TAG(x) x##_ft0
+#include "tnl_dd/t_dd_vbtmp.h"
+
#define IND (GAMMA_RGBA_BIT)
#define TAG(x) x##_g
#include "tnl_dd/t_dd_vbtmp.h"
+#define IND (GAMMA_RGBA_BIT|GAMMA_SPEC_BIT)
+#define TAG(x) x##_gs
+#include "tnl_dd/t_dd_vbtmp.h"
+
#define IND (GAMMA_RGBA_BIT|GAMMA_TEX0_BIT)
#define TAG(x) x##_gt0
#include "tnl_dd/t_dd_vbtmp.h"
+#define IND (GAMMA_RGBA_BIT|GAMMA_SPEC_BIT|GAMMA_TEX0_BIT)
+#define TAG(x) x##_gst0
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (GAMMA_RGBA_BIT|GAMMA_FOG_BIT)
+#define TAG(x) x##_gf
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_SPEC_BIT)
+#define TAG(x) x##_gfs
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_TEX0_BIT)
+#define TAG(x) x##_gft0
+#include "tnl_dd/t_dd_vbtmp.h"
+#define IND (GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_SPEC_BIT|GAMMA_TEX0_BIT)
+#define TAG(x) x##_gfst0
+#include "tnl_dd/t_dd_vbtmp.h"
static void init_setup_tab( void )
{
init_wg();
+ init_wgs();
init_wgt0();
init_wgpt0();
+ init_wgst0();
+ init_wgspt0();
+ init_wgf();
+ init_wgfs();
+ init_wgft0();
+ init_wgfpt0();
+ init_wgfst0();
+ init_wgfspt0();
init_t0();
+ init_f();
+ init_ft0();
init_g();
+ init_gs();
init_gt0();
+ init_gst0();
+ init_gf();
+ init_gfs();
+ init_gft0();
+ init_gfst0();
}
-
-#if 0
-void gammaPrintSetupFlags(char *msg, GLuint flags )
-{
- fprintf(stderr, "%s(%x): %s%s%s%s%s%s\n",
- msg,
- (int)flags,
- (flags & GAMMA_XYZW_BIT) ? " xyzw," : "",
- (flags & GAMMA_RGBA_BIT) ? " rgba," : "",
- (flags & GAMMA_SPEC_BIT) ? " spec," : "",
- (flags & GAMMA_FOG_BIT) ? " fog," : "",
- (flags & GAMMA_TEX0_BIT) ? " tex-0," : "",
- (flags & GAMMA_TEX1_BIT) ? " tex-1," : "");
-}
-#endif
-
-
void gammaCheckTexSizes( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
gammaContextPtr gmesa = GAMMA_CONTEXT( ctx );
-#if 0
if (!setup_tab[gmesa->SetupIndex].check_tex_sizes(ctx)) {
/* Invalidate stored verts
*/
gmesa->SetupNewInputs = ~0;
gmesa->SetupIndex |= GAMMA_PTEX_BIT;
- if (/*!gmesa->Fallback && */
- !(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
- tnl->Driver.Render.Interp = setup_tab[gmesa->SetupIndex].interp;
- tnl->Driver.Render.CopyPV = setup_tab[gmesa->SetupIndex].copy_pv;
- }
- }
-#endif
-
- if (!setup_tab[gmesa->SetupIndex].check_tex_sizes(ctx)) {
-
- /* Radeon handles projective textures nicely; just have to change
- * up to the new vertex format.
- */
-#if 0
- GLuint ind = gmesa->SetupIndex |= (GAMMA_PTEX_BIT|GAMMA_RGBA_BIT);
-
- if (setup_tab[ind].vertex_format != gmesa->vertex_format) {
- RADEON_STATECHANGE(gmesa, 0);
- gmesa->vertex_format = setup_tab[ind].vertex_format;
- gmesa->vertex_size = setup_tab[ind].vertex_size;
- gmesa->vertex_stride_shift = setup_tab[ind].vertex_stride_shift;
- }
-#endif
-
if (!(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
tnl->Driver.Render.Interp = setup_tab[gmesa->SetupIndex].interp;
tnl->Driver.Render.CopyPV = setup_tab[gmesa->SetupIndex].copy_pv;
@@ -235,24 +278,30 @@ void gammaBuildVertices( GLcontext *ctx,
if (!newinputs)
return;
- if (newinputs & VERT_CLIP) {
- setup_tab[gmesa->SetupIndex].emit( ctx, start, count, v, stride );
+ if (newinputs & VERT_BIT_CLIP) {
+ setup_tab[gmesa->SetupIndex].emit( ctx, start, count, v, stride );
} else {
GLuint ind = 0;
- if (newinputs & VERT_RGBA)
+ if (newinputs & VERT_BIT_COLOR0)
ind |= GAMMA_RGBA_BIT;
-
- if (newinputs & VERT_TEX0)
+
+ if (newinputs & VERT_BIT_COLOR1)
+ ind |= GAMMA_SPEC_BIT;
+
+ if (newinputs & VERT_BIT_TEX0)
ind |= GAMMA_TEX0_BIT;
+ if (newinputs & VERT_BIT_FOG)
+ ind |= GAMMA_FOG_BIT;
+
if (gmesa->SetupIndex & GAMMA_PTEX_BIT)
ind = ~0;
ind &= gmesa->SetupIndex;
if (ind) {
- setup_tab[ind].emit( ctx, start, count, v, stride );
+ setup_tab[ind].emit( ctx, start, count, v, stride );
}
}
}
@@ -263,14 +312,26 @@ void gammaChooseVertexState( GLcontext *ctx )
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint ind = GAMMA_XYZW_BIT|GAMMA_RGBA_BIT;
- if (ctx->Texture._ReallyEnabled) {
+ if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
+ ind |= GAMMA_SPEC_BIT;
+
+ if (ctx->Fog.Enabled)
+ ind |= GAMMA_FOG_BIT;
+
+ if (ctx->Texture.Unit[0]._ReallyEnabled) {
_tnl_need_projected_coords( ctx, GL_FALSE );
ind |= GAMMA_TEX0_BIT;
} else
- _tnl_need_projected_coords( ctx, GL_TRUE );
+ _tnl_need_projected_coords( ctx, GL_FALSE );
gmesa->SetupIndex = ind;
+ if (setup_tab[ind].vertex_format != gmesa->vertex_format) {
+ gmesa->vertex_format = setup_tab[ind].vertex_format;
+ gmesa->vertex_size = setup_tab[ind].vertex_size;
+ gmesa->vertex_stride_shift = setup_tab[ind].vertex_stride_shift;
+ }
+
if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) {
tnl->Driver.Render.Interp = gamma_interp_extras;
tnl->Driver.Render.CopyPV = gamma_copy_pv_extras;
diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c b/xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c
index 9d85c9583..ac63fd12a 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c
+++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c
@@ -20,7 +20,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
+ * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
*
* 3DLabs Gamma driver
*/
@@ -74,8 +74,7 @@ gammaDestroyContext(__DRIcontextPrivate *driContextPriv)
static GLboolean
-gammaCreateBuffer( Display *dpy,
- __DRIscreenPrivate *driScrnPriv,
+gammaCreateBuffer( __DRIscreenPrivate *driScrnPriv,
__DRIdrawablePrivate *driDrawPriv,
const __GLcontextModes *mesaVis,
GLboolean isPixmap )
@@ -103,11 +102,8 @@ gammaDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
}
static void
-gammaSwapBuffers(Display *dpy, void *drawablePrivate)
+gammaSwapBuffers( __DRIdrawablePrivate *dPriv )
{
- __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
- (void) dpy;
-
if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
gammaContextPtr gmesa;
__DRIscreenPrivate *driScrnPriv;
@@ -117,6 +113,8 @@ gammaSwapBuffers(Display *dpy, void *drawablePrivate)
ctx = gmesa->glCtx;
driScrnPriv = gmesa->driScreen;
+ _mesa_notifySwapBuffers(ctx);
+
VALIDATE_DRAWABLE_INFO(gmesa);
/* Flush any partially filled buffers */
diff --git a/xc/lib/GL/mesa/src/drv/i810/Imakefile b/xc/lib/GL/mesa/src/drv/i810/Imakefile
index 9548f9e15..4d06334df 100644
--- a/xc/lib/GL/mesa/src/drv/i810/Imakefile
+++ b/xc/lib/GL/mesa/src/drv/i810/Imakefile
@@ -32,16 +32,7 @@ XCOMM $XFree86: xc/lib/GL/mesa/src/drv/i810/Imakefile,v 1.22 2002/09/10 00:39:37
#include "../../SPARC/Imakefile.inc"
#endif
-#ifndef HaveDrmCommand
-#define HaveDrmCommand NO
-#endif
-
-#if HaveDrmCommand
-DRMCOMMAND_DEFINES = -DHAVE_DRM_COMMAND
-#endif
-
- DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(MESA_ASM_DEFINES) \
- $(DRMCOMMAND_DEFINES)
+ DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(MESA_ASM_DEFINES)
INCLUDES = $(X_INCLUDES) $(MESA_INCLUDES) $(DRI_INCLUDES)
@@ -64,7 +55,7 @@ DRMCOMMAND_DEFINES = -DHAVE_DRM_COMMAND
OBJS = $(LOOBJS) $(DRIOBJS) $(DRMOBJS) $(COREMESAOBJS) \
$(MESA_ASM_OBJS) $(COMMONOBJS) $(I810OBJS) $(HIOBJS)
-REQUIREDLIBS = MathLibrary $(LDPRELIB) $(GLXLIB)
+REQUIREDLIBS = MathLibrary $(LDPRELIB) $(GLXLIB) $(XONLYLIB)
#include <Library.tmpl>
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810context.c b/xc/lib/GL/mesa/src/drv/i810/i810context.c
index 0d5ff8812..164396fb4 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810context.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810context.c
@@ -28,7 +28,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/*
* Authors:
- * Keith Whitwell <keithw@precisioninsight.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*
*/
@@ -38,7 +38,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "matrix.h"
#include "simple_list.h"
#include "extensions.h"
-#include "mem.h"
+#include "imports.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
@@ -57,9 +57,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "i810vb.h"
#include "i810ioctl.h"
-#include <X11/Xlibint.h>
-#include <stdio.h>
-
static const GLubyte *i810GetString( GLcontext *ctx, GLenum name )
{
@@ -67,14 +64,13 @@ static const GLubyte *i810GetString( GLcontext *ctx, GLenum name )
case GL_VENDOR:
return (GLubyte *)"Keith Whitwell";
case GL_RENDERER:
- return (GLubyte *)"Mesa DRI I810 20020221";
+ return (GLubyte *)"Mesa DRI I810 20021125";
default:
return 0;
}
}
-static void i810BufferSize(GLframebuffer *buffer,
- GLuint *width, GLuint *height)
+static void i810BufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
{
GET_CURRENT_CONTEXT(ctx);
i810ContextPtr imesa = I810_CONTEXT(ctx);
@@ -118,7 +114,7 @@ static const struct gl_pipeline_stage *i810_pipeline[] = {
GLboolean
-i810CreateContext( Display *dpy, const __GLcontextModes *mesaVis,
+i810CreateContext( const __GLcontextModes *mesaVis,
__DRIcontextPrivate *driContextPriv,
void *sharedContextPrivate )
{
@@ -126,7 +122,7 @@ i810CreateContext( Display *dpy, const __GLcontextModes *mesaVis,
i810ContextPtr imesa;
__DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
i810ScreenPrivate *i810Screen = (i810ScreenPrivate *)sPriv->private;
- drm_i810_sarea_t *saPriv = (drm_i810_sarea_t *)
+ I810SAREAPtr saPriv = (I810SAREAPtr)
(((GLubyte *)sPriv->pSAREA) + i810Screen->sarea_priv_offset);
/* Allocate i810 context */
@@ -140,7 +136,7 @@ i810CreateContext( Display *dpy, const __GLcontextModes *mesaVis,
shareCtx = ((i810ContextPtr) sharedContextPrivate)->glCtx;
else
shareCtx = NULL;
- imesa->glCtx = _mesa_create_context(mesaVis, shareCtx, imesa, GL_TRUE);
+ imesa->glCtx = _mesa_create_context(mesaVis, shareCtx, (void*) imesa, GL_TRUE);
if (!imesa->glCtx) {
FREE(imesa);
return GL_FALSE;
@@ -175,6 +171,7 @@ i810CreateContext( Display *dpy, const __GLcontextModes *mesaVis,
ctx->Const.PointSizeGranularity = 1.0;
ctx->Driver.GetBufferSize = i810BufferSize;
+ ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
ctx->Driver.GetString = i810GetString;
/* Who owns who?
@@ -201,7 +198,6 @@ i810CreateContext( Display *dpy, const __GLcontextModes *mesaVis,
/* Dri stuff
*/
- imesa->display = dpy;
imesa->hHWContext = driContextPriv->hHWContext;
imesa->driFd = sPriv->fd;
imesa->driHwLock = &sPriv->pSAREA->lock;
@@ -299,17 +295,17 @@ void i810XMesaSetBackClipRects( i810ContextPtr imesa )
static void i810XMesaWindowMoved( i810ContextPtr imesa )
{
- switch (imesa->glCtx->Color.DriverDrawBuffer) {
- case GL_FRONT_LEFT:
+ switch (imesa->glCtx->Color._DrawDestMask) {
+ case FRONT_LEFT_BIT:
i810XMesaSetFrontClipRects( imesa );
break;
- case GL_BACK_LEFT:
+ case BACK_LEFT_BIT:
i810XMesaSetBackClipRects( imesa );
break;
default:
- break;
+ /* glDrawBuffer(GL_NONE or GL_FRONT_AND_BACK): software fallback */
+ i810XMesaSetFrontClipRects( imesa );
}
-
}
@@ -335,14 +331,14 @@ i810MakeCurrent(__DRIcontextPrivate *driContextPriv,
if (driContextPriv) {
i810ContextPtr imesa = (i810ContextPtr) driContextPriv->driverPrivate;
- _mesa_make_current2(imesa->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate);
-
/* Shouldn't the readbuffer be stored also?
*/
imesa->driDrawable = driDrawPriv;
+ _mesa_make_current2(imesa->glCtx,
+ (GLframebuffer *) driDrawPriv->driverPrivate,
+ (GLframebuffer *) driReadPriv->driverPrivate);
+
/* Are these necessary?
*/
i810XMesaWindowMoved( imesa );
@@ -362,7 +358,7 @@ void i810GetLock( i810ContextPtr imesa, GLuint flags )
{
__DRIdrawablePrivate *dPriv = imesa->driDrawable;
__DRIscreenPrivate *sPriv = imesa->driScreen;
- drm_i810_sarea_t *sarea = imesa->sarea;
+ I810SAREAPtr sarea = imesa->sarea;
int me = imesa->hHWContext;
drmGetLock(imesa->driFd, imesa->hHWContext, flags);
@@ -372,7 +368,7 @@ void i810GetLock( i810ContextPtr 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(imesa->display, sPriv, dPriv);
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
/* If we lost context, need to dump all registers to hardware.
@@ -423,18 +419,15 @@ void i810GetLock( i810ContextPtr imesa, GLuint flags )
void
-i810SwapBuffers(Display *dpy, void *drawablePrivate)
+i810SwapBuffers( __DRIdrawablePrivate *dPriv )
{
- __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
- (void) dpy;
-
if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
i810ContextPtr imesa;
GLcontext *ctx;
imesa = (i810ContextPtr) dPriv->driContextPriv->driverPrivate;
ctx = imesa->glCtx;
if (ctx->Visual.doubleBufferMode) {
- _mesa_swapbuffers( ctx ); /* flush pending rendering comands */
+ _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */
if ( imesa->doPageFlip ) {
i810PageFlip( dPriv );
}
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810context.h b/xc/lib/GL/mesa/src/drv/i810/i810context.h
index 0a40c374f..347a4ef20 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810context.h
+++ b/xc/lib/GL/mesa/src/drv/i810/i810context.h
@@ -30,10 +30,7 @@ typedef struct i810_context_t i810Context;
typedef struct i810_context_t *i810ContextPtr;
typedef struct i810_texture_object_t *i810TextureObjectPtr;
-#include <X11/Xlibint.h>
-
#include "mtypes.h"
-#include "drm.h"
#include "mm.h"
#include "i810screen.h"
@@ -134,7 +131,7 @@ struct i810_context_t {
GLuint BufferSetup[I810_DEST_SETUP_SIZE];
int vertex_size;
int vertex_stride_shift;
- GLint lastStamp;
+ unsigned int lastStamp;
GLboolean stipple_in_hw;
GLenum TexEnvImageFmt[2];
@@ -170,18 +167,17 @@ struct i810_context_t {
int dirtyAge;
GLboolean scissor;
- drm_clip_rect_t draw_rect;
- drm_clip_rect_t scissor_rect;
+ XF86DRIClipRectRec draw_rect;
+ XF86DRIClipRectRec scissor_rect;
drmContext hHWContext;
drmLock *driHwLock;
int driFd;
- Display *display;
__DRIdrawablePrivate *driDrawable;
__DRIscreenPrivate *driScreen;
i810ScreenPrivate *i810Screen;
- drm_i810_sarea_t *sarea;
+ I810SAREAPtr sarea;
};
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810ioctl.c b/xc/lib/GL/mesa/src/drv/i810/i810ioctl.c
index 4ac686f03..49aa4ffec 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810ioctl.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810ioctl.c
@@ -1,36 +1,36 @@
/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810ioctl.c,v 1.6 2002/02/22 21:33:03 dawes Exp $ */
-#include <stdio.h>
-#include <unistd.h>
+#include <unistd.h> /* for usleep() */
#include "glheader.h"
#include "mtypes.h"
#include "macros.h"
#include "dd.h"
#include "swrast/swrast.h"
-
#include "mm.h"
+
+#include "i810screen.h"
+#include "i810_dri.h"
+
#include "i810context.h"
#include "i810ioctl.h"
#include "i810state.h"
-#include "drm.h"
-#include <sys/ioctl.h>
-
static drmBufPtr i810_get_buffer_ioctl( i810ContextPtr imesa )
{
- drm_i810_dma_t dma;
+ drmI810DMA dma;
drmBufPtr buf;
int retcode, i = 0;
while (1) {
- retcode = ioctl(imesa->driFd, DRM_IOCTL_I810_GETBUF, &dma);
+ retcode = drmCommandWriteRead(imesa->driFd, DRM_I810_GETBUF,
+ &dma, sizeof(drmI810DMA));
if (dma.granted == 1 && retcode == 0)
break;
if (++i > 1000) {
- ioctl(imesa->driFd, DRM_IOCTL_I810_FLUSH);
+ drmCommandNone(imesa->driFd, DRM_I810_FLUSH);
i = 0;
}
}
@@ -54,7 +54,7 @@ static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
i810ContextPtr imesa = I810_CONTEXT( ctx );
__DRIdrawablePrivate *dPriv = imesa->driDrawable;
const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
- drm_i810_clear_t clear;
+ drmI810Clear clear;
int i;
clear.flags = 0;
@@ -90,8 +90,8 @@ static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
for (i = 0 ; i < imesa->numClipRects ; )
{
int nr = MIN2(i + I810_NR_SAREA_CLIPRECTS, imesa->numClipRects);
- XF86DRIClipRectRec *box = imesa->pClipRects;
- drm_clip_rect_t *b = imesa->sarea->boxes;
+ XF86DRIClipRectPtr box = imesa->pClipRects;
+ XF86DRIClipRectPtr b = imesa->sarea->boxes;
int n = 0;
if (!all) {
@@ -117,13 +117,14 @@ static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
} else {
for ( ; i < nr ; i++) {
- *b++ = *(drm_clip_rect_t *)&box[i];
+ *b++ = *(XF86DRIClipRectPtr)&box[i];
n++;
}
}
imesa->sarea->nbox = n;
- ioctl(imesa->driFd, DRM_IOCTL_I810_CLEAR, &clear);
+ drmCommandWrite(imesa->driFd, DRM_I810_CLEAR,
+ &clear, sizeof(drmI810Clear));
}
UNLOCK_HARDWARE( imesa );
@@ -168,7 +169,7 @@ void i810CopyBuffer( const __DRIdrawablePrivate *dPriv )
for ( ; i < nr ; i++)
*b++ = pbox[i];
- ioctl(imesa->driFd, DRM_IOCTL_I810_SWAP);
+ drmCommandNone(imesa->driFd, DRM_I810_SWAP);
}
tmp = GET_ENQUEUE_AGE(imesa);
@@ -219,14 +220,14 @@ void i810WaitAgeLocked( i810ContextPtr imesa, int age )
int i = 0, j;
while (++i < 5000) {
- ioctl(imesa->driFd, DRM_IOCTL_I810_GETAGE);
+ drmCommandNone(imesa->driFd, DRM_I810_GETAGE);
if (GET_DISPATCH_AGE(imesa) >= age)
return;
for (j = 0 ; j < 1000 ; j++)
;
}
- ioctl(imesa->driFd, DRM_IOCTL_I810_FLUSH);
+ drmCommandNone(imesa->driFd, DRM_I810_FLUSH);
}
@@ -235,7 +236,7 @@ void i810WaitAge( i810ContextPtr imesa, int age )
int i = 0, j;
while (++i < 5000) {
- ioctl(imesa->driFd, DRM_IOCTL_I810_GETAGE);
+ drmCommandNone(imesa->driFd, DRM_I810_GETAGE);
if (GET_DISPATCH_AGE(imesa) >= age)
return;
for (j = 0 ; j < 1000 ; j++)
@@ -244,23 +245,23 @@ void i810WaitAge( i810ContextPtr imesa, int age )
i = 0;
while (++i < 1000) {
- ioctl(imesa->driFd, DRM_IOCTL_I810_GETAGE);
+ drmCommandNone(imesa->driFd, DRM_I810_GETAGE);
if (GET_DISPATCH_AGE(imesa) >= age)
return;
usleep(1000);
}
LOCK_HARDWARE(imesa);
- ioctl(imesa->driFd, DRM_IOCTL_I810_FLUSH);
+ drmCommandNone(imesa->driFd, DRM_I810_FLUSH);
UNLOCK_HARDWARE(imesa);
}
-static int intersect_rect( drm_clip_rect_t *out,
- drm_clip_rect_t *a,
- drm_clip_rect_t *b )
+static int intersect_rect( XF86DRIClipRectPtr out,
+ XF86DRIClipRectPtr a,
+ XF86DRIClipRectPtr b )
{
*out = *a;
if (b->x1 > out->x1) out->x1 = b->x1;
@@ -277,7 +278,7 @@ static int intersect_rect( drm_clip_rect_t *out,
static void emit_state( i810ContextPtr imesa )
{
GLuint dirty = imesa->dirty;
- drm_i810_sarea_t *sarea = imesa->sarea;
+ I810SAREAPtr sarea = imesa->sarea;
if (dirty & I810_UPLOAD_BUFFERS) {
memcpy( sarea->BufferState, imesa->BufferSetup,
@@ -326,11 +327,11 @@ static void age_imesa( i810ContextPtr imesa, int age )
void i810FlushPrimsLocked( i810ContextPtr imesa )
{
- drm_clip_rect_t *pbox = (drm_clip_rect_t *)imesa->pClipRects;
+ XF86DRIClipRectPtr pbox = (XF86DRIClipRectPtr)imesa->pClipRects;
int nbox = imesa->numClipRects;
drmBufPtr buffer = imesa->vertex_buffer;
- drm_i810_sarea_t *sarea = imesa->sarea;
- drm_i810_vertex_t vertex;
+ I810SAREAPtr sarea = imesa->sarea;
+ drmI810Vertex vertex;
int i;
if (imesa->dirty)
@@ -356,7 +357,8 @@ void i810FlushPrimsLocked( i810ContextPtr imesa )
sarea->nbox = nbox;
vertex.discard = 1;
- ioctl(imesa->driFd, DRM_IOCTL_I810_VERTEX, &vertex);
+ drmCommandWrite(imesa->driFd, DRM_I810_VERTEX,
+ &vertex, sizeof(drmI810Vertex));
age_imesa(imesa, sarea->last_enqueue);
}
else
@@ -364,7 +366,7 @@ void i810FlushPrimsLocked( i810ContextPtr imesa )
for (i = 0 ; i < nbox ; )
{
int nr = MIN2(i + I810_NR_SAREA_CLIPRECTS, nbox);
- drm_clip_rect_t *b = sarea->boxes;
+ XF86DRIClipRectPtr b = sarea->boxes;
if (imesa->scissor) {
sarea->nbox = 0;
@@ -402,7 +404,8 @@ void i810FlushPrimsLocked( i810ContextPtr imesa )
if (nr == nbox)
vertex.discard = 1;
- ioctl(imesa->driFd, DRM_IOCTL_I810_VERTEX, &vertex);
+ drmCommandWrite(imesa->driFd, DRM_I810_VERTEX,
+ &vertex, sizeof(drmI810Vertex));
age_imesa(imesa, imesa->sarea->last_enqueue);
}
}
@@ -447,7 +450,7 @@ void i810FlushPrims( i810ContextPtr imesa )
int i810_check_copy(int fd)
{
- return(ioctl(fd, DRM_IOCTL_I810_DOCOPY));
+ return(drmCommandNone(fd, DRM_I810_DOCOPY));
}
static void i810Flush( GLcontext *ctx )
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810render.c b/xc/lib/GL/mesa/src/drv/i810/i810render.c
index fba9b24d0..37d05069e 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810render.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810render.c
@@ -1,5 +1,3 @@
-/* $Id: i810render.c,v 1.1.1.1 2002/10/22 13:00:16 alanh Exp $ */
-
/*
* Intel i810 DRI driver for Mesa 3.5
*
@@ -24,7 +22,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Author:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
@@ -36,12 +34,15 @@
#include "glheader.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mtypes.h"
#include "mmath.h"
#include "tnl/t_context.h"
+#include "i810screen.h"
+#include "i810_dri.h"
+
#include "i810context.h"
#include "i810tris.h"
#include "i810state.h"
@@ -105,7 +106,7 @@ static void VERT_FALLBACK( GLcontext *ctx,
tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 );
tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start,
count, flags );
- I810_CONTEXT(ctx)->SetupNewInputs = VERT_CLIP;
+ I810_CONTEXT(ctx)->SetupNewInputs = VERT_BIT_CLIP;
}
@@ -150,7 +151,7 @@ static GLboolean i810_run_render( GLcontext *ctx,
return GL_TRUE;
}
- imesa->SetupNewInputs = VERT_CLIP;
+ imesa->SetupNewInputs = VERT_BIT_CLIP;
tnl->Driver.Render.Start( ctx );
@@ -171,20 +172,20 @@ static GLboolean i810_run_render( GLcontext *ctx,
static void i810_check_render( GLcontext *ctx, struct gl_pipeline_stage *stage )
{
- GLuint inputs = VERT_CLIP|VERT_RGBA;
+ GLuint inputs = VERT_BIT_CLIP | VERT_BIT_COLOR0;
if (ctx->RenderMode == GL_RENDER) {
if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
- inputs |= VERT_SPEC_RGB;
+ inputs |= VERT_BIT_COLOR1;
if (ctx->Texture.Unit[0]._ReallyEnabled)
- inputs |= VERT_TEX(0);
+ inputs |= VERT_BIT_TEX0;
if (ctx->Texture.Unit[1]._ReallyEnabled)
- inputs |= VERT_TEX(1);
+ inputs |= VERT_BIT_TEX1;
if (ctx->Fog.Enabled)
- inputs |= VERT_FOG_COORD;
+ inputs |= VERT_BIT_FOG;
}
stage->inputs = inputs;
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810screen.c b/xc/lib/GL/mesa/src/drv/i810/i810screen.c
index adf487b98..d3f932522 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810screen.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810screen.c
@@ -24,31 +24,29 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810screen.c,v 1.1 2002/02/22 21:33:04 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c,v 1.9 2000/12/07 20:26:06 dawes Exp $ */
/*
* Authors:
- * Keith Whitwell <keithw@precisioninsight.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*
*/
-#include <X11/Xlibint.h>
-#include <stdio.h>
-
#include "glheader.h"
#include "context.h"
#include "matrix.h"
#include "simple_list.h"
+#include "i810screen.h"
+#include "i810_dri.h"
+
#include "i810state.h"
#include "i810tex.h"
#include "i810span.h"
#include "i810tris.h"
#include "i810ioctl.h"
-#include "i810_dri.h"
-
/* static int i810_malloc_proxy_buf(drmBufMapPtr buffers) */
@@ -89,15 +87,12 @@ i810InitDriver(__DRIscreenPrivate *sPriv)
i810ScreenPrivate *i810Screen;
I810DRIPtr gDRIPriv = (I810DRIPtr)sPriv->pDevPriv;
- /* Check the DRI version */
- {
- int major, minor, patch;
- if (XF86DRIQueryVersion(sPriv->display, &major, &minor, &patch)) {
- if (major != 4 || minor < 0) {
- __driUtilMessage("i810 DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch);
- return GL_FALSE;
- }
- }
+ /* Check the DRI externsion version */
+ if ( sPriv->driMajor != 4 || sPriv->driMinor < 0 ) {
+ __driUtilMessage( "i810 DRI driver expected DRI version 4.0.x "
+ "but got version %d.%d.%d",
+ sPriv->driMajor, sPriv->driMinor, sPriv->driPatch );
+ return GL_FALSE;
}
/* Check that the DDX driver version is compatible */
@@ -216,8 +211,7 @@ i810DestroyScreen(__DRIscreenPrivate *sPriv)
static GLboolean
-i810CreateBuffer( Display *dpy,
- __DRIscreenPrivate *driScrnPriv,
+i810CreateBuffer( __DRIscreenPrivate *driScrnPriv,
__DRIdrawablePrivate *driDrawPriv,
const __GLcontextModes *mesaVis,
GLboolean isPixmap )
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810screen.h b/xc/lib/GL/mesa/src/drv/i810/i810screen.h
index 26e0976a8..4625bc5e9 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810screen.h
+++ b/xc/lib/GL/mesa/src/drv/i810/i810screen.h
@@ -27,7 +27,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/*
* Authors:
- * Keith Whitwell <keithw@precisioninsight.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*
*/
@@ -78,7 +78,7 @@ typedef struct {
extern GLboolean
-i810CreateContext( Display *dpy, const __GLcontextModes *mesaVis,
+i810CreateContext( const __GLcontextModes *mesaVis,
__DRIcontextPrivate *driContextPriv,
void *sharedContextPrivate );
@@ -94,6 +94,6 @@ i810MakeCurrent(__DRIcontextPrivate *driContextPriv,
__DRIdrawablePrivate *driReadPriv);
extern void
-i810SwapBuffers(Display *dpy, void *drawablePrivate);
+i810SwapBuffers(__DRIdrawablePrivate *driDrawPriv);
#endif
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810span.c b/xc/lib/GL/mesa/src/drv/i810/i810span.c
index 6971eb145..15ba0a8ef 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810span.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810span.c
@@ -1,10 +1,15 @@
#include "glheader.h"
#include "macros.h"
#include "mtypes.h"
+
+#include "i810screen.h"
+#include "i810_dri.h"
+
#include "i810span.h"
#include "i810ioctl.h"
#include "swrast/swrast.h"
+
#define DBG 0
#define LOCAL_VARS \
@@ -111,15 +116,23 @@ do { \
#include "depthtmp.h"
-static void i810SetReadBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
- GLenum mode )
+/*
+ * This function is called to specify which buffer to read and write
+ * for software rasterization (swrast) fallbacks. This doesn't necessarily
+ * correspond to glDrawBuffer() or glReadBuffer() calls.
+ */
+static void i810SetBuffer(GLcontext *ctx, GLframebuffer *buffer,
+ GLuint bufferBit )
{
i810ContextPtr imesa = I810_CONTEXT(ctx);
+ (void) buffer;
- if (mode == GL_FRONT_LEFT) {
+ if (bufferBit == FRONT_LEFT_BIT) {
+ imesa->drawMap = (char *)imesa->driScreen->pFB;
imesa->readMap = (char *)imesa->driScreen->pFB;
}
- else if (mode == GL_BACK_LEFT) {
+ else if (bufferBit == BACK_LEFT_BIT) {
+ imesa->drawMap = imesa->i810Screen->back.map;
imesa->readMap = imesa->i810Screen->back.map;
}
else {
@@ -132,7 +145,7 @@ void i810InitSpanFuncs( GLcontext *ctx )
{
struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
- swdd->SetReadBuffer = i810SetReadBuffer;
+ swdd->SetBuffer = i810SetBuffer;
swdd->WriteRGBASpan = i810WriteRGBASpan_565;
swdd->WriteRGBSpan = i810WriteRGBSpan_565;
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810state.c b/xc/lib/GL/mesa/src/drv/i810/i810state.c
index 4ff952f36..954a9e1b2 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810state.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810state.c
@@ -1,6 +1,3 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810state.c,v 1.8 2002/09/10 00:39:37 dawes Exp $ */
-
-#include <stdio.h>
#include "glheader.h"
#include "context.h"
@@ -9,6 +6,10 @@
#include "dd.h"
#include "mm.h"
+
+#include "i810screen.h"
+#include "i810_dri.h"
+
#include "i810context.h"
#include "i810state.h"
#include "i810tex.h"
@@ -39,10 +40,13 @@ static __inline__ GLuint i810PackColor(GLuint format,
}
-static void i810AlphaFunc(GLcontext *ctx, GLenum func, GLchan ref)
+static void i810AlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
{
i810ContextPtr imesa = I810_CONTEXT(ctx);
GLuint a = (ZA_UPDATE_ALPHAFUNC|ZA_UPDATE_ALPHAREF);
+ GLubyte refByte;
+
+ CLAMPED_FLOAT_TO_UBYTE(refByte, ref);
switch (ctx->Color.AlphaFunc) {
case GL_NEVER: a |= ZA_ALPHA_NEVER; break;
@@ -56,7 +60,7 @@ static void i810AlphaFunc(GLcontext *ctx, GLenum func, GLchan ref)
default: return;
}
- a |= ((ref & 0xfc) << ZA_ALPHAREF_SHIFT);
+ a |= ((refByte & 0xfc) << ZA_ALPHAREF_SHIFT);
I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
imesa->Setup[I810_CTXREG_ZA] &= ~(ZA_ALPHA_MASK|ZA_ALPHAREF_MASK);
@@ -272,45 +276,59 @@ static void i810RenderMode( GLcontext *ctx, GLenum mode )
}
-static void i810SetDrawBuffer(GLcontext *ctx, GLenum mode )
+static void i810DrawBuffer(GLcontext *ctx, GLenum mode )
{
i810ContextPtr imesa = I810_CONTEXT(ctx);
- if (mode == GL_FRONT_LEFT)
- {
+ /*
+ * _DrawDestMask is easier to cope with than <mode>.
+ */
+ switch ( ctx->Color._DrawDestMask ) {
+ case FRONT_LEFT_BIT:
I810_FIREVERTICES(imesa);
I810_STATECHANGE(imesa, I810_UPLOAD_BUFFERS);
imesa->BufferSetup[I810_DESTREG_DI1] = (imesa->i810Screen->fbOffset |
imesa->i810Screen->backPitchBits);
- imesa->drawMap = (char *)imesa->driScreen->pFB;
- imesa->readMap = (char *)imesa->driScreen->pFB;
i810XMesaSetFrontClipRects( imesa );
FALLBACK( imesa, I810_FALLBACK_DRAW_BUFFER, GL_FALSE );
- }
- else if (mode == GL_BACK_LEFT)
- {
+ break;
+ case BACK_LEFT_BIT:
I810_FIREVERTICES(imesa);
I810_STATECHANGE(imesa, I810_UPLOAD_BUFFERS);
imesa->BufferSetup[I810_DESTREG_DI1] = (imesa->i810Screen->backOffset |
imesa->i810Screen->backPitchBits);
- imesa->drawMap = imesa->i810Screen->back.map;
- imesa->readMap = imesa->i810Screen->back.map;
i810XMesaSetBackClipRects( imesa );
FALLBACK( imesa, I810_FALLBACK_DRAW_BUFFER, GL_FALSE );
- }
- else {
+ break;
+ default:
+ /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
FALLBACK( imesa, I810_FALLBACK_DRAW_BUFFER, GL_TRUE );
+ return;
}
+
+ /* We want to update the s/w rast state too so that r200SetBuffer()
+ * gets called.
+ */
+ _swrast_DrawBuffer(ctx, mode);
}
+static void i810ReadBuffer(GLcontext *ctx, GLenum mode )
+{
+ /* XXX anything? */
+}
+
-static void i810ClearColor(GLcontext *ctx, const GLchan color[4] )
+static void i810ClearColor(GLcontext *ctx, const GLfloat color[4] )
{
i810ContextPtr imesa = I810_CONTEXT(ctx);
+ GLubyte c[4];
+ CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
+ CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]);
imesa->ClearColor = i810PackColor( imesa->i810Screen->fbFormat,
- color[0], color[1],
- color[2], color[3] );
+ c[0], c[1], c[2], c[3] );
}
@@ -893,12 +911,14 @@ void i810InitState( GLcontext *ctx )
memset(imesa->BufferSetup, 0, sizeof(imesa->BufferSetup));
imesa->BufferSetup[I810_DESTREG_DI0] = CMD_OP_DESTBUFFER_INFO;
- if (imesa->glCtx->Color.DriverDrawBuffer == GL_BACK_LEFT) {
+ if (imesa->glCtx->Visual.doubleBufferMode) {
+ /* use back buffer by default */
imesa->drawMap = i810Screen->back.map;
imesa->readMap = i810Screen->back.map;
imesa->BufferSetup[I810_DESTREG_DI1] = (i810Screen->backOffset |
i810Screen->backPitchBits);
} else {
+ /* use front buffer by default */
imesa->drawMap = (char *)imesa->driScreen->pFB;
imesa->readMap = (char *)imesa->driScreen->pFB;
imesa->BufferSetup[I810_DESTREG_DI1] = (i810Screen->fbOffset |
@@ -950,7 +970,8 @@ void i810InitStateFuncs(GLcontext *ctx)
ctx->Driver.PolygonStipple = i810PolygonStipple;
ctx->Driver.RenderMode = i810RenderMode;
ctx->Driver.Scissor = i810Scissor;
- ctx->Driver.SetDrawBuffer = i810SetDrawBuffer;
+ ctx->Driver.DrawBuffer = i810DrawBuffer;
+ ctx->Driver.ReadBuffer = i810ReadBuffer;
ctx->Driver.ShadeModel = i810ShadeModel;
ctx->Driver.DepthRange = i810DepthRange;
ctx->Driver.Viewport = i810Viewport;
@@ -969,7 +990,6 @@ void i810InitStateFuncs(GLcontext *ctx)
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:
*/
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810tex.c b/xc/lib/GL/mesa/src/drv/i810/i810tex.c
index 59e4671fd..6f0de817d 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810tex.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810tex.c
@@ -23,12 +23,9 @@
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810tex.c,v 1.8 2002/02/22 21:33:04 dawes Exp $ */
-#include <stdlib.h>
-#include <stdio.h>
-
#include "glheader.h"
#include "mtypes.h"
-#include "mem.h"
+#include "imports.h"
#include "simple_list.h"
#include "enums.h"
#include "texstore.h"
@@ -36,6 +33,10 @@
#include "swrast/swrast.h"
#include "mm.h"
+
+#include "i810screen.h"
+#include "i810_dri.h"
+
#include "i810context.h"
#include "i810tex.h"
#include "i810state.h"
@@ -175,7 +176,7 @@ static void i810TexParameter( GLcontext *ctx, GLenum target,
break;
case GL_TEXTURE_BORDER_COLOR:
- i810SetTexBorderColor( t, tObj->BorderColor );
+ i810SetTexBorderColor( t, tObj->_BorderChan );
break;
case GL_TEXTURE_BASE_LEVEL:
@@ -367,7 +368,7 @@ static void i810BindTexture( GLcontext *ctx, GLenum target,
i810SetTexWrapping( t, tObj->WrapS, tObj->WrapT );
i810SetTexFilter( imesa, t, tObj->MinFilter, tObj->MagFilter, bias );
- i810SetTexBorderColor( t, tObj->BorderColor );
+ i810SetTexBorderColor( t, tObj->_BorderChan );
}
}
}
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810texmem.c b/xc/lib/GL/mesa/src/drv/i810/i810texmem.c
index a4467ec3c..5f7b7fa1f 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810texmem.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810texmem.c
@@ -22,9 +22,6 @@
*
*/
-#include <stdlib.h>
-#include <stdio.h>
-
#include "glheader.h"
#include "macros.h"
#include "mtypes.h"
@@ -32,6 +29,10 @@
#include "enums.h"
#include "mm.h"
+
+#include "i810screen.h"
+#include "i810_dri.h"
+
#include "i810context.h"
#include "i810tex.h"
#include "i810state.h"
@@ -230,7 +231,7 @@ void i810PrintLocalLRU( i810ContextPtr imesa )
void i810PrintGlobalLRU( i810ContextPtr imesa )
{
int i, j;
- drm_i810_tex_region_t *list = imesa->sarea->texList;
+ I810TexRegionRec *list = imesa->sarea->texList;
for (i = 0, j = I810_NR_TEX_REGIONS ; i < I810_NR_TEX_REGIONS ; i++) {
fprintf(stderr, "list[%d] age %d next %d prev %d\n",
@@ -246,7 +247,7 @@ void i810PrintGlobalLRU( i810ContextPtr imesa )
void i810ResetGlobalLRU( i810ContextPtr imesa )
{
- drm_i810_tex_region_t *list = imesa->sarea->texList;
+ I810TexRegionRec *list = imesa->sarea->texList;
int sz = 1 << imesa->i810Screen->logTextureGranularity;
int i;
@@ -278,7 +279,7 @@ void i810UpdateTexLRU( i810ContextPtr imesa, i810TextureObjectPtr t )
int logsz = imesa->i810Screen->logTextureGranularity;
int start = t->MemBlock->ofs >> logsz;
int end = (t->MemBlock->ofs + t->MemBlock->size - 1) >> logsz;
- drm_i810_tex_region_t *list = imesa->sarea->texList;
+ I810TexRegionRec *list = imesa->sarea->texList;
imesa->texAge = ++imesa->sarea->texAge;
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810texstate.c b/xc/lib/GL/mesa/src/drv/i810/i810texstate.c
index 2fdd336f6..3ed355f4a 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810texstate.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810texstate.c
@@ -22,9 +22,6 @@
*
*/
-#include <stdlib.h>
-#include <stdio.h>
-
#include "glheader.h"
#include "macros.h"
#include "mtypes.h"
@@ -32,6 +29,10 @@
#include "enums.h"
#include "mm.h"
+
+#include "i810screen.h"
+#include "i810_dri.h"
+
#include "i810context.h"
#include "i810tex.h"
#include "i810state.h"
@@ -687,7 +688,7 @@ static void i810UpdateTexUnit( GLcontext *ctx, GLuint unit )
i810ContextPtr imesa = I810_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- if (texUnit->_ReallyEnabled == TEXTURE0_2D)
+ if (texUnit->_ReallyEnabled == TEXTURE_2D_BIT)
{
struct gl_texture_object *tObj = texUnit->_Current;
i810TextureObjectPtr t = (i810TextureObjectPtr)tObj->DriverData;
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810tris.c b/xc/lib/GL/mesa/src/drv/i810/i810tris.c
index 0d9b0d995..5c76e645c 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810tris.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810tris.c
@@ -28,12 +28,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
/*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
-#include <stdio.h>
-#include <math.h>
-
#include "glheader.h"
#include "mtypes.h"
#include "macros.h"
@@ -44,6 +41,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
+#include "i810screen.h"
+#include "i810_dri.h"
+
#include "i810tris.h"
#include "i810state.h"
#include "i810vb.h"
@@ -513,9 +513,9 @@ static void i810FastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
int i,j;
for (i = 2 ; i < n ; i++) {
- COPY_DWORDS( j, vb, vertsize, start );
COPY_DWORDS( j, vb, vertsize, V(elts[i-1]) );
COPY_DWORDS( j, vb, vertsize, V(elts[i]) );
+ COPY_DWORDS( j, vb, vertsize, start );
}
}
@@ -523,6 +523,10 @@ static void i810FastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
/* Choose render functions */
/**********************************************************************/
+/***********************************************************************
+ * Rasterization fallback helpers *
+ ***********************************************************************/
+
#define _I810_NEW_RENDERSTATE (_DD_NEW_LINE_STIPPLE | \
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810vb.c b/xc/lib/GL/mesa/src/drv/i810/i810vb.c
index d5b817a72..43f040936 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810vb.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810vb.c
@@ -26,7 +26,7 @@
#include "glheader.h"
#include "mtypes.h"
-#include "mem.h"
+#include "imports.h"
#include "macros.h"
#include "colormac.h"
#include "mmath.h"
@@ -34,6 +34,9 @@
#include "swrast_setup/swrast_setup.h"
#include "tnl/t_context.h"
+#include "i810screen.h"
+#include "i810_dri.h"
+
#include "i810context.h"
#include "i810vb.h"
#include "i810ioctl.h"
@@ -103,7 +106,7 @@ static struct {
#define GET_VIEWPORT_MAT() I810_CONTEXT(ctx)->ViewportMatrix.m
#define GET_TEXSOURCE(n) n
#define GET_VERTEX_FORMAT() I810_CONTEXT(ctx)->Setup[I810_CTXREG_VF]
-#define GET_VERTEX_STORE() (GLubyte *)(I810_CONTEXT(ctx)->verts)
+#define GET_VERTEX_STORE() I810_CONTEXT(ctx)->verts
#define GET_VERTEX_STRIDE_SHIFT() I810_CONTEXT(ctx)->vertex_stride_shift
#define GET_UBYTE_COLOR_STORE() &I810_CONTEXT(ctx)->UbyteColor
#define GET_UBYTE_SPEC_COLOR_STORE() &I810_CONTEXT(ctx)->UbyteSecondaryColor
@@ -377,24 +380,24 @@ void i810BuildVertices( GLcontext *ctx,
if (!newinputs)
return;
- if (newinputs & VERT_CLIP) {
+ if (newinputs & VERT_BIT_CLIP) {
setup_tab[imesa->SetupIndex].emit( ctx, start, count, v, stride );
} else {
GLuint ind = 0;
- if (newinputs & VERT_RGBA)
+ if (newinputs & VERT_BIT_COLOR0)
ind |= I810_RGBA_BIT;
- if (newinputs & VERT_SPEC_RGB)
+ if (newinputs & VERT_BIT_COLOR1)
ind |= I810_SPEC_BIT;
- if (newinputs & VERT_TEX0)
+ if (newinputs & VERT_BIT_TEX0)
ind |= I810_TEX0_BIT;
- if (newinputs & VERT_TEX1)
+ if (newinputs & VERT_BIT_TEX1)
ind |= I810_TEX1_BIT;
- if (newinputs & VERT_FOG_COORD)
+ if (newinputs & VERT_BIT_FOG)
ind |= I810_FOG_BIT;
if (imesa->SetupIndex & I810_PTEX_BIT)
@@ -420,9 +423,11 @@ void i810ChooseVertexState( GLcontext *ctx )
if (ctx->Fog.Enabled)
ind |= I810_FOG_BIT;
- if (ctx->Texture._ReallyEnabled & 0xf0)
+ if (ctx->Texture._EnabledUnits & 0x2)
+ /* unit 1 enabled */
ind |= I810_TEX1_BIT|I810_TEX0_BIT;
- else if (ctx->Texture._ReallyEnabled & 0xf)
+ else if (ctx->Texture._EnabledUnits & 0x1)
+ /* unit 0 enabled */
ind |= I810_TEX0_BIT;
imesa->SetupIndex = ind;
diff --git a/xc/lib/GL/mesa/src/drv/i830/Imakefile b/xc/lib/GL/mesa/src/drv/i830/Imakefile
index c5d312973..36154045e 100644
--- a/xc/lib/GL/mesa/src/drv/i830/Imakefile
+++ b/xc/lib/GL/mesa/src/drv/i830/Imakefile
@@ -29,16 +29,7 @@ XCOMM $XFree86: xc/lib/GL/mesa/src/drv/i830/Imakefile,v 1.4 2002/09/11 00:29:24
#include "../../X86/Imakefile.inc"
#endif
-#ifndef HaveDrmCommand
-#define HaveDrmCommand NO
-#endif
-
-#if HaveDrmCommand
-DRMCOMMAND_DEFINES = -DHAVE_DRM_COMMAND
-#endif
-
- DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(MESA_ASM_DEFINES) \
- $(DRMCOMMAND_DEFINES)
+ DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(MESA_ASM_DEFINES)
INCLUDES = $(X_INCLUDES) $(MESA_INCLUDES) $(DRI_INCLUDES)
diff --git a/xc/lib/GL/mesa/src/drv/i830/i830_context.c b/xc/lib/GL/mesa/src/drv/i830/i830_context.c
index 6b1b3ef6d..2b87c6f3b 100644
--- a/xc/lib/GL/mesa/src/drv/i830/i830_context.c
+++ b/xc/lib/GL/mesa/src/drv/i830/i830_context.c
@@ -41,7 +41,7 @@
#include "matrix.h"
#include "simple_list.h"
#include "extensions.h"
-#include "mem.h"
+#include "imports.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
@@ -60,9 +60,6 @@
#include "i830_vb.h"
#include "i830_ioctl.h"
-#include <X11/Xlibint.h>
-#include <stdio.h>
-
#ifndef I830_DEBUG
int I830_DEBUG = (0);
@@ -74,7 +71,7 @@ int I830_DEBUG = (0);
#define PCI_CHIP_845_G 0x2562
#define PCI_CHIP_I830_M 0x3577
-#define DRIVER_DATE "20020803"
+#define DRIVER_DATE "20021125"
static const GLubyte *i830DDGetString( GLcontext *ctx, GLenum name )
{
@@ -201,9 +198,9 @@ static void add_debug_flags( const char *debug )
}
#endif
-GLboolean i830CreateContext( Display *dpy, const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate)
+GLboolean i830CreateContext( const __GLcontextModes *mesaVis,
+ __DRIcontextPrivate *driContextPriv,
+ void *sharedContextPrivate)
{
GLcontext *ctx , *shareCtx;
i830ContextPtr imesa;
@@ -221,8 +218,7 @@ GLboolean i830CreateContext( Display *dpy, const __GLcontextModes *mesaVis,
shareCtx = ((i830ContextPtr) sharedContextPrivate)->glCtx;
else
shareCtx = NULL;
-
- imesa->glCtx = _mesa_create_context(mesaVis, shareCtx, imesa, GL_TRUE);
+ imesa->glCtx = _mesa_create_context(mesaVis, shareCtx, (void*) imesa, GL_TRUE);
if (!imesa->glCtx) {
FREE(imesa);
return GL_FALSE;
@@ -278,7 +274,6 @@ GLboolean i830CreateContext( Display *dpy, const __GLcontextModes *mesaVis,
_swrast_allow_vertex_fog( ctx, GL_TRUE );
/* Dri stuff */
- imesa->display = dpy;
imesa->hHWContext = driContextPriv->hHWContext;
imesa->driFd = sPriv->fd;
imesa->driHwLock = &sPriv->pSAREA->lock;
@@ -404,15 +399,16 @@ void i830XMesaSetBackClipRects( i830ContextPtr imesa )
static void i830XMesaWindowMoved( i830ContextPtr imesa )
{
- switch (imesa->glCtx->Color.DriverDrawBuffer) {
- case GL_FRONT_LEFT:
+ switch (imesa->glCtx->Color._DrawDestMask) {
+ case FRONT_LEFT_BIT:
i830XMesaSetFrontClipRects( imesa );
break;
- case GL_BACK_LEFT:
+ case BACK_LEFT_BIT:
i830XMesaSetBackClipRects( imesa );
break;
default:
- break;
+ /* glDrawBuffer(GL_NONE or GL_FRONT_AND_BACK): software fallback */
+ i830XMesaSetFrontClipRects( imesa );
}
}
@@ -474,7 +470,7 @@ void i830GetLock( i830ContextPtr 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(imesa->display, sPriv, dPriv);
+ DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv);
/* If we lost context, need to dump all registers to hardware.
* Note that we don't care about 2d contexts, even if they perform
@@ -529,17 +525,15 @@ void i830GetLock( i830ContextPtr imesa, GLuint flags )
sarea->last_quiescent = -1; /* just kill it for now */
}
-void i830SwapBuffers(Display *dpy, void *drawablePrivate)
+void i830SwapBuffers( __DRIdrawablePrivate *dPriv )
{
- __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
-
if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
i830ContextPtr imesa;
GLcontext *ctx;
imesa = (i830ContextPtr) dPriv->driContextPriv->driverPrivate;
ctx = imesa->glCtx;
if (ctx->Visual.doubleBufferMode) {
- _mesa_swapbuffers( ctx ); /* flush pending rendering comands */
+ _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */
if ( imesa->doPageFlip ) {
i830PageFlip( dPriv );
} else {
diff --git a/xc/lib/GL/mesa/src/drv/i830/i830_context.h b/xc/lib/GL/mesa/src/drv/i830/i830_context.h
index c6adc86d3..52c0e54cf 100644
--- a/xc/lib/GL/mesa/src/drv/i830/i830_context.h
+++ b/xc/lib/GL/mesa/src/drv/i830/i830_context.h
@@ -100,10 +100,10 @@ struct i830_context_t
GLboolean mask_blue;
GLboolean mask_alpha;
- GLboolean clear_red;
- GLboolean clear_green;
- GLboolean clear_blue;
- GLboolean clear_alpha;
+ GLubyte clear_red;
+ GLubyte clear_green;
+ GLubyte clear_blue;
+ GLubyte clear_alpha;
GLfloat depth_scale;
int depth_clear_mask;
@@ -167,7 +167,7 @@ struct i830_context_t
GLuint BufferSetup[I830_DEST_SETUP_SIZE];
int vertex_size;
int vertex_stride_shift;
- GLint lastStamp;
+ unsigned int lastStamp;
GLboolean stipple_in_hw;
GLenum TexEnvImageFmt[2];
@@ -209,7 +209,6 @@ struct i830_context_t
drmContext hHWContext;
drmLock *driHwLock;
int driFd;
- Display *display;
__DRIdrawablePrivate *driDrawable;
__DRIscreenPrivate *driScreen;
diff --git a/xc/lib/GL/mesa/src/drv/i830/i830_debug.c b/xc/lib/GL/mesa/src/drv/i830/i830_debug.c
index fef802f8d..b452ee414 100644
--- a/xc/lib/GL/mesa/src/drv/i830/i830_debug.c
+++ b/xc/lib/GL/mesa/src/drv/i830/i830_debug.c
@@ -31,8 +31,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* Author:
* Jeff Hartmann <jhartmann@2d3d.com>
*/
-#include <stdio.h>
-#include <unistd.h>
#include "glheader.h"
#include "context.h"
@@ -221,7 +219,6 @@ void i830VertexSanity( i830ContextPtr imesa, drmI830Vertex vertex )
"internal state\n");
fprintf(stderr, "Buffer size : %d\n", size);
fprintf(stderr, "Vertex size : %d\n", vfmt_size);
- sleep(10);
}
switch(sarea->vertex_prim) {
@@ -285,7 +282,6 @@ void i830VertexSanity( i830ContextPtr imesa, drmI830Vertex vertex )
fprintf(stderr, "temp_size : %d\n", temp_size);
fprintf(stderr, "remaining vertices : %d",
remaining / vfmt_size);
- sleep(10);
}
}
if (1) {
diff --git a/xc/lib/GL/mesa/src/drv/i830/i830_ioctl.c b/xc/lib/GL/mesa/src/drv/i830/i830_ioctl.c
index dcaffec91..b85622952 100644
--- a/xc/lib/GL/mesa/src/drv/i830/i830_ioctl.c
+++ b/xc/lib/GL/mesa/src/drv/i830/i830_ioctl.c
@@ -38,8 +38,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* Keith Whitwell <keith@tungstengraphics.com>
*/
-#include <stdio.h>
-#include <unistd.h>
+#include <unistd.h> /* for usleep() */
#include "glheader.h"
#include "mtypes.h"
@@ -59,70 +58,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "drm.h"
-
-/*
- * XXX This is here only while not all of the XFree86 versions of interest
- * don't have the drmCommand interfaces.
- */
-
-#if !defined(HAVE_DRM_COMMAND)
-#include <sys/ioctl.h>
-
-#define DRM_COMMAND_BASE 0x40
-
-#define DRM_I830_INIT 0x00
-#define DRM_I830_VERTEX 0x01
-#define DRM_I830_CLEAR 0x02
-#define DRM_I830_FLUSH 0x03
-#define DRM_I830_GETAGE 0x04
-#define DRM_I830_GETBUF 0x05
-#define DRM_I830_SWAP 0x06
-#define DRM_I830_COPY 0x07
-#define DRM_I830_DOCOPY 0x08
-
-static int
-drmCommandNone(int fd, unsigned long drmCommandIndex)
-{
- void *data = NULL; /* dummy */
- unsigned long request;
-
- request = DRM_IO(DRM_COMMAND_BASE + drmCommandIndex);
-
- if (ioctl(fd, request, data)) {
- return -errno;
- }
- return 0;
-}
-
-static int
-drmCommandWrite(int fd, unsigned long drmCommandIndex,
- void *data, unsigned long size )
-{
- unsigned long request;
-
- request = DRM_IOW(DRM_COMMAND_BASE + drmCommandIndex, size);
-
- if (ioctl(fd, request, data)) {
- return -errno;
- }
- return 0;
-}
-
-static int
-drmCommandWriteRead(int fd, unsigned long drmCommandIndex,
- void *data, unsigned long size )
-{
- unsigned long request;
-
- request = DRM_IOWR(DRM_COMMAND_BASE + drmCommandIndex, size);
-
- if (ioctl(fd, request, data)) {
- return -errno;
- }
- return 0;
-}
-#endif
-
static drmBufPtr i830_get_buffer_ioctl( i830ContextPtr imesa )
{
drmI830DMA dma;
@@ -304,8 +239,8 @@ static void i830ClearWithTris(GLcontext *ctx, GLbitfield mask,
imesa->clear_blue, imesa->clear_alpha);
i830ClearDrawQuad(imesa, (float)x0, (float)x1, (float)y0, (float)y1,
- imesa->clear_red, imesa->clear_green,
- imesa->clear_blue, imesa->clear_alpha);
+ imesa->clear_red, imesa->clear_green,
+ imesa->clear_blue, imesa->clear_alpha);
i830FlushPrimsLocked( imesa );
}
@@ -373,7 +308,7 @@ static void i830ClearWithTris(GLcontext *ctx, GLbitfield mask,
}
if(mask & DD_STENCIL_BIT) {
- GLuint s_mask = ctx->Stencil.WriteMask;
+ GLuint s_mask = ctx->Stencil.WriteMask[0];
sarea->dirty |= (I830_UPLOAD_CTX | I830_UPLOAD_BUFFERS |
I830_UPLOAD_TEXBLEND0);
@@ -515,7 +450,7 @@ static void i830Clear(GLcontext *ctx, GLbitfield mask, GLboolean all,
}
if((mask & DD_STENCIL_BIT) && imesa->hw_stencil) {
- if (ctx->Stencil.WriteMask != 0xff) {
+ if (ctx->Stencil.WriteMask[0] != 0xff) {
tri_mask |= DD_STENCIL_BIT;
} else {
clear.flags |= I830_DEPTH;
diff --git a/xc/lib/GL/mesa/src/drv/i830/i830_render.c b/xc/lib/GL/mesa/src/drv/i830/i830_render.c
index 65dd263ec..bfd4fb6b8 100644
--- a/xc/lib/GL/mesa/src/drv/i830/i830_render.c
+++ b/xc/lib/GL/mesa/src/drv/i830/i830_render.c
@@ -36,7 +36,7 @@
#include "glheader.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mtypes.h"
#include "mmath.h"
@@ -109,7 +109,7 @@ static void VERT_FALLBACK( GLcontext *ctx,
tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 );
tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start,
count, flags );
- I830_CONTEXT(ctx)->SetupNewInputs = VERT_CLIP;
+ I830_CONTEXT(ctx)->SetupNewInputs = VERT_BIT_CLIP;
}
@@ -151,7 +151,7 @@ static GLboolean i830_run_render( GLcontext *ctx,
return GL_TRUE;
}
- imesa->SetupNewInputs = VERT_CLIP;
+ imesa->SetupNewInputs = VERT_BIT_CLIP;
tnl->Driver.Render.Start( ctx );
@@ -172,19 +172,19 @@ static GLboolean i830_run_render( GLcontext *ctx,
static void i830_check_render( GLcontext *ctx,
struct gl_pipeline_stage *stage )
{
- GLuint inputs = VERT_CLIP|VERT_RGBA;
+ GLuint inputs = VERT_BIT_CLIP | VERT_BIT_COLOR0;
if (ctx->RenderMode == GL_RENDER) {
if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
- inputs |= VERT_SPEC_RGB;
+ inputs |= VERT_BIT_COLOR1;
if (ctx->Texture.Unit[0]._ReallyEnabled)
- inputs |= VERT_TEX(0);
+ inputs |= VERT_BIT_TEX0;
if (ctx->Texture.Unit[1]._ReallyEnabled)
- inputs |= VERT_TEX(1);
+ inputs |= VERT_BIT_TEX1;
if (ctx->Fog.Enabled)
- inputs |= VERT_FOG_COORD;
+ inputs |= VERT_BIT_FOG;
}
stage->inputs = inputs;
diff --git a/xc/lib/GL/mesa/src/drv/i830/i830_screen.c b/xc/lib/GL/mesa/src/drv/i830/i830_screen.c
index 71ae60640..5929a2288 100644
--- a/xc/lib/GL/mesa/src/drv/i830/i830_screen.c
+++ b/xc/lib/GL/mesa/src/drv/i830/i830_screen.c
@@ -34,13 +34,6 @@
*/
-#include <X11/Xlibint.h>
-#include <stdio.h>
-
-
-#include <X11/Xlibint.h>
-#include <stdio.h>
-
#include "glheader.h"
#include "context.h"
#include "matrix.h"
@@ -132,17 +125,14 @@ static GLboolean i830InitDriver(__DRIscreenPrivate *sPriv)
i830ScreenPrivate *i830Screen;
I830DRIPtr gDRIPriv = (I830DRIPtr)sPriv->pDevPriv;
- /* Check the DRI version */
- {
- int major, minor, patch;
- if (XF86DRIQueryVersion(sPriv->display, &major, &minor, &patch)) {
- if (major != 4 || minor < 0) {
- __driUtilMessage("i830 DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch);
- return GL_FALSE;
- }
- }
+ /* Check the DRI externsion version */
+ if ( sPriv->driMajor != 4 || sPriv->driMinor < 0 ) {
+ __driUtilMessage( "i830 DRI driver expected DRI version 4.0.x "
+ "but got version %d.%d.%d",
+ sPriv->driMajor, sPriv->driMinor, sPriv->driPatch );
+ return GL_FALSE;
}
-
+
/* Check that the DDX driver version is compatible */
if (sPriv->ddxMajor != 1 || sPriv->ddxMinor < 0) {
__driUtilMessage("i830 DRI driver expected DDX driver version 1.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch);
@@ -268,8 +258,7 @@ static void i830DestroyScreen(__DRIscreenPrivate *sPriv)
sPriv->private = NULL;
}
-static GLboolean i830CreateBuffer( Display *dpy,
- __DRIscreenPrivate *driScrnPriv,
+static GLboolean i830CreateBuffer(__DRIscreenPrivate *driScrnPriv,
__DRIdrawablePrivate *driDrawPriv,
const __GLcontextModes *mesaVis,
GLboolean isPixmap )
diff --git a/xc/lib/GL/mesa/src/drv/i830/i830_screen.h b/xc/lib/GL/mesa/src/drv/i830/i830_screen.h
index ca991c78a..270194c87 100644
--- a/xc/lib/GL/mesa/src/drv/i830/i830_screen.h
+++ b/xc/lib/GL/mesa/src/drv/i830/i830_screen.h
@@ -94,7 +94,7 @@ typedef struct
extern GLboolean
-i830CreateContext( Display *dpy, const __GLcontextModes *mesaVis,
+i830CreateContext( const __GLcontextModes *mesaVis,
__DRIcontextPrivate *driContextPriv,
void *sharedContextPrivate );
@@ -110,6 +110,6 @@ i830MakeCurrent(__DRIcontextPrivate *driContextPriv,
__DRIdrawablePrivate *driReadPriv);
extern void
-i830SwapBuffers(Display *dpy, void *drawablePrivate);
+i830SwapBuffers(__DRIdrawablePrivate *driDrawPriv);
#endif
diff --git a/xc/lib/GL/mesa/src/drv/i830/i830_span.c b/xc/lib/GL/mesa/src/drv/i830/i830_span.c
index 232698911..2fe74ffc4 100644
--- a/xc/lib/GL/mesa/src/drv/i830/i830_span.c
+++ b/xc/lib/GL/mesa/src/drv/i830/i830_span.c
@@ -262,13 +262,20 @@ do { \
#define TAG(x) i830##x##_24_8
#include "stenciltmp.h"
-static void i830SetReadBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
- GLenum mode)
+/*
+ * This function is called to specify which buffer to read and write
+ * for software rasterization (swrast) fallbacks. This doesn't necessarily
+ * correspond to glDrawBuffer() or glReadBuffer() calls.
+ */
+static void i830SetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
+ GLuint bufferBit)
{
i830ContextPtr imesa = I830_CONTEXT(ctx);
- if (mode == GL_FRONT_LEFT) {
- imesa->readMap = (char*)imesa->driScreen->pFB;
- } else if (mode == GL_BACK_LEFT) {
+ if (bufferBit == FRONT_LEFT_BIT) {
+ imesa->drawMap = (char *)imesa->driScreen->pFB;
+ imesa->readMap = (char *)imesa->driScreen->pFB;
+ } else if (bufferBit == BACK_LEFT_BIT) {
+ imesa->drawMap = imesa->i830Screen->back.map;
imesa->readMap = imesa->i830Screen->back.map;
} else {
ASSERT(0);
@@ -301,7 +308,7 @@ void i830DDInitSpanFuncs( GLcontext *ctx )
struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
- swdd->SetReadBuffer = i830SetReadBuffer;
+ swdd->SetBuffer = i830SetBuffer;
switch (i830Screen->fbFormat) {
case DV_PF_555:
diff --git a/xc/lib/GL/mesa/src/drv/i830/i830_state.c b/xc/lib/GL/mesa/src/drv/i830/i830_state.c
index 86992d61e..15e0dd495 100644
--- a/xc/lib/GL/mesa/src/drv/i830/i830_state.c
+++ b/xc/lib/GL/mesa/src/drv/i830/i830_state.c
@@ -34,7 +34,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* Heavily based on the I810 driver, which was written by:
* Keith Whitwell <keith@tungstengraphics.com>
*/
-#include <stdio.h>
#include "glheader.h"
#include "context.h"
@@ -244,10 +243,11 @@ static void i830StencilOp(GLcontext *ctx, GLenum fail, GLenum zfail,
STENCIL_PASS_DEPTH_PASS_OP(dpop));
}
-static void i830AlphaFunc(GLcontext *ctx, GLenum func, GLchan ref)
+static void i830AlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
{
i830ContextPtr imesa = I830_CONTEXT(ctx);
int test = 0;
+ GLuint refByte = (GLint) (ref * 255.0);
switch(func) {
case GL_NEVER:
@@ -274,7 +274,8 @@ static void i830AlphaFunc(GLcontext *ctx, GLenum func, GLchan ref)
case GL_ALWAYS:
test = COMPAREFUNC_ALWAYS;
break;
- default: return;
+ default:
+ return;
}
I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
@@ -282,7 +283,7 @@ static void i830AlphaFunc(GLcontext *ctx, GLenum func, GLchan ref)
imesa->Setup[I830_CTXREG_STATE2] |= (ENABLE_ALPHA_TEST_FUNC |
ENABLE_ALPHA_REF_VALUE |
ALPHA_TEST_FUNC(test) |
- ALPHA_REF_VALUE(ref));
+ ALPHA_REF_VALUE(refByte));
}
/* This function makes sure that the proper enables are
@@ -843,50 +844,60 @@ static void i830RenderMode( GLcontext *ctx, GLenum mode )
FALLBACK( imesa, I830_FALLBACK_RENDERMODE, (mode != GL_RENDER) );
}
-static void i830SetDrawBuffer(GLcontext *ctx, GLenum mode )
+static void i830DrawBuffer(GLcontext *ctx, GLenum mode )
{
i830ContextPtr imesa = I830_CONTEXT(ctx);
- if (mode == GL_FRONT_LEFT) {
+ /*
+ * _DrawDestMask is easier to cope with than <mode>.
+ */
+ switch ( ctx->Color._DrawDestMask ) {
+ case FRONT_LEFT_BIT:
I830_FIREVERTICES(imesa);
I830_STATECHANGE(imesa, I830_UPLOAD_BUFFERS);
-
imesa->BufferSetup[I830_DESTREG_CBUFADDR] = imesa->i830Screen->fbOffset;
-
- imesa->drawMap = (char *)imesa->driScreen->pFB;
- imesa->readMap = (char *)imesa->driScreen->pFB;
i830XMesaSetFrontClipRects( imesa );
FALLBACK( imesa, I830_FALLBACK_DRAW_BUFFER, GL_FALSE );
- } else if (mode == GL_BACK_LEFT) {
+ break;
+ case BACK_LEFT_BIT:
I830_FIREVERTICES(imesa);
I830_STATECHANGE(imesa, I830_UPLOAD_BUFFERS);
-
imesa->BufferSetup[I830_DESTREG_CBUFADDR] =
imesa->i830Screen->backOffset;
-
- imesa->drawMap = imesa->i830Screen->back.map;
- imesa->readMap = imesa->i830Screen->back.map;
i830XMesaSetBackClipRects( imesa );
FALLBACK( imesa, I830_FALLBACK_DRAW_BUFFER, GL_FALSE );
- } else {
+ break;
+ default:
+ /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
FALLBACK( imesa, I830_FALLBACK_DRAW_BUFFER, GL_TRUE );
+ return;
}
+
+ /* We want to update the s/w rast state too so that i830SetBuffer()
+ * gets called.
+ */
+ _swrast_DrawBuffer(ctx, mode);
+}
+
+static void i830ReadBuffer(GLcontext *ctx, GLenum mode )
+{
+ /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */
}
-static void i830ClearColor(GLcontext *ctx, const GLchan color[4])
+static void i830ClearColor(GLcontext *ctx, const GLfloat color[4])
{
i830ContextPtr imesa = I830_CONTEXT(ctx);
- imesa->clear_red = color[RCOMP];
- imesa->clear_green = color[GCOMP];
- imesa->clear_blue = color[BCOMP];
- imesa->clear_alpha = color[ACOMP];
+ CLAMPED_FLOAT_TO_UBYTE(imesa->clear_red, color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(imesa->clear_green, color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(imesa->clear_blue, color[2]);
+ CLAMPED_FLOAT_TO_UBYTE(imesa->clear_alpha, color[3]);
imesa->ClearColor = i830PackColor(imesa->i830Screen->fbFormat,
- color[RCOMP],
- color[GCOMP],
- color[BCOMP],
- color[ACOMP] );
+ imesa->clear_red,
+ imesa->clear_green,
+ imesa->clear_blue,
+ imesa->clear_alpha);
}
static void i830CullFaceFrontFace(GLcontext *ctx, GLenum unused)
@@ -1566,12 +1577,14 @@ void i830DDInitState( GLcontext *ctx )
memset(imesa->BufferSetup, 0, sizeof(imesa->BufferSetup));
- if (imesa->glCtx->Color.DriverDrawBuffer == GL_BACK_LEFT) {
+ if (imesa->glCtx->Visual.doubleBufferMode) {
+ /* use back buffer by default */
imesa->drawMap = i830Screen->back.map;
imesa->readMap = i830Screen->back.map;
imesa->BufferSetup[I830_DESTREG_CBUFADDR] = i830Screen->backOffset;
imesa->BufferSetup[I830_DESTREG_DBUFADDR] = 0;
} else {
+ /* use front buffer by default */
imesa->drawMap = (char *)imesa->driScreen->pFB;
imesa->readMap = (char *)imesa->driScreen->pFB;
imesa->BufferSetup[I830_DESTREG_CBUFADDR] = i830Screen->fbOffset;
@@ -1655,7 +1668,8 @@ void i830DDInitStateFuncs(GLcontext *ctx)
ctx->Driver.PolygonStipple = i830PolygonStipple;
ctx->Driver.RenderMode = i830RenderMode;
ctx->Driver.Scissor = i830Scissor;
- ctx->Driver.SetDrawBuffer = i830SetDrawBuffer;
+ ctx->Driver.DrawBuffer = i830DrawBuffer;
+ ctx->Driver.ReadBuffer = i830ReadBuffer;
ctx->Driver.ShadeModel = i830ShadeModel;
ctx->Driver.DepthRange = i830DepthRange;
ctx->Driver.Viewport = i830Viewport;
diff --git a/xc/lib/GL/mesa/src/drv/i830/i830_tex.c b/xc/lib/GL/mesa/src/drv/i830/i830_tex.c
index e90c8c12d..dc0baac86 100644
--- a/xc/lib/GL/mesa/src/drv/i830/i830_tex.c
+++ b/xc/lib/GL/mesa/src/drv/i830/i830_tex.c
@@ -35,13 +35,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* Keith Whitwell <keithw@tungstengraphics.com>
*/
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <GL/gl.h>
#include "glheader.h"
#include "mtypes.h"
-#include "mem.h"
+#include "imports.h"
#include "simple_list.h"
#include "enums.h"
#include "texstore.h"
@@ -223,7 +219,7 @@ static void i830TexParameter( GLcontext *ctx, GLenum target,
break;
case GL_TEXTURE_BORDER_COLOR:
- i830SetTexBorderColor( t, tObj->BorderColor );
+ i830SetTexBorderColor( t, tObj->_BorderChan );
break;
case GL_TEXTURE_BASE_LEVEL:
@@ -385,7 +381,7 @@ static void i830BindTexture( GLcontext *ctx, GLenum target,
i830SetTexWrapping( t, tObj->WrapS, tObj->WrapT );
i830SetTexFilter( imesa, t, tObj->MinFilter, tObj->MagFilter, bias );
- i830SetTexBorderColor( t, tObj->BorderColor );
+ i830SetTexBorderColor( t, tObj->_BorderChan );
}
}
}
diff --git a/xc/lib/GL/mesa/src/drv/i830/i830_texmem.c b/xc/lib/GL/mesa/src/drv/i830/i830_texmem.c
index d54af4daf..c98327e87 100644
--- a/xc/lib/GL/mesa/src/drv/i830/i830_texmem.c
+++ b/xc/lib/GL/mesa/src/drv/i830/i830_texmem.c
@@ -35,9 +35,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* Keith Whitwell <keithw@tungstengraphics.com>
*/
-#include <stdlib.h>
-#include <stdio.h>
-
#include "glheader.h"
#include "macros.h"
#include "mtypes.h"
diff --git a/xc/lib/GL/mesa/src/drv/i830/i830_texstate.c b/xc/lib/GL/mesa/src/drv/i830/i830_texstate.c
index 54f038ec7..d2cbaf3f1 100644
--- a/xc/lib/GL/mesa/src/drv/i830/i830_texstate.c
+++ b/xc/lib/GL/mesa/src/drv/i830/i830_texstate.c
@@ -34,8 +34,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* Heavily based on the I810 driver, which was written by:
* Keith Whitwell <keithw@tungstengraphics.com>
*/
-#include <stdlib.h>
-#include <stdio.h>
#include "glheader.h"
#include "macros.h"
@@ -1279,7 +1277,7 @@ static void i830UpdateTexUnit( GLcontext *ctx, GLuint unit )
imesa->TexEnabledMask &= ~(I830_TEX_UNIT_ENABLED(unit));
- if (texUnit->_ReallyEnabled == TEXTURE0_2D) {
+ if (texUnit->_ReallyEnabled == TEXTURE_2D_BIT) {
struct gl_texture_object *tObj = texUnit->_Current;
i830TextureObjectPtr t = (i830TextureObjectPtr)tObj->DriverData;
GLuint mcs = t->Setup[I830_TEXREG_MCS] & TEXCOORDTYPE_MASK;
@@ -1374,7 +1372,7 @@ void i830UpdateTexUnitProj( GLcontext *ctx, GLuint unit, GLboolean state )
i830ContextPtr imesa = I830_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- if (texUnit->_ReallyEnabled == TEXTURE0_2D) {
+ if (texUnit->_ReallyEnabled == TEXTURE_2D_BIT) {
struct gl_texture_object *tObj = texUnit->_Current;
i830TextureObjectPtr t = (i830TextureObjectPtr)tObj->DriverData;
GLuint mcs = t->Setup[I830_TEXREG_MCS] & TEXCOORDTYPE_MASK;
diff --git a/xc/lib/GL/mesa/src/drv/i830/i830_tris.c b/xc/lib/GL/mesa/src/drv/i830/i830_tris.c
index 970fc0888..4ae95347b 100644
--- a/xc/lib/GL/mesa/src/drv/i830/i830_tris.c
+++ b/xc/lib/GL/mesa/src/drv/i830/i830_tris.c
@@ -33,9 +33,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* Jeff Hartmann <jhartmann@2d3d.com>
*/
-#include <stdio.h>
-#include <math.h>
-
#include "glheader.h"
#include "context.h"
#include "macros.h"
diff --git a/xc/lib/GL/mesa/src/drv/i830/i830_vb.c b/xc/lib/GL/mesa/src/drv/i830/i830_vb.c
index 532849abb..1bf20d813 100644
--- a/xc/lib/GL/mesa/src/drv/i830/i830_vb.c
+++ b/xc/lib/GL/mesa/src/drv/i830/i830_vb.c
@@ -27,7 +27,7 @@
#include "glheader.h"
#include "mtypes.h"
-#include "mem.h"
+#include "imports.h"
#include "macros.h"
#include "colormac.h"
#include "mmath.h"
@@ -446,24 +446,24 @@ void i830BuildVertices( GLcontext *ctx,
if (!newinputs)
return;
- if (newinputs & VERT_CLIP) {
+ if (newinputs & VERT_BIT_CLIP) {
setup_tab[imesa->SetupIndex].emit( ctx, start, count, v, stride );
} else {
GLuint ind = 0;
- if (newinputs & VERT_RGBA)
+ if (newinputs & VERT_BIT_COLOR0)
ind |= I830_RGBA_BIT;
- if (newinputs & VERT_SPEC_RGB)
+ if (newinputs & VERT_BIT_COLOR1)
ind |= I830_SPEC_BIT;
- if (newinputs & VERT_TEX0)
+ if (newinputs & VERT_BIT_TEX0)
ind |= I830_TEX0_BIT;
- if (newinputs & VERT_TEX1)
+ if (newinputs & VERT_BIT_TEX1)
ind |= I830_TEX1_BIT;
- if (newinputs & VERT_FOG_COORD)
+ if (newinputs & VERT_BIT_FOG)
ind |= I830_FOG_BIT;
#if 0
@@ -491,9 +491,11 @@ void i830ChooseVertexState( GLcontext *ctx )
if (ctx->Fog.Enabled)
ind |= I830_FOG_BIT;
- if (ctx->Texture._ReallyEnabled & TEXTURE1_ANY)
+ if (ctx->Texture._EnabledUnits & 0x2)
+ /* unit 1 enabled */
ind |= I830_TEX1_BIT|I830_TEX0_BIT;
- else if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY)
+ else if (ctx->Texture._EnabledUnits & 0x1)
+ /* unit 0 enabled */
ind |= I830_TEX0_BIT;
imesa->SetupIndex = ind;
diff --git a/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c b/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c
index 191ae3a2f..a5f505e18 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c
@@ -23,21 +23,18 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#ifdef GLX_DIRECT_RENDERING
-#include <X11/Xlibint.h>
-#include <stdio.h>
-
-#include "drm.h"
+#include "mga_common.h"
#include "mga_xmesa.h"
#include "context.h"
#include "matrix.h"
#include "mmath.h"
#include "simple_list.h"
-#include "mem.h"
+#include "imports.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
@@ -56,7 +53,6 @@
#include "mgabuffers.h"
#include "mgapixel.h"
-#include "xf86dri.h"
#include "mga_xmesa.h"
#include "mga_dri.h"
@@ -84,15 +80,12 @@ mgaInitDriver(__DRIscreenPrivate *sPriv)
if (MGA_DEBUG&DEBUG_VERBOSE_DRI)
fprintf(stderr, "mgaInitDriver\n");
- /* Check the DRI version */
- {
- int major, minor, patch;
- if (XF86DRIQueryVersion(sPriv->display, &major, &minor, &patch)) {
- if (major != 4 || minor < 0) {
- __driUtilMessage("MGA DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch);
- return GL_FALSE;
- }
- }
+ /* Check the DRI externsion version */
+ if ( sPriv->driMajor != 4 || sPriv->driMinor < 0 ) {
+ __driUtilMessage( "MGA DRI driver expected DRI version 4.0.x "
+ "but got version %d.%d.%d",
+ sPriv->driMajor, sPriv->driMinor, sPriv->driPatch );
+ return GL_FALSE;
}
/* Check that the DDX driver version is compatible */
@@ -120,6 +113,24 @@ mgaInitDriver(__DRIscreenPrivate *sPriv)
mgaScreen->sPriv = sPriv;
sPriv->private = (void *)mgaScreen;
+ if (sPriv->drmMinor >= 1) {
+ int ret;
+ drmMGAGetParam gp;
+
+ gp.param = MGA_PARAM_IRQ_NR;
+ gp.value = &mgaScreen->irq;
+
+ ret = drmCommandWriteRead( sPriv->fd, DRM_MGA_GETPARAM,
+ &gp, sizeof(gp));
+ if (ret) {
+ fprintf(stderr, "drmMgaGetParam (MGA_PARAM_IRQ_NR): %d\n", ret);
+ XFree(mgaScreen);
+ sPriv->private = NULL;
+ return GL_FALSE;
+ }
+ }
+
+
if (serverInfo->chipset != MGA_CARD_TYPE_G200 &&
serverInfo->chipset != MGA_CARD_TYPE_G400) {
XFree(mgaScreen);
@@ -260,7 +271,7 @@ static const struct gl_pipeline_stage *mga_pipeline[] = {
static GLboolean
-mgaCreateContext( Display *dpy, const __GLcontextModes *mesaVis,
+mgaCreateContext( const __GLcontextModes *mesaVis,
__DRIcontextPrivate *driContextPriv,
void *sharedContextPrivate )
{
@@ -269,7 +280,7 @@ mgaCreateContext( Display *dpy, const __GLcontextModes *mesaVis,
mgaContextPtr mmesa;
__DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
mgaScreenPrivate *mgaScreen = (mgaScreenPrivate *)sPriv->private;
- drm_mga_sarea_t *saPriv=(drm_mga_sarea_t*)(((char*)sPriv->pSAREA)+
+ MGASAREAPrivPtr saPriv=(MGASAREAPrivPtr)(((char*)sPriv->pSAREA)+
mgaScreen->sarea_priv_offset);
if (MGA_DEBUG&DEBUG_VERBOSE_DRI)
@@ -286,7 +297,7 @@ mgaCreateContext( Display *dpy, const __GLcontextModes *mesaVis,
shareCtx = ((mgaContextPtr) sharedContextPrivate)->glCtx;
else
shareCtx = NULL;
- mmesa->glCtx = _mesa_create_context(mesaVis, shareCtx, mmesa, GL_TRUE);
+ mmesa->glCtx = _mesa_create_context(mesaVis, shareCtx, (void *) mmesa, GL_TRUE);
if (!mmesa->glCtx) {
FREE(mmesa);
return GL_FALSE;
@@ -294,7 +305,6 @@ mgaCreateContext( Display *dpy, const __GLcontextModes *mesaVis,
driContextPriv->driverPrivate = mmesa;
/* Init mga state */
- mmesa->display = dpy;
mmesa->hHWContext = driContextPriv->hHWContext;
mmesa->driFd = sPriv->fd;
mmesa->driHwLock = &sPriv->pSAREA->lock;
@@ -446,8 +456,7 @@ mgaDestroyContext(__DRIcontextPrivate *driContextPriv)
static GLboolean
-mgaCreateBuffer( Display *dpy,
- __DRIscreenPrivate *driScrnPriv,
+mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv,
__DRIdrawablePrivate *driDrawPriv,
const __GLcontextModes *mesaVis,
GLboolean isPixmap )
@@ -549,7 +558,7 @@ void mgaGetLock( mgaContextPtr mmesa, GLuint flags )
if (*(dPriv->pStamp) != mmesa->lastStamp) {
mmesa->lastStamp = *(dPriv->pStamp);
- mmesa->SetupNewInputs |= VERT_CLIP;
+ mmesa->SetupNewInputs |= VERT_BIT_CLIP;
mmesa->dirty_cliprects = (MGA_FRONT|MGA_BACK);
mgaUpdateRects( mmesa, (MGA_FRONT|MGA_BACK) );
}
diff --git a/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h b/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h
index 5220dd82e..3ef3db7c5 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h
+++ b/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h
@@ -22,7 +22,7 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h,v 1.10 2002/02/22 21:33:05 dawes Exp $ */
@@ -35,6 +35,7 @@
#include "dri_util.h"
#include "mtypes.h"
#include "mgaregs.h"
+#include "mga_common.h"
typedef struct mga_screen_private_s {
@@ -45,6 +46,7 @@ typedef struct mga_screen_private_s {
int cpp; /* for front and back buffers */
GLint agpMode;
+ unsigned int irq; /* IRQ number (0 means none) */
unsigned int mAccess;
@@ -59,10 +61,10 @@ typedef struct mga_screen_private_s {
unsigned int dmaOffset;
- unsigned int textureOffset[MGA_NR_TEX_HEAPS];
- unsigned int textureSize[MGA_NR_TEX_HEAPS];
- int logTextureGranularity[MGA_NR_TEX_HEAPS];
- char *texVirtual[MGA_NR_TEX_HEAPS];
+ unsigned int textureOffset[DRM_MGA_NR_TEX_HEAPS];
+ unsigned int textureSize[DRM_MGA_NR_TEX_HEAPS];
+ int logTextureGranularity[DRM_MGA_NR_TEX_HEAPS];
+ char *texVirtual[DRM_MGA_NR_TEX_HEAPS];
__DRIscreenPrivate *sPriv;
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgabuffers.c b/xc/lib/GL/mesa/src/drv/mga/mgabuffers.c
index 444cb2bac..5da3be6dd 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgabuffers.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgabuffers.c
@@ -22,16 +22,17 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgabuffers.c,v 1.11 2002/09/11 19:49:07 tsi Exp $ */
-#include <stdio.h>
#include "mgacontext.h"
#include "mgabuffers.h"
#include "mgastate.h"
#include "mgaioctl.h"
#include "mgatris.h"
+#include "swrast/swrast.h"
+#include "imports.h"
static void mgaXMesaSetFrontClipRects( mgaContextPtr mmesa )
{
@@ -212,7 +213,7 @@ void mgaUpdateRects( mgaContextPtr mmesa, GLuint buffers )
/* fprintf(stderr, "%s\n", __FUNCTION__); */
- DRI_VALIDATE_DRAWABLE_INFO(mmesa->display, mmesa->driScreen, driDrawable);
+ DRI_VALIDATE_DRAWABLE_INFO(mmesa->driScreen, driDrawable);
mmesa->dirty_cliprects = 0;
if (mmesa->draw_buffer == MGA_FRONT)
@@ -235,36 +236,57 @@ void mgaUpdateRects( mgaContextPtr mmesa, GLuint buffers )
-void mgaDDSetDrawBuffer(GLcontext *ctx, GLenum mode )
+void mgaDDDrawBuffer(GLcontext *ctx, GLenum mode )
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
FLUSH_BATCH( MGA_CONTEXT(ctx) );
-
- if (mode == GL_FRONT_LEFT)
- {
- mmesa->drawOffset = mmesa->mgaScreen->frontOffset;
- mmesa->readOffset = mmesa->mgaScreen->frontOffset;
+ /*
+ * _DrawDestMask is easier to cope with than <mode>.
+ */
+ switch ( ctx->Color._DrawDestMask ) {
+ case FRONT_LEFT_BIT:
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 );
- }
- else if (mode == GL_BACK_LEFT)
- {
- mmesa->drawOffset = mmesa->mgaScreen->backOffset;
- mmesa->readOffset = mmesa->mgaScreen->backOffset;
+ break;
+ case BACK_LEFT_BIT:
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 );
- }
- else
- {
+ break;
+ default:
+ /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_TRUE );
+ return;
}
+
+ /* We want to update the s/w rast state too so that r200SetBuffer()
+ * gets called.
+ */
+ _swrast_DrawBuffer(ctx, mode);
}
+
+void mgaDDReadBuffer(GLcontext *ctx, GLenum mode )
+{
+ mgaContextPtr mmesa = MGA_CONTEXT(ctx);
+
+ FLUSH_BATCH( MGA_CONTEXT(ctx) );
+
+ switch (ctx->Pixel._ReadSrcMask) {
+ case FRONT_LEFT_BIT:
+ mmesa->read_buffer = MGA_FRONT;
+ break;
+ case BACK_LEFT_BIT:
+ mmesa->read_buffer = MGA_FRONT;
+ break;
+ default:
+ _mesa_problem(ctx, "bad mode in mgaDDReadBuffer");
+ }
+}
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgabuffers.h b/xc/lib/GL/mesa/src/drv/mga/mgabuffers.h
index fc0777243..f5f23998a 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgabuffers.h
+++ b/xc/lib/GL/mesa/src/drv/mga/mgabuffers.h
@@ -23,13 +23,14 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#ifndef MGA_BUFFERS_H
#define MGA_BUFFERS_H
-void mgaDDSetDrawBuffer(GLcontext *ctx, GLenum mode );
+void mgaDDDrawBuffer(GLcontext *ctx, GLenum mode );
+void mgaDDReadBuffer(GLcontext *ctx, GLenum mode );
void mgaUpdateRects( mgaContextPtr mmesa, GLuint buffers );
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgacontext.h b/xc/lib/GL/mesa/src/drv/mga/mgacontext.h
index 69eaa47c6..6f67ed567 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgacontext.h
+++ b/xc/lib/GL/mesa/src/drv/mga/mgacontext.h
@@ -23,18 +23,16 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#ifndef MGALIB_INC
#define MGALIB_INC
-#include <X11/Xlibint.h>
#include "dri_util.h"
#include "mtypes.h"
-#include "drm.h"
+#include "xf86drm.h"
#include "mm.h"
-#include "mem.h"
#include "mga_sarea.h"
@@ -120,7 +118,7 @@ typedef struct mga_texture_object_s
struct mga_context_t {
GLcontext *glCtx;
- GLuint lastStamp; /* fullscreen breaks dpriv->laststamp,
+ unsigned int lastStamp; /* fullscreen breaks dpriv->laststamp,
* need to shadow it here. */
/* Bookkeeping for texturing
@@ -202,6 +200,9 @@ struct mga_context_t {
drmBufPtr vertex_dma_buffer;
drmBufPtr iload_buffer;
+ /* VBI
+ */
+ GLuint vbl_seq;
/* Drawable, cliprect and scissor information
*/
@@ -234,7 +235,6 @@ struct mga_context_t {
drmContext hHWContext;
drmLock *driHwLock;
int driFd;
- Display *display;
__DRIdrawablePrivate *driDrawable;
__DRIscreenPrivate *driScreen;
struct mga_screen_private_s *mgaScreen;
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgadd.c b/xc/lib/GL/mesa/src/drv/mga/mgadd.c
index 6f4f23836..c2fb0be3b 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgadd.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgadd.c
@@ -22,17 +22,13 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgadd.c,v 1.13 2002/09/11 19:49:07 tsi Exp $ */
#include "mtypes.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
#include "mm.h"
#include "mgacontext.h"
#include "mgadd.h"
@@ -47,7 +43,7 @@
#include "X86/common_x86_asm.h"
#endif
-#define MGA_DATE "20020221"
+#define MGA_DATE "20021125"
/***************************************
@@ -137,15 +133,17 @@ void mgaDDExtensionsInit( GLcontext *ctx )
_mesa_enable_extension( ctx, "GL_EXT_paletted_texture" );
*/
- /* Support multitexture only on the g400.
+ _mesa_enable_extension( ctx, "GL_ARB_texture_compression" );
+ _mesa_enable_extension( ctx, "GL_ARB_multisample" );
+
+ _mesa_enable_extension( ctx, "GL_SGIS_generate_mipmap" );
+
+ /* Turn on multitexture and texenv_add for the G400.
*/
if (MGA_IS_G400(MGA_CONTEXT(ctx))) {
_mesa_enable_extension( ctx, "GL_ARB_multitexture" );
- }
+ _mesa_enable_extension( ctx, "GL_ARB_texture_env_add" );
- /* Turn on texenv_add for the G400.
- */
- if (MGA_IS_G400(MGA_CONTEXT(ctx))) {
_mesa_enable_extension( ctx, "GL_EXT_texture_env_add" );
#if defined (MESA_packed_depth_stencil)
@@ -164,5 +162,6 @@ void mgaDDExtensionsInit( GLcontext *ctx )
void mgaDDInitDriverFuncs( GLcontext *ctx )
{
ctx->Driver.GetBufferSize = mgaBufferSize;
+ ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
ctx->Driver.GetString = mgaDDGetString;
}
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c b/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c
index 07b5052fe..22fcaf6b8 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c
@@ -22,13 +22,11 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
* Gareth Hughes <gareth@valinux.com>
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaioctl.c,v 1.14 2002/09/18 17:11:40 tsi Exp $ */
-#include <stdio.h>
-
#include "mtypes.h"
#include "macros.h"
#include "dd.h"
@@ -43,23 +41,31 @@
#include "mgaioctl.h"
#include "mgatris.h"
#include "mgabuffers.h"
+#include "mga_common.h"
-#include "drm.h"
-#include "xf86drmMga.h"
-
static void mga_iload_dma_ioctl(mgaContextPtr mmesa,
unsigned long dest,
int length)
{
drmBufPtr buf = mmesa->iload_buffer;
- int ret;
+ drmMGAIload iload;
+ int ret, i;
if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL)
fprintf(stderr, "DRM_IOCTL_MGA_ILOAD idx %d dst %x length %d\n",
buf->idx, (int) dest, length);
- ret = drmMGATextureLoad( mmesa->driFd, buf->idx, dest, length );
+ iload.idx = buf->idx;
+ iload.dstorg = dest;
+ iload.length = length;
+
+ i = 0;
+ do {
+ ret = drmCommandWrite( mmesa->driFd, DRM_MGA_ILOAD,
+ &iload, sizeof(drmMGAIload) );
+ } while ( ret == -EBUSY && i++ < DRM_MGA_IDLE_RETRY );
+
if ( ret < 0 ) {
printf("send iload retcode = %d\n", ret);
exit(1);
@@ -155,6 +161,7 @@ mgaDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
int ret;
int i;
static int nrclears;
+ drmMGAClearRec clear;
FLUSH_BATCH( mmesa );
@@ -242,9 +249,13 @@ mgaDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
mmesa->sarea->nbox = n;
- ret = drmMGAClear( mmesa->driFd, flags,
- clear_color, clear_depth,
- color_mask, depth_mask );
+ clear.flags = flags;
+ clear.clear_color = clear_color;
+ clear.clear_depth = clear_depth;
+ clear.color_mask = color_mask;
+ clear.depth_mask = depth_mask;
+ ret = drmCommandWrite( mmesa->driFd, DRM_MGA_CLEAR,
+ &clear, sizeof(drmMGAClearRec));
if ( ret ) {
fprintf( stderr, "send clear retcode = %d\n", ret );
exit( 1 );
@@ -254,7 +265,7 @@ mgaDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
UNLOCK_HARDWARE( mmesa );
- mmesa->dirty |= MGA_UPLOAD_CLIPRECTS;
+ mmesa->dirty |= MGA_UPLOAD_CLIPRECTS|MGA_UPLOAD_CONTEXT;
}
if (mask)
@@ -265,13 +276,42 @@ mgaDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
int nrswaps;
+void mgaWaitForVBlank( mgaContextPtr mmesa )
+{
+ drmVBlank vbl;
+ int ret;
+
+ if ( !mmesa->mgaScreen->irq )
+ return;
+
+ if ( getenv("LIBGL_SYNC_REFRESH") ) {
+ /* Wait for until the next vertical blank */
+ vbl.request.type = DRM_VBLANK_RELATIVE;
+ vbl.request.sequence = 1;
+ } else if ( getenv("LIBGL_THROTTLE_REFRESH") ) {
+ /* Wait for at least one vertical blank since the last call */
+ vbl.request.type = DRM_VBLANK_ABSOLUTE;
+ vbl.request.sequence = mmesa->vbl_seq + 1;
+ } else {
+ return;
+ }
+
+ if ((ret = drmWaitVBlank( mmesa->driFd, &vbl ))) {
+ fprintf(stderr, "%s: drmWaitVBlank returned %d, IRQs don't seem to be"
+ " working correctly.\nTry running with LIBGL_THROTTLE_REFRESH"
+ " and LIBL_SYNC_REFRESH unset.\n", __FUNCTION__, ret);
+ exit(1);
+ }
+
+ mmesa->vbl_seq = vbl.reply.sequence;
+}
+
/*
* Copy the back buffer to the front buffer.
*/
-void mgaSwapBuffers(Display *dpy, void *drawablePrivate)
+void mgaSwapBuffers( __DRIdrawablePrivate *dPriv )
{
- __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
mgaContextPtr mmesa;
XF86DRIClipRectPtr pbox;
GLint nbox;
@@ -287,6 +327,8 @@ void mgaSwapBuffers(Display *dpy, void *drawablePrivate)
FLUSH_BATCH( mmesa );
+ mgaWaitForVBlank( mmesa );
+
LOCK_HARDWARE( mmesa );
last_frame = mmesa->sarea->last_frame.head;
@@ -340,7 +382,7 @@ void mgaSwapBuffers(Display *dpy, void *drawablePrivate)
if (0)
fprintf(stderr, "DRM_IOCTL_MGA_SWAP\n");
- ret = drmMGASwapBuffers( mmesa->driFd );
+ ret = drmCommandNone( mmesa->driFd, DRM_MGA_SWAP );
if ( ret ) {
printf("send swap retcode = %d\n", ret);
exit(1);
@@ -425,6 +467,7 @@ void mgaFlushVerticesLocked( mgaContextPtr mmesa )
XF86DRIClipRectPtr pbox = mmesa->pClipRects;
int nbox = mmesa->numClipRects;
drmBufPtr buffer = mmesa->vertex_dma_buffer;
+ drmMGAVertex vertex;
int i;
mmesa->vertex_dma_buffer = 0;
@@ -459,7 +502,12 @@ void mgaFlushVerticesLocked( mgaContextPtr mmesa )
if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL)
fprintf(stderr, "Firing vertex -- case a nbox %d\n", nbox);
- drmMGAFlushVertexBuffer( mmesa->driFd, buffer->idx, buffer->used, 1 );
+ vertex.idx = buffer->idx;
+ vertex.used = buffer->used;
+ vertex.discard = 1;
+ drmCommandWrite( mmesa->driFd, DRM_MGA_VERTEX,
+ &vertex, sizeof(drmMGAVertex) );
+
age_mmesa(mmesa, mmesa->sarea->last_enqueue);
}
else
@@ -500,8 +548,13 @@ void mgaFlushVerticesLocked( mgaContextPtr mmesa )
discard = 1;
mmesa->sarea->dirty |= MGA_UPLOAD_CLIPRECTS;
- drmMGAFlushVertexBuffer( mmesa->driFd, buffer->idx,
- buffer->used, discard );
+
+ vertex.idx = buffer->idx;
+ vertex.used = buffer->used;
+ vertex.discard = discard;
+ drmCommandWrite( mmesa->driFd, DRM_MGA_VERTEX,
+ &vertex, sizeof(drmMGAVertex) );
+
age_mmesa(mmesa, mmesa->sarea->last_enqueue);
}
}
@@ -577,11 +630,53 @@ void mgaDDFlush( GLcontext *ctx )
void mgaReleaseBufLocked( mgaContextPtr mmesa, drmBufPtr buffer )
{
+ drmMGAVertex vertex;
+
if (!buffer) return;
- drmMGAFlushVertexBuffer( mmesa->driFd, buffer->idx, 0, 1 );
+ vertex.idx = buffer->idx;
+ vertex.used = 0;
+ vertex.discard = 1;
+ drmCommandWrite( mmesa->driFd, DRM_MGA_VERTEX,
+ &vertex, sizeof(drmMGAVertex) );
}
+int mgaFlushDMA( int fd, drmLockFlags flags )
+{
+ drmMGALock lock;
+ int ret, i = 0;
+
+ memset( &lock, 0, sizeof(drmMGALock) );
+
+ if ( flags & DRM_LOCK_QUIESCENT ) lock.flags |= DRM_LOCK_QUIESCENT;
+ if ( flags & DRM_LOCK_FLUSH ) lock.flags |= DRM_LOCK_FLUSH;
+ if ( flags & DRM_LOCK_FLUSH_ALL ) lock.flags |= DRM_LOCK_FLUSH_ALL;
+
+ do {
+ ret = drmCommandWrite( fd, DRM_MGA_FLUSH, &lock, sizeof(drmMGALock) );
+ } while ( ret && errno == EBUSY && i++ < DRM_MGA_IDLE_RETRY );
+
+ if ( ret == 0 )
+ return 0;
+ if ( errno != EBUSY )
+ return -errno;
+
+ if ( lock.flags & DRM_LOCK_QUIESCENT ) {
+ /* Only keep trying if we need quiescence.
+ */
+ lock.flags &= ~(DRM_LOCK_FLUSH | DRM_LOCK_FLUSH_ALL);
+
+ do {
+ ret = drmCommandWrite( fd, DRM_MGA_FLUSH, &lock, sizeof(drmMGALock) );
+ } while ( ret && errno == EBUSY && i++ < DRM_MGA_IDLE_RETRY );
+ }
+
+ if ( ret == 0 ) {
+ return 0;
+ } else {
+ return -errno;
+ }
+}
void mgaDDInitIoctlFuncs( GLcontext *ctx )
{
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaioctl.h b/xc/lib/GL/mesa/src/drv/mga/mgaioctl.h
index 0fcd9f67e..463999c23 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgaioctl.h
+++ b/xc/lib/GL/mesa/src/drv/mga/mgaioctl.h
@@ -22,7 +22,7 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
* Gareth Hughes <gareth@valinux.com>
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaioctl.h,v 1.10 2002/09/18 17:11:41 tsi Exp $ */
@@ -33,7 +33,8 @@
#include "mgacontext.h"
#include "mga_xmesa.h"
-void mgaSwapBuffers( Display *dpy, void *drawablePrivate );
+void mgaSwapBuffers( __DRIdrawablePrivate *dPriv );
+void mgaWaitForVBlank( mgaContextPtr mmesa );
GLuint *mgaAllocVertexDwords( mgaContextPtr mmesa, int dwords );
@@ -51,6 +52,7 @@ void mgaWaitAge( mgaContextPtr mmesa, int age );
void mgaFlushVertices( mgaContextPtr mmesa );
void mgaFlushVerticesLocked( mgaContextPtr mmesa );
void mgaReleaseBufLocked( mgaContextPtr mmesa, drmBufPtr buffer );
+int mgaFlushDMA( int fd, drmLockFlags flags );
void mgaDDFlush( GLcontext *ctx );
void mgaDDFinish( GLcontext *ctx );
@@ -98,9 +100,9 @@ GLuint *mgaAllocDmaLow( mgaContextPtr mmesa, int bytes )
#define UPDATE_LOCK( mmesa, flags ) \
do { \
- GLint ret = drmMGAFlushDMA( mmesa->driFd, flags ); \
+ GLint ret = mgaFlushDMA( mmesa->driFd, flags ); \
if ( ret < 0 ) { \
- drmMGAEngineReset( mmesa->driFd ); \
+ drmCommandNone( mmesa->driFd, DRM_MGA_RESET ); \
UNLOCK_HARDWARE( mmesa ); \
fprintf( stderr, "%s: flush ret=%d\n", __FUNCTION__, ret ); \
/*fprintf( stderr, "drmMGAFlushDMA: return = %d\n", ret );*/ \
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgapixel.c b/xc/lib/GL/mesa/src/drv/mga/mgapixel.c
index 7ab1fb0ad..d3cc4de8e 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgapixel.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgapixel.c
@@ -22,7 +22,7 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
* Gareth Hughes <gareth@valinux.com>
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgapixel.c,v 1.7 2002/09/18 17:11:41 tsi Exp $ */
@@ -37,10 +37,10 @@
#include "mgapixel.h"
#include "mgabuffers.h"
-#include "drm.h"
-#include "xf86drmMga.h"
+#include "mga_common.h"
#include "swrast/swrast.h"
+#include "imports.h"
#define IS_AGP_MEM( mmesa, p ) \
((unsigned long)mmesa->mgaScreen->buffers.map <= ((unsigned long)p) && \
@@ -134,7 +134,7 @@ check_color_per_fragment_ops( const GLcontext *ctx )
!ctx->Color.ColorMask[2] ||
!ctx->Color.ColorMask[3] ||
ctx->Color.ColorLogicOpEnabled ||
- ctx->Texture._ReallyEnabled ||
+ ctx->Texture._EnabledUnits ||
ctx->Depth.OcclusionTest
) &&
ctx->Current.RasterPosValid &&
@@ -220,9 +220,6 @@ mgaTryReadPixels( GLcontext *ctx,
GLvoid *pixels )
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
-#if 0
- drm_mga_blit_t blit;
-#endif
GLint size, skipPixels, skipRows;
GLint pitch = pack->RowLength ? pack->RowLength : width;
GLboolean ok;
@@ -230,6 +227,7 @@ mgaTryReadPixels( GLcontext *ctx,
GLuint planemask;
GLuint source;
#if 0
+ drmMGABlit blit;
GLuint dest;
GLint source_pitch, dest_pitch;
GLint delta_sx, delta_sy;
@@ -357,7 +355,8 @@ mgaTryReadPixels( GLcontext *ctx,
mmesa->sarea->nbox = n;
- if (n && (retcode = ioctl(mmesa->driFd, DRM_IOCTL_MGA_BLIT, &blit))) {
+ if (n && (retcode = drmCommandWrite( mmesa->driFd, DRM_MGA_BLIT,
+ &blit, sizeof(drmMGABlit)))) {
fprintf(stderr, "blit ioctl failed, retcode = %d\n", retcode);
UNLOCK_HARDWARE( mmesa );
exit(1);
@@ -393,20 +392,18 @@ static void do_draw_pix( GLcontext *ctx,
const void *pixels,
GLuint dest, GLuint planemask)
{
+#if 0
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
+ drmMGABlit blit;
__DRIdrawablePrivate *dPriv = mmesa->driDrawable;
-#if 0
- drm_mga_blit_t blit;
XF86DRIClipRectPtr pbox = dPriv->pClipRects;
int nbox = dPriv->numClipRects;
int retcode, i;
-#endif
y = dPriv->h - y - height;
x += mmesa->drawX;
y += mmesa->drawY;
-#if 0
blit.dest = dest;
blit.planemask = planemask;
blit.source = ((mmesa->mgaScreen->agp.handle + AGP_OFFSET(mmesa, pixels))
@@ -459,7 +456,8 @@ static void do_draw_pix( GLcontext *ctx,
mmesa->sarea->nbox = n;
- if (n && (retcode = ioctl(mmesa->driFd, DRM_IOCTL_MGA_BLIT, &blit))) {
+ if (n && (retcode = drmCommandWrite( mmesa->driFd, DRM_MGA_BLIT,
+ &blit, sizeof(drmMGABlit)))) {
fprintf(stderr, "blit ioctl failed, retcode = %d\n", retcode);
UNLOCK_HARDWARE( mmesa );
exit(1);
@@ -684,7 +682,6 @@ void mgaDDInitPixelFuncs( GLcontext *ctx )
ctx->Driver.CopyPixels = _swrast_CopyPixels;
ctx->Driver.DrawPixels = _swrast_DrawPixels;
ctx->Driver.ReadPixels = _swrast_ReadPixels;
- ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
if (getenv("MGA_BLIT_PIXELS")) {
ctx->Driver.ReadPixels = mgaDDReadPixels; /* requires agp dest */
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgarender.c b/xc/lib/GL/mesa/src/drv/mga/mgarender.c
index 928d278b2..e4d2a51fa 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgarender.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgarender.c
@@ -29,7 +29,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
/*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*
*/
@@ -42,7 +42,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "glheader.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mtypes.h"
#include "mmath.h"
@@ -102,7 +102,7 @@ static void VERT_FALLBACK( GLcontext *ctx, GLuint start, GLuint count,
tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK );
tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 );
tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start, count, flags );
- MGA_CONTEXT(ctx)->SetupNewInputs |= VERT_CLIP;
+ MGA_CONTEXT(ctx)->SetupNewInputs |= VERT_BIT_CLIP;
}
#define LOCAL_VARS mgaContextPtr mmesa = MGA_CONTEXT(ctx)
@@ -165,20 +165,20 @@ static GLboolean mga_run_render( GLcontext *ctx,
static void mga_check_render( GLcontext *ctx, struct gl_pipeline_stage *stage )
{
- GLuint inputs = VERT_CLIP|VERT_RGBA;
+ GLuint inputs = VERT_BIT_CLIP | VERT_BIT_COLOR0;
if (ctx->RenderMode == GL_RENDER) {
if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
- inputs |= VERT_SPEC_RGB;
+ inputs |= VERT_BIT_COLOR1;
if (ctx->Texture.Unit[0]._ReallyEnabled)
- inputs |= VERT_TEX(0);
+ inputs |= VERT_BIT_TEX0;
if (ctx->Texture.Unit[1]._ReallyEnabled)
- inputs |= VERT_TEX(1);
+ inputs |= VERT_BIT_TEX1;
if (ctx->Fog.Enabled)
- inputs |= VERT_FOG_COORD;
+ inputs |= VERT_BIT_FOG;
}
stage->inputs = inputs;
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaspan.c b/xc/lib/GL/mesa/src/drv/mga/mgaspan.c
index c06914006..06c3466b2 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgaspan.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgaspan.c
@@ -22,7 +22,7 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaspan.c,v 1.10 2002/02/26 23:37:35 tsi Exp $ */
@@ -33,8 +33,6 @@
#include "mgaioctl.h"
#include "swrast/swrast.h"
-#include "xf86drmMga.h"
-
#define DBG 0
@@ -235,20 +233,28 @@ do { \
-static void mgaDDSetReadBuffer(GLcontext *ctx, GLframebuffer *buffer,
- GLenum mode )
+/*
+ * This function is called to specify which buffer to read and write
+ * for software rasterization (swrast) fallbacks. This doesn't necessarily
+ * correspond to glDrawBuffer() or glReadBuffer() calls.
+ */
+static void mgaDDSetBuffer(GLcontext *ctx, GLframebuffer *buffer,
+ GLuint bufferBit)
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- if (mode == GL_FRONT_LEFT)
+ if (bufferBit == FRONT_LEFT_BIT)
{
+ mmesa->drawOffset = mmesa->mgaScreen->frontOffset;
mmesa->readOffset = mmesa->mgaScreen->frontOffset;
- mmesa->read_buffer = MGA_FRONT;
}
- else
+ else if (bufferBit == BACK_LEFT_BIT)
{
+ mmesa->drawOffset = mmesa->mgaScreen->backOffset;
mmesa->readOffset = mmesa->mgaScreen->backOffset;
- mmesa->read_buffer = MGA_BACK;
+ }
+ else {
+ assert(0);
}
}
@@ -257,7 +263,7 @@ void mgaDDInitSpanFuncs( GLcontext *ctx )
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
- swdd->SetReadBuffer = mgaDDSetReadBuffer;
+ swdd->SetBuffer = mgaDDSetBuffer;
switch (mmesa->mgaScreen->cpp) {
case 2:
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgastate.c b/xc/lib/GL/mesa/src/drv/mga/mgastate.c
index 8c47cd111..5bb2e25f6 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgastate.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgastate.c
@@ -22,13 +22,13 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.c,v 1.12 2002/02/22 21:44:55 dawes Exp $ */
-#include <stdio.h>
#include "mtypes.h"
+#include "colormac.h"
#include "dd.h"
#include "mm.h"
@@ -48,7 +48,6 @@
#include "swrast_setup/swrast_setup.h"
-
/* Some outstanding problems with accelerating logic ops...
*/
#if defined(ACCEL_ROP)
@@ -72,11 +71,11 @@ static void mgaUpdateStencil(const GLcontext *ctx)
if (ctx->Stencil.Enabled)
{
- stencil = ctx->Stencil.Ref |
- ( ctx->Stencil.ValueMask << 8 ) |
- ( ctx->Stencil.WriteMask << 16 );
+ stencil = ctx->Stencil.Ref[0] |
+ ( ctx->Stencil.ValueMask[0] << 8 ) |
+ ( ctx->Stencil.WriteMask[0] << 16 );
- switch (ctx->Stencil.Function)
+ switch (ctx->Stencil.Function[0])
{
case GL_NEVER:
MGA_SET_FIELD(stencilctl, SC_smode_MASK, SC_smode_snever);
@@ -105,7 +104,7 @@ static void mgaUpdateStencil(const GLcontext *ctx)
break;
}
- switch (ctx->Stencil.FailFunc)
+ switch (ctx->Stencil.FailFunc[0])
{
case GL_KEEP:
MGA_SET_FIELD(stencilctl, SC_sfailop_MASK, SC_sfailop_keep);
@@ -129,7 +128,7 @@ static void mgaUpdateStencil(const GLcontext *ctx)
break;
}
- switch (ctx->Stencil.ZFailFunc)
+ switch (ctx->Stencil.ZFailFunc[0])
{
case GL_KEEP:
MGA_SET_FIELD(stencilctl, SC_szfailop_MASK, SC_szfailop_keep);
@@ -153,7 +152,7 @@ static void mgaUpdateStencil(const GLcontext *ctx)
break;
}
- switch (ctx->Stencil.ZPassFunc)
+ switch (ctx->Stencil.ZPassFunc[0])
{
case GL_KEEP:
MGA_SET_FIELD(stencilctl, SC_szpassop_MASK, SC_szpassop_keep);
@@ -269,7 +268,7 @@ static void mgaUpdateZMode(const GLcontext *ctx)
}
-static void mgaDDAlphaFunc(GLcontext *ctx, GLenum func, GLchan ref)
+static void mgaDDAlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
{
FLUSH_BATCH( MGA_CONTEXT(ctx) );
MGA_CONTEXT(ctx)->new_state |= MGA_NEW_ALPHA;
@@ -380,7 +379,7 @@ static void mgaUpdateAlphaMode(GLcontext *ctx)
int a = 0;
/* determine source of alpha for blending and testing */
- if ( !ctx->Texture._ReallyEnabled ) {
+ if (ctx->Texture._EnabledUnits == 0) {
a |= AC_alphasel_diffused;
}
else {
@@ -415,7 +414,7 @@ static void mgaUpdateAlphaMode(GLcontext *ctx)
/* alpha test control.
*/
if (ctx->Color.AlphaEnabled) {
- GLubyte ref = ctx->Color.AlphaRef;
+ GLubyte ref = (GLint) (ctx->Color.AlphaRef * 255.0);
switch (ctx->Color.AlphaFunc) {
case GL_NEVER:
a |= AC_atmode_alt;
@@ -575,13 +574,17 @@ static void mgaDDScissor( GLcontext *ctx, GLint x, GLint y,
static void mgaDDClearColor(GLcontext *ctx,
- const GLchan color[4] )
+ const GLfloat color[4] )
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
+ GLubyte c[4];
+ CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
+ CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]);
mmesa->ClearColor = mgaPackColor( mmesa->mgaScreen->cpp,
- color[0], color[1],
- color[2], color[3]);
+ c[0], c[1], c[2], c[3]);
}
@@ -608,7 +611,8 @@ void mgaUpdateCull( GLcontext *ctx )
mode ^= (_CULL_POSITIVE ^ _CULL_NEGATIVE);
if (ctx->Polygon.FrontFace != GL_CCW)
mode ^= (_CULL_POSITIVE ^ _CULL_NEGATIVE);
- if (ctx->Texture._ReallyEnabled == (TEXTURE0_2D|TEXTURE1_2D))
+ if (ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT &&
+ ctx->Texture.Unit[1]._ReallyEnabled == TEXTURE_2D_BIT)
mode ^= (_CULL_POSITIVE ^ _CULL_NEGATIVE); /* warp bug? */
}
@@ -799,7 +803,7 @@ void mgaEmitHwStateLocked( mgaContextPtr mmesa )
/* This is a bit of a hack but seems to be the best place to ensure
* that separate specular is disabled when not needed.
*/
- if (mmesa->glCtx->Texture._ReallyEnabled == 0 ||
+ if (mmesa->glCtx->Texture._EnabledUnits == 0 ||
!mmesa->glCtx->Light.Enabled ||
mmesa->glCtx->Light.Model.ColorControl == GL_SINGLE_COLOR) {
sarea->TexState[0].texctl2 &= ~TMC_specen_enable;
@@ -1001,13 +1005,15 @@ void mgaInitState( mgaContextPtr mmesa )
mgaScreenPrivate *mgaScreen = mmesa->mgaScreen;
GLcontext *ctx = mmesa->glCtx;
- if (ctx->Color.DriverDrawBuffer == GL_BACK_LEFT) {
+ if (ctx->Visual.doubleBufferMode) {
+ /* use back buffer by default */
mmesa->draw_buffer = MGA_BACK;
mmesa->read_buffer = MGA_BACK;
mmesa->drawOffset = mmesa->mgaScreen->backOffset;
mmesa->readOffset = mmesa->mgaScreen->backOffset;
mmesa->setup.dstorg = mgaScreen->backOffset;
} else {
+ /* use front buffer by default */
mmesa->draw_buffer = MGA_FRONT;
mmesa->read_buffer = MGA_FRONT;
mmesa->drawOffset = mmesa->mgaScreen->frontOffset;
@@ -1102,7 +1108,8 @@ void mgaDDInitStateFuncs( GLcontext *ctx )
ctx->Driver.FrontFace = mgaDDCullFaceFrontFace;
ctx->Driver.ColorMask = mgaDDColorMask;
- ctx->Driver.SetDrawBuffer = mgaDDSetDrawBuffer;
+ ctx->Driver.DrawBuffer = mgaDDDrawBuffer;
+ ctx->Driver.ReadBuffer = mgaDDReadBuffer;
ctx->Driver.ClearColor = mgaDDClearColor;
ctx->Driver.ClearDepth = mgaDDClearDepth;
ctx->Driver.LogicOpcode = mgaDDLogicOp;
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatex.c b/xc/lib/GL/mesa/src/drv/mga/mgatex.c
index 8a8daee32..40f5c13a9 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgatex.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgatex.c
@@ -22,14 +22,11 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.c,v 1.13 2002/02/22 21:44:55 dawes Exp $ */
-#include <stdlib.h>
-#include <stdio.h>
-#include <GL/gl.h>
-
+#include "glheader.h"
#include "mm.h"
#include "mgacontext.h"
#include "mgatex.h"
@@ -39,7 +36,7 @@
#include "enums.h"
#include "simple_list.h"
-#include "mem.h"
+#include "imports.h"
#include "macros.h"
#include "texformat.h"
#include "texstore.h"
@@ -189,8 +186,9 @@ static GLint mgaChooseTexFormat( mgaContextPtr mmesa,
* got to be better than sticking them way down the end of this
* huge list.
*/
- case GL_RGBA:
case 4:
+ case GL_RGBA:
+ case GL_COMPRESSED_RGBA:
if ( format == GL_BGRA ) {
if ( type == GL_UNSIGNED_INT_8_8_8_8_REV ) {
SET_FORMAT( TMC_tformat_tw32, _mesa_texformat_argb8888 );
@@ -207,8 +205,9 @@ static GLint mgaChooseTexFormat( mgaContextPtr mmesa,
TMC_tformat_tw12, _mesa_texformat_argb4444 );
break;
- case GL_RGB:
case 3:
+ case GL_RGB:
+ case GL_COMPRESSED_RGB:
if ( format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 ) {
SET_FORMAT( TMC_tformat_tw16, _mesa_texformat_rgb565 );
break;
@@ -256,6 +255,7 @@ static GLint mgaChooseTexFormat( mgaContextPtr mmesa,
case GL_ALPHA8:
case GL_ALPHA12:
case GL_ALPHA16:
+ case GL_COMPRESSED_ALPHA:
/* FIXME: This will report incorrect component sizes... */
SET_FORMAT( TMC_tformat_tw12, _mesa_texformat_argb4444 );
break;
@@ -266,6 +266,7 @@ static GLint mgaChooseTexFormat( mgaContextPtr mmesa,
case GL_LUMINANCE8:
case GL_LUMINANCE12:
case GL_LUMINANCE16:
+ case GL_COMPRESSED_LUMINANCE:
/* FIXME: This will report incorrect component sizes... */
SET_FORMAT( TMC_tformat_tw16, _mesa_texformat_rgb565 );
break;
@@ -278,6 +279,7 @@ static GLint mgaChooseTexFormat( mgaContextPtr mmesa,
case GL_LUMINANCE12_ALPHA4:
case GL_LUMINANCE12_ALPHA12:
case GL_LUMINANCE16_ALPHA16:
+ case GL_COMPRESSED_LUMINANCE_ALPHA:
/* FIXME: This will report incorrect component sizes... */
SET_FORMAT( TMC_tformat_tw12, _mesa_texformat_argb4444 );
break;
@@ -287,6 +289,7 @@ static GLint mgaChooseTexFormat( mgaContextPtr mmesa,
case GL_INTENSITY8:
case GL_INTENSITY12:
case GL_INTENSITY16:
+ case GL_COMPRESSED_INTENSITY:
/* FIXME: This will report incorrect component sizes... */
SET_FORMAT( TMC_tformat_tw12, _mesa_texformat_argb4444 );
break;
@@ -417,7 +420,7 @@ static void mgaCreateTexObj(mgaContextPtr mmesa,
/* set all the register values for filtering, border, etc */
mgaSetTexWrapping( t, tObj->WrapS, tObj->WrapT );
mgaSetTexFilter( t, tObj->MinFilter, tObj->MagFilter );
- mgaSetTexBorderColor( t, tObj->BorderColor );
+ mgaSetTexBorderColor( t, tObj->_BorderChan );
}
@@ -669,7 +672,7 @@ static void mgaUpdateTextureObject( GLcontext *ctx, int hw_unit )
enabled = ctx->Texture.Unit[gl_unit]._ReallyEnabled;
tObj = ctx->Texture.Unit[gl_unit]._Current;
- if (enabled != TEXTURE0_2D) {
+ if (enabled != TEXTURE_2D_BIT) {
if (enabled)
FALLBACK( ctx, MGA_FALLBACK_TEXTURE, GL_TRUE );
return;
@@ -702,7 +705,8 @@ static void mgaUpdateTextureObject( GLcontext *ctx, int hw_unit )
/* mgaUpdateTexLRU( mmesa, t ); */
t->setup.texctl2 &= ~TMC_dualtex_enable;
- if (ctx->Texture._ReallyEnabled == (TEXTURE0_2D|TEXTURE1_2D))
+ if (ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT &&
+ ctx->Texture.Unit[1]._ReallyEnabled == TEXTURE_2D_BIT)
t->setup.texctl2 |= TMC_dualtex_enable;
t->setup.texctl2 &= ~TMC_specen_enable;
@@ -732,7 +736,8 @@ void mgaUpdateTextureState( GLcontext *ctx )
mmesa->CurrentTexObj[1] = 0;
}
- if (ctx->Texture._ReallyEnabled == TEXTURE1_2D) {
+ if (ctx->Texture.Unit[0]._ReallyEnabled == 0 &&
+ ctx->Texture.Unit[1]._ReallyEnabled == TEXTURE_2D_BIT) {
mmesa->tmu_source[0] = 1;
} else {
mmesa->tmu_source[0] = 0;
@@ -744,7 +749,8 @@ void mgaUpdateTextureState( GLcontext *ctx )
mmesa->setup.tdualstage1 = mmesa->setup.tdualstage0;
- if (ctx->Texture._ReallyEnabled == (TEXTURE0_2D|TEXTURE1_2D)) {
+ if (ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT &&
+ ctx->Texture.Unit[1]._ReallyEnabled == TEXTURE_2D_BIT) {
mgaUpdateTextureObject( ctx, 1 );
mgaUpdateTextureEnvG400( ctx, 1 );
mmesa->dirty |= MGA_UPLOAD_TEX1;
@@ -757,7 +763,7 @@ void mgaUpdateTextureState( GLcontext *ctx )
mmesa->dirty |= MGA_UPLOAD_CONTEXT | MGA_UPLOAD_TEX0;
mmesa->setup.dwgctl &= DC_opcod_MASK;
- mmesa->setup.dwgctl |= (ctx->Texture._ReallyEnabled
+ mmesa->setup.dwgctl |= (ctx->Texture._EnabledUnits
? DC_opcod_texture_trap
: DC_opcod_trap);
}
@@ -889,7 +895,7 @@ mgaDDTexParameter( GLcontext *ctx, GLenum target,
case GL_TEXTURE_BORDER_COLOR:
FLUSH_BATCH(mmesa);
- mgaSetTexBorderColor(t,tObj->BorderColor);
+ mgaSetTexBorderColor(t, tObj->_BorderChan);
break;
default:
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatexcnv.c b/xc/lib/GL/mesa/src/drv/mga/mgatexcnv.c
index aa26d181e..35df6a830 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgatexcnv.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgatexcnv.c
@@ -23,12 +23,9 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
-#include <stdlib.h>
-#include <stdio.h>
-
#include <GL/gl.h>
#include "mm.h"
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatexmem.c b/xc/lib/GL/mesa/src/drv/mga/mgatexmem.c
index 641f29e14..b7929a269 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgatexmem.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgatexmem.c
@@ -22,13 +22,11 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatexmem.c,v 1.6 2002/02/26 23:37:35 tsi Exp $ */
-#include <stdlib.h>
-#include <stdio.h>
-#include <GL/gl.h>
+#include "glheader.h"
#include "mm.h"
#include "mgacontext.h"
@@ -36,11 +34,9 @@
#include "mgaregs.h"
#include "mgaioctl.h"
-#include "mem.h"
+#include "imports.h"
#include "simple_list.h"
-#include "xf86drmMga.h"
-
static void
mgaSwapOutTexObj(mgaContextPtr mmesa, mgaTextureObjectPtr t)
{
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatris.c b/xc/lib/GL/mesa/src/drv/mga/mgatris.c
index 17a8f69a1..2db3fed0f 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgatris.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgatris.c
@@ -22,13 +22,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.c,v 1.9 2002/02/22 21:44:56 dawes Exp $ */
-#include <stdio.h>
-#include <math.h>
-
#include "mtypes.h"
#include "macros.h"
#include "colormac.h"
@@ -665,9 +662,9 @@ static void mgaFastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
int i,j;
for (i = 2 ; i < n ; i++) {
- EMIT_VERT( j, vb, vertex_size, (mgaVertexPtr) start );
EMIT_VERT( j, vb, vertex_size, (mgaVertexPtr) VERT(elts[i-1]) );
EMIT_VERT( j, vb, vertex_size, (mgaVertexPtr) VERT(elts[i]) );
+ EMIT_VERT( j, vb, vertex_size, (mgaVertexPtr) start );
}
}
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgavb.c b/xc/lib/GL/mesa/src/drv/mga/mgavb.c
index f5d7e7e40..57e24fa0e 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgavb.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgavb.c
@@ -22,7 +22,7 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgavb.c,v 1.13 2002/02/26 23:37:35 tsi Exp $ */
@@ -34,7 +34,7 @@
#include "glheader.h"
#include "mtypes.h"
-#include "mem.h"
+#include "imports.h"
#include "macros.h"
#include "colormac.h"
#include "mmath.h"
@@ -43,9 +43,6 @@
#include "swrast_setup/swrast_setup.h"
#include "swrast/swrast.h"
-#include <stdio.h>
-#include <stdlib.h>
-
#define MGA_TEX1_BIT 0x1
#define MGA_TEX0_BIT 0x2
@@ -88,11 +85,12 @@ static struct {
#define VERTEX mgaVertex
+#define VERTEX_COLOR mga_color_t
#define LOCALVARS mgaContextPtr mmesa = MGA_CONTEXT(ctx);
#define GET_VIEWPORT_MAT() mmesa->hw_viewport
#define GET_TEXSOURCE(n) mmesa->tmu_source[n]
#define GET_VERTEX_FORMAT() mmesa->vertex_format
-#define GET_VERTEX_STORE() (GLubyte *)(mmesa->verts)
+#define GET_VERTEX_STORE() mmesa->verts
#define GET_VERTEX_STRIDE_SHIFT() mmesa->vertex_stride_shift
#define GET_UBYTE_COLOR_STORE() &mmesa->UbyteColor
#define GET_UBYTE_SPEC_COLOR_STORE() &mmesa->UbyteSecondaryColor
@@ -124,8 +122,8 @@ static struct {
#define IMPORT_FLOAT_COLORS mga_import_float_colors
#define IMPORT_FLOAT_SPEC_COLORS mga_import_float_spec_colors
-#define INTERP_VERTEX setup_tab[mmesa->SetupIndex].interp
-#define COPY_PV_VERTEX setup_tab[mmesa->SetupIndex].copy_pv
+#define INTERP_VERTEX setup_tab[MGA_CONTEXT(ctx)->SetupIndex].interp
+#define COPY_PV_VERTEX setup_tab[MGA_CONTEXT(ctx)->SetupIndex].copy_pv
/***********************************************************************
@@ -362,24 +360,24 @@ void mgaBuildVertices( GLcontext *ctx,
if (!newinputs)
return;
- if (newinputs & VERT_CLIP) {
+ if (newinputs & VERT_BIT_CLIP) {
setup_tab[mmesa->SetupIndex].emit( ctx, start, count, v, stride );
} else {
GLuint ind = 0;
- if (newinputs & VERT_RGBA)
+ if (newinputs & VERT_BIT_COLOR0)
ind |= MGA_RGBA_BIT;
- if (newinputs & VERT_SPEC_RGB)
+ if (newinputs & VERT_BIT_COLOR1)
ind |= MGA_SPEC_BIT;
- if (newinputs & VERT_TEX0)
+ if (newinputs & VERT_BIT_TEX0)
ind |= MGA_TEX0_BIT;
- if (newinputs & VERT_TEX1)
+ if (newinputs & VERT_BIT_TEX1)
ind |= MGA_TEX0_BIT|MGA_TEX1_BIT;
- if (newinputs & VERT_FOG_COORD)
+ if (newinputs & VERT_BIT_FOG)
ind |= MGA_FOG_BIT;
if (mmesa->SetupIndex & MGA_PTEX_BIT)
@@ -406,15 +404,18 @@ void mgaChooseVertexState( GLcontext *ctx )
if (ctx->Fog.Enabled)
ind |= MGA_FOG_BIT;
- if (ctx->Texture._ReallyEnabled & 0xf0) {
- if (ctx->Texture._ReallyEnabled & 0xf) {
+ if (ctx->Texture._EnabledUnits & 0x2) {
+ /* unit 1 enabled */
+ if (ctx->Texture._EnabledUnits & 0x1) {
+ /* unit 0 enabled */
ind |= MGA_TEX1_BIT|MGA_TEX0_BIT;
}
else {
ind |= MGA_TEX0_BIT;
}
}
- else if (ctx->Texture._ReallyEnabled & 0xf) {
+ else if (ctx->Texture._EnabledUnits & 0x1) {
+ /* unit 0 enabled */
ind |= MGA_TEX0_BIT;
}
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_context.c b/xc/lib/GL/mesa/src/drv/r128/r128_context.c
index 38342be45..e06e4c168 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_context.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_context.c
@@ -33,7 +33,18 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
-#include <stdlib.h>
+#include "glheader.h"
+#include "context.h"
+#include "simple_list.h"
+#include "imports.h"
+#include "matrix.h"
+
+#include "swrast/swrast.h"
+#include "swrast_setup/swrast_setup.h"
+#include "array_cache/acache.h"
+
+#include "tnl/tnl.h"
+#include "tnl/t_pipeline.h"
#include "r128_context.h"
#include "r128_ioctl.h"
@@ -44,19 +55,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r128_tris.h"
#include "r128_vb.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "array_cache/acache.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-
-#include "context.h"
-#include "simple_list.h"
-#include "mem.h"
-#include "matrix.h"
-
#ifndef R128_DEBUG
int R128_DEBUG = (0
/* | DEBUG_ALWAYS_SYNC */
@@ -71,7 +69,7 @@ int R128_DEBUG = (0
/* Create the device specific context.
*/
-GLboolean r128CreateContext( Display *dpy, const __GLcontextModes *glVisual,
+GLboolean r128CreateContext( const __GLcontextModes *glVisual,
__DRIcontextPrivate *driContextPriv,
void *sharedContextPrivate )
{
@@ -91,7 +89,7 @@ GLboolean r128CreateContext( Display *dpy, const __GLcontextModes *glVisual,
shareCtx = ((r128ContextPtr) sharedContextPrivate)->glCtx;
else
shareCtx = NULL;
- rmesa->glCtx = _mesa_create_context(glVisual, shareCtx, rmesa, GL_TRUE);
+ rmesa->glCtx = _mesa_create_context(glVisual, shareCtx, (void *) rmesa, GL_TRUE);
if (!rmesa->glCtx) {
FREE(rmesa);
return GL_FALSE;
@@ -99,7 +97,6 @@ GLboolean r128CreateContext( Display *dpy, const __GLcontextModes *glVisual,
driContextPriv->driverPrivate = rmesa;
ctx = rmesa->glCtx;
- rmesa->display = dpy;
rmesa->driContext = driContextPriv;
rmesa->driScreen = sPriv;
rmesa->driDrawable = NULL;
@@ -218,6 +215,7 @@ void r128DestroyContext( __DRIcontextPrivate *driContextPriv )
r128DestroyTexObj( rmesa, t );
}
mmDestroy( rmesa->texHeap[i] );
+ rmesa->texHeap[i] = NULL;
}
foreach_s ( t, next_t, &rmesa->SwappedOut ) {
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_context.h b/xc/lib/GL/mesa/src/drv/r128/r128_context.h
index a0cd5ca60..0b4dc0e92 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_context.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_context.h
@@ -38,16 +38,13 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifdef GLX_DIRECT_RENDERING
-#include <X11/Xlibint.h>
-
#include "dri_util.h"
#include "xf86drm.h"
-#include "xf86drmR128.h"
+#include "r128_common.h"
#include "mtypes.h"
-#include "r128_sarea.h"
#include "r128_reg.h"
struct r128_context;
@@ -184,7 +181,6 @@ struct r128_context {
/* Drawable, cliprect and scissor information
*/
- GLenum DrawBuffer; /* Optimize draw buffer update */
GLint drawOffset, drawPitch;
GLint readOffset, readPitch;
@@ -196,13 +192,11 @@ struct r128_context {
/* Mirrors of some DRI state
*/
- Display *display; /* X server display */
-
__DRIcontextPrivate *driContext; /* DRI context */
__DRIscreenPrivate *driScreen; /* DRI screen */
__DRIdrawablePrivate *driDrawable; /* DRI drawable bound to this ctx */
- int lastStamp; /* mirror driDrawable->lastStamp */
+ unsigned int lastStamp; /* mirror driDrawable->lastStamp */
drmContext hHWContext;
drmLock *driHwLock;
@@ -220,6 +214,10 @@ struct r128_context {
GLuint c_textureSwaps;
GLuint c_textureBytes;
GLuint c_vertexBuffers;
+
+ /* VBI
+ */
+ GLuint vbl_seq;
};
#define R128_CONTEXT(ctx) ((r128ContextPtr)(ctx->DriverCtx))
@@ -232,8 +230,7 @@ struct r128_context {
(rmesa->r128Screen->chipset == R128_CARD_TYPE_R128_MOBILITY)
-extern GLboolean r128CreateContext( Display *dpy,
- const __GLcontextModes *glVisual,
+extern GLboolean r128CreateContext( const __GLcontextModes *glVisual,
__DRIcontextPrivate *driContextPriv,
void *sharedContextPrivate );
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_dd.c b/xc/lib/GL/mesa/src/drv/r128/r128_dd.c
index 36af02ce7..8bfdc165d 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_dd.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_dd.c
@@ -45,7 +45,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "X86/common_x86_asm.h"
#endif
-#define R128_DATE "20020221"
+#define R128_DATE "20021125"
/* Return the width and height of the current color buffer.
@@ -183,6 +183,7 @@ void r128DDInitExtensions( GLcontext *ctx )
void r128DDInitDriverFuncs( GLcontext *ctx )
{
ctx->Driver.GetBufferSize = r128DDGetBufferSize;
+ ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
ctx->Driver.GetString = r128DDGetString;
ctx->Driver.Finish = r128DDFinish;
ctx->Driver.Flush = r128DDFlush;
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c b/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c
index 70f56353a..cb042b846 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c
@@ -36,12 +36,13 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r128_state.h"
#include "r128_ioctl.h"
-#include "mem.h"
+#include "imports.h"
#include "macros.h"
#include "swrast/swrast.h"
#define R128_TIMEOUT 2048
+#define R128_IDLE_RETRY 32
/* =============================================================
@@ -86,7 +87,7 @@ drmBufPtr r128GetBufferLocked( r128ContextPtr rmesa )
}
if ( !buf ) {
- drmR128EngineReset( fd );
+ drmCommandNone( fd, DRM_R128_CCE_RESET);
UNLOCK_HARDWARE( rmesa );
fprintf( stderr, "Error: Could not get new VB... exiting\n" );
exit( -1 );
@@ -103,6 +104,7 @@ void r128FlushVerticesLocked( r128ContextPtr rmesa )
int count = rmesa->num_verts;
int prim = rmesa->hw_primitive;
int fd = rmesa->driScreen->fd;
+ drmR128Vertex vertex;
int i;
rmesa->num_verts = 0;
@@ -128,7 +130,11 @@ void r128FlushVerticesLocked( r128ContextPtr rmesa )
rmesa->sarea->nbox = nbox;
}
- drmR128FlushVertexBuffer( fd, prim, buffer->idx, count, 1 );
+ vertex.prim = prim;
+ vertex.idx = buffer->idx;
+ vertex.count = count;
+ vertex.discard = 1;
+ drmCommandWrite( fd, DRM_R128_VERTEX, &vertex, sizeof(drmR128Vertex) );
}
else
{
@@ -149,7 +155,12 @@ void r128FlushVerticesLocked( r128ContextPtr rmesa )
}
rmesa->sarea->dirty |= R128_UPLOAD_CLIPRECTS;
- drmR128FlushVertexBuffer( fd, prim, buffer->idx, count, discard );
+
+ vertex.prim = prim;
+ vertex.idx = buffer->idx;
+ vertex.count = count;
+ vertex.discard = discard;
+ drmCommandWrite( fd, DRM_R128_VERTEX, &vertex, sizeof(drmR128Vertex) );
}
}
@@ -168,15 +179,24 @@ void r128FireBlitLocked( r128ContextPtr rmesa, drmBufPtr buffer,
GLint offset, GLint pitch, GLint format,
GLint x, GLint y, GLint width, GLint height )
{
+ drmR128Blit blit;
GLint ret;
- ret = drmR128TextureBlit( rmesa->driFd, buffer->idx,
- offset, pitch, format,
- x, y, width, height );
+ blit.idx = buffer->idx;
+ blit.offset = offset;
+ blit.pitch = pitch;
+ blit.format = format;
+ blit.x = x;
+ blit.y = y;
+ blit.width = width;
+ blit.height = height;
+
+ ret = drmCommandWrite( rmesa->driFd, DRM_R128_BLIT,
+ &blit, sizeof(drmR128Blit) );
if ( ret ) {
UNLOCK_HARDWARE( rmesa );
- fprintf( stderr, "drmR128TextureBlit: return = %d\n", ret );
+ fprintf( stderr, "DRM_R128_BLIT: return = %d\n", ret );
exit( 1 );
}
}
@@ -256,6 +276,8 @@ void r128CopyBuffer( const __DRIdrawablePrivate *dPriv )
rmesa->hardwareWentIdle = 0;
}
+ r128WaitForVBlank( rmesa );
+
nbox = dPriv->numClipRects;
for ( i = 0 ; i < nbox ; ) {
@@ -270,17 +292,20 @@ void r128CopyBuffer( const __DRIdrawablePrivate *dPriv )
}
rmesa->sarea->nbox = n;
- ret = drmR128SwapBuffers( rmesa->driFd );
+ ret = drmCommandNone( rmesa->driFd, DRM_R128_SWAP );
if ( ret ) {
UNLOCK_HARDWARE( rmesa );
- fprintf( stderr, "drmR128SwapBuffers: return = %d\n", ret );
+ fprintf( stderr, "DRM_R128_SWAP: return = %d\n", ret );
exit( 1 );
}
}
if ( R128_DEBUG & DEBUG_ALWAYS_SYNC ) {
- drmR128WaitForIdleCCE( rmesa->driFd );
+ i = 0;
+ do {
+ ret = drmCommandNone(rmesa->driFd, DRM_R128_CCE_IDLE);
+ } while ( ret && errno == EBUSY && i++ < R128_IDLE_RETRY );
}
UNLOCK_HARDWARE( rmesa );
@@ -325,15 +350,17 @@ void r128PageFlip( const __DRIdrawablePrivate *dPriv )
rmesa->hardwareWentIdle = 0;
}
+ r128WaitForVBlank( rmesa );
+
/* The kernel will have been initialized to perform page flipping
* on a swapbuffers ioctl.
*/
- ret = drmR128SwapBuffers( rmesa->driFd );
+ ret = drmCommandNone( rmesa->driFd, DRM_R128_SWAP );
UNLOCK_HARDWARE( rmesa );
if ( ret ) {
- fprintf( stderr, "drmR128SwapBuffers: return = %d\n", ret );
+ fprintf( stderr, "DRM_R128_SWAP: return = %d\n", ret );
exit( 1 );
}
@@ -373,6 +400,7 @@ static void r128DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
{
r128ContextPtr rmesa = R128_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = rmesa->driDrawable;
+ drmR128Clear clear;
GLuint flags = 0;
GLint i;
GLint ret;
@@ -395,23 +423,23 @@ static void r128DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
if ( mask & DD_FRONT_LEFT_BIT ) {
- flags |= DRM_R128_FRONT;
+ flags |= DRM_R128_FRONT_BUFFER;
mask &= ~DD_FRONT_LEFT_BIT;
}
if ( mask & DD_BACK_LEFT_BIT ) {
- flags |= DRM_R128_BACK;
+ flags |= DRM_R128_BACK_BUFFER;
mask &= ~DD_BACK_LEFT_BIT;
}
if ( ( mask & DD_DEPTH_BIT ) && ctx->Depth.Mask ) {
- flags |= DRM_R128_DEPTH;
+ flags |= DRM_R128_DEPTH_BUFFER;
mask &= ~DD_DEPTH_BIT;
}
#if 0
/* FIXME: Add stencil support */
if ( mask & DD_STENCIL_BIT ) {
- flags |= DRM_R128_DEPTH;
+ flags |= DRM_R128_DEPTH_BUFFER;
mask &= ~DD_STENCIL_BIT;
}
#endif
@@ -468,28 +496,25 @@ static void r128DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
if ( R128_DEBUG & DEBUG_VERBOSE_IOCTL ) {
fprintf( stderr,
- "drmR128Clear: flag 0x%x color %x depth %x nbox %d\n",
+ "DRM_R128_CLEAR: flag 0x%x color %x depth %x nbox %d\n",
flags,
(GLuint)rmesa->ClearColor,
(GLuint)rmesa->ClearDepth,
rmesa->sarea->nbox );
}
-/* ret = drmR128Clear( rmesa->driFd, */
-/* flags, */
-/* rmesa->ClearColor, */
-/* rmesa->setup.plane_3d_mask_c, */
-/* rmesa->ClearDepth ); */
+ clear.flags = flags;
+ clear.clear_color = rmesa->ClearColor;
+ clear.clear_depth = rmesa->ClearDepth;
+ clear.color_mask = rmesa->setup.plane_3d_mask_c;
+ clear.depth_mask = ~0;
- ret = drmR128Clear( rmesa->driFd, flags,
- rmesa->ClearColor,
- rmesa->ClearDepth,
- rmesa->setup.plane_3d_mask_c,
- ~0 ); /* depthmask */
+ ret = drmCommandWrite( rmesa->driFd, DRM_R128_CLEAR,
+ &clear, sizeof(drmR128Clear) );
if ( ret ) {
UNLOCK_HARDWARE( rmesa );
- fprintf( stderr, "drmR128Clear: return = %d\n", ret );
+ fprintf( stderr, "DRM_R128_CLEAR: return = %d\n", ret );
exit( 1 );
}
}
@@ -514,6 +539,7 @@ void r128WriteDepthSpanLocked( r128ContextPtr rmesa,
const GLubyte mask[] )
{
XF86DRIClipRectPtr pbox = rmesa->pClipRects;
+ drmR128Depth d;
int nbox = rmesa->numClipRects;
int fd = rmesa->driScreen->fd;
int i;
@@ -533,7 +559,15 @@ void r128WriteDepthSpanLocked( r128ContextPtr rmesa,
rmesa->sarea->nbox = nbox;
}
- drmR128WriteDepthSpan( fd, n, x, y, depth, mask );
+ d.func = DRM_R128_WRITE_SPAN;
+ d.n = n;
+ d.x = (int*)&x;
+ d.y = (int*)&y;
+ d.buffer = (unsigned int *)depth;
+ d.mask = (unsigned char *)mask;
+
+ drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(drmR128Depth));
+
}
else
{
@@ -547,7 +581,15 @@ void r128WriteDepthSpanLocked( r128ContextPtr rmesa,
}
rmesa->sarea->dirty |= R128_UPLOAD_CLIPRECTS;
- drmR128WriteDepthSpan( fd, n, x, y, depth, mask );
+
+ d.func = DRM_R128_WRITE_SPAN;
+ d.n = n;
+ d.x = (int*)&x;
+ d.y = (int*)&y;
+ d.buffer = (unsigned int *)depth;
+ d.mask = (unsigned char *)mask;
+
+ drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(drmR128Depth));
}
}
@@ -560,6 +602,7 @@ void r128WriteDepthPixelsLocked( r128ContextPtr rmesa, GLuint n,
const GLubyte mask[] )
{
XF86DRIClipRectPtr pbox = rmesa->pClipRects;
+ drmR128Depth d;
int nbox = rmesa->numClipRects;
int fd = rmesa->driScreen->fd;
int i;
@@ -579,7 +622,14 @@ void r128WriteDepthPixelsLocked( r128ContextPtr rmesa, GLuint n,
rmesa->sarea->nbox = nbox;
}
- drmR128WriteDepthPixels( fd, n, x, y, depth, mask );
+ d.func = DRM_R128_WRITE_PIXELS;
+ d.n = n;
+ d.x = (int*)&x;
+ d.y = (int*)&y;
+ d.buffer = (unsigned int *)depth;
+ d.mask = (unsigned char *)mask;
+
+ drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(drmR128Depth));
}
else
{
@@ -593,7 +643,15 @@ void r128WriteDepthPixelsLocked( r128ContextPtr rmesa, GLuint n,
}
rmesa->sarea->dirty |= R128_UPLOAD_CLIPRECTS;
- drmR128WriteDepthPixels( fd, n, x, y, depth, mask );
+
+ d.func = DRM_R128_WRITE_PIXELS;
+ d.n = n;
+ d.x = (int*)&x;
+ d.y = (int*)&y;
+ d.buffer = (unsigned int *)depth;
+ d.mask = (unsigned char *)mask;
+
+ drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(drmR128Depth));
}
}
@@ -604,6 +662,7 @@ void r128ReadDepthSpanLocked( r128ContextPtr rmesa,
GLuint n, GLint x, GLint y )
{
XF86DRIClipRectPtr pbox = rmesa->pClipRects;
+ drmR128Depth d;
int nbox = rmesa->numClipRects;
int fd = rmesa->driScreen->fd;
int i;
@@ -623,7 +682,14 @@ void r128ReadDepthSpanLocked( r128ContextPtr rmesa,
rmesa->sarea->nbox = nbox;
}
- drmR128ReadDepthSpan( fd, n, x, y );
+ d.func = DRM_R128_READ_SPAN;
+ d.n = n;
+ d.x = (int*)&x;
+ d.y = (int*)&y;
+ d.buffer = NULL;
+ d.mask = NULL;
+
+ drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(drmR128Depth));
}
else
{
@@ -637,7 +703,15 @@ void r128ReadDepthSpanLocked( r128ContextPtr rmesa,
}
rmesa->sarea->dirty |= R128_UPLOAD_CLIPRECTS;
- drmR128ReadDepthSpan( fd, n, x, y );
+
+ d.func = DRM_R128_READ_SPAN;
+ d.n = n;
+ d.x = (int*)&x;
+ d.y = (int*)&y;
+ d.buffer = NULL;
+ d.mask = NULL;
+
+ drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(drmR128Depth));
}
}
@@ -648,6 +722,7 @@ void r128ReadDepthPixelsLocked( r128ContextPtr rmesa, GLuint n,
const GLint x[], const GLint y[] )
{
XF86DRIClipRectPtr pbox = rmesa->pClipRects;
+ drmR128Depth d;
int nbox = rmesa->numClipRects;
int fd = rmesa->driScreen->fd;
int i;
@@ -667,7 +742,14 @@ void r128ReadDepthPixelsLocked( r128ContextPtr rmesa, GLuint n,
rmesa->sarea->nbox = nbox;
}
- drmR128ReadDepthPixels( fd, n, x, y );
+ d.func = DRM_R128_READ_PIXELS;
+ d.n = n;
+ d.x = (int*)&x;
+ d.y = (int*)&y;
+ d.buffer = NULL;
+ d.mask = NULL;
+
+ drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(drmR128Depth));
}
else
{
@@ -681,7 +763,15 @@ void r128ReadDepthPixelsLocked( r128ContextPtr rmesa, GLuint n,
}
rmesa->sarea->dirty |= R128_UPLOAD_CLIPRECTS;
- drmR128ReadDepthPixels( fd, n, x, y );
+
+ d.func = DRM_R128_READ_PIXELS;
+ d.n = n;
+ d.x = (int*)&x;
+ d.y = (int*)&y;
+ d.buffer = NULL;
+ d.mask = NULL;
+
+ drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(drmR128Depth));
}
}
@@ -693,20 +783,56 @@ void r128WaitForIdleLocked( r128ContextPtr rmesa )
{
int fd = rmesa->r128Screen->driScreen->fd;
int to = 0;
- int ret;
+ int ret, i;
do {
- ret = drmR128WaitForIdleCCE( fd );
+ i = 0;
+ do {
+ ret = drmCommandNone( fd, DRM_R128_CCE_IDLE);
+ } while ( ret && errno == EBUSY && i++ < R128_IDLE_RETRY );
} while ( ( ret == -EBUSY ) && ( to++ < R128_TIMEOUT ) );
if ( ret < 0 ) {
- drmR128EngineReset( fd );
+ drmCommandNone( fd, DRM_R128_CCE_RESET);
UNLOCK_HARDWARE( rmesa );
fprintf( stderr, "Error: Rage 128 timed out... exiting\n" );
exit( -1 );
}
}
+void r128WaitForVBlank( r128ContextPtr rmesa )
+{
+ drmVBlank vbl;
+ int ret;
+
+ if ( !rmesa->r128Screen->irq )
+ return;
+
+ if ( getenv("LIBGL_SYNC_REFRESH") ) {
+ /* Wait for until the next vertical blank */
+ vbl.request.type = DRM_VBLANK_RELATIVE;
+ vbl.request.sequence = 1;
+ } else if ( getenv("LIBGL_THROTTLE_REFRESH") ) {
+ /* Wait for at least one vertical blank since the last call */
+ vbl.request.type = DRM_VBLANK_ABSOLUTE;
+ vbl.request.sequence = rmesa->vbl_seq + 1;
+ } else {
+ return;
+ }
+
+ UNLOCK_HARDWARE( rmesa );
+
+ if ((ret = drmWaitVBlank( rmesa->driFd, &vbl ))) {
+ fprintf(stderr, "%s: drmWaitVBlank returned %d, IRQs don't seem to be"
+ " working correctly.\nTry running with LIBGL_THROTTLE_REFRESH"
+ " and LIBL_SYNC_REFRESH unset.\n", __FUNCTION__, ret);
+ exit(1);
+ }
+
+ rmesa->vbl_seq = vbl.reply.sequence;
+
+ LOCK_HARDWARE( rmesa );
+}
void r128DDInitIoctlFuncs( GLcontext *ctx )
{
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.h b/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.h
index 96fc3018f..aff80e9ee 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.h
@@ -42,7 +42,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r128_lock.h"
#include "xf86drm.h"
-#include "xf86drmR128.h"
+#include "r128_common.h"
#define R128_BUFFER_MAX_DWORDS (R128_BUFFER_SIZE / sizeof(CARD32))
@@ -89,6 +89,7 @@ extern void r128ReadDepthPixelsLocked( r128ContextPtr rmesa, GLuint n,
extern void r128CopyBuffer( const __DRIdrawablePrivate *dPriv );
extern void r128PageFlip( const __DRIdrawablePrivate *dPriv );
+void r128WaitForVBlank( r128ContextPtr rmesa );
extern void r128WaitForIdleLocked( r128ContextPtr rmesa );
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_lock.c b/xc/lib/GL/mesa/src/drv/r128/r128_lock.c
index 272a8a4f1..e94d30480 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_lock.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_lock.c
@@ -67,7 +67,7 @@ void r128GetLock( r128ContextPtr 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( rmesa->display, sPriv, dPriv );
+ DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
if ( rmesa->lastStamp != dPriv->lastStamp ) {
rmesa->lastStamp = dPriv->lastStamp;
@@ -86,7 +86,7 @@ void r128GetLock( r128ContextPtr rmesa, GLuint flags )
}
for ( i = 0 ; i < rmesa->lastTexHeap ; i++ ) {
- if ( sarea->texAge[i] != rmesa->lastTexAge[i] ) {
+ if ( rmesa->texHeap[i] && sarea->texAge[i] != rmesa->lastTexAge[i] ) {
r128AgeTextures( rmesa, i );
}
}
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_screen.c b/xc/lib/GL/mesa/src/drv/r128/r128_screen.c
index 6556cfe33..29dabd9b6 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_screen.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_screen.c
@@ -41,7 +41,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r128_vb.h"
#include "context.h"
-#include "mem.h"
+#include "imports.h"
#if 1
/* Including xf86PciInfo.h introduces a bunch of errors...
@@ -74,6 +74,22 @@ r128CreateScreen( __DRIscreenPrivate *sPriv )
*/
r128Screen->IsPCI = r128DRIPriv->IsPCI;
r128Screen->sarea_priv_offset = r128DRIPriv->sarea_priv_offset;
+
+ if (sPriv->drmMinor >= 3) {
+ drmR128GetParam gp;
+ int ret;
+
+ gp.param = R128_PARAM_IRQ_NR;
+ gp.value = &r128Screen->irq;
+
+ ret = drmCommandWriteRead( sPriv->fd, DRM_R128_GETPARAM,
+ &gp, sizeof(gp));
+ if (ret) {
+ fprintf(stderr, "drmR128GetParam (R128_PARAM_IRQ_NR): %d\n", ret);
+ FREE( r128Screen );
+ return NULL;
+ }
+ }
r128Screen->mmio.handle = r128DRIPriv->registerHandle;
r128Screen->mmio.size = r128DRIPriv->registerSize;
@@ -166,6 +182,9 @@ r128DestroyScreen( __DRIscreenPrivate *sPriv )
{
r128ScreenPtr r128Screen = (r128ScreenPtr)sPriv->private;
+ if ( !r128Screen )
+ return;
+
if ( !r128Screen->IsPCI ) {
drmUnmap( (drmAddress)r128Screen->agpTextures.map,
r128Screen->agpTextures.size );
@@ -185,6 +204,7 @@ r128OpenFullScreen( __DRIcontextPrivate *driContextPriv )
{
#if 0
r128ContextPtr rmesa = (r128ContextPtr)driContextPriv->driverPrivate;
+ drmR128Fullscreen fullscreen;
GLint ret;
/* FIXME: Do we need to check this?
@@ -197,7 +217,9 @@ r128OpenFullScreen( __DRIcontextPrivate *driContextPriv )
/* Ignore errors. If this fails, we simply don't do page flipping.
*/
- ret = drmR128FullScreen( rmesa->driFd, GL_TRUE );
+ fullscreen.func = DRM_R128_INIT_FULLSCREEN;
+ ret = drmCommandWrite( rmesa->driFd, DRM_R128_FULLSCREEN,
+ &fullscreen, sizeof(drmR128Fullscreen) );
UNLOCK_HARDWARE( rmesa );
@@ -214,12 +236,15 @@ r128CloseFullScreen( __DRIcontextPrivate *driContextPriv )
{
#if 0
r128ContextPtr rmesa = (r128ContextPtr)driContextPriv->driverPrivate;
+ drmR128Fullscreen fullscreen;
LOCK_HARDWARE( rmesa );
r128WaitForIdleLocked( rmesa );
/* Don't care if this fails, we're not page flipping anymore.
*/
- drmR128FullScreen( rmesa->driFd, GL_FALSE );
+ fullscreen.func = DRM_R128_CLEANUP_FULLSCREEN;
+ drmCommandWrite( rmesa->driFd, DRM_R128_FULLSCREEN,
+ &fullscreen, sizeof(drmR128Fullscreen) );
UNLOCK_HARDWARE( rmesa );
@@ -235,8 +260,7 @@ r128CloseFullScreen( __DRIcontextPrivate *driContextPriv )
* data.
*/
static GLboolean
-r128CreateBuffer( Display *dpy,
- __DRIscreenPrivate *driScrnPriv,
+r128CreateBuffer( __DRIscreenPrivate *driScrnPriv,
__DRIdrawablePrivate *driDrawPriv,
const __GLcontextModes *mesaVis,
GLboolean isPixmap )
@@ -265,18 +289,15 @@ r128DestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
/* Copy the back color buffer to the front color buffer */
static void
-r128SwapBuffers(Display *dpy, void *drawablePrivate)
+r128SwapBuffers(__DRIdrawablePrivate *dPriv)
{
- __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
- (void) dpy;
-
if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
r128ContextPtr rmesa;
GLcontext *ctx;
rmesa = (r128ContextPtr) dPriv->driContextPriv->driverPrivate;
ctx = rmesa->glCtx;
if (ctx->Visual.doubleBufferMode) {
- _mesa_swapbuffers( ctx ); /* flush pending rendering comands */
+ _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */
if ( rmesa->doPageFlip ) {
r128PageFlip( dPriv );
}
@@ -299,15 +320,12 @@ r128InitDriver( __DRIscreenPrivate *sPriv )
{
sPriv->private = (void *) r128CreateScreen( sPriv );
- /* Check the DRI version */
- {
- int major, minor, patch;
- if ( XF86DRIQueryVersion( sPriv->display, &major, &minor, &patch ) ) {
- if ( major != 4 || minor < 0 ) {
- __driUtilMessage( "R128 DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch );
- return GL_FALSE;
- }
- }
+ /* Check the DRI externsion version */
+ if ( sPriv->driMajor != 4 || sPriv->driMinor < 0 ) {
+ __driUtilMessage( "R128 DRI driver expected DRI version 4.0.x "
+ "but got version %d.%d.%d",
+ sPriv->driMajor, sPriv->driMinor, sPriv->driPatch );
+ return GL_FALSE;
}
/* Check that the DDX driver version is compatible */
@@ -334,12 +352,9 @@ r128InitDriver( __DRIscreenPrivate *sPriv )
-/* This function is called by libGL.so as soon as libGL.so is loaded.
- * This is where we'd register new extension functions with the
- * dispatcher.
- */
void __driRegisterExtensions( void )
{
+ /* See r200 driver for info */
}
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_screen.h b/xc/lib/GL/mesa/src/drv/r128/r128_screen.h
index 63e37a8d6..411b29b56 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_screen.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_screen.h
@@ -52,6 +52,7 @@ typedef struct {
GLint cpp;
GLint IsPCI; /* Current card is a PCI card */
GLint AGPMode;
+ unsigned int irq; /* IRQ number (0 means none) */
GLuint frontOffset;
GLuint frontPitch;
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_span.c b/xc/lib/GL/mesa/src/drv/r128/r128_span.c
index 6893abd2f..653f893b3 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_span.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_span.c
@@ -29,7 +29,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
/*
* Authors:
* Gareth Hughes <gareth@valinux.com>
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
* Kevin E. Martin <martin@valinux.com>
*
*/
@@ -40,7 +40,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r128_span.h"
#include "r128_tex.h"
-#include "swrast/s_pb.h" /* for PB_SIZE */
+#include "swrast/swrast.h"
#define DBG 0
@@ -219,8 +219,8 @@ do { \
#define WRITE_DEPTH_PIXELS() \
do { \
- GLint ox[PB_SIZE]; \
- GLint oy[PB_SIZE]; \
+ GLint ox[MAX_WIDTH]; \
+ GLint oy[MAX_WIDTH]; \
for ( i = 0 ; i < n ; i++ ) { \
ox[i] = x[i] + dPriv->x; \
} \
@@ -253,8 +253,8 @@ do { \
GLint i, remaining = n; \
\
while ( remaining > 0 ) { \
- GLint ox[PB_SIZE]; \
- GLint oy[PB_SIZE]; \
+ GLint ox[MAX_WIDTH]; \
+ GLint oy[MAX_WIDTH]; \
GLint count; \
\
if ( remaining <= 128 ) { \
@@ -296,8 +296,8 @@ do { \
#define WRITE_DEPTH_PIXELS() \
do { \
- GLint ox[PB_SIZE]; \
- GLint oy[PB_SIZE]; \
+ GLint ox[MAX_WIDTH]; \
+ GLint oy[MAX_WIDTH]; \
for ( i = 0 ; i < n ; i++ ) { \
ox[i] = x[i] + dPriv->x; \
} \
@@ -330,8 +330,8 @@ do { \
GLint i, remaining = n; \
\
while ( remaining > 0 ) { \
- GLint ox[PB_SIZE]; \
- GLint oy[PB_SIZE]; \
+ GLint ox[MAX_WIDTH]; \
+ GLint oy[MAX_WIDTH]; \
GLint count; \
\
if ( remaining <= 128 ) { \
@@ -378,20 +378,25 @@ do { \
-static void r128DDSetReadBuffer( GLcontext *ctx,
- GLframebuffer *colorBuffer,
- GLenum mode )
+/*
+ * This function is called to specify which buffer to read and write
+ * for software rasterization (swrast) fallbacks. This doesn't necessarily
+ * correspond to glDrawBuffer() or glReadBuffer() calls.
+ */
+static void r128DDSetBuffer( GLcontext *ctx,
+ GLframebuffer *colorBuffer,
+ GLuint bufferBit )
{
r128ContextPtr rmesa = R128_CONTEXT(ctx);
- switch ( mode ) {
- case GL_FRONT_LEFT:
- rmesa->readOffset = rmesa->r128Screen->frontOffset;
- rmesa->readPitch = rmesa->r128Screen->frontPitch;
+ switch ( bufferBit ) {
+ case FRONT_LEFT_BIT:
+ rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->frontOffset;
+ rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->frontPitch;
break;
- case GL_BACK_LEFT:
- rmesa->readOffset = rmesa->r128Screen->backOffset;
- rmesa->readPitch = rmesa->r128Screen->backPitch;
+ case BACK_LEFT_BIT:
+ rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->backOffset;
+ rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->backPitch;
break;
default:
break;
@@ -404,7 +409,7 @@ void r128DDInitSpanFuncs( GLcontext *ctx )
r128ContextPtr rmesa = R128_CONTEXT(ctx);
struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
- swdd->SetReadBuffer = r128DDSetReadBuffer;
+ swdd->SetBuffer = r128DDSetBuffer;
switch ( rmesa->r128Screen->cpp ) {
case 2:
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_state.c b/xc/lib/GL/mesa/src/drv/r128/r128_state.c
index 36f86af8c..ed68a7389 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_state.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_state.c
@@ -30,7 +30,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* Authors:
* Gareth Hughes <gareth@valinux.com>
* Kevin E. Martin <martin@valinux.com>
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*
*/
@@ -182,7 +182,7 @@ static void r128UpdateAlphaMode( GLcontext *ctx )
}
}
-static void r128DDAlphaFunc( GLcontext *ctx, GLenum func, GLchan ref )
+static void r128DDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref )
{
r128ContextPtr rmesa = R128_CONTEXT(ctx);
@@ -658,13 +658,18 @@ static void r128DepthRange( GLcontext *ctx,
*/
static void r128DDClearColor( GLcontext *ctx,
- const GLchan color[4] )
+ const GLfloat color[4] )
{
r128ContextPtr rmesa = R128_CONTEXT(ctx);
+ GLubyte c[4];
+
+ CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
+ CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]);
rmesa->ClearColor = r128PackColor( rmesa->r128Screen->cpp,
- color[0], color[1],
- color[2], color[3] );
+ c[0], c[1], c[2], c[3] );
}
static void r128DDLogicOpCode( GLcontext *ctx, GLenum opcode )
@@ -678,35 +683,41 @@ static void r128DDLogicOpCode( GLcontext *ctx, GLenum opcode )
}
}
-static void r128DDSetDrawBuffer( GLcontext *ctx, GLenum mode )
+static void r128DDDrawBuffer( GLcontext *ctx, GLenum mode )
{
r128ContextPtr rmesa = R128_CONTEXT(ctx);
FLUSH_BATCH( rmesa );
- if ( rmesa->DrawBuffer != mode ) {
- rmesa->DrawBuffer = mode;
+ /*
+ * _DrawDestMask is easier to cope with than <mode>.
+ */
+ switch ( ctx->Color._DrawDestMask ) {
+ case FRONT_LEFT_BIT:
+ FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE );
+ break;
+ case BACK_LEFT_BIT:
+ FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE );
+ break;
+ default:
+ /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
+ FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_TRUE );
+ break;
+ }
- switch ( mode ) {
- case GL_FRONT_LEFT:
- rmesa->drawOffset = rmesa->r128Screen->frontOffset;
- rmesa->drawPitch = rmesa->r128Screen->frontPitch;
- FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE );
- break;
- case GL_BACK_LEFT:
- rmesa->drawOffset = rmesa->r128Screen->backOffset;
- rmesa->drawPitch = rmesa->r128Screen->backPitch;
- FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE );
- break;
- default:
- FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_TRUE );
- break;
- }
+ /* We want to update the s/w rast state too so that r200SetBuffer()
+ * gets called.
+ */
+ _swrast_DrawBuffer(ctx, mode);
- rmesa->setup.dst_pitch_offset_c = (((rmesa->drawPitch/8) << 21) |
- (rmesa->drawOffset >> 5));
- rmesa->new_state |= R128_NEW_WINDOW;
- }
+ rmesa->setup.dst_pitch_offset_c = (((rmesa->drawPitch/8) << 21) |
+ (rmesa->drawOffset >> 5));
+ rmesa->new_state |= R128_NEW_WINDOW;
+}
+
+static void r128DDReadBuffer( GLcontext *ctx, GLenum mode )
+{
+ /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */
}
@@ -718,6 +729,7 @@ static void r128DDPolygonStipple( GLcontext *ctx, const GLubyte *mask )
{
r128ContextPtr rmesa = R128_CONTEXT(ctx);
GLuint stipple[32], i;
+ drmR128Stipple stippleRec;
for (i = 0; i < 32; i++) {
stipple[31 - i] = ((mask[i*4+0] << 24) |
@@ -728,7 +740,11 @@ static void r128DDPolygonStipple( GLcontext *ctx, const GLubyte *mask )
FLUSH_BATCH( rmesa );
LOCK_HARDWARE( rmesa );
- drmR128PolygonStipple( rmesa->driFd, stipple );
+
+ stippleRec.mask = stipple;
+ drmCommandWrite( rmesa->driFd, DRM_R128_STIPPLE,
+ &stippleRec, sizeof(drmR128Stipple) );
+
UNLOCK_HARDWARE( rmesa );
rmesa->new_state |= R128_NEW_CONTEXT;
@@ -1068,11 +1084,9 @@ void r128DDInitState( r128ContextPtr rmesa )
rmesa->Fallback = 0;
if ( rmesa->glCtx->Visual.doubleBufferMode ) {
- rmesa->DrawBuffer = GL_BACK_LEFT;
rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->backOffset;
rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->backPitch;
} else {
- rmesa->DrawBuffer = GL_FRONT_LEFT;
rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->frontOffset;
rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->frontPitch;
}
@@ -1187,7 +1201,8 @@ void r128DDInitStateFuncs( GLcontext *ctx )
ctx->Driver.ClearIndex = NULL;
ctx->Driver.ClearColor = r128DDClearColor;
- ctx->Driver.SetDrawBuffer = r128DDSetDrawBuffer;
+ ctx->Driver.DrawBuffer = r128DDDrawBuffer;
+ ctx->Driver.ReadBuffer = r128DDReadBuffer;
ctx->Driver.IndexMask = NULL;
ctx->Driver.ColorMask = r128DDColorMask;
@@ -1226,7 +1241,6 @@ void r128DDInitStateFuncs( GLcontext *ctx )
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:
*/
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_tex.c b/xc/lib/GL/mesa/src/drv/r128/r128_tex.c
index 8bbb7332d..6423de7b3 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_tex.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_tex.c
@@ -48,7 +48,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "enums.h"
#include "texstore.h"
#include "texformat.h"
-#include "mem.h"
+#include "imports.h"
#define TEX_0 1
#define TEX_1 2
@@ -129,7 +129,7 @@ static r128TexObjPtr r128AllocTexObj( struct gl_texture_object *texObj )
r128TexObjPtr t;
if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, texObj, t );
+ fprintf( stderr, "%s( %p )\n", __FUNCTION__, texObj );
}
t = (r128TexObjPtr) CALLOC_STRUCT( r128_tex_obj );
@@ -146,7 +146,7 @@ static r128TexObjPtr r128AllocTexObj( struct gl_texture_object *texObj )
r128SetTexWrap( t, texObj->WrapS, texObj->WrapT );
/*r128SetTexMaxAnisotropy( t, texObj->MaxAnisotropy );*/
r128SetTexFilter( t, texObj->MinFilter, texObj->MagFilter );
- r128SetTexBorderColor( t, texObj->BorderColor );
+ r128SetTexBorderColor( t, texObj->_BorderChan );
return t;
}
@@ -509,7 +509,7 @@ static void r128DDTexParameter( GLcontext *ctx, GLenum target,
case GL_TEXTURE_BORDER_COLOR:
if ( t->bound ) FLUSH_BATCH( rmesa );
- r128SetTexBorderColor( t, tObj->BorderColor );
+ r128SetTexBorderColor( t, tObj->_BorderChan );
break;
case GL_TEXTURE_BASE_LEVEL:
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_texmem.c b/xc/lib/GL/mesa/src/drv/r128/r128_texmem.c
index 9ad0eddba..8b2e484ef 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_texmem.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_texmem.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_texmem.c,v 1.1 2002/02/22 21:44:58 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.c,v 1.7 2001/01/08 01:07:21 martin Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
@@ -45,7 +45,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "mmath.h"
#include "simple_list.h"
#include "texformat.h"
-#include "mem.h"
+#include "imports.h"
#define TEX_0 1
#define TEX_1 2
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_texstate.c b/xc/lib/GL/mesa/src/drv/r128/r128_texstate.c
index f16c73cc8..33e2d2120 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_texstate.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_texstate.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_texstate.c,v 1.1 2002/02/22 21:44:58 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.c,v 1.7 2001/01/08 01:07:21 martin Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
@@ -33,6 +33,12 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* Brian Paul <brianp@valinux.com>
*/
+#include "glheader.h"
+#include "imports.h"
+#include "context.h"
+#include "macros.h"
+#include "texformat.h"
+
#include "r128_context.h"
#include "r128_state.h"
#include "r128_ioctl.h"
@@ -40,11 +46,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r128_tris.h"
#include "r128_tex.h"
-#include "context.h"
-#include "macros.h"
-#include "mem.h"
-#include "texformat.h"
-
static void r128SetTexImages( r128ContextPtr rmesa,
const struct gl_texture_object *tObj )
@@ -489,7 +490,7 @@ static void r128UpdateTextureUnit( GLcontext *ctx, int unit )
assert(unit == 0 || unit == 1); /* only two tex units */
- if (texUnit->_ReallyEnabled & (TEXTURE0_1D | TEXTURE0_2D)) {
+ if (texUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) {
assert(t); /* should have driver tex data by now */
@@ -540,8 +541,9 @@ void r128UpdateTextureState( GLcontext *ctx )
r128ContextPtr rmesa = R128_CONTEXT(ctx);
if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %p ) enabled=0x%x\n",
- __FUNCTION__, ctx, ctx->Texture._ReallyEnabled );
+ fprintf( stderr, "%s( %p ) enabled=0x%x 0x%x\n",
+ __FUNCTION__, ctx, ctx->Texture.Unit[0]._ReallyEnabled,
+ ctx->Texture.Unit[1]._ReallyEnabled );
}
/* Clear any texturing fallbacks */
@@ -565,8 +567,9 @@ void r128UpdateTextureState( GLcontext *ctx )
rmesa->tmu_source[1] = 1;
rmesa->blend_flags &= ~R128_BLEND_MULTITEX;
- if (ctx->Texture._ReallyEnabled & TEXTURE1_ANY) {
- if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY) {
+ if (ctx->Texture._EnabledUnits & 0x2) {
+ /* unit 1 enabled */
+ if (ctx->Texture._EnabledUnits & 0x1) {
/* both texture 0 and 1 enabled */
if ( R128_IS_PLAIN( rmesa ) )
rmesa->blend_flags |= R128_BLEND_MULTITEX;
@@ -586,7 +589,7 @@ void r128UpdateTextureState( GLcontext *ctx )
rmesa->dirty |= (R128_UPLOAD_TEX0IMAGES | R128_UPLOAD_TEX0);
}
}
- else if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY) {
+ else if (ctx->Texture._EnabledUnits & 0x1) {
/* only texture 0 enabled */
r128UpdateTextureUnit( ctx, 0 );
r128UpdateTextureEnv( ctx, 0 );
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_tris.c b/xc/lib/GL/mesa/src/drv/r128/r128_tris.c
index 0bd64ee0b..9a4e6a0ca 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_tris.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_tris.c
@@ -29,13 +29,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
/*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*
*/
-#include <stdio.h>
-#include <math.h>
-
#include "glheader.h"
#include "mtypes.h"
#include "colormac.h"
@@ -88,7 +85,7 @@ do { \
#define COPY_DWORDS( j, vb, vertsize, v ) \
do { \
for ( j = 0 ; j < vertsize ; j++ ) \
- vb[j] = ((GLuint *)v)[j]; \
+ vb[j] = CPU_TO_LE32(((GLuint *)v)[j]); \
vb += vertsize; \
} while (0)
#endif
@@ -236,33 +233,31 @@ static struct {
#define AREA_IS_CCW( a ) (a > 0)
#define GET_VERTEX(e) (rmesa->verts + (e<<rmesa->vertex_stride_shift))
-#define R128_COLOR( dst, src ) \
-do { \
- dst[0] = src[2]; \
- dst[1] = src[1]; \
- dst[2] = src[0]; \
- dst[3] = src[3]; \
-} while (0)
-
-#define R128_SPEC( dst, src ) \
-do { \
- dst[0] = src[2]; \
- dst[1] = src[1]; \
- dst[2] = src[0]; \
-} while (0)
-
-#define VERT_SET_RGBA( v, c ) R128_COLOR( v->ub4[coloroffset], c )
+#define VERT_SET_RGBA( v, c ) do { \
+ r128_color_t *vc = (r128_color_t *)&(v)->ui[coloroffset]; \
+ vc->blue = (c)[2]; \
+ vc->green = (c)[1]; \
+ vc->red = (c)[0]; \
+ vc->alpha = (c)[3]; \
+ } while (0)
#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset]
#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset]
#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = color[idx]
-#define VERT_SET_SPEC( v, c ) if (havespec) R128_SPEC( v->ub4[5], c )
-#define VERT_COPY_SPEC( v0, v1 ) if (havespec) COPY_3V(v0->ub4[5], v1->ub4[5])
+#define VERT_SET_SPEC( v0, c ) if (havespec) { \
+ (v0)->v.specular.red = (c)[0];\
+ (v0)->v.specular.green = (c)[1];\
+ (v0)->v.specular.blue = (c)[2]; }
+#define VERT_COPY_SPEC( v0, v1 ) if (havespec) { \
+ (v0)->v.specular.red = v1->v.specular.red; \
+ (v0)->v.specular.green = v1->v.specular.green; \
+ (v0)->v.specular.blue = v1->v.specular.blue; }
+
#define VERT_SAVE_SPEC( idx ) if (havespec) spec[idx] = v[idx]->ui[5]
#define VERT_RESTORE_SPEC( idx ) if (havespec) v[idx]->ui[5] = spec[idx]
#define LOCAL_VARS(n) \
- r128ContextPtr rmesa = R128_CONTEXT(ctx); \
+ r128ContextPtr rmesa = R128_CONTEXT(ctx); \
GLuint color[n], spec[n]; \
GLuint coloroffset = (rmesa->vertex_size == 4 ? 3 : 4); \
GLboolean havespec = (rmesa->vertex_size == 4 ? 0 : 1); \
@@ -501,9 +496,9 @@ static void r128FastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
rmesa->num_verts += (n-2) * 3;
for (i = 2 ; i < n ; i++) {
- COPY_DWORDS( j, vb, vertsize, (r128VertexPtr) start );
COPY_DWORDS( j, vb, vertsize, (r128VertexPtr) VERT(elts[i-1]) );
COPY_DWORDS( j, vb, vertsize, (r128VertexPtr) VERT(elts[i]) );
+ COPY_DWORDS( j, vb, vertsize, (r128VertexPtr) start );
}
}
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_vb.c b/xc/lib/GL/mesa/src/drv/r128/r128_vb.c
index 0a6cc6785..38cff8048 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_vb.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_vb.c
@@ -29,13 +29,13 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
/*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*
*/
#include "glheader.h"
#include "mtypes.h"
-#include "mem.h"
+#include "imports.h"
#include "macros.h"
#include "colormac.h"
#include "mmath.h"
@@ -108,7 +108,7 @@ static struct {
#define GET_VIEWPORT_MAT() rmesa->hw_viewport
#define GET_TEXSOURCE(n) rmesa->tmu_source[n]
#define GET_VERTEX_FORMAT() rmesa->vertex_format
-#define GET_VERTEX_STORE() (GLubyte *)(rmesa->verts)
+#define GET_VERTEX_STORE() rmesa->verts
#define GET_VERTEX_STRIDE_SHIFT() rmesa->vertex_stride_shift
#define INVALIDATE_STORED_VERTICES()
#define GET_UBYTE_COLOR_STORE() &rmesa->UbyteColor
@@ -380,24 +380,24 @@ void r128BuildVertices( GLcontext *ctx,
if (!newinputs)
return;
- if (newinputs & VERT_CLIP) {
+ if (newinputs & VERT_BIT_CLIP) {
setup_tab[rmesa->SetupIndex].emit( ctx, start, count, v, stride );
} else {
GLuint ind = 0;
- if (newinputs & VERT_RGBA)
+ if (newinputs & VERT_BIT_COLOR0)
ind |= R128_RGBA_BIT;
- if (newinputs & VERT_SPEC_RGB)
+ if (newinputs & VERT_BIT_COLOR1)
ind |= R128_SPEC_BIT;
- if (newinputs & VERT_TEX0)
+ if (newinputs & VERT_BIT_TEX0)
ind |= R128_TEX0_BIT;
- if (newinputs & VERT_TEX1)
+ if (newinputs & VERT_BIT_TEX1)
ind |= R128_TEX1_BIT;
- if (newinputs & VERT_FOG_COORD)
+ if (newinputs & VERT_BIT_FOG)
ind |= R128_FOG_BIT;
if (rmesa->SetupIndex & R128_PTEX_BIT)
@@ -423,7 +423,7 @@ void r128ChooseVertexState( GLcontext *ctx )
if (ctx->Fog.Enabled)
ind |= R128_FOG_BIT;
- if (ctx->Texture._ReallyEnabled) {
+ if (ctx->Texture._EnabledUnits) {
ind |= R128_TEX0_BIT;
if (ctx->Texture.Unit[0]._ReallyEnabled &&
ctx->Texture.Unit[1]._ReallyEnabled)
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_cmdbuf.c b/xc/lib/GL/mesa/src/drv/r200/r200_cmdbuf.c
new file mode 100644
index 000000000..d7c06b68e
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_cmdbuf.c
@@ -0,0 +1,344 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "macros.h"
+#include "context.h"
+#include "swrast/swrast.h"
+#include "simple_list.h"
+
+#include "r200_context.h"
+#include "r200_state.h"
+#include "r200_ioctl.h"
+#include "r200_tcl.h"
+#include "r200_sanity.h"
+#include "radeon_reg.h"
+
+static void print_state_atom( struct r200_state_atom *state )
+{
+ int i;
+
+ fprintf(stderr, "emit %s/%d\n", state->name, state->cmd_size);
+
+ if (0 & R200_DEBUG & DEBUG_VERBOSE)
+ for (i = 0 ; i < state->cmd_size ; i++)
+ fprintf(stderr, "\t%s[%d]: %x\n", state->name, i, state->cmd[i]);
+
+}
+
+static void r200_emit_state_list( r200ContextPtr rmesa,
+ struct r200_state_atom *list )
+{
+ struct r200_state_atom *state, *tmp;
+ char *dest;
+
+ foreach_s( state, tmp, list ) {
+ if (state->check( rmesa->glCtx, state->idx )) {
+ dest = r200AllocCmdBuf( rmesa, state->cmd_size * 4, __FUNCTION__);
+ memcpy( dest, state->cmd, state->cmd_size * 4);
+ move_to_head( &(rmesa->hw.clean), state );
+ if (R200_DEBUG & DEBUG_STATE)
+ print_state_atom( state );
+ }
+ else if (R200_DEBUG & DEBUG_STATE)
+ fprintf(stderr, "skip state %s\n", state->name);
+ }
+}
+
+
+void r200EmitState( r200ContextPtr rmesa )
+{
+ struct r200_state_atom *state, *tmp;
+
+ if (R200_DEBUG & (DEBUG_STATE|DEBUG_PRIMS))
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ /* Somewhat overkill:
+ */
+ if ( rmesa->lost_context) {
+ if (R200_DEBUG & (DEBUG_STATE|DEBUG_PRIMS|DEBUG_IOCTL))
+ fprintf(stderr, "%s - lost context\n", __FUNCTION__);
+
+ foreach_s( state, tmp, &(rmesa->hw.clean) )
+ move_to_tail(&(rmesa->hw.dirty), state );
+
+ rmesa->lost_context = 0;
+ }
+ else {
+ move_to_tail( &rmesa->hw.dirty, &rmesa->hw.mtl[0] );
+ /* odd bug? -- isosurf, cycle between reflect & lit */
+ }
+
+ r200_emit_state_list( rmesa, &rmesa->hw.dirty );
+}
+
+
+
+/* Fire a section of the retained (indexed_verts) buffer as a regular
+ * primtive.
+ */
+extern void r200EmitVbufPrim( r200ContextPtr rmesa,
+ GLuint primitive,
+ GLuint vertex_nr )
+{
+ drmRadeonCmdHeader *cmd;
+
+ assert(!(primitive & R200_VF_PRIM_WALK_IND));
+
+ r200EmitState( rmesa );
+
+ if (R200_DEBUG & (DEBUG_IOCTL|DEBUG_PRIMS))
+ fprintf(stderr, "%s cmd_used/4: %d prim %x nr %d\n", __FUNCTION__,
+ rmesa->store.cmd_used/4, primitive, vertex_nr);
+
+ cmd = (drmRadeonCmdHeader *)r200AllocCmdBuf( rmesa, 3 * sizeof(*cmd),
+ __FUNCTION__ );
+ cmd[0].i = 0;
+ cmd[0].header.cmd_type = RADEON_CMD_PACKET3_CLIP;
+ cmd[1].i = R200_CP_CMD_3D_DRAW_VBUF_2;
+ cmd[2].i = (primitive |
+ R200_VF_PRIM_WALK_LIST |
+ R200_VF_COLOR_ORDER_RGBA |
+ (vertex_nr << R200_VF_VERTEX_NUMBER_SHIFT));
+
+
+ if (R200_DEBUG & DEBUG_SYNC) {
+ fprintf(stderr, "\nSyncing\n\n");
+ R200_FIREVERTICES( rmesa );
+ r200Finish( rmesa->glCtx );
+ }
+}
+
+
+void r200FlushElts( r200ContextPtr rmesa )
+{
+ int *cmd = (int *)(rmesa->store.cmd_buf + rmesa->store.elts_start);
+ int dwords;
+ int nr = (rmesa->store.cmd_used - (rmesa->store.elts_start + 12)) / 2;
+
+ if (R200_DEBUG & (DEBUG_IOCTL|DEBUG_PRIMS))
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ assert( rmesa->dma.flush == r200FlushElts );
+ rmesa->dma.flush = 0;
+
+ /* Cope with odd number of elts:
+ */
+ rmesa->store.cmd_used = (rmesa->store.cmd_used + 2) & ~2;
+ dwords = (rmesa->store.cmd_used - rmesa->store.elts_start) / 4;
+
+ cmd[1] |= (dwords - 3) << 16;
+ cmd[2] |= nr << R200_VF_VERTEX_NUMBER_SHIFT;
+
+ if (R200_DEBUG & DEBUG_SYNC) {
+ fprintf(stderr, "\nSyncing in %s\n\n", __FUNCTION__);
+ R200_FIREVERTICES( rmesa );
+ r200Finish( rmesa->glCtx );
+ }
+}
+
+
+GLushort *r200AllocEltsOpenEnded( r200ContextPtr rmesa,
+ GLuint primitive,
+ GLuint min_nr )
+{
+ drmRadeonCmdHeader *cmd;
+ GLushort *retval;
+
+ if (R200_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s %d prim %x\n", __FUNCTION__, min_nr, primitive);
+
+ assert((primitive & R200_VF_PRIM_WALK_IND));
+
+ r200EmitState( rmesa );
+
+ cmd = (drmRadeonCmdHeader *)r200AllocCmdBuf( rmesa,
+ 12 + min_nr*2,
+ __FUNCTION__ );
+ cmd[0].i = 0;
+ cmd[0].header.cmd_type = RADEON_CMD_PACKET3_CLIP;
+ cmd[1].i = R200_CP_CMD_3D_DRAW_INDX_2;
+ cmd[2].i = (primitive |
+ R200_VF_PRIM_WALK_IND |
+ R200_VF_COLOR_ORDER_RGBA);
+
+
+ retval = (GLushort *)(cmd+3);
+
+ if (R200_DEBUG & DEBUG_PRIMS)
+ fprintf(stderr, "%s: header 0x%x prim %x \n",
+ __FUNCTION__,
+ cmd[1].i, primitive);
+
+ assert(!rmesa->dma.flush);
+ rmesa->dma.flush = r200FlushElts;
+
+ rmesa->store.elts_start = ((char *)cmd) - rmesa->store.cmd_buf;
+
+ return retval;
+}
+
+
+
+void r200EmitVertexAOS( r200ContextPtr rmesa,
+ GLuint vertex_size,
+ GLuint offset )
+{
+ drmRadeonCmdHeader *cmd;
+
+ if (R200_DEBUG & (DEBUG_PRIMS|DEBUG_IOCTL))
+ fprintf(stderr, "%s: vertex_size 0x%x offset 0x%x \n",
+ __FUNCTION__, vertex_size, offset);
+
+ cmd = (drmRadeonCmdHeader *)r200AllocCmdBuf( rmesa, 5 * sizeof(int),
+ __FUNCTION__ );
+
+ cmd[0].header.cmd_type = RADEON_CMD_PACKET3;
+ cmd[1].i = R200_CP_CMD_3D_LOAD_VBPNTR | (2 << 16);
+ cmd[2].i = 1;
+ cmd[3].i = vertex_size | (vertex_size << 8);
+ cmd[4].i = offset;
+}
+
+
+void r200EmitAOS( r200ContextPtr rmesa,
+ struct r200_dma_region **component,
+ GLuint nr,
+ GLuint offset )
+{
+ drmRadeonCmdHeader *cmd;
+ int sz = 3 + ((nr/2)*3) + ((nr&1)*2);
+ int i;
+ int *tmp;
+
+ if (R200_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s nr arrays: %d\n", __FUNCTION__, nr);
+
+ cmd = (drmRadeonCmdHeader *)r200AllocCmdBuf( rmesa, sz * sizeof(int),
+ __FUNCTION__ );
+ cmd[0].i = 0;
+ cmd[0].header.cmd_type = RADEON_CMD_PACKET3;
+ cmd[1].i = R200_CP_CMD_3D_LOAD_VBPNTR | ((sz-3) << 16);
+ cmd[2].i = nr;
+ tmp = &cmd[0].i;
+ cmd += 3;
+
+ for (i = 0 ; i < nr ; i++) {
+ if (i & 1) {
+ cmd[0].i |= ((component[i]->aos_stride << 24) |
+ (component[i]->aos_size << 16));
+ cmd[2].i = (component[i]->aos_start +
+ offset * component[i]->aos_stride * 4);
+ cmd += 3;
+ }
+ else {
+ cmd[0].i = ((component[i]->aos_stride << 8) |
+ (component[i]->aos_size << 0));
+ cmd[1].i = (component[i]->aos_start +
+ offset * component[i]->aos_stride * 4);
+ }
+ }
+
+ if (R200_DEBUG & DEBUG_VERTS) {
+ fprintf(stderr, "%s:\n", __FUNCTION__);
+ for (i = 0 ; i < sz ; i++)
+ fprintf(stderr, " %d: %x\n", i, tmp[i]);
+ }
+}
+
+void r200EmitBlit( r200ContextPtr rmesa,
+ GLuint color_fmt,
+ GLuint src_pitch,
+ GLuint src_offset,
+ GLuint dst_pitch,
+ GLuint dst_offset,
+ GLint srcx, GLint srcy,
+ GLint dstx, GLint dsty,
+ GLuint w, GLuint h )
+{
+ drmRadeonCmdHeader *cmd;
+
+ if (R200_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s src %x/%x %d,%d dst: %x/%x %d,%d sz: %dx%d\n",
+ __FUNCTION__,
+ src_pitch, src_offset, srcx, srcy,
+ dst_pitch, dst_offset, dstx, dsty,
+ w, h);
+
+ assert( (src_pitch & 63) == 0 );
+ assert( (dst_pitch & 63) == 0 );
+ assert( (src_offset & 1023) == 0 );
+ assert( (dst_offset & 1023) == 0 );
+ assert( w < (1<<16) );
+ assert( h < (1<<16) );
+
+ cmd = (drmRadeonCmdHeader *)r200AllocCmdBuf( rmesa, 8 * sizeof(int),
+ __FUNCTION__ );
+
+
+ cmd[0].header.cmd_type = RADEON_CMD_PACKET3;
+ cmd[1].i = R200_CP_CMD_BITBLT_MULTI | (5 << 16);
+ cmd[2].i = (RADEON_GMC_SRC_PITCH_OFFSET_CNTL |
+ RADEON_GMC_DST_PITCH_OFFSET_CNTL |
+ RADEON_GMC_BRUSH_NONE |
+ (color_fmt << 8) |
+ RADEON_GMC_SRC_DATATYPE_COLOR |
+ RADEON_ROP3_S |
+ RADEON_DP_SRC_SOURCE_MEMORY |
+ RADEON_GMC_CLR_CMP_CNTL_DIS |
+ RADEON_GMC_WR_MSK_DIS );
+
+ cmd[3].i = ((src_pitch/64)<<22) | (src_offset >> 10);
+ cmd[4].i = ((dst_pitch/64)<<22) | (dst_offset >> 10);
+ cmd[5].i = (srcx << 16) | srcy;
+ cmd[6].i = (dstx << 16) | dsty; /* dst */
+ cmd[7].i = (w << 16) | h;
+}
+
+
+void r200EmitWait( r200ContextPtr rmesa, GLuint flags )
+{
+ if (rmesa->dri.drmMinor >= 6) {
+ drmRadeonCmdHeader *cmd;
+
+ assert( !(flags & ~(RADEON_WAIT_2D|RADEON_WAIT_3D)) );
+
+ cmd = (drmRadeonCmdHeader *)r200AllocCmdBuf( rmesa, 1 * sizeof(int),
+ __FUNCTION__ );
+ cmd[0].i = 0;
+ cmd[0].wait.cmd_type = RADEON_CMD_WAIT;
+ cmd[0].wait.flags = flags;
+ }
+}
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_context.c b/xc/lib/GL/mesa/src/drv/r200/r200_context.c
new file mode 100644
index 000000000..55319b613
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_context.c
@@ -0,0 +1,672 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "api_arrayelt.h"
+#include "context.h"
+#include "simple_list.h"
+#include "imports.h"
+#include "matrix.h"
+#include "state.h"
+#include "extensions.h"
+#include "state.h"
+
+#include "swrast/swrast.h"
+#include "swrast_setup/swrast_setup.h"
+#include "array_cache/acache.h"
+
+#include "tnl/tnl.h"
+#include "tnl/t_pipeline.h"
+
+#include "r200_context.h"
+#include "r200_ioctl.h"
+#include "r200_state.h"
+#include "r200_span.h"
+#include "r200_pixel.h"
+#include "r200_tex.h"
+#include "r200_swtcl.h"
+#include "r200_tcl.h"
+#include "r200_vtxfmt.h"
+#include "r200_maos.h"
+
+#if defined(USE_X86_ASM)
+#include "X86/common_x86_asm.h"
+#endif
+
+#define R200_DATE "20021125"
+
+#ifndef R200_DEBUG
+int R200_DEBUG = (0);
+#endif
+
+
+
+/* Return the width and height of the given buffer.
+ */
+static void r200GetBufferSize( GLframebuffer *buffer,
+ GLuint *width, GLuint *height )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ LOCK_HARDWARE( rmesa );
+ *width = rmesa->dri.drawable->w;
+ *height = rmesa->dri.drawable->h;
+ UNLOCK_HARDWARE( rmesa );
+}
+
+/* Return various strings for glGetString().
+ */
+static const GLubyte *r200GetString( GLcontext *ctx, GLenum name )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ static char buffer[128];
+
+ switch ( name ) {
+ case GL_VENDOR:
+ return (GLubyte *)"Tungsten Graphics, Inc.";
+
+ case GL_RENDERER:
+ sprintf( buffer, "Mesa DRI R200 " R200_DATE);
+
+ /* Append any chipset-specific information. None yet.
+ */
+
+ /* Append any AGP-specific information.
+ */
+ switch ( rmesa->r200Screen->AGPMode ) {
+ case 1:
+ strncat( buffer, " AGP 1x", 7 );
+ break;
+ case 2:
+ strncat( buffer, " AGP 2x", 7 );
+ break;
+ case 4:
+ strncat( buffer, " AGP 4x", 7 );
+ break;
+ }
+
+ /* Append any CPU-specific information.
+ */
+#ifdef USE_X86_ASM
+ if ( _mesa_x86_cpu_features ) {
+ strncat( buffer, " x86", 4 );
+ }
+#ifdef USE_MMX_ASM
+ if ( cpu_has_mmx ) {
+ strncat( buffer, "/MMX", 4 );
+ }
+#endif
+#ifdef USE_3DNOW_ASM
+ if ( cpu_has_3dnow ) {
+ strncat( buffer, "/3DNow!", 7 );
+ }
+#endif
+#ifdef USE_SSE_ASM
+ if ( cpu_has_xmm ) {
+ strncat( buffer, "/SSE", 4 );
+ }
+#endif
+#endif
+
+ if ( !(rmesa->TclFallback & R200_TCL_FALLBACK_TCL_DISABLE) ) {
+ strncat( buffer, " TCL", 4 );
+ }
+ else {
+ strncat( buffer, " NO-TCL", 7 );
+ }
+
+ return (GLubyte *)buffer;
+
+ default:
+ return NULL;
+ }
+}
+
+
+
+/* Initialize the extensions supported by this driver.
+ */
+static void r200InitExtensions( GLcontext *ctx, r200ScreenPtr r200Screen )
+{
+ _mesa_enable_imaging_extensions( ctx );
+
+ _mesa_enable_extension( ctx, "GL_ARB_multitexture" );
+ if (r200Screen->drmSupportsCubeMaps)
+ _mesa_enable_extension( ctx, "GL_ARB_texture_cube_map" );
+ _mesa_enable_extension( ctx, "GL_ARB_texture_env_add" );
+ _mesa_enable_extension( ctx, "GL_ARB_texture_env_combine" );
+ _mesa_enable_extension( ctx, "GL_ARB_texture_env_dot3" );
+ _mesa_enable_extension( ctx, "GL_ARB_texture_mirrored_repeat" );
+ _mesa_enable_extension( ctx, "GL_ARB_texture_border_clamp" );
+
+ _mesa_enable_extension( ctx, "GL_ATI_texture_env_combine3" );
+ _mesa_enable_extension( ctx, "GL_ATI_texture_mirror_once" );
+
+ _mesa_enable_extension( ctx, "GL_EXT_blend_logic_op" );
+ /*_mesa_enable_extension( ctx, "GL_EXT_fog_coord" );*/
+ _mesa_enable_extension( ctx, "GL_EXT_stencil_wrap" );
+ _mesa_enable_extension( ctx, "GL_EXT_texture_edge_clamp" );
+ _mesa_enable_extension( ctx, "GL_EXT_texture_env_add" );
+ _mesa_enable_extension( ctx, "GL_EXT_texture_env_combine" );
+ _mesa_enable_extension( ctx, "GL_EXT_texture_env_dot3" );
+ _mesa_enable_extension( ctx, "GL_EXT_texture_filter_anisotropic" );
+ _mesa_enable_extension( ctx, "GL_EXT_texture_lod_bias" );
+ _mesa_enable_extension( ctx, "GL_EXT_secondary_color" );
+ _mesa_enable_extension( ctx, "GL_EXT_blend_subtract" );
+ _mesa_enable_extension( ctx, "GL_EXT_blend_minmax" );
+
+/* _mesa_enable_extension( ctx, "GL_EXT_fog_coord" ); */
+
+ _mesa_enable_extension( ctx, "GL_MESA_pack_invert" );
+ _mesa_enable_extension( ctx, "GL_MESA_ycbcr_texture" );
+ _mesa_enable_extension( ctx, "GL_NV_texture_rectangle" );
+}
+
+extern const struct gl_pipeline_stage _r200_render_stage;
+extern const struct gl_pipeline_stage _r200_tcl_stage;
+
+static const struct gl_pipeline_stage *r200_pipeline[] = {
+
+ /* Try and go straight to t&l
+ */
+ &_r200_tcl_stage,
+
+ /* Catch any t&l fallbacks
+ */
+ &_tnl_vertex_transform_stage,
+ &_tnl_normal_transform_stage,
+ &_tnl_lighting_stage,
+ &_tnl_fog_coordinate_stage,
+ &_tnl_texgen_stage,
+ &_tnl_texture_transform_stage,
+
+ /* Try again to go to tcl?
+ * - no good for asymmetric-twoside (do with multipass)
+ * - no good for asymmetric-unfilled (do with multipass)
+ * - good for material
+ * - good for texgen
+ * - need to manipulate a bit of state
+ *
+ * - worth it/not worth it?
+ */
+
+ /* Else do them here.
+ */
+ &_r200_render_stage,
+ &_tnl_render_stage, /* FALLBACK: */
+ 0,
+};
+
+
+
+/* Initialize the driver's misc functions.
+ */
+static void r200InitDriverFuncs( GLcontext *ctx )
+{
+ ctx->Driver.GetBufferSize = r200GetBufferSize;
+ ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
+ ctx->Driver.GetString = r200GetString;
+
+ ctx->Driver.Error = NULL;
+ ctx->Driver.DrawPixels = NULL;
+ ctx->Driver.Bitmap = NULL;
+}
+
+static void add_debug_flags( const char *debug )
+{
+ if (strstr(debug, "fall"))
+ R200_DEBUG |= DEBUG_FALLBACKS;
+
+ if (strstr(debug, "tex"))
+ R200_DEBUG |= DEBUG_TEXTURE;
+
+ if (strstr(debug, "ioctl"))
+ R200_DEBUG |= DEBUG_IOCTL;
+
+ if (strstr(debug, "prim"))
+ R200_DEBUG |= DEBUG_PRIMS;
+
+ if (strstr(debug, "vert"))
+ R200_DEBUG |= DEBUG_VERTS;
+
+ if (strstr(debug, "state"))
+ R200_DEBUG |= DEBUG_STATE;
+
+ if (strstr(debug, "code"))
+ R200_DEBUG |= DEBUG_CODEGEN;
+
+ if (strstr(debug, "vfmt") || strstr(debug, "vtxf"))
+ R200_DEBUG |= DEBUG_VFMT;
+
+ if (strstr(debug, "verb"))
+ R200_DEBUG |= DEBUG_VERBOSE;
+
+ if (strstr(debug, "dri"))
+ R200_DEBUG |= DEBUG_DRI;
+
+ if (strstr(debug, "dma"))
+ R200_DEBUG |= DEBUG_DMA;
+
+ if (strstr(debug, "san"))
+ R200_DEBUG |= DEBUG_SANITY;
+
+ if (strstr(debug, "sync"))
+ R200_DEBUG |= DEBUG_SYNC;
+
+ if (strstr(debug, "pix"))
+ R200_DEBUG |= DEBUG_PIXEL;
+
+ if (strstr(debug, "mem"))
+ R200_DEBUG |= DEBUG_MEMORY;
+}
+
+/* Create the device specific context.
+ */
+GLboolean r200CreateContext( const __GLcontextModes *glVisual,
+ __DRIcontextPrivate *driContextPriv,
+ void *sharedContextPrivate)
+{
+ __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
+ r200ScreenPtr r200Screen = (r200ScreenPtr)(sPriv->private);
+ r200ContextPtr rmesa;
+ GLcontext *ctx, *shareCtx;
+ int i, memPerUnit;
+
+ assert(glVisual);
+ assert(driContextPriv);
+ assert(r200Screen);
+
+ /* Allocate the R200 context */
+ rmesa = (r200ContextPtr) CALLOC( sizeof(*rmesa) );
+ if ( !rmesa )
+ return GL_FALSE;
+
+ /* Allocate the Mesa context */
+ if (sharedContextPrivate)
+ shareCtx = ((r200ContextPtr) sharedContextPrivate)->glCtx;
+ else
+ shareCtx = NULL;
+ rmesa->glCtx = _mesa_create_context(glVisual, shareCtx, (void *) rmesa, GL_TRUE);
+ if (!rmesa->glCtx) {
+ FREE(rmesa);
+ return GL_FALSE;
+ }
+ driContextPriv->driverPrivate = rmesa;
+
+ /* Init r200 context data */
+ rmesa->dri.context = driContextPriv;
+ rmesa->dri.screen = sPriv;
+ rmesa->dri.drawable = NULL; /* Set by XMesaMakeCurrent */
+ rmesa->dri.hwContext = driContextPriv->hHWContext;
+ rmesa->dri.hwLock = &sPriv->pSAREA->lock;
+ rmesa->dri.fd = sPriv->fd;
+ rmesa->dri.drmMinor = sPriv->drmMinor;
+
+ rmesa->r200Screen = r200Screen;
+ rmesa->sarea = (RADEONSAREAPrivPtr)((GLubyte *)sPriv->pSAREA +
+ r200Screen->sarea_priv_offset);
+
+
+ rmesa->dma.buf0_address = rmesa->r200Screen->buffers->list[0].address;
+
+ for ( i = 0 ; i < r200Screen->numTexHeaps ; i++ ) {
+ make_empty_list( &rmesa->texture.objects[i] );
+ rmesa->texture.heap[i] = mmInit( 0, r200Screen->texSize[i] );
+ rmesa->texture.age[i] = -1;
+ }
+ rmesa->texture.numHeaps = r200Screen->numTexHeaps;
+ make_empty_list( &rmesa->texture.swapped );
+
+ rmesa->swtcl.RenderIndex = ~0;
+ rmesa->lost_context = 1;
+
+ /* KW: Set the maximum texture size small enough that we can
+ * guarentee that both texture units can bind a maximal texture
+ * and have them both in on-card memory at once.
+ * Test for 2 textures * 4 bytes/texel * size * size.
+ */
+ ctx = rmesa->glCtx;
+ memPerUnit = r200Screen->texSize[RADEON_CARD_HEAP] / 2;
+
+ /* XXX the following code could go into a utility file */
+ if (memPerUnit >= 4 * 2048 * 2048) {
+ ctx->Const.MaxTextureLevels = 12; /* 2048x2048 */
+ }
+ else if (memPerUnit >= 4 * 1024 * 1024) {
+ ctx->Const.MaxTextureLevels = 11; /* 1024x1024 */
+ }
+ else if (memPerUnit >= 4 * 512 * 512) {
+ ctx->Const.MaxTextureLevels = 10; /* 512x512 */
+ }
+ else {
+ ctx->Const.MaxTextureLevels = 9; /* 256x256 */
+ }
+
+#if ENABLE_HW_3D_TEXTURE
+ if (memPerUnit >= 4 * 256 * 256 * 256) {
+ ctx->Const.Max3DTextureLevels = 9; /* 256x256x256 */
+ }
+ else if (memPerUnit >= 4 * 64 * 64 * 64) {
+ ctx->Const.Max3DTextureLevels = 8; /* 128x128x128 */
+ }
+ else if (memPerUnit >= 4 * 32 * 32 * 32) {
+ ctx->Const.Max3DTextureLevels = 7; /* 64x64x64 */
+ }
+ else { /* 256KBytes */
+ ctx->Const.Max3DTextureLevels = 6; /* 32x32x32 */
+ }
+#endif
+
+ if (memPerUnit >= 4 * 6 * 2048 * 2048) {
+ ctx->Const.MaxCubeTextureLevels = 12; /* 2048x2048 */
+ }
+ if (memPerUnit >= 4 * 6 * 1024 * 1024) {
+ ctx->Const.MaxCubeTextureLevels = 11; /* 1024x1024 */
+ }
+ else if (memPerUnit >= 4 * 6 * 512 * 512) {
+ ctx->Const.MaxCubeTextureLevels = 10; /* 512x512 */
+ }
+ else if (memPerUnit >= 4 * 6 * 256 * 256) {
+ ctx->Const.MaxCubeTextureLevels = 9; /* 256x256 */
+ }
+ else { /* 393216 bytes */
+ ctx->Const.MaxCubeTextureLevels = 8; /* 128x128 */
+ }
+
+ ctx->Const.MaxTextureUnits = 2;
+ ctx->Const.MaxTextureMaxAnisotropy = 16.0;
+
+ /* No wide points.
+ */
+ ctx->Const.MinPointSize = 1.0;
+ ctx->Const.MinPointSizeAA = 1.0;
+ ctx->Const.MaxPointSize = 1.0;
+ ctx->Const.MaxPointSizeAA = 1.0;
+
+ ctx->Const.MinLineWidth = 1.0;
+ ctx->Const.MinLineWidthAA = 1.0;
+ ctx->Const.MaxLineWidth = 10.0;
+ ctx->Const.MaxLineWidthAA = 10.0;
+ ctx->Const.LineWidthGranularity = 0.0625;
+
+ /* Initialize the software rasterizer and helper modules.
+ */
+ _swrast_CreateContext( ctx );
+ _ac_CreateContext( ctx );
+ _tnl_CreateContext( ctx );
+ _swsetup_CreateContext( ctx );
+ _ae_create_context( ctx );
+
+ /* Install the customized pipeline:
+ */
+ _tnl_destroy_pipeline( ctx );
+ _tnl_install_pipeline( ctx, r200_pipeline );
+
+ /* Try and keep materials and vertices separate:
+ */
+ _tnl_isolate_materials( ctx, GL_TRUE );
+
+
+ /* Configure swrast to match hardware characteristics:
+ */
+ _swrast_allow_pixel_fog( ctx, GL_FALSE );
+ _swrast_allow_vertex_fog( ctx, GL_TRUE );
+
+
+ _math_matrix_ctr( &rmesa->TexGenMatrix[0] );
+ _math_matrix_ctr( &rmesa->TexGenMatrix[1] );
+ _math_matrix_ctr( &rmesa->tmpmat );
+ _math_matrix_set_identity( &rmesa->TexGenMatrix[0] );
+ _math_matrix_set_identity( &rmesa->TexGenMatrix[1] );
+ _math_matrix_set_identity( &rmesa->tmpmat );
+
+ r200InitExtensions( ctx, r200Screen );
+ r200InitDriverFuncs( ctx );
+ r200InitIoctlFuncs( ctx );
+ r200InitStateFuncs( ctx );
+ r200InitSpanFuncs( ctx );
+ r200InitPixelFuncs( ctx );
+ r200InitTextureFuncs( ctx );
+ r200InitState( rmesa );
+ r200InitSwtcl( ctx );
+
+ rmesa->iw.irq_seq = -1;
+ rmesa->irqsEmitted = 0;
+ rmesa->do_irqs = (rmesa->dri.drmMinor >= 6 &&
+ !getenv("R200_NO_IRQS") &&
+ rmesa->r200Screen->irq);
+
+ if (!rmesa->do_irqs)
+ fprintf(stderr,
+ "IRQ's not enabled, falling back to busy waits: %d %d %d\n",
+ rmesa->dri.drmMinor,
+ !!getenv("R200_NO_IRQS"),
+ rmesa->r200Screen->irq);
+
+
+ rmesa->do_usleeps = !getenv("R200_NO_USLEEPS");
+ rmesa->prefer_agp_client_texturing =
+ (getenv("R200_AGP_CLIENT_TEXTURES") != 0);
+
+
+#if DO_DEBUG
+ if (getenv("R200_DEBUG"))
+ add_debug_flags( getenv("R200_DEBUG") );
+ if (getenv("RADEON_DEBUG"))
+ add_debug_flags( getenv("RADEON_DEBUG") );
+#endif
+
+ if (getenv("R200_NO_RAST")) {
+ fprintf(stderr, "disabling 3D acceleration\n");
+ FALLBACK(rmesa, R200_FALLBACK_DISABLE, 1);
+ }
+ else if (getenv("R200_NO_TCL")) {
+ fprintf(stderr, "disabling TCL support\n");
+ TCL_FALLBACK(rmesa->glCtx, R200_TCL_FALLBACK_TCL_DISABLE, 1);
+ }
+ else {
+ if (!getenv("R200_NO_VTXFMT")) {
+ r200VtxfmtInit( ctx );
+ }
+ _tnl_need_dlist_norm_lengths( ctx, GL_FALSE );
+ }
+ return GL_TRUE;
+}
+
+
+/* Destroy the device specific context.
+ */
+/* Destroy the Mesa and driver specific context data.
+ */
+void r200DestroyContext( __DRIcontextPrivate *driContextPriv )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ r200ContextPtr rmesa = (r200ContextPtr) driContextPriv->driverPrivate;
+ r200ContextPtr current = ctx ? R200_CONTEXT(ctx) : NULL;
+
+ /* check if we're deleting the currently bound context */
+ if (rmesa == current) {
+ R200_FIREVERTICES( rmesa );
+ _mesa_make_current2(NULL, NULL, NULL);
+ }
+
+ /* Free r200 context resources */
+ assert(rmesa); /* should never be null */
+ if ( rmesa ) {
+ if (rmesa->glCtx->Shared->RefCount == 1) {
+ /* This share group is about to go away, free our private
+ * texture object data.
+ */
+ r200TexObjPtr t, next_t;
+ int i;
+
+ for ( i = 0 ; i < rmesa->texture.numHeaps ; i++ ) {
+ foreach_s ( t, next_t, &rmesa->texture.objects[i] ) {
+ r200DestroyTexObj( rmesa, t );
+ }
+ mmDestroy( rmesa->texture.heap[i] );
+ rmesa->texture.heap[i] = NULL;
+ }
+
+ foreach_s ( t, next_t, &rmesa->texture.swapped ) {
+ r200DestroyTexObj( rmesa, t );
+ }
+ }
+
+ _swsetup_DestroyContext( rmesa->glCtx );
+ _tnl_DestroyContext( rmesa->glCtx );
+ _ac_DestroyContext( rmesa->glCtx );
+ _swrast_DestroyContext( rmesa->glCtx );
+
+ r200DestroySwtcl( rmesa->glCtx );
+
+ r200ReleaseArrays( rmesa->glCtx, ~0 );
+
+ if (rmesa->dma.current.buf) {
+ r200ReleaseDmaRegion( rmesa, &rmesa->dma.current, __FUNCTION__ );
+ r200FlushCmdBuf( rmesa, __FUNCTION__ );
+ }
+
+ if (!rmesa->TclFallback & R200_TCL_FALLBACK_TCL_DISABLE)
+ if (!getenv("R200_NO_VTXFMT"))
+ r200VtxfmtDestroy( rmesa->glCtx );
+
+ /* free the Mesa context */
+ rmesa->glCtx->DriverCtx = NULL;
+ _mesa_destroy_context( rmesa->glCtx );
+
+ if (rmesa->state.scissor.pClipRects) {
+ FREE(rmesa->state.scissor.pClipRects);
+ rmesa->state.scissor.pClipRects = 0;
+ }
+
+ FREE( rmesa );
+ }
+}
+
+
+
+
+void
+r200SwapBuffers( __DRIdrawablePrivate *dPriv )
+{
+ if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
+ r200ContextPtr rmesa;
+ GLcontext *ctx;
+ rmesa = (r200ContextPtr) dPriv->driContextPriv->driverPrivate;
+ ctx = rmesa->glCtx;
+ if (ctx->Visual.doubleBufferMode) {
+ _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */
+ if ( rmesa->doPageFlip ) {
+ r200PageFlip( dPriv );
+ }
+ else {
+ r200CopyBuffer( dPriv );
+ }
+ }
+ }
+ else {
+ /* XXX this shouldn't be an error but we can't handle it for now */
+ _mesa_problem(NULL, "r200SwapBuffers: drawable has no context!\n");
+ }
+}
+
+
+/* Force the context `c' to be the current context and associate with it
+ * buffer `b'.
+ */
+GLboolean
+r200MakeCurrent( __DRIcontextPrivate *driContextPriv,
+ __DRIdrawablePrivate *driDrawPriv,
+ __DRIdrawablePrivate *driReadPriv )
+{
+ if ( driContextPriv ) {
+ r200ContextPtr newR200Ctx =
+ (r200ContextPtr) driContextPriv->driverPrivate;
+
+ if (R200_DEBUG & DEBUG_DRI)
+ fprintf(stderr, "%s ctx %p\n", __FUNCTION__, newR200Ctx->glCtx);
+
+ if ( newR200Ctx->dri.drawable != driDrawPriv ) {
+ newR200Ctx->dri.drawable = driDrawPriv;
+ r200UpdateWindow( newR200Ctx->glCtx );
+ r200UpdateViewportOffset( newR200Ctx->glCtx );
+ }
+
+ _mesa_make_current2( newR200Ctx->glCtx,
+ (GLframebuffer *) driDrawPriv->driverPrivate,
+ (GLframebuffer *) driReadPriv->driverPrivate );
+
+ if ( !newR200Ctx->glCtx->Viewport.Width ) {
+ _mesa_set_viewport( newR200Ctx->glCtx, 0, 0,
+ driDrawPriv->w, driDrawPriv->h );
+ }
+
+ if (newR200Ctx->vb.enabled)
+ r200VtxfmtMakeCurrent( newR200Ctx->glCtx );
+
+ _mesa_update_state( newR200Ctx->glCtx );
+ r200ValidateState( newR200Ctx->glCtx );
+
+ } else {
+ if (R200_DEBUG & DEBUG_DRI)
+ fprintf(stderr, "%s ctx is null\n", __FUNCTION__);
+ _mesa_make_current( 0, 0 );
+ }
+
+ if (R200_DEBUG & DEBUG_DRI)
+ fprintf(stderr, "End %s\n", __FUNCTION__);
+ return GL_TRUE;
+}
+
+/* Force the context `c' to be unbound from its buffer.
+ */
+GLboolean
+r200UnbindContext( __DRIcontextPrivate *driContextPriv )
+{
+ r200ContextPtr rmesa = (r200ContextPtr) driContextPriv->driverPrivate;
+
+ if (R200_DEBUG & DEBUG_DRI)
+ fprintf(stderr, "%s ctx %p\n", __FUNCTION__, rmesa->glCtx);
+
+ r200VtxfmtUnbindContext( rmesa->glCtx );
+ return GL_TRUE;
+}
+
+
+
+
+
+
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_context.h b/xc/lib/GL/mesa/src/drv/r200/r200_context.h
new file mode 100644
index 000000000..db354476b
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_context.h
@@ -0,0 +1,944 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#ifndef __R200_CONTEXT_H__
+#define __R200_CONTEXT_H__
+
+#ifdef GLX_DIRECT_RENDERING
+
+#include "dri_util.h"
+#include "radeon_common.h"
+
+#include "macros.h"
+#include "mtypes.h"
+#include "r200_reg.h"
+
+#define ENABLE_HW_3D_TEXTURE 0 /* XXX this is temporary! */
+
+struct r200_context;
+typedef struct r200_context r200ContextRec;
+typedef struct r200_context *r200ContextPtr;
+
+#include "r200_lock.h"
+#include "r200_screen.h"
+#include "mm.h"
+
+/* Flags for software fallback cases */
+/* See correponding strings in r200_swtcl.c */
+#define R200_FALLBACK_TEXTURE 0x1
+#define R200_FALLBACK_DRAW_BUFFER 0x2
+#define R200_FALLBACK_STENCIL 0x4
+#define R200_FALLBACK_RENDER_MODE 0x8
+#define R200_FALLBACK_BLEND_EQ 0x10
+#define R200_FALLBACK_BLEND_FUNC 0x20
+#define R200_FALLBACK_DISABLE 0x40
+
+/* The blit width for texture uploads
+ */
+#define BLIT_WIDTH_BYTES 1024
+
+/* Use the templated vertex format:
+ */
+#define COLOR_IS_RGBA
+#define TAG(x) r200##x
+#include "tnl_dd/t_dd_vertex.h"
+#undef TAG
+
+typedef void (*r200_tri_func)( r200ContextPtr,
+ r200Vertex *,
+ r200Vertex *,
+ r200Vertex * );
+
+typedef void (*r200_line_func)( r200ContextPtr,
+ r200Vertex *,
+ r200Vertex * );
+
+typedef void (*r200_point_func)( r200ContextPtr,
+ r200Vertex * );
+
+
+struct r200_colorbuffer_state {
+ GLuint clear;
+ GLint drawOffset, drawPitch;
+};
+
+
+struct r200_depthbuffer_state {
+ GLfloat scale;
+};
+
+struct r200_pixel_state {
+ GLint readOffset, readPitch;
+};
+
+struct r200_scissor_state {
+ XF86DRIClipRectRec rect;
+ GLboolean enabled;
+
+ GLuint numClipRects; /* Cliprects active */
+ GLuint numAllocedClipRects; /* Cliprects available */
+ XF86DRIClipRectPtr pClipRects;
+};
+
+struct r200_stencilbuffer_state {
+ GLboolean hwBuffer;
+ GLuint clear; /* rb3d_stencilrefmask value */
+};
+
+struct r200_stipple_state {
+ GLuint mask[32];
+};
+
+
+
+#define TEX_0 0x1
+#define TEX_1 0x2
+#define TEX_ALL 0x3
+
+typedef struct r200_tex_obj r200TexObj, *r200TexObjPtr;
+
+/* Texture object in locally shared texture space.
+ */
+struct r200_tex_obj {
+ r200TexObjPtr next, prev;
+
+ struct gl_texture_object *tObj; /* Mesa texture object */
+
+ PMemBlock memBlock; /* Memory block containing texture */
+ GLuint bufAddr; /* Offset to start of locally
+ shared texture block */
+
+ GLuint dirty_images[6]; /* Flags for whether or not
+ images need to be uploaded to
+ local or AGP texture space.
+ Six cube faces. */
+
+ GLuint dirty_state; /* Flags (1 per texunit) for
+ whether or not this texobj
+ has dirty hardware state
+ (pp_*) that needs to be
+ brought into the
+ texunit. */
+
+ GLint heap; /* Texture heap currently stored in */
+
+ drmRadeonTexImage image[6][RADEON_MAX_TEXTURE_LEVELS];
+ /* Six, for the cube faces */
+
+ GLint totalSize; /* Total size of the texture
+ including all mipmap levels,
+ and all six cube faces */
+
+ GLuint pp_txfilter; /* hardware register values */
+ GLuint pp_txformat;
+ GLuint pp_txformat_x;
+ GLuint pp_txoffset; /* Image location in texmem.
+ All cube faces follow. */
+ GLuint pp_txsize; /* npot only */
+ GLuint pp_txpitch; /* npot only */
+ GLuint pp_border_color;
+ GLuint pp_cubic_faces; /* cube face 1,2,3,4 log2 sizes */
+
+ /* texObj->Image[firstLevel] through texObj->Image[lastLevel] are the
+ * images to upload.
+ */
+ GLint firstLevel;
+ GLint lastLevel;
+};
+
+
+struct r200_texture_env_state {
+ r200TexObjPtr texobj;
+ GLenum format;
+ GLenum envMode;
+};
+
+#define R200_MAX_TEXTURE_UNITS 3
+
+struct r200_texture_state {
+ struct r200_texture_env_state unit[R200_MAX_TEXTURE_UNITS];
+};
+
+
+struct r200_state_atom {
+ struct r200_state_atom *next, *prev;
+ const char *name; /* for debug */
+ int cmd_size; /* size in bytes */
+ GLuint idx;
+ int *cmd; /* one or more cmd's */
+ int *lastcmd; /* one or more cmd's */
+ GLboolean (*check)( GLcontext *, int ); /* is this state active? */
+};
+
+
+
+/* Trying to keep these relatively short as the variables are becoming
+ * extravagently long. Drop the R200_ off the front of everything -
+ * I think we know we're in the r200 driver by now, and keep the
+ * prefix to 3 letters unless absolutely impossible.
+ */
+
+#define CTX_CMD_0 0
+#define CTX_PP_MISC 1
+#define CTX_PP_FOG_COLOR 2
+#define CTX_RE_SOLID_COLOR 3
+#define CTX_RB3D_BLENDCNTL 4
+#define CTX_RB3D_DEPTHOFFSET 5
+#define CTX_RB3D_DEPTHPITCH 6
+#define CTX_RB3D_ZSTENCILCNTL 7
+#define CTX_CMD_1 8
+#define CTX_PP_CNTL 9
+#define CTX_RB3D_CNTL 10
+#define CTX_RB3D_COLOROFFSET 11
+#define CTX_CMD_2 12 /* why */
+#define CTX_RB3D_COLORPITCH 13 /* why */
+#define CTX_STATE_SIZE 14
+
+#define SET_CMD_0 0
+#define SET_SE_CNTL 1
+#define SET_RE_CNTL 2 /* replace se_coord_fmt */
+#define SET_STATE_SIZE 3
+
+#define VTE_CMD_0 0
+#define VTE_SE_VTE_CNTL 1
+#define VTE_STATE_SIZE 2
+
+#define LIN_CMD_0 0
+#define LIN_RE_LINE_PATTERN 1
+#define LIN_RE_LINE_STATE 2
+#define LIN_CMD_1 3
+#define LIN_SE_LINE_WIDTH 4
+#define LIN_STATE_SIZE 5
+
+#define MSK_CMD_0 0
+#define MSK_RB3D_STENCILREFMASK 1
+#define MSK_RB3D_ROPCNTL 2
+#define MSK_RB3D_PLANEMASK 3
+#define MSK_STATE_SIZE 4
+
+#define VPT_CMD_0 0
+#define VPT_SE_VPORT_XSCALE 1
+#define VPT_SE_VPORT_XOFFSET 2
+#define VPT_SE_VPORT_YSCALE 3
+#define VPT_SE_VPORT_YOFFSET 4
+#define VPT_SE_VPORT_ZSCALE 5
+#define VPT_SE_VPORT_ZOFFSET 6
+#define VPT_STATE_SIZE 7
+
+#define ZBS_CMD_0 0
+#define ZBS_SE_ZBIAS_FACTOR 1
+#define ZBS_SE_ZBIAS_CONSTANT 2
+#define ZBS_STATE_SIZE 3
+
+#define MSC_CMD_0 0
+#define MSC_RE_MISC 1
+#define MSC_STATE_SIZE 2
+
+#define TAM_CMD_0 0
+#define TAM_DEBUG3 1
+#define TAM_STATE_SIZE 2
+
+#define TEX_CMD_0 0
+#define TEX_PP_TXFILTER 1 /*2c00*/
+#define TEX_PP_TXFORMAT 2 /*2c04*/
+#define TEX_PP_TXFORMAT_X 3 /*2c08*/
+#define TEX_PP_TXSIZE 4 /*2c0c*/
+#define TEX_PP_TXPITCH 5 /*2c10*/
+#define TEX_PP_BORDER_COLOR 6 /*2c14*/
+#define TEX_CMD_1 7
+#define TEX_PP_TXOFFSET 8 /*2d00 */
+#define TEX_STATE_SIZE 9
+
+#define CUBE_CMD_0 0 /* 1 register follows */
+#define CUBE_PP_CUBIC_FACES 1 /* 0x2c18 */
+#define CUBE_CMD_1 2 /* 5 registers follow */
+#define CUBE_PP_CUBIC_OFFSET_F1 3 /* 0x2d04 */
+#define CUBE_PP_CUBIC_OFFSET_F2 4 /* 0x2d08 */
+#define CUBE_PP_CUBIC_OFFSET_F3 5 /* 0x2d0c */
+#define CUBE_PP_CUBIC_OFFSET_F4 6 /* 0x2d10 */
+#define CUBE_PP_CUBIC_OFFSET_F5 7 /* 0x2d14 */
+#define CUBE_STATE_SIZE 8
+
+#define PIX_CMD_0 0
+#define PIX_PP_TXCBLEND 1
+#define PIX_PP_TXCBLEND2 2
+#define PIX_PP_TXABLEND 3
+#define PIX_PP_TXABLEND2 4
+#define PIX_STATE_SIZE 5
+
+#define TF_CMD_0 0
+#define TF_TFACTOR_0 1
+#define TF_TFACTOR_1 2
+#define TF_TFACTOR_2 3
+#define TF_TFACTOR_3 4
+#define TF_TFACTOR_4 5
+#define TF_TFACTOR_5 6
+#define TF_STATE_SIZE 7
+
+#define TCL_CMD_0 0
+#define TCL_LIGHT_MODEL_CTL_0 1
+#define TCL_LIGHT_MODEL_CTL_1 2
+#define TCL_PER_LIGHT_CTL_0 3
+#define TCL_PER_LIGHT_CTL_1 4
+#define TCL_PER_LIGHT_CTL_2 5
+#define TCL_PER_LIGHT_CTL_3 6
+#define TCL_CMD_1 7
+#define TCL_UCP_VERT_BLEND_CTL 8
+#define TCL_STATE_SIZE 9
+
+#define MSL_CMD_0 0
+#define MSL_MATRIX_SELECT_0 1
+#define MSL_MATRIX_SELECT_1 2
+#define MSL_MATRIX_SELECT_2 3
+#define MSL_MATRIX_SELECT_3 4
+#define MSL_MATRIX_SELECT_4 5
+#define MSL_STATE_SIZE 6
+
+#define TCG_CMD_0 0
+#define TCG_TEX_PROC_CTL_2 1
+#define TCG_TEX_PROC_CTL_3 2
+#define TCG_TEX_PROC_CTL_0 3
+#define TCG_TEX_PROC_CTL_1 4
+#define TCG_TEX_CYL_WRAP_CTL 5
+#define TCG_STATE_SIZE 6
+
+#define MTL_CMD_0 0
+#define MTL_EMMISSIVE_RED 1
+#define MTL_EMMISSIVE_GREEN 2
+#define MTL_EMMISSIVE_BLUE 3
+#define MTL_EMMISSIVE_ALPHA 4
+#define MTL_AMBIENT_RED 5
+#define MTL_AMBIENT_GREEN 6
+#define MTL_AMBIENT_BLUE 7
+#define MTL_AMBIENT_ALPHA 8
+#define MTL_DIFFUSE_RED 9
+#define MTL_DIFFUSE_GREEN 10
+#define MTL_DIFFUSE_BLUE 11
+#define MTL_DIFFUSE_ALPHA 12
+#define MTL_SPECULAR_RED 13
+#define MTL_SPECULAR_GREEN 14
+#define MTL_SPECULAR_BLUE 15
+#define MTL_SPECULAR_ALPHA 16
+#define MTL_CMD_1 17
+#define MTL_SHININESS 18
+#define MTL_STATE_SIZE 19
+
+#define VAP_CMD_0 0
+#define VAP_SE_VAP_CNTL 1
+#define VAP_STATE_SIZE 2
+
+/* Replaces a lot of packet info from radeon
+ */
+#define VTX_CMD_0 0
+#define VTX_VTXFMT_0 1
+#define VTX_VTXFMT_1 2
+#define VTX_TCL_OUTPUT_VTXFMT_0 3
+#define VTX_TCL_OUTPUT_VTXFMT_1 4
+#define VTX_CMD_1 5
+#define VTX_TCL_OUTPUT_COMPSEL 6
+#define VTX_CMD_2 7
+#define VTX_STATE_CNTL 8
+#define VTX_STATE_SIZE 9
+
+
+#define VTX_COLOR(v,n) (((v)>>(R200_VTX_COLOR_0_SHIFT+(n)*2))&\
+ R200_VTX_COLOR_MASK)
+
+#define MAT_CMD_0 0
+#define MAT_ELT_0 1
+#define MAT_STATE_SIZE 17
+
+#define GRD_CMD_0 0
+#define GRD_VERT_GUARD_CLIP_ADJ 1
+#define GRD_VERT_GUARD_DISCARD_ADJ 2
+#define GRD_HORZ_GUARD_CLIP_ADJ 3
+#define GRD_HORZ_GUARD_DISCARD_ADJ 4
+#define GRD_STATE_SIZE 5
+
+/* position changes frequently when lighting in modelpos - separate
+ * out to new state item?
+ */
+#define LIT_CMD_0 0
+#define LIT_AMBIENT_RED 1
+#define LIT_AMBIENT_GREEN 2
+#define LIT_AMBIENT_BLUE 3
+#define LIT_AMBIENT_ALPHA 4
+#define LIT_DIFFUSE_RED 5
+#define LIT_DIFFUSE_GREEN 6
+#define LIT_DIFFUSE_BLUE 7
+#define LIT_DIFFUSE_ALPHA 8
+#define LIT_SPECULAR_RED 9
+#define LIT_SPECULAR_GREEN 10
+#define LIT_SPECULAR_BLUE 11
+#define LIT_SPECULAR_ALPHA 12
+#define LIT_POSITION_X 13
+#define LIT_POSITION_Y 14
+#define LIT_POSITION_Z 15
+#define LIT_POSITION_W 16
+#define LIT_DIRECTION_X 17
+#define LIT_DIRECTION_Y 18
+#define LIT_DIRECTION_Z 19
+#define LIT_DIRECTION_W 20
+#define LIT_ATTEN_CONST 21
+#define LIT_ATTEN_LINEAR 22
+#define LIT_ATTEN_QUADRATIC 23
+#define LIT_ATTEN_XXX 24
+#define LIT_CMD_1 25
+#define LIT_SPOT_DCD 26
+#define LIT_SPOT_DCM 27
+#define LIT_SPOT_EXPONENT 28
+#define LIT_SPOT_CUTOFF 29
+#define LIT_SPECULAR_THRESH 30
+#define LIT_RANGE_CUTOFF 31 /* ? */
+#define LIT_RANGE_ATTEN 32 /* ? */
+#define LIT_STATE_SIZE 33
+
+/* Fog
+ */
+#define FOG_CMD_0 0
+#define FOG_R 1
+#define FOG_C 2
+#define FOG_D 3
+#define FOG_PAD 4
+#define FOG_STATE_SIZE 5
+
+/* UCP
+ */
+#define UCP_CMD_0 0
+#define UCP_X 1
+#define UCP_Y 2
+#define UCP_Z 3
+#define UCP_W 4
+#define UCP_STATE_SIZE 5
+
+/* GLT - Global ambient
+ */
+#define GLT_CMD_0 0
+#define GLT_RED 1
+#define GLT_GREEN 2
+#define GLT_BLUE 3
+#define GLT_ALPHA 4
+#define GLT_STATE_SIZE 5
+
+/* EYE
+ */
+#define EYE_CMD_0 0
+#define EYE_X 1
+#define EYE_Y 2
+#define EYE_Z 3
+#define EYE_RESCALE_FACTOR 4
+#define EYE_STATE_SIZE 5
+
+/* CST - constant state
+ */
+#define CST_CMD_0 0
+#define CST_PP_CNTL_X 1
+#define CST_CMD_1 2
+#define CST_RB3D_DEPTHXY_OFFSET 3
+#define CST_CMD_2 4
+#define CST_RE_AUX_SCISSOR_CNTL 5
+#define CST_CMD_3 6
+#define CST_RE_SCISSOR_TL_0 7
+#define CST_RE_SCISSOR_BR_0 8
+#define CST_CMD_4 9
+#define CST_SE_VAP_CNTL_STATUS 10
+#define CST_CMD_5 11
+#define CST_RE_POINTSIZE 12
+#define CST_CMD_6 13
+#define CST_SE_TCL_INPUT_VTX_0 14
+#define CST_SE_TCL_INPUT_VTX_1 15
+#define CST_SE_TCL_INPUT_VTX_2 16
+#define CST_SE_TCL_INPUT_VTX_3 17
+#define CST_STATE_SIZE 18
+
+
+
+
+struct r200_hw_state {
+ /* All state should be on one of these lists:
+ */
+ struct r200_state_atom dirty; /* dirty list head placeholder */
+ struct r200_state_atom clean; /* clean list head placeholder */
+
+ /* Hardware state, stored as cmdbuf commands:
+ * -- Need to doublebuffer for
+ * - reviving state after loss of context
+ * - eliding noop statechange loops? (except line stipple count)
+ */
+ struct r200_state_atom ctx;
+ struct r200_state_atom set;
+ struct r200_state_atom vte;
+ struct r200_state_atom lin;
+ struct r200_state_atom msk;
+ struct r200_state_atom vpt;
+ struct r200_state_atom vap;
+ struct r200_state_atom vtx;
+ struct r200_state_atom tcl;
+ struct r200_state_atom msl;
+ struct r200_state_atom tcg;
+ struct r200_state_atom msc;
+ struct r200_state_atom cst;
+ struct r200_state_atom tam;
+ struct r200_state_atom tf;
+ struct r200_state_atom tex[2];
+ struct r200_state_atom cube[2];
+ struct r200_state_atom zbs;
+ struct r200_state_atom mtl[2];
+ struct r200_state_atom mat[5];
+ struct r200_state_atom lit[8]; /* includes vec, scl commands */
+ struct r200_state_atom ucp[6];
+ struct r200_state_atom pix[6]; /* pixshader stages */
+ struct r200_state_atom eye; /* eye pos */
+ struct r200_state_atom grd; /* guard band clipping */
+ struct r200_state_atom fog;
+ struct r200_state_atom glt;
+};
+
+struct r200_state {
+ /* Derived state for internal purposes:
+ */
+ struct r200_colorbuffer_state color;
+ struct r200_depthbuffer_state depth;
+ struct r200_pixel_state pixel;
+ struct r200_scissor_state scissor;
+ struct r200_stencilbuffer_state stencil;
+ struct r200_stipple_state stipple;
+ struct r200_texture_state texture;
+};
+
+struct r200_texture {
+ r200TexObj objects[R200_NR_TEX_HEAPS];
+ r200TexObj swapped;
+
+ memHeap_t *heap[R200_NR_TEX_HEAPS];
+ GLint age[R200_NR_TEX_HEAPS];
+
+ GLint numHeaps;
+};
+
+/* Need refcounting on dma buffers:
+ */
+struct r200_dma_buffer {
+ int refcount; /* the number of retained regions in buf */
+ drmBufPtr buf;
+};
+
+#define GET_START(rvb) (rmesa->r200Screen->agp_buffer_offset + \
+ (rvb)->address - rmesa->dma.buf0_address + \
+ (rvb)->start)
+
+/* A retained region, eg vertices for indexed vertices.
+ */
+struct r200_dma_region {
+ struct r200_dma_buffer *buf;
+ char *address; /* == buf->address */
+ int start, end, ptr; /* offsets from start of buf */
+ int aos_start;
+ int aos_stride;
+ int aos_size;
+};
+
+
+struct r200_dma {
+ /* Active dma region. Allocations for vertices and retained
+ * regions come from here. Also used for emitting random vertices,
+ * these may be flushed by calling flush_current();
+ */
+ struct r200_dma_region current;
+
+ void (*flush)( r200ContextPtr );
+
+ char *buf0_address; /* start of buf[0], for index calcs */
+ GLuint nr_released_bufs; /* flush after so many buffers released */
+};
+
+struct r200_dri_mirror {
+ __DRIcontextPrivate *context; /* DRI context */
+ __DRIscreenPrivate *screen; /* DRI screen */
+ __DRIdrawablePrivate *drawable; /* DRI drawable bound to this ctx */
+
+ drmContext hwContext;
+ drmLock *hwLock;
+ int fd;
+ int drmMinor;
+};
+
+
+#define R200_CMD_BUF_SZ (8*1024)
+
+struct r200_store {
+ GLuint statenr;
+ GLuint primnr;
+ char cmd_buf[R200_CMD_BUF_SZ];
+ int cmd_used;
+ int elts_start;
+};
+
+
+/* r200_tcl.c
+ */
+struct r200_tcl_info {
+ GLuint vertex_format;
+ GLint last_offset;
+ GLuint hw_primitive;
+
+ struct r200_dma_region *aos_components[8];
+ GLuint nr_aos_components;
+
+ GLuint *Elts;
+
+ struct r200_dma_region indexed_verts;
+ struct r200_dma_region obj;
+ struct r200_dma_region rgba;
+ struct r200_dma_region spec;
+ struct r200_dma_region fog;
+ struct r200_dma_region tex[R200_MAX_TEXTURE_UNITS];
+ struct r200_dma_region norm;
+};
+
+
+/* r200_swtcl.c
+ */
+struct r200_swtcl_info {
+ GLuint SetupIndex;
+ GLuint SetupNewInputs;
+ GLuint RenderIndex;
+ GLuint vertex_size;
+ GLuint vertex_stride_shift;
+ GLuint vertex_format;
+ char *verts;
+
+ /* Fallback rasterization functions
+ */
+ r200_point_func draw_point;
+ r200_line_func draw_line;
+ r200_tri_func draw_tri;
+
+ GLuint hw_primitive;
+ GLenum render_primitive;
+ GLuint numverts;
+
+ struct r200_dma_region indexed_verts;
+};
+
+
+struct r200_ioctl {
+ GLuint vertex_offset;
+ GLuint vertex_size;
+};
+
+
+
+#define R200_MAX_PRIMS 64
+
+
+/* Want to keep a cache of these around. Each is parameterized by
+ * only a single value which has only a small range. Only expect a
+ * few, so just rescan the list each time?
+ */
+struct dynfn {
+ struct dynfn *next, *prev;
+ int key[2];
+ char *code;
+};
+
+struct dfn_lists {
+ struct dynfn Vertex2f;
+ struct dynfn Vertex2fv;
+ struct dynfn Vertex3f;
+ struct dynfn Vertex3fv;
+ struct dynfn Color4ub;
+ struct dynfn Color4ubv;
+ struct dynfn Color3ub;
+ struct dynfn Color3ubv;
+ struct dynfn Color4f;
+ struct dynfn Color4fv;
+ struct dynfn Color3f;
+ struct dynfn Color3fv;
+ struct dynfn SecondaryColor3ubEXT;
+ struct dynfn SecondaryColor3ubvEXT;
+ struct dynfn SecondaryColor3fEXT;
+ struct dynfn SecondaryColor3fvEXT;
+ struct dynfn Normal3f;
+ struct dynfn Normal3fv;
+ struct dynfn TexCoord2f;
+ struct dynfn TexCoord2fv;
+ struct dynfn TexCoord1f;
+ struct dynfn TexCoord1fv;
+ struct dynfn MultiTexCoord2fARB;
+ struct dynfn MultiTexCoord2fvARB;
+ struct dynfn MultiTexCoord1fARB;
+ struct dynfn MultiTexCoord1fvARB;
+};
+
+struct _vb;
+
+struct dfn_generators {
+ struct dynfn *(*Vertex2f)( GLcontext *, const int * );
+ struct dynfn *(*Vertex2fv)( GLcontext *, const int * );
+ struct dynfn *(*Vertex3f)( GLcontext *, const int * );
+ struct dynfn *(*Vertex3fv)( GLcontext *, const int * );
+ struct dynfn *(*Color4ub)( GLcontext *, const int * );
+ struct dynfn *(*Color4ubv)( GLcontext *, const int * );
+ struct dynfn *(*Color3ub)( GLcontext *, const int * );
+ struct dynfn *(*Color3ubv)( GLcontext *, const int * );
+ struct dynfn *(*Color4f)( GLcontext *, const int * );
+ struct dynfn *(*Color4fv)( GLcontext *, const int * );
+ struct dynfn *(*Color3f)( GLcontext *, const int * );
+ struct dynfn *(*Color3fv)( GLcontext *, const int * );
+ struct dynfn *(*SecondaryColor3ubEXT)( GLcontext *, const int * );
+ struct dynfn *(*SecondaryColor3ubvEXT)( GLcontext *, const int * );
+ struct dynfn *(*SecondaryColor3fEXT)( GLcontext *, const int * );
+ struct dynfn *(*SecondaryColor3fvEXT)( GLcontext *, const int * );
+ struct dynfn *(*Normal3f)( GLcontext *, const int * );
+ struct dynfn *(*Normal3fv)( GLcontext *, const int * );
+ struct dynfn *(*TexCoord2f)( GLcontext *, const int * );
+ struct dynfn *(*TexCoord2fv)( GLcontext *, const int * );
+ struct dynfn *(*TexCoord1f)( GLcontext *, const int * );
+ struct dynfn *(*TexCoord1fv)( GLcontext *, const int * );
+ struct dynfn *(*MultiTexCoord2fARB)( GLcontext *, const int * );
+ struct dynfn *(*MultiTexCoord2fvARB)( GLcontext *, const int * );
+ struct dynfn *(*MultiTexCoord1fARB)( GLcontext *, const int * );
+ struct dynfn *(*MultiTexCoord1fvARB)( GLcontext *, const int * );
+};
+
+
+struct r200_vb {
+ /* Keep these first: referenced from codegen templates:
+ */
+ GLint counter, initial_counter;
+ GLint *dmaptr;
+ void (*notify)( void );
+ GLint vertex_size;
+
+ /* A maximum total of 15 elements per vertex: 3 floats for position, 3
+ * floats for normal, 4 floats for color, 4 bytes for secondary color,
+ * 2 floats for each texture unit (4 floats total).
+ *
+ * As soon as the 3rd TMU is supported or cube maps (or 3D textures) are
+ * supported, this value will grow.
+ *
+ * The position data is never actually stored here, so 3 elements could be
+ * trimmed out of the buffer.
+ */
+ union { float f; int i; r200_color_t color; } vertex[15];
+
+ GLfloat *normalptr;
+ GLfloat *floatcolorptr;
+ r200_color_t *colorptr;
+ GLfloat *floatspecptr;
+ r200_color_t *specptr;
+ GLfloat *texcoordptr[2];
+
+ GLcontext *context; /* current context : Single thread only! */
+};
+
+struct r200_prim {
+ GLuint start;
+ GLuint end;
+ GLuint prim;
+};
+
+struct r200_vbinfo {
+ GLenum *prim; /* &ctx->Driver.CurrentExecPrimitive */
+ GLuint primflags;
+ GLboolean enabled; /* R200_NO_VTXFMT//R200_NO_TCL env vars */
+ GLboolean installed;
+ GLboolean fell_back;
+ GLboolean recheck;
+ GLint initial_counter;
+ GLint nrverts;
+ GLuint vtxfmt_0, vtxfmt_1;
+
+ GLuint installed_vertex_format;
+ GLuint installed_color_3f_sz;
+
+ struct r200_prim primlist[R200_MAX_PRIMS];
+ int nrprims;
+
+ struct dfn_lists dfn_cache;
+ struct dfn_generators codegen;
+ GLvertexformat vtxfmt;
+};
+
+
+
+
+struct r200_context {
+ GLcontext *glCtx; /* Mesa context */
+
+ /* Driver and hardware state management
+ */
+ struct r200_hw_state hw;
+ struct r200_state state;
+
+ /* Texture object bookkeeping
+ */
+ struct r200_texture texture;
+
+
+ /* Rasterization and vertex state:
+ */
+ GLuint TclFallback;
+ GLuint Fallback;
+ GLuint NewGLState;
+
+
+ /* Temporaries for translating away float colors:
+ */
+ struct gl_client_array UbyteColor;
+ struct gl_client_array UbyteSecondaryColor;
+
+ /* Vertex buffers
+ */
+ struct r200_ioctl ioctl;
+ struct r200_dma dma;
+ struct r200_store store;
+
+ /* Page flipping
+ */
+ GLuint doPageFlip;
+
+ /* Busy waiting
+ */
+ GLuint do_usleeps;
+ GLuint do_irqs;
+ GLuint irqsEmitted;
+ drmRadeonIrqWait iw;
+
+ /* Clientdata textures;
+ */
+ GLuint prefer_agp_client_texturing;
+
+ /* Drawable, cliprect and scissor information
+ */
+ GLuint numClipRects; /* Cliprects for the draw buffer */
+ XF86DRIClipRectPtr pClipRects;
+ unsigned int lastStamp;
+ GLboolean lost_context;
+ r200ScreenPtr r200Screen; /* Screen private DRI data */
+ RADEONSAREAPrivPtr sarea; /* Private SAREA data */
+
+ /* TCL stuff
+ */
+ GLmatrix TexGenMatrix[R200_MAX_TEXTURE_UNITS];
+ GLboolean recheck_texgen[R200_MAX_TEXTURE_UNITS];
+ GLboolean TexGenNeedNormals[R200_MAX_TEXTURE_UNITS];
+ GLuint TexMatEnabled;
+ GLuint TexMatCompSel;
+ GLuint TexGenEnabled;
+ GLuint TexGenInputs;
+ GLuint TexGenCompSel;
+ GLmatrix tmpmat;
+
+ /* VBI
+ */
+ GLuint vbl_seq;
+
+ /* r200_tcl.c
+ */
+ struct r200_tcl_info tcl;
+
+ /* r200_swtcl.c
+ */
+ struct r200_swtcl_info swtcl;
+
+ /* r200_vtxfmt.c
+ */
+ struct r200_vbinfo vb;
+
+ /* Mirrors of some DRI state
+ */
+ struct r200_dri_mirror dri;
+};
+
+#define R200_CONTEXT(ctx) ((r200ContextPtr)(ctx->DriverCtx))
+
+
+static __inline GLuint r200PackColor( GLuint cpp,
+ GLubyte r, GLubyte g,
+ GLubyte b, GLubyte a )
+{
+ switch ( cpp ) {
+ case 2:
+ return PACK_COLOR_565( r, g, b );
+ case 4:
+ return PACK_COLOR_8888( a, r, g, b );
+ default:
+ return 0;
+ }
+}
+
+#define R200_OLD_PACKETS 0
+
+
+extern void r200DestroyContext( __DRIcontextPrivate *driContextPriv );
+extern GLboolean r200CreateContext( const __GLcontextModes *glVisual,
+ __DRIcontextPrivate *driContextPriv,
+ void *sharedContextPrivate);
+extern void r200SwapBuffers( __DRIdrawablePrivate *dPriv );
+extern GLboolean r200MakeCurrent( __DRIcontextPrivate *driContextPriv,
+ __DRIdrawablePrivate *driDrawPriv,
+ __DRIdrawablePrivate *driReadPriv );
+extern GLboolean r200UnbindContext( __DRIcontextPrivate *driContextPriv );
+
+/* ================================================================
+ * Debugging:
+ */
+#define DO_DEBUG 1
+
+#if DO_DEBUG
+extern int R200_DEBUG;
+#else
+#define R200_DEBUG 0
+#endif
+
+#define DEBUG_TEXTURE 0x001
+#define DEBUG_STATE 0x002
+#define DEBUG_IOCTL 0x004
+#define DEBUG_PRIMS 0x008
+#define DEBUG_VERTS 0x010
+#define DEBUG_FALLBACKS 0x020
+#define DEBUG_VFMT 0x040
+#define DEBUG_CODEGEN 0x080
+#define DEBUG_VERBOSE 0x100
+#define DEBUG_DRI 0x200
+#define DEBUG_DMA 0x400
+#define DEBUG_SANITY 0x800
+#define DEBUG_SYNC 0x1000
+#define DEBUG_PIXEL 0x2000
+#define DEBUG_MEMORY 0x4000
+
+#endif
+#endif /* __R200_CONTEXT_H__ */
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_ioctl.c b/xc/lib/GL/mesa/src/drv/r200/r200_ioctl.c
new file mode 100644
index 000000000..58f17c27f
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_ioctl.c
@@ -0,0 +1,931 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "macros.h"
+#include "context.h"
+#include "swrast/swrast.h"
+
+#include "r200_context.h"
+#include "r200_state.h"
+#include "r200_ioctl.h"
+#include "r200_tcl.h"
+#include "r200_sanity.h"
+#include "radeon_reg.h"
+
+#include <unistd.h> /* for usleep() */
+
+
+#define R200_TIMEOUT 512
+#define R200_IDLE_RETRY 16
+
+
+static void do_usleep( int nr, const char *caller )
+{
+ if (1) fprintf(stderr, "usleep %d in %s\n", nr, caller );
+ if (1) usleep( nr );
+}
+
+static void r200WaitForIdle( r200ContextPtr rmesa );
+
+
+int r200FlushCmdBufLocked( r200ContextPtr rmesa, const char * caller )
+{
+ int ret, i;
+ drmRadeonCmdBuffer cmd;
+
+ if (R200_DEBUG & DEBUG_IOCTL) {
+ fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
+
+ if (0 & R200_DEBUG & DEBUG_VERBOSE)
+ for (i = 0 ; i < rmesa->store.cmd_used ; i += 4 )
+ fprintf(stderr, "%d: %x\n", i/4,
+ *(int *)(&rmesa->store.cmd_buf[i]));
+ }
+
+ if (R200_DEBUG & DEBUG_DMA)
+ fprintf(stderr, "%s: Releasing %d buffers\n", __FUNCTION__,
+ rmesa->dma.nr_released_bufs);
+
+
+ if (R200_DEBUG & DEBUG_SANITY) {
+ if (rmesa->state.scissor.enabled)
+ ret = r200SanityCmdBuffer( rmesa,
+ rmesa->state.scissor.numClipRects,
+ rmesa->state.scissor.pClipRects);
+ else
+ ret = r200SanityCmdBuffer( rmesa,
+ rmesa->numClipRects,
+ rmesa->pClipRects);
+ if (ret) {
+ fprintf(stderr, "drmSanityCommandWrite: %d\n", ret);
+ goto out;
+ }
+ }
+
+
+ if (R200_DEBUG & DEBUG_MEMORY) {
+ if (!r200ValidateTexObjs( rmesa )) {
+ fprintf(stderr, " -- tex memory is inconsistent - expect mangled textures\n");
+ }
+ }
+
+
+ cmd.bufsz = rmesa->store.cmd_used;
+ cmd.buf = rmesa->store.cmd_buf;
+
+ if (rmesa->state.scissor.enabled) {
+ cmd.nbox = rmesa->state.scissor.numClipRects;
+ cmd.boxes = (drmClipRect *)rmesa->state.scissor.pClipRects;
+ } else {
+ cmd.nbox = rmesa->numClipRects;
+ cmd.boxes = (drmClipRect *)rmesa->pClipRects;
+ }
+
+ ret = drmCommandWrite( rmesa->dri.fd,
+ DRM_RADEON_CMDBUF,
+ &cmd, sizeof(cmd) );
+
+ if (ret)
+ fprintf(stderr, "drmCommandWrite: %d\n", ret);
+
+ if (R200_DEBUG & DEBUG_SYNC) {
+ fprintf(stderr, "\nSyncing in %s\n\n", __FUNCTION__);
+ r200WaitForIdleLocked( rmesa );
+ }
+
+
+ out:
+ rmesa->store.primnr = 0;
+ rmesa->store.statenr = 0;
+ rmesa->store.cmd_used = 0;
+ rmesa->dma.nr_released_bufs = 0;
+/* rmesa->lost_context = 0; */
+ rmesa->lost_context = 1;
+ return ret;
+}
+
+
+/* Note: does not emit any commands to avoid recursion on
+ * r200AllocCmdBuf.
+ */
+void r200FlushCmdBuf( r200ContextPtr rmesa, const char *caller )
+{
+ int ret;
+
+ LOCK_HARDWARE( rmesa );
+
+ ret = r200FlushCmdBufLocked( rmesa, caller );
+
+ UNLOCK_HARDWARE( rmesa );
+
+ if (ret) {
+ fprintf(stderr, "drmRadeonCmdBuffer: %d (exiting)\n", ret);
+ exit(ret);
+ }
+}
+
+
+/* =============================================================
+ * Hardware vertex buffer handling
+ */
+
+
+void r200RefillCurrentDmaRegion( r200ContextPtr rmesa )
+{
+ struct r200_dma_buffer *dmabuf;
+ int fd = rmesa->dri.fd;
+ int index = 0;
+ int size = 0;
+ drmDMAReq dma;
+ int ret;
+
+ if (R200_DEBUG & (DEBUG_IOCTL|DEBUG_DMA))
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ if (rmesa->dma.flush) {
+ rmesa->dma.flush( rmesa );
+ }
+
+ if (rmesa->dma.current.buf)
+ r200ReleaseDmaRegion( rmesa, &rmesa->dma.current, __FUNCTION__ );
+
+ if (rmesa->dma.nr_released_bufs > 4)
+ r200FlushCmdBuf( rmesa, __FUNCTION__ );
+
+ dma.context = rmesa->dri.hwContext;
+ dma.send_count = 0;
+ dma.send_list = NULL;
+ dma.send_sizes = NULL;
+ dma.flags = 0;
+ dma.request_count = 1;
+ dma.request_size = RADEON_BUFFER_SIZE;
+ dma.request_list = &index;
+ dma.request_sizes = &size;
+ dma.granted_count = 0;
+
+ LOCK_HARDWARE(rmesa); /* no need to validate */
+
+ while (1) {
+ ret = drmDMA( fd, &dma );
+ if (ret == 0)
+ break;
+
+ if (rmesa->dma.nr_released_bufs) {
+ r200FlushCmdBufLocked( rmesa, __FUNCTION__ );
+ }
+
+ if (rmesa->do_usleeps) {
+ UNLOCK_HARDWARE( rmesa );
+ do_usleep(1, __FUNCTION__);
+ LOCK_HARDWARE( rmesa );
+ }
+ }
+
+ UNLOCK_HARDWARE(rmesa);
+
+ if (R200_DEBUG & DEBUG_DMA)
+ fprintf(stderr, "Allocated buffer %d\n", index);
+
+ dmabuf = CALLOC_STRUCT( r200_dma_buffer );
+ dmabuf->buf = &rmesa->r200Screen->buffers->list[index];
+ dmabuf->refcount = 1;
+
+ rmesa->dma.current.buf = dmabuf;
+ rmesa->dma.current.address = dmabuf->buf->address;
+ rmesa->dma.current.end = dmabuf->buf->total;
+ rmesa->dma.current.start = 0;
+ rmesa->dma.current.ptr = 0;
+}
+
+void r200ReleaseDmaRegion( r200ContextPtr rmesa,
+ struct r200_dma_region *region,
+ const char *caller )
+{
+ if (R200_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
+
+ if (!region->buf)
+ return;
+
+ if (rmesa->dma.flush)
+ rmesa->dma.flush( rmesa );
+
+ if (--region->buf->refcount == 0) {
+ drmRadeonCmdHeader *cmd;
+
+ if (R200_DEBUG & (DEBUG_IOCTL|DEBUG_DMA))
+ fprintf(stderr, "%s -- DISCARD BUF %d\n", __FUNCTION__,
+ region->buf->buf->idx);
+
+ cmd = (drmRadeonCmdHeader *)r200AllocCmdBuf( rmesa, sizeof(*cmd),
+ __FUNCTION__ );
+ cmd->dma.cmd_type = RADEON_CMD_DMA_DISCARD;
+ cmd->dma.buf_idx = region->buf->buf->idx;
+ FREE(region->buf);
+ rmesa->dma.nr_released_bufs++;
+ }
+
+ region->buf = 0;
+ region->start = 0;
+}
+
+/* Allocates a region from rmesa->dma.current. If there isn't enough
+ * space in current, grab a new buffer (and discard what was left of current)
+ */
+void r200AllocDmaRegion( r200ContextPtr rmesa,
+ struct r200_dma_region *region,
+ int bytes,
+ int alignment )
+{
+ if (R200_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s %d\n", __FUNCTION__, bytes);
+
+ if (rmesa->dma.flush)
+ rmesa->dma.flush( rmesa );
+
+ if (region->buf)
+ r200ReleaseDmaRegion( rmesa, region, __FUNCTION__ );
+
+ alignment--;
+ rmesa->dma.current.start = rmesa->dma.current.ptr =
+ (rmesa->dma.current.ptr + alignment) & ~alignment;
+
+ if ( rmesa->dma.current.ptr + bytes > rmesa->dma.current.end )
+ r200RefillCurrentDmaRegion( rmesa );
+
+ region->start = rmesa->dma.current.start;
+ region->ptr = rmesa->dma.current.start;
+ region->end = rmesa->dma.current.start + bytes;
+ region->address = rmesa->dma.current.address;
+ region->buf = rmesa->dma.current.buf;
+ region->buf->refcount++;
+
+ rmesa->dma.current.ptr += bytes; /* bug - if alignment > 7 */
+ rmesa->dma.current.start =
+ rmesa->dma.current.ptr = (rmesa->dma.current.ptr + 0x7) & ~0x7;
+}
+
+void r200AllocDmaRegionVerts( r200ContextPtr rmesa,
+ struct r200_dma_region *region,
+ int numverts,
+ int vertsize,
+ int alignment )
+{
+ r200AllocDmaRegion( rmesa, region, vertsize * numverts, alignment );
+}
+
+/* ================================================================
+ * SwapBuffers with client-side throttling
+ */
+
+static CARD32 r200GetLastFrame(r200ContextPtr rmesa)
+{
+ drmRadeonGetParam gp;
+ int ret;
+ CARD32 frame;
+
+ gp.param = RADEON_PARAM_LAST_FRAME;
+ gp.value = (int *)&frame;
+ ret = drmCommandWriteRead( rmesa->dri.fd, DRM_RADEON_GETPARAM,
+ &gp, sizeof(gp) );
+ if ( ret ) {
+ fprintf( stderr, "%s: drmRadeonGetParam: %d\n", __FUNCTION__, ret );
+ exit(1);
+ }
+
+ return frame;
+}
+
+static void r200EmitIrqLocked( r200ContextPtr rmesa )
+{
+ drmRadeonIrqEmit ie;
+ int ret;
+
+ ie.irq_seq = &rmesa->iw.irq_seq;
+ ret = drmCommandWriteRead( rmesa->dri.fd, DRM_RADEON_IRQ_EMIT,
+ &ie, sizeof(ie) );
+ if ( ret ) {
+ fprintf( stderr, "%s: drmRadeonIrqEmit: %d\n", __FUNCTION__, ret );
+ exit(1);
+ }
+}
+
+
+static void r200WaitIrq( r200ContextPtr rmesa )
+{
+ int ret;
+
+ do {
+ ret = drmCommandWrite( rmesa->dri.fd, DRM_RADEON_IRQ_WAIT,
+ &rmesa->iw, sizeof(rmesa->iw) );
+ } while (ret && (errno == EINTR || errno == EAGAIN));
+
+ if ( ret ) {
+ fprintf( stderr, "%s: drmRadeonIrqWait: %d\n", __FUNCTION__, ret );
+ exit(1);
+ }
+}
+
+
+static void r200WaitForFrameCompletion( r200ContextPtr rmesa )
+{
+ RADEONSAREAPrivPtr sarea = rmesa->sarea;
+
+ if (rmesa->do_irqs) {
+ if (r200GetLastFrame(rmesa) < sarea->last_frame) {
+ if (!rmesa->irqsEmitted) {
+ while (r200GetLastFrame (rmesa) < sarea->last_frame)
+ ;
+ }
+ else {
+ UNLOCK_HARDWARE( rmesa );
+ r200WaitIrq( rmesa );
+ LOCK_HARDWARE( rmesa );
+ }
+ rmesa->irqsEmitted = 10;
+ }
+
+ if (rmesa->irqsEmitted) {
+ r200EmitIrqLocked( rmesa );
+ rmesa->irqsEmitted--;
+ }
+ }
+ else {
+ while (r200GetLastFrame (rmesa) < sarea->last_frame) {
+ UNLOCK_HARDWARE( rmesa );
+ if (rmesa->do_usleeps)
+ do_usleep(1, __FUNCTION__);
+ LOCK_HARDWARE( rmesa );
+ }
+ }
+}
+
+
+
+/* Copy the back color buffer to the front color buffer.
+ */
+void r200CopyBuffer( const __DRIdrawablePrivate *dPriv )
+{
+ r200ContextPtr rmesa;
+ GLint nbox, i, ret;
+
+ assert(dPriv);
+ assert(dPriv->driContextPriv);
+ assert(dPriv->driContextPriv->driverPrivate);
+
+ rmesa = (r200ContextPtr) dPriv->driContextPriv->driverPrivate;
+
+ if ( R200_DEBUG & DEBUG_IOCTL ) {
+ fprintf( stderr, "\n%s( %p )\n\n", __FUNCTION__, rmesa->glCtx );
+ }
+
+ R200_FIREVERTICES( rmesa );
+
+ LOCK_HARDWARE( rmesa );
+
+
+ /* Throttle the frame rate -- only allow one pending swap buffers
+ * request at a time.
+ */
+ r200WaitForFrameCompletion( rmesa );
+
+ r200WaitForVBlank( rmesa );
+
+ nbox = rmesa->dri.drawable->numClipRects; /* must be in locked region */
+
+ for ( i = 0 ; i < nbox ; ) {
+ GLint nr = MIN2( i + RADEON_NR_SAREA_CLIPRECTS , nbox );
+ XF86DRIClipRectPtr box = rmesa->dri.drawable->pClipRects;
+ XF86DRIClipRectPtr b = rmesa->sarea->boxes;
+ GLint n = 0;
+
+ for ( ; i < nr ; i++ ) {
+ *b++ = box[i];
+ n++;
+ }
+ rmesa->sarea->nbox = n;
+
+ ret = drmCommandNone( rmesa->dri.fd, DRM_RADEON_SWAP );
+
+ if ( ret ) {
+ fprintf( stderr, "DRM_R200_SWAP_BUFFERS: return = %d\n", ret );
+ UNLOCK_HARDWARE( rmesa );
+ exit( 1 );
+ }
+ }
+
+ UNLOCK_HARDWARE( rmesa );
+ rmesa->lost_context = 1;
+}
+
+void r200PageFlip( const __DRIdrawablePrivate *dPriv )
+{
+ r200ContextPtr rmesa;
+ GLint ret;
+
+ assert(dPriv);
+ assert(dPriv->driContextPriv);
+ assert(dPriv->driContextPriv->driverPrivate);
+
+ rmesa = (r200ContextPtr) dPriv->driContextPriv->driverPrivate;
+
+ if ( R200_DEBUG & DEBUG_IOCTL ) {
+ fprintf(stderr, "%s: pfCurrentPage: %d\n", __FUNCTION__,
+ rmesa->sarea->pfCurrentPage);
+ }
+
+ R200_FIREVERTICES( rmesa );
+ LOCK_HARDWARE( rmesa );
+
+ if (!rmesa->dri.drawable->numClipRects) {
+ UNLOCK_HARDWARE( rmesa );
+ usleep( 10000 ); /* throttle invisible client 10ms */
+ return;
+ }
+
+ /* Need to do this for the perf box placement:
+ */
+ {
+ XF86DRIClipRectPtr box = rmesa->dri.drawable->pClipRects;
+ XF86DRIClipRectPtr b = rmesa->sarea->boxes;
+ b[0] = box[0];
+ rmesa->sarea->nbox = 1;
+ }
+
+ /* Throttle the frame rate -- only allow a few pending swap buffers
+ * request at a time.
+ */
+ r200WaitForFrameCompletion( rmesa );
+
+ r200WaitForVBlank( rmesa );
+
+ ret = drmCommandNone( rmesa->dri.fd, DRM_RADEON_FLIP );
+
+ UNLOCK_HARDWARE( rmesa );
+
+ if ( ret ) {
+ fprintf( stderr, "DRM_R200_FLIP: return = %d\n", ret );
+ exit( 1 );
+ }
+
+ if ( rmesa->sarea->pfCurrentPage == 1 ) {
+ rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset;
+ rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch;
+ } else {
+ rmesa->state.color.drawOffset = rmesa->r200Screen->backOffset;
+ rmesa->state.color.drawPitch = rmesa->r200Screen->backPitch;
+ }
+
+ R200_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset;
+ rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch;
+}
+
+
+/* ================================================================
+ * Buffer clear
+ */
+static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
+ GLint cx, GLint cy, GLint cw, GLint ch )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
+ GLuint flags = 0;
+ GLuint color_mask = 0;
+ GLint ret, i;
+
+ if ( R200_DEBUG & DEBUG_IOCTL ) {
+ fprintf( stderr, "%s: all=%d cx=%d cy=%d cw=%d ch=%d\n",
+ __FUNCTION__, all, cx, cy, cw, ch );
+ }
+
+ {
+ LOCK_HARDWARE( rmesa );
+ UNLOCK_HARDWARE( rmesa );
+ if ( dPriv->numClipRects == 0 )
+ return;
+ }
+
+ r200EmitState( rmesa );
+
+ /* Need to cope with lostcontext here as kernel relies on
+ * some residual state:
+ */
+ R200_FIREVERTICES( rmesa );
+
+ if ( mask & DD_FRONT_LEFT_BIT ) {
+ flags |= RADEON_FRONT;
+ color_mask = rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK];
+ mask &= ~DD_FRONT_LEFT_BIT;
+ }
+
+ if ( mask & DD_BACK_LEFT_BIT ) {
+ flags |= RADEON_BACK;
+ color_mask = rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK];
+ mask &= ~DD_BACK_LEFT_BIT;
+ }
+
+ if ( mask & DD_DEPTH_BIT ) {
+ if ( ctx->Depth.Mask ) flags |= RADEON_DEPTH; /* FIXME: ??? */
+ mask &= ~DD_DEPTH_BIT;
+ }
+
+ if ( (mask & DD_STENCIL_BIT) && rmesa->state.stencil.hwBuffer ) {
+ flags |= RADEON_STENCIL;
+ mask &= ~DD_STENCIL_BIT;
+ }
+
+ if ( mask )
+ _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+
+ if ( !flags )
+ return;
+
+ /* 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 ) {
+ drmRadeonGetParam gp;
+ int ret;
+ int clear;
+
+ gp.param = RADEON_PARAM_LAST_CLEAR;
+ gp.value = (int *)&clear;
+ ret = drmCommandWriteRead( rmesa->dri.fd,
+ DRM_RADEON_GETPARAM, &gp, sizeof(gp) );
+
+ if ( ret ) {
+ fprintf( stderr, "%s: drmRadeonGetParam: %d\n", __FUNCTION__, ret );
+ exit(1);
+ }
+
+ /* Clear throttling needs more thought.
+ */
+ if ( rmesa->sarea->last_clear - clear <= 25 ) {
+ break;
+ }
+
+ if (rmesa->do_usleeps) {
+ UNLOCK_HARDWARE( rmesa );
+ do_usleep(1, __FUNCTION__);
+ LOCK_HARDWARE( rmesa );
+ }
+ }
+
+
+ for ( i = 0 ; i < dPriv->numClipRects ; ) {
+ GLint nr = MIN2( i + RADEON_NR_SAREA_CLIPRECTS, dPriv->numClipRects );
+ XF86DRIClipRectPtr box = dPriv->pClipRects;
+ XF86DRIClipRectPtr b = rmesa->sarea->boxes;
+ drmRadeonClearType clear;
+ drmRadeonClearRect depth_boxes[RADEON_NR_SAREA_CLIPRECTS];
+ GLint n = 0;
+
+ if ( !all ) {
+ for ( ; i < nr ; i++ ) {
+ GLint x = box[i].x1;
+ GLint y = box[i].y1;
+ GLint w = box[i].x2 - x;
+ GLint h = box[i].y2 - y;
+
+ if ( x < cx ) w -= cx - x, x = cx;
+ if ( y < cy ) h -= cy - y, y = cy;
+ if ( x + w > cx + cw ) w = cx + cw - x;
+ if ( y + h > cy + ch ) h = cy + ch - y;
+ if ( w <= 0 ) continue;
+ if ( h <= 0 ) continue;
+
+ b->x1 = x;
+ b->y1 = y;
+ b->x2 = x + w;
+ b->y2 = y + h;
+ b++;
+ n++;
+ }
+ } else {
+ for ( ; i < nr ; i++ ) {
+ *b++ = box[i];
+ n++;
+ }
+ }
+
+ rmesa->sarea->nbox = n;
+
+ clear.flags = flags;
+ clear.clear_color = rmesa->state.color.clear;
+ clear.clear_depth = 0; /* not used */
+ clear.color_mask = rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK];
+ clear.depth_mask = rmesa->state.stencil.clear;
+ clear.depth_boxes = depth_boxes;
+
+ n--;
+ b = rmesa->sarea->boxes;
+ for ( ; n >= 0 ; n-- ) {
+ depth_boxes[n].f[RADEON_CLEAR_X1] = (float)b[n].x1;
+ depth_boxes[n].f[RADEON_CLEAR_Y1] = (float)b[n].y1;
+ depth_boxes[n].f[RADEON_CLEAR_X2] = (float)b[n].x2;
+ depth_boxes[n].f[RADEON_CLEAR_Y2] = (float)b[n].y2;
+ depth_boxes[n].f[RADEON_CLEAR_DEPTH] = ctx->Depth.Clear;
+ }
+
+ ret = drmCommandWrite( rmesa->dri.fd, DRM_RADEON_CLEAR,
+ &clear, sizeof(drmRadeonClearType));
+
+
+ if ( ret ) {
+ UNLOCK_HARDWARE( rmesa );
+ fprintf( stderr, "DRM_RADEON_CLEAR: return = %d\n", ret );
+ exit( 1 );
+ }
+ }
+
+ UNLOCK_HARDWARE( rmesa );
+ rmesa->lost_context = 1;
+}
+
+
+void r200WaitForIdleLocked( r200ContextPtr rmesa )
+{
+ int ret;
+ int i = 0;
+
+ do {
+ ret = drmCommandNone( rmesa->dri.fd, DRM_RADEON_CP_IDLE);
+ if (ret)
+ do_usleep( 1, __FUNCTION__ );
+ } while (ret && ++i < 100);
+
+ if ( ret < 0 ) {
+ UNLOCK_HARDWARE( rmesa );
+ fprintf( stderr, "Error: R200 timed out... exiting\n" );
+ exit( -1 );
+ }
+}
+
+static void r200WaitForIdle( r200ContextPtr rmesa )
+{
+ LOCK_HARDWARE(rmesa);
+ r200WaitForIdleLocked( rmesa );
+ UNLOCK_HARDWARE(rmesa);
+}
+
+
+void r200WaitForVBlank( r200ContextPtr rmesa )
+{
+ drmVBlank vbl;
+ int ret;
+
+ if ( !rmesa->r200Screen->irq )
+ return;
+
+ if ( getenv("LIBGL_SYNC_REFRESH") ) {
+ /* Wait for until the next vertical blank */
+ vbl.request.type = DRM_VBLANK_RELATIVE;
+ vbl.request.sequence = 1;
+ } else if ( getenv("LIBGL_THROTTLE_REFRESH") ) {
+ /* Wait for at least one vertical blank since the last call */
+ vbl.request.type = DRM_VBLANK_ABSOLUTE;
+ vbl.request.sequence = rmesa->vbl_seq + 1;
+ } else {
+ return;
+ }
+
+ UNLOCK_HARDWARE( rmesa );
+
+ if ((ret = drmWaitVBlank( rmesa->dri.fd, &vbl ))) {
+ fprintf(stderr, "%s: drmWaitVBlank returned %d, IRQs don't seem to be"
+ " working correctly.\nTry running with LIBGL_THROTTLE_REFRESH"
+ " and LIBL_SYNC_REFRESH unset.\n", __FUNCTION__, ret);
+ exit(1);
+ } else if (R200_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s: drmWaitVBlank returned %d\n", __FUNCTION__, ret);
+
+ rmesa->vbl_seq = vbl.reply.sequence;
+
+ LOCK_HARDWARE( rmesa );
+}
+
+void r200Flush( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+
+ if (R200_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ if (rmesa->dma.flush)
+ rmesa->dma.flush( rmesa );
+
+ if (!is_empty_list(&rmesa->hw.dirty))
+ r200EmitState( rmesa );
+
+ if (rmesa->store.cmd_used)
+ r200FlushCmdBuf( rmesa, __FUNCTION__ );
+}
+
+/* Make sure all commands have been sent to the hardware and have
+ * completed processing.
+ */
+void r200Finish( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ r200Flush( ctx );
+
+ if (rmesa->do_irqs) {
+ LOCK_HARDWARE( rmesa );
+ r200EmitIrqLocked( rmesa );
+ UNLOCK_HARDWARE( rmesa );
+ r200WaitIrq( rmesa );
+ }
+ else
+ r200WaitForIdle( rmesa );
+}
+
+
+/* This version of AllocateMemoryNV allocates only agp memory, and
+ * only does so after the point at which the driver has been
+ * initialized.
+ *
+ * Theoretically a valid context isn't required. However, in this
+ * implementation, it is, as I'm using the hardware lock to protect
+ * the kernel data structures, and the current context to get the
+ * device fd.
+ */
+void *r200AllocateMemoryNV(GLsizei size, GLfloat readfreq,
+ GLfloat writefreq, GLfloat priority)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ r200ContextPtr rmesa;
+ int region_offset;
+ drmRadeonMemAlloc alloc;
+ int ret;
+
+ if (R200_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s sz %d %f/%f/%f\n", __FUNCTION__, size, readfreq,
+ writefreq, priority);
+
+ if (!ctx || !(rmesa = R200_CONTEXT(ctx)) || rmesa->r200Screen->IsPCI )
+ return NULL;
+
+ if (getenv("R200_NO_ALLOC"))
+ return NULL;
+
+ if (rmesa->dri.drmMinor < 6)
+ return NULL;
+
+ alloc.region = RADEON_MEM_REGION_AGP;
+ alloc.alignment = 0;
+ alloc.size = size;
+ alloc.region_offset = &region_offset;
+
+ ret = drmCommandWriteRead( rmesa->r200Screen->driScreen->fd,
+ DRM_RADEON_ALLOC,
+ &alloc, sizeof(alloc));
+
+ if (ret) {
+ fprintf(stderr, "%s: DRM_RADEON_ALLOC ret %d\n", __FUNCTION__, ret);
+ return NULL;
+ }
+
+ {
+ char *region_start = (char *)rmesa->r200Screen->agpTextures.map;
+ return (void *)(region_start + region_offset);
+ }
+}
+
+
+/* Called via glXFreeMemoryNV() */
+void r200FreeMemoryNV(GLvoid *pointer)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ r200ContextPtr rmesa;
+ int region_offset;
+ drmRadeonMemFree memfree;
+ int ret;
+
+ if (R200_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s %p\n", __FUNCTION__, pointer);
+
+ if (!ctx || !(rmesa = R200_CONTEXT(ctx)) || rmesa->r200Screen->IsPCI ) {
+ fprintf(stderr, "%s: no context\n", __FUNCTION__);
+ return;
+ }
+
+ if (rmesa->dri.drmMinor < 6)
+ return;
+
+ region_offset = (char *)pointer - (char *)rmesa->r200Screen->agpTextures.map;
+
+ if (region_offset < 0 ||
+ region_offset > rmesa->r200Screen->agpTextures.size) {
+ fprintf(stderr, "offset %d outside range 0..%d\n", region_offset,
+ rmesa->r200Screen->agpTextures.size);
+ return;
+ }
+
+ memfree.region = RADEON_MEM_REGION_AGP;
+ memfree.region_offset = region_offset;
+
+ ret = drmCommandWrite( rmesa->r200Screen->driScreen->fd,
+ DRM_RADEON_FREE,
+ &memfree, sizeof(memfree));
+
+ if (ret)
+ fprintf(stderr, "%s: DRM_RADEON_FREE ret %d\n", __FUNCTION__, ret);
+}
+
+/* Called via glXGetAGPOffsetMESA() */
+GLuint r200GetAGPOffset(const GLvoid *pointer)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ r200ContextPtr rmesa;
+ GLuint card_offset;
+
+ if (!ctx || !(rmesa = R200_CONTEXT(ctx)) ) {
+ fprintf(stderr, "%s: no context\n", __FUNCTION__);
+ return ~0;
+ }
+
+ if (!r200IsAgpMemory( rmesa, pointer, 0 ))
+ return ~0;
+
+ if (rmesa->dri.drmMinor < 6)
+ return ~0;
+
+ card_offset = r200AgpOffsetFromVirtual( rmesa, pointer );
+
+ return card_offset - rmesa->r200Screen->agp_base;
+}
+
+
+GLboolean r200IsAgpMemory( r200ContextPtr rmesa, const GLvoid *pointer,
+ GLint size )
+{
+ int offset = (char *)pointer - (char *)rmesa->r200Screen->agpTextures.map;
+ int valid = (size >= 0 &&
+ offset >= 0 &&
+ offset + size < rmesa->r200Screen->agpTextures.size);
+
+ if (R200_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "r200IsAgpMemory( %p ) : %d\n", pointer, valid );
+
+ return valid;
+}
+
+
+GLuint r200AgpOffsetFromVirtual( r200ContextPtr rmesa, const GLvoid *pointer )
+{
+ int offset = (char *)pointer - (char *)rmesa->r200Screen->agpTextures.map;
+
+ if (offset < 0 || offset > rmesa->r200Screen->agpTextures.size)
+ return ~0;
+ else
+ return rmesa->r200Screen->agp_texture_offset + offset;
+}
+
+
+
+void r200InitIoctlFuncs( GLcontext *ctx )
+{
+ ctx->Driver.Clear = r200Clear;
+ ctx->Driver.Finish = r200Finish;
+ ctx->Driver.Flush = r200Flush;
+}
+
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_lock.c b/xc/lib/GL/mesa/src/drv/r200/r200_lock.c
new file mode 100644
index 000000000..22b8b3af2
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_lock.c
@@ -0,0 +1,118 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "r200_context.h"
+#include "r200_lock.h"
+#include "r200_tex.h"
+#include "r200_state.h"
+#include "r200_ioctl.h"
+
+#if DEBUG_LOCKING
+char *prevLockFile = NULL;
+int prevLockLine = 0;
+#endif
+
+/* Turn on/off page flipping according to the flags in the sarea:
+ */
+static void
+r200UpdatePageFlipping( r200ContextPtr rmesa )
+{
+ int use_back;
+ rmesa->doPageFlip = rmesa->sarea->pfAllowPageFlip;
+
+ use_back = (rmesa->glCtx->Color._DrawDestMask == BACK_LEFT_BIT);
+ use_back ^= (rmesa->sarea->pfCurrentPage == 1);
+
+ if (use_back) {
+ rmesa->state.color.drawOffset = rmesa->r200Screen->backOffset;
+ rmesa->state.color.drawPitch = rmesa->r200Screen->backPitch;
+ } else {
+ rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset;
+ rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch;
+ }
+
+ R200_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset;
+ rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch;
+}
+
+
+
+/* Update the hardware state. This is called if another context has
+ * grabbed the hardware lock, which includes the X server. This
+ * function also updates the driver's window state after the X server
+ * moves, resizes or restacks a window -- the change will be reflected
+ * in the drawable position and clip rects. Since the X server grabs
+ * the hardware lock when it changes the window state, this routine will
+ * automatically be called after such a change.
+ */
+void r200GetLock( r200ContextPtr rmesa, GLuint flags )
+{
+ __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
+ __DRIscreenPrivate *sPriv = rmesa->dri.screen;
+ RADEONSAREAPrivPtr sarea = rmesa->sarea;
+ int i;
+
+ drmGetLock( rmesa->dri.fd, rmesa->dri.hwContext, flags );
+
+ /* The window might have moved, so we might need to get new clip
+ * rects.
+ *
+ * NOTE: This releases and regrabs the hw lock to allow the X server
+ * to respond to the DRI protocol request for new drawable info.
+ * Since the hardware state depends on having the latest drawable
+ * clip rects, all state checking must be done _after_ this call.
+ */
+ DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
+
+ if ( rmesa->lastStamp != dPriv->lastStamp ) {
+ r200UpdatePageFlipping( rmesa );
+ if (rmesa->glCtx->Color._DrawDestMask == BACK_LEFT_BIT)
+ r200SetCliprects( rmesa, GL_BACK_LEFT );
+ else
+ r200SetCliprects( rmesa, GL_FRONT_LEFT );
+ r200UpdateViewportOffset( rmesa->glCtx );
+ rmesa->lastStamp = dPriv->lastStamp;
+ }
+
+ if ( sarea->ctxOwner != rmesa->dri.hwContext ) {
+ sarea->ctxOwner = rmesa->dri.hwContext;
+ }
+
+ for ( i = 0 ; i < rmesa->texture.numHeaps ; i++ ) {
+ if ( sarea->texAge[i] != rmesa->texture.age[i] ) {
+ r200AgeTextures( rmesa, i );
+ }
+ }
+}
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_maos_arrays.c b/xc/lib/GL/mesa/src/drv/r200/r200_maos_arrays.c
new file mode 100644
index 000000000..19ed677cb
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_maos_arrays.c
@@ -0,0 +1,479 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "mtypes.h"
+#include "colormac.h"
+#include "imports.h"
+#include "mmath.h"
+#include "macros.h"
+
+#include "swrast_setup/swrast_setup.h"
+#include "math/m_translate.h"
+#include "tnl/tnl.h"
+#include "tnl/t_context.h"
+#include "tnl/t_imm_debug.h"
+
+#include "r200_context.h"
+#include "r200_ioctl.h"
+#include "r200_state.h"
+#include "r200_swtcl.h"
+#include "r200_maos.h"
+
+/* Usage:
+ * - from r200_tcl_render
+ * - call r200EmitArrays to ensure uptodate arrays in dma
+ * - emit primitives (new type?) which reference the data
+ * -- need to use elts for lineloop, quads, quadstrip/flat
+ * -- other primitives are all well-formed (need tristrip-1,fake-poly)
+ *
+ */
+static void emit_ubyte_rgba3( GLcontext *ctx,
+ struct r200_dma_region *rvb,
+ char *data,
+ int stride,
+ int count )
+{
+ int i;
+ char *out = (char *)(rvb->start + rvb->address);
+
+ if (R200_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s count %d stride %d out %p\n",
+ __FUNCTION__, count, stride, out);
+
+ for (i = 0; i < count; i++) {
+ out[0] = *data;
+ out[1] = *(data+1);
+ out[2] = *(data+2);
+ out[3] = 0xFF;
+ out += 4;
+ data += stride;
+ }
+}
+
+
+#if defined(USE_X86_ASM)
+#define COPY_DWORDS( dst, src, nr ) \
+do { \
+ int __tmp; \
+ __asm__ __volatile__( "rep ; movsl" \
+ : "=%c" (__tmp), "=D" (dst), "=S" (__tmp) \
+ : "0" (nr), \
+ "D" ((long)dst), \
+ "S" ((long)src) ); \
+} while (0)
+#else
+#define COPY_DWORDS( dst, src, nr ) \
+do { \
+ int j; \
+ for ( j = 0 ; j < nr ; j++ ) \
+ dst[j] = ((int *)src)[j]; \
+ dst += nr; \
+} while (0)
+#endif
+
+
+
+static void emit_ubyte_rgba4( GLcontext *ctx,
+ struct r200_dma_region *rvb,
+ char *data,
+ int stride,
+ int count )
+{
+ int i;
+ int *out = (int *)(rvb->address + rvb->start);
+
+ if (R200_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s count %d stride %d\n",
+ __FUNCTION__, count, stride);
+
+ if (stride == 4)
+ COPY_DWORDS( out, data, count );
+ else
+ for (i = 0; i < count; i++) {
+ *out++ = *(int *)data;
+ data += stride;
+ }
+}
+
+
+static void emit_ubyte_rgba( GLcontext *ctx,
+ struct r200_dma_region *rvb,
+ char *data,
+ int size,
+ int stride,
+ int count )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if (R200_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s %d/%d\n", __FUNCTION__, count, size);
+
+ assert (!rvb->buf);
+
+ if (stride == 0) {
+ r200AllocDmaRegion( rmesa, rvb, 4, 4 );
+ count = 1;
+ rvb->aos_start = GET_START(rvb);
+ rvb->aos_stride = 0;
+ rvb->aos_size = 1;
+ }
+ else {
+ r200AllocDmaRegion( rmesa, rvb, 4 * count, 4 ); /* alignment? */
+ rvb->aos_start = GET_START(rvb);
+ rvb->aos_stride = 1;
+ rvb->aos_size = 1;
+ }
+
+ /* Emit the data
+ */
+ switch (size) {
+ case 3:
+ emit_ubyte_rgba3( ctx, rvb, data, stride, count );
+ break;
+ case 4:
+ emit_ubyte_rgba4( ctx, rvb, data, stride, count );
+ break;
+ default:
+ assert(0);
+ exit(1);
+ break;
+ }
+}
+
+
+
+
+static void emit_vec8( GLcontext *ctx,
+ struct r200_dma_region *rvb,
+ char *data,
+ int stride,
+ int count )
+{
+ int i;
+ int *out = (int *)(rvb->address + rvb->start);
+
+ if (R200_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s count %d stride %d\n",
+ __FUNCTION__, count, stride);
+
+ if (stride == 8)
+ COPY_DWORDS( out, data, count*2 );
+ else
+ for (i = 0; i < count; i++) {
+ out[0] = *(int *)data;
+ out[1] = *(int *)(data+4);
+ out += 2;
+ data += stride;
+ }
+}
+
+static void emit_vec12( GLcontext *ctx,
+ struct r200_dma_region *rvb,
+ char *data,
+ int stride,
+ int count )
+{
+ int i;
+ int *out = (int *)(rvb->address + rvb->start);
+
+ if (R200_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s count %d stride %d out %p data %p\n",
+ __FUNCTION__, count, stride, out, data);
+
+ if (stride == 12)
+ COPY_DWORDS( out, data, count*3 );
+ else
+ for (i = 0; i < count; i++) {
+ out[0] = *(int *)data;
+ out[1] = *(int *)(data+4);
+ out[2] = *(int *)(data+8);
+ out += 3;
+ data += stride;
+ }
+}
+
+static void emit_vec16( GLcontext *ctx,
+ struct r200_dma_region *rvb,
+ char *data,
+ int stride,
+ int count )
+{
+ int i;
+ int *out = (int *)(rvb->address + rvb->start);
+
+ if (R200_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s count %d stride %d\n",
+ __FUNCTION__, count, stride);
+
+ if (stride == 16)
+ COPY_DWORDS( out, data, count*4 );
+ else
+ for (i = 0; i < count; i++) {
+ out[0] = *(int *)data;
+ out[1] = *(int *)(data+4);
+ out[2] = *(int *)(data+8);
+ out[3] = *(int *)(data+12);
+ out += 4;
+ data += stride;
+ }
+}
+
+
+static void emit_vector( GLcontext *ctx,
+ struct r200_dma_region *rvb,
+ char *data,
+ int size,
+ int stride,
+ int count )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if (R200_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s count %d size %d stride %d\n",
+ __FUNCTION__, count, size, stride);
+
+ assert (!rvb->buf);
+
+ if (stride == 0) {
+ r200AllocDmaRegion( rmesa, rvb, size * 4, 4 );
+ count = 1;
+ rvb->aos_start = GET_START(rvb);
+ rvb->aos_stride = 0;
+ rvb->aos_size = size;
+ }
+ else {
+ r200AllocDmaRegion( rmesa, rvb, size * count * 4, 4 ); /* alignment? */
+ rvb->aos_start = GET_START(rvb);
+ rvb->aos_stride = size;
+ rvb->aos_size = size;
+ }
+
+ /* Emit the data
+ */
+ switch (size) {
+ case 2:
+ emit_vec8( ctx, rvb, data, stride, count );
+ break;
+ case 3:
+ emit_vec12( ctx, rvb, data, stride, count );
+ break;
+ case 4:
+ emit_vec16( ctx, rvb, data, stride, count );
+ break;
+ default:
+ assert(0);
+ exit(1);
+ break;
+ }
+
+}
+
+
+
+/* Emit any changed arrays to new agp memory, re-emit a packet to
+ * update the arrays.
+ */
+void r200EmitArrays( GLcontext *ctx, GLuint inputs )
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+ struct vertex_buffer *VB = &TNL_CONTEXT( ctx )->vb;
+ struct r200_dma_region **component = rmesa->tcl.aos_components;
+ GLuint nr = 0;
+ GLuint vfmt0 = 0, vfmt1 = 0;
+ GLuint count = VB->Count;
+
+ if (R200_DEBUG & DEBUG_VERTS)
+ _tnl_print_vert_flags( __FUNCTION__, inputs );
+
+ if (1) {
+ if (!rmesa->tcl.obj.buf)
+ emit_vector( ctx,
+ &rmesa->tcl.obj,
+ (char *)VB->ObjPtr->data,
+ VB->ObjPtr->size,
+ VB->ObjPtr->stride,
+ count);
+
+ switch( VB->ObjPtr->size ) {
+ case 4: vfmt0 |= R200_VTX_W0;
+ case 3: vfmt0 |= R200_VTX_Z0;
+ case 2:
+ default:
+ break;
+ }
+ component[nr++] = &rmesa->tcl.obj;
+ }
+
+
+ if (inputs & VERT_BIT_NORMAL) {
+ if (!rmesa->tcl.norm.buf)
+ emit_vector( ctx,
+ &(rmesa->tcl.norm),
+ (char *)VB->NormalPtr->data,
+ 3,
+ VB->NormalPtr->stride,
+ count);
+
+ vfmt0 |= R200_VTX_N0;
+ component[nr++] = &rmesa->tcl.norm;
+ }
+
+ if (inputs & VERT_BIT_COLOR0) {
+ if (VB->ColorPtr[0]->Type == GL_UNSIGNED_BYTE) {
+ if (!rmesa->tcl.rgba.buf)
+ emit_ubyte_rgba( ctx,
+ &rmesa->tcl.rgba,
+ (char *)VB->ColorPtr[0]->Ptr,
+ VB->ColorPtr[0]->Size,
+ VB->ColorPtr[0]->StrideB,
+ count);
+
+ vfmt0 |= R200_VTX_PK_RGBA << R200_VTX_COLOR_0_SHIFT;
+ }
+ else {
+ int emitsize;
+
+ if (VB->ColorPtr[0]->Size == 4 &&
+ (VB->ColorPtr[0]->StrideB != 0 ||
+ ((GLfloat *)VB->ColorPtr[0]->Ptr)[3] != 1.0)) {
+ vfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT;
+ emitsize = 4;
+ }
+ else {
+ vfmt0 |= R200_VTX_FP_RGB << R200_VTX_COLOR_0_SHIFT;
+ emitsize = 3;
+ }
+
+ if (!rmesa->tcl.rgba.buf)
+ emit_vector( ctx,
+ &(rmesa->tcl.rgba),
+ (char *)VB->ColorPtr[0]->Ptr,
+ emitsize,
+ VB->ColorPtr[0]->StrideB,
+ count);
+ }
+
+ component[nr++] = &rmesa->tcl.rgba;
+ }
+
+
+ if (inputs & VERT_BIT_COLOR1) {
+ if (!rmesa->tcl.spec.buf) {
+ if (VB->SecondaryColorPtr[0]->Type != GL_UNSIGNED_BYTE)
+ r200_import_float_spec_colors( ctx );
+
+ emit_ubyte_rgba( ctx,
+ &rmesa->tcl.spec,
+ (char *)VB->SecondaryColorPtr[0]->Ptr,
+ 3,
+ VB->SecondaryColorPtr[0]->StrideB,
+ count);
+ }
+
+ /* How does this work?
+ */
+ vfmt0 |= R200_VTX_PK_RGBA << R200_VTX_COLOR_1_SHIFT;
+ component[nr++] = &rmesa->tcl.spec;
+ }
+
+/* vtx = (rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] & */
+/* ~(R200_TCL_VTX_Q0|R200_TCL_VTX_Q1)); */
+
+ if (inputs & VERT_BIT_TEX0) {
+ if (!rmesa->tcl.tex[0].buf)
+ emit_vector( ctx,
+ &(rmesa->tcl.tex[0]),
+ (char *)VB->TexCoordPtr[0]->data,
+ VB->TexCoordPtr[0]->size,
+ VB->TexCoordPtr[0]->stride,
+ count );
+
+ vfmt1 |= VB->TexCoordPtr[0]->size << R200_VTX_TEX0_COMP_CNT_SHIFT;
+ component[nr++] = &rmesa->tcl.tex[0];
+ }
+
+ if (inputs & VERT_BIT_TEX1) {
+ if (!rmesa->tcl.tex[1].buf)
+ emit_vector( ctx,
+ &(rmesa->tcl.tex[1]),
+ (char *)VB->TexCoordPtr[1]->data,
+ VB->TexCoordPtr[1]->size,
+ VB->TexCoordPtr[1]->stride,
+ count );
+
+ vfmt1 |= VB->TexCoordPtr[1]->size << R200_VTX_TEX1_COMP_CNT_SHIFT;
+ component[nr++] = &rmesa->tcl.tex[1];
+ }
+
+ if (vfmt0 != rmesa->hw.vtx.cmd[VTX_VTXFMT_0] ||
+ vfmt1 != rmesa->hw.vtx.cmd[VTX_VTXFMT_1]) {
+ R200_STATECHANGE( rmesa, vtx );
+ rmesa->hw.vtx.cmd[VTX_VTXFMT_0] = vfmt0;
+ rmesa->hw.vtx.cmd[VTX_VTXFMT_1] = vfmt1;
+ }
+
+
+/* fprintf(stderr, "VTXFMT_0: %x VTXFMT_1: %x\n", vfmt0, vfmt1); */
+
+ rmesa->tcl.nr_aos_components = nr;
+ rmesa->tcl.vertex_format = vfmt0;
+}
+
+
+void r200ReleaseArrays( GLcontext *ctx, GLuint newinputs )
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+
+ if (R200_DEBUG & DEBUG_VERTS)
+ _tnl_print_vert_flags( __FUNCTION__, newinputs );
+
+ if (newinputs & VERT_BIT_POS)
+ r200ReleaseDmaRegion( rmesa, &rmesa->tcl.obj, __FUNCTION__ );
+
+ if (newinputs & VERT_BIT_NORMAL)
+ r200ReleaseDmaRegion( rmesa, &rmesa->tcl.norm, __FUNCTION__ );
+
+ if (newinputs & VERT_BIT_COLOR0)
+ r200ReleaseDmaRegion( rmesa, &rmesa->tcl.rgba, __FUNCTION__ );
+
+ if (newinputs & VERT_BIT_COLOR1)
+ r200ReleaseDmaRegion( rmesa, &rmesa->tcl.spec, __FUNCTION__ );
+
+ if (newinputs & VERT_BIT_TEX0)
+ r200ReleaseDmaRegion( rmesa, &rmesa->tcl.tex[0], __FUNCTION__ );
+
+ if (newinputs & VERT_BIT_TEX1)
+ r200ReleaseDmaRegion( rmesa, &rmesa->tcl.tex[1], __FUNCTION__ );
+}
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_maos_vbtmp.h b/xc/lib/GL/mesa/src/drv/r200/r200_maos_vbtmp.h
new file mode 100644
index 000000000..a36be45b2
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_maos_vbtmp.h
@@ -0,0 +1,378 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#ifndef LOCALVARS
+#define LOCALVARS
+#endif
+
+#undef TCL_DEBUG
+#ifndef TCL_DEBUG
+#define TCL_DEBUG 0
+#endif
+
+static void TAG(emit)( GLcontext *ctx,
+ GLuint start, GLuint end,
+ void *dest )
+{
+ LOCALVARS
+ struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
+ GLuint (*tc0)[4], (*tc1)[4];
+ GLfloat *fog;
+ GLuint (*tc2)[4], (*norm)[3];
+ GLubyte (*col)[4], (*spec)[4];
+ GLuint tc0_stride, tc1_stride, col_stride, spec_stride, fog_stride;
+ GLuint tc2_stride, norm_stride;
+ GLuint (*coord)[4];
+ GLuint coord_stride;
+ GLubyte dummy[4];
+ int i;
+
+ union emit_union *v = (union emit_union *)dest;
+
+
+ if (R200_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ /* The vertex code expects Obj to be clean to element 3. To fix
+ * this, add more vertex code (for obj-2, obj-3) or preferably move
+ * to maos.
+ */
+ if (VB->ObjPtr->size < 3) {
+ if (VB->ObjPtr->flags & VEC_NOT_WRITEABLE) {
+ VB->import_data( ctx, VERT_OBJ, VEC_NOT_WRITEABLE );
+ }
+ _mesa_vector4f_clean_elem( VB->ObjPtr, VB->Count, 2 );
+ }
+
+ if (DO_W && VB->ObjPtr->size < 4) {
+ if (VB->ObjPtr->flags & VEC_NOT_WRITEABLE) {
+ VB->import_data( ctx, VERT_OBJ, VEC_NOT_WRITEABLE );
+ }
+ _mesa_vector4f_clean_elem( VB->ObjPtr, VB->Count, 3 );
+ }
+
+ coord = (GLuint (*)[4])VB->ObjPtr->data;
+ coord_stride = VB->ObjPtr->stride;
+
+ if (DO_TEX2) {
+ const GLuint t2 = GET_TEXSOURCE(2);
+ tc2 = (GLuint (*)[4])VB->TexCoordPtr[t2]->data;
+ tc2_stride = VB->TexCoordPtr[t2]->stride;
+ if (DO_PTEX && VB->TexCoordPtr[t2]->size < 4) {
+ if (VB->TexCoordPtr[t2]->flags & VEC_NOT_WRITEABLE) {
+ VB->import_data( ctx, VERT_TEX2, VEC_NOT_WRITEABLE );
+ }
+ _mesa_vector4f_clean_elem( VB->TexCoordPtr[t2], VB->Count, 3 );
+ }
+ }
+
+ if (DO_TEX1) {
+ if (VB->TexCoordPtr[1]) {
+ const GLuint t1 = GET_TEXSOURCE(1);
+ tc1 = (GLuint (*)[4])VB->TexCoordPtr[t1]->data;
+ tc1_stride = VB->TexCoordPtr[t1]->stride;
+ if (DO_PTEX && VB->TexCoordPtr[t1]->size < 4) {
+ if (VB->TexCoordPtr[t1]->flags & VEC_NOT_WRITEABLE) {
+ VB->import_data( ctx, VERT_TEX1, VEC_NOT_WRITEABLE );
+ }
+ _mesa_vector4f_clean_elem( VB->TexCoordPtr[t1], VB->Count, 3 );
+ }
+ } else {
+ tc1 = (GLuint (*)[4])&ctx->Current.Texcoord[1]; /* could be anything, really */
+ tc1_stride = 0;
+ }
+ }
+
+ if (DO_TEX0) {
+ if (VB->TexCoordPtr[0]) {
+ const GLuint t0 = GET_TEXSOURCE(0);
+ tc0_stride = VB->TexCoordPtr[t0]->stride;
+ tc0 = (GLuint (*)[4])VB->TexCoordPtr[t0]->data;
+ if (DO_PTEX && VB->TexCoordPtr[t0]->size < 4) {
+ if (VB->TexCoordPtr[t0]->flags & VEC_NOT_WRITEABLE) {
+ VB->import_data( ctx, VERT_TEX0, VEC_NOT_WRITEABLE );
+ }
+ _mesa_vector4f_clean_elem( VB->TexCoordPtr[t0], VB->Count, 3 );
+ }
+ } else {
+ tc0 = (GLuint (*)[4])&ctx->Current.Texcoord[0]; /* could be anything, really */
+ tc0_stride = 0;
+ }
+
+ }
+
+ if (DO_NORM) {
+ if (VB->NormalPtr) {
+ norm_stride = VB->NormalPtr->stride;
+ norm = (GLuint (*)[3])VB->NormalPtr->data;
+ } else {
+ norm_stride = 0;
+ norm = (GLuint (*)[3])&ctx->Current.Normal;
+ }
+ }
+
+ if (DO_RGBA) {
+ if (VB->ColorPtr[0]) {
+ /* This is incorrect when colormaterial is enabled:
+ */
+ if (VB->ColorPtr[0]->Type != GL_UNSIGNED_BYTE) {
+ if (0) fprintf(stderr, "IMPORTING FLOAT COLORS\n");
+ IMPORT_FLOAT_COLORS( ctx );
+ }
+ col = (GLubyte (*)[4])VB->ColorPtr[0]->Ptr;
+ col_stride = VB->ColorPtr[0]->StrideB;
+ } else {
+ col = &dummy; /* any old memory is fine */
+ col_stride = 0;
+ }
+
+ }
+
+ if (DO_SPEC) {
+ if (VB->SecondaryColorPtr[0]) {
+ if (VB->SecondaryColorPtr[0]->Type != GL_UNSIGNED_BYTE)
+ IMPORT_FLOAT_SPEC_COLORS( ctx );
+ spec = (GLubyte (*)[4])VB->SecondaryColorPtr[0]->Ptr;
+ spec_stride = VB->SecondaryColorPtr[0]->StrideB;
+ } else {
+ spec = &dummy;
+ spec_stride = 0;
+ }
+
+ }
+
+ if (DO_FOG) {
+ if (VB->FogCoordPtr) {
+ fog = VB->FogCoordPtr->data;
+ fog_stride = VB->FogCoordPtr->stride;
+ } else {
+ fog = (GLfloat *)&dummy; *fog = 0;
+ fog_stride = 0;
+ }
+
+ }
+
+
+ if (VB->importable_data) {
+ if (start) {
+ coord = (GLuint (*)[4])((GLubyte *)coord + start * coord_stride);
+ if (DO_TEX0)
+ tc0 = (GLuint (*)[4])((GLubyte *)tc0 + start * tc0_stride);
+ if (DO_TEX1)
+ tc1 = (GLuint (*)[4])((GLubyte *)tc1 + start * tc1_stride);
+ if (DO_TEX2)
+ tc2 = (GLuint (*)[4])((GLubyte *)tc2 + start * tc2_stride);
+ if (DO_NORM)
+ norm = (GLuint (*)[3])((GLubyte *)norm + start * norm_stride);
+ if (DO_RGBA)
+ STRIDE_4UB(col, start * col_stride);
+ if (DO_SPEC)
+ STRIDE_4UB(spec, start * spec_stride);
+ if (DO_FOG)
+ STRIDE_F(fog, start * fog_stride);
+ }
+
+ for (i=start; i < end; i++) {
+ v[0].ui = coord[0][0];
+ v[1].ui = coord[0][1];
+ v[2].ui = coord[0][2];
+ if (TCL_DEBUG) fprintf(stderr, "%d: %.2f %.2f %.2f ", i, v[0].f, v[1].f, v[2].f);
+ if (DO_W) {
+ v[3].ui = coord[0][3];
+ if (TCL_DEBUG) fprintf(stderr, "%.2f ", v[3].f);
+ v += 4;
+ }
+ else
+ v += 3;
+ coord = (GLuint (*)[4])((GLubyte *)coord + coord_stride);
+
+ if (DO_NORM) {
+ v[0].ui = norm[0][0];
+ v[1].ui = norm[0][1];
+ v[2].ui = norm[0][2];
+ if (TCL_DEBUG) fprintf(stderr, "norm: %.2f %.2f %.2f ", v[0].f, v[1].f, v[2].f);
+ v += 3;
+ norm = (GLuint (*)[3])((GLubyte *)norm + norm_stride);
+ }
+ if (DO_RGBA) {
+ v[0].ui = LE32_TO_CPU(*(GLuint *)&col[0]);
+ STRIDE_4UB(col, col_stride);
+ if (TCL_DEBUG) fprintf(stderr, "%x ", v[0].ui);
+ v++;
+ }
+ if (DO_SPEC || DO_FOG) {
+ if (DO_SPEC) {
+ v[0].ub[0] = spec[0][0];
+ v[0].ub[1] = spec[0][1];
+ v[0].ub[2] = spec[0][2];
+ STRIDE_4UB(spec, spec_stride);
+ }
+ if (DO_FOG) {
+ v[0].ub[3] = fog[0] * 255.0;
+ STRIDE_F(fog, fog_stride);
+ }
+ if (TCL_DEBUG) fprintf(stderr, "%x ", v[0].ui);
+ v++;
+ }
+ if (DO_TEX0) {
+ v[0].ui = tc0[0][0];
+ v[1].ui = tc0[0][1];
+ if (TCL_DEBUG) fprintf(stderr, "t0: %.2f %.2f ", v[0].f, v[1].f);
+ if (DO_PTEX) {
+ v[2].ui = tc0[0][3];
+ if (TCL_DEBUG) fprintf(stderr, "%.2f ", v[2].f);
+ v += 3;
+ }
+ else
+ v += 2;
+ tc0 = (GLuint (*)[4])((GLubyte *)tc0 + tc0_stride);
+ }
+ if (DO_TEX1) {
+ v[0].ui = tc1[0][0];
+ v[1].ui = tc1[0][1];
+ if (TCL_DEBUG) fprintf(stderr, "t1: %.2f %.2f ", v[0].f, v[1].f);
+ if (DO_PTEX) {
+ v[2].ui = tc1[0][3];
+ if (TCL_DEBUG) fprintf(stderr, "%.2f ", v[2].f);
+ v += 3;
+ }
+ else
+ v += 2;
+ tc1 = (GLuint (*)[4])((GLubyte *)tc1 + tc1_stride);
+ }
+ if (DO_TEX2) {
+ v[0].ui = tc2[0][0];
+ v[1].ui = tc2[0][1];
+ if (DO_PTEX) {
+ v[2].ui = tc2[0][3];
+ v += 3;
+ }
+ else
+ v += 2;
+ tc2 = (GLuint (*)[4])((GLubyte *)tc2 + tc2_stride);
+ }
+ if (TCL_DEBUG) fprintf(stderr, "\n");
+ }
+ } else {
+ for (i=start; i < end; i++) {
+ v[0].ui = coord[i][0];
+ v[1].ui = coord[i][1];
+ v[2].ui = coord[i][2];
+ if (DO_W) {
+ v[3].ui = coord[i][3];
+ v += 4;
+ }
+ else
+ v += 3;
+
+ if (DO_NORM) {
+ v[0].ui = norm[i][0];
+ v[1].ui = norm[i][1];
+ v[2].ui = norm[i][2];
+ v += 3;
+ }
+ if (DO_RGBA) {
+ v[0].ui = LE32_TO_CPU(*(GLuint *)&col[i]);
+ v++;
+ }
+ if (DO_SPEC || DO_FOG) {
+ if (DO_SPEC) {
+ v[0].ub[0] = spec[i][0];
+ v[0].ub[1] = spec[i][1];
+ v[0].ub[2] = spec[i][2];
+ }
+ if (DO_FOG) {
+ v[0].ub[3] = fog[i] * 255.0;
+ }
+ v++;
+ }
+ if (DO_TEX0) {
+ v[0].ui = tc0[i][0];
+ v[1].ui = tc0[i][1];
+ if (DO_PTEX) {
+ v[2].ui = tc0[i][3];
+ v += 3;
+ }
+ else
+ v += 2;
+ }
+ if (DO_TEX1) {
+ v[0].ui = tc1[i][0];
+ v[1].ui = tc1[i][1];
+ if (DO_PTEX) {
+ v[2].ui = tc1[i][3];
+ v += 3;
+ }
+ else
+ v += 2;
+ }
+ if (DO_TEX2) {
+ v[0].ui = tc2[i][0];
+ v[1].ui = tc2[i][1];
+ if (DO_PTEX) {
+ v[2].ui = tc2[i][3];
+ v += 3;
+ }
+ else
+ v += 2;
+ }
+ }
+ }
+}
+
+
+
+static void TAG(init)( void )
+{
+ int sz = 3;
+ if (DO_W) sz++;
+ if (DO_NORM) sz += 3;
+ if (DO_RGBA) sz++;
+ if (DO_SPEC || DO_FOG) sz++;
+ if (DO_TEX0) sz += 2;
+ if (DO_TEX0 && DO_PTEX) sz++;
+ if (DO_TEX1) sz += 2;
+ if (DO_TEX1 && DO_PTEX) sz++;
+ if (DO_TEX2) sz += 2;
+ if (DO_TEX2 && DO_PTEX) sz++;
+
+ setup_tab[IDX].emit = TAG(emit);
+ setup_tab[IDX].vertex_format = IND;
+ setup_tab[IDX].vertex_size = sz;
+}
+
+
+#undef IND
+#undef TAG
+#undef IDX
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_maos_verts.c b/xc/lib/GL/mesa/src/drv/r200/r200_maos_verts.c
new file mode 100644
index 000000000..cc1d10f4d
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_maos_verts.c
@@ -0,0 +1,338 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "mmath.h"
+#include "mtypes.h"
+#include "enums.h"
+#include "colormac.h"
+#include "light.h"
+
+#include "array_cache/acache.h"
+#include "tnl/tnl.h"
+#include "tnl/t_pipeline.h"
+#include "tnl/t_imm_debug.h"
+
+#include "r200_context.h"
+#include "r200_state.h"
+#include "r200_ioctl.h"
+#include "r200_tex.h"
+#include "r200_tcl.h"
+#include "r200_swtcl.h"
+#include "r200_maos.h"
+
+
+#define R200_TCL_MAX_SETUP 13
+
+union emit_union { float f; GLuint ui; GLubyte ub[4]; };
+
+static struct {
+ void (*emit)( GLcontext *, GLuint, GLuint, void * );
+ GLuint vertex_size;
+ GLuint vertex_format;
+} setup_tab[R200_TCL_MAX_SETUP];
+
+#define DO_W (IND & R200_CP_VC_FRMT_W0)
+#define DO_RGBA (IND & R200_CP_VC_FRMT_PKCOLOR)
+#define DO_SPEC (IND & R200_CP_VC_FRMT_PKSPEC)
+#define DO_FOG (IND & R200_CP_VC_FRMT_PKSPEC)
+#define DO_TEX0 (IND & R200_CP_VC_FRMT_ST0)
+#define DO_TEX1 (IND & R200_CP_VC_FRMT_ST1)
+#define DO_PTEX (IND & R200_CP_VC_FRMT_Q0)
+#define DO_NORM (IND & R200_CP_VC_FRMT_N0)
+
+#define DO_TEX2 0
+#define DO_TEX3 0
+
+#define GET_TEXSOURCE(n) n
+#define GET_UBYTE_COLOR_STORE() &R200_CONTEXT(ctx)->UbyteColor
+#define GET_UBYTE_SPEC_COLOR_STORE() &R200_CONTEXT(ctx)->UbyteSecondaryColor
+
+#define IMPORT_FLOAT_COLORS r200_import_float_colors
+#define IMPORT_FLOAT_SPEC_COLORS r200_import_float_spec_colors
+
+/***********************************************************************
+ * Generate vertex emit functions *
+ ***********************************************************************/
+
+
+/* Defined in order of increasing vertex size:
+ */
+#define IDX 0
+#define IND (R200_CP_VC_FRMT_XY| \
+ R200_CP_VC_FRMT_Z| \
+ R200_CP_VC_FRMT_PKCOLOR)
+#define TAG(x) x##_rgba
+#include "r200_maos_vbtmp.h"
+
+#define IDX 1
+#define IND (R200_CP_VC_FRMT_XY| \
+ R200_CP_VC_FRMT_Z| \
+ R200_CP_VC_FRMT_N0)
+#define TAG(x) x##_n
+#include "r200_maos_vbtmp.h"
+
+#define IDX 2
+#define IND (R200_CP_VC_FRMT_XY| \
+ R200_CP_VC_FRMT_Z| \
+ R200_CP_VC_FRMT_PKCOLOR| \
+ R200_CP_VC_FRMT_ST0)
+#define TAG(x) x##_rgba_st
+#include "r200_maos_vbtmp.h"
+
+#define IDX 3
+#define IND (R200_CP_VC_FRMT_XY| \
+ R200_CP_VC_FRMT_Z| \
+ R200_CP_VC_FRMT_PKCOLOR| \
+ R200_CP_VC_FRMT_N0)
+#define TAG(x) x##_rgba_n
+#include "r200_maos_vbtmp.h"
+
+#define IDX 4
+#define IND (R200_CP_VC_FRMT_XY| \
+ R200_CP_VC_FRMT_Z| \
+ R200_CP_VC_FRMT_ST0| \
+ R200_CP_VC_FRMT_N0)
+#define TAG(x) x##_st_n
+#include "r200_maos_vbtmp.h"
+
+#define IDX 5
+#define IND (R200_CP_VC_FRMT_XY| \
+ R200_CP_VC_FRMT_Z| \
+ R200_CP_VC_FRMT_PKCOLOR| \
+ R200_CP_VC_FRMT_ST0| \
+ R200_CP_VC_FRMT_ST1)
+#define TAG(x) x##_rgba_st_st
+#include "r200_maos_vbtmp.h"
+
+#define IDX 6
+#define IND (R200_CP_VC_FRMT_XY| \
+ R200_CP_VC_FRMT_Z| \
+ R200_CP_VC_FRMT_PKCOLOR| \
+ R200_CP_VC_FRMT_ST0| \
+ R200_CP_VC_FRMT_N0)
+#define TAG(x) x##_rgba_st_n
+#include "r200_maos_vbtmp.h"
+
+#define IDX 7
+#define IND (R200_CP_VC_FRMT_XY| \
+ R200_CP_VC_FRMT_Z| \
+ R200_CP_VC_FRMT_PKCOLOR| \
+ R200_CP_VC_FRMT_PKSPEC| \
+ R200_CP_VC_FRMT_ST0| \
+ R200_CP_VC_FRMT_ST1)
+#define TAG(x) x##_rgba_spec_st_st
+#include "r200_maos_vbtmp.h"
+
+#define IDX 8
+#define IND (R200_CP_VC_FRMT_XY| \
+ R200_CP_VC_FRMT_Z| \
+ R200_CP_VC_FRMT_ST0| \
+ R200_CP_VC_FRMT_ST1| \
+ R200_CP_VC_FRMT_N0)
+#define TAG(x) x##_st_st_n
+#include "r200_maos_vbtmp.h"
+
+#define IDX 9
+#define IND (R200_CP_VC_FRMT_XY| \
+ R200_CP_VC_FRMT_Z| \
+ R200_CP_VC_FRMT_PKCOLOR| \
+ R200_CP_VC_FRMT_PKSPEC| \
+ R200_CP_VC_FRMT_ST0| \
+ R200_CP_VC_FRMT_ST1| \
+ R200_CP_VC_FRMT_N0)
+#define TAG(x) x##_rgpa_spec_st_st_n
+#include "r200_maos_vbtmp.h"
+
+#define IDX 10
+#define IND (R200_CP_VC_FRMT_XY| \
+ R200_CP_VC_FRMT_Z| \
+ R200_CP_VC_FRMT_PKCOLOR| \
+ R200_CP_VC_FRMT_ST0| \
+ R200_CP_VC_FRMT_Q0)
+#define TAG(x) x##_rgba_stq
+#include "r200_maos_vbtmp.h"
+
+#define IDX 11
+#define IND (R200_CP_VC_FRMT_XY| \
+ R200_CP_VC_FRMT_Z| \
+ R200_CP_VC_FRMT_PKCOLOR| \
+ R200_CP_VC_FRMT_ST1| \
+ R200_CP_VC_FRMT_Q1| \
+ R200_CP_VC_FRMT_ST0| \
+ R200_CP_VC_FRMT_Q0)
+#define TAG(x) x##_rgba_stq_stq
+#include "r200_maos_vbtmp.h"
+
+#define IDX 12
+#define IND (R200_CP_VC_FRMT_XY| \
+ R200_CP_VC_FRMT_Z| \
+ R200_CP_VC_FRMT_W0| \
+ R200_CP_VC_FRMT_PKCOLOR| \
+ R200_CP_VC_FRMT_PKSPEC| \
+ R200_CP_VC_FRMT_ST0| \
+ R200_CP_VC_FRMT_Q0| \
+ R200_CP_VC_FRMT_ST1| \
+ R200_CP_VC_FRMT_Q1| \
+ R200_CP_VC_FRMT_N0)
+#define TAG(x) x##_w_rgpa_spec_stq_stq_n
+#include "r200_maos_vbtmp.h"
+
+
+
+
+
+/***********************************************************************
+ * Initialization
+ ***********************************************************************/
+
+
+static void init_tcl_verts( void )
+{
+ init_rgba();
+ init_n();
+ init_rgba_n();
+ init_rgba_st();
+ init_st_n();
+ init_rgba_st_st();
+ init_rgba_st_n();
+ init_rgba_spec_st_st();
+ init_st_st_n();
+ init_rgpa_spec_st_st_n();
+ init_rgba_stq();
+ init_rgba_stq_stq();
+ init_w_rgpa_spec_stq_stq_n();
+}
+
+
+void r200EmitArrays( GLcontext *ctx, GLuint inputs )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
+ GLuint req = 0;
+ GLuint vtx = (rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &
+ ~(R200_TCL_VTX_Q0|R200_TCL_VTX_Q1));
+ int i;
+ static int firsttime = 1;
+
+ if (firsttime) {
+ init_tcl_verts();
+ firsttime = 0;
+ }
+
+ if (1) {
+ req |= R200_CP_VC_FRMT_Z;
+ if (VB->ObjPtr->size == 4) {
+ req |= R200_CP_VC_FRMT_W0;
+ }
+ }
+
+ if (inputs & VERT_BIT_NORMAL) {
+ req |= R200_CP_VC_FRMT_N0;
+ }
+
+ if (inputs & VERT_BIT_COLOR0) {
+ req |= R200_CP_VC_FRMT_PKCOLOR;
+ }
+
+ if (inputs & VERT_BIT_COLOR1) {
+ req |= R200_CP_VC_FRMT_PKSPEC;
+ }
+
+ if (inputs & VERT_BIT_TEX0) {
+ req |= R200_CP_VC_FRMT_ST0;
+
+ if (VB->TexCoordPtr[0]->size == 4) {
+ req |= R200_CP_VC_FRMT_Q0;
+ vtx |= R200_TCL_VTX_Q0;
+ }
+ }
+
+ if (inputs & VERT_BIT_TEX1) {
+ req |= R200_CP_VC_FRMT_ST1;
+
+ if (VB->TexCoordPtr[1]->size == 4) {
+ req |= R200_CP_VC_FRMT_Q1;
+ vtx |= R200_TCL_VTX_Q1;
+ }
+ }
+
+ if (vtx != rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT]) {
+ R200_STATECHANGE( rmesa, tcl );
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] = vtx;
+ }
+
+ for (i = 0 ; i < R200_TCL_MAX_SETUP ; i++)
+ if ((setup_tab[i].vertex_format & req) == req)
+ break;
+
+ if (rmesa->tcl.vertex_format == setup_tab[i].vertex_format &&
+ rmesa->tcl.indexed_verts.buf)
+ return;
+
+ if (rmesa->tcl.indexed_verts.buf)
+ r200ReleaseArrays( ctx, ~0 );
+
+ r200AllocDmaRegionVerts( rmesa,
+ &rmesa->tcl.indexed_verts,
+ VB->Count,
+ setup_tab[i].vertex_size * 4,
+ 4);
+
+ setup_tab[i].emit( ctx, 0, VB->Count,
+ rmesa->tcl.indexed_verts.address +
+ rmesa->tcl.indexed_verts.start );
+
+ rmesa->tcl.vertex_format = setup_tab[i].vertex_format;
+ rmesa->tcl.indexed_verts.aos_start = GET_START( &rmesa->tcl.indexed_verts );
+ rmesa->tcl.indexed_verts.aos_size = setup_tab[i].vertex_size;
+ rmesa->tcl.indexed_verts.aos_stride = setup_tab[i].vertex_size;
+
+ rmesa->tcl.aos_components[0] = &rmesa->tcl.indexed_verts;
+ rmesa->tcl.nr_aos_components = 1;
+}
+
+
+
+void r200ReleaseArrays( GLcontext *ctx, GLuint newinputs )
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+
+ if (R200_DEBUG & DEBUG_VERTS)
+ _tnl_print_vert_flags( __FUNCTION__, newinputs );
+
+ if (newinputs)
+ r200ReleaseDmaRegion( rmesa, &rmesa->tcl.indexed_verts, __FUNCTION__ );
+}
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_pixel.c b/xc/lib/GL/mesa/src/drv/r200/r200_pixel.c
new file mode 100644
index 000000000..94977efd1
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_pixel.c
@@ -0,0 +1,494 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "enums.h"
+#include "mtypes.h"
+#include "macros.h"
+#include "texutil.h"
+#include "swrast/swrast.h"
+
+#include "r200_context.h"
+#include "r200_ioctl.h"
+#include "r200_pixel.h"
+#include "r200_swtcl.h"
+
+
+
+static GLboolean
+check_color( const GLcontext *ctx, GLenum type, GLenum format,
+ const struct gl_pixelstore_attrib *packing,
+ const void *pixels, GLint sz, GLint pitch )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint cpp = rmesa->r200Screen->cpp;
+
+ if (R200_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ if ( (pitch & 63) ||
+ ctx->_ImageTransferState ||
+ packing->SwapBytes ||
+ packing->LsbFirst) {
+ if (R200_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s: failed 1\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
+ if ( type == GL_UNSIGNED_INT_8_8_8_8_REV &&
+ cpp == 4 &&
+ format == GL_BGRA ) {
+ if (R200_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s: passed 2\n", __FUNCTION__);
+ return GL_TRUE;
+ }
+
+ if (R200_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s: failed\n", __FUNCTION__);
+
+ return GL_FALSE;
+}
+
+static GLboolean
+check_color_per_fragment_ops( const GLcontext *ctx )
+{
+ int result;
+ result = (!( ctx->Color.AlphaEnabled ||
+ ctx->Depth.Test ||
+ ctx->Fog.Enabled ||
+ ctx->Scissor.Enabled ||
+ ctx->Stencil.Enabled ||
+ !ctx->Color.ColorMask[0] ||
+ !ctx->Color.ColorMask[1] ||
+ !ctx->Color.ColorMask[2] ||
+ !ctx->Color.ColorMask[3] ||
+ ctx->Color.ColorLogicOpEnabled ||
+ ctx->Texture._EnabledUnits ||
+ ctx->Depth.OcclusionTest
+ ) &&
+ ctx->Current.RasterPosValid);
+
+ return result;
+}
+
+
+
+static GLboolean
+clip_pixelrect( const GLcontext *ctx,
+ const GLframebuffer *buffer,
+ GLint *x, GLint *y,
+ GLsizei *width, GLsizei *height,
+ GLint *size )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ /* left clipping */
+ if (*x < buffer->_Xmin) {
+ *width -= (buffer->_Xmin - *x);
+ *x = buffer->_Xmin;
+ }
+
+ /* right clipping */
+ if (*x + *width > buffer->_Xmax)
+ *width -= (*x + *width - buffer->_Xmax - 1);
+
+ if (*width <= 0)
+ return GL_FALSE;
+
+ /* bottom clipping */
+ if (*y < buffer->_Ymin) {
+ *height -= (buffer->_Ymin - *y);
+ *y = buffer->_Ymin;
+ }
+
+ /* top clipping */
+ if (*y + *height > buffer->_Ymax)
+ *height -= (*y + *height - buffer->_Ymax - 1);
+
+ if (*height <= 0)
+ return GL_FALSE;
+
+ *size = ((*y + *height - 1) * rmesa->r200Screen->frontPitch +
+ (*x + *width - 1) * rmesa->r200Screen->cpp);
+
+ return GL_TRUE;
+}
+
+static GLboolean
+r200TryReadPixels( GLcontext *ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *pack,
+ GLvoid *pixels )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLint size;
+ GLint pitch = pack->RowLength ? pack->RowLength : width;
+ GLint blit_format;
+
+ if (R200_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ /* Only accelerate reading to agp buffers.
+ */
+ if ( !r200IsAgpMemory(rmesa, pixels,
+ pitch * height * rmesa->r200Screen->cpp ) ) {
+ if (R200_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s: dest not agp\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
+ /* Need GL_PACK_INVERT_MESA to cope with upsidedown results from
+ * blitter:
+ */
+ if (!pack->Invert) {
+ if (R200_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s: MESA_PACK_INVERT not set\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
+ if (!check_color(ctx, type, format, pack, pixels, size, pitch))
+ return GL_FALSE;
+
+ switch ( rmesa->r200Screen->cpp ) {
+ case 4:
+ blit_format = R200_CP_COLOR_FORMAT_ARGB8888;
+ break;
+ default:
+ return GL_FALSE;
+ }
+
+
+ /* Although the blits go on the command buffer, need to do this and
+ * fire with lock held to guarentee cliprects and drawOffset are
+ * correct.
+ *
+ * This is an unusual situation however, as the code which flushes
+ * a full command buffer expects to be called unlocked. As a
+ * workaround, immediately flush the buffer on aquiring the lock.
+ */
+ LOCK_HARDWARE( rmesa );
+
+ if (rmesa->store.cmd_used)
+ r200FlushCmdBufLocked( rmesa, __FUNCTION__ );
+
+ if (!clip_pixelrect(ctx, ctx->ReadBuffer, &x, &y, &width, &height,
+ &size)) {
+ UNLOCK_HARDWARE( rmesa );
+ if (R200_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s totally clipped -- nothing to do\n",
+ __FUNCTION__);
+ return GL_TRUE;
+ }
+
+ {
+ __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
+ int nbox = dPriv->numClipRects;
+ int src_offset = rmesa->state.color.drawOffset;
+ int src_pitch = rmesa->state.color.drawPitch * rmesa->r200Screen->cpp;
+ int dst_offset = r200AgpOffsetFromVirtual( rmesa, pixels);
+ int dst_pitch = pitch * rmesa->r200Screen->cpp;
+ XF86DRIClipRectRec *box = dPriv->pClipRects;
+ int i;
+
+ r200EmitWait( rmesa, RADEON_WAIT_3D );
+
+ y = dPriv->h - y - height;
+ x += dPriv->x;
+ y += dPriv->y;
+
+
+ if (R200_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "readpixel blit src_pitch %d dst_pitch %d\n",
+ src_pitch, dst_pitch);
+
+ for (i = 0 ; i < nbox ; i++)
+ {
+ GLint bx = box[i].x1;
+ GLint by = box[i].y1;
+ GLint bw = box[i].x2 - bx;
+ GLint bh = box[i].y2 - by;
+
+ if (bx < x) bw -= x - bx, bx = x;
+ if (by < y) bh -= y - by, by = y;
+ if (bx + bw > x + width) bw = x + width - bx;
+ if (by + bh > y + height) bh = y + height - by;
+ if (bw <= 0) continue;
+ if (bh <= 0) continue;
+
+ r200EmitBlit( rmesa,
+ blit_format,
+ src_pitch, src_offset,
+ dst_pitch, dst_offset,
+ bx, by,
+ bx - x, by - y,
+ bw, bh );
+ }
+
+ r200FlushCmdBufLocked( rmesa, __FUNCTION__ );
+ }
+ UNLOCK_HARDWARE( rmesa );
+
+ r200Finish( ctx ); /* required by GL */
+
+ return GL_TRUE;
+}
+
+static void
+r200ReadPixels( GLcontext *ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *pack,
+ GLvoid *pixels )
+{
+ if (R200_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ if (!r200TryReadPixels( ctx, x, y, width, height, format, type, pack,
+ pixels))
+ _swrast_ReadPixels( ctx, x, y, width, height, format, type, pack,
+ pixels);
+}
+
+
+
+
+static void do_draw_pix( GLcontext *ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLint pitch,
+ const void *pixels,
+ GLuint dest, GLuint planemask)
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
+ XF86DRIClipRectPtr box = dPriv->pClipRects;
+ int nbox = dPriv->numClipRects;
+ int i;
+ int blit_format;
+ int size;
+ int src_offset = r200AgpOffsetFromVirtual( rmesa, pixels);
+ int src_pitch = pitch * rmesa->r200Screen->cpp;
+
+ if (R200_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ switch ( rmesa->r200Screen->cpp ) {
+ case 2:
+ blit_format = R200_CP_COLOR_FORMAT_RGB565;
+ break;
+ case 4:
+ blit_format = R200_CP_COLOR_FORMAT_ARGB8888;
+ break;
+ default:
+ return;
+ }
+
+
+ LOCK_HARDWARE( rmesa );
+
+ if (rmesa->store.cmd_used)
+ r200FlushCmdBufLocked( rmesa, __FUNCTION__ );
+
+ y -= height; /* cope with pixel zoom */
+
+ if (!clip_pixelrect(ctx, ctx->DrawBuffer,
+ &x, &y, &width, &height,
+ &size)) {
+ UNLOCK_HARDWARE( rmesa );
+ return;
+ }
+
+ y = dPriv->h - y - height; /* convert from gl to hardware coords */
+ x += dPriv->x;
+ y += dPriv->y;
+
+
+ r200EmitWait( rmesa, RADEON_WAIT_3D );
+
+ for (i = 0 ; i < nbox ; i++ )
+ {
+ GLint bx = box[i].x1;
+ GLint by = box[i].y1;
+ GLint bw = box[i].x2 - bx;
+ GLint bh = box[i].y2 - by;
+
+ if (bx < x) bw -= x - bx, bx = x;
+ if (by < y) bh -= y - by, by = y;
+ if (bx + bw > x + width) bw = x + width - bx;
+ if (by + bh > y + height) bh = y + height - by;
+ if (bw <= 0) continue;
+ if (bh <= 0) continue;
+
+ r200EmitBlit( rmesa,
+ blit_format,
+ src_pitch, src_offset,
+ rmesa->state.color.drawPitch * rmesa->r200Screen->cpp,
+ rmesa->state.color.drawOffset,
+ bx - x, by - y,
+ bx, by,
+ bw, bh );
+ }
+
+ r200FlushCmdBufLocked( rmesa, __FUNCTION__ );
+ r200WaitForIdleLocked( rmesa ); /* required by GL */
+ UNLOCK_HARDWARE( rmesa );
+}
+
+
+
+
+static GLboolean
+r200TryDrawPixels( GLcontext *ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLvoid *pixels )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLint pitch = unpack->RowLength ? unpack->RowLength : width;
+ GLuint dest, planemask;
+ GLuint cpp = rmesa->r200Screen->cpp;
+ GLint size = width * pitch * cpp;
+
+ if (R200_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ switch (format) {
+ case GL_RGB:
+ case GL_RGBA:
+ case GL_BGRA:
+ dest = rmesa->state.color.drawOffset;
+
+ planemask = r200PackColor(cpp,
+ ctx->Color.ColorMask[RCOMP],
+ ctx->Color.ColorMask[GCOMP],
+ ctx->Color.ColorMask[BCOMP],
+ ctx->Color.ColorMask[ACOMP]);
+
+ if (cpp == 2)
+ planemask |= planemask << 16;
+
+ if (planemask != ~0)
+ return GL_FALSE; /* fix me -- should be possible */
+
+ /* Can't do conversions on agp reads/draws.
+ */
+ if ( !r200IsAgpMemory( rmesa, pixels, size ) ) {
+ if (R200_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s: not agp memory\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
+ if (!check_color(ctx, type, format, unpack, pixels, size, pitch)) {
+ return GL_FALSE;
+ }
+ if (!check_color_per_fragment_ops(ctx)) {
+ return GL_FALSE;
+ }
+
+ if (ctx->Pixel.ZoomX != 1.0F ||
+ ctx->Pixel.ZoomY != -1.0F)
+ return GL_FALSE;
+ break;
+
+ default:
+ return GL_FALSE;
+ }
+
+ if ( r200IsAgpMemory(rmesa, pixels, size) )
+ {
+ do_draw_pix( ctx, x, y, width, height, pitch, pixels,
+ dest, planemask );
+ return GL_TRUE;
+ }
+ else if (0)
+ {
+ /* Pixels is in regular memory -- get dma buffers and perform
+ * upload through them.
+ */
+ }
+ else
+ return GL_FALSE;
+}
+
+static void
+r200DrawPixels( GLcontext *ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLvoid *pixels )
+{
+ if (R200_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ if (!r200TryDrawPixels( ctx, x, y, width, height, format, type,
+ unpack, pixels ))
+ _swrast_DrawPixels( ctx, x, y, width, height, format, type,
+ unpack, pixels );
+}
+
+
+static void
+r200Bitmap( GLcontext *ctx, GLint px, GLint py,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if (rmesa->Fallback)
+ _swrast_Bitmap( ctx, px, py, width, height, unpack, bitmap );
+ else
+ r200PointsBitmap( ctx, px, py, width, height, unpack, bitmap );
+}
+
+
+
+void r200InitPixelFuncs( GLcontext *ctx )
+{
+ /* Pixel path fallbacks.
+ */
+ ctx->Driver.Accum = _swrast_Accum;
+ ctx->Driver.Bitmap = _swrast_Bitmap;
+ ctx->Driver.CopyPixels = _swrast_CopyPixels;
+ ctx->Driver.DrawPixels = _swrast_DrawPixels;
+ ctx->Driver.ReadPixels = _swrast_ReadPixels;
+
+ if (!getenv("R200_NO_BLITS") && R200_CONTEXT(ctx)->dri.drmMinor >= 6) {
+ ctx->Driver.ReadPixels = r200ReadPixels;
+ ctx->Driver.DrawPixels = r200DrawPixels;
+ if (getenv("R200_HW_BITMAP"))
+ ctx->Driver.Bitmap = r200Bitmap;
+ }
+}
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_reg.h b/xc/lib/GL/mesa/src/drv/r200/r200_reg.h
new file mode 100644
index 000000000..3b5bd02f4
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_reg.h
@@ -0,0 +1,1438 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#ifndef _R200_REG_H_
+#define _R200_REG_H_
+
+#define R200_PP_MISC 0x1c14
+#define R200_REF_ALPHA_MASK 0x000000ff
+#define R200_ALPHA_TEST_FAIL (0 << 8)
+#define R200_ALPHA_TEST_LESS (1 << 8)
+#define R200_ALPHA_TEST_LEQUAL (2 << 8)
+#define R200_ALPHA_TEST_EQUAL (3 << 8)
+#define R200_ALPHA_TEST_GEQUAL (4 << 8)
+#define R200_ALPHA_TEST_GREATER (5 << 8)
+#define R200_ALPHA_TEST_NEQUAL (6 << 8)
+#define R200_ALPHA_TEST_PASS (7 << 8)
+#define R200_ALPHA_TEST_OP_MASK (7 << 8)
+#define R200_CHROMA_FUNC_FAIL (0 << 16)
+#define R200_CHROMA_FUNC_PASS (1 << 16)
+#define R200_CHROMA_FUNC_NEQUAL (2 << 16)
+#define R200_CHROMA_FUNC_EQUAL (3 << 16)
+#define R200_CHROMA_KEY_NEAREST (0 << 18)
+#define R200_CHROMA_KEY_ZERO (1 << 18)
+#define R200_RIGHT_HAND_CUBE_D3D (0 << 24)
+#define R200_RIGHT_HAND_CUBE_OGL (1 << 24)
+#define R200_PP_FOG_COLOR 0x1c18
+#define R200_FOG_COLOR_MASK 0x00ffffff
+#define R200_FOG_VERTEX (0 << 24)
+#define R200_FOG_TABLE (1 << 24)
+#define R200_FOG_USE_DEPTH (0 << 25)
+#define R200_FOG_USE_W (1 << 25)
+#define R200_FOG_USE_DIFFUSE_ALPHA (2 << 25)
+#define R200_FOG_USE_SPEC_ALPHA (3 << 25)
+#define R200_FOG_USE_VTX_FOG (4 << 25)
+#define R200_RE_SOLID_COLOR 0x1c1c
+#define R200_RB3D_BLENDCNTL 0x1c20
+#define R200_COMB_FCN_MASK (7 << 12)
+#define R200_COMB_FCN_ADD_CLAMP (0 << 12)
+#define R200_COMB_FCN_ADD_NOCLAMP (1 << 12)
+#define R200_COMB_FCN_SUB_CLAMP (2 << 12)
+#define R200_COMB_FCN_SUB_NOCLAMP (3 << 12)
+#define R200_COMB_FCN_MIN (4 << 12)
+#define R200_COMB_FCN_MAX (5 << 12)
+#define R200_COMB_FCN_RSUB_CLAMP (6 << 12)
+#define R200_COMB_FCN_RSUB_NOCLAMP (7 << 12)
+#define R200_SRC_BLEND_GL_ZERO (32 << 16)
+#define R200_SRC_BLEND_GL_ONE (33 << 16)
+#define R200_SRC_BLEND_GL_SRC_COLOR (34 << 16)
+#define R200_SRC_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 16)
+#define R200_SRC_BLEND_GL_DST_COLOR (36 << 16)
+#define R200_SRC_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 16)
+#define R200_SRC_BLEND_GL_SRC_ALPHA (38 << 16)
+#define R200_SRC_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 16)
+#define R200_SRC_BLEND_GL_DST_ALPHA (40 << 16)
+#define R200_SRC_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 16)
+#define R200_SRC_BLEND_GL_SRC_ALPHA_SATURATE (42 << 16)
+#define R200_SRC_BLEND_GL_CONST_COLOR (43 << 16)
+#define R200_SRC_BLEND_GL_ONE_MINUS_CONST_COLOR (44 << 16)
+#define R200_SRC_BLEND_GL_CONST_ALPHA (45 << 16)
+#define R200_SRC_BLEND_GL_ONE_MINUS_CONST_ALPHA (46 << 16)
+#define R200_SRC_BLEND_MASK (63 << 16)
+#define R200_DST_BLEND_GL_ZERO (32 << 24)
+#define R200_DST_BLEND_GL_ONE (33 << 24)
+#define R200_DST_BLEND_GL_SRC_COLOR (34 << 24)
+#define R200_DST_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 24)
+#define R200_DST_BLEND_GL_DST_COLOR (36 << 24)
+#define R200_DST_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 24)
+#define R200_DST_BLEND_GL_SRC_ALPHA (38 << 24)
+#define R200_DST_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 24)
+#define R200_DST_BLEND_GL_DST_ALPHA (40 << 24)
+#define R200_DST_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 24)
+#define R200_DST_BLEND_GL_CONST_COLOR (43 << 24)
+#define R200_DST_BLEND_GL_ONE_MINUS_CONST_COLOR (44 << 24)
+#define R200_DST_BLEND_GL_CONST_ALPHA (45 << 24)
+#define R200_DST_BLEND_GL_ONE_MINUS_CONST_ALPHA (46 << 24)
+#define R200_DST_BLEND_MASK (63 << 24)
+#define R200_RB3D_DEPTHOFFSET 0x1c24
+#define R200_RB3D_DEPTHPITCH 0x1c28
+#define R200_DEPTHPITCH_MASK 0x00001ff8
+#define R200_DEPTH_ENDIAN_NO_SWAP (0 << 18)
+#define R200_DEPTH_ENDIAN_WORD_SWAP (1 << 18)
+#define R200_DEPTH_ENDIAN_DWORD_SWAP (2 << 18)
+#define R200_RB3D_ZSTENCILCNTL 0x1c2c
+#define R200_DEPTH_FORMAT_MASK (0xf << 0)
+#define R200_DEPTH_FORMAT_16BIT_INT_Z (0 << 0)
+#define R200_DEPTH_FORMAT_24BIT_INT_Z (2 << 0)
+#define R200_DEPTH_FORMAT_24BIT_FLOAT_Z (3 << 0)
+#define R200_DEPTH_FORMAT_32BIT_INT_Z (4 << 0)
+#define R200_DEPTH_FORMAT_32BIT_FLOAT_Z (5 << 0)
+#define R200_DEPTH_FORMAT_24BIT_FLOAT_W (9 << 0)
+#define R200_DEPTH_FORMAT_32BIT_FLOAT_W (11 << 0)
+#define R200_Z_TEST_NEVER (0 << 4)
+#define R200_Z_TEST_LESS (1 << 4)
+#define R200_Z_TEST_LEQUAL (2 << 4)
+#define R200_Z_TEST_EQUAL (3 << 4)
+#define R200_Z_TEST_GEQUAL (4 << 4)
+#define R200_Z_TEST_GREATER (5 << 4)
+#define R200_Z_TEST_NEQUAL (6 << 4)
+#define R200_Z_TEST_ALWAYS (7 << 4)
+#define R200_Z_TEST_MASK (7 << 4)
+#define R200_STENCIL_TEST_NEVER (0 << 12)
+#define R200_STENCIL_TEST_LESS (1 << 12)
+#define R200_STENCIL_TEST_LEQUAL (2 << 12)
+#define R200_STENCIL_TEST_EQUAL (3 << 12)
+#define R200_STENCIL_TEST_GEQUAL (4 << 12)
+#define R200_STENCIL_TEST_GREATER (5 << 12)
+#define R200_STENCIL_TEST_NEQUAL (6 << 12)
+#define R200_STENCIL_TEST_ALWAYS (7 << 12)
+#define R200_STENCIL_TEST_MASK (0x7 << 12)
+#define R200_STENCIL_FAIL_KEEP (0 << 16)
+#define R200_STENCIL_FAIL_ZERO (1 << 16)
+#define R200_STENCIL_FAIL_REPLACE (2 << 16)
+#define R200_STENCIL_FAIL_INC (3 << 16)
+#define R200_STENCIL_FAIL_DEC (4 << 16)
+#define R200_STENCIL_FAIL_INVERT (5 << 16)
+#define R200_STENCIL_FAIL_INC_WRAP (6 << 16)
+#define R200_STENCIL_FAIL_DEC_WRAP (7 << 16)
+#define R200_STENCIL_FAIL_MASK (0x7 << 16)
+#define R200_STENCIL_ZPASS_KEEP (0 << 20)
+#define R200_STENCIL_ZPASS_ZERO (1 << 20)
+#define R200_STENCIL_ZPASS_REPLACE (2 << 20)
+#define R200_STENCIL_ZPASS_INC (3 << 20)
+#define R200_STENCIL_ZPASS_DEC (4 << 20)
+#define R200_STENCIL_ZPASS_INVERT (5 << 20)
+#define R200_STENCIL_ZPASS_INC_WRAP (6 << 20)
+#define R200_STENCIL_ZPASS_DEC_WRAP (7 << 20)
+#define R200_STENCIL_ZPASS_MASK (0x7 << 20)
+#define R200_STENCIL_ZFAIL_KEEP (0 << 24)
+#define R200_STENCIL_ZFAIL_ZERO (1 << 24)
+#define R200_STENCIL_ZFAIL_REPLACE (2 << 24)
+#define R200_STENCIL_ZFAIL_INC (3 << 24)
+#define R200_STENCIL_ZFAIL_DEC (4 << 24)
+#define R200_STENCIL_ZFAIL_INVERT (5 << 24)
+#define R200_STENCIL_ZFAIL_INC_WRAP (6 << 24)
+#define R200_STENCIL_ZFAIL_DEC_WRAP (7 << 24)
+#define R200_STENCIL_ZFAIL_MASK (0x7 << 24)
+#define R200_Z_WRITE_ENABLE (1 << 30)
+/*gap*/
+#define R200_PP_CNTL 0x1c38
+#define R200_TEX_0_ENABLE 0x00000010
+#define R200_TEX_1_ENABLE 0x00000020
+#define R200_TEX_2_ENABLE 0x00000040
+#define R200_TEX_3_ENABLE 0x00000080
+#define R200_TEX_4_ENABLE 0x00000100
+#define R200_TEX_5_ENABLE 0x00000200
+#define R200_TEX_ENABLE_MASK 0x000003f0
+#define R200_FILTER_ROUND_MODE_MASK 0x00000400
+#define R200_TEX_BLEND_7_ENABLE 0x00000800
+#define R200_TEX_BLEND_0_ENABLE 0x00001000
+#define R200_TEX_BLEND_1_ENABLE 0x00002000
+#define R200_TEX_BLEND_2_ENABLE 0x00004000
+#define R200_TEX_BLEND_3_ENABLE 0x00008000
+#define R200_TEX_BLEND_4_ENABLE 0x00010000
+#define R200_TEX_BLEND_5_ENABLE 0x00020000
+#define R200_TEX_BLEND_6_ENABLE 0x00040000
+#define R200_MULTI_PASS_ENABLE 0x00080000
+#define R200_SPECULAR_ENABLE 0x00200000
+#define R200_FOG_ENABLE 0x00400000
+#define R200_ALPHA_TEST_ENABLE 0x00800000
+#define R200_ANTI_ALIAS_NONE 0x00000000
+#define R200_ANTI_ALIAS_LINE 0x01000000
+#define R200_ANTI_ALIAS_POLY 0x02000000
+#define R200_ANTI_ALIAS_MASK 0x03000000
+#define R200_RB3D_CNTL 0x1c3c
+#define R200_ALPHA_BLEND_ENABLE (1 << 0)
+#define R200_PLANE_MASK_ENABLE (1 << 1)
+#define R200_DITHER_ENABLE (1 << 2)
+#define R200_ROUND_ENABLE (1 << 3)
+#define R200_SCALE_DITHER_ENABLE (1 << 4)
+#define R200_DITHER_INIT (1 << 5)
+#define R200_ROP_ENABLE (1 << 6)
+#define R200_STENCIL_ENABLE (1 << 7)
+#define R200_Z_ENABLE (1 << 8)
+#define R200_DEPTH_XZ_OFFEST_ENABLE (1 << 9)
+#define R200_COLOR_FORMAT_ARGB1555 (3 << 10)
+#define R200_COLOR_FORMAT_RGB565 (4 << 10)
+#define R200_COLOR_FORMAT_ARGB8888 (6 << 10)
+#define R200_COLOR_FORMAT_RGB332 (7 << 10)
+#define R200_COLOR_FORMAT_Y8 (8 << 10)
+#define R200_COLOR_FORMAT_RGB8 (9 << 10)
+#define R200_COLOR_FORMAT_YUV422_VYUY (11 << 10)
+#define R200_COLOR_FORMAT_YUV422_YVYU (12 << 10)
+#define R200_COLOR_FORMAT_aYUV444 (14 << 10)
+#define R200_COLOR_FORMAT_ARGB4444 (15 << 10)
+#define R200_CLRCMP_FLIP_ENABLE (1 << 14)
+#define R200_SEPARATE_ALPHA_ENABLE (1 << 16)
+#define R200_RB3D_COLOROFFSET 0x1c40
+#define R200_COLOROFFSET_MASK 0xfffffff0
+#define R200_RE_WIDTH_HEIGHT 0x1c44
+#define R200_RE_WIDTH_SHIFT 0
+#define R200_RE_HEIGHT_SHIFT 16
+#define R200_RB3D_COLORPITCH 0x1c48
+#define R200_COLORPITCH_MASK 0x000001ff8
+#define R200_COLOR_ENDIAN_NO_SWAP (0 << 18)
+#define R200_COLOR_ENDIAN_WORD_SWAP (1 << 18)
+#define R200_COLOR_ENDIAN_DWORD_SWAP (2 << 18)
+#define R200_SE_CNTL 0x1c4c
+#define R200_FFACE_CULL_CW (0 << 0)
+#define R200_FFACE_CULL_CCW (1 << 0)
+#define R200_FFACE_CULL_DIR_MASK (1 << 0)
+#define R200_BFACE_CULL (0 << 1)
+#define R200_BFACE_SOLID (3 << 1)
+#define R200_FFACE_CULL (0 << 3)
+#define R200_FFACE_SOLID (3 << 3)
+#define R200_FFACE_CULL_MASK (3 << 3)
+#define R200_FLAT_SHADE_VTX_0 (0 << 6)
+#define R200_FLAT_SHADE_VTX_1 (1 << 6)
+#define R200_FLAT_SHADE_VTX_2 (2 << 6)
+#define R200_FLAT_SHADE_VTX_LAST (3 << 6)
+#define R200_DIFFUSE_SHADE_SOLID (0 << 8)
+#define R200_DIFFUSE_SHADE_FLAT (1 << 8)
+#define R200_DIFFUSE_SHADE_GOURAUD (2 << 8)
+#define R200_DIFFUSE_SHADE_MASK (3 << 8)
+#define R200_ALPHA_SHADE_SOLID (0 << 10)
+#define R200_ALPHA_SHADE_FLAT (1 << 10)
+#define R200_ALPHA_SHADE_GOURAUD (2 << 10)
+#define R200_ALPHA_SHADE_MASK (3 << 10)
+#define R200_SPECULAR_SHADE_SOLID (0 << 12)
+#define R200_SPECULAR_SHADE_FLAT (1 << 12)
+#define R200_SPECULAR_SHADE_GOURAUD (2 << 12)
+#define R200_SPECULAR_SHADE_MASK (3 << 12)
+#define R200_FOG_SHADE_SOLID (0 << 14)
+#define R200_FOG_SHADE_FLAT (1 << 14)
+#define R200_FOG_SHADE_GOURAUD (2 << 14)
+#define R200_FOG_SHADE_MASK (3 << 14)
+#define R200_ZBIAS_ENABLE_POINT (1 << 16)
+#define R200_ZBIAS_ENABLE_LINE (1 << 17)
+#define R200_ZBIAS_ENABLE_TRI (1 << 18)
+#define R200_WIDELINE_ENABLE (1 << 20)
+#define R200_VTX_PIX_CENTER_D3D (0 << 27)
+#define R200_VTX_PIX_CENTER_OGL (1 << 27)
+#define R200_ROUND_MODE_TRUNC (0 << 28)
+#define R200_ROUND_MODE_ROUND (1 << 28)
+#define R200_ROUND_MODE_ROUND_EVEN (2 << 28)
+#define R200_ROUND_MODE_ROUND_ODD (3 << 28)
+#define R200_ROUND_PREC_16TH_PIX (0 << 30)
+#define R200_ROUND_PREC_8TH_PIX (1 << 30)
+#define R200_ROUND_PREC_4TH_PIX (2 << 30)
+#define R200_ROUND_PREC_HALF_PIX (3 << 30)
+#define R200_RE_CNTL 0x1c50
+#define R200_STIPPLE_ENABLE 0x1
+#define R200_SCISSOR_ENABLE 0x2
+#define R200_PATTERN_ENABLE 0x4
+#define R200_PERSPECTIVE_ENABLE 0x8
+#define R200_POINT_SMOOTH 0x20
+#define R200_VTX_STQ0_D3D 0x00010000
+#define R200_VTX_STQ1_D3D 0x00040000
+#define R200_VTX_STQ2_D3D 0x00100000
+#define R200_VTX_STQ3_D3D 0x00400000
+#define R200_VTX_STQ4_D3D 0x01000000
+#define R200_VTX_STQ5_D3D 0x04000000
+/* gap */
+#define R200_RE_STIPPLE_ADDR 0x1cc8
+#define R200_RE_STIPPLE_DATA 0x1ccc
+#define R200_RE_LINE_PATTERN 0x1cd0
+#define R200_LINE_PATTERN_MASK 0x0000ffff
+#define R200_LINE_REPEAT_COUNT_SHIFT 16
+#define R200_LINE_PATTERN_START_SHIFT 24
+#define R200_LINE_PATTERN_LITTLE_BIT_ORDER (0 << 28)
+#define R200_LINE_PATTERN_BIG_BIT_ORDER (1 << 28)
+#define R200_LINE_PATTERN_AUTO_RESET (1 << 29)
+#define R200_RE_LINE_STATE 0x1cd4
+#define R200_LINE_CURRENT_PTR_SHIFT 0
+#define R200_LINE_CURRENT_COUNT_SHIFT 8
+#define R200_RE_SCISSOR_TL_0 0x1cd8
+#define R200_RE_SCISSOR_BR_0 0x1cdc
+#define R200_RE_SCISSOR_TL_1 0x1ce0
+#define R200_RE_SCISSOR_BR_1 0x1ce4
+#define R200_RE_SCISSOR_TL_2 0x1ce8
+#define R200_RE_SCISSOR_BR_2 0x1cec
+/* gap */
+#define R200_RB3D_DEPTHXY_OFFSET 0x1d60
+#define R200_DEPTHX_SHIFT 0
+#define R200_DEPTHY_SHIFT 16
+/* gap */
+#define R200_RB3D_STENCILREFMASK 0x1d7c
+#define R200_STENCIL_REF_SHIFT 0
+#define R200_STENCIL_REF_MASK (0xff << 0)
+#define R200_STENCIL_MASK_SHIFT 16
+#define R200_STENCIL_VALUE_MASK (0xff << 16)
+#define R200_STENCIL_WRITEMASK_SHIFT 24
+#define R200_STENCIL_WRITE_MASK (0xff << 24)
+#define R200_RB3D_ROPCNTL 0x1d80
+#define R200_ROP_MASK (15 << 8)
+#define R200_ROP_CLEAR (0 << 8)
+#define R200_ROP_NOR (1 << 8)
+#define R200_ROP_AND_INVERTED (2 << 8)
+#define R200_ROP_COPY_INVERTED (3 << 8)
+#define R200_ROP_AND_REVERSE (4 << 8)
+#define R200_ROP_INVERT (5 << 8)
+#define R200_ROP_XOR (6 << 8)
+#define R200_ROP_NAND (7 << 8)
+#define R200_ROP_AND (8 << 8)
+#define R200_ROP_EQUIV (9 << 8)
+#define R200_ROP_NOOP (10 << 8)
+#define R200_ROP_OR_INVERTED (11 << 8)
+#define R200_ROP_COPY (12 << 8)
+#define R200_ROP_OR_REVERSE (13 << 8)
+#define R200_ROP_OR (14 << 8)
+#define R200_ROP_SET (15 << 8)
+#define R200_RB3D_PLANEMASK 0x1d84
+/* gap */
+#define R200_SE_VPORT_XSCALE 0x1d98
+#define R200_SE_VPORT_XOFFSET 0x1d9c
+#define R200_SE_VPORT_YSCALE 0x1da0
+#define R200_SE_VPORT_YOFFSET 0x1da4
+#define R200_SE_VPORT_ZSCALE 0x1da8
+#define R200_SE_VPORT_ZOFFSET 0x1dac
+#define R200_SE_ZBIAS_FACTOR 0x1db0
+#define R200_SE_ZBIAS_CONSTANT 0x1db4
+#define R200_SE_LINE_WIDTH 0x1db8
+#define R200_LINE_WIDTH_SHIFT 0x00000000
+#define R200_MINPOINTSIZE_SHIFT 0x00000010
+/* gap */
+#define R200_SE_VAP_CNTL 0x2080
+#define R200_VAP_TCL_ENABLE 0x00000001
+#define R200_VAP_SINGLE_BUF_STATE_ENABLE 0x00000010
+#define R200_VAP_FORCE_W_TO_ONE 0x00010000
+#define R200_VAP_D3D_TEX_DEFAULT 0x00020000
+#define R200_VAP_VF_MAX_VTX_NUM__SHIFT 18
+#define R200_VAP_DX_CLIP_SPACE_DEF 0x00400000
+#define R200_SE_VF_CNTL 0x2084
+#define R200_VF_PRIM_NONE 0x00000000
+#define R200_VF_PRIM_POINTS 0x00000001
+#define R200_VF_PRIM_LINES 0x00000002
+#define R200_VF_PRIM_LINE_STRIP 0x00000003
+#define R200_VF_PRIM_TRIANGLES 0x00000004
+#define R200_VF_PRIM_TRIANGLE_FAN 0x00000005
+#define R200_VF_PRIM_TRIANGLE_STRIP 0x00000006
+#define R200_VF_PRIM_RECT_LIST 0x00000008
+#define R200_VF_PRIM_3VRT_POINTS 0x00000009
+#define R200_VF_PRIM_3VRT_LINES 0x0000000a
+#define R200_VF_PRIM_POINT_SPRITES 0x0000000b
+#define R200_VF_PRIM_LINE_LOOP 0x0000000c
+#define R200_VF_PRIM_QUADS 0x0000000d
+#define R200_VF_PRIM_QUAD_STRIP 0x0000000e
+#define R200_VF_PRIM_POLYGON 0x0000000f
+#define R200_VF_PRIM_MASK 0x0000000f
+#define R200_VF_PRIM_WALK_IND 0x00000010
+#define R200_VF_PRIM_WALK_LIST 0x00000020
+#define R200_VF_PRIM_WALK_RING 0x00000030
+#define R200_VF_PRIM_WALK_MASK 0x00000030
+#define R200_VF_COLOR_ORDER_RGBA 0x00000040
+#define R200_VF_TCL_OUTPUT_VTX_ENABLE 0x00000200
+#define R200_VF_INDEX_SZ_4 0x00000800
+#define R200_VF_VERTEX_NUMBER_MASK 0xffff0000
+#define R200_VF_VERTEX_NUMBER_SHIFT 16
+#define R200_SE_VTX_FMT_0 0x2088
+#define R200_VTX_XY 0 /* always have xy */
+#define R200_VTX_Z0 (1<<0)
+#define R200_VTX_W0 (1<<1)
+#define R200_VTX_WEIGHT_COUNT_SHIFT (2)
+#define R200_VTX_PV_MATRIX_SEL (1<<5)
+#define R200_VTX_N0 (1<<6)
+#define R200_VTX_POINT_SIZE (1<<7)
+#define R200_VTX_DISCRETE_FOG (1<<8)
+#define R200_VTX_SHININESS_0 (1<<9)
+#define R200_VTX_SHININESS_1 (1<<10)
+#define R200_VTX_COLOR_NOT_PRESENT 0
+#define R200_VTX_PK_RGBA 1
+#define R200_VTX_FP_RGB 2
+#define R200_VTX_FP_RGBA 3
+#define R200_VTX_COLOR_MASK 3
+#define R200_VTX_COLOR_0_SHIFT 11
+#define R200_VTX_COLOR_1_SHIFT 13
+#define R200_VTX_COLOR_2_SHIFT 15
+#define R200_VTX_COLOR_3_SHIFT 17
+#define R200_VTX_COLOR_4_SHIFT 19
+#define R200_VTX_COLOR_5_SHIFT 21
+#define R200_VTX_COLOR_6_SHIFT 23
+#define R200_VTX_COLOR_7_SHIFT 25
+#define R200_VTX_XY1 (1<<28)
+#define R200_VTX_Z1 (1<<29)
+#define R200_VTX_W1 (1<<30)
+#define R200_VTX_N1 (1<<31)
+#define R200_SE_VTX_FMT_1 0x208c
+#define R200_VTX_TEX0_COMP_CNT_SHIFT 0
+#define R200_VTX_TEX1_COMP_CNT_SHIFT 3
+#define R200_VTX_TEX2_COMP_CNT_SHIFT 6
+#define R200_VTX_TEX3_COMP_CNT_SHIFT 9
+#define R200_VTX_TEX4_COMP_CNT_SHIFT 12
+#define R200_VTX_TEX5_COMP_CNT_SHIFT 15
+#define R200_SE_TCL_OUTPUT_VTX_FMT_0 0x2090
+#define R200_SE_TCL_OUTPUT_VTX_FMT_1 0x2094
+/* gap */
+#define R200_SE_VTE_CNTL 0x20b0
+#define R200_VPORT_X_SCALE_ENA 0x00000001
+#define R200_VPORT_X_OFFSET_ENA 0x00000002
+#define R200_VPORT_Y_SCALE_ENA 0x00000004
+#define R200_VPORT_Y_OFFSET_ENA 0x00000008
+#define R200_VPORT_Z_SCALE_ENA 0x00000010
+#define R200_VPORT_Z_OFFSET_ENA 0x00000020
+#define R200_VTX_XY_FMT 0x00000100
+#define R200_VTX_Z_FMT 0x00000200
+#define R200_VTX_W0_FMT 0x00000400
+#define R200_VTX_W0_NORMALIZE 0x00000800
+#define R200_VTX_ST_DENORMALIZED 0x00001000
+/* gap */
+#define R200_SE_VTX_NUM_ARRAYS 0x20c0
+#define R200_SE_VTX_AOS_ATTR01 0x20c4
+#define R200_SE_VTX_AOS_ADDR0 0x20c8
+#define R200_SE_VTX_AOS_ADDR1 0x20cc
+#define R200_SE_VTX_AOS_ATTR23 0x20d0
+#define R200_SE_VTX_AOS_ADDR2 0x20d4
+#define R200_SE_VTX_AOS_ADDR3 0x20d8
+#define R200_SE_VTX_AOS_ATTR45 0x20dc
+#define R200_SE_VTX_AOS_ADDR4 0x20e0
+#define R200_SE_VTX_AOS_ADDR5 0x20e4
+#define R200_SE_VTX_AOS_ATTR67 0x20e8
+#define R200_SE_VTX_AOS_ADDR6 0x20ec
+#define R200_SE_VTX_AOS_ADDR7 0x20f0
+#define R200_SE_VTX_AOS_ATTR89 0x20f4
+#define R200_SE_VTX_AOS_ADDR8 0x20f8
+#define R200_SE_VTX_AOS_ADDR9 0x20fc
+#define R200_SE_VTX_AOS_ATTR1011 0x2100
+#define R200_SE_VTX_AOS_ADDR10 0x2104
+#define R200_SE_VTX_AOS_ADDR11 0x2108
+#define R200_SE_VF_MAX_VTX_INDX 0x210c
+#define R200_SE_VF_MIN_VTX_INDX 0x2110
+/* gap */
+#define R200_SE_VAP_CNTL_STATUS 0x2140
+#define R200_VC_NO_SWAP (0 << 0)
+#define R200_VC_16BIT_SWAP (1 << 0)
+#define R200_VC_32BIT_SWAP (2 << 0)
+/* gap */
+#define R200_SE_VTX_STATE_CNTL 0x2180
+#define R200_VSC_COLOR_0_ASSEMBLY_CNTL_SHIFT 0x00000000
+#define R200_VSC_COLOR_1_ASSEMBLY_CNTL_SHIFT 0x00000002
+#define R200_VSC_COLOR_2_ASSEMBLY_CNTL_SHIFT 0x00000004
+#define R200_VSC_COLOR_3_ASSEMBLY_CNTL_SHIFT 0x00000006
+#define R200_VSC_COLOR_4_ASSEMBLY_CNTL_SHIFT 0x00000008
+#define R200_VSC_COLOR_5_ASSEMBLY_CNTL_SHIFT 0x0000000a
+#define R200_VSC_COLOR_6_ASSEMBLY_CNTL_SHIFT 0x0000000c
+#define R200_VSC_COLOR_7_ASSEMBLY_CNTL_SHIFT 0x0000000e
+#define R200_VSC_UPDATE_USER_COLOR_0_ENABLE 0x00010000
+#define R200_VSC_UPDATE_USER_COLOR_1_ENABLE 0x00020000
+/* gap */
+#define R200_SE_TCL_VECTOR_INDX_REG 0x2200
+#define R200_SE_TCL_VECTOR_DATA_REG 0x2204
+#define R200_SE_TCL_SCALAR_INDX_REG 0x2208
+#define R200_SE_TCL_SCALAR_DATA_REG 0x220c
+/* gap */
+#define R200_SE_TCL_MATRIX_SEL_0 0x2230
+#define R200_MODELVIEW_0_SHIFT (0)
+#define R200_MODELVIEW_1_SHIFT (8)
+#define R200_MODELVIEW_2_SHIFT (16)
+#define R200_MODELVIEW_3_SHIFT (24)
+#define R200_SE_TCL_MATRIX_SEL_1 0x2234
+#define R200_IT_MODELVIEW_0_SHIFT (0)
+#define R200_IT_MODELVIEW_1_SHIFT (8)
+#define R200_IT_MODELVIEW_2_SHIFT (16)
+#define R200_IT_MODELVIEW_3_SHIFT (24)
+#define R200_SE_TCL_MATRIX_SEL_2 0x2238
+#define R200_MODELPROJECT_0_SHIFT (0)
+#define R200_MODELPROJECT_1_SHIFT (8)
+#define R200_MODELPROJECT_2_SHIFT (16)
+#define R200_MODELPROJECT_3_SHIFT (24)
+#define R200_SE_TCL_MATRIX_SEL_3 0x223c
+#define R200_TEXMAT_0_SHIFT 0
+#define R200_TEXMAT_1_SHIFT 8
+#define R200_TEXMAT_2_SHIFT 16
+#define R200_TEXMAT_3_SHIFT 24
+#define R200_SE_TCL_MATRIX_SEL_4 0x2240
+#define R200_TEXMAT_4_SHIFT 0
+#define R200_TEXMAT_5_SHIFT 8
+/* gap */
+#define R200_SE_TCL_OUTPUT_VTX_COMP_SEL 0x2250
+#define R200_OUTPUT_XYZW (1<<0)
+#define R200_OUTPUT_COLOR_0 (1<<8)
+#define R200_OUTPUT_COLOR_1 (1<<9)
+#define R200_OUTPUT_TEX_0 (1<<16)
+#define R200_OUTPUT_TEX_1 (1<<17)
+#define R200_OUTPUT_TEX_2 (1<<18)
+#define R200_OUTPUT_TEX_3 (1<<19)
+#define R200_OUTPUT_TEX_4 (1<<20)
+#define R200_OUTPUT_TEX_5 (1<<21)
+#define R200_OUTPUT_TEX_MASK (0x3f<<16)
+#define R200_OUTPUT_PT_SIZE (1<<25)
+#define R200_FORCE_INORDER_PROC (1<<31)
+#define R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0 0x2254
+#define R200_VERTEX_POSITION_ADDR__SHIFT 0x00000000
+#define R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_1 0x2258
+#define R200_VTX_COLOR_0_ADDR__SHIFT 0x00000000
+#define R200_VTX_COLOR_1_ADDR__SHIFT 0x00000008
+#define R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_2 0x225c
+#define R200_VTX_TEX_0_ADDR__SHIFT 0x00000000
+#define R200_VTX_TEX_1_ADDR__SHIFT 0x00000008
+#define R200_VTX_TEX_2_ADDR__SHIFT 0x00000010
+#define R200_VTX_TEX_3_ADDR__SHIFT 0x00000018
+#define R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_3 0x2260
+#define R200_VTX_TEX_4_ADDR__SHIFT 0x00000000
+#define R200_VTX_TEX_5_ADDR__SHIFT 0x00000008
+
+/* gap */
+#define R200_SE_TCL_LIGHT_MODEL_CTL_0 0x2268
+#define R200_LIGHTING_ENABLE (1<<0)
+#define R200_LIGHT_IN_MODELSPACE (1<<1)
+#define R200_LOCAL_VIEWER (1<<2)
+#define R200_NORMALIZE_NORMALS (1<<3)
+#define R200_RESCALE_NORMALS (1<<4)
+#define R200_SPECULAR_LIGHTS (1<<5)
+#define R200_DIFFUSE_SPECULAR_COMBINE (1<<6)
+#define R200_LIGHT_ALPHA (1<<7)
+#define R200_LOCAL_LIGHT_VEC_GL (1<<8)
+#define R200_LIGHT_NO_NORMAL_AMBIENT_ONLY (1<<9)
+#define R200_LIGHT_TWOSIDE (1<<10)
+#define R200_FRONT_SHININESS_SOURCE_SHIFT (0xb)
+#define R200_BACK_SHININESS_SOURCE_SHIFT (0xd)
+#define R200_LM0_SOURCE_MATERIAL_0 (0)
+#define R200_LM0_SOURCE_MATERIAL_1 (1)
+#define R200_LM0_SOURCE_VERTEX_SHININESS_0 (2)
+#define R200_LM0_SOURCE_VERTEX_SHININESS_1 (3)
+#define R200_SE_TCL_LIGHT_MODEL_CTL_1 0x226c
+#define R200_LM1_SOURCE_LIGHT_PREMULT (0)
+#define R200_LM1_SOURCE_MATERIAL_0 (1)
+#define R200_LM1_SOURCE_VERTEX_COLOR_0 (2)
+#define R200_LM1_SOURCE_VERTEX_COLOR_1 (3)
+#define R200_LM1_SOURCE_VERTEX_COLOR_2 (4)
+#define R200_LM1_SOURCE_VERTEX_COLOR_3 (5)
+#define R200_LM1_SOURCE_VERTEX_COLOR_4 (6)
+#define R200_LM1_SOURCE_VERTEX_COLOR_5 (7)
+#define R200_LM1_SOURCE_VERTEX_COLOR_6 (8)
+#define R200_LM1_SOURCE_VERTEX_COLOR_7 (9)
+#define R200_LM1_SOURCE_MATERIAL_1 (0xf)
+#define R200_FRONT_EMISSIVE_SOURCE_SHIFT (0)
+#define R200_FRONT_AMBIENT_SOURCE_SHIFT (4)
+#define R200_FRONT_DIFFUSE_SOURCE_SHIFT (8)
+#define R200_FRONT_SPECULAR_SOURCE_SHIFT (12)
+#define R200_BACK_EMISSIVE_SOURCE_SHIFT (16)
+#define R200_BACK_AMBIENT_SOURCE_SHIFT (20)
+#define R200_BACK_DIFFUSE_SOURCE_SHIFT (24)
+#define R200_BACK_SPECULAR_SOURCE_SHIFT (28)
+#define R200_SE_TCL_PER_LIGHT_CTL_0 0x2270
+#define R200_LIGHT_0_ENABLE (1<<0)
+#define R200_LIGHT_0_ENABLE_AMBIENT (1<<1)
+#define R200_LIGHT_0_ENABLE_SPECULAR (1<<2)
+#define R200_LIGHT_0_IS_LOCAL (1<<3)
+#define R200_LIGHT_0_IS_SPOT (1<<4)
+#define R200_LIGHT_0_DUAL_CONE (1<<5)
+#define R200_LIGHT_0_ENABLE_RANGE_ATTEN (1<<6)
+#define R200_LIGHT_0_CONSTANT_RANGE_ATTEN (1<<7)
+#define R200_LIGHT_1_ENABLE (1<<16)
+#define R200_LIGHT_1_ENABLE_AMBIENT (1<<17)
+#define R200_LIGHT_1_ENABLE_SPECULAR (1<<18)
+#define R200_LIGHT_1_IS_LOCAL (1<<19)
+#define R200_LIGHT_1_IS_SPOT (1<<20)
+#define R200_LIGHT_1_DUAL_CONE (1<<21)
+#define R200_LIGHT_1_ENABLE_RANGE_ATTEN (1<<22)
+#define R200_LIGHT_1_CONSTANT_RANGE_ATTEN (1<<23)
+#define R200_LIGHT_0_SHIFT (0)
+#define R200_LIGHT_1_SHIFT (16)
+#define R200_SE_TCL_PER_LIGHT_CTL_1 0x2274
+#define R200_LIGHT_2_SHIFT (0)
+#define R200_LIGHT_3_SHIFT (16)
+#define R200_SE_TCL_PER_LIGHT_CTL_2 0x2278
+#define R200_LIGHT_4_SHIFT (0)
+#define R200_LIGHT_5_SHIFT (16)
+#define R200_SE_TCL_PER_LIGHT_CTL_3 0x227c
+#define R200_LIGHT_6_SHIFT (0)
+#define R200_LIGHT_7_SHIFT (16)
+/* gap */
+#define R200_SE_TCL_TEX_PROC_CTL_2 0x22a8
+#define R200_TEXGEN_0_COMP_MASK_SHIFT (0)
+#define R200_TEXGEN_1_COMP_MASK_SHIFT (4)
+#define R200_TEXGEN_2_COMP_MASK_SHIFT (8)
+#define R200_TEXGEN_3_COMP_MASK_SHIFT (12)
+#define R200_TEXGEN_4_COMP_MASK_SHIFT (16)
+#define R200_TEXGEN_5_COMP_MASK_SHIFT (20)
+#define R200_SE_TCL_TEX_PROC_CTL_3 0x22ac
+#define R200_TEXGEN_0_INPUT_TEX_SHIFT (0)
+#define R200_TEXGEN_1_INPUT_TEX_SHIFT (4)
+#define R200_TEXGEN_2_INPUT_TEX_SHIFT (8)
+#define R200_TEXGEN_3_INPUT_TEX_SHIFT (12)
+#define R200_TEXGEN_4_INPUT_TEX_SHIFT (16)
+#define R200_TEXGEN_5_INPUT_TEX_SHIFT (20)
+#define R200_SE_TCL_TEX_PROC_CTL_0 0x22b0
+#define R200_TEXGEN_TEXMAT_0_ENABLE (1<<0)
+#define R200_TEXGEN_TEXMAT_1_ENABLE (1<<1)
+#define R200_TEXGEN_TEXMAT_2_ENABLE (1<<2)
+#define R200_TEXGEN_TEXMAT_3_ENABLE (1<<3)
+#define R200_TEXGEN_TEXMAT_4_ENABLE (1<<4)
+#define R200_TEXGEN_TEXMAT_5_ENABLE (1<<5)
+#define R200_TEXMAT_0_ENABLE (1<<8)
+#define R200_TEXMAT_1_ENABLE (1<<9)
+#define R200_TEXMAT_2_ENABLE (1<<10)
+#define R200_TEXMAT_3_ENABLE (1<<11)
+#define R200_TEXMAT_4_ENABLE (1<<12)
+#define R200_TEXMAT_5_ENABLE (1<<13)
+#define R200_TEXGEN_FORCE_W_TO_ONE (1<<16)
+#define R200_SE_TCL_TEX_PROC_CTL_1 0x22b4
+#define R200_TEXGEN_INPUT_MASK (0xf)
+#define R200_TEXGEN_INPUT_TEXCOORD_0 (0)
+#define R200_TEXGEN_INPUT_TEXCOORD_1 (1)
+#define R200_TEXGEN_INPUT_TEXCOORD_2 (2)
+#define R200_TEXGEN_INPUT_TEXCOORD_3 (3)
+#define R200_TEXGEN_INPUT_TEXCOORD_4 (4)
+#define R200_TEXGEN_INPUT_TEXCOORD_5 (5)
+#define R200_TEXGEN_INPUT_OBJ (8)
+#define R200_TEXGEN_INPUT_EYE (9)
+#define R200_TEXGEN_INPUT_EYE_NORMAL (0xa)
+#define R200_TEXGEN_INPUT_EYE_REFLECT (0xb)
+#define R200_TEXGEN_INPUT_SPHERE (0xd)
+#define R200_TEXGEN_0_INPUT_SHIFT (0)
+#define R200_TEXGEN_1_INPUT_SHIFT (4)
+#define R200_TEXGEN_2_INPUT_SHIFT (8)
+#define R200_TEXGEN_3_INPUT_SHIFT (12)
+#define R200_TEXGEN_4_INPUT_SHIFT (16)
+#define R200_TEXGEN_5_INPUT_SHIFT (20)
+#define R200_SE_TC_TEX_CYL_WRAP_CTL 0x22b8
+/* gap */
+#define R200_SE_TCL_UCP_VERT_BLEND_CTL 0x22c0
+#define R200_UCP_IN_CLIP_SPACE (1<<0)
+#define R200_UCP_IN_MODEL_SPACE (1<<1)
+#define R200_UCP_ENABLE_0 (1<<2)
+#define R200_UCP_ENABLE_1 (1<<3)
+#define R200_UCP_ENABLE_2 (1<<4)
+#define R200_UCP_ENABLE_3 (1<<5)
+#define R200_UCP_ENABLE_4 (1<<6)
+#define R200_UCP_ENABLE_5 (1<<7)
+#define R200_TCL_FOG_MASK (3<<8)
+#define R200_TCL_FOG_DISABLE (0<<8)
+#define R200_TCL_FOG_EXP (1<<8)
+#define R200_TCL_FOG_EXP2 (2<<8)
+#define R200_TCL_FOG_LINEAR (3<<8)
+#define R200_RNG_BASED_FOG (1<<10)
+#define R200_CLIP_DISABLE (1<<11)
+#define R200_CULL_FRONT_IS_CW (0<<28)
+#define R200_CULL_FRONT_IS_CCW (1<<28)
+#define R200_CULL_FRONT (1<<29)
+#define R200_CULL_BACK (1<<30)
+#define R200_SE_TCL_POINT_SPRITE_CNTL 0x22c4
+/* gap */
+#define R200_SE_VTX_ST_POS_0_X_4 0x2300
+#define R200_SE_VTX_ST_POS_0_Y_4 0x2304
+#define R200_SE_VTX_ST_POS_0_Z_4 0x2308
+#define R200_SE_VTX_ST_POS_0_W_4 0x230c
+#define R200_SE_VTX_ST_NORM_0_X 0x2310
+#define R200_SE_VTX_ST_NORM_0_Y 0x2314
+#define R200_SE_VTX_ST_NORM_0_Z 0x2318
+#define R200_SE_VTX_ST_PVMS 0x231c
+#define R200_SE_VTX_ST_CLR_0_R 0x2320
+#define R200_SE_VTX_ST_CLR_0_G 0x2324
+#define R200_SE_VTX_ST_CLR_0_B 0x2328
+#define R200_SE_VTX_ST_CLR_0_A 0x232c
+#define R200_SE_VTX_ST_CLR_1_R 0x2330
+#define R200_SE_VTX_ST_CLR_1_G 0x2334
+#define R200_SE_VTX_ST_CLR_1_B 0x2338
+#define R200_SE_VTX_ST_CLR_1_A 0x233c
+#define R200_SE_VTX_ST_CLR_2_R 0x2340
+#define R200_SE_VTX_ST_CLR_2_G 0x2344
+#define R200_SE_VTX_ST_CLR_2_B 0x2348
+#define R200_SE_VTX_ST_CLR_2_A 0x234c
+#define R200_SE_VTX_ST_CLR_3_R 0x2350
+#define R200_SE_VTX_ST_CLR_3_G 0x2354
+#define R200_SE_VTX_ST_CLR_3_B 0x2358
+#define R200_SE_VTX_ST_CLR_3_A 0x235c
+#define R200_SE_VTX_ST_CLR_4_R 0x2360
+#define R200_SE_VTX_ST_CLR_4_G 0x2364
+#define R200_SE_VTX_ST_CLR_4_B 0x2368
+#define R200_SE_VTX_ST_CLR_4_A 0x236c
+#define R200_SE_VTX_ST_CLR_5_R 0x2370
+#define R200_SE_VTX_ST_CLR_5_G 0x2374
+#define R200_SE_VTX_ST_CLR_5_B 0x2378
+#define R200_SE_VTX_ST_CLR_5_A 0x237c
+#define R200_SE_VTX_ST_CLR_6_R 0x2380
+#define R200_SE_VTX_ST_CLR_6_G 0x2384
+#define R200_SE_VTX_ST_CLR_6_B 0x2388
+#define R200_SE_VTX_ST_CLR_6_A 0x238c
+#define R200_SE_VTX_ST_CLR_7_R 0x2390
+#define R200_SE_VTX_ST_CLR_7_G 0x2394
+#define R200_SE_VTX_ST_CLR_7_B 0x2398
+#define R200_SE_VTX_ST_CLR_7_A 0x239c
+#define R200_SE_VTX_ST_TEX_0_S 0x23a0
+#define R200_SE_VTX_ST_TEX_0_T 0x23a4
+#define R200_SE_VTX_ST_TEX_0_R 0x23a8
+#define R200_SE_VTX_ST_TEX_0_Q 0x23ac
+#define R200_SE_VTX_ST_TEX_1_S 0x23b0
+#define R200_SE_VTX_ST_TEX_1_T 0x23b4
+#define R200_SE_VTX_ST_TEX_1_R 0x23b8
+#define R200_SE_VTX_ST_TEX_1_Q 0x23bc
+#define R200_SE_VTX_ST_TEX_2_S 0x23c0
+#define R200_SE_VTX_ST_TEX_2_T 0x23c4
+#define R200_SE_VTX_ST_TEX_2_R 0x23c8
+#define R200_SE_VTX_ST_TEX_2_Q 0x23cc
+#define R200_SE_VTX_ST_TEX_3_S 0x23d0
+#define R200_SE_VTX_ST_TEX_3_T 0x23d4
+#define R200_SE_VTX_ST_TEX_3_R 0x23d8
+#define R200_SE_VTX_ST_TEX_3_Q 0x23dc
+#define R200_SE_VTX_ST_TEX_4_S 0x23e0
+#define R200_SE_VTX_ST_TEX_4_T 0x23e4
+#define R200_SE_VTX_ST_TEX_4_R 0x23e8
+#define R200_SE_VTX_ST_TEX_4_Q 0x23ec
+#define R200_SE_VTX_ST_TEX_5_S 0x23f0
+#define R200_SE_VTX_ST_TEX_5_T 0x23f4
+#define R200_SE_VTX_ST_TEX_5_R 0x23f8
+#define R200_SE_VTX_ST_TEX_5_Q 0x23fc
+#define R200_SE_VTX_ST_PNT_SPRT_SZ 0x2400
+#define R200_SE_VTX_ST_DISC_FOG 0x2404
+#define R200_SE_VTX_ST_SHININESS_0 0x2408
+#define R200_SE_VTX_ST_SHININESS_1 0x240c
+#define R200_SE_VTX_ST_BLND_WT_0 0x2410
+#define R200_SE_VTX_ST_BLND_WT_1 0x2414
+#define R200_SE_VTX_ST_BLND_WT_2 0x2418
+#define R200_SE_VTX_ST_BLND_WT_3 0x241c
+#define R200_SE_VTX_ST_POS_1_X 0x2420
+#define R200_SE_VTX_ST_POS_1_Y 0x2424
+#define R200_SE_VTX_ST_POS_1_Z 0x2428
+#define R200_SE_VTX_ST_POS_1_W 0x242c
+#define R200_SE_VTX_ST_NORM_1_X 0x2430
+#define R200_SE_VTX_ST_NORM_1_Y 0x2434
+#define R200_SE_VTX_ST_NORM_1_Z 0x2438
+#define R200_SE_VTX_ST_USR_CLR_0_R 0x2440
+#define R200_SE_VTX_ST_USR_CLR_0_G 0x2444
+#define R200_SE_VTX_ST_USR_CLR_0_B 0x2448
+#define R200_SE_VTX_ST_USR_CLR_0_A 0x244c
+#define R200_SE_VTX_ST_USR_CLR_1_R 0x2450
+#define R200_SE_VTX_ST_USR_CLR_1_G 0x2454
+#define R200_SE_VTX_ST_USR_CLR_1_B 0x2458
+#define R200_SE_VTX_ST_USR_CLR_1_A 0x245c
+#define R200_SE_VTX_ST_CLR_0_PKD 0x2460
+#define R200_SE_VTX_ST_CLR_1_PKD 0x2464
+#define R200_SE_VTX_ST_CLR_2_PKD 0x2468
+#define R200_SE_VTX_ST_CLR_3_PKD 0x246c
+#define R200_SE_VTX_ST_CLR_4_PKD 0x2470
+#define R200_SE_VTX_ST_CLR_5_PKD 0x2474
+#define R200_SE_VTX_ST_CLR_6_PKD 0x2478
+#define R200_SE_VTX_ST_CLR_7_PKD 0x247c
+#define R200_SE_VTX_ST_POS_0_X_2 0x2480
+#define R200_SE_VTX_ST_POS_0_Y_2 0x2484
+#define R200_SE_VTX_ST_PAR_CLR_LD 0x2488
+#define R200_SE_VTX_ST_USR_CLR_PKD 0x248c
+#define R200_SE_VTX_ST_POS_0_X_3 0x2490
+#define R200_SE_VTX_ST_POS_0_Y_3 0x2494
+#define R200_SE_VTX_ST_POS_0_Z_3 0x2498
+#define R200_SE_VTX_ST_END_OF_PKT 0x249c
+/* gap */
+#define R200_RE_POINTSIZE 0x2648
+#define R200_POINTSIZE_SHIFT 0
+#define R200_MAXPOINTSIZE_SHIFT 16
+/* gap */
+#define R200_RE_TOP_LEFT 0x26c0
+#define R200_RE_LEFT_SHIFT 0
+#define R200_RE_TOP_SHIFT 16
+#define R200_RE_MISC 0x26c4
+#define R200_STIPPLE_COORD_MASK 0x1f
+#define R200_STIPPLE_X_OFFSET_SHIFT 0
+#define R200_STIPPLE_X_OFFSET_MASK (0x1f << 0)
+#define R200_STIPPLE_Y_OFFSET_SHIFT 8
+#define R200_STIPPLE_Y_OFFSET_MASK (0x1f << 8)
+#define R200_STIPPLE_LITTLE_BIT_ORDER (0 << 16)
+#define R200_STIPPLE_BIG_BIT_ORDER (1 << 16)
+/* gap */
+#define R200_RE_AUX_SCISSOR_CNTL 0x26f0
+#define R200_EXCLUSIVE_SCISSOR_0 0x01000000
+#define R200_EXCLUSIVE_SCISSOR_1 0x02000000
+#define R200_EXCLUSIVE_SCISSOR_2 0x04000000
+#define R200_SCISSOR_ENABLE_0 0x10000000
+#define R200_SCISSOR_ENABLE_1 0x20000000
+#define R200_SCISSOR_ENABLE_2 0x40000000
+/* gap */
+#define R200_PP_TXFILTER_0 0x2c00
+#define R200_MAG_FILTER_NEAREST (0 << 0)
+#define R200_MAG_FILTER_LINEAR (1 << 0)
+#define R200_MAG_FILTER_MASK (1 << 0)
+#define R200_MIN_FILTER_NEAREST (0 << 1)
+#define R200_MIN_FILTER_LINEAR (1 << 1)
+#define R200_MIN_FILTER_NEAREST_MIP_NEAREST (2 << 1)
+#define R200_MIN_FILTER_NEAREST_MIP_LINEAR (3 << 1)
+#define R200_MIN_FILTER_LINEAR_MIP_NEAREST (6 << 1)
+#define R200_MIN_FILTER_LINEAR_MIP_LINEAR (7 << 1)
+#define R200_MIN_FILTER_ANISO_NEAREST (8 << 1)
+#define R200_MIN_FILTER_ANISO_LINEAR (9 << 1)
+#define R200_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST (10 << 1)
+#define R200_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR (11 << 1)
+#define R200_MIN_FILTER_MASK (15 << 1)
+#define R200_MAX_ANISO_1_TO_1 (0 << 5)
+#define R200_MAX_ANISO_2_TO_1 (1 << 5)
+#define R200_MAX_ANISO_4_TO_1 (2 << 5)
+#define R200_MAX_ANISO_8_TO_1 (3 << 5)
+#define R200_MAX_ANISO_16_TO_1 (4 << 5)
+#define R200_MAX_ANISO_MASK (7 << 5)
+#define R200_MAX_MIP_LEVEL_MASK (0x0f << 16)
+#define R200_MAX_MIP_LEVEL_SHIFT 16
+#define R200_YUV_TO_RGB (1 << 20)
+#define R200_YUV_TEMPERATURE_COOL (0 << 21)
+#define R200_YUV_TEMPERATURE_HOT (1 << 21)
+#define R200_YUV_TEMPERATURE_MASK (1 << 21)
+#define R200_WRAPEN_S (1 << 22)
+#define R200_CLAMP_S_WRAP (0 << 23)
+#define R200_CLAMP_S_MIRROR (1 << 23)
+#define R200_CLAMP_S_CLAMP_LAST (2 << 23)
+#define R200_CLAMP_S_MIRROR_CLAMP_LAST (3 << 23)
+#define R200_CLAMP_S_CLAMP_BORDER (4 << 23)
+#define R200_CLAMP_S_MIRROR_CLAMP_BORDER (5 << 23)
+#define R200_CLAMP_S_MASK (7 << 23)
+#define R200_WRAPEN_T (1 << 26)
+#define R200_CLAMP_T_WRAP (0 << 27)
+#define R200_CLAMP_T_MIRROR (1 << 27)
+#define R200_CLAMP_T_CLAMP_LAST (2 << 27)
+#define R200_CLAMP_T_MIRROR_CLAMP_LAST (3 << 27)
+#define R200_CLAMP_T_CLAMP_BORDER (4 << 27)
+#define R200_CLAMP_T_MIRROR_CLAMP_BORDER (5 << 27)
+#define R200_CLAMP_T_MASK (7 << 27)
+#define R200_KILL_LT_ZERO (1 << 30)
+#define R200_BORDER_MODE_OGL (0 << 31)
+#define R200_BORDER_MODE_D3D (1 << 31)
+#define R200_PP_TXFORMAT_0 0x2c04
+#define R200_TXFORMAT_I8 (0 << 0)
+#define R200_TXFORMAT_AI88 (1 << 0)
+#define R200_TXFORMAT_RGB332 (2 << 0)
+#define R200_TXFORMAT_ARGB1555 (3 << 0)
+#define R200_TXFORMAT_RGB565 (4 << 0)
+#define R200_TXFORMAT_ARGB4444 (5 << 0)
+#define R200_TXFORMAT_ARGB8888 (6 << 0)
+#define R200_TXFORMAT_RGBA8888 (7 << 0)
+#define R200_TXFORMAT_Y8 (8 << 0)
+#define R200_TXFORMAT_AVYU4444 (9 << 0)
+#define R200_TXFORMAT_VYUY422 (10 << 0)
+#define R200_TXFORMAT_YVYU422 (11 << 0)
+#define R200_TXFORMAT_DXT1 (12 << 0)
+#define R200_TXFORMAT_DXT23 (14 << 0)
+#define R200_TXFORMAT_DXT45 (15 << 0)
+#define R200_TXFORMAT_FORMAT_MASK (31 << 0)
+#define R200_TXFORMAT_FORMAT_SHIFT 0
+#define R200_TXFORMAT_ALPHA_IN_MAP (1 << 6)
+#define R200_TXFORMAT_NON_POWER2 (1 << 7)
+#define R200_TXFORMAT_WIDTH_MASK (15 << 8)
+#define R200_TXFORMAT_WIDTH_SHIFT 8
+#define R200_TXFORMAT_HEIGHT_MASK (15 << 12)
+#define R200_TXFORMAT_HEIGHT_SHIFT 12
+#define R200_TXFORMAT_F5_WIDTH_MASK (15 << 16) /* cube face 5 */
+#define R200_TXFORMAT_F5_WIDTH_SHIFT 16
+#define R200_TXFORMAT_F5_HEIGHT_MASK (15 << 20)
+#define R200_TXFORMAT_F5_HEIGHT_SHIFT 20
+#define R200_TXFORMAT_ST_ROUTE_STQ0 (0 << 24)
+#define R200_TXFORMAT_ST_ROUTE_STQ1 (1 << 24)
+#define R200_TXFORMAT_ST_ROUTE_STQ2 (2 << 24)
+#define R200_TXFORMAT_ST_ROUTE_STQ3 (3 << 24)
+#define R200_TXFORMAT_ST_ROUTE_STQ4 (4 << 24)
+#define R200_TXFORMAT_ST_ROUTE_STQ5 (5 << 24)
+#define R200_TXFORMAT_ST_ROUTE_MASK (7 << 24)
+#define R200_TXFORMAT_ST_ROUTE_SHIFT 24
+#define R200_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28)
+#define R200_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29)
+#define R200_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30)
+#define R200_PP_TXFORMAT_X_0 0x2c08
+#define R200_DEPTH_LOG2_MASK (0xf << 0)
+#define R200_DEPTH_LOG2_SHIFT 0
+#define R200_VOLUME_FILTER_SHIFT 4
+#define R200_VOLUME_FILTER_MASK (1 << 4)
+#define R200_VOLUME_FILTER_NEAREST (0 << 4)
+#define R200_VOLUME_FILTER_LINEAR (1 << 4)
+#define R200_WRAPEN_Q (1 << 8)
+#define R200_CLAMP_Q_WRAP (0 << 9)
+#define R200_CLAMP_Q_MIRROR (1 << 9)
+#define R200_CLAMP_Q_CLAMP_LAST (2 << 9)
+#define R200_CLAMP_Q_MIRROR_CLAMP_LAST (3 << 9)
+#define R200_CLAMP_Q_CLAMP_BORDER (6 << 9)
+#define R200_CLAMP_Q_MIRROR_CLAMP_BORDER (7 << 9)
+#define R200_CLAMP_Q_MASK (7 << 9)
+#define R200_MIN_MIP_LEVEL_MASK (0xff << 12)
+#define R200_MIN_MIP_LEVEL_SHIFT 12
+#define R200_TEXCOORD_NONPROJ (0 << 16)
+#define R200_TEXCOORD_CUBIC_ENV (1 << 16)
+#define R200_TEXCOORD_VOLUME (2 << 16)
+#define R200_TEXCOORD_PROJ (3 << 16)
+#define R200_TEXCOORD_DEPTH (4 << 16)
+#define R200_TEXCOORD_1D_PROJ (5 << 16)
+#define R200_TEXCOORD_1D (6 << 16)
+#define R200_TEXCOORD_ZERO (7 << 16)
+#define R200_TEXCOORD_MASK (7 << 16)
+#define R200_LOD_BIAS_MASK (0xfff80000)
+#define R200_LOD_BIAS_SHIFT 19
+#define R200_PP_TXSIZE_0 0x2c0c /* NPOT only */
+#define R200_PP_TXPITCH_0 0x2c10 /* NPOT only */
+#define R200_PP_BORDER_COLOR_0 0x2c14
+#define R200_PP_CUBIC_FACES_0 0x2c18
+#define R200_FACE_WIDTH_1_SHIFT 0
+#define R200_FACE_HEIGHT_1_SHIFT 4
+#define R200_FACE_WIDTH_1_MASK (0xf << 0)
+#define R200_FACE_HEIGHT_1_MASK (0xf << 4)
+#define R200_FACE_WIDTH_2_SHIFT 8
+#define R200_FACE_HEIGHT_2_SHIFT 12
+#define R200_FACE_WIDTH_2_MASK (0xf << 8)
+#define R200_FACE_HEIGHT_2_MASK (0xf << 12)
+#define R200_FACE_WIDTH_3_SHIFT 16
+#define R200_FACE_HEIGHT_3_SHIFT 20
+#define R200_FACE_WIDTH_3_MASK (0xf << 16)
+#define R200_FACE_HEIGHT_3_MASK (0xf << 20)
+#define R200_FACE_WIDTH_4_SHIFT 24
+#define R200_FACE_HEIGHT_4_SHIFT 28
+#define R200_FACE_WIDTH_4_MASK (0xf << 24)
+#define R200_FACE_HEIGHT_4_MASK (0xf << 28)
+#define R200_PP_TXFILTER_1 0x2c20
+#define R200_PP_TXFORMAT_1 0x2c24
+#define R200_PP_TXFORMAT_X_1 0x2c28
+#define R200_PP_TXSIZE_1 0x2c2c
+#define R200_PP_TXPITCH_1 0x2c30
+#define R200_PP_BORDER_COLOR_1 0x2c34
+#define R200_PP_CUBIC_FACES_1 0x2c38
+#define R200_PP_TXFILTER_2 0x2c40
+#define R200_PP_TXFORMAT_2 0x2c44
+#define R200_PP_TXSIZE_2 0x2c4c
+#define R200_PP_TXFORMAT_X_2 0x2c48
+#define R200_PP_TXPITCH_2 0x2c50
+#define R200_PP_BORDER_COLOR_2 0x2c54
+#define R200_PP_CUBIC_FACES_2 0x2c58
+#define R200_PP_TXFILTER_3 0x2c60
+#define R200_PP_TXFORMAT_3 0x2c64
+#define R200_PP_TXSIZE_3 0x2c6c
+#define R200_PP_TXFORMAT_X_3 0x2c68
+#define R200_PP_TXPITCH_3 0x2c70
+#define R200_PP_BORDER_COLOR_3 0x2c74
+#define R200_PP_CUBIC_FACES_3 0x2c78
+#define R200_PP_TXFILTER_4 0x2c80
+#define R200_PP_TXFORMAT_4 0x2c84
+#define R200_PP_TXSIZE_4 0x2c8c
+#define R200_PP_TXFORMAT_X_4 0x2c88
+#define R200_PP_TXPITCH_4 0x2c90
+#define R200_PP_BORDER_COLOR_4 0x2c94
+#define R200_PP_CUBIC_FACES_4 0x2c98
+#define R200_PP_TXFILTER_5 0x2ca0
+#define R200_PP_TXFORMAT_5 0x2ca4
+#define R200_PP_TXSIZE_5 0x2cac
+#define R200_PP_TXFORMAT_X_5 0x2ca8
+#define R200_PP_TXPITCH_5 0x2cb0
+#define R200_PP_BORDER_COLOR_5 0x2cb4
+#define R200_PP_CUBIC_FACES_5 0x2cb8
+/* gap */
+#define R200_PP_CNTL_X 0x2cc4
+/* gap */
+#define R200_PP_TXOFFSET_0 0x2d00
+#define R200_TXO_ENDIAN_NO_SWAP (0 << 0)
+#define R200_TXO_ENDIAN_BYTE_SWAP (1 << 0)
+#define R200_TXO_ENDIAN_WORD_SWAP (2 << 0)
+#define R200_TXO_ENDIAN_HALFDW_SWAP (3 << 0)
+#define R200_TXO_OFFSET_MASK 0xffffffe0
+#define R200_TXO_OFFSET_SHIFT 5
+#define R200_PP_CUBIC_OFFSET_F1_0 0x2d04
+#define R200_PP_CUBIC_OFFSET_F2_0 0x2d08
+#define R200_PP_CUBIC_OFFSET_F3_0 0x2d0c
+#define R200_PP_CUBIC_OFFSET_F4_0 0x2d10
+#define R200_PP_CUBIC_OFFSET_F5_0 0x2d14
+#define R200_PP_TXOFFSET_1 0x2d18
+#define R200_PP_CUBIC_OFFSET_F1_1 0x2d1c
+#define R200_PP_CUBIC_OFFSET_F2_1 0x2d20
+#define R200_PP_CUBIC_OFFSET_F3_1 0x2d24
+#define R200_PP_CUBIC_OFFSET_F4_1 0x2d28
+#define R200_PP_CUBIC_OFFSET_F5_1 0x2d2c
+#define R200_PP_TXOFFSET_2 0x2d30
+#define R200_PP_CUBIC_OFFSET_F1_2 0x2d34
+#define R200_PP_CUBIC_OFFSET_F2_2 0x2d38
+#define R200_PP_CUBIC_OFFSET_F3_2 0x2d3c
+#define R200_PP_CUBIC_OFFSET_F4_2 0x2d40
+#define R200_PP_CUBIC_OFFSET_F5_2 0x2d44
+#define R200_PP_TXOFFSET_3 0x2d48
+#define R200_PP_CUBIC_OFFSET_F1_3 0x2d4c
+#define R200_PP_CUBIC_OFFSET_F2_3 0x2d50
+#define R200_PP_CUBIC_OFFSET_F3_3 0x2d54
+#define R200_PP_CUBIC_OFFSET_F4_3 0x2d58
+#define R200_PP_CUBIC_OFFSET_F5_3 0x2d5c
+#define R200_PP_TXOFFSET_4 0x2d60
+#define R200_PP_CUBIC_OFFSET_F1_4 0x2d64
+#define R200_PP_CUBIC_OFFSET_F2_4 0x2d68
+#define R200_PP_CUBIC_OFFSET_F3_4 0x2d6c
+#define R200_PP_CUBIC_OFFSET_F4_4 0x2d70
+#define R200_PP_CUBIC_OFFSET_F5_4 0x2d74
+#define R200_PP_TXOFFSET_5 0x2d78
+#define R200_PP_CUBIC_OFFSET_F1_5 0x2d7c
+#define R200_PP_CUBIC_OFFSET_F2_5 0x2d80
+#define R200_PP_CUBIC_OFFSET_F3_5 0x2d84
+#define R200_PP_CUBIC_OFFSET_F4_5 0x2d88
+#define R200_PP_CUBIC_OFFSET_F5_5 0x2d8c
+/* gap */
+#define R200_PP_TAM_DEBUG3 0x2d9c
+/* gap */
+#define R200_PP_TFACTOR_0 0x2ee0
+#define R200_PP_TFACTOR_1 0x2ee4
+#define R200_PP_TFACTOR_2 0x2ee8
+#define R200_PP_TFACTOR_3 0x2eec
+#define R200_PP_TFACTOR_4 0x2ef0
+#define R200_PP_TFACTOR_5 0x2ef4
+/* gap */
+#define R200_PP_TXCBLEND_0 0x2f00
+#define R200_TXC_ARG_A_ZERO (0)
+#define R200_TXC_ARG_A_CURRENT_COLOR (2)
+#define R200_TXC_ARG_A_CURRENT_ALPHA (3)
+#define R200_TXC_ARG_A_DIFFUSE_COLOR (4)
+#define R200_TXC_ARG_A_DIFFUSE_ALPHA (5)
+#define R200_TXC_ARG_A_SPECULAR_COLOR (6)
+#define R200_TXC_ARG_A_SPECULAR_ALPHA (7)
+#define R200_TXC_ARG_A_TFACTOR_COLOR (8)
+#define R200_TXC_ARG_A_TFACTOR_ALPHA (9)
+#define R200_TXC_ARG_A_R0_COLOR (10)
+#define R200_TXC_ARG_A_R0_ALPHA (11)
+#define R200_TXC_ARG_A_R1_COLOR (12)
+#define R200_TXC_ARG_A_R1_ALPHA (13)
+#define R200_TXC_ARG_A_R2_COLOR (14)
+#define R200_TXC_ARG_A_R2_ALPHA (15)
+#define R200_TXC_ARG_A_R3_COLOR (16)
+#define R200_TXC_ARG_A_R3_ALPHA (17)
+#define R200_TXC_ARG_A_R4_COLOR (18)
+#define R200_TXC_ARG_A_R4_ALPHA (19)
+#define R200_TXC_ARG_A_R5_COLOR (20)
+#define R200_TXC_ARG_A_R5_ALPHA (21)
+#define R200_TXC_ARG_A_TFACTOR1_COLOR (26)
+#define R200_TXC_ARG_A_TFACTOR1_ALPHA (27)
+#define R200_TXC_ARG_A_MASK (31 << 0)
+#define R200_TXC_ARG_A_SHIFT 0
+#define R200_TXC_ARG_B_ZERO (0<<5)
+#define R200_TXC_ARG_B_CURRENT_COLOR (2<<5)
+#define R200_TXC_ARG_B_CURRENT_ALPHA (3<<5)
+#define R200_TXC_ARG_B_DIFFUSE_COLOR (4<<5)
+#define R200_TXC_ARG_B_DIFFUSE_ALPHA (5<<5)
+#define R200_TXC_ARG_B_SPECULAR_COLOR (6<<5)
+#define R200_TXC_ARG_B_SPECULAR_ALPHA (7<<5)
+#define R200_TXC_ARG_B_TFACTOR_COLOR (8<<5)
+#define R200_TXC_ARG_B_TFACTOR_ALPHA (9<<5)
+#define R200_TXC_ARG_B_R0_COLOR (10<<5)
+#define R200_TXC_ARG_B_R0_ALPHA (11<<5)
+#define R200_TXC_ARG_B_R1_COLOR (12<<5)
+#define R200_TXC_ARG_B_R1_ALPHA (13<<5)
+#define R200_TXC_ARG_B_R2_COLOR (14<<5)
+#define R200_TXC_ARG_B_R2_ALPHA (15<<5)
+#define R200_TXC_ARG_B_R3_COLOR (16<<5)
+#define R200_TXC_ARG_B_R3_ALPHA (17<<5)
+#define R200_TXC_ARG_B_R4_COLOR (18<<5)
+#define R200_TXC_ARG_B_R4_ALPHA (19<<5)
+#define R200_TXC_ARG_B_R5_COLOR (20<<5)
+#define R200_TXC_ARG_B_R5_ALPHA (21<<5)
+#define R200_TXC_ARG_B_TFACTOR1_COLOR (26<<5)
+#define R200_TXC_ARG_B_TFACTOR1_ALPHA (27<<5)
+#define R200_TXC_ARG_B_MASK (31 << 5)
+#define R200_TXC_ARG_B_SHIFT 5
+#define R200_TXC_ARG_C_ZERO (0<<10)
+#define R200_TXC_ARG_C_CURRENT_COLOR (2<<10)
+#define R200_TXC_ARG_C_CURRENT_ALPHA (3<<10)
+#define R200_TXC_ARG_C_DIFFUSE_COLOR (4<<10)
+#define R200_TXC_ARG_C_DIFFUSE_ALPHA (5<<10)
+#define R200_TXC_ARG_C_SPECULAR_COLOR (6<<10)
+#define R200_TXC_ARG_C_SPECULAR_ALPHA (7<<10)
+#define R200_TXC_ARG_C_TFACTOR_COLOR (8<<10)
+#define R200_TXC_ARG_C_TFACTOR_ALPHA (9<<10)
+#define R200_TXC_ARG_C_R0_COLOR (10<<10)
+#define R200_TXC_ARG_C_R0_ALPHA (11<<10)
+#define R200_TXC_ARG_C_R1_COLOR (12<<10)
+#define R200_TXC_ARG_C_R1_ALPHA (13<<10)
+#define R200_TXC_ARG_C_R2_COLOR (14<<10)
+#define R200_TXC_ARG_C_R2_ALPHA (15<<10)
+#define R200_TXC_ARG_C_R3_COLOR (16<<10)
+#define R200_TXC_ARG_C_R3_ALPHA (17<<10)
+#define R200_TXC_ARG_C_R4_COLOR (18<<10)
+#define R200_TXC_ARG_C_R4_ALPHA (19<<10)
+#define R200_TXC_ARG_C_R5_COLOR (20<<10)
+#define R200_TXC_ARG_C_R5_ALPHA (21<<10)
+#define R200_TXC_ARG_C_TFACTOR1_COLOR (26<<10)
+#define R200_TXC_ARG_C_TFACTOR1_ALPHA (27<<10)
+#define R200_TXC_ARG_C_MASK (31 << 10)
+#define R200_TXC_ARG_C_SHIFT 10
+#define R200_TXC_COMP_ARG_A (1 << 16)
+#define R200_TXC_COMP_ARG_A_SHIFT (16)
+#define R200_TXC_BIAS_ARG_A (1 << 17)
+#define R200_TXC_SCALE_ARG_A (1 << 18)
+#define R200_TXC_NEG_ARG_A (1 << 19)
+#define R200_TXC_COMP_ARG_B (1 << 20)
+#define R200_TXC_COMP_ARG_B_SHIFT (20)
+#define R200_TXC_BIAS_ARG_B (1 << 21)
+#define R200_TXC_SCALE_ARG_B (1 << 22)
+#define R200_TXC_NEG_ARG_B (1 << 23)
+#define R200_TXC_COMP_ARG_C (1 << 24)
+#define R200_TXC_COMP_ARG_C_SHIFT (24)
+#define R200_TXC_BIAS_ARG_C (1 << 25)
+#define R200_TXC_SCALE_ARG_C (1 << 26)
+#define R200_TXC_NEG_ARG_C (1 << 27)
+#define R200_TXC_OP_MADD (0 << 28)
+#define R200_TXC_OP_CND0 (2 << 28)
+#define R200_TXC_OP_LERP (3 << 28)
+#define R200_TXC_OP_DOT3 (4 << 28)
+#define R200_TXC_OP_DOT4 (5 << 28)
+#define R200_TXC_OP_CONDITIONAL (6 << 28)
+#define R200_TXC_OP_DOT2_ADD (7 << 28)
+#define R200_TXC_OP_MASK (7 << 28)
+#define R200_PP_TXCBLEND2_0 0x2f04
+#define R200_TXC_TFACTOR_SEL_SHIFT 0
+#define R200_TXC_TFACTOR_SEL_MASK 0x7
+#define R200_TXC_TFACTOR1_SEL_SHIFT 4
+#define R200_TXC_TFACTOR1_SEL_MASK (0x7 << 4)
+#define R200_TXC_SCALE_SHIFT 8
+#define R200_TXC_SCALE_MASK (7 << 8)
+#define R200_TXC_SCALE_1X (0 << 8)
+#define R200_TXC_SCALE_2X (1 << 8)
+#define R200_TXC_SCALE_4X (2 << 8)
+#define R200_TXC_SCALE_8X (3 << 8)
+#define R200_TXC_SCALE_INV2 (5 << 8)
+#define R200_TXC_SCALE_INV4 (6 << 8)
+#define R200_TXC_SCALE_INV8 (7 << 8)
+#define R200_TXC_CLAMP_SHIFT 12
+#define R200_TXC_CLAMP_MASK (3 << 12)
+#define R200_TXC_CLAMP_WRAP (0 << 12)
+#define R200_TXC_CLAMP_0_1 (1 << 12)
+#define R200_TXC_CLAMP_8_8 (2 << 12)
+#define R200_TXC_OUTPUT_REG_MASK (7 << 16)
+#define R200_TXC_OUTPUT_REG_NONE (0 << 16)
+#define R200_TXC_OUTPUT_REG_R0 (1 << 16)
+#define R200_TXC_OUTPUT_REG_R1 (2 << 16)
+#define R200_TXC_OUTPUT_REG_R2 (3 << 16)
+#define R200_TXC_OUTPUT_REG_R3 (4 << 16)
+#define R200_TXC_OUTPUT_REG_R4 (5 << 16)
+#define R200_TXC_OUTPUT_REG_R5 (6 << 16)
+#define R200_TXC_OUTPUT_MASK_MASK (7 << 20)
+#define R200_TXC_OUTPUT_MASK_RGB (0 << 20)
+#define R200_TXC_OUTPUT_MASK_RG (1 << 20)
+#define R200_TXC_OUTPUT_MASK_RB (2 << 20)
+#define R200_TXC_OUTPUT_MASK_R (3 << 20)
+#define R200_TXC_OUTPUT_MASK_GB (4 << 20)
+#define R200_TXC_OUTPUT_MASK_G (5 << 20)
+#define R200_TXC_OUTPUT_MASK_B (6 << 20)
+#define R200_TXC_OUTPUT_MASK_NONE (7 << 20)
+#define R200_TXC_REPL_NORMAL 0
+#define R200_TXC_REPL_RED 1
+#define R200_TXC_REPL_GREEN 2
+#define R200_TXC_REPL_BLUE 3
+#define R200_TXC_REPL_ARG_A_SHIFT 26
+#define R200_TXC_REPL_ARG_A_MASK (3 << 26)
+#define R200_TXC_REPL_ARG_B_SHIFT 28
+#define R200_TXC_REPL_ARG_B_MASK (3 << 28)
+#define R200_TXC_REPL_ARG_C_SHIFT 30
+#define R200_TXC_REPL_ARG_C_MASK (3 << 30)
+#define R200_PP_TXABLEND_0 0x2f08
+#define R200_TXA_ARG_A_ZERO (0)
+#define R200_TXA_ARG_A_CURRENT_ALPHA (2) /* guess */
+#define R200_TXA_ARG_A_CURRENT_BLUE (3) /* guess */
+#define R200_TXA_ARG_A_DIFFUSE_ALPHA (4)
+#define R200_TXA_ARG_A_DIFFUSE_BLUE (5)
+#define R200_TXA_ARG_A_SPECULAR_ALPHA (6)
+#define R200_TXA_ARG_A_SPECULAR_BLUE (7)
+#define R200_TXA_ARG_A_TFACTOR_ALPHA (8)
+#define R200_TXA_ARG_A_TFACTOR_BLUE (9)
+#define R200_TXA_ARG_A_R0_ALPHA (10)
+#define R200_TXA_ARG_A_R0_BLUE (11)
+#define R200_TXA_ARG_A_R1_ALPHA (12)
+#define R200_TXA_ARG_A_R1_BLUE (13)
+#define R200_TXA_ARG_A_R2_ALPHA (14)
+#define R200_TXA_ARG_A_R2_BLUE (15)
+#define R200_TXA_ARG_A_R3_ALPHA (16)
+#define R200_TXA_ARG_A_R3_BLUE (17)
+#define R200_TXA_ARG_A_R4_ALPHA (18)
+#define R200_TXA_ARG_A_R4_BLUE (19)
+#define R200_TXA_ARG_A_R5_ALPHA (20)
+#define R200_TXA_ARG_A_R5_BLUE (21)
+#define R200_TXA_ARG_A_TFACTOR1_ALPHA (26)
+#define R200_TXA_ARG_A_TFACTOR1_BLUE (27)
+#define R200_TXA_ARG_A_MASK (31 << 0)
+#define R200_TXA_ARG_A_SHIFT 0
+#define R200_TXA_ARG_B_ZERO (0<<5)
+#define R200_TXA_ARG_B_CURRENT_ALPHA (2<<5) /* guess */
+#define R200_TXA_ARG_B_CURRENT_BLUE (3<<5) /* guess */
+#define R200_TXA_ARG_B_DIFFUSE_ALPHA (4<<5)
+#define R200_TXA_ARG_B_DIFFUSE_BLUE (5<<5)
+#define R200_TXA_ARG_B_SPECULAR_ALPHA (6<<5)
+#define R200_TXA_ARG_B_SPECULAR_BLUE (7<<5)
+#define R200_TXA_ARG_B_TFACTOR_ALPHA (8<<5)
+#define R200_TXA_ARG_B_TFACTOR_BLUE (9<<5)
+#define R200_TXA_ARG_B_R0_ALPHA (10<<5)
+#define R200_TXA_ARG_B_R0_BLUE (11<<5)
+#define R200_TXA_ARG_B_R1_ALPHA (12<<5)
+#define R200_TXA_ARG_B_R1_BLUE (13<<5)
+#define R200_TXA_ARG_B_R2_ALPHA (14<<5)
+#define R200_TXA_ARG_B_R2_BLUE (15<<5)
+#define R200_TXA_ARG_B_R3_ALPHA (16<<5)
+#define R200_TXA_ARG_B_R3_BLUE (17<<5)
+#define R200_TXA_ARG_B_R4_ALPHA (18<<5)
+#define R200_TXA_ARG_B_R4_BLUE (19<<5)
+#define R200_TXA_ARG_B_R5_ALPHA (20<<5)
+#define R200_TXA_ARG_B_R5_BLUE (21<<5)
+#define R200_TXA_ARG_B_TFACTOR1_ALPHA (26<<5)
+#define R200_TXA_ARG_B_TFACTOR1_BLUE (27<<5)
+#define R200_TXA_ARG_B_MASK (31 << 5)
+#define R200_TXA_ARG_B_SHIFT 5
+#define R200_TXA_ARG_C_ZERO (0<<10)
+#define R200_TXA_ARG_C_CURRENT_ALPHA (2<<10) /* guess */
+#define R200_TXA_ARG_C_CURRENT_BLUE (3<<10) /* guess */
+#define R200_TXA_ARG_C_DIFFUSE_ALPHA (4<<10)
+#define R200_TXA_ARG_C_DIFFUSE_BLUE (5<<10)
+#define R200_TXA_ARG_C_SPECULAR_ALPHA (6<<10)
+#define R200_TXA_ARG_C_SPECULAR_BLUE (7<<10)
+#define R200_TXA_ARG_C_TFACTOR_ALPHA (8<<10)
+#define R200_TXA_ARG_C_TFACTOR_BLUE (9<<10)
+#define R200_TXA_ARG_C_R0_ALPHA (10<<10)
+#define R200_TXA_ARG_C_R0_BLUE (11<<10)
+#define R200_TXA_ARG_C_R1_ALPHA (12<<10)
+#define R200_TXA_ARG_C_R1_BLUE (13<<10)
+#define R200_TXA_ARG_C_R2_ALPHA (14<<10)
+#define R200_TXA_ARG_C_R2_BLUE (15<<10)
+#define R200_TXA_ARG_C_R3_ALPHA (16<<10)
+#define R200_TXA_ARG_C_R3_BLUE (17<<10)
+#define R200_TXA_ARG_C_R4_ALPHA (18<<10)
+#define R200_TXA_ARG_C_R4_BLUE (19<<10)
+#define R200_TXA_ARG_C_R5_ALPHA (20<<10)
+#define R200_TXA_ARG_C_R5_BLUE (21<<10)
+#define R200_TXA_ARG_C_TFACTOR1_ALPHA (26<<10)
+#define R200_TXA_ARG_C_TFACTOR1_BLUE (27<<10)
+#define R200_TXA_ARG_C_MASK (31 << 10)
+#define R200_TXA_ARG_C_SHIFT 10
+#define R200_TXA_COMP_ARG_A (1 << 16)
+#define R200_TXA_COMP_ARG_A_SHIFT (16)
+#define R200_TXA_BIAS_ARG_A (1 << 17)
+#define R200_TXA_SCALE_ARG_A (1 << 18)
+#define R200_TXA_NEG_ARG_A (1 << 19)
+#define R200_TXA_COMP_ARG_B (1 << 20)
+#define R200_TXA_COMP_ARG_B_SHIFT (20)
+#define R200_TXA_BIAS_ARG_B (1 << 21)
+#define R200_TXA_SCALE_ARG_B (1 << 22)
+#define R200_TXA_NEG_ARG_B (1 << 23)
+#define R200_TXA_COMP_ARG_C (1 << 24)
+#define R200_TXA_COMP_ARG_C_SHIFT (24)
+#define R200_TXA_BIAS_ARG_C (1 << 25)
+#define R200_TXA_SCALE_ARG_C (1 << 26)
+#define R200_TXA_NEG_ARG_C (1 << 27)
+#define R200_TXA_OP_MADD (0 << 28)
+#define R200_TXA_OP_CND0 (2 << 28)
+#define R200_TXA_OP_LERP (3 << 28)
+#define R200_TXA_OP_CONDITIONAL (6 << 28)
+#define R200_TXA_OP_MASK (7 << 28)
+#define R200_PP_TXABLEND2_0 0x2f0c
+#define R200_TXA_TFACTOR_SEL_SHIFT 0
+#define R200_TXA_TFACTOR_SEL_MASK 0x7
+#define R200_TXA_TFACTOR1_SEL_SHIFT 4
+#define R200_TXA_TFACTOR1_SEL_MASK (0x7 << 4)
+#define R200_TXA_SCALE_SHIFT 8
+#define R200_TXA_SCALE_MASK (7 << 8)
+#define R200_TXA_SCALE_1X (0 << 8)
+#define R200_TXA_SCALE_2X (1 << 8)
+#define R200_TXA_SCALE_4X (2 << 8)
+#define R200_TXA_SCALE_8X (3 << 8)
+#define R200_TXA_SCALE_INV2 (5 << 8)
+#define R200_TXA_SCALE_INV4 (6 << 8)
+#define R200_TXA_SCALE_INV8 (7 << 8)
+#define R200_TXA_CLAMP_SHIFT 12
+#define R200_TXA_CLAMP_MASK (3 << 12)
+#define R200_TXA_CLAMP_WRAP (0 << 12)
+#define R200_TXA_CLAMP_0_1 (1 << 12)
+#define R200_TXA_CLAMP_8_8 (2 << 12)
+#define R200_TXA_OUTPUT_REG_MASK (7 << 16)
+#define R200_TXA_OUTPUT_REG_NONE (0 << 16)
+#define R200_TXA_OUTPUT_REG_R0 (1 << 16)
+#define R200_TXA_OUTPUT_REG_R1 (2 << 16)
+#define R200_TXA_OUTPUT_REG_R2 (3 << 16)
+#define R200_TXA_OUTPUT_REG_R3 (4 << 16)
+#define R200_TXA_OUTPUT_REG_R4 (5 << 16)
+#define R200_TXA_OUTPUT_REG_R5 (6 << 16)
+#define R200_TXA_DOT_ALPHA (1 << 20)
+#define R200_TXA_REPL_NORMAL 0
+#define R200_TXA_REPL_RED 1
+#define R200_TXA_REPL_GREEN 2
+#define R200_TXA_REPL_ARG_A_SHIFT 26
+#define R200_TXA_REPL_ARG_A_MASK (3 << 26)
+#define R200_TXA_REPL_ARG_B_SHIFT 28
+#define R200_TXA_REPL_ARG_B_MASK (3 << 28)
+#define R200_TXA_REPL_ARG_C_SHIFT 30
+#define R200_TXA_REPL_ARG_C_MASK (3 << 30)
+#define R200_PP_TXCBLEND_1 0x2f10
+#define R200_PP_TXCBLEND2_1 0x2f14
+#define R200_PP_TXABLEND_1 0x2f18
+#define R200_PP_TXABLEND2_1 0x2f1c
+#define R200_PP_TXCBLEND_2 0x2f20
+#define R200_PP_TXCBLEND2_2 0x2f24
+#define R200_PP_TXABLEND_2 0x2f28
+#define R200_PP_TXABLEND2_2 0x2f2c
+#define R200_PP_TXCBLEND_3 0x2f30
+#define R200_PP_TXCBLEND2_3 0x2f34
+#define R200_PP_TXABLEND_3 0x2f38
+#define R200_PP_TXABLEND2_3 0x2f3c
+#define R200_PP_TXCBLEND_4 0x2f40
+#define R200_PP_TXCBLEND2_4 0x2f44
+#define R200_PP_TXABLEND_4 0x2f48
+#define R200_PP_TXABLEND2_4 0x2f4c
+#define R200_PP_TXCBLEND_5 0x2f50
+#define R200_PP_TXCBLEND2_5 0x2f54
+#define R200_PP_TXABLEND_5 0x2f58
+#define R200_PP_TXABLEND2_5 0x2f5c
+#define R200_PP_TXCBLEND_6 0x2f60
+#define R200_PP_TXCBLEND2_6 0x2f64
+#define R200_PP_TXABLEND_6 0x2f68
+#define R200_PP_TXABLEND2_6 0x2f6c
+#define R200_PP_TXCBLEND_7 0x2f70
+#define R200_PP_TXCBLEND2_7 0x2f74
+#define R200_PP_TXABLEND_7 0x2f78
+#define R200_PP_TXABLEND2_7 0x2f7c
+/* gap */
+#define R200_RB3D_ABLENDCNTL 0x321C /* see BLENDCTL */
+#define R200_RB3D_CBLENDCNTL 0x3220 /* see BLENDCTL */
+
+
+/*
+ * Offsets in TCL vector state. NOTE: Hardwiring matrix positions.
+ * Multiple contexts could collaberate to eliminate state bouncing.
+ */
+#define R200_VS_LIGHT_AMBIENT_ADDR 0x00000028
+#define R200_VS_LIGHT_DIFFUSE_ADDR 0x00000030
+#define R200_VS_LIGHT_SPECULAR_ADDR 0x00000038
+#define R200_VS_LIGHT_DIRPOS_ADDR 0x00000040
+#define R200_VS_LIGHT_HWVSPOT_ADDR 0x00000048
+#define R200_VS_LIGHT_ATTENUATION_ADDR 0x00000050
+#define R200_VS_SPOT_DUAL_CONE 0x00000058
+#define R200_VS_GLOBAL_AMBIENT_ADDR 0x0000005C
+#define R200_VS_FOG_PARAM_ADDR 0x0000005D
+#define R200_VS_EYE_VECTOR_ADDR 0x0000005E
+#define R200_VS_UCP_ADDR 0x00000060
+#define R200_VS_PNT_SPRITE_VPORT_SCALE 0x00000068
+#define R200_VS_MATRIX_0_MV 0x00000080
+#define R200_VS_MATRIX_1_INV_MV 0x00000084
+#define R200_VS_MATRIX_2_MVP 0x00000088
+#define R200_VS_MATRIX_3_TEX0 0x0000008C
+#define R200_VS_MATRIX_4_TEX1 0x00000090
+#define R200_VS_MATRIX_5_TEX2 0x00000094
+#define R200_VS_MATRIX_6_TEX3 0x00000098
+#define R200_VS_MATRIX_7_TEX4 0x0000009C
+#define R200_VS_MATRIX_8_TEX5 0x000000A0
+#define R200_VS_MAT_0_EMISS 0x000000B0
+#define R200_VS_MAT_0_AMB 0x000000B1
+#define R200_VS_MAT_0_DIF 0x000000B2
+#define R200_VS_MAT_0_SPEC 0x000000B3
+#define R200_VS_MAT_1_EMISS 0x000000B4
+#define R200_VS_MAT_1_AMB 0x000000B5
+#define R200_VS_MAT_1_DIF 0x000000B6
+#define R200_VS_MAT_1_SPEC 0x000000B7
+#define R200_VS_EYE2CLIP_MTX 0x000000B8
+#define R200_VS_PNT_SPRITE_ATT_CONST 0x000000BC
+#define R200_VS_PNT_SPRITE_EYE_IN_MODEL 0x000000BD
+#define R200_VS_PNT_SPRITE_CLAMP 0x000000BE
+#define R200_VS_MAX 0x000001C0
+
+
+/*
+ * Offsets in TCL scalar state
+ */
+#define R200_SS_LIGHT_DCD_ADDR 0x00000000
+#define R200_SS_LIGHT_DCM_ADDR 0x00000008
+#define R200_SS_LIGHT_SPOT_EXPONENT_ADDR 0x00000010
+#define R200_SS_LIGHT_SPOT_CUTOFF_ADDR 0x00000018
+#define R200_SS_LIGHT_SPECULAR_THRESH_ADDR 0x00000020
+#define R200_SS_LIGHT_RANGE_CUTOFF_SQRD 0x00000028
+#define R200_SS_LIGHT_RANGE_ATT_CONST 0x00000030
+#define R200_SS_VERT_GUARD_CLIP_ADJ_ADDR 0x00000080
+#define R200_SS_VERT_GUARD_DISCARD_ADJ_ADDR 0x00000081
+#define R200_SS_HORZ_GUARD_CLIP_ADJ_ADDR 0x00000082
+#define R200_SS_HORZ_GUARD_DISCARD_ADJ_ADDR 0x00000083
+#define R200_SS_MAT_0_SHININESS 0x00000100
+#define R200_SS_MAT_1_SHININESS 0x00000101
+
+
+/*
+ * Matrix indices
+ */
+#define R200_MTX_MV 0
+#define R200_MTX_IMV 1
+#define R200_MTX_MVP 2
+#define R200_MTX_TEX0 3
+#define R200_MTX_TEX1 4
+#define R200_MTX_TEX2 5
+#define R200_MTX_TEX3 6
+#define R200_MTX_TEX4 7
+#define R200_MTX_TEX5 8
+
+/* Color formats for 2d packets
+ */
+#define R200_CP_COLOR_FORMAT_CI8 2
+#define R200_CP_COLOR_FORMAT_ARGB1555 3
+#define R200_CP_COLOR_FORMAT_RGB565 4
+#define R200_CP_COLOR_FORMAT_ARGB8888 6
+#define R200_CP_COLOR_FORMAT_RGB332 7
+#define R200_CP_COLOR_FORMAT_RGB8 9
+#define R200_CP_COLOR_FORMAT_ARGB4444 15
+
+
+/*
+ * CP type-3 packets
+ */
+#define R200_CP_CMD_NOP 0xC0001000
+#define R200_CP_CMD_NEXT_CHAR 0xC0001900
+#define R200_CP_CMD_PLY_NEXTSCAN 0xC0001D00
+#define R200_CP_CMD_SET_SCISSORS 0xC0001E00
+#define R200_CP_CMD_LOAD_MICROCODE 0xC0002400
+#define R200_CP_CMD_WAIT_FOR_IDLE 0xC0002600
+#define R200_CP_CMD_3D_DRAW_VBUF 0xC0002800
+#define R200_CP_CMD_3D_DRAW_IMMD 0xC0002900
+#define R200_CP_CMD_3D_DRAW_INDX 0xC0002A00
+#define R200_CP_CMD_LOAD_PALETTE 0xC0002C00
+#define R200_CP_CMD_3D_LOAD_VBPNTR 0xC0002F00
+#define R200_CP_CMD_INDX_BUFFER 0xC0003300
+#define R200_CP_CMD_3D_DRAW_VBUF_2 0xC0003400
+#define R200_CP_CMD_3D_DRAW_IMMD_2 0xC0003500
+#define R200_CP_CMD_3D_DRAW_INDX_2 0xC0003600
+#define R200_CP_CMD_PAINT 0xC0009100
+#define R200_CP_CMD_BITBLT 0xC0009200
+#define R200_CP_CMD_SMALLTEXT 0xC0009300
+#define R200_CP_CMD_HOSTDATA_BLT 0xC0009400
+#define R200_CP_CMD_POLYLINE 0xC0009500
+#define R200_CP_CMD_POLYSCANLINES 0xC0009800
+#define R200_CP_CMD_PAINT_MULTI 0xC0009A00
+#define R200_CP_CMD_BITBLT_MULTI 0xC0009B00
+#define R200_CP_CMD_TRANS_BITBLT 0xC0009C00
+
+
+#define R200_AGP_TEX_OFFSET 0x02000000
+
+
+
+
+#endif
+
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_sanity.c b/xc/lib/GL/mesa/src/drv/r200/r200_sanity.c
new file mode 100644
index 000000000..ec0de7ddd
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_sanity.c
@@ -0,0 +1,1435 @@
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright 2002 ATI Technologies Inc., Ontario, Canada, and
+ Tungsten Graphics Inc, Cedar Park, TX.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ *
+ */
+
+#include "glheader.h"
+#include "imports.h"
+
+#include "r200_context.h"
+#include "r200_ioctl.h"
+#include "r200_sanity.h"
+#include "radeon_reg.h"
+#include "r200_reg.h"
+
+/* Set this '1' to get more verbiage.
+ */
+#define MORE_VERBOSE 1
+
+#if MORE_VERBOSE
+#define VERBOSE (R200_DEBUG & DEBUG_VERBOSE)
+#define NORMAL (1)
+#else
+#define VERBOSE 0
+#define NORMAL (R200_DEBUG & DEBUG_VERBOSE)
+#endif
+
+
+/* New (1.3) state mechanism. 3 commands (packet, scalar, vector) in
+ * 1.3 cmdbuffers allow all previous state to be updated as well as
+ * the tcl scalar and vector areas.
+ */
+static struct {
+ int start;
+ int len;
+ const char *name;
+} packet[RADEON_MAX_STATE_PACKETS] = {
+ { RADEON_PP_MISC,7,"RADEON_PP_MISC" },
+ { RADEON_PP_CNTL,3,"RADEON_PP_CNTL" },
+ { RADEON_RB3D_COLORPITCH,1,"RADEON_RB3D_COLORPITCH" },
+ { RADEON_RE_LINE_PATTERN,2,"RADEON_RE_LINE_PATTERN" },
+ { RADEON_SE_LINE_WIDTH,1,"RADEON_SE_LINE_WIDTH" },
+ { RADEON_PP_LUM_MATRIX,1,"RADEON_PP_LUM_MATRIX" },
+ { RADEON_PP_ROT_MATRIX_0,2,"RADEON_PP_ROT_MATRIX_0" },
+ { RADEON_RB3D_STENCILREFMASK,3,"RADEON_RB3D_STENCILREFMASK" },
+ { RADEON_SE_VPORT_XSCALE,6,"RADEON_SE_VPORT_XSCALE" },
+ { RADEON_SE_CNTL,2,"RADEON_SE_CNTL" },
+ { RADEON_SE_CNTL_STATUS,1,"RADEON_SE_CNTL_STATUS" },
+ { RADEON_RE_MISC,1,"RADEON_RE_MISC" },
+ { RADEON_PP_TXFILTER_0,6,"RADEON_PP_TXFILTER_0" },
+ { RADEON_PP_BORDER_COLOR_0,1,"RADEON_PP_BORDER_COLOR_0" },
+ { RADEON_PP_TXFILTER_1,6,"RADEON_PP_TXFILTER_1" },
+ { RADEON_PP_BORDER_COLOR_1,1,"RADEON_PP_BORDER_COLOR_1" },
+ { RADEON_PP_TXFILTER_2,6,"RADEON_PP_TXFILTER_2" },
+ { RADEON_PP_BORDER_COLOR_2,1,"RADEON_PP_BORDER_COLOR_2" },
+ { RADEON_SE_ZBIAS_FACTOR,2,"RADEON_SE_ZBIAS_FACTOR" },
+ { RADEON_SE_TCL_OUTPUT_VTX_FMT,11,"RADEON_SE_TCL_OUTPUT_VTX_FMT" },
+ { RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED,17,"RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED" },
+ { R200_PP_TXCBLEND_0, 4, "R200_EMIT_PP_TXCBLEND_0" },
+ { R200_PP_TXCBLEND_1, 4, "R200_PP_TXCBLEND_1" },
+ { R200_PP_TXCBLEND_2, 4, "R200_PP_TXCBLEND_2" },
+ { R200_PP_TXCBLEND_3, 4, "R200_PP_TXCBLEND_3" },
+ { R200_PP_TXCBLEND_4, 4, "R200_PP_TXCBLEND_4" },
+ { R200_PP_TXCBLEND_5, 4, "R200_PP_TXCBLEND_5" },
+ { R200_PP_TXCBLEND_6, 4, "R200_PP_TXCBLEND_6" },
+ { R200_PP_TXCBLEND_7, 4, "R200_PP_TXCBLEND_7" },
+ { R200_SE_TCL_LIGHT_MODEL_CTL_0, 6, "R200_SE_TCL_LIGHT_MODEL_CTL_0" },
+ { R200_PP_TFACTOR_0, 6, "R200_PP_TFACTOR_0" },
+ { R200_SE_VTX_FMT_0, 4, "R200_SE_VTX_FMT_0" },
+ { R200_SE_VAP_CNTL, 1, "R200_SE_VAP_CNTL" },
+ { R200_SE_TCL_MATRIX_SEL_0, 5, "R200_SE_TCL_MATRIX_SEL_0" },
+ { R200_SE_TCL_TEX_PROC_CTL_2, 5, "R200_SE_TCL_TEX_PROC_CTL_2" },
+ { R200_SE_TCL_UCP_VERT_BLEND_CTL, 1, "R200_SE_TCL_UCP_VERT_BLEND_CTL" },
+ { R200_PP_TXFILTER_0, 6, "R200_PP_TXFILTER_0" },
+ { R200_PP_TXFILTER_1, 6, "R200_PP_TXFILTER_1" },
+ { R200_PP_TXFILTER_2, 6, "R200_PP_TXFILTER_2" },
+ { R200_PP_TXFILTER_3, 6, "R200_PP_TXFILTER_3" },
+ { R200_PP_TXFILTER_4, 6, "R200_PP_TXFILTER_4" },
+ { R200_PP_TXFILTER_5, 6, "R200_PP_TXFILTER_5" },
+ { R200_PP_TXOFFSET_0, 1, "R200_PP_TXOFFSET_0" },
+ { R200_PP_TXOFFSET_1, 1, "R200_PP_TXOFFSET_1" },
+ { R200_PP_TXOFFSET_2, 1, "R200_PP_TXOFFSET_2" },
+ { R200_PP_TXOFFSET_3, 1, "R200_PP_TXOFFSET_3" },
+ { R200_PP_TXOFFSET_4, 1, "R200_PP_TXOFFSET_4" },
+ { R200_PP_TXOFFSET_5, 1, "R200_PP_TXOFFSET_5" },
+ { R200_SE_VTE_CNTL, 1, "R200_SE_VTE_CNTL" },
+ { R200_SE_TCL_OUTPUT_VTX_COMP_SEL, 1, "R200_SE_TCL_OUTPUT_VTX_COMP_SEL" },
+ { R200_PP_TAM_DEBUG3, 1, "R200_PP_TAM_DEBUG3" },
+ { R200_PP_CNTL_X, 1, "R200_PP_CNTL_X" },
+ { R200_RB3D_DEPTHXY_OFFSET, 1, "R200_RB3D_DEPTHXY_OFFSET" },
+ { R200_RE_AUX_SCISSOR_CNTL, 1, "R200_RE_AUX_SCISSOR_CNTL" },
+ { R200_RE_SCISSOR_TL_0, 2, "R200_RE_SCISSOR_TL_0" },
+ { R200_RE_SCISSOR_TL_1, 2, "R200_RE_SCISSOR_TL_1" },
+ { R200_RE_SCISSOR_TL_2, 2, "R200_RE_SCISSOR_TL_2" },
+ { R200_SE_VAP_CNTL_STATUS, 1, "R200_SE_VAP_CNTL_STATUS" },
+ { R200_SE_VTX_STATE_CNTL, 1, "R200_SE_VTX_STATE_CNTL" },
+ { R200_RE_POINTSIZE, 1, "R200_RE_POINTSIZE" },
+ { R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0, 4, "R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0" },
+ { R200_PP_CUBIC_FACES_0, 1, "R200_PP_CUBIC_FACES_0" }, /* 61 */
+ { R200_PP_CUBIC_OFFSET_F1_0, 5, "R200_PP_CUBIC_OFFSET_F1_0" }, /* 62 */
+ { R200_PP_CUBIC_FACES_1, 1, "R200_PP_CUBIC_FACES_1" },
+ { R200_PP_CUBIC_OFFSET_F1_1, 5, "R200_PP_CUBIC_OFFSET_F1_1" },
+ { R200_PP_CUBIC_FACES_2, 1, "R200_PP_CUBIC_FACES_2" },
+ { R200_PP_CUBIC_OFFSET_F1_2, 5, "R200_PP_CUBIC_OFFSET_F1_2" },
+ { R200_PP_CUBIC_FACES_3, 1, "R200_PP_CUBIC_FACES_3" },
+ { R200_PP_CUBIC_OFFSET_F1_3, 5, "R200_PP_CUBIC_OFFSET_F1_3" },
+ { R200_PP_CUBIC_FACES_4, 1, "R200_PP_CUBIC_FACES_4" },
+ { R200_PP_CUBIC_OFFSET_F1_4, 5, "R200_PP_CUBIC_OFFSET_F1_4" },
+ { R200_PP_CUBIC_FACES_5, 1, "R200_PP_CUBIC_FACES_5" },
+ { R200_PP_CUBIC_OFFSET_F1_5, 5, "R200_PP_CUBIC_OFFSET_F1_5" },
+};
+
+struct reg_names {
+ int idx;
+ const char *name;
+};
+
+static struct reg_names reg_names[] = {
+ { R200_PP_MISC, "R200_PP_MISC" },
+ { R200_PP_FOG_COLOR, "R200_PP_FOG_COLOR" },
+ { R200_RE_SOLID_COLOR, "R200_RE_SOLID_COLOR" },
+ { R200_RB3D_BLENDCNTL, "R200_RB3D_BLENDCNTL" },
+ { R200_RB3D_DEPTHOFFSET, "R200_RB3D_DEPTHOFFSET" },
+ { R200_RB3D_DEPTHPITCH, "R200_RB3D_DEPTHPITCH" },
+ { R200_RB3D_ZSTENCILCNTL, "R200_RB3D_ZSTENCILCNTL" },
+ { R200_PP_CNTL, "R200_PP_CNTL" },
+ { R200_RB3D_CNTL, "R200_RB3D_CNTL" },
+ { R200_RB3D_COLOROFFSET, "R200_RB3D_COLOROFFSET" },
+ { R200_RE_WIDTH_HEIGHT, "R200_RE_WIDTH_HEIGHT" },
+ { R200_RB3D_COLORPITCH, "R200_RB3D_COLORPITCH" },
+ { R200_SE_CNTL, "R200_SE_CNTL" },
+ { R200_RE_CNTL, "R200_RE_CNTL" },
+ { R200_RE_MISC, "R200_RE_MISC" },
+ { R200_RE_STIPPLE_ADDR, "R200_RE_STIPPLE_ADDR" },
+ { R200_RE_STIPPLE_DATA, "R200_RE_STIPPLE_DATA" },
+ { R200_RE_LINE_PATTERN, "R200_RE_LINE_PATTERN" },
+ { R200_RE_LINE_STATE, "R200_RE_LINE_STATE" },
+ { R200_RE_SCISSOR_TL_0, "R200_RE_SCISSOR_TL_0" },
+ { R200_RE_SCISSOR_BR_0, "R200_RE_SCISSOR_BR_0" },
+ { R200_RE_SCISSOR_TL_1, "R200_RE_SCISSOR_TL_1" },
+ { R200_RE_SCISSOR_BR_1, "R200_RE_SCISSOR_BR_1" },
+ { R200_RE_SCISSOR_TL_2, "R200_RE_SCISSOR_TL_2" },
+ { R200_RE_SCISSOR_BR_2, "R200_RE_SCISSOR_BR_2" },
+ { R200_RB3D_DEPTHXY_OFFSET, "R200_RB3D_DEPTHXY_OFFSET" },
+ { R200_RB3D_STENCILREFMASK, "R200_RB3D_STENCILREFMASK" },
+ { R200_RB3D_ROPCNTL, "R200_RB3D_ROPCNTL" },
+ { R200_RB3D_PLANEMASK, "R200_RB3D_PLANEMASK" },
+ { R200_SE_VPORT_XSCALE, "R200_SE_VPORT_XSCALE" },
+ { R200_SE_VPORT_XOFFSET, "R200_SE_VPORT_XOFFSET" },
+ { R200_SE_VPORT_YSCALE, "R200_SE_VPORT_YSCALE" },
+ { R200_SE_VPORT_YOFFSET, "R200_SE_VPORT_YOFFSET" },
+ { R200_SE_VPORT_ZSCALE, "R200_SE_VPORT_ZSCALE" },
+ { R200_SE_VPORT_ZOFFSET, "R200_SE_VPORT_ZOFFSET" },
+ { R200_SE_ZBIAS_FACTOR, "R200_SE_ZBIAS_FACTOR" },
+ { R200_SE_ZBIAS_CONSTANT, "R200_SE_ZBIAS_CONSTANT" },
+ { R200_SE_LINE_WIDTH, "R200_SE_LINE_WIDTH" },
+ { R200_SE_VAP_CNTL, "R200_SE_VAP_CNTL" },
+ { R200_SE_VF_CNTL, "R200_SE_VF_CNTL" },
+ { R200_SE_VTX_FMT_0, "R200_SE_VTX_FMT_0" },
+ { R200_SE_VTX_FMT_1, "R200_SE_VTX_FMT_1" },
+ { R200_SE_TCL_OUTPUT_VTX_FMT_0, "R200_SE_TCL_OUTPUT_VTX_FMT_0" },
+ { R200_SE_TCL_OUTPUT_VTX_FMT_1, "R200_SE_TCL_OUTPUT_VTX_FMT_1" },
+ { R200_SE_VTE_CNTL, "R200_SE_VTE_CNTL" },
+ { R200_SE_VTX_NUM_ARRAYS, "R200_SE_VTX_NUM_ARRAYS" },
+ { R200_SE_VTX_AOS_ATTR01, "R200_SE_VTX_AOS_ATTR01" },
+ { R200_SE_VTX_AOS_ADDR0, "R200_SE_VTX_AOS_ADDR0" },
+ { R200_SE_VTX_AOS_ADDR1, "R200_SE_VTX_AOS_ADDR1" },
+ { R200_SE_VTX_AOS_ATTR23, "R200_SE_VTX_AOS_ATTR23" },
+ { R200_SE_VTX_AOS_ADDR2, "R200_SE_VTX_AOS_ADDR2" },
+ { R200_SE_VTX_AOS_ADDR3, "R200_SE_VTX_AOS_ADDR3" },
+ { R200_SE_VTX_AOS_ATTR45, "R200_SE_VTX_AOS_ATTR45" },
+ { R200_SE_VTX_AOS_ADDR4, "R200_SE_VTX_AOS_ADDR4" },
+ { R200_SE_VTX_AOS_ADDR5, "R200_SE_VTX_AOS_ADDR5" },
+ { R200_SE_VTX_AOS_ATTR67, "R200_SE_VTX_AOS_ATTR67" },
+ { R200_SE_VTX_AOS_ADDR6, "R200_SE_VTX_AOS_ADDR6" },
+ { R200_SE_VTX_AOS_ADDR7, "R200_SE_VTX_AOS_ADDR7" },
+ { R200_SE_VTX_AOS_ATTR89, "R200_SE_VTX_AOS_ATTR89" },
+ { R200_SE_VTX_AOS_ADDR8, "R200_SE_VTX_AOS_ADDR8" },
+ { R200_SE_VTX_AOS_ADDR9, "R200_SE_VTX_AOS_ADDR9" },
+ { R200_SE_VTX_AOS_ATTR1011, "R200_SE_VTX_AOS_ATTR1011" },
+ { R200_SE_VTX_AOS_ADDR10, "R200_SE_VTX_AOS_ADDR10" },
+ { R200_SE_VTX_AOS_ADDR11, "R200_SE_VTX_AOS_ADDR11" },
+ { R200_SE_VF_MAX_VTX_INDX, "R200_SE_VF_MAX_VTX_INDX" },
+ { R200_SE_VF_MIN_VTX_INDX, "R200_SE_VF_MIN_VTX_INDX" },
+ { R200_SE_VTX_STATE_CNTL, "R200_SE_VTX_STATE_CNTL" },
+ { R200_SE_TCL_VECTOR_INDX_REG, "R200_SE_TCL_VECTOR_INDX_REG" },
+ { R200_SE_TCL_VECTOR_DATA_REG, "R200_SE_TCL_VECTOR_DATA_REG" },
+ { R200_SE_TCL_SCALAR_INDX_REG, "R200_SE_TCL_SCALAR_INDX_REG" },
+ { R200_SE_TCL_SCALAR_DATA_REG, "R200_SE_TCL_SCALAR_DATA_REG" },
+ { R200_SE_TCL_MATRIX_SEL_0, "R200_SE_TCL_MATRIX_SEL_0" },
+ { R200_SE_TCL_MATRIX_SEL_1, "R200_SE_TCL_MATRIX_SEL_1" },
+ { R200_SE_TCL_MATRIX_SEL_2, "R200_SE_TCL_MATRIX_SEL_2" },
+ { R200_SE_TCL_MATRIX_SEL_3, "R200_SE_TCL_MATRIX_SEL_3" },
+ { R200_SE_TCL_MATRIX_SEL_4, "R200_SE_TCL_MATRIX_SEL_4" },
+ { R200_SE_TCL_LIGHT_MODEL_CTL_0, "R200_SE_TCL_LIGHT_MODEL_CTL_0" },
+ { R200_SE_TCL_LIGHT_MODEL_CTL_1, "R200_SE_TCL_LIGHT_MODEL_CTL_1" },
+ { R200_SE_TCL_PER_LIGHT_CTL_0, "R200_SE_TCL_PER_LIGHT_CTL_0" },
+ { R200_SE_TCL_PER_LIGHT_CTL_1, "R200_SE_TCL_PER_LIGHT_CTL_1" },
+ { R200_SE_TCL_PER_LIGHT_CTL_2, "R200_SE_TCL_PER_LIGHT_CTL_2" },
+ { R200_SE_TCL_PER_LIGHT_CTL_3, "R200_SE_TCL_PER_LIGHT_CTL_3" },
+ { R200_SE_TCL_TEX_PROC_CTL_2, "R200_SE_TCL_TEX_PROC_CTL_2" },
+ { R200_SE_TCL_TEX_PROC_CTL_3, "R200_SE_TCL_TEX_PROC_CTL_3" },
+ { R200_SE_TCL_TEX_PROC_CTL_0, "R200_SE_TCL_TEX_PROC_CTL_0" },
+ { R200_SE_TCL_TEX_PROC_CTL_1, "R200_SE_TCL_TEX_PROC_CTL_1" },
+ { R200_SE_TC_TEX_CYL_WRAP_CTL, "R200_SE_TC_TEX_CYL_WRAP_CTL" },
+ { R200_SE_TCL_UCP_VERT_BLEND_CTL, "R200_SE_TCL_UCP_VERT_BLEND_CTL" },
+ { R200_SE_TCL_POINT_SPRITE_CNTL, "R200_SE_TCL_POINT_SPRITE_CNTL" },
+ { R200_SE_VTX_ST_POS_0_X_4, "R200_SE_VTX_ST_POS_0_X_4" },
+ { R200_SE_VTX_ST_POS_0_Y_4, "R200_SE_VTX_ST_POS_0_Y_4" },
+ { R200_SE_VTX_ST_POS_0_Z_4, "R200_SE_VTX_ST_POS_0_Z_4" },
+ { R200_SE_VTX_ST_POS_0_W_4, "R200_SE_VTX_ST_POS_0_W_4" },
+ { R200_SE_VTX_ST_NORM_0_X, "R200_SE_VTX_ST_NORM_0_X" },
+ { R200_SE_VTX_ST_NORM_0_Y, "R200_SE_VTX_ST_NORM_0_Y" },
+ { R200_SE_VTX_ST_NORM_0_Z, "R200_SE_VTX_ST_NORM_0_Z" },
+ { R200_SE_VTX_ST_PVMS, "R200_SE_VTX_ST_PVMS" },
+ { R200_SE_VTX_ST_CLR_0_R, "R200_SE_VTX_ST_CLR_0_R" },
+ { R200_SE_VTX_ST_CLR_0_G, "R200_SE_VTX_ST_CLR_0_G" },
+ { R200_SE_VTX_ST_CLR_0_B, "R200_SE_VTX_ST_CLR_0_B" },
+ { R200_SE_VTX_ST_CLR_0_A, "R200_SE_VTX_ST_CLR_0_A" },
+ { R200_SE_VTX_ST_CLR_1_R, "R200_SE_VTX_ST_CLR_1_R" },
+ { R200_SE_VTX_ST_CLR_1_G, "R200_SE_VTX_ST_CLR_1_G" },
+ { R200_SE_VTX_ST_CLR_1_B, "R200_SE_VTX_ST_CLR_1_B" },
+ { R200_SE_VTX_ST_CLR_1_A, "R200_SE_VTX_ST_CLR_1_A" },
+ { R200_SE_VTX_ST_CLR_2_R, "R200_SE_VTX_ST_CLR_2_R" },
+ { R200_SE_VTX_ST_CLR_2_G, "R200_SE_VTX_ST_CLR_2_G" },
+ { R200_SE_VTX_ST_CLR_2_B, "R200_SE_VTX_ST_CLR_2_B" },
+ { R200_SE_VTX_ST_CLR_2_A, "R200_SE_VTX_ST_CLR_2_A" },
+ { R200_SE_VTX_ST_CLR_3_R, "R200_SE_VTX_ST_CLR_3_R" },
+ { R200_SE_VTX_ST_CLR_3_G, "R200_SE_VTX_ST_CLR_3_G" },
+ { R200_SE_VTX_ST_CLR_3_B, "R200_SE_VTX_ST_CLR_3_B" },
+ { R200_SE_VTX_ST_CLR_3_A, "R200_SE_VTX_ST_CLR_3_A" },
+ { R200_SE_VTX_ST_CLR_4_R, "R200_SE_VTX_ST_CLR_4_R" },
+ { R200_SE_VTX_ST_CLR_4_G, "R200_SE_VTX_ST_CLR_4_G" },
+ { R200_SE_VTX_ST_CLR_4_B, "R200_SE_VTX_ST_CLR_4_B" },
+ { R200_SE_VTX_ST_CLR_4_A, "R200_SE_VTX_ST_CLR_4_A" },
+ { R200_SE_VTX_ST_CLR_5_R, "R200_SE_VTX_ST_CLR_5_R" },
+ { R200_SE_VTX_ST_CLR_5_G, "R200_SE_VTX_ST_CLR_5_G" },
+ { R200_SE_VTX_ST_CLR_5_B, "R200_SE_VTX_ST_CLR_5_B" },
+ { R200_SE_VTX_ST_CLR_5_A, "R200_SE_VTX_ST_CLR_5_A" },
+ { R200_SE_VTX_ST_CLR_6_R, "R200_SE_VTX_ST_CLR_6_R" },
+ { R200_SE_VTX_ST_CLR_6_G, "R200_SE_VTX_ST_CLR_6_G" },
+ { R200_SE_VTX_ST_CLR_6_B, "R200_SE_VTX_ST_CLR_6_B" },
+ { R200_SE_VTX_ST_CLR_6_A, "R200_SE_VTX_ST_CLR_6_A" },
+ { R200_SE_VTX_ST_CLR_7_R, "R200_SE_VTX_ST_CLR_7_R" },
+ { R200_SE_VTX_ST_CLR_7_G, "R200_SE_VTX_ST_CLR_7_G" },
+ { R200_SE_VTX_ST_CLR_7_B, "R200_SE_VTX_ST_CLR_7_B" },
+ { R200_SE_VTX_ST_CLR_7_A, "R200_SE_VTX_ST_CLR_7_A" },
+ { R200_SE_VTX_ST_TEX_0_S, "R200_SE_VTX_ST_TEX_0_S" },
+ { R200_SE_VTX_ST_TEX_0_T, "R200_SE_VTX_ST_TEX_0_T" },
+ { R200_SE_VTX_ST_TEX_0_R, "R200_SE_VTX_ST_TEX_0_R" },
+ { R200_SE_VTX_ST_TEX_0_Q, "R200_SE_VTX_ST_TEX_0_Q" },
+ { R200_SE_VTX_ST_TEX_1_S, "R200_SE_VTX_ST_TEX_1_S" },
+ { R200_SE_VTX_ST_TEX_1_T, "R200_SE_VTX_ST_TEX_1_T" },
+ { R200_SE_VTX_ST_TEX_1_R, "R200_SE_VTX_ST_TEX_1_R" },
+ { R200_SE_VTX_ST_TEX_1_Q, "R200_SE_VTX_ST_TEX_1_Q" },
+ { R200_SE_VTX_ST_TEX_2_S, "R200_SE_VTX_ST_TEX_2_S" },
+ { R200_SE_VTX_ST_TEX_2_T, "R200_SE_VTX_ST_TEX_2_T" },
+ { R200_SE_VTX_ST_TEX_2_R, "R200_SE_VTX_ST_TEX_2_R" },
+ { R200_SE_VTX_ST_TEX_2_Q, "R200_SE_VTX_ST_TEX_2_Q" },
+ { R200_SE_VTX_ST_TEX_3_S, "R200_SE_VTX_ST_TEX_3_S" },
+ { R200_SE_VTX_ST_TEX_3_T, "R200_SE_VTX_ST_TEX_3_T" },
+ { R200_SE_VTX_ST_TEX_3_R, "R200_SE_VTX_ST_TEX_3_R" },
+ { R200_SE_VTX_ST_TEX_3_Q, "R200_SE_VTX_ST_TEX_3_Q" },
+ { R200_SE_VTX_ST_TEX_4_S, "R200_SE_VTX_ST_TEX_4_S" },
+ { R200_SE_VTX_ST_TEX_4_T, "R200_SE_VTX_ST_TEX_4_T" },
+ { R200_SE_VTX_ST_TEX_4_R, "R200_SE_VTX_ST_TEX_4_R" },
+ { R200_SE_VTX_ST_TEX_4_Q, "R200_SE_VTX_ST_TEX_4_Q" },
+ { R200_SE_VTX_ST_TEX_5_S, "R200_SE_VTX_ST_TEX_5_S" },
+ { R200_SE_VTX_ST_TEX_5_T, "R200_SE_VTX_ST_TEX_5_T" },
+ { R200_SE_VTX_ST_TEX_5_R, "R200_SE_VTX_ST_TEX_5_R" },
+ { R200_SE_VTX_ST_TEX_5_Q, "R200_SE_VTX_ST_TEX_5_Q" },
+ { R200_SE_VTX_ST_PNT_SPRT_SZ, "R200_SE_VTX_ST_PNT_SPRT_SZ" },
+ { R200_SE_VTX_ST_DISC_FOG, "R200_SE_VTX_ST_DISC_FOG" },
+ { R200_SE_VTX_ST_SHININESS_0, "R200_SE_VTX_ST_SHININESS_0" },
+ { R200_SE_VTX_ST_SHININESS_1, "R200_SE_VTX_ST_SHININESS_1" },
+ { R200_SE_VTX_ST_BLND_WT_0, "R200_SE_VTX_ST_BLND_WT_0" },
+ { R200_SE_VTX_ST_BLND_WT_1, "R200_SE_VTX_ST_BLND_WT_1" },
+ { R200_SE_VTX_ST_BLND_WT_2, "R200_SE_VTX_ST_BLND_WT_2" },
+ { R200_SE_VTX_ST_BLND_WT_3, "R200_SE_VTX_ST_BLND_WT_3" },
+ { R200_SE_VTX_ST_POS_1_X, "R200_SE_VTX_ST_POS_1_X" },
+ { R200_SE_VTX_ST_POS_1_Y, "R200_SE_VTX_ST_POS_1_Y" },
+ { R200_SE_VTX_ST_POS_1_Z, "R200_SE_VTX_ST_POS_1_Z" },
+ { R200_SE_VTX_ST_POS_1_W, "R200_SE_VTX_ST_POS_1_W" },
+ { R200_SE_VTX_ST_NORM_1_X, "R200_SE_VTX_ST_NORM_1_X" },
+ { R200_SE_VTX_ST_NORM_1_Y, "R200_SE_VTX_ST_NORM_1_Y" },
+ { R200_SE_VTX_ST_NORM_1_Z, "R200_SE_VTX_ST_NORM_1_Z" },
+ { R200_SE_VTX_ST_USR_CLR_0_R, "R200_SE_VTX_ST_USR_CLR_0_R" },
+ { R200_SE_VTX_ST_USR_CLR_0_G, "R200_SE_VTX_ST_USR_CLR_0_G" },
+ { R200_SE_VTX_ST_USR_CLR_0_B, "R200_SE_VTX_ST_USR_CLR_0_B" },
+ { R200_SE_VTX_ST_USR_CLR_0_A, "R200_SE_VTX_ST_USR_CLR_0_A" },
+ { R200_SE_VTX_ST_USR_CLR_1_R, "R200_SE_VTX_ST_USR_CLR_1_R" },
+ { R200_SE_VTX_ST_USR_CLR_1_G, "R200_SE_VTX_ST_USR_CLR_1_G" },
+ { R200_SE_VTX_ST_USR_CLR_1_B, "R200_SE_VTX_ST_USR_CLR_1_B" },
+ { R200_SE_VTX_ST_USR_CLR_1_A, "R200_SE_VTX_ST_USR_CLR_1_A" },
+ { R200_SE_VTX_ST_CLR_0_PKD, "R200_SE_VTX_ST_CLR_0_PKD" },
+ { R200_SE_VTX_ST_CLR_1_PKD, "R200_SE_VTX_ST_CLR_1_PKD" },
+ { R200_SE_VTX_ST_CLR_2_PKD, "R200_SE_VTX_ST_CLR_2_PKD" },
+ { R200_SE_VTX_ST_CLR_3_PKD, "R200_SE_VTX_ST_CLR_3_PKD" },
+ { R200_SE_VTX_ST_CLR_4_PKD, "R200_SE_VTX_ST_CLR_4_PKD" },
+ { R200_SE_VTX_ST_CLR_5_PKD, "R200_SE_VTX_ST_CLR_5_PKD" },
+ { R200_SE_VTX_ST_CLR_6_PKD, "R200_SE_VTX_ST_CLR_6_PKD" },
+ { R200_SE_VTX_ST_CLR_7_PKD, "R200_SE_VTX_ST_CLR_7_PKD" },
+ { R200_SE_VTX_ST_POS_0_X_2, "R200_SE_VTX_ST_POS_0_X_2" },
+ { R200_SE_VTX_ST_POS_0_Y_2, "R200_SE_VTX_ST_POS_0_Y_2" },
+ { R200_SE_VTX_ST_PAR_CLR_LD, "R200_SE_VTX_ST_PAR_CLR_LD" },
+ { R200_SE_VTX_ST_USR_CLR_PKD, "R200_SE_VTX_ST_USR_CLR_PKD" },
+ { R200_SE_VTX_ST_POS_0_X_3, "R200_SE_VTX_ST_POS_0_X_3" },
+ { R200_SE_VTX_ST_POS_0_Y_3, "R200_SE_VTX_ST_POS_0_Y_3" },
+ { R200_SE_VTX_ST_POS_0_Z_3, "R200_SE_VTX_ST_POS_0_Z_3" },
+ { R200_SE_VTX_ST_END_OF_PKT, "R200_SE_VTX_ST_END_OF_PKT" },
+ { R200_RE_POINTSIZE, "R200_RE_POINTSIZE" },
+ { R200_RE_TOP_LEFT, "R200_RE_TOP_LEFT" },
+ { R200_RE_AUX_SCISSOR_CNTL, "R200_RE_AUX_SCISSOR_CNTL" },
+ { R200_PP_TXFILTER_0, "R200_PP_TXFILTER_0" },
+ { R200_PP_TXFORMAT_0, "R200_PP_TXFORMAT_0" },
+ { R200_PP_TXSIZE_0, "R200_PP_TXSIZE_0" },
+ { R200_PP_TXFORMAT_X_0, "R200_PP_TXFORMAT_X_0" },
+ { R200_PP_TXPITCH_0, "R200_PP_TXPITCH_0" },
+ { R200_PP_BORDER_COLOR_0, "R200_PP_BORDER_COLOR_0" },
+ { R200_PP_CUBIC_FACES_0, "R200_PP_CUBIC_FACES_0" },
+ { R200_PP_TXFILTER_1, "R200_PP_TXFILTER_1" },
+ { R200_PP_TXFORMAT_1, "R200_PP_TXFORMAT_1" },
+ { R200_PP_TXSIZE_1, "R200_PP_TXSIZE_1" },
+ { R200_PP_TXFORMAT_X_1, "R200_PP_TXFORMAT_X_1" },
+ { R200_PP_TXPITCH_1, "R200_PP_TXPITCH_1" },
+ { R200_PP_BORDER_COLOR_1, "R200_PP_BORDER_COLOR_1" },
+ { R200_PP_CUBIC_FACES_1, "R200_PP_CUBIC_FACES_1" },
+ { R200_PP_TXFILTER_2, "R200_PP_TXFILTER_2" },
+ { R200_PP_TXFORMAT_2, "R200_PP_TXFORMAT_2" },
+ { R200_PP_TXSIZE_2, "R200_PP_TXSIZE_2" },
+ { R200_PP_TXFORMAT_X_2, "R200_PP_TXFORMAT_X_2" },
+ { R200_PP_TXPITCH_2, "R200_PP_TXPITCH_2" },
+ { R200_PP_BORDER_COLOR_2, "R200_PP_BORDER_COLOR_2" },
+ { R200_PP_CUBIC_FACES_2, "R200_PP_CUBIC_FACES_2" },
+ { R200_PP_TXFILTER_3, "R200_PP_TXFILTER_3" },
+ { R200_PP_TXFORMAT_3, "R200_PP_TXFORMAT_3" },
+ { R200_PP_TXSIZE_3, "R200_PP_TXSIZE_3" },
+ { R200_PP_TXFORMAT_X_3, "R200_PP_TXFORMAT_X_3" },
+ { R200_PP_TXPITCH_3, "R200_PP_TXPITCH_3" },
+ { R200_PP_BORDER_COLOR_3, "R200_PP_BORDER_COLOR_3" },
+ { R200_PP_CUBIC_FACES_3, "R200_PP_CUBIC_FACES_3" },
+ { R200_PP_TXFILTER_4, "R200_PP_TXFILTER_4" },
+ { R200_PP_TXFORMAT_4, "R200_PP_TXFORMAT_4" },
+ { R200_PP_TXSIZE_4, "R200_PP_TXSIZE_4" },
+ { R200_PP_TXFORMAT_X_4, "R200_PP_TXFORMAT_X_4" },
+ { R200_PP_TXPITCH_4, "R200_PP_TXPITCH_4" },
+ { R200_PP_BORDER_COLOR_4, "R200_PP_BORDER_COLOR_4" },
+ { R200_PP_CUBIC_FACES_4, "R200_PP_CUBIC_FACES_4" },
+ { R200_PP_TXFILTER_5, "R200_PP_TXFILTER_5" },
+ { R200_PP_TXFORMAT_5, "R200_PP_TXFORMAT_5" },
+ { R200_PP_TXSIZE_5, "R200_PP_TXSIZE_5" },
+ { R200_PP_TXFORMAT_X_5, "R200_PP_TXFORMAT_X_5" },
+ { R200_PP_TXPITCH_5, "R200_PP_TXPITCH_5" },
+ { R200_PP_BORDER_COLOR_5, "R200_PP_BORDER_COLOR_5" },
+ { R200_PP_CUBIC_FACES_5, "R200_PP_CUBIC_FACES_5" },
+ { R200_PP_TXOFFSET_0, "R200_PP_TXOFFSET_0" },
+ { R200_PP_CUBIC_OFFSET_F1_0, "R200_PP_CUBIC_OFFSET_F1_0" },
+ { R200_PP_CUBIC_OFFSET_F2_0, "R200_PP_CUBIC_OFFSET_F2_0" },
+ { R200_PP_CUBIC_OFFSET_F3_0, "R200_PP_CUBIC_OFFSET_F3_0" },
+ { R200_PP_CUBIC_OFFSET_F4_0, "R200_PP_CUBIC_OFFSET_F4_0" },
+ { R200_PP_CUBIC_OFFSET_F5_0, "R200_PP_CUBIC_OFFSET_F5_0" },
+ { R200_PP_TXOFFSET_1, "R200_PP_TXOFFSET_1" },
+ { R200_PP_CUBIC_OFFSET_F1_1, "R200_PP_CUBIC_OFFSET_F1_1" },
+ { R200_PP_CUBIC_OFFSET_F2_1, "R200_PP_CUBIC_OFFSET_F2_1" },
+ { R200_PP_CUBIC_OFFSET_F3_1, "R200_PP_CUBIC_OFFSET_F3_1" },
+ { R200_PP_CUBIC_OFFSET_F4_1, "R200_PP_CUBIC_OFFSET_F4_1" },
+ { R200_PP_CUBIC_OFFSET_F5_1, "R200_PP_CUBIC_OFFSET_F5_1" },
+ { R200_PP_TXOFFSET_2, "R200_PP_TXOFFSET_2" },
+ { R200_PP_CUBIC_OFFSET_F1_2, "R200_PP_CUBIC_OFFSET_F1_2" },
+ { R200_PP_CUBIC_OFFSET_F2_2, "R200_PP_CUBIC_OFFSET_F2_2" },
+ { R200_PP_CUBIC_OFFSET_F3_2, "R200_PP_CUBIC_OFFSET_F3_2" },
+ { R200_PP_CUBIC_OFFSET_F4_2, "R200_PP_CUBIC_OFFSET_F4_2" },
+ { R200_PP_CUBIC_OFFSET_F5_2, "R200_PP_CUBIC_OFFSET_F5_2" },
+ { R200_PP_TXOFFSET_3, "R200_PP_TXOFFSET_3" },
+ { R200_PP_CUBIC_OFFSET_F1_3, "R200_PP_CUBIC_OFFSET_F1_3" },
+ { R200_PP_CUBIC_OFFSET_F2_3, "R200_PP_CUBIC_OFFSET_F2_3" },
+ { R200_PP_CUBIC_OFFSET_F3_3, "R200_PP_CUBIC_OFFSET_F3_3" },
+ { R200_PP_CUBIC_OFFSET_F4_3, "R200_PP_CUBIC_OFFSET_F4_3" },
+ { R200_PP_CUBIC_OFFSET_F5_3, "R200_PP_CUBIC_OFFSET_F5_3" },
+ { R200_PP_TXOFFSET_4, "R200_PP_TXOFFSET_4" },
+ { R200_PP_CUBIC_OFFSET_F1_4, "R200_PP_CUBIC_OFFSET_F1_4" },
+ { R200_PP_CUBIC_OFFSET_F2_4, "R200_PP_CUBIC_OFFSET_F2_4" },
+ { R200_PP_CUBIC_OFFSET_F3_4, "R200_PP_CUBIC_OFFSET_F3_4" },
+ { R200_PP_CUBIC_OFFSET_F4_4, "R200_PP_CUBIC_OFFSET_F4_4" },
+ { R200_PP_CUBIC_OFFSET_F5_4, "R200_PP_CUBIC_OFFSET_F5_4" },
+ { R200_PP_TXOFFSET_5, "R200_PP_TXOFFSET_5" },
+ { R200_PP_CUBIC_OFFSET_F1_5, "R200_PP_CUBIC_OFFSET_F1_5" },
+ { R200_PP_CUBIC_OFFSET_F2_5, "R200_PP_CUBIC_OFFSET_F2_5" },
+ { R200_PP_CUBIC_OFFSET_F3_5, "R200_PP_CUBIC_OFFSET_F3_5" },
+ { R200_PP_CUBIC_OFFSET_F4_5, "R200_PP_CUBIC_OFFSET_F4_5" },
+ { R200_PP_CUBIC_OFFSET_F5_5, "R200_PP_CUBIC_OFFSET_F5_5" },
+ { R200_PP_TAM_DEBUG3, "R200_PP_TAM_DEBUG3" },
+ { R200_PP_TFACTOR_0, "R200_PP_TFACTOR_0" },
+ { R200_PP_TFACTOR_1, "R200_PP_TFACTOR_1" },
+ { R200_PP_TFACTOR_2, "R200_PP_TFACTOR_2" },
+ { R200_PP_TFACTOR_3, "R200_PP_TFACTOR_3" },
+ { R200_PP_TFACTOR_4, "R200_PP_TFACTOR_4" },
+ { R200_PP_TFACTOR_5, "R200_PP_TFACTOR_5" },
+ { R200_PP_TXCBLEND_0, "R200_PP_TXCBLEND_0" },
+ { R200_PP_TXCBLEND2_0, "R200_PP_TXCBLEND2_0" },
+ { R200_PP_TXABLEND_0, "R200_PP_TXABLEND_0" },
+ { R200_PP_TXABLEND2_0, "R200_PP_TXABLEND2_0" },
+ { R200_PP_TXCBLEND_1, "R200_PP_TXCBLEND_1" },
+ { R200_PP_TXCBLEND2_1, "R200_PP_TXCBLEND2_1" },
+ { R200_PP_TXABLEND_1, "R200_PP_TXABLEND_1" },
+ { R200_PP_TXABLEND2_1, "R200_PP_TXABLEND2_1" },
+ { R200_PP_TXCBLEND_2, "R200_PP_TXCBLEND_2" },
+ { R200_PP_TXCBLEND2_2, "R200_PP_TXCBLEND2_2" },
+ { R200_PP_TXABLEND_2, "R200_PP_TXABLEND_2" },
+ { R200_PP_TXABLEND2_2, "R200_PP_TXABLEND2_2" },
+ { R200_PP_TXCBLEND_3, "R200_PP_TXCBLEND_3" },
+ { R200_PP_TXCBLEND2_3, "R200_PP_TXCBLEND2_3" },
+ { R200_PP_TXABLEND_3, "R200_PP_TXABLEND_3" },
+ { R200_PP_TXABLEND2_3, "R200_PP_TXABLEND2_3" },
+ { R200_PP_TXCBLEND_4, "R200_PP_TXCBLEND_4" },
+ { R200_PP_TXCBLEND2_4, "R200_PP_TXCBLEND2_4" },
+ { R200_PP_TXABLEND_4, "R200_PP_TXABLEND_4" },
+ { R200_PP_TXABLEND2_4, "R200_PP_TXABLEND2_4" },
+ { R200_PP_TXCBLEND_5, "R200_PP_TXCBLEND_5" },
+ { R200_PP_TXCBLEND2_5, "R200_PP_TXCBLEND2_5" },
+ { R200_PP_TXABLEND_5, "R200_PP_TXABLEND_5" },
+ { R200_PP_TXABLEND2_5, "R200_PP_TXABLEND2_5" },
+ { R200_PP_TXCBLEND_6, "R200_PP_TXCBLEND_6" },
+ { R200_PP_TXCBLEND2_6, "R200_PP_TXCBLEND2_6" },
+ { R200_PP_TXABLEND_6, "R200_PP_TXABLEND_6" },
+ { R200_PP_TXABLEND2_6, "R200_PP_TXABLEND2_6" },
+ { R200_PP_TXCBLEND_7, "R200_PP_TXCBLEND_7" },
+ { R200_PP_TXCBLEND2_7, "R200_PP_TXCBLEND2_7" },
+ { R200_PP_TXABLEND_7, "R200_PP_TXABLEND_7" },
+ { R200_PP_TXABLEND2_7, "R200_PP_TXABLEND2_7" },
+ { R200_RB3D_ABLENDCNTL, "R200_RB3D_ABLENDCNTL" },
+ { R200_RB3D_CBLENDCNTL, "R200_RB3D_CBLENDCNTL" },
+ { R200_SE_TCL_OUTPUT_VTX_COMP_SEL, "R200_SE_TCL_OUTPUT_VTX_COMP_SEL" },
+ { R200_PP_CNTL_X, "R200_PP_CNTL_X" },
+ { R200_SE_VAP_CNTL_STATUS, "R200_SE_VAP_CNTL_STATUS" },
+ { R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0, "R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0" },
+ { R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_1, "R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_1" },
+ { R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_2, "R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_2" },
+ { R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_3, "R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_3" },
+};
+
+static struct reg_names scalar_names[] = {
+ { R200_SS_LIGHT_DCD_ADDR, "R200_SS_LIGHT_DCD_ADDR" },
+ { R200_SS_LIGHT_DCM_ADDR, "R200_SS_LIGHT_DCM_ADDR" },
+ { R200_SS_LIGHT_SPOT_EXPONENT_ADDR, "R200_SS_LIGHT_SPOT_EXPONENT_ADDR" },
+ { R200_SS_LIGHT_SPOT_CUTOFF_ADDR, "R200_SS_LIGHT_SPOT_CUTOFF_ADDR" },
+ { R200_SS_LIGHT_SPECULAR_THRESH_ADDR, "R200_SS_LIGHT_SPECULAR_THRESH_ADDR" },
+ { R200_SS_LIGHT_RANGE_CUTOFF_SQRD, "R200_SS_LIGHT_RANGE_CUTOFF_SQRD" },
+ { R200_SS_LIGHT_RANGE_ATT_CONST, "R200_SS_LIGHT_RANGE_ATT_CONST" },
+ { R200_SS_VERT_GUARD_CLIP_ADJ_ADDR, "R200_SS_VERT_GUARD_CLIP_ADJ_ADDR" },
+ { R200_SS_VERT_GUARD_DISCARD_ADJ_ADDR, "R200_SS_VERT_GUARD_DISCARD_ADJ_ADDR" },
+ { R200_SS_HORZ_GUARD_CLIP_ADJ_ADDR, "R200_SS_HORZ_GUARD_CLIP_ADJ_ADDR" },
+ { R200_SS_HORZ_GUARD_DISCARD_ADJ_ADDR, "R200_SS_HORZ_GUARD_DISCARD_ADJ_ADDR" },
+ { R200_SS_MAT_0_SHININESS, "R200_SS_MAT_0_SHININESS" },
+ { R200_SS_MAT_1_SHININESS, "R200_SS_MAT_1_SHININESS" },
+ { 1000, "" },
+};
+
+/* Puff these out to make them look like normal (dword) registers.
+ */
+static struct reg_names vector_names[] = {
+ { 0, "start" },
+ { R200_VS_LIGHT_AMBIENT_ADDR, "R200_VS_LIGHT_AMBIENT_ADDR" },
+ { R200_VS_LIGHT_DIFFUSE_ADDR, "R200_VS_LIGHT_DIFFUSE_ADDR" },
+ { R200_VS_LIGHT_SPECULAR_ADDR, "R200_VS_LIGHT_SPECULAR_ADDR" },
+ { R200_VS_LIGHT_DIRPOS_ADDR, "R200_VS_LIGHT_DIRPOS_ADDR" },
+ { R200_VS_LIGHT_HWVSPOT_ADDR, "R200_VS_LIGHT_HWVSPOT_ADDR" },
+ { R200_VS_LIGHT_ATTENUATION_ADDR, "R200_VS_LIGHT_ATTENUATION_ADDR" },
+ { R200_VS_SPOT_DUAL_CONE, "R200_VS_SPOT_DUAL_CONE" },
+ { R200_VS_GLOBAL_AMBIENT_ADDR, "R200_VS_GLOBAL_AMBIENT_ADDR" },
+ { R200_VS_FOG_PARAM_ADDR, "R200_VS_FOG_PARAM_ADDR" },
+ { R200_VS_EYE_VECTOR_ADDR, "R200_VS_EYE_VECTOR_ADDR" },
+ { R200_VS_UCP_ADDR, "R200_VS_UCP_ADDR" },
+ { R200_VS_PNT_SPRITE_VPORT_SCALE, "R200_VS_PNT_SPRITE_VPORT_SCALE" },
+ { R200_VS_MATRIX_0_MV, "R200_VS_MATRIX_0_MV" },
+ { R200_VS_MATRIX_1_INV_MV, "R200_VS_MATRIX_1_INV_MV" },
+ { R200_VS_MATRIX_2_MVP, "R200_VS_MATRIX_2_MVP" },
+ { R200_VS_MATRIX_3_TEX0, "R200_VS_MATRIX_3_TEX0" },
+ { R200_VS_MATRIX_4_TEX1, "R200_VS_MATRIX_4_TEX1" },
+ { R200_VS_MATRIX_5_TEX2, "R200_VS_MATRIX_5_TEX2" },
+ { R200_VS_MATRIX_6_TEX3, "R200_VS_MATRIX_6_TEX3" },
+ { R200_VS_MATRIX_7_TEX4, "R200_VS_MATRIX_7_TEX4" },
+ { R200_VS_MATRIX_8_TEX5, "R200_VS_MATRIX_8_TEX5" },
+ { R200_VS_MAT_0_EMISS, "R200_VS_MAT_0_EMISS" },
+ { R200_VS_MAT_0_AMB, "R200_VS_MAT_0_AMB" },
+ { R200_VS_MAT_0_DIF, "R200_VS_MAT_0_DIF" },
+ { R200_VS_MAT_0_SPEC, "R200_VS_MAT_0_SPEC" },
+ { R200_VS_MAT_1_EMISS, "R200_VS_MAT_1_EMISS" },
+ { R200_VS_MAT_1_AMB, "R200_VS_MAT_1_AMB" },
+ { R200_VS_MAT_1_DIF, "R200_VS_MAT_1_DIF" },
+ { R200_VS_MAT_1_SPEC, "R200_VS_MAT_1_SPEC" },
+ { R200_VS_EYE2CLIP_MTX, "R200_VS_EYE2CLIP_MTX" },
+ { R200_VS_PNT_SPRITE_ATT_CONST, "R200_VS_PNT_SPRITE_ATT_CONST" },
+ { R200_VS_PNT_SPRITE_EYE_IN_MODEL, "R200_VS_PNT_SPRITE_EYE_IN_MODEL" },
+ { R200_VS_PNT_SPRITE_CLAMP, "R200_VS_PNT_SPRITE_CLAMP" },
+ { R200_VS_MAX, "R200_VS_MAX" },
+ { 1000, "" },
+};
+
+union fi { float f; int i; };
+
+#define ISVEC 1
+#define ISFLOAT 2
+#define TOUCHED 4
+
+struct reg {
+ int idx;
+ struct reg_names *closest;
+ int flags;
+ union fi current;
+ union fi *values;
+ int nvalues;
+ int nalloc;
+ float vmin, vmax;
+};
+
+
+static struct reg regs[Elements(reg_names)+1];
+static struct reg scalars[512+1];
+static struct reg vectors[512*4+1];
+
+static int total, total_changed, bufs;
+
+static void init_regs( void )
+{
+ struct reg_names *tmp;
+ int i;
+
+ for (i = 0 ; i < Elements(regs) ; i++) {
+ regs[i].idx = reg_names[i].idx;
+ regs[i].closest = &reg_names[i];
+ regs[i].flags = 0;
+ }
+
+ for (i = 0, tmp = scalar_names ; i < Elements(scalars) ; i++) {
+ if (tmp[1].idx == i) tmp++;
+ scalars[i].idx = i;
+ scalars[i].closest = tmp;
+ scalars[i].flags = ISFLOAT;
+ }
+
+ for (i = 0, tmp = vector_names ; i < Elements(vectors) ; i++) {
+ if (tmp[1].idx*4 == i) tmp++;
+ vectors[i].idx = i;
+ vectors[i].closest = tmp;
+ vectors[i].flags = ISFLOAT|ISVEC;
+ }
+
+ regs[Elements(regs)-1].idx = -1;
+ scalars[Elements(scalars)-1].idx = -1;
+ vectors[Elements(vectors)-1].idx = -1;
+}
+
+static int find_or_add_value( struct reg *reg, int val )
+{
+ int j;
+
+ for ( j = 0 ; j < reg->nvalues ; j++)
+ if ( val == reg->values[j].i )
+ return 1;
+
+ if (j == reg->nalloc) {
+ reg->nalloc += 5;
+ reg->nalloc *= 2;
+ reg->values = (union fi *) realloc( reg->values,
+ reg->nalloc * sizeof(union fi) );
+ }
+
+ reg->values[reg->nvalues++].i = val;
+ return 0;
+}
+
+static struct reg *lookup_reg( struct reg *tab, int reg )
+{
+ int i;
+
+ for (i = 0 ; tab[i].idx != -1 ; i++) {
+ if (tab[i].idx == reg)
+ return &tab[i];
+ }
+
+ fprintf(stderr, "*** unknown reg 0x%x\n", reg);
+ return 0;
+}
+
+
+static const char *get_reg_name( struct reg *reg )
+{
+ static char tmp[80];
+
+ if (reg->idx == reg->closest->idx)
+ return reg->closest->name;
+
+
+ if (reg->flags & ISVEC) {
+ if (reg->idx/4 != reg->closest->idx)
+ sprintf(tmp, "%s+%d[%d]",
+ reg->closest->name,
+ (reg->idx/4) - reg->closest->idx,
+ reg->idx%4);
+ else
+ sprintf(tmp, "%s[%d]", reg->closest->name, reg->idx%4);
+ }
+ else {
+ if (reg->idx != reg->closest->idx)
+ sprintf(tmp, "%s+%d", reg->closest->name, reg->idx - reg->closest->idx);
+ else
+ sprintf(tmp, "%s", reg->closest->name);
+ }
+
+ return tmp;
+}
+
+static int print_int_reg_assignment( struct reg *reg, int data )
+{
+ int changed = (reg->current.i != data);
+ int ever_seen = find_or_add_value( reg, data );
+
+ if (VERBOSE || (NORMAL && (changed || !ever_seen)))
+ fprintf(stderr, " %s <-- 0x%x", get_reg_name(reg), data);
+
+ if (NORMAL) {
+ if (!ever_seen)
+ fprintf(stderr, " *** BRAND NEW VALUE");
+ else if (changed)
+ fprintf(stderr, " *** CHANGED");
+ }
+
+ reg->current.i = data;
+
+ if (VERBOSE || (NORMAL && (changed || !ever_seen)))
+ fprintf(stderr, "\n");
+
+ return changed;
+}
+
+
+static int print_float_reg_assignment( struct reg *reg, float data )
+{
+ int changed = (reg->current.f != data);
+ int newmin = (data < reg->vmin);
+ int newmax = (data > reg->vmax);
+
+ if (VERBOSE || (NORMAL && (newmin || newmax || changed)))
+ fprintf(stderr, " %s <-- %.3f", get_reg_name(reg), data);
+
+ if (NORMAL) {
+ if (newmin) {
+ fprintf(stderr, " *** NEW MIN (prev %.3f)", reg->vmin);
+ reg->vmin = data;
+ }
+ else if (newmax) {
+ fprintf(stderr, " *** NEW MAX (prev %.3f)", reg->vmax);
+ reg->vmax = data;
+ }
+ else if (changed) {
+ fprintf(stderr, " *** CHANGED");
+ }
+ }
+
+ reg->current.f = data;
+
+ if (VERBOSE || (NORMAL && (newmin || newmax || changed)))
+ fprintf(stderr, "\n");
+
+ return changed;
+}
+
+static int print_reg_assignment( struct reg *reg, int data )
+{
+ reg->flags |= TOUCHED;
+ if (reg->flags & ISFLOAT)
+ return print_float_reg_assignment( reg, *(float *)&data );
+ else
+ return print_int_reg_assignment( reg, data );
+}
+
+static void print_reg( struct reg *reg )
+{
+ if (reg->flags & TOUCHED) {
+ if (reg->flags & ISFLOAT) {
+ fprintf(stderr, " %s == %f\n", get_reg_name(reg), reg->current.f);
+ } else {
+ fprintf(stderr, " %s == 0x%x\n", get_reg_name(reg), reg->current.i);
+ }
+ }
+}
+
+
+static void dump_state( void )
+{
+ int i;
+
+ for (i = 0 ; i < Elements(regs) ; i++)
+ print_reg( &regs[i] );
+
+ for (i = 0 ; i < Elements(scalars) ; i++)
+ print_reg( &scalars[i] );
+
+ for (i = 0 ; i < Elements(vectors) ; i++)
+ print_reg( &vectors[i] );
+}
+
+
+
+static int radeon_emit_packets(
+ drmRadeonCmdHeader header,
+ drmRadeonCmdBuffer *cmdbuf )
+{
+ int id = (int)header.packet.packet_id;
+ int sz = packet[id].len;
+ int *data = (int *)cmdbuf->buf;
+ int i;
+
+ if (sz * sizeof(int) > cmdbuf->bufsz) {
+ fprintf(stderr, "Packet overflows cmdbuf\n");
+ return -EINVAL;
+ }
+
+ if (!packet[id].name) {
+ fprintf(stderr, "*** Unknown packet 0 nr %d\n", id );
+ return -EINVAL;
+ }
+
+
+ if (VERBOSE)
+ fprintf(stderr, "Packet 0 reg %s nr %d\n", packet[id].name, sz );
+
+ for ( i = 0 ; i < sz ; i++) {
+ struct reg *reg = lookup_reg( regs, packet[id].start + i*4 );
+ if (print_reg_assignment( reg, data[i] ))
+ total_changed++;
+ total++;
+ }
+
+ cmdbuf->buf += sz * sizeof(int);
+ cmdbuf->bufsz -= sz * sizeof(int);
+ return 0;
+}
+
+
+static int radeon_emit_scalars(
+ drmRadeonCmdHeader header,
+ drmRadeonCmdBuffer *cmdbuf )
+{
+ int sz = header.scalars.count;
+ int *data = (int *)cmdbuf->buf;
+ int start = header.scalars.offset;
+ int stride = header.scalars.stride;
+ int i;
+
+ if (VERBOSE)
+ fprintf(stderr, "emit scalars, start %d stride %d nr %d (end %d)\n",
+ start, stride, sz, start + stride * sz);
+
+
+ for (i = 0 ; i < sz ; i++, start += stride) {
+ struct reg *reg = lookup_reg( scalars, start );
+ if (print_reg_assignment( reg, data[i] ))
+ total_changed++;
+ total++;
+ }
+
+ cmdbuf->buf += sz * sizeof(int);
+ cmdbuf->bufsz -= sz * sizeof(int);
+ return 0;
+}
+
+
+static int radeon_emit_scalars2(
+ drmRadeonCmdHeader header,
+ drmRadeonCmdBuffer *cmdbuf )
+{
+ int sz = header.scalars.count;
+ int *data = (int *)cmdbuf->buf;
+ int start = header.scalars.offset + 0x100;
+ int stride = header.scalars.stride;
+ int i;
+
+ if (VERBOSE)
+ fprintf(stderr, "emit scalars2, start %d stride %d nr %d (end %d)\n",
+ start, stride, sz, start + stride * sz);
+
+ if (start + stride * sz > 257) {
+ fprintf(stderr, "emit scalars OVERFLOW %d/%d/%d\n", start, stride, sz);
+ return -1;
+ }
+
+ for (i = 0 ; i < sz ; i++, start += stride) {
+ struct reg *reg = lookup_reg( scalars, start );
+ if (print_reg_assignment( reg, data[i] ))
+ total_changed++;
+ total++;
+ }
+
+ cmdbuf->buf += sz * sizeof(int);
+ cmdbuf->bufsz -= sz * sizeof(int);
+ return 0;
+}
+
+/* Check: inf/nan/extreme-size?
+ * Check: table start, end, nr, etc.
+ */
+static int radeon_emit_vectors(
+ drmRadeonCmdHeader header,
+ drmRadeonCmdBuffer *cmdbuf )
+{
+ int sz = header.vectors.count;
+ int *data = (int *)cmdbuf->buf;
+ int start = header.vectors.offset;
+ int stride = header.vectors.stride;
+ int i,j;
+
+ if (VERBOSE)
+ fprintf(stderr, "emit vectors, start %d stride %d nr %d (end %d) (0x%x)\n",
+ start, stride, sz, start + stride * sz, header.i);
+
+/* if (start + stride * (sz/4) > 128) { */
+/* fprintf(stderr, "emit vectors OVERFLOW %d/%d/%d\n", start, stride, sz); */
+/* return -1; */
+/* } */
+
+ for (i = 0 ; i < sz ; start += stride) {
+ int changed = 0;
+ for (j = 0 ; j < 4 ; i++,j++) {
+ struct reg *reg = lookup_reg( vectors, start*4+j );
+ if (print_reg_assignment( reg, data[i] ))
+ changed = 1;
+ }
+ if (changed)
+ total_changed += 4;
+ total += 4;
+ }
+
+
+ cmdbuf->buf += sz * sizeof(int);
+ cmdbuf->bufsz -= sz * sizeof(int);
+ return 0;
+}
+
+#if 0
+static int print_vertex_format( int vfmt )
+{
+ if (NORMAL) {
+ fprintf(stderr, " %s(%x): %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
+ "vertex format",
+ vfmt,
+ "xy,",
+ (vfmt & R200_VTX_Z0) ? "z," : "",
+ (vfmt & R200_VTX_W0) ? "w0," : "",
+ (vfmt & R200_VTX_FPCOLOR) ? "fpcolor," : "",
+ (vfmt & R200_VTX_FPALPHA) ? "fpalpha," : "",
+ (vfmt & R200_VTX_PKCOLOR) ? "pkcolor," : "",
+ (vfmt & R200_VTX_FPSPEC) ? "fpspec," : "",
+ (vfmt & R200_VTX_FPFOG) ? "fpfog," : "",
+ (vfmt & R200_VTX_PKSPEC) ? "pkspec," : "",
+ (vfmt & R200_VTX_ST0) ? "st0," : "",
+ (vfmt & R200_VTX_ST1) ? "st1," : "",
+ (vfmt & R200_VTX_Q1) ? "q1," : "",
+ (vfmt & R200_VTX_ST2) ? "st2," : "",
+ (vfmt & R200_VTX_Q2) ? "q2," : "",
+ (vfmt & R200_VTX_ST3) ? "st3," : "",
+ (vfmt & R200_VTX_Q3) ? "q3," : "",
+ (vfmt & R200_VTX_Q0) ? "q0," : "",
+ (vfmt & R200_VTX_N0) ? "n0," : "",
+ (vfmt & R200_VTX_XY1) ? "xy1," : "",
+ (vfmt & R200_VTX_Z1) ? "z1," : "",
+ (vfmt & R200_VTX_W1) ? "w1," : "",
+ (vfmt & R200_VTX_N1) ? "n1," : "");
+
+
+ if (!find_or_add_value( &others[V_VTXFMT], vfmt ))
+ fprintf(stderr, " *** NEW VALUE");
+
+ fprintf(stderr, "\n");
+ }
+
+ return 0;
+}
+#endif
+
+static char *primname[0x10] = {
+ "NONE",
+ "POINTS",
+ "LINES",
+ "LINE_STRIP",
+ "TRIANGLES",
+ "TRIANGLE_FAN",
+ "TRIANGLE_STRIP",
+ "RECT_LIST",
+ 0,
+ "3VRT_POINTS",
+ "3VRT_LINES",
+ "POINT_SPRITES",
+ "LINE_LOOP",
+ "QUADS",
+ "QUAD_STRIP",
+ "POLYGON",
+};
+
+static int print_prim_and_flags( int prim )
+{
+ int numverts;
+
+ if (NORMAL)
+ fprintf(stderr, " %s(%x): %s%s%s%s%s%s\n",
+ "prim flags",
+ prim,
+ ((prim & 0x30) == R200_VF_PRIM_WALK_IND) ? "IND," : "",
+ ((prim & 0x30) == R200_VF_PRIM_WALK_LIST) ? "LIST," : "",
+ ((prim & 0x30) == R200_VF_PRIM_WALK_RING) ? "RING," : "",
+ (prim & R200_VF_COLOR_ORDER_RGBA) ? "RGBA," : "BGRA, ",
+ (prim & R200_VF_INDEX_SZ_4) ? "INDX-32," : "",
+ (prim & R200_VF_TCL_OUTPUT_VTX_ENABLE) ? "TCL_OUT_VTX," : "");
+
+ numverts = prim>>16;
+
+ if (NORMAL)
+ fprintf(stderr, " prim: %s numverts %d\n", primname[prim&0xf], numverts);
+
+ switch (prim & 0xf) {
+ case R200_VF_PRIM_NONE:
+ case R200_VF_PRIM_POINTS:
+ if (numverts < 1) {
+ fprintf(stderr, "Bad nr verts for line %d\n", numverts);
+ return -1;
+ }
+ break;
+ case R200_VF_PRIM_LINES:
+ case R200_VF_PRIM_POINT_SPRITES:
+ if ((numverts & 1) || numverts == 0) {
+ fprintf(stderr, "Bad nr verts for line %d\n", numverts);
+ return -1;
+ }
+ break;
+ case R200_VF_PRIM_LINE_STRIP:
+ case R200_VF_PRIM_LINE_LOOP:
+ if (numverts < 2) {
+ fprintf(stderr, "Bad nr verts for line_strip %d\n", numverts);
+ return -1;
+ }
+ break;
+ case R200_VF_PRIM_TRIANGLES:
+ case R200_VF_PRIM_3VRT_POINTS:
+ case R200_VF_PRIM_3VRT_LINES:
+ case R200_VF_PRIM_RECT_LIST:
+ if (numverts % 3 || numverts == 0) {
+ fprintf(stderr, "Bad nr verts for tri %d\n", numverts);
+ return -1;
+ }
+ break;
+ case R200_VF_PRIM_TRIANGLE_FAN:
+ case R200_VF_PRIM_TRIANGLE_STRIP:
+ case R200_VF_PRIM_POLYGON:
+ if (numverts < 3) {
+ fprintf(stderr, "Bad nr verts for strip/fan %d\n", numverts);
+ return -1;
+ }
+ break;
+ case R200_VF_PRIM_QUADS:
+ if (numverts % 4 || numverts == 0) {
+ fprintf(stderr, "Bad nr verts for quad %d\n", numverts);
+ return -1;
+ }
+ break;
+ case R200_VF_PRIM_QUAD_STRIP:
+ if (numverts % 2 || numverts < 4) {
+ fprintf(stderr, "Bad nr verts for quadstrip %d\n", numverts);
+ return -1;
+ }
+ break;
+ default:
+ fprintf(stderr, "Bad primitive\n");
+ return -1;
+ }
+ return 0;
+}
+
+/* build in knowledge about each packet type
+ */
+static int radeon_emit_packet3( drmRadeonCmdBuffer *cmdbuf )
+{
+ int cmdsz;
+ int *cmd = (int *)cmdbuf->buf;
+ int *tmp;
+ int i, stride, size, start;
+
+ cmdsz = 2 + ((cmd[0] & RADEON_CP_PACKET_COUNT_MASK) >> 16);
+
+ if ((cmd[0] & RADEON_CP_PACKET_MASK) != RADEON_CP_PACKET3 ||
+ cmdsz * 4 > cmdbuf->bufsz ||
+ cmdsz > RADEON_CP_PACKET_MAX_DWORDS) {
+ fprintf(stderr, "Bad packet\n");
+ return -EINVAL;
+ }
+
+ switch( cmd[0] & ~RADEON_CP_PACKET_COUNT_MASK ) {
+ case R200_CP_CMD_NOP:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_NOP, %d dwords\n", cmdsz);
+ break;
+ case R200_CP_CMD_NEXT_CHAR:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_NEXT_CHAR, %d dwords\n", cmdsz);
+ break;
+ case R200_CP_CMD_PLY_NEXTSCAN:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_PLY_NEXTSCAN, %d dwords\n", cmdsz);
+ break;
+ case R200_CP_CMD_SET_SCISSORS:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_SET_SCISSORS, %d dwords\n", cmdsz);
+ break;
+ case R200_CP_CMD_LOAD_MICROCODE:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_LOAD_MICROCODE, %d dwords\n", cmdsz);
+ break;
+ case R200_CP_CMD_WAIT_FOR_IDLE:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_WAIT_FOR_IDLE, %d dwords\n", cmdsz);
+ break;
+
+ case R200_CP_CMD_3D_DRAW_VBUF:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_3D_DRAW_VBUF, %d dwords\n", cmdsz);
+/* print_vertex_format(cmd[1]); */
+ if (print_prim_and_flags(cmd[2]))
+ return -EINVAL;
+ break;
+
+ case R200_CP_CMD_3D_DRAW_IMMD:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_3D_DRAW_IMMD, %d dwords\n", cmdsz);
+ break;
+ case R200_CP_CMD_3D_DRAW_INDX: {
+ int neltdwords;
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_3D_DRAW_INDX, %d dwords\n", cmdsz);
+/* print_vertex_format(cmd[1]); */
+ if (print_prim_and_flags(cmd[2]))
+ return -EINVAL;
+ neltdwords = cmd[2]>>16;
+ neltdwords += neltdwords & 1;
+ neltdwords /= 2;
+ if (neltdwords + 3 != cmdsz)
+ fprintf(stderr, "Mismatch in DRAW_INDX, %d vs cmdsz %d\n",
+ neltdwords, cmdsz);
+ break;
+ }
+ case R200_CP_CMD_LOAD_PALETTE:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_LOAD_PALETTE, %d dwords\n", cmdsz);
+ break;
+ case R200_CP_CMD_3D_LOAD_VBPNTR:
+ if (NORMAL) {
+ fprintf(stderr, "PACKET3_3D_LOAD_VBPNTR, %d dwords\n", cmdsz);
+ fprintf(stderr, " nr arrays: %d\n", cmd[1]);
+ }
+
+ if (((cmd[1]/2)*3) + ((cmd[1]%2)*2) != cmdsz - 2) {
+ fprintf(stderr, " ****** MISMATCH %d/%d *******\n",
+ ((cmd[1]/2)*3) + ((cmd[1]%2)*2) + 2, cmdsz);
+ return -EINVAL;
+ }
+
+ if (NORMAL) {
+ tmp = cmd+2;
+ for (i = 0 ; i < cmd[1] ; i++) {
+ if (i & 1) {
+ stride = (tmp[0]>>24) & 0xff;
+ size = (tmp[0]>>16) & 0xff;
+ start = tmp[2];
+ tmp += 3;
+ }
+ else {
+ stride = (tmp[0]>>8) & 0xff;
+ size = (tmp[0]) & 0xff;
+ start = tmp[1];
+ }
+ fprintf(stderr, " array %d: start 0x%x vsize %d vstride %d\n",
+ i, start, size, stride );
+ }
+ }
+ break;
+ case R200_CP_CMD_PAINT:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_CNTL_PAINT, %d dwords\n", cmdsz);
+ break;
+ case R200_CP_CMD_BITBLT:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_CNTL_BITBLT, %d dwords\n", cmdsz);
+ break;
+ case R200_CP_CMD_SMALLTEXT:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_CNTL_SMALLTEXT, %d dwords\n", cmdsz);
+ break;
+ case R200_CP_CMD_HOSTDATA_BLT:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_CNTL_HOSTDATA_BLT, %d dwords\n",
+ cmdsz);
+ break;
+ case R200_CP_CMD_POLYLINE:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_CNTL_POLYLINE, %d dwords\n", cmdsz);
+ break;
+ case R200_CP_CMD_POLYSCANLINES:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_CNTL_POLYSCANLINES, %d dwords\n",
+ cmdsz);
+ break;
+ case R200_CP_CMD_PAINT_MULTI:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_CNTL_PAINT_MULTI, %d dwords\n",
+ cmdsz);
+ break;
+ case R200_CP_CMD_BITBLT_MULTI:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_CNTL_BITBLT_MULTI, %d dwords\n",
+ cmdsz);
+ break;
+ case R200_CP_CMD_TRANS_BITBLT:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_CNTL_TRANS_BITBLT, %d dwords\n",
+ cmdsz);
+ break;
+ case R200_CP_CMD_3D_DRAW_VBUF_2:
+ if (NORMAL)
+ fprintf(stderr, "R200_CP_CMD_3D_DRAW_VBUF_2, %d dwords\n",
+ cmdsz);
+ if (print_prim_and_flags(cmd[1]))
+ return -EINVAL;
+ break;
+ case R200_CP_CMD_3D_DRAW_IMMD_2:
+ if (NORMAL)
+ fprintf(stderr, "R200_CP_CMD_3D_DRAW_IMMD_2, %d dwords\n",
+ cmdsz);
+ if (print_prim_and_flags(cmd[1]))
+ return -EINVAL;
+ break;
+ case R200_CP_CMD_3D_DRAW_INDX_2:
+ if (NORMAL)
+ fprintf(stderr, "R200_CP_CMD_3D_DRAW_INDX_2, %d dwords\n",
+ cmdsz);
+ if (print_prim_and_flags(cmd[1]))
+ return -EINVAL;
+ break;
+ default:
+ fprintf(stderr, "UNKNOWN PACKET, %d dwords\n", cmdsz);
+ break;
+ }
+
+ cmdbuf->buf += cmdsz * 4;
+ cmdbuf->bufsz -= cmdsz * 4;
+ return 0;
+}
+
+
+/* Check cliprects for bounds, then pass on to above:
+ */
+static int radeon_emit_packet3_cliprect( drmRadeonCmdBuffer *cmdbuf )
+{
+ XF86DRIClipRectRec *boxes = (XF86DRIClipRectRec *)cmdbuf->boxes;
+ int i = 0;
+
+ if (VERBOSE && total_changed) {
+ dump_state();
+ total_changed = 0;
+ }
+
+ if (NORMAL) {
+ do {
+ if ( i < cmdbuf->nbox ) {
+ fprintf(stderr, "Emit box %d/%d %d,%d %d,%d\n",
+ i, cmdbuf->nbox,
+ boxes[i].x1, boxes[i].y1, boxes[i].x2, boxes[i].y2);
+ }
+ } while ( ++i < cmdbuf->nbox );
+ }
+
+ if (cmdbuf->nbox == 1)
+ cmdbuf->nbox = 0;
+
+ return radeon_emit_packet3( cmdbuf );
+}
+
+
+int r200SanityCmdBuffer( r200ContextPtr rmesa,
+ int nbox,
+ XF86DRIClipRectRec *boxes )
+{
+ int idx;
+ drmRadeonCmdBuffer cmdbuf;
+ drmRadeonCmdHeader header;
+ static int inited = 0;
+
+ if (!inited) {
+ init_regs();
+ inited = 1;
+ }
+
+
+ cmdbuf.buf = rmesa->store.cmd_buf;
+ cmdbuf.bufsz = rmesa->store.cmd_used;
+ cmdbuf.boxes = (drmClipRect *)boxes;
+ cmdbuf.nbox = nbox;
+
+ while ( cmdbuf.bufsz >= sizeof(header) ) {
+
+ header.i = *(int *)cmdbuf.buf;
+ cmdbuf.buf += sizeof(header);
+ cmdbuf.bufsz -= sizeof(header);
+
+ switch (header.header.cmd_type) {
+ case RADEON_CMD_PACKET:
+ if (radeon_emit_packets( header, &cmdbuf )) {
+ fprintf(stderr,"radeon_emit_packets failed\n");
+ return -EINVAL;
+ }
+ break;
+
+ case RADEON_CMD_SCALARS:
+ if (radeon_emit_scalars( header, &cmdbuf )) {
+ fprintf(stderr,"radeon_emit_scalars failed\n");
+ return -EINVAL;
+ }
+ break;
+
+ case RADEON_CMD_SCALARS2:
+ if (radeon_emit_scalars2( header, &cmdbuf )) {
+ fprintf(stderr,"radeon_emit_scalars failed\n");
+ return -EINVAL;
+ }
+ break;
+
+ case RADEON_CMD_VECTORS:
+ if (radeon_emit_vectors( header, &cmdbuf )) {
+ fprintf(stderr,"radeon_emit_vectors failed\n");
+ return -EINVAL;
+ }
+ break;
+
+ case RADEON_CMD_DMA_DISCARD:
+ idx = header.dma.buf_idx;
+ if (NORMAL)
+ fprintf(stderr, "RADEON_CMD_DMA_DISCARD buf %d\n", idx);
+ bufs++;
+ break;
+
+ case RADEON_CMD_PACKET3:
+ if (radeon_emit_packet3( &cmdbuf )) {
+ fprintf(stderr,"radeon_emit_packet3 failed\n");
+ return -EINVAL;
+ }
+ break;
+
+ case RADEON_CMD_PACKET3_CLIP:
+ if (radeon_emit_packet3_cliprect( &cmdbuf )) {
+ fprintf(stderr,"radeon_emit_packet3_clip failed\n");
+ return -EINVAL;
+ }
+ break;
+
+ case RADEON_CMD_WAIT:
+ break;
+
+ default:
+ fprintf(stderr,"bad cmd_type %d at %p\n",
+ header.header.cmd_type,
+ cmdbuf.buf - sizeof(header));
+ return -EINVAL;
+ }
+ }
+
+ if (0)
+ {
+ static int n = 0;
+ n++;
+ if (n == 10) {
+ fprintf(stderr, "Bufs %d Total emitted %d real changes %d (%.2f%%)\n",
+ bufs,
+ total, total_changed,
+ ((float)total_changed/(float)total*100.0));
+ fprintf(stderr, "Total emitted per buf: %.2f\n",
+ (float)total/(float)bufs);
+ fprintf(stderr, "Real changes per buf: %.2f\n",
+ (float)total_changed/(float)bufs);
+
+ bufs = n = total = total_changed = 0;
+ }
+ }
+
+ fprintf(stderr, "leaving %s\n\n\n", __FUNCTION__);
+
+ return 0;
+}
+
+static int check_in_heap( TMemBlock *p, TMemBlock *heap )
+{
+#if 1
+ return p->heap == heap;
+#else
+ while (heap && heap != p)
+ heap = heap->next;
+
+ return heap && heap == p;
+#endif
+}
+
+int r200ValidateTexObjs( r200ContextPtr rmesa )
+{
+ r200TexObjPtr t, next_t;
+ int i;
+
+ for ( i = 0 ; i < rmesa->texture.numHeaps ; i++ ) {
+ int nr = 0, nr2 = 0;
+ TMemBlock *heap = (TMemBlock *)rmesa->texture.heap[i];
+
+ /* Check each texture object has a MemBlock, and is linked into
+ * the correct heap.
+ *
+ * Check the texobj base address corresponds to the MemBlock
+ * range. Check the texobj size (recalculate???) fits within
+ * the MemBlock.
+ *
+ * Count the number of texobj's using this heap.
+ */
+ foreach_s ( t, next_t, &rmesa->texture.objects[i] ) {
+ int ofs = rmesa->r200Screen->texOffset[i] + t->memBlock->ofs;
+
+ if (!check_in_heap( t->memBlock, heap )) {
+ fprintf(stderr, "memblock for texobj %p not found in heap %d\n",
+ t, i);
+ return GL_FALSE;
+ }
+
+ if (t->tObj && (t->pp_txoffset != ofs || t->bufAddr != ofs)) {
+ fprintf(stderr, "Offsets mismatch: %x %x %x\n",
+ t->pp_txoffset, t->bufAddr, ofs );
+ abort();
+ return GL_FALSE;
+ }
+
+ if (t->totalSize > t->memBlock->size) {
+ fprintf(stderr, "Memblock not large enough: %d %d\n",
+ t->totalSize, t->memBlock->size);
+ return GL_FALSE;
+ }
+
+
+ nr++;
+ }
+
+ /* Validate the contents of the heap:
+ * - Ordering
+ * - Overlaps
+ * - Bounds
+ */
+ {
+ TMemBlock *p = heap;
+ int last_end = 0;
+
+ while (p) {
+ if (p->reserved) {
+ fprintf(stderr, " Block (%08x,%x), is reserved?!\n",
+ p->ofs, p->size);
+ return GL_FALSE;
+ }
+ if (p->ofs != last_end) {
+ fprintf(stderr, "nr2: %d last_end: %d p->ofs: %d\n",
+ nr2, last_end, p->ofs);
+ return GL_FALSE;
+ }
+ if (!p->reserved && !p->free)
+ nr2++;
+ last_end = p->ofs + p->size;
+ p = p->next;
+ }
+ }
+
+ if (nr != nr2) {
+ fprintf(stderr,
+ "Different number of texobj's (%d) and inuse memblocks (%d)\n",
+ nr, nr2);
+ return GL_FALSE;
+ }
+
+ if (0) fprintf(stderr, "nr: %d\n", nr);
+ }
+
+
+ /* Check swapped texobj's have zero memblocks
+ */
+ i = 0;
+ foreach_s ( t, next_t, &rmesa->texture.swapped ) {
+ if (t->memBlock) {
+ fprintf(stderr, "Swapped texobj %p has non-zero memblock %p\n",
+ t, t->memBlock);
+ return GL_FALSE;
+ }
+ i++;
+ }
+
+ if (0) fprintf(stderr, "nr_swapped: %d\n", i);
+
+ return GL_TRUE;
+}
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_sanity.h b/xc/lib/GL/mesa/src/drv/r200/r200_sanity.h
new file mode 100644
index 000000000..d52e08b4d
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_sanity.h
@@ -0,0 +1,11 @@
+#ifndef R200_SANITY_H
+#define R200_SANITY_H
+
+extern int r200SanityCmdBuffer( r200ContextPtr rmesa,
+ int nbox,
+ XF86DRIClipRectRec *boxes );
+
+
+extern int r200ValidateTexObjs( r200ContextPtr rmesa );
+
+#endif
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_screen.c b/xc/lib/GL/mesa/src/drv/r200/r200_screen.c
new file mode 100644
index 000000000..9997a7821
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_screen.c
@@ -0,0 +1,434 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include <dlfcn.h>
+
+#include "glheader.h"
+#include "imports.h"
+#include "context.h"
+
+#include "r200_screen.h"
+#include "r200_context.h"
+#include "r200_ioctl.h"
+
+
+#if 1
+/* Including xf86PciInfo.h introduces a bunch of errors...
+ */
+#define PCI_CHIP_R200_QD 0x5144
+#define PCI_CHIP_R200_QE 0x5145
+#define PCI_CHIP_R200_QF 0x5146
+#define PCI_CHIP_R200_QG 0x5147
+#define PCI_CHIP_R200_QY 0x5159
+#define PCI_CHIP_R200_QZ 0x515A
+#define PCI_CHIP_R200_LW 0x4C57
+#define PCI_CHIP_R200_LY 0x4C59
+#define PCI_CHIP_R200_LZ 0x4C5A
+#define PCI_CHIP_RV200_QW 0x5157
+#endif
+
+static r200ScreenPtr __r200Screen;
+
+/* Create the device specific screen private data struct.
+ */
+static r200ScreenPtr
+r200CreateScreen( __DRIscreenPrivate *sPriv )
+{
+ r200ScreenPtr r200Screen;
+ RADEONDRIPtr r200DRIPriv = (RADEONDRIPtr)sPriv->pDevPriv;
+
+ /* Check the DRI extension version */
+ if ( sPriv->driMajor != 4 || sPriv->driMinor < 0 ) {
+ __driUtilMessage( "R200 DRI driver expected DRI version 4.0.x "
+ "but got version %d.%d.%d",
+ sPriv->driMajor, sPriv->driMinor, sPriv->driPatch );
+ return NULL;
+ }
+
+ /* Check that the DDX driver version is compatible */
+ if ( sPriv->ddxMajor != 4 ||
+ sPriv->ddxMinor < 0 ) {
+ __driUtilMessage( "R200 DRI driver expected DDX driver version 4.0.x "
+ "but got version %d.%d.%d",
+ sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch );
+ return NULL;
+ }
+
+ /* Check that the DRM driver version is compatible
+ * -- R200 support added at 1.5.0.
+ */
+ if ( sPriv->drmMajor != 1 ||
+ sPriv->drmMinor < 5) {
+ __driUtilMessage( "R200 DRI driver expected DRM driver version 1.5.x "
+ "but got version %d.%d.%d",
+ sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch );
+ return NULL;
+ }
+
+ /* Allocate the private area */
+ r200Screen = (r200ScreenPtr) CALLOC( sizeof(*r200Screen) );
+ if ( !r200Screen ) {
+ __driUtilMessage("%s: CALLOC r200Screen struct failed",
+ __FUNCTION__);
+ return NULL;
+ }
+
+ /* Check if kernel module is new enough to support cube maps */
+ if (sPriv->drmMajor * 100 + sPriv->drmMinor >= 107)
+ r200Screen->drmSupportsCubeMaps = GL_TRUE;
+ else
+ r200Screen->drmSupportsCubeMaps = GL_FALSE;
+
+ switch ( r200DRIPriv->deviceID ) {
+ case PCI_CHIP_R200_QD:
+ case PCI_CHIP_R200_QE:
+ case PCI_CHIP_R200_QF:
+ case PCI_CHIP_R200_QG:
+ case PCI_CHIP_R200_QY:
+ case PCI_CHIP_R200_QZ:
+ case PCI_CHIP_RV200_QW:
+ case PCI_CHIP_R200_LW:
+ case PCI_CHIP_R200_LY:
+ case PCI_CHIP_R200_LZ:
+ __driUtilMessage("r200CreateScreen(): Device isn't an r200!\n");
+ FREE( r200Screen );
+ return NULL;
+ default:
+ r200Screen->chipset = R200_CHIPSET_R200;
+ break;
+ }
+
+
+ /* This is first since which regions we map depends on whether or
+ * not we are using a PCI card.
+ */
+ r200Screen->IsPCI = r200DRIPriv->IsPCI;
+
+ {
+ int ret;
+ drmRadeonGetParam gp;
+
+ gp.param = RADEON_PARAM_AGP_BUFFER_OFFSET;
+ gp.value = &r200Screen->agp_buffer_offset;
+
+ ret = drmCommandWriteRead( sPriv->fd, DRM_RADEON_GETPARAM,
+ &gp, sizeof(gp));
+ if (ret) {
+ FREE( r200Screen );
+ fprintf(stderr, "drmR200GetParam: %d\n", ret);
+ return NULL;
+ }
+
+ r200Screen->agp_texture_offset =
+ r200Screen->agp_buffer_offset + 2*1024*1024;
+
+
+ if (sPriv->drmMinor >= 6) {
+ gp.param = RADEON_PARAM_AGP_BASE;
+ gp.value = &r200Screen->agp_base;
+
+ ret = drmCommandWriteRead( sPriv->fd, DRM_RADEON_GETPARAM,
+ &gp, sizeof(gp));
+ if (ret) {
+ FREE( r200Screen );
+ fprintf(stderr, "drmR200GetParam (RADEON_PARAM_AGP_BUFFER_OFFSET): %d\n", ret);
+ return NULL;
+ }
+ }
+
+ if (sPriv->drmMinor >= 6) {
+ gp.param = RADEON_PARAM_IRQ_NR;
+ gp.value = &r200Screen->irq;
+
+ ret = drmCommandWriteRead( sPriv->fd, DRM_RADEON_GETPARAM,
+ &gp, sizeof(gp));
+ if (ret) {
+ FREE( r200Screen );
+ fprintf(stderr, "drmR200GetParam (RADEON_PARAM_IRQ_NR): %d\n", ret);
+ return NULL;
+ }
+ }
+
+ }
+
+ r200Screen->mmio.handle = r200DRIPriv->registerHandle;
+ r200Screen->mmio.size = r200DRIPriv->registerSize;
+ if ( drmMap( sPriv->fd,
+ r200Screen->mmio.handle,
+ r200Screen->mmio.size,
+ &r200Screen->mmio.map ) ) {
+ FREE( r200Screen );
+ __driUtilMessage("r200CreateScreen(): drmMap failed\n");
+ return NULL;
+ }
+
+ r200Screen->status.handle = r200DRIPriv->statusHandle;
+ r200Screen->status.size = r200DRIPriv->statusSize;
+ if ( drmMap( sPriv->fd,
+ r200Screen->status.handle,
+ r200Screen->status.size,
+ &r200Screen->status.map ) ) {
+ drmUnmap( r200Screen->mmio.map, r200Screen->mmio.size );
+ FREE( r200Screen );
+ __driUtilMessage("r200CreateScreen(): drmMap (2) failed\n");
+ return NULL;
+ }
+ r200Screen->scratch = (__volatile__ CARD32 *)
+ ((GLubyte *)r200Screen->status.map + RADEON_SCRATCH_REG_OFFSET);
+
+ r200Screen->buffers = drmMapBufs( sPriv->fd );
+ if ( !r200Screen->buffers ) {
+ drmUnmap( r200Screen->status.map, r200Screen->status.size );
+ drmUnmap( r200Screen->mmio.map, r200Screen->mmio.size );
+ FREE( r200Screen );
+ __driUtilMessage("r200CreateScreen(): drmMapBufs failed\n");
+ return NULL;
+ }
+
+ if ( !r200Screen->IsPCI ) {
+ r200Screen->agpTextures.handle = r200DRIPriv->agpTexHandle;
+ r200Screen->agpTextures.size = r200DRIPriv->agpTexMapSize;
+ if ( drmMap( sPriv->fd,
+ r200Screen->agpTextures.handle,
+ r200Screen->agpTextures.size,
+ (drmAddressPtr)&r200Screen->agpTextures.map ) ) {
+ drmUnmapBufs( r200Screen->buffers );
+ drmUnmap( r200Screen->status.map, r200Screen->status.size );
+ drmUnmap( r200Screen->mmio.map, r200Screen->mmio.size );
+ FREE( r200Screen );
+ __driUtilMessage("r200CreateScreen(): IsPCI failed\n");
+ return NULL;
+ }
+ }
+
+
+
+ r200Screen->cpp = r200DRIPriv->bpp / 8;
+ r200Screen->AGPMode = r200DRIPriv->AGPMode;
+
+ r200Screen->frontOffset = r200DRIPriv->frontOffset;
+ r200Screen->frontPitch = r200DRIPriv->frontPitch;
+ r200Screen->backOffset = r200DRIPriv->backOffset;
+ r200Screen->backPitch = r200DRIPriv->backPitch;
+ r200Screen->depthOffset = r200DRIPriv->depthOffset;
+ r200Screen->depthPitch = r200DRIPriv->depthPitch;
+
+ r200Screen->texOffset[RADEON_CARD_HEAP] = r200DRIPriv->textureOffset;
+ r200Screen->texSize[RADEON_CARD_HEAP] = r200DRIPriv->textureSize;
+ r200Screen->logTexGranularity[RADEON_CARD_HEAP] =
+ r200DRIPriv->log2TexGran;
+
+ if ( r200Screen->IsPCI ) {
+ r200Screen->numTexHeaps = RADEON_NR_TEX_HEAPS - 1;
+ r200Screen->texOffset[RADEON_AGP_HEAP] = 0;
+ r200Screen->texSize[RADEON_AGP_HEAP] = 0;
+ r200Screen->logTexGranularity[RADEON_AGP_HEAP] = 0;
+ } else {
+ r200Screen->numTexHeaps = RADEON_NR_TEX_HEAPS;
+ r200Screen->texOffset[RADEON_AGP_HEAP] =
+ r200DRIPriv->agpTexOffset + R200_AGP_TEX_OFFSET;
+ r200Screen->texSize[RADEON_AGP_HEAP] = r200DRIPriv->agpTexMapSize;
+ r200Screen->logTexGranularity[RADEON_AGP_HEAP] =
+ r200DRIPriv->log2AGPTexGran;
+ }
+
+
+ r200Screen->driScreen = sPriv;
+ r200Screen->sarea_priv_offset = r200DRIPriv->sarea_priv_offset;
+ return r200Screen;
+}
+
+/* Destroy the device specific screen private data struct.
+ */
+static void
+r200DestroyScreen( __DRIscreenPrivate *sPriv )
+{
+ r200ScreenPtr r200Screen = (r200ScreenPtr)sPriv->private;
+
+ if (!r200Screen)
+ return;
+
+ if ( !r200Screen->IsPCI ) {
+ drmUnmap( r200Screen->agpTextures.map,
+ r200Screen->agpTextures.size );
+ }
+ drmUnmapBufs( r200Screen->buffers );
+ drmUnmap( r200Screen->status.map, r200Screen->status.size );
+ drmUnmap( r200Screen->mmio.map, r200Screen->mmio.size );
+
+ FREE( r200Screen );
+ sPriv->private = NULL;
+}
+
+
+/* Initialize the driver specific screen private data.
+ */
+static GLboolean
+r200InitDriver( __DRIscreenPrivate *sPriv )
+{
+ __r200Screen = r200CreateScreen( sPriv );
+
+ sPriv->private = (void *) __r200Screen;
+
+ return sPriv->private ? GL_TRUE : GL_FALSE;
+}
+
+
+
+/* Create and initialize the Mesa and driver specific pixmap buffer
+ * data.
+ */
+static GLboolean
+r200CreateBuffer( __DRIscreenPrivate *driScrnPriv,
+ __DRIdrawablePrivate *driDrawPriv,
+ const __GLcontextModes *mesaVis,
+ GLboolean isPixmap )
+{
+ if (isPixmap) {
+ return GL_FALSE; /* not implemented */
+ }
+ else {
+ const GLboolean swDepth = GL_FALSE;
+ const GLboolean swAlpha = GL_FALSE;
+ const GLboolean swAccum = mesaVis->accumRedBits > 0;
+ const GLboolean swStencil = mesaVis->stencilBits > 0 &&
+ mesaVis->depthBits != 24;
+ driDrawPriv->driverPrivate = (void *)
+ _mesa_create_framebuffer( mesaVis,
+ swDepth,
+ swStencil,
+ swAccum,
+ swAlpha );
+ return (driDrawPriv->driverPrivate != NULL);
+ }
+}
+
+
+static void
+r200DestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
+{
+ _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
+}
+
+
+
+
+/* Fullscreen mode isn't used for much -- could be a way to shrink
+ * front/back buffers & get more texture memory if the client has
+ * changed the video resolution.
+ *
+ * Pageflipping is now done automatically whenever there is a single
+ * 3d client.
+ */
+static GLboolean
+r200OpenCloseFullScreen( __DRIcontextPrivate *driContextPriv )
+{
+ return GL_TRUE;
+}
+
+static struct __DriverAPIRec r200API = {
+ r200InitDriver,
+ r200DestroyScreen,
+ r200CreateContext,
+ r200DestroyContext,
+ r200CreateBuffer,
+ r200DestroyBuffer,
+ r200SwapBuffers,
+ r200MakeCurrent,
+ r200UnbindContext,
+ r200OpenCloseFullScreen,
+ r200OpenCloseFullScreen
+};
+
+
+
+/*
+ * This is the bootstrap function for the driver.
+ * The __driCreateScreen name is the symbol that libGL.so fetches.
+ * Return: pointer to a __DRIscreenPrivate.
+ *
+ */
+void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
+ int numConfigs, __GLXvisualConfig *config)
+{
+ __DRIscreenPrivate *psp;
+ psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &r200API);
+ return (void *) psp;
+}
+
+
+/* This function is called by libGL.so to allow the driver to dynamically
+ * extend libGL. We can add new GLX functions and/or new GL functions.
+ * Note that _mesa_create_context() will probably add most of the newer
+ * OpenGL extension functions into the dispatcher.
+ */
+void
+__driRegisterExtensions( void )
+{
+ /* dlopen ourself */
+ void *dll = dlopen(NULL, RTLD_GLOBAL);
+ if (dll) {
+ typedef void *(*registerFunc)(const char *funcName, void *funcAddr);
+ typedef void (*registerString)(const char *extName);
+
+ /* Get pointers to libGL's __glXRegisterGLXFunction
+ * and __glXRegisterGLXExtensionString, if they exist.
+ */
+ registerFunc regFunc = (registerFunc) dlsym(dll, "__glXRegisterGLXFunction");
+ registerString regString = (registerString) dlsym(dll, "__glXRegisterGLXExtensionString");
+
+ if (regFunc) {
+ /* register our GLX extensions with libGL */
+ void *p;
+ p = regFunc("glXAllocateMemoryNV", (void *) r200AllocateMemoryNV);
+ if (p)
+ ; /* XXX already registered - what to do, wrap? */
+
+ p = regFunc("glXFreeMemoryNV", (void *) r200FreeMemoryNV);
+ if (p)
+ ; /* XXX already registered - what to do, wrap? */
+
+ p = regFunc("glXGetAGPOffsetMESA", (void *) r200GetAGPOffset);
+ if (p)
+ ; /* XXX already registered - what to do, wrap? */
+ }
+
+ if (regString) {
+ regString("GLX_NV_vertex_array_range");
+ regString("GLX_MESA_agp_offset");
+ }
+
+ dlclose(dll);
+ }
+}
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_screen.h b/xc/lib/GL/mesa/src/drv/r200/r200_screen.h
new file mode 100644
index 000000000..fd0ff7ab6
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_screen.h
@@ -0,0 +1,97 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#ifndef __R200_SCREEN_H__
+#define __R200_SCREEN_H__
+
+#ifdef GLX_DIRECT_RENDERING
+
+#include "dri_util.h"
+#include "xf86drm.h"
+#include "radeon_common.h"
+#include "radeon_sarea.h"
+
+typedef struct {
+ drmHandle handle; /* Handle to the DRM region */
+ drmSize size; /* Size of the DRM region */
+ drmAddress map; /* Mapping of the DRM region */
+} r200RegionRec, *r200RegionPtr;
+
+#define R200_CHIPSET_R200 1
+#define R200_CHIPSET_MOBILITY 2
+
+
+#define R200_NR_TEX_HEAPS 2
+
+typedef struct {
+
+ int chipset;
+ int cpp;
+ int IsPCI; /* Current card is a PCI card */
+ int AGPMode;
+ unsigned int irq; /* IRQ number (0 means none) */
+
+ unsigned int frontOffset;
+ unsigned int frontPitch;
+ unsigned int backOffset;
+ unsigned int backPitch;
+
+ unsigned int depthOffset;
+ unsigned int depthPitch;
+
+ /* Shared texture data */
+ int numTexHeaps;
+ int texOffset[R200_NR_TEX_HEAPS];
+ int texSize[R200_NR_TEX_HEAPS];
+ int logTexGranularity[R200_NR_TEX_HEAPS];
+
+ r200RegionRec mmio;
+ r200RegionRec status;
+ r200RegionRec agpTextures;
+
+ drmBufMapPtr buffers;
+
+ __volatile__ CARD32 *scratch;
+
+ __DRIscreenPrivate *driScreen;
+ unsigned int sarea_priv_offset;
+ unsigned int agp_buffer_offset; /* offset in card memory space */
+ unsigned int agp_texture_offset; /* offset in card memory space */
+ unsigned int agp_base;
+
+ GLboolean drmSupportsCubeMaps; /* need radeon kernel module >=1.7 */
+} r200ScreenRec, *r200ScreenPtr;
+
+#endif
+#endif /* __R200_SCREEN_H__ */
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_span.c b/xc/lib/GL/mesa/src/drv/r200/r200_span.c
new file mode 100644
index 000000000..efbef9894
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_span.c
@@ -0,0 +1,430 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "swrast/swrast.h"
+
+#include "r200_context.h"
+#include "r200_ioctl.h"
+#include "r200_state.h"
+#include "r200_span.h"
+#include "r200_tex.h"
+
+#define DBG 0
+
+#define LOCAL_VARS \
+ r200ContextPtr rmesa = R200_CONTEXT(ctx); \
+ r200ScreenPtr r200Screen = rmesa->r200Screen; \
+ __DRIscreenPrivate *sPriv = rmesa->dri.screen; \
+ __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; \
+ GLuint pitch = r200Screen->frontPitch * r200Screen->cpp; \
+ GLuint height = dPriv->h; \
+ char *buf = (char *)(sPriv->pFB + \
+ rmesa->state.color.drawOffset + \
+ (dPriv->x * r200Screen->cpp) + \
+ (dPriv->y * pitch)); \
+ char *read_buf = (char *)(sPriv->pFB + \
+ rmesa->state.pixel.readOffset + \
+ (dPriv->x * r200Screen->cpp) + \
+ (dPriv->y * pitch)); \
+ GLuint p; \
+ (void) read_buf; (void) buf; (void) p
+
+#define LOCAL_DEPTH_VARS \
+ r200ContextPtr rmesa = R200_CONTEXT(ctx); \
+ r200ScreenPtr r200Screen = rmesa->r200Screen; \
+ __DRIscreenPrivate *sPriv = rmesa->dri.screen; \
+ __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; \
+ GLuint height = dPriv->h; \
+ GLuint xo = dPriv->x; \
+ GLuint yo = dPriv->y; \
+ char *buf = (char *)(sPriv->pFB + r200Screen->depthOffset); \
+ (void) buf
+
+#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
+
+
+#define CLIPPIXEL( _x, _y ) \
+ ((_x >= minx) && (_x < maxx) && (_y >= miny) && (_y < maxy))
+
+
+#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
+ if ( _y < miny || _y >= maxy ) { \
+ _n1 = 0, _x1 = x; \
+ } else { \
+ _n1 = _n; \
+ _x1 = _x; \
+ if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
+ if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
+ }
+
+#define Y_FLIP( _y ) (height - _y - 1)
+
+
+#define HW_LOCK()
+
+#define HW_CLIPLOOP() \
+ do { \
+ __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; \
+ int _nc = dPriv->numClipRects; \
+ \
+ while ( _nc-- ) { \
+ int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \
+ int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \
+ int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \
+ int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y;
+
+#define HW_ENDCLIPLOOP() \
+ } \
+ } while (0)
+
+#define HW_UNLOCK()
+
+
+
+/* ================================================================
+ * Color buffer
+ */
+
+/* 16 bit, RGB565 color spanline and pixel functions
+ */
+#define INIT_MONO_PIXEL(p, color) \
+ p = PACK_COLOR_565( color[0], color[1], color[2] )
+
+#define WRITE_RGBA( _x, _y, r, g, b, a ) \
+ *(GLushort *)(buf + _x*2 + _y*pitch) = ((((int)r & 0xf8) << 8) | \
+ (((int)g & 0xfc) << 3) | \
+ (((int)b & 0xf8) >> 3))
+
+#define WRITE_PIXEL( _x, _y, p ) \
+ *(GLushort *)(buf + _x*2 + _y*pitch) = p
+
+#define READ_RGBA( rgba, _x, _y ) \
+ do { \
+ GLushort p = *(GLushort *)(read_buf + _x*2 + _y*pitch); \
+ rgba[0] = ((p >> 8) & 0xf8) * 255 / 0xf8; \
+ rgba[1] = ((p >> 3) & 0xfc) * 255 / 0xfc; \
+ rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \
+ rgba[3] = 0xff; \
+ } while (0)
+
+#define TAG(x) r200##x##_RGB565
+#include "spantmp.h"
+
+/* 32 bit, ARGB8888 color spanline and pixel functions
+ */
+#undef INIT_MONO_PIXEL
+#define INIT_MONO_PIXEL(p, color) \
+ p = PACK_COLOR_8888( color[3], color[0], color[1], color[2] )
+
+#define WRITE_RGBA( _x, _y, r, g, b, a ) \
+do { \
+ *(GLuint *)(buf + _x*4 + _y*pitch) = ((b << 0) | \
+ (g << 8) | \
+ (r << 16) | \
+ (a << 24) ); \
+} while (0)
+
+#define WRITE_PIXEL( _x, _y, p ) \
+do { \
+ *(GLuint *)(buf + _x*4 + _y*pitch) = p; \
+} while (0)
+
+#define READ_RGBA( rgba, _x, _y ) \
+do { \
+ volatile GLuint *ptr = (volatile GLuint *)(read_buf + _x*4 + _y*pitch); \
+ GLuint p = *ptr; \
+ rgba[0] = (p >> 16) & 0xff; \
+ rgba[1] = (p >> 8) & 0xff; \
+ rgba[2] = (p >> 0) & 0xff; \
+ rgba[3] = (p >> 24) & 0xff; \
+} while (0)
+
+#define TAG(x) r200##x##_ARGB8888
+#include "spantmp.h"
+
+
+
+/* ================================================================
+ * Depth buffer
+ */
+
+/* The R200 has depth tiling on all the time, so we have to convert
+ * the x,y coordinates into the memory bus address (mba) in the same
+ * manner as the engine. In each case, the linear block address (ba)
+ * is calculated, and then wired with x and y to produce the final
+ * memory address.
+ */
+
+#define BIT(x,b) ((x & (1<<b))>>b)
+static GLuint r200_mba_z32( r200ContextPtr rmesa,
+ GLint x, GLint y )
+{
+ GLuint pitch = rmesa->r200Screen->frontPitch;
+ GLuint b = ((y & 0x3FF) >> 4) * ((pitch & 0xFFF) >> 5) + ((x & 0x3FF) >> 5);
+ GLuint a =
+ (BIT(x,0) << 2) |
+ (BIT(y,0) << 3) |
+ (BIT(x,1) << 4) |
+ (BIT(y,1) << 5) |
+ (BIT(x,3) << 6) |
+ (BIT(x,4) << 7) |
+ (BIT(x,2) << 8) |
+ (BIT(y,2) << 9) |
+ (BIT(y,3) << 10) |
+ (((pitch & 0x20) ? (b & 0x01) : ((b & 0x01) ^ (BIT(y,4)))) << 11) |
+ ((b >> 1) << 12);
+ return a;
+}
+
+static GLuint r200_mba_z16( r200ContextPtr rmesa, GLint x, GLint y )
+{
+ GLuint pitch = rmesa->r200Screen->frontPitch;
+ GLuint b = ((y & 0x3FF) >> 4) * ((pitch & 0xFFF) >> 6) + ((x & 0x3FF) >> 6);
+ GLuint a =
+ (BIT(x,0) << 1) |
+ (BIT(y,0) << 2) |
+ (BIT(x,1) << 3) |
+ (BIT(y,1) << 4) |
+ (BIT(x,2) << 5) |
+ (BIT(x,4) << 6) |
+ (BIT(x,5) << 7) |
+ (BIT(x,3) << 8) |
+ (BIT(y,2) << 9) |
+ (BIT(y,3) << 10) |
+ (((pitch & 0x40) ? (b & 0x01) : ((b & 0x01) ^ (BIT(y,4)))) << 11) |
+ ((b >> 1) << 12);
+ return a;
+}
+
+
+/* 16-bit depth buffer functions
+ */
+#define WRITE_DEPTH( _x, _y, d ) \
+ *(GLushort *)(buf + r200_mba_z16( rmesa, _x + xo, _y + yo )) = d;
+
+#define READ_DEPTH( d, _x, _y ) \
+ d = *(GLushort *)(buf + r200_mba_z16( rmesa, _x + xo, _y + yo ));
+
+#define TAG(x) r200##x##_16
+#include "depthtmp.h"
+
+/* 24 bit depth, 8 bit stencil depthbuffer functions
+ */
+#define WRITE_DEPTH( _x, _y, d ) \
+do { \
+ GLuint offset = r200_mba_z32( rmesa, _x + xo, _y + yo ); \
+ GLuint tmp = *(GLuint *)(buf + offset); \
+ tmp &= 0xff000000; \
+ tmp |= ((d) & 0x00ffffff); \
+ *(GLuint *)(buf + offset) = tmp; \
+} while (0)
+
+#define READ_DEPTH( d, _x, _y ) \
+ d = *(GLuint *)(buf + r200_mba_z32( rmesa, _x + xo, \
+ _y + yo )) & 0x00ffffff;
+
+#define TAG(x) r200##x##_24_8
+#include "depthtmp.h"
+
+
+/* ================================================================
+ * Stencil buffer
+ */
+
+/* 24 bit depth, 8 bit stencil depthbuffer functions
+ */
+#define WRITE_STENCIL( _x, _y, d ) \
+do { \
+ GLuint offset = r200_mba_z32( rmesa, _x + xo, _y + yo ); \
+ GLuint tmp = *(GLuint *)(buf + offset); \
+ tmp &= 0x00ffffff; \
+ tmp |= (((d) & 0xff) << 24); \
+ *(GLuint *)(buf + offset) = tmp; \
+} while (0)
+
+#define READ_STENCIL( d, _x, _y ) \
+do { \
+ GLuint offset = r200_mba_z32( rmesa, _x + xo, _y + yo ); \
+ GLuint tmp = *(GLuint *)(buf + offset); \
+ tmp &= 0xff000000; \
+ d = tmp >> 24; \
+} while (0)
+
+#define TAG(x) r200##x##_24_8
+#include "stenciltmp.h"
+
+
+/*
+ * This function is called to specify which buffer to read and write
+ * for software rasterization (swrast) fallbacks. This doesn't necessarily
+ * correspond to glDrawBuffer() or glReadBuffer() calls.
+ */
+static void r200SetBuffer( GLcontext *ctx,
+ GLframebuffer *colorBuffer,
+ GLuint bufferBit )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ switch ( bufferBit ) {
+ case FRONT_LEFT_BIT:
+ if ( rmesa->doPageFlip && rmesa->sarea->pfCurrentPage == 1 ) {
+ rmesa->state.pixel.readOffset = rmesa->r200Screen->backOffset;
+ rmesa->state.pixel.readPitch = rmesa->r200Screen->backPitch;
+ rmesa->state.color.drawOffset = rmesa->r200Screen->backOffset;
+ rmesa->state.color.drawPitch = rmesa->r200Screen->backPitch;
+ } else {
+ rmesa->state.pixel.readOffset = rmesa->r200Screen->frontOffset;
+ rmesa->state.pixel.readPitch = rmesa->r200Screen->frontPitch;
+ rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset;
+ rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch;
+ }
+ break;
+ case BACK_LEFT_BIT:
+ if ( rmesa->doPageFlip && rmesa->sarea->pfCurrentPage == 1 ) {
+ rmesa->state.pixel.readOffset = rmesa->r200Screen->frontOffset;
+ rmesa->state.pixel.readPitch = rmesa->r200Screen->frontPitch;
+ rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset;
+ rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch;
+ } else {
+ rmesa->state.pixel.readOffset = rmesa->r200Screen->backOffset;
+ rmesa->state.pixel.readPitch = rmesa->r200Screen->backPitch;
+ rmesa->state.color.drawOffset = rmesa->r200Screen->backOffset;
+ rmesa->state.color.drawPitch = rmesa->r200Screen->backPitch;
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "Bad bufferBit in r200SetBuffer()");
+ break;
+ }
+}
+
+/* Move locking out to get reasonable span performance (10x better
+ * than doing this in HW_LOCK above). WaitForIdle() is the main
+ * culprit.
+ */
+
+static void r200SpanRenderStart( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+
+ R200_FIREVERTICES( rmesa );
+ LOCK_HARDWARE( rmesa );
+ r200WaitForIdleLocked( rmesa );
+
+ /* Read & rewrite the first pixel in the frame buffer. This should
+ * be a noop, right? In fact without this conform fails as reading
+ * from the framebuffer sometimes produces old results -- the
+ * on-card read cache gets mixed up and doesn't notice that the
+ * framebuffer has been updated.
+ *
+ * In the worst case this is buggy too as p might get the wrong
+ * value first time, so really need a hidden pixel somewhere for this.
+ */
+ {
+ int p;
+ volatile int *read_buf = (volatile int *)(rmesa->dri.screen->pFB +
+ rmesa->state.pixel.readOffset);
+ p = *read_buf;
+ *read_buf = p;
+ }
+}
+
+static void r200SpanRenderFinish( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+ _swrast_flush( ctx );
+ UNLOCK_HARDWARE( rmesa );
+}
+
+void r200InitSpanFuncs( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
+
+ swdd->SetBuffer = r200SetBuffer;
+
+ switch ( rmesa->r200Screen->cpp ) {
+ case 2:
+ swdd->WriteRGBASpan = r200WriteRGBASpan_RGB565;
+ swdd->WriteRGBSpan = r200WriteRGBSpan_RGB565;
+ swdd->WriteMonoRGBASpan = r200WriteMonoRGBASpan_RGB565;
+ swdd->WriteRGBAPixels = r200WriteRGBAPixels_RGB565;
+ swdd->WriteMonoRGBAPixels = r200WriteMonoRGBAPixels_RGB565;
+ swdd->ReadRGBASpan = r200ReadRGBASpan_RGB565;
+ swdd->ReadRGBAPixels = r200ReadRGBAPixels_RGB565;
+ break;
+
+ case 4:
+ swdd->WriteRGBASpan = r200WriteRGBASpan_ARGB8888;
+ swdd->WriteRGBSpan = r200WriteRGBSpan_ARGB8888;
+ swdd->WriteMonoRGBASpan = r200WriteMonoRGBASpan_ARGB8888;
+ swdd->WriteRGBAPixels = r200WriteRGBAPixels_ARGB8888;
+ swdd->WriteMonoRGBAPixels = r200WriteMonoRGBAPixels_ARGB8888;
+ swdd->ReadRGBASpan = r200ReadRGBASpan_ARGB8888;
+ swdd->ReadRGBAPixels = r200ReadRGBAPixels_ARGB8888;
+ break;
+
+ default:
+ break;
+ }
+
+ switch ( rmesa->glCtx->Visual.depthBits ) {
+ case 16:
+ swdd->ReadDepthSpan = r200ReadDepthSpan_16;
+ swdd->WriteDepthSpan = r200WriteDepthSpan_16;
+ swdd->ReadDepthPixels = r200ReadDepthPixels_16;
+ swdd->WriteDepthPixels = r200WriteDepthPixels_16;
+ break;
+
+ case 24:
+ swdd->ReadDepthSpan = r200ReadDepthSpan_24_8;
+ swdd->WriteDepthSpan = r200WriteDepthSpan_24_8;
+ swdd->ReadDepthPixels = r200ReadDepthPixels_24_8;
+ swdd->WriteDepthPixels = r200WriteDepthPixels_24_8;
+
+ swdd->ReadStencilSpan = r200ReadStencilSpan_24_8;
+ swdd->WriteStencilSpan = r200WriteStencilSpan_24_8;
+ swdd->ReadStencilPixels = r200ReadStencilPixels_24_8;
+ swdd->WriteStencilPixels = r200WriteStencilPixels_24_8;
+ break;
+
+ default:
+ break;
+ }
+
+ swdd->SpanRenderStart = r200SpanRenderStart;
+ swdd->SpanRenderFinish = r200SpanRenderFinish;
+}
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_state.c b/xc/lib/GL/mesa/src/drv/r200/r200_state.c
new file mode 100644
index 000000000..acc21930d
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_state.c
@@ -0,0 +1,2155 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "api_arrayelt.h"
+#include "mmath.h"
+#include "enums.h"
+#include "colormac.h"
+
+#include "swrast/swrast.h"
+#include "array_cache/acache.h"
+#include "tnl/tnl.h"
+#include "tnl/t_pipeline.h"
+#include "swrast_setup/swrast_setup.h"
+
+
+#include "r200_context.h"
+#include "r200_ioctl.h"
+#include "r200_state.h"
+#include "r200_tcl.h"
+#include "r200_tex.h"
+#include "r200_swtcl.h"
+#include "r200_vtxfmt.h"
+
+
+/* =============================================================
+ * Alpha blending
+ */
+
+static void r200AlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ int pp_misc = rmesa->hw.ctx.cmd[CTX_PP_MISC];
+ GLubyte refByte;
+
+ CLAMPED_FLOAT_TO_UBYTE(refByte, ref);
+
+ R200_STATECHANGE( rmesa, ctx );
+
+ pp_misc &= ~(R200_ALPHA_TEST_OP_MASK | R200_REF_ALPHA_MASK);
+ pp_misc |= (refByte & R200_REF_ALPHA_MASK);
+
+ switch ( func ) {
+ case GL_NEVER:
+ pp_misc |= R200_ALPHA_TEST_FAIL;
+ break;
+ case GL_LESS:
+ pp_misc |= R200_ALPHA_TEST_LESS;
+ break;
+ case GL_EQUAL:
+ pp_misc |= R200_ALPHA_TEST_EQUAL;
+ break;
+ case GL_LEQUAL:
+ pp_misc |= R200_ALPHA_TEST_LEQUAL;
+ break;
+ case GL_GREATER:
+ pp_misc |= R200_ALPHA_TEST_GREATER;
+ break;
+ case GL_NOTEQUAL:
+ pp_misc |= R200_ALPHA_TEST_NEQUAL;
+ break;
+ case GL_GEQUAL:
+ pp_misc |= R200_ALPHA_TEST_GEQUAL;
+ break;
+ case GL_ALWAYS:
+ pp_misc |= R200_ALPHA_TEST_PASS;
+ break;
+ }
+
+ rmesa->hw.ctx.cmd[CTX_PP_MISC] = pp_misc;
+}
+
+static void r200BlendEquation( GLcontext *ctx, GLenum mode )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint b = rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] & ~R200_COMB_FCN_MASK;
+
+ switch ( mode ) {
+ case GL_FUNC_ADD_EXT:
+ case GL_LOGIC_OP:
+ b |= R200_COMB_FCN_ADD_CLAMP;
+ break;
+
+ case GL_FUNC_SUBTRACT_EXT:
+ b |= R200_COMB_FCN_SUB_CLAMP;
+ break;
+
+ case GL_FUNC_REVERSE_SUBTRACT_EXT:
+ b |= R200_COMB_FCN_RSUB_CLAMP;
+ break;
+
+ case GL_MIN_EXT:
+ b |= R200_COMB_FCN_MIN;
+ break;
+
+ case GL_MAX_EXT:
+ b |= R200_COMB_FCN_MAX;
+ break;
+
+ default:
+ break;
+ }
+
+ R200_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] = b;
+ if ( ctx->Color.ColorLogicOpEnabled ) {
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= R200_ROP_ENABLE;
+ } else {
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~R200_ROP_ENABLE;
+ }
+}
+
+static void r200BlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint b = rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] &
+ ~(R200_SRC_BLEND_MASK | R200_DST_BLEND_MASK);
+
+ switch ( ctx->Color.BlendSrcRGB ) {
+ case GL_ZERO:
+ b |= R200_SRC_BLEND_GL_ZERO;
+ break;
+ case GL_ONE:
+ b |= R200_SRC_BLEND_GL_ONE;
+ break;
+ case GL_DST_COLOR:
+ b |= R200_SRC_BLEND_GL_DST_COLOR;
+ break;
+ case GL_ONE_MINUS_DST_COLOR:
+ b |= R200_SRC_BLEND_GL_ONE_MINUS_DST_COLOR;
+ break;
+ case GL_SRC_ALPHA:
+ b |= R200_SRC_BLEND_GL_SRC_ALPHA;
+ break;
+ case GL_ONE_MINUS_SRC_ALPHA:
+ b |= R200_SRC_BLEND_GL_ONE_MINUS_SRC_ALPHA;
+ break;
+ case GL_DST_ALPHA:
+ b |= R200_SRC_BLEND_GL_DST_ALPHA;
+ break;
+ case GL_ONE_MINUS_DST_ALPHA:
+ b |= R200_SRC_BLEND_GL_ONE_MINUS_DST_ALPHA;
+ break;
+ case GL_SRC_ALPHA_SATURATE:
+ b |= R200_SRC_BLEND_GL_SRC_ALPHA_SATURATE;
+ break;
+ case GL_CONSTANT_COLOR:
+ b |= R200_SRC_BLEND_GL_CONST_COLOR;
+ break;
+ case GL_ONE_MINUS_CONSTANT_COLOR:
+ b |= R200_SRC_BLEND_GL_ONE_MINUS_CONST_COLOR;
+ break;
+ case GL_CONSTANT_ALPHA:
+ b |= R200_SRC_BLEND_GL_CONST_ALPHA;
+ break;
+ case GL_ONE_MINUS_CONSTANT_ALPHA:
+ b |= R200_SRC_BLEND_GL_ONE_MINUS_CONST_ALPHA;
+ break;
+ default:
+ break;
+ }
+
+ switch ( ctx->Color.BlendDstRGB ) {
+ case GL_ZERO:
+ b |= R200_DST_BLEND_GL_ZERO;
+ break;
+ case GL_ONE:
+ b |= R200_DST_BLEND_GL_ONE;
+ break;
+ case GL_SRC_COLOR:
+ b |= R200_DST_BLEND_GL_SRC_COLOR;
+ break;
+ case GL_ONE_MINUS_SRC_COLOR:
+ b |= R200_DST_BLEND_GL_ONE_MINUS_SRC_COLOR;
+ break;
+ case GL_SRC_ALPHA:
+ b |= R200_DST_BLEND_GL_SRC_ALPHA;
+ break;
+ case GL_ONE_MINUS_SRC_ALPHA:
+ b |= R200_DST_BLEND_GL_ONE_MINUS_SRC_ALPHA;
+ break;
+ case GL_DST_ALPHA:
+ b |= R200_DST_BLEND_GL_DST_ALPHA;
+ break;
+ case GL_ONE_MINUS_DST_ALPHA:
+ b |= R200_DST_BLEND_GL_ONE_MINUS_DST_ALPHA;
+ break;
+ case GL_CONSTANT_COLOR:
+ b |= R200_DST_BLEND_GL_CONST_COLOR;
+ break;
+ case GL_ONE_MINUS_CONSTANT_COLOR:
+ b |= R200_DST_BLEND_GL_ONE_MINUS_CONST_COLOR;
+ break;
+ case GL_CONSTANT_ALPHA:
+ b |= R200_DST_BLEND_GL_CONST_ALPHA;
+ break;
+ case GL_ONE_MINUS_CONSTANT_ALPHA:
+ b |= R200_DST_BLEND_GL_ONE_MINUS_CONST_ALPHA;
+ break;
+ default:
+ break;
+ }
+
+ R200_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] = b;
+}
+
+static void r200BlendFuncSeparate( GLcontext *ctx,
+ GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorA, GLenum dfactorA )
+{
+ r200BlendFunc( ctx, sfactorRGB, dfactorRGB );
+}
+
+
+/* =============================================================
+ * Depth testing
+ */
+
+static void r200DepthFunc( GLcontext *ctx, GLenum func )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ R200_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &= ~R200_Z_TEST_MASK;
+
+ switch ( ctx->Depth.Func ) {
+ case GL_NEVER:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_TEST_NEVER;
+ break;
+ case GL_LESS:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_TEST_LESS;
+ break;
+ case GL_EQUAL:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_TEST_EQUAL;
+ break;
+ case GL_LEQUAL:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_TEST_LEQUAL;
+ break;
+ case GL_GREATER:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_TEST_GREATER;
+ break;
+ case GL_NOTEQUAL:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_TEST_NEQUAL;
+ break;
+ case GL_GEQUAL:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_TEST_GEQUAL;
+ break;
+ case GL_ALWAYS:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_TEST_ALWAYS;
+ break;
+ }
+}
+
+
+static void r200DepthMask( GLcontext *ctx, GLboolean flag )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ R200_STATECHANGE( rmesa, ctx );
+
+ if ( ctx->Depth.Mask ) {
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_WRITE_ENABLE;
+ } else {
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &= ~R200_Z_WRITE_ENABLE;
+ }
+}
+
+
+/* =============================================================
+ * Fog
+ */
+
+
+static void r200Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *param )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ union { int i; float f; } c, d;
+ GLchan col[4];
+ GLuint i;
+
+ c.i = rmesa->hw.fog.cmd[FOG_C];
+ d.i = rmesa->hw.fog.cmd[FOG_D];
+
+ switch (pname) {
+ case GL_FOG_MODE:
+ if (!ctx->Fog.Enabled)
+ return;
+ R200_STATECHANGE(rmesa, tcl);
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~R200_TCL_FOG_MASK;
+ switch (ctx->Fog.Mode) {
+ case GL_LINEAR:
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= R200_TCL_FOG_LINEAR;
+ if (ctx->Fog.Start == ctx->Fog.End) {
+ c.f = 1.0F;
+ d.f = 1.0F;
+ }
+ else {
+ c.f = ctx->Fog.End/(ctx->Fog.End-ctx->Fog.Start);
+ d.f = -1.0/(ctx->Fog.End-ctx->Fog.Start);
+ }
+ break;
+ case GL_EXP:
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= R200_TCL_FOG_EXP;
+ c.f = 0.0;
+ d.f = -ctx->Fog.Density;
+ break;
+ case GL_EXP2:
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= R200_TCL_FOG_EXP2;
+ c.f = 0.0;
+ d.f = -(ctx->Fog.Density * ctx->Fog.Density);
+ break;
+ default:
+ return;
+ }
+ break;
+ case GL_FOG_DENSITY:
+ switch (ctx->Fog.Mode) {
+ case GL_EXP:
+ c.f = 0.0;
+ d.f = -ctx->Fog.Density;
+ break;
+ case GL_EXP2:
+ c.f = 0.0;
+ d.f = -(ctx->Fog.Density * ctx->Fog.Density);
+ break;
+ default:
+ break;
+ }
+ break;
+ case GL_FOG_START:
+ case GL_FOG_END:
+ if (ctx->Fog.Mode == GL_LINEAR) {
+ if (ctx->Fog.Start == ctx->Fog.End) {
+ c.f = 1.0F;
+ d.f = 1.0F;
+ } else {
+ c.f = ctx->Fog.End/(ctx->Fog.End-ctx->Fog.Start);
+ d.f = -1.0/(ctx->Fog.End-ctx->Fog.Start);
+ }
+ }
+ break;
+ case GL_FOG_COLOR:
+ R200_STATECHANGE( rmesa, ctx );
+ UNCLAMPED_FLOAT_TO_RGB_CHAN( col, ctx->Fog.Color );
+ i = r200PackColor( 4, col[0], col[1], col[2], 0 );
+ rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] &= ~R200_FOG_COLOR_MASK;
+ rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] |= i;
+ break;
+ case GL_FOG_COORDINATE_SOURCE_EXT:
+ /* What to do?
+ */
+ break;
+ default:
+ return;
+ }
+
+ if (c.i != rmesa->hw.fog.cmd[FOG_C] || d.i != rmesa->hw.fog.cmd[FOG_D]) {
+ R200_STATECHANGE( rmesa, fog );
+ rmesa->hw.fog.cmd[FOG_C] = c.i;
+ rmesa->hw.fog.cmd[FOG_D] = d.i;
+ }
+}
+
+
+/* =============================================================
+ * Scissoring
+ */
+
+
+static GLboolean intersect_rect( XF86DRIClipRectPtr out,
+ XF86DRIClipRectPtr a,
+ XF86DRIClipRectPtr b )
+{
+ *out = *a;
+ if ( b->x1 > out->x1 ) out->x1 = b->x1;
+ if ( b->y1 > out->y1 ) out->y1 = b->y1;
+ if ( b->x2 < out->x2 ) out->x2 = b->x2;
+ if ( b->y2 < out->y2 ) out->y2 = b->y2;
+ if ( out->x1 >= out->x2 ) return GL_FALSE;
+ if ( out->y1 >= out->y2 ) return GL_FALSE;
+ return GL_TRUE;
+}
+
+
+void r200RecalcScissorRects( r200ContextPtr rmesa )
+{
+ XF86DRIClipRectPtr out;
+ int i;
+
+ /* Grow cliprect store?
+ */
+ if (rmesa->state.scissor.numAllocedClipRects < rmesa->numClipRects) {
+ while (rmesa->state.scissor.numAllocedClipRects < rmesa->numClipRects) {
+ rmesa->state.scissor.numAllocedClipRects += 1; /* zero case */
+ rmesa->state.scissor.numAllocedClipRects *= 2;
+ }
+
+ if (rmesa->state.scissor.pClipRects)
+ FREE(rmesa->state.scissor.pClipRects);
+
+ rmesa->state.scissor.pClipRects =
+ MALLOC( rmesa->state.scissor.numAllocedClipRects *
+ sizeof(XF86DRIClipRectRec) );
+
+ if ( rmesa->state.scissor.pClipRects == NULL ) {
+ rmesa->state.scissor.numAllocedClipRects = 0;
+ return;
+ }
+ }
+
+ out = rmesa->state.scissor.pClipRects;
+ rmesa->state.scissor.numClipRects = 0;
+
+ for ( i = 0 ; i < rmesa->numClipRects ; i++ ) {
+ if ( intersect_rect( out,
+ &rmesa->pClipRects[i],
+ &rmesa->state.scissor.rect ) ) {
+ rmesa->state.scissor.numClipRects++;
+ out++;
+ }
+ }
+}
+
+
+static void r200UpdateScissor( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if ( rmesa->dri.drawable ) {
+ __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
+
+ int x = ctx->Scissor.X;
+ int y = dPriv->h - ctx->Scissor.Y - ctx->Scissor.Height;
+ int w = ctx->Scissor.X + ctx->Scissor.Width - 1;
+ int h = dPriv->h - ctx->Scissor.Y - 1;
+
+ rmesa->state.scissor.rect.x1 = x + dPriv->x;
+ rmesa->state.scissor.rect.y1 = y + dPriv->y;
+ rmesa->state.scissor.rect.x2 = w + dPriv->x + 1;
+ rmesa->state.scissor.rect.y2 = h + dPriv->y + 1;
+
+ r200RecalcScissorRects( rmesa );
+ }
+}
+
+
+static void r200Scissor( GLcontext *ctx,
+ GLint x, GLint y, GLsizei w, GLsizei h )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if ( ctx->Scissor.Enabled ) {
+ R200_FIREVERTICES( rmesa ); /* don't pipeline cliprect changes */
+ r200UpdateScissor( ctx );
+ }
+
+}
+
+
+/* =============================================================
+ * Culling
+ */
+
+static void r200CullFace( GLcontext *ctx, GLenum unused )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint s = rmesa->hw.set.cmd[SET_SE_CNTL];
+ GLuint t = rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL];
+
+ s |= R200_FFACE_SOLID | R200_BFACE_SOLID;
+ t &= ~(R200_CULL_FRONT | R200_CULL_BACK);
+
+ if ( ctx->Polygon.CullFlag ) {
+ switch ( ctx->Polygon.CullFaceMode ) {
+ case GL_FRONT:
+ s &= ~R200_FFACE_SOLID;
+ t |= R200_CULL_FRONT;
+ break;
+ case GL_BACK:
+ s &= ~R200_BFACE_SOLID;
+ t |= R200_CULL_BACK;
+ break;
+ case GL_FRONT_AND_BACK:
+ s &= ~(R200_FFACE_SOLID | R200_BFACE_SOLID);
+ t |= (R200_CULL_FRONT | R200_CULL_BACK);
+ break;
+ }
+ }
+
+ if ( rmesa->hw.set.cmd[SET_SE_CNTL] != s ) {
+ R200_STATECHANGE(rmesa, set );
+ rmesa->hw.set.cmd[SET_SE_CNTL] = s;
+ }
+
+ if ( rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] != t ) {
+ R200_STATECHANGE(rmesa, tcl );
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] = t;
+ }
+}
+
+static void r200FrontFace( GLcontext *ctx, GLenum mode )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ R200_STATECHANGE( rmesa, set );
+ rmesa->hw.set.cmd[SET_SE_CNTL] &= ~R200_FFACE_CULL_DIR_MASK;
+
+ R200_STATECHANGE( rmesa, tcl );
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~R200_CULL_FRONT_IS_CCW;
+
+ switch ( mode ) {
+ case GL_CW:
+ rmesa->hw.set.cmd[SET_SE_CNTL] |= R200_FFACE_CULL_CW;
+ break;
+ case GL_CCW:
+ rmesa->hw.set.cmd[SET_SE_CNTL] |= R200_FFACE_CULL_CCW;
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= R200_CULL_FRONT_IS_CCW;
+ break;
+ }
+}
+
+/* =============================================================
+ * Point state
+ */
+static void r200PointSize( GLcontext *ctx, GLfloat size )
+{
+ if (0) fprintf(stderr, "%s: %f\n", __FUNCTION__, size );
+}
+
+/* =============================================================
+ * Line state
+ */
+static void r200LineWidth( GLcontext *ctx, GLfloat widthf )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ R200_STATECHANGE( rmesa, lin );
+ R200_STATECHANGE( rmesa, set );
+
+ /* Line width is stored in U6.4 format.
+ */
+ rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] &= ~0xffff;
+ rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] |= (GLuint)(ctx->Line._Width * 16.0);
+
+ if ( widthf > 1.0 ) {
+ rmesa->hw.set.cmd[SET_SE_CNTL] |= R200_WIDELINE_ENABLE;
+ } else {
+ rmesa->hw.set.cmd[SET_SE_CNTL] &= ~R200_WIDELINE_ENABLE;
+ }
+}
+
+static void r200LineStipple( GLcontext *ctx, GLint factor, GLushort pattern )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ R200_STATECHANGE( rmesa, lin );
+ rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] =
+ ((((GLuint)factor & 0xff) << 16) | ((GLuint)pattern));
+}
+
+
+/* =============================================================
+ * Masks
+ */
+static void r200ColorMask( GLcontext *ctx,
+ GLboolean r, GLboolean g,
+ GLboolean b, GLboolean a )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint mask = r200PackColor( rmesa->r200Screen->cpp,
+ ctx->Color.ColorMask[RCOMP],
+ ctx->Color.ColorMask[GCOMP],
+ ctx->Color.ColorMask[BCOMP],
+ ctx->Color.ColorMask[ACOMP] );
+
+ GLuint flag = rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] & ~R200_PLANE_MASK_ENABLE;
+
+ if (!(r && g && b && a))
+ flag |= R200_PLANE_MASK_ENABLE;
+
+ if ( rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] != flag ) {
+ R200_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] = flag;
+ }
+
+ if ( rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK] != mask ) {
+ R200_STATECHANGE( rmesa, msk );
+ rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK] = mask;
+ }
+}
+
+
+/* =============================================================
+ * Polygon state
+ */
+
+static void r200PolygonOffset( GLcontext *ctx,
+ GLfloat factor, GLfloat units )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLfloat constant = units * rmesa->state.depth.scale;
+
+/* factor *= 2; */
+/* constant *= 2; */
+
+/* fprintf(stderr, "%s f:%f u:%f\n", __FUNCTION__, factor, constant); */
+
+ R200_STATECHANGE( rmesa, zbs );
+ rmesa->hw.zbs.cmd[ZBS_SE_ZBIAS_FACTOR] = *(GLuint *)&factor;
+ rmesa->hw.zbs.cmd[ZBS_SE_ZBIAS_CONSTANT] = *(GLuint *)&constant;
+}
+
+static void r200PolygonStipple( GLcontext *ctx, const GLubyte *mask )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint i;
+ drmRadeonStipple stipple;
+
+ /* Must flip pattern upside down.
+ */
+ for ( i = 0 ; i < 32 ; i++ ) {
+ rmesa->state.stipple.mask[31 - i] = ((GLuint *) mask)[i];
+ }
+
+ /* TODO: push this into cmd mechanism
+ */
+ R200_FIREVERTICES( rmesa );
+ LOCK_HARDWARE( rmesa );
+
+ /* FIXME: Use window x,y offsets into stipple RAM.
+ */
+ stipple.mask = rmesa->state.stipple.mask;
+ drmCommandWrite( rmesa->dri.fd, DRM_RADEON_STIPPLE,
+ &stipple, sizeof(drmRadeonStipple) );
+ UNLOCK_HARDWARE( rmesa );
+}
+
+static void r200PolygonMode( GLcontext *ctx, GLenum face, GLenum mode )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLboolean flag = (ctx->_TriangleCaps & DD_TRI_UNFILLED) != 0;
+
+ /* Can't generally do unfilled via tcl, but some good special
+ * cases work.
+ */
+ TCL_FALLBACK( ctx, R200_TCL_FALLBACK_UNFILLED, flag);
+ if (rmesa->TclFallback) {
+ r200ChooseRenderState( ctx );
+ r200ChooseVertexState( ctx );
+ }
+}
+
+
+/* =============================================================
+ * Rendering attributes
+ *
+ * We really don't want to recalculate all this every time we bind a
+ * texture. These things shouldn't change all that often, so it makes
+ * sense to break them out of the core texture state update routines.
+ */
+
+/* Examine lighting and texture state to determine if separate specular
+ * should be enabled.
+ */
+static void r200UpdateSpecular( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ CARD32 p = rmesa->hw.ctx.cmd[CTX_PP_CNTL];
+
+ R200_STATECHANGE( rmesa, tcl );
+ R200_STATECHANGE( rmesa, vtx );
+
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] &= ~(3<<R200_VTX_COLOR_0_SHIFT);
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] &= ~(3<<R200_VTX_COLOR_1_SHIFT);
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] &= ~R200_OUTPUT_COLOR_0;
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] &= ~R200_OUTPUT_COLOR_1;
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] &= ~R200_LIGHTING_ENABLE;
+ p &= ~R200_SPECULAR_ENABLE;
+
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] |= R200_DIFFUSE_SPECULAR_COMBINE;
+
+
+ if (ctx->Light.Enabled &&
+ ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) {
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] |=
+ ((R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT) |
+ (R200_VTX_FP_RGBA << R200_VTX_COLOR_1_SHIFT));
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] |= R200_OUTPUT_COLOR_0;
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] |= R200_OUTPUT_COLOR_1;
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] |= R200_LIGHTING_ENABLE;
+ p |= R200_SPECULAR_ENABLE;
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] &=
+ ~R200_DIFFUSE_SPECULAR_COMBINE;
+ }
+ else if (ctx->Light.Enabled) {
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] |=
+ ((R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT));
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] |= R200_OUTPUT_COLOR_0;
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] |= R200_LIGHTING_ENABLE;
+ } else if (ctx->Fog.ColorSumEnabled ) {
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] |=
+ ((R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT) |
+ (R200_VTX_FP_RGBA << R200_VTX_COLOR_1_SHIFT));
+ p |= R200_SPECULAR_ENABLE;
+ } else {
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] |=
+ ((R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT));
+ }
+
+ if (ctx->Fog.Enabled) {
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] |=
+ ((R200_VTX_FP_RGBA << R200_VTX_COLOR_1_SHIFT));
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] |= R200_OUTPUT_COLOR_1;
+ }
+
+ if ( rmesa->hw.ctx.cmd[CTX_PP_CNTL] != p ) {
+ R200_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] = p;
+ }
+
+ /* Update vertex/render formats
+ */
+ if (rmesa->TclFallback) {
+ r200ChooseRenderState( ctx );
+ r200ChooseVertexState( ctx );
+ }
+}
+
+
+/* =============================================================
+ * Materials
+ */
+
+
+/* Update on colormaterial, material emmissive/ambient,
+ * lightmodel.globalambient
+ */
+static void update_global_ambient( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ float *fcmd = (float *)R200_DB_STATE( glt );
+
+ /* Need to do more if both emmissive & ambient are PREMULT:
+ */
+ if ((rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_1] &
+ ((3 << R200_FRONT_EMISSIVE_SOURCE_SHIFT) |
+ (3 << R200_FRONT_AMBIENT_SOURCE_SHIFT))) == 0)
+ {
+ COPY_3V( &fcmd[GLT_RED],
+ ctx->Light.Material[0].Emission);
+ ACC_SCALE_3V( &fcmd[GLT_RED],
+ ctx->Light.Model.Ambient,
+ ctx->Light.Material[0].Ambient);
+ }
+ else
+ {
+ COPY_3V( &fcmd[GLT_RED], ctx->Light.Model.Ambient );
+ }
+
+ R200_DB_STATECHANGE(rmesa, &rmesa->hw.glt);
+}
+
+/* Update on change to
+ * - light[p].colors
+ * - light[p].enabled
+ * - material,
+ * - colormaterial enabled
+ * - colormaterial bitmask
+ */
+static void update_light_colors( GLcontext *ctx, GLuint p )
+{
+ struct gl_light *l = &ctx->Light.Light[p];
+
+/* fprintf(stderr, "%s\n", __FUNCTION__); */
+
+ if (l->Enabled) {
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ float *fcmd = (float *)R200_DB_STATE( lit[p] );
+ GLuint bitmask = ctx->Light.ColorMaterialBitmask;
+ struct gl_material *mat = &ctx->Light.Material[0];
+
+ COPY_4V( &fcmd[LIT_AMBIENT_RED], l->Ambient );
+ COPY_4V( &fcmd[LIT_DIFFUSE_RED], l->Diffuse );
+ COPY_4V( &fcmd[LIT_SPECULAR_RED], l->Specular );
+
+ if (!ctx->Light.ColorMaterialEnabled)
+ bitmask = 0;
+
+ if ((bitmask & FRONT_AMBIENT_BIT) == 0)
+ SELF_SCALE_3V( &fcmd[LIT_AMBIENT_RED], mat->Ambient );
+
+ if ((bitmask & FRONT_DIFFUSE_BIT) == 0)
+ SELF_SCALE_3V( &fcmd[LIT_DIFFUSE_RED], mat->Diffuse );
+
+ if ((bitmask & FRONT_SPECULAR_BIT) == 0)
+ SELF_SCALE_3V( &fcmd[LIT_SPECULAR_RED], mat->Specular );
+
+ R200_DB_STATECHANGE( rmesa, &rmesa->hw.lit[p] );
+ }
+}
+
+/* Also fallback for asym colormaterial mode in twoside lighting...
+ */
+static void check_twoside_fallback( GLcontext *ctx )
+{
+ GLboolean fallback = GL_FALSE;
+
+ if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) {
+ if (memcmp( &ctx->Light.Material[0],
+ &ctx->Light.Material[1],
+ sizeof(struct gl_material)) != 0)
+ fallback = GL_TRUE;
+ else if (ctx->Light.ColorMaterialEnabled &&
+ (ctx->Light.ColorMaterialBitmask & BACK_MATERIAL_BITS) !=
+ ((ctx->Light.ColorMaterialBitmask & FRONT_MATERIAL_BITS)<<1))
+ fallback = GL_TRUE;
+ }
+
+ TCL_FALLBACK( ctx, R200_TCL_FALLBACK_LIGHT_TWOSIDE, fallback );
+}
+
+static void r200ColorMaterial( GLcontext *ctx, GLenum face, GLenum mode )
+{
+ if (ctx->Light.ColorMaterialEnabled) {
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint light_model_ctl1 = rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_1];
+ GLuint mask = ctx->Light.ColorMaterialBitmask;
+
+ /* Default to PREMULT:
+ */
+ light_model_ctl1 &= ~((0xf << R200_FRONT_EMISSIVE_SOURCE_SHIFT) |
+ (0xf << R200_FRONT_AMBIENT_SOURCE_SHIFT) |
+ (0xf << R200_FRONT_DIFFUSE_SOURCE_SHIFT) |
+ (0xf << R200_FRONT_SPECULAR_SOURCE_SHIFT));
+
+ if (mask & FRONT_EMISSION_BIT) {
+ light_model_ctl1 |= (R200_LM1_SOURCE_VERTEX_COLOR_0 <<
+ R200_FRONT_EMISSIVE_SOURCE_SHIFT);
+ }
+
+ if (mask & FRONT_AMBIENT_BIT) {
+ light_model_ctl1 |= (R200_LM1_SOURCE_VERTEX_COLOR_0 <<
+ R200_FRONT_AMBIENT_SOURCE_SHIFT);
+ }
+
+ if (mask & FRONT_DIFFUSE_BIT) {
+ light_model_ctl1 |= (R200_LM1_SOURCE_VERTEX_COLOR_0 <<
+ R200_FRONT_DIFFUSE_SOURCE_SHIFT);
+ }
+
+ if (mask & FRONT_SPECULAR_BIT) {
+ light_model_ctl1 |= (R200_LM1_SOURCE_VERTEX_COLOR_0 <<
+ R200_FRONT_SPECULAR_SOURCE_SHIFT);
+ }
+
+ if (light_model_ctl1 != rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_1]) {
+ GLuint p;
+
+ R200_STATECHANGE( rmesa, tcl );
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_1] = light_model_ctl1;
+
+ for (p = 0 ; p < MAX_LIGHTS; p++)
+ update_light_colors( ctx, p );
+ update_global_ambient( ctx );
+ }
+ }
+
+ check_twoside_fallback( ctx );
+}
+
+void r200UpdateMaterial( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLfloat *fcmd = (GLfloat *)R200_DB_STATE( mtl[0] );
+ GLuint p;
+ GLuint mask = ~0;
+
+ if (ctx->Light.ColorMaterialEnabled)
+ mask &= ~ctx->Light.ColorMaterialBitmask;
+
+ if (R200_DEBUG & DEBUG_STATE)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+
+ if (mask & FRONT_EMISSION_BIT) {
+ fcmd[MTL_EMMISSIVE_RED] = ctx->Light.Material[0].Emission[0];
+ fcmd[MTL_EMMISSIVE_GREEN] = ctx->Light.Material[0].Emission[1];
+ fcmd[MTL_EMMISSIVE_BLUE] = ctx->Light.Material[0].Emission[2];
+ fcmd[MTL_EMMISSIVE_ALPHA] = ctx->Light.Material[0].Emission[3];
+ }
+ if (mask & FRONT_AMBIENT_BIT) {
+ fcmd[MTL_AMBIENT_RED] = ctx->Light.Material[0].Ambient[0];
+ fcmd[MTL_AMBIENT_GREEN] = ctx->Light.Material[0].Ambient[1];
+ fcmd[MTL_AMBIENT_BLUE] = ctx->Light.Material[0].Ambient[2];
+ fcmd[MTL_AMBIENT_ALPHA] = ctx->Light.Material[0].Ambient[3];
+ }
+ if (mask & FRONT_DIFFUSE_BIT) {
+ fcmd[MTL_DIFFUSE_RED] = ctx->Light.Material[0].Diffuse[0];
+ fcmd[MTL_DIFFUSE_GREEN] = ctx->Light.Material[0].Diffuse[1];
+ fcmd[MTL_DIFFUSE_BLUE] = ctx->Light.Material[0].Diffuse[2];
+ fcmd[MTL_DIFFUSE_ALPHA] = ctx->Light.Material[0].Diffuse[3];
+ }
+ if (mask & FRONT_SPECULAR_BIT) {
+ fcmd[MTL_SPECULAR_RED] = ctx->Light.Material[0].Specular[0];
+ fcmd[MTL_SPECULAR_GREEN] = ctx->Light.Material[0].Specular[1];
+ fcmd[MTL_SPECULAR_BLUE] = ctx->Light.Material[0].Specular[2];
+ fcmd[MTL_SPECULAR_ALPHA] = ctx->Light.Material[0].Specular[3];
+ }
+ if (mask & FRONT_SHININESS_BIT) {
+ fcmd[MTL_SHININESS] = ctx->Light.Material[0].Shininess;
+ }
+
+ if (R200_DB_STATECHANGE( rmesa, &rmesa->hw.mtl[0] )) {
+ for (p = 0 ; p < MAX_LIGHTS; p++)
+ update_light_colors( ctx, p );
+
+ check_twoside_fallback( ctx );
+ update_global_ambient( ctx );
+ }
+ else if (R200_DEBUG & (DEBUG_PRIMS|DEBUG_STATE))
+ fprintf(stderr, "%s: Elided noop material call\n", __FUNCTION__);
+}
+
+/* _NEW_LIGHT
+ * _NEW_MODELVIEW
+ * _MESA_NEW_NEED_EYE_COORDS
+ *
+ * Uses derived state from mesa:
+ * _VP_inf_norm
+ * _h_inf_norm
+ * _Position
+ * _NormDirection
+ * _ModelViewInvScale
+ * _NeedEyeCoords
+ * _EyeZDir
+ *
+ * which are calculated in light.c and are correct for the current
+ * lighting space (model or eye), hence dependencies on _NEW_MODELVIEW
+ * and _MESA_NEW_NEED_EYE_COORDS.
+ */
+static void update_light( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ /* Have to check these, or have an automatic shortcircuit mechanism
+ * to remove noop statechanges. (Or just do a better job on the
+ * front end).
+ */
+ {
+ GLuint tmp = rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0];
+
+ if (ctx->_NeedEyeCoords)
+ tmp &= ~R200_LIGHT_IN_MODELSPACE;
+ else
+ tmp |= R200_LIGHT_IN_MODELSPACE;
+
+ if (tmp != rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0])
+ {
+ R200_STATECHANGE( rmesa, tcl );
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] = tmp;
+ }
+ }
+
+ {
+ GLfloat *fcmd = (GLfloat *)R200_DB_STATE( eye );
+ fcmd[EYE_X] = ctx->_EyeZDir[0];
+ fcmd[EYE_Y] = ctx->_EyeZDir[1];
+ fcmd[EYE_Z] = - ctx->_EyeZDir[2];
+ fcmd[EYE_RESCALE_FACTOR] = ctx->_ModelViewInvScale;
+ R200_DB_STATECHANGE( rmesa, &rmesa->hw.eye );
+ }
+
+
+/* R200_STATECHANGE( rmesa, glt ); */
+
+ if (ctx->Light.Enabled) {
+ GLint p;
+ for (p = 0 ; p < MAX_LIGHTS; p++) {
+ if (ctx->Light.Light[p].Enabled) {
+ struct gl_light *l = &ctx->Light.Light[p];
+ GLfloat *fcmd = (GLfloat *)R200_DB_STATE( lit[p] );
+
+ if (l->EyePosition[3] == 0.0) {
+ COPY_3FV( &fcmd[LIT_POSITION_X], l->_VP_inf_norm );
+ COPY_3FV( &fcmd[LIT_DIRECTION_X], l->_h_inf_norm );
+ fcmd[LIT_POSITION_W] = 0;
+ fcmd[LIT_DIRECTION_W] = 0;
+ } else {
+ COPY_4V( &fcmd[LIT_POSITION_X], l->_Position );
+ fcmd[LIT_DIRECTION_X] = -l->_NormDirection[0];
+ fcmd[LIT_DIRECTION_Y] = -l->_NormDirection[1];
+ fcmd[LIT_DIRECTION_Z] = -l->_NormDirection[2];
+ fcmd[LIT_DIRECTION_W] = 0;
+ }
+
+ R200_DB_STATECHANGE( rmesa, &rmesa->hw.lit[p] );
+ }
+ }
+ }
+}
+
+static void r200Lightfv( GLcontext *ctx, GLenum light,
+ GLenum pname, const GLfloat *params )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLint p = light - GL_LIGHT0;
+ struct gl_light *l = &ctx->Light.Light[p];
+ GLfloat *fcmd = (GLfloat *)rmesa->hw.lit[p].cmd;
+
+
+ switch (pname) {
+ case GL_AMBIENT:
+ case GL_DIFFUSE:
+ case GL_SPECULAR:
+ update_light_colors( ctx, p );
+ break;
+
+ case GL_SPOT_DIRECTION:
+ /* picked up in update_light */
+ break;
+
+ case GL_POSITION: {
+ /* positions picked up in update_light, but can do flag here */
+ GLuint flag = (p&1)? R200_LIGHT_1_IS_LOCAL : R200_LIGHT_0_IS_LOCAL;
+ GLuint idx = TCL_PER_LIGHT_CTL_0 + p/2;
+
+ R200_STATECHANGE(rmesa, tcl);
+ if (l->EyePosition[3] != 0.0F)
+ rmesa->hw.tcl.cmd[idx] |= flag;
+ else
+ rmesa->hw.tcl.cmd[idx] &= ~flag;
+ break;
+ }
+
+ case GL_SPOT_EXPONENT:
+ R200_STATECHANGE(rmesa, lit[p]);
+ fcmd[LIT_SPOT_EXPONENT] = params[0];
+ break;
+
+ case GL_SPOT_CUTOFF: {
+ GLuint flag = (p&1) ? R200_LIGHT_1_IS_SPOT : R200_LIGHT_0_IS_SPOT;
+ GLuint idx = TCL_PER_LIGHT_CTL_0 + p/2;
+
+ R200_STATECHANGE(rmesa, lit[p]);
+ fcmd[LIT_SPOT_CUTOFF] = l->_CosCutoff;
+
+ R200_STATECHANGE(rmesa, tcl);
+ if (l->SpotCutoff != 180.0F)
+ rmesa->hw.tcl.cmd[idx] |= flag;
+ else
+ rmesa->hw.tcl.cmd[idx] &= ~flag;
+
+ break;
+ }
+
+ case GL_CONSTANT_ATTENUATION:
+ R200_STATECHANGE(rmesa, lit[p]);
+ fcmd[LIT_ATTEN_CONST] = params[0];
+ break;
+ case GL_LINEAR_ATTENUATION:
+ R200_STATECHANGE(rmesa, lit[p]);
+ fcmd[LIT_ATTEN_LINEAR] = params[0];
+ break;
+ case GL_QUADRATIC_ATTENUATION:
+ R200_STATECHANGE(rmesa, lit[p]);
+ fcmd[LIT_ATTEN_QUADRATIC] = params[0];
+ break;
+ default:
+ return;
+ }
+
+}
+
+
+
+
+static void r200LightModelfv( GLcontext *ctx, GLenum pname,
+ const GLfloat *param )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ switch (pname) {
+ case GL_LIGHT_MODEL_AMBIENT:
+ update_global_ambient( ctx );
+ break;
+
+ case GL_LIGHT_MODEL_LOCAL_VIEWER:
+ R200_STATECHANGE( rmesa, tcl );
+ if (ctx->Light.Model.LocalViewer)
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] |= R200_LOCAL_VIEWER;
+ else
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] &= ~R200_LOCAL_VIEWER;
+ break;
+
+ case GL_LIGHT_MODEL_TWO_SIDE:
+ R200_STATECHANGE( rmesa, tcl );
+ if (ctx->Light.Model.TwoSide)
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] |= R200_LIGHT_TWOSIDE;
+ else
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] &= ~R200_LIGHT_TWOSIDE;
+
+ check_twoside_fallback( ctx );
+
+ if (rmesa->TclFallback) {
+ r200ChooseRenderState( ctx );
+ r200ChooseVertexState( ctx );
+ }
+ break;
+
+ case GL_LIGHT_MODEL_COLOR_CONTROL:
+ r200UpdateSpecular(ctx);
+ break;
+
+ default:
+ break;
+ }
+}
+
+static void r200ShadeModel( GLcontext *ctx, GLenum mode )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint s = rmesa->hw.set.cmd[SET_SE_CNTL];
+
+ s &= ~(R200_DIFFUSE_SHADE_MASK |
+ R200_ALPHA_SHADE_MASK |
+ R200_SPECULAR_SHADE_MASK |
+ R200_FOG_SHADE_MASK);
+
+ switch ( mode ) {
+ case GL_FLAT:
+ s |= (R200_DIFFUSE_SHADE_FLAT |
+ R200_ALPHA_SHADE_FLAT |
+ R200_SPECULAR_SHADE_FLAT |
+ R200_FOG_SHADE_FLAT);
+ break;
+ case GL_SMOOTH:
+ s |= (R200_DIFFUSE_SHADE_GOURAUD |
+ R200_ALPHA_SHADE_GOURAUD |
+ R200_SPECULAR_SHADE_GOURAUD |
+ R200_FOG_SHADE_GOURAUD);
+ break;
+ default:
+ return;
+ }
+
+ if ( rmesa->hw.set.cmd[SET_SE_CNTL] != s ) {
+ R200_STATECHANGE( rmesa, set );
+ rmesa->hw.set.cmd[SET_SE_CNTL] = s;
+ }
+}
+
+
+/* =============================================================
+ * User clip planes
+ */
+
+static void r200ClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *eq )
+{
+ GLint p = (GLint) plane - (GLint) GL_CLIP_PLANE0;
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLint *ip = (GLint *)ctx->Transform._ClipUserPlane[p];
+
+ R200_STATECHANGE( rmesa, ucp[p] );
+ rmesa->hw.ucp[p].cmd[UCP_X] = ip[0];
+ rmesa->hw.ucp[p].cmd[UCP_Y] = ip[1];
+ rmesa->hw.ucp[p].cmd[UCP_Z] = ip[2];
+ rmesa->hw.ucp[p].cmd[UCP_W] = ip[3];
+}
+
+static void r200UpdateClipPlanes( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint p;
+
+ for (p = 0; p < ctx->Const.MaxClipPlanes; p++) {
+ if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
+ GLint *ip = (GLint *)ctx->Transform._ClipUserPlane[p];
+
+ R200_STATECHANGE( rmesa, ucp[p] );
+ rmesa->hw.ucp[p].cmd[UCP_X] = ip[0];
+ rmesa->hw.ucp[p].cmd[UCP_Y] = ip[1];
+ rmesa->hw.ucp[p].cmd[UCP_Z] = ip[2];
+ rmesa->hw.ucp[p].cmd[UCP_W] = ip[3];
+ }
+ }
+}
+
+
+/* =============================================================
+ * Stencil
+ */
+
+static void r200StencilFunc( GLcontext *ctx, GLenum func,
+ GLint ref, GLuint mask )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint refmask = ((ctx->Stencil.Ref[0] << R200_STENCIL_REF_SHIFT) |
+ (ctx->Stencil.ValueMask[0] << R200_STENCIL_MASK_SHIFT));
+
+ R200_STATECHANGE( rmesa, ctx );
+ R200_STATECHANGE( rmesa, msk );
+
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &= ~R200_STENCIL_TEST_MASK;
+ rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] &= ~(R200_STENCIL_REF_MASK|
+ R200_STENCIL_VALUE_MASK);
+
+ switch ( ctx->Stencil.Function[0] ) {
+ case GL_NEVER:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_TEST_NEVER;
+ break;
+ case GL_LESS:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_TEST_LESS;
+ break;
+ case GL_EQUAL:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_TEST_EQUAL;
+ break;
+ case GL_LEQUAL:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_TEST_LEQUAL;
+ break;
+ case GL_GREATER:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_TEST_GREATER;
+ break;
+ case GL_NOTEQUAL:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_TEST_NEQUAL;
+ break;
+ case GL_GEQUAL:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_TEST_GEQUAL;
+ break;
+ case GL_ALWAYS:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_TEST_ALWAYS;
+ break;
+ }
+
+ rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] |= refmask;
+}
+
+static void r200StencilMask( GLcontext *ctx, GLuint mask )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ R200_STATECHANGE( rmesa, msk );
+ rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] &= ~R200_STENCIL_WRITE_MASK;
+ rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] |=
+ (ctx->Stencil.WriteMask[0] << R200_STENCIL_WRITEMASK_SHIFT);
+}
+
+static void r200StencilOp( GLcontext *ctx, GLenum fail,
+ GLenum zfail, GLenum zpass )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ R200_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &= ~(R200_STENCIL_FAIL_MASK |
+ R200_STENCIL_ZFAIL_MASK |
+ R200_STENCIL_ZPASS_MASK);
+
+ switch ( ctx->Stencil.FailFunc[0] ) {
+ case GL_KEEP:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_FAIL_KEEP;
+ break;
+ case GL_ZERO:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_FAIL_ZERO;
+ break;
+ case GL_REPLACE:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_FAIL_REPLACE;
+ break;
+ case GL_INCR:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_FAIL_INC;
+ break;
+ case GL_DECR:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_FAIL_DEC;
+ break;
+ case GL_INCR_WRAP_EXT:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_FAIL_INC_WRAP;
+ break;
+ case GL_DECR_WRAP_EXT:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_FAIL_DEC_WRAP;
+ break;
+ case GL_INVERT:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_FAIL_INVERT;
+ break;
+ }
+
+ switch ( ctx->Stencil.ZFailFunc[0] ) {
+ case GL_KEEP:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZFAIL_KEEP;
+ break;
+ case GL_ZERO:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZFAIL_ZERO;
+ break;
+ case GL_REPLACE:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZFAIL_REPLACE;
+ break;
+ case GL_INCR:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZFAIL_INC;
+ break;
+ case GL_DECR:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZFAIL_DEC;
+ break;
+ case GL_INCR_WRAP_EXT:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZFAIL_INC_WRAP;
+ break;
+ case GL_DECR_WRAP_EXT:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZFAIL_DEC_WRAP;
+ break;
+ case GL_INVERT:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZFAIL_INVERT;
+ break;
+ }
+
+ switch ( ctx->Stencil.ZPassFunc[0] ) {
+ case GL_KEEP:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZPASS_KEEP;
+ break;
+ case GL_ZERO:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZPASS_ZERO;
+ break;
+ case GL_REPLACE:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZPASS_REPLACE;
+ break;
+ case GL_INCR:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZPASS_INC;
+ break;
+ case GL_DECR:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZPASS_DEC;
+ break;
+ case GL_INCR_WRAP_EXT:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZPASS_INC_WRAP;
+ break;
+ case GL_DECR_WRAP_EXT:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZPASS_DEC_WRAP;
+ break;
+ case GL_INVERT:
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZPASS_INVERT;
+ break;
+ }
+}
+
+static void r200ClearStencil( GLcontext *ctx, GLint s )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ rmesa->state.stencil.clear =
+ ((GLuint) ctx->Stencil.Clear |
+ (0xff << R200_STENCIL_MASK_SHIFT) |
+ (ctx->Stencil.WriteMask[0] << R200_STENCIL_WRITEMASK_SHIFT));
+}
+
+
+/* =============================================================
+ * Window position and viewport transformation
+ */
+
+/*
+ * To correctly position primitives:
+ */
+#define SUBPIXEL_X 0.125
+#define SUBPIXEL_Y 0.125
+
+void r200UpdateWindow( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
+ GLfloat xoffset = (GLfloat)dPriv->x;
+ GLfloat yoffset = (GLfloat)dPriv->y + dPriv->h;
+ const GLfloat *v = ctx->Viewport._WindowMap.m;
+
+ GLfloat sx = v[MAT_SX];
+ GLfloat tx = v[MAT_TX] + xoffset + SUBPIXEL_X;
+ GLfloat sy = - v[MAT_SY];
+ GLfloat ty = (- v[MAT_TY]) + yoffset + SUBPIXEL_Y;
+ GLfloat sz = v[MAT_SZ] * rmesa->state.depth.scale;
+ GLfloat tz = v[MAT_TZ] * rmesa->state.depth.scale;
+
+ R200_FIREVERTICES( rmesa );
+ R200_STATECHANGE( rmesa, vpt );
+
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_XSCALE] = *(GLuint *)&sx;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] = *(GLuint *)&tx;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_YSCALE] = *(GLuint *)&sy;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] = *(GLuint *)&ty;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZSCALE] = *(GLuint *)&sz;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZOFFSET] = *(GLuint *)&tz;
+}
+
+
+
+static void r200Viewport( GLcontext *ctx, GLint x, GLint y,
+ GLsizei width, GLsizei height )
+{
+ /* Don't pipeline viewport changes, conflict with window offset
+ * setting below. Could apply deltas to rescue pipelined viewport
+ * values, or keep the originals hanging around.
+ */
+ R200_FIREVERTICES( R200_CONTEXT(ctx) );
+ r200UpdateWindow( ctx );
+}
+
+static void r200DepthRange( GLcontext *ctx, GLclampd nearval,
+ GLclampd farval )
+{
+ r200UpdateWindow( ctx );
+}
+
+void r200UpdateViewportOffset( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
+ GLfloat xoffset = (GLfloat)dPriv->x;
+ GLfloat yoffset = (GLfloat)dPriv->y + dPriv->h;
+ const GLfloat *v = ctx->Viewport._WindowMap.m;
+
+ GLfloat tx = v[MAT_TX] + xoffset;
+ GLfloat ty = (- v[MAT_TY]) + yoffset;
+
+ if ( rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] != *(GLuint *)&tx ||
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] != *(GLuint *)&ty )
+ {
+ /* Note: this should also modify whatever data the context reset
+ * code uses...
+ */
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] = *(GLuint *)&tx;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] = *(GLuint *)&ty;
+
+ /* update polygon stipple x/y screen offset */
+ {
+ GLuint stx, sty;
+ GLuint m = rmesa->hw.msc.cmd[MSC_RE_MISC];
+
+ m &= ~(R200_STIPPLE_X_OFFSET_MASK |
+ R200_STIPPLE_Y_OFFSET_MASK);
+
+ /* add magic offsets, then invert */
+ stx = 31 - ((rmesa->dri.drawable->x - 1) & R200_STIPPLE_COORD_MASK);
+ sty = 31 - ((rmesa->dri.drawable->y + rmesa->dri.drawable->h - 1)
+ & R200_STIPPLE_COORD_MASK);
+
+ m |= ((stx << R200_STIPPLE_X_OFFSET_SHIFT) |
+ (sty << R200_STIPPLE_Y_OFFSET_SHIFT));
+
+ if ( rmesa->hw.msc.cmd[MSC_RE_MISC] != m ) {
+ R200_STATECHANGE( rmesa, msc );
+ rmesa->hw.msc.cmd[MSC_RE_MISC] = m;
+ }
+ }
+ }
+
+ r200UpdateScissor( ctx );
+}
+
+
+
+/* =============================================================
+ * Miscellaneous
+ */
+
+static void r200ClearColor( GLcontext *ctx, const GLfloat c[4] )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLubyte color[4];
+ CLAMPED_FLOAT_TO_UBYTE(color[0], c[0]);
+ CLAMPED_FLOAT_TO_UBYTE(color[1], c[1]);
+ CLAMPED_FLOAT_TO_UBYTE(color[2], c[2]);
+ CLAMPED_FLOAT_TO_UBYTE(color[3], c[3]);
+ rmesa->state.color.clear = r200PackColor( rmesa->r200Screen->cpp,
+ color[0], color[1],
+ color[2], color[3] );
+}
+
+
+static void r200RenderMode( GLcontext *ctx, GLenum mode )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ FALLBACK( rmesa, R200_FALLBACK_RENDER_MODE, (mode != GL_RENDER) );
+}
+
+
+static GLuint r200_rop_tab[] = {
+ R200_ROP_CLEAR,
+ R200_ROP_AND,
+ R200_ROP_AND_REVERSE,
+ R200_ROP_COPY,
+ R200_ROP_AND_INVERTED,
+ R200_ROP_NOOP,
+ R200_ROP_XOR,
+ R200_ROP_OR,
+ R200_ROP_NOR,
+ R200_ROP_EQUIV,
+ R200_ROP_INVERT,
+ R200_ROP_OR_REVERSE,
+ R200_ROP_COPY_INVERTED,
+ R200_ROP_OR_INVERTED,
+ R200_ROP_NAND,
+ R200_ROP_SET,
+};
+
+static void r200LogicOpCode( GLcontext *ctx, GLenum opcode )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint rop = (GLuint)opcode - GL_CLEAR;
+
+ ASSERT( rop < 16 );
+
+ R200_STATECHANGE( rmesa, msk );
+ rmesa->hw.msk.cmd[MSK_RB3D_ROPCNTL] = r200_rop_tab[rop];
+}
+
+
+void r200SetCliprects( r200ContextPtr rmesa, GLenum mode )
+{
+ __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
+
+ switch ( mode ) {
+ case GL_FRONT_LEFT:
+ rmesa->numClipRects = dPriv->numClipRects;
+ rmesa->pClipRects = (XF86DRIClipRectPtr)dPriv->pClipRects;
+ break;
+ case GL_BACK_LEFT:
+ /* Can't ignore 2d windows if we are page flipping.
+ */
+ if ( dPriv->numBackClipRects == 0 || rmesa->doPageFlip ) {
+ rmesa->numClipRects = dPriv->numClipRects;
+ rmesa->pClipRects = (XF86DRIClipRectPtr)dPriv->pClipRects;
+ }
+ else {
+ rmesa->numClipRects = dPriv->numBackClipRects;
+ rmesa->pClipRects = (XF86DRIClipRectPtr)dPriv->pBackClipRects;
+ }
+ break;
+ default:
+ fprintf(stderr, "bad mode in r200SetCliprects\n");
+ return;
+ }
+
+ if (rmesa->state.scissor.enabled)
+ r200RecalcScissorRects( rmesa );
+}
+
+
+static void r200DrawBuffer( GLcontext *ctx, GLenum mode )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if (R200_DEBUG & DEBUG_DRI)
+ fprintf(stderr, "%s %s\n", __FUNCTION__,
+ _mesa_lookup_enum_by_nr( mode ));
+
+ R200_FIREVERTICES(rmesa); /* don't pipeline cliprect changes */
+
+ /*
+ * _DrawDestMask is easier to cope with than <mode>.
+ */
+ switch ( ctx->Color._DrawDestMask ) {
+ case FRONT_LEFT_BIT:
+ FALLBACK( rmesa, R200_FALLBACK_DRAW_BUFFER, GL_FALSE );
+ r200SetCliprects( rmesa, GL_FRONT_LEFT );
+ break;
+ case BACK_LEFT_BIT:
+ FALLBACK( rmesa, R200_FALLBACK_DRAW_BUFFER, GL_FALSE );
+ r200SetCliprects( rmesa, GL_BACK_LEFT );
+ break;
+ default:
+ /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
+ FALLBACK( rmesa, R200_FALLBACK_DRAW_BUFFER, GL_TRUE );
+ return;
+ }
+
+ /* We want to update the s/w rast state too so that r200SetBuffer()
+ * gets called.
+ */
+ _swrast_DrawBuffer(ctx, mode);
+
+ R200_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = (rmesa->state.color.drawOffset &
+ R200_COLOROFFSET_MASK);
+ rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch;
+}
+
+
+static void r200ReadBuffer( GLcontext *ctx, GLenum mode )
+{
+ /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */
+}
+
+/* =============================================================
+ * State enable/disable
+ */
+
+static void r200Enable( GLcontext *ctx, GLenum cap, GLboolean state )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint p, flag;
+
+ if ( R200_DEBUG & DEBUG_STATE )
+ fprintf( stderr, "%s( %s = %s )\n", __FUNCTION__,
+ _mesa_lookup_enum_by_nr( cap ),
+ state ? "GL_TRUE" : "GL_FALSE" );
+
+ switch ( cap ) {
+ /* Fast track this one...
+ */
+ case GL_TEXTURE_1D:
+ case GL_TEXTURE_2D:
+ case GL_TEXTURE_3D:
+ break;
+
+ case GL_ALPHA_TEST:
+ R200_STATECHANGE( rmesa, ctx );
+ if (state) {
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_ALPHA_TEST_ENABLE;
+ } else {
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~R200_ALPHA_TEST_ENABLE;
+ }
+ break;
+
+ case GL_BLEND:
+ R200_STATECHANGE( rmesa, ctx );
+ if (state) {
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= R200_ALPHA_BLEND_ENABLE;
+ } else {
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~R200_ALPHA_BLEND_ENABLE;
+ }
+ if ( ctx->Color.ColorLogicOpEnabled ) {
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= R200_ROP_ENABLE;
+ } else {
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~R200_ROP_ENABLE;
+ }
+ break;
+
+ case GL_CLIP_PLANE0:
+ case GL_CLIP_PLANE1:
+ case GL_CLIP_PLANE2:
+ case GL_CLIP_PLANE3:
+ case GL_CLIP_PLANE4:
+ case GL_CLIP_PLANE5:
+ p = cap-GL_CLIP_PLANE0;
+ R200_STATECHANGE( rmesa, tcl );
+ if (state) {
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= (R200_UCP_ENABLE_0<<p);
+ r200ClipPlane( ctx, cap, NULL );
+ }
+ else {
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~(R200_UCP_ENABLE_0<<p);
+ }
+ break;
+
+ case GL_COLOR_MATERIAL:
+ r200ColorMaterial( ctx, 0, 0 );
+ if (!state)
+ r200UpdateMaterial( ctx );
+ break;
+
+ case GL_CULL_FACE:
+ r200CullFace( ctx, 0 );
+ break;
+
+ case GL_DEPTH_TEST:
+ R200_STATECHANGE(rmesa, ctx );
+ if ( state ) {
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= R200_Z_ENABLE;
+ } else {
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~R200_Z_ENABLE;
+ }
+ break;
+
+ case GL_DITHER:
+ R200_STATECHANGE(rmesa, ctx );
+ if ( state ) {
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= R200_DITHER_ENABLE;
+ } else {
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~R200_DITHER_ENABLE;
+ }
+ break;
+
+ case GL_FOG:
+ R200_STATECHANGE(rmesa, ctx );
+ if ( state ) {
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_FOG_ENABLE;
+ r200Fogfv( ctx, GL_FOG_MODE, 0 );
+ } else {
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~R200_FOG_ENABLE;
+ R200_STATECHANGE(rmesa, tcl);
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~R200_TCL_FOG_MASK;
+ }
+ r200UpdateSpecular( ctx ); /* for PK_SPEC */
+ break;
+
+ case GL_LIGHT0:
+ case GL_LIGHT1:
+ case GL_LIGHT2:
+ case GL_LIGHT3:
+ case GL_LIGHT4:
+ case GL_LIGHT5:
+ case GL_LIGHT6:
+ case GL_LIGHT7:
+ R200_STATECHANGE(rmesa, tcl);
+ p = cap - GL_LIGHT0;
+ if (p&1)
+ flag = (R200_LIGHT_1_ENABLE |
+ R200_LIGHT_1_ENABLE_AMBIENT |
+ R200_LIGHT_1_ENABLE_SPECULAR);
+ else
+ flag = (R200_LIGHT_0_ENABLE |
+ R200_LIGHT_0_ENABLE_AMBIENT |
+ R200_LIGHT_0_ENABLE_SPECULAR);
+
+ if (state)
+ rmesa->hw.tcl.cmd[p/2 + TCL_PER_LIGHT_CTL_0] |= flag;
+ else
+ rmesa->hw.tcl.cmd[p/2 + TCL_PER_LIGHT_CTL_0] &= ~flag;
+
+ /*
+ */
+ update_light_colors( ctx, p );
+ break;
+
+ case GL_LIGHTING:
+ r200UpdateSpecular(ctx);
+ check_twoside_fallback( ctx );
+ break;
+
+ case GL_LINE_SMOOTH:
+ R200_STATECHANGE( rmesa, ctx );
+ if ( state ) {
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_ANTI_ALIAS_LINE;
+ } else {
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~R200_ANTI_ALIAS_LINE;
+ }
+ break;
+
+ case GL_LINE_STIPPLE:
+ R200_STATECHANGE( rmesa, set );
+ if ( state ) {
+ rmesa->hw.set.cmd[SET_RE_CNTL] |= R200_PATTERN_ENABLE;
+ } else {
+ rmesa->hw.set.cmd[SET_RE_CNTL] &= ~R200_PATTERN_ENABLE;
+ }
+ break;
+
+ case GL_COLOR_LOGIC_OP:
+ R200_STATECHANGE( rmesa, ctx );
+ if ( state ) {
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= R200_ROP_ENABLE;
+ } else {
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~R200_ROP_ENABLE;
+ }
+ break;
+
+ case GL_NORMALIZE:
+ R200_STATECHANGE( rmesa, tcl );
+ if ( state ) {
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] |= R200_NORMALIZE_NORMALS;
+ } else {
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] &= ~R200_NORMALIZE_NORMALS;
+ }
+ break;
+
+ /* Pointsize registers on r200 don't seem to do anything. Maybe
+ * have to pass pointsizes as vertex parameters? In any case,
+ * setting pointmin == pointsizemax == 1.0, and doing nothing
+ * for aa is enough to satisfy conform.
+ */
+ case GL_POINT_SMOOTH:
+ break;
+
+ /* These don't really do anything, as we don't use the 3vtx
+ * primitives yet.
+ */
+#if 0
+ case GL_POLYGON_OFFSET_POINT:
+ R200_STATECHANGE( rmesa, set );
+ if ( state ) {
+ rmesa->hw.set.cmd[SET_SE_CNTL] |= R200_ZBIAS_ENABLE_POINT;
+ } else {
+ rmesa->hw.set.cmd[SET_SE_CNTL] &= ~R200_ZBIAS_ENABLE_POINT;
+ }
+ break;
+
+ case GL_POLYGON_OFFSET_LINE:
+ R200_STATECHANGE( rmesa, set );
+ if ( state ) {
+ rmesa->hw.set.cmd[SET_SE_CNTL] |= R200_ZBIAS_ENABLE_LINE;
+ } else {
+ rmesa->hw.set.cmd[SET_SE_CNTL] &= ~R200_ZBIAS_ENABLE_LINE;
+ }
+ break;
+#endif
+
+ case GL_POLYGON_OFFSET_FILL:
+ R200_STATECHANGE( rmesa, set );
+ if ( state ) {
+ rmesa->hw.set.cmd[SET_SE_CNTL] |= R200_ZBIAS_ENABLE_TRI;
+ } else {
+ rmesa->hw.set.cmd[SET_SE_CNTL] &= ~R200_ZBIAS_ENABLE_TRI;
+ }
+ break;
+
+ case GL_POLYGON_SMOOTH:
+ R200_STATECHANGE( rmesa, ctx );
+ if ( state ) {
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_ANTI_ALIAS_POLY;
+ } else {
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~R200_ANTI_ALIAS_POLY;
+ }
+ break;
+
+ case GL_POLYGON_STIPPLE:
+ R200_STATECHANGE(rmesa, set );
+ if ( state ) {
+ rmesa->hw.set.cmd[SET_RE_CNTL] |= R200_STIPPLE_ENABLE;
+ } else {
+ rmesa->hw.set.cmd[SET_RE_CNTL] &= ~R200_STIPPLE_ENABLE;
+ }
+ break;
+
+ case GL_RESCALE_NORMAL_EXT: {
+ GLboolean tmp = ctx->_NeedEyeCoords ? state : !state;
+ R200_STATECHANGE( rmesa, tcl );
+ if ( tmp ) {
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] |= R200_RESCALE_NORMALS;
+ } else {
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] &= ~R200_RESCALE_NORMALS;
+ }
+ break;
+ }
+
+ case GL_SCISSOR_TEST:
+ R200_FIREVERTICES( rmesa );
+ rmesa->state.scissor.enabled = state;
+ r200UpdateScissor( ctx );
+ break;
+
+ case GL_STENCIL_TEST:
+ if ( rmesa->state.stencil.hwBuffer ) {
+ R200_STATECHANGE( rmesa, ctx );
+ if ( state ) {
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= R200_STENCIL_ENABLE;
+ } else {
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~R200_STENCIL_ENABLE;
+ }
+ } else {
+ FALLBACK( rmesa, R200_FALLBACK_STENCIL, state );
+ }
+ break;
+
+ case GL_TEXTURE_GEN_Q:
+ case GL_TEXTURE_GEN_R:
+ case GL_TEXTURE_GEN_S:
+ case GL_TEXTURE_GEN_T:
+ /* Picked up in r200UpdateTextureState.
+ */
+ rmesa->recheck_texgen[ctx->Texture.CurrentUnit] = GL_TRUE;
+ break;
+
+ case GL_COLOR_SUM_EXT:
+ r200UpdateSpecular ( ctx );
+ break;
+
+ default:
+ return;
+ }
+}
+
+
+void r200LightingSpaceChange( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLboolean tmp;
+
+ if (R200_DEBUG & DEBUG_STATE)
+ fprintf(stderr, "%s %d BEFORE %x\n", __FUNCTION__, ctx->_NeedEyeCoords,
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0]);
+
+ if (ctx->_NeedEyeCoords)
+ tmp = ctx->Transform.RescaleNormals;
+ else
+ tmp = !ctx->Transform.RescaleNormals;
+
+ R200_STATECHANGE( rmesa, tcl );
+ if ( tmp ) {
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] |= R200_RESCALE_NORMALS;
+ } else {
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] &= ~R200_RESCALE_NORMALS;
+ }
+
+ if (R200_DEBUG & DEBUG_STATE)
+ fprintf(stderr, "%s %d AFTER %x\n", __FUNCTION__, ctx->_NeedEyeCoords,
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0]);
+}
+
+/* =============================================================
+ * Deferred state management - matrices, textures, other?
+ */
+
+
+
+
+static void upload_matrix( r200ContextPtr rmesa, GLfloat *src, int idx )
+{
+ float *dest = ((float *)R200_DB_STATE( mat[idx] ))+MAT_ELT_0;
+ int i;
+
+
+ for (i = 0 ; i < 4 ; i++) {
+ *dest++ = src[i];
+ *dest++ = src[i+4];
+ *dest++ = src[i+8];
+ *dest++ = src[i+12];
+ }
+
+ R200_DB_STATECHANGE( rmesa, &rmesa->hw.mat[idx] );
+}
+
+static void upload_matrix_t( r200ContextPtr rmesa, const GLfloat *src, int idx )
+{
+ float *dest = ((float *)R200_DB_STATE( mat[idx] ))+MAT_ELT_0;
+ memcpy(dest, src, 16*sizeof(float));
+ R200_DB_STATECHANGE( rmesa, &rmesa->hw.mat[idx] );
+}
+
+
+static void update_texturematrix( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+ GLuint tpc = rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_0];
+ GLuint compsel = rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL];
+ int unit;
+
+ if (R200_DEBUG & DEBUG_STATE)
+ fprintf(stderr, "%s before COMPSEL: %x\n", __FUNCTION__,
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL]);
+
+ rmesa->TexMatEnabled = 0;
+ rmesa->TexMatCompSel = 0;
+
+ for (unit = 0 ; unit < 2; unit++) {
+ if (!ctx->Texture.Unit[unit]._ReallyEnabled)
+ continue;
+
+ if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY) {
+ rmesa->TexMatEnabled |= (R200_TEXGEN_TEXMAT_0_ENABLE|
+ R200_TEXMAT_0_ENABLE) << unit;
+
+ rmesa->TexMatCompSel |= R200_OUTPUT_TEX_0 << unit;
+
+ if (rmesa->TexGenEnabled & (R200_TEXMAT_0_ENABLE << unit)) {
+ /* Need to preconcatenate any active texgen
+ * obj/eyeplane matrices:
+ */
+ _math_matrix_mul_matrix( &rmesa->tmpmat,
+ &rmesa->TexGenMatrix[unit],
+ ctx->TextureMatrixStack[unit].Top );
+ upload_matrix( rmesa, rmesa->tmpmat.m, R200_MTX_TEX0+unit );
+ }
+ else {
+ upload_matrix( rmesa, ctx->TextureMatrixStack[unit].Top->m,
+ R200_MTX_TEX0+unit );
+ }
+ }
+ else if (rmesa->TexGenEnabled & (R200_TEXMAT_0_ENABLE << unit)) {
+ upload_matrix( rmesa, rmesa->TexGenMatrix[unit].m,
+ R200_MTX_TEX0+unit );
+ }
+ }
+
+ tpc = (rmesa->TexMatEnabled | rmesa->TexGenEnabled);
+ if (tpc != rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_0] ||
+ rmesa->TexGenInputs != rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_1]) {
+ R200_STATECHANGE(rmesa, tcg);
+ rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_0] = tpc;
+ rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_1] = rmesa->TexGenInputs;
+ }
+
+ compsel &= ~R200_OUTPUT_TEX_MASK;
+ compsel |= rmesa->TexMatCompSel | rmesa->TexGenCompSel;
+ if (compsel != rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL]) {
+ R200_STATECHANGE(rmesa, vtx);
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] = compsel;
+ }
+}
+
+
+
+void r200ValidateState( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint new_state = rmesa->NewGLState;
+
+ if (new_state & _NEW_TEXTURE) {
+ r200UpdateTextureState( ctx );
+ new_state |= rmesa->NewGLState; /* may add TEXTURE_MATRIX */
+ }
+
+ /* Need an event driven matrix update?
+ */
+ if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION))
+ upload_matrix( rmesa, ctx->_ModelProjectMatrix.m, R200_MTX_MVP );
+
+ /* Need these for lighting (shouldn't upload otherwise)
+ */
+ if (new_state & (_NEW_MODELVIEW)) {
+ upload_matrix( rmesa, ctx->ModelviewMatrixStack.Top->m, R200_MTX_MV );
+ upload_matrix_t( rmesa, ctx->ModelviewMatrixStack.Top->inv, R200_MTX_IMV );
+ }
+
+ /* Does this need to be triggered on eg. modelview for
+ * texgen-derived objplane/eyeplane matrices?
+ */
+ if (new_state & (_NEW_TEXTURE|_NEW_TEXTURE_MATRIX)) {
+ update_texturematrix( ctx );
+ }
+
+ if (new_state & (_NEW_LIGHT|_NEW_MODELVIEW|_MESA_NEW_NEED_EYE_COORDS)) {
+ update_light( ctx );
+ }
+
+ /* emit all active clip planes if projection matrix changes.
+ */
+ if (new_state & (_NEW_PROJECTION)) {
+ if (ctx->Transform.ClipPlanesEnabled)
+ r200UpdateClipPlanes( ctx );
+ }
+
+
+ rmesa->NewGLState = 0;
+}
+
+
+static void r200InvalidateState( GLcontext *ctx, GLuint new_state )
+{
+ _swrast_InvalidateState( ctx, new_state );
+ _swsetup_InvalidateState( ctx, new_state );
+ _ac_InvalidateState( ctx, new_state );
+ _tnl_InvalidateState( ctx, new_state );
+ _ae_invalidate_state( ctx, new_state );
+ R200_CONTEXT(ctx)->NewGLState |= new_state;
+ r200VtxfmtInvalidate( ctx );
+}
+
+static void r200WrapRunPipeline( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ if (0)
+ fprintf(stderr, "%s, newstate: %x\n", __FUNCTION__, rmesa->NewGLState);
+
+ /* Validate state:
+ */
+ if (rmesa->NewGLState)
+ r200ValidateState( ctx );
+
+ if (tnl->vb.Material) {
+ TCL_FALLBACK( ctx, R200_TCL_FALLBACK_MATERIAL, GL_TRUE );
+ }
+
+ /* Run the pipeline.
+ */
+ _tnl_run_pipeline( ctx );
+
+ if (tnl->vb.Material) {
+ TCL_FALLBACK( ctx, R200_TCL_FALLBACK_MATERIAL, GL_FALSE );
+ r200UpdateMaterial( ctx ); /* not needed any more? */
+ }
+}
+
+
+/* Initialize the driver's state functions.
+ */
+void r200InitStateFuncs( GLcontext *ctx )
+{
+ ctx->Driver.UpdateState = r200InvalidateState;
+ ctx->Driver.LightingSpaceChange = r200LightingSpaceChange;
+
+ ctx->Driver.DrawBuffer = r200DrawBuffer;
+ ctx->Driver.ReadBuffer = r200ReadBuffer;
+
+ ctx->Driver.AlphaFunc = r200AlphaFunc;
+ ctx->Driver.BlendEquation = r200BlendEquation;
+ ctx->Driver.BlendFunc = r200BlendFunc;
+ ctx->Driver.BlendFuncSeparate = r200BlendFuncSeparate;
+ ctx->Driver.ClearColor = r200ClearColor;
+ ctx->Driver.ClearDepth = NULL;
+ ctx->Driver.ClearIndex = NULL;
+ ctx->Driver.ClearStencil = r200ClearStencil;
+ ctx->Driver.ClipPlane = r200ClipPlane;
+ ctx->Driver.ColorMask = r200ColorMask;
+ ctx->Driver.CullFace = r200CullFace;
+ ctx->Driver.DepthFunc = r200DepthFunc;
+ ctx->Driver.DepthMask = r200DepthMask;
+ ctx->Driver.DepthRange = r200DepthRange;
+ ctx->Driver.Enable = r200Enable;
+ ctx->Driver.Fogfv = r200Fogfv;
+ ctx->Driver.FrontFace = r200FrontFace;
+ ctx->Driver.Hint = NULL;
+ ctx->Driver.IndexMask = NULL;
+ ctx->Driver.LightModelfv = r200LightModelfv;
+ ctx->Driver.Lightfv = r200Lightfv;
+ ctx->Driver.LineStipple = r200LineStipple;
+ ctx->Driver.LineWidth = r200LineWidth;
+ ctx->Driver.LogicOpcode = r200LogicOpCode;
+ ctx->Driver.PolygonMode = r200PolygonMode;
+ ctx->Driver.PolygonOffset = r200PolygonOffset;
+ ctx->Driver.PolygonStipple = r200PolygonStipple;
+ ctx->Driver.PointSize = r200PointSize;
+ ctx->Driver.RenderMode = r200RenderMode;
+ ctx->Driver.Scissor = r200Scissor;
+ ctx->Driver.ShadeModel = r200ShadeModel;
+ ctx->Driver.StencilFunc = r200StencilFunc;
+ ctx->Driver.StencilMask = r200StencilMask;
+ ctx->Driver.StencilOp = r200StencilOp;
+ ctx->Driver.Viewport = r200Viewport;
+
+ /* Swrast hooks for imaging extensions:
+ */
+ ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
+ ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
+ ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
+ ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
+
+ TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange = r200UpdateMaterial;
+ TNL_CONTEXT(ctx)->Driver.RunPipeline = r200WrapRunPipeline;
+}
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_state.h b/xc/lib/GL/mesa/src/drv/r200/r200_state.h
new file mode 100644
index 000000000..4eefa1838
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_state.h
@@ -0,0 +1,68 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#ifndef __R200_STATE_H__
+#define __R200_STATE_H__
+
+#ifdef GLX_DIRECT_RENDERING
+
+#include "r200_context.h"
+
+extern void r200InitState( r200ContextPtr rmesa );
+extern void r200InitStateFuncs( GLcontext *ctx );
+
+extern void r200UpdateMaterial( GLcontext *ctx );
+
+extern void r200SetCliprects( r200ContextPtr rmesa, GLenum mode );
+extern void r200RecalcScissorRects( r200ContextPtr rmesa );
+extern void r200UpdateViewportOffset( GLcontext *ctx );
+extern void r200UpdateWindow( GLcontext *ctx );
+
+extern void r200ValidateState( GLcontext *ctx );
+
+extern void r200PrintDirty( r200ContextPtr rmesa,
+ const char *msg );
+
+
+extern void r200Fallback( GLcontext *ctx, GLuint bit, GLboolean mode );
+#define FALLBACK( rmesa, bit, mode ) do { \
+ if ( 0 ) fprintf( stderr, "FALLBACK in %s: #%d=%d\n", \
+ __FUNCTION__, bit, mode ); \
+ r200Fallback( rmesa->glCtx, bit, mode ); \
+} while (0)
+
+extern void r200LightingSpaceChange( GLcontext *ctx );
+
+#endif
+#endif
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_state_init.c b/xc/lib/GL/mesa/src/drv/r200/r200_state_init.c
new file mode 100644
index 000000000..6da6632db
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_state_init.c
@@ -0,0 +1,696 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "mmath.h"
+#include "enums.h"
+#include "colormac.h"
+#include "api_arrayelt.h"
+
+#include "swrast/swrast.h"
+#include "array_cache/acache.h"
+#include "tnl/tnl.h"
+#include "tnl/t_pipeline.h"
+#include "swrast_setup/swrast_setup.h"
+
+#include "r200_context.h"
+#include "r200_ioctl.h"
+#include "r200_state.h"
+#include "r200_tcl.h"
+#include "r200_tex.h"
+#include "r200_swtcl.h"
+#include "r200_vtxfmt.h"
+
+/* =============================================================
+ * State initialization
+ */
+
+void r200PrintDirty( r200ContextPtr rmesa, const char *msg )
+{
+ struct r200_state_atom *l;
+
+ fprintf(stderr, msg);
+ fprintf(stderr, ": ");
+
+ foreach(l, &(rmesa->hw.dirty)) {
+ fprintf(stderr, "%s, ", l->name);
+ }
+
+ fprintf(stderr, "\n");
+}
+
+static int cmdpkt( int id )
+{
+ drmRadeonCmdHeader h;
+ h.i = 0;
+ h.packet.cmd_type = RADEON_CMD_PACKET;
+ h.packet.packet_id = id;
+ return h.i;
+}
+
+static int cmdvec( int offset, int stride, int count )
+{
+ drmRadeonCmdHeader h;
+ h.i = 0;
+ h.vectors.cmd_type = RADEON_CMD_VECTORS;
+ h.vectors.offset = offset;
+ h.vectors.stride = stride;
+ h.vectors.count = count;
+ return h.i;
+}
+
+static int cmdscl( int offset, int stride, int count )
+{
+ drmRadeonCmdHeader h;
+ h.i = 0;
+ h.scalars.cmd_type = RADEON_CMD_SCALARS;
+ h.scalars.offset = offset;
+ h.scalars.stride = stride;
+ h.scalars.count = count;
+ return h.i;
+}
+
+static int cmdscl2( int offset, int stride, int count )
+{
+ drmRadeonCmdHeader h;
+ h.i = 0;
+ h.scalars.cmd_type = RADEON_CMD_SCALARS2;
+ h.scalars.offset = offset - 0x100;
+ h.scalars.stride = stride;
+ h.scalars.count = count;
+ return h.i;
+}
+
+#define CHECK( NM, FLAG ) \
+static GLboolean check_##NM( GLcontext *ctx, int idx ) \
+{ \
+ (void) idx; \
+ return FLAG; \
+}
+
+#define TCL_CHECK( NM, FLAG ) \
+static GLboolean check_##NM( GLcontext *ctx, int idx ) \
+{ \
+ r200ContextPtr rmesa = R200_CONTEXT(ctx); \
+ (void) idx; \
+ return !rmesa->TclFallback && (FLAG); \
+}
+
+
+
+CHECK( always, GL_TRUE )
+CHECK( tex_any, ctx->Texture._EnabledUnits )
+CHECK( tex, ctx->Texture.Unit[idx]._ReallyEnabled )
+CHECK( fog, ctx->Fog.Enabled )
+TCL_CHECK( tcl, GL_TRUE )
+TCL_CHECK( tcl_tex_any, ctx->Texture._EnabledUnits )
+TCL_CHECK( tcl_tex, ctx->Texture.Unit[idx]._ReallyEnabled )
+TCL_CHECK( tcl_lighting, ctx->Light.Enabled )
+TCL_CHECK( tcl_eyespace_or_lighting, ctx->_NeedEyeCoords || ctx->Light.Enabled )
+TCL_CHECK( tcl_light, ctx->Light.Enabled && ctx->Light.Light[idx].Enabled )
+TCL_CHECK( tcl_ucp, (ctx->Transform.ClipPlanesEnabled & (1 << idx)) )
+/* TCL_CHECK( tcl_eyespace_or_fog, ctx->_NeedEyeCoords || ctx->Fog.Enabled ) */
+
+
+static GLboolean check_tcl_eyespace_or_fog( GLcontext *ctx, int idx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ int res;
+ (void) idx;
+ res = !rmesa->TclFallback && (ctx->_NeedEyeCoords || ctx->Fog.Enabled);
+ fprintf(stderr, "%s: %d\n", __FUNCTION__, res);
+ return res;
+}
+
+
+/* Initialize the context's hardware state.
+ */
+void r200InitState( r200ContextPtr rmesa )
+{
+ GLcontext *ctx = rmesa->glCtx;
+ GLuint color_fmt, depth_fmt, i;
+
+ switch ( rmesa->r200Screen->cpp ) {
+ case 2:
+ color_fmt = R200_COLOR_FORMAT_RGB565;
+ break;
+ case 4:
+ color_fmt = R200_COLOR_FORMAT_ARGB8888;
+ break;
+ default:
+ fprintf( stderr, "Error: Unsupported pixel depth... exiting\n" );
+ exit( -1 );
+ }
+
+ rmesa->state.color.clear = 0x00000000;
+
+ switch ( ctx->Visual.depthBits ) {
+ case 16:
+ rmesa->state.depth.scale = 1.0 / (GLfloat)0xffff;
+ depth_fmt = R200_DEPTH_FORMAT_16BIT_INT_Z;
+ rmesa->state.stencil.clear = 0x00000000;
+ break;
+ case 24:
+ rmesa->state.depth.scale = 1.0 / (GLfloat)0xffffff;
+ depth_fmt = R200_DEPTH_FORMAT_24BIT_INT_Z;
+ rmesa->state.stencil.clear = 0xff000000;
+ break;
+ default:
+ fprintf( stderr, "Error: Unsupported depth %d... exiting\n",
+ ctx->Visual.depthBits );
+ exit( -1 );
+ }
+
+ /* Only have hw stencil when depth buffer is 24 bits deep */
+ rmesa->state.stencil.hwBuffer = ( ctx->Visual.stencilBits > 0 &&
+ ctx->Visual.depthBits == 24 );
+
+ rmesa->Fallback = 0;
+
+ if ( ctx->Visual.doubleBufferMode && rmesa->sarea->pfCurrentPage == 0 ) {
+ rmesa->state.color.drawOffset = rmesa->r200Screen->backOffset;
+ rmesa->state.color.drawPitch = rmesa->r200Screen->backPitch;
+ } else {
+ rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset;
+ rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch;
+ }
+
+ rmesa->state.pixel.readOffset = rmesa->state.color.drawOffset;
+ rmesa->state.pixel.readPitch = rmesa->state.color.drawPitch;
+
+ /* Initialize lists:
+ */
+ make_empty_list(&(rmesa->hw.dirty)); rmesa->hw.dirty.name = "DIRTY";
+ make_empty_list(&(rmesa->hw.clean)); rmesa->hw.clean.name = "CLEAN";
+
+
+#define ALLOC_STATE( ATOM, CHK, SZ, NM, IDX ) \
+ do { \
+ rmesa->hw.ATOM.cmd_size = SZ; \
+ rmesa->hw.ATOM.cmd = (int *)CALLOC(SZ * sizeof(int)); \
+ rmesa->hw.ATOM.lastcmd = (int *)CALLOC(SZ * sizeof(int)); \
+ rmesa->hw.ATOM.name = NM; \
+ rmesa->hw.ATOM.idx = IDX; \
+ rmesa->hw.ATOM.check = check_##CHK; \
+ insert_at_head(&(rmesa->hw.dirty), &(rmesa->hw.ATOM)); \
+ } while (0)
+
+
+ /* Allocate state buffers:
+ */
+ ALLOC_STATE( ctx, always, CTX_STATE_SIZE, "CTX/context", 0 );
+ ALLOC_STATE( set, always, SET_STATE_SIZE, "SET/setup", 0 );
+ ALLOC_STATE( lin, always, LIN_STATE_SIZE, "LIN/line", 0 );
+ ALLOC_STATE( msk, always, MSK_STATE_SIZE, "MSK/mask", 0 );
+ ALLOC_STATE( vpt, always, VPT_STATE_SIZE, "VPT/viewport", 0 );
+ ALLOC_STATE( vtx, always, VTX_STATE_SIZE, "VTX/vertex", 0 );
+ ALLOC_STATE( vap, always, VAP_STATE_SIZE, "VAP/vap", 0 );
+ ALLOC_STATE( vte, always, VTE_STATE_SIZE, "VTE/vte", 0 );
+ ALLOC_STATE( msc, always, MSC_STATE_SIZE, "MSC/misc", 0 );
+ ALLOC_STATE( cst, always, CST_STATE_SIZE, "CST/constant", 0 );
+ ALLOC_STATE( zbs, always, ZBS_STATE_SIZE, "ZBS/zbias", 0 );
+ ALLOC_STATE( tam, tex_any, TAM_STATE_SIZE, "TAM/tam", 0 );
+ ALLOC_STATE( tf, tex_any, TF_STATE_SIZE, "TF/tfactor", 0 );
+ ALLOC_STATE( tex[0], tex_any, TEX_STATE_SIZE, "TEX/tex-0", 0 );
+ ALLOC_STATE( tex[1], tex_any, TEX_STATE_SIZE, "TEX/tex-1", 1 );
+ ALLOC_STATE( cube[0], tex_any, CUBE_STATE_SIZE, "CUBE/tex-0", 0 );
+ ALLOC_STATE( cube[1], tex_any, CUBE_STATE_SIZE, "CUBE/tex-1", 1 );
+
+ ALLOC_STATE( tcl, tcl, TCL_STATE_SIZE, "TCL/tcl", 0 );
+ ALLOC_STATE( msl, tcl, MSL_STATE_SIZE, "MSL/matrix-select", 0 );
+ ALLOC_STATE( tcg, tcl, TCG_STATE_SIZE, "TCG/texcoordgen", 0 );
+ ALLOC_STATE( mtl[0], tcl_lighting, MTL_STATE_SIZE, "MTL0/material0", 0 );
+ ALLOC_STATE( grd, tcl, GRD_STATE_SIZE, "GRD/guard-band", 0 );
+ ALLOC_STATE( fog, fog, FOG_STATE_SIZE, "FOG/fog", 0 );
+ ALLOC_STATE( glt, tcl_lighting, GLT_STATE_SIZE, "GLT/light-global", 0 );
+ ALLOC_STATE( eye, tcl_lighting, EYE_STATE_SIZE, "EYE/eye-vector", 0 );
+ ALLOC_STATE( mat[R200_MTX_MV], tcl, MAT_STATE_SIZE, "MAT/modelview", 0 );
+ ALLOC_STATE( mat[R200_MTX_IMV], tcl, MAT_STATE_SIZE, "MAT/it-modelview", 0 );
+ ALLOC_STATE( mat[R200_MTX_MVP], tcl, MAT_STATE_SIZE, "MAT/modelproject", 0 );
+ ALLOC_STATE( mat[R200_MTX_TEX0], tcl_tex, MAT_STATE_SIZE, "MAT/texmat0", 0 );
+ ALLOC_STATE( mat[R200_MTX_TEX1], tcl_tex, MAT_STATE_SIZE, "MAT/texmat1", 1 );
+ ALLOC_STATE( ucp[0], tcl_ucp, UCP_STATE_SIZE, "UCP/userclip-0", 0 );
+ ALLOC_STATE( ucp[1], tcl_ucp, UCP_STATE_SIZE, "UCP/userclip-1", 1 );
+ ALLOC_STATE( ucp[2], tcl_ucp, UCP_STATE_SIZE, "UCP/userclip-2", 2 );
+ ALLOC_STATE( ucp[3], tcl_ucp, UCP_STATE_SIZE, "UCP/userclip-3", 3 );
+ ALLOC_STATE( ucp[4], tcl_ucp, UCP_STATE_SIZE, "UCP/userclip-4", 4 );
+ ALLOC_STATE( ucp[5], tcl_ucp, UCP_STATE_SIZE, "UCP/userclip-5", 5 );
+ ALLOC_STATE( lit[0], tcl_light, LIT_STATE_SIZE, "LIT/light-0", 0 );
+ ALLOC_STATE( lit[1], tcl_light, LIT_STATE_SIZE, "LIT/light-1", 1 );
+ ALLOC_STATE( lit[2], tcl_light, LIT_STATE_SIZE, "LIT/light-2", 2 );
+ ALLOC_STATE( lit[3], tcl_light, LIT_STATE_SIZE, "LIT/light-3", 3 );
+ ALLOC_STATE( lit[4], tcl_light, LIT_STATE_SIZE, "LIT/light-4", 4 );
+ ALLOC_STATE( lit[5], tcl_light, LIT_STATE_SIZE, "LIT/light-5", 5 );
+ ALLOC_STATE( lit[6], tcl_light, LIT_STATE_SIZE, "LIT/light-6", 6 );
+ ALLOC_STATE( lit[7], tcl_light, LIT_STATE_SIZE, "LIT/light-7", 7 );
+ ALLOC_STATE( pix[0], always, PIX_STATE_SIZE, "PIX/pixstage-0", 0 );
+ ALLOC_STATE( pix[1], tex, PIX_STATE_SIZE, "PIX/pixstage-1", 1 );
+
+
+ /* Fill in the packet headers:
+ */
+ rmesa->hw.ctx.cmd[CTX_CMD_0] = cmdpkt(RADEON_EMIT_PP_MISC);
+ rmesa->hw.ctx.cmd[CTX_CMD_1] = cmdpkt(RADEON_EMIT_PP_CNTL);
+ rmesa->hw.ctx.cmd[CTX_CMD_2] = cmdpkt(RADEON_EMIT_RB3D_COLORPITCH);
+ rmesa->hw.lin.cmd[LIN_CMD_0] = cmdpkt(RADEON_EMIT_RE_LINE_PATTERN);
+ rmesa->hw.lin.cmd[LIN_CMD_1] = cmdpkt(RADEON_EMIT_SE_LINE_WIDTH);
+ rmesa->hw.msk.cmd[MSK_CMD_0] = cmdpkt(RADEON_EMIT_RB3D_STENCILREFMASK);
+ rmesa->hw.vpt.cmd[VPT_CMD_0] = cmdpkt(RADEON_EMIT_SE_VPORT_XSCALE);
+ rmesa->hw.set.cmd[SET_CMD_0] = cmdpkt(RADEON_EMIT_SE_CNTL);
+ rmesa->hw.msc.cmd[MSC_CMD_0] = cmdpkt(RADEON_EMIT_RE_MISC);
+ rmesa->hw.cst.cmd[CST_CMD_0] = cmdpkt(R200_EMIT_PP_CNTL_X);
+ rmesa->hw.cst.cmd[CST_CMD_1] = cmdpkt(R200_EMIT_RB3D_DEPTHXY_OFFSET);
+ rmesa->hw.cst.cmd[CST_CMD_2] = cmdpkt(R200_EMIT_RE_AUX_SCISSOR_CNTL);
+ rmesa->hw.cst.cmd[CST_CMD_3] = cmdpkt(R200_EMIT_RE_SCISSOR_TL_0);
+ rmesa->hw.cst.cmd[CST_CMD_4] = cmdpkt(R200_EMIT_SE_VAP_CNTL_STATUS);
+ rmesa->hw.cst.cmd[CST_CMD_5] = cmdpkt(R200_EMIT_RE_POINTSIZE);
+ rmesa->hw.cst.cmd[CST_CMD_6] = cmdpkt(R200_EMIT_TCL_INPUT_VTX_VECTOR_ADDR_0);
+ rmesa->hw.tam.cmd[TAM_CMD_0] = cmdpkt(R200_EMIT_PP_TAM_DEBUG3);
+ rmesa->hw.tf.cmd[TF_CMD_0] = cmdpkt(R200_EMIT_TFACTOR_0);
+ rmesa->hw.tex[0].cmd[TEX_CMD_0] = cmdpkt(R200_EMIT_PP_TXFILTER_0);
+ rmesa->hw.tex[0].cmd[TEX_CMD_1] = cmdpkt(R200_EMIT_PP_TXOFFSET_0);
+ rmesa->hw.tex[1].cmd[TEX_CMD_0] = cmdpkt(R200_EMIT_PP_TXFILTER_1);
+ rmesa->hw.tex[1].cmd[TEX_CMD_1] = cmdpkt(R200_EMIT_PP_TXOFFSET_1);
+ rmesa->hw.cube[0].cmd[CUBE_CMD_0] = cmdpkt(R200_EMIT_PP_CUBIC_FACES_0);
+ rmesa->hw.cube[0].cmd[CUBE_CMD_1] = cmdpkt(R200_EMIT_PP_CUBIC_OFFSETS_0);
+ rmesa->hw.cube[1].cmd[CUBE_CMD_0] = cmdpkt(R200_EMIT_PP_CUBIC_FACES_1);
+ rmesa->hw.cube[1].cmd[CUBE_CMD_1] = cmdpkt(R200_EMIT_PP_CUBIC_OFFSETS_1);
+ rmesa->hw.pix[0].cmd[PIX_CMD_0] = cmdpkt(R200_EMIT_PP_TXCBLEND_0);
+ rmesa->hw.pix[1].cmd[PIX_CMD_0] = cmdpkt(R200_EMIT_PP_TXCBLEND_1);
+ rmesa->hw.zbs.cmd[ZBS_CMD_0] = cmdpkt(RADEON_EMIT_SE_ZBIAS_FACTOR);
+ rmesa->hw.tcl.cmd[TCL_CMD_0] = cmdpkt(R200_EMIT_TCL_LIGHT_MODEL_CTL_0);
+ rmesa->hw.tcl.cmd[TCL_CMD_1] = cmdpkt(R200_EMIT_TCL_UCP_VERT_BLEND_CTL);
+ rmesa->hw.tcg.cmd[TCG_CMD_0] = cmdpkt(R200_EMIT_TEX_PROC_CTL_2);
+ rmesa->hw.msl.cmd[MSL_CMD_0] = cmdpkt(R200_EMIT_MATRIX_SELECT_0);
+ rmesa->hw.vap.cmd[VAP_CMD_0] = cmdpkt(R200_EMIT_VAP_CTL);
+ rmesa->hw.vtx.cmd[VTX_CMD_0] = cmdpkt(R200_EMIT_VTX_FMT_0);
+ rmesa->hw.vtx.cmd[VTX_CMD_1] = cmdpkt(R200_EMIT_OUTPUT_VTX_COMP_SEL);
+ rmesa->hw.vtx.cmd[VTX_CMD_2] = cmdpkt(R200_EMIT_SE_VTX_STATE_CNTL);
+ rmesa->hw.vte.cmd[VTE_CMD_0] = cmdpkt(R200_EMIT_VTE_CNTL);
+ rmesa->hw.mtl[0].cmd[MTL_CMD_0] =
+ cmdvec( R200_VS_MAT_0_EMISS, 1, 16 );
+ rmesa->hw.mtl[0].cmd[MTL_CMD_1] =
+ cmdscl2( R200_SS_MAT_0_SHININESS, 1, 1 );
+ rmesa->hw.grd.cmd[GRD_CMD_0] =
+ cmdscl( R200_SS_VERT_GUARD_CLIP_ADJ_ADDR, 1, 4 );
+ rmesa->hw.fog.cmd[FOG_CMD_0] =
+ cmdvec( R200_VS_FOG_PARAM_ADDR, 1, 4 );
+ rmesa->hw.glt.cmd[GLT_CMD_0] =
+ cmdvec( R200_VS_GLOBAL_AMBIENT_ADDR, 1, 4 );
+ rmesa->hw.eye.cmd[EYE_CMD_0] =
+ cmdvec( R200_VS_EYE_VECTOR_ADDR, 1, 4 );
+
+ rmesa->hw.mat[R200_MTX_MV].cmd[MAT_CMD_0] =
+ cmdvec( R200_VS_MATRIX_0_MV, 1, 16);
+ rmesa->hw.mat[R200_MTX_IMV].cmd[MAT_CMD_0] =
+ cmdvec( R200_VS_MATRIX_1_INV_MV, 1, 16);
+ rmesa->hw.mat[R200_MTX_MVP].cmd[MAT_CMD_0] =
+ cmdvec( R200_VS_MATRIX_2_MVP, 1, 16);
+ rmesa->hw.mat[R200_MTX_TEX0].cmd[MAT_CMD_0] =
+ cmdvec( R200_VS_MATRIX_3_TEX0, 1, 16);
+ rmesa->hw.mat[R200_MTX_TEX1].cmd[MAT_CMD_0] =
+ cmdvec( R200_VS_MATRIX_4_TEX1, 1, 16);
+
+ for (i = 0 ; i < 8; i++) {
+ rmesa->hw.lit[i].cmd[LIT_CMD_0] =
+ cmdvec( R200_VS_LIGHT_AMBIENT_ADDR + i, 8, 24 );
+ rmesa->hw.lit[i].cmd[LIT_CMD_1] =
+ cmdscl( R200_SS_LIGHT_DCD_ADDR + i, 8, 7 );
+ }
+
+ for (i = 0 ; i < 6; i++) {
+ rmesa->hw.ucp[i].cmd[UCP_CMD_0] =
+ cmdvec( R200_VS_UCP_ADDR + i, 1, 4 );
+ }
+
+ /* Initial Harware state:
+ */
+ rmesa->hw.ctx.cmd[CTX_PP_MISC] = (R200_ALPHA_TEST_PASS
+ /* | R200_RIGHT_HAND_CUBE_OGL*/);
+
+ rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] = (R200_FOG_VERTEX |
+ R200_FOG_USE_SPEC_ALPHA);
+
+ rmesa->hw.ctx.cmd[CTX_RE_SOLID_COLOR] = 0x00000000;
+
+ rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] = (R200_COMB_FCN_ADD_CLAMP |
+ R200_SRC_BLEND_GL_ONE |
+ R200_DST_BLEND_GL_ZERO );
+
+ rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHOFFSET] =
+ rmesa->r200Screen->depthOffset;
+
+ rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHPITCH] =
+ ((rmesa->r200Screen->depthPitch &
+ R200_DEPTHPITCH_MASK) |
+ R200_DEPTH_ENDIAN_NO_SWAP);
+
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] = (depth_fmt |
+ R200_Z_TEST_LESS |
+ R200_STENCIL_TEST_ALWAYS |
+ R200_STENCIL_FAIL_KEEP |
+ R200_STENCIL_ZPASS_KEEP |
+ R200_STENCIL_ZFAIL_KEEP |
+ R200_Z_WRITE_ENABLE);
+
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] = (R200_ANTI_ALIAS_NONE
+ | R200_TEX_BLEND_0_ENABLE);
+
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] = color_fmt;
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= R200_DITHER_ENABLE;
+
+ rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = (rmesa->state.color.drawOffset &
+ R200_COLOROFFSET_MASK);
+
+ rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = ((rmesa->state.color.drawPitch &
+ R200_COLORPITCH_MASK) |
+ R200_COLOR_ENDIAN_NO_SWAP);
+
+ rmesa->hw.set.cmd[SET_SE_CNTL] = (R200_FFACE_CULL_CCW |
+ R200_BFACE_SOLID |
+ R200_FFACE_SOLID |
+ R200_FLAT_SHADE_VTX_LAST |
+ R200_DIFFUSE_SHADE_GOURAUD |
+ R200_ALPHA_SHADE_GOURAUD |
+ R200_SPECULAR_SHADE_GOURAUD |
+ R200_FOG_SHADE_GOURAUD |
+ R200_VTX_PIX_CENTER_OGL |
+ R200_ROUND_MODE_TRUNC |
+ R200_ROUND_PREC_8TH_PIX);
+
+ rmesa->hw.set.cmd[SET_RE_CNTL] = (R200_PERSPECTIVE_ENABLE |
+ R200_SCISSOR_ENABLE);
+
+ rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] =
+ ((0x0000 & R200_LINE_PATTERN_MASK) |
+ (0 << R200_LINE_REPEAT_COUNT_SHIFT) |
+ (0 << R200_LINE_PATTERN_START_SHIFT) |
+ R200_LINE_PATTERN_LITTLE_BIT_ORDER);
+
+ rmesa->hw.lin.cmd[LIN_RE_LINE_STATE] =
+ ((0 << R200_LINE_CURRENT_PTR_SHIFT) |
+ (1 << R200_LINE_CURRENT_COUNT_SHIFT));
+
+ rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] = (1 << 4);
+
+ rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] =
+ ((0x00 << R200_STENCIL_REF_SHIFT) |
+ (0xff << R200_STENCIL_MASK_SHIFT) |
+ (0xff << R200_STENCIL_WRITEMASK_SHIFT));
+
+ rmesa->hw.msk.cmd[MSK_RB3D_ROPCNTL] = R200_ROP_COPY;
+ rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK] = 0xffffffff;
+
+ rmesa->hw.tam.cmd[TAM_DEBUG3] = 0;
+
+ rmesa->hw.msc.cmd[MSC_RE_MISC] =
+ ((0 << R200_STIPPLE_X_OFFSET_SHIFT) |
+ (0 << R200_STIPPLE_Y_OFFSET_SHIFT) |
+ R200_STIPPLE_BIG_BIT_ORDER);
+
+
+ rmesa->hw.cst.cmd[CST_PP_CNTL_X] = 0;
+ rmesa->hw.cst.cmd[CST_RB3D_DEPTHXY_OFFSET] = 0;
+ rmesa->hw.cst.cmd[CST_RE_AUX_SCISSOR_CNTL] = 0x0;
+ rmesa->hw.cst.cmd[CST_RE_SCISSOR_TL_0] = 0;
+ rmesa->hw.cst.cmd[CST_RE_SCISSOR_BR_0] = 0;
+ rmesa->hw.cst.cmd[CST_SE_VAP_CNTL_STATUS] =
+#ifdef MESA_BIG_ENDIAN
+ R200_VC_32BIT_SWAP;
+#else
+ R200_VC_NO_SWAP;
+#endif
+ rmesa->hw.cst.cmd[CST_RE_POINTSIZE] = 0x100010;
+ rmesa->hw.cst.cmd[CST_SE_TCL_INPUT_VTX_0] =
+ (0x0 << R200_VERTEX_POSITION_ADDR__SHIFT);
+ rmesa->hw.cst.cmd[CST_SE_TCL_INPUT_VTX_1] =
+ (0x02 << R200_VTX_COLOR_0_ADDR__SHIFT) |
+ (0x03 << R200_VTX_COLOR_1_ADDR__SHIFT);
+ rmesa->hw.cst.cmd[CST_SE_TCL_INPUT_VTX_2] =
+ (0x06 << R200_VTX_TEX_0_ADDR__SHIFT) |
+ (0x07 << R200_VTX_TEX_1_ADDR__SHIFT) |
+ (0x08 << R200_VTX_TEX_2_ADDR__SHIFT) |
+ (0x09 << R200_VTX_TEX_3_ADDR__SHIFT);
+ rmesa->hw.cst.cmd[CST_SE_TCL_INPUT_VTX_3] =
+ (0x0A << R200_VTX_TEX_4_ADDR__SHIFT) |
+ (0x0B << R200_VTX_TEX_5_ADDR__SHIFT);
+
+
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_XSCALE] = 0x00000000;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] = 0x00000000;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_YSCALE] = 0x00000000;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] = 0x00000000;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZSCALE] = 0x00000000;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZOFFSET] = 0x00000000;
+
+ for (i = 0; i < 2; i++) { /* 2 texture units for now */
+ rmesa->hw.tex[i].cmd[TEX_PP_TXFILTER] = R200_BORDER_MODE_OGL;
+ rmesa->hw.tex[i].cmd[TEX_PP_TXFORMAT] =
+ ((i << R200_TXFORMAT_ST_ROUTE_SHIFT) | /* <-- note i */
+ (2 << R200_TXFORMAT_WIDTH_SHIFT) |
+ (2 << R200_TXFORMAT_HEIGHT_SHIFT));
+ rmesa->hw.tex[i].cmd[TEX_PP_TXOFFSET] = 0;
+ rmesa->hw.tex[i].cmd[TEX_PP_BORDER_COLOR] = 0;
+ rmesa->hw.tex[i].cmd[TEX_PP_TXFORMAT_X] =
+ (/* R200_TEXCOORD_PROJ | */
+ 0x100000); /* Small default bias */
+
+ rmesa->hw.cube[i].cmd[CUBE_PP_CUBIC_FACES] = 0;
+ rmesa->hw.cube[i].cmd[CUBE_PP_CUBIC_OFFSET_F1] = 0;
+ rmesa->hw.cube[i].cmd[CUBE_PP_CUBIC_OFFSET_F2] = 0;
+ rmesa->hw.cube[i].cmd[CUBE_PP_CUBIC_OFFSET_F3] = 0;
+ rmesa->hw.cube[i].cmd[CUBE_PP_CUBIC_OFFSET_F4] = 0;
+ rmesa->hw.cube[i].cmd[CUBE_PP_CUBIC_OFFSET_F5] = 0;
+ }
+
+ rmesa->hw.pix[0].cmd[PIX_PP_TXCBLEND] =
+ (R200_TXC_ARG_A_ZERO |
+ R200_TXC_ARG_B_ZERO |
+ R200_TXC_ARG_C_DIFFUSE_COLOR |
+ R200_TXC_OP_MADD);
+
+ rmesa->hw.pix[0].cmd[PIX_PP_TXCBLEND2] =
+ ((0 << R200_TXC_TFACTOR_SEL_SHIFT) |
+ R200_TXC_SCALE_1X |
+ R200_TXC_CLAMP_0_1 |
+ R200_TXC_OUTPUT_REG_R0);
+
+ rmesa->hw.pix[0].cmd[PIX_PP_TXABLEND] =
+ (R200_TXA_ARG_A_ZERO |
+ R200_TXA_ARG_B_ZERO |
+ R200_TXA_ARG_C_DIFFUSE_ALPHA |
+ R200_TXA_OP_MADD);
+
+ rmesa->hw.pix[0].cmd[PIX_PP_TXABLEND2] =
+ ((0 << R200_TXA_TFACTOR_SEL_SHIFT) |
+ R200_TXA_SCALE_1X |
+ R200_TXA_CLAMP_0_1 |
+ R200_TXA_OUTPUT_REG_R0);
+
+ rmesa->hw.pix[1].cmd[PIX_PP_TXCBLEND] =
+ (R200_TXC_ARG_A_ZERO |
+ R200_TXC_ARG_B_ZERO |
+ R200_TXC_ARG_C_DIFFUSE_COLOR |
+ R200_TXC_OP_MADD);
+
+ rmesa->hw.pix[1].cmd[PIX_PP_TXCBLEND2] =
+ ((0 << R200_TXC_TFACTOR_SEL_SHIFT) |
+ R200_TXC_SCALE_1X |
+ R200_TXC_CLAMP_0_1 |
+ R200_TXC_OUTPUT_REG_R0);
+
+ rmesa->hw.pix[1].cmd[PIX_PP_TXABLEND] =
+ (R200_TXA_ARG_A_ZERO |
+ R200_TXA_ARG_B_ZERO |
+ R200_TXA_ARG_C_DIFFUSE_ALPHA |
+ R200_TXA_OP_MADD);
+
+ rmesa->hw.pix[1].cmd[PIX_PP_TXABLEND2] =
+ ((0 << R200_TXA_TFACTOR_SEL_SHIFT) |
+ R200_TXA_SCALE_1X |
+ R200_TXA_CLAMP_0_1 |
+ R200_TXA_OUTPUT_REG_R0);
+
+ rmesa->hw.tf.cmd[TF_TFACTOR_0] = 0;
+ rmesa->hw.tf.cmd[TF_TFACTOR_1] = 0;
+ rmesa->hw.tf.cmd[TF_TFACTOR_2] = 0;
+ rmesa->hw.tf.cmd[TF_TFACTOR_3] = 0;
+ rmesa->hw.tf.cmd[TF_TFACTOR_4] = 0;
+ rmesa->hw.tf.cmd[TF_TFACTOR_5] = 0;
+
+ rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] =
+ (R200_VAP_TCL_ENABLE |
+ (0x9 << R200_VAP_VF_MAX_VTX_NUM__SHIFT));
+
+ rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] =
+ (R200_VPORT_X_SCALE_ENA |
+ R200_VPORT_Y_SCALE_ENA |
+ R200_VPORT_Z_SCALE_ENA |
+ R200_VPORT_X_OFFSET_ENA |
+ R200_VPORT_Y_OFFSET_ENA |
+ R200_VPORT_Z_OFFSET_ENA |
+/* FIXME: Turn on for tex rect only */
+ R200_VTX_ST_DENORMALIZED |
+ R200_VTX_W0_FMT);
+
+
+ rmesa->hw.vtx.cmd[VTX_VTXFMT_0] = 0;
+ rmesa->hw.vtx.cmd[VTX_VTXFMT_1] = 0;
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] =
+ ((R200_VTX_Z0 | R200_VTX_W0 |
+ (R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT)));
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] = 0;
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] = (R200_OUTPUT_XYZW);
+ rmesa->hw.vtx.cmd[VTX_STATE_CNTL] = R200_VSC_UPDATE_USER_COLOR_0_ENABLE;
+
+
+ /* Matrix selection */
+ rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_0] =
+ (R200_MTX_MV << R200_MODELVIEW_0_SHIFT);
+
+ rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_1] =
+ (R200_MTX_IMV << R200_IT_MODELVIEW_0_SHIFT);
+
+ rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_2] =
+ (R200_MTX_MVP << R200_MODELPROJECT_0_SHIFT);
+
+ rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_3] =
+ ((R200_MTX_TEX0 << R200_TEXMAT_0_SHIFT) |
+ (R200_MTX_TEX1 << R200_TEXMAT_1_SHIFT) |
+ (R200_MTX_TEX2 << R200_TEXMAT_2_SHIFT) |
+ (R200_MTX_TEX3 << R200_TEXMAT_3_SHIFT));
+
+ rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_4] =
+ ((R200_MTX_TEX4 << R200_TEXMAT_4_SHIFT) |
+ (R200_MTX_TEX5 << R200_TEXMAT_5_SHIFT));
+
+
+ /* General TCL state */
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] =
+ (R200_SPECULAR_LIGHTS |
+ R200_DIFFUSE_SPECULAR_COMBINE |
+ R200_LOCAL_LIGHT_VEC_GL);
+
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_1] =
+ ((R200_LM1_SOURCE_LIGHT_PREMULT << R200_FRONT_EMISSIVE_SOURCE_SHIFT) |
+ (R200_LM1_SOURCE_LIGHT_PREMULT << R200_FRONT_AMBIENT_SOURCE_SHIFT) |
+ (R200_LM1_SOURCE_LIGHT_PREMULT << R200_FRONT_DIFFUSE_SOURCE_SHIFT) |
+ (R200_LM1_SOURCE_LIGHT_PREMULT << R200_FRONT_SPECULAR_SOURCE_SHIFT) |
+ (R200_LM1_SOURCE_LIGHT_PREMULT << R200_BACK_EMISSIVE_SOURCE_SHIFT) |
+ (R200_LM1_SOURCE_LIGHT_PREMULT << R200_BACK_AMBIENT_SOURCE_SHIFT) |
+ (R200_LM1_SOURCE_LIGHT_PREMULT << R200_BACK_DIFFUSE_SOURCE_SHIFT) |
+ (R200_LM1_SOURCE_LIGHT_PREMULT << R200_BACK_SPECULAR_SOURCE_SHIFT));
+
+ rmesa->hw.tcl.cmd[TCL_PER_LIGHT_CTL_0] = 0; /* filled in via callbacks */
+ rmesa->hw.tcl.cmd[TCL_PER_LIGHT_CTL_1] = 0;
+ rmesa->hw.tcl.cmd[TCL_PER_LIGHT_CTL_2] = 0;
+ rmesa->hw.tcl.cmd[TCL_PER_LIGHT_CTL_3] = 0;
+
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] =
+ (R200_UCP_IN_CLIP_SPACE |
+ R200_CULL_FRONT_IS_CCW);
+
+ /* Texgen/Texmat state */
+ rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_2] = 0x0; /* masks??? */
+ rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_3] =
+ ((0 << R200_TEXGEN_0_INPUT_TEX_SHIFT) |
+ (1 << R200_TEXGEN_1_INPUT_TEX_SHIFT) |
+ (2 << R200_TEXGEN_2_INPUT_TEX_SHIFT) |
+ (3 << R200_TEXGEN_3_INPUT_TEX_SHIFT) |
+ (4 << R200_TEXGEN_4_INPUT_TEX_SHIFT) |
+ (5 << R200_TEXGEN_5_INPUT_TEX_SHIFT));
+ rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_0] = 0;
+ rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_1] =
+ ((0 << R200_TEXGEN_0_INPUT_SHIFT) |
+ (1 << R200_TEXGEN_1_INPUT_SHIFT) |
+ (2 << R200_TEXGEN_2_INPUT_SHIFT) |
+ (3 << R200_TEXGEN_3_INPUT_SHIFT) |
+ (4 << R200_TEXGEN_4_INPUT_SHIFT) |
+ (5 << R200_TEXGEN_5_INPUT_SHIFT));
+ rmesa->hw.tcg.cmd[TCG_TEX_CYL_WRAP_CTL] = 0;
+
+ rmesa->TexGenInputs = rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_1];
+
+
+ for (i = 0 ; i < 8; i++) {
+ struct gl_light *l = &ctx->Light.Light[i];
+ GLenum p = GL_LIGHT0 + i;
+ *(float *)&(rmesa->hw.lit[i].cmd[LIT_RANGE_CUTOFF]) = FLT_MAX;
+
+ ctx->Driver.Lightfv( ctx, p, GL_AMBIENT, l->Ambient );
+ ctx->Driver.Lightfv( ctx, p, GL_DIFFUSE, l->Diffuse );
+ ctx->Driver.Lightfv( ctx, p, GL_SPECULAR, l->Specular );
+ ctx->Driver.Lightfv( ctx, p, GL_POSITION, 0 );
+ ctx->Driver.Lightfv( ctx, p, GL_SPOT_DIRECTION, 0 );
+ ctx->Driver.Lightfv( ctx, p, GL_SPOT_EXPONENT, &l->SpotExponent );
+ ctx->Driver.Lightfv( ctx, p, GL_SPOT_CUTOFF, &l->SpotCutoff );
+ ctx->Driver.Lightfv( ctx, p, GL_CONSTANT_ATTENUATION,
+ &l->ConstantAttenuation );
+ ctx->Driver.Lightfv( ctx, p, GL_LINEAR_ATTENUATION,
+ &l->LinearAttenuation );
+ ctx->Driver.Lightfv( ctx, p, GL_QUADRATIC_ATTENUATION,
+ &l->QuadraticAttenuation );
+ }
+
+ ctx->Driver.LightModelfv( ctx, GL_LIGHT_MODEL_AMBIENT,
+ ctx->Light.Model.Ambient );
+
+ TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange( ctx );
+
+ for (i = 0 ; i < 6; i++) {
+ ctx->Driver.ClipPlane( ctx, GL_CLIP_PLANE0 + i, NULL );
+ }
+
+ ctx->Driver.Fogfv( ctx, GL_FOG_MODE, 0 );
+ ctx->Driver.Fogfv( ctx, GL_FOG_DENSITY, &ctx->Fog.Density );
+ ctx->Driver.Fogfv( ctx, GL_FOG_START, &ctx->Fog.Start );
+ ctx->Driver.Fogfv( ctx, GL_FOG_END, &ctx->Fog.End );
+ ctx->Driver.Fogfv( ctx, GL_FOG_COLOR, ctx->Fog.Color );
+ ctx->Driver.Fogfv( ctx, GL_FOG_COORDINATE_SOURCE_EXT, 0 );
+
+ rmesa->hw.grd.cmd[GRD_VERT_GUARD_CLIP_ADJ] = IEEE_ONE;
+ rmesa->hw.grd.cmd[GRD_VERT_GUARD_DISCARD_ADJ] = IEEE_ONE;
+ rmesa->hw.grd.cmd[GRD_HORZ_GUARD_CLIP_ADJ] = IEEE_ONE;
+ rmesa->hw.grd.cmd[GRD_HORZ_GUARD_DISCARD_ADJ] = IEEE_ONE;
+
+ rmesa->hw.eye.cmd[EYE_X] = 0;
+ rmesa->hw.eye.cmd[EYE_Y] = 0;
+ rmesa->hw.eye.cmd[EYE_Z] = IEEE_ONE;
+ rmesa->hw.eye.cmd[EYE_RESCALE_FACTOR] = IEEE_ONE;
+
+ r200LightingSpaceChange( ctx );
+
+ rmesa->lost_context = 1;
+}
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_swtcl.c b/xc/lib/GL/mesa/src/drv/r200/r200_swtcl.c
new file mode 100644
index 000000000..6ee57cf92
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_swtcl.c
@@ -0,0 +1,1277 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "mtypes.h"
+#include "colormac.h"
+#include "enums.h"
+#include "image.h"
+#include "imports.h"
+#include "mmath.h"
+#include "macros.h"
+
+#include "swrast/s_fog.h"
+#include "swrast_setup/swrast_setup.h"
+#include "math/m_translate.h"
+#include "tnl/tnl.h"
+#include "tnl/t_context.h"
+#include "tnl/t_pipeline.h"
+
+#include "r200_context.h"
+#include "r200_ioctl.h"
+#include "r200_state.h"
+#include "r200_swtcl.h"
+#include "r200_tcl.h"
+
+/***********************************************************************
+ * Build render functions from dd templates *
+ ***********************************************************************/
+
+
+#define R200_XYZW_BIT 0x01
+#define R200_RGBA_BIT 0x02
+#define R200_SPEC_BIT 0x04
+#define R200_TEX0_BIT 0x08
+#define R200_TEX1_BIT 0x10
+#define R200_PTEX_BIT 0x20
+#define R200_MAX_SETUP 0x40
+
+static void flush_last_swtcl_prim( r200ContextPtr rmesa );
+
+static struct {
+ void (*emit)( GLcontext *, GLuint, GLuint, void *, GLuint );
+ interp_func interp;
+ copy_pv_func copy_pv;
+ GLboolean (*check_tex_sizes)( GLcontext *ctx );
+ GLuint vertex_size;
+ GLuint vertex_stride_shift;
+ GLuint vertex_format;
+} setup_tab[R200_MAX_SETUP];
+
+
+static int se_vtx_fmt_0[] = {
+ 0,
+
+ (R200_VTX_XY |
+ R200_VTX_Z0 |
+ (R200_VTX_PK_RGBA << R200_VTX_COLOR_0_SHIFT)),
+
+ (R200_VTX_XY |
+ R200_VTX_Z0 |
+ R200_VTX_W0 |
+ (R200_VTX_PK_RGBA << R200_VTX_COLOR_0_SHIFT) |
+ (R200_VTX_PK_RGBA << R200_VTX_COLOR_1_SHIFT)),
+
+ (R200_VTX_XY |
+ R200_VTX_Z0 |
+ R200_VTX_W0 |
+ (R200_VTX_PK_RGBA << R200_VTX_COLOR_0_SHIFT) |
+ (R200_VTX_PK_RGBA << R200_VTX_COLOR_1_SHIFT)),
+
+ (R200_VTX_XY |
+ R200_VTX_Z0 |
+ R200_VTX_W0 |
+ (R200_VTX_PK_RGBA << R200_VTX_COLOR_0_SHIFT) |
+ (R200_VTX_PK_RGBA << R200_VTX_COLOR_1_SHIFT)),
+
+ (R200_VTX_XY |
+ R200_VTX_Z0 |
+ R200_VTX_W0 |
+ (R200_VTX_PK_RGBA << R200_VTX_COLOR_0_SHIFT) |
+ (R200_VTX_PK_RGBA << R200_VTX_COLOR_1_SHIFT))
+};
+
+static int se_vtx_fmt_1[] = {
+ 0,
+ 0,
+ 0,
+ ((2 << R200_VTX_TEX0_COMP_CNT_SHIFT)),
+ ((2 << R200_VTX_TEX0_COMP_CNT_SHIFT) |
+ (2 << R200_VTX_TEX1_COMP_CNT_SHIFT)),
+ ((3 << R200_VTX_TEX0_COMP_CNT_SHIFT) |
+ (3 << R200_VTX_TEX1_COMP_CNT_SHIFT)),
+};
+
+#define TINY_VERTEX_FORMAT 1
+#define NOTEX_VERTEX_FORMAT 2
+#define TEX0_VERTEX_FORMAT 3
+#define TEX1_VERTEX_FORMAT 4
+#define PROJ_TEX1_VERTEX_FORMAT 5
+#define TEX2_VERTEX_FORMAT 0
+#define TEX3_VERTEX_FORMAT 0
+#define PROJ_TEX3_VERTEX_FORMAT 0
+
+#define DO_XYZW (IND & R200_XYZW_BIT)
+#define DO_RGBA (IND & R200_RGBA_BIT)
+#define DO_SPEC (IND & R200_SPEC_BIT)
+#define DO_FOG (IND & R200_SPEC_BIT)
+#define DO_TEX0 (IND & R200_TEX0_BIT)
+#define DO_TEX1 (IND & R200_TEX1_BIT)
+#define DO_TEX2 0
+#define DO_TEX3 0
+#define DO_PTEX (IND & R200_PTEX_BIT)
+
+#define VERTEX r200Vertex
+#define VERTEX_COLOR r200_color_t
+#define GET_VIEWPORT_MAT() 0
+#define GET_TEXSOURCE(n) n
+#define GET_VERTEX_FORMAT() R200_CONTEXT(ctx)->swtcl.vertex_format
+#define GET_VERTEX_STORE() R200_CONTEXT(ctx)->swtcl.verts
+#define GET_VERTEX_STRIDE_SHIFT() R200_CONTEXT(ctx)->swtcl.vertex_stride_shift
+#define GET_UBYTE_COLOR_STORE() &R200_CONTEXT(ctx)->UbyteColor
+#define GET_UBYTE_SPEC_COLOR_STORE() &R200_CONTEXT(ctx)->UbyteSecondaryColor
+
+#define HAVE_HW_VIEWPORT 1
+#define HAVE_HW_DIVIDE (IND & ~(R200_XYZW_BIT|R200_RGBA_BIT))
+#define HAVE_TINY_VERTICES 1
+#define HAVE_RGBA_COLOR 1
+#define HAVE_NOTEX_VERTICES 1
+#define HAVE_TEX0_VERTICES 1
+#define HAVE_TEX1_VERTICES 1
+#define HAVE_TEX2_VERTICES 0
+#define HAVE_TEX3_VERTICES 0
+#define HAVE_PTEX_VERTICES 1
+
+#define CHECK_HW_DIVIDE (!(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE| \
+ DD_TRI_UNFILLED)))
+
+#define IMPORT_QUALIFIER
+#define IMPORT_FLOAT_COLORS r200_import_float_colors
+#define IMPORT_FLOAT_SPEC_COLORS r200_import_float_spec_colors
+
+#define INTERP_VERTEX setup_tab[R200_CONTEXT(ctx)->swtcl.SetupIndex].interp
+#define COPY_PV_VERTEX setup_tab[R200_CONTEXT(ctx)->swtcl.SetupIndex].copy_pv
+
+
+/***********************************************************************
+ * Generate pv-copying and translation functions *
+ ***********************************************************************/
+
+#define TAG(x) r200_##x
+#define IND ~0
+#include "tnl_dd/t_dd_vb.c"
+#undef IND
+
+
+/***********************************************************************
+ * Generate vertex emit and interp functions *
+ ***********************************************************************/
+
+#define IND (R200_XYZW_BIT|R200_RGBA_BIT)
+#define TAG(x) x##_wg
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (R200_XYZW_BIT|R200_RGBA_BIT|R200_TEX0_BIT)
+#define TAG(x) x##_wgt0
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (R200_XYZW_BIT|R200_RGBA_BIT|R200_TEX0_BIT|R200_PTEX_BIT)
+#define TAG(x) x##_wgpt0
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (R200_XYZW_BIT|R200_RGBA_BIT|R200_TEX0_BIT|R200_TEX1_BIT)
+#define TAG(x) x##_wgt0t1
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (R200_XYZW_BIT|R200_RGBA_BIT|R200_TEX0_BIT|R200_TEX1_BIT|\
+ R200_PTEX_BIT)
+#define TAG(x) x##_wgpt0t1
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (R200_XYZW_BIT|R200_RGBA_BIT|R200_SPEC_BIT)
+#define TAG(x) x##_wgfs
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (R200_XYZW_BIT|R200_RGBA_BIT|R200_SPEC_BIT|\
+ R200_TEX0_BIT)
+#define TAG(x) x##_wgfst0
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (R200_XYZW_BIT|R200_RGBA_BIT|R200_SPEC_BIT|\
+ R200_TEX0_BIT|R200_PTEX_BIT)
+#define TAG(x) x##_wgfspt0
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (R200_XYZW_BIT|R200_RGBA_BIT|R200_SPEC_BIT|\
+ R200_TEX0_BIT|R200_TEX1_BIT)
+#define TAG(x) x##_wgfst0t1
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (R200_XYZW_BIT|R200_RGBA_BIT|R200_SPEC_BIT|\
+ R200_TEX0_BIT|R200_TEX1_BIT|R200_PTEX_BIT)
+#define TAG(x) x##_wgfspt0t1
+#include "tnl_dd/t_dd_vbtmp.h"
+
+
+/***********************************************************************
+ * Initialization
+ ***********************************************************************/
+
+static void init_setup_tab( void )
+{
+ init_wg();
+ init_wgt0();
+ init_wgpt0();
+ init_wgt0t1();
+ init_wgpt0t1();
+ init_wgfs();
+ init_wgfst0();
+ init_wgfspt0();
+ init_wgfst0t1();
+ init_wgfspt0t1();
+}
+
+
+
+void r200PrintSetupFlags(char *msg, GLuint flags )
+{
+ fprintf(stderr, "%s(%x): %s%s%s%s%s%s\n",
+ msg,
+ (int)flags,
+ (flags & R200_XYZW_BIT) ? " xyzw," : "",
+ (flags & R200_RGBA_BIT) ? " rgba," : "",
+ (flags & R200_SPEC_BIT) ? " spec/fog," : "",
+ (flags & R200_TEX0_BIT) ? " tex-0," : "",
+ (flags & R200_TEX1_BIT) ? " tex-1," : "",
+ (flags & R200_PTEX_BIT) ? " proj-tex," : "");
+}
+
+
+
+static void r200SetVertexFormat( GLcontext *ctx, GLuint ind )
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ rmesa->swtcl.SetupIndex = ind;
+
+ if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) {
+ tnl->Driver.Render.Interp = r200_interp_extras;
+ tnl->Driver.Render.CopyPV = r200_copy_pv_extras;
+ }
+ else {
+ tnl->Driver.Render.Interp = setup_tab[ind].interp;
+ tnl->Driver.Render.CopyPV = setup_tab[ind].copy_pv;
+ }
+
+ if (setup_tab[ind].vertex_format != rmesa->swtcl.vertex_format) {
+ int i;
+ R200_NEWPRIM(rmesa);
+ i = rmesa->swtcl.vertex_format = setup_tab[ind].vertex_format;
+ rmesa->swtcl.vertex_size = setup_tab[ind].vertex_size;
+ rmesa->swtcl.vertex_stride_shift = setup_tab[ind].vertex_stride_shift;
+
+ R200_STATECHANGE( rmesa, vtx );
+ rmesa->hw.vtx.cmd[VTX_VTXFMT_0] = se_vtx_fmt_0[i];
+ rmesa->hw.vtx.cmd[VTX_VTXFMT_1] = se_vtx_fmt_1[i];
+ }
+
+ {
+ GLuint vte = rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL];
+ GLuint vap = rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL];
+ GLuint needproj;
+
+ /* HW perspective divide is a win, but tiny vertex formats are a
+ * bigger one.
+ */
+ if (setup_tab[ind].vertex_format == TINY_VERTEX_FORMAT ||
+ (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
+ needproj = GL_TRUE;
+ vte |= R200_VTX_XY_FMT | R200_VTX_Z_FMT;
+ vte &= ~R200_VTX_W0_FMT;
+ vap |= R200_VAP_FORCE_W_TO_ONE;
+ }
+ else {
+ needproj = GL_FALSE;
+ vte &= ~(R200_VTX_XY_FMT | R200_VTX_Z_FMT);
+ vte |= R200_VTX_W0_FMT;
+ vap &= ~R200_VAP_FORCE_W_TO_ONE;
+ }
+
+ _tnl_need_projected_coords( ctx, needproj );
+ if (vte != rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL]) {
+ R200_STATECHANGE( rmesa, vte );
+ rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] = vte;
+ }
+ if (vap != rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL]) {
+ R200_STATECHANGE( rmesa, vap );
+ rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] = vap;
+ }
+ }
+}
+
+static void r200RenderStart( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+
+ if (!setup_tab[rmesa->swtcl.SetupIndex].check_tex_sizes(ctx)) {
+ r200SetVertexFormat( ctx, rmesa->swtcl.SetupIndex | R200_PTEX_BIT);
+ }
+
+ if (rmesa->dma.flush != 0 &&
+ rmesa->dma.flush != flush_last_swtcl_prim)
+ rmesa->dma.flush( rmesa );
+}
+
+
+void r200BuildVertices( GLcontext *ctx, GLuint start, GLuint count,
+ GLuint newinputs )
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+ GLubyte *v = ((GLubyte *)rmesa->swtcl.verts +
+ (start << rmesa->swtcl.vertex_stride_shift));
+ GLuint stride = 1 << rmesa->swtcl.vertex_stride_shift;
+
+ newinputs |= rmesa->swtcl.SetupNewInputs;
+ rmesa->swtcl.SetupNewInputs = 0;
+
+ if (!newinputs)
+ return;
+
+ setup_tab[rmesa->swtcl.SetupIndex].emit( ctx, start, count, v, stride );
+}
+
+
+void r200ChooseVertexState( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+ GLuint ind = (R200_XYZW_BIT | R200_RGBA_BIT);
+
+ if (!rmesa->TclFallback || rmesa->Fallback)
+ return;
+
+ if (ctx->Fog.Enabled || (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR))
+ ind |= R200_SPEC_BIT;
+
+ if (ctx->Texture._EnabledUnits & 0x2) /* unit 1 enabled */
+ ind |= R200_TEX0_BIT|R200_TEX1_BIT;
+ else if (ctx->Texture._EnabledUnits & 0x1) /* unit 1 enabled */
+ ind |= R200_TEX0_BIT;
+
+ r200SetVertexFormat( ctx, ind );
+}
+
+
+/* Flush vertices in the current dma region.
+ */
+static void flush_last_swtcl_prim( r200ContextPtr rmesa )
+{
+ if (R200_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ if (rmesa->dma.current.buf) {
+ struct r200_dma_region *current = &rmesa->dma.current;
+ GLuint current_offset = (rmesa->r200Screen->agp_buffer_offset +
+ current->buf->buf->idx * RADEON_BUFFER_SIZE +
+ current->start);
+
+ assert (!(rmesa->swtcl.hw_primitive & R200_VF_PRIM_WALK_IND));
+
+ assert (current->start +
+ rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 ==
+ current->ptr);
+
+ if (rmesa->dma.current.start != rmesa->dma.current.ptr) {
+ r200EmitVertexAOS( rmesa,
+ rmesa->swtcl.vertex_size,
+ current_offset);
+
+ r200EmitVbufPrim( rmesa,
+ rmesa->swtcl.hw_primitive,
+ rmesa->swtcl.numverts);
+ }
+
+ rmesa->swtcl.numverts = 0;
+ current->start = current->ptr;
+
+ rmesa->dma.flush = 0;
+ }
+}
+
+
+/* Alloc space in the current dma region.
+ */
+static __inline void *r200AllocDmaLowVerts( r200ContextPtr rmesa,
+ int nverts, int vsize )
+{
+ GLuint bytes = vsize * nverts;
+
+ if ( rmesa->dma.current.ptr + bytes > rmesa->dma.current.end )
+ r200RefillCurrentDmaRegion( rmesa );
+
+ if (!rmesa->dma.flush) {
+ rmesa->dma.flush = flush_last_swtcl_prim;
+ }
+
+ ASSERT( vsize == rmesa->swtcl.vertex_size * 4 );
+ ASSERT( rmesa->dma.flush == flush_last_swtcl_prim );
+ ASSERT( rmesa->dma.current.start +
+ rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 ==
+ rmesa->dma.current.ptr );
+
+
+ {
+ GLubyte *head = rmesa->dma.current.address + rmesa->dma.current.ptr;
+ rmesa->dma.current.ptr += bytes;
+ rmesa->swtcl.numverts += nverts;
+ return head;
+ }
+
+}
+
+
+
+
+void r200_emit_contiguous_verts( GLcontext *ctx, GLuint start, GLuint count )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint vertex_size = rmesa->swtcl.vertex_size * 4;
+ CARD32 *dest = r200AllocDmaLowVerts( rmesa, count-start, vertex_size );
+ setup_tab[rmesa->swtcl.SetupIndex].emit( ctx, start, count, dest,
+ vertex_size );
+}
+
+
+
+void r200_emit_indexed_verts( GLcontext *ctx, GLuint start, GLuint count )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ r200AllocDmaRegionVerts( rmesa,
+ &rmesa->swtcl.indexed_verts,
+ count - start,
+ rmesa->swtcl.vertex_size * 4,
+ 64);
+
+ setup_tab[rmesa->swtcl.SetupIndex].emit(
+ ctx, start, count,
+ rmesa->swtcl.indexed_verts.address + rmesa->swtcl.indexed_verts.start,
+ rmesa->swtcl.vertex_size * 4 );
+}
+
+
+/*
+ * Render unclipped vertex buffers by emitting vertices directly to
+ * dma buffers. Use strip/fan hardware primitives where possible.
+ * Try to simulate missing primitives with indexed vertices.
+ */
+#define HAVE_POINTS 1
+#define HAVE_LINES 1
+#define HAVE_LINE_STRIPS 1
+#define HAVE_TRIANGLES 1
+#define HAVE_TRI_STRIPS 1
+#define HAVE_TRI_STRIP_1 0
+#define HAVE_TRI_FANS 1
+#define HAVE_QUADS 1
+#define HAVE_QUAD_STRIPS 1
+#define HAVE_POLYGONS 1
+#define HAVE_ELTS 1
+
+static const GLuint hw_prim[GL_POLYGON+1] = {
+ R200_VF_PRIM_POINTS,
+ R200_VF_PRIM_LINES,
+ 0,
+ R200_VF_PRIM_LINE_STRIP,
+ R200_VF_PRIM_TRIANGLES,
+ R200_VF_PRIM_TRIANGLE_STRIP,
+ R200_VF_PRIM_TRIANGLE_FAN,
+ R200_VF_PRIM_QUADS,
+ R200_VF_PRIM_QUAD_STRIP,
+ R200_VF_PRIM_POLYGON
+};
+
+static __inline void r200DmaPrimitive( r200ContextPtr rmesa, GLenum prim )
+{
+ R200_NEWPRIM( rmesa );
+ rmesa->swtcl.hw_primitive = hw_prim[prim];
+ assert(rmesa->dma.current.ptr == rmesa->dma.current.start);
+}
+
+static __inline void r200EltPrimitive( r200ContextPtr rmesa, GLenum prim )
+{
+ R200_NEWPRIM( rmesa );
+ rmesa->swtcl.hw_primitive = hw_prim[prim] | R200_VF_PRIM_WALK_IND;
+}
+
+
+static void VERT_FALLBACK( GLcontext *ctx,
+ GLuint start,
+ GLuint count,
+ GLuint flags )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK );
+ tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 );
+ tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start, count, flags );
+ R200_CONTEXT(ctx)->swtcl.SetupNewInputs = VERT_BIT_CLIP;
+}
+
+static void ELT_FALLBACK( GLcontext *ctx,
+ GLuint start,
+ GLuint count,
+ GLuint flags )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK );
+ tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 );
+ tnl->Driver.Render.PrimTabElts[flags&PRIM_MODE_MASK]( ctx, start, count, flags );
+ R200_CONTEXT(ctx)->swtcl.SetupNewInputs = VERT_BIT_CLIP;
+}
+
+
+#define LOCAL_VARS r200ContextPtr rmesa = R200_CONTEXT(ctx)
+#define ELTS_VARS GLushort *dest
+#define INIT( prim ) r200DmaPrimitive( rmesa, prim )
+#define ELT_INIT(prim) r200EltPrimitive( rmesa, prim )
+#define NEW_PRIMITIVE() R200_NEWPRIM( rmesa )
+#define NEW_BUFFER() r200RefillCurrentDmaRegion( rmesa )
+#define GET_CURRENT_VB_MAX_VERTS() \
+ (((int)rmesa->dma.current.end - (int)rmesa->dma.current.ptr) / (rmesa->swtcl.vertex_size*4))
+#define GET_SUBSEQUENT_VB_MAX_VERTS() \
+ ((RADEON_BUFFER_SIZE) / (rmesa->swtcl.vertex_size*4))
+
+#define GET_CURRENT_VB_MAX_ELTS() \
+ ((R200_CMD_BUF_SZ - (rmesa->store.cmd_used + 16)) / 2)
+#define GET_SUBSEQUENT_VB_MAX_ELTS() \
+ ((R200_CMD_BUF_SZ - 1024) / 2)
+
+
+
+/* How do you extend an existing primitive?
+ */
+#define ALLOC_ELTS(nr) \
+do { \
+ if (rmesa->dma.flush == r200FlushElts && \
+ rmesa->store.cmd_used + nr*2 < R200_CMD_BUF_SZ) { \
+ \
+ dest = (GLushort *)(rmesa->store.cmd_buf + \
+ rmesa->store.cmd_used); \
+ rmesa->store.cmd_used += nr*2; \
+ } \
+ else { \
+ if (rmesa->dma.flush) { \
+ rmesa->dma.flush( rmesa ); \
+ } \
+ \
+ r200EmitVertexAOS( rmesa, \
+ rmesa->swtcl.vertex_size, \
+ (rmesa->r200Screen->agp_buffer_offset + \
+ rmesa->swtcl.indexed_verts.buf->buf->idx * \
+ RADEON_BUFFER_SIZE + \
+ rmesa->swtcl.indexed_verts.start)); \
+ \
+ dest = r200AllocEltsOpenEnded( rmesa, \
+ rmesa->swtcl.hw_primitive, \
+ nr ); \
+ } \
+} while (0)
+
+#define ALLOC_ELTS_NEW_PRIMITIVE(nr) ALLOC_ELTS( nr )
+
+#ifdef MESA_BIG_ENDIAN
+/* We could do without (most of) this ugliness if dest was always 32 bit word aligned... */
+#define EMIT_ELT(offset, x) do { \
+ int off = offset + ( ( (GLuint)dest & 0x2 ) >> 1 ); \
+ GLushort *des = (GLushort *)( (GLuint)dest & ~0x2 ); \
+ (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x); } while (0)
+#else
+#define EMIT_ELT(offset, x) (dest)[offset] = (GLushort) (x)
+#endif
+#define EMIT_TWO_ELTS(offset, x, y) *(GLuint *)(dest+offset) = ((y)<<16)|(x);
+#define INCR_ELTS( nr ) dest += nr
+#define RELEASE_ELT_VERTS() \
+ r200ReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts, __FUNCTION__ )
+#define EMIT_VERTS( ctx, j, nr ) \
+ r200_emit_contiguous_verts(ctx, j, (j)+(nr))
+#define EMIT_INDEXED_VERTS( ctx, start, count ) \
+ r200_emit_indexed_verts( ctx, start, count )
+
+
+#define TAG(x) r200_dma_##x
+#include "tnl_dd/t_dd_dmatmp.h"
+
+
+/**********************************************************************/
+/* Render pipeline stage */
+/**********************************************************************/
+
+
+static GLboolean r200_run_render( GLcontext *ctx,
+ struct gl_pipeline_stage *stage )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *VB = &tnl->vb;
+ GLuint i, length, flags = 0;
+ render_func *tab = TAG(render_tab_verts);
+
+ if (rmesa->swtcl.indexed_verts.buf && (!VB->Elts || stage->changed_inputs))
+ RELEASE_ELT_VERTS();
+
+
+
+ if ((R200_DEBUG & DEBUG_VERTS) || /* No debug */
+ VB->ClipOrMask || /* No clipping */
+ rmesa->swtcl.RenderIndex != 0 || /* No per-vertex manipulations */
+ ctx->Line.StippleFlag) /* No stipple -- fix me? */
+ return GL_TRUE;
+
+ if (VB->Elts) {
+ tab = TAG(render_tab_elts);
+ if (!rmesa->swtcl.indexed_verts.buf)
+ if (!TAG(emit_elt_verts)(ctx, 0, VB->Count))
+ return GL_TRUE; /* too many vertices */
+ }
+
+ tnl->Driver.Render.Start( ctx );
+
+ for (i = 0 ; !(flags & PRIM_LAST) ; i += length)
+ {
+ flags = VB->Primitive[i];
+ length = VB->PrimitiveLength[i];
+
+ if (R200_DEBUG & DEBUG_PRIMS)
+ fprintf(stderr, "r200_render.c: prim %s %d..%d\n",
+ _mesa_lookup_enum_by_nr(flags & PRIM_MODE_MASK),
+ i, i+length);
+
+ if (length)
+ tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
+ }
+
+ tnl->Driver.Render.Finish( ctx );
+
+ return GL_FALSE; /* finished the pipe */
+}
+
+
+
+static void r200_check_render( GLcontext *ctx,
+ struct gl_pipeline_stage *stage )
+{
+ GLuint inputs = VERT_BIT_POS | VERT_BIT_CLIP | VERT_BIT_COLOR0;
+
+ if (ctx->RenderMode == GL_RENDER) {
+ if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
+ inputs |= VERT_BIT_COLOR1;
+
+ if (ctx->Texture.Unit[0]._ReallyEnabled)
+ inputs |= VERT_BIT_TEX0;
+
+ if (ctx->Texture.Unit[1]._ReallyEnabled)
+ inputs |= VERT_BIT_TEX1;
+
+ if (ctx->Fog.Enabled)
+ inputs |= VERT_BIT_FOG;
+ }
+
+ stage->inputs = inputs;
+}
+
+
+static void dtr( struct gl_pipeline_stage *stage )
+{
+ (void)stage;
+}
+
+
+const struct gl_pipeline_stage _r200_render_stage =
+{
+ "r200 render",
+ (_DD_NEW_SEPARATE_SPECULAR |
+ _NEW_TEXTURE|
+ _NEW_FOG|
+ _NEW_RENDERMODE), /* re-check (new inputs) */
+ 0, /* re-run (always runs) */
+ GL_TRUE, /* active */
+ 0, 0, /* inputs (set in check_render), outputs */
+ 0, 0, /* changed_inputs, private */
+ dtr, /* destructor */
+ r200_check_render, /* check - initially set to alloc data */
+ r200_run_render /* run */
+};
+
+
+
+/**************************************************************************/
+
+
+static const GLuint reduced_hw_prim[GL_POLYGON+1] = {
+ R200_VF_PRIM_POINTS,
+ R200_VF_PRIM_LINES,
+ R200_VF_PRIM_LINES,
+ R200_VF_PRIM_LINES,
+ R200_VF_PRIM_TRIANGLES,
+ R200_VF_PRIM_TRIANGLES,
+ R200_VF_PRIM_TRIANGLES,
+ R200_VF_PRIM_TRIANGLES,
+ R200_VF_PRIM_TRIANGLES,
+ R200_VF_PRIM_TRIANGLES
+};
+
+static void r200RasterPrimitive( GLcontext *ctx, GLuint hwprim );
+static void r200RenderPrimitive( GLcontext *ctx, GLenum prim );
+static void r200ResetLineStipple( GLcontext *ctx );
+
+#undef HAVE_QUADS
+#define HAVE_QUADS 0
+
+#undef HAVE_QUAD_STRIPS
+#define HAVE_QUAD_STRIPS 0
+
+/***********************************************************************
+ * Emit primitives as inline vertices *
+ ***********************************************************************/
+
+#undef LOCAL_VARS
+#define CTX_ARG r200ContextPtr rmesa
+#define CTX_ARG2 rmesa
+#define GET_VERTEX_DWORDS() rmesa->swtcl.vertex_size
+#define ALLOC_VERTS( n, size ) r200AllocDmaLowVerts( rmesa, n, size * 4 )
+#define LOCAL_VARS \
+ r200ContextPtr rmesa = R200_CONTEXT(ctx); \
+ const GLuint shift = rmesa->swtcl.vertex_stride_shift; \
+ const char *r200verts = (char *)rmesa->swtcl.verts;
+#define VERT(x) (r200Vertex *)(r200verts + (x << shift))
+#define VERTEX r200Vertex
+#define DO_DEBUG_VERTS (1 && (R200_DEBUG & DEBUG_VERTS))
+#define PRINT_VERTEX(v) r200_print_vertex(rmesa->glCtx, v)
+#undef TAG
+#define TAG(x) r200_##x
+#include "tnl_dd/t_dd_triemit.h"
+
+
+/***********************************************************************
+ * Macros for t_dd_tritmp.h to draw basic primitives *
+ ***********************************************************************/
+
+#define QUAD( a, b, c, d ) r200_quad( rmesa, a, b, c, d )
+#define TRI( a, b, c ) r200_triangle( rmesa, a, b, c )
+#define LINE( a, b ) r200_line( rmesa, a, b )
+#define POINT( a ) r200_point( rmesa, a )
+
+/***********************************************************************
+ * Build render functions from dd templates *
+ ***********************************************************************/
+
+#define R200_TWOSIDE_BIT 0x01
+#define R200_UNFILLED_BIT 0x02
+#define R200_MAX_TRIFUNC 0x04
+
+
+static struct {
+ points_func points;
+ line_func line;
+ triangle_func triangle;
+ quad_func quad;
+} rast_tab[R200_MAX_TRIFUNC];
+
+
+#define DO_FALLBACK 0
+#define DO_UNFILLED (IND & R200_UNFILLED_BIT)
+#define DO_TWOSIDE (IND & R200_TWOSIDE_BIT)
+#define DO_FLAT 0
+#define DO_OFFSET 0
+#define DO_TRI 1
+#define DO_QUAD 1
+#define DO_LINE 1
+#define DO_POINTS 1
+#define DO_FULL_QUAD 1
+
+#define HAVE_RGBA 1
+#define HAVE_SPEC 1
+#define HAVE_INDEX 0
+#define HAVE_BACK_COLORS 0
+#define HAVE_HW_FLATSHADE 1
+#define TAB rast_tab
+
+#define DEPTH_SCALE 1.0
+#define UNFILLED_TRI unfilled_tri
+#define UNFILLED_QUAD unfilled_quad
+#define VERT_X(_v) _v->v.x
+#define VERT_Y(_v) _v->v.y
+#define VERT_Z(_v) _v->v.z
+#define AREA_IS_CCW( a ) (a < 0)
+#define GET_VERTEX(e) (rmesa->swtcl.verts + (e<<rmesa->swtcl.vertex_stride_shift))
+
+#define VERT_SET_RGBA( v, c ) v->ui[coloroffset] = LE32_TO_CPU(*(GLuint *)c)
+#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset]
+#define VERT_SAVE_RGBA( idx ) color[idx] = CPU_TO_LE32(v[idx]->ui[coloroffset])
+#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = LE32_TO_CPU(color[idx])
+
+#define VERT_SET_SPEC( v0, c ) if (havespec) { \
+ v0->v.specular.red = (c)[0]; \
+ v0->v.specular.green = (c)[1]; \
+ v0->v.specular.blue = (c)[2]; }
+#define VERT_COPY_SPEC( v0, v1 ) if (havespec) { \
+ v0->v.specular.red = v1->v.specular.red; \
+ v0->v.specular.green = v1->v.specular.green; \
+ v0->v.specular.blue = v1->v.specular.blue; }
+#define VERT_SAVE_SPEC( idx ) if (havespec) spec[idx] = CPU_TO_LE32(v[idx]->ui[5])
+#define VERT_RESTORE_SPEC( idx ) if (havespec) v[idx]->ui[5] = LE32_TO_CPU(spec[idx])
+
+#undef LOCAL_VARS
+#undef TAG
+#undef INIT
+
+#define LOCAL_VARS(n) \
+ r200ContextPtr rmesa = R200_CONTEXT(ctx); \
+ GLuint color[n], spec[n]; \
+ GLuint coloroffset = (rmesa->swtcl.vertex_size == 4 ? 3 : 4); \
+ GLboolean havespec = (rmesa->swtcl.vertex_size > 4); \
+ (void) color; (void) spec; (void) coloroffset; (void) havespec;
+
+/***********************************************************************
+ * Helpers for rendering unfilled primitives *
+ ***********************************************************************/
+
+#define RASTERIZE(x) r200RasterPrimitive( ctx, reduced_hw_prim[x] )
+#define RENDER_PRIMITIVE rmesa->swtcl.render_primitive
+#define TAG(x) x
+#include "tnl_dd/t_dd_unfilled.h"
+#undef IND
+
+
+/***********************************************************************
+ * Generate GL render functions *
+ ***********************************************************************/
+
+
+#define IND (0)
+#define TAG(x) x
+#include "tnl_dd/t_dd_tritmp.h"
+
+#define IND (R200_TWOSIDE_BIT)
+#define TAG(x) x##_twoside
+#include "tnl_dd/t_dd_tritmp.h"
+
+#define IND (R200_UNFILLED_BIT)
+#define TAG(x) x##_unfilled
+#include "tnl_dd/t_dd_tritmp.h"
+
+#define IND (R200_TWOSIDE_BIT|R200_UNFILLED_BIT)
+#define TAG(x) x##_twoside_unfilled
+#include "tnl_dd/t_dd_tritmp.h"
+
+
+static void init_rast_tab( void )
+{
+ init();
+ init_twoside();
+ init_unfilled();
+ init_twoside_unfilled();
+}
+
+/**********************************************************************/
+/* Render unclipped begin/end objects */
+/**********************************************************************/
+
+#define VERT(x) (r200Vertex *)(r200verts + (x << shift))
+#define RENDER_POINTS( start, count ) \
+ for ( ; start < count ; start++) \
+ r200_point( rmesa, VERT(start) )
+#define RENDER_LINE( v0, v1 ) \
+ r200_line( rmesa, VERT(v0), VERT(v1) )
+#define RENDER_TRI( v0, v1, v2 ) \
+ r200_triangle( rmesa, VERT(v0), VERT(v1), VERT(v2) )
+#define RENDER_QUAD( v0, v1, v2, v3 ) \
+ r200_quad( rmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) )
+#define INIT(x) do { \
+ r200RenderPrimitive( ctx, x ); \
+} while (0)
+#undef LOCAL_VARS
+#define LOCAL_VARS \
+ r200ContextPtr rmesa = R200_CONTEXT(ctx); \
+ const GLuint shift = rmesa->swtcl.vertex_stride_shift; \
+ const char *r200verts = (char *)rmesa->swtcl.verts; \
+ const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
+ const GLboolean stipple = ctx->Line.StippleFlag; \
+ (void) elt; (void) stipple;
+#define RESET_STIPPLE if ( stipple ) r200ResetLineStipple( ctx );
+#define RESET_OCCLUSION
+#define PRESERVE_VB_DEFS
+#define ELT(x) (x)
+#define TAG(x) r200_##x##_verts
+#include "tnl/t_vb_rendertmp.h"
+#undef ELT
+#undef TAG
+#define TAG(x) r200_##x##_elts
+#define ELT(x) elt[x]
+#include "tnl/t_vb_rendertmp.h"
+
+
+
+/**********************************************************************/
+/* Choose render functions */
+/**********************************************************************/
+
+void r200ChooseRenderState( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint index = 0;
+ GLuint flags = ctx->_TriangleCaps;
+
+ if (!rmesa->TclFallback || rmesa->Fallback)
+ return;
+
+ if (flags & DD_TRI_LIGHT_TWOSIDE) index |= R200_TWOSIDE_BIT;
+ if (flags & DD_TRI_UNFILLED) index |= R200_UNFILLED_BIT;
+
+ if (index != rmesa->swtcl.RenderIndex) {
+ tnl->Driver.Render.Points = rast_tab[index].points;
+ tnl->Driver.Render.Line = rast_tab[index].line;
+ tnl->Driver.Render.ClippedLine = rast_tab[index].line;
+ tnl->Driver.Render.Triangle = rast_tab[index].triangle;
+ tnl->Driver.Render.Quad = rast_tab[index].quad;
+
+ if (index == 0) {
+ tnl->Driver.Render.PrimTabVerts = r200_render_tab_verts;
+ tnl->Driver.Render.PrimTabElts = r200_render_tab_elts;
+ tnl->Driver.Render.ClippedPolygon = r200_fast_clipped_poly;
+ } else {
+ tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
+ tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
+ tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon;
+ }
+
+ rmesa->swtcl.RenderIndex = index;
+ }
+}
+
+
+/**********************************************************************/
+/* High level hooks for t_vb_render.c */
+/**********************************************************************/
+
+
+static void r200RasterPrimitive( GLcontext *ctx, GLuint hwprim )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if (rmesa->swtcl.hw_primitive != hwprim) {
+ R200_NEWPRIM( rmesa );
+ rmesa->swtcl.hw_primitive = hwprim;
+ }
+}
+
+static void r200RenderPrimitive( GLcontext *ctx, GLenum prim )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ rmesa->swtcl.render_primitive = prim;
+ if (prim < GL_TRIANGLES || !(ctx->_TriangleCaps & DD_TRI_UNFILLED))
+ r200RasterPrimitive( ctx, reduced_hw_prim[prim] );
+}
+
+static void r200RenderFinish( GLcontext *ctx )
+{
+}
+
+static void r200ResetLineStipple( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ R200_STATECHANGE( rmesa, lin );
+}
+
+
+/**********************************************************************/
+/* Transition to/from hardware rasterization. */
+/**********************************************************************/
+
+static char *fallbackStrings[] = {
+ "Texture mode",
+ "glDrawBuffer(GL_FRONT_AND_BACK)",
+ "glEnable(GL_STENCIL) without hw stencil buffer",
+ "glRenderMode(selection or feedback)",
+ "glBlendEquation",
+ "glBlendFunc(mode != ADD)"
+ "R200_NO_RAST"
+};
+
+
+static char *getFallbackString(GLuint bit)
+{
+ int i = 0;
+ while (bit > 1) {
+ i++;
+ bit >>= 1;
+ }
+ return fallbackStrings[i];
+}
+
+
+void r200Fallback( GLcontext *ctx, GLuint bit, GLboolean mode )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint oldfallback = rmesa->Fallback;
+
+ if (mode) {
+ rmesa->Fallback |= bit;
+ if (oldfallback == 0) {
+ R200_FIREVERTICES( rmesa );
+ TCL_FALLBACK( ctx, R200_TCL_FALLBACK_RASTER, GL_TRUE );
+ _swsetup_Wakeup( ctx );
+ _tnl_need_projected_coords( ctx, GL_TRUE );
+ rmesa->swtcl.RenderIndex = ~0;
+ if (R200_DEBUG & DEBUG_FALLBACKS) {
+ fprintf(stderr, "R200 begin rasterization fallback: 0x%x %s\n",
+ bit, getFallbackString(bit));
+ }
+ }
+ }
+ else {
+ rmesa->Fallback &= ~bit;
+ if (oldfallback == bit) {
+ _swrast_flush( ctx );
+ tnl->Driver.Render.Start = r200RenderStart;
+ tnl->Driver.Render.PrimitiveNotify = r200RenderPrimitive;
+ tnl->Driver.Render.Finish = r200RenderFinish;
+ tnl->Driver.Render.BuildVertices = r200BuildVertices;
+ tnl->Driver.Render.ResetLineStipple = r200ResetLineStipple;
+ TCL_FALLBACK( ctx, R200_TCL_FALLBACK_RASTER, GL_FALSE );
+ if (rmesa->TclFallback) {
+ /* These are already done if rmesa->TclFallback goes to
+ * zero above. But not if it doesn't (R200_NO_TCL for
+ * example?)
+ */
+ r200ChooseVertexState( ctx );
+ r200ChooseRenderState( ctx );
+ }
+ if (R200_DEBUG & DEBUG_FALLBACKS) {
+ fprintf(stderr, "R200 end rasterization fallback: 0x%x %s\n",
+ bit, getFallbackString(bit));
+ }
+ }
+ }
+}
+
+
+
+
+/* Cope with depth operations by drawing individual pixels as points???
+ */
+void
+r200PointsBitmap( GLcontext *ctx, GLint px, GLint py,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ const GLfloat *rc = ctx->Current.RasterColor;
+ GLint row, col;
+ r200Vertex vert;
+ GLuint orig_vte;
+ GLuint h;
+
+
+ /* Turn off tcl.
+ */
+ TCL_FALLBACK( ctx, R200_TCL_FALLBACK_BITMAP, 1 );
+
+ /* Choose tiny vertex format
+ */
+ r200SetVertexFormat( ctx, R200_XYZW_BIT | R200_RGBA_BIT );
+
+ /* Ready for point primitives:
+ */
+ r200RenderPrimitive( ctx, GL_POINTS );
+
+ /* Turn off the hw viewport transformation:
+ */
+ R200_STATECHANGE( rmesa, vte );
+ orig_vte = rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL];
+ rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] &= ~(R200_VPORT_X_SCALE_ENA |
+ R200_VPORT_Y_SCALE_ENA |
+ R200_VPORT_Z_SCALE_ENA |
+ R200_VPORT_X_OFFSET_ENA |
+ R200_VPORT_Y_OFFSET_ENA |
+ R200_VPORT_Z_OFFSET_ENA);
+
+ /* Turn off other stuff: Stipple?, texture?, blending?, etc.
+ */
+
+
+ /* Populate the vertex
+ *
+ * Incorporate FOG into RGBA
+ */
+ if (ctx->Fog.Enabled) {
+ const GLfloat *fc = ctx->Fog.Color;
+ GLfloat color[4];
+ GLfloat f;
+
+ if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT)
+ f = _mesa_z_to_fogfactor(ctx, ctx->Current.Attrib[VERT_ATTRIB_FOG][0]);
+ else
+ f = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
+
+ color[0] = f * rc[0] + (1.F - f) * fc[0];
+ color[1] = f * rc[1] + (1.F - f) * fc[1];
+ color[2] = f * rc[2] + (1.F - f) * fc[2];
+ color[3] = rc[3];
+
+ UNCLAMPED_FLOAT_TO_CHAN(vert.tv.color.red, color[0]);
+ UNCLAMPED_FLOAT_TO_CHAN(vert.tv.color.green, color[1]);
+ UNCLAMPED_FLOAT_TO_CHAN(vert.tv.color.blue, color[2]);
+ UNCLAMPED_FLOAT_TO_CHAN(vert.tv.color.alpha, color[3]);
+ }
+ else {
+ UNCLAMPED_FLOAT_TO_CHAN(vert.tv.color.red, rc[0]);
+ UNCLAMPED_FLOAT_TO_CHAN(vert.tv.color.green, rc[1]);
+ UNCLAMPED_FLOAT_TO_CHAN(vert.tv.color.blue, rc[2]);
+ UNCLAMPED_FLOAT_TO_CHAN(vert.tv.color.alpha, rc[3]);
+ }
+
+
+ vert.tv.z = ctx->Current.RasterPos[2];
+
+
+ /* Update window height
+ */
+ LOCK_HARDWARE( rmesa );
+ UNLOCK_HARDWARE( rmesa );
+ h = rmesa->dri.drawable->h + rmesa->dri.drawable->y;
+ px += rmesa->dri.drawable->x;
+
+ /* Clipping handled by existing mechansims in r200_ioctl.c?
+ */
+ for (row=0; row<height; row++) {
+ const GLubyte *src = (const GLubyte *)
+ _mesa_image_address( unpack, bitmap, width, height,
+ GL_COLOR_INDEX, GL_BITMAP, 0, row, 0 );
+
+ if (unpack->LsbFirst) {
+ /* Lsb first */
+ GLubyte mask = 1U << (unpack->SkipPixels & 0x7);
+ for (col=0; col<width; col++) {
+ if (*src & mask) {
+ vert.tv.x = px+col;
+ vert.tv.y = h - (py+row) - 1;
+ r200_point( rmesa, &vert );
+ }
+ src += (mask >> 7);
+ mask = ((mask << 1) & 0xff) | (mask >> 7);
+ }
+
+ /* get ready for next row */
+ if (mask != 1)
+ src++;
+ }
+ else {
+ /* Msb first */
+ GLubyte mask = 128U >> (unpack->SkipPixels & 0x7);
+ for (col=0; col<width; col++) {
+ if (*src & mask) {
+ vert.tv.x = px+col;
+ vert.tv.y = h - (py+row) - 1;
+ r200_point( rmesa, &vert );
+ }
+ src += mask & 1;
+ mask = ((mask << 7) & 0xff) | (mask >> 1);
+ }
+ /* get ready for next row */
+ if (mask != 128)
+ src++;
+ }
+ }
+
+ /* Fire outstanding vertices, restore state
+ */
+ R200_STATECHANGE( rmesa, vte );
+ rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] = orig_vte;
+
+ /* Unfallback
+ */
+ TCL_FALLBACK( ctx, R200_TCL_FALLBACK_BITMAP, 0 );
+
+ /* Need to restore vertexformat?
+ */
+ if (rmesa->TclFallback)
+ r200ChooseVertexState( ctx );
+}
+
+
+/**********************************************************************/
+/* Initialization. */
+/**********************************************************************/
+
+void r200InitSwtcl( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint size = TNL_CONTEXT(ctx)->vb.Size;
+ static int firsttime = 1;
+
+ if (firsttime) {
+ init_rast_tab();
+ init_setup_tab();
+ firsttime = 0;
+ }
+
+ tnl->Driver.Render.Start = r200RenderStart;
+ tnl->Driver.Render.Finish = r200RenderFinish;
+ tnl->Driver.Render.PrimitiveNotify = r200RenderPrimitive;
+ tnl->Driver.Render.ResetLineStipple = r200ResetLineStipple;
+ tnl->Driver.Render.BuildVertices = r200BuildVertices;
+
+ rmesa->swtcl.verts = (char *)ALIGN_MALLOC( size * 16 * 4, 32 );
+ rmesa->swtcl.RenderIndex = ~0;
+ rmesa->swtcl.render_primitive = GL_TRIANGLES;
+ rmesa->swtcl.hw_primitive = 0;
+}
+
+
+void r200DestroySwtcl( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if (rmesa->swtcl.indexed_verts.buf)
+ r200ReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts, __FUNCTION__ );
+
+ if (rmesa->swtcl.verts) {
+ ALIGN_FREE(rmesa->swtcl.verts);
+ rmesa->swtcl.verts = 0;
+ }
+
+ if (rmesa->UbyteSecondaryColor.Ptr) {
+ ALIGN_FREE(rmesa->UbyteSecondaryColor.Ptr);
+ rmesa->UbyteSecondaryColor.Ptr = 0;
+ }
+
+ if (rmesa->UbyteColor.Ptr) {
+ ALIGN_FREE(rmesa->UbyteColor.Ptr);
+ rmesa->UbyteColor.Ptr = 0;
+ }
+}
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_swtcl.h b/xc/lib/GL/mesa/src/drv/r200/r200_swtcl.h
new file mode 100644
index 000000000..e3cee42b4
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_swtcl.h
@@ -0,0 +1,79 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#ifndef __R200_SWTCL_H__
+#define __R200_SWTCL_H__
+
+#include "mtypes.h"
+#include "swrast/swrast.h"
+#include "r200_context.h"
+
+extern void r200InitSwtcl( GLcontext *ctx );
+extern void r200DestroySwtcl( GLcontext *ctx );
+
+extern void r200ChooseRenderState( GLcontext *ctx );
+extern void r200ChooseVertexState( GLcontext *ctx );
+
+extern void r200CheckTexSizes( GLcontext *ctx );
+
+extern void r200BuildVertices( GLcontext *ctx, GLuint start, GLuint count,
+ GLuint newinputs );
+
+extern void r200PrintSetupFlags(char *msg, GLuint flags );
+
+
+extern void r200_emit_contiguous_verts( GLcontext *ctx,
+ GLuint start,
+ GLuint count );
+
+extern void r200_emit_indexed_verts( GLcontext *ctx,
+ GLuint start,
+ GLuint count );
+
+extern void r200_translate_vertex( GLcontext *ctx,
+ const r200Vertex *src,
+ SWvertex *dst );
+
+extern void r200_print_vertex( GLcontext *ctx, const r200Vertex *v );
+
+extern void r200_import_float_colors( GLcontext *ctx );
+extern void r200_import_float_spec_colors( GLcontext *ctx );
+
+extern void r200PointsBitmap( GLcontext *ctx, GLint px, GLint py,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap );
+
+
+#endif
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_tcl.c b/xc/lib/GL/mesa/src/drv/r200/r200_tcl.c
new file mode 100644
index 000000000..efc8ef83c
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_tcl.c
@@ -0,0 +1,555 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "mmath.h"
+#include "mtypes.h"
+#include "enums.h"
+#include "colormac.h"
+#include "light.h"
+
+#include "array_cache/acache.h"
+#include "tnl/tnl.h"
+#include "tnl/t_pipeline.h"
+
+#include "r200_context.h"
+#include "r200_state.h"
+#include "r200_ioctl.h"
+#include "r200_tex.h"
+#include "r200_tcl.h"
+#include "r200_swtcl.h"
+#include "r200_maos.h"
+
+
+
+#define HAVE_POINTS 1
+#define HAVE_LINES 1
+#define HAVE_LINE_LOOP 0
+#define HAVE_LINE_STRIPS 1
+#define HAVE_TRIANGLES 1
+#define HAVE_TRI_STRIPS 1
+#define HAVE_TRI_STRIP_1 0
+#define HAVE_TRI_FANS 1
+#define HAVE_QUADS 0 /* hw quad verts in wrong order??? */
+#define HAVE_QUAD_STRIPS 1
+#define HAVE_POLYGONS 1
+#define HAVE_ELTS 1
+
+
+#define HW_POINTS R200_VF_PRIM_POINTS
+#define HW_LINES R200_VF_PRIM_LINES
+#define HW_LINE_LOOP 0
+#define HW_LINE_STRIP R200_VF_PRIM_LINE_STRIP
+#define HW_TRIANGLES R200_VF_PRIM_TRIANGLES
+#define HW_TRIANGLE_STRIP_0 R200_VF_PRIM_TRIANGLE_STRIP
+#define HW_TRIANGLE_STRIP_1 0
+#define HW_TRIANGLE_FAN R200_VF_PRIM_TRIANGLE_FAN
+#define HW_QUADS R200_VF_PRIM_QUADS
+#define HW_QUAD_STRIP R200_VF_PRIM_QUAD_STRIP
+#define HW_POLYGON R200_VF_PRIM_POLYGON
+
+
+static GLboolean discrete_prim[0x10] = {
+ 0, /* 0 none */
+ 1, /* 1 points */
+ 1, /* 2 lines */
+ 0, /* 3 line_strip */
+ 1, /* 4 tri_list */
+ 0, /* 5 tri_fan */
+ 0, /* 6 tri_strip */
+ 0, /* 7 tri_w_flags */
+ 1, /* 8 rect list (unused) */
+ 1, /* 9 3vert point */
+ 1, /* a 3vert line */
+ 0, /* b point sprite */
+ 0, /* c line loop */
+ 1, /* d quads */
+ 0, /* e quad strip */
+ 0, /* f polygon */
+};
+
+
+#define LOCAL_VARS r200ContextPtr rmesa = R200_CONTEXT(ctx)
+#define ELTS_VARS GLushort *dest
+
+#define ELT_INIT(prim, hw_prim) \
+ r200TclPrimitive( ctx, prim, hw_prim | R200_VF_PRIM_WALK_IND )
+
+#define GET_ELTS() rmesa->tcl.Elts
+
+
+#define NEW_PRIMITIVE() R200_NEWPRIM( rmesa )
+#define NEW_BUFFER() r200RefillCurrentDmaRegion( rmesa )
+
+/* Don't really know how many elts will fit in what's left of cmdbuf,
+ * as there is state to emit, etc:
+ */
+
+#if 0
+#define GET_CURRENT_VB_MAX_ELTS() \
+ ((R200_CMD_BUF_SZ - (rmesa->store.cmd_used + 16)) / 2)
+#define GET_SUBSEQUENT_VB_MAX_ELTS() ((R200_CMD_BUF_SZ - 16) / 2)
+#else
+/* Testing on isosurf shows a maximum around here. Don't know if it's
+ * the card or driver or kernel module that is causing the behaviour.
+ */
+#define GET_CURRENT_VB_MAX_ELTS() 300
+#define GET_SUBSEQUENT_VB_MAX_ELTS() 300
+#endif
+
+#define RESET_STIPPLE() do { \
+ R200_STATECHANGE( rmesa, lin ); \
+ r200EmitState( rmesa ); \
+} while (0)
+
+#define AUTO_STIPPLE( mode ) do { \
+ R200_STATECHANGE( rmesa, lin ); \
+ if (mode) \
+ rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] |= \
+ R200_LINE_PATTERN_AUTO_RESET; \
+ else \
+ rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] &= \
+ ~R200_LINE_PATTERN_AUTO_RESET; \
+ r200EmitState( rmesa ); \
+} while (0)
+
+
+/* How do you extend an existing primitive?
+ */
+#define ALLOC_ELTS(nr) \
+do { \
+ if (rmesa->dma.flush == r200FlushElts && \
+ rmesa->store.cmd_used + nr*2 < R200_CMD_BUF_SZ) { \
+ \
+ dest = (GLushort *)(rmesa->store.cmd_buf + \
+ rmesa->store.cmd_used); \
+ rmesa->store.cmd_used += nr*2; \
+ } \
+ else { \
+ if (rmesa->dma.flush) \
+ rmesa->dma.flush( rmesa ); \
+ \
+ r200EmitAOS( rmesa, \
+ rmesa->tcl.aos_components, \
+ rmesa->tcl.nr_aos_components, \
+ 0 ); \
+ \
+ dest = r200AllocEltsOpenEnded( rmesa, \
+ rmesa->tcl.hw_primitive, \
+ nr ); \
+ } \
+} while (0)
+
+
+
+/* TODO: Try to extend existing primitive if both are identical,
+ * discrete and there are no intervening state changes. (Somewhat
+ * duplicates changes to DrawArrays code)
+ */
+static void EMIT_PRIM( GLcontext *ctx,
+ GLenum prim,
+ GLuint hwprim,
+ GLuint start,
+ GLuint count)
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+ r200TclPrimitive( ctx, prim, hwprim );
+
+ r200EmitAOS( rmesa,
+ rmesa->tcl.aos_components,
+ rmesa->tcl.nr_aos_components,
+ start );
+
+ /* Why couldn't this packet have taken an offset param?
+ */
+ r200EmitVbufPrim( rmesa,
+ rmesa->tcl.hw_primitive,
+ count - start );
+}
+
+
+
+/* Try & join small primitives
+ */
+#if 0
+#define PREFER_DISCRETE_ELT_PRIM( NR, PRIM ) 0
+#else
+#define PREFER_DISCRETE_ELT_PRIM( NR, PRIM ) \
+ ((NR) < 20 || \
+ ((NR) < 40 && \
+ rmesa->tcl.hw_primitive == (PRIM| \
+ R200_VF_TCL_OUTPUT_VTX_ENABLE| \
+ R200_VF_PRIM_WALK_IND)))
+#endif
+
+#ifdef MESA_BIG_ENDIAN
+/* We could do without (most of) this ugliness if dest was always 32 bit word aligned... */
+#define EMIT_ELT(offset, x) do { \
+ int off = offset + ( ( (GLuint)dest & 0x2 ) >> 1 ); \
+ GLushort *des = (GLushort *)( (GLuint)dest & ~0x2 ); \
+ (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x); } while (0)
+#else
+#define EMIT_ELT(offset, x) (dest)[offset] = (GLushort) (x)
+#endif
+#define EMIT_TWO_ELTS(offset, x, y) *(GLuint *)(dest+offset) = ((y)<<16)|(x);
+#define INCR_ELTS( nr ) dest += nr
+#define RELEASE_ELT_VERTS() \
+ r200ReleaseArrays( ctx, ~0 )
+
+
+
+#define TAG(x) tcl_##x
+#include "tnl_dd/t_dd_dmatmp2.h"
+
+/**********************************************************************/
+/* External entrypoints */
+/**********************************************************************/
+
+void r200EmitPrimitive( GLcontext *ctx,
+ GLuint first,
+ GLuint last,
+ GLuint flags )
+{
+ tcl_render_tab_verts[flags&PRIM_MODE_MASK]( ctx, first, last, flags );
+}
+
+void r200EmitEltPrimitive( GLcontext *ctx,
+ GLuint first,
+ GLuint last,
+ GLuint flags )
+{
+ tcl_render_tab_elts[flags&PRIM_MODE_MASK]( ctx, first, last, flags );
+}
+
+void r200TclPrimitive( GLcontext *ctx,
+ GLenum prim,
+ int hw_prim )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint newprim = hw_prim | R200_VF_TCL_OUTPUT_VTX_ENABLE;
+
+ if (newprim != rmesa->tcl.hw_primitive ||
+ !discrete_prim[hw_prim&0xf]) {
+ R200_NEWPRIM( rmesa );
+ rmesa->tcl.hw_primitive = newprim;
+ }
+}
+
+
+/**********************************************************************/
+/* Render pipeline stage */
+/**********************************************************************/
+
+
+/* TCL render.
+ */
+static GLboolean r200_run_tcl_render( GLcontext *ctx,
+ struct gl_pipeline_stage *stage )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *VB = &tnl->vb;
+ GLuint i,flags = 0,length;
+
+ /* TODO: separate this from the swtnl pipeline
+ */
+ if (rmesa->TclFallback)
+ return GL_TRUE; /* fallback to software t&l */
+
+ if (R200_DEBUG & DEBUG_PRIMS)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ if (VB->Count == 0)
+ return GL_FALSE;
+
+ r200ReleaseArrays( ctx, stage->changed_inputs );
+ r200EmitArrays( ctx, stage->inputs );
+
+ rmesa->tcl.Elts = VB->Elts;
+
+ for (i = VB->FirstPrimitive ; !(flags & PRIM_LAST) ; i += length)
+ {
+ flags = VB->Primitive[i];
+ length = VB->PrimitiveLength[i];
+
+ if (R200_DEBUG & DEBUG_PRIMS)
+ fprintf(stderr, "%s: prim %s %d..%d\n",
+ __FUNCTION__,
+ _mesa_lookup_enum_by_nr(flags & PRIM_MODE_MASK),
+ i, i+length);
+
+ if (!length)
+ continue;
+
+ if (rmesa->tcl.Elts)
+ r200EmitEltPrimitive( ctx, i, i+length, flags );
+ else
+ r200EmitPrimitive( ctx, i, i+length, flags );
+ }
+
+ return GL_FALSE; /* finished the pipe */
+}
+
+
+
+static void r200_check_tcl_render( GLcontext *ctx,
+ struct gl_pipeline_stage *stage )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint inputs = VERT_BIT_POS;
+
+ /* Validate state:
+ */
+ if (rmesa->NewGLState)
+ r200ValidateState( ctx );
+
+ if (0)
+ fprintf(stderr, "%s: RE %d TGE %d NN %d\n",
+ __FUNCTION__,
+ ctx->Texture.Unit[0]._ReallyEnabled,
+ ctx->Texture.Unit[0].TexGenEnabled,
+ rmesa->TexGenNeedNormals[0]);
+
+ if (ctx->RenderMode == GL_RENDER) {
+ /* Make all this event-driven:
+ */
+ if (ctx->Light.Enabled) {
+ inputs |= VERT_BIT_NORMAL;
+
+ if (ctx->Light.ColorMaterialEnabled) {
+ inputs |= VERT_BIT_COLOR0;
+ }
+ }
+ else {
+ inputs |= VERT_BIT_COLOR0;
+
+ if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
+ inputs |= VERT_BIT_COLOR1;
+ }
+ }
+
+ if (ctx->Texture.Unit[0]._ReallyEnabled) {
+ if (ctx->Texture.Unit[0].TexGenEnabled) {
+ if (rmesa->TexGenNeedNormals[0]) {
+ inputs |= VERT_BIT_NORMAL;
+ }
+ } else {
+ inputs |= VERT_BIT_TEX0;
+ }
+ }
+
+ if (ctx->Texture.Unit[1]._ReallyEnabled) {
+ if (ctx->Texture.Unit[1].TexGenEnabled) {
+ if (rmesa->TexGenNeedNormals[1]) {
+ inputs |= VERT_BIT_NORMAL;
+ }
+ } else {
+ inputs |= VERT_BIT_TEX1;
+ }
+ }
+
+ stage->inputs = inputs;
+ stage->active = 1;
+ }
+ else
+ stage->active = 0;
+}
+
+static void r200_init_tcl_render( GLcontext *ctx,
+ struct gl_pipeline_stage *stage )
+{
+ stage->check = r200_check_tcl_render;
+ stage->check( ctx, stage );
+}
+
+static void dtr( struct gl_pipeline_stage *stage )
+{
+ (void)stage;
+}
+
+
+/* Initial state for tcl stage.
+ */
+const struct gl_pipeline_stage _r200_tcl_stage =
+{
+ "r200 render",
+ (_DD_NEW_SEPARATE_SPECULAR |
+ _NEW_LIGHT|
+ _NEW_TEXTURE|
+ _NEW_FOG|
+ _NEW_RENDERMODE), /* re-check (new inputs) */
+ 0, /* re-run (always runs) */
+ GL_TRUE, /* active */
+ 0, 0, /* inputs (set in check_render), outputs */
+ 0, 0, /* changed_inputs, private */
+ dtr, /* destructor */
+ r200_init_tcl_render, /* check - initially set to alloc data */
+ r200_run_tcl_render /* run */
+};
+
+
+
+/**********************************************************************/
+/* Validate state at pipeline start */
+/**********************************************************************/
+
+
+/*-----------------------------------------------------------------------
+ * Manage TCL fallbacks
+ */
+
+
+static void transition_to_swtnl( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ R200_NEWPRIM( rmesa );
+ rmesa->swtcl.vertex_format = 0;
+
+ r200ChooseVertexState( ctx );
+ r200ChooseRenderState( ctx );
+
+ _mesa_validate_all_lighting_tables( ctx );
+
+ tnl->Driver.NotifyMaterialChange =
+ _mesa_validate_all_lighting_tables;
+
+ r200ReleaseArrays( ctx, ~0 );
+
+ /* Still using the D3D based hardware-rasterizer from the radeon;
+ * need to put the card into D3D mode to make it work:
+ */
+ R200_STATECHANGE( rmesa, vap );
+ rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] &= ~R200_VAP_TCL_ENABLE;
+ rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] |= R200_VAP_D3D_TEX_DEFAULT;
+
+ R200_STATECHANGE( rmesa, vte );
+ rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] &= ~R200_VTX_W0_FMT;
+
+ R200_STATECHANGE( rmesa, set );
+ rmesa->hw.set.cmd[SET_RE_CNTL] |= (R200_VTX_STQ0_D3D |
+ R200_VTX_STQ1_D3D);
+}
+
+
+static void transition_to_hwtnl( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ _tnl_need_projected_coords( ctx, GL_FALSE );
+
+ r200UpdateMaterial( ctx );
+
+ tnl->Driver.NotifyMaterialChange = r200UpdateMaterial;
+
+ if ( rmesa->dma.flush )
+ rmesa->dma.flush( rmesa );
+
+ rmesa->dma.flush = 0;
+ rmesa->swtcl.vertex_format = 0;
+
+ if (rmesa->swtcl.indexed_verts.buf)
+ r200ReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts,
+ __FUNCTION__ );
+
+ R200_STATECHANGE( rmesa, vap );
+ rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] |= R200_VAP_TCL_ENABLE;
+ rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] &= ~(R200_VAP_FORCE_W_TO_ONE |
+ R200_VAP_D3D_TEX_DEFAULT);
+
+ 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;
+
+ R200_STATECHANGE( rmesa, set );
+ rmesa->hw.set.cmd[SET_RE_CNTL] &= ~(R200_VTX_STQ0_D3D |
+ R200_VTX_STQ1_D3D);
+
+
+ if (R200_DEBUG & DEBUG_FALLBACKS)
+ fprintf(stderr, "R200 end tcl fallback\n");
+}
+
+
+static char *fallbackStrings[] = {
+ "Rasterization fallback",
+ "Unfilled triangles",
+ "Twosided lighting, differing materials",
+ "Materials in VB (maybe between begin/end)",
+ "Texgen unit 0",
+ "Texgen unit 1",
+ "Texgen unit 2",
+ "User disable"
+};
+
+
+static char *getFallbackString(GLuint bit)
+{
+ int i = 0;
+ while (bit > 1) {
+ i++;
+ bit >>= 1;
+ }
+ return fallbackStrings[i];
+}
+
+
+
+void r200TclFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint oldfallback = rmesa->TclFallback;
+
+ if (mode) {
+ rmesa->TclFallback |= bit;
+ if (oldfallback == 0) {
+ if (R200_DEBUG & DEBUG_FALLBACKS)
+ fprintf(stderr, "R200 begin tcl fallback %s\n",
+ getFallbackString( bit ));
+ transition_to_swtnl( ctx );
+ }
+ }
+ else {
+ rmesa->TclFallback &= ~bit;
+ if (oldfallback == bit) {
+ if (R200_DEBUG & DEBUG_FALLBACKS)
+ fprintf(stderr, "R200 end tcl fallback %s\n",
+ getFallbackString( bit ));
+ transition_to_hwtnl( ctx );
+ }
+ }
+}
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_tcl.h b/xc/lib/GL/mesa/src/drv/r200/r200_tcl.h
new file mode 100644
index 000000000..b0f4386ee
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_tcl.h
@@ -0,0 +1,66 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#ifndef __R200_TCL_H__
+#define __R200_TCL_H__
+
+#ifdef GLX_DIRECT_RENDERING
+
+#include "r200_context.h"
+
+extern void r200TclPrimitive( GLcontext *ctx, GLenum prim, int hw_prim );
+extern void r200EmitEltPrimitive( GLcontext *ctx, GLuint first, GLuint last,
+ GLuint flags );
+extern void r200EmitPrimitive( GLcontext *ctx, GLuint first, GLuint last,
+ GLuint flags );
+
+extern void r200TclFallback( GLcontext *ctx, GLuint bit, GLboolean mode );
+
+#define R200_TCL_FALLBACK_RASTER 0x1 /* rasterization */
+#define R200_TCL_FALLBACK_UNFILLED 0x2 /* unfilled tris */
+#define R200_TCL_FALLBACK_LIGHT_TWOSIDE 0x4 /* twoside tris */
+#define R200_TCL_FALLBACK_MATERIAL 0x8 /* material in vb */
+#define R200_TCL_FALLBACK_TEXGEN_0 0x10 /* texgen, unit 0 */
+#define R200_TCL_FALLBACK_TEXGEN_1 0x20 /* texgen, unit 1 */
+#define R200_TCL_FALLBACK_TEXGEN_2 0x40 /* texgen, unit 2 */
+#define R200_TCL_FALLBACK_TCL_DISABLE 0x80 /* user disable */
+#define R200_TCL_FALLBACK_BITMAP 0x100 /* draw bitmap with points */
+
+#define R200_MAX_TCL_VERTSIZE (4*4) /* using maos now... */
+
+#define TCL_FALLBACK( ctx, bit, mode ) r200TclFallback( ctx, bit, mode )
+
+
+#endif
+#endif
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_tex.c b/xc/lib/GL/mesa/src/drv/r200/r200_tex.c
new file mode 100644
index 000000000..d9efd101a
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_tex.c
@@ -0,0 +1,988 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "colormac.h"
+#include "context.h"
+#include "enums.h"
+#include "image.h"
+#include "mmath.h"
+#include "simple_list.h"
+#include "texformat.h"
+#include "texstore.h"
+#include "texutil.h"
+
+#include "r200_context.h"
+#include "r200_state.h"
+#include "r200_ioctl.h"
+#include "r200_swtcl.h"
+#include "r200_tex.h"
+
+
+/* =============================================================
+ * Utility functions:
+ */
+
+static void r200SetTexWrap( r200TexObjPtr t, GLenum swrap, GLenum twrap, GLenum rwrap )
+{
+ t->pp_txfilter &= ~(R200_CLAMP_S_MASK | R200_CLAMP_T_MASK);
+
+ switch ( swrap ) {
+ case GL_REPEAT:
+ t->pp_txfilter |= R200_CLAMP_S_WRAP;
+ break;
+ case GL_CLAMP:
+ t->pp_txfilter |= R200_CLAMP_S_CLAMP_LAST;
+ break;
+ case GL_CLAMP_TO_EDGE:
+ t->pp_txfilter |= R200_CLAMP_S_CLAMP_LAST;
+ break;
+ case GL_CLAMP_TO_BORDER:
+ t->pp_txfilter |= R200_CLAMP_S_CLAMP_BORDER;
+ break;
+ case GL_MIRRORED_REPEAT_ARB:
+ t->pp_txfilter |= R200_CLAMP_S_MIRROR;
+ break;
+ case GL_MIRROR_CLAMP_ATI:
+ t->pp_txfilter |= R200_CLAMP_S_MIRROR_CLAMP_BORDER;
+ break;
+ case GL_MIRROR_CLAMP_TO_EDGE_ATI:
+ t->pp_txfilter |= R200_CLAMP_S_MIRROR_CLAMP_LAST;
+ break;
+ default:
+ _mesa_problem(NULL, "bad S wrap mode in r200SetTexWrap");
+ }
+
+ switch ( twrap ) {
+ case GL_REPEAT:
+ t->pp_txfilter |= R200_CLAMP_T_WRAP;
+ break;
+ case GL_CLAMP:
+ t->pp_txfilter |= R200_CLAMP_T_CLAMP_LAST;
+ break;
+ case GL_CLAMP_TO_EDGE:
+ t->pp_txfilter |= R200_CLAMP_T_CLAMP_LAST;
+ break;
+ case GL_CLAMP_TO_BORDER:
+ t->pp_txfilter |= R200_CLAMP_T_CLAMP_BORDER;
+ break;
+ case GL_MIRRORED_REPEAT_ARB:
+ t->pp_txfilter |= R200_CLAMP_T_MIRROR;
+ break;
+ case GL_MIRROR_CLAMP_ATI:
+ t->pp_txfilter |= R200_CLAMP_T_MIRROR_CLAMP_BORDER;
+ break;
+ case GL_MIRROR_CLAMP_TO_EDGE_ATI:
+ t->pp_txfilter |= R200_CLAMP_T_MIRROR_CLAMP_LAST;
+ break;
+ default:
+ _mesa_problem(NULL, "bad S wrap mode in r200SetTexWrap");
+ }
+
+ t->pp_txformat_x &= ~R200_CLAMP_Q_MASK;
+
+ switch ( rwrap ) {
+ case GL_REPEAT:
+ t->pp_txformat_x |= R200_CLAMP_Q_WRAP;
+ break;
+ case GL_CLAMP:
+ t->pp_txformat_x |= R200_CLAMP_Q_CLAMP_LAST;
+ break;
+ case GL_CLAMP_TO_EDGE:
+ t->pp_txformat_x |= R200_CLAMP_Q_CLAMP_LAST;
+ break;
+ case GL_CLAMP_TO_BORDER:
+ t->pp_txformat_x |= R200_CLAMP_Q_CLAMP_BORDER;
+ break;
+ case GL_MIRRORED_REPEAT_ARB:
+ t->pp_txformat_x |= R200_CLAMP_Q_MIRROR;
+ break;
+ case GL_MIRROR_CLAMP_ATI:
+ t->pp_txformat_x |= R200_CLAMP_Q_MIRROR_CLAMP_BORDER;
+ break;
+ case GL_MIRROR_CLAMP_TO_EDGE_ATI:
+ t->pp_txformat_x |= R200_CLAMP_Q_MIRROR_CLAMP_LAST;
+ break;
+ default:
+ _mesa_problem(NULL, "bad R wrap mode in r200SetTexWrap");
+ }
+}
+
+static void r200SetTexMaxAnisotropy( r200TexObjPtr t, GLfloat max )
+{
+ t->pp_txfilter &= ~R200_MAX_ANISO_MASK;
+
+ if ( max == 1.0 ) {
+ t->pp_txfilter |= R200_MAX_ANISO_1_TO_1;
+ } else if ( max <= 2.0 ) {
+ t->pp_txfilter |= R200_MAX_ANISO_2_TO_1;
+ } else if ( max <= 4.0 ) {
+ t->pp_txfilter |= R200_MAX_ANISO_4_TO_1;
+ } else if ( max <= 8.0 ) {
+ t->pp_txfilter |= R200_MAX_ANISO_8_TO_1;
+ } else {
+ t->pp_txfilter |= R200_MAX_ANISO_16_TO_1;
+ }
+}
+
+static void r200SetTexFilter( r200TexObjPtr t, GLenum minf, GLenum magf )
+{
+ GLuint anisotropy = (t->pp_txfilter & R200_MAX_ANISO_MASK);
+
+ t->pp_txfilter &= ~(R200_MIN_FILTER_MASK | R200_MAG_FILTER_MASK);
+ t->pp_txformat_x &= ~R200_VOLUME_FILTER_MASK;
+
+ if ( anisotropy == R200_MAX_ANISO_1_TO_1 ) {
+ switch ( minf ) {
+ case GL_NEAREST:
+ t->pp_txfilter |= R200_MIN_FILTER_NEAREST;
+ break;
+ case GL_LINEAR:
+ t->pp_txfilter |= R200_MIN_FILTER_LINEAR;
+ break;
+ case GL_NEAREST_MIPMAP_NEAREST:
+ t->pp_txfilter |= R200_MIN_FILTER_NEAREST_MIP_NEAREST;
+ break;
+ case GL_NEAREST_MIPMAP_LINEAR:
+ t->pp_txfilter |= R200_MIN_FILTER_LINEAR_MIP_NEAREST;
+ break;
+ case GL_LINEAR_MIPMAP_NEAREST:
+ t->pp_txfilter |= R200_MIN_FILTER_NEAREST_MIP_LINEAR;
+ break;
+ case GL_LINEAR_MIPMAP_LINEAR:
+ t->pp_txfilter |= R200_MIN_FILTER_LINEAR_MIP_LINEAR;
+ break;
+ }
+ } else {
+ switch ( minf ) {
+ case GL_NEAREST:
+ t->pp_txfilter |= R200_MIN_FILTER_ANISO_NEAREST;
+ break;
+ case GL_LINEAR:
+ t->pp_txfilter |= R200_MIN_FILTER_ANISO_LINEAR;
+ break;
+ case GL_NEAREST_MIPMAP_NEAREST:
+ case GL_LINEAR_MIPMAP_NEAREST:
+ t->pp_txfilter |= R200_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST;
+ break;
+ case GL_NEAREST_MIPMAP_LINEAR:
+ case GL_LINEAR_MIPMAP_LINEAR:
+ t->pp_txfilter |= R200_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR;
+ break;
+ }
+ }
+
+ /* Note we don't have 3D mipmaps so only use the mag filter setting
+ * to set the 3D texture filter mode.
+ */
+ switch ( magf ) {
+ case GL_NEAREST:
+ t->pp_txfilter |= R200_MAG_FILTER_NEAREST;
+ t->pp_txformat_x |= R200_VOLUME_FILTER_NEAREST;
+ break;
+ case GL_LINEAR:
+ t->pp_txfilter |= R200_MAG_FILTER_LINEAR;
+ t->pp_txformat_x |= R200_VOLUME_FILTER_LINEAR;
+ break;
+ }
+}
+
+static void r200SetTexBorderColor( r200TexObjPtr t, GLubyte c[4] )
+{
+ t->pp_border_color = r200PackColor( 4, c[0], c[1], c[2], c[3] );
+}
+
+
+static r200TexObjPtr r200AllocTexObj( struct gl_texture_object *texObj )
+{
+ r200TexObjPtr t;
+
+ t = CALLOC_STRUCT( r200_tex_obj );
+ if (!t)
+ return NULL;
+
+ if ( R200_DEBUG & DEBUG_TEXTURE ) {
+ fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, texObj, t );
+ }
+
+ t->tObj = texObj;
+ make_empty_list( t );
+
+ /* Initialize non-image-dependent parts of the state:
+ */
+ r200SetTexWrap( t, texObj->WrapS, texObj->WrapT, texObj->WrapR );
+ r200SetTexMaxAnisotropy( t, texObj->MaxAnisotropy );
+ r200SetTexFilter( t, texObj->MinFilter, texObj->MagFilter );
+ r200SetTexBorderColor( t, texObj->_BorderChan );
+ return t;
+}
+
+
+static const struct gl_texture_format *
+r200ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
+ GLenum format, GLenum type )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ const GLboolean do32bpt = ( rmesa->r200Screen->cpp == 4 );
+
+ switch ( internalFormat ) {
+ case 4:
+ case GL_RGBA:
+ if ( format == GL_BGRA ) {
+ if ( type == GL_UNSIGNED_INT_8_8_8_8_REV ) {
+ return &_mesa_texformat_argb8888;
+ }
+ else if ( type == GL_UNSIGNED_SHORT_4_4_4_4_REV ) {
+ return &_mesa_texformat_argb4444;
+ }
+ else if ( type == GL_UNSIGNED_SHORT_1_5_5_5_REV ) {
+ return &_mesa_texformat_argb1555;
+ }
+ }
+ return do32bpt ? &_mesa_texformat_rgba8888 : &_mesa_texformat_argb4444;
+
+ case 3:
+ case GL_RGB:
+ if ( format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 ) {
+ return &_mesa_texformat_rgb565;
+ }
+ return do32bpt ? &_mesa_texformat_rgba8888 : &_mesa_texformat_rgb565;
+
+ case GL_RGBA8:
+ case GL_RGB10_A2:
+ case GL_RGBA12:
+ case GL_RGBA16:
+ return do32bpt ? &_mesa_texformat_rgba8888 : &_mesa_texformat_argb4444;
+
+ case GL_RGBA4:
+ case GL_RGBA2:
+ return &_mesa_texformat_argb4444;
+
+ case GL_RGB5_A1:
+ return &_mesa_texformat_argb1555;
+
+ case GL_RGB8:
+ case GL_RGB10:
+ case GL_RGB12:
+ case GL_RGB16:
+ return do32bpt ? &_mesa_texformat_rgba8888 : &_mesa_texformat_rgb565;
+
+ case GL_RGB5:
+ case GL_RGB4:
+ case GL_R3_G3_B2:
+ return &_mesa_texformat_rgb565;
+
+ case GL_ALPHA:
+ case GL_ALPHA4:
+ case GL_ALPHA8:
+ case GL_ALPHA12:
+ case GL_ALPHA16:
+ return &_mesa_texformat_al88;
+
+ case 1:
+ case GL_LUMINANCE:
+ case GL_LUMINANCE4:
+ case GL_LUMINANCE8:
+ case GL_LUMINANCE12:
+ case GL_LUMINANCE16:
+ return &_mesa_texformat_al88;
+
+ case 2:
+ case GL_LUMINANCE_ALPHA:
+ case GL_LUMINANCE4_ALPHA4:
+ case GL_LUMINANCE6_ALPHA2:
+ case GL_LUMINANCE8_ALPHA8:
+ case GL_LUMINANCE12_ALPHA4:
+ case GL_LUMINANCE12_ALPHA12:
+ case GL_LUMINANCE16_ALPHA16:
+ return &_mesa_texformat_al88;
+
+ case GL_INTENSITY:
+ case GL_INTENSITY4:
+ case GL_INTENSITY8:
+ case GL_INTENSITY12:
+ case GL_INTENSITY16:
+ /* At the moment, glean & conform both fail using the i8 internal
+ * format.
+ */
+ return &_mesa_texformat_al88;
+/* return &_mesa_texformat_i8; */
+
+ case GL_YCBCR_MESA:
+ if (type == GL_UNSIGNED_SHORT_8_8_APPLE ||
+ type == GL_UNSIGNED_BYTE)
+ return &_mesa_texformat_ycbcr;
+ else
+ return &_mesa_texformat_ycbcr_rev;
+
+ default:
+ _mesa_problem(ctx, "unexpected texture format in r200ChoosTexFormat");
+ return NULL;
+ }
+
+ return NULL; /* never get here */
+}
+
+
+static GLboolean
+r200ValidateClientStorage( GLcontext *ctx, GLenum target,
+ GLint internalFormat,
+ GLint srcWidth, GLint srcHeight,
+ GLenum format, GLenum type, const void *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ int texelBytes;
+
+ if (0)
+ fprintf(stderr, "intformat %s format %s type %s\n",
+ _mesa_lookup_enum_by_nr( internalFormat ),
+ _mesa_lookup_enum_by_nr( format ),
+ _mesa_lookup_enum_by_nr( type ));
+
+ if (!ctx->Unpack.ClientStorage)
+ return 0;
+
+ if (ctx->_ImageTransferState ||
+ texImage->IsCompressed ||
+ texObj->GenerateMipmap)
+ return 0;
+
+
+ /* This list is incomplete, may be different on ppc???
+ */
+ switch ( internalFormat ) {
+ case GL_RGBA:
+ if ( format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8_REV ) {
+ texImage->TexFormat = &_mesa_texformat_argb8888;
+ texelBytes = 4;
+ }
+ else
+ return 0;
+ break;
+
+ case GL_YCBCR_MESA:
+ if ( format == GL_YCBCR_MESA &&
+ type == GL_UNSIGNED_SHORT_8_8_REV_APPLE ) {
+ texImage->TexFormat = &_mesa_texformat_ycbcr_rev;
+ texelBytes = 2;
+ }
+ else if ( format == GL_YCBCR_MESA &&
+ (type == GL_UNSIGNED_SHORT_8_8_APPLE ||
+ type == GL_UNSIGNED_BYTE)) {
+ texImage->TexFormat = &_mesa_texformat_ycbcr;
+ texelBytes = 2;
+ }
+ else
+ return 0;
+ break;
+
+
+ default:
+ return 0;
+ }
+
+ /* Could deal with these packing issues, but currently don't:
+ */
+ if (packing->SkipPixels ||
+ packing->SkipRows ||
+ packing->SwapBytes ||
+ packing->LsbFirst) {
+ return 0;
+ }
+
+ {
+ GLint srcRowStride = _mesa_image_row_stride(packing, srcWidth,
+ format, type);
+
+
+ if (0)
+ fprintf(stderr, "%s: srcRowStride %d/%x\n",
+ __FUNCTION__, srcRowStride, srcRowStride);
+
+ /* Could check this later in upload, pitch restrictions could be
+ * relaxed, but would need to store the image pitch somewhere,
+ * as packing details might change before image is uploaded:
+ */
+ if (!r200IsAgpMemory( rmesa, pixels, srcHeight * srcRowStride ) ||
+ (srcRowStride & 63))
+ return 0;
+
+
+ /* Have validated that _mesa_transfer_teximage would be a straight
+ * memcpy at this point. NOTE: future calls to TexSubImage will
+ * overwrite the client data. This is explicitly mentioned in the
+ * extension spec.
+ */
+ texImage->Data = (void *)pixels;
+ texImage->IsClientData = GL_TRUE;
+ texImage->RowStride = srcRowStride / texelBytes;
+ return 1;
+ }
+}
+
+
+static void r200TexImage1D( GLcontext *ctx, GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint border,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ r200TexObjPtr t = (r200TexObjPtr) texObj->DriverData;
+
+ if ( t ) {
+ r200SwapOutTexObj( rmesa, t );
+ }
+ else {
+ t = r200AllocTexObj( texObj );
+ if (!t) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D");
+ return;
+ }
+ texObj->DriverData = t;
+ }
+
+ /* Note, this will call r200ChooseTextureFormat */
+ _mesa_store_teximage1d(ctx, target, level, internalFormat,
+ width, border, format, type, pixels,
+ &ctx->Unpack, texObj, texImage);
+
+ t->dirty_images[0] |= (1 << level);
+}
+
+
+static void r200TexSubImage1D( GLcontext *ctx, GLenum target, GLint level,
+ GLint xoffset,
+ GLsizei width,
+ GLenum format, GLenum type,
+ const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ r200TexObjPtr t = (r200TexObjPtr)texObj->DriverData;
+
+ assert( t ); /* this _should_ be true */
+ if ( t ) {
+ r200SwapOutTexObj( rmesa, t );
+ t->dirty_images[0] |= (1 << level);
+ }
+ else {
+ t = r200AllocTexObj(texObj);
+ if (!t) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage1D");
+ return;
+ }
+ texObj->DriverData = t;
+ }
+
+ _mesa_store_texsubimage1d(ctx, target, level, xoffset, width,
+ format, type, pixels, packing, texObj,
+ texImage);
+
+ t->dirty_images[0] |= (1 << level);
+}
+
+
+static void r200TexImage2D( GLcontext *ctx, GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint height, GLint border,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ r200TexObjPtr t = (r200TexObjPtr)texObj->DriverData;
+ GLuint face;
+
+ /* which cube face or ordinary 2D image */
+ switch (target) {
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+ face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
+ ASSERT(face < 6);
+ break;
+ default:
+ face = 0;
+ }
+
+ if ( t ) {
+ r200SwapOutTexObj( rmesa, t );
+ }
+ else {
+ t = r200AllocTexObj( texObj );
+ if (!t) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
+ return;
+ }
+ texObj->DriverData = t;
+ }
+
+ texImage->IsClientData = GL_FALSE;
+
+ if (r200ValidateClientStorage( ctx, target,
+ internalFormat,
+ width, height,
+ format, type, pixels,
+ packing, texObj, texImage)) {
+ if (R200_DEBUG & DEBUG_TEXTURE)
+ fprintf(stderr, "%s: Using client storage\n", __FUNCTION__);
+ }
+ else {
+ if (R200_DEBUG & DEBUG_TEXTURE)
+ fprintf(stderr, "%s: Using normal storage\n", __FUNCTION__);
+
+ /* Normal path: copy (to cached memory) and eventually upload
+ * via another copy to agp memory and then a blit... Could
+ * eliminate one copy by going straight to (permanent) agp.
+ *
+ * Note, this will call r200ChooseTextureFormat.
+ */
+ _mesa_store_teximage2d(ctx, target, level, internalFormat,
+ width, height, border, format, type, pixels,
+ &ctx->Unpack, texObj, texImage);
+
+ t->dirty_images[face] |= (1 << level);
+ }
+}
+
+
+static void r200TexSubImage2D( GLcontext *ctx, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ r200TexObjPtr t = (r200TexObjPtr) texObj->DriverData;
+ GLuint face;
+
+/* fprintf(stderr, "%s\n", __FUNCTION__); */
+
+ /* which cube face or ordinary 2D image */
+ switch (target) {
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+ face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
+ ASSERT(face < 6);
+ break;
+ default:
+ face = 0;
+ }
+
+ assert( t ); /* this _should_ be true */
+ if ( t ) {
+ r200SwapOutTexObj( rmesa, t );
+ }
+ else {
+ t = r200AllocTexObj(texObj);
+ if (!t) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D");
+ return;
+ }
+ texObj->DriverData = t;
+ }
+
+ _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
+ height, format, type, pixels, packing, texObj,
+ texImage);
+
+ t->dirty_images[face] |= (1 << level);
+}
+
+
+static void r200TexImage3D( GLcontext *ctx, GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint height, GLint depth,
+ GLint border,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ r200TexObjPtr t = (r200TexObjPtr)texObj->DriverData;
+
+ if ( t ) {
+ r200SwapOutTexObj( rmesa, t );
+ }
+ else {
+ t = r200AllocTexObj( texObj );
+ if (!t) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D");
+ return;
+ }
+ texObj->DriverData = t;
+ }
+
+ texImage->IsClientData = GL_FALSE;
+
+#if 0
+ if (r200ValidateClientStorage( ctx, target,
+ internalFormat,
+ width, height,
+ format, type, pixels,
+ packing, texObj, texImage)) {
+ if (R200_DEBUG & DEBUG_TEXTURE)
+ fprintf(stderr, "%s: Using client storage\n", __FUNCTION__);
+ }
+ else
+#endif
+ {
+ if (R200_DEBUG & DEBUG_TEXTURE)
+ fprintf(stderr, "%s: Using normal storage\n", __FUNCTION__);
+
+ /* Normal path: copy (to cached memory) and eventually upload
+ * via another copy to agp memory and then a blit... Could
+ * eliminate one copy by going straight to (permanent) agp.
+ *
+ * Note, this will call r200ChooseTextureFormat.
+ */
+ _mesa_store_teximage3d(ctx, target, level, internalFormat,
+ width, height, depth, border,
+ format, type, pixels,
+ &ctx->Unpack, texObj, texImage);
+
+ t->dirty_images[0] |= (1 << level);
+ }
+}
+
+
+static void
+r200TexSubImage3D( GLcontext *ctx, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type,
+ const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ r200TexObjPtr t = (r200TexObjPtr) texObj->DriverData;
+
+/* fprintf(stderr, "%s\n", __FUNCTION__); */
+
+ assert( t ); /* this _should_ be true */
+ if ( t ) {
+ r200SwapOutTexObj( rmesa, t );
+ }
+ else {
+ t = r200AllocTexObj(texObj);
+ if (!t) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage3D");
+ return;
+ }
+ texObj->DriverData = t;
+ }
+
+ _mesa_store_texsubimage3d(ctx, target, level, xoffset, yoffset, zoffset,
+ width, height, depth,
+ format, type, pixels, packing, texObj, texImage);
+
+ t->dirty_images[0] |= (1 << level);
+}
+
+
+
+static void r200TexEnv( GLcontext *ctx, GLenum target,
+ GLenum pname, const GLfloat *param )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint unit = ctx->Texture.CurrentUnit;
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+
+ if ( R200_DEBUG & DEBUG_STATE ) {
+ fprintf( stderr, "%s( %s )\n",
+ __FUNCTION__, _mesa_lookup_enum_by_nr( pname ) );
+ }
+
+ /* This is incorrect: Need to maintain this data for each of
+ * GL_TEXTURE_{123}D, GL_TEXTURE_RECTANGLE_NV, etc, and switch
+ * between them according to _ReallyEnabled.
+ */
+ switch ( pname ) {
+ case GL_TEXTURE_ENV_COLOR: {
+ GLubyte c[4];
+ GLuint envColor;
+ UNCLAMPED_FLOAT_TO_RGBA_CHAN( c, texUnit->EnvColor );
+ envColor = r200PackColor( 4, c[0], c[1], c[2], c[3] );
+ if ( rmesa->hw.tf.cmd[TF_TFACTOR_0 + unit] != envColor ) {
+ R200_STATECHANGE( rmesa, tf );
+ rmesa->hw.tf.cmd[TF_TFACTOR_0 + unit] = envColor;
+ }
+ break;
+ }
+
+ case GL_TEXTURE_LOD_BIAS_EXT: {
+ GLfloat bias;
+ GLuint b;
+ const int fixed_one = 0x8000000;
+
+ /* The R200's LOD bias is a signed 2's complement value with a
+ * range of -16.0 <= bias < 16.0.
+ *
+ * NOTE: Add a small bias to the bias for conform mipsel.c test.
+ */
+ bias = *param + .01;
+ bias = CLAMP( bias, -16.0, 16.0 );
+ b = (int)(bias * fixed_one) & R200_LOD_BIAS_MASK;
+
+ if ( (rmesa->hw.tex[unit].cmd[TEX_PP_TXFORMAT_X] & R200_LOD_BIAS_MASK) != b ) {
+ R200_STATECHANGE( rmesa, tex[unit] );
+ rmesa->hw.tex[unit].cmd[TEX_PP_TXFORMAT_X] &= ~R200_LOD_BIAS_MASK;
+ rmesa->hw.tex[unit].cmd[TEX_PP_TXFORMAT_X] |= b;
+ }
+ break;
+ }
+
+ default:
+ return;
+ }
+}
+
+static void r200TexParameter( GLcontext *ctx, GLenum target,
+ struct gl_texture_object *texObj,
+ GLenum pname, const GLfloat *params )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ r200TexObjPtr t = (r200TexObjPtr) texObj->DriverData;
+
+ if ( R200_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
+ fprintf( stderr, "%s( %s )\n", __FUNCTION__,
+ _mesa_lookup_enum_by_nr( pname ) );
+ }
+
+ if (!t)
+ return;
+
+ switch ( pname ) {
+ case GL_TEXTURE_MIN_FILTER:
+ case GL_TEXTURE_MAG_FILTER:
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ r200SetTexMaxAnisotropy( t, texObj->MaxAnisotropy );
+ r200SetTexFilter( t, texObj->MinFilter, texObj->MagFilter );
+ break;
+
+ case GL_TEXTURE_WRAP_S:
+ case GL_TEXTURE_WRAP_T:
+ case GL_TEXTURE_WRAP_R:
+ r200SetTexWrap( t, texObj->WrapS, texObj->WrapT, texObj->WrapR );
+ break;
+
+ case GL_TEXTURE_BORDER_COLOR:
+ r200SetTexBorderColor( t, texObj->_BorderChan );
+ break;
+
+ case GL_TEXTURE_BASE_LEVEL:
+ case GL_TEXTURE_MAX_LEVEL:
+ case GL_TEXTURE_MIN_LOD:
+ case GL_TEXTURE_MAX_LOD:
+ /* This isn't the most efficient solution but there doesn't appear to
+ * be a nice alternative for R200. Since there's no LOD clamping,
+ * we just have to rely on loading the right subset of mipmap levels
+ * to simulate a clamped LOD.
+ */
+ r200SwapOutTexObj( rmesa, t );
+ break;
+
+ default:
+ return;
+ }
+
+ /* Mark this texobj as dirty (one bit per tex unit)
+ */
+ t->dirty_state = TEX_ALL;
+}
+
+
+
+static void r200BindTexture( GLcontext *ctx, GLenum target,
+ struct gl_texture_object *texObj )
+{
+ r200TexObjPtr t = (r200TexObjPtr) texObj->DriverData;
+ GLuint unit = ctx->Texture.CurrentUnit;
+
+ if ( R200_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
+ fprintf( stderr, "%s( %p ) unit=%d\n", __FUNCTION__, texObj, unit );
+ }
+
+ if ( target == GL_TEXTURE_2D || target == GL_TEXTURE_1D ) {
+ if ( !t ) {
+ t = r200AllocTexObj( texObj );
+ texObj->DriverData = t;
+ }
+ }
+}
+
+static void r200DeleteTexture( GLcontext *ctx,
+ struct gl_texture_object *texObj )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ r200TexObjPtr t = (r200TexObjPtr) texObj->DriverData;
+
+ if ( R200_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
+ fprintf( stderr, "%s( %p )\n", __FUNCTION__, texObj );
+ }
+
+ if ( t ) {
+ if ( rmesa ) {
+ R200_FIREVERTICES( rmesa );
+ }
+ r200DestroyTexObj( rmesa, t );
+ texObj->DriverData = NULL;
+ }
+}
+
+static GLboolean r200IsTextureResident( GLcontext *ctx,
+ struct gl_texture_object *texObj )
+{
+ r200TexObjPtr t = (r200TexObjPtr) texObj->DriverData;
+
+ return ( t && t->memBlock );
+}
+
+
+static void r200InitTextureObjects( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ struct gl_texture_object *texObj;
+ GLuint tmp = ctx->Texture.CurrentUnit;
+
+ ctx->Texture.CurrentUnit = 0;
+
+ texObj = ctx->Texture.Unit[0].Current1D;
+ r200BindTexture( ctx, GL_TEXTURE_1D, texObj );
+ move_to_tail( &rmesa->texture.swapped,
+ (r200TexObjPtr)texObj->DriverData );
+
+ texObj = ctx->Texture.Unit[0].Current2D;
+ r200BindTexture( ctx, GL_TEXTURE_2D, texObj );
+ move_to_tail( &rmesa->texture.swapped,
+ (r200TexObjPtr)texObj->DriverData );
+
+ ctx->Texture.CurrentUnit = 1;
+
+ texObj = ctx->Texture.Unit[1].Current1D;
+ r200BindTexture( ctx, GL_TEXTURE_1D, texObj );
+ move_to_tail( &rmesa->texture.swapped,
+ (r200TexObjPtr)texObj->DriverData );
+
+ texObj = ctx->Texture.Unit[1].Current2D;
+ r200BindTexture( ctx, GL_TEXTURE_2D, texObj );
+ move_to_tail( &rmesa->texture.swapped,
+ (r200TexObjPtr)texObj->DriverData );
+
+ ctx->Texture.CurrentUnit = tmp;
+}
+
+/* Need:
+ * - Same GEN_MODE for all active bits
+ * - Same EyePlane/ObjPlane for all active bits when using Eye/Obj
+ * - STRQ presumably all supported (matrix means incoming R values
+ * can end up in STQ, this has implications for vertex support,
+ * presumably ok if maos is used, though?)
+ *
+ * Basically impossible to do this on the fly - just collect some
+ * basic info & do the checks from ValidateState().
+ */
+static void r200TexGen( GLcontext *ctx,
+ GLenum coord,
+ GLenum pname,
+ const GLfloat *params )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint unit = ctx->Texture.CurrentUnit;
+ rmesa->recheck_texgen[unit] = GL_TRUE;
+}
+
+
+void r200InitTextureFuncs( GLcontext *ctx )
+{
+ ctx->Driver.ChooseTextureFormat = r200ChooseTextureFormat;
+ ctx->Driver.TexImage1D = r200TexImage1D;
+ ctx->Driver.TexImage2D = r200TexImage2D;
+#if ENABLE_HW_3D_TEXTURE
+ ctx->Driver.TexImage3D = r200TexImage3D;
+#else
+ ctx->Driver.TexImage3D = _mesa_store_teximage3d;
+#endif
+ ctx->Driver.TexSubImage1D = r200TexSubImage1D;
+ ctx->Driver.TexSubImage2D = r200TexSubImage2D;
+#if ENABLE_HW_3D_TEXTURE
+ ctx->Driver.TexSubImage3D = r200TexSubImage3D;
+#else
+ ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d;
+#endif
+ ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d;
+ ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d;
+ ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d;
+ ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d;
+ ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d;
+ ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage;
+
+ ctx->Driver.BindTexture = r200BindTexture;
+ ctx->Driver.CreateTexture = NULL; /* FIXME: Is this used??? */
+ ctx->Driver.DeleteTexture = r200DeleteTexture;
+ ctx->Driver.IsTextureResident = r200IsTextureResident;
+ ctx->Driver.PrioritizeTexture = NULL;
+ ctx->Driver.ActiveTexture = NULL;
+ ctx->Driver.UpdateTexturePalette = NULL;
+
+ ctx->Driver.TexEnv = r200TexEnv;
+ ctx->Driver.TexParameter = r200TexParameter;
+ ctx->Driver.TexGen = r200TexGen;
+
+ r200InitTextureObjects( ctx );
+}
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_tex.h b/xc/lib/GL/mesa/src/drv/r200/r200_tex.h
new file mode 100644
index 000000000..17230ae99
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_tex.h
@@ -0,0 +1,55 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#ifndef __R200_TEX_H__
+#define __R200_TEX_H__
+
+#ifdef GLX_DIRECT_RENDERING
+
+extern void r200UpdateTextureState( GLcontext *ctx );
+
+extern int r200UploadTexImages( r200ContextPtr rmesa, r200TexObjPtr t, GLuint face );
+
+extern void r200AgeTextures( r200ContextPtr rmesa, int heap );
+extern void r200DestroyTexObj( r200ContextPtr rmesa, r200TexObjPtr t );
+extern void r200SwapOutTexObj( r200ContextPtr rmesa, r200TexObjPtr t );
+
+extern void r200PrintLocalLRU( r200ContextPtr rmesa, int heap );
+extern void r200PrintGlobalLRU( r200ContextPtr rmesa, int heap );
+extern void r200UpdateTexLRU( r200ContextPtr rmesa, r200TexObjPtr t );
+
+extern void r200InitTextureFuncs( GLcontext *ctx );
+
+#endif
+#endif /* __R200_TEX_H__ */
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_texmem.c b/xc/lib/GL/mesa/src/drv/r200/r200_texmem.c
new file mode 100644
index 000000000..fe584c4c5
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_texmem.c
@@ -0,0 +1,809 @@
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright (C) Tungsten Graphics 2002. All Rights Reserved.
+The Weather Channel, Inc. funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86
+license. This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation on the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT. IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR THEIR
+SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <martin@valinux.com>
+ * Gareth Hughes <gareth@valinux.com>
+ *
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "context.h"
+#include "colormac.h"
+#include "mmath.h"
+#include "macros.h"
+#include "simple_list.h"
+#include "radeon_reg.h" /* gets definition for usleep */
+#include "r200_context.h"
+#include "r200_state.h"
+#include "r200_ioctl.h"
+#include "r200_swtcl.h"
+#include "r200_tex.h"
+
+#include <unistd.h> /* for usleep() */
+
+
+/* Destroy hardware state associated with texture `t'.
+ */
+void r200DestroyTexObj( r200ContextPtr rmesa, r200TexObjPtr t )
+{
+ if ( !t )
+ return;
+
+ if ( R200_DEBUG & DEBUG_TEXTURE ) {
+ fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, t, t->tObj );
+ }
+
+ if ( t->memBlock ) {
+ mmFreeMem( t->memBlock );
+ t->memBlock = NULL;
+ }
+
+ if ( t->tObj )
+ t->tObj->DriverData = NULL;
+
+ if ( rmesa ) {
+ if ( t == rmesa->state.texture.unit[0].texobj ) {
+ rmesa->state.texture.unit[0].texobj = NULL;
+ remove_from_list( &rmesa->hw.tex[0] );
+ make_empty_list( &rmesa->hw.tex[0] );
+ remove_from_list( &rmesa->hw.cube[0] );
+ make_empty_list( &rmesa->hw.cube[0] );
+ }
+
+ if ( t == rmesa->state.texture.unit[1].texobj ) {
+ rmesa->state.texture.unit[1].texobj = NULL;
+ remove_from_list( &rmesa->hw.tex[1] );
+ make_empty_list( &rmesa->hw.tex[1] );
+ remove_from_list( &rmesa->hw.cube[1] );
+ make_empty_list( &rmesa->hw.cube[1] );
+ }
+ }
+
+ remove_from_list( t );
+ FREE( t );
+}
+
+
+/* Keep track of swapped out texture objects.
+ */
+void r200SwapOutTexObj( r200ContextPtr rmesa, r200TexObjPtr t )
+{
+ GLuint face;
+
+ if ( R200_DEBUG & DEBUG_TEXTURE ) {
+ fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, t, t->tObj );
+ }
+
+ if (t->memBlock) {
+ mmFreeMem( t->memBlock );
+ t->memBlock = NULL;
+ }
+
+ if (!t->tObj) {
+ remove_from_list( t );
+ FREE( t );
+ }
+ else {
+ for (face = 0; face < 6; face++)
+ t->dirty_images[face] = ~0;
+ move_to_tail( &rmesa->texture.swapped, t );
+ }
+}
+
+/* Print out debugging information about texture LRU.
+ */
+void r200PrintLocalLRU( r200ContextPtr rmesa, int heap )
+{
+ r200TexObjPtr t;
+ int sz = 1 << (rmesa->r200Screen->logTexGranularity[heap]);
+
+ fprintf( stderr, "\nLocal LRU, heap %d:\n", heap );
+
+ foreach ( t, &rmesa->texture.objects[heap] ) {
+ if (!t->memBlock)
+ continue;
+ if (!t->tObj) {
+ fprintf( stderr, "Placeholder %d at 0x%x sz 0x%x\n",
+ t->memBlock->ofs / sz,
+ t->memBlock->ofs,
+ t->memBlock->size );
+ } else {
+ fprintf( stderr, "Texture at 0x%x sz 0x%x\n",
+ t->memBlock->ofs,
+ t->memBlock->size );
+ }
+ }
+
+ fprintf( stderr, "\n" );
+}
+
+void r200PrintGlobalLRU( r200ContextPtr rmesa, int heap )
+{
+ radeon_tex_region_t *list = rmesa->sarea->texList[heap];
+ int i, j;
+
+ fprintf( stderr, "\nGlobal LRU, heap %d list %p:\n", heap, list );
+
+ for ( i = 0, j = RADEON_NR_TEX_REGIONS ; i < RADEON_NR_TEX_REGIONS ; i++ ) {
+ fprintf( stderr, "list[%d] age %d next %d prev %d\n",
+ j, list[j].age, list[j].next, list[j].prev );
+ j = list[j].next;
+ if ( j == RADEON_NR_TEX_REGIONS ) break;
+ }
+
+ if ( j != RADEON_NR_TEX_REGIONS ) {
+ fprintf( stderr, "Loop detected in global LRU\n" );
+ for ( i = 0 ; i < RADEON_NR_TEX_REGIONS ; i++ ) {
+ fprintf( stderr, "list[%d] age %d next %d prev %d\n",
+ i, list[i].age, list[i].next, list[i].prev );
+ }
+ }
+
+ fprintf( stderr, "\n" );
+}
+
+/* Reset the global texture LRU.
+ */
+static void r200ResetGlobalLRU( r200ContextPtr rmesa, int heap )
+{
+ radeon_tex_region_t *list = rmesa->sarea->texList[heap];
+ int sz = 1 << rmesa->r200Screen->logTexGranularity[heap];
+ int i;
+
+ /*
+ * (Re)initialize the global circular LRU list. The last element in
+ * the array (RADEON_NR_TEX_REGIONS) is the sentinal. Keeping it at
+ * the end of the array allows it to be addressed rationally when
+ * looking up objects at a particular location in texture memory.
+ */
+ for ( i = 0 ; (i+1) * sz <= rmesa->r200Screen->texSize[heap] ; i++ ) {
+ list[i].prev = i-1;
+ list[i].next = i+1;
+ list[i].age = 0;
+ }
+
+ i--;
+ list[0].prev = RADEON_NR_TEX_REGIONS;
+ list[i].prev = i-1;
+ list[i].next = RADEON_NR_TEX_REGIONS;
+ list[RADEON_NR_TEX_REGIONS].prev = i;
+ list[RADEON_NR_TEX_REGIONS].next = 0;
+ rmesa->sarea->texAge[heap] = 0;
+}
+
+/* Update the local and glock texture LRUs.
+ */
+void r200UpdateTexLRU(r200ContextPtr rmesa, r200TexObjPtr t )
+{
+ int heap = t->heap;
+ radeon_tex_region_t *list = rmesa->sarea->texList[heap];
+ int sz = rmesa->r200Screen->logTexGranularity[heap];
+ int i, start, end;
+
+ rmesa->texture.age[heap] = ++rmesa->sarea->texAge[heap];
+
+ if ( !t->memBlock )
+ return;
+
+ start = t->memBlock->ofs >> sz;
+ end = (t->memBlock->ofs + t->memBlock->size-1) >> sz;
+
+ /* Update our local LRU */
+ move_to_head( &rmesa->texture.objects[heap], t );
+
+ /* Update the global LRU */
+ for ( i = start ; i <= end ; i++ ) {
+ list[i].in_use = 1;
+ list[i].age = rmesa->texture.age[heap];
+
+ /* remove_from_list(i) */
+ list[(CARD32)list[i].next].prev = list[i].prev;
+ list[(CARD32)list[i].prev].next = list[i].next;
+
+ /* insert_at_head(list, i) */
+ list[i].prev = RADEON_NR_TEX_REGIONS;
+ list[i].next = list[RADEON_NR_TEX_REGIONS].next;
+ list[(CARD32)list[RADEON_NR_TEX_REGIONS].next].prev = i;
+ list[RADEON_NR_TEX_REGIONS].next = i;
+ }
+
+ if ( 0 ) {
+ r200PrintGlobalLRU( rmesa, t->heap );
+ r200PrintLocalLRU( rmesa, t->heap );
+ }
+}
+
+/* Update our notion of what textures have been changed since we last
+ * held the lock. This pertains to both our local textures and the
+ * textures belonging to other clients. Keep track of other client's
+ * textures by pushing a placeholder texture onto the LRU list -- these
+ * are denoted by (tObj == NULL).
+ */
+static void r200TexturesGone( r200ContextPtr rmesa, int heap,
+ int offset, int size, int in_use )
+{
+ r200TexObjPtr t, tmp;
+
+ foreach_s ( t, tmp, &rmesa->texture.objects[heap] ) {
+ if ( !t->memBlock ||
+ t->memBlock->ofs >= offset + size ||
+ t->memBlock->ofs + t->memBlock->size <= offset )
+ continue;
+
+ /* It overlaps - kick it out. Need to hold onto the currently
+ * bound objects, however.
+ */
+ r200SwapOutTexObj( rmesa, t );
+ }
+
+ if ( in_use ) {
+ t = (r200TexObjPtr) CALLOC( sizeof(*t) );
+ if ( !t ) return;
+
+ t->memBlock = mmAllocMem( rmesa->texture.heap[heap], size, 0, offset );
+ if ( !t->memBlock ) {
+ fprintf( stderr, "Couldn't alloc placeholder sz %x ofs %x\n",
+ (int)size, (int)offset );
+ mmDumpMemInfo( rmesa->texture.heap[heap] );
+ return;
+ }
+ insert_at_head( &rmesa->texture.objects[heap], t );
+ }
+}
+
+/* Update our client's shared texture state. If another client has
+ * modified a region in which we have textures, then we need to figure
+ * out which of our textures has been removed, and update our global
+ * LRU.
+ */
+void r200AgeTextures( r200ContextPtr rmesa, int heap )
+{
+ RADEONSAREAPrivPtr sarea = rmesa->sarea;
+
+ fprintf(stderr, "%s %d\n", __FUNCTION__, heap);
+
+ if ( sarea->texAge[heap] != rmesa->texture.age[heap] ) {
+ int sz = 1 << rmesa->r200Screen->logTexGranularity[heap];
+ int nr = 0;
+ int idx;
+
+ for ( idx = sarea->texList[heap][RADEON_NR_TEX_REGIONS].prev ;
+ idx != RADEON_NR_TEX_REGIONS && nr < RADEON_NR_TEX_REGIONS ;
+ idx = sarea->texList[heap][idx].prev, nr++ )
+ {
+ /* If switching texturing schemes, then the SAREA might not
+ * have been properly cleared, so we need to reset the
+ * global texture LRU.
+ */
+ if ( idx * sz > rmesa->r200Screen->texSize[heap] ) {
+ nr = RADEON_NR_TEX_REGIONS;
+ break;
+ }
+
+ if ( sarea->texList[heap][idx].age > rmesa->texture.age[heap] ) {
+ r200TexturesGone( rmesa, heap, idx * sz, sz,
+ sarea->texList[heap][idx].in_use );
+ }
+ }
+
+ if ( nr == RADEON_NR_TEX_REGIONS ) {
+ r200TexturesGone( rmesa, heap, 0,
+ rmesa->r200Screen->texSize[heap], 0 );
+ r200ResetGlobalLRU( rmesa, heap );
+ }
+
+ rmesa->texture.age[heap] = sarea->texAge[heap];
+ }
+}
+
+
+/* ------------------------------------------------------------
+ * Texture image conversions
+ */
+
+
+static void r200UploadAGPClientSubImage( r200ContextPtr rmesa,
+ r200TexObjPtr t,
+ struct gl_texture_image *texImage,
+ GLint hwlevel,
+ GLint x, GLint y,
+ GLint width, GLint height )
+{
+ const struct gl_texture_format *texFormat = texImage->TexFormat;
+ GLuint srcPitch, dstPitch;
+ int blit_format;
+ int srcOffset;
+
+ /*
+ * XXX it appears that we always upload the full image, not a subimage.
+ * I.e. x==0, y==0, width=texWidth, height=texWidth. If this is ever
+ * changed, the src pitch will have to change.
+ */
+ switch ( texFormat->TexelBytes ) {
+ case 1:
+ blit_format = R200_CP_COLOR_FORMAT_CI8;
+ srcPitch = t->image[0][0].width * texFormat->TexelBytes;
+ dstPitch = t->image[0][0].width * texFormat->TexelBytes;
+ break;
+ case 2:
+ blit_format = R200_CP_COLOR_FORMAT_RGB565;
+ srcPitch = t->image[0][0].width * texFormat->TexelBytes;
+ dstPitch = t->image[0][0].width * texFormat->TexelBytes;
+ break;
+ case 4:
+ blit_format = R200_CP_COLOR_FORMAT_ARGB8888;
+ srcPitch = t->image[0][0].width * texFormat->TexelBytes;
+ dstPitch = t->image[0][0].width * texFormat->TexelBytes;
+ break;
+ default:
+ return;
+ }
+
+ t->image[0][hwlevel].data = texImage->Data;
+ srcOffset = r200AgpOffsetFromVirtual( rmesa, texImage->Data );
+
+ assert( srcOffset != ~0 );
+
+ /* Don't currently need to cope with small pitches?
+ */
+ width = texImage->Width;
+ height = texImage->Height;
+
+ r200EmitWait( rmesa, RADEON_WAIT_3D );
+
+ r200EmitBlit( rmesa, blit_format,
+ srcPitch,
+ srcOffset,
+ dstPitch,
+ t->bufAddr,
+ x,
+ y,
+ t->image[0][hwlevel].x + x,
+ t->image[0][hwlevel].y + y,
+ width,
+ height );
+
+ r200EmitWait( rmesa, RADEON_WAIT_2D );
+}
+
+static void r200UploadRectSubImage( r200ContextPtr rmesa,
+ r200TexObjPtr t,
+ struct gl_texture_image *texImage,
+ GLint x, GLint y,
+ GLint width, GLint height )
+{
+ const struct gl_texture_format *texFormat = texImage->TexFormat;
+ int blit_format, dstPitch, done;
+
+ switch ( texFormat->TexelBytes ) {
+ case 1:
+ blit_format = R200_CP_COLOR_FORMAT_CI8;
+ break;
+ case 2:
+ blit_format = R200_CP_COLOR_FORMAT_RGB565;
+ break;
+ case 4:
+ blit_format = R200_CP_COLOR_FORMAT_ARGB8888;
+ break;
+ default:
+ return;
+ }
+
+ t->image[0][0].data = texImage->Data;
+
+ /* Currently don't need to cope with small pitches.
+ */
+ width = texImage->Width;
+ height = texImage->Height;
+ dstPitch = t->pp_txpitch + 32;
+
+ if (rmesa->prefer_agp_client_texturing && texImage->IsClientData) {
+ /* In this case, could also use agp texturing. This is
+ * currently disabled, but has been tested & works.
+ */
+ t->pp_txoffset = r200AgpOffsetFromVirtual( rmesa, texImage->Data );
+ t->pp_txpitch = texImage->RowStride * texFormat->TexelBytes - 32;
+
+ if (R200_DEBUG & DEBUG_TEXTURE)
+ fprintf(stderr,
+ "Using agp texturing for rectangular client texture\n");
+
+ /* Release FB memory allocated for this image:
+ */
+ if ( t->memBlock ) {
+ mmFreeMem( t->memBlock );
+ t->memBlock = NULL;
+ }
+
+ }
+ else if (texImage->IsClientData) {
+ /* Data already in agp memory, with usable pitch.
+ */
+ GLuint srcPitch;
+ srcPitch = texImage->RowStride * texFormat->TexelBytes;
+ r200EmitBlit( rmesa,
+ blit_format,
+ srcPitch,
+ r200AgpOffsetFromVirtual( rmesa, texImage->Data ),
+ dstPitch, t->bufAddr,
+ 0, 0,
+ 0, 0,
+ width, height );
+ }
+ else {
+ /* Data not in agp memory, or bad pitch.
+ */
+ for (done = 0; done < height ; ) {
+ struct r200_dma_region region;
+ int lines = MIN2( height - done, RADEON_BUFFER_SIZE / dstPitch );
+ int src_pitch;
+ char *tex;
+
+ src_pitch = texImage->RowStride * texFormat->TexelBytes;
+
+ tex = (char *)texImage->Data + done * src_pitch;
+
+ memset(&region, 0, sizeof(region));
+ r200AllocDmaRegion( rmesa, &region, lines * dstPitch, 64 );
+
+ /* Copy texdata to dma:
+ */
+ if (0)
+ fprintf(stderr, "%s: src_pitch %d dst_pitch %d\n",
+ __FUNCTION__, src_pitch, dstPitch);
+
+ if (src_pitch == dstPitch) {
+ memcpy( region.address, tex, lines * src_pitch );
+ }
+ else {
+ char *buf = region.address;
+ int i;
+ for (i = 0 ; i < lines ; i++) {
+ memcpy( buf, tex, src_pitch );
+ buf += dstPitch;
+ tex += src_pitch;
+ }
+ }
+
+ r200EmitWait( rmesa, RADEON_WAIT_3D );
+
+ /* Blit to framebuffer
+ */
+ r200EmitBlit( rmesa,
+ blit_format,
+ dstPitch, GET_START( &region ),
+ dstPitch, t->bufAddr,
+ 0, 0,
+ 0, done,
+ width, lines );
+
+ r200EmitWait( rmesa, RADEON_WAIT_2D );
+
+ r200ReleaseDmaRegion( rmesa, &region, __FUNCTION__ );
+ done += lines;
+ }
+ }
+}
+
+
+/* Upload the texture image associated with texture `t' at level `level'
+ * at the address relative to `start'.
+ */
+static void r200UploadSubImage( r200ContextPtr rmesa,
+ r200TexObjPtr t,
+ GLint hwlevel,
+ GLint x, GLint y, GLint width, GLint height,
+ GLuint face )
+{
+ struct gl_texture_image *texImage = NULL;
+ const struct gl_texture_format *texFormat;
+ GLint texelsPerDword = 0;
+ GLuint format, pitch, offset;
+ GLint imageWidth, imageHeight;
+ GLint ret;
+ drmRadeonTexture tex;
+ drmRadeonTexImage tmp;
+ int level = hwlevel + t->firstLevel;
+
+ if ( R200_DEBUG & DEBUG_TEXTURE ) {
+ fprintf( stderr, "%s level %d %dx%d\n", __FUNCTION__,
+ level, width, height);
+ }
+
+ ASSERT(face < 6);
+
+ /* Ensure we have a valid texture to upload */
+ if ( ( hwlevel < 0 ) || ( hwlevel >= RADEON_MAX_TEXTURE_LEVELS ) ) {
+ _mesa_problem(NULL, "bad texture level in r200UploadSubimage");
+ return;
+ }
+
+ switch (face) {
+ case 0:
+ texImage = t->tObj->Image[level];
+ break;
+ case 1:
+ texImage = t->tObj->NegX[level];
+ break;
+ case 2:
+ texImage = t->tObj->PosY[level];
+ break;
+ case 3:
+ texImage = t->tObj->NegY[level];
+ break;
+ case 4:
+ texImage = t->tObj->PosZ[level];
+ break;
+ case 5:
+ texImage = t->tObj->NegZ[level];
+ break;
+ }
+
+ if ( !texImage ) {
+ if ( R200_DEBUG & DEBUG_TEXTURE )
+ fprintf( stderr, "%s: texImage %d is NULL!\n", __FUNCTION__, level );
+ return;
+ }
+ if ( !texImage->Data ) {
+ if ( R200_DEBUG & DEBUG_TEXTURE )
+ fprintf( stderr, "%s: image data is NULL!\n", __FUNCTION__ );
+ return;
+ }
+
+
+ if (t->tObj->Target == GL_TEXTURE_RECTANGLE_NV) {
+ assert(level == 0);
+ assert(hwlevel == 0);
+ if ( R200_DEBUG & DEBUG_TEXTURE )
+ fprintf( stderr, "%s: image data is rectangular\n", __FUNCTION__);
+ r200UploadRectSubImage( rmesa, t, texImage, x, y, width, height );
+ return;
+ }
+ else if (texImage->IsClientData) {
+ if ( R200_DEBUG & DEBUG_TEXTURE )
+ fprintf( stderr, "%s: image data is in agp client storage\n",
+ __FUNCTION__);
+ r200UploadAGPClientSubImage( rmesa, t, texImage, hwlevel,
+ x, y, width, height );
+ return;
+ }
+ else if ( R200_DEBUG & DEBUG_TEXTURE )
+ fprintf( stderr, "%s: image data is in normal memory\n",
+ __FUNCTION__);
+
+
+ texFormat = texImage->TexFormat;
+
+ switch ( texFormat->TexelBytes ) {
+ case 1:
+ texelsPerDword = 4;
+ break;
+ case 2:
+ texelsPerDword = 2;
+ break;
+ case 4:
+ texelsPerDword = 1;
+ break;
+ }
+
+ format = t->pp_txformat & R200_TXFORMAT_FORMAT_MASK;
+
+ imageWidth = texImage->Width;
+ imageHeight = texImage->Height;
+
+ offset = t->bufAddr;
+
+ if (texFormat->TexelBytes == 0)
+ pitch = (t->image[face][0].width * 1) / 64;
+ else
+ pitch = (t->image[face][0].width * texFormat->TexelBytes) / 64;
+
+
+ if ( R200_DEBUG & (DEBUG_TEXTURE|DEBUG_IOCTL) )
+ {
+ GLint imageX = 0;
+ GLint imageY = 0;
+ GLint blitX = t->image[face][hwlevel].x;
+ GLint blitY = t->image[face][hwlevel].y;
+ GLint blitWidth = t->image[face][hwlevel].width;
+ GLint blitHeight = t->image[face][hwlevel].height;
+ fprintf( stderr, " upload image: %d,%d at %d,%d\n",
+ imageWidth, imageHeight, imageX, imageY );
+ fprintf( stderr, " upload blit: %d,%d at %d,%d\n",
+ blitWidth, blitHeight, blitX, blitY );
+ fprintf( stderr, " blit ofs: 0x%07x pitch: 0x%x "
+ "level: %d/%d format: %x\n",
+ (GLuint)offset, (GLuint)pitch, hwlevel, level, format );
+ }
+
+ t->image[face][hwlevel].data = texImage->Data;
+
+ /* Init the DRM_RADEON_TEXTURE command / drmRadeonTexture struct.
+ * NOTE: we're always use a 1KB-wide blit and I8 texture format.
+ * We used to use 1, 2 and 4-byte texels and used to use the texture
+ * width to dictate the blit width - but that won't work for compressed
+ * textures. (Brian)
+ */
+ tex.offset = offset;
+ tex.pitch = BLIT_WIDTH_BYTES / 64;
+ tex.format = R200_TXFORMAT_I8; /* any 1-byte texel format */
+ if (texImage->TexFormat->TexelBytes) {
+ tex.width = imageWidth * texImage->TexFormat->TexelBytes; /* in bytes */
+ tex.height = imageHeight;
+ }
+ else {
+ tex.width = imageWidth; /* compressed */
+ tex.height = imageHeight;
+ if (tex.height < 4)
+ tex.height = 4;
+ }
+ tex.image = &tmp;
+
+ /* copy (x,y,width,height,data) */
+ memcpy( &tmp, &t->image[face][hwlevel], sizeof(drmRadeonTexImage) );
+
+ LOCK_HARDWARE( rmesa );
+ do {
+ ret = drmCommandWriteRead( rmesa->dri.fd, DRM_RADEON_TEXTURE,
+ &tex, sizeof(drmRadeonTexture) );
+ if (ret) {
+ if (R200_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "DRM_RADEON_TEXTURE: again!\n");
+ usleep(1);
+ }
+ } while ( ret && errno == EAGAIN );
+
+ UNLOCK_HARDWARE( rmesa );
+
+ if ( ret ) {
+ fprintf( stderr, "DRM_R200_TEXTURE: return = %d\n", ret );
+ fprintf( stderr, " offset=0x%08x pitch=0x%x format=%d\n",
+ offset, pitch, format );
+ fprintf( stderr, " image width=%d height=%d\n",
+ imageWidth, imageHeight );
+ fprintf( stderr, " blit width=%d height=%d data=%p\n",
+ t->image[face][hwlevel].width, t->image[face][hwlevel].height,
+ t->image[face][hwlevel].data );
+ exit( 1 );
+ }
+}
+
+
+
+/* Upload the texture images associated with texture `t'. This might
+ * require removing our own and/or other client's texture objects to
+ * make room for these images.
+ */
+int r200UploadTexImages( r200ContextPtr rmesa, r200TexObjPtr t, GLuint face )
+{
+ const int numLevels = t->lastLevel - t->firstLevel + 1;
+ int heap;
+ r200TexObjPtr t0 = rmesa->state.texture.unit[0].texobj;
+ r200TexObjPtr t1 = rmesa->state.texture.unit[1].texobj;
+
+ if ( R200_DEBUG & (DEBUG_TEXTURE|DEBUG_IOCTL) ) {
+ fprintf( stderr, "%s( %p, %p ) sz=%d lvls=%d-%d\n", __FUNCTION__,
+ rmesa->glCtx, t->tObj, t->totalSize,
+ t->firstLevel, t->lastLevel );
+ }
+
+ if ( !t || t->totalSize == 0 )
+ return 0;
+
+ if (R200_DEBUG & DEBUG_SYNC) {
+ fprintf(stderr, "\nSyncing\n\n");
+ R200_FIREVERTICES( rmesa );
+ r200Finish( rmesa->glCtx );
+ }
+
+ LOCK_HARDWARE( rmesa );
+
+ /* Choose the heap appropriately */
+ heap = t->heap = RADEON_CARD_HEAP;
+
+ /* Do we need to eject LRU texture objects? */
+ if ( !t->memBlock ) {
+ /* Allocate a memory block on a 1k boundary (1<<10 == 1024) */
+ t->memBlock = mmAllocMem( rmesa->texture.heap[heap],
+ t->totalSize, 10, 0 );
+
+
+ /* Kick out textures until the requested texture fits */
+ while ( !t->memBlock ) {
+ if ( rmesa->texture.objects[heap].prev == t0 ||
+ rmesa->texture.objects[heap].prev == t1 ) {
+ fprintf( stderr,
+ "r200UploadTexImages: ran into bound texture\n" );
+ UNLOCK_HARDWARE( rmesa );
+ return -1;
+ }
+ if ( rmesa->texture.objects[heap].prev ==
+ &rmesa->texture.objects[heap] ) {
+ if ( rmesa->r200Screen->IsPCI ) {
+ fprintf( stderr, "r200UploadTexImages: upload texture "
+ "failure on local texture heaps, sz=%d\n",
+ t->totalSize );
+ UNLOCK_HARDWARE( rmesa );
+ return -1;
+ } else {
+ fprintf( stderr, "r200UploadTexImages: upload texture "
+ "failure on both local and AGP texture heaps, "
+ "sz=%d\n",
+ t->totalSize );
+ UNLOCK_HARDWARE( rmesa );
+ return -1;
+ }
+ }
+
+ r200SwapOutTexObj( rmesa, rmesa->texture.objects[heap].prev );
+
+ t->memBlock = mmAllocMem( rmesa->texture.heap[heap],
+ t->totalSize, 12, 0 );
+ }
+
+ /* Set the base offset of the texture image */
+ t->bufAddr = rmesa->r200Screen->texOffset[heap] + t->memBlock->ofs;
+ t->pp_txoffset = t->bufAddr;
+
+ /* Mark this texobj as dirty on all units:
+ */
+ t->dirty_state = TEX_ALL;
+ }
+
+ /* Let the world know we've used this memory recently */
+ r200UpdateTexLRU( rmesa, t );
+ UNLOCK_HARDWARE( rmesa );
+
+ /* Upload any images that are new */
+ if (t->dirty_images[face]) {
+ int hwlevel;
+ for ( hwlevel = 0 ; hwlevel < numLevels ; hwlevel++ ) {
+ if ( t->dirty_images[face] & (1 << (hwlevel+t->firstLevel)) ) {
+ r200UploadSubImage( rmesa, t, hwlevel,
+ 0, 0,
+ t->image[face][hwlevel].width,
+ t->image[face][hwlevel].height, face );
+ }
+ }
+ t->dirty_images[face] = 0;
+ }
+
+
+ if (R200_DEBUG & DEBUG_SYNC) {
+ fprintf(stderr, "\nSyncing\n\n");
+ r200Finish( rmesa->glCtx );
+ }
+
+ return 0;
+}
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_texstate.c b/xc/lib/GL/mesa/src/drv/r200/r200_texstate.c
new file mode 100644
index 000000000..95daf1fda
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_texstate.c
@@ -0,0 +1,1799 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "context.h"
+#include "macros.h"
+#include "mmath.h"
+#include "texformat.h"
+#include "enums.h"
+
+#include "r200_context.h"
+#include "r200_state.h"
+#include "r200_ioctl.h"
+#include "r200_swtcl.h"
+#include "r200_tex.h"
+#include "r200_tcl.h"
+
+
+/**
+ * This function computes the number of bytes of storage needed for
+ * the given texture object (all mipmap levels, all cube faces).
+ * The \c image[face][level].x/y/width/height parameters for upload/blitting
+ * are computed here. \c pp_txfilter, \c pp_txformat, etc. will be set here
+ * too.
+ *
+ * \param rmesa Context pointer
+ * \param tObj GL texture object whose images are to be posted to
+ * hardware state.
+ */
+static void r200SetTexImages( r200ContextPtr rmesa,
+ struct gl_texture_object *tObj )
+{
+ r200TexObjPtr t = (r200TexObjPtr)tObj->DriverData;
+ const struct gl_texture_image *baseImage = tObj->Image[tObj->BaseLevel];
+ GLint curOffset;
+ GLint i;
+ GLint firstLevel=0, lastLevel=0, numLevels;
+ GLint log2Width, log2Height, log2Depth;
+ GLuint txformat = 0;
+
+ t->pp_txfilter &= ~R200_YUV_TO_RGB;
+
+ /* Set the hardware texture format
+ */
+ switch (baseImage->TexFormat->MesaFormat) {
+ case MESA_FORMAT_I8:
+ txformat = R200_TXFORMAT_I8;
+ break;
+ case MESA_FORMAT_AL88:
+ txformat = R200_TXFORMAT_AI88;
+ break;
+ case MESA_FORMAT_RGBA8888:
+ txformat = R200_TXFORMAT_RGBA8888;
+ break;
+ case MESA_FORMAT_ARGB8888:
+ txformat = R200_TXFORMAT_ARGB8888;
+ break;
+ case MESA_FORMAT_RGB565:
+ txformat = R200_TXFORMAT_RGB565;
+ break;
+ case MESA_FORMAT_ARGB1555:
+ txformat = R200_TXFORMAT_ARGB1555;
+ break;
+ case MESA_FORMAT_ARGB4444:
+ txformat = R200_TXFORMAT_ARGB4444;
+ break;
+ case MESA_FORMAT_YCBCR:
+ txformat = R200_TXFORMAT_YVYU422;
+ t->pp_txfilter |= R200_YUV_TO_RGB;
+ break;
+ case MESA_FORMAT_YCBCR_REV:
+ txformat = R200_TXFORMAT_VYUY422;
+ t->pp_txfilter |= R200_YUV_TO_RGB;
+ break;
+ default:
+ _mesa_problem(NULL, "unexpected texture format in %s" __FUNCTION__);
+ return;
+ }
+
+ t->pp_txformat &= ~(R200_TXFORMAT_FORMAT_MASK |
+ R200_TXFORMAT_ALPHA_IN_MAP);
+ t->pp_txformat |= txformat;
+
+ if ( txformat == R200_TXFORMAT_RGBA8888 ||
+ txformat == R200_TXFORMAT_ARGB8888 ||
+ txformat == R200_TXFORMAT_ARGB4444 ||
+ txformat == R200_TXFORMAT_ARGB1555 ||
+ txformat == R200_TXFORMAT_AI88) {
+ t->pp_txformat |= R200_TXFORMAT_ALPHA_IN_MAP;
+ }
+
+ /* Compute which mipmap levels we really want to send to the hardware.
+ * This depends on the base image size, GL_TEXTURE_MIN_LOD,
+ * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL.
+ * Yes, this looks overly complicated, but it's all needed.
+ */
+ if (R200_DEBUG & DEBUG_TEXTURE)
+ fprintf(stderr,
+ "%s: BaseLevel %d MinLod %f MaxLod %f MaxLevel %d\n",
+ __FUNCTION__,
+ tObj->BaseLevel, tObj->MinLod, tObj->MaxLod,
+ tObj->MaxLevel);
+
+
+ switch (tObj->Target) {
+ case GL_TEXTURE_1D:
+ case GL_TEXTURE_2D:
+ case GL_TEXTURE_CUBE_MAP:
+ 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 */
+ log2Width = tObj->Image[firstLevel]->WidthLog2;
+ log2Height = tObj->Image[firstLevel]->HeightLog2;
+ log2Depth = 0;
+ break;
+ case GL_TEXTURE_3D:
+ firstLevel = tObj->BaseLevel;
+ lastLevel = tObj->BaseLevel;
+ log2Width = tObj->Image[firstLevel]->WidthLog2;
+ log2Height = tObj->Image[firstLevel]->HeightLog2;
+ log2Depth = tObj->Image[firstLevel]->DepthLog2;
+ break;
+ case GL_TEXTURE_RECTANGLE_NV:
+ firstLevel = lastLevel = 0;
+ log2Width = log2Height = 1; /* ? */
+ log2Depth = 0;
+ break;
+ default:
+ return;
+ }
+
+ /* save these values */
+ t->firstLevel = firstLevel;
+ t->lastLevel = lastLevel;
+
+ numLevels = lastLevel - firstLevel + 1;
+
+ if (R200_DEBUG & DEBUG_TEXTURE)
+ fprintf(stderr,
+ "%s: firstLevel %d last Level %d w,h: %d,%d log(w,h) %d,%d\n",
+ __FUNCTION__, firstLevel, lastLevel,
+ tObj->Image[firstLevel]->Width,
+ tObj->Image[firstLevel]->Height,
+ tObj->Image[firstLevel]->WidthLog2,
+ tObj->Image[firstLevel]->HeightLog2);
+
+
+ assert(numLevels <= RADEON_MAX_TEXTURE_LEVELS);
+
+ /* Calculate mipmap offsets and dimensions for blitting (uploading)
+ * The idea is that we lay out the mipmap levels within a block of
+ * memory organized as a rectangle of width BLIT_WIDTH_BYTES.
+ */
+ curOffset = 0;
+
+ for (i = 0; i < numLevels; i++) {
+ const struct gl_texture_image *texImage;
+ GLuint size;
+
+ texImage = tObj->Image[i + firstLevel];
+ if ( !texImage )
+ break;
+
+ /* find image size in bytes */
+ if (texImage->IsCompressed) {
+ size = texImage->CompressedSize;
+ }
+ else if (tObj->Target == GL_TEXTURE_RECTANGLE_NV) {
+ size = ((texImage->Width * texImage->TexFormat->TexelBytes + 63)
+ & ~63) * texImage->Height;
+ }
+ else {
+ int w = texImage->Width * texImage->TexFormat->TexelBytes;
+ if (w < 32)
+ w = 32;
+ size = w * texImage->Height * texImage->Depth;
+ }
+ assert(size > 0);
+
+ if (curOffset & 0x1f) {
+ /* align to 32-byte offset */
+ curOffset = (curOffset + 0x1f) & ~0x1f;
+ }
+
+ t->image[0][i].x = curOffset % BLIT_WIDTH_BYTES;
+ t->image[0][i].y = curOffset / BLIT_WIDTH_BYTES;
+ t->image[0][i].width = MIN2(size, BLIT_WIDTH_BYTES);
+ t->image[0][i].height = size / t->image[0][i].width;
+
+#if 0
+ /* for debugging only and only applicable to non-rectangle targets */
+ assert(size % t->image[0][i].width == 0);
+ assert(t->image[0][i].x == 0
+ || (size < BLIT_WIDTH_BYTES && t->image[0][i].height == 1));
+#endif
+ curOffset += size;
+
+ if (0)
+ fprintf(stderr,
+ "level %d: %dx%d x=%d y=%d w=%d h=%d size=%d at %d\n",
+ i, texImage->Width, texImage->Height,
+ t->image[0][i].x, t->image[0][i].y,
+ t->image[0][i].width, t->image[0][i].height, size, curOffset);
+ }
+
+ /* Align the total size of texture memory block.
+ */
+ t->totalSize = (curOffset + RADEON_OFFSET_MASK) & ~RADEON_OFFSET_MASK;
+
+ /* Setup remaining cube face blits, if needed */
+ if (tObj->Target == GL_TEXTURE_CUBE_MAP) {
+ /* Round totalSize up to multiple of BLIT_WIDTH_BYTES */
+ const GLuint faceSize = (t->totalSize + BLIT_WIDTH_BYTES - 1)
+ & ~(BLIT_WIDTH_BYTES-1);
+ const GLuint lines = faceSize / BLIT_WIDTH_BYTES;
+ GLuint face;
+ /* reuse face 0 x/y/width/height - just adjust y */
+ for (face = 1; face < 6; face++) {
+ for (i = 0; i < numLevels; i++) {
+ t->image[face][i].x = t->image[0][i].x;
+ t->image[face][i].y = t->image[0][i].y + face * lines;
+ t->image[face][i].width = t->image[0][i].width;
+ t->image[face][i].height = t->image[0][i].height;
+ }
+ }
+ t->totalSize = 6 * faceSize; /* total texmem needed */
+ }
+
+
+ /* Hardware state:
+ */
+ t->pp_txfilter &= ~R200_MAX_MIP_LEVEL_MASK;
+ t->pp_txfilter |= (numLevels - 1) << R200_MAX_MIP_LEVEL_SHIFT;
+
+ t->pp_txformat &= ~(R200_TXFORMAT_WIDTH_MASK |
+ R200_TXFORMAT_HEIGHT_MASK |
+ R200_TXFORMAT_CUBIC_MAP_ENABLE |
+ R200_TXFORMAT_F5_WIDTH_MASK |
+ R200_TXFORMAT_F5_HEIGHT_MASK);
+ t->pp_txformat |= ((log2Width << R200_TXFORMAT_WIDTH_SHIFT) |
+ (log2Height << R200_TXFORMAT_HEIGHT_SHIFT));
+
+ t->pp_txformat_x &= ~(R200_DEPTH_LOG2_MASK | R200_TEXCOORD_MASK);
+ if (tObj->Target == GL_TEXTURE_3D) {
+ t->pp_txformat_x |= (log2Depth << R200_DEPTH_LOG2_SHIFT);
+ t->pp_txformat_x |= R200_TEXCOORD_VOLUME;
+ }
+ else if (tObj->Target == GL_TEXTURE_CUBE_MAP) {
+ ASSERT(log2Width == log2height);
+ t->pp_txformat |= ((log2Width << R200_TXFORMAT_F5_WIDTH_SHIFT) |
+ (log2Height << R200_TXFORMAT_F5_HEIGHT_SHIFT) |
+ (R200_TXFORMAT_CUBIC_MAP_ENABLE));
+ t->pp_txformat_x |= R200_TEXCOORD_CUBIC_ENV;
+ t->pp_cubic_faces = ((log2Width << R200_FACE_WIDTH_1_SHIFT) |
+ (log2Height << R200_FACE_HEIGHT_1_SHIFT) |
+ (log2Width << R200_FACE_WIDTH_2_SHIFT) |
+ (log2Height << R200_FACE_HEIGHT_2_SHIFT) |
+ (log2Width << R200_FACE_WIDTH_3_SHIFT) |
+ (log2Height << R200_FACE_HEIGHT_3_SHIFT) |
+ (log2Width << R200_FACE_WIDTH_4_SHIFT) |
+ (log2Height << R200_FACE_HEIGHT_4_SHIFT));
+ }
+
+ t->pp_txsize = (((tObj->Image[firstLevel]->Width - 1) << 0) |
+ ((tObj->Image[firstLevel]->Height - 1) << 16));
+
+ /* Only need to round to nearest 32 for textures, but the blitter
+ * requires 64-byte aligned pitches, and we may/may not need the
+ * blitter. NPOT only!
+ */
+ if (baseImage->IsCompressed)
+ t->pp_txpitch = (tObj->Image[firstLevel]->Width + 63) & ~(63);
+ else
+ t->pp_txpitch = ((tObj->Image[firstLevel]->Width * baseImage->TexFormat->TexelBytes) + 63) & ~(63);
+ t->pp_txpitch -= 32;
+
+ t->dirty_state = TEX_ALL;
+
+ /* FYI: r200UploadTexImages( rmesa, t ) used to be called here */
+}
+
+
+
+/* ================================================================
+ * Texture combine functions
+ */
+
+#define R200_DISABLE 0
+#define R200_REPLACE 1
+#define R200_MODULATE 2
+#define R200_DECAL 3
+#define R200_BLEND 4
+#define R200_ADD 5
+#define R200_MAX_COMBFUNC 6
+
+static GLuint r200_color_combine[][R200_MAX_COMBFUNC] =
+{
+ /* Unit 0:
+ */
+ {
+ /* Disable combiner stage
+ */
+ (R200_TXC_ARG_A_ZERO |
+ R200_TXC_ARG_B_ZERO |
+ R200_TXC_ARG_C_DIFFUSE_COLOR |
+ R200_TXC_OP_MADD),
+
+ /* GL_REPLACE = 0x00802800
+ */
+ (R200_TXC_ARG_A_ZERO |
+ R200_TXC_ARG_B_ZERO |
+ R200_TXC_ARG_C_R0_COLOR |
+ R200_TXC_OP_MADD),
+
+ /* GL_MODULATE = 0x00800142
+ */
+ (R200_TXC_ARG_A_DIFFUSE_COLOR | /* current starts in DIFFUSE */
+ R200_TXC_ARG_B_R0_COLOR |
+ R200_TXC_ARG_C_ZERO |
+ R200_TXC_OP_MADD),
+
+ /* GL_DECAL = 0x008c2d42
+ */
+ (R200_TXC_ARG_A_DIFFUSE_COLOR |
+ R200_TXC_ARG_B_R0_COLOR |
+ R200_TXC_ARG_C_R0_ALPHA |
+ R200_TXC_OP_LERP),
+
+ /* GL_BLEND = 0x008c2902
+ */
+ (R200_TXC_ARG_A_DIFFUSE_COLOR |
+ R200_TXC_ARG_B_TFACTOR_COLOR |
+ R200_TXC_ARG_C_R0_COLOR |
+ R200_TXC_OP_LERP),
+
+ /* GL_ADD = 0x00812802
+ */
+ (R200_TXC_ARG_A_DIFFUSE_COLOR |
+ R200_TXC_ARG_B_ZERO |
+ R200_TXC_ARG_C_R0_COLOR |
+ R200_TXC_COMP_ARG_B |
+ R200_TXC_OP_MADD),
+ },
+
+ /* Unit 1:
+ */
+ {
+ /* Disable combiner stage
+ */
+ (R200_TXC_ARG_A_ZERO |
+ R200_TXC_ARG_B_ZERO |
+ R200_TXC_ARG_C_R0_COLOR |
+ R200_TXC_OP_MADD),
+
+ /* GL_REPLACE = 0x00803000
+ */
+ (R200_TXC_ARG_A_ZERO |
+ R200_TXC_ARG_B_ZERO |
+ R200_TXC_ARG_C_R1_COLOR |
+ R200_TXC_OP_MADD),
+
+ /* GL_MODULATE = 0x00800182
+ */
+ (R200_TXC_ARG_A_R0_COLOR | /* current in R0 thereafter */
+ R200_TXC_ARG_B_R1_COLOR |
+ R200_TXC_ARG_C_ZERO |
+ R200_TXC_OP_MADD),
+
+ /* GL_DECAL = 0x008c3582
+ */
+ (R200_TXC_ARG_A_R0_COLOR |
+ R200_TXC_ARG_B_R1_COLOR |
+ R200_TXC_ARG_C_R1_ALPHA |
+ R200_TXC_OP_LERP),
+
+ /* GL_BLEND = 0x008c3102
+ */
+ (R200_TXC_ARG_A_R0_COLOR |
+ R200_TXC_ARG_B_TFACTOR_COLOR |
+ R200_TXC_ARG_C_R1_COLOR |
+ R200_TXC_OP_LERP),
+
+ /* GL_ADD = 0x00813002
+ */
+ (R200_TXC_ARG_A_R0_COLOR |
+ R200_TXC_ARG_B_ZERO |
+ R200_TXC_ARG_C_R1_COLOR |
+ R200_TXC_COMP_ARG_B |
+ R200_TXC_OP_MADD),
+ },
+
+ /* Unit 2:
+ */
+ {
+ /* Disable combiner stage
+ */
+ (R200_TXC_ARG_A_ZERO |
+ R200_TXC_ARG_B_ZERO |
+ R200_TXC_ARG_C_R0_COLOR |
+ R200_TXC_OP_MADD),
+
+ /* GL_REPLACE = 0x00803800
+ */
+ (R200_TXC_ARG_A_ZERO |
+ R200_TXC_ARG_B_ZERO |
+ R200_TXC_ARG_C_R2_COLOR |
+ R200_TXC_OP_MADD),
+
+ /* GL_MODULATE = 0x008001c2
+ */
+ (R200_TXC_ARG_A_R0_COLOR |
+ R200_TXC_ARG_B_R2_COLOR |
+ R200_TXC_ARG_C_ZERO |
+ R200_TXC_OP_MADD),
+
+ /* GL_DECAL = 0x008c3dc2
+ */
+ (R200_TXC_ARG_A_R0_COLOR |
+ R200_TXC_ARG_B_R2_COLOR |
+ R200_TXC_ARG_C_R2_ALPHA |
+ R200_TXC_OP_LERP),
+
+ /* GL_BLEND = 0x008c3902
+ */
+ (R200_TXC_ARG_A_R0_COLOR |
+ R200_TXC_ARG_B_TFACTOR_COLOR |
+ R200_TXC_ARG_C_R2_COLOR |
+ R200_TXC_OP_LERP),
+
+ /* GL_ADD = 0x00813802
+ */
+ (R200_TXC_ARG_A_R0_COLOR |
+ R200_TXC_ARG_B_ZERO |
+ R200_TXC_ARG_C_R2_COLOR |
+ R200_TXC_COMP_ARG_B |
+ R200_TXC_OP_MADD),
+ }
+};
+
+static GLuint r200_alpha_combine[][R200_MAX_COMBFUNC] =
+{
+ /* Unit 0:
+ */
+ {
+ /* Disable combiner stage
+ */
+ (R200_TXA_ARG_A_ZERO |
+ R200_TXA_ARG_B_ZERO |
+ R200_TXA_ARG_C_DIFFUSE_ALPHA |
+ R200_TXA_OP_MADD),
+
+
+ /* GL_REPLACE = 0x00800500
+ */
+ (R200_TXA_ARG_A_ZERO |
+ R200_TXA_ARG_B_ZERO |
+ R200_TXA_ARG_C_R0_ALPHA |
+ R200_TXA_OP_MADD),
+
+ /* GL_MODULATE = 0x00800051
+ */
+ (R200_TXA_ARG_A_DIFFUSE_ALPHA |
+ R200_TXA_ARG_B_R0_ALPHA |
+ R200_TXA_ARG_C_ZERO |
+ R200_TXA_OP_MADD),
+
+ /* GL_DECAL = 0x00800100
+ */
+ (R200_TXA_ARG_A_ZERO |
+ R200_TXA_ARG_B_ZERO |
+ R200_TXA_ARG_C_DIFFUSE_ALPHA |
+ R200_TXA_OP_MADD),
+
+ /* GL_BLEND = 0x00800051
+ */
+ (R200_TXA_ARG_A_DIFFUSE_ALPHA |
+ R200_TXA_ARG_B_TFACTOR_ALPHA |
+ R200_TXA_ARG_C_R0_ALPHA |
+ R200_TXA_OP_LERP),
+
+ /* GL_ADD = 0x00800051
+ */
+ (R200_TXA_ARG_A_DIFFUSE_ALPHA |
+ R200_TXA_ARG_B_ZERO |
+ R200_TXA_ARG_C_R0_ALPHA |
+ R200_TXA_COMP_ARG_B |
+ R200_TXA_OP_MADD),
+ },
+
+ /* Unit 1:
+ */
+ {
+ /* Disable combiner stage
+ */
+ (R200_TXA_ARG_A_ZERO |
+ R200_TXA_ARG_B_ZERO |
+ R200_TXA_ARG_C_R0_ALPHA |
+ R200_TXA_OP_MADD),
+
+ /* GL_REPLACE = 0x00800600
+ */
+ (R200_TXA_ARG_A_ZERO |
+ R200_TXA_ARG_B_ZERO |
+ R200_TXA_ARG_C_R1_ALPHA |
+ R200_TXA_OP_MADD),
+
+ /* GL_MODULATE = 0x00800061
+ */
+ (R200_TXA_ARG_A_R0_ALPHA |
+ R200_TXA_ARG_B_R1_ALPHA |
+ R200_TXA_ARG_C_ZERO |
+ R200_TXA_OP_MADD),
+
+ /* GL_DECAL = 0x00800100
+ */
+ (R200_TXA_ARG_A_ZERO |
+ R200_TXA_ARG_B_ZERO |
+ R200_TXA_ARG_C_R0_ALPHA |
+ R200_TXA_OP_MADD),
+
+ /* GL_BLEND = 0x00800061
+ */
+ (R200_TXA_ARG_A_R0_ALPHA |
+ R200_TXA_ARG_B_TFACTOR_ALPHA |
+ R200_TXA_ARG_C_R1_ALPHA |
+ R200_TXA_OP_LERP),
+
+ /* GL_ADD = 0x00800061
+ */
+ (R200_TXA_ARG_A_R0_ALPHA |
+ R200_TXA_ARG_B_ZERO |
+ R200_TXA_ARG_C_R1_ALPHA |
+ R200_TXA_COMP_ARG_B |
+ R200_TXA_OP_MADD),
+ },
+
+ /* Unit 2:
+ */
+ {
+ /* Disable combiner stage
+ */
+ (R200_TXA_ARG_A_ZERO |
+ R200_TXA_ARG_B_ZERO |
+ R200_TXA_ARG_C_R0_ALPHA |
+ R200_TXA_OP_MADD),
+
+ /* GL_REPLACE = 0x00800700
+ */
+ (R200_TXA_ARG_A_ZERO |
+ R200_TXA_ARG_B_ZERO |
+ R200_TXA_ARG_C_R2_ALPHA |
+ R200_TXA_OP_MADD),
+
+ /* GL_MODULATE = 0x00800071
+ */
+ (R200_TXA_ARG_A_R0_ALPHA |
+ R200_TXA_ARG_B_R2_ALPHA |
+ R200_TXA_ARG_C_ZERO |
+ R200_TXA_OP_MADD),
+
+ /* GL_DECAL = 0x00800100
+ */
+ (R200_TXA_ARG_A_ZERO |
+ R200_TXA_ARG_B_ZERO |
+ R200_TXA_ARG_C_R0_ALPHA |
+ R200_TXA_OP_MADD),
+
+ /* GL_BLEND = 0x00800071
+ */
+ (R200_TXA_ARG_A_R0_ALPHA |
+ R200_TXA_ARG_B_TFACTOR_ALPHA |
+ R200_TXA_ARG_C_R2_ALPHA |
+ R200_TXA_OP_LERP),
+
+ /* GL_ADD = 0x00800021
+ */
+ (R200_TXA_ARG_A_R0_ALPHA |
+ R200_TXA_ARG_B_ZERO |
+ R200_TXA_ARG_C_R2_ALPHA |
+ R200_TXA_COMP_ARG_B |
+ R200_TXA_OP_MADD),
+ }
+};
+
+
+/* GL_ARB_texture_env_combine support
+ */
+
+/* The color tables have combine functions for GL_SRC_COLOR,
+ * GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA and GL_ONE_MINUS_SRC_ALPHA.
+ */
+static GLuint r200_register_color[][R200_MAX_TEXTURE_UNITS] =
+{
+ {
+ R200_TXC_ARG_A_R0_COLOR,
+ R200_TXC_ARG_A_R1_COLOR,
+ R200_TXC_ARG_A_R2_COLOR
+ },
+ {
+ R200_TXC_ARG_A_R0_COLOR | R200_TXC_COMP_ARG_A,
+ R200_TXC_ARG_A_R1_COLOR | R200_TXC_COMP_ARG_A,
+ R200_TXC_ARG_A_R2_COLOR | R200_TXC_COMP_ARG_A
+ },
+ {
+ R200_TXC_ARG_A_R0_ALPHA,
+ R200_TXC_ARG_A_R1_ALPHA,
+ R200_TXC_ARG_A_R2_ALPHA
+ },
+ {
+ R200_TXC_ARG_A_R0_ALPHA | R200_TXC_COMP_ARG_A,
+ R200_TXC_ARG_A_R1_ALPHA | R200_TXC_COMP_ARG_A,
+ R200_TXC_ARG_A_R2_ALPHA | R200_TXC_COMP_ARG_A
+ },
+};
+
+static GLuint r200_tfactor_color[] =
+{
+ R200_TXC_ARG_A_TFACTOR_COLOR,
+ R200_TXC_ARG_A_TFACTOR_COLOR | R200_TXC_COMP_ARG_A,
+ R200_TXC_ARG_A_TFACTOR_ALPHA,
+ R200_TXC_ARG_A_TFACTOR_ALPHA | R200_TXC_COMP_ARG_A
+};
+
+static GLuint r200_primary_color[] =
+{
+ R200_TXC_ARG_A_DIFFUSE_COLOR,
+ R200_TXC_ARG_A_DIFFUSE_COLOR | R200_TXC_COMP_ARG_A,
+ R200_TXC_ARG_A_DIFFUSE_ALPHA,
+ R200_TXC_ARG_A_DIFFUSE_ALPHA | R200_TXC_COMP_ARG_A
+};
+
+/* GL_ZERO table - indices 0-3
+ * GL_ONE table - indices 1-4
+ */
+static GLuint r200_zero_color[] =
+{
+ R200_TXC_ARG_A_ZERO,
+ R200_TXC_ARG_A_ZERO | R200_TXC_COMP_ARG_A,
+ R200_TXC_ARG_A_ZERO,
+ R200_TXC_ARG_A_ZERO | R200_TXC_COMP_ARG_A,
+ R200_TXC_ARG_A_ZERO
+};
+
+/* The alpha tables only have GL_SRC_ALPHA and GL_ONE_MINUS_SRC_ALPHA.
+ */
+static GLuint r200_register_alpha[][R200_MAX_TEXTURE_UNITS] =
+{
+ {
+ R200_TXA_ARG_A_R0_ALPHA,
+ R200_TXA_ARG_A_R1_ALPHA,
+ R200_TXA_ARG_A_R2_ALPHA
+ },
+ {
+ R200_TXA_ARG_A_R0_ALPHA | R200_TXA_COMP_ARG_A,
+ R200_TXA_ARG_A_R1_ALPHA | R200_TXA_COMP_ARG_A,
+ R200_TXA_ARG_A_R2_ALPHA | R200_TXA_COMP_ARG_A
+ },
+};
+
+static GLuint r200_tfactor_alpha[] =
+{
+ R200_TXA_ARG_A_TFACTOR_ALPHA,
+ R200_TXA_ARG_A_TFACTOR_ALPHA | R200_TXA_COMP_ARG_A
+};
+
+static GLuint r200_primary_alpha[] =
+{
+ R200_TXA_ARG_A_DIFFUSE_ALPHA,
+ R200_TXA_ARG_A_DIFFUSE_ALPHA | R200_TXA_COMP_ARG_A
+};
+
+/* GL_ZERO table - indices 0-1
+ * GL_ONE table - indices 1-2
+ */
+static GLuint r200_zero_alpha[] =
+{
+ R200_TXA_ARG_A_ZERO,
+ R200_TXA_ARG_A_ZERO | R200_TXA_COMP_ARG_A,
+ R200_TXA_ARG_A_ZERO,
+};
+
+
+/* Extract the arg from slot A, shift it into the correct argument slot
+ * and set the corresponding complement bit.
+ */
+#define R200_COLOR_ARG( n, arg ) \
+do { \
+ color_combine |= \
+ ((color_arg[n] & R200_TXC_ARG_A_MASK) \
+ << R200_TXC_ARG_##arg##_SHIFT); \
+ color_combine |= \
+ ((color_arg[n] >> R200_TXC_COMP_ARG_A_SHIFT) \
+ << R200_TXC_COMP_ARG_##arg##_SHIFT); \
+} while (0)
+
+#define R200_ALPHA_ARG( n, arg ) \
+do { \
+ alpha_combine |= \
+ ((alpha_arg[n] & R200_TXA_ARG_A_MASK) \
+ << R200_TXA_ARG_##arg##_SHIFT); \
+ alpha_combine |= \
+ ((alpha_arg[n] >> R200_TXA_COMP_ARG_A_SHIFT) \
+ << R200_TXA_COMP_ARG_##arg##_SHIFT); \
+} while (0)
+
+
+/* ================================================================
+ * Texture unit state management
+ */
+
+static void r200UpdateTextureEnv( GLcontext *ctx, int unit )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ GLuint color_combine, alpha_combine;
+ GLuint color_scale = rmesa->hw.pix[unit].cmd[PIX_PP_TXCBLEND2];
+ GLuint alpha_scale = rmesa->hw.pix[unit].cmd[PIX_PP_TXABLEND2];
+
+ /* texUnit->_Current can be NULL if and only if the texture unit is
+ * not actually enabled.
+ */
+ assert( (texUnit->_ReallyEnabled == 0)
+ || (texUnit->_Current != NULL) );
+
+ if ( R200_DEBUG & DEBUG_TEXTURE ) {
+ fprintf( stderr, "%s( %p, %d )\n", __FUNCTION__, ctx, unit );
+ }
+
+ /* Set the texture environment state. Isn't this nice and clean?
+ * The chip will automagically set the texture alpha to 0xff when
+ * the texture format does not include an alpha component. This
+ * reduces the amount of special-casing we have to do, alpha-only
+ * textures being a notable exception.
+ */
+ if ( !texUnit->_ReallyEnabled ) {
+ /* Don't cache these results.
+ */
+ rmesa->state.texture.unit[unit].format = 0;
+ rmesa->state.texture.unit[unit].envMode = 0;
+ color_combine = r200_color_combine[unit][R200_DISABLE];
+ alpha_combine = r200_alpha_combine[unit][R200_DISABLE];
+ }
+ else {
+ const struct gl_texture_object *tObj = texUnit->_Current;
+ const GLenum format = tObj->Image[tObj->BaseLevel]->Format;
+ GLuint color_arg[3], alpha_arg[3];
+ GLuint i, numColorArgs = 0, numAlphaArgs = 0;
+ GLuint RGBshift = texUnit->CombineScaleShiftRGB;
+ GLuint Ashift = texUnit->CombineScaleShiftA;
+
+ switch ( texUnit->EnvMode ) {
+ case GL_REPLACE:
+ switch ( format ) {
+ case GL_RGBA:
+ case GL_LUMINANCE_ALPHA:
+ case GL_INTENSITY:
+ color_combine = r200_color_combine[unit][R200_REPLACE];
+ alpha_combine = r200_alpha_combine[unit][R200_REPLACE];
+ break;
+ case GL_ALPHA:
+ color_combine = r200_color_combine[unit][R200_DISABLE];
+ alpha_combine = r200_alpha_combine[unit][R200_REPLACE];
+ break;
+ case GL_LUMINANCE:
+ case GL_RGB:
+ case GL_YCBCR_MESA:
+ color_combine = r200_color_combine[unit][R200_REPLACE];
+ alpha_combine = r200_alpha_combine[unit][R200_DISABLE];
+ break;
+ case GL_COLOR_INDEX:
+ default:
+ return;
+ }
+ break;
+
+ case GL_MODULATE:
+ switch ( format ) {
+ case GL_RGBA:
+ case GL_LUMINANCE_ALPHA:
+ case GL_INTENSITY:
+ color_combine = r200_color_combine[unit][R200_MODULATE];
+ alpha_combine = r200_alpha_combine[unit][R200_MODULATE];
+ break;
+ case GL_ALPHA:
+ color_combine = r200_color_combine[unit][R200_DISABLE];
+ alpha_combine = r200_alpha_combine[unit][R200_MODULATE];
+ break;
+ case GL_RGB:
+ case GL_LUMINANCE:
+ case GL_YCBCR_MESA:
+ color_combine = r200_color_combine[unit][R200_MODULATE];
+ alpha_combine = r200_alpha_combine[unit][R200_DISABLE];
+ break;
+ case GL_COLOR_INDEX:
+ default:
+ return;
+ }
+ break;
+
+ case GL_DECAL:
+ switch ( format ) {
+ case GL_RGBA:
+ case GL_RGB:
+ case GL_YCBCR_MESA:
+ color_combine = r200_color_combine[unit][R200_DECAL];
+ alpha_combine = r200_alpha_combine[unit][R200_DISABLE];
+ break;
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ case GL_LUMINANCE_ALPHA:
+ case GL_INTENSITY:
+ color_combine = r200_color_combine[unit][R200_DISABLE];
+ alpha_combine = r200_alpha_combine[unit][R200_DISABLE];
+ break;
+ case GL_COLOR_INDEX:
+ default:
+ return;
+ }
+ break;
+
+ case GL_BLEND:
+ switch ( format ) {
+ case GL_RGBA:
+ case GL_RGB:
+ case GL_LUMINANCE:
+ case GL_LUMINANCE_ALPHA:
+ case GL_YCBCR_MESA:
+ color_combine = r200_color_combine[unit][R200_BLEND];
+ alpha_combine = r200_alpha_combine[unit][R200_MODULATE];
+ break;
+ case GL_ALPHA:
+ color_combine = r200_color_combine[unit][R200_DISABLE];
+ alpha_combine = r200_alpha_combine[unit][R200_MODULATE];
+ break;
+ case GL_INTENSITY:
+ color_combine = r200_color_combine[unit][R200_BLEND];
+ alpha_combine = r200_alpha_combine[unit][R200_BLEND];
+ break;
+ case GL_COLOR_INDEX:
+ default:
+ return;
+ }
+ break;
+
+ case GL_ADD:
+ switch ( format ) {
+ case GL_RGBA:
+ case GL_RGB:
+ case GL_LUMINANCE:
+ case GL_LUMINANCE_ALPHA:
+ case GL_YCBCR_MESA:
+ color_combine = r200_color_combine[unit][R200_ADD];
+ alpha_combine = r200_alpha_combine[unit][R200_MODULATE];
+ break;
+ case GL_ALPHA:
+ color_combine = r200_color_combine[unit][R200_DISABLE];
+ alpha_combine = r200_alpha_combine[unit][R200_MODULATE];
+ break;
+ case GL_INTENSITY:
+ color_combine = r200_color_combine[unit][R200_ADD];
+ alpha_combine = r200_alpha_combine[unit][R200_ADD];
+ break;
+ case GL_COLOR_INDEX:
+ default:
+ return;
+ }
+ break;
+
+ case GL_COMBINE:
+ /* Don't cache these results.
+ */
+ rmesa->state.texture.unit[unit].format = 0;
+ rmesa->state.texture.unit[unit].envMode = 0;
+
+ /* Step 0:
+ * Calculate how many arguments we need to process.
+ */
+ switch ( texUnit->CombineModeRGB ) {
+ case GL_REPLACE:
+ numColorArgs = 1;
+ break;
+ case GL_MODULATE:
+ case GL_ADD:
+ case GL_ADD_SIGNED:
+ case GL_SUBTRACT:
+ case GL_DOT3_RGB:
+ case GL_DOT3_RGBA:
+ case GL_DOT3_RGB_EXT:
+ case GL_DOT3_RGBA_EXT:
+ numColorArgs = 2;
+ break;
+ case GL_INTERPOLATE:
+ case GL_MODULATE_ADD_ATI:
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ case GL_MODULATE_SUBTRACT_ATI:
+ numColorArgs = 3;
+ break;
+ default:
+ return;
+ }
+
+ switch ( texUnit->CombineModeA ) {
+ case GL_REPLACE:
+ numAlphaArgs = 1;
+ break;
+ case GL_MODULATE:
+ case GL_ADD:
+ case GL_ADD_SIGNED:
+ case GL_SUBTRACT:
+ numAlphaArgs = 2;
+ break;
+ case GL_INTERPOLATE:
+ case GL_MODULATE_ADD_ATI:
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ case GL_MODULATE_SUBTRACT_ATI:
+ numAlphaArgs = 3;
+ break;
+ default:
+ return;
+ }
+
+ /* Step 1:
+ * Extract the color and alpha combine function arguments.
+ */
+ for ( i = 0 ; i < numColorArgs ; i++ ) {
+ const GLuint op = texUnit->CombineOperandRGB[i] - GL_SRC_COLOR;
+ assert(op >= 0);
+ assert(op <= 3);
+ switch ( texUnit->CombineSourceRGB[i] ) {
+ case GL_TEXTURE:
+ color_arg[i] = r200_register_color[op][unit];
+ break;
+ case GL_CONSTANT:
+ color_arg[i] = r200_tfactor_color[op];
+ break;
+ case GL_PRIMARY_COLOR:
+ color_arg[i] = r200_primary_color[op];
+ break;
+ case GL_PREVIOUS:
+ if (unit == 0)
+ color_arg[i] = r200_primary_color[op];
+ else
+ color_arg[i] = r200_register_color[op][0];
+ break;
+ case GL_ZERO:
+ color_arg[i] = r200_zero_color[op];
+ break;
+ case GL_ONE:
+ color_arg[i] = r200_zero_color[op+1];
+ break;
+ default:
+ return;
+ }
+ }
+
+ for ( i = 0 ; i < numAlphaArgs ; i++ ) {
+ const GLuint op = texUnit->CombineOperandA[i] - GL_SRC_ALPHA;
+ assert(op >= 0);
+ assert(op <= 1);
+ switch ( texUnit->CombineSourceA[i] ) {
+ case GL_TEXTURE:
+ alpha_arg[i] = r200_register_alpha[op][unit];
+ break;
+ case GL_CONSTANT:
+ alpha_arg[i] = r200_tfactor_alpha[op];
+ break;
+ case GL_PRIMARY_COLOR:
+ alpha_arg[i] = r200_primary_alpha[op];
+ break;
+ case GL_PREVIOUS:
+ if (unit == 0)
+ alpha_arg[i] = r200_primary_alpha[op];
+ else
+ alpha_arg[i] = r200_register_alpha[op][0];
+ break;
+ case GL_ZERO:
+ alpha_arg[i] = r200_zero_alpha[op];
+ break;
+ case GL_ONE:
+ alpha_arg[i] = r200_zero_alpha[op+1];
+ break;
+ default:
+ return;
+ }
+ }
+
+ /* Step 2:
+ * Build up the color and alpha combine functions.
+ */
+ switch ( texUnit->CombineModeRGB ) {
+ case GL_REPLACE:
+ color_combine = (R200_TXC_ARG_A_ZERO |
+ R200_TXC_ARG_B_ZERO |
+ R200_TXC_OP_MADD);
+ R200_COLOR_ARG( 0, C );
+ break;
+ case GL_MODULATE:
+ color_combine = (R200_TXC_ARG_C_ZERO |
+ R200_TXC_OP_MADD);
+ R200_COLOR_ARG( 0, A );
+ R200_COLOR_ARG( 1, B );
+ break;
+ case GL_ADD:
+ color_combine = (R200_TXC_ARG_B_ZERO |
+ R200_TXC_COMP_ARG_B |
+ R200_TXC_OP_MADD);
+ R200_COLOR_ARG( 0, A );
+ R200_COLOR_ARG( 1, C );
+ break;
+ case GL_ADD_SIGNED:
+ color_combine = (R200_TXC_ARG_B_ZERO |
+ R200_TXC_COMP_ARG_B |
+ R200_TXC_BIAS_ARG_C | /* new */
+ R200_TXC_OP_MADD); /* was ADDSIGNED */
+ R200_COLOR_ARG( 0, A );
+ R200_COLOR_ARG( 1, C );
+ break;
+ case GL_SUBTRACT:
+ color_combine = (R200_TXC_ARG_B_ZERO |
+ R200_TXC_COMP_ARG_B |
+ R200_TXC_NEG_ARG_C |
+ R200_TXC_OP_MADD);
+ R200_COLOR_ARG( 0, A );
+ R200_COLOR_ARG( 1, C );
+ break;
+ case GL_INTERPOLATE:
+ color_combine = (R200_TXC_OP_LERP);
+ R200_COLOR_ARG( 0, B );
+ R200_COLOR_ARG( 1, A );
+ R200_COLOR_ARG( 2, C );
+ break;
+
+ case GL_DOT3_RGB_EXT:
+ case GL_DOT3_RGBA_EXT:
+ /* The EXT version of the DOT3 extension does not support the
+ * scale factor, but the ARB version (and the version in OpenGL
+ * 1.3) does.
+ */
+ RGBshift = 0;
+ Ashift = 0;
+ /* FALLTHROUGH */
+
+ case GL_DOT3_RGB:
+ case GL_DOT3_RGBA:
+ /* DOT3 works differently on R200 than on R100. On R100, just
+ * setting the DOT3 mode did everything for you. On R200, the
+ * driver has to enable the biasing (the -0.5 in the combine
+ * equation), and it has add the 4x scale factor. The hardware
+ * only supports up to 8x in the post filter, so 2x part of it
+ * happens on the inputs going into the combiner.
+ */
+
+ RGBshift++;
+ Ashift = RGBshift;
+
+ color_combine = (R200_TXC_ARG_C_ZERO |
+ R200_TXC_OP_DOT3 |
+ R200_TXC_BIAS_ARG_A |
+ R200_TXC_BIAS_ARG_B |
+ R200_TXC_SCALE_ARG_A |
+ R200_TXC_SCALE_ARG_B);
+ R200_COLOR_ARG( 0, A );
+ R200_COLOR_ARG( 1, B );
+ break;
+
+ case GL_MODULATE_ADD_ATI:
+ color_combine = (R200_TXC_OP_MADD);
+ R200_COLOR_ARG( 0, A );
+ R200_COLOR_ARG( 1, C );
+ R200_COLOR_ARG( 2, B );
+ break;
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ color_combine = (R200_TXC_BIAS_ARG_C | /* new */
+ R200_TXC_OP_MADD); /* was ADDSIGNED */
+ R200_COLOR_ARG( 0, A );
+ R200_COLOR_ARG( 1, C );
+ R200_COLOR_ARG( 2, B );
+ break;
+ case GL_MODULATE_SUBTRACT_ATI:
+ color_combine = (R200_TXC_NEG_ARG_C |
+ R200_TXC_OP_MADD);
+ R200_COLOR_ARG( 0, A );
+ R200_COLOR_ARG( 1, C );
+ R200_COLOR_ARG( 2, B );
+ break;
+ default:
+ return;
+ }
+
+ switch ( texUnit->CombineModeA ) {
+ case GL_REPLACE:
+ alpha_combine = (R200_TXA_ARG_A_ZERO |
+ R200_TXA_ARG_B_ZERO |
+ R200_TXA_OP_MADD);
+ R200_ALPHA_ARG( 0, C );
+ break;
+ case GL_MODULATE:
+ alpha_combine = (R200_TXA_ARG_C_ZERO |
+ R200_TXA_OP_MADD);
+ R200_ALPHA_ARG( 0, A );
+ R200_ALPHA_ARG( 1, B );
+ break;
+ case GL_ADD:
+ alpha_combine = (R200_TXA_ARG_B_ZERO |
+ R200_TXA_COMP_ARG_B |
+ R200_TXA_OP_MADD);
+ R200_ALPHA_ARG( 0, A );
+ R200_ALPHA_ARG( 1, C );
+ break;
+ case GL_ADD_SIGNED:
+ alpha_combine = (R200_TXA_ARG_B_ZERO |
+ R200_TXA_COMP_ARG_B |
+ R200_TXA_BIAS_ARG_C | /* new */
+ R200_TXA_OP_MADD); /* was ADDSIGNED */
+ R200_ALPHA_ARG( 0, A );
+ R200_ALPHA_ARG( 1, C );
+ break;
+ case GL_SUBTRACT:
+ alpha_combine = (R200_TXA_ARG_B_ZERO |
+ R200_TXA_COMP_ARG_B |
+ R200_TXA_NEG_ARG_C |
+ R200_TXA_OP_MADD);
+ R200_ALPHA_ARG( 0, A );
+ R200_ALPHA_ARG( 1, C );
+ break;
+ case GL_INTERPOLATE:
+ alpha_combine = (R200_TXA_OP_LERP);
+ R200_ALPHA_ARG( 0, B );
+ R200_ALPHA_ARG( 1, A );
+ R200_ALPHA_ARG( 2, C );
+ break;
+
+ case GL_MODULATE_ADD_ATI:
+ alpha_combine = (R200_TXA_OP_MADD);
+ R200_ALPHA_ARG( 0, A );
+ R200_ALPHA_ARG( 1, C );
+ R200_ALPHA_ARG( 2, B );
+ break;
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ alpha_combine = (R200_TXA_BIAS_ARG_C | /* new */
+ R200_TXA_OP_MADD); /* was ADDSIGNED */
+ R200_ALPHA_ARG( 0, A );
+ R200_ALPHA_ARG( 1, C );
+ R200_ALPHA_ARG( 2, B );
+ break;
+ case GL_MODULATE_SUBTRACT_ATI:
+ alpha_combine = (R200_TXA_NEG_ARG_C |
+ R200_TXA_OP_MADD);
+ R200_ALPHA_ARG( 0, A );
+ R200_ALPHA_ARG( 1, C );
+ R200_ALPHA_ARG( 2, B );
+ break;
+ default:
+ return;
+ }
+
+ if ( (texUnit->CombineModeRGB == GL_DOT3_RGB_EXT)
+ || (texUnit->CombineModeRGB == GL_DOT3_RGB) ) {
+ alpha_scale |= R200_TXA_DOT_ALPHA;
+ }
+
+ /* Step 3:
+ * Apply the scale factor.
+ */
+ color_scale &= ~R200_TXC_SCALE_MASK;
+ alpha_scale &= ~R200_TXA_SCALE_MASK;
+ color_scale |= (RGBshift << R200_TXC_SCALE_SHIFT);
+ alpha_scale |= (Ashift << R200_TXA_SCALE_SHIFT);
+
+ /* All done!
+ */
+ break;
+
+ default:
+ return;
+ }
+ }
+
+ if ( rmesa->hw.pix[unit].cmd[PIX_PP_TXCBLEND] != color_combine ||
+ rmesa->hw.pix[unit].cmd[PIX_PP_TXABLEND] != alpha_combine ||
+ rmesa->hw.pix[unit].cmd[PIX_PP_TXCBLEND2] != color_scale ||
+ rmesa->hw.pix[unit].cmd[PIX_PP_TXABLEND2] != alpha_scale) {
+ R200_STATECHANGE( rmesa, pix[unit] );
+ rmesa->hw.pix[unit].cmd[PIX_PP_TXCBLEND] = color_combine;
+ rmesa->hw.pix[unit].cmd[PIX_PP_TXABLEND] = alpha_combine;
+ rmesa->hw.pix[unit].cmd[PIX_PP_TXCBLEND2] = color_scale;
+ rmesa->hw.pix[unit].cmd[PIX_PP_TXABLEND2] = alpha_scale;
+ }
+}
+
+#define TEXOBJ_TXFILTER_MASK (R200_MAX_MIP_LEVEL_MASK | \
+ R200_MIN_FILTER_MASK | \
+ R200_MAG_FILTER_MASK | \
+ R200_MAX_ANISO_MASK | \
+ R200_YUV_TO_RGB | \
+ R200_YUV_TEMPERATURE_MASK | \
+ R200_CLAMP_S_MASK | \
+ R200_CLAMP_T_MASK)
+
+#define TEXOBJ_TXFORMAT_MASK (R200_TXFORMAT_WIDTH_MASK | \
+ R200_TXFORMAT_HEIGHT_MASK | \
+ R200_TXFORMAT_FORMAT_MASK | \
+ R200_TXFORMAT_F5_WIDTH_MASK | \
+ R200_TXFORMAT_F5_HEIGHT_MASK | \
+ R200_TXFORMAT_ALPHA_IN_MAP | \
+ R200_TXFORMAT_CUBIC_MAP_ENABLE | \
+ R200_TXFORMAT_NON_POWER2)
+
+#define TEXOBJ_TXFORMAT_X_MASK (R200_DEPTH_LOG2_MASK | \
+ R200_TEXCOORD_MASK | \
+ R200_VOLUME_FILTER_MASK)
+
+
+static void import_tex_obj_state( r200ContextPtr rmesa,
+ int unit,
+ r200TexObjPtr texobj )
+{
+ GLuint *cmd = R200_DB_STATE( tex[unit] );
+
+ cmd[TEX_PP_TXFILTER] &= ~TEXOBJ_TXFILTER_MASK;
+ cmd[TEX_PP_TXFILTER] |= texobj->pp_txfilter & TEXOBJ_TXFILTER_MASK;
+ cmd[TEX_PP_TXFORMAT] &= ~TEXOBJ_TXFORMAT_MASK;
+ cmd[TEX_PP_TXFORMAT] |= texobj->pp_txformat & TEXOBJ_TXFORMAT_MASK;
+ cmd[TEX_PP_TXFORMAT_X] &= ~TEXOBJ_TXFORMAT_X_MASK;
+ cmd[TEX_PP_TXFORMAT_X] |= texobj->pp_txformat_x & TEXOBJ_TXFORMAT_X_MASK;
+ cmd[TEX_PP_TXSIZE] = texobj->pp_txsize; /* NPOT only! */
+ cmd[TEX_PP_TXPITCH] = texobj->pp_txpitch; /* NPOT only! */
+ cmd[TEX_PP_TXOFFSET] = texobj->pp_txoffset;
+ cmd[TEX_PP_BORDER_COLOR] = texobj->pp_border_color;
+ R200_DB_STATECHANGE( rmesa, &rmesa->hw.tex[unit] );
+
+ if (texobj->tObj->Target == GL_TEXTURE_CUBE_MAP) {
+ GLuint *cube_cmd = R200_DB_STATE( cube[unit] );
+ GLuint bytesPerFace = texobj->totalSize / 6;
+ ASSERT(texobj->totalSize % 6 == 0);
+ cube_cmd[CUBE_PP_CUBIC_FACES] = texobj->pp_cubic_faces;
+ cube_cmd[CUBE_PP_CUBIC_OFFSET_F1] = texobj->pp_txoffset + 1 * bytesPerFace;
+ cube_cmd[CUBE_PP_CUBIC_OFFSET_F2] = texobj->pp_txoffset + 2 * bytesPerFace;
+ cube_cmd[CUBE_PP_CUBIC_OFFSET_F3] = texobj->pp_txoffset + 3 * bytesPerFace;
+ cube_cmd[CUBE_PP_CUBIC_OFFSET_F4] = texobj->pp_txoffset + 4 * bytesPerFace;
+ cube_cmd[CUBE_PP_CUBIC_OFFSET_F5] = texobj->pp_txoffset + 5 * bytesPerFace;
+ R200_DB_STATECHANGE( rmesa, &rmesa->hw.cube[unit] );
+ }
+
+ texobj->dirty_state &= ~(1<<unit);
+}
+
+
+
+
+static void set_texgen_matrix( r200ContextPtr rmesa,
+ GLuint unit,
+ const GLfloat *s_plane,
+ const GLfloat *t_plane,
+ const GLfloat *r_plane )
+{
+ static const GLfloat scale_identity[4] = { 1,1,1,1 };
+
+ if (!TEST_EQ_4V( s_plane, scale_identity) ||
+ !TEST_EQ_4V( t_plane, scale_identity) ||
+ !TEST_EQ_4V( r_plane, scale_identity)) {
+ rmesa->TexGenEnabled |= R200_TEXMAT_0_ENABLE<<unit;
+ rmesa->TexGenMatrix[unit].m[0] = s_plane[0];
+ rmesa->TexGenMatrix[unit].m[4] = s_plane[1];
+ rmesa->TexGenMatrix[unit].m[8] = s_plane[2];
+ rmesa->TexGenMatrix[unit].m[12] = s_plane[3];
+
+ rmesa->TexGenMatrix[unit].m[1] = t_plane[0];
+ rmesa->TexGenMatrix[unit].m[5] = t_plane[1];
+ rmesa->TexGenMatrix[unit].m[9] = t_plane[2];
+ rmesa->TexGenMatrix[unit].m[13] = t_plane[3];
+
+ /* NOTE: r_plane goes in the 4th row, not 3rd! */
+ rmesa->TexGenMatrix[unit].m[3] = r_plane[0];
+ rmesa->TexGenMatrix[unit].m[7] = r_plane[1];
+ rmesa->TexGenMatrix[unit].m[11] = r_plane[2];
+ rmesa->TexGenMatrix[unit].m[15] = r_plane[3];
+
+ rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
+ }
+}
+
+/* Need this special matrix to get correct reflection map coords */
+static void
+set_texgen_reflection_matrix( r200ContextPtr rmesa, GLuint unit )
+{
+ static const GLfloat m[16] = {
+ -1, 0, 0, 0,
+ 0, -1, 0, 0,
+ 0, 0, 0, -1,
+ 0, 0, -1, 0 };
+ _math_matrix_loadf( &(rmesa->TexGenMatrix[unit]), m);
+ _math_matrix_analyse( &(rmesa->TexGenMatrix[unit]) );
+ rmesa->TexGenEnabled |= R200_TEXMAT_0_ENABLE<<unit;
+}
+
+/* Need this special matrix to get correct normal map coords */
+static void
+set_texgen_normal_map_matrix( r200ContextPtr rmesa, GLuint unit )
+{
+ static const GLfloat m[16] = {
+ 1, 0, 0, 0,
+ 0, 1, 0, 0,
+ 0, 0, 0, 1,
+ 0, 0, 1, 0 };
+ _math_matrix_loadf( &(rmesa->TexGenMatrix[unit]), m);
+ _math_matrix_analyse( &(rmesa->TexGenMatrix[unit]) );
+ rmesa->TexGenEnabled |= R200_TEXMAT_0_ENABLE<<unit;
+}
+
+
+/* Ignoring the Q texcoord for now.
+ *
+ * Returns GL_FALSE if fallback required.
+ */
+static GLboolean r200_validate_texgen( GLcontext *ctx, GLuint unit )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ GLuint inputshift = R200_TEXGEN_0_INPUT_SHIFT + unit*4;
+ GLuint tmp = rmesa->TexGenEnabled;
+
+ rmesa->TexGenCompSel &= ~(R200_OUTPUT_TEX_0 << unit);
+ rmesa->TexGenEnabled &= ~(R200_TEXGEN_TEXMAT_0_ENABLE<<unit);
+ rmesa->TexGenEnabled &= ~(R200_TEXMAT_0_ENABLE<<unit);
+ rmesa->TexGenInputs &= ~(R200_TEXGEN_INPUT_MASK<<inputshift);
+ rmesa->TexGenNeedNormals[unit] = 0;
+
+ if (0)
+ fprintf(stderr, "%s unit %d\n", __FUNCTION__, unit);
+
+ if ((texUnit->TexGenEnabled & (S_BIT|T_BIT|R_BIT)) == 0) {
+ /* Disabled, no fallback:
+ */
+ rmesa->TexGenInputs |=
+ (R200_TEXGEN_INPUT_TEXCOORD_0+unit) << inputshift;
+ return GL_TRUE;
+ }
+ else if (texUnit->TexGenEnabled & Q_BIT) {
+ /* Very easy to do this, in fact would remove a fallback case
+ * elsewhere, but I haven't done it yet... Fallback:
+ */
+ /*fprintf(stderr, "fallback Q_BIT\n");*/
+ return GL_FALSE;
+ }
+ else if (texUnit->TexGenEnabled == (S_BIT|T_BIT) &&
+ texUnit->GenModeS == texUnit->GenModeT) {
+ /* OK */
+ rmesa->TexGenEnabled |= R200_TEXGEN_TEXMAT_0_ENABLE << unit;
+ /* continue */
+ }
+ else if (texUnit->TexGenEnabled == (S_BIT|T_BIT|R_BIT) &&
+ texUnit->GenModeS == texUnit->GenModeT &&
+ texUnit->GenModeT == texUnit->GenModeR) {
+ /* OK */
+ rmesa->TexGenEnabled |= R200_TEXGEN_TEXMAT_0_ENABLE << unit;
+ /* continue */
+ }
+ else {
+ /* Mixed modes, fallback:
+ */
+ /* fprintf(stderr, "fallback mixed texgen\n"); */
+ return GL_FALSE;
+ }
+
+ rmesa->TexGenEnabled |= R200_TEXGEN_TEXMAT_0_ENABLE << unit;
+
+ switch (texUnit->GenModeS) {
+ case GL_OBJECT_LINEAR:
+ rmesa->TexGenInputs |= R200_TEXGEN_INPUT_OBJ << inputshift;
+ set_texgen_matrix( rmesa, unit,
+ texUnit->ObjectPlaneS,
+ texUnit->ObjectPlaneT,
+ texUnit->ObjectPlaneR);
+ break;
+
+ case GL_EYE_LINEAR:
+ rmesa->TexGenInputs |= R200_TEXGEN_INPUT_EYE << inputshift;
+ set_texgen_matrix( rmesa, unit,
+ texUnit->EyePlaneS,
+ texUnit->EyePlaneT,
+ texUnit->EyePlaneR);
+ break;
+
+ case GL_REFLECTION_MAP_NV:
+ rmesa->TexGenNeedNormals[unit] = GL_TRUE;
+ rmesa->TexGenInputs |= R200_TEXGEN_INPUT_EYE_REFLECT<<inputshift;
+ set_texgen_reflection_matrix(rmesa, unit);
+ break;
+
+ case GL_NORMAL_MAP_NV:
+ rmesa->TexGenNeedNormals[unit] = GL_TRUE;
+ rmesa->TexGenInputs |= R200_TEXGEN_INPUT_EYE_NORMAL<<inputshift;
+ set_texgen_normal_map_matrix(rmesa, unit);
+ break;
+
+ case GL_SPHERE_MAP:
+ rmesa->TexGenNeedNormals[unit] = GL_TRUE;
+ rmesa->TexGenInputs |= R200_TEXGEN_INPUT_SPHERE<<inputshift;
+ break;
+
+ default:
+ /* Unsupported mode, fallback:
+ */
+ /* fprintf(stderr, "fallback unsupported texgen\n"); */
+ return GL_FALSE;
+ }
+
+ rmesa->TexGenCompSel |= R200_OUTPUT_TEX_0 << unit;
+
+ if (tmp != rmesa->TexGenEnabled) {
+ rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
+ }
+
+ if (0)
+ fprintf(stderr, "%s unit %d neednormals %d\n", __FUNCTION__, unit,
+ rmesa->TexGenNeedNormals[unit]);
+
+ return GL_TRUE;
+}
+
+
+static void disable_tex( GLcontext *ctx, int unit )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if (rmesa->hw.ctx.cmd[CTX_PP_CNTL] & (R200_TEX_0_ENABLE<<unit)) {
+ /* Texture unit disabled */
+ rmesa->state.texture.unit[unit].texobj = 0;
+ R200_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~((R200_TEX_0_ENABLE |
+ R200_TEX_BLEND_0_ENABLE) << unit);
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_BLEND_0_ENABLE;
+
+ R200_STATECHANGE( rmesa, tcl );
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] &= ~(7 << (unit * 3));
+
+ if (rmesa->TclFallback & (R200_TCL_FALLBACK_TEXGEN_0<<unit)) {
+ TCL_FALLBACK( ctx, (R200_TCL_FALLBACK_TEXGEN_0<<unit), GL_FALSE);
+ }
+
+ /* Actually want to keep all units less than max active texture
+ * enabled, right? Fix this for >2 texunits.
+ */
+ if (unit == 0)
+ r200UpdateTextureEnv( ctx, unit );
+
+
+ {
+ GLuint inputshift = R200_TEXGEN_0_INPUT_SHIFT + unit*4;
+ GLuint tmp = rmesa->TexGenEnabled;
+
+ rmesa->TexGenEnabled &= ~(R200_TEXGEN_TEXMAT_0_ENABLE<<unit);
+ rmesa->TexGenEnabled &= ~(R200_TEXMAT_0_ENABLE<<unit);
+ rmesa->TexGenEnabled &= ~(R200_TEXGEN_INPUT_MASK<<inputshift);
+ rmesa->TexGenNeedNormals[unit] = 0;
+ rmesa->TexGenCompSel &= ~(R200_OUTPUT_TEX_0 << unit);
+ rmesa->TexGenInputs &= ~(R200_TEXGEN_INPUT_MASK<<inputshift);
+
+ if (tmp != rmesa->TexGenEnabled) {
+ rmesa->recheck_texgen[unit] = GL_TRUE;
+ rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
+ }
+ }
+ }
+}
+
+static GLboolean enable_tex_2d( GLcontext *ctx, int unit )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ struct gl_texture_object *tObj = texUnit->_Current;
+ r200TexObjPtr t = (r200TexObjPtr) tObj->DriverData;
+
+ /* Need to load the 2d images associated with this unit.
+ */
+ if (t->pp_txformat & R200_TXFORMAT_NON_POWER2) {
+ t->pp_txformat &= ~R200_TXFORMAT_NON_POWER2;
+ t->dirty_images[0] = ~0;
+ }
+
+ ASSERT(tObj->Target == GL_TEXTURE_2D || tObj->Target == GL_TEXTURE_1D);
+
+ if ( t->dirty_images[0] ) {
+ R200_FIREVERTICES( rmesa );
+ r200SetTexImages( rmesa, tObj );
+ r200UploadTexImages( rmesa, (r200TexObjPtr) tObj->DriverData, 0 );
+ if ( !t->memBlock )
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+#if ENABLE_HW_3D_TEXTURE
+static GLboolean enable_tex_3d( GLcontext *ctx, int unit )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ struct gl_texture_object *tObj = texUnit->_Current;
+ r200TexObjPtr t = (r200TexObjPtr) tObj->DriverData;
+
+ /* Need to load the 3d images associated with this unit.
+ */
+ if (t->pp_txformat & R200_TXFORMAT_NON_POWER2) {
+ t->pp_txformat &= ~R200_TXFORMAT_NON_POWER2;
+ t->dirty_images[0] = ~0;
+ }
+
+ ASSERT(tObj->Target == GL_TEXTURE_3D);
+
+ if ( t->dirty_images[0] ) {
+ R200_FIREVERTICES( rmesa );
+ r200SetTexImages( rmesa, tObj );
+ r200UploadTexImages( rmesa, (r200TexObjPtr) tObj->DriverData, 0 );
+ if ( !t->memBlock )
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+#endif
+
+static GLboolean enable_tex_cube( GLcontext *ctx, int unit )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ struct gl_texture_object *tObj = texUnit->_Current;
+ r200TexObjPtr t = (r200TexObjPtr) tObj->DriverData;
+ GLuint face;
+
+ /* Need to load the 2d images associated with this unit.
+ */
+ if (t->pp_txformat & R200_TXFORMAT_NON_POWER2) {
+ t->pp_txformat &= ~R200_TXFORMAT_NON_POWER2;
+ for (face = 0; face < 6; face++)
+ t->dirty_images[face] = ~0;
+ }
+
+ ASSERT(tObj->Target == GL_TEXTURE_CUBE_MAP);
+
+ if ( t->dirty_images[0] || t->dirty_images[1] ||
+ t->dirty_images[2] || t->dirty_images[3] ||
+ t->dirty_images[4] || t->dirty_images[5] ) {
+ /* flush */
+ R200_FIREVERTICES( rmesa );
+ /* layout memory space, once for all faces */
+ r200SetTexImages( rmesa, tObj );
+ }
+
+ /* upload (per face) */
+ for (face = 0; face < 6; face++) {
+ if (t->dirty_images[face]) {
+ r200UploadTexImages( rmesa, (r200TexObjPtr) tObj->DriverData, face );
+ }
+ }
+
+ if ( !t->memBlock ) {
+ /* texmem alloc failed, use s/w fallback */
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+static GLboolean enable_tex_rect( GLcontext *ctx, int unit )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ struct gl_texture_object *tObj = texUnit->_Current;
+ r200TexObjPtr t = (r200TexObjPtr) tObj->DriverData;
+
+ if (!(t->pp_txformat & R200_TXFORMAT_NON_POWER2)) {
+ t->pp_txformat |= R200_TXFORMAT_NON_POWER2;
+ t->dirty_images[0] = ~0;
+ }
+
+ ASSERT(tObj->Target == GL_TEXTURE_RECTANGLE_NV);
+
+ if ( t->dirty_images[0] ) {
+ R200_FIREVERTICES( rmesa );
+ r200SetTexImages( rmesa, tObj );
+ r200UploadTexImages( rmesa, (r200TexObjPtr) tObj->DriverData, 0 );
+ if ( !t->memBlock && !rmesa->prefer_agp_client_texturing )
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+
+static GLboolean update_tex_common( GLcontext *ctx, int unit )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ struct gl_texture_object *tObj = texUnit->_Current;
+ r200TexObjPtr t = (r200TexObjPtr) tObj->DriverData;
+ GLenum format;
+
+ /* Fallback if there's a texture border */
+ if ( tObj->Image[tObj->BaseLevel]->Border > 0 )
+ return GL_FALSE;
+
+ /* Update state if this is a different texture object to last
+ * time.
+ */
+ if ( rmesa->state.texture.unit[unit].texobj != t ) {
+ rmesa->state.texture.unit[unit].texobj = t;
+ t->dirty_state |= 1<<unit;
+
+ R200_FIREVERTICES( rmesa );
+ LOCK_HARDWARE( rmesa );
+ r200UpdateTexLRU( rmesa, t );
+ UNLOCK_HARDWARE( rmesa );
+ }
+
+
+ /* Newly enabled?
+ */
+ if ( 1|| !(rmesa->hw.ctx.cmd[CTX_PP_CNTL] & (R200_TEX_0_ENABLE<<unit))) {
+ R200_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= (R200_TEX_0_ENABLE |
+ R200_TEX_BLEND_0_ENABLE) << unit;
+
+ R200_STATECHANGE( rmesa, vtx );
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] |= 4 << (unit * 3);
+
+ rmesa->recheck_texgen[unit] = GL_TRUE;
+ }
+
+ if (t->dirty_state & (1<<unit)) {
+ import_tex_obj_state( rmesa, unit, t );
+ }
+
+ if (rmesa->recheck_texgen[unit]) {
+ GLboolean fallback = !r200_validate_texgen( ctx, unit );
+ TCL_FALLBACK( ctx, (R200_TCL_FALLBACK_TEXGEN_0<<unit), fallback);
+ rmesa->recheck_texgen[unit] = 0;
+ rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
+ }
+
+ format = tObj->Image[tObj->BaseLevel]->Format;
+ if ( rmesa->state.texture.unit[unit].format != format ||
+ rmesa->state.texture.unit[unit].envMode != texUnit->EnvMode ) {
+ rmesa->state.texture.unit[unit].format = format;
+ rmesa->state.texture.unit[unit].envMode = texUnit->EnvMode;
+ r200UpdateTextureEnv( ctx, unit );
+ }
+
+ return GL_TRUE;
+}
+
+
+
+static GLboolean r200UpdateTextureUnit( GLcontext *ctx, int unit )
+{
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+
+ if ( texUnit->_ReallyEnabled & (TEXTURE_RECT_BIT) ) {
+ return (enable_tex_rect( ctx, unit ) &&
+ update_tex_common( ctx, unit ));
+ }
+ else if ( texUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT) ) {
+ return (enable_tex_2d( ctx, unit ) &&
+ update_tex_common( ctx, unit ));
+ }
+#if ENABLE_HW_3D_TEXTURE
+ else if ( texUnit->_ReallyEnabled & (TEXTURE_3D_BIT) ) {
+ return (enable_tex_3d( ctx, unit ) &&
+ update_tex_common( ctx, unit ));
+ }
+#endif
+ else if ( texUnit->_ReallyEnabled & (TEXTURE_CUBE_BIT) ) {
+ return (enable_tex_cube( ctx, unit ) &&
+ update_tex_common( ctx, unit ));
+ }
+ else if ( texUnit->_ReallyEnabled ) {
+ return GL_FALSE;
+ }
+ else {
+ disable_tex( ctx, unit );
+ return GL_TRUE;
+ }
+}
+
+
+void r200UpdateTextureState( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLboolean ok;
+ GLuint dbg;
+
+ ok = (r200UpdateTextureUnit( ctx, 0 ) &&
+ r200UpdateTextureUnit( ctx, 1 ));
+
+ FALLBACK( rmesa, R200_FALLBACK_TEXTURE, !ok );
+
+ if (rmesa->TclFallback)
+ r200ChooseVertexState( ctx );
+
+ /*
+ * T0 hang workaround -------------
+ */
+#if 1
+ if ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_ENABLE_MASK) == R200_TEX_0_ENABLE &&
+ (rmesa->hw.tex[0].cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK) > R200_MIN_FILTER_LINEAR) {
+
+ R200_STATECHANGE(rmesa, ctx);
+ R200_STATECHANGE(rmesa, tex[1]);
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_1_ENABLE;
+ rmesa->hw.tex[1].cmd[TEX_PP_TXFORMAT] &= ~TEXOBJ_TXFORMAT_MASK;
+ rmesa->hw.tex[1].cmd[TEX_PP_TXFORMAT] |= 0x08000000;
+ }
+ else {
+ if ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_1_ENABLE) &&
+ (rmesa->hw.tex[1].cmd[TEX_PP_TXFORMAT] & 0x08000000)) {
+ R200_STATECHANGE(rmesa, tex[1]);
+ rmesa->hw.tex[1].cmd[TEX_PP_TXFORMAT] &= ~0x08000000;
+ }
+ }
+#endif
+
+#if 1
+ /*
+ * Texture cache LRU hang workaround -------------
+ */
+ dbg = 0x0;
+ if (((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_0_ENABLE) &&
+ ((((rmesa->hw.tex[0].cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK)) &
+ 0x04) == 0)))
+ {
+ dbg |= 0x02;
+ }
+
+ if (((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_1_ENABLE) &&
+ ((((rmesa->hw.tex[1].cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK)) &
+ 0x04) == 0)))
+ {
+ dbg |= 0x04;
+ }
+
+ if (dbg != rmesa->hw.tam.cmd[TAM_DEBUG3]) {
+ R200_STATECHANGE( rmesa, tam );
+ rmesa->hw.tam.cmd[TAM_DEBUG3] = dbg;
+ if (0) printf("TEXCACHE LRU HANG WORKAROUND %x\n", dbg);
+ }
+#endif
+}
+
+/*
+ also tests for higher texunits:
+
+ ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_2_ENABLE) &&
+ ((((rmesa->hw.tex[2].cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK)) & 0x04) == 0)) ||
+ ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_4_ENABLE) &&
+ ((((rmesa->hw.tex[4].cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK)) & 0x04) == 0)))
+
+ ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_3_ENABLE) &&
+ ((((rmesa->hw.tex[3].cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK)) & 0x04) == 0)) ||
+ ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_5_ENABLE) &&
+ ((((rmesa->hw.tex[5].cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK)) & 0x04) == 0)))
+
+*/
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.c b/xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.c
new file mode 100644
index 000000000..3d2ae138e
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.c
@@ -0,0 +1,1148 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "r200_context.h"
+#include "r200_state.h"
+#include "r200_ioctl.h"
+#include "r200_tex.h"
+#include "r200_tcl.h"
+#include "r200_vtxfmt.h"
+
+#include "api_noop.h"
+#include "api_arrayelt.h"
+#include "context.h"
+#include "mmath.h"
+#include "mtypes.h"
+#include "enums.h"
+#include "glapi.h"
+#include "colormac.h"
+#include "light.h"
+#include "state.h"
+#include "vtxfmt.h"
+
+#include "tnl/tnl.h"
+#include "tnl/t_context.h"
+#include "tnl/t_array_api.h"
+
+struct r200_vb vb;
+
+static void r200FlushVertices( GLcontext *, GLuint );
+
+static void count_func( const char *name, struct dynfn *l )
+{
+ int i = 0;
+ struct dynfn *f;
+ foreach (f, l) i++;
+ if (i) fprintf(stderr, "%s: %d\n", name, i );
+}
+
+static void count_funcs( r200ContextPtr rmesa )
+{
+ count_func( "Vertex2f", &rmesa->vb.dfn_cache.Vertex2f );
+ count_func( "Vertex2fv", &rmesa->vb.dfn_cache.Vertex2fv );
+ count_func( "Vertex3f", &rmesa->vb.dfn_cache.Vertex3f );
+ count_func( "Vertex3fv", &rmesa->vb.dfn_cache.Vertex3fv );
+ count_func( "Color4ub", &rmesa->vb.dfn_cache.Color4ub );
+ count_func( "Color4ubv", &rmesa->vb.dfn_cache.Color4ubv );
+ count_func( "Color3ub", &rmesa->vb.dfn_cache.Color3ub );
+ count_func( "Color3ubv", &rmesa->vb.dfn_cache.Color3ubv );
+ count_func( "Color4f", &rmesa->vb.dfn_cache.Color4f );
+ count_func( "Color4fv", &rmesa->vb.dfn_cache.Color4fv );
+ count_func( "Color3f", &rmesa->vb.dfn_cache.Color3f );
+ count_func( "Color3fv", &rmesa->vb.dfn_cache.Color3fv );
+ count_func( "SecondaryColor3f", &rmesa->vb.dfn_cache.SecondaryColor3fEXT );
+ count_func( "SecondaryColor3fv", &rmesa->vb.dfn_cache.SecondaryColor3fvEXT );
+ count_func( "SecondaryColor3ub", &rmesa->vb.dfn_cache.SecondaryColor3ubEXT );
+ count_func( "SecondaryColor3ubv", &rmesa->vb.dfn_cache.SecondaryColor3ubvEXT );
+ count_func( "Normal3f", &rmesa->vb.dfn_cache.Normal3f );
+ count_func( "Normal3fv", &rmesa->vb.dfn_cache.Normal3fv );
+ count_func( "TexCoord2f", &rmesa->vb.dfn_cache.TexCoord2f );
+ count_func( "TexCoord2fv", &rmesa->vb.dfn_cache.TexCoord2fv );
+ count_func( "TexCoord1f", &rmesa->vb.dfn_cache.TexCoord1f );
+ count_func( "TexCoord1fv", &rmesa->vb.dfn_cache.TexCoord1fv );
+ count_func( "MultiTexCoord2fARB", &rmesa->vb.dfn_cache.MultiTexCoord2fARB );
+ count_func( "MultiTexCoord2fvARB", &rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
+ count_func( "MultiTexCoord1fARB", &rmesa->vb.dfn_cache.MultiTexCoord1fARB );
+ count_func( "MultiTexCoord1fvARB", &rmesa->vb.dfn_cache.MultiTexCoord1fvARB );
+}
+
+
+void r200_copy_to_current( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ assert(ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT);
+ assert(vb.context == ctx);
+
+ if (rmesa->vb.vtxfmt_0 & R200_VTX_N0) {
+ ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0] = vb.normalptr[0];
+ ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1] = vb.normalptr[1];
+ ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2] = vb.normalptr[2];
+ }
+
+ switch( VTX_COLOR(rmesa->vb.vtxfmt_0, 0) ) {
+ case R200_VTX_PK_RGBA:
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] = UBYTE_TO_FLOAT( vb.colorptr->red );
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] = UBYTE_TO_FLOAT( vb.colorptr->green );
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] = UBYTE_TO_FLOAT( vb.colorptr->blue );
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = UBYTE_TO_FLOAT( vb.colorptr->alpha );
+ break;
+
+ case R200_VTX_FP_RGB:
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] = vb.floatcolorptr[0];
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] = vb.floatcolorptr[1];
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] = vb.floatcolorptr[2];
+ break;
+
+ case R200_VTX_FP_RGBA:
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] = vb.floatcolorptr[0];
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] = vb.floatcolorptr[1];
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] = vb.floatcolorptr[2];
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = vb.floatcolorptr[3];
+ break;
+
+ default:
+ break;
+ }
+
+ if (VTX_COLOR(rmesa->vb.vtxfmt_0, 1) == R200_VTX_PK_RGBA) {
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0] = UBYTE_TO_FLOAT( vb.specptr->red );
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1] = UBYTE_TO_FLOAT( vb.specptr->green );
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2] = UBYTE_TO_FLOAT( vb.specptr->blue );
+ }
+
+ if (rmesa->vb.vtxfmt_1 & (7 << R200_VTX_TEX0_COMP_CNT_SHIFT)) {
+ ctx->Current.Attrib[VERT_ATTRIB_TEX0][0] = vb.texcoordptr[0][0];
+ ctx->Current.Attrib[VERT_ATTRIB_TEX0][1] = vb.texcoordptr[0][1];
+ ctx->Current.Attrib[VERT_ATTRIB_TEX0][2] = 0.0F;
+ ctx->Current.Attrib[VERT_ATTRIB_TEX0][3] = 1.0F;
+ }
+
+ if (rmesa->vb.vtxfmt_1 & (7 << R200_VTX_TEX1_COMP_CNT_SHIFT)) {
+ ctx->Current.Attrib[VERT_ATTRIB_TEX1][0] = vb.texcoordptr[1][0];
+ ctx->Current.Attrib[VERT_ATTRIB_TEX1][1] = vb.texcoordptr[1][1];
+ ctx->Current.Attrib[VERT_ATTRIB_TEX1][2] = 0.0F;
+ ctx->Current.Attrib[VERT_ATTRIB_TEX1][3] = 1.0F;
+ }
+
+ ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT;
+}
+
+static GLboolean discreet_gl_prim[GL_POLYGON+1] = {
+ 1, /* 0 points */
+ 1, /* 1 lines */
+ 0, /* 2 line_strip */
+ 0, /* 3 line_loop */
+ 1, /* 4 tris */
+ 0, /* 5 tri_fan */
+ 0, /* 6 tri_strip */
+ 1, /* 7 quads */
+ 0, /* 8 quadstrip */
+ 0, /* 9 poly */
+};
+
+static void flush_prims( r200ContextPtr rmesa )
+{
+ int i,j;
+ struct r200_dma_region tmp = rmesa->dma.current;
+
+ tmp.buf->refcount++;
+ tmp.aos_size = vb.vertex_size;
+ tmp.aos_stride = vb.vertex_size;
+ tmp.aos_start = GET_START(&tmp);
+
+ rmesa->dma.current.ptr = rmesa->dma.current.start +=
+ (vb.initial_counter - vb.counter) * vb.vertex_size * 4;
+
+ rmesa->tcl.vertex_format = rmesa->vb.vtxfmt_0;
+ rmesa->tcl.aos_components[0] = &tmp;
+ rmesa->tcl.nr_aos_components = 1;
+ rmesa->dma.flush = 0;
+
+ /* Optimize the primitive list:
+ */
+ if (rmesa->vb.nrprims > 1) {
+ for (j = 0, i = 1 ; i < rmesa->vb.nrprims; i++) {
+ int pj = rmesa->vb.primlist[j].prim & 0xf;
+ int pi = rmesa->vb.primlist[i].prim & 0xf;
+
+ if (pj == pi && discreet_gl_prim[pj] &&
+ rmesa->vb.primlist[i].start == rmesa->vb.primlist[j].end) {
+ rmesa->vb.primlist[j].end = rmesa->vb.primlist[i].end;
+ }
+ else {
+ j++;
+ if (j != i) rmesa->vb.primlist[j] = rmesa->vb.primlist[i];
+ }
+ }
+ rmesa->vb.nrprims = j+1;
+ }
+
+ if (rmesa->vb.vtxfmt_0 != rmesa->hw.vtx.cmd[VTX_VTXFMT_0] ||
+ rmesa->vb.vtxfmt_1 != rmesa->hw.vtx.cmd[VTX_VTXFMT_1]) {
+ R200_STATECHANGE( rmesa, vtx );
+ rmesa->hw.vtx.cmd[VTX_VTXFMT_0] = rmesa->vb.vtxfmt_0;
+ rmesa->hw.vtx.cmd[VTX_VTXFMT_1] = rmesa->vb.vtxfmt_1;
+ }
+
+
+ for (i = 0 ; i < rmesa->vb.nrprims; i++) {
+ if (R200_DEBUG & DEBUG_PRIMS)
+ fprintf(stderr, "vtxfmt prim %d: %s %d..%d\n", i,
+ _mesa_lookup_enum_by_nr( rmesa->vb.primlist[i].prim &
+ PRIM_MODE_MASK ),
+ rmesa->vb.primlist[i].start,
+ rmesa->vb.primlist[i].end);
+
+ if (rmesa->vb.primlist[i].start < rmesa->vb.primlist[i].end)
+ r200EmitPrimitive( vb.context,
+ rmesa->vb.primlist[i].start,
+ rmesa->vb.primlist[i].end,
+ rmesa->vb.primlist[i].prim );
+ }
+
+ rmesa->vb.nrprims = 0;
+ r200ReleaseDmaRegion( rmesa, &tmp, __FUNCTION__ );
+}
+
+
+static void start_prim( r200ContextPtr rmesa, GLuint mode )
+{
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s %d\n", __FUNCTION__, vb.initial_counter - vb.counter);
+
+ rmesa->vb.primlist[rmesa->vb.nrprims].start = vb.initial_counter - vb.counter;
+ rmesa->vb.primlist[rmesa->vb.nrprims].prim = mode;
+}
+
+static void note_last_prim( r200ContextPtr rmesa, GLuint flags )
+{
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s %d\n", __FUNCTION__, vb.initial_counter - vb.counter);
+
+ if (rmesa->vb.prim[0] != GL_POLYGON+1) {
+ rmesa->vb.primlist[rmesa->vb.nrprims].prim |= flags;
+ rmesa->vb.primlist[rmesa->vb.nrprims].end = vb.initial_counter - vb.counter;
+
+ if (++(rmesa->vb.nrprims) == R200_MAX_PRIMS)
+ flush_prims( rmesa );
+ }
+}
+
+
+static void copy_vertex( r200ContextPtr rmesa, GLuint n, GLfloat *dst )
+{
+ GLuint i;
+ GLfloat *src = (GLfloat *)(rmesa->dma.current.address +
+ rmesa->dma.current.ptr +
+ (rmesa->vb.primlist[rmesa->vb.nrprims].start + n) *
+ vb.vertex_size * 4);
+
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "copy_vertex %d\n", rmesa->vb.primlist[rmesa->vb.nrprims].start + n);
+
+ for (i = 0 ; i < vb.vertex_size; i++) {
+ dst[i] = src[i];
+ }
+}
+
+/* NOTE: This actually reads the copied vertices back from uncached
+ * memory. Could also use the counter/notify mechanism to populate
+ * tmp on the fly as vertices are generated.
+ */
+static GLuint copy_dma_verts( r200ContextPtr rmesa, GLfloat (*tmp)[15] )
+{
+ GLuint ovf, i;
+ GLuint nr = (vb.initial_counter - vb.counter) - rmesa->vb.primlist[rmesa->vb.nrprims].start;
+
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s %d verts\n", __FUNCTION__, nr);
+
+ switch( rmesa->vb.prim[0] )
+ {
+ case GL_POINTS:
+ return 0;
+ case GL_LINES:
+ ovf = nr&1;
+ for (i = 0 ; i < ovf ; i++)
+ copy_vertex( rmesa, nr-ovf+i, tmp[i] );
+ return i;
+ case GL_TRIANGLES:
+ ovf = nr%3;
+ for (i = 0 ; i < ovf ; i++)
+ copy_vertex( rmesa, nr-ovf+i, tmp[i] );
+ return i;
+ case GL_QUADS:
+ ovf = nr&3;
+ for (i = 0 ; i < ovf ; i++)
+ copy_vertex( rmesa, nr-ovf+i, tmp[i] );
+ return i;
+ case GL_LINE_STRIP:
+ if (nr == 0)
+ return 0;
+ copy_vertex( rmesa, nr-1, tmp[0] );
+ return 1;
+ case GL_LINE_LOOP:
+ case GL_TRIANGLE_FAN:
+ case GL_POLYGON:
+ if (nr == 0)
+ return 0;
+ else if (nr == 1) {
+ copy_vertex( rmesa, 0, tmp[0] );
+ return 1;
+ } else {
+ copy_vertex( rmesa, 0, tmp[0] );
+ copy_vertex( rmesa, nr-1, tmp[1] );
+ return 2;
+ }
+ case GL_TRIANGLE_STRIP:
+ ovf = MIN2( nr-1, 2 );
+ for (i = 0 ; i < ovf ; i++)
+ copy_vertex( rmesa, nr-ovf+i, tmp[i] );
+ return i;
+ case GL_QUAD_STRIP:
+ ovf = MIN2( nr-1, 2 );
+ if (nr > 2) ovf += nr&1;
+ for (i = 0 ; i < ovf ; i++)
+ copy_vertex( rmesa, nr-ovf+i, tmp[i] );
+ return i;
+ default:
+ assert(0);
+ return 0;
+ }
+}
+
+static void VFMT_FALLBACK_OUTSIDE_BEGIN_END( const char *caller )
+{
+ GLcontext *ctx = vb.context;
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if (R200_DEBUG & (DEBUG_VFMT|DEBUG_FALLBACKS))
+ fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
+
+ if (ctx->Driver.NeedFlush)
+ r200FlushVertices( ctx, ctx->Driver.NeedFlush );
+
+ if (ctx->NewState)
+ _mesa_update_state( ctx ); /* clear state so fell_back sticks */
+
+ _tnl_wakeup_exec( ctx );
+
+ assert( rmesa->dma.flush == 0 );
+ rmesa->vb.fell_back = GL_TRUE;
+ rmesa->vb.installed = GL_FALSE;
+/* vb.context = 0; */
+}
+
+
+static void VFMT_FALLBACK( const char *caller )
+{
+ GLcontext *ctx = vb.context;
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLfloat tmp[3][15];
+ GLuint i, prim;
+ GLuint ind0 = rmesa->vb.vtxfmt_0;
+ GLuint ind1 = rmesa->vb.vtxfmt_1;
+ GLuint nrverts;
+ GLfloat alpha = 1.0;
+
+ if (R200_DEBUG & (DEBUG_FALLBACKS|DEBUG_VFMT))
+ fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
+
+ if (rmesa->vb.prim[0] == GL_POLYGON+1) {
+ VFMT_FALLBACK_OUTSIDE_BEGIN_END( __FUNCTION__ );
+ return;
+ }
+
+ /* Copy vertices out of dma:
+ */
+ nrverts = copy_dma_verts( rmesa, tmp );
+
+ /* Finish the prim at this point:
+ */
+ note_last_prim( rmesa, 0 );
+ flush_prims( rmesa );
+
+ /* Update ctx->Driver.CurrentExecPrimitive and swap in swtnl.
+ */
+ prim = rmesa->vb.prim[0];
+ ctx->Driver.CurrentExecPrimitive = GL_POLYGON+1;
+ _tnl_wakeup_exec( ctx );
+
+ assert(rmesa->dma.flush == 0);
+ rmesa->vb.fell_back = GL_TRUE;
+ rmesa->vb.installed = GL_FALSE;
+ vb.context = 0;
+ glBegin( prim );
+
+ if (rmesa->vb.installed_color_3f_sz == 4)
+ alpha = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
+
+ /* Replay saved vertices
+ */
+ for (i = 0 ; i < nrverts; i++) {
+ GLuint offset = 3;
+ if (ind0 & R200_VTX_N0) {
+ glNormal3fv( &tmp[i][offset] );
+ offset += 3;
+ }
+
+ if (VTX_COLOR(ind0, 0) == R200_VTX_PK_RGBA) {
+ glColor4ubv( (GLubyte *)&tmp[i][offset] );
+ offset++;
+ }
+ else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGBA) {
+ glColor4fv( &tmp[i][offset] );
+ offset+=4;
+ }
+ else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGB) {
+ glColor3fv( &tmp[i][offset] );
+ offset+=3;
+ }
+
+ if (VTX_COLOR(ind0, 1) == R200_VTX_PK_RGBA) {
+ _glapi_Dispatch->SecondaryColor3ubvEXT( (GLubyte *)&tmp[i][offset] );
+ offset++;
+ }
+
+ if (ind1 & (7 << R200_VTX_TEX0_COMP_CNT_SHIFT)) {
+ glTexCoord2fv( &tmp[i][offset] );
+ offset += 2;
+ }
+
+ if (ind1 & (7 << R200_VTX_TEX1_COMP_CNT_SHIFT)) {
+ glMultiTexCoord2fvARB( GL_TEXTURE1_ARB, &tmp[i][offset] );
+ offset += 2;
+ }
+
+ glVertex3fv( &tmp[i][0] );
+ }
+
+ /* Replay current vertex
+ */
+ if (ind0 & R200_VTX_N0)
+ glNormal3fv( vb.normalptr );
+
+ if (VTX_COLOR(ind0, 0) == R200_VTX_PK_RGBA)
+ glColor4ub( vb.colorptr->red, vb.colorptr->green, vb.colorptr->blue, vb.colorptr->alpha );
+ else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGBA)
+ glColor4fv( vb.floatcolorptr );
+ else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGB) {
+ if (rmesa->vb.installed_color_3f_sz == 4 && alpha != 1.0)
+ glColor4f( vb.floatcolorptr[0],
+ vb.floatcolorptr[1],
+ vb.floatcolorptr[2],
+ alpha );
+ else
+ glColor3fv( vb.floatcolorptr );
+ }
+
+ if (VTX_COLOR(ind0, 1) == R200_VTX_PK_RGBA)
+ _glapi_Dispatch->SecondaryColor3ubEXT( vb.specptr->red, vb.specptr->green, vb.specptr->blue );
+
+ if (ind1 & (7 << R200_VTX_TEX0_COMP_CNT_SHIFT))
+ glTexCoord2fv( vb.texcoordptr[0] );
+
+ if (ind1 & (7 << R200_VTX_TEX1_COMP_CNT_SHIFT))
+ glMultiTexCoord2fvARB( GL_TEXTURE1_ARB, vb.texcoordptr[1] );
+}
+
+
+
+static void wrap_buffer( void )
+{
+ GLcontext *ctx = vb.context;
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLfloat tmp[3][15];
+ GLuint i, nrverts;
+
+ if (R200_DEBUG & (DEBUG_VFMT|DEBUG_PRIMS))
+ fprintf(stderr, "%s %d\n", __FUNCTION__, vb.initial_counter - vb.counter);
+
+ /* Don't deal with parity.
+ */
+ if ((((vb.initial_counter - vb.counter) -
+ rmesa->vb.primlist[rmesa->vb.nrprims].start) & 1)) {
+ vb.counter++;
+ vb.initial_counter++;
+ return;
+ }
+
+ /* Copy vertices out of dma:
+ */
+ if (rmesa->vb.prim[0] == GL_POLYGON+1)
+ nrverts = 0;
+ else {
+ nrverts = copy_dma_verts( rmesa, tmp );
+
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%d vertices to copy\n", nrverts);
+
+ /* Finish the prim at this point:
+ */
+ note_last_prim( rmesa, 0 );
+ }
+
+ /* Fire any buffered primitives
+ */
+ flush_prims( rmesa );
+
+ /* Get new buffer
+ */
+ r200RefillCurrentDmaRegion( rmesa );
+
+ /* Reset counter, dmaptr
+ */
+ vb.dmaptr = (int *)(rmesa->dma.current.ptr + rmesa->dma.current.address);
+ vb.counter = (rmesa->dma.current.end - rmesa->dma.current.ptr) /
+ (vb.vertex_size * 4);
+ vb.counter--;
+ vb.initial_counter = vb.counter;
+ vb.notify = wrap_buffer;
+
+ rmesa->dma.flush = flush_prims;
+
+ /* Restart wrapped primitive:
+ */
+ if (rmesa->vb.prim[0] != GL_POLYGON+1)
+ start_prim( rmesa, rmesa->vb.prim[0] );
+
+
+ /* Reemit saved vertices
+ */
+ for (i = 0 ; i < nrverts; i++) {
+ if (R200_DEBUG & DEBUG_VERTS) {
+ int j;
+ fprintf(stderr, "re-emit vertex %d to %p\n", i, vb.dmaptr);
+ if (R200_DEBUG & DEBUG_VERBOSE)
+ for (j = 0 ; j < vb.vertex_size; j++)
+ fprintf(stderr, "\t%08x/%f\n", *(int*)&tmp[i][j], tmp[i][j]);
+ }
+
+ memcpy( vb.dmaptr, tmp[i], vb.vertex_size * 4 );
+ vb.dmaptr += vb.vertex_size;
+ vb.counter--;
+ }
+}
+
+
+
+static GLboolean check_vtx_fmt( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLuint ind0 = R200_VTX_Z0;
+ GLuint ind1 = 0;
+
+ if (rmesa->TclFallback || rmesa->vb.fell_back || ctx->CompileFlag)
+ return GL_FALSE;
+
+ if (!_glapi_Context)
+ return GL_FALSE;
+
+ if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT)
+ ctx->Driver.FlushVertices( ctx, FLUSH_UPDATE_CURRENT );
+
+ /* Make all this event-driven:
+ */
+ if (ctx->Light.Enabled) {
+ ind0 |= R200_VTX_N0;
+
+ /* TODO: make this data driven: If we receive only ubytes, send
+ * color as ubytes. Also check if converting (with free
+ * checking for overflow) is cheaper than sending floats
+ * directly.
+ */
+ if (ctx->Light.ColorMaterialEnabled) {
+ if (1 || ctx->Color.AlphaEnabled)
+ ind0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT;
+ else
+ ind0 |= R200_VTX_FP_RGB << R200_VTX_COLOR_0_SHIFT;
+ }
+ }
+ else {
+ /* TODO: make this data driven?
+ */
+ ind0 |= R200_VTX_PK_RGBA << R200_VTX_COLOR_0_SHIFT;
+
+ if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
+ ind0 |= R200_VTX_PK_RGBA << R200_VTX_COLOR_1_SHIFT;
+ }
+ }
+
+ if (ctx->Texture.Unit[0]._ReallyEnabled) {
+ if (ctx->Texture.Unit[0].TexGenEnabled) {
+ if (rmesa->TexGenNeedNormals[0]) {
+ ind0 |= R200_VTX_N0;
+ }
+ } else {
+ if (ctx->Current.Attrib[VERT_ATTRIB_TEX0][2] != 0.0F ||
+ ctx->Current.Attrib[VERT_ATTRIB_TEX0][3] != 1.0) {
+ if (R200_DEBUG & (DEBUG_VFMT|DEBUG_FALLBACKS))
+ fprintf(stderr, "%s: rq0\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+ ind1 |= 2 << R200_VTX_TEX0_COMP_CNT_SHIFT;
+ }
+ }
+
+ if (ctx->Texture.Unit[1]._ReallyEnabled) {
+ if (ctx->Texture.Unit[1].TexGenEnabled) {
+ if (rmesa->TexGenNeedNormals[1]) {
+ ind0 |= R200_VTX_N0;
+ }
+ } else {
+ if (ctx->Current.Attrib[VERT_ATTRIB_TEX1][2] != 0.0F ||
+ ctx->Current.Attrib[VERT_ATTRIB_TEX1][3] != 1.0) {
+ if (R200_DEBUG & (DEBUG_VFMT|DEBUG_FALLBACKS))
+ fprintf(stderr, "%s: rq1\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+ ind1 |= 2 << R200_VTX_TEX1_COMP_CNT_SHIFT;
+ }
+ }
+
+ if (R200_DEBUG & (DEBUG_VFMT|DEBUG_STATE))
+ fprintf(stderr, "%s: format: 0x%x, 0x%x\n", __FUNCTION__, ind0, ind1 );
+
+ R200_NEWPRIM(rmesa);
+ rmesa->vb.vtxfmt_0 = ind0;
+ rmesa->vb.vtxfmt_1 = ind1;
+ rmesa->vb.prim = &ctx->Driver.CurrentExecPrimitive;
+
+ vb.vertex_size = 3;
+ vb.normalptr = ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
+ vb.colorptr = NULL;
+ vb.floatcolorptr = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
+ vb.specptr = NULL;
+ vb.floatspecptr = ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
+ vb.texcoordptr[0] = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
+ vb.texcoordptr[1] = ctx->Current.Attrib[VERT_ATTRIB_TEX1];
+
+ /* Run through and initialize the vertex components in the order
+ * the hardware understands:
+ */
+ if (ind0 & R200_VTX_N0) {
+ vb.normalptr = &vb.vertex[vb.vertex_size].f;
+ vb.vertex_size += 3;
+ vb.normalptr[0] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0];
+ vb.normalptr[1] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1];
+ vb.normalptr[2] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2];
+ }
+
+ if (VTX_COLOR(ind0, 0) == R200_VTX_PK_RGBA) {
+ vb.colorptr = &vb.vertex[vb.vertex_size].color;
+ vb.vertex_size += 1;
+ UNCLAMPED_FLOAT_TO_CHAN( vb.colorptr->red, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] );
+ UNCLAMPED_FLOAT_TO_CHAN( vb.colorptr->green, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] );
+ UNCLAMPED_FLOAT_TO_CHAN( vb.colorptr->blue, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] );
+ UNCLAMPED_FLOAT_TO_CHAN( vb.colorptr->alpha, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] );
+ }
+ else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGBA) {
+ vb.floatcolorptr = &vb.vertex[vb.vertex_size].f;
+ vb.vertex_size += 4;
+ vb.floatcolorptr[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0];
+ vb.floatcolorptr[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1];
+ vb.floatcolorptr[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2];
+ vb.floatcolorptr[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
+ }
+ else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGB) {
+ vb.floatcolorptr = &vb.vertex[vb.vertex_size].f;
+ vb.vertex_size += 3;
+ vb.floatcolorptr[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0];
+ vb.floatcolorptr[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1];
+ vb.floatcolorptr[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2];
+ }
+
+ if (VTX_COLOR(ind0, 1) == R200_VTX_PK_RGBA) {
+ vb.specptr = &vb.vertex[vb.vertex_size].color;
+ vb.vertex_size += 1;
+ UNCLAMPED_FLOAT_TO_CHAN( vb.specptr->red, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0] );
+ UNCLAMPED_FLOAT_TO_CHAN( vb.specptr->green, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1] );
+ UNCLAMPED_FLOAT_TO_CHAN( vb.specptr->blue, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2] );
+ }
+
+
+ if (ind1 & (7 << R200_VTX_TEX0_COMP_CNT_SHIFT)) {
+ vb.texcoordptr[0] = &vb.vertex[vb.vertex_size].f;
+ vb.vertex_size += 2;
+ vb.texcoordptr[0][0] = ctx->Current.Attrib[VERT_ATTRIB_TEX0][0];
+ vb.texcoordptr[0][1] = ctx->Current.Attrib[VERT_ATTRIB_TEX0][1];
+ }
+
+ if (ind1 & (7 << R200_VTX_TEX1_COMP_CNT_SHIFT)) {
+ vb.texcoordptr[1] = &vb.vertex[vb.vertex_size].f;
+ vb.vertex_size += 2;
+ vb.texcoordptr[1][0] = ctx->Current.Attrib[VERT_ATTRIB_TEX1][0];
+ vb.texcoordptr[1][1] = ctx->Current.Attrib[VERT_ATTRIB_TEX1][1];
+ }
+
+ if (rmesa->vb.installed_vertex_format != rmesa->vb.vtxfmt_0) {
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "reinstall on vertex_format change\n");
+ _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt );
+ rmesa->vb.installed_vertex_format = rmesa->vb.vtxfmt_0;
+ }
+
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s -- success\n", __FUNCTION__);
+
+ return GL_TRUE;
+}
+
+
+void r200VtxfmtInvalidate( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+
+ rmesa->vb.recheck = GL_TRUE;
+ rmesa->vb.fell_back = GL_FALSE;
+}
+
+
+static void r200NewList( GLcontext *ctx, GLuint list, GLenum mode )
+{
+ VFMT_FALLBACK_OUTSIDE_BEGIN_END( __FUNCTION__ );
+}
+
+
+static void r200VtxfmtValidate( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ if (ctx->Driver.NeedFlush)
+ ctx->Driver.FlushVertices( ctx, ctx->Driver.NeedFlush );
+
+ rmesa->vb.recheck = GL_FALSE;
+
+ if (check_vtx_fmt( ctx )) {
+ if (!rmesa->vb.installed) {
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "reinstall (new install)\n");
+
+ _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt );
+ ctx->Driver.FlushVertices = r200FlushVertices;
+ ctx->Driver.NewList = r200NewList;
+ rmesa->vb.installed = GL_TRUE;
+ vb.context = ctx;
+ }
+ else if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s: already installed", __FUNCTION__);
+ }
+ else {
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s: failed\n", __FUNCTION__);
+
+ if (rmesa->vb.installed) {
+ if (rmesa->dma.flush)
+ rmesa->dma.flush( rmesa );
+ _tnl_wakeup_exec( ctx );
+ rmesa->vb.installed = GL_FALSE;
+ vb.context = 0;
+ }
+ }
+}
+
+
+
+/* Materials:
+ */
+static void r200_Materialfv( GLenum face, GLenum pname,
+ const GLfloat *params )
+{
+ GLcontext *ctx = vb.context;
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ if (rmesa->vb.prim[0] != GL_POLYGON+1) {
+ VFMT_FALLBACK( __FUNCTION__ );
+ glMaterialfv( face, pname, params );
+ return;
+ }
+ _mesa_noop_Materialfv( face, pname, params );
+ r200UpdateMaterial( vb.context );
+}
+
+
+/* Begin/End
+ */
+static void r200_Begin( GLenum mode )
+{
+ GLcontext *ctx = vb.context;
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s( %s )\n", __FUNCTION__,
+ _mesa_lookup_enum_by_nr( mode ));
+
+ if (mode > GL_POLYGON) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glBegin" );
+ return;
+ }
+
+ if (rmesa->vb.prim[0] != GL_POLYGON+1) {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glBegin" );
+ return;
+ }
+
+ if (ctx->NewState)
+ _mesa_update_state( ctx );
+
+ if (rmesa->NewGLState)
+ r200ValidateState( ctx );
+
+ if (rmesa->vb.recheck)
+ r200VtxfmtValidate( ctx );
+
+ if (!rmesa->vb.installed) {
+ glBegin( mode );
+ return;
+ }
+
+
+ if (rmesa->dma.flush && vb.counter < 12) {
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s: flush almost-empty buffers\n", __FUNCTION__);
+ flush_prims( rmesa );
+ }
+
+ /* Need to arrange to save vertices here? Or always copy from dma (yuk)?
+ */
+ if (!rmesa->dma.flush) {
+ if (rmesa->dma.current.ptr + 12*vb.vertex_size*4 >
+ rmesa->dma.current.end) {
+ R200_NEWPRIM( rmesa );
+ r200RefillCurrentDmaRegion( rmesa );
+ }
+
+ vb.dmaptr = (int *)(rmesa->dma.current.address + rmesa->dma.current.ptr);
+ vb.counter = (rmesa->dma.current.end - rmesa->dma.current.ptr) /
+ (vb.vertex_size * 4);
+ vb.counter--;
+ vb.initial_counter = vb.counter;
+ vb.notify = wrap_buffer;
+ rmesa->dma.flush = flush_prims;
+ vb.context->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
+ }
+
+
+ rmesa->vb.prim[0] = mode;
+ start_prim( rmesa, mode | PRIM_BEGIN );
+}
+
+
+
+static void r200_End( void )
+{
+ GLcontext *ctx = vb.context;
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ if (rmesa->vb.prim[0] == GL_POLYGON+1) {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" );
+ return;
+ }
+
+ note_last_prim( rmesa, PRIM_END );
+ rmesa->vb.prim[0] = GL_POLYGON+1;
+}
+
+
+/* Fallback on difficult entrypoints:
+ */
+#define PRE_LOOPBACK( FUNC ) \
+do { \
+ if (R200_DEBUG & DEBUG_VFMT) \
+ fprintf(stderr, "%s\n", __FUNCTION__); \
+ VFMT_FALLBACK( __FUNCTION__ ); \
+} while (0)
+#define TAG(x) r200_fallback_##x
+#include "vtxfmt_tmp.h"
+
+
+
+static GLboolean r200NotifyBegin( GLcontext *ctx, GLenum p )
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ assert(!rmesa->vb.installed);
+
+ if (ctx->NewState)
+ _mesa_update_state( ctx );
+
+ if (rmesa->NewGLState)
+ r200ValidateState( ctx );
+
+ if (ctx->Driver.NeedFlush)
+ ctx->Driver.FlushVertices( ctx, ctx->Driver.NeedFlush );
+
+ if (rmesa->vb.recheck)
+ r200VtxfmtValidate( ctx );
+
+ if (!rmesa->vb.installed) {
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s -- failed\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
+ r200_Begin( p );
+ return GL_TRUE;
+}
+
+static void r200FlushVertices( GLcontext *ctx, GLuint flags )
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ assert(rmesa->vb.installed);
+ assert(vb.context == ctx);
+
+ if (flags & FLUSH_UPDATE_CURRENT) {
+ r200_copy_to_current( ctx );
+ if (R200_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "reinstall on update_current\n");
+ _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt );
+ ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT;
+ }
+
+ if (flags & FLUSH_STORED_VERTICES) {
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+ assert (rmesa->dma.flush == 0 ||
+ rmesa->dma.flush == flush_prims);
+ if (rmesa->dma.flush == flush_prims)
+ flush_prims( R200_CONTEXT( ctx ) );
+ ctx->Driver.NeedFlush &= ~FLUSH_STORED_VERTICES;
+ }
+}
+
+
+
+/* At this point, don't expect very many versions of each function to
+ * be generated, so not concerned about freeing them?
+ */
+
+
+void r200VtxfmtInit( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+ GLvertexformat *vfmt = &(rmesa->vb.vtxfmt);
+
+ MEMSET( vfmt, 0, sizeof(GLvertexformat) );
+
+ /* Hook in chooser functions for codegen, etc:
+ */
+ r200VtxfmtInitChoosers( vfmt );
+
+ /* Handled fully in supported states, but no codegen:
+ */
+ vfmt->Materialfv = r200_Materialfv;
+ vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */
+ vfmt->Rectf = _mesa_noop_Rectf; /* generic helper */
+ vfmt->Begin = r200_Begin;
+ vfmt->End = r200_End;
+
+ /* Fallback for performance reasons: (Fix with cva/elt path here and
+ * dmatmp2.h style primitive-merging)
+ *
+ * These should call NotifyBegin(), as should _tnl_EvalMesh, to allow
+ * a driver-hook.
+ */
+ vfmt->DrawArrays = r200_fallback_DrawArrays;
+ vfmt->DrawElements = r200_fallback_DrawElements;
+ vfmt->DrawRangeElements = r200_fallback_DrawRangeElements;
+
+
+ /* Not active in supported states; just keep ctx->Current uptodate:
+ */
+ vfmt->FogCoordfvEXT = _mesa_noop_FogCoordfvEXT;
+ vfmt->FogCoordfEXT = _mesa_noop_FogCoordfEXT;
+ vfmt->EdgeFlag = _mesa_noop_EdgeFlag;
+ vfmt->EdgeFlagv = _mesa_noop_EdgeFlagv;
+ vfmt->Indexi = _mesa_noop_Indexi;
+ vfmt->Indexiv = _mesa_noop_Indexiv;
+
+
+ /* Active but unsupported -- fallback if we receive these:
+ */
+ vfmt->CallList = r200_fallback_CallList;
+ vfmt->EvalCoord1f = r200_fallback_EvalCoord1f;
+ vfmt->EvalCoord1fv = r200_fallback_EvalCoord1fv;
+ vfmt->EvalCoord2f = r200_fallback_EvalCoord2f;
+ vfmt->EvalCoord2fv = r200_fallback_EvalCoord2fv;
+ vfmt->EvalMesh1 = r200_fallback_EvalMesh1;
+ vfmt->EvalMesh2 = r200_fallback_EvalMesh2;
+ vfmt->EvalPoint1 = r200_fallback_EvalPoint1;
+ vfmt->EvalPoint2 = r200_fallback_EvalPoint2;
+ vfmt->TexCoord3f = r200_fallback_TexCoord3f;
+ vfmt->TexCoord3fv = r200_fallback_TexCoord3fv;
+ vfmt->TexCoord4f = r200_fallback_TexCoord4f;
+ vfmt->TexCoord4fv = r200_fallback_TexCoord4fv;
+ vfmt->MultiTexCoord3fARB = r200_fallback_MultiTexCoord3fARB;
+ vfmt->MultiTexCoord3fvARB = r200_fallback_MultiTexCoord3fvARB;
+ vfmt->MultiTexCoord4fARB = r200_fallback_MultiTexCoord4fARB;
+ vfmt->MultiTexCoord4fvARB = r200_fallback_MultiTexCoord4fvARB;
+ vfmt->Vertex4f = r200_fallback_Vertex4f;
+ vfmt->Vertex4fv = r200_fallback_Vertex4fv;
+
+ (void)r200_fallback_vtxfmt;
+
+ TNL_CONTEXT(ctx)->Driver.NotifyBegin = r200NotifyBegin;
+
+ vb.context = ctx;
+ rmesa->vb.enabled = 1;
+ rmesa->vb.prim = &ctx->Driver.CurrentExecPrimitive;
+ rmesa->vb.primflags = 0;
+
+ make_empty_list( &rmesa->vb.dfn_cache.Vertex2f );
+ make_empty_list( &rmesa->vb.dfn_cache.Vertex2fv );
+ make_empty_list( &rmesa->vb.dfn_cache.Vertex3f );
+ make_empty_list( &rmesa->vb.dfn_cache.Vertex3fv );
+ make_empty_list( &rmesa->vb.dfn_cache.Color4ub );
+ make_empty_list( &rmesa->vb.dfn_cache.Color4ubv );
+ make_empty_list( &rmesa->vb.dfn_cache.Color3ub );
+ make_empty_list( &rmesa->vb.dfn_cache.Color3ubv );
+ make_empty_list( &rmesa->vb.dfn_cache.Color4f );
+ make_empty_list( &rmesa->vb.dfn_cache.Color4fv );
+ make_empty_list( &rmesa->vb.dfn_cache.Color3f );
+ make_empty_list( &rmesa->vb.dfn_cache.Color3fv );
+ make_empty_list( &rmesa->vb.dfn_cache.SecondaryColor3fEXT );
+ make_empty_list( &rmesa->vb.dfn_cache.SecondaryColor3fvEXT );
+ make_empty_list( &rmesa->vb.dfn_cache.SecondaryColor3ubEXT );
+ make_empty_list( &rmesa->vb.dfn_cache.SecondaryColor3ubvEXT );
+ make_empty_list( &rmesa->vb.dfn_cache.Normal3f );
+ make_empty_list( &rmesa->vb.dfn_cache.Normal3fv );
+ make_empty_list( &rmesa->vb.dfn_cache.TexCoord2f );
+ make_empty_list( &rmesa->vb.dfn_cache.TexCoord2fv );
+ make_empty_list( &rmesa->vb.dfn_cache.TexCoord1f );
+ make_empty_list( &rmesa->vb.dfn_cache.TexCoord1fv );
+ make_empty_list( &rmesa->vb.dfn_cache.MultiTexCoord2fARB );
+ make_empty_list( &rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
+ make_empty_list( &rmesa->vb.dfn_cache.MultiTexCoord1fARB );
+ make_empty_list( &rmesa->vb.dfn_cache.MultiTexCoord1fvARB );
+
+ r200InitCodegen( &rmesa->vb.codegen );
+}
+
+static void free_funcs( struct dynfn *l )
+{
+ struct dynfn *f, *tmp;
+ foreach_s (f, tmp, l) {
+ remove_from_list( f );
+ ALIGN_FREE( f->code );
+ FREE( f );
+ }
+}
+
+void r200VtxfmtUnbindContext( GLcontext *ctx )
+{
+ if (R200_CONTEXT(ctx)->vb.installed) {
+ assert(vb.context == ctx);
+ VFMT_FALLBACK_OUTSIDE_BEGIN_END( __FUNCTION__ );
+ }
+
+ TNL_CONTEXT(ctx)->Driver.NotifyBegin = 0;
+}
+
+
+void r200VtxfmtMakeCurrent( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+
+#if defined(THREADS)
+ /* Insider knowledge: this value is zero when multithreading has
+ * been detected.
+ */
+ if (_glapi_Context == 0) {
+ if (R200_DEBUG & (DEBUG_DRI|DEBUG_VFMT))
+ fprintf(stderr, "**** Multithreading: disabling vtxfmt!\n");
+ TNL_CONTEXT(ctx)->Driver.NotifyBegin = 0;
+ return;
+ }
+#endif
+
+ if (rmesa->vb.enabled) {
+ TNL_CONTEXT(ctx)->Driver.NotifyBegin = r200NotifyBegin;
+ }
+}
+
+
+void r200VtxfmtDestroy( GLcontext *ctx )
+{
+ r200ContextPtr rmesa = R200_CONTEXT( ctx );
+
+ count_funcs( rmesa );
+ free_funcs( &rmesa->vb.dfn_cache.Vertex2f );
+ free_funcs( &rmesa->vb.dfn_cache.Vertex2fv );
+ free_funcs( &rmesa->vb.dfn_cache.Vertex3f );
+ free_funcs( &rmesa->vb.dfn_cache.Vertex3fv );
+ free_funcs( &rmesa->vb.dfn_cache.Color4ub );
+ free_funcs( &rmesa->vb.dfn_cache.Color4ubv );
+ free_funcs( &rmesa->vb.dfn_cache.Color3ub );
+ free_funcs( &rmesa->vb.dfn_cache.Color3ubv );
+ free_funcs( &rmesa->vb.dfn_cache.Color4f );
+ free_funcs( &rmesa->vb.dfn_cache.Color4fv );
+ free_funcs( &rmesa->vb.dfn_cache.Color3f );
+ free_funcs( &rmesa->vb.dfn_cache.Color3fv );
+ free_funcs( &rmesa->vb.dfn_cache.SecondaryColor3ubEXT );
+ free_funcs( &rmesa->vb.dfn_cache.SecondaryColor3ubvEXT );
+ free_funcs( &rmesa->vb.dfn_cache.SecondaryColor3fEXT );
+ free_funcs( &rmesa->vb.dfn_cache.SecondaryColor3fvEXT );
+ free_funcs( &rmesa->vb.dfn_cache.Normal3f );
+ free_funcs( &rmesa->vb.dfn_cache.Normal3fv );
+ free_funcs( &rmesa->vb.dfn_cache.TexCoord2f );
+ free_funcs( &rmesa->vb.dfn_cache.TexCoord2fv );
+ free_funcs( &rmesa->vb.dfn_cache.TexCoord1f );
+ free_funcs( &rmesa->vb.dfn_cache.TexCoord1fv );
+ free_funcs( &rmesa->vb.dfn_cache.MultiTexCoord2fARB );
+ free_funcs( &rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
+ free_funcs( &rmesa->vb.dfn_cache.MultiTexCoord1fARB );
+ free_funcs( &rmesa->vb.dfn_cache.MultiTexCoord1fvARB );
+}
+
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.h b/xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.h
new file mode 100644
index 000000000..abc34c9ca
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.h
@@ -0,0 +1,128 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#ifndef __R200_VTXFMT_H__
+#define __R200_VTXFMT_H__
+
+#ifdef GLX_DIRECT_RENDERING
+
+#include "r200_context.h"
+
+
+
+extern struct r200_vb vb;
+
+
+extern void r200VtxfmtUpdate( GLcontext *ctx );
+extern void r200VtxfmtInit( GLcontext *ctx );
+extern void r200VtxfmtInvalidate( GLcontext *ctx );
+extern void r200VtxfmtDestroy( GLcontext *ctx );
+extern void r200VtxfmtInitChoosers( GLvertexformat *vfmt );
+
+extern void r200VtxfmtMakeCurrent( GLcontext *ctx );
+extern void r200VtxfmtUnbindContext( GLcontext *ctx );
+
+extern void r200_copy_to_current( GLcontext *ctx );
+
+#define DFN( FUNC, CACHE) \
+do { \
+ char *start = (char *)&FUNC; \
+ char *end = (char *)&FUNC##_end; \
+ insert_at_head( &CACHE, dfn ); \
+ dfn->key[0] = key[0]; \
+ dfn->key[1] = key[1]; \
+ dfn->code = ALIGN_MALLOC( end - start, 16 ); \
+ memcpy (dfn->code, start, end - start); \
+} \
+while ( 0 )
+
+#define FIXUP( CODE, OFFSET, CHECKVAL, NEWVAL ) \
+do { \
+ int *icode = (int *)(CODE+OFFSET); \
+ assert (*icode == CHECKVAL); \
+ *icode = (int)NEWVAL; \
+} while (0)
+
+
+/* Useful for figuring out the offsets:
+ */
+#define FIXUP2( CODE, OFFSET, CHECKVAL, NEWVAL ) \
+do { \
+ while (*(int *)(CODE+OFFSET) != CHECKVAL) OFFSET++; \
+ /*fprintf(stderr, "%s/%d CVAL %x OFFSET %d VAL %x\n", __FUNCTION__,*/ \
+ /* __LINE__, CHECKVAL, OFFSET, (int)(NEWVAL));*/ \
+ *(int *)(CODE+OFFSET) = (int)(NEWVAL); \
+ OFFSET += 4; \
+} while (0)
+
+/*
+ */
+void r200InitCodegen( struct dfn_generators *gen );
+void r200InitX86Codegen( struct dfn_generators *gen );
+void r200InitSSECodegen( struct dfn_generators *gen );
+
+
+
+/* Defined in r200_vtxfmt_x86.c
+ */
+struct dynfn *r200_makeX86Vertex2f( GLcontext *, const int * );
+struct dynfn *r200_makeX86Vertex2fv( GLcontext *, const int * );
+struct dynfn *r200_makeX86Vertex3f( GLcontext *, const int * );
+struct dynfn *r200_makeX86Vertex3fv( GLcontext *, const int * );
+struct dynfn *r200_makeX86Color4ub( GLcontext *, const int * );
+struct dynfn *r200_makeX86Color4ubv( GLcontext *, const int * );
+struct dynfn *r200_makeX86Color3ub( GLcontext *, const int * );
+struct dynfn *r200_makeX86Color3ubv( GLcontext *, const int * );
+struct dynfn *r200_makeX86Color4f( GLcontext *, const int * );
+struct dynfn *r200_makeX86Color4fv( GLcontext *, const int * );
+struct dynfn *r200_makeX86Color3f( GLcontext *, const int * );
+struct dynfn *r200_makeX86Color3fv( GLcontext *, const int * );
+struct dynfn *r200_makeX86SecondaryColor3ubEXT( GLcontext *, const int * );
+struct dynfn *r200_makeX86SecondaryColor3ubvEXT( GLcontext *, const int * );
+struct dynfn *r200_makeX86SecondaryColor3fEXT( GLcontext *, const int * );
+struct dynfn *r200_makeX86SecondaryColor3fvEXT( GLcontext *, const int * );
+struct dynfn *r200_makeX86Normal3f( GLcontext *, const int * );
+struct dynfn *r200_makeX86Normal3fv( GLcontext *, const int * );
+struct dynfn *r200_makeX86TexCoord2f( GLcontext *, const int * );
+struct dynfn *r200_makeX86TexCoord2fv( GLcontext *, const int * );
+struct dynfn *r200_makeX86TexCoord1f( GLcontext *, const int * );
+struct dynfn *r200_makeX86TexCoord1fv( GLcontext *, const int * );
+struct dynfn *r200_makeX86MultiTexCoord2fARB( GLcontext *, const int * );
+struct dynfn *r200_makeX86MultiTexCoord2fvARB( GLcontext *, const int * );
+struct dynfn *r200_makeX86MultiTexCoord1fARB( GLcontext *, const int * );
+struct dynfn *r200_makeX86MultiTexCoord1fvARB( GLcontext *, const int * );
+
+
+#endif
+#endif
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_c.c b/xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_c.c
new file mode 100644
index 000000000..3a01deb84
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_c.c
@@ -0,0 +1,797 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "mtypes.h"
+#include "colormac.h"
+#include "simple_list.h"
+#include "api_noop.h"
+#include "vtxfmt.h"
+
+#include "r200_vtxfmt.h"
+
+/* Fallback versions of all the entrypoints for situations where
+ * codegen isn't available. This is still a lot faster than the
+ * vb/pipeline implementation in Mesa.
+ */
+static void r200_Vertex3f( GLfloat x, GLfloat y, GLfloat z )
+{
+ int i;
+
+ *vb.dmaptr++ = *(int *)&x;
+ *vb.dmaptr++ = *(int *)&y;
+ *vb.dmaptr++ = *(int *)&z;
+
+ for (i = 3; i < vb.vertex_size; i++)
+ *vb.dmaptr++ = vb.vertex[i].i;
+
+ if (--vb.counter == 0)
+ vb.notify();
+}
+
+
+static void r200_Vertex3fv( const GLfloat *v )
+{
+ int i;
+
+ *vb.dmaptr++ = *(int *)&v[0];
+ *vb.dmaptr++ = *(int *)&v[1];
+ *vb.dmaptr++ = *(int *)&v[2];
+
+ for (i = 3; i < vb.vertex_size; i++)
+ *vb.dmaptr++ = vb.vertex[i].i;
+
+ if (--vb.counter == 0)
+ vb.notify();
+}
+
+
+static void r200_Vertex2f( GLfloat x, GLfloat y )
+{
+ int i;
+
+ *vb.dmaptr++ = *(int *)&x;
+ *vb.dmaptr++ = *(int *)&y;
+ *vb.dmaptr++ = 0;
+
+ for (i = 3; i < vb.vertex_size; i++)
+ *vb.dmaptr++ = vb.vertex[i].i;
+
+ if (--vb.counter == 0)
+ vb.notify();
+}
+
+
+static void r200_Vertex2fv( const GLfloat *v )
+{
+ int i;
+
+ *vb.dmaptr++ = *(int *)&v[0];
+ *vb.dmaptr++ = *(int *)&v[1];
+ *vb.dmaptr++ = 0;
+
+ for (i = 3; i < vb.vertex_size; i++)
+ *vb.dmaptr++ = vb.vertex[i].i;
+
+ if (--vb.counter == 0)
+ vb.notify();
+}
+
+
+
+/* Color for ubyte (packed) color formats:
+ */
+static void r200_Color3ub_ub( GLubyte r, GLubyte g, GLubyte b )
+{
+ r200_color_t *dest = vb.colorptr;
+ dest->red = r;
+ dest->green = g;
+ dest->blue = b;
+ dest->alpha = 0xff;
+}
+
+static void r200_Color3ubv_ub( const GLubyte *v )
+{
+ r200_color_t *dest = vb.colorptr;
+ dest->red = v[0];
+ dest->green = v[1];
+ dest->blue = v[2];
+ dest->alpha = 0xff;
+}
+
+static void r200_Color4ub_ub( GLubyte r, GLubyte g, GLubyte b, GLubyte a )
+{
+ r200_color_t *dest = vb.colorptr;
+ dest->red = r;
+ dest->green = g;
+ dest->blue = b;
+ dest->alpha = a;
+}
+
+static void r200_Color4ubv_ub( const GLubyte *v )
+{
+ *(GLuint *)vb.colorptr = LE32_TO_CPU(*(GLuint *)v);
+}
+
+
+static void r200_Color3f_ub( GLfloat r, GLfloat g, GLfloat b )
+{
+ r200_color_t *dest = vb.colorptr;
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->red, r );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->green, g );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, b );
+ dest->alpha = 255;
+}
+
+static void r200_Color3fv_ub( const GLfloat *v )
+{
+ r200_color_t *dest = vb.colorptr;
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->red, v[0] );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->green, v[1] );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, v[2] );
+ dest->alpha = 255;
+}
+
+static void r200_Color4f_ub( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
+{
+ r200_color_t *dest = vb.colorptr;
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->red, r );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->green, g );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, b );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->alpha, a );
+}
+
+static void r200_Color4fv_ub( const GLfloat *v )
+{
+ r200_color_t *dest = vb.colorptr;
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->red, v[0] );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->green, v[1] );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, v[2] );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->alpha, v[3] );
+}
+
+
+/* Color for float color+alpha formats:
+ */
+static void r200_Color3ub_4f( GLubyte r, GLubyte g, GLubyte b )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = UBYTE_TO_FLOAT(r);
+ dest[1] = UBYTE_TO_FLOAT(g);
+ dest[2] = UBYTE_TO_FLOAT(b);
+ dest[3] = 1.0;
+}
+
+static void r200_Color3ubv_4f( const GLubyte *v )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = UBYTE_TO_FLOAT(v[0]);
+ dest[1] = UBYTE_TO_FLOAT(v[1]);
+ dest[2] = UBYTE_TO_FLOAT(v[2]);
+ dest[3] = 1.0;
+}
+
+static void r200_Color4ub_4f( GLubyte r, GLubyte g, GLubyte b, GLubyte a )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = UBYTE_TO_FLOAT(r);
+ dest[1] = UBYTE_TO_FLOAT(g);
+ dest[2] = UBYTE_TO_FLOAT(b);
+ dest[3] = UBYTE_TO_FLOAT(a);
+}
+
+static void r200_Color4ubv_4f( const GLubyte *v )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = UBYTE_TO_FLOAT(v[0]);
+ dest[1] = UBYTE_TO_FLOAT(v[1]);
+ dest[2] = UBYTE_TO_FLOAT(v[2]);
+ dest[3] = UBYTE_TO_FLOAT(v[3]);
+}
+
+
+static void r200_Color3f_4f( GLfloat r, GLfloat g, GLfloat b )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = r;
+ dest[1] = g;
+ dest[2] = b;
+ dest[3] = 1.0;
+}
+
+static void r200_Color3fv_4f( const GLfloat *v )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = v[0];
+ dest[1] = v[1];
+ dest[2] = v[2];
+ dest[3] = 1.0;
+}
+
+static void r200_Color4f_4f( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = r;
+ dest[1] = g;
+ dest[2] = b;
+ dest[3] = a;
+}
+
+static void r200_Color4fv_4f( const GLfloat *v )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = v[0];
+ dest[1] = v[1];
+ dest[2] = v[2];
+ dest[3] = v[3];
+}
+
+
+/* Color for float color formats:
+ */
+static void r200_Color3ub_3f( GLubyte r, GLubyte g, GLubyte b )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = UBYTE_TO_FLOAT(r);
+ dest[1] = UBYTE_TO_FLOAT(g);
+ dest[2] = UBYTE_TO_FLOAT(b);
+}
+
+static void r200_Color3ubv_3f( const GLubyte *v )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = UBYTE_TO_FLOAT(v[0]);
+ dest[1] = UBYTE_TO_FLOAT(v[1]);
+ dest[2] = UBYTE_TO_FLOAT(v[2]);
+}
+
+static void r200_Color4ub_3f( GLubyte r, GLubyte g, GLubyte b, GLubyte a )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = UBYTE_TO_FLOAT(r);
+ dest[1] = UBYTE_TO_FLOAT(g);
+ dest[2] = UBYTE_TO_FLOAT(b);
+ vb.context->Current.Attrib[VERT_ATTRIB_COLOR0][3] = UBYTE_TO_FLOAT(a);
+}
+
+static void r200_Color4ubv_3f( const GLubyte *v )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = UBYTE_TO_FLOAT(v[0]);
+ dest[1] = UBYTE_TO_FLOAT(v[1]);
+ dest[2] = UBYTE_TO_FLOAT(v[2]);
+ vb.context->Current.Attrib[VERT_ATTRIB_COLOR0][3] = UBYTE_TO_FLOAT(v[3]);
+}
+
+
+static void r200_Color3f_3f( GLfloat r, GLfloat g, GLfloat b )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = r;
+ dest[1] = g;
+ dest[2] = b;
+}
+
+static void r200_Color3fv_3f( const GLfloat *v )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = v[0];
+ dest[1] = v[1];
+ dest[2] = v[2];
+}
+
+static void r200_Color4f_3f( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = r;
+ dest[1] = g;
+ dest[2] = b;
+ vb.context->Current.Attrib[VERT_ATTRIB_COLOR0][3] = a;
+}
+
+static void r200_Color4fv_3f( const GLfloat *v )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = v[0];
+ dest[1] = v[1];
+ dest[2] = v[2];
+ vb.context->Current.Attrib[VERT_ATTRIB_COLOR0][3] = v[3];
+}
+
+
+/* Secondary Color:
+ */
+static void r200_SecondaryColor3ubEXT_ub( GLubyte r, GLubyte g, GLubyte b )
+{
+ r200_color_t *dest = vb.specptr;
+ dest->red = r;
+ dest->green = g;
+ dest->blue = b;
+ dest->alpha = 0xff;
+}
+
+static void r200_SecondaryColor3ubvEXT_ub( const GLubyte *v )
+{
+ r200_color_t *dest = vb.specptr;
+ dest->red = v[0];
+ dest->green = v[1];
+ dest->blue = v[2];
+ dest->alpha = 0xff;
+}
+
+static void r200_SecondaryColor3fEXT_ub( GLfloat r, GLfloat g, GLfloat b )
+{
+ r200_color_t *dest = vb.specptr;
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->red, r );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->green, g );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, b );
+ dest->alpha = 255;
+}
+
+static void r200_SecondaryColor3fvEXT_ub( const GLfloat *v )
+{
+ r200_color_t *dest = vb.specptr;
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->red, v[0] );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->green, v[1] );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, v[2] );
+ dest->alpha = 255;
+}
+
+static void r200_SecondaryColor3ubEXT_3f( GLubyte r, GLubyte g, GLubyte b )
+{
+ GLfloat *dest = vb.floatspecptr;
+ dest[0] = UBYTE_TO_FLOAT(r);
+ dest[1] = UBYTE_TO_FLOAT(g);
+ dest[2] = UBYTE_TO_FLOAT(b);
+ dest[3] = 1.0;
+}
+
+static void r200_SecondaryColor3ubvEXT_3f( const GLubyte *v )
+{
+ GLfloat *dest = vb.floatspecptr;
+ dest[0] = UBYTE_TO_FLOAT(v[0]);
+ dest[1] = UBYTE_TO_FLOAT(v[1]);
+ dest[2] = UBYTE_TO_FLOAT(v[2]);
+ dest[3] = 1.0;
+}
+
+static void r200_SecondaryColor3fEXT_3f( GLfloat r, GLfloat g, GLfloat b )
+{
+ GLfloat *dest = vb.floatspecptr;
+ dest[0] = r;
+ dest[1] = g;
+ dest[2] = b;
+ dest[3] = 1.0;
+}
+
+static void r200_SecondaryColor3fvEXT_3f( const GLfloat *v )
+{
+ GLfloat *dest = vb.floatspecptr;
+ dest[0] = v[0];
+ dest[1] = v[1];
+ dest[2] = v[2];
+ dest[3] = 1.0;
+}
+
+
+
+/* Normal
+ */
+static void r200_Normal3f( GLfloat n0, GLfloat n1, GLfloat n2 )
+{
+ GLfloat *dest = vb.normalptr;
+ dest[0] = n0;
+ dest[1] = n1;
+ dest[2] = n2;
+}
+
+static void r200_Normal3fv( const GLfloat *v )
+{
+ GLfloat *dest = vb.normalptr;
+ dest[0] = v[0];
+ dest[1] = v[1];
+ dest[2] = v[2];
+}
+
+
+/* TexCoord
+ */
+static void r200_TexCoord1f( GLfloat s )
+{
+ GLfloat *dest = vb.texcoordptr[0];
+ dest[0] = s;
+ dest[1] = 0;
+}
+
+static void r200_TexCoord1fv( const GLfloat *v )
+{
+ GLfloat *dest = vb.texcoordptr[0];
+ dest[0] = v[0];
+ dest[1] = 0;
+}
+
+static void r200_TexCoord2f( GLfloat s, GLfloat t )
+{
+ GLfloat *dest = vb.texcoordptr[0];
+ dest[0] = s;
+ dest[1] = t;
+}
+
+static void r200_TexCoord2fv( const GLfloat *v )
+{
+ GLfloat *dest = vb.texcoordptr[0];
+ dest[0] = v[0];
+ dest[1] = v[1];
+}
+
+
+/* MultiTexcoord
+ */
+static void r200_MultiTexCoord1fARB( GLenum target, GLfloat s )
+{
+ GLfloat *dest = vb.texcoordptr[(target - GL_TEXTURE0_ARB)&1];
+ dest[0] = s;
+ dest[1] = 0;
+}
+
+static void r200_MultiTexCoord1fvARB( GLenum target, const GLfloat *v )
+{
+ GLfloat *dest = vb.texcoordptr[(target - GL_TEXTURE0_ARB)&1];
+ dest[0] = v[0];
+ dest[1] = 0;
+}
+
+static void r200_MultiTexCoord2fARB( GLenum target, GLfloat s, GLfloat t )
+{
+ GLfloat *dest = vb.texcoordptr[(target - GL_TEXTURE0_ARB)&1];
+ dest[0] = s;
+ dest[1] = t;
+}
+
+static void r200_MultiTexCoord2fvARB( GLenum target, const GLfloat *v )
+{
+ GLfloat *dest = vb.texcoordptr[(target - GL_TEXTURE0_ARB)&1];
+ dest[0] = v[0];
+ dest[1] = v[1];
+}
+
+static struct dynfn *lookup( struct dynfn *l, const int *key )
+{
+ struct dynfn *f;
+
+ foreach( f, l ) {
+ if (f->key[0] == key[0] && f->key[1] == key[1])
+ return f;
+ }
+
+ return 0;
+}
+
+/* Can't use the loopback template for this:
+ */
+
+#define CHOOSE(FN, FNTYPE, MASK0, MASK1, ARGS1, ARGS2 ) \
+static void choose_##FN ARGS1 \
+{ \
+ r200ContextPtr rmesa = R200_CONTEXT(vb.context); \
+ int key[2]; \
+ struct dynfn *dfn; \
+ \
+ key[0] = rmesa->vb.vtxfmt_0 & MASK0; \
+ key[1] = rmesa->vb.vtxfmt_1 & MASK1; \
+ \
+ dfn = lookup( &rmesa->vb.dfn_cache.FN, key ); \
+ if (dfn == 0) \
+ dfn = rmesa->vb.codegen.FN( vb.context, key ); \
+ else if (R200_DEBUG & DEBUG_CODEGEN) \
+ fprintf(stderr, "%s -- cached codegen\n", __FUNCTION__ ); \
+ \
+ if (dfn) \
+ vb.context->Exec->FN = (FNTYPE)(dfn->code); \
+ else { \
+ if (R200_DEBUG & DEBUG_CODEGEN) \
+ fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \
+ vb.context->Exec->FN = r200_##FN; \
+ } \
+ \
+ vb.context->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
+ vb.context->Exec->FN ARGS2; \
+}
+
+
+
+/* For the _3f case, only allow one color function to be hooked in at
+ * a time. Eventually, use a similar mechanism to allow selecting the
+ * color component of the vertex format based on client behaviour.
+ *
+ * Note: Perform these actions even if there is a codegen or cached
+ * codegen version of the chosen function.
+ */
+#define CHOOSE_COLOR(FN, FNTYPE, NR, MASK0, MASK1, ARGS1, ARGS2 ) \
+static void choose_##FN ARGS1 \
+{ \
+ GLcontext *ctx = vb.context; \
+ r200ContextPtr rmesa = R200_CONTEXT(vb.context); \
+ int key[2]; \
+ struct dynfn *dfn; \
+ \
+ key[0] = rmesa->vb.vtxfmt_0 & MASK0; \
+ key[1] = rmesa->vb.vtxfmt_1 & MASK1; \
+ \
+ if (VTX_COLOR(rmesa->vb.vtxfmt_0,0) == R200_VTX_PK_RGBA) { \
+ ctx->Exec->FN = r200_##FN##_ub; \
+ } \
+ else if (VTX_COLOR(rmesa->vb.vtxfmt_0,0) == R200_VTX_FP_RGB) { \
+ \
+ if (rmesa->vb.installed_color_3f_sz != NR) { \
+ rmesa->vb.installed_color_3f_sz = NR; \
+ if (NR == 3) ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = 1.0; \
+ if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) { \
+ r200_copy_to_current( ctx ); \
+ _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt ); \
+ ctx->Exec->FN ARGS2; \
+ return; \
+ } \
+ } \
+ \
+ ctx->Exec->FN = r200_##FN##_3f; \
+ } \
+ else { \
+ ctx->Exec->FN = r200_##FN##_4f; \
+ } \
+ \
+ \
+ dfn = lookup( &rmesa->vb.dfn_cache.FN, key ); \
+ if (!dfn) dfn = rmesa->vb.codegen.FN( ctx, key ); \
+ \
+ if (dfn) { \
+ if (R200_DEBUG & DEBUG_CODEGEN) \
+ fprintf(stderr, "%s -- codegen version\n", __FUNCTION__ ); \
+ ctx->Exec->FN = (FNTYPE)dfn->code; \
+ } \
+ else if (R200_DEBUG & DEBUG_CODEGEN) \
+ fprintf(stderr, "%s -- 'c' version\n", __FUNCTION__ ); \
+ \
+ ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
+ ctx->Exec->FN ARGS2; \
+}
+
+
+
+/* Right now there are both _ub and _3f versions of the secondary color
+ * functions. Currently, we only set-up the hardware to use the _ub versions.
+ * The _3f versions are needed for the cases where secondary color isn't used
+ * in the vertex format, but it still needs to be stored in the context
+ * state vector.
+ */
+#define CHOOSE_SECONDARY_COLOR(FN, FNTYPE, MASK0, MASK1, ARGS1, ARGS2 ) \
+static void choose_##FN ARGS1 \
+{ \
+ r200ContextPtr rmesa = R200_CONTEXT(vb.context); \
+ int key[2]; \
+ struct dynfn *dfn; \
+ \
+ key[0] = rmesa->vb.vtxfmt_0 & MASK0; \
+ key[1] = rmesa->vb.vtxfmt_1 & MASK1; \
+ \
+ dfn = lookup( &rmesa->vb.dfn_cache.FN, key ); \
+ if (dfn == 0) \
+ dfn = rmesa->vb.codegen.FN( vb.context, key ); \
+ else if (R200_DEBUG & DEBUG_CODEGEN) \
+ fprintf(stderr, "%s -- cached version\n", __FUNCTION__ ); \
+ \
+ if (dfn) \
+ vb.context->Exec->FN = (FNTYPE)(dfn->code); \
+ else { \
+ if (R200_DEBUG & DEBUG_CODEGEN) \
+ fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \
+ vb.context->Exec->FN = (VTX_COLOR(rmesa->vb.vtxfmt_0,1) == R200_VTX_PK_RGBA) \
+ ? r200_##FN##_ub : r200_##FN##_3f; \
+ } \
+ \
+ vb.context->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
+ vb.context->Exec->FN ARGS2; \
+}
+
+
+
+
+
+/* VTXFMT_0
+ */
+#define MASK_XYZW (R200_VTX_W0|R200_VTX_Z0)
+#define MASK_NORM (MASK_XYZW|R200_VTX_N0)
+#define MASK_COLOR (MASK_NORM |(R200_VTX_COLOR_MASK<<R200_VTX_COLOR_0_SHIFT))
+#define MASK_SPEC (MASK_COLOR|(R200_VTX_COLOR_MASK<<R200_VTX_COLOR_1_SHIFT))
+
+/* VTXFMT_1
+ */
+#define MASK_ST0 (0x7 << R200_VTX_TEX0_COMP_CNT_SHIFT)
+
+
+
+typedef void (*p4f)( GLfloat, GLfloat, GLfloat, GLfloat );
+typedef void (*p3f)( GLfloat, GLfloat, GLfloat );
+typedef void (*p2f)( GLfloat, GLfloat );
+typedef void (*p1f)( GLfloat );
+typedef void (*pe2f)( GLenum, GLfloat, GLfloat );
+typedef void (*pe1f)( GLenum, GLfloat );
+typedef void (*p4ub)( GLubyte, GLubyte, GLubyte, GLubyte );
+typedef void (*p3ub)( GLubyte, GLubyte, GLubyte );
+typedef void (*pfv)( const GLfloat * );
+typedef void (*pefv)( GLenum, const GLfloat * );
+typedef void (*pubv)( const GLubyte * );
+
+
+CHOOSE(Normal3f, p3f, MASK_NORM, 0,
+ (GLfloat a,GLfloat b,GLfloat c), (a,b,c))
+CHOOSE(Normal3fv, pfv, MASK_NORM, 0,
+ (const GLfloat *v), (v))
+
+CHOOSE_COLOR(Color4ub, p4ub, 4, MASK_COLOR, 0,
+ (GLubyte a,GLubyte b, GLubyte c, GLubyte d), (a,b,c,d))
+CHOOSE_COLOR(Color4ubv, pubv, 4, MASK_COLOR, 0,
+ (const GLubyte *v), (v))
+CHOOSE_COLOR(Color3ub, p3ub, 3, MASK_COLOR, 0,
+ (GLubyte a,GLubyte b, GLubyte c), (a,b,c))
+CHOOSE_COLOR(Color3ubv, pubv, 3, MASK_COLOR, 0,
+ (const GLubyte *v), (v))
+
+CHOOSE_COLOR(Color4f, p4f, 4, MASK_COLOR, 0,
+ (GLfloat a,GLfloat b, GLfloat c, GLfloat d), (a,b,c,d))
+CHOOSE_COLOR(Color4fv, pfv, 4, MASK_COLOR, 0,
+ (const GLfloat *v), (v))
+CHOOSE_COLOR(Color3f, p3f, 3, MASK_COLOR, 0,
+ (GLfloat a,GLfloat b, GLfloat c), (a,b,c))
+CHOOSE_COLOR(Color3fv, pfv, 3, MASK_COLOR, 0,
+ (const GLfloat *v), (v))
+
+
+CHOOSE_SECONDARY_COLOR(SecondaryColor3ubEXT, p3ub, MASK_SPEC, 0,
+ (GLubyte a,GLubyte b, GLubyte c), (a,b,c))
+CHOOSE_SECONDARY_COLOR(SecondaryColor3ubvEXT, pubv, MASK_SPEC, 0,
+ (const GLubyte *v), (v))
+CHOOSE_SECONDARY_COLOR(SecondaryColor3fEXT, p3f, MASK_SPEC, 0,
+ (GLfloat a,GLfloat b, GLfloat c), (a,b,c))
+CHOOSE_SECONDARY_COLOR(SecondaryColor3fvEXT, pfv, MASK_SPEC, 0,
+ (const GLfloat *v), (v))
+
+CHOOSE(TexCoord2f, p2f, ~0, MASK_ST0,
+ (GLfloat a,GLfloat b), (a,b))
+CHOOSE(TexCoord2fv, pfv, ~0, MASK_ST0,
+ (const GLfloat *v), (v))
+CHOOSE(TexCoord1f, p1f, ~0, MASK_ST0,
+ (GLfloat a), (a))
+CHOOSE(TexCoord1fv, pfv, ~0, MASK_ST0,
+ (const GLfloat *v), (v))
+
+CHOOSE(MultiTexCoord2fARB, pe2f, ~0, ~0,
+ (GLenum u,GLfloat a,GLfloat b), (u,a,b))
+CHOOSE(MultiTexCoord2fvARB, pefv, ~0, ~0,
+ (GLenum u,const GLfloat *v), (u,v))
+CHOOSE(MultiTexCoord1fARB, pe1f, ~0, ~0,
+ (GLenum u,GLfloat a), (u,a))
+CHOOSE(MultiTexCoord1fvARB, pefv, ~0, ~0,
+ (GLenum u,const GLfloat *v), (u,v))
+
+CHOOSE(Vertex3f, p3f, ~0, ~0,
+ (GLfloat a,GLfloat b,GLfloat c), (a,b,c))
+CHOOSE(Vertex3fv, pfv, ~0, ~0,
+ (const GLfloat *v), (v))
+CHOOSE(Vertex2f, p2f, ~0, ~0,
+ (GLfloat a,GLfloat b), (a,b))
+CHOOSE(Vertex2fv, pfv, ~0, ~0,
+ (const GLfloat *v), (v))
+
+
+
+
+
+void r200VtxfmtInitChoosers( GLvertexformat *vfmt )
+{
+ vfmt->Color3f = choose_Color3f;
+ vfmt->Color3fv = choose_Color3fv;
+ vfmt->Color3ub = choose_Color3ub;
+ vfmt->Color3ubv = choose_Color3ubv;
+ vfmt->Color4f = choose_Color4f;
+ vfmt->Color4fv = choose_Color4fv;
+ vfmt->Color4ub = choose_Color4ub;
+ vfmt->Color4ubv = choose_Color4ubv;
+ vfmt->SecondaryColor3fEXT = choose_SecondaryColor3fEXT;
+ vfmt->SecondaryColor3fvEXT = choose_SecondaryColor3fvEXT;
+ vfmt->SecondaryColor3ubEXT = choose_SecondaryColor3ubEXT;
+ vfmt->SecondaryColor3ubvEXT = choose_SecondaryColor3ubvEXT;
+ vfmt->MultiTexCoord1fARB = choose_MultiTexCoord1fARB;
+ vfmt->MultiTexCoord1fvARB = choose_MultiTexCoord1fvARB;
+ vfmt->MultiTexCoord2fARB = choose_MultiTexCoord2fARB;
+ vfmt->MultiTexCoord2fvARB = choose_MultiTexCoord2fvARB;
+ vfmt->Normal3f = choose_Normal3f;
+ vfmt->Normal3fv = choose_Normal3fv;
+ vfmt->TexCoord1f = choose_TexCoord1f;
+ vfmt->TexCoord1fv = choose_TexCoord1fv;
+ vfmt->TexCoord2f = choose_TexCoord2f;
+ vfmt->TexCoord2fv = choose_TexCoord2fv;
+ vfmt->Vertex2f = choose_Vertex2f;
+ vfmt->Vertex2fv = choose_Vertex2fv;
+ vfmt->Vertex3f = choose_Vertex3f;
+ vfmt->Vertex3fv = choose_Vertex3fv;
+}
+
+
+static struct dynfn *codegen_noop( GLcontext *ctx, const int *key )
+{
+ (void) ctx; (void) key;
+ return 0;
+}
+
+void r200InitCodegen( struct dfn_generators *gen )
+{
+ gen->Vertex3f = codegen_noop;
+ gen->Vertex3fv = codegen_noop;
+ gen->Color4ub = codegen_noop;
+ gen->Color4ubv = codegen_noop;
+ gen->Normal3f = codegen_noop;
+ gen->Normal3fv = codegen_noop;
+ gen->TexCoord2f = codegen_noop;
+ gen->TexCoord2fv = codegen_noop;
+ gen->MultiTexCoord2fARB = codegen_noop;
+ gen->MultiTexCoord2fvARB = codegen_noop;
+ gen->Vertex2f = codegen_noop;
+ gen->Vertex2fv = codegen_noop;
+ gen->Color3ub = codegen_noop;
+ gen->Color3ubv = codegen_noop;
+ gen->Color4f = codegen_noop;
+ gen->Color4fv = codegen_noop;
+ gen->Color3f = codegen_noop;
+ gen->Color3fv = codegen_noop;
+ gen->SecondaryColor3fEXT = codegen_noop;
+ gen->SecondaryColor3fvEXT = codegen_noop;
+ gen->SecondaryColor3ubEXT = codegen_noop;
+ gen->SecondaryColor3ubvEXT = codegen_noop;
+ gen->TexCoord1f = codegen_noop;
+ gen->TexCoord1fv = codegen_noop;
+ gen->MultiTexCoord1fARB = codegen_noop;
+ gen->MultiTexCoord1fvARB = codegen_noop;
+
+ if (!getenv("R200_NO_CODEGEN")) {
+#if defined(USE_X86_ASM)
+ r200InitX86Codegen( gen );
+#endif
+
+#if defined(USE_SSE_ASM)
+ r200InitSSECodegen( gen );
+#endif
+ }
+}
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_sse.c b/xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_sse.c
new file mode 100644
index 000000000..ef77208c6
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_sse.c
@@ -0,0 +1,95 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "simple_list.h"
+#include "r200_vtxfmt.h"
+
+#if defined(USE_SSE_ASM)
+
+/* Build specialized versions of the immediate calls on the fly for
+ * the current state. ???P4 SSE2 versions???
+ */
+
+
+static struct dynfn *makeSSENormal3fv( GLcontext *ctx, const int *key )
+{
+ /* Requires P4 (sse2?)
+ */
+ static unsigned char temp[] = {
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0xba, 0x78, 0x56, 0x34, 0x12, /* mov $0x12345678,%edx */
+ 0xf3, 0x0f, 0x7e, 0x00, /* movq (%eax),%xmm0 */
+ 0x66, 0x0f, 0x6e, 0x48, 0x08, /* movd 0x8(%eax),%xmm1 */
+ 0x66, 0x0f, 0xd6, 0x42, 0x0c, /* movq %xmm0,0xc(%edx) */
+ 0x66, 0x0f, 0x7e, 0x4a, 0x14, /* movd %xmm1,0x14(%edx) */
+ 0xc3, /* ret */
+ };
+
+
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ insert_at_head( &rmesa->vb.dfn_cache.Normal3fv, dfn );
+ dfn->key[0] = key[0];
+ dfn->key[1] = key[1];
+
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 5, 0x0, (int)vb.normalptr);
+ return dfn;
+}
+
+void r200InitSSECodegen( struct dfn_generators *gen )
+{
+ /* Need to:
+ * - check kernel sse support
+ * - check p4/sse2
+ */
+ (void) makeSSENormal3fv;
+}
+
+
+#else
+
+void r200InitSSECodegen( struct dfn_generators *gen )
+{
+ (void) gen;
+}
+
+#endif
+
+
+
+
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_x86.c b/xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_x86.c
new file mode 100644
index 000000000..abd505adc
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_x86.c
@@ -0,0 +1,462 @@
+/* $XFree86$ */
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "mmath.h"
+#include "simple_list.h"
+#include "r200_vtxfmt.h"
+
+#if defined(USE_X86_ASM)
+
+#define EXTERN( FUNC ) \
+extern const char *FUNC; \
+extern const char *FUNC##_end
+
+EXTERN ( _x86_Normal3fv );
+EXTERN ( _x86_Normal3f );
+EXTERN ( _x86_Vertex3fv_6 );
+EXTERN ( _x86_Vertex3fv_8 );
+EXTERN ( _x86_Vertex3fv );
+EXTERN ( _x86_Vertex3f_4 );
+EXTERN ( _x86_Vertex3f_6 );
+EXTERN ( _x86_Vertex3f );
+EXTERN ( _x86_Color4ubv_ub );
+EXTERN ( _x86_Color4ubv_4f );
+EXTERN ( _x86_Color4ub_ub );
+EXTERN ( _x86_Color3fv_3f );
+EXTERN ( _x86_Color3f_3f );
+EXTERN ( _x86_TexCoord2fv );
+EXTERN ( _x86_TexCoord2f );
+EXTERN ( _x86_MultiTexCoord2fvARB );
+EXTERN ( _x86_MultiTexCoord2fvARB_2 );
+EXTERN ( _x86_MultiTexCoord2fARB );
+EXTERN ( _x86_MultiTexCoord2fARB_2 );
+
+
+/* Build specialized versions of the immediate calls on the fly for
+ * the current state. Generic x86 versions.
+ */
+
+struct dynfn *r200_makeX86Vertex3f( GLcontext *ctx, const int *key )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+
+ if (R200_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x 0x%08x %d\n", __FUNCTION__,
+ key[0], key[1], vb.vertex_size );
+
+ switch (vb.vertex_size) {
+ case 4: {
+
+ DFN ( _x86_Vertex3f_4, rmesa->vb.dfn_cache.Vertex3f );
+ FIXUP(dfn->code, 2, 0x0, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 25, 0x0, (int)&vb.vertex[3]);
+ FIXUP(dfn->code, 36, 0x0, (int)&vb.counter);
+ FIXUP(dfn->code, 46, 0x0, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 51, 0x0, (int)&vb.counter);
+ FIXUP(dfn->code, 60, 0x0, (int)&vb.notify);
+ break;
+ }
+ case 6: {
+
+ DFN ( _x86_Vertex3f_6, rmesa->vb.dfn_cache.Vertex3f );
+ FIXUP(dfn->code, 3, 0x0, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 28, 0x0, (int)&vb.vertex[3]);
+ FIXUP(dfn->code, 34, 0x0, (int)&vb.vertex[4]);
+ FIXUP(dfn->code, 40, 0x0, (int)&vb.vertex[5]);
+ FIXUP(dfn->code, 57, 0x0, (int)&vb.counter);
+ FIXUP(dfn->code, 63, 0x0, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 70, 0x0, (int)&vb.counter);
+ FIXUP(dfn->code, 79, 0x0, (int)&vb.notify);
+ break;
+ }
+ default: {
+
+ DFN ( _x86_Vertex3f, rmesa->vb.dfn_cache.Vertex3f );
+ FIXUP(dfn->code, 3, 0x0, (int)&vb.vertex[3]);
+ FIXUP(dfn->code, 9, 0x0, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 37, 0x0, vb.vertex_size-3);
+ FIXUP(dfn->code, 44, 0x0, (int)&vb.counter);
+ FIXUP(dfn->code, 50, 0x0, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 56, 0x0, (int)&vb.counter);
+ FIXUP(dfn->code, 67, 0x0, (int)&vb.notify);
+ break;
+ }
+ }
+
+ return dfn;
+}
+
+
+
+struct dynfn *r200_makeX86Vertex3fv( GLcontext *ctx, const int *key )
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+
+ if (R200_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x 0x%08x %d\n", __FUNCTION__,
+ key[0], key[1], vb.vertex_size );
+
+ switch (vb.vertex_size) {
+ case 6: {
+
+ DFN ( _x86_Vertex3fv_6, rmesa->vb.dfn_cache.Vertex3fv );
+ FIXUP(dfn->code, 1, 0x00000000, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 27, 0x0000001c, (int)&vb.vertex[3]);
+ FIXUP(dfn->code, 33, 0x00000020, (int)&vb.vertex[4]);
+ FIXUP(dfn->code, 45, 0x00000024, (int)&vb.vertex[5]);
+ FIXUP(dfn->code, 56, 0x00000000, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 61, 0x00000004, (int)&vb.counter);
+ FIXUP(dfn->code, 67, 0x00000004, (int)&vb.counter);
+ FIXUP(dfn->code, 76, 0x00000008, (int)&vb.notify);
+ break;
+ }
+
+
+ case 8: {
+
+ DFN ( _x86_Vertex3fv_8, rmesa->vb.dfn_cache.Vertex3fv );
+ FIXUP(dfn->code, 1, 0x00000000, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 27, 0x0000001c, (int)&vb.vertex[3]);
+ FIXUP(dfn->code, 33, 0x00000020, (int)&vb.vertex[4]);
+ FIXUP(dfn->code, 45, 0x0000001c, (int)&vb.vertex[5]);
+ FIXUP(dfn->code, 51, 0x00000020, (int)&vb.vertex[6]);
+ FIXUP(dfn->code, 63, 0x00000024, (int)&vb.vertex[7]);
+ FIXUP(dfn->code, 74, 0x00000000, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 79, 0x00000004, (int)&vb.counter);
+ FIXUP(dfn->code, 85, 0x00000004, (int)&vb.counter);
+ FIXUP(dfn->code, 94, 0x00000008, (int)&vb.notify);
+ break;
+ }
+
+
+
+ default: {
+
+ DFN ( _x86_Vertex3fv, rmesa->vb.dfn_cache.Vertex3fv );
+ FIXUP(dfn->code, 8, 0x01010101, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 32, 0x00000006, vb.vertex_size-3);
+ FIXUP(dfn->code, 37, 0x00000058, (int)&vb.vertex[3]);
+ FIXUP(dfn->code, 45, 0x01010101, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 50, 0x02020202, (int)&vb.counter);
+ FIXUP(dfn->code, 58, 0x02020202, (int)&vb.counter);
+ FIXUP(dfn->code, 67, 0x0, (int)&vb.notify);
+ break;
+ }
+ }
+
+ return dfn;
+}
+
+struct dynfn *r200_makeX86Normal3fv( GLcontext *ctx, const int *key )
+{
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ int i = 0;
+
+ if (R200_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key[0] );
+
+ DFN ( _x86_Normal3fv, rmesa->vb.dfn_cache.Normal3fv );
+
+ FIXUP2(dfn->code, i, 0x0, (int)vb.normalptr);
+ FIXUP2(dfn->code, i, 0x4, 4+(int)vb.normalptr);
+ FIXUP2(dfn->code, i, 0x8, 8+(int)vb.normalptr);
+ /*fprintf(stderr, "%s done\n", __FUNCTION__);*/
+ return dfn;
+}
+
+struct dynfn *r200_makeX86Normal3f( GLcontext *ctx, const int *key )
+{
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if (R200_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key[0] );
+
+ DFN ( _x86_Normal3f, rmesa->vb.dfn_cache.Normal3f );
+ FIXUP(dfn->code, 1, 0x12345678, (int)vb.normalptr);
+ return dfn;
+}
+
+struct dynfn *r200_makeX86Color4ubv( GLcontext *ctx, const int *key )
+{
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+
+ if (R200_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key[0] );
+
+ if (VTX_COLOR(key[0],0) == R200_VTX_PK_RGBA) {
+ DFN ( _x86_Color4ubv_ub, rmesa->vb.dfn_cache.Color4ubv);
+ FIXUP(dfn->code, 5, 0x12345678, (int)vb.colorptr);
+ return dfn;
+ }
+ else {
+
+ DFN ( _x86_Color4ubv_4f, rmesa->vb.dfn_cache.Color4ubv);
+ FIXUP(dfn->code, 2, 0x00000000, (int)_mesa_ubyte_to_float_color_tab);
+ FIXUP(dfn->code, 27, 0xdeadbeaf, (int)vb.floatcolorptr);
+ FIXUP(dfn->code, 33, 0xdeadbeaf, (int)vb.floatcolorptr+4);
+ FIXUP(dfn->code, 55, 0xdeadbeaf, (int)vb.floatcolorptr+8);
+ FIXUP(dfn->code, 61, 0xdeadbeaf, (int)vb.floatcolorptr+12);
+ return dfn;
+ }
+}
+
+struct dynfn *r200_makeX86Color4ub( GLcontext *ctx, const int *key )
+{
+ if (R200_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key[0] );
+
+ if (VTX_COLOR(key[0],0) == R200_VTX_PK_RGBA) {
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ DFN ( _x86_Color4ub_ub, rmesa->vb.dfn_cache.Color4ub );
+ FIXUP(dfn->code, 18, 0x0, (int)vb.colorptr);
+ FIXUP(dfn->code, 24, 0x0, (int)vb.colorptr+1);
+ FIXUP(dfn->code, 30, 0x0, (int)vb.colorptr+2);
+ FIXUP(dfn->code, 36, 0x0, (int)vb.colorptr+3);
+ return dfn;
+ }
+ else
+ return 0;
+}
+
+
+struct dynfn *r200_makeX86Color3fv( GLcontext *ctx, const int *key )
+{
+ if (VTX_COLOR(key[0],0) != R200_VTX_FP_RGB)
+ return 0;
+ else
+ {
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if (R200_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key[0] );
+
+ DFN ( _x86_Color3fv_3f, rmesa->vb.dfn_cache.Color3fv );
+ FIXUP(dfn->code, 5, 0x0, (int)vb.floatcolorptr);
+ return dfn;
+ }
+}
+
+struct dynfn *r200_makeX86Color3f( GLcontext *ctx, const int *key )
+{
+ if (VTX_COLOR(key[0],0) != R200_VTX_FP_RGB)
+ return 0;
+ else
+ {
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if (R200_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key[0] );
+
+ DFN ( _x86_Color3f_3f, rmesa->vb.dfn_cache.Color3f );
+ FIXUP(dfn->code, 1, 0x12345678, (int)vb.floatcolorptr);
+ return dfn;
+ }
+}
+
+
+
+struct dynfn *r200_makeX86TexCoord2fv( GLcontext *ctx, const int *key )
+{
+
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if (R200_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x 0x%08x\n", __FUNCTION__, key[0], key[1] );
+
+ DFN ( _x86_TexCoord2fv, rmesa->vb.dfn_cache.TexCoord2fv );
+ FIXUP(dfn->code, 5, 0x12345678, (int)vb.texcoordptr[0]);
+ return dfn;
+}
+
+struct dynfn *r200_makeX86TexCoord2f( GLcontext *ctx, const int *key )
+{
+
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if (R200_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x 0x%08x\n", __FUNCTION__, key[0], key[1] );
+
+ DFN ( _x86_TexCoord2f, rmesa->vb.dfn_cache.TexCoord2f );
+ FIXUP(dfn->code, 1, 0x12345678, (int)vb.texcoordptr[0]);
+ return dfn;
+}
+
+struct dynfn *r200_makeX86MultiTexCoord2fvARB( GLcontext *ctx, const int *key )
+{
+#if 0
+ static char temp[] = {
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0x8b, 0x4c, 0x24, 0x08, /* mov 0x8(%esp,1),%ecx */
+ 0x2d, 0xc0, 0x84, 0x00, 0x00, /* sub $0x84c0,%eax */
+ 0x83, 0xe0, 0x01, /* and $0x1,%eax */
+ 0x8b, 0x11, /* mov (%ecx),%edx */
+ 0xc1, 0xe0, 0x03, /* shl $0x3,%eax */
+ 0x8b, 0x49, 0x04, /* mov 0x4(%ecx),%ecx */
+ 0x89, 0x90, 0, 0, 0, 0,/* mov %edx,DEST(%eax) */
+ 0x89, 0x88, 0, 0, 0, 0,/* mov %ecx,DEST+8(%eax) */
+ 0xc3, /* ret */
+ };
+ static char temp2[] = {
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0x8b, 0x4c, 0x24, 0x08, /* mov 0x8(%esp,1),%ecx */
+ 0x2d, 0xc0, 0x84, 0x00, 0x00, /* sub $0x84c0,%eax */
+ 0x83, 0xe0, 0x01, /* and $0x1,%eax */
+ 0x8b, 0x14, 0x85, 0, 0, 0, 0, /* mov DEST(,%eax,4),%edx */
+ 0x8b, 0x01, /* mov (%ecx),%eax */
+ 0x89, 0x02, /* mov %eax,(%edx) */
+ 0x8b, 0x41, 0x04, /* mov 0x4(%ecx),%eax */
+ 0x89, 0x42, 0x04, /* mov %eax,0x4(%edx) */
+ 0xc3, /* ret */
+ };
+#endif
+
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if (R200_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x 0x%08x\n", __FUNCTION__, key[0], key[1] );
+
+ if (vb.texcoordptr[1] == vb.texcoordptr[0]+4) {
+ DFN ( _x86_MultiTexCoord2fvARB, rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
+ FIXUP(dfn->code, 26, 0xdeadbeef, (int)vb.texcoordptr[0]);
+ FIXUP(dfn->code, 32, 0xdeadbeef, (int)vb.texcoordptr[0]+4);
+ } else {
+ DFN ( _x86_MultiTexCoord2fvARB_2, rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
+ FIXUP(dfn->code, 19, 0x0, (int)vb.texcoordptr);
+ }
+ return dfn;
+}
+
+struct dynfn *r200_makeX86MultiTexCoord2fARB( GLcontext *ctx,
+ const int *key )
+{
+#if 0
+ static char temp[] = {
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0x8b, 0x54, 0x24, 0x08, /* mov 0x8(%esp,1),%edx */
+ 0x2d, 0xc0, 0x84, 0x00, 0x00, /* sub $0x84c0,%eax */
+ 0x8b, 0x4c, 0x24, 0x0c, /* mov 0xc(%esp,1),%ecx */
+ 0x83, 0xe0, 0x01, /* and $0x1,%eax */
+ 0xc1, 0xe0, 0x03, /* shl $0x3,%eax */
+ 0x89, 0x90, 0, 0, 0, 0, /* mov %edx,DEST(%eax) */
+ 0x89, 0x88, 0, 0, 0, 0, /* mov %ecx,DEST+8(%eax) */
+ 0xc3, /* ret */
+ };
+
+ static char temp2[] = {
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0x8b, 0x54, 0x24, 0x08, /* mov 0x8(%esp,1),%edx */
+ 0x2d, 0xc0, 0x84, 0x00, 0x00, /* sub $0x84c0,%eax */
+ 0x8b, 0x4c, 0x24, 0x0c, /* mov 0xc(%esp,1),%ecx */
+ 0x83, 0xe0, 0x01, /* and $0x1,%eax */
+ 0x8b, 0x04, 0x85, 0, 0, 0, 0, /* mov DEST(,%eax,4),%eax */
+ 0x89, 0x10, /* mov %edx,(%eax) */
+ 0x89, 0x48, 0x04, /* mov %ecx,0x4(%eax) */
+ 0xc3, /* ret */
+ };
+#endif
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
+ if (R200_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x 0x%08x\n", __FUNCTION__, key[0], key[1] );
+
+ if (vb.texcoordptr[1] == vb.texcoordptr[0]+4) {
+ DFN ( _x86_MultiTexCoord2fARB, rmesa->vb.dfn_cache.MultiTexCoord2fARB );
+ FIXUP(dfn->code, 25, 0xdeadbeef, (int)vb.texcoordptr[0]);
+ FIXUP(dfn->code, 31, 0xdeadbeef, (int)vb.texcoordptr[0]+4);
+ }
+ else {
+ /* Note: this might get generated multiple times, even though the
+ * actual emitted code is the same.
+ */
+ DFN ( _x86_MultiTexCoord2fARB_2, rmesa->vb.dfn_cache.MultiTexCoord2fARB );
+ FIXUP(dfn->code, 23, 0x0, (int)vb.texcoordptr);
+ }
+ return dfn;
+}
+
+
+void r200InitX86Codegen( struct dfn_generators *gen )
+{
+ gen->Vertex3f = r200_makeX86Vertex3f;
+ gen->Vertex3fv = r200_makeX86Vertex3fv;
+ gen->Color4ub = r200_makeX86Color4ub; /* PKCOLOR only */
+ gen->Color4ubv = r200_makeX86Color4ubv; /* PKCOLOR only */
+ gen->Normal3f = r200_makeX86Normal3f;
+ gen->Normal3fv = r200_makeX86Normal3fv;
+ gen->TexCoord2f = r200_makeX86TexCoord2f;
+ gen->TexCoord2fv = r200_makeX86TexCoord2fv;
+ gen->MultiTexCoord2fARB = r200_makeX86MultiTexCoord2fARB;
+ gen->MultiTexCoord2fvARB = r200_makeX86MultiTexCoord2fvARB;
+ gen->Color3f = r200_makeX86Color3f;
+ gen->Color3fv = r200_makeX86Color3fv;
+
+ /* Not done:
+ */
+/* gen->Vertex2f = r200_makeX86Vertex2f; */
+/* gen->Vertex2fv = r200_makeX86Vertex2fv; */
+/* gen->Color3ub = r200_makeX86Color3ub; */
+/* gen->Color3ubv = r200_makeX86Color3ubv; */
+/* gen->Color4f = r200_makeX86Color4f; */
+/* gen->Color4fv = r200_makeX86Color4fv; */
+/* gen->TexCoord1f = r200_makeX86TexCoord1f; */
+/* gen->TexCoord1fv = r200_makeX86TexCoord1fv; */
+/* gen->MultiTexCoord1fARB = r200_makeX86MultiTexCoord1fARB; */
+/* gen->MultiTexCoord1fvARB = r200_makeX86MultiTexCoord1fvARB; */
+}
+
+
+#else
+
+void r200InitX86Codegen( struct dfn_generators *gen )
+{
+ (void) gen;
+}
+
+#endif
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_vtxtmp_x86.S b/xc/lib/GL/mesa/src/drv/r200/r200_vtxtmp_x86.S
index 7b325caec..4980ce1bb 100644
--- a/xc/lib/GL/mesa/src/drv/r200/r200_vtxtmp_x86.S
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_vtxtmp_x86.S
@@ -1,4 +1,4 @@
-/* $XFree86$ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxtmp_x86.S,v 1.1 2002/10/30 12:51:53 alanh Exp $ */
/**************************************************************************
Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
@@ -112,7 +112,8 @@ GLOBL ( _x86_Vertex3f )
movl %ecx, 8(%edi)
addl $12, %edi
movl $0, %ecx
- repz movsl %ds:(%esi), %es:(%edi)
+ repz
+ movsl %ds:(%esi), %es:(%edi)
movl (0), %eax
movl %edi, (0)
dec %eax
@@ -204,7 +205,8 @@ GLOBL ( _x86_Vertex3fv )
addl $12, %edi
movl $6, %ecx
movl $0x58, %esi
- repz movsl %ds:(%esi), %es:(%edi)
+ repz
+ movsl %ds:(%esi), %es:(%edi)
movl %edi, (0x1010101)
movl (0x2020202), %eax
pop %esi
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_compat.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_compat.c
new file mode 100644
index 000000000..0c3264153
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_compat.c
@@ -0,0 +1,304 @@
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright 2002 ATI Technologies Inc., Ontario, Canada, and
+ Tungsten Graphics Inc., Austin, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ *
+ */
+
+#include "glheader.h"
+#include "imports.h"
+
+#include "radeon_context.h"
+#include "radeon_state.h"
+#include "radeon_ioctl.h"
+
+
+static struct {
+ int start;
+ int len;
+ const char *name;
+} packet[RADEON_MAX_STATE_PACKETS] = {
+ { RADEON_PP_MISC,7,"RADEON_PP_MISC" },
+ { RADEON_PP_CNTL,3,"RADEON_PP_CNTL" },
+ { RADEON_RB3D_COLORPITCH,1,"RADEON_RB3D_COLORPITCH" },
+ { RADEON_RE_LINE_PATTERN,2,"RADEON_RE_LINE_PATTERN" },
+ { RADEON_SE_LINE_WIDTH,1,"RADEON_SE_LINE_WIDTH" },
+ { RADEON_PP_LUM_MATRIX,1,"RADEON_PP_LUM_MATRIX" },
+ { RADEON_PP_ROT_MATRIX_0,2,"RADEON_PP_ROT_MATRIX_0" },
+ { RADEON_RB3D_STENCILREFMASK,3,"RADEON_RB3D_STENCILREFMASK" },
+ { RADEON_SE_VPORT_XSCALE,6,"RADEON_SE_VPORT_XSCALE" },
+ { RADEON_SE_CNTL,2,"RADEON_SE_CNTL" },
+ { RADEON_SE_CNTL_STATUS,1,"RADEON_SE_CNTL_STATUS" },
+ { RADEON_RE_MISC,1,"RADEON_RE_MISC" },
+ { RADEON_PP_TXFILTER_0,6,"RADEON_PP_TXFILTER_0" },
+ { RADEON_PP_BORDER_COLOR_0,1,"RADEON_PP_BORDER_COLOR_0" },
+ { RADEON_PP_TXFILTER_1,6,"RADEON_PP_TXFILTER_1" },
+ { RADEON_PP_BORDER_COLOR_1,1,"RADEON_PP_BORDER_COLOR_1" },
+ { RADEON_PP_TXFILTER_2,6,"RADEON_PP_TXFILTER_2" },
+ { RADEON_PP_BORDER_COLOR_2,1,"RADEON_PP_BORDER_COLOR_2" },
+ { RADEON_SE_ZBIAS_FACTOR,2,"RADEON_SE_ZBIAS_FACTOR" },
+ { RADEON_SE_TCL_OUTPUT_VTX_FMT,11,"RADEON_SE_TCL_OUTPUT_VTX_FMT" },
+ { RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED,17,"RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED" },
+};
+
+
+static void radeonCompatEmitPacket( radeonContextPtr rmesa,
+ struct radeon_state_atom *state )
+{
+ RADEONSAREAPrivPtr sarea = rmesa->sarea;
+ radeon_context_regs_t *ctx = &sarea->ContextState;
+ radeon_texture_regs_t *tex0 = &sarea->TexState[0];
+ radeon_texture_regs_t *tex1 = &sarea->TexState[1];
+ int i;
+ int *buf = state->cmd;
+
+ for ( i = 0 ; i < state->cmd_size ; ) {
+ drmRadeonCmdHeader *header = (drmRadeonCmdHeader *)&buf[i++];
+
+ if (RADEON_DEBUG & DEBUG_STATE)
+ fprintf(stderr, "%s %d: %s\n", __FUNCTION__, header->packet.packet_id,
+ packet[(int)header->packet.packet_id].name);
+
+ switch (header->packet.packet_id) {
+ case RADEON_EMIT_PP_MISC:
+ ctx->pp_misc = buf[i++];
+ ctx->pp_fog_color = buf[i++];
+ ctx->re_solid_color = buf[i++];
+ ctx->rb3d_blendcntl = buf[i++];
+ ctx->rb3d_depthoffset = buf[i++];
+ ctx->rb3d_depthpitch = buf[i++];
+ ctx->rb3d_zstencilcntl = buf[i++];
+ sarea->dirty |= RADEON_UPLOAD_CONTEXT;
+ break;
+ case RADEON_EMIT_PP_CNTL:
+ ctx->pp_cntl = buf[i++];
+ ctx->rb3d_cntl = buf[i++];
+ ctx->rb3d_coloroffset = buf[i++];
+ sarea->dirty |= RADEON_UPLOAD_CONTEXT;
+ break;
+ case RADEON_EMIT_RB3D_COLORPITCH:
+ ctx->rb3d_colorpitch = buf[i++];
+ sarea->dirty |= RADEON_UPLOAD_CONTEXT;
+ break;
+ case RADEON_EMIT_RE_LINE_PATTERN:
+ ctx->re_line_pattern = buf[i++];
+ ctx->re_line_state = buf[i++];
+ sarea->dirty |= RADEON_UPLOAD_LINE;
+ break;
+ case RADEON_EMIT_SE_LINE_WIDTH:
+ ctx->se_line_width = buf[i++];
+ sarea->dirty |= RADEON_UPLOAD_LINE;
+ break;
+ case RADEON_EMIT_PP_LUM_MATRIX:
+ ctx->pp_lum_matrix = buf[i++];
+ sarea->dirty |= RADEON_UPLOAD_BUMPMAP;
+ break;
+ case RADEON_EMIT_PP_ROT_MATRIX_0:
+ ctx->pp_rot_matrix_0 = buf[i++];
+ ctx->pp_rot_matrix_1 = buf[i++];
+ sarea->dirty |= RADEON_UPLOAD_BUMPMAP;
+ break;
+ case RADEON_EMIT_RB3D_STENCILREFMASK:
+ ctx->rb3d_stencilrefmask = buf[i++];
+ ctx->rb3d_ropcntl = buf[i++];
+ ctx->rb3d_planemask = buf[i++];
+ sarea->dirty |= RADEON_UPLOAD_MASKS;
+ break;
+ case RADEON_EMIT_SE_VPORT_XSCALE:
+ ctx->se_vport_xscale = buf[i++];
+ ctx->se_vport_xoffset = buf[i++];
+ ctx->se_vport_yscale = buf[i++];
+ ctx->se_vport_yoffset = buf[i++];
+ ctx->se_vport_zscale = buf[i++];
+ ctx->se_vport_zoffset = buf[i++];
+ sarea->dirty |= RADEON_UPLOAD_VIEWPORT;
+ break;
+ case RADEON_EMIT_SE_CNTL:
+ ctx->se_cntl = buf[i++];
+ ctx->se_coord_fmt = buf[i++];
+ sarea->dirty |= RADEON_UPLOAD_CONTEXT | RADEON_UPLOAD_VERTFMT;
+ break;
+ case RADEON_EMIT_SE_CNTL_STATUS:
+ ctx->se_cntl_status = buf[i++];
+ sarea->dirty |= RADEON_UPLOAD_SETUP;
+ break;
+ case RADEON_EMIT_RE_MISC:
+ ctx->re_misc = buf[i++];
+ sarea->dirty |= RADEON_UPLOAD_MISC;
+ break;
+ case RADEON_EMIT_PP_TXFILTER_0:
+ tex0->pp_txfilter = buf[i++];
+ tex0->pp_txformat = buf[i++];
+ tex0->pp_txoffset = buf[i++];
+ tex0->pp_txcblend = buf[i++];
+ tex0->pp_txablend = buf[i++];
+ tex0->pp_tfactor = buf[i++];
+ sarea->dirty |= RADEON_UPLOAD_TEX0;
+ break;
+ case RADEON_EMIT_PP_BORDER_COLOR_0:
+ tex0->pp_border_color = buf[i++];
+ sarea->dirty |= RADEON_UPLOAD_TEX0;
+ break;
+ case RADEON_EMIT_PP_TXFILTER_1:
+ tex1->pp_txfilter = buf[i++];
+ tex1->pp_txformat = buf[i++];
+ tex1->pp_txoffset = buf[i++];
+ tex1->pp_txcblend = buf[i++];
+ tex1->pp_txablend = buf[i++];
+ tex1->pp_tfactor = buf[i++];
+ sarea->dirty |= RADEON_UPLOAD_TEX1;
+ break;
+ case RADEON_EMIT_PP_BORDER_COLOR_1:
+ tex1->pp_border_color = buf[i++];
+ sarea->dirty |= RADEON_UPLOAD_TEX1;
+ break;
+
+ case RADEON_EMIT_SE_ZBIAS_FACTOR:
+ i++;
+ i++;
+ break;
+
+ case RADEON_EMIT_PP_TXFILTER_2:
+ case RADEON_EMIT_PP_BORDER_COLOR_2:
+ case RADEON_EMIT_SE_TCL_OUTPUT_VTX_FMT:
+ case RADEON_EMIT_SE_TCL_MATERIAL_EMMISSIVE_RED:
+ default:
+ /* These states aren't understood by radeon drm 1.1 */
+ fprintf(stderr, "Tried to emit unsupported state\n");
+ return;
+ }
+ }
+}
+
+
+
+static void radeonCompatEmitStateLocked( radeonContextPtr rmesa )
+{
+ struct radeon_state_atom *state, *tmp;
+
+ if (RADEON_DEBUG & (DEBUG_STATE|DEBUG_PRIMS))
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ if (rmesa->lost_context) {
+ if (RADEON_DEBUG & (DEBUG_STATE|DEBUG_PRIMS|DEBUG_IOCTL))
+ fprintf(stderr, "%s - lost context\n", __FUNCTION__);
+
+ foreach_s( state, tmp, &(rmesa->hw.clean) )
+ move_to_tail(&(rmesa->hw.dirty), state );
+
+ rmesa->lost_context = 0;
+ }
+
+ foreach_s( state, tmp, &(rmesa->hw.dirty) ) {
+ if (!state->is_tcl)
+ radeonCompatEmitPacket( rmesa, state );
+ move_to_head( &(rmesa->hw.clean), state );
+ }
+}
+
+
+
+static void radeonCompatEmitPrimitiveLocked( radeonContextPtr rmesa,
+ GLuint hw_primitive,
+ GLuint nverts,
+ XF86DRIClipRectPtr pbox,
+ GLuint nbox )
+{
+ int i;
+
+ for ( i = 0 ; i < nbox ; ) {
+ int nr = MIN2( i + RADEON_NR_SAREA_CLIPRECTS, nbox );
+ XF86DRIClipRectPtr b = rmesa->sarea->boxes;
+ drmRadeonVertex vtx;
+
+ rmesa->sarea->dirty |= RADEON_UPLOAD_CLIPRECTS;
+ rmesa->sarea->nbox = nr - i;
+
+ for ( ; i < nr ; i++)
+ *b++ = pbox[i];
+
+ if (RADEON_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr,
+ "RadeonFlushVertexBuffer: prim %x buf %d verts %d "
+ "disc %d nbox %d\n",
+ hw_primitive,
+ rmesa->dma.current.buf->buf->idx,
+ nverts,
+ nr == nbox,
+ rmesa->sarea->nbox );
+
+ vtx.prim = hw_primitive;
+ vtx.idx = rmesa->dma.current.buf->buf->idx;
+ vtx.count = nverts;
+ vtx.discard = (nr == nbox);
+
+ drmCommandWrite( rmesa->dri.fd,
+ DRM_RADEON_VERTEX,
+ &vtx, sizeof(vtx));
+ }
+}
+
+
+
+/* No 'start' for 1.1 vertices ioctl: only one vertex prim/buffer!
+ */
+void radeonCompatEmitPrimitive( radeonContextPtr rmesa,
+ GLuint vertex_format,
+ GLuint hw_primitive,
+ GLuint nrverts )
+{
+ if (RADEON_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ LOCK_HARDWARE( rmesa );
+
+ radeonCompatEmitStateLocked( rmesa );
+ rmesa->sarea->vc_format = vertex_format;
+
+ if (rmesa->state.scissor.enabled) {
+ radeonCompatEmitPrimitiveLocked( rmesa,
+ hw_primitive,
+ nrverts,
+ rmesa->state.scissor.pClipRects,
+ rmesa->state.scissor.numClipRects );
+ }
+ else {
+ radeonCompatEmitPrimitiveLocked( rmesa,
+ hw_primitive,
+ nrverts,
+ rmesa->pClipRects,
+ rmesa->numClipRects );
+ }
+
+
+ UNLOCK_HARDWARE( rmesa );
+}
+
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_context.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_context.c
index 690e30af4..305fde928 100644
--- a/xc/lib/GL/mesa/src/drv/radeon/radeon_context.c
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_context.c
@@ -31,18 +31,17 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* Authors:
* Kevin E. Martin <martin@valinux.com>
* Gareth Hughes <gareth@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*
*/
-#include <stdlib.h>
-
-#include "radeon_context.h"
-#include "radeon_ioctl.h"
-#include "radeon_state.h"
-#include "radeon_span.h"
-#include "radeon_tex.h"
-#include "radeon_tris.h"
-#include "radeon_vb.h"
+#include "glheader.h"
+#include "imports.h"
+#include "api_arrayelt.h"
+#include "context.h"
+#include "simple_list.h"
+#include "matrix.h"
+#include "extensions.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
@@ -51,36 +50,32 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "tnl/tnl.h"
#include "tnl/t_pipeline.h"
-#include "context.h"
-#include "simple_list.h"
-#include "mem.h"
-#include "matrix.h"
-#include "extensions.h"
+#include "radeon_context.h"
+#include "radeon_ioctl.h"
+#include "radeon_state.h"
+#include "radeon_span.h"
+#include "radeon_tex.h"
+#include "radeon_swtcl.h"
+#include "radeon_tcl.h"
+#include "radeon_vtxfmt.h"
+#include "radeon_maos.h"
+
#if defined(USE_X86_ASM)
#include "X86/common_x86_asm.h"
#endif
-#define RADEON_DATE "20020221"
+#define RADEON_DATE "20021125"
#ifndef RADEON_DEBUG
-int RADEON_DEBUG = (0
-/* | DEBUG_ALWAYS_SYNC */
-/* | DEBUG_VERBOSE_API */
-/* | DEBUG_VERBOSE_MSG */
-/* | DEBUG_VERBOSE_LRU */
-/* | DEBUG_VERBOSE_DRI */
-/* | DEBUG_VERBOSE_IOCTL */
-/* | DEBUG_VERBOSE_2D */
-/* | DEBUG_VERBOSE_TEXTURE */
- );
+int RADEON_DEBUG = (0);
#endif
-/* Return the width and height of the current color buffer.
+/* Return the width and height of the given buffer.
*/
static void radeonGetBufferSize( GLframebuffer *buffer,
- GLuint *width, GLuint *height )
+ GLuint *width, GLuint *height )
{
GET_CURRENT_CONTEXT(ctx);
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
@@ -100,10 +95,10 @@ static const GLubyte *radeonGetString( GLcontext *ctx, GLenum name )
switch ( name ) {
case GL_VENDOR:
- return (GLubyte *)"VA Linux Systems, Inc.";
+ return (GLubyte *)"Tungsten Graphics, Inc.";
case GL_RENDERER:
- sprintf( buffer, "Mesa DRI Radeon " RADEON_DATE );
+ sprintf( buffer, "Mesa DRI Radeon " RADEON_DATE);
/* Append any chipset-specific information. None yet.
*/
@@ -144,6 +139,18 @@ static const GLubyte *radeonGetString( GLcontext *ctx, GLenum name )
}
#endif
#endif
+
+ if ( rmesa->dri.drmMinor < 3 ) {
+ strncat( buffer, " DRM-COMPAT", 11 );
+ }
+
+ if ( !(rmesa->TclFallback & RADEON_TCL_FALLBACK_TCL_DISABLE) ) {
+ strncat( buffer, " TCL", 4 );
+ }
+ else {
+ strncat( buffer, " NO-TCL", 7 );
+ }
+
return (GLubyte *)buffer;
default:
@@ -151,76 +158,81 @@ static const GLubyte *radeonGetString( GLcontext *ctx, GLenum name )
}
}
-/* Send all commands to the hardware. If vertex buffers or indirect
- * buffers are in use, then we need to make sure they are sent to the
- * hardware. All commands that are normally sent to the ring are
- * already considered `flushed'.
- */
-static void radeonFlush( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- RADEON_FIREVERTICES( rmesa );
-
- if ( rmesa->boxes ) {
- LOCK_HARDWARE( rmesa );
- radeonPerformanceBoxesLocked( rmesa );
- UNLOCK_HARDWARE( rmesa );
- }
- /* Log the performance counters if necessary */
- radeonPerformanceCounters( rmesa );
-}
-
-/* Make sure all commands have been sent to the hardware and have
- * completed processing.
+/* Extension strings exported by the R100 driver.
*/
-static void radeonFinish( GLcontext *ctx )
+static const char * const radeon_extensions[] =
{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- /* Bump the performance counter */
- rmesa->c_drawWaits++;
- radeonFlush( ctx );
- LOCK_HARDWARE( rmesa );
- radeonWaitForIdleLocked( rmesa );
- UNLOCK_HARDWARE( rmesa );
-}
-
+ "GL_ARB_multisample",
+ "GL_ARB_multitexture",
+ "GL_ARB_texture_border_clamp",
+ "GL_ARB_texture_compression",
+ "GL_ARB_texture_env_add",
+ "GL_ARB_texture_env_combine",
+ "GL_ARB_texture_env_dot3",
+ "GL_ARB_texture_mirrored_repeat",
+ "GL_EXT_blend_logic_op",
+ "GL_EXT_blend_subtract",
+/* "GL_EXT_fog_coord", */
+ "GL_EXT_secondary_color",
+ "GL_EXT_texture_env_add",
+ "GL_EXT_texture_env_combine",
+ "GL_EXT_texture_env_dot3",
+ "GL_EXT_texture_filter_anisotropic",
+ "GL_EXT_texture_lod_bias",
+ "GL_ATI_texture_env_combine3",
+ "GL_ATI_texture_mirror_once",
+ "GL_IBM_texture_mirrored_repeat",
+ "GL_NV_blend_square",
+ "GL_SGIS_generate_mipmap",
+ "GL_SGIS_texture_border_clamp",
+ NULL
+};
/* Initialize the extensions supported by this driver.
*/
static void radeonInitExtensions( GLcontext *ctx )
{
+ unsigned i;
_mesa_enable_imaging_extensions( ctx );
- _mesa_enable_extension( ctx, "GL_ARB_multitexture" );
- _mesa_enable_extension( ctx, "GL_ARB_texture_env_add" );
-
- _mesa_enable_extension( ctx, "GL_EXT_blend_logic_op" );
- _mesa_enable_extension( ctx, "GL_EXT_texture_env_add" );
- _mesa_enable_extension( ctx, "GL_EXT_texture_env_combine" );
- _mesa_enable_extension( ctx, "GL_EXT_texture_env_dot3" );
- _mesa_enable_extension( ctx, "GL_EXT_texture_filter_anisotropic" );
- _mesa_enable_extension( ctx, "GL_EXT_texture_lod_bias" );
-
+ for ( i = 0 ; radeon_extensions[i] != NULL ; i++ ) {
+ _mesa_enable_extension( ctx, radeon_extensions[i] );
+ }
}
extern const struct gl_pipeline_stage _radeon_render_stage;
-extern const struct gl_pipeline_stage _radeon_tcl_render_stage;
+extern const struct gl_pipeline_stage _radeon_tcl_stage;
static const struct gl_pipeline_stage *radeon_pipeline[] = {
+
+ /* Try and go straight to t&l
+ */
+ &_radeon_tcl_stage,
+
+ /* Catch any t&l fallbacks
+ */
&_tnl_vertex_transform_stage,
&_tnl_normal_transform_stage,
&_tnl_lighting_stage,
&_tnl_fog_coordinate_stage,
&_tnl_texgen_stage,
&_tnl_texture_transform_stage,
- /* REMOVE: point attenuation stage */
-#if 1
- &_radeon_render_stage, /* ADD: unclipped rastersetup-to-dma */
-#endif
- &_tnl_render_stage,
+
+ /* Try again to go to tcl?
+ * - no good for asymmetric-twoside (do with multipass)
+ * - no good for asymmetric-unfilled (do with multipass)
+ * - good for material
+ * - good for texgen
+ * - need to manipulate a bit of state
+ *
+ * - worth it/not worth it?
+ */
+
+ /* Else do them here.
+ */
+ &_radeon_render_stage,
+ &_tnl_render_stage, /* FALLBACK: */
0,
};
@@ -231,9 +243,8 @@ static const struct gl_pipeline_stage *radeon_pipeline[] = {
static void radeonInitDriverFuncs( GLcontext *ctx )
{
ctx->Driver.GetBufferSize = radeonGetBufferSize;
+ ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
ctx->Driver.GetString = radeonGetString;
- ctx->Driver.Finish = radeonFinish;
- ctx->Driver.Flush = radeonFlush;
ctx->Driver.Error = NULL;
ctx->Driver.DrawPixels = NULL;
@@ -245,7 +256,7 @@ static void radeonInitDriverFuncs( GLcontext *ctx )
/* Create the device specific context.
*/
static GLboolean
-radeonCreateContext( Display *dpy, const __GLcontextModes *glVisual,
+radeonCreateContext( const __GLcontextModes *glVisual,
__DRIcontextPrivate *driContextPriv,
void *sharedContextPrivate)
{
@@ -255,7 +266,6 @@ radeonCreateContext( Display *dpy, const __GLcontextModes *glVisual,
GLcontext *ctx, *shareCtx;
int i;
- assert(dpy);
assert(glVisual);
assert(driContextPriv);
assert(radeonScreen);
@@ -270,7 +280,7 @@ radeonCreateContext( Display *dpy, const __GLcontextModes *glVisual,
shareCtx = ((radeonContextPtr) sharedContextPrivate)->glCtx;
else
shareCtx = NULL;
- rmesa->glCtx = _mesa_create_context(glVisual, shareCtx, rmesa, GL_TRUE);
+ rmesa->glCtx = _mesa_create_context(glVisual, shareCtx, (void *) rmesa, GL_TRUE);
if (!rmesa->glCtx) {
FREE(rmesa);
return GL_FALSE;
@@ -278,7 +288,6 @@ radeonCreateContext( Display *dpy, const __GLcontextModes *glVisual,
driContextPriv->driverPrivate = rmesa;
/* Init radeon context data */
- rmesa->dri.display = dpy;
rmesa->dri.context = driContextPriv;
rmesa->dri.screen = sPriv;
rmesa->dri.drawable = NULL; /* Set by XMesaMakeCurrent */
@@ -286,11 +295,20 @@ radeonCreateContext( Display *dpy, const __GLcontextModes *glVisual,
rmesa->dri.hwLock = &sPriv->pSAREA->lock;
rmesa->dri.fd = sPriv->fd;
+ /* If we don't have 1.3, fallback to the 1.1 interfaces.
+ */
+ if (getenv("RADEON_COMPAT") || sPriv->drmMinor < 3 )
+ rmesa->dri.drmMinor = 1;
+ else
+ rmesa->dri.drmMinor = sPriv->drmMinor;
+
rmesa->radeonScreen = radeonScreen;
rmesa->sarea = (RADEONSAREAPrivPtr)((GLubyte *)sPriv->pSAREA +
radeonScreen->sarea_priv_offset);
+ rmesa->dma.buf0_address = rmesa->radeonScreen->buffers->list[0].address;
+
for ( i = 0 ; i < radeonScreen->numTexHeaps ; i++ ) {
make_empty_list( &rmesa->texture.objects[i] );
rmesa->texture.heap[i] = mmInit( 0, radeonScreen->texSize[i] );
@@ -299,9 +317,8 @@ radeonCreateContext( Display *dpy, const __GLcontextModes *glVisual,
rmesa->texture.numHeaps = radeonScreen->numTexHeaps;
make_empty_list( &rmesa->texture.swapped );
- rmesa->RenderIndex = ~0;
- rmesa->state.hw.dirty = RADEON_UPLOAD_CONTEXT_ALL;
- rmesa->upload_cliprects = 1;
+ rmesa->swtcl.RenderIndex = ~0;
+ rmesa->lost_context = 1;
/* KW: Set the maximum texture size small enough that we can
* guarentee that both texture units can bind a maximal texture
@@ -338,17 +355,20 @@ radeonCreateContext( Display *dpy, const __GLcontextModes *glVisual,
ctx->Const.MaxLineWidthAA = 10.0;
ctx->Const.LineWidthGranularity = 0.0625;
+ /* Set maxlocksize (and hence vb size) small enough to avoid
+ * fallbacks in radeon_tcl.c. ie. guarentee that all vertices can
+ * fit in a single dma buffer for indexed rendering of quad strips,
+ * etc.
+ */
+ ctx->Const.MaxArrayLockSize =
+ MIN2( ctx->Const.MaxArrayLockSize,
+ RADEON_BUFFER_SIZE / RADEON_MAX_TCL_VERTSIZE );
+
if (getenv("LIBGL_PERFORMANCE_BOXES"))
rmesa->boxes = 1;
else
rmesa->boxes = 0;
- {
- const char *debug = getenv("LIBGL_DEBUG");
- if (debug && strstr(debug, "fallbacks")) {
- rmesa->debugFallbacks = GL_TRUE;
- }
- }
/* Initialize the software rasterizer and helper modules.
*/
@@ -356,29 +376,150 @@ radeonCreateContext( Display *dpy, const __GLcontextModes *glVisual,
_ac_CreateContext( ctx );
_tnl_CreateContext( ctx );
_swsetup_CreateContext( ctx );
-
+ _ae_create_context( ctx );
/* Install the customized pipeline:
*/
_tnl_destroy_pipeline( ctx );
_tnl_install_pipeline( ctx, radeon_pipeline );
+ /* Try and keep materials and vertices separate:
+ */
+ _tnl_isolate_materials( ctx, GL_TRUE );
+
+
+/* _mesa_allow_light_in_model( ctx, GL_FALSE ); */
+
/* Configure swrast to match hardware characteristics:
*/
_swrast_allow_pixel_fog( ctx, GL_FALSE );
_swrast_allow_vertex_fog( ctx, GL_TRUE );
- radeonInitVB( ctx );
+
+ _math_matrix_ctr( &rmesa->TexGenMatrix[0] );
+ _math_matrix_ctr( &rmesa->TexGenMatrix[1] );
+ _math_matrix_ctr( &rmesa->tmpmat );
+ _math_matrix_set_identity( &rmesa->TexGenMatrix[0] );
+ _math_matrix_set_identity( &rmesa->TexGenMatrix[1] );
+ _math_matrix_set_identity( &rmesa->tmpmat );
+
radeonInitExtensions( ctx );
radeonInitDriverFuncs( ctx );
radeonInitIoctlFuncs( ctx );
radeonInitStateFuncs( ctx );
radeonInitSpanFuncs( ctx );
radeonInitTextureFuncs( ctx );
- radeonInitTriFuncs( ctx );
-
radeonInitState( rmesa );
+ radeonInitSwtcl( ctx );
+
+ rmesa->do_irqs = (rmesa->radeonScreen->irq && !getenv("RADEON_NO_IRQS"));
+ rmesa->irqsEmitted = 0;
+ rmesa->iw.irq_seq = -1;
+
+ rmesa->do_usleeps = !getenv("RADEON_NO_USLEEPS");
+
+#if DO_DEBUG
+ if (getenv("RADEON_DEBUG_FALLBACKS"))
+ RADEON_DEBUG |= DEBUG_FALLBACKS;
+ if (getenv("RADEON_DEBUG_TEXTURE"))
+ RADEON_DEBUG |= DEBUG_TEXTURE;
+
+ if (getenv("RADEON_DEBUG_IOCTL"))
+ RADEON_DEBUG |= DEBUG_IOCTL;
+
+ if (getenv("RADEON_DEBUG_PRIMS"))
+ RADEON_DEBUG |= DEBUG_PRIMS;
+
+ if (getenv("RADEON_DEBUG_VERTS"))
+ RADEON_DEBUG |= DEBUG_VERTS;
+
+ if (getenv("RADEON_DEBUG_STATE"))
+ RADEON_DEBUG |= DEBUG_STATE;
+
+ if (getenv("RADEON_DEBUG_CODEGEN"))
+ RADEON_DEBUG |= DEBUG_CODEGEN;
+
+ if (getenv("RADEON_DEBUG_VTXFMT"))
+ RADEON_DEBUG |= DEBUG_VFMT;
+
+ if (getenv("RADEON_DEBUG_VERBOSE"))
+ RADEON_DEBUG |= DEBUG_VERBOSE;
+
+ if (getenv("RADEON_DEBUG_DRI"))
+ RADEON_DEBUG |= DEBUG_DRI;
+
+ if (getenv("RADEON_DEBUG_DMA"))
+ RADEON_DEBUG |= DEBUG_DMA;
+
+ if (getenv("RADEON_DEBUG_SANITY"))
+ RADEON_DEBUG |= DEBUG_SANITY;
+
+ if (getenv("RADEON_DEBUG"))
+ {
+ const char *debug = getenv("RADEON_DEBUG");
+ if (strstr(debug, "fall"))
+ RADEON_DEBUG |= DEBUG_FALLBACKS;
+
+ if (strstr(debug, "tex"))
+ RADEON_DEBUG |= DEBUG_TEXTURE;
+
+ if (strstr(debug, "ioctl"))
+ RADEON_DEBUG |= DEBUG_IOCTL;
+
+ if (strstr(debug, "prim"))
+ RADEON_DEBUG |= DEBUG_PRIMS;
+
+ if (strstr(debug, "vert"))
+ RADEON_DEBUG |= DEBUG_VERTS;
+
+ if (strstr(debug, "state"))
+ RADEON_DEBUG |= DEBUG_STATE;
+
+ if (strstr(debug, "code"))
+ RADEON_DEBUG |= DEBUG_CODEGEN;
+
+ if (strstr(debug, "vfmt") || strstr(debug, "vtxf"))
+ RADEON_DEBUG |= DEBUG_VFMT;
+
+ if (strstr(debug, "verb"))
+ RADEON_DEBUG |= DEBUG_VERBOSE;
+
+ if (strstr(debug, "dri"))
+ RADEON_DEBUG |= DEBUG_DRI;
+
+ if (strstr(debug, "dma"))
+ RADEON_DEBUG |= DEBUG_DMA;
+
+ if (strstr(debug, "san"))
+ RADEON_DEBUG |= DEBUG_SANITY;
+ }
+
+
+#endif
+
+ if (getenv("RADEON_NO_RAST")) {
+ fprintf(stderr, "disabling 3D acceleration\n");
+ FALLBACK(rmesa, RADEON_FALLBACK_DISABLE, 1);
+ }
+ else if (getenv("RADEON_TCL_FORCE_ENABLE")) {
+ fprintf(stderr, "Enabling TCL support... this will probably crash\n");
+ fprintf(stderr, " your card if it isn't capable of TCL!\n");
+ rmesa->radeonScreen->chipset |= RADEON_CHIPSET_TCL;
+ } else if (getenv("RADEON_TCL_FORCE_DISABLE") ||
+ rmesa->dri.drmMinor < 3 ||
+ !(rmesa->radeonScreen->chipset & RADEON_CHIPSET_TCL)) {
+ rmesa->radeonScreen->chipset &= ~RADEON_CHIPSET_TCL;
+ fprintf(stderr, "disabling TCL support\n");
+ TCL_FALLBACK(rmesa->glCtx, RADEON_TCL_FALLBACK_TCL_DISABLE, 1);
+ }
+
+ if (rmesa->radeonScreen->chipset & RADEON_CHIPSET_TCL) {
+ if (!getenv("RADEON_NO_VTXFMT"))
+ radeonVtxfmtInit( ctx );
+
+ _tnl_need_dlist_norm_lengths( ctx, GL_FALSE );
+ }
return GL_TRUE;
}
@@ -396,6 +537,7 @@ radeonDestroyContext( __DRIcontextPrivate *driContextPriv )
/* check if we're deleting the currently bound context */
if (rmesa == current) {
+ RADEON_FIREVERTICES( rmesa );
_mesa_make_current2(NULL, NULL, NULL);
}
@@ -414,6 +556,7 @@ radeonDestroyContext( __DRIcontextPrivate *driContextPriv )
radeonDestroyTexObj( rmesa, t );
}
mmDestroy( rmesa->texture.heap[i] );
+ rmesa->texture.heap[i] = NULL;
}
foreach_s ( t, next_t, &rmesa->texture.swapped ) {
@@ -426,12 +569,27 @@ radeonDestroyContext( __DRIcontextPrivate *driContextPriv )
_ac_DestroyContext( rmesa->glCtx );
_swrast_DestroyContext( rmesa->glCtx );
- radeonFreeVB( rmesa->glCtx );
+ radeonDestroySwtcl( rmesa->glCtx );
+
+ radeonReleaseArrays( rmesa->glCtx, ~0 );
+ if (rmesa->dma.current.buf) {
+ radeonReleaseDmaRegion( rmesa, &rmesa->dma.current, __FUNCTION__ );
+ radeonFlushCmdBuf( rmesa, __FUNCTION__ );
+ }
+
+ if (!rmesa->TclFallback & RADEON_TCL_FALLBACK_TCL_DISABLE)
+ if (!getenv("RADEON_NO_VTXFMT"))
+ radeonVtxfmtDestroy( rmesa->glCtx );
/* free the Mesa context */
rmesa->glCtx->DriverCtx = NULL;
_mesa_destroy_context( rmesa->glCtx );
+ if (rmesa->state.scissor.pClipRects) {
+ FREE(rmesa->state.scissor.pClipRects);
+ rmesa->state.scissor.pClipRects = 0;
+ }
+
FREE( rmesa );
}
@@ -461,8 +619,7 @@ radeonInitDriver( __DRIscreenPrivate *sPriv )
* data.
*/
static GLboolean
-radeonCreateBuffer( Display *dpy,
- __DRIscreenPrivate *driScrnPriv,
+radeonCreateBuffer( __DRIscreenPrivate *driScrnPriv,
__DRIdrawablePrivate *driDrawPriv,
const __GLcontextModes *mesaVis,
GLboolean isPixmap )
@@ -496,10 +653,8 @@ radeonDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
static void
-radeonSwapBuffers(Display *dpy, void *drawablePrivate)
+radeonSwapBuffers( __DRIdrawablePrivate *dPriv )
{
- __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
- (void) dpy;
if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
radeonContextPtr rmesa;
@@ -507,7 +662,8 @@ radeonSwapBuffers(Display *dpy, void *drawablePrivate)
rmesa = (radeonContextPtr) dPriv->driContextPriv->driverPrivate;
ctx = rmesa->glCtx;
if (ctx->Visual.doubleBufferMode) {
- _mesa_swapbuffers( ctx ); /* flush pending rendering comands */
+ _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */
+
if ( rmesa->doPageFlip ) {
radeonPageFlip( dPriv );
}
@@ -532,21 +688,14 @@ radeonMakeCurrent( __DRIcontextPrivate *driContextPriv,
__DRIdrawablePrivate *driReadPriv )
{
if ( driContextPriv ) {
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr oldRadeonCtx = ctx ? RADEON_CONTEXT(ctx) : NULL;
- radeonContextPtr newRadeonCtx = (radeonContextPtr) driContextPriv->driverPrivate;
-
- if ( newRadeonCtx != oldRadeonCtx ) {
- newRadeonCtx->state.hw.dirty = RADEON_UPLOAD_CONTEXT_ALL;
- if ( newRadeonCtx->state.texture.unit[0].texobj )
- newRadeonCtx->state.hw.dirty |= RADEON_UPLOAD_TEX0;
- if ( newRadeonCtx->state.texture.unit[1].texobj )
- newRadeonCtx->state.hw.dirty |= RADEON_UPLOAD_TEX1;
- }
+ radeonContextPtr newRadeonCtx =
+ (radeonContextPtr) driContextPriv->driverPrivate;
+
+ if (RADEON_DEBUG & DEBUG_DRI)
+ fprintf(stderr, "%s ctx %p\n", __FUNCTION__, newRadeonCtx->glCtx);
if ( newRadeonCtx->dri.drawable != driDrawPriv ) {
newRadeonCtx->dri.drawable = driDrawPriv;
- newRadeonCtx->upload_cliprects = 1;
radeonUpdateWindow( newRadeonCtx->glCtx );
radeonUpdateViewportOffset( newRadeonCtx->glCtx );
}
@@ -559,10 +708,18 @@ radeonMakeCurrent( __DRIcontextPrivate *driContextPriv,
_mesa_set_viewport( newRadeonCtx->glCtx, 0, 0,
driDrawPriv->w, driDrawPriv->h );
}
+
+ if (newRadeonCtx->vb.enabled)
+ radeonVtxfmtMakeCurrent( newRadeonCtx->glCtx );
+
} else {
+ if (RADEON_DEBUG & DEBUG_DRI)
+ fprintf(stderr, "%s ctx %p\n", __FUNCTION__, NULL);
_mesa_make_current( 0, 0 );
}
+ if (RADEON_DEBUG & DEBUG_DRI)
+ fprintf(stderr, "End %s\n", __FUNCTION__);
return GL_TRUE;
}
@@ -571,67 +728,34 @@ radeonMakeCurrent( __DRIcontextPrivate *driContextPriv,
static GLboolean
radeonUnbindContext( __DRIcontextPrivate *driContextPriv )
{
- return GL_TRUE;
-}
-
-/* Initialize the fullscreen mode.
- */
-static GLboolean
-radeonOpenFullScreen( __DRIcontextPrivate *driContextPriv )
-{
-#if 0
- radeonContextPtr rmesa = (radeonContextPtr)driContextPriv->driverPrivate;
- GLint ret;
-
- /* FIXME: Do we need to check this?
- */
- if ( !rmesa->glCtx->Visual.doubleBufferMode )
- return GL_TRUE;
-
- LOCK_HARDWARE( rmesa );
- radeonWaitForIdleLocked( rmesa );
-
- /* Ignore errors. If this fails, we simply don't do page flipping.
- */
- ret = drmRadeonFullScreen( rmesa->driFd, GL_TRUE );
+ radeonContextPtr rmesa = (radeonContextPtr) driContextPriv->driverPrivate;
- UNLOCK_HARDWARE( rmesa );
+ if (RADEON_DEBUG & DEBUG_DRI)
+ fprintf(stderr, "%s ctx %p\n", __FUNCTION__, rmesa->glCtx);
- rmesa->doPageFlip = ( ret == 0 );
-#endif
+ radeonVtxfmtUnbindContext( rmesa->glCtx );
return GL_TRUE;
}
-/* Shut down the fullscreen mode.
+/* Fullscreen mode isn't used for much -- could be a way to shrink
+ * front/back buffers & get more texture memory if the client has
+ * changed the video resolution.
+ *
+ * Pageflipping is now done automatically whenever there is a single
+ * 3d client.
*/
static GLboolean
-radeonCloseFullScreen( __DRIcontextPrivate *driContextPriv )
+radeonOpenCloseFullScreen( __DRIcontextPrivate *driContextPriv )
{
-#if 0
- radeonContextPtr rmesa = (radeonContextPtr)driContextPriv->driverPrivate;
-
- LOCK_HARDWARE( rmesa );
- radeonWaitForIdleLocked( rmesa );
-
- /* Don't care if this fails, we're not page flipping anymore.
- */
- drmRadeonFullScreen( rmesa->driFd, GL_FALSE );
-
- UNLOCK_HARDWARE( rmesa );
-
- rmesa->doPageFlip = GL_FALSE;
- rmesa->currentPage = 0;
-#endif
return GL_TRUE;
}
-/* This function is called by libGL.so as soon as libGL.so is loaded.
- * This is where we'd register new extension functions with the dispatcher.
- */
+
void
__driRegisterExtensions( void )
{
+ /* See r200 driver for info */
}
@@ -646,8 +770,8 @@ static struct __DriverAPIRec radeonAPI = {
radeonSwapBuffers,
radeonMakeCurrent,
radeonUnbindContext,
- radeonOpenFullScreen,
- radeonCloseFullScreen
+ radeonOpenCloseFullScreen,
+ radeonOpenCloseFullScreen
};
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_context.h b/xc/lib/GL/mesa/src/drv/radeon/radeon_context.h
index 736f4c654..5208199de 100644
--- a/xc/lib/GL/mesa/src/drv/radeon/radeon_context.h
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_context.h
@@ -31,7 +31,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* Authors:
* Kevin E. Martin <martin@valinux.com>
* Gareth Hughes <gareth@valinux.com>
- * Keith Whitwell <keith_whitwell@yahoo.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
#ifndef __RADEON_CONTEXT_H__
@@ -39,34 +39,25 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifdef GLX_DIRECT_RENDERING
-#include <X11/Xlibint.h>
-
-#include "dri_util.h"
-
-#include "xf86drm.h"
-#include "xf86drmRadeon.h"
-
-#include "macros.h"
-#include "mtypes.h"
-
-#include "radeon_reg.h"
-
struct radeon_context;
typedef struct radeon_context radeonContextRec;
typedef struct radeon_context *radeonContextPtr;
+#include "mtypes.h"
+#include "macros.h"
#include "radeon_lock.h"
#include "radeon_screen.h"
#include "mm.h"
/* Flags for software fallback cases */
-/* See correponding strings in radeon_tris.c */
+/* See correponding strings in radeon_swtcl.c */
#define RADEON_FALLBACK_TEXTURE 0x0001
#define RADEON_FALLBACK_DRAW_BUFFER 0x0002
#define RADEON_FALLBACK_STENCIL 0x0004
#define RADEON_FALLBACK_RENDER_MODE 0x0008
#define RADEON_FALLBACK_BLEND_EQ 0x0010
#define RADEON_FALLBACK_BLEND_FUNC 0x0020
+#define RADEON_FALLBACK_DISABLE 0x0040
/* Use the templated vertex format:
*/
@@ -87,12 +78,9 @@ typedef void (*radeon_line_func)( radeonContextPtr,
typedef void (*radeon_point_func)( radeonContextPtr,
radeonVertex * );
-typedef void (*radeon_prim_func)( GLcontext *ctx );
-
struct radeon_colorbuffer_state {
GLuint clear;
-
GLint drawOffset, drawPitch;
};
@@ -109,6 +97,10 @@ struct radeon_pixel_state {
struct radeon_scissor_state {
XF86DRIClipRectRec rect;
GLboolean enabled;
+
+ GLuint numClipRects; /* Cliprects active */
+ GLuint numAllocedClipRects; /* Cliprects available */
+ XF86DRIClipRectPtr pClipRects;
};
struct radeon_stencilbuffer_state {
@@ -122,8 +114,9 @@ struct radeon_stipple_state {
-#define TEX_0 1
-#define TEX_1 2
+#define TEX_0 0x1
+#define TEX_1 0x2
+#define TEX_ALL 0x3
typedef struct radeon_tex_obj radeonTexObj, *radeonTexObjPtr;
@@ -142,7 +135,13 @@ struct radeon_tex_obj {
images need to be uploaded to
local or AGP texture space */
- GLint bound; /* Texture unit currently bound to */
+ GLuint dirty_state; /* Flags (1 per texunit) for
+ whether or not this texobj
+ has dirty hardware state
+ (pp_*) that needs to be
+ brought into the
+ texunit. */
+
GLint heap; /* Texture heap currently stored in */
drmRadeonTexImage image[RADEON_MAX_TEXTURE_LEVELS];
@@ -173,10 +172,253 @@ struct radeon_texture_state {
struct radeon_texture_env_state unit[RADEON_MAX_TEXTURE_UNITS];
};
-struct radeon_state {
- drmRadeonState hw;
+struct radeon_state_atom {
+ struct radeon_state_atom *next, *prev;
+ const char *name; /* for debug */
+ int cmd_size; /* size in bytes */
+ GLuint is_tcl;
+ int *cmd; /* one or more cmd's */
+ int *lastcmd; /* one or more cmd's */
+ GLboolean (*check)( GLcontext * ); /* is this state active? */
+};
+
+
+/* Trying to keep these relatively short as the variables are becoming
+ * extravagently long. Drop the RADEON_ off the front of everything -
+ * I think we know we're in the radeon driver by now, and keep the
+ * prefix to 3 letters unless absolutely impossible.
+ */
+
+#define CTX_CMD_0 0
+#define CTX_PP_MISC 1
+#define CTX_PP_FOG_COLOR 2
+#define CTX_RE_SOLID_COLOR 3
+#define CTX_RB3D_BLENDCNTL 4
+#define CTX_RB3D_DEPTHOFFSET 5
+#define CTX_RB3D_DEPTHPITCH 6
+#define CTX_RB3D_ZSTENCILCNTL 7
+#define CTX_CMD_1 8
+#define CTX_PP_CNTL 9
+#define CTX_RB3D_CNTL 10
+#define CTX_RB3D_COLOROFFSET 11
+#define CTX_CMD_2 12
+#define CTX_RB3D_COLORPITCH 13
+#define CTX_STATE_SIZE 14
+
+#define SET_CMD_0 0
+#define SET_SE_CNTL 1
+#define SET_SE_COORDFMT 2
+#define SET_CMD_1 3
+#define SET_SE_CNTL_STATUS 4
+#define SET_STATE_SIZE 5
+
+#define LIN_CMD_0 0
+#define LIN_RE_LINE_PATTERN 1
+#define LIN_RE_LINE_STATE 2
+#define LIN_CMD_1 3
+#define LIN_SE_LINE_WIDTH 4
+#define LIN_STATE_SIZE 5
+
+#define MSK_CMD_0 0
+#define MSK_RB3D_STENCILREFMASK 1
+#define MSK_RB3D_ROPCNTL 2
+#define MSK_RB3D_PLANEMASK 3
+#define MSK_STATE_SIZE 4
+
+#define VPT_CMD_0 0
+#define VPT_SE_VPORT_XSCALE 1
+#define VPT_SE_VPORT_XOFFSET 2
+#define VPT_SE_VPORT_YSCALE 3
+#define VPT_SE_VPORT_YOFFSET 4
+#define VPT_SE_VPORT_ZSCALE 5
+#define VPT_SE_VPORT_ZOFFSET 6
+#define VPT_STATE_SIZE 7
+
+#define MSC_CMD_0 0
+#define MSC_RE_MISC 1
+#define MSC_STATE_SIZE 2
+
+#define TEX_CMD_0 0
+#define TEX_PP_TXFILTER 1
+#define TEX_PP_TXFORMAT 2
+#define TEX_PP_TXOFFSET 3
+#define TEX_PP_TXCBLEND 4
+#define TEX_PP_TXABLEND 5
+#define TEX_PP_TFACTOR 6
+#define TEX_CMD_1 7
+#define TEX_PP_BORDER_COLOR 8
+#define TEX_STATE_SIZE 9
+
+#define ZBS_CMD_0 0
+#define ZBS_SE_ZBIAS_FACTOR 1
+#define ZBS_SE_ZBIAS_CONSTANT 2
+#define ZBS_STATE_SIZE 3
+
+#define TCL_CMD_0 0
+#define TCL_OUTPUT_VTXFMT 1
+#define TCL_OUTPUT_VTXSEL 2
+#define TCL_MATRIX_SELECT_0 3
+#define TCL_MATRIX_SELECT_1 4
+#define TCL_UCP_VERT_BLEND_CTL 5
+#define TCL_TEXTURE_PROC_CTL 6
+#define TCL_LIGHT_MODEL_CTL 7
+#define TCL_PER_LIGHT_CTL_0 8
+#define TCL_PER_LIGHT_CTL_1 9
+#define TCL_PER_LIGHT_CTL_2 10
+#define TCL_PER_LIGHT_CTL_3 11
+#define TCL_STATE_SIZE 12
+
+#define MTL_CMD_0 0
+#define MTL_EMMISSIVE_RED 1
+#define MTL_EMMISSIVE_GREEN 2
+#define MTL_EMMISSIVE_BLUE 3
+#define MTL_EMMISSIVE_ALPHA 4
+#define MTL_AMBIENT_RED 5
+#define MTL_AMBIENT_GREEN 6
+#define MTL_AMBIENT_BLUE 7
+#define MTL_AMBIENT_ALPHA 8
+#define MTL_DIFFUSE_RED 9
+#define MTL_DIFFUSE_GREEN 10
+#define MTL_DIFFUSE_BLUE 11
+#define MTL_DIFFUSE_ALPHA 12
+#define MTL_SPECULAR_RED 13
+#define MTL_SPECULAR_GREEN 14
+#define MTL_SPECULAR_BLUE 15
+#define MTL_SPECULAR_ALPHA 16
+#define MTL_SHININESS 17
+#define MTL_STATE_SIZE 18
+
+#define VTX_CMD_0 0
+#define VTX_SE_COORD_FMT 1
+#define VTX_STATE_SIZE 2
+
+#define MAT_CMD_0 0
+#define MAT_ELT_0 1
+#define MAT_STATE_SIZE 17
+
+#define GRD_CMD_0 0
+#define GRD_VERT_GUARD_CLIP_ADJ 1
+#define GRD_VERT_GUARD_DISCARD_ADJ 2
+#define GRD_HORZ_GUARD_CLIP_ADJ 3
+#define GRD_HORZ_GUARD_DISCARD_ADJ 4
+#define GRD_STATE_SIZE 5
+
+/* position changes frequently when lighting in modelpos - separate
+ * out to new state item?
+ */
+#define LIT_CMD_0 0
+#define LIT_AMBIENT_RED 1
+#define LIT_AMBIENT_GREEN 2
+#define LIT_AMBIENT_BLUE 3
+#define LIT_AMBIENT_ALPHA 4
+#define LIT_DIFFUSE_RED 5
+#define LIT_DIFFUSE_GREEN 6
+#define LIT_DIFFUSE_BLUE 7
+#define LIT_DIFFUSE_ALPHA 8
+#define LIT_SPECULAR_RED 9
+#define LIT_SPECULAR_GREEN 10
+#define LIT_SPECULAR_BLUE 11
+#define LIT_SPECULAR_ALPHA 12
+#define LIT_POSITION_X 13
+#define LIT_POSITION_Y 14
+#define LIT_POSITION_Z 15
+#define LIT_POSITION_W 16
+#define LIT_DIRECTION_X 17
+#define LIT_DIRECTION_Y 18
+#define LIT_DIRECTION_Z 19
+#define LIT_DIRECTION_W 20
+#define LIT_ATTEN_CONST 21
+#define LIT_ATTEN_LINEAR 22
+#define LIT_ATTEN_QUADRATIC 23
+#define LIT_ATTEN_XXX 24
+#define LIT_CMD_1 25
+#define LIT_SPOT_DCD 26
+#define LIT_SPOT_EXPONENT 27
+#define LIT_SPOT_CUTOFF 28
+#define LIT_SPECULAR_THRESH 29
+#define LIT_RANGE_CUTOFF 30 /* ? */
+#define LIT_RANGE_ATTEN 31 /* ? */
+#define LIT_STATE_SIZE 32
+
+/* Fog
+ */
+#define FOG_CMD_0 0
+#define FOG_R 1
+#define FOG_C 2
+#define FOG_D 3
+#define FOG_PAD 4
+#define FOG_STATE_SIZE 5
+
+/* UCP
+ */
+#define UCP_CMD_0 0
+#define UCP_X 1
+#define UCP_Y 2
+#define UCP_Z 3
+#define UCP_W 4
+#define UCP_STATE_SIZE 5
+
+/* GLT - Global ambient
+ */
+#define GLT_CMD_0 0
+#define GLT_RED 1
+#define GLT_GREEN 2
+#define GLT_BLUE 3
+#define GLT_ALPHA 4
+#define GLT_STATE_SIZE 5
+
+/* EYE
+ */
+#define EYE_CMD_0 0
+#define EYE_X 1
+#define EYE_Y 2
+#define EYE_Z 3
+#define EYE_RESCALE_FACTOR 4
+#define EYE_STATE_SIZE 5
+
+#define SHN_CMD_0 0
+#define SHN_SHININESS 1
+#define SHN_STATE_SIZE 2
+
+
+
+
+
+struct radeon_hw_state {
+ /* All state should be on one of these lists:
+ */
+ struct radeon_state_atom dirty; /* dirty list head placeholder */
+ struct radeon_state_atom clean; /* clean list head placeholder */
+
+ /* Hardware state, stored as cmdbuf commands:
+ * -- Need to doublebuffer for
+ * - reviving state after loss of context
+ * - eliding noop statechange loops? (except line stipple count)
+ */
+ struct radeon_state_atom ctx;
+ struct radeon_state_atom set;
+ struct radeon_state_atom lin;
+ struct radeon_state_atom msk;
+ struct radeon_state_atom vpt;
+ struct radeon_state_atom tcl;
+ struct radeon_state_atom msc;
+ struct radeon_state_atom tex[2];
+ struct radeon_state_atom zbs;
+ struct radeon_state_atom mtl;
+ struct radeon_state_atom mat[5];
+ struct radeon_state_atom lit[8]; /* includes vec, scl commands */
+ struct radeon_state_atom ucp[6];
+ struct radeon_state_atom eye; /* eye pos */
+ struct radeon_state_atom grd; /* guard band clipping */
+ struct radeon_state_atom fog;
+ struct radeon_state_atom glt;
+};
+
+struct radeon_state {
+ /* Derived state for internal purposes:
+ */
struct radeon_colorbuffer_state color;
struct radeon_depthbuffer_state depth;
struct radeon_pixel_state pixel;
@@ -196,18 +438,43 @@ struct radeon_texture {
GLint numHeaps;
};
+/* Need refcounting on dma buffers:
+ */
+struct radeon_dma_buffer {
+ int refcount; /* the number of retained regions in buf */
+ drmBufPtr buf;
+};
+
+#define GET_START(rvb) (rmesa->radeonScreen->agp_buffer_offset + \
+ (rvb)->address - rmesa->dma.buf0_address + \
+ (rvb)->start)
+
+/* A retained region, eg vertices for indexed vertices.
+ */
+struct radeon_dma_region {
+ struct radeon_dma_buffer *buf;
+ char *address; /* == buf->address */
+ int start, end, ptr; /* offsets from start of buf */
+ int aos_start;
+ int aos_stride;
+ int aos_size;
+};
+
struct radeon_dma {
- drmBufPtr buffer;
- drmBufPtr retained;
- GLubyte *address;
- GLuint low, high, last;
- GLuint offset;
+ /* Active dma region. Allocations for vertices and retained
+ * regions come from here. Also used for emitting random vertices,
+ * these may be flushed by calling flush_current();
+ */
+ struct radeon_dma_region current;
+
+ void (*flush)( radeonContextPtr );
+
+ char *buf0_address; /* start of buf[0], for index calcs */
+ GLuint nr_released_bufs; /* flush after so many buffers released */
};
struct radeon_dri_mirror {
- Display *display; /* X server display */
-
__DRIcontextPrivate *context; /* DRI context */
__DRIscreenPrivate *screen; /* DRI screen */
__DRIdrawablePrivate *drawable; /* DRI drawable bound to this ctx */
@@ -215,14 +482,205 @@ struct radeon_dri_mirror {
drmContext hwContext;
drmLock *hwLock;
int fd;
+ int drmMinor;
};
+
+#define RADEON_CMD_BUF_SZ (8*1024)
+
struct radeon_store {
- radeonTexObjPtr texture[2][RADEON_MAX_STATES];
- drmRadeonState state[RADEON_MAX_STATES];
- drmRadeonPrim prim[RADEON_MAX_PRIMS];
GLuint statenr;
GLuint primnr;
+ char cmd_buf[RADEON_CMD_BUF_SZ];
+ int cmd_used;
+ int elts_start;
+};
+
+
+/* radeon_tcl.c
+ */
+struct radeon_tcl_info {
+ GLuint vertex_format;
+ GLint last_offset;
+ GLuint hw_primitive;
+
+ struct radeon_dma_region *aos_components[8];
+ GLuint nr_aos_components;
+
+ GLuint *Elts;
+
+ struct radeon_dma_region indexed_verts;
+ struct radeon_dma_region obj;
+ struct radeon_dma_region rgba;
+ struct radeon_dma_region spec;
+ struct radeon_dma_region fog;
+ struct radeon_dma_region tex[RADEON_MAX_TEXTURE_UNITS];
+ struct radeon_dma_region norm;
+};
+
+
+/* radeon_swtcl.c
+ */
+struct radeon_swtcl_info {
+ GLuint SetupIndex;
+ GLuint SetupNewInputs;
+ GLuint RenderIndex;
+ GLuint vertex_size;
+ GLuint vertex_stride_shift;
+ GLuint vertex_format;
+ char *verts;
+
+ /* Fallback rasterization functions
+ */
+ radeon_point_func draw_point;
+ radeon_line_func draw_line;
+ radeon_tri_func draw_tri;
+
+ GLuint hw_primitive;
+ GLenum render_primitive;
+ GLuint numverts;
+
+ struct radeon_dma_region indexed_verts;
+};
+
+
+struct radeon_ioctl {
+ GLuint vertex_offset;
+ GLuint vertex_size;
+};
+
+
+
+#define RADEON_MAX_PRIMS 64
+
+
+/* Want to keep a cache of these around. Each is parameterized by
+ * only a single value which has only a small range. Only expect a
+ * few, so just rescan the list each time?
+ */
+struct dynfn {
+ struct dynfn *next, *prev;
+ int key;
+ char *code;
+};
+
+struct dfn_lists {
+ struct dynfn Vertex2f;
+ struct dynfn Vertex2fv;
+ struct dynfn Vertex3f;
+ struct dynfn Vertex3fv;
+ struct dynfn Color4ub;
+ struct dynfn Color4ubv;
+ struct dynfn Color3ub;
+ struct dynfn Color3ubv;
+ struct dynfn Color4f;
+ struct dynfn Color4fv;
+ struct dynfn Color3f;
+ struct dynfn Color3fv;
+ struct dynfn SecondaryColor3ubEXT;
+ struct dynfn SecondaryColor3ubvEXT;
+ struct dynfn SecondaryColor3fEXT;
+ struct dynfn SecondaryColor3fvEXT;
+ struct dynfn Normal3f;
+ struct dynfn Normal3fv;
+ struct dynfn TexCoord2f;
+ struct dynfn TexCoord2fv;
+ struct dynfn TexCoord1f;
+ struct dynfn TexCoord1fv;
+ struct dynfn MultiTexCoord2fARB;
+ struct dynfn MultiTexCoord2fvARB;
+ struct dynfn MultiTexCoord1fARB;
+ struct dynfn MultiTexCoord1fvARB;
+};
+
+struct _vb;
+
+struct dfn_generators {
+ struct dynfn *(*Vertex2f)( GLcontext *, int );
+ struct dynfn *(*Vertex2fv)( GLcontext *, int );
+ struct dynfn *(*Vertex3f)( GLcontext *, int );
+ struct dynfn *(*Vertex3fv)( GLcontext *, int );
+ struct dynfn *(*Color4ub)( GLcontext *, int );
+ struct dynfn *(*Color4ubv)( GLcontext *, int );
+ struct dynfn *(*Color3ub)( GLcontext *, int );
+ struct dynfn *(*Color3ubv)( GLcontext *, int );
+ struct dynfn *(*Color4f)( GLcontext *, int );
+ struct dynfn *(*Color4fv)( GLcontext *, int );
+ struct dynfn *(*Color3f)( GLcontext *, int );
+ struct dynfn *(*Color3fv)( GLcontext *, int );
+ struct dynfn *(*SecondaryColor3ubEXT)( GLcontext *, int );
+ struct dynfn *(*SecondaryColor3ubvEXT)( GLcontext *, int );
+ struct dynfn *(*SecondaryColor3fEXT)( GLcontext *, int );
+ struct dynfn *(*SecondaryColor3fvEXT)( GLcontext *, int );
+ struct dynfn *(*Normal3f)( GLcontext *, int );
+ struct dynfn *(*Normal3fv)( GLcontext *, int );
+ struct dynfn *(*TexCoord2f)( GLcontext *, int );
+ struct dynfn *(*TexCoord2fv)( GLcontext *, int );
+ struct dynfn *(*TexCoord1f)( GLcontext *, int );
+ struct dynfn *(*TexCoord1fv)( GLcontext *, int );
+ struct dynfn *(*MultiTexCoord2fARB)( GLcontext *, int );
+ struct dynfn *(*MultiTexCoord2fvARB)( GLcontext *, int );
+ struct dynfn *(*MultiTexCoord1fARB)( GLcontext *, int );
+ struct dynfn *(*MultiTexCoord1fvARB)( GLcontext *, int );
+};
+
+
+struct radeon_vb {
+ /* Keep these first: referenced from codegen templates:
+ */
+ GLint counter, initial_counter;
+ GLint *dmaptr;
+ void (*notify)( void );
+ GLint vertex_size;
+
+ /* A maximum total of 15 elements per vertex: 3 floats for position, 3
+ * floats for normal, 4 floats for color, 4 bytes for secondary color,
+ * 2 floats for each texture unit (4 floats total).
+ *
+ * As soon as the 3rd TMU is supported or cube maps (or 3D textures) are
+ * supported, this value will grow.
+ *
+ * The position data is never actually stored here, so 3 elements could be
+ * trimmed out of the buffer.
+ */
+ union { float f; int i; radeon_color_t color; } vertex[15];
+
+ GLfloat *normalptr;
+ GLfloat *floatcolorptr;
+ radeon_color_t *colorptr;
+ GLfloat *floatspecptr;
+ radeon_color_t *specptr;
+ GLfloat *texcoordptr[2];
+
+ GLcontext *context; /* current context : Single thread only! */
+};
+
+struct radeon_prim {
+ GLuint start;
+ GLuint end;
+ GLuint prim;
+};
+
+struct radeon_vbinfo {
+ GLenum *prim; /* &ctx->Driver.CurrentExecPrimitive */
+ GLuint primflags;
+ GLboolean enabled; /* RADEON_NO_VTXFMT//RADEON_NO_TCL env vars */
+ GLboolean installed;
+ GLboolean fell_back;
+ GLboolean recheck;
+ GLint initial_counter;
+ GLint nrverts;
+ GLuint vertex_format;
+
+ GLuint installed_vertex_format;
+ GLuint installed_color_3f_sz;
+
+ struct radeon_prim primlist[RADEON_MAX_PRIMS];
+ int nrprims;
+
+ struct dfn_lists dfn_cache;
+ struct dfn_generators codegen;
+ GLvertexformat vtxfmt;
};
@@ -233,31 +691,20 @@ struct radeon_context {
/* Driver and hardware state management
*/
+ struct radeon_hw_state hw;
struct radeon_state state;
/* Texture object bookkeeping
*/
struct radeon_texture texture;
- /* Fallback rasterization functions
- */
- radeon_point_func draw_point;
- radeon_line_func draw_line;
- radeon_tri_func draw_tri;
/* Rasterization and vertex state:
*/
- GLuint NewGLState;
+ GLuint TclFallback;
GLuint Fallback;
- GLuint SetupIndex;
- GLuint SetupNewInputs;
- GLuint RenderIndex;
+ GLuint NewGLState;
- GLuint vertex_size;
- GLuint vertex_stride_shift;
- GLuint vertex_format;
- GLuint num_verts;
- char *verts;
/* Temporaries for translating away float colors:
*/
@@ -266,34 +713,61 @@ struct radeon_context {
/* Vertex buffers
*/
+ struct radeon_ioctl ioctl;
struct radeon_dma dma;
-
struct radeon_store store;
- GLboolean upload_cliprects;
-
- GLuint hw_primitive;
- GLenum render_primitive;
/* Page flipping
*/
GLuint doPageFlip;
- GLuint currentPage;
+
+ /* Busy waiting
+ */
+ GLuint do_usleeps;
+ GLuint do_irqs;
+ GLuint irqsEmitted;
+ drmRadeonIrqWait iw;
/* Drawable, cliprect and scissor information
*/
GLuint numClipRects; /* Cliprects for the draw buffer */
XF86DRIClipRectPtr pClipRects;
- GLuint lastStamp;
+ unsigned int lastStamp;
+ GLboolean lost_context;
+ radeonScreenPtr radeonScreen; /* Screen private DRI data */
+ RADEONSAREAPrivPtr sarea; /* Private SAREA data */
- /* Mirrors of some DRI state
+ /* TCL stuff
*/
- struct radeon_dri_mirror dri;
+ GLmatrix TexGenMatrix[RADEON_MAX_TEXTURE_UNITS];
+ GLboolean recheck_texgen[RADEON_MAX_TEXTURE_UNITS];
+ GLboolean TexGenNeedNormals[RADEON_MAX_TEXTURE_UNITS];
+ GLuint TexMatEnabled;
+ GLuint TexGenEnabled;
+ GLmatrix tmpmat;
+ GLuint last_ReallyEnabled;
+
+ /* VBI
+ */
+ GLuint vbl_seq;
- radeonScreenPtr radeonScreen; /* Screen private DRI data */
- RADEONSAREAPrivPtr sarea; /* Private SAREA data */
+ /* radeon_tcl.c
+ */
+ struct radeon_tcl_info tcl;
- GLboolean debugFallbacks;
+ /* radeon_swtcl.c
+ */
+ struct radeon_swtcl_info swtcl;
+
+ /* radeon_vtxfmt.c
+ */
+ struct radeon_vbinfo vb;
+
+ /* Mirrors of some DRI state
+ */
+ struct radeon_dri_mirror dri;
+
/* Performance counters
*/
GLuint boxes; /* Draw performance boxes */
@@ -322,11 +796,12 @@ static __inline GLuint radeonPackColor( GLuint cpp,
}
}
+#define RADEON_OLD_PACKETS 1
/* ================================================================
* Debugging:
*/
-#define DO_DEBUG 0
+#define DO_DEBUG 1
#if DO_DEBUG
extern int RADEON_DEBUG;
@@ -334,14 +809,18 @@ extern int RADEON_DEBUG;
#define RADEON_DEBUG 0
#endif
-#define DEBUG_ALWAYS_SYNC 0x01
-#define DEBUG_VERBOSE_API 0x02
-#define DEBUG_VERBOSE_MSG 0x04
-#define DEBUG_VERBOSE_LRU 0x08
-#define DEBUG_VERBOSE_DRI 0x10
-#define DEBUG_VERBOSE_IOCTL 0x20
-#define DEBUG_VERBOSE_2D 0x40
-#define DEBUG_VERBOSE_TEXTURE 0x80
+#define DEBUG_TEXTURE 0x001
+#define DEBUG_STATE 0x002
+#define DEBUG_IOCTL 0x004
+#define DEBUG_PRIMS 0x008
+#define DEBUG_VERTS 0x010
+#define DEBUG_FALLBACKS 0x020
+#define DEBUG_VFMT 0x040
+#define DEBUG_CODEGEN 0x080
+#define DEBUG_VERBOSE 0x100
+#define DEBUG_DRI 0x200
+#define DEBUG_DMA 0x400
+#define DEBUG_SANITY 0x800
#endif
#endif /* __RADEON_CONTEXT_H__ */
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c
index 223301ccb..226f99b49 100644
--- a/xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c
@@ -31,480 +31,703 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* Authors:
* Kevin E. Martin <martin@valinux.com>
* Gareth Hughes <gareth@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*
*/
+#include "glheader.h"
+#include "imports.h"
+#include "simple_list.h"
+#include "swrast/swrast.h"
+
#include "radeon_context.h"
#include "radeon_state.h"
#include "radeon_ioctl.h"
+#include "radeon_tcl.h"
+#include "radeon_sanity.h"
-#include "mem.h"
-#include "macros.h"
-#include "swrast/swrast.h"
+#include "radeon_macros.h" /* for INREG() */
+
+#undef usleep
+#include <unistd.h> /* for usleep() */
#define RADEON_TIMEOUT 512
+#define RADEON_IDLE_RETRY 16
+static void do_usleep( int nr, const char *caller )
+{
+ if (0) fprintf(stderr, "usleep %d in %s\n", nr, caller );
+ if (1) usleep( nr );
+}
+
+static void radeonWaitForIdle( radeonContextPtr rmesa );
+
/* =============================================================
- * Hardware vertex buffer handling
+ * Kernel command buffer handling
*/
-/* Get a new VB from the pool of vertex buffers in AGP space.
- */
-drmBufPtr radeonGetBufferLocked( radeonContextPtr rmesa )
+static void print_state_atom( struct radeon_state_atom *state )
{
- int fd = rmesa->dri.fd;
- int index = 0;
- int size = 0;
- drmDMAReq dma;
- drmBufPtr buf = NULL;
- int to = 0;
- int ret;
+ int i;
- dma.context = rmesa->dri.hwContext;
- dma.send_count = 0;
- dma.send_list = NULL;
- dma.send_sizes = NULL;
- dma.flags = 0;
- dma.request_count = 1;
- dma.request_size = RADEON_BUFFER_SIZE;
- dma.request_list = &index;
- dma.request_sizes = &size;
- dma.granted_count = 0;
+ fprintf(stderr, "emit %s/%d\n", state->name, state->cmd_size);
- while ( !buf && ( to++ < RADEON_TIMEOUT ) ) {
- ret = drmDMA( fd, &dma );
+ if (RADEON_DEBUG & DEBUG_VERBOSE)
+ for (i = 0 ; i < state->cmd_size ; i++)
+ fprintf(stderr, "\t%s[%d]: %x\n", state->name, i, state->cmd[i]);
- if ( ret == 0 ) {
- buf = &rmesa->radeonScreen->buffers->list[index];
- buf->used = 0;
- /* Bump the performance counter */
- rmesa->c_vertexBuffers++;
- return buf;
+}
+
+static void radeon_emit_state_list( radeonContextPtr rmesa,
+ struct radeon_state_atom *list )
+{
+ struct radeon_state_atom *state, *tmp;
+ char *dest;
+
+ /* From Felix Kuhling: similar to some other lockups, glaxium will
+ * lock with what we believe to be a normal command stream, but
+ * sprinkling some magic waits arounds allows it to run
+ * uninterrupted. This has a slight effect on q3 framerates, but
+ * it might now be possible to remove the zbs hack, below.
+ *
+ * Felix reports that this can be narrowed down to just
+ * tcl,tex0,tex1 state, but that's pretty much every statechange,
+ * so let's just put the wait in always (unless Felix wants to
+ * narrow it down further...)
+ */
+ if (1) {
+ drmRadeonCmdHeader *cmd;
+ cmd = (drmRadeonCmdHeader *)radeonAllocCmdBuf( rmesa, sizeof(*cmd),
+ __FUNCTION__ );
+ cmd->wait.cmd_type = RADEON_CMD_WAIT;
+ cmd->wait.flags = RADEON_WAIT_3D;
+ }
+
+ foreach_s( state, tmp, list ) {
+ if (state->check( rmesa->glCtx )) {
+ dest = radeonAllocCmdBuf( rmesa, state->cmd_size * 4, __FUNCTION__);
+ memcpy( dest, state->cmd, state->cmd_size * 4);
+ move_to_head( &(rmesa->hw.clean), state );
+ if (RADEON_DEBUG & DEBUG_STATE)
+ print_state_atom( state );
}
+ else if (RADEON_DEBUG & DEBUG_STATE)
+ fprintf(stderr, "skip state %s\n", state->name);
}
+}
- if ( !buf ) {
- UNLOCK_HARDWARE( rmesa );
- fprintf( stderr, "Error: Could not get new VB... exiting\n" );
- exit( -1 );
+
+void radeonEmitState( radeonContextPtr rmesa )
+{
+ struct radeon_state_atom *state, *tmp;
+
+ if (RADEON_DEBUG & (DEBUG_STATE|DEBUG_PRIMS))
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ /* Somewhat overkill:
+ */
+ if (rmesa->lost_context) {
+ if (RADEON_DEBUG & (DEBUG_STATE|DEBUG_PRIMS|DEBUG_IOCTL))
+ fprintf(stderr, "%s - lost context\n", __FUNCTION__);
+
+ foreach_s( state, tmp, &(rmesa->hw.clean) )
+ move_to_tail(&(rmesa->hw.dirty), state );
+
+ rmesa->lost_context = 0;
+ }
+ else if (1) {
+ /* This is a darstardly kludge to work around a lockup that I
+ * haven't otherwise figured out.
+ */
+ move_to_tail(&(rmesa->hw.dirty), &(rmesa->hw.zbs) );
+ }
+
+ if (!(rmesa->radeonScreen->chipset & RADEON_CHIPSET_TCL)) {
+ foreach_s( state, tmp, &(rmesa->hw.dirty) ) {
+ if (state->is_tcl) {
+ move_to_head( &(rmesa->hw.clean), state );
+ }
+ }
}
- return buf;
+ radeon_emit_state_list( rmesa, &rmesa->hw.dirty );
}
-static GLboolean intersect_rect( XF86DRIClipRectPtr out,
- XF86DRIClipRectPtr a,
- XF86DRIClipRectPtr b )
+
+/* Fire a section of the retained (indexed_verts) buffer as a regular
+ * primtive.
+ */
+extern void radeonEmitVbufPrim( radeonContextPtr rmesa,
+ GLuint vertex_format,
+ GLuint primitive,
+ GLuint vertex_nr )
{
- *out = *a;
- if ( b->x1 > out->x1 ) out->x1 = b->x1;
- if ( b->y1 > out->y1 ) out->y1 = b->y1;
- if ( b->x2 < out->x2 ) out->x2 = b->x2;
- if ( b->y2 < out->y2 ) out->y2 = b->y2;
- if ( out->x1 >= out->x2 ) return GL_FALSE;
- if ( out->y1 >= out->y2 ) return GL_FALSE;
- return GL_TRUE;
+ drmRadeonCmdHeader *cmd;
+
+
+ assert(rmesa->dri.drmMinor >= 3);
+ assert(!(primitive & RADEON_CP_VC_CNTL_PRIM_WALK_IND));
+
+ radeonEmitState( rmesa );
+
+ if (RADEON_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s cmd_used/4: %d\n", __FUNCTION__,
+ rmesa->store.cmd_used/4);
+
+#if RADEON_OLD_PACKETS
+ cmd = (drmRadeonCmdHeader *)radeonAllocCmdBuf( rmesa, 6 * sizeof(*cmd),
+ __FUNCTION__ );
+ cmd[0].header.cmd_type = RADEON_CMD_PACKET3_CLIP;
+ cmd[1].i = RADEON_CP_PACKET3_3D_RNDR_GEN_INDX_PRIM | (3 << 16);
+ cmd[2].i = rmesa->ioctl.vertex_offset;
+ cmd[3].i = vertex_nr;
+ cmd[4].i = vertex_format;
+ cmd[5].i = (primitive |
+ RADEON_CP_VC_CNTL_PRIM_WALK_LIST |
+ RADEON_CP_VC_CNTL_COLOR_ORDER_RGBA |
+ RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE |
+ (vertex_nr << RADEON_CP_VC_CNTL_NUM_SHIFT));
+
+ if (RADEON_DEBUG & DEBUG_PRIMS)
+ fprintf(stderr, "%s: header 0x%x offt 0x%x vfmt 0x%x vfcntl %x \n",
+ __FUNCTION__,
+ cmd[1].i, cmd[2].i, cmd[4].i, cmd[5].i);
+#else
+ cmd = (drmRadeonCmdHeader *)radeonAllocCmdBuf( rmesa, 4 * sizeof(*cmd),
+ __FUNCTION__ );
+ cmd[0].i = 0;
+ cmd[0].header.cmd_type = RADEON_CMD_PACKET3_CLIP;
+ cmd[1].i = RADEON_CP_PACKET3_3D_DRAW_VBUF | (1 << 16);
+ cmd[2].i = vertex_format;
+ cmd[3].i = (primitive |
+ RADEON_CP_VC_CNTL_PRIM_WALK_LIST |
+ RADEON_CP_VC_CNTL_COLOR_ORDER_RGBA |
+ RADEON_CP_VC_CNTL_MAOS_ENABLE |
+ RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE |
+ (vertex_nr << RADEON_CP_VC_CNTL_NUM_SHIFT));
+
+
+ if (RADEON_DEBUG & DEBUG_PRIMS)
+ fprintf(stderr, "%s: header 0x%x vfmt 0x%x vfcntl %x \n",
+ __FUNCTION__,
+ cmd[1].i, cmd[2].i, cmd[3].i);
+#endif
}
-static void emit_state( radeonContextPtr rmesa,
- drmRadeonState *dest,
- int dirty )
-{
- struct radeon_state *state = &rmesa->state;
- if ( dirty & RADEON_UPLOAD_CONTEXT )
- memcpy( &dest->context, &state->hw.context, sizeof(dest->context) );
+void radeonFlushElts( radeonContextPtr rmesa )
+{
+ int *cmd = (int *)(rmesa->store.cmd_buf + rmesa->store.elts_start);
+ int dwords;
+#if RADEON_OLD_PACKETS
+ int nr = (rmesa->store.cmd_used - (rmesa->store.elts_start + 24)) / 2;
+#else
+ int nr = (rmesa->store.cmd_used - (rmesa->store.elts_start + 16)) / 2;
+#endif
- if ( dirty & RADEON_UPLOAD_VERTFMT )
- memcpy( &dest->vertex, &state->hw.vertex, sizeof(dest->vertex) );
+ if (RADEON_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
- if ( dirty & RADEON_UPLOAD_LINE )
- memcpy( &dest->line, &state->hw.line, sizeof(dest->line) );
+ assert( rmesa->dma.flush == radeonFlushElts );
+ rmesa->dma.flush = 0;
- if ( dirty & RADEON_UPLOAD_BUMPMAP )
- memcpy( &dest->bumpmap, &state->hw.bumpmap, sizeof(dest->bumpmap) );
+ /* Cope with odd number of elts:
+ */
+ rmesa->store.cmd_used = (rmesa->store.cmd_used + 2) & ~2;
+ dwords = (rmesa->store.cmd_used - rmesa->store.elts_start) / 4;
+
+#if RADEON_OLD_PACKETS
+ cmd[1] |= (dwords - 3) << 16;
+ cmd[5] |= nr << RADEON_CP_VC_CNTL_NUM_SHIFT;
+#else
+ cmd[1] |= (dwords - 3) << 16;
+ cmd[3] |= nr << RADEON_CP_VC_CNTL_NUM_SHIFT;
+#endif
+}
- if ( dirty & RADEON_UPLOAD_MASKS )
- memcpy( &dest->mask, &state->hw.mask, sizeof(dest->mask) );
- if ( dirty & RADEON_UPLOAD_VIEWPORT )
- memcpy( &dest->viewport, &state->hw.viewport, sizeof(dest->viewport) );
+GLushort *radeonAllocEltsOpenEnded( radeonContextPtr rmesa,
+ GLuint vertex_format,
+ GLuint primitive,
+ GLuint min_nr )
+{
+ drmRadeonCmdHeader *cmd;
+ GLushort *retval;
+
+ if (RADEON_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s %d\n", __FUNCTION__, min_nr);
+
+ assert(rmesa->dri.drmMinor >= 3);
+ assert((primitive & RADEON_CP_VC_CNTL_PRIM_WALK_IND));
+
+ radeonEmitState( rmesa );
+
+#if RADEON_OLD_PACKETS
+ cmd = (drmRadeonCmdHeader *)radeonAllocCmdBuf( rmesa,
+ 24 + min_nr*2,
+ __FUNCTION__ );
+ cmd[0].i = 0;
+ cmd[0].header.cmd_type = RADEON_CMD_PACKET3_CLIP;
+ cmd[1].i = RADEON_CP_PACKET3_3D_RNDR_GEN_INDX_PRIM;
+ cmd[2].i = rmesa->ioctl.vertex_offset;
+ cmd[3].i = 0xffff;
+ cmd[4].i = vertex_format;
+ cmd[5].i = (primitive |
+ RADEON_CP_VC_CNTL_PRIM_WALK_IND |
+ RADEON_CP_VC_CNTL_COLOR_ORDER_RGBA |
+ RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE);
+
+ retval = (GLushort *)(cmd+6);
+#else
+ cmd = (drmRadeonCmdHeader *)radeonAllocCmdBuf( rmesa,
+ 16 + min_nr*2,
+ __FUNCTION__ );
+ cmd[0].i = 0;
+ cmd[0].header.cmd_type = RADEON_CMD_PACKET3_CLIP;
+ cmd[1].i = RADEON_CP_PACKET3_3D_DRAW_INDX;
+ cmd[2].i = vertex_format;
+ cmd[3].i = (primitive |
+ RADEON_CP_VC_CNTL_PRIM_WALK_IND |
+ RADEON_CP_VC_CNTL_COLOR_ORDER_RGBA |
+ RADEON_CP_VC_CNTL_MAOS_ENABLE |
+ RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE);
+
+ retval = (GLushort *)(cmd+4);
+#endif
- if ( dirty & RADEON_UPLOAD_SETUP ) {
- memcpy( &dest->setup1, &state->hw.setup1, sizeof(dest->setup1) );
- memcpy( &dest->setup2, &state->hw.setup2, sizeof(dest->setup2) );
- }
+ if (RADEON_DEBUG & DEBUG_PRIMS)
+ fprintf(stderr, "%s: header 0x%x vfmt 0x%x prim %x \n",
+ __FUNCTION__,
+ cmd[1].i, vertex_format, primitive);
- if ( dirty & RADEON_UPLOAD_MISC )
- memcpy( &dest->misc, &state->hw.misc, sizeof(dest->misc) );
+ assert(!rmesa->dma.flush);
+ rmesa->dma.flush = radeonFlushElts;
- if ( dirty & RADEON_UPLOAD_ZBIAS )
- memcpy( &dest->zbias, &state->hw.zbias, sizeof(dest->zbias) );
+ rmesa->store.elts_start = ((char *)cmd) - rmesa->store.cmd_buf;
- /* Assemble the texture state, combining the texture object and
- * texture environment state into the hardware texture unit state.
- */
- if ( dirty & RADEON_UPLOAD_TEX0 ) {
- radeonTexObjPtr t0 = state->texture.unit[0].texobj;
+ return retval;
+}
- dest->texture[0].pp_txfilter = t0->pp_txfilter | state->hw.texture[0].pp_txfilter;
- dest->texture[0].pp_txformat = t0->pp_txformat | RADEON_TXFORMAT_ST_ROUTE_STQ0;
- dest->texture[0].pp_txoffset = t0->pp_txoffset;
- dest->texture[0].pp_border_color = t0->pp_border_color;
- dest->texture[0].pp_txcblend = state->hw.texture[0].pp_txcblend;
- dest->texture[0].pp_txablend = state->hw.texture[0].pp_txablend;
- dest->texture[0].pp_tfactor = state->hw.texture[0].pp_tfactor;
- }
- if ( dirty & RADEON_UPLOAD_TEX1 ) {
- radeonTexObjPtr t1 = state->texture.unit[1].texobj;
- dest->texture[1].pp_txfilter = t1->pp_txfilter | state->hw.texture[1].pp_txfilter;
- dest->texture[1].pp_txformat = t1->pp_txformat | RADEON_TXFORMAT_ST_ROUTE_STQ1;
- dest->texture[1].pp_txoffset = t1->pp_txoffset;
- dest->texture[1].pp_border_color = t1->pp_border_color;
- dest->texture[1].pp_txcblend = state->hw.texture[1].pp_txcblend;
- dest->texture[1].pp_txablend = state->hw.texture[1].pp_txablend;
- dest->texture[1].pp_tfactor = state->hw.texture[1].pp_tfactor;
- }
+void radeonEmitVertexAOS( radeonContextPtr rmesa,
+ GLuint vertex_size,
+ GLuint offset )
+{
+#if RADEON_OLD_PACKETS
+ rmesa->ioctl.vertex_size = vertex_size;
+ rmesa->ioctl.vertex_offset = offset;
+#else
+ drmRadeonCmdHeader *cmd;
+ assert(rmesa->dri.drmMinor >= 3);
+
+ if (RADEON_DEBUG & (DEBUG_PRIMS|DEBUG_IOCTL))
+ fprintf(stderr, "%s: vertex_size 0x%x offset 0x%x \n",
+ __FUNCTION__, vertex_size, offset);
+
+ cmd = (drmRadeonCmdHeader *)radeonAllocCmdBuf( rmesa, 5 * sizeof(int),
+ __FUNCTION__ );
+
+ cmd[0].i = 0;
+ cmd[0].header.cmd_type = RADEON_CMD_PACKET3;
+ cmd[1].i = RADEON_CP_PACKET3_3D_LOAD_VBPNTR | (2 << 16);
+ cmd[2].i = 1;
+ cmd[3].i = vertex_size | (vertex_size << 8);
+ cmd[4].i = offset;
+#endif
}
+
-#if 0
-static void print_values( const char *name, const void *vals, int sz )
+void radeonEmitAOS( radeonContextPtr rmesa,
+ struct radeon_dma_region **component,
+ GLuint nr,
+ GLuint offset )
{
- const int *ivals = (const int *)vals;
+#if RADEON_OLD_PACKETS
+ assert( nr == 1 );
+ assert( component[0]->aos_size == component[0]->aos_stride );
+ rmesa->ioctl.vertex_size = component[0]->aos_size;
+ rmesa->ioctl.vertex_offset =
+ (component[0]->aos_start + offset * component[0]->aos_stride * 4);
+#else
+ drmRadeonCmdHeader *cmd;
+ int sz = 3 + (nr/2 * 3) + (nr & 1) * 2;
int i;
+ int *tmp;
+
+ if (RADEON_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ assert(rmesa->dri.drmMinor >= 3);
+
+ cmd = (drmRadeonCmdHeader *)radeonAllocCmdBuf( rmesa, sz * sizeof(int),
+ __FUNCTION__ );
+ cmd[0].i = 0;
+ cmd[0].header.cmd_type = RADEON_CMD_PACKET3;
+ cmd[1].i = RADEON_CP_PACKET3_3D_LOAD_VBPNTR | ((sz-3) << 16);
+ cmd[2].i = nr;
+ tmp = &cmd[0].i;
+ cmd += 3;
+
+ for (i = 0 ; i < nr ; i++) {
+ if (i & 1) {
+ cmd[0].i |= ((component[i]->aos_stride << 24) |
+ (component[i]->aos_size << 16));
+ cmd[2].i = (component[i]->aos_start +
+ offset * component[i]->aos_stride * 4);
+ cmd += 3;
+ }
+ else {
+ cmd[0].i = ((component[i]->aos_stride << 8) |
+ (component[i]->aos_size << 0));
+ cmd[1].i = (component[i]->aos_start +
+ offset * component[i]->aos_stride * 4);
+ }
+ }
- for (i = 0; i < sz/4 ; i++)
- fprintf(stderr, "%s %d: 0x%x\n", name, i, ivals[i]);
-}
+ if (RADEON_DEBUG & DEBUG_VERTS) {
+ fprintf(stderr, "%s:\n", __FUNCTION__);
+ for (i = 0 ; i < sz ; i++)
+ fprintf(stderr, " %d: %x\n", i, tmp[i]);
+ }
#endif
-/*
-static void print_state( drmRadeonState *state )
-{
- int dirty = state->dirty;
+}
- if ( dirty & RADEON_UPLOAD_CONTEXT )
- print_values( "CONTEXT", &state->context, sizeof(state->context) );
- if ( dirty & RADEON_UPLOAD_VERTFMT )
- print_values( "VERTFMT", &state->vertex, sizeof(state->vertex) );
+static int radeonFlushCmdBufLocked( radeonContextPtr rmesa,
+ const char * caller )
+{
+ int ret, i;
+ drmRadeonCmdBuffer cmd;
- if ( dirty & RADEON_UPLOAD_LINE )
- print_values( "LINE", &state->line, sizeof(state->line) );
+ if (RADEON_DEBUG & DEBUG_IOCTL) {
+ fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
- if ( dirty & RADEON_UPLOAD_BUMPMAP )
- print_values( "BUMPMAP", &state->bumpmap, sizeof(state->bumpmap) );
+ if (RADEON_DEBUG & DEBUG_VERBOSE)
+ for (i = 0 ; i < rmesa->store.cmd_used ; i += 4 )
+ fprintf(stderr, "%d: %x\n", i/4,
+ *(int *)(&rmesa->store.cmd_buf[i]));
+ }
- if ( dirty & RADEON_UPLOAD_MASKS )
- print_values( "MASKS", &state->mask, sizeof(state->mask) );
+ if (RADEON_DEBUG & DEBUG_DMA)
+ fprintf(stderr, "%s: Releasing %d buffers\n", __FUNCTION__,
+ rmesa->dma.nr_released_bufs);
- if ( dirty & RADEON_UPLOAD_VIEWPORT )
- print_values( "VIEWPORT", &state->viewport, sizeof(state->viewport) );
- if ( dirty & RADEON_UPLOAD_SETUP ) {
- print_values( "SETUP", &state->setup1, sizeof(state->setup1) );
- print_values( "SETUP2", &state->setup2, sizeof(state->setup2) );
+ if (RADEON_DEBUG & DEBUG_SANITY) {
+ if (rmesa->state.scissor.enabled)
+ ret = radeonSanityCmdBuffer( rmesa,
+ rmesa->state.scissor.numClipRects,
+ rmesa->state.scissor.pClipRects);
+ else
+ ret = radeonSanityCmdBuffer( rmesa,
+ rmesa->numClipRects,
+ rmesa->pClipRects);
}
- if ( dirty & RADEON_UPLOAD_MISC )
- print_values( "MISC", &state->misc, sizeof(state->misc) );
+ cmd.bufsz = rmesa->store.cmd_used;
+ cmd.buf = rmesa->store.cmd_buf;
- if ( dirty & RADEON_UPLOAD_ZBIAS )
- print_values( "ZBIAS", &state->zbias, sizeof(state->zbias) );
+ if (rmesa->state.scissor.enabled) {
+ cmd.nbox = rmesa->state.scissor.numClipRects;
+ cmd.boxes = (drmClipRect *)rmesa->state.scissor.pClipRects;
+ } else {
+ cmd.nbox = rmesa->numClipRects;
+ cmd.boxes = (drmClipRect *)rmesa->pClipRects;
+ }
- if ( dirty & RADEON_UPLOAD_TEX0 )
- print_values( "TEX0", &state->texture[0], sizeof(state->texture[0]) );
+ ret = drmCommandWrite( rmesa->dri.fd,
+ DRM_RADEON_CMDBUF,
+ &cmd, sizeof(cmd) );
- if ( dirty & RADEON_UPLOAD_TEX1 )
- print_values( "TEX1", &state->texture[1], sizeof(state->texture[1]) );
+ rmesa->store.primnr = 0;
+ rmesa->store.statenr = 0;
+ rmesa->store.cmd_used = 0;
+ rmesa->dma.nr_released_bufs = 0;
+ rmesa->lost_context = 1;
+ return ret;
}
-*/
-
-static void emit_prim( radeonContextPtr rmesa )
-{
- GLuint prim = rmesa->store.primnr++;
- GLuint dirty = rmesa->state.hw.dirty;
- rmesa->store.prim[prim].prim = rmesa->hw_primitive;
- rmesa->store.prim[prim].start = rmesa->dma.last;
- rmesa->store.prim[prim].finish = rmesa->dma.low;
- rmesa->store.prim[prim].vc_format = rmesa->vertex_format;
- if (rmesa->hw_primitive & RADEON_CP_VC_CNTL_PRIM_WALK_IND)
- rmesa->store.prim[prim].numverts = rmesa->dma.offset / 64;
- else
- rmesa->store.prim[prim].numverts = rmesa->num_verts;
+/* Note: does not emit any commands to avoid recursion on
+ * radeonAllocCmdBuf.
+ */
+void radeonFlushCmdBuf( radeonContextPtr rmesa, const char *caller )
+{
+ int ret;
- rmesa->num_verts = 0;
- rmesa->dma.last = rmesa->dma.low;
+
+ assert (rmesa->dri.drmMinor >= 3);
+ LOCK_HARDWARE( rmesa );
+ ret = radeonFlushCmdBufLocked( rmesa, caller );
+ UNLOCK_HARDWARE( rmesa );
- /* Make sure we keep a copy of the initial state.
- */
- if (prim == 0) {
- dirty = RADEON_UPLOAD_CONTEXT_ALL;
- if (rmesa->state.texture.unit[0].texobj) dirty |= RADEON_UPLOAD_TEX0;
- if (rmesa->state.texture.unit[1].texobj) dirty |= RADEON_UPLOAD_TEX1;
+ if (ret) {
+ fprintf(stderr, "drmRadeonCmdBuffer: %d\n", ret);
+ exit(ret);
}
+}
- if (dirty)
- {
- GLuint state = rmesa->store.statenr++;
-
- emit_state( rmesa, &rmesa->store.state[state], dirty );
-/* fprintf(stderr, "emit state %d, dirty %x rmesa->dirty %x\n", */
-/* state, dirty, rmesa->state.hw.dirty ); */
- rmesa->store.state[state].dirty = rmesa->state.hw.dirty; /* override */
- rmesa->store.texture[0][state] = rmesa->state.texture.unit[0].texobj;
- rmesa->store.texture[1][state] = rmesa->state.texture.unit[1].texobj;
- rmesa->state.hw.dirty = 0;
-/* print_state( &rmesa->store.state[state] ); */
- }
-
- rmesa->store.prim[prim].stateidx = rmesa->store.statenr - 1;
-
-/* fprintf(stderr, "emit_prim %d hwprim 0x%x vfmt 0x%x %d..%d %d verts stateidx %x\n", */
-/* prim, */
-/* rmesa->store.prim[prim].prim, */
-/* rmesa->store.prim[prim].vc_format, */
-/* rmesa->store.prim[prim].start, */
-/* rmesa->store.prim[prim].finish, */
-/* rmesa->store.prim[prim].numverts, */
-/* rmesa->store.prim[prim].stateidx); */
-}
+/* =============================================================
+ * Hardware vertex buffer handling
+ */
-void radeonFlushPrimsLocked( radeonContextPtr rmesa )
+void radeonRefillCurrentDmaRegion( radeonContextPtr rmesa )
{
- XF86DRIClipRectPtr pbox = (XF86DRIClipRectPtr)rmesa->pClipRects;
- int nbox = rmesa->numClipRects;
- drmBufPtr buffer = rmesa->dma.buffer;
- RADEONSAREAPrivPtr sarea = rmesa->sarea;
+ struct radeon_dma_buffer *dmabuf;
int fd = rmesa->dri.fd;
- int discard_sz = rmesa->dma.high - rmesa->dma.low < 4096;
- int discard = (rmesa->dma.retained != rmesa->dma.buffer &&
- discard_sz);
- int i;
+ int index = 0;
+ int size = 0;
+ drmDMAReq dma;
+ int ret;
- if ( !nbox )
- rmesa->store.primnr = 0;
- else if ( nbox >= RADEON_NR_SAREA_CLIPRECTS ) {
- rmesa->upload_cliprects = 1;
- for ( i = 0 ; i < rmesa->store.statenr ; i++ )
- rmesa->store.state[0].dirty |= rmesa->store.state[i].dirty;
- if ( !rmesa->store.texture[0][0] )
- rmesa->store.state[0].dirty &= ~RADEON_UPLOAD_TEX0;
- if ( !rmesa->store.texture[1][0] )
- rmesa->store.state[0].dirty &= ~RADEON_UPLOAD_TEX1;
+ if (RADEON_DEBUG & (DEBUG_IOCTL|DEBUG_DMA))
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ if (rmesa->dma.flush) {
+ rmesa->dma.flush( rmesa );
}
+ if (rmesa->dma.current.buf)
+ radeonReleaseDmaRegion( rmesa, &rmesa->dma.current, __FUNCTION__ );
-/* fprintf(stderr, "%s: boxes: %d prims: %d states: %d vertexstore: 0x%x\n", */
-/* __FUNCTION__, */
-/* sarea->nbox, rmesa->store.primnr, rmesa->store.statenr, */
-/* rmesa->dma.low - rmesa->store.prim[0].start); */
+ if (rmesa->dma.nr_released_bufs > 4)
+ radeonFlushCmdBuf( rmesa, __FUNCTION__ );
- if ( !rmesa->upload_cliprects || !rmesa->store.primnr )
- {
- if ( nbox == 1 ) {
- sarea->nbox = 0;
- } else {
- sarea->nbox = nbox;
- }
+ dma.context = rmesa->dri.hwContext;
+ dma.send_count = 0;
+ dma.send_list = NULL;
+ dma.send_sizes = NULL;
+ dma.flags = 0;
+ dma.request_count = 1;
+ dma.request_size = RADEON_BUFFER_SIZE;
+ dma.request_list = &index;
+ dma.request_sizes = &size;
+ dma.granted_count = 0;
-/* fprintf(stderr, "case a %d boxes %d prims %d states\n", */
-/* sarea->nbox, rmesa->store.primnr, rmesa->store.statenr); */
- if (discard || rmesa->store.primnr)
- drmRadeonFlushPrims( fd,
- buffer->idx,
- discard,
- rmesa->store.statenr,
- rmesa->store.state,
- rmesa->store.primnr,
- rmesa->store.prim);
- }
- else
- {
- for ( i = 0 ; i < nbox ; ) {
- int nr = MIN2( i + RADEON_NR_SAREA_CLIPRECTS, nbox );
- XF86DRIClipRectPtr b = sarea->boxes;
- int discard_now = 0;
-
- /* TODO: Precalculate this intersection:
- */
- if ( rmesa->state.scissor.enabled ) {
- sarea->nbox = 0;
-
- for ( ; i < nr ; i++ ) {
- *b = pbox[i];
- if ( intersect_rect( b, b, &rmesa->state.scissor.rect ) ) {
- sarea->nbox++;
- b++;
- }
- }
-
- /* Culled?
- */
- if ( !sarea->nbox ) {
- if ( nr < nbox ) continue;
- rmesa->store.primnr = 0;
- }
- } else {
- sarea->nbox = nr - i;
- for ( ; i < nr ; i++) {
- *b++ = pbox[i];
- }
- }
+ LOCK_HARDWARE(rmesa); /* no need to validate */
- /* Finished with the buffer?
- */
- if ( nr == nbox ) {
- discard_now = discard;
- }
+ ret = drmDMA( fd, &dma );
+
+ if (ret != 0) {
+ /* Free some up this way?
+ */
+ if (rmesa->dma.nr_released_bufs) {
+ radeonFlushCmdBufLocked( rmesa, __FUNCTION__ );
+ }
+
+ if (RADEON_DEBUG & DEBUG_DMA)
+ fprintf(stderr, "Waiting for buffers\n");
-/* fprintf(stderr, "case a %d boxes %d prims %d states, discard: %d\n", */
-/* sarea->nbox, rmesa->store.primnr, rmesa->store.statenr, discard); */
- drmRadeonFlushPrims( fd,
- buffer->idx,
- discard_now,
- rmesa->store.statenr,
- rmesa->store.state,
- rmesa->store.primnr,
- rmesa->store.prim);
+ radeonWaitForIdleLocked( rmesa );
+ ret = drmDMA( fd, &dma );
+
+ if ( ret != 0 ) {
+ UNLOCK_HARDWARE( rmesa );
+ fprintf( stderr, "Error: Could not get dma buffer... exiting\n" );
+ exit( -1 );
}
}
- if (discard_sz) {
- rmesa->dma.buffer = 0;
- rmesa->dma.address = 0;
- rmesa->dma.low = 0;
- rmesa->dma.high = 0;
- }
- else {
- rmesa->dma.low = (rmesa->dma.low + 0x7) & ~0x7; /* alignment */
- }
- rmesa->dma.last = rmesa->dma.low;
- rmesa->store.primnr = 0;
- rmesa->store.statenr = 0;
- rmesa->upload_cliprects = 0;
- rmesa->num_verts = 0;
-}
+ UNLOCK_HARDWARE(rmesa);
-void radeonFlushPrimsGetBuffer( radeonContextPtr rmesa )
-{
- if (rmesa->dma.low != rmesa->dma.last)
- emit_prim( rmesa );
+ if (RADEON_DEBUG & DEBUG_DMA)
+ fprintf(stderr, "Allocated buffer %d\n", index);
- LOCK_HARDWARE(rmesa);
+ dmabuf = CALLOC_STRUCT( radeon_dma_buffer );
+ dmabuf->buf = &rmesa->radeonScreen->buffers->list[index];
+ dmabuf->refcount = 1;
- if (rmesa->dma.buffer) {
- rmesa->dma.low = rmesa->dma.high; /* force discard */
- rmesa->dma.last = rmesa->dma.low;
- radeonFlushPrimsLocked( rmesa );
- }
+ rmesa->dma.current.buf = dmabuf;
+ rmesa->dma.current.address = dmabuf->buf->address;
+ rmesa->dma.current.end = dmabuf->buf->total;
+ rmesa->dma.current.start = 0;
+ rmesa->dma.current.ptr = 0;
- rmesa->dma.buffer = radeonGetBufferLocked( rmesa );
- rmesa->dma.high = rmesa->dma.buffer->total;
- rmesa->dma.address = (GLubyte *)rmesa->dma.buffer->address;
- rmesa->dma.low = 0;
- rmesa->num_verts = 0;
- rmesa->dma.last = rmesa->dma.low;
- UNLOCK_HARDWARE(rmesa);
+ rmesa->c_vertexBuffers++;
}
-
-void radeonFlushPrims( radeonContextPtr rmesa )
+void radeonReleaseDmaRegion( radeonContextPtr rmesa,
+ struct radeon_dma_region *region,
+ const char *caller )
{
- if (rmesa->dma.buffer) {
- if (rmesa->dma.low != rmesa->dma.last)
- emit_prim( rmesa );
+ if (RADEON_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
+
+ if (!region->buf)
+ return;
- LOCK_HARDWARE( rmesa );
- radeonFlushPrimsLocked( rmesa );
- UNLOCK_HARDWARE( rmesa );
+ if (rmesa->dma.flush)
+ rmesa->dma.flush( rmesa );
+
+ if (--region->buf->refcount == 0) {
+ drmRadeonCmdHeader *cmd;
+
+ if (RADEON_DEBUG & (DEBUG_IOCTL|DEBUG_DMA))
+ fprintf(stderr, "%s -- DISCARD BUF %d\n", __FUNCTION__,
+ region->buf->buf->idx);
+
+ cmd = (drmRadeonCmdHeader *)radeonAllocCmdBuf( rmesa, sizeof(*cmd),
+ __FUNCTION__ );
+ cmd->dma.cmd_type = RADEON_CMD_DMA_DISCARD;
+ cmd->dma.buf_idx = region->buf->buf->idx;
+ FREE(region->buf);
+ rmesa->dma.nr_released_bufs++;
}
+
+ region->buf = 0;
+ region->start = 0;
}
-void radeonEmitPrim( radeonContextPtr rmesa )
+/* Allocates a region from rmesa->dma.current. If there isn't enough
+ * space in current, grab a new buffer (and discard what was left of current)
+ */
+void radeonAllocDmaRegion( radeonContextPtr rmesa,
+ struct radeon_dma_region *region,
+ int bytes,
+ int alignment )
{
- ASSERT(rmesa->dma.buffer);
- emit_prim( rmesa );
+ if (RADEON_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s %d\n", __FUNCTION__, bytes);
- if (rmesa->store.primnr == RADEON_MAX_PRIMS ||
- rmesa->store.statenr == RADEON_MAX_STATES) {
- LOCK_HARDWARE(rmesa);
- radeonFlushPrimsLocked(rmesa);
- UNLOCK_HARDWARE(rmesa);
- }
- else {
- rmesa->dma.low = (rmesa->dma.low + 0x7) & ~0x7; /* alignment */
- rmesa->dma.last = rmesa->dma.low;
- rmesa->num_verts = 0;
- }
+ if (rmesa->dma.flush)
+ rmesa->dma.flush( rmesa );
+
+ if (region->buf)
+ radeonReleaseDmaRegion( rmesa, region, __FUNCTION__ );
+
+ alignment--;
+ rmesa->dma.current.start = rmesa->dma.current.ptr =
+ (rmesa->dma.current.ptr + alignment) & ~alignment;
+
+ if ( rmesa->dma.current.ptr + bytes > rmesa->dma.current.end )
+ radeonRefillCurrentDmaRegion( rmesa );
+
+ region->start = rmesa->dma.current.start;
+ region->ptr = rmesa->dma.current.start;
+ region->end = rmesa->dma.current.start + bytes;
+ region->address = rmesa->dma.current.address;
+ region->buf = rmesa->dma.current.buf;
+ region->buf->refcount++;
+
+ rmesa->dma.current.ptr += bytes; /* bug - if alignment > 7 */
+ rmesa->dma.current.start =
+ rmesa->dma.current.ptr = (rmesa->dma.current.ptr + 0x7) & ~0x7;
+
+ if ( rmesa->dri.drmMinor < 3 )
+ radeonRefillCurrentDmaRegion( rmesa );
}
+void radeonAllocDmaRegionVerts( radeonContextPtr rmesa,
+ struct radeon_dma_region *region,
+ int numverts,
+ int vertsize,
+ int alignment )
+{
+ radeonAllocDmaRegion( rmesa, region, vertsize * numverts, alignment );
+}
/* ================================================================
- * Texture uploads
+ * SwapBuffers with client-side throttling
*/
-void radeonFireBlitLocked( radeonContextPtr rmesa, drmBufPtr buffer,
- GLint offset, GLint pitch, GLint format,
- GLint x, GLint y, GLint width, GLint height )
+static CARD32 radeonGetLastFrame (radeonContextPtr rmesa)
{
-#if 0
- GLint ret;
+ unsigned char *RADEONMMIO = rmesa->radeonScreen->mmio.map;
+ int ret;
+ CARD32 frame;
+
+ if (rmesa->dri.screen->drmMinor >= 4) {
+ drmRadeonGetParam gp;
+
+ gp.param = RADEON_PARAM_LAST_FRAME;
+ gp.value = (int *)&frame;
+ ret = drmCommandWriteRead( rmesa->dri.fd, DRM_RADEON_GETPARAM,
+ &gp, sizeof(gp) );
+ }
+ else
+ ret = -EINVAL;
- ret = drmRadeonTextureBlit( rmesa->dri.fd, buffer->idx,
- offset, pitch, format,
- x, y, width, height );
+ if ( ret == -EINVAL ) {
+ frame = INREG( RADEON_LAST_FRAME_REG );
+ }
+ else if ( ret ) {
+ fprintf( stderr, "%s: drmRadeonGetParam: %d\n", __FUNCTION__, ret );
+ exit(1);
+ }
+ return frame;
+}
+
+static void radeonEmitIrqLocked( radeonContextPtr rmesa )
+{
+ drmRadeonIrqEmit ie;
+ int ret;
+
+ ie.irq_seq = &rmesa->iw.irq_seq;
+ ret = drmCommandWriteRead( rmesa->dri.fd, DRM_RADEON_IRQ_EMIT,
+ &ie, sizeof(ie) );
if ( ret ) {
- UNLOCK_HARDWARE( rmesa );
- fprintf( stderr, "drmRadeonTextureBlit: return = %d\n", ret );
- exit( 1 );
+ fprintf( stderr, "%s: drmRadeonIrqEmit: %d\n", __FUNCTION__, ret );
+ exit(1);
}
-#endif
}
-/* ================================================================
- * SwapBuffers with client-side throttling
- */
+static void radeonWaitIrq( radeonContextPtr rmesa )
+{
+ int ret;
-#define RADEON_MAX_OUTSTANDING 2
+ do {
+ ret = drmCommandWrite( rmesa->dri.fd, DRM_RADEON_IRQ_WAIT,
+ &rmesa->iw, sizeof(rmesa->iw) );
+ } while (ret && (errno == EINTR || errno == EAGAIN));
-static void delay( void ) {
-/* Prevent an optimizing compiler from removing a spin loop */
+ if ( ret ) {
+ fprintf( stderr, "%s: drmRadeonIrqWait: %d\n", __FUNCTION__, ret );
+ exit(1);
+ }
}
-static int radeonWaitForFrameCompletion( radeonContextPtr rmesa )
+
+static void radeonWaitForFrameCompletion( radeonContextPtr rmesa )
{
- unsigned char *RADEONMMIO = rmesa->radeonScreen->mmio.map;
RADEONSAREAPrivPtr sarea = rmesa->sarea;
- CARD32 frame;
- int wait = 0;
- int i;
- while ( 1 ) {
- frame = INREG( RADEON_LAST_FRAME_REG );
- if ( sarea->last_frame - frame <= RADEON_MAX_OUTSTANDING ) {
- break;
+ if (rmesa->do_irqs) {
+ if (radeonGetLastFrame(rmesa) < sarea->last_frame) {
+ if (!rmesa->irqsEmitted) {
+ while (radeonGetLastFrame (rmesa) < sarea->last_frame)
+ ;
+ }
+ else {
+ UNLOCK_HARDWARE( rmesa );
+ radeonWaitIrq( rmesa );
+ LOCK_HARDWARE( rmesa );
+ }
+ rmesa->irqsEmitted = 10;
+ }
+
+ if (rmesa->irqsEmitted) {
+ radeonEmitIrqLocked( rmesa );
+ rmesa->irqsEmitted--;
}
- wait++;
- /* Spin in place a bit so we aren't hammering the bus */
- for ( i = 0 ; i < 1024 ; i++ ) {
- delay();
+ }
+ else {
+ while (radeonGetLastFrame (rmesa) < sarea->last_frame) {
+ UNLOCK_HARDWARE( rmesa );
+ if (rmesa->do_usleeps)
+ do_usleep(1, __FUNCTION__);
+ LOCK_HARDWARE( rmesa );
}
}
-
- return wait;
}
/* Copy the back color buffer to the front color buffer.
@@ -520,26 +743,22 @@ void radeonCopyBuffer( const __DRIdrawablePrivate *dPriv )
rmesa = (radeonContextPtr) dPriv->driContextPriv->driverPrivate;
- if ( RADEON_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "\n%s( %p )\n\n", __FUNCTION__, (void*)rmesa->glCtx );
+ if ( RADEON_DEBUG & DEBUG_IOCTL ) {
+ fprintf( stderr, "\n%s( %p )\n\n", __FUNCTION__, rmesa->glCtx );
}
RADEON_FIREVERTICES( rmesa );
LOCK_HARDWARE( rmesa );
- nbox = rmesa->dri.drawable->numClipRects; /* must be in locked region */
/* Throttle the frame rate -- only allow one pending swap buffers
* request at a time.
*/
- if ( !radeonWaitForFrameCompletion( rmesa ) ) {
- rmesa->hardwareWentIdle = 1;
- } else {
- rmesa->hardwareWentIdle = 0;
- }
+ radeonWaitForFrameCompletion( rmesa );
+ radeonWaitForVBlank( rmesa );
- nbox = dPriv->numClipRects;
+ nbox = rmesa->dri.drawable->numClipRects; /* must be in locked region */
for ( i = 0 ; i < nbox ; ) {
GLint nr = MIN2( i + RADEON_NR_SAREA_CLIPRECTS , nbox );
@@ -553,28 +772,16 @@ void radeonCopyBuffer( const __DRIdrawablePrivate *dPriv )
}
rmesa->sarea->nbox = n;
- ret = drmRadeonSwapBuffers( rmesa->dri.fd );
+ ret = drmCommandNone( rmesa->dri.fd, DRM_RADEON_SWAP );
if ( ret ) {
- fprintf( stderr, "drmRadeonSwapBuffers: return = %d\n", ret );
+ fprintf( stderr, "DRM_RADEON_SWAP_BUFFERS: return = %d\n", ret );
UNLOCK_HARDWARE( rmesa );
exit( 1 );
}
}
UNLOCK_HARDWARE( rmesa );
-
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT_ALL );
- if ( rmesa->state.texture.unit[0].texobj )
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX0 );
- if ( rmesa->state.texture.unit[1].texobj )
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX1 );
-
-
- rmesa->upload_cliprects = 1;
-
- /* Log the performance counters if necessary */
- radeonPerformanceCounters( rmesa );
}
void radeonPageFlip( const __DRIdrawablePrivate *dPriv )
@@ -588,61 +795,54 @@ void radeonPageFlip( const __DRIdrawablePrivate *dPriv )
rmesa = (radeonContextPtr) dPriv->driContextPriv->driverPrivate;
- if ( RADEON_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "\n%s( %p ): page=%d\n\n",
- __FUNCTION__, (void*)rmesa->glCtx, rmesa->currentPage );
+ if ( RADEON_DEBUG & DEBUG_IOCTL ) {
+ fprintf(stderr, "%s %d\n", __FUNCTION__,
+ rmesa->sarea->pfCurrentPage );
}
RADEON_FIREVERTICES( rmesa );
LOCK_HARDWARE( rmesa );
- /* Throttle the frame rate -- only allow one pending swap buffers
- * request at a time.
+ /* Need to do this for the perf box placement:
*/
- if ( !radeonWaitForFrameCompletion( rmesa ) ) {
- rmesa->hardwareWentIdle = 1;
- } else {
- rmesa->hardwareWentIdle = 0;
+ if (rmesa->dri.drawable->numClipRects)
+ {
+ XF86DRIClipRectPtr box = rmesa->dri.drawable->pClipRects;
+ XF86DRIClipRectPtr b = rmesa->sarea->boxes;
+ b[0] = box[0];
+ rmesa->sarea->nbox = 1;
}
- /* The kernel will have been initialized to perform page flipping
- * on a swapbuffers ioctl.
+
+ /* Throttle the frame rate -- only allow one pending swap buffers
+ * request at a time.
*/
- ret = drmRadeonSwapBuffers( rmesa->dri.fd );
+ radeonWaitForFrameCompletion( rmesa );
+ radeonWaitForVBlank( rmesa );
+
+ ret = drmCommandNone( rmesa->dri.fd, DRM_RADEON_FLIP );
UNLOCK_HARDWARE( rmesa );
if ( ret ) {
- fprintf( stderr, "drmRadeonSwapBuffers: return = %d\n", ret );
+ fprintf( stderr, "DRM_RADEON_FLIP: return = %d\n", ret );
exit( 1 );
}
- if ( rmesa->currentPage == 0 ) {
+ if ( rmesa->sarea->pfCurrentPage == 1 ) {
rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset;
rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch;
- rmesa->currentPage = 1;
} else {
rmesa->state.color.drawOffset = rmesa->radeonScreen->backOffset;
rmesa->state.color.drawPitch = rmesa->radeonScreen->backPitch;
- rmesa->currentPage = 0;
}
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT );
- rmesa->state.hw.context.rb3d_coloroffset = rmesa->state.color.drawOffset;
- rmesa->state.hw.context.rb3d_colorpitch = rmesa->state.color.drawPitch;
-
- /* Log the performance counters if necessary */
- radeonPerformanceCounters( rmesa );
+ RADEON_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset;
+ rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch;
}
-void radeonPerformanceCounters( radeonContextPtr rmesa )
-{
-}
-
-void radeonPerformanceBoxesLocked( radeonContextPtr rmesa )
-{
-}
/* ================================================================
* Buffer clear
@@ -659,25 +859,29 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
CARD32 clear;
GLuint flags = 0;
GLuint color_mask = 0;
-/* GLuint depth_mask = 0; */
GLint ret, i;
- if ( RADEON_DEBUG & DEBUG_VERBOSE_API ) {
+ 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 );
}
- RADEON_FIREVERTICES( rmesa );
+ radeonEmitState( rmesa );
+
+ /* Need to cope with lostcontext here as kernel relies on
+ * some residual state:
+ */
+ RADEON_FIREVERTICES( rmesa );
if ( mask & DD_FRONT_LEFT_BIT ) {
flags |= RADEON_FRONT;
- color_mask = rmesa->state.hw.mask.rb3d_planemask;
+ color_mask = rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK];
mask &= ~DD_FRONT_LEFT_BIT;
}
if ( mask & DD_BACK_LEFT_BIT ) {
flags |= RADEON_BACK;
- color_mask = rmesa->state.hw.mask.rb3d_planemask;
+ color_mask = rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK];
mask &= ~DD_BACK_LEFT_BIT;
}
@@ -691,107 +895,123 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
mask &= ~DD_STENCIL_BIT;
}
- if ( flags ) {
- /* Flip top to bottom */
- cx += dPriv->x;
- cy = dPriv->y + dPriv->h - cy - ch;
+ if ( mask )
+ _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
- LOCK_HARDWARE( rmesa );
+ if ( !flags )
+ return;
- /* Throttle the number of clear ioctls we do.
- */
- while ( 1 ) {
+
+ /* Flip top to bottom */
+ cx += dPriv->x;
+ cy = dPriv->y + dPriv->h - cy - ch;
+
+ LOCK_HARDWARE( rmesa );
+
+ /* Throttle the number of clear ioctls we do.
+ */
+ while ( 1 ) {
+ int ret;
+
+ if (rmesa->dri.screen->drmMinor >= 4) {
+ drmRadeonGetParam gp;
+
+ gp.param = RADEON_PARAM_LAST_CLEAR;
+ gp.value = (int *)&clear;
+ ret = drmCommandWriteRead( rmesa->dri.fd,
+ DRM_RADEON_GETPARAM, &gp, sizeof(gp) );
+ } else
+ ret = -EINVAL;
+
+ if ( ret == -EINVAL ) {
clear = INREG( RADEON_LAST_CLEAR_REG );
- if ( sarea->last_clear - clear <= RADEON_MAX_CLEARS ) {
- break;
- }
- /* Spin in place a bit so we aren't hammering the bus */
- for ( i = 0 ; i < 1024 ; i++ ) {
- delay();
- }
+ } else if ( ret ) {
+ fprintf( stderr, "%s: drmRadeonGetParam: %d\n", __FUNCTION__, ret );
+ exit(1);
+ }
+ if ( RADEON_DEBUG & DEBUG_IOCTL ) {
+ fprintf( stderr, "%s( %d )\n", __FUNCTION__, (int)clear );
+ if ( ret ) fprintf( stderr, " ( RADEON_LAST_CLEAR register read directly )\n" );
}
- /* Emit any new MASKS state. This ioctl uses the old
- * sarea-based state mechanism, which is why I'm not using
- * emit_state() above. Time for a new ioctl?
- */
- if ( rmesa->state.hw.dirty ) {
- memcpy( &sarea->ContextState, &rmesa->state.hw,
- sizeof(sarea->ContextState));
- sarea->dirty |= RADEON_UPLOAD_CONTEXT_ALL;
+ if ( sarea->last_clear - clear <= RADEON_MAX_CLEARS ) {
+ break;
}
+ if ( rmesa->do_usleeps ) {
+ UNLOCK_HARDWARE( rmesa );
+ do_usleep(1, __FUNCTION__);
+ LOCK_HARDWARE( rmesa );
+ }
+ }
- for ( i = 0 ; i < dPriv->numClipRects ; ) {
- GLint nr = MIN2( i + RADEON_NR_SAREA_CLIPRECTS, dPriv->numClipRects );
- XF86DRIClipRectPtr box = dPriv->pClipRects;
- XF86DRIClipRectPtr b = rmesa->sarea->boxes;
- GLint n = 0;
-
- if ( !all ) {
- for ( ; i < nr ; i++ ) {
- GLint x = box[i].x1;
- GLint y = box[i].y1;
- GLint w = box[i].x2 - x;
- GLint h = box[i].y2 - y;
-
- if ( x < cx ) w -= cx - x, x = cx;
- if ( y < cy ) h -= cy - y, y = cy;
- if ( x + w > cx + cw ) w = cx + cw - x;
- if ( y + h > cy + ch ) h = cy + ch - y;
- if ( w <= 0 ) continue;
- if ( h <= 0 ) continue;
-
- b->x1 = x;
- b->y1 = y;
- b->x2 = x + w;
- b->y2 = y + h;
- b++;
- n++;
- }
- } else {
- for ( ; i < nr ; i++ ) {
- *b++ = box[i];
- n++;
- }
- }
+ for ( i = 0 ; i < dPriv->numClipRects ; ) {
+ GLint nr = MIN2( i + RADEON_NR_SAREA_CLIPRECTS, dPriv->numClipRects );
+ XF86DRIClipRectPtr box = dPriv->pClipRects;
+ XF86DRIClipRectPtr b = rmesa->sarea->boxes;
+ drmRadeonClearType clear;
+ drmRadeonClearRect depth_boxes[RADEON_NR_SAREA_CLIPRECTS];
+ GLint n = 0;
- rmesa->sarea->nbox = n;
-
-/* fprintf( stderr, */
-/* "drmRadeonClear: flag 0x%x color %x depth %x sten %x nbox %d\n", */
-/* flags, */
-/* rmesa->state.color.clear, */
-/* rmesa->state.depth.clear, */
-/* rmesa->state.stencil.clear, */
-/* rmesa->sarea->nbox ); */
-
- ret = drmRadeonClear( rmesa->dri.fd, flags,
- rmesa->state.color.clear,
- rmesa->state.depth.clear,
- rmesa->state.hw.mask.rb3d_planemask,
- rmesa->state.stencil.clear,
- rmesa->sarea->boxes, rmesa->sarea->nbox );
-
- if ( ret ) {
- UNLOCK_HARDWARE( rmesa );
- fprintf( stderr, "drmRadeonClear: return = %d\n", ret );
- exit( 1 );
+ if ( !all ) {
+ for ( ; i < nr ; i++ ) {
+ GLint x = box[i].x1;
+ GLint y = box[i].y1;
+ GLint w = box[i].x2 - x;
+ GLint h = box[i].y2 - y;
+
+ if ( x < cx ) w -= cx - x, x = cx;
+ if ( y < cy ) h -= cy - y, y = cy;
+ if ( x + w > cx + cw ) w = cx + cw - x;
+ if ( y + h > cy + ch ) h = cy + ch - y;
+ if ( w <= 0 ) continue;
+ if ( h <= 0 ) continue;
+
+ b->x1 = x;
+ b->y1 = y;
+ b->x2 = x + w;
+ b->y2 = y + h;
+ b++;
+ n++;
+ }
+ } else {
+ for ( ; i < nr ; i++ ) {
+ *b++ = box[i];
+ n++;
}
}
- UNLOCK_HARDWARE( rmesa );
+ rmesa->sarea->nbox = n;
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT_ALL );
- if ( rmesa->state.texture.unit[0].texobj )
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX0 );
- if ( rmesa->state.texture.unit[1].texobj )
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX1 );
- rmesa->upload_cliprects = 1;
+ clear.flags = flags;
+ clear.clear_color = rmesa->state.color.clear;
+ clear.clear_depth = rmesa->state.depth.clear;
+ clear.color_mask = rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK];
+ clear.depth_mask = rmesa->state.stencil.clear;
+ clear.depth_boxes = depth_boxes;
+
+ n--;
+ b = rmesa->sarea->boxes;
+ for ( ; n >= 0 ; n-- ) {
+ depth_boxes[n].f[RADEON_CLEAR_X1] = (float)b[n].x1;
+ depth_boxes[n].f[RADEON_CLEAR_Y1] = (float)b[n].y1;
+ depth_boxes[n].f[RADEON_CLEAR_X2] = (float)b[n].x2;
+ depth_boxes[n].f[RADEON_CLEAR_Y2] = (float)b[n].y2;
+ depth_boxes[n].f[RADEON_CLEAR_DEPTH] =
+ (float)rmesa->state.depth.clear;
+ }
+
+ ret = drmCommandWrite( rmesa->dri.fd, DRM_RADEON_CLEAR,
+ &clear, sizeof(drmRadeonClearType));
+
+ if ( ret ) {
+ UNLOCK_HARDWARE( rmesa );
+ fprintf( stderr, "DRM_RADEON_CLEAR: return = %d\n", ret );
+ exit( 1 );
+ }
}
- if ( mask )
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ UNLOCK_HARDWARE( rmesa );
}
@@ -799,10 +1019,22 @@ void radeonWaitForIdleLocked( radeonContextPtr rmesa )
{
int fd = rmesa->dri.fd;
int to = 0;
- int ret;
+ int ret, i = 0;
+
+ rmesa->c_drawWaits++;
do {
- ret = drmRadeonWaitForIdleCP( fd );
+ do {
+ ret = drmCommandNone( fd, DRM_RADEON_CP_IDLE);
+ } while ( ret && errno == EBUSY && i++ < RADEON_IDLE_RETRY );
+ if (ret && ret != -EBUSY) {
+ /*
+ * JO - I'm reluctant to print this message while holding the lock
+ *
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "%s: CP idle %d\n", __FUNCTION__, ret);
+ */
+ }
} while ( ( ret == -EBUSY ) && ( to++ < RADEON_TIMEOUT ) );
if ( ret < 0 ) {
@@ -813,32 +1045,91 @@ void radeonWaitForIdleLocked( radeonContextPtr rmesa )
}
-void radeonInitIoctlFuncs( GLcontext *ctx )
+static void radeonWaitForIdle( radeonContextPtr rmesa )
{
- ctx->Driver.Clear = radeonClear;
+ LOCK_HARDWARE(rmesa);
+ radeonWaitForIdleLocked( rmesa );
+ UNLOCK_HARDWARE(rmesa);
}
+void radeonWaitForVBlank( radeonContextPtr rmesa )
+{
+ drmVBlank vbl;
+ int ret;
+
+ if ( !rmesa->radeonScreen->irq )
+ return;
+
+ if ( getenv("LIBGL_SYNC_REFRESH") ) {
+ /* Wait for until the next vertical blank */
+ vbl.request.type = DRM_VBLANK_RELATIVE;
+ vbl.request.sequence = 1;
+ } else if ( getenv("LIBGL_THROTTLE_REFRESH") ) {
+ /* Wait for at least one vertical blank since the last call */
+ vbl.request.type = DRM_VBLANK_ABSOLUTE;
+ vbl.request.sequence = rmesa->vbl_seq + 1;
+ } else {
+ return;
+ }
+
+ UNLOCK_HARDWARE( rmesa );
+
+ if ((ret = drmWaitVBlank( rmesa->dri.fd, &vbl ))) {
+ fprintf(stderr, "%s: drmWaitVBlank returned %d, IRQs don't seem to be"
+ " working correctly.\nTry running with LIBGL_THROTTLE_REFRESH"
+ " and LIBL_SYNC_REFRESH unset.\n", __FUNCTION__, ret);
+ exit(1);
+ } else if (RADEON_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s: drmWaitVBlank returned %d\n", __FUNCTION__, ret);
+
+ rmesa->vbl_seq = vbl.reply.sequence;
+
+ LOCK_HARDWARE( rmesa );
+}
-void radeonReleaseRetainedBuffer( radeonContextPtr rmesa )
+void radeonFlush( GLcontext *ctx )
{
- ASSERT(rmesa->dma.retained);
+ radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
- if (rmesa->dma.retained &&
- rmesa->dma.retained != rmesa->dma.buffer) {
- RADEON_FIREVERTICES(rmesa); /* FIX ME: dependency tracking for retained */
+ if (RADEON_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
-/* fprintf(stderr, "releaseRetained: retained %p current %p\n", */
-/* rmesa->dma.retained, rmesa->dma.buffer); */
-
- LOCK_HARDWARE(rmesa);
- drmRadeonFlushPrims( rmesa->dri.fd,
- rmesa->dma.retained->idx,
- 1,
- 0, rmesa->store.state,
- 0, rmesa->store.prim);
- UNLOCK_HARDWARE(rmesa);
+ if (rmesa->dma.flush)
+ rmesa->dma.flush( rmesa );
+
+ if (rmesa->dri.drmMinor >= 3) {
+ if (!is_empty_list(&rmesa->hw.dirty))
+ radeonEmitState( rmesa );
+
+ if (rmesa->store.cmd_used)
+ radeonFlushCmdBuf( rmesa, __FUNCTION__ );
+ }
+}
+
+/* Make sure all commands have been sent to the hardware and have
+ * completed processing.
+ */
+void radeonFinish( GLcontext *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ radeonFlush( ctx );
+
+ if (rmesa->do_irqs) {
+ LOCK_HARDWARE( rmesa );
+ radeonEmitIrqLocked( rmesa );
+ UNLOCK_HARDWARE( rmesa );
+ radeonWaitIrq( rmesa );
}
+ else
+ radeonWaitForIdle( rmesa );
+}
+
- rmesa->dma.retained = 0;
+void radeonInitIoctlFuncs( GLcontext *ctx )
+{
+ ctx->Driver.Clear = radeonClear;
+ ctx->Driver.Finish = radeonFinish;
+ ctx->Driver.Flush = radeonFlush;
}
+
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.h b/xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.h
index a56b39e16..c8b00c08b 100644
--- a/xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.h
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.h
@@ -39,90 +39,138 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifdef GLX_DIRECT_RENDERING
-#include "radeon_dri.h"
+#include "simple_list.h"
#include "radeon_lock.h"
-#include "xf86drm.h"
-#include "xf86drmRadeon.h"
-#define RADEON_BUFFER_MAX_DWORDS (RADEON_BUFFER_SIZE / sizeof(CARD32))
+extern void radeonEmitState( radeonContextPtr rmesa );
+extern void radeonEmitVertexAOS( radeonContextPtr rmesa,
+ GLuint vertex_size,
+ GLuint offset );
+extern void radeonEmitVbufPrim( radeonContextPtr rmesa,
+ GLuint vertex_format,
+ GLuint primitive,
+ GLuint vertex_nr );
+
+extern void radeonFlushElts( radeonContextPtr rmesa );
+
+extern GLushort *radeonAllocEltsOpenEnded( radeonContextPtr rmesa,
+ GLuint vertex_format,
+ GLuint primitive,
+ GLuint min_nr );
+
+extern void radeonEmitAOS( radeonContextPtr rmesa,
+ struct radeon_dma_region **regions,
+ GLuint n,
+ GLuint offset );
+
+
+
+extern void radeonFlushCmdBuf( radeonContextPtr rmesa, const char * );
+extern void radeonRefillCurrentDmaRegion( radeonContextPtr rmesa );
+
+extern void radeonAllocDmaRegion( radeonContextPtr rmesa,
+ struct radeon_dma_region *region,
+ int bytes,
+ int alignment );
+
+extern void radeonAllocDmaRegionVerts( radeonContextPtr rmesa,
+ struct radeon_dma_region *region,
+ int numverts,
+ int vertsize,
+ int alignment );
+
+extern void radeonReleaseDmaRegion( radeonContextPtr rmesa,
+ struct radeon_dma_region *region,
+ const char *caller );
-extern drmBufPtr radeonGetBufferLocked( radeonContextPtr rmesa );
-extern void radeonEmitPrim( radeonContextPtr rmesa );
-extern void radeonFlushPrims( radeonContextPtr rmesa );
-extern void radeonFlushPrimsLocked( radeonContextPtr rmesa );
-extern void radeonFlushPrimsGetBuffer( radeonContextPtr rmesa );
-extern void radeonFireBlitLocked( radeonContextPtr rmesa,
- drmBufPtr buffer,
- GLint offset, GLint pitch, GLint format,
- GLint x, GLint y,
- GLint width, GLint height );
extern void radeonCopyBuffer( const __DRIdrawablePrivate *drawable );
extern void radeonPageFlip( const __DRIdrawablePrivate *drawable );
+extern void radeonFlush( GLcontext *ctx );
+extern void radeonFinish( GLcontext *ctx );
extern void radeonWaitForIdleLocked( radeonContextPtr rmesa );
-extern void radeonPerformanceCounters( radeonContextPtr rmesa );
-extern void radeonPerformanceBoxesLocked( radeonContextPtr rmesa );
+extern void radeonWaitForVBlank( radeonContextPtr rmesa );
extern void radeonInitIoctlFuncs( GLcontext *ctx );
-extern void radeonReleaseRetainedBuffer( radeonContextPtr rmesa );
+extern void radeonGetAllParams( radeonContextPtr rmesa );
+
+/* radeon_compat.c:
+ */
+extern void radeonCompatEmitPrimitive( radeonContextPtr rmesa,
+ GLuint vertex_format,
+ GLuint hw_primitive,
+ GLuint nrverts );
/* ================================================================
* Helper macros:
*/
+/* Close off the last primitive, if it exists.
+ */
+#define RADEON_NEWPRIM( rmesa ) \
+do { \
+ if ( rmesa->dma.flush ) \
+ rmesa->dma.flush( rmesa ); \
+} while (0)
+
/* Can accomodate several state changes and primitive changes without
* actually firing the buffer.
*/
-#define RADEON_STATECHANGE( rmesa, flag ) \
-do { \
- if ( 0 ) radeonPrintDirty( __FUNCTION__, flag ); \
- if ( rmesa->dma.low != rmesa->dma.last ) \
- radeonEmitPrim( rmesa ); \
- rmesa->state.hw.dirty |= flag; \
+#define RADEON_STATECHANGE( rmesa, ATOM ) \
+do { \
+ RADEON_NEWPRIM( rmesa ); \
+ move_to_head( &(rmesa->hw.dirty), &(rmesa->hw.ATOM)); \
} while (0)
+#define RADEON_DB_STATE( ATOM ) \
+ memcpy( rmesa->hw.ATOM.lastcmd, rmesa->hw.ATOM.cmd, \
+ rmesa->hw.ATOM.cmd_size * 4)
+
+static __inline int RADEON_DB_STATECHANGE(
+ radeonContextPtr rmesa,
+ struct radeon_state_atom *atom )
+{
+ if (memcmp(atom->cmd, atom->lastcmd, atom->cmd_size*4)) {
+ int *tmp;
+ RADEON_NEWPRIM( rmesa );
+ move_to_head( &(rmesa->hw.dirty), atom );
+ tmp = atom->cmd;
+ atom->cmd = atom->lastcmd;
+ atom->lastcmd = tmp;
+ return 1;
+ }
+ else
+ return 0;
+}
+
/* Fire the buffered vertices no matter what.
*/
-#define RADEON_FIREVERTICES( rmesa ) \
-do { \
- if ( rmesa->store.primnr || rmesa->dma.low != rmesa->dma.last ) { \
- if ( 0 ) \
- fprintf( stderr, "RADEON_FIREVERTICES in %s\n",__FUNCTION__ ); \
- radeonFlushPrims( rmesa ); \
- } \
+#define RADEON_FIREVERTICES( rmesa ) \
+do { \
+ if ( rmesa->store.cmd_used || rmesa->dma.flush ) { \
+ radeonFlush( rmesa->glCtx ); \
+ } \
} while (0)
-
-static __inline void *radeonAllocDmaLow( radeonContextPtr rmesa,
+/* Alloc space in the command buffer
+ */
+static __inline char *radeonAllocCmdBuf( radeonContextPtr rmesa,
int bytes, const char *where )
{
- if ( rmesa->dma.low + bytes > rmesa->dma.high ) {
- if (0) fprintf( stderr, "%s flush for %d (%d/%d/%d)\n",
- where, bytes, rmesa->dma.last,
- rmesa->dma.low, rmesa->dma.high );
- radeonFlushPrimsGetBuffer( rmesa );
- }
+ if (rmesa->store.cmd_used + bytes > RADEON_CMD_BUF_SZ)
+ radeonFlushCmdBuf( rmesa, __FUNCTION__ );
+
+ assert(rmesa->dri.drmMinor >= 3);
{
- GLubyte *head = rmesa->dma.address + rmesa->dma.low;
- if (0) fprintf( stderr, "%s: alloc %d (%d/%d/%d)\n",
- where, bytes, rmesa->dma.last,
- rmesa->dma.low, rmesa->dma.high );
- rmesa->dma.low += bytes;
+ char *head = rmesa->store.cmd_buf + rmesa->store.cmd_used;
+ rmesa->store.cmd_used += bytes;
return head;
}
}
-static __inline void *radeonAllocDmaHigh( radeonContextPtr rmesa, int bytes )
-{
- if ( rmesa->dma.low + bytes > rmesa->dma.high )
- radeonFlushPrimsGetBuffer( rmesa );
-
- rmesa->dma.high -= bytes;
- return (void *)(rmesa->dma.address + rmesa->dma.high);
-}
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c
index 0c05f507b..b292c25d1 100644
--- a/xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c
@@ -34,16 +34,52 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
+#include "glheader.h"
#include "radeon_context.h"
#include "radeon_lock.h"
#include "radeon_tex.h"
#include "radeon_state.h"
+#include "radeon_ioctl.h"
#if DEBUG_LOCKING
char *prevLockFile = NULL;
int prevLockLine = 0;
#endif
+/* Turn on/off page flipping according to the flags in the sarea:
+ */
+static void
+radeonUpdatePageFlipping( radeonContextPtr rmesa )
+{
+ int use_back;
+
+ if (rmesa->dri.drmMinor < 3)
+ return;
+
+ rmesa->doPageFlip = rmesa->sarea->pfAllowPageFlip;
+
+ use_back = (rmesa->glCtx->Color._DrawDestMask == BACK_LEFT_BIT);
+ use_back ^= (rmesa->sarea->pfCurrentPage == 1);
+
+ if ( RADEON_DEBUG & DEBUG_VERBOSE )
+ fprintf(stderr, "%s allow %d current %d\n", __FUNCTION__,
+ rmesa->doPageFlip,
+ rmesa->sarea->pfCurrentPage );
+
+ if ( use_back ) {
+ rmesa->state.color.drawOffset = rmesa->radeonScreen->backOffset;
+ rmesa->state.color.drawPitch = rmesa->radeonScreen->backPitch;
+ } else {
+ rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset;
+ rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch;
+ }
+
+ RADEON_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset;
+ rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch;
+}
+
+
/* Update the hardware state. This is called if another context has
* grabbed the hardware lock, which includes the X server. This
@@ -70,10 +106,14 @@ 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( rmesa->dri.display, sPriv, dPriv );
+ DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
if ( rmesa->lastStamp != dPriv->lastStamp ) {
- radeonSetCliprects( rmesa, rmesa->glCtx->Color.DriverDrawBuffer );
+ radeonUpdatePageFlipping( rmesa );
+ if (rmesa->glCtx->Color._DrawDestMask == BACK_LEFT_BIT)
+ radeonSetCliprects( rmesa, GL_BACK_LEFT );
+ else
+ radeonSetCliprects( rmesa, GL_FRONT_LEFT );
radeonUpdateViewportOffset( rmesa->glCtx );
rmesa->lastStamp = dPriv->lastStamp;
}
@@ -81,24 +121,8 @@ void radeonGetLock( radeonContextPtr rmesa, GLuint flags )
if ( sarea->ctxOwner != rmesa->dri.hwContext ) {
sarea->ctxOwner = rmesa->dri.hwContext;
- rmesa->upload_cliprects = 1;
- if ( rmesa->store.statenr ) {
- rmesa->store.state[0].dirty = RADEON_UPLOAD_CONTEXT_ALL;
- if ( rmesa->store.texture[0][0] )
- rmesa->store.state[0].dirty |= RADEON_UPLOAD_TEX0;
- if ( rmesa->store.texture[1][0] )
- rmesa->store.state[0].dirty |= RADEON_UPLOAD_TEX1;
- }
- else {
- rmesa->state.hw.dirty = RADEON_UPLOAD_CONTEXT_ALL;
- if ( rmesa->state.texture.unit[0].texobj )
- rmesa->state.hw.dirty |= RADEON_UPLOAD_TEX0;
- if ( rmesa->state.texture.unit[1].texobj )
- rmesa->state.hw.dirty |= RADEON_UPLOAD_TEX1;
- }
-
for ( i = 0 ; i < rmesa->texture.numHeaps ; i++ ) {
- if ( sarea->texAge[i] != rmesa->texture.age[i] ) {
+ if ( rmesa->texture.heap[i] && sarea->texAge[i] != rmesa->texture.age[i] ) {
radeonAgeTextures( rmesa, i );
}
}
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_maos_arrays.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_maos_arrays.c
new file mode 100644
index 000000000..d76ee087a
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_maos_arrays.c
@@ -0,0 +1,591 @@
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
+ Tungsten Graphics Inc., Cedar Park, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ *
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "mtypes.h"
+#include "mmath.h"
+#include "macros.h"
+
+#include "swrast_setup/swrast_setup.h"
+#include "math/m_translate.h"
+#include "tnl/tnl.h"
+#include "tnl/t_context.h"
+#include "tnl/t_imm_debug.h"
+
+#include "radeon_context.h"
+#include "radeon_ioctl.h"
+#include "radeon_state.h"
+#include "radeon_swtcl.h"
+#include "radeon_maos.h"
+
+/* Usage:
+ * - from radeon_tcl_render
+ * - call radeonEmitArrays to ensure uptodate arrays in dma
+ * - emit primitives (new type?) which reference the data
+ * -- need to use elts for lineloop, quads, quadstrip/flat
+ * -- other primitives are all well-formed (need tristrip-1,fake-poly)
+ *
+ */
+static void emit_ubyte_rgba3( GLcontext *ctx,
+ struct radeon_dma_region *rvb,
+ char *data,
+ int stride,
+ int count )
+{
+ int i;
+ radeon_color_t *out = (radeon_color_t *)(rvb->start + rvb->address);
+
+ if (RADEON_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s count %d stride %d out %p\n",
+ __FUNCTION__, count, stride, out);
+
+ for (i = 0; i < count; i++) {
+ out->red = *data;
+ out->green = *(data+1);
+ out->blue = *(data+2);
+ out->alpha = 0xFF;
+ out++;
+ data += stride;
+ }
+}
+
+
+#if defined(USE_X86_ASM)
+#define COPY_DWORDS( dst, src, nr ) \
+do { \
+ int __tmp; \
+ __asm__ __volatile__( "rep ; movsl" \
+ : "=%c" (__tmp), "=D" (dst), "=S" (__tmp) \
+ : "0" (nr), \
+ "D" ((long)dst), \
+ "S" ((long)src) ); \
+} while (0)
+#else
+#define COPY_DWORDS( dst, src, nr ) \
+do { \
+ int j; \
+ for ( j = 0 ; j < nr ; j++ ) \
+ dst[j] = ((int *)src)[j]; \
+ dst += nr; \
+} while (0)
+#endif
+
+
+
+static void emit_ubyte_rgba4( GLcontext *ctx,
+ struct radeon_dma_region *rvb,
+ char *data,
+ int stride,
+ int count )
+{
+ int i;
+ int *out = (int *)(rvb->address + rvb->start);
+
+ if (RADEON_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s count %d stride %d\n",
+ __FUNCTION__, count, stride);
+
+ if (stride == 4)
+ COPY_DWORDS( out, data, count );
+ else
+ for (i = 0; i < count; i++) {
+ *out++ = LE32_TO_CPU(*(int *)data);
+ data += stride;
+ }
+}
+
+
+static void emit_ubyte_rgba( GLcontext *ctx,
+ struct radeon_dma_region *rvb,
+ char *data,
+ int size,
+ int stride,
+ int count )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+
+ if (RADEON_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s %d/%d\n", __FUNCTION__, count, size);
+
+ assert (!rvb->buf);
+
+ if (stride == 0) {
+ radeonAllocDmaRegion( rmesa, rvb, 4, 4 );
+ count = 1;
+ rvb->aos_start = GET_START(rvb);
+ rvb->aos_stride = 0;
+ rvb->aos_size = 1;
+ }
+ else {
+ radeonAllocDmaRegion( rmesa, rvb, 4 * count, 4 ); /* alignment? */
+ rvb->aos_start = GET_START(rvb);
+ rvb->aos_stride = 1;
+ rvb->aos_size = 1;
+ }
+
+ /* Emit the data
+ */
+ switch (size) {
+ case 3:
+ emit_ubyte_rgba3( ctx, rvb, data, stride, count );
+ break;
+ case 4:
+ emit_ubyte_rgba4( ctx, rvb, data, stride, count );
+ break;
+ default:
+ assert(0);
+ exit(1);
+ break;
+ }
+}
+
+
+
+
+static void emit_vec8( GLcontext *ctx,
+ struct radeon_dma_region *rvb,
+ char *data,
+ int stride,
+ int count )
+{
+ int i;
+ int *out = (int *)(rvb->address + rvb->start);
+
+ if (RADEON_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s count %d stride %d\n",
+ __FUNCTION__, count, stride);
+
+ if (stride == 8)
+ COPY_DWORDS( out, data, count*2 );
+ else
+ for (i = 0; i < count; i++) {
+ out[0] = *(int *)data;
+ out[1] = *(int *)(data+4);
+ out += 2;
+ data += stride;
+ }
+}
+
+static void emit_vec12( GLcontext *ctx,
+ struct radeon_dma_region *rvb,
+ char *data,
+ int stride,
+ int count )
+{
+ int i;
+ int *out = (int *)(rvb->address + rvb->start);
+
+ if (RADEON_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s count %d stride %d out %p data %p\n",
+ __FUNCTION__, count, stride, out, data);
+
+ if (stride == 12)
+ COPY_DWORDS( out, data, count*3 );
+ else
+ for (i = 0; i < count; i++) {
+ out[0] = *(int *)data;
+ out[1] = *(int *)(data+4);
+ out[2] = *(int *)(data+8);
+ out += 3;
+ data += stride;
+ }
+}
+
+static void emit_vec16( GLcontext *ctx,
+ struct radeon_dma_region *rvb,
+ char *data,
+ int stride,
+ int count )
+{
+ int i;
+ int *out = (int *)(rvb->address + rvb->start);
+
+ if (RADEON_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s count %d stride %d\n",
+ __FUNCTION__, count, stride);
+
+ if (stride == 16)
+ COPY_DWORDS( out, data, count*4 );
+ else
+ for (i = 0; i < count; i++) {
+ out[0] = *(int *)data;
+ out[1] = *(int *)(data+4);
+ out[2] = *(int *)(data+8);
+ out[3] = *(int *)(data+12);
+ out += 4;
+ data += stride;
+ }
+}
+
+
+static void emit_vector( GLcontext *ctx,
+ struct radeon_dma_region *rvb,
+ char *data,
+ int size,
+ int stride,
+ int count )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+
+ if (RADEON_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s %d/%d\n", __FUNCTION__, count, size);
+
+ assert (!rvb->buf);
+
+ if (stride == 0) {
+ radeonAllocDmaRegion( rmesa, rvb, size * 4, 4 );
+ count = 1;
+ rvb->aos_start = GET_START(rvb);
+ rvb->aos_stride = 0;
+ rvb->aos_size = size;
+ }
+ else {
+ radeonAllocDmaRegion( rmesa, rvb, size * count * 4, 4 ); /* alignment? */
+ rvb->aos_start = GET_START(rvb);
+ rvb->aos_stride = size;
+ rvb->aos_size = size;
+ }
+
+ /* Emit the data
+ */
+ switch (size) {
+ case 2:
+ emit_vec8( ctx, rvb, data, stride, count );
+ break;
+ case 3:
+ emit_vec12( ctx, rvb, data, stride, count );
+ break;
+ case 4:
+ emit_vec16( ctx, rvb, data, stride, count );
+ break;
+ default:
+ assert(0);
+ exit(1);
+ break;
+ }
+
+}
+
+
+
+static void emit_s0_vec( GLcontext *ctx,
+ struct radeon_dma_region *rvb,
+ char *data,
+ int stride,
+ int count )
+{
+ int i;
+ int *out = (int *)(rvb->address + rvb->start);
+
+ if (RADEON_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s count %d stride %d\n",
+ __FUNCTION__, count, stride);
+
+ for (i = 0; i < count; i++) {
+ out[0] = *(int *)data;
+ out[1] = 0;
+ out += 2;
+ data += stride;
+ }
+}
+
+static void emit_stq_vec( GLcontext *ctx,
+ struct radeon_dma_region *rvb,
+ char *data,
+ int stride,
+ int count )
+{
+ int i;
+ int *out = (int *)(rvb->address + rvb->start);
+
+ if (RADEON_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s count %d stride %d\n",
+ __FUNCTION__, count, stride);
+
+ for (i = 0; i < count; i++) {
+ out[0] = *(int *)data;
+ out[1] = *(int *)(data+4);
+ out[2] = *(int *)(data+12);
+ out += 3;
+ data += stride;
+ }
+}
+
+
+
+
+static void emit_tex_vector( GLcontext *ctx,
+ struct radeon_dma_region *rvb,
+ char *data,
+ int size,
+ int stride,
+ int count )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ int emitsize;
+
+ if (RADEON_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s %d/%d\n", __FUNCTION__, count, size);
+
+ assert (!rvb->buf);
+
+ switch (size) {
+ case 4: emitsize = 3; break;
+ default: emitsize = 2; break;
+ }
+
+
+ if (stride == 0) {
+ radeonAllocDmaRegion( rmesa, rvb, 4 * emitsize, 4 );
+ count = 1;
+ rvb->aos_start = GET_START(rvb);
+ rvb->aos_stride = 0;
+ rvb->aos_size = emitsize;
+ }
+ else {
+ radeonAllocDmaRegion( rmesa, rvb, 4 * emitsize * count, 4 );
+ rvb->aos_start = GET_START(rvb);
+ rvb->aos_stride = emitsize;
+ rvb->aos_size = emitsize;
+ }
+
+
+ /* Emit the data
+ */
+ switch (size) {
+ case 1:
+ emit_s0_vec( ctx, rvb, data, stride, count );
+ break;
+ case 2:
+ emit_vec8( ctx, rvb, data, stride, count );
+ break;
+ case 3:
+ emit_vec8( ctx, rvb, data, stride, count );
+ break;
+ case 4:
+ emit_stq_vec( ctx, rvb, data, stride, count );
+ break;
+ default:
+ assert(0);
+ exit(1);
+ break;
+ }
+}
+
+
+
+
+/* Emit any changed arrays to new agp memory, re-emit a packet to
+ * update the arrays.
+ */
+void radeonEmitArrays( GLcontext *ctx, GLuint inputs )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
+ struct vertex_buffer *VB = &TNL_CONTEXT( ctx )->vb;
+ struct radeon_dma_region **component = rmesa->tcl.aos_components;
+ GLuint nr = 0;
+ GLuint vfmt = 0;
+ GLuint count = VB->Count;
+ GLuint vtx;
+
+ if (RADEON_DEBUG & DEBUG_VERTS)
+ _tnl_print_vert_flags( __FUNCTION__, inputs );
+
+ if (1) {
+ if (!rmesa->tcl.obj.buf)
+ emit_vector( ctx,
+ &rmesa->tcl.obj,
+ (char *)VB->ObjPtr->data,
+ VB->ObjPtr->size,
+ VB->ObjPtr->stride,
+ count);
+
+ switch( VB->ObjPtr->size ) {
+ case 4: vfmt |= RADEON_CP_VC_FRMT_W0;
+ case 3: vfmt |= RADEON_CP_VC_FRMT_Z;
+ case 2: vfmt |= RADEON_CP_VC_FRMT_XY;
+ default:
+ }
+ component[nr++] = &rmesa->tcl.obj;
+ }
+
+
+ if (inputs & VERT_BIT_NORMAL) {
+ if (!rmesa->tcl.norm.buf)
+ emit_vector( ctx,
+ &(rmesa->tcl.norm),
+ (char *)VB->NormalPtr->data,
+ 3,
+ VB->NormalPtr->stride,
+ count);
+
+ vfmt |= RADEON_CP_VC_FRMT_N0;
+ component[nr++] = &rmesa->tcl.norm;
+ }
+
+ if (inputs & VERT_BIT_COLOR0) {
+ if (VB->ColorPtr[0]->Type == GL_UNSIGNED_BYTE) {
+ if (!rmesa->tcl.rgba.buf)
+ emit_ubyte_rgba( ctx,
+ &rmesa->tcl.rgba,
+ (char *)VB->ColorPtr[0]->Ptr,
+ VB->ColorPtr[0]->Size,
+ VB->ColorPtr[0]->StrideB,
+ count);
+
+ vfmt |= RADEON_CP_VC_FRMT_PKCOLOR;
+ }
+ else {
+ int emitsize;
+
+ if (VB->ColorPtr[0]->Size == 4 &&
+ (VB->ColorPtr[0]->StrideB != 0 ||
+ ((GLfloat *)VB->ColorPtr[0]->Ptr)[3] != 1.0)) {
+ vfmt |= RADEON_CP_VC_FRMT_FPCOLOR | RADEON_CP_VC_FRMT_FPALPHA;
+ emitsize = 4;
+ }
+ else {
+ vfmt |= RADEON_CP_VC_FRMT_FPCOLOR;
+ emitsize = 3;
+ }
+
+
+ if (!rmesa->tcl.rgba.buf)
+ emit_vector( ctx,
+ &(rmesa->tcl.rgba),
+ (char *)VB->ColorPtr[0]->Ptr,
+ emitsize,
+ VB->ColorPtr[0]->StrideB,
+ count);
+ }
+
+ component[nr++] = &rmesa->tcl.rgba;
+ }
+
+
+ if (inputs & VERT_BIT_COLOR1) {
+ if (!rmesa->tcl.spec.buf) {
+ if (VB->SecondaryColorPtr[0]->Type != GL_UNSIGNED_BYTE)
+ radeon_import_float_spec_colors( ctx );
+
+ emit_ubyte_rgba( ctx,
+ &rmesa->tcl.spec,
+ (char *)VB->SecondaryColorPtr[0]->Ptr,
+ 3,
+ VB->SecondaryColorPtr[0]->StrideB,
+ count);
+ }
+
+ vfmt |= RADEON_CP_VC_FRMT_PKSPEC;
+ component[nr++] = &rmesa->tcl.spec;
+ }
+
+ vtx = (rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &
+ ~(RADEON_TCL_VTX_Q0|RADEON_TCL_VTX_Q1));
+
+ if (inputs & VERT_BIT_TEX0) {
+ if (!rmesa->tcl.tex[0].buf)
+ emit_tex_vector( ctx,
+ &(rmesa->tcl.tex[0]),
+ (char *)VB->TexCoordPtr[0]->data,
+ VB->TexCoordPtr[0]->size,
+ VB->TexCoordPtr[0]->stride,
+ count );
+
+ switch( VB->TexCoordPtr[0]->size ) {
+ case 4:
+ vtx |= RADEON_TCL_VTX_Q0;
+ vfmt |= RADEON_CP_VC_FRMT_Q0;
+ default:
+ vfmt |= RADEON_CP_VC_FRMT_ST0;
+ }
+ component[nr++] = &rmesa->tcl.tex[0];
+ }
+
+ if (inputs & VERT_BIT_TEX1) {
+ if (!rmesa->tcl.tex[1].buf)
+ emit_tex_vector( ctx,
+ &(rmesa->tcl.tex[1]),
+ (char *)VB->TexCoordPtr[1]->data,
+ VB->TexCoordPtr[1]->size,
+ VB->TexCoordPtr[1]->stride,
+ count );
+
+ switch( VB->TexCoordPtr[1]->size ) {
+ case 4:
+ vtx |= RADEON_TCL_VTX_Q1;
+ vfmt |= RADEON_CP_VC_FRMT_Q1;
+ default:
+ vfmt |= RADEON_CP_VC_FRMT_ST1;
+ }
+ component[nr++] = &rmesa->tcl.tex[1];
+ }
+
+ if (vtx != rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT]) {
+ RADEON_STATECHANGE( rmesa, tcl );
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] = vtx;
+ }
+
+ rmesa->tcl.nr_aos_components = nr;
+ rmesa->tcl.vertex_format = vfmt;
+}
+
+
+void radeonReleaseArrays( GLcontext *ctx, GLuint newinputs )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
+
+ if (RADEON_DEBUG & DEBUG_VERTS)
+ _tnl_print_vert_flags( __FUNCTION__, newinputs );
+
+ if (newinputs & VERT_BIT_POS)
+ radeonReleaseDmaRegion( rmesa, &rmesa->tcl.obj, __FUNCTION__ );
+
+ if (newinputs & VERT_BIT_NORMAL)
+ radeonReleaseDmaRegion( rmesa, &rmesa->tcl.norm, __FUNCTION__ );
+
+ if (newinputs & VERT_BIT_COLOR0)
+ radeonReleaseDmaRegion( rmesa, &rmesa->tcl.rgba, __FUNCTION__ );
+
+ if (newinputs & VERT_BIT_COLOR1)
+ radeonReleaseDmaRegion( rmesa, &rmesa->tcl.spec, __FUNCTION__ );
+
+ if (newinputs & VERT_BIT_TEX0)
+ radeonReleaseDmaRegion( rmesa, &rmesa->tcl.tex[0], __FUNCTION__ );
+
+ if (newinputs & VERT_BIT_TEX1)
+ radeonReleaseDmaRegion( rmesa, &rmesa->tcl.tex[1], __FUNCTION__ );
+}
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_maos_vbtmp.h b/xc/lib/GL/mesa/src/drv/radeon/radeon_maos_vbtmp.h
new file mode 100644
index 000000000..b379bad98
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_maos_vbtmp.h
@@ -0,0 +1,368 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 4.1
+ *
+ * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#ifndef LOCALVARS
+#define LOCALVARS
+#endif
+
+#undef TCL_DEBUG
+#ifndef TCL_DEBUG
+#define TCL_DEBUG 0
+#endif
+
+static void TAG(emit)( GLcontext *ctx,
+ GLuint start, GLuint end,
+ void *dest )
+{
+ LOCALVARS
+ struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
+ GLuint (*tc0)[4], (*tc1)[4], (*tc2)[4];
+ GLfloat (*fog)[4];
+ GLuint (*norm)[4];
+ GLubyte (*col)[4], (*spec)[4];
+ GLuint tc0_stride, tc1_stride, col_stride, spec_stride, fog_stride;
+ GLuint tc2_stride, norm_stride;
+ GLuint (*coord)[4];
+ GLuint coord_stride; /* object coordinates */
+ GLubyte dummy[4];
+ int i;
+
+ union emit_union *v = (union emit_union *)dest;
+
+ if (RADEON_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ /* The vertex code expects Obj to be clean to element 3. To fix
+ * this, add more vertex code (for obj-2, obj-3) or preferably move
+ * to maos.
+ */
+ if (VB->ObjPtr->size < 3) {
+ if (VB->ObjPtr->flags & VEC_NOT_WRITEABLE) {
+ VB->import_data( ctx, VERT_BIT_POS, VEC_NOT_WRITEABLE );
+ }
+ _mesa_vector4f_clean_elem( VB->ObjPtr, VB->Count, 2 );
+ }
+
+ if (DO_W && VB->ObjPtr->size < 4) {
+ if (VB->ObjPtr->flags & VEC_NOT_WRITEABLE) {
+ VB->import_data( ctx, VERT_BIT_POS, VEC_NOT_WRITEABLE );
+ }
+ _mesa_vector4f_clean_elem( VB->ObjPtr, VB->Count, 3 );
+ }
+
+ coord = (GLuint (*)[4])VB->ObjPtr->data;
+ coord_stride = VB->ObjPtr->stride;
+
+ if (DO_TEX2) {
+ const GLuint t2 = GET_TEXSOURCE(2);
+ tc2 = (GLuint (*)[4])VB->TexCoordPtr[t2]->data;
+ tc2_stride = VB->TexCoordPtr[t2]->stride;
+ if (DO_PTEX && VB->TexCoordPtr[t2]->size < 4) {
+ if (VB->TexCoordPtr[t2]->flags & VEC_NOT_WRITEABLE) {
+ VB->import_data( ctx, VERT_BIT_TEX2, VEC_NOT_WRITEABLE );
+ }
+ _mesa_vector4f_clean_elem( VB->TexCoordPtr[t2], VB->Count, 3 );
+ }
+ }
+
+ if (DO_TEX1) {
+ if (VB->TexCoordPtr[1]) {
+ const GLuint t1 = GET_TEXSOURCE(1);
+ tc1 = (GLuint (*)[4])VB->TexCoordPtr[t1]->data;
+ tc1_stride = VB->TexCoordPtr[t1]->stride;
+ if (DO_PTEX && VB->TexCoordPtr[t1]->size < 4) {
+ if (VB->TexCoordPtr[t1]->flags & VEC_NOT_WRITEABLE) {
+ VB->import_data( ctx, VERT_BIT_TEX1, VEC_NOT_WRITEABLE );
+ }
+ _mesa_vector4f_clean_elem( VB->TexCoordPtr[t1], VB->Count, 3 );
+ }
+ } else {
+ tc1 = (GLuint (*)[4])&ctx->Current.Attrib[VERT_ATTRIB_TEX1]; /* could be anything, really */
+ tc1_stride = 0;
+ }
+ }
+
+ if (DO_TEX0) {
+ if (VB->TexCoordPtr[0]) {
+ const GLuint t0 = GET_TEXSOURCE(0);
+ tc0_stride = VB->TexCoordPtr[t0]->stride;
+ tc0 = (GLuint (*)[4])VB->TexCoordPtr[t0]->data;
+ if (DO_PTEX && VB->TexCoordPtr[t0]->size < 4) {
+ if (VB->TexCoordPtr[t0]->flags & VEC_NOT_WRITEABLE) {
+ VB->import_data( ctx, VERT_BIT_TEX0, VEC_NOT_WRITEABLE );
+ }
+ _mesa_vector4f_clean_elem( VB->TexCoordPtr[t0], VB->Count, 3 );
+ }
+ } else {
+ tc0 = (GLuint (*)[4])&ctx->Current.Attrib[VERT_ATTRIB_TEX0]; /* could be anything, really */
+ tc0_stride = 0;
+ }
+
+ }
+
+ if (DO_NORM) {
+ if (VB->NormalPtr) {
+ norm_stride = VB->NormalPtr->stride;
+ norm = (GLuint (*)[4])VB->NormalPtr->data;
+ } else {
+ norm_stride = 0;
+ norm = (GLuint (*)[4])&ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
+ }
+ }
+
+ if (DO_RGBA) {
+ if (VB->ColorPtr[0]) {
+ /* This is incorrect when colormaterial is enabled:
+ */
+ if (VB->ColorPtr[0]->Type != GL_UNSIGNED_BYTE) {
+ if (0) fprintf(stderr, "IMPORTING FLOAT COLORS\n");
+ IMPORT_FLOAT_COLORS( ctx );
+ }
+ col = (GLubyte (*)[4])VB->ColorPtr[0]->Ptr;
+ col_stride = VB->ColorPtr[0]->StrideB;
+ } else {
+ col = &dummy; /* any old memory is fine */
+ col_stride = 0;
+ }
+ }
+
+ if (DO_SPEC) {
+ if (VB->SecondaryColorPtr[0]) {
+ if (VB->SecondaryColorPtr[0]->Type != GL_UNSIGNED_BYTE)
+ IMPORT_FLOAT_SPEC_COLORS( ctx );
+ spec = (GLubyte (*)[4])VB->SecondaryColorPtr[0]->Ptr;
+ spec_stride = VB->SecondaryColorPtr[0]->StrideB;
+ } else {
+ spec = &dummy;
+ spec_stride = 0;
+ }
+ }
+
+ if (DO_FOG) {
+ if (VB->FogCoordPtr) {
+ fog = VB->FogCoordPtr->data;
+ fog_stride = VB->FogCoordPtr->stride;
+ } else {
+ fog = (GLfloat (*)[4])&dummy; fog[0][0] = 0.0F;
+ fog_stride = 0;
+ }
+ }
+
+
+ if (VB->importable_data) {
+ if (start) {
+ coord = (GLuint (*)[4])((GLubyte *)coord + start * coord_stride);
+ if (DO_TEX0)
+ tc0 = (GLuint (*)[4])((GLubyte *)tc0 + start * tc0_stride);
+ if (DO_TEX1)
+ tc1 = (GLuint (*)[4])((GLubyte *)tc1 + start * tc1_stride);
+ if (DO_TEX2)
+ tc2 = (GLuint (*)[4])((GLubyte *)tc2 + start * tc2_stride);
+ if (DO_NORM)
+ norm = (GLuint (*)[4])((GLubyte *)norm + start * norm_stride);
+ if (DO_RGBA)
+ STRIDE_4UB(col, start * col_stride);
+ if (DO_SPEC)
+ STRIDE_4UB(spec, start * spec_stride);
+ if (DO_FOG)
+ fog = (GLfloat (*)[4])((GLubyte *)fog + start * fog_stride);
+ }
+
+ for (i=start; i < end; i++) {
+ v[0].ui = coord[0][0];
+ v[1].ui = coord[0][1];
+ v[2].ui = coord[0][2];
+ if (TCL_DEBUG) fprintf(stderr, "%d: %.2f %.2f %.2f ", i, v[0].f, v[1].f, v[2].f);
+ if (DO_W) {
+ v[3].ui = coord[0][3];
+ if (TCL_DEBUG) fprintf(stderr, "%.2f ", v[3].f);
+ v += 4;
+ }
+ else
+ v += 3;
+ coord = (GLuint (*)[4])((GLubyte *)coord + coord_stride);
+
+ if (DO_NORM) {
+ v[0].ui = norm[0][0];
+ v[1].ui = norm[0][1];
+ v[2].ui = norm[0][2];
+ if (TCL_DEBUG) fprintf(stderr, "norm: %.2f %.2f %.2f ", v[0].f, v[1].f, v[2].f);
+ v += 3;
+ norm = (GLuint (*)[4])((GLubyte *)norm + norm_stride);
+ }
+ if (DO_RGBA) {
+ v[0].ui = LE32_TO_CPU(*(GLuint *)&col[0]);
+ STRIDE_4UB(col, col_stride);
+ if (TCL_DEBUG) fprintf(stderr, "%x ", v[0].ui);
+ v++;
+ }
+ if (DO_SPEC || DO_FOG) {
+ if (DO_SPEC) {
+ v[0].specular.red = spec[0][0];
+ v[0].specular.green = spec[0][1];
+ v[0].specular.blue = spec[0][2];
+ STRIDE_4UB(spec, spec_stride);
+ }
+ if (DO_FOG) {
+ v[0].specular.alpha = fog[0][0] * 255.0;
+ fog = (GLfloat (*)[4])((GLubyte *)fog + fog_stride);
+ }
+ if (TCL_DEBUG) fprintf(stderr, "%x ", v[0].ui);
+ v++;
+ }
+ if (DO_TEX0) {
+ v[0].ui = tc0[0][0];
+ v[1].ui = tc0[0][1];
+ if (TCL_DEBUG) fprintf(stderr, "t0: %.2f %.2f ", v[0].f, v[1].f);
+ if (DO_PTEX) {
+ v[2].ui = tc0[0][3];
+ if (TCL_DEBUG) fprintf(stderr, "%.2f ", v[2].f);
+ v += 3;
+ }
+ else
+ v += 2;
+ tc0 = (GLuint (*)[4])((GLubyte *)tc0 + tc0_stride);
+ }
+ if (DO_TEX1) {
+ v[0].ui = tc1[0][0];
+ v[1].ui = tc1[0][1];
+ if (TCL_DEBUG) fprintf(stderr, "t1: %.2f %.2f ", v[0].f, v[1].f);
+ if (DO_PTEX) {
+ v[2].ui = tc1[0][3];
+ if (TCL_DEBUG) fprintf(stderr, "%.2f ", v[2].f);
+ v += 3;
+ }
+ else
+ v += 2;
+ tc1 = (GLuint (*)[4])((GLubyte *)tc1 + tc1_stride);
+ }
+ if (DO_TEX2) {
+ v[0].ui = tc2[0][0];
+ v[1].ui = tc2[0][1];
+ if (DO_PTEX) {
+ v[2].ui = tc2[0][3];
+ v += 3;
+ }
+ else
+ v += 2;
+ tc2 = (GLuint (*)[4])((GLubyte *)tc2 + tc2_stride);
+ }
+ if (TCL_DEBUG) fprintf(stderr, "\n");
+ }
+ } else {
+ for (i=start; i < end; i++) {
+ v[0].ui = coord[i][0];
+ v[1].ui = coord[i][1];
+ v[2].ui = coord[i][2];
+ if (DO_W) {
+ v[3].ui = coord[i][3];
+ v += 4;
+ }
+ else
+ v += 3;
+
+ if (DO_NORM) {
+ v[0].ui = norm[i][0];
+ v[1].ui = norm[i][1];
+ v[2].ui = norm[i][2];
+ v += 3;
+ }
+ if (DO_RGBA) {
+ v[0].ui = LE32_TO_CPU(*(GLuint *)&col[i]);
+ v++;
+ }
+ if (DO_SPEC || DO_FOG) {
+ if (DO_SPEC) {
+ v[0].specular.red = spec[i][0];
+ v[0].specular.green = spec[i][1];
+ v[0].specular.blue = spec[i][2];
+ }
+ if (DO_FOG) {
+ GLfloat *f = (GLfloat *) ((GLubyte *)fog + fog_stride);
+ v[0].specular.alpha = *f * 255.0;
+ }
+ v++;
+ }
+ if (DO_TEX0) {
+ v[0].ui = tc0[i][0];
+ v[1].ui = tc0[i][1];
+ if (DO_PTEX) {
+ v[2].ui = tc0[i][3];
+ v += 3;
+ }
+ else
+ v += 2;
+ }
+ if (DO_TEX1) {
+ v[0].ui = tc1[i][0];
+ v[1].ui = tc1[i][1];
+ if (DO_PTEX) {
+ v[2].ui = tc1[i][3];
+ v += 3;
+ }
+ else
+ v += 2;
+ }
+ if (DO_TEX2) {
+ v[0].ui = tc2[i][0];
+ v[1].ui = tc2[i][1];
+ if (DO_PTEX) {
+ v[2].ui = tc2[i][3];
+ v += 3;
+ }
+ else
+ v += 2;
+ }
+ }
+ }
+}
+
+
+
+static void TAG(init)( void )
+{
+ int sz = 3;
+ if (DO_W) sz++;
+ if (DO_NORM) sz += 3;
+ if (DO_RGBA) sz++;
+ if (DO_SPEC || DO_FOG) sz++;
+ if (DO_TEX0) sz += 2;
+ if (DO_TEX0 && DO_PTEX) sz++;
+ if (DO_TEX1) sz += 2;
+ if (DO_TEX1 && DO_PTEX) sz++;
+ if (DO_TEX2) sz += 2;
+ if (DO_TEX2 && DO_PTEX) sz++;
+
+ setup_tab[IDX].emit = TAG(emit);
+ setup_tab[IDX].vertex_format = IND;
+ setup_tab[IDX].vertex_size = sz;
+}
+
+
+#undef IND
+#undef TAG
+#undef IDX
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_maos_verts.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_maos_verts.c
new file mode 100644
index 000000000..671133a8b
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_maos_verts.c
@@ -0,0 +1,335 @@
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
+ Tungsten Graphics Inc., Austin, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ *
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "mtypes.h"
+
+#include "array_cache/acache.h"
+#include "tnl/tnl.h"
+#include "tnl/t_pipeline.h"
+#include "tnl/t_imm_debug.h"
+
+#include "radeon_context.h"
+#include "radeon_state.h"
+#include "radeon_ioctl.h"
+#include "radeon_tex.h"
+#include "radeon_tcl.h"
+#include "radeon_swtcl.h"
+#include "radeon_maos.h"
+
+
+#define RADEON_TCL_MAX_SETUP 13
+
+union emit_union { float f; GLuint ui; radeon_color_t specular; };
+
+static struct {
+ void (*emit)( GLcontext *, GLuint, GLuint, void * );
+ GLuint vertex_size;
+ GLuint vertex_format;
+} setup_tab[RADEON_TCL_MAX_SETUP];
+
+#define DO_W (IND & RADEON_CP_VC_FRMT_W0)
+#define DO_RGBA (IND & RADEON_CP_VC_FRMT_PKCOLOR)
+#define DO_SPEC (IND & RADEON_CP_VC_FRMT_PKSPEC)
+#define DO_FOG (IND & RADEON_CP_VC_FRMT_PKSPEC)
+#define DO_TEX0 (IND & RADEON_CP_VC_FRMT_ST0)
+#define DO_TEX1 (IND & RADEON_CP_VC_FRMT_ST1)
+#define DO_PTEX (IND & RADEON_CP_VC_FRMT_Q0)
+#define DO_NORM (IND & RADEON_CP_VC_FRMT_N0)
+
+#define DO_TEX2 0
+#define DO_TEX3 0
+
+#define GET_TEXSOURCE(n) n
+#define GET_UBYTE_COLOR_STORE() &RADEON_CONTEXT(ctx)->UbyteColor
+#define GET_UBYTE_SPEC_COLOR_STORE() &RADEON_CONTEXT(ctx)->UbyteSecondaryColor
+
+#define IMPORT_FLOAT_COLORS radeon_import_float_colors
+#define IMPORT_FLOAT_SPEC_COLORS radeon_import_float_spec_colors
+
+/***********************************************************************
+ * Generate vertex emit functions *
+ ***********************************************************************/
+
+
+/* Defined in order of increasing vertex size:
+ */
+#define IDX 0
+#define IND (RADEON_CP_VC_FRMT_XY| \
+ RADEON_CP_VC_FRMT_Z| \
+ RADEON_CP_VC_FRMT_PKCOLOR)
+#define TAG(x) x##_rgba
+#include "radeon_maos_vbtmp.h"
+
+#define IDX 1
+#define IND (RADEON_CP_VC_FRMT_XY| \
+ RADEON_CP_VC_FRMT_Z| \
+ RADEON_CP_VC_FRMT_N0)
+#define TAG(x) x##_n
+#include "radeon_maos_vbtmp.h"
+
+#define IDX 2
+#define IND (RADEON_CP_VC_FRMT_XY| \
+ RADEON_CP_VC_FRMT_Z| \
+ RADEON_CP_VC_FRMT_PKCOLOR| \
+ RADEON_CP_VC_FRMT_ST0)
+#define TAG(x) x##_rgba_st
+#include "radeon_maos_vbtmp.h"
+
+#define IDX 3
+#define IND (RADEON_CP_VC_FRMT_XY| \
+ RADEON_CP_VC_FRMT_Z| \
+ RADEON_CP_VC_FRMT_PKCOLOR| \
+ RADEON_CP_VC_FRMT_N0)
+#define TAG(x) x##_rgba_n
+#include "radeon_maos_vbtmp.h"
+
+#define IDX 4
+#define IND (RADEON_CP_VC_FRMT_XY| \
+ RADEON_CP_VC_FRMT_Z| \
+ RADEON_CP_VC_FRMT_ST0| \
+ RADEON_CP_VC_FRMT_N0)
+#define TAG(x) x##_st_n
+#include "radeon_maos_vbtmp.h"
+
+#define IDX 5
+#define IND (RADEON_CP_VC_FRMT_XY| \
+ RADEON_CP_VC_FRMT_Z| \
+ RADEON_CP_VC_FRMT_PKCOLOR| \
+ RADEON_CP_VC_FRMT_ST0| \
+ RADEON_CP_VC_FRMT_ST1)
+#define TAG(x) x##_rgba_st_st
+#include "radeon_maos_vbtmp.h"
+
+#define IDX 6
+#define IND (RADEON_CP_VC_FRMT_XY| \
+ RADEON_CP_VC_FRMT_Z| \
+ RADEON_CP_VC_FRMT_PKCOLOR| \
+ RADEON_CP_VC_FRMT_ST0| \
+ RADEON_CP_VC_FRMT_N0)
+#define TAG(x) x##_rgba_st_n
+#include "radeon_maos_vbtmp.h"
+
+#define IDX 7
+#define IND (RADEON_CP_VC_FRMT_XY| \
+ RADEON_CP_VC_FRMT_Z| \
+ RADEON_CP_VC_FRMT_PKCOLOR| \
+ RADEON_CP_VC_FRMT_PKSPEC| \
+ RADEON_CP_VC_FRMT_ST0| \
+ RADEON_CP_VC_FRMT_ST1)
+#define TAG(x) x##_rgba_spec_st_st
+#include "radeon_maos_vbtmp.h"
+
+#define IDX 8
+#define IND (RADEON_CP_VC_FRMT_XY| \
+ RADEON_CP_VC_FRMT_Z| \
+ RADEON_CP_VC_FRMT_ST0| \
+ RADEON_CP_VC_FRMT_ST1| \
+ RADEON_CP_VC_FRMT_N0)
+#define TAG(x) x##_st_st_n
+#include "radeon_maos_vbtmp.h"
+
+#define IDX 9
+#define IND (RADEON_CP_VC_FRMT_XY| \
+ RADEON_CP_VC_FRMT_Z| \
+ RADEON_CP_VC_FRMT_PKCOLOR| \
+ RADEON_CP_VC_FRMT_PKSPEC| \
+ RADEON_CP_VC_FRMT_ST0| \
+ RADEON_CP_VC_FRMT_ST1| \
+ RADEON_CP_VC_FRMT_N0)
+#define TAG(x) x##_rgpa_spec_st_st_n
+#include "radeon_maos_vbtmp.h"
+
+#define IDX 10
+#define IND (RADEON_CP_VC_FRMT_XY| \
+ RADEON_CP_VC_FRMT_Z| \
+ RADEON_CP_VC_FRMT_PKCOLOR| \
+ RADEON_CP_VC_FRMT_ST0| \
+ RADEON_CP_VC_FRMT_Q0)
+#define TAG(x) x##_rgba_stq
+#include "radeon_maos_vbtmp.h"
+
+#define IDX 11
+#define IND (RADEON_CP_VC_FRMT_XY| \
+ RADEON_CP_VC_FRMT_Z| \
+ RADEON_CP_VC_FRMT_PKCOLOR| \
+ RADEON_CP_VC_FRMT_ST1| \
+ RADEON_CP_VC_FRMT_Q1| \
+ RADEON_CP_VC_FRMT_ST0| \
+ RADEON_CP_VC_FRMT_Q0)
+#define TAG(x) x##_rgba_stq_stq
+#include "radeon_maos_vbtmp.h"
+
+#define IDX 12
+#define IND (RADEON_CP_VC_FRMT_XY| \
+ RADEON_CP_VC_FRMT_Z| \
+ RADEON_CP_VC_FRMT_W0| \
+ RADEON_CP_VC_FRMT_PKCOLOR| \
+ RADEON_CP_VC_FRMT_PKSPEC| \
+ RADEON_CP_VC_FRMT_ST0| \
+ RADEON_CP_VC_FRMT_Q0| \
+ RADEON_CP_VC_FRMT_ST1| \
+ RADEON_CP_VC_FRMT_Q1| \
+ RADEON_CP_VC_FRMT_N0)
+#define TAG(x) x##_w_rgpa_spec_stq_stq_n
+#include "radeon_maos_vbtmp.h"
+
+
+
+
+
+/***********************************************************************
+ * Initialization
+ ***********************************************************************/
+
+
+static void init_tcl_verts( void )
+{
+ init_rgba();
+ init_n();
+ init_rgba_n();
+ init_rgba_st();
+ init_st_n();
+ init_rgba_st_st();
+ init_rgba_st_n();
+ init_rgba_spec_st_st();
+ init_st_st_n();
+ init_rgpa_spec_st_st_n();
+ init_rgba_stq();
+ init_rgba_stq_stq();
+ init_w_rgpa_spec_stq_stq_n();
+}
+
+
+void radeonEmitArrays( GLcontext *ctx, GLuint inputs )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
+ GLuint req = 0;
+ GLuint vtx = (rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &
+ ~(RADEON_TCL_VTX_Q0|RADEON_TCL_VTX_Q1));
+ int i;
+ static int firsttime = 1;
+
+ if (firsttime) {
+ init_tcl_verts();
+ firsttime = 0;
+ }
+
+ if (1) {
+ req |= RADEON_CP_VC_FRMT_Z;
+ if (VB->ObjPtr->size == 4) {
+ req |= RADEON_CP_VC_FRMT_W0;
+ }
+ }
+
+ if (inputs & VERT_BIT_NORMAL) {
+ req |= RADEON_CP_VC_FRMT_N0;
+ }
+
+ if (inputs & VERT_BIT_COLOR0) {
+ req |= RADEON_CP_VC_FRMT_PKCOLOR;
+ }
+
+ if (inputs & VERT_BIT_COLOR1) {
+ req |= RADEON_CP_VC_FRMT_PKSPEC;
+ }
+
+ if (inputs & VERT_BIT_TEX0) {
+ req |= RADEON_CP_VC_FRMT_ST0;
+
+ if (VB->TexCoordPtr[0]->size == 4) {
+ req |= RADEON_CP_VC_FRMT_Q0;
+ vtx |= RADEON_TCL_VTX_Q0;
+ }
+ }
+
+ if (inputs & VERT_BIT_TEX1) {
+ req |= RADEON_CP_VC_FRMT_ST1;
+
+ if (VB->TexCoordPtr[1]->size == 4) {
+ req |= RADEON_CP_VC_FRMT_Q1;
+ vtx |= RADEON_TCL_VTX_Q1;
+ }
+ }
+
+ if (vtx != rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT]) {
+ RADEON_STATECHANGE( rmesa, tcl );
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] = vtx;
+ }
+
+ for (i = 0 ; i < RADEON_TCL_MAX_SETUP ; i++)
+ if ((setup_tab[i].vertex_format & req) == req)
+ break;
+
+ if (rmesa->tcl.vertex_format == setup_tab[i].vertex_format &&
+ rmesa->tcl.indexed_verts.buf)
+ return;
+
+ if (rmesa->tcl.indexed_verts.buf)
+ radeonReleaseArrays( ctx, ~0 );
+
+ radeonAllocDmaRegionVerts( rmesa,
+ &rmesa->tcl.indexed_verts,
+ VB->Count,
+ setup_tab[i].vertex_size * 4,
+ 4);
+
+ setup_tab[i].emit( ctx, 0, VB->Count,
+ rmesa->tcl.indexed_verts.address +
+ rmesa->tcl.indexed_verts.start );
+
+ rmesa->tcl.vertex_format = setup_tab[i].vertex_format;
+ rmesa->tcl.indexed_verts.aos_start = GET_START( &rmesa->tcl.indexed_verts );
+ rmesa->tcl.indexed_verts.aos_size = setup_tab[i].vertex_size;
+ rmesa->tcl.indexed_verts.aos_stride = setup_tab[i].vertex_size;
+
+ rmesa->tcl.aos_components[0] = &rmesa->tcl.indexed_verts;
+ rmesa->tcl.nr_aos_components = 1;
+}
+
+
+
+void radeonReleaseArrays( GLcontext *ctx, GLuint newinputs )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
+
+ if (RADEON_DEBUG & DEBUG_VERTS)
+ _tnl_print_vert_flags( __FUNCTION__, newinputs );
+
+ if (newinputs)
+ radeonReleaseDmaRegion( rmesa, &rmesa->tcl.indexed_verts, __FUNCTION__ );
+}
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_sanity.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_sanity.c
new file mode 100644
index 000000000..e5b97d2c9
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_sanity.c
@@ -0,0 +1,981 @@
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright 2002 ATI Technologies Inc., Ontario, Canada, and
+ Tungsten Graphics Inc, Cedar Park, TX.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ *
+ */
+
+#include "glheader.h"
+
+#include "radeon_context.h"
+#include "radeon_ioctl.h"
+#include "radeon_sanity.h"
+
+/* Set this '1' to get more verbiage.
+ */
+#define MORE_VERBOSE 1
+
+#if MORE_VERBOSE
+#define VERBOSE (RADEON_DEBUG & DEBUG_VERBOSE)
+#define NORMAL (1)
+#else
+#define VERBOSE 0
+#define NORMAL (RADEON_DEBUG & DEBUG_VERBOSE)
+#endif
+
+
+/* New (1.3) state mechanism. 3 commands (packet, scalar, vector) in
+ * 1.3 cmdbuffers allow all previous state to be updated as well as
+ * the tcl scalar and vector areas.
+ */
+static struct {
+ int start;
+ int len;
+ const char *name;
+} packet[RADEON_MAX_STATE_PACKETS] = {
+ { RADEON_PP_MISC,7,"RADEON_PP_MISC" },
+ { RADEON_PP_CNTL,3,"RADEON_PP_CNTL" },
+ { RADEON_RB3D_COLORPITCH,1,"RADEON_RB3D_COLORPITCH" },
+ { RADEON_RE_LINE_PATTERN,2,"RADEON_RE_LINE_PATTERN" },
+ { RADEON_SE_LINE_WIDTH,1,"RADEON_SE_LINE_WIDTH" },
+ { RADEON_PP_LUM_MATRIX,1,"RADEON_PP_LUM_MATRIX" },
+ { RADEON_PP_ROT_MATRIX_0,2,"RADEON_PP_ROT_MATRIX_0" },
+ { RADEON_RB3D_STENCILREFMASK,3,"RADEON_RB3D_STENCILREFMASK" },
+ { RADEON_SE_VPORT_XSCALE,6,"RADEON_SE_VPORT_XSCALE" },
+ { RADEON_SE_CNTL,2,"RADEON_SE_CNTL" },
+ { RADEON_SE_CNTL_STATUS,1,"RADEON_SE_CNTL_STATUS" },
+ { RADEON_RE_MISC,1,"RADEON_RE_MISC" },
+ { RADEON_PP_TXFILTER_0,6,"RADEON_PP_TXFILTER_0" },
+ { RADEON_PP_BORDER_COLOR_0,1,"RADEON_PP_BORDER_COLOR_0" },
+ { RADEON_PP_TXFILTER_1,6,"RADEON_PP_TXFILTER_1" },
+ { RADEON_PP_BORDER_COLOR_1,1,"RADEON_PP_BORDER_COLOR_1" },
+ { RADEON_PP_TXFILTER_2,6,"RADEON_PP_TXFILTER_2" },
+ { RADEON_PP_BORDER_COLOR_2,1,"RADEON_PP_BORDER_COLOR_2" },
+ { RADEON_SE_ZBIAS_FACTOR,2,"RADEON_SE_ZBIAS_FACTOR" },
+ { RADEON_SE_TCL_OUTPUT_VTX_FMT,11,"RADEON_SE_TCL_OUTPUT_VTX_FMT" },
+ { RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED,17,"RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED" },
+};
+
+struct reg_names {
+ int idx;
+ const char *name;
+};
+
+static struct reg_names reg_names[] = {
+ { RADEON_PP_MISC, "RADEON_PP_MISC" },
+ { RADEON_PP_FOG_COLOR, "RADEON_PP_FOG_COLOR" },
+ { RADEON_RE_SOLID_COLOR, "RADEON_RE_SOLID_COLOR" },
+ { RADEON_RB3D_BLENDCNTL, "RADEON_RB3D_BLENDCNTL" },
+ { RADEON_RB3D_DEPTHOFFSET, "RADEON_RB3D_DEPTHOFFSET" },
+ { RADEON_RB3D_DEPTHPITCH, "RADEON_RB3D_DEPTHPITCH" },
+ { RADEON_RB3D_ZSTENCILCNTL, "RADEON_RB3D_ZSTENCILCNTL" },
+ { RADEON_PP_CNTL, "RADEON_PP_CNTL" },
+ { RADEON_RB3D_CNTL, "RADEON_RB3D_CNTL" },
+ { RADEON_RB3D_COLOROFFSET, "RADEON_RB3D_COLOROFFSET" },
+ { RADEON_RB3D_COLORPITCH, "RADEON_RB3D_COLORPITCH" },
+ { RADEON_SE_CNTL, "RADEON_SE_CNTL" },
+ { RADEON_SE_COORD_FMT, "RADEON_SE_COORDFMT" },
+ { RADEON_SE_CNTL_STATUS, "RADEON_SE_CNTL_STATUS" },
+ { RADEON_RE_LINE_PATTERN, "RADEON_RE_LINE_PATTERN" },
+ { RADEON_RE_LINE_STATE, "RADEON_RE_LINE_STATE" },
+ { RADEON_SE_LINE_WIDTH, "RADEON_SE_LINE_WIDTH" },
+ { RADEON_RB3D_STENCILREFMASK, "RADEON_RB3D_STENCILREFMASK" },
+ { RADEON_RB3D_ROPCNTL, "RADEON_RB3D_ROPCNTL" },
+ { RADEON_RB3D_PLANEMASK, "RADEON_RB3D_PLANEMASK" },
+ { RADEON_SE_VPORT_XSCALE, "RADEON_SE_VPORT_XSCALE" },
+ { RADEON_SE_VPORT_XOFFSET, "RADEON_SE_VPORT_XOFFSET" },
+ { RADEON_SE_VPORT_YSCALE, "RADEON_SE_VPORT_YSCALE" },
+ { RADEON_SE_VPORT_YOFFSET, "RADEON_SE_VPORT_YOFFSET" },
+ { RADEON_SE_VPORT_ZSCALE, "RADEON_SE_VPORT_ZSCALE" },
+ { RADEON_SE_VPORT_ZOFFSET, "RADEON_SE_VPORT_ZOFFSET" },
+ { RADEON_RE_MISC, "RADEON_RE_MISC" },
+ { RADEON_PP_TXFILTER_0, "RADEON_PP_TXFILTER_0" },
+ { RADEON_PP_TXFILTER_1, "RADEON_PP_TXFILTER_1" },
+ { RADEON_PP_TXFILTER_2, "RADEON_PP_TXFILTER_2" },
+ { RADEON_PP_TXFORMAT_0, "RADEON_PP_TXFORMAT_0" },
+ { RADEON_PP_TXFORMAT_1, "RADEON_PP_TXFORMAT_1" },
+ { RADEON_PP_TXFORMAT_2, "RADEON_PP_TXFORMAT_3" },
+ { RADEON_PP_TXOFFSET_0, "RADEON_PP_TXOFFSET_0" },
+ { RADEON_PP_TXOFFSET_1, "RADEON_PP_TXOFFSET_1" },
+ { RADEON_PP_TXOFFSET_2, "RADEON_PP_TXOFFSET_3" },
+ { RADEON_PP_TXCBLEND_0, "RADEON_PP_TXCBLEND_0" },
+ { RADEON_PP_TXCBLEND_1, "RADEON_PP_TXCBLEND_1" },
+ { RADEON_PP_TXCBLEND_2, "RADEON_PP_TXCBLEND_3" },
+ { RADEON_PP_TXABLEND_0, "RADEON_PP_TXABLEND_0" },
+ { RADEON_PP_TXABLEND_1, "RADEON_PP_TXABLEND_1" },
+ { RADEON_PP_TXABLEND_2, "RADEON_PP_TXABLEND_3" },
+ { RADEON_PP_TFACTOR_0, "RADEON_PP_TFACTOR_0" },
+ { RADEON_PP_TFACTOR_1, "RADEON_PP_TFACTOR_1" },
+ { RADEON_PP_TFACTOR_2, "RADEON_PP_TFACTOR_3" },
+ { RADEON_PP_BORDER_COLOR_0, "RADEON_PP_BORDER_COLOR_0" },
+ { RADEON_PP_BORDER_COLOR_1, "RADEON_PP_BORDER_COLOR_1" },
+ { RADEON_PP_BORDER_COLOR_2, "RADEON_PP_BORDER_COLOR_3" },
+ { RADEON_SE_ZBIAS_FACTOR, "RADEON_SE_ZBIAS_FACTOR" },
+ { RADEON_SE_ZBIAS_CONSTANT, "RADEON_SE_ZBIAS_CONSTANT" },
+ { RADEON_SE_TCL_OUTPUT_VTX_FMT, "RADEON_SE_TCL_OUTPUT_VTXFMT" },
+ { RADEON_SE_TCL_OUTPUT_VTX_SEL, "RADEON_SE_TCL_OUTPUT_VTXSEL" },
+ { RADEON_SE_TCL_MATRIX_SELECT_0, "RADEON_SE_TCL_MATRIX_SELECT_0" },
+ { RADEON_SE_TCL_MATRIX_SELECT_1, "RADEON_SE_TCL_MATRIX_SELECT_1" },
+ { RADEON_SE_TCL_UCP_VERT_BLEND_CTL, "RADEON_SE_TCL_UCP_VERT_BLEND_CTL" },
+ { RADEON_SE_TCL_TEXTURE_PROC_CTL, "RADEON_SE_TCL_TEXTURE_PROC_CTL" },
+ { RADEON_SE_TCL_LIGHT_MODEL_CTL, "RADEON_SE_TCL_LIGHT_MODEL_CTL" },
+ { RADEON_SE_TCL_PER_LIGHT_CTL_0, "RADEON_SE_TCL_PER_LIGHT_CTL_0" },
+ { RADEON_SE_TCL_PER_LIGHT_CTL_1, "RADEON_SE_TCL_PER_LIGHT_CTL_1" },
+ { RADEON_SE_TCL_PER_LIGHT_CTL_2, "RADEON_SE_TCL_PER_LIGHT_CTL_2" },
+ { RADEON_SE_TCL_PER_LIGHT_CTL_3, "RADEON_SE_TCL_PER_LIGHT_CTL_3" },
+ { RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED, "RADEON_SE_TCL_EMMISSIVE_RED" },
+ { RADEON_SE_TCL_MATERIAL_EMMISSIVE_GREEN, "RADEON_SE_TCL_EMMISSIVE_GREEN" },
+ { RADEON_SE_TCL_MATERIAL_EMMISSIVE_BLUE, "RADEON_SE_TCL_EMMISSIVE_BLUE" },
+ { RADEON_SE_TCL_MATERIAL_EMMISSIVE_ALPHA, "RADEON_SE_TCL_EMMISSIVE_ALPHA" },
+ { RADEON_SE_TCL_MATERIAL_AMBIENT_RED, "RADEON_SE_TCL_AMBIENT_RED" },
+ { RADEON_SE_TCL_MATERIAL_AMBIENT_GREEN, "RADEON_SE_TCL_AMBIENT_GREEN" },
+ { RADEON_SE_TCL_MATERIAL_AMBIENT_BLUE, "RADEON_SE_TCL_AMBIENT_BLUE" },
+ { RADEON_SE_TCL_MATERIAL_AMBIENT_ALPHA, "RADEON_SE_TCL_AMBIENT_ALPHA" },
+ { RADEON_SE_TCL_MATERIAL_DIFFUSE_RED, "RADEON_SE_TCL_DIFFUSE_RED" },
+ { RADEON_SE_TCL_MATERIAL_DIFFUSE_GREEN, "RADEON_SE_TCL_DIFFUSE_GREEN" },
+ { RADEON_SE_TCL_MATERIAL_DIFFUSE_BLUE, "RADEON_SE_TCL_DIFFUSE_BLUE" },
+ { RADEON_SE_TCL_MATERIAL_DIFFUSE_ALPHA, "RADEON_SE_TCL_DIFFUSE_ALPHA" },
+ { RADEON_SE_TCL_MATERIAL_SPECULAR_RED, "RADEON_SE_TCL_SPECULAR_RED" },
+ { RADEON_SE_TCL_MATERIAL_SPECULAR_GREEN, "RADEON_SE_TCL_SPECULAR_GREEN" },
+ { RADEON_SE_TCL_MATERIAL_SPECULAR_BLUE, "RADEON_SE_TCL_SPECULAR_BLUE" },
+ { RADEON_SE_TCL_MATERIAL_SPECULAR_ALPHA, "RADEON_SE_TCL_SPECULAR_ALPHA" },
+ { RADEON_SE_TCL_SHININESS, "RADEON_SE_TCL_SHININESS" },
+ { RADEON_SE_COORD_FMT, "RADEON_SE_COORD_FMT" }
+};
+
+static struct reg_names scalar_names[] = {
+ { RADEON_SS_LIGHT_DCD_ADDR, "LIGHT_DCD" },
+ { RADEON_SS_LIGHT_SPOT_EXPONENT_ADDR, "LIGHT_SPOT_EXPONENT" },
+ { RADEON_SS_LIGHT_SPOT_CUTOFF_ADDR, "LIGHT_SPOT_CUTOFF" },
+ { RADEON_SS_LIGHT_SPECULAR_THRESH_ADDR, "LIGHT_SPECULAR_THRESH" },
+ { RADEON_SS_LIGHT_RANGE_CUTOFF_ADDR, "LIGHT_RANGE_CUTOFF" },
+ { RADEON_SS_VERT_GUARD_CLIP_ADJ_ADDR, "VERT_GUARD_CLIP" },
+ { RADEON_SS_VERT_GUARD_DISCARD_ADJ_ADDR, "VERT_GUARD_DISCARD" },
+ { RADEON_SS_HORZ_GUARD_CLIP_ADJ_ADDR, "HORZ_GUARD_CLIP" },
+ { RADEON_SS_HORZ_GUARD_DISCARD_ADJ_ADDR, "HORZ_GUARD_DISCARD" },
+ { RADEON_SS_SHININESS, "SHININESS" },
+ { 1000, "" },
+};
+
+/* Puff these out to make them look like normal (dword) registers.
+ */
+static struct reg_names vector_names[] = {
+ { RADEON_VS_MATRIX_0_ADDR * 4, "MATRIX_0" },
+ { RADEON_VS_MATRIX_1_ADDR * 4, "MATRIX_1" },
+ { RADEON_VS_MATRIX_2_ADDR * 4, "MATRIX_2" },
+ { RADEON_VS_MATRIX_3_ADDR * 4, "MATRIX_3" },
+ { RADEON_VS_MATRIX_4_ADDR * 4, "MATRIX_4" },
+ { RADEON_VS_MATRIX_5_ADDR * 4, "MATRIX_5" },
+ { RADEON_VS_MATRIX_6_ADDR * 4, "MATRIX_6" },
+ { RADEON_VS_MATRIX_7_ADDR * 4, "MATRIX_7" },
+ { RADEON_VS_MATRIX_8_ADDR * 4, "MATRIX_8" },
+ { RADEON_VS_MATRIX_9_ADDR * 4, "MATRIX_9" },
+ { RADEON_VS_MATRIX_10_ADDR * 4, "MATRIX_10" },
+ { RADEON_VS_MATRIX_11_ADDR * 4, "MATRIX_11" },
+ { RADEON_VS_MATRIX_12_ADDR * 4, "MATRIX_12" },
+ { RADEON_VS_MATRIX_13_ADDR * 4, "MATRIX_13" },
+ { RADEON_VS_MATRIX_14_ADDR * 4, "MATRIX_14" },
+ { RADEON_VS_MATRIX_15_ADDR * 4, "MATRIX_15" },
+ { RADEON_VS_LIGHT_AMBIENT_ADDR * 4, "LIGHT_AMBIENT" },
+ { RADEON_VS_LIGHT_DIFFUSE_ADDR * 4, "LIGHT_DIFFUSE" },
+ { RADEON_VS_LIGHT_SPECULAR_ADDR * 4, "LIGHT_SPECULAR" },
+ { RADEON_VS_LIGHT_DIRPOS_ADDR * 4, "LIGHT_DIRPOS" },
+ { RADEON_VS_LIGHT_HWVSPOT_ADDR * 4, "LIGHT_HWVSPOT" },
+ { RADEON_VS_LIGHT_ATTENUATION_ADDR * 4, "LIGHT_ATTENUATION" },
+ { RADEON_VS_MATRIX_EYE2CLIP_ADDR * 4, "MATRIX_EYE2CLIP" },
+ { RADEON_VS_UCP_ADDR * 4, "UCP" },
+ { RADEON_VS_GLOBAL_AMBIENT_ADDR * 4, "GLOBAL_AMBIENT" },
+ { RADEON_VS_FOG_PARAM_ADDR * 4, "FOG_PARAM" },
+ { RADEON_VS_EYE_VECTOR_ADDR * 4, "EYE_VECTOR" },
+ { 1000, "" },
+};
+
+union fi { float f; int i; };
+
+#define ISVEC 1
+#define ISFLOAT 2
+#define TOUCHED 4
+
+struct reg {
+ int idx;
+ struct reg_names *closest;
+ int flags;
+ union fi current;
+ union fi *values;
+ int nvalues;
+ int nalloc;
+ float vmin, vmax;
+};
+
+
+static struct reg regs[Elements(reg_names)+1];
+static struct reg scalars[512+1];
+static struct reg vectors[512*4+1];
+
+static int total, total_changed, bufs;
+
+static void init_regs( void )
+{
+ struct reg_names *tmp;
+ int i;
+
+ for (i = 0 ; i < Elements(regs) ; i++) {
+ regs[i].idx = reg_names[i].idx;
+ regs[i].closest = &reg_names[i];
+ regs[i].flags = 0;
+ }
+
+ for (i = 0, tmp = scalar_names ; i < Elements(scalars) ; i++) {
+ if (tmp[1].idx == i) tmp++;
+ scalars[i].idx = i;
+ scalars[i].closest = tmp;
+ scalars[i].flags = ISFLOAT;
+ }
+
+ for (i = 0, tmp = vector_names ; i < Elements(vectors) ; i++) {
+ if (tmp[1].idx*4 == i) tmp++;
+ vectors[i].idx = i;
+ vectors[i].closest = tmp;
+ vectors[i].flags = ISFLOAT|ISVEC;
+ }
+
+ regs[Elements(regs)-1].idx = -1;
+ scalars[Elements(scalars)-1].idx = -1;
+ vectors[Elements(vectors)-1].idx = -1;
+}
+
+static int find_or_add_value( struct reg *reg, int val )
+{
+ int j;
+
+ for ( j = 0 ; j < reg->nvalues ; j++)
+ if ( val == reg->values[j].i )
+ return 1;
+
+ if (j == reg->nalloc) {
+ reg->nalloc += 5;
+ reg->nalloc *= 2;
+ reg->values = (union fi *) realloc( reg->values,
+ reg->nalloc * sizeof(union fi) );
+ }
+
+ reg->values[reg->nvalues++].i = val;
+ return 0;
+}
+
+static struct reg *lookup_reg( struct reg *tab, int reg )
+{
+ int i;
+
+ for (i = 0 ; tab[i].idx != -1 ; i++) {
+ if (tab[i].idx == reg)
+ return &tab[i];
+ }
+
+ fprintf(stderr, "*** unknown reg 0x%x\n", reg);
+ return 0;
+}
+
+
+static const char *get_reg_name( struct reg *reg )
+{
+ static char tmp[80];
+
+ if (reg->idx == reg->closest->idx)
+ return reg->closest->name;
+
+
+ if (reg->flags & ISVEC) {
+ if (reg->idx/4 != reg->closest->idx)
+ sprintf(tmp, "%s+%d[%d]",
+ reg->closest->name,
+ (reg->idx/4) - reg->closest->idx,
+ reg->idx%4);
+ else
+ sprintf(tmp, "%s[%d]", reg->closest->name, reg->idx%4);
+ }
+ else {
+ if (reg->idx != reg->closest->idx)
+ sprintf(tmp, "%s+%d", reg->closest->name, reg->idx - reg->closest->idx);
+ else
+ sprintf(tmp, "%s", reg->closest->name);
+ }
+
+ return tmp;
+}
+
+static int print_int_reg_assignment( struct reg *reg, int data )
+{
+ int changed = (reg->current.i != data);
+ int ever_seen = find_or_add_value( reg, data );
+
+ if (VERBOSE || (NORMAL && (changed || !ever_seen)))
+ fprintf(stderr, " %s <-- 0x%x", get_reg_name(reg), data);
+
+ if (NORMAL) {
+ if (!ever_seen)
+ fprintf(stderr, " *** BRAND NEW VALUE");
+ else if (changed)
+ fprintf(stderr, " *** CHANGED");
+ }
+
+ reg->current.i = data;
+
+ if (VERBOSE || (NORMAL && (changed || !ever_seen)))
+ fprintf(stderr, "\n");
+
+ return changed;
+}
+
+
+static int print_float_reg_assignment( struct reg *reg, float data )
+{
+ int changed = (reg->current.f != data);
+ int newmin = (data < reg->vmin);
+ int newmax = (data > reg->vmax);
+
+ if (VERBOSE || (NORMAL && (newmin || newmax || changed)))
+ fprintf(stderr, " %s <-- %.3f", get_reg_name(reg), data);
+
+ if (NORMAL) {
+ if (newmin) {
+ fprintf(stderr, " *** NEW MIN (prev %.3f)", reg->vmin);
+ reg->vmin = data;
+ }
+ else if (newmax) {
+ fprintf(stderr, " *** NEW MAX (prev %.3f)", reg->vmax);
+ reg->vmax = data;
+ }
+ else if (changed) {
+ fprintf(stderr, " *** CHANGED");
+ }
+ }
+
+ reg->current.f = data;
+
+ if (VERBOSE || (NORMAL && (newmin || newmax || changed)))
+ fprintf(stderr, "\n");
+
+ return changed;
+}
+
+static int print_reg_assignment( struct reg *reg, int data )
+{
+ reg->flags |= TOUCHED;
+ if (reg->flags & ISFLOAT)
+ return print_float_reg_assignment( reg, *(float *)&data );
+ else
+ return print_int_reg_assignment( reg, data );
+}
+
+static void print_reg( struct reg *reg )
+{
+ if (reg->flags & TOUCHED) {
+ if (reg->flags & ISFLOAT) {
+ fprintf(stderr, " %s == %f\n", get_reg_name(reg), reg->current.f);
+ } else {
+ fprintf(stderr, " %s == 0x%x\n", get_reg_name(reg), reg->current.i);
+ }
+ }
+}
+
+
+static void dump_state( void )
+{
+ int i;
+
+ for (i = 0 ; i < Elements(regs) ; i++)
+ print_reg( &regs[i] );
+
+ for (i = 0 ; i < Elements(scalars) ; i++)
+ print_reg( &scalars[i] );
+
+ for (i = 0 ; i < Elements(vectors) ; i++)
+ print_reg( &vectors[i] );
+}
+
+
+
+static int radeon_emit_packets(
+ drmRadeonCmdHeader header,
+ drmRadeonCmdBuffer *cmdbuf )
+{
+ int id = (int)header.packet.packet_id;
+ int sz = packet[id].len;
+ int *data = (int *)cmdbuf->buf;
+ int i;
+
+ if (sz * sizeof(int) > cmdbuf->bufsz) {
+ fprintf(stderr, "Packet overflows cmdbuf\n");
+ return -EINVAL;
+ }
+
+ if (!packet[id].name) {
+ fprintf(stderr, "*** Unknown packet 0 nr %d\n", id );
+ return -EINVAL;
+ }
+
+
+ if (VERBOSE)
+ fprintf(stderr, "Packet 0 reg %s nr %d\n", packet[id].name, sz );
+
+ for ( i = 0 ; i < sz ; i++) {
+ struct reg *reg = lookup_reg( regs, packet[id].start + i*4 );
+ if (print_reg_assignment( reg, data[i] ))
+ total_changed++;
+ total++;
+ }
+
+ cmdbuf->buf += sz * sizeof(int);
+ cmdbuf->bufsz -= sz * sizeof(int);
+ return 0;
+}
+
+
+static int radeon_emit_scalars(
+ drmRadeonCmdHeader header,
+ drmRadeonCmdBuffer *cmdbuf )
+{
+ int sz = header.scalars.count;
+ int *data = (int *)cmdbuf->buf;
+ int start = header.scalars.offset;
+ int stride = header.scalars.stride;
+ int i;
+
+ if (VERBOSE)
+ fprintf(stderr, "emit scalars, start %d stride %d nr %d (end %d)\n",
+ start, stride, sz, start + stride * sz);
+
+
+ for (i = 0 ; i < sz ; i++, start += stride) {
+ struct reg *reg = lookup_reg( scalars, start );
+ if (print_reg_assignment( reg, data[i] ))
+ total_changed++;
+ total++;
+ }
+
+ cmdbuf->buf += sz * sizeof(int);
+ cmdbuf->bufsz -= sz * sizeof(int);
+ return 0;
+}
+
+
+static int radeon_emit_scalars2(
+ drmRadeonCmdHeader header,
+ drmRadeonCmdBuffer *cmdbuf )
+{
+ int sz = header.scalars.count;
+ int *data = (int *)cmdbuf->buf;
+ int start = header.scalars.offset + 0x100;
+ int stride = header.scalars.stride;
+ int i;
+
+ if (VERBOSE)
+ fprintf(stderr, "emit scalars2, start %d stride %d nr %d (end %d)\n",
+ start, stride, sz, start + stride * sz);
+
+ if (start + stride * sz > 257) {
+ fprintf(stderr, "emit scalars OVERFLOW %d/%d/%d\n", start, stride, sz);
+ return -1;
+ }
+
+ for (i = 0 ; i < sz ; i++, start += stride) {
+ struct reg *reg = lookup_reg( scalars, start );
+ if (print_reg_assignment( reg, data[i] ))
+ total_changed++;
+ total++;
+ }
+
+ cmdbuf->buf += sz * sizeof(int);
+ cmdbuf->bufsz -= sz * sizeof(int);
+ return 0;
+}
+
+/* Check: inf/nan/extreme-size?
+ * Check: table start, end, nr, etc.
+ */
+static int radeon_emit_vectors(
+ drmRadeonCmdHeader header,
+ drmRadeonCmdBuffer *cmdbuf )
+{
+ int sz = header.vectors.count;
+ int *data = (int *)cmdbuf->buf;
+ int start = header.vectors.offset;
+ int stride = header.vectors.stride;
+ int i,j;
+
+ if (VERBOSE)
+ fprintf(stderr, "emit vectors, start %d stride %d nr %d (end %d) (0x%x)\n",
+ start, stride, sz, start + stride * sz, header.i);
+
+/* if (start + stride * (sz/4) > 128) { */
+/* fprintf(stderr, "emit vectors OVERFLOW %d/%d/%d\n", start, stride, sz); */
+/* return -1; */
+/* } */
+
+ for (i = 0 ; i < sz ; start += stride) {
+ int changed = 0;
+ for (j = 0 ; j < 4 ; i++,j++) {
+ struct reg *reg = lookup_reg( vectors, start*4+j );
+ if (print_reg_assignment( reg, data[i] ))
+ changed = 1;
+ }
+ if (changed)
+ total_changed += 4;
+ total += 4;
+ }
+
+
+ cmdbuf->buf += sz * sizeof(int);
+ cmdbuf->bufsz -= sz * sizeof(int);
+ return 0;
+}
+
+
+static int print_vertex_format( int vfmt )
+{
+ if (NORMAL) {
+ fprintf(stderr, " %s(%x): %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
+ "vertex format",
+ vfmt,
+ "xy,",
+ (vfmt & RADEON_CP_VC_FRMT_Z) ? "z," : "",
+ (vfmt & RADEON_CP_VC_FRMT_W0) ? "w0," : "",
+ (vfmt & RADEON_CP_VC_FRMT_FPCOLOR) ? "fpcolor," : "",
+ (vfmt & RADEON_CP_VC_FRMT_FPALPHA) ? "fpalpha," : "",
+ (vfmt & RADEON_CP_VC_FRMT_PKCOLOR) ? "pkcolor," : "",
+ (vfmt & RADEON_CP_VC_FRMT_FPSPEC) ? "fpspec," : "",
+ (vfmt & RADEON_CP_VC_FRMT_FPFOG) ? "fpfog," : "",
+ (vfmt & RADEON_CP_VC_FRMT_PKSPEC) ? "pkspec," : "",
+ (vfmt & RADEON_CP_VC_FRMT_ST0) ? "st0," : "",
+ (vfmt & RADEON_CP_VC_FRMT_ST1) ? "st1," : "",
+ (vfmt & RADEON_CP_VC_FRMT_Q1) ? "q1," : "",
+ (vfmt & RADEON_CP_VC_FRMT_ST2) ? "st2," : "",
+ (vfmt & RADEON_CP_VC_FRMT_Q2) ? "q2," : "",
+ (vfmt & RADEON_CP_VC_FRMT_ST3) ? "st3," : "",
+ (vfmt & RADEON_CP_VC_FRMT_Q3) ? "q3," : "",
+ (vfmt & RADEON_CP_VC_FRMT_Q0) ? "q0," : "",
+ (vfmt & RADEON_CP_VC_FRMT_N0) ? "n0," : "",
+ (vfmt & RADEON_CP_VC_FRMT_XY1) ? "xy1," : "",
+ (vfmt & RADEON_CP_VC_FRMT_Z1) ? "z1," : "",
+ (vfmt & RADEON_CP_VC_FRMT_W1) ? "w1," : "",
+ (vfmt & RADEON_CP_VC_FRMT_N1) ? "n1," : "");
+
+
+/* if (!find_or_add_value( &others[V_VTXFMT], vfmt )) */
+/* fprintf(stderr, " *** NEW VALUE"); */
+
+ fprintf(stderr, "\n");
+ }
+
+ return 0;
+}
+
+static char *primname[0xf] = {
+ "NONE",
+ "POINT",
+ "LINE",
+ "LINE_STRIP",
+ "TRI_LIST",
+ "TRI_FAN",
+ "TRI_STRIP",
+ "TRI_TYPE_2",
+ "RECT_LIST",
+ "3VRT_POINT_LIST",
+ "3VRT_LINE_LIST",
+};
+
+static int print_prim_and_flags( int prim )
+{
+ int numverts;
+
+ if (NORMAL)
+ fprintf(stderr, " %s(%x): %s%s%s%s%s%s%s\n",
+ "prim flags",
+ prim,
+ ((prim & 0x30) == RADEON_CP_VC_CNTL_PRIM_WALK_IND) ? "IND," : "",
+ ((prim & 0x30) == RADEON_CP_VC_CNTL_PRIM_WALK_LIST) ? "LIST," : "",
+ ((prim & 0x30) == RADEON_CP_VC_CNTL_PRIM_WALK_RING) ? "RING," : "",
+ (prim & RADEON_CP_VC_CNTL_COLOR_ORDER_RGBA) ? "RGBA," : "BGRA, ",
+ (prim & RADEON_CP_VC_CNTL_MAOS_ENABLE) ? "MAOS," : "",
+ (prim & RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE) ? "RADEON," : "",
+ (prim & RADEON_CP_VC_CNTL_TCL_ENABLE) ? "TCL," : "");
+
+ if ((prim & 0xf) > RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_LINE_LIST) {
+ fprintf(stderr, " *** Bad primitive: %x\n", prim & 0xf);
+ return -1;
+ }
+
+ numverts = prim>>16;
+
+ if (NORMAL)
+ fprintf(stderr, " prim: %s numverts %d\n", primname[prim&0xf], numverts);
+
+ switch (prim & 0xf) {
+ case RADEON_CP_VC_CNTL_PRIM_TYPE_NONE:
+ case RADEON_CP_VC_CNTL_PRIM_TYPE_POINT:
+ if (numverts < 1) {
+ fprintf(stderr, "Bad nr verts for line %d\n", numverts);
+ return -1;
+ }
+ break;
+ case RADEON_CP_VC_CNTL_PRIM_TYPE_LINE:
+ if ((numverts & 1) || numverts == 0) {
+ fprintf(stderr, "Bad nr verts for line %d\n", numverts);
+ return -1;
+ }
+ break;
+ case RADEON_CP_VC_CNTL_PRIM_TYPE_LINE_STRIP:
+ if (numverts < 2) {
+ fprintf(stderr, "Bad nr verts for line_strip %d\n", numverts);
+ return -1;
+ }
+ break;
+ case RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST:
+ case RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_POINT_LIST:
+ case RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_LINE_LIST:
+ case RADEON_CP_VC_CNTL_PRIM_TYPE_RECT_LIST:
+ if (numverts % 3 || numverts == 0) {
+ fprintf(stderr, "Bad nr verts for tri %d\n", numverts);
+ return -1;
+ }
+ break;
+ case RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_FAN:
+ case RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_STRIP:
+ if (numverts < 3) {
+ fprintf(stderr, "Bad nr verts for strip/fan %d\n", numverts);
+ return -1;
+ }
+ break;
+ default:
+ fprintf(stderr, "Bad primitive\n");
+ return -1;
+ }
+ return 0;
+}
+
+/* build in knowledge about each packet type
+ */
+static int radeon_emit_packet3( drmRadeonCmdBuffer *cmdbuf )
+{
+ int cmdsz;
+ int *cmd = (int *)cmdbuf->buf;
+ int *tmp;
+ int i, stride, size, start;
+
+ cmdsz = 2 + ((cmd[0] & RADEON_CP_PACKET_COUNT_MASK) >> 16);
+
+ if ((cmd[0] & RADEON_CP_PACKET_MASK) != RADEON_CP_PACKET3 ||
+ cmdsz * 4 > cmdbuf->bufsz ||
+ cmdsz > RADEON_CP_PACKET_MAX_DWORDS) {
+ fprintf(stderr, "Bad packet\n");
+ return -EINVAL;
+ }
+
+ switch( cmd[0] & ~RADEON_CP_PACKET_COUNT_MASK ) {
+ case RADEON_CP_PACKET3_NOP:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_NOP, %d dwords\n", cmdsz);
+ break;
+ case RADEON_CP_PACKET3_NEXT_CHAR:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_NEXT_CHAR, %d dwords\n", cmdsz);
+ break;
+ case RADEON_CP_PACKET3_PLY_NEXTSCAN:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_PLY_NEXTSCAN, %d dwords\n", cmdsz);
+ break;
+ case RADEON_CP_PACKET3_SET_SCISSORS:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_SET_SCISSORS, %d dwords\n", cmdsz);
+ break;
+ case RADEON_CP_PACKET3_3D_RNDR_GEN_INDX_PRIM:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_3D_RNDR_GEN_INDX_PRIM, %d dwords\n",
+ cmdsz);
+ break;
+ case RADEON_CP_PACKET3_LOAD_MICROCODE:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_LOAD_MICROCODE, %d dwords\n", cmdsz);
+ break;
+ case RADEON_CP_PACKET3_WAIT_FOR_IDLE:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_WAIT_FOR_IDLE, %d dwords\n", cmdsz);
+ break;
+
+ case RADEON_CP_PACKET3_3D_DRAW_VBUF:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_3D_DRAW_VBUF, %d dwords\n", cmdsz);
+ print_vertex_format(cmd[1]);
+ print_prim_and_flags(cmd[2]);
+ break;
+
+ case RADEON_CP_PACKET3_3D_DRAW_IMMD:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_3D_DRAW_IMMD, %d dwords\n", cmdsz);
+ break;
+ case RADEON_CP_PACKET3_3D_DRAW_INDX: {
+ int neltdwords;
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_3D_DRAW_INDX, %d dwords\n", cmdsz);
+ print_vertex_format(cmd[1]);
+ print_prim_and_flags(cmd[2]);
+ neltdwords = cmd[2]>>16;
+ neltdwords += neltdwords & 1;
+ neltdwords /= 2;
+ if (neltdwords + 3 != cmdsz)
+ fprintf(stderr, "Mismatch in DRAW_INDX, %d vs cmdsz %d\n",
+ neltdwords, cmdsz);
+ break;
+ }
+ case RADEON_CP_PACKET3_LOAD_PALETTE:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_LOAD_PALETTE, %d dwords\n", cmdsz);
+ break;
+ case RADEON_CP_PACKET3_3D_LOAD_VBPNTR:
+ if (NORMAL) {
+ fprintf(stderr, "PACKET3_3D_LOAD_VBPNTR, %d dwords\n", cmdsz);
+ fprintf(stderr, " nr arrays: %d\n", cmd[1]);
+ }
+
+ if (cmd[1]/2 + cmd[1]%2 != cmdsz - 3) {
+ fprintf(stderr, " ****** MISMATCH %d/%d *******\n",
+ cmd[1]/2 + cmd[1]%2 + 3, cmdsz);
+ return -EINVAL;
+ }
+
+ if (NORMAL) {
+ tmp = cmd+2;
+ for (i = 0 ; i < cmd[1] ; i++) {
+ if (i & 1) {
+ stride = (tmp[0]>>24) & 0xff;
+ size = (tmp[0]>>16) & 0xff;
+ start = tmp[2];
+ tmp += 3;
+ }
+ else {
+ stride = (tmp[0]>>8) & 0xff;
+ size = (tmp[0]) & 0xff;
+ start = tmp[1];
+ }
+ fprintf(stderr, " array %d: start 0x%x vsize %d vstride %d\n",
+ i, start, size, stride );
+ }
+ }
+ break;
+ case RADEON_CP_PACKET3_CNTL_PAINT:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_CNTL_PAINT, %d dwords\n", cmdsz);
+ break;
+ case RADEON_CP_PACKET3_CNTL_BITBLT:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_CNTL_BITBLT, %d dwords\n", cmdsz);
+ break;
+ case RADEON_CP_PACKET3_CNTL_SMALLTEXT:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_CNTL_SMALLTEXT, %d dwords\n", cmdsz);
+ break;
+ case RADEON_CP_PACKET3_CNTL_HOSTDATA_BLT:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_CNTL_HOSTDATA_BLT, %d dwords\n",
+ cmdsz);
+ break;
+ case RADEON_CP_PACKET3_CNTL_POLYLINE:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_CNTL_POLYLINE, %d dwords\n", cmdsz);
+ break;
+ case RADEON_CP_PACKET3_CNTL_POLYSCANLINES:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_CNTL_POLYSCANLINES, %d dwords\n",
+ cmdsz);
+ break;
+ case RADEON_CP_PACKET3_CNTL_PAINT_MULTI:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_CNTL_PAINT_MULTI, %d dwords\n",
+ cmdsz);
+ break;
+ case RADEON_CP_PACKET3_CNTL_BITBLT_MULTI:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_CNTL_BITBLT_MULTI, %d dwords\n",
+ cmdsz);
+ break;
+ case RADEON_CP_PACKET3_CNTL_TRANS_BITBLT:
+ if (NORMAL)
+ fprintf(stderr, "PACKET3_CNTL_TRANS_BITBLT, %d dwords\n",
+ cmdsz);
+ break;
+ default:
+ fprintf(stderr, "UNKNOWN PACKET, %d dwords\n", cmdsz);
+ break;
+ }
+
+ cmdbuf->buf += cmdsz * 4;
+ cmdbuf->bufsz -= cmdsz * 4;
+ return 0;
+}
+
+
+/* Check cliprects for bounds, then pass on to above:
+ */
+static int radeon_emit_packet3_cliprect( drmRadeonCmdBuffer *cmdbuf )
+{
+ XF86DRIClipRectRec *boxes = (XF86DRIClipRectRec *)cmdbuf->boxes;
+ int i = 0;
+
+ if (VERBOSE && total_changed) {
+ dump_state();
+ total_changed = 0;
+ }
+ else fprintf(stderr, "total_changed zero\n");
+
+ if (NORMAL) {
+ do {
+ if ( i < cmdbuf->nbox ) {
+ fprintf(stderr, "Emit box %d/%d %d,%d %d,%d\n",
+ i, cmdbuf->nbox,
+ boxes[i].x1, boxes[i].y1, boxes[i].x2, boxes[i].y2);
+ }
+ } while ( ++i < cmdbuf->nbox );
+ }
+
+ if (cmdbuf->nbox == 1)
+ cmdbuf->nbox = 0;
+
+ return radeon_emit_packet3( cmdbuf );
+}
+
+
+int radeonSanityCmdBuffer( radeonContextPtr rmesa,
+ int nbox,
+ XF86DRIClipRectRec *boxes )
+{
+ int idx;
+ drmRadeonCmdBuffer cmdbuf;
+ drmRadeonCmdHeader header;
+ static int inited = 0;
+
+ if (!inited) {
+ init_regs();
+ inited = 1;
+ }
+
+ cmdbuf.buf = rmesa->store.cmd_buf;
+ cmdbuf.bufsz = rmesa->store.cmd_used;
+ cmdbuf.boxes = (drmClipRect *)boxes;
+ cmdbuf.nbox = nbox;
+
+ while ( cmdbuf.bufsz >= sizeof(header) ) {
+
+ header.i = *(int *)cmdbuf.buf;
+ cmdbuf.buf += sizeof(header);
+ cmdbuf.bufsz -= sizeof(header);
+
+ switch (header.header.cmd_type) {
+ case RADEON_CMD_PACKET:
+ if (radeon_emit_packets( header, &cmdbuf )) {
+ fprintf(stderr,"radeon_emit_packets failed\n");
+ return -EINVAL;
+ }
+ break;
+
+ case RADEON_CMD_SCALARS:
+ if (radeon_emit_scalars( header, &cmdbuf )) {
+ fprintf(stderr,"radeon_emit_scalars failed\n");
+ return -EINVAL;
+ }
+ break;
+
+ case RADEON_CMD_SCALARS2:
+ if (radeon_emit_scalars2( header, &cmdbuf )) {
+ fprintf(stderr,"radeon_emit_scalars failed\n");
+ return -EINVAL;
+ }
+ break;
+
+ case RADEON_CMD_VECTORS:
+ if (radeon_emit_vectors( header, &cmdbuf )) {
+ fprintf(stderr,"radeon_emit_vectors failed\n");
+ return -EINVAL;
+ }
+ break;
+
+ case RADEON_CMD_DMA_DISCARD:
+ idx = header.dma.buf_idx;
+ if (NORMAL)
+ fprintf(stderr, "RADEON_CMD_DMA_DISCARD buf %d\n", idx);
+ bufs++;
+ break;
+
+ case RADEON_CMD_PACKET3:
+ if (radeon_emit_packet3( &cmdbuf )) {
+ fprintf(stderr,"radeon_emit_packet3 failed\n");
+ return -EINVAL;
+ }
+ break;
+
+ case RADEON_CMD_PACKET3_CLIP:
+ if (radeon_emit_packet3_cliprect( &cmdbuf )) {
+ fprintf(stderr,"radeon_emit_packet3_clip failed\n");
+ return -EINVAL;
+ }
+ break;
+
+ case RADEON_CMD_WAIT:
+ break;
+
+ default:
+ fprintf(stderr,"bad cmd_type %d at %p\n",
+ header.header.cmd_type,
+ cmdbuf.buf - sizeof(header));
+ return -EINVAL;
+ }
+ }
+
+ if (0)
+ {
+ static int n = 0;
+ n++;
+ if (n == 10) {
+ fprintf(stderr, "Bufs %d Total emitted %d real changes %d (%.2f%%)\n",
+ bufs,
+ total, total_changed,
+ ((float)total_changed/(float)total*100.0));
+ fprintf(stderr, "Total emitted per buf: %.2f\n",
+ (float)total/(float)bufs);
+ fprintf(stderr, "Real changes per buf: %.2f\n",
+ (float)total_changed/(float)bufs);
+
+ bufs = n = total = total_changed = 0;
+ }
+ }
+
+ return 0;
+}
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c
index 443cdfc3a..7172603a7 100644
--- a/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c
@@ -34,11 +34,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
+#include "glheader.h"
+#include "imports.h"
+
#include "radeon_screen.h"
-#include "radeon_context.h"
-#include "radeon_ioctl.h"
-#include "mem.h"
#if 1
/* Including xf86PciInfo.h introduces a bunch of errors...
@@ -47,6 +47,16 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define PCI_CHIP_RADEON_QE 0x5145
#define PCI_CHIP_RADEON_QF 0x5146
#define PCI_CHIP_RADEON_QG 0x5147
+
+#define PCI_CHIP_RADEON_QY 0x5159
+#define PCI_CHIP_RADEON_QZ 0x515A
+
+#define PCI_CHIP_RADEON_LW 0x4C57 /* mobility 7 - has tcl */
+
+#define PCI_CHIP_RADEON_LY 0x4C59
+#define PCI_CHIP_RADEON_LZ 0x4C5A
+
+#define PCI_CHIP_RV200_QW 0x5157 /* a confusing name for a radeon */
#endif
@@ -57,43 +67,89 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv )
radeonScreenPtr radeonScreen;
RADEONDRIPtr radeonDRIPriv = (RADEONDRIPtr)sPriv->pDevPriv;
- /* Check the DRI version */
- {
- int major, minor, patch;
- if ( XF86DRIQueryVersion( sPriv->display, &major, &minor, &patch ) ) {
- if ( major != 4 || minor < 0 ) {
- __driUtilMessage( "Radeon DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch );
- return NULL;
- }
- }
+ /* Check the DRI extension version */
+ if ( sPriv->driMajor != 4 || sPriv->driMinor < 0 ) {
+ __driUtilMessage( "Radeon DRI driver expected DRI version 4.0.x "
+ "but got version %d.%d.%d",
+ sPriv->driMajor, sPriv->driMinor, sPriv->driPatch );
+ return NULL;
}
/* Check that the DDX driver version is compatible */
if ( sPriv->ddxMajor != 4 ||
sPriv->ddxMinor < 0 ) {
- __driUtilMessage( "Radeon DRI driver expected DDX driver version 4.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch );
+ __driUtilMessage( "Radeon DRI driver expected DDX driver version 4.0.x "
+ "but got version %d.%d.%d",
+ sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch );
return NULL;
}
/* Check that the DRM driver version is compatible */
+ /* KW: Check minor number here too -- compatibility mode is broken
+ * atm.
+ */
if ( sPriv->drmMajor != 1 ||
- sPriv->drmMinor < 2 ) {
- __driUtilMessage( "Radeon DRI driver expected DRM driver version 1.2.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch );
+ sPriv->drmMinor < 3) {
+ __driUtilMessage( "Radeon DRI driver expected DRM driver version 1.3.x "
+ "or newer but got version %d.%d.%d",
+ sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch );
return NULL;
}
+
/* Allocate the private area */
radeonScreen = (radeonScreenPtr) CALLOC( sizeof(*radeonScreen) );
if ( !radeonScreen ) {
- __driUtilMessage("radeonCreateScreen(): CALLOC radeonScreen struct failed");
+ __driUtilMessage("%s: CALLOC radeonScreen struct failed",
+ __FUNCTION__);
return NULL;
}
+ if ( sPriv->drmMinor < 3 ||
+ getenv("RADEON_COMPAT")) {
+ fprintf( stderr, "Radeon DRI driver:\n\t"
+ "Compatibility mode for DRM driver version %d.%d.%d\n\t"
+ "TCL will be disabled, expect reduced performance\n\t"
+ "(prefer DRM radeon.o 1.3.x or newer)\n\t",
+ sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch );
+ }
+
+
/* This is first since which regions we map depends on whether or
* not we are using a PCI card.
*/
radeonScreen->IsPCI = radeonDRIPriv->IsPCI;
+ if (sPriv->drmMinor >= 3) {
+ int ret;
+ drmRadeonGetParam gp;
+
+ gp.param = RADEON_PARAM_AGP_BUFFER_OFFSET;
+ gp.value = &radeonScreen->agp_buffer_offset;
+
+ ret = drmCommandWriteRead( sPriv->fd, DRM_RADEON_GETPARAM,
+ &gp, sizeof(gp));
+ if (ret) {
+ FREE( radeonScreen );
+ fprintf(stderr, "drmRadeonGetParam (RADEON_PARAM_AGP_BUFFER_OFFSET): %d\n", ret);
+ return NULL;
+ }
+
+ if (sPriv->drmMinor >= 6) {
+ gp.param = RADEON_PARAM_IRQ_NR;
+ gp.value = &radeonScreen->irq;
+
+ ret = drmCommandWriteRead( sPriv->fd, DRM_RADEON_GETPARAM,
+ &gp, sizeof(gp));
+ if (ret) {
+ FREE( radeonScreen );
+ fprintf(stderr, "drmRadeonGetParam (RADEON_PARAM_IRQ_NR): %d\n", ret);
+ return NULL;
+ }
+ }
+
+ }
+
radeonScreen->mmio.handle = radeonDRIPriv->registerHandle;
radeonScreen->mmio.size = radeonDRIPriv->registerSize;
if ( drmMap( sPriv->fd,
@@ -144,16 +200,21 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv )
}
}
-
+ radeonScreen->chipset = 0;
switch ( radeonDRIPriv->deviceID ) {
+ default:
+ fprintf(stderr, "unknown chip id, assuming full radeon support\n");
case PCI_CHIP_RADEON_QD:
case PCI_CHIP_RADEON_QE:
case PCI_CHIP_RADEON_QF:
case PCI_CHIP_RADEON_QG:
- radeonScreen->chipset = RADEON_CARD_TYPE_RADEON;
- break;
- default:
- radeonScreen->chipset = RADEON_CARD_TYPE_RADEON;
+ case PCI_CHIP_RV200_QW:
+ case PCI_CHIP_RADEON_LW:
+ radeonScreen->chipset |= RADEON_CHIPSET_TCL;
+ case PCI_CHIP_RADEON_QY:
+ case PCI_CHIP_RADEON_QZ:
+ case PCI_CHIP_RADEON_LY:
+ case PCI_CHIP_RADEON_LZ:
break;
}
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.h b/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.h
index b5f11bcad..ba477685b 100644
--- a/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.h
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.h
@@ -39,24 +39,33 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifdef GLX_DIRECT_RENDERING
-#include <X11/Xlibint.h>
+/*
+ * IMPORTS: these headers contain all the DRI, X and kernel-related
+ * definitions that we need.
+ */
#include "dri_util.h"
-#include "xf86drm.h"
-#include "xf86drmRadeon.h"
+#include "radeon_common.h"
+#include "radeon_dri.h"
+#include "radeon_reg.h"
#include "radeon_sarea.h"
+
typedef struct {
drmHandle handle; /* Handle to the DRM region */
drmSize size; /* Size of the DRM region */
drmAddress map; /* Mapping of the DRM region */
} radeonRegionRec, *radeonRegionPtr;
+/* chipset features */
+#define RADEON_CHIPSET_TCL (1 << 0)
+
typedef struct {
int chipset;
int cpp;
int IsPCI; /* Current card is a PCI card */
int AGPMode;
+ unsigned int irq; /* IRQ number (0 means none) */
unsigned int frontOffset;
unsigned int frontPitch;
@@ -82,6 +91,7 @@ typedef struct {
__DRIscreenPrivate *driScreen;
unsigned int sarea_priv_offset;
+ unsigned int agp_buffer_offset; /* offset in card memory space */
} radeonScreenRec, *radeonScreenPtr;
extern radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv );
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_span.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_span.c
index 41a2668df..cce2fdf4c 100644
--- a/xc/lib/GL/mesa/src/drv/radeon/radeon_span.c
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_span.c
@@ -31,18 +31,19 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* Authors:
* Kevin E. Martin <martin@valinux.com>
* Gareth Hughes <gareth@valinux.com>
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*
*/
+#include "glheader.h"
+#include "swrast/swrast.h"
+
#include "radeon_context.h"
#include "radeon_ioctl.h"
#include "radeon_state.h"
#include "radeon_span.h"
#include "radeon_tex.h"
-#include "swrast/swrast.h"
-
#define DBG 0
#define LOCAL_VARS \
@@ -284,20 +285,43 @@ do { \
#include "stenciltmp.h"
-static void radeonSetReadBuffer( GLcontext *ctx,
- GLframebuffer *colorBuffer,
- GLenum mode )
+/*
+ * This function is called to specify which buffer to read and write
+ * for software rasterization (swrast) fallbacks. This doesn't necessarily
+ * correspond to glDrawBuffer() or glReadBuffer() calls.
+ */
+static void radeonSetBuffer( GLcontext *ctx,
+ GLframebuffer *colorBuffer,
+ GLuint bufferBit )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- switch ( mode ) {
- case GL_FRONT_LEFT:
- rmesa->state.pixel.readOffset = rmesa->radeonScreen->frontOffset;
- rmesa->state.pixel.readPitch = rmesa->radeonScreen->frontPitch;
+ switch ( bufferBit ) {
+ case FRONT_LEFT_BIT:
+ if ( rmesa->sarea->pfCurrentPage == 1 ) {
+ rmesa->state.pixel.readOffset = rmesa->radeonScreen->backOffset;
+ rmesa->state.pixel.readPitch = rmesa->radeonScreen->backPitch;
+ rmesa->state.color.drawOffset = rmesa->radeonScreen->backOffset;
+ rmesa->state.color.drawPitch = rmesa->radeonScreen->backPitch;
+ } else {
+ rmesa->state.pixel.readOffset = rmesa->radeonScreen->frontOffset;
+ rmesa->state.pixel.readPitch = rmesa->radeonScreen->frontPitch;
+ rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset;
+ rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch;
+ }
break;
- case GL_BACK_LEFT:
- rmesa->state.pixel.readOffset = rmesa->radeonScreen->backOffset;
- rmesa->state.pixel.readPitch = rmesa->radeonScreen->backPitch;
+ case BACK_LEFT_BIT:
+ if ( rmesa->sarea->pfCurrentPage == 1 ) {
+ rmesa->state.pixel.readOffset = rmesa->radeonScreen->frontOffset;
+ rmesa->state.pixel.readPitch = rmesa->radeonScreen->frontPitch;
+ rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset;
+ rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch;
+ } else {
+ rmesa->state.pixel.readOffset = rmesa->radeonScreen->backOffset;
+ rmesa->state.pixel.readPitch = rmesa->radeonScreen->backPitch;
+ rmesa->state.color.drawOffset = rmesa->radeonScreen->backOffset;
+ rmesa->state.color.drawPitch = rmesa->radeonScreen->backPitch;
+ }
break;
default:
assert(0);
@@ -330,7 +354,7 @@ void radeonInitSpanFuncs( GLcontext *ctx )
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
- swdd->SetReadBuffer = radeonSetReadBuffer;
+ swdd->SetBuffer = radeonSetBuffer;
switch ( rmesa->radeonScreen->cpp ) {
case 2:
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_state.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_state.c
index 9077ee43f..5c46fc902 100644
--- a/xc/lib/GL/mesa/src/drv/radeon/radeon_state.c
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_state.c
@@ -25,16 +25,12 @@
*
* Authors:
* Gareth Hughes <gareth@valinux.com>
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
-#include "radeon_context.h"
-#include "radeon_state.h"
-#include "radeon_ioctl.h"
-#include "radeon_tris.h"
-#include "radeon_vb.h"
-#include "radeon_tex.h"
-
+#include "glheader.h"
+#include "imports.h"
+#include "api_arrayelt.h"
#include "mmath.h"
#include "enums.h"
#include "colormac.h"
@@ -46,62 +42,83 @@
#include "swrast_setup/swrast_setup.h"
+#include "radeon_context.h"
+#include "radeon_ioctl.h"
+#include "radeon_state.h"
+#include "radeon_tcl.h"
+#include "radeon_tex.h"
+#include "radeon_swtcl.h"
+#include "radeon_vtxfmt.h"
+
+
+#define MODEL_PROJ 0
+#define MODEL 1
+#define MODEL_IT 2
+#define TEXMAT_0 3
+#define TEXMAT_1 4
+#define TEXMAT_2 5
+
+
/* =============================================================
* Alpha blending
*/
-static void radeonAlphaFunc( GLcontext *ctx, GLenum func, GLchan ref )
+static void radeonAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ int pp_misc = rmesa->hw.ctx.cmd[CTX_PP_MISC];
+ GLubyte refByte;
+
+ CLAMPED_FLOAT_TO_UBYTE(refByte, ref);
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT );
+ RADEON_STATECHANGE( rmesa, ctx );
- rmesa->state.hw.context.pp_misc &= ~(RADEON_ALPHA_TEST_OP_MASK |
- RADEON_REF_ALPHA_MASK);
+ pp_misc &= ~(RADEON_ALPHA_TEST_OP_MASK | RADEON_REF_ALPHA_MASK);
+ pp_misc |= (refByte & RADEON_REF_ALPHA_MASK);
switch ( func ) {
case GL_NEVER:
- rmesa->state.hw.context.pp_misc |= RADEON_ALPHA_TEST_FAIL;
+ pp_misc |= RADEON_ALPHA_TEST_FAIL;
break;
case GL_LESS:
- rmesa->state.hw.context.pp_misc |= RADEON_ALPHA_TEST_LESS;
+ pp_misc |= RADEON_ALPHA_TEST_LESS;
break;
case GL_EQUAL:
- rmesa->state.hw.context.pp_misc |= RADEON_ALPHA_TEST_EQUAL;
+ pp_misc |= RADEON_ALPHA_TEST_EQUAL;
break;
case GL_LEQUAL:
- rmesa->state.hw.context.pp_misc |= RADEON_ALPHA_TEST_LEQUAL;
+ pp_misc |= RADEON_ALPHA_TEST_LEQUAL;
break;
case GL_GREATER:
- rmesa->state.hw.context.pp_misc |= RADEON_ALPHA_TEST_GREATER;
+ pp_misc |= RADEON_ALPHA_TEST_GREATER;
break;
case GL_NOTEQUAL:
- rmesa->state.hw.context.pp_misc |= RADEON_ALPHA_TEST_NEQUAL;
+ pp_misc |= RADEON_ALPHA_TEST_NEQUAL;
break;
case GL_GEQUAL:
- rmesa->state.hw.context.pp_misc |= RADEON_ALPHA_TEST_GEQUAL;
+ pp_misc |= RADEON_ALPHA_TEST_GEQUAL;
break;
case GL_ALWAYS:
- rmesa->state.hw.context.pp_misc |= RADEON_ALPHA_TEST_PASS;
+ pp_misc |= RADEON_ALPHA_TEST_PASS;
break;
}
- rmesa->state.hw.context.pp_misc |= (ref & RADEON_REF_ALPHA_MASK);
+ rmesa->hw.ctx.cmd[CTX_PP_MISC] = pp_misc;
}
static void radeonBlendEquation( GLcontext *ctx, GLenum mode )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint b = rmesa->state.hw.context.rb3d_blendcntl & ~RADEON_COMB_FCN_MASK;
+ GLuint b = rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] & ~RADEON_COMB_FCN_MASK;
GLboolean fallback = GL_FALSE;
switch ( mode ) {
- case GL_FUNC_ADD_EXT:
+ case GL_FUNC_ADD:
case GL_LOGIC_OP:
b |= RADEON_COMB_FCN_ADD_CLAMP;
break;
- case GL_FUNC_SUBTRACT_EXT:
+ case GL_FUNC_SUBTRACT:
b |= RADEON_COMB_FCN_SUB_CLAMP;
break;
@@ -112,12 +129,12 @@ static void radeonBlendEquation( GLcontext *ctx, GLenum mode )
FALLBACK( rmesa, RADEON_FALLBACK_BLEND_EQ, fallback );
if ( !fallback ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT );
- rmesa->state.hw.context.rb3d_blendcntl = b;
+ RADEON_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] = b;
if ( ctx->Color.ColorLogicOpEnabled ) {
- rmesa->state.hw.context.rb3d_cntl |= RADEON_ROP_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_ROP_ENABLE;
} else {
- rmesa->state.hw.context.rb3d_cntl &= ~RADEON_ROP_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_ROP_ENABLE;
}
}
}
@@ -125,8 +142,8 @@ static void radeonBlendEquation( GLcontext *ctx, GLenum mode )
static void radeonBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint b = rmesa->state.hw.context.rb3d_blendcntl & ~(RADEON_SRC_BLEND_MASK |
- RADEON_DST_BLEND_MASK);
+ GLuint b = rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] &
+ ~(RADEON_SRC_BLEND_MASK | RADEON_DST_BLEND_MASK);
GLboolean fallback = GL_FALSE;
switch ( ctx->Color.BlendSrcRGB ) {
@@ -142,6 +159,12 @@ static void radeonBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
case GL_ONE_MINUS_DST_COLOR:
b |= RADEON_SRC_BLEND_GL_ONE_MINUS_DST_COLOR;
break;
+ case GL_SRC_COLOR:
+ b |= RADEON_SRC_BLEND_GL_SRC_COLOR;
+ break;
+ case GL_ONE_MINUS_SRC_COLOR:
+ b |= RADEON_SRC_BLEND_GL_ONE_MINUS_SRC_COLOR;
+ break;
case GL_SRC_ALPHA:
b |= RADEON_SRC_BLEND_GL_SRC_ALPHA;
break;
@@ -184,6 +207,12 @@ static void radeonBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
case GL_ONE_MINUS_SRC_ALPHA:
b |= RADEON_DST_BLEND_GL_ONE_MINUS_SRC_ALPHA;
break;
+ case GL_DST_COLOR:
+ b |= RADEON_DST_BLEND_GL_DST_COLOR;
+ break;
+ case GL_ONE_MINUS_DST_COLOR:
+ b |= RADEON_DST_BLEND_GL_ONE_MINUS_DST_COLOR;
+ break;
case GL_DST_ALPHA:
b |= RADEON_DST_BLEND_GL_DST_ALPHA;
break;
@@ -200,8 +229,8 @@ static void radeonBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
FALLBACK( rmesa, RADEON_FALLBACK_BLEND_FUNC, fallback );
if ( !fallback ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT );
- rmesa->state.hw.context.rb3d_blendcntl = b;
+ RADEON_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] = b;
}
}
@@ -221,33 +250,33 @@ static void radeonDepthFunc( GLcontext *ctx, GLenum func )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT );
- rmesa->state.hw.context.rb3d_zstencilcntl &= ~RADEON_Z_TEST_MASK;
+ RADEON_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &= ~RADEON_Z_TEST_MASK;
switch ( ctx->Depth.Func ) {
case GL_NEVER:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_Z_TEST_NEVER;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_TEST_NEVER;
break;
case GL_LESS:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_Z_TEST_LESS;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_TEST_LESS;
break;
case GL_EQUAL:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_Z_TEST_EQUAL;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_TEST_EQUAL;
break;
case GL_LEQUAL:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_Z_TEST_LEQUAL;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_TEST_LEQUAL;
break;
case GL_GREATER:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_Z_TEST_GREATER;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_TEST_GREATER;
break;
case GL_NOTEQUAL:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_Z_TEST_NEQUAL;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_TEST_NEQUAL;
break;
case GL_GEQUAL:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_Z_TEST_GEQUAL;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_TEST_GEQUAL;
break;
case GL_ALWAYS:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_Z_TEST_ALWAYS;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_TEST_ALWAYS;
break;
}
}
@@ -256,19 +285,19 @@ static void radeonDepthFunc( GLcontext *ctx, GLenum func )
static void radeonDepthMask( GLcontext *ctx, GLboolean flag )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT );
+ RADEON_STATECHANGE( rmesa, ctx );
if ( ctx->Depth.Mask ) {
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_Z_WRITE_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_WRITE_ENABLE;
} else {
- rmesa->state.hw.context.rb3d_zstencilcntl &= ~RADEON_Z_WRITE_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &= ~RADEON_Z_WRITE_ENABLE;
}
}
static void radeonClearDepth( GLcontext *ctx, GLclampd d )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint format = (rmesa->state.hw.context.rb3d_zstencilcntl &
+ GLuint format = (rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &
RADEON_DEPTH_FORMAT_MASK);
switch ( format ) {
@@ -286,22 +315,156 @@ static void radeonClearDepth( GLcontext *ctx, GLclampd d )
* Fog
*/
+
static void radeonFogfv( GLcontext *ctx, GLenum pname, const GLfloat *param )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLchan c[4];
+ union { int i; float f; } c, d;
+ GLchan col[4];
+
+ c.i = rmesa->hw.fog.cmd[FOG_C];
+ d.i = rmesa->hw.fog.cmd[FOG_D];
+
+ switch (pname) {
+ case GL_FOG_MODE:
+ if (!ctx->Fog.Enabled)
+ return;
+ RADEON_STATECHANGE(rmesa, tcl);
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~RADEON_TCL_FOG_MASK;
+ switch (ctx->Fog.Mode) {
+ case GL_LINEAR:
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_TCL_FOG_LINEAR;
+ if (ctx->Fog.Start == ctx->Fog.End) {
+ c.f = 1.0F;
+ d.f = 1.0F;
+ }
+ else {
+ c.f = ctx->Fog.End/(ctx->Fog.End-ctx->Fog.Start);
+ d.f = 1.0/(ctx->Fog.End-ctx->Fog.Start);
+ }
+ break;
+ case GL_EXP:
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_TCL_FOG_EXP;
+ c.f = 0.0;
+ d.f = ctx->Fog.Density;
+ break;
+ case GL_EXP2:
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_TCL_FOG_EXP2;
+ c.f = 0.0;
+ d.f = -(ctx->Fog.Density * ctx->Fog.Density);
+ break;
+ default:
+ return;
+ }
+ break;
+ case GL_FOG_DENSITY:
+ switch (ctx->Fog.Mode) {
+ case GL_EXP:
+ c.f = 0.0;
+ d.f = ctx->Fog.Density;
+ break;
+ case GL_EXP2:
+ c.f = 0.0;
+ d.f = -(ctx->Fog.Density * ctx->Fog.Density);
+ break;
+ default:
+ break;
+ }
+ break;
+ case GL_FOG_START:
+ case GL_FOG_END:
+ if (ctx->Fog.Mode == GL_LINEAR) {
+ if (ctx->Fog.Start == ctx->Fog.End) {
+ c.f = 1.0F;
+ d.f = 1.0F;
+ } else {
+ c.f = ctx->Fog.End/(ctx->Fog.End-ctx->Fog.Start);
+ d.f = 1.0/(ctx->Fog.End-ctx->Fog.Start);
+ }
+ }
+ break;
+ case GL_FOG_COLOR:
+ RADEON_STATECHANGE( rmesa, ctx );
+ UNCLAMPED_FLOAT_TO_RGB_CHAN( col, ctx->Fog.Color );
+ rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] =
+ radeonPackColor( 4, col[0], col[1], col[2], 0 );
+ break;
+ case GL_FOG_COORDINATE_SOURCE_EXT:
+ /* What to do?
+ */
+ break;
+ default:
+ return;
+ }
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT );
- UNCLAMPED_FLOAT_TO_RGB_CHAN( c, ctx->Fog.Color );
- rmesa->state.hw.context.pp_fog_color =
- radeonPackColor( 4, c[0], c[1], c[2], 0 );
+ if (c.i != rmesa->hw.fog.cmd[FOG_C] || d.i != rmesa->hw.fog.cmd[FOG_D]) {
+ RADEON_STATECHANGE( rmesa, fog );
+ rmesa->hw.fog.cmd[FOG_C] = c.i;
+ rmesa->hw.fog.cmd[FOG_D] = d.i;
+ }
}
/* =============================================================
- * Clipping
+ * Scissoring
*/
+
+static GLboolean intersect_rect( XF86DRIClipRectPtr out,
+ XF86DRIClipRectPtr a,
+ XF86DRIClipRectPtr b )
+{
+ *out = *a;
+ if ( b->x1 > out->x1 ) out->x1 = b->x1;
+ if ( b->y1 > out->y1 ) out->y1 = b->y1;
+ if ( b->x2 < out->x2 ) out->x2 = b->x2;
+ if ( b->y2 < out->y2 ) out->y2 = b->y2;
+ if ( out->x1 >= out->x2 ) return GL_FALSE;
+ if ( out->y1 >= out->y2 ) return GL_FALSE;
+ return GL_TRUE;
+}
+
+
+void radeonRecalcScissorRects( radeonContextPtr rmesa )
+{
+ XF86DRIClipRectPtr out;
+ int i;
+
+ /* Grow cliprect store?
+ */
+ if (rmesa->state.scissor.numAllocedClipRects < rmesa->numClipRects) {
+ while (rmesa->state.scissor.numAllocedClipRects < rmesa->numClipRects) {
+ rmesa->state.scissor.numAllocedClipRects += 1; /* zero case */
+ rmesa->state.scissor.numAllocedClipRects *= 2;
+ }
+
+ if (rmesa->state.scissor.pClipRects)
+ FREE(rmesa->state.scissor.pClipRects);
+
+ rmesa->state.scissor.pClipRects =
+ MALLOC( rmesa->state.scissor.numAllocedClipRects *
+ sizeof(XF86DRIClipRectRec) );
+
+ if ( rmesa->state.scissor.pClipRects == NULL ) {
+ rmesa->state.scissor.numAllocedClipRects = 0;
+ return;
+ }
+ }
+
+ out = rmesa->state.scissor.pClipRects;
+ rmesa->state.scissor.numClipRects = 0;
+
+ for ( i = 0 ; i < rmesa->numClipRects ; i++ ) {
+ if ( intersect_rect( out,
+ &rmesa->pClipRects[i],
+ &rmesa->state.scissor.rect ) ) {
+ rmesa->state.scissor.numClipRects++;
+ out++;
+ }
+ }
+}
+
+
static void radeonUpdateScissor( GLcontext *ctx )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
@@ -319,8 +482,7 @@ static void radeonUpdateScissor( GLcontext *ctx )
rmesa->state.scissor.rect.x2 = w + dPriv->x + 1;
rmesa->state.scissor.rect.y2 = h + dPriv->y + 1;
- if ( ctx->Scissor.Enabled )
- rmesa->upload_cliprects = 1;
+ radeonRecalcScissorRects( rmesa );
}
}
@@ -330,10 +492,11 @@ static void radeonScissor( GLcontext *ctx,
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- if ( ctx->Scissor.Enabled )
+ if ( ctx->Scissor.Enabled ) {
RADEON_FIREVERTICES( rmesa ); /* don't pipeline cliprect changes */
+ radeonUpdateScissor( ctx );
+ }
- radeonUpdateScissor( ctx );
}
@@ -344,27 +507,37 @@ static void radeonScissor( GLcontext *ctx,
static void radeonCullFace( GLcontext *ctx, GLenum unused )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint s = rmesa->state.hw.setup1.se_cntl;
+ GLuint s = rmesa->hw.set.cmd[SET_SE_CNTL];
+ GLuint t = rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL];
s |= RADEON_FFACE_SOLID | RADEON_BFACE_SOLID;
+ t &= ~(RADEON_CULL_FRONT | RADEON_CULL_BACK);
if ( ctx->Polygon.CullFlag ) {
switch ( ctx->Polygon.CullFaceMode ) {
case GL_FRONT:
s &= ~RADEON_FFACE_SOLID;
+ t |= RADEON_CULL_FRONT;
break;
case GL_BACK:
s &= ~RADEON_BFACE_SOLID;
+ t |= RADEON_CULL_BACK;
break;
case GL_FRONT_AND_BACK:
s &= ~(RADEON_FFACE_SOLID | RADEON_BFACE_SOLID);
+ t |= (RADEON_CULL_FRONT | RADEON_CULL_BACK);
break;
}
}
- if ( rmesa->state.hw.setup1.se_cntl != s ) {
- RADEON_STATECHANGE(rmesa, RADEON_UPLOAD_SETUP);
- rmesa->state.hw.setup1.se_cntl = s;
+ if ( rmesa->hw.set.cmd[SET_SE_CNTL] != s ) {
+ RADEON_STATECHANGE(rmesa, set );
+ rmesa->hw.set.cmd[SET_SE_CNTL] = s;
+ }
+
+ if ( rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] != t ) {
+ RADEON_STATECHANGE(rmesa, tcl );
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] = t;
}
}
@@ -372,15 +545,19 @@ static void radeonFrontFace( GLcontext *ctx, GLenum mode )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_SETUP );
- rmesa->state.hw.setup1.se_cntl &= ~RADEON_FFACE_CULL_DIR_MASK;
+ RADEON_STATECHANGE( rmesa, set );
+ rmesa->hw.set.cmd[SET_SE_CNTL] &= ~RADEON_FFACE_CULL_DIR_MASK;
+
+ RADEON_STATECHANGE( rmesa, tcl );
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~RADEON_CULL_FRONT_IS_CCW;
switch ( mode ) {
case GL_CW:
- rmesa->state.hw.setup1.se_cntl |= RADEON_FFACE_CULL_CW;
+ rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_FFACE_CULL_CW;
break;
case GL_CCW:
- rmesa->state.hw.setup1.se_cntl |= RADEON_FFACE_CULL_CCW;
+ rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_FFACE_CULL_CCW;
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_CULL_FRONT_IS_CCW;
break;
}
}
@@ -393,15 +570,16 @@ static void radeonLineWidth( GLcontext *ctx, GLfloat widthf )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_LINE | RADEON_UPLOAD_SETUP );
+ RADEON_STATECHANGE( rmesa, lin );
+ RADEON_STATECHANGE( rmesa, set );
/* Line width is stored in U6.4 format.
*/
- rmesa->state.hw.line.se_line_width = (GLuint)(widthf * 16.0);
+ rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] = (GLuint)(widthf * 16.0);
if ( widthf > 1.0 ) {
- rmesa->state.hw.setup1.se_cntl |= RADEON_WIDELINE_ENABLE;
+ rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_WIDELINE_ENABLE;
} else {
- rmesa->state.hw.setup1.se_cntl &= ~RADEON_WIDELINE_ENABLE;
+ rmesa->hw.set.cmd[SET_SE_CNTL] &= ~RADEON_WIDELINE_ENABLE;
}
}
@@ -409,10 +587,9 @@ static void radeonLineStipple( GLcontext *ctx, GLint factor, GLushort pattern )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_LINE );
-
- rmesa->state.hw.line.re_line_pattern = ((((GLuint)factor & 0xff) << 16) |
- ((GLuint)pattern));
+ RADEON_STATECHANGE( rmesa, lin );
+ rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] =
+ ((((GLuint)factor & 0xff) << 16) | ((GLuint)pattern));
}
@@ -430,9 +607,9 @@ static void radeonColorMask( GLcontext *ctx,
ctx->Color.ColorMask[BCOMP],
ctx->Color.ColorMask[ACOMP] );
- if ( rmesa->state.hw.mask.rb3d_planemask != mask ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_MASKS );
- rmesa->state.hw.mask.rb3d_planemask = mask;
+ if ( rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK] != mask ) {
+ RADEON_STATECHANGE( rmesa, msk );
+ rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK] = mask;
}
}
@@ -447,15 +624,16 @@ static void radeonPolygonOffset( GLcontext *ctx,
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
GLfloat constant = units * rmesa->state.depth.scale;
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_ZBIAS );
- rmesa->state.hw.zbias.se_zbias_factor = *(GLuint *)&factor;
- rmesa->state.hw.zbias.se_zbias_constant = *(GLuint *)&constant;
+ RADEON_STATECHANGE( rmesa, zbs );
+ rmesa->hw.zbs.cmd[ZBS_SE_ZBIAS_FACTOR] = *(GLuint *)&factor;
+ rmesa->hw.zbs.cmd[ZBS_SE_ZBIAS_CONSTANT] = *(GLuint *)&constant;
}
static void radeonPolygonStipple( GLcontext *ctx, const GLubyte *mask )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
GLuint i;
+ drmRadeonStipple stipple;
/* Must flip pattern upside down.
*/
@@ -463,15 +641,34 @@ static void radeonPolygonStipple( GLcontext *ctx, const GLubyte *mask )
rmesa->state.stipple.mask[31 - i] = ((GLuint *) mask)[i];
}
+ /* TODO: push this into cmd mechanism
+ */
RADEON_FIREVERTICES( rmesa );
LOCK_HARDWARE( rmesa );
/* FIXME: Use window x,y offsets into stipple RAM.
*/
- drmRadeonPolygonStipple( rmesa->dri.fd, rmesa->state.stipple.mask );
+ stipple.mask = rmesa->state.stipple.mask;
+ drmCommandWrite( rmesa->dri.fd, DRM_RADEON_STIPPLE,
+ &stipple, sizeof(drmRadeonStipple) );
UNLOCK_HARDWARE( rmesa );
}
+static void radeonPolygonMode( GLcontext *ctx, GLenum face, GLenum mode )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLboolean flag = (ctx->_TriangleCaps & DD_TRI_UNFILLED) != 0;
+
+ /* Can't generally do unfilled via tcl, but some good special
+ * cases work.
+ */
+ TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_UNFILLED, flag);
+ if (rmesa->TclFallback) {
+ radeonChooseRenderState( ctx );
+ radeonChooseVertexState( ctx );
+ }
+}
+
/* =============================================================
* Rendering attributes
@@ -487,34 +684,478 @@ static void radeonPolygonStipple( GLcontext *ctx, const GLubyte *mask )
static void radeonUpdateSpecular( GLcontext *ctx )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- CARD32 p = rmesa->state.hw.context.pp_cntl;
+ CARD32 p = rmesa->hw.ctx.cmd[CTX_PP_CNTL];
- if ( ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR &&
- ctx->Light.Enabled) {
+ if ( ctx->_TriangleCaps & DD_SEPARATE_SPECULAR ) {
p |= RADEON_SPECULAR_ENABLE;
} else {
p &= ~RADEON_SPECULAR_ENABLE;
}
- if ( rmesa->state.hw.context.pp_cntl != p ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT );
- rmesa->state.hw.context.pp_cntl = p;
+ if ( rmesa->hw.ctx.cmd[CTX_PP_CNTL] != p ) {
+ RADEON_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] = p;
+ }
+
+ /* Bizzare: have to leave lighting enabled to get fog.
+ */
+ RADEON_STATECHANGE( rmesa, tcl );
+ if ((ctx->Light.Enabled &&
+ ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) {
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_SPECULAR;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_DIFFUSE;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE;
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE;
+ }
+ else if (ctx->Fog.Enabled) {
+ if (ctx->Light.Enabled) {
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_SPECULAR;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_DIFFUSE;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE;
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE;
+ } else {
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_SPECULAR;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_DIFFUSE;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE;
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE;
+ }
+ }
+ else if (ctx->Light.Enabled) {
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_SPECULAR;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_DIFFUSE;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &= ~RADEON_TCL_VTX_PK_SPEC;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE;
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE;
+ } else if (ctx->Fog.ColorSumEnabled ) {
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_SPECULAR;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_DIFFUSE;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE;
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_LIGHTING_ENABLE;
+ } else {
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_SPECULAR;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_DIFFUSE;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &= ~RADEON_TCL_VTX_PK_SPEC;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE;
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_LIGHTING_ENABLE;
+ }
+
+ /* Update vertex/render formats
+ */
+ if (rmesa->TclFallback) {
+ radeonChooseRenderState( ctx );
+ radeonChooseVertexState( ctx );
}
}
+/* =============================================================
+ * Materials
+ */
+
+
+/* Update on colormaterial, material emmissive/ambient,
+ * lightmodel.globalambient
+ */
+static void update_global_ambient( GLcontext *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ float *fcmd = (float *)RADEON_DB_STATE( glt );
+
+ /* Need to do more if both emmissive & ambient are PREMULT:
+ */
+ if ((rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &
+ ((3 << RADEON_EMISSIVE_SOURCE_SHIFT) |
+ (3 << RADEON_AMBIENT_SOURCE_SHIFT))) == 0)
+ {
+ COPY_3V( &fcmd[GLT_RED],
+ ctx->Light.Material[0].Emission);
+ ACC_SCALE_3V( &fcmd[GLT_RED],
+ ctx->Light.Model.Ambient,
+ ctx->Light.Material[0].Ambient);
+ }
+ else
+ {
+ COPY_3V( &fcmd[GLT_RED], ctx->Light.Model.Ambient );
+ }
+
+ RADEON_DB_STATECHANGE(rmesa, &rmesa->hw.glt);
+}
+
+/* Update on change to
+ * - light[p].colors
+ * - light[p].enabled
+ * - material,
+ * - colormaterial enabled
+ * - colormaterial bitmask
+ */
+static void update_light_colors( GLcontext *ctx, GLuint p )
+{
+ struct gl_light *l = &ctx->Light.Light[p];
+
+/* fprintf(stderr, "%s\n", __FUNCTION__); */
+
+ if (l->Enabled) {
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ float *fcmd = (float *)RADEON_DB_STATE( lit[p] );
+ GLuint bitmask = ctx->Light.ColorMaterialBitmask;
+ struct gl_material *mat = &ctx->Light.Material[0];
+
+ COPY_4V( &fcmd[LIT_AMBIENT_RED], l->Ambient );
+ COPY_4V( &fcmd[LIT_DIFFUSE_RED], l->Diffuse );
+ COPY_4V( &fcmd[LIT_SPECULAR_RED], l->Specular );
+
+ if (!ctx->Light.ColorMaterialEnabled)
+ bitmask = 0;
+
+ if ((bitmask & FRONT_AMBIENT_BIT) == 0)
+ SELF_SCALE_3V( &fcmd[LIT_AMBIENT_RED], mat->Ambient );
+
+ if ((bitmask & FRONT_DIFFUSE_BIT) == 0)
+ SELF_SCALE_3V( &fcmd[LIT_DIFFUSE_RED], mat->Diffuse );
+
+ if ((bitmask & FRONT_SPECULAR_BIT) == 0)
+ SELF_SCALE_3V( &fcmd[LIT_SPECULAR_RED], mat->Specular );
+
+ RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.lit[p] );
+ }
+}
+
+/* Also fallback for asym colormaterial mode in twoside lighting...
+ */
+static void check_twoside_fallback( GLcontext *ctx )
+{
+ GLboolean fallback = GL_FALSE;
+
+ if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) {
+ if (memcmp( &ctx->Light.Material[0],
+ &ctx->Light.Material[1],
+ sizeof(struct gl_material)) != 0)
+ fallback = GL_TRUE;
+ else if (ctx->Light.ColorMaterialEnabled &&
+ (ctx->Light.ColorMaterialBitmask & BACK_MATERIAL_BITS) !=
+ ((ctx->Light.ColorMaterialBitmask & FRONT_MATERIAL_BITS)<<1))
+ fallback = GL_TRUE;
+ }
+
+ TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_LIGHT_TWOSIDE, fallback );
+}
+
+static void radeonColorMaterial( GLcontext *ctx, GLenum face, GLenum mode )
+{
+ if (ctx->Light.ColorMaterialEnabled) {
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLuint light_model_ctl = rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL];
+ GLuint mask = ctx->Light.ColorMaterialBitmask;
+
+ /* Default to PREMULT:
+ */
+ light_model_ctl &= ~((3 << RADEON_EMISSIVE_SOURCE_SHIFT) |
+ (3 << RADEON_AMBIENT_SOURCE_SHIFT) |
+ (3 << RADEON_DIFFUSE_SOURCE_SHIFT) |
+ (3 << RADEON_SPECULAR_SOURCE_SHIFT));
+
+ if (mask & FRONT_EMISSION_BIT) {
+ light_model_ctl |= (RADEON_LM_SOURCE_VERTEX_DIFFUSE <<
+ RADEON_EMISSIVE_SOURCE_SHIFT);
+ }
+
+ if (mask & FRONT_AMBIENT_BIT) {
+ light_model_ctl |= (RADEON_LM_SOURCE_VERTEX_DIFFUSE <<
+ RADEON_AMBIENT_SOURCE_SHIFT);
+ }
+
+ if (mask & FRONT_DIFFUSE_BIT) {
+ light_model_ctl |= (RADEON_LM_SOURCE_VERTEX_DIFFUSE <<
+ RADEON_DIFFUSE_SOURCE_SHIFT);
+ }
+
+ if (mask & FRONT_SPECULAR_BIT) {
+ light_model_ctl |= (RADEON_LM_SOURCE_VERTEX_DIFFUSE <<
+ RADEON_SPECULAR_SOURCE_SHIFT);
+ }
+
+ if (light_model_ctl != rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL]) {
+ GLuint p;
+
+ RADEON_STATECHANGE( rmesa, tcl );
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] = light_model_ctl;
+
+ for (p = 0 ; p < MAX_LIGHTS; p++)
+ update_light_colors( ctx, p );
+ update_global_ambient( ctx );
+ }
+ }
+
+ check_twoside_fallback( ctx );
+}
+
+void radeonUpdateMaterial( GLcontext *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLfloat *fcmd = (GLfloat *)RADEON_DB_STATE( mtl );
+ GLuint p;
+ GLuint mask = ~0;
+
+ if (ctx->Light.ColorMaterialEnabled)
+ mask &= ~ctx->Light.ColorMaterialBitmask;
+
+ if (RADEON_DEBUG & DEBUG_STATE)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+
+ if (mask & FRONT_EMISSION_BIT) {
+ fcmd[MTL_EMMISSIVE_RED] = ctx->Light.Material[0].Emission[0];
+ fcmd[MTL_EMMISSIVE_GREEN] = ctx->Light.Material[0].Emission[1];
+ fcmd[MTL_EMMISSIVE_BLUE] = ctx->Light.Material[0].Emission[2];
+ fcmd[MTL_EMMISSIVE_ALPHA] = ctx->Light.Material[0].Emission[3];
+ }
+ if (mask & FRONT_AMBIENT_BIT) {
+ fcmd[MTL_AMBIENT_RED] = ctx->Light.Material[0].Ambient[0];
+ fcmd[MTL_AMBIENT_GREEN] = ctx->Light.Material[0].Ambient[1];
+ fcmd[MTL_AMBIENT_BLUE] = ctx->Light.Material[0].Ambient[2];
+ fcmd[MTL_AMBIENT_ALPHA] = ctx->Light.Material[0].Ambient[3];
+ }
+ if (mask & FRONT_DIFFUSE_BIT) {
+ fcmd[MTL_DIFFUSE_RED] = ctx->Light.Material[0].Diffuse[0];
+ fcmd[MTL_DIFFUSE_GREEN] = ctx->Light.Material[0].Diffuse[1];
+ fcmd[MTL_DIFFUSE_BLUE] = ctx->Light.Material[0].Diffuse[2];
+ fcmd[MTL_DIFFUSE_ALPHA] = ctx->Light.Material[0].Diffuse[3];
+ }
+ if (mask & FRONT_SPECULAR_BIT) {
+ fcmd[MTL_SPECULAR_RED] = ctx->Light.Material[0].Specular[0];
+ fcmd[MTL_SPECULAR_GREEN] = ctx->Light.Material[0].Specular[1];
+ fcmd[MTL_SPECULAR_BLUE] = ctx->Light.Material[0].Specular[2];
+ fcmd[MTL_SPECULAR_ALPHA] = ctx->Light.Material[0].Specular[3];
+ }
+ if (mask & FRONT_SHININESS_BIT) {
+ fcmd[MTL_SHININESS] = ctx->Light.Material[0].Shininess;
+ }
+
+ if (RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.mtl )) {
+ for (p = 0 ; p < MAX_LIGHTS; p++)
+ update_light_colors( ctx, p );
+
+ check_twoside_fallback( ctx );
+ update_global_ambient( ctx );
+ }
+ else if (RADEON_DEBUG & (DEBUG_PRIMS|DEBUG_STATE))
+ fprintf(stderr, "%s: Elided noop material call\n", __FUNCTION__);
+}
+
+/* _NEW_LIGHT
+ * _NEW_MODELVIEW
+ * _MESA_NEW_NEED_EYE_COORDS
+ *
+ * Uses derived state from mesa:
+ * _VP_inf_norm
+ * _h_inf_norm
+ * _Position
+ * _NormDirection
+ * _ModelViewInvScale
+ * _NeedEyeCoords
+ * _EyeZDir
+ *
+ * which are calculated in light.c and are correct for the current
+ * lighting space (model or eye), hence dependencies on _NEW_MODELVIEW
+ * and _MESA_NEW_NEED_EYE_COORDS.
+ */
+static void update_light( GLcontext *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+
+ /* Have to check these, or have an automatic shortcircuit mechanism
+ * to remove noop statechanges. (Or just do a better job on the
+ * front end).
+ */
+ {
+ GLuint tmp = rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL];
+
+ if (ctx->_NeedEyeCoords)
+ tmp &= ~RADEON_LIGHT_IN_MODELSPACE;
+ else
+ tmp |= RADEON_LIGHT_IN_MODELSPACE;
+
+
+ /* Leave this test disabled: (unexplained q3 lockup) (even with
+ new packets)
+ */
+ if (tmp != rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL])
+ {
+ RADEON_STATECHANGE( rmesa, tcl );
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] = tmp;
+ }
+ }
+
+ {
+ GLfloat *fcmd = (GLfloat *)RADEON_DB_STATE( eye );
+ fcmd[EYE_X] = ctx->_EyeZDir[0];
+ fcmd[EYE_Y] = ctx->_EyeZDir[1];
+ fcmd[EYE_Z] = - ctx->_EyeZDir[2];
+ fcmd[EYE_RESCALE_FACTOR] = ctx->_ModelViewInvScale;
+ RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.eye );
+ }
+
+
+/* RADEON_STATECHANGE( rmesa, glt ); */
+
+ if (ctx->Light.Enabled) {
+ GLint p;
+ for (p = 0 ; p < MAX_LIGHTS; p++) {
+ if (ctx->Light.Light[p].Enabled) {
+ struct gl_light *l = &ctx->Light.Light[p];
+ GLfloat *fcmd = (GLfloat *)RADEON_DB_STATE( lit[p] );
+
+ if (l->EyePosition[3] == 0.0) {
+ COPY_3FV( &fcmd[LIT_POSITION_X], l->_VP_inf_norm );
+ COPY_3FV( &fcmd[LIT_DIRECTION_X], l->_h_inf_norm );
+ fcmd[LIT_POSITION_W] = 0;
+ fcmd[LIT_DIRECTION_W] = 0;
+ } else {
+ COPY_4V( &fcmd[LIT_POSITION_X], l->_Position );
+ fcmd[LIT_DIRECTION_X] = -l->_NormDirection[0];
+ fcmd[LIT_DIRECTION_Y] = -l->_NormDirection[1];
+ fcmd[LIT_DIRECTION_Z] = -l->_NormDirection[2];
+ fcmd[LIT_DIRECTION_W] = 0;
+ }
+
+ RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.lit[p] );
+ }
+ }
+ }
+}
+
+static void radeonLightfv( GLcontext *ctx, GLenum light,
+ GLenum pname, const GLfloat *params )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLint p = light - GL_LIGHT0;
+ struct gl_light *l = &ctx->Light.Light[p];
+ GLfloat *fcmd = (GLfloat *)rmesa->hw.lit[p].cmd;
+
+
+ switch (pname) {
+ case GL_AMBIENT:
+ case GL_DIFFUSE:
+ case GL_SPECULAR:
+ update_light_colors( ctx, p );
+ break;
+
+ case GL_SPOT_DIRECTION:
+ /* picked up in update_light */
+ break;
+
+ case GL_POSITION: {
+ /* positions picked up in update_light, but can do flag here */
+ GLuint flag = (p&1)? RADEON_LIGHT_1_IS_LOCAL : RADEON_LIGHT_0_IS_LOCAL;
+ GLuint idx = TCL_PER_LIGHT_CTL_0 + p/2;
+
+ RADEON_STATECHANGE(rmesa, tcl);
+ if (l->EyePosition[3] != 0.0F)
+ rmesa->hw.tcl.cmd[idx] |= flag;
+ else
+ rmesa->hw.tcl.cmd[idx] &= ~flag;
+ break;
+ }
+
+ case GL_SPOT_EXPONENT:
+ RADEON_STATECHANGE(rmesa, lit[p]);
+ fcmd[LIT_SPOT_EXPONENT] = params[0];
+ break;
+
+ case GL_SPOT_CUTOFF: {
+ GLuint flag = (p&1) ? RADEON_LIGHT_1_IS_SPOT : RADEON_LIGHT_0_IS_SPOT;
+ GLuint idx = TCL_PER_LIGHT_CTL_0 + p/2;
+
+ RADEON_STATECHANGE(rmesa, lit[p]);
+ fcmd[LIT_SPOT_CUTOFF] = l->_CosCutoff;
+
+ RADEON_STATECHANGE(rmesa, tcl);
+ if (l->SpotCutoff != 180.0F)
+ rmesa->hw.tcl.cmd[idx] |= flag;
+ else
+ rmesa->hw.tcl.cmd[idx] &= ~flag;
+ break;
+ }
+
+ case GL_CONSTANT_ATTENUATION:
+ RADEON_STATECHANGE(rmesa, lit[p]);
+ fcmd[LIT_ATTEN_CONST] = params[0];
+ break;
+ case GL_LINEAR_ATTENUATION:
+ RADEON_STATECHANGE(rmesa, lit[p]);
+ fcmd[LIT_ATTEN_LINEAR] = params[0];
+ break;
+ case GL_QUADRATIC_ATTENUATION:
+ RADEON_STATECHANGE(rmesa, lit[p]);
+ fcmd[LIT_ATTEN_QUADRATIC] = params[0];
+ break;
+ default:
+ return;
+ }
+
+}
+
+
+
+
static void radeonLightModelfv( GLcontext *ctx, GLenum pname,
const GLfloat *param )
{
- if ( pname == GL_LIGHT_MODEL_COLOR_CONTROL ) {
- radeonUpdateSpecular(ctx);
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+
+ switch (pname) {
+ case GL_LIGHT_MODEL_AMBIENT:
+ update_global_ambient( ctx );
+ break;
+
+ case GL_LIGHT_MODEL_LOCAL_VIEWER:
+ RADEON_STATECHANGE( rmesa, tcl );
+ if (ctx->Light.Model.LocalViewer)
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LOCAL_VIEWER;
+ else
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_LOCAL_VIEWER;
+ break;
+
+ case GL_LIGHT_MODEL_TWO_SIDE:
+ RADEON_STATECHANGE( rmesa, tcl );
+ if (ctx->Light.Model.TwoSide)
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_LIGHT_TWOSIDE;
+ else
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~RADEON_LIGHT_TWOSIDE;
+
+ check_twoside_fallback( ctx );
+
+ if (rmesa->TclFallback) {
+ radeonChooseRenderState( ctx );
+ radeonChooseVertexState( ctx );
+ }
+ break;
+
+ case GL_LIGHT_MODEL_COLOR_CONTROL:
+ radeonUpdateSpecular(ctx);
+
+ RADEON_STATECHANGE( rmesa, tcl );
+ if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &=
+ ~RADEON_DIFFUSE_SPECULAR_COMBINE;
+ else
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |=
+ RADEON_DIFFUSE_SPECULAR_COMBINE;
+ break;
+
+ default:
+ break;
}
}
static void radeonShadeModel( GLcontext *ctx, GLenum mode )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint s = rmesa->state.hw.setup1.se_cntl;
+ GLuint s = rmesa->hw.set.cmd[SET_SE_CNTL];
s &= ~(RADEON_DIFFUSE_SHADE_MASK |
RADEON_ALPHA_SHADE_MASK |
@@ -538,9 +1179,45 @@ static void radeonShadeModel( GLcontext *ctx, GLenum mode )
return;
}
- if ( rmesa->state.hw.setup1.se_cntl != s ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_SETUP );
- rmesa->state.hw.setup1.se_cntl = s;
+ if ( rmesa->hw.set.cmd[SET_SE_CNTL] != s ) {
+ RADEON_STATECHANGE( rmesa, set );
+ rmesa->hw.set.cmd[SET_SE_CNTL] = s;
+ }
+}
+
+
+/* =============================================================
+ * User clip planes
+ */
+
+static void radeonClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *eq )
+{
+ GLint p = (GLint) plane - (GLint) GL_CLIP_PLANE0;
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLint *ip = (GLint *)ctx->Transform._ClipUserPlane[p];
+
+ RADEON_STATECHANGE( rmesa, ucp[p] );
+ rmesa->hw.ucp[p].cmd[UCP_X] = ip[0];
+ rmesa->hw.ucp[p].cmd[UCP_Y] = ip[1];
+ rmesa->hw.ucp[p].cmd[UCP_Z] = ip[2];
+ rmesa->hw.ucp[p].cmd[UCP_W] = ip[3];
+}
+
+static void radeonUpdateClipPlanes( GLcontext *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLuint p;
+
+ for (p = 0; p < ctx->Const.MaxClipPlanes; p++) {
+ if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
+ GLint *ip = (GLint *)ctx->Transform._ClipUserPlane[p];
+
+ RADEON_STATECHANGE( rmesa, ucp[p] );
+ rmesa->hw.ucp[p].cmd[UCP_X] = ip[0];
+ rmesa->hw.ucp[p].cmd[UCP_Y] = ip[1];
+ rmesa->hw.ucp[p].cmd[UCP_Z] = ip[2];
+ rmesa->hw.ucp[p].cmd[UCP_W] = ip[3];
+ }
}
}
@@ -553,54 +1230,54 @@ static void radeonStencilFunc( GLcontext *ctx, GLenum func,
GLint ref, GLuint mask )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint refmask = ((ctx->Stencil.Ref << RADEON_STENCIL_REF_SHIFT) |
- (ctx->Stencil.ValueMask << RADEON_STENCIL_MASK_SHIFT));
+ GLuint refmask = ((ctx->Stencil.Ref[0] << RADEON_STENCIL_REF_SHIFT) |
+ (ctx->Stencil.ValueMask[0] << RADEON_STENCIL_MASK_SHIFT));
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT | RADEON_UPLOAD_MASKS );
+ RADEON_STATECHANGE( rmesa, ctx );
+ RADEON_STATECHANGE( rmesa, msk );
- rmesa->state.hw.context.rb3d_zstencilcntl &= ~RADEON_STENCIL_TEST_MASK;
- rmesa->state.hw.mask.rb3d_stencilrefmask &= ~(RADEON_STENCIL_REF_MASK|
- RADEON_STENCIL_VALUE_MASK);
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &= ~RADEON_STENCIL_TEST_MASK;
+ rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] &= ~(RADEON_STENCIL_REF_MASK|
+ RADEON_STENCIL_VALUE_MASK);
- switch ( ctx->Stencil.Function ) {
+ switch ( ctx->Stencil.Function[0] ) {
case GL_NEVER:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_TEST_NEVER;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_TEST_NEVER;
break;
case GL_LESS:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_TEST_LESS;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_TEST_LESS;
break;
case GL_EQUAL:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_TEST_EQUAL;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_TEST_EQUAL;
break;
case GL_LEQUAL:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_TEST_LEQUAL;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_TEST_LEQUAL;
break;
case GL_GREATER:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_TEST_GREATER;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_TEST_GREATER;
break;
case GL_NOTEQUAL:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_TEST_NEQUAL;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_TEST_NEQUAL;
break;
case GL_GEQUAL:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_TEST_GEQUAL;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_TEST_GEQUAL;
break;
case GL_ALWAYS:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_TEST_ALWAYS;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_TEST_ALWAYS;
break;
}
- rmesa->state.hw.mask.rb3d_stencilrefmask |= refmask;
+ rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] |= refmask;
}
static void radeonStencilMask( GLcontext *ctx, GLuint mask )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_MASKS );
- rmesa->state.hw.mask.rb3d_stencilrefmask &= ~RADEON_STENCIL_WRITE_MASK;
-
- rmesa->state.hw.mask.rb3d_stencilrefmask |=
- (ctx->Stencil.WriteMask << RADEON_STENCIL_WRITEMASK_SHIFT);
+ RADEON_STATECHANGE( rmesa, msk );
+ rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] &= ~RADEON_STENCIL_WRITE_MASK;
+ rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] |=
+ (ctx->Stencil.WriteMask[0] << RADEON_STENCIL_WRITEMASK_SHIFT);
}
static void radeonStencilOp( GLcontext *ctx, GLenum fail,
@@ -608,71 +1285,71 @@ static void radeonStencilOp( GLcontext *ctx, GLenum fail,
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT );
- rmesa->state.hw.context.rb3d_zstencilcntl &= ~(RADEON_STENCIL_FAIL_MASK |
+ RADEON_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &= ~(RADEON_STENCIL_FAIL_MASK |
RADEON_STENCIL_ZFAIL_MASK |
RADEON_STENCIL_ZPASS_MASK);
- switch ( ctx->Stencil.FailFunc ) {
+ switch ( ctx->Stencil.FailFunc[0] ) {
case GL_KEEP:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_FAIL_KEEP;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_FAIL_KEEP;
break;
case GL_ZERO:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_FAIL_ZERO;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_FAIL_ZERO;
break;
case GL_REPLACE:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_FAIL_REPLACE;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_FAIL_REPLACE;
break;
case GL_INCR:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_FAIL_INC;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_FAIL_INC;
break;
case GL_DECR:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_FAIL_DEC;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_FAIL_DEC;
break;
case GL_INVERT:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_FAIL_INVERT;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_FAIL_INVERT;
break;
}
- switch ( ctx->Stencil.ZFailFunc ) {
+ switch ( ctx->Stencil.ZFailFunc[0] ) {
case GL_KEEP:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_ZFAIL_KEEP;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZFAIL_KEEP;
break;
case GL_ZERO:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_ZFAIL_ZERO;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZFAIL_ZERO;
break;
case GL_REPLACE:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_ZFAIL_REPLACE;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZFAIL_REPLACE;
break;
case GL_INCR:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_ZFAIL_INC;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZFAIL_INC;
break;
case GL_DECR:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_ZFAIL_DEC;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZFAIL_DEC;
break;
case GL_INVERT:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_ZFAIL_INVERT;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZFAIL_INVERT;
break;
}
- switch ( ctx->Stencil.ZPassFunc ) {
+ switch ( ctx->Stencil.ZPassFunc[0] ) {
case GL_KEEP:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_ZPASS_KEEP;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZPASS_KEEP;
break;
case GL_ZERO:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_ZPASS_ZERO;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZPASS_ZERO;
break;
case GL_REPLACE:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_ZPASS_REPLACE;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZPASS_REPLACE;
break;
case GL_INCR:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_ZPASS_INC;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZPASS_INC;
break;
case GL_DECR:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_ZPASS_DEC;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZPASS_DEC;
break;
case GL_INVERT:
- rmesa->state.hw.context.rb3d_zstencilcntl |= RADEON_STENCIL_ZPASS_INVERT;
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZPASS_INVERT;
break;
}
}
@@ -681,9 +1358,10 @@ static void radeonClearStencil( GLcontext *ctx, GLint s )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- rmesa->state.stencil.clear = ((GLuint) ctx->Stencil.Clear |
- (0xff << RADEON_STENCIL_MASK_SHIFT) |
- (ctx->Stencil.WriteMask << RADEON_STENCIL_WRITEMASK_SHIFT));
+ rmesa->state.stencil.clear =
+ ((GLuint) ctx->Stencil.Clear |
+ (0xff << RADEON_STENCIL_MASK_SHIFT) |
+ (ctx->Stencil.WriteMask[0] << RADEON_STENCIL_WRITEMASK_SHIFT));
}
@@ -695,6 +1373,7 @@ static void radeonClearStencil( GLcontext *ctx, GLint s )
* To correctly position primitives:
*/
#define SUBPIXEL_X 0.125
+#define SUBPIXEL_Y 0.125
void radeonUpdateWindow( GLcontext *ctx )
{
@@ -707,20 +1386,18 @@ void radeonUpdateWindow( GLcontext *ctx )
GLfloat sx = v[MAT_SX];
GLfloat tx = v[MAT_TX] + xoffset + SUBPIXEL_X;
GLfloat sy = - v[MAT_SY];
- GLfloat ty = (- v[MAT_TY]) + yoffset;
+ GLfloat ty = (- v[MAT_TY]) + yoffset + SUBPIXEL_Y;
GLfloat sz = v[MAT_SZ] * rmesa->state.depth.scale;
GLfloat tz = v[MAT_TZ] * rmesa->state.depth.scale;
-
-/* fprintf(stderr, "radeonUpdateWindow %d,%d %dx%d\n", */
-/* dPriv->x, dPriv->y, dPriv->w, dPriv->h); */
-
- RADEON_STATECHANGE(rmesa, RADEON_UPLOAD_VIEWPORT);
- rmesa->state.hw.viewport.se_vport_xscale = *(GLuint *)&sx;
- rmesa->state.hw.viewport.se_vport_xoffset = *(GLuint *)&tx;
- rmesa->state.hw.viewport.se_vport_yscale = *(GLuint *)&sy;
- rmesa->state.hw.viewport.se_vport_yoffset = *(GLuint *)&ty;
- rmesa->state.hw.viewport.se_vport_zscale = *(GLuint *)&sz;
- rmesa->state.hw.viewport.se_vport_zoffset = *(GLuint *)&tz;
+ RADEON_FIREVERTICES( rmesa );
+ RADEON_STATECHANGE( rmesa, vpt );
+
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_XSCALE] = *(GLuint *)&sx;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] = *(GLuint *)&tx;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_YSCALE] = *(GLuint *)&sy;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] = *(GLuint *)&ty;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZSCALE] = *(GLuint *)&sz;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZOFFSET] = *(GLuint *)&tz;
}
@@ -753,29 +1430,19 @@ void radeonUpdateViewportOffset( GLcontext *ctx )
GLfloat tx = v[MAT_TX] + xoffset;
GLfloat ty = (- v[MAT_TY]) + yoffset;
- if ( rmesa->state.hw.viewport.se_vport_xoffset != tx ||
- rmesa->state.hw.viewport.se_vport_yoffset != ty )
+ if ( rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] != *(GLuint *)&tx ||
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] != *(GLuint *)&ty )
{
- rmesa->state.hw.viewport.se_vport_xoffset = *(GLuint *)&tx;
- rmesa->state.hw.viewport.se_vport_yoffset = *(GLuint *)&ty;
-
- if (rmesa->store.statenr) {
- int i;
- rmesa->store.state[0].dirty |= RADEON_UPLOAD_VIEWPORT;
- /* Note: assume vport x/yoffset are constant over the buffer:
- */
- for (i = 0 ; i < rmesa->store.statenr ; i++) {
- rmesa->store.state[i].viewport.se_vport_xoffset = *(GLuint *)&tx;
- rmesa->store.state[i].viewport.se_vport_yoffset = *(GLuint *)&ty;
- }
- } else {
- rmesa->state.hw.dirty |= RADEON_UPLOAD_VIEWPORT;
- }
-
+ /* Note: this should also modify whatever data the context reset
+ * code uses...
+ */
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] = *(GLuint *)&tx;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] = *(GLuint *)&ty;
+
/* update polygon stipple x/y screen offset */
{
GLuint stx, sty;
- GLuint m = rmesa->state.hw.misc.re_misc;
+ GLuint m = rmesa->hw.msc.cmd[MSC_RE_MISC];
m &= ~(RADEON_STIPPLE_X_OFFSET_MASK |
RADEON_STIPPLE_Y_OFFSET_MASK);
@@ -788,9 +1455,9 @@ void radeonUpdateViewportOffset( GLcontext *ctx )
m |= ((stx << RADEON_STIPPLE_X_OFFSET_SHIFT) |
(sty << RADEON_STIPPLE_Y_OFFSET_SHIFT));
- if ( rmesa->state.hw.misc.re_misc != m ) {
- rmesa->state.hw.misc.re_misc = m;
- RADEON_STATECHANGE(rmesa, RADEON_UPLOAD_MISC);
+ if ( rmesa->hw.msc.cmd[MSC_RE_MISC] != m ) {
+ RADEON_STATECHANGE( rmesa, msc );
+ rmesa->hw.msc.cmd[MSC_RE_MISC] = m;
}
}
}
@@ -804,9 +1471,14 @@ void radeonUpdateViewportOffset( GLcontext *ctx )
* Miscellaneous
*/
-static void radeonClearColor( GLcontext *ctx, const GLchan c[4] )
+static void radeonClearColor( GLcontext *ctx, const GLfloat color[4] )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLubyte c[4];
+ CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
+ CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]);
rmesa->state.color.clear = radeonPackColor( rmesa->radeonScreen->cpp,
c[0], c[1], c[2], c[3] );
}
@@ -845,8 +1517,8 @@ static void radeonLogicOpCode( GLcontext *ctx, GLenum opcode )
ASSERT( rop < 16 );
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_MASKS );
- rmesa->state.hw.mask.rb3d_ropcntl = radeon_rop_tab[rop];
+ RADEON_STATECHANGE( rmesa, msk );
+ rmesa->hw.msk.cmd[MSK_RB3D_ROPCNTL] = radeon_rop_tab[rop];
}
@@ -860,7 +1532,9 @@ void radeonSetCliprects( radeonContextPtr rmesa, GLenum mode )
rmesa->pClipRects = (XF86DRIClipRectPtr)dPriv->pClipRects;
break;
case GL_BACK_LEFT:
- if ( dPriv->numBackClipRects == 0 ) {
+ /* Can't ignore 2d windows if we are page flipping.
+ */
+ if ( dPriv->numBackClipRects == 0 || rmesa->doPageFlip ) {
rmesa->numClipRects = dPriv->numClipRects;
rmesa->pClipRects = (XF86DRIClipRectPtr)dPriv->pClipRects;
}
@@ -870,41 +1544,57 @@ void radeonSetCliprects( radeonContextPtr rmesa, GLenum mode )
}
break;
default:
+ fprintf(stderr, "bad mode in radeonSetCliprects\n");
return;
}
- rmesa->upload_cliprects = 1;
+ if (rmesa->state.scissor.enabled)
+ radeonRecalcScissorRects( rmesa );
}
-static void radeonSetDrawBuffer( GLcontext *ctx, GLenum mode )
+static void radeonDrawBuffer( GLcontext *ctx, GLenum mode )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ if (RADEON_DEBUG & DEBUG_DRI)
+ fprintf(stderr, "%s %s\n", __FUNCTION__,
+ _mesa_lookup_enum_by_nr( mode ));
+
RADEON_FIREVERTICES(rmesa); /* don't pipeline cliprect changes */
- switch ( mode ) {
- case GL_FRONT_LEFT:
+ /*
+ * _DrawDestMask is easier to cope with than <mode>.
+ */
+ switch ( ctx->Color._DrawDestMask ) {
+ case FRONT_LEFT_BIT:
FALLBACK( rmesa, RADEON_FALLBACK_DRAW_BUFFER, GL_FALSE );
- rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset;
- rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch;
radeonSetCliprects( rmesa, GL_FRONT_LEFT );
break;
- case GL_BACK_LEFT:
+ case BACK_LEFT_BIT:
FALLBACK( rmesa, RADEON_FALLBACK_DRAW_BUFFER, GL_FALSE );
- rmesa->state.color.drawOffset = rmesa->radeonScreen->backOffset;
- rmesa->state.color.drawPitch = rmesa->radeonScreen->backPitch;
radeonSetCliprects( rmesa, GL_BACK_LEFT );
break;
default:
+ /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
FALLBACK( rmesa, RADEON_FALLBACK_DRAW_BUFFER, GL_TRUE );
return;
}
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT );
- rmesa->state.hw.context.rb3d_coloroffset = (rmesa->state.color.drawOffset &
+ /* We want to update the s/w rast state too so that r200SetBuffer()
+ * gets called.
+ */
+ _swrast_DrawBuffer(ctx, mode);
+
+ RADEON_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = (rmesa->state.color.drawOffset &
RADEON_COLOROFFSET_MASK);
- rmesa->state.hw.context.rb3d_colorpitch = rmesa->state.color.drawPitch;
+ rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch;
+}
+
+static void radeonReadBuffer( GLcontext *ctx, GLenum mode )
+{
+ /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */
}
@@ -915,9 +1605,10 @@ static void radeonSetDrawBuffer( GLcontext *ctx, GLenum mode )
static void radeonEnable( GLcontext *ctx, GLenum cap, GLboolean state )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLuint p, flag;
- if ( RADEON_DEBUG & DEBUG_VERBOSE_API )
- fprintf( stderr, "%s( %s = %s )\n",__FUNCTION__,
+ if ( RADEON_DEBUG & DEBUG_STATE )
+ fprintf( stderr, "%s( %s = %s )\n", __FUNCTION__,
_mesa_lookup_enum_by_nr( cap ),
state ? "GL_TRUE" : "GL_FALSE" );
@@ -930,371 +1621,490 @@ static void radeonEnable( GLcontext *ctx, GLenum cap, GLboolean state )
break;
case GL_ALPHA_TEST:
- RADEON_STATECHANGE(rmesa, RADEON_UPLOAD_CONTEXT);
+ RADEON_STATECHANGE( rmesa, ctx );
if (state) {
- rmesa->state.hw.context.pp_cntl |= RADEON_ALPHA_TEST_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= RADEON_ALPHA_TEST_ENABLE;
} else {
- rmesa->state.hw.context.pp_cntl &= ~RADEON_ALPHA_TEST_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~RADEON_ALPHA_TEST_ENABLE;
}
break;
case GL_BLEND:
- RADEON_STATECHANGE(rmesa, RADEON_UPLOAD_CONTEXT);
+ RADEON_STATECHANGE( rmesa, ctx );
if (state) {
- rmesa->state.hw.context.rb3d_cntl |= RADEON_ALPHA_BLEND_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_ALPHA_BLEND_ENABLE;
+ } else {
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_ALPHA_BLEND_ENABLE;
+ }
+ if ( ctx->Color.ColorLogicOpEnabled ) {
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_ROP_ENABLE;
} else {
- rmesa->state.hw.context.rb3d_cntl &= ~RADEON_ALPHA_BLEND_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_ROP_ENABLE;
+ }
+ break;
+
+ case GL_CLIP_PLANE0:
+ case GL_CLIP_PLANE1:
+ case GL_CLIP_PLANE2:
+ case GL_CLIP_PLANE3:
+ case GL_CLIP_PLANE4:
+ case GL_CLIP_PLANE5:
+ p = cap-GL_CLIP_PLANE0;
+ RADEON_STATECHANGE( rmesa, tcl );
+ if (state) {
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= (RADEON_UCP_ENABLE_0<<p);
+ radeonClipPlane( ctx, cap, NULL );
+ }
+ else {
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~(RADEON_UCP_ENABLE_0<<p);
}
break;
+ case GL_COLOR_MATERIAL:
+ radeonColorMaterial( ctx, 0, 0 );
+ if (!state)
+ radeonUpdateMaterial( ctx );
+ break;
+
case GL_CULL_FACE:
radeonCullFace( ctx, 0 );
break;
case GL_DEPTH_TEST:
- RADEON_STATECHANGE(rmesa, RADEON_UPLOAD_CONTEXT);
+ RADEON_STATECHANGE(rmesa, ctx );
if ( state ) {
- rmesa->state.hw.context.rb3d_cntl |= RADEON_Z_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_Z_ENABLE;
} else {
- rmesa->state.hw.context.rb3d_cntl &= ~RADEON_Z_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_Z_ENABLE;
}
break;
case GL_DITHER:
- RADEON_STATECHANGE(rmesa, RADEON_UPLOAD_CONTEXT);
+ RADEON_STATECHANGE(rmesa, ctx );
if ( state ) {
- rmesa->state.hw.context.rb3d_cntl |= RADEON_DITHER_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_DITHER_ENABLE;
} else {
- rmesa->state.hw.context.rb3d_cntl &= ~RADEON_DITHER_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_DITHER_ENABLE;
}
break;
case GL_FOG:
- RADEON_STATECHANGE(rmesa, RADEON_UPLOAD_CONTEXT);
+ RADEON_STATECHANGE(rmesa, ctx );
if ( state ) {
- rmesa->state.hw.context.pp_cntl |= RADEON_FOG_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= RADEON_FOG_ENABLE;
+ radeonFogfv( ctx, GL_FOG_MODE, 0 );
} else {
- rmesa->state.hw.context.pp_cntl &= ~RADEON_FOG_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~RADEON_FOG_ENABLE;
+ RADEON_STATECHANGE(rmesa, tcl);
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~RADEON_TCL_FOG_MASK;
}
+ radeonUpdateSpecular( ctx ); /* for PK_SPEC */
+ if (rmesa->TclFallback)
+ radeonChooseVertexState( ctx );
+ break;
+
+ case GL_LIGHT0:
+ case GL_LIGHT1:
+ case GL_LIGHT2:
+ case GL_LIGHT3:
+ case GL_LIGHT4:
+ case GL_LIGHT5:
+ case GL_LIGHT6:
+ case GL_LIGHT7:
+ RADEON_STATECHANGE(rmesa, tcl);
+ p = cap - GL_LIGHT0;
+ if (p&1)
+ flag = (RADEON_LIGHT_1_ENABLE |
+ RADEON_LIGHT_1_ENABLE_AMBIENT |
+ RADEON_LIGHT_1_ENABLE_SPECULAR);
+ else
+ flag = (RADEON_LIGHT_0_ENABLE |
+ RADEON_LIGHT_0_ENABLE_AMBIENT |
+ RADEON_LIGHT_0_ENABLE_SPECULAR);
+
+ if (state)
+ rmesa->hw.tcl.cmd[p/2 + TCL_PER_LIGHT_CTL_0] |= flag;
+ else
+ rmesa->hw.tcl.cmd[p/2 + TCL_PER_LIGHT_CTL_0] &= ~flag;
+
+ /*
+ */
+ update_light_colors( ctx, p );
break;
case GL_LIGHTING:
+ RADEON_STATECHANGE(rmesa, tcl);
+ if (state) {
+/* rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE; */
+/* rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_DIFFUSE; */
+ }
+ else {
+/* rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_LIGHTING_ENABLE; */
+/* rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_DIFFUSE; */
+ }
radeonUpdateSpecular(ctx);
+ check_twoside_fallback( ctx );
break;
case GL_LINE_SMOOTH:
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT );
+ RADEON_STATECHANGE( rmesa, ctx );
if ( state ) {
- rmesa->state.hw.context.pp_cntl |= RADEON_ANTI_ALIAS_LINE;
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= RADEON_ANTI_ALIAS_LINE;
} else {
- rmesa->state.hw.context.pp_cntl &= ~RADEON_ANTI_ALIAS_LINE;
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~RADEON_ANTI_ALIAS_LINE;
}
break;
case GL_LINE_STIPPLE:
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT );
+ RADEON_STATECHANGE( rmesa, ctx );
if ( state ) {
- rmesa->state.hw.context.pp_cntl |= RADEON_PATTERN_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= RADEON_PATTERN_ENABLE;
} else {
- rmesa->state.hw.context.pp_cntl &= ~RADEON_PATTERN_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~RADEON_PATTERN_ENABLE;
}
break;
case GL_COLOR_LOGIC_OP:
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT );
+ RADEON_STATECHANGE( rmesa, ctx );
if ( state ) {
- rmesa->state.hw.context.rb3d_cntl |= RADEON_ROP_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_ROP_ENABLE;
} else {
- rmesa->state.hw.context.rb3d_cntl &= ~RADEON_ROP_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_ROP_ENABLE;
}
break;
-
- case GL_POLYGON_OFFSET_POINT:
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_SETUP );
+
+ case GL_NORMALIZE:
+ RADEON_STATECHANGE( rmesa, tcl );
if ( state ) {
- rmesa->state.hw.setup1.se_cntl |= RADEON_ZBIAS_ENABLE_POINT;
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_NORMALIZE_NORMALS;
} else {
- rmesa->state.hw.setup1.se_cntl &= ~RADEON_ZBIAS_ENABLE_POINT;
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_NORMALIZE_NORMALS;
+ }
+ break;
+
+ case GL_POLYGON_OFFSET_POINT:
+ if (rmesa->dri.drmMinor == 1) {
+ radeonChooseRenderState( ctx );
+ }
+ else {
+ RADEON_STATECHANGE( rmesa, set );
+ if ( state ) {
+ rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_ZBIAS_ENABLE_POINT;
+ } else {
+ rmesa->hw.set.cmd[SET_SE_CNTL] &= ~RADEON_ZBIAS_ENABLE_POINT;
+ }
}
break;
case GL_POLYGON_OFFSET_LINE:
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_SETUP );
- if ( state ) {
- rmesa->state.hw.setup1.se_cntl |= RADEON_ZBIAS_ENABLE_LINE;
- } else {
- rmesa->state.hw.setup1.se_cntl &= ~RADEON_ZBIAS_ENABLE_LINE;
+ if (rmesa->dri.drmMinor == 1) {
+ radeonChooseRenderState( ctx );
+ }
+ else {
+ RADEON_STATECHANGE( rmesa, set );
+ if ( state ) {
+ rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_ZBIAS_ENABLE_LINE;
+ } else {
+ rmesa->hw.set.cmd[SET_SE_CNTL] &= ~RADEON_ZBIAS_ENABLE_LINE;
+ }
}
break;
case GL_POLYGON_OFFSET_FILL:
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_SETUP );
- if ( state ) {
- rmesa->state.hw.setup1.se_cntl |= RADEON_ZBIAS_ENABLE_TRI;
- } else {
- rmesa->state.hw.setup1.se_cntl &= ~RADEON_ZBIAS_ENABLE_TRI;
+ if (rmesa->dri.drmMinor == 1) {
+ radeonChooseRenderState( ctx );
+ }
+ else {
+ RADEON_STATECHANGE( rmesa, set );
+ if ( state ) {
+ rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_ZBIAS_ENABLE_TRI;
+ } else {
+ rmesa->hw.set.cmd[SET_SE_CNTL] &= ~RADEON_ZBIAS_ENABLE_TRI;
+ }
}
break;
case GL_POLYGON_SMOOTH:
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT );
+ RADEON_STATECHANGE( rmesa, ctx );
if ( state ) {
- rmesa->state.hw.context.pp_cntl |= RADEON_ANTI_ALIAS_POLY;
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= RADEON_ANTI_ALIAS_POLY;
} else {
- rmesa->state.hw.context.pp_cntl &= ~RADEON_ANTI_ALIAS_POLY;
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~RADEON_ANTI_ALIAS_POLY;
}
break;
case GL_POLYGON_STIPPLE:
- RADEON_STATECHANGE(rmesa, RADEON_UPLOAD_CONTEXT);
+ RADEON_STATECHANGE(rmesa, ctx );
if ( state ) {
- rmesa->state.hw.context.pp_cntl |= RADEON_STIPPLE_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= RADEON_STIPPLE_ENABLE;
+ } else {
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~RADEON_STIPPLE_ENABLE;
+ }
+ break;
+
+ case GL_RESCALE_NORMAL_EXT: {
+ GLboolean tmp = ctx->_NeedEyeCoords ? state : !state;
+ RADEON_STATECHANGE( rmesa, tcl );
+ if ( tmp ) {
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_RESCALE_NORMALS;
} else {
- rmesa->state.hw.context.pp_cntl &= ~RADEON_STIPPLE_ENABLE;
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_RESCALE_NORMALS;
}
break;
+ }
case GL_SCISSOR_TEST:
RADEON_FIREVERTICES( rmesa );
rmesa->state.scissor.enabled = state;
- rmesa->upload_cliprects = 1;
+ radeonUpdateScissor( ctx );
break;
case GL_STENCIL_TEST:
if ( rmesa->state.stencil.hwBuffer ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT );
+ RADEON_STATECHANGE( rmesa, ctx );
if ( state ) {
- rmesa->state.hw.context.rb3d_cntl |= RADEON_STENCIL_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_STENCIL_ENABLE;
} else {
- rmesa->state.hw.context.rb3d_cntl &= ~RADEON_STENCIL_ENABLE;
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_STENCIL_ENABLE;
}
} else {
FALLBACK( rmesa, RADEON_FALLBACK_STENCIL, state );
}
break;
+ case GL_TEXTURE_GEN_Q:
+ case GL_TEXTURE_GEN_R:
+ case GL_TEXTURE_GEN_S:
+ case GL_TEXTURE_GEN_T:
+ /* Picked up in radeonUpdateTextureState.
+ */
+ rmesa->recheck_texgen[ctx->Texture.CurrentUnit] = GL_TRUE;
+ break;
+
+ case GL_COLOR_SUM_EXT:
+ radeonUpdateSpecular ( ctx );
+ break;
+
default:
return;
}
}
+static void radeonLightingSpaceChange( GLcontext *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLboolean tmp;
+ RADEON_STATECHANGE( rmesa, tcl );
+
+ if (RADEON_DEBUG & DEBUG_STATE)
+ fprintf(stderr, "%s %d\n", __FUNCTION__, ctx->_NeedEyeCoords);
+
+ if (ctx->_NeedEyeCoords)
+ tmp = ctx->Transform.RescaleNormals;
+ else
+ tmp = !ctx->Transform.RescaleNormals;
+
+ if ( tmp ) {
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_RESCALE_NORMALS;
+ } else {
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_RESCALE_NORMALS;
+ }
+}
+
/* =============================================================
- * State initialization, management
+ * Deferred state management - matrices, textures, other?
*/
-void radeonPrintDirty( const char *msg, GLuint state )
-{
- fprintf( stderr,
- "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s\n",
- msg,
- state,
- (state & RADEON_UPLOAD_CONTEXT) ? "context, " : "",
- (state & RADEON_UPLOAD_LINE) ? "line, " : "",
- (state & RADEON_UPLOAD_BUMPMAP) ? "bumpmap, " : "",
- (state & RADEON_UPLOAD_MASKS) ? "masks, " : "",
- (state & RADEON_UPLOAD_VIEWPORT) ? "viewport, " : "",
- (state & RADEON_UPLOAD_SETUP) ? "setup, " : "",
- (state & RADEON_UPLOAD_TCL) ? "tcl, " : "",
- (state & RADEON_UPLOAD_MISC) ? "misc, " : "",
- (state & RADEON_UPLOAD_TEX0) ? "tex0, " : "",
- (state & RADEON_UPLOAD_TEX1) ? "tex1, " : "",
- (state & RADEON_UPLOAD_TEX2) ? "tex2, " : "");
-}
+static void upload_matrix( radeonContextPtr rmesa, GLfloat *src, int idx )
+{
+ float *dest = ((float *)RADEON_DB_STATE( mat[idx] ))+MAT_ELT_0;
+ int i;
+
+ for (i = 0 ; i < 4 ; i++) {
+ *dest++ = src[i];
+ *dest++ = src[i+4];
+ *dest++ = src[i+8];
+ *dest++ = src[i+12];
+ }
-static void radeonInvalidateState( GLcontext *ctx, GLuint new_state )
+ RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.mat[idx] );
+}
+
+static void upload_matrix_t( radeonContextPtr rmesa, GLfloat *src, int idx )
{
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
- RADEON_CONTEXT(ctx)->NewGLState |= new_state;
+ float *dest = ((float *)RADEON_DB_STATE( mat[idx] ))+MAT_ELT_0;
+ memcpy(dest, src, 16*sizeof(float));
+ RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.mat[idx] );
}
+static void update_texturematrix( GLcontext *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
+ GLuint tpc = rmesa->hw.tcl.cmd[TCL_TEXTURE_PROC_CTL];
+ GLuint vs = rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL];
+ int unit;
+ rmesa->TexMatEnabled = 0;
-/* Initialize the context's hardware state.
- */
-void radeonInitState( radeonContextPtr rmesa )
-{
- GLcontext *ctx = rmesa->glCtx;
- GLuint color_fmt, depth_fmt;
+ for (unit = 0 ; unit < 2; unit++) {
+ if (!ctx->Texture.Unit[unit]._ReallyEnabled) {
+ }
+ else if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY) {
+ GLuint inputshift = RADEON_TEXGEN_0_INPUT_SHIFT + unit*4;
+
+ rmesa->TexMatEnabled |= (RADEON_TEXGEN_TEXMAT_0_ENABLE|
+ RADEON_TEXMAT_0_ENABLE) << unit;
+
+ if (rmesa->TexGenEnabled & (RADEON_TEXMAT_0_ENABLE << unit)) {
+ /* Need to preconcatenate any active texgen
+ * obj/eyeplane matrices:
+ */
+ _math_matrix_mul_matrix( &rmesa->tmpmat,
+ &rmesa->TexGenMatrix[unit],
+ ctx->TextureMatrixStack[unit].Top );
+ upload_matrix( rmesa, rmesa->tmpmat.m, TEXMAT_0+unit );
+ }
+ else {
+ rmesa->TexMatEnabled |=
+ (RADEON_TEXGEN_INPUT_TEXCOORD_0+unit) << inputshift;
+ upload_matrix( rmesa, ctx->TextureMatrixStack[unit].Top->m,
+ TEXMAT_0+unit );
+ }
+ }
+ else if (rmesa->TexGenEnabled & (RADEON_TEXMAT_0_ENABLE << unit)) {
+ upload_matrix( rmesa, rmesa->TexGenMatrix[unit].m,
+ TEXMAT_0+unit );
+ }
+ }
- switch ( rmesa->radeonScreen->cpp ) {
- case 2:
- color_fmt = RADEON_COLOR_FORMAT_RGB565;
- break;
- case 4:
- color_fmt = RADEON_COLOR_FORMAT_ARGB8888;
- break;
- default:
- fprintf( stderr, "Error: Unsupported pixel depth... exiting\n" );
- exit( -1 );
+
+ tpc = (rmesa->TexMatEnabled | rmesa->TexGenEnabled);
+
+ vs &= ~((0xf << RADEON_TCL_TEX_0_OUTPUT_SHIFT) |
+ (0xf << RADEON_TCL_TEX_1_OUTPUT_SHIFT));
+
+ if (tpc & RADEON_TEXGEN_TEXMAT_0_ENABLE)
+ vs |= RADEON_TCL_TEX_COMPUTED_TEX_0 << RADEON_TCL_TEX_0_OUTPUT_SHIFT;
+ else
+ vs |= RADEON_TCL_TEX_INPUT_TEX_0 << RADEON_TCL_TEX_0_OUTPUT_SHIFT;
+
+ if (tpc & RADEON_TEXGEN_TEXMAT_1_ENABLE)
+ vs |= RADEON_TCL_TEX_COMPUTED_TEX_1 << RADEON_TCL_TEX_1_OUTPUT_SHIFT;
+ else
+ vs |= RADEON_TCL_TEX_INPUT_TEX_1 << RADEON_TCL_TEX_1_OUTPUT_SHIFT;
+
+ if (tpc != rmesa->hw.tcl.cmd[TCL_TEXTURE_PROC_CTL] ||
+ vs != rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL]) {
+
+ RADEON_STATECHANGE(rmesa, tcl);
+ rmesa->hw.tcl.cmd[TCL_TEXTURE_PROC_CTL] = tpc;
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] = vs;
}
+}
- rmesa->state.color.clear = 0x00000000;
- switch ( ctx->Visual.depthBits ) {
- case 16:
- rmesa->state.depth.clear = 0x0000ffff;
- rmesa->state.depth.scale = 1.0 / (GLfloat)0xffff;
- depth_fmt = RADEON_DEPTH_FORMAT_16BIT_INT_Z;
- rmesa->state.stencil.clear = 0x00000000;
- break;
- case 24:
- rmesa->state.depth.clear = 0x00ffffff;
- rmesa->state.depth.scale = 1.0 / (GLfloat)0xffffff;
- depth_fmt = RADEON_DEPTH_FORMAT_24BIT_INT_Z;
- rmesa->state.stencil.clear = 0xffff0000;
- break;
- default:
- fprintf( stderr, "Error: Unsupported depth %d... exiting\n",
- ctx->Visual.depthBits );
- exit( -1 );
+
+void radeonValidateState( GLcontext *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLuint new_state = rmesa->NewGLState;
+
+ if (new_state & _NEW_TEXTURE) {
+ radeonUpdateTextureState( ctx );
+ new_state |= rmesa->NewGLState; /* may add TEXTURE_MATRIX */
}
- /* Only have hw stencil when depth buffer is 24 bits deep */
- rmesa->state.stencil.hwBuffer = ( ctx->Visual.stencilBits > 0 &&
- ctx->Visual.depthBits == 24 );
+ /* Need an event driven matrix update?
+ */
+ if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION))
+ upload_matrix( rmesa, ctx->_ModelProjectMatrix.m, MODEL_PROJ );
- rmesa->RenderIndex = ~0;
- rmesa->Fallback = 0;
- rmesa->render_primitive = GL_TRIANGLES;
- rmesa->hw_primitive = RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST;
+ /* Need these for lighting (shouldn't upload otherwise)
+ */
+ if (new_state & (_NEW_MODELVIEW)) {
+ upload_matrix( rmesa, ctx->ModelviewMatrixStack.Top->m, MODEL );
+ upload_matrix_t( rmesa, ctx->ModelviewMatrixStack.Top->inv, MODEL_IT );
+ }
- if ( ctx->Visual.doubleBufferMode ) {
- rmesa->state.color.drawOffset = rmesa->radeonScreen->backOffset;
- rmesa->state.color.drawPitch = rmesa->radeonScreen->backPitch;
- } else {
- rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset;
- rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch;
+ /* Does this need to be triggered on eg. modelview for
+ * texgen-derived objplane/eyeplane matrices?
+ */
+ if (new_state & _NEW_TEXTURE_MATRIX) {
+ update_texturematrix( ctx );
+ }
+
+ if (new_state & (_NEW_LIGHT|_NEW_MODELVIEW|_MESA_NEW_NEED_EYE_COORDS)) {
+ update_light( ctx );
}
- rmesa->state.pixel.readOffset = rmesa->state.color.drawOffset;
- rmesa->state.pixel.readPitch = rmesa->state.color.drawPitch;
- /* Harware state:
+ /* emit all active clip planes if projection matrix changes.
*/
- rmesa->state.hw.context.pp_misc = (RADEON_ALPHA_TEST_PASS |
- RADEON_CHROMA_FUNC_FAIL |
- RADEON_CHROMA_KEY_NEAREST |
- RADEON_SHADOW_FUNC_EQUAL |
- RADEON_SHADOW_PASS_1 |
- RADEON_RIGHT_HAND_CUBE_OGL);
+ if (new_state & (_NEW_PROJECTION)) {
+ if (ctx->Transform.ClipPlanesEnabled)
+ radeonUpdateClipPlanes( ctx );
+ }
- rmesa->state.hw.context.pp_fog_color = ((0x00000000 & RADEON_FOG_COLOR_MASK) |
- RADEON_FOG_VERTEX |
- RADEON_FOG_USE_DEPTH);
- rmesa->state.hw.context.re_solid_color = 0x00000000;
+ rmesa->NewGLState = 0;
+}
- rmesa->state.hw.context.rb3d_blendcntl = (RADEON_COMB_FCN_ADD_CLAMP |
- RADEON_SRC_BLEND_GL_ONE |
- RADEON_DST_BLEND_GL_ZERO );
- rmesa->state.hw.context.rb3d_depthoffset = rmesa->radeonScreen->depthOffset;
+static void radeonInvalidateState( GLcontext *ctx, GLuint new_state )
+{
+ _swrast_InvalidateState( ctx, new_state );
+ _swsetup_InvalidateState( ctx, new_state );
+ _ac_InvalidateState( ctx, new_state );
+ _tnl_InvalidateState( ctx, new_state );
+ _ae_invalidate_state( ctx, new_state );
+ RADEON_CONTEXT(ctx)->NewGLState |= new_state;
+ radeonVtxfmtInvalidate( ctx );
+}
- rmesa->state.hw.context.rb3d_depthpitch = ((rmesa->radeonScreen->depthPitch &
- RADEON_DEPTHPITCH_MASK) |
- RADEON_DEPTH_ENDIAN_NO_SWAP);
+static void radeonWrapRunPipeline( GLcontext *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
- rmesa->state.hw.context.rb3d_zstencilcntl = (depth_fmt |
- RADEON_Z_TEST_LESS |
- RADEON_STENCIL_TEST_ALWAYS |
- RADEON_STENCIL_FAIL_KEEP |
- RADEON_STENCIL_ZPASS_KEEP |
- RADEON_STENCIL_ZFAIL_KEEP |
- RADEON_Z_WRITE_ENABLE);
+ if (0)
+ fprintf(stderr, "%s, newstate: %x\n", __FUNCTION__, rmesa->NewGLState);
- rmesa->state.hw.context.pp_cntl = (RADEON_SCISSOR_ENABLE |
- RADEON_ANTI_ALIAS_NONE);
+ /* Validate state:
+ */
+ if (rmesa->NewGLState)
+ radeonValidateState( ctx );
- rmesa->state.hw.context.rb3d_cntl = (RADEON_PLANE_MASK_ENABLE |
- color_fmt |
- RADEON_ZBLOCK16);
+ if (tnl->vb.Material) {
+ TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_MATERIAL, GL_TRUE );
+ }
- rmesa->state.hw.context.rb3d_coloroffset = (rmesa->state.color.drawOffset &
- RADEON_COLOROFFSET_MASK);
+ /* Run the pipeline.
+ */
+ _tnl_run_pipeline( ctx );
- rmesa->state.hw.context.re_width_height = ((0x7ff << RADEON_RE_WIDTH_SHIFT) |
- (0x7ff << RADEON_RE_HEIGHT_SHIFT));
-
- rmesa->state.hw.context.rb3d_colorpitch = ((rmesa->state.color.drawPitch &
- RADEON_COLORPITCH_MASK) |
- RADEON_COLOR_ENDIAN_NO_SWAP);
-
- rmesa->state.hw.setup1.se_cntl = (RADEON_FFACE_CULL_CCW |
- RADEON_BFACE_SOLID |
- RADEON_FFACE_SOLID |
- RADEON_FLAT_SHADE_VTX_LAST |
- RADEON_DIFFUSE_SHADE_GOURAUD |
- RADEON_ALPHA_SHADE_GOURAUD |
- RADEON_SPECULAR_SHADE_GOURAUD |
- RADEON_FOG_SHADE_GOURAUD |
- RADEON_VPORT_XY_XFORM_ENABLE |
- RADEON_VPORT_Z_XFORM_ENABLE |
- RADEON_VTX_PIX_CENTER_OGL |
- RADEON_ROUND_MODE_TRUNC |
- RADEON_ROUND_PREC_8TH_PIX);
-
- rmesa->state.hw.vertex.se_coord_fmt = (
-#if 1
- RADEON_VTX_XY_PRE_MULT_1_OVER_W0 |
- RADEON_VTX_Z_PRE_MULT_1_OVER_W0 |
-#else
- RADEON_VTX_W0_IS_NOT_1_OVER_W0 |
-#endif
- RADEON_TEX1_W_ROUTING_USE_Q1);
-
- rmesa->state.hw.setup2.se_cntl_status = (RADEON_VC_NO_SWAP |
- RADEON_TCL_BYPASS);
-
- rmesa->state.hw.line.re_line_pattern = ((0x0000 & RADEON_LINE_PATTERN_MASK) |
- (0 << RADEON_LINE_REPEAT_COUNT_SHIFT) |
- (0 << RADEON_LINE_PATTERN_START_SHIFT) |
- RADEON_LINE_PATTERN_LITTLE_BIT_ORDER);
-
- rmesa->state.hw.line.re_line_state = ((0 << RADEON_LINE_CURRENT_PTR_SHIFT) |
- (1 << RADEON_LINE_CURRENT_COUNT_SHIFT));
-
- rmesa->state.hw.line.se_line_width = (1 << 4);
-
- rmesa->state.hw.bumpmap.pp_lum_matrix = 0x00000000;
- rmesa->state.hw.bumpmap.pp_rot_matrix_0 = 0x00000000;
- rmesa->state.hw.bumpmap.pp_rot_matrix_1 = 0x00000000;
-
- rmesa->state.hw.mask.rb3d_stencilrefmask = ((0x00 << RADEON_STENCIL_REF_SHIFT) |
- (0xff << RADEON_STENCIL_MASK_SHIFT) |
- (0xff << RADEON_STENCIL_WRITEMASK_SHIFT));
-
- rmesa->state.hw.mask.rb3d_ropcntl = RADEON_ROP_COPY;
- rmesa->state.hw.mask.rb3d_planemask = 0xffffffff;
-
- rmesa->state.hw.viewport.se_vport_xscale = 0x00000000;
- rmesa->state.hw.viewport.se_vport_xoffset = 0x00000000;
- rmesa->state.hw.viewport.se_vport_yscale = 0x00000000;
- rmesa->state.hw.viewport.se_vport_yoffset = 0x00000000;
- rmesa->state.hw.viewport.se_vport_zscale = 0x00000000;
- rmesa->state.hw.viewport.se_vport_zoffset = 0x00000000;
-
- rmesa->state.hw.misc.re_misc = ((0 << RADEON_STIPPLE_X_OFFSET_SHIFT) |
- (0 << RADEON_STIPPLE_Y_OFFSET_SHIFT) |
- RADEON_STIPPLE_BIG_BIT_ORDER);
-
- rmesa->state.hw.dirty = RADEON_UPLOAD_CONTEXT_ALL;
+ if (tnl->vb.Material) {
+ TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_MATERIAL, GL_FALSE );
+ radeonUpdateMaterial( ctx ); /* not needed any more? */
+ }
}
+
+
+
/* Initialize the driver's state functions.
*/
void radeonInitStateFuncs( GLcontext *ctx )
{
ctx->Driver.UpdateState = radeonInvalidateState;
+ ctx->Driver.LightingSpaceChange = radeonLightingSpaceChange;
- ctx->Driver.SetDrawBuffer = radeonSetDrawBuffer;
+ ctx->Driver.DrawBuffer = radeonDrawBuffer;
+ ctx->Driver.ReadBuffer = radeonReadBuffer;
ctx->Driver.AlphaFunc = radeonAlphaFunc;
ctx->Driver.BlendEquation = radeonBlendEquation;
@@ -1304,6 +2114,7 @@ void radeonInitStateFuncs( GLcontext *ctx )
ctx->Driver.ClearDepth = radeonClearDepth;
ctx->Driver.ClearIndex = NULL;
ctx->Driver.ClearStencil = radeonClearStencil;
+ ctx->Driver.ClipPlane = radeonClipPlane;
ctx->Driver.ColorMask = radeonColorMask;
ctx->Driver.CullFace = radeonCullFace;
ctx->Driver.DepthFunc = radeonDepthFunc;
@@ -1315,12 +2126,15 @@ void radeonInitStateFuncs( GLcontext *ctx )
ctx->Driver.Hint = NULL;
ctx->Driver.IndexMask = NULL;
ctx->Driver.LightModelfv = radeonLightModelfv;
- ctx->Driver.Lightfv = NULL;
+ ctx->Driver.Lightfv = radeonLightfv;
ctx->Driver.LineStipple = radeonLineStipple;
ctx->Driver.LineWidth = radeonLineWidth;
ctx->Driver.LogicOpcode = radeonLogicOpCode;
- ctx->Driver.PolygonMode = NULL;
- ctx->Driver.PolygonOffset = radeonPolygonOffset;
+ ctx->Driver.PolygonMode = radeonPolygonMode;
+
+ if (RADEON_CONTEXT(ctx)->dri.drmMinor > 1)
+ ctx->Driver.PolygonOffset = radeonPolygonOffset;
+
ctx->Driver.PolygonStipple = radeonPolygonStipple;
ctx->Driver.RenderMode = radeonRenderMode;
ctx->Driver.Scissor = radeonScissor;
@@ -1337,7 +2151,6 @@ void radeonInitStateFuncs( GLcontext *ctx )
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:
*/
@@ -1345,4 +2158,7 @@ void radeonInitStateFuncs( GLcontext *ctx )
ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
+
+ TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange = radeonUpdateMaterial;
+ TNL_CONTEXT(ctx)->Driver.RunPipeline = radeonWrapRunPipeline;
}
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_state.h b/xc/lib/GL/mesa/src/drv/radeon/radeon_state.h
index b34e17133..f05c676ec 100644
--- a/xc/lib/GL/mesa/src/drv/radeon/radeon_state.h
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_state.h
@@ -44,20 +44,33 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
extern void radeonInitState( radeonContextPtr rmesa );
extern void radeonInitStateFuncs( GLcontext *ctx );
-extern void radeonUpdateWindow( GLcontext *ctx );
+extern void radeonUpdateMaterial( GLcontext *ctx );
+
extern void radeonSetCliprects( radeonContextPtr rmesa, GLenum mode );
+extern void radeonRecalcScissorRects( radeonContextPtr rmesa );
extern void radeonUpdateViewportOffset( GLcontext *ctx );
+extern void radeonUpdateWindow( GLcontext *ctx );
-extern void radeonPrintDirty( const char *msg, GLuint state );
+extern void radeonValidateState( GLcontext *ctx );
+
+extern void radeonPrintDirty( radeonContextPtr rmesa,
+ const char *msg );
extern void radeonFallback( GLcontext *ctx, GLuint bit, GLboolean mode );
#define FALLBACK( rmesa, bit, mode ) do { \
- if ( 0 ) fprintf( stderr, "FALLBACK in %s: #%d=%d\n",__FUNCTION__, \
- bit, mode ); \
+ if ( 0 ) fprintf( stderr, "FALLBACK in %s: #%d=%d\n", \
+ __FUNCTION__, bit, mode ); \
radeonFallback( rmesa->glCtx, bit, mode ); \
} while (0)
+#define MODEL_PROJ 0
+#define MODEL 1
+#define MODEL_IT 2
+#define TEXMAT_0 3
+#define TEXMAT_1 4
+#define TEXMAT_2 5
+
#endif
#endif
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_state_init.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_state_init.c
new file mode 100644
index 000000000..51475a3bb
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_state_init.c
@@ -0,0 +1,558 @@
+/* $XFree86$ */
+/*
+ * Copyright 2000, 2001 VA Linux Systems Inc., Fremont, California.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Gareth Hughes <gareth@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "mmath.h"
+#include "api_arrayelt.h"
+
+#include "swrast/swrast.h"
+#include "array_cache/acache.h"
+#include "tnl/tnl.h"
+#include "tnl/t_pipeline.h"
+#include "swrast_setup/swrast_setup.h"
+
+#include "radeon_context.h"
+#include "radeon_ioctl.h"
+#include "radeon_state.h"
+#include "radeon_tcl.h"
+#include "radeon_tex.h"
+#include "radeon_swtcl.h"
+#include "radeon_vtxfmt.h"
+
+/* =============================================================
+ * State initialization
+ */
+
+void radeonPrintDirty( radeonContextPtr rmesa, const char *msg )
+{
+ struct radeon_state_atom *l;
+
+ fprintf(stderr, msg);
+ fprintf(stderr, ": ");
+
+ foreach(l, &(rmesa->hw.dirty)) {
+ fprintf(stderr, "%s, ", l->name);
+ }
+
+ fprintf(stderr, "\n");
+}
+
+static int cmdpkt( int id )
+{
+ drmRadeonCmdHeader h;
+ h.i = 0;
+ h.packet.cmd_type = RADEON_CMD_PACKET;
+ h.packet.packet_id = id;
+ return h.i;
+}
+
+static int cmdvec( int offset, int stride, int count )
+{
+ drmRadeonCmdHeader h;
+ h.i = 0;
+ h.vectors.cmd_type = RADEON_CMD_VECTORS;
+ h.vectors.offset = offset;
+ h.vectors.stride = stride;
+ h.vectors.count = count;
+ return h.i;
+}
+
+static int cmdscl( int offset, int stride, int count )
+{
+ drmRadeonCmdHeader h;
+ h.i = 0;
+ h.scalars.cmd_type = RADEON_CMD_SCALARS;
+ h.scalars.offset = offset;
+ h.scalars.stride = stride;
+ h.scalars.count = count;
+ return h.i;
+}
+
+#define CHECK( NM, FLAG ) \
+static GLboolean check_##NM( GLcontext *ctx ) \
+{ \
+ return FLAG; \
+}
+
+#define TCL_CHECK( NM, FLAG ) \
+static GLboolean check_##NM( GLcontext *ctx ) \
+{ \
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \
+ return !rmesa->TclFallback && (FLAG); \
+}
+
+
+CHECK( always, GL_TRUE )
+CHECK( tex0, ctx->Texture.Unit[0]._ReallyEnabled )
+CHECK( tex1, ctx->Texture.Unit[1]._ReallyEnabled )
+CHECK( fog, ctx->Fog.Enabled )
+TCL_CHECK( tcl, GL_TRUE )
+TCL_CHECK( tcl_tex0, ctx->Texture.Unit[0]._ReallyEnabled )
+TCL_CHECK( tcl_tex1, ctx->Texture.Unit[1]._ReallyEnabled )
+TCL_CHECK( tcl_lighting, ctx->Light.Enabled )
+TCL_CHECK( tcl_eyespace_or_lighting, ctx->_NeedEyeCoords || ctx->Light.Enabled )
+TCL_CHECK( tcl_lit0, ctx->Light.Enabled && ctx->Light.Light[0].Enabled )
+TCL_CHECK( tcl_lit1, ctx->Light.Enabled && ctx->Light.Light[1].Enabled )
+TCL_CHECK( tcl_lit2, ctx->Light.Enabled && ctx->Light.Light[2].Enabled )
+TCL_CHECK( tcl_lit3, ctx->Light.Enabled && ctx->Light.Light[3].Enabled )
+TCL_CHECK( tcl_lit4, ctx->Light.Enabled && ctx->Light.Light[4].Enabled )
+TCL_CHECK( tcl_lit5, ctx->Light.Enabled && ctx->Light.Light[5].Enabled )
+TCL_CHECK( tcl_lit6, ctx->Light.Enabled && ctx->Light.Light[6].Enabled )
+TCL_CHECK( tcl_lit7, ctx->Light.Enabled && ctx->Light.Light[7].Enabled )
+TCL_CHECK( tcl_ucp0, (ctx->Transform.ClipPlanesEnabled & 0x1) )
+TCL_CHECK( tcl_ucp1, (ctx->Transform.ClipPlanesEnabled & 0x2) )
+TCL_CHECK( tcl_ucp2, (ctx->Transform.ClipPlanesEnabled & 0x4) )
+TCL_CHECK( tcl_ucp3, (ctx->Transform.ClipPlanesEnabled & 0x8) )
+TCL_CHECK( tcl_ucp4, (ctx->Transform.ClipPlanesEnabled & 0x10) )
+TCL_CHECK( tcl_ucp5, (ctx->Transform.ClipPlanesEnabled & 0x20) )
+TCL_CHECK( tcl_eyespace_or_fog, ctx->_NeedEyeCoords || ctx->Fog.Enabled )
+
+
+
+/* Initialize the context's hardware state.
+ */
+void radeonInitState( radeonContextPtr rmesa )
+{
+ GLcontext *ctx = rmesa->glCtx;
+ GLuint color_fmt, depth_fmt, i;
+
+ switch ( rmesa->radeonScreen->cpp ) {
+ case 2:
+ color_fmt = RADEON_COLOR_FORMAT_RGB565;
+ break;
+ case 4:
+ color_fmt = RADEON_COLOR_FORMAT_ARGB8888;
+ break;
+ default:
+ fprintf( stderr, "Error: Unsupported pixel depth... exiting\n" );
+ exit( -1 );
+ }
+
+ rmesa->state.color.clear = 0x00000000;
+
+ switch ( ctx->Visual.depthBits ) {
+ case 16:
+ rmesa->state.depth.clear = 0x0000ffff;
+ rmesa->state.depth.scale = 1.0 / (GLfloat)0xffff;
+ depth_fmt = RADEON_DEPTH_FORMAT_16BIT_INT_Z;
+ rmesa->state.stencil.clear = 0x00000000;
+ break;
+ case 24:
+ rmesa->state.depth.clear = 0x00ffffff;
+ rmesa->state.depth.scale = 1.0 / (GLfloat)0xffffff;
+ depth_fmt = RADEON_DEPTH_FORMAT_24BIT_INT_Z;
+ rmesa->state.stencil.clear = 0xff000000;
+ break;
+ default:
+ fprintf( stderr, "Error: Unsupported depth %d... exiting\n",
+ ctx->Visual.depthBits );
+ exit( -1 );
+ }
+
+ /* Only have hw stencil when depth buffer is 24 bits deep */
+ rmesa->state.stencil.hwBuffer = ( ctx->Visual.stencilBits > 0 &&
+ ctx->Visual.depthBits == 24 );
+
+ rmesa->Fallback = 0;
+
+ if ( ctx->Visual.doubleBufferMode && rmesa->sarea->pfCurrentPage == 0 ) {
+ rmesa->state.color.drawOffset = rmesa->radeonScreen->backOffset;
+ rmesa->state.color.drawPitch = rmesa->radeonScreen->backPitch;
+ } else {
+ rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset;
+ rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch;
+ }
+ rmesa->state.pixel.readOffset = rmesa->state.color.drawOffset;
+ rmesa->state.pixel.readPitch = rmesa->state.color.drawPitch;
+
+ /* Initialize lists:
+ */
+ make_empty_list(&(rmesa->hw.dirty));
+ make_empty_list(&(rmesa->hw.clean));
+
+
+#define ALLOC_STATE( ATOM, CHK, SZ, NM, FLAG ) \
+ do { \
+ rmesa->hw.ATOM.cmd_size = SZ; \
+ rmesa->hw.ATOM.cmd = (int *)CALLOC(SZ * sizeof(int)); \
+ rmesa->hw.ATOM.lastcmd = (int *)CALLOC(SZ * sizeof(int)); \
+ rmesa->hw.ATOM.name = NM; \
+ rmesa->hw.ATOM.is_tcl = FLAG; \
+ rmesa->hw.ATOM.check = check_##CHK; \
+ insert_at_head(&(rmesa->hw.dirty), &(rmesa->hw.ATOM)); \
+ } while (0)
+
+
+ /* Allocate state buffers:
+ */
+ ALLOC_STATE( ctx, always, CTX_STATE_SIZE, "CTX/context", 0 );
+ ALLOC_STATE( lin, always, LIN_STATE_SIZE, "LIN/line", 0 );
+ ALLOC_STATE( msk, always, MSK_STATE_SIZE, "MSK/mask", 0 );
+ ALLOC_STATE( vpt, always, VPT_STATE_SIZE, "VPT/viewport", 0 );
+ ALLOC_STATE( set, always, SET_STATE_SIZE, "SET/setup", 0 );
+ ALLOC_STATE( msc, always, MSC_STATE_SIZE, "MSC/misc", 0 );
+ ALLOC_STATE( zbs, always, ZBS_STATE_SIZE, "ZBS/zbias", 0 );
+ ALLOC_STATE( tcl, always, TCL_STATE_SIZE, "TCL/tcl", 1 );
+ ALLOC_STATE( mtl, tcl_lighting, MTL_STATE_SIZE, "MTL/material", 1 );
+ ALLOC_STATE( grd, always, GRD_STATE_SIZE, "GRD/guard-band", 1 );
+ ALLOC_STATE( fog, fog, FOG_STATE_SIZE, "FOG/fog", 1 );
+ ALLOC_STATE( glt, tcl_lighting, GLT_STATE_SIZE, "GLT/light-global", 1 );
+ ALLOC_STATE( eye, tcl_lighting, EYE_STATE_SIZE, "EYE/eye-vector", 1 );
+ ALLOC_STATE( tex[0], tex0, TEX_STATE_SIZE, "TEX/tex-0", 0 );
+ ALLOC_STATE( tex[1], tex1, TEX_STATE_SIZE, "TEX/tex-1", 0 );
+ ALLOC_STATE( mat[0], tcl, MAT_STATE_SIZE, "MAT/modelproject", 1 );
+ ALLOC_STATE( mat[1], tcl_eyespace_or_fog, MAT_STATE_SIZE, "MAT/modelview", 1 );
+ ALLOC_STATE( mat[2], tcl_eyespace_or_lighting, MAT_STATE_SIZE, "MAT/it-modelview", 1 );
+ ALLOC_STATE( mat[3], tcl_tex0, MAT_STATE_SIZE, "MAT/texmat0", 1 );
+ ALLOC_STATE( mat[4], tcl_tex1, MAT_STATE_SIZE, "MAT/texmat1", 1 );
+ ALLOC_STATE( ucp[0], tcl_ucp0, UCP_STATE_SIZE, "UCP/userclip-0", 1 );
+ ALLOC_STATE( ucp[1], tcl_ucp1, UCP_STATE_SIZE, "UCP/userclip-1", 1 );
+ ALLOC_STATE( ucp[2], tcl_ucp2, UCP_STATE_SIZE, "UCP/userclip-2", 1 );
+ ALLOC_STATE( ucp[3], tcl_ucp3, UCP_STATE_SIZE, "UCP/userclip-3", 1 );
+ ALLOC_STATE( ucp[4], tcl_ucp4, UCP_STATE_SIZE, "UCP/userclip-4", 1 );
+ ALLOC_STATE( ucp[5], tcl_ucp5, UCP_STATE_SIZE, "UCP/userclip-5", 1 );
+ ALLOC_STATE( lit[0], tcl_lit0, LIT_STATE_SIZE, "LIT/light-0", 1 );
+ ALLOC_STATE( lit[1], tcl_lit1, LIT_STATE_SIZE, "LIT/light-1", 1 );
+ ALLOC_STATE( lit[2], tcl_lit2, LIT_STATE_SIZE, "LIT/light-2", 1 );
+ ALLOC_STATE( lit[3], tcl_lit3, LIT_STATE_SIZE, "LIT/light-3", 1 );
+ ALLOC_STATE( lit[4], tcl_lit4, LIT_STATE_SIZE, "LIT/light-4", 1 );
+ ALLOC_STATE( lit[5], tcl_lit5, LIT_STATE_SIZE, "LIT/light-5", 1 );
+ ALLOC_STATE( lit[6], tcl_lit6, LIT_STATE_SIZE, "LIT/light-6", 1 );
+ ALLOC_STATE( lit[7], tcl_lit7, LIT_STATE_SIZE, "LIT/light-7", 1 );
+
+
+ /* Fill in the packet headers:
+ */
+ rmesa->hw.ctx.cmd[CTX_CMD_0] = cmdpkt(RADEON_EMIT_PP_MISC);
+ rmesa->hw.ctx.cmd[CTX_CMD_1] = cmdpkt(RADEON_EMIT_PP_CNTL);
+ rmesa->hw.ctx.cmd[CTX_CMD_2] = cmdpkt(RADEON_EMIT_RB3D_COLORPITCH);
+ rmesa->hw.lin.cmd[LIN_CMD_0] = cmdpkt(RADEON_EMIT_RE_LINE_PATTERN);
+ rmesa->hw.lin.cmd[LIN_CMD_1] = cmdpkt(RADEON_EMIT_SE_LINE_WIDTH);
+ rmesa->hw.msk.cmd[MSK_CMD_0] = cmdpkt(RADEON_EMIT_RB3D_STENCILREFMASK);
+ rmesa->hw.vpt.cmd[VPT_CMD_0] = cmdpkt(RADEON_EMIT_SE_VPORT_XSCALE);
+ rmesa->hw.set.cmd[SET_CMD_0] = cmdpkt(RADEON_EMIT_SE_CNTL);
+ rmesa->hw.set.cmd[SET_CMD_1] = cmdpkt(RADEON_EMIT_SE_CNTL_STATUS);
+ rmesa->hw.msc.cmd[MSC_CMD_0] = cmdpkt(RADEON_EMIT_RE_MISC);
+ rmesa->hw.tex[0].cmd[TEX_CMD_0] = cmdpkt(RADEON_EMIT_PP_TXFILTER_0);
+ rmesa->hw.tex[0].cmd[TEX_CMD_1] = cmdpkt(RADEON_EMIT_PP_BORDER_COLOR_0);
+ rmesa->hw.tex[1].cmd[TEX_CMD_0] = cmdpkt(RADEON_EMIT_PP_TXFILTER_1);
+ rmesa->hw.tex[1].cmd[TEX_CMD_1] = cmdpkt(RADEON_EMIT_PP_BORDER_COLOR_1);
+ rmesa->hw.zbs.cmd[ZBS_CMD_0] = cmdpkt(RADEON_EMIT_SE_ZBIAS_FACTOR);
+ rmesa->hw.tcl.cmd[TCL_CMD_0] = cmdpkt(RADEON_EMIT_SE_TCL_OUTPUT_VTX_FMT);
+ rmesa->hw.mtl.cmd[MTL_CMD_0] =
+ cmdpkt(RADEON_EMIT_SE_TCL_MATERIAL_EMMISSIVE_RED);
+ rmesa->hw.grd.cmd[GRD_CMD_0] =
+ cmdscl( RADEON_SS_VERT_GUARD_CLIP_ADJ_ADDR, 1, 4 );
+ rmesa->hw.fog.cmd[FOG_CMD_0] =
+ cmdvec( RADEON_VS_FOG_PARAM_ADDR, 1, 4 );
+ rmesa->hw.glt.cmd[GLT_CMD_0] =
+ cmdvec( RADEON_VS_GLOBAL_AMBIENT_ADDR, 1, 4 );
+ rmesa->hw.eye.cmd[EYE_CMD_0] =
+ cmdvec( RADEON_VS_EYE_VECTOR_ADDR, 1, 4 );
+
+ for (i = 0 ; i < 5; i++) {
+ rmesa->hw.mat[i].cmd[MAT_CMD_0] =
+ cmdvec( RADEON_VS_MATRIX_0_ADDR + i*4, 1, 16);
+ }
+
+ for (i = 0 ; i < 8; i++) {
+ rmesa->hw.lit[i].cmd[LIT_CMD_0] =
+ cmdvec( RADEON_VS_LIGHT_AMBIENT_ADDR + i, 8, 24 );
+ rmesa->hw.lit[i].cmd[LIT_CMD_1] =
+ cmdscl( RADEON_SS_LIGHT_DCD_ADDR + i, 8, 6 );
+ }
+
+ for (i = 0 ; i < 6; i++) {
+ rmesa->hw.ucp[i].cmd[UCP_CMD_0] =
+ cmdvec( RADEON_VS_UCP_ADDR + i, 1, 4 );
+ }
+
+ rmesa->last_ReallyEnabled = -1;
+
+ /* Initial Harware state:
+ */
+ rmesa->hw.ctx.cmd[CTX_PP_MISC] = (RADEON_ALPHA_TEST_PASS |
+ RADEON_CHROMA_FUNC_FAIL |
+ RADEON_CHROMA_KEY_NEAREST |
+ RADEON_SHADOW_FUNC_EQUAL |
+ RADEON_SHADOW_PASS_1 |
+ RADEON_RIGHT_HAND_CUBE_OGL);
+
+ rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] = (RADEON_FOG_VERTEX |
+ RADEON_FOG_USE_DEPTH);
+
+ rmesa->hw.ctx.cmd[CTX_RE_SOLID_COLOR] = 0x00000000;
+
+ rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] = (RADEON_COMB_FCN_ADD_CLAMP |
+ RADEON_SRC_BLEND_GL_ONE |
+ RADEON_DST_BLEND_GL_ZERO );
+
+ rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHOFFSET] =
+ rmesa->radeonScreen->depthOffset;
+
+ rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHPITCH] =
+ ((rmesa->radeonScreen->depthPitch &
+ RADEON_DEPTHPITCH_MASK) |
+ RADEON_DEPTH_ENDIAN_NO_SWAP);
+
+ rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] = (depth_fmt |
+ RADEON_Z_TEST_LESS |
+ RADEON_STENCIL_TEST_ALWAYS |
+ RADEON_STENCIL_FAIL_KEEP |
+ RADEON_STENCIL_ZPASS_KEEP |
+ RADEON_STENCIL_ZFAIL_KEEP |
+ RADEON_Z_WRITE_ENABLE);
+
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] = (RADEON_SCISSOR_ENABLE |
+ RADEON_ANTI_ALIAS_NONE);
+
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] = (RADEON_PLANE_MASK_ENABLE |
+ color_fmt |
+ (1<<15));
+
+ rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_DITHER_ENABLE;
+
+ rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = (rmesa->state.color.drawOffset &
+ RADEON_COLOROFFSET_MASK);
+
+ rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = ((rmesa->state.color.drawPitch &
+ RADEON_COLORPITCH_MASK) |
+ RADEON_COLOR_ENDIAN_NO_SWAP);
+
+ rmesa->hw.set.cmd[SET_SE_CNTL] = (RADEON_FFACE_CULL_CCW |
+ RADEON_BFACE_SOLID |
+ RADEON_FFACE_SOLID |
+/* RADEON_BADVTX_CULL_DISABLE | */
+ RADEON_FLAT_SHADE_VTX_LAST |
+ RADEON_DIFFUSE_SHADE_GOURAUD |
+ RADEON_ALPHA_SHADE_GOURAUD |
+ RADEON_SPECULAR_SHADE_GOURAUD |
+ RADEON_FOG_SHADE_GOURAUD |
+ RADEON_VPORT_XY_XFORM_ENABLE |
+ RADEON_VPORT_Z_XFORM_ENABLE |
+ RADEON_VTX_PIX_CENTER_OGL |
+ RADEON_ROUND_MODE_TRUNC |
+ RADEON_ROUND_PREC_8TH_PIX);
+
+ rmesa->hw.set.cmd[SET_SE_CNTL_STATUS] =
+#ifdef MESA_BIG_ENDIAN
+ RADEON_VC_32BIT_SWAP;
+#else
+ RADEON_VC_NO_SWAP;
+#endif
+
+ if (!(rmesa->radeonScreen->chipset & RADEON_CHIPSET_TCL)) {
+ rmesa->hw.set.cmd[SET_SE_CNTL_STATUS] |= RADEON_TCL_BYPASS;
+ }
+
+ rmesa->hw.set.cmd[SET_SE_COORDFMT] = (
+ RADEON_VTX_W0_IS_NOT_1_OVER_W0 |
+ RADEON_TEX1_W_ROUTING_USE_Q1);
+
+
+ rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] =
+ ((0x0000 & RADEON_LINE_PATTERN_MASK) |
+ (0 << RADEON_LINE_REPEAT_COUNT_SHIFT) |
+ (0 << RADEON_LINE_PATTERN_START_SHIFT) |
+ RADEON_LINE_PATTERN_LITTLE_BIT_ORDER);
+
+ rmesa->hw.lin.cmd[LIN_RE_LINE_STATE] =
+ ((0 << RADEON_LINE_CURRENT_PTR_SHIFT) |
+ (1 << RADEON_LINE_CURRENT_COUNT_SHIFT));
+
+ rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] = (1 << 4);
+
+ rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] =
+ ((0x00 << RADEON_STENCIL_REF_SHIFT) |
+ (0xff << RADEON_STENCIL_MASK_SHIFT) |
+ (0xff << RADEON_STENCIL_WRITEMASK_SHIFT));
+
+ rmesa->hw.msk.cmd[MSK_RB3D_ROPCNTL] = RADEON_ROP_COPY;
+ rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK] = 0xffffffff;
+
+ rmesa->hw.msc.cmd[MSC_RE_MISC] =
+ ((0 << RADEON_STIPPLE_X_OFFSET_SHIFT) |
+ (0 << RADEON_STIPPLE_Y_OFFSET_SHIFT) |
+ RADEON_STIPPLE_BIG_BIT_ORDER);
+
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_XSCALE] = 0x00000000;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] = 0x00000000;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_YSCALE] = 0x00000000;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] = 0x00000000;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZSCALE] = 0x00000000;
+ rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZOFFSET] = 0x00000000;
+
+ rmesa->hw.tex[0].cmd[TEX_PP_TXFILTER] = RADEON_BORDER_MODE_OGL;
+ rmesa->hw.tex[0].cmd[TEX_PP_TXFORMAT] =
+ (RADEON_TXFORMAT_ENDIAN_NO_SWAP |
+ RADEON_TXFORMAT_PERSPECTIVE_ENABLE |
+ RADEON_TXFORMAT_ST_ROUTE_STQ0 |
+ (2 << RADEON_TXFORMAT_WIDTH_SHIFT) |
+ (2 << RADEON_TXFORMAT_HEIGHT_SHIFT));
+ rmesa->hw.tex[0].cmd[TEX_PP_TXOFFSET] = 0x2000;
+ rmesa->hw.tex[0].cmd[TEX_PP_BORDER_COLOR] = 0;
+ rmesa->hw.tex[0].cmd[TEX_PP_TXCBLEND] =
+ (RADEON_COLOR_ARG_A_ZERO |
+ RADEON_COLOR_ARG_B_ZERO |
+ RADEON_COLOR_ARG_C_CURRENT_COLOR |
+ RADEON_BLEND_CTL_ADD |
+ RADEON_SCALE_1X |
+ RADEON_CLAMP_TX);
+ rmesa->hw.tex[0].cmd[TEX_PP_TXABLEND] =
+ (RADEON_ALPHA_ARG_A_ZERO |
+ RADEON_ALPHA_ARG_B_ZERO |
+ RADEON_ALPHA_ARG_C_CURRENT_ALPHA |
+ RADEON_BLEND_CTL_ADD |
+ RADEON_SCALE_1X |
+ RADEON_CLAMP_TX);
+ rmesa->hw.tex[0].cmd[TEX_PP_TFACTOR] = 0;
+
+ rmesa->hw.tex[1].cmd[TEX_PP_TXFILTER] = RADEON_BORDER_MODE_OGL;
+ rmesa->hw.tex[1].cmd[TEX_PP_TXFORMAT] =
+ (RADEON_TXFORMAT_ENDIAN_NO_SWAP |
+ RADEON_TXFORMAT_PERSPECTIVE_ENABLE |
+ RADEON_TXFORMAT_ST_ROUTE_STQ1 |
+ (2 << RADEON_TXFORMAT_WIDTH_SHIFT) |
+ (2 << RADEON_TXFORMAT_HEIGHT_SHIFT));
+ rmesa->hw.tex[1].cmd[TEX_PP_TXOFFSET] = 0x8000;
+ rmesa->hw.tex[1].cmd[TEX_PP_BORDER_COLOR] = 0;
+ rmesa->hw.tex[1].cmd[TEX_PP_TXCBLEND] =
+ (RADEON_COLOR_ARG_A_ZERO |
+ RADEON_COLOR_ARG_B_ZERO |
+ RADEON_COLOR_ARG_C_CURRENT_COLOR |
+ RADEON_BLEND_CTL_ADD |
+ RADEON_SCALE_1X |
+ RADEON_CLAMP_TX);
+ rmesa->hw.tex[1].cmd[TEX_PP_TXABLEND] =
+ (RADEON_ALPHA_ARG_A_ZERO |
+ RADEON_ALPHA_ARG_B_ZERO |
+ RADEON_ALPHA_ARG_C_CURRENT_ALPHA |
+ RADEON_BLEND_CTL_ADD |
+ RADEON_SCALE_1X |
+ RADEON_CLAMP_TX);
+ rmesa->hw.tex[1].cmd[TEX_PP_TFACTOR] = 0;
+
+ /* Can oly add ST1 at the time of doing some multitex but can keep
+ * it after that. Errors if DIFFUSE is missing.
+ */
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] =
+ (RADEON_TCL_VTX_Z0 |
+ RADEON_TCL_VTX_W0 |
+ RADEON_TCL_VTX_PK_DIFFUSE
+ ); /* need to keep this uptodate */
+
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] =
+ ( RADEON_TCL_COMPUTE_XYZW |
+ (RADEON_TCL_TEX_INPUT_TEX_0 << RADEON_TCL_TEX_0_OUTPUT_SHIFT) |
+ (RADEON_TCL_TEX_INPUT_TEX_1 << RADEON_TCL_TEX_1_OUTPUT_SHIFT) |
+ (RADEON_TCL_TEX_INPUT_TEX_2 << RADEON_TCL_TEX_2_OUTPUT_SHIFT));
+
+
+ /* XXX */
+ rmesa->hw.tcl.cmd[TCL_MATRIX_SELECT_0] =
+ ((MODEL << RADEON_MODELVIEW_0_SHIFT) |
+ (MODEL_IT << RADEON_IT_MODELVIEW_0_SHIFT));
+
+ rmesa->hw.tcl.cmd[TCL_MATRIX_SELECT_1] =
+ ((MODEL_PROJ << RADEON_MODELPROJECT_0_SHIFT) |
+ (TEXMAT_0 << RADEON_TEXMAT_0_SHIFT) |
+ (TEXMAT_1 << RADEON_TEXMAT_1_SHIFT));
+
+ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] =
+ (RADEON_UCP_IN_CLIP_SPACE |
+ RADEON_CULL_FRONT_IS_CCW);
+
+ rmesa->hw.tcl.cmd[TCL_TEXTURE_PROC_CTL] = 0;
+
+ rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] =
+ (RADEON_SPECULAR_LIGHTS |
+ RADEON_DIFFUSE_SPECULAR_COMBINE |
+ RADEON_LOCAL_LIGHT_VEC_GL |
+ (RADEON_LM_SOURCE_STATE_PREMULT << RADEON_EMISSIVE_SOURCE_SHIFT) |
+ (RADEON_LM_SOURCE_STATE_PREMULT << RADEON_AMBIENT_SOURCE_SHIFT) |
+ (RADEON_LM_SOURCE_STATE_PREMULT << RADEON_DIFFUSE_SOURCE_SHIFT) |
+ (RADEON_LM_SOURCE_STATE_PREMULT << RADEON_SPECULAR_SOURCE_SHIFT));
+
+ for (i = 0 ; i < 8; i++) {
+ struct gl_light *l = &ctx->Light.Light[i];
+ GLenum p = GL_LIGHT0 + i;
+ *(float *)&(rmesa->hw.lit[i].cmd[LIT_RANGE_CUTOFF]) = FLT_MAX;
+
+ ctx->Driver.Lightfv( ctx, p, GL_AMBIENT, l->Ambient );
+ ctx->Driver.Lightfv( ctx, p, GL_DIFFUSE, l->Diffuse );
+ ctx->Driver.Lightfv( ctx, p, GL_SPECULAR, l->Specular );
+ ctx->Driver.Lightfv( ctx, p, GL_POSITION, 0 );
+ ctx->Driver.Lightfv( ctx, p, GL_SPOT_DIRECTION, 0 );
+ ctx->Driver.Lightfv( ctx, p, GL_SPOT_EXPONENT, &l->SpotExponent );
+ ctx->Driver.Lightfv( ctx, p, GL_SPOT_CUTOFF, &l->SpotCutoff );
+ ctx->Driver.Lightfv( ctx, p, GL_CONSTANT_ATTENUATION,
+ &l->ConstantAttenuation );
+ ctx->Driver.Lightfv( ctx, p, GL_LINEAR_ATTENUATION,
+ &l->LinearAttenuation );
+ ctx->Driver.Lightfv( ctx, p, GL_QUADRATIC_ATTENUATION,
+ &l->QuadraticAttenuation );
+ }
+
+ ctx->Driver.LightModelfv( ctx, GL_LIGHT_MODEL_AMBIENT,
+ ctx->Light.Model.Ambient );
+
+ TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange( ctx );
+
+ for (i = 0 ; i < 6; i++) {
+ ctx->Driver.ClipPlane( ctx, GL_CLIP_PLANE0 + i, NULL );
+ }
+
+ ctx->Driver.Fogfv( ctx, GL_FOG_MODE, 0 );
+ ctx->Driver.Fogfv( ctx, GL_FOG_DENSITY, &ctx->Fog.Density );
+ ctx->Driver.Fogfv( ctx, GL_FOG_START, &ctx->Fog.Start );
+ ctx->Driver.Fogfv( ctx, GL_FOG_END, &ctx->Fog.End );
+ ctx->Driver.Fogfv( ctx, GL_FOG_COLOR, ctx->Fog.Color );
+ ctx->Driver.Fogfv( ctx, GL_FOG_COORDINATE_SOURCE_EXT, 0 );
+
+
+ /* Set up vector and scalar state commands:
+ */
+/* upload_matrix( rmesa, ctx->ModelView.m, MODEL ); */
+/* upload_matrix_t( rmesa, ctx->ModelView.inv, MODEL_IT ); */
+/* upload_matrix( rmesa, ctx->TextureMatrix[0].m, TEXMAT_0 ); */
+/* upload_matrix( rmesa, ctx->TextureMatrix[1].m, TEXMAT_1 ); */
+/* upload_matrix( rmesa, ctx->_ModelProjectMatrix.m, TEXMAT_2 ); */
+
+ rmesa->hw.grd.cmd[GRD_VERT_GUARD_CLIP_ADJ] = IEEE_ONE;
+ rmesa->hw.grd.cmd[GRD_VERT_GUARD_DISCARD_ADJ] = IEEE_ONE;
+ rmesa->hw.grd.cmd[GRD_HORZ_GUARD_CLIP_ADJ] = IEEE_ONE;
+ rmesa->hw.grd.cmd[GRD_HORZ_GUARD_DISCARD_ADJ] = IEEE_ONE;
+
+ rmesa->hw.eye.cmd[EYE_X] = 0;
+ rmesa->hw.eye.cmd[EYE_Y] = 0;
+ rmesa->hw.eye.cmd[EYE_Z] = IEEE_ONE;
+ rmesa->hw.eye.cmd[EYE_RESCALE_FACTOR] = IEEE_ONE;
+}
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.c
new file mode 100644
index 000000000..299003719
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.c
@@ -0,0 +1,1191 @@
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
+ VA Linux Systems Inc., Fremont, California.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ *
+ */
+
+#include "glheader.h"
+#include "mtypes.h"
+#include "colormac.h"
+#include "enums.h"
+#include "imports.h"
+#include "mmath.h"
+#include "macros.h"
+
+#include "swrast_setup/swrast_setup.h"
+#include "math/m_translate.h"
+#include "tnl/tnl.h"
+#include "tnl/t_context.h"
+#include "tnl/t_pipeline.h"
+
+#include "radeon_context.h"
+#include "radeon_ioctl.h"
+#include "radeon_state.h"
+#include "radeon_swtcl.h"
+#include "radeon_tcl.h"
+
+/***********************************************************************
+ * Build render functions from dd templates *
+ ***********************************************************************/
+
+
+#define RADEON_XYZW_BIT 0x01
+#define RADEON_RGBA_BIT 0x02
+#define RADEON_SPEC_BIT 0x04
+#define RADEON_TEX0_BIT 0x08
+#define RADEON_TEX1_BIT 0x10
+#define RADEON_PTEX_BIT 0x20
+#define RADEON_MAX_SETUP 0x40
+
+static void flush_last_swtcl_prim( radeonContextPtr rmesa );
+static void flush_last_swtcl_prim_compat( radeonContextPtr rmesa );
+
+static struct {
+ void (*emit)( GLcontext *, GLuint, GLuint, void *, GLuint );
+ interp_func interp;
+ copy_pv_func copy_pv;
+ GLboolean (*check_tex_sizes)( GLcontext *ctx );
+ GLuint vertex_size;
+ GLuint vertex_stride_shift;
+ GLuint vertex_format;
+} setup_tab[RADEON_MAX_SETUP];
+
+
+#define TINY_VERTEX_FORMAT (RADEON_CP_VC_FRMT_XY | \
+ RADEON_CP_VC_FRMT_Z | \
+ RADEON_CP_VC_FRMT_PKCOLOR)
+
+#define NOTEX_VERTEX_FORMAT (RADEON_CP_VC_FRMT_XY | \
+ RADEON_CP_VC_FRMT_Z | \
+ RADEON_CP_VC_FRMT_W0 | \
+ RADEON_CP_VC_FRMT_PKCOLOR | \
+ RADEON_CP_VC_FRMT_PKSPEC)
+
+#define TEX0_VERTEX_FORMAT (RADEON_CP_VC_FRMT_XY | \
+ RADEON_CP_VC_FRMT_Z | \
+ RADEON_CP_VC_FRMT_W0 | \
+ RADEON_CP_VC_FRMT_PKCOLOR | \
+ RADEON_CP_VC_FRMT_PKSPEC | \
+ RADEON_CP_VC_FRMT_ST0)
+
+#define TEX1_VERTEX_FORMAT (RADEON_CP_VC_FRMT_XY | \
+ RADEON_CP_VC_FRMT_Z | \
+ RADEON_CP_VC_FRMT_W0 | \
+ RADEON_CP_VC_FRMT_PKCOLOR | \
+ RADEON_CP_VC_FRMT_PKSPEC | \
+ RADEON_CP_VC_FRMT_ST0 | \
+ RADEON_CP_VC_FRMT_ST1)
+
+#define PROJ_TEX1_VERTEX_FORMAT (RADEON_CP_VC_FRMT_XY | \
+ RADEON_CP_VC_FRMT_Z | \
+ RADEON_CP_VC_FRMT_W0 | \
+ RADEON_CP_VC_FRMT_PKCOLOR | \
+ RADEON_CP_VC_FRMT_PKSPEC | \
+ RADEON_CP_VC_FRMT_ST0 | \
+ RADEON_CP_VC_FRMT_Q0 | \
+ RADEON_CP_VC_FRMT_ST1 | \
+ RADEON_CP_VC_FRMT_Q1)
+
+#define TEX2_VERTEX_FORMAT 0
+#define TEX3_VERTEX_FORMAT 0
+#define PROJ_TEX3_VERTEX_FORMAT 0
+
+#define DO_XYZW (IND & RADEON_XYZW_BIT)
+#define DO_RGBA (IND & RADEON_RGBA_BIT)
+#define DO_SPEC (IND & RADEON_SPEC_BIT)
+#define DO_FOG (IND & RADEON_SPEC_BIT)
+#define DO_TEX0 (IND & RADEON_TEX0_BIT)
+#define DO_TEX1 (IND & RADEON_TEX1_BIT)
+#define DO_TEX2 0
+#define DO_TEX3 0
+#define DO_PTEX (IND & RADEON_PTEX_BIT)
+
+#define VERTEX radeonVertex
+#define VERTEX_COLOR radeon_color_t
+#define GET_VIEWPORT_MAT() 0
+#define GET_TEXSOURCE(n) n
+#define GET_VERTEX_FORMAT() RADEON_CONTEXT(ctx)->swtcl.vertex_format
+#define GET_VERTEX_STORE() RADEON_CONTEXT(ctx)->swtcl.verts
+#define GET_VERTEX_STRIDE_SHIFT() RADEON_CONTEXT(ctx)->swtcl.vertex_stride_shift
+#define GET_UBYTE_COLOR_STORE() &RADEON_CONTEXT(ctx)->UbyteColor
+#define GET_UBYTE_SPEC_COLOR_STORE() &RADEON_CONTEXT(ctx)->UbyteSecondaryColor
+
+#define HAVE_HW_VIEWPORT 1
+/* Tiny vertices don't seem to work atm - haven't looked into why.
+ */
+#define HAVE_HW_DIVIDE (IND & ~(RADEON_XYZW_BIT|RADEON_RGBA_BIT))
+#define HAVE_TINY_VERTICES 1
+#define HAVE_RGBA_COLOR 1
+#define HAVE_NOTEX_VERTICES 1
+#define HAVE_TEX0_VERTICES 1
+#define HAVE_TEX1_VERTICES 1
+#define HAVE_TEX2_VERTICES 0
+#define HAVE_TEX3_VERTICES 0
+#define HAVE_PTEX_VERTICES 1
+
+#define CHECK_HW_DIVIDE (!(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE| \
+ DD_TRI_UNFILLED)))
+
+#define IMPORT_QUALIFIER
+#define IMPORT_FLOAT_COLORS radeon_import_float_colors
+#define IMPORT_FLOAT_SPEC_COLORS radeon_import_float_spec_colors
+
+#define INTERP_VERTEX setup_tab[RADEON_CONTEXT(ctx)->swtcl.SetupIndex].interp
+#define COPY_PV_VERTEX setup_tab[RADEON_CONTEXT(ctx)->swtcl.SetupIndex].copy_pv
+
+
+/***********************************************************************
+ * Generate pv-copying and translation functions *
+ ***********************************************************************/
+
+#define TAG(x) radeon_##x
+#define IND ~0
+#include "tnl_dd/t_dd_vb.c"
+#undef IND
+
+
+/***********************************************************************
+ * Generate vertex emit and interp functions *
+ ***********************************************************************/
+
+#define IND (RADEON_XYZW_BIT|RADEON_RGBA_BIT)
+#define TAG(x) x##_wg
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (RADEON_XYZW_BIT|RADEON_RGBA_BIT|RADEON_TEX0_BIT)
+#define TAG(x) x##_wgt0
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (RADEON_XYZW_BIT|RADEON_RGBA_BIT|RADEON_TEX0_BIT|RADEON_PTEX_BIT)
+#define TAG(x) x##_wgpt0
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (RADEON_XYZW_BIT|RADEON_RGBA_BIT|RADEON_TEX0_BIT|RADEON_TEX1_BIT)
+#define TAG(x) x##_wgt0t1
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (RADEON_XYZW_BIT|RADEON_RGBA_BIT|RADEON_TEX0_BIT|RADEON_TEX1_BIT|\
+ RADEON_PTEX_BIT)
+#define TAG(x) x##_wgpt0t1
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (RADEON_XYZW_BIT|RADEON_RGBA_BIT|RADEON_SPEC_BIT)
+#define TAG(x) x##_wgfs
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (RADEON_XYZW_BIT|RADEON_RGBA_BIT|RADEON_SPEC_BIT|\
+ RADEON_TEX0_BIT)
+#define TAG(x) x##_wgfst0
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (RADEON_XYZW_BIT|RADEON_RGBA_BIT|RADEON_SPEC_BIT|\
+ RADEON_TEX0_BIT|RADEON_PTEX_BIT)
+#define TAG(x) x##_wgfspt0
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (RADEON_XYZW_BIT|RADEON_RGBA_BIT|RADEON_SPEC_BIT|\
+ RADEON_TEX0_BIT|RADEON_TEX1_BIT)
+#define TAG(x) x##_wgfst0t1
+#include "tnl_dd/t_dd_vbtmp.h"
+
+#define IND (RADEON_XYZW_BIT|RADEON_RGBA_BIT|RADEON_SPEC_BIT|\
+ RADEON_TEX0_BIT|RADEON_TEX1_BIT|RADEON_PTEX_BIT)
+#define TAG(x) x##_wgfspt0t1
+#include "tnl_dd/t_dd_vbtmp.h"
+
+
+/***********************************************************************
+ * Initialization
+ ***********************************************************************/
+
+static void init_setup_tab( void )
+{
+ init_wg();
+ init_wgt0();
+ init_wgpt0();
+ init_wgt0t1();
+ init_wgpt0t1();
+ init_wgfs();
+ init_wgfst0();
+ init_wgfspt0();
+ init_wgfst0t1();
+ init_wgfspt0t1();
+}
+
+
+
+void radeonPrintSetupFlags(char *msg, GLuint flags )
+{
+ fprintf(stderr, "%s(%x): %s%s%s%s%s%s\n",
+ msg,
+ (int)flags,
+ (flags & RADEON_XYZW_BIT) ? " xyzw," : "",
+ (flags & RADEON_RGBA_BIT) ? " rgba," : "",
+ (flags & RADEON_SPEC_BIT) ? " spec/fog," : "",
+ (flags & RADEON_TEX0_BIT) ? " tex-0," : "",
+ (flags & RADEON_TEX1_BIT) ? " tex-1," : "",
+ (flags & RADEON_PTEX_BIT) ? " proj-tex," : "");
+}
+
+
+static void radeonRenderStart( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
+
+ if (!setup_tab[rmesa->swtcl.SetupIndex].check_tex_sizes(ctx)) {
+ GLuint ind = rmesa->swtcl.SetupIndex |= (RADEON_PTEX_BIT|RADEON_RGBA_BIT);
+
+ /* Radeon handles projective textures nicely; just have to change
+ * up to the new vertex format.
+ */
+ if (setup_tab[ind].vertex_format != rmesa->swtcl.vertex_format) {
+ RADEON_NEWPRIM(rmesa);
+ rmesa->swtcl.vertex_format = setup_tab[ind].vertex_format;
+ rmesa->swtcl.vertex_size = setup_tab[ind].vertex_size;
+ rmesa->swtcl.vertex_stride_shift = setup_tab[ind].vertex_stride_shift;
+ }
+
+ if (!(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
+ tnl->Driver.Render.Interp = setup_tab[rmesa->swtcl.SetupIndex].interp;
+ tnl->Driver.Render.CopyPV = setup_tab[rmesa->swtcl.SetupIndex].copy_pv;
+ }
+ }
+
+ if (rmesa->dma.flush != 0 &&
+ rmesa->dma.flush != flush_last_swtcl_prim &&
+ rmesa->dma.flush != flush_last_swtcl_prim_compat)
+ rmesa->dma.flush( rmesa );
+}
+
+
+void radeonBuildVertices( GLcontext *ctx, GLuint start, GLuint count,
+ GLuint newinputs )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
+ GLubyte *v = ((GLubyte *)rmesa->swtcl.verts +
+ (start << rmesa->swtcl.vertex_stride_shift));
+ GLuint stride = 1 << rmesa->swtcl.vertex_stride_shift;
+
+ newinputs |= rmesa->swtcl.SetupNewInputs;
+ rmesa->swtcl.SetupNewInputs = 0;
+
+ if (!newinputs)
+ return;
+
+ setup_tab[rmesa->swtcl.SetupIndex].emit( ctx, start, count, v, stride );
+}
+
+void radeonChooseVertexState( GLcontext *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint ind = (RADEON_XYZW_BIT | RADEON_RGBA_BIT);
+
+ if (!rmesa->TclFallback || rmesa->Fallback)
+ return;
+
+ if (ctx->Fog.Enabled || (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR))
+ ind |= RADEON_SPEC_BIT;
+
+ if (ctx->Texture._EnabledUnits & 0x2)
+ /* unit 1 enabled */
+ ind |= RADEON_TEX0_BIT|RADEON_TEX1_BIT;
+ else if (ctx->Texture._EnabledUnits & 0x1)
+ /* unit 0 enabled */
+ ind |= RADEON_TEX0_BIT;
+
+ rmesa->swtcl.SetupIndex = ind;
+
+ if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) {
+ tnl->Driver.Render.Interp = radeon_interp_extras;
+ tnl->Driver.Render.CopyPV = radeon_copy_pv_extras;
+ }
+ else {
+ tnl->Driver.Render.Interp = setup_tab[ind].interp;
+ tnl->Driver.Render.CopyPV = setup_tab[ind].copy_pv;
+ }
+
+ if (setup_tab[ind].vertex_format != rmesa->swtcl.vertex_format) {
+ RADEON_NEWPRIM(rmesa);
+ rmesa->swtcl.vertex_format = setup_tab[ind].vertex_format;
+ rmesa->swtcl.vertex_size = setup_tab[ind].vertex_size;
+ rmesa->swtcl.vertex_stride_shift = setup_tab[ind].vertex_stride_shift;
+ }
+
+ {
+ GLuint se_coord_fmt, needproj;
+
+ /* HW perspective divide is a win, but tiny vertex formats are a
+ * bigger one.
+ */
+ if (setup_tab[ind].vertex_format == TINY_VERTEX_FORMAT ||
+ (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
+ needproj = GL_TRUE;
+ se_coord_fmt = (RADEON_VTX_XY_PRE_MULT_1_OVER_W0 |
+ RADEON_VTX_Z_PRE_MULT_1_OVER_W0 |
+ RADEON_TEX1_W_ROUTING_USE_Q1);
+ }
+ else {
+ needproj = GL_FALSE;
+ se_coord_fmt = (RADEON_VTX_W0_IS_NOT_1_OVER_W0 |
+ RADEON_TEX1_W_ROUTING_USE_Q1);
+ }
+
+ if ( se_coord_fmt != rmesa->hw.set.cmd[SET_SE_COORDFMT] ) {
+ RADEON_STATECHANGE( rmesa, set );
+ rmesa->hw.set.cmd[SET_SE_COORDFMT] = se_coord_fmt;
+ }
+ _tnl_need_projected_coords( ctx, needproj );
+ }
+}
+
+
+/* Flush vertices in the current dma region.
+ */
+static void flush_last_swtcl_prim( radeonContextPtr rmesa )
+{
+ if (RADEON_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ if (rmesa->dma.current.buf) {
+ struct radeon_dma_region *current = &rmesa->dma.current;
+ GLuint current_offset = (rmesa->radeonScreen->agp_buffer_offset +
+ current->buf->buf->idx * RADEON_BUFFER_SIZE +
+ current->start);
+
+ assert (!(rmesa->swtcl.hw_primitive & RADEON_CP_VC_CNTL_PRIM_WALK_IND));
+
+ assert (current->start +
+ rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 ==
+ current->ptr);
+
+ if (rmesa->dma.current.start != rmesa->dma.current.ptr) {
+ radeonEmitVertexAOS( rmesa,
+ rmesa->swtcl.vertex_size,
+ current_offset);
+
+ radeonEmitVbufPrim( rmesa,
+ rmesa->swtcl.vertex_format,
+ rmesa->swtcl.hw_primitive,
+ rmesa->swtcl.numverts);
+ }
+
+ rmesa->swtcl.numverts = 0;
+ current->start = current->ptr;
+
+ rmesa->dma.flush = 0;
+ }
+}
+
+
+static void flush_last_swtcl_prim_compat( radeonContextPtr rmesa )
+{
+ struct radeon_dma_region *current = &rmesa->dma.current;
+
+ if (RADEON_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s buf %p start %d ptr %d\n",
+ __FUNCTION__,
+ current->buf,
+ current->start,
+ current->ptr);
+
+ assert (!(rmesa->swtcl.hw_primitive & RADEON_CP_VC_CNTL_PRIM_WALK_IND));
+ assert (current->start +
+ rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 ==
+ current->ptr);
+ assert (current->start == 0);
+
+ if (current->ptr && current->buf) {
+ assert (current->buf->refcount == 1);
+
+ radeonCompatEmitPrimitive( rmesa,
+ rmesa->swtcl.vertex_format,
+ rmesa->swtcl.hw_primitive,
+ rmesa->swtcl.numverts);
+
+ /* The buffer has been released:
+ */
+ FREE(current->buf);
+ current->buf = 0;
+ current->start = 0;
+ current->ptr = current->end;
+
+ }
+
+ rmesa->swtcl.numverts = 0;
+ rmesa->dma.flush = 0;
+}
+
+
+/* Alloc space in the current dma region.
+ */
+static __inline void *radeonAllocDmaLowVerts( radeonContextPtr rmesa,
+ int nverts, int vsize )
+{
+ GLuint bytes = vsize * nverts;
+
+ if ( rmesa->dma.current.ptr + bytes > rmesa->dma.current.end )
+ radeonRefillCurrentDmaRegion( rmesa );
+
+ if (!rmesa->dma.flush) {
+ if (rmesa->dri.drmMinor == 1)
+ rmesa->dma.flush = flush_last_swtcl_prim_compat;
+ else
+ rmesa->dma.flush = flush_last_swtcl_prim;
+ }
+
+ assert( vsize == rmesa->swtcl.vertex_size * 4 );
+ assert( rmesa->dma.flush == flush_last_swtcl_prim ||
+ rmesa->dma.flush == flush_last_swtcl_prim_compat);
+ assert (rmesa->dma.current.start +
+ rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 ==
+ rmesa->dma.current.ptr);
+
+
+ {
+ GLubyte *head = rmesa->dma.current.address + rmesa->dma.current.ptr;
+ rmesa->dma.current.ptr += bytes;
+ rmesa->swtcl.numverts += nverts;
+ return head;
+ }
+
+}
+
+
+
+
+void radeon_emit_contiguous_verts( GLcontext *ctx, GLuint start, GLuint count )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLuint vertex_size = rmesa->swtcl.vertex_size * 4;
+ CARD32 *dest = radeonAllocDmaLowVerts( rmesa, count-start, vertex_size );
+ setup_tab[rmesa->swtcl.SetupIndex].emit( ctx, start, count, dest,
+ vertex_size );
+}
+
+
+
+void radeon_emit_indexed_verts( GLcontext *ctx, GLuint start, GLuint count )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+
+ radeonAllocDmaRegionVerts( rmesa,
+ &rmesa->swtcl.indexed_verts,
+ count - start,
+ rmesa->swtcl.vertex_size * 4,
+ 64);
+
+ setup_tab[rmesa->swtcl.SetupIndex].emit(
+ ctx, start, count,
+ rmesa->swtcl.indexed_verts.address + rmesa->swtcl.indexed_verts.start,
+ rmesa->swtcl.vertex_size * 4 );
+}
+
+
+/*
+ * Render unclipped vertex buffers by emitting vertices directly to
+ * dma buffers. Use strip/fan hardware primitives where possible.
+ * Try to simulate missing primitives with indexed vertices.
+ */
+#define HAVE_POINTS 1
+#define HAVE_LINES 1
+#define HAVE_LINE_STRIPS 1
+#define HAVE_TRIANGLES 1
+#define HAVE_TRI_STRIPS 1
+#define HAVE_TRI_STRIP_1 0
+#define HAVE_TRI_FANS 1
+#define HAVE_QUADS 0
+#define HAVE_QUAD_STRIPS 0
+#define HAVE_POLYGONS 0
+#define HAVE_ELTS 1
+
+static const GLuint hw_prim[GL_POLYGON+1] = {
+ RADEON_CP_VC_CNTL_PRIM_TYPE_POINT,
+ RADEON_CP_VC_CNTL_PRIM_TYPE_LINE,
+ 0,
+ RADEON_CP_VC_CNTL_PRIM_TYPE_LINE_STRIP,
+ RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST,
+ RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_STRIP,
+ RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_FAN,
+ 0,
+ 0,
+ 0
+};
+
+static __inline void radeonDmaPrimitive( radeonContextPtr rmesa, GLenum prim )
+{
+ RADEON_NEWPRIM( rmesa );
+ rmesa->swtcl.hw_primitive = hw_prim[prim];
+ assert(rmesa->dma.current.ptr == rmesa->dma.current.start);
+}
+
+static __inline void radeonEltPrimitive( radeonContextPtr rmesa, GLenum prim )
+{
+ RADEON_NEWPRIM( rmesa );
+ rmesa->swtcl.hw_primitive = hw_prim[prim] | RADEON_CP_VC_CNTL_PRIM_WALK_IND;
+}
+
+
+static void VERT_FALLBACK( GLcontext *ctx,
+ GLuint start,
+ GLuint count,
+ GLuint flags )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK );
+ tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 );
+ tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start, count, flags );
+ RADEON_CONTEXT(ctx)->swtcl.SetupNewInputs = VERT_BIT_CLIP;
+}
+
+static void ELT_FALLBACK( GLcontext *ctx,
+ GLuint start,
+ GLuint count,
+ GLuint flags )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK );
+ tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 );
+ tnl->Driver.Render.PrimTabElts[flags&PRIM_MODE_MASK]( ctx, start, count, flags );
+ RADEON_CONTEXT(ctx)->swtcl.SetupNewInputs = VERT_BIT_CLIP;
+}
+
+
+#define LOCAL_VARS radeonContextPtr rmesa = RADEON_CONTEXT(ctx)
+#define ELTS_VARS GLushort *dest
+#define INIT( prim ) radeonDmaPrimitive( rmesa, prim )
+#define ELT_INIT(prim) radeonEltPrimitive( rmesa, prim )
+#define NEW_PRIMITIVE() RADEON_NEWPRIM( rmesa )
+#define NEW_BUFFER() radeonRefillCurrentDmaRegion( rmesa )
+#define GET_CURRENT_VB_MAX_VERTS() \
+ (((int)rmesa->dma.current.end - (int)rmesa->dma.current.ptr) / (rmesa->swtcl.vertex_size*4))
+#define GET_SUBSEQUENT_VB_MAX_VERTS() \
+ ((RADEON_BUFFER_SIZE) / (rmesa->swtcl.vertex_size*4))
+
+#if RADEON_OLD_PACKETS
+# define GET_CURRENT_VB_MAX_ELTS() \
+ ((RADEON_CMD_BUF_SZ - (rmesa->store.cmd_used + 24)) / 2)
+#else
+# define GET_CURRENT_VB_MAX_ELTS() \
+ ((RADEON_CMD_BUF_SZ - (rmesa->store.cmd_used + 16)) / 2)
+#endif
+#define GET_SUBSEQUENT_VB_MAX_ELTS() \
+ ((RADEON_CMD_BUF_SZ - 1024) / 2)
+
+
+
+/* How do you extend an existing primitive?
+ */
+#define ALLOC_ELTS(nr) \
+do { \
+ if (rmesa->dma.flush == radeonFlushElts && \
+ rmesa->store.cmd_used + nr*2 < RADEON_CMD_BUF_SZ) { \
+ \
+ dest = (GLushort *)(rmesa->store.cmd_buf + \
+ rmesa->store.cmd_used); \
+ rmesa->store.cmd_used += nr*2; \
+ } \
+ else { \
+ if (rmesa->dma.flush) { \
+ rmesa->dma.flush( rmesa ); \
+ } \
+ \
+ radeonEmitVertexAOS( rmesa, \
+ rmesa->swtcl.vertex_size, \
+ (rmesa->radeonScreen->agp_buffer_offset + \
+ rmesa->swtcl.indexed_verts.buf->buf->idx * \
+ RADEON_BUFFER_SIZE + \
+ rmesa->swtcl.indexed_verts.start)); \
+ \
+ dest = radeonAllocEltsOpenEnded( rmesa, \
+ rmesa->swtcl.vertex_format, \
+ rmesa->swtcl.hw_primitive, \
+ nr ); \
+ } \
+} while (0)
+
+#define ALLOC_ELTS_NEW_PRIMITIVE(nr) ALLOC_ELTS( nr )
+
+#ifdef MESA_BIG_ENDIAN
+/* We could do without (most of) this ugliness if dest was always 32 bit word aligned... */
+#define EMIT_ELT(offset, x) do { \
+ int off = offset + ( ( (GLuint)dest & 0x2 ) >> 1 ); \
+ GLushort *des = (GLushort *)( (GLuint)dest & ~0x2 ); \
+ (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x); } while (0)
+#else
+#define EMIT_ELT(offset, x) (dest)[offset] = (GLushort) (x)
+#endif
+#define EMIT_TWO_ELTS(offset, x, y) *(GLuint *)(dest+offset) = ((y)<<16)|(x);
+#define INCR_ELTS( nr ) dest += nr
+#define RELEASE_ELT_VERTS() \
+ radeonReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts, __FUNCTION__ )
+#define EMIT_VERTS( ctx, j, nr ) \
+ radeon_emit_contiguous_verts(ctx, j, (j)+(nr))
+#define EMIT_INDEXED_VERTS( ctx, start, count ) \
+ radeon_emit_indexed_verts( ctx, start, count )
+
+
+#define TAG(x) radeon_dma_##x
+#include "tnl_dd/t_dd_dmatmp.h"
+
+
+/**********************************************************************/
+/* Render pipeline stage */
+/**********************************************************************/
+
+
+static GLboolean radeon_run_render( GLcontext *ctx,
+ struct gl_pipeline_stage *stage )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *VB = &tnl->vb;
+ GLuint i, length, flags = 0;
+ render_func *tab = TAG(render_tab_verts);
+
+ if (rmesa->swtcl.indexed_verts.buf && (!VB->Elts || stage->changed_inputs))
+ RELEASE_ELT_VERTS();
+
+ if (VB->ClipOrMask || /* No clipping */
+ rmesa->swtcl.RenderIndex != 0 || /* No per-vertex manipulations */
+ ctx->Line.StippleFlag) /* GH: THIS IS A HACK!!! */
+ return GL_TRUE;
+
+ if (rmesa->dri.drmMinor < 3) {
+ /* drm 1.1 doesn't support vertex primitives starting in the
+ * middle of a buffer. It doesn't support sane indexed vertices
+ * either. drm 1.2 fixes both of these problems, but we don't have a
+ * compatibility layer to that version yet.
+ */
+ return GL_TRUE;
+ }
+
+ tnl->Driver.Render.Start( ctx );
+
+ if (VB->Elts) {
+ tab = TAG(render_tab_elts);
+ if (!rmesa->swtcl.indexed_verts.buf)
+ if (!TAG(emit_elt_verts)(ctx, 0, VB->Count))
+ return GL_TRUE; /* too many vertices */
+ }
+
+ for (i = 0 ; !(flags & PRIM_LAST) ; i += length)
+ {
+ flags = VB->Primitive[i];
+ length = VB->PrimitiveLength[i];
+
+ if (RADEON_DEBUG & DEBUG_PRIMS)
+ fprintf(stderr, "radeon_render.c: prim %s %d..%d\n",
+ _mesa_lookup_enum_by_nr(flags & PRIM_MODE_MASK),
+ i, i+length);
+
+ if (length)
+ tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
+ }
+
+ tnl->Driver.Render.Finish( ctx );
+
+ return GL_FALSE; /* finished the pipe */
+}
+
+
+
+static void radeon_check_render( GLcontext *ctx,
+ struct gl_pipeline_stage *stage )
+{
+ GLuint inputs = VERT_BIT_POS | VERT_BIT_CLIP | VERT_BIT_COLOR0;
+
+ if (ctx->RenderMode == GL_RENDER) {
+ if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
+ inputs |= VERT_BIT_COLOR1;
+
+ if (ctx->Texture.Unit[0]._ReallyEnabled)
+ inputs |= VERT_BIT_TEX0;
+
+ if (ctx->Texture.Unit[1]._ReallyEnabled)
+ inputs |= VERT_BIT_TEX1;
+
+ if (ctx->Fog.Enabled)
+ inputs |= VERT_BIT_FOG;
+ }
+
+ stage->inputs = inputs;
+}
+
+
+static void dtr( struct gl_pipeline_stage *stage )
+{
+ (void)stage;
+}
+
+
+const struct gl_pipeline_stage _radeon_render_stage =
+{
+ "radeon render",
+ (_DD_NEW_SEPARATE_SPECULAR |
+ _NEW_TEXTURE|
+ _NEW_FOG|
+ _NEW_RENDERMODE), /* re-check (new inputs) */
+ 0, /* re-run (always runs) */
+ GL_TRUE, /* active */
+ 0, 0, /* inputs (set in check_render), outputs */
+ 0, 0, /* changed_inputs, private */
+ dtr, /* destructor */
+ radeon_check_render, /* check - initially set to alloc data */
+ radeon_run_render /* run */
+};
+
+
+
+/**************************************************************************/
+
+
+static const GLuint reduced_hw_prim[GL_POLYGON+1] = {
+ RADEON_CP_VC_CNTL_PRIM_TYPE_POINT,
+ RADEON_CP_VC_CNTL_PRIM_TYPE_LINE,
+ RADEON_CP_VC_CNTL_PRIM_TYPE_LINE,
+ RADEON_CP_VC_CNTL_PRIM_TYPE_LINE,
+ RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST,
+ RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST,
+ RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST,
+ RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST,
+ RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST,
+ RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST
+};
+
+static void radeonRasterPrimitive( GLcontext *ctx, GLuint hwprim );
+static void radeonRenderPrimitive( GLcontext *ctx, GLenum prim );
+static void radeonResetLineStipple( GLcontext *ctx );
+
+
+/***********************************************************************
+ * Emit primitives as inline vertices *
+ ***********************************************************************/
+
+#define CTX_ARG radeonContextPtr rmesa
+#define CTX_ARG2 rmesa
+#define GET_VERTEX_DWORDS() rmesa->swtcl.vertex_size
+#define ALLOC_VERTS( n, size ) radeonAllocDmaLowVerts( rmesa, n, size * 4 )
+#undef LOCAL_VARS
+#define LOCAL_VARS \
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \
+ const GLuint shift = rmesa->swtcl.vertex_stride_shift; \
+ const char *radeonverts = (char *)rmesa->swtcl.verts;
+#define VERT(x) (radeonVertex *)(radeonverts + (x << shift))
+#define VERTEX radeonVertex
+#undef TAG
+#define TAG(x) radeon_##x
+#include "tnl_dd/t_dd_triemit.h"
+
+
+/***********************************************************************
+ * Macros for t_dd_tritmp.h to draw basic primitives *
+ ***********************************************************************/
+
+#define QUAD( a, b, c, d ) radeon_quad( rmesa, a, b, c, d )
+#define TRI( a, b, c ) radeon_triangle( rmesa, a, b, c )
+#define LINE( a, b ) radeon_line( rmesa, a, b )
+#define POINT( a ) radeon_point( rmesa, a )
+
+/***********************************************************************
+ * Build render functions from dd templates *
+ ***********************************************************************/
+
+#define RADEON_TWOSIDE_BIT 0x01
+#define RADEON_UNFILLED_BIT 0x02
+#define RADEON_OFFSET_BIT 0x04 /* drmMinor == 1 */
+#define RADEON_MAX_TRIFUNC 0x08
+
+
+static struct {
+ points_func points;
+ line_func line;
+ triangle_func triangle;
+ quad_func quad;
+} rast_tab[RADEON_MAX_TRIFUNC];
+
+
+#define DO_FALLBACK 0
+#define DO_OFFSET (IND & RADEON_OFFSET_BIT)
+#define DO_UNFILLED (IND & RADEON_UNFILLED_BIT)
+#define DO_TWOSIDE (IND & RADEON_TWOSIDE_BIT)
+#define DO_FLAT 0
+#define DO_TRI 1
+#define DO_QUAD 1
+#define DO_LINE 1
+#define DO_POINTS 1
+#define DO_FULL_QUAD 1
+
+#define HAVE_RGBA 1
+#define HAVE_SPEC 1
+#define HAVE_INDEX 0
+#define HAVE_BACK_COLORS 0
+#define HAVE_HW_FLATSHADE 1
+#define TAB rast_tab
+
+#define DEPTH_SCALE 1.0
+#define UNFILLED_TRI unfilled_tri
+#define UNFILLED_QUAD unfilled_quad
+#define VERT_X(_v) _v->v.x
+#define VERT_Y(_v) _v->v.y
+#define VERT_Z(_v) _v->v.z
+#define AREA_IS_CCW( a ) (a < 0)
+#define GET_VERTEX(e) (rmesa->swtcl.verts + (e<<rmesa->swtcl.vertex_stride_shift))
+
+#define VERT_SET_RGBA( v, c ) v->ui[coloroffset] = LE32_TO_CPU(*(GLuint *)c)
+#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset]
+#define VERT_SAVE_RGBA( idx ) color[idx] = CPU_TO_LE32(v[idx]->ui[coloroffset])
+#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = LE32_TO_CPU(color[idx])
+
+#define VERT_SET_SPEC( v0, c ) if (havespec) { \
+ v0->v.specular.red = (c)[0]; \
+ v0->v.specular.green = (c)[1]; \
+ v0->v.specular.blue = (c)[2]; }
+#define VERT_COPY_SPEC( v0, v1 ) if (havespec) { \
+ v0->v.specular.red = v1->v.specular.red; \
+ v0->v.specular.green = v1->v.specular.green; \
+ v0->v.specular.blue = v1->v.specular.blue; }
+#define VERT_SAVE_SPEC( idx ) if (havespec) spec[idx] = CPU_TO_LE32(v[idx]->ui[5])
+#define VERT_RESTORE_SPEC( idx ) if (havespec) v[idx]->ui[5] = LE32_TO_CPU(spec[idx])
+
+#undef LOCAL_VARS
+#define LOCAL_VARS(n) \
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \
+ GLuint color[n], spec[n]; \
+ GLuint coloroffset = (rmesa->swtcl.vertex_size == 4 ? 3 : 4); \
+ GLboolean havespec = (rmesa->swtcl.vertex_size > 4); \
+ (void) color; (void) spec; (void) coloroffset; (void) havespec;
+
+/***********************************************************************
+ * Helpers for rendering unfilled primitives *
+ ***********************************************************************/
+
+#define RASTERIZE(x) radeonRasterPrimitive( ctx, reduced_hw_prim[x] )
+#define RENDER_PRIMITIVE rmesa->swtcl.render_primitive
+#undef TAG
+#define TAG(x) x
+#include "tnl_dd/t_dd_unfilled.h"
+#undef IND
+
+
+/***********************************************************************
+ * Generate GL render functions *
+ ***********************************************************************/
+
+
+#define IND (0)
+#define TAG(x) x
+#include "tnl_dd/t_dd_tritmp.h"
+
+#define IND (RADEON_TWOSIDE_BIT)
+#define TAG(x) x##_twoside
+#include "tnl_dd/t_dd_tritmp.h"
+
+#define IND (RADEON_UNFILLED_BIT)
+#define TAG(x) x##_unfilled
+#include "tnl_dd/t_dd_tritmp.h"
+
+#define IND (RADEON_TWOSIDE_BIT|RADEON_UNFILLED_BIT)
+#define TAG(x) x##_twoside_unfilled
+#include "tnl_dd/t_dd_tritmp.h"
+
+#define IND (RADEON_OFFSET_BIT)
+#define TAG(x) x##_offset
+#include "tnl_dd/t_dd_tritmp.h"
+
+#define IND (RADEON_TWOSIDE_BIT|RADEON_OFFSET_BIT)
+#define TAG(x) x##_twoside_offset
+#include "tnl_dd/t_dd_tritmp.h"
+
+#define IND (RADEON_UNFILLED_BIT|RADEON_OFFSET_BIT)
+#define TAG(x) x##_unfilled_offset
+#include "tnl_dd/t_dd_tritmp.h"
+
+#define IND (RADEON_TWOSIDE_BIT|RADEON_UNFILLED_BIT|RADEON_OFFSET_BIT)
+#define TAG(x) x##_twoside_unfilled_offset
+#include "tnl_dd/t_dd_tritmp.h"
+
+
+static void init_rast_tab( void )
+{
+ init();
+ init_twoside();
+ init_unfilled();
+ init_twoside_unfilled();
+ init_offset();
+ init_twoside_offset();
+ init_unfilled_offset();
+ init_twoside_unfilled_offset();
+}
+
+/**********************************************************************/
+/* Render unclipped begin/end objects */
+/**********************************************************************/
+
+#define VERT(x) (radeonVertex *)(radeonverts + (x << shift))
+#define RENDER_POINTS( start, count ) \
+ for ( ; start < count ; start++) \
+ radeon_point( rmesa, VERT(start) )
+#define RENDER_LINE( v0, v1 ) \
+ radeon_line( rmesa, VERT(v0), VERT(v1) )
+#define RENDER_TRI( v0, v1, v2 ) \
+ radeon_triangle( rmesa, VERT(v0), VERT(v1), VERT(v2) )
+#define RENDER_QUAD( v0, v1, v2, v3 ) \
+ radeon_quad( rmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) )
+#undef INIT
+#define INIT(x) do { \
+ radeonRenderPrimitive( ctx, x ); \
+} while (0)
+#undef LOCAL_VARS
+#define LOCAL_VARS \
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \
+ const GLuint shift = rmesa->swtcl.vertex_stride_shift; \
+ const char *radeonverts = (char *)rmesa->swtcl.verts; \
+ const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
+ const GLboolean stipple = ctx->Line.StippleFlag; \
+ (void) elt; (void) stipple;
+#define RESET_STIPPLE if ( stipple ) radeonResetLineStipple( ctx );
+#define RESET_OCCLUSION
+#define PRESERVE_VB_DEFS
+#define ELT(x) (x)
+#define TAG(x) radeon_##x##_verts
+#include "tnl/t_vb_rendertmp.h"
+#undef ELT
+#undef TAG
+#define TAG(x) radeon_##x##_elts
+#define ELT(x) elt[x]
+#include "tnl/t_vb_rendertmp.h"
+
+
+
+/**********************************************************************/
+/* Choose render functions */
+/**********************************************************************/
+
+void radeonChooseRenderState( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLuint index = 0;
+ GLuint flags = ctx->_TriangleCaps;
+
+ if (!rmesa->TclFallback || rmesa->Fallback)
+ return;
+
+ if (flags & DD_TRI_LIGHT_TWOSIDE) index |= RADEON_TWOSIDE_BIT;
+ if (flags & DD_TRI_UNFILLED) index |= RADEON_UNFILLED_BIT;
+ if ((flags & DD_TRI_OFFSET) &&
+ rmesa->dri.drmMinor == 1) index |= RADEON_OFFSET_BIT;
+
+ if (index != rmesa->swtcl.RenderIndex) {
+ tnl->Driver.Render.Points = rast_tab[index].points;
+ tnl->Driver.Render.Line = rast_tab[index].line;
+ tnl->Driver.Render.ClippedLine = rast_tab[index].line;
+ tnl->Driver.Render.Triangle = rast_tab[index].triangle;
+ tnl->Driver.Render.Quad = rast_tab[index].quad;
+
+ if (index == 0) {
+ tnl->Driver.Render.PrimTabVerts = radeon_render_tab_verts;
+ tnl->Driver.Render.PrimTabElts = radeon_render_tab_elts;
+ tnl->Driver.Render.ClippedPolygon = radeon_fast_clipped_poly;
+ } else {
+ tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
+ tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
+ tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon;
+ }
+
+ rmesa->swtcl.RenderIndex = index;
+ }
+}
+
+
+/**********************************************************************/
+/* High level hooks for t_vb_render.c */
+/**********************************************************************/
+
+
+static void radeonRasterPrimitive( GLcontext *ctx, GLuint hwprim )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+
+ if (rmesa->swtcl.hw_primitive != hwprim) {
+ RADEON_NEWPRIM( rmesa );
+ rmesa->swtcl.hw_primitive = hwprim;
+ }
+}
+
+static void radeonRenderPrimitive( GLcontext *ctx, GLenum prim )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ rmesa->swtcl.render_primitive = prim;
+ if (prim < GL_TRIANGLES || !(ctx->_TriangleCaps & DD_TRI_UNFILLED))
+ radeonRasterPrimitive( ctx, reduced_hw_prim[prim] );
+}
+
+static void radeonRenderFinish( GLcontext *ctx )
+{
+}
+
+static void radeonResetLineStipple( GLcontext *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ RADEON_STATECHANGE( rmesa, lin );
+}
+
+
+/**********************************************************************/
+/* Transition to/from hardware rasterization. */
+/**********************************************************************/
+
+static char *fallbackStrings[] = {
+ "Texture mode",
+ "glDrawBuffer(GL_FRONT_AND_BACK)",
+ "glEnable(GL_STENCIL) without hw stencil buffer",
+ "glRenderMode(selection or feedback)",
+ "glBlendEquation",
+ "glBlendFunc(mode != ADD)"
+ "RADEON_NO_RAST"
+};
+
+
+static char *getFallbackString(GLuint bit)
+{
+ int i = 0;
+ while (bit > 1) {
+ i++;
+ bit >>= 1;
+ }
+ return fallbackStrings[i];
+}
+
+
+void radeonFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint oldfallback = rmesa->Fallback;
+
+ if (mode) {
+ rmesa->Fallback |= bit;
+ if (oldfallback == 0) {
+ RADEON_FIREVERTICES( rmesa );
+ TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_RASTER, GL_TRUE );
+ _swsetup_Wakeup( ctx );
+ _tnl_need_projected_coords( ctx, GL_TRUE );
+ rmesa->swtcl.RenderIndex = ~0;
+ if (RADEON_DEBUG & DEBUG_FALLBACKS) {
+ fprintf(stderr, "Radeon begin rasterization fallback: 0x%x %s\n",
+ bit, getFallbackString(bit));
+ }
+ }
+ }
+ else {
+ rmesa->Fallback &= ~bit;
+ if (oldfallback == bit) {
+ _swrast_flush( ctx );
+ tnl->Driver.Render.Start = radeonRenderStart;
+ tnl->Driver.Render.PrimitiveNotify = radeonRenderPrimitive;
+ tnl->Driver.Render.Finish = radeonRenderFinish;
+ tnl->Driver.Render.BuildVertices = radeonBuildVertices;
+ tnl->Driver.Render.ResetLineStipple = radeonResetLineStipple;
+ TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_RASTER, GL_FALSE );
+ if (rmesa->TclFallback) {
+ /* These are already done if rmesa->TclFallback goes to
+ * zero above. But not if it doesn't (RADEON_NO_TCL for
+ * example?)
+ */
+ radeonChooseVertexState( ctx );
+ radeonChooseRenderState( ctx );
+ }
+ if (RADEON_DEBUG & DEBUG_FALLBACKS) {
+ fprintf(stderr, "Radeon end rasterization fallback: 0x%x %s\n",
+ bit, getFallbackString(bit));
+ }
+ }
+ }
+}
+
+
+/**********************************************************************/
+/* Initialization. */
+/**********************************************************************/
+
+void radeonInitSwtcl( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLuint size = TNL_CONTEXT(ctx)->vb.Size;
+ static int firsttime = 1;
+
+ if (firsttime) {
+ init_rast_tab();
+ init_setup_tab();
+ firsttime = 0;
+ }
+
+ tnl->Driver.Render.Start = radeonRenderStart;
+ tnl->Driver.Render.Finish = radeonRenderFinish;
+ tnl->Driver.Render.PrimitiveNotify = radeonRenderPrimitive;
+ tnl->Driver.Render.ResetLineStipple = radeonResetLineStipple;
+ tnl->Driver.Render.BuildVertices = radeonBuildVertices;
+
+ rmesa->swtcl.verts = (char *)ALIGN_MALLOC( size * 16 * 4, 32 );
+ rmesa->swtcl.RenderIndex = ~0;
+ rmesa->swtcl.render_primitive = GL_TRIANGLES;
+ rmesa->swtcl.hw_primitive = 0;
+}
+
+
+void radeonDestroySwtcl( GLcontext *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+
+ if (rmesa->swtcl.indexed_verts.buf)
+ radeonReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts,
+ __FUNCTION__ );
+
+ if (rmesa->swtcl.verts) {
+ ALIGN_FREE(rmesa->swtcl.verts);
+ rmesa->swtcl.verts = 0;
+ }
+
+ if (rmesa->UbyteSecondaryColor.Ptr) {
+ ALIGN_FREE(rmesa->UbyteSecondaryColor.Ptr);
+ rmesa->UbyteSecondaryColor.Ptr = 0;
+ }
+
+ if (rmesa->UbyteColor.Ptr) {
+ ALIGN_FREE(rmesa->UbyteColor.Ptr);
+ rmesa->UbyteColor.Ptr = 0;
+ }
+}
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.c
new file mode 100644
index 000000000..429cef409
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.c
@@ -0,0 +1,546 @@
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
+ Tungsten Graphics Inc., Austin, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ *
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "light.h"
+#include "mmath.h"
+#include "mtypes.h"
+#include "enums.h"
+
+#include "array_cache/acache.h"
+#include "tnl/tnl.h"
+#include "tnl/t_pipeline.h"
+
+#include "radeon_context.h"
+#include "radeon_state.h"
+#include "radeon_ioctl.h"
+#include "radeon_tex.h"
+#include "radeon_tcl.h"
+#include "radeon_swtcl.h"
+#include "radeon_maos.h"
+
+
+
+/*
+ * Render unclipped vertex buffers by emitting vertices directly to
+ * dma buffers. Use strip/fan hardware primitives where possible.
+ * Try to simulate missing primitives with indexed vertices.
+ */
+#define HAVE_POINTS 1
+#define HAVE_LINES 1
+#define HAVE_LINE_LOOP 0
+#define HAVE_LINE_STRIPS 1
+#define HAVE_TRIANGLES 1
+#define HAVE_TRI_STRIPS 1
+#define HAVE_TRI_STRIP_1 0
+#define HAVE_TRI_FANS 1
+#define HAVE_QUADS 0
+#define HAVE_QUAD_STRIPS 0
+#define HAVE_POLYGONS 1
+#define HAVE_ELTS 1
+
+
+#define HW_POINTS RADEON_CP_VC_CNTL_PRIM_TYPE_POINT
+#define HW_LINES RADEON_CP_VC_CNTL_PRIM_TYPE_LINE
+#define HW_LINE_LOOP 0
+#define HW_LINE_STRIP RADEON_CP_VC_CNTL_PRIM_TYPE_LINE_STRIP
+#define HW_TRIANGLES RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST
+#define HW_TRIANGLE_STRIP_0 RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_STRIP
+#define HW_TRIANGLE_STRIP_1 0
+#define HW_TRIANGLE_FAN RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_FAN
+#define HW_QUADS 0
+#define HW_QUAD_STRIP 0
+#define HW_POLYGON RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_FAN
+
+
+static GLboolean discreet_prim[0x10] = {
+ 0, /* none */
+ 1, /* points */
+ 1, /* lines */
+ 0, /* line_strip */
+ 1, /* tri_list */
+ 0, /* tri_fan */
+ 0, /* tri_type_2 */
+ 1, /* rect list (unused) */
+ 1, /* 3 vert point */
+ 1, /* 3 vert line */
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+};
+
+
+#define LOCAL_VARS radeonContextPtr rmesa = RADEON_CONTEXT(ctx)
+#define ELTS_VARS GLushort *dest
+
+#define ELT_INIT(prim, hw_prim) \
+ radeonTclPrimitive( ctx, prim, hw_prim | RADEON_CP_VC_CNTL_PRIM_WALK_IND )
+
+#define GET_ELTS() rmesa->tcl.Elts
+
+
+#define NEW_PRIMITIVE() RADEON_NEWPRIM( rmesa )
+#define NEW_BUFFER() radeonRefillCurrentDmaRegion( rmesa )
+
+/* Don't really know how many elts will fit in what's left of cmdbuf,
+ * as there is state to emit, etc:
+ */
+
+#if 0
+#define GET_CURRENT_VB_MAX_ELTS() \
+ ((RADEON_CMD_BUF_SZ - (rmesa->store.cmd_used + 16)) / 2)
+#define GET_SUBSEQUENT_VB_MAX_ELTS() ((RADEON_CMD_BUF_SZ - 16) / 2)
+#else
+/* Testing on isosurf shows a maximum around here. Don't know if it's
+ * the card or driver or kernel module that is causing the behaviour.
+ */
+#define GET_CURRENT_VB_MAX_ELTS() 300
+#define GET_SUBSEQUENT_VB_MAX_ELTS() 300
+#endif
+
+#define RESET_STIPPLE() do { \
+ RADEON_STATECHANGE( rmesa, lin ); \
+ radeonEmitState( rmesa ); \
+} while (0)
+
+#define AUTO_STIPPLE( mode ) do { \
+ RADEON_STATECHANGE( rmesa, lin ); \
+ if (mode) \
+ rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] |= \
+ RADEON_LINE_PATTERN_AUTO_RESET; \
+ else \
+ rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] &= \
+ ~RADEON_LINE_PATTERN_AUTO_RESET; \
+ radeonEmitState( rmesa ); \
+} while (0)
+
+
+/* How do you extend an existing primitive?
+ */
+#define ALLOC_ELTS(nr) \
+do { \
+ if (rmesa->dma.flush == radeonFlushElts && \
+ rmesa->store.cmd_used + nr*2 < RADEON_CMD_BUF_SZ) { \
+ \
+ dest = (GLushort *)(rmesa->store.cmd_buf + \
+ rmesa->store.cmd_used); \
+ rmesa->store.cmd_used += nr*2; \
+ } \
+ else { \
+ if (rmesa->dma.flush) \
+ rmesa->dma.flush( rmesa ); \
+ \
+ radeonEmitAOS( rmesa, \
+ rmesa->tcl.aos_components, \
+ rmesa->tcl.nr_aos_components, \
+ 0 ); \
+ \
+ dest = radeonAllocEltsOpenEnded( rmesa, \
+ rmesa->tcl.vertex_format, \
+ rmesa->tcl.hw_primitive, \
+ nr ); \
+ } \
+} while (0)
+
+
+
+/* TODO: Try to extend existing primitive if both are identical,
+ * discreet and there are no intervening state changes. (Somewhat
+ * duplicates changes to DrawArrays code)
+ */
+static void EMIT_PRIM( GLcontext *ctx,
+ GLenum prim,
+ GLuint hwprim,
+ GLuint start,
+ GLuint count)
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
+ radeonTclPrimitive( ctx, prim, hwprim );
+
+ radeonEmitAOS( rmesa,
+ rmesa->tcl.aos_components,
+ rmesa->tcl.nr_aos_components,
+ start );
+
+ /* Why couldn't this packet have taken an offset param?
+ */
+ radeonEmitVbufPrim( rmesa,
+ rmesa->tcl.vertex_format,
+ rmesa->tcl.hw_primitive,
+ count - start );
+}
+
+
+
+/* Try & join small primitives
+ */
+#if 0
+#define PREFER_DISCRETE_ELT_PRIM( NR, PRIM ) 0
+#else
+#define PREFER_DISCRETE_ELT_PRIM( NR, PRIM ) \
+ ((NR) < 20 || \
+ ((NR) < 40 && \
+ rmesa->tcl.hw_primitive == (PRIM| \
+ RADEON_CP_VC_CNTL_PRIM_WALK_IND| \
+ RADEON_CP_VC_CNTL_TCL_ENABLE)))
+#endif
+
+#ifdef MESA_BIG_ENDIAN
+/* We could do without (most of) this ugliness if dest was always 32 bit word aligned... */
+#define EMIT_ELT(offset, x) do { \
+ int off = offset + ( ( (GLuint)dest & 0x2 ) >> 1 ); \
+ GLushort *des = (GLushort *)( (GLuint)dest & ~0x2 ); \
+ (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x); } while (0)
+#else
+#define EMIT_ELT(offset, x) (dest)[offset] = (GLushort) (x)
+#endif
+#define EMIT_TWO_ELTS(offset, x, y) *(GLuint *)(dest+offset) = ((y)<<16)|(x);
+#define INCR_ELTS( nr ) dest += nr
+#define RELEASE_ELT_VERTS() \
+ radeonReleaseArrays( ctx, ~0 )
+
+
+
+#define TAG(x) tcl_##x
+#include "tnl_dd/t_dd_dmatmp2.h"
+
+/**********************************************************************/
+/* External entrypoints */
+/**********************************************************************/
+
+void radeonEmitPrimitive( GLcontext *ctx,
+ GLuint first,
+ GLuint last,
+ GLuint flags )
+{
+ tcl_render_tab_verts[flags&PRIM_MODE_MASK]( ctx, first, last, flags );
+}
+
+void radeonEmitEltPrimitive( GLcontext *ctx,
+ GLuint first,
+ GLuint last,
+ GLuint flags )
+{
+ tcl_render_tab_elts[flags&PRIM_MODE_MASK]( ctx, first, last, flags );
+}
+
+void radeonTclPrimitive( GLcontext *ctx,
+ GLenum prim,
+ int hw_prim )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLuint se_cntl;
+ GLuint newprim = hw_prim | RADEON_CP_VC_CNTL_TCL_ENABLE;
+
+ if (newprim != rmesa->tcl.hw_primitive ||
+ !discreet_prim[hw_prim&0xf]) {
+ RADEON_NEWPRIM( rmesa );
+ rmesa->tcl.hw_primitive = newprim;
+ }
+
+ se_cntl = rmesa->hw.set.cmd[SET_SE_CNTL];
+ se_cntl &= ~RADEON_FLAT_SHADE_VTX_LAST;
+
+ if (prim == GL_POLYGON && (ctx->_TriangleCaps & DD_FLATSHADE))
+ se_cntl |= RADEON_FLAT_SHADE_VTX_0;
+ else
+ se_cntl |= RADEON_FLAT_SHADE_VTX_LAST;
+
+ if (se_cntl != rmesa->hw.set.cmd[SET_SE_CNTL]) {
+ RADEON_STATECHANGE( rmesa, set );
+ rmesa->hw.set.cmd[SET_SE_CNTL] = se_cntl;
+ }
+}
+
+
+/**********************************************************************/
+/* Render pipeline stage */
+/**********************************************************************/
+
+
+/* TCL render.
+ */
+static GLboolean radeon_run_tcl_render( GLcontext *ctx,
+ struct gl_pipeline_stage *stage )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *VB = &tnl->vb;
+ GLuint i,flags = 0,length;
+
+ /* TODO: separate this from the swtnl pipeline
+ */
+ if (rmesa->TclFallback)
+ return GL_TRUE; /* fallback to software t&l */
+
+ if (VB->Count == 0)
+ return GL_FALSE;
+
+ radeonReleaseArrays( ctx, stage->changed_inputs );
+ radeonEmitArrays( ctx, stage->inputs );
+
+ rmesa->tcl.Elts = VB->Elts;
+
+ for (i = VB->FirstPrimitive ; !(flags & PRIM_LAST) ; i += length)
+ {
+ flags = VB->Primitive[i];
+ length = VB->PrimitiveLength[i];
+
+ if (RADEON_DEBUG & DEBUG_PRIMS)
+ fprintf(stderr, "%s: prim %s %d..%d\n",
+ __FUNCTION__,
+ _mesa_lookup_enum_by_nr(flags & PRIM_MODE_MASK),
+ i, i+length);
+
+ if (!length)
+ continue;
+
+ if (rmesa->tcl.Elts)
+ radeonEmitEltPrimitive( ctx, i, i+length, flags );
+ else
+ radeonEmitPrimitive( ctx, i, i+length, flags );
+ }
+
+ return GL_FALSE; /* finished the pipe */
+}
+
+
+
+static void radeon_check_tcl_render( GLcontext *ctx,
+ struct gl_pipeline_stage *stage )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLuint inputs = VERT_BIT_POS;
+
+ if (ctx->RenderMode == GL_RENDER) {
+ /* Make all this event-driven:
+ */
+ if (ctx->Light.Enabled) {
+ inputs |= VERT_BIT_NORMAL;
+
+ if (ctx->Light.ColorMaterialEnabled) {
+ inputs |= VERT_BIT_COLOR0;
+ }
+ }
+ else {
+ inputs |= VERT_BIT_COLOR0;
+
+ if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
+ inputs |= VERT_BIT_COLOR1;
+ }
+ }
+
+ if (ctx->Texture.Unit[0]._ReallyEnabled) {
+ if (ctx->Texture.Unit[0].TexGenEnabled) {
+ if (rmesa->TexGenNeedNormals[0]) {
+ inputs |= VERT_BIT_NORMAL;
+ }
+ } else {
+ inputs |= VERT_BIT_TEX0;
+ }
+ }
+
+ if (ctx->Texture.Unit[1]._ReallyEnabled) {
+ if (ctx->Texture.Unit[1].TexGenEnabled) {
+ if (rmesa->TexGenNeedNormals[1]) {
+ inputs |= VERT_BIT_NORMAL;
+ }
+ } else {
+ inputs |= VERT_BIT_TEX1;
+ }
+ }
+
+ stage->inputs = inputs;
+ stage->active = 1;
+ }
+ else
+ stage->active = 0;
+}
+
+static void radeon_init_tcl_render( GLcontext *ctx,
+ struct gl_pipeline_stage *stage )
+{
+ stage->check = radeon_check_tcl_render;
+ stage->check( ctx, stage );
+}
+
+static void dtr( struct gl_pipeline_stage *stage )
+{
+ (void)stage;
+}
+
+
+/* Initial state for tcl stage.
+ */
+const struct gl_pipeline_stage _radeon_tcl_stage =
+{
+ "radeon render",
+ (_DD_NEW_SEPARATE_SPECULAR |
+ _NEW_LIGHT|
+ _NEW_TEXTURE|
+ _NEW_FOG|
+ _NEW_RENDERMODE), /* re-check (new inputs) */
+ 0, /* re-run (always runs) */
+ GL_TRUE, /* active */
+ 0, 0, /* inputs (set in check_render), outputs */
+ 0, 0, /* changed_inputs, private */
+ dtr, /* destructor */
+ radeon_init_tcl_render, /* check - initially set to alloc data */
+ radeon_run_tcl_render /* run */
+};
+
+
+
+/**********************************************************************/
+/* Validate state at pipeline start */
+/**********************************************************************/
+
+
+/*-----------------------------------------------------------------------
+ * Manage TCL fallbacks
+ */
+
+
+static void transition_to_swtnl( GLcontext *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint se_cntl;
+
+ RADEON_NEWPRIM( rmesa );
+ rmesa->swtcl.vertex_format = 0;
+
+ radeonChooseVertexState( ctx );
+ radeonChooseRenderState( ctx );
+
+ _mesa_validate_all_lighting_tables( ctx );
+
+ tnl->Driver.NotifyMaterialChange =
+ _mesa_validate_all_lighting_tables;
+
+ radeonReleaseArrays( ctx, ~0 );
+
+ se_cntl = rmesa->hw.set.cmd[SET_SE_CNTL];
+ se_cntl |= RADEON_FLAT_SHADE_VTX_LAST;
+
+ if (se_cntl != rmesa->hw.set.cmd[SET_SE_CNTL]) {
+ RADEON_STATECHANGE( rmesa, set );
+ rmesa->hw.set.cmd[SET_SE_CNTL] = se_cntl;
+ }
+}
+
+
+static void transition_to_hwtnl( GLcontext *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint se_coord_fmt = (RADEON_VTX_W0_IS_NOT_1_OVER_W0 |
+ RADEON_TEX1_W_ROUTING_USE_Q1);
+
+ if ( se_coord_fmt != rmesa->hw.set.cmd[SET_SE_COORDFMT] ) {
+ RADEON_STATECHANGE( rmesa, set );
+ rmesa->hw.set.cmd[SET_SE_COORDFMT] = se_coord_fmt;
+ _tnl_need_projected_coords( ctx, GL_FALSE );
+ }
+
+ radeonUpdateMaterial( ctx );
+
+ tnl->Driver.NotifyMaterialChange = radeonUpdateMaterial;
+
+ if ( rmesa->dma.flush )
+ rmesa->dma.flush( rmesa );
+
+ rmesa->dma.flush = 0;
+ rmesa->swtcl.vertex_format = 0;
+
+ if (rmesa->swtcl.indexed_verts.buf)
+ radeonReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts,
+ __FUNCTION__ );
+
+ if (RADEON_DEBUG & DEBUG_FALLBACKS)
+ fprintf(stderr, "Radeon end tcl fallback\n");
+}
+
+static char *fallbackStrings[] = {
+ "Rasterization fallback",
+ "Unfilled triangles",
+ "Twosided lighting, differing materials",
+ "Materials in VB (maybe between begin/end)",
+ "Texgen unit 0",
+ "Texgen unit 1",
+ "Texgen unit 2",
+ "User disable"
+};
+
+
+static char *getFallbackString(GLuint bit)
+{
+ int i = 0;
+ while (bit > 1) {
+ i++;
+ bit >>= 1;
+ }
+ return fallbackStrings[i];
+}
+
+
+
+void radeonTclFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLuint oldfallback = rmesa->TclFallback;
+
+ if (mode) {
+ rmesa->TclFallback |= bit;
+ if (oldfallback == 0) {
+ if (RADEON_DEBUG & DEBUG_FALLBACKS)
+ fprintf(stderr, "Radeon begin tcl fallback %s\n",
+ getFallbackString( bit ));
+ transition_to_swtnl( ctx );
+ }
+ }
+ else {
+ rmesa->TclFallback &= ~bit;
+ if (oldfallback == bit) {
+ if (RADEON_DEBUG & DEBUG_FALLBACKS)
+ fprintf(stderr, "Radeon end tcl fallback %s\n",
+ getFallbackString( bit ));
+ transition_to_hwtnl( ctx );
+ }
+ }
+}
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.h b/xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.h
new file mode 100644
index 000000000..4edf33154
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.h
@@ -0,0 +1,66 @@
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
+ Tungsten Grahpics Inc., Austin, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ATI, TUNGSTEN GRAHPICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ *
+ */
+
+#ifndef __RADEON_TCL_H__
+#define __RADEON_TCL_H__
+
+#ifdef GLX_DIRECT_RENDERING
+
+#include "radeon_context.h"
+
+extern void radeonTclPrimitive( GLcontext *ctx, GLenum prim, int hw_prim );
+extern void radeonEmitEltPrimitive( GLcontext *ctx, GLuint first, GLuint last,
+ GLuint flags );
+extern void radeonEmitPrimitive( GLcontext *ctx, GLuint first, GLuint last,
+ GLuint flags );
+
+extern void radeonTclFallback( GLcontext *ctx, GLuint bit, GLboolean mode );
+
+#define RADEON_TCL_FALLBACK_RASTER 0x1 /* rasterization */
+#define RADEON_TCL_FALLBACK_UNFILLED 0x2 /* unfilled tris */
+#define RADEON_TCL_FALLBACK_LIGHT_TWOSIDE 0x4 /* twoside tris */
+#define RADEON_TCL_FALLBACK_MATERIAL 0x8 /* material in vb */
+#define RADEON_TCL_FALLBACK_TEXGEN_0 0x10 /* texgen, unit 0 */
+#define RADEON_TCL_FALLBACK_TEXGEN_1 0x20 /* texgen, unit 1 */
+#define RADEON_TCL_FALLBACK_TEXGEN_2 0x40 /* texgen, unit 2 */
+#define RADEON_TCL_FALLBACK_TCL_DISABLE 0x80 /* user disable */
+
+#define RADEON_MAX_TCL_VERTSIZE (15*4)
+
+#define TCL_FALLBACK( ctx, bit, mode ) radeonTclFallback( ctx, bit, mode )
+
+
+#endif
+#endif
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c
index 701cd6f25..7aed7ca16 100644
--- a/xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c
@@ -29,22 +29,22 @@
* Brian Paul <brianp@valinux.com>
*/
-#include "radeon_context.h"
-#include "radeon_state.h"
-#include "radeon_ioctl.h"
-#include "radeon_vb.h"
-#include "radeon_tex.h"
-
+#include "glheader.h"
+#include "imports.h"
#include "colormac.h"
#include "context.h"
#include "enums.h"
#include "image.h"
-#include "mem.h"
-#include "mmath.h"
#include "simple_list.h"
#include "texformat.h"
#include "texstore.h"
-#include "texutil.h"
+
+#include "radeon_context.h"
+#include "radeon_state.h"
+#include "radeon_ioctl.h"
+#include "radeon_swtcl.h"
+#include "radeon_tex.h"
+
/* =============================================================
@@ -65,6 +65,18 @@ static void radeonSetTexWrap( radeonTexObjPtr t, GLenum swrap, GLenum twrap )
case GL_CLAMP_TO_EDGE:
t->pp_txfilter |= RADEON_CLAMP_S_CLAMP_LAST;
break;
+ case GL_CLAMP_TO_BORDER:
+ t->pp_txfilter |= RADEON_CLAMP_S_CLAMP_BORDER;
+ break;
+ case GL_MIRRORED_REPEAT:
+ t->pp_txfilter |= RADEON_CLAMP_S_MIRROR;
+ break;
+ case GL_MIRROR_CLAMP_ATI:
+ t->pp_txfilter |= RADEON_CLAMP_S_MIRROR_CLAMP_BORDER;
+ break;
+ case GL_MIRROR_CLAMP_TO_EDGE_ATI:
+ t->pp_txfilter |= RADEON_CLAMP_S_MIRROR_CLAMP_LAST;
+ break;
}
switch ( twrap ) {
@@ -77,6 +89,18 @@ static void radeonSetTexWrap( radeonTexObjPtr t, GLenum swrap, GLenum twrap )
case GL_CLAMP_TO_EDGE:
t->pp_txfilter |= RADEON_CLAMP_T_CLAMP_LAST;
break;
+ case GL_CLAMP_TO_BORDER:
+ t->pp_txfilter |= RADEON_CLAMP_T_CLAMP_BORDER;
+ break;
+ case GL_MIRRORED_REPEAT:
+ t->pp_txfilter |= RADEON_CLAMP_T_MIRROR;
+ break;
+ case GL_MIRROR_CLAMP_ATI:
+ t->pp_txfilter |= RADEON_CLAMP_T_MIRROR_CLAMP_BORDER;
+ break;
+ case GL_MIRROR_CLAMP_TO_EDGE_ATI:
+ t->pp_txfilter |= RADEON_CLAMP_T_MIRROR_CLAMP_LAST;
+ break;
}
}
@@ -167,27 +191,19 @@ static radeonTexObjPtr radeonAllocTexObj( struct gl_texture_object *texObj )
if (!t)
return NULL;
- if ( RADEON_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %p, %p )\n",__FUNCTION__, (void*)texObj, (void*)t );
+ if ( RADEON_DEBUG & DEBUG_TEXTURE ) {
+ fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, texObj, t );
}
- /* Initialize non-image-dependent parts of the state:
- */
t->tObj = texObj;
-#if 0
- t->dirty_images = ~0;
-#endif
- t->pp_txfilter = RADEON_BORDER_MODE_OGL;
- t->pp_txformat = (RADEON_TXFORMAT_ENDIAN_NO_SWAP |
- RADEON_TXFORMAT_PERSPECTIVE_ENABLE);
-
make_empty_list( t );
+ /* Initialize non-image-dependent parts of the state:
+ */
radeonSetTexWrap( t, texObj->WrapS, texObj->WrapT );
radeonSetTexMaxAnisotropy( t, texObj->MaxAnisotropy );
radeonSetTexFilter( t, texObj->MinFilter, texObj->MagFilter );
- radeonSetTexBorderColor( t, texObj->BorderColor );
-
+ radeonSetTexBorderColor( t, texObj->_BorderChan );
return t;
}
@@ -202,6 +218,7 @@ radeonChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
switch ( internalFormat ) {
case 4:
case GL_RGBA:
+ case GL_COMPRESSED_RGBA:
if ( format == GL_BGRA ) {
if ( type == GL_UNSIGNED_INT_8_8_8_8_REV ) {
return &_mesa_texformat_argb8888;
@@ -217,6 +234,7 @@ radeonChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case 3:
case GL_RGB:
+ case GL_COMPRESSED_RGB:
if ( format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 ) {
return &_mesa_texformat_rgb565;
}
@@ -251,6 +269,7 @@ radeonChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_ALPHA8:
case GL_ALPHA12:
case GL_ALPHA16:
+ case GL_COMPRESSED_ALPHA:
return &_mesa_texformat_al88;
case 1:
@@ -259,6 +278,7 @@ radeonChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_LUMINANCE8:
case GL_LUMINANCE12:
case GL_LUMINANCE16:
+ case GL_COMPRESSED_LUMINANCE:
return &_mesa_texformat_al88;
case 2:
@@ -269,6 +289,7 @@ radeonChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_LUMINANCE12_ALPHA4:
case GL_LUMINANCE12_ALPHA12:
case GL_LUMINANCE16_ALPHA16:
+ case GL_COMPRESSED_LUMINANCE_ALPHA:
return &_mesa_texformat_al88;
case GL_INTENSITY:
@@ -276,6 +297,7 @@ radeonChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_INTENSITY8:
case GL_INTENSITY12:
case GL_INTENSITY16:
+ case GL_COMPRESSED_INTENSITY:
return &_mesa_texformat_i8;
default:
@@ -316,13 +338,6 @@ static void radeonTexImage1D( GLcontext *ctx, GLenum target, GLint level,
&ctx->Unpack, texObj, texImage);
t->dirty_images |= (1 << level);
-
- if ( t == rmesa->state.texture.unit[0].texobj ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX0 );
- }
- if ( t == rmesa->state.texture.unit[1].texobj ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX1 );
- }
}
@@ -357,13 +372,6 @@ static void radeonTexSubImage1D( GLcontext *ctx, GLenum target, GLint level,
texImage);
t->dirty_images |= (1 << level);
-
- if ( t == rmesa->state.texture.unit[0].texobj ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX0 );
- }
- if ( t == rmesa->state.texture.unit[1].texobj ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX1 );
- }
}
@@ -378,6 +386,8 @@ static void radeonTexImage2D( GLcontext *ctx, GLenum target, GLint level,
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
radeonTexObjPtr t = (radeonTexObjPtr)texObj->DriverData;
+/* fprintf(stderr, "%s\n", __FUNCTION__); */
+
if ( t ) {
radeonSwapOutTexObj( rmesa, t );
}
@@ -396,13 +406,6 @@ static void radeonTexImage2D( GLcontext *ctx, GLenum target, GLint level,
&ctx->Unpack, texObj, texImage);
t->dirty_images |= (1 << level);
-
- if ( t == rmesa->state.texture.unit[0].texobj ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX0 );
- }
- if ( t == rmesa->state.texture.unit[1].texobj ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX1 );
- }
}
@@ -418,10 +421,11 @@ static void radeonTexSubImage2D( GLcontext *ctx, GLenum target, GLint level,
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
radeonTexObjPtr t = (radeonTexObjPtr) texObj->DriverData;
+/* fprintf(stderr, "%s\n", __FUNCTION__); */
+
assert( t ); /* this _should_ be true */
if ( t ) {
radeonSwapOutTexObj( rmesa, t );
- t->dirty_images |= (1 << level);
}
else {
t = radeonAllocTexObj(texObj);
@@ -437,88 +441,12 @@ static void radeonTexSubImage2D( GLcontext *ctx, GLenum target, GLint level,
texImage);
t->dirty_images |= (1 << level);
-
- if ( t == rmesa->state.texture.unit[0].texobj ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX0 );
- }
- if ( t == rmesa->state.texture.unit[1].texobj ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX1 );
- }
}
-#if 0
-static void radeonTexImage3D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint depth,
- GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- radeonTexObjPtr t = (radeonTexObjPtr)texObj->DriverData;
-
- if ( t ) {
- radeonSwapOutTexObj( rmesa, t );
- }
- else {
- t = radeonAllocTexObj( texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D");
- return;
- }
- texObj->DriverData = t;
- }
-
- /* Note, this will call radeonChooseTextureFormat */
- _mesa_store_teximage3d(ctx, target, level, internalFormat,
- width, height, depth, border, format, type, pixels,
- &ctx->Unpack, texObj, texImage);
-
- t->dirty_images |= (1 << level);
-
- if ( t == rmesa->state.texture.unit[0].texobj ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX0 );
- }
- if ( t == rmesa->state.texture.unit[1].texobj ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX1 );
- }
-}
-
-
-static void radeonTexSubImage3D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLint depth,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- radeonTexObjPtr t = (radeonTexObjPtr) texObj->DriverData;
-
- assert( t ); /* this _should_ be true */
-
- _mesa_store_texsubimage3d(ctx, target, level, xoffset, yoffset, zoffset,
- width, height, depth, format, type, pixels,
- packing, texObj, texImage);
-
- t->dirty_images |= (1 << level);
-
- if ( t == rmesa->state.texture.unit[0].texobj ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX0 );
- }
- if ( t == rmesa->state.texture.unit[1].texobj ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX1 );
- }
-}
-#endif
#define SCALED_FLOAT_TO_BYTE( x, scale ) \
- ((((GLint)((256.0F / scale) * (x))) - 1) / 2)
+ (((GLuint)((255.0F / scale) * (x))) / 2)
static void radeonTexEnv( GLcontext *ctx, GLenum target,
GLenum pname, const GLfloat *param )
@@ -527,7 +455,7 @@ static void radeonTexEnv( GLcontext *ctx, GLenum target,
GLuint unit = ctx->Texture.CurrentUnit;
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- if ( RADEON_DEBUG & DEBUG_VERBOSE_API ) {
+ if ( RADEON_DEBUG & DEBUG_STATE ) {
fprintf( stderr, "%s( %s )\n",
__FUNCTION__, _mesa_lookup_enum_by_nr( pname ) );
}
@@ -538,11 +466,9 @@ static void radeonTexEnv( GLcontext *ctx, GLenum target,
GLuint envColor;
UNCLAMPED_FLOAT_TO_RGBA_CHAN( c, texUnit->EnvColor );
envColor = radeonPackColor( 4, c[0], c[1], c[2], c[3] );
- if ( rmesa->state.hw.texture[unit].pp_tfactor != envColor ) {
- if ( rmesa->state.texture.unit[unit].texobj ) {
- RADEON_STATECHANGE( rmesa, (RADEON_UPLOAD_TEX0 << unit) );
- }
- rmesa->state.hw.texture[unit].pp_tfactor = envColor;
+ if ( rmesa->hw.tex[unit].cmd[TEX_PP_TFACTOR] != envColor ) {
+ RADEON_STATECHANGE( rmesa, tex[unit] );
+ rmesa->hw.tex[unit].cmd[TEX_PP_TFACTOR] = envColor;
}
break;
}
@@ -560,14 +486,14 @@ static void radeonTexEnv( GLcontext *ctx, GLenum target,
if ( bias == 0 ) {
b = 0;
} else if ( bias > 0 ) {
- b = ((GLuint)SCALED_FLOAT_TO_BYTE( bias, 4.0 )) << 8;
+ b = ((GLuint)SCALED_FLOAT_TO_BYTE( bias, 4.0 )) << RADEON_LOD_BIAS_SHIFT;
} else {
- b = ((GLuint)SCALED_FLOAT_TO_BYTE( bias, 1.0 )) << 8;
+ b = ((GLuint)SCALED_FLOAT_TO_BYTE( bias, 1.0 )) << RADEON_LOD_BIAS_SHIFT;
}
- if ( rmesa->state.hw.texture[unit].pp_txfilter != b ) {
- if ( rmesa->state.texture.unit[unit].texobj )
- RADEON_STATECHANGE( rmesa, (RADEON_UPLOAD_TEX0 << unit) );
- rmesa->state.hw.texture[unit].pp_txfilter = b;
+ if ( (rmesa->hw.tex[unit].cmd[TEX_PP_TXFILTER] & RADEON_LOD_BIAS_MASK) != b ) {
+ RADEON_STATECHANGE( rmesa, tex[unit] );
+ rmesa->hw.tex[unit].cmd[TEX_PP_TXFILTER] &= ~RADEON_LOD_BIAS_MASK;
+ rmesa->hw.tex[unit].cmd[TEX_PP_TXFILTER] |= (b & RADEON_LOD_BIAS_MASK);
}
break;
}
@@ -584,8 +510,8 @@ static void radeonTexParameter( GLcontext *ctx, GLenum target,
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
radeonTexObjPtr t = (radeonTexObjPtr) texObj->DriverData;
- if ( RADEON_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %s )\n",__FUNCTION__,
+ if ( RADEON_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
+ fprintf( stderr, "%s( %s )\n", __FUNCTION__,
_mesa_lookup_enum_by_nr( pname ) );
}
@@ -596,6 +522,8 @@ static void radeonTexParameter( GLcontext *ctx, GLenum target,
switch ( pname ) {
case GL_TEXTURE_MIN_FILTER:
case GL_TEXTURE_MAG_FILTER:
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ radeonSetTexMaxAnisotropy( t, texObj->MaxAnisotropy );
radeonSetTexFilter( t, texObj->MinFilter, texObj->MagFilter );
break;
@@ -605,11 +533,7 @@ static void radeonTexParameter( GLcontext *ctx, GLenum target,
break;
case GL_TEXTURE_BORDER_COLOR:
- radeonSetTexBorderColor( t, texObj->BorderColor );
- break;
-
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- radeonSetTexMaxAnisotropy( t, texObj->MaxAnisotropy );
+ radeonSetTexBorderColor( t, texObj->_BorderChan );
break;
case GL_TEXTURE_BASE_LEVEL:
@@ -628,12 +552,9 @@ static void radeonTexParameter( GLcontext *ctx, GLenum target,
return;
}
- if ( t == rmesa->state.texture.unit[0].texobj ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX0 );
- }
- if ( t == rmesa->state.texture.unit[1].texobj ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX1 );
- }
+ /* Mark this texobj as dirty (one bit per tex unit)
+ */
+ t->dirty_state = TEX_ALL;
}
@@ -644,8 +565,8 @@ static void radeonBindTexture( GLcontext *ctx, GLenum target,
radeonTexObjPtr t = (radeonTexObjPtr) texObj->DriverData;
GLuint unit = ctx->Texture.CurrentUnit;
- if ( RADEON_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %p ) unit=%d\n",__FUNCTION__, (void*)texObj, unit );
+ if ( RADEON_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
+ fprintf( stderr, "%s( %p ) unit=%d\n", __FUNCTION__, texObj, unit );
}
if ( target == GL_TEXTURE_2D || target == GL_TEXTURE_1D ) {
@@ -662,8 +583,8 @@ static void radeonDeleteTexture( GLcontext *ctx,
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
radeonTexObjPtr t = (radeonTexObjPtr) texObj->DriverData;
- if ( RADEON_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %p )\n",__FUNCTION__, (void*)texObj );
+ if ( RADEON_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
+ fprintf( stderr, "%s( %p )\n", __FUNCTION__, texObj );
}
if ( t ) {
@@ -717,6 +638,27 @@ static void radeonInitTextureObjects( GLcontext *ctx )
ctx->Texture.CurrentUnit = tmp;
}
+/* Need:
+ * - Same GEN_MODE for all active bits
+ * - Same EyePlane/ObjPlane for all active bits when using Eye/Obj
+ * - STRQ presumably all supported (matrix means incoming R values
+ * can end up in STQ, this has implications for vertex support,
+ * presumably ok if maos is used, though?)
+ *
+ * Basically impossible to do this on the fly - just collect some
+ * basic info & do the checks from ValidateState().
+ */
+static void radeonTexGen( GLcontext *ctx,
+ GLenum coord,
+ GLenum pname,
+ const GLfloat *params )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLuint unit = ctx->Texture.CurrentUnit;
+ rmesa->recheck_texgen[unit] = GL_TRUE;
+}
+
+
void radeonInitTextureFuncs( GLcontext *ctx )
{
ctx->Driver.ChooseTextureFormat = radeonChooseTextureFormat;
@@ -730,7 +672,7 @@ void radeonInitTextureFuncs( GLcontext *ctx )
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.CopyTexSubImage3D = _swrast_copy_texsubimage3d;
ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage;
ctx->Driver.BindTexture = radeonBindTexture;
@@ -743,6 +685,7 @@ void radeonInitTextureFuncs( GLcontext *ctx )
ctx->Driver.TexEnv = radeonTexEnv;
ctx->Driver.TexParameter = radeonTexParameter;
+ ctx->Driver.TexGen = radeonTexGen;
radeonInitTextureObjects( ctx );
}
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c
index efa1fa26a..0b7cfa2d0 100644
--- a/xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c
@@ -34,20 +34,15 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
-#include "radeon_context.h"
-#include "radeon_state.h"
-#include "radeon_ioctl.h"
-#include "radeon_vb.h"
-#include "radeon_tex.h"
-
+#include "glheader.h"
+#include "imports.h"
#include "context.h"
-#include "colormac.h"
#include "mmath.h"
#include "macros.h"
#include "simple_list.h"
-#include "enums.h"
-#include "mem.h"
+#include "radeon_context.h"
+#include "radeon_tex.h"
/* Destroy hardware state associated with texture `t'.
@@ -57,8 +52,8 @@ void radeonDestroyTexObj( radeonContextPtr rmesa, radeonTexObjPtr t )
if ( !t )
return;
- if ( RADEON_DEBUG & DEBUG_VERBOSE_TEXTURE ) {
- fprintf( stderr, "%s( %p, %p )\n",__FUNCTION__, (void*)t, (void*)t->tObj );
+ if ( RADEON_DEBUG & DEBUG_TEXTURE ) {
+ fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, t, t->tObj );
}
if ( t->memBlock ) {
@@ -75,12 +70,14 @@ void radeonDestroyTexObj( radeonContextPtr rmesa, radeonTexObjPtr t )
if ( t == rmesa->state.texture.unit[0].texobj ) {
rmesa->state.texture.unit[0].texobj = NULL;
- rmesa->state.hw.dirty &= ~RADEON_UPLOAD_TEX0;
+ remove_from_list( &rmesa->hw.tex[0] );
+ make_empty_list( &rmesa->hw.tex[0] );
}
if ( t == rmesa->state.texture.unit[1].texobj ) {
rmesa->state.texture.unit[1].texobj = NULL;
- rmesa->state.hw.dirty &= ~RADEON_UPLOAD_TEX1;
+ remove_from_list( &rmesa->hw.tex[1] );
+ make_empty_list( &rmesa->hw.tex[1] );
}
}
@@ -88,12 +85,13 @@ void radeonDestroyTexObj( radeonContextPtr rmesa, radeonTexObjPtr t )
FREE( t );
}
+
/* Keep track of swapped out texture objects.
*/
void radeonSwapOutTexObj( radeonContextPtr rmesa, radeonTexObjPtr t )
{
- if ( RADEON_DEBUG & DEBUG_VERBOSE_TEXTURE ) {
- fprintf( stderr, "%s( %p, %p )\n",__FUNCTION__, (void*)t, (void*)t->tObj );
+ if ( RADEON_DEBUG & DEBUG_TEXTURE ) {
+ fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, t, t->tObj );
}
/* Bump the performace counter */
@@ -124,8 +122,7 @@ void radeonPrintLocalLRU( radeonContextPtr rmesa, int heap )
t->memBlock->ofs,
t->memBlock->size );
} else {
- fprintf( stderr, "Texture (bound %d) at 0x%x sz 0x%x\n",
- t->bound,
+ fprintf( stderr, "Texture at 0x%x sz 0x%x\n",
t->memBlock->ofs,
t->memBlock->size );
}
@@ -139,7 +136,7 @@ void radeonPrintGlobalLRU( radeonContextPtr rmesa, int heap )
radeon_tex_region_t *list = rmesa->sarea->texList[heap];
int i, j;
- fprintf( stderr, "\nGlobal LRU, heap %d list %p:\n", heap, (void*)list );
+ fprintf( stderr, "\nGlobal LRU, heap %d list %p:\n", heap, list );
for ( i = 0, j = RADEON_NR_TEX_REGIONS ; i < RADEON_NR_TEX_REGIONS ; i++ ) {
fprintf( stderr, "list[%d] age %d next %d prev %d\n",
@@ -329,9 +326,11 @@ static void radeonUploadSubImage( radeonContextPtr rmesa,
GLuint format, pitch, offset;
GLint imageWidth, imageHeight;
GLint ret;
+ drmRadeonTexture tex;
+ drmRadeonTexImage tmp;
- if ( RADEON_DEBUG & DEBUG_VERBOSE_TEXTURE ) {
- fprintf( stderr, "%s( %p, %p )\n",__FUNCTION__, (void*)t, (void*)t->tObj );
+ if ( RADEON_DEBUG & DEBUG_TEXTURE ) {
+ fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, t, t->tObj );
}
/* Ensure we have a valid texture to upload */
@@ -343,13 +342,13 @@ static void radeonUploadSubImage( radeonContextPtr rmesa,
texImage = t->tObj->Image[level];
if ( !texImage ) {
- if ( RADEON_DEBUG & DEBUG_VERBOSE_TEXTURE )
- fprintf( stderr, "%s: texImage %d is NULL!\n",__FUNCTION__, level );
+ if ( RADEON_DEBUG & DEBUG_TEXTURE )
+ fprintf( stderr, "%s: texImage %d is NULL!\n", __FUNCTION__, level );
return;
}
if ( !texImage->Data ) {
- if ( RADEON_DEBUG & DEBUG_VERBOSE_TEXTURE )
- fprintf( stderr, "%s: image data is NULL!\n",__FUNCTION__ );
+ if ( RADEON_DEBUG & DEBUG_TEXTURE )
+ fprintf( stderr, "%s: image data is NULL!\n", __FUNCTION__ );
return;
}
@@ -380,7 +379,7 @@ static void radeonUploadSubImage( radeonContextPtr rmesa,
rmesa->c_textureBytes += (dwords << 2);
#endif
- if ( RADEON_DEBUG & DEBUG_VERBOSE_MSG ) {
+ if ( RADEON_DEBUG & (DEBUG_TEXTURE|DEBUG_IOCTL) ) {
GLint imageX = 0;
GLint imageY = 0;
GLint blitX = t->image[level].x;
@@ -397,12 +396,24 @@ static void radeonUploadSubImage( radeonContextPtr rmesa,
}
t->image[level].data = texImage->Data;
- ret = drmRadeonLoadTexture( rmesa->dri.fd, offset, pitch, format,
- imageWidth, imageHeight, &t->image[level] );
+
+ tex.offset = offset;
+ tex.pitch = pitch;
+ tex.format = format;
+ tex.width = imageWidth;
+ tex.height = imageHeight;
+ tex.image = &tmp;
+
+ memcpy( &tmp, &t->image[level], sizeof(drmRadeonTexImage) );
+
+ do {
+ ret = drmCommandWriteRead( rmesa->dri.fd, DRM_RADEON_TEXTURE,
+ &tex, sizeof(drmRadeonTexture) );
+ } while ( ret && errno == EAGAIN );
if ( ret ) {
UNLOCK_HARDWARE( rmesa );
- fprintf( stderr, "drmRadeonTextureBlit: return = %d\n", ret );
+ fprintf( stderr, "DRM_RADEON_TEXTURE: return = %d\n", ret );
fprintf( stderr, " offset=0x%08x pitch=0x%x format=%d\n",
offset, pitch, format );
fprintf( stderr, " image width=%d height=%d\n",
@@ -412,8 +423,6 @@ static void radeonUploadSubImage( radeonContextPtr rmesa,
t->image[level].data );
exit( 1 );
}
-
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT | RADEON_UPLOAD_MASKS );
}
/* Upload the texture images associated with texture `t'. This might
@@ -425,10 +434,12 @@ int radeonUploadTexImages( radeonContextPtr rmesa, radeonTexObjPtr t )
const int numLevels = t->lastLevel - t->firstLevel + 1;
int i;
int heap;
+ radeonTexObjPtr t0 = rmesa->state.texture.unit[0].texobj;
+ radeonTexObjPtr t1 = rmesa->state.texture.unit[1].texobj;
- if ( RADEON_DEBUG & DEBUG_VERBOSE_TEXTURE ) {
- fprintf( stderr, "%s( %p, %p ) sz=%d lvls=%d-%d\n",__FUNCTION__,
- (void*)rmesa->glCtx, (void*)t->tObj, t->totalSize,
+ if ( RADEON_DEBUG & (DEBUG_TEXTURE|DEBUG_IOCTL) ) {
+ fprintf( stderr, "%s( %p, %p ) sz=%d lvls=%d-%d\n", __FUNCTION__,
+ rmesa->glCtx, t->tObj, t->totalSize,
t->firstLevel, t->lastLevel );
}
@@ -465,7 +476,8 @@ int radeonUploadTexImages( radeonContextPtr rmesa, radeonTexObjPtr t )
/* Kick out textures until the requested texture fits */
while ( !t->memBlock ) {
- if ( rmesa->texture.objects[heap].prev->bound ) {
+ if ( rmesa->texture.objects[heap].prev == t0 ||
+ rmesa->texture.objects[heap].prev == t1 ) {
fprintf( stderr,
"radeonUploadTexImages: ran into bound texture\n" );
UNLOCK_HARDWARE( rmesa );
@@ -512,11 +524,9 @@ int radeonUploadTexImages( radeonContextPtr rmesa, radeonTexObjPtr t )
}
#endif
- if ( t == rmesa->state.texture.unit[0].texobj )
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX0 );
-
- if ( t == rmesa->state.texture.unit[1].texobj )
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_TEX1 );
+ /* Mark this texobj as dirty on all units:
+ */
+ t->dirty_state = TEX_ALL;
}
/* Let the world know we've used this memory recently */
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c
index f66f589cd..179525288 100644
--- a/xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c
@@ -34,21 +34,22 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
-#include "radeon_context.h"
-#include "radeon_state.h"
-#include "radeon_ioctl.h"
-#include "radeon_vb.h"
-#include "radeon_tex.h"
-
+#include "glheader.h"
+#include "imports.h"
#include "colormac.h"
#include "context.h"
#include "enums.h"
#include "macros.h"
-#include "mem.h"
#include "mmath.h"
-#include "simple_list.h"
#include "texformat.h"
+#include "radeon_context.h"
+#include "radeon_state.h"
+#include "radeon_ioctl.h"
+#include "radeon_swtcl.h"
+#include "radeon_tex.h"
+#include "radeon_tcl.h"
+
static void radeonSetTexImages( radeonContextPtr rmesa,
struct gl_texture_object *tObj )
@@ -228,6 +229,8 @@ static void radeonSetTexImages( radeonContextPtr rmesa,
t->pp_txformat |= ((log2Width << RADEON_TXFORMAT_WIDTH_SHIFT) |
(log2Height << RADEON_TXFORMAT_HEIGHT_SHIFT));
+ t->dirty_state = TEX_ALL;
+
radeonUploadTexImages( rmesa, t );
}
@@ -660,6 +663,19 @@ static GLuint radeon_previous_color[] =
RADEON_COLOR_ARG_A_CURRENT_ALPHA | RADEON_COMP_ARG_A
};
+/* GL_ZERO table - indices 0-3
+ * GL_ONE table - indices 1-4
+ */
+static GLuint radeon_zero_color[] =
+{
+ RADEON_COLOR_ARG_A_ZERO,
+ RADEON_COLOR_ARG_A_ZERO | RADEON_COMP_ARG_A,
+ RADEON_COLOR_ARG_A_ZERO,
+ RADEON_COLOR_ARG_A_ZERO | RADEON_COMP_ARG_A,
+ RADEON_COLOR_ARG_A_ZERO
+};
+
+
/* The alpha tables only have GL_SRC_ALPHA and GL_ONE_MINUS_SRC_ALPHA.
*/
static GLuint radeon_texture_alpha[][RADEON_MAX_TEXTURE_UNITS] =
@@ -694,6 +710,16 @@ static GLuint radeon_previous_alpha[] =
RADEON_ALPHA_ARG_A_CURRENT_ALPHA | RADEON_COMP_ARG_A
};
+/* GL_ZERO table - indices 0-1
+ * GL_ONE table - indices 1-2
+ */
+static GLuint radeon_zero_alpha[] =
+{
+ RADEON_ALPHA_ARG_A_ZERO,
+ RADEON_ALPHA_ARG_A_ZERO | RADEON_COMP_ARG_A,
+ RADEON_ALPHA_ARG_A_ZERO
+};
+
/* Extract the arg from slot A, shift it into the correct argument slot
* and set the corresponding complement bit.
@@ -723,7 +749,7 @@ do { \
* Texture unit state management
*/
-static void radeonUpdateTextureEnv( GLcontext *ctx, int unit )
+static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
@@ -733,9 +759,9 @@ static void radeonUpdateTextureEnv( GLcontext *ctx, int unit )
GLuint color_arg[3], alpha_arg[3];
GLuint i, numColorArgs = 0, numAlphaArgs = 0;
- if ( RADEON_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %p, %d ) format=%s\n",__FUNCTION__,
- (void*)ctx, unit, _mesa_lookup_enum_by_nr( format ) );
+ if ( RADEON_DEBUG & DEBUG_TEXTURE ) {
+ fprintf( stderr, "%s( %p, %d ) format=%s\n", __FUNCTION__,
+ ctx, unit, _mesa_lookup_enum_by_nr( format ) );
}
/* Set the texture environment state. Isn't this nice and clean?
@@ -764,7 +790,7 @@ static void radeonUpdateTextureEnv( GLcontext *ctx, int unit )
break;
case GL_COLOR_INDEX:
default:
- return;
+ return GL_FALSE;
}
break;
@@ -787,7 +813,7 @@ static void radeonUpdateTextureEnv( GLcontext *ctx, int unit )
break;
case GL_COLOR_INDEX:
default:
- return;
+ return GL_FALSE;
}
break;
@@ -807,7 +833,7 @@ static void radeonUpdateTextureEnv( GLcontext *ctx, int unit )
break;
case GL_COLOR_INDEX:
default:
- return;
+ return GL_FALSE;
}
break;
@@ -830,7 +856,7 @@ static void radeonUpdateTextureEnv( GLcontext *ctx, int unit )
break;
case GL_COLOR_INDEX:
default:
- return;
+ return GL_FALSE;
}
break;
@@ -853,7 +879,7 @@ static void radeonUpdateTextureEnv( GLcontext *ctx, int unit )
break;
case GL_COLOR_INDEX:
default:
- return;
+ return GL_FALSE;
}
break;
@@ -872,16 +898,22 @@ static void radeonUpdateTextureEnv( GLcontext *ctx, int unit )
break;
case GL_MODULATE:
case GL_ADD:
- case GL_ADD_SIGNED_EXT:
+ case GL_ADD_SIGNED:
+ case GL_SUBTRACT:
+ case GL_DOT3_RGB:
+ case GL_DOT3_RGBA:
case GL_DOT3_RGB_EXT:
case GL_DOT3_RGBA_EXT:
numColorArgs = 2;
break;
- case GL_INTERPOLATE_EXT:
+ case GL_INTERPOLATE:
+ case GL_MODULATE_ADD_ATI:
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ case GL_MODULATE_SUBTRACT_ATI:
numColorArgs = 3;
break;
default:
- return;
+ return GL_FALSE;
}
switch ( texUnit->CombineModeA ) {
@@ -890,14 +922,18 @@ static void radeonUpdateTextureEnv( GLcontext *ctx, int unit )
break;
case GL_MODULATE:
case GL_ADD:
- case GL_ADD_SIGNED_EXT:
+ case GL_ADD_SIGNED:
+ case GL_SUBTRACT:
numAlphaArgs = 2;
break;
- case GL_INTERPOLATE_EXT:
+ case GL_INTERPOLATE:
+ case GL_MODULATE_ADD_ATI:
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ case GL_MODULATE_SUBTRACT_ATI:
numAlphaArgs = 3;
break;
default:
- return;
+ return GL_FALSE;
}
/* Step 1:
@@ -911,17 +947,23 @@ static void radeonUpdateTextureEnv( GLcontext *ctx, int unit )
case GL_TEXTURE:
color_arg[i] = radeon_texture_color[op][unit];
break;
- case GL_CONSTANT_EXT:
+ case GL_CONSTANT:
color_arg[i] = radeon_tfactor_color[op];
break;
- case GL_PRIMARY_COLOR_EXT:
+ case GL_PRIMARY_COLOR:
color_arg[i] = radeon_primary_color[op];
break;
- case GL_PREVIOUS_EXT:
+ case GL_PREVIOUS:
color_arg[i] = radeon_previous_color[op];
break;
+ case GL_ZERO:
+ color_arg[i] = radeon_zero_color[op];
+ break;
+ case GL_ONE:
+ color_arg[i] = radeon_zero_color[op+1];
+ break;
default:
- return;
+ return GL_FALSE;
}
}
@@ -933,17 +975,23 @@ static void radeonUpdateTextureEnv( GLcontext *ctx, int unit )
case GL_TEXTURE:
alpha_arg[i] = radeon_texture_alpha[op][unit];
break;
- case GL_CONSTANT_EXT:
+ case GL_CONSTANT:
alpha_arg[i] = radeon_tfactor_alpha[op];
break;
- case GL_PRIMARY_COLOR_EXT:
+ case GL_PRIMARY_COLOR:
alpha_arg[i] = radeon_primary_alpha[op];
break;
- case GL_PREVIOUS_EXT:
+ case GL_PREVIOUS:
alpha_arg[i] = radeon_previous_alpha[op];
break;
+ case GL_ZERO:
+ alpha_arg[i] = radeon_zero_alpha[op];
+ break;
+ case GL_ONE:
+ alpha_arg[i] = radeon_zero_alpha[op+1];
+ break;
default:
- return;
+ return GL_FALSE;
}
}
@@ -973,7 +1021,7 @@ static void radeonUpdateTextureEnv( GLcontext *ctx, int unit )
RADEON_COLOR_ARG( 0, A );
RADEON_COLOR_ARG( 1, C );
break;
- case GL_ADD_SIGNED_EXT:
+ case GL_ADD_SIGNED:
color_combine = (RADEON_COLOR_ARG_B_ZERO |
RADEON_COMP_ARG_B |
RADEON_BLEND_CTL_ADDSIGNED |
@@ -981,13 +1029,31 @@ static void radeonUpdateTextureEnv( GLcontext *ctx, int unit )
RADEON_COLOR_ARG( 0, A );
RADEON_COLOR_ARG( 1, C );
break;
- case GL_INTERPOLATE_EXT:
+ case GL_SUBTRACT:
+ color_combine = (RADEON_COLOR_ARG_B_ZERO |
+ RADEON_COMP_ARG_B |
+ RADEON_BLEND_CTL_SUBTRACT |
+ RADEON_CLAMP_TX);
+ RADEON_COLOR_ARG( 0, A );
+ RADEON_COLOR_ARG( 1, C );
+ break;
+ case GL_INTERPOLATE:
color_combine = (RADEON_BLEND_CTL_BLEND |
RADEON_CLAMP_TX);
RADEON_COLOR_ARG( 0, B );
RADEON_COLOR_ARG( 1, A );
RADEON_COLOR_ARG( 2, C );
break;
+
+ case GL_DOT3_RGB:
+ case GL_DOT3_RGBA:
+ if ( texUnit->CombineScaleShiftRGB
+ != (RADEON_SCALE_1X >> RADEON_SCALE_SHIFT) )
+ {
+ return GL_FALSE;
+ }
+ /* FALLTHROUGH */
+
case GL_DOT3_RGB_EXT:
case GL_DOT3_RGBA_EXT:
color_combine = (RADEON_COLOR_ARG_C_ZERO |
@@ -996,8 +1062,30 @@ static void radeonUpdateTextureEnv( GLcontext *ctx, int unit )
RADEON_COLOR_ARG( 0, A );
RADEON_COLOR_ARG( 1, B );
break;
+
+ case GL_MODULATE_ADD_ATI:
+ color_combine = (RADEON_BLEND_CTL_ADD |
+ RADEON_CLAMP_TX);
+ RADEON_COLOR_ARG( 0, A );
+ RADEON_COLOR_ARG( 1, C );
+ RADEON_COLOR_ARG( 2, B );
+ break;
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ color_combine = (RADEON_BLEND_CTL_ADDSIGNED |
+ RADEON_CLAMP_TX);
+ RADEON_COLOR_ARG( 0, A );
+ RADEON_COLOR_ARG( 1, C );
+ RADEON_COLOR_ARG( 2, B );
+ break;
+ case GL_MODULATE_SUBTRACT_ATI:
+ color_combine = (RADEON_BLEND_CTL_SUBTRACT |
+ RADEON_CLAMP_TX);
+ RADEON_COLOR_ARG( 0, A );
+ RADEON_COLOR_ARG( 1, C );
+ RADEON_COLOR_ARG( 2, B );
+ break;
default:
- return;
+ return GL_FALSE;
}
switch ( texUnit->CombineModeA ) {
@@ -1023,7 +1111,7 @@ static void radeonUpdateTextureEnv( GLcontext *ctx, int unit )
RADEON_ALPHA_ARG( 0, A );
RADEON_ALPHA_ARG( 1, C );
break;
- case GL_ADD_SIGNED_EXT:
+ case GL_ADD_SIGNED:
alpha_combine = (RADEON_ALPHA_ARG_B_ZERO |
RADEON_COMP_ARG_B |
RADEON_BLEND_CTL_ADDSIGNED |
@@ -1031,31 +1119,64 @@ static void radeonUpdateTextureEnv( GLcontext *ctx, int unit )
RADEON_ALPHA_ARG( 0, A );
RADEON_ALPHA_ARG( 1, C );
break;
- case GL_INTERPOLATE_EXT:
+ case GL_SUBTRACT:
+ alpha_combine = (RADEON_COLOR_ARG_B_ZERO |
+ RADEON_COMP_ARG_B |
+ RADEON_BLEND_CTL_SUBTRACT |
+ RADEON_CLAMP_TX);
+ RADEON_ALPHA_ARG( 0, A );
+ RADEON_ALPHA_ARG( 1, C );
+ break;
+ case GL_INTERPOLATE:
alpha_combine = (RADEON_BLEND_CTL_BLEND |
RADEON_CLAMP_TX);
RADEON_ALPHA_ARG( 0, B );
RADEON_ALPHA_ARG( 1, A );
RADEON_ALPHA_ARG( 2, C );
break;
+
+ case GL_MODULATE_ADD_ATI:
+ alpha_combine = (RADEON_BLEND_CTL_ADD |
+ RADEON_CLAMP_TX);
+ RADEON_ALPHA_ARG( 0, A );
+ RADEON_ALPHA_ARG( 1, C );
+ RADEON_ALPHA_ARG( 2, B );
+ break;
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ alpha_combine = (RADEON_BLEND_CTL_ADDSIGNED |
+ RADEON_CLAMP_TX);
+ RADEON_ALPHA_ARG( 0, A );
+ RADEON_ALPHA_ARG( 1, C );
+ RADEON_ALPHA_ARG( 2, B );
+ break;
+ case GL_MODULATE_SUBTRACT_ATI:
+ alpha_combine = (RADEON_BLEND_CTL_SUBTRACT |
+ RADEON_CLAMP_TX);
+ RADEON_ALPHA_ARG( 0, A );
+ RADEON_ALPHA_ARG( 1, C );
+ RADEON_ALPHA_ARG( 2, B );
+ break;
default:
- return;
+ return GL_FALSE;
}
- if ( texUnit->CombineModeRGB == GL_DOT3_RGB_EXT ) {
+ if ( (texUnit->CombineModeRGB == GL_DOT3_RGB_EXT)
+ || (texUnit->CombineModeRGB == GL_DOT3_RGB_ARB) ) {
alpha_combine |= RADEON_DOT_ALPHA_DONT_REPLICATE;
}
/* Step 3:
- * Apply the scale factor. The EXT extension has a somewhat
- * unnecessary restriction that the scale must be 4x. The ARB
- * extension will likely drop this and we can just apply the
- * scale factors regardless.
+ * Apply the scale factor. 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. The catch is that the Radeon only supports a 1X
+ * multiplier in hardware w/the ARB version.
*/
if ( texUnit->CombineModeRGB != GL_DOT3_RGB_EXT &&
- texUnit->CombineModeRGB != GL_DOT3_RGBA_EXT ) {
- color_combine |= (texUnit->CombineScaleShiftRGB << 21);
- alpha_combine |= (texUnit->CombineScaleShiftA << 21);
+ texUnit->CombineModeRGB != GL_DOT3_RGBA_EXT &&
+ texUnit->CombineModeRGB != GL_DOT3_RGB &&
+ texUnit->CombineModeRGB != GL_DOT3_RGBA ) {
+ color_combine |= (texUnit->CombineScaleShiftRGB << RADEON_SCALE_SHIFT);
+ alpha_combine |= (texUnit->CombineScaleShiftA << RADEON_SCALE_SHIFT);
}
else
{
@@ -1068,57 +1189,227 @@ static void radeonUpdateTextureEnv( GLcontext *ctx, int unit )
break;
default:
- return;
+ return GL_FALSE;
}
- if ( rmesa->state.hw.texture[unit].pp_txcblend != color_combine ||
- rmesa->state.hw.texture[unit].pp_txablend != alpha_combine ) {
- RADEON_STATECHANGE( rmesa, (RADEON_UPLOAD_TEX0 << unit) );
- rmesa->state.hw.texture[unit].pp_txcblend = color_combine;
- rmesa->state.hw.texture[unit].pp_txablend = alpha_combine;
+ if ( rmesa->hw.tex[unit].cmd[TEX_PP_TXCBLEND] != color_combine ||
+ rmesa->hw.tex[unit].cmd[TEX_PP_TXABLEND] != alpha_combine ) {
+ RADEON_STATECHANGE( rmesa, tex[unit] );
+ rmesa->hw.tex[unit].cmd[TEX_PP_TXCBLEND] = color_combine;
+ rmesa->hw.tex[unit].cmd[TEX_PP_TXABLEND] = alpha_combine;
}
+
+ return GL_TRUE;
}
-static void radeonUpdateTextureUnit( GLcontext *ctx, int unit )
+#define TEXOBJ_TXFILTER_MASK (RADEON_MAX_MIP_LEVEL_MASK | \
+ RADEON_MIN_FILTER_MASK | \
+ RADEON_MAG_FILTER_MASK | \
+ RADEON_MAX_ANISO_MASK | \
+ RADEON_CLAMP_S_MASK | \
+ RADEON_CLAMP_T_MASK)
+
+#define TEXOBJ_TXFORMAT_MASK (RADEON_TXFORMAT_WIDTH_MASK | \
+ RADEON_TXFORMAT_HEIGHT_MASK | \
+ RADEON_TXFORMAT_FORMAT_MASK | \
+ RADEON_TXFORMAT_ALPHA_IN_MAP)
+
+
+static void import_tex_obj_state( radeonContextPtr rmesa,
+ int unit,
+ radeonTexObjPtr texobj )
{
+ GLuint *cmd = RADEON_DB_STATE( tex[unit] );
+
+ cmd[TEX_PP_TXFILTER] &= ~TEXOBJ_TXFILTER_MASK;
+ cmd[TEX_PP_TXFORMAT] &= ~TEXOBJ_TXFORMAT_MASK;
+ cmd[TEX_PP_TXFILTER] |= texobj->pp_txfilter & TEXOBJ_TXFILTER_MASK;
+ cmd[TEX_PP_TXFORMAT] |= texobj->pp_txformat & TEXOBJ_TXFORMAT_MASK;
+ cmd[TEX_PP_TXOFFSET] = texobj->pp_txoffset;
+ cmd[TEX_PP_BORDER_COLOR] = texobj->pp_border_color;
+ texobj->dirty_state &= ~(1<<unit);
+
+ RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.tex[unit] );
+}
+
+
+
+
+static void set_texgen_matrix( radeonContextPtr rmesa,
+ GLuint unit,
+ GLfloat *s_plane,
+ GLfloat *t_plane )
+{
+ static const GLfloat scale_identity[4] = { 1,1,1,1 };
+
+ if (!TEST_EQ_4V( s_plane, scale_identity) ||
+ !(TEST_EQ_4V( t_plane, scale_identity))) {
+ rmesa->TexGenEnabled |= RADEON_TEXMAT_0_ENABLE<<unit;
+ rmesa->TexGenMatrix[unit].m[0] = s_plane[0];
+ rmesa->TexGenMatrix[unit].m[4] = s_plane[1];
+ rmesa->TexGenMatrix[unit].m[8] = s_plane[2];
+ rmesa->TexGenMatrix[unit].m[12] = s_plane[3];
+
+ rmesa->TexGenMatrix[unit].m[1] = t_plane[0];
+ rmesa->TexGenMatrix[unit].m[5] = t_plane[1];
+ rmesa->TexGenMatrix[unit].m[9] = t_plane[2];
+ rmesa->TexGenMatrix[unit].m[13] = t_plane[3];
+ rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
+ }
+}
+
+/* Ignoring the Q texcoord for now.
+ *
+ * Returns GL_FALSE if fallback required.
+ */
+static GLboolean radeon_validate_texgen( GLcontext *ctx, GLuint unit )
+{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ GLuint inputshift = RADEON_TEXGEN_0_INPUT_SHIFT + unit*4;
+ GLuint tmp = rmesa->TexGenEnabled;
+
+ rmesa->TexGenEnabled &= ~(RADEON_TEXGEN_TEXMAT_0_ENABLE<<unit);
+ rmesa->TexGenEnabled &= ~(RADEON_TEXMAT_0_ENABLE<<unit);
+ rmesa->TexGenEnabled &= ~(RADEON_TEXGEN_INPUT_MASK<<inputshift);
+ rmesa->TexGenNeedNormals[unit] = 0;
+
+ if (0)
+ fprintf(stderr, "%s unit %d cleared texgenEnabled %x\n", __FUNCTION__,
+ unit, rmesa->TexGenEnabled);
+
+ if ((texUnit->TexGenEnabled & (S_BIT|T_BIT)) == 0) {
+ /* Disabled, no fallback:
+ */
+ rmesa->TexGenEnabled |=
+ (RADEON_TEXGEN_INPUT_TEXCOORD_0+unit) << inputshift;
+ return GL_TRUE;
+ }
+ else if (texUnit->TexGenEnabled & Q_BIT) {
+ /* Very easy to do this, in fact would remove a fallback case
+ * elsewhere, but I haven't done it yet... Fallback:
+ */
+ fprintf(stderr, "fallback Q_BIT\n");
+ return GL_FALSE;
+ }
+ else if ((texUnit->TexGenEnabled & (S_BIT|T_BIT)) != (S_BIT|T_BIT) ||
+ texUnit->GenModeS != texUnit->GenModeT) {
+ /* Mixed modes, fallback:
+ */
+/* fprintf(stderr, "fallback mixed texgen\n"); */
+ return GL_FALSE;
+ }
+ else
+ rmesa->TexGenEnabled |= RADEON_TEXGEN_TEXMAT_0_ENABLE << unit;
+
+ switch (texUnit->GenModeS) {
+ case GL_OBJECT_LINEAR:
+ rmesa->TexGenEnabled |= RADEON_TEXGEN_INPUT_OBJ << inputshift;
+ set_texgen_matrix( rmesa, unit,
+ texUnit->ObjectPlaneS,
+ texUnit->ObjectPlaneT);
+ break;
+
+ case GL_EYE_LINEAR:
+ rmesa->TexGenEnabled |= RADEON_TEXGEN_INPUT_EYE << inputshift;
+ set_texgen_matrix( rmesa, unit,
+ texUnit->EyePlaneS,
+ texUnit->EyePlaneT);
+ break;
- if ( texUnit->_ReallyEnabled & (TEXTURE0_1D|TEXTURE0_2D) ) {
+ case GL_REFLECTION_MAP_NV:
+ rmesa->TexGenNeedNormals[unit] = GL_TRUE;
+ rmesa->TexGenEnabled |= RADEON_TEXGEN_INPUT_EYE_REFLECT<<inputshift;
+ break;
+
+ case GL_NORMAL_MAP_NV:
+ rmesa->TexGenNeedNormals[unit] = GL_TRUE;
+ rmesa->TexGenEnabled |= RADEON_TEXGEN_INPUT_EYE_NORMAL<<inputshift;
+ break;
+
+ case GL_SPHERE_MAP:
+ default:
+ /* Unsupported mode, fallback:
+ */
+ /* fprintf(stderr, "fallback unsupported texgen\n"); */
+ return GL_FALSE;
+ }
+
+ if (tmp != rmesa->TexGenEnabled) {
+ rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
+ }
+
+/* fprintf(stderr, "%s unit %d texgenEnabled %x\n", __FUNCTION__, */
+/* unit, rmesa->TexGenEnabled); */
+ return GL_TRUE;
+}
+
+
+
+
+static GLboolean radeonUpdateTextureUnit( GLcontext *ctx, int unit )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+
+/* fprintf(stderr, "%s\n", __FUNCTION__); */
+
+ if ( texUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT) ) {
struct gl_texture_object *tObj = texUnit->_Current;
radeonTexObjPtr t = (radeonTexObjPtr) tObj->DriverData;
- GLuint flag = RADEON_UPLOAD_TEX0 << unit;
GLenum format;
/* Fallback if there's a texture border */
- if ( tObj->Image[tObj->BaseLevel]->Border > 0 ) {
- FALLBACK( rmesa, RADEON_FALLBACK_TEXTURE, GL_TRUE );
- return;
- }
+ if ( tObj->Image[tObj->BaseLevel]->Border > 0 )
+ return GL_FALSE;
/* Upload teximages (not pipelined)
*/
if ( t->dirty_images ) {
RADEON_FIREVERTICES( rmesa );
radeonSetTexImages( rmesa, tObj );
- if ( !t->memBlock ) {
- FALLBACK( rmesa, RADEON_FALLBACK_TEXTURE, GL_TRUE );
- return;
- }
+ /* Fallback if we can't upload:
+ */
+ if ( !t->memBlock )
+ return GL_FALSE;
}
/* Update state if this is a different texture object to last
* time.
*/
if ( rmesa->state.texture.unit[unit].texobj != t ) {
- if ( rmesa->state.texture.unit[unit].texobj == NULL ) {
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT );
- rmesa->state.hw.context.pp_cntl |= (RADEON_TEX_0_ENABLE |
- RADEON_TEX_BLEND_0_ENABLE)<<unit;
- }
- RADEON_STATECHANGE( rmesa, flag );
rmesa->state.texture.unit[unit].texobj = t;
- radeonUpdateTexLRU( rmesa, t ); /* done too often */
+ t->dirty_state |= 1<<unit;
+ radeonUpdateTexLRU( rmesa, t ); /* XXX: should be locked! */
+ }
+
+
+ /* Newly enabled?
+ */
+ if ( !(rmesa->hw.ctx.cmd[CTX_PP_CNTL] & (RADEON_TEX_0_ENABLE<<unit))) {
+ RADEON_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |=
+ (RADEON_TEX_0_ENABLE | RADEON_TEX_BLEND_0_ENABLE) << unit;
+
+ RADEON_STATECHANGE( rmesa, tcl );
+
+ if (unit == 0)
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_ST0;
+ else
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_ST1;
+
+ rmesa->recheck_texgen[unit] = GL_TRUE;
+ }
+
+ if (t->dirty_state & (1<<unit)) {
+ import_tex_obj_state( rmesa, unit, t );
+ }
+
+ if (rmesa->recheck_texgen[unit]) {
+ GLboolean fallback = !radeon_validate_texgen( ctx, unit );
+ TCL_FALLBACK( ctx, (RADEON_TCL_FALLBACK_TEXGEN_0<<unit), fallback);
+ rmesa->recheck_texgen[unit] = 0;
+ rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
}
format = tObj->Image[tObj->BaseLevel]->Format;
@@ -1126,27 +1417,76 @@ static void radeonUpdateTextureUnit( GLcontext *ctx, int unit )
rmesa->state.texture.unit[unit].envMode != texUnit->EnvMode ) {
rmesa->state.texture.unit[unit].format = format;
rmesa->state.texture.unit[unit].envMode = texUnit->EnvMode;
- radeonUpdateTextureEnv( ctx, unit );
+ if ( ! radeonUpdateTextureEnv( ctx, unit ) ) {
+ return GL_FALSE;
+ }
}
}
else if ( texUnit->_ReallyEnabled ) {
- FALLBACK( rmesa, RADEON_FALLBACK_TEXTURE, GL_TRUE );
- return;
+ /* 3d textures, etc:
+ */
+ return GL_FALSE;
}
- else {
+ else if (rmesa->hw.ctx.cmd[CTX_PP_CNTL] & (RADEON_TEX_0_ENABLE<<unit)) {
/* Texture unit disabled */
rmesa->state.texture.unit[unit].texobj = 0;
- rmesa->state.hw.dirty &= ~(RADEON_UPLOAD_TEX0 << unit);
- RADEON_STATECHANGE( rmesa, RADEON_UPLOAD_CONTEXT );
- rmesa->state.hw.context.pp_cntl &= ~((RADEON_TEX_0_ENABLE |
- RADEON_TEX_BLEND_0_ENABLE) << unit);
+ RADEON_STATECHANGE( rmesa, ctx );
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] &=
+ ~((RADEON_TEX_0_ENABLE | RADEON_TEX_BLEND_0_ENABLE) << unit);
+
+ RADEON_STATECHANGE( rmesa, tcl );
+ switch (unit) {
+ case 0:
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &= ~(RADEON_TCL_VTX_ST0 |
+ RADEON_TCL_VTX_Q0);
+ break;
+ case 1:
+ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &= ~(RADEON_TCL_VTX_ST1 |
+ RADEON_TCL_VTX_Q1);
+ break;
+ default:
+ break;
+ }
+
+
+ if (rmesa->TclFallback & (RADEON_TCL_FALLBACK_TEXGEN_0<<unit)) {
+ TCL_FALLBACK( ctx, (RADEON_TCL_FALLBACK_TEXGEN_0<<unit), GL_FALSE);
+ rmesa->recheck_texgen[unit] = GL_TRUE;
+ }
+
+
+
+ {
+ GLuint inputshift = RADEON_TEXGEN_0_INPUT_SHIFT + unit*4;
+ GLuint tmp = rmesa->TexGenEnabled;
+
+ rmesa->TexGenEnabled &= ~(RADEON_TEXGEN_TEXMAT_0_ENABLE<<unit);
+ rmesa->TexGenEnabled &= ~(RADEON_TEXMAT_0_ENABLE<<unit);
+ rmesa->TexGenEnabled &= ~(RADEON_TEXGEN_INPUT_MASK<<inputshift);
+ rmesa->TexGenNeedNormals[unit] = 0;
+ rmesa->TexGenEnabled |=
+ (RADEON_TEXGEN_INPUT_TEXCOORD_0+unit) << inputshift;
+
+ if (tmp != rmesa->TexGenEnabled) {
+ rmesa->recheck_texgen[unit] = GL_TRUE;
+ rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
+ }
+ }
}
+
+ return GL_TRUE;
}
void radeonUpdateTextureState( GLcontext *ctx )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- FALLBACK( rmesa, RADEON_FALLBACK_TEXTURE, GL_FALSE );
- radeonUpdateTextureUnit( ctx, 0 );
- radeonUpdateTextureUnit( ctx, 1 );
+ GLboolean ok;
+
+ ok = (radeonUpdateTextureUnit( ctx, 0 ) &&
+ radeonUpdateTextureUnit( ctx, 1 ));
+
+ FALLBACK( rmesa, RADEON_FALLBACK_TEXTURE, !ok );
+
+ if (rmesa->TclFallback)
+ radeonChooseVertexState( ctx );
}
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.c
index 6b06a33c2..da503b284 100644
--- a/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.c
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.c
@@ -1,607 +1,982 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.c,v 1.2 2002/09/10 00:39:39 dawes Exp $ */
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
+ Tungsten Graphics Inc., Cedar Park, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
/*
- * Copyright 2000, 2001 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
* Authors:
- * Gareth Hughes <gareth@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
+ *
*/
-
-
#include "glheader.h"
+#include "imports.h"
#include "api_noop.h"
-#include "colormac.h"
+#include "api_arrayelt.h"
#include "context.h"
-#include "light.h"
-#include "macros.h"
-#include "mem.h"
#include "mmath.h"
#include "mtypes.h"
-#include "simple_list.h"
+#include "enums.h"
+#include "glapi.h"
+#include "colormac.h"
+#include "light.h"
+#include "state.h"
#include "vtxfmt.h"
-#include "math/m_xform.h"
#include "tnl/tnl.h"
+#include "tnl/t_context.h"
+#include "tnl/t_array_api.h"
#include "radeon_context.h"
+#include "radeon_state.h"
#include "radeon_ioctl.h"
-#include "radeon_vb.h"
+#include "radeon_tex.h"
+#include "radeon_tcl.h"
#include "radeon_vtxfmt.h"
+struct radeon_vb vb;
-#define VERTEX radeonVertex
-#define TNL_VERTEX radeonTnlVertex
-
+static void radeonFlushVertices( GLcontext *, GLuint );
-#define LINTERP( T, A, B ) ((A) + (T) * ((B) - (A)))
-
-#define INTERP_RGBA( t, out, a, b ) \
-do { \
- GLint i; \
- for ( i = 0 ; i < 4 ; i++ ) { \
- GLfloat fa = UBYTE_TO_FLOAT( a[i] ); \
- GLfloat fb = UBYTE_TO_FLOAT( b[i] ); \
- GLfloat fo = LINTERP( t, fa, fb ); \
- UNCLAMPED_FLOAT_TO_UBYTE( out[i], fo ); \
- } \
-} while (0)
+static void count_func( const char *name, struct dynfn *l )
+{
+ int i = 0;
+ struct dynfn *f;
+ foreach (f, l) i++;
+ if (i) fprintf(stderr, "%s: %d\n", name, i );
+}
+static void count_funcs( radeonContextPtr rmesa )
+{
+ count_func( "Vertex2f", &rmesa->vb.dfn_cache.Vertex2f );
+ count_func( "Vertex2fv", &rmesa->vb.dfn_cache.Vertex2fv );
+ count_func( "Vertex3f", &rmesa->vb.dfn_cache.Vertex3f );
+ count_func( "Vertex3fv", &rmesa->vb.dfn_cache.Vertex3fv );
+ count_func( "Color4ub", &rmesa->vb.dfn_cache.Color4ub );
+ count_func( "Color4ubv", &rmesa->vb.dfn_cache.Color4ubv );
+ count_func( "Color3ub", &rmesa->vb.dfn_cache.Color3ub );
+ count_func( "Color3ubv", &rmesa->vb.dfn_cache.Color3ubv );
+ count_func( "Color4f", &rmesa->vb.dfn_cache.Color4f );
+ count_func( "Color4fv", &rmesa->vb.dfn_cache.Color4fv );
+ count_func( "Color3f", &rmesa->vb.dfn_cache.Color3f );
+ count_func( "Color3fv", &rmesa->vb.dfn_cache.Color3fv );
+ count_func( "SecondaryColor3f", &rmesa->vb.dfn_cache.SecondaryColor3fEXT );
+ count_func( "SecondaryColor3fv", &rmesa->vb.dfn_cache.SecondaryColor3fvEXT );
+ count_func( "SecondaryColor3ub", &rmesa->vb.dfn_cache.SecondaryColor3ubEXT );
+ count_func( "SecondaryColor3ubv", &rmesa->vb.dfn_cache.SecondaryColor3ubvEXT );
+ count_func( "Normal3f", &rmesa->vb.dfn_cache.Normal3f );
+ count_func( "Normal3fv", &rmesa->vb.dfn_cache.Normal3fv );
+ count_func( "TexCoord2f", &rmesa->vb.dfn_cache.TexCoord2f );
+ count_func( "TexCoord2fv", &rmesa->vb.dfn_cache.TexCoord2fv );
+ count_func( "TexCoord1f", &rmesa->vb.dfn_cache.TexCoord1f );
+ count_func( "TexCoord1fv", &rmesa->vb.dfn_cache.TexCoord1fv );
+ count_func( "MultiTexCoord2fARB", &rmesa->vb.dfn_cache.MultiTexCoord2fARB );
+ count_func( "MultiTexCoord2fvARB", &rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
+ count_func( "MultiTexCoord1fARB", &rmesa->vb.dfn_cache.MultiTexCoord1fARB );
+ count_func( "MultiTexCoord1fvARB", &rmesa->vb.dfn_cache.MultiTexCoord1fvARB );
+}
+void radeon_copy_to_current( GLcontext *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-/* ================================================================
- * Color functions: Always update ctx->Current.*
- */
+ assert(ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT);
+ assert(vb.context == ctx);
-/* ================================================================
- * Material functions:
- */
+ if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_N0) {
+ ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0] = vb.normalptr[0];
+ ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1] = vb.normalptr[1];
+ ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2] = vb.normalptr[2];
+ }
-static __inline void radeon_recalc_base_color( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- struct gl_light *light;
+ if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_PKCOLOR) {
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] = UBYTE_TO_FLOAT( vb.colorptr->red );
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] = UBYTE_TO_FLOAT( vb.colorptr->green );
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] = UBYTE_TO_FLOAT( vb.colorptr->blue );
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = UBYTE_TO_FLOAT( vb.colorptr->alpha );
+ }
+
+ if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_FPCOLOR) {
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] = vb.floatcolorptr[0];
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] = vb.floatcolorptr[1];
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] = vb.floatcolorptr[2];
+ }
- COPY_3V( rmesa->state.light.base_color, ctx->Light._BaseColor[0] );
- foreach ( light, &ctx->Light.EnabledList ) {
- ACC_3V( rmesa->state.light.base_color, light->_MatAmbient[0] );
+ if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_FPALPHA)
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = vb.floatcolorptr[3];
+
+ if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_PKSPEC) {
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0] = UBYTE_TO_FLOAT( vb.specptr->red );
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1] = UBYTE_TO_FLOAT( vb.specptr->green );
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2] = UBYTE_TO_FLOAT( vb.specptr->blue );
+ }
+
+ if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_ST0) {
+ ctx->Current.Attrib[VERT_ATTRIB_TEX0][0] = vb.texcoordptr[0][0];
+ ctx->Current.Attrib[VERT_ATTRIB_TEX0][1] = vb.texcoordptr[0][1];
+ ctx->Current.Attrib[VERT_ATTRIB_TEX0][2] = 0.0F;
+ ctx->Current.Attrib[VERT_ATTRIB_TEX0][3] = 1.0F;
}
-
- UNCLAMPED_FLOAT_TO_UBYTE( rmesa->state.light.base_alpha,
- ctx->Light.Material[0].Diffuse[3] );
-}
+ if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_ST1) {
+ ctx->Current.Attrib[VERT_ATTRIB_TEX1][0] = vb.texcoordptr[1][0];
+ ctx->Current.Attrib[VERT_ATTRIB_TEX1][1] = vb.texcoordptr[1][1];
+ ctx->Current.Attrib[VERT_ATTRIB_TEX1][2] = 0.0F;
+ ctx->Current.Attrib[VERT_ATTRIB_TEX1][3] = 1.0F;
+ }
-/* ================================================================
- * Normal functions:
- */
+ ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT;
+}
-struct radeon_norm_tab {
- void (*normal3f_multi)( GLfloat x, GLfloat y, GLfloat z );
- void (*normal3fv_multi)( const GLfloat *v );
- void (*normal3f_single)( GLfloat x, GLfloat y, GLfloat z );
- void (*normal3fv_single)( const GLfloat *v );
+static GLboolean discreet_gl_prim[GL_POLYGON+1] = {
+ 1, /* 0 points */
+ 1, /* 1 lines */
+ 0, /* 2 line_strip */
+ 0, /* 3 line_loop */
+ 1, /* 4 tris */
+ 0, /* 5 tri_fan */
+ 0, /* 6 tri_strip */
+ 1, /* 7 quads */
+ 0, /* 8 quadstrip */
+ 0, /* 9 poly */
};
-static struct radeon_norm_tab norm_tab[0x4];
-
+static void flush_prims( radeonContextPtr rmesa )
+{
+ int i,j;
+ struct radeon_dma_region tmp = rmesa->dma.current;
+
+ tmp.buf->refcount++;
+ tmp.aos_size = vb.vertex_size;
+ tmp.aos_stride = vb.vertex_size;
+ tmp.aos_start = GET_START(&tmp);
+
+ rmesa->dma.current.ptr = rmesa->dma.current.start +=
+ (vb.initial_counter - vb.counter) * vb.vertex_size * 4;
+
+ rmesa->tcl.vertex_format = rmesa->vb.vertex_format;
+ rmesa->tcl.aos_components[0] = &tmp;
+ rmesa->tcl.nr_aos_components = 1;
+ rmesa->dma.flush = 0;
+
+ /* Optimize the primitive list:
+ */
+ if (rmesa->vb.nrprims > 1) {
+ for (j = 0, i = 1 ; i < rmesa->vb.nrprims; i++) {
+ int pj = rmesa->vb.primlist[j].prim & 0xf;
+ int pi = rmesa->vb.primlist[i].prim & 0xf;
+
+ if (pj == pi && discreet_gl_prim[pj] &&
+ rmesa->vb.primlist[i].start == rmesa->vb.primlist[j].end) {
+ rmesa->vb.primlist[j].end = rmesa->vb.primlist[i].end;
+ }
+ else {
+ j++;
+ if (j != i) rmesa->vb.primlist[j] = rmesa->vb.primlist[i];
+ }
+ }
+ rmesa->vb.nrprims = j+1;
+ }
-#define HAVE_HW_LIGHTING 0
+ for (i = 0 ; i < rmesa->vb.nrprims; i++) {
+ if (RADEON_DEBUG & DEBUG_PRIMS)
+ fprintf(stderr, "vtxfmt prim %d: %s %d..%d\n", i,
+ _mesa_lookup_enum_by_nr( rmesa->vb.primlist[i].prim &
+ PRIM_MODE_MASK ),
+ rmesa->vb.primlist[i].start,
+ rmesa->vb.primlist[i].end);
+
+ radeonEmitPrimitive( vb.context,
+ rmesa->vb.primlist[i].start,
+ rmesa->vb.primlist[i].end,
+ rmesa->vb.primlist[i].prim );
+ }
-#define GET_CURRENT_VERTEX \
- GET_CURRENT_CONTEXT(ctx); \
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \
- radeonTnlVertexPtr v = rmesa->imm.v0
+ rmesa->vb.nrprims = 0;
+ radeonReleaseDmaRegion( rmesa, &tmp, __FUNCTION__ );
+}
-#define CURRENT_NORMAL rmesa->state.current.normal
-#define BASE_COLOR rmesa->state.light.base_color
-#define BASE_ALPHA rmesa->state.light.base_alpha
-#define VERT_COLOR( COMP ) v->color[COMP]
+static void start_prim( radeonContextPtr rmesa, GLuint mode )
+{
+ if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s %d\n", __FUNCTION__, vb.initial_counter - vb.counter);
+ rmesa->vb.primlist[rmesa->vb.nrprims].start = vb.initial_counter - vb.counter;
+ rmesa->vb.primlist[rmesa->vb.nrprims].prim = mode;
+}
-#define IND (0)
-#define TAG(x) radeon_##x
-#define PRESERVE_NORMAL_DEFS
-#include "tnl_dd/t_dd_imm_napi.h"
+static void note_last_prim( radeonContextPtr rmesa, GLuint flags )
+{
+ if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s %d\n", __FUNCTION__, vb.initial_counter - vb.counter);
-#define IND (NORM_RESCALE)
-#define TAG(x) radeon_##x##_rescale
-#define PRESERVE_NORMAL_DEFS
-#include "tnl_dd/t_dd_imm_napi.h"
+ if (rmesa->vb.prim[0] != GL_POLYGON+1) {
+ rmesa->vb.primlist[rmesa->vb.nrprims].prim |= flags;
+ rmesa->vb.primlist[rmesa->vb.nrprims].end = vb.initial_counter - vb.counter;
-#define IND (NORM_NORMALIZE)
-#define TAG(x) radeon_##x##_normalize
-#include "tnl_dd/t_dd_imm_napi.h"
+ if (++(rmesa->vb.nrprims) == RADEON_MAX_PRIMS)
+ flush_prims( rmesa );
+ }
+}
-static void radeon_init_norm_funcs( void )
+static void copy_vertex( radeonContextPtr rmesa, GLuint n, GLfloat *dst )
{
- radeon_init_norm();
- radeon_init_norm_rescale();
- radeon_init_norm_normalize();
-}
+ GLuint i;
+ GLfloat *src = (GLfloat *)(rmesa->dma.current.address +
+ rmesa->dma.current.ptr +
+ (rmesa->vb.primlist[rmesa->vb.nrprims].start + n) *
+ vb.vertex_size * 4);
-static void radeon_choose_Normal3f( GLfloat x, GLfloat y, GLfloat z )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint index;
+ if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "copy_vertex %d\n", rmesa->vb.primlist[rmesa->vb.nrprims].start + n);
- if ( ctx->Light.Enabled ) {
- if ( ctx->Transform.Normalize ) {
- index = NORM_NORMALIZE;
- }
- else if ( !ctx->Transform.RescaleNormals &&
- ctx->_ModelViewInvScale != 1.0 ) {
- index = NORM_RESCALE;
- }
- else {
- index = 0;
- }
+ for (i = 0 ; i < vb.vertex_size; i++) {
+ dst[i] = src[i];
+ }
+}
- if ( ctx->Light.EnabledList.next == ctx->Light.EnabledList.prev ) {
- ctx->Exec->Normal3f = norm_tab[index].normal3f_single;
+/* NOTE: This actually reads the copied vertices back from uncached
+ * memory. Could also use the counter/notify mechanism to populate
+ * tmp on the fly as vertices are generated.
+ */
+static GLuint copy_dma_verts( radeonContextPtr rmesa, GLfloat (*tmp)[15] )
+{
+ GLuint ovf, i;
+ GLuint nr = (vb.initial_counter - vb.counter) - rmesa->vb.primlist[rmesa->vb.nrprims].start;
+
+ if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s %d verts\n", __FUNCTION__, nr);
+
+ switch( rmesa->vb.prim[0] )
+ {
+ case GL_POINTS:
+ return 0;
+ case GL_LINES:
+ ovf = nr&1;
+ for (i = 0 ; i < ovf ; i++)
+ copy_vertex( rmesa, nr-ovf+i, tmp[i] );
+ return i;
+ case GL_TRIANGLES:
+ ovf = nr%3;
+ for (i = 0 ; i < ovf ; i++)
+ copy_vertex( rmesa, nr-ovf+i, tmp[i] );
+ return i;
+ case GL_QUADS:
+ ovf = nr&3;
+ for (i = 0 ; i < ovf ; i++)
+ copy_vertex( rmesa, nr-ovf+i, tmp[i] );
+ return i;
+ case GL_LINE_STRIP:
+ if (nr == 0)
+ return 0;
+ copy_vertex( rmesa, nr-1, tmp[0] );
+ return 1;
+ case GL_LINE_LOOP:
+ case GL_TRIANGLE_FAN:
+ case GL_POLYGON:
+ if (nr == 0)
+ return 0;
+ else if (nr == 1) {
+ copy_vertex( rmesa, 0, tmp[0] );
+ return 1;
} else {
- ctx->Exec->Normal3f = norm_tab[index].normal3f_multi;
+ copy_vertex( rmesa, 0, tmp[0] );
+ copy_vertex( rmesa, nr-1, tmp[1] );
+ return 2;
}
- } else {
- ctx->Exec->Normal3f = _mesa_noop_Normal3f;
+ case GL_TRIANGLE_STRIP:
+ ovf = MIN2( nr-1, 2 );
+ for (i = 0 ; i < ovf ; i++)
+ copy_vertex( rmesa, nr-ovf+i, tmp[i] );
+ return i;
+ case GL_QUAD_STRIP:
+ ovf = MIN2( nr-1, 2 );
+ if (nr > 2) ovf += nr&1;
+ for (i = 0 ; i < ovf ; i++)
+ copy_vertex( rmesa, nr-ovf+i, tmp[i] );
+ return i;
+ default:
+ assert(0);
+ return 0;
}
-
- glNormal3f( x, y, z );
}
-static void radeon_choose_Normal3fv( const GLfloat *v )
+static void VFMT_FALLBACK_OUTSIDE_BEGIN_END( const char *caller )
{
- GET_CURRENT_CONTEXT(ctx);
- GLuint index;
+ GLcontext *ctx = vb.context;
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- if ( ctx->Light.Enabled ) {
- if ( ctx->Transform.Normalize ) {
- index = NORM_NORMALIZE;
- }
- else if ( !ctx->Transform.RescaleNormals &&
- ctx->_ModelViewInvScale != 1.0 ) {
- index = NORM_RESCALE;
- }
- else {
- index = 0;
- }
+ if (RADEON_DEBUG & (DEBUG_VFMT|DEBUG_FALLBACKS))
+ fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
- if ( ctx->Light.EnabledList.next == ctx->Light.EnabledList.prev ) {
- ctx->Exec->Normal3fv = norm_tab[index].normal3fv_single;
- } else {
- ctx->Exec->Normal3fv = norm_tab[index].normal3fv_multi;
- }
- } else {
- ctx->Exec->Normal3fv = _mesa_noop_Normal3fv;
- }
+ if (ctx->Driver.NeedFlush)
+ radeonFlushVertices( ctx, ctx->Driver.NeedFlush );
+
+ if (ctx->NewState)
+ _mesa_update_state( ctx ); /* clear state so fell_back sticks */
- glNormal3fv( v );
+ _tnl_wakeup_exec( ctx );
+
+ assert( rmesa->dma.flush == 0 );
+ rmesa->vb.fell_back = GL_TRUE;
+ rmesa->vb.installed = GL_FALSE;
+ vb.context = 0;
}
+static void VFMT_FALLBACK( const char *caller )
+{
+ GLcontext *ctx = vb.context;
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLfloat tmp[3][15];
+ GLuint i, prim;
+ GLuint ind = rmesa->vb.vertex_format;
+ GLuint nrverts;
+ GLfloat alpha = 1.0;
+ if (RADEON_DEBUG & (DEBUG_FALLBACKS|DEBUG_VFMT))
+ fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
-/* ================================================================
- * Texture functions:
- */
+ if (rmesa->vb.prim[0] == GL_POLYGON+1) {
+ VFMT_FALLBACK_OUTSIDE_BEGIN_END( __FUNCTION__ );
+ return;
+ }
-#define GET_CURRENT \
- GET_CURRENT_CONTEXT(ctx); \
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx)
+ /* Copy vertices out of dma:
+ */
+ nrverts = copy_dma_verts( rmesa, tmp );
-#define NUM_TEXTURE_UNITS RADEON_MAX_TEXTURE_UNITS
-#define DO_PROJ_TEX
+ /* Finish the prim at this point:
+ */
+ note_last_prim( rmesa, 0 );
+ flush_prims( rmesa );
-#define CURRENT_TEXTURE( unit ) rmesa->state.current.texture[unit]
+ /* Update ctx->Driver.CurrentExecPrimitive and swap in swtnl.
+ */
+ prim = rmesa->vb.prim[0];
+ ctx->Driver.CurrentExecPrimitive = GL_POLYGON+1;
+ _tnl_wakeup_exec( ctx );
-#define TAG(x) radeon_##x
-#include "tnl_dd/t_dd_imm_tapi.h"
+ assert(rmesa->dma.flush == 0);
+ rmesa->vb.fell_back = GL_TRUE;
+ rmesa->vb.installed = GL_FALSE;
+ vb.context = 0;
+ glBegin( prim );
+
+ if (rmesa->vb.installed_color_3f_sz == 4)
+ alpha = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
+ /* Replay saved vertices
+ */
+ for (i = 0 ; i < nrverts; i++) {
+ GLuint offset = 3;
+ if (ind & RADEON_CP_VC_FRMT_N0) {
+ glNormal3fv( &tmp[i][offset] );
+ offset += 3;
+ }
+ if (ind & RADEON_CP_VC_FRMT_PKCOLOR) {
+ radeon_color_t *col = (radeon_color_t *)&tmp[i][offset];
+ glColor4ub( col->red, col->green, col->blue, col->alpha );
+ offset++;
+ }
+ else if (ind & RADEON_CP_VC_FRMT_FPALPHA) {
+ glColor4fv( &tmp[i][offset] );
+ offset+=4;
+ }
+ else if (ind & RADEON_CP_VC_FRMT_FPCOLOR) {
+ glColor3fv( &tmp[i][offset] );
+ offset+=3;
+ }
-/* ================================================================
- * Vertex functions:
- */
+ if (ind & RADEON_CP_VC_FRMT_PKSPEC) {
+ radeon_color_t *spec = (radeon_color_t *)&tmp[i][offset];
+ _glapi_Dispatch->SecondaryColor3ubEXT( spec->red, spec->green, spec->blue );
+ offset++;
+ }
-#define GET_CURRENT_VERTEX \
- GET_CURRENT_CONTEXT(ctx); \
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \
- radeonTnlVertexPtr v = rmesa->imm.v0
+ if (ind & RADEON_CP_VC_FRMT_ST0) {
+ glTexCoord2fv( &tmp[i][offset] );
+ offset += 2;
+ }
-#define CURRENT_VERTEX v->obj
-#define SAVE_VERTEX rmesa->imm.save_vertex( ctx, v )
+ if (ind & RADEON_CP_VC_FRMT_ST1) {
+ glMultiTexCoord2fvARB( GL_TEXTURE1_ARB, &tmp[i][offset] );
+ offset += 2;
+ }
+ glVertex3fv( &tmp[i][0] );
+ }
-#define TAG(x) radeon_##x
-#include "tnl_dd/t_dd_imm_vapi.h"
+ /* Replay current vertex
+ */
+ if (ind & RADEON_CP_VC_FRMT_N0)
+ glNormal3fv( vb.normalptr );
+
+ if (ind & RADEON_CP_VC_FRMT_PKCOLOR)
+ glColor4ub( vb.colorptr->red, vb.colorptr->green, vb.colorptr->blue, vb.colorptr->alpha );
+ else if (ind & RADEON_CP_VC_FRMT_FPALPHA)
+ glColor4fv( vb.floatcolorptr );
+ else if (ind & RADEON_CP_VC_FRMT_FPCOLOR) {
+ if (rmesa->vb.installed_color_3f_sz == 4 && alpha != 1.0)
+ glColor4f( vb.floatcolorptr[0],
+ vb.floatcolorptr[1],
+ vb.floatcolorptr[2],
+ alpha );
+ else
+ glColor3fv( vb.floatcolorptr );
+ }
+ if (ind & RADEON_CP_VC_FRMT_PKSPEC)
+ _glapi_Dispatch->SecondaryColor3ubEXT( vb.specptr->red, vb.specptr->green, vb.specptr->blue );
+ if (ind & RADEON_CP_VC_FRMT_ST0)
+ glTexCoord2fv( vb.texcoordptr[0] );
+ if (ind & RADEON_CP_VC_FRMT_ST1)
+ glMultiTexCoord2fvARB( GL_TEXTURE1_ARB, vb.texcoordptr[1] );
+}
-struct radeon_vert_tab {
- void (*save_vertex)( GLcontext *ctx, radeonTnlVertexPtr v );
- void (*interpolate_vertex)( GLfloat t,
- radeonTnlVertex *O,
- const radeonTnlVertex *I,
- const radeonTnlVertex *J );
-};
-static struct radeon_vert_tab vert_tab[0xf];
-#define VTX_NORMAL 0x0
-#define VTX_RGBA 0x1
-#define VTX_SPEC 0x2
-#define VTX_TEX0 0x4
-#define VTX_TEX1 0x8
+static void wrap_buffer( void )
+{
+ GLcontext *ctx = vb.context;
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLfloat tmp[3][15];
+ GLuint i, nrverts;
-#define LOCAL_VARS \
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx)
+ if (RADEON_DEBUG & (DEBUG_VFMT|DEBUG_PRIMS))
+ fprintf(stderr, "%s %d\n", __FUNCTION__, vb.initial_counter - vb.counter);
-#define CURRENT_COLOR rmesa->state.current.color
-#define CURRENT_SPECULAR rmesa->state.current.specular
+ /* Don't deal with parity.
+ */
+ if ((((vb.initial_counter - vb.counter) -
+ rmesa->vb.primlist[rmesa->vb.nrprims].start) & 1)) {
+ vb.counter++;
+ vb.initial_counter++;
+ return;
+ }
-#define CURRENT_NORMAL( COMP ) rmesa->state.current.normal[COMP]
-#define CURRENT_TEXTURE( U, COMP ) rmesa->state.current.texture[U][COMP]
+ /* Copy vertices out of dma:
+ */
+ if (rmesa->vb.prim[0] == GL_POLYGON+1)
+ nrverts = 0;
+ else {
+ nrverts = copy_dma_verts( rmesa, tmp );
+
+ if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%d vertices to copy\n", nrverts);
+
+ /* Finish the prim at this point:
+ */
+ note_last_prim( rmesa, 0 );
+ }
-#define FLUSH_VERTEX rmesa->imm.flush_vertex( ctx, v );
+ /* Fire any buffered primitives
+ */
+ flush_prims( rmesa );
+ /* Get new buffer
+ */
+ radeonRefillCurrentDmaRegion( rmesa );
-#define IND (VTX_NORMAL)
-#define TAG(x) radeon_##x##_NORMAL
-#define PRESERVE_VERTEX_DEFS
-#include "tnl_dd/t_dd_imm_vertex.h"
+ /* Reset counter, dmaptr
+ */
+ vb.dmaptr = (int *)(rmesa->dma.current.ptr + rmesa->dma.current.address);
+ vb.counter = (rmesa->dma.current.end - rmesa->dma.current.ptr) /
+ (vb.vertex_size * 4);
+ vb.counter--;
+ vb.initial_counter = vb.counter;
+ vb.notify = wrap_buffer;
-#define IND (VTX_NORMAL|VTX_TEX0)
-#define TAG(x) radeon_##x##_NORMAL_TEX0
-#define PRESERVE_VERTEX_DEFS
-#include "tnl_dd/t_dd_imm_vertex.h"
+ rmesa->dma.flush = flush_prims;
-#define IND (VTX_NORMAL|VTX_TEX0|VTX_TEX1)
-#define TAG(x) radeon_##x##_NORMAL_TEX0_TEX1
-#define PRESERVE_VERTEX_DEFS
-#include "tnl_dd/t_dd_imm_vertex.h"
+ /* Restart wrapped primitive:
+ */
+ if (rmesa->vb.prim[0] != GL_POLYGON+1)
+ start_prim( rmesa, rmesa->vb.prim[0] );
-#define IND (VTX_RGBA)
-#define TAG(x) radeon_##x##_RGBA
-#define PRESERVE_VERTEX_DEFS
-#include "tnl_dd/t_dd_imm_vertex.h"
+ /* Reemit saved vertices
+ */
+ for (i = 0 ; i < nrverts; i++) {
+ if (RADEON_DEBUG & DEBUG_VERTS) {
+ int j;
+ fprintf(stderr, "re-emit vertex %d to %p\n", i, vb.dmaptr);
+ if (RADEON_DEBUG & DEBUG_VERBOSE)
+ for (j = 0 ; j < vb.vertex_size; j++)
+ fprintf(stderr, "\t%08x/%f\n", *(int*)&tmp[i][j], tmp[i][j]);
+ }
-#define IND (VTX_RGBA|VTX_TEX0)
-#define TAG(x) radeon_##x##_RGBA_TEX0
-#define PRESERVE_VERTEX_DEFS
-#include "tnl_dd/t_dd_imm_vertex.h"
+ memcpy( vb.dmaptr, tmp[i], vb.vertex_size * 4 );
+ vb.dmaptr += vb.vertex_size;
+ vb.counter--;
+ }
+}
-#define IND (VTX_RGBA|VTX_TEX1)
-#define TAG(x) radeon_##x##_RGBA_TEX0_TEX1
-#include "tnl_dd/t_dd_imm_vertex.h"
-static void radeon_init_vert_funcs( void )
+static GLboolean check_vtx_fmt( GLcontext *ctx )
{
- radeon_init_vert_NORMAL();
- radeon_init_vert_NORMAL_TEX0();
- radeon_init_vert_NORMAL_TEX0_TEX1();
- radeon_init_vert_RGBA();
- radeon_init_vert_RGBA_TEX0();
- radeon_init_vert_RGBA_TEX0_TEX1();
-}
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLuint ind = RADEON_CP_VC_FRMT_Z;
+ if (rmesa->TclFallback || rmesa->vb.fell_back || ctx->CompileFlag)
+ return GL_FALSE;
+ if (!_glapi_Context)
+ return GL_FALSE;
+ if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT)
+ ctx->Driver.FlushVertices( ctx, FLUSH_UPDATE_CURRENT );
+
+ /* Make all this event-driven:
+ */
+ if (ctx->Light.Enabled) {
+ ind |= RADEON_CP_VC_FRMT_N0;
+
+ /* TODO: make this data driven: If we receive only ubytes, send
+ * color as ubytes. Also check if converting (with free
+ * checking for overflow) is cheaper than sending floats
+ * directly.
+ */
+ if (ctx->Light.ColorMaterialEnabled) {
+ ind |= RADEON_CP_VC_FRMT_FPCOLOR;
+ if (ctx->Color.AlphaEnabled) {
+ ind |= RADEON_CP_VC_FRMT_FPALPHA;
+ }
+ }
+ }
+ else {
+ /* TODO: make this data driven?
+ */
+ ind |= RADEON_CP_VC_FRMT_PKCOLOR;
+
+ if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
+ ind |= RADEON_CP_VC_FRMT_PKSPEC;
+ }
+ }
+ if (ctx->Texture.Unit[0]._ReallyEnabled) {
+ if (ctx->Texture.Unit[0].TexGenEnabled) {
+ if (rmesa->TexGenNeedNormals[0]) {
+ ind |= RADEON_CP_VC_FRMT_N0;
+ }
+ } else {
+ if (ctx->Current.Attrib[VERT_ATTRIB_TEX0][2] != 0.0F ||
+ ctx->Current.Attrib[VERT_ATTRIB_TEX0][3] != 1.0) {
+ if (RADEON_DEBUG & (DEBUG_VFMT|DEBUG_FALLBACKS))
+ fprintf(stderr, "%s: rq0\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+ ind |= RADEON_CP_VC_FRMT_ST0;
+ }
+ }
+ if (ctx->Texture.Unit[1]._ReallyEnabled) {
+ if (ctx->Texture.Unit[1].TexGenEnabled) {
+ if (rmesa->TexGenNeedNormals[1]) {
+ ind |= RADEON_CP_VC_FRMT_N0;
+ }
+ } else {
+ if (ctx->Current.Attrib[VERT_ATTRIB_TEX1][2] != 0.0F ||
+ ctx->Current.Attrib[VERT_ATTRIB_TEX1][3] != 1.0) {
+ if (RADEON_DEBUG & (DEBUG_VFMT|DEBUG_FALLBACKS))
+ fprintf(stderr, "%s: rq1\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+ ind |= RADEON_CP_VC_FRMT_ST1;
+ }
+ }
+ if (RADEON_DEBUG & (DEBUG_VFMT|DEBUG_STATE))
+ fprintf(stderr, "%s: format: 0x%x\n", __FUNCTION__, ind );
-#define LOCAL_VARS \
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx)
+ RADEON_NEWPRIM(rmesa);
+ rmesa->vb.vertex_format = ind;
+ vb.vertex_size = 3;
+ rmesa->vb.prim = &ctx->Driver.CurrentExecPrimitive;
-#define FLUSH_VERTEX rmesa->imm.flush_vertex
+ vb.normalptr = ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
+ vb.colorptr = NULL;
+ vb.floatcolorptr = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
+ vb.specptr = NULL;
+ vb.floatspecptr = ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
+ vb.texcoordptr[0] = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
+ vb.texcoordptr[1] = ctx->Current.Attrib[VERT_ATTRIB_TEX1];
-#define IMM_VERTEX( V ) rmesa->imm.V
-#define IMM_VERTICES( n ) rmesa->imm.vertices[n]
+ /* Run through and initialize the vertex components in the order
+ * the hardware understands:
+ */
+ if (ind & RADEON_CP_VC_FRMT_N0) {
+ vb.normalptr = &vb.vertex[vb.vertex_size].f;
+ vb.vertex_size += 3;
+ vb.normalptr[0] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0];
+ vb.normalptr[1] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1];
+ vb.normalptr[2] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2];
+ }
+ if (ind & RADEON_CP_VC_FRMT_PKCOLOR) {
+ vb.colorptr = &vb.vertex[vb.vertex_size].color;
+ vb.vertex_size += 1;
+ UNCLAMPED_FLOAT_TO_CHAN( vb.colorptr->red, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] );
+ UNCLAMPED_FLOAT_TO_CHAN( vb.colorptr->green, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] );
+ UNCLAMPED_FLOAT_TO_CHAN( vb.colorptr->blue, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] );
+ UNCLAMPED_FLOAT_TO_CHAN( vb.colorptr->alpha, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] );
+ }
-/* TINY_VERTEX_FORMAT:
- */
-#define GET_VERTEX_SPACE( n ) radeonAllocDmaLow( rmesa, n * 16, __FUNCTION__ )
-
-#define EMIT_VERTEX( vb, v ) \
-do { \
- vb[0] = *(GLuint *)&(v->clip[0]); \
- vb[1] = *(GLuint *)&(v->clip[1]); \
- vb[2] = *(GLuint *)&(v->clip[2]); \
- vb[3] = *(GLuint *)&(v->color); \
- vb += 4; \
-} while (0)
+ if (ind & RADEON_CP_VC_FRMT_FPCOLOR) {
+ assert(!(ind & RADEON_CP_VC_FRMT_PKCOLOR));
+ vb.floatcolorptr = &vb.vertex[vb.vertex_size].f;
+ vb.vertex_size += 3;
+ vb.floatcolorptr[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0];
+ vb.floatcolorptr[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1];
+ vb.floatcolorptr[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2];
+
+ if (ind & RADEON_CP_VC_FRMT_FPALPHA) {
+ vb.vertex_size += 1;
+ vb.floatcolorptr[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
+ }
+ }
+
+ if (ind & RADEON_CP_VC_FRMT_PKSPEC) {
+ vb.specptr = &vb.vertex[vb.vertex_size].color;
+ vb.vertex_size += 1;
+ UNCLAMPED_FLOAT_TO_CHAN( vb.specptr->red, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0] );
+ UNCLAMPED_FLOAT_TO_CHAN( vb.specptr->green, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1] );
+ UNCLAMPED_FLOAT_TO_CHAN( vb.specptr->blue, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2] );
+ }
-#define TAG(x) radeon_##x##_tiny
-#define PRESERVE_PRIM_DEFS
-#include "tnl_dd/t_dd_imm_primtmp.h"
+ if (ind & RADEON_CP_VC_FRMT_ST0) {
+ vb.texcoordptr[0] = &vb.vertex[vb.vertex_size].f;
+ vb.vertex_size += 2;
+ vb.texcoordptr[0][0] = ctx->Current.Attrib[VERT_ATTRIB_TEX0][0];
+ vb.texcoordptr[0][1] = ctx->Current.Attrib[VERT_ATTRIB_TEX0][1];
+ }
+
+ if (ind & RADEON_CP_VC_FRMT_ST1) {
+ vb.texcoordptr[1] = &vb.vertex[vb.vertex_size].f;
+ vb.vertex_size += 2;
+ vb.texcoordptr[1][0] = ctx->Current.Attrib[VERT_ATTRIB_TEX1][0];
+ vb.texcoordptr[1][1] = ctx->Current.Attrib[VERT_ATTRIB_TEX1][1];
+ }
+
+ if (rmesa->vb.installed_vertex_format != rmesa->vb.vertex_format) {
+ if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "reinstall on vertex_format change\n");
+ _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt );
+ rmesa->vb.installed_vertex_format = rmesa->vb.vertex_format;
+ }
-/* NOTEX_VERTEX_FORMAT:
- */
-#define GET_VERTEX_SPACE( n ) radeonAllocDmaLow( rmesa, n * 24, __FUNCTION__ )
-
-#define EMIT_VERTEX( vb, v ) \
-do { \
- vb[0] = *(GLuint *)&(v->clip[0]); \
- vb[1] = *(GLuint *)&(v->clip[1]); \
- vb[2] = *(GLuint *)&(v->clip[2]); \
- vb[3] = *(GLuint *)&(v->clip[3]); \
- vb[4] = *(GLuint *)&(v->color); \
- vb[5] = *(GLuint *)&(v->specular); \
- vb += 6; \
-} while (0)
+ if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s -- success\n", __FUNCTION__);
+
+ return GL_TRUE;
+}
-#define TAG(x) radeon_##x##_notex
-#define PRESERVE_PRIM_DEFS
-#include "tnl_dd/t_dd_imm_primtmp.h"
+void radeonVtxfmtInvalidate( GLcontext *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
-/* TEX0_VERTEX_FORMAT:
- */
-#define GET_VERTEX_SPACE( n ) radeonAllocDmaLow( rmesa, n * 32, __FUNCTION__ )
-
-#define EMIT_VERTEX( vb, v ) \
-do { \
- vb[0] = *(GLuint *)&(v->clip[0]); \
- vb[1] = *(GLuint *)&(v->clip[1]); \
- vb[2] = *(GLuint *)&(v->clip[2]); \
- vb[3] = *(GLuint *)&(v->clip[3]); \
- vb[4] = *(GLuint *)&(v->color); \
- vb[5] = *(GLuint *)&(v->specular); \
- vb[6] = *(GLuint *)&(v->texture[0][0]); \
- vb[7] = *(GLuint *)&(v->texture[0][1]); \
- vb += 8; \
-} while (0)
+ rmesa->vb.recheck = GL_TRUE;
+ rmesa->vb.fell_back = GL_FALSE;
+}
-#define TAG(x) radeon_##x##_tex0
-#define PRESERVE_PRIM_DEFS
-#include "tnl_dd/t_dd_imm_primtmp.h"
+static void radeonNewList( GLcontext *ctx, GLuint list, GLenum mode )
+{
+ VFMT_FALLBACK_OUTSIDE_BEGIN_END( __FUNCTION__ );
+}
-/* TEX1_VERTEX_FORMAT:
- */
-#define GET_VERTEX_SPACE( n ) radeonAllocDmaLow( rmesa, n * 40, __FUNCTION__ )
-
-#define EMIT_VERTEX( vb, v ) \
-do { \
- vb[0] = *(GLuint *)&(v->clip[0]); \
- vb[1] = *(GLuint *)&(v->clip[1]); \
- vb[2] = *(GLuint *)&(v->clip[2]); \
- vb[3] = *(GLuint *)&(v->clip[3]); \
- vb[4] = *(GLuint *)&(v->color); \
- vb[5] = *(GLuint *)&(v->specular); \
- vb[6] = *(GLuint *)&(v->texture[0][0]); \
- vb[7] = *(GLuint *)&(v->texture[0][1]); \
- vb[8] = *(GLuint *)&(v->texture[1][0]); \
- vb[9] = *(GLuint *)&(v->texture[1][1]); \
- vb += 10; \
-} while (0)
-#define TAG(x) radeon_##x##_tex1
-#define PRESERVE_PRIM_DEFS
-#include "tnl_dd/t_dd_imm_primtmp.h"
+static void radeonVtxfmtValidate( GLcontext *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
+
+ if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+ if (ctx->Driver.NeedFlush)
+ ctx->Driver.FlushVertices( ctx, ctx->Driver.NeedFlush );
+ rmesa->vb.recheck = GL_FALSE;
+ if (check_vtx_fmt( ctx )) {
+ if (!rmesa->vb.installed) {
+ if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "reinstall (new install)\n");
+ _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt );
+ ctx->Driver.FlushVertices = radeonFlushVertices;
+ ctx->Driver.NewList = radeonNewList;
+ rmesa->vb.installed = GL_TRUE;
+ vb.context = ctx;
+ }
+ else if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s: already installed", __FUNCTION__);
+ }
+ else {
+ if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s: failed\n", __FUNCTION__);
+
+ if (rmesa->vb.installed) {
+ if (rmesa->dma.flush)
+ rmesa->dma.flush( rmesa );
+ _tnl_wakeup_exec( ctx );
+ rmesa->vb.installed = GL_FALSE;
+ vb.context = 0;
+ }
+ }
+}
-/* Bzzt: Material changes are lost on fallback.
+/* Materials:
*/
-static void radeon_Materialfv( GLenum face, GLenum pname,
+static void radeon_Materialfv( GLenum face, GLenum pname,
const GLfloat *params )
{
- GET_CURRENT_CONTEXT(ctx);
+ GLcontext *ctx = vb.context;
+ radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
+
+ if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+ if (rmesa->vb.prim[0] != GL_POLYGON+1) {
+ VFMT_FALLBACK( __FUNCTION__ );
+ glMaterialfv( face, pname, params );
+ return;
+ }
_mesa_noop_Materialfv( face, pname, params );
- radeon_recalc_base_color( ctx );
+ radeonUpdateMaterial( vb.context );
}
-
-
-
-/* ================================================================
- * Fallback functions:
+/* Begin/End
*/
-
-static void radeon_do_fallback( GLcontext *ctx )
+static void radeon_Begin( GLenum mode )
{
+ GLcontext *ctx = vb.context;
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- struct radeon_current_state *current = &rmesa->state.current;
+
+ if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s\n", __FUNCTION__);
- /* Tell tnl to restore its exec vtxfmt, rehook its driver callbacks
- * and revive internal state that depended on those callbacks:
- */
- _tnl_wakeup_exec( ctx );
+ if (mode > GL_POLYGON) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glBegin" );
+ return;
+ }
- /* Replay enough vertices that the current primitive is continued
- * correctly:
- */
- if ( rmesa->imm.prim != PRIM_OUTSIDE_BEGIN_END ) {
- glBegin( rmesa->imm.prim );
- /*rmesa->fire_on_fallback( ctx );*/
+ if (rmesa->vb.prim[0] != GL_POLYGON+1) {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glBegin" );
+ return;
}
+
+ if (ctx->NewState)
+ _mesa_update_state( ctx );
- /* Replay the current, partially complete vertex:
- */
- if ( current->texture[0][3] == 1.0 ) {
- glMultiTexCoord3fvARB( GL_TEXTURE0_ARB, current->texture[0] );
- } else {
- glMultiTexCoord4fvARB( GL_TEXTURE0_ARB, current->texture[0] );
+ if (rmesa->NewGLState)
+ radeonValidateState( ctx );
+
+ if (rmesa->vb.recheck)
+ radeonVtxfmtValidate( ctx );
+
+ if (!rmesa->vb.installed) {
+ glBegin( mode );
+ return;
}
- if ( current->texture[1][3] == 1.0 ) {
- glMultiTexCoord3fvARB( GL_TEXTURE1_ARB, current->texture[1] );
- } else {
- glMultiTexCoord4fvARB( GL_TEXTURE1_ARB, current->texture[1] );
+
+ if (rmesa->dma.flush && vb.counter < 12) {
+ if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s: flush almost-empty buffers\n", __FUNCTION__);
+ flush_prims( rmesa );
}
- /* FIXME: Secondary color, fog coord...
+ /* Need to arrange to save vertices here? Or always copy from dma (yuk)?
*/
+ if (!rmesa->dma.flush) {
+ if (rmesa->dma.current.ptr + 12*vb.vertex_size*4 >
+ rmesa->dma.current.end) {
+ RADEON_NEWPRIM( rmesa );
+ radeonRefillCurrentDmaRegion( rmesa );
+ }
- if ( ctx->Light.Enabled ) {
- glColor4fv( ctx->Current.Color ); /* Catch ColorMaterial */
- glNormal3fv( current->normal );
- } else {
- glColor4ubv( current->color );
+ vb.dmaptr = (int *)(rmesa->dma.current.address + rmesa->dma.current.ptr);
+ vb.counter = (rmesa->dma.current.end - rmesa->dma.current.ptr) /
+ (vb.vertex_size * 4);
+ vb.counter--;
+ vb.initial_counter = vb.counter;
+ vb.notify = wrap_buffer;
+ rmesa->dma.flush = flush_prims;
+ vb.context->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
}
+
+
+ rmesa->vb.prim[0] = mode;
+ start_prim( rmesa, mode | PRIM_BEGIN );
}
-#define PRE_LOOPBACK( FUNC ) do { \
- GET_CURRENT_CONTEXT(ctx); \
- radeon_do_fallback( ctx ); \
-} while (0)
-#define TAG(x) radeon_fallback_##x
-#include "vtxfmt_tmp.h"
+static void radeon_End( void )
+{
+ GLcontext *ctx = vb.context;
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+ if (rmesa->vb.prim[0] == GL_POLYGON+1) {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" );
+ return;
+ }
+
+ note_last_prim( rmesa, PRIM_END );
+ rmesa->vb.prim[0] = GL_POLYGON+1;
+}
+
+
+/* Fallback on difficult entrypoints:
+ */
+#define PRE_LOOPBACK( FUNC ) \
+do { \
+ if (RADEON_DEBUG & DEBUG_VFMT) \
+ fprintf(stderr, "%s\n", __FUNCTION__); \
+ VFMT_FALLBACK( __FUNCTION__ ); \
+} while (0)
+#define TAG(x) radeon_fallback_##x
+#include "vtxfmt_tmp.h"
-static void radeon_Begin( GLenum prim )
+static GLboolean radeonNotifyBegin( GLcontext *ctx, GLenum p )
{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
+
+ if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s\n", __FUNCTION__);
- if ( prim > GL_POLYGON ) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glBegin" );
- return;
- }
- if ( rmesa->imm.prim != PRIM_OUTSIDE_BEGIN_END ) {
- _mesa_error( ctx, GL_INVALID_OPERATION, "glBegin" );
- return;
- }
+ assert(!rmesa->vb.installed);
- ctx->Driver.NeedFlush |= (FLUSH_STORED_VERTICES |
- FLUSH_UPDATE_CURRENT);
+ if (ctx->NewState)
+ _mesa_update_state( ctx );
+ if (rmesa->NewGLState)
+ radeonValidateState( ctx );
- radeonChooseVertexState( ctx );
+ if (ctx->Driver.NeedFlush)
+ ctx->Driver.FlushVertices( ctx, ctx->Driver.NeedFlush );
+ if (rmesa->vb.recheck)
+ radeonVtxfmtValidate( ctx );
- rmesa->imm.prim = prim;
- rmesa->imm.v0 = &rmesa->imm.vertices[0];
+ if (!rmesa->vb.installed) {
+ if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s -- failed\n", __FUNCTION__);
+ return GL_FALSE;
+ }
- rmesa->imm.save_vertex = radeon_save_vertex_RGBA;
- rmesa->imm.flush_vertex = rmesa->imm.flush_tab[prim];
+ radeon_Begin( p );
+ return GL_TRUE;
}
-static void radeon_End( void )
+static void radeonFlushVertices( GLcontext *ctx, GLuint flags )
{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
- if ( rmesa->imm.prim == PRIM_OUTSIDE_BEGIN_END ) {
- _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" );
- return;
- }
+ if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "%s\n", __FUNCTION__);
- rmesa->imm.prim = PRIM_OUTSIDE_BEGIN_END;
+ assert(rmesa->vb.installed);
+ assert(vb.context == ctx);
- ctx->Driver.NeedFlush &= ~(FLUSH_STORED_VERTICES |
- FLUSH_UPDATE_CURRENT);
-}
+ if (flags & FLUSH_UPDATE_CURRENT) {
+ radeon_copy_to_current( ctx );
+ if (RADEON_DEBUG & DEBUG_VFMT)
+ fprintf(stderr, "reinstall on update_current\n");
+ _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt );
+ ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT;
+ }
+ if (flags & FLUSH_STORED_VERTICES) {
+ radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
+ assert (rmesa->dma.flush == 0 ||
+ rmesa->dma.flush == flush_prims);
+ if (rmesa->dma.flush == flush_prims)
+ flush_prims( RADEON_CONTEXT( ctx ) );
+ ctx->Driver.NeedFlush &= ~FLUSH_STORED_VERTICES;
+ }
+}
+/* At this point, don't expect very many versions of each function to
+ * be generated, so not concerned about freeing them?
+ */
-void radeonInitTnlModule( GLcontext *ctx )
+void radeonVtxfmtInit( GLcontext *ctx )
{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLvertexformat *vfmt = &(rmesa->imm.vtxfmt);
-
- return;
-
- radeon_init_norm_funcs();
- radeon_init_vert_funcs();
+ radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
+ GLvertexformat *vfmt = &(rmesa->vb.vtxfmt);
MEMSET( vfmt, 0, sizeof(GLvertexformat) );
- /* Handled fully in supported states:
+ /* Hook in chooser functions for codegen, etc:
*/
- vfmt->ArrayElement = NULL; /* FIXME: ... */
- vfmt->Color3f = radeon_choose_Color3f;
- vfmt->Color3fv = radeon_choose_Color3fv;
- vfmt->Color3ub = radeon_choose_Color3ub;
- vfmt->Color3ubv = radeon_choose_Color3ubv;
- vfmt->Color4f = radeon_choose_Color4f;
- vfmt->Color4fv = radeon_choose_Color4fv;
- vfmt->Color4ub = radeon_choose_Color4ub;
- vfmt->Color4ubv = radeon_choose_Color4ubv;
- vfmt->FogCoordfvEXT = radeon_FogCoordfvEXT;
- vfmt->FogCoordfEXT = radeon_FogCoordfEXT;
- vfmt->Materialfv = radeon_Materialfv;
- vfmt->MultiTexCoord1fARB = radeon_MultiTexCoord1fARB;
- vfmt->MultiTexCoord1fvARB = radeon_MultiTexCoord1fvARB;
- vfmt->MultiTexCoord2fARB = radeon_MultiTexCoord2fARB;
- vfmt->MultiTexCoord2fvARB = radeon_MultiTexCoord2fvARB;
- vfmt->MultiTexCoord3fARB = radeon_MultiTexCoord3fARB;
- vfmt->MultiTexCoord3fvARB = radeon_MultiTexCoord3fvARB;
- vfmt->MultiTexCoord4fARB = radeon_MultiTexCoord4fARB;
- vfmt->MultiTexCoord4fvARB = radeon_MultiTexCoord4fvARB;
- vfmt->Normal3f = radeon_choose_Normal3f;
- vfmt->Normal3fv = radeon_choose_Normal3fv;
- vfmt->SecondaryColor3ubEXT = radeon_SecondaryColor3ubEXT;
- vfmt->SecondaryColor3ubvEXT = radeon_SecondaryColor3ubvEXT;
- vfmt->SecondaryColor3fEXT = radeon_SecondaryColor3fEXT;
- vfmt->SecondaryColor3fvEXT = radeon_SecondaryColor3fvEXT;
- vfmt->TexCoord1f = radeon_TexCoord1f;
- vfmt->TexCoord1fv = radeon_TexCoord1fv;
- vfmt->TexCoord2f = radeon_TexCoord2f;
- vfmt->TexCoord2fv = radeon_TexCoord2fv;
- vfmt->TexCoord3f = radeon_TexCoord3f;
- vfmt->TexCoord3fv = radeon_TexCoord3fv;
- vfmt->TexCoord4f = radeon_TexCoord4f;
- vfmt->TexCoord4fv = radeon_TexCoord4fv;
- vfmt->Vertex2f = radeon_Vertex2f;
- vfmt->Vertex2fv = radeon_Vertex2fv;
- vfmt->Vertex3f = radeon_Vertex3f;
- vfmt->Vertex3fv = radeon_Vertex3fv;
- vfmt->Vertex4f = radeon_Vertex4f;
- vfmt->Vertex4fv = radeon_Vertex4fv;
+ radeonVtxfmtInitChoosers( vfmt );
+ /* Handled fully in supported states, but no codegen:
+ */
+ vfmt->Materialfv = radeon_Materialfv;
+ vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */
+ vfmt->Rectf = _mesa_noop_Rectf; /* generic helper */
vfmt->Begin = radeon_Begin;
vfmt->End = radeon_End;
- vfmt->Rectf = _mesa_noop_Rectf; /* generic helper */
-
- vfmt->DrawArrays = NULL;
- vfmt->DrawElements = NULL;
- vfmt->DrawRangeElements = _mesa_noop_DrawRangeElements; /* discard range */
+ /* Fallback for performance reasons: (Fix with cva/elt path here and
+ * dmatmp2.h style primitive-merging)
+ *
+ * These should call NotifyBegin(), as should _tnl_EvalMesh, to allow
+ * a driver-hook.
+ */
+ vfmt->DrawArrays = radeon_fallback_DrawArrays;
+ vfmt->DrawElements = radeon_fallback_DrawElements;
+ vfmt->DrawRangeElements = radeon_fallback_DrawRangeElements;
/* Not active in supported states; just keep ctx->Current uptodate:
*/
+ vfmt->FogCoordfvEXT = _mesa_noop_FogCoordfvEXT;
+ vfmt->FogCoordfEXT = _mesa_noop_FogCoordfEXT;
vfmt->EdgeFlag = _mesa_noop_EdgeFlag;
vfmt->EdgeFlagv = _mesa_noop_EdgeFlagv;
vfmt->Indexi = _mesa_noop_Indexi;
@@ -609,10 +984,6 @@ void radeonInitTnlModule( GLcontext *ctx )
/* Active but unsupported -- fallback if we receive these:
- *
- * All of these fallbacks can be fixed with additional code, except
- * CallList, unless we build a play_immediate_noop() command which
- * turns an immediate back into glBegin/glEnd commands...
*/
vfmt->CallList = radeon_fallback_CallList;
vfmt->EvalCoord1f = radeon_fallback_EvalCoord1f;
@@ -623,132 +994,130 @@ void radeonInitTnlModule( GLcontext *ctx )
vfmt->EvalMesh2 = radeon_fallback_EvalMesh2;
vfmt->EvalPoint1 = radeon_fallback_EvalPoint1;
vfmt->EvalPoint2 = radeon_fallback_EvalPoint2;
-
-
- rmesa->imm.prim = PRIM_OUTSIDE_BEGIN_END;
-
- /* THIS IS A HACK!
- */
- _mesa_install_exec_vtxfmt( ctx, vfmt );
+ vfmt->TexCoord3f = radeon_fallback_TexCoord3f;
+ vfmt->TexCoord3fv = radeon_fallback_TexCoord3fv;
+ vfmt->TexCoord4f = radeon_fallback_TexCoord4f;
+ vfmt->TexCoord4fv = radeon_fallback_TexCoord4fv;
+ vfmt->MultiTexCoord3fARB = radeon_fallback_MultiTexCoord3fARB;
+ vfmt->MultiTexCoord3fvARB = radeon_fallback_MultiTexCoord3fvARB;
+ vfmt->MultiTexCoord4fARB = radeon_fallback_MultiTexCoord4fARB;
+ vfmt->MultiTexCoord4fvARB = radeon_fallback_MultiTexCoord4fvARB;
+ vfmt->Vertex4f = radeon_fallback_Vertex4f;
+ vfmt->Vertex4fv = radeon_fallback_Vertex4fv;
+
+ (void)radeon_fallback_vtxfmt;
+
+ TNL_CONTEXT(ctx)->Driver.NotifyBegin = radeonNotifyBegin;
+
+ vb.context = ctx;
+ rmesa->vb.enabled = 1;
+ rmesa->vb.prim = &ctx->Driver.CurrentExecPrimitive;
+ rmesa->vb.primflags = 0;
+
+ make_empty_list( &rmesa->vb.dfn_cache.Vertex2f );
+ make_empty_list( &rmesa->vb.dfn_cache.Vertex2fv );
+ make_empty_list( &rmesa->vb.dfn_cache.Vertex3f );
+ make_empty_list( &rmesa->vb.dfn_cache.Vertex3fv );
+ make_empty_list( &rmesa->vb.dfn_cache.Color4ub );
+ make_empty_list( &rmesa->vb.dfn_cache.Color4ubv );
+ make_empty_list( &rmesa->vb.dfn_cache.Color3ub );
+ make_empty_list( &rmesa->vb.dfn_cache.Color3ubv );
+ make_empty_list( &rmesa->vb.dfn_cache.Color4f );
+ make_empty_list( &rmesa->vb.dfn_cache.Color4fv );
+ make_empty_list( &rmesa->vb.dfn_cache.Color3f );
+ make_empty_list( &rmesa->vb.dfn_cache.Color3fv );
+ make_empty_list( &rmesa->vb.dfn_cache.SecondaryColor3fEXT );
+ make_empty_list( &rmesa->vb.dfn_cache.SecondaryColor3fvEXT );
+ make_empty_list( &rmesa->vb.dfn_cache.SecondaryColor3ubEXT );
+ make_empty_list( &rmesa->vb.dfn_cache.SecondaryColor3ubvEXT );
+ make_empty_list( &rmesa->vb.dfn_cache.Normal3f );
+ make_empty_list( &rmesa->vb.dfn_cache.Normal3fv );
+ make_empty_list( &rmesa->vb.dfn_cache.TexCoord2f );
+ make_empty_list( &rmesa->vb.dfn_cache.TexCoord2fv );
+ make_empty_list( &rmesa->vb.dfn_cache.TexCoord1f );
+ make_empty_list( &rmesa->vb.dfn_cache.TexCoord1fv );
+ make_empty_list( &rmesa->vb.dfn_cache.MultiTexCoord2fARB );
+ make_empty_list( &rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
+ make_empty_list( &rmesa->vb.dfn_cache.MultiTexCoord1fARB );
+ make_empty_list( &rmesa->vb.dfn_cache.MultiTexCoord1fvARB );
+
+ radeonInitCodegen( &rmesa->vb.codegen );
}
-
-
-
-
-
-#if 0
-
-
-
-static void radeon_Begin( GLenum prim )
+static void free_funcs( struct dynfn *l )
{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- radeon_prim *tab = &radeon_prim_tab[(int)prim];
-
- if ( prim > GL_POLYGON ) {
- gl_error( ctx, GL_INVALID_ENUM, "glBegin" );
- return;
- }
-
- if ( rmesa->prim != PRIM_OUTSIDE_BEGIN_END ) {
- gl_error( ctx, GL_INVALID_OPERATION, "glBegin" );
- return;
- }
-
- if ( tab->fire_on_vertex ) {
- rmesa->fire_on_vertex = tab->fire_on_vertex;
- rmesa->fire_on_end = tab->fire_on_end;
- rmesa->fire_on_fallback = tab->fire_on_fallback;
- rmesa->vert = &(rmesa->cache[0]);
- rmesa->prim = prim;
- ctx->Driver.NeedFlush |= (FLUSH_INSIDE_BEGIN_END |
- FLUSH_STORED_VERTICES);
- } else {
- radeon_fallback_vtxfmt( ctx );
+ struct dynfn *f, *tmp;
+ foreach_s (f, tmp, l) {
+ remove_from_list( f );
+ ALIGN_FREE( f->code );
+ FREE( f );
}
}
-static void radeon_End( void )
+void radeonVtxfmtUnbindContext( GLcontext *ctx )
{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- if ( rmesa->prim == PRIM_OUTSIDE_BEGIN_END ) {
- gl_error( ctx, GL_INVALID_OPERATION, "glEnd" );
- return;
+ if (RADEON_CONTEXT(ctx)->vb.installed) {
+ assert(vb.context == ctx);
+ VFMT_FALLBACK_OUTSIDE_BEGIN_END( __FUNCTION__ );
}
- rmesa->fire_on_end( ctx );
- rmesa->prim = PRIM_OUTSIDE_BEGIN_END;
-
- ctx->Exec->Vertex3fv = radeon_noop_Vertex3fv;
- ctx->Exec->Vertex3f = radeon_noop_Vertex3f;
- ctx->Exec->Vertex2f = radeon_noop_Vertex2f;
-
- ctx->Driver.NeedFlush &= ~(FLUSH_INSIDE_BEGIN_END |
- FLUSH_STORED_VERTICES);
+ TNL_CONTEXT(ctx)->Driver.NotifyBegin = 0;
}
-
-
-static GLboolean radeon_flush_vtxfmt( GLcontext *ctx, GLuint flags )
+void radeonVtxfmtMakeCurrent( GLcontext *ctx )
{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- if ( fxMesa->prim != PRIM_OUTSIDE_BEGIN_END )
- return GL_FALSE;
+ radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
- /* Outside begin/end. All vertices will already be flushed, just
- * update ctx->Current.
+#if defined(THREADS)
+ /* Insider knowledge: this value is zero when multithreading has
+ * been detected.
*/
- if ( flags & FLUSH_UPDATE_CURRENT ) {
- radeonClipVertexPtr v = &(RADEON_CONTEXT(ctx)->Current);
- COPY_2FV( ctx->Current.Texcoord[0], v->texcoord[0] );
- COPY_2FV( ctx->Current.Texcoord[1], v->texcoord[1] );
- if ( rmesa->accel_light == ACCEL_LIGHT ) {
- COPY_3FV( ctx->Current.Normal, v->normal );
- } else {
- ctx->Current.Color[RCOMP] = UBYTE_TO_CHAN( v->v.color.red );
- ctx->Current.Color[GCOMP] = UBYTE_TO_CHAN( v->v.color.green );
- ctx->Current.Color[BCOMP] = UBYTE_TO_CHAN( v->v.color.blue );
- ctx->Current.Color[ACOMP] = UBYTE_TO_CHAN( v->v.color.alpha );
-
- if ( ctx->Light.ColorMaterialEnabled )
- _mesa_update_color_material( ctx, ctx->Current.Color );
- }
+ if (_glapi_Context == 0) {
+ if (RADEON_DEBUG & (DEBUG_DRI|DEBUG_VFMT))
+ fprintf(stderr, "**** Multithreading: disabling vtxfmt!\n");
+ TNL_CONTEXT(ctx)->Driver.NotifyBegin = 0;
+ return;
}
+#endif
- /* Could clear this flag and set it from each 'choose' function,
- * maybe, but there isn't much of a penalty for leaving it set:
- */
- ctx->Driver.NeedFlush = FLUSH_UPDATE_CURRENT;
- return GL_TRUE;
-}
-
-void radeon_update_lighting( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- if ( !ctx->Light.Enabled ) {
- rmesa->accel_light = ACCEL_NO_LIGHT;
- }
- else if ( !ctx->Light._NeedVertices && !ctx->Light.Model.TwoSide ) {
- rmesa->accel_light = ACCEL_LIGHT;
- radeon_recalc_basecolor( ctx );
- }
- else {
- radeon->accel_light = 0;
+ if (rmesa->vb.enabled) {
+ TNL_CONTEXT(ctx)->Driver.NotifyBegin = radeonNotifyBegin;
}
}
-/* How to fallback:
- * - install default vertex format
- * - call glBegin
- * - revive stalled vertices (may be reordered).
- * - re-issue call that caused fallback.
- */
-#endif
+void radeonVtxfmtDestroy( GLcontext *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
+
+ count_funcs( rmesa );
+ free_funcs( &rmesa->vb.dfn_cache.Vertex2f );
+ free_funcs( &rmesa->vb.dfn_cache.Vertex2fv );
+ free_funcs( &rmesa->vb.dfn_cache.Vertex3f );
+ free_funcs( &rmesa->vb.dfn_cache.Vertex3fv );
+ free_funcs( &rmesa->vb.dfn_cache.Color4ub );
+ free_funcs( &rmesa->vb.dfn_cache.Color4ubv );
+ free_funcs( &rmesa->vb.dfn_cache.Color3ub );
+ free_funcs( &rmesa->vb.dfn_cache.Color3ubv );
+ free_funcs( &rmesa->vb.dfn_cache.Color4f );
+ free_funcs( &rmesa->vb.dfn_cache.Color4fv );
+ free_funcs( &rmesa->vb.dfn_cache.Color3f );
+ free_funcs( &rmesa->vb.dfn_cache.Color3fv );
+ free_funcs( &rmesa->vb.dfn_cache.SecondaryColor3ubEXT );
+ free_funcs( &rmesa->vb.dfn_cache.SecondaryColor3ubvEXT );
+ free_funcs( &rmesa->vb.dfn_cache.SecondaryColor3fEXT );
+ free_funcs( &rmesa->vb.dfn_cache.SecondaryColor3fvEXT );
+ free_funcs( &rmesa->vb.dfn_cache.Normal3f );
+ free_funcs( &rmesa->vb.dfn_cache.Normal3fv );
+ free_funcs( &rmesa->vb.dfn_cache.TexCoord2f );
+ free_funcs( &rmesa->vb.dfn_cache.TexCoord2fv );
+ free_funcs( &rmesa->vb.dfn_cache.TexCoord1f );
+ free_funcs( &rmesa->vb.dfn_cache.TexCoord1fv );
+ free_funcs( &rmesa->vb.dfn_cache.MultiTexCoord2fARB );
+ free_funcs( &rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
+ free_funcs( &rmesa->vb.dfn_cache.MultiTexCoord1fARB );
+ free_funcs( &rmesa->vb.dfn_cache.MultiTexCoord1fvARB );
+}
+
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.h b/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.h
index b388d7364..aca8768ef 100644
--- a/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.h
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.h
@@ -1,30 +1,36 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.h,v 1.1 2002/02/22 21:45:01 dawes Exp $ */
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
+ Tungsten Graphics Inc., Cedar Park, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
/*
- * Copyright 2000, 2001 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
* Authors:
- * Gareth Hughes <gareth@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
+ *
*/
#ifndef __RADEON_VTXFMT_H__
@@ -34,13 +40,89 @@
#include "radeon_context.h"
-extern void radeonInitTnlModule( GLcontext *ctx );
-extern radeon_flush_func radeon_flush_tab_tiny[GL_POLYGON+1];
-extern radeon_flush_func radeon_flush_tab_notex[GL_POLYGON+1];
-extern radeon_flush_func radeon_flush_tab_tex0[GL_POLYGON+1];
-extern radeon_flush_func radeon_flush_tab_tex1[GL_POLYGON+1];
+extern struct radeon_vb vb;
+
+
+extern void radeonVtxfmtUpdate( GLcontext *ctx );
+extern void radeonVtxfmtInit( GLcontext *ctx );
+extern void radeonVtxfmtInvalidate( GLcontext *ctx );
+extern void radeonVtxfmtDestroy( GLcontext *ctx );
+extern void radeonVtxfmtInitChoosers( GLvertexformat *vfmt );
+
+extern void radeonVtxfmtMakeCurrent( GLcontext *ctx );
+extern void radeonVtxfmtUnbindContext( GLcontext *ctx );
+
+extern void radeon_copy_to_current( GLcontext *ctx );
+
+#define DFN( FUNC, CACHE) \
+do { \
+ char *start = (char *)&FUNC; \
+ char *end = (char *)&FUNC##_end; \
+ insert_at_head( &CACHE, dfn ); \
+ dfn->key = key; \
+ dfn->code = ALIGN_MALLOC( end - start, 16 ); \
+ memcpy (dfn->code, start, end - start); \
+} \
+while ( 0 )
+
+#define FIXUP( CODE, OFFSET, CHECKVAL, NEWVAL ) \
+do { \
+ int *icode = (int *)(CODE+OFFSET); \
+ assert (*icode == CHECKVAL); \
+ *icode = (int)NEWVAL; \
+} while (0)
+
+
+/* Useful for figuring out the offsets:
+ */
+#define FIXUP2( CODE, OFFSET, CHECKVAL, NEWVAL ) \
+do { \
+ while (*(int *)(CODE+OFFSET) != CHECKVAL) OFFSET++; \
+ /* fprintf(stderr, "%s/%d CVAL %x OFFSET %d VAL %x\n", __FUNCTION__, */ \
+/* __LINE__, CHECKVAL, OFFSET, (int)(NEWVAL)); */ \
+ *(int *)(CODE+OFFSET) = (int)(NEWVAL); \
+ OFFSET += 4; \
+} while (0)
+
+/*
+ */
+void radeonInitCodegen( struct dfn_generators *gen );
+void radeonInitX86Codegen( struct dfn_generators *gen );
+void radeonInitSSECodegen( struct dfn_generators *gen );
+
+
+
+/* Defined in radeon_vtxfmt_x86.c
+ */
+struct dynfn *radeon_makeX86Vertex2f( GLcontext *, int );
+struct dynfn *radeon_makeX86Vertex2fv( GLcontext *, int );
+struct dynfn *radeon_makeX86Vertex3f( GLcontext *, int );
+struct dynfn *radeon_makeX86Vertex3fv( GLcontext *, int );
+struct dynfn *radeon_makeX86Color4ub( GLcontext *, int );
+struct dynfn *radeon_makeX86Color4ubv( GLcontext *, int );
+struct dynfn *radeon_makeX86Color3ub( GLcontext *, int );
+struct dynfn *radeon_makeX86Color3ubv( GLcontext *, int );
+struct dynfn *radeon_makeX86Color4f( GLcontext *, int );
+struct dynfn *radeon_makeX86Color4fv( GLcontext *, int );
+struct dynfn *radeon_makeX86Color3f( GLcontext *, int );
+struct dynfn *radeon_makeX86Color3fv( GLcontext *, int );
+struct dynfn *radeon_makeX86SecondaryColor3ubEXT( GLcontext *, int );
+struct dynfn *radeon_makeX86SecondaryColor3ubvEXT( GLcontext *, int );
+struct dynfn *radeon_makeX86SecondaryColor3fEXT( GLcontext *, int );
+struct dynfn *radeon_makeX86SecondaryColor3fvEXT( GLcontext *, int );
+struct dynfn *radeon_makeX86Normal3f( GLcontext *, int );
+struct dynfn *radeon_makeX86Normal3fv( GLcontext *, int );
+struct dynfn *radeon_makeX86TexCoord2f( GLcontext *, int );
+struct dynfn *radeon_makeX86TexCoord2fv( GLcontext *, int );
+struct dynfn *radeon_makeX86TexCoord1f( GLcontext *, int );
+struct dynfn *radeon_makeX86TexCoord1fv( GLcontext *, int );
+struct dynfn *radeon_makeX86MultiTexCoord2fARB( GLcontext *, int );
+struct dynfn *radeon_makeX86MultiTexCoord2fvARB( GLcontext *, int );
+struct dynfn *radeon_makeX86MultiTexCoord1fARB( GLcontext *, int );
+struct dynfn *radeon_makeX86MultiTexCoord1fvARB( GLcontext *, int );
+
#endif
#endif
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_c.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_c.c
new file mode 100644
index 000000000..abbb93fe5
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_c.c
@@ -0,0 +1,802 @@
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright 2002 ATI Technologies Inc., Ontario, Canada, and
+ Tungsten Graphics Inc., Cedar Park, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+#include "glheader.h"
+#include "mtypes.h"
+#include "colormac.h"
+#include "simple_list.h"
+#include "api_noop.h"
+#include "vtxfmt.h"
+
+#include "radeon_vtxfmt.h"
+
+/* Fallback versions of all the entrypoints for situations where
+ * codegen isn't available. This is still a lot faster than the
+ * vb/pipeline implementation in Mesa.
+ */
+static void radeon_Vertex3f( GLfloat x, GLfloat y, GLfloat z )
+{
+ int i;
+
+ *vb.dmaptr++ = *(int *)&x;
+ *vb.dmaptr++ = *(int *)&y;
+ *vb.dmaptr++ = *(int *)&z;
+
+ for (i = 3; i < vb.vertex_size; i++)
+ *vb.dmaptr++ = vb.vertex[i].i;
+
+ if (--vb.counter == 0)
+ vb.notify();
+}
+
+
+static void radeon_Vertex3fv( const GLfloat *v )
+{
+ int i;
+
+ *vb.dmaptr++ = *(int *)&v[0];
+ *vb.dmaptr++ = *(int *)&v[1];
+ *vb.dmaptr++ = *(int *)&v[2];
+
+ for (i = 3; i < vb.vertex_size; i++)
+ *vb.dmaptr++ = vb.vertex[i].i;
+
+ if (--vb.counter == 0)
+ vb.notify();
+}
+
+
+static void radeon_Vertex2f( GLfloat x, GLfloat y )
+{
+ int i;
+
+ *vb.dmaptr++ = *(int *)&x;
+ *vb.dmaptr++ = *(int *)&y;
+ *vb.dmaptr++ = 0;
+
+ for (i = 3; i < vb.vertex_size; i++)
+ *vb.dmaptr++ = *(int *)&vb.vertex[i];
+
+ if (--vb.counter == 0)
+ vb.notify();
+}
+
+
+static void radeon_Vertex2fv( const GLfloat *v )
+{
+ int i;
+
+ *vb.dmaptr++ = *(int *)&v[0];
+ *vb.dmaptr++ = *(int *)&v[1];
+ *vb.dmaptr++ = 0;
+
+ for (i = 3; i < vb.vertex_size; i++)
+ *vb.dmaptr++ = vb.vertex[i].i;
+
+ if (--vb.counter == 0)
+ vb.notify();
+}
+
+
+
+/* Color for ubyte (packed) color formats:
+ */
+static void radeon_Color3ub_ub( GLubyte r, GLubyte g, GLubyte b )
+{
+ radeon_color_t *dest = vb.colorptr;
+ dest->red = r;
+ dest->green = g;
+ dest->blue = b;
+ dest->alpha = 0xff;
+}
+
+static void radeon_Color3ubv_ub( const GLubyte *v )
+{
+ radeon_color_t *dest = vb.colorptr;
+ dest->red = v[0];
+ dest->green = v[1];
+ dest->blue = v[2];
+ dest->alpha = 0xff;
+}
+
+static void radeon_Color4ub_ub( GLubyte r, GLubyte g, GLubyte b, GLubyte a )
+{
+ radeon_color_t *dest = vb.colorptr;
+ dest->red = r;
+ dest->green = g;
+ dest->blue = b;
+ dest->alpha = a;
+}
+
+static void radeon_Color4ubv_ub( const GLubyte *v )
+{
+ *(GLuint *)vb.colorptr = LE32_TO_CPU(*(GLuint *)v);
+}
+
+
+static void radeon_Color3f_ub( GLfloat r, GLfloat g, GLfloat b )
+{
+ radeon_color_t *dest = vb.colorptr;
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->red, r );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->green, g );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, b );
+ dest->alpha = 255;
+}
+
+static void radeon_Color3fv_ub( const GLfloat *v )
+{
+ radeon_color_t *dest = vb.colorptr;
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->red, v[0] );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->green, v[1] );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, v[2] );
+ dest->alpha = 255;
+}
+
+static void radeon_Color4f_ub( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
+{
+ radeon_color_t *dest = vb.colorptr;
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->red, r );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->green, g );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, b );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->alpha, a );
+}
+
+static void radeon_Color4fv_ub( const GLfloat *v )
+{
+ radeon_color_t *dest = vb.colorptr;
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->red, v[0] );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->green, v[1] );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, v[2] );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->alpha, v[3] );
+}
+
+
+/* Color for float color+alpha formats:
+ */
+static void radeon_Color3ub_4f( GLubyte r, GLubyte g, GLubyte b )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = UBYTE_TO_FLOAT(r);
+ dest[1] = UBYTE_TO_FLOAT(g);
+ dest[2] = UBYTE_TO_FLOAT(b);
+ dest[3] = 1.0;
+}
+
+static void radeon_Color3ubv_4f( const GLubyte *v )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = UBYTE_TO_FLOAT(v[0]);
+ dest[1] = UBYTE_TO_FLOAT(v[1]);
+ dest[2] = UBYTE_TO_FLOAT(v[2]);
+ dest[3] = 1.0;
+}
+
+static void radeon_Color4ub_4f( GLubyte r, GLubyte g, GLubyte b, GLubyte a )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = UBYTE_TO_FLOAT(r);
+ dest[1] = UBYTE_TO_FLOAT(g);
+ dest[2] = UBYTE_TO_FLOAT(b);
+ dest[3] = UBYTE_TO_FLOAT(a);
+}
+
+static void radeon_Color4ubv_4f( const GLubyte *v )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = UBYTE_TO_FLOAT(v[0]);
+ dest[1] = UBYTE_TO_FLOAT(v[1]);
+ dest[2] = UBYTE_TO_FLOAT(v[2]);
+ dest[3] = UBYTE_TO_FLOAT(v[3]);
+}
+
+
+static void radeon_Color3f_4f( GLfloat r, GLfloat g, GLfloat b )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = r;
+ dest[1] = g;
+ dest[2] = b;
+ dest[3] = 1.0;
+}
+
+static void radeon_Color3fv_4f( const GLfloat *v )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = v[0];
+ dest[1] = v[1];
+ dest[2] = v[2];
+ dest[3] = 1.0;
+}
+
+static void radeon_Color4f_4f( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = r;
+ dest[1] = g;
+ dest[2] = b;
+ dest[3] = a;
+}
+
+static void radeon_Color4fv_4f( const GLfloat *v )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = v[0];
+ dest[1] = v[1];
+ dest[2] = v[2];
+ dest[3] = v[3];
+}
+
+
+/* Color for float color formats:
+ */
+static void radeon_Color3ub_3f( GLubyte r, GLubyte g, GLubyte b )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = UBYTE_TO_FLOAT(r);
+ dest[1] = UBYTE_TO_FLOAT(g);
+ dest[2] = UBYTE_TO_FLOAT(b);
+}
+
+static void radeon_Color3ubv_3f( const GLubyte *v )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = UBYTE_TO_FLOAT(v[0]);
+ dest[1] = UBYTE_TO_FLOAT(v[1]);
+ dest[2] = UBYTE_TO_FLOAT(v[2]);
+}
+
+static void radeon_Color4ub_3f( GLubyte r, GLubyte g, GLubyte b, GLubyte a )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = UBYTE_TO_FLOAT(r);
+ dest[1] = UBYTE_TO_FLOAT(g);
+ dest[2] = UBYTE_TO_FLOAT(b);
+ vb.context->Current.Attrib[VERT_ATTRIB_COLOR0][3] = UBYTE_TO_FLOAT(a);
+}
+
+static void radeon_Color4ubv_3f( const GLubyte *v )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = UBYTE_TO_FLOAT(v[0]);
+ dest[1] = UBYTE_TO_FLOAT(v[1]);
+ dest[2] = UBYTE_TO_FLOAT(v[2]);
+ vb.context->Current.Attrib[VERT_ATTRIB_COLOR0][3] = UBYTE_TO_FLOAT(v[3]);
+}
+
+
+static void radeon_Color3f_3f( GLfloat r, GLfloat g, GLfloat b )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = r;
+ dest[1] = g;
+ dest[2] = b;
+}
+
+static void radeon_Color3fv_3f( const GLfloat *v )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = v[0];
+ dest[1] = v[1];
+ dest[2] = v[2];
+}
+
+static void radeon_Color4f_3f( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = r;
+ dest[1] = g;
+ dest[2] = b;
+ vb.context->Current.Attrib[VERT_ATTRIB_COLOR0][3] = a;
+}
+
+static void radeon_Color4fv_3f( const GLfloat *v )
+{
+ GLfloat *dest = vb.floatcolorptr;
+ dest[0] = v[0];
+ dest[1] = v[1];
+ dest[2] = v[2];
+ vb.context->Current.Attrib[VERT_ATTRIB_COLOR0][3] = v[3];
+}
+
+
+/* Secondary Color:
+ */
+static void radeon_SecondaryColor3ubEXT_ub( GLubyte r, GLubyte g, GLubyte b )
+{
+ radeon_color_t *dest = vb.specptr;
+ dest->red = r;
+ dest->green = g;
+ dest->blue = b;
+ dest->alpha = 0xff;
+}
+
+static void radeon_SecondaryColor3ubvEXT_ub( const GLubyte *v )
+{
+ radeon_color_t *dest = vb.specptr;
+ dest->red = v[0];
+ dest->green = v[1];
+ dest->blue = v[2];
+ dest->alpha = 0xff;
+}
+
+static void radeon_SecondaryColor3fEXT_ub( GLfloat r, GLfloat g, GLfloat b )
+{
+ radeon_color_t *dest = vb.specptr;
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->red, r );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->green, g );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, b );
+ dest->alpha = 255;
+}
+
+static void radeon_SecondaryColor3fvEXT_ub( const GLfloat *v )
+{
+ radeon_color_t *dest = vb.specptr;
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->red, v[0] );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->green, v[1] );
+ UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, v[2] );
+ dest->alpha = 255;
+}
+
+static void radeon_SecondaryColor3ubEXT_3f( GLubyte r, GLubyte g, GLubyte b )
+{
+ GLfloat *dest = vb.floatspecptr;
+ dest[0] = UBYTE_TO_FLOAT(r);
+ dest[1] = UBYTE_TO_FLOAT(g);
+ dest[2] = UBYTE_TO_FLOAT(b);
+ dest[3] = 1.0;
+}
+
+static void radeon_SecondaryColor3ubvEXT_3f( const GLubyte *v )
+{
+ GLfloat *dest = vb.floatspecptr;
+ dest[0] = UBYTE_TO_FLOAT(v[0]);
+ dest[1] = UBYTE_TO_FLOAT(v[1]);
+ dest[2] = UBYTE_TO_FLOAT(v[2]);
+ dest[3] = 1.0;
+}
+
+static void radeon_SecondaryColor3fEXT_3f( GLfloat r, GLfloat g, GLfloat b )
+{
+ GLfloat *dest = vb.floatspecptr;
+ dest[0] = r;
+ dest[1] = g;
+ dest[2] = b;
+ dest[3] = 1.0;
+}
+
+static void radeon_SecondaryColor3fvEXT_3f( const GLfloat *v )
+{
+ GLfloat *dest = vb.floatspecptr;
+ dest[0] = v[0];
+ dest[1] = v[1];
+ dest[2] = v[2];
+ dest[3] = 1.0;
+}
+
+
+/* Normal
+ */
+static void radeon_Normal3f( GLfloat n0, GLfloat n1, GLfloat n2 )
+{
+ GLfloat *dest = vb.normalptr;
+ dest[0] = n0;
+ dest[1] = n1;
+ dest[2] = n2;
+}
+
+static void radeon_Normal3fv( const GLfloat *v )
+{
+ GLfloat *dest = vb.normalptr;
+ dest[0] = v[0];
+ dest[1] = v[1];
+ dest[2] = v[2];
+}
+
+
+/* TexCoord
+ */
+static void radeon_TexCoord1f( GLfloat s )
+{
+ GLfloat *dest = vb.texcoordptr[0];
+ dest[0] = s;
+ dest[1] = 0;
+}
+
+static void radeon_TexCoord1fv( const GLfloat *v )
+{
+ GLfloat *dest = vb.texcoordptr[0];
+ dest[0] = v[0];
+ dest[1] = 0;
+}
+
+static void radeon_TexCoord2f( GLfloat s, GLfloat t )
+{
+ GLfloat *dest = vb.texcoordptr[0];
+ dest[0] = s;
+ dest[1] = t;
+}
+
+static void radeon_TexCoord2fv( const GLfloat *v )
+{
+ GLfloat *dest = vb.texcoordptr[0];
+ dest[0] = v[0];
+ dest[1] = v[1];
+}
+
+
+/* MultiTexcoord
+ */
+static void radeon_MultiTexCoord1fARB( GLenum target, GLfloat s )
+{
+ GLfloat *dest = vb.texcoordptr[(target - GL_TEXTURE0_ARB)&1];
+ dest[0] = s;
+ dest[1] = 0;
+}
+
+static void radeon_MultiTexCoord1fvARB( GLenum target, const GLfloat *v )
+{
+ GLfloat *dest = vb.texcoordptr[(target - GL_TEXTURE0_ARB)&1];
+ dest[0] = v[0];
+ dest[1] = 0;
+}
+
+static void radeon_MultiTexCoord2fARB( GLenum target, GLfloat s, GLfloat t )
+{
+ GLfloat *dest = vb.texcoordptr[(target - GL_TEXTURE0_ARB)&1];
+ dest[0] = s;
+ dest[1] = t;
+}
+
+static void radeon_MultiTexCoord2fvARB( GLenum target, const GLfloat *v )
+{
+ GLfloat *dest = vb.texcoordptr[(target - GL_TEXTURE0_ARB)&1];
+ dest[0] = v[0];
+ dest[1] = v[1];
+}
+
+static struct dynfn *lookup( struct dynfn *l, int key )
+{
+ struct dynfn *f;
+
+ foreach( f, l ) {
+ if (f->key == key)
+ return f;
+ }
+
+ return 0;
+}
+
+/* Can't use the loopback template for this:
+ */
+
+#define CHOOSE(FN, FNTYPE, MASK, ACTIVE, ARGS1, ARGS2 ) \
+static void choose_##FN ARGS1 \
+{ \
+ radeonContextPtr rmesa = RADEON_CONTEXT(vb.context); \
+ int key = rmesa->vb.vertex_format & (MASK|ACTIVE); \
+ struct dynfn *dfn = lookup( &rmesa->vb.dfn_cache.FN, key ); \
+ \
+ if (dfn == 0) \
+ dfn = rmesa->vb.codegen.FN( vb.context, key ); \
+ else if (RADEON_DEBUG & DEBUG_CODEGEN) \
+ fprintf(stderr, "%s -- cached codegen\n", __FUNCTION__ ); \
+ \
+ if (dfn) \
+ vb.context->Exec->FN = (FNTYPE)(dfn->code); \
+ else { \
+ if (RADEON_DEBUG & DEBUG_CODEGEN) \
+ fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \
+ vb.context->Exec->FN = radeon_##FN; \
+ } \
+ \
+ vb.context->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
+ vb.context->Exec->FN ARGS2; \
+}
+
+
+
+/* For the _3f case, only allow one color function to be hooked in at
+ * a time. Eventually, use a similar mechanism to allow selecting the
+ * color component of the vertex format based on client behaviour.
+ *
+ * Note: Perform these actions even if there is a codegen or cached
+ * codegen version of the chosen function.
+ */
+#define CHOOSE_COLOR(FN, FNTYPE, NR, MASK, ACTIVE, ARGS1, ARGS2 ) \
+static void choose_##FN ARGS1 \
+{ \
+ GLcontext *ctx = vb.context; \
+ radeonContextPtr rmesa = RADEON_CONTEXT(vb.context); \
+ int key = rmesa->vb.vertex_format & (MASK|ACTIVE); \
+ struct dynfn *dfn; \
+ \
+ if (rmesa->vb.vertex_format & ACTIVE_PKCOLOR) { \
+ ctx->Exec->FN = radeon_##FN##_ub; \
+ } \
+ else if ((rmesa->vb.vertex_format & \
+ (ACTIVE_FPCOLOR|ACTIVE_FPALPHA)) == ACTIVE_FPCOLOR) { \
+ \
+ if (rmesa->vb.installed_color_3f_sz != NR) { \
+ rmesa->vb.installed_color_3f_sz = NR; \
+ if (NR == 3) ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = 1.0; \
+ if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) { \
+ radeon_copy_to_current( ctx ); \
+ _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt ); \
+ ctx->Exec->FN ARGS2; \
+ return; \
+ } \
+ } \
+ \
+ ctx->Exec->FN = radeon_##FN##_3f; \
+ } \
+ else { \
+ ctx->Exec->FN = radeon_##FN##_4f; \
+ } \
+ \
+ \
+ dfn = lookup( &rmesa->vb.dfn_cache.FN, key ); \
+ if (!dfn) dfn = rmesa->vb.codegen.FN( ctx, key ); \
+ \
+ if (dfn) { \
+ if (RADEON_DEBUG & DEBUG_CODEGEN) \
+ fprintf(stderr, "%s -- codegen version\n", __FUNCTION__ ); \
+ ctx->Exec->FN = (FNTYPE)dfn->code; \
+ } \
+ else if (RADEON_DEBUG & DEBUG_CODEGEN) \
+ fprintf(stderr, "%s -- 'c' version\n", __FUNCTION__ ); \
+ \
+ ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
+ ctx->Exec->FN ARGS2; \
+}
+
+
+
+/* Right now there are both _ub and _3f versions of the secondary color
+ * functions. Currently, we only set-up the hardware to use the _ub versions.
+ * The _3f versions are needed for the cases where secondary color isn't used
+ * in the vertex format, but it still needs to be stored in the context
+ * state vector.
+ */
+#define CHOOSE_SECONDARY_COLOR(FN, FNTYPE, MASK, ACTIVE, ARGS1, ARGS2 ) \
+static void choose_##FN ARGS1 \
+{ \
+ GLcontext *ctx = vb.context; \
+ radeonContextPtr rmesa = RADEON_CONTEXT(vb.context); \
+ int key = rmesa->vb.vertex_format & (MASK|ACTIVE); \
+ struct dynfn *dfn = lookup( &rmesa->vb.dfn_cache.FN, key ); \
+ \
+ if (dfn == 0) \
+ dfn = rmesa->vb.codegen.FN( vb.context, key ); \
+ else if (RADEON_DEBUG & DEBUG_CODEGEN) \
+ fprintf(stderr, "%s -- cached version\n", __FUNCTION__ ); \
+ \
+ if (dfn) \
+ vb.context->Exec->FN = (FNTYPE)(dfn->code); \
+ else { \
+ if (RADEON_DEBUG & DEBUG_CODEGEN) \
+ fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \
+ vb.context->Exec->FN = ((rmesa->vb.vertex_format & ACTIVE_PKSPEC) != 0) \
+ ? radeon_##FN##_ub : radeon_##FN##_3f; \
+ } \
+ \
+ ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
+ ctx->Exec->FN ARGS2; \
+}
+
+
+
+
+
+/* Shorthands
+ */
+#define ACTIVE_XYZW (RADEON_CP_VC_FRMT_W0|RADEON_CP_VC_FRMT_Z)
+#define ACTIVE_NORM RADEON_CP_VC_FRMT_N0
+
+#define ACTIVE_PKCOLOR RADEON_CP_VC_FRMT_PKCOLOR
+#define ACTIVE_FPCOLOR RADEON_CP_VC_FRMT_FPCOLOR
+#define ACTIVE_FPALPHA RADEON_CP_VC_FRMT_FPALPHA
+#define ACTIVE_COLOR (ACTIVE_FPCOLOR|ACTIVE_PKCOLOR)
+
+#define ACTIVE_PKSPEC RADEON_CP_VC_FRMT_PKSPEC
+#define ACTIVE_FPSPEC RADEON_CP_VC_FRMT_FPSPEC
+#define ACTIVE_SPEC (ACTIVE_FPSPEC|ACTIVE_PKSPEC)
+
+#define ACTIVE_ST0 RADEON_CP_VC_FRMT_ST0
+#define ACTIVE_ST1 RADEON_CP_VC_FRMT_ST1
+#define ACTIVE_ST_ALL (RADEON_CP_VC_FRMT_ST1|RADEON_CP_VC_FRMT_ST0)
+
+/* Each codegen function should be able to be fully specified by a
+ * subsetted version of rmesa->vb.vertex_format.
+ */
+#define MASK_NORM (ACTIVE_XYZW)
+#define MASK_COLOR (MASK_NORM|ACTIVE_NORM)
+#define MASK_SPEC (MASK_COLOR|ACTIVE_COLOR)
+#define MASK_ST0 (MASK_SPEC|ACTIVE_SPEC)
+#define MASK_ST1 (MASK_ST0|ACTIVE_ST0)
+#define MASK_ST_ALL (MASK_ST1|ACTIVE_ST1)
+#define MASK_VERTEX (MASK_ST_ALL|ACTIVE_FPALPHA)
+
+
+typedef void (*p4f)( GLfloat, GLfloat, GLfloat, GLfloat );
+typedef void (*p3f)( GLfloat, GLfloat, GLfloat );
+typedef void (*p2f)( GLfloat, GLfloat );
+typedef void (*p1f)( GLfloat );
+typedef void (*pe2f)( GLenum, GLfloat, GLfloat );
+typedef void (*pe1f)( GLenum, GLfloat );
+typedef void (*p4ub)( GLubyte, GLubyte, GLubyte, GLubyte );
+typedef void (*p3ub)( GLubyte, GLubyte, GLubyte );
+typedef void (*pfv)( const GLfloat * );
+typedef void (*pefv)( GLenum, const GLfloat * );
+typedef void (*pubv)( const GLubyte * );
+
+
+CHOOSE(Normal3f, p3f, MASK_NORM, ACTIVE_NORM,
+ (GLfloat a,GLfloat b,GLfloat c), (a,b,c))
+CHOOSE(Normal3fv, pfv, MASK_NORM, ACTIVE_NORM,
+ (const GLfloat *v), (v))
+
+CHOOSE_COLOR(Color4ub, p4ub, 4, MASK_COLOR, ACTIVE_COLOR,
+ (GLubyte a,GLubyte b, GLubyte c, GLubyte d), (a,b,c,d))
+CHOOSE_COLOR(Color4ubv, pubv, 4, MASK_COLOR, ACTIVE_COLOR,
+ (const GLubyte *v), (v))
+CHOOSE_COLOR(Color3ub, p3ub, 3, MASK_COLOR, ACTIVE_COLOR,
+ (GLubyte a,GLubyte b, GLubyte c), (a,b,c))
+CHOOSE_COLOR(Color3ubv, pubv, 3, MASK_COLOR, ACTIVE_COLOR,
+ (const GLubyte *v), (v))
+
+CHOOSE_COLOR(Color4f, p4f, 4, MASK_COLOR, ACTIVE_COLOR,
+ (GLfloat a,GLfloat b, GLfloat c, GLfloat d), (a,b,c,d))
+CHOOSE_COLOR(Color4fv, pfv, 4, MASK_COLOR, ACTIVE_COLOR,
+ (const GLfloat *v), (v))
+CHOOSE_COLOR(Color3f, p3f, 3, MASK_COLOR, ACTIVE_COLOR,
+ (GLfloat a,GLfloat b, GLfloat c), (a,b,c))
+CHOOSE_COLOR(Color3fv, pfv, 3, MASK_COLOR, ACTIVE_COLOR,
+ (const GLfloat *v), (v))
+
+
+CHOOSE_SECONDARY_COLOR(SecondaryColor3ubEXT, p3ub, MASK_SPEC, ACTIVE_SPEC,
+ (GLubyte a,GLubyte b, GLubyte c), (a,b,c))
+CHOOSE_SECONDARY_COLOR(SecondaryColor3ubvEXT, pubv, MASK_SPEC, ACTIVE_SPEC,
+ (const GLubyte *v), (v))
+CHOOSE_SECONDARY_COLOR(SecondaryColor3fEXT, p3f, MASK_SPEC, ACTIVE_SPEC,
+ (GLfloat a,GLfloat b, GLfloat c), (a,b,c))
+CHOOSE_SECONDARY_COLOR(SecondaryColor3fvEXT, pfv, MASK_SPEC, ACTIVE_SPEC,
+ (const GLfloat *v), (v))
+
+CHOOSE(TexCoord2f, p2f, MASK_ST0, ACTIVE_ST0,
+ (GLfloat a,GLfloat b), (a,b))
+CHOOSE(TexCoord2fv, pfv, MASK_ST0, ACTIVE_ST0,
+ (const GLfloat *v), (v))
+CHOOSE(TexCoord1f, p1f, MASK_ST0, ACTIVE_ST0,
+ (GLfloat a), (a))
+CHOOSE(TexCoord1fv, pfv, MASK_ST0, ACTIVE_ST0,
+ (const GLfloat *v), (v))
+
+CHOOSE(MultiTexCoord2fARB, pe2f, MASK_ST_ALL, ACTIVE_ST_ALL,
+ (GLenum u,GLfloat a,GLfloat b), (u,a,b))
+CHOOSE(MultiTexCoord2fvARB, pefv, MASK_ST_ALL, ACTIVE_ST_ALL,
+ (GLenum u,const GLfloat *v), (u,v))
+CHOOSE(MultiTexCoord1fARB, pe1f, MASK_ST_ALL, ACTIVE_ST_ALL,
+ (GLenum u,GLfloat a), (u,a))
+CHOOSE(MultiTexCoord1fvARB, pefv, MASK_ST_ALL, ACTIVE_ST_ALL,
+ (GLenum u,const GLfloat *v), (u,v))
+
+CHOOSE(Vertex3f, p3f, MASK_VERTEX, MASK_VERTEX,
+ (GLfloat a,GLfloat b,GLfloat c), (a,b,c))
+CHOOSE(Vertex3fv, pfv, MASK_VERTEX, MASK_VERTEX,
+ (const GLfloat *v), (v))
+CHOOSE(Vertex2f, p2f, MASK_VERTEX, MASK_VERTEX,
+ (GLfloat a,GLfloat b), (a,b))
+CHOOSE(Vertex2fv, pfv, MASK_VERTEX, MASK_VERTEX,
+ (const GLfloat *v), (v))
+
+
+
+
+
+void radeonVtxfmtInitChoosers( GLvertexformat *vfmt )
+{
+ vfmt->Color3f = choose_Color3f;
+ vfmt->Color3fv = choose_Color3fv;
+ vfmt->Color3ub = choose_Color3ub;
+ vfmt->Color3ubv = choose_Color3ubv;
+ vfmt->Color4f = choose_Color4f;
+ vfmt->Color4fv = choose_Color4fv;
+ vfmt->Color4ub = choose_Color4ub;
+ vfmt->Color4ubv = choose_Color4ubv;
+ vfmt->SecondaryColor3fEXT = choose_SecondaryColor3fEXT;
+ vfmt->SecondaryColor3fvEXT = choose_SecondaryColor3fvEXT;
+ vfmt->SecondaryColor3ubEXT = choose_SecondaryColor3ubEXT;
+ vfmt->SecondaryColor3ubvEXT = choose_SecondaryColor3ubvEXT;
+ vfmt->MultiTexCoord1fARB = choose_MultiTexCoord1fARB;
+ vfmt->MultiTexCoord1fvARB = choose_MultiTexCoord1fvARB;
+ vfmt->MultiTexCoord2fARB = choose_MultiTexCoord2fARB;
+ vfmt->MultiTexCoord2fvARB = choose_MultiTexCoord2fvARB;
+ vfmt->Normal3f = choose_Normal3f;
+ vfmt->Normal3fv = choose_Normal3fv;
+ vfmt->TexCoord1f = choose_TexCoord1f;
+ vfmt->TexCoord1fv = choose_TexCoord1fv;
+ vfmt->TexCoord2f = choose_TexCoord2f;
+ vfmt->TexCoord2fv = choose_TexCoord2fv;
+ vfmt->Vertex2f = choose_Vertex2f;
+ vfmt->Vertex2fv = choose_Vertex2fv;
+ vfmt->Vertex3f = choose_Vertex3f;
+ vfmt->Vertex3fv = choose_Vertex3fv;
+}
+
+
+static struct dynfn *codegen_noop( GLcontext *ctx, int key )
+{
+ (void) ctx; (void) key;
+ return 0;
+}
+
+void radeonInitCodegen( struct dfn_generators *gen )
+{
+ gen->Vertex3f = codegen_noop;
+ gen->Vertex3fv = codegen_noop;
+ gen->Color4ub = codegen_noop;
+ gen->Color4ubv = codegen_noop;
+ gen->Normal3f = codegen_noop;
+ gen->Normal3fv = codegen_noop;
+ gen->TexCoord2f = codegen_noop;
+ gen->TexCoord2fv = codegen_noop;
+ gen->MultiTexCoord2fARB = codegen_noop;
+ gen->MultiTexCoord2fvARB = codegen_noop;
+ gen->Vertex2f = codegen_noop;
+ gen->Vertex2fv = codegen_noop;
+ gen->Color3ub = codegen_noop;
+ gen->Color3ubv = codegen_noop;
+ gen->Color4f = codegen_noop;
+ gen->Color4fv = codegen_noop;
+ gen->Color3f = codegen_noop;
+ gen->Color3fv = codegen_noop;
+ gen->SecondaryColor3fEXT = codegen_noop;
+ gen->SecondaryColor3fvEXT = codegen_noop;
+ gen->SecondaryColor3ubEXT = codegen_noop;
+ gen->SecondaryColor3ubvEXT = codegen_noop;
+ gen->TexCoord1f = codegen_noop;
+ gen->TexCoord1fv = codegen_noop;
+ gen->MultiTexCoord1fARB = codegen_noop;
+ gen->MultiTexCoord1fvARB = codegen_noop;
+
+ if (!getenv("RADEON_NO_CODEGEN")) {
+#if defined(USE_X86_ASM)
+ radeonInitX86Codegen( gen );
+#endif
+
+#if defined(USE_SSE_ASM)
+ radeonInitSSECodegen( gen );
+#endif
+ }
+}
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_sse.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_sse.c
new file mode 100644
index 000000000..868294fd5
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_sse.c
@@ -0,0 +1,87 @@
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
+ Tungsten Graphics Inc., Cedar Park, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "simple_list.h"
+#include "radeon_vtxfmt.h"
+
+#if defined(USE_SSE_ASM)
+#include "X86/common_x86_asm.h"
+
+/* Build specialized versions of the immediate calls on the fly for
+ * the current state. ???P4 SSE2 versions???
+ */
+
+
+static struct dynfn *makeSSENormal3fv( GLcontext *ctx, int key )
+{
+ /* Requires P4 (sse2?)
+ */
+ static unsigned char temp[] = {
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0xba, 0x78, 0x56, 0x34, 0x12, /* mov $0x12345678,%edx */
+ 0xf3, 0x0f, 0x7e, 0x00, /* movq (%eax),%xmm0 */
+ 0x66, 0x0f, 0x6e, 0x48, 0x08, /* movd 0x8(%eax),%xmm1 */
+ 0x66, 0x0f, 0xd6, 0x42, 0x0c, /* movq %xmm0,0xc(%edx) */
+ 0x66, 0x0f, 0x7e, 0x4a, 0x14, /* movd %xmm1,0x14(%edx) */
+ 0xc3, /* ret */
+ };
+
+
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ insert_at_head( &rmesa->vb.dfn_cache.Normal3fv, dfn );
+ dfn->key = key;
+
+ dfn->code = ALIGN_MALLOC( sizeof(temp), 16 );
+ memcpy (dfn->code, temp, sizeof(temp));
+ FIXUP(dfn->code, 5, 0x0, (int)vb.normalptr);
+ return dfn;
+}
+
+void radeonInitSSECodegen( struct dfn_generators *gen )
+{
+ if ( cpu_has_xmm && cpu_has_xmm2 )
+ /*gen->Normal3fv = */ (void)makeSSENormal3fv;
+}
+
+#else
+
+void radeonInitSSECodegen( struct dfn_generators *gen )
+{
+ (void) gen;
+}
+
+#endif
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_x86.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_x86.c
new file mode 100644
index 000000000..341b4ed16
--- /dev/null
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_x86.c
@@ -0,0 +1,462 @@
+/* $XFree86$ */
+/**************************************************************************
+
+Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
+ Tungsten Graphics Inc., Cedar Park, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "mmath.h"
+#include "simple_list.h"
+#include "radeon_vtxfmt.h"
+
+#if defined(USE_X86_ASM)
+
+#define EXTERN( FUNC ) \
+extern const char *FUNC; \
+extern const char *FUNC##_end
+
+EXTERN ( _x86_Normal3fv );
+EXTERN ( _x86_Normal3f );
+EXTERN ( _x86_Vertex3fv_6 );
+EXTERN ( _x86_Vertex3fv_8 );
+EXTERN ( _x86_Vertex3fv );
+EXTERN ( _x86_Vertex3f_4 );
+EXTERN ( _x86_Vertex3f_6 );
+EXTERN ( _x86_Vertex3f );
+EXTERN ( _x86_Color4ubv_ub );
+EXTERN ( _x86_Color4ubv_4f );
+EXTERN ( _x86_Color4ub_ub );
+EXTERN ( _x86_Color3fv_3f );
+EXTERN ( _x86_Color3f_3f );
+EXTERN ( _x86_TexCoord2fv );
+EXTERN ( _x86_TexCoord2f );
+EXTERN ( _x86_MultiTexCoord2fvARB );
+EXTERN ( _x86_MultiTexCoord2fvARB_2 );
+EXTERN ( _x86_MultiTexCoord2fARB );
+EXTERN ( _x86_MultiTexCoord2fARB_2 );
+
+
+/* Build specialized versions of the immediate calls on the fly for
+ * the current state. Generic x86 versions.
+ */
+
+struct dynfn *radeon_makeX86Vertex3f( GLcontext *ctx, int key )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+
+ if (RADEON_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x %d\n", __FUNCTION__, key, vb.vertex_size );
+
+ switch (vb.vertex_size) {
+ case 4: {
+
+ DFN ( _x86_Vertex3f_4, rmesa->vb.dfn_cache.Vertex3f );
+ FIXUP(dfn->code, 2, 0x0, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 25, 0x0, (int)&vb.vertex[3]);
+ FIXUP(dfn->code, 36, 0x0, (int)&vb.counter);
+ FIXUP(dfn->code, 46, 0x0, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 51, 0x0, (int)&vb.counter);
+ FIXUP(dfn->code, 60, 0x0, (int)&vb.notify);
+ break;
+ }
+ case 6: {
+
+ DFN ( _x86_Vertex3f_6, rmesa->vb.dfn_cache.Vertex3f );
+ FIXUP(dfn->code, 3, 0x0, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 28, 0x0, (int)&vb.vertex[3]);
+ FIXUP(dfn->code, 34, 0x0, (int)&vb.vertex[4]);
+ FIXUP(dfn->code, 40, 0x0, (int)&vb.vertex[5]);
+ FIXUP(dfn->code, 57, 0x0, (int)&vb.counter);
+ FIXUP(dfn->code, 63, 0x0, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 70, 0x0, (int)&vb.counter);
+ FIXUP(dfn->code, 79, 0x0, (int)&vb.notify);
+ break;
+ }
+ default: {
+
+ DFN ( _x86_Vertex3f, rmesa->vb.dfn_cache.Vertex3f );
+ FIXUP(dfn->code, 3, 0x0, (int)&vb.vertex[3]);
+ FIXUP(dfn->code, 9, 0x0, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 37, 0x0, vb.vertex_size-3);
+ FIXUP(dfn->code, 44, 0x0, (int)&vb.counter);
+ FIXUP(dfn->code, 50, 0x0, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 56, 0x0, (int)&vb.counter);
+ FIXUP(dfn->code, 67, 0x0, (int)&vb.notify);
+ break;
+ }
+ }
+
+ return dfn;
+}
+
+
+
+struct dynfn *radeon_makeX86Vertex3fv( GLcontext *ctx, int key )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+
+ if (RADEON_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x %d\n", __FUNCTION__, key, vb.vertex_size );
+
+ switch (vb.vertex_size) {
+ case 6: {
+
+ DFN ( _x86_Vertex3fv_6, rmesa->vb.dfn_cache.Vertex3fv );
+ FIXUP(dfn->code, 1, 0x00000000, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 27, 0x0000001c, (int)&vb.vertex[3]);
+ FIXUP(dfn->code, 33, 0x00000020, (int)&vb.vertex[4]);
+ FIXUP(dfn->code, 45, 0x00000024, (int)&vb.vertex[5]);
+ FIXUP(dfn->code, 56, 0x00000000, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 61, 0x00000004, (int)&vb.counter);
+ FIXUP(dfn->code, 67, 0x00000004, (int)&vb.counter);
+ FIXUP(dfn->code, 76, 0x00000008, (int)&vb.notify);
+ break;
+ }
+
+
+ case 8: {
+
+ DFN ( _x86_Vertex3fv_8, rmesa->vb.dfn_cache.Vertex3fv );
+ FIXUP(dfn->code, 1, 0x00000000, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 27, 0x0000001c, (int)&vb.vertex[3]);
+ FIXUP(dfn->code, 33, 0x00000020, (int)&vb.vertex[4]);
+ FIXUP(dfn->code, 45, 0x0000001c, (int)&vb.vertex[5]);
+ FIXUP(dfn->code, 51, 0x00000020, (int)&vb.vertex[6]);
+ FIXUP(dfn->code, 63, 0x00000024, (int)&vb.vertex[7]);
+ FIXUP(dfn->code, 74, 0x00000000, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 79, 0x00000004, (int)&vb.counter);
+ FIXUP(dfn->code, 85, 0x00000004, (int)&vb.counter);
+ FIXUP(dfn->code, 94, 0x00000008, (int)&vb.notify);
+ break;
+ }
+
+
+
+ default: {
+
+ DFN ( _x86_Vertex3fv, rmesa->vb.dfn_cache.Vertex3fv );
+ FIXUP(dfn->code, 8, 0x01010101, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 32, 0x00000006, vb.vertex_size-3);
+ FIXUP(dfn->code, 37, 0x00000058, (int)&vb.vertex[3]);
+ FIXUP(dfn->code, 45, 0x01010101, (int)&vb.dmaptr);
+ FIXUP(dfn->code, 50, 0x02020202, (int)&vb.counter);
+ FIXUP(dfn->code, 58, 0x02020202, (int)&vb.counter);
+ FIXUP(dfn->code, 67, 0x0, (int)&vb.notify);
+ break;
+ }
+ }
+
+ return dfn;
+}
+
+struct dynfn *radeon_makeX86Normal3fv( GLcontext *ctx, int key )
+{
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ int i = 0;
+
+ if (RADEON_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key );
+
+ DFN ( _x86_Normal3fv, rmesa->vb.dfn_cache.Normal3fv );
+
+ FIXUP2(dfn->code, i, 0x0, (int)vb.normalptr);
+ FIXUP2(dfn->code, i, 0x4, 4+(int)vb.normalptr);
+ FIXUP2(dfn->code, i, 0x8, 8+(int)vb.normalptr);
+ /* fprintf(stderr, "%s done\n", __FUNCTION__); */
+ return dfn;
+}
+
+struct dynfn *radeon_makeX86Normal3f( GLcontext *ctx, int key )
+{
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+
+ if (RADEON_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key );
+
+ DFN ( _x86_Normal3f, rmesa->vb.dfn_cache.Normal3f );
+ FIXUP(dfn->code, 1, 0x12345678, (int)vb.normalptr);
+ return dfn;
+}
+
+struct dynfn *radeon_makeX86Color4ubv( GLcontext *ctx, int key )
+{
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+
+
+ if (RADEON_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key );
+
+ if (key & RADEON_CP_VC_FRMT_PKCOLOR) {
+ DFN ( _x86_Color4ubv_ub, rmesa->vb.dfn_cache.Color4ubv);
+ FIXUP(dfn->code, 5, 0x12345678, (int)vb.colorptr);
+ return dfn;
+ }
+ else {
+
+ DFN ( _x86_Color4ubv_4f, rmesa->vb.dfn_cache.Color4ubv);
+ FIXUP(dfn->code, 2, 0x00000000, (int)_mesa_ubyte_to_float_color_tab);
+ FIXUP(dfn->code, 27, 0xdeadbeaf, (int)vb.floatcolorptr);
+ FIXUP(dfn->code, 33, 0xdeadbeaf, (int)vb.floatcolorptr+4);
+ FIXUP(dfn->code, 55, 0xdeadbeaf, (int)vb.floatcolorptr+8);
+ FIXUP(dfn->code, 61, 0xdeadbeaf, (int)vb.floatcolorptr+12);
+ return dfn;
+ }
+}
+
+struct dynfn *radeon_makeX86Color4ub( GLcontext *ctx, int key )
+{
+ if (RADEON_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key );
+
+ if (key & RADEON_CP_VC_FRMT_PKCOLOR) {
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+
+ DFN ( _x86_Color4ub_ub, rmesa->vb.dfn_cache.Color4ub );
+ FIXUP(dfn->code, 18, 0x0, (int)vb.colorptr);
+ FIXUP(dfn->code, 24, 0x0, (int)vb.colorptr+1);
+ FIXUP(dfn->code, 30, 0x0, (int)vb.colorptr+2);
+ FIXUP(dfn->code, 36, 0x0, (int)vb.colorptr+3);
+ return dfn;
+ }
+ else
+ return 0;
+}
+
+
+struct dynfn *radeon_makeX86Color3fv( GLcontext *ctx, int key )
+{
+ if (key & (RADEON_CP_VC_FRMT_PKCOLOR|RADEON_CP_VC_FRMT_FPALPHA))
+ return 0;
+ else
+ {
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+
+ if (RADEON_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key );
+
+ DFN ( _x86_Color3fv_3f, rmesa->vb.dfn_cache.Color3fv );
+ FIXUP(dfn->code, 5, 0x0, (int)vb.floatcolorptr);
+ return dfn;
+ }
+}
+
+struct dynfn *radeon_makeX86Color3f( GLcontext *ctx, int key )
+{
+ if (key & (RADEON_CP_VC_FRMT_PKCOLOR|RADEON_CP_VC_FRMT_FPALPHA))
+ return 0;
+ else
+ {
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+
+ if (RADEON_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key );
+
+ DFN ( _x86_Color3f_3f, rmesa->vb.dfn_cache.Color3f );
+ FIXUP(dfn->code, 1, 0x12345678, (int)vb.floatcolorptr);
+ return dfn;
+ }
+}
+
+
+
+struct dynfn *radeon_makeX86TexCoord2fv( GLcontext *ctx, int key )
+{
+
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+
+ if (RADEON_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key );
+
+ DFN ( _x86_TexCoord2fv, rmesa->vb.dfn_cache.TexCoord2fv );
+ FIXUP(dfn->code, 5, 0x12345678, (int)vb.texcoordptr[0]);
+ return dfn;
+}
+
+struct dynfn *radeon_makeX86TexCoord2f( GLcontext *ctx, int key )
+{
+
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+
+ if (RADEON_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key );
+
+ DFN ( _x86_TexCoord2f, rmesa->vb.dfn_cache.TexCoord2f );
+ FIXUP(dfn->code, 1, 0x12345678, (int)vb.texcoordptr[0]);
+ return dfn;
+}
+
+struct dynfn *radeon_makeX86MultiTexCoord2fvARB( GLcontext *ctx, int key )
+{
+#if 0
+ static char temp[] = {
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0x8b, 0x4c, 0x24, 0x08, /* mov 0x8(%esp,1),%ecx */
+ 0x2d, 0xc0, 0x84, 0x00, 0x00, /* sub $0x84c0,%eax */
+ 0x83, 0xe0, 0x01, /* and $0x1,%eax */
+ 0x8b, 0x11, /* mov (%ecx),%edx */
+ 0xc1, 0xe0, 0x03, /* shl $0x3,%eax */
+ 0x8b, 0x49, 0x04, /* mov 0x4(%ecx),%ecx */
+ 0x89, 0x90, 0, 0, 0, 0,/* mov %edx,DEST(%eax) */
+ 0x89, 0x88, 0, 0, 0, 0,/* mov %ecx,DEST+8(%eax) */
+ 0xc3, /* ret */
+ };
+ static char temp2[] = {
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0x8b, 0x4c, 0x24, 0x08, /* mov 0x8(%esp,1),%ecx */
+ 0x2d, 0xc0, 0x84, 0x00, 0x00, /* sub $0x84c0,%eax */
+ 0x83, 0xe0, 0x01, /* and $0x1,%eax */
+ 0x8b, 0x14, 0x85, 0, 0, 0, 0, /* mov DEST(,%eax,4),%edx */
+ 0x8b, 0x01, /* mov (%ecx),%eax */
+ 0x89, 0x02, /* mov %eax,(%edx) */
+ 0x8b, 0x41, 0x04, /* mov 0x4(%ecx),%eax */
+ 0x89, 0x42, 0x04, /* mov %eax,0x4(%edx) */
+ 0xc3, /* ret */
+ };
+#endif
+
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+
+ if (RADEON_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key );
+
+ if ((key & (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) ==
+ (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) {
+ DFN ( _x86_MultiTexCoord2fvARB, rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
+ FIXUP(dfn->code, 26, 0xdeadbeef, (int)vb.texcoordptr[0]);
+ FIXUP(dfn->code, 32, 0xdeadbeef, (int)vb.texcoordptr[0]+4);
+ } else {
+ DFN ( _x86_MultiTexCoord2fvARB_2, rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
+ FIXUP(dfn->code, 19, 0x0, (int)vb.texcoordptr);
+ }
+ return dfn;
+}
+
+struct dynfn *radeon_makeX86MultiTexCoord2fARB( GLcontext *ctx,
+ int key )
+{
+#if 0
+ static char temp[] = {
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0x8b, 0x54, 0x24, 0x08, /* mov 0x8(%esp,1),%edx */
+ 0x2d, 0xc0, 0x84, 0x00, 0x00, /* sub $0x84c0,%eax */
+ 0x8b, 0x4c, 0x24, 0x0c, /* mov 0xc(%esp,1),%ecx */
+ 0x83, 0xe0, 0x01, /* and $0x1,%eax */
+ 0xc1, 0xe0, 0x03, /* shl $0x3,%eax */
+ 0x89, 0x90, 0, 0, 0, 0, /* mov %edx,DEST(%eax) */
+ 0x89, 0x88, 0, 0, 0, 0, /* mov %ecx,DEST+8(%eax) */
+ 0xc3, /* ret */
+ };
+
+ static char temp2[] = {
+ 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */
+ 0x8b, 0x54, 0x24, 0x08, /* mov 0x8(%esp,1),%edx */
+ 0x2d, 0xc0, 0x84, 0x00, 0x00, /* sub $0x84c0,%eax */
+ 0x8b, 0x4c, 0x24, 0x0c, /* mov 0xc(%esp,1),%ecx */
+ 0x83, 0xe0, 0x01, /* and $0x1,%eax */
+ 0x8b, 0x04, 0x85, 0, 0, 0, 0, /* mov DEST(,%eax,4),%eax */
+ 0x89, 0x10, /* mov %edx,(%eax) */
+ 0x89, 0x48, 0x04, /* mov %ecx,0x4(%eax) */
+ 0xc3, /* ret */
+ };
+#endif
+ struct dynfn *dfn = MALLOC_STRUCT( dynfn );
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+
+ if (RADEON_DEBUG & DEBUG_CODEGEN)
+ fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key );
+
+ if ((key & (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) ==
+ (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) {
+ DFN ( _x86_MultiTexCoord2fARB, rmesa->vb.dfn_cache.MultiTexCoord2fARB );
+ FIXUP(dfn->code, 25, 0xdeadbeef, (int)vb.texcoordptr[0]);
+ FIXUP(dfn->code, 31, 0xdeadbeef, (int)vb.texcoordptr[0]+4);
+ }
+ else {
+ /* Note: this might get generated multiple times, even though the
+ * actual emitted code is the same.
+ */
+ DFN ( _x86_MultiTexCoord2fARB_2, rmesa->vb.dfn_cache.MultiTexCoord2fARB );
+ FIXUP(dfn->code, 23, 0x0, (int)vb.texcoordptr);
+ }
+ return dfn;
+}
+
+
+void radeonInitX86Codegen( struct dfn_generators *gen )
+{
+ gen->Vertex3f = radeon_makeX86Vertex3f;
+ gen->Vertex3fv = radeon_makeX86Vertex3fv;
+ gen->Color4ub = radeon_makeX86Color4ub; /* PKCOLOR only */
+ gen->Color4ubv = radeon_makeX86Color4ubv; /* PKCOLOR only */
+ gen->Normal3f = radeon_makeX86Normal3f;
+ gen->Normal3fv = radeon_makeX86Normal3fv;
+ gen->TexCoord2f = radeon_makeX86TexCoord2f;
+ gen->TexCoord2fv = radeon_makeX86TexCoord2fv;
+ gen->MultiTexCoord2fARB = radeon_makeX86MultiTexCoord2fARB;
+ gen->MultiTexCoord2fvARB = radeon_makeX86MultiTexCoord2fvARB;
+ gen->Color3f = radeon_makeX86Color3f;
+ gen->Color3fv = radeon_makeX86Color3fv;
+
+ /* Not done:
+ */
+/* gen->Vertex2f = radeon_makeX86Vertex2f; */
+/* gen->Vertex2fv = radeon_makeX86Vertex2fv; */
+/* gen->Color3ub = radeon_makeX86Color3ub; */
+/* gen->Color3ubv = radeon_makeX86Color3ubv; */
+/* gen->Color4f = radeon_makeX86Color4f; */
+/* gen->Color4fv = radeon_makeX86Color4fv; */
+/* gen->TexCoord1f = radeon_makeX86TexCoord1f; */
+/* gen->TexCoord1fv = radeon_makeX86TexCoord1fv; */
+/* gen->MultiTexCoord1fARB = radeon_makeX86MultiTexCoord1fARB; */
+/* gen->MultiTexCoord1fvARB = radeon_makeX86MultiTexCoord1fvARB; */
+}
+
+
+#else
+
+void radeonInitX86Codegen( struct dfn_generators *gen )
+{
+ (void) gen;
+}
+
+#endif
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxtmp_x86.S b/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxtmp_x86.S
index 7b325caec..f41c37fc3 100644
--- a/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxtmp_x86.S
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxtmp_x86.S
@@ -1,4 +1,4 @@
-/* $XFree86$ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxtmp_x86.S,v 1.1 2002/10/30 12:51:58 alanh Exp $ */
/**************************************************************************
Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
@@ -112,7 +112,8 @@ GLOBL ( _x86_Vertex3f )
movl %ecx, 8(%edi)
addl $12, %edi
movl $0, %ecx
- repz movsl %ds:(%esi), %es:(%edi)
+ repz
+ movsl %ds:(%esi), %es:(%edi)
movl (0), %eax
movl %edi, (0)
dec %eax
@@ -204,7 +205,8 @@ GLOBL ( _x86_Vertex3fv )
addl $12, %edi
movl $6, %ecx
movl $0x58, %esi
- repz movsl %ds:(%esi), %es:(%edi)
+ repz
+ movsl %ds:(%esi), %es:(%edi)
movl %edi, (0x1010101)
movl (0x2020202), %eax
pop %esi
diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c b/xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c
index fe0780804..a3f05b947 100644
--- a/xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c
+++ b/xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c
@@ -76,17 +76,13 @@ GLboolean XMesaInitDriver (__DRIscreenPrivate * driScrnPriv)
{
SISDRIPtr priv = (SISDRIPtr) driScrnPriv->pDevPriv;
- /* Check the DRI version */
- {
- int major, minor, patch;
- if (XF86DRIQueryVersion(driScrnPriv->display, &major, &minor, &patch)) {
- if (major != 4 || minor < 0) {
- char msg[1000];
- sprintf(msg, "sis DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch);
- __driMesaMessage(msg);
- return GL_FALSE;
- }
- }
+
+ /* Check the DRI externsion version */
+ if ( sPriv->driMajor != 4 || sPriv->driMinor < 0 ) {
+ __driUtilMessage( "sis DRI driver expected DRI version 4.0.x "
+ "but got version %d.%d.%d",
+ sPriv->driMajor, sPriv->driMinor, sPriv->driPatch );
+ return NULL;
}
/* Check that the DDX driver version is compatible */
@@ -211,7 +207,7 @@ GLvisual *XMesaCreateVisual(Display *dpy,
0 /* num samples */ );
}
-GLboolean XMesaCreateContext(Display *dpy, GLvisual *mesaVis,
+GLboolean XMesaCreateContext(GLvisual *mesaVis,
__DRIcontextPrivate *driContextPriv)
{
XMesaContext c;
@@ -228,12 +224,10 @@ GLboolean XMesaCreateContext(Display *dpy, GLvisual *mesaVis,
if (!c->xm_visual)
return GL_FALSE;
c->xm_visual->gl_visual = mesaVis;
- c->xm_visual->display = dpy;
c->gl_ctx = driContextPriv->mesaContext;
c->xm_buffer = NULL;
- c->display = dpy;
c->gl_ctx->Driver.UpdateState = sis_UpdateState;
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c
index 8c75dee7e..243710b97 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c
@@ -55,16 +55,6 @@
#include "tnl/t_pipeline.h"
-#if 0
-/* Example extension function */
-static void
-fxFooBarEXT(GLint i)
-{
- printf("You called glFooBarEXT(%d)\n", i);
-}
-#endif
-
-
/*
* Enable/Disable the extensions for this context.
*/
@@ -89,28 +79,14 @@ static void tdfxDDInitExtensions( GLcontext *ctx )
_mesa_enable_extension( ctx, "GL_EXT_texture_env_combine" );
}
+#if 0
+ _mesa_enable_extension( ctx, "GL_ARB_texture_cube_map");
+ _mesa_enable_extension( ctx, "GL_NV_texture_rectangle");
+#endif
+
if (fxMesa->haveHwStencil) {
_mesa_enable_extension( ctx, "GL_EXT_stencil_wrap" );
}
-
- /* Example of hooking in an extension function.
- * For DRI-based drivers, also see __driRegisterExtensions in the
- * tdfx_xmesa.c file.
- */
-#if 0
- {
- void **dispatchTable = (void **) ctx->Exec;
- const int _gloffset_FooBarEXT = 555; /* just an example number! */
- const int tabSize = _glapi_get_dispatch_table_size();
- assert(_gloffset_FooBarEXT < tabSize);
- dispatchTable[_gloffset_FooBarEXT] = (void *) tdfxFooBarEXT;
- /* XXX You would also need to hook into the display list dispatch
- * table. Really, the implementation of extensions might as well
- * be in the core of Mesa since core Mesa and the device driver
- * is one big shared lib.
- */
- }
-#endif
}
@@ -127,7 +103,7 @@ static const struct gl_pipeline_stage *tdfx_pipeline[] = {
};
-GLboolean tdfxCreateContext( Display *dpy, const __GLcontextModes *mesaVis,
+GLboolean tdfxCreateContext( const __GLcontextModes *mesaVis,
__DRIcontextPrivate *driContextPriv,
void *sharedContextPrivate )
{
@@ -138,7 +114,6 @@ GLboolean tdfxCreateContext( Display *dpy, const __GLcontextModes *mesaVis,
TDFXSAREAPriv *saPriv = (TDFXSAREAPriv *) ((char *) sPriv->pSAREA +
sizeof(XF86DRISAREARec));
-
/* Allocate tdfx context */
fxMesa = (tdfxContextPtr) CALLOC( sizeof(tdfxContextRec) );
if (!fxMesa)
@@ -149,7 +124,8 @@ GLboolean tdfxCreateContext( Display *dpy, const __GLcontextModes *mesaVis,
shareCtx = ((tdfxContextPtr) sharedContextPrivate)->glCtx;
else
shareCtx = NULL;
- fxMesa->glCtx = _mesa_create_context(mesaVis, shareCtx, fxMesa, GL_TRUE);
+
+ fxMesa->glCtx = _mesa_create_context(mesaVis, shareCtx, (void *) fxMesa, GL_TRUE);
if (!fxMesa->glCtx) {
FREE(fxMesa);
return GL_FALSE;
@@ -227,10 +203,8 @@ GLboolean tdfxCreateContext( Display *dpy, const __GLcontextModes *mesaVis,
ctx = fxMesa->glCtx;
if ( TDFX_IS_NAPALM( fxMesa ) ) {
ctx->Const.MaxTextureLevels = 12;
- ctx->Const.NumCompressedTextureFormats = 1;
} else {
ctx->Const.MaxTextureLevels = 9;
- ctx->Const.NumCompressedTextureFormats = 0;
}
ctx->Const.MaxTextureUnits = TDFX_IS_BANSHEE( fxMesa ) ? 1 : 2;
@@ -755,118 +729,118 @@ GLboolean tdfxInitGlide(tdfxContextPtr tmesa)
}
}
-#define GET_FUNCTION(PTR, NAME, CHECK) \
- *((void **)&(tmesa->Glide.PTR)) = dlsym(libHandle, NAME); \
- if (CHECK && !tmesa->Glide.PTR) { \
+#define GET_FUNCTION(PTR, NAME) \
+ tmesa->Glide.PTR = dlsym(libHandle, NAME); \
+ if (!tmesa->Glide.PTR) { \
__driUtilMessage("couldn't find Glide function %s in %s.", \
NAME, libName); \
}
- GET_FUNCTION(grDrawPoint, "grDrawPoint", GL_TRUE);
- GET_FUNCTION(grDrawLine, "grDrawLine", GL_TRUE);
- GET_FUNCTION(grDrawTriangle, "grDrawTriangle", GL_TRUE);
- GET_FUNCTION(grVertexLayout, "grVertexLayout", GL_TRUE);
- GET_FUNCTION(grDrawVertexArray, "grDrawVertexArray", GL_TRUE);
- GET_FUNCTION(grDrawVertexArrayContiguous, "grDrawVertexArrayContiguous", GL_TRUE);
- GET_FUNCTION(grBufferClear, "grBufferClear", GL_TRUE);
+ GET_FUNCTION(grDrawPoint, "grDrawPoint");
+ GET_FUNCTION(grDrawLine, "grDrawLine");
+ GET_FUNCTION(grDrawTriangle, "grDrawTriangle");
+ GET_FUNCTION(grVertexLayout, "grVertexLayout");
+ GET_FUNCTION(grDrawVertexArray, "grDrawVertexArray");
+ GET_FUNCTION(grDrawVertexArrayContiguous, "grDrawVertexArrayContiguous");
+ GET_FUNCTION(grBufferClear, "grBufferClear");
/*GET_FUNCTION(grBufferSwap, "grBufferSwap");*/
- GET_FUNCTION(grRenderBuffer, "grRenderBuffer", GL_TRUE);
- GET_FUNCTION(grErrorSetCallback, "grErrorSetCallback", GL_TRUE);
- GET_FUNCTION(grFinish, "grFinish", GL_TRUE);
- GET_FUNCTION(grFlush, "grFlush", GL_TRUE);
- GET_FUNCTION(grSstWinOpen, "grSstWinOpen", GL_TRUE);
- GET_FUNCTION(grSstWinClose, "grSstWinClose", GL_TRUE);
+ GET_FUNCTION(grRenderBuffer, "grRenderBuffer");
+ GET_FUNCTION(grErrorSetCallback, "grErrorSetCallback");
+ GET_FUNCTION(grFinish, "grFinish");
+ GET_FUNCTION(grFlush, "grFlush");
+ GET_FUNCTION(grSstWinOpen, "grSstWinOpen");
+ GET_FUNCTION(grSstWinClose, "grSstWinClose");
#if 0
/* Not in V3 lib, and not used anyway. */
- GET_FUNCTION(grSetNumPendingBuffers, "grSetNumPendingBuffers", GL_TRUE);
+ GET_FUNCTION(grSetNumPendingBuffers, "grSetNumPendingBuffers");
#endif
- GET_FUNCTION(grSelectContext, "grSelectContext", GL_TRUE);
- GET_FUNCTION(grSstOrigin, "grSstOrigin", GL_TRUE);
- GET_FUNCTION(grSstSelect, "grSstSelect", GL_TRUE);
- GET_FUNCTION(grAlphaBlendFunction, "grAlphaBlendFunction", GL_TRUE);
- GET_FUNCTION(grAlphaCombine, "grAlphaCombine", GL_TRUE);
- GET_FUNCTION(grAlphaControlsITRGBLighting, "grAlphaControlsITRGBLighting", GL_TRUE);
- GET_FUNCTION(grAlphaTestFunction, "grAlphaTestFunction", GL_TRUE);
- GET_FUNCTION(grAlphaTestReferenceValue, "grAlphaTestReferenceValue", GL_TRUE);
- GET_FUNCTION(grChromakeyMode, "grChromakeyMode", GL_TRUE);
- GET_FUNCTION(grChromakeyValue, "grChromakeyValue", GL_TRUE);
- GET_FUNCTION(grClipWindow, "grClipWindow", GL_TRUE);
- GET_FUNCTION(grColorCombine, "grColorCombine", GL_TRUE);
- GET_FUNCTION(grColorMask, "grColorMask", GL_TRUE);
- GET_FUNCTION(grCullMode, "grCullMode", GL_TRUE);
- GET_FUNCTION(grConstantColorValue, "grConstantColorValue", GL_TRUE);
- GET_FUNCTION(grDepthBiasLevel, "grDepthBiasLevel", GL_TRUE);
- GET_FUNCTION(grDepthBufferFunction, "grDepthBufferFunction", GL_TRUE);
- GET_FUNCTION(grDepthBufferMode, "grDepthBufferMode", GL_TRUE);
- GET_FUNCTION(grDepthMask, "grDepthMask", GL_TRUE);
- GET_FUNCTION(grDisableAllEffects, "grDisableAllEffects", GL_TRUE);
- GET_FUNCTION(grDitherMode, "grDitherMode", GL_TRUE);
- GET_FUNCTION(grFogColorValue, "grFogColorValue", GL_TRUE);
- GET_FUNCTION(grFogMode, "grFogMode", GL_TRUE);
- GET_FUNCTION(grFogTable, "grFogTable", GL_TRUE);
- GET_FUNCTION(grLoadGammaTable, "grLoadGammaTable", GL_TRUE);
- GET_FUNCTION(grSplash, "grSplash", GL_TRUE);
- GET_FUNCTION(grGet, "grGet", GL_TRUE);
- GET_FUNCTION(grGetString, "grGetString", GL_TRUE);
- GET_FUNCTION(grQueryResolutions, "grQueryResolutions", GL_TRUE);
- GET_FUNCTION(grReset, "grReset", GL_TRUE);
- GET_FUNCTION(grGetProcAddress, "grGetProcAddress", GL_TRUE);
- GET_FUNCTION(grEnable, "grEnable", GL_TRUE);
- GET_FUNCTION(grDisable, "grDisable", GL_TRUE);
- GET_FUNCTION(grCoordinateSpace, "grCoordinateSpace", GL_TRUE);
- GET_FUNCTION(grDepthRange, "grDepthRange", GL_TRUE);
+ GET_FUNCTION(grSelectContext, "grSelectContext");
+ GET_FUNCTION(grSstOrigin, "grSstOrigin");
+ GET_FUNCTION(grSstSelect, "grSstSelect");
+ GET_FUNCTION(grAlphaBlendFunction, "grAlphaBlendFunction");
+ GET_FUNCTION(grAlphaCombine, "grAlphaCombine");
+ GET_FUNCTION(grAlphaControlsITRGBLighting, "grAlphaControlsITRGBLighting");
+ GET_FUNCTION(grAlphaTestFunction, "grAlphaTestFunction");
+ GET_FUNCTION(grAlphaTestReferenceValue, "grAlphaTestReferenceValue");
+ GET_FUNCTION(grChromakeyMode, "grChromakeyMode");
+ GET_FUNCTION(grChromakeyValue, "grChromakeyValue");
+ GET_FUNCTION(grClipWindow, "grClipWindow");
+ GET_FUNCTION(grColorCombine, "grColorCombine");
+ GET_FUNCTION(grColorMask, "grColorMask");
+ GET_FUNCTION(grCullMode, "grCullMode");
+ GET_FUNCTION(grConstantColorValue, "grConstantColorValue");
+ GET_FUNCTION(grDepthBiasLevel, "grDepthBiasLevel");
+ GET_FUNCTION(grDepthBufferFunction, "grDepthBufferFunction");
+ GET_FUNCTION(grDepthBufferMode, "grDepthBufferMode");
+ GET_FUNCTION(grDepthMask, "grDepthMask");
+ GET_FUNCTION(grDisableAllEffects, "grDisableAllEffects");
+ GET_FUNCTION(grDitherMode, "grDitherMode");
+ GET_FUNCTION(grFogColorValue, "grFogColorValue");
+ GET_FUNCTION(grFogMode, "grFogMode");
+ GET_FUNCTION(grFogTable, "grFogTable");
+ GET_FUNCTION(grLoadGammaTable, "grLoadGammaTable");
+ GET_FUNCTION(grSplash, "grSplash");
+ GET_FUNCTION(grGet, "grGet");
+ GET_FUNCTION(grGetString, "grGetString");
+ GET_FUNCTION(grQueryResolutions, "grQueryResolutions");
+ GET_FUNCTION(grReset, "grReset");
+ GET_FUNCTION(grGetProcAddress, "grGetProcAddress");
+ GET_FUNCTION(grEnable, "grEnable");
+ GET_FUNCTION(grDisable, "grDisable");
+ GET_FUNCTION(grCoordinateSpace, "grCoordinateSpace");
+ GET_FUNCTION(grDepthRange, "grDepthRange");
#ifdef __linux__
- GET_FUNCTION(grStippleMode, "grStippleMode", GL_TRUE);
- GET_FUNCTION(grStipplePattern, "grStipplePattern", GL_TRUE);
+ GET_FUNCTION(grStippleMode, "grStippleMode");
+ GET_FUNCTION(grStipplePattern, "grStipplePattern");
#endif /* __linux__ */
- GET_FUNCTION(grViewport, "grViewport", GL_TRUE);
- GET_FUNCTION(grTexCalcMemRequired, "grTexCalcMemRequired", GL_TRUE);
- GET_FUNCTION(grTexTextureMemRequired, "grTexTextureMemRequired", GL_TRUE);
- GET_FUNCTION(grTexMinAddress, "grTexMinAddress", GL_TRUE);
- GET_FUNCTION(grTexMaxAddress, "grTexMaxAddress", GL_TRUE);
- GET_FUNCTION(grTexNCCTable, "grTexNCCTable", GL_TRUE);
- GET_FUNCTION(grTexSource, "grTexSource", GL_TRUE);
- GET_FUNCTION(grTexClampMode, "grTexClampMode", GL_TRUE);
- GET_FUNCTION(grTexCombine, "grTexCombine", GL_TRUE);
- GET_FUNCTION(grTexDetailControl, "grTexDetailControl", GL_TRUE);
- GET_FUNCTION(grTexFilterMode, "grTexFilterMode", GL_TRUE);
- GET_FUNCTION(grTexLodBiasValue, "grTexLodBiasValue", GL_TRUE);
- GET_FUNCTION(grTexDownloadMipMap, "grTexDownloadMipMap", GL_TRUE);
- GET_FUNCTION(grTexDownloadMipMapLevel, "grTexDownloadMipMapLevel", GL_TRUE);
- GET_FUNCTION(grTexDownloadMipMapLevelPartial, "grTexDownloadMipMapLevelPartial", GL_TRUE);
- GET_FUNCTION(grTexDownloadTable, "grTexDownloadTable", GL_TRUE);
- GET_FUNCTION(grTexDownloadTablePartial, "grTexDownloadTablePartial", GL_TRUE);
- GET_FUNCTION(grTexMipMapMode, "grTexMipMapMode", GL_TRUE);
- GET_FUNCTION(grTexMultibase, "grTexMultibase", GL_TRUE);
- GET_FUNCTION(grTexMultibaseAddress, "grTexMultibaseAddress", GL_TRUE);
- GET_FUNCTION(grLfbLock, "grLfbLock", GL_TRUE);
- GET_FUNCTION(grLfbUnlock, "grLfbUnlock", GL_TRUE);
- GET_FUNCTION(grLfbConstantAlpha, "grLfbConstantAlpha", GL_TRUE);
- GET_FUNCTION(grLfbConstantDepth, "grLfbConstantDepth", GL_TRUE);
- GET_FUNCTION(grLfbWriteColorSwizzle, "grLfbWriteColorSwizzle", GL_TRUE);
- GET_FUNCTION(grLfbWriteColorFormat, "grLfbWriteColorFormat", GL_TRUE);
- GET_FUNCTION(grLfbWriteRegion, "grLfbWriteRegion", GL_TRUE);
- GET_FUNCTION(grLfbReadRegion, "grLfbReadRegion", GL_TRUE);
- GET_FUNCTION(grGlideInit, "grGlideInit", GL_TRUE);
- GET_FUNCTION(grGlideShutdown, "grGlideShutdown", GL_TRUE);
- GET_FUNCTION(grGlideGetState, "grGlideGetState", GL_TRUE);
- GET_FUNCTION(grGlideSetState, "grGlideSetState", GL_TRUE);
- GET_FUNCTION(grGlideGetVertexLayout, "grGlideGetVertexLayout", GL_TRUE);
- GET_FUNCTION(grGlideSetVertexLayout, "grGlideSetVertexLayout", GL_TRUE);
+ GET_FUNCTION(grViewport, "grViewport");
+ GET_FUNCTION(grTexCalcMemRequired, "grTexCalcMemRequired");
+ GET_FUNCTION(grTexTextureMemRequired, "grTexTextureMemRequired");
+ GET_FUNCTION(grTexMinAddress, "grTexMinAddress");
+ GET_FUNCTION(grTexMaxAddress, "grTexMaxAddress");
+ GET_FUNCTION(grTexNCCTable, "grTexNCCTable");
+ GET_FUNCTION(grTexSource, "grTexSource");
+ GET_FUNCTION(grTexClampMode, "grTexClampMode");
+ GET_FUNCTION(grTexCombine, "grTexCombine");
+ GET_FUNCTION(grTexDetailControl, "grTexDetailControl");
+ GET_FUNCTION(grTexFilterMode, "grTexFilterMode");
+ GET_FUNCTION(grTexLodBiasValue, "grTexLodBiasValue");
+ GET_FUNCTION(grTexDownloadMipMap, "grTexDownloadMipMap");
+ GET_FUNCTION(grTexDownloadMipMapLevel, "grTexDownloadMipMapLevel");
+ GET_FUNCTION(grTexDownloadMipMapLevelPartial, "grTexDownloadMipMapLevelPartial");
+ GET_FUNCTION(grTexDownloadTable, "grTexDownloadTable");
+ GET_FUNCTION(grTexDownloadTablePartial, "grTexDownloadTablePartial");
+ GET_FUNCTION(grTexMipMapMode, "grTexMipMapMode");
+ GET_FUNCTION(grTexMultibase, "grTexMultibase");
+ GET_FUNCTION(grTexMultibaseAddress, "grTexMultibaseAddress");
+ GET_FUNCTION(grLfbLock, "grLfbLock");
+ GET_FUNCTION(grLfbUnlock, "grLfbUnlock");
+ GET_FUNCTION(grLfbConstantAlpha, "grLfbConstantAlpha");
+ GET_FUNCTION(grLfbConstantDepth, "grLfbConstantDepth");
+ GET_FUNCTION(grLfbWriteColorSwizzle, "grLfbWriteColorSwizzle");
+ GET_FUNCTION(grLfbWriteColorFormat, "grLfbWriteColorFormat");
+ GET_FUNCTION(grLfbWriteRegion, "grLfbWriteRegion");
+ GET_FUNCTION(grLfbReadRegion, "grLfbReadRegion");
+ GET_FUNCTION(grGlideInit, "grGlideInit");
+ GET_FUNCTION(grGlideShutdown, "grGlideShutdown");
+ GET_FUNCTION(grGlideGetState, "grGlideGetState");
+ GET_FUNCTION(grGlideSetState, "grGlideSetState");
+ GET_FUNCTION(grGlideGetVertexLayout, "grGlideGetVertexLayout");
+ GET_FUNCTION(grGlideSetVertexLayout, "grGlideSetVertexLayout");
/* Glide utility functions */
- GET_FUNCTION(guFogGenerateExp, "guFogGenerateExp", GL_TRUE);
- GET_FUNCTION(guFogGenerateExp2, "guFogGenerateExp2", GL_TRUE);
- GET_FUNCTION(guFogGenerateLinear, "guFogGenerateLinear", GL_TRUE);
+ GET_FUNCTION(guFogGenerateExp, "guFogGenerateExp");
+ GET_FUNCTION(guFogGenerateExp2, "guFogGenerateExp2");
+ GET_FUNCTION(guFogGenerateLinear, "guFogGenerateLinear");
/* DRI functions */
- GET_FUNCTION(grDRIOpen, "grDRIOpen", GL_TRUE);
- GET_FUNCTION(grDRIPosition, "grDRIPosition", GL_TRUE);
+ GET_FUNCTION(grDRIOpen, "grDRIOpen");
+ GET_FUNCTION(grDRIPosition, "grDRIPosition");
/*GET_FUNCTION(grDRILostContext, "grDRILostContext");*/
- GET_FUNCTION(grDRIImportFifo, "grDRIImportFifo", GL_TRUE);
- GET_FUNCTION(grDRIInvalidateAll, "grDRIInvalidateAll", GL_TRUE);
- GET_FUNCTION(grDRIResetSAREA, "grDRIResetSAREA", GL_TRUE);
- GET_FUNCTION(grDRIBufferSwap, "grDRIBufferSwap", GL_TRUE);
+ GET_FUNCTION(grDRIImportFifo, "grDRIImportFifo");
+ GET_FUNCTION(grDRIInvalidateAll, "grDRIInvalidateAll");
+ GET_FUNCTION(grDRIResetSAREA, "grDRIResetSAREA");
+ GET_FUNCTION(grDRIBufferSwap, "grDRIBufferSwap");
/*
* Extension functions:
@@ -874,22 +848,22 @@ GLboolean tdfxInitGlide(tdfxContextPtr tmesa)
* not found.
*/
/* PIXEXT extension */
- GET_FUNCTION(grStencilFunc, "grStencilFunc", GL_FALSE);
- GET_FUNCTION(grStencilMask, "grStencilMask", GL_FALSE);
- GET_FUNCTION(grStencilOp, "grStencilOp", GL_FALSE);
- GET_FUNCTION(grBufferClearExt, "grBufferClearExt", GL_FALSE);
- GET_FUNCTION(grColorMaskExt, "grColorMaskExt", GL_FALSE);
+ tmesa->Glide.grStencilFunc = dlsym(libHandle, "grStencilFunc");
+ tmesa->Glide.grStencilMask = dlsym(libHandle, "grStencilMask");
+ tmesa->Glide.grStencilOp = dlsym(libHandle, "grStencilOp");
+ tmesa->Glide.grBufferClearExt = dlsym(libHandle, "grBufferClearExt");
+ tmesa->Glide.grColorMaskExt = dlsym(libHandle, "grColorMaskExt");
/* COMBINE extension */
- GET_FUNCTION(grColorCombineExt, "grColorCombineExt", GL_FALSE);
- GET_FUNCTION(grTexColorCombineExt, "grTexColorCombineExt", GL_FALSE);
- GET_FUNCTION(grAlphaCombineExt, "grAlphaCombineExt", GL_FALSE);
- GET_FUNCTION(grTexAlphaCombineExt, "grTexAlphaCombineExt", GL_FALSE);
- GET_FUNCTION(grAlphaBlendFunctionExt, "grAlphaBlendFunctionExt", GL_FALSE);
- GET_FUNCTION(grConstantColorValueExt, "grConstantColorValueExt", GL_FALSE);
+ tmesa->Glide.grColorCombineExt = dlsym(libHandle, "grColorCombineExt");
+ tmesa->Glide.grTexColorCombineExt = dlsym(libHandle, "grTexColorCombineExt");
+ tmesa->Glide.grAlphaCombineExt = dlsym(libHandle, "grAlphaCombineExt");
+ tmesa->Glide.grTexAlphaCombineExt = dlsym(libHandle, "grTexAlphaCombineExt");
+ tmesa->Glide.grAlphaBlendFunctionExt = dlsym(libHandle, "grAlphaBlendFunctionExt");
+ tmesa->Glide.grConstantColorValueExt = dlsym(libHandle, "grConstantColorValueExt");
/* Texus 2 */
- GET_FUNCTION(txImgQuantize, "txImgQuantize", GL_FALSE);
- GET_FUNCTION(txImgDequantizeFXT1, "_txImgDequantizeFXT1", GL_FALSE);
- GET_FUNCTION(txErrorSetCallback, "txErrorSetCallback", GL_FALSE);
+ tmesa->Glide.txImgQuantize = dlsym(libHandle, "txImgQuantize");
+ tmesa->Glide.txImgDequantizeFXT1 = dlsym(libHandle, "_txImgDequantizeFXT1");
+ tmesa->Glide.txErrorSetCallback = dlsym(libHandle, "txErrorSetCallback");
#ifdef DEBUG_TRAP
/* wrap the drawing functions so we can trap them */
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h
index 7decaa97e..59e21b0d5 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h
@@ -56,7 +56,7 @@
#include "context.h"
#include "macros.h"
#include "matrix.h"
-#include "mem.h"
+#include "imports.h"
#include "mtypes.h"
#include "tdfx_screen.h"
@@ -507,7 +507,7 @@ struct tdfx_texcombine_ext {
/* Used to track changes between Glide's state and Mesa's */
struct tdfx_texstate {
- GLuint Enabled; /* bitmask of all units */
+ GLuint Enabled[2]; /* values ala ctx->Texture.Unit[i]._ReallyEnabled */
GLenum EnvMode[TDFX_NUM_TMU]; /* index is Glide index, not OpenGL */
GLenum TexFormat[TDFX_NUM_TMU]; /* index is Glide index, not OpenGL */
};
@@ -947,8 +947,7 @@ struct tdfx_context {
extern GLboolean
-tdfxCreateContext( Display *dpy,
- const __GLcontextModes *mesaVis,
+tdfxCreateContext( const __GLcontextModes *mesaVis,
__DRIcontextPrivate *driContextPriv,
void *sharedContextPrivate );
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c
index 976958ca1..1e5914db3 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c
@@ -49,7 +49,7 @@
#endif
-#define TDFX_DATE "20020221"
+#define TDFX_DATE "20021125"
/* These are used in calls to FX_grColorMaskv() */
@@ -256,6 +256,7 @@ void tdfxDDInitDriverFuncs( GLcontext *ctx )
ctx->Driver.GetString = tdfxDDGetString;
ctx->Driver.GetBufferSize = tdfxDDGetBufferSize;
+ ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
ctx->Driver.Error = NULL;
/* Pixel path fallbacks.
@@ -265,7 +266,6 @@ void tdfxDDInitDriverFuncs( GLcontext *ctx )
ctx->Driver.CopyPixels = _swrast_CopyPixels;
ctx->Driver.DrawPixels = _swrast_DrawPixels;
ctx->Driver.ReadPixels = _swrast_ReadPixels;
- ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
/* Accelerated paths
*/
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.c
index 2790caa15..dc4c97619 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.c
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.c
@@ -49,12 +49,12 @@ void tdfxGetLock( tdfxContextPtr fxMesa )
__DRIscreenPrivate *sPriv = dPriv->driScreenPriv;
TDFXSAREAPriv *saPriv = (TDFXSAREAPriv *) (((char *) sPriv->pSAREA) +
fxMesa->fxScreen->sarea_priv_offset);
- int stamp = dPriv->lastStamp;
+ unsigned int stamp = dPriv->lastStamp;
drmGetLock( fxMesa->driFd, fxMesa->hHWContext, 0 );
/* This macro will update dPriv's cliprects if needed */
- DRI_VALIDATE_DRAWABLE_INFO( cPriv->display, sPriv, dPriv );
+ DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
if ( saPriv->fifoOwner != fxMesa->hHWContext ) {
fxMesa->Glide.grDRIImportFifo( saPriv->fifoPtr, saPriv->fifoRead );
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_pixels.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_pixels.c
index 940c49a12..803c8c5c1 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_pixels.c
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_pixels.c
@@ -64,6 +64,7 @@
} while (0);
+#if 0
static FxBool
FX_grLfbLock(tdfxContextPtr fxMesa, GrLock_t type, GrBuffer_t buffer,
GrLfbWriteMode_t writeMode, GrOriginLocation_t origin,
@@ -76,7 +77,7 @@ FX_grLfbLock(tdfxContextPtr fxMesa, GrLock_t type, GrBuffer_t buffer,
UNLOCK_HARDWARE(fxMesa);
return result;
}
-
+#endif
#define FX_grLfbUnlock(fxMesa, t, b) \
@@ -511,7 +512,7 @@ tdfx_readpixels_R5G6B5(GLcontext * ctx, GLint x, GLint y,
GL_FRONT) ? (fxMesa->screen_width) : (info.strideInBytes / 2);
const GLushort *src = (const GLushort *) info.lfbPtr
+ scrY * srcStride + scrX;
- const GLubyte *dst = (GLubyte *) _mesa_image_address(packing,
+ GLubyte *dst = (GLubyte *) _mesa_image_address(packing,
dstImage, width, height, format, type, 0, 0, 0);
const GLint dstStride = _mesa_image_row_stride(packing,
width, format, type);
@@ -572,7 +573,7 @@ tdfx_readpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y,
+ scrY * srcStride + scrX;
const GLint dstStride =
_mesa_image_row_stride(packing, width, format, type);
- const GLubyte *dst = (GLubyte *) _mesa_image_address(packing,
+ GLubyte *dst = (GLubyte *) _mesa_image_address(packing,
dstImage, width, height, format, type, 0, 0, 0);
const GLint widthInBytes = width * 4;
@@ -616,7 +617,7 @@ tdfx_drawpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y,
!ctx->Color.ColorMask[2] ||
!ctx->Color.ColorMask[3] ||
ctx->Color.ColorLogicOpEnabled ||
- ctx->Texture._ReallyEnabled ||
+ ctx->Texture._EnabledUnits ||
ctx->Depth.OcclusionTest ||
fxMesa->Fallback)
{
@@ -662,7 +663,7 @@ tdfx_drawpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y,
{
const GLint dstStride = (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT)
? (fxMesa->screen_width * 4) : (info.strideInBytes);
- const GLubyte *dst = (const GLubyte *) info.lfbPtr
+ GLubyte *dst = (GLubyte *) info.lfbPtr
+ scrY * dstStride + scrX * 4;
const GLint srcStride =
_mesa_image_row_stride(unpack, width, format, type);
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c
index 558766894..1cb3eeddb 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c
@@ -67,7 +67,7 @@ static void tdfxDDClear( GLcontext *ctx,
mask &= ~(DD_ACCUM_BIT);
if (mask & DD_STENCIL_BIT) {
- if (!fxMesa->haveHwStencil || ctx->Stencil.WriteMask != 0xff) {
+ if (!fxMesa->haveHwStencil || ctx->Stencil.WriteMask[0] != 0xff) {
/* Napalm seems to have trouble with stencil write masks != 0xff */
/* do stencil clear in software */
mask &= ~(DD_STENCIL_BIT);
@@ -275,7 +275,7 @@ static void tdfxDDClear( GLcontext *ctx,
fxMesa->Color.ClearAlpha,
fxMesa->Depth.Clear);
FX_grColorMaskv_NoLock(ctx, true4);
- if (ctx->Color.DrawDestMask & FRONT_LEFT_BIT)
+ if (ctx->Color._DrawDestMask & FRONT_LEFT_BIT)
fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER);
if (!ctx->Depth.Test || !ctx->Depth.Mask)
fxMesa->Glide.grDepthMask(FXFALSE);
@@ -295,7 +295,7 @@ static void tdfxDDClear( GLcontext *ctx,
fxMesa->Glide.grDepthMask(FXTRUE);
}
FX_grColorMaskv_NoLock(ctx, true4);
- if (ctx->Color.DrawDestMask & FRONT_LEFT_BIT)
+ if (ctx->Color._DrawDestMask & FRONT_LEFT_BIT)
fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER);
}
}
@@ -532,7 +532,7 @@ static void uploadTextureImages( tdfxContextPtr fxMesa )
GLcontext *ctx = fxMesa->glCtx;
int unit;
for (unit = 0; unit < TDFX_NUM_TMU; unit++) {
- if (ctx->Texture.Unit[unit]._ReallyEnabled == TEXTURE0_2D) {
+ if (ctx->Texture.Unit[unit]._ReallyEnabled == TEXTURE_2D_BIT) {
struct gl_texture_object *tObj = ctx->Texture.Unit[unit].Current2D;
tdfxTexInfo *ti = TDFX_TEXTURE_DATA(tObj);
if (ti && ti->reloadImages && ti->whichTMU != TDFX_TMU_NONE) {
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.c
index 6a9bf0801..05cd31443 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.c
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.c
@@ -34,8 +34,6 @@
*
*/
-#include <X11/Xlibint.h>
-
#include "tdfx_dri.h"
#include "tdfx_context.h"
#include "tdfx_lock.h"
@@ -119,22 +117,16 @@ tdfxDestroyScreen( __DRIscreenPrivate *sPriv )
static GLboolean
tdfxInitDriver( __DRIscreenPrivate *sPriv )
{
- int major, minor, patch;
-
if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) {
fprintf( stderr, "%s( %p )\n", __FUNCTION__, sPriv );
}
- /* Check the DRI version */
- if ( XF86DRIQueryVersion( sPriv->display, &major, &minor, &patch ) ) {
- if ( major != 4 ||
- minor < 0 ) {
- __driUtilMessage(
- "3dfx DRI driver expected DRI version 4.0.x "
- "but got version %d.%d.%d",
- major, minor, patch );
- return GL_FALSE;
- }
+ /* Check the DRI externsion version */
+ if ( sPriv->driMajor != 4 || sPriv->driMinor < 0 ) {
+ __driUtilMessage( "tdfx DRI driver expected DRI version 4.0.x "
+ "but got version %d.%d.%d",
+ sPriv->driMajor, sPriv->driMinor, sPriv->driPatch );
+ return GL_FALSE;
}
/* Check that the DDX driver version is compatible */
@@ -167,8 +159,7 @@ tdfxInitDriver( __DRIscreenPrivate *sPriv )
static GLboolean
-tdfxCreateBuffer( Display *dpy,
- __DRIscreenPrivate *driScrnPriv,
+tdfxCreateBuffer( __DRIscreenPrivate *driScrnPriv,
__DRIdrawablePrivate *driDrawPriv,
const __GLcontextModes *mesaVis,
GLboolean isPixmap )
@@ -196,9 +187,9 @@ tdfxDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
static void
-tdfxSwapBuffers(Display *dpy, void *drawablePrivate)
+tdfxSwapBuffers( __DRIdrawablePrivate *driDrawPriv )
+
{
- __DRIdrawablePrivate *driDrawPriv = (__DRIdrawablePrivate*) drawablePrivate;
GET_CURRENT_CONTEXT(ctx);
tdfxContextPtr fxMesa = 0;
GLframebuffer *mesaBuffer;
@@ -221,7 +212,7 @@ tdfxSwapBuffers(Display *dpy, void *drawablePrivate)
if ( curDrawPriv == driDrawPriv ) {
/* swapping window bound to current context, flush first */
- _mesa_swapbuffers( ctx );
+ _mesa_notifySwapBuffers( ctx );
LOCK_HARDWARE( fxMesa );
}
else {
@@ -300,21 +291,9 @@ tdfxSwapBuffers(Display *dpy, void *drawablePrivate)
-/* This function is called by libGL.so as soon as libGL.so is loaded.
- * This is where we'd register new extension functions with the dispatcher.
- */
void __driRegisterExtensions( void )
{
-#if 0
- /* Example. Also look in tdfx_dd.c for more details. */
- {
- const int _gloffset_FooBarEXT = 555; /* just an example number! */
- if ( _glapi_add_entrypoint( "glFooBarEXT", _gloffset_FooBarEXT ) ) {
- void *f = glXGetProcAddressARB( "glFooBarEXT" );
- assert( f );
- }
- }
-#endif
+ /* See r200 driver for info */
}
static GLboolean
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_span.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_span.c
index 8af85a608..2574a846a 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_span.c
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_span.c
@@ -32,7 +32,7 @@
* Authors:
* Gareth Hughes <gareth@valinux.com>
* Brian Paul <brianp@valinux.com>
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*
*/
@@ -572,30 +572,28 @@ GetFbParams(tdfxContextPtr fxMesa,
*
* Recall that x and y are screen coordinates.
*/
+#define GET_FB_DATA(ReadParamsp, type, x, y) \
+ (((x) < (ReadParamsp)->firstWrappedX) \
+ ? (((type *)((ReadParamsp)->lfbPtr)) \
+ [(y) * ((ReadParamsp)->LFBStrideInElts) \
+ + (x)]) \
+ : (((type *)((ReadParamsp)->lfbWrapPtr)) \
+ [((y)) * ((ReadParamsp)->LFBStrideInElts) \
+ + ((x) - (ReadParamsp)->firstWrappedX)]))
#define GET_ORDINARY_FB_DATA(ReadParamsp, type, x, y) \
- ((*(type **)(&(ReadParamsp)->lfbPtr)) \
+ (((type *)((ReadParamsp)->lfbPtr)) \
[(y) * ((ReadParamsp)->LFBStrideInElts) \
+ (x)])
#define GET_WRAPPED_FB_DATA(ReadParamsp, type, x, y) \
- ((*(type **)(&(ReadParamsp)->lfbWrapPtr)) \
- [(y) * ((ReadParamsp)->LFBStrideInElts) \
+ (((type *)((ReadParamsp)->lfbWrapPtr)) \
+ [((y)) * ((ReadParamsp)->LFBStrideInElts) \
+ ((x) - (ReadParamsp)->firstWrappedX)])
-#define GET_FB_DATA(ReadParamsp, type, x, y) \
- (((x) < (ReadParamsp)->firstWrappedX) ? \
- GET_ORDINARY_FB_DATA(ReadParamsp, type, x, y) : \
- GET_WRAPPED_FB_DATA(ReadParamsp, type, x, y))
-
-#define PUT_ORDINARY_FB_DATA(ReadParamsp, type, x, y, value) \
+#define PUT_FB_DATA(ReadParamsp, type, x, y, value) \
+ (GET_FB_DATA(ReadParamsp, type, x, y) = (type)(value))
+#define PUT_ORDINARY_FB_DATA(ReadParamsp, type, x, y, value) \
(GET_ORDINARY_FB_DATA(ReadParamsp, type, x, y) = (type)(value))
-#define PUT_WRAPPED_FB_DATA(ReadParamsp, type, x, y, value) \
+#define PUT_WRAPPED_FB_DATA(ReadParamsp, type, x, y, value) \
(GET_WRAPPED_FB_DATA(ReadParamsp, type, x, y) = (type)(value))
-#define PUT_FB_DATA(ReadParamsp, type, x, y, value) \
- do { \
- if ((x) < (ReadParamsp)->firstWrappedX) \
- PUT_ORDINARY_FB_DATA(ReadParamsp, type, x, y, value); \
- else \
- PUT_WRAPPED_FB_DATA(ReadParamsp, type, x, y, value); \
- } while(0)
static void
tdfxDDWriteDepthSpan(GLcontext * ctx,
@@ -1309,21 +1307,19 @@ static void tdfxSpanRenderFinish( GLcontext *ctx )
}
/* Set the buffer used for reading */
-static void tdfxDDSetReadBuffer( GLcontext *ctx,
- GLframebuffer *buffer, GLenum mode )
+static void tdfxDDSetBuffer( GLcontext *ctx,
+ GLframebuffer *buffer, GLuint bufferBit )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
(void) buffer;
- switch ( mode ) {
- case GL_FRONT_LEFT:
- fxMesa->ReadBuffer = GR_BUFFER_FRONTBUFFER;
+ switch ( bufferBit ) {
+ case FRONT_LEFT_BIT:
+ fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_FRONTBUFFER;
break;
-
- case GL_BACK_LEFT:
- fxMesa->ReadBuffer = GR_BUFFER_BACKBUFFER;
+ case BACK_LEFT_BIT:
+ fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_BACKBUFFER;
break;
-
default:
break;
}
@@ -1338,7 +1334,7 @@ void tdfxDDInitSpanFuncs( GLcontext *ctx )
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx );
- swdd->SetReadBuffer = tdfxDDSetReadBuffer;
+ swdd->SetBuffer = tdfxDDSetBuffer;
if ( VISUAL_EQUALS_RGBA(ctx->Visual, 5, 6, 5, 0) )
{
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c
index f5fca6a66..ea9f229f7 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c
@@ -32,11 +32,12 @@
* Authors:
* Gareth Hughes <gareth@valinux.com>
* Brian Paul <brianp@valinux.com>
- * Keith Whitwell <keithw@valinux.com> (port to 3.5)
+ * Keith Whitwell <keith@tungstengraphics.com> (port to 3.5)
*
*/
#include "mtypes.h"
+#include "colormac.h"
#include "texformat.h"
#include "texstore.h"
@@ -66,7 +67,7 @@ static void tdfxUpdateAlphaMode( GLcontext *ctx )
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
GrCmpFnc_t func;
GrAlphaBlendFnc_t srcRGB, dstRGB, srcA, dstA;
- GrAlpha_t ref = ctx->Color.AlphaRef;
+ GrAlpha_t ref = (GLint) (ctx->Color.AlphaRef * 255.0);
if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) {
fprintf( stderr, "%s()\n", __FUNCTION__ );
@@ -257,7 +258,7 @@ static void tdfxUpdateAlphaMode( GLcontext *ctx )
}
}
-static void tdfxDDAlphaFunc( GLcontext *ctx, GLenum func, GLchan ref )
+static void tdfxDDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
@@ -468,13 +469,13 @@ static void tdfxUpdateStencil( GLcontext *ctx )
if (fxMesa->haveHwStencil) {
if (ctx->Stencil.Enabled) {
- fxMesa->Stencil.Function = ctx->Stencil.Function - GL_NEVER;
- fxMesa->Stencil.RefValue = ctx->Stencil.Ref;
- fxMesa->Stencil.ValueMask = ctx->Stencil.ValueMask;
- fxMesa->Stencil.WriteMask = ctx->Stencil.WriteMask;
- fxMesa->Stencil.FailFunc = convertGLStencilOp(ctx->Stencil.FailFunc);
- fxMesa->Stencil.ZFailFunc =convertGLStencilOp(ctx->Stencil.ZFailFunc);
- fxMesa->Stencil.ZPassFunc =convertGLStencilOp(ctx->Stencil.ZPassFunc);
+ fxMesa->Stencil.Function = ctx->Stencil.Function[0] - GL_NEVER;
+ fxMesa->Stencil.RefValue = ctx->Stencil.Ref[0];
+ fxMesa->Stencil.ValueMask = ctx->Stencil.ValueMask[0];
+ fxMesa->Stencil.WriteMask = ctx->Stencil.WriteMask[0];
+ fxMesa->Stencil.FailFunc = convertGLStencilOp(ctx->Stencil.FailFunc[0]);
+ fxMesa->Stencil.ZFailFunc = convertGLStencilOp(ctx->Stencil.ZFailFunc[0]);
+ fxMesa->Stencil.ZPassFunc = convertGLStencilOp(ctx->Stencil.ZPassFunc[0]);
fxMesa->Stencil.Clear = ctx->Stencil.Clear & 0xff;
}
fxMesa->dirty |= TDFX_UPLOAD_STENCIL;
@@ -796,12 +797,17 @@ static void tdfxDDColorMask( GLcontext *ctx,
static void tdfxDDClearColor( GLcontext *ctx,
- const GLchan color[4] )
+ const GLfloat color[4] )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
+ GLubyte c[4];
FLUSH_BATCH( fxMesa );
- fxMesa->Color.ClearColor = TDFXPACKCOLOR888( color[0], color[1], color[2] );
- fxMesa->Color.ClearAlpha = color[3];
+ CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
+ CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]);
+ fxMesa->Color.ClearColor = TDFXPACKCOLOR888( c[0], c[1], c[2] );
+ fxMesa->Color.ClearAlpha = c[3];
}
@@ -871,7 +877,7 @@ void tdfxUpdateViewport( GLcontext *ctx )
m[MAT_SZ] = v[MAT_SZ];
m[MAT_TZ] = v[MAT_TZ];
- fxMesa->SetupNewInputs |= VERT_CLIP;
+ fxMesa->SetupNewInputs |= VERT_BIT_CLIP;
}
@@ -996,7 +1002,7 @@ static void tdfxDDEnable( GLcontext *ctx, GLenum cap, GLboolean state )
/* Set the buffer used for drawing */
/* XXX support for separate read/draw buffers hasn't been tested */
-static void tdfxDDSetDrawBuffer( GLcontext *ctx, GLenum mode )
+static void tdfxDDDrawBuffer( GLcontext *ctx, GLenum mode )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
@@ -1006,31 +1012,41 @@ static void tdfxDDSetDrawBuffer( GLcontext *ctx, GLenum mode )
FLUSH_BATCH( fxMesa );
- switch( mode) {
- case GL_FRONT_LEFT:
- fxMesa->DrawBuffer = GR_BUFFER_FRONTBUFFER;
+ /*
+ * _DrawDestMask is easier to cope with than <mode>.
+ */
+ switch ( ctx->Color._DrawDestMask ) {
+ case FRONT_LEFT_BIT:
+ fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_FRONTBUFFER;
fxMesa->new_state |= TDFX_NEW_RENDER;
FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE );
- return;
-
- case GL_BACK_LEFT:
- fxMesa->DrawBuffer = GR_BUFFER_BACKBUFFER;
+ break;
+ case BACK_LEFT_BIT:
+ fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_BACKBUFFER;
fxMesa->new_state |= TDFX_NEW_RENDER;
FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE );
- return;
-
- case GL_NONE:
+ break;
+ case 0:
FX_grColorMaskv( ctx, false4 );
FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE );
- return;
-
+ break;
default:
FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_TRUE );
- return;
+ break;
}
+
+ /* We want to update the s/w rast state too so that tdfxDDSetBuffer()
+ * gets called.
+ */
+ _swrast_DrawBuffer(ctx, mode);
}
+static void tdfxDDReadBuffer( GLcontext *ctx, GLenum mode )
+{
+ /* XXX ??? */
+}
+
/* =============================================================
* Polygon stipple
@@ -1282,7 +1298,7 @@ void tdfxInitState( tdfxContextPtr fxMesa )
fxMesa->TexState.EnvMode[i] = ~0;
fxMesa->TexState.TexFormat[i] = ~0;
- fxMesa->TexState.Enabled = 0;
+ fxMesa->TexState.Enabled[i] = 0;
}
if ( ctx->Visual.doubleBufferMode) {
@@ -1373,7 +1389,8 @@ void tdfxDDInitStateFuncs( GLcontext *ctx )
*/
ctx->Driver.ClearIndex = NULL;
ctx->Driver.ClearColor = tdfxDDClearColor;
- ctx->Driver.SetDrawBuffer = tdfxDDSetDrawBuffer;
+ ctx->Driver.DrawBuffer = tdfxDDDrawBuffer;
+ ctx->Driver.ReadBuffer = tdfxDDReadBuffer;
ctx->Driver.IndexMask = NULL;
ctx->Driver.ColorMask = tdfxDDColorMask;
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_tex.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_tex.c
index d9236533f..e301d9cc7 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_tex.c
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_tex.c
@@ -565,12 +565,12 @@ tdfxDDTexturePalette(GLcontext * ctx, struct gl_texture_object *tObj)
/**** NEW TEXTURE IMAGE FUNCTIONS ****/
/**********************************************************************/
-#define TX_DITHER_NONE 0x00000000
-
#if 000
static FxBool TexusFatalError = FXFALSE;
static FxBool TexusError = FXFALSE;
+#define TX_DITHER_NONE 0x00000000
+
static void
fxTexusError(const char *string, FxBool fatal)
{
@@ -975,7 +975,7 @@ tdfxDDTexImage2D(GLcontext *ctx, GLenum target, GLint level,
0, /* dstImageStride */
format, type, pixels, packing);
assert(!texImage->Data);
- texImage->Data = MALLOC(mml->width * mml->height * texelBytes);
+ texImage->Data = MESA_PBUFFER_ALLOC(mml->width * mml->height * texelBytes);
if (!texImage->Data) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
FREE(tempImage);
@@ -991,7 +991,7 @@ tdfxDDTexImage2D(GLcontext *ctx, GLenum target, GLint level,
else {
/* no rescaling needed */
assert(!texImage->Data);
- texImage->Data = MALLOC(mml->width * mml->height * texelBytes);
+ texImage->Data = MESA_PBUFFER_ALLOC(mml->width * mml->height * texelBytes);
if (!texImage->Data) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
return;
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_texstate.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_texstate.c
index b90992c7a..a20215cb8 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_texstate.c
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_texstate.c
@@ -1487,14 +1487,14 @@ static void print_state(tdfxContextPtr fxMesa)
GLenum base1 = tObj1->Image[tObj1->BaseLevel] ? tObj1->Image[tObj1->BaseLevel]->Format : 99;
printf("Unit 0: Enabled: GL=%d Gr=%d\n", ctx->Texture.Unit[0]._ReallyEnabled,
- fxMesa->TexState.Enabled);
+ fxMesa->TexState.Enabled[0]);
printf(" EnvMode: GL=0x%x Gr=0x%x\n", ctx->Texture.Unit[0].EnvMode,
fxMesa->TexState.EnvMode[0]);
printf(" BaseFmt: GL=0x%x Gr=0x%x\n", base0, fxMesa->TexState.TexFormat[0]);
printf("Unit 1: Enabled: GL=%d Gr=%d\n", ctx->Texture.Unit[1]._ReallyEnabled,
- fxMesa->TexState.Enabled);
+ fxMesa->TexState.Enabled[1]);
printf(" EnvMode: GL=0x%x Gr:0x%x\n", ctx->Texture.Unit[1].EnvMode,
fxMesa->TexState.EnvMode[1]);
printf(" BaseFmt: GL=0x%x Gr:0x%x\n", base1, fxMesa->TexState.TexFormat[1]);
@@ -1543,7 +1543,7 @@ static void setupTextureSingleTMU(GLcontext * ctx, GLuint unit)
if (TDFX_IS_NAPALM(fxMesa)) {
/* see if we really need to update the unit */
- if (fxMesa->TexState.Enabled != ctx->Texture._ReallyEnabled ||
+ if (fxMesa->TexState.Enabled[unit] != ctx->Texture.Unit[unit]._ReallyEnabled ||
envMode != fxMesa->TexState.EnvMode[0] ||
envMode == GL_COMBINE_EXT ||
baseFormat != fxMesa->TexState.TexFormat[0]) {
@@ -1577,7 +1577,7 @@ static void setupTextureSingleTMU(GLcontext * ctx, GLuint unit)
otherEnv->Alpha.Shift = 0;
otherEnv->Alpha.Invert = FXFALSE;
- fxMesa->TexState.Enabled = ctx->Texture._ReallyEnabled;
+ fxMesa->TexState.Enabled[unit] = ctx->Texture.Unit[unit]._ReallyEnabled;
fxMesa->TexState.EnvMode[0] = envMode;
fxMesa->TexState.TexFormat[0] = baseFormat;
fxMesa->TexState.EnvMode[1] = 0;
@@ -1588,7 +1588,7 @@ static void setupTextureSingleTMU(GLcontext * ctx, GLuint unit)
/* Voodoo3 */
/* see if we really need to update the unit */
- if (fxMesa->TexState.Enabled != ctx->Texture._ReallyEnabled ||
+ if (fxMesa->TexState.Enabled[unit] != ctx->Texture.Unit[unit]._ReallyEnabled ||
envMode != fxMesa->TexState.EnvMode[0] ||
envMode == GL_COMBINE_EXT ||
baseFormat != fxMesa->TexState.TexFormat[0]) {
@@ -1596,7 +1596,7 @@ static void setupTextureSingleTMU(GLcontext * ctx, GLuint unit)
/* software fallback */
FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_ENV, GL_TRUE);
}
- fxMesa->TexState.Enabled = ctx->Texture._ReallyEnabled;
+ fxMesa->TexState.Enabled[unit] = ctx->Texture.Unit[unit]._ReallyEnabled;
fxMesa->TexState.EnvMode[0] = envMode;
fxMesa->TexState.TexFormat[0] = baseFormat;
fxMesa->TexState.EnvMode[1] = 0;
@@ -1850,7 +1850,7 @@ static void setupTextureDoubleTMU(GLcontext * ctx)
GLboolean hw1 = GL_TRUE, hw2 = GL_TRUE;
/* check if we really need to update glide unit 1 */
- if (fxMesa->TexState.Enabled != ctx->Texture._ReallyEnabled ||
+ if (fxMesa->TexState.Enabled[0] != ctx->Texture.Unit[0]._ReallyEnabled ||
envMode0 != fxMesa->TexState.EnvMode[1] ||
envMode0 == GL_COMBINE_EXT ||
baseImage0->Format != fxMesa->TexState.TexFormat[1] ||
@@ -1859,10 +1859,11 @@ static void setupTextureDoubleTMU(GLcontext * ctx)
baseImage0->Format, &fxMesa->TexCombineExt[1]);
fxMesa->TexState.EnvMode[1] = envMode0;
fxMesa->TexState.TexFormat[1] = baseImage0->Format;
+ fxMesa->TexState.Enabled[0] = ctx->Texture.Unit[0]._ReallyEnabled;
}
/* check if we really need to update glide unit 0 */
- if (fxMesa->TexState.Enabled != ctx->Texture._ReallyEnabled ||
+ if (fxMesa->TexState.Enabled[1] != ctx->Texture.Unit[1]._ReallyEnabled ||
envMode1 != fxMesa->TexState.EnvMode[0] ||
envMode1 == GL_COMBINE_EXT ||
baseImage1->Format != fxMesa->TexState.TexFormat[0] ||
@@ -1871,9 +1872,9 @@ static void setupTextureDoubleTMU(GLcontext * ctx)
baseImage1->Format, &fxMesa->TexCombineExt[0]);
fxMesa->TexState.EnvMode[0] = envMode1;
fxMesa->TexState.TexFormat[0] = baseImage1->Format;
+ fxMesa->TexState.Enabled[1] = ctx->Texture.Unit[1]._ReallyEnabled;
}
- fxMesa->TexState.Enabled = ctx->Texture._ReallyEnabled;
if (!hw1 || !hw2) {
FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_ENV, GL_TRUE);
@@ -1887,7 +1888,8 @@ static void setupTextureDoubleTMU(GLcontext * ctx)
unit0 = 0;
unit1 = 1 - unit0;
- if (fxMesa->TexState.Enabled != ctx->Texture._ReallyEnabled ||
+ if (fxMesa->TexState.Enabled[0] != ctx->Texture.Unit[0]._ReallyEnabled ||
+ fxMesa->TexState.Enabled[1] != ctx->Texture.Unit[1]._ReallyEnabled ||
envMode0 != fxMesa->TexState.EnvMode[unit0] ||
envMode0 == GL_COMBINE_EXT ||
envMode1 != fxMesa->TexState.EnvMode[unit1] ||
@@ -1906,7 +1908,8 @@ static void setupTextureDoubleTMU(GLcontext * ctx)
fxMesa->TexState.TexFormat[unit0] = baseImage0->Format;
fxMesa->TexState.EnvMode[unit1] = envMode1;
fxMesa->TexState.TexFormat[unit1] = baseImage1->Format;
- fxMesa->TexState.Enabled = ctx->Texture._ReallyEnabled;
+ fxMesa->TexState.Enabled[0] = ctx->Texture.Unit[0]._ReallyEnabled;
+ fxMesa->TexState.Enabled[1] = ctx->Texture.Unit[1]._ReallyEnabled;
}
}
}
@@ -1916,31 +1919,29 @@ void
tdfxUpdateTextureState( GLcontext *ctx )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GLuint tex2Denabled = ctx->Texture._ReallyEnabled;
-
- if (!fxMesa->haveTwoTMUs)
- tex2Denabled &= TEXTURE0_2D;
FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_BORDER, GL_FALSE);
FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_ENV, GL_FALSE);
- switch (tex2Denabled) {
- case TEXTURE0_2D:
+ if (ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT &&
+ ctx->Texture.Unit[1]._ReallyEnabled == 0) {
LOCK_HARDWARE( fxMesa ); /* XXX remove locking eventually */
setupTextureSingleTMU(ctx, 0);
UNLOCK_HARDWARE( fxMesa );
- break;
- case TEXTURE1_2D:
+ }
+ else if (ctx->Texture.Unit[0]._ReallyEnabled == 0 &&
+ ctx->Texture.Unit[1]._ReallyEnabled == TEXTURE_2D_BIT) {
LOCK_HARDWARE( fxMesa );
setupTextureSingleTMU(ctx, 1);
UNLOCK_HARDWARE( fxMesa );
- break;
- case (TEXTURE0_2D | TEXTURE1_2D):
+ }
+ else if (ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT &&
+ ctx->Texture.Unit[1]._ReallyEnabled == TEXTURE_2D_BIT) {
LOCK_HARDWARE( fxMesa );
setupTextureDoubleTMU(ctx);
UNLOCK_HARDWARE( fxMesa );
- break;
- default:
+ }
+ else {
/* disable hardware texturing */
if (TDFX_IS_NAPALM(fxMesa)) {
fxMesa->ColorCombineExt.SourceA = GR_CMBX_ITRGB;
@@ -1978,12 +1979,19 @@ tdfxUpdateTextureState( GLcontext *ctx )
fxMesa->AlphaCombine.Invert = FXFALSE;
}
- fxMesa->TexState.Enabled = 0;
+ fxMesa->TexState.Enabled[0] = 0;
+ fxMesa->TexState.Enabled[1] = 0;
fxMesa->TexState.EnvMode[0] = 0;
fxMesa->TexState.EnvMode[1] = 0;
fxMesa->dirty |= TDFX_UPLOAD_COLOR_COMBINE;
fxMesa->dirty |= TDFX_UPLOAD_ALPHA_COMBINE;
+
+ if (ctx->Texture.Unit[0]._ReallyEnabled != 0 ||
+ ctx->Texture.Unit[1]._ReallyEnabled != 0) {
+ /* software texture (cube map, rect tex, etc */
+ FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_ENV, GL_TRUE);
+ }
}
}
@@ -2027,7 +2035,9 @@ tdfxUpdateTextureBinding( GLcontext *ctx )
fxMesa->tScale1 = ti1->tScale;
}
- if (ctx->Texture._ReallyEnabled == TEXTURE0_2D) {
+ if (ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT &&
+ ctx->Texture.Unit[0]._ReallyEnabled == 0) {
+ /* Only unit 0 2D enabled */
if (shared->umaTexMemory) {
fxMesa->TexSource[0].StartAddress = ti0->tm[0]->startAddr;
fxMesa->TexSource[0].EvenOdd = GR_MIPMAPLEVELMASK_BOTH;
@@ -2058,14 +2068,18 @@ tdfxUpdateTextureBinding( GLcontext *ctx )
}
}
}
- else if (ctx->Texture._ReallyEnabled == TEXTURE1_2D) {
+ else if (ctx->Texture.Unit[0]._ReallyEnabled == 0 &&
+ ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT) {
+ /* Only unit 1 2D enabled */
if (shared->umaTexMemory) {
fxMesa->TexSource[0].StartAddress = ti1->tm[0]->startAddr;
fxMesa->TexSource[0].EvenOdd = GR_MIPMAPLEVELMASK_BOTH;
fxMesa->TexSource[0].Info = &(ti1->info);
}
}
- else if (ctx->Texture._ReallyEnabled == (TEXTURE0_2D | TEXTURE1_2D)) {
+ else if (ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT &&
+ ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT) {
+ /* Both 2D enabled */
if (shared->umaTexMemory) {
const FxU32 tmu0 = 0, tmu1 = 1;
fxMesa->TexSource[tmu0].StartAddress = ti0->tm[0]->startAddr;
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_tris.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_tris.c
index 4c28b2d2d..c67683ecb 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_tris.c
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_tris.c
@@ -26,12 +26,9 @@
/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_tris.c,v 1.3 2002/02/22 21:45:04 dawes Exp $ */
/* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
-#include <stdio.h>
-#include <math.h>
-
#include "glheader.h"
#include "mtypes.h"
#include "macros.h"
@@ -901,7 +898,7 @@ static void tdfxFastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
int i;
for (i = 2 ; i < n ; i++) {
- fxMesa->Glide.grDrawTriangle( start, VERT(elts[i-1]), VERT(elts[i]) );
+ fxMesa->Glide.grDrawTriangle( VERT(elts[i-1]), VERT(elts[i]), start );
}
}
@@ -1167,24 +1164,6 @@ static void tdfxRenderFinish( GLcontext *ctx )
}
-
-/*
- * These functions are used when we're software rendering, and
- * lock/unlock the hardware (for span reading/writing).
- */
-static void tdfxSwSetupStart( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- LOCK_HARDWARE(fxMesa);
-}
-
-static void tdfxSwSetupFinish( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- UNLOCK_HARDWARE(fxMesa);
-}
-
-
/**********************************************************************/
/* Manage total rasterization fallbacks */
/**********************************************************************/
@@ -1257,7 +1236,6 @@ void tdfxFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
void tdfxDDInitTriFuncs( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
- SScontext *swsetup = SWSETUP_CONTEXT(ctx);
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
static int firsttime = 1;
@@ -1276,9 +1254,5 @@ void tdfxDDInitTriFuncs( GLcontext *ctx )
tnl->Driver.Render.BuildVertices = tdfxBuildVertices;
tnl->Driver.Render.Multipass = NULL;
-
- swsetup->Driver.Start = tdfxSwSetupStart;
- swsetup->Driver.Finish = tdfxSwSetupFinish;
-
(void) tdfx_print_vertex;
}
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_vb.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_vb.c
index 492d41d06..31a47b1b2 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_vb.c
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_vb.c
@@ -26,7 +26,7 @@
#include "glheader.h"
#include "mtypes.h"
-#include "mem.h"
+#include "imports.h"
#include "macros.h"
#include "colormac.h"
#include "mmath.h"
@@ -271,18 +271,18 @@ void tdfxBuildVertices( GLcontext *ctx, GLuint start, GLuint count,
if (!newinputs)
return;
- if (newinputs & VERT_CLIP) {
+ if (newinputs & VERT_BIT_CLIP) {
setup_tab[fxMesa->SetupIndex].emit( ctx, start, count, v, stride );
} else {
GLuint ind = 0;
- if (newinputs & VERT_RGBA)
+ if (newinputs & VERT_BIT_COLOR0)
ind |= TDFX_RGBA_BIT;
- if (newinputs & VERT_TEX0)
+ if (newinputs & VERT_BIT_TEX0)
ind |= TDFX_TEX0_BIT;
- if (newinputs & VERT_TEX1)
+ if (newinputs & VERT_BIT_TEX1)
ind |= TDFX_TEX0_BIT|TDFX_TEX1_BIT;
if (fxMesa->SetupIndex & TDFX_PTEX_BIT)
@@ -303,9 +303,11 @@ void tdfxChooseVertexState( GLcontext *ctx )
tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
GLuint ind = TDFX_XYZ_BIT|TDFX_RGBA_BIT;
- if (ctx->Texture._ReallyEnabled & 0xf0)
+ if (ctx->Texture._EnabledUnits & 0x2)
+ /* unit 1 enabled */
ind |= TDFX_W_BIT|TDFX_TEX1_BIT|TDFX_TEX0_BIT;
- else if (ctx->Texture._ReallyEnabled & 0xf)
+ else if (ctx->Texture._EnabledUnits & 0x1)
+ /* unit 0 enabled */
ind |= TDFX_W_BIT|TDFX_TEX0_BIT;
else if (ctx->Fog.Enabled)
ind |= TDFX_W_BIT;
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_vbtmp.h b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_vbtmp.h
index 558f38666..9925a10ea 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_vbtmp.h
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_vbtmp.h
@@ -12,8 +12,8 @@ static void TAG(emit)( GLcontext *ctx,
GLubyte (*col)[4];
GLuint tc0_stride, tc1_stride, col_stride;
GLuint tc0_size, tc1_size;
- GLfloat (*proj)[4] = VB->ProjectedClipPtr->data;
- GLuint proj_stride = VB->ProjectedClipPtr->stride;
+ GLfloat (*proj)[4] = VB->NdcPtr->data;
+ GLuint proj_stride = VB->NdcPtr->stride;
tdfxVertex *v = (tdfxVertex *)dest;
GLfloat u0scale,v0scale,u1scale,v1scale;
const GLubyte *mask = VB->ClipMask;
@@ -185,8 +185,8 @@ static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end,
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
GLubyte (*col)[4];
GLuint col_stride;
- GLfloat (*proj)[4] = VB->ProjectedClipPtr->data;
- GLuint proj_stride = VB->ProjectedClipPtr->stride;
+ GLfloat (*proj)[4] = VB->NdcPtr->data;
+ GLuint proj_stride = VB->NdcPtr->stride;
GLfloat *v = (GLfloat *)dest;
const GLubyte *mask = VB->ClipMask;
const GLfloat *s = fxMesa->hw_viewport;
diff --git a/xc/lib/GL/mesa/src/math/Imakefile.inc b/xc/lib/GL/mesa/src/math/Imakefile.inc
index 75104fbe0..dbc173917 100644
--- a/xc/lib/GL/mesa/src/math/Imakefile.inc
+++ b/xc/lib/GL/mesa/src/math/Imakefile.inc
@@ -9,48 +9,40 @@ MESAMATHBUILDDIR = MesaMathBuildDir
MESA_MATH_SRCS = $(MESAMATHBUILDDIR)m_debug_clip.c \
$(MESAMATHBUILDDIR)m_debug_norm.c \
$(MESAMATHBUILDDIR)m_debug_xform.c \
- $(MESAMATHBUILDDIR)m_debug_vertex.c \
$(MESAMATHBUILDDIR)m_eval.c \
$(MESAMATHBUILDDIR)m_matrix.c \
$(MESAMATHBUILDDIR)m_translate.c \
$(MESAMATHBUILDDIR)m_vector.c \
- $(MESAMATHBUILDDIR)m_vertices.c \
$(MESAMATHBUILDDIR)m_xform.c
#ifdef NeedToLinkMesaSrc
LinkSourceFile(m_debug_clip.c, $(MESASRCDIR)/src/math)
LinkSourceFile(m_debug_norm.c, $(MESASRCDIR)/src/math)
-LinkSourceFile(m_debug_vertex.c, $(MESASRCDIR)/src/math)
LinkSourceFile(m_debug_xform.c, $(MESASRCDIR)/src/math)
LinkSourceFile(m_eval.c, $(MESASRCDIR)/src/math)
LinkSourceFile(m_matrix.c, $(MESASRCDIR)/src/math)
LinkSourceFile(m_translate.c, $(MESASRCDIR)/src/math)
LinkSourceFile(m_vector.c, $(MESASRCDIR)/src/math)
-LinkSourceFile(m_vertices.c, $(MESASRCDIR)/src/math)
LinkSourceFile(m_xform.c, $(MESASRCDIR)/src/math)
#endif
MESA_MATH_OBJS = $(MESAMATHBUILDDIR)m_debug_clip.o \
$(MESAMATHBUILDDIR)m_debug_norm.o \
$(MESAMATHBUILDDIR)m_debug_xform.o \
- $(MESAMATHBUILDDIR)m_debug_vertex.o \
$(MESAMATHBUILDDIR)m_eval.o \
$(MESAMATHBUILDDIR)m_matrix.o \
$(MESAMATHBUILDDIR)m_translate.o \
$(MESAMATHBUILDDIR)m_vector.o \
- $(MESAMATHBUILDDIR)m_vertices.o \
$(MESAMATHBUILDDIR)m_xform.o
#if DoSharedLib
MESA_MATH_UOBJS = $(MESAMATHBUILDDIR)unshared/m_debug_clip.o \
$(MESAMATHBUILDDIR)unshared/m_debug_norm.o \
$(MESAMATHBUILDDIR)unshared/m_debug_xform.o \
- $(MESAMATHBUILDDIR)unshared/m_debug_vertex.o \
$(MESAMATHBUILDDIR)unshared/m_eval.o \
$(MESAMATHBUILDDIR)unshared/m_matrix.o \
$(MESAMATHBUILDDIR)unshared/m_translate.o \
$(MESAMATHBUILDDIR)unshared/m_vector.o \
- $(MESAMATHBUILDDIR)unshared/m_vertices.o \
$(MESAMATHBUILDDIR)unshared/m_xform.o
#else
MATH_MESA_UOBJS = $(MESA_MATH_OBJS)
@@ -59,22 +51,18 @@ LinkSourceFile(m_xform.c, $(MESASRCDIR)/src/math)
MESA_MATH_DOBJS = $(MESAMATHBUILDDIR)debugger/m_debug_clip.o \
$(MESAMATHBUILDDIR)debugger/m_debug_norm.o \
$(MESAMATHBUILDDIR)debugger/m_debug_xform.o \
- $(MESAMATHBUILDDIR)debugger/m_debug_vertex.o \
$(MESAMATHBUILDDIR)debugger/m_eval.o \
$(MESAMATHBUILDDIR)debugger/m_matrix.o \
$(MESAMATHBUILDDIR)debugger/m_translate.o \
$(MESAMATHBUILDDIR)debugger/m_vector.o \
- $(MESAMATHBUILDDIR)debugger/m_vertices.o \
$(MESAMATHBUILDDIR)debugger/m_xform.o
MESA_MATH_POBJS = $(MESAMATHBUILDDIR)profiled/m_debug_clip.o \
$(MESAMATHBUILDDIR)profiled/m_debug_norm.o \
$(MESAMATHBUILDDIR)profiled/m_debug_xform.o \
- $(MESAMATHBUILDDIR)profiled/m_debug_vertex.o \
$(MESAMATHBUILDDIR)profiled/m_eval.o \
$(MESAMATHBUILDDIR)profiled/m_matrix.o \
$(MESAMATHBUILDDIR)profiled/m_translate.o \
$(MESAMATHBUILDDIR)profiled/m_vector.o \
- $(MESAMATHBUILDDIR)profiled/m_vertices.o \
$(MESAMATHBUILDDIR)profiled/m_xform.o
diff --git a/xc/lib/GL/mesa/src/swrast/Imakefile.inc b/xc/lib/GL/mesa/src/swrast/Imakefile.inc
index 6ea372416..64f554272 100644
--- a/xc/lib/GL/mesa/src/swrast/Imakefile.inc
+++ b/xc/lib/GL/mesa/src/swrast/Imakefile.inc
@@ -25,11 +25,9 @@ MESASWRASTBUILDDIR = MesaSwrastBuildDir
$(MESASWRASTBUILDDIR)s_lines.c \
$(MESASWRASTBUILDDIR)s_logic.c \
$(MESASWRASTBUILDDIR)s_masking.c \
- $(MESASWRASTBUILDDIR)s_pb.c \
$(MESASWRASTBUILDDIR)s_pixeltex.c \
$(MESASWRASTBUILDDIR)s_points.c \
$(MESASWRASTBUILDDIR)s_readpix.c \
- $(MESASWRASTBUILDDIR)s_scissor.c \
$(MESASWRASTBUILDDIR)s_span.c \
$(MESASWRASTBUILDDIR)s_stencil.c \
$(MESASWRASTBUILDDIR)s_texstore.c \
@@ -57,11 +55,9 @@ LinkSourceFile(s_imaging.c, $(MESASRCDIR)/src/swrast)
LinkSourceFile(s_lines.c, $(MESASRCDIR)/src/swrast)
LinkSourceFile(s_logic.c, $(MESASRCDIR)/src/swrast)
LinkSourceFile(s_masking.c, $(MESASRCDIR)/src/swrast)
-LinkSourceFile(s_pb.c, $(MESASRCDIR)/src/swrast)
LinkSourceFile(s_pixeltex.c, $(MESASRCDIR)/src/swrast)
LinkSourceFile(s_points.c, $(MESASRCDIR)/src/swrast)
LinkSourceFile(s_readpix.c, $(MESASRCDIR)/src/swrast)
-LinkSourceFile(s_scissor.c, $(MESASRCDIR)/src/swrast)
LinkSourceFile(s_span.c, $(MESASRCDIR)/src/swrast)
LinkSourceFile(s_stencil.c, $(MESASRCDIR)/src/swrast)
LinkSourceFile(s_texstore.c, $(MESASRCDIR)/src/swrast)
@@ -89,11 +85,9 @@ LinkSourceFile(s_zoom.c, $(MESASRCDIR)/src/swrast)
$(MESASWRASTBUILDDIR)s_lines.o \
$(MESASWRASTBUILDDIR)s_logic.o \
$(MESASWRASTBUILDDIR)s_masking.o \
- $(MESASWRASTBUILDDIR)s_pb.o \
$(MESASWRASTBUILDDIR)s_pixeltex.o \
$(MESASWRASTBUILDDIR)s_points.o \
$(MESASWRASTBUILDDIR)s_readpix.o \
- $(MESASWRASTBUILDDIR)s_scissor.o \
$(MESASWRASTBUILDDIR)s_span.o \
$(MESASWRASTBUILDDIR)s_stencil.o \
$(MESASWRASTBUILDDIR)s_texstore.o \
@@ -121,11 +115,9 @@ LinkSourceFile(s_zoom.c, $(MESASRCDIR)/src/swrast)
$(MESASWRASTBUILDDIR)unshared/s_lines.o \
$(MESASWRASTBUILDDIR)unshared/s_logic.o \
$(MESASWRASTBUILDDIR)unshared/s_masking.o \
- $(MESASWRASTBUILDDIR)unshared/s_pb.o \
$(MESASWRASTBUILDDIR)unshared/s_pixeltex.o \
$(MESASWRASTBUILDDIR)unshared/s_points.o \
$(MESASWRASTBUILDDIR)unshared/s_readpix.o \
- $(MESASWRASTBUILDDIR)unshared/s_scissor.o \
$(MESASWRASTBUILDDIR)unshared/s_span.o \
$(MESASWRASTBUILDDIR)unshared/s_stencil.o \
$(MESASWRASTBUILDDIR)unshared/s_texstore.o \
@@ -155,11 +147,9 @@ LinkSourceFile(s_zoom.c, $(MESASRCDIR)/src/swrast)
$(MESASWRASTBUILDDIR)debugger/s_lines.o \
$(MESASWRASTBUILDDIR)debugger/s_logic.o \
$(MESASWRASTBUILDDIR)debugger/s_masking.o \
- $(MESASWRASTBUILDDIR)debugger/s_pb.o \
$(MESASWRASTBUILDDIR)debugger/s_pixeltex.o \
$(MESASWRASTBUILDDIR)debugger/s_points.o \
$(MESASWRASTBUILDDIR)debugger/s_readpix.o \
- $(MESASWRASTBUILDDIR)debugger/s_scissor.o \
$(MESASWRASTBUILDDIR)debugger/s_span.o \
$(MESASWRASTBUILDDIR)debugger/s_stencil.o \
$(MESASWRASTBUILDDIR)debugger/s_texstore.o \
@@ -186,11 +176,9 @@ LinkSourceFile(s_zoom.c, $(MESASRCDIR)/src/swrast)
$(MESASWRASTBUILDDIR)profiled/s_lines.o \
$(MESASWRASTBUILDDIR)profiled/s_logic.o \
$(MESASWRASTBUILDDIR)profiled/s_masking.o \
- $(MESASWRASTBUILDDIR)profiled/s_pb.o \
$(MESASWRASTBUILDDIR)profiled/s_pixeltex.o \
$(MESASWRASTBUILDDIR)profiled/s_points.o \
$(MESASWRASTBUILDDIR)profiled/s_readpix.o \
- $(MESASWRASTBUILDDIR)profiled/s_scissor.o \
$(MESASWRASTBUILDDIR)profiled/s_span.o \
$(MESASWRASTBUILDDIR)profiled/s_stencil.o \
$(MESASWRASTBUILDDIR)profiled/s_texstore.o \
diff --git a/xc/lib/GLU/GLU-def.cpp b/xc/lib/GLU/GLU-def.cpp
deleted file mode 100644
index 369160b18..000000000
--- a/xc/lib/GLU/GLU-def.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-LIBRARY GLU
-VERSION LIBRARY_VERSION
-EXPORTS
-
-bezierPatchDelete
-bezierPatchDeleteList
-bezierPatchDraw
-bezierPatchEval
-bezierPatchEvalNormal
-bezierPatchInsert
-bezierPatchListDraw
-bezierPatchMake
-bezierPatchMake2
-bezierPatchPrint
-bezierPatchPrintList
-bezierPatchMeshBeginStrip
-bezierPatchMeshDelDeg
-bezierPatchMeshDelete
-bezierPatchMeshDraw
-bezierPatchMeshEndStrip
-bezierPatchMeshEval
-bezierPatchMeshInsertUV
-bezierPatchMeshListCollect
-bezierPatchMeshListDelDeg
-bezierPatchMeshListDelete
-bezierPatchMeshListDraw
-bezierPatchMeshListEval
-bezierPatchMeshListInsert
-bezierPatchMeshListNumTriangles
-bezierPatchMeshListPrint
-bezierPatchMeshListReverse
-bezierPatchMeshListTotalStrips
-bezierPatchMeshListTotalVert
-bezierPatchMeshMake
-bezierPatchMeshMake2
-bezierPatchMeshNumTriangles
-bezierPatchMeshPrint
-bezierPatchMeshPutPatch
-drawStrips
-gluBeginCurve
-gluBeginSurface
-gluBeginTrim
-gluDeleteNurbsRenderer
-gluDeleteNurbsTessellatorEXT
-gluEndCurve
-gluEndSurface
-gluEndTrim
-gluGetNurbsProperty
-gluLoadSamplingMatrices
-gluNewNurbsRenderer
-gluNurbsCallback
-gluNurbsCallbackData
-gluNurbsCallbackDataEXT
-gluNurbsCurve
-gluNurbsProperty
-gluNurbsSurface
-gluPwlCurve
-glu_LOD_eval_list
-__gl_dictListDelete
-__gl_dictListDeleteDict
-__gl_dictListInsertBefore
-__gl_dictListNewDict
-__gl_dictListSearch
-__gl_edgeEval
-__gl_edgeIntersect
-__gl_edgeSign
-__gl_transEval
-__gl_transSign
-__gl_vertCCW
-__gl_vertLeq
-__gl_memInit
-__gl_meshAddEdgeVertex
-; __gl_meshCheckMesh
-__gl_meshConnect
-__gl_meshDelete
-__gl_meshDeleteMesh
-__gl_meshMakeEdge
-__gl_meshNewMesh
-__gl_meshSplice
-__gl_meshSplitEdge
-__gl_meshUnion
-__gl_meshZapFace
-__gl_projectPolygon
-__gl_pqHeapDelete
-__gl_pqHeapDeletePriorityQ
-__gl_pqHeapExtractMin
-__gl_pqHeapInit
-__gl_pqHeapInsert
-__gl_pqHeapNewPriorityQ
-__gl_pqSortDelete
-__gl_pqSortDeletePriorityQ
-__gl_pqSortExtractMin
-__gl_pqSortInit
-__gl_pqSortInsert
-__gl_pqSortIsEmpty
-__gl_pqSortMinimum
-__gl_pqSortNewPriorityQ
-__gl_renderBoundary
-__gl_renderCache
-__gl_renderMesh
-__gl_computeInterior
-__gl_noBeginData
-__gl_noCombineData
-__gl_noEdgeFlagData
-__gl_noEndData
-__gl_noErrorData
-__gl_noVertexData
-gluBeginPolygon
-; gluDeleteMesh
-gluDeleteTess
-gluEndPolygon
-gluGetTessProperty
-gluNewTess
-gluNextContour
-gluTessBeginContour
-gluTessBeginPolygon
-gluTessCallback
-gluTessEndContour
-gluTessEndPolygon
-gluTessNormal
-gluTessProperty
-gluTessVertex
-__gl_meshDiscardExterior
-__gl_meshSetWindingNumber
-__gl_meshTessellateInterior
-__gl_meshTessellateMonoRegion
-gluErrorString
-; __glNURBSErrorString
-; __glTessErrorString
-; bitmapBuild2DMipmaps
-; fastBuild2DMipmaps
-gluBuild1DMipmapLevels
-gluBuild1DMipmaps
-gluBuild2DMipmapLevels
-gluBuild2DMipmaps
-gluBuild3DMipmapLevels
-gluBuild3DMipmaps
-gluScaleImage
-gluScaleImage3D
-; __gluInvertMatrixd
-; __gluMakeIdentityd
-; __gluMakeIdentityf
-; __gluMultMatricesd
-; __gluMultMatrixVecd
-gluLookAt
-gluOrtho2D
-gluPerspective
-gluPickMatrix
-gluProject
-gluUnProject
-gluUnProject4
-gluCylinder
-gluDeleteQuadric
-gluDisk
-gluNewQuadric
-gluPartialDisk
-gluQuadricCallback
-gluQuadricDrawStyle
-gluQuadricNormals
-gluQuadricOrientation
-gluQuadricTexture
-gluSphere
-gluCheckExtension
-gluGetString
-
-/* $XFree86: xc/lib/GLU/GLU-def.cpp,v 1.1 2001/02/13 19:19:11 dawes Exp $ */
diff --git a/xc/lib/GLU/Imakefile b/xc/lib/GLU/Imakefile
deleted file mode 100644
index 7c071533c..000000000
--- a/xc/lib/GLU/Imakefile
+++ /dev/null
@@ -1,133 +0,0 @@
-XCOMM $XFree86: xc/lib/GLU/Imakefile,v 1.6 2002/05/31 18:45:39 dawes Exp $
-
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-#define IHaveSubdirs
-
-#define DoNormalLib NormalLibGlu
-#define DoSharedLib SharedLibGlu
-#define DoDebugLib DebugLibGlu
-#define DoProfileLib ProfileLibGlu
-#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
-
-LIBNAME = GLU
-SOREV = $(SOGLUREV)
-
-#define CplusplusSource
-
-#ifdef SharedGLUReqs
-REQUIREDLIBS = SharedGLUReqs
-#endif
-
-#ifndef SeparateSharedCompile
-#define SeparateSharedCompile YES
-#endif
-#if NormalLibGlu && SharedLibGlu && SeparateSharedCompile
-STATIC_OBJSDIR = unshared/
-#endif
-
-SUBDIRS = \
- include \
- libutil \
- libtess \
- libnurbs/internals \
- libnurbs/interface \
- libnurbs/nurbtess
-
- SHARED_OBJS = libutil/?*.o libtess/?*.o \
- libnurbs/internals/?*.o \
- libnurbs/interface/?*.o \
- libnurbs/nurbtess/?*.o
-
- STATIC_OBJS = libutil/$(STATIC_OBJSDIR)?*.o libtess/$(STATIC_OBJSDIR)?*.o \
- libnurbs/internals/$(STATIC_OBJSDIR)?*.o \
- libnurbs/interface/$(STATIC_OBJSDIR)?*.o \
- libnurbs/nurbtess/$(STATIC_OBJSDIR)?*.o
-
- DEBUG_OBJS = libutil/debugger/?*.o libtess/debugger/?*.o \
- libnurbs/internals/debugger/?*.o \
- libnurbs/interface/debugger/?*.o \
- libnurbs/nurbtess/debugger/?*.o
-
- PROFILE_OBJS = libutil/profiled/?*.o libtess/profiled/?*.o \
- libnurbs/internals/profiled/?*.o \
- libnurbs/interface/profiled/?*.o \
- libnurbs/nurbtess/profiled/?*.o
-
- DONES = libutil/DONE libtess/DONE \
- libnurbs/internals/DONE \
- libnurbs/interface/DONE \
- libnurbs/nurbtess/DONE
-
-#if HasParallelMake
-MakeMutex($(SUBDIRS) $(DONES))
-#endif
-
-#if HasGnuMake || HasBsdMake
-$(DONES): $(SUBDIRS)
-#endif
-
-#include <Library.tmpl>
-
-#undef _LinkBuildLibrary
-#define _LinkBuildLibrary(lib) LinkBuildLibrary(lib)
-
-#if NormalLibGlu
-NormalDepLibraryTarget($(LIBNAME),$(SUBDIRS) $(DONES),$(STATIC_OBJS))
-InstallLibrary($(LIBNAME),$(USRLIBDIR))
-#endif
-
-#if SharedLibGlu
-#ifdef SharedDepCplusplusLibraryTarget
-SharedDepCplusplusLibraryTarget($(LIBNAME),$(SOREV),$(SUBDIRS) $(DONES),$(SHARED_OBJS),.,.)
-#else
-SharedDepLibraryTarget($(LIBNAME),$(SOREV),$(SUBDIRS) $(DONES),$(SHARED_OBJS),.,.)
-#endif
-InstallSharedLibrary($(LIBNAME),$(SOREV),$(SHLIBDIR))
-#endif
-
-#if DebugLibGlu
-DebuggedDepLibraryTarget($(LIBNAME),$(SUBDIRS) $(DONES),$(DEBUG_OBJS))
-InstallLibrary($(LIBNAME)_d,$(USRLIBDIR))
-#endif /* DebugLibGlu */
-
-#if ProfileLibGlu
-ProfiledDepLibraryTarget($(LIBNAME),$(SUBDIRS) $(DONES),$(PROFILE_OBJS))
-InstallLibrary($(LIBNAME)_p,$(USRLIBDIR))
-#endif /* ProfileLibGlu */
-
-
-ForceSubdirs($(SUBDIRS))
-DependSubdirs($(SUBDIRS))
-
diff --git a/xc/lib/GLU/include/Imakefile b/xc/lib/GLU/include/Imakefile
deleted file mode 100644
index 1f3b70d34..000000000
--- a/xc/lib/GLU/include/Imakefile
+++ /dev/null
@@ -1,38 +0,0 @@
-XCOMM $XFree86: xc/lib/GLU/include/Imakefile,v 1.1 2001/01/15 22:17:53 dawes Exp $
-
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-GLUSRCDIR = $(OGLSAMPLESRCDIR)/main/gfx/lib/glu
-
-LinkSourceFile(gluos.h, $(GLUSRCDIR)/include)
diff --git a/xc/lib/GLU/libnurbs/interface/Imakefile b/xc/lib/GLU/libnurbs/interface/Imakefile
deleted file mode 100644
index eabf0b307..000000000
--- a/xc/lib/GLU/libnurbs/interface/Imakefile
+++ /dev/null
@@ -1,107 +0,0 @@
-XCOMM $XFree86: xc/lib/GLU/libnurbs/interface/Imakefile,v 1.3 2001/01/16 00:39:24 dawes Exp $
-
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-#define DoNormalLib NormalLibGlu
-#define DoSharedLib SharedLibGlu
-#define DoDebugLib DebugLibGlu
-#define DoProfileLib ProfileLibGlu
-
-#define CplusplusSource
-
-#include <Library.tmpl>
-
-SRCS = \
- bezierEval.cc \
- bezierPatch.cc \
- bezierPatchMesh.cc \
- glcurveval.cc \
- glinterface.cc \
- glrenderer.cc \
- glsurfeval.cc \
- incurveeval.cc \
- insurfeval.cc
-
-OBJS = \
- bezierEval.o \
- bezierPatch.o \
- bezierPatchMesh.o \
- glcurveval.o \
- glinterface.o \
- glrenderer.o \
- glsurfeval.o \
- incurveeval.o \
- insurfeval.o
-
-INCLUDES = \
- -I. \
- -I../internals \
- -I../nurbtess \
- -I../../include \
- -I$(TOP)/include \
- -I$(TOP)/include/GL
-
-DEFINES = \
- -DLIBRARYBUILD \
- -DNDEBUG
-
-LibraryObjectRule()
-
-SubdirLibraryRule($(OBJS))
-NormalLintTarget($(SRCS))
-
-GLUSRCDIR = $(OGLSAMPLESRCDIR)/main/gfx/lib/glu
-
-LinkSourceFile(bezierEval.cc, $(GLUSRCDIR)/libnurbs/interface)
-LinkSourceFile(bezierPatch.cc, $(GLUSRCDIR)/libnurbs/interface)
-LinkSourceFile(bezierPatchMesh.cc, $(GLUSRCDIR)/libnurbs/interface)
-LinkSourceFile(glcurveval.cc, $(GLUSRCDIR)/libnurbs/interface)
-LinkSourceFile(glinterface.cc, $(GLUSRCDIR)/libnurbs/interface)
-LinkSourceFile(glrenderer.cc, $(GLUSRCDIR)/libnurbs/interface)
-LinkSourceFile(glsurfeval.cc, $(GLUSRCDIR)/libnurbs/interface)
-LinkSourceFile(incurveeval.cc, $(GLUSRCDIR)/libnurbs/interface)
-LinkSourceFile(insurfeval.cc, $(GLUSRCDIR)/libnurbs/interface)
-
-LinkSourceFile(bezierEval.h, $(GLUSRCDIR)/libnurbs/interface)
-LinkSourceFile(bezierPatch.h, $(GLUSRCDIR)/libnurbs/interface)
-LinkSourceFile(bezierPatchMesh.h, $(GLUSRCDIR)/libnurbs/interface)
-LinkSourceFile(glcurveval.h, $(GLUSRCDIR)/libnurbs/interface)
-LinkSourceFile(glimports.h, $(GLUSRCDIR)/libnurbs/interface)
-LinkSourceFile(glrenderer.h, $(GLUSRCDIR)/libnurbs/interface)
-LinkSourceFile(glsurfeval.h, $(GLUSRCDIR)/libnurbs/interface)
-LinkSourceFile(mystdio.h, $(GLUSRCDIR)/libnurbs/interface)
-LinkSourceFile(mystdlib.h, $(GLUSRCDIR)/libnurbs/interface)
-
-DependTarget()
-CleanTarget()
diff --git a/xc/lib/GLU/libnurbs/internals/Imakefile b/xc/lib/GLU/libnurbs/internals/Imakefile
deleted file mode 100644
index a74fbbdc7..000000000
--- a/xc/lib/GLU/libnurbs/internals/Imakefile
+++ /dev/null
@@ -1,267 +0,0 @@
-XCOMM $XFree86: xc/lib/GLU/libnurbs/internals/Imakefile,v 1.8 2002/07/17 01:06:05 torrey Exp $
-
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-#define DoNormalLib NormalLibGlu
-#define DoSharedLib SharedLibGlu
-#define DoDebugLib DebugLibGlu
-#define DoProfileLib ProfileLibGlu
-
-#define CplusplusSource
-
-#include <Library.tmpl>
-
-SRCS = \
- arc.cc \
- arcsorter.cc \
- arctess.cc \
- backend.cc \
- basiccrveval.cc \
- basicsurfeval.cc \
- bin.cc \
- bufpool.cc \
- cachingeval.cc \
- ccw.cc \
- coveandtiler.cc \
- curve.cc \
- curvelist.cc \
- curvesub.cc \
- dataTransform.cc \
- displaylist.cc \
- flist.cc \
- flistsorter.cc \
- hull.cc \
- intersect.cc \
- knotvector.cc \
- mapdesc.cc \
- mapdescv.cc \
- maplist.cc \
- mesher.cc \
- monoTriangulationBackend.cc \
- monotonizer.cc \
- mycode.cc \
- nurbsinterfac.cc \
- nurbstess.cc \
- patch.cc \
- patchlist.cc \
- quilt.cc \
- reader.cc \
- renderhints.cc \
- slicer.cc \
- sorter.cc \
- splitarcs.cc \
- subdivider.cc \
- tobezier.cc \
- trimline.cc \
- trimregion.cc \
- trimvertpool.cc \
- uarray.cc \
- varray.cc
-
-OBJS = \
- arc.o \
- arcsorter.o \
- arctess.o \
- backend.o \
- basiccrveval.o \
- basicsurfeval.o \
- bin.o \
- bufpool.o \
- cachingeval.o \
- ccw.o \
- coveandtiler.o \
- curve.o \
- curvelist.o \
- curvesub.o \
- dataTransform.o \
- displaylist.o \
- flist.o \
- flistsorter.o \
- hull.o \
- intersect.o \
- knotvector.o \
- mapdesc.o \
- mapdescv.o \
- maplist.o \
- mesher.o \
- monoTriangulationBackend.o \
- monotonizer.o \
- mycode.o \
- nurbsinterfac.o \
- nurbstess.o \
- patch.o \
- patchlist.o \
- quilt.o \
- reader.o \
- renderhints.o \
- slicer.o \
- sorter.o \
- splitarcs.o \
- subdivider.o \
- tobezier.o \
- trimline.o \
- trimregion.o \
- trimvertpool.o \
- uarray.o \
- varray.o
-
-INCLUDES = \
- -I../nurbtess \
- -I../../libutil \
- -I../../include \
- -I$(TOP)/include \
- -I$(TOP)/include/GL
-
-#if SystemV4
-OSDEFINES = -DNEEDCEILF
-#elif defined(DarwinArchitecture)
-# if OSMajorVersion <= 5
-OSDEFINES = -DNEEDCEILF
-# endif
-#else
-OSDEFINES = -D_EXTENSIONS_
-#endif
-
-DEFINES = $(OSDEFINES) \
- -DLIBRARYBUILD \
- -DNDEBUG
-
-LibraryObjectRule()
-
-SubdirLibraryRule($(OBJS))
-NormalLintTarget($(SRCS))
-
-GLUSRCDIR = $(OGLSAMPLESRCDIR)/main/gfx/lib/glu
-
-LinkSourceFile(arc.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(arcsorter.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(arctess.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(backend.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(basiccrveval.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(basicsurfeval.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(bin.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(bufpool.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(cachingeval.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(ccw.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(coveandtiler.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(curve.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(curvelist.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(curvesub.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(dataTransform.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(displaylist.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(flist.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(flistsorter.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(hull.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(intersect.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(knotvector.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(mapdesc.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(mapdescv.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(maplist.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(mesher.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(monoTriangulationBackend.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(monotonizer.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(mycode.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(nurbsinterfac.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(nurbstess.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(patch.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(patchlist.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(quilt.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(reader.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(renderhints.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(slicer.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(sorter.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(splitarcs.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(subdivider.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(tobezier.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(trimline.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(trimregion.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(trimvertpool.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(uarray.cc, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(varray.cc, $(GLUSRCDIR)/libnurbs/internals)
-
-LinkSourceFile(arc.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(arcsorter.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(arctess.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(backend.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(basiccrveval.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(basicsurfeval.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(bezierarc.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(bin.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(bufpool.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(cachingeval.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(coveandtiler.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(curve.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(curvelist.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(dataTransform.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(defines.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(displaylist.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(displaymode.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(flist.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(flistsorter.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(gridline.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(gridtrimvertex.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(gridvertex.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(hull.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(jarcloc.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(knotvector.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(mapdesc.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(maplist.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(mesher.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(monotonizer.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(myassert.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(mymath.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(mysetjmp.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(mystring.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(nurbsconsts.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(nurbstess.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(patch.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(patchlist.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(pwlarc.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(quilt.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(reader.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(renderhints.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(simplemath.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(slicer.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(sorter.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(subdivider.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(trimline.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(trimregion.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(trimvertex.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(trimvertpool.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(types.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(uarray.h, $(GLUSRCDIR)/libnurbs/internals)
-LinkSourceFile(varray.h, $(GLUSRCDIR)/libnurbs/internals)
-
-DependTarget()
-CleanTarget()
diff --git a/xc/lib/GLU/libnurbs/nurbtess/Imakefile b/xc/lib/GLU/libnurbs/nurbtess/Imakefile
deleted file mode 100644
index 5471f6363..000000000
--- a/xc/lib/GLU/libnurbs/nurbtess/Imakefile
+++ /dev/null
@@ -1,150 +0,0 @@
-XCOMM $XFree86: xc/lib/GLU/libnurbs/nurbtess/Imakefile,v 1.3 2001/01/16 00:39:25 dawes Exp $
-
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-#define DoNormalLib NormalLibGlu
-#define DoSharedLib SharedLibGlu
-#define DoDebugLib DebugLibGlu
-#define DoProfileLib ProfileLibGlu
-
-#define CplusplusSource
-
-#include <Library.tmpl>
-
-SRCS = \
- directedLine.cc \
- gridWrap.cc \
- monoChain.cc \
- monoTriangulation.cc \
- partitionX.cc \
- partitionY.cc \
- polyDBG.cc \
- polyUtil.cc \
- primitiveStream.cc \
- quicksort.cc \
- rectBlock.cc \
- sampleComp.cc \
- sampleCompBot.cc \
- sampleCompRight.cc \
- sampleCompTop.cc \
- sampleMonoPoly.cc \
- sampledLine.cc \
- searchTree.cc \
- monoPolyPart.cc
-
-OBJS = \
- directedLine.o \
- gridWrap.o \
- monoChain.o \
- monoTriangulation.o \
- partitionX.o \
- partitionY.o \
- polyDBG.o \
- polyUtil.o \
- primitiveStream.o \
- quicksort.o \
- rectBlock.o \
- sampleComp.o \
- sampleCompBot.o \
- sampleCompRight.o \
- sampleCompTop.o \
- sampleMonoPoly.o \
- sampledLine.o \
- searchTree.o \
- monoPolyPart.o
-
-INCLUDES = \
- -I../internals \
- -I../../include \
- -I$(TOP)/include \
- -I$(TOP)/include/GL
-
-DEFINES = \
- -DLIBRARYBUILD \
- -DNDEBUG
-
-LibraryObjectRule()
-
-SubdirLibraryRule($(OBJS))
-NormalLintTarget($(SRCS))
-
-GLUSRCDIR = $(OGLSAMPLESRCDIR)/main/gfx/lib/glu
-
-LinkSourceFile(directedLine.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(gridWrap.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(monoChain.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(monoTriangulation.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(partitionX.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(partitionY.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(polyDBG.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(polyUtil.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(primitiveStream.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(quicksort.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(rectBlock.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(sampleComp.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(sampleCompBot.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(sampleCompRight.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(sampleCompTop.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(sampleMonoPoly.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(sampledLine.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(searchTree.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(monoPolyPart.cc, $(GLUSRCDIR)/libnurbs/nurbtess)
-
-LinkSourceFile(definitions.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(directedLine.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(glimports.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(gridWrap.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(monoChain.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(monoPolyPart.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(monoTriangulation.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(mystdio.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(mystdlib.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(partitionX.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(partitionY.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(polyDBG.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(polyUtil.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(primitiveStream.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(quicksort.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(rectBlock.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(sampleComp.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(sampleCompBot.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(sampleCompRight.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(sampleCompTop.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(sampleMonoPoly.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(sampledLine.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(searchTree.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-LinkSourceFile(zlassert.h, $(GLUSRCDIR)/libnurbs/nurbtess)
-
-DependTarget()
-CleanTarget()
diff --git a/xc/lib/GLU/libtess/Imakefile b/xc/lib/GLU/libtess/Imakefile
deleted file mode 100644
index e87c09799..000000000
--- a/xc/lib/GLU/libtess/Imakefile
+++ /dev/null
@@ -1,109 +0,0 @@
-XCOMM $XFree86: xc/lib/GLU/libtess/Imakefile,v 1.2 2001/01/16 00:39:25 dawes Exp $
-
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-#define DoNormalLib NormalLibGlu
-#define DoSharedLib SharedLibGlu
-#define DoDebugLib DebugLibGlu
-#define DoProfileLib ProfileLibGlu
-
-#include <Library.tmpl>
-
-SRCS = \
- dict.c \
- geom.c \
- memalloc.c \
- mesh.c \
- normal.c \
- priorityq.c \
- render.c \
- sweep.c \
- tess.c \
- tessmono.c
-
-OBJS = \
- dict.o \
- geom.o \
- memalloc.o \
- mesh.o \
- normal.o \
- priorityq.o \
- render.o \
- sweep.o \
- tess.o \
- tessmono.o
-
-INCLUDES = \
- -I../include \
- -I$(TOP)/include \
- -I$(TOP)/include/GL
-
-DEFINES = \
- -DNDEBUG
-
-LibraryObjectRule()
-
-SubdirLibraryRule($(OBJS))
-NormalLintTarget($(SRCS))
-
-GLUSRCDIR = $(OGLSAMPLESRCDIR)/main/gfx/lib/glu
-
-LinkSourceFile(dict.c, $(GLUSRCDIR)/libtess)
-LinkSourceFile(geom.c, $(GLUSRCDIR)/libtess)
-LinkSourceFile(memalloc.c, $(GLUSRCDIR)/libtess)
-LinkSourceFile(mesh.c, $(GLUSRCDIR)/libtess)
-LinkSourceFile(normal.c, $(GLUSRCDIR)/libtess)
-LinkSourceFile(priorityq-heap.c, $(GLUSRCDIR)/libtess)
-LinkSourceFile(priorityq.c, $(GLUSRCDIR)/libtess)
-LinkSourceFile(render.c, $(GLUSRCDIR)/libtess)
-LinkSourceFile(sweep.c, $(GLUSRCDIR)/libtess)
-LinkSourceFile(tess.c, $(GLUSRCDIR)/libtess)
-LinkSourceFile(tessmono.c, $(GLUSRCDIR)/libtess)
-
-LinkSourceFile(dict-list.h, $(GLUSRCDIR)/libtess)
-LinkSourceFile(dict.h, $(GLUSRCDIR)/libtess)
-LinkSourceFile(geom.h, $(GLUSRCDIR)/libtess)
-LinkSourceFile(memalloc.h, $(GLUSRCDIR)/libtess)
-LinkSourceFile(mesh.h, $(GLUSRCDIR)/libtess)
-LinkSourceFile(normal.h, $(GLUSRCDIR)/libtess)
-LinkSourceFile(priorityq-heap.h, $(GLUSRCDIR)/libtess)
-LinkSourceFile(priorityq-sort.h, $(GLUSRCDIR)/libtess)
-LinkSourceFile(priorityq.h, $(GLUSRCDIR)/libtess)
-LinkSourceFile(render.h, $(GLUSRCDIR)/libtess)
-LinkSourceFile(sweep.h, $(GLUSRCDIR)/libtess)
-LinkSourceFile(tess.h, $(GLUSRCDIR)/libtess)
-LinkSourceFile(tessmono.h, $(GLUSRCDIR)/libtess)
-
-DependTarget()
-CleanTarget()
diff --git a/xc/lib/GLU/libutil/Imakefile b/xc/lib/GLU/libutil/Imakefile
deleted file mode 100644
index 8ce739b9d..000000000
--- a/xc/lib/GLU/libutil/Imakefile
+++ /dev/null
@@ -1,84 +0,0 @@
-XCOMM $XFree86: xc/lib/GLU/libutil/Imakefile,v 1.2 2001/01/16 00:39:26 dawes Exp $
-
-XCOMM License Applicability. Except to the extent portions of this file are
-XCOMM made subject to an alternative license as permitted in the SGI Free
-XCOMM Software License B, Version 1.1 (the "License"), the contents of this
-XCOMM file are subject only to the provisions of the License. You may not use
-XCOMM this file except in compliance with the License. You may obtain a copy
-XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-XCOMM
-XCOMM http://oss.sgi.com/projects/FreeB
-XCOMM
-XCOMM Note that, as provided in the License, the Software is distributed on an
-XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-XCOMM
-XCOMM Original Code. The Original Code is: OpenGL Sample Implementation,
-XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-XCOMM Copyright in any portions created by third parties is as indicated
-XCOMM elsewhere herein. All Rights Reserved.
-XCOMM
-XCOMM Additional Notice Provisions: The application programming interfaces
-XCOMM established by SGI in conjunction with the Original Code are The
-XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-XCOMM April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-XCOMM 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-XCOMM Window System(R) (Version 1.3), released October 19, 1998. This software
-XCOMM was created using the OpenGL(R) version 1.2.1 Sample Implementation
-XCOMM published by SGI, but has not been independently verified as being
-XCOMM compliant with the OpenGL(R) version 1.2.1 Specification.
-XCOMM
-
-#define DoNormalLib NormalLibGlu
-#define DoSharedLib SharedLibGlu
-#define DoDebugLib DebugLibGlu
-#define DoProfileLib ProfileLibGlu
-
-#include <Library.tmpl>
-
-SRCS = \
- error.c \
- glue.c \
- mipmap.c \
- project.c \
- quad.c \
- registry.c
-
-OBJS = \
- error.o \
- glue.o \
- mipmap.o \
- project.o \
- quad.o \
- registry.o
-
-INCLUDES = \
- -I../include \
- -I$(TOP)/include \
- -I$(TOP)/include/GL
-
-DEFINES = \
- -DNDEBUG
-
-LibraryObjectRule()
-
-SubdirLibraryRule($(OBJS))
-NormalLintTarget($(SRCS))
-
-GLUSRCDIR = $(OGLSAMPLESRCDIR)/main/gfx/lib/glu
-
-LinkSourceFile(error.c, $(GLUSRCDIR)/libutil)
-LinkSourceFile(glue.c, $(GLUSRCDIR)/libutil)
-LinkSourceFile(mipmap.c, $(GLUSRCDIR)/libutil)
-LinkSourceFile(project.c, $(GLUSRCDIR)/libutil)
-LinkSourceFile(quad.c, $(GLUSRCDIR)/libutil)
-LinkSourceFile(registry.c, $(GLUSRCDIR)/libutil)
-
-LinkSourceFile(gluint.h, $(GLUSRCDIR)/libutil)
-
-DependTarget()
-CleanTarget()
diff --git a/xc/lib/GLw/GLwM1DrawA.c b/xc/lib/GLw/GLwM1DrawA.c
deleted file mode 100644
index ac6b38f8c..000000000
--- a/xc/lib/GLw/GLwM1DrawA.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * (c) Copyright 1993, Silicon Graphics, Inc.
- * ALL RIGHTS RESERVED
- * Permission to use, copy, modify, and distribute this software for
- * any purpose and without fee is hereby granted, provided that the above
- * copyright notice appear in all copies and that both the copyright notice
- * and this permission notice appear in supporting documentation, and that
- * the name of Silicon Graphics, Inc. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.
- *
- * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
- * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
- * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
- * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
- * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
- * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
- * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
- * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
- * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- *
- * US Government Users Restricted Rights
- * Use, duplication, or disclosure by the Government is subject to
- * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
- * (c)(1)(ii) of the Rights in Technical Data and Computer Software
- * clause at DFARS 252.227-7013 and/or in similar or successor
- * clauses in the FAR or the DOD or NASA FAR Supplement.
- * Unpublished-- rights reserved under the copyright laws of the
- * United States. Contractor/manufacturer is Silicon Graphics,
- * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
- *
- * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
- */
-/* $XFree86: xc/lib/GLw/GLwM1DrawA.c,v 1.1 2000/11/02 20:39:07 dawes Exp $ */
-
-#define __GLX_MOTIF 1
-
-#define XmVERSION 1
-#define XmREVISION 2
-#define XmVersion (XmVERSION * 1000 + XmREVISION)
-#define XmVERSION_STRING "GLwDrawingArea fake M*tif 1.X"
-#define XmUPDATE_LEVEL 0
-
-/* Include our fake Motif headers */
-#include "GLwXm/Xm.h"
-#include "GLwXm/PrimitiveP.h"
-
-#define __GLX_INCLUDE_XM_H
-#define __GLX_INCLUDE_PRIMITIVE_P_H
-
-#include "GLwDrawA.c"
diff --git a/xc/lib/GLw/GLwM2DrawA.c b/xc/lib/GLw/GLwM2DrawA.c
deleted file mode 100644
index eb313514c..000000000
--- a/xc/lib/GLw/GLwM2DrawA.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * (c) Copyright 1993, Silicon Graphics, Inc.
- * ALL RIGHTS RESERVED
- * Permission to use, copy, modify, and distribute this software for
- * any purpose and without fee is hereby granted, provided that the above
- * copyright notice appear in all copies and that both the copyright notice
- * and this permission notice appear in supporting documentation, and that
- * the name of Silicon Graphics, Inc. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.
- *
- * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
- * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
- * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
- * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
- * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
- * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
- * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
- * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
- * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- *
- * US Government Users Restricted Rights
- * Use, duplication, or disclosure by the Government is subject to
- * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
- * (c)(1)(ii) of the Rights in Technical Data and Computer Software
- * clause at DFARS 252.227-7013 and/or in similar or successor
- * clauses in the FAR or the DOD or NASA FAR Supplement.
- * Unpublished-- rights reserved under the copyright laws of the
- * United States. Contractor/manufacturer is Silicon Graphics,
- * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
- *
- * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
- */
-/* $XFree86: xc/lib/GLw/GLwM2DrawA.c,v 1.1 2000/11/02 20:39:07 dawes Exp $ */
-
-#define __GLX_MOTIF 2
-
-#define XmVERSION 2
-#define XmREVISION 0
-#define XmVersion (XmVERSION * 1000 + XmREVISION)
-#define XmVERSION_STRING "GLwDrawingArea fake M*tif 2.X"
-#define XmUPDATE_LEVEL 0
-
-/* Include our fake Motif headers */
-#include "GLwXm/Xm.h"
-#include "GLwXm/PrimitiveP.h"
-
-#define __GLX_INCLUDE_XM_H
-#define __GLX_INCLUDE_PRIMITIVE_P_H
-
-#include "GLwDrawA.c"
diff --git a/xc/lib/GLw/GLwXm/PrimitiveP.h b/xc/lib/GLw/GLwXm/PrimitiveP.h
deleted file mode 100644
index ccd03fa2d..000000000
--- a/xc/lib/GLw/GLwXm/PrimitiveP.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2000 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-/* $XFree86: xc/lib/GLw/GLwXm/PrimitiveP.h,v 1.1 2000/11/02 20:39:08 dawes Exp $ */
-
-/*
- * This file is a fake Motif(TM) header intended to allow the compilation of
- * libGLw without having a real Motif. Do not use this file to compile any
- * application because it declares only a small subset of the API!
- */
-
-#ifndef GLWXM_PRIMITIVE_P_H
-#define GLWXM_PRIMITIVE_P_H
-
-#include "GLwXm/XmP.h"
-
-/* primitive instance part */
-typedef struct {
- Pixel foreground;
- Dimension shadow_thickness;
- Pixel top_shadow_color;
- Pixmap top_shadow_pixmap;
- Pixel bottom_shadow_color;
- Pixmap bottom_shadow_pixmap;
- Dimension highlight_thickness;
- Pixel highlight_color;
- Pixmap highlight_pixmap;
- XtCallbackList help_callback;
- XtPointer user_data;
- Boolean traversal_on;
- Boolean highlight_on_enter;
- Boolean have_traversal;
- unsigned char unit_type;
- XmNavigationType navigation_type;
- Boolean highlight_drawn;
- Boolean highlighted;
- GC highlight_GC;
- GC top_shadow_GC;
- GC bottom_shadow_GC;
-#if XmVERSION > 1
- XtCallbackList convert_callback;
- XtCallbackList popup_handler_callback;
- XmDirection layout_direction;
-#endif
-} XmPrimitivePart;
-
-/* primitive class part */
-typedef struct {
- XtWidgetProc border_highlight;
- XtWidgetProc border_unhighlight;
- String translations;
- XtActionProc arm_and_activate;
- XmSyntheticResource *syn_resources;
- int num_syn_resources;
- XtPointer extension;
-} XmPrimitiveClassPart;
-
-/* class record */
-typedef struct _XmPrimitiveClassRec {
- CoreClassPart core_class;
- XmPrimitiveClassPart primitive_class;
-} XmPrimitiveClassRec;
-
-/* declare class record */
-extern XmPrimitiveClassRec xmPrimitiveClassRec;
-
-#endif /* GLWXM_PRIMITIVE_P_H */
diff --git a/xc/lib/GLw/GLwXm/Xm.h b/xc/lib/GLw/GLwXm/Xm.h
deleted file mode 100644
index 0020048b8..000000000
--- a/xc/lib/GLw/GLwXm/Xm.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2000 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-/* $XFree86: xc/lib/GLw/GLwXm/Xm.h,v 1.1 2000/11/02 20:39:08 dawes Exp $ */
-
-/*
- * This file is a fake Motif(TM) header intended to allow the compilation of
- * libGLw without having a real Motif. Do not use this file to compile any
- * application because it declares only a small subset of the API!
- */
-
-#ifndef GLWXM_H
-#define GLWXM_H
-
-#include <X11/Intrinsic.h>
-#include <X11/Shell.h>
-#include <X11/Xatom.h>
-#include "GLwXm/XmStrDefs.h"
-
-enum {
- XmATTACH_NONE,
- XmATTACH_FORM,
- XmATTACH_OPPOSITE_FORM,
- XmATTACH_WIDGET,
- XmATTACH_OPPOSITE_WIDGET,
- XmATTACH_POSITION,
- XmATTACH_SELF
-};
-
-enum {
- XmCR_NONE,
- XmCR_HELP,
- XmCR_VALUE_CHANGED,
- XmCR_INCREMENT,
- XmCR_DECREMENT,
- XmCR_PAGE_INCREMENT,
- XmCR_PAGE_DECREMENT,
- XmCR_TO_TOP,
- XmCR_TO_BOTTOM,
- XmCR_DRAG,
- XmCR_ACTIVATE,
- XmCR_ARM,
- XmCR_DISARM,
- XmCR_DUMMY13,
- XmCR_DUMMY14,
- XmCR_DUMMY15,
- XmCR_MAP,
- XmCR_UNMAP,
- XmCR_FOCUS,
- XmCR_LOSING_FOCUS,
- XmCR_MODIFYING_TEXT_VALUE,
- XmCR_MOVING_INSERT_CURSOR,
- XmCR_EXECUTE,
- XmCR_SINGLE_SELECT,
- XmCR_MULTIPLE_SELECT,
- XmCR_EXTENDED_SELECT,
- XmCR_BROWSE_SELECT,
- XmCR_DEFAULT_ACTION,
- XmCR_CLIPBOARD_DATA_REQUEST,
- XmCR_CLIPBOARD_DATA_DELETE,
- XmCR_CASCADING,
- XmCR_OK,
- XmCR_CANCEL,
- XmCR_DUMMY33,
- XmCR_APPLY,
- XmCR_NO_MATCH,
- XmCR_COMMAND_ENTERED,
- XmCR_COMMAND_CHANGED,
- XmCR_EXPOSE,
- XmCR_RESIZE,
- XmCR_INPUT,
- XmCR_GAIN_PRIMARY,
- XmCR_LOSE_PRIMARY,
- XmCR_CREATE,
- XmCR_TEAR_OFF_ACTIVATE,
- XmCR_TEAR_OFF_DEACTIVATE,
- XmCR_OBSCURED_TRAVERSAL,
-#if XmVERSION < 2
- XmCR_PROTOCOLS
-#else
- XmCR_FOCUS_MOVED,
- XmCR_DUMMY48,
- XmCR_DUMMY49,
- XmCR_DUMMY50,
- XmCR_DUMMY51,
- XmCR_DUMMY52,
- XmCR_DUMMY53,
- XmCR_REPOST,
- XmCR_COLLAPSED,
- XmCR_EXPANDED,
- XmCR_SELECT,
- XmCR_DRAG_START,
- XmCR_NO_FONT,
- XmCR_NO_RENDITION,
- XmCR_POST,
- XmCR_SPIN_NEXT,
- XmCR_SPIN_PRIOR,
- XmCR_SPIN_FIRST,
- XmCR_SPIN_LAST,
- XmCR_PAGE_SCROLLER_INCREMENT,
- XmCR_PAGE_SCROLLER_DECREMENT,
- XmCR_MAJOR_TAB,
- XmCR_MINOR_TAB,
- XmCR_PROTOCOLS = 6666
-#endif
-};
-
-typedef unsigned char XmDirection;
-
-typedef struct {
- int reason;
- XEvent *event;
- Window window;
-} XmDrawingAreaCallbackStruct;
-
-#define XmUNSPECIFIED_PIXMAP 2
-
-typedef unsigned char XmNavigationType;
-
-#endif /* GLWXM_H */
diff --git a/xc/lib/GLw/GLwXm/XmP.h b/xc/lib/GLw/GLwXm/XmP.h
deleted file mode 100644
index 6e7228805..000000000
--- a/xc/lib/GLw/GLwXm/XmP.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2000 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-/* $XFree86: xc/lib/GLw/GLwXm/XmP.h,v 1.1 2000/11/02 20:39:08 dawes Exp $ */
-
-/*
- * This file is a fake Motif(TM) header intended to allow the compilation of
- * libGLw without having a real Motif. Do not use this file to compile any
- * application because it declares only a small subset of the API!
- */
-
-#ifndef GLWXM_P_H
-#define GLWXM_P_H
-
-#include "GLwXm/Xm.h"
-#include <X11/IntrinsicP.h>
-
-#define XmInheritBorderHighlight ((XtWidgetProc) _XtInherit)
-#define XmInheritBorderUnhighlight ((XtWidgetProc) _XtInherit)
-
-void _XmBackgroundColorDefault(Widget widget, int offset, XrmValue *value);
-void _XmForegroundColorDefault(Widget widget, int offset, XrmValue *value);
-void _XmHighlightColorDefault(Widget widget, int offset, XrmValue *value);
-void _XmPrimitiveHighlightPixmapDefault(Widget widget, int offset,
- XrmValue *value);
-
-typedef enum {
- XmSYNTHETIC_NONE,
- XmSYNTHETIC_LOAD
-} XmImportOperator;
-
-typedef void (*XmExportProc)(Widget, int, XtArgVal *);
-
-typedef XmImportOperator (*XmImportProc)(Widget, int, XtArgVal*);
-
-typedef struct _XmSyntheticResource {
- String resource_name;
- Cardinal resource_size;
- Cardinal resource_offset;
- XmExportProc export_proc;
- XmImportProc import_proc;
-} XmSyntheticResource;
-
-#endif /* GLWXM_P_H */
diff --git a/xc/lib/GLw/GLwXm/XmStrDefs.h b/xc/lib/GLw/GLwXm/XmStrDefs.h
deleted file mode 100644
index 8fe7e67fa..000000000
--- a/xc/lib/GLw/GLwXm/XmStrDefs.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2000 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-/* $XFree86: xc/lib/GLw/GLwXm/XmStrDefs.h,v 1.1 2000/11/02 20:39:08 dawes Exp $ */
-
-/*
- * This file is a fake Motif(TM) header intended to allow the compilation of
- * libGLw without having a real Motif. Do not use this file to compile any
- * application because it declares only a small subset of the API!
- */
-
-#ifndef GLWXM_STRDEFS_H
-#define GLWXM_STRDEFS_H
-
-#ifndef _XmConst
-#define _XmConst /**/
-#endif
-
-#ifdef XMSTRINGDEFINES
-
-#define XmCBackgroundPixmap "BackgroundPixmap"
-#define XmRBackgroundPixmap "BackgroundPixmap"
-#define XmRBooleanDimension "BooleanDimension"
-#define XmNbottomAttachment "bottomAttachment"
-#define XmNbottomWidget "bottomWidget"
-#define XmCForegroundThreshold "ForegroundThreshold"
-#define XmNforegroundThreshold "foregroundThreshold"
-#define XmCHighlightColor "HighlightColor"
-#define XmNhighlightColor "highlightColor"
-#define XmCHighlightOnEnter "HighlightOnEnter"
-#define XmNhighlightOnEnter "highlightOnEnter"
-#define XmCHighlightThickness "HighlightThickness"
-#define XmNhighlightThickness "highlightThickness"
-#define XmCHighlightPixmap "HighlightPixmap"
-#define XmNhighlightPixmap "highlightPixmap"
-#define XmRHighlightPixmap "HighlightPixmap"
-#define XmRHorizontalDimension "HorizontalDimension"
-#define XmNleftAttachment "leftAttachment"
-#define XmNrightAttachment "rightAttachment"
-#define XmRStringDirection "StringDirection"
-#define XmNtopAttachment "topAttachment"
-#define XmCTraversalOn "TraversalOn"
-#define XmNtraversalOn "traversalOn"
-#define XmRXmBackgroundPixmap "XmBackgroundPixmap"
-
-#else /* XMSTRINGDEFINES */
-
-extern _XmConst char _XmStrings[];
-
-#define XmCBackgroundPixmap ((char *)&_XmStrings[299])
-#define XmRBackgroundPixmap ((char *)&_XmStrings[10844])
-#define XmRBooleanDimension ((char *)&_XmStrings[10872])
-#define XmNbottomAttachment ((char *)&_XmStrings[5017])
-#define XmNbottomWidget ((char *)&_XmStrings[5099])
-#define XmCHighlightColor ((char *)&_XmStrings[1844])
-#define XmNhighlightColor ((char *)&_XmStrings[6996])
-#define XmCHighlightOnEnter ((char *)&_XmStrings[1859])
-#define XmNhighlightOnEnter ((char *)&_XmStrings[7011])
-#define XmCHighlightThickness ((char *)&_XmStrings[1892])
-#define XmNhighlightThickness ((char *)&_XmStrings[7044])
-#define XmCForegroundThreshold ((char *)&_XmStrings[1808])
-#define XmNforegroundThreshold ((char *)&_XmStrings[6914])
-#define XmCHighlightPixmap ((char *)&_XmStrings[1876])
-#define XmNhighlightPixmap ((char *)&_XmStrings[7028])
-#define XmRHighlightPixmap ((char *)&_XmStrings[11299])
-#define XmRHorizontalDimension ((char *)&_XmStrings[11315])
-#define XmNleftAttachment ((char *)&_XmStrings[7523])
-#define XmNrightAttachment ((char *)&_XmStrings[9077])
-#define XmRStringDirection ((char *)&_XmStrings[11981])
-#define XmNtopAttachment ((char *)&_XmStrings[10165])
-#define XmCTraversalOn ((char *)&_XmStrings[4318])
-#define XmNtraversalOn ((char *)&_XmStrings[10361])
-#define XmRXmBackgroundPixmap ((char *)&_XmStrings[12210])
-
-#endif /* XMSTRINGDEFINES */
-
-/* copy Xt constant definitions */
-#include <X11/StringDefs.h>
-
-#define XmCBackground XtCBackground
-#define XmNbackground XtNbackground
-#define XmNbackgroundPixmap XtNbackgroundPixmap
-#define XmCBoolean XtCBoolean
-#define XmRBoolean XtRBoolean
-#define XmRCallProc XtRCallProc
-#define XmCForeground XtCForeground
-#define XmNforeground XtNforeground
-#define XmRImmediate XtRImmediate
-#define XmRPixel XtRPixel
-#define XmCPixmap XtCPixmap
-#define XmNpixmap XtNpixmap
-#define XmRPixmap XtRPixmap
-#define XmRPrimHighlightPixmap XmRHighlightPixmap
-#define XmRString XtRString
-#define XmRStringArray XtRStringArray
-#define XmRStringTable XtRStringTable
-
-#endif /* GLWXM_STRDEFS_H */
diff --git a/xc/lib/GLw/Imakefile b/xc/lib/GLw/Imakefile
deleted file mode 100644
index fa2a9a684..000000000
--- a/xc/lib/GLw/Imakefile
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2000 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-XCOMM $XFree86: xc/lib/GLw/Imakefile,v 1.3 2002/04/06 18:24:46 tsi Exp $
-
-XCOMM
-XCOMM Imakefile for GLw library - lots of modifications for XFree86 by
-XCOMM Carlos A. M. dos Santos <casantos@cpmet.ufpel.tche.br>
-XCOMM
-
-XCOMM Uncomment this and set the correct values if your Motif installation
-XCOMM is out of the standard X tree and your Imake configuration is not
-XCOMM correct (unfortunatelly, a common mistake).
-
-XCOMM MOTIF_INCLUDES = -I/usr/local/include
-XCOMM MOTIF_LDFLAGS = -L/usr/local/lib
-
-#define DoNormalLib NormalLibGLw
-#define DoSharedLib SharedLibGLw
-#define DoDebugLib DebugLibGLw
-#define DoProfileLib ProfileLibGLw
-
-#define HasSharedData NO
-#define LibName GLw
-#define SoRev SOGLWREV
-#define IncSubdir GL
-
-REQUIREDLIBS = $(LDPRELIBS) $(XTOOLLIB) $(XLIB)
-
-DEFINES =
-
-#if GLwUseXmStubs
-SHAREDCODEDEF = SharedCodeDef -DUSE_XM_STUBS
-#endif
-
-GLWSRCDIR = $(OGLSAMPLESRCDIR)/main/gfx/lib/glw
-
-INCLUDES = $(MOTIF_INCLUDES) -I.
-
-LOCAL_LDFLAGS = $(MOTIF_LDFLAGS)
-
-LINTLIBS = $(LINTXLIB) $(LINTXTOOL)
-
-HEADERS = GLwDrawA.h GLwDrawAP.h GLwMDrawA.h GLwMDrawAP.h
-SRCS = GLwDrawA.c GLwM1DrawA.c GLwM2DrawA.c GLwDAUtil.c
-OBJS = GLwDrawA.o GLwM1DrawA.o GLwM2DrawA.o GLwDAUtil.o
-
-#include <Library.tmpl>
-
-LinkSourceFile(GLwDAUtil.c,$(GLWSRCDIR))
-LinkSourceFile(GLwDrawA.c,$(GLWSRCDIR))
-LinkSourceFile(GLwMDrawA.c,$(GLWSRCDIR))
-LinkSourceFile(GLwDrawA.h,$(GLWSRCDIR))
-LinkSourceFile(GLwDrawAP.h,$(GLWSRCDIR))
-LinkSourceFile(GLwMDrawA.h,$(GLWSRCDIR))
-LinkSourceFile(GLwMDrawAP.h,$(GLWSRCDIR))
-
-DependTarget()
diff --git a/xc/lib/GLw/README.html b/xc/lib/GLw/README.html
deleted file mode 100644
index 02b599b6a..000000000
--- a/xc/lib/GLw/README.html
+++ /dev/null
@@ -1,242 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<HTML>
-<HEAD>
-<TITLE>GL widgets for Xt/Motif - XFree86 implementation</TITLE>
-<META NAME="generator" CONTENT="Only VIM and me.">
-</HEAD>
-<BODY BGCOLOR="#FFFFFF">
-
-<!-- $XFree86: xc/lib/GLw/README.html,v 1.2 2000/11/06 21:57:10 dawes Exp $ -->
-
-<H1 ALIGN=CENTER>GL widgets for Xt/Motif</H1>
-<H2 ALIGN=CENTER>XFree86 implementation</H1>
-<P ALIGN=CENTER>by Carlos A. M. dos Santos<BR>casantos@cpmet.ufpel.tche.br</P>
-
-<HR NOSHADE>
-
-<H3>1. Introduction</H3>
-<P>
-This directory contains the source code for SGI's OpenGL Xt/Motif(TM) widgets,
-slightly modified to generate both Motif 1.x and 2.x versions of
-the widget even if Motif is not available, as in the XFree86 distribution of
-the X Window System. This code is based on that distributed by Silicon
-Graphics as part of it's OpenGL Sample Implementation, not on the modified version
-distributed with Mesa.
-
-
-<H3>2. Installation</H3>
-<P>
-This code is intended to be compiled as part of the normal XFree86 building
-process, under the xc/lib/GLw directory. To compile the library out of the X
-source tree, follow instructions below.
-
-<H3>2.1. Requirements</H3>
-<P>
-Gzip and tar are needed to extract the files from the distribution <A
-HREF="http://www.inf.ufrgs.br/~casantos/libGLw/GLw.tar.gz">archive</A>. Tar is
-a standard UNIX utility but if you don't have it use GNU tar, available in
-source form at <A
-HREF="ftp://ftp.gnu.org/pub/gnu/">ftp://ftp.gnu.org/pub/gnu/</A>. Gzip is not
-a standard UNIX utility, though available in many systems. You may obtain it
-(also source form) at the same FTP server as GNU tar.
-
-<P>
-You need xmkmf and imake too. Depending on your operating system you may need
-to install some kind of X Window System development kit, so check the vendor
-documentation first. I was told that some UNIX systems don't have imake:
-report this as a bug (to your vendor, not me).
-
-<P>
-Of course you will need a C compiler.
-
-<H3>2.2. Steps</H3>
-<P>
-<OL>
- <LI>Extract the source code from the distribution archive.
- <P>
- <CODE>
- gzip -dc GLw.tar.gz | tar xf -
- </CODE>
- <P>
- <LI>Go to the surce code directory and generate the makefile.
- <P>
- <CODE>
- cd GLw<BR>
- xmkmf
- </CODE>
- <P>For LessTif, use "mxmkmf" instead of "xmkmf". Imake support
- is much better in recent versions of LessTif (since late july 2000).
- If your Motif or OpenGL libraries and/or include files are installed in
- non-standard locations (some UNIX vendors seem to be very creative :-)
- then edit the file named Imakefile, remove the leading XCOMM of the
- lines containing MOTIF_INCLUDES and MOTIF_LDFLAGS and set the
- appropriate values.
- <P>
- <LI>Compile the code with
- <P>
- <CODE>
- make includes<BR>
- make standalone
- </CODE>
- <P>
- <LI>Install the library and manual pages with
- <P>
- <CODE>
- make install<BR>
- make install.man
- </CODE>
- <P>
- <LI>Optionally, you may compile two test programs: xmdemo and xtdemo. You need OpenGL
- (or Mesa) for both and Motif (or LessTif) for xmdemo. There are four
- extra make targers for these programs: demos, stand-demos, stand-xmdemo
- and stand-xtdemo. You may use them with:
- <P>
- <CODE>
- make stand-demos<BR>
- ./xmdemo
- ./xtdemo
- </CODE>
-</OL>
-
-<H3>2.3. Creating a shared library</H3>
-<P>
-By default only a static library is created because most of the UNIX loaders,
-if not all, complain about unresolved symbols even if the application doesn't
-use the modules in which such symbols are referenced. However, if your system
-supports libraries with weak symbols (e.g. Solaris, FreeBSD and Linux) it is
-possible to fool the loader. All you have to do is edit the Imakefile,
-changing "#define SharedLibGLw" and "#define GLwUseXmStubs" to YES, then
-repeat the compilation process starting from step 2 in the previous section.
-
-<H3>2.4. Problems</H3>
-<P>
-If you have trouble, ask for help in the XFree86 "xperts" mailing list. Look
-at <A HREF="http://www.xfree86.org">http://www.xfree86.org</A> for
-instructions on how to subscribe. In desperation, send an email to <A
-HREF="mailto:casantos@cpmet.ufpel.tche.br">casantos@cpmet.ufpel.tche.br</A>.
-
-<P>
-PLEASE DO NOT SEND ME EMAIL ASKING HOW TO INSTALL OR CONFIGURE YOUR OPERATING
-SYSTEM, MODEM, NETWORK CARD, BREAD TOASTER, COFEE MAKER OR WHATEVER ELSE!
-
-
-<H3>3. Copyrights</H3>
-<P>
-Most of the code is covered by the following license terms:
-<BLOCKQUOTE>
-<P>
-License Applicability. Except to the extent portions of this file are
-made subject to an alternative license as permitted in the SGI Free
-Software License B, Version 1.1 (the "License"), the contents of this
-file are subject only to the provisions of the License. You may not use
-this file except in compliance with the License. You may obtain a copy
-of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-<P>
-<A
-HREF="http://oss.sgi.com/projects/FreeB">http://oss.sgi.com/projects/FreeB</A>
-<P>
-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.
-<P>
-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 &copy; 1991-2000 Silicon Graphics, Inc.
-Copyright in any portions created by third parties is as indicated
-elsewhere herein. All Rights Reserved.
-<P>
-Additional Notice Provisions: The application programming interfaces
-established by SGI in conjunction with the Original Code are The
-OpenGL&reg; Graphics System: A Specification (Version 1.2.1), released
-April 1, 1999; The OpenGL&reg; Graphics System Utility Library (Version
-1.3), released November 4, 1998; and OpenGL&reg; Graphics with the X
-Window System&reg; (Version 1.3), released October 19, 1998. This software
-was created using the OpenGL&reg; version 1.2.1 Sample Implementation
-published by SGI, but has not been independently verified as being
-compliant with the OpenGL&reg; version 1.2.1 Specification.
-</BLOCKQUOTE>
-
-<P>
-The demonstration programs are covered by the following license terms:
-
-<BLOCKQUOTE>
-<P>
-Copyright &copy; Mark J. Kilgard, 1995, 1996.
-
-<P>
-NOTICE: This source code distribution contains source code contained in
-the book "Programming OpenGL for the X Window System" (ISBN:
-0-201-48359-9) published by Addison-Wesley. The programs and associated
-files contained in the distribution were developed by Mark J. Kilgard and
-are Copyright 1994, 1995, 1996 by Mark J. Kilgard (unless otherwise
-noted). The programs are not in the public domain, but they are freely
-distributable without licensing fees. These programs are provided without
-guarantee or warrantee expressed or implied.
-</BLOCKQUOTE>
-
-<P>
-The files contained in directory GLwXm are fake Motif headers, covered by
-the XFree86 license, they permit us to generate both Motif 1.x and 2.x
-versions of the widget without having Motif. Notice that they are NOT part of
-a standard Motif distribution and shall not be used to compile any other code.
-
-
-<H3>4. Thanks</H3>
-
-<P>
-Many thanks to Silicon Graphics and Mark J. Kilgard for making their
-software free.
-
-
-<H3>5. No thanks</H3>
-
-<BLOCKQUOTE>
-<P>
-<STRONG>
-THIS SECTION CONTAINS MY PERSONAL OPINIONS AND
-DOESN'T REPRESENT AN OFFICIAL POSITION OF THE XFree86 PROJECT.
-</STRONG>
-</BLOCKQUOTE>
-
-<P>
-The first incarnation of this version of libGLw used eight header files from
-<A HREF="http://www.lesstif.org/">LessTif</A>, four for each Motif version.
-LessTif is covered by the GNU Library General Public License (LGPL) whose
-terms are not compatible with the XFree86 licensing policy. Since the
-copyright holder of LessTif is the <A HREF="http://www.fsf.org/">Free Software
-Foundation</A> (FSF), I asked Richard Stallman, president of FSF and so called
-"leader of the Free Software movement", permission to redistribute a copy of
-those eight headers under XFree86 terms, still maintaining the FSF copyright.
-
-<P>
-Observe that I was not asking him to change the license of LessTif as a whole,
-but only to allow me to distribute copies of some header files containing
-function prototypes, variable declarations and data type definitions. Even so,
-Stallman said no because the files contained "more than 6000 lines of code".
-Which code? The LessTif headers are mostly copies of the Motif ones and don't
-contain any original GNU "code"! I can't still imagine a reason for Stallman's
-negative answer except for paranoia. He seems to ignore what Motif is and
-that LessTif's API is simply a copy of Motif's one.
-
-<P>
-After spending some time, I made my own headers, that became much smaller than
-the previous ones because I included only a subset of the Motif API and merged
-everything into four files: 417 lines instead 6000. Humm, perhaps I should be
-grateful to Sallman too :-).
-
-
-<H3>6. Trademarks</H3>
-
-<P>
-<UL>
- <LI>OpenGL is a trademark of Silicon Graphics, Inc.
- <LI>Motif is a trademark of the Open Group.
-</UL>
-
-<HR NOSHADE>
-
-</BODY>
-</HTML>
diff --git a/xc/lib/GLw/README.txt b/xc/lib/GLw/README.txt
deleted file mode 100644
index f3eb83f3f..000000000
--- a/xc/lib/GLw/README.txt
+++ /dev/null
@@ -1,199 +0,0 @@
- GL widgets for Xt/Motif
-
- XFree86 implementation
-
- by Carlos A. M. dos Santos
- casantos@cpmet.ufpel.tche.br
-
- ------------------------------------------------------------------------
-
-1. Introduction
-
-This directory contains the source code for SGI's OpenGL Xt/Motif(TM)
-widgets, slightly modified to generate both Motif 1.x and 2.x versions of
-the widget even if Motif is not available, as in the XFree86 distribution of
-the X Window System. This code is based on that distributed by Silicon
-Graphics as part of it's OpenGL Sample Implementation, not on the modified
-version distributed with Mesa.
-
-2. Installation
-
-This code is intended to be compiled as part of the normal XFree86 building
-process, under the xc/lib/GLw directory. To compile the library out of the X
-source tree, follow instructions below.
-
-2.1. Requirements
-
-Gzip and tar are needed to extract the files from the distribution archive.
-Tar is a standard UNIX utility but if you don't have it use GNU tar,
-available in source form at ftp://ftp.gnu.org/pub/gnu/. Gzip is not a
-standard UNIX utility, though available in many systems. You may obtain it
-(also source form) at the same FTP server as GNU tar.
-
-You need xmkmf and imake too. Depending on your operating system you may
-need to install some kind of X Window System development kit, so check the
-vendor documentation first. I was told that some UNIX systems don't have
-imake: report this as a bug (to your vendor, not me).
-
-Of course you will need a C compiler.
-
-2.2. Steps
-
- 1. Extract the source code from the distribution archive.
-
- gzip -dc GLw.tar.gz | tar xf -
-
- 2. Go to the surce code directory and generate the makefile.
-
- cd GLw
- xmkmf
-
- For LessTif, use "mxmkmf" instead of "xmkmf". Imake support is much
- better in recent versions of LessTif (since late july 2000). If your
- Motif or OpenGL libraries and/or include files are installed in
- non-standard locations (some UNIX vendors seem to be very creative :-)
- then edit the file named Imakefile, remove the leading XCOMM of the
- lines containing MOTIF_INCLUDES and MOTIF_LDFLAGS and set the
- appropriate values.
-
- 3. Compile the code with
-
- make includes
- make standalone
-
- 4. Install the library and manual pages with
-
- make install
- make install.man
-
- 5. Optionally, you may compile two test programs: xmdemo and xtdemo. You
- need OpenGL (or Mesa) for both and Motif (or LessTif) for xmdemo. There
- are four extra make targers for these programs: demos, stand-demos,
- stand-xmdemo and stand-xtdemo. You may use them with:
-
- make stand-demos
- ./xmdemo ./xtdemo
-
-2.3. Creating a shared library
-
-By default only a static library is created because most of the UNIX
-loaders, if not all, complain about unresolved symbols even if the
-application doesn't use the modules in which such symbols are referenced.
-However, if your system supports libraries with weak symbols (e.g. Solaris,
-FreeBSD and Linux) it is possible to fool the loader. All you have to do is
-edit the Imakefile, changing "#define SharedLibGLw" and "#define
-GLwUseXmStubs" to YES, then repeat the compilation process starting from
-step 2 in the previous section.
-
-2.4. Problems
-
-If you have trouble, ask for help in the XFree86 "xperts" mailing list. Look
-at http://www.xfree86.org for instructions on how to subscribe. In
-desperation, send an email to casantos@cpmet.ufpel.tche.br.
-
-PLEASE DO NOT SEND ME EMAIL ASKING HOW TO INSTALL OR CONFIGURE YOUR
-OPERATING SYSTEM, MODEM, NETWORK CARD, BREAD TOASTER, COFEE MAKER OR
-WHATEVER ELSE!
-
-3. Copyrights
-
-Most of the code is covered by the following license terms:
-
- License Applicability. Except to the extent portions of this file
- are made subject to an alternative license as permitted in the SGI
- Free Software License B, Version 1.1 (the "License"), the contents
- of this file are subject only to the provisions of the License.
- You may not use this file except in compliance with the License.
- You may obtain a copy of the License at Silicon Graphics, Inc.,
- attn: Legal Services, 1600 Amphitheatre Parkway, Mountain View, CA
- 94043-1351, or at:
-
- http://oss.sgi.com/projects/FreeB
-
- Note that, as provided in the License, the Software is distributed
- on an "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND
- CONDITIONS DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED
- WARRANTIES AND CONDITIONS OF MERCHANTABILITY, SATISFACTORY
- QUALITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-
- Original Code. The Original Code is: OpenGL Sample Implementation,
- Version 1.2.1, released January 26, 2000, developed by Silicon
- Graphics, Inc. The Original Code is Copyright © 1991-2000 Silicon
- Graphics, Inc. Copyright in any portions created by third parties
- is as indicated elsewhere herein. All Rights Reserved.
-
- Additional Notice Provisions: The application programming
- interfaces established by SGI in conjunction with the Original
- Code are The OpenGL® Graphics System: A Specification (Version
- 1.2.1), released April 1, 1999; The OpenGL® Graphics System
- Utility Library (Version 1.3), released November 4, 1998; and
- OpenGL® Graphics with the X Window System® (Version 1.3), released
- October 19, 1998. This software was created using the OpenGL®
- version 1.2.1 Sample Implementation published by SGI, but has not
- been independently verified as being compliant with the OpenGL®
- version 1.2.1 Specification.
-
-The demonstration programs are covered by the following license terms:
-
- Copyright © Mark J. Kilgard, 1995, 1996.
-
- NOTICE: This source code distribution contains source code
- contained in the book "Programming OpenGL for the X Window System"
- (ISBN: 0-201-48359-9) published by Addison-Wesley. The programs
- and associated files contained in the distribution were developed
- by Mark J. Kilgard and are Copyright 1994, 1995, 1996 by Mark J.
- Kilgard (unless otherwise noted). The programs are not in the
- public domain, but they are freely distributable without licensing
- fees. These programs are provided without guarantee or warrantee
- expressed or implied.
-
-The files contained in directory GLwXm are fake Motif headers, covered by
-the XFree86 license, they permit us to generate both Motif 1.x and 2.x
-versions of the widget without having Motif. Notice that they are NOT part
-of a standard Motif distribution and shall not be used to compile any other
-code.
-
-4. Thanks
-
-Many thanks to Silicon Graphics and Mark J. Kilgard for making their
-software free.
-
-5. No thanks
-
- THIS SECTION CONTAINS MY PERSONAL OPINIONS AND DOESN'T REPRESENT
- AN OFFICIAL POSITION OF THE XFree86 PROJECT.
-
-The first incarnation of this version of libGLw used eight header files from
-LessTif, four for each Motif version. LessTif is covered by the GNU Library
-General Public License (LGPL) whose terms are not compatible with the
-XFree86 licensing policy. Since the copyright holder of LessTif is the Free
-Software Foundation (FSF), I asked Richard Stallman, president of FSF and so
-called "leader of the Free Software movement", permission to redistribute a
-copy of those eight headers under XFree86 terms, still maintaining the FSF
-copyright.
-
-Observe that I was not asking him to change the license of LessTif as a
-whole, but only to allow me to distribute copies of some header files
-containing function prototypes, variable declarations and data type
-definitions. Even so, Stallman said no because the files contained "more
-than 6000 lines of code". Which code? The LessTif headers are mostly copies
-of the Motif ones and don't contain any original GNU "code"! I can't still
-imagine a reason for Stallman's negative answer except for paranoia. He
-seems to ignore what Motif is and that LessTif's API is simply a copy of
-Motif's one.
-
-After spending some time, I made my own headers, that became much smaller
-than the previous ones because I included only a subset of the Motif API and
-merged everything into four files: 417 lines instead 6000. Humm, perhaps I
-should be grateful to Sallman too :-).
-
-6. Trademarks
-
- * OpenGL is a trademark of Silicon Graphics, Inc.
- * Motif is a trademark of the Open Group.
-
- ------------------------------------------------------------------------
-
-
-
-$XFree86: xc/lib/GLw/README.txt,v 1.2 2000/11/06 21:57:10 dawes Exp $
diff --git a/xc/lib/font/FreeType/ftutil.c b/xc/lib/font/FreeType/ftutil.c
deleted file mode 100644
index da2fcd940..000000000
--- a/xc/lib/font/FreeType/ftutil.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
-Copyright (c) 1997 by Mark Leisher
-Copyright (c) 1998 by Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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.
-*/
-
-/* $XFree86: xc/lib/font/FreeType/ftutil.c,v 1.11 2000/08/11 21:12:42 dawes Exp $ */
-
-#ifndef FONTMODULE
-#include <ctype.h>
-#endif
-#include "font.h"
-#include "ttconfig.h"
-#include "freetype.h"
-#include "ft.h"
-
-#ifndef LSBFirst
-#define LSBFirst 0
-#define MSBFirst 1
-#endif
-
-#define LOBYTE(s,byte) ((byte)==LSBFirst?*(char*)(s):*((char*)(s)+1))
-#define HIBYTE(s,byte) ((byte)==LSBFirst?*((char*)(s)+1):*(char*)(s))
-
-static unsigned char a2i[128] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-static unsigned char odigits[32] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static unsigned char ddigits[32] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static unsigned char hdigits[32] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03,
- 0x7e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-#define isdigok(m, d) (m[(d) >> 3] & (1 << ((d) & 7)))
-
-long
-ttf_atol(char *s, char **end, int base)
-{
- long v, neg;
- unsigned char *dmap;
-
- if (s==0 || *s==0)
- return 0;
-
- /*
- * Make sure the radix is something recognizable. Default to 10.
- */
- switch (base) {
- case 8: dmap = odigits; break;
- case 16: dmap = hdigits; break;
- default: base = 10; dmap = ddigits; break;
- }
-
- /*
- * Check for a minus sign.
- */
- neg = 0;
- if (*s=='-') {
- s++;
- neg = 1;
- }
-
- /*
- * Check for the special hex prefix.
- */
- if (*s=='0' && (*(s + 1)=='x' || *(s + 1)=='X')) {
- base = 16;
- dmap = hdigits;
- s += 2;
- }
-
- for (v = 0; isdigok(dmap, *s); s++)
- v = (v * base) + a2i[(int) *s];
-
- if (end != 0)
- *end = s;
-
- return (!neg) ? v : -v;
-}
-
-/* Take slen bytes from a Unicode string and convert them to ISO
- * 8859-1. byte specifies the endianness of the string. */
-int
-ttf_u2a(int slen, char *from, char *to, int byte)
-{
- int i;
-
- for (i = 0; i < slen; i += 2) {
- if(HIBYTE(from+i,byte)!=0)
- *to++='?';
- else
- *to++ = LOBYTE(from+i,byte);
- }
- *to = 0;
- return (slen >> 1);
-}
-
-
-int FTtoXReturnCode(int rc)
-{
- if(rc>>8==0x01)
- return AllocError;
- else return BadFontFormat;
-}
-
-
-
-/* A generic routine to get a name from the TT name table. This
- * routine tries to get a name in English. The encoding will be
- * converted to ISO 8859-1.
- *
- * The particular name ID mut be provided (e.g. nameID = 0 for
- * copyright string, nameID = 6 for Postscript name, nameID = 1 for
- * typeface name.
- *
- * Returns the number of bytes added, -1 on failure. */
-
-int
-ttf_GetEnglishName(TT_Face face, char *name, int nameID)
-{
- int i, nrec;
- unsigned short slen;
- unsigned short nrPlatformID, nrEncodingID, nrLanguageID, nrNameID;
- char *s;
-
- nrec = TT_Get_Name_Count(face);
-
- for (i = 0; i < nrec; i++) {
- if(TT_Get_Name_ID(face, i, &nrPlatformID, &nrEncodingID,
- &nrLanguageID, &nrNameID))
- continue;
- if (/* check for Microsoft, Unicode, English */
- (nrPlatformID==3 && nrEncodingID==1 &&
- nrNameID==nameID &&
- (nrLanguageID==0x0409 || nrLanguageID==0x0809 ||
- nrLanguageID==0x0c09 || nrLanguageID==0x1009 ||
- nrLanguageID==0x1409 || nrLanguageID==0x1809)) ||
- /* or for Apple, Unicode, English */
- ((nrPlatformID==0 && nrNameID==nameID &&
- nrLanguageID==0))) {
- if(!TT_Get_Name_String(face, i, &s, &slen))
- return ttf_u2a(slen, s, name, MSBFirst);
- }
- }
-
- /* Must be some dodgy font. Pretend that Apple Roman is ISO 8859-1. */
- for (i = 0; i < nrec; i++) {
- if(TT_Get_Name_ID(face, i, &nrPlatformID, &nrEncodingID,
- &nrLanguageID, &nrNameID))
- continue;
- /* Check for Apple, Roman, English */
- if (nrPlatformID==1 && nrEncodingID==0 &&
- nrLanguageID==0 && nrNameID==nameID) {
- TT_Get_Name_String(face, i, &s, &slen);
- memcpy(name,s,slen);
- name[slen]=0;
- return slen;
- }
- }
-
- /* Must be some font that can only be named in Polish or something. */
- return -1;
-}
-
-int
-ttf_checkForTTCName(char *fileName, char **realFileName, int *faceNumber)
-{
- int length;
- int fn;
- int i, j;
- char *start, *realName;
-
- length=strlen(fileName);
- if(length<4)
- return 0;
-
- if(strcasecmp(fileName+(length-4), ".ttc"))
- return 0;
-
- if (!(realName = xalloc(length + 1)))
- return 0;
-
- strcpy(realName, fileName);
- *realFileName=realName;
- start = strchr(realName, ':');
- if (start) {
- fn=0;
- i=1;
- while(isdigit(start[i])) {
- fn*=10;
- fn+=start[i]-'0';
- i++;
- }
- if(start[i]==':') {
- *faceNumber=fn;
- i++;
- j = 0;
- while (start[i]) {
- start[j++] = start[i++];
- }
- start[j] = '\0';
- return 1;
- }
- }
-
- *faceNumber=0;
- return 1;
-}
diff --git a/xc/lib/xtrans/Xtransos2.c b/xc/lib/xtrans/Xtransos2.c
deleted file mode 100644
index 6b3c87ae1..000000000
--- a/xc/lib/xtrans/Xtransos2.c
+++ /dev/null
@@ -1,886 +0,0 @@
-/* $XFree86: xc/lib/xtrans/Xtransos2.c,v 3.6 1999/06/20 08:41:22 dawes Exp $ */
-
-/*
- * (c) Copyright 1996 by Sebastien Marineau and Holger Veit
- * <marineau@genie.uottawa.ca>
- * <Holger.Veit@gmd.de>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * HOLGER VEIT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Sebastien Marineau or Holger Veit shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Holger Veit or Sebastien Marineau.
- *
- */
-
-/* Implementation of the OS/2 local pipe transport layer */
-
-#define INCL_DOSNMPIPES
-#define INCL_DOSPROCESS
-#define INCL_DOSERRORS
-#define INCL_DOSFILEMGR
-#undef BYTE
-#undef BOOL
-#include <os2.h>
-
-#ifdef XSERV_t
-extern HEV hPipeSem;
-BOOL init_server_pipes();
-#endif
-
-/*************************************************************************
- * Independent Layer
- *************************************************************************/
-#ifdef TRANS_CLIENT
-
-static XtransConnInfo
-TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol,
- char *host, char *port)
-{
- APIRET rc;
- HFILE hfd,hServer;
- ULONG action,byteWritten,State;
- char pipename[256],clientname[256];
- char server_string[256];
- struct sockaddr *addr_name;
- unsigned char pipe_len;
- XtransConnInfo ciptr;
- static int unique_id=0;
- int i,namelen,try;
-
- PRMSG(2,"Os2OpenClient(%s,%s,%s)\n",protocol,host,port);
-
- /* test, whether the host is really local, i.e. either
- * "os2" or "local"
- */
- if (strcmp(protocol,"os2") && strcmp(protocol,"local")) {
- PRMSG (1,
- "Os2OpenClient: Cannot connect to non-local host %s\n",
- host, 0, 0);
- return NULL;
- }
-
- /* make the pipename */
-
- if (port && *port ) {
- if( *port == '/' ) { /* A full pathname */
- (void) sprintf(pipename, "\\PIPE\\X\\%s,", port);
- } else {
- (void) sprintf(pipename, "%s%s", "\\PIPE\\X\\xf86.", port);
- }
- } else {
- (void) sprintf(pipename, "\\PIPE\\X\\xfree86"); }
-
- PRMSG(5, "Os2OpenClient: Creating pipe %s\n",pipename, 0,0 );
-
- /* make a connection entry */
- if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL ) {
- PRMSG(1,"Os2OpenClient: calloc(1,%d) failed\n",
- sizeof(struct _XtransConnInfo),0,0 );
- return NULL;
- }
-
- /* open the pipe. Try ten times before giving up at 500ms intervals*/
- try = 0;
- do {
- rc = DosOpen(pipename,&hServer, &action, 0,
- FILE_NORMAL, FILE_OPEN,
- OPEN_ACCESS_WRITEONLY | OPEN_SHARE_DENYWRITE,
- (PEAOP2)NULL);
- if(rc == 0) break;
- if (try >=10) {
- PRMSG(1,"Os2OpenClient: Open server pipe %s failed, rc=%d\n",
- pipename,rc,0 );
- PRMSG(1,"\tProbable causes: either the XServer is not running, or has not started properly,\n",
- 0,0,0 );
- PRMSG(1,"\tor the DISPLAY variable is set incorrectly.\n",
- 0,0,0 );
- xfree(ciptr);
- return NULL;
- }
- try ++;
- DosSleep(500);
- } while (rc != 0);
-
-/* OK, now we are talking to the server. Generate a unique pipe name and pass it to
- * the server. Make the pipe and wait for server to connect */
-
- sprintf(clientname,"\\PIPE\\X\\%d.%d",getpid(),unique_id++);
-
- rc = DosCreateNPipe (clientname, &hfd,
- NP_NOINHERIT | NP_ACCESS_DUPLEX,
- 1 | NP_NOWAIT | NP_TYPE_BYTE | NP_READMODE_BYTE,
- 16384, 16384, 0);
- if (rc != 0){
- PRMSG(1, "Os2OpenClient: Unable to create pipe %s\n", pipename,0,0 );
- DosClose(hfd);
- pipe_len=0;
- DosWrite(hServer,&pipe_len,1,&byteWritten);
- DosClose(hServer);
- xfree(ciptr);
- return(NULL);
- }
-
- /* Connect to the pipe. */
-
- rc = DosConnectNPipe (hfd);
- if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED)
- {
- PRMSG(1, "Os2OpenClient: Unable to connect to pipe %s\n", pipename,0,0 );
- DosClose (hfd);
- DosClose(hServer);
- xfree(ciptr);
- return (NULL);
- }
-
-/* Now write name to server on hServer */
- server_string[0]=(char) strlen(clientname)+1;
- strcpy(&server_string[1],clientname);
- rc = DosWrite(hServer,server_string,(ULONG)server_string[0]+1,&byteWritten);
- if(rc != 0){ /* Could not write to server pipe? */
- PRMSG(1, "Os2OpenClient: Error writing to server pipe, handle=%d, rc=%d, w=%d\n",
- hServer,rc,byteWritten );
- DosClose(hServer);
- DosClose(hfd);
- xfree(ciptr);
- return(NULL);
- }
-
- PRMSG (5, "Os2OpenCLient: Wrote pipename %s to server; len %d written %d \n",
- &server_string[1],server_string[0]+1,byteWritten);
-
-
-/* The server will respond by opening the pipe. Wait for that for 30 secs */
-
- i=0;
- DosSleep(50); /* Give it time to catch up but minimize race condition*/
- rc = DosConnectNPipe(hfd);
- while((rc == ERROR_PIPE_NOT_CONNECTED)&&(i++<60)) {
- DosSleep(500);
- rc = DosConnectNPipe(hfd);
- }
-
- if(rc != 0){ /* Server has not responded! */
- PRMSG(1, "Os2OpenClient: Timeout on wait for server response, handle=%d, rc=%d\n",hServer,rc,0 );
- PRMSG(1, "\tProbable cause: the XServer has exited or crashed while the connection was being established\n",0,0,0 );
- PRMSG(1, "\tor the XServer is too busy to respond.\n",0,0,0 );
- DosClose(hServer);
- DosClose(hfd);
- xfree(ciptr);
- return(NULL);
- }
-
-/* OK, the server has connected! Fill-in the info and return */
-
- DosClose(hServer);
-
-/* Last check: make sure client is connected! */
-
- rc = DosQueryNPHState(hfd,&State);
- if(rc != 0){ /* Client is not connected! */
- PRMSG(1, "Os2OpenClient: Client pipe does not appear connected. rc=%d, h=%d\n",rc,hfd,0 );
- PRMSG(1, "\tProbable cause: the XServer has just exited.\n",0,0,0 );
- DosClose(hfd);
- xfree(ciptr);
- return(NULL);
- }
-
- namelen=sizeof(struct sockaddr);
- if ((ciptr->addr = (char *) xalloc (namelen)) == NULL)
- {
- PRMSG (1, "Os2OpenClient: Can't allocate space for the addr\n",
- 0, 0, 0);
- DosClose(hfd);
- xfree(ciptr);
- return(NULL);
- }
- ciptr->addrlen = namelen;
- ((struct sockaddr *)ciptr->addr)->sa_family = AF_UNIX;
- strcpy(((struct sockaddr *)ciptr->addr)->sa_data, "local");
-
- if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL)
- {
- PRMSG (1, "Os2OpenCLient: Can't allocate space for the addr\n",
- 0, 0, 0);
- DosClose(hfd);
- xfree(ciptr->addr);
- xfree(ciptr);
- return(NULL);
- }
- ciptr->peeraddrlen = namelen;
- ((struct sockaddr *)ciptr->peeraddr)->sa_family = AF_UNIX;
- strcpy (((struct sockaddr *)ciptr->peeraddr)->sa_data,"local");
-
- PRMSG (5, "Os2OpenCLient: Filled in struct: len %d %d name %s\n",
- ciptr->addrlen,ciptr->peeraddrlen,((struct sockaddr *)ciptr->peeraddr)->sa_data);
-
-
- ciptr->index=hfd;
- ciptr->family=AF_UNIX;
- if((ciptr->fd=_imphandle(hfd))<0){
- PRMSG(1, "Os2OpenClient: Could not import the pipe handle into EMX\n",0,0,0 );
- PRMSG(1, "\tProbable cause: EMX has run out of free file handles.\n",0,0,0 );
- DosClose(hfd);
- xfree(ciptr->addr);
- xfree(ciptr->peeraddr);
- xfree(ciptr);
- return(NULL);
- }
- PRMSG(5, "Os2OpenClient: pipe handle %d EMX handle %d\n",ciptr->index,ciptr->fd,0 );
- fcntl(ciptr->fd,F_SETFL,O_NDELAY);
- fcntl(ciptr->fd,F_SETFD,FD_CLOEXEC);
- return ciptr;
-}
-#endif /* TRANS_CLIENT */
-
-#ifdef TRANS_SERVER
-static XtransConnInfo
-TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol,
- char *host, char *port)
-{
- APIRET rc;
- HFILE hfd;
- ULONG action;
- char pipename[256];
- struct sockaddr *addr_name;
- XtransConnInfo ciptr;
- int namelen;
-
-#ifdef XSERV_t
- if (! init_server_pipes()) return(NULL);
-#endif
-
- PRMSG(2,"Os2OpenServer(%s,%s,%s)\n",protocol,host,port);
-
- if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
- {
- PRMSG(1,"Os2OpenServer: xcalloc(1,%d) failed\n",
- sizeof(struct _XtransConnInfo),0,0 );
- return NULL;
- }
-
-
- if (port && *port ) {
- if( *port == '/' ) { /* A full pathname */
- (void) sprintf(pipename, "\\PIPE\\X\\%s", port);
- } else {
- (void) sprintf(pipename, "%s%s", "\\PIPE\\X\\xf86.", port);
- }
- } else {
- (void) sprintf(pipename, "\\PIPE\\X\\xfree86");
- }
-
- PRMSG(5, "Os2OpenServer: Creating pipe %s\n",pipename, 0,0 );
-
- rc = DosCreateNPipe (pipename, &hfd,
- NP_NOINHERIT | NP_ACCESS_INBOUND,
- 1 | NP_NOWAIT | NP_TYPE_BYTE | NP_READMODE_BYTE,
- 0, 8192, 0);
- if (rc != 0){
- PRMSG(1, "Os2OpenServer: Unable to create pipe %s, rc=%d\n", pipename,rc,0 );
- PRMSG(1, "\tProbable cause: there is already another XServer running on display :%s\n",port,0,0 );
- DosClose(hfd);
- xfree(ciptr);
- return(NULL);
- }
-
- /* Connect to the pipe. */
-
- rc = DosConnectNPipe (hfd);
- if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED)
- {
- PRMSG(1, "Os2OpenServer: Unable to connect to pipe %s\n", pipename,0,0 );
- DosClose (hfd);
- xfree(ciptr);
- return (NULL);
- }
-
-/* Pipe is now connected and waiting for client connect */
-
-/*** Put in info ***/
-
- namelen=sizeof(struct sockaddr);
- if ((ciptr->addr = (char *) xalloc (namelen)) == NULL)
- {
- PRMSG (1, "Os2OpenServer: Can't allocate space for the addr\n",
- 0, 0, 0);
- DosClose(hfd);
- xfree(ciptr);
- return(NULL);
- }
- ciptr->addrlen = namelen;
- ((struct sockaddr *)ciptr->addr)->sa_family = AF_UNIX;
- strcpy (((struct sockaddr *)ciptr->addr)->sa_data, "local");
-
- if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL)
- {
- PRMSG (1, "Os2OpenServer: Can't allocate space for the addr\n",
- 0, 0, 0);
- DosClose(hfd);
- xfree(ciptr->addr);
- xfree(ciptr);
- return(NULL);
- }
-
- ciptr->peeraddrlen = namelen;
- ((struct sockaddr *)ciptr->peeraddr)->sa_family = AF_UNIX;
- strcpy(((struct sockaddr *)ciptr->peeraddr)->sa_data,"local");
-
- PRMSG (5, "Os2OpenServer: Filled in struct: len %d %d name %s\n",
- ciptr->addrlen,ciptr->peeraddrlen,((struct sockaddr *)ciptr->peeraddr)->sa_data);
-
- ciptr->index=hfd; /* Save this for later use in this unused member of struct */
- ciptr->flags=1; /* Listener */
- ciptr->family=AF_UNIX;
-
- if((ciptr->fd=_imphandle(hfd))<0){
- DosClose(hfd);
- xfree(ciptr->addr);
- xfree(ciptr->peeraddr);
- xfree(ciptr);
- return(NULL);
- }
- PRMSG(5, "Os2OpenServer: Pipe handle %d EMX handle %d",ciptr->index,ciptr->fd,0 );
-
-#ifdef XSERV_t
-/* Attach the pipe sem to the pipe. Use handle index as key */
- rc = DosSetNPipeSem(ciptr->fd, (HSEM)hPipeSem, ciptr->fd);
- if (rc){
- PRMSG(1, "Os2OpenCOTSServer: Could not attach sem %d to pipe %d, rc=%d\n",
- hPipeSem,ciptr->fd,rc);
- DosClose(ciptr->fd);
- xfree(ciptr->addr);
- xfree(ciptr->peeraddr);
- xfree(ciptr);
- return(NULL);
- }
-#endif
-
- fcntl(ciptr->fd,F_SETFL,O_NDELAY);
- fcntl(ciptr->fd,F_SETFD,FD_CLOEXEC);
- return(ciptr);
-}
-#endif /* TRANS_SERVER */
-
-#ifdef TRANS_CLIENT
-static XtransConnInfo
-TRANS(Os2OpenCLTSClient)(Xtransport *thistrans, char *protocol,
- char *host, char *port)
-{
- PRMSG(2,"Os2OpenCLTSClient(%s,%s,%s)\n",protocol,host,port);
- return TRANS(Os2OpenClient)(thistrans, protocol, host, port);
-}
-#endif /* TRANS_CLIENT */
-
-#ifdef TRANS_CLIENT
-static XtransConnInfo
-TRANS(Os2OpenCOTSClient)(Xtransport *thistrans, char *protocol,
- char *host, char *port)
-{
- PRMSG(2,"Os2OpenCOTSClient(%s,%s,%s)\n",protocol,host,port);
- return TRANS(Os2OpenClient)(thistrans, protocol, host, port);
-}
-#endif /* TRANS_CLIENT */
-
-
-#ifdef TRANS_SERVER
-static XtransConnInfo
-TRANS(Os2OpenCLTSServer)(Xtransport *thistrans, char *protocol,
- char *host, char *port)
-{
- PRMSG(2,"Os2OpenCLTSServer(%s,%s,%s)\n",protocol,host,port);
- return TRANS(Os2OpenServer)(thistrans, protocol, host, port);
-}
-#endif /* TRANS_SERVER */
-
-
-#ifdef TRANS_SERVER
-static XtransConnInfo
-TRANS(Os2OpenCOTSServer)(Xtransport *thistrans, char *protocol,
- char *host, char *port)
-{
- PRMSG(2,"Os2OpenCOTSServer(%s,%s,%s)\n",protocol,host,port);
- return TRANS(Os2OpenServer)(thistrans, protocol, host, port);
-}
-#endif /* TRANS_SERVER */
-
-
-#ifdef TRANS_REOPEN
-static XtransConnInfo
-TRANS(Os2ReopenCOTSServer)(Xtransport *thistrans, int fd, char *port)
-{
-
- XtransConnInfo ciptr;
- char addr_name[256];
- int namelen;
-
- PRMSG(2,"Os2ReopenCOTSServer(%d,%s)\n", fd, port, 0);
-
- if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
- {
- PRMSG(1,"Os2ReopenCOTSServer: xcalloc(1,%d) failed\n",
- sizeof(struct _XtransConnInfo),0,0 );
- return NULL;
- }
-
- strcpy(addr_name,"local");
- namelen=sizeof(addr_name);
- if ((ciptr->addr = (char *) xalloc (namelen)) == NULL)
- {
- PRMSG (1, "Os2ReopenCOTSServer: Can't allocate space for the addr\n",
- 0, 0, 0);
- xfree(ciptr);
- return(NULL);
- }
-
- ciptr->addrlen = namelen;
- memcpy (ciptr->addr, addr_name, ciptr->addrlen);
- if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL)
- {
- PRMSG (1, "Os2ReopenCOTSServer: Can't allocate space for the addr\n",
- 0, 0, 0);
- xfree(ciptr);
- return(NULL);
- }
-
- ciptr->peeraddrlen = namelen;
- memcpy (ciptr->peeraddr,addr_name, ciptr->addrlen);
-
- ciptr->fd = fd;
- ciptr->family=AF_UNIX;
- ciptr->flags=1;
- PRMSG(1,"Os2ReopenCOTSServer: Filled-in info for handle %d on port %s.\n", fd, port, 0);
-
- return(ciptr);
-}
-
-static XtransConnInfo
-TRANS(Os2ReopenCLTSServer)(Xtransport *thistrans, int fd, char *port)
-{
- PRMSG(2,"Os2ReopenCLTSServer(%d,%s)\n", fd, port, 0);
- return TRANS(Os2ReopenCOTSServer)(thistrans, fd, port);
-}
-#endif
-
-static
-TRANS(Os2SetOption)(XtransConnInfo ciptr, int option, int arg)
-{
- PRMSG(2,"Os2SetOption(%d,%d,%d)\n",ciptr->fd,option,arg);
- return -1;
-}
-
-#ifdef TRANS_SERVER
-
-static
-TRANS(Os2CreateListener)(XtransConnInfo ciptr, char *port)
-{
- PRMSG(2,"Os2CreateListener(%x->%d,%s)\n",ciptr,ciptr->fd,port);
- return 0;
-}
-
-static XtransConnInfo
-TRANS(Os2Accept)(XtransConnInfo ciptr, int *status)
-{
- XtransConnInfo newciptr;
- HFILE hClient;
- unsigned char length;
- ULONG action;
- char clientname[256];
- struct sockaddr *addr_name;
- int in,namelen;
- APIRET rc;
-
-
- PRMSG(2,"Os2Accept(%x->%d)\n", ciptr, ciptr->fd,0);
- if( (newciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo)))==NULL )
- {
- PRMSG(1,"Os2Accept: xcalloc(1,%d) failed\n",
- sizeof(struct _XtransConnInfo),0,0 );
- *status = TRANS_ACCEPT_BAD_MALLOC;
- return NULL;
- }
-
-/* Read in length of client pipe name. If fails, then reset server pipe */
- if((in=read(ciptr->fd,&length,1))<=0){
- PRMSG(2,"Os2Accept: Error reading incoming connection, in=%d, error=%d\n",
- in,errno,0 );
- *status = TRANS_ACCEPT_MISC_ERROR;
- xfree(newciptr);
- rc = DosDisConnectNPipe(ciptr->fd);
- rc = DosConnectNPipe (ciptr->fd);
- if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED)
- {
- PRMSG(1, "Os2Accept: Unable to reconnect server pipe %d\n", ciptr->fd,0,0 );
- }
- return NULL;
- }
- PRMSG(5, "Os2Accept: Bytes to read for name: %d\n",length,0,0 );
-
-
-/* Check length for valid length ?? */
-
-/* Now read in length bytes from pipe for client pipe name */
- if((in=read(ciptr->fd,clientname,length))<=0){
- PRMSG(2,"Os2Accept: Error reading incoming connection, in=%d, error=%d\n",
- in,errno,0 );
- *status = TRANS_ACCEPT_MISC_ERROR;
- xfree(newciptr);
- rc = DosDisConnectNPipe(ciptr->fd);
- rc = DosConnectNPipe (ciptr->fd);
- if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED)
- {
- PRMSG(1, "Os2Accept: Unable to reconnect server pipe %d\n", ciptr->fd,0,0 );
- }
- return NULL;
- }
- clientname[length]='\0';
- PRMSG(5, "Os2Accept: Server name %s length %d\n",clientname,length,0 );
-
-
-/* Now we have the client pipe name. Open it with DosOpen */
-
- rc = DosOpen(clientname,&hClient, &action, 0,
- FILE_NORMAL, FILE_OPEN,
- OPEN_FLAGS_NOINHERIT | OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYREADWRITE,
- (PEAOP2)NULL);
-
- PRMSG(5, "Os2Accept: Open pipe %s, handle = %d, rc=%d\n",clientname,hClient,rc );
-
- if (rc) {
- PRMSG(1,"Os2Accept: Open pipe %s to client failed, rc=%d\n",
- clientname,rc,0 );
- PRMSG(1, "\tProbable cause: the client has exited or timed-out.\n",0,0,0 );
- xfree(newciptr);
- rc = DosDisConnectNPipe(ciptr->fd);
- rc = DosConnectNPipe (ciptr->fd);
- if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED)
- {
- PRMSG(1, "Os2Accept: Unable to reconnect server pipe %d\n", ciptr->fd,0,0 );
- }
- return NULL;
- }
-
- rc = DosSetNPHState (hClient, NP_NOWAIT | NP_READMODE_BYTE);
- if (rc != 0)
- {
- PRMSG(1,"Os2Accept: Could not set pipe %s to non-blocking mode, rc=%d\n",
- hClient,rc,0 );
- xfree(newciptr);
- rc = DosDisConnectNPipe(ciptr->fd);
- rc = DosConnectNPipe (ciptr->fd);
- if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED)
- {
- PRMSG(1, "Os2Accept: Unable to reconnect server pipe %d\n", ciptr->fd,0,0 );
- }
- return NULL;
- }
-
-/* OK, we seem to be well connected to client. Now disconnect server pipe and put again in listen */
-
- rc = DosDisConnectNPipe(ciptr->fd);
- rc = DosConnectNPipe (ciptr->fd);
- PRMSG(5, "Os2Accept: Reconnecting server pipe %d, rc = %d\n",ciptr->fd,rc,0 );
-
- if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED)
- {
- PRMSG(1, "Os2Accept: Unable to reconnect server pipe %d\n", ciptr->fd,0,0 );
- } /* Consider this non-fatal for present connection */
-
-/* And finally fill-in info in newciptr */
-
- namelen=sizeof(struct sockaddr);
- if ((newciptr->addr = (char *) xalloc (namelen)) == NULL)
- {
- PRMSG (1, "Os2Accept: Can't allocate space for the addr\n",
- 0, 0, 0);
- DosClose(hClient);
- xfree(newciptr);
- return(NULL);
- }
-
- newciptr->addrlen = namelen;
- ((struct sockaddr *)newciptr->addr)->sa_family = AF_UNIX;
- strcpy (((struct sockaddr *)newciptr->addr)->sa_data, "local");
-
- if ((newciptr->peeraddr = (char *) xalloc (namelen)) == NULL)
- {
- PRMSG (1, "Os2Accept: Can't allocate space for the addr\n",
- 0, 0, 0);
- DosClose(hClient);
- xfree(ciptr->addr);
- xfree(newciptr);
- return(NULL);
- }
-
- newciptr->peeraddrlen = namelen;
- ((struct sockaddr *)newciptr->peeraddr)->sa_family = AF_UNIX;
- strcpy (((struct sockaddr *)newciptr->peeraddr)->sa_data, "local");
-
- PRMSG (5, "Os2Accept: Filled in struct: len %d %d name %s\n",
- newciptr->addrlen,newciptr->peeraddrlen,newciptr->peeraddr);
-
-
- newciptr->index=hClient;
- newciptr->family=AF_UNIX;
- if((newciptr->fd=_imphandle(hClient))<0){
- PRMSG(1,"Os2Accept: Could not import pipe %d into EMX, errno=%d\n",
- hClient,errno,0 );
- PRMSG(1, "\tProbable cause: EMX has run out of file handles.\n",0,0,0 );
- DosClose(hClient);
- xfree(newciptr->addr);
- xfree(newciptr->peeraddr);
- xfree(newciptr);
- return(NULL);
- }
- PRMSG(5, "Os2Accept: Pipe handle %d EMX handle %d",newciptr->index,newciptr->fd,0 );
-
-#ifdef XSERV_t
-/* Attach the pipe sem to the pipe. Use handle index as key */
- rc = DosSetNPipeSem(newciptr->fd, (HSEM)hPipeSem, newciptr->fd);
- if (rc){
- PRMSG(1, "Os2OpenCOTSServer: Could not attach sem %d to pipe %d, rc=%d\n",
- hPipeSem,newciptr->fd,rc);
- DosClose(newciptr->fd);
- xfree(newciptr->addr);
- xfree(newciptr->peeraddr);
- xfree(newciptr);
- return(NULL);
- }
-#endif
-
- fcntl(ciptr->fd,F_SETFL,O_NDELAY);
- fcntl(ciptr->fd,F_SETFD,FD_CLOEXEC);
- *status=0;
- return newciptr;
-}
-
-#endif /* TRANS_SERVER */
-
-#ifdef TRANS_CLIENT
-
-static
-TRANS(Os2Connect)(XtransConnInfo ciptr, char *host, char *port)
-{
- PRMSG(2,"Os2Connect(%x->%d,%s)\n", ciptr, ciptr->fd, port);
- return 0;
-}
-
-#endif /* TRANS_CLIENT */
-
-static int
-TRANS(Os2BytesReadable)(XtransConnInfo ciptr, BytesReadable_t *pend )
-{
- ULONG rc, state, nread;
- AVAILDATA avail;
- char buffer;
-
- PRMSG(2,"Os2BytesReadable(%x->%d,%x)\n", ciptr, ciptr->fd, pend);
-
- rc = DosPeekNPipe (ciptr->fd, &buffer, 0, &nread, &avail, &state);
- if (rc != 0)
- {
- errno = EPIPE;
- *pend = 0;
- return -1;
- }
- if (state == NP_STATE_CLOSING)
- {
- errno = EPIPE;
- *pend = 0;
- return -1;
- }
- errno = 0;
- *pend = avail.cbpipe;
- return 0;
-}
-
-static int
-TRANS(Os2Read)(XtransConnInfo ciptr, char *buf, int size)
-{
- int ret;
- APIRET rc;
- ULONG ulRead;
- PRMSG(2,"Os2Read(%d,%x,%d)\n", ciptr->fd, buf, size );
- errno = 0;
- rc = DosRead(ciptr->fd, buf, size, &ulRead);
- if (rc == 0){
- ret = ulRead;
- }
- else if ((rc == 232) || (rc == 231)){
- errno = EAGAIN;
- ret = -1;
- }
- else if (rc == 6){
- errno = EBADF;
- ret = -1;
- }
- else if ((rc == 109) || (rc == 230) || (rc == 233)){
- errno = EPIPE;
- ret = -1;
- }
- else {
- PRMSG(2,"Os2Read: Unknown return code from DosRead, fd %d rc=%d\n", ciptr->fd,rc,0 );
- errno = EINVAL;
- ret = -1;
- }
- return (ret);
-}
-
-static int
-TRANS(Os2Write)(XtransConnInfo ciptr, char *buf, int size)
-{
- int ret;
- APIRET rc;
- ULONG nWritten;
- PRMSG(2,"Os2Write(%d,%x,%d)\n", ciptr->fd, buf, size );
- rc = DosWrite(ciptr->fd, buf, size, &nWritten);
- if (rc == 0){
- ret = nWritten;
- if(nWritten == 0) {
- errno=EAGAIN;
- ret = -1;
- }
- }
- else if ((rc == 39) || (rc == 112)){
- errno = EAGAIN;
- ret = -1;
- }
- else if ((rc == 109) || (rc == 230) || (rc == 233)){
- errno = EPIPE;
- ret = -1;
- }
- else if (rc == 6){
- errno=EBADF;
- ret = -1;
- }
- else {
- PRMSG(2,"(Os2Write)Unknown return code from DosWrite, fd %d rc=%d\n", ciptr->fd,rc,0 );
- errno = EINVAL;
- ret = -1;
- }
- return (ret);
-}
-
-static int
-TRANS(Os2Readv)(XtransConnInfo ciptr, struct iovec *buf, int size)
-{
- int ret;
- PRMSG(2,"Os2Readv(%d,%x,%d)\n", ciptr->fd, buf, size );
- ret = READV(ciptr,buf,size);
- if ((ret <0) && (errno == EINVAL)) errno = EPIPE;
- return (ret);
-}
-
-static int
-TRANS(Os2Writev)(XtransConnInfo ciptr, struct iovec *buf, int size)
-{
- int ret;
- PRMSG(2,"Os2Writev(%d,%x,%d)\n", ciptr->fd, buf, size );
- ret = WRITEV(ciptr,buf,size);
- if ((ret <0) && (errno == EINVAL)) errno = EPIPE;
- if ((ret <0) && (errno == ENOSPC)) errno = EAGAIN;
- return (ret);
-}
-
-static int
-TRANS(Os2Disconnect)(XtransConnInfo ciptr)
-{
- PRMSG(2,"Os2Disconnect(%x->%d)\n", ciptr, ciptr->fd, 0);
- return 0;
-}
-
-static int
-TRANS(Os2Close)(XtransConnInfo ciptr)
-{
- int ret;
- PRMSG(2,"Os2Close(%x->%d)\n", ciptr, ciptr->fd ,0);
- ret=close(ciptr->fd);
- return ret;
-}
-
-static int
-TRANS(Os2CloseForCloning)(XtransConnInfo ciptr)
-{
- int ret;
-
- PRMSG(2,"Os2CloseForCloning(%x->%d)\n", ciptr, ciptr->fd ,0);
- ret=close(ciptr->fd);
- return ret;
-}
-
-
-Xtransport TRANS(OS2LocalFuncs) = {
- /* Local Interface */
- "local",
- TRANS_LOCAL,
-#ifdef TRANS_CLIENT
- TRANS(Os2OpenCOTSClient),
-#endif /* TRANS_CLIENT */
-#ifdef TRANS_SERVER
- TRANS(Os2OpenCOTSServer),
-#endif /* TRANS_SERVER */
-#ifdef TRANS_CLIENT
- TRANS(Os2OpenCLTSClient),
-#endif /* TRANS_CLIENT */
-#ifdef TRANS_SERVER
- TRANS(Os2OpenCLTSServer),
-#endif /* TRANS_SERVER */
-#ifdef TRANS_REOPEN
- TRANS(Os2ReopenCOTSServer),
- TRANS(Os2ReopenCLTSServer),
-#endif
- TRANS(Os2SetOption),
-#ifdef TRANS_SERVER
- TRANS(Os2CreateListener),
- NULL, /* ResetListener */
- TRANS(Os2Accept),
-#endif /* TRANS_SERVER */
-#ifdef TRANS_CLIENT
- TRANS(Os2Connect),
-#endif /* TRANS_CLIENT */
- TRANS(Os2BytesReadable),
- TRANS(Os2Read),
- TRANS(Os2Write),
- TRANS(Os2Readv),
- TRANS(Os2Writev),
- TRANS(Os2Disconnect),
- TRANS(Os2Close),
- TRANS(Os2CloseForCloning),
-};
-
-#ifdef XSERV_t
-/* This function is used in the server to initialize the semaphore used with pipes */
-
-BOOL init_server_pipes()
-{
- static BOOL first_time=TRUE;
- ULONG rc;
-
- if(first_time){
- rc = DosCreateEventSem(NULL, &hPipeSem,DC_SEM_SHARED,FALSE);
- if (rc){
- PRMSG(1,"Os2OpenListener (init_server_pipes): Could not create pipe semaphore, rc=%d\n",
- rc,0,0);
- return(FALSE);
- }
- first_time=FALSE;
- }
-return(TRUE);
-}
-#endif /* XSERV_t */
diff --git a/xc/programs/Xserver/GL/dri/dri.c b/xc/programs/Xserver/GL/dri/dri.c
index 4d2604280..9d60fc5c9 100644
--- a/xc/programs/Xserver/GL/dri/dri.c
+++ b/xc/programs/Xserver/GL/dri/dri.c
@@ -29,7 +29,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/*
* Authors:
- * Jens Owen <jens@valinux.com>
+ * Jens Owen <jens@tungstengraphics.com>
* Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
@@ -388,30 +388,31 @@ DRIFinishScreenInit(ScreenPtr pScreen)
/* Wrap DRI support */
if (pDRIInfo->wrap.ValidateTree) {
- pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree;
- pScreen->ValidateTree = pDRIInfo->wrap.ValidateTree;
+ pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree;
+ pScreen->ValidateTree = pDRIInfo->wrap.ValidateTree;
}
if (pDRIInfo->wrap.PostValidateTree) {
pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree;
- pScreen->PostValidateTree = pDRIInfo->wrap.PostValidateTree;
+ pScreen->PostValidateTree = pDRIInfo->wrap.PostValidateTree;
}
if (pDRIInfo->wrap.WindowExposures) {
- pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures;
- pScreen->WindowExposures = pDRIInfo->wrap.WindowExposures;
+ pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures;
+ pScreen->WindowExposures = pDRIInfo->wrap.WindowExposures;
}
if (pDRIInfo->wrap.CopyWindow) {
- pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow;
- pScreen->CopyWindow = pDRIInfo->wrap.CopyWindow;
+ pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow;
+ pScreen->CopyWindow = pDRIInfo->wrap.CopyWindow;
}
if (pDRIInfo->wrap.ClipNotify) {
- pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
- pScreen->ClipNotify = pDRIInfo->wrap.ClipNotify;
+ pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
+ pScreen->ClipNotify = pDRIInfo->wrap.ClipNotify;
}
if (pDRIInfo->wrap.AdjustFrame) {
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame;
- pScrn->AdjustFrame = pDRIInfo->wrap.AdjustFrame;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame;
+ pScrn->AdjustFrame = pDRIInfo->wrap.AdjustFrame;
}
+ pDRIPriv->wrapped = TRUE;
DRIDrvMsg(pScreen->myNum, X_INFO, "[DRI] installation complete\n");
@@ -422,15 +423,42 @@ void
DRICloseScreen(ScreenPtr pScreen)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIInfoPtr pDRIInfo;
drmContextPtr reserved;
int reserved_count;
if (pDRIPriv && pDRIPriv->directRenderingSupport) {
- if (pDRIPriv->wrap.AdjustFrame) {
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame;
- pDRIPriv->wrap.AdjustFrame = NULL;
+ pDRIInfo = pDRIPriv->pDriverInfo;
+
+ if (pDRIPriv->wrapped) {
+ /* Unwrap DRI Functions */
+ if (pDRIInfo->wrap.ValidateTree) {
+ pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree;
+ pDRIPriv->wrap.ValidateTree = NULL;
+ }
+ if (pDRIInfo->wrap.PostValidateTree) {
+ pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree;
+ pDRIPriv->wrap.PostValidateTree = NULL;
+ }
+ if (pDRIInfo->wrap.WindowExposures) {
+ pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures;
+ pDRIPriv->wrap.WindowExposures = NULL;
+ }
+ if (pDRIInfo->wrap.CopyWindow) {
+ pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow;
+ pDRIPriv->wrap.CopyWindow = NULL;
+ }
+ if (pDRIInfo->wrap.ClipNotify) {
+ pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify;
+ pDRIPriv->wrap.ClipNotify = NULL;
+ }
+ if (pDRIInfo->wrap.AdjustFrame) {
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame;
+ pDRIPriv->wrap.AdjustFrame = NULL;
+ }
+ pDRIPriv->wrapped = FALSE;
}
if (pDRIPriv->drmSIGIOHandlerInstalled) {
@@ -464,21 +492,19 @@ DRICloseScreen(ScreenPtr pScreen)
reserved_count, reserved_count > 1 ? "s" : "");
}
- if (pDRIPriv->grabbedDRILock) {
- DRIUnlock(pScreen);
- lockRefCount=0;
- }
-
+ /* Make sure signals get unblocked etc. */
+ drmUnlock(pDRIPriv->drmFD, pDRIPriv->myContext);
+ lockRefCount=0;
DRIDrvMsg(pScreen->myNum, X_INFO,
"[drm] unmapping %d bytes of SAREA 0x%08lx at %p\n",
- pDRIPriv->pDriverInfo->SAREASize,
+ pDRIInfo->SAREASize,
pDRIPriv->hSAREA,
pDRIPriv->pSAREA);
- if (drmUnmap(pDRIPriv->pSAREA, pDRIPriv->pDriverInfo->SAREASize)) {
+ if (drmUnmap(pDRIPriv->pSAREA, pDRIInfo->SAREASize)) {
DRIDrvMsg(pScreen->myNum, X_ERROR,
"[drm] unable to unmap %d bytes"
" of SAREA 0x%08lx at %p\n",
- pDRIPriv->pDriverInfo->SAREASize,
+ pDRIInfo->SAREASize,
pDRIPriv->hSAREA,
pDRIPriv->pSAREA);
}
@@ -852,14 +878,26 @@ DRIClipNotifyAllDrawables(ScreenPtr pScreen)
static void
DRITransitionToSharedBuffers(ScreenPtr pScreen)
{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
+
DRIClipNotifyAllDrawables( pScreen );
+
+ if (pDRIInfo->TransitionSingleToMulti3D)
+ pDRIInfo->TransitionSingleToMulti3D( pScreen );
}
static void
DRITransitionToPrivateBuffers(ScreenPtr pScreen)
{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
+
DRIClipNotifyAllDrawables( pScreen );
+
+ if (pDRIInfo->TransitionMultiToSingle3D)
+ pDRIInfo->TransitionMultiToSingle3D( pScreen );
}
@@ -869,6 +907,8 @@ DRITransitionTo3d(ScreenPtr pScreen)
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
+ DRIClipNotifyAllDrawables( pScreen );
+
if (pDRIInfo->TransitionTo3d)
pDRIInfo->TransitionTo3d( pScreen );
}
@@ -879,6 +919,8 @@ DRITransitionTo2d(ScreenPtr pScreen)
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
+ DRIClipNotifyAllDrawables( pScreen );
+
if (pDRIInfo->TransitionTo2d)
pDRIInfo->TransitionTo2d( pScreen );
}
@@ -979,6 +1021,10 @@ DRIDrawablePrivDelete(pointer pResource, XID id)
pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
if (pDRIDrawablePriv->drawableIndex != -1) {
+ /* bump stamp to force outstanding 3D requests to resync */
+ pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp
+ = DRIDrawableValidationStamp++;
+
/* release drawable table entry */
pDRIPriv->DRIDrawables[pDRIDrawablePriv->drawableIndex] = NULL;
}
@@ -1466,13 +1512,19 @@ DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg)
pDRIDrawablePriv->drawableIndex);
}
- pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures;
+ /* call lower wrapped functions */
+ if (pDRIPriv && pDRIPriv->wrap.WindowExposures) {
- (*pScreen->WindowExposures)(pWin, prgn, bsreg);
+ /* unwrap */
+ pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures;
- pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures;
- pScreen->WindowExposures = DRIWindowExposures;
+ /* call lower layers */
+ (*pScreen->WindowExposures)(pWin, prgn, bsreg);
+ /* rewrap */
+ pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures;
+ pScreen->WindowExposures = DRIWindowExposures;
+ }
}
@@ -1500,6 +1552,8 @@ DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
ScreenPtr pScreen = pWin->drawable.pScreen;
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ if(!pDRIPriv) return;
+
if(pDRIPriv->nrWindows > 0) {
RegionRec reg;
@@ -1519,15 +1573,18 @@ DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
REGION_UNINIT(pScreen, &reg);
}
- /* unwrap */
- pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow;
+ /* call lower wrapped functions */
+ if(pDRIPriv->wrap.CopyWindow) {
+ /* unwrap */
+ pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow;
- /* call lower layers */
- (*pScreen->CopyWindow)(pWin, ptOldOrg, prgnSrc);
+ /* call lower layers */
+ (*pScreen->CopyWindow)(pWin, ptOldOrg, prgnSrc);
- /* rewrap */
- pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow;
- pScreen->CopyWindow = DRICopyWindow;
+ /* rewrap */
+ pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow;
+ pScreen->CopyWindow = DRICopyWindow;
+ }
}
static void
@@ -1560,7 +1617,7 @@ static void
DRISpinLockTimeout(drmLock *lock, int val, unsigned long timeout /* in mS */)
{
int count = 10000;
-#ifndef __alpha__
+#if !defined(__alpha__) && !defined(__powerpc__)
char ret;
#else
int ret;
@@ -1595,6 +1652,8 @@ DRILockTree(ScreenPtr pScreen)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ if(!pDRIPriv) return;
+
/* Restore the last known 3D context if the X context is hidden */
if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
(*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
@@ -1612,7 +1671,7 @@ DRILockTree(ScreenPtr pScreen)
appropriate, since this should never time out except in the case of
client death while the lock is being held. The timeout must be
greater than any reasonable rendering time. */
- DRISpinLockTimeout(&pDRIPriv->pSAREA->drawable_lock, 1, 10000); /* 10 secs */
+ DRISpinLockTimeout(&pDRIPriv->pSAREA->drawable_lock, 1, 10000); /*10 secs*/
/* Call kernel flush outstanding buffers and relock */
DRILock(pScreen, DRM_LOCK_QUIESCENT|DRM_LOCK_FLUSH_ALL);
@@ -1641,7 +1700,10 @@ DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
{
ScreenPtr pScreen = pParent->drawable.pScreen;
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- int returnValue;
+
+ int returnValue = 1; /* always return 1, not checked by dix/window.c */
+
+ if(!pDRIPriv) return returnValue;
DRIWindowsTouched = FALSE;
@@ -1652,15 +1714,18 @@ DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
}
#endif
- /* unwrap */
- pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree;
+ /* call lower wrapped functions */
+ if(pDRIPriv->wrap.ValidateTree) {
+ /* unwrap */
+ pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree;
- /* call lower layers */
- returnValue = (*pScreen->ValidateTree)(pParent, pChild, kind);
+ /* call lower layers */
+ returnValue = (*pScreen->ValidateTree)(pParent, pChild, kind);
- /* rewrap */
- pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree;
- pScreen->ValidateTree = DRIValidateTree;
+ /* rewrap */
+ pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree;
+ pScreen->ValidateTree = DRIValidateTree;
+ }
return returnValue;
}
@@ -1676,7 +1741,7 @@ DRIPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
} else {
pScreen = pChild->drawable.pScreen;
}
- pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ if(!(pDRIPriv = DRI_SCREEN_PRIV(pScreen))) return;
if (pDRIPriv->wrap.PostValidateTree) {
/* unwrap */
@@ -1704,6 +1769,8 @@ DRIClipNotify(WindowPtr pWin, int dx, int dy)
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
DRIDrawablePrivPtr pDRIDrawablePriv;
+ if(!pDRIPriv) return;
+
if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
#ifndef DRI_BROKEN
@@ -1717,11 +1784,16 @@ DRIClipNotify(WindowPtr pWin, int dx, int dy)
= DRIDrawableValidationStamp++;
}
+ /* call lower wrapped functions */
if(pDRIPriv->wrap.ClipNotify) {
+
+ /* unwrap */
pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify;
+ /* call lower layers */
(*pScreen->ClipNotify)(pWin, dx, dy);
+ /* rewrap */
pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
pScreen->ClipNotify = DRIClipNotify;
}
@@ -1765,6 +1837,7 @@ void
DRILock(ScreenPtr pScreen, int flags)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ if(!pDRIPriv) return;
if (!lockRefCount)
DRM_LOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext, flags);
@@ -1775,6 +1848,7 @@ void
DRIUnlock(ScreenPtr pScreen)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ if(!pDRIPriv) return;
if (lockRefCount > 0) {
lockRefCount--;
@@ -1791,17 +1865,17 @@ void *
DRIGetSAREAPrivate(ScreenPtr pScreen)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- if (!pDRIPriv)
- return 0;
- return (void *)(((char*)pDRIPriv->pSAREA)+sizeof(XF86DRISAREARec));
+ if (!pDRIPriv) return 0;
+
+ return (void *)(((char*)pDRIPriv->pSAREA)+sizeof(XF86DRISAREARec));
}
drmContext
DRIGetContext(ScreenPtr pScreen)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- if (!pDRIPriv)
- return 0;
+ if (!pDRIPriv) return 0;
+
return pDRIPriv->myContext;
}
diff --git a/xc/programs/Xserver/GL/dri/dristruct.h b/xc/programs/Xserver/GL/dri/dristruct.h
index 106bd0a00..ba3b9704a 100644
--- a/xc/programs/Xserver/GL/dri/dristruct.h
+++ b/xc/programs/Xserver/GL/dri/dristruct.h
@@ -28,7 +28,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/*
* Authors:
- * Jens Owen <jens@precisioninsight.com>
+ * Jens Owen <jens@tungstengraphics.com>
*
*/
@@ -97,7 +97,8 @@ typedef struct _DRIScreenPrivRec
Bool createDummyCtx;
Bool createDummyCtxPriv;
Bool grabbedDRILock;
- Bool drmSIGIOHandlerInstalled;
+ Bool drmSIGIOHandlerInstalled;
+ Bool wrapped;
} DRIScreenPrivRec, *DRIScreenPrivPtr;
#endif /* DRI_STRUCT_H */
diff --git a/xc/programs/Xserver/GL/dri/xf86dri.c b/xc/programs/Xserver/GL/dri/xf86dri.c
index e7471f2db..c7cf37344 100644
--- a/xc/programs/Xserver/GL/dri/xf86dri.c
+++ b/xc/programs/Xserver/GL/dri/xf86dri.c
@@ -30,7 +30,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/*
* Authors:
* Kevin E. Martin <martin@valinux.com>
- * Jens Owen <jens@valinux.com>
+ * Jens Owen <jens@tungstengraphics.com>
* Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
@@ -155,6 +155,11 @@ ProcXF86DRIQueryDirectRenderingCapable(
REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
@@ -184,6 +189,10 @@ ProcXF86DRIOpenConnection(
REQUEST(xXF86DRIOpenConnectionReq);
REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
if (!DRIOpenConnection( screenInfo.screens[stuff->screen],
&hSAREA,
@@ -221,6 +230,10 @@ ProcXF86DRIAuthConnection(
REQUEST(xXF86DRIAuthConnectionReq);
REQUEST_SIZE_MATCH(xXF86DRIAuthConnectionReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
rep.type = X_Reply;
rep.length = 0;
@@ -242,6 +255,10 @@ ProcXF86DRICloseConnection(
{
REQUEST(xXF86DRICloseConnectionReq);
REQUEST_SIZE_MATCH(xXF86DRICloseConnectionReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
DRICloseConnection( screenInfo.screens[stuff->screen]);
@@ -258,6 +275,10 @@ ProcXF86DRIGetClientDriverName(
REQUEST(xXF86DRIGetClientDriverNameReq);
REQUEST_SIZE_MATCH(xXF86DRIGetClientDriverNameReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
DRIGetClientDriverName( screenInfo.screens[stuff->screen],
(int *)&rep.ddxDriverMajorVersion,
@@ -295,6 +316,11 @@ ProcXF86DRICreateContext(
REQUEST(xXF86DRICreateContextReq);
REQUEST_SIZE_MATCH(xXF86DRICreateContextReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
@@ -329,6 +355,10 @@ ProcXF86DRIDestroyContext(
{
REQUEST(xXF86DRIDestroyContextReq);
REQUEST_SIZE_MATCH(xXF86DRIDestroyContextReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
if (!DRIDestroyContext( screenInfo.screens[stuff->screen],
stuff->context)) {
@@ -348,6 +378,11 @@ ProcXF86DRICreateDrawable(
REQUEST(xXF86DRICreateDrawableReq);
REQUEST_SIZE_MATCH(xXF86DRICreateDrawableReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
@@ -378,6 +413,10 @@ ProcXF86DRIDestroyDrawable(
REQUEST(xXF86DRIDestroyDrawableReq);
DrawablePtr pDrawable;
REQUEST_SIZE_MATCH(xXF86DRIDestroyDrawableReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
(Drawable)stuff->drawable,
@@ -409,6 +448,11 @@ ProcXF86DRIGetDrawableInfo(
REQUEST(xXF86DRIGetDrawableInfoReq);
REQUEST_SIZE_MATCH(xXF86DRIGetDrawableInfoReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
@@ -483,6 +527,11 @@ ProcXF86DRIGetDeviceInfo(
REQUEST(xXF86DRIGetDeviceInfoReq);
REQUEST_SIZE_MATCH(xXF86DRIGetDeviceInfoReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
@@ -528,6 +577,11 @@ ProcXF86DRIOpenFullScreen (
DrawablePtr pDrawable;
REQUEST_SIZE_MATCH(xXF86DRIOpenFullScreenReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
@@ -554,6 +608,11 @@ ProcXF86DRICloseFullScreen (
DrawablePtr pDrawable;
REQUEST_SIZE_MATCH(xXF86DRICloseFullScreenReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
diff --git a/xc/programs/Xserver/GL/glx/g_disptab.c b/xc/programs/Xserver/GL/glx/g_disptab.c
index ee187330d..bf6014646 100644
--- a/xc/programs/Xserver/GL/glx/g_disptab.c
+++ b/xc/programs/Xserver/GL/glx/g_disptab.c
@@ -32,7 +32,7 @@
#include "glxserver.h"
#include "glxext.h"
#include "g_disptab.h"
-__GLXdispatchSingleProcPtr __glXSingleTable[] = {
+__GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
__glXNoSuchSingleOpcode,
__glXRender,
__glXRenderLarge,
@@ -409,10 +409,27 @@ __GLXdispatchRenderProcPtr __glXRenderTable[] = {
__glXDisp_MultiTexCoord4dvARB,
__glXDisp_MultiTexCoord4fvARB,
__glXDisp_MultiTexCoord4ivARB,
- __glXDisp_MultiTexCoord4svARB,
+ __glXDisp_MultiTexCoord4svARB, /* 213 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 220 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXDisp_WindowPos3fARB /* 230 */
};
-__GLXdispatchSingleProcPtr __glXSwapSingleTable[] = {
+__GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
__glXNoSuchSingleOpcode,
__glXSwapRender,
__glXSwapRenderLarge,
@@ -575,7 +592,7 @@ __GLXdispatchSingleProcPtr __glXSwapSingleTable[] = {
__glXDispSwap_GetMinmaxParameteriv,
};
-__GLXdispatchRenderProcPtr __glXSwapRenderTable[] = {
+__GLXdispatchRenderProcPtr __glXSwapRenderTable[__GLX_RENDER_TABLE_SIZE] = {
__glXNoSuchRenderOpcode,
__glXDispSwap_CallList,
__glXDispSwap_CallLists,
@@ -789,5 +806,22 @@ __GLXdispatchRenderProcPtr __glXSwapRenderTable[] = {
__glXDispSwap_MultiTexCoord4dvARB,
__glXDispSwap_MultiTexCoord4fvARB,
__glXDispSwap_MultiTexCoord4ivARB,
- __glXDispSwap_MultiTexCoord4svARB,
+ __glXDispSwap_MultiTexCoord4svARB, /* 213 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 220 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXDispSwap_WindowPos3fARB /* 230 */
};
diff --git a/xc/programs/Xserver/GL/glx/g_disptab.h b/xc/programs/Xserver/GL/glx/g_disptab.h
index a24f7a12a..91fd33f0d 100644
--- a/xc/programs/Xserver/GL/glx/g_disptab.h
+++ b/xc/programs/Xserver/GL/glx/g_disptab.h
@@ -323,6 +323,7 @@ extern void __glXDisp_MultiTexCoord4dvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord4fvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord4ivARB(GLbyte*);
extern void __glXDisp_MultiTexCoord4svARB(GLbyte*);
+extern void __glXDisp_WindowPos3fARB(GLbyte *);
extern int __glXSwapRender(__GLXclientState*, GLbyte*);
extern int __glXSwapRenderLarge(__GLXclientState*, GLbyte*);
@@ -616,15 +617,18 @@ extern void __glXDispSwap_MultiTexCoord4dvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord4fvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord4ivARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord4svARB(GLbyte*);
+extern void __glXDispSwap_WindowPos3fARB(GLbyte *);
#define __GLX_MIN_GLXCMD_OPCODE 1
#define __GLX_MAX_GLXCMD_OPCODE 20
#define __GLX_MIN_RENDER_OPCODE 1
-#define __GLX_MAX_RENDER_OPCODE 213
+/*#define __GLX_MAX_RENDER_OPCODE 213*/
+#define __GLX_MAX_RENDER_OPCODE 230
#define __GLX_MIN_SINGLE_OPCODE 1
#define __GLX_MAX_SINGLE_OPCODE 159
#define __GLX_SINGLE_TABLE_SIZE 160
-#define __GLX_RENDER_TABLE_SIZE 214
+/*#define __GLX_RENDER_TABLE_SIZE 214*/
+#define __GLX_RENDER_TABLE_SIZE 231
extern __GLXdispatchRenderProcPtr __glXRenderTable[__GLX_RENDER_TABLE_SIZE];
extern __GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE];
extern __GLXdispatchRenderProcPtr __glXSwapRenderTable[__GLX_RENDER_TABLE_SIZE];
diff --git a/xc/programs/Xserver/GL/glx/g_disptab_EXT.c b/xc/programs/Xserver/GL/glx/g_disptab_EXT.c
index e839afe4f..be82264a4 100644
--- a/xc/programs/Xserver/GL/glx/g_disptab_EXT.c
+++ b/xc/programs/Xserver/GL/glx/g_disptab_EXT.c
@@ -32,21 +32,25 @@
#include "glxserver.h"
#include "glxext.h"
#include "g_disptab_EXT.h"
-__GLXdispatchRenderProcPtr __glXRenderTable_EXT[] = {
- __glXDisp_ColorTable,
- __glXDisp_ColorTableParameterfv,
+__GLXdispatchRenderProcPtr __glXRenderTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN_RENDER_OPCODE_EXT + 1] = {
+ __glXDisp_ColorTable, /* 2053 */
+ __glXDisp_ColorTableParameterfv, /* 2054 */
__glXDisp_ColorTableParameteriv,
__glXDisp_CopyColorTable,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 2060 */
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
+ __glXDisp_PointParameterfARB, /* 2065 */
+ __glXDisp_PointParameterfvARB, /* 2066 */
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 2070 */
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
@@ -2072,15 +2076,11 @@ __GLXdispatchRenderProcPtr __glXRenderTable_EXT[] = {
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXDisp_BlendColor,
- __glXDisp_BlendEquation,
- __glXNoSuchRenderOpcode,
- __glXDisp_TexSubImage1D,
- __glXDisp_TexSubImage2D,
+ __glXDisp_BlendColor, /* 4096 */
+ __glXDisp_BlendEquation, /* 4097 */
+ __glXNoSuchRenderOpcode, /* 4098 */
+ __glXDisp_TexSubImage1D, /* 4099 */
+ __glXDisp_TexSubImage2D, /* 4100 */
__glXDisp_ConvolutionFilter1D,
__glXDisp_ConvolutionFilter2D,
__glXDisp_ConvolutionParameterf,
@@ -2090,7 +2090,7 @@ __GLXdispatchRenderProcPtr __glXRenderTable_EXT[] = {
__glXDisp_CopyConvolutionFilter1D,
__glXDisp_CopyConvolutionFilter2D,
__glXDisp_SeparableFilter2D,
- __glXDisp_Histogram,
+ __glXDisp_Histogram, /* 4110 */
__glXDisp_Minmax,
__glXDisp_ResetHistogram,
__glXDisp_ResetMinmax,
@@ -2100,38 +2100,135 @@ __GLXdispatchRenderProcPtr __glXRenderTable_EXT[] = {
__glXDisp_BindTexture,
__glXDisp_PrioritizeTextures,
__glXDisp_CopyTexImage1D,
- __glXDisp_CopyTexImage2D,
- __glXDisp_CopyTexSubImage1D,
- __glXDisp_CopyTexSubImage2D,
- __glXDisp_CopyTexSubImage3D,
+ __glXDisp_CopyTexImage2D, /* 4120 */
+ __glXDisp_CopyTexSubImage1D, /* 4121 */
+ __glXDisp_CopyTexSubImage2D, /* 4122 */
+ __glXDisp_CopyTexSubImage3D, /* 4123 */
+ __glXNoSuchRenderOpcode, /* 4124 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4130 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4140 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4150 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4160 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4170 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4180 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4190 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4200 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4210 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4219 */
+ __glXDisp_ActiveStencilFaceEXT, /* 4220 */
};
-__GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[] = {
- __glXDisp_AreTexturesResidentEXT,
- __glXDisp_DeleteTexturesEXT,
- __glXDisp_GenTexturesEXT,
- __glXDisp_IsTextureEXT,
+__GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[__GLX_MAX_VENDPRIV_OPCODE_EXT - __GLX_MIN_VENDPRIV_OPCODE_EXT + 1] = {
+ __glXDisp_AreTexturesResidentEXT, /* 11 */
+ __glXDisp_DeleteTexturesEXT, /* 12 */
+ __glXDisp_GenTexturesEXT, /* 13 */
+ __glXDisp_IsTextureEXT, /* 14 */
};
-__GLXdispatchRenderProcPtr __glXSwapRenderTable_EXT[] = {
- __glXDispSwap_ColorTable,
- __glXDispSwap_ColorTableParameterfv,
+__GLXdispatchRenderProcPtr __glXSwapRenderTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN_RENDER_OPCODE_EXT + 1] = {
+ __glXDispSwap_ColorTable, /* 2053 */
+ __glXDispSwap_ColorTableParameterfv, /* 2054 */
__glXDispSwap_ColorTableParameteriv,
__glXDispSwap_CopyColorTable,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 2060 */
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
+ __glXDispSwap_PointParameterfARB, /* 2065 */
+ __glXDispSwap_PointParameterfvARB, /* 2066 */
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 2070 */
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
@@ -4181,15 +4278,112 @@ __GLXdispatchRenderProcPtr __glXSwapRenderTable_EXT[] = {
__glXDispSwap_BindTexture,
__glXDispSwap_PrioritizeTextures,
__glXDispSwap_CopyTexImage1D,
- __glXDispSwap_CopyTexImage2D,
- __glXDispSwap_CopyTexSubImage1D,
- __glXDispSwap_CopyTexSubImage2D,
- __glXDispSwap_CopyTexSubImage3D,
+ __glXDispSwap_CopyTexImage2D, /* 4120 */
+ __glXDispSwap_CopyTexSubImage1D, /* 4121 */
+ __glXDispSwap_CopyTexSubImage2D, /* 4122 */
+ __glXDispSwap_CopyTexSubImage3D, /* 4123 */
+ __glXNoSuchRenderOpcode, /* 4124 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4130 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4140 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4150 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4160 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4170 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4180 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4190 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4200 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4210 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4219 */
+ __glXDispSwap_ActiveStencilFaceEXT, /* 4220 */
};
-__GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[] = {
- __glXDispSwap_AreTexturesResidentEXT,
- __glXDispSwap_DeleteTexturesEXT,
- __glXDispSwap_GenTexturesEXT,
- __glXDispSwap_IsTextureEXT,
+__GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[__GLX_MAX_VENDPRIV_OPCODE_EXT - __GLX_MIN_VENDPRIV_OPCODE_EXT + 1] = {
+ __glXDispSwap_AreTexturesResidentEXT, /* 11 */
+ __glXDispSwap_DeleteTexturesEXT, /* 12 */
+ __glXDispSwap_GenTexturesEXT, /* 13 */
+ __glXDispSwap_IsTextureEXT, /* 14 */
};
diff --git a/xc/programs/Xserver/GL/glx/g_disptab_EXT.h b/xc/programs/Xserver/GL/glx/g_disptab_EXT.h
index 193da6ea7..0d118c5c4 100644
--- a/xc/programs/Xserver/GL/glx/g_disptab_EXT.h
+++ b/xc/programs/Xserver/GL/glx/g_disptab_EXT.h
@@ -67,6 +67,9 @@ extern void __glXDisp_CopyTexImage2D(GLbyte*);
extern void __glXDisp_CopyTexSubImage1D(GLbyte*);
extern void __glXDisp_CopyTexSubImage2D(GLbyte*);
extern void __glXDisp_CopyTexSubImage3D(GLbyte*);
+extern void __glXDisp_PointParameterfARB(GLbyte*);
+extern void __glXDisp_PointParameterfvARB(GLbyte*);
+extern void __glXDisp_ActiveStencilFaceEXT(GLbyte*);
extern int __glXDispSwap_AreTexturesResidentEXT(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_DeleteTexturesEXT(__GLXclientState*, GLbyte*);
@@ -104,13 +107,16 @@ extern void __glXDispSwap_CopyTexImage2D(GLbyte*);
extern void __glXDispSwap_CopyTexSubImage1D(GLbyte*);
extern void __glXDispSwap_CopyTexSubImage2D(GLbyte*);
extern void __glXDispSwap_CopyTexSubImage3D(GLbyte*);
+extern void __glXDispSwap_PointParameterfARB(GLbyte*);
+extern void __glXDispSwap_PointParameterfvARB(GLbyte*);
+extern void __glXDispSwap_ActiveStencilFaceEXT(GLbyte*);
#define __GLX_MIN_RENDER_OPCODE_EXT 2053
-#define __GLX_MAX_RENDER_OPCODE_EXT 4123
+#define __GLX_MAX_RENDER_OPCODE_EXT 4220
#define __GLX_MIN_VENDPRIV_OPCODE_EXT 11
#define __GLX_MAX_VENDPRIV_OPCODE_EXT 14
-#define __GLX_VENDPRIV_TABLE_SIZE_EXT 4
-#define __GLX_RENDER_TABLE_SIZE_EXT 2071
+#define __GLX_VENDPRIV_TABLE_SIZE_EXT (__GLX_MAX_VENDPRIV_OPCODE_EXT - __GLX_MIN_VENDPRIV_OPCODE_EXT + 1)
+#define __GLX_RENDER_TABLE_SIZE_EXT (__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN_RENDER_OPCODE_EXT + 1)
extern __GLXdispatchRenderProcPtr __glXRenderTable_EXT[__GLX_RENDER_TABLE_SIZE_EXT];
extern __GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[__GLX_VENDPRIV_TABLE_SIZE_EXT];
extern __GLXdispatchRenderProcPtr __glXSwapRenderTable_EXT[__GLX_RENDER_TABLE_SIZE_EXT];
diff --git a/xc/programs/Xserver/GL/glx/g_render.c b/xc/programs/Xserver/GL/glx/g_render.c
index 52ecab5b1..35e083399 100644
--- a/xc/programs/Xserver/GL/glx/g_render.c
+++ b/xc/programs/Xserver/GL/glx/g_render.c
@@ -2075,3 +2075,40 @@ void __glXDisp_MultiTexCoord4svARB(GLbyte *pc)
);
}
+
+/*
+ * Extensions
+ */
+
+void __glXDisp_PointParameterfARB(GLbyte *pc)
+{
+ glPointParameterfARB(
+ *(GLenum *)(pc + 0),
+ *(GLfloat *)(pc + 4)
+ );
+}
+
+
+void __glXDisp_PointParameterfvARB(GLbyte *pc)
+{
+ glPointParameterfvARB(
+ *(GLenum *)(pc + 0),
+ (GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDisp_ActiveStencilFaceEXT(GLbyte *pc)
+{
+ glActiveStencilFaceEXT(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDisp_WindowPos3fARB(GLbyte *pc)
+{
+ glWindowPos3fARB(
+ *(GLfloat *)(pc + 0),
+ *(GLfloat *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
diff --git a/xc/programs/Xserver/GL/glx/g_renderswap.c b/xc/programs/Xserver/GL/glx/g_renderswap.c
index fa3f15d45..6a199d8c7 100644
--- a/xc/programs/Xserver/GL/glx/g_renderswap.c
+++ b/xc/programs/Xserver/GL/glx/g_renderswap.c
@@ -3306,3 +3306,61 @@ void __glXDispSwap_MultiTexCoord4svARB(GLbyte *pc)
);
}
+
+/*
+ * Extensions
+ */
+
+void __glXDispSwap_PointParameterfARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ glPointParameterfARB(
+ *(GLenum *)(pc + 0),
+ *(GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_PointParameterfvARB(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ pname = *(GLenum *)(pc + 0);
+ compsize = __glPointParameterfvARB_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_FLOAT_ARRAY(pc + 4, compsize);
+
+ glPointParameterfvARB(
+ *(GLenum *)(pc + 0),
+ (GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_ActiveStencilFaceEXT(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glActiveStencilFaceEXT(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_WindowPos3fARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+ glWindowPos3fARB(
+ *(GLfloat *)(pc + 0),
+ *(GLfloat *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
diff --git a/xc/programs/Xserver/GL/glx/glxcmds.c b/xc/programs/Xserver/GL/glx/glxcmds.c
index 476ff0e60..095791f25 100644
--- a/xc/programs/Xserver/GL/glx/glxcmds.c
+++ b/xc/programs/Xserver/GL/glx/glxcmds.c
@@ -515,7 +515,7 @@ int __glXMakeCurrent(__GLXclientState *cl, GLbyte *pc)
__glXCacheDrawableSize(glxPriv);
/* make the context current */
- if (!(*gc->exports.makeCurrent)((__GLcontext *)gc, &glxPriv->glPriv)) {
+ if (!(*gc->exports.makeCurrent)((__GLcontext *)gc)) {
glxc->glxPriv = NULL;
return __glXBadContext;
}
@@ -761,7 +761,7 @@ int __glXGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
int i, p;
screen = req->screen;
- if (screen > screenInfo.numScreens) {
+ if (screen >= screenInfo.numScreens) {
/* The client library must send a valid screen number. */
client->errorValue = screen;
return BadValue;
@@ -1466,7 +1466,7 @@ int __glXQueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
ClientPtr client = cl->client;
xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc;
xGLXQueryExtensionsStringReply reply;
- GLint screen;
+ GLuint screen;
size_t n, length;
const char *ptr;
char *buf;
@@ -1475,7 +1475,7 @@ int __glXQueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
/*
** Check if screen exists.
*/
- if ((screen < 0) || (screen >= screenInfo.numScreens)) {
+ if (screen >= screenInfo.numScreens) {
client->errorValue = screen;
return BadValue;
}
@@ -1511,7 +1511,7 @@ int __glXQueryServerString(__GLXclientState *cl, GLbyte *pc)
xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc;
xGLXQueryServerStringReply reply;
int name;
- GLint screen;
+ GLuint screen;
size_t n, length;
const char *ptr;
char *buf;
@@ -1521,7 +1521,7 @@ int __glXQueryServerString(__GLXclientState *cl, GLbyte *pc)
/*
** Check if screen exists.
*/
- if ((screen < 0) || (screen >= screenInfo.numScreens)) {
+ if (screen >= screenInfo.numScreens) {
client->errorValue = screen;
return BadValue;
}
diff --git a/xc/programs/Xserver/GL/glx/glxscreens.c b/xc/programs/Xserver/GL/glx/glxscreens.c
index a59df6ca9..d2ac595f4 100644
--- a/xc/programs/Xserver/GL/glx/glxscreens.c
+++ b/xc/programs/Xserver/GL/glx/glxscreens.c
@@ -47,18 +47,26 @@
#include "glxutil.h"
static char GLServerExtensions[] =
+ "GL_ARB_depth_texture "
"GL_ARB_imaging "
"GL_ARB_multitexture "
+ "GL_ARB_point_parameters "
+ "GL_ARB_shadow "
+ "GL_ARB_shadow_ambient "
"GL_ARB_texture_border_clamp "
"GL_ARB_texture_cube_map "
"GL_ARB_texture_env_add "
"GL_ARB_texture_env_combine "
+ "GL_ARB_texture_env_crossbar "
"GL_ARB_texture_env_dot3 "
+ "GL_ARB_texture_mirrored_repeat "
"GL_ARB_transpose_matrix "
+ "GL_ARB_window_pos "
"GL_EXT_abgr "
"GL_EXT_blend_color "
"GL_EXT_blend_minmax "
"GL_EXT_blend_subtract "
+ "GL_EXT_stencil_two_side "
"GL_EXT_texture_env_add "
"GL_EXT_texture_env_combine "
"GL_EXT_texture_env_dot3 "
@@ -94,6 +102,7 @@ GLint __glXNumActiveScreens;
RESTYPE __glXDrawableRes;
+#if 0
static int
CountBits(unsigned long mask)
{
@@ -106,6 +115,7 @@ CountBits(unsigned long mask)
return count;
}
+#endif
#if 0
/*
diff --git a/xc/programs/Xserver/GL/glx/glxserver.h b/xc/programs/Xserver/GL/glx/glxserver.h
index ad921511b..cfefd4096 100644
--- a/xc/programs/Xserver/GL/glx/glxserver.h
+++ b/xc/programs/Xserver/GL/glx/glxserver.h
@@ -279,4 +279,6 @@ extern int __glXConvolutionParameterfvSize(GLenum pname);
extern int __glXColorTableParameterfvSize(GLenum pname);
extern int __glXColorTableParameterivSize(GLenum pname);
+extern int __glXPointParameterfvARBReqSize(GLbyte *pc, Bool swap);
+
#endif /* !__GLX_server_h__ */
diff --git a/xc/programs/Xserver/GL/glx/impsize.h b/xc/programs/Xserver/GL/glx/impsize.h
index f4c2778f4..63fdcef20 100644
--- a/xc/programs/Xserver/GL/glx/impsize.h
+++ b/xc/programs/Xserver/GL/glx/impsize.h
@@ -67,4 +67,6 @@ extern int __glTexParameterfv_size(GLenum e);
extern int __glTexParameteriv_size(GLenum e);
extern int __glEvalComputeK(GLenum target);
+extern int __glPointParameterfvARB_size(GLenum pname);
+
#endif /* _impsize_h_ */
diff --git a/xc/programs/Xserver/GL/glx/rensize.c b/xc/programs/Xserver/GL/glx/rensize.c
index d93e8a206..5f2355a80 100644
--- a/xc/programs/Xserver/GL/glx/rensize.c
+++ b/xc/programs/Xserver/GL/glx/rensize.c
@@ -998,3 +998,12 @@ int __glXColorTableParameterivReqSize(GLbyte *pc, Bool swap )
/* no difference between fv and iv versions */
return __glXColorTableParameterfvReqSize(pc, swap);
}
+
+int __glXPointParameterfvARBReqSize(GLbyte *pc, Bool swap )
+{
+ GLenum pname = *(GLenum *)(pc + 0);
+ if (swap) {
+ pname = SWAPL( pname );
+ }
+ return 4 * __glPointParameterfvARB_size( pname );
+}
diff --git a/xc/programs/Xserver/GL/glx/rensizetab.c b/xc/programs/Xserver/GL/glx/rensizetab.c
index 71a96d25c..feaac9869 100644
--- a/xc/programs/Xserver/GL/glx/rensizetab.c
+++ b/xc/programs/Xserver/GL/glx/rensizetab.c
@@ -35,8 +35,9 @@
*/
#include "glxserver.h"
+#include "g_disptab_EXT.h"
-__GLXrenderSizeData __glXRenderSizeTable[] = {
+__GLXrenderSizeData __glXRenderSizeTable[__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN_RENDER_OPCODE_EXT + 1] = {
/* no such opcode */ { 0, 0 },
/* CallList */ { 8, 0 },
/* CallLists */ { 12, __glXCallListsReqSize },
@@ -232,2090 +233,2107 @@ __GLXrenderSizeData __glXRenderSizeTable[] = {
/* PolygonOffset */ { 12, 0 },
/* no such opcode */ { 0, 0 },
/* Indexubv */ { 8, 0 },
- /* ColorSubTable */ { 44, __glXColorSubTableReqSize },
- /* CopyColorSubTable */ { 24, 0 },
- /* ActiveTextureARB */ { 8, 0 },
- /* MultiTexCoord1dvARB */ { 16, 0 },
- /* MultiTexCoord1fvARB */ { 12, 0 },
- /* MultiTexCoord1ivARB */ { 12, 0 },
- /* MultiTexCoord1svARB */ { 12, 0 },
- /* MultiTexCoord2dvARB */ { 24, 0 },
- /* MultiTexCoord2fvARB */ { 16, 0 },
- /* MultiTexCoord2ivARB */ { 16, 0 },
- /* MultiTexCoord2svARB */ { 12, 0 },
- /* MultiTexCoord3dvARB */ { 32, 0 },
- /* MultiTexCoord3fvARB */ { 20, 0 },
- /* MultiTexCoord3ivARB */ { 20, 0 },
- /* MultiTexCoord3svARB */ { 16, 0 },
- /* MultiTexCoord4dvARB */ { 40, 0 },
- /* MultiTexCoord4fvARB */ { 24, 0 },
- /* MultiTexCoord4ivARB */ { 24, 0 },
- /* MultiTexCoord4svARB */ { 16, 0 },
+ /* ColorSubTable */ { 44, __glXColorSubTableReqSize },
+ /* CopyColorSubTable */ { 24, 0 },
+ /* ActiveTextureARB */ { 8, 0 },
+ /* MultiTexCoord1dvARB */ { 16, 0 },
+ /* MultiTexCoord1fvARB */ { 12, 0 },
+ /* MultiTexCoord1ivARB */ { 12, 0 },
+ /* MultiTexCoord1svARB */ { 12, 0 },
+ /* MultiTexCoord2dvARB */ { 24, 0 },
+ /* MultiTexCoord2fvARB */ { 16, 0 },
+ /* MultiTexCoord2ivARB */ { 16, 0 },
+ /* MultiTexCoord2svARB */ { 12, 0 },
+ /* MultiTexCoord3dvARB */ { 32, 0 },
+ /* MultiTexCoord3fvARB */ { 20, 0 },
+ /* MultiTexCoord3ivARB */ { 20, 0 },
+ /* MultiTexCoord3svARB */ { 16, 0 },
+ /* MultiTexCoord4dvARB */ { 40, 0 },
+ /* MultiTexCoord4fvARB */ { 24, 0 },
+ /* MultiTexCoord4ivARB */ { 24, 0 },
+ /* MultiTexCoord4svARB 213 */ { 16, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode 220 */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* WindowPos3fARB 230 */ { 16, 0 },
};
-__GLXrenderSizeData __glXRenderSizeTable_EXT[] = {
- /* ColorTable */ { 44, __glXColorTableReqSize },
- /* ColorTableParameterfv */ { 12, __glXColorTableParameterfvReqSize },
- /* ColorTableParameteriv */ { 12, __glXColorTableParameterivReqSize },
- /* CopyColorTable */ { 24, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* BlendColor */ { 20, 0 },
- /* BlendEquation */ { 8, 0 },
- /* no such opcode */ { 0, 0 },
- /* TexSubImage1D */ { 60, __glXTexSubImage1DReqSize },
- /* TexSubImage2D */ { 60, __glXTexSubImage2DReqSize },
- /* ConvolutionFilter1D */ { 48, __glXConvolutionFilter1DReqSize },
- /* ConvolutionFilter2D */ { 48, __glXConvolutionFilter2DReqSize },
- /* ConvolutionParameterf */ { 16, 0 },
- /* ConvolutionParameterfv */ { 12, __glXConvolutionParameterfvReqSize },
- /* ConvolutionParameteri */ { 16, 0 },
- /* ConvolutionParameteriv */ { 12, __glXConvolutionParameterivReqSize },
- /* CopyConvolutionFilter1D */ { 24, },
- /* CopyConvolutionFilter2D */ { 28, },
- /* SeparableFilter2D */ { 48, __glXSeparableFilter2DReqSize },
- /* Histogram */ { 20, },
- /* Minmax */ { 16, },
- /* ResetHistogram */ { 8, },
- /* ResetMinmax */ { 8, },
- /* TexImage3D */ { 84, __glXTexImage3DReqSize },
- /* TexSubImage3D */ { 92, __glXTexSubImage3DReqSize },
+__GLXrenderSizeData __glXRenderSizeTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN_RENDER_OPCODE_EXT + 1] = {
+ /* ColorTable 2053 */ { 44, __glXColorTableReqSize },
+ /* ColorTableParameterfv */ { 12, __glXColorTableParameterfvReqSize },
+ /* ColorTableParameteriv */ { 12, __glXColorTableParameterivReqSize },
+ /* CopyColorTable */ { 24, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* PointParameterfARB 2065 */ { 12, 0 },
+ /* PointParameterfvARB 2066 */ { 8, __glXPointParameterfvARBReqSize },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* BlendColor */ { 20, 0 },
+ /* BlendEquation */ { 8, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* TexSubImage1D */ { 60, __glXTexSubImage1DReqSize },
+ /* TexSubImage2D */ { 60, __glXTexSubImage2DReqSize },
+ /* ConvolutionFilter1D */ { 48, __glXConvolutionFilter1DReqSize },
+ /* ConvolutionFilter2D */ { 48, __glXConvolutionFilter2DReqSize },
+ /* ConvolutionParameterf */ { 16, 0 },
+ /* ConvolutionParameterfv */ { 12, __glXConvolutionParameterfvReqSize },
+ /* ConvolutionParameteri */ { 16, 0 },
+ /* ConvolutionParameteriv */ { 12, __glXConvolutionParameterivReqSize },
+ /* CopyConvolutionFilter1D */ { 24, },
+ /* CopyConvolutionFilter2D */ { 28, },
+ /* SeparableFilter2D */ { 48, __glXSeparableFilter2DReqSize },
+ /* Histogram */ { 20, },
+ /* Minmax */ { 16, },
+ /* ResetHistogram */ { 8, },
+ /* ResetMinmax */ { 8, },
+ /* TexImage3D */ { 84, __glXTexImage3DReqSize },
+ /* TexSubImage3D */ { 92, __glXTexSubImage3DReqSize },
/* DrawArrays */ { 16, __glXDrawArraysSize },
/* BindTexture */ { 12, 0 },
/* PrioritizeTextures */ { 8, __glXPrioritizeTexturesReqSize },
@@ -2323,5 +2341,102 @@ __GLXrenderSizeData __glXRenderSizeTable_EXT[] = {
/* CopyTexImage2D */ { 36, 0 },
/* CopyTexSubImage1D */ { 28, 0 },
/* CopyTexSubImage2D */ { 36, 0 },
- /* CopyTexSubImage3D */ { 40, 0 },
+ /* CopyTexSubImage3D 4123 */ { 40, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* ActiveStencilFaceEXT 4220 */ { 8, 0 },
};
diff --git a/xc/programs/Xserver/GL/glx/singlesize.c b/xc/programs/Xserver/GL/glx/singlesize.c
index 21652babd..0fbaa6292 100644
--- a/xc/programs/Xserver/GL/glx/singlesize.c
+++ b/xc/programs/Xserver/GL/glx/singlesize.c
@@ -225,6 +225,10 @@ GLint __glGetTexParameterfv_size(GLenum pname)
case GL_TEXTURE_BASE_LEVEL:
case GL_TEXTURE_MAX_LEVEL:
return 1;
+ case GL_TEXTURE_COMPARE_MODE_ARB: /* GL_ARB_shadow */
+ case GL_TEXTURE_COMPARE_FUNC_ARB: /* GL_ARB_shadow */
+ case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: /* GL_ARB_shadow_ambient */
+ return 1;
default:
return -1;
@@ -983,6 +987,7 @@ GLint __glGetTexImage_size(GLenum target, GLint level, GLenum format,
case GL_ALPHA:
case GL_LUMINANCE:
case GL_INTENSITY:
+ case GL_DEPTH_COMPONENT:
elements = 1;
break;
case GL_LUMINANCE_ALPHA:
diff --git a/xc/programs/Xserver/GL/glxmodule.c b/xc/programs/Xserver/GL/glxmodule.c
index 513bb7647..eb8e54f26 100644
--- a/xc/programs/Xserver/GL/glxmodule.c
+++ b/xc/programs/Xserver/GL/glxmodule.c
@@ -104,6 +104,7 @@ static const char *glcoreSymbols[] = {
"__glLightiv_size",
"__glMaterialfv_size",
"__glMaterialiv_size",
+ "__glPointParameterfvARB_size",
"__glReadPixels_size",
"__glTexEnvfv_size",
"__glTexEnviv_size",
@@ -146,6 +147,7 @@ static const char *glcoreSymbols[] = {
"__glXDestroyContext",
"__glXDestroyGLXPixmap",
"__glXDispSwap_Accum",
+ "__glXDispSwap_ActiveStencilFaceEXT",
"__glXDispSwap_ActiveTextureARB",
"__glXDispSwap_AlphaFunc",
"__glXDispSwap_AreTexturesResident",
@@ -357,6 +359,8 @@ static const char *glcoreSymbols[] = {
"__glXDispSwap_PixelTransferf",
"__glXDispSwap_PixelTransferi",
"__glXDispSwap_PixelZoom",
+ "__glXDispSwap_PointParameterfARB",
+ "__glXDispSwap_PointParameterfvARB",
"__glXDispSwap_PointSize",
"__glXDispSwap_PolygonMode",
"__glXDispSwap_PolygonOffset",
@@ -451,7 +455,9 @@ static const char *glcoreSymbols[] = {
"__glXDispSwap_Vertex4iv",
"__glXDispSwap_Vertex4sv",
"__glXDispSwap_Viewport",
+ "__glXDispSwap_WindowPos3fARB",
"__glXDisp_Accum",
+ "__glXDisp_ActiveStencilFaceEXT",
"__glXDisp_ActiveTextureARB",
"__glXDisp_AlphaFunc",
"__glXDisp_AreTexturesResident",
@@ -663,6 +669,8 @@ static const char *glcoreSymbols[] = {
"__glXDisp_PixelTransferf",
"__glXDisp_PixelTransferi",
"__glXDisp_PixelZoom",
+ "__glXDisp_PointParameterfARB",
+ "__glXDisp_PointParameterfvARB",
"__glXDisp_PointSize",
"__glXDisp_PolygonMode",
"__glXDisp_PolygonOffset",
@@ -757,6 +765,7 @@ static const char *glcoreSymbols[] = {
"__glXDisp_Vertex4iv",
"__glXDisp_Vertex4sv",
"__glXDisp_Viewport",
+ "__glXDisp_WindowPos3fARB",
"__glXDrawArraysSize",
"__glXDrawPixelsReqSize",
"__glXDrawableRes",
@@ -886,6 +895,7 @@ static const char *glcoreSymbols[] = {
"__glXWaitX",
"__glXcombine_strings",
"glAccum",
+ "glActiveStencilFaceEXT",
"glActiveTextureARB",
"glAlphaFunc",
"glAreTexturesResident",
@@ -1102,6 +1112,8 @@ static const char *glcoreSymbols[] = {
"glPixelTransferf",
"glPixelTransferi",
"glPixelZoom",
+ "glPointParameterfARB",
+ "glPointParameterfvARB",
"glPointSize",
"glPolygonMode",
"glPolygonOffset",
@@ -1198,6 +1210,7 @@ static const char *glcoreSymbols[] = {
"glVertex4sv",
"glVertexPointer",
"glViewport",
+ "glWindowPos3fARB",
"glxSwapQueryExtensionsStringReply",
"glxSwapQueryServerStringReply",
NULL
diff --git a/xc/programs/Xserver/GL/mesa/src/X/xf86glx.c b/xc/programs/Xserver/GL/mesa/src/X/xf86glx.c
index 2f3a3a46b..e55cb0532 100644
--- a/xc/programs/Xserver/GL/mesa/src/X/xf86glx.c
+++ b/xc/programs/Xserver/GL/mesa/src/X/xf86glx.c
@@ -47,6 +47,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <glxext.h>
#include <glxutil.h>
#include "xf86glxint.h"
+#include "context.h"
#include "xmesaP.h"
#include <GL/xf86glx.h>
#include "context.h"
@@ -135,13 +136,15 @@ static XMesaVisual find_mesa_visual(int screen, VisualID vid)
/*
- * In the case the driver has no GLX visuals we'll use these.
- * [0] = RGB, double buffered
- * [1] = RGB, double buffered, stencil, accum
- * [2] = CI, double buffered
+ * In the case the driver defines no GLX visuals we'll use these.
+ * One thing is funny here: the bufferSize field doesn't always include
+ * the alpha bits. That is, bufferSize may be 24 when we have 8 bits
+ * of red, green, blue and alpha. If set set bufferSize to 32 we may
+ * foul-up the visual matching code below (search for bufferSize).
*/
-#define NUM_FALLBACK_CONFIGS 3
+#define NUM_FALLBACK_CONFIGS 5
static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = {
+ /* [0] = RGB, double buffered, Z */
{
-1, /* vid */
-1, /* class */
@@ -161,6 +164,7 @@ static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = {
0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
0 /* transparentIndex */
},
+ /* [1] = RGB, double buffered, Z, stencil, accum */
{
-1, /* vid */
-1, /* class */
@@ -180,10 +184,51 @@ static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = {
0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
0 /* transparentIndex */
},
+ /* [2] = RGB+Alpha, double buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 8, /* rgba sizes */
+ -1, -1, -1, -1, /* rgba masks */
+ 16, 16, 16, 16, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE_EXT, /* visualRating */
+ 0, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [3] = RGB+Alpha, single buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 8, /* rgba sizes */
+ -1, -1, -1, -1, /* rgba masks */
+ 16, 16, 16, 16, /* rgba accum sizes */
+ False, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE_EXT, /* visualRating */
+ 0, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [4] = CI, double buffered, Z */
{
-1, /* vid */
-1, /* class */
- False, /* color index */
+ False, /* rgba? (false = color index) */
-1, -1, -1, 0, /* rgba sizes */
-1, -1, -1, 0, /* rgba masks */
0, 0, 0, 0, /* rgba accum sizes */
@@ -729,9 +774,8 @@ GLboolean __MESA_loseCurrent(__GLcontext *gc)
return XMesaLoseCurrent(xmesa);
}
-GLboolean __MESA_makeCurrent(__GLcontext *gc, __GLdrawablePrivate *oldglPriv)
+GLboolean __MESA_makeCurrent(__GLcontext *gc)
{
- /* We don't use oldglPriv - kept for backwards compatibility */
__GLdrawablePrivate *glPriv = gc->imports.getDrawablePrivate( gc );
__MESA_buffer buf = (__MESA_buffer)glPriv->private;
XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
@@ -780,9 +824,7 @@ void __MESA_notifyDestroy(__GLcontext *gc)
void __MESA_notifySwapBuffers(__GLcontext *gc)
{
- /* NOT_DONE */
- ErrorF("__MESA_notifySwapBuffers\n");
- return;
+ _mesa_notifySwapBuffers(gc);
}
struct __GLdispatchStateRec *__MESA_dispatchExec(__GLcontext *gc)
@@ -806,6 +848,12 @@ void __MESA_endDispatchOverride(__GLcontext *gc)
return;
}
+
+/*
+ * Server-side GLX uses these functions which are normally defined
+ * in the OpenGL SI.
+ */
+
GLint __glEvalComputeK(GLenum target)
{
switch (target) {
diff --git a/xc/programs/Xserver/GL/mesa/src/X/xf86glxint.h b/xc/programs/Xserver/GL/mesa/src/X/xf86glxint.h
index 556b0fcbf..47c8e7608 100644
--- a/xc/programs/Xserver/GL/mesa/src/X/xf86glxint.h
+++ b/xc/programs/Xserver/GL/mesa/src/X/xf86glxint.h
@@ -85,7 +85,7 @@ extern __GLinterface *__MESA_createContext(__GLimports *imports,
__GLinterface *shareGC);
extern GLboolean __MESA_destroyContext(__GLcontext *gc);
extern GLboolean __MESA_loseCurrent(__GLcontext *gc);
-extern GLboolean __MESA_makeCurrent(__GLcontext *gc, __GLdrawablePrivate *oldglPriv);
+extern GLboolean __MESA_makeCurrent(__GLcontext *gc);
extern GLboolean __MESA_shareContext(__GLcontext *gc, __GLcontext *gcShare);
extern GLboolean __MESA_copyContext(__GLcontext *dst, const __GLcontext *src,
GLuint mask);
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Dutch.lproj/InfoPlist.strings.cpp b/xc/programs/Xserver/hw/darwin/bundle/Dutch.lproj/InfoPlist.strings.cpp
deleted file mode 100644
index ec29fc81a..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/Dutch.lproj/InfoPlist.strings.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Dutch localized versions of Info.plist keys. */
-/* Most of these are set in the target application settings. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Dutch.lproj/InfoPlist.strings.cpp,v 1.1 2001/11/15 07:36:23 torrey Exp $ */
-
-NSHumanReadableCopyright = __quote__XFree86 XF86_VERSION\nCopyright 2001 XFree86 Project, Inc.__quote__
diff --git a/xc/programs/Xserver/hw/darwin/bundle/French.lproj/InfoPlist.strings.cpp b/xc/programs/Xserver/hw/darwin/bundle/French.lproj/InfoPlist.strings.cpp
deleted file mode 100644
index b3b1e06c6..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/French.lproj/InfoPlist.strings.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-/* French localized versions of Info.plist keys. */
-/* Most of these are set in the target application settings. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/French.lproj/InfoPlist.strings.cpp,v 1.2 2001/11/04 07:09:48 torrey Exp $ */
-
-NSHumanReadableCopyright = __quote__XFree86 XF86_VERSION\nCopyright 2001 XFree86 Project, Inc.__quote__
diff --git a/xc/programs/Xserver/hw/darwin/bundle/German.lproj/InfoPlist.strings.cpp b/xc/programs/Xserver/hw/darwin/bundle/German.lproj/InfoPlist.strings.cpp
deleted file mode 100644
index 933f1065c..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/German.lproj/InfoPlist.strings.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-/* German localized versions of Info.plist keys. */
-/* Most of these are set in the target application settings. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/German.lproj/InfoPlist.strings.cpp,v 1.2 2001/11/04 07:09:48 torrey Exp $ */
-
-NSHumanReadableCopyright = __quote__XFree86 XF86_VERSION\nCopyright 2001 XFree86 Project, Inc.__quote__
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/InfoPlist.strings.cpp b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/InfoPlist.strings.cpp
deleted file mode 100644
index 02d42eb94..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/InfoPlist.strings.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Japanese localized versions of Info.plist keys. */
-/* Most of these are set in the target application settings. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/InfoPlist.strings.cpp,v 1.2 2001/11/04 07:09:48 torrey Exp $ */
-
-NSHumanReadableCopyright = __quote__XFree86 XF86_VERSION\nCopyright 2001 XFree86 Project, Inc.__quote__
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Preferences.h b/xc/programs/Xserver/hw/darwin/bundle/Preferences.h
deleted file mode 100644
index 1f3d5a110..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/Preferences.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Preferences.h,v 1.10 2001/10/14 03:02:18 torrey Exp $ */
-
-#import <Cocoa/Cocoa.h>
-
-@interface Preferences : NSObject
-{
- IBOutlet NSPanel *window;
- IBOutlet id displayField;
- IBOutlet id dockSwitchButton;
- IBOutlet id fakeButton;
- IBOutlet id button2ModifiersMatrix;
- IBOutlet id button3ModifiersMatrix;
- IBOutlet id switchKeyButton;
- IBOutlet id keymapFileField;
- IBOutlet id modeMatrix;
- IBOutlet id modeWindowButton;
- IBOutlet id startupHelpButton;
- IBOutlet id systemBeepButton;
- IBOutlet id mouseAccelChangeButton;
- IBOutlet id useXineramaButton;
- IBOutlet id addToPathButton;
- IBOutlet id addToPathField;
- IBOutlet id useDefaultShellMatrix;
- IBOutlet id useOtherShellField;
- IBOutlet id depthButton;
-
- BOOL isGettingKeyCode;
- int keyCode;
- int modifiers;
- NSMutableString *switchString;
-}
-
-- (IBAction)close:(id)sender;
-- (IBAction)pickFile:(id)sender;
-- (IBAction)saveChanges:(id)sender;
-- (IBAction)setKey:(id)sender;
-
-- (BOOL)sendEvent:(NSEvent*)anEvent;
-
-- (void)awakeFromNib;
-- (void)windowWillClose:(NSNotification *)aNotification;
-
-+ (void)setUseKeymapFile:(BOOL)newUseKeymapFile;
-+ (void)setKeymapFile:(NSString*)newFile;
-+ (void)setSwitchString:(NSString*)newString;
-+ (void)setKeyCode:(int)newKeyCode;
-+ (void)setModifiers:(int)newModifiers;
-+ (void)setDisplay:(int)newDisplay;
-+ (void)setDockSwitch:(BOOL)newDockSwitch;
-+ (void)setFakeButtons:(BOOL)newFakeButtons;
-+ (void)setButton2Mask:(int)newFakeMask;
-+ (void)setButton3Mask:(int)newFakeMask;
-+ (void)setMouseAccelChange:(BOOL)newMouseAccelChange;
-+ (void)setUseQDCursor:(int)newUseQDCursor;
-+ (void)setRootless:(BOOL)newRootless;
-+ (void)setModeWindow:(BOOL)newModeWindow;
-+ (void)setStartupHelp:(BOOL)newStartupHelp;
-+ (void)setSystemBeep:(BOOL)newSystemBeep;
-+ (void)setXinerama:(BOOL)newXinerama;
-+ (void)setAddToPath:(BOOL)newAddToPath;
-+ (void)setAddToPathString:(NSString*)newAddToPathString;
-+ (void)setUseDefaultShell:(BOOL)newUseDefaultShell;
-+ (void)setShellString:(NSString*)newShellString;
-+ (void)setDepth:(int)newDepth;
-+ (void)saveToDisk;
-
-+ (BOOL)useKeymapFile;
-+ (NSString*)keymapFile;
-+ (NSString*)switchString;
-+ (unsigned int)keyCode;
-+ (unsigned int)modifiers;
-+ (int)display;
-+ (BOOL)dockSwitch;
-+ (BOOL)fakeButtons;
-+ (int)button2Mask;
-+ (int)button3Mask;
-+ (BOOL)mouseAccelChange;
-+ (int)useQDCursor;
-+ (BOOL)rootless;
-+ (BOOL)modeWindow;
-+ (BOOL)startupHelp;
-+ (BOOL)systemBeep;
-+ (BOOL)xinerama;
-+ (BOOL)addToPath;
-+ (NSString*)addToPathString;
-+ (BOOL)useDefaultShell;
-+ (NSString*)shellString;
-+ (int)depth;
-
-@end
-
-// Possible settings for useQDCursor
-enum {
- qdCursor_Never, // never use QuickDraw cursor
- qdCursor_Not8Bit, // don't try to use QuickDraw with 8-bit depth
- qdCursor_Always // always try to use QuickDraw cursor
-};
-
-// Possible settings for depth
-enum {
- depth_Current,
- depth_8Bit,
- depth_15Bit,
- depth_24Bit
-};
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Preferences.m b/xc/programs/Xserver/hw/darwin/bundle/Preferences.m
deleted file mode 100644
index f9ff40b77..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/Preferences.m
+++ /dev/null
@@ -1,517 +0,0 @@
-//
-// Preferences.m
-//
-// This class keeps track of the user preferences.
-//
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Preferences.m,v 1.13 2001/10/14 03:02:18 torrey Exp $ */
-
-#import "Preferences.h"
-#import "quartzCommon.h"
-#include <IOKit/hidsystem/IOLLEvent.h> // for modifier masks
-
-// Macros to build the path name
-#ifndef XBINDIR
-#define XBINDIR /usr/X11R6/bin
-#endif
-#define STR(s) #s
-#define XSTRPATH(s) STR(s)
-
-
-@implementation Preferences
-
-+ (void)initialize
-{
- // Provide user defaults if needed
- NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithInt:0], @"Display",
- @"YES", @"FakeButtons",
- [NSNumber numberWithInt:NX_COMMANDMASK], @"Button2Mask",
- [NSNumber numberWithInt:NX_ALTERNATEMASK], @"Button3Mask",
- @"USA.keymapping", @"KeymappingFile",
- @"YES", @"UseKeymappingFile",
- @"Cmd-Opt-a", @"SwitchString",
- @"NO", @"UseRootlessMode",
- @"YES", @"ShowModePickWindow",
- @"YES", @"ShowStartupHelp",
- [NSNumber numberWithInt:0], @"SwitchKeyCode",
- [NSNumber numberWithInt:(NSCommandKeyMask | NSAlternateKeyMask)],
- @"SwitchModifiers", @"NO", @"UseSystemBeep",
- @"YES", @"DockSwitch",
- @"NO", @"AllowMouseAccelChange",
- [NSNumber numberWithInt:qdCursor_Not8Bit], @"UseQDCursor",
- @"YES", @"Xinerama",
- @"YES", @"AddToPath",
- [NSString stringWithCString:XSTRPATH(XBINDIR)], @"AddToPathString",
- @"YES", @"UseDefaultShell",
- @"/bin/tcsh", @"Shell",
- [NSNumber numberWithInt:depth_Current], @"Depth", nil];
-
- [super initialize];
- [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
-}
-
-// Initialize internal state info of switch key button
-- (void)initSwitchKey
-{
- keyCode = [Preferences keyCode];
- modifiers = [Preferences modifiers];
- [switchString setString:[Preferences switchString]];
-}
-
-- (id)init
-{
- self = [super init];
-
- isGettingKeyCode=NO;
- switchString=[[NSMutableString alloc] init];
- [self initSwitchKey];
-
- return self;
-}
-
-// Set a modifiers checkbox matrix to match a modifier mask
-- (void)resetMatrix:(NSMatrix *)aMatrix withMask:(int)aMask
-{
- [aMatrix setState:(aMask & NX_SHIFTMASK) atRow:0 column:0];
- [aMatrix setState:(aMask & NX_CONTROLMASK) atRow:1 column:0];
- [aMatrix setState:(aMask & NX_COMMANDMASK) atRow:2 column:0];
- [aMatrix setState:(aMask & NX_ALTERNATEMASK) atRow:3 column:0];
- [aMatrix setState:(aMask & NX_SECONDARYFNMASK) atRow:4 column:0];
-}
-
-// Generate a modifiers mask from a modifiers checkbox matrix
-- (int)getMaskFromMatrix:(NSMatrix *)aMatrix
-{
- int theMask = 0;
-
- if ([[aMatrix cellAtRow:0 column:0] state])
- theMask |= NX_SHIFTMASK;
- if ([[aMatrix cellAtRow:1 column:0] state])
- theMask |= NX_CONTROLMASK;
- if ([[aMatrix cellAtRow:2 column:0] state])
- theMask |= NX_COMMANDMASK;
- if ([[aMatrix cellAtRow:3 column:0] state])
- theMask |= NX_ALTERNATEMASK;
- if ([[aMatrix cellAtRow:4 column:0] state])
- theMask |= NX_SECONDARYFNMASK;
-
- return theMask;
-}
-
-// Set the window controls to the state in user defaults
-- (void)resetWindow
-{
- if ([Preferences keymapFile] == nil)
- [keymapFileField setStringValue:@" "];
- else
- [keymapFileField setStringValue:[Preferences keymapFile]];
-
- if ([Preferences switchString] == nil)
- [switchKeyButton setTitle:@"--"];
- else
- [switchKeyButton setTitle:[Preferences switchString]];
-
- [displayField setIntValue:[Preferences display]];
- [dockSwitchButton setIntValue:[Preferences dockSwitch]];
- [fakeButton setIntValue:[Preferences fakeButtons]];
- [self resetMatrix:button2ModifiersMatrix
- withMask:[Preferences button2Mask]];
- [self resetMatrix:button3ModifiersMatrix
- withMask:[Preferences button3Mask]];
- [modeMatrix setState:[Preferences rootless] atRow:0 column:1];
- [startupHelpButton setIntValue:[Preferences startupHelp]];
- [modeWindowButton setIntValue:[Preferences modeWindow]];
- [systemBeepButton setIntValue:[Preferences systemBeep]];
- [mouseAccelChangeButton setIntValue:[Preferences mouseAccelChange]];
- [useXineramaButton setIntValue:[Preferences xinerama]];
- [addToPathButton setIntValue:[Preferences addToPath]];
- [addToPathField setStringValue:[Preferences addToPathString]];
- [useDefaultShellMatrix setState:![Preferences useDefaultShell]
- atRow:1 column:0];
- [useOtherShellField setStringValue:[Preferences shellString]];
- [depthButton selectItemAtIndex:[Preferences depth]];
-}
-
-- (void)awakeFromNib
-{
- [self resetWindow];
-}
-
-// Preference window delegate
-- (void)windowWillClose:(NSNotification *)aNotification
-{
- [self resetWindow];
- [self initSwitchKey];
-}
-
-// User cancelled the changes
-- (IBAction)close:(id)sender
-{
- [window orderOut:nil];
- [self resetWindow]; // reset window controls
- [self initSwitchKey]; // reset switch key state
-}
-
-// Pick keymapping file
-- (IBAction)pickFile:(id)sender
-{
- int result;
- NSArray *fileTypes = [NSArray arrayWithObject:@"keymapping"];
- NSOpenPanel *oPanel = [NSOpenPanel openPanel];
-
- [oPanel setAllowsMultipleSelection:NO];
- result = [oPanel runModalForDirectory:@"/System/Library/Keyboards"
- file:nil types:fileTypes];
- if (result == NSOKButton) {
- [keymapFileField setStringValue:[oPanel filename]];
- }
-}
-
-// User saved changes
-- (IBAction)saveChanges:(id)sender
-{
- [Preferences setKeyCode:keyCode];
- [Preferences setModifiers:modifiers];
- [Preferences setSwitchString:switchString];
- [Preferences setKeymapFile:[keymapFileField stringValue]];
- [Preferences setUseKeymapFile:YES];
- [Preferences setDisplay:[displayField intValue]];
- [Preferences setDockSwitch:[dockSwitchButton intValue]];
- [Preferences setFakeButtons:[fakeButton intValue]];
- [Preferences setButton2Mask:
- [self getMaskFromMatrix:button2ModifiersMatrix]];
- [Preferences setButton3Mask:
- [self getMaskFromMatrix:button3ModifiersMatrix]];
- [Preferences setRootless:[[modeMatrix cellAtRow:0 column:1] state]];
- [Preferences setModeWindow:[modeWindowButton intValue]];
- [Preferences setStartupHelp:[startupHelpButton intValue]];
- [Preferences setSystemBeep:[systemBeepButton intValue]];
- [Preferences setMouseAccelChange:[mouseAccelChangeButton intValue]];
- [Preferences setXinerama:[useXineramaButton intValue]];
- [Preferences setAddToPath:[addToPathButton intValue]];
- [Preferences setAddToPathString:[addToPathField stringValue]];
- [Preferences setUseDefaultShell:
- [[useDefaultShellMatrix cellAtRow:0 column:0] state]];
- [Preferences setShellString:[useOtherShellField stringValue]];
- [Preferences setDepth:[depthButton indexOfSelectedItem]];
- [Preferences saveToDisk];
-
- [window orderOut:nil];
-}
-
-- (IBAction)setKey:(id)sender
-{
- [switchKeyButton setTitle:@"Press key"];
- isGettingKeyCode=YES;
- [switchString setString:@""];
-}
-
-- (BOOL)sendEvent:(NSEvent*)anEvent
-{
- if(isGettingKeyCode) {
- if([anEvent type]==NSKeyDown) //wait for keyup
- return YES;
- if([anEvent type]!=NSKeyUp)
- return NO;
-
- if([anEvent modifierFlags] & NSCommandKeyMask)
- [switchString appendString:@"Cmd-"];
- if([anEvent modifierFlags] & NSControlKeyMask)
- [switchString appendString:@"Ctrl-"];
- if([anEvent modifierFlags] & NSAlternateKeyMask)
- [switchString appendString:@"Opt-"];
- if([anEvent modifierFlags] & NSNumericPadKeyMask) // doesn't work
- [switchString appendString:@"Num-"];
- if([anEvent modifierFlags] & NSHelpKeyMask)
- [switchString appendString:@"Help-"];
- if([anEvent modifierFlags] & NSFunctionKeyMask) // powerbooks only
- [switchString appendString:@"Fn-"];
-
- [switchString appendString:[anEvent charactersIgnoringModifiers]];
- [switchKeyButton setTitle:switchString];
-
- keyCode = [anEvent keyCode];
- modifiers = [anEvent modifierFlags];
- isGettingKeyCode=NO;
-
- return YES;
- }
- return NO;
-}
-
-+ (void)setKeymapFile:(NSString*)newFile
-{
- [[NSUserDefaults standardUserDefaults] setObject:newFile
- forKey:@"KeymappingFile"];
-}
-
-+ (void)setUseKeymapFile:(BOOL)newUseKeymapFile
-{
- [[NSUserDefaults standardUserDefaults] setBool:newUseKeymapFile
- forKey:@"UseKeymappingFile"];
-}
-
-+ (void)setSwitchString:(NSString*)newString
-{
- [[NSUserDefaults standardUserDefaults] setObject:newString
- forKey:@"SwitchString"];
-}
-
-+ (void)setKeyCode:(int)newKeyCode
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newKeyCode
- forKey:@"SwitchKeyCode"];
-}
-
-+ (void)setModifiers:(int)newModifiers
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newModifiers
- forKey:@"SwitchModifiers"];
-}
-
-+ (void)setDisplay:(int)newDisplay
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newDisplay
- forKey:@"Display"];
-}
-
-+ (void)setDockSwitch:(BOOL)newDockSwitch
-{
- [[NSUserDefaults standardUserDefaults] setBool:newDockSwitch
- forKey:@"DockSwitch"];
-}
-
-+ (void)setFakeButtons:(BOOL)newFakeButtons
-{
- [[NSUserDefaults standardUserDefaults] setBool:newFakeButtons
- forKey:@"FakeButtons"];
- // Update the setting used by the X server thread
- darwinFakeButtons = newFakeButtons;
-}
-
-+ (void)setButton2Mask:(int)newFakeMask
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newFakeMask
- forKey:@"Button2Mask"];
- // Update the setting used by the X server thread
- darwinFakeMouse2Mask = newFakeMask;
-}
-
-+ (void)setButton3Mask:(int)newFakeMask
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newFakeMask
- forKey:@"Button3Mask"];
- // Update the setting used by the X server thread
- darwinFakeMouse3Mask = newFakeMask;
-}
-
-+ (void)setMouseAccelChange:(BOOL)newMouseAccelChange
-{
- [[NSUserDefaults standardUserDefaults] setBool:newMouseAccelChange
- forKey:@"AllowMouseAccelChange"];
- // Update the setting used by the X server thread
- quartzMouseAccelChange = newMouseAccelChange;
-}
-
-+ (void)setUseQDCursor:(int)newUseQDCursor
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newUseQDCursor
- forKey:@"UseQDCursor"];
-}
-
-+ (void)setModeWindow:(BOOL)newModeWindow
-{
- [[NSUserDefaults standardUserDefaults] setBool:newModeWindow
- forKey:@"ShowModePickWindow"];
-}
-
-+ (void)setRootless:(BOOL)newRootless
-{
- [[NSUserDefaults standardUserDefaults] setBool:newRootless
- forKey:@"UseRootlessMode"];
-}
-
-+ (void)setStartupHelp:(BOOL)newStartupHelp
-{
- [[NSUserDefaults standardUserDefaults] setBool:newStartupHelp
- forKey:@"ShowStartupHelp"];
-}
-
-+ (void)setSystemBeep:(BOOL)newSystemBeep
-{
- [[NSUserDefaults standardUserDefaults] setBool:newSystemBeep
- forKey:@"UseSystemBeep"];
- // Update the setting used by the X server thread
- quartzUseSysBeep = newSystemBeep;
-}
-
-+ (void)setXinerama:(BOOL)newXinerama
-{
- [[NSUserDefaults standardUserDefaults] setBool:newXinerama
- forKey:@"Xinerama"];
-}
-
-+ (void)setAddToPath:(BOOL)newAddToPath
-{
- [[NSUserDefaults standardUserDefaults] setBool:newAddToPath
- forKey:@"AddToPath"];
-}
-
-+ (void)setAddToPathString:(NSString*)newAddToPathString
-{
- [[NSUserDefaults standardUserDefaults] setObject:newAddToPathString
- forKey:@"AddToPathString"];
-}
-
-+ (void)setUseDefaultShell:(BOOL)newUseDefaultShell
-{
- [[NSUserDefaults standardUserDefaults] setBool:newUseDefaultShell
- forKey:@"UseDefaultShell"];
-}
-
-+ (void)setShellString:(NSString*)newShellString
-{
- [[NSUserDefaults standardUserDefaults] setObject:newShellString
- forKey:@"Shell"];
-}
-
-+ (void)setDepth:(int)newDepth
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newDepth
- forKey:@"Depth"];
-}
-
-+ (void)saveToDisk
-{
- [[NSUserDefaults standardUserDefaults] synchronize];
-}
-
-+ (BOOL)useKeymapFile
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"UseKeymappingFile"];
-}
-
-+ (NSString*)keymapFile
-{
- return [[NSUserDefaults standardUserDefaults]
- stringForKey:@"KeymappingFile"];
-}
-
-+ (NSString*)switchString
-{
- return [[NSUserDefaults standardUserDefaults]
- stringForKey:@"SwitchString"];
-}
-
-+ (unsigned int)keyCode
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"SwitchKeyCode"];
-}
-
-+ (unsigned int)modifiers
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"SwitchModifiers"];
-}
-
-+ (int)display
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"Display"];
-}
-
-+ (BOOL)dockSwitch
-{
- return [[NSUserDefaults standardUserDefaults] boolForKey:@"DockSwitch"];
-}
-
-+ (BOOL)fakeButtons
-{
- return [[NSUserDefaults standardUserDefaults] boolForKey:@"FakeButtons"];
-}
-
-+ (int)button2Mask
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"Button2Mask"];
-}
-
-+ (int)button3Mask
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"Button3Mask"];
-}
-
-+ (BOOL)mouseAccelChange
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"AllowMouseAccelChange"];
-}
-
-+ (int)useQDCursor
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"UseQDCursor"];
-}
-
-+ (BOOL)rootless
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"UseRootlessMode"];
-}
-
-+ (BOOL)modeWindow
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"ShowModePickWindow"];
-}
-
-+ (BOOL)startupHelp
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"ShowStartupHelp"];
-}
-
-+ (BOOL)systemBeep
-{
- return [[NSUserDefaults standardUserDefaults] boolForKey:@"UseSystemBeep"];
-}
-
-+ (BOOL)xinerama
-{
- return [[NSUserDefaults standardUserDefaults] boolForKey:@"Xinerama"];
-}
-
-+ (BOOL)addToPath
-{
- return [[NSUserDefaults standardUserDefaults] boolForKey:@"AddToPath"];
-}
-
-+ (NSString*)addToPathString
-{
- return [[NSUserDefaults standardUserDefaults]
- stringForKey:@"AddToPathString"];
-}
-
-+ (BOOL)useDefaultShell
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"UseDefaultShell"];
-}
-
-+ (NSString*)shellString
-{
- return [[NSUserDefaults standardUserDefaults]
- stringForKey:@"Shell"];
-}
-
-+ (int)depth
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"Depth"];
-}
-
-
-@end
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Spanish.lproj/InfoPlist.strings.cpp b/xc/programs/Xserver/hw/darwin/bundle/Spanish.lproj/InfoPlist.strings.cpp
deleted file mode 100644
index 0ca9b9643..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/Spanish.lproj/InfoPlist.strings.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-/* English localized versions of Info.plist keys. */
-/* Most of these are set in the target application settings. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Spanish.lproj/InfoPlist.strings.cpp,v 1.1 2001/11/27 21:11:50 torrey Exp $ */
-
-NSHumanReadableCopyright = __quote__XFree86 XF86_VERSION\nCopyright 2001 XFree86 Project, Inc.__quote__
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Swedish.lproj/InfoPlist.strings.cpp b/xc/programs/Xserver/hw/darwin/bundle/Swedish.lproj/InfoPlist.strings.cpp
deleted file mode 100644
index 4a9fa416b..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/Swedish.lproj/InfoPlist.strings.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Swedish localized versions of Info.plist keys. */
-/* Most of these are set in the target application settings. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Swedish.lproj/InfoPlist.strings.cpp,v 1.2 2001/11/04 07:09:49 torrey Exp $ */
-
-NSHumanReadableCopyright = __quote__XFree86 XF86_VERSION\nCopyright 2001 XFree86 Project, Inc.__quote__
diff --git a/xc/programs/Xserver/hw/darwin/bundle/XApplication.h b/xc/programs/Xserver/hw/darwin/bundle/XApplication.h
deleted file mode 100644
index 40b2046eb..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/XApplication.h
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// NSXApplication.h
-// Xmaster project
-//
-// Created by Andreas Monitzer on January 6, 2001.
-//
-
-#import <Cocoa/Cocoa.h>
-
-#import "Xserver.h"
-#import "Preferences.h"
-
-@interface XApplication : NSApplication {
- IBOutlet Xserver *xserver;
- IBOutlet Preferences *preferences;
-}
-
-- (void)sendEvent:(NSEvent *)anEvent;
-
-@end
diff --git a/xc/programs/Xserver/hw/darwin/bundle/XApplication.m b/xc/programs/Xserver/hw/darwin/bundle/XApplication.m
deleted file mode 100644
index 4920e0688..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/XApplication.m
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// XApplication.m
-// Xmaster project
-//
-// Created by Andreas Monitzer on January 6, 2001.
-//
-
-#import "XApplication.h"
-
-
-@implementation XApplication
-
-- (void)sendEvent:(NSEvent*)anEvent {
- if(![xserver translateEvent:anEvent]) {
- if(![preferences sendEvent:anEvent])
- [super sendEvent:anEvent];
- }
-}
-
-@end
diff --git a/xc/programs/Xserver/hw/darwin/bundle/XDarwin.pbproj/project.pbxproj b/xc/programs/Xserver/hw/darwin/bundle/XDarwin.pbproj/project.pbxproj
deleted file mode 100644
index e93e9c92a..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/XDarwin.pbproj/project.pbxproj
+++ /dev/null
@@ -1,1310 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 32;
- objects = {
- 01279092000747AA0A000002 = {
- isa = PBXFileReference;
- path = Xserver.m;
- refType = 4;
- };
- 0127909600074AF60A000002 = {
- isa = PBXFileReference;
- path = XApplication.m;
- refType = 4;
- };
- 0127909800074B1A0A000002 = {
- isa = PBXFileReference;
- path = XApplication.h;
- refType = 4;
- };
- 014C68ED00ED6A9D7F000001 = {
- isa = PBXFileReference;
- path = XView.h;
- refType = 4;
- };
- 014C68EE00ED6A9D7F000001 = {
- isa = PBXFileReference;
- path = XView.m;
- refType = 4;
- };
- 014C68EF00ED6A9D7F000001 = {
- isa = PBXFileReference;
- path = XWindow.h;
- refType = 4;
- };
- 014C68F000ED6A9D7F000001 = {
- isa = PBXFileReference;
- path = XWindow.m;
- refType = 4;
- };
- 014C68F200ED7AD67F000001 = {
- isa = PBXFileReference;
- path = fakeBoxRec.h;
- refType = 4;
- };
- 014C68F300EE5AB97F000001 = {
- isa = PBXFileReference;
- path = rootlessCommon.c;
- refType = 4;
- };
- 014C68F400EE5AB97F000001 = {
- isa = PBXFileReference;
- path = rootlessCommon.h;
- refType = 4;
- };
- 014C68F700EE678F7F000001 = {
- isa = PBXFileReference;
- path = rootlessWindow.c;
- refType = 4;
- };
- 014C68F800EE678F7F000001 = {
- isa = PBXFileReference;
- path = rootlessWindow.h;
- refType = 4;
- };
- 015698ED003DF345CE6F79C2 = {
- isa = PBXFileReference;
- path = XDarwin.icns;
- refType = 4;
- };
- 0157A37D002CF6D7CE6F79C2 = {
- children = (
- F533214601A4B45401000001,
- 0157A37E002CF6D7CE6F79C2,
- F58D65DF018F79B101000001,
- F533213D0193CBE001000001,
- 43B962E200617B93416877C2,
- F5ACD263C5BE031F01000001,
- F5ACD25CC5B5E96601000001,
- F587E16401924C6901000001,
- );
- isa = PBXVariantGroup;
- name = Credits.rtf;
- path = "";
- refType = 4;
- };
- 0157A37E002CF6D7CE6F79C2 = {
- isa = PBXFileReference;
- name = English;
- path = English.lproj/Credits.rtf;
- refType = 4;
- };
- 015EDCEA004203A8CE6F79C2 = {
- isa = PBXFrameworkReference;
- name = IOKit.framework;
- path = /System/Library/Frameworks/IOKit.framework;
- refType = 0;
- };
- 017D6F4400E861FB7F000001 = {
- isa = PBXFileReference;
- path = rootlessGC.c;
- refType = 4;
- };
- 017D6F4500E861FB7F000001 = {
- isa = PBXFileReference;
- path = rootlessScreen.c;
- refType = 4;
- };
- 018F40F2003E1902CE6F79C2 = {
- children = (
- 018F40F3003E1916CE6F79C2,
- 021D6BA9003E1BACCE6F79C2,
- 3E74E03600863F047F000001,
- 018F40F6003E1974CE6F79C2,
- );
- isa = PBXGroup;
- name = "X Server";
- path = ..;
- refType = 2;
- };
- 018F40F3003E1916CE6F79C2 = {
- isa = PBXFileReference;
- path = darwin.c;
- refType = 4;
- };
- 018F40F6003E1974CE6F79C2 = {
- isa = PBXFileReference;
- path = darwinKeyboard.c;
- refType = 4;
- };
- 018F40F8003E1979CE6F79C2 = {
- isa = PBXFileReference;
- path = quartz.c;
- refType = 4;
- };
- 018F40FA003E197ECE6F79C2 = {
- isa = PBXFileReference;
- path = quartz.h;
- refType = 4;
- };
- 018F40FC003E1983CE6F79C2 = {
- isa = PBXFileReference;
- path = xfIOKit.c;
- refType = 4;
- };
- 018F40FE003E1988CE6F79C2 = {
- isa = PBXFileReference;
- path = xfIOKit.h;
- refType = 4;
- };
- 018F4100003E19E4CE6F79C2 = {
- isa = PBXFileReference;
- path = xfIOKitCursor.c;
- refType = 4;
- };
-//010
-//011
-//012
-//013
-//014
-//020
-//021
-//022
-//023
-//024
- 021D6BA9003E1BACCE6F79C2 = {
- isa = PBXFileReference;
- path = darwin.h;
- refType = 4;
- };
- 02A1FEA6006D34BE416877C2 = {
- isa = PBXFileReference;
- path = xfIOKitStartup.c;
- refType = 4;
- };
- 02A1FEA8006D38F0416877C2 = {
- isa = PBXFileReference;
- path = quartzStartup.c;
- refType = 4;
- };
- 02E03CA000348209CE6F79C2 = {
- children = (
- F533214701A4B48301000001,
- 02E03CA100348209CE6F79C2,
- F58D65E0018F79C001000001,
- F533213E0193CBF401000001,
- 43B962E300617B93416877C2,
- F5ACD268C5BE046401000001,
- F5ACD261C5B5EA2001000001,
- F587E16501924C7401000001,
- );
- isa = PBXVariantGroup;
- name = XDarwinHelp.html;
- path = "";
- refType = 4;
- };
- 02E03CA100348209CE6F79C2 = {
- isa = PBXFileReference;
- name = English;
- path = English.lproj/XDarwinHelp.html;
- refType = 4;
- };
-//020
-//021
-//022
-//023
-//024
-//030
-//031
-//032
-//033
-//034
- 0338412F0083BFE57F000001 = {
- isa = PBXFileReference;
- path = quartzCursor.h;
- refType = 4;
- };
-//030
-//031
-//032
-//033
-//034
-//040
-//041
-//042
-//043
-//044
- 04329610000763920A000002 = {
- isa = PBXFileReference;
- path = Preferences.m;
- refType = 4;
- };
- 04329611000763920A000002 = {
- isa = PBXFileReference;
- path = Preferences.h;
- refType = 4;
- };
-//040
-//041
-//042
-//043
-//044
-//060
-//061
-//062
-//063
-//064
- 06EB6C3B004099E7CE6F79C2 = {
- isa = PBXFileReference;
- path = quartzShared.h;
- refType = 4;
- };
-//060
-//061
-//062
-//063
-//064
-//080
-//081
-//082
-//083
-//084
- 080E96DDFE201D6D7F000001 = {
- children = (
- 04329610000763920A000002,
- 04329611000763920A000002,
- 0127909600074AF60A000002,
- 0127909800074B1A0A000002,
- 01279092000747AA0A000002,
- 1C4A3109004D8F24CE6F79C2,
- 014C68EE00ED6A9D7F000001,
- 014C68ED00ED6A9D7F000001,
- 014C68F000ED6A9D7F000001,
- 014C68EF00ED6A9D7F000001,
- );
- isa = PBXGroup;
- name = Classes;
- refType = 4;
- };
- 089C165CFE840E0CC02AAC07 = {
- children = (
- F533214301A4B3F001000001,
- 089C165DFE840E0CC02AAC07,
- F58D65DD018F798F01000001,
- F533213A0193CBA201000001,
- 43B962E100617B49416877C2,
- F5ACD269C5BE049301000001,
- F5ACD262C5B5EA4D01000001,
- F587E16101924C2F01000001,
- );
- isa = PBXVariantGroup;
- name = InfoPlist.strings;
- refType = 4;
- };
- 089C165DFE840E0CC02AAC07 = {
- isa = PBXFileReference;
- name = English;
- path = English.lproj/InfoPlist.strings;
- refType = 4;
- };
-//080
-//081
-//082
-//083
-//084
-//0A0
-//0A1
-//0A2
-//0A3
-//0A4
- 0A79E19E004499A1CE6F79C2 = {
- isa = PBXApplicationReference;
- path = XDarwin.app;
- refType = 3;
- };
- 0A79E19F004499A1CE6F79C2 = {
- buildPhases = (
- 0A79E1A0004499A1CE6F79C2,
- 0A79E1A1004499A1CE6F79C2,
- 0A79E1A2004499A1CE6F79C2,
- 0A79E1A3004499A1CE6F79C2,
- 0A79E1A4004499A1CE6F79C2,
- );
- buildSettings = {
- INSTALL_PATH = "";
- OPTIMIZATION_CFLAGS = "";
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = XDarwin;
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
- WRAPPER_EXTENSION = app;
- };
- dependencies = (
- );
- isa = PBXApplicationTarget;
- name = XDarwin;
- productInstallPath = "";
- productName = XDarwin;
- productReference = 0A79E19E004499A1CE6F79C2;
- productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<!DOCTYPE plist SYSTEM \"file://localhost/System/Library/DTDs/PropertyList.dtd\">
-<plist version=\"0.9\">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>XDarwin</string>
- <key>CFBundleGetInfoString</key>
- <string>XDarwin 1.1, ©2001-2002 XFree86 Project, Inc.</string>
- <key>CFBundleIconFile</key>
- <string>XDarwin.icns</string>
- <key>CFBundleIdentifier</key>
- <string>org.xfree86.XDarwin</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>XDarwin</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>XDarwin 1.1</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string></string>
- <key>NSHelpFile</key>
- <string>XDarwinHelp.html</string>
- <key>NSMainNibFile</key>
- <string>MainMenu</string>
- <key>NSPrincipalClass</key>
- <string>XApplication</string>
-</dict>
-</plist>
-";
- shouldUseHeadermap = 0;
- };
- 0A79E1A0004499A1CE6F79C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXHeadersBuildPhase;
- name = Headers;
- };
- 0A79E1A1004499A1CE6F79C2 = {
- buildActionMask = 2147483647;
- files = (
- 0A79E1A600449EB2CE6F79C2,
- 0A79E1A700449EB2CE6F79C2,
- 0A79E1A800449EB2CE6F79C2,
- 0A79E1A900449EB2CE6F79C2,
- 0A79E1AA00449EB2CE6F79C2,
- 1220774500712D2D416877C2,
- F54BF6ED017D506E01000001,
- );
- isa = PBXResourcesBuildPhase;
- name = "Bundle Resources";
- };
- 0A79E1A2004499A1CE6F79C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXSourcesBuildPhase;
- name = Sources;
- };
- 0A79E1A3004499A1CE6F79C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXFrameworksBuildPhase;
- name = "Frameworks & Libraries";
- };
- 0A79E1A4004499A1CE6F79C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXRezBuildPhase;
- name = "ResourceManager Resources";
- };
- 0A79E1A600449EB2CE6F79C2 = {
- fileRef = 29B97318FDCFA39411CA2CEA;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 0A79E1A700449EB2CE6F79C2 = {
- fileRef = 089C165CFE840E0CC02AAC07;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 0A79E1A800449EB2CE6F79C2 = {
- fileRef = 0157A37D002CF6D7CE6F79C2;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 0A79E1A900449EB2CE6F79C2 = {
- fileRef = 02E03CA000348209CE6F79C2;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 0A79E1AA00449EB2CE6F79C2 = {
- fileRef = 015698ED003DF345CE6F79C2;
- isa = PBXBuildFile;
- settings = {
- };
- };
-//0A0
-//0A1
-//0A2
-//0A3
-//0A4
-//100
-//101
-//102
-//103
-//104
- 1058C7A0FEA54F0111CA2CBB = {
- children = (
- F53321400193CCF001000001,
- 1BE4F84D0006C9890A000002,
- 1058C7A1FEA54F0111CA2CBB,
- F53321410193CCF001000001,
- 015EDCEA004203A8CE6F79C2,
- );
- isa = PBXGroup;
- name = "Linked Frameworks";
- refType = 4;
- };
- 1058C7A1FEA54F0111CA2CBB = {
- isa = PBXFrameworkReference;
- name = Cocoa.framework;
- path = /System/Library/Frameworks/Cocoa.framework;
- refType = 0;
- };
- 1058C7A2FEA54F0111CA2CBB = {
- children = (
- 29B97325FDCFA39411CA2CEA,
- 29B97324FDCFA39411CA2CEA,
- );
- isa = PBXGroup;
- name = "Other Frameworks";
- refType = 4;
- };
-//100
-//101
-//102
-//103
-//104
-//120
-//121
-//122
-//123
-//124
- 1220774300712D2D416877C2 = {
- children = (
- F533214501A4B42501000001,
- 1220774400712D2D416877C2,
- F58D65DE018F79A001000001,
- F533213C0193CBC901000001,
- 1220774600712D75416877C2,
- F5ACD266C5BE03C501000001,
- F5ACD25FC5B5E9AA01000001,
- F587E16301924C5E01000001,
- );
- isa = PBXVariantGroup;
- name = Localizable.strings;
- path = "";
- refType = 4;
- };
- 1220774400712D2D416877C2 = {
- isa = PBXFileReference;
- name = English;
- path = English.lproj/Localizable.strings;
- refType = 4;
- };
- 1220774500712D2D416877C2 = {
- fileRef = 1220774300712D2D416877C2;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 1220774600712D75416877C2 = {
- isa = PBXFileReference;
- name = Japanese;
- path = Japanese.lproj/Localizable.strings;
- refType = 4;
- };
-//120
-//121
-//122
-//123
-//124
-//170
-//171
-//172
-//173
-//174
- 170DFAFF00729A35416877C2 = {
- isa = PBXFileReference;
- path = XDarwinStartup.c;
- refType = 4;
- };
- 170DFB0000729C86416877C2 = {
- children = (
- 018F40FC003E1983CE6F79C2,
- 018F40FE003E1988CE6F79C2,
- 018F4100003E19E4CE6F79C2,
- 02A1FEA6006D34BE416877C2,
- );
- isa = PBXGroup;
- name = IOKit;
- path = ..;
- refType = 2;
- };
-//170
-//171
-//172
-//173
-//174
-//190
-//191
-//192
-//193
-//194
- 19C28FACFE9D520D11CA2CBB = {
- children = (
- 0A79E19E004499A1CE6F79C2,
- );
- isa = PBXGroup;
- name = Products;
- refType = 4;
- };
-//190
-//191
-//192
-//193
-//194
-//1B0
-//1B1
-//1B2
-//1B3
-//1B4
- 1BD8DE4200B8A3567F000001 = {
- children = (
- F533214401A4B40F01000001,
- 1BD8DE4300B8A3567F000001,
- F58D65DC018F794D01000001,
- F533213B0193CBB401000001,
- 1BD8DE4700B8A3C77F000001,
- F5ACD264C5BE035B01000001,
- F5ACD25DC5B5E97701000001,
- F587E16201924C5301000001,
- );
- isa = PBXVariantGroup;
- name = InfoPlist.strings.cpp;
- path = "";
- refType = 4;
- };
- 1BD8DE4300B8A3567F000001 = {
- isa = PBXFileReference;
- name = English;
- path = English.lproj/InfoPlist.strings.cpp;
- refType = 4;
- };
- 1BD8DE4400B8A38E7F000001 = {
- children = (
- F533214801A4B4D701000001,
- 1BD8DE4500B8A38E7F000001,
- F58D65E1018F79E001000001,
- F533213F0193CC2501000001,
- 1BD8DE4800B8A4167F000001,
- F5ACD267C5BE03FC01000001,
- F5ACD260C5B5E9DF01000001,
- F587E16601924C9D01000001,
- );
- isa = PBXVariantGroup;
- name = XDarwinHelp.html.cpp;
- path = "";
- refType = 4;
- };
- 1BD8DE4500B8A38E7F000001 = {
- isa = PBXFileReference;
- name = English;
- path = English.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- };
- 1BD8DE4700B8A3C77F000001 = {
- isa = PBXFileReference;
- name = Japanese;
- path = Japanese.lproj/InfoPlist.strings.cpp;
- refType = 4;
- };
- 1BD8DE4800B8A4167F000001 = {
- isa = PBXFileReference;
- name = Japanese;
- path = Japanese.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- };
- 1BE4F84D0006C9890A000002 = {
- isa = PBXFrameworkReference;
- name = Carbon.framework;
- path = /System/Library/Frameworks/Carbon.framework;
- refType = 0;
- };
-//1B0
-//1B1
-//1B2
-//1B3
-//1B4
-//1C0
-//1C1
-//1C2
-//1C3
-//1C4
- 1C4A3109004D8F24CE6F79C2 = {
- isa = PBXFileReference;
- path = Xserver.h;
- refType = 4;
- };
-//1C0
-//1C1
-//1C2
-//1C3
-//1C4
-//230
-//231
-//232
-//233
-//234
- 237A34C10076E37E7F000001 = {
- isa = PBXFileReference;
- path = quartzAudio.c;
- refType = 4;
- };
- 237A34C20076E37E7F000001 = {
- buildRules = (
- );
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- };
- isa = PBXBuildStyle;
- name = Development;
- };
- 237A34C30076E37E7F000001 = {
- buildRules = (
- );
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- };
- isa = PBXBuildStyle;
- name = Deployment;
- };
- 237A34C40076F4F07F000001 = {
- isa = PBXFileReference;
- path = quartzAudio.h;
- refType = 4;
- };
-//230
-//231
-//232
-//233
-//234
-//290
-//291
-//292
-//293
-//294
- 29B97313FDCFA39411CA2CEA = {
- buildStyles = (
- 237A34C20076E37E7F000001,
- 237A34C30076E37E7F000001,
- );
- isa = PBXProject;
- knownRegions = (
- English,
- Japanese,
- French,
- German,
- Swedish,
- Dutch,
- Spanish,
- ko,
- );
- mainGroup = 29B97314FDCFA39411CA2CEA;
- projectDirPath = "";
- targets = (
- 0A79E19F004499A1CE6F79C2,
- );
- };
- 29B97314FDCFA39411CA2CEA = {
- children = (
- 080E96DDFE201D6D7F000001,
- 29B97315FDCFA39411CA2CEA,
- 29B97317FDCFA39411CA2CEA,
- 618092480041B0E4CE6F79C2,
- 29B97323FDCFA39411CA2CEA,
- 19C28FACFE9D520D11CA2CBB,
- );
- isa = PBXGroup;
- name = "Xmaster-Cocoa";
- path = "";
- refType = 4;
- };
- 29B97315FDCFA39411CA2CEA = {
- children = (
- 170DFAFF00729A35416877C2,
- 018F40F2003E1902CE6F79C2,
- 170DFB0000729C86416877C2,
- 43B962CE00617089416877C2,
- 32FEE13C00E07C3E7F000001,
- );
- isa = PBXGroup;
- name = "Other Sources";
- path = "";
- refType = 2;
- };
- 29B97317FDCFA39411CA2CEA = {
- children = (
- 29B97318FDCFA39411CA2CEA,
- 089C165CFE840E0CC02AAC07,
- 1BD8DE4200B8A3567F000001,
- 1220774300712D2D416877C2,
- 0157A37D002CF6D7CE6F79C2,
- 02E03CA000348209CE6F79C2,
- 1BD8DE4400B8A38E7F000001,
- 015698ED003DF345CE6F79C2,
- F54BF6EA017D500901000001,
- F54BF6EC017D506E01000001,
- );
- isa = PBXGroup;
- name = Resources;
- path = "";
- refType = 4;
- };
- 29B97318FDCFA39411CA2CEA = {
- children = (
- F533214201A4B3CE01000001,
- 29B97319FDCFA39411CA2CEA,
- F58D65DB018F793801000001,
- F53321390193CB6A01000001,
- 43B962E000617B49416877C2,
- F5ACD265C5BE038601000001,
- F5ACD25EC5B5E98D01000001,
- F587E16001924C1D01000001,
- );
- isa = PBXVariantGroup;
- name = MainMenu.nib;
- path = "";
- refType = 4;
- };
- 29B97319FDCFA39411CA2CEA = {
- isa = PBXFileReference;
- name = English;
- path = English.lproj/MainMenu.nib;
- refType = 4;
- };
- 29B97323FDCFA39411CA2CEA = {
- children = (
- 1058C7A0FEA54F0111CA2CBB,
- 1058C7A2FEA54F0111CA2CBB,
- );
- isa = PBXGroup;
- name = Frameworks;
- path = "";
- refType = 4;
- };
- 29B97324FDCFA39411CA2CEA = {
- isa = PBXFrameworkReference;
- name = AppKit.framework;
- path = /System/Library/Frameworks/AppKit.framework;
- refType = 0;
- };
- 29B97325FDCFA39411CA2CEA = {
- isa = PBXFrameworkReference;
- name = Foundation.framework;
- path = /System/Library/Frameworks/Foundation.framework;
- refType = 0;
- };
-//290
-//291
-//292
-//293
-//294
-//320
-//321
-//322
-//323
-//324
- 32FEE13C00E07C3E7F000001 = {
- children = (
- 014C68F200ED7AD67F000001,
- F5269C2D01D5BC3501000001,
- F5269C2E01D5BC3501000001,
- 32FEE13E00E07CBE7F000001,
- 32FEE13F00E07CBE7F000001,
- 32FEE14000E07CBE7F000001,
- 32FEE14100E07CBE7F000001,
- 32FEE14200E07CBE7F000001,
- 014C68F300EE5AB97F000001,
- 014C68F400EE5AB97F000001,
- 017D6F4400E861FB7F000001,
- 017D6F4500E861FB7F000001,
- 014C68F700EE678F7F000001,
- 014C68F800EE678F7F000001,
- 32FEE14900E07D317F000001,
- );
- isa = PBXGroup;
- name = Rootless;
- refType = 4;
- };
- 32FEE13E00E07CBE7F000001 = {
- isa = PBXFileReference;
- path = rootless.h;
- refType = 4;
- };
- 32FEE13F00E07CBE7F000001 = {
- isa = PBXFileReference;
- path = rootlessAqua.h;
- refType = 4;
- };
- 32FEE14000E07CBE7F000001 = {
- isa = PBXFileReference;
- path = rootlessAquaGlue.c;
- refType = 4;
- };
- 32FEE14100E07CBE7F000001 = {
- isa = PBXFileReference;
- path = rootlessAquaImp.h;
- refType = 4;
- };
- 32FEE14200E07CBE7F000001 = {
- isa = PBXFileReference;
- path = rootlessAquaImp.m;
- refType = 4;
- };
- 32FEE14900E07D317F000001 = {
- isa = PBXFileReference;
- path = rootlessValTree.c;
- refType = 4;
- };
-//320
-//321
-//322
-//323
-//324
-//350
-//351
-//352
-//353
-//354
- 3576829A0077B8F17F000001 = {
- isa = PBXFileReference;
- path = quartzCursor.c;
- refType = 4;
- };
-//350
-//351
-//352
-//353
-//354
-//3E0
-//3E1
-//3E2
-//3E3
-//3E4
- 3E74E03600863F047F000001 = {
- isa = PBXFileReference;
- path = darwinClut8.h;
- refType = 4;
- };
-//3E0
-//3E1
-//3E2
-//3E3
-//3E4
-//430
-//431
-//432
-//433
-//434
- 43B962CE00617089416877C2 = {
- children = (
- 018F40F8003E1979CE6F79C2,
- 018F40FA003E197ECE6F79C2,
- 237A34C10076E37E7F000001,
- 237A34C40076F4F07F000001,
- 3576829A0077B8F17F000001,
- 0338412F0083BFE57F000001,
- 43B962D000617089416877C2,
- 43B962D100617089416877C2,
- 43B962CF00617089416877C2,
- F5582948015DAD3B01000001,
- 06EB6C3B004099E7CE6F79C2,
- 02A1FEA8006D38F0416877C2,
- );
- isa = PBXGroup;
- name = Quartz;
- refType = 4;
- };
- 43B962CF00617089416877C2 = {
- isa = PBXFileReference;
- path = quartzCocoa.m;
- refType = 4;
- };
- 43B962D000617089416877C2 = {
- isa = PBXFileReference;
- path = quartzPasteboard.c;
- refType = 4;
- };
- 43B962D100617089416877C2 = {
- isa = PBXFileReference;
- path = quartzPasteboard.h;
- refType = 4;
- };
- 43B962E000617B49416877C2 = {
- isa = PBXFileReference;
- name = Japanese;
- path = Japanese.lproj/MainMenu.nib;
- refType = 4;
- };
- 43B962E100617B49416877C2 = {
- isa = PBXFileReference;
- name = Japanese;
- path = Japanese.lproj/InfoPlist.strings;
- refType = 4;
- };
- 43B962E200617B93416877C2 = {
- isa = PBXFileReference;
- name = Japanese;
- path = Japanese.lproj/Credits.rtf;
- refType = 4;
- };
- 43B962E300617B93416877C2 = {
- isa = PBXFileReference;
- name = Japanese;
- path = Japanese.lproj/XDarwinHelp.html;
- refType = 4;
- };
-//430
-//431
-//432
-//433
-//434
-//610
-//611
-//612
-//613
-//614
- 618092480041B0E4CE6F79C2 = {
- children = (
- );
- isa = PBXGroup;
- name = Libraries;
- path = ../../..;
- refType = 2;
- };
-//610
-//611
-//612
-//613
-//614
-//F50
-//F51
-//F52
-//F53
-//F54
- F5269C2D01D5BC3501000001 = {
- isa = PBXFileReference;
- path = pseudoramiX.c;
- refType = 4;
- };
- F5269C2E01D5BC3501000001 = {
- isa = PBXFileReference;
- path = pseudoramiX.h;
- refType = 4;
- };
- F53321390193CB6A01000001 = {
- isa = PBXFileReference;
- name = German;
- path = German.lproj/MainMenu.nib;
- refType = 4;
- };
- F533213A0193CBA201000001 = {
- isa = PBXFileReference;
- name = German;
- path = German.lproj/InfoPlist.strings;
- refType = 4;
- };
- F533213B0193CBB401000001 = {
- isa = PBXFileReference;
- name = German;
- path = German.lproj/InfoPlist.strings.cpp;
- refType = 4;
- };
- F533213C0193CBC901000001 = {
- isa = PBXFileReference;
- name = German;
- path = German.lproj/Localizable.strings;
- refType = 4;
- };
- F533213D0193CBE001000001 = {
- isa = PBXFileReference;
- name = German;
- path = German.lproj/Credits.rtf;
- refType = 4;
- };
- F533213E0193CBF401000001 = {
- isa = PBXFileReference;
- name = German;
- path = German.lproj/XDarwinHelp.html;
- refType = 4;
- };
- F533213F0193CC2501000001 = {
- isa = PBXFileReference;
- name = German;
- path = German.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- };
- F53321400193CCF001000001 = {
- isa = PBXFrameworkReference;
- name = ApplicationServices.framework;
- path = /System/Library/Frameworks/ApplicationServices.framework;
- refType = 0;
- };
- F53321410193CCF001000001 = {
- isa = PBXFrameworkReference;
- name = CoreAudio.framework;
- path = /System/Library/Frameworks/CoreAudio.framework;
- refType = 0;
- };
- F533214201A4B3CE01000001 = {
- isa = PBXFileReference;
- name = Dutch;
- path = Dutch.lproj/MainMenu.nib;
- refType = 4;
- };
- F533214301A4B3F001000001 = {
- isa = PBXFileReference;
- name = Dutch;
- path = Dutch.lproj/InfoPlist.strings;
- refType = 4;
- };
- F533214401A4B40F01000001 = {
- isa = PBXFileReference;
- name = Dutch;
- path = Dutch.lproj/InfoPlist.strings.cpp;
- refType = 4;
- };
- F533214501A4B42501000001 = {
- isa = PBXFileReference;
- name = Dutch;
- path = Dutch.lproj/Localizable.strings;
- refType = 4;
- };
- F533214601A4B45401000001 = {
- isa = PBXFileReference;
- name = Dutch;
- path = Dutch.lproj/Credits.rtf;
- refType = 4;
- };
- F533214701A4B48301000001 = {
- isa = PBXFileReference;
- name = Dutch;
- path = Dutch.lproj/XDarwinHelp.html;
- refType = 4;
- };
- F533214801A4B4D701000001 = {
- isa = PBXFileReference;
- name = Dutch;
- path = Dutch.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- };
- F54BF6EA017D500901000001 = {
- isa = PBXFileReference;
- path = startXClients.cpp;
- refType = 4;
- };
- F54BF6EC017D506E01000001 = {
- isa = PBXFileReference;
- path = startXClients;
- refType = 4;
- };
- F54BF6ED017D506E01000001 = {
- fileRef = F54BF6EC017D506E01000001;
- isa = PBXBuildFile;
- settings = {
- };
- };
- F5582948015DAD3B01000001 = {
- isa = PBXFileReference;
- path = quartzCommon.h;
- refType = 4;
- };
- F587E16001924C1D01000001 = {
- isa = PBXFileReference;
- name = Swedish;
- path = Swedish.lproj/MainMenu.nib;
- refType = 4;
- };
- F587E16101924C2F01000001 = {
- isa = PBXFileReference;
- name = Swedish;
- path = Swedish.lproj/InfoPlist.strings;
- refType = 4;
- };
- F587E16201924C5301000001 = {
- isa = PBXFileReference;
- name = Swedish;
- path = Swedish.lproj/InfoPlist.strings.cpp;
- refType = 4;
- };
- F587E16301924C5E01000001 = {
- isa = PBXFileReference;
- name = Swedish;
- path = Swedish.lproj/Localizable.strings;
- refType = 4;
- };
- F587E16401924C6901000001 = {
- isa = PBXFileReference;
- name = Swedish;
- path = Swedish.lproj/Credits.rtf;
- refType = 4;
- };
- F587E16501924C7401000001 = {
- isa = PBXFileReference;
- name = Swedish;
- path = Swedish.lproj/XDarwinHelp.html;
- refType = 4;
- };
- F587E16601924C9D01000001 = {
- isa = PBXFileReference;
- name = Swedish;
- path = Swedish.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- };
- F58D65DB018F793801000001 = {
- isa = PBXFileReference;
- name = French;
- path = French.lproj/MainMenu.nib;
- refType = 4;
- };
- F58D65DC018F794D01000001 = {
- isa = PBXFileReference;
- name = French;
- path = French.lproj/InfoPlist.strings.cpp;
- refType = 4;
- };
- F58D65DD018F798F01000001 = {
- isa = PBXFileReference;
- name = French;
- path = French.lproj/InfoPlist.strings;
- refType = 4;
- };
- F58D65DE018F79A001000001 = {
- isa = PBXFileReference;
- name = French;
- path = French.lproj/Localizable.strings;
- refType = 4;
- };
- F58D65DF018F79B101000001 = {
- isa = PBXFileReference;
- name = French;
- path = French.lproj/Credits.rtf;
- refType = 4;
- };
- F58D65E0018F79C001000001 = {
- isa = PBXFileReference;
- name = French;
- path = French.lproj/XDarwinHelp.html;
- refType = 4;
- };
- F58D65E1018F79E001000001 = {
- isa = PBXFileReference;
- name = French;
- path = French.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- };
- F5ACD25CC5B5E96601000001 = {
- isa = PBXFileReference;
- name = Spanish;
- path = Spanish.lproj/Credits.rtf;
- refType = 4;
- };
- F5ACD25DC5B5E97701000001 = {
- isa = PBXFileReference;
- name = Spanish;
- path = Spanish.lproj/InfoPlist.strings.cpp;
- refType = 4;
- };
- F5ACD25EC5B5E98D01000001 = {
- isa = PBXFileReference;
- name = Spanish;
- path = Spanish.lproj/MainMenu.nib;
- refType = 4;
- };
- F5ACD25FC5B5E9AA01000001 = {
- isa = PBXFileReference;
- name = Spanish;
- path = Spanish.lproj/Localizable.strings;
- refType = 4;
- };
- F5ACD260C5B5E9DF01000001 = {
- isa = PBXFileReference;
- name = Spanish;
- path = Spanish.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- };
- F5ACD261C5B5EA2001000001 = {
- isa = PBXFileReference;
- name = Spanish;
- path = Spanish.lproj/XDarwinHelp.html;
- refType = 4;
- };
- F5ACD262C5B5EA4D01000001 = {
- isa = PBXFileReference;
- name = Spanish;
- path = Spanish.lproj/InfoPlist.strings;
- refType = 4;
- };
- F5ACD263C5BE031F01000001 = {
- isa = PBXFileReference;
- name = ko;
- path = ko.lproj/Credits.rtf;
- refType = 4;
- };
- F5ACD264C5BE035B01000001 = {
- isa = PBXFileReference;
- name = ko;
- path = ko.lproj/InfoPlist.strings.cpp;
- refType = 4;
- };
- F5ACD265C5BE038601000001 = {
- isa = PBXFileReference;
- name = ko;
- path = ko.lproj/MainMenu.nib;
- refType = 4;
- };
- F5ACD266C5BE03C501000001 = {
- isa = PBXFileReference;
- name = ko;
- path = ko.lproj/Localizable.strings;
- refType = 4;
- };
- F5ACD267C5BE03FC01000001 = {
- isa = PBXFileReference;
- name = ko;
- path = ko.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- };
- F5ACD268C5BE046401000001 = {
- isa = PBXFileReference;
- name = ko;
- path = ko.lproj/XDarwinHelp.html;
- refType = 4;
- };
- F5ACD269C5BE049301000001 = {
- isa = PBXFileReference;
- name = ko;
- path = ko.lproj/InfoPlist.strings;
- refType = 4;
- };
- };
- rootObject = 29B97313FDCFA39411CA2CEA;
-}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/XDarwinStartup.c b/xc/programs/Xserver/hw/darwin/bundle/XDarwinStartup.c
deleted file mode 100644
index b510cbd9a..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/XDarwinStartup.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/**************************************************************
- *
- * Startup program for Darwin X servers
- *
- * This program selects the appropriate X server to launch:
- * XDarwin IOKit X server (default)
- * XDarwinQuartz A soft link to the Quartz X server
- * executable (-quartz option)
- *
- * If told to idle, the program will simply pause and not
- * launch any X server. This is to support startx being
- * run by XDarwin.app.
- *
- **************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/XDarwinStartup.c,v 1.5 2001/12/30 03:50:15 torrey Exp $ */
-
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/syslimits.h>
-
-extern int errno;
-
-// Macros to build the path name
-#ifndef XBINDIR
-#define XBINDIR /usr/X11R6/bin
-#endif
-#define STR(s) #s
-#define XSTRPATH(s) STR(s) "/"
-#define XPATH(file) XSTRPATH(XBINDIR) STR(file)
-
-int main(
- int argc,
- char *argv[] )
-{
- int i, j;
- char **newargv;
-
- // Check if we are going to run in Quartz mode or idle
- // to support startx from the Quartz server. The last
- // parameter in the list is the one used.
- for (i = argc-1; i; i--) {
- if (!strcmp(argv[i], "-idle")) {
- pause();
- return 0;
-
- } else if (!strcmp(argv[i], "-quartz") ||
- !strcmp(argv[i], "-rootless") ||
- !strcmp(argv[i], "-fullscreen"))
- {
- char quartzPath[PATH_MAX+1];
- int pathLength;
-
- // Find the path to the Quartz executable
- pathLength = readlink(XPATH(XDarwinQuartz), quartzPath, PATH_MAX);
- if (pathLength == -1) {
- fprintf(stderr, "The symbolic link " XPATH(XDarwinQuartz)
- " is not valid.\n");
- return errno;
- }
- quartzPath[pathLength] = '\0';
-
- // Build the new argument list
- newargv = (char **) malloc((argc+2) * sizeof(char *));
- for (j = argc; j; j--)
- newargv[j] = argv[j];
- newargv[0] = quartzPath;
- newargv[argc] = "-nostartx";
- newargv[argc+1] = NULL;
-
- execv(newargv[0], newargv);
- fprintf(stderr,
- "Could not start XDarwin Quartz X server at %s.\n",
- quartzPath);
- return errno;
- }
- }
-
- // Build the new argument list
- newargv = (char **) malloc((argc+1) * sizeof(char *));
- for (j = argc; j; j--)
- newargv[j] = argv[j];
- newargv[0] = XPATH(XDarwin);
- newargv[argc] = NULL;
-
- // Launch the IOKit X server
- execv(newargv[0], newargv);
- fprintf(stderr, "Could not start XDarwin IOKit X server.\n");
- return errno;
-}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/XView.h b/xc/programs/Xserver/hw/darwin/bundle/XView.h
deleted file mode 100644
index 7bcc08866..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/XView.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * NSView subclass for Mac OS X rootless X server
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/XView.h,v 1.3 2001/11/05 05:12:16 torrey Exp $ */
-
-#import <Cocoa/Cocoa.h>
-
-#include <drivers/event_status_driver.h>
-#include "fakeBoxRec.h"
-
-@interface XView : NSView
-{
- char *mBits;
- int mBytesPerRow;
- int mBitsPerSample;
- int mSamplesPerPixel;
- int mBitsPerPixel;
- int mDepth;
- BOOL mShaped;
-}
-
-- (id)initWithFrame:(NSRect)aRect;
-- (void)dealloc;
-
-- (void)drawRect:(NSRect)aRect;
-- (BOOL)isFlipped;
-- (BOOL)acceptsFirstResponder;
-- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent;
-- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent;
-
-- (void)mouseDown:(NSEvent *)anEvent;
-
-- (void)setFrameSize:(NSSize)newSize;
-
-- (void)allocBitsForSize:(NSSize)newSize;
-- (char *)bits;
-- (void)getBits:(char **)bits
- rowBytes:(int *)rowBytes
- depth:(int *)depth
- bitsPerPixel:(int *)bpp;
-
-- (void)refreshRects:(fakeBoxRec *)rectList count:(int)count;
-- (void)reshapeRects:(fakeBoxRec *)eraseRects count:(int)count;
-
-- (void)copyToScreen:(fakeBoxRec *)rectList count:(int)count
- fromTemp:(BOOL)copyFromTemp;
-- (void)copyToShapeBits:(fakeBoxRec *)rectList count:(int)count;
-- (void)eraseFromShapeBits:(fakeBoxRec *)rectList count:(int)count;
-
-@end
diff --git a/xc/programs/Xserver/hw/darwin/bundle/XView.m b/xc/programs/Xserver/hw/darwin/bundle/XView.m
deleted file mode 100644
index 2c978e4d1..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/XView.m
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * NSView subclass for Mac OS X rootless X server
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/XView.m,v 1.5 2001/11/09 00:12:38 torrey Exp $ */
-
-#include <ApplicationServices/ApplicationServices.h>
-
-#import "XView.h"
-#include "fakeBoxRec.h"
-
-static const void *infobytes(void *info)
-{
- return info;
-}
-
-
-static unsigned long *shapeBits = NULL;
-static int shapeWidth = 0;
-static int shapeHeight = 0;
-
-static void reallocShapeBits(NSSize minSize)
-{
- if (shapeWidth < minSize.width || shapeHeight < minSize.height) {
- shapeWidth = minSize.width;
- shapeHeight = minSize.height;
- if (shapeBits) free(shapeBits);
- shapeBits = (unsigned long *) malloc(4 * shapeWidth * shapeHeight);
- }
-}
-
-
-@implementation XView
-
-- (id)initWithFrame:(NSRect)aRect
-{
- self = [super initWithFrame:aRect];
- if (!self) return nil;
-
- mShaped = NO;
- mBitsPerSample = 8;
- mSamplesPerPixel = 3;
- mDepth = mBitsPerSample * mSamplesPerPixel;
- mBitsPerPixel = 32;
- mBits = nil;
- [self allocBitsForSize:aRect.size];
-
- return self;
-}
-
-- (void)dealloc
-{
- if (mBits) free(mBits);
- [super dealloc];
-}
-
-- (void)drawRect:(NSRect)aRect
-{
- // Never draw here.
-}
-
-- (BOOL)isFlipped
-{
- return NO;
-}
-
-- (BOOL)isOpaque
-{
- return !mShaped;
-}
-
-- (BOOL)acceptsFirstResponder
-{
- return YES;
-}
-
-- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
-{
- return YES;
-}
-
-- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent
-{
- return YES;
-}
-
-
-- (void)mouseDown:(NSEvent *)anEvent
-{
- // Only X is allowed to restack windows.
- [NSApp preventWindowOrdering];
- [[self nextResponder] mouseDown:anEvent];
-}
-
-- (void)mouseUp:(NSEvent *)anEvent
-{
- // Bring app to front if necessary
- // Don't bring app to front in mouseDown; mousedown-mouseup is too
- // long and X gets what looks like a mouse drag.
- if (! [NSApp isActive]) {
- [NSApp activateIgnoringOtherApps:YES];
- [NSApp arrangeInFront:nil]; // fixme only bring some windows forward?
- }
-
- [[self nextResponder] mouseDown:anEvent];
-}
-
-
-// Reallocate bits.
-// setFrame goes through here too.
-- (void)setFrameSize:(NSSize)newSize
-{
- [self allocBitsForSize:newSize];
- [super setFrameSize:newSize];
-}
-
-- (void)allocBitsForSize:(NSSize)newSize
-{
- if (mBits) free(mBits);
- mBytesPerRow = newSize.width * mBitsPerPixel / 8;
- mBits = calloc(mBytesPerRow * newSize.height, 1);
-}
-
-- (char *)bits
-{
- return mBits;
-}
-
-- (void)getBits:(char **)bits
- rowBytes:(int *)rowBytes
- depth:(int *)depth
- bitsPerPixel:(int *)bpp
-{
- *bits = mBits;
- *rowBytes = mBytesPerRow;
- *depth = mDepth;
- *bpp = mBitsPerPixel;
-}
-
-- (void)refreshRects:(fakeBoxRec *)rectList count:(int)count
-{
- if (!mShaped) {
- [self lockFocus];
- [self copyToScreen:rectList count:count fromTemp:NO];
- } else {
- [self copyToShapeBits:rectList count:count];
- [self lockFocus];
- [self copyToScreen:rectList count:count fromTemp:YES];
- }
- [[NSGraphicsContext currentContext] flushGraphics];
- [self unlockFocus];
-}
-
-// eraseRects are OUTSIDE the new shape
-- (void)reshapeRects:(fakeBoxRec *)eraseRects count:(int)count
-{
- fakeBoxRec bounds = {0, 0, [self frame].size.width,
- [self frame].size.height};
-
- if (count == 0 && !mShaped) {
- [self refreshRects:&bounds count:1];
- } else {
- // View is shaped, or used to be shaped.
- // Shaped windows never become unshaped.
- // (Mac OS X 10.0.4 does not allow transparent windows
- // to become opaque.)
-
- mShaped = YES;
-
- // Magic. 10.0.4 and 10.1 both require the alpha channel to be
- // cleared explicitly. 10.0.4 additionally requires the view to
- // be unlocked between this and the drawing code below.
- [self lockFocus];
- [[NSColor clearColor] set];
- NSRectFill([self frame]);
- [self unlockFocus];
-
- // copy everything from X11 to temp
- // erase eraseRects from temp
- // copy everything from temp to screen
- [self lockFocus];
- [self copyToShapeBits:&bounds count:1];
- [self eraseFromShapeBits:eraseRects count:count];
- [self copyToScreen:&bounds count:1 fromTemp:YES];
- [[NSGraphicsContext currentContext] flushGraphics];
- [self unlockFocus];
- }
-}
-
-
-- (void)eraseFromShapeBits:(fakeBoxRec *)rectList count:(int)count
-{
- unsigned long *dst = NULL; // don't assign yet
- int dstWidth = 0; // don't assign yet
- fakeBoxRec *r;
- fakeBoxRec *end;
-
- assert(mBitsPerPixel == 32);
- reallocShapeBits([self frame].size);
- dst = shapeBits;
- dstWidth = shapeWidth;
-
- for (r = rectList, end = rectList + count; r < end; r++) {
- unsigned long *dstline = dst + dstWidth*r->y1 + r->x1;
- int h = r->y2 - r->y1;
-
- while (h--) {
- unsigned long *dstp = dstline;
- int w = r->x2 - r->x1;
-
- while (w--) {
- *dstp++ = 0x00000000;
- }
- dstline += dstWidth;
- }
- }
-}
-
-// assumes X11 bits and temp bits are 32-bit
-- (void)copyToShapeBits:(fakeBoxRec *)rectList count:(int)count
-{
- unsigned long *src = (unsigned long *) mBits;
- unsigned long *dst = NULL; // don't assign yet
- int srcWidth = mBytesPerRow / 4;
- int dstWidth = 0; // don't assign yet
- fakeBoxRec *r;
- fakeBoxRec *end;
-
- assert(mBitsPerPixel == 32);
- reallocShapeBits([self frame].size);
- dst = shapeBits;
- dstWidth = shapeWidth;
-
- for (r = rectList, end = rectList + count; r < end; r++) {
- unsigned long *srcline = src + srcWidth*r->y1 + r->x1;
- unsigned long *dstline = dst + dstWidth*r->y1 + r->x1;
- int h = r->y2 - r->y1;
-
- while (h--) {
- unsigned long *srcp = srcline;
- unsigned long *dstp = dstline;
- int w = r->x2 - r->x1;
-
- while (w--) {
- *dstp++ = *srcp++ | 0xff000000;
- }
- srcline += srcWidth;
- dstline += dstWidth;
- }
- }
-}
-
-
-// Copy boxes to the screen from the per-window pixmaps where X draws.
-// rectList is in local, X-flipped coordinates.
-- (void)copyToScreen:(fakeBoxRec *)rectList count:(int)count
- fromTemp:(BOOL)copyFromTemp
-{
- unsigned char *offsetbits;
- fakeBoxRec *r;
- fakeBoxRec *end;
- NSRect bounds;
- char *srcBits;
- int bytesPerRow;
- int bitsPerPixel;
- int bitsPerSample;
- CGImageAlphaInfo alpha;
- CGContextRef destCtx = (CGContextRef)[[NSGraphicsContext currentContext]
- graphicsPort];
- CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
- // fixme colorspace leaks?
- const CGDataProviderDirectAccessCallbacks cb = {
- infobytes, NULL, NULL, NULL
- };
-
- if (copyFromTemp) {
- // shapeBits assumed to be 32-bit
- srcBits = (char *)shapeBits;
- bytesPerRow = 4 * shapeWidth;
- bitsPerPixel = 32;
- bitsPerSample = 8;
- alpha = kCGImageAlphaPremultipliedFirst; // premultiplied ARGB
- } else {
- srcBits = mBits;
- bytesPerRow = mBytesPerRow;
- bitsPerPixel = mBitsPerPixel;
- bitsPerSample = mBitsPerSample;
- alpha = kCGImageAlphaNoneSkipFirst; // xRGB
- }
-
- bounds = [self frame];
- bounds.origin.x = bounds.origin.y = 0;
-
- for (r = rectList, end = rectList + count; r < end; r++) {
- NSRect nsr = {{r->x1, r->y1}, {r->x2-r->x1, r->y2-r->y1}};
- CGRect destRect;
- CGDataProviderRef dataProviderRef;
- CGImageRef imageRef;
-
- // Clip to window
- // (bounds origin is (0,0) so it can be used in either flip)
- // fixme is this necessary with pixmap-per-window?
- nsr = NSIntersectionRect(nsr, bounds);
-
- // Disallow empty rects
- if (nsr.size.width <= 0 || nsr.size.height <= 0) continue;
-
- offsetbits = srcBits + (int)(nsr.origin.y * bytesPerRow +
- nsr.origin.x * bitsPerPixel/8);
-
- // Flip r to Cocoa-flipped
- nsr.origin.y = bounds.size.height - nsr.origin.y - nsr.size.height;
- destRect = CGRectMake(nsr.origin.x, nsr.origin.y,
- nsr.size.width, nsr.size.height);
-
- dataProviderRef = CGDataProviderCreateDirectAccess(offsetbits,
- destRect.size.height * bytesPerRow, &cb);
-
- imageRef = CGImageCreate(destRect.size.width, destRect.size.height,
- bitsPerSample, bitsPerPixel, bytesPerRow,
- colorSpace, alpha, dataProviderRef, NULL,
- 1, kCGRenderingIntentDefault);
-
- CGContextDrawImage(destCtx, destRect, imageRef);
- CGImageRelease(imageRef);
- CGDataProviderRelease(dataProviderRef);
- }
-}
-
-
-@end
diff --git a/xc/programs/Xserver/hw/darwin/bundle/XWindow.h b/xc/programs/Xserver/hw/darwin/bundle/XWindow.h
deleted file mode 100644
index 8afd8a172..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/XWindow.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * NSWindow subclass for Mac OS X rootless X server
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/XWindow.h,v 1.2 2001/09/17 03:08:40 torrey Exp $ */
-
-#import <Cocoa/Cocoa.h>
-#import "XView.h"
-
-#include "fakeBoxRec.h"
-
-@interface XWindow : NSWindow
-{
- XView *mView;
-}
-
-- (id)initWithContentRect:(NSRect)aRect
- isRoot:(BOOL)isRoot;
-- (void)dealloc;
-
-- (char *)bits;
-- (void)getBits:(char **)bits
- rowBytes:(int *)rowBytes
- depth:(int *)depth
- bitsPerPixel:(int *)bpp;
-
-- (void)refreshRects:(fakeBoxRec *)rectList
- count:(int)count;
-
-- (void)orderWindow:(NSWindowOrderingMode)place
- relativeTo:(int)otherWindowNumber;
-
-- (void)sendEvent:(NSEvent *)anEvent;
-- (BOOL)canBecomeMainWindow;
-- (BOOL)canBecomeKeyWindow;
-
-@end
diff --git a/xc/programs/Xserver/hw/darwin/bundle/XWindow.m b/xc/programs/Xserver/hw/darwin/bundle/XWindow.m
deleted file mode 100644
index 66909a611..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/XWindow.m
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * NSWindow subclass for Mac OS X rootless X server
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/XWindow.m,v 1.5 2001/11/06 23:18:14 torrey Exp $ */
-
-#import "XWindow.h"
-
-
-@implementation XWindow
-
-// XWindow MUST NOT autodisplay! Autodisplay can cause a deadlock.
-// event thread - autodisplay: locks view hierarchy, then window
-// X Server thread - window resize: locks window, then view hierarchy
-// Deadlock occurs if each thread gets one lock and waits for the other.
-
-// XWindow MUST defer! Otherwise an assertion fails in
-// NSViewHierarchyLock sometimes.
-
-- (id)initWithContentRect:(NSRect)aRect
- isRoot:(BOOL)isRoot
-{
- int style;
- NSRect viewRect = {{0, 0}, {aRect.size.width, aRect.size.height}};
- style = NSBorderlessWindowMask;
-
- self = [super initWithContentRect: aRect
- styleMask: style
- backing: NSBackingStoreBuffered
- defer: YES];
- if (! self) return NULL;
-
- [self setBackgroundColor:[NSColor clearColor]]; // erase transparent
- [self setAlphaValue:1.0]; // draw opaque
- [self setOpaque:YES]; // changed when window is shaped
-
- [self useOptimizedDrawing:YES]; // Has no overlapping sub-views
- [self setAutodisplay:NO]; // MUST NOT autodisplay! See comment above
- [self disableFlushWindow]; // We do all the flushing manually
- [self setHasShadow: !isRoot]; // All windows have shadows except root
-
- // [self setAcceptsMouseMovedEvents:YES]; // MUST be AFTER orderFront?
-
- mView = [[XView alloc] initWithFrame: viewRect];
- [self setContentView:mView];
- [self setInitialFirstResponder:mView];
-
- return self;
-}
-
-- (void)dealloc
-{
- [mView release];
- [super dealloc];
-}
-
-- (char *)bits
-{
- return [mView bits];
-}
-
-- (void)getBits:(char **)bits
- rowBytes:(int *)rowBytes
- depth:(int *)depth
- bitsPerPixel:(int *)bpp
-{
- [mView getBits:bits rowBytes:rowBytes depth:depth bitsPerPixel:bpp];
-}
-
-
-// rects are X-flip and LOCAL coords
-- (void)refreshRects:(fakeBoxRec *)rectList count:(int)count;
-{
- [mView refreshRects:rectList count:count];
-}
-
-
-// Deferred windows don't handle mouse moved events very well.
-- (void)orderWindow:(NSWindowOrderingMode)place
- relativeTo:(int)otherWindowNumber
-{
- [super orderWindow:place relativeTo:otherWindowNumber];
- [self setAcceptsMouseMovedEvents:YES];
-}
-
-- (void)sendEvent:(NSEvent *)anEvent
-{
- [super sendEvent:anEvent];
- [self setAcceptsMouseMovedEvents:YES];
-}
-
-// XWindow may be frameless, and frameless windows default to
-// NO key and NO main.
-// update: we *don't* want main or key status after all
-- (BOOL)canBecomeMainWindow
-{
- return NO;
-}
-
-- (BOOL)canBecomeKeyWindow
-{
- return NO;
-}
-
-@end
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Xserver.h b/xc/programs/Xserver/hw/darwin/bundle/Xserver.h
deleted file mode 100644
index 63690e3f1..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/Xserver.h
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// Xserver.h
-//
-// Created by Andreas Monitzer on January 6, 2001.
-//
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Xserver.h,v 1.13 2002/01/01 23:09:00 torrey Exp $ */
-
-#import <Cocoa/Cocoa.h>
-
-#include <drivers/event_status_driver.h> // for NXEvent
-
-@interface Xserver : NSObject {
- // server state
- NSRecursiveLock *serverLock;
- NSPort *signalPort;
- BOOL serverVisible;
- BOOL rootlessMenuBarVisible;
- BOOL appQuitting;
- UInt32 mouseState;
- Class windowClass;
-
- // server event queue
- BOOL sendServerEvents;
- int eventWriteFD;
-
- // Aqua interface
- IBOutlet NSWindow *modeWindow;
- IBOutlet id startupModeButton;
- IBOutlet NSWindow *helpWindow;
- IBOutlet id startupHelpButton;
- IBOutlet NSPanel *switchWindow;
-}
-
-- (id)init;
-
-- (BOOL)translateEvent:(NSEvent *)anEvent;
-- (BOOL)getNXMouse:(NXEvent*)ev;
-
-+ (void)append:(NSString*)value toEnv:(NSString*)name;
-
-- (void)startX;
-- (BOOL)startXClients;
-- (void)run;
-- (void)toggle;
-- (void)show;
-- (void)hide;
-- (void)killServer;
-- (void)readPasteboard;
-- (void)writePasteboard;
-- (void)sendNXEvent:(NXEvent*)ev;
-- (void)sendShowHide:(BOOL)show;
-
-// Aqua interface actions
-- (IBAction)startFullScreen:(id)sender;
-- (IBAction)startRootless:(id)sender;
-- (IBAction)closeHelpAndShow:(id)sender;
-- (IBAction)showAction:(id)sender;
-
-// NSApplication delegate
-- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
-- (void)applicationDidFinishLaunching:(NSNotification *)aNotification;
-- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag;
-- (void)applicationWillResignActive:(NSNotification *)aNotification;
-- (void)applicationWillBecomeActive:(NSNotification *)aNotification;
-
-// NSPort delegate
-- (void)handlePortMessage:(NSPortMessage *)portMessage;
-
-@end
-
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Xserver.m b/xc/programs/Xserver/hw/darwin/bundle/Xserver.m
deleted file mode 100644
index 55c66ca1e..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/Xserver.m
+++ /dev/null
@@ -1,828 +0,0 @@
-//
-// Xserver.m
-//
-// This class handles the interaction between the Cocoa front-end
-// and the Darwin X server thread.
-//
-// Created by Andreas Monitzer on January 6, 2001.
-//
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Xserver.m,v 1.37 2002/01/01 23:09:00 torrey Exp $ */
-
-#import "Xserver.h"
-#import "Preferences.h"
-#import "XWindow.h"
-#include "quartzCommon.h"
-
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/syslimits.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <pwd.h>
-#include <signal.h>
-#include <fcntl.h>
-
-// Types of shells
-enum {
- shell_Unknown,
- shell_Bourne,
- shell_C
-};
-
-typedef struct {
- char *name;
- int type;
-} shellList_t;
-
-static shellList_t const shellList[] = {
- { "csh", shell_C }, // standard C shell
- { "tcsh", shell_C }, // ... needs no introduction
- { "sh", shell_Bourne }, // standard Bourne shell
- { "zsh", shell_Bourne }, // Z shell
- { "bash", shell_Bourne }, // GNU Bourne again shell
- { NULL, shell_Unknown }
-};
-
-extern int argcGlobal;
-extern char **argvGlobal;
-extern char **envpGlobal;
-extern int main(int argc, char *argv[], char *envp[]);
-extern void HideMenuBar(void);
-extern void ShowMenuBar(void);
-static void childDone(int sig);
-
-static NSPortMessage *signalMessage;
-static pid_t clientPID;
-static Xserver *oneXserver;
-static NSRect aquaMenuBarBox;
-
-
-@implementation Xserver
-
-- (id)init
-{
- self = [super init];
- oneXserver = self;
-
- serverLock = [[NSRecursiveLock alloc] init];
- clientPID = 0;
- sendServerEvents = NO;
- serverVisible = NO;
- rootlessMenuBarVisible = YES;
- appQuitting = NO;
- mouseState = 0;
- eventWriteFD = quartzEventWriteFD;
- windowClass = [XWindow class];
-
- // set up a port to safely send messages to main thread from server thread
- signalPort = [[NSPort port] retain];
- signalMessage = [[NSPortMessage alloc] initWithSendPort:signalPort
- receivePort:signalPort components:nil];
-
- // set up receiving end
- [signalPort setDelegate:self];
- [[NSRunLoop currentRunLoop] addPort:signalPort
- forMode:NSDefaultRunLoopMode];
- [[NSRunLoop currentRunLoop] addPort:signalPort
- forMode:NSModalPanelRunLoopMode];
-
- return self;
-}
-
-- (NSApplicationTerminateReply)
- applicationShouldTerminate:(NSApplication *)sender
-{
- // Quit if the X server is not running
- if ([serverLock tryLock]) {
- appQuitting = YES;
- if (clientPID != 0)
- kill(clientPID, SIGINT);
- return NSTerminateNow;
- }
-
- if (clientPID != 0 || !quartzStartClients) {
- int but;
-
- // Hide the X server and stop sending it events
- [self hide];
- sendServerEvents = NO;
-
- but = NSRunAlertPanel(NSLocalizedString(@"Quit X server?",@""),
- NSLocalizedString(@"Quitting the X server will terminate any running X Window System programs.",@""),
- NSLocalizedString(@"Quit",@""),
- NSLocalizedString(@"Cancel",@""),
- nil);
-
- switch (but) {
- case NSAlertDefaultReturn: // quit
- break;
- case NSAlertAlternateReturn: // cancel
- sendServerEvents = YES;
- return NSTerminateCancel;
- }
- }
-
- appQuitting = YES;
- if (clientPID != 0)
- kill(clientPID, SIGINT);
- [self killServer];
- return NSTerminateNow;
-}
-
-// Ensure that everything has quit cleanly
-- (void)applicationWillTerminate:(NSNotification *)aNotification
-{
- // Make sure the client process has finished
- if (clientPID != 0) {
- NSLog(@"Waiting on client process...");
- sleep(2);
-
- // If the client process hasn't finished yet, kill it off
- if (clientPID != 0) {
- int clientStatus;
- NSLog(@"Killing client process...");
- killpg(clientPID, SIGKILL);
- waitpid(clientPID, &clientStatus, 0);
- }
- }
-
- // Wait until the X server thread quits
- [serverLock lock];
-}
-
-// returns YES when event was handled
-- (BOOL)translateEvent:(NSEvent *)anEvent
-{
- NXEvent ev;
- static BOOL mouse1Pressed = NO;
- BOOL onScreen;
-
- if (!sendServerEvents) {
- return NO;
- }
-
- ev.type = [anEvent type];
- ev.flags = [anEvent modifierFlags];
-
- if (!quartzRootless) {
- // Check for switch keypress
- if ((ev.type == NSKeyDown) && (![anEvent isARepeat]) &&
- ([anEvent keyCode] == [Preferences keyCode]))
- {
- unsigned int switchFlags = [Preferences modifiers];
-
- // Switch if all the switch modifiers are pressed, while none are
- // pressed that should not be, except for caps lock.
- if (((ev.flags & switchFlags) == switchFlags) &&
- ((ev.flags & ~(switchFlags | NSAlphaShiftKeyMask)) == 0))
- {
- [self toggle];
- return YES;
- }
- }
-
- if (!serverVisible)
- return NO;
- }
-
- // If the mouse is not on the valid X display area,
- // we don't send the X server key events.
- onScreen = [self getNXMouse:&ev];
-
- switch (ev.type) {
- case NSLeftMouseUp:
- if (quartzRootless && !mouse1Pressed) {
- // MouseUp after MouseDown in menu - ignore
- return NO;
- }
- mouse1Pressed = NO;
- break;
- case NSLeftMouseDown:
- if (quartzRootless &&
- ! ([anEvent window] &&
- [[anEvent window] isKindOfClass:windowClass])) {
- // Click in non X window - ignore
- return NO;
- }
- mouse1Pressed = YES;
- case NSMouseMoved:
- break;
- case NSLeftMouseDragged:
- case NSRightMouseDragged:
- case 27: // undocumented high button MouseDragged event
- ev.type=NSMouseMoved;
- break;
- case NSSystemDefined:
- if (![anEvent subtype]==7)
- return NO; // we only use multibutton mouse events
- if ([anEvent data1] & 1)
- return NO; // skip mouse button 1 events
- if (mouseState==[anEvent data2])
- return NO; // ignore double events
- ev.data.compound.subType=[anEvent subtype];
- ev.data.compound.misc.L[0]=[anEvent data1];
- ev.data.compound.misc.L[1]=mouseState=[anEvent data2];
- break;
- case NSScrollWheel:
- ev.data.scrollWheel.deltaAxis1=[anEvent deltaY];
- break;
- case NSKeyDown:
- case NSKeyUp:
- if (!onScreen)
- return NO;
- ev.data.key.keyCode = [anEvent keyCode];
- ev.data.key.repeat = [anEvent isARepeat];
- break;
- case NSFlagsChanged:
- ev.data.key.keyCode = [anEvent keyCode];
- break;
- case 25: // undocumented MouseDown
- case 26: // undocumented MouseUp
- // Hide these from AppKit to avoid its log messages
- return YES;
- default:
- return NO;
- }
-
- [self sendNXEvent:&ev];
-
- // Rootless: Send first NSLeftMouseDown to windows and views so window
- // ordering can be suppressed.
- // Don't pass further events - they (incorrectly?) bring the window
- // forward no matter what.
- if (quartzRootless &&
- (ev.type == NSLeftMouseDown || ev.type == NSLeftMouseUp) &&
- [anEvent clickCount] == 1 &&
- [[anEvent window] isKindOfClass:windowClass])
- {
- return NO;
- }
-
- return YES;
-}
-
-// Fill in NXEvent with mouse coordinates, inverting y coordinate.
-// For rootless mode, the menu bar is treated as not part of the usable
-// X display area and the cursor position is adjusted accordingly.
-// Returns YES if the cursor is not in the menu bar.
-- (BOOL)getNXMouse:(NXEvent*)ev
-{
- NSPoint pt = [NSEvent mouseLocation];
-
- ev->location.x = (int)(pt.x);
-
- if (quartzRootless && NSMouseInRect(pt, aquaMenuBarBox, NO)) {
- // mouse in menu bar - tell X11 that it's just below instead
- ev->location.y = aquaMenuBarHeight;
- return NO;
- } else {
- ev->location.y = NSHeight([[NSScreen mainScreen] frame]) - (int)(pt.y);
- return YES;
- }
-}
-
-// Append a string to the given enviroment variable
-+ (void)append:(NSString*)value toEnv:(NSString*)name
-{
- setenv([name cString],
- [[[NSString stringWithCString:getenv([name cString])]
- stringByAppendingString:value] cString],1);
-}
-
-- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
-{
- // Block SIGPIPE
- // SIGPIPE repeatably killed the (rootless) server when closing a
- // dozen xterms in rapid succession. Those SIGPIPEs should have been
- // sent to the X server thread, which ignores them, but somehow they
- // ended up in this thread instead.
- {
- sigset_t set;
- sigemptyset(&set);
- sigaddset(&set, SIGPIPE);
- // pthread_sigmask not implemented yet
- // pthread_sigmask(SIG_BLOCK, &set, NULL);
- sigprocmask(SIG_BLOCK, &set, NULL);
- }
-
- if (quartzRootless == -1) {
- // The display mode was not set from the command line.
- // Show mode pick panel?
- if ([Preferences modeWindow]) {
- [modeWindow makeKeyAndOrderFront:nil];
- } else {
- // Otherwise use default mode
- quartzRootless = [Preferences rootless];
- [self startX];
- }
- } else {
- [self startX];
- }
-}
-
-// Start the X server thread and the client process
-- (void)startX
-{
- NSDictionary *appDictionary;
- NSString *appVersion;
-
- [modeWindow close];
-
- // Calculate the height of the menu bar so rootless mode can avoid it
- if (quartzRootless) {
- aquaMenuBarHeight = NSHeight([[NSScreen mainScreen] frame]) -
- NSMaxY([[NSScreen mainScreen] visibleFrame]) - 1;
- aquaMenuBarBox =
- NSMakeRect(0, NSMaxY([[NSScreen mainScreen] visibleFrame]) + 1,
- NSWidth([[NSScreen mainScreen] frame]),
- aquaMenuBarHeight);
- }
-
- // Write the XDarwin version to the console log
- appDictionary = [[NSBundle mainBundle] infoDictionary];
- appVersion = [appDictionary objectForKey:@"CFBundleShortVersionString"];
- if (appVersion)
- NSLog(@"\n%@", appVersion);
- else
- NSLog(@"No version");
-
- // Start the X server thread
- [NSThread detachNewThreadSelector:@selector(run) toTarget:self
- withObject:nil];
- sendServerEvents = YES;
-
- // Start the X clients if started from GUI
- if (quartzStartClients) {
- [self startXClients];
- }
-
- if (quartzRootless) {
- // There is no help window for rootless; just start
- [helpWindow close];
- helpWindow = nil;
- if ([NSApp isActive])
- [self sendShowHide:YES];
- else
- [self sendShowHide:NO];
- } else {
- // Show the X switch window if not using dock icon switching
- if (![Preferences dockSwitch])
- [switchWindow orderFront:nil];
-
- if ([Preferences startupHelp]) {
- // display the full screen mode help
- [self sendShowHide:NO];
- [helpWindow makeKeyAndOrderFront:nil];
- } else {
- // start running full screen and make sure X is visible
- ShowMenuBar();
- [self closeHelpAndShow:nil];
- }
- }
-}
-
-// Start the first X clients in a separate process
-- (BOOL)startXClients
-{
- struct passwd *passwdUser;
- NSString *shellPath, *dashShellName, *commandStr, *startXPath;
- NSMutableString *safeStartXPath;
- NSRange aRange;
- NSBundle *thisBundle;
- const char *shellPathStr, *newargv[3], *shellNameStr;
- int fd[2], outFD, length, shellType, i;
-
- // Register to catch the signal when the client processs finishes
- signal(SIGCHLD, childDone);
-
- // Get user's password database entry
- passwdUser = getpwuid(getuid());
-
- // Find the shell to use
- if ([Preferences useDefaultShell])
- shellPath = [NSString stringWithCString:passwdUser->pw_shell];
- else
- shellPath = [Preferences shellString];
-
- dashShellName = [NSString stringWithFormat:@"-%@",
- [shellPath lastPathComponent]];
- shellPathStr = [shellPath cString];
- shellNameStr = [[shellPath lastPathComponent] cString];
-
- if (access(shellPathStr, X_OK)) {
- NSLog(@"Shell %s is not valid!", shellPathStr);
- return NO;
- }
-
- // Find the type of shell
- for (i = 0; shellList[i].name; i++) {
- if (!strcmp(shellNameStr, shellList[i].name))
- break;
- }
- shellType = shellList[i].type;
-
- newargv[0] = [dashShellName cString];
- if (shellType == shell_Bourne) {
- // Bourne shells need to be told they are interactive to make
- // sure they read all their initialization files.
- newargv[1] = "-i";
- newargv[2] = NULL;
- } else {
- newargv[1] = NULL;
- }
-
- // Create a pipe to communicate with the X client process
- NSAssert(pipe(fd) == 0, @"Could not create new pipe.");
-
- // Open a file descriptor for writing to stdout and stderr
- outFD = open("/dev/console", O_WRONLY, 0);
- if (outFD == -1) {
- outFD = open("/dev/null", O_WRONLY, 0);
- NSAssert(outFD != -1, @"Could not open shell output.");
- }
-
- // Fork process to start X clients in user's default shell
- // Sadly we can't use NSTask because we need to start a login shell.
- // Login shells are started by passing "-" as the first character of
- // argument 0. NSTask forces argument 0 to be the shell's name.
- clientPID = vfork();
- if (clientPID == 0) {
-
- // Inside the new process:
- if (fd[0] != STDIN_FILENO) {
- dup2(fd[0], STDIN_FILENO); // Take stdin from pipe
- close(fd[0]);
- }
- close(fd[1]); // Close write end of pipe
- if (outFD == STDOUT_FILENO) { // Setup stdout and stderr
- dup2(outFD, STDERR_FILENO);
- } else if (outFD == STDERR_FILENO) {
- dup2(outFD, STDOUT_FILENO);
- } else {
- dup2(outFD, STDERR_FILENO);
- dup2(outFD, STDOUT_FILENO);
- close(outFD);
- }
-
- // Setup environment
- setenv("HOME", passwdUser->pw_dir, 1);
- setenv("SHELL", shellPathStr, 1);
- setenv("LOGNAME", passwdUser->pw_name, 1);
- setenv("USER", passwdUser->pw_name, 1);
- setenv("TERM", "unknown", 1);
- if (chdir(passwdUser->pw_dir)) // Change to user's home dir
- NSLog(@"Could not change to user's home directory.");
-
- execv(shellPathStr, newargv); // Start user's shell
-
- NSLog(@"Could not start X client process with errno = %i.", errno);
- _exit(127);
- }
-
- // In parent process:
- close(fd[0]); // Close read end of pipe
- close(outFD); // Close output file descriptor
-
- thisBundle = [NSBundle bundleForClass:[self class]];
- startXPath = [thisBundle pathForResource:@"startXClients" ofType:nil];
- if (!startXPath) {
- NSLog(@"Could not find startXClients in application bundle!");
- return NO;
- }
-
- // We will run the startXClients script with the path in single quotes
- // in case there are problematic characters in the path. We still have
- // to worry about there being single quotes in the path. So, replace
- // all instances of the ' character in startXPath with '\''.
- safeStartXPath = [NSMutableString stringWithString:startXPath];
- aRange = NSMakeRange(0, [safeStartXPath length]);
- while (aRange.length) {
- aRange = [safeStartXPath rangeOfString:@"'" options:0 range:aRange];
- if (!aRange.length)
- break;
- [safeStartXPath replaceCharactersInRange:aRange
- withString:@"\'\\'\'"];
- aRange.location += 4;
- aRange.length = [safeStartXPath length] - aRange.location;
- }
-
- if ([Preferences addToPath]) {
- commandStr = [NSString stringWithFormat:@"'%@' :%d %@\n",
- safeStartXPath, [Preferences display],
- [Preferences addToPathString]];
- } else {
- commandStr = [NSString stringWithFormat:@"'%@' :%d\n",
- safeStartXPath, [Preferences display]];
- }
-
- length = [commandStr cStringLength];
- if (write(fd[1], [commandStr cString], length) != length) {
- NSLog(@"Write to X client process failed.");
- return NO;
- }
-
- // Close the pipe so that shell will terminate when xinit quits
- close(fd[1]);
-
- return YES;
-}
-
-// Run the X server thread
-- (void)run
-{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- [serverLock lock];
- main(argcGlobal, argvGlobal, envpGlobal);
- serverVisible = NO;
- [pool release];
- [serverLock unlock];
- QuartzMessageMainThread(kQuartzServerDied);
-}
-
-// Full screen mode was picked in the mode pick panel
-- (IBAction)startFullScreen:(id)sender
-{
- [Preferences setModeWindow:[startupModeButton intValue]];
- [Preferences saveToDisk];
- quartzRootless = FALSE;
- [self startX];
-}
-
-// Rootless mode was picked in the mode pick panel
-- (IBAction)startRootless:(id)sender
-{
- [Preferences setModeWindow:[startupModeButton intValue]];
- [Preferences saveToDisk];
- quartzRootless = TRUE;
- [self startX];
-}
-
-// Close the help splash screen and show the X server
-- (IBAction)closeHelpAndShow:(id)sender
-{
- if (sender) {
- int helpVal = [startupHelpButton intValue];
- [Preferences setStartupHelp:helpVal];
- [Preferences saveToDisk];
- }
- [helpWindow close];
- helpWindow = nil;
-
- serverVisible = YES;
- [self sendShowHide:YES];
- [NSApp activateIgnoringOtherApps:YES];
-}
-
-// Show the X server when sent message from GUI
-- (IBAction)showAction:(id)sender
-{
- if (sendServerEvents)
- [self sendShowHide:YES];
-}
-
-// Show or hide the X server or menu bar in rootless mode
-- (void)toggle
-{
- if (quartzRootless) {
-#if 0
- // FIXME: Remove or add option to not dodge menubar
- if (rootlessMenuBarVisible)
- HideMenuBar();
- else
- ShowMenuBar();
- rootlessMenuBarVisible = !rootlessMenuBarVisible;
-#endif
- } else {
- if (serverVisible)
- [self hide];
- else
- [self show];
- }
-}
-
-// Show the X server on screen
-- (void)show
-{
- if (!serverVisible && sendServerEvents) {
- [self sendShowHide:YES];
- }
-}
-
-// Hide the X server from the screen
-- (void)hide
-{
- if (serverVisible && sendServerEvents) {
- [self sendShowHide:NO];
- }
-}
-
-// Kill the X server thread
-- (void)killServer
-{
- NXEvent ev;
-
- if (serverVisible)
- [self hide];
-
- ev.type = NX_APPDEFINED;
- ev.data.compound.subType = kXDarwinQuit;
- [self sendNXEvent:&ev];
-}
-
-// Tell the X server to show or hide itself.
-// This ignores the current X server visible state.
-//
-// In full screen mode, the order we do things is important and must be
-// preserved between the threads. X drawing operations have to be performed
-// in the X server thread. It appears that we have the additional
-// constraint that we must hide and show the menu bar in the main thread.
-//
-// To show the X server:
-// 1. Capture the displays. (Main thread)
-// 2. Hide the menu bar. (Must be in main thread)
-// 3. Send event to X server thread to redraw X screen.
-// 4. Redraw the X screen. (Must be in X server thread)
-//
-// To hide the X server:
-// 1. Send event to X server thread to stop drawing.
-// 2. Stop drawing to the X screen. (Must be in X server thread)
-// 3. Message main thread that drawing is stopped.
-// 4. If main thread still wants X server hidden:
-// a. Release the displays. (Main thread)
-// b. Unhide the menu bar. (Must be in main thread)
-// Otherwise we have already queued an event to start drawing again.
-//
-- (void)sendShowHide:(BOOL)show
-{
- NXEvent ev;
-
- [self getNXMouse:&ev];
- ev.type = NX_APPDEFINED;
-
- if (show) {
- if (!quartzRootless) {
- QuartzCapture();
- HideMenuBar();
- }
- ev.data.compound.subType = kXDarwinShow;
- [self sendNXEvent:&ev];
-
- // inform the X server of the current modifier state
- ev.flags = [[NSApp currentEvent] modifierFlags];
- ev.data.compound.subType = kXDarwinUpdateModifiers;
- [self sendNXEvent:&ev];
-
- // put the pasteboard into the X cut buffer
- [self readPasteboard];
- } else {
- // put the X cut buffer on the pasteboard
- [self writePasteboard];
-
- ev.data.compound.subType = kXDarwinHide;
- [self sendNXEvent:&ev];
- }
-
- serverVisible = show;
-}
-
-// Tell the X server to read from the pasteboard into the X cut buffer
-- (void)readPasteboard
-{
- NXEvent ev;
-
- ev.type = NX_APPDEFINED;
- ev.data.compound.subType = kXDarwinReadPasteboard;
- [self sendNXEvent:&ev];
-}
-
-// Tell the X server to write the X cut buffer into the pasteboard
-- (void)writePasteboard
-{
- NXEvent ev;
-
- ev.type = NX_APPDEFINED;
- ev.data.compound.subType = kXDarwinWritePasteboard;
- [self sendNXEvent:&ev];
-}
-
-- (void)sendNXEvent:(NXEvent*)ev
-{
- int bytesWritten;
-
- if (quartzRootless &&
- (ev->type == NSLeftMouseDown || ev->type == NSLeftMouseUp ||
- (ev->type == NSSystemDefined && ev->data.compound.subType == 7)))
- {
- // mouse button event - send mouseMoved to this position too
- // X gets confused if it gets a click that isn't at the last
- // reported mouse position.
- NXEvent moveEvent = *ev;
- moveEvent.type = NSMouseMoved;
- [self sendNXEvent:&moveEvent];
- }
-
- bytesWritten = write(eventWriteFD, ev, sizeof(*ev));
- if (bytesWritten == sizeof(*ev))
- return;
- NSLog(@"Bad write to event pipe.");
- // FIXME: handle bad writes better?
-}
-
-// Handle messages from the X server thread
-- (void)handlePortMessage:(NSPortMessage *)portMessage
-{
- unsigned msg = [portMessage msgid];
-
- switch(msg) {
- case kQuartzServerHidden:
- // Make sure the X server wasn't queued to be shown again while
- // the hide was pending.
- if (!quartzRootless && !serverVisible) {
- QuartzRelease();
- ShowMenuBar();
- }
-
- // FIXME: This hack is necessary (but not completely effective)
- // since Mac OS X 10.0.2
- [NSCursor unhide];
- break;
-
- case kQuartzServerDied:
- sendServerEvents = NO;
- if (!appQuitting) {
- [NSApp terminate:nil]; // quit if we aren't already
- }
- break;
-
- default:
- NSLog(@"Unknown message from server thread.");
- }
-}
-
-// Quit the X server when the X client process finishes
-- (void)clientProcessDone:(int)clientStatus
-{
- if (WIFEXITED(clientStatus)) {
- int exitStatus = WEXITSTATUS(clientStatus);
- if (exitStatus != 0)
- NSLog(@"X client process terminated with status %i.", exitStatus);
- } else {
- NSLog(@"X client process terminated abnormally.");
- }
-
- if (!appQuitting) {
- [NSApp terminate:nil]; // quit if we aren't already
- }
-}
-
-// Called when the user clicks the application icon,
-// but not when Cmd-Tab is used.
-// Rootless: Don't switch until applicationWillBecomeActive.
-- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication
- hasVisibleWindows:(BOOL)flag
-{
- if ([Preferences dockSwitch] && !quartzRootless) {
- [self show];
- }
- return NO;
-}
-
-- (void)applicationWillResignActive:(NSNotification *)aNotification
-{
- [self hide];
-}
-
-- (void)applicationWillBecomeActive:(NSNotification *)aNotification
-{
- if (quartzRootless)
- [self show];
-}
-
-@end
-
-// Send a message to the main thread, which calls handlePortMessage in
-// response. Must only be called from the X server thread because
-// NSPort is not thread safe.
-void QuartzMessageMainThread(unsigned msg)
-{
- [signalMessage setMsgid:msg];
- [signalMessage sendBeforeDate:[NSDate distantPast]];
-}
-
-// Handle SIGCHLD signals
-static void childDone(int sig)
-{
- int clientStatus;
-
- if (clientPID == 0)
- return;
-
- // Make sure it was the client task that finished
- if (waitpid(clientPID, &clientStatus, WNOHANG) == clientPID) {
- if (WIFSTOPPED(clientStatus))
- return;
- clientPID = 0;
- [oneXserver clientProcessDone:clientStatus];
- }
-}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/fakeBoxRec.h b/xc/programs/Xserver/hw/darwin/bundle/fakeBoxRec.h
deleted file mode 100644
index 1e5027cc8..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/fakeBoxRec.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/fakeBoxRec.h,v 1.1 2001/07/01 02:13:41 torrey Exp $ */
-
-#ifndef FAKEBOXREC_H
-#define FAKEBOXREC_H
-
-// This struct is byte-compatible with X11's BoxRec, for use in
-// code that can't include X headers.
-typedef struct _fakeBox {
- short x1;
- short y1;
- short x2;
- short y2;
-} fakeBoxRec;
-
-#endif
diff --git a/xc/programs/Xserver/hw/darwin/bundle/ko.lproj/InfoPlist.strings.cpp b/xc/programs/Xserver/hw/darwin/bundle/ko.lproj/InfoPlist.strings.cpp
deleted file mode 100644
index 6beace14f..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/ko.lproj/InfoPlist.strings.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Korean localized versions of Info.plist keys. */
-/* Most of these are set in the target application settings. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/ko.lproj/InfoPlist.strings.cpp,v 1.1 2001/12/04 03:36:39 torrey Exp $ */
-
-NSHumanReadableCopyright = __quote__XFree86 XF86_VERSION\nCopyright 2001 XFree86 Project, Inc.__quote__
diff --git a/xc/programs/Xserver/hw/darwin/bundle/pseudoramiX.c b/xc/programs/Xserver/hw/darwin/bundle/pseudoramiX.c
deleted file mode 100644
index 22c48c12e..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/pseudoramiX.c
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- * Minimal implementation of PanoramiX/Xinerama
- *
- * This is used in rootless mode where the underlying window server
- * already provides an abstracted view of multiple screens as one
- * large screen area.
- *
- * This code is largely based on panoramiX.c, which contains the
- * following copyright notice:
- */
-/*****************************************************************
-Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
-BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of Digital Equipment Corporation
-shall not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from Digital
-Equipment Corporation.
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/pseudoramiX.c,v 1.3 2002/01/17 02:44:26 torrey Exp $ */
-
-#include "pseudoramiX.h"
-
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "window.h"
-#include "panoramiXproto.h"
-#include "globals.h"
-
-extern int ProcPanoramiXQueryVersion (ClientPtr client);
-
-static void PseudoramiXResetProc(ExtensionEntry *extEntry);
-
-static int ProcPseudoramiXQueryVersion(ClientPtr client);
-static int ProcPseudoramiXGetState(ClientPtr client);
-static int ProcPseudoramiXGetScreenCount(ClientPtr client);
-static int ProcPseudoramiXGetScreenSize(ClientPtr client);
-static int ProcPseudoramiXIsActive(ClientPtr client);
-static int ProcPseudoramiXQueryScreens(ClientPtr client);
-static int ProcPseudoramiXDispatch(ClientPtr client);
-
-static int SProcPseudoramiXQueryVersion(ClientPtr client);
-static int SProcPseudoramiXGetState(ClientPtr client);
-static int SProcPseudoramiXGetScreenCount(ClientPtr client);
-static int SProcPseudoramiXGetScreenSize(ClientPtr client);
-static int SProcPseudoramiXIsActive(ClientPtr client);
-static int SProcPseudoramiXQueryScreens(ClientPtr client);
-static int SProcPseudoramiXDispatch(ClientPtr client);
-
-
-typedef struct {
- int x;
- int y;
- int w;
- int h;
-} PseudoramiXScreenRec;
-
-static PseudoramiXScreenRec *pseudoramiXScreens = NULL;
-static int pseudoramiXScreensAllocated = 0;
-static int pseudoramiXNumScreens = 0;
-static int pseudoramiXGeneration = -1;
-
-
-// Add a PseudoramiX screen.
-// The rest of the X server will know nothing about this screen.
-// Can be called before or after extension init.
-// Screens must be re-added once per generation.
-void
-PseudoramiXAddScreen(int x, int y, int w, int h)
-{
- PseudoramiXScreenRec *s;
-
- if (noPseudoramiXExtension) return;
-
- if (pseudoramiXNumScreens == pseudoramiXScreensAllocated) {
- pseudoramiXScreensAllocated += pseudoramiXScreensAllocated + 1;
- pseudoramiXScreens = xrealloc(pseudoramiXScreens,
- pseudoramiXScreensAllocated *
- sizeof(PseudoramiXScreenRec));
- }
-
- s = &pseudoramiXScreens[pseudoramiXNumScreens++];
- s->x = x;
- s->y = y;
- s->w = w;
- s->h = h;
-}
-
-
-// Initialize PseudoramiX.
-// Copied from PanoramiXExtensionInit
-void PseudoramiXExtensionInit(int argc, char *argv[])
-{
- Bool success = FALSE;
- ExtensionEntry *extEntry;
-
- if (noPseudoramiXExtension) return;
-
- if (pseudoramiXNumScreens == 1 || aquaNumScreens == 1) {
- // Only one screen - disable Xinerama extension.
- noPseudoramiXExtension = TRUE;
- return;
- }
-
- // The server must not run the PanoramiX operations.
- noPanoramiXExtension = TRUE;
-
- if (pseudoramiXGeneration != serverGeneration) {
- extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0,
- ProcPseudoramiXDispatch,
- SProcPseudoramiXDispatch,
- PseudoramiXResetProc,
- StandardMinorOpcode);
- if (!extEntry) {
- ErrorF("PseudoramiXExtensionInit(): AddExtension failed\n");
- } else {
- pseudoramiXGeneration = serverGeneration;
- success = TRUE;
- }
- }
-
- if (!success) {
- ErrorF("%s Extension (PseudoramiX) failed to initialize\n",
- PANORAMIX_PROTOCOL_NAME);
- return;
- }
-}
-
-
-static void PseudoramiXResetProc(ExtensionEntry *extEntry)
-{
- pseudoramiXNumScreens = 0;
-}
-
-
-// was PanoramiX
-static int ProcPseudoramiXQueryVersion(ClientPtr client)
-{
- return ProcPanoramiXQueryVersion(client);
-}
-
-
-// was PanoramiX
-static int ProcPseudoramiXGetState(ClientPtr client)
-{
- REQUEST(xPanoramiXGetStateReq);
- WindowPtr pWin;
- xPanoramiXGetStateReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
- pWin = LookupWindow (stuff->window, client);
- if (!pWin)
- return BadWindow;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.state = !noPseudoramiXExtension;
- if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swaps (&rep.state, n);
- }
- WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
- return client->noClientException;
-}
-
-
-// was PanoramiX
-static int ProcPseudoramiXGetScreenCount(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenCountReq);
- WindowPtr pWin;
- xPanoramiXGetScreenCountReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
- pWin = LookupWindow (stuff->window, client);
- if (!pWin)
- return BadWindow;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.ScreenCount = pseudoramiXNumScreens;
- if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swaps (&rep.ScreenCount, n);
- }
- WriteToClient (client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep);
- return client->noClientException;
-}
-
-
-// was PanoramiX
-static int ProcPseudoramiXGetScreenSize(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenSizeReq);
- WindowPtr pWin;
- xPanoramiXGetScreenSizeReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
- pWin = LookupWindow (stuff->window, client);
- if (!pWin)
- return BadWindow;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- /* screen dimensions */
- rep.width = pseudoramiXScreens[stuff->screen].w;
- // was panoramiXdataPtr[stuff->screen].width;
- rep.height = pseudoramiXScreens[stuff->screen].h;
- // was panoramiXdataPtr[stuff->screen].height;
- if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swaps (&rep.width, n);
- swaps (&rep.height, n);
- }
- WriteToClient (client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep);
- return client->noClientException;
-}
-
-
-// was Xinerama
-static int ProcPseudoramiXIsActive(ClientPtr client)
-{
- /* REQUEST(xXineramaIsActiveReq); */
- xXineramaIsActiveReply rep;
-
- REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.state = !noPseudoramiXExtension;
- if (client->swapped) {
- register int n;
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.state, n);
- }
- WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep);
- return client->noClientException;
-}
-
-
-// was Xinerama
-static int ProcPseudoramiXQueryScreens(ClientPtr client)
-{
- /* REQUEST(xXineramaQueryScreensReq); */
- xXineramaQueryScreensReply rep;
-
- REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.number = noPseudoramiXExtension ? 0 : pseudoramiXNumScreens;
- rep.length = rep.number * sz_XineramaScreenInfo >> 2;
- if (client->swapped) {
- register int n;
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.number, n);
- }
- WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep);
-
- if (!noPseudoramiXExtension) {
- xXineramaScreenInfo scratch;
- int i;
-
- for(i = 0; i < pseudoramiXNumScreens; i++) {
- scratch.x_org = pseudoramiXScreens[i].x;
- scratch.y_org = pseudoramiXScreens[i].y;
- scratch.width = pseudoramiXScreens[i].w;
- scratch.height = pseudoramiXScreens[i].h;
-
- if(client->swapped) {
- register int n;
- swaps (&scratch.x_org, n);
- swaps (&scratch.y_org, n);
- swaps (&scratch.width, n);
- swaps (&scratch.height, n);
- }
- WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch);
- }
- }
-
- return client->noClientException;
-}
-
-
-// was PanoramiX
-static int ProcPseudoramiXDispatch (ClientPtr client)
-{ REQUEST(xReq);
- switch (stuff->data)
- {
- case X_PanoramiXQueryVersion:
- return ProcPseudoramiXQueryVersion(client);
- case X_PanoramiXGetState:
- return ProcPseudoramiXGetState(client);
- case X_PanoramiXGetScreenCount:
- return ProcPseudoramiXGetScreenCount(client);
- case X_PanoramiXGetScreenSize:
- return ProcPseudoramiXGetScreenSize(client);
- case X_XineramaIsActive:
- return ProcPseudoramiXIsActive(client);
- case X_XineramaQueryScreens:
- return ProcPseudoramiXQueryScreens(client);
- }
- return BadRequest;
-}
-
-
-
-static int
-SProcPseudoramiXQueryVersion (ClientPtr client)
-{
- REQUEST(xPanoramiXQueryVersionReq);
- register int n;
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
- return ProcPseudoramiXQueryVersion(client);
-}
-
-static int
-SProcPseudoramiXGetState(ClientPtr client)
-{
- REQUEST(xPanoramiXGetStateReq);
- register int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
- return ProcPseudoramiXGetState(client);
-}
-
-static int
-SProcPseudoramiXGetScreenCount(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenCountReq);
- register int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
- return ProcPseudoramiXGetScreenCount(client);
-}
-
-static int
-SProcPseudoramiXGetScreenSize(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenSizeReq);
- register int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
- return ProcPseudoramiXGetScreenSize(client);
-}
-
-
-static int
-SProcPseudoramiXIsActive(ClientPtr client)
-{
- REQUEST(xXineramaIsActiveReq);
- register int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
- return ProcPseudoramiXIsActive(client);
-}
-
-
-static int
-SProcPseudoramiXQueryScreens(ClientPtr client)
-{
- REQUEST(xXineramaQueryScreensReq);
- register int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
- return ProcPseudoramiXQueryScreens(client);
-}
-
-
-static int
-SProcPseudoramiXDispatch (ClientPtr client)
-{ REQUEST(xReq);
- switch (stuff->data)
- {
- case X_PanoramiXQueryVersion:
- return SProcPseudoramiXQueryVersion(client);
- case X_PanoramiXGetState:
- return SProcPseudoramiXGetState(client);
- case X_PanoramiXGetScreenCount:
- return SProcPseudoramiXGetScreenCount(client);
- case X_PanoramiXGetScreenSize:
- return SProcPseudoramiXGetScreenSize(client);
- case X_XineramaIsActive:
- return SProcPseudoramiXIsActive(client);
- case X_XineramaQueryScreens:
- return SProcPseudoramiXQueryScreens(client);
- }
- return BadRequest;
-}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/pseudoramiX.h b/xc/programs/Xserver/hw/darwin/bundle/pseudoramiX.h
deleted file mode 100644
index cb4c06fda..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/pseudoramiX.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * Minimal implementation of PanoramiX/Xinerama
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/pseudoramiX.h,v 1.3 2002/01/17 02:44:26 torrey Exp $ */
-
-extern int noPseudoramiXExtension;
-extern int aquaNumScreens;
-
-void PseudoramiXAddScreen(int x, int y, int w, int h);
-void PseudoramiXExtensionInit(int argc, char *argv[]);
diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartz.c b/xc/programs/Xserver/hw/darwin/bundle/quartz.c
deleted file mode 100644
index 9f258fef7..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/quartz.c
+++ /dev/null
@@ -1,513 +0,0 @@
-/**************************************************************
- *
- * Quartz-specific support for the Darwin X Server
- *
- * By Gregory Robert Parker
- *
- **************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartz.c,v 1.24 2002/01/17 02:44:26 torrey Exp $ */
-
-#include "quartzCommon.h"
-#include "quartz.h"
-#include "darwin.h"
-#include "quartzAudio.h"
-#include "quartzCursor.h"
-#include "rootlessAqua.h"
-#include "pseudoramiX.h"
-
-// X headers
-#include "scrnintstr.h"
-#include "colormapst.h"
-
-// System headers
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <IOKit/pwr_mgt/IOPMLib.h>
-
-// Shared global variables for Quartz modes
-int quartzEventWriteFD = -1;
-int quartzStartClients = 1;
-int quartzRootless = -1;
-int quartzUseSysBeep = 0;
-int quartzServerVisible = TRUE;
-int quartzScreenIndex = 0;
-int aquaMenuBarHeight = 0;
-int noPseudoramiXExtension = TRUE;
-int aquaNumScreens = 0;
-
-// Full screen specific per screen storage structure
-typedef struct {
- CGDirectDisplayID displayID;
- CFDictionaryRef xDisplayMode;
- CFDictionaryRef aquaDisplayMode;
- CGDirectPaletteRef xPalette;
- CGDirectPaletteRef aquaPalette;
-} QuartzFSScreenRec, *QuartzFSScreenPtr;
-
-#define FULLSCREEN_PRIV(pScreen) \
- ((QuartzFSScreenPtr)pScreen->devPrivates[quartzFSScreenIndex].ptr)
-
-static int quartzFSScreenIndex;
-static CGDisplayCount quartzDisplayCount = 0;
-static CGDirectDisplayID *quartzDisplayList = NULL;
-
-
-/*
- * QuartzFSStoreColors
- * This is a callback from X to change the hardware colormap
- * when using PsuedoColor in full screen mode.
- */
-static void QuartzFSStoreColors(
- ColormapPtr pmap,
- int numEntries,
- xColorItem *pdefs)
-{
- ScreenPtr pScreen = pmap->pScreen;
- QuartzFSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen);
- CGDirectPaletteRef palette = fsDisplayInfo->xPalette;
- CGDeviceColor color;
- int i;
-
- if (! palette)
- return;
-
- for (i = 0; i < numEntries; i++) {
- color.red = pdefs[i].red / 65535.0;
- color.green = pdefs[i].green / 65535.0;
- color.blue = pdefs[i].blue / 65535.0;
- CGPaletteSetColorAtIndex(palette, color, pdefs[i].pixel);
- }
-
- if (quartzServerVisible)
- CGDisplaySetPalette(fsDisplayInfo->displayID, palette);
-}
-
-/*
-===========================================================================
-
- Screen functions
-
-===========================================================================
-*/
-
-/*
- * QuartzPMThread
- * Handle power state notifications, FIXME
- */
-#if 0
-static void *QuartzPMThread(void *arg)
-{
- for (;;) {
- mach_msg_return_t kr;
- mach_msg_empty_rcv_t msg;
-
- kr = mach_msg((mach_msg_header_t*) &msg, MACH_RCV_MSG, 0,
- sizeof(msg), pmNotificationPort, 0, MACH_PORT_NULL);
- kern_assert(kr);
-
- // computer just woke up
- if (msg.header.msgh_id == 1) {
- if (quartzServerVisible) {
- int i;
-
- for (i = 0; i < screenInfo.numScreens; i++) {
- if (screenInfo.screens[i])
- xf86SetRootClip(screenInfo.screens[i], true);
- }
- }
- }
- }
- return NULL;
-}
-#endif
-
-
-/*
- * QuartzFSFindDisplayMode
- * Find the appropriate display mode to use in full screen mode.
- * If display mode is not the same as the current Aqua mode, switch
- * to the new mode.
- */
-static Bool QuartzFSFindDisplayMode(
- QuartzFSScreenPtr fsDisplayInfo)
-{
- CGDirectDisplayID cgID = fsDisplayInfo->displayID;
- size_t height, width, bpp;
- boolean_t exactMatch;
-
- fsDisplayInfo->aquaDisplayMode = CGDisplayCurrentMode(cgID);
-
- // If no user options, use current display mode
- if (darwinDesiredWidth == 0 && darwinDesiredDepth == -1 &&
- darwinDesiredRefresh == -1)
- {
- fsDisplayInfo->xDisplayMode = fsDisplayInfo->aquaDisplayMode;
- return TRUE;
- }
-
- // If the user has no choice for size, use current
- if (darwinDesiredWidth == 0) {
- width = CGDisplayPixelsWide(cgID);
- height = CGDisplayPixelsHigh(cgID);
- } else {
- width = darwinDesiredWidth;
- height = darwinDesiredHeight;
- }
-
- switch (darwinDesiredDepth) {
- case 0:
- bpp = 8;
- break;
- case 1:
- bpp = 16;
- break;
- case 2:
- bpp = 32;
- break;
- default:
- bpp = CGDisplayBitsPerPixel(cgID);
- }
-
- if (darwinDesiredRefresh == -1) {
- fsDisplayInfo->xDisplayMode =
- CGDisplayBestModeForParameters(cgID, bpp, width, height,
- &exactMatch);
- } else {
- fsDisplayInfo->xDisplayMode =
- CGDisplayBestModeForParametersAndRefreshRate(cgID, bpp,
- width, height, darwinDesiredRefresh, &exactMatch);
- }
- if (!exactMatch) {
- fsDisplayInfo->xDisplayMode = fsDisplayInfo->aquaDisplayMode;
- return FALSE;
- }
-
- // Switch to the new display mode
- CGDisplaySwitchToMode(cgID, fsDisplayInfo->xDisplayMode);
- return TRUE;
-}
-
-
-/*
- * QuartzFSAddScreen
- * Do initialization of each screen for Quartz in full screen mode.
- */
-static Bool QuartzFSAddScreen(
- int index,
- ScreenPtr pScreen)
-{
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- QuartzScreenPtr displayInfo = QUARTZ_PRIV(pScreen);
- CGDirectDisplayID cgID = quartzDisplayList[index];
- CGRect bounds;
- QuartzFSScreenPtr fsDisplayInfo;
-
- // Allocate space for private per screen fullscreen specific storage.
- fsDisplayInfo = xalloc(sizeof(QuartzFSScreenRec));
- FULLSCREEN_PRIV(pScreen) = fsDisplayInfo;
-
- displayInfo->displayCount = 1;
- displayInfo->displayIDs = xrealloc(displayInfo->displayIDs,
- 1 * sizeof(CGDirectDisplayID));
- displayInfo->displayIDs[0] = cgID;
-
- fsDisplayInfo->displayID = cgID;
- fsDisplayInfo->xDisplayMode = 0;
- fsDisplayInfo->aquaDisplayMode = 0;
- fsDisplayInfo->xPalette = 0;
- fsDisplayInfo->aquaPalette = 0;
-
- // Capture full screen because X doesn't like read-only framebuffer.
- // We need to do this before we (potentially) switch the display mode.
- CGDisplayCapture(cgID);
-
- if (! QuartzFSFindDisplayMode(fsDisplayInfo)) {
- ErrorF("Could not support specified display mode on screen %i.\n",
- index);
- xfree(fsDisplayInfo);
- return FALSE;
- }
-
- // Don't need to flip y-coordinate as CoreGraphics treats (0, 0)
- // as the top left of main screen.
- bounds = CGDisplayBounds(cgID);
- dfb->x = bounds.origin.x;
- dfb->y = bounds.origin.y;
- dfb->width = bounds.size.width;
- dfb->height = bounds.size.height;
- dfb->pitch = CGDisplayBytesPerRow(cgID);
- dfb->bitsPerPixel = CGDisplayBitsPerPixel(cgID);
- dfb->pixelInfo.componentCount = CGDisplaySamplesPerPixel(cgID);
-
- if (dfb->bitsPerPixel == 8) {
- if (CGDisplayCanSetPalette(cgID)) {
- dfb->pixelInfo.pixelType = kIOCLUTPixels;
- } else {
- dfb->pixelInfo.pixelType = kIOFixedCLUTPixels;
- }
- dfb->pixelInfo.bitsPerComponent = 8;
- dfb->colorBitsPerPixel = 8;
- } else {
- dfb->pixelInfo.pixelType = kIORGBDirectPixels;
- dfb->pixelInfo.bitsPerComponent = CGDisplayBitsPerSample(cgID);
- dfb->colorBitsPerPixel = (dfb->pixelInfo.componentCount *
- dfb->pixelInfo.bitsPerComponent);
- }
-
- dfb->framebuffer = CGDisplayBaseAddress(cgID);
-
- return TRUE;
-}
-
-
-/*
- * QuartzAddScreen
- * Do mode dependent initialization of each screen for Quartz.
- */
-Bool QuartzAddScreen(
- int index,
- ScreenPtr pScreen)
-{
- // allocate space for private per screen Quartz specific storage
- QuartzScreenPtr displayInfo = xcalloc(sizeof(QuartzScreenRec), 1);
- QUARTZ_PRIV(pScreen) = displayInfo;
-
- // do full screen or rootless specific initialization
- if (quartzRootless) {
- return AquaAddScreen(index, pScreen);
- } else {
- return QuartzFSAddScreen(index, pScreen);
- }
-}
-
-
-/*
- * QuartzFSSetupScreen
- * Finalize full screen specific setup of each screen.
- */
-static Bool QuartzFSSetupScreen(
- int index,
- ScreenPtr pScreen)
-{
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- QuartzFSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen);
- CGDirectDisplayID cgID = fsDisplayInfo->displayID;
-
- if (dfb->pixelInfo.pixelType == kIOCLUTPixels) {
- // initialize colormap handling
- size_t aquaBpp;
-
- CFNumberGetValue(CFDictionaryGetValue(fsDisplayInfo->aquaDisplayMode,
- kCGDisplayBitsPerPixel), kCFNumberLongType, &aquaBpp);
- if (aquaBpp <= 8)
- fsDisplayInfo->aquaPalette = CGPaletteCreateWithDisplay(cgID);
- fsDisplayInfo->xPalette = CGPaletteCreateDefaultColorPalette();
- pScreen->StoreColors = QuartzFSStoreColors;
- }
-
- return TRUE;
-}
-
-
-/*
- * QuartzSetupScreen
- * Finalize mode specific setup of each screen.
- */
-Bool QuartzSetupScreen(
- int index,
- ScreenPtr pScreen)
-{
- // setup cursor support
- if (! QuartzInitCursor(pScreen))
- return FALSE;
-
- // do full screen or rootless specific setup
- if (quartzRootless) {
- if (! AquaSetupScreen(index, pScreen))
- return FALSE;
- } else {
- if (! QuartzFSSetupScreen(index, pScreen))
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * QuartzCapture
- * Capture the screen so we can draw. Called directly from the main thread
- * to synchronize with hiding the menubar.
- */
-void QuartzCapture(void)
-{
- int i;
-
- for (i = 0; i < screenInfo.numScreens; i++) {
- QuartzFSScreenPtr fsDisplayInfo =
- FULLSCREEN_PRIV(screenInfo.screens[i]);
- CGDirectDisplayID cgID = fsDisplayInfo->displayID;
-
- if (!CGDisplayIsCaptured(cgID) && !quartzRootless) {
- CGDisplayCapture(cgID);
- fsDisplayInfo->aquaDisplayMode = CGDisplayCurrentMode(cgID);
- if (fsDisplayInfo->xDisplayMode != fsDisplayInfo->aquaDisplayMode)
- CGDisplaySwitchToMode(cgID, fsDisplayInfo->xDisplayMode);
- if (fsDisplayInfo->xPalette)
- CGDisplaySetPalette(cgID, fsDisplayInfo->xPalette);
- }
- }
-}
-
-
-/*
- * QuartzRelease
- * Release the screen so others can draw.
- */
-void QuartzRelease(void)
-{
- int i;
-
- for (i = 0; i < screenInfo.numScreens; i++) {
- QuartzFSScreenPtr fsDisplayInfo =
- FULLSCREEN_PRIV(screenInfo.screens[i]);
- CGDirectDisplayID cgID = fsDisplayInfo->displayID;
-
- if (CGDisplayIsCaptured(cgID) && !quartzRootless) {
- if (fsDisplayInfo->xDisplayMode != fsDisplayInfo->aquaDisplayMode)
- CGDisplaySwitchToMode(cgID, fsDisplayInfo->aquaDisplayMode);
- if (fsDisplayInfo->aquaPalette)
- CGDisplaySetPalette(cgID, fsDisplayInfo->aquaPalette);
- CGDisplayRelease(cgID);
- }
- }
-}
-
-
-/*
- * QuartzFSDisplayInit
- * Full screen specific initialization called from InitOutput.
- */
-static void QuartzFSDisplayInit(void)
-{
- static unsigned long generation = 0;
-
- // Allocate private storage for each screen's mode specific info
- if (generation != serverGeneration) {
- quartzFSScreenIndex = AllocateScreenPrivateIndex();
- generation = serverGeneration;
- }
-
- // Find all the CoreGraphics displays
- CGGetActiveDisplayList(0, NULL, &quartzDisplayCount);
- quartzDisplayList = xalloc(quartzDisplayCount * sizeof(CGDirectDisplayID));
- CGGetActiveDisplayList(quartzDisplayCount, quartzDisplayList,
- &quartzDisplayCount);
-
- darwinScreensFound = quartzDisplayCount;
- atexit(QuartzRelease);
-}
-
-
-/*
- * QuartzInitOutput
- * Quartz display initialization.
- */
-void QuartzInitOutput(
- int argc,
- char **argv )
-{
- static unsigned long generation = 0;
-
- // Allocate private storage for each screen's Quartz specific info
- if (generation != serverGeneration) {
- quartzScreenIndex = AllocateScreenPrivateIndex();
- generation = serverGeneration;
- }
-
- if (serverGeneration == 0) {
- QuartzAudioInit();
- }
-
- if (quartzRootless) {
- ErrorF("Display mode: Rootless Quartz\n");
- AquaDisplayInit();
- } else {
- ErrorF("Display mode: Full screen Quartz\n");
- QuartzFSDisplayInit();
- }
-
- // Init PseudoramiX implementation of Xinerama.
- // This should be in InitExtensions, but that causes link errors
- // for servers that don't link in pseudoramiX.c.
- if (!noPseudoramiXExtension) {
- PseudoramiXExtensionInit(argc, argv);
- }
-}
-
-
-/*
- * QuartzShow
- * Show the X server on screen. Does nothing if already shown.
- * Restore the X clip regions the X server cursor state.
- */
-void QuartzShow(
- int x, // cursor location
- int y )
-{
- int i;
-
- if (!quartzServerVisible) {
- quartzServerVisible = TRUE;
- for (i = 0; i < screenInfo.numScreens; i++) {
- if (screenInfo.screens[i]) {
- QuartzResumeXCursor(screenInfo.screens[i], x, y);
- if (!quartzRootless)
- xf86SetRootClip(screenInfo.screens[i], TRUE);
- }
- }
- }
-}
-
-
-/*
- * QuartzHide
- * Remove the X server display from the screen. Does nothing if already
- * hidden. Set X clip regions to prevent drawing, and restore the Aqua
- * cursor.
- */
-void QuartzHide(void)
-{
- int i;
-
- if (quartzServerVisible) {
- for (i = 0; i < screenInfo.numScreens; i++) {
- if (screenInfo.screens[i]) {
- QuartzSuspendXCursor(screenInfo.screens[i]);
- if (!quartzRootless)
- xf86SetRootClip(screenInfo.screens[i], FALSE);
- }
- }
- }
- quartzServerVisible = FALSE;
- QuartzMessageMainThread(kQuartzServerHidden);
-}
-
-
-/*
- * QuartzGiveUp
- * Cleanup before X server shutdown
- * Release the screen and restore the Aqua cursor.
- */
-void QuartzGiveUp(void)
-{
- int i;
-
- for (i = 0; i < screenInfo.numScreens; i++) {
- if (screenInfo.screens[i]) {
- QuartzSuspendXCursor(screenInfo.screens[i]);
- }
- }
- QuartzRelease();
-}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartz.h b/xc/programs/Xserver/hw/darwin/bundle/quartz.h
deleted file mode 100644
index 510bef847..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/quartz.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * quartz.h
- *
- * External interface of the Quartz modes seen by the generic, mode
- * independent parts of the Darwin X server.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartz.h,v 1.8 2001/12/22 05:28:35 torrey Exp $ */
-
-#ifndef _QUARTZ_H
-#define _QUARTZ_H
-
-#include "screenint.h"
-#include "quartzPasteboard.h"
-
-int QuartzProcessArgument(int argc, char *argv[], int i);
-void QuartzInitOutput(int argc, char **argv);
-Bool QuartzAddScreen(int index, ScreenPtr pScreen);
-Bool QuartzSetupScreen(int index, ScreenPtr pScreen);
-void QuartzGiveUp(void);
-void QuartzHide(void);
-void QuartzShow(int x, int y);
-
-#endif
diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartzAudio.c b/xc/programs/Xserver/hw/darwin/bundle/quartzAudio.c
deleted file mode 100644
index 567c5b8a4..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/quartzAudio.c
+++ /dev/null
@@ -1,317 +0,0 @@
-//
-// QuartzAudio.m
-//
-// X Window bell support using CoreAudio or AppKit.
-// Greg Parker gparker@cs.stanford.edu 19 Feb 2001
-//
-// Info about sine wave sound playback:
-// CoreAudio code derived from macosx-dev posting by Tim Wood
-// http://www.omnigroup.com/mailman/archive/macosx-dev/2000-May/002004.html
-// Smoothing transitions between sounds
-// http://www.wam.umd.edu/~mphoenix/dss/dss.html
-//
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzAudio.c,v 1.5 2001/09/23 04:04:49 torrey Exp $ */
-
-#include "quartzCommon.h"
-#include "quartzAudio.h"
-
-#include <CoreAudio/CoreAudio.h>
-#include <pthread.h>
-
-#include "inputstr.h"
-#include "extensions/XI.h"
-
-void NSBeep();
-
-typedef struct QuartzAudioRec {
- double frequency;
- double amplitude;
-
- UInt32 curFrame;
- UInt32 remainingFrames;
- UInt32 totalFrames;
- UInt32 bytesPerFrame;
- double sampleRate;
- UInt32 fadeLength;
-
- UInt32 bufferByteCount;
- Boolean playing;
- pthread_mutex_t lock;
-
- // used to fade out interrupted sound and avoid 'pop'
- double prevFrequency;
- double prevAmplitude;
- UInt32 prevFrame;
-} QuartzAudioRec;
-
-static AudioDeviceID quartzAudioDevice = kAudioDeviceUnknown;
-static QuartzAudioRec data;
-
-
-/*
- * QuartzAudioEnvelope
- * Fade sound in and out to avoid pop.
- * Sounds with shorter duration will never reach full amplitude. Deal.
- */
-static double QuartzAudioEnvelope(
- UInt32 curFrame,
- UInt32 totalFrames,
- UInt32 fadeLength )
-{
- double fadeFrames = min(fadeLength, totalFrames / 2);
- if (fadeFrames < 1) return 0;
-
- if (curFrame < fadeFrames) {
- return curFrame / fadeFrames;
- } else if (curFrame > totalFrames - fadeFrames) {
- return (totalFrames-curFrame) / fadeFrames;
- } else {
- return 1.0;
- }
-}
-
-
-/*
- * QuartzFillBuffer
- * Fill this buffer with data and update the data position.
- * FIXME: this is ugly
- */
-static void QuartzFillBuffer(
- AudioBuffer *audiobuffer,
- QuartzAudioRec *data )
-{
- float *buffer, *b;
- unsigned int frame, frameCount;
- unsigned int bufferFrameCount;
- float multiplier, v;
- int i;
-
- buffer = (float *)audiobuffer->mData;
- bufferFrameCount = audiobuffer->mDataByteSize / data->bytesPerFrame;
-
- frameCount = min(bufferFrameCount, data->remainingFrames);
-
- // Fade out previous sine wave, if any.
- b = buffer;
- if (data->prevFrame) {
- multiplier = 2*M_PI*(data->prevFrequency/data->sampleRate);
- for (frame = 0; frame < data->fadeLength; frame++) {
- v = data->prevAmplitude *
- QuartzAudioEnvelope(frame+data->fadeLength,
- 2*data->fadeLength,
- data->fadeLength) *
- sin(multiplier * (data->prevFrame+frame));
- for (i = 0; i < audiobuffer->mNumberChannels; i++) {
- *b++ = v;
- }
- }
- // no more prev fade
- data->prevFrame = 0;
-
- // adjust for space eaten by prev fade
- buffer += audiobuffer->mNumberChannels*frame;
- bufferFrameCount -= frame;
- frameCount = min(bufferFrameCount, data->remainingFrames);
- }
-
- // Write a sine wave with the specified frequency and amplitude
- multiplier = 2*M_PI*(data->frequency/data->sampleRate);
- for (frame = 0; frame < frameCount; frame++) {
- v = data->amplitude *
- QuartzAudioEnvelope(data->curFrame+frame, data->totalFrames,
- data->fadeLength) *
- sin(multiplier * (data->curFrame+frame));
- for (i = 0; i < audiobuffer->mNumberChannels; i++) {
- *b++ = v;
- }
- }
-
- // Zero out the rest of the buffer, if any
- memset(b, 0, sizeof(float) * audiobuffer->mNumberChannels *
- (bufferFrameCount-frame));
-
- data->curFrame += frameCount;
- data->remainingFrames -= frameCount;
- if (data->remainingFrames == 0) {
- data->playing = FALSE;
- data->curFrame = 0;
- }
-}
-
-
-/*
- * QuartzAudioIOProc
- * Callback function for audio playback.
- * FIXME: use inOutputTime to correct for skipping
- */
-static OSStatus
-QuartzAudioIOProc(
- AudioDeviceID inDevice,
- const AudioTimeStamp *inNow,
- const AudioBufferList *inInputData,
- const AudioTimeStamp *inInputTime,
- AudioBufferList *outOutputData,
- const AudioTimeStamp *inOutputTime,
- void *inClientData )
-{
- QuartzAudioRec *data = (QuartzAudioRec *)inClientData;
- int i;
- Boolean wasPlaying;
-
- pthread_mutex_lock(&data->lock);
- wasPlaying = data->playing;
- for (i = 0; i < outOutputData->mNumberBuffers; i++) {
- if (data->playing) {
- QuartzFillBuffer(outOutputData->mBuffers+i, data);
- }
- else {
- memset(outOutputData->mBuffers[i].mData, 0,
- outOutputData->mBuffers[i].mDataByteSize);
- }
- }
- if (wasPlaying && !data->playing) {
- OSStatus err;
- err = AudioDeviceStop(inDevice, QuartzAudioIOProc);
- }
- pthread_mutex_unlock(&data->lock);
- return 0;
-}
-
-
-/*
- * QuartzCoreAudioBell
- * Play a tone using the CoreAudio API
- */
-static void QuartzCoreAudioBell(
- int volume, // volume is % of max
- int pitch, // pitch is Hz
- int duration ) // duration is milliseconds
-{
- if (quartzAudioDevice == kAudioDeviceUnknown) return;
-
- pthread_mutex_lock(&data.lock);
-
- // fade previous sound, if any
- data.prevFrequency = data.frequency;
- data.prevAmplitude = data.amplitude;
- data.prevFrame = data.curFrame;
-
- // set new sound
- data.frequency = pitch;
- data.amplitude = volume / 100.0;
- data.curFrame = 0;
- data.totalFrames = (int)(data.sampleRate * duration / 1000.0);
- data.remainingFrames = data.totalFrames;
-
- if (! data.playing) {
- OSStatus status;
- status = AudioDeviceStart(quartzAudioDevice, QuartzAudioIOProc);
- if (status) {
- ErrorF("QuartzAudioBell: AudioDeviceStart returned %d\n", status);
- } else {
- data.playing = TRUE;
- }
- }
- pthread_mutex_unlock(&data.lock);
-}
-
-
-/*
- * QuartzBell
- * Ring the bell
- */
-void QuartzBell(
- int volume, // volume in percent of max
- DeviceIntPtr pDevice,
- pointer ctrl,
- int class )
-{
- int pitch; // pitch in Hz
- int duration; // duration in milliseconds
-
- if (class == BellFeedbackClass) {
- pitch = ((BellCtrl*)ctrl)->pitch;
- duration = ((BellCtrl*)ctrl)->duration;
- } else if (class == KbdFeedbackClass) {
- pitch = ((KeybdCtrl*)ctrl)->bell_pitch;
- duration = ((KeybdCtrl*)ctrl)->bell_duration;
- } else {
- ErrorF("QuartzBell: bad bell class %d\n", class);
- return;
- }
-
- if (quartzUseSysBeep) {
- if (volume)
- NSBeep();
- } else {
- QuartzCoreAudioBell(volume, pitch, duration);
- }
-}
-
-
-/*
- * QuartzAudioInit
- * Prepare to play the bell with the CoreAudio API
- */
-void QuartzAudioInit(void)
-{
- UInt32 propertySize;
- OSStatus status;
- AudioDeviceID outputDevice;
- AudioStreamBasicDescription outputStreamDescription;
- double sampleRate;
-
- // Get the default output device
- propertySize = sizeof(outputDevice);
- status = AudioHardwareGetProperty(
- kAudioHardwarePropertyDefaultOutputDevice,
- &propertySize, &outputDevice);
- if (status) {
- ErrorF("QuartzAudioInit: AudioHardwareGetProperty returned %d\n",
- status);
- return;
- }
- if (outputDevice == kAudioDeviceUnknown) {
- ErrorF("QuartzAudioInit: No audio output devices available.\n");
- return;
- }
-
- // Get the basic device description
- propertySize = sizeof(outputStreamDescription);
- status = AudioDeviceGetProperty(outputDevice, 0, FALSE,
- kAudioDevicePropertyStreamFormat,
- &propertySize, &outputStreamDescription);
- if (status) {
- ErrorF("QuartzAudioInit: GetProperty(stream format) returned %d\n",
- status);
- return;
- }
- sampleRate = outputStreamDescription.mSampleRate;
-
- // Fill in the playback data
- data.frequency = 0;
- data.amplitude = 0;
- data.curFrame = 0;
- data.remainingFrames = 0;
- data.bytesPerFrame = outputStreamDescription.mBytesPerFrame;
- data.sampleRate = sampleRate;
- // data.bufferByteCount = bufferByteCount;
- data.playing = FALSE;
- data.prevAmplitude = 0;
- data.prevFrame = 0;
- data.prevFrequency = 0;
- data.fadeLength = data.sampleRate / 200;
- pthread_mutex_init(&data.lock, NULL); // fixme error check
-
- // fixme assert fadeLength<framesPerBuffer
-
- // Prepare for playback
- status = AudioDeviceAddIOProc(outputDevice, QuartzAudioIOProc, &data);
- if (status) {
- ErrorF("QuartzAudioInit: AddIOProc returned %d\n", status);
- return;
- }
-
- // success!
- quartzAudioDevice = outputDevice;
-}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartzAudio.h b/xc/programs/Xserver/hw/darwin/bundle/quartzAudio.h
deleted file mode 100644
index 4edd87ce4..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/quartzAudio.h
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// QuartzAudio.h
-//
-// X Window bell support using CoreAudio or AppKit.
-// Greg Parker gparker@cs.stanford.edu 19 Feb 2001
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzAudio.h,v 1.2 2001/04/01 20:45:43 tsi Exp $ */
-
-#ifndef _QUARTZAUDIO_H
-#define _QUARTZAUDIO_H
-
-#include "input.h"
-
-void QuartzAudioInit(void);
-void QuartzBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class);
-
-#endif
diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartzCocoa.m b/xc/programs/Xserver/hw/darwin/bundle/quartzCocoa.m
deleted file mode 100644
index 1e7ba1185..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/quartzCocoa.m
+++ /dev/null
@@ -1,122 +0,0 @@
-/**************************************************************
- *
- * Quartz-specific support for the Darwin X Server
- * that requires Cocoa and Objective-C.
- *
- * This file is separate from the parts of Quartz support
- * that use X include files to avoid symbol collisions.
- *
- **************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzCocoa.m,v 1.11 2001/12/22 05:28:35 torrey Exp $ */
-
-#include <Cocoa/Cocoa.h>
-
-#import "Preferences.h"
-#include "quartzCommon.h"
-#include "pseudoramiX.h"
-
-extern void FatalError(const char *, ...);
-extern char *display;
-extern int noPanoramiXExtension;
-
-// Read the user preferences from the Cocoa front end
-void QuartzReadPreferences(void)
-{
- char *fileString;
-
- darwinFakeButtons = [Preferences fakeButtons];
- darwinFakeMouse2Mask = [Preferences button2Mask];
- darwinFakeMouse3Mask = [Preferences button3Mask];
- quartzMouseAccelChange = [Preferences mouseAccelChange];
- quartzUseSysBeep = [Preferences systemBeep];
-
- // Rootless: use PseudoramiX not Xinerama (quartzRootless already set)
- if (quartzRootless) {
- noPanoramiXExtension = TRUE;
- noPseudoramiXExtension = ![Preferences xinerama];
- } else {
- noPanoramiXExtension = ![Preferences xinerama];
- noPseudoramiXExtension = TRUE;
- }
-
- if ([Preferences useKeymapFile]) {
- fileString = (char *) [[Preferences keymapFile] lossyCString];
- darwinKeymapFile = (char *) malloc(strlen(fileString)+1);
- if (! darwinKeymapFile)
- FatalError("malloc failed in QuartzReadPreferences()!\n");
- strcpy(darwinKeymapFile, fileString);
- }
-
- display = (char *) malloc(8);
- if (! display)
- FatalError("malloc failed in QuartzReadPreferences()!\n");
- snprintf(display, 8, "%i", [Preferences display]);
-
- darwinDesiredDepth = [Preferences depth] - 1;
-}
-
-// Write text to the Mac OS X pasteboard.
-void QuartzWriteCocoaPasteboard(
- char *text)
-{
- NSPasteboard *pasteboard;
- NSArray *pasteboardTypes;
- NSString *string;
-
- if (! text) return;
- pasteboard = [NSPasteboard generalPasteboard];
- if (! pasteboard) return;
- string = [NSString stringWithCString:text];
- if (! string) return;
- pasteboardTypes = [NSArray arrayWithObject:NSStringPboardType];
-
- // nil owner because we don't provide type translations
- [pasteboard declareTypes:pasteboardTypes owner:nil];
- [pasteboard setString:string forType:NSStringPboardType];
-}
-
-// Read text from the Mac OS X pasteboard and return it as a heap string.
-// The caller must free the string.
-char *QuartzReadCocoaPasteboard(void)
-{
- NSPasteboard *pasteboard;
- NSArray *pasteboardTypes;
- NSString *existingType;
- char *text = NULL;
-
- pasteboardTypes = [NSArray arrayWithObject:NSStringPboardType];
- pasteboard = [NSPasteboard generalPasteboard];
- if (! pasteboard) return NULL;
-
- existingType = [pasteboard availableTypeFromArray:pasteboardTypes];
- if (existingType) {
- NSString *string = [pasteboard stringForType:existingType];
- char *buffer;
-
- if (! string) return NULL;
- buffer = (char *) [string lossyCString];
- text = (char *) malloc(strlen(buffer)+1);
- if (text)
- strcpy(text, buffer);
- }
-
- return text;
-}
-
-// Return whether the screen should use a QuickDraw cursor
-int QuartzFSUseQDCursor(
- int depth) // screen depth
-{
- switch ([Preferences useQDCursor]) {
- case qdCursor_Always:
- return TRUE;
- case qdCursor_Never:
- return FALSE;
- case qdCursor_Not8Bit:
- if (depth > 8)
- return TRUE;
- else
- return FALSE;
- }
- return TRUE;
-}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartzCommon.h b/xc/programs/Xserver/hw/darwin/bundle/quartzCommon.h
deleted file mode 100644
index c80d96efd..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/quartzCommon.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * quartzCommon.h
- *
- * Common definitions used internally by all Quartz modes
- *
- * This file should be included before any X11 or IOKit headers
- * so that it can avoid symbol conflicts.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzCommon.h,v 1.4 2001/12/22 05:28:35 torrey Exp $ */
-
-#ifndef _QUARTZCOMMON_H
-#define _QUARTZCOMMON_H
-
-// QuickDraw in ApplicationServices has the following conflicts with
-// the basic X server headers. Use QD_<name> to use the QuickDraw
-// definition of any of these symbols, or the normal name for the
-// X11 definition.
-#define AllocCursor QD_AllocCursor
-#define InitFonts QD_InitFonts
-#define Cursor QD_Cursor
-#define WindowPtr QD_WindowPtr
-#include <ApplicationServices/ApplicationServices.h>
-#undef AllocCursor
-#undef InitFonts
-#undef Cursor
-#undef WindowPtr
-
-#include "quartzShared.h"
-
-// Quartz specific per screen storage structure
-typedef struct {
- // List of CoreGraphics displays that this X11 screen covers.
- // This is more than one CG display for video mirroring and
- // rootless PseudoramiX mode.
- // No CG display will be covered by more than one X11 screen.
- int displayCount;
- CGDirectDisplayID *displayIDs;
-} QuartzScreenRec, *QuartzScreenPtr;
-
-#define QUARTZ_PRIV(pScreen) \
- ((QuartzScreenPtr)pScreen->devPrivates[quartzScreenIndex].ptr)
-
-// Data stored at startup for Cocoa front end
-extern int quartzEventWriteFD;
-extern int quartzStartClients;
-
-// User preferences used by Quartz modes
-extern int quartzRootless;
-extern int quartzUseSysBeep;
-
-// Other shared data
-extern int quartzServerVisible;
-extern int quartzScreenIndex;
-extern int aquaMenuBarHeight;
-
-void QuartzCapture(void);
-void QuartzRelease(void);
-void QuartzReadPreferences(void);
-void QuartzMessageMainThread(unsigned msg);
-int QuartzFSUseQDCursor(int depth);
-
-// Messages that can be sent to the main thread.
-enum {
- kQuartzServerHidden,
- kQuartzServerDied
-};
-
-#endif /* _QUARTZCOMMON_H */
diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c b/xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c
deleted file mode 100644
index 1f8d0d672..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c
+++ /dev/null
@@ -1,572 +0,0 @@
-/**************************************************************
- *
- * Support for using the Quartz Window Manager cursor
- *
- **************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c,v 1.15 2001/12/22 05:28:35 torrey Exp $ */
-
-#include "quartzCommon.h"
-#include "quartzCursor.h"
-#include "darwin.h"
-
-#include "mi.h"
-#include "scrnintstr.h"
-#include "cursorstr.h"
-#include "mipointrst.h"
-#include "globals.h"
-
-// Size of the QuickDraw cursor
-#define CURSORWIDTH 16
-#define CURSORHEIGHT 16
-
-typedef struct {
- int qdCursorMode;
- int qdCursorVisible;
- int useQDCursor;
- QueryBestSizeProcPtr QueryBestSize;
- miPointerSpriteFuncPtr spriteFuncs;
-} QuartzCursorScreenRec, *QuartzCursorScreenPtr;
-
-static int darwinCursorScreenIndex = -1;
-static unsigned long darwinCursorGeneration = 0;
-static CursorPtr quartzLatentCursor = NULL;
-static QD_Cursor gQDArrow; // QuickDraw arrow cursor
-
-#define CURSOR_PRIV(pScreen) \
- ((QuartzCursorScreenPtr)pScreen->devPrivates[darwinCursorScreenIndex].ptr)
-
-#define HIDE_QD_CURSOR(pScreen, visible) \
- if (visible) { \
- int ix; \
- for (ix = 0; ix < QUARTZ_PRIV(pScreen)->displayCount; ix++) { \
- CGDisplayHideCursor(QUARTZ_PRIV(pScreen)->displayIDs[ix]); \
- } \
- visible = FALSE; \
- } ((void)0)
-
-#define SHOW_QD_CURSOR(pScreen, visible) \
- { \
- int ix; \
- for (ix = 0; ix < QUARTZ_PRIV(pScreen)->displayCount; ix++) { \
- CGDisplayShowCursor(QUARTZ_PRIV(pScreen)->displayIDs[ix]); \
- } \
- visible = TRUE; \
- } ((void)0)
-
-
-/*
- * MakeQDCursor helpers: CTAB_ENTER, interleave
- */
-
-// Add a color entry to a ctab
-#define CTAB_ENTER(ctab, index, r, g, b) \
- ctab->ctTable[index].rgb.red = r; \
- ctab->ctTable[index].rgb.green = g; \
- ctab->ctTable[index].rgb.blue = b
-
-// Make an unsigned short by interleaving the bits of bytes c1 and c2.
-// High bit of c1 is first; low bit of c2 is last.
-// Interleave is a built-in INTERCAL operator.
-static unsigned short
-interleave(
- unsigned char c1,
- unsigned char c2 )
-{
- return
- ((c1 & 0x80) << 8) | ((c2 & 0x80) << 7) |
- ((c1 & 0x40) << 7) | ((c2 & 0x40) << 6) |
- ((c1 & 0x20) << 6) | ((c2 & 0x20) << 5) |
- ((c1 & 0x10) << 5) | ((c2 & 0x10) << 4) |
- ((c1 & 0x08) << 4) | ((c2 & 0x08) << 3) |
- ((c1 & 0x04) << 3) | ((c2 & 0x04) << 2) |
- ((c1 & 0x02) << 2) | ((c2 & 0x02) << 1) |
- ((c1 & 0x01) << 1) | ((c2 & 0x01) << 0) ;
-}
-
-/*
- * MakeQDCursor
- * Make a QuickDraw color cursor from the given X11 cursor.
- * Warning: This code is nasty. Color cursors were meant to be read
- * from resources; constructing the structures programmatically is messy.
- */
-/*
- QuickDraw cursor representation:
- Our color cursor is a 2 bit per pixel pixmap.
- Each pixel's bits are (source<<1 | mask) from the original X cursor pixel.
- The cursor's color table maps the colors like this:
- (2-bit value | X result | colortable | Mac result)
- 00 | transparent | white | transparent (white outside mask)
- 01 | back color | back color | back color
- 10 | undefined | black | invert background (just for fun)
- 11 | fore color | fore color | fore color
-*/
-static CCrsrHandle
-MakeQDCursor(
- CursorPtr pCursor )
-{
- CCrsrHandle result;
- CCrsrPtr curs;
- int i, w, h;
- unsigned short rowMask;
- PixMap *pix;
- ColorTable *ctab;
- unsigned short *image;
-
- result = (CCrsrHandle) NewHandleClear(sizeof(CCrsr));
- if (!result) return NULL;
- HLock((Handle)result);
- curs = *result;
-
- // Initialize CCrsr
- curs->crsrType = 0x8001; // 0x8000 = b&w, 0x8001 = color
- curs->crsrMap = (PixMapHandle) NewHandleClear(sizeof(PixMap));
- if (!curs->crsrMap) goto pixAllocFailed;
- HLock((Handle)curs->crsrMap);
- pix = *curs->crsrMap;
- curs->crsrData = NULL; // raw cursor image data (set below)
- curs->crsrXData = NULL; // QD's processed data
- curs->crsrXValid = 0; // zero means QD must re-process cursor data
- curs->crsrXHandle = NULL; // reserved
- memset(curs->crsr1Data, 0, CURSORWIDTH*CURSORHEIGHT/8); // b&w data
- memset(curs->crsrMask, 0, CURSORWIDTH*CURSORHEIGHT/8); // b&w & color mask
- curs->crsrHotSpot.h = min(CURSORWIDTH, pCursor->bits->xhot); // hot spot
- curs->crsrHotSpot.v = min(CURSORHEIGHT, pCursor->bits->yhot); // hot spot
- curs->crsrXTable = 0; // reserved
- curs->crsrID = GetCTSeed(); // unique ID from Color Manager
-
- // Set the b&w data and mask
- w = min(pCursor->bits->width, CURSORWIDTH);
- h = min(pCursor->bits->height, CURSORHEIGHT);
- rowMask = ~((1 << (CURSORWIDTH - w)) - 1);
- for (i = 0; i < h; i++) {
- curs->crsr1Data[i] = rowMask &
- ((pCursor->bits->source[i*4]<<8) | pCursor->bits->source[i*4+1]);
- curs->crsrMask[i] = rowMask &
- ((pCursor->bits->mask[i*4]<<8) | pCursor->bits->mask[i*4+1]);
- }
-
- // Set the color data and mask
- // crsrMap: defines bit depth and size and colortable only
- pix->rowBytes = (CURSORWIDTH * 2 / 8) | 0x8000; // last bit on means PixMap
- SetRect(&pix->bounds, 0, 0, CURSORWIDTH, CURSORHEIGHT); // see TN 1020
- pix->pixelSize = 2;
- pix->cmpCount = 1;
- pix->cmpSize = 2;
- // pix->pmTable set below
-
- // crsrData is the pixel data. crsrMap's baseAddr is not used.
- curs->crsrData = NewHandleClear(CURSORWIDTH*CURSORHEIGHT * 2 / 8);
- if (!curs->crsrData) goto imageAllocFailed;
- HLock((Handle)curs->crsrData);
- image = (unsigned short *) *curs->crsrData;
- // Pixel data is just 1-bit data and mask interleaved (see above)
- for (i = 0; i < h; i++) {
- unsigned char s, m;
- s = pCursor->bits->source[i*4] & (rowMask >> 8);
- m = pCursor->bits->mask[i*4] & (rowMask >> 8);
- image[2*i] = interleave(s, m);
- s = pCursor->bits->source[i*4+1] & (rowMask & 0x00ff);
- m = pCursor->bits->mask[i*4+1] & (rowMask & 0x00ff);
- image[2*i+1] = interleave(s, m);
- }
-
- // Build the color table (entries described above)
- // NewPixMap allocates a color table handle.
- pix->pmTable = (CTabHandle) NewHandleClear(sizeof(ColorTable) + 3
- * sizeof(ColorSpec));
- if (!pix->pmTable) goto ctabAllocFailed;
- HLock((Handle)pix->pmTable);
- ctab = *pix->pmTable;
- ctab->ctSeed = GetCTSeed();
- ctab->ctFlags = 0;
- ctab->ctSize = 3; // color count - 1
- CTAB_ENTER(ctab, 0, 0xffff, 0xffff, 0xffff);
- CTAB_ENTER(ctab, 1, pCursor->backRed, pCursor->backGreen,
- pCursor->backBlue);
- CTAB_ENTER(ctab, 2, 0x0000, 0x0000, 0x0000);
- CTAB_ENTER(ctab, 3, pCursor->foreRed, pCursor->foreGreen,
- pCursor->foreBlue);
-
- HUnlock((Handle)pix->pmTable); // ctab
- HUnlock((Handle)curs->crsrData); // image data
- HUnlock((Handle)curs->crsrMap); // pix
- HUnlock((Handle)result); // cursor
-
- return result;
-
- // "What we have here is a failure to allocate"
-ctabAllocFailed:
- HUnlock((Handle)curs->crsrData);
- DisposeHandle((Handle)curs->crsrData);
-imageAllocFailed:
- HUnlock((Handle)curs->crsrMap);
- DisposeHandle((Handle)curs->crsrMap);
-pixAllocFailed:
- HUnlock((Handle)result);
- DisposeHandle((Handle)result);
- return NULL;
-}
-
-
-/*
- * FreeQDCursor
- * Destroy a QuickDraw color cursor created with MakeQDCursor().
- * The cursor must not currently be on screen.
- */
-static void FreeQDCursor(CCrsrHandle cursHandle)
-{
- CCrsrPtr curs;
- PixMap *pix;
-
- HLock((Handle)cursHandle);
- curs = *cursHandle;
- HLock((Handle)curs->crsrMap);
- pix = *curs->crsrMap;
- DisposeHandle((Handle)pix->pmTable);
- HUnlock((Handle)curs->crsrMap);
- DisposeHandle((Handle)curs->crsrMap);
- DisposeHandle((Handle)curs->crsrData);
- HUnlock((Handle)cursHandle);
- DisposeHandle((Handle)cursHandle);
-}
-
-
-/*
-===========================================================================
-
- Pointer sprite functions
-
-===========================================================================
-*/
-
-/*
- * QuartzRealizeCursor
- * Convert the X cursor representation to QuickDraw format if possible.
- */
-Bool
-QuartzRealizeCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor )
-{
- CCrsrHandle qdCursor;
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- if(!pCursor || !pCursor->bits)
- return FALSE;
-
- // if the cursor is too big we use a software cursor
- if ((pCursor->bits->height > CURSORHEIGHT) ||
- (pCursor->bits->width > CURSORWIDTH) || !ScreenPriv->useQDCursor)
- {
- if (quartzRootless) {
- // rootless can't use a software cursor
- return TRUE;
- } else {
- return (*ScreenPriv->spriteFuncs->RealizeCursor)
- (pScreen, pCursor);
- }
- }
-
- // make new cursor image
- qdCursor = MakeQDCursor(pCursor);
- if (!qdCursor) return FALSE;
-
- // save the result
- pCursor->devPriv[pScreen->myNum] = (pointer) qdCursor;
-
- return TRUE;
-}
-
-
-/*
- * QuartzUnrealizeCursor
- * Free the storage space associated with a realized cursor.
- */
-Bool
-QuartzUnrealizeCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor )
-{
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- if ((pCursor->bits->height > CURSORHEIGHT) ||
- (pCursor->bits->width > CURSORWIDTH) || !ScreenPriv->useQDCursor)
- {
- if (quartzRootless) {
- return TRUE;
- } else {
- return (*ScreenPriv->spriteFuncs->UnrealizeCursor)
- (pScreen, pCursor);
- }
- } else {
- FreeQDCursor((CCrsrHandle) pCursor->devPriv[pScreen->myNum]);
- pCursor->devPriv[pScreen->myNum] = NULL;
- return TRUE;
- }
-}
-
-
-/*
- * QuartzSetCursor
- * Set the cursor sprite and position.
- * Use QuickDraw cursor if possible.
- */
-static void
-QuartzSetCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor,
- int x,
- int y)
-{
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- quartzLatentCursor = pCursor;
-
- // Don't touch Mac OS cursor if X is hidden!
- if (!quartzServerVisible)
- return;
-
- if (!pCursor) {
- // Remove the cursor completely.
- HIDE_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
- if (! ScreenPriv->qdCursorMode)
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y);
- }
- else if ((pCursor->bits->height <= CURSORHEIGHT) &&
- (pCursor->bits->width <= CURSORWIDTH) && ScreenPriv->useQDCursor)
- {
- // Cursor is small enough to use QuickDraw directly.
- CCrsrHandle curs;
-
- if (! ScreenPriv->qdCursorMode) // remove the X cursor
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y);
- ScreenPriv->qdCursorMode = TRUE;
-
- curs = (CCrsrHandle) pCursor->devPriv[pScreen->myNum];
- SetCCursor(curs);
- SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
- }
- else if (quartzRootless) {
- // Rootless can't use a software cursor, so we just use Mac OS arrow.
- SetCursor(&gQDArrow);
- SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
- }
- else {
- // Cursor is too big for QuickDraw. Use X software cursor.
- HIDE_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
- ScreenPriv->qdCursorMode = FALSE;
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCursor, x, y);
- }
-}
-
-
-/*
- * QuartzMoveCursor
- * Move the cursor. This is a noop for QuickDraw.
- */
-static void
-QuartzMoveCursor(
- ScreenPtr pScreen,
- int x,
- int y)
-{
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- // only the X cursor needs to be explicitly moved
- if (!ScreenPriv->qdCursorMode)
- (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y);
-}
-
-
-static miPointerSpriteFuncRec quartzSpriteFuncsRec = {
- QuartzRealizeCursor,
- QuartzUnrealizeCursor,
- QuartzSetCursor,
- QuartzMoveCursor
-};
-
-/*
-===========================================================================
-
- Pointer screen functions
-
-===========================================================================
-*/
-
-/*
- * QuartzCursorOffScreen
- */
-static Bool QuartzCursorOffScreen(ScreenPtr *pScreen, int *x, int *y)
-{
- return FALSE;
-}
-
-
-/*
- * QuartzCrossScreen
- */
-static void QuartzCrossScreen(ScreenPtr pScreen, Bool entering)
-{
- return;
-}
-
-
-/*
- * QuartzWarpCursor
- * Change the cursor position without generating an event or motion history.
- * The input coordinates (x,y) are in pScreen-local X11 coordinates.
- *
- */
-static void
-QuartzWarpCursor(
- ScreenPtr pScreen,
- int x,
- int y)
-{
- static int neverMoved = TRUE;
-
- if (neverMoved) {
- // Don't move the cursor the first time. This is the jump-to-center
- // initialization, and it's annoying because we may still be in MacOS.
- neverMoved = FALSE;
- return;
- }
-
- if (quartzServerVisible) {
- CGDisplayErr cgErr;
- CGPoint cgPoint;
- // Only need to do this for one display. Any display will do.
- CGDirectDisplayID cgID = QUARTZ_PRIV(pScreen)->displayIDs[0];
- CGRect cgRect = CGDisplayBounds(cgID);
-
- // Convert (x,y) to CoreGraphics screen-local CG coordinates.
- // This is necessary because the X11 screen and CG screen may not
- // coincide. (e.g. X11 screen may be moved to dodge the menu bar)
-
- // Make point in X11 global coordinates
- cgPoint = CGPointMake(x + dixScreenOrigins[pScreen->myNum].x,
- y + dixScreenOrigins[pScreen->myNum].y);
- // Shift to CoreGraphics global screen coordinates
- cgPoint.x += darwinMainScreenX;
- cgPoint.y += darwinMainScreenY;
- // Shift to CoreGraphics screen-local coordinates
- cgPoint.x -= cgRect.origin.x;
- cgPoint.y -= cgRect.origin.y;
-
- cgErr = CGDisplayMoveCursorToPoint(cgID, cgPoint);
- if (cgErr != CGDisplayNoErr) {
- ErrorF("Could not set cursor position with error code 0x%x.\n",
- cgErr);
- }
- }
-
- miPointerWarpCursor(pScreen, x, y);
-}
-
-
-static miPointerScreenFuncRec quartzScreenFuncsRec = {
- QuartzCursorOffScreen,
- QuartzCrossScreen,
- QuartzWarpCursor,
-};
-
-/*
-===========================================================================
-
- Other screen functions
-
-===========================================================================
-*/
-
-/*
- * QuartzCursorQueryBestSize
- * Handle queries for best cursor size
- */
-static void
-QuartzCursorQueryBestSize(
- int class,
- unsigned short *width,
- unsigned short *height,
- ScreenPtr pScreen)
-{
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- if (class == CursorShape) {
- *width = CURSORWIDTH;
- *height = CURSORHEIGHT;
- } else {
- (*ScreenPriv->QueryBestSize)(class, width, height, pScreen);
- }
-}
-
-
-/*
- * QuartzInitCursor
- * Initialize cursor support
- */
-Bool
-QuartzInitCursor(
- ScreenPtr pScreen )
-{
- QuartzCursorScreenPtr ScreenPriv;
- miPointerScreenPtr PointPriv;
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
-
- // initialize software cursor handling (always needed as backup)
- if (!miDCInitialize(pScreen, &quartzScreenFuncsRec)) {
- return FALSE;
- }
-
- // allocate private storage for this screen's QuickDraw cursor info
- if (darwinCursorGeneration != serverGeneration) {
- if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- darwinCursorGeneration = serverGeneration;
- }
-
- ScreenPriv = xcalloc( 1, sizeof(QuartzCursorScreenRec) );
- if (!ScreenPriv) return FALSE;
-
- CURSOR_PRIV(pScreen) = ScreenPriv;
-
- // override some screen procedures
- ScreenPriv->QueryBestSize = pScreen->QueryBestSize;
- pScreen->QueryBestSize = QuartzCursorQueryBestSize;
-
- // initialize QuickDraw cursor handling
- GetQDGlobalsArrow(&gQDArrow);
- PointPriv = (miPointerScreenPtr)
- pScreen->devPrivates[miPointerScreenIndex].ptr;
-
- ScreenPriv->spriteFuncs = PointPriv->spriteFuncs;
- PointPriv->spriteFuncs = &quartzSpriteFuncsRec;
-
- if (!quartzRootless)
- ScreenPriv->useQDCursor = QuartzFSUseQDCursor(dfb->colorBitsPerPixel);
- else
- ScreenPriv->useQDCursor = TRUE;
- ScreenPriv->qdCursorMode = TRUE;
- ScreenPriv->qdCursorVisible = TRUE;
- return TRUE;
-}
-
-
-// X server is hiding. Restore the Aqua cursor.
-void QuartzSuspendXCursor(
- ScreenPtr pScreen )
-{
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- SetCursor(&gQDArrow);
- SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
-}
-
-
-// X server is showing. Restore the X cursor.
-void QuartzResumeXCursor(
- ScreenPtr pScreen,
- int x,
- int y )
-{
- QuartzSetCursor(pScreen, quartzLatentCursor, x, y);
-}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartzCursor.h b/xc/programs/Xserver/hw/darwin/bundle/quartzCursor.h
deleted file mode 100644
index fc0a043e0..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/quartzCursor.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * quartzCursor.h
- *
- * External interface for Quartz hardware cursor
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzCursor.h,v 1.2 2001/09/23 04:04:49 torrey Exp $ */
-
-#ifndef QUARTZCURSOR_H
-#define QUARTZCURSOR_H
-
-#include "screenint.h"
-
-Bool QuartzInitCursor(ScreenPtr pScreen);
-void QuartzSuspendXCursor(ScreenPtr pScreen);
-void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y);
-
-#endif
diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c b/xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c
deleted file mode 100644
index 28aca48f2..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/**************************************************************
- * quartzPasteboard.c
- *
- * Aqua pasteboard <-> X cut buffer
- * Greg Parker gparker@cs.stanford.edu March 8, 2001
- **************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c,v 1.3 2001/09/23 04:04:49 torrey Exp $ */
-
-#include "quartzPasteboard.h"
-
-#include "Xatom.h"
-#include "windowstr.h"
-#include "propertyst.h"
-#include "scrnintstr.h"
-#include "selection.h"
-#include "globals.h"
-
-extern Selection *CurrentSelections;
-extern int NumCurrentSelections;
-
-
-// Helper function to read the X11 cut buffer
-// FIXME: What about multiple screens? Currently, this reads the first
-// CUT_BUFFER0 from the first screen where the buffer content is a string.
-// Returns a string on the heap that the caller must free.
-// Returns NULL if there is no cut text or there is not enough memory.
-static char * QuartzReadCutBuffer(void)
-{
- int i;
- char *text = NULL;
-
- for (i = 0; i < screenInfo.numScreens; i++) {
- ScreenPtr pScreen = screenInfo.screens[i];
- PropertyPtr pProp;
-
- pProp = wUserProps (WindowTable[pScreen->myNum]);
- while (pProp && pProp->propertyName != XA_CUT_BUFFER0) {
- pProp = pProp->next;
- }
- if (! pProp) continue;
- if (pProp->type != XA_STRING) continue;
- if (pProp->format != 8) continue;
-
- text = xalloc(1 + pProp->size);
- if (! text) continue;
- memcpy(text, pProp->data, pProp->size);
- text[pProp->size] = '\0';
- return text;
- }
-
- // didn't find any text
- return NULL;
-}
-
-// Write X cut buffer to Mac OS X pasteboard
-// Called by ProcessInputEvents() in response to request from X server thread.
-void QuartzWritePasteboard(void)
-{
- char *text;
- text = QuartzReadCutBuffer();
- if (text) {
- QuartzWriteCocoaPasteboard(text);
- free(text);
- }
-}
-
-#define strequal(a, b) (0 == strcmp((a), (b)))
-
-// Read Mac OS X pasteboard into X cut buffer
-// Called by ProcessInputEvents() in response to request from X server thread.
-void QuartzReadPasteboard(void)
-{
- char *oldText = QuartzReadCutBuffer();
- char *text = QuartzReadCocoaPasteboard();
-
- // Compare text with current cut buffer contents.
- // Change the buffer if both exist and are different
- // OR if there is new text but no old text.
- // Otherwise, don't clear the selection unnecessarily.
-
- if ((text && oldText && !strequal(text, oldText)) ||
- (text && !oldText)) {
- int scrn, sel;
-
- for (scrn = 0; scrn < screenInfo.numScreens; scrn++) {
- ScreenPtr pScreen = screenInfo.screens[scrn];
- // Set the cut buffers on each screen
- // fixme really on each screen?
- ChangeWindowProperty(WindowTable[pScreen->myNum], XA_CUT_BUFFER0,
- XA_STRING, 8, PropModeReplace,
- strlen(text), (pointer)text, TRUE);
- }
-
- // Undo any current X selection (similar to code in dispatch.c)
- // FIXME: what about secondary selection?
- // FIXME: only touch first XA_PRIMARY selection?
- sel = 0;
- while ((sel < NumCurrentSelections) &&
- CurrentSelections[sel].selection != XA_PRIMARY)
- sel++;
- if (sel < NumCurrentSelections) {
- // Notify client if necessary
- if (CurrentSelections[sel].client) {
- xEvent event;
-
- event.u.u.type = SelectionClear;
- event.u.selectionClear.time = GetTimeInMillis();
- event.u.selectionClear.window = CurrentSelections[sel].window;
- event.u.selectionClear.atom = CurrentSelections[sel].selection;
- TryClientEvents(CurrentSelections[sel].client, &event, 1,
- NoEventMask, NoEventMask /*CantBeFiltered*/,
- NullGrab);
- }
-
- // Erase it
- // FIXME: need to erase .selection too? dispatch.c doesn't
- CurrentSelections[sel].pWin = NullWindow;
- CurrentSelections[sel].window = None;
- CurrentSelections[sel].client = NullClient;
- }
- }
-
- if (text) free(text);
- if (oldText) free(oldText);
-}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.h b/xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.h
deleted file mode 100644
index 048de532d..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- QuartzPasteboard.h
-
- Mac OS X pasteboard <-> X cut buffer
- Greg Parker gparker@cs.stanford.edu March 8, 2001
-*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.h,v 1.1 2001/03/15 22:24:27 torrey Exp $ */
-
-#ifndef _QUARTZPASTEBOARD_H
-#define _QUARTZPASTEBOARD_H
-
-// Aqua->X
-void QuartzReadPasteboard();
-char * QuartzReadCocoaPasteboard(void); // caller must free string
-
-// X->Aqua
-void QuartzWritePasteboard();
-void QuartzWriteCocoaPasteboard(char *text);
-
-#endif /* _QUARTZPASTEBOARD_H */ \ No newline at end of file
diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartzShared.h b/xc/programs/Xserver/hw/darwin/bundle/quartzShared.h
deleted file mode 100644
index a65f1d148..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/quartzShared.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * quartzShared.h
- *
- * Shared definitions between the Darwin X Server and the Cocoa front end
- *
- * This file is included in all parts of the Darwin X Server and must not
- * include any types defined in X11 or Mac OS X specific headers.
- * Definitions that are internal to the Quartz modes or use Mac OS X
- * specific types should be in quartzCommon.h instead of here.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzShared.h,v 1.11 2001/10/14 03:02:18 torrey Exp $ */
-
-#ifndef _QUARTZSHARED_H
-#define _QUARTZSHARED_H
-
-// User preferences used by generic Darwin X server code
-extern int quartzMouseAccelChange;
-extern int darwinFakeButtons;
-extern int darwinFakeMouse2Mask;
-extern int darwinFakeMouse3Mask;
-extern char *darwinKeymapFile;
-extern unsigned int darwinDesiredWidth, darwinDesiredHeight;
-extern int darwinDesiredDepth;
-extern int darwinDesiredRefresh;
-
-// location of X11's (0,0) point in global screen coordinates
-extern int darwinMainScreenX;
-extern int darwinMainScreenY;
-
-// NX_APPDEFINED event subtypes for special commands to the X server
-enum {
- kXDarwinUpdateModifiers, // update all modifier keys
- kXDarwinShow, // vt switch to X server;
- // recapture screen and restore X drawing
- kXDarwinHide, // vt switch away from X server;
- // release screen and clip X drawing
- kXDarwinQuit, // kill the X server and release the display
- kXDarwinReadPasteboard, // copy Mac OS X pasteboard into X cut buffer
- kXDarwinWritePasteboard // copy X cut buffer onto Mac OS X pasteboard
-};
-
-#endif /* _QUARTZSHARED_H */
-
diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartzStartup.c b/xc/programs/Xserver/hw/darwin/bundle/quartzStartup.c
deleted file mode 100644
index b9f7c5fe7..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/quartzStartup.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/**************************************************************
- *
- * Startup code for the Quartz Darwin X Server
- *
- **************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzStartup.c,v 1.7 2001/09/23 04:04:49 torrey Exp $ */
-
-#include <fcntl.h>
-#include "quartzCommon.h"
-#include "darwin.h"
-#include "opaque.h"
-
-int NSApplicationMain(int argc, char *argv[]);
-
-char **envpGlobal; // argcGlobal and argvGlobal
- // are from dix/globals.c
-
-/*
- * DarwinHandleGUI
- * This function is called first from main(). The first time
- * it is called we start the Mac OS X front end. The front end
- * will call main() again from another thread to run the X
- * server. On the second call this function loads the user
- * preferences set by the Mac OS X front end.
- */
-void DarwinHandleGUI(
- int argc,
- char *argv[],
- char *envp[] )
-{
- static Bool been_here = FALSE;
- int main_exit, i;
- int fd[2];
-
- if (been_here) {
- QuartzReadPreferences();
- return;
- }
- been_here = TRUE;
-
- // Make a pipe to pass events
- assert( pipe(fd) == 0 );
- darwinEventFD = fd[0];
- quartzEventWriteFD = fd[1];
- fcntl(darwinEventFD, F_SETFL, O_NONBLOCK);
-
- // Store command line arguments to pass back to main()
- argcGlobal = argc;
- argvGlobal = argv;
- envpGlobal = envp;
-
- // Determine if we need to start X clients
- // and what display mode to use
- quartzStartClients = 1;
- for (i = 1; i < argc; i++) {
- if (!strcmp(argv[i], "-nostartx")) {
- quartzStartClients = 0;
- } else if (!strcmp( argv[i], "-fullscreen")) {
- quartzRootless = 0;
- } else if (!strcmp( argv[i], "-rootless")) {
- quartzRootless = 1;
- }
- }
-
- quartz = TRUE;
- main_exit = NSApplicationMain(argc, argv);
- exit(main_exit);
-}
-
-int QuartzProcessArgument( int argc, char *argv[], int i )
-{
- // fullscreen: CoreGraphics full-screen mode
- // rootless: Cocoa rootless mode
- // quartz: Default, either fullscreen or rootless
-
- if ( !strcmp( argv[i], "-fullscreen" ) ) {
- ErrorF( "Running full screen in parallel with Mac OS X Quartz window server.\n" );
-#ifdef QUARTZ_SAFETY_DELAY
- ErrorF( "Quitting in %d seconds if no controller is found.\n",
- QUARTZ_SAFETY_DELAY );
-#endif
- return 1;
- }
-
- if ( !strcmp( argv[i], "-rootless" ) ) {
- ErrorF( "Running rootless inside Mac OS X window server.\n" );
-#ifdef QUARTZ_SAFETY_DELAY
- ErrorF( "Quitting in %d seconds if no controller is found.\n",
- QUARTZ_SAFETY_DELAY );
-#endif
- return 1;
- }
-
- if ( !strcmp( argv[i], "-quartz" ) ) {
- ErrorF( "Running in parallel with Mac OS X Quartz window server.\n" );
-#ifdef QUARTZ_SAFETY_DELAY
- ErrorF( "Quitting in %d seconds if no controller is found.\n",
- QUARTZ_SAFETY_DELAY );
-#endif
- return 1;
- }
-
- // The Mac OS X front end uses this argument, which we just ignore here.
- if ( !strcmp( argv[i], "-nostartx" ) ) {
- return 1;
- }
-
- // This command line arg is passed when launched from the Aqua GUI.
- if ( !strncmp( argv[i], "-psn_", 5 ) ) {
- return 1;
- }
-
- return 0;
-} \ No newline at end of file
diff --git a/xc/programs/Xserver/hw/darwin/bundle/rootless.h b/xc/programs/Xserver/hw/darwin/bundle/rootless.h
deleted file mode 100644
index 705dbf9f2..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/rootless.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * External interface to generic rootless mode
- *
- * Greg Parker gparker@cs.stanford.edu March 3, 2001
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/rootless.h,v 1.3 2001/08/01 05:34:06 torrey Exp $ */
-
-#ifndef _ROOTLESS_H
-#define _ROOTLESS_H
-
-#include "mi.h"
-#include "gcstruct.h"
-
-// RootlessFrameRec
-// Describes a single rootless window (aka frame).
-// The rootless mode keeps track of window position, and the
-// rootless implementation is responsible for the pixmap.
-// Multiple screens: all coordinates are SCREEN-LOCAL, not global.
-
-
-typedef struct RootlessFrameRec {
- /* Data maintained by rootless mode */
- /* position and size, including window border, in screen coordinates */
- int x;
- int y;
- unsigned int w;
- unsigned int h;
- WindowPtr win; /* the top-level window drawn in this frame */
- int isRoot; /* TRUE if this is the root window */
-
- /* Data maintained by rootless implementation */
- char *pixelData;
- int depth; // color bits per pixel; depth <= bitsPerPixel
- int bitsPerPixel;
- int bytesPerRow;
-
- void *devPrivate; /* for caller's use */
-} RootlessFrameRec, *RootlessFramePtr;
-
-
-// Create a new frame.
-// pUpper is the window above the new frame, or NULL if the new
-// frame will be on top.
-// pFrame is completely initialized. devPrivate is NULL
-// The pixmap must be valid when this is done.
-typedef void (*RootlessCreateFrameProc)
- (ScreenPtr pScreen, RootlessFramePtr pFrame, RootlessFramePtr pUpper);
-
-// Destroy a frame. Caller must free any private data and the pixmap.
-// All drawing is stopped and all updates are flushed before this is called.
-typedef void (*RootlessDestroyFrameProc)
- (ScreenPtr pScreen, RootlessFramePtr pFrame);
-
-// Move a frame on screen.
-// The frame changes position and nothing else.
-// pFrame and pFrame->win already contain the information about the
-// new position. oldX and oldY are the old position.
-// All updates are flushed before this is called.
-// The pixmap may change during this function.
-typedef void (*RootlessMoveFrameProc)
- (ScreenPtr pScreen, RootlessFramePtr pFrame, int oldX, int oldY);
-
-// Change frame ordering (aka stacking, layering)
-// pFrame->win already has its new siblings.
-// pOldNext is the window that was below this one, or NULL if this was
-// at the bottom.
-// pNewNext is the window that is now below this one, or NULL if this is
-// now at the bottom.
-typedef void (*RootlessRestackFrameProc)
- (ScreenPtr pScreen, RootlessFramePtr pFrame,
- RootlessFramePtr pOldNext, RootlessFramePtr pNewNext);
-
-// Flush drawing updates to the screen.
-// pDamage contains all changed pixels.
-// pDamage is in frame-local coordinates.
-// pDamage is clipped to the frame bounds and the frame shape.
-typedef void (*RootlessUpdateRegionProc)
- (ScreenPtr pScreen, RootlessFramePtr pFrame, RegionPtr pDamage);
-
-// Change the frame's shape.
-// pNewShape is in frame-local coordinates.
-// Everything outside pNewShape is no longer part of the frame.
-// pNewShape is {0, 0, width, height} for a plain-shaped frame.
-// fixme can the pixmap change here?
-// fixme reimplement shape
-typedef void (*RootlessReshapeFrameProc)
- (ScreenPtr pScreen, RootlessFramePtr pFrame, RegionPtr pNewShape);
-
-// Frame is about to resize.
-// The frame has its new position and size already.
-// postconditions:
-// The pixmap MUST point to a pixmap with the new size.
-// The pixmap data is undefined.
-// The old pixmap may be destroyed here.
-typedef void (*RootlessStartResizeFrameProc)
- (ScreenPtr pScreen, RootlessFramePtr pFrame,
- int oldX, int oldY, unsigned int oldW, unsigned int oldH);
-
-// Frame is done resizing.
-// Destroy the old pixmap if you haven't already.
-typedef void (*RootlessFinishResizeFrameProc)
- (ScreenPtr pScreen, RootlessFramePtr pFrame,
- int oldX, int oldY, unsigned int oldW, unsigned int oldH);
-
-
-// The callback function list.
-// Any of these may be NULL.
-typedef struct RootlessFrameProcs {
- RootlessCreateFrameProc CreateFrame;
- RootlessDestroyFrameProc DestroyFrame;
-
- RootlessMoveFrameProc MoveFrame;
- RootlessStartResizeFrameProc StartResizeFrame;
- RootlessFinishResizeFrameProc FinishResizeFrame;
- RootlessRestackFrameProc RestackFrame;
- RootlessReshapeFrameProc ReshapeFrame;
-
- RootlessUpdateRegionProc UpdateRegion;
-
- // RootlessStartDrawingProc StartDrawing;
- // RootlessStopDrawingProc StopDrawing;
-} RootlessFrameProcs;
-
-// Initialize rootless mode on the given screen.
-Bool RootlessInit(ScreenPtr pScreen, RootlessFrameProcs *procs);
-
-#endif /* _ROOTLESS_H */
diff --git a/xc/programs/Xserver/hw/darwin/bundle/rootlessAqua.h b/xc/programs/Xserver/hw/darwin/bundle/rootlessAqua.h
deleted file mode 100644
index 721dc1695..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/rootlessAqua.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Rootless setup for Aqua
- *
- * Greg Parker gparker@cs.stanford.edu
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/rootlessAqua.h,v 1.2 2001/08/01 05:34:06 torrey Exp $ */
-
-#ifndef _ROOTLESSAQUA_H
-#define _ROOTLESSAQUA_H
-
-Bool AquaAddScreen(int index, ScreenPtr pScreen);
-Bool AquaSetupScreen(int index, ScreenPtr pScreen);
-void AquaDisplayInit(void);
-
-#endif /* _ROOTLESSAQUA_H */
diff --git a/xc/programs/Xserver/hw/darwin/bundle/rootlessAquaGlue.c b/xc/programs/Xserver/hw/darwin/bundle/rootlessAquaGlue.c
deleted file mode 100644
index f3b041636..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/rootlessAquaGlue.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Generic rootless to Aqua specific glue code
- *
- * This code acts as a glue between the generic rootless X server code
- * and the Aqua specific implementation, which includes definitions that
- * conflict with stardard X types.
- *
- * Greg Parker gparker@cs.stanford.edu
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/rootlessAquaGlue.c,v 1.7 2001/12/22 05:28:35 torrey Exp $ */
-
-#include "quartzCommon.h"
-#include "darwin.h"
-#include "rootlessAqua.h"
-#include "rootlessAquaImp.h"
-#include "rootless.h"
-
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "globals.h" // dixScreenOrigins[]
-
-
-/////////////////////////////////////////
-// Rootless mode callback glue
-
-static void
-AquaGlueCreateFrame(ScreenPtr pScreen, RootlessFramePtr pFrame,
- RootlessFramePtr pUpper)
-{
- int sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX;
- int sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY;
-
- pFrame->devPrivate = AquaNewWindow(pUpper ? pUpper->devPrivate : NULL,
- pFrame->x + sx, pFrame->y + sy,
- pFrame->w, pFrame->h,
- pFrame->isRoot);
- AquaGetPixmap(pFrame->devPrivate, &pFrame->pixelData,
- &pFrame->bytesPerRow, &pFrame->depth,
- &pFrame->bitsPerPixel);
-}
-
-
-static void
-AquaGlueDestroyFrame(ScreenPtr pScreen, RootlessFramePtr pFrame)
-{
- AquaDestroyWindow(pFrame->devPrivate);
-}
-
-static void
-AquaGlueMoveFrame(ScreenPtr pScreen, RootlessFramePtr pFrame,
- int oldX, int oldY)
-{
- int sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX;
- int sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY;
-
- AquaMoveWindow(pFrame->devPrivate, pFrame->x + sx, pFrame->y + sy);
-}
-
-
-static void
-AquaGlueStartResizeFrame(ScreenPtr pScreen, RootlessFramePtr pFrame,
- int oldX, int oldY,
- unsigned int oldW, unsigned int oldH)
-{
- int sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX;
- int sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY;
-
- AquaStartResizeWindow(pFrame->devPrivate,
- pFrame->x + sx, pFrame->y + sy, pFrame->w, pFrame->h);
- AquaGetPixmap(pFrame->devPrivate, &pFrame->pixelData,
- &pFrame->bytesPerRow, &pFrame->depth,
- &pFrame->bitsPerPixel);
-}
-
-static void
-AquaGlueFinishResizeFrame(ScreenPtr pScreen, RootlessFramePtr pFrame,
- int oldX, int oldY,
- unsigned int oldW, unsigned int oldH)
-{
- int sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX;
- int sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY;
-
- AquaFinishResizeWindow(pFrame->devPrivate,
- pFrame->x + sx, pFrame->y + sy,
- pFrame->w, pFrame->h);
-}
-
-
-static void
-AquaGlueRestackFrame(ScreenPtr pScreen, RootlessFramePtr pFrame,
- RootlessFramePtr pOldPrev,
- RootlessFramePtr pNewPrev)
-{
- AquaRestackWindow(pFrame->devPrivate,
- pNewPrev ? pNewPrev->devPrivate : NULL);
-}
-
-static void
-AquaGlueReshapeFrame(ScreenPtr pScreen, RootlessFramePtr pFrame,
- RegionPtr pNewShape)
-{
- // Don't correct for dixScreenOrigins here.
- // pNewShape is in window-local coordinates.
- BoxRec shapeBox = {0, 0, pFrame->w, pFrame->h};
- if (pFrame->isRoot) return; // shouldn't happen; mi or dix covers this
-
- REGION_INVERSE(pScreen, pNewShape, pNewShape, &shapeBox);
- AquaReshapeWindow(pFrame->devPrivate,
- (fakeBoxRec *) REGION_RECTS(pNewShape),
- REGION_NUM_RECTS(pNewShape));
-}
-
-static void
-AquaGlueUpdateRegion(ScreenPtr pScreen, RootlessFramePtr pFrame,
- RegionPtr pDamage)
-{
- AquaUpdateRects(pFrame->devPrivate,
- (fakeBoxRec *) REGION_RECTS(pDamage),
- REGION_NUM_RECTS(pDamage));
-}
-
-#if 0
-static void
-AquaGlueStartDrawing(ScreenPtr pScreen, RootlessFramePtr pFrame)
-{
- AquaStartDrawing(pFrame->devPrivate, &pFrame->pixelData,
- &pFrame->bytesPerRow, &pFrame->depth,
- &pFrame->bitsPerPixel);
-}
-
-static void
-AquaGlueStopDrawing(ScreenPtr pScreen, RootlessFramePtr pFrame)
-{
- AquaStopDrawing(pFrame->devPrivate);
-}
-#endif
-
-static RootlessFrameProcs aquaRootlessProcs = {
- AquaGlueCreateFrame,
- AquaGlueDestroyFrame,
- AquaGlueMoveFrame,
- AquaGlueStartResizeFrame,
- AquaGlueFinishResizeFrame,
- AquaGlueRestackFrame,
- AquaGlueReshapeFrame,
- AquaGlueUpdateRegion
-};
-
-
-///////////////////////////////////////
-// Rootless mode initialization.
-// Exported by rootlessAqua.h
-
-/*
- * AquaDisplayInit
- * Find all Aqua screens.
- */
-void
-AquaDisplayInit(void)
-{
- darwinScreensFound = AquaDisplayCount();
-}
-
-
-/*
- * AquaAddScreen
- * Init the framebuffer and record pixmap parameters for the screen.
- */
-Bool
-AquaAddScreen(int index, ScreenPtr pScreen)
-{
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- QuartzScreenPtr displayInfo = QUARTZ_PRIV(pScreen);
- CGRect cgRect;
- CGDisplayCount numDisplays;
- CGDisplayCount allocatedDisplays = 0;
- CGDirectDisplayID *displays = NULL;
- CGDisplayErr cgErr;
-
- dfb->pixelInfo.pixelType = kIORGBDirectPixels;
- AquaScreenInit(index, &dfb->x, &dfb->y, &dfb->width, &dfb->height,
- &dfb->pitch, &dfb->pixelInfo.bitsPerComponent,
- &dfb->pixelInfo.componentCount, &dfb->bitsPerPixel);
- dfb->colorBitsPerPixel = dfb->pixelInfo.bitsPerComponent *
- dfb->pixelInfo.componentCount;
-
- // No frame buffer - it's all in window pixmaps.
- dfb->framebuffer = NULL; // malloc(dfb.pitch * dfb.height);
-
- // Get all CoreGraphics displays covered by this X11 display.
- cgRect = CGRectMake(dfb->x, dfb->y, dfb->width, dfb->height);
- do {
- cgErr = CGGetDisplaysWithRect(cgRect, 0, NULL, &numDisplays);
- if (cgErr) break;
- allocatedDisplays = numDisplays;
- displays = xrealloc(displays,
- numDisplays * sizeof(CGDirectDisplayID));
- cgErr = CGGetDisplaysWithRect(cgRect, allocatedDisplays, displays,
- &numDisplays);
- if (cgErr != CGDisplayNoErr) break;
- } while (numDisplays > allocatedDisplays);
-
- if (cgErr != CGDisplayNoErr || numDisplays == 0) {
- ErrorF("Could not find CGDirectDisplayID(s) for X11 screen %d: %dx%d @ %d,%d.\n",
- index, dfb->width, dfb->height, dfb->x, dfb->y);
- return FALSE;
- }
-
- // This X11 screen covers all CoreGraphics displays we just found.
- // If there's more than one CG display, then video mirroring is on
- // or PseudoramiX is on.
- displayInfo->displayCount = allocatedDisplays;
- displayInfo->displayIDs = displays;
-
- return TRUE;
-}
-
-/*
- * AquaSetupScreen
- * Setup the screen for rootless access.
- */
-Bool
-AquaSetupScreen(int index, ScreenPtr pScreen)
-{
- return RootlessInit(pScreen, &aquaRootlessProcs);
-}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/rootlessAquaImp.h b/xc/programs/Xserver/hw/darwin/bundle/rootlessAquaImp.h
deleted file mode 100644
index fe2d4e3a4..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/rootlessAquaImp.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Rootless implementation for Mac OS X Aqua environment
- *
- * Greg Parker gparker@cs.stanford.edu
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/rootlessAquaImp.h,v 1.3 2001/08/01 05:34:06 torrey Exp $ */
-
-#ifndef _ROOTLESSAQUAIMP_H
-#define _ROOTLESSAQUAIMP_H
-
-#include "fakeBoxRec.h"
-
-int AquaDisplayCount();
-
-void AquaScreenInit(int index, int *x, int *y, int *width, int *height,
- int *rowBytes, unsigned long *bps, unsigned long *spp,
- int *bpp);
-
-void *AquaNewWindow(void *upperw, int x, int y, int w, int h, int isRoot);
-
-void AquaDestroyWindow(void *rw);
-
-void AquaMoveWindow(void *rw, int x, int y);
-
-void AquaStartResizeWindow(void *rw, int x, int y, int w, int h);
-
-void AquaFinishResizeWindow(void *rw, int x, int y, int w, int h);
-
-void AquaUpdateRects(void *rw, fakeBoxRec *rects, int count);
-
-void AquaRestackWindow(void *rw, void *lowerw);
-
-void AquaReshapeWindow(void *rw, fakeBoxRec *rects, int count);
-
-void AquaGetPixmap(void *rw, char **bits,
- int *rowBytes, int *depth, int *bpp);
-
-#endif /* _ROOTLESSAQUAIMP_H */
diff --git a/xc/programs/Xserver/hw/darwin/bundle/rootlessAquaImp.m b/xc/programs/Xserver/hw/darwin/bundle/rootlessAquaImp.m
deleted file mode 100644
index df4fb5d9e..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/rootlessAquaImp.m
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Rootless implementation for Mac OS X Aqua environment
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/rootlessAquaImp.m,v 1.11 2002/01/17 02:44:27 torrey Exp $ */
-
-#include "rootlessAquaImp.h"
-#include "XWindow.h"
-#include "fakeBoxRec.h"
-#include "quartzCommon.h"
-#include "pseudoramiX.h"
-
-extern void ErrorF(const char *, ...);
-
-typedef struct {
- XWindow *window;
-} AquaWindowRec;
-
-
-#define WINREC(rw) ((AquaWindowRec *)rw)
-
-
-// Multihead note: When rootless mode uses PseudoramiX, the
-// X server only sees one screen; only PseudoramiX itself knows
-// about all of the screens.
-
-int AquaDisplayCount()
-{
- aquaNumScreens = [[NSScreen screens] count];
-
- if (noPseudoramiXExtension) {
- return aquaNumScreens;
- } else {
- return 1; // only PseudoramiX knows about the rest
- }
-}
-
-void AquaScreenInit(int index, int *x, int *y, int *width, int *height,
- int *rowBytes, unsigned long *bps, unsigned long *spp,
- int *bpp)
-{
- *bps = 8;
- *spp = 3;
- *bpp = 32;
-
- if (noPseudoramiXExtension) {
- NSScreen *screen = [[NSScreen screens] objectAtIndex:index];
- NSRect frame = [screen frame];
-
- // set x, y so (0,0) is top left of main screen
- *x = NSMinX(frame);
- *y = NSHeight([[NSScreen mainScreen] frame]) - NSHeight(frame) -
- NSMinY(frame);
-
- *width = NSWidth(frame);
- *height = NSHeight(frame);
- *rowBytes = (*width) * (*bpp) / 8;
-
- // Shift the usable part of main screen down to avoid the menu bar.
- if (NSEqualRects(frame, [[NSScreen mainScreen] frame])) {
- *y += aquaMenuBarHeight;
- *height -= aquaMenuBarHeight;
- }
-
- } else {
- int i;
- NSRect unionRect = NSMakeRect(0, 0, 0, 0);
- NSArray *screens = [NSScreen screens];
-
- // Get the union of all screens (minus the menu bar on main screen)
- for (i = 0; i < [screens count]; i++) {
- NSScreen *screen = [screens objectAtIndex:i];
- NSRect frame = [screen frame];
- frame.origin.y = [[NSScreen mainScreen] frame].size.height -
- frame.size.height - frame.origin.y;
- if (NSEqualRects([screen frame], [[NSScreen mainScreen] frame])) {
- frame.origin.y += aquaMenuBarHeight;
- frame.size.height -= aquaMenuBarHeight;
- }
- unionRect = NSUnionRect(unionRect, frame);
- }
-
- // Use unionRect as the screen size for the X server.
- *x = unionRect.origin.x;
- *y = unionRect.origin.y;
- *width = unionRect.size.width;
- *height = unionRect.size.height;
- *rowBytes = (*width) * (*bpp) / 8;
-
- // Tell PseudoramiX about the real screens.
- // InitOutput() will move the big screen to (0,0),
- // so compensate for that here.
- for (i = 0; i < [screens count]; i++) {
- NSScreen *screen = [screens objectAtIndex:i];
- NSRect frame = [screen frame];
- int j;
-
- // Skip this screen if it's a mirrored copy of an earlier screen.
- for (j = 0; j < i; j++) {
- if (NSEqualRects(frame, [[screens objectAtIndex:j] frame])) {
- ErrorF("PseudoramiX screen %d is a mirror of screen %d.\n",
- i, j);
- break;
- }
- }
- if (j < i) continue; // this screen is a mirrored copy
-
- frame.origin.y = [[NSScreen mainScreen] frame].size.height -
- frame.size.height - frame.origin.y;
-
- if (NSEqualRects([screen frame], [[NSScreen mainScreen] frame])) {
- frame.origin.y += aquaMenuBarHeight;
- frame.size.height -= aquaMenuBarHeight;
- }
-
- ErrorF("PseudoramiX screen %d added: %dx%d @ (%d,%d).\n", i,
- (int)frame.size.width, (int)frame.size.height,
- (int)frame.origin.x, (int)frame.origin.y);
-
- frame.origin.x -= unionRect.origin.x;
- frame.origin.y -= unionRect.origin.y;
-
- ErrorF("PseudoramiX screen %d placed at X11 coordinate (%d,%d).\n",
- i, (int)frame.origin.x, (int)frame.origin.y);
-
- PseudoramiXAddScreen(frame.origin.x, frame.origin.y,
- frame.size.width, frame.size.height);
- }
- }
-}
-
-void *AquaNewWindow(void *upperw, int x, int y, int w, int h, int isRoot)
-{
- AquaWindowRec *winRec = (AquaWindowRec *)malloc(sizeof(AquaWindowRec));
- NSRect frame = NSMakeRect(x, NSHeight([[NSScreen mainScreen] frame]) -
- y - h, w, h);
-
- winRec->window = [[XWindow alloc] initWithContentRect:frame isRoot:isRoot];
-
- if (upperw) {
- AquaWindowRec *upperRec = WINREC(upperw);
- int uppernum = [upperRec->window windowNumber];
- [winRec->window orderWindow:NSWindowBelow relativeTo:uppernum];
- } else {
- [winRec->window orderFront:nil];
- }
-
- // fixme hide root for now
- if (isRoot) [winRec->window orderOut:nil];
-
- return winRec;
-}
-
-void AquaDestroyWindow(void *rw)
-{
- AquaWindowRec *winRec = WINREC(rw);
-
- [winRec->window release];
-}
-
-void AquaMoveWindow(void *rw, int x, int y)
-{
- AquaWindowRec *winRec = WINREC(rw);
- NSPoint topLeft = NSMakePoint(x, NSHeight([[NSScreen mainScreen] frame]) -
- y);
-
- [winRec->window setFrameTopLeftPoint:topLeft];
-}
-
-void AquaStartResizeWindow(void *rw, int x, int y, int w, int h)
-{
- AquaWindowRec *winRec = WINREC(rw);
- NSRect frame = NSMakeRect(x, NSHeight([[NSScreen mainScreen] frame]) -
- y - h, w, h);
-
- [winRec->window setFrame:frame display:NO];
-}
-
-void AquaFinishResizeWindow(void *rw, int x, int y, int w, int h)
-{
- // refresh everything? fixme yes for testing
- fakeBoxRec box = {0, 0, w, h};
- AquaWindowRec *winRec = WINREC(rw);
-
- [winRec->window refreshRects:&box count:1];
-}
-
-void AquaUpdateRects(void *rw, fakeBoxRec *rects, int count)
-{
- AquaWindowRec *winRec = WINREC(rw);
-
- [winRec->window refreshRects:rects count:count];
-}
-
-// fixme is this upperw or lowerw?
-void AquaRestackWindow(void *rw, void *upperw)
-{
- AquaWindowRec *winRec = WINREC(rw);
-
- if (upperw) {
- AquaWindowRec *upperRec = WINREC(upperw);
- int uppernum = [upperRec->window windowNumber];
- [winRec->window orderWindow:NSWindowBelow relativeTo:uppernum];
- } else {
- [winRec->window orderFront:nil];
- }
- // [winRec->window setAcceptsMouseMovedEvents:YES];
- // fixme prefer to orderFront whenever possible - pass upperw, not lowerw
-}
-
-// rects are the areas not part of the new shape
-void AquaReshapeWindow(void *rw, fakeBoxRec *rects, int count)
-{
- AquaWindowRec *winRec = WINREC(rw);
-
- // make transparent if window is now shaped
- // transparent windows never go back to opaque
- if (count > 0) {
- [winRec->window setOpaque:NO];
- }
-
- [[winRec->window contentView] reshapeRects:rects count:count];
-
- if (! [winRec->window isOpaque]) {
- // force update of window shadow
- [winRec->window setHasShadow:NO];
- [winRec->window setHasShadow:YES];
- }
-}
-
-void AquaGetPixmap(void *rw, char **bits,
- int *rowBytes, int *depth, int *bpp)
-{
- AquaWindowRec *winRec = WINREC(rw);
-
- [winRec->window getBits:bits rowBytes:rowBytes depth:depth
- bitsPerPixel:bpp];
-}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/rootlessCommon.c b/xc/programs/Xserver/hw/darwin/bundle/rootlessCommon.c
deleted file mode 100644
index 4e9d665c6..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/rootlessCommon.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Common rootless definitions and code
- *
- * Greg Parker gparker@cs.stanford.edu
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/rootlessCommon.c,v 1.3 2001/11/05 05:12:16 torrey Exp $ */
-
-#include "rootlessCommon.h"
-
-
-RegionRec rootlessHugeRoot = {{-32767, -32767, 32767, 32767}, NULL};
-
-
-// Returns the top-level parent of pWindow.
-// The root is the top-level parent of itself, even though the root is
-// not otherwise considered to be a top-level window.
-WindowPtr TopLevelParent(WindowPtr pWindow)
-{
- WindowPtr top = pWindow;
-
- if (IsRoot(pWindow)) return pWindow; // root is top-level parent of itself
- while (top && ! IsTopLevel(top)) top = top->parent;
- return top;
-}
-
-
-// Returns TRUE if this window is visible inside a frame
-// (e.g. it is visible and has a top-level or root parent)
-Bool IsFramedWindow(WindowPtr pWin)
-{
- WindowPtr top;
-
- if (! pWin->realized) return FALSE;
- top = TopLevelParent(pWin);
- return (top && WINREC(top));
-}
-
-
-// Move the given pixmap's base address to where pixel (0, 0)
-// would be if the pixmap's actual data started at (x, y)
-void SetPixmapBaseToScreen(PixmapPtr pix, int x, int y)
-{
- pix->devPrivate.ptr = (char *)(pix->devPrivate.ptr) -
- (pix->drawable.bitsPerPixel/8 * x + y*pix->devKind);
-}
-
-
-// Update pWindow's pixmap.
-// This needs to be called every time a window moves relative to
-// its top-level parent, or the parent's pixmap data is reallocated.
-// Three cases:
-// * window is top-level with no existing pixmap: make one
-// * window is top-level with existing pixmap: update it in place
-// * window is descendant of top-level: point to top-level's pixmap
-void UpdatePixmap(WindowPtr pWindow)
-{
- WindowPtr top = TopLevelParent(pWindow);
- RootlessWindowRec *winRec;
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- PixmapPtr pix;
-
- RL_DEBUG_MSG("update pixmap (win 0x%x)", pWindow);
-
- // Don't use IsFramedWindow(); window is unrealized during RealizeWindow().
-
- if (! top) {
- RL_DEBUG_MSG("no parent\n");
- return;
- }
- winRec = WINREC(top);
- if (!winRec) {
- RL_DEBUG_MSG("not framed\n");
- return;
- }
-
- if (pWindow == top) {
- // This is the top window. Update its pixmap.
- if (winRec->pixmap == NULL) {
- // Allocate a new pixmap.
- pix = GetScratchPixmapHeader(pScreen,
- winRec->frame.w, winRec->frame.h,
- winRec->frame.depth,
- winRec->frame.bitsPerPixel,
- winRec->frame.bytesPerRow,
- winRec->frame.pixelData);
- SetPixmapBaseToScreen(pix, winRec->frame.x, winRec->frame.y);
- pScreen->SetWindowPixmap(pWindow, pix);
- winRec->pixmap = pix;
- } else {
- // Update existing pixmap. Update in place so we don't have to
- // change the children's pixmaps.
- pix = winRec->pixmap;
- pScreen->ModifyPixmapHeader(pix,
- winRec->frame.w, winRec->frame.h,
- winRec->frame.depth,
- winRec->frame.bitsPerPixel,
- winRec->frame.bytesPerRow,
- winRec->frame.pixelData);
- SetPixmapBaseToScreen(pix, winRec->frame.x, winRec->frame.y);
- }
- } else {
- // This is not the top window. Point to the parent's pixmap.
- pix = winRec->pixmap;
- pScreen->SetWindowPixmap(pWindow, pix);
- }
-
- RL_DEBUG_MSG("done\n");
-}
-
-
-#ifdef SHAPE
-
-// boundingShape = outside border (like borderClip)
-// clipShape = inside border (like clipList)
-// Both are in window-local coordinates
-// We only care about boundingShape (fixme true?)
-
-// RootlessReallySetShape is used in several places other than SetShape.
-// Most importantly, SetShape is often called on unmapped windows, so we
-// have to wait until the window is mapped to reshape the frame.
-static void RootlessReallySetShape(WindowPtr pWin)
-{
- RootlessWindowRec *winRec = WINREC(pWin);
- ScreenPtr pScreen = pWin->drawable.pScreen;
- RegionRec newShape;
-
- if (IsRoot(pWin)) return;
- if (!IsTopLevel(pWin)) return;
- if (!winRec) return;
-
- if (wBoundingShape(pWin)) {
- // wBoundingShape is relative to *inner* origin of window.
- // Translate by borderWidth to get the outside-relative position.
- REGION_INIT(pScreen, &newShape, NullBox, 0);
- REGION_COPY(pScreen, &newShape, wBoundingShape(pWin));
- REGION_TRANSLATE(pScreen, &newShape, pWin->borderWidth,
- pWin->borderWidth);
- } else {
- newShape.data = NULL;
- newShape.extents.x1 = 0;
- newShape.extents.y1 = 0;
- newShape.extents.x2 = winRec->frame.w;
- newShape.extents.y2 = winRec->frame.h;
- }
- RL_DEBUG_MSG("reshaping...");
- RL_DEBUG_MSG("numrects %d, extents %d %d %d %d ",
- REGION_NUM_RECTS(&newShape),
- newShape.extents.x1, newShape.extents.y1,
- newShape.extents.x2, newShape.extents.y2);
- CallFrameProc(pScreen, ReshapeFrame,(pScreen, &winRec->frame, &newShape));
- REGION_UNINIT(pScreen, &newShape);
-}
-
-#endif // SHAPE
-
-
-// pRegion is GLOBAL
-void
-RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion)
-{
- pWindow = TopLevelParent(pWindow);
- if (!pWindow) {
- RL_DEBUG_MSG("RootlessDamageRegion: window is not framed\n");
- } else if (!WINREC(pWindow)) {
- RL_DEBUG_MSG("RootlessDamageRegion: top-level window not a frame\n");
- } else {
- REGION_UNION((pWindow)->drawable.pScreen, &WINREC(pWindow)->damage,
- &WINREC(pWindow)->damage, (pRegion));
- }
-}
-
-
-// pBox is GLOBAL
-void
-RootlessDamageBox(WindowPtr pWindow, BoxPtr pBox)
-{
- RegionRec region;
-
- REGION_INIT(pWindow->drawable.pScreen, &region, pBox, 1);
- RootlessDamageRegion(pWindow, &region);
-}
-
-
-// (x, y, w, h) is in window-local coordinates.
-void
-RootlessDamageRect(WindowPtr pWindow, int x, int y, int w, int h)
-{
- BoxRec box;
- RegionRec region;
-
- x += pWindow->drawable.x;
- y += pWindow->drawable.y;
- box.x1 = x;
- box.x2 = x + w;
- box.y1 = y;
- box.y2 = y + h;
- REGION_INIT(pWindow->drawable.pScreen, &region, &box, 1);
- RootlessDamageRegion(pWindow, &region);
-}
-
-#ifdef SHAPE
-
-void
-RootlessDamageShape(WindowPtr pWin)
-{
- RootlessWindowRec *winRec = WINREC(pWin);
-
- // We only care about the shape of top-level framed windows.
- if (IsRoot(pWin)) return;
- if (!IsTopLevel(pWin)) return;
- if (!winRec) return;
-
- winRec->shapeDamage = TRUE;
-}
-
-#endif // SHAPE
-
-void
-RootlessRedisplay(WindowPtr pWindow)
-{
- RootlessWindowRec *winRec = WINREC(pWindow);
- ScreenPtr pScreen = pWindow->drawable.pScreen;
-
-#ifdef SHAPE
- if (winRec->shapeDamage) {
- // Reshape the window. This will also update the entire window.
- RootlessReallySetShape(pWindow);
- REGION_EMPTY(pScreen, &winRec->damage);
- winRec->shapeDamage = FALSE;
- }
- else
-#endif // SHAPE
- if (REGION_NOTEMPTY(pScreen, &winRec->damage)) {
- REGION_INTERSECT(pScreen, &winRec->damage, &winRec->damage,
- &pWindow->borderSize);
-
- // move region to window local coords
- REGION_TRANSLATE(pScreen, &winRec->damage,
- -winRec->frame.x, -winRec->frame.y);
- CallFrameProc(pScreen, UpdateRegion,
- (pScreen, &winRec->frame, &winRec->damage));
- REGION_EMPTY(pScreen, &winRec->damage);
- }
-}
-
-
-void
-RootlessRedisplayScreen(ScreenPtr pScreen)
-{
- WindowPtr root = WindowTable[pScreen->myNum];
-
- if (root) {
- WindowPtr win;
-
- RootlessRedisplay(root);
- for (win = root->firstChild; win; win = win->nextSib) {
- if (WINREC(win)) {
- RootlessRedisplay(win);
- }
- }
- }
-}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/rootlessCommon.h b/xc/programs/Xserver/hw/darwin/bundle/rootlessCommon.h
deleted file mode 100644
index d6ca120ab..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/rootlessCommon.h
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Common internal rootless definitions and code
- *
- * Greg Parker gparker@cs.stanford.edu
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/rootlessCommon.h,v 1.5 2001/12/22 05:28:35 torrey Exp $ */
-
-#ifndef _ROOTLESSCOMMON_H
-#define _ROOTLESSCOMMON_H
-
-#include "rootless.h"
-
-#include "pixmapstr.h"
-#include "windowstr.h"
-
-#ifdef RENDER
-#include "picturestr.h"
-#endif
-
-
-// Debug output, or not.
-#ifdef ROOTLESSDEBUG
-#define RL_DEBUG_MSG ErrorF
-#else
-#define RL_DEBUG_MSG(a, ...)
-#endif
-
-
-// Global variables
-extern int rootlessGCPrivateIndex;
-extern int rootlessScreenPrivateIndex;
-extern int rootlessWindowPrivateIndex;
-
-
-// RootlessGCRec: private per-gc data
-typedef struct {
- GCFuncs *originalFuncs;
- GCOps *originalOps;
-} RootlessGCRec;
-
-
-// RootlessWindowRec: private per-window data
-typedef struct RootlessWindowRec {
- RootlessFrameRec frame;
- RegionRec damage;
- unsigned int borderWidth; // needed for MoveWindow(VTOther) (%$#@!!!)
- PixmapPtr pixmap;
-#ifdef SHAPE
- BOOL shapeDamage; // TRUE if shape has changed
-#endif
-} RootlessWindowRec;
-
-
-// RootlessScreenRec: per-screen private data
-typedef struct {
- ScreenPtr pScreen;
- RootlessFrameProcs frameProcs;
-
- CloseScreenProcPtr CloseScreen;
-
- CreateWindowProcPtr CreateWindow;
- DestroyWindowProcPtr DestroyWindow;
- RealizeWindowProcPtr RealizeWindow;
- UnrealizeWindowProcPtr UnrealizeWindow;
- MoveWindowProcPtr MoveWindow;
- ResizeWindowProcPtr ResizeWindow;
- RestackWindowProcPtr RestackWindow;
- ChangeBorderWidthProcPtr ChangeBorderWidth;
- PositionWindowProcPtr PositionWindow;
- ChangeWindowAttributesProcPtr ChangeWindowAttributes;
-
- CreateGCProcPtr CreateGC;
- PaintWindowBackgroundProcPtr PaintWindowBackground;
- PaintWindowBorderProcPtr PaintWindowBorder;
- CopyWindowProcPtr CopyWindow;
- GetImageProcPtr GetImage;
-
- MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
- ValidateTreeProcPtr ValidateTree;
-
-#ifdef SHAPE
- SetShapeProcPtr SetShape;
-#endif
-
-#ifdef RENDER
- CompositeProcPtr Composite;
- GlyphsProcPtr Glyphs;
-#endif
-
-} RootlessScreenRec;
-
-
-// "Definition of the Porting Layer for the X11 Sample Server" says
-// unwrap and rewrap of screen functions is unnecessary, but
-// screen->CreateGC changes after a call to cfbCreateGC.
-
-#define SCREEN_UNWRAP(screen, fn) \
- screen->fn = SCREENREC(screen)->fn;
-
-#define SCREEN_WRAP(screen, fn) \
- SCREENREC(screen)->fn = screen->fn; \
- screen->fn = Rootless##fn
-
-
-// Accessors for screen and window privates
-
-#define SCREENREC(pScreen) \
- ((RootlessScreenRec*)(pScreen)->devPrivates[rootlessScreenPrivateIndex].ptr)
-
-#define WINREC(pWin) \
- ((RootlessWindowRec *)(pWin)->devPrivates[rootlessWindowPrivateIndex].ptr)
-
-
-// Call a rootless implementation function.
-// Many rootless implementation functions are allowed to be NULL.
-#define CallFrameProc(pScreen, proc, params) \
- if (SCREENREC(pScreen)->frameProcs.proc) { \
- RL_DEBUG_MSG("calling frame proc " #proc " "); \
- SCREENREC(pScreen)->frameProcs.proc params; \
- }
-
-
-// BoxRec manipulators
-// Copied from shadowfb
-
-#define TRIM_BOX(box, pGC) { \
- BoxPtr extents = &pGC->pCompositeClip->extents;\
- if(box.x1 < extents->x1) box.x1 = extents->x1; \
- if(box.x2 > extents->x2) box.x2 = extents->x2; \
- if(box.y1 < extents->y1) box.y1 = extents->y1; \
- if(box.y2 > extents->y2) box.y2 = extents->y2; \
-}
-
-#define TRANSLATE_BOX(box, pDraw) { \
- box.x1 += pDraw->x; \
- box.x2 += pDraw->x; \
- box.y1 += pDraw->y; \
- box.y2 += pDraw->y; \
-}
-
-#define TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC) { \
- TRANSLATE_BOX(box, pDraw); \
- TRIM_BOX(box, pGC); \
-}
-
-#define BOX_NOT_EMPTY(box) \
- (((box.x2 - box.x1) > 0) && ((box.y2 - box.y1) > 0))
-
-
-// HUGE_ROOT and NORMAL_ROOT
-// We don't want to clip windows to the edge of the screen.
-// HUGE_ROOT temporarily makes the root window really big.
-// This is needed as a wrapper around any function that calls
-// SetWinSize or SetBorderSize which clip a window against its
-// parents, including the root.
-
-extern RegionRec rootlessHugeRoot;
-
-#define HUGE_ROOT(pWin) \
- { \
- WindowPtr w = pWin; \
- while (w->parent) w = w->parent; \
- saveRoot = w->winSize; \
- w->winSize = rootlessHugeRoot; \
- }
-
-#define NORMAL_ROOT(pWin) \
- { \
- WindowPtr w = pWin; \
- while (w->parent) w = w->parent; \
- w->winSize = saveRoot; \
- }
-
-
-// Returns TRUE if this window is a top-level window (i.e. child of the root)
-// The root is not a top-level window.
-#define IsTopLevel(pWin) \
- ((pWin) && (pWin)->parent && !(pWin)->parent->parent)
-
-// Returns TRUE if this window is a root window
-#define IsRoot(pWin) \
- ((pWin) == WindowTable[(pWin)->drawable.pScreen->myNum])
-
-// Returns the top-level parent of pWindow.
-// The root is the top-level parent of itself, even though the root is
-// not otherwise considered to be a top-level window.
-WindowPtr TopLevelParent(WindowPtr pWindow);
-
-// Returns TRUE if this window is visible inside a frame
-// (e.g. it is visible and has a top-level or root parent)
-Bool IsFramedWindow(WindowPtr pWin);
-
-// Move the given pixmap's base address to where pixel (0, 0)
-// would be if the pixmap's actual data started at (x, y).
-void SetPixmapBaseToScreen(PixmapPtr pix, int x, int y);
-
-// Update pWindow's pixmap.
-// This needs to be called every time a window moves relative to
-// its top-level parent, or the parent's pixmap data is reallocated.
-void UpdatePixmap(WindowPtr pWindow);
-
-// Routines that cause regions to get redrawn.
-// DamageRegion and DamageRect are in global coordinates.
-// DamageBox is in window-local coordinates.
-void RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion);
-void RootlessDamageRect(WindowPtr pWindow, int x, int y, int w, int h);
-void RootlessDamageBox(WindowPtr pWindow, BoxPtr pBox);
-void RootlessRedisplay(WindowPtr pWindow);
-void RootlessRedisplayScreen(ScreenPtr pScreen);
-
-// Window reshape needs to be updated. The reshape also forces complete redraw.
-void RootlessDamageShape(WindowPtr pWin);
-
-#endif // _ROOTLESSCOMMON_H
diff --git a/xc/programs/Xserver/hw/darwin/bundle/rootlessGC.c b/xc/programs/Xserver/hw/darwin/bundle/rootlessGC.c
deleted file mode 100644
index a82118b23..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/rootlessGC.c
+++ /dev/null
@@ -1,1170 +0,0 @@
-/*
- * Graphics Context support for Mac OS X rootless X server
- *
- * Greg Parker gparker@cs.stanford.edu
- *
- * February 2001 Created
- * March 3, 2001 Restructured as generic rootless mode
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/rootlessGC.c,v 1.3 2001/07/01 03:24:57 torrey Exp $ */
-
-#include "mi.h"
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "dixfontstr.h"
-#include "mivalidate.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include "rootlessCommon.h"
-
-
-// GC functions
-static void RootlessValidateGC(GCPtr pGC, unsigned long changes,
- DrawablePtr pDrawable);
-static void RootlessChangeGC(GCPtr pGC, unsigned long mask);
-static void RootlessCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
-static void RootlessDestroyGC(GCPtr pGC);
-static void RootlessChangeClip(GCPtr pGC, int type, pointer pvalue,
- int nrects);
-static void RootlessDestroyClip(GCPtr pGC);
-static void RootlessCopyClip(GCPtr pgcDst, GCPtr pgcSrc);
-
-GCFuncs rootlessGCFuncs = {
- RootlessValidateGC,
- RootlessChangeGC,
- RootlessCopyGC,
- RootlessDestroyGC,
- RootlessChangeClip,
- RootlessDestroyClip,
- RootlessCopyClip,
-};
-
-// GC operations
-static void RootlessFillSpans();
-static void RootlessSetSpans();
-static void RootlessPutImage();
-static RegionPtr RootlessCopyArea();
-static RegionPtr RootlessCopyPlane();
-static void RootlessPolyPoint();
-static void RootlessPolylines();
-static void RootlessPolySegment();
-static void RootlessPolyRectangle();
-static void RootlessPolyArc();
-static void RootlessFillPolygon();
-static void RootlessPolyFillRect();
-static void RootlessPolyFillArc();
-static int RootlessPolyText8();
-static int RootlessPolyText16();
-static void RootlessImageText8();
-static void RootlessImageText16();
-static void RootlessImageGlyphBlt();
-static void RootlessPolyGlyphBlt();
-static void RootlessPushPixels();
-
-static GCOps rootlessGCOps = {
- RootlessFillSpans,
- RootlessSetSpans,
- RootlessPutImage,
- RootlessCopyArea,
- RootlessCopyPlane,
- RootlessPolyPoint,
- RootlessPolylines,
- RootlessPolySegment,
- RootlessPolyRectangle,
- RootlessPolyArc,
- RootlessFillPolygon,
- RootlessPolyFillRect,
- RootlessPolyFillArc,
- RootlessPolyText8,
- RootlessPolyText16,
- RootlessImageText8,
- RootlessImageText16,
- RootlessImageGlyphBlt,
- RootlessPolyGlyphBlt,
- RootlessPushPixels
-#ifdef NEED_LINEHELPER
- , NULL
-#endif
-};
-
-
-Bool
-RootlessCreateGC(GCPtr pGC)
-{
- RootlessGCRec *gcrec;
- RootlessScreenRec *s;
- Bool result;
-
- SCREEN_UNWRAP(pGC->pScreen, CreateGC);
- s = (RootlessScreenRec *) pGC->pScreen->
- devPrivates[rootlessScreenPrivateIndex].ptr;
- result = s->CreateGC(pGC);
- gcrec = (RootlessGCRec *) pGC->devPrivates[rootlessGCPrivateIndex].ptr;
- gcrec->originalOps = NULL; // don't wrap ops yet
- gcrec->originalFuncs = pGC->funcs;
- pGC->funcs = &rootlessGCFuncs;
-
- SCREEN_WRAP(pGC->pScreen, CreateGC);
- return result;
-}
-
-
-// GC func wrapping
-// ValidateGC wraps gcOps iff dest is viewable. All others just unwrap&call.
-
-// GCFUN_UNRAP assumes funcs have been wrapped and
-// does not assume ops have been wrapped
-#define GCFUNC_UNWRAP(pGC) \
- RootlessGCRec *gcrec = (RootlessGCRec *) \
- (pGC)->devPrivates[rootlessGCPrivateIndex].ptr; \
- (pGC)->funcs = gcrec->originalFuncs; \
- if (gcrec->originalOps) { \
- (pGC)->ops = gcrec->originalOps; \
-}
-
-#define GCFUNC_WRAP(pGC) \
- gcrec->originalFuncs = (pGC)->funcs; \
- (pGC)->funcs = &rootlessGCFuncs; \
- if (gcrec->originalOps) { \
- gcrec->originalOps = (pGC)->ops; \
- (pGC)->ops = &rootlessGCOps; \
-}
-
-
-static void
-RootlessValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
-{
- GCFUNC_UNWRAP(pGC);
-
- pGC->funcs->ValidateGC(pGC, changes, pDrawable);
-
- gcrec->originalOps = NULL;
-
- if (pDrawable->type == DRAWABLE_WINDOW) {
- WindowPtr pWin = (WindowPtr) pDrawable;
-
- if (pWin->viewable) {
- gcrec->originalOps = pGC->ops;
- }
- }
-
- GCFUNC_WRAP(pGC);
-}
-
-static void RootlessChangeGC(GCPtr pGC, unsigned long mask)
-{
- GCFUNC_UNWRAP(pGC);
- pGC->funcs->ChangeGC(pGC, mask);
- GCFUNC_WRAP(pGC);
-}
-
-static void RootlessCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst)
-{
- GCFUNC_UNWRAP(pGCDst);
- pGCDst->funcs->CopyGC(pGCSrc, mask, pGCDst);
- GCFUNC_WRAP(pGCDst);
-}
-
-static void RootlessDestroyGC(GCPtr pGC)
-{
- GCFUNC_UNWRAP(pGC);
- pGC->funcs->DestroyGC(pGC);
- GCFUNC_WRAP(pGC);
-}
-
-static void RootlessChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects)
-{
- GCFUNC_UNWRAP(pGC);
- pGC->funcs->ChangeClip(pGC, type, pvalue, nrects);
- GCFUNC_WRAP(pGC);
-}
-
-static void RootlessDestroyClip(GCPtr pGC)
-{
- GCFUNC_UNWRAP(pGC);
- pGC->funcs->DestroyClip(pGC);
- GCFUNC_WRAP(pGC);
-}
-
-static void RootlessCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
- GCFUNC_UNWRAP(pgcDst);
- pgcDst->funcs->CopyClip(pgcDst, pgcSrc);
- GCFUNC_WRAP(pgcDst);
-}
-
-
-// GC ops
-// We can't use shadowfb because shadowfb assumes one pixmap
-// and our root window is a special case.
-// So much of this code is copied from shadowfb.
-
-// assumes both funcs and ops are wrapped
-#define GCOP_UNWRAP(pGC) \
- RootlessGCRec *gcrec = (RootlessGCRec *) \
- (pGC)->devPrivates[rootlessGCPrivateIndex].ptr; \
- GCFuncs *saveFuncs = pGC->funcs; \
- (pGC)->funcs = gcrec->originalFuncs; \
- (pGC)->ops = gcrec->originalOps;
-
-#define GCOP_WRAP(pGC) \
- gcrec->originalOps = (pGC)->ops; \
- (pGC)->funcs = saveFuncs; \
- (pGC)->ops = &rootlessGCOps;
-
-
-static void
-RootlessFillSpans(DrawablePtr dst, GCPtr pGC, int nInit,
- DDXPointPtr pptInit, int *pwidthInit, int sorted)
-{
- GCOP_UNWRAP(pGC);
- RL_DEBUG_MSG("fill spans start ");
-
- if (nInit <= 0) {
- pGC->ops->FillSpans(dst, pGC, nInit, pptInit, pwidthInit, sorted);
- } else {
- DDXPointPtr ppt = pptInit;
- int *pwidth = pwidthInit;
- int i = nInit;
- BoxRec box;
-
- box.x1 = ppt->x;
- box.x2 = box.x1 + *pwidth;
- box.y2 = box.y1 = ppt->y;
-
- while(--i) {
- ppt++;
- pwidthInit++;
- if(box.x1 > ppt->x)
- box.x1 = ppt->x;
- if(box.x2 < (ppt->x + *pwidth))
- box.x2 = ppt->x + *pwidth;
- if(box.y1 > ppt->y)
- box.y1 = ppt->y;
- else if(box.y2 < ppt->y)
- box.y2 = ppt->y;
- }
-
- box.y2++;
-
- pGC->ops->FillSpans(dst, pGC, nInit, pptInit, pwidthInit, sorted);
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("fill spans end\n");
-}
-
-static void
-RootlessSetSpans(DrawablePtr dst, GCPtr pGC, char *pSrc,
- DDXPointPtr pptInit, int *pwidthInit,
- int nspans, int sorted)
-{
- GCOP_UNWRAP(pGC);
- RL_DEBUG_MSG("set spans start ");
-
- if (nspans <= 0) {
- pGC->ops->SetSpans(dst, pGC, pSrc, pptInit, pwidthInit,
- nspans, sorted);
- } else {
- DDXPointPtr ppt = pptInit;
- int *pwidth = pwidthInit;
- int i = nspans;
- BoxRec box;
-
- box.x1 = ppt->x;
- box.x2 = box.x1 + *pwidth;
- box.y2 = box.y1 = ppt->y;
-
- while(--i) {
- ppt++;
- pwidth++;
- if(box.x1 > ppt->x)
- box.x1 = ppt->x;
- if(box.x2 < (ppt->x + *pwidth))
- box.x2 = ppt->x + *pwidth;
- if(box.y1 > ppt->y)
- box.y1 = ppt->y;
- else if(box.y2 < ppt->y)
- box.y2 = ppt->y;
- }
-
- box.y2++;
-
- pGC->ops->SetSpans(dst, pGC, pSrc, pptInit, pwidthInit,
- nspans, sorted);
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("set spans end\n");
-}
-
-static void
-RootlessPutImage(DrawablePtr dst, GCPtr pGC,
- int depth, int x, int y, int w, int h,
- int leftPad, int format, char *pBits)
-{
- BoxRec box;
-
- GCOP_UNWRAP(pGC);
- RL_DEBUG_MSG("put image start ");
-
- pGC->ops->PutImage(dst, pGC, depth, x,y,w,h, leftPad, format, pBits);
-
- box.x1 = x + dst->x;
- box.x2 = box.x1 + w;
- box.y1 = y + dst->y;
- box.y2 = box.y1 + h;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("put image end\n");
-}
-
-/* changed area is *dest* rect */
-/* If this code ever goes back go StartDrawing/StopDrawing:
- * start and stop dst always
- * start and stop src if src->type is DRAWABLE_WINDOW and src is framed
- */
-static RegionPtr
-RootlessCopyArea(DrawablePtr pSrc, DrawablePtr dst, GCPtr pGC,
- int srcx, int srcy, int w, int h,
- int dstx, int dsty)
-{
- RegionPtr result;
- BoxRec box;
-
- GCOP_UNWRAP(pGC);
- RL_DEBUG_MSG("copy area start (src 0x%x, dst 0x%x)", pSrc, dst);
-
- result = pGC->ops->CopyArea(pSrc, dst, pGC, srcx, srcy, w, h, dstx, dsty);
-
- box.x1 = dstx + dst->x;
- box.x2 = box.x1 + w;
- box.y1 = dsty + dst->y;
- box.y2 = box.y1 + h;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("copy area end\n");
- return result;
-}
-
-/* changed area is *dest* rect */
-/* If this code ever goes back go StartDrawing/StopDrawing:
- * start and stop dst always
- * start and stop src if src->type is DRAWABLE_WINDOW and src is framed
- */
-static RegionPtr RootlessCopyPlane(DrawablePtr pSrc, DrawablePtr dst,
- GCPtr pGC, int srcx, int srcy,
- int w, int h, int dstx, int dsty,
- unsigned long plane)
-{
- RegionPtr result;
- BoxRec box;
-
- GCOP_UNWRAP(pGC);
- RL_DEBUG_MSG("copy plane start ");
-
- result = pGC->ops->CopyPlane(pSrc, dst, pGC, srcx, srcy, w, h,
- dstx, dsty, plane);
-
- box.x1 = dstx + dst->x;
- box.x2 = box.x1 + w;
- box.y1 = dsty + dst->y;
- box.y2 = box.y1 + h;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("copy plane end\n");
- return result;
-}
-
-// Options for size of changed area:
-// 0 = box per point
-// 1 = big box around all points
-// 2 = accumulate point in 20 pixel radius
-#define ROOTLESS_CHANGED_AREA 1
-#define abs(a) ((a) > 0 ? (a) : -(a))
-
-/* changed area is box around all points */
-static void RootlessPolyPoint(DrawablePtr dst, GCPtr pGC,
- int mode, int npt, DDXPointPtr pptInit)
-{
- GCOP_UNWRAP(pGC);
-
- RL_DEBUG_MSG("polypoint start ");
-
- pGC->ops->PolyPoint(dst, pGC, mode, npt, pptInit);
-
- if (npt > 0) {
-#if ROOTLESS_CHANGED_AREA==0
- // box per point
- BoxRec box;
-
- while (npt) {
- box.x1 = pptInit->x;
- box.y1 = pptInit->y;
- box.x2 = box.x1 + 1;
- box.y2 = box.y1 + 1;
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
- npt--;
- pptInit++;
- }
-
-#elif ROOTLESS_CHANGED_AREA==1
- // one big box
- BoxRec box;
-
- box.x2 = box.x1 = pptInit->x;
- box.y2 = box.y1 = pptInit->y;
- while(--npt) {
- pptInit++;
- if(box.x1 > pptInit->x)
- box.x1 = pptInit->x;
- else if(box.x2 < pptInit->x)
- box.x2 = pptInit->x;
- if(box.y1 > pptInit->y)
- box.y1 = pptInit->y;
- else if(box.y2 < pptInit->y)
- box.y2 = pptInit->y;
- }
-
- box.x2++;
- box.y2++;
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
-#elif ROOTLESS_CHANGED_AREA==2
- // clever(?) method: accumulate point in 20-pixel radius
- BoxRec box;
- int firstx, firsty;
-
- box.x2 = box.x1 = firstx = pptInit->x;
- box.y2 = box.y1 = firsty = pptInit->y;
- while(--npt) {
- pptInit++;
- if (abs(pptInit->x - firstx) > 20 ||
- abs(pptInit->y - firsty) > 20) {
- box.x2++;
- box.y2++;
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- box.x2 = box.x1 = firstx = pptInit->x;
- box.y2 = box.y1 = firsty = pptInit->y;
- } else {
- if (box.x1 > pptInit->x) box.x1 = pptInit->x;
- else if (box.x2 < pptInit->x) box.x2 = pptInit->x;
- if (box.y1 > pptInit->y) box.y1 = pptInit->y;
- else if (box.y2 < pptInit->y) box.y2 = pptInit->y;
- }
- }
- box.x2++;
- box.y2++;
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-#endif /* ROOTLESS_CHANGED_AREA */
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("polypoint end\n");
-}
-
-#undef ROOTLESS_CHANGED_AREA
-
-/* changed area is box around each line */
-static void RootlessPolylines(DrawablePtr dst, GCPtr pGC,
- int mode, int npt, DDXPointPtr pptInit)
-{
- GCOP_UNWRAP(pGC);
-
- RL_DEBUG_MSG("poly lines start ");
-
- pGC->ops->Polylines(dst, pGC, mode, npt, pptInit);
-
- if (npt > 0) {
- BoxRec box;
- int extra = pGC->lineWidth >> 1;
-
- box.x2 = box.x1 = pptInit->x;
- box.y2 = box.y1 = pptInit->y;
-
- if(npt > 1) {
- if(pGC->joinStyle == JoinMiter)
- extra = 6 * pGC->lineWidth;
- else if(pGC->capStyle == CapProjecting)
- extra = pGC->lineWidth;
- }
-
- if(mode == CoordModePrevious) {
- int x = box.x1;
- int y = box.y1;
-
- while(--npt) {
- pptInit++;
- x += pptInit->x;
- y += pptInit->y;
- if(box.x1 > x)
- box.x1 = x;
- else if(box.x2 < x)
- box.x2 = x;
- if(box.y1 > y)
- box.y1 = y;
- else if(box.y2 < y)
- box.y2 = y;
- }
- } else {
- while(--npt) {
- pptInit++;
- if(box.x1 > pptInit->x)
- box.x1 = pptInit->x;
- else if(box.x2 < pptInit->x)
- box.x2 = pptInit->x;
- if(box.y1 > pptInit->y)
- box.y1 = pptInit->y;
- else if(box.y2 < pptInit->y)
- box.y2 = pptInit->y;
- }
- }
-
- box.x2++;
- box.y2++;
-
- if(extra) {
- box.x1 -= extra;
- box.x2 += extra;
- box.y1 -= extra;
- box.y2 += extra;
- }
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("poly lines end\n");
-}
-
-/* changed area is box around each line segment */
-static void RootlessPolySegment(DrawablePtr dst, GCPtr pGC,
- int nseg, xSegment *pSeg)
-{
- GCOP_UNWRAP(pGC);
-
- RL_DEBUG_MSG("poly segment start (win 0x%x)", dst);
-
- pGC->ops->PolySegment(dst, pGC, nseg, pSeg);
-
- if (nseg > 0) {
- BoxRec box;
- int extra = pGC->lineWidth;
-
- if(pGC->capStyle != CapProjecting)
- extra >>= 1;
-
- if(pSeg->x2 > pSeg->x1) {
- box.x1 = pSeg->x1;
- box.x2 = pSeg->x2;
- } else {
- box.x2 = pSeg->x1;
- box.x1 = pSeg->x2;
- }
-
- if(pSeg->y2 > pSeg->y1) {
- box.y1 = pSeg->y1;
- box.y2 = pSeg->y2;
- } else {
- box.y2 = pSeg->y1;
- box.y1 = pSeg->y2;
- }
-
- while(--nseg) {
- pSeg++;
- if(pSeg->x2 > pSeg->x1) {
- if(pSeg->x1 < box.x1) box.x1 = pSeg->x1;
- if(pSeg->x2 > box.x2) box.x2 = pSeg->x2;
- } else {
- if(pSeg->x2 < box.x1) box.x1 = pSeg->x2;
- if(pSeg->x1 > box.x2) box.x2 = pSeg->x1;
- }
- if(pSeg->y2 > pSeg->y1) {
- if(pSeg->y1 < box.y1) box.y1 = pSeg->y1;
- if(pSeg->y2 > box.y2) box.y2 = pSeg->y2;
- } else {
- if(pSeg->y2 < box.y1) box.y1 = pSeg->y2;
- if(pSeg->y1 > box.y2) box.y2 = pSeg->y1;
- }
- }
-
- box.x2++;
- box.y2++;
-
- if(extra) {
- box.x1 -= extra;
- box.x2 += extra;
- box.y1 -= extra;
- box.y2 += extra;
- }
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("poly segment end\n");
-}
-
-/* changed area is box around each line (not entire rects) */
-static void RootlessPolyRectangle(DrawablePtr dst, GCPtr pGC,
- int nRects, xRectangle *pRects)
-{
- GCOP_UNWRAP(pGC);
-
- RL_DEBUG_MSG("poly rectangle start ");
-
- pGC->ops->PolyRectangle(dst, pGC, nRects, pRects);
-
- if (nRects > 0) {
- BoxRec box;
- int offset1, offset2, offset3;
-
- offset2 = pGC->lineWidth;
- if(!offset2) offset2 = 1;
- offset1 = offset2 >> 1;
- offset3 = offset2 - offset1;
-
- while(nRects--) {
- box.x1 = pRects->x - offset1;
- box.y1 = pRects->y - offset1;
- box.x2 = box.x1 + pRects->width + offset2;
- box.y2 = box.y1 + offset2;
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
- box.x1 = pRects->x - offset1;
- box.y1 = pRects->y + offset3;
- box.x2 = box.x1 + offset2;
- box.y2 = box.y1 + pRects->height - offset2;
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
- box.x1 = pRects->x + pRects->width - offset1;
- box.y1 = pRects->y + offset3;
- box.x2 = box.x1 + offset2;
- box.y2 = box.y1 + pRects->height - offset2;
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
- box.x1 = pRects->x - offset1;
- box.y1 = pRects->y + pRects->height - offset1;
- box.x2 = box.x1 + pRects->width + offset2;
- box.y2 = box.y1 + offset2;
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
- pRects++;
- }
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("poly rectangle end\n");
-}
-
-
-/* changed area is box around each arc (assumes all arcs are 360 degrees) */
-static void RootlessPolyArc(DrawablePtr dst, GCPtr pGC, int narcs, xArc *parcs)
-{
- GCOP_UNWRAP(pGC);
-
- RL_DEBUG_MSG("poly arc start ");
-
- pGC->ops->PolyArc(dst, pGC, narcs, parcs);
-
- if (narcs > 0) {
- int extra = pGC->lineWidth >> 1;
- BoxRec box;
-
- box.x1 = parcs->x;
- box.x2 = box.x1 + parcs->width;
- box.y1 = parcs->y;
- box.y2 = box.y1 + parcs->height;
-
- /* should I break these up instead ? */
-
- while(--narcs) {
- parcs++;
- if(box.x1 > parcs->x)
- box.x1 = parcs->x;
- if(box.x2 < (parcs->x + parcs->width))
- box.x2 = parcs->x + parcs->width;
- if(box.y1 > parcs->y)
- box.y1 = parcs->y;
- if(box.y2 < (parcs->y + parcs->height))
- box.y2 = parcs->y + parcs->height;
- }
-
- if(extra) {
- box.x1 -= extra;
- box.x2 += extra;
- box.y1 -= extra;
- box.y2 += extra;
- }
-
- box.x2++;
- box.y2++;
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("poly arc end\n");
-}
-
-
-/* changed area is box around each poly */
-static void RootlessFillPolygon(DrawablePtr dst, GCPtr pGC,
- int shape, int mode, int count,
- DDXPointPtr pptInit)
-{
- GCOP_UNWRAP(pGC);
-
- RL_DEBUG_MSG("fill poly start ");
-
- if (count <= 2) {
- pGC->ops->FillPolygon(dst, pGC, shape, mode, count, pptInit);
- } else {
- DDXPointPtr ppt = pptInit;
- int i = count;
- BoxRec box;
-
- box.x2 = box.x1 = ppt->x;
- box.y2 = box.y1 = ppt->y;
-
- if(mode != CoordModeOrigin) {
- int x = box.x1;
- int y = box.y1;
-
- while(--i) {
- ppt++;
- x += ppt->x;
- y += ppt->y;
- if(box.x1 > x)
- box.x1 = x;
- else if(box.x2 < x)
- box.x2 = x;
- if(box.y1 > y)
- box.y1 = y;
- else if(box.y2 < y)
- box.y2 = y;
- }
- } else {
- while(--i) {
- ppt++;
- if(box.x1 > ppt->x)
- box.x1 = ppt->x;
- else if(box.x2 < ppt->x)
- box.x2 = ppt->x;
- if(box.y1 > ppt->y)
- box.y1 = ppt->y;
- else if(box.y2 < ppt->y)
- box.y2 = ppt->y;
- }
- }
-
- box.x2++;
- box.y2++;
-
- pGC->ops->FillPolygon(dst, pGC, shape, mode, count, pptInit);
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("fill poly end\n");
-}
-
-/* changed area is the rects */
-static void RootlessPolyFillRect(DrawablePtr dst, GCPtr pGC,
- int nRectsInit, xRectangle *pRectsInit)
-{
- GCOP_UNWRAP(pGC);
-
- RL_DEBUG_MSG("fill rect start (win 0x%x)", dst);
-
- if (nRectsInit <= 0) {
- pGC->ops->PolyFillRect(dst, pGC, nRectsInit, pRectsInit);
- } else {
- BoxRec box;
- xRectangle *pRects = pRectsInit;
- int nRects = nRectsInit;
-
- box.x1 = pRects->x;
- box.x2 = box.x1 + pRects->width;
- box.y1 = pRects->y;
- box.y2 = box.y1 + pRects->height;
-
- while(--nRects) {
- pRects++;
- if(box.x1 > pRects->x)
- box.x1 = pRects->x;
- if(box.x2 < (pRects->x + pRects->width))
- box.x2 = pRects->x + pRects->width;
- if(box.y1 > pRects->y)
- box.y1 = pRects->y;
- if(box.y2 < (pRects->y + pRects->height))
- box.y2 = pRects->y + pRects->height;
- }
-
- /* cfb messes with the pRectsInit so we have to do our
- calculations first */
-
- pGC->ops->PolyFillRect(dst, pGC, nRectsInit, pRectsInit);
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("fill rect end\n");
-}
-
-
-/* changed area is box around each arc (assuming arcs are all 360 degrees) */
-static void RootlessPolyFillArc(DrawablePtr dst, GCPtr pGC,
- int narcs, xArc *parcs)
-{
- GCOP_UNWRAP(pGC);
-
- RL_DEBUG_MSG("fill arc start ");
-
- pGC->ops->PolyFillArc(dst, pGC, narcs, parcs);
-
- if (narcs > 0) {
- BoxRec box;
-
- box.x1 = parcs->x;
- box.x2 = box.x1 + parcs->width;
- box.y1 = parcs->y;
- box.y2 = box.y1 + parcs->height;
-
- /* should I break these up instead ? */
-
- while(--narcs) {
- parcs++;
- if(box.x1 > parcs->x)
- box.x1 = parcs->x;
- if(box.x2 < (parcs->x + parcs->width))
- box.x2 = parcs->x + parcs->width;
- if(box.y1 > parcs->y)
- box.y1 = parcs->y;
- if(box.y2 < (parcs->y + parcs->height))
- box.y2 = parcs->y + parcs->height;
- }
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("fill arc end");
-}
-
-
-static void RootlessImageText8(DrawablePtr dst, GCPtr pGC,
- int x, int y, int count, char *chars)
-{
- GCOP_UNWRAP(pGC);
- RL_DEBUG_MSG("imagetext8 start ");
-
- pGC->ops->ImageText8(dst, pGC, x, y, count, chars);
-
- if (count > 0) {
- int top, bot, Min, Max;
- BoxRec box;
-
- top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font));
- bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font));
-
- Min = count * FONTMINBOUNDS(pGC->font, characterWidth);
- if(Min > 0) Min = 0;
- Max = count * FONTMAXBOUNDS(pGC->font, characterWidth);
- if(Max < 0) Max = 0;
-
- /* ugh */
- box.x1 = dst->x + x + Min +
- FONTMINBOUNDS(pGC->font, leftSideBearing);
- box.x2 = dst->x + x + Max +
- FONTMAXBOUNDS(pGC->font, rightSideBearing);
-
- box.y1 = dst->y + y - top;
- box.y2 = dst->y + y + bot;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("imagetext8 end\n");
-}
-
-static int RootlessPolyText8(DrawablePtr dst, GCPtr pGC,
- int x, int y, int count, char *chars)
-{
- int width; // the result, sorta
-
- GCOP_UNWRAP(pGC);
- RL_DEBUG_MSG("polytext8 start ");
-
- width = pGC->ops->PolyText8(dst, pGC, x, y, count, chars);
- width -= x;
-
- if(width > 0) {
- BoxRec box;
-
- /* ugh */
- box.x1 = dst->x + x + FONTMINBOUNDS(pGC->font, leftSideBearing);
- box.x2 = dst->x + x + FONTMAXBOUNDS(pGC->font, rightSideBearing);
-
- if(count > 1) {
- if(width > 0) box.x2 += width;
- else box.x1 += width;
- }
-
- box.y1 = dst->y + y - FONTMAXBOUNDS(pGC->font, ascent);
- box.y2 = dst->y + y + FONTMAXBOUNDS(pGC->font, descent);
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("polytext8 end\n");
- return (width + x);
-}
-
-static void RootlessImageText16(DrawablePtr dst, GCPtr pGC,
- int x, int y, int count, unsigned short *chars)
-{
- GCOP_UNWRAP(pGC);
- RL_DEBUG_MSG("imagetext16 start ");
-
- pGC->ops->ImageText16(dst, pGC, x, y, count, chars);
-
- if (count > 0) {
- int top, bot, Min, Max;
- BoxRec box;
-
- top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font));
- bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font));
-
- Min = count * FONTMINBOUNDS(pGC->font, characterWidth);
- if(Min > 0) Min = 0;
- Max = count * FONTMAXBOUNDS(pGC->font, characterWidth);
- if(Max < 0) Max = 0;
-
- /* ugh */
- box.x1 = dst->x + x + Min +
- FONTMINBOUNDS(pGC->font, leftSideBearing);
- box.x2 = dst->x + x + Max +
- FONTMAXBOUNDS(pGC->font, rightSideBearing);
-
- box.y1 = dst->y + y - top;
- box.y2 = dst->y + y + bot;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("imagetext16 end\n");
-}
-
-static int RootlessPolyText16(DrawablePtr dst, GCPtr pGC,
- int x, int y, int count, unsigned short *chars)
-{
- int width; // the result, sorta
-
- GCOP_UNWRAP(pGC);
- RL_DEBUG_MSG("polytext16 start ");
-
- width = pGC->ops->PolyText16(dst, pGC, x, y, count, chars);
- width -= x;
-
- if (width > 0) {
- BoxRec box;
-
- /* ugh */
- box.x1 = dst->x + x + FONTMINBOUNDS(pGC->font, leftSideBearing);
- box.x2 = dst->x + x + FONTMAXBOUNDS(pGC->font, rightSideBearing);
-
- if(count > 1) {
- if(width > 0) box.x2 += width;
- else box.x1 += width;
- }
-
- box.y1 = dst->y + y - FONTMAXBOUNDS(pGC->font, ascent);
- box.y2 = dst->y + y + FONTMAXBOUNDS(pGC->font, descent);
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("polytext16 end\n");
- return width + x;
-}
-
-static void RootlessImageGlyphBlt(DrawablePtr dst, GCPtr pGC,
- int x, int y, unsigned int nglyph,
- CharInfoPtr *ppci, pointer unused)
-{
- GCOP_UNWRAP(pGC);
- RL_DEBUG_MSG("imageglyph start ");
-
- pGC->ops->ImageGlyphBlt(dst, pGC, x, y, nglyph, ppci, unused);
-
- if (nglyph > 0) {
- int top, bot, width = 0;
- BoxRec box;
-
- top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font));
- bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font));
-
- box.x1 = ppci[0]->metrics.leftSideBearing;
- if(box.x1 > 0) box.x1 = 0;
- box.x2 = ppci[nglyph - 1]->metrics.rightSideBearing -
- ppci[nglyph - 1]->metrics.characterWidth;
- if(box.x2 < 0) box.x2 = 0;
-
- box.x2 += dst->x + x;
- box.x1 += dst->x + x;
-
- while(nglyph--) {
- width += (*ppci)->metrics.characterWidth;
- ppci++;
- }
-
- if(width > 0)
- box.x2 += width;
- else
- box.x1 += width;
-
- box.y1 = dst->y + y - top;
- box.y2 = dst->y + y + bot;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("imageglyph end\n");
-}
-
-static void RootlessPolyGlyphBlt(DrawablePtr dst, GCPtr pGC,
- int x, int y, unsigned int nglyph,
- CharInfoPtr *ppci, pointer pglyphBase)
-{
- GCOP_UNWRAP(pGC);
- RL_DEBUG_MSG("polyglyph start ");
-
- pGC->ops->PolyGlyphBlt(dst, pGC, x, y, nglyph, ppci, pglyphBase);
-
- if (nglyph > 0) {
- BoxRec box;
-
- /* ugh */
- box.x1 = dst->x + x + ppci[0]->metrics.leftSideBearing;
- box.x2 = dst->x + x + ppci[nglyph - 1]->metrics.rightSideBearing;
-
- if(nglyph > 1) {
- int width = 0;
-
- while(--nglyph) {
- width += (*ppci)->metrics.characterWidth;
- ppci++;
- }
-
- if(width > 0) box.x2 += width;
- else box.x1 += width;
- }
-
- box.y1 = dst->y + y - FONTMAXBOUNDS(pGC->font, ascent);
- box.y2 = dst->y + y + FONTMAXBOUNDS(pGC->font, descent);
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("polyglyph end\n");
-}
-
-
-/* changed area is in dest */
-static void
-RootlessPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr dst,
- int dx, int dy, int xOrg, int yOrg)
-{
- BoxRec box;
- GCOP_UNWRAP(pGC);
-
- pGC->ops->PushPixels(pGC, pBitMap, dst, dx, dy, xOrg, yOrg);
-
- box.x1 = xOrg + dst->x;
- box.x2 = box.x1 + dx;
- box.y1 = yOrg + dst->y;
- box.y2 = box.y1 + dy;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("push pixels end\n");
-}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/rootlessScreen.c b/xc/programs/Xserver/hw/darwin/bundle/rootlessScreen.c
deleted file mode 100644
index 0c6b44696..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/rootlessScreen.c
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
- * Screen routines for Mac OS X rootless X server
- *
- * Greg Parker gparker@cs.stanford.edu
- *
- * February 2001 Created
- * March 3, 2001 Restructured as generic rootless mode
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/rootlessScreen.c,v 1.5 2001/12/22 05:28:35 torrey Exp $ */
-
-
-#include "mi.h"
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "propertyst.h"
-#include "mivalidate.h"
-#include "picturestr.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include "rootlessCommon.h"
-#include "rootlessWindow.h"
-
-extern int
-rootlessMiValidateTree(WindowPtr pRoot, WindowPtr pChild, VTKind kind);
-extern Bool
-RootlessCreateGC(GCPtr pGC);
-
-// Initialize globals
-int rootlessGCPrivateIndex = -1;
-int rootlessScreenPrivateIndex = -1;
-int rootlessWindowPrivateIndex = -1;
-
-
-static Bool
-RootlessCloseScreen(int i, ScreenPtr pScreen)
-{
- RootlessScreenRec *s;
-
- s = SCREENREC(pScreen);
-
- // fixme unwrap everything that was wrapped?
- pScreen->CloseScreen = s->CloseScreen;
-
- xfree(s);
- return pScreen->CloseScreen(i, pScreen);
-}
-
-
-static void
-RootlessGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
- unsigned int format, unsigned long planeMask, char *pdstLine)
-{
- ScreenPtr pScreen = pDrawable->pScreen;
- SCREEN_UNWRAP(pScreen, GetImage);
-
- if (pDrawable->type == DRAWABLE_WINDOW) {
- /* Many apps use GetImage to sync with the visible frame buffer */
- // fixme entire screen or just window or all screens?
- RootlessRedisplayScreen(pScreen);
- }
-
- pScreen->GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
-
- SCREEN_WRAP(pScreen, GetImage);
-}
-
-
-#ifdef RENDER
-
-static void
-RootlessComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
- INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask,
- INT16 xDst, INT16 yDst, CARD16 width, CARD16 height)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- WindowPtr dstWin;
-
- dstWin = (pDst->pDrawable->type == DRAWABLE_WINDOW) ?
- (WindowPtr)pDst->pDrawable : NULL;
-
- // SCREEN_UNWRAP(ps, Composite);
- ps->Composite = SCREENREC(pScreen)->Composite;
-
- ps->Composite(op, pSrc, pMask, pDst,
- xSrc, ySrc, xMask, yMask,
- xDst, yDst, width, height);
-
- if (dstWin && IsFramedWindow(dstWin)) {
- RootlessDamageRect(dstWin, xDst, yDst, width, height);
- }
-
- ps->Composite = RootlessComposite;
- // SCREEN_WRAP(ps, Composite);
-}
-
-
-static void
-RootlessGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
- PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
- int nlist, GlyphListPtr list, GlyphPtr *glyphs)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- int x, y;
- int n;
- GlyphPtr glyph;
- WindowPtr dstWin;
-
- dstWin = (pDst->pDrawable->type == DRAWABLE_WINDOW) ?
- (WindowPtr)pDst->pDrawable : NULL;
-
- //SCREEN_UNWRAP(ps, Glyphs);
- ps->Glyphs = SCREENREC(pScreen)->Glyphs;
- ps->Glyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
- ps->Glyphs = RootlessGlyphs;
- //SCREEN_WRAP(ps, Glyphs);
-
- if (dstWin && IsFramedWindow(dstWin)) {
- x = xSrc;
- y = ySrc;
- while (nlist--) {
- x += list->xOff;
- y += list->yOff;
- n = list->len;
- while (n--) {
- glyph = *glyphs++;
- RootlessDamageRect(dstWin,
- x - glyph->info.x, y - glyph->info.y,
- glyph->info.width, glyph->info.height);
- x += glyph->info.xOff;
- y += glyph->info.yOff;
- }
- list++;
- }
- }
-}
-
-#endif // RENDER
-
-
-// RootlessValidateTree
-// ValidateTree is modified in two ways:
-// * top-level windows don't clip each other
-// * windows aren't clipped against root.
-// These only matter when validating from the root.
-static int
-RootlessValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
-{
- int result;
- RegionRec saveRoot;
- ScreenPtr pScreen = pParent->drawable.pScreen;
-
- SCREEN_UNWRAP(pScreen, ValidateTree);
- RL_DEBUG_MSG("VALIDATETREE start ");
-
- // Use our custom version to validate from root
- if (IsRoot(pParent)) {
- RL_DEBUG_MSG("custom ");
- result = rootlessMiValidateTree(pParent, pChild, kind);
- } else {
- HUGE_ROOT(pParent);
- result = pScreen->ValidateTree(pParent, pChild, kind);
- NORMAL_ROOT(pParent);
- }
-
- SCREEN_WRAP(pScreen, ValidateTree);
- RL_DEBUG_MSG("VALIDATETREE end\n");
-
- return result;
-}
-
-
-// RootlessMarkOverlappedWindows
-// MarkOverlappedWindows is modified to ignore overlapping
-// top-level windows.
-static Bool
-RootlessMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst,
- WindowPtr *ppLayerWin)
-{
- RegionRec saveRoot;
- Bool result;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- SCREEN_UNWRAP(pScreen, MarkOverlappedWindows);
- RL_DEBUG_MSG("MARKOVERLAPPEDWINDOWS start ");
-
- HUGE_ROOT(pWin);
- if (IsRoot(pWin)) {
- // root - mark nothing
- RL_DEBUG_MSG("is root not marking ");
- result = FALSE;
- }
- else if (! IsTopLevel(pWin)) {
- // not top-level window - mark normally
- result = pScreen->MarkOverlappedWindows(pWin, pFirst, ppLayerWin);
- }
- else {
- //top-level window - mark children ONLY - NO overlaps with sibs (?)
- // This code copied from miMarkOverlappedWindows()
-
- register WindowPtr pChild;
- Bool anyMarked = FALSE;
- void (* MarkWindow)() = pScreen->MarkWindow;
-
- RL_DEBUG_MSG("is top level! ");
- /* single layered systems are easy */
- if (ppLayerWin) *ppLayerWin = pWin;
-
- if (pWin == pFirst) {
- /* Blindly mark pWin and all of its inferiors. This is a slight
- * overkill if there are mapped windows that outside pWin's border,
- * but it's better than wasting time on RectIn checks.
- */
- pChild = pWin;
- while (1) {
- if (pChild->viewable) {
- if (REGION_BROKEN (pScreen, &pChild->winSize))
- SetWinSize (pChild);
- if (REGION_BROKEN (pScreen, &pChild->borderSize))
- SetBorderSize (pChild);
- (* MarkWindow)(pChild);
- if (pChild->firstChild) {
- pChild = pChild->firstChild;
- continue;
- }
- }
- while (!pChild->nextSib && (pChild != pWin))
- pChild = pChild->parent;
- if (pChild == pWin)
- break;
- pChild = pChild->nextSib;
- }
- anyMarked = TRUE;
- pFirst = pFirst->nextSib;
- }
- if (anyMarked)
- (* MarkWindow)(pWin->parent);
- result = anyMarked;
- }
- NORMAL_ROOT(pWin);
- SCREEN_WRAP(pScreen, MarkOverlappedWindows);
- RL_DEBUG_MSG("MARKOVERLAPPEDWINDOWS end\n");
- return result;
-}
-
-
-static void
-RootlessPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what)
-{
- int oldBackgroundState = 0;
- PixUnion oldBackground;
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- SCREEN_UNWRAP(pScreen, PaintWindowBackground);
- RL_DEBUG_MSG("paintwindowbackground start (win 0x%x) ", pWin);
- if (IsFramedWindow(pWin)) {
- if (IsRoot(pWin)) {
- // set root background to magic transparent color
- oldBackgroundState = pWin->backgroundState;
- oldBackground = pWin->background;
- pWin->backgroundState = BackgroundPixel;
- pWin->background.pixel = 0x00fffffe;
- }
- }
-
- pScreen->PaintWindowBackground(pWin, pRegion, what);
-
- if (IsFramedWindow(pWin)) {
- RootlessDamageRegion(pWin, pRegion);
- if (IsRoot(pWin)) {
- pWin->backgroundState = oldBackgroundState;
- pWin->background = oldBackground;
- }
- }
- SCREEN_WRAP(pScreen, PaintWindowBackground);
- RL_DEBUG_MSG("paintwindowbackground end\n");
-}
-
-
-static void
-RootlessPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what)
-{
- SCREEN_UNWRAP(pWin->drawable.pScreen, PaintWindowBorder);
- RL_DEBUG_MSG("paintwindowborder start (win 0x%x) ", pWin);
- pWin->drawable.pScreen->PaintWindowBorder(pWin, pRegion, what);
- if (IsFramedWindow(pWin)) {
- RootlessDamageRegion(pWin, pRegion);
- }
- SCREEN_WRAP(pWin->drawable.pScreen, PaintWindowBorder);
- RL_DEBUG_MSG("paintwindowborder end\n");
-}
-
-
-// Flush drawing before blocking on select().
-static void
-RootlessBlockHandler(pointer pbdata, OSTimePtr pTimeout, pointer pReadmask)
-{
- RootlessRedisplayScreen((ScreenPtr) pbdata);
-}
-
-
-static void
-RootlessWakeupHandler(pointer data, int i, pointer LastSelectMask)
-{
- // nothing here
-}
-
-
-static Bool
-RootlessAllocatePrivates(ScreenPtr pScreen)
-{
- RootlessScreenRec *s;
- static int rootlessGeneration = -1;
-
- if (rootlessGeneration != serverGeneration) {
- rootlessScreenPrivateIndex = AllocateScreenPrivateIndex();
- if (rootlessScreenPrivateIndex == -1) return FALSE;
- rootlessGCPrivateIndex = AllocateGCPrivateIndex();
- if (rootlessGCPrivateIndex == -1) return FALSE;
- rootlessWindowPrivateIndex = AllocateWindowPrivateIndex();
- if (rootlessWindowPrivateIndex == -1) return FALSE;
- rootlessGeneration = serverGeneration;
- }
-
- // no allocation needed for screen privates
- if (!AllocateGCPrivate(pScreen, rootlessGCPrivateIndex,
- sizeof(RootlessGCRec)))
- return FALSE;
- if (!AllocateWindowPrivate(pScreen, rootlessWindowPrivateIndex, 0))
- return FALSE;
-
- s = xalloc(sizeof(RootlessScreenRec));
- if (! s) return FALSE;
- SCREENREC(pScreen) = s;
-
- return TRUE;
-}
-
-
-static void
-RootlessWrap(ScreenPtr pScreen)
-{
- RootlessScreenRec *s = (RootlessScreenRec*)
- pScreen->devPrivates[rootlessScreenPrivateIndex].ptr;
-
-#define WRAP(a) \
- if (pScreen->a) { \
- s->a = pScreen->a; \
- } else { \
- RL_DEBUG_MSG("null screen fn " #a "\n"); \
- s->a = NULL; \
- } \
- pScreen->a = Rootless##a
-
- WRAP(CloseScreen);
- WRAP(CreateGC);
- WRAP(PaintWindowBackground);
- WRAP(PaintWindowBorder);
- WRAP(CopyWindow);
- WRAP(GetImage);
- WRAP(CreateWindow);
- WRAP(DestroyWindow);
- WRAP(RealizeWindow);
- WRAP(UnrealizeWindow);
- WRAP(MoveWindow);
- WRAP(PositionWindow);
- WRAP(ResizeWindow);
- WRAP(RestackWindow);
- WRAP(ChangeBorderWidth);
- WRAP(MarkOverlappedWindows);
- WRAP(ValidateTree);
- WRAP(ChangeWindowAttributes);
-
-#ifdef SHAPE
- WRAP(SetShape);
-#endif
-
-#ifdef RENDER
- {
- // Composite and Glyphs don't use normal screen wrapping
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- s->Composite = ps->Composite;
- ps->Composite = RootlessComposite;
- s->Glyphs = ps->Glyphs;
- ps->Glyphs = RootlessGlyphs;
- }
-#endif
-
- // WRAP(ClearToBackground); fixme put this back? useful for shaped wins?
- // WRAP(RestoreAreas); fixme put this back?
-
-#undef WRAP
-}
-
-
-/*
- * RootlessInit
- * Rootless wraps lots of stuff and needs a bunch of devPrivates.
- */
-Bool RootlessInit(ScreenPtr pScreen, RootlessFrameProcs *procs)
-{
- RootlessScreenRec *s;
-
- if (! RootlessAllocatePrivates(pScreen)) return FALSE;
- s = (RootlessScreenRec*)
- pScreen->devPrivates[rootlessScreenPrivateIndex].ptr;
-
- s->pScreen = pScreen;
- s->frameProcs = *procs;
-
- RootlessWrap(pScreen);
-
- if (!RegisterBlockAndWakeupHandlers (RootlessBlockHandler,
- RootlessWakeupHandler,
- (pointer) pScreen))
- {
- return FALSE;
- }
-
- return TRUE;
-}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/rootlessValTree.c b/xc/programs/Xserver/hw/darwin/bundle/rootlessValTree.c
deleted file mode 100644
index a6d33b6f1..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/rootlessValTree.c
+++ /dev/null
@@ -1,744 +0,0 @@
-/*
- * Calculate window clip lists for rootless mode
- *
- * This file is very closely based on mivaltree.c.
- */
- /* $XFree86: xc/programs/Xserver/hw/darwin/bundle/rootlessValTree.c,v 1.1 2001/06/26 23:29:13 torrey Exp $ */
-
-/*
- * mivaltree.c --
- * Functions for recalculating window clip lists. Main function
- * is miValidateTree.
- *
-
-Copyright 1987, 1988, 1989, 1998 The Open Group
-
-All Rights Reserved.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
- *
- * Copyright 1987, 1988, 1989 by
- * Digital Equipment Corporation, Maynard, Massachusetts,
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- ******************************************************************/
-
-/* The panoramix components contained the following notice */
-/****************************************************************
-* *
-* Copyright (c) Digital Equipment Corporation, 1991, 1997 *
-* *
-* All Rights Reserved. Unpublished rights reserved under *
-* the copyright laws of the United States. *
-* *
-* The software contained on this media is proprietary to *
-* and embodies the confidential technology of Digital *
-* Equipment Corporation. Possession, use, duplication or *
-* dissemination of the software and media is authorized only *
-* pursuant to a valid written license from Digital Equipment *
-* Corporation. *
-* *
-* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *
-* by the U.S. Government is subject to restrictions as set *
-* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *
-* or in FAR 52.227-19, as applicable. *
-* *
-*****************************************************************/
-
- /*
- * Aug '86: Susan Angebranndt -- original code
- * July '87: Adam de Boor -- substantially modified and commented
- * Summer '89: Joel McCormack -- so fast you wouldn't believe it possible.
- * In particular, much improved code for window mapping and
- * circulating.
- * Bob Scheifler -- avoid miComputeClips for unmapped windows,
- * valdata changes
- */
-#include "X.h"
-#include "scrnintstr.h"
-#include "validate.h"
-#include "windowstr.h"
-#include "mi.h"
-#include "regionstr.h"
-#include "mivalidate.h"
-
-#include "globals.h"
-
-#ifdef SHAPE
-/*
- * Compute the visibility of a shaped window
- */
-int
-rootlessShapedWindowIn (pScreen, universe, bounding, rect, x, y)
- ScreenPtr pScreen;
- RegionPtr universe, bounding;
- BoxPtr rect;
- register int x, y;
-{
- BoxRec box;
- register BoxPtr boundBox;
- int nbox;
- Bool someIn, someOut;
- register int t, x1, y1, x2, y2;
-
- nbox = REGION_NUM_RECTS (bounding);
- boundBox = REGION_RECTS (bounding);
- someIn = someOut = FALSE;
- x1 = rect->x1;
- y1 = rect->y1;
- x2 = rect->x2;
- y2 = rect->y2;
- while (nbox--)
- {
- if ((t = boundBox->x1 + x) < x1)
- t = x1;
- box.x1 = t;
- if ((t = boundBox->y1 + y) < y1)
- t = y1;
- box.y1 = t;
- if ((t = boundBox->x2 + x) > x2)
- t = x2;
- box.x2 = t;
- if ((t = boundBox->y2 + y) > y2)
- t = y2;
- box.y2 = t;
- if (box.x1 > box.x2)
- box.x2 = box.x1;
- if (box.y1 > box.y2)
- box.y2 = box.y1;
- switch (RECT_IN_REGION(pScreen, universe, &box))
- {
- case rgnIN:
- if (someOut)
- return rgnPART;
- someIn = TRUE;
- break;
- case rgnOUT:
- if (someIn)
- return rgnPART;
- someOut = TRUE;
- break;
- default:
- return rgnPART;
- }
- boundBox++;
- }
- if (someIn)
- return rgnIN;
- return rgnOUT;
-}
-#endif
-
-#define HasParentRelativeBorder(w) (!(w)->borderIsPixel && \
- HasBorder(w) && \
- (w)->backgroundState == ParentRelative)
-
-
-/*
- *-----------------------------------------------------------------------
- * miComputeClips --
- * Recompute the clipList, borderClip, exposed and borderExposed
- * regions for pParent and its children. Only viewable windows are
- * taken into account.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * clipList, borderClip, exposed and borderExposed are altered.
- * A VisibilityNotify event may be generated on the parent window.
- *
- *-----------------------------------------------------------------------
- */
-static void
-rootlessComputeClips (pParent, pScreen, universe, kind, exposed)
- register WindowPtr pParent;
- register ScreenPtr pScreen;
- register RegionPtr universe;
- VTKind kind;
- RegionPtr exposed; /* for intermediate calculations */
-{
- int dx,
- dy;
- RegionRec childUniverse;
- register WindowPtr pChild;
- int oldVis, newVis;
- BoxRec borderSize;
- RegionRec childUnion;
- Bool overlap;
- RegionPtr borderVisible;
- Bool resized;
- /*
- * Figure out the new visibility of this window.
- * The extent of the universe should be the same as the extent of
- * the borderSize region. If the window is unobscured, this rectangle
- * will be completely inside the universe (the universe will cover it
- * completely). If the window is completely obscured, none of the
- * universe will cover the rectangle.
- */
- borderSize.x1 = pParent->drawable.x - wBorderWidth(pParent);
- borderSize.y1 = pParent->drawable.y - wBorderWidth(pParent);
- dx = (int) pParent->drawable.x + (int) pParent->drawable.width + wBorderWidth(pParent);
- if (dx > 32767)
- dx = 32767;
- borderSize.x2 = dx;
- dy = (int) pParent->drawable.y + (int) pParent->drawable.height + wBorderWidth(pParent);
- if (dy > 32767)
- dy = 32767;
- borderSize.y2 = dy;
-
- oldVis = pParent->visibility;
- switch (RECT_IN_REGION( pScreen, universe, &borderSize))
- {
- case rgnIN:
- newVis = VisibilityUnobscured;
- break;
- case rgnPART:
- newVis = VisibilityPartiallyObscured;
-#ifdef SHAPE
- {
- RegionPtr pBounding;
-
- if ((pBounding = wBoundingShape (pParent)))
- {
- switch (rootlessShapedWindowIn (pScreen, universe,
- pBounding, &borderSize,
- pParent->drawable.x,
- pParent->drawable.y))
- {
- case rgnIN:
- newVis = VisibilityUnobscured;
- break;
- case rgnOUT:
- newVis = VisibilityFullyObscured;
- break;
- }
- }
- }
-#endif
- break;
- default:
- newVis = VisibilityFullyObscured;
- break;
- }
-
- pParent->visibility = newVis;
- if (oldVis != newVis &&
- ((pParent->eventMask | wOtherEventMasks(pParent)) & VisibilityChangeMask))
- SendVisibilityNotify(pParent);
-
- dx = pParent->drawable.x - pParent->valdata->before.oldAbsCorner.x;
- dy = pParent->drawable.y - pParent->valdata->before.oldAbsCorner.y;
-
- /*
- * avoid computations when dealing with simple operations
- */
-
- switch (kind) {
- case VTMap:
- case VTStack:
- case VTUnmap:
- break;
- case VTMove:
- if ((oldVis == newVis) &&
- ((oldVis == VisibilityFullyObscured) ||
- (oldVis == VisibilityUnobscured)))
- {
- pChild = pParent;
- while (1)
- {
- if (pChild->viewable)
- {
- if (pChild->visibility != VisibilityFullyObscured)
- {
- REGION_TRANSLATE( pScreen, &pChild->borderClip,
- dx, dy);
- REGION_TRANSLATE( pScreen, &pChild->clipList,
- dx, dy);
- pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- if (pScreen->ClipNotify)
- (* pScreen->ClipNotify) (pChild, dx, dy);
-
- }
- if (pChild->valdata)
- {
- REGION_INIT(pScreen,
- &pChild->valdata->after.borderExposed,
- NullBox, 0);
- if (HasParentRelativeBorder(pChild))
- {
- REGION_SUBTRACT(pScreen,
- &pChild->valdata->after.borderExposed,
- &pChild->borderClip,
- &pChild->winSize);
- }
- REGION_INIT( pScreen, &pChild->valdata->after.exposed,
- NullBox, 0);
- }
- if (pChild->firstChild)
- {
- pChild = pChild->firstChild;
- continue;
- }
- }
- while (!pChild->nextSib && (pChild != pParent))
- pChild = pChild->parent;
- if (pChild == pParent)
- break;
- pChild = pChild->nextSib;
- }
- return;
- }
- /* fall through */
- default:
- /*
- * To calculate exposures correctly, we have to translate the old
- * borderClip and clipList regions to the window's new location so there
- * is a correspondence between pieces of the new and old clipping regions.
- */
- if (dx || dy)
- {
- /*
- * We translate the old clipList because that will be exposed or copied
- * if gravity is right.
- */
- REGION_TRANSLATE( pScreen, &pParent->borderClip, dx, dy);
- REGION_TRANSLATE( pScreen, &pParent->clipList, dx, dy);
- }
- break;
- case VTBroken:
- REGION_EMPTY (pScreen, &pParent->borderClip);
- REGION_EMPTY (pScreen, &pParent->clipList);
- break;
- }
-
- borderVisible = pParent->valdata->before.borderVisible;
- resized = pParent->valdata->before.resized;
- REGION_INIT( pScreen, &pParent->valdata->after.borderExposed, NullBox, 0);
- REGION_INIT( pScreen, &pParent->valdata->after.exposed, NullBox, 0);
-
- /*
- * Since the borderClip must not be clipped by the children, we do
- * the border exposure first...
- *
- * 'universe' is the window's borderClip. To figure the exposures, remove
- * the area that used to be exposed from the new.
- * This leaves a region of pieces that weren't exposed before.
- */
-
- if (HasBorder (pParent))
- {
- if (borderVisible)
- {
- /*
- * when the border changes shape, the old visible portions
- * of the border will be saved by DIX in borderVisible --
- * use that region and destroy it
- */
- REGION_SUBTRACT( pScreen, exposed, universe, borderVisible);
- REGION_DESTROY( pScreen, borderVisible);
- }
- else
- {
- REGION_SUBTRACT( pScreen, exposed, universe, &pParent->borderClip);
- }
- if (HasParentRelativeBorder(pParent) && (dx || dy)) {
- REGION_SUBTRACT( pScreen, &pParent->valdata->after.borderExposed,
- universe,
- &pParent->winSize);
- } else {
- REGION_SUBTRACT( pScreen, &pParent->valdata->after.borderExposed,
- exposed, &pParent->winSize);
- }
-
- REGION_COPY( pScreen, &pParent->borderClip, universe);
-
- /*
- * To get the right clipList for the parent, and to make doubly sure
- * that no child overlaps the parent's border, we remove the parent's
- * border from the universe before proceeding.
- */
-
- REGION_INTERSECT( pScreen, universe, universe, &pParent->winSize);
- }
- else
- REGION_COPY( pScreen, &pParent->borderClip, universe);
-
- if ((pChild = pParent->firstChild) && pParent->mapped)
- {
- REGION_INIT(pScreen, &childUniverse, NullBox, 0);
- REGION_INIT(pScreen, &childUnion, NullBox, 0);
- if ((pChild->drawable.y < pParent->lastChild->drawable.y) ||
- ((pChild->drawable.y == pParent->lastChild->drawable.y) &&
- (pChild->drawable.x < pParent->lastChild->drawable.x)))
- {
- for (; pChild; pChild = pChild->nextSib)
- {
- if (pChild->viewable)
- REGION_APPEND( pScreen, &childUnion, &pChild->borderSize);
- }
- }
- else
- {
- for (pChild = pParent->lastChild; pChild; pChild = pChild->prevSib)
- {
- if (pChild->viewable)
- REGION_APPEND( pScreen, &childUnion, &pChild->borderSize);
- }
- }
- REGION_VALIDATE( pScreen, &childUnion, &overlap);
-
- for (pChild = pParent->firstChild;
- pChild;
- pChild = pChild->nextSib)
- {
- if (pChild->viewable) {
- /*
- * If the child is viewable, we want to remove its extents
- * from the current universe, but we only re-clip it if
- * it's been marked.
- */
- if (pChild->valdata) {
- /*
- * Figure out the new universe from the child's
- * perspective and recurse.
- */
- REGION_INTERSECT( pScreen, &childUniverse,
- universe,
- &pChild->borderSize);
- rootlessComputeClips (pChild, pScreen, &childUniverse,
- kind, exposed);
- }
- /*
- * Once the child has been processed, we remove its extents
- * from the current universe, thus denying its space to any
- * other sibling.
- */
- if (overlap)
- REGION_SUBTRACT( pScreen, universe, universe,
- &pChild->borderSize);
- }
- }
- if (!overlap)
- REGION_SUBTRACT( pScreen, universe, universe, &childUnion);
- REGION_UNINIT( pScreen, &childUnion);
- REGION_UNINIT( pScreen, &childUniverse);
- } /* if any children */
-
- /*
- * 'universe' now contains the new clipList for the parent window.
- *
- * To figure the exposure of the window we subtract the old clip from the
- * new, just as for the border.
- */
-
- if (oldVis == VisibilityFullyObscured ||
- oldVis == VisibilityNotViewable)
- {
- REGION_COPY( pScreen, &pParent->valdata->after.exposed, universe);
- }
- else if (newVis != VisibilityFullyObscured &&
- newVis != VisibilityNotViewable)
- {
- REGION_SUBTRACT( pScreen, &pParent->valdata->after.exposed,
- universe, &pParent->clipList);
- }
-
- /*
- * One last thing: backing storage. We have to try to save what parts of
- * the window are about to be obscured. We can just subtract the universe
- * from the old clipList and get the areas that were in the old but aren't
- * in the new and, hence, are about to be obscured.
- */
- if (pParent->backStorage && !resized)
- {
- REGION_SUBTRACT( pScreen, exposed, &pParent->clipList, universe);
- (* pScreen->SaveDoomedAreas)(pParent, exposed, dx, dy);
- }
-
- /* HACK ALERT - copying contents of regions, instead of regions */
- {
- RegionRec tmp;
-
- tmp = pParent->clipList;
- pParent->clipList = *universe;
- *universe = tmp;
- }
-
-#ifdef NOTDEF
- REGION_COPY( pScreen, &pParent->clipList, universe);
-#endif
-
- pParent->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-
- if (pScreen->ClipNotify)
- (* pScreen->ClipNotify) (pParent, dx, dy);
-}
-
-static void
-rootlessTreeObscured(pParent)
- register WindowPtr pParent;
-{
- register WindowPtr pChild;
- register int oldVis;
-
- pChild = pParent;
- while (1)
- {
- if (pChild->viewable)
- {
- oldVis = pChild->visibility;
- if (oldVis != (pChild->visibility = VisibilityFullyObscured) &&
- ((pChild->eventMask | wOtherEventMasks(pChild)) & VisibilityChangeMask))
- SendVisibilityNotify(pChild);
- if (pChild->firstChild)
- {
- pChild = pChild->firstChild;
- continue;
- }
- }
- while (!pChild->nextSib && (pChild != pParent))
- pChild = pChild->parent;
- if (pChild == pParent)
- break;
- pChild = pChild->nextSib;
- }
-}
-
-/*
- *-----------------------------------------------------------------------
- * miValidateTree --
- * Recomputes the clip list for pParent and all its inferiors.
- *
- * Results:
- * Always returns 1.
- *
- * Side Effects:
- * The clipList, borderClip, exposed, and borderExposed regions for
- * each marked window are altered.
- *
- * Notes:
- * This routine assumes that all affected windows have been marked
- * (valdata created) and their winSize and borderSize regions
- * adjusted to correspond to their new positions. The borderClip and
- * clipList regions should not have been touched.
- *
- * The top-most level is treated differently from all lower levels
- * because pParent is unchanged. For the top level, we merge the
- * regions taken up by the marked children back into the clipList
- * for pParent, thus forming a region from which the marked children
- * can claim their areas. For lower levels, where the old clipList
- * and borderClip are invalid, we can't do this and have to do the
- * extra operations done in miComputeClips, but this is much faster
- * e.g. when only one child has moved...
- *
- *-----------------------------------------------------------------------
- */
-/*
- Quartz version: used for validate from root in rootless mode.
- We need to make sure top-level windows don't clip each other,
- and that top-level windows aren't clipped to the root window.
-*/
-/*ARGSUSED*/
-// fixme this is ugly
-// Xprint/ValTree.c doesn't work, but maybe that method can?
-int
-rootlessMiValidateTree (pRoot, pChild, kind)
- WindowPtr pRoot; /* Parent to validate */
- WindowPtr pChild; /* First child of pRoot that was
- * affected */
- VTKind kind; /* What kind of configuration caused call */
-{
- RegionRec totalClip; /* Total clipping region available to
- * the marked children. pRoot's clipList
- * merged with the borderClips of all
- * the marked children. */
- RegionRec childClip; /* The new borderClip for the current
- * child */
- RegionRec childUnion; /* the space covered by borderSize for
- * all marked children */
- RegionRec exposed; /* For intermediate calculations */
- register ScreenPtr pScreen;
- register WindowPtr pWin;
- Bool overlap;
- int viewvals;
- Bool forward;
-
- pScreen = pRoot->drawable.pScreen;
- if (pChild == NullWindow)
- pChild = pRoot->firstChild;
-
- REGION_INIT(pScreen, &childClip, NullBox, 0);
- REGION_INIT(pScreen, &exposed, NullBox, 0);
-
- /*
- * compute the area of the parent window occupied
- * by the marked children + the parent itself. This
- * is the area which can be divied up among the marked
- * children in their new configuration.
- */
- REGION_INIT(pScreen, &totalClip, NullBox, 0);
- viewvals = 0;
- if (REGION_BROKEN (pScreen, &pRoot->clipList) &&
- !REGION_BROKEN (pScreen, &pRoot->borderClip))
- {
- kind = VTBroken;
- /*
- * When rebuilding clip lists after out of memory,
- * assume everything is busted.
- */
- forward = TRUE;
- REGION_COPY (pScreen, &totalClip, &pRoot->borderClip);
- REGION_INTERSECT (pScreen, &totalClip, &totalClip, &pRoot->winSize);
-
- for (pWin = pRoot->firstChild; pWin != pChild; pWin = pWin->nextSib)
- {
- if (pWin->viewable)
- REGION_SUBTRACT (pScreen, &totalClip, &totalClip, &pWin->borderSize);
- }
- for (pWin = pChild; pWin; pWin = pWin->nextSib)
- if (pWin->valdata && pWin->viewable)
- viewvals++;
-
- REGION_EMPTY (pScreen, &pRoot->clipList);
- ErrorF("ValidateTree: BUSTED!\n");
- }
- else
- {
- if ((pChild->drawable.y < pRoot->lastChild->drawable.y) ||
- ((pChild->drawable.y == pRoot->lastChild->drawable.y) &&
- (pChild->drawable.x < pRoot->lastChild->drawable.x)))
- {
- forward = TRUE;
- for (pWin = pChild; pWin; pWin = pWin->nextSib)
- {
- if (pWin->valdata)
- {
- REGION_APPEND( pScreen, &totalClip, &pWin->borderClip);
- if (pWin->viewable)
- viewvals++;
- }
- }
- }
- else
- {
- forward = FALSE;
- pWin = pRoot->lastChild;
- while (1)
- {
- if (pWin->valdata)
- {
- REGION_APPEND( pScreen, &totalClip, &pWin->borderClip);
- if (pWin->viewable)
- viewvals++;
- }
- if (pWin == pChild)
- break;
- pWin = pWin->prevSib;
- }
- }
- REGION_VALIDATE( pScreen, &totalClip, &overlap);
- }
-
-
- // calculate childUnion so we can subtract it from totalClip later
- REGION_INIT(pScreen, &childUnion, NullBox, 0);
- if (kind != VTStack) {
- if (forward)
- {
- for (pWin = pChild; pWin; pWin = pWin->nextSib)
- if (pWin->valdata && pWin->viewable)
- REGION_APPEND( pScreen, &childUnion,
- &pWin->borderSize);
- }
- else
- {
- pWin = pRoot->lastChild;
- while (1)
- {
- if (pWin->valdata && pWin->viewable)
- REGION_APPEND( pScreen, &childUnion,
- &pWin->borderSize);
- if (pWin == pChild)
- break;
- pWin = pWin->prevSib;
- }
- }
- REGION_VALIDATE(pScreen, &childUnion, &overlap);
- }
-
-
- /*
- * Now go through the children of the root and figure their new
- * borderClips from the totalClip, passing that off to miComputeClips
- * to handle recursively. Once that's done, we remove the child
- * from the totalClip to clip any siblings below it.
- */
-
- for (pWin = pChild;
- pWin != NullWindow;
- pWin = pWin->nextSib)
- {
- if (pWin->viewable) {
- if (pWin->valdata) {
- REGION_COPY( pScreen, &childClip, &pWin->borderSize);
- rootlessComputeClips (pWin, pScreen, &childClip, kind, &exposed);
- } else if (pWin->visibility == VisibilityNotViewable) {
- rootlessTreeObscured(pWin);
- }
- } else {
- if (pWin->valdata) {
- REGION_EMPTY( pScreen, &pWin->clipList);
- if (pScreen->ClipNotify)
- (* pScreen->ClipNotify) (pWin, 0, 0);
- REGION_EMPTY( pScreen, &pWin->borderClip);
- pWin->valdata = (ValidatePtr)NULL;
- }
- }
- }
-
- REGION_UNINIT( pScreen, &childClip);
-
- // REGION_SUBTRACT(pScreen, &totalClip, &totalClip, &childUnion);
- REGION_UNINIT(pScreen, &childUnion);
-
- REGION_INIT( pScreen, &pRoot->valdata->after.exposed, NullBox, 0);
- REGION_INIT( pScreen, &pRoot->valdata->after.borderExposed, NullBox, 0);
-
-
- REGION_UNINIT( pScreen, &totalClip);
- REGION_UNINIT( pScreen, &exposed);
- //if (pScreen->ClipNotify)
- //(*pScreen->ClipNotify) (pRoot, 0, 0);
- return (1);
-}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/rootlessWindow.c b/xc/programs/Xserver/hw/darwin/bundle/rootlessWindow.c
deleted file mode 100644
index 974d7c3dc..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/rootlessWindow.c
+++ /dev/null
@@ -1,674 +0,0 @@
-/*
- * Rootless window management
- *
- * Greg Parker gparker@cs.stanford.edu
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/rootlessWindow.c,v 1.9 2001/12/22 05:28:35 torrey Exp $ */
-
-#include "rootlessCommon.h"
-#include "rootlessWindow.h"
-
-#include "fb.h"
-
-
-// RootlessCreateWindow
-// For now, don't create a frame until the window is realized.
-// Do reset the window size so it's not clipped by the root window.
-Bool
-RootlessCreateWindow(WindowPtr pWin)
-{
- Bool result;
- RegionRec saveRoot;
-
- WINREC(pWin) = NULL;
- SCREEN_UNWRAP(pWin->drawable.pScreen, CreateWindow);
- if (!IsRoot(pWin)) {
- // win/border size set by DIX, not by wrapped CreateWindow, so
- // correct it here.
- // Don't HUGE_ROOT when pWin is the root!
- HUGE_ROOT(pWin);
- SetWinSize(pWin);
- SetBorderSize(pWin);
- }
- result = pWin->drawable.pScreen->CreateWindow(pWin);
- if (pWin->parent) {
- NORMAL_ROOT(pWin);
- }
- SCREEN_WRAP(pWin->drawable.pScreen, CreateWindow);
- return result;
-}
-
-
-// RootlessDestroyWindow
-// For now, all window destruction takes place in UnrealizeWindow
-Bool
-RootlessDestroyWindow(WindowPtr pWin)
-{
- Bool result;
-
- SCREEN_UNWRAP(pWin->drawable.pScreen, DestroyWindow);
- result = pWin->drawable.pScreen->DestroyWindow(pWin);
- SCREEN_WRAP(pWin->drawable.pScreen, DestroyWindow);
- return result;
-}
-
-
-#ifdef SHAPE
-
-// RootlessSetShape
-// Shape is usually set before the window is mapped, but (for now) we
-// don't keep track of frames before they're mapped. So we just record
-// that the shape needs to updated later.
-void
-RootlessSetShape(WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- RootlessDamageShape(pWin);
- SCREEN_UNWRAP(pScreen, SetShape);
- pScreen->SetShape(pWin);
- SCREEN_WRAP(pScreen, SetShape);
-}
-
-#endif // SHAPE
-
-
-// Disallow ParentRelative background on top-level windows
-// because the root window doesn't really have the right background
-// and cfb will try to draw on the root instead of on the window.
-// fixme what about fb?
-// fixme implement ParentRelative with real transparency?
-// ParentRelative prevention is also in RealizeWindow()
-Bool
-RootlessChangeWindowAttributes(WindowPtr pWin, unsigned long vmask)
-{
- Bool result;
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- RL_DEBUG_MSG("change window attributes start ");
-
- SCREEN_UNWRAP(pScreen, ChangeWindowAttributes);
- result = pScreen->ChangeWindowAttributes(pWin, vmask);
- SCREEN_WRAP(pScreen, ChangeWindowAttributes);
-
- if (WINREC(pWin)) {
- // disallow ParentRelative background state
- if (pWin->backgroundState == ParentRelative) {
- XID pixel = 0;
- ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient);
- }
- }
-
- RL_DEBUG_MSG("change window attributes end\n");
- return result;
-}
-
-
-// Update the frame position now.
-// (x, y) are *inside* position!
-// After this, mi and fb are expecting the pixmap to be at the new location.
-Bool
-RootlessPositionWindow(WindowPtr pWin, int x, int y)
-{
- RootlessWindowRec *winRec = WINREC(pWin);
- ScreenPtr pScreen = pWin->drawable.pScreen;
- Bool result;
-
- RL_DEBUG_MSG("positionwindow start\n");
- if (winRec) {
- winRec->frame.x = x - pWin->borderWidth;
- winRec->frame.y = y - pWin->borderWidth;
- }
-
- UpdatePixmap(pWin);
-
- SCREEN_UNWRAP(pScreen, PositionWindow);
- result = pScreen->PositionWindow(pWin, x, y);
- SCREEN_WRAP(pScreen, PositionWindow);
-
- RL_DEBUG_MSG("positionwindow end\n");
- return result;
-}
-
-
-// RootlessRealizeWindow
-// The frame is created here and not in CreateWindow.
-// fixme change this? probably not - would be faster, but eat more memory
-Bool
-RootlessRealizeWindow(WindowPtr pWin)
-{
- Bool result = FALSE;
- RegionRec saveRoot;
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- RL_DEBUG_MSG("realizewindow start ");
-
- if (IsTopLevel(pWin) || IsRoot(pWin)) {
- DrawablePtr d = &pWin->drawable;
- RootlessWindowRec *winRec = xalloc(sizeof(RootlessWindowRec));
-
- if (! winRec) goto windowcreatebad;
-
- winRec->frame.isRoot = (pWin == WindowTable[pScreen->myNum]);
- winRec->frame.x = d->x - pWin->borderWidth;
- winRec->frame.y = d->y - pWin->borderWidth;
- winRec->frame.w = d->width + 2*pWin->borderWidth;
- winRec->frame.h = d->height + 2*pWin->borderWidth;
- winRec->frame.win = pWin;
- winRec->frame.devPrivate = NULL;
-
- REGION_INIT(pScreen, &winRec->damage, NullBox, 0);
- winRec->borderWidth = pWin->borderWidth;
-
- winRec->pixmap = NULL;
- // UpdatePixmap() called below
-
- WINREC(pWin) = winRec;
-
- RL_DEBUG_MSG("creating frame ");
- CallFrameProc(pScreen, CreateFrame,
- (pScreen, &WINREC(pWin)->frame,
- pWin->prevSib ? &WINREC(pWin->prevSib)->frame : NULL));
-
- // fixme implement ParentRelative with transparency?
- // need non-interfering fb first
- // Disallow ParentRelative background state
- // This might have been set before the window was mapped
- if (pWin->backgroundState == ParentRelative) {
- XID pixel = 0;
- ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient);
- }
-
-#ifdef SHAPE
- // Shape is usually set before the window is mapped, but
- // (for now) we don't keep track of frames before they're mapped.
- winRec->shapeDamage = TRUE;
-#endif
- }
-
- UpdatePixmap(pWin);
-
- if (!IsRoot(pWin)) HUGE_ROOT(pWin);
- SCREEN_UNWRAP(pScreen, RealizeWindow);
- result = pScreen->RealizeWindow(pWin);
- SCREEN_WRAP(pScreen, RealizeWindow);
- if (!IsRoot(pWin)) NORMAL_ROOT(pWin);
-
- RL_DEBUG_MSG("realizewindow end\n");
- return result;
-
-windowcreatebad:
- RL_DEBUG_MSG("window create bad! ");
- RL_DEBUG_MSG("realizewindow end\n");
- return NULL;
-}
-
-
-Bool
-RootlessUnrealizeWindow(WindowPtr pWin)
-{
- Bool result;
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- RL_DEBUG_MSG("unrealizewindow start ");
-
- if (IsTopLevel(pWin) || IsRoot(pWin)) {
- RootlessWindowRec *winRec = WINREC(pWin);
-
- RootlessRedisplay(pWin);
- CallFrameProc(pScreen, DestroyFrame, (pScreen, &winRec->frame));
-
- REGION_UNINIT(pScreen, &winRec->damage);
-
- xfree(winRec);
- WINREC(pWin) = NULL;
- }
-
- SCREEN_UNWRAP(pScreen, UnrealizeWindow);
- result = pScreen->UnrealizeWindow(pWin);
- SCREEN_WRAP(pScreen, UnrealizeWindow);
- RL_DEBUG_MSG("unrealizewindow end\n");
- return result;
-}
-
-
-void
-RootlessRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
-{
- RegionRec saveRoot;
- RootlessWindowRec *winRec = WINREC(pWin);
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- RL_DEBUG_MSG("restackwindow start ");
- if (winRec) RL_DEBUG_MSG("restack top level \n");
-
- HUGE_ROOT(pWin);
- SCREEN_UNWRAP(pScreen, RestackWindow);
- if (pScreen->RestackWindow) pScreen->RestackWindow(pWin, pOldNextSib);
- SCREEN_WRAP(pScreen, RestackWindow);
- NORMAL_ROOT(pWin);
-
- if (winRec) {
- // fixme simplify the following
-
- WindowPtr oldNextW, newNextW, oldPrevW, newPrevW;
- RootlessFramePtr oldNext, newNext, oldPrev, newPrev;
-
- oldNextW = pOldNextSib;
- while (oldNextW && ! WINREC(oldNextW)) oldNextW = oldNextW->nextSib;
- oldNext = oldNextW ? &WINREC(oldNextW)->frame : NULL;
-
- newNextW = pWin->nextSib;
- while (newNextW && ! WINREC(newNextW)) newNextW = newNextW->nextSib;
- newNext = newNextW ? &WINREC(newNextW)->frame : NULL;
-
- oldPrevW= pOldNextSib ? pOldNextSib->prevSib : pWin->parent->lastChild;
- while (oldPrevW && ! WINREC(oldPrevW)) oldPrevW = oldPrevW->prevSib;
- oldPrev = oldPrevW ? &WINREC(oldPrevW)->frame : NULL;
-
- newPrevW = pWin->prevSib;
- while (newPrevW && ! WINREC(newPrevW)) newPrevW = newPrevW->prevSib;
- newPrev = newPrevW ? &WINREC(newPrevW)->frame : NULL;
-
- if (pWin->prevSib) {
- WindowPtr w = pWin->prevSib;
- while (w) {
- RL_DEBUG_MSG("w 0x%x\n", w);
- w = w->parent;
- }
- }
-
- CallFrameProc(pScreen, RestackFrame,
- (pScreen, &winRec->frame, oldPrev, newPrev));
- }
-
- RL_DEBUG_MSG("restackwindow end\n");
-}
-
-
-/*
- * Specialized window copy procedures
- */
-
-// Globals needed during window resize and move.
-static PixmapPtr gResizeDeathPix = NULL;
-static pointer gResizeDeathBits = NULL;
-static PixmapPtr gResizeCopyWindowSource = NULL;
-static CopyWindowProcPtr gResizeOldCopyWindowProc = NULL;
-
-// CopyWindow() that doesn't do anything.
-// For MoveWindow() of top-level windows.
-static void
-RootlessNoCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
- RegionPtr prgnSrc)
-{
- // some code expects the region to be translated
- int dx = ptOldOrg.x - pWin->drawable.x;
- int dy = ptOldOrg.y - pWin->drawable.y;
- RL_DEBUG_MSG("ROOTLESSNOCOPYWINDOW ");
-
- REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
-}
-
-
-// CopyWindow used during ResizeWindow for gravity moves.
-// Cloned from fbCopyWindow
-// The original always draws on the root pixmap (which we don't have).
-// Instead, draw on the parent window's pixmap.
-// Resize version: the old location's pixels are in gResizeCopyWindowSource
-static void
-RootlessResizeCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
- RegionPtr prgnSrc)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- SCREEN_UNWRAP(pScreen, CopyWindow);
- RL_DEBUG_MSG("resizecopywindowFB start (win 0x%x) ", pWin);
-
- {
- RegionRec rgnDst;
- int dx, dy;
-
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
- REGION_INIT (pScreen, &rgnDst, NullBox, 0);
- REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
-
- fbCopyRegion (&gResizeCopyWindowSource->drawable,
- &pScreen->GetWindowPixmap(pWin)->drawable,
- 0,
- &rgnDst, dx, dy, fbCopyWindowProc, 0, 0);
-
- // don't update - resize will update everything
- // fixme DO update?
- REGION_UNINIT(pScreen, &rgnDst);
- fbValidateDrawable (&pWin->drawable);
- }
-
- SCREEN_WRAP(pScreen, CopyWindow);
- RL_DEBUG_MSG("resizecopywindowFB end\n");
-}
-
-
-/* Update *new* location of window. Old location is redrawn with
- * PaintWindowBackground/Border.
- * Cloned from fbCopyWindow
- * The original always draws on the root pixmap (which we don't have).
- * Instead, draw on the parent window's pixmap.
- */
-void
-RootlessCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- SCREEN_UNWRAP(pScreen, CopyWindow);
- RL_DEBUG_MSG("copywindowFB start (win 0x%x) ", pWin);
-
- {
- RegionRec rgnDst;
- int dx, dy;
-
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
-
- REGION_INIT(pScreen, &rgnDst, NullBox, 0);
- REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
-
- fbCopyRegion ((DrawablePtr)pWin, (DrawablePtr)pWin,
- 0,
- &rgnDst, dx, dy, fbCopyWindowProc, 0, 0);
-
- // prgnSrc has been translated to dst position
- RootlessDamageRegion(pWin, prgnSrc);
- REGION_UNINIT(pScreen, &rgnDst);
- fbValidateDrawable (&pWin->drawable);
- }
-
- SCREEN_WRAP(pScreen, CopyWindow);
- RL_DEBUG_MSG("copywindowFB end\n");
-}
-
-
-/*
- * Window resize procedures
- */
-
-// Prepare to resize a window.
-// The old window's pixels are saved and the implementation is told
-// to change the window size.
-// (x,y,w,h) is outer frame of window (outside border)
-static void
-StartFrameResize(WindowPtr pWin, Bool gravity,
- int oldX, int oldY,
- unsigned int oldW, unsigned int oldH, unsigned int oldBW,
- int newX, int newY,
- unsigned int newW, unsigned int newH, unsigned int newBW)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- RootlessWindowRec *winRec = WINREC(pWin);
-
- RL_DEBUG_MSG("RESIZE TOPLEVEL WINDOW ");
- RL_DEBUG_MSG("%d %d %d %d %d %d %d %d %d %d ",
- oldX, oldY, oldW, oldH, oldBW,
- newX, newY, newW, newH, newBW);
-
- RootlessRedisplay(pWin);
-
- // Make a copy of the current pixmap and all its data.
- // The original will go away when we ask the frame manager to
- // allocate the new pixmap.
-
- gResizeDeathBits = xalloc(winRec->frame.bytesPerRow * winRec->frame.h);
- memcpy(gResizeDeathBits, winRec->frame.pixelData,
- winRec->frame.bytesPerRow * winRec->frame.h);
- gResizeDeathPix =
- GetScratchPixmapHeader(pScreen, winRec->frame.w, winRec->frame.h,
- winRec->frame.depth, winRec->frame.bitsPerPixel,
- winRec->frame.bytesPerRow, gResizeDeathBits);
- SetPixmapBaseToScreen(gResizeDeathPix, winRec->frame.x, winRec->frame.y);
-
- winRec->frame.x = newX;
- winRec->frame.y = newY;
- winRec->frame.w = newW;
- winRec->frame.h = newH;
- winRec->borderWidth = newBW;
-
- CallFrameProc(pScreen, StartResizeFrame,
- (pScreen, &winRec->frame, oldX, oldY, oldW, oldH));
- UpdatePixmap(pWin);
-
- // Use custom CopyWindow when moving gravity bits around
- // ResizeWindow assumes the old window contents are in the same
- // pixmap, but here they're in deathPix instead.
- if (gravity) {
- gResizeCopyWindowSource = gResizeDeathPix;
- gResizeOldCopyWindowProc = pScreen->CopyWindow;
- pScreen->CopyWindow = RootlessResizeCopyWindow;
- }
-
- // Copy pixels in intersection from src to dst.
- // ResizeWindow assumes these pixels are already present when
- // making gravity adjustments.
- // pWin currently has new-sized pixmap but is in old position
- // fixme border width change!
- {
- RegionRec r;
- DrawablePtr src = &gResizeDeathPix->drawable;
- DrawablePtr dst = &pScreen->GetWindowPixmap(pWin)->drawable;
- // These vars are needed because implicit unsigned->signed fails
- int oldX2 = (int)(oldX + oldW), newX2 = (int)(newX + newW);
- int oldY2 = (int)(oldY + oldH), newY2 = (int)(newY + newH);
-
- r.data = NULL;
- r.extents.x1 = max(oldX, newX);
- r.extents.y1 = max(oldY, newY);
- r.extents.x2 = min(oldX2, newX2);
- r.extents.y2 = min(oldY2, newY2);
-
- // r is now intersection of of old location and new location
- if (r.extents.x2 > r.extents.x1 && r.extents.y2 > r.extents.y1) {
-#if 0
- DDXPointRec srcPt = {r.extents.x1, r.extents.y1};
- // Correct for border width change
- // fixme need to correct for border width change
- int dx = newX - oldX;
- int dy = newY - oldY;
- REGION_TRANSLATE(pScreen, &r, dx, dy);
-#endif
- fbCopyRegion(src, dst, NULL, &r, 0, 0, fbCopyWindowProc, 0, 0);
- }
- REGION_UNINIT(pScreen, &r);
- }
-}
-
-
-static void
-FinishFrameResize(WindowPtr pWin, Bool gravity,
- int oldX, int oldY,
- unsigned int oldW, unsigned int oldH, unsigned int oldBW,
- int newX, int newY,
- unsigned int newW, unsigned int newH, unsigned int newBW)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- RootlessWindowRec *winRec = WINREC(pWin);
-
- CallFrameProc(pScreen, FinishResizeFrame,
- (pScreen, &winRec->frame, oldX, oldY, oldW, oldH));
- if (wBoundingShape(pWin)) {
- RootlessDamageShape(pWin);
- }
-
- // Destroy temp pixmap
- FreeScratchPixmapHeader(gResizeDeathPix);
- xfree(gResizeDeathBits);
- gResizeDeathPix = gResizeDeathBits = NULL;
-
- if (gravity) {
- pScreen->CopyWindow = gResizeOldCopyWindowProc;
- gResizeCopyWindowSource = NULL;
- }
-}
-
-
-// If kind==VTOther, window border is resizing (and borderWidth is
-// already changed!!@#$) This case works like window resize, not move.
-void
-RootlessMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind)
-{
- CopyWindowProcPtr oldCopyWindowProc = NULL;
- RegionRec saveRoot;
- RootlessWindowRec *winRec = WINREC(pWin);
- ScreenPtr pScreen = pWin->drawable.pScreen;
- int oldX = 0, oldY = 0, newX = 0, newY = 0;
- unsigned int oldW = 0, oldH = 0, oldBW = 0, newW = 0, newH = 0, newBW = 0;
-
- RL_DEBUG_MSG("movewindow start \n");
-
- if (winRec) {
- if (kind == VTMove) {
- oldX = winRec->frame.x;
- oldY = winRec->frame.y;
- RootlessRedisplay(pWin);
- } else {
- RL_DEBUG_MSG("movewindow border resizing ");
- oldBW = winRec->borderWidth;
- oldX = winRec->frame.x;
- oldY = winRec->frame.y;
- oldW = winRec->frame.w;
- oldH = winRec->frame.h;
- newBW = pWin->borderWidth;
- newX = x;
- newY = y;
- newW = pWin->drawable.width + 2*newBW;
- newH = pWin->drawable.height + 2*newBW;
- StartFrameResize(pWin, FALSE, oldX, oldY, oldW, oldH, oldBW,
- newX, newY, newW, newH, newBW);
- }
- }
-
- HUGE_ROOT(pWin);
- SCREEN_UNWRAP(pScreen, MoveWindow);
- if (winRec) {
- oldCopyWindowProc = pScreen->CopyWindow;
- pScreen->CopyWindow = RootlessNoCopyWindow;
- }
- pScreen->MoveWindow(pWin, x, y, pSib, kind);
- if (winRec) {
- pScreen->CopyWindow = oldCopyWindowProc;
- }
- NORMAL_ROOT(pWin);
- SCREEN_WRAP(pScreen, MoveWindow);
-
- if (winRec) {
- if (kind == VTMove) {
- // PositionWindow has already set the new frame position.
- CallFrameProc(pScreen, MoveFrame,
- (pScreen, &winRec->frame, oldX, oldY));
- } else {
- FinishFrameResize(pWin, FALSE, oldX, oldY, oldW, oldH, oldBW,
- newX, newY, newW, newH, newBW);
- }
- }
-
- RL_DEBUG_MSG("movewindow end\n");
-}
-
-
-// Note: (x, y, w, h) as passed to this procedure don't match
-// the frame definition.
-// (x,y) is corner of very outer edge, *outside* border
-// w,h is width and height *inside8 border, *ignoring* border width
-// The rect (x, y, w, h) doesn't mean anything.
-// (x, y, w+2*bw, h+2*bw) is total rect
-// (x+bw, y+bw, w, h) is inner rect
-
-void
-RootlessResizeWindow(WindowPtr pWin, int x, int y,
- unsigned int w, unsigned int h, WindowPtr pSib)
-{
- RegionRec saveRoot;
- RootlessWindowRec *winRec = WINREC(pWin);
- ScreenPtr pScreen = pWin->drawable.pScreen;
- int oldX = 0, oldY = 0, newX = 0, newY = 0;
- unsigned int oldW = 0, oldH = 0, oldBW = 0, newW = 0, newH = 0, newBW = 0;
-
- RL_DEBUG_MSG("resizewindow start (win 0x%x) ", pWin);
-
- if (winRec) {
- oldBW = winRec->borderWidth;
- oldX = winRec->frame.x;
- oldY = winRec->frame.y;
- oldW = winRec->frame.w;
- oldH = winRec->frame.h;
-
- newBW = oldBW;
- newX = x;
- newY = y;
- newW = w + 2*newBW;
- newH = h + 2*newBW;
-
- StartFrameResize(pWin, TRUE, oldX, oldY, oldW, oldH, oldBW,
- newX, newY, newW, newH, newBW);
- }
-
- HUGE_ROOT(pWin);
- SCREEN_UNWRAP(pScreen, ResizeWindow);
- pScreen->ResizeWindow(pWin, x, y, w, h, pSib);
- SCREEN_WRAP(pScreen, ResizeWindow);
- NORMAL_ROOT(pWin);
-
- if (winRec) {
- FinishFrameResize(pWin, TRUE, oldX, oldY, oldW, oldH, oldBW,
- newX, newY, newW, newH, newBW);
- }
-
- RL_DEBUG_MSG("resizewindow end\n");
-}
-
-
-// fixme untested!
-// pWin inside corner stays the same
-// pWin->drawable.[xy] stays the same
-// frame moves and resizes
-void
-RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width)
-{
- RegionRec saveRoot;
-
- RL_DEBUG_MSG("change border width ");
- if (width != pWin->borderWidth) {
- RootlessWindowRec *winRec = WINREC(pWin);
- int oldX = 0, oldY = 0, newX = 0, newY = 0;
- unsigned int oldW = 0, oldH = 0, oldBW = 0;
- unsigned int newW = 0, newH = 0, newBW = 0;
-
- if (winRec) {
- oldBW = winRec->borderWidth;
- oldX = winRec->frame.x;
- oldY = winRec->frame.y;
- oldW = winRec->frame.w;
- oldH = winRec->frame.h;
-
- newBW = width;
- newX = pWin->drawable.x - newBW;
- newY = pWin->drawable.y - newBW;
- newW = pWin->drawable.width + 2*newBW;
- newH = pWin->drawable.height + 2*newBW;
-
- StartFrameResize(pWin, FALSE, oldX, oldY, oldW, oldH, oldBW,
- newX, newY, newW, newH, newBW);
- }
-
- HUGE_ROOT(pWin);
- SCREEN_UNWRAP(pWin->drawable.pScreen, ChangeBorderWidth);
- pWin->drawable.pScreen->ChangeBorderWidth(pWin, width);
- SCREEN_WRAP(pWin->drawable.pScreen, ChangeBorderWidth);
- NORMAL_ROOT(pWin);
-
- if (winRec) {
- FinishFrameResize(pWin, FALSE, oldX, oldY, oldW, oldH, oldBW,
- newX, newY, newW, newH, newBW);
- }
- }
- RL_DEBUG_MSG("change border width end\n");
-}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/rootlessWindow.h b/xc/programs/Xserver/hw/darwin/bundle/rootlessWindow.h
deleted file mode 100644
index ba14c787a..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/rootlessWindow.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Rootless window management
- *
- * Greg Parker gparker@cs.stanford.edu
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/rootlessWindow.h,v 1.1 2001/07/01 02:13:41 torrey Exp $ */
-
-#ifndef _ROOTLESSWINDOW_H
-#define _ROOTLESSWINDOW_H
-
-#include "rootlessCommon.h"
-
-
-Bool RootlessCreateWindow(WindowPtr pWin);
-Bool RootlessDestroyWindow(WindowPtr pWin);
-
-#ifdef SHAPE
-void RootlessSetShape(WindowPtr pWin);
-#endif // SHAPE
-
-Bool RootlessChangeWindowAttributes(WindowPtr pWin, unsigned long vmask);
-Bool RootlessPositionWindow(WindowPtr pWin, int x, int y);
-Bool RootlessRealizeWindow(WindowPtr pWin);
-Bool RootlessUnrealizeWindow(WindowPtr pWin);
-void RootlessRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib);
-void RootlessCopyWindow(WindowPtr pWin,DDXPointRec ptOldOrg,RegionPtr prgnSrc);
-void RootlessMoveWindow(WindowPtr pWin,int x,int y,WindowPtr pSib,VTKind kind);
-void RootlessResizeWindow(WindowPtr pWin, int x, int y,
- unsigned int w, unsigned int h, WindowPtr pSib);
-void RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width);
-
-#endif
diff --git a/xc/programs/Xserver/hw/kdrive/linux/agp.c b/xc/programs/Xserver/hw/kdrive/linux/agp.c
index ea34e7c40..3d65cc264 100644
--- a/xc/programs/Xserver/hw/kdrive/linux/agp.c
+++ b/xc/programs/Xserver/hw/kdrive/linux/agp.c
@@ -120,9 +120,16 @@ GARTInit()
KdReleaseGART(-1);
#if defined(linux)
- /* Should this look for version >= rather than version == ? */
- if (agpinf.version.major != AGPGART_MAJOR_VERSION &&
- agpinf.version.minor != AGPGART_MINOR_VERSION) {
+ /* Per Dave Jones, every effort will be made to keep the
+ * agpgart interface backwards compatible, so allow all
+ * future versions.
+ */
+ if (
+#if (AGPGART_MAJOR_VERSION > 0) /* quiet compiler */
+ agpinf.version.major < AGPGART_MAJOR_VERSION ||
+#endif
+ (agpinf.version.major == AGPGART_MAJOR_VERSION &&
+ agpinf.version.minor < AGPGART_MINOR_VERSION)) {
fprintf(stderr,
"Kernel agpgart driver version is not current"
" (%d.%d vs %d.%d)\n",
diff --git a/xc/programs/Xserver/hw/xfree86/Imakefile b/xc/programs/Xserver/hw/xfree86/Imakefile
index 42f602fa5..b52e26516 100644
--- a/xc/programs/Xserver/hw/xfree86/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/Imakefile
@@ -75,7 +75,7 @@ XF86SETUPDIR = XF86Setup
LOADERDIR = loader
#endif
-#if BuildXInputExt
+#if BuildXInputExt && defined(XInputDrivers)
INPUTDIR = input
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Mode.c b/xc/programs/Xserver/hw/xfree86/common/xf86Mode.c
index 1a0913659..bf94b4d91 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86Mode.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86Mode.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.58 2002/10/16 17:53:55 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.61 2002/11/07 20:55:19 tsi Exp $ */
/*
* Copyright (c) 1997,1998 by The XFree86 Project, Inc.
@@ -11,6 +11,7 @@
#include "X.h"
#include "os.h"
+#include "servermd.h"
#include "mibank.h"
#include "xf86.h"
#include "xf86Priv.h"
@@ -761,6 +762,55 @@ xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor)
}
/*
+ * xf86CheckModeSize
+ *
+ * An internal routine to check if a mode fits in video memory. This tries to
+ * avoid overflows that would otherwise occur when video memory size is greater
+ * than 256MB.
+ */
+static Bool
+xf86CheckModeSize(ScrnInfoPtr scrp, int w, int x, int y)
+{
+ int bpp = scrp->fbFormat.bitsPerPixel,
+ pad = scrp->fbFormat.scanlinePad;
+ int lineWidth, lastWidth;
+
+ if (scrp->depth == 4)
+ pad *= 4; /* 4 planes */
+
+ /* Sanity check */
+ if ((w < 0) || (x < 0) || (y <= 0))
+ return FALSE;
+
+ lineWidth = (((w * bpp) + pad - 1) / pad) * pad;
+ lastWidth = x * bpp;
+
+ /*
+ * At this point, we need to compare
+ *
+ * (lineWidth * (y - 1)) + lastWidth
+ *
+ * against
+ *
+ * scrp->videoRam * (1024 * 8)
+ *
+ * These are bit quantities. To avoid overflows, do the comparison in
+ * terms of BITMAP_SCANLINE_PAD units. This assumes BITMAP_SCANLINE_PAD
+ * is a power of 2. We currently use 32, which limits us to a video
+ * memory size of 8GB.
+ */
+
+ lineWidth = (lineWidth + (BITMAP_SCANLINE_PAD - 1)) / BITMAP_SCANLINE_PAD;
+ lastWidth = (lastWidth + (BITMAP_SCANLINE_PAD - 1)) / BITMAP_SCANLINE_PAD;
+
+ if ((lineWidth * (y - 1) + lastWidth) >
+ (scrp->videoRam * ((1024 * 8) / BITMAP_SCANLINE_PAD)))
+ return FALSE;
+
+ return TRUE;
+}
+
+/*
* xf86InitialCheckModeForDriver
*
* This function checks if a mode satisfies a driver's initial requirements:
@@ -817,8 +867,8 @@ xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
mode->VSyncStart >= mode->VSyncEnd || mode->VSyncEnd >= mode->VTotal)
return MODE_V_ILLEGAL;
- if (mode->HDisplay * mode->VDisplay * scrp->fbFormat.bitsPerPixel >
- scrp->videoRam * (1024 * 8))
+ if (!xf86CheckModeSize(scrp, mode->HDisplay, mode->HDisplay,
+ mode->VDisplay))
return MODE_MEM;
if (maxPitch > 0 && mode->HDisplay > maxPitch)
@@ -1135,9 +1185,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
ModeStatus status;
int linePitch = -1, virtX = 0, virtY = 0;
int newLinePitch, newVirtX, newVirtY;
- int pixelArea = scrp->videoRam * (1024 * 8); /* in bits */
int modeSize; /* in pixels */
- int bitsPerPixel, pixmapPad;
Bool validateAllDefaultModes;
Bool userModes = FALSE;
int saveType;
@@ -1315,18 +1363,10 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
else
BankFormat = xf86GetPixFormat(scrp, 1); /* >not< scrp->depth! */
- bitsPerPixel = scrp->fbFormat.bitsPerPixel;
- pixmapPad = scrp->fbFormat.scanlinePad;
- if (scrp->depth == 4)
- pixmapPad *= 4; /* 4 planes */
-
if (scrp->xInc <= 0)
scrp->xInc = 8; /* Suitable for VGA and others */
#define _VIRTUALX(x) ((((x) + scrp->xInc - 1) / scrp->xInc) * scrp->xInc)
-#define _VIDEOSIZE(w, x, y) \
- ((((((w) * bitsPerPixel) + pixmapPad - 1) / pixmapPad) * pixmapPad * \
- ((y) - 1)) + ((x) * bitsPerPixel))
/*
* Determine maxPitch if it wasn't given explicitly. Note linePitches
@@ -1386,7 +1426,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
return -1;
}
- if (_VIDEOSIZE(linePitch, virtualX, virtualY) > pixelArea) {
+ if (!xf86CheckModeSize(scrp, linePitch, virtualX, virtualY)) {
xf86DrvMsg(scrp->scrnIndex, X_ERROR,
"Virtual size (%dx%d) (pitch %d) exceeds video memory\n",
virtualX, virtualY, linePitch);
@@ -1597,6 +1637,19 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
newVirtY = virtY;
/*
+ * Don't let non-user defined modes increase the virtual size
+ */
+ if (!(p->type & M_T_USERDEF)) {
+ if (p->HDisplay > virtX) {
+ p->status = MODE_VIRTUAL_X;
+ goto lookupNext;
+ }
+ if (p->VDisplay > virtY) {
+ p->status = MODE_VIRTUAL_Y;
+ goto lookupNext;
+ }
+ }
+ /*
* Adjust virtual width and height if the mode is too large for the
* current values and if they are not fixed.
*/
@@ -1642,7 +1695,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
* Check that the pixel area required by the new virtual height
* and line pitch isn't too large.
*/
- if (_VIDEOSIZE(newLinePitch, newVirtX, newVirtY) > pixelArea) {
+ if (!xf86CheckModeSize(scrp, newLinePitch, newVirtX, newVirtY)) {
p->status = MODE_MEM_VIRT;
goto lookupNext;
}
@@ -1673,7 +1726,6 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
}
#undef _VIRTUALX
-#undef _VIDEOSIZE
/* Update the ScrnInfoRec parameters */
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.SOLX86 b/xc/programs/Xserver/hw/xfree86/doc/README.SOLX86
deleted file mode 100644
index 41d6ff236..000000000
--- a/xc/programs/Xserver/hw/xfree86/doc/README.SOLX86
+++ /dev/null
@@ -1,231 +0,0 @@
- Information for Solaris for x86 Users
-
- David Holland
-
- 25 Feb 1998
-
-1. What is XFree86
-
-XFree86 is a port of X11R6.3 that supports several versions of Intel-based
-Unix. It is derived from X386 1.2 which was the X server distributed with
-X11R5. This release consists of many new features and performance improve-
-ments as well as many bug fixes. The release is available as source patches
-against the X Consortium code, as well as binary distributions for many
-architectures.
-
-The sources for XFree86 are available by anonymous ftp from:
-
- ftp://ftp.XFree86.org/pub/XFree86/current
-
-Solaris binaries for XFree86 are available for anonymous ftp from:
-
- ftp://ftp.XFree86.org/pub/XFree86/current/binaries/Solaris
-
-2. Solaris for x86, versions on which XFree86 3.3.3 has been tested
-
-XFree86 3.3.2 has been actively tested on:
-
- o Solaris 2.5.1 for x86
-
- o Solaris 2.6 for x86
-
-3. The VT-switching sub-system in Solaris x86
-
-The virtual terminal sub-system is a undocumented, and unsupported feature of
-Solaris x86. Therefore if you use Virtual Terminals, you do so at YOUR OWN
-RISK.
-
-The virtual terminals of Solaris work basically the same way as most other
-Intel based SVR4 VT sub-systems. However, there are a number of limitations
-documented below.
-
-First, if you are running a Solaris 2.4 x86 system, and you want VT's, you
-will have to create the necessary devices first, so become root.
-
-First verify the chanmux device driver's major number is 100:
-
- # grep -i chanmux /etc/name_to_major
- chanmux 100
- #
-
-If the number after 'chanmux' is anything but 100, I would suggest you imme-
-diately abort your attempt to create virtual terminals, and learn to live
-without them.
-
-However, if it is 100, then as root type the following commands to create the
-maximum allowable number of virtual terminals.
-
- # cd /dev
- # mknod vt01 c 100 1
- # mknod vt02 c 100 2
- # mknod vt03 c 100 3
- # mknod vt04 c 100 4
- # mknod vt05 c 100 5
- # mknod vt06 c 100 6
- # mknod vt07 c 100 7
-
-There is no need for a reconfiguration boot.
-
-Secondly, for both 2.1, and 2.4 x86 systems, add a few lines to the inittab
-to enable logins on them.
-
-(Note, do NOT make a mistake here, you could lock yourself out of the system)
-
- --------------------->Snip Snip<-----------------------------------------------
- v1:234:respawn:/usr/lib/saf/ttymon -g -h -p "`uname -n` VT01 login: " -T AT386 -d /dev/vt01 -l console
- v2:234:respawn:/usr/lib/saf/ttymon -g -h -p "`uname -n` VT02 login: " -T AT386 -d /dev/vt02 -l console
- v3:234:respawn:/usr/lib/saf/ttymon -g -h -p "`uname -n` VT03 login: " -T AT386 -d /dev/vt03 -l console
- v4:234:respawn:/usr/lib/saf/ttymon -g -h -p "`uname -n` VT04 login: " -T AT386 -d /dev/vt04 -l console
- ---------------------->End Here<-----------------------------------------------
-
-These four lines enable four VT's on Alt-SysReq-F1 through Alt-SysReq-F4.
-
-Then execute the command 'init q' to immediately enable the virtual termi-
-nals.
-
-The keys used for VT switching are as follows:
-
- Alt-SysReq-F1 through Alt-SysReq-F7 enable VT screens 1-7 respec-
- tively (if the VT is active).
-
- Alt-SysReq-n enables the next active VT screen.
-
- Alt-SysReq-p enables the previous active VT screen.
-
- Alt-SysReq-h returns to the console.
-
-If you are using virtual terminals, you must leave at least one free for use
-by the Xserver.
-
-Limitations of the virtual terminal sub-system under Solaris x86:
-
-There are only a total of 8 available VT's (7 normal VT's + 1 console) not
-the usual 15. If you have all 8 allocated, and you attempt to allocate a
-additional VT you will panic the system. (This bug is worked around in the
-Solaris XFree86 Xserver.)
-
-From a programming stand point, they work pretty much as documented in the
-AT&T Unix System V/386 Release 4 Integrated Software Development Guide, how-
-ever a number of ioctl() calls are broken.
-
-4. Notes for building XFree86 on Solaris x86
-
- 1. The majority of all modifications you will need to make are now in
- ~xc/config/cf/xf86site.def.
-
- 2. Both Gcc, and ProWorks are supported by XFree86. Gcc-2.5.8 or
- gcc-2.7.2.3 are suggested, Gcc-2.6.0 is known not to work. You also
- need to set HasGcc2 correctly in ~xc/config/cf/xf86site.def.
-
- You should also make certain your version of GCC predefines `sun'.
- 2.4.5 is known NOT to by default. If needed edit /usr/local/lib/gcc-
- lib/*/*/specs, and modify the *predefines: line.
-
- Note: A Threaded Xlib compiled with GCC has subtle problems. It'll
- work 98% of the time, however clients will occasionally exhibit strange
- hangs. Most notably image viewers such as xv-3.10 exhibit this problem.
-
- It is recommended that you set ThreadedX in ~xc/config/cf/sun.cf to NO,
- if you are using GCC. ProWorks does not have this problem.
-
- 3. To build XFree86 with gcc you need gcc and (optionally) c++filt from
- GNU binutils. Don't install gas or ld from GNU binutils, use the one
- provided by Sun.
-
- With XFree86 3.3.2, you will need to setup a /opt/SUNWspro/bin direc-
- tory containing symbolic links named cc, CC, and c++filt pointing
- respectively to the actual gcc, g++ and c++filt commands.
-
- 4. If you don't have c++filt or if you have troubles in making World with
- c++filt, you need to set UseExportLists to NO in ~xc/con-
- fig/cf/host.def.
-
- 5. If you are using ProWorks to compile the XFree86 distribution, you need
- to modify your PATH appropriately so the ProWorks tools are available.
- Normally, they should be in /opt/SUNWspro/bin
-
- 6. You MUST put /usr/ccs/bin at the front of your PATH. There are known
- problems with some GNU replacements for the utilities found there. So
- the /usr/ccs/bin versions of these programs must be found before any
- other possible GNU versions. (Most notably GNU 'ar' does not work dur-
- ing the build).
-
- 7. If you wish to use the "memory aperture" feature of the S3, and Mach32
- servers, you need to compile, and install the Solaris x86 aperture
- driver for memory mapped I/O support. This driver is REQUIRED for the
- I128, P9000 and Mach 64 servers.
-
- You need to set HasSolx86apertureDrv to YES in ~xc/con-
- fig/cf/xf86site.def.
-
- to enable the aperture driver.
-
- Under Solaris 2.5 and later, there's a system driver (/dev/xsvc that
- provides this functionality. It will be detected automatically by the
- server, so you don't need to install the driver.
-
- For Solaris 2.1 and 2.4, the source for this driver is included in
- ~xc/programs/Xserver/hw/xfree86/etc/apSolx86.shar. Building, and
- installing the driver is relatively straight forward. Please read its
- accompanying README file.
-
-5. Notes for running XFree86 on Solaris x86
-
- 1. If you have not made the Virtual Terminal devices, you will need to
- specify the terminal device to run the Xserver on. The correct device
- is vt00 so your xinit command would look like so:
-
- xinit -- vt00
-
- If you have made the virtual terminal devices you do not need to spec-
- ify the VT to run the Xserver on.
-
- To be able to run XF86Setup, you must at least create /dev/vt01. Other-
- wise XF86Setup won't start.
-
- 2. For Solaris you will probably want to set your LD_LIBRARY_PATH to
- /usr/X11R6/lib:/usr/openwin/lib:/usr/dt/lib. Including /usr/X11R6/lib
- in your LD_LIBRARY_PATH is probably not necessary, however it doesn't
- hurt. :)
-
- Including /usr/openwin/lib in the LD_LIBRARY_PATH is recommended
- because some Sun supplied binaries were not compiled with LD_RUN_PATH
- set properly at compile time.
-
- Motif and CDE applications may require /usr/dt/lib in your
- LD_LIBRARY_PATH too.
-
- 3. Xqueue is NOT supported under Solaris. The includes necessary for
- Xqueue are available, however the driver does not seem to be in the
- kernel. (Go figure)
-
- 4. If you want to use xdm with Solaris, extract the files from the shar
- file in /usr/X11R6/lib/X11/etc/XdmConf.svr4 into a temporary directory.
- The README file tells where the individual files need to be installed.
- Be sure to read through each file and make any site-specific changes
- that you need.
-
-6. Known bugs, and work arounds with Solaris x86
-
- 1. The Solaris 2.1 for x86 OpenWindows filemgr does not work against a
- X11R5 Xserver, it probably will also not work against a X11R6 Xserver.
- Attempting to 'Drag and Drop' a file causes the filemgr to abort with a
- 'X error'
-
- Solaris 2.4 does not have this problem.
-
- There is no known work around.
-
-7. Bug Notification
-
-Bug reports need to be sent to XFree86@XFree86.org, or posted to the
-comp.windows.x.i386unix newsgroup. Questions or comments about the Solaris
-support, or the Solaris distribution need to be made to davidh@use.com, or
-danson@lgc.com.
-
- Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/SOLX86.sgml,v 3.15 1999/08/23 06:38:52 dawes Exp $
-
- $XConsortium: SOLX86.sgml /main/7 1996/10/28 05:43:28 kaleb $
-
-
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.SOLX86,v 3.27 2000/03/01 01:48:13 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/SOLX86.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/SOLX86.sgml
deleted file mode 100644
index 270c3030e..000000000
--- a/xc/programs/Xserver/hw/xfree86/doc/sgml/SOLX86.sgml
+++ /dev/null
@@ -1,327 +0,0 @@
-<!DOCTYPE linuxdoc PUBLIC "-//XFree86//DTD linuxdoc//EN">
-<article>
-
-<!-- Title information -->
-
-<title>Information for Solaris for x86 Users
-<author>David Holland
-<date>25 Feb 1998
-
-<!-- Table of contents -->
-<toc>
-
-<!-- Begin the document -->
-
-
-<!--Contents
---------
-
- 1) What is XFree86
- 2) Solaris versions on which XFree86 has been tested.
- 3) The VT-switching sub-system in Solaris x86
- 4) Various notes for building XFree86 on Solaris x86
- 5) Known bugs, and work arounds.
- -->
-
-
-<sect>What is XFree86<p>
-
- XFree86 is a port of X11R6.3 that supports several versions of
- Intel-based Unix. It is derived from X386 1.2 which was the X server
- distributed with X11R5. This release consists of many new features
- and
- performance improvements as well as many bug fixes. The release is
- available as source patches against the X Consortium code, as well as
- binary distributions for many architectures.
-<p>
-The sources for XFree86 are available by anonymous ftp from:
-<quote>
- <htmlurl name="ftp://ftp.XFree86.org/pub/XFree86/current"
- url="ftp://ftp.XFree86.org/pub/XFree86/current">
-</quote>
-Solaris binaries for XFree86 are available for anonymous ftp from:
-<quote>
- <htmlurl name="ftp://ftp.XFree86.org/pub/XFree86/current/binaries/Solaris"
- url="ftp://ftp.XFree86.org/pub/XFree86/current/binaries/Solaris"><p>
-</quote>
-
-<sect> Solaris for x86, versions on which XFree86 3.3.3 has been tested<p>
-
-XFree86 3.3.2 has been actively tested on:
-<itemize>
-<item>Solaris 2.5.1 for x86
-<item>Solaris 2.6 for x86
-</itemize>
-
-<sect>The VT-switching sub-system in Solaris x86<p>
-
- The virtual terminal sub-system is a undocumented, and unsupported
- feature of Solaris x86. Therefore if you use Virtual Terminals, you
- do so at <bf>YOUR OWN RISK</bf>.<p>
-
- The virtual terminals of Solaris work basically the same way as
- most other Intel based SVR4 VT sub-systems. However, there are a
- number of limitations documented below.<p>
-
- First, if you are running a Solaris 2.4 x86 system, and you want VT's,
- you will have to create the necessary devices first, so become root.<p>
-
- First verify the chanmux device driver's major number is 100:<p>
-<tscreen><verb>
- # grep -i chanmux /etc/name_to_major
- chanmux 100
- #
-</verb></tscreen>
- If the number after 'chanmux' is anything but 100, I would suggest
- you immediately abort your attempt to create virtual terminals, and
- learn to live without them.<p>
-
- However, if it is 100, then as root type the following commands to
- create the maximum allowable number of virtual terminals.<p>
-<tscreen><verb>
- # cd /dev
- # mknod vt01 c 100 1
- # mknod vt02 c 100 2
- # mknod vt03 c 100 3
- # mknod vt04 c 100 4
- # mknod vt05 c 100 5
- # mknod vt06 c 100 6
- # mknod vt07 c 100 7
-</verb></tscreen>
- There is no need for a reconfiguration boot.<p>
-
- Secondly, for both 2.1, and 2.4 x86 systems, add a few lines to the
- <tt/inittab/ to enable logins on them.<p>
-
-(<bf>Note</bf>, do <bf>NOT</bf> make a mistake here, you could
-lock yourself out of the system)<p>
-<verb>
---------------------->Snip Snip<-----------------------------------------------
-v1:234:respawn:/usr/lib/saf/ttymon -g -h -p "`uname -n` VT01 login: " -T AT386 -d /dev/vt01 -l console
-v2:234:respawn:/usr/lib/saf/ttymon -g -h -p "`uname -n` VT02 login: " -T AT386 -d /dev/vt02 -l console
-v3:234:respawn:/usr/lib/saf/ttymon -g -h -p "`uname -n` VT03 login: " -T AT386 -d /dev/vt03 -l console
-v4:234:respawn:/usr/lib/saf/ttymon -g -h -p "`uname -n` VT04 login: " -T AT386 -d /dev/vt04 -l console
----------------------->End Here<-----------------------------------------------
-</verb>
- These four lines enable four VT's on Alt-SysReq-F1 through
- Alt-SysReq-F4.<p>
-
- Then execute the command '<tt>init q</tt>' to immediately
- enable the virtual
- terminals.<p>
-
-The keys used for VT switching are as follows:<p>
-
-<quote>
- <tt>Alt-SysReq-F1</tt> through <tt>Alt-SysReq-F7</tt>
- enable VT screens 1-7 respectively
- (if the VT is active).<p>
- <tt>Alt-SysReq-n</tt> enables the next active VT screen.<p>
- <tt>Alt-SysReq-p</tt> enables the previous active VT screen.<p>
- <tt>Alt-SysReq-h</tt> returns to the console.<p>
-</quote>
- If you are using virtual terminals, you must leave at least one free
- for use by the Xserver.<p>
-
-
-Limitations of the virtual terminal sub-system under Solaris x86:<p>
-
- There are only a total of 8 available VT's (7 normal VT's + 1 console)
- not the usual 15. If you have all 8 allocated, and you attempt to
- allocate a additional VT you will panic the system. (This bug is
- worked around in the Solaris XFree86 Xserver.)<p>
-
- From a programming stand point, they work pretty much as documented in
- the AT&amp;T Unix System V/386 Release 4 Integrated Software
- Development
- Guide, however a number of <tt>ioctl()</tt> calls are broken.<p>
-
-
-<sect>Notes for building XFree86 on Solaris x86<p>
-
-<enum>
-<item>The majority of all modifications you will need to make are now in
- <tt>~xc/config/cf/xf86site.def</tt>.
-
-<!--
- except one. You will need to set OSName,
- and OSMinorVersion correctly in <tt>~xc/config/cf/sun.cf</tt>.
-
-Under Solaris 2.1 for x86, <tt>sun.cf</tt> needs to read
-(near the top of the file)
-
-<verb> #ifdef SVR4Architecture
- #ifdef i386Architecture
- #define OSName SunOS 5.1 x86
- XCOMM operating system: OSName
- #define OSMajorVersion 5
- #define OSMinorVersion 1
-</verb>
-
-Under Solaris 2.4 for x86, <tt>sun.cf</tt> needs to read
-(near the top of the file)
-
-<verb> #ifdef SVR4Architecture
- #ifdef i386Architecture
- #define OSName SunOS 5.4 x86
- XCOMM operating system: OSName
- #define OSMajorVersion 5
- #define OSMinorVersion 4
-</verb>
--->
-
-<item>Both Gcc, and ProWorks are supported by XFree86. Gcc-2.5.8 or
- gcc-2.7.2.3 are
- suggested, Gcc-2.6.0 is known not to work. You also need to set
- HasGcc2 correctly in <tt>~xc/config/cf/xf86site.def</tt>.
-
- You should also make certain your version of GCC predefines `sun'.
- 2.4.5 is known NOT to by default. If needed edit
- <tt>/usr/local/lib/gcc-lib/*/*/specs</tt>, and modify the
- <tt>*predefines:</tt> line.<p>
-
- Note: A Threaded Xlib compiled with GCC has subtle problems.
- It'll work 98&percnt; of the time, however clients will occasionally
- exhibit strange hangs. Most notably image viewers such as
- xv-3.10 exhibit this problem.<p>
-
- It is recommended that you set ThreadedX in
- <tt>~xc/config/cf/sun.cf</tt> to NO, if you are using GCC.
- ProWorks does not have this problem.
-
-<item> To build XFree86 with gcc you need gcc and (optionally)
- c++filt from GNU binutils. Don't install gas or ld from GNU
- binutils, use the one provided by Sun.
- <p>
- With XFree86 3.3.2, you will need to setup a /opt/SUNWspro/bin
- directory containing symbolic links named <tt/cc/, <tt/CC/, and
- <tt/c++filt/ pointing respectively to the actual <tt/gcc/,
- <tt/g++/ and <tt/c++filt/ commands.
-
-<item>If you don't have c++filt or if you have troubles in making
- World with c++filt, you need to set UseExportLists to NO in
- <tt>~xc/config/cf/host.def</tt>.<p>
-
-<!--
- If you use c++filt, you need to check the definition of PATH in
- <tt>~xc/config/util/elistgen.sun</tt>.<p>
--->
-
-<item>If you are using ProWorks to compile the XFree86 distribution, you
- need to modify your PATH appropriately so the ProWorks tools are
- available. Normally, they should be in <tt>/opt/SUNWspro/bin</tt><p>
-
-
-<item>You <bf>MUST</bf> put <tt>/usr/ccs/bin</tt>
- at the front of your PATH. There are known
- problems with some GNU replacements for the utilities found there. So
- the <tt>/usr/ccs/bin</tt> versions of these programs
-must be found before any
- other possible GNU versions. (Most notably GNU '<tt/ar/' does not work
- during the build).<p>
-
-<item>If you wish to use the "memory aperture" feature of the S3, and Mach32
- servers, you need to compile, and install the Solaris x86 aperture
- driver for memory mapped I/O support. This driver is <bf>REQUIRED</bf>
- for the I128, P9000 and Mach 64 servers.<p>
-
- You need to set HasSolx86apertureDrv to YES in
- <tt>~xc/config/cf/xf86site.def</tt>.<p> to enable the aperture
- driver.
-
- Under Solaris 2.5 and later, there's a system driver
- (<tt>/dev/xsvc</tt> that provides this functionality. It will
- be detected automatically by the server, so you don't need to
- install the driver.
-
- For Solaris 2.1 and 2.4, the source for this driver is included in
- <tt>~xc/programs/Xserver/hw/xfree86/etc/apSolx86.shar</tt>.
- Building, and
- installing the driver is relatively straight forward. Please read
- its accompanying README file.<p>
-
-
-
-</enum>
-<sect> Notes for running XFree86 on Solaris x86<p>
-
-<enum>
-<item>If you have not made the Virtual Terminal devices, you will need to
- specify the terminal device to run the Xserver on. The correct
- device is vt00 so your <tt>xinit</tt> command would look like so:<p>
-<tscreen><verb>
- xinit -- vt00
-</verb></tscreen>
- If you have made the virtual terminal devices you do not need to
- specify the VT to run the Xserver on.<p>
-
- To be able to run XF86Setup, you must at least create
- /dev/vt01. Otherwise XF86Setup won't start.
-
-<item>For Solaris you will probably want to set your LD_LIBRARY_PATH to
- <tt>/usr/X11R6/lib:/usr/openwin/lib:/usr/dt/lib</tt>.
- Including <tt>/usr/X11R6/lib</tt> in your
- LD_LIBRARY_PATH is probably not necessary, however it doesn't hurt. :)
-<p>
- Including <tt>/usr/openwin/lib</tt> in the LD_LIBRARY_PATH is
- recommended
- because some Sun supplied binaries were not compiled with LD_RUN_PATH
- set properly at compile time.<p>
-<p>
- Motif and CDE applications may require <tt>/usr/dt/lib</tt> in your
- LD_LIBRARY_PATH too.
-
-<item>Xqueue is <bf>NOT</bf> supported under Solaris.
- The includes necessary for
- Xqueue are available, however the driver does not seem to be in the
- kernel. (Go figure)<p>
-
-
-<item>If you want to use xdm with Solaris, extract the files from the shar
- file in <tt>/usr/X11R6/lib/X11/etc/XdmConf.svr4</tt> into a temporary
- directory. The <tt>README</tt> file tells where
- the individual files need to
- be installed. Be sure to read through each file and make any
- site-specific changes that you need.<p>
-
-</enum>
-
-<sect> Known bugs, and work arounds with Solaris x86<p>
-
-<enum>
-
-<item>The Solaris 2.1 for x86 OpenWindows filemgr does not work against a
- X11R5 Xserver, it probably will also not work against a X11R6
-Xserver.
- Attempting to 'Drag and Drop' a file causes the filemgr to abort
- with a 'X error'<p>
-
- Solaris 2.4 does not have this problem.<p>
-
- There is no known work around.<p>
-
-<!--
-<item>It has been reported that the aperture driver doesn't work
- under Solaris 2.5.1. It probably doesn't work either under
- 2.5.
--->
-
-</enum>
-<sect> Bug Notification<p>
-
- Bug reports need to be sent to <bf/XFree86@XFree86.org/, or posted to
- the comp.windows.x.i386unix newsgroup. Questions or comments about
- the Solaris support, or the Solaris distribution need to be made to
- <it/davidh@use.com/, or <it/danson@lgc.com./<p>
-
-
-<verb>
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/SOLX86.sgml,v 3.15 1999/08/23 06:38:52 dawes Exp $
-
-
-
-
-
-$XConsortium: SOLX86.sgml /main/7 1996/10/28 05:43:28 kaleb $
-</verb>
-</article>
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile
index 7bf7262fb..d5c7175b3 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile
@@ -42,12 +42,6 @@ MODOBJS4 = radeon_misc.o
#endif
-/* XXX Temporary: for now DRM for BSD/Radeon doesn't build. */
-#if !defined(LinuxArchitecture)
-#undef BuildXF86DRI
-#define BuildXF86DRI NO
-#endif
-
#if BuildXF86DRI
DRISRCS3 = r128_dri.c
@@ -192,6 +186,7 @@ INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(XF86SRC) \
-I$(XF86SRC)/vgahw -I$(XF86SRC)/fbdevhw \
-I$(SERVERSRC)/cfb -I$(SERVERSRC)/mfb \
-I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \
+ -I$(SERVERSRC)/miext/shadow \
-I$(SERVERSRC)/render -I$(SERVERSRC)/Xext -I$(SERVERSRC)/include \
$(DRIINCLUDES) -I$(FONTINCSRC) -I$(EXTINCSRC) -I$(XINCLUDESRC)
#endif
@@ -316,6 +311,7 @@ InstallDriverSDKNonExecFile(r128_reg.h,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(r128_sarea.h,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(r128_version.h,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(r128_video.c,$(DRIVERSDKDIR)/drivers/ati)
+InstallDriverSDKNonExecFile(r128_common.h,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(radeon.h,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(radeon_accel.c,$(DRIVERSDKDIR)/drivers/ati)
@@ -325,6 +321,7 @@ InstallDriverSDKNonExecFile(radeon_dri.c,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(radeon_dri.h,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(radeon_dripriv.h,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(radeon_driver.c,$(DRIVERSDKDIR)/drivers/ati)
+InstallDriverSDKNonExecFile(radeon_macros.h,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(radeon_misc.c,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(radeon_probe.c,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(radeon_probe.h,$(DRIVERSDKDIR)/drivers/ati)
@@ -332,6 +329,7 @@ InstallDriverSDKNonExecFile(radeon_reg.h,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(radeon_sarea.h,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(radeon_version.h,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(radeon_video.c,$(DRIVERSDKDIR)/drivers/ati)
+InstallDriverSDKNonExecFile(radeon_common.h,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKObjectModule(ati,$(DRIVERSDKMODULEDIR),drivers)
InstallDriverSDKObjectModule(atimisc,$(DRIVERSDKMODULEDIR),drivers)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c
index fce12713b..da05fb603 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c
@@ -76,7 +76,7 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen)
__GLXvisualConfig *pConfigs = 0;
R128ConfigPrivPtr pR128Configs = 0;
R128ConfigPrivPtr *pR128ConfigPtrs = 0;
- int i, accum, stencil;
+ int i, accum, stencil, db;
switch (info->CurrentLayout.pixel_code) {
case 8: /* 8bpp mode is not support */
@@ -89,11 +89,13 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen)
#define R128_USE_ACCUM 1
#define R128_USE_STENCIL 1
+#define R128_USE_DB 1
case 16:
numConfigs = 1;
if (R128_USE_ACCUM) numConfigs *= 2;
if (R128_USE_STENCIL) numConfigs *= 2;
+ if (R128_USE_DB) numConfigs *= 2;
if (!(pConfigs
= (__GLXvisualConfig*)xcalloc(sizeof(__GLXvisualConfig),
@@ -115,7 +117,8 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen)
}
i = 0;
- for (accum = 0; accum <= R128_USE_ACCUM; accum++) {
+ for (db = 0; db <= R128_USE_DB; db++) {
+ for (accum = 0; accum <= R128_USE_ACCUM; accum++) {
for (stencil = 0; stencil <= R128_USE_STENCIL; stencil++) {
pR128ConfigPtrs[i] = &pR128Configs[i];
@@ -141,7 +144,10 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen)
pConfigs[i].accumBlueSize = 0;
pConfigs[i].accumAlphaSize = 0;
}
- pConfigs[i].doubleBuffer = TRUE;
+ if (db)
+ pConfigs[i].doubleBuffer = TRUE;
+ else
+ pConfigs[i].doubleBuffer = FALSE;
pConfigs[i].stereo = FALSE;
pConfigs[i].bufferSize = 16;
pConfigs[i].depthSize = 16;
@@ -164,6 +170,7 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen)
pConfigs[i].transparentIndex = 0;
i++;
}
+ }
}
break;
@@ -171,6 +178,7 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen)
numConfigs = 1;
if (R128_USE_ACCUM) numConfigs *= 2;
if (R128_USE_STENCIL) numConfigs *= 2;
+ if (R128_USE_DB) numConfigs *= 2;
if (!(pConfigs
= (__GLXvisualConfig*)xcalloc(sizeof(__GLXvisualConfig),
@@ -192,7 +200,8 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen)
}
i = 0;
- for (accum = 0; accum <= R128_USE_ACCUM; accum++) {
+ for (db = 0; db <= R128_USE_DB; db++) {
+ for (accum = 0; accum <= R128_USE_ACCUM; accum++) {
for (stencil = 0; stencil <= R128_USE_STENCIL; stencil++) {
pR128ConfigPtrs[i] = &pR128Configs[i];
@@ -218,7 +227,10 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen)
pConfigs[i].accumBlueSize = 0;
pConfigs[i].accumAlphaSize = 0;
}
- pConfigs[i].doubleBuffer = TRUE;
+ if (db)
+ pConfigs[i].doubleBuffer = TRUE;
+ else
+ pConfigs[i].doubleBuffer = FALSE;
pConfigs[i].stereo = FALSE;
pConfigs[i].bufferSize = 24;
if (stencil) {
@@ -243,6 +255,7 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen)
pConfigs[i].transparentIndex = 0;
i++;
}
+ }
}
break;
}
@@ -767,6 +780,9 @@ static int R128DRIKernelInit(R128InfoPtr info, ScreenPtr pScreen)
{
drmR128Init drmInfo;
+ memset( &drmInfo, 0, sizeof(drmR128Init) );
+
+ drmInfo.func = DRM_R128_INIT_CCE;
drmInfo.sarea_priv_offset = sizeof(XF86DRISAREARec);
drmInfo.is_pci = info->IsPCI;
drmInfo.cce_mode = info->CCEMode;
@@ -794,7 +810,9 @@ static int R128DRIKernelInit(R128InfoPtr info, ScreenPtr pScreen)
drmInfo.buffers_offset = info->bufHandle;
drmInfo.agp_textures_offset = info->agpTexHandle;
- if (drmR128InitCCE(info->drmFD, &drmInfo) < 0) return FALSE;
+ if (drmCommandWrite(info->drmFD, DRM_R128_INIT,
+ &drmInfo, sizeof(drmR128Init)) < 0)
+ return FALSE;
return TRUE;
}
@@ -838,6 +856,35 @@ static Bool R128DRIBufInit(R128InfoPtr info, ScreenPtr pScreen)
return TRUE;
}
+static void R128DRIIrqInit(R128InfoPtr info, ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+
+ if (!info->irq) {
+ info->irq = drmGetInterruptFromBusID(
+ info->drmFD,
+ ((pciConfigPtr)info->PciInfo->thisCard)->busnum,
+ ((pciConfigPtr)info->PciInfo->thisCard)->devnum,
+ ((pciConfigPtr)info->PciInfo->thisCard)->funcnum);
+
+ if((drmCtlInstHandler(info->drmFD, info->irq)) != 0) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "[drm] failure adding irq handler, "
+ "there is a device already using that irq\n"
+ "[drm] falling back to irq-free operation\n");
+ info->irq = 0;
+ } else {
+ unsigned char *R128MMIO = info->MMIO;
+ info->gen_int_cntl = INREG( R128_GEN_INT_CNTL );
+ }
+ }
+
+ if (info->irq)
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "[drm] dma control initialized, using IRQ %d\n",
+ info->irq);
+}
+
/* Initialize the CCE state, and start the CCE (if used by the X server) */
static void R128DRICCEInit(ScrnInfoPtr pScrn)
{
@@ -994,6 +1041,42 @@ Bool R128DRIScreenInit(ScreenPtr pScreen)
return FALSE;
}
+ /* Check the DRM lib version.
+ drmGetLibVersion was not supported in version 1.0, so check for
+ symbol first to avoid possible crash or hang.
+ */
+ if (xf86LoaderCheckSymbol("drmGetLibVersion")) {
+ version = drmGetLibVersion(info->drmFD);
+ }
+ else {
+ /* drmlib version 1.0.0 didn't have the drmGetLibVersion
+ entry point. Fake it by allocating a version record
+ via drmGetVersion and changing it to version 1.0.0
+ */
+ version = drmGetVersion(info->drmFD);
+ version->version_major = 1;
+ version->version_minor = 0;
+ version->version_patchlevel = 0;
+ }
+
+ if (version) {
+ if (version->version_major != 1 ||
+ version->version_minor < 1) {
+ /* incompatible drm library version */
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] R128DRIScreenInit failed because of a version mismatch.\n"
+ "[dri] libdrm.a module version is %d.%d.%d but version 1.1.x is needed.\n"
+ "[dri] Disabling DRI.\n",
+ version->version_major,
+ version->version_minor,
+ version->version_patchlevel);
+ drmFreeVersion(version);
+ R128DRICloseScreen(pScreen);
+ return FALSE;
+ }
+ drmFreeVersion(version);
+ }
+
/* Check the r128 DRM version */
version = drmGetVersion(info->drmFD);
if (version) {
@@ -1082,6 +1165,9 @@ Bool R128DRIFinishScreenInit(ScreenPtr pScreen)
return FALSE;
}
+ /* Initialize IRQ */
+ R128DRIIrqInit(info, pScreen);
+
/* Initialize and start the CCE if required */
R128DRICCEInit(pScrn);
@@ -1128,12 +1214,18 @@ void R128DRICloseScreen(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
R128InfoPtr info = R128PTR(pScrn);
+ drmR128Init drmInfo;
/* Stop the CCE if it is still in use */
if (info->directRenderingEnabled) {
R128CCE_STOP(pScrn, info);
}
+ if (info->irq) {
+ drmCtlUninstHandler(info->drmFD);
+ info->irq = 0;
+ }
+
/* De-allocate vertex buffers */
if (info->buffers) {
drmUnmapBufs(info->buffers);
@@ -1141,7 +1233,10 @@ void R128DRICloseScreen(ScreenPtr pScreen)
}
/* De-allocate all kernel resources */
- drmR128CleanupCCE(info->drmFD);
+ memset(&drmInfo, 0, sizeof(drmR128Init));
+ drmInfo.func = DRM_R128_CLEANUP_CCE;
+ drmCommandWrite(info->drmFD, DRM_R128_INIT,
+ &drmInfo, sizeof(drmR128Init));
/* De-allocate all AGP resources */
if (info->agpTex) {
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c
index 02b4a847a..d59b53027 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c
@@ -284,18 +284,16 @@ static const char *drmSymbols[] = {
"drmAgpUnbind",
"drmAgpVendorId",
"drmAvailable",
+ "drmCommandNone",
+ "drmCommandRead",
+ "drmCommandWrite",
+ "drmCommandWriteRead",
"drmFreeVersion",
+ "drmGetLibVersion",
"drmGetVersion",
"drmMap",
"drmMapBufs",
"drmDMA",
- "drmR128CleanupCCE",
- "drmR128InitCCE",
- "drmR128ResetCCE",
- "drmR128StartCCE",
- "drmR128StopCCE",
- "drmR128WaitForIdleCCE",
- "drmR128FlushIndirectBuffer",
"drmScatterGatherAlloc",
"drmScatterGatherFree",
"drmUnmap",
@@ -2352,10 +2350,6 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
}
}
- /* Backing store setup */
- miInitializeBackingStore(pScreen);
- xf86SetBackingStore(pScreen);
-
/* Set Silken Mouse */
xf86SetSilkenMouse(pScreen);
@@ -2375,6 +2369,10 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
info->accelOn = FALSE;
}
+ /* Backing store setup */
+ miInitializeBackingStore(pScreen);
+ xf86SetBackingStore(pScreen);
+
/* DGA setup */
R128DGAInit(pScreen);
@@ -3442,6 +3440,11 @@ Bool R128EnterVT(int scrnIndex, int flags)
#ifdef XF86DRI
if (info->directRenderingEnabled) {
+ if (info->irq) {
+ /* Need to make sure interrupts are enabled */
+ unsigned char *R128MMIO = info->MMIO;
+ OUTREG(R128_GEN_INT_CNTL, info->gen_int_cntl);
+ }
R128CCE_START(pScrn, info);
DRIUnlock(pScrn->pScreen);
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h
index ac461d0d0..d99e40283 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h
@@ -48,7 +48,9 @@
#ifndef _R128_REG_H_
#define _R128_REG_H_
+#ifdef XFree86Module
#include "xf86_ansic.h"
+#endif
#include "compiler.h"
/* Memory mapped register access macros */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h
index 54aed36f2..983d75ef9 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h
@@ -31,7 +31,7 @@
* Authors:
* Kevin E. Martin <martin@xfree86.org>
* Rickard E. Faith <faith@valinux.com>
- * Alan Hourihane <ahourihane@valinux.com>
+ * Alan Hourihane <alanh@fairlite.demon.co.uk>
*
*/
@@ -66,9 +66,10 @@
#include "picturestr.h"
#endif
-#define RADEON_DEBUG 0 /* Turn off debugging output */
-#define RADEON_TIMEOUT 2000000 /* Fall out of wait loops after this count */
-#define RADEON_MMIOSIZE 0x80000
+#define RADEON_DEBUG 0 /* Turn off debugging output */
+#define RADEON_IDLE_RETRY 16 /* Fall out of idle loops after this count */
+#define RADEON_TIMEOUT 2000000 /* Fall out of wait loops after this count */
+#define RADEON_MMIOSIZE 0x80000
#define RADEON_VBIOS_SIZE 0x00010000
#define RADEON_USE_RMX 0x80000000 /* mode flag for using RMX
@@ -394,6 +395,7 @@ typedef struct {
RADEONFBLayout CurrentLayout;
#ifdef XF86DRI
+ Bool noBackBuffer;
Bool directRenderingEnabled;
DRIInfoPtr pDRIInfo;
int drmFD;
@@ -412,12 +414,16 @@ typedef struct {
unsigned char *PCI; /* Map */
Bool depthMoves; /* Enable depth moves -- slow! */
+ Bool allowPageFlip; /* Enable 3d page flipping */
+ Bool have3DWindows; /* Are there any 3d clients? */
+ int drmMinor;
drmSize agpSize;
drmHandle agpMemHandle; /* Handle from drmAgpAlloc */
unsigned long agpOffset;
unsigned char *AGP; /* Map */
int agpMode;
+ int agpFastWrite;
CARD32 pciCommand;
@@ -485,6 +491,12 @@ typedef struct {
CARD32 dst_pitch_offset;
+ /* offscreen memory management */
+ int backLines;
+ FBAreaPtr backArea;
+ int depthTexLines;
+ FBAreaPtr depthTexArea;
+
/* Saved scissor values */
CARD32 sc_left;
CARD32 sc_right;
@@ -496,16 +508,25 @@ typedef struct {
CARD32 aux_sc_cntl;
+ int irq;
+
#ifdef PER_CONTEXT_SAREA
- int perctx_sarea_size;
+ int perctx_sarea_size;
#endif
#endif
+ /* XVideo */
XF86VideoAdaptorPtr adaptor;
void (*VideoTimerCallback)(ScrnInfoPtr, Time);
+ FBLinearPtr videoLinear;
int videoKey;
+
+ /* general */
Bool showCache;
OptionInfoPtr Options;
+#ifdef XFree86LOADER
+ XF86ModReqInfo xaaReq;
+#endif
} RADEONInfoRec, *RADEONInfoPtr;
#define RADEONWaitForFifo(pScrn, entries) \
@@ -521,6 +542,9 @@ extern void RADEONWaitForIdleMMIO(ScrnInfoPtr pScrn);
extern void RADEONWaitForIdleCP(ScrnInfoPtr pScrn);
#endif
+extern void RADEONDoAdjustFrame(ScrnInfoPtr pScrn, int x, int y,
+ int clone);
+
extern void RADEONEngineReset(ScrnInfoPtr pScrn);
extern void RADEONEngineFlush(ScrnInfoPtr pScrn);
extern void RADEONEngineRestore(ScrnInfoPtr pScrn);
@@ -549,11 +573,12 @@ extern Bool RADEONDRIFinishScreenInit(ScreenPtr pScreen);
extern drmBufPtr RADEONCPGetBuffer(ScrnInfoPtr pScrn);
extern void RADEONCPFlushIndirect(ScrnInfoPtr pScrn, int discard);
extern void RADEONCPReleaseIndirect(ScrnInfoPtr pScrn);
+extern int RADEONCPStop(ScrnInfoPtr pScrn, RADEONInfoPtr info);
#define RADEONCP_START(pScrn, info) \
do { \
- int _ret = drmRadeonStartCP(info->drmFD); \
+ int _ret = drmCommandNone(info->drmFD, DRM_RADEON_CP_START); \
if (_ret) { \
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, \
"%s: CP start %d\n", __FUNCTION__, _ret); \
@@ -563,7 +588,7 @@ do { \
#define RADEONCP_STOP(pScrn, info) \
do { \
- int _ret = drmRadeonStopCP(info->drmFD); \
+ int _ret = RADEONCPStop(pScrn, info); \
if (_ret) { \
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, \
"%s: CP stop %d\n", __FUNCTION__, _ret); \
@@ -575,7 +600,7 @@ do { \
#define RADEONCP_RESET(pScrn, info) \
do { \
if (RADEONCP_USE_RING_BUFFER(info->CPMode)) { \
- int _ret = drmRadeonResetCP(info->drmFD); \
+ int _ret = drmCommandNone(info->drmFD, DRM_RADEON_CP_RESET); \
if (_ret) { \
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, \
"%s: CP reset %d\n", __FUNCTION__, _ret); \
@@ -609,7 +634,7 @@ do { \
#define RADEON_VERBOSE 0
-#define RING_LOCALS CARD32 *__head; int __count;
+#define RING_LOCALS CARD32 *__head = NULL; int __count = 0
#define BEGIN_RING(n) do { \
if (RADEON_VERBOSE) { \
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c
index 9d852f0e3..588d5c835 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c
@@ -31,7 +31,7 @@
* Authors:
* Kevin E. Martin <martin@xfree86.org>
* Rickard E. Faith <faith@valinux.com>
- * Alan Hourihane <ahourihane@valinux.com>
+ * Alan Hourihane <alanh@fairlite.demon.co.uk>
*
* Credits:
*
@@ -72,6 +72,7 @@
/* Driver data structures */
#include "radeon.h"
+#include "radeon_macros.h"
#include "radeon_probe.h"
#include "radeon_reg.h"
#include "radeon_version.h"
@@ -405,6 +406,48 @@ void RADEONEngineInit(ScrnInfoPtr pScrn)
#undef OUT_ACCEL_REG
#undef FINISH_ACCEL
+/* Stop the CP */
+int RADEONCPStop(ScrnInfoPtr pScrn, RADEONInfoPtr info)
+{
+ drmRadeonCPStop stop;
+ int ret, i;
+
+ stop.flush = 1;
+ stop.idle = 1;
+
+ ret = drmCommandWrite(info->drmFD, DRM_RADEON_CP_STOP, &stop,
+ sizeof(drmRadeonCPStop));
+
+ if (ret == 0) {
+ return 0;
+ } else if (errno != EBUSY) {
+ return -errno;
+ }
+
+ stop.flush = 0;
+
+ i = 0;
+ do {
+ ret = drmCommandWrite(info->drmFD, DRM_RADEON_CP_STOP, &stop,
+ sizeof(drmRadeonCPStop));
+ } while (ret && errno == EBUSY && i++ < RADEON_IDLE_RETRY);
+
+ if (ret == 0) {
+ return 0;
+ } else if (errno != EBUSY) {
+ return -errno;
+ }
+
+ stop.idle = 0;
+
+ if (drmCommandWrite(info->drmFD, DRM_RADEON_CP_STOP,
+ &stop, sizeof(drmRadeonCPStop))) {
+ return -errno;
+ } else {
+ return 0;
+ }
+}
+
/* Get an indirect buffer for the CP 2D acceleration commands */
drmBufPtr RADEONCPGetBuffer(ScrnInfoPtr pScrn)
{
@@ -472,9 +515,10 @@ drmBufPtr RADEONCPGetBuffer(ScrnInfoPtr pScrn)
/* Flush the indirect buffer to the kernel for submission to the card */
void RADEONCPFlushIndirect(ScrnInfoPtr pScrn, int discard)
{
- RADEONInfoPtr info = RADEONPTR(pScrn);
- drmBufPtr buffer = info->indirectBuffer;
- int start = info->indirectStart;
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ drmBufPtr buffer = info->indirectBuffer;
+ int start = info->indirectStart;
+ drmRadeonIndirect indirect;
if (!buffer) return;
if (start == buffer->used && !discard) return;
@@ -483,8 +527,14 @@ void RADEONCPFlushIndirect(ScrnInfoPtr pScrn, int discard)
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Flushing buffer %d\n",
buffer->idx);
}
- drmRadeonFlushIndirectBuffer(info->drmFD, buffer->idx,
- start, buffer->used, discard);
+
+ indirect.idx = buffer->idx;
+ indirect.start = start;
+ indirect.end = buffer->used;
+ indirect.discard = discard;
+
+ drmCommandWriteRead(info->drmFD, DRM_RADEON_INDIRECT,
+ &indirect, sizeof(drmRadeonIndirect));
if (discard) {
info->indirectBuffer = RADEONCPGetBuffer(pScrn);
@@ -502,9 +552,10 @@ void RADEONCPFlushIndirect(ScrnInfoPtr pScrn, int discard)
/* Flush and release the indirect buffer */
void RADEONCPReleaseIndirect(ScrnInfoPtr pScrn)
{
- RADEONInfoPtr info = RADEONPTR(pScrn);
- drmBufPtr buffer = info->indirectBuffer;
- int start = info->indirectStart;
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ drmBufPtr buffer = info->indirectBuffer;
+ int start = info->indirectStart;
+ drmRadeonIndirect indirect;
info->indirectBuffer = NULL;
info->indirectStart = 0;
@@ -515,8 +566,14 @@ void RADEONCPReleaseIndirect(ScrnInfoPtr pScrn)
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Releasing buffer %d\n",
buffer->idx);
}
- drmRadeonFlushIndirectBuffer(info->drmFD, buffer->idx,
- start, buffer->used, 1);
+
+ indirect.idx = buffer->idx;
+ indirect.start = start;
+ indirect.end = buffer->used;
+ indirect.discard = 1;
+
+ drmCommandWriteRead(info->drmFD, DRM_RADEON_INDIRECT,
+ &indirect, sizeof(drmRadeonIndirect));
}
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accelfuncs.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accelfuncs.c
index 76200ecee..d0b01db8e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accelfuncs.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accelfuncs.c
@@ -31,7 +31,7 @@
* Authors:
* Kevin E. Martin <martin@xfree86.org>
* Rickard E. Faith <faith@valinux.com>
- * Alan Hourihane <ahourihane@valinux.com>
+ * Alan Hourihane <alanh@fairlite.demon.co.uk>
* Michel Dänzer <michel@daenzer.net>
*
* Credits:
@@ -106,11 +106,43 @@ void
FUNC_NAME(RADEONWaitForIdle)(ScrnInfoPtr pScrn)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
+ unsigned char *RADEONMMIO = info->MMIO;
int i = 0;
-#ifdef ACCEL_MMIO
+#ifdef ACCEL_CP
- unsigned char *RADEONMMIO = info->MMIO;
+ int ret;
+
+ /* Make sure the CP is idle first */
+
+ if (info->CPStarted) {
+ FLUSH_RING();
+
+ for (;;) {
+ do {
+ ret = drmCommandNone(info->drmFD, DRM_RADEON_CP_IDLE);
+ if (ret && ret != -EBUSY) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "%s: CP idle %d\n", __FUNCTION__, ret);
+ }
+ } while ((ret == -EBUSY) && (i++ < RADEON_TIMEOUT));
+
+ if (ret == 0) return;
+
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Idle timed out, resetting engine...\n");
+ RADEONEngineReset(pScrn);
+ RADEONEngineRestore(pScrn);
+
+ /* Always restart the engine when doing CP 2D acceleration */
+ RADEONCP_RESET(pScrn, info);
+ RADEONCP_START(pScrn, info);
+ }
+ }
+
+#endif
+
+ /* Wait for the engine to go idle */
RADEONTRACE(("WaitForIdle (entering): %d entries, stat=0x%08x\n",
INREG(RADEON_RBBM_STATUS) & RADEON_RBBM_FIFOCNT_MASK,
@@ -139,35 +171,6 @@ FUNC_NAME(RADEONWaitForIdle)(ScrnInfoPtr pScrn)
}
#endif
}
-
-#else /* ACCEL_CP */
-
- int ret;
-
- FLUSH_RING();
-
- for (;;) {
- do {
- ret = drmRadeonWaitForIdleCP(info->drmFD);
- if (ret && ret != -EBUSY) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "%s: CP idle %d\n", __FUNCTION__, ret);
- }
- } while ((ret == -EBUSY) && (i++ < RADEON_TIMEOUT));
-
- if (ret == 0) return;
-
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Idle timed out, resetting engine...\n");
- RADEONEngineReset(pScrn);
- RADEONEngineRestore(pScrn);
-
- /* Always restart the engine when doing CP 2D acceleration */
- RADEONCP_RESET(pScrn, info);
- RADEONCP_START(pScrn, info);
- }
-
-#endif
}
/* This callback is required for multiheader cards using XAA */
@@ -578,15 +581,25 @@ FUNC_NAME(RADEONSetupForMono8x8PatternFill)(ScrnInfoPtr pScrn,
unsigned int planemask)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
+ unsigned char pattern[8];
ACCEL_PREAMBLE();
+ /* Take care of endianness */
+ pattern[0] = (patternx & 0x000000ff);
+ pattern[1] = (patternx & 0x0000ff00) >> 8;
+ pattern[2] = (patternx & 0x00ff0000) >> 16;
+ pattern[3] = (patternx & 0xff000000) >> 24;
+ pattern[4] = (patterny & 0x000000ff);
+ pattern[5] = (patterny & 0x0000ff00) >> 8;
+ pattern[6] = (patterny & 0x00ff0000) >> 16;
+ pattern[7] = (patterny & 0xff000000) >> 24;
+
/* Save for later clipping */
info->dp_gui_master_cntl_clip = (info->dp_gui_master_cntl
| (bg == -1
? RADEON_GMC_BRUSH_8X8_MONO_FG_LA
: RADEON_GMC_BRUSH_8X8_MONO_FG_BG)
- | RADEON_ROP[rop].pattern
- | RADEON_GMC_BYTE_MSB_TO_LSB);
+ | RADEON_ROP[rop].pattern);
BEGIN_ACCEL((bg == -1) ? 5 : 6);
@@ -595,8 +608,8 @@ FUNC_NAME(RADEONSetupForMono8x8PatternFill)(ScrnInfoPtr pScrn,
OUT_ACCEL_REG(RADEON_DP_BRUSH_FRGD_CLR, fg);
if (bg != -1)
OUT_ACCEL_REG(RADEON_DP_BRUSH_BKGD_CLR, bg);
- OUT_ACCEL_REG(RADEON_BRUSH_DATA0, patternx);
- OUT_ACCEL_REG(RADEON_BRUSH_DATA1, patterny);
+ OUT_ACCEL_REG(RADEON_BRUSH_DATA0, *(CARD32 *)(pointer)&pattern[0]);
+ OUT_ACCEL_REG(RADEON_BRUSH_DATA1, *(CARD32 *)(pointer)&pattern[4]);
FINISH_ACCEL();
}
@@ -778,7 +791,7 @@ FUNC_NAME(RADEONSetupForScanlineCPUToScreenColorExpandFill)(ScrnInfoPtr pScrn,
#else
BEGIN_ACCEL(2);
- OUT_ACCEL_REG(RADEON_RBBM_GUICNTL, RADEON_HOST_DATA_SWAP_NONE);
+ OUT_ACCEL_REG(RADEON_RBBM_GUICNTL, RADEON_HOST_DATA_SWAP_32BIT);
#endif
OUT_ACCEL_REG(RADEON_DP_WRITE_MASK, planemask);
@@ -1216,6 +1229,10 @@ FUNC_NAME(RADEONAccelInit)(ScreenPtr pScreen, XAAInfoRecPtr a)
a->SubsequentSolidHorVertLine
= FUNC_NAME(RADEONSubsequentSolidHorVertLine);
+#ifdef XFree86LOADER
+ if (info->xaaReq.minorversion >= 1) {
+#endif
+
/* RADEON only supports 14 bits for lines and clipping and only
* draws lines that are completely on-screen correctly. This will
* cause display corruption problem in the cases when out-of-range
@@ -1253,6 +1270,13 @@ FUNC_NAME(RADEONAccelInit)(ScreenPtr pScreen, XAAInfoRecPtr a)
a->DashedLineLimits.x2 = pScrn->virtualX-1;
a->DashedLineLimits.y2 = pScrn->virtualY-1;
+#ifdef XFree86LOADER
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "libxaa too old, can't accelerate TwoPoint lines\n");
+ }
+#endif
+
/* Clipping, note that without this, all line accelerations will
* not be called
*/
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_common.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_common.h
new file mode 100644
index 000000000..392e5066c
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_common.h
@@ -0,0 +1,444 @@
+/* radeon_common.h -- common header definitions for Radeon 2D/3D/DRM suite
+ *
+ * Copyright 2000 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
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author:
+ * Gareth Hughes <gareth@valinux.com>
+ * Kevin E. Martin <martin@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
+ *
+ * Converted to common header format:
+ * Jens Owen <jens@tungstengraphics.com>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86drmRadeon.h,v 1.6 2001/04/16 15:02:13 tsi Exp $
+ *
+ */
+
+#ifndef _RADEON_COMMON_H_
+#define _RADEON_COMMON_H_
+
+#include "xf86drm.h"
+
+/* WARNING: If you change any of these defines, make sure to change
+ * the kernel include file as well (radeon_drm.h)
+ */
+
+/* Driver specific DRM command indices
+ * NOTE: these are not OS specific, but they are driver specific
+ */
+#define DRM_RADEON_CP_INIT 0x00
+#define DRM_RADEON_CP_START 0x01
+#define DRM_RADEON_CP_STOP 0x02
+#define DRM_RADEON_CP_RESET 0x03
+#define DRM_RADEON_CP_IDLE 0x04
+#define DRM_RADEON_RESET 0x05
+#define DRM_RADEON_FULLSCREEN 0x06
+#define DRM_RADEON_SWAP 0x07
+#define DRM_RADEON_CLEAR 0x08
+#define DRM_RADEON_VERTEX 0x09
+#define DRM_RADEON_INDICES 0x0a
+#define DRM_RADEON_STIPPLE 0x0c
+#define DRM_RADEON_INDIRECT 0x0d
+#define DRM_RADEON_TEXTURE 0x0e
+#define DRM_RADEON_VERTEX2 0x0f
+#define DRM_RADEON_CMDBUF 0x10
+#define DRM_RADEON_GETPARAM 0x11
+#define DRM_RADEON_FLIP 0x12
+#define DRM_RADEON_ALLOC 0x13
+#define DRM_RADEON_FREE 0x14
+#define DRM_RADEON_INIT_HEAP 0x15
+#define DRM_RADEON_IRQ_EMIT 0x16
+#define DRM_RADEON_IRQ_WAIT 0x17
+#define DRM_RADEON_MAX_DRM_COMMAND_INDEX 0x39
+
+
+#define RADEON_FRONT 0x1
+#define RADEON_BACK 0x2
+#define RADEON_DEPTH 0x4
+#define RADEON_STENCIL 0x8
+
+#define RADEON_CLEAR_X1 0
+#define RADEON_CLEAR_Y1 1
+#define RADEON_CLEAR_X2 2
+#define RADEON_CLEAR_Y2 3
+#define RADEON_CLEAR_DEPTH 4
+
+
+typedef struct {
+ enum {
+ DRM_RADEON_INIT_CP = 0x01,
+ DRM_RADEON_CLEANUP_CP = 0x02,
+ DRM_RADEON_INIT_R200_CP = 0x03
+ } func;
+ unsigned long sarea_priv_offset;
+ int is_pci;
+ int cp_mode;
+ int agp_size;
+ int ring_size;
+ int usec_timeout;
+
+ unsigned int fb_bpp;
+ unsigned int front_offset, front_pitch;
+ unsigned int back_offset, back_pitch;
+ unsigned int depth_bpp;
+ unsigned int depth_offset, depth_pitch;
+
+ unsigned long fb_offset;
+ unsigned long mmio_offset;
+ unsigned long ring_offset;
+ unsigned long ring_rptr_offset;
+ unsigned long buffers_offset;
+ unsigned long agp_textures_offset;
+} drmRadeonInit;
+
+typedef struct {
+ int flush;
+ int idle;
+} drmRadeonCPStop;
+
+typedef struct {
+ int idx;
+ int start;
+ int end;
+ int discard;
+} drmRadeonIndirect;
+
+typedef union drmRadeonClearR {
+ float f[5];
+ unsigned int ui[5];
+} drmRadeonClearRect;
+
+typedef struct drmRadeonClearT {
+ unsigned int flags;
+ unsigned int clear_color;
+ unsigned int clear_depth;
+ unsigned int color_mask;
+ unsigned int depth_mask; /* misnamed field: should be stencil */
+ drmRadeonClearRect *depth_boxes;
+} drmRadeonClearType;
+
+typedef struct drmRadeonFullscreenT {
+ enum {
+ RADEON_INIT_FULLSCREEN = 0x01,
+ RADEON_CLEANUP_FULLSCREEN = 0x02
+ } func;
+} drmRadeonFullscreenType;
+
+typedef struct {
+ unsigned int *mask;
+} drmRadeonStipple;
+
+typedef struct {
+ unsigned int x;
+ unsigned int y;
+ unsigned int width;
+ unsigned int height;
+ const void *data;
+} drmRadeonTexImage;
+
+typedef struct {
+ int offset;
+ int pitch;
+ int format;
+ int width; /* Texture image coordinates */
+ int height;
+ drmRadeonTexImage *image;
+} drmRadeonTexture;
+
+
+#define RADEON_MAX_TEXTURE_UNITS 3
+
+/* Layout matches drm_radeon_state_t in linux drm_radeon.h.
+ */
+typedef struct {
+ struct {
+ unsigned int pp_misc; /* 0x1c14 */
+ unsigned int pp_fog_color;
+ unsigned int re_solid_color;
+ unsigned int rb3d_blendcntl;
+ unsigned int rb3d_depthoffset;
+ unsigned int rb3d_depthpitch;
+ unsigned int rb3d_zstencilcntl;
+ unsigned int pp_cntl; /* 0x1c38 */
+ unsigned int rb3d_cntl;
+ unsigned int rb3d_coloroffset;
+ unsigned int re_width_height;
+ unsigned int rb3d_colorpitch;
+ } context;
+ struct {
+ unsigned int se_cntl;
+ } setup1;
+ struct {
+ unsigned int se_coord_fmt; /* 0x1c50 */
+ } vertex;
+ struct {
+ unsigned int re_line_pattern; /* 0x1cd0 */
+ unsigned int re_line_state;
+ unsigned int se_line_width; /* 0x1db8 */
+ } line;
+ struct {
+ unsigned int pp_lum_matrix; /* 0x1d00 */
+ unsigned int pp_rot_matrix_0; /* 0x1d58 */
+ unsigned int pp_rot_matrix_1;
+ } bumpmap;
+ struct {
+ unsigned int rb3d_stencilrefmask; /* 0x1d7c */
+ unsigned int rb3d_ropcntl;
+ unsigned int rb3d_planemask;
+ } mask;
+ struct {
+ unsigned int se_vport_xscale; /* 0x1d98 */
+ unsigned int se_vport_xoffset;
+ unsigned int se_vport_yscale;
+ unsigned int se_vport_yoffset;
+ unsigned int se_vport_zscale;
+ unsigned int se_vport_zoffset;
+ } viewport;
+ struct {
+ unsigned int se_cntl_status; /* 0x2140 */
+ } setup2;
+ struct {
+ unsigned int re_top_left; /*ignored*/ /* 0x26c0 */
+ unsigned int re_misc;
+ } misc;
+ struct {
+ unsigned int pp_txfilter;
+ unsigned int pp_txformat;
+ unsigned int pp_txoffset;
+ unsigned int pp_txcblend;
+ unsigned int pp_txablend;
+ unsigned int pp_tfactor;
+ unsigned int pp_border_color;
+ } texture[RADEON_MAX_TEXTURE_UNITS];
+ struct {
+ unsigned int se_zbias_factor;
+ unsigned int se_zbias_constant;
+ } zbias;
+ unsigned int dirty;
+} drmRadeonState;
+
+/* 1.1 vertex ioctl. Used in compatibility modes.
+ */
+typedef struct {
+ int prim;
+ int idx; /* Index of vertex buffer */
+ int count; /* Number of vertices in buffer */
+ int discard; /* Client finished with buffer? */
+} drmRadeonVertex;
+
+typedef struct {
+ unsigned int start;
+ unsigned int finish;
+ unsigned int prim:8;
+ unsigned int stateidx:8;
+ unsigned int numverts:16; /* overloaded as offset/64 for elt prims */
+ unsigned int vc_format;
+} drmRadeonPrim;
+
+typedef struct {
+ int idx; /* Index of vertex buffer */
+ int discard; /* Client finished with buffer? */
+ int nr_states;
+ drmRadeonState *state;
+ int nr_prims;
+ drmRadeonPrim *prim;
+} drmRadeonVertex2;
+
+#define RADEON_MAX_STATES 16
+#define RADEON_MAX_PRIMS 64
+
+/* Command buffer. Replace with true dma stream?
+ */
+typedef struct {
+ int bufsz;
+ char *buf;
+ int nbox;
+ drmClipRect *boxes;
+} drmRadeonCmdBuffer;
+
+/* New style per-packet identifiers for use in cmd_buffer ioctl with
+ * the RADEON_EMIT_PACKET command. Comments relate new packets to old
+ * state bits and the packet size:
+ */
+#define RADEON_EMIT_PP_MISC 0 /* context/7 */
+#define RADEON_EMIT_PP_CNTL 1 /* context/3 */
+#define RADEON_EMIT_RB3D_COLORPITCH 2 /* context/1 */
+#define RADEON_EMIT_RE_LINE_PATTERN 3 /* line/2 */
+#define RADEON_EMIT_SE_LINE_WIDTH 4 /* line/1 */
+#define RADEON_EMIT_PP_LUM_MATRIX 5 /* bumpmap/1 */
+#define RADEON_EMIT_PP_ROT_MATRIX_0 6 /* bumpmap/2 */
+#define RADEON_EMIT_RB3D_STENCILREFMASK 7 /* masks/3 */
+#define RADEON_EMIT_SE_VPORT_XSCALE 8 /* viewport/6 */
+#define RADEON_EMIT_SE_CNTL 9 /* setup/2 */
+#define RADEON_EMIT_SE_CNTL_STATUS 10 /* setup/1 */
+#define RADEON_EMIT_RE_MISC 11 /* misc/1 */
+#define RADEON_EMIT_PP_TXFILTER_0 12 /* tex0/6 */
+#define RADEON_EMIT_PP_BORDER_COLOR_0 13 /* tex0/1 */
+#define RADEON_EMIT_PP_TXFILTER_1 14 /* tex1/6 */
+#define RADEON_EMIT_PP_BORDER_COLOR_1 15 /* tex1/1 */
+#define RADEON_EMIT_PP_TXFILTER_2 16 /* tex2/6 */
+#define RADEON_EMIT_PP_BORDER_COLOR_2 17 /* tex2/1 */
+#define RADEON_EMIT_SE_ZBIAS_FACTOR 18 /* zbias/2 */
+#define RADEON_EMIT_SE_TCL_OUTPUT_VTX_FMT 19 /* tcl/11 */
+#define RADEON_EMIT_SE_TCL_MATERIAL_EMMISSIVE_RED 20 /* material/17 */
+#define R200_EMIT_PP_TXCBLEND_0 21 /* tex0/4 */
+#define R200_EMIT_PP_TXCBLEND_1 22 /* tex1/4 */
+#define R200_EMIT_PP_TXCBLEND_2 23 /* tex2/4 */
+#define R200_EMIT_PP_TXCBLEND_3 24 /* tex3/4 */
+#define R200_EMIT_PP_TXCBLEND_4 25 /* tex4/4 */
+#define R200_EMIT_PP_TXCBLEND_5 26 /* tex5/4 */
+#define R200_EMIT_PP_TXCBLEND_6 27 /* /4 */
+#define R200_EMIT_PP_TXCBLEND_7 28 /* /4 */
+#define R200_EMIT_TCL_LIGHT_MODEL_CTL_0 29 /* tcl/6 */
+#define R200_EMIT_TFACTOR_0 30 /* tf/6 */
+#define R200_EMIT_VTX_FMT_0 31 /* vtx/4 */
+#define R200_EMIT_VAP_CTL 32 /* vap/1 */
+#define R200_EMIT_MATRIX_SELECT_0 33 /* msl/5 */
+#define R200_EMIT_TEX_PROC_CTL_2 34 /* tcg/5 */
+#define R200_EMIT_TCL_UCP_VERT_BLEND_CTL 35 /* tcl/1 */
+#define R200_EMIT_PP_TXFILTER_0 36 /* tex0/6 */
+#define R200_EMIT_PP_TXFILTER_1 37 /* tex1/6 */
+#define R200_EMIT_PP_TXFILTER_2 38 /* tex2/6 */
+#define R200_EMIT_PP_TXFILTER_3 39 /* tex3/6 */
+#define R200_EMIT_PP_TXFILTER_4 40 /* tex4/6 */
+#define R200_EMIT_PP_TXFILTER_5 41 /* tex5/6 */
+#define R200_EMIT_PP_TXOFFSET_0 42 /* tex0/1 */
+#define R200_EMIT_PP_TXOFFSET_1 43 /* tex1/1 */
+#define R200_EMIT_PP_TXOFFSET_2 44 /* tex2/1 */
+#define R200_EMIT_PP_TXOFFSET_3 45 /* tex3/1 */
+#define R200_EMIT_PP_TXOFFSET_4 46 /* tex4/1 */
+#define R200_EMIT_PP_TXOFFSET_5 47 /* tex5/1 */
+#define R200_EMIT_VTE_CNTL 48 /* vte/1 */
+#define R200_EMIT_OUTPUT_VTX_COMP_SEL 49 /* vtx/1 */
+#define R200_EMIT_PP_TAM_DEBUG3 50 /* tam/1 */
+#define R200_EMIT_PP_CNTL_X 51 /* cst/1 */
+#define R200_EMIT_RB3D_DEPTHXY_OFFSET 52 /* cst/1 */
+#define R200_EMIT_RE_AUX_SCISSOR_CNTL 53 /* cst/1 */
+#define R200_EMIT_RE_SCISSOR_TL_0 54 /* cst/2 */
+#define R200_EMIT_RE_SCISSOR_TL_1 55 /* cst/2 */
+#define R200_EMIT_RE_SCISSOR_TL_2 56 /* cst/2 */
+#define R200_EMIT_SE_VAP_CNTL_STATUS 57 /* cst/1 */
+#define R200_EMIT_SE_VTX_STATE_CNTL 58 /* cst/1 */
+#define R200_EMIT_RE_POINTSIZE 59 /* cst/1 */
+#define R200_EMIT_TCL_INPUT_VTX_VECTOR_ADDR_0 60 /* cst/4 */
+#define R200_EMIT_PP_CUBIC_FACES_0 61
+#define R200_EMIT_PP_CUBIC_OFFSETS_0 62
+#define R200_EMIT_PP_CUBIC_FACES_1 63
+#define R200_EMIT_PP_CUBIC_OFFSETS_1 64
+#define R200_EMIT_PP_CUBIC_FACES_2 65
+#define R200_EMIT_PP_CUBIC_OFFSETS_2 66
+#define R200_EMIT_PP_CUBIC_FACES_3 67
+#define R200_EMIT_PP_CUBIC_OFFSETS_3 68
+#define R200_EMIT_PP_CUBIC_FACES_4 69
+#define R200_EMIT_PP_CUBIC_OFFSETS_4 70
+#define R200_EMIT_PP_CUBIC_FACES_5 71
+#define R200_EMIT_PP_CUBIC_OFFSETS_5 72
+#define RADEON_MAX_STATE_PACKETS 73
+
+
+/* Commands understood by cmd_buffer ioctl. More can be added but
+ * obviously these can't be removed or changed:
+ */
+#define RADEON_CMD_PACKET 1 /* emit one of the register packets above */
+#define RADEON_CMD_SCALARS 2 /* emit scalar data */
+#define RADEON_CMD_VECTORS 3 /* emit vector data */
+#define RADEON_CMD_DMA_DISCARD 4 /* discard current dma buf */
+#define RADEON_CMD_PACKET3 5 /* emit hw packet */
+#define RADEON_CMD_PACKET3_CLIP 6 /* emit hw packet wrapped in cliprects */
+#define RADEON_CMD_SCALARS2 7 /* R200 stopgap */
+#define RADEON_CMD_WAIT 8 /* synchronization */
+
+typedef union {
+ int i;
+ struct {
+ unsigned char cmd_type, pad0, pad1, pad2;
+ } header;
+ struct {
+ unsigned char cmd_type, packet_id, pad0, pad1;
+ } packet;
+ struct {
+ unsigned char cmd_type, offset, stride, count;
+ } scalars;
+ struct {
+ unsigned char cmd_type, offset, stride, count;
+ } vectors;
+ struct {
+ unsigned char cmd_type, buf_idx, pad0, pad1;
+ } dma;
+ struct {
+ unsigned char cmd_type, flags, pad0, pad1;
+ } wait;
+} drmRadeonCmdHeader;
+
+
+#define RADEON_WAIT_2D 0x1
+#define RADEON_WAIT_3D 0x2
+
+
+typedef struct drm_radeon_getparam {
+ int param;
+ int *value;
+} drmRadeonGetParam;
+
+#define RADEON_PARAM_AGP_BUFFER_OFFSET 1
+#define RADEON_PARAM_LAST_FRAME 2
+#define RADEON_PARAM_LAST_DISPATCH 3
+#define RADEON_PARAM_LAST_CLEAR 4
+#define RADEON_PARAM_IRQ_NR 5
+#define RADEON_PARAM_AGP_BASE 6
+
+
+#define RADEON_MEM_REGION_AGP 1
+#define RADEON_MEM_REGION_FB 2
+
+typedef struct drm_radeon_mem_alloc {
+ int region;
+ int alignment;
+ int size;
+ int *region_offset; /* offset from start of fb or agp */
+} drmRadeonMemAlloc;
+
+typedef struct drm_radeon_mem_free {
+ int region;
+ int region_offset;
+} drmRadeonMemFree;
+
+typedef struct drm_radeon_mem_init_heap {
+ int region;
+ int size;
+ int start;
+} drmRadeonMemInitHeap;
+
+/* 1.6: Userspace can request & wait on irq's:
+ */
+typedef struct drm_radeon_irq_emit {
+ int *irq_seq;
+} drmRadeonIrqEmit;
+
+typedef struct drm_radeon_irq_wait {
+ int irq_seq;
+} drmRadeonIrqWait;
+
+
+#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_cursor.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_cursor.c
index 284411972..ecddc34a5 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_cursor.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_cursor.c
@@ -46,6 +46,7 @@
/* Driver data structures */
#include "radeon.h"
+#include "radeon_macros.h"
#include "radeon_reg.h"
/* X and server generic header files */
@@ -154,7 +155,7 @@ static void RADEONSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
if ((X0 >= 0 || Y0 >= 0) &&
((info->CloneFrameX0 != X0) || (info->CloneFrameY0 != Y0))) {
- pScrn->AdjustFrame(pScrn->scrnIndex, X0, Y0, 1);
+ RADEONDoAdjustFrame(pScrn, X0, Y0, TRUE);
info->CloneFrameX0 = X0;
info->CloneFrameY0 = Y0;
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c
index 20a3217db..cdc433ed2 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c
@@ -39,6 +39,7 @@
/* Driver data structures */
#include "radeon.h"
#include "radeon_dri.h"
+#include "radeon_macros.h"
#include "radeon_reg.h"
#include "radeon_version.h"
@@ -47,13 +48,15 @@
#include "windowstr.h"
#include "xf86PciInfo.h"
+
+#include "shadowfb.h"
/* GLX/DRI/DRM definitions */
#define _XF86DRI_SERVER_
#include "GL/glxtokens.h"
#include "sarea.h"
#include "radeon_sarea.h"
-#if defined(__alpha__)
+#if defined(__alpha__) || defined(__powerpc__)
# define PCIGART_ENABLED
#else
# undef PCIGART_ENABLED
@@ -69,6 +72,16 @@
# define DRM_PAGE_SIZE 4096
#endif
+
+static Bool RADEONDRICloseFullScreen(ScreenPtr pScreen);
+static Bool RADEONDRIOpenFullScreen(ScreenPtr pScreen);
+static void RADEONDRITransitionTo2d(ScreenPtr pScreen);
+static void RADEONDRITransitionTo3d(ScreenPtr pScreen);
+static void RADEONDRITransitionMultiToSingle3d(ScreenPtr pScreen);
+static void RADEONDRITransitionSingleToMulti3d(ScreenPtr pScreen);
+
+static void RADEONDRIRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
+
/* Initialize the visual configs that are supported by the hardware.
* These are combined with the visual configs that the indirect
* rendering core supports, and the intersection is exported to the
@@ -82,7 +95,9 @@ static Bool RADEONInitVisualConfigs(ScreenPtr pScreen)
__GLXvisualConfig *pConfigs = 0;
RADEONConfigPrivPtr pRADEONConfigs = 0;
RADEONConfigPrivPtr *pRADEONConfigPtrs = 0;
- int i, accum, stencil;
+ int i, accum, stencil, db, use_db;
+
+ use_db = !info->noBackBuffer ? 1 : 0;
switch (info->CurrentLayout.pixel_code) {
case 8: /* 8bpp mode is not support */
@@ -101,6 +116,7 @@ static Bool RADEONInitVisualConfigs(ScreenPtr pScreen)
numConfigs = 1;
if (RADEON_USE_ACCUM) numConfigs *= 2;
if (RADEON_USE_STENCIL) numConfigs *= 2;
+ if (use_db) numConfigs *= 2;
if (!(pConfigs
= (__GLXvisualConfig *)xcalloc(sizeof(__GLXvisualConfig),
@@ -122,7 +138,8 @@ static Bool RADEONInitVisualConfigs(ScreenPtr pScreen)
}
i = 0;
- for (accum = 0; accum <= RADEON_USE_ACCUM; accum++) {
+ for (db = 0; db <= use_db; db++) {
+ for (accum = 0; accum <= RADEON_USE_ACCUM; accum++) {
for (stencil = 0; stencil <= RADEON_USE_STENCIL; stencil++) {
pRADEONConfigPtrs[i] = &pRADEONConfigs[i];
@@ -148,7 +165,10 @@ static Bool RADEONInitVisualConfigs(ScreenPtr pScreen)
pConfigs[i].accumBlueSize = 0;
pConfigs[i].accumAlphaSize = 0;
}
- pConfigs[i].doubleBuffer = TRUE;
+ if (db)
+ pConfigs[i].doubleBuffer = TRUE;
+ else
+ pConfigs[i].doubleBuffer = FALSE;
pConfigs[i].stereo = FALSE;
pConfigs[i].bufferSize = 16;
pConfigs[i].depthSize = 16;
@@ -171,6 +191,7 @@ static Bool RADEONInitVisualConfigs(ScreenPtr pScreen)
pConfigs[i].transparentIndex = 0;
i++;
}
+ }
}
break;
@@ -178,6 +199,7 @@ static Bool RADEONInitVisualConfigs(ScreenPtr pScreen)
numConfigs = 1;
if (RADEON_USE_ACCUM) numConfigs *= 2;
if (RADEON_USE_STENCIL) numConfigs *= 2;
+ if (use_db) numConfigs *= 2;
if (!(pConfigs
= (__GLXvisualConfig *)xcalloc(sizeof(__GLXvisualConfig),
@@ -199,7 +221,8 @@ static Bool RADEONInitVisualConfigs(ScreenPtr pScreen)
}
i = 0;
- for (accum = 0; accum <= RADEON_USE_ACCUM; accum++) {
+ for (db = 0; db <= use_db; db++) {
+ for (accum = 0; accum <= RADEON_USE_ACCUM; accum++) {
for (stencil = 0; stencil <= RADEON_USE_STENCIL; stencil++) {
pRADEONConfigPtrs[i] = &pRADEONConfigs[i];
@@ -225,9 +248,12 @@ static Bool RADEONInitVisualConfigs(ScreenPtr pScreen)
pConfigs[i].accumBlueSize = 0;
pConfigs[i].accumAlphaSize = 0;
}
- pConfigs[i].doubleBuffer = TRUE;
+ if (db)
+ pConfigs[i].doubleBuffer = TRUE;
+ else
+ pConfigs[i].doubleBuffer = FALSE;
pConfigs[i].stereo = FALSE;
- pConfigs[i].bufferSize = 24;
+ pConfigs[i].bufferSize = 32;
if (stencil) {
pConfigs[i].depthSize = 24;
pConfigs[i].stencilSize = 8;
@@ -250,6 +276,7 @@ static Bool RADEONInitVisualConfigs(ScreenPtr pScreen)
pConfigs[i].transparentIndex = 0;
i++;
}
+ }
}
break;
}
@@ -494,86 +521,9 @@ static void RADEONScreenToScreenCopyDepth(ScrnInfoPtr pScrn,
/* Initialize the state of the back and depth buffers */
static void RADEONDRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 indx)
{
- /* FIXME: This routine needs to have acceleration turned on */
- ScreenPtr pScreen = pWin->drawable.pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- RADEONInfoPtr info = RADEONPTR(pScrn);
- RADEONSAREAPrivPtr pSAREAPriv;
- BoxPtr pbox;
- int nbox;
- unsigned int color, depth, stencil;
- unsigned int color_mask, depth_mask, flags;
-
- /* FIXME: This should be based on the __GLXvisualConfig info */
- color = 0;
- switch (pScrn->bitsPerPixel) {
- case 16:
- depth = 0x0000ffff;
- color_mask = 0x0000ffff;
- depth_mask = 0xffffffff;
- stencil = 0x00000000;
- flags = RADEON_BACK | RADEON_DEPTH;
- break;
-
- case 32:
- depth = 0x00ffffff;
- color_mask = 0xffffffff;
- depth_mask = 0x00ffffff;
- stencil = 0xff000000;
- flags = RADEON_BACK | RADEON_DEPTH /* | RADEON_STENCIL */;
- break;
-
- default:
- return;
- }
-
- /* FIXME: Copy XAAPaintWindow() and use REGION_TRANSLATE() */
-
- /* FIXME: Only initialize the back and depth buffers for contexts
- * that request them
- */
-
- FLUSH_RING();
-
- pSAREAPriv = (RADEONSAREAPrivPtr)DRIGetSAREAPrivate(pScreen);
-
- pbox = REGION_RECTS(prgn);
- nbox = REGION_NUM_RECTS(prgn);
-
- for (; nbox; nbox--, pbox++) {
- int ret;
-
- /* drmRadeonClear uses the clip rects to draw instead of the
- * rect passed to it; however, it uses the rect for the depth
- * clears
- */
- pSAREAPriv->boxes[0].x1 = pbox->x1;
- pSAREAPriv->boxes[0].x2 = pbox->x2;
- pSAREAPriv->boxes[0].y1 = pbox->y1;
- pSAREAPriv->boxes[0].y2 = pbox->y2;
- pSAREAPriv->nbox = 1;
-
- ret = drmRadeonClear(info->drmFD,
- flags,
- color, depth, color_mask, depth_mask,
- pSAREAPriv->boxes, pSAREAPriv->nbox);
- if (ret) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "[dri] DRIInitBuffers timed out, "
- "resetting engine...\n");
- RADEONEngineReset(pScrn);
- RADEONEngineRestore(pScrn);
- RADEONCP_RESET(pScrn, info);
- RADEONCP_START(pScrn, info);
- return;
- }
- }
-
- /* Mark the X server as the last context owner */
- pSAREAPriv->ctxOwner = DRIGetContext(pScreen);
-
- RADEONSelectBuffer(pScrn, RADEON_FRONT);
- info->accel->NeedToSync = TRUE;
+ /* NOOP. There's no need for the 2d driver to be clearing buffers
+ * for the 3d client. It knows how to do that on its own.
+ */
}
/* Copy the back and depth buffers when the X server moves a window.
@@ -720,13 +670,14 @@ static void RADEONDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
xa, ya,
destx, desty,
w, h);
- RADEONSelectBuffer(pScrn, RADEON_DEPTH);
- if (info->depthMoves)
+ if (info->depthMoves) {
+ RADEONSelectBuffer(pScrn, RADEON_DEPTH);
RADEONScreenToScreenCopyDepth(pScrn,
xa, ya,
destx, desty,
w, h);
+ }
}
RADEONSelectBuffer(pScrn, RADEON_FRONT);
@@ -757,7 +708,7 @@ static Bool RADEONDRIAgpInit(RADEONInfoPtr info, ScreenPtr pScreen)
/* Workaround for some hardware bugs */
if (info->ChipFamily < CHIP_FAMILY_R200)
- OUTREG(RADEON_AGP_CNTL, INREG(RADEON_AGP_CNTL) | 0x000e0020);
+ OUTREG(RADEON_AGP_CNTL, INREG(RADEON_AGP_CNTL) | 0x000e0000);
/* Modify the mode if the default mode
* is not appropriate for this
@@ -776,6 +727,8 @@ static Bool RADEONDRIAgpInit(RADEONInfoPtr info, ScreenPtr pScreen)
case 1: default: mode |= RADEON_AGP_1X_MODE;
}
+ if (info->agpFastWrite) mode |= RADEON_AGP_FW_MODE;
+
if ((vendor == PCI_VENDOR_AMD) &&
(device == PCI_CHIP_AMD761)) {
/* The combination of 761 with MOBILITY chips will lockup the
@@ -1060,6 +1013,15 @@ static int RADEONDRIKernelInit(RADEONInfoPtr info, ScreenPtr pScreen)
int cpp = info->CurrentLayout.pixel_bytes;
drmRadeonInit drmInfo;
+ memset(&drmInfo, 0, sizeof(drmRadeonInit));
+
+ if ( (info->ChipFamily == CHIP_FAMILY_R200) ||
+ (info->ChipFamily == CHIP_FAMILY_RV250) ||
+ (info->ChipFamily == CHIP_FAMILY_M9) )
+ drmInfo.func = DRM_RADEON_INIT_R200_CP;
+ else
+ drmInfo.func = DRM_RADEON_INIT_CP;
+
drmInfo.sarea_priv_offset = sizeof(XF86DRISAREARec);
drmInfo.is_pci = info->IsPCI;
drmInfo.cp_mode = info->CPMode;
@@ -1084,9 +1046,11 @@ static int RADEONDRIKernelInit(RADEONInfoPtr info, ScreenPtr pScreen)
drmInfo.buffers_offset = info->bufHandle;
drmInfo.agp_textures_offset = info->agpTexHandle;
- if (drmRadeonInitCP(info->drmFD, &drmInfo) < 0) return FALSE;
+ if (drmCommandWrite(info->drmFD, DRM_RADEON_CP_INIT,
+ &drmInfo, sizeof(drmRadeonInit)) < 0)
+ return FALSE;
- /* drmRadeonInitCP does an engine reset, which resets some engine
+ /* DRM_RADEON_CP_INIT does an engine reset, which resets some engine
* registers back to their default values, so we need to restore
* those engine register here.
*/
@@ -1095,6 +1059,32 @@ static int RADEONDRIKernelInit(RADEONInfoPtr info, ScreenPtr pScreen)
return TRUE;
}
+static void RADEONDRIAgpHeapInit(RADEONInfoPtr info, ScreenPtr pScreen)
+{
+ drmRadeonMemInitHeap drmHeap;
+
+ /* Start up the simple memory manager for agp space */
+ if (info->drmMinor >= 6) {
+ drmHeap.region = RADEON_MEM_REGION_AGP;
+ drmHeap.start = 0;
+ drmHeap.size = info->agpTexMapSize;
+
+ if (drmCommandWrite(info->drmFD, DRM_RADEON_INIT_HEAP,
+ &drmHeap, sizeof(drmHeap))) {
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[drm] Failed to initialized agp heap manager\n");
+ } else {
+ xf86DrvMsg(pScreen->myNum, X_INFO,
+ "[drm] Initialized kernel agp heap manager, %d\n",
+ info->agpTexMapSize);
+ }
+ } else {
+ xf86DrvMsg(pScreen->myNum, X_INFO,
+ "[drm] Kernel module too old (1.%d) for agp heap manager\n",
+ info->drmMinor);
+ }
+}
+
/* Add a map for the vertex buffers that will be accessed by any
* DRI-based clients.
*/
@@ -1139,6 +1129,36 @@ static Bool RADEONDRIBufInit(RADEONInfoPtr info, ScreenPtr pScreen)
return TRUE;
}
+static void RADEONDRIIrqInit(RADEONInfoPtr info, ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+
+ if (!info->irq) {
+ info->irq = drmGetInterruptFromBusID(
+ info->drmFD,
+ ((pciConfigPtr)info->PciInfo->thisCard)->busnum,
+ ((pciConfigPtr)info->PciInfo->thisCard)->devnum,
+ ((pciConfigPtr)info->PciInfo->thisCard)->funcnum);
+
+ if ((drmCtlInstHandler(info->drmFD, info->irq)) != 0) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "[drm] failure adding irq handler, "
+ "there is a device already using that irq\n"
+ "[drm] falling back to irq-free operation\n");
+ info->irq = 0;
+ } else {
+ unsigned char *RADEONMMIO = info->MMIO;
+ info->ModeReg.gen_int_cntl = INREG( RADEON_GEN_INT_CNTL );
+ }
+ }
+
+ if (info->irq)
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "[drm] dma control initialized, using IRQ %d\n",
+ info->irq);
+}
+
+
/* Initialize the CP state, and start the CP (if used by the X server) */
static void RADEONDRICPInit(ScrnInfoPtr pScrn)
{
@@ -1152,196 +1172,6 @@ static void RADEONDRICPInit(ScrnInfoPtr pScrn)
RADEONSelectBuffer(pScrn, RADEON_FRONT);
}
-/* Initialize the DRI specific hardware state stored in the SAREA.
- * Currently, this involves setting up the 3D hardware state.
- */
-static void RADEONDRISAREAInit(ScreenPtr pScreen,
- RADEONSAREAPrivPtr pSAREAPriv)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- RADEONInfoPtr info = RADEONPTR(pScrn);
- radeon_context_regs_t *ctx;
- radeon_texture_regs_t *tex;
- CARD32 color_fmt, depth_fmt;
- int i;
-
- switch (info->CurrentLayout.pixel_code) {
- case 16:
- color_fmt = RADEON_COLOR_FORMAT_RGB565;
- depth_fmt = RADEON_DEPTH_FORMAT_16BIT_INT_Z;
- break;
-
- case 32:
- color_fmt = RADEON_COLOR_FORMAT_ARGB8888;
- depth_fmt = RADEON_DEPTH_FORMAT_24BIT_INT_Z;
- break;
-
- default:
- xf86DrvMsg(pScreen->myNum, X_ERROR,
- "[dri] RADEONDRISAREAInit failed: Unsupported depth "
- "(%d bpp). Disabling DRI.\n",
- info->CurrentLayout.pixel_code);
- return;
- }
-
- /* Initialize the context state */
- ctx = &pSAREAPriv->ContextState;
-
- ctx->pp_misc = (RADEON_ALPHA_TEST_PASS |
- RADEON_CHROMA_FUNC_FAIL |
- RADEON_CHROMA_KEY_NEAREST |
- RADEON_SHADOW_FUNC_EQUAL |
- RADEON_SHADOW_PASS_1 |
- RADEON_RIGHT_HAND_CUBE_OGL);
-
- ctx->pp_fog_color = ((0x00000000 & RADEON_FOG_COLOR_MASK) |
- RADEON_FOG_VERTEX |
- RADEON_FOG_USE_DEPTH);
-
- ctx->re_solid_color = 0x00000000;
-
- ctx->rb3d_blendcntl = (RADEON_SRC_BLEND_GL_ONE |
- RADEON_DST_BLEND_GL_ZERO );
-
- ctx->rb3d_depthoffset = info->depthOffset;
-
- ctx->rb3d_depthpitch = ((info->depthPitch & RADEON_DEPTHPITCH_MASK) |
- RADEON_DEPTH_ENDIAN_NO_SWAP);
-
- ctx->rb3d_zstencilcntl = (depth_fmt |
- RADEON_Z_TEST_LESS |
- RADEON_STENCIL_TEST_ALWAYS |
- RADEON_STENCIL_FAIL_KEEP |
- RADEON_STENCIL_ZPASS_KEEP |
- RADEON_STENCIL_ZFAIL_KEEP |
- RADEON_Z_WRITE_ENABLE);
-
- ctx->pp_cntl = (RADEON_SCISSOR_ENABLE |
- RADEON_ANTI_ALIAS_NONE);
-
- ctx->rb3d_cntl = (RADEON_PLANE_MASK_ENABLE |
- color_fmt |
- RADEON_ZBLOCK16);
-
- ctx->rb3d_coloroffset = (info->backOffset & RADEON_COLOROFFSET_MASK);
-
- ctx->re_width_height = ((0x7ff << RADEON_RE_WIDTH_SHIFT) |
- (0x7ff << RADEON_RE_HEIGHT_SHIFT));
-
- ctx->rb3d_colorpitch = ((info->backPitch & RADEON_COLORPITCH_MASK) |
- RADEON_COLOR_ENDIAN_NO_SWAP);
-
- ctx->se_cntl = (RADEON_FFACE_CULL_CW |
- RADEON_BFACE_SOLID |
- RADEON_FFACE_SOLID |
- RADEON_FLAT_SHADE_VTX_LAST |
- RADEON_DIFFUSE_SHADE_GOURAUD |
- RADEON_ALPHA_SHADE_GOURAUD |
- RADEON_SPECULAR_SHADE_GOURAUD |
- RADEON_FOG_SHADE_GOURAUD |
- RADEON_VPORT_XY_XFORM_ENABLE |
- RADEON_VTX_PIX_CENTER_OGL |
- RADEON_ROUND_MODE_TRUNC |
- RADEON_ROUND_PREC_8TH_PIX);
-
- ctx->se_coord_fmt = (RADEON_VTX_XY_PRE_MULT_1_OVER_W0 |
- RADEON_VTX_Z_PRE_MULT_1_OVER_W0 |
- RADEON_TEX1_W_ROUTING_USE_Q1);
-
- ctx->re_line_pattern = ((0x0000 & RADEON_LINE_PATTERN_MASK) |
- (0 << RADEON_LINE_REPEAT_COUNT_SHIFT) |
- (0 << RADEON_LINE_PATTERN_START_SHIFT) |
- RADEON_LINE_PATTERN_LITTLE_BIT_ORDER);
-
- ctx->re_line_state = ((0 << RADEON_LINE_CURRENT_PTR_SHIFT) |
- (0 << RADEON_LINE_CURRENT_COUNT_SHIFT));
-
- ctx->se_line_width = 0x0000000;
-
- ctx->pp_lum_matrix = 0x00000000;
-
- ctx->pp_rot_matrix_0 = 0x00000000;
- ctx->pp_rot_matrix_1 = 0x00000000;
-
- ctx->rb3d_stencilrefmask =
- (CARD32)((0x000 << RADEON_STENCIL_REF_SHIFT) |
- (0x0ff << RADEON_STENCIL_MASK_SHIFT) |
- (0x0ff << RADEON_STENCIL_WRITEMASK_SHIFT));
-
- ctx->rb3d_ropcntl = 0x00000000;
- ctx->rb3d_planemask = 0xffffffff;
-
- ctx->se_vport_xscale = 0x00000000;
- ctx->se_vport_xoffset = 0x00000000;
- ctx->se_vport_yscale = 0x00000000;
- ctx->se_vport_yoffset = 0x00000000;
- ctx->se_vport_zscale = 0x00000000;
- ctx->se_vport_zoffset = 0x00000000;
-
- ctx->se_cntl_status = (RADEON_VC_NO_SWAP |
- RADEON_TCL_BYPASS);
-
-#ifdef TCL_ENABLE
- /* FIXME: Obviously these need to be properly initialized */
- ctx->se_tcl_material_emmissive.red = 0x00000000;
- ctx->se_tcl_material_emmissive.green = 0x00000000;
- ctx->se_tcl_material_emmissive.blue = 0x00000000;
- ctx->se_tcl_material_emmissive.alpha = 0x00000000;
-
- ctx->se_tcl_material_ambient.red = 0x00000000;
- ctx->se_tcl_material_ambient.green = 0x00000000;
- ctx->se_tcl_material_ambient.blue = 0x00000000;
- ctx->se_tcl_material_ambient.alpha = 0x00000000;
-
- ctx->se_tcl_material_diffuse.red = 0x00000000;
- ctx->se_tcl_material_diffuse.green = 0x00000000;
- ctx->se_tcl_material_diffuse.blue = 0x00000000;
- ctx->se_tcl_material_diffuse.alpha = 0x00000000;
-
- ctx->se_tcl_material_specular.red = 0x00000000;
- ctx->se_tcl_material_specular.green = 0x00000000;
- ctx->se_tcl_material_specular.blue = 0x00000000;
- ctx->se_tcl_material_specular.alpha = 0x00000000;
-
- ctx->se_tcl_shininess = 0x00000000;
- ctx->se_tcl_output_vtx_fmt = 0x00000000;
- ctx->se_tcl_output_vtx_sel = 0x00000000;
- ctx->se_tcl_matrix_select_0 = 0x00000000;
- ctx->se_tcl_matrix_select_1 = 0x00000000;
- ctx->se_tcl_ucp_vert_blend_ctl = 0x00000000;
- ctx->se_tcl_texture_proc_ctl = 0x00000000;
- ctx->se_tcl_light_model_ctl = 0x00000000;
- for ( i = 0 ; i < 4 ; i++ ) {
- ctx->se_tcl_per_light_ctl[i] = 0x00000000;
- }
-#endif
-
- ctx->re_top_left = ((0 << RADEON_RE_LEFT_SHIFT) |
- (0 << RADEON_RE_TOP_SHIFT) );
-
- ctx->re_misc = ((0 << RADEON_STIPPLE_X_OFFSET_SHIFT) |
- (0 << RADEON_STIPPLE_Y_OFFSET_SHIFT) |
- RADEON_STIPPLE_LITTLE_BIT_ORDER);
-
- /* Initialize the texture state */
- for (i = 0; i < RADEON_MAX_TEXTURE_UNITS; i++) {
- tex = &pSAREAPriv->TexState[i];
-
- tex->pp_txfilter = 0x00000000;
- tex->pp_txformat = 0x00000000;
- tex->pp_txoffset = 0x00000000;
- tex->pp_txcblend = 0x00000000;
- tex->pp_txablend = 0x00000000;
- tex->pp_tfactor = 0x00000000;
- tex->pp_border_color = 0x00000000;
- }
-
- /* Mark the context as dirty */
- pSAREAPriv->dirty = RADEON_UPLOAD_ALL;
-
- /* Mark the X server as the last context owner */
- pSAREAPriv->ctxOwner = DRIGetContext(pScreen);
-}
/* Initialize the screen-specific data structures for the DRI and the
* Radeon. This is the main entry point to the device-specific
@@ -1406,7 +1236,15 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
info->pDRIInfo = pDRIInfo;
pDRIInfo->drmDriverName = RADEON_DRIVER_NAME;
- pDRIInfo->clientDriverName = RADEON_DRIVER_NAME;
+
+ if (info->ChipFamily == CHIP_FAMILY_R200)
+ pDRIInfo->clientDriverName = R200_DRIVER_NAME;
+ else if ((info->ChipFamily == CHIP_FAMILY_RV250) ||
+ (info->ChipFamily == CHIP_FAMILY_M9))
+ pDRIInfo->clientDriverName = RV250_DRIVER_NAME;
+ else
+ pDRIInfo->clientDriverName = RADEON_DRIVER_NAME;
+
pDRIInfo->busIdString = xalloc(64);
sprintf(pDRIInfo->busIdString,
"PCI:%d:%d:%d",
@@ -1425,6 +1263,7 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
< RADEON_MAX_DRAWABLES
? SAREA_MAX_DRAWABLES
: RADEON_MAX_DRAWABLES);
+
#ifdef PER_CONTEXT_SAREA
/* This is only here for testing per-context SAREAs. When used, the
magic number below would be properly defined in a header file. */
@@ -1442,7 +1281,7 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
/* For now the mapping works by using a fixed size defined
* in the SAREA header
*/
- if (sizeof(XF86DRISAREARec)+sizeof(RADEONSAREAPriv)>SAREA_MAX) {
+ if (sizeof(XF86DRISAREARec)+sizeof(RADEONSAREAPriv) > SAREA_MAX) {
ErrorF("Data does not fit in SAREA\n");
return FALSE;
}
@@ -1464,6 +1303,12 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
pDRIInfo->InitBuffers = RADEONDRIInitBuffers;
pDRIInfo->MoveBuffers = RADEONDRIMoveBuffers;
pDRIInfo->bufferRequests = DRI_ALL_WINDOWS;
+ pDRIInfo->OpenFullScreen = RADEONDRIOpenFullScreen;
+ pDRIInfo->CloseFullScreen = RADEONDRICloseFullScreen;
+ pDRIInfo->TransitionTo2d = RADEONDRITransitionTo2d;
+ pDRIInfo->TransitionTo3d = RADEONDRITransitionTo3d;
+ pDRIInfo->TransitionSingleToMulti3D = RADEONDRITransitionSingleToMulti3d;
+ pDRIInfo->TransitionMultiToSingle3D = RADEONDRITransitionMultiToSingle3d;
pDRIInfo->createDummyCtx = TRUE;
pDRIInfo->createDummyCtxPriv = FALSE;
@@ -1478,17 +1323,32 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
return FALSE;
}
- /* Check the radeon DRM version */
- version = drmGetVersion(info->drmFD);
+ /* Check the DRM lib version.
+ * drmGetLibVersion was not supported in version 1.0, so check for
+ * symbol first to avoid possible crash or hang.
+ */
+ if (xf86LoaderCheckSymbol("drmGetLibVersion")) {
+ version = drmGetLibVersion(info->drmFD);
+ } else {
+ /* drmlib version 1.0.0 didn't have the drmGetLibVersion
+ * entry point. Fake it by allocating a version record
+ * via drmGetVersion and changing it to version 1.0.0.
+ */
+ version = drmGetVersion(info->drmFD);
+ version->version_major = 1;
+ version->version_minor = 0;
+ version->version_patchlevel = 0;
+ }
+
if (version) {
if (version->version_major != 1 ||
version->version_minor < 1) {
- /* Incompatible drm version */
+ /* incompatible drm library version */
xf86DrvMsg(pScreen->myNum, X_ERROR,
"[dri] RADEONDRIScreenInit failed because of a "
"version mismatch.\n"
- "[dri] radeon.o kernel module version is %d.%d.%d "
- "but version 1.1.x is needed.\n"
+ "[dri] libdrm.a module version is %d.%d.%d but "
+ "version 1.1.x is needed.\n"
"[dri] Disabling DRI.\n",
version->version_major,
version->version_minor,
@@ -1500,6 +1360,61 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
drmFreeVersion(version);
}
+ /* Check the radeon DRM version */
+ version = drmGetVersion(info->drmFD);
+ if (version) {
+ int req_minor, req_patch;
+
+ if ((info->ChipFamily == CHIP_FAMILY_R200) ||
+ (info->ChipFamily == CHIP_FAMILY_RV250) ||
+ (info->ChipFamily == CHIP_FAMILY_M9)) {
+ req_minor = 5;
+ req_patch = 0;
+ } else {
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+ req_minor = 1;
+ req_patch = 0;
+#else
+ req_minor = 2;
+ req_patch = 1;
+#endif
+ }
+
+ if (version->version_major != 1 ||
+ version->version_minor < req_minor ||
+ (version->version_minor == req_minor &&
+ version->version_patchlevel < req_patch)) {
+ /* Incompatible drm version */
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] RADEONDRIScreenInit failed because of a version "
+ "mismatch.\n"
+ "[dri] radeon.o kernel module version is %d.%d.%d "
+ "but version 1.%d.%d or newer is needed.\n"
+ "[dri] Disabling DRI.\n",
+ version->version_major,
+ version->version_minor,
+ version->version_patchlevel,
+ req_minor,
+ req_patch);
+ drmFreeVersion(version);
+ RADEONDRICloseScreen(pScreen);
+ return FALSE;
+ }
+
+ if (version->version_minor < 3) {
+ xf86DrvMsg(pScreen->myNum, X_WARNING,
+ "[dri] Some DRI features disabled because of version "
+ "mismatch.\n"
+ "[dri] radeon.o kernel module version is %d.%d.%d but "
+ "1.3.1 or later is preferred.\n",
+ version->version_major,
+ version->version_minor,
+ version->version_patchlevel);
+ }
+ info->drmMinor = version->version_minor;
+ drmFreeVersion(version);
+ }
+
#if !defined(PCIGART_ENABLED)
/* Initialize AGP */
if (!info->IsPCI && !RADEONDRIAgpInit(info, pScreen)) {
@@ -1589,6 +1504,12 @@ Bool RADEONDRIFinishScreenInit(ScreenPtr pScreen)
return FALSE;
}
+ /* Initialize IRQ */
+ RADEONDRIIrqInit(info, pScreen);
+
+ /* Initialize kernel agp memory manager */
+ RADEONDRIAgpHeapInit(info, pScreen);
+
/* Initialize and start the CP if required */
RADEONDRICPInit(pScrn);
@@ -1596,8 +1517,6 @@ Bool RADEONDRIFinishScreenInit(ScreenPtr pScreen)
pSAREAPriv = (RADEONSAREAPrivPtr)DRIGetSAREAPrivate(pScreen);
memset(pSAREAPriv, 0, sizeof(*pSAREAPriv));
- RADEONDRISAREAInit(pScreen, pSAREAPriv);
-
pRADEONDRI = (RADEONDRIPtr)info->pDRIInfo->devPrivate;
pRADEONDRI->deviceID = info->Chipset;
@@ -1637,6 +1556,13 @@ Bool RADEONDRIFinishScreenInit(ScreenPtr pScreen)
pRADEONDRI->perctx_sarea_size = info->perctx_sarea_size;
#endif
+ /* Have shadowfb run only while there is 3d active. */
+ if (info->allowPageFlip /* && info->drmMinor >= 3 */) {
+ ShadowFBInit2( pScreen, NULL, RADEONDRIRefreshArea, FALSE );
+ } else {
+ info->allowPageFlip = 0;
+ }
+
return TRUE;
}
@@ -1645,13 +1571,29 @@ Bool RADEONDRIFinishScreenInit(ScreenPtr pScreen)
*/
void RADEONDRICloseScreen(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- RADEONInfoPtr info = RADEONPTR(pScrn);
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ drmRadeonInit drmInfo;
+ RING_LOCALS;
/* Stop the CP */
if (info->directRenderingEnabled) {
- if (info->CPStarted) RADEONCP_STOP(pScrn, info);
- else DRIUnlock(pScreen);
+ /* If we've generated any CP commands, we must flush them to the
+ * kernel module now.
+ */
+ if (info->CPInUse) {
+ RADEON_FLUSH_CACHE();
+ RADEON_WAIT_UNTIL_IDLE();
+ RADEONCPReleaseIndirect(pScrn);
+
+ info->CPInUse = FALSE;
+ }
+ RADEONCP_STOP(pScrn, info);
+ }
+
+ if (info->irq) {
+ drmCtlUninstHandler(info->drmFD);
+ info->irq = 0;
}
/* De-allocate vertex buffers */
@@ -1661,7 +1603,10 @@ void RADEONDRICloseScreen(ScreenPtr pScreen)
}
/* De-allocate all kernel resources */
- drmRadeonCleanupCP(info->drmFD);
+ memset(&drmInfo, 0, sizeof(drmRadeonInit));
+ drmInfo.func = DRM_RADEON_CLEANUP_CP;
+ drmCommandWrite(info->drmFD, DRM_RADEON_CP_INIT,
+ &drmInfo, sizeof(drmRadeonInit));
/* De-allocate all AGP resources */
if (info->agpTex) {
@@ -1712,3 +1657,207 @@ void RADEONDRICloseScreen(ScreenPtr pScreen)
info->pVisualConfigsPriv = NULL;
}
}
+
+
+
+/* Fullscreen hooks. The DRI fullscreen mode can probably be removed as
+ * it adds little or nothing above the mechanism below (and isn't widely
+ * used).
+ */
+static Bool RADEONDRIOpenFullScreen(ScreenPtr pScreen)
+{
+ return TRUE;
+}
+
+static Bool RADEONDRICloseFullScreen(ScreenPtr pScreen)
+{
+ return TRUE;
+}
+
+
+
+/* Use callbacks from dri.c to support pageflipping mode for a single
+ * 3d context without need for any specific full-screen extension.
+ *
+ * Also use these callbacks to allocate and free 3d-specific memory on
+ * demand.
+ */
+
+
+/* Use the shadowfb module to maintain a list of dirty rectangles.
+ * These are blitted to the back buffer to keep both buffers clean
+ * during page-flipping when the 3d application isn't fullscreen.
+ *
+ * Unlike most use of the shadowfb code, both buffers are in video memory.
+ *
+ * An alternative to this would be to organize for all on-screen drawing
+ * operations to be duplicated for the two buffers. That might be
+ * faster, but seems like a lot more work...
+ */
+
+
+static void RADEONDRIRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
+{
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ int i;
+ RADEONSAREAPrivPtr pSAREAPriv = DRIGetSAREAPrivate(pScrn->pScreen);
+
+ /* Don't want to do this when no 3d is active and pages are
+ * right-way-round
+ */
+ if (!pSAREAPriv->pfAllowPageFlip && pSAREAPriv->pfCurrentPage == 0)
+ return;
+
+ (*info->accel->SetupForScreenToScreenCopy)(pScrn,
+ 1, 1, GXcopy,
+ (CARD32)(-1), -1);
+
+ for (i = 0 ; i < num ; i++, pbox++) {
+ int x1 = max(pbox->x1, 0), x2 = min(pbox->x2, pScrn->virtualX-1);
+ int y1 = max(pbox->y1, 0), y2 = min(pbox->y2, pScrn->virtualY-1);
+
+ if (x1 <= x2 && y1 <= y2) {
+ (*info->accel->SubsequentScreenToScreenCopy)(pScrn, x1, y1,
+ x1 + info->backX,
+ y1 + info->backY,
+ x2 - x1 + 1,
+ y2 - y1 + 1);
+ }
+ }
+}
+
+static void RADEONEnablePageFlip(ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ RADEONSAREAPrivPtr pSAREAPriv = DRIGetSAREAPrivate(pScreen);
+
+ if (info->allowPageFlip) {
+ /* Duplicate the frontbuffer to the backbuffer */
+ (*info->accel->SetupForScreenToScreenCopy)(pScrn,
+ 1, 1, GXcopy,
+ (CARD32)(-1), -1);
+
+ (*info->accel->SubsequentScreenToScreenCopy)(pScrn,
+ 0,
+ 0,
+ info->backX,
+ info->backY,
+ pScrn->virtualX,
+ pScrn->virtualY);
+
+ pSAREAPriv->pfAllowPageFlip = 1;
+ }
+}
+
+static void RADEONDisablePageFlip(ScreenPtr pScreen)
+{
+ /* Tell the clients not to pageflip. How?
+ * -- Field in sarea, plus bumping the window counters.
+ * -- DRM needs to cope with Front-to-Back swapbuffers.
+ */
+ RADEONSAREAPrivPtr pSAREAPriv = DRIGetSAREAPrivate(pScreen);
+
+ pSAREAPriv->pfAllowPageFlip = 0;
+}
+
+static void RADEONDRITransitionSingleToMulti3d(ScreenPtr pScreen)
+{
+ RADEONDisablePageFlip(pScreen);
+}
+
+static void RADEONDRITransitionMultiToSingle3d(ScreenPtr pScreen)
+{
+ /* Let the remaining 3d app start page flipping again */
+ RADEONEnablePageFlip(pScreen);
+}
+
+static void RADEONDRITransitionTo3d(ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ FBAreaPtr fbarea;
+ int width, height;
+
+ /* reserve offscreen area for back and depth buffers and textures */
+
+ /* If we still have an area for the back buffer reserved, free it
+ * first so we always start with all free offscreen memory, except
+ * maybe for Xv
+ */
+ if (info->backArea) {
+ xf86FreeOffscreenArea(info->backArea);
+ info->backArea = NULL;
+ }
+
+ xf86PurgeUnlockedOffscreenAreas(pScreen);
+
+ xf86QueryLargestOffscreenArea(pScreen, &width, &height, 0, 0, 0);
+
+ /* Free Xv linear offscreen memory if necessary */
+ if (height < (info->depthTexLines + info->backLines)) {
+ xf86FreeOffscreenLinear(info->videoLinear);
+ info->videoLinear = NULL;
+ xf86QueryLargestOffscreenArea(pScreen, &width, &height, 0, 0, 0);
+ }
+
+ /* Reserve placeholder area so the other areas will match the
+ * pre-calculated offsets
+ */
+ fbarea = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth,
+ height
+ - info->depthTexLines
+ - info->backLines,
+ pScrn->displayWidth,
+ NULL, NULL, NULL);
+ if (!fbarea)
+ xf86DrvMsg(pScreen->myNum, X_ERROR, "Unable to reserve placeholder "
+ "offscreen area, you might experience screen corruption\n");
+
+ info->backArea = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth,
+ info->backLines,
+ pScrn->displayWidth,
+ NULL, NULL, NULL);
+ if (!info->backArea)
+ xf86DrvMsg(pScreen->myNum, X_ERROR, "Unable to reserve offscreen "
+ "area for back buffer, you might experience screen "
+ "corruption\n");
+
+ info->depthTexArea = xf86AllocateOffscreenArea(pScreen,
+ pScrn->displayWidth,
+ info->depthTexLines,
+ pScrn->displayWidth,
+ NULL, NULL, NULL);
+ if (!info->depthTexArea)
+ xf86DrvMsg(pScreen->myNum, X_ERROR, "Unable to reserve offscreen "
+ "area for depth buffer and textures, you might "
+ "experience screen corruption\n");
+
+ xf86FreeOffscreenArea(fbarea);
+
+ RADEONEnablePageFlip(pScreen);
+
+ info->have3DWindows = 1;
+}
+
+static void RADEONDRITransitionTo2d(ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ RADEONSAREAPrivPtr pSAREAPriv = DRIGetSAREAPrivate(pScreen);
+
+ /* Shut down shadowing if we've made it back to the front page */
+ if (pSAREAPriv->pfCurrentPage == 0) {
+ RADEONDisablePageFlip(pScreen);
+ xf86FreeOffscreenArea(info->backArea);
+ info->backArea = NULL;
+ } else {
+ xf86DrvMsg(pScreen->myNum, X_WARNING,
+ "[dri] RADEONDRITransitionTo2d: "
+ "kernel failed to unflip buffers.\n");
+ }
+
+ xf86FreeOffscreenArea(info->depthTexArea);
+
+ info->have3DWindows = 0;
+}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c
index 752575b4f..a36809641 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c
@@ -31,7 +31,7 @@
* Authors:
* Kevin E. Martin <martin@xfree86.org>
* Rickard E. Faith <faith@valinux.com>
- * Alan Hourihane <ahourihane@valinux.com>
+ * Alan Hourihane <alanh@fairlite.demon.co.uk>
*
* Credits:
*
@@ -51,7 +51,8 @@
*
* This server does not yet support these XFree86 4.0 features:
* !!!! FIXME !!!!
- * shadowfb
+ * DDC1 & DDC2
+ * shadowfb (Note: dri uses shadowfb for another purpose in radeon_dri.c)
* overlay planes
*
* Modified by Marc Aurele La France (tsi@xfree86.org) for ATI driver merge.
@@ -59,6 +60,7 @@
/* Driver data structures */
#include "radeon.h"
+#include "radeon_macros.h"
#include "radeon_probe.h"
#include "radeon_reg.h"
#include "radeon_version.h"
@@ -122,13 +124,15 @@ typedef enum {
#ifdef XF86DRI
OPTION_IS_PCI,
OPTION_CP_PIO,
- OPTION_NO_SECURITY,
OPTION_USEC_TIMEOUT,
OPTION_AGP_MODE,
+ OPTION_AGP_FW,
OPTION_AGP_SIZE,
OPTION_RING_SIZE,
OPTION_BUFFER_SIZE,
OPTION_DEPTH_MOVE,
+ OPTION_PAGE_FLIP,
+ OPTION_NO_BACKBUFFER,
#endif
OPTION_PANEL_OFF,
OPTION_DDC_MODE,
@@ -150,10 +154,13 @@ const OptionInfoRec RADEONOptions[] = {
{ OPTION_CP_PIO, "CPPIOMode", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_USEC_TIMEOUT, "CPusecTimeout", OPTV_INTEGER, {0}, FALSE },
{ OPTION_AGP_MODE, "AGPMode", OPTV_INTEGER, {0}, FALSE },
+ { OPTION_AGP_FW, "AGPFastWrite", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_AGP_SIZE, "AGPSize", OPTV_INTEGER, {0}, FALSE },
{ OPTION_RING_SIZE, "RingSize", OPTV_INTEGER, {0}, FALSE },
{ OPTION_BUFFER_SIZE, "BufferSize", OPTV_INTEGER, {0}, FALSE },
{ OPTION_DEPTH_MOVE, "EnableDepthMoves", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_PAGE_FLIP, "EnablePageFlip", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_NO_BACKBUFFER, "NoBackBuffer", OPTV_BOOLEAN, {0}, FALSE },
#endif
{ OPTION_PANEL_OFF, "PanelOff", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_DDC_MODE, "DDCMode", OPTV_BOOLEAN, {0}, FALSE },
@@ -258,6 +265,9 @@ static const char *ramdacSymbols[] = {
#ifdef XF86DRI
static const char *drmSymbols[] = {
+ "drmGetInterruptFromBusID",
+ "drmCtlInstHandler",
+ "drmCtlUninstHandler",
"drmAddBufs",
"drmAddMap",
"drmAgpAcquire",
@@ -270,8 +280,13 @@ static const char *drmSymbols[] = {
"drmAgpRelease",
"drmAgpUnbind",
"drmAgpVendorId",
+ "drmCommandNone",
+ "drmCommandRead",
+ "drmCommandWrite",
+ "drmCommandWriteRead",
"drmDMA",
"drmFreeVersion",
+ "drmGetLibVersion",
"drmGetVersion",
"drmMap",
"drmMapBufs",
@@ -303,6 +318,11 @@ static const char *driSymbols[] = {
"GlxSetVisualConfigs",
NULL
};
+
+static const char *driShadowFBSymbols[] = {
+ "ShadowFBInit2",
+ NULL
+};
#endif
static const char *vbeSymbols[] = {
@@ -350,7 +370,7 @@ void RADEONLoaderRefSymLists(void)
int10Symbols,
ddcSymbols,
/* i2csymbols, */
- /* shadowSymbols, */
+ /* driShadowFBSymbols, */
NULL);
}
@@ -903,23 +923,23 @@ static Bool RADEONGetBIOSParameters(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
&(CloneDispOption))) {
char *s = NULL;
+ if (CloneDispOption < 0 || CloneDispOption > 4) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Illegal CloneDisplay Option set, "
+ "using default\n");
+ CloneDispOption = 1;
+ }
+
switch (CloneDispOption) {
case 0: s = "Disable"; break;
case 1: s = "Auto-detect"; break;
case 2: s = "Force On"; break;
case 3: s = "Auto-detect -- use 2nd head overlay"; break;
case 4: s = "Force On -- use 2nd head overlay"; break;
- default:
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Illegal CloneDisplay Option set, "
- "using default\n");
- CloneDispOption = 1;
- break;
}
- if (s)
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "CloneDisplay option: %s (%d)\n",
- s, CloneDispOption);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "CloneDisplay option: %s (%d)\n",
+ s, CloneDispOption);
} else {
/* Default to auto-detect */
CloneDispOption = 1;
@@ -2798,12 +2818,29 @@ static Bool RADEONPreInitCursor(ScrnInfoPtr pScrn)
/* This is called by RADEONPreInit to initialize hardware acceleration */
static Bool RADEONPreInitAccel(ScrnInfoPtr pScrn)
{
+#ifdef XFree86LOADER
RADEONInfoPtr info = RADEONPTR(pScrn);
if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) {
- if (!xf86LoadSubModule(pScrn, "xaa")) return FALSE;
+ int errmaj = 0, errmin = 0;
+
+ info->xaaReq.majorversion = 1;
+ info->xaaReq.minorversion = 1;
+
+ if (!LoadSubModule(pScrn->module, "xaa", NULL, NULL, NULL,
+ &info->xaaReq, &errmaj, &errmin)) {
+ info->xaaReq.minorversion = 0;
+
+ if (!LoadSubModule(pScrn->module, "xaa", NULL, NULL, NULL,
+ &info->xaaReq, &errmaj, &errmin)) {
+ LoaderErrorMsg(NULL, "xaa", errmaj, errmin);
+ return FALSE;
+ }
+ }
xf86LoaderReqSymLists(xaaSymbols, NULL);
}
+#endif
+
return TRUE;
}
@@ -2838,6 +2875,7 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn)
info->ringSize = RADEON_DEFAULT_RING_SIZE;
info->bufSize = RADEON_DEFAULT_BUFFER_SIZE;
info->agpTexSize = RADEON_DEFAULT_AGP_TEX_SIZE;
+ info->agpFastWrite = RADEON_DEFAULT_AGP_FAST_WRITE;
info->CPusecTimeout = RADEON_DEFAULT_CP_TIMEOUT;
@@ -2853,6 +2891,16 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn)
"Using AGP %dx mode\n", info->agpMode);
}
+ if ((info->agpFastWrite = xf86ReturnOptValBool(info->Options,
+ OPTION_AGP_FW,
+ FALSE))) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "Enabling AGP Fast Write\n");
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "AGP Fast Write disabled by default\n");
+ }
+
if (xf86GetOptValInteger(info->Options,
OPTION_AGP_SIZE, (int *)&(info->agpSize))) {
switch (info->agpSize) {
@@ -2924,6 +2972,30 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn)
"Depth moves disabled by default\n");
}
+ /* Two options to try and squeeze as much texture memory as possible
+ * for dedicated 3d rendering boxes
+ */
+ info->noBackBuffer = xf86ReturnOptValBool(info->Options,
+ OPTION_NO_BACKBUFFER,
+ FALSE);
+
+ if (info->noBackBuffer) {
+ info->allowPageFlip = 0;
+ } else if (!xf86LoadSubModule(pScrn, "shadowfb")) {
+ info->allowPageFlip = 0;
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Couldn't load shadowfb module:\n");
+ } else {
+ xf86LoaderReqSymLists(driShadowFBSymbols, NULL);
+
+ info->allowPageFlip = xf86ReturnOptValBool(info->Options,
+ OPTION_PAGE_FLIP,
+ FALSE);
+ }
+
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Page flipping %sabled\n",
+ info->allowPageFlip ? "en" : "dis");
+
return TRUE;
}
#endif
@@ -3058,18 +3130,24 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags)
}
if (xf86ReturnOptValBool(info->Options, OPTION_FBDEV, FALSE)) {
- info->FBDev = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using framebuffer device\n");
- }
+ /* check for Linux framebuffer device */
- if (info->FBDev) {
- /* Check for linux framebuffer device */
- if (!xf86LoadSubModule(pScrn, "fbdevhw")) return FALSE;
- xf86LoaderReqSymLists(fbdevHWSymbols, NULL);
- if (!fbdevHWInit(pScrn, info->PciInfo, NULL)) return FALSE;
- pScrn->SwitchMode = fbdevHWSwitchMode;
- pScrn->AdjustFrame = fbdevHWAdjustFrame;
- pScrn->ValidMode = fbdevHWValidMode;
+ if (xf86LoadSubModule(pScrn, "fbdevhw")) {
+ xf86LoaderReqSymLists(fbdevHWSymbols, NULL);
+
+ if (fbdevHWInit(pScrn, info->PciInfo, NULL)) {
+ pScrn->ValidMode = fbdevHWValidMode;
+ info->FBDev = TRUE;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "Using framebuffer device\n");
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "fbdevHWInit failed, not using framebuffer device\n");
+ }
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Couldn't load fbdevhw module, not using framebuffer device\n");
+ }
}
if (!info->FBDev)
@@ -3151,67 +3229,30 @@ static void RADEONLoadPalette(ScrnInfoPtr pScrn, int numColors,
int idx, j;
unsigned char r, g, b;
- /* If the second monitor is connected, we also need to deal with the
- * secondary palette
- */
- if (info->IsSecondary) j = 1;
- else j = 0;
-
- PAL_SELECT(j);
-
- if (info->CurrentLayout.depth == 15) {
- /* 15bpp mode. This sends 32 values. */
- for (i = 0; i < numColors; i++) {
- idx = indices[i];
- r = colors[idx].red;
- g = colors[idx].green;
- b = colors[idx].blue;
- OUTPAL(idx * 8, r, g, b);
- }
- } else if (info->CurrentLayout.depth == 16) {
- /* 16bpp mode. This sends 64 values.
- *
- * There are twice as many green values as there are values for
- * red and blue. So, we take each red and blue pair, and
- * combine it with each of the two green values.
- */
- for (i = 0; i < numColors; i++) {
- idx = indices[i];
- r = colors[idx / 2].red;
- g = colors[idx].green;
- b = colors[idx / 2].blue;
- OUTPAL(idx * 4, r, g, b);
-
- /* AH - Added to write extra green data - How come this isn't
- * needed on R128 ? We didn't load the extra green data in the
- * other routine */
- if (idx <= 31) {
- r = colors[idx].red;
- g = colors[(idx * 2) + 1].green;
- b = colors[idx].blue;
- OUTPAL(idx * 8, r, g, b);
- }
- }
+#ifdef XF86DRI
+ if (info->CPStarted) DRILock(pScrn->pScreen, 0);
+#endif
+
+ if (info->accelOn) info->accel->Sync(pScrn);
+
+ if (info->FBDev) {
+ fbdevHWLoadPalette(pScrn, numColors, indices, colors, pVisual);
} else {
- /* 8bpp mode. This sends 256 values. */
- for (i = 0; i < numColors; i++) {
- idx = indices[i];
- r = colors[idx].red;
- b = colors[idx].blue;
- g = colors[idx].green;
- OUTPAL(idx, r, g, b);
- }
- }
+ /* If the second monitor is connected, we also need to deal with
+ * the secondary palette
+ */
+ if (info->IsSecondary) j = 1;
+ else j = 0;
+
+ PAL_SELECT(j);
- if (info->Clone) {
- PAL_SELECT(1);
if (info->CurrentLayout.depth == 15) {
/* 15bpp mode. This sends 32 values. */
for (i = 0; i < numColors; i++) {
idx = indices[i];
- r = colors[idx].red;
- g = colors[idx].green;
- b = colors[idx].blue;
+ r = colors[idx].red;
+ g = colors[idx].green;
+ b = colors[idx].blue;
OUTPAL(idx * 8, r, g, b);
}
} else if (info->CurrentLayout.depth == 16) {
@@ -3223,18 +3264,21 @@ static void RADEONLoadPalette(ScrnInfoPtr pScrn, int numColors,
*/
for (i = 0; i < numColors; i++) {
idx = indices[i];
- r = colors[idx / 2].red;
- g = colors[idx].green;
- b = colors[idx / 2].blue;
+ r = colors[idx / 2].red;
+ g = colors[idx].green;
+ b = colors[idx / 2].blue;
+ RADEONWaitForFifo(pScrn, 32); /* delay */
OUTPAL(idx * 4, r, g, b);
/* AH - Added to write extra green data - How come this isn't
- * needed on R128 ? We didn't load the extra green data in the
- * other routine */
+ * needed on R128? We didn't load the extra green data in the
+ * other routine
+ */
if (idx <= 31) {
- r = colors[idx].red;
- g = colors[(idx * 2) + 1].green;
- b = colors[idx].blue;
+ r = colors[idx].red;
+ g = colors[(idx * 2) + 1].green;
+ b = colors[idx].blue;
+ RADEONWaitForFifo(pScrn, 32); /* delay */
OUTPAL(idx * 8, r, g, b);
}
}
@@ -3242,13 +3286,66 @@ static void RADEONLoadPalette(ScrnInfoPtr pScrn, int numColors,
/* 8bpp mode. This sends 256 values. */
for (i = 0; i < numColors; i++) {
idx = indices[i];
- r = colors[idx].red;
- b = colors[idx].blue;
- g = colors[idx].green;
+ r = colors[idx].red;
+ b = colors[idx].blue;
+ g = colors[idx].green;
+ RADEONWaitForFifo(pScrn, 32); /* delay */
OUTPAL(idx, r, g, b);
}
}
+
+ if (info->Clone) {
+ PAL_SELECT(1);
+ if (info->CurrentLayout.depth == 15) {
+ /* 15bpp mode. This sends 32 values. */
+ for (i = 0; i < numColors; i++) {
+ idx = indices[i];
+ r = colors[idx].red;
+ g = colors[idx].green;
+ b = colors[idx].blue;
+ OUTPAL(idx * 8, r, g, b);
+ }
+ } else if (info->CurrentLayout.depth == 16) {
+ /* 16bpp mode. This sends 64 values.
+ *
+ * There are twice as many green values as there are values
+ * for red and blue. So, we take each red and blue pair,
+ * and combine it with each of the two green values.
+ */
+ for (i = 0; i < numColors; i++) {
+ idx = indices[i];
+ r = colors[idx / 2].red;
+ g = colors[idx].green;
+ b = colors[idx / 2].blue;
+ OUTPAL(idx * 4, r, g, b);
+
+ /* AH - Added to write extra green data - How come
+ * this isn't needed on R128? We didn't load the
+ * extra green data in the other routine.
+ */
+ if (idx <= 31) {
+ r = colors[idx].red;
+ g = colors[(idx * 2) + 1].green;
+ b = colors[idx].blue;
+ OUTPAL(idx * 8, r, g, b);
+ }
+ }
+ } else {
+ /* 8bpp mode. This sends 256 values. */
+ for (i = 0; i < numColors; i++) {
+ idx = indices[i];
+ r = colors[idx].red;
+ b = colors[idx].blue;
+ g = colors[idx].green;
+ OUTPAL(idx, r, g, b);
+ }
+ }
+ }
}
+
+#ifdef XF86DRI
+ if (info->CPStarted) DRIUnlock(pScrn->pScreen);
+#endif
}
static void RADEONBlockHandler(int i, pointer blockData,
@@ -3284,11 +3381,12 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
#ifdef XF86DRI
/* Turn off the CP for now. */
- info->CPInUse = FALSE;
- info->indirectBuffer = NULL;
+ info->CPInUse = FALSE;
+ info->CPStarted = FALSE;
+ info->directRenderingEnabled = FALSE;
#endif
-
- pScrn->fbOffset = 0;
+ info->accelOn = FALSE;
+ pScrn->fbOffset = 0;
if (info->IsSecondary) pScrn->fbOffset = pScrn->videoRam * 1024;
if (!RADEONMapMem(pScrn)) return FALSE;
@@ -3318,8 +3416,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
(pScrn->virtualX - info->CurCloneMode->HDisplay) / 2;
info->CloneFrameY0 =
(pScrn->virtualY - info->CurCloneMode->VDisplay) / 2;
- pScrn->AdjustFrame(scrnIndex,
- info->CloneFrameX0, info->CloneFrameY0, 1);
+ RADEONDoAdjustFrame(pScrn, info->CloneFrameX0, info->CloneFrameY0, TRUE);
}
/* Visual setup */
@@ -3356,11 +3453,11 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
(pScrn->displayWidth * pScrn->virtualY *
info->CurrentLayout.pixel_bytes * 3 + 1023) / 1024);
info->directRenderingEnabled = FALSE;
- } else if (info->ChipFamily >= CHIP_FAMILY_R200) {
+ } else if (info->ChipFamily >= CHIP_FAMILY_R300) {
info->directRenderingEnabled = FALSE;
xf86DrvMsg(scrnIndex, X_WARNING,
"Direct rendering not yet supported on "
- "Radeon 8500 and newer cards\n");
+ "Radeon 9700 and newer cards\n");
} else {
if (info->IsSecondary)
info->directRenderingEnabled = FALSE;
@@ -3459,6 +3556,9 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
int bufferSize = ((pScrn->virtualY * width_bytes
+ RADEON_BUFFER_ALIGN)
& ~RADEON_BUFFER_ALIGN);
+ int depthSize = ((((pScrn->virtualY+15) & ~15) * width_bytes
+ + RADEON_BUFFER_ALIGN)
+ & ~RADEON_BUFFER_ALIGN);
int l;
int scanlines;
@@ -3490,7 +3590,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
* pixmap cache. Should be enough for a fullscreen background
* image plus some leftovers.
*/
- info->textureSize = info->FbMapSize - 6 * bufferSize;
+ info->textureSize = info->FbMapSize - 5 * bufferSize - depthSize;
/* If that gives us less than half the available memory, let's
* be greedy and grab some more. Sorry, I care more about 3D
@@ -3498,18 +3598,28 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
* framebuffer's worth of pixmap cache anyway.
*/
if (info->textureSize < (int)info->FbMapSize / 2) {
- info->textureSize = info->FbMapSize - 5 * bufferSize;
+ info->textureSize = info->FbMapSize - 4 * bufferSize - depthSize;
}
if (info->textureSize < (int)info->FbMapSize / 2) {
- info->textureSize = info->FbMapSize - 4 * bufferSize;
+ info->textureSize = info->FbMapSize - 3 * bufferSize - depthSize;
+ }
+ /* If there's still no space for textures, try without pixmap cache */
+ if (info->textureSize < 0) {
+ info->textureSize = info->FbMapSize - 2 * bufferSize - depthSize
+ - 64/4*64;
}
/* Check to see if there is more room available after the 8192nd
scanline for textures */
- if ((int)info->FbMapSize - 8192*width_bytes - bufferSize*2
+ if ((int)info->FbMapSize - 8192*width_bytes - bufferSize - depthSize
> info->textureSize) {
info->textureSize =
- info->FbMapSize - 8192*width_bytes - bufferSize*2;
+ info->FbMapSize - 8192*width_bytes - bufferSize - depthSize;
+ }
+
+ /* If backbuffer is disabled, don't allocate memory for it */
+ if (info->noBackBuffer) {
+ info->textureSize += bufferSize;
}
if (info->textureSize > 0) {
@@ -3542,18 +3652,26 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
/* Reserve space for the shared depth
* buffer.
*/
- info->depthOffset = ((info->textureOffset - bufferSize +
+ info->depthOffset = ((info->textureOffset - depthSize +
RADEON_BUFFER_ALIGN) &
~(CARD32)RADEON_BUFFER_ALIGN);
info->depthPitch = pScrn->displayWidth;
/* Reserve space for the shared back buffer */
- info->backOffset = ((info->depthOffset - bufferSize +
- RADEON_BUFFER_ALIGN) &
- ~(CARD32)RADEON_BUFFER_ALIGN);
- info->backPitch = pScrn->displayWidth;
+ if (info->noBackBuffer) {
+ info->backOffset = info->depthOffset;
+ info->backPitch = pScrn->displayWidth;
+ } else {
+ info->backOffset = ((info->depthOffset - bufferSize +
+ RADEON_BUFFER_ALIGN) &
+ ~(CARD32)RADEON_BUFFER_ALIGN);
+ info->backPitch = pScrn->displayWidth;
+ }
+
+ info->backY = info->backOffset / width_bytes;
+ info->backX = (info->backOffset - (info->backY * width_bytes)) / cpp;
- scanlines = info->backOffset / width_bytes - 1;
+ scanlines = info->FbMapSize / width_bytes;
if (scanlines > 8191) scanlines = 8191;
MemBox.x1 = 0;
@@ -3589,17 +3707,32 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
xf86DrvMsg(scrnIndex, X_INFO,
"Largest offscreen area available: %d x %d\n",
width, height);
+
+ /* Lines in offscreen area needed for depth buffer and
+ * textures
+ */
+ info->depthTexLines = (scanlines
+ - info->depthOffset / width_bytes);
+ info->backLines = (scanlines
+ - info->backOffset / width_bytes
+ - info->depthTexLines);
+ info->backArea = NULL;
+ } else {
+ xf86DrvMsg(scrnIndex, X_ERROR,
+ "Unable to determine largest offscreen area "
+ "available\n");
+ return FALSE;
}
}
xf86DrvMsg(scrnIndex, X_INFO,
- "Reserved back buffer at offset 0x%x\n",
+ "Will use back buffer at offset 0x%x\n",
info->backOffset);
xf86DrvMsg(scrnIndex, X_INFO,
- "Reserved depth buffer at offset 0x%x\n",
+ "Will use depth buffer at offset 0x%x\n",
info->depthOffset);
xf86DrvMsg(scrnIndex, X_INFO,
- "Reserved %d kb for textures at offset 0x%x\n",
+ "Will use %d kb for textures at offset 0x%x\n",
info->textureSize/1024, info->textureOffset);
info->frontPitchOffset = (((info->frontPitch * cpp / 64) << 22) |
@@ -3660,10 +3793,6 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
}
- /* Backing store setup */
- miInitializeBackingStore(pScreen);
- xf86SetBackingStore(pScreen);
-
/* Set Silken Mouse */
xf86SetSilkenMouse(pScreen);
@@ -3672,6 +3801,10 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (RADEONAccelInit(pScreen)) {
xf86DrvMsg(scrnIndex, X_INFO, "Acceleration enabled\n");
info->accelOn = TRUE;
+
+ /* FIXME: Figure out why this was added because it shouldn't be! */
+ /* This is needed by the DRI and XAA code for shared entities */
+ pScrn->pScreen = pScreen;
} else {
xf86DrvMsg(scrnIndex, X_ERROR,
"Acceleration initialization failed\n");
@@ -3683,6 +3816,10 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
info->accelOn = FALSE;
}
+ /* Backing store setup */
+ miInitializeBackingStore(pScreen);
+ xf86SetBackingStore(pScreen);
+
/* DGA setup */
RADEONDGAInit(pScreen);
@@ -3696,7 +3833,8 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Using hardware cursor (scanline %d)\n",
- info->cursor_start / pScrn->displayWidth);
+ info->cursor_start / pScrn->displayWidth
+ / info->CurrentLayout.pixel_bytes);
if (xf86QueryLargestOffscreenArea(pScreen, &width, &height,
0, 0, 0)) {
xf86DrvMsg(scrnIndex, X_INFO,
@@ -3715,8 +3853,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
/* Colormap setup */
if (!miCreateDefColormap(pScreen)) return FALSE;
if (!xf86HandleColormaps(pScreen, 256, info->dac6bits ? 6 : 8,
- (info->FBDev ? fbdevHWLoadPalette :
- RADEONLoadPalette), NULL,
+ RADEONLoadPalette, NULL,
CMAP_PALETTED_TRUECOLOR
#if 0 /* This option messes up text mode! (eich@suse.de) */
| CMAP_LOAD_EVEN_IF_OFFSCREEN
@@ -3725,10 +3862,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
/* DPMS setup */
#ifdef DPMSExtension
- if (info->FBDev)
- xf86DPMSInit(pScreen, fbdevHWDPMSSet, 0);
- else
- xf86DPMSInit(pScreen, RADEONDisplayPowerManagementSet, 0);
+ xf86DPMSInit(pScreen, RADEONDisplayPowerManagementSet, 0);
#endif
RADEONInitVideo(pScreen);
@@ -3807,6 +3941,31 @@ static void RADEONRestoreCommonRegisters(ScrnInfoPtr pScrn,
}
}
+/* Write miscellaneous registers which might have been destroyed by an fbdevHW
+ * call
+ */
+static void RADEONRestoreFBDevRegisters(ScrnInfoPtr pScrn,
+ RADEONSavePtr restore)
+{
+#ifdef XF86DRI
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ unsigned char *RADEONMMIO = info->MMIO;
+
+ /* Restore register for vertical blank interrupts */
+ if (info->irq) {
+ OUTREG(RADEON_GEN_INT_CNTL, restore->gen_int_cntl);
+ }
+
+ /* Restore registers for page flipping */
+ if (info->allowPageFlip) {
+ OUTREG(RADEON_CRTC_OFFSET_CNTL, restore->crtc_offset_cntl);
+ if (info->HasCRTC2) {
+ OUTREG(RADEON_CRTC2_OFFSET_CNTL, restore->crtc2_offset_cntl);
+ }
+ }
+#endif
+}
+
/* Write CRTC registers */
static void RADEONRestoreCrtcRegisters(ScrnInfoPtr pScrn,
RADEONSavePtr restore)
@@ -4232,6 +4391,28 @@ static void RADEONSaveCommonRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save)
save->surface_cntl = INREG(RADEON_SURFACE_CNTL);
}
+/* Read miscellaneous registers which might be destroyed by an fbdevHW call */
+static void RADEONSaveFBDevRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save)
+{
+#ifdef XF86DRI
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ unsigned char *RADEONMMIO = info->MMIO;
+
+ /* Save register for vertical blank interrupts */
+ if (info->irq) {
+ save->gen_int_cntl = INREG(RADEON_GEN_INT_CNTL);
+ }
+
+ /* Save registers for page flipping */
+ if (info->allowPageFlip) {
+ save->crtc_offset_cntl = INREG(RADEON_CRTC_OFFSET_CNTL);
+ if (info->HasCRTC2) {
+ save->crtc2_offset_cntl = INREG(RADEON_CRTC2_OFFSET_CNTL);
+ }
+ }
+#endif
+}
+
/* Read CRTC registers */
static void RADEONSaveCrtcRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save)
{
@@ -4423,6 +4604,12 @@ static void RADEONRestore(ScrnInfoPtr pScrn)
vgaHWPtr hwp = VGAHWPTR(pScrn);
RADEONTRACE(("RADEONRestore\n"));
+
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+ RADEONWaitForFifo(pScrn, 1);
+ OUTREG(RADEON_RBBM_GUICNTL, RADEON_HOST_DATA_SWAP_NONE);
+#endif
+
if (info->FBDev) {
fbdevHWRestore(pScrn);
return;
@@ -4515,6 +4702,8 @@ static void RADEONInitCommonRegisters(RADEONSavePtr save, RADEONInfoPtr info)
static Bool RADEONInitCrtcRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save,
DisplayModePtr mode, RADEONInfoPtr info)
{
+ unsigned char *RADEONMMIO = info->MMIO;
+
int format;
int hsync_start;
int hsync_wid;
@@ -4629,14 +4818,15 @@ static Bool RADEONInitCrtcRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save,
: 0));
save->crtc_offset = 0;
- save->crtc_offset_cntl = 0;
+ save->crtc_offset_cntl = INREG(RADEON_CRTC_OFFSET_CNTL);
save->crtc_pitch = (((pScrn->displayWidth * pScrn->bitsPerPixel) +
((pScrn->bitsPerPixel * 8) -1)) /
(pScrn->bitsPerPixel * 8));
save->crtc_pitch |= save->crtc_pitch << 16;
- save->surface_cntl = RADEON_SURF_TRANSLATION_DIS;
+ save->surface_cntl = 0;
+
#if X_BYTE_ORDER == X_BIG_ENDIAN
switch (pScrn->bitsPerPixel) {
case 16:
@@ -4659,6 +4849,8 @@ static Bool RADEONInitCrtcRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save,
static Bool RADEONInitCrtc2Registers(ScrnInfoPtr pScrn, RADEONSavePtr save,
DisplayModePtr mode, RADEONInfoPtr info)
{
+ unsigned char *RADEONMMIO = info->MMIO;
+
int format;
int hsync_start;
int hsync_wid;
@@ -4763,7 +4955,7 @@ static Bool RADEONInitCrtc2Registers(ScrnInfoPtr pScrn, RADEONSavePtr save,
: RADEON_CRTC2_V_SYNC_POL));
save->crtc2_offset = 0;
- save->crtc2_offset_cntl = 0;
+ save->crtc2_offset_cntl = INREG(RADEON_CRTC2_OFFSET_CNTL);
save->crtc2_pitch = (((pScrn->displayWidth * pScrn->bitsPerPixel) +
((pScrn->bitsPerPixel * 8) -1)) /
@@ -5156,7 +5348,6 @@ static Bool RADEONModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
RADEONInfoPtr info = RADEONPTR(pScrn);
if (!RADEONInit(pScrn, mode, &info->ModeReg)) return FALSE;
- /* FIXME? DRILock/DRIUnlock here? */
pScrn->vtSema = TRUE;
RADEONBlank(pScrn);
@@ -5184,72 +5375,102 @@ static Bool RADEONSaveScreen(ScreenPtr pScreen, int mode)
Bool RADEONSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- RADEONInfoPtr info = RADEONPTR(pScrn);
- Bool ret = FALSE;
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ Bool ret;
+#ifdef XF86DRI
+ Bool CPStarted = info->CPStarted;
- info->IsSwitching = TRUE;
- if (info->Clone && info->CloneModes) {
- DisplayModePtr clone_mode = info->CloneModes;
+ if (CPStarted) {
+ DRILock(pScrn->pScreen, 0);
+ RADEONCP_STOP(pScrn, info);
+ }
+#endif
- /* Try to match a mode on primary head
- * FIXME: This may not be good if both heads don't have
- * exactly the same list of mode.
- */
- while (1) {
- if ((clone_mode->HDisplay == mode->HDisplay) &&
- (clone_mode->VDisplay == mode->VDisplay) &&
- (!info->PanelOff)) {
- info->CloneFrameX0 = (info->CurCloneMode->HDisplay +
- info->CloneFrameX0 -
- clone_mode->HDisplay - 1) / 2;
- info->CloneFrameY0 =
- (info->CurCloneMode->VDisplay + info->CloneFrameY0 -
- clone_mode->VDisplay - 1) / 2;
- info->CurCloneMode = clone_mode;
- break;
- }
+ if (info->accelOn) info->accel->Sync(pScrn);
- if (!clone_mode->next) {
- if (info->CurCloneMode->next)
- info->CurCloneMode = info->CurCloneMode->next;
- else
- info->CurCloneMode = info->CloneModes;
+ if (info->FBDev) {
+ RADEONSaveFBDevRegisters(pScrn, &info->ModeReg);
- info->CloneFrameX0 = (info->CurCloneMode->HDisplay +
- info->CloneFrameX0 -
- clone_mode->HDisplay - 1) / 2;
- info->CloneFrameY0 =
- (info->CurCloneMode->VDisplay + info->CloneFrameY0 -
- clone_mode->VDisplay - 1) / 2;
- break;
+ ret = fbdevHWSwitchMode(scrnIndex, mode, flags);
+
+ RADEONRestoreFBDevRegisters(pScrn, &info->ModeReg);
+ } else {
+ info->IsSwitching = TRUE;
+ if (info->Clone && info->CloneModes) {
+ DisplayModePtr clone_mode = info->CloneModes;
+
+ /* Try to match a mode on primary head
+ * FIXME: This may not be good if both heads don't have
+ * exactly the same list of mode.
+ */
+ while (1) {
+ if ((clone_mode->HDisplay == mode->HDisplay) &&
+ (clone_mode->VDisplay == mode->VDisplay) &&
+ (!info->PanelOff)) {
+ info->CloneFrameX0 = (info->CurCloneMode->HDisplay +
+ info->CloneFrameX0 -
+ clone_mode->HDisplay - 1) / 2;
+ info->CloneFrameY0 =
+ (info->CurCloneMode->VDisplay + info->CloneFrameY0 -
+ clone_mode->VDisplay - 1) / 2;
+ info->CurCloneMode = clone_mode;
+ break;
+ }
+
+ if (!clone_mode->next) {
+ if (info->CurCloneMode->next)
+ info->CurCloneMode = info->CurCloneMode->next;
+ else
+ info->CurCloneMode = info->CloneModes;
+
+ info->CloneFrameX0 = (info->CurCloneMode->HDisplay +
+ info->CloneFrameX0 -
+ clone_mode->HDisplay - 1) / 2;
+ info->CloneFrameY0 =
+ (info->CurCloneMode->VDisplay + info->CloneFrameY0 -
+ clone_mode->VDisplay - 1) / 2;
+ break;
+ }
+
+ clone_mode = clone_mode->next;
}
+ }
+ ret = RADEONModeInit(xf86Screens[scrnIndex], mode);
+
+ if (info->CurCloneMode) {
+ if (info->CloneFrameX0 + info->CurCloneMode->HDisplay >=
+ pScrn->virtualX)
+ info->CloneFrameX0 =
+ pScrn->virtualX - info->CurCloneMode->HDisplay;
+ else if (info->CloneFrameX0 < 0)
+ info->CloneFrameX0 = 0;
+
+ if (info->CloneFrameY0 + info->CurCloneMode->VDisplay >=
+ pScrn->virtualY)
+ info->CloneFrameY0 =
+ pScrn->virtualY - info->CurCloneMode->VDisplay;
+ else if (info->CloneFrameY0 < 0)
+ info->CloneFrameY0 = 0;
- clone_mode = clone_mode->next;
+ RADEONDoAdjustFrame(pScrn, info->CloneFrameX0, info->CloneFrameY0, TRUE);
}
- }
- ret = RADEONModeInit(xf86Screens[scrnIndex], mode);
- if (info->CurCloneMode) {
- if (info->CloneFrameX0 + info->CurCloneMode->HDisplay >=
- pScrn->virtualX)
- info->CloneFrameX0 =
- pScrn->virtualX - info->CurCloneMode->HDisplay;
- else if (info->CloneFrameX0 < 0)
- info->CloneFrameX0 = 0;
+ info->IsSwitching = FALSE;
+ }
- if (info->CloneFrameY0 + info->CurCloneMode->VDisplay >=
- pScrn->virtualY)
- info->CloneFrameY0 =
- pScrn->virtualY - info->CurCloneMode->VDisplay;
- else if (info->CloneFrameY0 < 0)
- info->CloneFrameY0 = 0;
+ if (info->accelOn) {
+ info->accel->Sync(pScrn);
+ RADEONEngineRestore(pScrn);
+ }
- pScrn->AdjustFrame(scrnIndex,
- info->CloneFrameX0, info->CloneFrameY0, 1);
+#ifdef XF86DRI
+ if (CPStarted) {
+ RADEONCP_START(pScrn, info);
+ DRIUnlock(pScrn->pScreen);
}
+#endif
- info->IsSwitching = FALSE;
return ret;
}
@@ -5267,14 +5488,14 @@ int RADEONValidMode(int scrnIndex, DisplayModePtr mode,
/* Adjust viewport into virtual desktop such that (0,0) in viewport
* space is (x,y) in virtual space.
*/
-void RADEONAdjustFrame(int scrnIndex, int x, int y, int flags)
+void RADEONDoAdjustFrame(ScrnInfoPtr pScrn, int x, int y, int clone)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
RADEONInfoPtr info = RADEONPTR(pScrn);
unsigned char *RADEONMMIO = info->MMIO;
- int Base;
-
- Base = y * info->CurrentLayout.displayWidth + x;
+ int reg, Base = y * info->CurrentLayout.displayWidth + x;
+#ifdef XF86DRI
+ RADEONSAREAPrivPtr pSAREAPriv;
+#endif
switch (info->CurrentLayout.pixel_code) {
case 15:
@@ -5285,17 +5506,51 @@ void RADEONAdjustFrame(int scrnIndex, int x, int y, int flags)
Base &= ~7; /* 3 lower bits are always 0 */
- if (info->Clone && (flags == 1)) {
+ if (clone || info->IsSecondary) {
Base += pScrn->fbOffset;
- OUTREG(RADEON_CRTC2_OFFSET, Base);
+ reg = RADEON_CRTC2_OFFSET;
} else {
- if (info->IsSecondary) {
- Base += pScrn->fbOffset;
- OUTREG(RADEON_CRTC2_OFFSET, Base);
- } else {
- OUTREG(RADEON_CRTC_OFFSET, Base);
+ reg = RADEON_CRTC_OFFSET;
+ }
+
+#ifdef XF86DRI
+ if (info->directRenderingEnabled) {
+
+ pSAREAPriv = DRIGetSAREAPrivate(pScrn->pScreen);
+
+ if (pSAREAPriv->pfCurrentPage == 1) {
+ Base += info->backOffset;
+ }
+
+ if (clone || info->IsSecondary) {
+ pSAREAPriv->crtc2_base = Base;
}
}
+#endif
+
+ OUTREG(reg, Base);
+}
+
+void RADEONAdjustFrame(int scrnIndex, int x, int y, int flags)
+{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+
+#ifdef XF86DRI
+ if (info->CPStarted) DRILock(pScrn->pScreen, 0);
+#endif
+
+ if (info->accelOn) info->accel->Sync(pScrn);
+
+ if (info->FBDev) {
+ fbdevHWAdjustFrame(scrnIndex, x, y, flags);
+ } else {
+ RADEONDoAdjustFrame(pScrn, x, y, FALSE);
+ }
+
+#ifdef XF86DRI
+ if (info->CPStarted) DRIUnlock(pScrn->pScreen);
+#endif
}
/* Called when VT switching back to the X server. Reinitialize the
@@ -5313,6 +5568,8 @@ Bool RADEONEnterVT(int scrnIndex, int flags)
if (!fbdevHWEnterVT(scrnIndex,flags)) return FALSE;
info->PaletteSavedOnVT = FALSE;
info->ModeReg.surface_cntl = INREG(RADEON_SURFACE_CNTL);
+
+ RADEONRestoreFBDevRegisters(pScrn, &info->ModeReg);
} else
if (!RADEONModeInit(pScrn, pScrn->currentMode)) return FALSE;
@@ -5326,10 +5583,9 @@ Bool RADEONEnterVT(int scrnIndex, int flags)
}
#endif
- RADEONAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
+ pScrn->AdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
if (info->CurCloneMode) {
- pScrn->AdjustFrame(scrnIndex,
- info->CloneFrameX0, info->CloneFrameY0, 1);
+ RADEONDoAdjustFrame(pScrn, info->CloneFrameX0, info->CloneFrameY0, TRUE);
}
return TRUE;
@@ -5355,9 +5611,13 @@ void RADEONLeaveVT(int scrnIndex, int flags)
if (info->FBDev) {
RADEONSavePalette(pScrn, save);
info->PaletteSavedOnVT = TRUE;
+
+ RADEONSaveFBDevRegisters(pScrn, &info->ModeReg);
+
fbdevHWLeaveVT(scrnIndex,flags);
- } else
- RADEONRestore(pScrn);
+ }
+
+ RADEONRestore(pScrn);
}
/* Called at the end of each server generation. Restore the original
@@ -5427,70 +5687,85 @@ static void RADEONDisplayPowerManagementSet(ScrnInfoPtr pScrn,
{
RADEONInfoPtr info = RADEONPTR(pScrn);
unsigned char *RADEONMMIO = info->MMIO;
- int mask1 = (RADEON_CRTC_DISPLAY_DIS |
- RADEON_CRTC_HSYNC_DIS |
- RADEON_CRTC_VSYNC_DIS);
- int mask2 = (RADEON_CRTC2_DISP_DIS |
- RADEON_CRTC2_VSYNC_DIS |
- RADEON_CRTC2_HSYNC_DIS);
-
- /* TODO: additional handling for LCD ? */
-
- switch (PowerManagementMode) {
- case DPMSModeOn:
- /* Screen: On; HSync: On, VSync: On */
- if (info->IsSecondary)
- OUTREGP(RADEON_CRTC2_GEN_CNTL, 0, ~mask2);
- else {
- if (info->Clone)
+
+#ifdef XF86DRI
+ if (info->CPStarted) DRILock(pScrn->pScreen, 0);
+#endif
+
+ if (info->accelOn) info->accel->Sync(pScrn);
+
+ if (info->FBDev) {
+ fbdevHWDPMSSet(pScrn, PowerManagementMode, flags);
+ } else {
+ int mask1 = (RADEON_CRTC_DISPLAY_DIS |
+ RADEON_CRTC_HSYNC_DIS |
+ RADEON_CRTC_VSYNC_DIS);
+ int mask2 = (RADEON_CRTC2_DISP_DIS |
+ RADEON_CRTC2_VSYNC_DIS |
+ RADEON_CRTC2_HSYNC_DIS);
+
+ /* TODO: additional handling for LCD ? */
+
+ switch (PowerManagementMode) {
+ case DPMSModeOn:
+ /* Screen: On; HSync: On, VSync: On */
+ if (info->IsSecondary)
OUTREGP(RADEON_CRTC2_GEN_CNTL, 0, ~mask2);
- OUTREGP(RADEON_CRTC_EXT_CNTL, 0, ~mask1);
- }
- break;
+ else {
+ if (info->Clone)
+ OUTREGP(RADEON_CRTC2_GEN_CNTL, 0, ~mask2);
+ OUTREGP(RADEON_CRTC_EXT_CNTL, 0, ~mask1);
+ }
+ break;
- case DPMSModeStandby:
- /* Screen: Off; HSync: Off, VSync: On */
- if (info->IsSecondary)
- OUTREGP(RADEON_CRTC2_GEN_CNTL,
- RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_HSYNC_DIS,
- ~mask2);
- else {
- if (info->Clone)
+ case DPMSModeStandby:
+ /* Screen: Off; HSync: Off, VSync: On */
+ if (info->IsSecondary)
OUTREGP(RADEON_CRTC2_GEN_CNTL,
RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_HSYNC_DIS,
~mask2);
- OUTREGP(RADEON_CRTC_EXT_CNTL,
- RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_HSYNC_DIS,
- ~mask1);
- }
- break;
+ else {
+ if (info->Clone)
+ OUTREGP(RADEON_CRTC2_GEN_CNTL,
+ RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_HSYNC_DIS,
+ ~mask2);
+ OUTREGP(RADEON_CRTC_EXT_CNTL,
+ RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_HSYNC_DIS,
+ ~mask1);
+ }
+ break;
- case DPMSModeSuspend:
- /* Screen: Off; HSync: On, VSync: Off */
- if (info->IsSecondary)
- OUTREGP(RADEON_CRTC2_GEN_CNTL,
- RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS,
- ~mask2);
- else {
- if (info->Clone)
+ case DPMSModeSuspend:
+ /* Screen: Off; HSync: On, VSync: Off */
+ if (info->IsSecondary)
OUTREGP(RADEON_CRTC2_GEN_CNTL,
RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS,
~mask2);
- OUTREGP(RADEON_CRTC_EXT_CNTL,
- RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_VSYNC_DIS,
- ~mask1);
- }
- break;
+ else {
+ if (info->Clone)
+ OUTREGP(RADEON_CRTC2_GEN_CNTL,
+ RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS,
+ ~mask2);
+ OUTREGP(RADEON_CRTC_EXT_CNTL,
+ RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_VSYNC_DIS,
+ ~mask1);
+ }
+ break;
- case DPMSModeOff:
- /* Screen: Off; HSync: Off, VSync: Off */
- if (info->IsSecondary)
- OUTREGP(RADEON_CRTC2_GEN_CNTL, mask2, ~mask2);
- else {
- if (info->Clone)
+ case DPMSModeOff:
+ /* Screen: Off; HSync: Off, VSync: Off */
+ if (info->IsSecondary)
OUTREGP(RADEON_CRTC2_GEN_CNTL, mask2, ~mask2);
- OUTREGP(RADEON_CRTC_EXT_CNTL, mask1, ~mask1);
+ else {
+ if (info->Clone)
+ OUTREGP(RADEON_CRTC2_GEN_CNTL, mask2, ~mask2);
+ OUTREGP(RADEON_CRTC_EXT_CNTL, mask1, ~mask1);
+ }
+ break;
}
- break;
}
+
+#ifdef XF86DRI
+ if (info->CPStarted) DRIUnlock(pScrn->pScreen);
+#endif
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_macros.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_macros.h
new file mode 100644
index 000000000..abfd283f6
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_macros.h
@@ -0,0 +1,134 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h,v 1.20 2002/10/12 01:38:07 martin Exp $ */
+/*
+ * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
+ * VA Linux Systems Inc., Fremont, California.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation on the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR
+ * THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * Authors:
+ * Kevin E. Martin <martin@xfree86.org>
+ * Rickard E. Faith <faith@valinux.com>
+ * Alan Hourihane <alanh@fairlite.demon.co.uk>
+ *
+ * References:
+ *
+ * !!!! FIXME !!!!
+ * RAGE 128 VR/ RAGE 128 GL Register Reference Manual (Technical
+ * Reference Manual P/N RRG-G04100-C Rev. 0.04), ATI Technologies: April
+ * 1999.
+ *
+ * !!!! FIXME !!!!
+ * RAGE 128 Software Development Manual (Technical Reference Manual P/N
+ * SDK-G04000 Rev. 0.01), ATI Technologies: June 1999.
+ *
+ */
+
+
+#ifndef _RADEON_MACROS_H_
+#define _RADEON_MACROS_H_
+
+#ifdef XFree86Module
+#include "xf86_ansic.h"
+#endif
+#include "compiler.h"
+
+ /* Memory mapped register access macros */
+#define INREG8(addr) MMIO_IN8(RADEONMMIO, addr)
+#define INREG16(addr) MMIO_IN16(RADEONMMIO, addr)
+#define INREG(addr) MMIO_IN32(RADEONMMIO, addr)
+#define OUTREG8(addr, val) MMIO_OUT8(RADEONMMIO, addr, val)
+#define OUTREG16(addr, val) MMIO_OUT16(RADEONMMIO, addr, val)
+#define OUTREG(addr, val) MMIO_OUT32(RADEONMMIO, addr, val)
+
+#define ADDRREG(addr) ((volatile CARD32 *)(pointer)(RADEONMMIO + (addr)))
+
+
+#define OUTREGP(addr, val, mask) \
+do { \
+ CARD32 tmp = INREG(addr); \
+ tmp &= (mask); \
+ tmp |= (val); \
+ OUTREG(addr, tmp); \
+} while (0)
+
+#define INPLL(pScrn, addr) RADEONINPLL(pScrn, addr)
+
+#define OUTPLL(addr, val) \
+do { \
+ OUTREG8(RADEON_CLOCK_CNTL_INDEX, (((addr) & 0x3f) | \
+ RADEON_PLL_WR_EN)); \
+ OUTREG(RADEON_CLOCK_CNTL_DATA, val); \
+} while (0)
+
+#define OUTPLLP(pScrn, addr, val, mask) \
+do { \
+ CARD32 tmp = INPLL(pScrn, addr); \
+ tmp &= (mask); \
+ tmp |= (val); \
+ OUTPLL(addr, tmp); \
+} while (0)
+
+#define OUTPAL_START(idx) \
+do { \
+ OUTREG8(RADEON_PALETTE_INDEX, (idx)); \
+} while (0)
+
+#define OUTPAL_NEXT(r, g, b) \
+do { \
+ OUTREG(RADEON_PALETTE_DATA, ((r) << 16) | ((g) << 8) | (b)); \
+} while (0)
+
+#define OUTPAL_NEXT_CARD32(v) \
+do { \
+ OUTREG(RADEON_PALETTE_DATA, (v & 0x00ffffff)); \
+} while (0)
+
+#define OUTPAL(idx, r, g, b) \
+do { \
+ OUTPAL_START((idx)); \
+ OUTPAL_NEXT((r), (g), (b)); \
+} while (0)
+
+#define INPAL_START(idx) \
+do { \
+ OUTREG(RADEON_PALETTE_INDEX, (idx) << 16); \
+} while (0)
+
+#define INPAL_NEXT() INREG(RADEON_PALETTE_DATA)
+
+#define PAL_SELECT(idx) \
+do { \
+ if (!idx) { \
+ OUTREG(RADEON_DAC_CNTL2, INREG(RADEON_DAC_CNTL2) & \
+ (CARD32)~RADEON_DAC2_PALETTE_ACC_CTL); \
+ } else { \
+ OUTREG(RADEON_DAC_CNTL2, INREG(RADEON_DAC_CNTL2) | \
+ RADEON_DAC2_PALETTE_ACC_CTL); \
+ } \
+} while (0)
+
+
+#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h
index 3a61991cf..22a278add 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h
@@ -31,7 +31,7 @@
* Authors:
* Kevin E. Martin <martin@xfree86.org>
* Rickard E. Faith <faith@valinux.com>
- * Alan Hourihane <ahourihane@valinux.com>
+ * Alan Hourihane <alanh@fairlite.demon.co.uk>
*
* References:
*
@@ -53,85 +53,6 @@
#ifndef _RADEON_REG_H_
#define _RADEON_REG_H_
-#include "xf86_ansic.h"
-#include "compiler.h"
-
- /* Memory mapped register access macros */
-#define INREG8(addr) MMIO_IN8(RADEONMMIO, addr)
-#define INREG16(addr) MMIO_IN16(RADEONMMIO, addr)
-#define INREG(addr) MMIO_IN32(RADEONMMIO, addr)
-#define OUTREG8(addr, val) MMIO_OUT8(RADEONMMIO, addr, val)
-#define OUTREG16(addr, val) MMIO_OUT16(RADEONMMIO, addr, val)
-#define OUTREG(addr, val) MMIO_OUT32(RADEONMMIO, addr, val)
-
-#define ADDRREG(addr) ((volatile CARD32 *)(pointer)(RADEONMMIO + (addr)))
-
-
-#define OUTREGP(addr, val, mask) \
-do { \
- CARD32 tmp = INREG(addr); \
- tmp &= (mask); \
- tmp |= (val); \
- OUTREG(addr, tmp); \
-} while (0)
-
-#define INPLL(pScrn, addr) RADEONINPLL(pScrn, addr)
-
-#define OUTPLL(addr, val) \
-do { \
- OUTREG8(RADEON_CLOCK_CNTL_INDEX, (((addr) & 0x3f) | \
- RADEON_PLL_WR_EN)); \
- OUTREG(RADEON_CLOCK_CNTL_DATA, val); \
-} while (0)
-
-#define OUTPLLP(pScrn, addr, val, mask) \
-do { \
- CARD32 tmp = INPLL(pScrn, addr); \
- tmp &= (mask); \
- tmp |= (val); \
- OUTPLL(addr, tmp); \
-} while (0)
-
-#define OUTPAL_START(idx) \
-do { \
- OUTREG8(RADEON_PALETTE_INDEX, (idx)); \
-} while (0)
-
-#define OUTPAL_NEXT(r, g, b) \
-do { \
- OUTREG(RADEON_PALETTE_DATA, ((r) << 16) | ((g) << 8) | (b)); \
-} while (0)
-
-#define OUTPAL_NEXT_CARD32(v) \
-do { \
- OUTREG(RADEON_PALETTE_DATA, (v & 0x00ffffff)); \
-} while (0)
-
-#define OUTPAL(idx, r, g, b) \
-do { \
- OUTPAL_START((idx)); \
- OUTPAL_NEXT((r), (g), (b)); \
-} while (0)
-
-#define INPAL_START(idx) \
-do { \
- OUTREG(RADEON_PALETTE_INDEX, (idx) << 16); \
-} while (0)
-
-#define INPAL_NEXT() INREG(RADEON_PALETTE_DATA)
-
-#define PAL_SELECT(idx) \
-do { \
- if (!idx) { \
- OUTREG(RADEON_DAC_CNTL2, INREG(RADEON_DAC_CNTL2) & \
- (CARD32)~RADEON_DAC2_PALETTE_ACC_CTL); \
- } else { \
- OUTREG(RADEON_DAC_CNTL2, INREG(RADEON_DAC_CNTL2) | \
- RADEON_DAC2_PALETTE_ACC_CTL); \
- } \
-} while (0)
-
-
/* Registers for 2D/Video/Overlay */
#define RADEON_ADAPTER_ID 0x0f2c /* PCI */
#define RADEON_AGP_BASE 0x0170
@@ -150,7 +71,8 @@ do { \
# define RADEON_AGP_1X_MODE 0x01
# define RADEON_AGP_2X_MODE 0x02
# define RADEON_AGP_4X_MODE 0x04
-# define RADEON_AGP_MODE_MASK 0x07
+# define RADEON_AGP_FW_MODE 0x10
+# define RADEON_AGP_MODE_MASK 0x17
#define RADEON_ATTRDR 0x03c1 /* VGA */
#define RADEON_ATTRDW 0x03c0 /* VGA */
#define RADEON_ATTRX 0x03c0 /* VGA */
@@ -307,7 +229,6 @@ do { \
#define RADEON_CRC_CMDFIFO_ADDR 0x0740
#define RADEON_CRC_CMDFIFO_DOUT 0x0744
#define RADEON_CRTC_CRNT_FRAME 0x0214
-#define RADEON_CRTC_DEBUG 0x021c
#define RADEON_CRTC_EXT_CNTL 0x0054
# define RADEON_CRTC_VGA_XOVERSCAN (1 << 0)
# define RADEON_VGA_ATI_LINEAR (1 << 3)
@@ -407,7 +328,6 @@ do { \
#define RADEON_CRTC_VLINE_CRNT_VLINE 0x0210
# define RADEON_CRTC_CRNT_VLINE_MASK (0x7ff << 16)
#define RADEON_CRTC2_CRNT_FRAME 0x0314
-#define RADEON_CRTC2_DEBUG 0x031c
#define RADEON_CRTC2_GUI_TRIG_VLINE 0x0318
#define RADEON_CRTC2_STATUS 0x03fc
#define RADEON_CRTC2_VLINE_CRNT_VLINE 0x0310
@@ -717,13 +637,6 @@ do { \
# define RADEON_GPIO_MASK_1 (1 << 25) /*??*/
#define RADEON_GRPH8_DATA 0x03cf /* VGA */
#define RADEON_GRPH8_IDX 0x03ce /* VGA */
-#define RADEON_GUI_DEBUG0 0x16a0
-#define RADEON_GUI_DEBUG1 0x16a4
-#define RADEON_GUI_DEBUG2 0x16a8
-#define RADEON_GUI_DEBUG3 0x16ac
-#define RADEON_GUI_DEBUG4 0x16b0
-#define RADEON_GUI_DEBUG5 0x16b4
-#define RADEON_GUI_DEBUG6 0x16b8
#define RADEON_GUI_SCRATCH_REG0 0x15e0
#define RADEON_GUI_SCRATCH_REG1 0x15e4
#define RADEON_GUI_SCRATCH_REG2 0x15e8
@@ -745,8 +658,6 @@ do { \
# define RADEON_HDP_SOFT_RESET (1 << 26)
#define RADEON_HTOTAL_CNTL 0x0009 /* PLL */
#define RADEON_HTOTAL2_CNTL 0x002e /* PLL */
-#define RADEON_HW_DEBUG 0x0128
-#define RADEON_HW_DEBUG2 0x011c
#define RADEON_I2C_CNTL_1 0x0094 /* ? */
#define RADEON_DVI_I2C_CNTL_1 0x02e4 /* ? */
@@ -1208,7 +1119,7 @@ do { \
# define RADEON_MAX_ANISO_8_TO_1 (3 << 5)
# define RADEON_MAX_ANISO_16_TO_1 (4 << 5)
# define RADEON_MAX_ANISO_MASK (7 << 5)
-# define RADEON_LOD_BIAS_MASK (0xffff << 8)
+# define RADEON_LOD_BIAS_MASK (0xff << 8)
# define RADEON_LOD_BIAS_SHIFT 8
# define RADEON_MAX_MIP_LEVEL_MASK (0x0f << 16)
# define RADEON_MAX_MIP_LEVEL_SHIFT 16
@@ -1251,6 +1162,10 @@ do { \
# define RADEON_TXFORMAT_WIDTH_SHIFT 8
# define RADEON_TXFORMAT_HEIGHT_MASK (15 << 12)
# define RADEON_TXFORMAT_HEIGHT_SHIFT 12
+# define RADEON_TXFORMAT_F5_WIDTH_MASK (15 << 16)
+# define RADEON_TXFORMAT_F5_WIDTH_SHIFT 16
+# define RADEON_TXFORMAT_F5_HEIGHT_MASK (15 << 20)
+# define RADEON_TXFORMAT_F5_HEIGHT_SHIFT 20
# define RADEON_TXFORMAT_ST_ROUTE_STQ0 (0 << 24)
# define RADEON_TXFORMAT_ST_ROUTE_MASK (3 << 24)
# define RADEON_TXFORMAT_ST_ROUTE_STQ1 (1 << 24)
@@ -1263,6 +1178,26 @@ do { \
# define RADEON_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29)
# define RADEON_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30)
# define RADEON_TXFORMAT_PERSPECTIVE_ENABLE (1 << 31)
+#define RADEON_PP_CUBIC_FACES_0 0x1d24
+#define RADEON_PP_CUBIC_FACES_1 0x1d28
+#define RADEON_PP_CUBIC_FACES_2 0x1d2c
+# define RADEON_FACE_WIDTH_1_SHIFT 0
+# define RADEON_FACE_HEIGHT_1_SHIFT 4
+# define RADEON_FACE_WIDTH_1_MASK 0xf << 0)
+# define RADEON_FACE_HEIGHT_1_MASK 0xf << 4)
+# define RADEON_FACE_WIDTH_2_SHIFT 8
+# define RADEON_FACE_HEIGHT_2_SHIFT 2
+# define RADEON_FACE_WIDTH_2_MASK 0xf << 8)
+# define RADEON_FACE_HEIGHT_2_MASK 0xf << 12)
+# define RADEON_FACE_WIDTH_3_SHIFT 6
+# define RADEON_FACE_HEIGHT_3_SHIFT 0
+# define RADEON_FACE_WIDTH_3_MASK 0xf << 16)
+# define RADEON_FACE_HEIGHT_3_MASK 0xf << 20)
+# define RADEON_FACE_WIDTH_4_SHIFT 4
+# define RADEON_FACE_HEIGHT_4_SHIFT 8
+# define RADEON_FACE_WIDTH_4_MASK 0xf << 24)
+# define RADEON_FACE_HEIGHT_4_MASK 0xf << 28)
+
#define RADEON_PP_TXOFFSET_0 0x1c5c
#define RADEON_PP_TXOFFSET_1 0x1c74
#define RADEON_PP_TXOFFSET_2 0x1c8c
@@ -1277,6 +1212,35 @@ do { \
# define RADEON_TXO_MICRO_TILE_OPT (2 << 3)
# define RADEON_TXO_OFFSET_MASK 0xffffffe0
# define RADEON_TXO_OFFSET_SHIFT 5
+
+#define RADEON_PP_CUBIC_OFFSET_T0_0 0x1dd0 /* bits [31:5] */
+#define RADEON_PP_CUBIC_OFFSET_T0_1 0x1dd4
+#define RADEON_PP_CUBIC_OFFSET_T0_2 0x1dd8
+#define RADEON_PP_CUBIC_OFFSET_T0_3 0x1ddc
+#define RADEON_PP_CUBIC_OFFSET_T0_4 0x1de0
+#define RADEON_PP_CUBIC_OFFSET_T1_0 0x1e00
+#define RADEON_PP_CUBIC_OFFSET_T1_1 0x1e04
+#define RADEON_PP_CUBIC_OFFSET_T1_2 0x1e08
+#define RADEON_PP_CUBIC_OFFSET_T1_3 0x1e0c
+#define RADEON_PP_CUBIC_OFFSET_T1_4 0x1e10
+#define RADEON_PP_CUBIC_OFFSET_T2_0 0x1e14
+#define RADEON_PP_CUBIC_OFFSET_T2_1 0x1e18
+#define RADEON_PP_CUBIC_OFFSET_T2_2 0x1e1c
+#define RADEON_PP_CUBIC_OFFSET_T2_3 0x1e20
+#define RADEON_PP_CUBIC_OFFSET_T2_4 0x1e24
+
+#define RADEON_PP_TEX_SIZE_0 0x1d04 /* NPOT */
+#define RADEON_PP_TEX_SIZE_1 0x1d0c
+#define RADEON_PP_TEX_SIZE_2 0x1d14
+# define RADEON_TEX_USIZE_MASK (0x7ff << 0)
+# define RADEON_TEX_USIZE_SHIFT 0
+# define RADEON_TEX_VSIZE_MASK (0x7ff << 16)
+# define RADEON_TEX_VSIZE_SHIFT 16
+# define RADEON_SIGNED_RGB_MASK (1 << 30)
+# define RADEON_SIGNED_RGB_SHIFT 30
+# define RADEON_SIGNED_ALPHA_MASK (1 << 31)
+# define RADEON_SIGNED_ALPHA_SHIFT 31
+
#define RADEON_PP_TXCBLEND_0 0x1c60
#define RADEON_PP_TXCBLEND_1 0x1c78
#define RADEON_PP_TXCBLEND_2 0x1c90
@@ -1455,8 +1419,6 @@ do { \
# define RADEON_COLOR_FORMAT_aYUV444 (14 << 10)
# define RADEON_COLOR_FORMAT_ARGB4444 (15 << 10)
# define RADEON_CLRCMP_FLIP_ENABLE (1 << 14)
-# define RADEON_ZBLOCK8 (0 << 15)
-# define RADEON_ZBLOCK16 (1 << 15)
#define RADEON_RB3D_COLOROFFSET 0x1c40
# define RADEON_COLOROFFSET_MASK 0xfffffff0
#define RADEON_RB3D_COLORPITCH 0x1c48
@@ -1517,7 +1479,6 @@ do { \
# define RADEON_Z_TEST_NEQUAL (6 << 4)
# define RADEON_Z_TEST_ALWAYS (7 << 4)
# define RADEON_Z_TEST_MASK (7 << 4)
-# define RADEON_HIERARCHICAL_Z_ENABLE (1 << 8)
# define RADEON_STENCIL_TEST_NEVER (0 << 12)
# define RADEON_STENCIL_TEST_LESS (1 << 12)
# define RADEON_STENCIL_TEST_LEQUAL (2 << 12)
@@ -1551,7 +1512,6 @@ do { \
# define RADEON_Z_COMPRESSION_ENABLE (1 << 28)
# define RADEON_FORCE_Z_DIRTY (1 << 29)
# define RADEON_Z_WRITE_ENABLE (1 << 30)
-# define RADEON_Z_DECOMPRESSION_ENABLE (1 << 31)
#define RADEON_RE_LINE_PATTERN 0x1cd0
# define RADEON_LINE_PATTERN_MASK 0x0000ffff
# define RADEON_LINE_REPEAT_COUNT_SHIFT 16
@@ -1647,6 +1607,24 @@ do { \
# define RADEON_TEX1_W_ROUTING_USE_Q1 (1 << 26)
#define RADEON_SE_LINE_WIDTH 0x1db8
#define RADEON_SE_TCL_LIGHT_MODEL_CTL 0x226c
+# define RADEON_LIGHTING_ENABLE (1 << 0)
+# define RADEON_LIGHT_IN_MODELSPACE (1 << 1)
+# define RADEON_LOCAL_VIEWER (1 << 2)
+# define RADEON_NORMALIZE_NORMALS (1 << 3)
+# define RADEON_RESCALE_NORMALS (1 << 4)
+# define RADEON_SPECULAR_LIGHTS (1 << 5)
+# define RADEON_DIFFUSE_SPECULAR_COMBINE (1 << 6)
+# define RADEON_LIGHT_ALPHA (1 << 7)
+# define RADEON_LOCAL_LIGHT_VEC_GL (1 << 8)
+# define RADEON_LIGHT_NO_NORMAL_AMBIENT_ONLY (1 << 9)
+# define RADEON_LM_SOURCE_STATE_PREMULT 0
+# define RADEON_LM_SOURCE_STATE_MULT 1
+# define RADEON_LM_SOURCE_VERTEX_DIFFUSE 2
+# define RADEON_LM_SOURCE_VERTEX_SPECULAR 3
+# define RADEON_EMISSIVE_SOURCE_SHIFT 16
+# define RADEON_AMBIENT_SOURCE_SHIFT 18
+# define RADEON_DIFFUSE_SOURCE_SHIFT 20
+# define RADEON_SPECULAR_SOURCE_SHIFT 22
#define RADEON_SE_TCL_MATERIAL_AMBIENT_RED 0x2220
#define RADEON_SE_TCL_MATERIAL_AMBIENT_GREEN 0x2224
#define RADEON_SE_TCL_MATERIAL_AMBIENT_BLUE 0x2228
@@ -1664,16 +1642,158 @@ do { \
#define RADEON_SE_TCL_MATERIAL_SPECULAR_BLUE 0x2248
#define RADEON_SE_TCL_MATERIAL_SPECULAR_ALPHA 0x224c
#define RADEON_SE_TCL_MATRIX_SELECT_0 0x225c
+# define RADEON_MODELVIEW_0_SHIFT 0
+# define RADEON_MODELVIEW_1_SHIFT 4
+# define RADEON_MODELVIEW_2_SHIFT 8
+# define RADEON_MODELVIEW_3_SHIFT 12
+# define RADEON_IT_MODELVIEW_0_SHIFT 16
+# define RADEON_IT_MODELVIEW_1_SHIFT 20
+# define RADEON_IT_MODELVIEW_2_SHIFT 24
+# define RADEON_IT_MODELVIEW_3_SHIFT 28
#define RADEON_SE_TCL_MATRIX_SELECT_1 0x2260
+# define RADEON_MODELPROJECT_0_SHIFT 0
+# define RADEON_MODELPROJECT_1_SHIFT 4
+# define RADEON_MODELPROJECT_2_SHIFT 8
+# define RADEON_MODELPROJECT_3_SHIFT 12
+# define RADEON_TEXMAT_0_SHIFT 16
+# define RADEON_TEXMAT_1_SHIFT 20
+# define RADEON_TEXMAT_2_SHIFT 24
+# define RADEON_TEXMAT_3_SHIFT 28
+
+
#define RADEON_SE_TCL_OUTPUT_VTX_FMT 0x2254
+# define RADEON_TCL_VTX_W0 (1 << 0)
+# define RADEON_TCL_VTX_FP_DIFFUSE (1 << 1)
+# define RADEON_TCL_VTX_FP_ALPHA (1 << 2)
+# define RADEON_TCL_VTX_PK_DIFFUSE (1 << 3)
+# define RADEON_TCL_VTX_FP_SPEC (1 << 4)
+# define RADEON_TCL_VTX_FP_FOG (1 << 5)
+# define RADEON_TCL_VTX_PK_SPEC (1 << 6)
+# define RADEON_TCL_VTX_ST0 (1 << 7)
+# define RADEON_TCL_VTX_ST1 (1 << 8)
+# define RADEON_TCL_VTX_Q1 (1 << 9)
+# define RADEON_TCL_VTX_ST2 (1 << 10)
+# define RADEON_TCL_VTX_Q2 (1 << 11)
+# define RADEON_TCL_VTX_ST3 (1 << 12)
+# define RADEON_TCL_VTX_Q3 (1 << 13)
+# define RADEON_TCL_VTX_Q0 (1 << 14)
+# define RADEON_TCL_VTX_WEIGHT_COUNT_SHIFT 15
+# define RADEON_TCL_VTX_NORM0 (1 << 18)
+# define RADEON_TCL_VTX_XY1 (1 << 27)
+# define RADEON_TCL_VTX_Z1 (1 << 28)
+# define RADEON_TCL_VTX_W1 (1 << 29)
+# define RADEON_TCL_VTX_NORM1 (1 << 30)
+# define RADEON_TCL_VTX_Z0 (1 << 31)
+
#define RADEON_SE_TCL_OUTPUT_VTX_SEL 0x2258
+# define RADEON_TCL_COMPUTE_XYZW (1 << 0)
+# define RADEON_TCL_COMPUTE_DIFFUSE (1 << 1)
+# define RADEON_TCL_COMPUTE_SPECULAR (1 << 2)
+# define RADEON_TCL_FORCE_NAN_IF_COLOR_NAN (1 << 3)
+# define RADEON_TCL_FORCE_INORDER_PROC (1 << 4)
+# define RADEON_TCL_TEX_INPUT_TEX_0 0
+# define RADEON_TCL_TEX_INPUT_TEX_1 1
+# define RADEON_TCL_TEX_INPUT_TEX_2 2
+# define RADEON_TCL_TEX_INPUT_TEX_3 3
+# define RADEON_TCL_TEX_COMPUTED_TEX_0 8
+# define RADEON_TCL_TEX_COMPUTED_TEX_1 9
+# define RADEON_TCL_TEX_COMPUTED_TEX_2 10
+# define RADEON_TCL_TEX_COMPUTED_TEX_3 11
+# define RADEON_TCL_TEX_0_OUTPUT_SHIFT 16
+# define RADEON_TCL_TEX_1_OUTPUT_SHIFT 20
+# define RADEON_TCL_TEX_2_OUTPUT_SHIFT 24
+# define RADEON_TCL_TEX_3_OUTPUT_SHIFT 28
+
#define RADEON_SE_TCL_PER_LIGHT_CTL_0 0x2270
+# define RADEON_LIGHT_0_ENABLE (1 << 0)
+# define RADEON_LIGHT_0_ENABLE_AMBIENT (1 << 1)
+# define RADEON_LIGHT_0_ENABLE_SPECULAR (1 << 2)
+# define RADEON_LIGHT_0_IS_LOCAL (1 << 3)
+# define RADEON_LIGHT_0_IS_SPOT (1 << 4)
+# define RADEON_LIGHT_0_DUAL_CONE (1 << 5)
+# define RADEON_LIGHT_0_ENABLE_RANGE_ATTEN (1 << 6)
+# define RADEON_LIGHT_0_CONSTANT_RANGE_ATTEN (1 << 7)
+# define RADEON_LIGHT_0_SHIFT 0
+# define RADEON_LIGHT_1_ENABLE (1 << 16)
+# define RADEON_LIGHT_1_ENABLE_AMBIENT (1 << 17)
+# define RADEON_LIGHT_1_ENABLE_SPECULAR (1 << 18)
+# define RADEON_LIGHT_1_IS_LOCAL (1 << 19)
+# define RADEON_LIGHT_1_IS_SPOT (1 << 20)
+# define RADEON_LIGHT_1_DUAL_CONE (1 << 21)
+# define RADEON_LIGHT_1_ENABLE_RANGE_ATTEN (1 << 22)
+# define RADEON_LIGHT_1_CONSTANT_RANGE_ATTEN (1 << 23)
+# define RADEON_LIGHT_1_SHIFT 16
#define RADEON_SE_TCL_PER_LIGHT_CTL_1 0x2274
+# define RADEON_LIGHT_2_SHIFT 0
+# define RADEON_LIGHT_3_SHIFT 16
#define RADEON_SE_TCL_PER_LIGHT_CTL_2 0x2278
+# define RADEON_LIGHT_4_SHIFT 0
+# define RADEON_LIGHT_5_SHIFT 16
#define RADEON_SE_TCL_PER_LIGHT_CTL_3 0x227c
+# define RADEON_LIGHT_6_SHIFT 0
+# define RADEON_LIGHT_7_SHIFT 16
+
#define RADEON_SE_TCL_SHININESS 0x2250
+
#define RADEON_SE_TCL_TEXTURE_PROC_CTL 0x2268
+# define RADEON_TEXGEN_TEXMAT_0_ENABLE (1 << 0)
+# define RADEON_TEXGEN_TEXMAT_1_ENABLE (1 << 1)
+# define RADEON_TEXGEN_TEXMAT_2_ENABLE (1 << 2)
+# define RADEON_TEXGEN_TEXMAT_3_ENABLE (1 << 3)
+# define RADEON_TEXMAT_0_ENABLE (1 << 4)
+# define RADEON_TEXMAT_1_ENABLE (1 << 5)
+# define RADEON_TEXMAT_2_ENABLE (1 << 6)
+# define RADEON_TEXMAT_3_ENABLE (1 << 7)
+# define RADEON_TEXGEN_INPUT_MASK 0xf
+# define RADEON_TEXGEN_INPUT_TEXCOORD_0 0
+# define RADEON_TEXGEN_INPUT_TEXCOORD_1 1
+# define RADEON_TEXGEN_INPUT_TEXCOORD_2 2
+# define RADEON_TEXGEN_INPUT_TEXCOORD_3 3
+# define RADEON_TEXGEN_INPUT_OBJ 4
+# define RADEON_TEXGEN_INPUT_EYE 5
+# define RADEON_TEXGEN_INPUT_EYE_NORMAL 6
+# define RADEON_TEXGEN_INPUT_EYE_REFLECT 7
+# define RADEON_TEXGEN_INPUT_EYE_NORMALIZED 8
+# define RADEON_TEXGEN_0_INPUT_SHIFT 16
+# define RADEON_TEXGEN_1_INPUT_SHIFT 20
+# define RADEON_TEXGEN_2_INPUT_SHIFT 24
+# define RADEON_TEXGEN_3_INPUT_SHIFT 28
+
#define RADEON_SE_TCL_UCP_VERT_BLEND_CTL 0x2264
+# define RADEON_UCP_IN_CLIP_SPACE (1 << 0)
+# define RADEON_UCP_IN_MODEL_SPACE (1 << 1)
+# define RADEON_UCP_ENABLE_0 (1 << 2)
+# define RADEON_UCP_ENABLE_1 (1 << 3)
+# define RADEON_UCP_ENABLE_2 (1 << 4)
+# define RADEON_UCP_ENABLE_3 (1 << 5)
+# define RADEON_UCP_ENABLE_4 (1 << 6)
+# define RADEON_UCP_ENABLE_5 (1 << 7)
+# define RADEON_TCL_FOG_MASK (3 << 8)
+# define RADEON_TCL_FOG_DISABLE (0 << 8)
+# define RADEON_TCL_FOG_EXP (1 << 8)
+# define RADEON_TCL_FOG_EXP2 (2 << 8)
+# define RADEON_TCL_FOG_LINEAR (3 << 8)
+# define RADEON_RNG_BASED_FOG (1 << 10)
+# define RADEON_LIGHT_TWOSIDE (1 << 11)
+# define RADEON_BLEND_OP_COUNT_MASK (7 << 12)
+# define RADEON_BLEND_OP_COUNT_SHIFT 12
+# define RADEON_POSITION_BLEND_OP_ENABLE (1 << 16)
+# define RADEON_NORMAL_BLEND_OP_ENABLE (1 << 17)
+# define RADEON_VERTEX_BLEND_SRC_0_PRIMARY (1 << 18)
+# define RADEON_VERTEX_BLEND_SRC_0_SECONDARY (1 << 18)
+# define RADEON_VERTEX_BLEND_SRC_1_PRIMARY (1 << 19)
+# define RADEON_VERTEX_BLEND_SRC_1_SECONDARY (1 << 19)
+# define RADEON_VERTEX_BLEND_SRC_2_PRIMARY (1 << 20)
+# define RADEON_VERTEX_BLEND_SRC_2_SECONDARY (1 << 20)
+# define RADEON_VERTEX_BLEND_SRC_3_PRIMARY (1 << 21)
+# define RADEON_VERTEX_BLEND_SRC_3_SECONDARY (1 << 21)
+# define RADEON_VERTEX_BLEND_WGT_MINUS_ONE (1 << 22)
+# define RADEON_CULL_FRONT_IS_CW (0 << 28)
+# define RADEON_CULL_FRONT_IS_CCW (1 << 28)
+# define RADEON_CULL_FRONT (1 << 29)
+# define RADEON_CULL_BACK (1 << 30)
+# define RADEON_FORCE_W_TO_ONE (1 << 31)
+
#define RADEON_SE_VPORT_XSCALE 0x1d98
#define RADEON_SE_VPORT_XOFFSET 0x1d9c
#define RADEON_SE_VPORT_YSCALE 0x1da0
@@ -1701,29 +1821,29 @@ do { \
#define RADEON_CP_IB_BUFSZ 0x073c
#define RADEON_CP_CSQ_CNTL 0x0740
-# define RADEON_CSQ_CNT_PRIMARY_MASK (0xff << 0)
-# define RADEON_CSQ_PRIDIS_INDDIS (0 << 28)
-# define RADEON_CSQ_PRIPIO_INDDIS (1 << 28)
-# define RADEON_CSQ_PRIBM_INDDIS (2 << 28)
-# define RADEON_CSQ_PRIPIO_INDBM (3 << 28)
-# define RADEON_CSQ_PRIBM_INDBM (4 << 28)
-# define RADEON_CSQ_PRIPIO_INDPIO (15 << 28)
+# define RADEON_CSQ_CNT_PRIMARY_MASK (0xff << 0)
+# define RADEON_CSQ_PRIDIS_INDDIS (0 << 28)
+# define RADEON_CSQ_PRIPIO_INDDIS (1 << 28)
+# define RADEON_CSQ_PRIBM_INDDIS (2 << 28)
+# define RADEON_CSQ_PRIPIO_INDBM (3 << 28)
+# define RADEON_CSQ_PRIBM_INDBM (4 << 28)
+# define RADEON_CSQ_PRIPIO_INDPIO (15 << 28)
#define RADEON_CP_CSQ_STAT 0x07f8
-# define RADEON_CSQ_RPTR_PRIMARY_MASK (0xff << 0)
-# define RADEON_CSQ_WPTR_PRIMARY_MASK (0xff << 8)
-# define RADEON_CSQ_RPTR_INDIRECT_MASK (0xff << 16)
-# define RADEON_CSQ_WPTR_INDIRECT_MASK (0xff << 24)
+# define RADEON_CSQ_RPTR_PRIMARY_MASK (0xff << 0)
+# define RADEON_CSQ_WPTR_PRIMARY_MASK (0xff << 8)
+# define RADEON_CSQ_RPTR_INDIRECT_MASK (0xff << 16)
+# define RADEON_CSQ_WPTR_INDIRECT_MASK (0xff << 24)
#define RADEON_CP_CSQ_ADDR 0x07f0
#define RADEON_CP_CSQ_DATA 0x07f4
#define RADEON_CP_CSQ_APER_PRIMARY 0x1000
#define RADEON_CP_CSQ_APER_INDIRECT 0x1300
#define RADEON_CP_RB_WPTR_DELAY 0x0718
-# define RADEON_PRE_WRITE_TIMER_SHIFT 0
-# define RADEON_PRE_WRITE_LIMIT_SHIFT 23
+# define RADEON_PRE_WRITE_TIMER_SHIFT 0
+# define RADEON_PRE_WRITE_LIMIT_SHIFT 23
#define RADEON_AIC_CNTL 0x01d0
-# define RADEON_PCIGART_TRANSLATE_EN (1 << 0)
+# define RADEON_PCIGART_TRANSLATE_EN (1 << 0)
@@ -1755,14 +1875,12 @@ do { \
#define RADEON_CP_PACKET3_SET_SCISSORS 0xC0001E00
#define RADEON_CP_PACKET3_3D_RNDR_GEN_INDX_PRIM 0xC0002300
#define RADEON_CP_PACKET3_LOAD_MICROCODE 0xC0002400
-#define RADEON_CP_PACKET3_3D_RNDR_GEN_PRIM 0xC0002500
#define RADEON_CP_PACKET3_WAIT_FOR_IDLE 0xC0002600
#define RADEON_CP_PACKET3_3D_DRAW_VBUF 0xC0002800
#define RADEON_CP_PACKET3_3D_DRAW_IMMD 0xC0002900
#define RADEON_CP_PACKET3_3D_DRAW_INDX 0xC0002A00
#define RADEON_CP_PACKET3_LOAD_PALETTE 0xC0002C00
#define RADEON_CP_PACKET3_3D_LOAD_VBPNTR 0xC0002F00
-#define RADEON_CP_PACKET3_3D_CLEAR_ZMASK 0xC0003200
#define RADEON_CP_PACKET3_CNTL_PAINT 0xC0009100
#define RADEON_CP_PACKET3_CNTL_BITBLT 0xC0009200
#define RADEON_CP_PACKET3_CNTL_SMALLTEXT 0xC0009300
@@ -1817,6 +1935,47 @@ do { \
#define RADEON_CP_VC_CNTL_MAOS_ENABLE 0x00000080
#define RADEON_CP_VC_CNTL_VTX_FMT_NON_RADEON_MODE 0x00000000
#define RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE 0x00000100
+#define RADEON_CP_VC_CNTL_TCL_DISABLE 0x00000000
+#define RADEON_CP_VC_CNTL_TCL_ENABLE 0x00000200
#define RADEON_CP_VC_CNTL_NUM_SHIFT 16
+#define RADEON_VS_MATRIX_0_ADDR 0
+#define RADEON_VS_MATRIX_1_ADDR 4
+#define RADEON_VS_MATRIX_2_ADDR 8
+#define RADEON_VS_MATRIX_3_ADDR 12
+#define RADEON_VS_MATRIX_4_ADDR 16
+#define RADEON_VS_MATRIX_5_ADDR 20
+#define RADEON_VS_MATRIX_6_ADDR 24
+#define RADEON_VS_MATRIX_7_ADDR 28
+#define RADEON_VS_MATRIX_8_ADDR 32
+#define RADEON_VS_MATRIX_9_ADDR 36
+#define RADEON_VS_MATRIX_10_ADDR 40
+#define RADEON_VS_MATRIX_11_ADDR 44
+#define RADEON_VS_MATRIX_12_ADDR 48
+#define RADEON_VS_MATRIX_13_ADDR 52
+#define RADEON_VS_MATRIX_14_ADDR 56
+#define RADEON_VS_MATRIX_15_ADDR 60
+#define RADEON_VS_LIGHT_AMBIENT_ADDR 64
+#define RADEON_VS_LIGHT_DIFFUSE_ADDR 72
+#define RADEON_VS_LIGHT_SPECULAR_ADDR 80
+#define RADEON_VS_LIGHT_DIRPOS_ADDR 88
+#define RADEON_VS_LIGHT_HWVSPOT_ADDR 96
+#define RADEON_VS_LIGHT_ATTENUATION_ADDR 104
+#define RADEON_VS_MATRIX_EYE2CLIP_ADDR 112
+#define RADEON_VS_UCP_ADDR 116
+#define RADEON_VS_GLOBAL_AMBIENT_ADDR 122
+#define RADEON_VS_FOG_PARAM_ADDR 123
+#define RADEON_VS_EYE_VECTOR_ADDR 124
+
+#define RADEON_SS_LIGHT_DCD_ADDR 0
+#define RADEON_SS_LIGHT_SPOT_EXPONENT_ADDR 8
+#define RADEON_SS_LIGHT_SPOT_CUTOFF_ADDR 16
+#define RADEON_SS_LIGHT_SPECULAR_THRESH_ADDR 24
+#define RADEON_SS_LIGHT_RANGE_CUTOFF_ADDR 32
+#define RADEON_SS_VERT_GUARD_CLIP_ADJ_ADDR 48
+#define RADEON_SS_VERT_GUARD_DISCARD_ADJ_ADDR 49
+#define RADEON_SS_HORZ_GUARD_CLIP_ADJ_ADDR 50
+#define RADEON_SS_HORZ_GUARD_DISCARD_ADJ_ADDR 51
+#define RADEON_SS_SHININESS 60
+
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h
index 460277c87..b9a22e283 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h
@@ -26,6 +26,8 @@
#define RADEON_NAME "RADEON"
#define RADEON_DRIVER_NAME "radeon"
+#define R200_DRIVER_NAME "r200"
+#define RV250_DRIVER_NAME "r200"
#define RADEON_VERSION_MAJOR 4
#define RADEON_VERSION_MINOR 0
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c
index ed5e1738c..88d323a0a 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c
@@ -1,6 +1,7 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c,v 1.18 2002/10/12 01:38:08 martin Exp $ */
#include "radeon.h"
+#include "radeon_macros.h"
#include "radeon_reg.h"
#include "xf86.h"
@@ -60,7 +61,6 @@ typedef struct {
Bool doubleBuffer;
unsigned char currentBuffer;
- FBLinearPtr linear;
RegionRec clip;
CARD32 colorKey;
CARD32 videoStatus;
@@ -384,6 +384,7 @@ RADEONResetVideo(ScrnInfoPtr pScrn)
unsigned char *RADEONMMIO = info->MMIO;
RADEONPortPrivPtr pPriv = info->adaptor->pPortPrivates[0].ptr;
+ if (info->accelOn) info->accel->Sync(pScrn);
RADEONWaitForIdleMMIO(pScrn);
OUTREG(RADEON_OV0_SCALE_CNTL, 0x80000000);
@@ -677,9 +678,9 @@ RADEONStopVideo(ScrnInfoPtr pScrn, pointer data, Bool cleanup)
RADEONWaitForFifo(pScrn, 2);
OUTREG(RADEON_OV0_SCALE_CNTL, 0);
}
- if(pPriv->linear) {
- xf86FreeOffscreenLinear(pPriv->linear);
- pPriv->linear = NULL;
+ if(info->videoLinear) {
+ xf86FreeOffscreenLinear(info->videoLinear);
+ info->videoLinear = NULL;
}
pPriv->videoStatus = 0;
} else {
@@ -800,7 +801,7 @@ RADEONGetPortAttribute(ScrnInfoPtr pScrn,
RADEONInfoPtr info = RADEONPTR(pScrn);
RADEONPortPrivPtr pPriv = (RADEONPortPrivPtr)data;
- info->accel->Sync(pScrn);
+ if (info->accelOn) info->accel->Sync(pScrn);
if(attribute == xvAutopaintColorkey)
*value = pPriv->autopaint_colorkey;
@@ -1018,7 +1019,7 @@ RADEONDisplayVideo(
RADEONWaitForFifo(pScrn, 2);
OUTREG(RADEON_OV0_REG_LOAD_CNTL, 1);
- RADEONWaitForIdleMMIO(pScrn);
+ if (info->accelOn) info->accel->Sync(pScrn);
while(!(INREG(RADEON_OV0_REG_LOAD_CNTL) & (1 << 3)));
RADEONWaitForFifo(pScrn, 14);
@@ -1194,7 +1195,7 @@ RADEONPutImage(
break;
}
- if(!(pPriv->linear = RADEONAllocateMemory(pScrn, pPriv->linear,
+ if(!(info->videoLinear = RADEONAllocateMemory(pScrn, info->videoLinear,
pPriv->doubleBuffer ? (new_size << 1) : new_size)))
{
return BadAlloc;
@@ -1207,7 +1208,7 @@ RADEONPutImage(
left = (xa >> 16) & ~1;
npixels = ((((xb + 0xffff) >> 16) + 1) & ~1) - left;
- offset = (pPriv->linear->offset * bpp) + (top * dstPitch);
+ offset = (info->videoLinear->offset * bpp) + (top * dstPitch);
if(pPriv->doubleBuffer)
offset += pPriv->currentBuffer * new_size * bpp;
dst_start = info->FB + offset;
@@ -1338,9 +1339,9 @@ RADEONVideoTimerCallback(ScrnInfoPtr pScrn, Time now)
}
} else { /* FREE_TIMER */
if(pPriv->freeTime < now) {
- if(pPriv->linear) {
- xf86FreeOffscreenLinear(pPriv->linear);
- pPriv->linear = NULL;
+ if(info->videoLinear) {
+ xf86FreeOffscreenLinear(info->videoLinear);
+ info->videoLinear = NULL;
}
pPriv->videoStatus = 0;
info->VideoTimerCallback = NULL;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c
index b6ec4fe78..87d18df9a 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c
@@ -29,7 +29,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/*
* Authors:
- * Jens Owen <jens@precisioninsight.com>
+ * Jens Owen <jens@tungstengraphics.com>
* Alan Hourihane <alanh@fairlite.demon.co.uk>
*
*/
@@ -126,11 +126,11 @@ GLINTInitVisualConfigs(ScreenPtr pScreen)
pConfigs[i].redSize = 5;
pConfigs[i].greenSize = 5;
pConfigs[i].blueSize = 5;
- pConfigs[i].alphaSize = 5;
+ pConfigs[i].alphaSize = 1;
pConfigs[i].redMask = 0x00007C00;
pConfigs[i].greenMask = 0x000003E0;
pConfigs[i].blueMask = 0x0000001F;
- pConfigs[i].alphaMask = 0x000F1000;
+ pConfigs[i].alphaMask = 0x00008000;
if ( accum ) {
pConfigs[i].accumRedSize = 16;
pConfigs[i].accumGreenSize = 16;
@@ -221,11 +221,11 @@ GLINTInitVisualConfigs(ScreenPtr pScreen)
pConfigs[i].redSize = 8;
pConfigs[i].greenSize = 8;
pConfigs[i].blueSize = 8;
- pConfigs[i].alphaSize = 0;
+ pConfigs[i].alphaSize = 8;
pConfigs[i].redMask = 0x00FF0000;
pConfigs[i].greenMask = 0x0000FF00;
pConfigs[i].blueMask = 0x000000FF;
- pConfigs[i].alphaMask = 0;
+ pConfigs[i].alphaMask = 0xFF000000;
if ( accum ) {
pConfigs[i].accumRedSize = 16;
pConfigs[i].accumGreenSize = 16;
@@ -406,6 +406,7 @@ static Bool GLINTDRIKernelInit( ScreenPtr pScreen )
memset( &init, 0, sizeof(drmGAMMAInit) );
+ init.func = GAMMA_INIT_DMA;
init.sarea_priv_offset = sizeof(XF86DRISAREARec);
init.mmio0 = pGlintDRI->registers0.handle;
@@ -420,7 +421,8 @@ static Bool GLINTDRIKernelInit( ScreenPtr pScreen )
init.pcimode = 1;
}
- ret = drmGAMMAInitDMA( pGlint->drmSubFD, &init );
+ ret = drmCommandWrite( pGlint->drmSubFD, DRM_GAMMA_INIT,
+ &init, sizeof(drmGAMMAInit) );
if ( ret < 0 ) {
xf86DrvMsg( pScrn->scrnIndex, X_ERROR,
@@ -553,9 +555,48 @@ GLINTDRIScreenInit(ScreenPtr pScreen)
return FALSE;
}
- /* Check the GLINT DRM version */
+ /* Check the DRM versioning */
{
- drmVersionPtr version = drmGetVersion(pGlint->drmSubFD);
+ drmVersionPtr version;
+
+ /* Check the DRM lib version.
+ drmGetLibVersion was not supported in version 1.0, so check for
+ symbol first to avoid possible crash or hang.
+ */
+ if (xf86LoaderCheckSymbol("drmGetLibVersion")) {
+ version = drmGetLibVersion(pGlint->drmSubFD);
+ }
+ else {
+ /* drmlib version 1.0.0 didn't have the drmGetLibVersion
+ entry point. Fake it by allocating a version record
+ via drmGetVersion and changing it to version 1.0.0
+ */
+ version = drmGetVersion(pGlint->drmSubFD);
+ version->version_major = 1;
+ version->version_minor = 0;
+ version->version_patchlevel = 0;
+ }
+
+ if (version) {
+ if (version->version_major != 1 ||
+ version->version_minor < 1) {
+ /* incompatible drm library version */
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] GLINTDRIScreenInit failed because of a version mismatch.\n"
+ "[dri] libdrm.a module version is %d.%d.%d but version 1.1.x is needed.\n"
+ "[dri] Disabling DRI.\n",
+ version->version_major,
+ version->version_minor,
+ version->version_patchlevel);
+ drmFreeVersion(version);
+ GLINTDRICloseScreen(pScreen);
+ return FALSE;
+ }
+ drmFreeVersion(version);
+ }
+
+ /* Check the GLINT DRM version */
+ version = drmGetVersion(pGlint->drmSubFD);
if (version) {
if (version->version_major != 2 ||
version->version_minor < 0) {
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c
index ae4fc5133..bdfb9169e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c
@@ -95,11 +95,6 @@ extern void GlxSetVisualConfigs(int nconfigs,
__GLXvisualConfig * configs,
void **configprivs);
-#ifndef HAVE_DRM_COMMAND
-extern drmVersionPtr drmGetLibVersion(int fd);
-#endif
-
-#ifdef HAVE_DRM_COMMAND
Bool
I830CleanupDma(ScrnInfoPtr pScrn)
{
@@ -117,21 +112,7 @@ I830CleanupDma(ScrnInfoPtr pScrn)
return TRUE;
}
-#else
-Bool
-I830CleanupDma(ScrnInfoPtr pScrn)
-{
- I830Ptr pI830 = I830PTR(pScrn);
-
- if (!drmI830CleanupDma(pI830->drmSubFD)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "I830 Dma Cleanup Failed\n");
- return FALSE;
- }
- return TRUE;
-}
-#endif
-#ifdef HAVE_DRM_COMMAND
Bool
I830InitDma(ScrnInfoPtr pScrn)
{
@@ -172,41 +153,6 @@ I830InitDma(ScrnInfoPtr pScrn)
return TRUE;
}
-#else
-Bool
-I830InitDma(ScrnInfoPtr pScrn)
-{
- I830Ptr pI830 = I830PTR(pScrn);
- I830RingBuffer *ring = &(pI830->LpRing);
- I830DRIPtr pI830DRI = (I830DRIPtr) pI830->pDRIInfo->devPrivate;
- drmI830Init info;
-
- info.start = ring->mem.Start + pI830->LinearAddr;
- info.end = ring->mem.End + pI830->LinearAddr;
- info.size = ring->mem.Size;
-
- info.mmio_offset = (unsigned int)pI830DRI->regs;
- info.buffers_offset = (unsigned int)pI830->buffer_map;
-
- info.sarea_off = sizeof(XF86DRISAREARec);
-
- info.front_offset = pI830->FrontBuffer.Start;
- info.back_offset = pI830->BackBuffer.Start;
- info.depth_offset = pI830->DepthBuffer.Start;
- info.w = pScrn->virtualX;
- info.h = pScrn->virtualY;
- info.pitch = pI830->auxPitch;
- info.pitch_bits = pI830->auxPitchBits;
- info.cpp = pI830->cpp;
-
- if (!drmI830InitDma(pI830->drmSubFD, &info)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "I830 Dma Initialization Failed\n");
- return FALSE;
- }
- return TRUE;
-}
-#endif
static Bool
I830InitVisualConfigs(ScreenPtr pScreen)
@@ -352,7 +298,7 @@ I830InitVisualConfigs(ScreenPtr pScreen)
pConfigs[i].redMask = 0x00FF0000;
pConfigs[i].greenMask = 0x0000FF00;
pConfigs[i].blueMask = 0x000000FF;
- pConfigs[i].alphaMask = 0xff000000;;
+ pConfigs[i].alphaMask = 0x00000000;;
if (accum) {
pConfigs[i].accumRedSize = 16;
pConfigs[i].accumGreenSize = 16;
@@ -370,7 +316,7 @@ I830InitVisualConfigs(ScreenPtr pScreen)
pConfigs[i].doubleBuffer = FALSE;
}
pConfigs[i].stereo = FALSE;
- pConfigs[i].bufferSize = 32;
+ pConfigs[i].bufferSize = 24;
if (depth) {
pConfigs[i].depthSize = 24;
pConfigs[i].stencilSize = 8;
@@ -531,7 +477,7 @@ I830DRIScreenInit(ScreenPtr pScreen)
{
drmVersionPtr version;
-#if defined(XFree86LOADER) || defined(HAVE_DRM_COMMAND)
+#if defined(XFree86LOADER)
/* Check the DRM lib version.
* drmGetLibVersion was not supported in version 1.0, so check for
* symbol first to avoid possible crash or hang.
@@ -551,23 +497,16 @@ I830DRIScreenInit(ScreenPtr pScreen)
version->version_patchlevel = 0;
}
-#define REQ_MAJ 1
-#ifdef HAVE_DRM_COMMAND
-#define REQ_MIN 1
-#else
-#define REQ_MIN 0
-#endif
if (version) {
- if (version->version_major != REQ_MAJ ||
- version->version_minor < REQ_MIN) {
+ if (version->version_major != 1 ||
+ version->version_minor < 1) {
/* incompatible drm library version */
xf86DrvMsg(pScreen->myNum, X_ERROR,
"[dri] I830DRIScreenInit failed because of a version mismatch.\n"
- "[dri] libdrm.a module version is %d.%d.%d but version %d.%d.x is needed.\n"
+ "[dri] libdrm.a module version is %d.%d.%d but version 1.1.x is needed.\n"
"[dri] Disabling DRI.\n",
version->version_major,
- version->version_minor, version->version_patchlevel,
- REQ_MAJ, REQ_MIN);
+ version->version_minor, version->version_patchlevel);
drmFreeVersion(version);
I830DRICloseScreen(pScreen);
return FALSE;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c
index fdc7c088e..0bf4eba5d 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c
@@ -24,7 +24,7 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith WHitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
* Gareth Hughes <gareth@valinux.com>
*/
@@ -251,11 +251,11 @@ static Bool MGAInitVisualConfigs( ScreenPtr pScreen )
pConfigs[i].redSize = 8;
pConfigs[i].greenSize = 8;
pConfigs[i].blueSize = 8;
- pConfigs[i].alphaSize = 8;
+ pConfigs[i].alphaSize = 0;
pConfigs[i].redMask = 0x00FF0000;
pConfigs[i].greenMask = 0x0000FF00;
pConfigs[i].blueMask = 0x000000FF;
- pConfigs[i].alphaMask = 0;
+ pConfigs[i].alphaMask = 0x0;
if ( accum ) {
pConfigs[i].accumRedSize = 16;
pConfigs[i].accumGreenSize = 16;
@@ -273,7 +273,7 @@ static Bool MGAInitVisualConfigs( ScreenPtr pScreen )
pConfigs[i].doubleBuffer = FALSE;
}
pConfigs[i].stereo = FALSE;
- pConfigs[i].bufferSize = 32;
+ pConfigs[i].bufferSize = 24;
if ( depth ) {
pConfigs[i].depthSize = 24;
pConfigs[i].stencilSize = 8;
@@ -342,13 +342,29 @@ static void MGADestroyContext( ScreenPtr pScreen, drmContext hwContext,
static void MGAWaitForIdleDMA( ScrnInfoPtr pScrn )
{
MGAPtr pMga = MGAPTR(pScrn);
+ drmMGALock lock;
int ret;
int i = 0;
+ memset( &lock, 0, sizeof(drmMGALock) );
+
for (;;) {
do {
- ret = drmMGAFlushDMA( pMga->drmFD,
- DRM_LOCK_QUIESCENT | DRM_LOCK_FLUSH );
+ /* first ask for quiescent and flush */
+ lock.flags = DRM_MGA_LOCK_QUIESCENT | DRM_MGA_LOCK_FLUSH;
+ do {
+ ret = drmCommandWrite( pMga->drmFD, DRM_MGA_FLUSH,
+ &lock, sizeof( drmMGALock ) );
+ } while ( ret == -EBUSY && i++ < DRM_MGA_IDLE_RETRY );
+
+ /* if it's still busy just try quiescent */
+ if ( ret == -EBUSY ) {
+ lock.flags = DRM_MGA_LOCK_QUIESCENT;
+ do {
+ ret = drmCommandWrite( pMga->drmFD, DRM_MGA_FLUSH,
+ &lock, sizeof( drmMGALock ) );
+ } while ( ret == -EBUSY && i++ < DRM_MGA_IDLE_RETRY );
+ }
} while ( ( ret == -EBUSY ) && ( i++ < MGA_TIMEOUT ) );
if ( ret == 0 )
@@ -357,7 +373,7 @@ static void MGAWaitForIdleDMA( ScrnInfoPtr pScrn )
xf86DrvMsg( pScrn->scrnIndex, X_ERROR,
"[dri] Idle timed out, resetting engine...\n" );
- drmMGAEngineReset( pMga->drmFD );
+ drmCommandNone( pMga->drmFD, DRM_MGA_RESET );
}
}
@@ -843,6 +859,7 @@ static Bool MGADRIKernelInit( ScreenPtr pScreen )
memset( &init, 0, sizeof(drmMGAInit) );
+ init.func = MGA_INIT_DMA;
init.sarea_priv_offset = sizeof(XF86DRISAREARec);
switch ( pMga->Chipset ) {
@@ -885,7 +902,7 @@ static Bool MGADRIKernelInit( ScreenPtr pScreen )
init.texture_offset[1] = pMGADRIServer->agpTextures.handle;
init.texture_size[1] = pMGADRIServer->agpTextures.size;
- ret = drmMGAInitDMA( pMga->drmFD, &init );
+ ret = drmCommandWrite( pMga->drmFD, DRM_MGA_INIT, &init, sizeof(drmMGAInit));
if ( ret < 0 ) {
xf86DrvMsg( pScrn->scrnIndex, X_ERROR,
"[drm] Failed to initialize DMA! (%d)\n", ret );
@@ -902,6 +919,38 @@ static Bool MGADRIKernelInit( ScreenPtr pScreen )
return TRUE;
}
+static void MGADRIIrqInit(MGAPtr pMga, ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+
+ /* version = drmGetVersion(pMga->drmFD);
+ if ( version ) {
+ if ( version->version_major != 3 ||
+ version->version_minor < 0 ) {*/
+ if (!pMga->irq) {
+ pMga->irq = drmGetInterruptFromBusID(
+ pMga->drmFD,
+ ((pciConfigPtr)pMga->PciInfo->thisCard)->busnum,
+ ((pciConfigPtr)pMga->PciInfo->thisCard)->devnum,
+ ((pciConfigPtr)pMga->PciInfo->thisCard)->funcnum);
+
+ if((drmCtlInstHandler(pMga->drmFD, pMga->irq)) != 0) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "[drm] failure adding irq handler, "
+ "there is a device already using that irq\n"
+ "[drm] falling back to irq-free operation\n");
+ pMga->irq = 0;
+ } else {
+ pMga->reg_ien = INREG( MGAREG_IEN );
+ }
+ }
+
+ if (pMga->irq)
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "[drm] dma control initialized, using IRQ %d\n",
+ pMga->irq);
+}
+
static Bool MGADRIBuffersInit( ScreenPtr pScreen )
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
@@ -1096,9 +1145,48 @@ Bool MGADRIScreenInit( ScreenPtr pScreen )
return FALSE;
}
- /* Check the MGA DRM version */
+ /* Check the DRM versioning */
{
- drmVersionPtr version = drmGetVersion(pMga->drmFD);
+ drmVersionPtr version;
+
+ /* Check the DRM lib version.
+ drmGetLibVersion was not supported in version 1.0, so check for
+ symbol first to avoid possible crash or hang.
+ */
+ if (xf86LoaderCheckSymbol("drmGetLibVersion")) {
+ version = drmGetLibVersion(pMga->drmFD);
+ }
+ else {
+ /* drmlib version 1.0.0 didn't have the drmGetLibVersion
+ entry point. Fake it by allocating a version record
+ via drmGetVersion and changing it to version 1.0.0
+ */
+ version = drmGetVersion(pMga->drmFD);
+ version->version_major = 1;
+ version->version_minor = 0;
+ version->version_patchlevel = 0;
+ }
+
+ if (version) {
+ if (version->version_major != 1 ||
+ version->version_minor < 1) {
+ /* incompatible drm library version */
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] MGADRIScreenInit failed because of a version mismatch.\n"
+ "[dri] libdrm.a module version is %d.%d.%d but version 1.1.x is needed.\n"
+ "[dri] Disabling DRI.\n",
+ version->version_major,
+ version->version_minor,
+ version->version_patchlevel);
+ drmFreeVersion(version);
+ MGADRICloseScreen( pScreen ); /* FIXME: ??? */
+ return FALSE;
+ }
+ drmFreeVersion(version);
+ }
+
+ /* Check the MGA DRM version */
+ version = drmGetVersion(pMga->drmFD);
if ( version ) {
if ( version->version_major != 3 ||
version->version_minor < 0 ) {
@@ -1189,6 +1277,8 @@ Bool MGADRIFinishScreenInit( ScreenPtr pScreen )
return FALSE;
}
+ MGADRIIrqInit(pMga, pScreen);
+
switch(pMga->Chipset) {
case PCI_CHIP_MGAG550:
case PCI_CHIP_MGAG400:
@@ -1250,13 +1340,22 @@ void MGADRICloseScreen( ScreenPtr pScreen )
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
MGAPtr pMga = MGAPTR(pScrn);
MGADRIServerPrivatePtr pMGADRIServer = pMga->DRIServerInfo;
+ drmMGAInit init;
if ( pMGADRIServer->drmBuffers ) {
drmUnmapBufs( pMGADRIServer->drmBuffers );
pMGADRIServer->drmBuffers = NULL;
}
- drmMGACleanupDMA( pMga->drmFD );
+ if (pMga->irq) {
+ drmCtlUninstHandler(pMga->drmFD);
+ pMga->irq = 0;
+ }
+
+ /* Cleanup DMA */
+ memset( &init, 0, sizeof(drmMGAInit) );
+ init.func = MGA_CLEANUP_DMA;
+ drmCommandWrite( pMga->drmFD, DRM_MGA_INIT, &init, sizeof(drmMGAInit) );
if ( pMGADRIServer->status.map ) {
drmUnmap( pMGADRIServer->status.map, pMGADRIServer->status.size );
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/vvga.c b/xc/programs/Xserver/hw/xfree86/drivers/rendition/vvga.c
deleted file mode 100644
index 6a26db3fc..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/vvga.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vvga.c,v 1.11 2001/10/28 03:33:44 tsi Exp $ */
-/*
- * file vvga.c
- *
- * Functions that handle the generic vga part of the Verite chips.
- */
-
-/*
- * includes
- */
-#include "rendition.h"
-#define VVGA_INTERNAL
-#include "vvga.h"
-#include "vtypes.h"
-#include "vos.h"
-#include "vmisc.h"
-#include "v1kregs.h"
-#include "v2kregs.h"
-
-#undef DEBUG
-
-void set_PLL(vu16, vu32);
-
-/*
- * global data
- */
-
-#ifdef STDVGAFONT
-#include "vgafont-std.data"
-#else
-#include "vgafont-vrx.data"
-#endif
-#include "vgapalette.data"
-
-/*
- * local function prototypes
- */
-
-static vu8 getvgareg(vu16 port, vu8 index);
-static void setvgareg(vu16 port, vu8 index, vu8 value);
-static void updattr(vu8 index, vu8 value);
-
-
-
-/*
- * functions
- */
-
-#if 0
-#if defined(SAVEVGA) || defined(XSERVER)
-static void
-verite_resetvga(void)
-{
- static struct VIDEO_REGS {
- vu8 seq[8]; /* sequencer regs */
- vu8 crtc[26]; /* crtc regs */
- vu8 grph[9]; /* graphics regs */
- vu8 attr[21]; /* attribute regs */
- } mode3={
- /* seq */
- {0x03,0x00,0x03,0x00,0x02,0xfa,0x01,0xfa},
-
- /* crtc */
- {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
- 0x00,0x4f,0x0d,0x0e,0x00,0x00,0x01,0xe0,
- 0x9c,0xae,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
- 0xff,0x19},
-
- /* grph */
- {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,0xff},
-
- /* attr */
- {0x00,0x01,0x02,0x03,0x04,0x05,0x14,
- 0x07,0x38,0x39,0x3a,0x3b,0x3c,0x3d,
- 0x3e,0x3f,0x0c,0x00,0x0f,0x08,0x00},
- };
- int c;
-
-#ifdef DEBUG
- ErrorF ("Rendition: Debug verite_resetvga called\n");
-#endif
-
- /* set attribute controller */
- for (c=0; c<0x15; c++)
- updattr(c, mode3.attr[c]);
-
- /* set CRTC registers */
- for (c=0; c<0x19; c++)
- setvgareg(0x3d4, c, mode3.crtc[c]);
-
- /* set graphics registers */
- for (c=0x00; c<0x09; c++)
- setvgareg(0x3ce, c, mode3.grph[c]);
-
- /* set sequencer registers */
- setvgareg(0x3c4, 0x00, 0x03); /* restart sequencer */
- for (c=0; c<5; c++)
- setvgareg(0x3c4, c, mode3.seq[c]);
-}
-
-static void
-verite_loadvgafont(void)
-{
- int c;
- vu8 b;
- vu8 *address;
- vu8 *vidmem;
- vu8 *vbase;
- int fbFlags;
-
-#ifdef DEBUG
- ErrorF ("Rendition: Debug verite_loadvgafont called\n");
-#endif
-
- /* Assert synchroneous reset while setting the clock mode */
- setvgareg(0x3c4, 0, 1); /* assert synchronous reset */
- verite_out8(0x3c2, 0x67); /* select clock */
- setvgareg(0x3c4, 0, 3); /* de-assert synchronous reset */
-
- /* load 8x16 font into plane 2 */
- b=(getvgareg(0x3c4, 0x04)|0x04)&0x07; /* memory mode reg - */
- setvgareg(0x3c4, 0x04, b); /* disable odd/even and chain 4 */
-
- /* disable video and enable all to cpu to enable maximum video
- * memory access */
- b=getvgareg(0x3c4, 0x01)|0x20; /* clocking mode register - */
- setvgareg(0x3c4, 0x01, b); /* enable all to cpu, disable video */
-
- b=getvgareg(0x3ce, 0x05)&0xef; /* graphics controller - */
- setvgareg(0x3ce, 0x05, b); /* disable odd/even */
-
- setvgareg(0x3ce, 0x06, 0x05); /* memory map - set it to A000
- * and graphics mode */
-
- setvgareg(0x3c4, 2, 4); /* enable write plane 2 */
-
- /* fill plane 2 with 8x16 font */
- address=font8x16;
- fbFlags = VIDMEM_MMIO; /* VIDMEM_SPARSE is implied on Alpha */
-
- vbase = xf86MapVidMem(0, fbFlags, 0xa0000, 64*1024);
- vidmem=vbase;
- for (c=0; c<=255; c++) {
- verite_memtobus_cpy(vbase+(32*c), address, 16);
- address+=16;
- }
-
- xf86UnMapVidMem(0, vbase, 64*1024);
- /* restore the standard vga register values */
- verite_resetvga();
-}
-#endif
-#endif
-
-void
-verite_textmode(struct verite_board_t *board)
-{
- vu16 iob=board->io_base;
- int tmp;
-
-#ifdef DEBUG
- ErrorF ("Rendition: Debug verite_textmode called\n");
-#endif
-
- /* dac */
- verite_out8(iob+DACCOMMAND0, 0x80); /* 6 bit op, enable extended */
- verite_out8(iob+DACCOMMAND1, 0x68); /* disable palette bypass */
- verite_out8(iob+DACCOMMAND2, 0x00); /* disable cursor & pixel packing */
- if (V1000_DEVICE == board->chip) {
- verite_out8(iob+DACRAMWRITEADR, 0x01); /* select COMMAND3 register */
- verite_out8(iob+DACCOMMAND3, 0x00); /* no clock doubling */
- }
- verite_out8(iob+DACCOMMAND0, 0x00); /* 6 bit op */
-
- if (V1000_DEVICE == board->chip) {
- verite_out32(iob+DRAMCTL, 0x140000);
- set_PLL(iob, 0x40000);
- usleep(500);
- }
- else {
- /* memctl */
- tmp = 0x1800|verite_in32(iob+DRAMCTL);
- verite_out32(iob+DRAMCTL, tmp); /* linear mode */
-
- /* pixel clock */
- verite_out32(iob+PCLKPLL, 0x300000);
- /* system and memory clock */
- verite_out32(iob+SCLKPLL, 0x2480C); /* mclk=86 sclk=43 */
-
- /* Need to wait 200uS for PLL to stabilize --
- * let's play it safe with 500 */
- usleep(500);
-
- /* wait until VBLANK */
- while ((verite_in32(iob+CRTCSTATUS)&CRTCSTATUS_VERT_MASK) !=
- CRTCSTATUS_VERT_ACTIVE);
- while ((verite_in32(iob+CRTCSTATUS)&CRTCSTATUS_VERT_MASK) ==
- CRTCSTATUS_VERT_ACTIVE);
- }
-
- /* vga mode */
- verite_out8(iob+MODEREG, VGA_MODE);
-
- /* crtc */
- verite_out32(iob+CRTCCTL, 0x44cc2);
- verite_out32(iob+CRTCHORZ, 0x2b0a4f);
- verite_out32(iob+CRTCVERT, 0x9301df);
- verite_out32(iob+CRTCOFFSET, 0x40);
-#if 0
-#ifdef SAVEVGA
- verite_loadvgafont();
- verite_restoretextmode(board);
- verite_restorepalette();
-#else
-#ifdef XSERVER
- verite_loadvgafont();
- verite_restorepalette();
-#endif
-#endif
-#endif
-
-}
-
-
-
-void
-verite_savetextmode(struct verite_board_t *board)
-{
- vu8 *vbase;
- int fbFlags;
-
-#ifdef DEBUG
- ErrorF ("Rendition: Debug verite_savetextmode called\n");
-#endif
-
- /* save the cursor position */
- board->cursor_hi=getvgareg(0x3d4, 0xe);
- board->cursor_low=getvgareg(0x3d4, 0xf);
-
- /* save the screen offset */
- board->offset_hi=getvgareg(0x3d4, 0xc);
- board->offset_low=getvgareg(0x3d4, 0xd);
-
- /* save the screen contents */
- board->scr_contents=(vu8 *)xalloc(0x8000);
- fbFlags = VIDMEM_MMIO; /* VIDMEM_SPARSE is implied on Alpha */
-
- vbase = xf86MapVidMem(0, fbFlags, 0xb8000, 0x8000);
- verite_bustomem_cpy(board->scr_contents, vbase, 0x8000);
- xf86UnMapVidMem(0, vbase, 0x8000);
-}
-
-
-
-static void
-verite_restoretextmode(struct verite_board_t *board)
-{
- vu8 *vbase;
- int fbFlags;
-
-#ifdef DEBUG
- ErrorF ("Rendition: Debug verite_restoretextmode called\n");
-#endif
-
- /* restore the cursor position */
- setvgareg(0x3d4, 0xe, board->cursor_hi);
- setvgareg(0x3d4, 0xf, board->cursor_low);
-
- /* restore the screen offset */
- setvgareg(0x3d4, 0xc, board->offset_hi);
- setvgareg(0x3d4, 0xd, board->offset_low);
-
- /* restore the screen contents */
- fbFlags = VIDMEM_MMIO; /* VIDMEM_SPARSE is implied on Alpha */
-
- vbase = xf86MapVidMem(0, fbFlags, 0xb8000, 0x8000);
- verite_memtobus_cpy(vbase, board->scr_contents, 0x8000);
- xf86UnMapVidMem(0, vbase, 0x8000);
- xfree(board->scr_contents);
-}
-
-
-
-static void
-verite_restorepalette(void)
-{
- int c;
- vu8 *pal=vga_pal;
-
-#ifdef DEBUG
- ErrorF ("Rendition: Debug verite_restorepalette called\n");
-#endif
-
- verite_out8(0x3c8, 0);
- for (c=0; c<768; c++)
- verite_out8(0x3c9, *pal++);
-}
-
-
-
-/*
- * local functions
- */
-
-/*
- * static vu8 getvgareg(vu16 port, vu8 index)
- *
- * Reads in a vga register.
- */
-static vu8
-getvgareg(vu16 port, vu8 index)
-{
- verite_out8(port, index);
- return verite_in8(port+1);
-}
-
-
-
-/*
- * static void setvgareg(vu16 port, vu8 index, vu8 value)
- *
- * Sets a vga register.
- */
-static void
-setvgareg(vu16 port, vu8 index, vu8 value)
-{
- verite_out8(port, index);
- verite_out8(port+1, value);
-}
-
-
-
-/*
- * static void updattr(vu8 index, vu8 value)
- *
- * Used to write the attribute controller registers.
- */
-static void
-updattr(vu8 index, vu8 value)
-{
- verite_in8(0x3da); /* points to index register for color adapter */
- verite_in8(0x3ba); /* points to index register for mono */
- verite_out8(0x3c0, index);
- verite_out8(0x3c0, value);
- verite_out8(0x3c0, index|0x20);
-}
-
-
-
-/*
- * end of file vvga.c
- */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/vvga.h b/xc/programs/Xserver/hw/xfree86/drivers/rendition/vvga.h
deleted file mode 100644
index f9efac888..000000000
--- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/vvga.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vvga.h,v 1.6 2001/10/28 03:33:44 tsi Exp $ */
-/*
- * file vvga.h
- *
- * Headerfile for vvga.c
- */
-
-#ifndef __VVGA_H__
-#define __VVGA_H__
-
-
-
-/*
- * includes
- */
-
-#include "vtypes.h"
-
-
-
-/*
- * function prototypes
- */
-
-void verite_textmode(struct verite_board_t *board);
-void verite_savetextmode(struct verite_board_t *board);
-#ifdef VVGA_INTERNAL
-#if 0
-#if defined(SAVEVGA) || defined(XSERVER)
-static void verite_resetvga(void);
-static void verite_loadvgafont(void);
-#endif
-#endif
-static void verite_restoretextmode(struct verite_board_t *board);
-static void verite_restorepalette(void);
-#endif
-
-
-#endif /* __VVGA_H__ */
-
-/*
- * end of file vvga.h
- */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c
index 475158783..bca90b412 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c
@@ -195,7 +195,7 @@ TDFXInitVisualConfigs(ScreenPtr pScreen)
else
pConfigs[i].doubleBuffer = FALSE;
pConfigs[i].stereo = FALSE;
- pConfigs[i].bufferSize = 16;
+ pConfigs[i].bufferSize = (pScrn->bitsPerPixel==32) ? 32 : 24;
if (depth) {
if (pTDFX->cpp > 2)
pConfigs[i].depthSize = 24;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_limits.h b/xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_limits.h
index 305f0a654..5def289ed 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_limits.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_limits.h
@@ -2,7 +2,7 @@
/* **********************************************************
* Copyright (C) 1998-2001 VMware, Inc.
* All Rights Reserved
- * $Id: svga_limits.h,v 1.1.1.2 2002/10/22 13:41:06 alanh Exp $
+ * $Id: svga_limits.h,v 1.1.1.2.6.1 2003/02/21 07:16:44 anholt Exp $
* **********************************************************/
/*
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_reg.h b/xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_reg.h
index e7235f747..8bef557f3 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_reg.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_reg.h
@@ -1,7 +1,7 @@
/* **********************************************************
* Copyright (C) 1998-2001 VMware, Inc.
* All Rights Reserved
- * $Id: svga_reg.h,v 1.1.1.4 2002/10/22 13:41:06 alanh Exp $
+ * $Id: svga_reg.h,v 1.3.6.1 2003/02/21 07:16:44 anholt Exp $
* **********************************************************/
/*
diff --git a/xc/programs/Xserver/hw/xfree86/etc/apSolx86.shar b/xc/programs/Xserver/hw/xfree86/etc/apSolx86.shar
deleted file mode 100644
index a870210d4..000000000
--- a/xc/programs/Xserver/hw/xfree86/etc/apSolx86.shar
+++ /dev/null
@@ -1,1339 +0,0 @@
-#!/bin/sh
-# $XFree86: xc/programs/Xserver/hw/xfree86/etc/apSolx86.shar,v 3.4 1996/12/23 06:47:07 dawes Exp $
-# This is a shell archive (produced by shar 3.49)
-# To extract the files from this archive, save it to a file, remove
-# everything above the "!/bin/sh" line above, and type "sh file_name".
-#
-# made 09/25/1994 14:29 UTC by davidh@barite
-# Source directory /usr10/davidh/aperture
-#
-# $XConsortium: apSolx86.shar /main/4 1996/02/21 17:47:22 kaleb $
-#
-# existing files will NOT be overwritten unless -c is specified
-#
-# This shar contains:
-# length mode name
-# ------ ---------- ------------------------------------------
-# 1342 -rw-r--r-- aperture/Makefile
-# 4042 -rw-r--r-- aperture/aperture.h
-# 95 -rw-r--r-- aperture/devlink.tab
-# 2914 -rw-r--r-- aperture/README
-# 20528 -rw-r--r-- aperture/aperture.c
-# 518 -rw-r--r-- aperture/aperture.conf
-# 3530 -rw-r--r-- aperture/aptest.c
-# 2174 -rw-r--r-- aperture/DISCLAIMER
-#
-# ============= aperture/Makefile ==============
-if test ! -d 'aperture'; then
- echo 'x - creating directory aperture'
- mkdir 'aperture'
-fi
-if test -f 'aperture/Makefile' -a X"$1" != X"-c"; then
- echo 'x - skipping aperture/Makefile (File already exists)'
-else
-echo 'x - extracting aperture/Makefile (Text)'
-sed 's/^X//' << 'SHAR_EOF' > 'aperture/Makefile' &&
-#
-# File: makefile for aperture Framebuffer Driver
-# Author: Doug Anson (danson@lgc.com)
-# Date: 2/15/94
-# Modified: David Holland (davidh@use.com)
-# Date: 2/23/94
-# - Changed name, and debugging structure
-#
-# $Id
-#
-# Debug flags may be set to the following values:
-#
-# APERTURE_DEBUG = 1 -- basic log reporting (mininal)
-# APERTURE_DEBUG = 2 -- more log reporting (mmap results)
-# APERTURE_DEBUG = 3 -- verbose log reporting (kernel entry points)
-#
-X
-#
-# GNU gcc compiler (2.4.5 or 2.5.8)
-CC=gcc
-CFLGS=-fno-builtin
-X
-#
-# Proworks compiler (untested!)
-#CC= /opt/SUNWspro/bin/cc
-#CFLGS=-Xa
-X
-#
-# location of lint program (untested!)
-LINT= /usr/opt/SUNWspro/bin/lint
-X
-#
-# Debug error reporting
-#DEBUG_FLG=
-#DEBUG_FLG=-DAPERTURE_DEBUG=1
-#DEBUG_FLG=-DAPERTURE_DEBUG=2
-DEBUG_FLG=-DAPERTURE_DEBUG=3
-X
-#
-# Files and object declarations
-KERNEL_FLGS=-D_KERNEL -DSUNDDI -I.
-CFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG)
-CFILES= aperture.c
-HEADERS= aperture.h
-OBJS= aperture.o
-DRIVER= aperture
-APTEST= aptest
-APTESTOBJ= aptest.o
-X
-#
-# Make rules
-all: aperture aptest
-X
-aperture: $(OBJS)
-X ld -r -o aperture aperture.o
-X
-install: aperture aptest
-X cp aperture aperture.conf /kernel/drv
-X
-aptest: $(APTESTOBJ)
-X $(CC) -o $(APTEST) $(APTESTOBJ)
-X
-clean:
-X rm -f *% *.BAK $(OBJS) $(APTESTOBJ) $(APTEST) $(DRIVER) core
-X
-lint:
-X $(LINT) -D_KERNEL -x -u $(CFILES)
-SHAR_EOF
-chmod 0644 aperture/Makefile ||
-echo 'restore of aperture/Makefile failed'
-Wc_c="`wc -c < 'aperture/Makefile'`"
-test 1342 -eq "$Wc_c" ||
- echo 'aperture/Makefile: original size 1342, current size' "$Wc_c"
-fi
-# ============= aperture/aperture.h ==============
-if test -f 'aperture/aperture.h' -a X"$1" != X"-c"; then
- echo 'x - skipping aperture/aperture.h (File already exists)'
-else
-echo 'x - extracting aperture/aperture.h (Text)'
-sed 's/^X//' << 'SHAR_EOF' > 'aperture/aperture.h' &&
-/*
-X * Copyright 1994 Doug Anson, danson@lgc.com & David Holland, davidh@use.com
-X *
-X * File: aperture.h
-X * Author: Doug Anson
-X * Date: 1/31/94
-X *
-X * Modified: David Holland (davidh@use.com)
-X * Log: Modified for new name 2/23/9
-X *
-X * Purpose: This header is the master header for the Solaris 2.1 x86
-X * framebuffer mmap driver. Portions of this driver are taken
-X * from mmapio.h 1.4 copyright 93/06/03 Sun Microsystems, Inc.
-X *
-X * Disclamer:
-X *
-X * This code is based largely upon the sample device drivers provided
-X * by Sun Microsystems Inc.
-X *
-X * Original copyright notice:
-X * @(#)mmapio.h 1.4 copyright 93/06/03 Sun Microsystems, Inc.
-X *
-X * Our copyright notice:
-X * Permission to use, copy, modify, distribute, and sell this software and its
-X * documentation for any purpose is hereby granted without fee, provided that
-X * the above copyright notice appear in all copies and that both that
-X * copyright notice and this permission notice appear in supporting
-X * documentation, and that the name of Doug Anson, and David Holland be used in
-X * advertising or publicity pertaining to distribution of the software
-X * Doug Anson, and David Holland make no * representations about the
-X * suitability of this software for any purpose.
-X * It is provided "as is" without express or implied warranty.
-X *
-X * Original disclamer from Sun Microsystems, Inc.:
-X * This is a package of sample device drivers for Solaris 2.x (SunOS
-X * 5.x). You may use, modify and distribute these drivers and/or binaries
-X * derived from them. However please note that:
-X *
-X * These examples are provided with no warranties of any kind, including
-X * without limitation accuracy and usefulness, and Sun expressly disclaims
-X * all implied warranties of merchantability, fitness for a particular
-X * purpose and non-infringement. In no event shall Sun be liable for any
-X * damages, including without limitation, direct, special, indirect, or
-X * consequential damages arising out of, or relating to, use of these
-X * examples by customer or any third party. Sun is under no obligation to
-X * provide support to customer for this software.
-X *
-X * Our disclaimer:
-X * DOUG ANSON, AND DAVID HOLLAND DISCLAIMS ALL WARRIENTS WITH REGARD TO THIS
-X * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS,
-X * IN NO EVENT SHALL DOUG ANSON, OR DAVID HOLLAND BE LIABLE FOR ANY SPECIAL,
-X * INDIRECT, OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM
-X * USAGE OF THIS SOFTWARE.
-X */
-X
-/*
-X * linear framebuffer aperture driver header file
-X *
-X * $Id
-X */
-X
-#ifndef APERTURE_H
-#define APERTURE_H
-X
-/*
-X * Framebuffer identification definitions
-X */
-#define APERTURE_NAME "aperture"
-#define DEV_BANNER_STRING "SVGA Framebuffer Driver v0.99"
-#define DEV_IDENT_STRING APERTURE_NAME
-X
-/*
-X * driver.conf(4) "reg" property definition for aperture driver:
-X * FORMAT: reg=AP_REGNUM,AP_ADDR,AP_SIZE
-X */
-#define AP_REGNUM 0 /* register number is 1st number in "reg" prop */
-#define AP_ADDR 1 /* fb base address is 2nd number in "reg" prop */
-#define AP_SIZE 2 /* fb length value is 3rd number in "reg" prop */
-#define AP_MAX 3 /* number of values in "reg" property */
-X
-/*
-X * How big a chunk of register we map with each ddi_map_regs(9F)
-X */
-#define AP_MEM_CHUNK sizeof(int)
-X
-/*
-X * Error value for mmap(2) failure status
-X */
-#define AP_MEM_FAILURE -1
-X
-/*
-X * Main memory map structure for the Framebuffer mmap driver
-X */
-struct mmap
-{
-X u_int regnum; /* registers number */
-X volatile caddr_t regbase; /* base address of device to mmap */
-X off_t regsize; /* length of region to mmap(2) */
-X off_t reglength; /* map length for ddi_map_regs(9F) */
-X volatile caddr_t kaddr; /* kernel address of mapped device */
-X off_t off; /* offset from mmap(2) call */
-X volatile off_t mapaddr; /* base address of mmap(2) region */
-X kmutex_t map_lock; /* device map mutex lock */
-X dev_info_t *dip; /* device information pointer */
-};
-typedef struct mmap Mmap;
-X
-#endif /* APERTURE_H */
-SHAR_EOF
-chmod 0644 aperture/aperture.h ||
-echo 'restore of aperture/aperture.h failed'
-Wc_c="`wc -c < 'aperture/aperture.h'`"
-test 4042 -eq "$Wc_c" ||
- echo 'aperture/aperture.h: original size 4042, current size' "$Wc_c"
-fi
-# ============= aperture/devlink.tab ==============
-if test -f 'aperture/devlink.tab' -a X"$1" != X"-c"; then
- echo 'x - skipping aperture/devlink.tab (File already exists)'
-else
-echo 'x - extracting aperture/devlink.tab (Text)'
-sed 's/^X//' << 'SHAR_EOF' > 'aperture/devlink.tab' &&
-# The following entry is for the SVGA framebuffer driver
-type=ddi_pseudo;name=aperture fbs/\M0
-SHAR_EOF
-chmod 0644 aperture/devlink.tab ||
-echo 'restore of aperture/devlink.tab failed'
-Wc_c="`wc -c < 'aperture/devlink.tab'`"
-test 95 -eq "$Wc_c" ||
- echo 'aperture/devlink.tab: original size 95, current size' "$Wc_c"
-fi
-# ============= aperture/README ==============
-if test -f 'aperture/README' -a X"$1" != X"-c"; then
- echo 'x - skipping aperture/README (File already exists)'
-else
-echo 'x - extracting aperture/README (Text)'
-sed 's/^X//' << 'SHAR_EOF' > 'aperture/README' &&
-Framebuffer apperture driver.
-X
-(Note, see the DISCLAIMER file before using this driver!
-X - Sorry, we've gotta cover ourselves)
-X
-This driver was written to help work around one particular limitation in the
-x86 /dev/mem driver.
-X
-1) No Solaris x86 device we've found allows access to memory regions that
-X exist above the amount of RAM in the machine. So one could not
-X access the linear frame buffer of a Mach32 VLB board that decodes
-X is memory aperture at the 124Megabyte mark.
-X
-This driver attempts to work around some of those problems. All it simply
-does is allow a user to mmap() any physical address less than 128Megs
-back into user address space.
-X
-It is the corroborative work of Doug Anson (danson@lgc.com), and
-David Holland (davidh@use.com).
-X
-Many thanks to the XFree86[tm] Alpha, and Beta teams, for without
-all their hard work, there wouldn't be any need for this driver.
-X
-Installation instructions:
-X
-1) Check the Makefile, for appropriate CC, and CFLAGS defintions.
-X Compiling with APERTURE_DEBUG defined (via -DAPERTURE_DEBUG=?) means
-X the driver will generate reams of debugging output. You'll probably
-X want to leave this off, or set to zero..
-X
-2) type 'make'. The driver and test program should compile with out any
-X problems. There also should not be any warning messages.
-X
-3) Become 'root'.
-X
-4) type 'make install' and run 'add_drv /kernel/drv/aperture'.
-X The screen should look something like this:
-X
-X # make install
-X cp aperture aperture.conf /kernel/drv
-X # add_drv /kernel/drv/aperture
-X
-X This installs the driver in the system.
-X
-5) While as root modify the file /etc/devlink.tab, adding these lines:
-X
-# The following entry is for the SVGA framebuffer driver
-type=ddi_pseudo;name=aperture fbs/\M0
-X
-X Add that line exactly as shown. You may also simply add the
-X contents of the devlink.tab file supplied to /etc/devlink.tab.
-X It contains the lines as well. (Yes, that is a tab between
-X aperture, and fbs, not spaces - very important)
-X
-6) Perform a reconfiguration boot of the system.
-X
-X # touch /reconfigure
-X # init 6
-X
-7) Login as root and run the aptest program. It tests that the
-X mmap driver is working properly, by mmaping the main bios
-X into user address space. If you happen to have AMI bios the
-X output will look something like so:
-X
-# ./aptest
-NOTICE: BIOS mapped [0xf0000 ,size=4096) to addr=0x8000b000...
-0123AAAAMMMMIIII05/05/91(C)1990 American Megatrends Inc., All Rights Reserved
-DONE displaying memory contents (80 bytes)
-UNMAPPING [0xf0000 ,size=4096) to addr=0x8000b000... and closing...DONE.
-Exiting successful...
-#
-X
-X
-8) Nope, there are not any man pages, I don't know nroff. As for programming
-X suggestions, take a look at aptest.c a working example is obviously
-X in there.
-X
-Bug reports, questions, suggestions, etc can be sent to
-X
-Doug Anson
-danson@lgc.com
-X
-X or
-X
-David Holland
-davidh@use.com
-X
-Flames can be sent to
-/dev/null
-SHAR_EOF
-chmod 0644 aperture/README ||
-echo 'restore of aperture/README failed'
-Wc_c="`wc -c < 'aperture/README'`"
-test 2914 -eq "$Wc_c" ||
- echo 'aperture/README: original size 2914, current size' "$Wc_c"
-fi
-# ============= aperture/aperture.c ==============
-if test -f 'aperture/aperture.c' -a X"$1" != X"-c"; then
- echo 'x - skipping aperture/aperture.c (File already exists)'
-else
-echo 'x - extracting aperture/aperture.c (Text)'
-sed 's/^X//' << 'SHAR_EOF' > 'aperture/aperture.c' &&
-/*
-X * Copyright 1994 Doug Anson, danson@lgc.com & David Holland, davidh@use.com
-X *
-X * File: aperture.c
-X * Author: Doug Anson (danson@lgc.com)
-X * Date: 1/31/94
-X *
-X * Modified: David Holland (davidh@use.com)
-X * Date: 2/23/94
-X * Changes: Changed general name of driver
-X * Debugging flags
-X * Removed a few extraneous erorr messages.
-X *
-X *
-X * Purpose: This file is the master device file for the Solaris 2.1 x86
-X * framebuffer aperture driver. Portions of this driver are taken
-X * from mmap.c 1.4 copyright 93/06/03 Sun Microsystems, Inc.
-X * (Sample memory mapped driver for Solaris 2.0/Sun OS 5.0)
-X *
-X * This driver allows accelerated SVGA graphics cards that are
-X * attached vi 32-bit paths (VESA/EISA/MC) and that have
-X * linear framebuffer capabilities to have their framebuffer
-X * memory mapped into the user process space.
-X *
-X * Disclamer:
-X *
-X * This code is based largely upon the sample device drivers provided
-X * by Sun Microsystems Inc.
-X *
-X * Original copyright notice:
-X * @(#)mmap.c 1.3 copyright 93/06/03 Sun Microsystems, Inc.
-X *
-X * Our copyright notice:
-X * Permission to use, copy, modify, distribute, and sell this software and its
-X * documentation for any purpose is hereby granted without fee, provided that
-X * the above copyright notice appear in all copies and that both that
-X * copyright notice and this permission notice appear in supporting
-X * documentation, and that the name of Doug Anson, and David Holland be used in
-X * advertising or publicity pertaining to distribution of the software
-X * Doug Anson, and David Holland make no * representations about the
-X * suitability of this software for any purpose.
-X * It is provided "as is" without express or implied warranty.
-X *
-X * Original disclamer from Sun Microsystems, Inc.:
-X * This is a package of sample device drivers for Solaris 2.x (SunOS
-X * 5.x). You may use, modify and distribute these drivers and/or binaries
-X * derived from them. However please note that:
-X *
-X * These examples are provided with no warranties of any kind, including
-X * without limitation accuracy and usefulness, and Sun expressly disclaims
-X * all implied warranties of merchantability, fitness for a particular
-X * purpose and non-infringement. In no event shall Sun be liable for any
-X * damages, including without limitation, direct, special, indirect, or
-X * consequential damages arising out of, or relating to, use of these
-X * examples by customer or any third party. Sun is under no obligation to
-X * provide support to customer for this software.
-X *
-X * Our disclaimer:
-X * DOUG ANSON, AND DAVID HOLLAND DISCLAIMS ALL WARRIENTS WITH REGARD TO THIS
-X * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS,
-X * IN NO EVENT SHALL DOUG ANSON, OR DAVID HOLLAND BE LIABLE FOR ANY SPECIAL,
-X * INDIRECT, OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM
-X * USAGE OF THIS SOFTWARE.
-X */
-X
-/*
-X * linear framebuffer aperture driver
-X *
-X * $Id
-X */
-X
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/errno.h>
-#include <sys/file.h>
-#include <sys/conf.h>
-#include <sys/uio.h>
-#include <sys/map.h>
-#include <sys/debug.h>
-#include <sys/modctl.h>
-#include <sys/kmem.h>
-#include <sys/cmn_err.h>
-#include <sys/open.h>
-#include <sys/stat.h>
-#include <sys/ddi.h>
-#include <sys/sunddi.h>
-X
-#include "aperture.h"
-X
-/* opaque handle top of state structs */
-static void *state_head = NULL;
-X
-/*
-X * Solaris DDI/DKI driver entry points
-X */
-#if defined(__STDC__)
-static int aperture_getinfo(dev_info_t *, ddi_info_cmd_t, void *,void **);
-static int aperture_identify(dev_info_t *dip);
-static int aperture_probe(dev_info_t *dip);
-static int aperture_attach(dev_info_t *, ddi_attach_cmd_t);
-static int aperture_open(dev_t *, int, int, cred_t *);
-static int aperture_close(dev_t, int, int, cred_t *);
-static int aperture_detach(dev_info_t *, ddi_detach_cmd_t);
-static int aperture_mmap(dev_t, off_t, int);
-#else
-static int aperture_getinfo();
-static int aperture_identify();
-static int aperture_probe();
-static int aperture_attach();
-static int aperture_open();
-static int aperture_close();
-static int aperture_detach();
-static int aperture_mmap();
-#endif /* __STDC__ */
-X
-/*
-X * Solaris DDI/DKI module linkeage structure declarations
-X */
-static struct cb_ops aperture_cb_ops =
-{
-X aperture_open, /* XXopen routine */
-X aperture_close, /* XXclose routine */
-X nodev, /* XXstrategy routine */
-X nodev, /* XXprint routine */
-X nodev, /* XXdump routine */
-X nodev, /* XXread routine */
-X nodev, /* XXwrite routine */
-X nodev, /* XXioctl routine */
-X nodev, /* XXdevmap routine */
-X aperture_mmap, /* XXmmap routine */
-X ddi_segmap, /* XXsegmap routine */
-X nochpoll, /* XXchpoll routine */
-X ddi_prop_op, /* XXprop_op routine */
-X (struct streamtab *)0, /* not a STREAMS driver */
-X D_NEW | D_MP, /* safe for multi-thread/multi-processor*/
-};
-X
-static struct dev_ops aperture_ops =
-{
-X DEVO_REV, /* DEVO_REV indicated by manual */
-X 0, /* device reference count */
-X aperture_getinfo, /* devo_getinfo routine */
-X aperture_identify, /* devo_identiry routine */
-X aperture_probe, /* device probe for non-self-id */
-X aperture_attach, /* devo_attach routine */
-X aperture_detach, /* devo_detach routine */
-X nodev, /* device reset routine */
-X &aperture_cb_ops, /* cb_ops structure pointer */
-X (struct bus_ops *)0, /* bus operations */
-};
-X
-extern struct mod_ops mod_driverops;
-static struct modldrv modldrv =
-{
-X &mod_driverops, /* mod_ops structure pointer */
-X DEV_BANNER_STRING, /* device banner string */
-X &aperture_ops, /* dev_ops structure pointer */
-};
-X
-static struct modlinkage modlinkage =
-{
-X MODREV_1, /* as indicated indicated by manual */
-X (void *)&modldrv, /* module driver structure pointer */
-X NULL, /* termination of list of linkage structures */
-};
-X
-/*
-X * Function: _init()
-X * Purpose: Solaris DDI/DKI _init(9E) entry point
-X * Author: Doug Anson
-X * Calls:
-X * Log: DMA -- Origional Version
-X * DWH - Removed extra cmn_err() calls 2/23/94
-X * DWH - Changed debugging 2/23/94
-X */
-#if defined(__STDC__)
-int _init(void)
-#else
-int _init()
-#endif /* __STDC__ */
-{
-X register int error;
-X
-#if APERTURE_DEBUG >= 3
-X
-X /* enterance announcement */
-X cmn_err(CE_CONT,"%s: entering _init(aperture)\n", DEV_IDENT_STRING);
-X
-#endif
-X
-X if ((error = ddi_soft_state_init(&state_head, sizeof (Mmap), 1)) != 0)
-X {
-X /* failed to get state structure */
-X return (error);
-X }
-X
-X if ((error = mod_install(&modlinkage)) != 0)
-X ddi_soft_state_fini(&state_head);
-X
-X return (error);
-}
-X
-/*
-X * Function: _info()
-X * Purpose: Solaris DDI/DKI _info(9E) entry point
-X * Author: Doug Anson
-X * Calls:
-X * Modified: David Holland (davidh@use.com)
-X * Log: DMA -- Origional Version
-X * DWH - Changed debugging 2/23/94
-X */
-#if defined(__STDC__)
-int _info(struct modinfo *modinfop)
-#else
-int _info(modinfop)
-struct modinfo *modinfop;
-#endif /* __STDC__ */
-{
-X
-#if APERTURE_DEBUG >= 3
-X
-X /* entrance announcement */
-X cmn_err(CE_CONT,"%s: entering _info(aperture)\n", DEV_IDENT_STRING);
-X
-#endif /* APERTURE_DEBUG >= 3 */
-X
-X return (mod_info(&modlinkage, modinfop));
-}
-X
-/*
-X * Function: _fini()
-X * Purpose: Solaris DDI/DKI _fini(9E) entry point
-X * Author: Doug Anson
-X * Calls:
-X * Modified: David Holland (davidh@use.com)
-X * Log: DMA -- Origional Version
-X * DWH - Changed debugging
-X */
-#if defined(__STDC__)
-int _fini(void)
-#else
-int _fini()
-#endif /* __STDC__ */
-{
-X int status;
-X
-#if APERTURE_DEBUG >= 3
-X
-/* entrance announcement */
-cmn_err(CE_CONT,"%s: entering _fini(aperture)\n", DEV_IDENT_STRING);
-X
-#endif /* APERTURE_DEBUG >= 3*/
-X
-X if ((status = mod_remove(&modlinkage)) != 0)
-X return (status);
-X
-X ddi_soft_state_fini(&state_head);
-X
-X return (status);
-}
-X
-/*
-X * Function: aperture_getinfo()
-X * Purpose: This function provides the getinfo(9E) functionality
-X * Author: Doug Anson
-X * Calls:
-X * Modified: David Holland (davidh@use.com)
-X * Log: DMA -- Origional Version
-X * DWH - Changed function name/variables/debugging 2/23/94
-X */
-#if defined(__STDC__)
-static int aperture_getinfo(dev_info_t *dip, ddi_info_cmd_t infocmd,
-X void *arg, void **result)
-#else
-static int aperture_getinfo(dip,infocmd,arg,result)
-dev_info_t *dip;
-ddi_info_cmd_t infocmd;
-void *arg;
-void **result;
-#endif /* __STDC__ */
-{
-X register int error;
-X register Mmap *aperture_p = NULL;
-X
-#if APERTURE_DEBUG >= 3
-X
-X /* enterance announcement */
-X cmn_err(CE_CONT,"%s: entering aperture_getinfo()\n", DEV_IDENT_STRING);
-X
-#endif
-X
-X switch (infocmd)
-X {
-X case DDI_INFO_DEVT2DEVINFO:
-X aperture_p = (Mmap *)ddi_get_soft_state(state_head, getminor((dev_t)arg));
-X if (aperture_p == NULL)
-X {
-X /* could not get state structure */
-X *result = NULL;
-X error = DDI_FAILURE;
-X }
-X else
-X {
-X /* got state structure */
-X *result = aperture_p->dip;
-X error = DDI_SUCCESS;
-X }
-X break;
-X case DDI_INFO_DEVT2INSTANCE:
-X *result = (void *)getminor((dev_t)arg);
-X error = DDI_SUCCESS;
-X break;
-X default:
-X *result = NULL;
-X error = DDI_FAILURE;
-X break;
-X }
-X return (error);
-}
-X
-/*
-X * Function: aperture_identify()
-X * Purpose: This function implements the identify(9E) functionality
-X * Author: Doug Anson
-X * Calls:
-X * Modified: David Holland (davidh@use.com)
-X * Log: DMA -- Origional Version
-X * DWH - Changed function name/debugging/variables 2/23/94
-X */
-#if defined(__STDC__)
-static int aperture_identify(dev_info_t *dip)
-#else
-static int aperture_identify(dip)
-dev_info_t *dip;
-#endif /* __STDC__ */
-{
-#if APERTURE_DEBUG >= 3
-X
-X /* entrance announcement */
-X cmn_err(CE_CONT,"%s: entering aperture_identify()\n", DEV_IDENT_STRING);
-X
-#endif
-X
-X /* check the driver name and respond */
-X if (strcmp(ddi_get_name(dip), APERTURE_NAME) == 0)
-X return (DDI_IDENTIFIED); /* device driver is identified */
-X else
-X return (DDI_NOT_IDENTIFIED); /* device driver not identified */
-}
-X
-/*
-X * Function: aperture_probe()
-X * Purpose: This function implements the probe(9E) functionality.
-X * Currently this function returns a "dont care" result
-X * as nothing is probed.
-X * Author: Doug Anson
-X * Calls:
-X * Modfied: David Holland (davidh@use.com)
-X * Log: DMA -- Origional Version
-X * DWH - changed function name/variables/debugging 2/23/94
-X */
-#if defined(__STDC__)
-static int aperture_probe(dev_info_t *dip)
-#else
-static int aperture_probe(dip)
-dev_info_t *dip;
-#endif /* __STDC__ */
-{
-X
-#if APERTURE_DEBUG >= 3
-X
-X /* enterance announcement */
-X cmn_err(CE_CONT,"%s: entering aperture_probe()\n", DEV_IDENT_STRING);
-X
-#endif
-X
-X /* return success as we really aren't probing for anything */
-X return (DDI_PROBE_SUCCESS);
-}
-X
-/*
-X * Function: aperture_attach()
-X * Purpose: This function implements the attach(9E) functionality
-X * Author: Doug Anson
-X * Calls:
-X * Modified: David Holland (davidh@use.com)
-X * Log: DMA -- Origional Version
-X * DWH - changed function name/variables/debugging 2/23/94
-X */
-#if defined(__STDC__)
-static int aperture_attach(dev_info_t *dip, ddi_attach_cmd_t cmd)
-#else
-static int aperture_attach(dip,cmd)
-dev_info_t *dip;
-ddi_attach_cmd_t cmd;
-#endif /* __STDC__ */
-{
-X register Mmap *aperture_p = NULL;
-X int buf[AP_MAX];
-X int length;
-X int instance;
-X
-#if APERTURE_DEBUG >= 3
-X
-X /* entrance announcement */
-X cmn_err(CE_CONT,"%s: entering aperture_attach()\n", DEV_IDENT_STRING);
-X
-#endif
-X
-X /* only continue if doing a DDI_ATTACH */
-X if (cmd == DDI_ATTACH)
-X {
-X /* get and initialize our state structure */
-X instance = ddi_get_instance(dip);
-X if (ddi_soft_state_zalloc(state_head, instance) != DDI_SUCCESS)
-X {
-X /* could not allocate state structure */
-X return (DDI_FAILURE);
-X }
-X
-X /* get the state structure */
-X aperture_p = (Mmap *)ddi_get_soft_state(state_head, instance);
-X
-X if (aperture_p == NULL)
-X {
-X /* failed to get the soft state */
-X return (DDI_FAILURE);
-X }
-X
-X /* initialize the mutex driver (ATOMIC) */
-X mutex_init(&aperture_p->map_lock, "apperture mmap lock", MUTEX_DRIVER, 0);
-X
-X /* ENTER the critical region */
-X mutex_enter(&aperture_p->map_lock);
-X
-X /* get the "reg" property from the .conf file */
-X length = sizeof(buf);
-X if (ddi_getlongprop_buf(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS, "reg", (caddr_t)buf, &length) != DDI_PROP_SUCCESS)
-X {
-X /* could not get the framebuffer properties */
-X return (DDI_FAILURE);
-X }
-X
-X /* remember our register configuration */
-X aperture_p->regnum = (u_int)buf[AP_REGNUM];
-X aperture_p->regbase = (caddr_t)buf[AP_ADDR];
-X aperture_p->regsize = (off_t)buf[AP_SIZE];
-X
-X /* initialize the mmap state info */
-X aperture_p->reglength = (off_t)AP_MEM_CHUNK;
-X aperture_p->kaddr = (caddr_t)0;
-X aperture_p->off = (off_t)0;
-X aperture_p->mapaddr = AP_MEM_FAILURE;
-X
-X /* initialize internal accounting */
-X aperture_p->dip = dip;
-X
-X /* EXIT the critical region */
-X mutex_exit(&aperture_p->map_lock);
-X
-X /* create the device node */
-X /* DDI_PSEUDO, CLONE_DEV */
-X if (ddi_create_minor_node(dip, ddi_get_name(dip), S_IFCHR, instance, NULL, (int)NULL) == DDI_FAILURE)
-X {
-X /* failed to make the device leaf or in error state */
-X mutex_destroy(&aperture_p->map_lock);
-X ddi_soft_state_free(state_head, instance);
-X return (DDI_FAILURE);
-X }
-X
-X /* device driver attached successfully */
-X ddi_report_dev(aperture_p->dip);
-X return (DDI_SUCCESS);
-X }
-X else
-X {
-X /* command not DDI_ATTACH -- return failure */
-X return (DDI_FAILURE);
-X }
-}
-X
-/*
-X * Function: aperture_detach()
-X * Purpose: This function implements the detach(9E) functionality
-X * Author: Doug Anson
-X * Calls:
-X * Modified: David Holland (davidh@use.com)
-X * Log: DMA -- Origional Version
-X * DWH - changed function name/variables/debugging 2/23/94
-X */
-#if defined(__STDC__)
-static int aperture_detach(dev_info_t *dip, ddi_detach_cmd_t cmd)
-#else
-static int aperture_detach(dip,cmd)
-dev_info_t *dip;
-ddi_detach_cmd_t cmd;
-#endif /* __STDC__ */
-{
-X register Mmap *aperture_p = NULL;
-X int instance;
-X
-#if APERTURE_DEBUG >= 3
-X
-X /* entrance announcement */
-X cmn_err(CE_CONT,"%s: entering aperture_detach()\n", DEV_IDENT_STRING);
-X
-#endif
-X
-X /* check the parameter list */
-X if (cmd != DDI_DETACH)
-X {
-X return (DDI_FAILURE);
-X }
-X
-X /* get the instance info and state structure */
-X instance = ddi_get_instance(dip);
-X aperture_p = (Mmap *)ddi_get_soft_state(state_head, instance);
-X if (aperture_p == NULL)
-X {
-X /* failed to get the soft state */
-X return (DDI_FAILURE);
-X }
-X
-X /* clean up the driver */
-X mutex_destroy(&aperture_p->map_lock);
-X ddi_remove_minor_node(dip, NULL);
-X ddi_soft_state_free(state_head, instance);
-X
-X /* device driver detached successfully */
-X return (DDI_SUCCESS);
-}
-X
-/*
-X * Function: aperture_open()
-X * Purpose: This function is called in response to the open(2) system call
-X * Author: Doug Anson
-X * Calls:
-X * Modified: David Holland (davidh@use.com)
-X * Log: DMA -- Origional Version
-X * DWH - Changed function name/variables/debugging
-X */
-#if defined(__STDC__)
-static int aperture_open(dev_t *dev, int openflags, int otyp, cred_t *credp)
-#else
-static int aperture_open(dev, openflags, otyp, credp)
-dev_t *dev;
-int openflags;
-int otyp;
-cred_t *credp;
-#endif /* __STDC__ */
-{
-X register Mmap *aperture_p = NULL;
-X
-#if APERTURE_DEBUG >= 3
-X
-X /* entrance announcement */
-X cmn_err(CE_CONT,"%s: entering aperture_open()\n", DEV_IDENT_STRING);
-X
-#endif
-X
-X /* get the state structure */
-X aperture_p = (Mmap *)ddi_get_soft_state(state_head, getminor(*dev));
-X if (aperture_p == NULL)
-X {
-X /* failed to get the soft state */
-X return (ENXIO);
-X }
-X
-X /* check the parameter list for correctness */
-X if (otyp != OTYP_CHR)
-X {
-X /* invalid parameter list */
-X return (EINVAL);
-X }
-X
-X return (0);
-}
-X
-/*
-X * Function: aperture_close()
-X * Purpose: This function is called after the last process that has
-X * the device open calls close(2)
-X * Author: Doug Anson
-X * Calls:
-X * Modified: David Holland (davidh@use.com)
-X * Log: DMA -- Origional Version
-X * DWH - changed function name/variables/debugging 2/23/94
-X */
-#if defined(__STDC__)
-static int aperture_close(dev_t dev, int closeflags, int otyp, cred_t *credp)
-#else
-static int aperture_close(dev, closeflags, otyp, credp)
-dev_t dev;
-int closeflags;
-int otyp;
-cred_t *credp;
-#endif /* __STDC__ */
-{
-X register Mmap *aperture_p = NULL;
-X
-#if APERTURE_DEBUG >= 3
-X
-X /* enterance announcement */
-X cmn_err(CE_CONT,"%s: entering aperture_close()\n", DEV_IDENT_STRING);
-X
-#endif
-X
-X /* get the state structure */
-X aperture_p = (Mmap *)ddi_get_soft_state(state_head, getminor(dev));
-X if (aperture_p == NULL)
-X {
-X /* failed to get the soft state */
-X return (ENXIO);
-X }
-X
-X /* check the paramter list for correctness */
-X if (otyp != OTYP_CHR)
-X {
-X /* invalid parameter */
-X return (EINVAL);
-X }
-X
-X /* do nothing but return successful */
-X return (0);
-}
-X
-/*
-X * Function: aperture_mmap()
-X * Purpose: This function gets called when the user process tries to mmap
-X * the framebuffer device using mmap(2).
-X * Author: Doug Anson
-X * Calls:
-X * Modified: David Holland (davidh@use.com)
-X * Log: DMA -- Origional Version
-X * DWH - changed function name/variables/debugging 2/23/94
-X */
-#if defined(__STDC__)
-static int aperture_mmap(dev_t dev, off_t off, int prot)
-#else
-static int aperture_mmap(dev, off, prot)
-dev_t dev;
-off_t off;
-int prot;
-#endif /* __STDC__ */
-{
-X register Mmap *aperture_p = NULL;
-X
-#if APERTURE_DEBUG >= 3
-X
-X /* enterance announcement */
-X cmn_err(CE_CONT,"%s: entering aperture_mmap()\n", DEV_IDENT_STRING);
-X
-#endif
-X
-X /* get the state structure */
-X aperture_p = (Mmap *)ddi_get_soft_state(state_head, getminor(dev));
-X if (aperture_p == NULL)
-X {
-X /* failed to get the soft state */
-X return (AP_MEM_FAILURE);
-X }
-X
-X /* check that we dont mmap out of bounds */
-X if (off > aperture_p->regsize)
-X {
-X /* offset is out of range for register length */
-X return (AP_MEM_FAILURE);
-X }
-X
-X /* check that READ/WRITE only priv only */
-X if (!((prot & PROT_READ) || (prot & PROT_WRITE)))
-X {
-X /* invalid prot parameter in mmap(2) call */
-X return (AP_MEM_FAILURE);
-X }
-X
-X /* ENTER the critical region */
-X mutex_enter(&aperture_p->map_lock);
-X
-X /* map the registers CRITICAL REGION ASSIGNMENT */
-X
-X aperture_p->off = off;
-X if (ddi_map_regs(aperture_p->dip, aperture_p->regnum, (caddr_t *)&(aperture_p->kaddr),
-X aperture_p->off, aperture_p->reglength) == DDI_FAILURE)
-X {
-X
-#if APERTURE_DEBUG >= 2
-X
-X /* report error */
-X cmn_err(CE_CONT, "%s: ERROR: mmap failed (map regs). kaddr=0x%x off=0x%x\n",
-X DEV_IDENT_STRING,aperture_p->kaddr,aperture_p->off);
-X
-#endif
-X
-X aperture_p->mapaddr = (off_t)AP_MEM_FAILURE;
-X }
-X else
-X {
-X /* fill in our state structure CRITICAL REGION ASSIGNMENT */
-X aperture_p->mapaddr = (off_t)hat_getkpfnum((caddr_t)aperture_p->kaddr);
-X if ((u_int)aperture_p->mapaddr == (u_int)AP_MEM_FAILURE)
-X {
-X
-#if APERTURE_DEBUG >= 2
-X
-X /* report error */
-X cmn_err(CE_CONT, "%s: ERROR: mmap failed (kpf). kaddr=0x%x off=0x%x\n",
-X DEV_IDENT_STRING,aperture_p->kaddr,aperture_p->off);
-#endif
-X
-X }
-X
-X /* now unmap the region CRITICAL REGION ASSIGNMENT */
-X
-X ddi_unmap_regs(aperture_p->dip, aperture_p->regnum, (caddr_t *)&(aperture_p->kaddr),
-X aperture_p->off, aperture_p->reglength);
-X
-#if APERTURE_DEBUG >= 2
-X /* report register mmaping status */
-X if (aperture_p->mapaddr != AP_MEM_FAILURE)
-X {
-X /* mmap successful */
-X cmn_err(CE_CONT,"%s: mmap [off=0x%x,length=0x%x) successful\n",
-X DEV_IDENT_STRING,aperture_p->off,aperture_p->regsize);
-X
-X cmn_err(CE_CONT,"%s: configuration:\n",DEV_IDENT_STRING);
-X cmn_err(CE_CONT," REG(%d): regbase=0x%x regsize=0x%x\n",
-X aperture_p->regnum, aperture_p->regbase, aperture_p->regsize);
-X
-X cmn_err(CE_CONT," kaddr=0x%x mmap off=0x%x mmap addr=0x%x\n",
-X aperture_p->kaddr, aperture_p->off, aperture_p->mapaddr);
-X }
-X else
-X {
-X /* error in mmap routine */
-X cmn_err(CE_CONT,"%s: mmap not established due to errors", DEV_IDENT_STRING);
-X }
-#endif
-X
-X }
-X
-X /* EXIT the critical region */
-X mutex_exit(&aperture_p->map_lock);
-X
-X /* return the page frame number (PFN) */
-X
-#if APERTURE_DEBUG >= 3
-X
-X /* report exit - determining where the long delay is... */
-X cmn_err(CE_CONT, "%s: _mmap routine exiting\n", DEV_IDENT_STRING);
-X
-#endif
-X
-X return ((int)(aperture_p->mapaddr));
-}
-SHAR_EOF
-chmod 0644 aperture/aperture.c ||
-echo 'restore of aperture/aperture.c failed'
-Wc_c="`wc -c < 'aperture/aperture.c'`"
-test 20528 -eq "$Wc_c" ||
- echo 'aperture/aperture.c: original size 20528, current size' "$Wc_c"
-fi
-# ============= aperture/aperture.conf ==============
-if test -f 'aperture/aperture.conf' -a X"$1" != X"-c"; then
- echo 'x - skipping aperture/aperture.conf (File already exists)'
-else
-echo 'x - extracting aperture/aperture.conf (Text)'
-sed 's/^X//' << 'SHAR_EOF' > 'aperture/aperture.conf' &&
-#
-# Copyright 1994 Doug Anson, danson@lgc.com & David Holland, davidh@use.com
-#
-# File: aperture.conf
-# Author: Doug Anson (danson@lgc.com)
-#
-# Modified: David Holland (davidh@use.com)
-# Log: Change comments 2/23/94
-# Log: Change defaults/comments 9/25/94
-#
-# Purpose: This conf file is used by the aperture Framebuffer aperture
-# driver. Do NOT! change the first two numbers of of
-# the 'reg' property. They should be 0, and 0x0,
-# respectivly.
-#
-name="aperture" class="sysbus" reg=0,0x0,0x7fffffff;
-SHAR_EOF
-chmod 0644 aperture/aperture.conf ||
-echo 'restore of aperture/aperture.conf failed'
-Wc_c="`wc -c < 'aperture/aperture.conf'`"
-test 518 -eq "$Wc_c" ||
- echo 'aperture/aperture.conf: original size 518, current size' "$Wc_c"
-fi
-# ============= aperture/aptest.c ==============
-if test -f 'aperture/aptest.c' -a X"$1" != X"-c"; then
- echo 'x - skipping aperture/aptest.c (File already exists)'
-else
-echo 'x - extracting aperture/aptest.c (Text)'
-sed 's/^X//' << 'SHAR_EOF' > 'aperture/aptest.c' &&
-/*
-X * Copyright 1994 Doug Anson, danson@lgc.com & David Holland, davidh@use.com
-X *
-X * Author: Doug Anson (danson@lgc.com)
-X * Date : 2/21/94
-X * Modifed: David Holland (davidh@use.com)
-X * Log:
-X * DWH - Changed names/added comments 2/23/94
-X * DWH - Removed annoying delays. 2/23/94
-X *
-X * This program test the fb aperture driver by 'cheating'
-X * it uses the aperture driver to access/read the main
-X * system BIOS header
-X *
-X * Copyright notice:
-X * Permission to use, copy, modify, distribute, and sell this software and its
-X * documentation for any purpose is hereby granted without fee, provided that
-X * the above copyright notice appear in all copies and that both that
-X * copyright notice and this permission notice appear in supporting
-X * documentation, and that the name of Doug Anson, and David Holland be used in
-X * advertising or publicity pertaining to distribution of the software
-X * Doug Anson, and David Holland make no * representations about the
-X * suitability of this software for any purpose.
-X * It is provided "as is" without express or implied warranty.
-X *
-X * Disclaimer:
-X * DOUG ANSON, AND DAVID HOLLAND DISCLAIMS ALL WARRIENTS WITH REGARD TO THIS
-X * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS,
-X * IN NO EVENT SHALL DOUG ANSON, OR DAVID HOLLAND BE LIABLE FOR ANY SPECIAL,
-X * INDIRECT, OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM
-X * USAGE OF THIS SOFTWARE.
-X */
-X
-/*
-X * linear framebuffer aperture driver test program
-X */
-X
-/*
-X * $Id
-X */
-X
-X
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-X
-#if !defined(sun)
-extern void exit(int);
-extern caddr_t mmap();
-extern int close();
-extern int munmap();
-#endif
-X
-/* framebuffer access defines */
-#define AP_DEV "/dev/fbs/aperture" /* framebuffer apperture device */
-#define PADDR 0xf0000 /* offset from fbmem base */
-#define BUF_LENGTH 0x1000 /* length in bytes -- ignored */
-X
-/* debug testing defines */
-#define START_INDEX 0 /* display starting index(>=0)*/
-#define STOP_INDEX 80 /* display stopping index */
-#define INCR 1 /* display increment */
-X
-/* main program */
-int main(int argc,char **argv)
-{
-X caddr_t addr = (caddr_t)0;
-X int fb_dev;
-X long start = START_INDEX;
-X long stop = STOP_INDEX;
-X int i;
-X
-X /* open the framebuffer device */
-X fb_dev = open (AP_DEV,O_RDWR);
-X if (fb_dev < 0)
-X {
-X /* failed to open framebuffer driver */
-X printf("ERROR: failed to open %s\n",AP_DEV);
-X perror("ERROR: open()");
-X exit(1);
-X }
-X
-X /* memory map the framebuffer */
-X addr = (caddr_t)mmap((caddr_t)0,BUF_LENGTH,PROT_READ|PROT_WRITE,MAP_SHARED,
-X fb_dev,(off_t)PADDR);
-X if (addr == (caddr_t)-1)
-X {
-X /* failed to memory map framebuffer driver */
-X printf("ERROR: failed to mmap [0x%x ,size=%d bytes)\n",
-X PADDR,BUF_LENGTH);
-X perror("ERROR: mmap()");
-X close(fb_dev);
-X exit(1);
-X }
-X else
-X {
-X /* frame buffer mapped */
-X close(fb_dev);
-X printf("NOTICE: BIOS mapped [0x%x ,size=%d) to addr=0x%x...\n",
-X PADDR,BUF_LENGTH,(int)addr);
-X
-X /* display the buffer */
-X for(i=start;i<stop;i=i+INCR)
-X printf("%c",addr[i]);
-X /* printf("addr[%d]=%c\n",i,addr[i]);
-X */
-X printf("\nDONE displaying memory contents (%d bytes)\n",stop);
-X
-X /* unmap and close */
-X printf("UNMAPPING [0x%x ,size=%d) to addr=0x%x... and closing...",
-X PADDR,BUF_LENGTH,(int)addr);
-X munmap(addr,BUF_LENGTH);
-X printf("DONE.\n");
-X printf("Exiting successful...\n");
-X exit(0);
-X }
-X return 1;
-}
-SHAR_EOF
-chmod 0644 aperture/aptest.c ||
-echo 'restore of aperture/aptest.c failed'
-Wc_c="`wc -c < 'aperture/aptest.c'`"
-test 3530 -eq "$Wc_c" ||
- echo 'aperture/aptest.c: original size 3530, current size' "$Wc_c"
-fi
-# ============= aperture/DISCLAIMER ==============
-if test -f 'aperture/DISCLAIMER' -a X"$1" != X"-c"; then
- echo 'x - skipping aperture/DISCLAIMER (File already exists)'
-else
-echo 'x - extracting aperture/DISCLAIMER (Text)'
-sed 's/^X//' << 'SHAR_EOF' > 'aperture/DISCLAIMER' &&
-/*
-X * Copyright 1994 Doug Anson (danson@lgc.com) & David Holland (davidh@use.com)
-X *
-X * This code is based largely upon the sample device drivers provided
-X * by Sun Microsystems Inc.
-X *
-X * Original copyright notice:
-X * @(#)mmap.c 1.3 copyright 93/06/03 Sun Microsystems, Inc.
-X *
-X * Our copyright notice:
-X * Permission to use, copy, modify, distribute, and sell this software and its
-X * documentation for any purpose is hereby granted without fee, provided that
-X * the above copyright notice appear in all copies and that both that
-X * copyright notice and this permission notice appear in supporting
-X * documentation, and that the name of Doug Anson, and David Holland be used in
-X * advertising or publicity pertaining to distribution of the software
-X * Doug Anson, and David Holland make no * representations about the
-X * suitability of this software for any purpose.
-X * It is provided "as is" without express or implied warranty.
-X *
-X * Original disclamer from Sun Microsystems, Inc.:
-X * This is a package of sample device drivers for Solaris 2.x (SunOS
-X * 5.x). You may use, modify and distribute these drivers and/or binaries
-X * derived from them. However please note that:
-X *
-X * These examples are provided with no warranties of any kind, including
-X * without limitation accuracy and usefulness, and Sun expressly disclaims
-X * all implied warranties of merchantability, fitness for a particular
-X * purpose and non-infringement. In no event shall Sun be liable for any
-X * damages, including without limitation, direct, special, indirect, or
-X * consequential damages arising out of, or relating to, use of these
-X * examples by customer or any third party. Sun is under no obligation to
-X * provide support to customer for this software.
-X *
-X * Our disclaimer:
-X * DOUG ANSON, AND DAVID HOLLAND DISCLAIMS ALL WARRIENTS WITH REGARD TO THIS
-X * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS,
-X * IN NO EVENT SHALL DOUG ANSON, OR DAVID HOLLAND BE LIABLE FOR ANY SPECIAL,
-X * INDIRECT, OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM
-X * USAGE OF THIS SOFTWARE.
-X */
-X
-/*
-X * linear framebuffer aperture driver
-X *
-X * $Id
-X */
-SHAR_EOF
-chmod 0644 aperture/DISCLAIMER ||
-echo 'restore of aperture/DISCLAIMER failed'
-Wc_c="`wc -c < 'aperture/DISCLAIMER'`"
-test 2174 -eq "$Wc_c" ||
- echo 'aperture/DISCLAIMER: original size 2174, current size' "$Wc_c"
-fi
-exit 0
diff --git a/xc/programs/Xserver/hw/xfree86/loader/README b/xc/programs/Xserver/hw/xfree86/loader/README
deleted file mode 100644
index 4fb375fcb..000000000
--- a/xc/programs/Xserver/hw/xfree86/loader/README
+++ /dev/null
@@ -1,107 +0,0 @@
-
-This README file describes the design and idea behind the loadable module
-code for XFree86. This code is based of code that was developed by Metro Link
-and donated to The XFree86 Project.
-
-<at this point we should include the design document as written by Stuart>
-
-Debugging this code is somewhat dificult as gdb will not be able to step
-through loaded modules in source mode. The functions
-
-LoaderPrintSymbol( address )
-LoaderPrintAddress( symbol )
-
-are provided to allow easy orientation in the loaded module. Most problems
-stem from global functions and variables that are not exported from other
-modules or the main server executable, but are referenced in a module.
-All global variables should be put in ScreenPrivates or other container
-objects, that are driver specific. This will solve the biggest problem
-cleanly and at the same time provide an important step towards multi headed
-servers.
-
-More documentation on the design and implementation should be added here.
-
-Specific comments to some design ideas and the state of the code
-
-- Init Function
-
-every module has its init function, which has the name ModuleInit.
-When loading the module this function is repeatedly called with two pointers
-(one to a magic value, one to a data element) until it returns a magic value
-indicating that it is done. Currently the magic values support several
-actions:
-
-magic data points to
-
-MAGIC_ADD_VIDEO_CHIP_REC the videoChipRec to be added to the list
- of drivers
-
-MAGIC_LOAD the name of the module to load
-
-MAGIC_CCD_DO_BITBLT the do_bitblt function for the current
- color depth
-
-MAGIC_CCD_SCREEN_PRIV_IDX the ScreenPrivIdx for the current color depth
-
-MAGIC_CCD_XAA_SCREEN_INIT the XaaScreenInit function for the current
- color depth
-
-MAGIC_PEX_INIT
-MAGIC_XIE_INIT init functions of extensions
-
-MAGIC_DONT_CHECK_UNRESOLVED checking for unresolved symbols will be delayed
- for one step until LoaderCheckUnresolved()
- is called with LD_RESOLV_NOW the same number of
- times than MAGIC_DONT_CHECK_UNRESOLVED
- has been passed before.
-
-MAGIC_DONE nothing; side effect is to stop looping
-
-- mixed color depths
-
-the current code has various cross dependencies on cfb8, libvga256, and all
-higher depths cfbs as well as all the xaa modules. These need to be
-straightened out (this has been started but is far from done).
-We basically need a redesigned server to solve these issues cleanly.
-
-- unresolved functions
-
-the current code has one 'minor' flaw. When checking unresolved symbols
-we reference quite a few things from the cfb libraries that we did not
-pull in. Since these functions are never called, this doesn't really
-matter, but it is uggly, obviously.
-
-Changing all this to use function pointers and initializing all of
-them sounds like the clean solution, but I'm wondering if it wasn't
-better to define a default function that is bound to all unresolved
-symbols and prints out that there was a problem with resolving symbols
-and makes the server exit gracefully. This would be a reasonable
-default behaviour and would allow to keep dangling references to
-functions that are known not to be called.
-
-This "elegant hack" has been implemented for the Elf loader, but better
-solutions are welcome.
-
-- OS support
-
-Currently this has been tested on Linux, it should work on SVR4. This
-code needs to be ported to the other operating systems XFree86 supports.
-
-- finding modules
-
-ModulePath can contain several entries of directories that contain modules.
-Modules can be implicitly or explicitly loaded. To load a module explicitly
-you have to include it in the Module Section. Load "name" tries to find
-name, name.o, name_drv.o, or name.a in any of the directories given in the
-ModulePath or in the subdirectories drivers, extensions, internal under these
-directories. Normally the chipset drivers should be implemented in a way that
-they implicitly load all other core modules needed by this driver.
-
-----------------------------------------------------------------------
-
-Last updated Feb 25, 1997, Dirk H. Hohndel <hohndel@XFree86.Org>
-
-
-
-
-$XFree86: xc/programs/Xserver/hw/xfree86/loader/README,v 1.4 1997/04/08 14:54:33 hohndel Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c b/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c
index 959099282..b28020b51 100644
--- a/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c
+++ b/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c
@@ -830,6 +830,7 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(xf86strlen)
SYMFUNC(xf86strncmp)
SYMFUNC(xf86strncasecmp)
+ SYMFUNC(xf86strncat)
SYMFUNC(xf86strncpy)
SYMFUNC(xf86strpbrk)
SYMFUNC(xf86strchr)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_video.c b/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_video.c
deleted file mode 100644
index b9791a442..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_video.c
+++ /dev/null
@@ -1,1742 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_video.c,v 3.45 2001/10/28 03:34:00 tsi Exp $ */
-/*
- * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Rich Murphey and David Wexelblat
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Rich Murphey and
- * David Wexelblat make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-/*
- * The ARM32 code here carries the following copyright:
- *
- * Copyright 1997
- * Digital Equipment Corporation. All rights reserved.
- * This software is furnished under license and may be used and copied only in
- * accordance with the following terms and conditions. Subject to these
- * conditions, you may download, copy, install, use, modify and distribute
- * this software in source and/or binary form. No title or ownership is
- * transferred hereby.
- *
- * 1) Any source code used, modified or distributed must reproduce and retain
- * this copyright notice and list of conditions as they appear in the
- * source file.
- *
- * 2) No right is granted to use any trade name, trademark, or logo of Digital
- * Equipment Corporation. Neither the "Digital Equipment Corporation"
- * name nor any trademark or logo of Digital Equipment Corporation may be
- * used to endorse or promote products derived from this software without
- * the prior written permission of Digital Equipment Corporation.
- *
- * 3) This software is provided "AS-IS" and any express or implied warranties,
- * including but not limited to, any implied warranties of merchantability,
- * fitness for a particular purpose, or non-infringement are disclaimed.
- * In no event shall DIGITAL be liable for any damages whatsoever, and in
- * particular, DIGITAL shall not be liable for special, indirect,
- * consequential, or incidental damages or damages for lost profits, loss
- * of revenue or loss of use, whether such damages arise in contract,
- * negligence, tort, under statute, in equity, at law or otherwise, even
- * if advised of the possibility of such damage.
- *
- */
-
-/* $XConsortium: bsd_video.c /main/10 1996/10/25 11:37:57 kaleb $ */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
-
-#ifdef HAS_MTRR_SUPPORT
-#ifndef __NetBSD__
-#include <sys/memrange.h>
-#else
-#include "memrange.h"
-#endif
-#define X_MTRR_ID "XFree86"
-#endif
-
-#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
-#include <machine/mtrr.h>
-#include <machine/sysarch.h>
-#include <sys/queue.h>
-#endif
-
-
-#ifdef __alpha__
-#include <sys/sysctl.h>
-#include "xf86Axp.h"
-#endif
-
-#ifdef __arm32__
-#include "machine/devmap.h"
-struct memAccess
-{
- int ioctl;
- struct map_info memInfo;
- pointer regionVirtBase;
- Bool Checked;
- Bool OK;
-};
-
-static pointer xf86MapInfoMap();
-static void xf86MapInfoUnmap();
-static struct memAccess *checkMapInfo();
-extern int vgaPhysLinearBase;
-
-/* A memAccess structure is needed for each possible region */
-struct memAccess vgaMemInfo = { CONSOLE_GET_MEM_INFO, NULL, NULL,
- FALSE, FALSE };
-struct memAccess linearMemInfo = { CONSOLE_GET_LINEAR_INFO, NULL, NULL,
- FALSE, FALSE };
-struct memAccess ioMemInfo = { CONSOLE_GET_IO_INFO, NULL, NULL,
- FALSE, FALSE };
-#endif /* __arm32__ */
-
-#if defined(__NetBSD__) && !defined(MAP_FILE)
-#define MAP_FLAGS MAP_SHARED
-#else
-#define MAP_FLAGS (MAP_FILE | MAP_SHARED)
-#endif
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((caddr_t)-1)
-#endif
-
-#ifdef __OpenBSD__
-#define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n"\
- "\tin /etc/sysctl.conf and reboot your machine\n" \
- "\trefer to xf86(4) for details\n"
-#define SYSCTL_MSG2 \
- "Check that you have set 'machdep.allowaperture=2'\n" \
- "\tin /etc/sysctl.conf and reboot your machine\n" \
- "\trefer to xf86(4) for details\n"
-#endif
-
-#ifdef __alpha__
-
-extern unsigned long dense_base(void);
-
-static int axpSystem = -1;
-static unsigned long hae_thresh;
-static unsigned long hae_mask;
-static unsigned long bus_base;
-static unsigned long sparse_size;
-
-static unsigned long
-memory_base(void)
-{
- static unsigned long base = 0;
-
- if (base == 0) {
- size_t len = sizeof(base);
- int error;
- if ((error = sysctlbyname("hw.chipset.memory", &base, &len,
- 0, 0)) < 0)
- FatalError("xf86MapVidMem: can't find memory\n");
- }
-
- return base;
-}
-
-static int
-has_bwx(void)
-{
- static int bwx = 0;
- size_t len = sizeof(bwx);
- int error;
- if ((error = sysctlbyname("hw.chipset.bwx", &bwx, &len, 0, 0)) < 0)
- return FALSE;
- else
- return bwx;
-}
-
-#define BUS_BASE dense_base()
-#define BUS_BASE_BWX memory_base()
-
-#else
-
-#define BUS_BASE 0L
-#define BUS_BASE_BWX 0L
-
-#endif
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-static Bool useDevMem = FALSE;
-static int devMemFd = -1;
-
-#ifdef HAS_APERTURE_DRV
-#define DEV_APERTURE "/dev/xf86"
-#endif
-#define DEV_MEM "/dev/mem"
-
-static pointer mapVidMem(int, unsigned long, unsigned long, int);
-static void unmapVidMem(int, pointer, unsigned long);
-#ifdef __alpha__
-static pointer mapVidMemSparse(int, unsigned long, unsigned long, int);
-static void unmapVidMemSparse(int, pointer, unsigned long);
-#endif
-#ifdef __powerpc__
-static pointer ppcMapVidMem(int, unsigned long, unsigned long);
-static void ppcUnmapVidMem(int, pointer, unsigned long);
-#endif
-#ifdef HAS_MTRR_SUPPORT
-static pointer setWC(int, unsigned long, unsigned long, Bool, MessageType);
-static void undoWC(int, pointer);
-static Bool cleanMTRR(void);
-#endif
-#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
-static pointer NetBSDsetWC(int, unsigned long, unsigned long, Bool,
- MessageType);
-static void NetBSDundoWC(int, pointer);
-#endif
-
-
-#if !defined(__powerpc__)
-/*
- * Check if /dev/mem can be mmap'd. If it can't print a warning when
- * "warn" is TRUE.
- */
-static void
-checkDevMem(Bool warn)
-{
- static Bool devMemChecked = FALSE;
- int fd;
- pointer base;
-
- if (devMemChecked)
- return;
- devMemChecked = TRUE;
-
- if ((fd = open(DEV_MEM, O_RDWR)) >= 0)
- {
- /* Try to map a page at the VGA address */
- base = mmap((caddr_t)0, 4096, PROT_READ|PROT_WRITE,
- MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE);
-
- if (base != MAP_FAILED)
- {
- munmap((caddr_t)base, 4096);
- devMemFd = fd;
- useDevMem = TRUE;
- return;
- } else {
- /* This should not happen */
- if (warn)
- {
- xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
- DEV_MEM, strerror(errno));
- }
- useDevMem = FALSE;
- return;
- }
- }
-#ifndef HAS_APERTURE_DRV
- if (warn)
- {
- xf86Msg(X_WARNING, "checkDevMem: failed to open %s (%s)\n",
- DEV_MEM, strerror(errno));
- xf86ErrorF("\tlinear framebuffer access unavailable\n");
- }
- useDevMem = FALSE;
- return;
-#else
- /* Failed to open /dev/mem, try the aperture driver */
- if ((fd = open(DEV_APERTURE, O_RDWR)) >= 0)
- {
- /* Try to map a page at the VGA address */
- base = mmap((caddr_t)0, 4096, PROT_READ|PROT_WRITE,
- MAP_FLAGS, fd, (off_t)0xA0000);
-
- if (base != MAP_FAILED)
- {
- munmap((caddr_t)base, 4096);
- devMemFd = fd;
- useDevMem = TRUE;
- xf86Msg(X_INFO, "checkDevMem: using aperture driver %s\n",
- DEV_APERTURE);
- return;
- } else {
-
- if (warn)
- {
- xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
- DEV_APERTURE, strerror(errno));
- }
- }
- } else {
- if (warn)
- {
-#ifndef __OpenBSD__
- xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
- "\t(%s)\n", DEV_MEM, DEV_APERTURE, strerror(errno));
-#else /* __OpenBSD__ */
- xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
- "\t(%s)\n%s", DEV_MEM, DEV_APERTURE, strerror(errno),
- SYSCTL_MSG);
-#endif /* __OpenBSD__ */
- }
- }
-
- if (warn)
- {
- xf86ErrorF("\tlinear framebuffer access unavailable\n");
- }
- useDevMem = FALSE;
- return;
-
-#endif
-}
-#endif /* !__powerpc__ */
-
-void
-xf86OSInitVidMem(VidMemInfoPtr pVidMem)
-{
-#if defined(__powerpc__)
- pVidMem->linearSupported = TRUE;
-#else
- checkDevMem(TRUE);
- pVidMem->linearSupported = useDevMem;
-#endif
-#if defined(__alpha__)
- if (has_bwx()) {
- xf86Msg(X_INFO,"Machine type has 8/16 bit access\n");
- pVidMem->mapMem = mapVidMem;
- pVidMem->unmapMem = unmapVidMem;
- } else {
- xf86Msg(X_INFO,"Machine needs sparse mapping\n");
- pVidMem->mapMem = mapVidMemSparse;
- pVidMem->unmapMem = unmapVidMemSparse;
- if (axpSystem == -1)
- axpSystem = bsdGetAXP();
- hae_thresh = xf86AXPParams[axpSystem].hae_thresh;
- hae_mask = xf86AXPParams[axpSystem].hae_mask;
- sparse_size = xf86AXPParams[axpSystem].size;
- }
-#elif defined(__arm32__)
- pVidMem->mapMem = armMapVidMem;
- pVidMem->unmapVidMem = armUnmapVidMem;
-#elif defined(__powerpc__)
- pVidMem->mapMem = ppcMapVidMem;
- pVidMem->unmapMem = ppcUnmapVidMem;
-#else
- pVidMem->mapMem = mapVidMem;
- pVidMem->unmapMem = unmapVidMem;
-#endif
-
-#ifdef HAS_MTRR_SUPPORT
- if (useDevMem) {
- if (cleanMTRR()) {
- pVidMem->setWC = setWC;
- pVidMem->undoWC = undoWC;
- }
- }
-#endif
-#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
- pVidMem->setWC = NetBSDsetWC;
- pVidMem->undoWC = NetBSDundoWC;
-#endif
- pVidMem->initialised = TRUE;
-}
-
-#if !defined(__powerpc__)
-static pointer
-mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- pointer base;
-
- checkDevMem(FALSE);
-
-#ifdef __alpha__
- Base = Base & ((1L<<32) - 1);
-#endif
-
- if (useDevMem)
- {
- if (devMemFd < 0)
- {
- FatalError("xf86MapVidMem: failed to open %s (%s)\n",
- DEV_MEM, strerror(errno));
- }
- base = mmap((caddr_t)0, Size, PROT_READ|PROT_WRITE,
- MAP_FLAGS, devMemFd, (off_t)Base + BUS_BASE_BWX);
- if (base == MAP_FAILED)
- {
- FatalError("%s: could not mmap %s [s=%x,a=%x] (%s)\n",
- "xf86MapVidMem", DEV_MEM, Size, Base,
- strerror(errno));
- }
- return(base);
- }
-
- /* else, mmap /dev/vga */
- if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
- {
- FatalError("%s: Address 0x%x outside allowable range\n",
- "xf86MapVidMem", Base);
- }
- base = mmap(0, Size, PROT_READ|PROT_WRITE, MAP_FLAGS,
- xf86Info.screenFd,
-#if defined(__alpha__)
- (unsigned long)Base + BUS_BASE
-#elif defined(__mips__)
- (unsigned long)Base
-#else
- (unsigned long)Base - 0xA0000
-#endif
- );
- if (base == MAP_FAILED)
- {
- FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n",
- strerror(errno));
- }
- return(base);
-}
-
-static void
-unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- munmap((caddr_t)Base, Size);
-}
-
-/*
- * Read BIOS via mmap()ing DEV_MEM
- */
-
-int
-xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
- int Len)
-{
- unsigned char *ptr;
- int psize;
- int mlen;
-
- checkDevMem(TRUE);
- if (devMemFd == -1) {
- return(-1);
- }
-
- psize = xf86getpagesize();
- Offset += Base & (psize - 1);
- Base &= ~(psize - 1);
- mlen = (Offset + Len + psize - 1) & ~(psize - 1);
- ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ,
- MAP_SHARED, devMemFd, (off_t)Base+BUS_BASE);
- if ((long)ptr == -1)
- {
- xf86Msg(X_WARNING,
- "xf86ReadBIOS: %s mmap[s=%x,a=%x,o=%x] failed (%s)\n",
- DEV_MEM, Len, Base, Offset, strerror(errno));
-#ifdef __OpenBSD__
- if (Base < 0xa0000) {
- xf86Msg(X_WARNING, SYSCTL_MSG2);
- }
-#endif
- return(-1);
- }
-#ifdef DEBUG
- ErrorF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
- Base, ptr[0] | (ptr[1] << 8));
-#endif
- (void)memcpy(Buf, (void *)(ptr + Offset), Len);
- (void)munmap((caddr_t)ptr, mlen);
-#ifdef DEBUG
- xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS(%x, %x, Buf, %x)"
- "-> %02x %02x %02x %02x...\n",
- Base, Offset, Len, Buf[0], Buf[1], Buf[2], Buf[3]);
-#endif
- return(Len);
-}
-
-#endif /* !__powerpc__ */
-
-#ifdef __arm32__
-
-/* XXX This needs to be updated for the ND */
-
-/*
-** Find out whether the console driver provides memory mapping information
-** for the specified region and return the map_info pointer. Print a warning if required.
-*/
-static struct memAccess *
-checkMapInfo(Bool warn, int Region)
-{
- struct memAccess *memAccP;
-
- switch (Region)
- {
- case VGA_REGION:
- memAccP = &vgaMemInfo;
- break;
-
- case LINEAR_REGION:
- memAccP = &linearMemInfo;
- break;
-
- case MMIO_REGION:
- memAccP = &ioMemInfo;
- break;
-
- default:
- return NULL;
- break;
- }
-
- if(!memAccP->Checked)
- {
- if(ioctl(xf86Info.screenFd, memAccP->ioctl, &(memAccP->memInfo)) == -1)
- {
- if(warn)
- {
- xf86Msg(X_WARNING,
- "checkMapInfo: failed to get map info for region %d\n\t(%s)\n",
- Region, strerror(errno));
- }
- }
- else
- {
- if(memAccP->memInfo.u.map_info_mmap.map_offset
- != MAP_INFO_UNKNOWN)
- memAccP->OK = TRUE;
- }
- memAccP->Checked = TRUE;
- }
- if (memAccP->OK)
- {
- return memAccP;
- }
- else
- {
- return NULL;
- }
-}
-
-static pointer
-xf86MapInfoMap(struct memAccess *memInfoP, pointer Base, unsigned long Size)
-{
- struct map_info *mapInfoP = &(memInfoP->memInfo);
-
- if (mapInfoP->u.map_info_mmap.map_size == MAP_INFO_UNKNOWN)
- {
- Size = (unsigned long)Base + Size;
- }
- else
- {
- Size = mapInfoP->u.map_info_mmap.map_size;
- }
-
- switch(mapInfoP->method)
- {
- case MAP_MMAP:
- /* Need to remap if size is unknown because we may not have
- mapped the whole region initially */
- if(memInfoP->regionVirtBase == NULL ||
- mapInfoP->u.map_info_mmap.map_size == MAP_INFO_UNKNOWN)
- {
- if((memInfoP->regionVirtBase =
- mmap((caddr_t)0,
- Size,
- PROT_READ|PROT_WRITE,
- MAP_SHARED,
- xf86Info.screenFd,
- (unsigned long)mapInfoP->u.map_info_mmap.map_offset))
- == (pointer)-1)
- {
- FatalError("xf86MapInfoMap: Failed to map memory at 0x%x\n\t%s\n",
- mapInfoP->u.map_info_mmap.map_offset, strerror(errno));
- }
- if(mapInfoP->u.map_info_mmap.internal_offset > 0)
- memInfoP->regionVirtBase +=
- mapInfoP->u.map_info_mmap.internal_offset;
- }
- break;
-
- default:
- FatalError("xf86MapInfoMap: Unsuported mapping method\n");
- break;
- }
-
- return (pointer)((int)memInfoP->regionVirtBase + (int)Base);
-}
-
-static void
-xf86MapInfoUnmap(struct memAccess *memInfoP, unsigned long Size)
-{
- struct map_info *mapInfoP = &(memInfoP->memInfo);
-
- switch(mapInfoP->method)
- {
- case MAP_MMAP:
- if(memInfoP->regionVirtBase != NULL)
- {
- if(mapInfoP->u.map_info_mmap.map_size != MAP_INFO_UNKNOWN)
- Size = mapInfoP->u.map_info_mmap.map_size;
- munmap((caddr_t)memInfoP->regionVirtBase, Size);
- memInfoP->regionVirtBase = NULL;
- }
- break;
- default:
- FatalError("xf86MapInfoMap: Unsuported mapping method\n");
- break;
- }
-}
-
-static pointer
-armMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- struct memAccess *memInfoP;
-
- if((memInfoP = checkMapInfo(FALSE, Region)) != NULL)
- {
- /*
- ** xf86 passes in a physical address offset from the start
- ** of physical memory, but xf86MapInfoMap expects an
- ** offset from the start of the specified region - it gets
- ** the physical address of the region from the display driver.
- */
- switch(Region)
- {
- case LINEAR_REGION:
- if (vgaPhysLinearBase)
- {
- Base -= vgaPhysLinearBase;
- }
- break;
- case VGA_REGION:
- Base -= 0xA0000;
- break;
- }
-
- base = xf86MapInfoMap(memInfoP, Base, Size);
- return (base);
- }
- return mapVidMem(ScreenNum, Base, Size, flags);
-}
-
-static void
-armUnmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- struct memAccess *memInfoP;
-
- if((memInfoP = checkMapInfo(FALSE, Region)) != NULL)
- {
- xf86MapInfoUnmap(memInfoP, Base, Size);
- }
- unmapVidMem(ScreenNum, Base, Size);
-}
-#endif /* __arm32__ */
-
-#if defined(__powerpc__)
-
-volatile unsigned char *ioBase = MAP_FAILED;
-
-static pointer
-ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size)
-{
- int fd = xf86Info.screenFd;
- pointer base;
-
- fprintf(stderr, "mapVidMem %lx, %lx, fd = %d\n", Base, Size, fd);
-
- base = mmap(0, Size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, Base);
- if (base == MAP_FAILED)
- FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)\n",
- "xf86MapVidMem", Size, Base, strerror(errno));
-
- return base;
-}
-
-static void
-ppcUnmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- munmap(Base, Size);
-}
-
-int
-xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
- int Len)
-{
- int rv;
- int kmem;
-
- kmem = open("/dev/kmem", 2);
- if (kmem == -1) {
- FatalError("xf86ReadBIOS: open /dev/kmem\n");
- }
-
-#ifdef DEBUG
- fprintf(stderr, "xf86ReadBIOS() %lx %lx, %x\n", Base, Offset, Len);
-#endif
-
- if (Base < 0x80000000) {
- fprintf(stderr, "No VGA\n");
- return 0;
- }
-
-
- lseek(kmem, Base + Offset, 0);
- rv = read(kmem, Buf, Len);
- close(kmem);
-
- return rv;
-}
-
-
-#endif /* __powerpc__ */
-
-#ifdef USE_I386_IOPL
-/***************************************************************************/
-/* I/O Permissions section */
-/***************************************************************************/
-
-static Bool ExtendedEnabled = FALSE;
-
-void
-xf86EnableIO()
-{
- if (ExtendedEnabled)
- return;
-
- if (i386_iopl(TRUE) < 0)
- {
-#ifndef __OpenBSD__
- FatalError("%s: Failed to set IOPL for extended I/O\n",
- "xf86EnableIO");
-#else
- FatalError("%s: Failed to set IOPL for extended I/O\n%s",
- "xf86EnableIO", SYSCTL_MSG);
-#endif
- }
- ExtendedEnabled = TRUE;
-
- return;
-}
-
-void
-xf86DisableIO()
-{
- if (!ExtendedEnabled)
- return;
-
- i386_iopl(FALSE);
- ExtendedEnabled = FALSE;
-
- return;
-}
-
-#endif /* USE_I386_IOPL */
-
-#ifdef USE_DEV_IO
-static int IoFd = -1;
-
-void
-xf86EnableIO()
-{
- if (IoFd >= 0)
- return;
-
- if ((IoFd = open("/dev/io", O_RDWR)) == -1)
- {
- FatalError("xf86EnableIO: "
- "Failed to open /dev/io for extended I/O\n");
- }
- return;
-}
-
-void
-xf86DisableIO()
-{
- if (IoFd < 0)
- return;
-
- close(IoFd);
- IoFd = -1;
- return;
-}
-
-#endif
-
-#if defined(USE_ARC_MMAP) || defined(__arm32__)
-
-void
-xf86EnableIO()
-{
- int fd;
- pointer base;
-
- if (ExtendedEnabled)
- return;
-
- if ((fd = open("/dev/ttyC0", O_RDWR)) >= 0) {
- /* Try to map a page at the pccons I/O space */
- base = (pointer)mmap((caddr_t)0, 65536, PROT_READ|PROT_WRITE,
- MAP_FLAGS, fd, (off_t)0x0000);
-
- if (base != (pointer)-1) {
- IOPortBase = base;
- }
- else {
- FatalError("EnableIO: failed to mmap %s (%s)\n",
- "/dev/ttyC0", strerror(errno));
- }
- }
- else {
- FatalError("EnableIO: failed to open %s (%s)\n",
- "/dev/ttyC0", strerror(errno));
- }
-
- ExtendedEnabled = TRUE;
-
- return;
-}
-
-void
-xf86DisableIO()
-{
- return;
-}
-
-#endif /* USE_ARC_MMAP */
-
-#if defined(__FreeBSD__) && defined(__alpha__)
-
-extern int ioperm(unsigned long from, unsigned long num, int on);
-
-void
-xf86EnableIO()
-{
- ioperm(0, 65536, TRUE);
- return;
-}
-
-void
-xf86DisableIO()
-{
- return;
-}
-
-#endif /* __FreeBSD__ && __alpha__ */
-
-/***************************************************************************/
-/* Interrupt Handling section */
-/***************************************************************************/
-
-Bool
-xf86DisableInterrupts()
-{
-
-#if !defined(__mips__) && !defined(__arm32__) && !defined(__alpha__) && \
- !defined(__powerpc__)
-#ifdef __GNUC__
- __asm__ __volatile__("cli");
-#else
- asm("cli");
-#endif /* __GNUC__ */
-#endif /* __mips__ */
-
- return(TRUE);
-}
-
-void
-xf86EnableInterrupts()
-{
-
-#if !defined(__mips__) && !defined(__arm32__) && !defined(__alpha__) && \
- !defined(__powerpc__)
-#ifdef __GNUC__
- __asm__ __volatile__("sti");
-#else
- asm("sti");
-#endif /* __GNUC__ */
-#endif /* __mips__ */
-
- return;
-}
-
-
-#ifdef __NetBSD__
-/***************************************************************************/
-/* Set TV output mode */
-/***************************************************************************/
-void
-xf86SetTVOut(int mode)
-{
- switch (xf86Info.consType)
- {
-#ifdef PCCONS_SUPPORT
- case PCCONS:{
-
- if (ioctl (xf86Info.consoleFd, CONSOLE_X_TV_ON, &mode) < 0)
- {
- xf86Msg(X_WARNING,
- "xf86SetTVOut: Could not set console to TV output, %s\n",
- strerror(errno));
- }
- }
- break;
-#endif /* PCCONS_SUPPORT */
-
- default:
- FatalError("Xf86SetTVOut: Unsupported console\n");
- break;
- }
- return;
-}
-
-void
-xf86SetRGBOut()
-{
- switch (xf86Info.consType)
- {
-#ifdef PCCONS_SUPPORT
- case PCCONS:{
-
- if (ioctl (xf86Info.consoleFd, CONSOLE_X_TV_OFF, 0) < 0)
- {
- xf86Msg(X_WARNING,
- "xf86SetTVOut: Could not set console to RGB output, %s\n",
- strerror(errno));
- }
- }
- break;
-#endif /* PCCONS_SUPPORT */
-
- default:
- FatalError("Xf86SetTVOut: Unsupported console\n");
- break;
- }
- return;
-}
-#endif
-
-
-#if 0
-/*
- * XXX This is here for reference. It needs to be handled differently for the
- * ND.
- */
-#if defined(USE_ARC_MMAP) || defined(__arm32__)
-
-#ifdef USE_ARM32_MMAP
-#define DEV_MEM_IOBASE 0x43000000
-#endif
-
-static Bool ScreenEnabled[MAXSCREENS];
-static Bool ExtendedEnabled = FALSE;
-static Bool InitDone = FALSE;
-
-void
-xf86EnableIOPorts(ScreenNum)
-int ScreenNum;
-{
- int i;
- int fd;
- pointer base;
-
-#ifdef __arm32__
- struct memAccess *memInfoP;
- int *Size;
-#endif
-
- ScreenEnabled[ScreenNum] = TRUE;
-
- if (ExtendedEnabled)
- return;
-
-#ifdef USE_ARC_MMAP
- if ((fd = open("/dev/ttyC0", O_RDWR)) >= 0) {
- /* Try to map a page at the pccons I/O space */
- base = (pointer)mmap((caddr_t)0, 65536, PROT_READ|PROT_WRITE,
- MAP_FLAGS, fd, (off_t)0x0000);
-
- if (base != (pointer)-1) {
- IOPortBase = base;
- }
- else {
- xf86Msg(X_ERROR,
- "EnableIOPorts: failed to mmap %s (%s)\n",
- "/dev/ttyC0", strerror(errno));
- }
- }
- else {
- xf86Msg(X_ERROR, "EnableIOPorts: failed to open %s (%s)\n",
- "/dev/ttyC0", strerror(errno));
- }
-#endif
-
-#ifdef __arm32__
- IOPortBase = (unsigned int)-1;
-
- if((memInfoP = checkMapInfo(TRUE, MMIO_REGION)) != NULL)
- {
- /*
- * xf86MapInfoMap maps an offset from the start of video IO
- * space (e.g. 0x3B0), but IOPortBase is expected to map to
- * physical address 0x000, so subtract the start of video I/O
- * space from the result. This is safe for now becase we
- * actually mmap the start of the page, then the start of video
- * I/O space is added as an internal offset.
- */
- IOPortBase = (unsigned int)xf86MapInfoMap(memInfoP,
- (caddr_t)0x0, 0L)
- - memInfoP->memInfo.u.map_info_mmap.internal_offset;
- ExtendedEnabled = TRUE;
- return;
- }
-#ifdef USE_ARM32_MMAP
- checkDevMem(TRUE);
-
- if (devMemFd >= 0 && useDevMem)
- {
- base = (pointer)mmap((caddr_t)0, 0x400, PROT_READ|PROT_WRITE,
- MAP_FLAGS, devMemFd, (off_t)DEV_MEM_IOBASE);
-
- if (base != (pointer)-1)
- IOPortBase = (unsigned int)base;
- }
-
- if (IOPortBase == (unsigned int)-1)
- {
- FatalError("xf86EnableIOPorts: failed to open mem device or map IO base. \n\
-Make sure you have the Aperture Driver installed, or a kernel built with the INSECURE option\n");
- }
-#else
- /* We don't have the IOBASE, so we can't map the address */
- FatalError("xf86EnableIOPorts: failed to open mem device or map IO base. \n\
-Try building the server with USE_ARM32_MMAP defined\n");
-#endif
-#endif
-
- ExtendedEnabled = TRUE;
-
- return;
-}
-
-void
-xf86DisableIOPorts(ScreenNum)
-int ScreenNum;
-{
- int i;
-#ifdef __arm32__
- struct memAccess *memInfoP;
-#endif
-
- ScreenEnabled[ScreenNum] = FALSE;
-
-#ifdef __arm32__
- if((memInfoP = checkMapInfo(FALSE, MMIO_REGION)) != NULL)
- {
- xf86MapInfoUnmap(memInfoP, 0);
- }
-#endif
-
-#ifdef USE_ARM32_MMAP
- if (!ExtendedEnabled)
- return;
-
- for (i = 0; i < MAXSCREENS; i++)
- if (ScreenEnabled[i])
- return;
-
- munmap((caddr_t)IOPortBase, 0x400);
- IOPortBase = (unsigned int)-1;
- ExtendedEnabled = FALSE;
-#endif
-
- return;
-}
-
-#endif /* USE_ARC_MMAP || USE_ARM32_MMAP */
-#endif
-
-
-#ifdef HAS_MTRR_SUPPORT
-/* memory range (MTRR) support for FreeBSD */
-
-/*
- * This code is experimental. Some parts may be overkill, and other parts
- * may be incomplete.
- */
-
-/*
- * getAllRanges returns the full list of memory ranges with attributes set.
- */
-
-static struct mem_range_desc *
-getAllRanges(int *nmr)
-{
- struct mem_range_desc *mrd;
- struct mem_range_op mro;
-
- /*
- * Find how many ranges there are. If this fails, then the kernel
- * probably doesn't have MTRR support.
- */
- mro.mo_arg[0] = 0;
- if (ioctl(devMemFd, MEMRANGE_GET, &mro))
- return NULL;
- *nmr = mro.mo_arg[0];
- mrd = xnfalloc(*nmr * sizeof(struct mem_range_desc));
- mro.mo_arg[0] = *nmr;
- mro.mo_desc = mrd;
- if (ioctl(devMemFd, MEMRANGE_GET, &mro)) {
- xfree(mrd);
- return NULL;
- }
- return mrd;
-}
-
-/*
- * cleanMTRR removes any memory attribute that may be left by a previous
- * X server. Normally there won't be any, but this takes care of the
- * case where a server crashed without being able finish cleaning up.
- */
-
-static Bool
-cleanMTRR()
-{
- struct mem_range_desc *mrd;
- struct mem_range_op mro;
- int nmr, i;
-
- /* This shouldn't happen */
- if (devMemFd < 0)
- return FALSE;
-
- if (!(mrd = getAllRanges(&nmr)))
- return FALSE;
-
- for (i = 0; i < nmr; i++) {
- if (strcmp(mrd[i].mr_owner, X_MTRR_ID) == 0 &&
- (mrd[i].mr_flags & MDF_ACTIVE)) {
-#ifdef DEBUG
- ErrorF("Clean for (0x%lx,0x%lx)\n",
- (unsigned long)mrd[i].mr_base,
- (unsigned long)rd[i].mr_len);
-#endif
- if (mrd[i].mr_flags & MDF_FIXACTIVE) {
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- mrd[i].mr_flags = MDF_UNCACHEABLE;
- } else {
- mro.mo_arg[0] = MEMRANGE_SET_REMOVE;
- }
- mro.mo_desc = mrd + i;
- ioctl(devMemFd, MEMRANGE_SET, &mro);
- }
- }
-#ifdef DEBUG
- sleep(10);
-#endif
- xfree(mrd);
- return TRUE;
-}
-
-typedef struct x_RangeRec {
- struct mem_range_desc mrd;
- Bool wasWC;
- struct x_RangeRec * next;
-} RangeRec, *RangePtr;
-
-static void
-freeRangeList(RangePtr range)
-{
- RangePtr rp;
-
- while (range) {
- rp = range;
- range = rp->next;
- xfree(rp);
- }
-}
-
-static RangePtr
-dupRangeList(RangePtr list)
-{
- RangePtr new = NULL, rp, p;
-
- rp = list;
- while (rp) {
- p = xnfalloc(sizeof(RangeRec));
- *p = *rp;
- p->next = new;
- new = p;
- rp = rp->next;
- }
- return new;
-}
-
-static RangePtr
-sortRangeList(RangePtr list)
-{
- RangePtr rp1, rp2, copy, sorted = NULL, minp, prev, minprev;
- unsigned long minBase;
-
- /* Sort by base address */
- rp1 = copy = dupRangeList(list);
- while (rp1) {
- minBase = rp1->mrd.mr_base;
- minp = rp1;
- minprev = NULL;
- prev = rp1;
- rp2 = rp1->next;
- while (rp2) {
- if (rp2->mrd.mr_base < minBase) {
- minBase = rp2->mrd.mr_base;
- minp = rp2;
- minprev = prev;
- }
- prev = rp2;
- rp2 = rp2->next;
- }
- if (minprev) {
- minprev->next = minp->next;
- rp1 = copy;
- } else {
- rp1 = minp->next;
- }
- minp->next = sorted;
- sorted = minp;
- }
- return sorted;
-}
-
-/*
- * findRanges returns a list of ranges that overlap the specified range.
- */
-
-static void
-findRanges(unsigned long base, unsigned long size, RangePtr *ucp, RangePtr *wcp)
-{
- struct mem_range_desc *mrd;
- int nmr, i;
- RangePtr rp, *p;
-
- if (!(mrd = getAllRanges(&nmr)))
- return;
-
- for (i = 0; i < nmr; i++) {
- if ((mrd[i].mr_flags & MDF_ACTIVE) &&
- mrd[i].mr_base < base + size &&
- mrd[i].mr_base + mrd[i].mr_len > base) {
- if (mrd[i].mr_flags & MDF_WRITECOMBINE)
- p = wcp;
- else if (mrd[i].mr_flags & MDF_UNCACHEABLE)
- p = ucp;
- else
- continue;
- rp = xnfalloc(sizeof(RangeRec));
- rp->mrd = mrd[i];
- rp->next = *p;
- *p = rp;
- }
- }
- xfree(mrd);
-}
-
-/*
- * This checks if the existing overlapping ranges fully cover the requested
- * range. Is this overkill?
- */
-
-static Bool
-fullCoverage(unsigned long base, unsigned long size, RangePtr overlap)
-{
- RangePtr rp1, sorted = NULL;
- unsigned long end;
-
- sorted = sortRangeList(overlap);
- /* Look for gaps */
- rp1 = sorted;
- end = base + size;
- while (rp1) {
- if (rp1->mrd.mr_base > base) {
- freeRangeList(sorted);
- return FALSE;
- } else {
- base = rp1->mrd.mr_base + rp1->mrd.mr_len;
- }
- if (base >= end) {
- freeRangeList(sorted);
- return TRUE;
- }
- rp1 = rp1->next;
- }
- freeRangeList(sorted);
- return FALSE;
-}
-
-static pointer
-addWC(int screenNum, unsigned long base, unsigned long size, MessageType from)
-{
- RangePtr uc = NULL, wc = NULL, retlist = NULL;
- struct mem_range_desc mrd;
- struct mem_range_op mro;
-
- findRanges(base, size, &uc, &wc);
-
- /* See of the full range is already WC */
- if (!uc && fullCoverage(base, size, wc)) {
- xf86DrvMsg(screenNum, from,
- "Write-combining range (0x%lx,0x%lx) was already set\n",
- base, size);
- return NULL;
- }
-
- /* Otherwise, try to add the new range */
- mrd.mr_base = base;
- mrd.mr_len = size;
- strcpy(mrd.mr_owner, X_MTRR_ID);
- mrd.mr_flags = MDF_WRITECOMBINE;
- mro.mo_desc = &mrd;
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
- xf86DrvMsg(screenNum, X_WARNING,
- "Failed to set write-combining range "
- "(0x%lx,0x%lx)\n", base, size);
- return NULL;
- } else {
- xf86DrvMsg(screenNum, from,
- "Write-combining range (0x%lx,0x%lx)\n", base, size);
- retlist = xnfalloc(sizeof(RangeRec));
- retlist->mrd = mrd;
- retlist->wasWC = FALSE;
- retlist->next = NULL;
- return retlist;
- }
-}
-
-static pointer
-delWC(int screenNum, unsigned long base, unsigned long size, MessageType from)
-{
- RangePtr uc = NULL, wc = NULL, retlist = NULL;
- struct mem_range_desc mrd;
- struct mem_range_op mro;
-
- findRanges(base, size, &uc, &wc);
-
- /*
- * See of the full range is already not WC, or if there is full
- * coverage from UC ranges.
- */
- if (!wc || fullCoverage(base, size, uc)) {
- xf86DrvMsg(screenNum, from,
- "Write-combining range (0x%lx,0x%lx) was already clear\n",
- base, size);
- return NULL;
- }
-
- /* Otherwise, try to add the new range */
- mrd.mr_base = base;
- mrd.mr_len = size;
- strcpy(mrd.mr_owner, X_MTRR_ID);
- mrd.mr_flags = MDF_UNCACHEABLE;
- mro.mo_desc = &mrd;
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
- xf86DrvMsg(screenNum, X_WARNING,
- "Failed to remove write-combining range "
- "(0x%lx,0x%lx)\n", base, size);
- /* XXX Should then remove all of the overlapping WC ranges */
- return NULL;
- } else {
- xf86DrvMsg(screenNum, from,
- "Removed Write-combining range (0x%lx,0x%lx)\n",
- base, size);
- retlist = xnfalloc(sizeof(RangeRec));
- retlist->mrd = mrd;
- retlist->wasWC = TRUE;
- retlist->next = NULL;
- return retlist;
- }
-}
-
-static pointer
-setWC(int screenNum, unsigned long base, unsigned long size, Bool enable,
- MessageType from)
-{
- if (enable)
- return addWC(screenNum, base, size, from);
- else
- return delWC(screenNum, base, size, from);
-}
-
-static void
-undoWC(int screenNum, pointer list)
-{
- RangePtr rp;
- struct mem_range_op mro;
- Bool failed;
-
- rp = list;
- while (rp) {
-#ifdef DEBUG
- ErrorF("Undo for (0x%lx,0x%lx), %d\n",
- (unsigned long)rp->mrd.mr_base,
- (unsigned long)rp->mrd.mr_len, rp->wasWC);
-#endif
- failed = FALSE;
- if (rp->wasWC) {
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- rp->mrd.mr_flags = MDF_WRITECOMBINE;
- strcpy(rp->mrd.mr_owner, "unknown");
- } else {
- mro.mo_arg[0] = MEMRANGE_SET_REMOVE;
- }
- mro.mo_desc = &rp->mrd;
-
- if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
- if (!rp->wasWC) {
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- rp->mrd.mr_flags = MDF_UNCACHEABLE;
- strcpy(rp->mrd.mr_owner, "unknown");
- if (ioctl(devMemFd, MEMRANGE_SET, &mro))
- failed = TRUE;
- } else
- failed = TRUE;
- }
- if (failed) {
- xf86DrvMsg(screenNum, X_WARNING,
- "Failed to restore MTRR range (0x%lx,0x%lx)\n",
- (unsigned long)rp->mrd.mr_base,
- (unsigned long)rp->mrd.mr_len);
- }
- rp = rp->next;
- }
-}
-
-#endif /* HAS_MTRR_SUPPORT */
-
-#if defined(__FreeBSD__) && defined(__alpha__)
-
-#define vuip volatile unsigned int *
-
-static unsigned long msb_set = 0;
-static pointer memSBase = 0;
-static pointer memBase = 0;
-
-extern int readDense8(pointer Base, register unsigned long Offset);
-extern int readDense16(pointer Base, register unsigned long Offset);
-extern int readDense32(pointer Base, register unsigned long Offset);
-extern void
-writeDenseNB8(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDenseNB16(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDenseNB32(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDense8(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDense16(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDense32(int Value, pointer Base, register unsigned long Offset);
-
-static int readSparse8(pointer Base, register unsigned long Offset);
-static int readSparse16(pointer Base, register unsigned long Offset);
-static int readSparse32(pointer Base, register unsigned long Offset);
-static void
-writeSparseNB8(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparseNB16(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparseNB32(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparse8(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparse16(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparse32(int Value, pointer Base, register unsigned long Offset);
-
-#include <machine/sysarch.h>
-
-extern int sysarch(int, char *);
-
-struct parms {
- u_int64_t hae;
-};
-
-static int
-sethae(u_int64_t hae)
-{
- struct parms p;
- p.hae = hae;
- return (sysarch(ALPHA_SETHAE, (char *)&p));
-}
-
-static pointer
-mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- static Bool was_here = FALSE;
-
- if (!was_here) {
- was_here = TRUE;
-
- checkDevMem(FALSE);
-
- xf86WriteMmio8 = writeSparse8;
- xf86WriteMmio16 = writeSparse16;
- xf86WriteMmio32 = writeSparse32;
- xf86WriteMmioNB8 = writeSparseNB8;
- xf86WriteMmioNB16 = writeSparseNB16;
- xf86WriteMmioNB32 = writeSparseNB32;
- xf86ReadMmio8 = readSparse8;
- xf86ReadMmio16 = readSparse16;
- xf86ReadMmio32 = readSparse32;
-
- memBase = mmap((caddr_t)0, 0x100000000,
- PROT_READ | PROT_WRITE,
- MAP_SHARED, devMemFd,
- (off_t) dense_base());
- memSBase = mmap((caddr_t)0, 0x100000000,
- PROT_READ | PROT_WRITE,
- MAP_SHARED, devMemFd,
- (off_t) memory_base());
-
- if (memSBase == MAP_FAILED || memBase == MAP_FAILED) {
- FatalError("xf86MapVidMem: Could not mmap framebuffer (%s)\n",
- strerror(errno));
- }
- }
- return (pointer)((unsigned long)memBase + Base);
-}
-
-static void
-unmapVidMemSparse(int ScreenNum, pointer Base, unsigned long Size)
-{
-}
-
-static int
-readSparse8(pointer Base, register unsigned long Offset)
-{
- register unsigned long result, shift;
- register unsigned long msb;
-
- mem_barrier();
- Offset += (unsigned long)Base - (unsigned long)memBase;
- shift = (Offset & 0x3) << 3;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
- sethae(msb);
- msb_set = msb;
- }
- }
-
- result = *(vuip) ((unsigned long)memSBase + (Offset << 5));
- result >>= shift;
- return 0xffUL & result;
-}
-
-static int
-readSparse16(pointer Base, register unsigned long Offset)
-{
- register unsigned long result, shift;
- register unsigned long msb;
-
- mem_barrier();
- Offset += (unsigned long)Base - (unsigned long)memBase;
- shift = (Offset & 0x2) << 3;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
- sethae(msb);
- msb_set = msb;
- }
- }
- result = *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2)));
- result >>= shift;
- return 0xffffUL & result;
-}
-
-static int
-readSparse32(pointer Base, register unsigned long Offset)
-{
- mem_barrier();
- return *(vuip)((unsigned long)Base+(Offset));
-}
-
-static void
-writeSparse8(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned long msb;
- register unsigned int b = Value & 0xffU;
-
- write_mem_barrier();
- Offset += (unsigned long)Base - (unsigned long)memBase;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
- sethae(msb);
- msb_set = msb;
- }
- }
- *(vuip) ((unsigned long)memSBase + (Offset << 5)) = b * 0x01010101;
-}
-
-static void
-writeSparse16(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned long msb;
- register unsigned int w = Value & 0xffffU;
-
- write_mem_barrier();
- Offset += (unsigned long)Base - (unsigned long)memBase;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
- sethae(msb);
- msb_set = msb;
- }
- }
- *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) =
- w * 0x00010001;
-
-}
-
-static void
-writeSparse32(int Value, pointer Base, register unsigned long Offset)
-{
- write_mem_barrier();
- *(vuip)((unsigned long)Base + (Offset)) = Value;
- return;
-}
-
-static void
-writeSparseNB8(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned long msb;
- register unsigned int b = Value & 0xffU;
-
- Offset += (unsigned long)Base - (unsigned long)memBase;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
- sethae(msb);
- msb_set = msb;
- }
- }
- *(vuip) ((unsigned long)memSBase + (Offset << 5)) = b * 0x01010101;
-}
-
-static void
-writeSparseNB16(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned long msb;
- register unsigned int w = Value & 0xffffU;
-
- Offset += (unsigned long)Base - (unsigned long)memBase;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask ;
- Offset -= msb;
- if (msb_set != msb) {
- sethae(msb);
- msb_set = msb;
- }
- }
- *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) =
- w * 0x00010001;
-}
-
-static void
-writeSparseNB32(int Value, pointer Base, register unsigned long Offset)
-{
- *(vuip)((unsigned long)Base + (Offset)) = Value;
- return;
-}
-
-void (*xf86WriteMmio8)(int Value, pointer Base, unsigned long Offset)
- = writeDense8;
-void (*xf86WriteMmio16)(int Value, pointer Base, unsigned long Offset)
- = writeDense16;
-void (*xf86WriteMmio32)(int Value, pointer Base, unsigned long Offset)
- = writeDense32;
-void (*xf86WriteMmioNB8)(int Value, pointer Base, unsigned long Offset)
- = writeDenseNB8;
-void (*xf86WriteMmioNB16)(int Value, pointer Base, unsigned long Offset)
- = writeDenseNB16;
-void (*xf86WriteMmioNB32)(int Value, pointer Base, unsigned long Offset)
- = writeDenseNB32;
-int (*xf86ReadMmio8)(pointer Base, unsigned long Offset)
- = readDense8;
-int (*xf86ReadMmio16)(pointer Base, unsigned long Offset)
- = readDense16;
-int (*xf86ReadMmio32)(pointer Base, unsigned long Offset)
- = readDense32;
-
-#endif /* __FreeBSD__ && __alpha__ */
-
-#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
-static pointer
-NetBSDsetWC(int screenNum, unsigned long base, unsigned long size, Bool enable,
- MessageType from)
-{
- struct mtrr *mtrrp;
- int n;
-
- xf86DrvMsg(screenNum, X_WARNING,
- "%s MTRR %lx - %lx\n", enable ? "set" : "remove",
- base, (base + size));
-
- mtrrp = xnfalloc(sizeof (struct mtrr));
- mtrrp->base = base;
- mtrrp->len = size;
- mtrrp->type = MTRR_TYPE_WC;
-
- /*
- * MTRR_PRIVATE will make this MTRR get reset automatically
- * if this process exits, so we have no need for an explicit
- * cleanup operation when starting a new server.
- */
-
- if (enable)
- mtrrp->flags = MTRR_VALID | MTRR_PRIVATE;
- else
- mtrrp->flags = 0;
- n = 1;
-
- if (i386_set_mtrr(mtrrp, &n) < 0) {
- xfree(mtrrp);
- return NULL;
- }
- return mtrrp;
-}
-
-static void
-NetBSDundoWC(int screenNum, pointer list)
-{
- struct mtrr *mtrrp = (struct mtrr *)list;
- int n;
-
- if (mtrrp == NULL)
- return;
- n = 1;
- mtrrp->flags &= ~MTRR_VALID;
- i386_set_mtrr(mtrrp, &n);
- xfree(mtrrp);
-}
-#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm.h b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm.h
index 688769409..d1d669437 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm.h
@@ -35,8 +35,31 @@
#ifndef _DRM_H_
#define _DRM_H_
+#if defined(__linux__)
+#include <linux/config.h>
+#include <asm/ioctl.h> /* For _IO* macros */
+#define DRM_IOCTL_NR(n) _IOC_NR(n)
+#define DRM_IOC_VOID _IOC_NONE
+#define DRM_IOC_READ _IOC_READ
+#define DRM_IOC_WRITE _IOC_WRITE
+#define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE
+#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
+#elif defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__FreeBSD__) && defined(XFree86Server)
+/* Prevent name collision when including sys/ioccom.h */
+#undef ioctl
#include <sys/ioccom.h>
-#define DRM_IOCTL_NR(n) ((n) & 0xff)
+#define ioctl(a,b,c) xf86ioctl(a,b,c)
+#else
+#include <sys/ioccom.h>
+#endif /* __FreeBSD__ && xf86ioctl */
+#define DRM_IOCTL_NR(n) ((n) & 0xff)
+#define DRM_IOC_VOID IOC_VOID
+#define DRM_IOC_READ IOC_OUT
+#define DRM_IOC_WRITE IOC_IN
+#define DRM_IOC_READWRITE IOC_INOUT
+#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
+#endif
#define XFREE86_VERSION(major,minor,patch,snap) \
((major << 16) | (minor << 8) | patch)
@@ -62,7 +85,7 @@
#define DRM_NAME "drm" /* Name in kernel, /dev, and /proc */
#define DRM_MIN_ORDER 5 /* At least 2^5 bytes = 32 bytes */
#define DRM_MAX_ORDER 22 /* Up to 2^22 bytes = 4MB */
-#define DRM_RAM_PERCENT 50 /* How much system ram can we lock? */
+#define DRM_RAM_PERCENT 10 /* How much system ram can we lock? */
#define _DRM_LOCK_HELD 0x80000000 /* Hardware lock is held */
#define _DRM_LOCK_CONT 0x40000000 /* Hardware lock is contended */
@@ -78,6 +101,10 @@ typedef unsigned int drm_magic_t;
/* Warning: If you change this structure, make sure you change
* XF86DRIClipRectRec in the server as well */
+/* KW: Actually it's illegal to change either for
+ * backwards-compatibility reasons.
+ */
+
typedef struct drm_clip_rect {
unsigned short x1;
unsigned short y1;
@@ -93,14 +120,6 @@ typedef struct drm_tex_region {
unsigned int age;
} drm_tex_region_t;
-/* Seperate include files for the driver specific structures */
-#include "mga_drm.h"
-#include "i810_drm.h"
-#include "i830_drm.h"
-#include "r128_drm.h"
-#include "radeon_drm.h"
-#include "sis_drm.h"
-
typedef struct drm_version {
int version_major; /* Major version */
int version_minor; /* Minor version */
@@ -326,6 +345,32 @@ typedef struct drm_irq_busid {
int funcnum;
} drm_irq_busid_t;
+typedef enum {
+ _DRM_VBLANK_ABSOLUTE = 0x0, /* Wait for specific vblank sequence number */
+ _DRM_VBLANK_RELATIVE = 0x1, /* Wait for given number of vblanks */
+ _DRM_VBLANK_SIGNAL = 0x40000000 /* Send signal instead of blocking */
+} drm_vblank_seq_type_t;
+
+#define _DRM_VBLANK_FLAGS_MASK _DRM_VBLANK_SIGNAL
+
+struct drm_wait_vblank_request {
+ drm_vblank_seq_type_t type;
+ unsigned int sequence;
+ unsigned long signal;
+};
+
+struct drm_wait_vblank_reply {
+ drm_vblank_seq_type_t type;
+ unsigned int sequence;
+ long tval_sec;
+ long tval_usec;
+};
+
+typedef union drm_wait_vblank {
+ struct drm_wait_vblank_request request;
+ struct drm_wait_vblank_reply reply;
+} drm_wait_vblank_t;
+
typedef struct drm_agp_mode {
unsigned long mode;
} drm_agp_mode_t;
@@ -365,10 +410,9 @@ typedef struct drm_scatter_gather {
#define DRM_IOCTL_BASE 'd'
#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr)
-#define DRM_IOR(nr,size) _IOR(DRM_IOCTL_BASE,nr,size)
-#define DRM_IOW(nr,size) _IOW(DRM_IOCTL_BASE,nr,size)
-#define DRM_IOWR(nr,size) _IOWR(DRM_IOCTL_BASE,nr,size)
-
+#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type)
+#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type)
+#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type)
#define DRM_IOCTL_VERSION DRM_IOWR(0x00, drm_version_t)
#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, drm_unique_t)
@@ -421,81 +465,10 @@ typedef struct drm_scatter_gather {
#define DRM_IOCTL_SG_ALLOC DRM_IOW( 0x38, drm_scatter_gather_t)
#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, drm_scatter_gather_t)
-/* MGA specific ioctls */
-#define DRM_IOCTL_MGA_INIT DRM_IOW( 0x40, drm_mga_init_t)
-#define DRM_IOCTL_MGA_FLUSH DRM_IOW( 0x41, drm_lock_t)
-#define DRM_IOCTL_MGA_RESET DRM_IO( 0x42)
-#define DRM_IOCTL_MGA_SWAP DRM_IO( 0x43)
-#define DRM_IOCTL_MGA_CLEAR DRM_IOW( 0x44, drm_mga_clear_t)
-#define DRM_IOCTL_MGA_VERTEX DRM_IOW( 0x45, drm_mga_vertex_t)
-#define DRM_IOCTL_MGA_INDICES DRM_IOW( 0x46, drm_mga_indices_t)
-#define DRM_IOCTL_MGA_ILOAD DRM_IOW( 0x47, drm_mga_iload_t)
-#define DRM_IOCTL_MGA_BLIT DRM_IOW( 0x48, drm_mga_blit_t)
-
-/* i810 specific ioctls */
-#define DRM_IOCTL_I810_INIT DRM_IOW( 0x40, drm_i810_init_t)
-#define DRM_IOCTL_I810_VERTEX DRM_IOW( 0x41, drm_i810_vertex_t)
-#define DRM_IOCTL_I810_CLEAR DRM_IOW( 0x42, drm_i810_clear_t)
-#define DRM_IOCTL_I810_FLUSH DRM_IO( 0x43)
-#define DRM_IOCTL_I810_GETAGE DRM_IO( 0x44)
-#define DRM_IOCTL_I810_GETBUF DRM_IOWR(0x45, drm_i810_dma_t)
-#define DRM_IOCTL_I810_SWAP DRM_IO( 0x46)
-#define DRM_IOCTL_I810_COPY DRM_IOW( 0x47, drm_i810_copy_t)
-#define DRM_IOCTL_I810_DOCOPY DRM_IO( 0x48)
-
-/* Rage 128 specific ioctls */
-#define DRM_IOCTL_R128_INIT DRM_IOW( 0x40, drm_r128_init_t)
-#define DRM_IOCTL_R128_CCE_START DRM_IO( 0x41)
-#define DRM_IOCTL_R128_CCE_STOP DRM_IOW( 0x42, drm_r128_cce_stop_t)
-#define DRM_IOCTL_R128_CCE_RESET DRM_IO( 0x43)
-#define DRM_IOCTL_R128_CCE_IDLE DRM_IO( 0x44)
-#define DRM_IOCTL_R128_RESET DRM_IO( 0x46)
-#define DRM_IOCTL_R128_SWAP DRM_IO( 0x47)
-#define DRM_IOCTL_R128_CLEAR DRM_IOW( 0x48, drm_r128_clear_t)
-#define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x49, drm_r128_vertex_t)
-#define DRM_IOCTL_R128_INDICES DRM_IOW( 0x4a, drm_r128_indices_t)
-#define DRM_IOCTL_R128_BLIT DRM_IOW( 0x4b, drm_r128_blit_t)
-#define DRM_IOCTL_R128_DEPTH DRM_IOW( 0x4c, drm_r128_depth_t)
-#define DRM_IOCTL_R128_STIPPLE DRM_IOW( 0x4d, drm_r128_stipple_t)
-#define DRM_IOCTL_R128_INDIRECT DRM_IOWR(0x4f, drm_r128_indirect_t)
-#define DRM_IOCTL_R128_FULLSCREEN DRM_IOW( 0x50, drm_r128_fullscreen_t)
-
-/* Radeon specific ioctls */
-#define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( 0x40, drm_radeon_init_t)
-#define DRM_IOCTL_RADEON_CP_START DRM_IO( 0x41)
-#define DRM_IOCTL_RADEON_CP_STOP DRM_IOW( 0x42, drm_radeon_cp_stop_t)
-#define DRM_IOCTL_RADEON_CP_RESET DRM_IO( 0x43)
-#define DRM_IOCTL_RADEON_CP_IDLE DRM_IO( 0x44)
-#define DRM_IOCTL_RADEON_RESET DRM_IO( 0x45)
-#define DRM_IOCTL_RADEON_FULLSCREEN DRM_IOW( 0x46, drm_radeon_fullscreen_t)
-#define DRM_IOCTL_RADEON_SWAP DRM_IO( 0x47)
-#define DRM_IOCTL_RADEON_CLEAR DRM_IOW( 0x48, drm_radeon_clear_t)
-#define DRM_IOCTL_RADEON_VERTEX DRM_IOW( 0x49, drm_radeon_vertex_t)
-#define DRM_IOCTL_RADEON_INDICES DRM_IOW( 0x4a, drm_radeon_indices_t)
-#define DRM_IOCTL_RADEON_STIPPLE DRM_IOW( 0x4c, drm_radeon_stipple_t)
-#define DRM_IOCTL_RADEON_INDIRECT DRM_IOWR(0x4d, drm_radeon_indirect_t)
-#define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(0x4e, drm_radeon_texture_t)
-
-/* SiS specific ioctls */
-
-#define SIS_IOCTL_FB_ALLOC DRM_IOWR(0x44, drm_sis_mem_t)
-#define SIS_IOCTL_FB_FREE DRM_IOW( 0x45, drm_sis_mem_t)
-#define SIS_IOCTL_AGP_INIT DRM_IOWR(0x53, drm_sis_agp_t)
-#define SIS_IOCTL_AGP_ALLOC DRM_IOWR(0x54, drm_sis_mem_t)
-#define SIS_IOCTL_AGP_FREE DRM_IOW( 0x55, drm_sis_mem_t)
-#define SIS_IOCTL_FLIP DRM_IOW( 0x48, drm_sis_flip_t)
-#define SIS_IOCTL_FLIP_INIT DRM_IO( 0x49)
-#define SIS_IOCTL_FLIP_FINAL DRM_IO( 0x50)
-
-/* I830 specific ioctls */
-#define DRM_IOCTL_I830_INIT DRM_IOW( 0x40, drm_i830_init_t)
-#define DRM_IOCTL_I830_VERTEX DRM_IOW( 0x41, drm_i830_vertex_t)
-#define DRM_IOCTL_I830_CLEAR DRM_IOW( 0x42, drm_i830_clear_t)
-#define DRM_IOCTL_I830_FLUSH DRM_IO ( 0x43)
-#define DRM_IOCTL_I830_GETAGE DRM_IO ( 0x44)
-#define DRM_IOCTL_I830_GETBUF DRM_IOWR(0x45, drm_i830_dma_t)
-#define DRM_IOCTL_I830_SWAP DRM_IO ( 0x46)
-#define DRM_IOCTL_I830_COPY DRM_IOW( 0x47, drm_i830_copy_t)
-#define DRM_IOCTL_I830_DOCOPY DRM_IO ( 0x48)
+#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, drm_wait_vblank_t)
+
+/* Device specfic ioctls should only be in their respective headers
+ * The device specific ioctl range is 0x40 to 0x79. */
+#define DRM_COMMAND_BASE 0x40
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drmP.h b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drmP.h
index 35b62f059..a4308f377 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drmP.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drmP.h
@@ -404,6 +404,14 @@ typedef struct drm_map_list_entry {
drm_local_map_t *map;
} drm_map_list_entry_t;
+TAILQ_HEAD(drm_vbl_sig_list, drm_vbl_sig);
+typedef struct drm_vbl_sig {
+ TAILQ_ENTRY(drm_vbl_sig) link;
+ unsigned int sequence;
+ int signo;
+ int pid;
+} drm_vbl_sig_t;
+
struct drm_device {
#ifdef __NetBSD__
struct device device; /* NetBSD's softc is an extension of struct device */
@@ -481,6 +489,8 @@ struct drm_device {
#if __HAVE_VBL_IRQ
wait_queue_head_t vbl_queue; /* vbl wait channel */
atomic_t vbl_received;
+ struct drm_vbl_sig_list vbl_sig_list;
+ DRM_SPINTYPE vbl_lock;
#endif
cycles_t ctx_start;
cycles_t lck_start;
@@ -626,6 +636,7 @@ extern drm_buf_t *DRM(freelist_get)(drm_freelist_t *bl, int block);
#endif /* __HAVE_DMA */
#if __HAVE_VBL_IRQ
extern int DRM(vblank_wait)(drm_device_t *dev, unsigned int *vbl_seq);
+extern void DRM(vbl_send_signals)( drm_device_t *dev );
#endif
#if __REALLY_HAVE_AGP
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_dma.h b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_dma.h
index cde35a95a..01b1cdb07 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_dma.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_dma.h
@@ -524,6 +524,11 @@ int DRM(irq_install)( drm_device_t *dev, int irq )
TASK_INIT(&dev->task, 0, DRM(dma_immediate_bh), dev);
#endif
+#if __HAVE_VBL_IRQ
+ DRM_SPININIT( dev->vbl_lock, "vblsig" );
+ TAILQ_INIT( &dev->vbl_sig_list );
+#endif
+
/* Before installing handler */
DRM(driver_irq_preinstall)( dev );
@@ -633,21 +638,68 @@ int DRM(wait_vblank)( DRM_IOCTL_ARGS )
DRM_COPY_FROM_USER_IOCTL( vblwait, (drm_wait_vblank_t *)data,
sizeof(vblwait) );
- if ( vblwait.type == _DRM_VBLANK_RELATIVE ) {
- vblwait.sequence += atomic_read( &dev->vbl_received );
+ if (vblwait.request.type & _DRM_VBLANK_RELATIVE) {
+ vblwait.request.sequence += atomic_read(&dev->vbl_received);
+ vblwait.request.type &= ~_DRM_VBLANK_RELATIVE;
}
- ret = DRM(vblank_wait)( dev, &vblwait.sequence );
-
- microtime( &now );
- vblwait.tval_sec = now.tv_sec;
- vblwait.tval_usec = now.tv_usec;
+ flags = vblwait.request.type & _DRM_VBLANK_FLAGS_MASK;
+ if (flags & _DRM_VBLANK_SIGNAL) {
+ drm_vbl_sig_t *vbl_sig = DRM_MALLOC(sizeof(drm_vbl_sig_t));
+ if (vbl_sig == NULL)
+ return ENOMEM;
+ bzero(vbl_sig, sizeof(*vbl_sig));
+
+ vbl_sig->sequence = vblwait.request.sequence;
+ vbl_sig->signo = vblwait.request.signal;
+ vbl_sig->pid = DRM_CURRENTPID;
+
+ vblwait.reply.sequence = atomic_read(&dev->vbl_received);
+
+ DRM_SPINLOCK(&dev->vbl_lock);
+ TAILQ_INSERT_HEAD(&dev->vbl_sig_list, vbl_sig, link);
+ DRM_SPINUNLOCK(&dev->vbl_lock);
+ ret = 0;
+ } else {
+ ret = DRM(vblank_wait)(dev, &vblwait.request.sequence);
+
+ microtime(&now);
+ vblwait.reply.tval_sec = now.tv_sec;
+ vblwait.reply.tval_usec = now.tv_usec;
+ }
DRM_COPY_TO_USER_IOCTL( (drm_wait_vblank_t *)data, vblwait,
sizeof(vblwait) );
return ret;
}
+
+void DRM(vbl_send_signals)( drm_device_t *dev )
+{
+ drm_vbl_sig_t *vbl_sig;
+ unsigned int vbl_seq = atomic_read( &dev->vbl_received );
+ struct proc *p;
+
+ DRM_SPINLOCK(&dev->vbl_lock);
+
+ vbl_sig = TAILQ_FIRST(&dev->vbl_sig_list);
+ while (vbl_sig != NULL) {
+ drm_vbl_sig_t *next = TAILQ_NEXT(vbl_sig, link);
+
+ if ( ( vbl_seq - vbl_sig->sequence ) <= (1<<23) ) {
+ p = pfind(vbl_sig->pid);
+ if (p != NULL)
+ psignal(p, vbl_sig->signo);
+
+ TAILQ_REMOVE(&dev->vbl_sig_list, vbl_sig, link);
+ DRM_FREE(vbl_sig);
+ }
+ vbl_sig = next;
+ }
+
+ DRM_SPINUNLOCK(&dev->vbl_lock);
+}
+
#endif /* __HAVE_VBL_IRQ */
#else
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_drv.h b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_drv.h
index 3cab73167..0e0dc1aaa 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_drv.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_drv.h
@@ -982,7 +982,7 @@ int DRM(close)(dev_t kdev, int flags, int fmt, DRM_STRUCTPROC *p)
}
if ( DRM(lock_take)( &dev->lock.hw_lock->lock,
DRM_KERNEL_CONTEXT ) ) {
- dev->lock.pid = p->p_pid;
+ dev->lock.pid = DRM_CURRENTPID;
dev->lock.lock_time = jiffies;
atomic_inc( &dev->counts[_DRM_STAT_LOCKS] );
break; /* Got lock */
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux
index ba7b1f718..633d96c4e 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux
@@ -44,7 +44,7 @@ LIBS =
DRMTEMPLATES = drm_auth.h drm_bufs.h drm_context.h drm_dma.h drm_drawable.h \
drm_drv.h drm_fops.h drm_init.h drm_ioctl.h drm_lists.h \
drm_lock.h drm_memory.h drm_proc.h drm_stub.h drm_vm.h
-DRMHEADERS = drm.h drmP.h
+DRMHEADERS = drm.h drmP.h drm_sarea.h
GAMMAOBJS = gamma_drv.o gamma_dma.o
GAMMAHEADERS = gamma_drv.h $(DRMHEADERS) $(DRMTEMPLATES)
@@ -52,10 +52,10 @@ GAMMAHEADERS = gamma_drv.h $(DRMHEADERS) $(DRMTEMPLATES)
TDFXOBJS = tdfx_drv.o
TDFXHEADERS = tdfx.h $(DRMHEADERS) $(DRMTEMPLATES)
-R128OBJS = r128_drv.o r128_cce.o r128_state.o
+R128OBJS = r128_drv.o r128_cce.o r128_state.o r128_irq.o
R128HEADERS = r128.h r128_drv.h r128_drm.h $(DRMHEADERS) $(DRMTEMPLATES)
-RADEONOBJS = radeon_drv.o radeon_cp.o radeon_state.o
+RADEONOBJS = radeon_drv.o radeon_cp.o radeon_state.o radeon_mem.o radeon_irq.o
RADEONHEADERS = radeon.h radeon_drv.h radeon_drm.h $(DRMHEADERS) \
$(DRMTEMPLATES)
@@ -66,7 +66,7 @@ WARNINGS = -Wall -Wwrite-strings -Wpointer-arith -Wcast-align \
-Wstrict-prototypes -Wnested-externs \
-Wpointer-arith
# -Wshadow -Winline -- make output too noisy
-MODCFLAGS = $(CFLAGS) -D__KERNEL__ -DMODULE -fomit-frame-pointer
+MODCFLAGS = $(CFLAGS) -D__KERNEL__ -DMODULE -fomit-frame-pointer -fno-strict-aliasing
PRGCFLAGS = $(CFLAGS) -g -ansi -pedantic -DPOSIX_C_SOURCE=199309L \
-D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE \
-I../../../../../../include -I../../../../../../../../include \
@@ -158,7 +158,7 @@ MODS += i810.o
MODS += i830.o
endif
-MGAOBJS = mga_drv.o mga_dma.o mga_state.o mga_warp.o
+MGAOBJS = mga_drv.o mga_dma.o mga_state.o mga_warp.o mga_irq.o
MGAHEADERS = mga.h mga_drv.h mga_drm.h $(DRMHEADERS) $(DRMTEMPLATES)
I810OBJS = i810_drv.o i810_dma.o
@@ -270,12 +270,12 @@ ChangeLog:
$(GAMMAOBJS): $(GAMMAHEADERS)
$(TDFXOBJS): $(TDFXHEADERS)
+$(R128OBJS): $(R128HEADERS)
+$(RADEONOBJS): $(RADEONHEADERS)
ifeq ($(AGP),1)
$(MGAOBJS): $(MGAHEADERS)
$(I810OBJS): $(I810HEADERS)
$(I830OBJS): $(I830HEADERS)
-$(R128OBJS): $(R128HEADERS)
-$(RADEONOBJS): $(RADEONHEADERS)
endif
clean cleandir::
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h
index 79dd58142..d1d669437 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h
@@ -38,10 +38,27 @@
#if defined(__linux__)
#include <linux/config.h>
#include <asm/ioctl.h> /* For _IO* macros */
-#define DRM_IOCTL_NR(n) _IOC_NR(n)
-#elif defined(__FreeBSD__)
+#define DRM_IOCTL_NR(n) _IOC_NR(n)
+#define DRM_IOC_VOID _IOC_NONE
+#define DRM_IOC_READ _IOC_READ
+#define DRM_IOC_WRITE _IOC_WRITE
+#define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE
+#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
+#elif defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__FreeBSD__) && defined(XFree86Server)
+/* Prevent name collision when including sys/ioccom.h */
+#undef ioctl
#include <sys/ioccom.h>
-#define DRM_IOCTL_NR(n) ((n) & 0xff)
+#define ioctl(a,b,c) xf86ioctl(a,b,c)
+#else
+#include <sys/ioccom.h>
+#endif /* __FreeBSD__ && xf86ioctl */
+#define DRM_IOCTL_NR(n) ((n) & 0xff)
+#define DRM_IOC_VOID IOC_VOID
+#define DRM_IOC_READ IOC_OUT
+#define DRM_IOC_WRITE IOC_IN
+#define DRM_IOC_READWRITE IOC_INOUT
+#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
#endif
#define XFREE86_VERSION(major,minor,patch,snap) \
@@ -84,6 +101,10 @@ typedef unsigned int drm_magic_t;
/* Warning: If you change this structure, make sure you change
* XF86DRIClipRectRec in the server as well */
+/* KW: Actually it's illegal to change either for
+ * backwards-compatibility reasons.
+ */
+
typedef struct drm_clip_rect {
unsigned short x1;
unsigned short y1;
@@ -99,15 +120,6 @@ typedef struct drm_tex_region {
unsigned int age;
} drm_tex_region_t;
-/* Seperate include files for the i810/mga/r128 specific structures */
-#include "mga_drm.h"
-#include "i810_drm.h"
-#include "r128_drm.h"
-#include "radeon_drm.h"
-#include "sis_drm.h"
-#include "i830_drm.h"
-#include "gamma_drm.h"
-
typedef struct drm_version {
int version_major; /* Major version */
int version_minor; /* Minor version */
@@ -333,6 +345,32 @@ typedef struct drm_irq_busid {
int funcnum;
} drm_irq_busid_t;
+typedef enum {
+ _DRM_VBLANK_ABSOLUTE = 0x0, /* Wait for specific vblank sequence number */
+ _DRM_VBLANK_RELATIVE = 0x1, /* Wait for given number of vblanks */
+ _DRM_VBLANK_SIGNAL = 0x40000000 /* Send signal instead of blocking */
+} drm_vblank_seq_type_t;
+
+#define _DRM_VBLANK_FLAGS_MASK _DRM_VBLANK_SIGNAL
+
+struct drm_wait_vblank_request {
+ drm_vblank_seq_type_t type;
+ unsigned int sequence;
+ unsigned long signal;
+};
+
+struct drm_wait_vblank_reply {
+ drm_vblank_seq_type_t type;
+ unsigned int sequence;
+ long tval_sec;
+ long tval_usec;
+};
+
+typedef union drm_wait_vblank {
+ struct drm_wait_vblank_request request;
+ struct drm_wait_vblank_reply reply;
+} drm_wait_vblank_t;
+
typedef struct drm_agp_mode {
unsigned long mode;
} drm_agp_mode_t;
@@ -372,10 +410,9 @@ typedef struct drm_scatter_gather {
#define DRM_IOCTL_BASE 'd'
#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr)
-#define DRM_IOR(nr,size) _IOR(DRM_IOCTL_BASE,nr,size)
-#define DRM_IOW(nr,size) _IOW(DRM_IOCTL_BASE,nr,size)
-#define DRM_IOWR(nr,size) _IOWR(DRM_IOCTL_BASE,nr,size)
-
+#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type)
+#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type)
+#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type)
#define DRM_IOCTL_VERSION DRM_IOWR(0x00, drm_version_t)
#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, drm_unique_t)
@@ -428,92 +465,10 @@ typedef struct drm_scatter_gather {
#define DRM_IOCTL_SG_ALLOC DRM_IOW( 0x38, drm_scatter_gather_t)
#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, drm_scatter_gather_t)
-/* MGA specific ioctls */
-#define DRM_IOCTL_MGA_INIT DRM_IOW( 0x40, drm_mga_init_t)
-#define DRM_IOCTL_MGA_FLUSH DRM_IOW( 0x41, drm_lock_t)
-#define DRM_IOCTL_MGA_RESET DRM_IO( 0x42)
-#define DRM_IOCTL_MGA_SWAP DRM_IO( 0x43)
-#define DRM_IOCTL_MGA_CLEAR DRM_IOW( 0x44, drm_mga_clear_t)
-#define DRM_IOCTL_MGA_VERTEX DRM_IOW( 0x45, drm_mga_vertex_t)
-#define DRM_IOCTL_MGA_INDICES DRM_IOW( 0x46, drm_mga_indices_t)
-#define DRM_IOCTL_MGA_ILOAD DRM_IOW( 0x47, drm_mga_iload_t)
-#define DRM_IOCTL_MGA_BLIT DRM_IOW( 0x48, drm_mga_blit_t)
-
-/* i810 specific ioctls */
-#define DRM_IOCTL_I810_INIT DRM_IOW( 0x40, drm_i810_init_t)
-#define DRM_IOCTL_I810_VERTEX DRM_IOW( 0x41, drm_i810_vertex_t)
-#define DRM_IOCTL_I810_CLEAR DRM_IOW( 0x42, drm_i810_clear_t)
-#define DRM_IOCTL_I810_FLUSH DRM_IO( 0x43)
-#define DRM_IOCTL_I810_GETAGE DRM_IO( 0x44)
-#define DRM_IOCTL_I810_GETBUF DRM_IOWR(0x45, drm_i810_dma_t)
-#define DRM_IOCTL_I810_SWAP DRM_IO( 0x46)
-#define DRM_IOCTL_I810_COPY DRM_IOW( 0x47, drm_i810_copy_t)
-#define DRM_IOCTL_I810_DOCOPY DRM_IO( 0x48)
-#define DRM_IOCTL_I810_OV0INFO DRM_IOR( 0x49, drm_i810_overlay_t)
-#define DRM_IOCTL_I810_FSTATUS DRM_IO ( 0x4a)
-#define DRM_IOCTL_I810_OV0FLIP DRM_IO ( 0x4b)
-#define DRM_IOCTL_I810_MC DRM_IOW( 0x4c, drm_i810_mc_t)
-#define DRM_IOCTL_I810_RSTATUS DRM_IO ( 0x4d )
-
-
-/* Rage 128 specific ioctls */
-#define DRM_IOCTL_R128_INIT DRM_IOW( 0x40, drm_r128_init_t)
-#define DRM_IOCTL_R128_CCE_START DRM_IO( 0x41)
-#define DRM_IOCTL_R128_CCE_STOP DRM_IOW( 0x42, drm_r128_cce_stop_t)
-#define DRM_IOCTL_R128_CCE_RESET DRM_IO( 0x43)
-#define DRM_IOCTL_R128_CCE_IDLE DRM_IO( 0x44)
-#define DRM_IOCTL_R128_RESET DRM_IO( 0x46)
-#define DRM_IOCTL_R128_SWAP DRM_IO( 0x47)
-#define DRM_IOCTL_R128_CLEAR DRM_IOW( 0x48, drm_r128_clear_t)
-#define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x49, drm_r128_vertex_t)
-#define DRM_IOCTL_R128_INDICES DRM_IOW( 0x4a, drm_r128_indices_t)
-#define DRM_IOCTL_R128_BLIT DRM_IOW( 0x4b, drm_r128_blit_t)
-#define DRM_IOCTL_R128_DEPTH DRM_IOW( 0x4c, drm_r128_depth_t)
-#define DRM_IOCTL_R128_STIPPLE DRM_IOW( 0x4d, drm_r128_stipple_t)
-#define DRM_IOCTL_R128_INDIRECT DRM_IOWR(0x4f, drm_r128_indirect_t)
-#define DRM_IOCTL_R128_FULLSCREEN DRM_IOW( 0x50, drm_r128_fullscreen_t)
-#define DRM_IOCTL_R128_CLEAR2 DRM_IOW( 0x51, drm_r128_clear2_t)
-
-/* Radeon specific ioctls */
-#define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( 0x40, drm_radeon_init_t)
-#define DRM_IOCTL_RADEON_CP_START DRM_IO( 0x41)
-#define DRM_IOCTL_RADEON_CP_STOP DRM_IOW( 0x42, drm_radeon_cp_stop_t)
-#define DRM_IOCTL_RADEON_CP_RESET DRM_IO( 0x43)
-#define DRM_IOCTL_RADEON_CP_IDLE DRM_IO( 0x44)
-#define DRM_IOCTL_RADEON_RESET DRM_IO( 0x45)
-#define DRM_IOCTL_RADEON_FULLSCREEN DRM_IOW( 0x46, drm_radeon_fullscreen_t)
-#define DRM_IOCTL_RADEON_SWAP DRM_IO( 0x47)
-#define DRM_IOCTL_RADEON_CLEAR DRM_IOW( 0x48, drm_radeon_clear_t)
-#define DRM_IOCTL_RADEON_VERTEX DRM_IOW( 0x49, drm_radeon_vertex_t)
-#define DRM_IOCTL_RADEON_INDICES DRM_IOW( 0x4a, drm_radeon_indices_t)
-#define DRM_IOCTL_RADEON_STIPPLE DRM_IOW( 0x4c, drm_radeon_stipple_t)
-#define DRM_IOCTL_RADEON_INDIRECT DRM_IOWR(0x4d, drm_radeon_indirect_t)
-#define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(0x4e, drm_radeon_texture_t)
-#define DRM_IOCTL_RADEON_VERTEX2 DRM_IOW( 0x4f, drm_radeon_vertex_t)
-
-/* Gamma specific ioctls */
-#define DRM_IOCTL_GAMMA_INIT DRM_IOW( 0x40, drm_gamma_init_t)
-#define DRM_IOCTL_GAMMA_COPY DRM_IOW( 0x41, drm_gamma_copy_t)
-
-/* SiS specific ioctls */
-#define SIS_IOCTL_FB_ALLOC DRM_IOWR(0x44, drm_sis_mem_t)
-#define SIS_IOCTL_FB_FREE DRM_IOW( 0x45, drm_sis_mem_t)
-#define SIS_IOCTL_AGP_INIT DRM_IOWR(0x53, drm_sis_agp_t)
-#define SIS_IOCTL_AGP_ALLOC DRM_IOWR(0x54, drm_sis_mem_t)
-#define SIS_IOCTL_AGP_FREE DRM_IOW( 0x55, drm_sis_mem_t)
-#define SIS_IOCTL_FLIP DRM_IOW( 0x48, drm_sis_flip_t)
-#define SIS_IOCTL_FLIP_INIT DRM_IO( 0x49)
-#define SIS_IOCTL_FLIP_FINAL DRM_IO( 0x50)
-
-/* I830 specific ioctls */
-#define DRM_IOCTL_I830_INIT DRM_IOW( 0x40, drm_i830_init_t)
-#define DRM_IOCTL_I830_VERTEX DRM_IOW( 0x41, drm_i830_vertex_t)
-#define DRM_IOCTL_I830_CLEAR DRM_IOW( 0x42, drm_i830_clear_t)
-#define DRM_IOCTL_I830_FLUSH DRM_IO ( 0x43)
-#define DRM_IOCTL_I830_GETAGE DRM_IO ( 0x44)
-#define DRM_IOCTL_I830_GETBUF DRM_IOWR(0x45, drm_i830_dma_t)
-#define DRM_IOCTL_I830_SWAP DRM_IO ( 0x46)
-#define DRM_IOCTL_I830_COPY DRM_IOW( 0x47, drm_i830_copy_t)
-#define DRM_IOCTL_I830_DOCOPY DRM_IO ( 0x48)
+#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, drm_wait_vblank_t)
+
+/* Device specfic ioctls should only be in their respective headers
+ * The device specific ioctl range is 0x40 to 0x79. */
+#define DRM_COMMAND_BASE 0x40
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h
index 39190b1f7..c20166e29 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h
@@ -489,7 +489,6 @@ typedef struct drm_agp_mem {
typedef struct drm_agp_head {
agp_kern_info agp_info;
- const char *chipset;
drm_agp_mem_t *memory;
unsigned long mode;
int enabled;
@@ -521,6 +520,17 @@ typedef struct drm_map_list {
typedef drm_map_t drm_local_map_t;
+#if __HAVE_VBL_IRQ
+
+typedef struct drm_vbl_sig {
+ struct list_head head;
+ unsigned int sequence;
+ struct siginfo info;
+ struct task_struct *task;
+} drm_vbl_sig_t;
+
+#endif
+
typedef struct drm_device {
const char *name; /* Simple driver name */
char *unique; /* Unique identifier: e.g., busid */
@@ -583,6 +593,9 @@ typedef struct drm_device {
#if __HAVE_VBL_IRQ
wait_queue_head_t vbl_queue;
atomic_t vbl_received;
+ spinlock_t vbl_lock;
+ drm_vbl_sig_t vbl_sigs;
+ unsigned int vbl_pending;
#endif
cycles_t ctx_start;
cycles_t lck_start;
@@ -823,6 +836,7 @@ extern void DRM(driver_irq_uninstall)( drm_device_t *dev );
extern int DRM(wait_vblank)(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int DRM(vblank_wait)(drm_device_t *dev, unsigned int *vbl_seq);
+extern void DRM(vbl_send_signals)( drm_device_t *dev );
#endif
#if __HAVE_DMA_IRQ_BH
extern void DRM(dma_immediate_bh)( void *dev );
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_agpsupport.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_agpsupport.h
index fc0b29aab..6d6b5911f 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_agpsupport.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_agpsupport.h
@@ -260,60 +260,6 @@ drm_agp_head_t *DRM(agp_init)(void)
return NULL;
}
head->memory = NULL;
- switch (head->agp_info.chipset) {
- case INTEL_GENERIC: head->chipset = "Intel"; break;
- case INTEL_LX: head->chipset = "Intel 440LX"; break;
- case INTEL_BX: head->chipset = "Intel 440BX"; break;
- case INTEL_GX: head->chipset = "Intel 440GX"; break;
- case INTEL_I810: head->chipset = "Intel i810"; break;
-
- case INTEL_I815: head->chipset = "Intel i815"; break;
-#if LINUX_VERSION_CODE >= 0x020415
- case INTEL_I820: head->chipset = "Intel i820"; break;
-#endif
- case INTEL_I840: head->chipset = "Intel i840"; break;
-#if LINUX_VERSION_CODE >= 0x020415
- case INTEL_I845: head->chipset = "Intel i845"; break;
-#endif
- case INTEL_I850: head->chipset = "Intel i850"; break;
-
- case VIA_GENERIC: head->chipset = "VIA"; break;
- case VIA_VP3: head->chipset = "VIA VP3"; break;
- case VIA_MVP3: head->chipset = "VIA MVP3"; break;
- case VIA_MVP4: head->chipset = "VIA MVP4"; break;
- case VIA_APOLLO_KX133: head->chipset = "VIA Apollo KX133";
- break;
- case VIA_APOLLO_KT133: head->chipset = "VIA Apollo KT133";
- break;
-
- case VIA_APOLLO_PRO: head->chipset = "VIA Apollo Pro";
- break;
- case SIS_GENERIC: head->chipset = "SiS"; break;
- case AMD_GENERIC: head->chipset = "AMD"; break;
- case AMD_IRONGATE: head->chipset = "AMD Irongate"; break;
- case ALI_GENERIC: head->chipset = "ALi"; break;
- case ALI_M1541: head->chipset = "ALi M1541"; break;
-
-#if LINUX_VERSION_CODE >= 0x020402
- case ALI_M1621: head->chipset = "ALi M1621"; break;
- case ALI_M1631: head->chipset = "ALi M1631"; break;
- case ALI_M1632: head->chipset = "ALi M1632"; break;
- case ALI_M1641: head->chipset = "ALi M1641"; break;
- case ALI_M1647: head->chipset = "ALi M1647"; break;
- case ALI_M1651: head->chipset = "ALi M1651"; break;
-#endif
-
-#if LINUX_VERSION_CODE >= 0x020406
- case SVWRKS_HE: head->chipset = "Serverworks HE";
- break;
- case SVWRKS_LE: head->chipset = "Serverworks LE";
- break;
- case SVWRKS_GENERIC: head->chipset = "Serverworks Generic";
- break;
-#endif
-
- default: head->chipset = "Unknown"; break;
- }
#if LINUX_VERSION_CODE <= 0x020408
head->cant_use_aperture = 0;
head->page_mask = ~(0xfff);
@@ -321,13 +267,12 @@ drm_agp_head_t *DRM(agp_init)(void)
head->cant_use_aperture = head->agp_info.cant_use_aperture;
head->page_mask = head->agp_info.page_mask;
#endif
-
- DRM_INFO("AGP %d.%d on %s @ 0x%08lx %ZuMB\n",
- head->agp_info.version.major,
- head->agp_info.version.minor,
- head->chipset,
- head->agp_info.aper_base,
- head->agp_info.aper_size);
+
+ DRM_DEBUG("AGP %d.%d, aperture @ 0x%08lx %ZuMB\n",
+ head->agp_info.version.major,
+ head->agp_info.version.minor,
+ head->agp_info.aper_base,
+ head->agp_info.aper_size);
}
return head;
}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_dma.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_dma.h
index dce376f6c..df4ed809f 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_dma.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_dma.h
@@ -538,8 +538,18 @@ int DRM(irq_install)( drm_device_t *dev, int irq )
dev->tq.data = dev;
#endif
+#if __HAVE_VBL_IRQ
+ init_waitqueue_head(&dev->vbl_queue);
+
+ spin_lock_init( &dev->vbl_lock );
+
+ INIT_LIST_HEAD( &dev->vbl_sigs.head );
+
+ dev->vbl_pending = 0;
+#endif
+
/* Before installing handler */
- DRIVER_PREINSTALL();
+ DRM(driver_irq_preinstall)(dev);
/* Install handler */
ret = request_irq( dev->irq, DRM(dma_service),
@@ -552,7 +562,7 @@ int DRM(irq_install)( drm_device_t *dev, int irq )
}
/* After installing handler */
- DRIVER_POSTINSTALL();
+ DRM(driver_irq_postinstall)(dev);
return 0;
}
@@ -571,7 +581,7 @@ int DRM(irq_uninstall)( drm_device_t *dev )
DRM_DEBUG( "%s: irq=%d\n", __FUNCTION__, irq );
- DRIVER_UNINSTALL();
+ DRM(driver_irq_uninstall)( dev );
free_irq( irq, dev );
@@ -598,6 +608,123 @@ int DRM(control)( struct inode *inode, struct file *filp,
}
}
+#if __HAVE_VBL_IRQ
+
+int DRM(wait_vblank)( DRM_IOCTL_ARGS )
+{
+ drm_file_t *priv = filp->private_data;
+ drm_device_t *dev = priv->dev;
+ drm_wait_vblank_t vblwait;
+ struct timeval now;
+ int ret = 0;
+ unsigned int flags;
+
+ if (!dev->irq)
+ return -EINVAL;
+
+ DRM_COPY_FROM_USER_IOCTL( vblwait, (drm_wait_vblank_t *)data,
+ sizeof(vblwait) );
+
+ switch ( vblwait.request.type & ~_DRM_VBLANK_FLAGS_MASK ) {
+ case _DRM_VBLANK_RELATIVE:
+ vblwait.request.sequence += atomic_read( &dev->vbl_received );
+ vblwait.request.type &= ~_DRM_VBLANK_RELATIVE;
+ case _DRM_VBLANK_ABSOLUTE:
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ flags = vblwait.request.type & _DRM_VBLANK_FLAGS_MASK;
+
+ if ( flags & _DRM_VBLANK_SIGNAL ) {
+ unsigned long irqflags;
+ drm_vbl_sig_t *vbl_sig;
+
+ vblwait.reply.sequence = atomic_read( &dev->vbl_received );
+
+ spin_lock_irqsave( &dev->vbl_lock, irqflags );
+
+ /* Check if this task has already scheduled the same signal
+ * for the same vblank sequence number; nothing to be done in
+ * that case
+ */
+ list_for_each( ( (struct list_head *) vbl_sig ), &dev->vbl_sigs.head ) {
+ if (vbl_sig->sequence == vblwait.request.sequence
+ && vbl_sig->info.si_signo == vblwait.request.signal
+ && vbl_sig->task == current)
+ {
+ spin_unlock_irqrestore( &dev->vbl_lock, irqflags );
+ goto done;
+ }
+ }
+
+ if ( dev->vbl_pending >= 100 ) {
+ spin_unlock_irqrestore( &dev->vbl_lock, irqflags );
+ return -EBUSY;
+ }
+
+ dev->vbl_pending++;
+
+ spin_unlock_irqrestore( &dev->vbl_lock, irqflags );
+
+ if ( !( vbl_sig = DRM_MALLOC( sizeof( drm_vbl_sig_t ) ) ) ) {
+ return -ENOMEM;
+ }
+
+ memset( (void *)vbl_sig, 0, sizeof(*vbl_sig) );
+
+ vbl_sig->sequence = vblwait.request.sequence;
+ vbl_sig->info.si_signo = vblwait.request.signal;
+ vbl_sig->task = current;
+
+ spin_lock_irqsave( &dev->vbl_lock, irqflags );
+
+ list_add_tail( (struct list_head *) vbl_sig, &dev->vbl_sigs.head );
+
+ spin_unlock_irqrestore( &dev->vbl_lock, irqflags );
+ } else {
+ ret = DRM(vblank_wait)( dev, &vblwait.request.sequence );
+
+ do_gettimeofday( &now );
+ vblwait.reply.tval_sec = now.tv_sec;
+ vblwait.reply.tval_usec = now.tv_usec;
+ }
+
+done:
+ DRM_COPY_TO_USER_IOCTL( (drm_wait_vblank_t *)data, vblwait,
+ sizeof(vblwait) );
+
+ return ret;
+}
+
+void DRM(vbl_send_signals)( drm_device_t *dev )
+{
+ struct list_head *tmp;
+ drm_vbl_sig_t *vbl_sig;
+ unsigned int vbl_seq = atomic_read( &dev->vbl_received );
+ unsigned long flags;
+
+ spin_lock_irqsave( &dev->vbl_lock, flags );
+
+ list_for_each_safe( ( (struct list_head *) vbl_sig ), tmp, &dev->vbl_sigs.head ) {
+ if ( ( vbl_seq - vbl_sig->sequence ) <= (1<<23) ) {
+ vbl_sig->info.si_code = vbl_seq;
+ send_sig_info( vbl_sig->info.si_signo, &vbl_sig->info, vbl_sig->task );
+
+ list_del( (struct list_head *) vbl_sig );
+
+ DRM_FREE( vbl_sig );
+
+ dev->vbl_pending--;
+ }
+ }
+
+ spin_unlock_irqrestore( &dev->vbl_lock, flags );
+}
+
+#endif /* __HAVE_VBL_IRQ */
+
#else
int DRM(control)( struct inode *inode, struct file *filp,
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_proc.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_proc.h
index 24e8556fc..d29db7b7b 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_proc.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_proc.h
@@ -449,7 +449,8 @@ static int DRM(_vma_info)(char *buf, char **start, off_t offset, int request,
for (i = vma->vm_start; i < vma->vm_end; i += PAGE_SIZE) {
pgd = pgd_offset(vma->vm_mm, i);
pmd = pmd_offset(pgd, i);
- pte = pte_offset(pmd, i);
+ preempt_disable();
+ pte = pte_offset_map(pmd, i);
if (pte_present(*pte)) {
address = __pa(pte_page(*pte))
+ (i & (PAGE_SIZE-1));
@@ -465,6 +466,8 @@ static int DRM(_vma_info)(char *buf, char **start, off_t offset, int request,
} else {
DRM_PROC_PRINT(" 0x%08lx\n", i);
}
+ pte_unmap(pte);
+ preempt_enable();
}
#endif
}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c
index ffe7f669a..004a7eb69 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c
@@ -26,15 +26,31 @@
*
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
* Jeff Hartmann <jhartmann@valinux.com>
- * Keith Whitwell <keith_whitwell@yahoo.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*
*/
#define __NO_VERSION__
#include "i810.h"
#include "drmP.h"
+#include "drm.h"
+#include "i810_drm.h"
#include "i810_drv.h"
#include <linux/interrupt.h> /* For task queue support */
+#include <linux/delay.h>
+#include <linux/pagemap.h>
+
+#ifdef DO_MUNMAP_4_ARGS
+#define DO_MUNMAP(m, a, l) do_munmap(m, a, l, 1)
+#else
+#define DO_MUNMAP(m, a, l) do_munmap(m, a, l)
+#endif
+
+#ifdef DO_MUNMAP_4_ARGS
+#define DO_MUNMAP(m, a, l) do_munmap(m, a, l, 1)
+#else
+#define DO_MUNMAP(m, a, l) do_munmap(m, a, l)
+#endif
#define I810_BUF_FREE 2
#define I810_BUF_CLIENT 1
@@ -127,14 +143,14 @@ static int i810_freelist_put(drm_device_t *dev, drm_buf_t *buf)
}
static struct file_operations i810_buffer_fops = {
- open: DRM(open),
- flush: DRM(flush),
- release: DRM(release),
- ioctl: DRM(ioctl),
- mmap: i810_mmap_buffers,
- read: DRM(read),
- fasync: DRM(fasync),
- poll: DRM(poll),
+ .open = DRM(open),
+ .flush = DRM(flush),
+ .release = DRM(release),
+ .ioctl = DRM(ioctl),
+ .mmap = i810_mmap_buffers,
+ .read = DRM(read),
+ .fasync = DRM(fasync),
+ .poll = DRM(poll),
};
int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
@@ -157,7 +173,7 @@ int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
buf_priv->currently_mapped = I810_BUF_MAPPED;
unlock_kernel();
- if (remap_page_range(vma->vm_start,
+ if (remap_page_range(DRM_RPR_ARG(vma) vma->vm_start,
VM_OFFSET(vma),
vma->vm_end - vma->vm_start,
vma->vm_page_prot)) return -EAGAIN;
@@ -215,7 +231,7 @@ static int i810_unmap_buffer(drm_buf_t *buf)
#else
down_write( &current->mm->mmap_sem );
#endif
- retcode = do_munmap(current->mm,
+ retcode = DO_MUNMAP(current->mm,
(unsigned long)buf_priv->virtual,
(size_t) buf->total);
#if LINUX_VERSION_CODE <= 0x020402
@@ -303,8 +319,6 @@ static int i810_wait_ring(drm_device_t *dev, int n)
end = jiffies + (HZ*3);
while (ring->space < n) {
- int i;
-
ring->head = I810_READ(LP_RING + RING_HEAD) & HEAD_ADDR;
ring->space = ring->head - (ring->tail+8);
if (ring->space < 0) ring->space += ring->Size;
@@ -318,8 +332,7 @@ static int i810_wait_ring(drm_device_t *dev, int n)
DRM_ERROR("lockup\n");
goto out_wait_ring;
}
-
- for (i = 0 ; i < 2000 ; i++) ;
+ udelay(1);
}
out_wait_ring:
@@ -1178,7 +1191,8 @@ int i810_ov0_info(struct inode *inode, struct file *filp,
data.offset = dev_priv->overlay_offset;
data.physical = dev_priv->overlay_physical;
- copy_to_user((drm_i810_overlay_t *)arg,&data,sizeof(data));
+ if (copy_to_user((drm_i810_overlay_t *)arg,&data,sizeof(data)))
+ return -EFAULT;
return 0;
}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.c
index 95880a482..f55cf6ab4 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.c
@@ -50,15 +50,16 @@ set_t *setInit(void)
set_t *set;
set = (set_t *)MALLOC(sizeof(set_t));
- for(i = 0; i < SET_SIZE; i++){
- set->list[i].free_next = i+1;
- set->list[i].alloc_next = -1;
- }
- set->list[SET_SIZE-1].free_next = -1;
- set->free = 0;
- set->alloc = -1;
- set->trace = -1;
-
+ if (set) {
+ for(i = 0; i < SET_SIZE; i++){
+ set->list[i].free_next = i+1;
+ set->list[i].alloc_next = -1;
+ }
+ set->list[SET_SIZE-1].free_next = -1;
+ set->free = 0;
+ set->alloc = -1;
+ set->trace = -1;
+ }
return set;
}
@@ -172,7 +173,8 @@ static void *calloc(size_t nmemb, size_t size)
{
void *addr;
addr = kmalloc(nmemb*size, GFP_KERNEL);
- memset(addr, 0, nmemb*size);
+ if (addr)
+ memset(addr, 0, nmemb*size);
return addr;
}
#define free(n) kfree(n)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c
index 4ff2ebf1e..23e6ac3d4 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c
@@ -248,6 +248,7 @@ static int drmOpenDevice(long dev, int minor)
fd = open(buf, O_RDWR, 0);
drmMsg("drmOpenDevice: open result is %d, (%s)\n",
fd, fd < 0 ? strerror(errno) : "OK");
+ if (fd >= 0) return fd;
drmMsg("drmOpenDevice: Open failed\n");
remove(buf);
@@ -1107,6 +1108,7 @@ int drmWaitVBlank(int fd, drmVBlankPtr vbl)
do {
ret = ioctl(fd, DRM_IOCTL_WAIT_VBLANK, vbl);
+ vbl->request.type &= ~DRM_VBLANK_RELATIVE;
} while (ret && errno == EINTR);
return ret;
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c
index 5de1089af..fb6ec15df 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c
@@ -89,9 +89,16 @@ GARTInit(int screenNum)
xf86ReleaseGART(-1);
#if defined(linux)
- /* Should this look for version >= rather than version == ? */
- if (agpinf.version.major != AGPGART_MAJOR_VERSION &&
- agpinf.version.minor != AGPGART_MINOR_VERSION) {
+ /* Per Dave Jones, every effort will be made to keep the
+ * agpgart interface backwards compatible, so allow all
+ * future versions.
+ */
+ if (
+#if (AGPGART_MAJOR_VERSION > 0) /* quiet compiler */
+ agpinf.version.major < AGPGART_MAJOR_VERSION ||
+#endif
+ (agpinf.version.major == AGPGART_MAJOR_VERSION &&
+ agpinf.version.minor < AGPGART_MINOR_VERSION)) {
xf86DrvMsg(screenNum, X_ERROR,
"GARTInit: Kernel agpgart driver version is not current"
" (%d.%d vs %d.%d)\n",
@@ -262,6 +269,10 @@ xf86BindGARTMemory(int screenNum, int key, unsigned long offset)
}
pageOffset = offset / AGP_PAGE_SIZE;
+ xf86DrvMsgVerb(screenNum, X_INFO, 3,
+ "xf86BindGARTMemory: bind key %d at 0x%08x "
+ "(pgoffset %d)\n", key, offset, pageOffset);
+
bind.pg_start = pageOffset;
bind.key = key;
@@ -302,6 +313,9 @@ xf86UnbindGARTMemory(int screenNum, int key)
return FALSE;
}
+ xf86DrvMsgVerb(screenNum, X_INFO, 3,
+ "xf86UnbindGARTMemory: unbind key %d\n", key);
+
return TRUE;
}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h
index 79dd58142..d1d669437 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h
@@ -38,10 +38,27 @@
#if defined(__linux__)
#include <linux/config.h>
#include <asm/ioctl.h> /* For _IO* macros */
-#define DRM_IOCTL_NR(n) _IOC_NR(n)
-#elif defined(__FreeBSD__)
+#define DRM_IOCTL_NR(n) _IOC_NR(n)
+#define DRM_IOC_VOID _IOC_NONE
+#define DRM_IOC_READ _IOC_READ
+#define DRM_IOC_WRITE _IOC_WRITE
+#define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE
+#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
+#elif defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__FreeBSD__) && defined(XFree86Server)
+/* Prevent name collision when including sys/ioccom.h */
+#undef ioctl
#include <sys/ioccom.h>
-#define DRM_IOCTL_NR(n) ((n) & 0xff)
+#define ioctl(a,b,c) xf86ioctl(a,b,c)
+#else
+#include <sys/ioccom.h>
+#endif /* __FreeBSD__ && xf86ioctl */
+#define DRM_IOCTL_NR(n) ((n) & 0xff)
+#define DRM_IOC_VOID IOC_VOID
+#define DRM_IOC_READ IOC_OUT
+#define DRM_IOC_WRITE IOC_IN
+#define DRM_IOC_READWRITE IOC_INOUT
+#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
#endif
#define XFREE86_VERSION(major,minor,patch,snap) \
@@ -84,6 +101,10 @@ typedef unsigned int drm_magic_t;
/* Warning: If you change this structure, make sure you change
* XF86DRIClipRectRec in the server as well */
+/* KW: Actually it's illegal to change either for
+ * backwards-compatibility reasons.
+ */
+
typedef struct drm_clip_rect {
unsigned short x1;
unsigned short y1;
@@ -99,15 +120,6 @@ typedef struct drm_tex_region {
unsigned int age;
} drm_tex_region_t;
-/* Seperate include files for the i810/mga/r128 specific structures */
-#include "mga_drm.h"
-#include "i810_drm.h"
-#include "r128_drm.h"
-#include "radeon_drm.h"
-#include "sis_drm.h"
-#include "i830_drm.h"
-#include "gamma_drm.h"
-
typedef struct drm_version {
int version_major; /* Major version */
int version_minor; /* Minor version */
@@ -333,6 +345,32 @@ typedef struct drm_irq_busid {
int funcnum;
} drm_irq_busid_t;
+typedef enum {
+ _DRM_VBLANK_ABSOLUTE = 0x0, /* Wait for specific vblank sequence number */
+ _DRM_VBLANK_RELATIVE = 0x1, /* Wait for given number of vblanks */
+ _DRM_VBLANK_SIGNAL = 0x40000000 /* Send signal instead of blocking */
+} drm_vblank_seq_type_t;
+
+#define _DRM_VBLANK_FLAGS_MASK _DRM_VBLANK_SIGNAL
+
+struct drm_wait_vblank_request {
+ drm_vblank_seq_type_t type;
+ unsigned int sequence;
+ unsigned long signal;
+};
+
+struct drm_wait_vblank_reply {
+ drm_vblank_seq_type_t type;
+ unsigned int sequence;
+ long tval_sec;
+ long tval_usec;
+};
+
+typedef union drm_wait_vblank {
+ struct drm_wait_vblank_request request;
+ struct drm_wait_vblank_reply reply;
+} drm_wait_vblank_t;
+
typedef struct drm_agp_mode {
unsigned long mode;
} drm_agp_mode_t;
@@ -372,10 +410,9 @@ typedef struct drm_scatter_gather {
#define DRM_IOCTL_BASE 'd'
#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr)
-#define DRM_IOR(nr,size) _IOR(DRM_IOCTL_BASE,nr,size)
-#define DRM_IOW(nr,size) _IOW(DRM_IOCTL_BASE,nr,size)
-#define DRM_IOWR(nr,size) _IOWR(DRM_IOCTL_BASE,nr,size)
-
+#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type)
+#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type)
+#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type)
#define DRM_IOCTL_VERSION DRM_IOWR(0x00, drm_version_t)
#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, drm_unique_t)
@@ -428,92 +465,10 @@ typedef struct drm_scatter_gather {
#define DRM_IOCTL_SG_ALLOC DRM_IOW( 0x38, drm_scatter_gather_t)
#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, drm_scatter_gather_t)
-/* MGA specific ioctls */
-#define DRM_IOCTL_MGA_INIT DRM_IOW( 0x40, drm_mga_init_t)
-#define DRM_IOCTL_MGA_FLUSH DRM_IOW( 0x41, drm_lock_t)
-#define DRM_IOCTL_MGA_RESET DRM_IO( 0x42)
-#define DRM_IOCTL_MGA_SWAP DRM_IO( 0x43)
-#define DRM_IOCTL_MGA_CLEAR DRM_IOW( 0x44, drm_mga_clear_t)
-#define DRM_IOCTL_MGA_VERTEX DRM_IOW( 0x45, drm_mga_vertex_t)
-#define DRM_IOCTL_MGA_INDICES DRM_IOW( 0x46, drm_mga_indices_t)
-#define DRM_IOCTL_MGA_ILOAD DRM_IOW( 0x47, drm_mga_iload_t)
-#define DRM_IOCTL_MGA_BLIT DRM_IOW( 0x48, drm_mga_blit_t)
-
-/* i810 specific ioctls */
-#define DRM_IOCTL_I810_INIT DRM_IOW( 0x40, drm_i810_init_t)
-#define DRM_IOCTL_I810_VERTEX DRM_IOW( 0x41, drm_i810_vertex_t)
-#define DRM_IOCTL_I810_CLEAR DRM_IOW( 0x42, drm_i810_clear_t)
-#define DRM_IOCTL_I810_FLUSH DRM_IO( 0x43)
-#define DRM_IOCTL_I810_GETAGE DRM_IO( 0x44)
-#define DRM_IOCTL_I810_GETBUF DRM_IOWR(0x45, drm_i810_dma_t)
-#define DRM_IOCTL_I810_SWAP DRM_IO( 0x46)
-#define DRM_IOCTL_I810_COPY DRM_IOW( 0x47, drm_i810_copy_t)
-#define DRM_IOCTL_I810_DOCOPY DRM_IO( 0x48)
-#define DRM_IOCTL_I810_OV0INFO DRM_IOR( 0x49, drm_i810_overlay_t)
-#define DRM_IOCTL_I810_FSTATUS DRM_IO ( 0x4a)
-#define DRM_IOCTL_I810_OV0FLIP DRM_IO ( 0x4b)
-#define DRM_IOCTL_I810_MC DRM_IOW( 0x4c, drm_i810_mc_t)
-#define DRM_IOCTL_I810_RSTATUS DRM_IO ( 0x4d )
-
-
-/* Rage 128 specific ioctls */
-#define DRM_IOCTL_R128_INIT DRM_IOW( 0x40, drm_r128_init_t)
-#define DRM_IOCTL_R128_CCE_START DRM_IO( 0x41)
-#define DRM_IOCTL_R128_CCE_STOP DRM_IOW( 0x42, drm_r128_cce_stop_t)
-#define DRM_IOCTL_R128_CCE_RESET DRM_IO( 0x43)
-#define DRM_IOCTL_R128_CCE_IDLE DRM_IO( 0x44)
-#define DRM_IOCTL_R128_RESET DRM_IO( 0x46)
-#define DRM_IOCTL_R128_SWAP DRM_IO( 0x47)
-#define DRM_IOCTL_R128_CLEAR DRM_IOW( 0x48, drm_r128_clear_t)
-#define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x49, drm_r128_vertex_t)
-#define DRM_IOCTL_R128_INDICES DRM_IOW( 0x4a, drm_r128_indices_t)
-#define DRM_IOCTL_R128_BLIT DRM_IOW( 0x4b, drm_r128_blit_t)
-#define DRM_IOCTL_R128_DEPTH DRM_IOW( 0x4c, drm_r128_depth_t)
-#define DRM_IOCTL_R128_STIPPLE DRM_IOW( 0x4d, drm_r128_stipple_t)
-#define DRM_IOCTL_R128_INDIRECT DRM_IOWR(0x4f, drm_r128_indirect_t)
-#define DRM_IOCTL_R128_FULLSCREEN DRM_IOW( 0x50, drm_r128_fullscreen_t)
-#define DRM_IOCTL_R128_CLEAR2 DRM_IOW( 0x51, drm_r128_clear2_t)
-
-/* Radeon specific ioctls */
-#define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( 0x40, drm_radeon_init_t)
-#define DRM_IOCTL_RADEON_CP_START DRM_IO( 0x41)
-#define DRM_IOCTL_RADEON_CP_STOP DRM_IOW( 0x42, drm_radeon_cp_stop_t)
-#define DRM_IOCTL_RADEON_CP_RESET DRM_IO( 0x43)
-#define DRM_IOCTL_RADEON_CP_IDLE DRM_IO( 0x44)
-#define DRM_IOCTL_RADEON_RESET DRM_IO( 0x45)
-#define DRM_IOCTL_RADEON_FULLSCREEN DRM_IOW( 0x46, drm_radeon_fullscreen_t)
-#define DRM_IOCTL_RADEON_SWAP DRM_IO( 0x47)
-#define DRM_IOCTL_RADEON_CLEAR DRM_IOW( 0x48, drm_radeon_clear_t)
-#define DRM_IOCTL_RADEON_VERTEX DRM_IOW( 0x49, drm_radeon_vertex_t)
-#define DRM_IOCTL_RADEON_INDICES DRM_IOW( 0x4a, drm_radeon_indices_t)
-#define DRM_IOCTL_RADEON_STIPPLE DRM_IOW( 0x4c, drm_radeon_stipple_t)
-#define DRM_IOCTL_RADEON_INDIRECT DRM_IOWR(0x4d, drm_radeon_indirect_t)
-#define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(0x4e, drm_radeon_texture_t)
-#define DRM_IOCTL_RADEON_VERTEX2 DRM_IOW( 0x4f, drm_radeon_vertex_t)
-
-/* Gamma specific ioctls */
-#define DRM_IOCTL_GAMMA_INIT DRM_IOW( 0x40, drm_gamma_init_t)
-#define DRM_IOCTL_GAMMA_COPY DRM_IOW( 0x41, drm_gamma_copy_t)
-
-/* SiS specific ioctls */
-#define SIS_IOCTL_FB_ALLOC DRM_IOWR(0x44, drm_sis_mem_t)
-#define SIS_IOCTL_FB_FREE DRM_IOW( 0x45, drm_sis_mem_t)
-#define SIS_IOCTL_AGP_INIT DRM_IOWR(0x53, drm_sis_agp_t)
-#define SIS_IOCTL_AGP_ALLOC DRM_IOWR(0x54, drm_sis_mem_t)
-#define SIS_IOCTL_AGP_FREE DRM_IOW( 0x55, drm_sis_mem_t)
-#define SIS_IOCTL_FLIP DRM_IOW( 0x48, drm_sis_flip_t)
-#define SIS_IOCTL_FLIP_INIT DRM_IO( 0x49)
-#define SIS_IOCTL_FLIP_FINAL DRM_IO( 0x50)
-
-/* I830 specific ioctls */
-#define DRM_IOCTL_I830_INIT DRM_IOW( 0x40, drm_i830_init_t)
-#define DRM_IOCTL_I830_VERTEX DRM_IOW( 0x41, drm_i830_vertex_t)
-#define DRM_IOCTL_I830_CLEAR DRM_IOW( 0x42, drm_i830_clear_t)
-#define DRM_IOCTL_I830_FLUSH DRM_IO ( 0x43)
-#define DRM_IOCTL_I830_GETAGE DRM_IO ( 0x44)
-#define DRM_IOCTL_I830_GETBUF DRM_IOWR(0x45, drm_i830_dma_t)
-#define DRM_IOCTL_I830_SWAP DRM_IO ( 0x46)
-#define DRM_IOCTL_I830_COPY DRM_IOW( 0x47, drm_i830_copy_t)
-#define DRM_IOCTL_I830_DOCOPY DRM_IO ( 0x48)
+#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, drm_wait_vblank_t)
+
+/* Device specfic ioctls should only be in their respective headers
+ * The device specific ioctl range is 0x40 to 0x79. */
+#define DRM_COMMAND_BASE 0x40
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/mga_drv.h b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/mga_drv.h
index d7f85af5b..0e650b428 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/mga_drv.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/mga_drv.h
@@ -142,12 +142,12 @@ extern int mga_warp_init( drm_mga_private_t *dev_priv );
#define MGA_READ( reg ) (_MGA_READ((u32 *)MGA_ADDR(reg)))
#define MGA_READ8( reg ) (_MGA_READ((u8 *)MGA_ADDR(reg)))
-#define MGA_WRITE( reg, val ) do { DRM_WRITEMEMORYBARRIER(); MGA_DEREF( reg ) = val; } while (0)
-#define MGA_WRITE8( reg, val ) do { DRM_WRITEMEMORYBARRIER(); MGA_DEREF8( reg ) = val; } while (0)
+#define MGA_WRITE( reg, val ) do { DRM_WRITEMEMORYBARRIER(dev_priv->mmio); MGA_DEREF( reg ) = val; } while (0)
+#define MGA_WRITE8( reg, val ) do { DRM_WRITEMEMORYBARRIER(dev_priv->mmio); MGA_DEREF8( reg ) = val; } while (0)
static inline u32 _MGA_READ(u32 *addr)
{
- DRM_READMEMORYBARRIER();
+ DRM_READMEMORYBARRIER(dev_priv->mmio);
return *(volatile u32 *)addr;
}
#else
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128.h b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128.h
new file mode 100644
index 000000000..29b26cd2d
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128.h
@@ -0,0 +1,114 @@
+/* r128.h -- ATI Rage 128 DRM template customization -*- linux-c -*-
+ * Created: Wed Feb 14 16:07:10 2001 by gareth@valinux.com
+ *
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Gareth Hughes <gareth@valinux.com>
+ */
+
+#ifndef __R128_H__
+#define __R128_H__
+
+/* This remains constant for all DRM template files.
+ */
+#define DRM(x) r128_##x
+
+/* General customization:
+ */
+#define __HAVE_AGP 1
+#define __MUST_HAVE_AGP 0
+#define __HAVE_MTRR 1
+#define __HAVE_CTX_BITMAP 1
+#define __HAVE_SG 1
+#define __HAVE_PCI_DMA 1
+
+#define DRIVER_AUTHOR "Gareth Hughes, VA Linux Systems Inc."
+
+#define DRIVER_NAME "r128"
+#define DRIVER_DESC "ATI Rage 128"
+#define DRIVER_DATE "20021029"
+
+#define DRIVER_MAJOR 2
+#define DRIVER_MINOR 3
+#define DRIVER_PATCHLEVEL 0
+
+
+#define DRIVER_IOCTLS \
+ [DRM_IOCTL_NR(DRM_IOCTL_DMA)] = { r128_cce_buffers, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_R128_INIT)] = { r128_cce_init, 1, 1 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_R128_CCE_START)] = { r128_cce_start, 1, 1 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_R128_CCE_STOP)] = { r128_cce_stop, 1, 1 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_R128_CCE_RESET)] = { r128_cce_reset, 1, 1 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_R128_CCE_IDLE)] = { r128_cce_idle, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_R128_RESET)] = { r128_engine_reset, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_R128_FULLSCREEN)] = { r128_fullscreen, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_R128_SWAP)] = { r128_cce_swap, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_R128_CLEAR)] = { r128_cce_clear, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_R128_VERTEX)] = { r128_cce_vertex, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_R128_INDICES)] = { r128_cce_indices, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_R128_BLIT)] = { r128_cce_blit, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_R128_DEPTH)] = { r128_cce_depth, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_R128_STIPPLE)] = { r128_cce_stipple, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_R128_INDIRECT)] = { r128_cce_indirect, 1, 1 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_R128_GETPARAM)] = { r128_getparam, 1, 0 },
+
+/* Driver customization:
+ */
+#define DRIVER_PRERELEASE() do { \
+ if ( dev->dev_private ) { \
+ drm_r128_private_t *dev_priv = dev->dev_private; \
+ if ( dev_priv->page_flipping ) { \
+ r128_do_cleanup_pageflip( dev ); \
+ } \
+ } \
+} while (0)
+
+#define DRIVER_PRETAKEDOWN() do { \
+ if ( dev->dev_private ) r128_do_cleanup_cce( dev ); \
+} while (0)
+
+/* DMA customization:
+ */
+#define __HAVE_DMA 1
+#define __HAVE_DMA_IRQ 1
+#define __HAVE_VBL_IRQ 1
+#define __HAVE_SHARED_IRQ 1
+
+#if 0
+/* GH: Remove this for now... */
+#define __HAVE_DMA_QUIESCENT 1
+#define DRIVER_DMA_QUIESCENT() do { \
+ drm_r128_private_t *dev_priv = dev->dev_private; \
+ return r128_do_cce_idle( dev_priv ); \
+} while (0)
+#endif
+
+/* Buffer customization:
+ */
+#define DRIVER_BUF_PRIV_T drm_r128_buf_priv_t
+
+#define DRIVER_AGP_BUFFERS_MAP( dev ) \
+ ((drm_r128_private_t *)((dev)->dev_private))->buffers
+
+#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon.h b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon.h
new file mode 100644
index 000000000..c36accb49
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon.h
@@ -0,0 +1,155 @@
+/* radeon.h -- ATI Radeon DRM template customization -*- linux-c -*-
+ * Created: Wed Feb 14 17:07:34 2001 by gareth@valinux.com
+ *
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Gareth Hughes <gareth@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#ifndef __RADEON_H__
+#define __RADEON_H__
+
+/* This remains constant for all DRM template files.
+ */
+#define DRM(x) radeon_##x
+
+/* General customization:
+ */
+#define __HAVE_AGP 1
+#define __MUST_HAVE_AGP 0
+#define __HAVE_MTRR 1
+#define __HAVE_CTX_BITMAP 1
+#define __HAVE_SG 1
+#define __HAVE_PCI_DMA 1
+
+#define DRIVER_AUTHOR "Gareth Hughes, Keith Whitwell, others."
+
+#define DRIVER_NAME "radeon"
+#define DRIVER_DESC "ATI Radeon"
+#define DRIVER_DATE "20020828"
+
+#define DRIVER_MAJOR 1
+#define DRIVER_MINOR 8
+#define DRIVER_PATCHLEVEL 0
+
+/* Interface history:
+ *
+ * 1.1 - ??
+ * 1.2 - Add vertex2 ioctl (keith)
+ * - Add stencil capability to clear ioctl (gareth, keith)
+ * - Increase MAX_TEXTURE_LEVELS (brian)
+ * 1.3 - Add cmdbuf ioctl (keith)
+ * - Add support for new radeon packets (keith)
+ * - Add getparam ioctl (keith)
+ * - Add flip-buffers ioctl, deprecate fullscreen foo (keith).
+ * 1.4 - Add scratch registers to get_param ioctl.
+ * 1.5 - Add r200 packets to cmdbuf ioctl
+ * - Add r200 function to init ioctl
+ * - Add 'scalar2' instruction to cmdbuf
+ * 1.6 - Add static agp memory manager
+ * Add irq handler (won't be turned on unless X server knows to)
+ * Add irq ioctls and irq_active getparam.
+ * Add wait command for cmdbuf ioctl
+ * Add agp offset query for getparam
+ * 1.7 - Add support for cube map registers: R200_PP_CUBIC_FACES_[0..5]
+ * and R200_PP_CUBIC_OFFSET_F1_[0..5].
+ * Added packets R200_EMIT_PP_CUBIC_FACES_[0..5] and
+ * R200_EMIT_PP_CUBIC_OFFSETS_[0..5]. (brian)
+ * 1.8 - Remove need to call cleanup ioctls on last client exit (keith)
+ */
+#define DRIVER_IOCTLS \
+ [DRM_IOCTL_NR(DRM_IOCTL_DMA)] = { radeon_cp_buffers, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_CP_INIT)] = { radeon_cp_init, 1, 1 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_CP_START)] = { radeon_cp_start, 1, 1 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_CP_STOP)] = { radeon_cp_stop, 1, 1 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_CP_RESET)] = { radeon_cp_reset, 1, 1 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_CP_IDLE)] = { radeon_cp_idle, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_RESET)] = { radeon_engine_reset, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_FULLSCREEN)] = { radeon_fullscreen, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_SWAP)] = { radeon_cp_swap, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_CLEAR)] = { radeon_cp_clear, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_VERTEX)] = { radeon_cp_vertex, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_INDICES)] = { radeon_cp_indices, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_TEXTURE)] = { radeon_cp_texture, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_STIPPLE)] = { radeon_cp_stipple, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_INDIRECT)] = { radeon_cp_indirect, 1, 1 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_VERTEX2)] = { radeon_cp_vertex2, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_CMDBUF)] = { radeon_cp_cmdbuf, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_GETPARAM)] = { radeon_cp_getparam, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_FLIP)] = { radeon_cp_flip, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_ALLOC)] = { radeon_mem_alloc, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_FREE)] = { radeon_mem_free, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_INIT_HEAP)] = { radeon_mem_init_heap, 1, 1 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_IRQ_EMIT)] = { radeon_irq_emit, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_IRQ_WAIT)] = { radeon_irq_wait, 1, 0 },
+
+
+
+/* When a client dies:
+ * - Check for and clean up flipped page state
+ * - Free any alloced agp memory.
+ *
+ * DRM infrastructure takes care of reclaiming dma buffers.
+ */
+#define DRIVER_PRERELEASE() \
+do { \
+ if ( dev->dev_private ) { \
+ drm_radeon_private_t *dev_priv = dev->dev_private; \
+ if ( dev_priv->page_flipping ) { \
+ radeon_do_cleanup_pageflip( dev ); \
+ } \
+ radeon_mem_release( dev_priv->agp_heap ); \
+ radeon_mem_release( dev_priv->fb_heap ); \
+ } \
+} while (0)
+
+/* When the last client dies, shut down the CP and free dev->dev_priv.
+ */
+#define __HAVE_RELEASE 1
+#define DRIVER_RELEASE() \
+do { \
+ DRM(reclaim_buffers)( dev, priv->pid ); \
+ if ( dev->open_count == 1) \
+ radeon_do_release( dev ); \
+} while (0)
+
+
+
+/* DMA customization:
+ */
+#define __HAVE_DMA 1
+#define __HAVE_DMA_IRQ 1
+#define __HAVE_VBL_IRQ 1
+#define __HAVE_SHARED_IRQ 1
+
+
+/* Buffer customization:
+ */
+#define DRIVER_BUF_PRIV_T drm_radeon_buf_priv_t
+
+#define DRIVER_AGP_BUFFERS_MAP( dev ) \
+ ((drm_radeon_private_t *)((dev)->dev_private))->buffers
+
+#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_cp.c b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_cp.c
index d004b681b..89c9eab1b 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_cp.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_cp.c
@@ -1355,6 +1355,9 @@ int radeon_cp_stop( DRM_IOCTL_ARGS )
DRM_COPY_FROM_USER_IOCTL( stop, (drm_radeon_cp_stop_t *)data, sizeof(stop) );
+ if (!dev_priv->cp_running)
+ return 0;
+
/* Flush any pending CP commands. This ensures any outstanding
* commands are exectuted by the engine before we turn it off.
*/
@@ -1382,6 +1385,39 @@ int radeon_cp_stop( DRM_IOCTL_ARGS )
return 0;
}
+
+void radeon_do_release( drm_device_t *dev )
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ int ret;
+
+ if (dev_priv) {
+ if (dev_priv->cp_running) {
+ /* Stop the cp */
+ while ((ret = radeon_do_cp_idle( dev_priv )) != 0) {
+ DRM_DEBUG("radeon_do_cp_idle %d\n", ret);
+#ifdef __linux__
+ schedule();
+#else
+ tsleep(&ret, PZERO, "rdnrel", 1);
+#endif
+ }
+ radeon_do_cp_stop( dev_priv );
+ radeon_do_engine_reset( dev );
+ }
+
+ /* Disable *all* interrupts */
+ RADEON_WRITE( RADEON_GEN_INT_CNTL, 0 );
+
+ /* Free memory heap structures */
+ radeon_mem_takedown( &(dev_priv->agp_heap) );
+ radeon_mem_takedown( &(dev_priv->fb_heap) );
+
+ /* deallocate kernel resources */
+ radeon_do_cleanup_cp( dev );
+ }
+}
+
/* Just reset the CP ring. Called as part of an X Server engine reset.
*/
int radeon_cp_reset( DRM_IOCTL_ARGS )
@@ -1413,9 +1449,6 @@ int radeon_cp_idle( DRM_IOCTL_ARGS )
LOCK_TEST_WITH_RETURN( dev );
-/* if (dev->irq) */
-/* radeon_emit_and_wait_irq( dev ); */
-
return radeon_do_cp_idle( dev_priv );
}
@@ -1498,7 +1531,7 @@ drm_buf_t *radeon_freelist_get( drm_device_t *dev )
}
}
- DRM_ERROR( "returning NULL!\n" );
+ DRM_DEBUG( "returning NULL!\n" );
return NULL;
}
#if 0
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_drm.h b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_drm.h
index 014a96c34..3ab573093 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_drm.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_drm.h
@@ -382,7 +382,7 @@ typedef struct {
#define DRM_IOCTL_RADEON_STIPPLE DRM_IOW( 0x4c, drm_radeon_stipple_t)
#define DRM_IOCTL_RADEON_INDIRECT DRM_IOWR(0x4d, drm_radeon_indirect_t)
#define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(0x4e, drm_radeon_texture_t)
-#define DRM_IOCTL_RADEON_VERTEX2 DRM_IOW( 0x4f, drm_radeon_vertex_t)
+#define DRM_IOCTL_RADEON_VERTEX2 DRM_IOW( 0x4f, drm_radeon_vertex2_t)
#define DRM_IOCTL_RADEON_CMDBUF DRM_IOW( 0x50, drm_radeon_cmd_buffer_t)
#define DRM_IOCTL_RADEON_GETPARAM DRM_IOWR(0x51, drm_radeon_getparam_t)
#define DRM_IOCTL_RADEON_FLIP DRM_IO( 0x52)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_drv.h b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_drv.h
index 882c77fdc..502ba89b4 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_drv.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_drv.h
@@ -194,6 +194,7 @@ extern int radeon_emit_and_wait_irq(drm_device_t *dev);
extern int radeon_wait_irq(drm_device_t *dev, int swi_nr);
extern int radeon_emit_irq(drm_device_t *dev);
+extern void radeon_do_release(drm_device_t *dev);
/* Flags for stats.boxes
*/
@@ -821,13 +822,6 @@ do { \
* Ring control
*/
-#if defined(__powerpc__)
-#define radeon_flush_write_combine() (void) GET_RING_HEAD( &dev_priv->ring )
-#else
-#define radeon_flush_write_combine() DRM_WRITEMEMORYBARRIER( dev_priv->ring_rtpr )
-#endif
-
-
#define RADEON_VERBOSE 0
#define RING_LOCALS int write, _nr; unsigned int mask; u32 *ring;
@@ -861,8 +855,13 @@ do { \
dev_priv->ring.tail = write; \
} while (0)
-#define COMMIT_RING() do { \
- RADEON_WRITE( RADEON_CP_RB_WPTR, dev_priv->ring.tail ); \
+#define COMMIT_RING() do { \
+ /* Flush writes to ring */ \
+ DRM_READMEMORYBARRIER(dev_priv->mmio); \
+ GET_RING_HEAD( &dev_priv->ring ); \
+ RADEON_WRITE( RADEON_CP_RB_WPTR, dev_priv->ring.tail ); \
+ /* read from PCI bus to ensure correct posting */ \
+ RADEON_READ( RADEON_CP_RB_RPTR ); \
} while (0)
#define OUT_RING( x ) do { \
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_irq.c b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_irq.c
new file mode 100644
index 000000000..596706bf3
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_irq.c
@@ -0,0 +1,256 @@
+/* radeon_irq.c -- IRQ handling for radeon -*- linux-c -*-
+ *
+ * Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+ *
+ * The Weather Channel (TM) funded Tungsten Graphics to develop the
+ * initial release of the Radeon 8500 driver under the XFree86 license.
+ * This notice must be preserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ * Michel Dänzer <michel@daenzer.net>
+ */
+
+#include "radeon.h"
+#include "drmP.h"
+#include "drm.h"
+#include "radeon_drm.h"
+#include "radeon_drv.h"
+
+/* Interrupts - Used for device synchronization and flushing in the
+ * following circumstances:
+ *
+ * - Exclusive FB access with hw idle:
+ * - Wait for GUI Idle (?) interrupt, then do normal flush.
+ *
+ * - Frame throttling, NV_fence:
+ * - Drop marker irq's into command stream ahead of time.
+ * - Wait on irq's with lock *not held*
+ * - Check each for termination condition
+ *
+ * - Internally in cp_getbuffer, etc:
+ * - as above, but wait with lock held???
+ *
+ * NOTE: These functions are misleadingly named -- the irq's aren't
+ * tied to dma at all, this is just a hangover from dri prehistory.
+ */
+
+void DRM(dma_service)( DRM_IRQ_ARGS )
+{
+ drm_device_t *dev = (drm_device_t *) arg;
+ drm_radeon_private_t *dev_priv =
+ (drm_radeon_private_t *)dev->dev_private;
+ u32 stat;
+
+ /* Only consider the bits we're interested in - others could be used
+ * outside the DRM
+ */
+ stat = RADEON_READ(RADEON_GEN_INT_STATUS)
+ & (RADEON_SW_INT_TEST | RADEON_CRTC_VBLANK_STAT);
+ if (!stat)
+ return;
+
+ /* SW interrupt */
+ if (stat & RADEON_SW_INT_TEST) {
+ DRM_WAKEUP( &dev_priv->swi_queue );
+ }
+
+ /* VBLANK interrupt */
+ if (stat & RADEON_CRTC_VBLANK_STAT) {
+ atomic_inc(&dev->vbl_received);
+ DRM_WAKEUP(&dev->vbl_queue);
+ DRM(vbl_send_signals)( dev );
+ }
+
+ /* Acknowledge interrupts we handle */
+ RADEON_WRITE(RADEON_GEN_INT_STATUS, stat);
+}
+
+static __inline__ void radeon_acknowledge_irqs(drm_radeon_private_t *dev_priv)
+{
+ u32 tmp = RADEON_READ( RADEON_GEN_INT_STATUS )
+ & (RADEON_SW_INT_TEST_ACK | RADEON_CRTC_VBLANK_STAT);
+ if (tmp)
+ RADEON_WRITE( RADEON_GEN_INT_STATUS, tmp );
+}
+
+int radeon_emit_irq(drm_device_t *dev)
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ unsigned int ret;
+ RING_LOCALS;
+
+ atomic_inc(&dev_priv->swi_emitted);
+ ret = atomic_read(&dev_priv->swi_emitted);
+
+ BEGIN_RING( 4 );
+ OUT_RING_REG( RADEON_LAST_SWI_REG, ret );
+ OUT_RING_REG( RADEON_GEN_INT_STATUS, RADEON_SW_INT_FIRE );
+ ADVANCE_RING();
+ COMMIT_RING();
+
+ return ret;
+}
+
+
+int radeon_wait_irq(drm_device_t *dev, int swi_nr)
+{
+ drm_radeon_private_t *dev_priv =
+ (drm_radeon_private_t *)dev->dev_private;
+ int ret = 0;
+
+ if (RADEON_READ( RADEON_LAST_SWI_REG ) >= swi_nr)
+ return 0;
+
+ dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE;
+
+ /* This is a hack to work around mysterious freezes on certain
+ * systems:
+ */
+ radeon_acknowledge_irqs( dev_priv );
+
+ DRM_WAIT_ON( ret, dev_priv->swi_queue, 3 * DRM_HZ,
+ RADEON_READ( RADEON_LAST_SWI_REG ) >= swi_nr );
+
+ return ret;
+}
+
+int radeon_emit_and_wait_irq(drm_device_t *dev)
+{
+ return radeon_wait_irq( dev, radeon_emit_irq(dev) );
+}
+
+
+int DRM(vblank_wait)(drm_device_t *dev, unsigned int *sequence)
+{
+ drm_radeon_private_t *dev_priv =
+ (drm_radeon_private_t *)dev->dev_private;
+ unsigned int cur_vblank;
+ int ret = 0;
+
+ if ( !dev_priv ) {
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
+ return DRM_ERR(EINVAL);
+ }
+
+ radeon_acknowledge_irqs( dev_priv );
+
+ dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE;
+
+ /* Assume that the user has missed the current sequence number
+ * by about a day rather than she wants to wait for years
+ * using vertical blanks...
+ */
+ DRM_WAIT_ON( ret, dev->vbl_queue, 3*DRM_HZ,
+ ( ( ( cur_vblank = atomic_read(&dev->vbl_received ) )
+ - *sequence ) <= (1<<23) ) );
+
+ *sequence = cur_vblank;
+
+ return ret;
+}
+
+
+/* Needs the lock as it touches the ring.
+ */
+int radeon_irq_emit( DRM_IOCTL_ARGS )
+{
+ DRM_DEVICE;
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_radeon_irq_emit_t emit;
+ int result;
+
+ LOCK_TEST_WITH_RETURN( dev );
+
+ if ( !dev_priv ) {
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
+ return DRM_ERR(EINVAL);
+ }
+
+ DRM_COPY_FROM_USER_IOCTL( emit, (drm_radeon_irq_emit_t *)data,
+ sizeof(emit) );
+
+ result = radeon_emit_irq( dev );
+
+ if ( DRM_COPY_TO_USER( emit.irq_seq, &result, sizeof(int) ) ) {
+ DRM_ERROR( "copy_to_user\n" );
+ return DRM_ERR(EFAULT);
+ }
+
+ return 0;
+}
+
+
+/* Doesn't need the hardware lock.
+ */
+int radeon_irq_wait( DRM_IOCTL_ARGS )
+{
+ DRM_DEVICE;
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_radeon_irq_wait_t irqwait;
+
+ if ( !dev_priv ) {
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
+ return DRM_ERR(EINVAL);
+ }
+
+ DRM_COPY_FROM_USER_IOCTL( irqwait, (drm_radeon_irq_wait_t *)data,
+ sizeof(irqwait) );
+
+ return radeon_wait_irq( dev, irqwait.irq_seq );
+}
+
+
+/* drm_dma.h hooks
+*/
+void DRM(driver_irq_preinstall)( drm_device_t *dev ) {
+ drm_radeon_private_t *dev_priv =
+ (drm_radeon_private_t *)dev->dev_private;
+
+ /* Disable *all* interrupts */
+ RADEON_WRITE( RADEON_GEN_INT_CNTL, 0 );
+
+ /* Clear bits if they're already high */
+ radeon_acknowledge_irqs( dev_priv );
+}
+
+void DRM(driver_irq_postinstall)( drm_device_t *dev ) {
+ drm_radeon_private_t *dev_priv =
+ (drm_radeon_private_t *)dev->dev_private;
+
+ atomic_set(&dev_priv->swi_emitted, 0);
+ DRM_INIT_WAITQUEUE( &dev_priv->swi_queue );
+
+ /* Turn on SW and VBL ints */
+ RADEON_WRITE( RADEON_GEN_INT_CNTL,
+ RADEON_CRTC_VBLANK_MASK |
+ RADEON_SW_INT_ENABLE );
+}
+
+void DRM(driver_irq_uninstall)( drm_device_t *dev ) {
+ drm_radeon_private_t *dev_priv =
+ (drm_radeon_private_t *)dev->dev_private;
+ if ( dev_priv ) {
+ /* Disable *all* interrupts */
+ RADEON_WRITE( RADEON_GEN_INT_CNTL, 0 );
+ }
+}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_mem.c b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_mem.c
index 50b6ee38c..7ca10753a 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_mem.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_mem.c
@@ -130,18 +130,6 @@ static void free_block( struct mem_block *p )
}
}
-#if 0
-static void print_heap( struct mem_block *heap )
-{
- struct mem_block *p;
-
- for (p = heap->next ; p != heap ; p = p->next)
- DRM_DEBUG("0x%x..0x%x (0x%x) -- owner %d\n",
- p->start, p->start + p->size,
- p->size, p->pid);
-}
-#endif
-
/* Initialize. How to check for an uninitialized heap?
*/
static int init_heap(struct mem_block **heap, int start, int size)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_state.c b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_state.c
new file mode 100644
index 000000000..d9bc948c0
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_state.c
@@ -0,0 +1,2202 @@
+/* radeon_state.c -- State support for Radeon -*- linux-c -*-
+ *
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Gareth Hughes <gareth@valinux.com>
+ * Kevin E. Martin <martin@valinux.com>
+ */
+
+#include "radeon.h"
+#include "drmP.h"
+#include "drm.h"
+#include "drm_sarea.h"
+#include "radeon_drm.h"
+#include "radeon_drv.h"
+
+
+/* ================================================================
+ * CP hardware state programming functions
+ */
+
+static __inline__ void radeon_emit_clip_rect( drm_radeon_private_t *dev_priv,
+ drm_clip_rect_t *box )
+{
+ RING_LOCALS;
+
+ DRM_DEBUG( " box: x1=%d y1=%d x2=%d y2=%d\n",
+ box->x1, box->y1, box->x2, box->y2 );
+
+ BEGIN_RING( 4 );
+ OUT_RING( CP_PACKET0( RADEON_RE_TOP_LEFT, 0 ) );
+ OUT_RING( (box->y1 << 16) | box->x1 );
+ OUT_RING( CP_PACKET0( RADEON_RE_WIDTH_HEIGHT, 0 ) );
+ OUT_RING( ((box->y2 - 1) << 16) | (box->x2 - 1) );
+ ADVANCE_RING();
+}
+
+/* Emit 1.1 state
+ */
+static void radeon_emit_state( drm_radeon_private_t *dev_priv,
+ drm_radeon_context_regs_t *ctx,
+ drm_radeon_texture_regs_t *tex,
+ unsigned int dirty )
+{
+ RING_LOCALS;
+ DRM_DEBUG( "dirty=0x%08x\n", dirty );
+
+ if ( dirty & RADEON_UPLOAD_CONTEXT ) {
+ BEGIN_RING( 14 );
+ OUT_RING( CP_PACKET0( RADEON_PP_MISC, 6 ) );
+ OUT_RING( ctx->pp_misc );
+ OUT_RING( ctx->pp_fog_color );
+ OUT_RING( ctx->re_solid_color );
+ OUT_RING( ctx->rb3d_blendcntl );
+ OUT_RING( ctx->rb3d_depthoffset );
+ OUT_RING( ctx->rb3d_depthpitch );
+ OUT_RING( ctx->rb3d_zstencilcntl );
+ OUT_RING( CP_PACKET0( RADEON_PP_CNTL, 2 ) );
+ OUT_RING( ctx->pp_cntl );
+ OUT_RING( ctx->rb3d_cntl );
+ OUT_RING( ctx->rb3d_coloroffset );
+ OUT_RING( CP_PACKET0( RADEON_RB3D_COLORPITCH, 0 ) );
+ OUT_RING( ctx->rb3d_colorpitch );
+ ADVANCE_RING();
+ }
+
+ if ( dirty & RADEON_UPLOAD_VERTFMT ) {
+ BEGIN_RING( 2 );
+ OUT_RING( CP_PACKET0( RADEON_SE_COORD_FMT, 0 ) );
+ OUT_RING( ctx->se_coord_fmt );
+ ADVANCE_RING();
+ }
+
+ if ( dirty & RADEON_UPLOAD_LINE ) {
+ BEGIN_RING( 5 );
+ OUT_RING( CP_PACKET0( RADEON_RE_LINE_PATTERN, 1 ) );
+ OUT_RING( ctx->re_line_pattern );
+ OUT_RING( ctx->re_line_state );
+ OUT_RING( CP_PACKET0( RADEON_SE_LINE_WIDTH, 0 ) );
+ OUT_RING( ctx->se_line_width );
+ ADVANCE_RING();
+ }
+
+ if ( dirty & RADEON_UPLOAD_BUMPMAP ) {
+ BEGIN_RING( 5 );
+ OUT_RING( CP_PACKET0( RADEON_PP_LUM_MATRIX, 0 ) );
+ OUT_RING( ctx->pp_lum_matrix );
+ OUT_RING( CP_PACKET0( RADEON_PP_ROT_MATRIX_0, 1 ) );
+ OUT_RING( ctx->pp_rot_matrix_0 );
+ OUT_RING( ctx->pp_rot_matrix_1 );
+ ADVANCE_RING();
+ }
+
+ if ( dirty & RADEON_UPLOAD_MASKS ) {
+ BEGIN_RING( 4 );
+ OUT_RING( CP_PACKET0( RADEON_RB3D_STENCILREFMASK, 2 ) );
+ OUT_RING( ctx->rb3d_stencilrefmask );
+ OUT_RING( ctx->rb3d_ropcntl );
+ OUT_RING( ctx->rb3d_planemask );
+ ADVANCE_RING();
+ }
+
+ if ( dirty & RADEON_UPLOAD_VIEWPORT ) {
+ BEGIN_RING( 7 );
+ OUT_RING( CP_PACKET0( RADEON_SE_VPORT_XSCALE, 5 ) );
+ OUT_RING( ctx->se_vport_xscale );
+ OUT_RING( ctx->se_vport_xoffset );
+ OUT_RING( ctx->se_vport_yscale );
+ OUT_RING( ctx->se_vport_yoffset );
+ OUT_RING( ctx->se_vport_zscale );
+ OUT_RING( ctx->se_vport_zoffset );
+ ADVANCE_RING();
+ }
+
+ if ( dirty & RADEON_UPLOAD_SETUP ) {
+ BEGIN_RING( 4 );
+ OUT_RING( CP_PACKET0( RADEON_SE_CNTL, 0 ) );
+ OUT_RING( ctx->se_cntl );
+ OUT_RING( CP_PACKET0( RADEON_SE_CNTL_STATUS, 0 ) );
+ OUT_RING( ctx->se_cntl_status );
+ ADVANCE_RING();
+ }
+
+ if ( dirty & RADEON_UPLOAD_MISC ) {
+ BEGIN_RING( 2 );
+ OUT_RING( CP_PACKET0( RADEON_RE_MISC, 0 ) );
+ OUT_RING( ctx->re_misc );
+ ADVANCE_RING();
+ }
+
+ if ( dirty & RADEON_UPLOAD_TEX0 ) {
+ BEGIN_RING( 9 );
+ OUT_RING( CP_PACKET0( RADEON_PP_TXFILTER_0, 5 ) );
+ OUT_RING( tex[0].pp_txfilter );
+ OUT_RING( tex[0].pp_txformat );
+ OUT_RING( tex[0].pp_txoffset );
+ OUT_RING( tex[0].pp_txcblend );
+ OUT_RING( tex[0].pp_txablend );
+ OUT_RING( tex[0].pp_tfactor );
+ OUT_RING( CP_PACKET0( RADEON_PP_BORDER_COLOR_0, 0 ) );
+ OUT_RING( tex[0].pp_border_color );
+ ADVANCE_RING();
+ }
+
+ if ( dirty & RADEON_UPLOAD_TEX1 ) {
+ BEGIN_RING( 9 );
+ OUT_RING( CP_PACKET0( RADEON_PP_TXFILTER_1, 5 ) );
+ OUT_RING( tex[1].pp_txfilter );
+ OUT_RING( tex[1].pp_txformat );
+ OUT_RING( tex[1].pp_txoffset );
+ OUT_RING( tex[1].pp_txcblend );
+ OUT_RING( tex[1].pp_txablend );
+ OUT_RING( tex[1].pp_tfactor );
+ OUT_RING( CP_PACKET0( RADEON_PP_BORDER_COLOR_1, 0 ) );
+ OUT_RING( tex[1].pp_border_color );
+ ADVANCE_RING();
+ }
+
+ if ( dirty & RADEON_UPLOAD_TEX2 ) {
+ BEGIN_RING( 9 );
+ OUT_RING( CP_PACKET0( RADEON_PP_TXFILTER_2, 5 ) );
+ OUT_RING( tex[2].pp_txfilter );
+ OUT_RING( tex[2].pp_txformat );
+ OUT_RING( tex[2].pp_txoffset );
+ OUT_RING( tex[2].pp_txcblend );
+ OUT_RING( tex[2].pp_txablend );
+ OUT_RING( tex[2].pp_tfactor );
+ OUT_RING( CP_PACKET0( RADEON_PP_BORDER_COLOR_2, 0 ) );
+ OUT_RING( tex[2].pp_border_color );
+ ADVANCE_RING();
+ }
+}
+
+/* Emit 1.2 state
+ */
+static void radeon_emit_state2( drm_radeon_private_t *dev_priv,
+ drm_radeon_state_t *state )
+{
+ RING_LOCALS;
+
+ if (state->dirty & RADEON_UPLOAD_ZBIAS) {
+ BEGIN_RING( 3 );
+ OUT_RING( CP_PACKET0( RADEON_SE_ZBIAS_FACTOR, 1 ) );
+ OUT_RING( state->context2.se_zbias_factor );
+ OUT_RING( state->context2.se_zbias_constant );
+ ADVANCE_RING();
+ }
+
+ radeon_emit_state( dev_priv, &state->context,
+ state->tex, state->dirty );
+}
+
+/* New (1.3) state mechanism. 3 commands (packet, scalar, vector) in
+ * 1.3 cmdbuffers allow all previous state to be updated as well as
+ * the tcl scalar and vector areas.
+ */
+static struct {
+ int start;
+ int len;
+ const char *name;
+} packet[RADEON_MAX_STATE_PACKETS] = {
+ { RADEON_PP_MISC,7,"RADEON_PP_MISC" },
+ { RADEON_PP_CNTL,3,"RADEON_PP_CNTL" },
+ { RADEON_RB3D_COLORPITCH,1,"RADEON_RB3D_COLORPITCH" },
+ { RADEON_RE_LINE_PATTERN,2,"RADEON_RE_LINE_PATTERN" },
+ { RADEON_SE_LINE_WIDTH,1,"RADEON_SE_LINE_WIDTH" },
+ { RADEON_PP_LUM_MATRIX,1,"RADEON_PP_LUM_MATRIX" },
+ { RADEON_PP_ROT_MATRIX_0,2,"RADEON_PP_ROT_MATRIX_0" },
+ { RADEON_RB3D_STENCILREFMASK,3,"RADEON_RB3D_STENCILREFMASK" },
+ { RADEON_SE_VPORT_XSCALE,6,"RADEON_SE_VPORT_XSCALE" },
+ { RADEON_SE_CNTL,2,"RADEON_SE_CNTL" },
+ { RADEON_SE_CNTL_STATUS,1,"RADEON_SE_CNTL_STATUS" },
+ { RADEON_RE_MISC,1,"RADEON_RE_MISC" },
+ { RADEON_PP_TXFILTER_0,6,"RADEON_PP_TXFILTER_0" },
+ { RADEON_PP_BORDER_COLOR_0,1,"RADEON_PP_BORDER_COLOR_0" },
+ { RADEON_PP_TXFILTER_1,6,"RADEON_PP_TXFILTER_1" },
+ { RADEON_PP_BORDER_COLOR_1,1,"RADEON_PP_BORDER_COLOR_1" },
+ { RADEON_PP_TXFILTER_2,6,"RADEON_PP_TXFILTER_2" },
+ { RADEON_PP_BORDER_COLOR_2,1,"RADEON_PP_BORDER_COLOR_2" },
+ { RADEON_SE_ZBIAS_FACTOR,2,"RADEON_SE_ZBIAS_FACTOR" },
+ { RADEON_SE_TCL_OUTPUT_VTX_FMT,11,"RADEON_SE_TCL_OUTPUT_VTX_FMT" },
+ { RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED,17,"RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED" },
+ { R200_PP_TXCBLEND_0, 4, "R200_PP_TXCBLEND_0" },
+ { R200_PP_TXCBLEND_1, 4, "R200_PP_TXCBLEND_1" },
+ { R200_PP_TXCBLEND_2, 4, "R200_PP_TXCBLEND_2" },
+ { R200_PP_TXCBLEND_3, 4, "R200_PP_TXCBLEND_3" },
+ { R200_PP_TXCBLEND_4, 4, "R200_PP_TXCBLEND_4" },
+ { R200_PP_TXCBLEND_5, 4, "R200_PP_TXCBLEND_5" },
+ { R200_PP_TXCBLEND_6, 4, "R200_PP_TXCBLEND_6" },
+ { R200_PP_TXCBLEND_7, 4, "R200_PP_TXCBLEND_7" },
+ { R200_SE_TCL_LIGHT_MODEL_CTL_0, 6, "R200_SE_TCL_LIGHT_MODEL_CTL_0" },
+ { R200_PP_TFACTOR_0, 6, "R200_PP_TFACTOR_0" },
+ { R200_SE_VTX_FMT_0, 4, "R200_SE_VTX_FMT_0" },
+ { R200_SE_VAP_CNTL, 1, "R200_SE_VAP_CNTL" },
+ { R200_SE_TCL_MATRIX_SEL_0, 5, "R200_SE_TCL_MATRIX_SEL_0" },
+ { R200_SE_TCL_TEX_PROC_CTL_2, 5, "R200_SE_TCL_TEX_PROC_CTL_2" },
+ { R200_SE_TCL_UCP_VERT_BLEND_CTL, 1, "R200_SE_TCL_UCP_VERT_BLEND_CTL" },
+ { R200_PP_TXFILTER_0, 6, "R200_PP_TXFILTER_0" },
+ { R200_PP_TXFILTER_1, 6, "R200_PP_TXFILTER_1" },
+ { R200_PP_TXFILTER_2, 6, "R200_PP_TXFILTER_2" },
+ { R200_PP_TXFILTER_3, 6, "R200_PP_TXFILTER_3" },
+ { R200_PP_TXFILTER_4, 6, "R200_PP_TXFILTER_4" },
+ { R200_PP_TXFILTER_5, 6, "R200_PP_TXFILTER_5" },
+ { R200_PP_TXOFFSET_0, 1, "R200_PP_TXOFFSET_0" },
+ { R200_PP_TXOFFSET_1, 1, "R200_PP_TXOFFSET_1" },
+ { R200_PP_TXOFFSET_2, 1, "R200_PP_TXOFFSET_2" },
+ { R200_PP_TXOFFSET_3, 1, "R200_PP_TXOFFSET_3" },
+ { R200_PP_TXOFFSET_4, 1, "R200_PP_TXOFFSET_4" },
+ { R200_PP_TXOFFSET_5, 1, "R200_PP_TXOFFSET_5" },
+ { R200_SE_VTE_CNTL, 1, "R200_SE_VTE_CNTL" },
+ { R200_SE_TCL_OUTPUT_VTX_COMP_SEL, 1, "R200_SE_TCL_OUTPUT_VTX_COMP_SEL" },
+ { R200_PP_TAM_DEBUG3, 1, "R200_PP_TAM_DEBUG3" },
+ { R200_PP_CNTL_X, 1, "R200_PP_CNTL_X" },
+ { R200_RB3D_DEPTHXY_OFFSET, 1, "R200_RB3D_DEPTHXY_OFFSET" },
+ { R200_RE_AUX_SCISSOR_CNTL, 1, "R200_RE_AUX_SCISSOR_CNTL" },
+ { R200_RE_SCISSOR_TL_0, 2, "R200_RE_SCISSOR_TL_0" },
+ { R200_RE_SCISSOR_TL_1, 2, "R200_RE_SCISSOR_TL_1" },
+ { R200_RE_SCISSOR_TL_2, 2, "R200_RE_SCISSOR_TL_2" },
+ { R200_SE_VAP_CNTL_STATUS, 1, "R200_SE_VAP_CNTL_STATUS" },
+ { R200_SE_VTX_STATE_CNTL, 1, "R200_SE_VTX_STATE_CNTL" },
+ { R200_RE_POINTSIZE, 1, "R200_RE_POINTSIZE" },
+ { R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0, 4, "R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0" },
+ { R200_PP_CUBIC_FACES_0, 1, "R200_PP_CUBIC_FACES_0" }, /* 61 */
+ { R200_PP_CUBIC_OFFSET_F1_0, 5, "R200_PP_CUBIC_OFFSET_F1_0" }, /* 62 */
+ { R200_PP_CUBIC_FACES_1, 1, "R200_PP_CUBIC_FACES_1" },
+ { R200_PP_CUBIC_OFFSET_F1_1, 5, "R200_PP_CUBIC_OFFSET_F1_1" },
+ { R200_PP_CUBIC_FACES_2, 1, "R200_PP_CUBIC_FACES_2" },
+ { R200_PP_CUBIC_OFFSET_F1_2, 5, "R200_PP_CUBIC_OFFSET_F1_2" },
+ { R200_PP_CUBIC_FACES_3, 1, "R200_PP_CUBIC_FACES_3" },
+ { R200_PP_CUBIC_OFFSET_F1_3, 5, "R200_PP_CUBIC_OFFSET_F1_3" },
+ { R200_PP_CUBIC_FACES_4, 1, "R200_PP_CUBIC_FACES_4" },
+ { R200_PP_CUBIC_OFFSET_F1_4, 5, "R200_PP_CUBIC_OFFSET_F1_4" },
+ { R200_PP_CUBIC_FACES_5, 1, "R200_PP_CUBIC_FACES_5" },
+ { R200_PP_CUBIC_OFFSET_F1_5, 5, "R200_PP_CUBIC_OFFSET_F1_5" },
+};
+
+
+
+/* ================================================================
+ * Performance monitoring functions
+ */
+
+static void radeon_clear_box( drm_radeon_private_t *dev_priv,
+ int x, int y, int w, int h,
+ int r, int g, int b )
+{
+ u32 color;
+ RING_LOCALS;
+
+ x += dev_priv->sarea_priv->boxes[0].x1;
+ y += dev_priv->sarea_priv->boxes[0].y1;
+
+ switch ( dev_priv->color_fmt ) {
+ case RADEON_COLOR_FORMAT_RGB565:
+ color = (((r & 0xf8) << 8) |
+ ((g & 0xfc) << 3) |
+ ((b & 0xf8) >> 3));
+ break;
+ case RADEON_COLOR_FORMAT_ARGB8888:
+ default:
+ color = (((0xff) << 24) | (r << 16) | (g << 8) | b);
+ break;
+ }
+
+ BEGIN_RING( 4 );
+ RADEON_WAIT_UNTIL_3D_IDLE();
+ OUT_RING( CP_PACKET0( RADEON_DP_WRITE_MASK, 0 ) );
+ OUT_RING( 0xffffffff );
+ ADVANCE_RING();
+
+ BEGIN_RING( 6 );
+
+ OUT_RING( CP_PACKET3( RADEON_CNTL_PAINT_MULTI, 4 ) );
+ OUT_RING( RADEON_GMC_DST_PITCH_OFFSET_CNTL |
+ RADEON_GMC_BRUSH_SOLID_COLOR |
+ (dev_priv->color_fmt << 8) |
+ RADEON_GMC_SRC_DATATYPE_COLOR |
+ RADEON_ROP3_P |
+ RADEON_GMC_CLR_CMP_CNTL_DIS );
+
+ if ( dev_priv->page_flipping && dev_priv->current_page == 1 ) {
+ OUT_RING( dev_priv->front_pitch_offset );
+ } else {
+ OUT_RING( dev_priv->back_pitch_offset );
+ }
+
+ OUT_RING( color );
+
+ OUT_RING( (x << 16) | y );
+ OUT_RING( (w << 16) | h );
+
+ ADVANCE_RING();
+}
+
+static void radeon_cp_performance_boxes( drm_radeon_private_t *dev_priv )
+{
+ /* Collapse various things into a wait flag -- trying to
+ * guess if userspase slept -- better just to have them tell us.
+ */
+ if (dev_priv->stats.last_frame_reads > 1 ||
+ dev_priv->stats.last_clear_reads > dev_priv->stats.clears) {
+ dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE;
+ }
+
+ if (dev_priv->stats.freelist_loops) {
+ dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE;
+ }
+
+ /* Purple box for page flipping
+ */
+ if ( dev_priv->stats.boxes & RADEON_BOX_FLIP )
+ radeon_clear_box( dev_priv, 4, 4, 8, 8, 255, 0, 255 );
+
+ /* Red box if we have to wait for idle at any point
+ */
+ if ( dev_priv->stats.boxes & RADEON_BOX_WAIT_IDLE )
+ radeon_clear_box( dev_priv, 16, 4, 8, 8, 255, 0, 0 );
+
+ /* Blue box: lost context?
+ */
+
+ /* Yellow box for texture swaps
+ */
+ if ( dev_priv->stats.boxes & RADEON_BOX_TEXTURE_LOAD )
+ radeon_clear_box( dev_priv, 40, 4, 8, 8, 255, 255, 0 );
+
+ /* Green box if hardware never idles (as far as we can tell)
+ */
+ if ( !(dev_priv->stats.boxes & RADEON_BOX_DMA_IDLE) )
+ radeon_clear_box( dev_priv, 64, 4, 8, 8, 0, 255, 0 );
+
+
+ /* Draw bars indicating number of buffers allocated
+ * (not a great measure, easily confused)
+ */
+ if (dev_priv->stats.requested_bufs) {
+ if (dev_priv->stats.requested_bufs > 100)
+ dev_priv->stats.requested_bufs = 100;
+
+ radeon_clear_box( dev_priv, 4, 16,
+ dev_priv->stats.requested_bufs, 4,
+ 196, 128, 128 );
+ }
+
+ memset( &dev_priv->stats, 0, sizeof(dev_priv->stats) );
+
+}
+/* ================================================================
+ * CP command dispatch functions
+ */
+
+static void radeon_cp_dispatch_clear( drm_device_t *dev,
+ drm_radeon_clear_t *clear,
+ drm_radeon_clear_rect_t *depth_boxes )
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ drm_radeon_depth_clear_t *depth_clear = &dev_priv->depth_clear;
+ int nbox = sarea_priv->nbox;
+ drm_clip_rect_t *pbox = sarea_priv->boxes;
+ unsigned int flags = clear->flags;
+ u32 rb3d_cntl = 0, rb3d_stencilrefmask= 0;
+ int i;
+ RING_LOCALS;
+ DRM_DEBUG( "flags = 0x%x\n", flags );
+
+ dev_priv->stats.clears++;
+
+ if ( dev_priv->page_flipping && dev_priv->current_page == 1 ) {
+ unsigned int tmp = flags;
+
+ flags &= ~(RADEON_FRONT | RADEON_BACK);
+ if ( tmp & RADEON_FRONT ) flags |= RADEON_BACK;
+ if ( tmp & RADEON_BACK ) flags |= RADEON_FRONT;
+ }
+
+ if ( flags & (RADEON_FRONT | RADEON_BACK) ) {
+
+ BEGIN_RING( 4 );
+
+ /* Ensure the 3D stream is idle before doing a
+ * 2D fill to clear the front or back buffer.
+ */
+ RADEON_WAIT_UNTIL_3D_IDLE();
+
+ OUT_RING( CP_PACKET0( RADEON_DP_WRITE_MASK, 0 ) );
+ OUT_RING( clear->color_mask );
+
+ ADVANCE_RING();
+
+ /* Make sure we restore the 3D state next time.
+ */
+ dev_priv->sarea_priv->ctx_owner = 0;
+
+ for ( i = 0 ; i < nbox ; i++ ) {
+ int x = pbox[i].x1;
+ int y = pbox[i].y1;
+ int w = pbox[i].x2 - x;
+ int h = pbox[i].y2 - y;
+
+ DRM_DEBUG( "dispatch clear %d,%d-%d,%d flags 0x%x\n",
+ x, y, w, h, flags );
+
+ if ( flags & RADEON_FRONT ) {
+ BEGIN_RING( 6 );
+
+ OUT_RING( CP_PACKET3( RADEON_CNTL_PAINT_MULTI, 4 ) );
+ OUT_RING( RADEON_GMC_DST_PITCH_OFFSET_CNTL |
+ RADEON_GMC_BRUSH_SOLID_COLOR |
+ (dev_priv->color_fmt << 8) |
+ RADEON_GMC_SRC_DATATYPE_COLOR |
+ RADEON_ROP3_P |
+ RADEON_GMC_CLR_CMP_CNTL_DIS );
+
+ OUT_RING( dev_priv->front_pitch_offset );
+ OUT_RING( clear->clear_color );
+
+ OUT_RING( (x << 16) | y );
+ OUT_RING( (w << 16) | h );
+
+ ADVANCE_RING();
+ }
+
+ if ( flags & RADEON_BACK ) {
+ BEGIN_RING( 6 );
+
+ OUT_RING( CP_PACKET3( RADEON_CNTL_PAINT_MULTI, 4 ) );
+ OUT_RING( RADEON_GMC_DST_PITCH_OFFSET_CNTL |
+ RADEON_GMC_BRUSH_SOLID_COLOR |
+ (dev_priv->color_fmt << 8) |
+ RADEON_GMC_SRC_DATATYPE_COLOR |
+ RADEON_ROP3_P |
+ RADEON_GMC_CLR_CMP_CNTL_DIS );
+
+ OUT_RING( dev_priv->back_pitch_offset );
+ OUT_RING( clear->clear_color );
+
+ OUT_RING( (x << 16) | y );
+ OUT_RING( (w << 16) | h );
+
+ ADVANCE_RING();
+ }
+ }
+ }
+
+ /* We have to clear the depth and/or stencil buffers by
+ * rendering a quad into just those buffers. Thus, we have to
+ * make sure the 3D engine is configured correctly.
+ */
+ if ( dev_priv->is_r200 &&
+ (flags & (RADEON_DEPTH | RADEON_STENCIL)) ) {
+
+ int tempPP_CNTL;
+ int tempRE_CNTL;
+ int tempRB3D_CNTL;
+ int tempRB3D_ZSTENCILCNTL;
+ int tempRB3D_STENCILREFMASK;
+ int tempRB3D_PLANEMASK;
+ int tempSE_CNTL;
+ int tempSE_VTE_CNTL;
+ int tempSE_VTX_FMT_0;
+ int tempSE_VTX_FMT_1;
+ int tempSE_VAP_CNTL;
+ int tempRE_AUX_SCISSOR_CNTL;
+
+ tempPP_CNTL = 0;
+ tempRE_CNTL = 0;
+
+ tempRB3D_CNTL = depth_clear->rb3d_cntl;
+ tempRB3D_CNTL &= ~(1<<15); /* unset radeon magic flag */
+
+ tempRB3D_ZSTENCILCNTL = depth_clear->rb3d_zstencilcntl;
+ tempRB3D_STENCILREFMASK = 0x0;
+
+ tempSE_CNTL = depth_clear->se_cntl;
+
+
+
+ /* Disable TCL */
+
+ tempSE_VAP_CNTL = (/* SE_VAP_CNTL__FORCE_W_TO_ONE_MASK | */
+ (0x9 << SE_VAP_CNTL__VF_MAX_VTX_NUM__SHIFT));
+
+ tempRB3D_PLANEMASK = 0x0;
+
+ tempRE_AUX_SCISSOR_CNTL = 0x0;
+
+ tempSE_VTE_CNTL =
+ SE_VTE_CNTL__VTX_XY_FMT_MASK |
+ SE_VTE_CNTL__VTX_Z_FMT_MASK;
+
+ /* Vertex format (X, Y, Z, W)*/
+ tempSE_VTX_FMT_0 =
+ SE_VTX_FMT_0__VTX_Z0_PRESENT_MASK |
+ SE_VTX_FMT_0__VTX_W0_PRESENT_MASK;
+ tempSE_VTX_FMT_1 = 0x0;
+
+
+ /*
+ * Depth buffer specific enables
+ */
+ if (flags & RADEON_DEPTH) {
+ /* Enable depth buffer */
+ tempRB3D_CNTL |= RADEON_Z_ENABLE;
+ } else {
+ /* Disable depth buffer */
+ tempRB3D_CNTL &= ~RADEON_Z_ENABLE;
+ }
+
+ /*
+ * Stencil buffer specific enables
+ */
+ if ( flags & RADEON_STENCIL ) {
+ tempRB3D_CNTL |= RADEON_STENCIL_ENABLE;
+ tempRB3D_STENCILREFMASK = clear->depth_mask;
+ } else {
+ tempRB3D_CNTL &= ~RADEON_STENCIL_ENABLE;
+ tempRB3D_STENCILREFMASK = 0x00000000;
+ }
+
+ BEGIN_RING( 26 );
+ RADEON_WAIT_UNTIL_2D_IDLE();
+
+ OUT_RING_REG( RADEON_PP_CNTL, tempPP_CNTL );
+ OUT_RING_REG( R200_RE_CNTL, tempRE_CNTL );
+ OUT_RING_REG( RADEON_RB3D_CNTL, tempRB3D_CNTL );
+ OUT_RING_REG( RADEON_RB3D_ZSTENCILCNTL,
+ tempRB3D_ZSTENCILCNTL );
+ OUT_RING_REG( RADEON_RB3D_STENCILREFMASK,
+ tempRB3D_STENCILREFMASK );
+ OUT_RING_REG( RADEON_RB3D_PLANEMASK, tempRB3D_PLANEMASK );
+ OUT_RING_REG( RADEON_SE_CNTL, tempSE_CNTL );
+ OUT_RING_REG( R200_SE_VTE_CNTL, tempSE_VTE_CNTL );
+ OUT_RING_REG( R200_SE_VTX_FMT_0, tempSE_VTX_FMT_0 );
+ OUT_RING_REG( R200_SE_VTX_FMT_1, tempSE_VTX_FMT_1 );
+ OUT_RING_REG( R200_SE_VAP_CNTL, tempSE_VAP_CNTL );
+ OUT_RING_REG( R200_RE_AUX_SCISSOR_CNTL,
+ tempRE_AUX_SCISSOR_CNTL );
+ ADVANCE_RING();
+
+ /* Make sure we restore the 3D state next time.
+ */
+ dev_priv->sarea_priv->ctx_owner = 0;
+
+ for ( i = 0 ; i < nbox ; i++ ) {
+
+ /* Funny that this should be required --
+ * sets top-left?
+ */
+ radeon_emit_clip_rect( dev_priv,
+ &sarea_priv->boxes[i] );
+
+ BEGIN_RING( 14 );
+ OUT_RING( CP_PACKET3( R200_3D_DRAW_IMMD_2, 12 ) );
+ OUT_RING( (RADEON_PRIM_TYPE_RECT_LIST |
+ RADEON_PRIM_WALK_RING |
+ (3 << RADEON_NUM_VERTICES_SHIFT)) );
+ OUT_RING( depth_boxes[i].ui[CLEAR_X1] );
+ OUT_RING( depth_boxes[i].ui[CLEAR_Y1] );
+ OUT_RING( depth_boxes[i].ui[CLEAR_DEPTH] );
+ OUT_RING( 0x3f800000 );
+ OUT_RING( depth_boxes[i].ui[CLEAR_X1] );
+ OUT_RING( depth_boxes[i].ui[CLEAR_Y2] );
+ OUT_RING( depth_boxes[i].ui[CLEAR_DEPTH] );
+ OUT_RING( 0x3f800000 );
+ OUT_RING( depth_boxes[i].ui[CLEAR_X2] );
+ OUT_RING( depth_boxes[i].ui[CLEAR_Y2] );
+ OUT_RING( depth_boxes[i].ui[CLEAR_DEPTH] );
+ OUT_RING( 0x3f800000 );
+ ADVANCE_RING();
+ }
+ }
+ else if ( (flags & (RADEON_DEPTH | RADEON_STENCIL)) ) {
+
+ rb3d_cntl = depth_clear->rb3d_cntl;
+
+ if ( flags & RADEON_DEPTH ) {
+ rb3d_cntl |= RADEON_Z_ENABLE;
+ } else {
+ rb3d_cntl &= ~RADEON_Z_ENABLE;
+ }
+
+ if ( flags & RADEON_STENCIL ) {
+ rb3d_cntl |= RADEON_STENCIL_ENABLE;
+ rb3d_stencilrefmask = clear->depth_mask; /* misnamed field */
+ } else {
+ rb3d_cntl &= ~RADEON_STENCIL_ENABLE;
+ rb3d_stencilrefmask = 0x00000000;
+ }
+
+ BEGIN_RING( 13 );
+ RADEON_WAIT_UNTIL_2D_IDLE();
+
+ OUT_RING( CP_PACKET0( RADEON_PP_CNTL, 1 ) );
+ OUT_RING( 0x00000000 );
+ OUT_RING( rb3d_cntl );
+
+ OUT_RING_REG( RADEON_RB3D_ZSTENCILCNTL,
+ depth_clear->rb3d_zstencilcntl );
+ OUT_RING_REG( RADEON_RB3D_STENCILREFMASK,
+ rb3d_stencilrefmask );
+ OUT_RING_REG( RADEON_RB3D_PLANEMASK,
+ 0x00000000 );
+ OUT_RING_REG( RADEON_SE_CNTL,
+ depth_clear->se_cntl );
+ ADVANCE_RING();
+
+ /* Make sure we restore the 3D state next time.
+ */
+ dev_priv->sarea_priv->ctx_owner = 0;
+
+ for ( i = 0 ; i < nbox ; i++ ) {
+
+ /* Funny that this should be required --
+ * sets top-left?
+ */
+ radeon_emit_clip_rect( dev_priv,
+ &sarea_priv->boxes[i] );
+
+ BEGIN_RING( 15 );
+
+ OUT_RING( CP_PACKET3( RADEON_3D_DRAW_IMMD, 13 ) );
+ OUT_RING( RADEON_VTX_Z_PRESENT |
+ RADEON_VTX_PKCOLOR_PRESENT);
+ OUT_RING( (RADEON_PRIM_TYPE_RECT_LIST |
+ RADEON_PRIM_WALK_RING |
+ RADEON_MAOS_ENABLE |
+ RADEON_VTX_FMT_RADEON_MODE |
+ (3 << RADEON_NUM_VERTICES_SHIFT)) );
+
+
+ OUT_RING( depth_boxes[i].ui[CLEAR_X1] );
+ OUT_RING( depth_boxes[i].ui[CLEAR_Y1] );
+ OUT_RING( depth_boxes[i].ui[CLEAR_DEPTH] );
+ OUT_RING( 0x0 );
+
+ OUT_RING( depth_boxes[i].ui[CLEAR_X1] );
+ OUT_RING( depth_boxes[i].ui[CLEAR_Y2] );
+ OUT_RING( depth_boxes[i].ui[CLEAR_DEPTH] );
+ OUT_RING( 0x0 );
+
+ OUT_RING( depth_boxes[i].ui[CLEAR_X2] );
+ OUT_RING( depth_boxes[i].ui[CLEAR_Y2] );
+ OUT_RING( depth_boxes[i].ui[CLEAR_DEPTH] );
+ OUT_RING( 0x0 );
+
+ ADVANCE_RING();
+ }
+ }
+
+ /* Increment the clear counter. The client-side 3D driver must
+ * wait on this value before performing the clear ioctl. We
+ * need this because the card's so damned fast...
+ */
+ dev_priv->sarea_priv->last_clear++;
+
+ BEGIN_RING( 4 );
+
+ RADEON_CLEAR_AGE( dev_priv->sarea_priv->last_clear );
+ RADEON_WAIT_UNTIL_IDLE();
+
+ ADVANCE_RING();
+}
+
+static void radeon_cp_dispatch_swap( drm_device_t *dev )
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ int nbox = sarea_priv->nbox;
+ drm_clip_rect_t *pbox = sarea_priv->boxes;
+ int i;
+ RING_LOCALS;
+ DRM_DEBUG( "\n" );
+
+ /* Do some trivial performance monitoring...
+ */
+ if (dev_priv->do_boxes)
+ radeon_cp_performance_boxes( dev_priv );
+
+
+ /* Wait for the 3D stream to idle before dispatching the bitblt.
+ * This will prevent data corruption between the two streams.
+ */
+ BEGIN_RING( 2 );
+
+ RADEON_WAIT_UNTIL_3D_IDLE();
+
+ ADVANCE_RING();
+
+ for ( i = 0 ; i < nbox ; i++ ) {
+ int x = pbox[i].x1;
+ int y = pbox[i].y1;
+ int w = pbox[i].x2 - x;
+ int h = pbox[i].y2 - y;
+
+ DRM_DEBUG( "dispatch swap %d,%d-%d,%d\n",
+ x, y, w, h );
+
+ BEGIN_RING( 7 );
+
+ OUT_RING( CP_PACKET3( RADEON_CNTL_BITBLT_MULTI, 5 ) );
+ OUT_RING( RADEON_GMC_SRC_PITCH_OFFSET_CNTL |
+ RADEON_GMC_DST_PITCH_OFFSET_CNTL |
+ RADEON_GMC_BRUSH_NONE |
+ (dev_priv->color_fmt << 8) |
+ RADEON_GMC_SRC_DATATYPE_COLOR |
+ RADEON_ROP3_S |
+ RADEON_DP_SRC_SOURCE_MEMORY |
+ RADEON_GMC_CLR_CMP_CNTL_DIS |
+ RADEON_GMC_WR_MSK_DIS );
+
+ /* Make this work even if front & back are flipped:
+ */
+ if (dev_priv->current_page == 0) {
+ OUT_RING( dev_priv->back_pitch_offset );
+ OUT_RING( dev_priv->front_pitch_offset );
+ }
+ else {
+ OUT_RING( dev_priv->front_pitch_offset );
+ OUT_RING( dev_priv->back_pitch_offset );
+ }
+
+ OUT_RING( (x << 16) | y );
+ OUT_RING( (x << 16) | y );
+ OUT_RING( (w << 16) | h );
+
+ ADVANCE_RING();
+ }
+
+ /* Increment the frame counter. The client-side 3D driver must
+ * throttle the framerate by waiting for this value before
+ * performing the swapbuffer ioctl.
+ */
+ dev_priv->sarea_priv->last_frame++;
+
+ BEGIN_RING( 4 );
+
+ RADEON_FRAME_AGE( dev_priv->sarea_priv->last_frame );
+ RADEON_WAIT_UNTIL_2D_IDLE();
+
+ ADVANCE_RING();
+}
+
+static void radeon_cp_dispatch_flip( drm_device_t *dev )
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_sarea_t *sarea = (drm_sarea_t *)dev_priv->sarea->handle;
+ int offset = (dev_priv->current_page == 1)
+ ? dev_priv->front_offset : dev_priv->back_offset;
+ RING_LOCALS;
+ DRM_DEBUG( "%s: page=%d pfCurrentPage=%d\n",
+ __FUNCTION__,
+ dev_priv->current_page,
+ dev_priv->sarea_priv->pfCurrentPage);
+
+ /* Do some trivial performance monitoring...
+ */
+ if (dev_priv->do_boxes) {
+ dev_priv->stats.boxes |= RADEON_BOX_FLIP;
+ radeon_cp_performance_boxes( dev_priv );
+ }
+
+ /* Update the frame offsets for both CRTCs
+ */
+ BEGIN_RING( 6 );
+
+ RADEON_WAIT_UNTIL_3D_IDLE();
+ OUT_RING_REG( RADEON_CRTC_OFFSET, ( ( sarea->frame.y * dev_priv->front_pitch
+ + sarea->frame.x
+ * ( dev_priv->color_fmt - 2 ) ) & ~7 )
+ + offset );
+ OUT_RING_REG( RADEON_CRTC2_OFFSET, dev_priv->sarea_priv->crtc2_base
+ + offset );
+
+ ADVANCE_RING();
+
+ /* Increment the frame counter. The client-side 3D driver must
+ * throttle the framerate by waiting for this value before
+ * performing the swapbuffer ioctl.
+ */
+ dev_priv->sarea_priv->last_frame++;
+ dev_priv->sarea_priv->pfCurrentPage = dev_priv->current_page =
+ 1 - dev_priv->current_page;
+
+ BEGIN_RING( 2 );
+
+ RADEON_FRAME_AGE( dev_priv->sarea_priv->last_frame );
+
+ ADVANCE_RING();
+}
+
+static int bad_prim_vertex_nr( int primitive, int nr )
+{
+ switch (primitive & RADEON_PRIM_TYPE_MASK) {
+ case RADEON_PRIM_TYPE_NONE:
+ case RADEON_PRIM_TYPE_POINT:
+ return nr < 1;
+ case RADEON_PRIM_TYPE_LINE:
+ return (nr & 1) || nr == 0;
+ case RADEON_PRIM_TYPE_LINE_STRIP:
+ return nr < 2;
+ case RADEON_PRIM_TYPE_TRI_LIST:
+ case RADEON_PRIM_TYPE_3VRT_POINT_LIST:
+ case RADEON_PRIM_TYPE_3VRT_LINE_LIST:
+ case RADEON_PRIM_TYPE_RECT_LIST:
+ return nr % 3 || nr == 0;
+ case RADEON_PRIM_TYPE_TRI_FAN:
+ case RADEON_PRIM_TYPE_TRI_STRIP:
+ return nr < 3;
+ default:
+ return 1;
+ }
+}
+
+
+
+typedef struct {
+ unsigned int start;
+ unsigned int finish;
+ unsigned int prim;
+ unsigned int numverts;
+ unsigned int offset;
+ unsigned int vc_format;
+} drm_radeon_tcl_prim_t;
+
+static void radeon_cp_dispatch_vertex( drm_device_t *dev,
+ drm_buf_t *buf,
+ drm_radeon_tcl_prim_t *prim,
+ drm_clip_rect_t *boxes,
+ int nbox )
+
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_clip_rect_t box;
+ int offset = dev_priv->agp_buffers_offset + buf->offset + prim->start;
+ int numverts = (int)prim->numverts;
+ int i = 0;
+ RING_LOCALS;
+
+ DRM_DEBUG("hwprim 0x%x vfmt 0x%x %d..%d %d verts\n",
+ prim->prim,
+ prim->vc_format,
+ prim->start,
+ prim->finish,
+ prim->numverts);
+
+ if (bad_prim_vertex_nr( prim->prim, prim->numverts )) {
+ DRM_ERROR( "bad prim %x numverts %d\n",
+ prim->prim, prim->numverts );
+ return;
+ }
+
+ do {
+ /* Emit the next cliprect */
+ if ( i < nbox ) {
+ if (DRM_COPY_FROM_USER_UNCHECKED( &box, &boxes[i], sizeof(box) ))
+ return;
+
+ radeon_emit_clip_rect( dev_priv, &box );
+ }
+
+ /* Emit the vertex buffer rendering commands */
+ BEGIN_RING( 5 );
+
+ OUT_RING( CP_PACKET3( RADEON_3D_RNDR_GEN_INDX_PRIM, 3 ) );
+ OUT_RING( offset );
+ OUT_RING( numverts );
+ OUT_RING( prim->vc_format );
+ OUT_RING( prim->prim | RADEON_PRIM_WALK_LIST |
+ RADEON_COLOR_ORDER_RGBA |
+ RADEON_VTX_FMT_RADEON_MODE |
+ (numverts << RADEON_NUM_VERTICES_SHIFT) );
+
+ ADVANCE_RING();
+
+ i++;
+ } while ( i < nbox );
+}
+
+
+
+static void radeon_cp_discard_buffer( drm_device_t *dev, drm_buf_t *buf )
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_radeon_buf_priv_t *buf_priv = buf->dev_private;
+ RING_LOCALS;
+
+ buf_priv->age = ++dev_priv->sarea_priv->last_dispatch;
+
+ /* Emit the vertex buffer age */
+ BEGIN_RING( 2 );
+ RADEON_DISPATCH_AGE( buf_priv->age );
+ ADVANCE_RING();
+
+ buf->pending = 1;
+ buf->used = 0;
+}
+
+static void radeon_cp_dispatch_indirect( drm_device_t *dev,
+ drm_buf_t *buf,
+ int start, int end )
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ RING_LOCALS;
+ DRM_DEBUG( "indirect: buf=%d s=0x%x e=0x%x\n",
+ buf->idx, start, end );
+
+ if ( start != end ) {
+ int offset = (dev_priv->agp_buffers_offset
+ + buf->offset + start);
+ int dwords = (end - start + 3) / sizeof(u32);
+
+ /* Indirect buffer data must be an even number of
+ * dwords, so if we've been given an odd number we must
+ * pad the data with a Type-2 CP packet.
+ */
+ if ( dwords & 1 ) {
+ u32 *data = (u32 *)
+ ((char *)dev_priv->buffers->handle
+ + buf->offset + start);
+ data[dwords++] = RADEON_CP_PACKET2;
+ }
+
+ /* Fire off the indirect buffer */
+ BEGIN_RING( 3 );
+
+ OUT_RING( CP_PACKET0( RADEON_CP_IB_BASE, 1 ) );
+ OUT_RING( offset );
+ OUT_RING( dwords );
+
+ ADVANCE_RING();
+ }
+}
+
+
+static void radeon_cp_dispatch_indices( drm_device_t *dev,
+ drm_buf_t *elt_buf,
+ drm_radeon_tcl_prim_t *prim,
+ drm_clip_rect_t *boxes,
+ int nbox )
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_clip_rect_t box;
+ int offset = dev_priv->agp_buffers_offset + prim->offset;
+ u32 *data;
+ int dwords;
+ int i = 0;
+ int start = prim->start + RADEON_INDEX_PRIM_OFFSET;
+ int count = (prim->finish - start) / sizeof(u16);
+
+ DRM_DEBUG("hwprim 0x%x vfmt 0x%x %d..%d offset: %x nr %d\n",
+ prim->prim,
+ prim->vc_format,
+ prim->start,
+ prim->finish,
+ prim->offset,
+ prim->numverts);
+
+ if (bad_prim_vertex_nr( prim->prim, count )) {
+ DRM_ERROR( "bad prim %x count %d\n",
+ prim->prim, count );
+ return;
+ }
+
+
+ if ( start >= prim->finish ||
+ (prim->start & 0x7) ) {
+ DRM_ERROR( "buffer prim %d\n", prim->prim );
+ return;
+ }
+
+ dwords = (prim->finish - prim->start + 3) / sizeof(u32);
+
+ data = (u32 *)((char *)dev_priv->buffers->handle +
+ elt_buf->offset + prim->start);
+
+ data[0] = CP_PACKET3( RADEON_3D_RNDR_GEN_INDX_PRIM, dwords-2 );
+ data[1] = offset;
+ data[2] = prim->numverts;
+ data[3] = prim->vc_format;
+ data[4] = (prim->prim |
+ RADEON_PRIM_WALK_IND |
+ RADEON_COLOR_ORDER_RGBA |
+ RADEON_VTX_FMT_RADEON_MODE |
+ (count << RADEON_NUM_VERTICES_SHIFT) );
+
+ do {
+ if ( i < nbox ) {
+ if (DRM_COPY_FROM_USER_UNCHECKED( &box, &boxes[i], sizeof(box) ))
+ return;
+
+ radeon_emit_clip_rect( dev_priv, &box );
+ }
+
+ radeon_cp_dispatch_indirect( dev, elt_buf,
+ prim->start,
+ prim->finish );
+
+ i++;
+ } while ( i < nbox );
+
+}
+
+#define RADEON_MAX_TEXTURE_SIZE (RADEON_BUFFER_SIZE - 8 * sizeof(u32))
+
+static int radeon_cp_dispatch_texture( drm_device_t *dev,
+ drm_radeon_texture_t *tex,
+ drm_radeon_tex_image_t *image )
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_buf_t *buf;
+ u32 format;
+ u32 *buffer;
+ const u8 *data;
+ int size, dwords, tex_width, blit_width;
+ u32 height;
+ int i;
+ RING_LOCALS;
+
+ dev_priv->stats.boxes |= RADEON_BOX_TEXTURE_LOAD;
+
+ /* Flush the pixel cache. This ensures no pixel data gets mixed
+ * up with the texture data from the host data blit, otherwise
+ * part of the texture image may be corrupted.
+ */
+ BEGIN_RING( 4 );
+ RADEON_FLUSH_CACHE();
+ RADEON_WAIT_UNTIL_IDLE();
+ ADVANCE_RING();
+
+#ifdef __BIG_ENDIAN
+ /* The Mesa texture functions provide the data in little endian as the
+ * chip wants it, but we need to compensate for the fact that the CP
+ * ring gets byte-swapped
+ */
+ BEGIN_RING( 2 );
+ OUT_RING_REG( RADEON_RBBM_GUICNTL, RADEON_HOST_DATA_SWAP_32BIT );
+ ADVANCE_RING();
+#endif
+
+
+ /* The compiler won't optimize away a division by a variable,
+ * even if the only legal values are powers of two. Thus, we'll
+ * use a shift instead.
+ */
+ switch ( tex->format ) {
+ case RADEON_TXFORMAT_ARGB8888:
+ case RADEON_TXFORMAT_RGBA8888:
+ format = RADEON_COLOR_FORMAT_ARGB8888;
+ tex_width = tex->width * 4;
+ blit_width = image->width * 4;
+ break;
+ case RADEON_TXFORMAT_AI88:
+ case RADEON_TXFORMAT_ARGB1555:
+ case RADEON_TXFORMAT_RGB565:
+ case RADEON_TXFORMAT_ARGB4444:
+ case RADEON_TXFORMAT_VYUY422:
+ case RADEON_TXFORMAT_YVYU422:
+ format = RADEON_COLOR_FORMAT_RGB565;
+ tex_width = tex->width * 2;
+ blit_width = image->width * 2;
+ break;
+ case RADEON_TXFORMAT_I8:
+ case RADEON_TXFORMAT_RGB332:
+ format = RADEON_COLOR_FORMAT_CI8;
+ tex_width = tex->width * 1;
+ blit_width = image->width * 1;
+ break;
+ default:
+ DRM_ERROR( "invalid texture format %d\n", tex->format );
+ return DRM_ERR(EINVAL);
+ }
+
+ DRM_DEBUG("tex=%dx%d blit=%d\n", tex_width, tex->height, blit_width );
+
+ do {
+ DRM_DEBUG( "tex: ofs=0x%x p=%d f=%d x=%hd y=%hd w=%hd h=%hd\n",
+ tex->offset >> 10, tex->pitch, tex->format,
+ image->x, image->y, image->width, image->height );
+
+ /* Make a copy of some parameters in case we have to
+ * update them for a multi-pass texture blit.
+ */
+ height = image->height;
+ data = (const u8 *)image->data;
+
+ size = height * blit_width;
+
+ if ( size > RADEON_MAX_TEXTURE_SIZE ) {
+ height = RADEON_MAX_TEXTURE_SIZE / blit_width;
+ size = height * blit_width;
+ } else if ( size < 4 && size > 0 ) {
+ size = 4;
+ } else if ( size == 0 ) {
+ return 0;
+ }
+
+ buf = radeon_freelist_get( dev );
+ if ( 0 && !buf ) {
+ radeon_do_cp_idle( dev_priv );
+ buf = radeon_freelist_get( dev );
+ }
+ if ( !buf ) {
+ DRM_DEBUG("radeon_cp_dispatch_texture: EAGAIN\n");
+ DRM_COPY_TO_USER( tex->image, image, sizeof(*image) );
+ return DRM_ERR(EAGAIN);
+ }
+
+
+ /* Dispatch the indirect buffer.
+ */
+ buffer = (u32*)((char*)dev_priv->buffers->handle + buf->offset);
+ dwords = size / 4;
+ buffer[0] = CP_PACKET3( RADEON_CNTL_HOSTDATA_BLT, dwords + 6 );
+ buffer[1] = (RADEON_GMC_DST_PITCH_OFFSET_CNTL |
+ RADEON_GMC_BRUSH_NONE |
+ (format << 8) |
+ RADEON_GMC_SRC_DATATYPE_COLOR |
+ RADEON_ROP3_S |
+ RADEON_DP_SRC_SOURCE_HOST_DATA |
+ RADEON_GMC_CLR_CMP_CNTL_DIS |
+ RADEON_GMC_WR_MSK_DIS);
+
+ buffer[2] = (tex->pitch << 22) | (tex->offset >> 10);
+ buffer[3] = 0xffffffff;
+ buffer[4] = 0xffffffff;
+ buffer[5] = (image->y << 16) | image->x;
+ buffer[6] = (height << 16) | image->width;
+ buffer[7] = dwords;
+ buffer += 8;
+
+ if ( tex_width >= 32 ) {
+ /* Texture image width is larger than the minimum, so we
+ * can upload it directly.
+ */
+ if ( DRM_COPY_FROM_USER( buffer, data,
+ dwords * sizeof(u32) ) ) {
+ DRM_ERROR( "EFAULT on data, %d dwords\n",
+ dwords );
+ return DRM_ERR(EFAULT);
+ }
+ } else {
+ /* Texture image width is less than the minimum, so we
+ * need to pad out each image scanline to the minimum
+ * width.
+ */
+ for ( i = 0 ; i < tex->height ; i++ ) {
+ if ( DRM_COPY_FROM_USER( buffer, data,
+ tex_width ) ) {
+ DRM_ERROR( "EFAULT on pad, %d bytes\n",
+ tex_width );
+ return DRM_ERR(EFAULT);
+ }
+ buffer += 8;
+ data += tex_width;
+ }
+ }
+
+ buf->pid = DRM_CURRENTPID;
+ buf->used = (dwords + 8) * sizeof(u32);
+ radeon_cp_dispatch_indirect( dev, buf, 0, buf->used );
+ radeon_cp_discard_buffer( dev, buf );
+
+ /* Update the input parameters for next time */
+ image->y += height;
+ image->height -= height;
+ (const u8 *)image->data += size;
+ } while (image->height > 0);
+
+ /* Flush the pixel cache after the blit completes. This ensures
+ * the texture data is written out to memory before rendering
+ * continues.
+ */
+ BEGIN_RING( 4 );
+ RADEON_FLUSH_CACHE();
+ RADEON_WAIT_UNTIL_2D_IDLE();
+ ADVANCE_RING();
+ return 0;
+}
+
+
+static void radeon_cp_dispatch_stipple( drm_device_t *dev, u32 *stipple )
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ int i;
+ RING_LOCALS;
+ DRM_DEBUG( "\n" );
+
+ BEGIN_RING( 35 );
+
+ OUT_RING( CP_PACKET0( RADEON_RE_STIPPLE_ADDR, 0 ) );
+ OUT_RING( 0x00000000 );
+
+ OUT_RING( CP_PACKET0_TABLE( RADEON_RE_STIPPLE_DATA, 31 ) );
+ for ( i = 0 ; i < 32 ; i++ ) {
+ OUT_RING( stipple[i] );
+ }
+
+ ADVANCE_RING();
+}
+
+
+/* ================================================================
+ * IOCTL functions
+ */
+
+int radeon_cp_clear( DRM_IOCTL_ARGS )
+{
+ DRM_DEVICE;
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ drm_radeon_clear_t clear;
+ drm_radeon_clear_rect_t depth_boxes[RADEON_NR_SAREA_CLIPRECTS];
+ DRM_DEBUG( "\n" );
+
+ LOCK_TEST_WITH_RETURN( dev );
+
+ DRM_COPY_FROM_USER_IOCTL( clear, (drm_radeon_clear_t *)data,
+ sizeof(clear) );
+
+ RING_SPACE_TEST_WITH_RETURN( dev_priv );
+
+ if ( sarea_priv->nbox > RADEON_NR_SAREA_CLIPRECTS )
+ sarea_priv->nbox = RADEON_NR_SAREA_CLIPRECTS;
+
+ if ( DRM_COPY_FROM_USER( &depth_boxes, clear.depth_boxes,
+ sarea_priv->nbox * sizeof(depth_boxes[0]) ) )
+ return DRM_ERR(EFAULT);
+
+ radeon_cp_dispatch_clear( dev, &clear, depth_boxes );
+
+ COMMIT_RING();
+ return 0;
+}
+
+
+/* Not sure why this isn't set all the time:
+ */
+static int radeon_do_init_pageflip( drm_device_t *dev )
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ RING_LOCALS;
+
+ DRM_DEBUG( "\n" );
+
+ BEGIN_RING( 6 );
+ RADEON_WAIT_UNTIL_3D_IDLE();
+ OUT_RING( CP_PACKET0( RADEON_CRTC_OFFSET_CNTL, 0 ) );
+ OUT_RING( RADEON_READ( RADEON_CRTC_OFFSET_CNTL ) | RADEON_CRTC_OFFSET_FLIP_CNTL );
+ OUT_RING( CP_PACKET0( RADEON_CRTC2_OFFSET_CNTL, 0 ) );
+ OUT_RING( RADEON_READ( RADEON_CRTC2_OFFSET_CNTL ) | RADEON_CRTC_OFFSET_FLIP_CNTL );
+ ADVANCE_RING();
+
+ dev_priv->page_flipping = 1;
+ dev_priv->current_page = 0;
+ dev_priv->sarea_priv->pfCurrentPage = dev_priv->current_page;
+
+ return 0;
+}
+
+/* Called whenever a client dies, from DRM(release).
+ * NOTE: Lock isn't necessarily held when this is called!
+ */
+int radeon_do_cleanup_pageflip( drm_device_t *dev )
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ DRM_DEBUG( "\n" );
+
+ if (dev_priv->current_page != 0)
+ radeon_cp_dispatch_flip( dev );
+
+ dev_priv->page_flipping = 0;
+ return 0;
+}
+
+/* Swapping and flipping are different operations, need different ioctls.
+ * They can & should be intermixed to support multiple 3d windows.
+ */
+int radeon_cp_flip( DRM_IOCTL_ARGS )
+{
+ DRM_DEVICE;
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ DRM_DEBUG( "\n" );
+
+ LOCK_TEST_WITH_RETURN( dev );
+
+ RING_SPACE_TEST_WITH_RETURN( dev_priv );
+
+ if (!dev_priv->page_flipping)
+ radeon_do_init_pageflip( dev );
+
+ radeon_cp_dispatch_flip( dev );
+
+ COMMIT_RING();
+ return 0;
+}
+
+int radeon_cp_swap( DRM_IOCTL_ARGS )
+{
+ DRM_DEVICE;
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ DRM_DEBUG( "\n" );
+
+ LOCK_TEST_WITH_RETURN( dev );
+
+ RING_SPACE_TEST_WITH_RETURN( dev_priv );
+
+ if ( sarea_priv->nbox > RADEON_NR_SAREA_CLIPRECTS )
+ sarea_priv->nbox = RADEON_NR_SAREA_CLIPRECTS;
+
+ radeon_cp_dispatch_swap( dev );
+ dev_priv->sarea_priv->ctx_owner = 0;
+
+ COMMIT_RING();
+ return 0;
+}
+
+int radeon_cp_vertex( DRM_IOCTL_ARGS )
+{
+ DRM_DEVICE;
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ drm_device_dma_t *dma = dev->dma;
+ drm_buf_t *buf;
+ drm_radeon_vertex_t vertex;
+ drm_radeon_tcl_prim_t prim;
+
+ LOCK_TEST_WITH_RETURN( dev );
+
+ if ( !dev_priv ) {
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
+ return DRM_ERR(EINVAL);
+ }
+
+ DRM_COPY_FROM_USER_IOCTL( vertex, (drm_radeon_vertex_t *)data,
+ sizeof(vertex) );
+
+ DRM_DEBUG( "pid=%d index=%d count=%d discard=%d\n",
+ DRM_CURRENTPID,
+ vertex.idx, vertex.count, vertex.discard );
+
+ if ( vertex.idx < 0 || vertex.idx >= dma->buf_count ) {
+ DRM_ERROR( "buffer index %d (of %d max)\n",
+ vertex.idx, dma->buf_count - 1 );
+ return DRM_ERR(EINVAL);
+ }
+ if ( vertex.prim < 0 ||
+ vertex.prim > RADEON_PRIM_TYPE_3VRT_LINE_LIST ) {
+ DRM_ERROR( "buffer prim %d\n", vertex.prim );
+ return DRM_ERR(EINVAL);
+ }
+
+ RING_SPACE_TEST_WITH_RETURN( dev_priv );
+ VB_AGE_TEST_WITH_RETURN( dev_priv );
+
+ buf = dma->buflist[vertex.idx];
+
+ if ( buf->pid != DRM_CURRENTPID ) {
+ DRM_ERROR( "process %d using buffer owned by %d\n",
+ DRM_CURRENTPID, buf->pid );
+ return DRM_ERR(EINVAL);
+ }
+ if ( buf->pending ) {
+ DRM_ERROR( "sending pending buffer %d\n", vertex.idx );
+ return DRM_ERR(EINVAL);
+ }
+
+ /* Build up a prim_t record:
+ */
+ if (vertex.count) {
+ buf->used = vertex.count; /* not used? */
+
+ if ( sarea_priv->dirty & ~RADEON_UPLOAD_CLIPRECTS ) {
+ radeon_emit_state( dev_priv,
+ &sarea_priv->context_state,
+ sarea_priv->tex_state,
+ sarea_priv->dirty );
+
+ sarea_priv->dirty &= ~(RADEON_UPLOAD_TEX0IMAGES |
+ RADEON_UPLOAD_TEX1IMAGES |
+ RADEON_UPLOAD_TEX2IMAGES |
+ RADEON_REQUIRE_QUIESCENCE);
+ }
+
+ prim.start = 0;
+ prim.finish = vertex.count; /* unused */
+ prim.prim = vertex.prim;
+ prim.numverts = vertex.count;
+ prim.vc_format = dev_priv->sarea_priv->vc_format;
+
+ radeon_cp_dispatch_vertex( dev, buf, &prim,
+ dev_priv->sarea_priv->boxes,
+ dev_priv->sarea_priv->nbox );
+ }
+
+ if (vertex.discard) {
+ radeon_cp_discard_buffer( dev, buf );
+ }
+
+ COMMIT_RING();
+ return 0;
+}
+
+int radeon_cp_indices( DRM_IOCTL_ARGS )
+{
+ DRM_DEVICE;
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ drm_device_dma_t *dma = dev->dma;
+ drm_buf_t *buf;
+ drm_radeon_indices_t elts;
+ drm_radeon_tcl_prim_t prim;
+ int count;
+
+ LOCK_TEST_WITH_RETURN( dev );
+
+ if ( !dev_priv ) {
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
+ return DRM_ERR(EINVAL);
+ }
+
+ DRM_COPY_FROM_USER_IOCTL( elts, (drm_radeon_indices_t *)data,
+ sizeof(elts) );
+
+ DRM_DEBUG( "pid=%d index=%d start=%d end=%d discard=%d\n",
+ DRM_CURRENTPID,
+ elts.idx, elts.start, elts.end, elts.discard );
+
+ if ( elts.idx < 0 || elts.idx >= dma->buf_count ) {
+ DRM_ERROR( "buffer index %d (of %d max)\n",
+ elts.idx, dma->buf_count - 1 );
+ return DRM_ERR(EINVAL);
+ }
+ if ( elts.prim < 0 ||
+ elts.prim > RADEON_PRIM_TYPE_3VRT_LINE_LIST ) {
+ DRM_ERROR( "buffer prim %d\n", elts.prim );
+ return DRM_ERR(EINVAL);
+ }
+
+ RING_SPACE_TEST_WITH_RETURN( dev_priv );
+ VB_AGE_TEST_WITH_RETURN( dev_priv );
+
+ buf = dma->buflist[elts.idx];
+
+ if ( buf->pid != DRM_CURRENTPID ) {
+ DRM_ERROR( "process %d using buffer owned by %d\n",
+ DRM_CURRENTPID, buf->pid );
+ return DRM_ERR(EINVAL);
+ }
+ if ( buf->pending ) {
+ DRM_ERROR( "sending pending buffer %d\n", elts.idx );
+ return DRM_ERR(EINVAL);
+ }
+
+ count = (elts.end - elts.start) / sizeof(u16);
+ elts.start -= RADEON_INDEX_PRIM_OFFSET;
+
+ if ( elts.start & 0x7 ) {
+ DRM_ERROR( "misaligned buffer 0x%x\n", elts.start );
+ return DRM_ERR(EINVAL);
+ }
+ if ( elts.start < buf->used ) {
+ DRM_ERROR( "no header 0x%x - 0x%x\n", elts.start, buf->used );
+ return DRM_ERR(EINVAL);
+ }
+
+ buf->used = elts.end;
+
+ if ( sarea_priv->dirty & ~RADEON_UPLOAD_CLIPRECTS ) {
+ radeon_emit_state( dev_priv,
+ &sarea_priv->context_state,
+ sarea_priv->tex_state,
+ sarea_priv->dirty );
+
+ sarea_priv->dirty &= ~(RADEON_UPLOAD_TEX0IMAGES |
+ RADEON_UPLOAD_TEX1IMAGES |
+ RADEON_UPLOAD_TEX2IMAGES |
+ RADEON_REQUIRE_QUIESCENCE);
+ }
+
+
+ /* Build up a prim_t record:
+ */
+ prim.start = elts.start;
+ prim.finish = elts.end;
+ prim.prim = elts.prim;
+ prim.offset = 0; /* offset from start of dma buffers */
+ prim.numverts = RADEON_MAX_VB_VERTS; /* duh */
+ prim.vc_format = dev_priv->sarea_priv->vc_format;
+
+ radeon_cp_dispatch_indices( dev, buf, &prim,
+ dev_priv->sarea_priv->boxes,
+ dev_priv->sarea_priv->nbox );
+ if (elts.discard) {
+ radeon_cp_discard_buffer( dev, buf );
+ }
+
+ COMMIT_RING();
+ return 0;
+}
+
+int radeon_cp_texture( DRM_IOCTL_ARGS )
+{
+ DRM_DEVICE;
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_radeon_texture_t tex;
+ drm_radeon_tex_image_t image;
+ int ret;
+
+ LOCK_TEST_WITH_RETURN( dev );
+
+ DRM_COPY_FROM_USER_IOCTL( tex, (drm_radeon_texture_t *)data, sizeof(tex) );
+
+ if ( tex.image == NULL ) {
+ DRM_ERROR( "null texture image!\n" );
+ return DRM_ERR(EINVAL);
+ }
+
+ if ( DRM_COPY_FROM_USER( &image,
+ (drm_radeon_tex_image_t *)tex.image,
+ sizeof(image) ) )
+ return DRM_ERR(EFAULT);
+
+ RING_SPACE_TEST_WITH_RETURN( dev_priv );
+ VB_AGE_TEST_WITH_RETURN( dev_priv );
+
+ ret = radeon_cp_dispatch_texture( dev, &tex, &image );
+
+ COMMIT_RING();
+ return ret;
+}
+
+int radeon_cp_stipple( DRM_IOCTL_ARGS )
+{
+ DRM_DEVICE;
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_radeon_stipple_t stipple;
+ u32 mask[32];
+
+ LOCK_TEST_WITH_RETURN( dev );
+
+ DRM_COPY_FROM_USER_IOCTL( stipple, (drm_radeon_stipple_t *)data,
+ sizeof(stipple) );
+
+ if ( DRM_COPY_FROM_USER( &mask, stipple.mask, 32 * sizeof(u32) ) )
+ return DRM_ERR(EFAULT);
+
+ RING_SPACE_TEST_WITH_RETURN( dev_priv );
+
+ radeon_cp_dispatch_stipple( dev, mask );
+
+ COMMIT_RING();
+ return 0;
+}
+
+int radeon_cp_indirect( DRM_IOCTL_ARGS )
+{
+ DRM_DEVICE;
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_device_dma_t *dma = dev->dma;
+ drm_buf_t *buf;
+ drm_radeon_indirect_t indirect;
+ RING_LOCALS;
+
+ LOCK_TEST_WITH_RETURN( dev );
+
+ if ( !dev_priv ) {
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
+ return DRM_ERR(EINVAL);
+ }
+
+ DRM_COPY_FROM_USER_IOCTL( indirect, (drm_radeon_indirect_t *)data,
+ sizeof(indirect) );
+
+ DRM_DEBUG( "indirect: idx=%d s=%d e=%d d=%d\n",
+ indirect.idx, indirect.start,
+ indirect.end, indirect.discard );
+
+ if ( indirect.idx < 0 || indirect.idx >= dma->buf_count ) {
+ DRM_ERROR( "buffer index %d (of %d max)\n",
+ indirect.idx, dma->buf_count - 1 );
+ return DRM_ERR(EINVAL);
+ }
+
+ buf = dma->buflist[indirect.idx];
+
+ if ( buf->pid != DRM_CURRENTPID ) {
+ DRM_ERROR( "process %d using buffer owned by %d\n",
+ DRM_CURRENTPID, buf->pid );
+ return DRM_ERR(EINVAL);
+ }
+ if ( buf->pending ) {
+ DRM_ERROR( "sending pending buffer %d\n", indirect.idx );
+ return DRM_ERR(EINVAL);
+ }
+
+ if ( indirect.start < buf->used ) {
+ DRM_ERROR( "reusing indirect: start=0x%x actual=0x%x\n",
+ indirect.start, buf->used );
+ return DRM_ERR(EINVAL);
+ }
+
+ RING_SPACE_TEST_WITH_RETURN( dev_priv );
+ VB_AGE_TEST_WITH_RETURN( dev_priv );
+
+ buf->used = indirect.end;
+
+ /* Wait for the 3D stream to idle before the indirect buffer
+ * containing 2D acceleration commands is processed.
+ */
+ BEGIN_RING( 2 );
+
+ RADEON_WAIT_UNTIL_3D_IDLE();
+
+ ADVANCE_RING();
+
+ /* Dispatch the indirect buffer full of commands from the
+ * X server. This is insecure and is thus only available to
+ * privileged clients.
+ */
+ radeon_cp_dispatch_indirect( dev, buf, indirect.start, indirect.end );
+ if (indirect.discard) {
+ radeon_cp_discard_buffer( dev, buf );
+ }
+
+
+ COMMIT_RING();
+ return 0;
+}
+
+int radeon_cp_vertex2( DRM_IOCTL_ARGS )
+{
+ DRM_DEVICE;
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ drm_device_dma_t *dma = dev->dma;
+ drm_buf_t *buf;
+ drm_radeon_vertex2_t vertex;
+ int i;
+ unsigned char laststate;
+
+ LOCK_TEST_WITH_RETURN( dev );
+
+ if ( !dev_priv ) {
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
+ return DRM_ERR(EINVAL);
+ }
+
+ DRM_COPY_FROM_USER_IOCTL( vertex, (drm_radeon_vertex2_t *)data,
+ sizeof(vertex) );
+
+ DRM_DEBUG( "pid=%d index=%d discard=%d\n",
+ DRM_CURRENTPID,
+ vertex.idx, vertex.discard );
+
+ if ( vertex.idx < 0 || vertex.idx >= dma->buf_count ) {
+ DRM_ERROR( "buffer index %d (of %d max)\n",
+ vertex.idx, dma->buf_count - 1 );
+ return DRM_ERR(EINVAL);
+ }
+
+ RING_SPACE_TEST_WITH_RETURN( dev_priv );
+ VB_AGE_TEST_WITH_RETURN( dev_priv );
+
+ buf = dma->buflist[vertex.idx];
+
+ if ( buf->pid != DRM_CURRENTPID ) {
+ DRM_ERROR( "process %d using buffer owned by %d\n",
+ DRM_CURRENTPID, buf->pid );
+ return DRM_ERR(EINVAL);
+ }
+
+ if ( buf->pending ) {
+ DRM_ERROR( "sending pending buffer %d\n", vertex.idx );
+ return DRM_ERR(EINVAL);
+ }
+
+ if (sarea_priv->nbox > RADEON_NR_SAREA_CLIPRECTS)
+ return DRM_ERR(EINVAL);
+
+ for (laststate = 0xff, i = 0 ; i < vertex.nr_prims ; i++) {
+ drm_radeon_prim_t prim;
+ drm_radeon_tcl_prim_t tclprim;
+
+ if ( DRM_COPY_FROM_USER( &prim, &vertex.prim[i], sizeof(prim) ) )
+ return DRM_ERR(EFAULT);
+
+ if ( prim.stateidx != laststate ) {
+ drm_radeon_state_t state;
+
+ if ( DRM_COPY_FROM_USER( &state,
+ &vertex.state[prim.stateidx],
+ sizeof(state) ) )
+ return DRM_ERR(EFAULT);
+
+ radeon_emit_state2( dev_priv, &state );
+
+ laststate = prim.stateidx;
+ }
+
+ tclprim.start = prim.start;
+ tclprim.finish = prim.finish;
+ tclprim.prim = prim.prim;
+ tclprim.vc_format = prim.vc_format;
+
+ if ( prim.prim & RADEON_PRIM_WALK_IND ) {
+ tclprim.offset = prim.numverts * 64;
+ tclprim.numverts = RADEON_MAX_VB_VERTS; /* duh */
+
+ radeon_cp_dispatch_indices( dev, buf, &tclprim,
+ sarea_priv->boxes,
+ sarea_priv->nbox);
+ } else {
+ tclprim.numverts = prim.numverts;
+ tclprim.offset = 0; /* not used */
+
+ radeon_cp_dispatch_vertex( dev, buf, &tclprim,
+ sarea_priv->boxes,
+ sarea_priv->nbox);
+ }
+
+ if (sarea_priv->nbox == 1)
+ sarea_priv->nbox = 0;
+ }
+
+ if ( vertex.discard ) {
+ radeon_cp_discard_buffer( dev, buf );
+ }
+
+ COMMIT_RING();
+ return 0;
+}
+
+
+static int radeon_emit_packets(
+ drm_radeon_private_t *dev_priv,
+ drm_radeon_cmd_header_t header,
+ drm_radeon_cmd_buffer_t *cmdbuf )
+{
+ int id = (int)header.packet.packet_id;
+ int sz, reg;
+ int *data = (int *)cmdbuf->buf;
+ RING_LOCALS;
+
+ if (id >= RADEON_MAX_STATE_PACKETS)
+ return DRM_ERR(EINVAL);
+
+ sz = packet[id].len;
+ reg = packet[id].start;
+
+ if (sz * sizeof(int) > cmdbuf->bufsz)
+ return DRM_ERR(EINVAL);
+
+ BEGIN_RING(sz+1);
+ OUT_RING( CP_PACKET0( reg, (sz-1) ) );
+ OUT_RING_USER_TABLE( data, sz );
+ ADVANCE_RING();
+
+ cmdbuf->buf += sz * sizeof(int);
+ cmdbuf->bufsz -= sz * sizeof(int);
+ return 0;
+}
+
+static __inline__ int radeon_emit_scalars(
+ drm_radeon_private_t *dev_priv,
+ drm_radeon_cmd_header_t header,
+ drm_radeon_cmd_buffer_t *cmdbuf )
+{
+ int sz = header.scalars.count;
+ int *data = (int *)cmdbuf->buf;
+ int start = header.scalars.offset;
+ int stride = header.scalars.stride;
+ RING_LOCALS;
+
+ BEGIN_RING( 3+sz );
+ OUT_RING( CP_PACKET0( RADEON_SE_TCL_SCALAR_INDX_REG, 0 ) );
+ OUT_RING( start | (stride << RADEON_SCAL_INDX_DWORD_STRIDE_SHIFT));
+ OUT_RING( CP_PACKET0_TABLE( RADEON_SE_TCL_SCALAR_DATA_REG, sz-1 ) );
+ OUT_RING_USER_TABLE( data, sz );
+ ADVANCE_RING();
+ cmdbuf->buf += sz * sizeof(int);
+ cmdbuf->bufsz -= sz * sizeof(int);
+ return 0;
+}
+
+/* God this is ugly
+ */
+static __inline__ int radeon_emit_scalars2(
+ drm_radeon_private_t *dev_priv,
+ drm_radeon_cmd_header_t header,
+ drm_radeon_cmd_buffer_t *cmdbuf )
+{
+ int sz = header.scalars.count;
+ int *data = (int *)cmdbuf->buf;
+ int start = ((unsigned int)header.scalars.offset) + 0x100;
+ int stride = header.scalars.stride;
+ RING_LOCALS;
+
+ BEGIN_RING( 3+sz );
+ OUT_RING( CP_PACKET0( RADEON_SE_TCL_SCALAR_INDX_REG, 0 ) );
+ OUT_RING( start | (stride << RADEON_SCAL_INDX_DWORD_STRIDE_SHIFT));
+ OUT_RING( CP_PACKET0_TABLE( RADEON_SE_TCL_SCALAR_DATA_REG, sz-1 ) );
+ OUT_RING_USER_TABLE( data, sz );
+ ADVANCE_RING();
+ cmdbuf->buf += sz * sizeof(int);
+ cmdbuf->bufsz -= sz * sizeof(int);
+ return 0;
+}
+
+static __inline__ int radeon_emit_vectors(
+ drm_radeon_private_t *dev_priv,
+ drm_radeon_cmd_header_t header,
+ drm_radeon_cmd_buffer_t *cmdbuf )
+{
+ int sz = header.vectors.count;
+ int *data = (int *)cmdbuf->buf;
+ int start = header.vectors.offset;
+ int stride = header.vectors.stride;
+ RING_LOCALS;
+
+ BEGIN_RING( 3+sz );
+ OUT_RING( CP_PACKET0( RADEON_SE_TCL_VECTOR_INDX_REG, 0 ) );
+ OUT_RING( start | (stride << RADEON_VEC_INDX_OCTWORD_STRIDE_SHIFT));
+ OUT_RING( CP_PACKET0_TABLE( RADEON_SE_TCL_VECTOR_DATA_REG, (sz-1) ) );
+ OUT_RING_USER_TABLE( data, sz );
+ ADVANCE_RING();
+
+ cmdbuf->buf += sz * sizeof(int);
+ cmdbuf->bufsz -= sz * sizeof(int);
+ return 0;
+}
+
+
+static int radeon_emit_packet3( drm_device_t *dev,
+ drm_radeon_cmd_buffer_t *cmdbuf )
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ int cmdsz, tmp;
+ int *cmd = (int *)cmdbuf->buf;
+ RING_LOCALS;
+
+
+ DRM_DEBUG("\n");
+
+ if (DRM_GET_USER_UNCHECKED( tmp, &cmd[0]))
+ return DRM_ERR(EFAULT);
+
+ cmdsz = 2 + ((tmp & RADEON_CP_PACKET_COUNT_MASK) >> 16);
+
+ if ((tmp & 0xc0000000) != RADEON_CP_PACKET3 ||
+ cmdsz * 4 > cmdbuf->bufsz)
+ return DRM_ERR(EINVAL);
+
+ BEGIN_RING( cmdsz );
+ OUT_RING_USER_TABLE( cmd, cmdsz );
+ ADVANCE_RING();
+
+ cmdbuf->buf += cmdsz * 4;
+ cmdbuf->bufsz -= cmdsz * 4;
+ return 0;
+}
+
+
+static int radeon_emit_packet3_cliprect( drm_device_t *dev,
+ drm_radeon_cmd_buffer_t *cmdbuf,
+ int orig_nbox )
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_clip_rect_t box;
+ int cmdsz, tmp;
+ int *cmd = (int *)cmdbuf->buf;
+ drm_clip_rect_t *boxes = cmdbuf->boxes;
+ int i = 0;
+ RING_LOCALS;
+
+ DRM_DEBUG("\n");
+
+ if (DRM_GET_USER_UNCHECKED( tmp, &cmd[0]))
+ return DRM_ERR(EFAULT);
+
+ cmdsz = 2 + ((tmp & RADEON_CP_PACKET_COUNT_MASK) >> 16);
+
+ if ((tmp & 0xc0000000) != RADEON_CP_PACKET3 ||
+ cmdsz * 4 > cmdbuf->bufsz)
+ return DRM_ERR(EINVAL);
+
+ if (!orig_nbox)
+ goto out;
+
+ do {
+ if ( i < cmdbuf->nbox ) {
+ if (DRM_COPY_FROM_USER_UNCHECKED( &box, &boxes[i], sizeof(box) ))
+ return DRM_ERR(EFAULT);
+ /* FIXME The second and subsequent times round
+ * this loop, send a WAIT_UNTIL_3D_IDLE before
+ * calling emit_clip_rect(). This fixes a
+ * lockup on fast machines when sending
+ * several cliprects with a cmdbuf, as when
+ * waving a 2D window over a 3D
+ * window. Something in the commands from user
+ * space seems to hang the card when they're
+ * sent several times in a row. That would be
+ * the correct place to fix it but this works
+ * around it until I can figure that out - Tim
+ * Smith */
+ if ( i ) {
+ BEGIN_RING( 2 );
+ RADEON_WAIT_UNTIL_3D_IDLE();
+ ADVANCE_RING();
+ }
+ radeon_emit_clip_rect( dev_priv, &box );
+ }
+
+ BEGIN_RING( cmdsz );
+ OUT_RING_USER_TABLE( cmd, cmdsz );
+ ADVANCE_RING();
+
+ } while ( ++i < cmdbuf->nbox );
+ if (cmdbuf->nbox == 1)
+ cmdbuf->nbox = 0;
+
+ out:
+ cmdbuf->buf += cmdsz * 4;
+ cmdbuf->bufsz -= cmdsz * 4;
+ return 0;
+}
+
+
+static int radeon_emit_wait( drm_device_t *dev, int flags )
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ RING_LOCALS;
+
+ DRM_DEBUG("%s: %x\n", __FUNCTION__, flags);
+ switch (flags) {
+ case RADEON_WAIT_2D:
+ BEGIN_RING( 2 );
+ RADEON_WAIT_UNTIL_2D_IDLE();
+ ADVANCE_RING();
+ break;
+ case RADEON_WAIT_3D:
+ BEGIN_RING( 2 );
+ RADEON_WAIT_UNTIL_3D_IDLE();
+ ADVANCE_RING();
+ break;
+ case RADEON_WAIT_2D|RADEON_WAIT_3D:
+ BEGIN_RING( 2 );
+ RADEON_WAIT_UNTIL_IDLE();
+ ADVANCE_RING();
+ break;
+ default:
+ return DRM_ERR(EINVAL);
+ }
+
+ return 0;
+}
+
+int radeon_cp_cmdbuf( DRM_IOCTL_ARGS )
+{
+ DRM_DEVICE;
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_device_dma_t *dma = dev->dma;
+ drm_buf_t *buf = 0;
+ int idx;
+ drm_radeon_cmd_buffer_t cmdbuf;
+ drm_radeon_cmd_header_t header;
+ int orig_nbox;
+
+ LOCK_TEST_WITH_RETURN( dev );
+
+ if ( !dev_priv ) {
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
+ return DRM_ERR(EINVAL);
+ }
+
+ DRM_COPY_FROM_USER_IOCTL( cmdbuf, (drm_radeon_cmd_buffer_t *)data,
+ sizeof(cmdbuf) );
+
+ RING_SPACE_TEST_WITH_RETURN( dev_priv );
+ VB_AGE_TEST_WITH_RETURN( dev_priv );
+
+
+ if (DRM_VERIFYAREA_READ( cmdbuf.buf, cmdbuf.bufsz ))
+ return DRM_ERR(EFAULT);
+
+ if (cmdbuf.nbox &&
+ DRM_VERIFYAREA_READ(cmdbuf.boxes,
+ cmdbuf.nbox * sizeof(drm_clip_rect_t)))
+ return DRM_ERR(EFAULT);
+
+ orig_nbox = cmdbuf.nbox;
+
+ while ( cmdbuf.bufsz >= sizeof(header) ) {
+
+ if (DRM_GET_USER_UNCHECKED( header.i, (int *)cmdbuf.buf )) {
+ DRM_ERROR("__get_user %p\n", cmdbuf.buf);
+ return DRM_ERR(EFAULT);
+ }
+
+ cmdbuf.buf += sizeof(header);
+ cmdbuf.bufsz -= sizeof(header);
+
+ switch (header.header.cmd_type) {
+ case RADEON_CMD_PACKET:
+ DRM_DEBUG("RADEON_CMD_PACKET\n");
+ if (radeon_emit_packets( dev_priv, header, &cmdbuf )) {
+ DRM_ERROR("radeon_emit_packets failed\n");
+ return DRM_ERR(EINVAL);
+ }
+ break;
+
+ case RADEON_CMD_SCALARS:
+ DRM_DEBUG("RADEON_CMD_SCALARS\n");
+ if (radeon_emit_scalars( dev_priv, header, &cmdbuf )) {
+ DRM_ERROR("radeon_emit_scalars failed\n");
+ return DRM_ERR(EINVAL);
+ }
+ break;
+
+ case RADEON_CMD_VECTORS:
+ DRM_DEBUG("RADEON_CMD_VECTORS\n");
+ if (radeon_emit_vectors( dev_priv, header, &cmdbuf )) {
+ DRM_ERROR("radeon_emit_vectors failed\n");
+ return DRM_ERR(EINVAL);
+ }
+ break;
+
+ case RADEON_CMD_DMA_DISCARD:
+ DRM_DEBUG("RADEON_CMD_DMA_DISCARD\n");
+ idx = header.dma.buf_idx;
+ if ( idx < 0 || idx >= dma->buf_count ) {
+ DRM_ERROR( "buffer index %d (of %d max)\n",
+ idx, dma->buf_count - 1 );
+ return DRM_ERR(EINVAL);
+ }
+
+ buf = dma->buflist[idx];
+ if ( buf->pid != DRM_CURRENTPID || buf->pending ) {
+ DRM_ERROR( "bad buffer\n" );
+ return DRM_ERR(EINVAL);
+ }
+
+ radeon_cp_discard_buffer( dev, buf );
+ break;
+
+ case RADEON_CMD_PACKET3:
+ DRM_DEBUG("RADEON_CMD_PACKET3\n");
+ if (radeon_emit_packet3( dev, &cmdbuf )) {
+ DRM_ERROR("radeon_emit_packet3 failed\n");
+ return DRM_ERR(EINVAL);
+ }
+ break;
+
+ case RADEON_CMD_PACKET3_CLIP:
+ DRM_DEBUG("RADEON_CMD_PACKET3_CLIP\n");
+ if (radeon_emit_packet3_cliprect( dev, &cmdbuf, orig_nbox )) {
+ DRM_ERROR("radeon_emit_packet3_clip failed\n");
+ return DRM_ERR(EINVAL);
+ }
+ break;
+
+ case RADEON_CMD_SCALARS2:
+ DRM_DEBUG("RADEON_CMD_SCALARS2\n");
+ if (radeon_emit_scalars2( dev_priv, header, &cmdbuf )) {
+ DRM_ERROR("radeon_emit_scalars2 failed\n");
+ return DRM_ERR(EINVAL);
+ }
+ break;
+
+ case RADEON_CMD_WAIT:
+ DRM_DEBUG("RADEON_CMD_WAIT\n");
+ if (radeon_emit_wait( dev, header.wait.flags )) {
+ DRM_ERROR("radeon_emit_wait failed\n");
+ return DRM_ERR(EINVAL);
+ }
+ break;
+ default:
+ DRM_ERROR("bad cmd_type %d at %p\n",
+ header.header.cmd_type,
+ cmdbuf.buf - sizeof(header));
+ return DRM_ERR(EINVAL);
+ }
+ }
+
+
+ DRM_DEBUG("DONE\n");
+ COMMIT_RING();
+ return 0;
+}
+
+
+
+int radeon_cp_getparam( DRM_IOCTL_ARGS )
+{
+ DRM_DEVICE;
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_radeon_getparam_t param;
+ int value;
+
+ if ( !dev_priv ) {
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
+ return DRM_ERR(EINVAL);
+ }
+
+ DRM_COPY_FROM_USER_IOCTL( param, (drm_radeon_getparam_t *)data,
+ sizeof(param) );
+
+ DRM_DEBUG( "pid=%d\n", DRM_CURRENTPID );
+
+ switch( param.param ) {
+ case RADEON_PARAM_AGP_BUFFER_OFFSET:
+ value = dev_priv->agp_buffers_offset;
+ break;
+ case RADEON_PARAM_LAST_FRAME:
+ dev_priv->stats.last_frame_reads++;
+ value = GET_SCRATCH( 0 );
+ break;
+ case RADEON_PARAM_LAST_DISPATCH:
+ value = GET_SCRATCH( 1 );
+ break;
+ case RADEON_PARAM_LAST_CLEAR:
+ dev_priv->stats.last_clear_reads++;
+ value = GET_SCRATCH( 2 );
+ break;
+ case RADEON_PARAM_IRQ_NR:
+ value = dev->irq;
+ break;
+ case RADEON_PARAM_AGP_BASE:
+ value = dev_priv->agp_vm_start;
+ break;
+ default:
+ return DRM_ERR(EINVAL);
+ }
+
+ if ( DRM_COPY_TO_USER( param.value, &value, sizeof(int) ) ) {
+ DRM_ERROR( "copy_to_user\n" );
+ return DRM_ERR(EFAULT);
+ }
+
+ return 0;
+}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h b/xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h
index ab9bc798a..4fc6b5d73 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h
@@ -350,6 +350,8 @@ typedef int xf86jmp_buf[20];
#define strerror(i) xf86strerror(i)
#undef strlen
#define strlen(ccp) xf86strlen(ccp)
+#undef strncat
+#define strncat(ccp1,ccp2,I) xf86strncat(ccp1,ccp2,I)
#undef strncmp
#define strncmp(ccp1,ccp2,I) xf86strncmp(ccp1,ccp2,I)
#undef strncasecmp
@@ -366,7 +368,7 @@ typedef int xf86jmp_buf[20];
#define strspn(ccp1,ccp2) xf86strspn(ccp1,ccp2)
#undef strstr
#define strstr(ccp1,ccp2) xf86strstr(ccp1,ccp2)
-#undef srttod
+#undef strtod
#define strtod(ccp,cpp) xf86strtod(ccp,cpp)
#undef strtok
#define strtok(cp,ccp) xf86strtok(cp,ccp)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h b/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h
index c28b5e47a..6ae17f1ff 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h
@@ -220,6 +220,41 @@ typedef struct _drmTextureRegion {
unsigned int age;
} drmTextureRegion, *drmTextureRegionPtr;
+
+typedef struct _drmClipRect {
+ unsigned short x1; /* Upper left: inclusive */
+ unsigned short y1;
+ unsigned short x2; /* Lower right: exclusive */
+ unsigned short y2;
+} drmClipRect, *drmClipRectPtr;
+
+
+typedef enum {
+ DRM_VBLANK_ABSOLUTE = 0x0, /* Wait for specific vblank sequence number */
+ DRM_VBLANK_RELATIVE = 0x1, /* Wait for given number of vblanks */
+ DRM_VBLANK_SIGNAL = 0x40000000 /* Send signal instead of blocking */
+} drmVBlankSeqType;
+
+typedef struct _drmVBlankReq {
+ drmVBlankSeqType type;
+ unsigned int sequence;
+ unsigned long signal;
+} drmVBlankReq, *drmVBlankReqPtr;
+
+typedef struct _drmVBlankReply {
+ drmVBlankSeqType type;
+ unsigned int sequence;
+ long tval_sec;
+ long tval_usec;
+} drmVBlankReply, *drmVBlankReplyPtr;
+
+typedef union _drmVBlank {
+ drmVBlankReq request;
+ drmVBlankReply reply;
+} drmVBlank, *drmVBlankPtr;
+
+
+
#define __drm_dummy_lock(lock) (*(__volatile__ unsigned int *)lock)
#define DRM_LOCK_HELD 0x80000000 /* Hardware lock is held */
@@ -424,6 +459,7 @@ extern int drmAvailable(void);
extern int drmOpen(const char *name, const char *busid);
extern int drmClose(int fd);
extern drmVersionPtr drmGetVersion(int fd);
+extern drmVersionPtr drmGetLibVersion(int fd);
extern void drmFreeVersion(drmVersionPtr);
extern int drmGetMagic(int fd, drmMagicPtr magic);
extern char *drmGetBusid(int fd);
@@ -437,7 +473,13 @@ extern int drmGetClient(int fd, int idx, int *auth, int *pid,
int *uid, unsigned long *magic,
unsigned long *iocs);
extern int drmGetStats(int fd, drmStatsT *stats);
-
+extern int drmCommandNone(int fd, unsigned long drmCommandIndex);
+extern int drmCommandRead(int fd, unsigned long drmCommandIndex,
+ void *data, unsigned long size);
+extern int drmCommandWrite(int fd, unsigned long drmCommandIndex,
+ void *data, unsigned long size);
+extern int drmCommandWriteRead(int fd, unsigned long drmCommandIndex,
+ void *data, unsigned long size);
/* General user-level programmer's API: X server (root) only */
extern void drmFreeBusid(const char *busid);
@@ -526,6 +568,8 @@ extern int drmScatterGatherAlloc(int fd, unsigned long size,
unsigned long *handle);
extern int drmScatterGatherFree(int fd, unsigned long handle);
+extern int drmWaitVBlank(int fd, drmVBlankPtr vbl);
+
/* Support routines */
extern int drmError(int err, const char *label);
extern void *drmMalloc(int size);
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/loadmod.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/loadmod.c
index aedf1d1dc..ef6bfa568 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/loadmod.c
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/loadmod.c
@@ -213,6 +213,7 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(xf86strlen)
SYMFUNC(xf86strncmp)
SYMFUNC(xf86strncasecmp)
+ SYMFUNC(xf86strncat)
SYMFUNC(xf86strncpy)
SYMFUNC(xf86strpbrk)
SYMFUNC(xf86strchr)